query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Does the product have the feature? | function product_has_feature( $result, $product_id, $options=array() ) {
// Does this product type support this feature?
if ( false === $this->product_supports_feature( false, $product_id, $options ) )
return false;
// If it does support, does it have it?
return (boolean) $this->get_feature( false, $product_id, $options );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function product_has_feature( $result, $product_id ) {\n\t\t// Does this product type support this feature?\n\t\tif ( false === $this->product_supports_feature( false, $product_id ) )\n\t\t\treturn false;\n\t\treturn (boolean) $this->get_feature( false, $product_id );\n\t}",
"function product_has_feature( $result, $product_id, $options=array() ) {\n\t\t$defaults['setting'] = 'enabled';\n\t\t$options = ITUtility::merge_defaults( $options, $defaults );\n\n\t\t// Does this product type support this feature?\n\t\tif ( false === $this->product_supports_feature( false, $product_id, $options ) )\n\t\t\treturn false;\n\n\t\t// If it does support, does it have it?\n\t\treturn (boolean) $this->get_feature( false, $product_id, $options );\n\t}",
"public function has_feature($feature) {\r\n\t\treturn false;\r\n\t}",
"public static function isFeatureActive(): bool\n {\n //====================================================================//\n // Check if Parameter is Enabled\n if (!isset(Splash::configuration()->PsUseAdvancedDiscounts)) {\n return false;\n }\n if (empty(Splash::configuration()->PsUseAdvancedDiscounts)) {\n return false;\n }\n //====================================================================//\n // Check if Storage Table Exists\n return self::hasStorageTable();\n }",
"function product_supports_feature( $result, $product_id ) {\n\t\t// Does this product type support this feature?\n\t\t$product_type = it_exchange_get_product_type( $product_id );\n\t\tif ( ! it_exchange_product_type_supports_feature( $product_type, 'featured-video' ) )\n\t\t\treturn false;\n\n\t\t// Determine if this product has turned on product availability\n\t\tif ( 'no' == it_exchange_get_product_feature( $product_id, 'featured-video', array( 'setting' => 'enabled' ) ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"function product_supports_feature( $result, $product_id, $options=array() ) {\n\t\t// Does this product type support this feature?\n\t\t$product_type = it_exchange_get_product_type( $product_id );\n\t\tif ( ! it_exchange_product_type_supports_feature( $product_type, 'membership-hierarchy' ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"function product_supports_feature( $result, $product_id ) {\n\t\t// Does this product type support this feature?\n\t\t$product_type = it_exchange_get_product_type( $product_id );\n\t\tif ( ! it_exchange_product_type_supports_feature( $product_type, 'membership-welcome-message' ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public function hasFeatureImage(): bool\n {\n return !empty($this->getFeatureImageId());\n }",
"public function hasFeature($what)\n {\n return in_array($what, $this->_features) || empty($this->_features);\n }",
"public function hasFeaturedProducts() {\r\n $data = $this->getItemData();\r\n if (isset($data['featured_type']) && $data['featured_type']) {\r\n if ($data['featured_type'] == '1') {\r\n if ($this->getFeaturedProducts() && count($this->getFeaturedProducts()))\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public static function isFeatureActive(): bool\n {\n //====================================================================//\n // Check if Parameter is Enabled\n if (!isset(Splash::configuration()->PsUseDiscountsCollector)) {\n return false;\n }\n if (empty(Splash::configuration()->PsUseDiscountsCollector)) {\n return false;\n }\n\n return true;\n }",
"public function can(string $feature): bool;",
"public function supports_feature($feature) {\n\t\treturn in_array($feature, $this->get_supported_features());\n\t}",
"public function has_feature($feature) {\r\n\t\tswitch ($feature) {\r\n\t\t\tcase self::FEATURE_REPLACE:\r\n\t\t\t\treturn true;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function hasGiftCardProduct()\r\n {\r\n $return = false;\r\n \r\n foreach ($this->items as $item) \r\n {\r\n \tif (!empty($item['product']['product_type']) && $item['product']['product_type'] == 'giftcards') \r\n \t{\r\n \t\t$return = true;\r\n \t\tbreak;\r\n \t}\r\n }\r\n \r\n return $return;\r\n }",
"public function is_needed() {\n\t\t$post_types = apply_filters( 'be_product_review_schema_post_types', array( 'post' ) );\n\t\tif( is_singular( $post_types ) ) {\n\t\t\t$display = get_post_meta( $this->context->id, 'be_product_review_include', true );\n\t\t\tif( 'on' === $display ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function webquest_supports($feature) {\r\n switch($feature) {\r\n case FEATURE_MOD_ARCHETYPE: return MOD_ARCHETYPE_RESOURCE;\r\n case FEATURE_GROUPS: return false;\r\n case FEATURE_GROUPINGS: return false;\r\n case FEATURE_GROUPMEMBERSONLY: return true;\r\n case FEATURE_MOD_INTRO: return true;\r\n case FEATURE_COMPLETION_TRACKS_VIEWS: return true;\r\n case FEATURE_GRADE_HAS_GRADE: return true;\r\n case FEATURE_GRADE_OUTCOMES: return false;\r\n case FEATURE_BACKUP_MOODLE2: return true;\r\n case FEATURE_SHOW_DESCRIPTION: return true;\r\n\r\n default: return null;\r\n }\r\n}",
"public function hasOutOfSizeProduct(): bool\n {\n }",
"abstract protected function checkFeature($feature);",
"public function hasProducts()\r\n {\r\n return $this->getTotalQty() != 0;\r\n }",
"function cma_supports($feature) {\n switch($feature) {\n case FEATURE_GROUPS:\n return false;\n case FEATURE_GROUPINGS:\n return false;\n case FEATURE_MOD_INTRO:\n return true;\n case FEATURE_COMPLETION_TRACKS_VIEWS:\n return true;\n case FEATURE_COMPLETION_HAS_RULES:\n return true;\n case FEATURE_GRADE_HAS_GRADE:\n return false;\n case FEATURE_GRADE_OUTCOMES:\n return false;\n case FEATURE_BACKUP_MOODLE2:\n return true;\n case FEATURE_SHOW_DESCRIPTION:\n return true;\n\n default:\n return null;\n }\n}",
"function blended_supports($feature) {\n\tswitch($feature) {\n\t\tcase FEATURE_GROUPS: return false;\n\t\tcase FEATURE_GROUPINGS: return false;\n\t\tcase FEATURE_GROUPMEMBERSONLY: return false;\n\t\tcase FEATURE_MOD_INTRO: return true;\n\t\tcase FEATURE_COMPLETION_TRACKS_VIEWS: return false;\n\t\tcase FEATURE_COMPLETION_HAS_RULES: return false;\n\t\tcase FEATURE_GRADE_HAS_GRADE: return false;\n\t\tcase FEATURE_GRADE_OUTCOMES: return false;\n\t\tcase FEATURE_RATE: return false;\n\t\tcase FEATURE_BACKUP_MOODLE2: return false;\n\t\tcase FEATURE_SHOW_DESCRIPTION: return true;\n\t\tcase FEATURE_PLAGIARISM: return false;\n\n\t\tdefault: return false;\n\t}\n}",
"public function valid() {\n\t\treturn key( $this->features ) !== null;\n\t}",
"function mod_cognitivefactory_supports_feature($feature) {\n assert(1);\n}",
"public static function isProduct($obj)\n {\n return (get_class($obj)=='product')? TRUE : FALSE; \n }",
"public function hasFeaturedItem() {\r\n if ($this->hasFeaturedProducts() || $this->hasFeaturedCategories())\r\n return true;\r\n return false;\r\n }",
"public static function hasApiFeatures()\n {\n return Features::hasApiFeatures();\n }",
"public static function hasProjectBillingFeature()\n {\n return Features::hasProjectBillingFeature();\n }",
"public function isFeatured() : bool\n {\n return $this->featured;\n }",
"private static function is_feature_enabled() {\n\t\t// Checkout signup is feature gated to WooCommerce 4.7 and newer;\n\t\t// uses updated my-account/lost-password screen from 4.7+ for\n\t\t// setting initial password.\n\t\t// This service is feature gated to plugin only, to match the\n\t\t// availability of the Checkout block (feature plugin only).\n\t\treturn Package::is_feature_plugin_build() && defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '4.7', '>=' );\n\t}"
] | [
"0.7987697",
"0.7539154",
"0.753052",
"0.72631514",
"0.72546685",
"0.72545767",
"0.72090995",
"0.7145153",
"0.71040106",
"0.70555633",
"0.69516766",
"0.6945737",
"0.68473417",
"0.68433166",
"0.67851484",
"0.6710007",
"0.6703153",
"0.669615",
"0.6689429",
"0.6681326",
"0.6662372",
"0.6628515",
"0.65951824",
"0.65943515",
"0.6585032",
"0.65843225",
"0.6565836",
"0.65393317",
"0.65286726",
"0.6521058"
] | 0.7683425 | 1 |
Sets any variable in $params[self::ATTRIBUTES] as a property | protected function setAttributes($attributes)
{
foreach($attributes as $attributeName => $attributeValue)
{
$this->$attributeName = $attributeValue;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAttributes(array $attributes);",
"function set($a,$v) { $this->attributes[$a] = $v; }",
"public function setAttributes($attributes);",
"public function set_attributes($data) { \n if (empty($data))\n exit();\n if (is_array($data))\n $this->attributes = $data;\n else\n parse_str($data, $this->attributes);\n foreach ($this->attributes as $name => $value)\n if (property_exists($this, $name))\n $this->$name = $value;\n }",
"public function setAttributes(array $data);",
"protected function SetUpAttributes()\n {\n $this->aAttributes['ean'] = 'ean';\n $this->aAttributes['mpnr'] = 'mpnr';\n }",
"public function preprocessAttributes() {\n foreach ($this->variables as $name => $value) {\n if (strpos($name, 'attributes') !== FALSE && is_array($value)) {\n $this->variables[$name] = new Attribute($value);\n }\n }\n }",
"function set_attributes($attrib)\r\n\t{\r\n\t\t$this->attributes = $attrib;\r\n\t}",
"function __construct($attributes = array()){\n if(count($attributes) > 0){\n \n $this->properties = array_merge($this->properties,$attributes);\n }\n }",
"public function init()\n {\n foreach($this->attributes() as $attribute) {\n $this->$attribute = Settings::get(explode('_', $attribute));\n }\n }",
"public function setAttributes(array $attr)\n\t{\n\t\t$this->_attributes = $attr;\n\t\tphpCAS::log('Forced setting of user masquerading attributes: '\n\t\t\t. serialize($attr));\n\t}",
"public function setCustomAttributes(array $attributes)\n {\n }",
"public function setAttributes($resource, array $attributes);",
"function setAttributes(array $attributes)\n {\n foreach($attributes as $k => $v)\n {\n $this->sf1Token->setAttribute($k, $v);\n }\n }",
"protected function setExposedAttributes($attributes = []) {\n $this->variables->setAttributes($attributes, 'exposed_attributes');\n }",
"function initAttributes($value, $data)\n {\n }",
"protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['guid'] = null;\n\t\t$this->attributes['type'] = null;\n\t\t$this->attributes['subtype'] = null;\n\n\t\t$this->attributes['owner_guid'] = _elgg_services()->session->getLoggedInUserGuid();\n\t\t$this->attributes['container_guid'] = _elgg_services()->session->getLoggedInUserGuid();\n\n\t\t$this->attributes['site_guid'] = null;\n\t\t$this->attributes['access_id'] = ACCESS_PRIVATE;\n\t\t$this->attributes['time_updated'] = null;\n\t\t$this->attributes['last_action'] = null;\n\t\t$this->attributes['enabled'] = \"yes\";\n\t}",
"public function setAttributes() {\n\t\t\n\t\t$this->orderId \t= $_POST['transaction_id'];\n\t\t$this->payee \t= $_POST['merchant_id'];\n\t\t$this->amount \t= $_POST['mb_amount'];\n\t\t$this->status \t= self::STATUS_SUCCESS;\n\n\t\t$payment = Payments::model()->findByPk($this->orderId);\n\n\t\t$this->targetId \t= $payment->target_id;\n\t\t$this->currencyId \t= $payment->currency;\n\t\t\n }",
"public function _setAttributes(array $_attributes = [])\n {\n $this->_attributes = array_merge($this->_attributes(), $_attributes);\n }",
"public function __set($attribute, $value) {}",
"public function setAttributes($attributes)\n {\n $this->attributes = $attributes;\n }",
"protected function defineAttributes() {\n $this->addString('supplierId', true);\n $this->addString('warehouseId', true);\n }",
"public function setFromArray(array $attributes) {\n\t\tforeach ($attributes as $attribute => $value) {\n\t\t\tif (array_key_exists($attribute, $this->data) && is_null($value) === false) {\n\t\t\t\t$this->$attribute = $value;\n\t\t\t}\n\t\t}\n\t}",
"public function setAttributes($attributes)\n {\n $this->attributes = array_merge($this->attributes, $attributes);\n }",
"public function setAttributes(array $attributes) {\n $this->attributes = $attributes;\n }",
"public function setAttributes(array $attributes)\n {\n foreach ($attributes as $name => $value)\n {\n $this->setAttribute($name, $value);\n }\n }",
"public function setAttributes($values)\n\t{\n\t\tforeach($values as $name=>$value)\n\t\t\t$this->_attributes[$name]=$value;\n\t}",
"function apigee_appdashboard_attribute_set($entity, $name, $value, $langcode, $type, $info)\n{\n $name = str_replace(\"attribute_\", '', $name);\n $entity->attributes[$name] = $value;\n}",
"abstract public function setAttribute($value);",
"function set_properties($props){\n $body = array(\n 'person_id' => $this->id\n );\n\n if($props) $body['properties'] = $props;\n\n return $this->GS->exec('/tracking/v1/properties', array(), $body, $this);\n }"
] | [
"0.6738815",
"0.6717394",
"0.6581526",
"0.65412945",
"0.6406285",
"0.6346706",
"0.6316695",
"0.6293054",
"0.62613255",
"0.62504286",
"0.6239757",
"0.6145071",
"0.614059",
"0.6133454",
"0.60311663",
"0.6025182",
"0.60155195",
"0.60024893",
"0.5993678",
"0.5966968",
"0.59388685",
"0.59360963",
"0.5925862",
"0.59104735",
"0.59053075",
"0.59016925",
"0.5885154",
"0.58493817",
"0.5791796",
"0.5789274"
] | 0.6777394 | 0 |
Returns an instance that passes the specified filters and that has the specified class if it exists in the instances array, or false if it doesn't. | static public function instanceInArrayBy( $class, array $filters )
{
if(isset(self::$instances[$class]))
{
foreach(self::$instances[$class] as $instance)
{
foreach($filters as $filter)
{
$thisInstanceOk = true;
$attributeName = $filter[0];
$attributeValue = $filter[1];
if(isset($filter[2]))
{
$operator = $filter[2];
}
else
{
$operator = '===';
}
if(isset($instance->$attributeName))
{
if(!Utils::compare($instance->$attributeName, $attributeValue, $operator))
{
//if this instance doesn't pass the current filter, check next instance
$thisInstanceOk = false;
break;
}
}
else
{
$thisInstanceOk = false;
break;
}
}
if($thisInstanceOk)
{
return $instance;
}
}
$params =
[
self::ATTRIBUTES => []
];
foreach($filters as $filter)
{
$params[self::ATTRIBUTES][$filter[0]] = $filter[1];
}
return self::getInstance(null, $class, $params);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function getInstanceBy( array $filters=null, $class = null )\r\n {\r\n \tif(!isset($class))\r\n \t{\r\n \t\t$class = get_called_class();\r\n \t}\r\n return self::instanceInArrayBy($class, $filters);\r\n }",
"public function accepts($class): bool;",
"public function findInstancesOf($class);",
"final public function instanceOf(string $class): self\n {\n return $this->constraint($this->constraintFactory()->instanceOf($class));\n }",
"private function checkIfInstanceIsSet(string $class, array $injections)\n {\n if (isset(self::$instances[$class]) === true) {\n return self::$instances[$class];\n }\n\n return new $class(...$injections);\n }",
"public function find($filters)\r\n {\r\n $results = array();\r\n foreach ($this as $object) {\r\n foreach ($filters as $attribute => $value) {\r\n if ($object->$attribute != $value) {\r\n continue 2;\r\n }\r\n }\r\n $results[] = $object;\r\n }\r\n return new $this($results, $this->getObjectClass());\r\n }",
"public function supportsClass($class)\n {\n }",
"public function supportsClass();",
"public function is($klass) {}",
"public static function is($instance): bool;",
"public function supportsClass(string $class)\n {\n }",
"protected static function _applyFilters() {\n\t\t$class = get_called_class();\n\t\t$self = $class::_object();\n\n\t\t$inheritance = array(\n\t\t\t'base' => __CLASS__\n\t\t) + $self->inheritance;\n\t\t$self->_inheritance = Inherited::apply($class, $inheritance);\n\n\t\t$class::applyFilter('create', function($self, $params, $chain) {\n\t\t\tif ($entity = $chain->next($self, $params, $chain)) {\n\t\t\t\t$classPath = explode('\\\\', $self);\n\t\t\t\t$entity->class = end($classPath);\n\t\t\t}\n\t\t\treturn $entity;\n\t\t});\n\t}",
"public function hasClass(string $class): bool;",
"static public function instanceInArray($instance)\r\n {\r\n if(array_key_exists(get_class($instance), self::$instances))\r\n {\r\n if(array_key_exists($instance->getId(), self::$instances[get_class($instance)]))\r\n {\r\n return self::$instances[get_class($instance)][$instance->getId()] === $instance;\r\n }\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }",
"public function haveFakeClass($instance) {\r\n $this->scenario->action('haveFakeClass', func_get_args());\r\n if ($this->scenario->running()) {\r\n $result = $this->scenario->runStep();\r\n return new Maybe($result);\r\n }\r\n return new Maybe();\r\n }",
"function instanceOfClass($className)\r\n\t{\r\n\t\treturn is_a($this, $className);\r\n\t}",
"public static function filter_widget( $instance ) {\n\t\tglobal $wp_query;\n\n\t\tif ( empty( $instance['conditions'] ) || empty( $instance['conditions']['rules'] ) )\n\t\t\treturn $instance;\n\n\t\t$condition_result = false;\n\n\t\tforeach ( $instance['conditions']['rules'] as $rule ) {\n\t\t\tswitch ( $rule['major'] ) {\n\t\t\t\tcase 'date':\n\t\t\t\t\tswitch ( $rule['minor'] ) {\n\t\t\t\t\t\tcase '':\n\t\t\t\t\t\t\t$condition_result = is_date();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'month':\n\t\t\t\t\t\t\t$condition_result = is_month();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'day':\n\t\t\t\t\t\t\t$condition_result = is_day();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'year':\n\t\t\t\t\t\t\t$condition_result = is_year();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'page':\n\t\t\t\t\t// Previously hardcoded post type options.\n\t\t\t\t\tif ( 'post' == $rule['minor'] )\n\t\t\t\t\t\t$rule['minor'] = 'post_type-post';\n\t\t\t\t\telse if ( ! $rule['minor'] )\n\t\t\t\t\t\t$rule['minor'] = 'post_type-page';\n\n\t\t\t\t\tswitch ( $rule['minor'] ) {\n\t\t\t\t\t\tcase '404':\n\t\t\t\t\t\t\t$condition_result = is_404();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'search':\n\t\t\t\t\t\t\t$condition_result = is_search();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'archive':\n\t\t\t\t\t\t\t$condition_result = is_archive();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'posts':\n\t\t\t\t\t\t\t$condition_result = $wp_query->is_posts_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'home':\n\t\t\t\t\t\t\t$condition_result = is_home();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'front':\n\t\t\t\t\t\t\tif ( current_theme_supports( 'infinite-scroll' ) )\n\t\t\t\t\t\t\t\t$condition_result = is_front_page();\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$condition_result = is_front_page() && !is_paged();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ( substr( $rule['minor'], 0, 10 ) == 'post_type-' )\n\t\t\t\t\t\t\t\t$condition_result = is_singular( substr( $rule['minor'], 10 ) );\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// $rule['minor'] is a page ID\n\t\t\t\t\t\t\t\t$condition_result = is_page( $rule['minor'] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'tag':\n\t\t\t\t\tif ( ! $rule['minor'] && is_tag() )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( is_singular() && $rule['minor'] && has_tag( $rule['minor'] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$tag = get_tag( $rule['minor'] );\n\n\t\t\t\t\t\tif ( $tag && is_tag( $tag->slug ) )\n\t\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tif ( ! $rule['minor'] && is_category() )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( is_category( $rule['minor'] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( is_singular() && $rule['minor'] && in_array( 'category', get_post_taxonomies() ) && has_category( $rule['minor'] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\tbreak;\n\t\t\t\tcase 'loggedin':\n\t\t\t\t\t$condition_result = is_user_logged_in();\n\t\t\t\t\tif ( 'loggedin' !== $rule['minor'] ) {\n\t\t\t\t\t $condition_result = ! $condition_result;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'author':\n\t\t\t\t\t$post = get_post();\n\t\t\t\t\tif ( ! $rule['minor'] && is_author() )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( $rule['minor'] && is_author( $rule['minor'] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( is_singular() && $rule['minor'] && $rule['minor'] == $post->post_author )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\tbreak;\n\t\t\t\tcase 'role':\n\t\t\t\t\tif( is_user_logged_in() ) {\n\t\t\t\t\t\tglobal $current_user;\n\t\t\t\t\t\tget_currentuserinfo();\n\n\t\t\t\t\t\t$user_roles = $current_user->roles;\n\n\t\t\t\t\t\tif( in_array( $rule['minor'], $user_roles ) ) {\n\t\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$condition_result = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$condition_result = false;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'taxonomy':\n\t\t\t\t\t$term = explode( '_tax_', $rule['minor'] ); // $term[0] = taxonomy name; $term[1] = term id\n\n\t\t\t\t\tif ( isset( $term[1] ) && is_tax( $term[0], $term[1] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( isset( $term[1] ) && is_singular() && $term[1] && has_term( $term[1], $term[0] ) )\n\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\telse if ( is_singular() && $post_id = get_the_ID() ){\n\t\t\t\t\t\t$terms = get_the_terms( $post_id, $rule['minor'] ); // Does post have terms in taxonomy?\n\t\t\t\t\t\tif( $terms & ! is_wp_error( $terms ) ) {\n\t\t\t\t\t\t\t$condition_result = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( $condition_result )\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( ( 'show' == $instance['conditions']['action'] && ! $condition_result ) || ( 'hide' == $instance['conditions']['action'] && $condition_result ) )\n\t\t\treturn false;\n\n\t\treturn $instance;\n\t}",
"function isA($instance, $className)\n {\n return is_a($instance, $className);\n }",
"protected function getFilterInstance() {\n\t\tassert(false);\n\t}",
"public function supportsClass($class)\n {\n // TODO: Implement supportsClass() method.\n }",
"public function supportsClass($class)\n {\n // TODO: Implement supportsClass() method.\n }",
"public function supportsClass($class)\n {\n return true;\n }",
"public function supportsClass($class)\n {\n return true;\n }",
"public function supportsClass($class)\n {\n return true;\n }",
"function supports(\\ReflectionClass $class);",
"public function supportsClass($class)\n {\n return User::class === $class;\n }",
"public function supportsClass($class)\n {\n return User::class === $class;\n }",
"public function supportsClass($class)\n {\n return User::class === $class;\n }",
"public static function instance($class)\r\n { \r\n //instantiate class as necessary\r\n self::create($class); \r\n \r\n //return instance\r\n return self::$instances[$class];\r\n }",
"public static function me() {\n\t\ttry {\n\t\t\t$args = func_get_args();\n\t\t\t$class = array_shift($args);\n\t\t\t$func = array_shift($args);\n\t\t\tif (self::$refresh or !isset(self::$o[$class])) {\n\t\t\t\tself::$o[$class] = new $class;\n\t\t\t}\n\t\t\treturn call_user_func_array(array(self::$o[$class], $func),$args);\n\n\t\t} catch (Exception $e) {\n\t\t\tself::err($e);\n\t\t\tif (!QUIET) die(self::err());\n\t\t\treturn false;\n\t\t}\n\t}"
] | [
"0.7069711",
"0.6138841",
"0.59016615",
"0.589062",
"0.5751855",
"0.56111544",
"0.55581707",
"0.55236477",
"0.5520376",
"0.5388808",
"0.5315502",
"0.5309809",
"0.5295472",
"0.5287651",
"0.5259622",
"0.52322936",
"0.52233046",
"0.5204803",
"0.5190272",
"0.517553",
"0.517553",
"0.5159339",
"0.5159339",
"0.5159339",
"0.51537275",
"0.5150858",
"0.5150858",
"0.5150858",
"0.5149433",
"0.51321065"
] | 0.7357212 | 0 |
Returns true if the passed instance exists in the instances array | static public function instanceInArray($instance)
{
if(array_key_exists(get_class($instance), self::$instances))
{
if(array_key_exists($instance->getId(), self::$instances[get_class($instance)]))
{
return self::$instances[get_class($instance)][$instance->getId()] === $instance;
}
}
else
{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function hasInstance(): bool\n {\n $self = get_called_class();\n\n return isset(self::$instances[$self]);\n }",
"public static function is($instance): bool;",
"public static function has( $key )\n\t{\n\t\treturn isset( self::$instances[ $key ] );\n\t}",
"public static function hasInstance()\n {\n return (static::$instance instanceof PluginChain);\n }",
"function has(string $key, string $redisInstance = DEFAULT_INSTANCE): bool\n{\n $redis = Container\\get($redisInstance);\n return $redis->exists($key) > 0;\n}",
"public function has($id): bool {\n return (false!= isset($this->instancesContainer[$id]));\n }",
"public function has_instance() {\n return $this->instance || $this->get_course_module();\n }",
"protected static function baseObjectExistsInArray($class)\r\n {\r\n return (isset(self::$instances[$class][self::BASE_OBJECT_ID]));\r\n }",
"public function exists_in_database ()\n {\n $storage = $this->_make_storage ();\n return $storage->object_exists ($this);\n }",
"final public static function isInstancied() {\n return (bool) self::$instance;\n }",
"public function isExists() {\n }",
"public function exists() {\n\t\treturn $this -> exists;\n\t}",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function exists();",
"public function isInstance( $value )\n {\n return ( $this->_class && $this->_class->isInstance($value) ) ||\n ( $this->isAssignableFrom(self::of($value)) );\n }",
"function isA($instance, $className)\n {\n return is_a($instance, $className);\n }",
"public function has();",
"function exists()\n {\n if (isset($this->id))\n {\n return TRUE;\n }\n\n return FALSE;\n }",
"public static function exists()\n {\n /** @var \\Illuminate\\Database\\Query\\Builder $instance */\n return $instance->exists();\n }",
"public function instance_allow_multiple() {\n\t\treturn true;\n\t}",
"public function exist()\r\n {\r\n return ($this->count() > 0);\r\n }",
"public function instance_allow_multiple() {\n return true;\n }",
"public function exists()\n\t{\n\t\treturn true;\n\t}",
"function instance_exists($pathname){\n\treturn file_exists_by_hash($pathname);\n}",
"function wpi_class_implements($classNameOrInstance, $interfaceName) {\n\treturn array_key_exists($interfaceName, class_implements($classNameOrInstance));\n}"
] | [
"0.72110873",
"0.6802191",
"0.626853",
"0.62566996",
"0.6188666",
"0.6123224",
"0.607449",
"0.6073412",
"0.59197855",
"0.59094954",
"0.58986217",
"0.5777035",
"0.57629937",
"0.57629937",
"0.57629937",
"0.57629937",
"0.57629937",
"0.57629937",
"0.57629937",
"0.57467246",
"0.5737774",
"0.5697144",
"0.56611043",
"0.5658635",
"0.56410414",
"0.5634708",
"0.5626694",
"0.56015337",
"0.56013644",
"0.55908054"
] | 0.80209047 | 0 |
Creates a new instance of the specified class, and with the specified id | protected static function createInstance($class, $Id = null)
{
$instance = new $class($Id);
self::putInstanceInArray($instance);
return $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newFromId($id);",
"function __construct($class='',$id=''){\n\t\t$this->class = $class;\n\t\t$this->id = $id;\n\t}",
"public function __construct($id);",
"public function create($id)\n {\n //\n }",
"protected static function getNewInstance($class, $Id=null)\r\n {\r\n if(!self::baseObjectExistsInArray($class))\r\n {\r\n self::createBaseObject($class);\r\n }\r\n $obj = clone self::$instances[$class][self::BASE_OBJECT_ID];\r\n if(!empty($Id))\r\n {\r\n if($Id != self::BASE_OBJECT_ID)\r\n {\r\n $Id = trim($Id);\r\n $obj->setId($Id);\r\n }\r\n return $obj;\r\n }\r\n return $obj;\r\n }",
"public static function find($id)\n {\n $class = get_called_class();\n //\n return new $class($id);\n }",
"public function create($id)\n {\n //\n }",
"public function create($id)\n {\n //\n }",
"public function create($id)\n {\n\n }",
"public function create($id)\n {\n\n }",
"public function create($id)\n {\n\n }",
"public static function factory($id=false)\r\n\t{\r\n\t\tif (is_numeric($id) && isset(self::$obj_cache[static::$_table][$id])) {\r\n\t\t\treturn self::$obj_cache[static::$_table][$id];\r\n\t\t}\r\n\r\n\t\t$type = get_called_class();\r\n\t\t$obj = new $type($id);\r\n\r\n\t\tif ($obj->valid()) {\r\n\t\t\treturn $obj;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public function construct($id, $args=[])\n {\n $className = $this->_resolveFullClassName($id);\n\n $entry = $this->get($id);\n \n if(count($args)) { \n $entry->setArgs($args);\n }\n\n if(!$entry->instanceExists()) {\n $arguments = $entry->getArgs();\n $this->_resolveMethodDependencies($className, '__construct', $arguments);\n $entry->setArgs($arguments);\n }\n return $entry->getInstance();\n }",
"public static function make($id = null)\n {\n return new static($id);\n }",
"public function create($id)\n {\n \n }",
"public function __construct($id) {\n\t\t$this->setId($id);\n\t}",
"public function __construct($id) {\r\n $this->id = $id;\r\n }",
"public static function getInstance($type, $id)\n {\n return new self($type, $id);\n }",
"public function __construct($id) {\n $this->id = $id;\n }",
"abstract protected static function GetNew($id);",
"public static function get_instance( $id ) {\n\n\t\tif ( empty( $id ) || ! is_string( $id ) )\n\t\t\ttrigger_error( 'Error in ' . __METHOD__ . ': parameter (string) id expected', E_USER_NOTICE );\n\n\t\tself::$id = $id;\n\n\t\treturn new self();\n\n\t}",
"public function __construct($id)\n {\n $this->id = $id;\n }",
"public function __construct($id)\n {\n $this->id = $id;\n }",
"public function __construct($id)\n {\n $this->id = $id;\n }",
"public function __construct($id)\n {\n $this->id = $id;\n }",
"function __construct($id) \n {\n $this->_id = $id; \n }",
"public function createNewObject($className = NULL);",
"public function __construct($id)\n\t{\n\t\t$this->id = $id;\n\t}",
"private function createInstance($class) {\n if ($this->container !== null) {\n return $this->container->get($class);\n } else {\n return new $class;\n }\n }",
"private function createInstance($class) {\n if ($this->container !== null) {\n return $this->container->get($class);\n } else {\n return new $class;\n }\n }"
] | [
"0.7477091",
"0.71022844",
"0.690588",
"0.68966734",
"0.6855827",
"0.68186104",
"0.67960626",
"0.67960626",
"0.6772237",
"0.6772237",
"0.6772237",
"0.66484195",
"0.6639083",
"0.65574455",
"0.65470237",
"0.65057415",
"0.64710695",
"0.6431783",
"0.63740253",
"0.63432026",
"0.63422084",
"0.63376886",
"0.63010424",
"0.63010424",
"0.63010424",
"0.6286525",
"0.6284908",
"0.62550133",
"0.6241437",
"0.6241437"
] | 0.7470252 | 1 |
Puts an object in the instances array | protected static function putInstanceInArray($instance)
{
self::$instances[get_class($instance)][$instance->getId()] = $instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addInstance()\r\n\t\t{\r\n\t\t\tif( $this->intId )\r\n\t\t\t{\r\n\t\t\t\tif( !isset( self::$arrInstances[ get_class( $this ) ] ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tself::$arrInstances[ get_class( $this ) ] = array();\r\n\t\t\t\t}\r\n\t\t\t\tif( !isset( self::$arrInstances[ get_class( $this ) ][ $this->intId ] ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tself::$arrInstances[ get_class( $this ) ][ $this->intId ] = $this;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception( \"Already exist another instance of this class ( \" . get_class( $this ) . \" )with the same id ( \" . $this->intId . \" )\" );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"private function __construct()\n {\n $this->instances = [];\n }",
"public function setInstance($key, $value) {\n $this->instances[$key] = $value;\n }",
"public static function addInstanceToPool($obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getIdAdherent();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"protected function instancesOfData()\n {\n $this->instances_of = 0;\n }",
"private function save_instance(array $_clients){\n\n\t\tforeach($_clients as $cli){\n\t\t\t$this->bussy_peers[]=$cli;\n\t\t}\n\t\t\n\t\t$this->instances[]=new \\app\\instance(\n\t\t\t$_clients,\n\t\t\tnew \\app\\world($this->world_width,$this->world_height)\n\t\t);\n\t}",
"abstract protected static function provideInstances(): array;",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if (null === $key) {\n $key = serialize([(null === $obj->getInititemnbr() || is_scalar($obj->getInititemnbr()) || is_callable([$obj->getInititemnbr(), '__toString']) ? (string) $obj->getInititemnbr() : $obj->getInititemnbr()), (null === $obj->getIntbwhse() || is_scalar($obj->getIntbwhse()) || is_callable([$obj->getIntbwhse(), '__toString']) ? (string) $obj->getIntbwhse() : $obj->getIntbwhse())]);\n } // if key === null\n self::$instances[$key] = $obj;\n }\n }",
"public function set($instance);",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = (string) $obj->getBewakingscodeCi();\n } // if key === null\n GsBewakingenKenmerkenPeer::$instances[$key] = $obj;\n }\n }",
"private function removeInstance()\r\n\t\t{\r\n\t\t\tif( $this->intId )\r\n\t\t\t{\r\n\t\t\t\tif( isset( self::$arrInstances[ get_class( $this ) ] ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( isset( self::$arrInstances[ get_class( $this ) ][ $this->intId ] ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tunset( self::$arrInstances[ get_class( $this ) ][ $this->intId ] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = serialize(array((string) $obj->getHandelsproduktkode(), (string) $obj->getVolgnummer()));\n } // if key === null\n GsIngegevenSamenstellingenPeer::$instances[$key] = $obj;\n }\n }",
"public static function getInstancesArray()\r\n {\r\n return self::$instances;\r\n }",
"public function toInstance($instance);",
"public function executeInstances()\n {\n foreach ($this->_dependencies as $alias => $config) {\n if (!array_key_exists($alias, $this->_instances)) {\n $attributes = array_values($config);\n array_unshift($attributes, $alias);\n call_user_func_array(array($this, '_instance'), $attributes);\n }\n }\n }",
"public static function addInstanceToPool(Website $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = (string) $obj->getid();\n } // if key === null\n ActionPropertyPeer::$instances[$key] = $obj;\n }\n }",
"public function __construct()\n {\n static::$x_instance_arr[get_called_class()] =& $this;\n }",
"public static function addInstanceToPool(MissionTypeWingStats $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public static function addInstanceToPool(MissionLeg $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"public static function getInstances(): array\n {\n return self::$instances;\n }",
"public function __construct()\n {\n $this->cachedInstances = [];\n }",
"protected function instancesOfData()\n {\n // TODO: Implement instancesOfData() method.\n }",
"public function createandstoreobject($object,$key){\n require_once($object . '.class.php');\n $this->objects[ $key ]=new $object($this);\n}",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = (string) $obj->getHandelsproduktkode();\n } // if key === null\n GsHandelsproductenPeer::$instances[$key] = $obj;\n }\n }",
"static function addedObject($object) {\n\t\tself::$added[$object->class][] = $object;\n\t}",
"static function insertIntoPool(Fact $object) {\n\t\tif (!Fact::$_poolEnabled) {\n\t\t\treturn;\n\t\t}\n\t\tif (Fact::$_instancePoolCount > Fact::MAX_INSTANCE_POOL_SIZE) {\n\t\t\treturn;\n\t\t}\n\n\t\tFact::$_instancePool[implode('-', $object->getPrimaryKeyValues())] = $object;\n\t\t++Fact::$_instancePoolCount;\n\t}",
"public static function addInstanceToPool(Customer $obj, $key = null)\n\t{\n\t\tif (Propel::isInstancePoolingEnabled()) {\n\t\t\tif ($key === null) {\n\t\t\t\t$key = (string) $obj->getId();\n\t\t\t} // if key === null\n\t\t\tself::$instances[$key] = $obj;\n\t\t}\n\t}",
"private function handleInstance($class)\n {\n if (!isset($this->instances[$class])) {\n $this->instances[$class] = new $class();\n }\n\n return $this->instances[$class];\n }",
"static public function instanceInArray($instance)\r\n {\r\n if(array_key_exists(get_class($instance), self::$instances))\r\n {\r\n if(array_key_exists($instance->getId(), self::$instances[get_class($instance)]))\r\n {\r\n return self::$instances[get_class($instance)][$instance->getId()] === $instance;\r\n }\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }"
] | [
"0.64902616",
"0.6463206",
"0.6132041",
"0.60112226",
"0.5924829",
"0.5763831",
"0.56903934",
"0.5646291",
"0.56369585",
"0.5634653",
"0.56118894",
"0.5605569",
"0.5568379",
"0.55086774",
"0.55036134",
"0.54742765",
"0.54517865",
"0.5437694",
"0.5427306",
"0.5411246",
"0.5386035",
"0.5384028",
"0.5380827",
"0.5370573",
"0.5356222",
"0.53503704",
"0.5313795",
"0.5303127",
"0.52976894",
"0.52964175"
] | 0.69317675 | 0 |
Creates the base object for a specified class | protected static function createBaseObject($class)
{
return self::createInstance($class, self::BASE_OBJECT_ID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function baseClass();",
"protected function createObject($class)\n {\n if ($this->objectCreator) {\n return call_user_func($this->objectCreator, $class);\n }\n return new $class();\n }",
"public static function create()\n {\n $_cls = get_called_class();\n $_obj = new $_cls;\n call_user_func_array(array($_obj, 'init'), func_get_args());\n return $_obj;\n }",
"public static function factory()\n {\n $class=get_called_class();\n return new $class;\n }",
"public static function newInstance($class = __CLASS__) {\n return parent::newInstance($class);\n }",
"public function createNewObject($className = NULL);",
"abstract protected function createInstance();",
"public static function create($classname = __CLASS__) \n {\n return parent::create($classname);\n }",
"public function create()\n {\n $class = $this->class;\n\n return new $class;\n }",
"abstract protected function doCreate($for, $class);",
"public function getBaseInstance();",
"public static function createObject($class)\n {\n if (!empty($class)) {\n return new $class();\n }\n return null;\n }",
"public function newInstance();",
"public function newInstance();",
"public function newInstance();",
"public function newInstance();",
"public function newInstance();",
"public static function factory($className = __CLASS__)\n {\n return parent::factory($className);\n }",
"public static function factory($className = __CLASS__)\n {\n return parent::factory($className);\n }",
"private static function instantiate( $class )\n {\n $service = new $class(); \n return $service; \n }",
"private function createInstance($class) {\n if ($this->container !== null) {\n return $this->container->get($class);\n } else {\n return new $class;\n }\n }",
"private function createInstance($class) {\n if ($this->container !== null) {\n return $this->container->get($class);\n } else {\n return new $class;\n }\n }",
"private static function instantiate( $class ) {\n\n $service = new $class();\n\n return $service;\n\n }",
"final public function create()\n {\n return new $this->class;\n }",
"public static function factory()\n {\n return parent::factory(__CLASS__);\n }",
"public function getObj(string $class_name, ...$parameters): object\n {\n return new $class_name(...$parameters);\n }",
"public function __construct($class)\n {\n $this->nameSpace='App\\strategy\\\\'.$class;\n $this->class=new $this->nameSpace;\n }",
"public static function create() {\n $refClass = new ReflectionClass(get_called_class());\n return $refClass->newInstanceArgs(func_get_args());\n }",
"protected function _getNewInstance($class, $arguments=array())\n\t{\n\t\treturn new $class($arguments);\n\t}",
"public function createInstance()\n {\n $class = $this->getClass();\n $model = new $class;\n\n return $model;\n }"
] | [
"0.69275427",
"0.6794239",
"0.6751003",
"0.6735123",
"0.6715613",
"0.6672557",
"0.6542098",
"0.6539253",
"0.64173746",
"0.6412257",
"0.63631207",
"0.632465",
"0.63198394",
"0.63198394",
"0.63198394",
"0.63198394",
"0.63198394",
"0.6273327",
"0.6273327",
"0.6273143",
"0.62525356",
"0.62525356",
"0.61549675",
"0.615418",
"0.6134459",
"0.6128446",
"0.60873175",
"0.60591966",
"0.60283816",
"0.6017602"
] | 0.7714302 | 0 |
Determines if the base object for the specified class is already instantiated. | protected static function baseObjectExistsInArray($class)
{
return (isset(self::$instances[$class][self::BASE_OBJECT_ID]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __is_class($__class)\n {\n if (class_exists($__class))\n return true;\n return false;\n }",
"protected static function hasInstance(): bool\n {\n $self = get_called_class();\n\n return isset(self::$instances[$self]);\n }",
"final public static function isInstancied() {\n return (bool) self::$instance;\n }",
"final public static function isClassRegistered(CtkObject $object = null) {\n\t\treturn (isset(self::$_classRegistry[get_called_class()]) && (self::$_classRegistry[get_called_class()] === true || (isset($object) && self::$_classRegistry[get_called_class()] === $object)));\n\t}",
"public function hasClass(string $class): bool;",
"public function hasClass() : bool;",
"private function classExists($class)\n\t{\n\t\treturn class_exists($class) || interface_exists($class);\n\t}",
"protected function inheritsClass($class, $targetClass)\n {\n return $class === $targetClass || \\is_subclass_of($class, $targetClass);\n }",
"function is_class_load(){ return data_model::is_load(get_class($this)); }",
"public function hasActiveSubClass();",
"public function isInstantiable()\n {\n $this->scan();\n return (!$this->isAbstract && !$this->isInterface);\n }",
"public function isInstance( $object )\n {\n return ( $object instanceof $this->_name );\n }",
"protected function canCreateClass($object_type) {\n return true;\n }",
"public function isObject()\n {\n return $this->_class instanceof ReflectionClass;\n }",
"public function supportsClass(string $class): bool\n {\n return UserCurrent::class === $class || is_subclass_of($class, UserCurrent::class);\n }",
"public function hasBaseType()\n {\n return !is_null($this->_baseType);\n }",
"abstract function isValidClass($class);",
"public function is_a( $class )\n\t{\n\t\treturn is_a( $this, $class );\n\t}",
"public function class_exists( $class_name ) {\n\t\t\tif ( class_exists( $class_name ) ) {\n\t\t\t\t$class_name::get_instance();\n\t\t\t}\n\n\t\t\treturn $class_name;\n\t\t}",
"public static function testClassForUniqueId($class)\n {\n $object = new $class;\n\n if (stripos($object->primaryKey, 'unique') !== false) {\n return true;\n }\n\n return false;\n }",
"public function isInstantiable()\n {\n return false;\n }",
"public static function IsThisClass(command $cmd)\r\n {\r\n return true;\r\n }",
"protected function _hasComponent() {\n return is_object($this->_component);\n }",
"public function has_instance() {\n return $this->instance || $this->get_course_module();\n }",
"public function supportsClass($object);",
"public static function isInstanceOf($object)\n {\n throw new Exception('The manually abstract method isInstanceOf is not been hardcoded in the child class');\n }",
"public function is_base()\r\n {\r\n return $this->base;\r\n }",
"function reliable_class_exists( $class_name ) {\n\tforeach ( get_declared_classes() as $class ) {\n\t\tif ( strcasecmp( $class_name, $class ) == 0 ) {\n\t\t\treturn( true );\n\t\t}\n\t}\n\treturn( false );\n}",
"public function is($klass) {}",
"public function isShared($class)\n {\n $class = $this->normalize($class);\n\n if (isset($this->instances[$class])) {\n return true;\n }\n\n if (!isset($this->builders[$class]['share'])) {\n return false;\n }\n\n return $this->builders[$class]['share'] === true;\n }"
] | [
"0.67127347",
"0.6353744",
"0.6220527",
"0.62027",
"0.6157285",
"0.6134081",
"0.6077469",
"0.60724366",
"0.6033387",
"0.597756",
"0.5950816",
"0.59227526",
"0.5890187",
"0.5884213",
"0.58711314",
"0.5864914",
"0.5849371",
"0.57881993",
"0.5770466",
"0.57647145",
"0.5753214",
"0.5733655",
"0.5725046",
"0.5721195",
"0.5697629",
"0.56907976",
"0.5689983",
"0.568247",
"0.5675521",
"0.5660597"
] | 0.70634335 | 0 |
Check if property of $varName is empty or not | public function propertyIsEmpty($varName)
{
return (empty($this->$varName));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _varIsEmpty(&$var) {\n\t\tif ( (is_string($var) && !strlen(trim($var)))\n\t\t || ($var instanceof Countable && count($var) < 1)\n\t\t || (!$var instanceof Countale && empty($var))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasAccessEmptyVariable()\n {\n if (Container::getData()->getVariable($this->variable) === null) {\n return true;\n }\n\n return false;\n }",
"function __isset($varName) {\n if ($this->isConstructing) return false; \n \n return $this->getConfigValue($varName, null) !== null;\n }",
"function is_var( $var ) {\n\tif( isset($var) ) {\n\t\tif( !empty($var) ){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"function is_blank( $p_var ) {\r\n\t\t$p_var = trim( $p_var );\r\n\t\t$str_len = strlen( $p_var );\r\n\t\tif ( 0 == $str_len ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function __isset($varName) {\n return isset($this->data[$varName]);\n\n }",
"public function hasVars(){\n return !empty($this->_varsNames);\n }",
"function filled_out(array $aVars)\n{\n foreach ($aVars as $sKey => $sVal) {\n if (empty($sKey) || trim($sVal) === '') {\n return false;\n }\n }\n return true;\n}",
"private function variable_iniciada($variable) {\n if (isset($variable) && !empty($variable)) {\n return true;\n } else {\n return false;\n }\n }",
"public static function isNullOrEmpty($var){\n return (!isset($var) || trim($var) === '');\n }",
"public function isEmpty(string $property): bool;",
"public function isEmpty()\n {\n return is_null($this->name) && is_null($this->value);\n }",
"function isEmpty($postvars)\n { \n return (!is_array($postvars[$this->fieldName()]) || count($postvars[$this->fieldName()])==0);\n }",
"function varSet($var)\n {\n if($var != null && trim($var) != ''){\n return true;\n }\n else{\n return false;\n }\n \n }",
"public function HasProperties()\n {\n if(count($this->variables) > 0)\n return true;\n \n return false;\n }",
"protected static function nonEmptyString($var)\n {\n return (strlen($var) > 0);\n }",
"public function __isset($key)\n {\n return ! empty($this->{$key});\n }",
"function check($variable) { if (isset($variable)) { \n return \"The variable is SET\".PHP_EOL; \n } //are you empty?\n elseif (empty($variable)) { \n return \"The variable is empty\".PHP_EOL;\n }\n }",
"public function isEmpty($var = null) {\n\t\t$ret_val = true;\n\t\tif (is_null($var)) {\n\t\t\t$ret_val = (0 === count($this));\n\t\t} else {\n\n\t\t\t// empty() returns true for the string '0' so override that, '0' is still data\n\t\t\tif ('0' === $this->get($var)) {\n\t\t\t\t$ret_val = false;\n\t\t\t} else {\n\t\t\t\t$ret_val = empty($this->_data[(string) $var]);\n\t\t\t}\n\t\t}\n\t\treturn $ret_val;\n\t}",
"function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}",
"public function is_empty()\n\t{\n\t\treturn empty($this->value->value);\n\t}",
"final public function isEmpty($name) {\r\n $vars = $this->_getVarsNames();\r\n $name = lcfirst($name);\r\n\r\n if (!$this->has($name)) {\r\n throw new Exception ('Parameter \"'.$name.'\" has not been set.');\r\n }\r\n\r\n if (in_array($name, $vars)) {\r\n return empty($this->$name);\r\n } else {\r\n return empty($this->_data[$name]);\r\n }\r\n }",
"public function isSet(String $varName): bool {\n return isset(get_object_vars($this)[$varName]);\n }",
"public function isEmpty() {\n return !isset($this->session->{$this->member}); \n }",
"function emptyOrSet($var) {\n\tif (isset($var) && empty($var)) {\n\t\treturn 'SET and EMPTY';\n\t}elseif (isset($var)) {\n\t\treturn 'SET';\n\t} elseif (empty($var)) {\n\t\treturn 'EMPTY';\n\t} else {\n\t\treturn FALSE;\n\t}\n}",
"public function isEmpty() {\n\t\treturn $this->getValue() == null || $this->getValue() == '';\n\t}",
"function fieldEmpty()\n {\n $rtr = true;\n foreach ($this->field as $key => $value) {\n $value = trim($value);\n if (empty($value))\n $rtr = false;\n }\n return $rtr;\n }",
"function __isset($varname){\n return isset($this->templateVars[$varname]);\n }",
"function v_is_empty($var) {\n $var = strip_tags($var);\n $var = str_replace(' ', '', $var);\n return v_custom_match('/^\\s*$/', $var);\n}",
"public function checkSet($var){\n\t\tif((isset($var)) && ($var!=''))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}"
] | [
"0.72079206",
"0.7080979",
"0.6919217",
"0.6907354",
"0.68079454",
"0.67882776",
"0.6732608",
"0.67134976",
"0.66505134",
"0.66167873",
"0.6584112",
"0.6573393",
"0.65131146",
"0.64344645",
"0.6380631",
"0.63717026",
"0.6363342",
"0.6363261",
"0.6360635",
"0.63478255",
"0.63323575",
"0.62882036",
"0.62742734",
"0.6252371",
"0.62459475",
"0.6230959",
"0.6223896",
"0.62102085",
"0.61930776",
"0.61919796"
] | 0.8524242 | 0 |
Returns the instances array | public static function getInstancesArray()
{
return self::$instances;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getInstances(): array\n {\n return self::$instances;\n }",
"public static function getInstances()\n {\n return self::$instances;\n }",
"public function getAllInstances()\n\t{\n\t\t$instances = [];\n\t\t\n\t\tforeach ($this->resources as $key => $namespace) \n\t\t{\n\t\t\t$obj = new $namespace;\n\t\t\t$instances[] = $obj;\n\t\t}\n\n\t\treturn $instances;\n\t}",
"public function instances()\n {\n if (!$this->instances) {\n $this->instances = new Instances($this);\n }\n\n return $this->instances;\n }",
"public static function get_all_instances() {\n\t\t\treturn self::$instances;\n\t\t}",
"public function getDataInstace()\n {\n $ret = array();\n $instances = $this->lightSailClient->getInstances()[\"instances\"];\n foreach ($instances as $instance) {\n $ret = $instance;\n }\n return $ret;\n }",
"abstract protected static function provideInstances(): array;",
"public static function getInstances(): array\n {\n /** @var array<string, array<string, string>> $settings */\n $settings = Chronicle::getSettings();\n\n return [\n \\array_keys($settings['instances']) ?? [],\n $settings['signing-public-key'] ?? '',\n ];\n }",
"public function getInstances()\n {\n try {\n return $this->lightSailClient->getInstances();\n } catch (\\Exception $e) {\n echo \"Erro ao acessar a Amazon Lightsail API. \" . PHP_EOL . \"Messagem {$e->getMessage()}\" . PHP_EOL;\n }\n }",
"public function getAllBookInstances()\n {\n $db = Database::getInstance();\n $statement = $db->prepare(\"SELECT * FROM book_instances WHERE book_id=?\");\n $statement->execute([$this->id]);\n\n return $statement->fetchAll(PDO::FETCH_CLASS, BookInstance::class);\n\n }",
"protected function instancesOfData()\n {\n // TODO: Implement instancesOfData() method.\n }",
"protected function get_shared_instances(): array {\n\t\treturn [\n\t\t\t// Example - make SampleService be shared amongst instantiations:\n\t\t\t// SampleService::class\n\n\t\t\t// Add your shared instances here.\n\t\t];\n\t}",
"public function getSpawnedInstances() { return $this->m_generatedInstances; }",
"public static function toArray()\r\n {\r\n $className = get_called_class();\r\n return $className::getInstance()->getArray();\r\n }",
"public function getInstantiates() {\n return $this->instantiates;\n }",
"public function all()\n {\n ksort($this->instances, SORT_NATURAL | SORT_FLAG_CASE);\n return $this->instances;\n }",
"public function find_many() {\n $rows = $this->_run();\n\n if ( $rows === false ) {\n return [];\n }\n\n\t\treturn \\array_map( [ $this, '_create_instance_from_row' ], $rows );\n\t}",
"public function pageInstances()\n {\n return $this->hasMany(PageInstance::class)\n ->orderBy('id');\n }",
"protected static function get_instances($arr) {\n $result = array();\n foreach ($arr as $key => $sub) {\n $result[$key] = new subscription($sub);\n }\n return $result;\n }",
"abstract function get_array_instance();",
"final public static function traceAllIstance()\n {\n $singleton = static::singleton();\n return $singleton::$x_instance_arr;\n }",
"public function findInstancesOf($class);",
"public function __toArray(){\n\t\treturn get_object_vars($this);\n\t}",
"private function _asArray()\n\t{\n\t\treturn get_object_vars($this);\n\t}",
"public function toArray() { return []; }",
"public function getInstances($constraints = array()) {\n !empty($constraints) OR $constraints = array('archive' => false);\n $constraints['instance'] = $this -> course['id'];\n $constraints['required_fields'] = array('num_students', 'num_lessons', 'num_skills', 'location');\n $courseInstances = self :: getAllCourses($constraints);\n/*\n#ifdef ENTERPRISE\n\t\t\t$result \t = eF_getTableData(\"module_hcd_course_to_branch cb, module_hcd_branch b\", \"cb.branches_ID, cb.courses_ID, b.name\", \"b.branch_ID=cb.branches_ID\");\n\t\t\t$branchResult = array();\n\t\t\tforeach ($result as $value) {\n\t\t\t\t$branchResult[$value['courses_ID']][$value['branches_ID']] = $value['name'];\n\t\t\t}\n\t\t\tforeach ($courseInstances as $key => $course) {\n\t\t\t\t$courseInstances[$key] -> branches = $branchResult[$course -> course['id']];\n\t\t\t\t$courseInstances[$key] -> course['branch_name'] = implode(\",\", $courseInstances[$key] -> branches);\n\t\t\t}\n#endif\n*/\n return $courseInstances;\n }",
"protected function instancesOfData()\n {\n $this->instances_of = 0;\n }",
"public function toArray()\n {\n $data = [];\n\n foreach ($this->models as $name => $model) {\n $data[] = $this->petchModel($model);\n }\n\n return $data;\n }",
"public function list(): array {\n\n $query = $this->execute();\n\n $results = [];\n\n while ( $row = $query->fetch( PDO::FETCH_OBJ, PDO::FETCH_ORI_NEXT ) ) {\n\n if ( $this->class )\n $results[] = new $this->class( $row );\n else\n $results[] = $row;\n }\n\n return $results;\n }",
"public function datas(): array\n {\n return get_object_vars($this);\n }"
] | [
"0.8037842",
"0.77170414",
"0.7661783",
"0.76054263",
"0.7533732",
"0.7366446",
"0.72778636",
"0.70832944",
"0.7069081",
"0.7011595",
"0.6900805",
"0.68043363",
"0.6790673",
"0.6606313",
"0.6590477",
"0.6569232",
"0.6296888",
"0.6288033",
"0.6280361",
"0.6272364",
"0.6267946",
"0.6244469",
"0.62353724",
"0.62092",
"0.61723024",
"0.6166398",
"0.6123423",
"0.6120565",
"0.60988516",
"0.6096911"
] | 0.85399646 | 0 |
Set exchange option property | public function setExchangeOption($key, $value)
{
if ($key && $value) {
$this->exchangeOptions[$key] = $value;
}
return $this->exchangeOptions[$key];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setExchangeServer($val)\n {\n $this->_propDict[\"exchangeServer\"] = $val;\n return $this;\n }",
"public function setIsExchange($isExchange) {\n $this->isExchange = $isExchange;\n return $this;\n }",
"public function setExchangeAlias($val)\n {\n $this->_propDict[\"exchangeAlias\"] = $val;\n return $this;\n }",
"protected function setExchangeRate($exchangeRate)\r\n\t{\r\n\t\treturn $this->exchangeRate = $exchangeRate;\r\n\t}",
"public function getIsExchange() {\n return $this->isExchange;\n }",
"public function setMailboxOpt($name, $value)\n {\n $this->_mailboxOpts[$name] = $value;\n }",
"function setOption( &$option )\n {\n if ( get_class( $option ) == \"ezoption\" )\n {\n $this->OptionID = $option->id();\n }\n }",
"public function setOption(string $option);",
"public function setUserDeliveryAddress($option)\n {\n $this->delivery_address_choice = $option;\n $this->saveToSession();\n }",
"function setOptInOptOutEmailFormat($email_format)\n {\n $this->__opt_in_opt_out_email_format = $email_format ;\n }",
"function setOption($key, $value) {\n if ($this->state) {\n throw new \\LogicException(\n 'Socket options may not be modified after connection is initialized'\n );\n }\n \n switch (strtolower($key)) {\n case 'connecttimeout':\n $this->setConnectTimeout($value);\n break;\n case 'bindtoip':\n $this->setBindToIp($value);\n break;\n case 'iogranularity':\n $this->setIoGranularity($value);\n break;\n case 'tlsoptions':\n $this->setTlsOptions($value);\n break;\n default:\n throw new \\DomainException(\n \"Unknown option key: {$key}\"\n );\n }\n }",
"public function configure()\n {\n $this->setOptions(array(\n '-vn' => '',\n '-ar' => '44100',\n '-ac' => '2',\n '-ab' => '192',\n '-f' => 'mp3',\n ));\n }",
"public function setOption(Option $option);",
"final public function _setTemplateOptions($option, $value){$this->_tplOptions->{$option} = $value;}",
"public function setOption($option, $value) \n {\n curl_setopt($this->ch, constant($option), $value);\n }",
"private function ExchangeTo() : Exchange\n {\n if ($this->exchange_to === false) {\n $this->exchange_to = new Exchange($this->infos['tx_transfer_exchange_id_to']);\n }\n return $this->exchange_to;\n }",
"public function setOptions( $options ){\n\t\t$data = @unserialize( $options );\n\t\tif( $options === 'b:0;' || $data !== false){\n\t\t\t$this->options = $data;\n\t\t} else {\n\t\t\t$this->options = $options;\n\t\t}\t\n\t}",
"public function setOptions( $options ){\n\t\t$data = @unserialize( $options );\n\t\tif( $options === 'b:0;' || $data !== false){\n\t\t\t$this->options = $data;\n\t\t} else {\n\t\t\t$this->options = $options;\n\t\t}\t\n\t}",
"public function setOption($option, $value) {}",
"public function setHttpClientOption($option_name, $option_value);",
"private function setRequestMailboxConfig() : void {\n $this->requestMailboxConfig = new MailboxConfig(env(\"REQUEST_MAILBOX_IMAP_INBOX\"),\n env(\"REQUEST_MAILBOX_IMAP_ARCHIVE\"));\n }",
"public function setTransportOptions(array $options): void;",
"public function activateOptions() {\n\t\ttry{\n\t\t\t$this->connection = new AMQPConnection($this->host, $this->port, $this->user, $this->password);\n\t\t\t$this->channel = $this->connection->channel();\n\t\t\t\n//\t\t\t$this->channel->exchange_declare($this->exchange, $this->routing_type, false, false, false);\n//\t\t\t$this->channel->queue_declare($this->queue, false, false, false, false);\n//\t\t\t$this->channel->queue_bind($this->queue, $this->exchange, $this->routing_key);\n\t\t}\n\t\tcatch(AMQPConnectionException $ce){\n\t\t\t$this->append = false;\n\t\t}\n\t\tcatch(AMQPChannelException $che){\n\t\t\t$this->append = false;\n\t\t}\n\t\t$this->append = true;\n\t\treturn true;\n\t}",
"function set($option, $value)\n\t{\n\t\tif (in_array($option, array_keys($this->options)))\n\t\t{\n\t\t\t// Boolean values can be set in different formats\n\t\t\tif (in_array($option, $this->bool_vars) && !is_bool($value))\n\t\t\t\t$this->options[$option] = in_array(strtolower(trim($value)), array('on', 1, '1', 'yes', 'true', 'y', 'enable')) ? true : false;\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Ignore api_type changes during runtime; this option can be set only before any transaction occurs.\n\t\t\t\tif ($option == 'api_type' && $this->db_env['connected'])\n\t\t\t\t\t$this->warn('api_change_forbidden', E_USER_NOTICE);\n\t\t\t\telse\n\t\t\t\t\t$this->options[$option] = $value;\n\t\t\t\tif ($option == 'charset' && $this->db_env['connected']) // Dynamic charset changing\n\t\t\t\t\t$this->set_charset($value);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\t$this->warn(array('unknown_option', $option), E_USER_NOTICE);\n\t}",
"public function setOption($name, $value)\n {\n if ($name === ConnectionOptions::OPTION_ENDPOINT ||\n $name === ConnectionOptions::OPTION_HOST ||\n $name === ConnectionOptions::OPTION_PORT ||\n $name === ConnectionOptions::OPTION_VERIFY_CERT ||\n $name === ConnectionOptions::OPTION_CIPHERS ||\n $name === ConnectionOptions::OPTION_ALLOW_SELF_SIGNED\n ) {\n throw new ClientException('Must not set option ' . $name . ' after connection is created.');\n }\n\n $this->_options[$name] = $value;\n\n // special handling for several options\n if ($name === ConnectionOptions::OPTION_TIMEOUT ||\n $name === ConnectionOptions::OPTION_REQUEST_TIMEOUT) {\n // set the timeout option: patch the stream of an existing connection\n if (is_resource($this->_handle)) {\n stream_set_timeout($this->_handle, $value);\n }\n } else if ($name === ConnectionOptions::OPTION_CONNECTION) {\n // set keep-alive flag\n $this->_useKeepAlive = (strtolower($value) === 'keep-alive');\n } else if ($name === ConnectionOptions::OPTION_DATABASE) {\n // set database\n $this->setDatabase($value);\n }\n\n $this->updateHttpHeader();\n }",
"private function set_options( $options = array() ) {\n\n\t\t\t$options = wp_parse_args(\n\t\t\t\t$options, array(\n\t\t\t\t\t'pue_option_name' => 'external_updates-' . $this->get_slug(),\n\t\t\t\t\t'apikey' => '',\n\t\t\t\t\t'check_period' => 12,\n\t\t\t\t\t'context' => 'component',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->pue_option_name = $options['pue_option_name'];\n\t\t\t$this->check_period = (int) $options['check_period'];\n\t\t\t$this->context = $options['context'];\n\n\t\t}",
"protected function setOptions()\n {\n if (!$this->ssoServerUrl || !$this->brokerName || !$this->brokerSecret) {\n throw new \\Exception('Missing configuration values.');\n }\n }",
"public function setOption ($key, $value) {}",
"public function getExchangeAlias()\n {\n if (array_key_exists(\"exchangeAlias\", $this->_propDict)) {\n return $this->_propDict[\"exchangeAlias\"];\n } else {\n return null;\n }\n }",
"public function setOption($option, $value);"
] | [
"0.5851953",
"0.57189286",
"0.5580072",
"0.5448889",
"0.5385664",
"0.53706914",
"0.5284255",
"0.5269647",
"0.5218678",
"0.5207155",
"0.52037466",
"0.5149763",
"0.51256406",
"0.5103209",
"0.5043992",
"0.500129",
"0.4925496",
"0.4925496",
"0.490286",
"0.4901443",
"0.4899314",
"0.4891138",
"0.48847392",
"0.48661476",
"0.4864087",
"0.48560473",
"0.4840873",
"0.48214692",
"0.4816209",
"0.47897136"
] | 0.6092762 | 0 |
Set queue option property | public function setQueueOption($key, $value)
{
if ($key && $value) {
$this->queueOptions[$key] = $value;
}
return $this->queueOptions[$key];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setQueue($queue = null)\n {\n // validation for constraint: string\n if (!is_null($queue) && !is_string($queue)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($queue)), __LINE__);\n }\n if (is_null($queue) || (is_array($queue) && empty($queue))) {\n unset($this->Queue);\n } else {\n $this->Queue = $queue;\n }\n return $this;\n }",
"public function setQueue(string $queue): self\n {\n $this->queue = $queue;\n\n return $this;\n }",
"protected function enableQueue() {\n $this->enabled = TRUE;\n }",
"public function setQueueEndpoint($url) {\n\t\t$this->endpoint_queue = $url;\n\t}",
"public function __construct()\n {\n //\n $this->queue = 'default'; //choose a queue name\n $this->connection = 'database';\n }",
"public function queue(string $queue): self\n {\n return $this->add('queue', '=', $queue);\n }",
"public function queue(bool $flag = true): self\n {\n $this->queue = $flag;\n\n return $this;\n }",
"public function setQueueName($name)\n {\n $this->_defaultAdapter->setQueueName($name);\n }",
"public function setQueue($queue)\n {\n $this->queue = $queue;\n\n return $this;\n }",
"function __construct() {\n $this->myQueue = [];\n }",
"protected function configure()\n {\n $this\n ->setName('queue:redis')\n ->setDescription('run redis cache over all records in queue')\n ->addOption(\n self::OPTION_EMULATE,\n null,\n InputOption::VALUE_NONE,\n 'emulate but do not actually call url and do not clear cache'\n )\n ->addOption(\n self::OPTION_SHOW_DEBUG,\n null,\n InputOption::VALUE_NONE,\n 'show debug info'\n )\n ->addOption(\n self::OPTION_THREADS,\n null,\n InputOption::VALUE_REQUIRED,\n 'run several threads'\n );\n }",
"public function markAsQueued()\n {\n $this->status = self::STATUS_QUEUED;\n $this->save();\n }",
"public function setQueue(Queue $queue)\n {\n $this->queue = $queue;\n $this->queueClass = get_class($queue);\n $this->queueName = $queue->getName();\n $this->messageClass = $queue->getOptions()->getMessageClass();\n\n return $this;\n }",
"public function __construct(Queue $queue)\n {\n $this->queue = $queue;\n }",
"public function __construct(\\blaze\\collections\\Queue $queue) {\n parent::__construct($queue);\n $this->queue = $queue;\n }",
"public function queue(?string $queue = null): bool;",
"public function setQueueUrl($url)\n {\n return $this->set('queue_url', $url);\n }",
"public function get_queue() {\n\t\t$queue = get_option( self::$queue_key, array() );\n\t\tif ( empty( $queue ) ) {\n\t\t\t$queue = $this->build_queue();\n\t\t}\n\n\t\treturn $queue;\n\t}",
"protected function disableQueue() {\n $this->enabled = FALSE;\n }",
"protected function setupQosOptions()\n {\n }",
"public function __construct()\n {\n $this->queue = 'maintenance';\n }",
"public function setMailboxOpt($name, $value)\n {\n $this->_mailboxOpts[$name] = $value;\n }",
"public function sizeDelay($queue)\n {\n }",
"public function setEntry(QueueEntry $entry)\n {\n $this->entry = $entry;\n }",
"public function setQueue(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\HotelReservationType\\QueueAType $queue)\n {\n $this->queue = $queue;\n return $this;\n }",
"public function getQueueOptionsAllowableValues()\n {\n return [\n self::QUEUE_OPTIONS_NONE,\n self::QUEUE_OPTIONS_DO_NOT_RUN,\n ];\n }",
"public function setQueueUrl($value) \r\n {\r\n $this->_fields['QueueUrl']['FieldValue'] = $value;\r\n return $this;\r\n }",
"public function consume($queue, array $options = []);",
"public function onQueue($queue)\n {\n $this->queue = $queue;\n\n return $this;\n }",
"public function onQueue($queue)\n {\n $this->queue = $queue;\n\n return $this;\n }"
] | [
"0.6243497",
"0.615861",
"0.60698986",
"0.6021266",
"0.5948201",
"0.59109336",
"0.5786505",
"0.5687457",
"0.56555784",
"0.562701",
"0.56009114",
"0.55655545",
"0.5524719",
"0.5481592",
"0.5475615",
"0.5414462",
"0.540231",
"0.5396647",
"0.53960824",
"0.53810775",
"0.5371878",
"0.53281903",
"0.5314576",
"0.52175874",
"0.5205207",
"0.52007484",
"0.51272404",
"0.5126418",
"0.511282",
"0.511282"
] | 0.64518845 | 0 |
Get period interval count. | public function getIntervalCount(): int
{
return $this->period;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIntervalCount()\n {\n return $this->getParameter('interval_count');\n }",
"public function period(): int;",
"public function get_period_length() {\n return absint( get_post_meta( $this->get_id(), '_dokan_subscription_length', true ) );\n }",
"public function get_edgesPerPeriod(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::EDGESPERPERIOD_INVALID;\n }\n }\n $res = $this->_edgesPerPeriod;\n return $res;\n }",
"protected function getDaysInPeriod(\\DatePeriod $period)\n {\n $interval = $period->getDateInterval();\n return $interval->days ? $interval->days : $interval->d;\n }",
"public function getIntervalCount(): ?int\n {\n return $this->intervalCount;\n }",
"protected function getIntervalsNumber()\n {\n if ($this->_intervalsNumber !== null) {\n return $this->_intervalsNumber;\n }\n\n return 1;\n }",
"public function getPeriods() {\n\t\treturn $this->periods;\n\t}",
"public function get_recurring_interval() {\n return (int) get_post_meta( $this->get_id(), '_dokan_subscription_period_interval', true );\n }",
"public function getRetentionPeriod(): int;",
"function get_number_of_payperiods() {\n\t//How many seconds in a year\n\t$yearlength = 31536000;\n\t//if we're in a leap year, add a day to that length\n\tif (date('L'))\n\t\t$yearlength += 86400;\n\t//Return the length of the year divided by the length of a payperiod.\n\t$out = intval($yearlength/get_payperiod_length());\n\treturn $out;\n}",
"public function getInterval()\n {\n return $this->interval;\n }",
"public function getInterval()\n {\n return $this->interval;\n }",
"public function getInterval()\n {\n return $this->interval;\n }",
"public function getTimePeriods()\n {\n return $this->timePeriods;\n }",
"function getPeriods(){\n return $this->periods;\n }",
"public function getInterval()\n {\n return new DateInterval('P1D');\n }",
"public function get_trial_period_length() {\n $range = $this->get_trial_range();\n $types = $this->get_trial_period_types();\n $length = 0;\n\n if ( ! $range || ! $types ) {\n return 0;\n }\n\n switch ( $types ) {\n case 'week':\n $length = 7 * $range;\n break;\n\n case 'month':\n $length = 30 * $range;\n break;\n\n case 'year':\n $length = 365 * $range;\n break;\n\n default:\n $length = $range;\n break;\n }\n\n return absint( $length );\n }",
"public function getPeriodos()\n {\n switch ($this->getFrecuencia())\n {\n case \"semanal\":\n return 48;\n case \"mensual\":\n return 12;\n case \"trimestral\":\n return 4;\n case \"semestral\":\n return 2;\n case \"anual\":\n return 1;\n }\n }",
"public function getPeriods(): array\n {\n return $this->periods;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getPeriod()\n {\n return $this->period;\n }",
"public function getTimePeriods()\r\n {\r\n return TimeHelper::timePeriods();\r\n }",
"public function getInterval(){\n\t\treturn $this->interval;\n\t}",
"function streamAnalysisPeriod() : int;",
"public function getInterval();",
"function getOnlineReviewsCount($period, $_businessId) {\n $businessId = intval($_businessId);\n $from = $this->getFrom($period);\n if($from == 'custom') {\n $from = $this->fromTo['from'];\n $to = $this->fromTo['to'];\n $query = \"SELECT count(*) as count FROM review_content \"\n . \"WHERE businessId=$businessId and UNIX_TIMESTAMP(STR_TO_DATE(review_content.time, '%Y-%m-%d %H:%i:%s')) >= {$from} and UNIX_TIMESTAMP(STR_TO_DATE(review_content.time, '%Y-%m-%d %H:%i:%s')) < {$to}\";\n } else {\n $query = \"SELECT count(*) as count FROM review_content \"\n . \"WHERE businessId=$businessId and time >= from_unixtime($from)\";\n }\n\n $result = $this->readConn()->query($query)->fetch(\\PDO::FETCH_ASSOC);\n return intval($result['count']);\n }"
] | [
"0.7501928",
"0.6973885",
"0.6468678",
"0.6432384",
"0.6419506",
"0.64140695",
"0.63804036",
"0.6355221",
"0.63520414",
"0.6284784",
"0.6246909",
"0.6215592",
"0.6215592",
"0.6215592",
"0.6156418",
"0.6152384",
"0.612882",
"0.6089013",
"0.6026795",
"0.6002133",
"0.59585583",
"0.59585583",
"0.59585583",
"0.59585583",
"0.59585583",
"0.59372306",
"0.59331894",
"0.58780444",
"0.5867571",
"0.58513"
] | 0.88967526 | 0 |
Check if a given interval is valid. | public static function isValidInterval(string $interval): bool
{
return isset(self::$methodMapping[$interval]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testItCanValidateIntervalUnit()\n {\n $this->assertTrue(Period::isValidIntervalUnit('day'));\n $this->assertTrue(Period::isValidIntervalUnit('month'));\n $this->assertTrue(Period::isValidIntervalUnit('week'));\n $this->assertTrue(Period::isValidIntervalUnit('year'));\n\n $this->assertfalse(Period::isValidIntervalUnit(''));\n $this->assertfalse(Period::isValidIntervalUnit('date'));\n $this->assertfalse(Period::isValidIntervalUnit('minute'));\n $this->assertfalse(Period::isValidIntervalUnit('days'));\n $this->assertfalse(Period::isValidIntervalUnit('wwek'));\n $this->assertfalse(Period::isValidIntervalUnit('months'));\n $this->assertfalse(Period::isValidIntervalUnit(5));\n }",
"public function abuts(Interval $interval): bool;",
"public function equalsTo(Interval $interval): bool;",
"public function overlaps(Interval $interval): bool;",
"private function containsInterval(self $interval): bool\n {\n if ($this->startDate < $interval->startDate && $this->endDate > $interval->endDate) {\n return true;\n }\n\n if ($this->startDate == $interval->startDate && $this->endDate == $interval->endDate) {\n return $this->boundaryType === $interval->boundaryType || '[]' === $this->boundaryType;\n }\n\n if ($this->startDate == $interval->startDate) {\n return ($this->boundaryType[0] === $interval->boundaryType[0] || '[' === $this->boundaryType[0])\n && $this->containsDatepoint($this->startDate->add($interval->getDateInterval()), $this->boundaryType);\n }\n\n if ($this->endDate == $interval->endDate) {\n return ($this->boundaryType[1] === $interval->boundaryType[1] || ']' === $this->boundaryType[1])\n && $this->containsDatepoint($this->endDate->sub($interval->getDateInterval()), $this->boundaryType);\n }\n\n return false;\n }",
"public static function test($number, $interval)\n {\n $interval = trim($interval);\n\n if (!preg_match('/^'.self::getIntervalRegexp().'$/x', $interval, $matches)) {\n throw new InvalidArgumentException(sprintf('\"%s\" is not a valid interval.', $interval));\n }\n\n if ($matches[1]) {\n foreach (explode(',', $matches[2]) as $n) {\n if ($number == $n) {\n return true;\n }\n }\n } else {\n $leftNumber = self::convertNumber($matches['left']);\n $rightNumber = self::convertNumber($matches['right']);\n\n return\n ('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber)\n && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber)\n ;\n }\n\n return false;\n }",
"function validInterval($element_names, $element_values){\n\t//echo 'elt 2: '.$element_values[1].'<br>';\n\tif (isset($element_values[0]) && !empty($element_values[0]) && isset($element_values[1]) && !empty($element_values[1])){\n\t\treturn isValidInterval($element_values[0],$element_values[1]);\n\t}else{\n\t\treturn true;\n\t}\n\n}",
"public function checkIntervalLimit()\n {\n if (strtotime('- '.$this->config->getIntervalLimit(). ' second') >= $this->data['period']['lastDate']) {\n return true;\n }\n if ($this->data['intervalMaxRequest'] < 1) {\n $this->execBan('Interval');\n return false;\n }\n return true;\n }",
"public function testItThrowExceptionOnInvalidInterval()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Interval unit `dummy` is invalid');\n new Period('dummy');\n }",
"public function abuts(self $interval): bool\n {\n return $this->bordersOnStart($interval) || $this->bordersOnEnd($interval);\n }",
"public function overlaps(self $interval): bool\n {\n return !$this->abuts($interval)\n && $this->startDate < $interval->endDate\n && $this->endDate > $interval->startDate;\n }",
"public function areRangeTimesValid($range)\n {\n $fromTime = explode(\":\", $range[\"from_time\"]);\n $toTime = explode(\":\", $range[\"to_time\"]);\n \n //Check if times have correct formats\n if (count($fromTime) != 2 || count($toTime) != 2) {\n return false;\n }\n \n //Check if from time is before to time\n if ($this->getLocalTimestampForTime($range[\"from_time\"]) >= $this->getLocalTimestampForTime($range[\"to_time\"])) {\n return false;\n }\n \n return true;\n }",
"protected function isCorrectRangeFormat(): bool\n {\n return ($this->operation === 'between' || $this->operation === 'not between')\n && count($this->value) === 2;\n }",
"public function isDuring(self $interval): bool\n {\n return $interval->containsInterval($this);\n }",
"final public function valid()\n {\n $polynom = $this->getPolynom();\n\n if ( $this->min >= $this->max )\n {\n return false;\n }\n\n return ( ( $this->getKey() >= $this->min ) && ( $this->getKey() <= $this->max ) );\n }",
"protected function validateInputDateRange() {\n\t\t$this->data['error'] = [];\n\t\t$ts = [];\n\n\t\tforeach (['from', 'to'] as $field) {\n\t\t\t$value = $this->getInput($field);\n\n\t\t\tif ($this->range_time_parser->parse($value) !== CParser::PARSE_SUCCESS) {\n\t\t\t\t$this->data['error'][$field] = _('Invalid date.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ts[$field] = $this->range_time_parser->getDateTime($field === 'from')->getTimestamp();\n\t\t\t}\n\t\t}\n\n\t\tif ($this->data['error']) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->getInput('method') === 'rangeoffset') {\n\t\t\t$ts['from'] += $this->getInput('from_offset');\n\t\t\t$ts['to'] -= $this->getInput('to_offset');\n\t\t}\n\n\t\t$period = $ts['to'] - $ts['from'] + 1;\n\n\t\tif ($period < ZBX_MIN_PERIOD) {\n\t\t\t$this->data['error']['from'] = _n('Minimum time period to display is %1$s minute.',\n\t\t\t\t'Minimum time period to display is %1$s minutes.', (int) (ZBX_MIN_PERIOD / SEC_PER_MIN)\n\t\t\t);\n\t\t}\n\t\telseif ($period > ZBX_MAX_PERIOD) {\n\t\t\t$this->data['error']['from'] = _n('Maximum time period to display is %1$s day.',\n\t\t\t\t'Maximum time period to display is %1$s days.', (int) (ZBX_MAX_PERIOD / SEC_PER_DAY)\n\t\t\t);\n\t\t}\n\n\t\treturn !$this->data['error'];\n\t}",
"function validate_notification_interval( $notification_interval, $default_notification_interval ) {\n\n\tif ( is_int( $notification_interval ) && $notification_interval >= 0 ) {\n\t\treturn true ;\n\t} else {\n\t\tprint \"# NOTE: Found notification_interval $notification_interval but skipping it because it is not a valid integer value zero or greater. Using default $default_notification_interval\" . PHP_EOL ;\n\t\treturn false ;\n\t}\n}",
"function isValidTime($sh, $sm, $eh, $em, $interval)\n {\n if ($sh > $eh) return false;\n if ($sh == $eh) {\n if ($sm > $em) {\n return false;\n } elseif ($em - $sm <= $interval) {\n return false;\n } else {\n return true;\n }\n }\n return true;\n }",
"public function containsInterval(Interval $interval)\n {\n foreach ($this->intervals as $current) {\n if (0 >= $this->cmpV($current->low(), $interval->low()) &&\n 0 <= $this->cmpV($current->high(), $interval->high())\n ) {\n if (0 == $this->cmpV($current->low(), $interval->low()) &&\n 0 > $this->cmpI($current->low(), $interval->low())\n ) {\n return false;\n }\n if (0 == $this->cmpV($current->high(), $interval->high()) &&\n 0 > $this->cmpI($current->high(), $interval->high())\n ) {\n return false;\n }\n\n return true;\n }\n }\n\n return false;\n }",
"public function isValid()\n {\n return\n $this->is_active &&\n $this->ends_at ? now()->between($this->starts_at, $this->ends_at) :\n now() >= $this->starts_at;\n }",
"public function contains(Period $interval, Period ...$intervals): bool\n {\n $intervals[] = $interval;\n foreach ($intervals as $period) {\n if (false === $this->indexOf($period)) {\n return false;\n }\n }\n\n return true;\n }",
"function check_time( $value, $min, $max) {\n // Extract range and step\n $a = explode( '/', $value);\n if (isset( $a[2])) return false;\n // Check step if present\n if (isset( $a[1])) {\n\t$step = $a[1];\n\tif (!preg_match( '/^[0-9]+$/', $step)) return false;\n\tif (($step < 1) || ($step > $max)) return false;\n }\n // Check range\n $range = $a[0];\n if ($range == '*') return true;\n $nums = split( '[,-]', $range);\n // Check numbers in range\n $last = (-1);\n foreach ($nums as $n) {\n\tif (!preg_match( '/^[0-9]+$/', $n)) return false;\n\tif (($n < $min) || ($n > $max) || ($last >= $n)) return false;\n\t$last = $n;\n }\n return true;\n}",
"public function validUntil();",
"public function isWithinNext($timeInterval);",
"public function isValid($value)\n {\n $this->reset();\n\n if ( ! is_string($value)) {\n $this->error(self::INVALID);\n return false;\n }\n\n if (preg_match('/^(2[0-3]|[01][0-9]):[0-5][0-9]$/', $value)) {\n $time = strtotime($value);\n\n if (Quform::isNonEmptyString($this->config('min'))) {\n $min = $this->config('min') == '{now}' ? strtotime(date('H:i')) : strtotime($this->config('min'));\n\n if ($time < $min) {\n $this->error(self::TOO_EARLY, array(\n 'min' => date($this->config('format'), $min),\n 'value' => date($this->config('format'), $time)\n ));\n\n return false;\n }\n }\n\n if (Quform::isNonEmptyString($this->config('max'))) {\n $max = $this->config('max') == '{now}' ? strtotime(date('H:i')) : strtotime($this->config('max'));\n\n if ($time > $max) {\n $this->error(self::TOO_LATE, array(\n 'max' => date($this->config('format'), $max),\n 'value' => date($this->config('format'), $time)\n ));\n\n return false;\n }\n }\n\n if (Quform::isNonEmptyString($this->config('interval'))) {\n $interval = (int) $this->config('interval');\n $parts = explode(':', $value);\n $minutes = (int) $parts[1];\n\n if ($minutes % $interval !== 0) {\n $this->error(self::BAD_INTERVAL, array(\n 'interval' => $interval,\n 'value' => date($this->config('format'), $time)\n ));\n\n return false;\n }\n }\n\n return true;\n }\n\n $this->error(self::INVALID_TIME);\n return false;\n }",
"public function inInterval($value) {\n if (!is_numeric($value)) {\n return FALSE;\n }\n else if ($this->isEmpty()) {\n return FALSE;\n }\n else if (!$this->allowFloats() && is_double($value)) {\n return FALSE;\n }\n else if ($this->includeLowerBound() && $value < $this->getLowerBound()) {\n return FALSE;\n }\n else if (!$this->includeLowerBound() && $value <= $this->getLowerBound()) {\n return FALSE;\n }\n else if ($this->includeUpperBound() && $value > $this->getUpperBound()) {\n return FALSE;\n }\n else if (!$this->includeUpperBound() && $value >= $this->getUpperBound()) {\n return FALSE;\n }\n else {\n return TRUE;\n }\n }",
"protected function isValid($num, $current) { \n return !isset($current[$num]) && ($num >= 1 && $num <= 59);\n }",
"public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_REALTIME,self::VALUE_DELAYED,self::VALUE_ONEMINUTE,self::VALUE_FIVEMINUTE,self::VALUE_TENMINUTE,self::VALUE_THIRTYMINUTE,self::VALUE_ONEHOUR,self::VALUE_PERIOD));\n\t}",
"public function testIntervalOverlap()\r\n\t{\r\n\t\t$interval = new \\CF\\Chrono\\Interval();\r\n\t\t$interval->onTimestamp(STAMP_2019);\r\n\t\t$this->assertEquals([], $interval->getMatchesBetween(START_2019, 1551744000));\r\n\t\t\r\n\t\t// Starting past the interval's set end date\r\n\t\t$interval = new \\CF\\Chrono\\Interval();\r\n\t\t$interval->ending(START_2019 - OFFSET_413_AM);\r\n\t\t$this->assertEquals([], $interval->getMatchesBetween(START_2019, END_2019));\r\n\t\t\r\n\t\t// Ending before the interval's set start date\r\n\t\t$interval = new \\CF\\Chrono\\Interval();\r\n\t\t$interval->starting(END_2019 + OFFSET_413_AM);\r\n\t\t$this->assertEquals([], $interval->getMatchesBetween(START_2019, END_2019));\r\n\t\t\r\n\t\t// Starting and ending between valid minute intervals\r\n\t\t$interval = new \\CF\\Chrono\\Interval(\"~15\");\r\n\t\t$this->assertEquals([], $interval->getMatchesBetween(START_2019 + 24, START_2019 + 42));\r\n\t\t\r\n\t\t// Starting and ending between valid daily intervals\r\n\t\t$interval = new \\CF\\Chrono\\Interval(\"}40\");\r\n\t\t$interval->starting(1548806400);\r\n\t\t$this->assertEquals([], $interval->getMatchesBetween(1548892800, 1549324800));\r\n\t}",
"protected function validateEventInterval()\n {\n // Trick for calculate seconds from interval\n $intervalInSeconds = Carbon::now()\n ->diffInSeconds(Carbon::now()->add($this->eventInterval));\n\n // Must be less then 24 H\n if ( ! ($intervalInSeconds < (24 * 60 * 60))) {\n throw new LogicException('Event interval must be less then 24 Hours');\n }\n }"
] | [
"0.7081672",
"0.6993576",
"0.694909",
"0.67369264",
"0.6592908",
"0.6465398",
"0.63341194",
"0.63174933",
"0.6216204",
"0.61573046",
"0.6099624",
"0.60893005",
"0.6055295",
"0.6017002",
"0.6014757",
"0.59962714",
"0.59937465",
"0.5906881",
"0.5898998",
"0.5877697",
"0.5873275",
"0.5863435",
"0.5862528",
"0.58175904",
"0.5794546",
"0.57767695",
"0.5762488",
"0.5754853",
"0.57401955",
"0.57097465"
] | 0.7209265 | 0 |
fonction retournant le nombre de jours entre 2 dates | function diff_date($date_fin, $date_debut)
{
$tab_datedebut = split("-", $date_debut);
$tab_datefin = split("-", $date_fin);
$mktime_debut = mktime(0, 0, 0, $tab_datedebut[1], $tab_datedebut[2], $tab_datedebut[0]);
$mktime_fin = mktime(0, 0, 0, $tab_datefin[1], $tab_datefin[2], $tab_datefin[0]);
$diff_date = $mktime_fin-$mktime_debut;
$nb_jours = (int)($diff_date/(60*60*24));
return $nb_jours;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function nombreJours(): int\n {\n\n $debutMois = $this->premierJourduMois();\n $finMois = (clone $debutMois)->modify('+1 month -1 day');\n\n $debuSemaine = intval($debutMois->format('W'));\n $finSemaine = intval($finMois->format('W'));\n\n if ($finSemaine === 1) {\n $finSemaine = intval((clone $finMois)->modify('-7 days')->format('W')) + 1;\n }\n $jours = $finSemaine - $debuSemaine + 1;\n if ($jours < 0) {\n $jours = $finMois->format('W');\n }\n return $jours;\n }",
"function getDateHour($fecha){ \n $tiempo = explode(\" \", $fecha);\n \n $fecha = $tiempo[0];\n $mes = getMes($fecha);\n \n $fecha = explode(\"-\", $fecha);\n $anio = $fecha[0]; \n $dia = $fecha[2];\n \n $hora = $tiempo[1];\n \n return \"$dia de $mes de $anio <br /> <i class='fa fa-clock-o'></i> $hora\".\"HRS\";\n \n}",
"public function horaCierreF(){\n $carbon = Carbon::parse($this->horaCierre);\n $minutes = $carbon->minute < 10? \"0$carbon->minute\" : $carbon->minute;\n return \"$carbon->hour:$minutes hrs.\";\n }",
"function NbJours($debut, $fin) {\n $tDeb = explode(\"-\", $debut);\n $tFin = explode(\"-\", $fin);\n $diff = mktime(0, 0, 0, $tFin[1], $tFin[2], $tFin[0]) - \n mktime(0, 0, 0, $tDeb[1], $tDeb[2], $tDeb[0]);\n return(($diff / 86400)+1);\n}",
"function RestarHoras($hora1,$hora2,$mer)\n{\n$hora1=explode(\":\",$hora1);\n$hora2=explode(\":\",$hora2);\nif ($mer==\"1\") if($hora1[0] < 12)$mer=\"AM\"; else $mer=\"PM\";\n$horas=(int)$hora1[0]-(int)$hora2[0];\n$minutos=(int)$hora1[1]-(int)$hora2[1];\n$segundos=(int)$hora1[2]-(int)$hora2[2];\n$horas+=(int)($minutos/60);\n$minutos=(int)($minutos%60)+(int)($segundos/60);\n$segundos=(int)($segundos%60);\n\nreturn (str_pad($horas, 2, '0', STR_PAD_LEFT).\":\".str_pad($minutos, 2, '0', STR_PAD_LEFT).\":\".str_pad($segundos, 2, '0', STR_PAD_LEFT).\" \".$mer);\n}",
"function lama_pengerjaan($start, $finish, $format = \"%h jam %i menit %s detik\")\n{\n $date_a = new DateTime($start);\n $date_b = new DateTime($finish);\n\n $interval = date_diff($date_a, $date_b);\n\n $result = $interval->format($format);\n $result = str_replace(array(\"0 jam\", \" 0 menit\", \" 0 detik\"), '', $result);\n\n return trim($result);\n}",
"function fechaHoy(){\n $diaHoy = date('j');\n $meses = array(\"Ene\",\"Feb\",\"Mar\",\"Abr\",\"May\",\"Jun\",\"Jul\",\"Ago\",\"Sep\",\"Oct\",\"Nov\",\"Dic\");\n $mesHoy = $meses[date('n')-1];\n $yearHoy = date('Y');\n $fechaActual = $mesHoy.\" \".$diaHoy.\", \".$yearHoy;\n return $fechaActual;\n }",
"public function llegadaSugeridaPersonalNoche(){\n if($this->horaCierre=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el equipo debe llegar 00:30hrs antes del cierre del local\n return date('H:i:s', strtotime($this->horaCierre)-1800); // 3600 = 30min * 60seg\n }else{\n // en los otros clientes, el equipo debe llegar 01:00hrs antes\n return date('H:i:s', strtotime($this->horaCierre)-3600); // 3600 = 60min * 60seg\n }\n }\n }",
"function sumahoras ($hora1,$hora2){\n$hora1=explode(\":\",$hora1);\n$hora2=explode(\":\",$hora2);\n$horas=(int)$hora1[0]+(int)$hora2[0];\n$minutos=(int)$hora1[1]+(int)$hora2[1];\n$segundos=(int)$hora1[2]+(int)$hora2[2];\n$horas+=(int)($minutos/60);\n$minutos=(int)($minutos%60)+(int)($segundos/60);\n$segundos=(int)($segundos%60);\n\nreturn (str_pad($horas, 2, '0', STR_PAD_LEFT).\":\".str_pad($minutos, 2, '0', STR_PAD_LEFT).\":\".str_pad($segundos, 2, '0', STR_PAD_LEFT));\n}",
"public function getPaiementNombreDeJours(): ?int {\n return $this->paiementNombreDeJours;\n }",
"protected function nbJours($debut, $fin) {\n\t\t$nbSecondes = 60*60*24;\n\t\n\t\t$debut_ts = strtotime($debut);\n\t\t$fin_ts = strtotime($fin);\n\t\t$diff = $fin_ts - $debut_ts;\n\t\treturn ($diff / $nbSecondes);\n\t}",
"function add_heures($heure1,$heure2){\t\n$secondes1=heure_to_secondes($heure1);\n\t$secondes2=heure_to_secondes($heure2);\n\t$somme=$secondes1+$secondes2;\n\t//transfo en h:i:s\n\t$s=$somme % 60; //reste de la division en minutes => secondes\n\t$m1=($somme-$s) / 60; //minutes totales\n\t$m=$m1 % 60;//reste de la division en heures => minutes\n\t$h=($m1-$m) / 60; //heures\n\t//$resultat=$h.\"H \".$m.\"mn \".$s.\"s\";\n\t$resultat=$h.\":\".$m;\n\treturn $resultat;\n}",
"function obtenerFechaEnLetra($fecha){\n $num = date(\"j\", strtotime($fecha));\n $anno = date(\"Y\", strtotime($fecha));\n $mes = array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre');\n $mes = $mes[(date('m', strtotime($fecha))*1)-1];\n\t$mes = ucfirst ($mes);\n return $num.' de '.$mes.' de '.$anno;\n\n}",
"function mostrar_hora($segundos)\n{\n\tif(bcmod($segundos, 3600)==0)\n\t{\n\t\t$hora=$segundos/3600;\n\t\t$minutos=\"00\";\n\t\t\n\t}\n\telseif (bcmod($segundos, 3600)!=0)\n\t{\t\n\t\t$minutes = bcmod($segundos, 3600);\n\t\t$hour=$segundos-$minutes;\n\t\t$hora=$hour/3600;\n\t\t$minutos = $minutes/60;\n\t\t\n\t}\n\treturn $hora.\":\".$minutos;\n\t \n}",
"function convertirTemps($duree){\n\t$jour=intval(($duree / 3600) / 24);\n\t$heures=intval(($duree / 3600)% 24);\n\t$minutes=intval(($duree % 3600) / 60);\n\t$secondes=intval((($duree % 3600) % 60));\n\treturn(\" \".$jour.\"j \".$heures.\"h \".$minutes.\"m \".$secondes.\"s \");\n}",
"public function getDateJeuxConcours() {\n\t\t$sql = \"SELECT * FROM hapta_concours AS hc JOIN hapta_event AS he ON hc.idEvent = he.id\";\n\t\t$resultat = $this->rechquery($sql);\n\t\treturn $resultat;\n\t}",
"public function printDurationInHour(){\r\n\t\tglobal $_LANG;\r\n\t\t$ret= \"\";\r\n\t\t$hour = floor(($this->enddate - $this->startdate) / (60 * 60));\r\n\t\t$minutes = (int) ceil((($this->enddate - $this->startdate) % (60 * 60)) / 60);\r\n\t\tif($hour > 0){\r\n\t\t\t$ret .= $hour.\" \".$_LANG->get('Std').\". \";\r\n\t\t}\r\n\t\tif($minutes > 0){\r\n\t\t\t$ret .= $minutes.\" \".$_LANG->get('Min').\".\";\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}",
"function workNeeded($projectMinutes, $freelancers) {\n $x = $projectMinutes - array_sum(array_map(function($f){\n return $f[0] * 60 + $f[1];\n },$freelancers));\n return $x > 0 ? \"I need to work \" . floor($x/60) . \" hour(s) and \" . floor($x%60) . \" minute(s)\" : \"Easy Money!\";\n}",
"public function llegadaSugeridaLiderNoche(){\n if($this->horaCierre=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el lider debe llegar 1 hora antes\n return date('H:i:s', strtotime($this->horaCierre)-3600); // 3600 = 60min * 60seg\n }else{\n // en los otros clientes, el lider debe llegar 1:30 antes\n return date('H:i:s', strtotime($this->horaCierre)-5400); // 5400 = 90min * 60seg\n }\n }\n }",
"function get_end($date1,$date2, $choix, $naviguer=\"=\") {\n\n //objet language\n $mlanguage = new MLanguage(isset($_SESSION['LANGUAGE']) ? $_SESSION['LANGUAGE'] : 'fr' );\n //tableau de langue associé\n $lang = $mlanguage->arrayLang();\n\n $year = date('Y',strtotime($date1));\n $month = date('m',strtotime($date1));\n if ($choix == $lang['month']) {\n if ($naviguer == \"<\") {\n $month--;\n }\n elseif ($naviguer == \">\"){\n $month++;\n }\n if ($month == 0){\n $month=12;\n $year--;\n }\n if ($month == 13){\n $month=1;\n $year++;\n }\n return date('Y-m-t', strtotime($year.'-'.$month.'-01'));\n }\n elseif( $choix == $lang['year']) {\n if ($naviguer == \"<\") {\n $year--;\n }\n elseif ($naviguer == \">\") {\n $year++;\n if ($year >= date('Y')){\n $year = date('Y');\n }\n }\n return date('Y-12-31', strtotime($year.'-12-31'));\n } \n else {\n return $date2; \n }\n\n}",
"function get_journee_format_long($journee_short)\n{\n\tdate_default_timezone_set('Europe/Paris');\n\tif(date('n') > 6){\n\t\treturn date(\"Y\").$journee_short;\n\t}else{\n\t\treturn (date(\"Y\")-1).$journee_short;\n\t}\n}",
"function showCalendar($periode) {\r\n $leCalendrier = \"\";\r\n // Tableau des valeurs possibles pour un numéro \r\n //de jour dans la semaine\r\n $tableau = Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"0\");\r\n\r\n $nb_jour = Date(\"t\", mktime(0, 0, 0, getMonth($periode), \r\n 1, getYear($periode)));\r\n $pas = 0;\r\n $indexe = 1;\r\n\r\n \r\n\r\n \r\n // Tant que l'on n'a pas affecté tous les jours du mois traité\r\n\twhile ($pas < $nb_jour) {\r\n\t\t$a=\"\";\r\n\t$malade=$_SESSION[\"malade\"];\r\n $a2= Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode)));\r\n\t\t $con=mysqli_connect(\"localhost\",\"root\",\"\",\"hopital\");\r\n\t\t $req=mysqli_query($con,\"select * from rendezvous where idMalade='${malade}'and rendezVous='${a2}' \");\r\n\t\t $res=mysqli_fetch_array($req);\r\n\t\t $a=$res[\"rendezVous\"];\r\n if ($indexe == 1) $leCalendrier .= \r\n \"\\n\\t<ul class=\\\"days\\\">\";\r\n\r\n // Si le jour calendrier == jour de la semaine en cours\r\n if (Date(\"w\", mktime(0, 0, 0, getMonth($periode), \r\n 1 + $pas, getYear($periode))) == $tableau[$indexe]) {\r\n // Si jour calendrier == aujourd'hui\r\n $afficheJour = Date(\"j\", mktime(0, 0, 0, \r\n getMonth($periode), 1 + $pas, getYear($periode)));\r\n\t\t \r\n if (Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode))) == Date(\"Y-m-d\")) {\r\n $class = \" class=\\\"itemCurrentItem\\\"\";\r\n\t\t\t\t\r\n\r\n }\r\n else {\r\n // 1 est toujours vrai => on affiche \r\n //un lien à chaque fois\r\n // A vous de faire les tests \r\n //nécessaire si vous gérer un agenda par exemple\r\n\t\t\t\tif (Date(\"Y-m-d\", mktime(0, 0, 0, getMonth($periode),\r\n 1 + $pas, getYear($periode))) == Date($a)) {\r\n\t\t\t \r\n $class = \" class=\\\"fas\\\"\";\r\n\t\t $afficheJour =\"\";\r\n\r\n\r\n\t\t }\r\n else {\r\n $class = \" class=\\\"itemExistingItem\\\"\";\r\n $afficheJour = Date(\"j\",\r\n mktime(0, 0, 0, getMonth($periode), 1 + \r\n $pas, getYear($periode)));\r\n\r\n }\r\n \r\n }\r\n // Ajout de la case avec la date\r\n $leCalendrier .= \"\\n\\t\\t<li$class>\r\n $afficheJour</li>\";\r\n $pas++;\r\n }\r\n //\r\n else {\r\n\r\n // Ajout d'une case vide\r\n $leCalendrier .= \"\\n\\t\\t<li> </li>\";\r\n }\r\n if ($indexe == 7 && $pas < $nb_jour) \r\n { $leCalendrier \r\n .= \"\\n\\t</ul>\"; $indexe = 1;} else {$indexe++;}\r\n }\r\n\r\n // Ajustement du tableau\r\n for ($i = $indexe; $i <= 7; $i++) {\r\n $leCalendrier .= \"\\n\\t\\t<li> </li>\";\r\n }\r\n $leCalendrier .= \"\\n\\t</ul>\\n\";\r\n\r\n // Retour de la chaine contenant le Calendrier\r\n return $leCalendrier;\r\n\r\n }",
"function conversorSegundosHorasExcel($tiempo_en_segundos) {\n\n $horas = floor($tiempo_en_segundos / 3600);\n $minutos = floor(($tiempo_en_segundos - ($horas * 3600)) / 60);\n $segundos = $tiempo_en_segundos - ($horas * 3600) - ($minutos * 60);\n \n $hora_texto = \"\";\n // if ($horas > 0 ) {\n\n $hora_texto .= str_pad($horas, 2, \"0\", STR_PAD_LEFT) . \":\".str_pad($minutos, 2, \"0\", STR_PAD_LEFT);\n\n\n // }\n /*\n if ($minutos > 0 ) {\n\n $hora_texto .= . \":\";\n }\n \n if ($segundos > 0 ) {\n $hora_texto .= str_pad($segundos, 2, \"0\", STR_PAD_LEFT) . \":\";\n }*/\n \n return $hora_texto;\n}",
"function date_fr($date_saisie){\n @list ($jour , $mois , $an) = split(\"[-./]\",$date_saisie);\n //inverse la date\n return($an.\"-\".$mois.\"-\".$jour);\n \n}",
"function fechaComp2Espanol($fecha){\n\t\tif ($fecha == \"\"){return \"\" ;}\n\n\t\t$aaaa = substr($fecha,0,4);\n\t\t$mm = substr($fecha,5,2);\n\t\t$dd = substr($fecha,8,2);\n\t\treturn $fecha = $dd.\"/\".$mm.\"/\".$aaaa;\n\t}",
"function formataHora($hrEntrada, $mnEntrada) {\n $hrSaida;\n $mnSaida;\n\n switch ($hrEntrada) {\n case \"0\": $hrSaida = \"00\";\n break;\n case \"1\": $hrSaida = \"01\";\n break;\n case \"2\": $hrSaida = \"02\";\n break;\n case \"3\": $hrSaida = \"03\";\n break;\n case \"4\": $hrSaida = \"04\";\n break;\n case \"5\": $hrSaida = \"05\";\n break;\n case \"6\": $hrSaida = \"06\";\n break;\n case \"7\": $hrSaida = \"07\";\n break;\n case \"8\": $hrSaida = \"08\";\n break;\n case \"9\": $hrSaida = \"09\";\n break;\n case \"10\": $hrSaida = \"10\";\n break;\n case \"11\": $hrSaida = \"11\";\n break;\n case \"12\": $hrSaida = \"12\";\n break;\n case \"13\": $hrSaida = \"13\";\n break;\n case \"14\": $hrSaida = \"14\";\n break;\n case \"15\": $hrSaida = \"15\";\n break;\n case \"16\": $hrSaida = \"16\";\n break;\n case \"17\": $hrSaida = \"17\";\n break;\n case \"18\": $hrSaida = \"18\";\n break;\n case \"19\": $hrSaida = \"19\";\n break;\n case \"20\": $hrSaida = \"20\";\n break;\n case \"21\": $hrSaida = \"21\";\n break;\n case \"22\": $hrSaida = \"22\";\n break;\n case \"23\": $hrSaida = \"23\";\n break;\n }\n\n switch ($mnEntrada) {\n case \"00\": $mnSaida = \":00:00\";\n break;\n case \"10\": $mnSaida = \":10:00\";\n break;\n case \"15\": $mnSaida = \":15:00\";\n break;\n case \"20\": $mnSaida = \":20:00\";\n break;\n case \"25\": $mnSaida = \":25:00\";\n break;\n case \"30\": $mnSaida = \":30:00\";\n break;\n case \"35\": $mnSaida = \":35:00\";\n break;\n case \"40\": $mnSaida = \":40:00\";\n break;\n case \"45\": $mnSaida = \":45:00\";\n break;\n case \"50\": $mnSaida = \":50:00\";\n break;\n case \"55\": $mnSaida = \":55:00\";\n break;\n case \"59\": $mnSaida = \":59:59\";\n break;\n }\n\n\n return $hrSaida . $mnSaida;\n }",
"private function calculateStJohnsDay(): void\n {\n $stJohnsDay = $this->year < 1955 ? \"$this->year-6-24\" : \"$this->year-6-20 this saturday\";\n\n $this->addHoliday(new Holiday(\n 'stJohnsDay',\n [],\n new DateTime($stJohnsDay, DateTimeZoneFactory::getDateTimeZone($this->timezone)),\n $this->locale\n ));\n }",
"public function hours() {\n echo Kohana::debug(date::hours());\n echo Kohana::debug(date::hours(1,false,9));\n echo Kohana::debug(date::hours(1,true,20));\n echo Kohana::debug(date::hours(1,true,date('g')));\n }",
"function fecha($fecha){\n$fecha = strtotime($fecha);\n$dias = array(\"Dom\",\"Lun\",\"Mar\",\"Mie\",\"Jue\",\"Vie\",\"Sáb\");\n$meses = array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n//echo $dias[date('w')].\" \".date('d').\", \".$meses[date('n')-1]. \" \".date('Y') ;\n//Salida: Viernes 24 de Febrero del 2012\n$fecha_1 = $dias[date('w',$fecha)].\" \".date('d',$fecha).\", \".$meses[date('n',$fecha)-1].\" \".date('Y',$fecha).\" \".date('g:i A',$fecha);\n\nreturn $fecha_1;\n\n}",
"private function aktuellesSemester() {\n\t\t$heute = explode(\".\", date(\"d.m\"));\n\t\t$fruehling = explode(\".\", $this->optionen[\"START_SOMMERSEMESTER\"]);\n\t\t$herbst = explode(\".\", $this->optionen[\"START_WINTERSEMESTER\"]);\n\n\t\tif($heute[1] > $fruehling[1] || ($heute[1] == $fruehling[1] && $heute[0] >= $fruehling[0]) ) {\n\t\t\tif($heute[1] < $herbst[1] || ($heute[1] == $herbst[1] && $heute[0] <= $herbst[0]) ) {\n\t\t\t\t// Sommersemester\n\t\t\t\treturn date(\"Y\") . \"s\";\n\t\t\t}\n\t\t}\n\t\t// Wintersemester\n\t\t$jahr = $this->toNumber(date(\"Y\"));\n\n\t\t//Wenn das neue Kalenderjahrangefangen hat, aber das Semester noch vom Vorjahr gilt. -> Einmal runterzaehlen\n\t\tif($heute[1] < $fruehling[1]) $jahr--;\n\t\treturn $jahr . \"w\";\n\t}"
] | [
"0.6962726",
"0.6024754",
"0.5710633",
"0.5698819",
"0.5681312",
"0.5655456",
"0.5597751",
"0.5530657",
"0.5486611",
"0.54581577",
"0.5453892",
"0.5451047",
"0.53644127",
"0.5358054",
"0.5350152",
"0.53263456",
"0.532054",
"0.5282811",
"0.5269728",
"0.52496976",
"0.52416164",
"0.5232306",
"0.52237123",
"0.5221648",
"0.5207975",
"0.51963156",
"0.51866364",
"0.51687384",
"0.5153521",
"0.51520616"
] | 0.60706896 | 1 |
ajoute des points au client | function ajoutePoint($nb_point, $client, $type, $annonce="")
{
$query = "INSERT INTO point_clients (point, client, datetime, type, annonce) VALUES ('".$nb_point."', '".$client."', '".date("Y-m-d H:i:s")."', '".$type."', '".$annonce."')";
mysql_query($query) or die(mysql_error());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function sendPointMap($PuntoMapa){\n\t\t\n\t}",
"function add_point($user, $list, $content){\n\t//database\n\t$database = $GLOBALS['database'];\n\n\t//grabbing the latest id\n\t$id = $database->get_data(\"POINT_ID\", \"LIST_POINTS\", \"ORDER BY POINT_ID DESC LIMIT 1\");\n\t$id = $id[0][\"POINT_ID\"] + 1;\n\n\t//database for inserting data\n\t$database->insert(\"LIST_POINTS\", \"$id , $content , $list\");\n\n\theader(\"Refresh:0; url=lists.php?action=display&list=$list\");\n}",
"function addPoint($lon, $lat, $alt=0, $user_options , $sLayer = '') {\n //print_r($user_options); \n //print_r($user_options); exit;\n if(!isset($lon) or !isset($lat)) { return null; }\n\n $this->point_counter++;\n\n $defaults = array('title' => 'PointTitle', 'description' => 'PointDescription' , 'heading' => 0, 'altitude' =>0, 'visibility' => 1, 'altitude' =>0, 'range' => 150, 'tilt' => 60, 'altitudemode' =>'clampToGround', 'tessellate' => 1, 'extrude' => 1);\n $options = array_merge($defaults, $user_options);\n// print_r($options);exit;\n\n\n $sResponse = '<Placemark id=\"po_'. $this->point_counter . '\">' . \"\\n\";\n if(isset($options['timestamp'])){\n $sResponse .= \"<TimeStamp><when>\" .$options['timestamp'] . \"</when></TimeStamp>\" . \"\\n\";\n if (!empty($options['begin'])) {\n $sResponse .= \"<TimeSpan><begin>\" .$options['begin'] . \"</begin>\" . \"\\n\";\n if (!empty($options['end'])) {\n $sResponse .= \"<end>\" .$options['end'] . \"</end></TimeSpan>\" . \"\\n\";\n } else {\n $sResponse .= \"</TimeSpan>\" . \"\\n\";\n }\n }\n }\n\n //$sResponse .= \"<description><![CDATA[\" . $options['description'] . \"]]>\" . \"</description>\" . \"\\n\";\n if(isset($options['title'])){\n $mkey='name';\n $sResponse .= sprintf('<%s><![CDATA[%s]]></%s>%s',$mkey, $options['title'],$mkey,\"\\n\");\n //$sResponse .= \"<name>\". $options['title'] .\"</name>\" . \"\\n\";\n }\n if(isset($options['description'])){\n $sResponse .= \"<description><![CDATA[\" . $options['description'] . \"]]>\" . \"</description>\" . \"\\n\";\n }\n\n /* other attributes */\n $special_attr_list = array('timestamp','title','description','visibility','coordinates','altitudemode','altitude','extrude','begin','end');\n foreach ( $options as $mattr => $value) {\n if (!in_array($mattr, $special_attr_list)) {\n $sResponse .= sprintf('<%1$s>%2$s</%1$s>%3$s',$mattr,$value,\"\\n\");\n }\n }\n // $sResponse .= '<heading>'. $options['heading'] . '</heading>' . \"\\n\";\n if(isset($options['visibility'])){\n $sResponse .= '<visibility>1</visibility>' . \"\\n\";\n }\n $sResponse .= \"<styleUrl>#$sLayer</styleUrl>\" . \"\\n\";\n $sResponse .= '<Point>' . \"\\n\";\n if(isset($options['visibility'])){\n $sResponse .= \"<tessellate>\". $options['tessellate'] .\"</tessellate>\" . \"\\n\";\n }\n //$sResponse .= \"<extrude>\". $options['extrude'] .\"</extrude>\" . \"\\n\";\n\n $sResponse .= \"<coordinates>$lon,$lat,$alt</coordinates>\" . \"\\n\";\n $sResponse .= '</Point>' . \"\\n\";\n $sResponse .= '</Placemark>' . \"\\n\";\n $this->add_element($sResponse);\n }",
"function addPoint(PointEntity $point)\r\n {\r\n }",
"public function __construct($points) { \n\t\n $this->points = $points;\n\t\t\n }",
"public function actionPoint()\n {\n $answer=array();\n try {\n //Yii::$app->request->isAjax &&\n if($id=Yii::$app->request->post('id')){\n\n $point = Point::autor_layer($_POST['id']);\n\n if($point){\n $answer['result'] = '1';\n $answer['data']['point']= $point;}\n else\n throw new ErrorException('Точка не найдена',0);\n\n }else\n throw new ErrorException('Только POST',0);\n\n\n } catch (ErrorException $e) {\n $answer['msg'] = $e->getMessage();\n $answer['result'] = '0';\n }\n\n echo json_encode($answer);\n }",
"public function actionGetAnotherPoints(){\n if (Yii::app()->request->isAjaxRequest) {\n\n $geos = array();\n $team = Team::getTeam();\n $usersIds = $team->getUsersInMap();\n if($usersIds){\n foreach ($usersIds as $userId) {\n if($team->user_host_id !=$userId){\n $geoLocal = GeoUnique::getByUserId($userId);\n $geos[$userId]['updated'] = 'Updated ' . (time() - $geoLocal->time) . ' secs ago!';\n $geos[$userId]['cores'] = array($geoLocal->latitude, $geoLocal->longitude);\n $geos[$userId]['title'] = User::getUserIdentityById($userId);\n $geos[$userId]['icocolor']=$this->getColor($geoLocal->time);\n $geos[$userId]['corecolor']=$this->getCoreColor($geoLocal->time);\n }\n }\n }\n echo json_encode($geos, 1);\n }\n }",
"function pointLocation() {\n \n }",
"private function new_user_points($user_id){\n\t\t$point = new Point;\n \t$point->user_id = $user_id;\n \t$point->points = 200;\n \t$point->description = trans('lang.registration');\n \t$point->save();\n\t}",
"function addClientAdresse( $adresse )\n{\n\t$r1 = $this->w - 80;\n\t$r2 = $r1 + 68;\n\t$y1 = 40;\n\t$this->SetXY( $r1, $y1);\n\t$this->MultiCell( 60, 4, $adresse);\n}",
"public function insertDataPoint() {\n\t\t//not used. To be completed.\n\t\t// $name = 'Free spot', $metaInfo, $lat, $lng, $comments = ''\n\t\tif ($this->model->validatePoint() ) {\n\t\t\t$this->model-> insertPoint();\n\t\t\techo json_encode(\"1\");\n\t\t}else {\n\t\t\tself::sendAPIerror(403, 'Error Processing Request');\n\t\t}\n\t}",
"public function setAsPoints($points) {\n\t\t$wkt = '';\n\t\t$pointsWKT = array();\n\t\tforeach($points as $point) {\n\t\t\t$pointsWKT[] = implode(' ', $point);\n\t\t}\n\t\t$wkt = implode(',',$pointsWKT);\n\t\t$this->setAsWKT($this->stat('wkt_name') . \"({$wkt})\");\n\t}",
"public function setPoints($points)\n\t{\n\t\t$this->points = $points;\n\t}",
"public function set_points_users($user_id,$points){\n\t\t$sql1=mysqli_query($this->_con, \"update users set user_points= user_points+'$points' where id='$user_id'\");\n\t}",
"public static function set_coord_extern() {\r\n\r\n\t\tglobal $db;\r\n\t\t\r\n\t//appropriate number of select query in this case 40-80\r\n\t $result5Pegel = $db->qry(\" SELECT pegelnummer,Rechtswert_GK,Hochwert_GK,lat,lon,daten_fehler FROM \".TABLE_PEGEL2.\" WHERE `lat` = '' AND `lon` = '' AND `Rechtswert_GK` != '0.00' AND `Hochwert_GK` != '0.00' ORDER BY `pegelnummer` DESC LIMIT 0, 40 \");\r\n\t if ($result5Pegel){\r\n\t\techo 'successful connection and selection';\r\n\t\t//write to logfile \r\n\t\t$msg = \"successful connection and selection\";\r\n\t\tLog::write(LOG_OTHER, $msg);\r\n\t\t}\r\n\t\telse {\r\n\t\techo 'error connection and selection';\r\n\t\t//write to logfile \r\n\t\t$msg = \"error connection and selection\";\r\n\t\tLog::write(LOG_OTHER, $msg);\r\n\t\t}\r\n\t \r\n\t for ($i = 0; $i < mysql_num_rows($result5Pegel); $i++ )\r\n\t { \r\n\t \twhile ($row5Pegel = mysql_fetch_array($result5Pegel))\r\n\t \t{ \r\n\t\t\t$pegelnummer = $row5Pegel[\"pegelnummer\"];\r\n\t\t\t$rw = $row5Pegel[\"Rechtswert_GK\"];\r\n\t\t\t$hw = $row5Pegel[\"Hochwert_GK\"];\r\n\t\t\t\r\n\t\t$externeurl = 'http://raumplanung.tobwen.de/OSM/scripts/gk2wgs84.php?LAGE=DE_complete&RW='.$rw.'&HW='.$hw.'';\r\n\t\t$page = Util::get_document($externeurl);\r\n\r\n\t\t//change : to , result is LAT, LON, 52.6827554958, 9.70345365009\r\n\t\t$page = str_replace(\":\",\",\",$page);\r\n\t\t//explode , and write to array\r\n\t\t$avar = explode(\",\", $page);\r\n\t\t\r\n\t\t//use only field number 3 and 4, index starts by 0\r\n\t\t$lat = $avar[2];\r\n\t\t$lon = $avar[3];\r\n\t\t\r\n\t$result = $db->qry(\" UPDATE \".TABLE_PEGEL2.\" SET \r\n\tpegelnummer='$pegelnummer',\r\n\tlat='$lat',\r\n\tlon='$lon'\r\n\tWHERE pegelnummer='$pegelnummer' \");\r\n\r\n\tif ($result){\r\n\techo 'successful update coordinates';\r\n\techo '<br><br>';\r\n\t\t//write to logfile \r\n\t$msg = \"successful update coordinates\";\r\n\tLog::write(LOG_OTHER, $msg);\r\n\t}\r\n\telse {\r\n\techo 'error see sql.log';\r\n\t}\r\n\t } \r\n\t }\r\n\t\t\r\n\t}",
"public function add_client(){\n $spathSQL= $this->GLOBALS_INI[\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATH_MODEL\"] . \"add_client.sql\";\n $this->resultat[\"devis_add_client\"]= $this->oBdd->treatDatas($spathSQL, array(\n \"id_ville\" => $this->VARS_HTML[\"id_ville\"], \n \"prenom_client\" => $this->VARS_HTML[\"prenom_client\"],\n \"nom_client\" => $this->VARS_HTML[\"nom_client\"], \n \"address_client\" => $this->VARS_HTML[\"address_client\"],\n \"tel_client\" => $this->VARS_HTML[\"tel_client\"],\n \"mail_client\" => $this->VARS_HTML[\"mail_client\"]\n ));\n }",
"public function sendLocation()\n\t{\n\t\t//$ret['message'] = 'Success';\n\t\t//print_r( json_encode( $ret)) ; die();\n\t\theader('Content-Type: application/json');\n\t\t$header = apache_request_headers() ;\n\t\t$authen = $this->authen($header);\n\t\tif($authen==true){\n\n\t\t}else{\n\t\t\t$ret['status'] = -2 ;\n\t\t\t$ret['message'] = 'Authentication failed please try again';\n\t\t\tprint_r(json_encode($ret)) ; die();\n\t\t}\n\t\t$time_start = microtime(true);\n\t\t//echo date('Y/m/d H:i:s') ;\n\t\t//$data = $_REQUEST ;\n\t\t//$data = json_decode(file_get_contents('php://input'), true);\n\t\t$data_x = file_get_contents('php://input') ;\n\t\t//$data = $this->CryptoJS->cryptoJsAesDecrypt( key_decrypt , $data_x );\n\t\t$data = $data_x ;\n\t\t$data = json_decode( $data , true ) ;\n\t\t //$data = json_decode( '{ \"username\": \"mdu1\", \"password\": \"mdu1\" ,\"device_name\": \"edd0a3c0209ac85f\"}' , true ) ;\n\t\t//print_r($_SERVER ) ; die();\n\n\t\tif( $data['citizen_phone_number']!=\"\" && $data['current_lat']!=\"\" && $data['current_lon']!=\"\"){\n\n\t\t\t$dataL = [] ;\n\t\t\t$retArea = [] ; \n\t\t\t$this->postgres = $this->load->database ( 'postgres', TRUE );\n\t\t\t$areas = $this->postgres->query(\"SELECT ADM2_EN,ADM2_TH,ADM2_PCODE,ADM1_EN,ADM1_TH,ADM1_PCODE,ADM0_EN,ADM0_TH,ADM0_PCODE , ST_WITHIN( ST_GeomFromText('POINT( \".$data['current_lon'].\" \".$data['current_lat'].\" )' ) , geom) as status FROM geometries \");\n\t\t\tforeach ($areas->result_array() as $kFile => $vFile) {\n\t\t\t\tif( $vFile['status']=='t' ){\n\t\t\t\t\t//print_r( ( $vFile ) ) ;\n\t\t\t\t\t$dataL = $vFile ;\n\t\t\t\t\tunset( $vFile['status'] ) ;\n\t\t\t\t\t//print_r( ( $vFile ) ) ; \n\t\t\t\t\t$this->db->where('citizen_phone_number', $data['citizen_phone_number'] );\n\t\t\t\t\t$query = $this->db->update('citizen_profile', $vFile); \n\t\t\t\t\t//print_r( $this->db->last_query() ) ; \n\t\t\t\t\tif($query==1){\n\t\t\t\t\t\t$retArea['status'] = 0 ;\n\t\t\t\t\t\t$retArea['message'] = 'Success'; \n\t\t\t\t\t}else{\n\t\t\t\t\t\t$retArea['status'] = -1 ;\n\t\t\t\t\t\t$retArea['message'] = 'Fail';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$dataL['ani'] = $data['citizen_phone_number'] ;\n\t\t\t$dataL['timekey'] = time() ;\n\t\t\t$dataL['latitude'] = $data['current_lat'] ;\n\t\t\t$dataL['longitude'] = $data['current_lon'] ;\n\t\t\t \n\t\t\t$resL = $this->curlServiceLBS( \"http://127.0.0.1:8005/mb\" , $dataL, \"POST\");\n\t\t\t$ret['LBS'] = json_decode( $resL , true ) ;\n\t\t\t$ret['boundary'] = $dataL ;\n\t\t\t$ret['boundary']['status'] = $retArea ;\n\n\n\t\t\tif($data['citizen_phone_number']==''){\n\t\t\t\t$ret['status'] = -1 ;\n\t\t\t\t$ret['message'] = 'Data invalid';\n\t\t\t\tprint_r(json_encode($ret)) ; die();\n\t\t\t}else{\n\t\t\t\t$uploads_dir = _UPLOADS.'/locations/'.$data['citizen_phone_number'].\".txt\";\n\t\t\t\tif( file_put_contents( $uploads_dir , json_encode($data)) ){\n\t\t\t\t\t$ret['status'] = 0 ;\n\t\t\t\t\t$ret['message'] = 'Success';\n\t\t\t\t\tif($_SERVER['HTTPS']==\"on\"){ $protocol=\"https://\";}else{ $protocol=\"http://\"; }\n\t\t\t\t\t$ret['link'] = $protocol.$_SERVER['SERVER_NAME'].\"/\"._UPLOADS_NAME.\"/locations/\".$data['citizen_phone_number'].\".txt\" ;\n\t\t\t\t}else{\n\t\t\t\t\t$ret['status'] = -1 ;\n\t\t\t\t\t$ret['message'] = 'Data invalid';\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$ret['status'] = -1 ;\n\t\t\t$ret['message'] = 'Data invalid';\n\t\t}\n\t\t$res_x = json_encode($ret) ;\n\t\t$time_end = microtime(true);\n\t\t$duration = $time_end - $time_start;\n\t\t$ret['duration'] = number_format( $duration , 3, '.', ''); \n\t\t$this->Writelogs_model->wLogs( $data['citizen_phone_number'] , $_SERVER['REMOTE_ADDR'] , 'high', 'sendLocation', 'lbs' , $duration , $ret['status'] , $data_x , $res_x , 'MobileApp');\n\t\tprint_r( json_encode($ret ) ) ;\n\t}",
"public function withdrawPointsFromAccount(): void\n {\n event(\n new PointsWithdrawnFromAccount(\n $this->account->uuid,\n $this->points,\n static::class,\n $this->getKey()\n )\n );\n }",
"public function formatPointsForView(&$points)\n {\n /** @var Router $router*/\n $router = $this->container->get('router');\n\n foreach ($points as &$point) {\n $point['lat'] = $point['imageLatitude'];\n $point['lng'] = $point['imageLongitude'];\n\n $point['url'] = $router->generate('point_show_ajax', array('id' => $point['id']));\n\n if ($point['planType'] == PlanService::PLAN_TYPE_MAP) {\n $point['lat'] = $point['mapLatitude'];\n $point['lng'] = $point['mapLongitude'];\n }\n\n unset(\n $point['imageLatitude'],\n $point['imageLongitude'],\n $point['mapLatitude'],\n $point['mapLongitude']\n );\n }\n }",
"public function test_insert_point(): void\n {\n factory(Customer::class, 10)->create();\n $customer = Customer::inRandomOrder()->limit(1)->first();\n $user = User::find(1);\n $response = $this->actingAs($user)->post('/master/customer-point', [\n 'date' => today()->format('Y-m-d'),\n 'point' => rand(0, 100),\n 'customer_id' => $customer->id,\n ]);\n\n $response->assertStatus(302);\n $response->assertRedirect('/master/customer');\n }",
"public function set_user_points($user_id,$points,$points_by){\n\t\t $query_11=mysqli_query($this->_con, \"insert into tbl_users_points(user_id,user_points,points_by,date_of_points_get) values('$user_id','$points','$points_by',NOW())\");\n\t\t\t\t//return $query_142;\n\t\t\n\t}",
"function setPoints($points = 0.0)\n\t{\n\t\t$this->points = $points;\n\t}",
"public function listPointsRelaisAction ()\n {\n \t\n \t\n $aPointsRelais = array();\n $response = new Varien_Object();\n \n $address = $this->getRequest()->getParam('address', false);\n $zipcode = $this->getRequest()->getParam('zipcode', false);\n $country = $this->getRequest()->getParam('country', false);\n $city = $this->getRequest()->getParam('city', false);\n \n $listrelais = Mage::getSingleton('gls/service')->getRelayPointsForZipCode($zipcode, $country,$address,$city);\n \n if (! isset($listrelais->exitCode->ErrorCode)) {\n $aPointsRelais['error'] = $this->__('Error call GLS webservice, it might be down, see var/log/gls.log');\n } else {\n if ($listrelais->exitCode->ErrorCode == 0) {\n $productMaxWeight = 0;\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n foreach ($items as $item) {\n $productMaxWeight = (($productMaxWeight > $item->getWeight()) ? \n $productMaxWeight : $item->getWeight());\n }\n \n $onlyxlrelay = Mage::getStoreConfig('carriers/gls/onlyxlrelay') ||\n ($productMaxWeight > Mage::getStoreConfig('carriers/gls/maxrelayweight'));\n \n //Si on retourne aucun relais pour ce code postal\n if(is_array($listrelais->SearchResults)){\n foreach ($listrelais->SearchResults as $key => $pointRelais) {\n \n $endName = substr(\n $pointRelais->Parcelshop->Address->Name1, \n strlen($pointRelais->Parcelshop->Address->Name1) - 2, \n strlen($pointRelais->Parcelshop->Address->Name1)\n );\n \n if ($onlyxlrelay && $endName != 'XL') {\n continue;\n }\n $aRelay = array();\n $aRelay['relayId'] = $pointRelais->Parcelshop->ParcelShopId;\n $aRelay['relayName'] = $pointRelais->Parcelshop->Address->Name1 . ' ' .\n $pointRelais->Parcelshop->Address->Name2 . ' ' . \n $pointRelais->Parcelshop->Address->Name3;\n $aRelay['relayAddress'] = $pointRelais->Parcelshop->Address->Street1 . ' ' .\n $pointRelais->Parcelshop->Address->BlockNo1 . ' ' . \n $pointRelais->Parcelshop->Address->Street2 . ' ' . \n $pointRelais->Parcelshop->Address->BlockNo2;\n $aRelay['relayZipCode'] = $pointRelais->Parcelshop->Address->ZipCode;\n $aRelay['relayCity'] = $pointRelais->Parcelshop->Address->City;\n $aRelay['relayCountry'] = $pointRelais->Parcelshop->Address->Country;\n $aRelay['relayLatitude'] = $pointRelais->Parcelshop->GLSCoordinates->Latitude;\n $aRelay['relayLongitude'] = $pointRelais->Parcelshop->GLSCoordinates->Longitude;\n \n $relayWorkingDays = array();\n for ($i = 0; $i < 7; $i ++) { \n if(is_array($pointRelais->Parcelshop->GLSWorkingDay)){\n if (isset($pointRelais->Parcelshop->GLSWorkingDay[$i])) {\n $relayWorkingDays[$i]['hours']['from'] = \n $pointRelais->Parcelshop->GLSWorkingDay[$i]->OpeningHours->Hours->From;\n $relayWorkingDays[$i]['hours']['to'] = \n $pointRelais->Parcelshop->GLSWorkingDay[$i]->OpeningHours->Hours->To;\n $relayWorkingDays[$i]['breaks']['from'] = \n $pointRelais->Parcelshop->GLSWorkingDay[$i]->Breaks->Hours->From;\n $relayWorkingDays[$i]['breaks']['to'] = \n $pointRelais->Parcelshop->GLSWorkingDay[$i]->Breaks->Hours->To;\n }\n }\n }\n $aRelay['relayWorkingDays'] = $relayWorkingDays;\n $aPointsRelais[$pointRelais->Parcelshop->ParcelShopId] = $aRelay;\n }\n //Sinon de si on retourne aucun relais pour ce code postal\n }else{\n // Aucune donnée ne correspond à la recherche. La requête est formulée correctement mais aucun\n // résultat dans la base de données points relais GLS.\n $aPointsRelais['error'] = $this->__('Aucun relais ne correspond à votre recherche');\n }\n } elseif ($listrelais->exitCode->ErrorCode == 502) {\n $aPointsRelais['error'] = $this->__('Authentification error GLS webservice, login or password might be wrong');\n } elseif ($listrelais->exitCode->ErrorCode == 999) {\n // Aucune donnée ne correspond à la recherche. La requête est formulée correctement mais aucun\n // résultat dans la base de données points relais GLS.\n $aPointsRelais['error'] = $this->__('Aucun relais ne correspond à votre recherche');\n } else {\n $aPointsRelais['error'] = $listrelais->exitCode->ErrorDscr;\n }\n }\n // Creation du block\n $this->loadLayout();\n $block = $this->getLayout()->createBlock(\n 'Addonline_Gls_Block_Listrelay', \n 'root', \n array('template' => 'gls/listrelais.phtml')\n );\n $block->setListRelay($aPointsRelais);\n $this->getLayout()\n ->getBlock('content')\n ->append($block);\n $this->renderLayout();\n }",
"function __construct($point = 0){\n $this->point = $point;\n }",
"function updatePoint(PointEntity $newPoint)\r\n {\r\n }",
"public static function set_coord_aehnlichkeit() {\r\n\r\n\t\tglobal $db;\r\n\t\t\r\n\t//appropriate number of select query in this case 1500 - 3000\r\n\t $result5Pegel = $db->qry(\" SELECT pegelnummer,Rechtswert_GK,Hochwert_GK,lat,lon,daten_fehler FROM \".TABLE_PEGEL2.\" WHERE `lat` = '' AND `lon` = '' AND `Rechtswert_GK` != '0.00' AND `Hochwert_GK` != '0.00' ORDER BY `pegelnummer` DESC LIMIT 0, 1500 \");\r\n\t if ($result5Pegel){\r\n\t\techo 'successful connection and selection';\r\n\t\t//write to logfile \r\n\t\t$msg = \"successful connection and selection\";\r\n\t\tLog::write(LOG_OTHER, $msg);\r\n\t\t}\r\n\t\telse {\r\n\t\techo 'error connection and selection';\r\n\t\t//write to logfile \r\n\t\t$msg = \"error connection and selection\";\r\n\t\tLog::write(LOG_OTHER, $msg);\r\n\t\t}\r\n\t\t\r\n\t \r\n\t for ($i = 0; $i < mysql_num_rows($result5Pegel); $i++ )\r\n\t { \r\n\t \twhile ($row5Pegel = mysql_fetch_array($result5Pegel))\r\n\t \t{ \r\n\t\t\t$pegelnummer = $row5Pegel[\"pegelnummer\"];\r\n\t\t\t$rw = $row5Pegel[\"Rechtswert_GK\"];\r\n\t\t\t$hw = $row5Pegel[\"Hochwert_GK\"];\r\n\t\t\r\n\t\t//transformation with constants\r\n\t\t$avar = Transformation::GK_geo_6point($hw,$rw);\r\n\t\t\r\n\t\t//importance: php has only one return value, here is an array that is set appropriately\r\n\t\t$lat = $avar[0];\r\n\t\t$lon = $avar[1];\r\n\t\t\r\n\t$result = $db->qry(\" UPDATE \".TABLE_PEGEL2.\" SET \r\n\tpegelnummer='$pegelnummer',\r\n\tlat='$lat',\r\n\tlon='$lon'\r\n\tWHERE pegelnummer='$pegelnummer' \");\r\n\r\n\tif ($result){\r\n\techo 'successful update coordinates';\r\n\techo '<br><br>';\r\n\t\t//write to logfile \r\n\t$msg = \"successful update coordinates\";\r\n\tLog::write(LOG_OTHER, $msg);\r\n\t}\r\n\telse {\r\n\techo 'error see sql.log';\r\n\t}\r\n\t\t\r\n\t} }\r\n\t\t\r\n\t}",
"public function set_points_fb($user_id,$points){\n\t\t//$query_11=mysqli_query($this->_con, \"SELECT * FROM tbl_users_points WHERE user_id = '$user_id' AND points_by = 'By Facebook Share'\");\n\t\t//$result = mysqli_fetch_array($query_11);\n\t\t//if($result!='')\n\t\t//{\n\t\t//\t$sql=mysqli_query($this->_con, \"UPDATE tbl_users_points SET user_points = user_points + '$points'\");\n\t\t//}\n\t\t//else\n\t\t//{\n\t\t\t$sql=mysqli_query($this->_con, \"insert into tbl_users_points(user_id,user_points,points_by,date_of_points_get) values('$user_id','$points','By Facebook Share',NOW())\");\n\n\t\t//}\n\t}",
"function addClient( $ref )\n{\n\t$r1 = $this->w - 31;\n\t$r2 = $r1 + 19;\n\t$y1 = 17;\n\t$y2 = $y1;\n\t$mid = $y1 + ($y2 / 2);\n\t$this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D');\n\t$this->Line( $r1, $mid, $r2, $mid);\n\t$this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 );\n\t$this->SetFont( \"Arial\", \"B\", 10);\n\t$this->Cell(10,5, \"CLIENT\", 0, 0, \"C\");\n\t$this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 );\n\t$this->SetFont( \"Arial\", \"\", 10);\n\t$this->Cell(10,5,$ref, 0,0, \"C\");\n}",
"public function depositPointsToAccount(): void\n {\n event(\n new PointsDepositedToAccount(\n $this->account->uuid,\n $this->points,\n static::class,\n $this->getKey()\n )\n );\n }",
"private function chargeLesClients()\n\t{\n\t\t$resultat=$this->maBD->chargement('client');\n\t\t$nb=0;\n\t\twhile ($nb<sizeof($resultat))\n\t\t\t{\n\t\t\t//instanciation du client et ajout de celui-ci dans la collection\n\t\t\t$this->tousLesClients->ajouteUnClient($resultat[$nb][0],$resultat[$nb][1],$resultat[$nb][2],$resultat[$nb][3],$resultat[$nb][4],$resultat[$nb][5],$resultat[$nb][6]);\n\t\t\t$nb++;\n\n\t\t\t}\n\t}"
] | [
"0.5955792",
"0.58606565",
"0.5834875",
"0.57570827",
"0.5756588",
"0.5721957",
"0.5704457",
"0.56639993",
"0.5635666",
"0.56270736",
"0.55985016",
"0.5573404",
"0.55168855",
"0.5461152",
"0.54101723",
"0.54043657",
"0.5381596",
"0.53598917",
"0.5317657",
"0.53111297",
"0.5278916",
"0.5267811",
"0.52309364",
"0.5218925",
"0.52147806",
"0.52120477",
"0.5199711",
"0.5187031",
"0.5168013",
"0.5152589"
] | 0.6558124 | 0 |
Function to search a particular symptom | function search() {
$admin = $this->Auth->user ();
if ($this->request->query('symptom_name')) {
$keyword = $this->request->query('symptom_name');
$this->paginate = array(
'conditions' => array('Symptom.name LIKE' => '%' . $keyword . '%'),
'limit' => SymptomsController::PAGE_LIMIT
);
}
$symptoms_list = $this->paginate('Symptom');
if (sizeof($symptoms_list) == 0) {
$this->Session->setFlash('No Symptom found.', 'warning');
}
$this->set(compact('keyword', 'symptoms_list'));
$this->render('index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function search();",
"public function search();",
"function searchBookSubject($search)\n\t\t{\n\t\t\t//$search = '%' . $search . '%';\n\t\t\t$sql = 'SELECT bookID FROM bookCopy WHERE subject=:search;';\n\t\t\t$statement = $this->dbconn->prepare($sql);\n\t\t\t$statement->bindValue(':search', $search);\n\t\t\t$statement->execute();\n\t\t\t$entry = $statement->fetchall(PDO::FETCH_ASSOC);\n\t\t\treturn($entry);\n\t\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}",
"public function searchForSkill($skill) {\n\t\t// between Bow and Bow special attack \n\t\t$results = $this->db->query(\"SELECT name FROM skills WHERE common = 1 AND name LIKE ?\", $skill);\n\t\tif (count($results) == 1) {\n\t\t\treturn $results;\n\t\t}\n\t\t\n\t\t$tmp = explode(\" \", $skill);\n\t\tlist($query, $params) = $this->util->generateQueryFromParams($tmp, 'name');\n\t\t\n\t\treturn $this->db->query(\"SELECT name FROM skills WHERE common = 1 AND $query\", $params);\n\t}",
"public function search() {\n\t\t\t$Recherches = $this->Components->load( 'WebrsaRecherchesFichesprescriptions93' );\n\t\t\t$Recherches->search();\n\t\t}",
"public function search($query) {\n\t\tif (!$query) redirect('admin/symptom_type');\n\n\t\t$query = urldecode($query);\n\n\t\t// Load results\n\t\t$this->data['symptom_types'] = $this->symptom_types_m->search($query, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'title' => 'after'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t$this->data['search_query'] = $query;\n\t\t$this->data['sidebar'][] = array('type' => 'button', 'label' => 'Tilbage til oversigt', 'slug' => 'admin/symptom_type');\n\n\t\t$this->data['subview'] = 'admin/symptom_types/index';\n\t\t$this->load->view('admin/_layout_main', $this->data);\n\t}",
"public function searchAMember($research)\n {\n $resultat = $this->db->query(\"SELECT \n id,\n pseudo,\n firstName,\n lastName,\n mail\n FROM $this->tableName \n WHERE pseudo LIKE '$research%'\n OR firstName LIKE '$research%'\n OR lastName LIKE '$research%'\n OR mail LIKE '$research%'\");\n return $resultat->fetch(PDO::FETCH_ASSOC);\n }",
"public static function searchField($property, $query, $dupCheck = array())\n\t{\n\t\tglobal $mysql;\n\t\t$query = real_escape_string($query);\n\t\t$result = $mysql->query(\"SELECT * FROM students WHERE \".$property.\" LIKE '%\".$query.\"%'\");\n\t\tif ( !$result || mysqli_num_rows($result) == 0 )\n\t\t\treturn array();\n\t\t$output = array();\n\t\t\n\t\twhile ( $d = mysqli_fetch_array($result) )\n\t\t{\n\t\t\tif ( !empty($d) )\n\t\t\t{\n\t\t\t\t$dup = false;\n\t\t\t\tforeach ( $dupCheck as $row )\n\t\t\t\t{\n\t\t\t\t\tif ( $row->getID() == $d['sid'] )\n\t\t\t\t\t\t$dup = true;\n\t\t\t\t}\n\t\t\t\tif ( !$dup )\n\t\t\t\t\t$output[] = new Student($d['sid']);\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}",
"public function search($name)\n {\n }",
"public function found();",
"public function search($kw);",
"function search($movieCount, $comedyObj, $holywoodObj)\n{\n//firct we check weather the string is entered or it is null\n function stringNullException($searchMovie)\n {\n if (!$searchMovie) {\n throw new Exception(\"String is null\");\n }\n }\n\n echo \"\\n\";\n $cnt = 0;\n $searchMovie = readline('Enter movie name to search - ');\n for ($i = 0; $i < $movieCount; $i++) {\n try { //try catch and finally block is used to handle exception\n\n stringNullException($searchMovie);\n } catch (Exception $e) //catch block catch the error thrown by try\n {\n echo \"string should be there \\n\";\n break;\n }\n//check the occurance of movie in comedy\n if ($comedyObj[$i]->movieName == $searchMovie) {\n echo \" Movie found in Comedy \\n\";\n break;\n //check occurance of movie in hollywood\n } else if ($holywoodObj[$i]->movieName == $searchMovie) {\n echo \" Movie found in Holywood \\n\";\n break;\n } else {\n $cnt++;\n //print this if movie not present in both\n echo \" Try to find the movie ## wait\\n\\n\";\n }\n }\n echo \"\\n\";\n if ($cnt == $movieCount) {\n echo \"Movie not found in Comedy and Holywood \\n\";\n }\n}",
"public function sql_search_relative_titles($mastertitle,$field2check) {\n $db = GetGlobal('db');\t\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->fcode.\" 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] = \"{$this->itmname} like '%$lex%' \";// or $this->itmdescr like '%$lex%' or $remarks like '%$lex%'\";// or \"; //as is\n\t\t //$sSQL .= \"{$this->itmname} like '% $ulex %' or $this->itmdescr like '% $ulex %' or $remarks like '% $ulex %' or \"; //upper case\t\t\n\t\t //$sSQL .= \"{$this->itmname} like '% $dlex %' or $this->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 particle_search($str)\n {\n \t$array = array('title'=>$str,'desc'=>$str,'task_tag'=>$str);\n \t$this->db->or_like($array); \n \t$query = $this->db->get('game_task');\n \treturn $query->result_array();\n }",
"public function search() {\n }",
"function searchSerie($p, $ordine){\n\t$query = \"SELECT * FROM `Serie` WHERE `nome` LIKE '%$p%' ORDER BY '$ordine'\";\n\treturn eseguiQuery($query);\n}",
"function searchBookTitle($search)\n\t\t{\n\t\t\t$search = '%' . $search . '%';\n\t\t\t$sql = 'SELECT bookID,ISBN,author,bookTitle,edition,picture FROM ' . $this->tablename . ' WHERE bookTitle LIKE :search;';\n\t\t\t$statement = $this->dbconn->prepare($sql);\n\t\t\t$statement->bindValue(':search', $search);\n\t\t\t$statement->execute();\n\t\t\t$entry = $statement->fetchall(PDO::FETCH_ASSOC);\n\t\t\treturn($entry);\n\t\t}",
"public function find();",
"public function applySearch();",
"public function search(array $sample);",
"public function find($p, $q);",
"function searchScholar($ThingToSearchFor, $year){\n\n\t\t//Replace any spaces with + signs for the url\n\t\t$formattedThingToSearchFor = str_replace(' ', '+', $ThingToSearchFor);\n\n\t\t//URL component parts\n\t\t//I am going to assume that google won't change there URL any time soon....\n\t\t$baseURL = 'https://scholar.google.com.au/scholar?q=\"';\n\t\t$yearlower = '\"&hl=en&as_sdt=0%2C5&as_ylo=';\n\t\t$yearHigh = '&as_yhi=';\n\n\t\t//Create the actual request\n\t\t$requestToMake = $baseURL.$formattedThingToSearchFor.$yearlower.$year.$yearHigh.$year;\n\n\t\t//sends off the request to get the page\n\t\t$html = file_get_contents($requestToMake);\n\t\t\n\t\t//gets the first instance of the phrase we want, we are using about to find the navbar \n\t\t$pos = stripos ($html , 'About');\n\n\t\t//remove everything before about inclusive and only give us the next 50 charters\n\t\t$total = substr ($html , $pos+6, 50);\n\n\t\t//find the end of our number by searching for the next element\n\t\t$sPos = stripos($total, '<b>');\n\n\t\t//remove everything after the number\n\t\t$output = substr($total, 0 ,$sPos-10);\n\n\t\t//remove the comma in the middle of the number and return just the number\n\t\treturn str_replace(',', '', $output);\n\t}",
"public function SearchSubject(){\n \n }",
"function search($keywords){\r\n \r\n }",
"public function search()\n {\n $searchText = Input::get('searchKeyword');\n $level2activities = $this->level2ActivitiesRepository->getAllLeve2Activities(Auth::guard('school')->user()->id, $searchText);\n return view('school.searchQuestions', compact('level2activities'));\n }",
"function searchEmployeeAndTitle(){ \n\t\t\n\t\t$sql = \"SELECT a.emp_number, CONCAT(a.emp_firstname,' ',a.emp_middle_name, ' ', a.emp_lastname) AS fullname, c.name\n\t\t\t\t\tFROM panpic_employee AS a\n\t\t\t\t\tJOIN config_general AS b\n\t\t\t\t\tON a.emp_job_title = b.id $this->cond\n\t\t\t\t\tJOIN config_general_desc AS c \n\t\t\t\t\t\tON b.id = c.id AND c.lang = '$this->_lang'\";\n\n\t\treturn $this->_db->fetchAll($sql);\n\t\t\n\t\t/*\n\t\tAND b.`type` = 'job_title'\n\t\tAND a.emp_number != '$emp_number'\n\t\tAND (a.emp_lastname LIKE '$q%' OR a.emp_firstname LIKE '$q%') \n\t\t */\n\t}",
"public function search()\n {\n }",
"public function search()\n {\n }",
"public function getSearchQueryText()\n {\n $catalogSearchData = $this->getCatalogSearchData();\n if ($this->_didYouMean) {\n $catalogSearchData->setDidYouMeanQueryText($this->_didYouMean);\n return __(\"Search results for: '%1' instead\", $catalogSearchData->getEscapedQueryText());\n }\n return __(\"Search results for: '%1'\", $catalogSearchData->getEscapedQueryText());\n }"
] | [
"0.6119884",
"0.5962518",
"0.56972134",
"0.5554179",
"0.5542772",
"0.5447128",
"0.5424802",
"0.53959465",
"0.537965",
"0.53639233",
"0.53615564",
"0.53551126",
"0.5344326",
"0.5248876",
"0.52417105",
"0.52354413",
"0.5229196",
"0.52160436",
"0.5208647",
"0.5201043",
"0.5199283",
"0.51625127",
"0.516127",
"0.5161069",
"0.51530993",
"0.51454055",
"0.51324415",
"0.5119897",
"0.5119897",
"0.5114875"
] | 0.62934285 | 0 |
Function to add new symptom | function add(){
$this->JQValidator->addValidation('Symptom', $this->Symptom->validate, 'SymptomAddForm');
if (!empty($this->data)) {
$this->Symptom->create();
if ($this->Symptom->save($this->data, array('validate' => false))) {
$this->Session->setFlash(__('The symptom has been added.', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The symptom could not be saved. Please, try again.', true));
}
}
$this->render('add_symptoms');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new FormulaSymptom();\n\n if($model->load(\\Yii::$app->request->getBodyParams(), '') && $model->save()) {\n\n \\Yii::$app->response->statusCode = Http::CREATED;\n\n $model->refresh();\n\n Activity::store(Formula::ITEM_TYPE, $model->formula_id, sprintf('New symptom appended %s', $model->symptom->name));\n\n return $model;\n }\n\n return $this->sendValidationResult($model);\n }",
"function add_symptom($conn){\n div_server_note();\n //try to clean-up any dangerous characters to be treated like text\n $symptom = mysqli_real_escape_string($conn, $_POST['symptom']);\n\n //check if the name already exists in our table\n if(!($query = $conn->prepare(\"SELECT name FROM `symptom`\".\n \"WHERE symptom.name=?\"))){\n prepare_failed($query);\n }\n\n if(!($query->bind_param('s', $symptom))){\n bindp_failed($query);\n }\n\n if(!($query->execute())){\n execute_failed($query);\n }\n \n if(!($query->store_result())){\n store_failed($query);\n }\n\n //if we get back 0 rows then we can attempt to insert it\n //otherwise print warning that duplicate exists\n if($query->num_rows < 1){\n if(!($sql = $conn->prepare(\"INSERT INTO `symptom` (`name`) VALUES (?)\"))){\n prepare_failed($sql);\n }\n if(!($sql->bind_param('s', $symptom))){\n bindp_failed($sql);\n }\n if(!($sql->execute())){\n execute_failed($sql);\n }\n else {\n insert_success(\"Symptom\");\n } \n $sql->close();\n \n } else {\n dup_found(\"Symptom\"); \n }\n \n $query->close();\n printf(\"<br>Symptoms entered so far.</div>\"); \n}",
"public function symptom(){\n return $this->belongsTo(Symptom::class);\n }",
"public function symptom() {\n return $this->belongsTo(Symptom::class, 'symptom_id', 'id');\n }",
"function add_requisition($point_of_use, $narrative, $details)\n{\n\t$sql = \"INSERT INTO \".TB_PREF.\"requisitions (point_of_use, narrative, details) VALUES (\".\n\t\tdb_escape($point_of_use).\",\".db_escape($narrative).\",\".db_escape($details).\")\";\n\n\tdb_query($sql, \"could not add requisitions\");\n}",
"public function symptom()\n {\n return $this->belongsTo('App\\Models\\Entry');\n }",
"public static function addNewSex() {\n\t\tswitch (Filter::post('SEX', '[MF]', 'U')) {\n\t\t\tcase 'M':\n\t\t\t\treturn \"\\n1 SEX M\";\n\t\t\tcase 'F':\n\t\t\t\treturn \"\\n1 SEX F\";\n\t\t\tdefault:\n\t\t\t\treturn \"\\n1 SEX U\";\n\t\t}\n\t}",
"public function createNewQuestion()\n\t{\n\t\tglobal $ilDB;\n\t\t\t\t\n\t\t$obj_id = $this->getObjId();\n\t\tif ($obj_id > 0)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_question');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_question (question_id, questiontype_fi, \" .\n\t\t\t\t\"obj_fi, owner_fi, title, description, author, questiontext, obligatory, complete, \" .\n\t\t\t\t\"created, original_id, tstamp) VALUES \" .\n\t\t\t\t\"(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer', 'integer', 'integer', 'integer', 'text', 'text', 'text', 'text', \n\t\t\t\t\t'text', 'text', 'integer', 'integer', 'integer'),\n\t\t\t\tarray(\n\t\t\t\t\t$next_id,\n\t\t\t\t\t$this->getQuestionTypeID(),\n\t\t\t\t\t$obj_id,\n\t\t\t\t\t$this->getOwner(),\n\t\t\t\t\tNULL,\n\t\t\t\t\tNULL,\n\t\t\t\t\t$this->getAuthor(),\n\t\t\t\t\tNULL,\n\t\t\t\t\t\"1\",\n\t\t\t\t\t\"0\",\n\t\t\t\t\ttime(),\n\t\t\t\t\tNULL,\n\t\t\t\t\t0\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->setId($next_id);\n\t\t}\n\t\treturn $this->getId();\n\t}",
"public function add($message){}",
"public function add($message) {}",
"public function add(){}",
"function addItem()\n {\n $this->global['pageTitle'] = \"新增赛事\";\n $this->loadViews(\"newseventadd\", $this->global, NULL);\n }",
"public function addproblemAction()\r\n {\r\n \t// check if user is logged in\r\n \tif (!$this->hasIdentity()) {\r\n \t\t$this->_helper->FlashMessenger->addMessage('Pre pridávanie nového problému musíte byť najskôr prihlásený.');\r\n \t\t$this->_redirect('/auth/login?redirect=/problemarea/addproblem');\r\n \t\treturn;\r\n \t}\r\n \t\r\n \t$this->checkAllowed('PROBLEM', 'DEFINE');\r\n \t\r\n \t// ID for the new problem\r\n \t$ProblemAreaId = Colla_App::getInstance()->getProblemArea();\r\n \t$form = new Form_Problem();\r\n \tif ($this->getRequest()->isPost()) {\r\n \t\tif ($form->isValid($_POST)) {\r\n \t\t\t$data = array();\r\n \t\t\t$data = $form->getValues();\r\n \t\t\t$data['CreatedBy'] = Zend_Registry::get('User')->Id;\r\n \t\t\t$data['ProblemAreaId'] = $ProblemAreaId;\r\n \t\t\t$problem = new Problem();\r\n\t\t\t\t$problem->createNew($data);\r\n\t\t\t\t$this->_helper->FlashMessenger->addMessage('Problém bol vytvorený');\r\n\t\t\t\t$this->_redirect('/problem/list/filter/acceptance');\r\n\t\t\t\treturn;\r\n \t\t}\r\n \t}\r\n \t$this->view->form = $form;\r\n }",
"public function addQuestion()\n\t{\n\t\t$ls = new Spomenar();\n\n\t\t$last_page = $ls->getMaxPage();\n\t\t$current = $last_page+1;\n\t\tsetcookie( 'current_page', $current, time()+60*60*24, \"/\" ); //set cookie na 24 sata\n\n\t\t$ls->addQuestion($current,$_POST['question']);\n\n\t\t$title = $ls->getQuestion($current);\n\t\t$PageList = $ls->getPage($current);\n\n\t\trequire_once 'view/page_index.php';\n\t}",
"function add_checkin_symptoms($conn, $rowID){\n\n $stmt = \"INSERT INTO `checkin_symptoms` (`checkin_id`, `symptom_id`, `severity` )\n VALUES (\";\n\n /* loop through the inputs received and only added those that are not duplicated */\n /* if we find a duplicate the last one in the list will be the one added to our */\n /* insert statement */\n $okToInsert = False;\n for($i = 0; $i < count($_POST['sym']); $i++){\n if( isset($_POST['sev'.$i])){\n $duplicate = False;\n $okToInsert = True; /* there is at least one symptom! */\n for($j = $i+1; $j < count($_POST['sym']); $j++){\n if( isset($_POST['sev'.$j])){\n if($_POST['sym'][$i] == $_POST['sym'][$j]){\n $duplicate = True;\n }\n }\n }\n\n if($duplicate == False){\n /* echo $_POST['sym'][$i];*/\n $stmt .= '\\''.$rowID.'\\',';\n $sid = mysqli_real_escape_string($conn, $_POST['sym'][$i]); \n $stmt .= '\\''.$sid.'\\',';\n $sev = mysqli_real_escape_string($conn, $_POST['sev'.$i]);\n $stmt .= '\\''.$sev.'\\'), (';\n }\n }\n }\n\n /* truncate the line so we get rid of that trailing , ( */\n /* then attempt to add all these to the check_symptom table as one INSERT */\n /* statement for multiple value */\n $stmt = substr($stmt, 0, -3);\n\n if($okToInsert == True){\n if(mysqli_query($conn, $stmt)){\n insert_success(\"Checkin symptoms\");\n } else {\n gen_error($conn);\n }\n }\n else {\n printf(\"No sysmptoms to insert\");\n }\n\n echo '</div>';\n\n}",
"public function add_question($sSessionKey, $iSurveyID, $question, $help_text, $type, $mandatory, $other) {\n // Check sessionkey\n if (!$this->_checkSessionKey($sSessionKey)) { return array('status' => 'Invalid session key'); }\n // make sure the survey exists\n elseif (!Survey::model()->findByPk($iSurveyID)) { return array('status' => 'Invalid surveyid'); }\n // make sure the user has permissions to create the question\n elseif (!Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'create')) { return array('status' => 'No permissions'); }\n // create the question\n else {\n // get the 'group_id'\n // (doesn't matter what the language is because it'll still point to the same group)\n $gQuery = \"SELECT gid FROM {{groups}} WHERE sid = :sid AND language = 'en'\";\n $group_id = Yii::app()->db->createCommand($gQuery)->bindValues(array(':sid' => $iSurveyID))->queryScalar();\n\n if($group_id == null) {\n return array('status' => 'Error: You need a question group first');\n } /*else {\n if(preg_match('/\\([0-9]+\\)/',$group,$matches)) {\n $group_id = substr($matches[0],1,-1);\n } else {\n return array('status' => 'Error: Could not retrieve question group ('.$group.')');\n }\n }*/\n\n // NEW QUESTION TITLE\n\n // add up all the questions in english (we only need a total)\n $qQuery = \"SELECT question_order FROM {{questions}} WHERE gid = :gid AND parent_qid = 0 AND language = 'en' ORDER BY question_order DESC\";\n $questions = Yii::app()->db->createCommand($qQuery)->bindValues(array(':gid' => $group_id))->query();\n // give the new question a unique title\n $new_question_title = 'Q' . time();\n\n // NEW QUESTION ORDER \n\n while($questions->next()) { }\n $questions_current_row = $questions->current();\n $new_question_order = $questions_current_row['question_order'] + 1;\n\n // (CODE FROM: controlers/admin/database.php [line: 359])\n\n $question_CLEAN = html_entity_decode(fixCKeditorText($question), ENT_QUOTES, \"UTF-8\");\n $help_text_CLEAN = html_entity_decode(fixCKeditorText($help_text), ENT_QUOTES, \"UTF-8\");\n\n $iQuestionID=0;\n $oQuestion= new Question;\n // set the question values\n $oQuestion->sid = $iSurveyID;\n $oQuestion->gid = $group_id;\n $oQuestion->type = strtoupper($type);\n $oQuestion->title = $new_question_title;\n $oQuestion->question = $question_CLEAN;\n $oQuestion->preg = '';\n $oQuestion->help = $help_text_CLEAN;\n $oQuestion->other = $other;\n $oQuestion->mandatory = $mandatory;\n $oQuestion->relevance = '1';\n $oQuestion->question_order = $new_question_order;\n $oQuestion->language = 'en';\n\n $oQuestion->save();\n\n $aErrors = $oQuestion->getErrors();\n // were there any errors\n if(count($aErrors)) {\n $errors_array = array();\n // loop through them\n foreach($aErrors as $sAttribute=>$aStringErrors) {\n foreach($aStringErrors as $sStringErrors) { $errors_array[] = $sStringErrors; }\n }\n return array('status' => 'Error: Question Errors ('.implode(', ',$errors_array).')');\n }\n if($oQuestion) { return array('status' => $oQuestion->qid); }\n else { return array('status' => 'Error: Can not save question'); }\n }\n return array('status' => 'Error: Something went wrong');\n }",
"function add(ISnippet $snippet);",
"public function add();",
"function addExcessWorkflowNew($employee_id, $employer_id, $refund, $date) {\r\n\t$title = \"Refund \". $refund.\", On \".$date;\r\n\t$requestor_type = 'Employee';\r\n\t$action_type = 'Employer';\r\n\t$status = 'Pending';\r\n\t$sql = \"select id from workflow where name = 'Excess Contribution' ORDER BY id ASC LIMIT 1\";\r\n\t$rs = mysql_query($sql) or die('error');\r\n\tif(mysql_num_rows($rs)) {\r\n\t\t$rec = mysql_fetch_array($rs);\r\n\t\t$wf_id = $rec['id'];\r\n\t} else {\r\n\t\t$wf_id = 2;\r\n\t}\r\n\t$insertSQL = \"INSERT INTO actions (title, id, requestor_id, requestor_type, action_type, wf_id, status) VALUES ('\".$title.\"', '\".$employer_id.\"', '\".$employee_id.\"', '\".$requestor_type.\"', '\".$action_type.\"', '\".$wf_id.\"', '\".$status.\"')\";\r\n\r\n $Result1 = mysql_query($insertSQL) or die(mysql_error());\r\n}",
"public function add_information();",
"public function add()\r\n {\r\n $this->redirectIfRequestIsNotPost('/admin/artists');\r\n\r\n $data = ['name' => trim($_POST['name'])];\r\n $this->artist_dao->create($data);\r\n\r\n Flash::addMessage('Artista agregado.');\r\n $this->redirect('/admin/artists');\r\n }",
"public function addnewQuestion(){\t\n\t \n\t $message_alert='';\n\t \n\t $id_lang=(int)Context::getContext()->language->id; \n\t $category_id=Tools::getValue('id');\n if(Tools::isSubmit('submitAddnewQuestion') && !empty($category_id)){ \t \n\t\t\n $FilterQuestions=new FilterQuestions(); \n\t\t\n\t\t$FilterQuestions->question_name=Tools::getValue('question_name');\n\t\t$FilterQuestions->more_infos=Tools::getValue('more_infos');\n\t\t$Quiz_name=$FilterQuestions->question_name;\n\t\t$FilterQuestions->category_id=$category_id;\n\t\t\n\t\t\n\t\tif(FilterQuestions::verifyByName($Quiz_name)!=''){\n $message_alert='Please remember duplicated questions are not allowed.';\n\t\t }\t\t\t\n\t\t\n\t\t elseif(!$FilterQuestions->add()){\t\t\t\n\t\t\t$message_alert=\"All field are required.\";\n } else {\n \n\t\t\t$message_alert=\"Your question has been successfully added.\";\n }\t\t\n\t\t\n\t\t\n }\n\t \n\t \n\t return $message_alert;\n\t \n\t \n }",
"function add($poductName,$quantitty){\n $this->prodcutStore[$poductName]=$quantitty;\n }",
"public function add()\n\t{\n\t}",
"public function hook_after_add($id) { \n\t $row = CRUDBooster::first($this->table,$id); \n\t CRUDBooster::sendNotification($config=[\n\t \t'content' \t\t=> 'Conducted An Concept Note...',\n\t \t'to'\t\t\t=>\tCRUDBooster::mainpath($id),\n\t \t'id_cms_users'\t=>\t[$row->lineManager],\n\t ]);\n\n\t }",
"public function add()\n\t{\n\n\t}",
"public function add()\n\t{\n\n\t}",
"function add($message = '') {\n\t$add_cat = open_table_form('Create New Certificate','create_certificate',SITE_ADMIN_SSL_URL.'?sect=createcertificate&mode=addcheck','post',$message);\n\t$add_cat .= $this->form();\n\t$add_cat .= close_table_form();\n return $add_cat;\n }",
"public static function add($message, $type)\n\t{\n\t\tglobal $SESSION;\n\t\t$SESSION->certificationmessage = new \\stdClass();\n\t\t$SESSION->certificationmessage->message = $message;\n\t\t$SESSION->certificationmessage->type = $type;\n\t}",
"function GetQuestionAddAction()\n {\n return \"QuestionAdd\";\n }"
] | [
"0.6083852",
"0.60718775",
"0.5518236",
"0.54453695",
"0.54450804",
"0.5430528",
"0.5343727",
"0.53364396",
"0.5269605",
"0.5215717",
"0.51746124",
"0.51635855",
"0.513516",
"0.51253015",
"0.5106432",
"0.5070674",
"0.50407624",
"0.5024725",
"0.50089014",
"0.5005828",
"0.500312",
"0.50003195",
"0.499108",
"0.49731997",
"0.49486753",
"0.49381787",
"0.49381787",
"0.49294835",
"0.49244186",
"0.49168172"
] | 0.7581655 | 0 |
Purifica los datos como html | public function purifyHtml($data){
$this->parser->options=array();
return $this->_purify($data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function purify($data){\n $this->parser->options=array(\n 'HTML.Allowed'=>'',\n );\n return $this->_purify($data);\n }",
"public function purify($data){\n $this->parser->options=array(\n 'HTML.Allowed'=>'',\n );\n return $this->_purify($data);\n }",
"function generar_html()\n\t{\n\t\t$this->pantalla()->generar_html();\t\n\t}",
"public function Clean() {\n\t\t$content = str_replace(['<br>', \"\\n\\n\"], '', $this->owner->NoHTML());\n\t\t//remove characters outside ASCII\n\t\t// return preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $content);\n\t\t$find = array('“', '’', '…', '—', '–', '‘', 'é', 'Â', '•', 'Ëœ', 'â€', '<br />'); // en dash\n\t\t$replace = array('“', '’', '…', '—', '–', '‘', 'é', '', '•', '˜', '”', ' ');\n\t\t$content = str_replace($find, $replace, $content);\n\t\treturn $content;\n\t}",
"public function purifyCustomHtml($data){\n $this->parser->options=array(\n 'HTML.Allowed'=>'br,a[href]',\n );\n return $this->_purify($data);\n }",
"private function clean_content($data) \r\n\t{\r\n\t return strip_tags($data);\r\n\t}",
"function RenderDinamicData($html, $data) {\n\n foreach($data as $clave=>$valor){\n $html = str_replace('{'.$clave.'}', $valor, $html);\n }\n return $html;\n }",
"private function htmlFormulaireSuppression(){\n $url_oui = $this->container->router->pathFor('supprimerListe', ['tokencreation'=>$this->data['tokencreation']]);\n $url_non=$this->container->router->pathFor('modificationAjoutListe', ['tokencreation'=>$this->data['tokencreation']]);\n $html=<<<END\n <section class='content'>\n <h1 align=\"center\">Suppression de la liste </h1>\n Voulez-vous réellement supprimer cette liste ?\n <button><a href=\"$url_oui\">Oui</a></button>\n\n <button><a href=\"$url_non\">Non</a></button>\n </section>\nEND;\n return $html;\n }",
"public function getHTML();",
"protected function html() {\n\t\treturn '';\n\t}",
"function html_off($text)\n{\n\t//gestion des sauts de ligne\n\t$text = str_replace(\"<br>\", \"[saut_ligne]\", $text);\n\t$text = str_replace(\"<br/>\", \"[saut_ligne]\", $text);\n\t$text = str_replace(\"<br />\", \"[saut_ligne]\", $text);\n\t\n\t//on enlève toutes les balises HTML les balises HTML\n\t$text = preg_replace(\"@<[\\/\\!]*?[^<>]*?>@si\", \"\", $text);\n\t\n\t//on remet les saut de ligne\n\t$text = str_replace(\"[saut_ligne]\", \"<br />\", $text);\n\t\n\treturn $text;\n}",
"public function generateHtml();",
"private function resetContent()\n {\n $this->html = $this->html_tpl;\n $this->title = $this->title_tpl;\n }",
"public function cleanData($data){\n $data = trim($data);\n $data = strip_tags($data);\n $data = htmlspecialchars($data);\n return $data;\n }",
"private function _stripTags() {\n\t\tif (count($this->data[$this->name]) > 0) {\n\t\t\tforeach ($this->data[$this->name] as $field => $value) {\n\t\t\t\tif (isset($this->_schema[$field])) {\n\t\t\t\t\tswitch ($this->_schema[$field]['type']) {\n\t\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = trim(strip_tags($value));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t//$this->data[$this->name][$field] = trim(strip_tags($value), array('h1','h2','h3','h4','h5','h6','p','em','strong','ul','ol','li','img','a','del'));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function safeHtml($html)\n {\n preg_match_all('#<(?!meta|img|br|hr|input\\b)\\b([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);\n $openedtags = $result[1];\n preg_match_all('#</([a-z]+)>#iU', $html, $result);\n $closedtags = $result[1];\n $len_opened = count($openedtags);\n if (count($closedtags) == $len_opened) {\n return $html;\n }\n $openedtags = array_reverse($openedtags);\n for ($i = 0; $i < $len_opened; $i++) {\n if (!in_array($openedtags[$i], $closedtags)) {\n $html .= '</' . $openedtags[$i] . '>';\n } else {\n unset($closedtags[array_search($openedtags[$i], $closedtags)]);\n }\n }\n\n $tagsPermitidas = \"<html><body><b><br><em><i><li><ol><p><s><span><thead><tbody><table><tr><td><u><ul><h1><h2><h3><h4><h5><h6><pre><img>\";\n \n $html = strip_tags($html, $tagsPermitidas);\n\n return $html;\n }",
"static function cleanUpHtml($html) {\n if (trim($html)) {\n $html = HtmlPurifierForAngie::purify($html);\n \n $dom = SimpleHTMLDOMForAngie::getInstance($html);\n \t\t\tif($dom) {\n \t\t\t // Remove Apple style class SPAN-s\n \t\t\t $elements = $dom->find('span[class=Apple-style-span]');\n \t\t\t if(is_foreachable($elements)) {\n \t\t\t foreach($elements as $element) {\n \t\t\t $element->outertext = $element->plaintext;\n \t\t\t } // foreach\n \t\t\t } // if\n\n // Remove empty paragraphs\n if(defined('REMOVE_EMPTY_PARAGRAPHS') && REMOVE_EMPTY_PARAGRAPHS) {\n foreach($dom->find('p') as $element) {\n $cleaned_up_content = trim(str_replace(' ', ' ', strip_tags($element->innertext)));\n\n // Empty paragraph (non-breaking spaces are converted to spaces so trim can remove them)?\n //if(trim(preg_replace('/\\x{00A0}/u', ' ', $element->plaintext)) == '') {\n if(empty($cleaned_up_content)) {\n if(strpos($element->innertext, 'img')) {\n continue;\n } // if\n\n $element->outertext = '';\n } // if\n } // foreach\n } // if\n\n \t\t\t $html = (string) $dom;\n \t\t\t} // if\n \n \t\t\treturn $html;\n } else {\n return '';\n } // if\n }",
"function ChamaManutencao(){\n\t\t\t$filename = 'html/manutencao.html';\n\t\t\t$handle = fopen($filename,\"r\");\n\t\t\t$Html = fread($handle,filesize($filename));\n\t\t\tfclose($handle);\n\t\t\t$SaidaHtml = $this->CarregaHtml('modelo');\n\t\t\t$SaidaHtml = str_replace('<%CONTEUDO%>',$Html,$SaidaHtml);\n\t\t\t$SaidaHtml = str_replace('<%URLPADRAO%>',UrlPadrao,$SaidaHtml);\n\t\t\techo $SaidaHtml;\n\t\t\tdie;\n\t\t}",
"abstract public function html();",
"abstract public function html();",
"function clearData($cadena){\n $cadenaLimpia = htmlspecialchars($cadena);\n $cadenaLimpia = trim($cadenaLimpia); // quita espacios al principio y al final\n $cadenaLimpia = stripslashes($cadenaLimpia); // quita las barras de un string\n\n return $cadenaLimpia;\n }",
"public static function cleanHTMLData(&$data)\n {\n if (is_array($data)) {\n foreach ($data as $i => $w)\n if (is_array($w))\n self::cleanHTMLData($data[$i]);\n else\n $data[$i] = htmlentities($w, ENT_QUOTES, self::STRING_ENCODING);\n } else {\n $data = htmlentities($data, ENT_QUOTES, self::STRING_ENCODING);\n }\n }",
"public function HTML($data) : string {\n return $this->process($data, function(\\SimpleXMLElement $data) : string {\n $string = $data->asXML();\n $tidy = new \\tidy();\n $config = array_merge(ImportConfig::$TIDY, [\n 'output-xml' => false,\n 'output-html' => true,\n 'show-body-only' => true,\n ]);\n $string = $tidy->repairString($string, $config, 'utf8');\n return $string;\n });\n }",
"function sanitizeData($data){\n return htmlspecialchars($data);\n \n }",
"public function getHtml() {\n\t}",
"private function prepare_data( $value ){\r\n //unhtml the entries\r\n// $trans_tbl = get_html_translation_table (HTML_ENTITIES);\r\n// $trans_tbl = array_flip ($trans_tbl);\r\n// return strtr($value, $trans_tbl);\r\n $value = str_replace( \"'\", \"\\'\", $value );\r\n \r\n return $value;\r\n }",
"private function stripContentDomByFilters()\n\t{\n\t\tif(count($this->feed->predefine->filters_array)==0) return;\n\n\t\t/* */\n\t\tforeach($this->feed->predefine->filters_array as $filter)\n\t\t{\n\t\t\t$this->pre_loadHTML();\n\t\t\tlist($type,$id)=$this->get_filter_type_id($filter);\n\n\t\t\t$xpath = new \\DOMXpath($this->dom);\n\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'class':\n\t\t\t\t$nodeList = $xpath->query(\"//*[contains(@class, '\".$id.\"')]\");\n\t\t\t\tif(get_class($nodeList)=='DOMNodeList')\n\t\t\t\t{\n\t\t\t\t\tforeach ($nodeList as $node) {\n\t\t\t\t\t\t$node->parentNode->removeChild($node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'id':\n\t\t\t\t$node=$this->dom->getElementById($id);\n\t\t\t\tif(get_class($node)=='DOMElement')\n\t\t\t\t\t$node->parentNode->removeChild($node);\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t$nodeList=$this->dom->getElementsByTagName($id);\n\t\t\t\tif(get_class($nodeList)=='DOMNodeList')\n\t\t\t\t{\n\t\t\t\t\tforeach ($nodeList as $node) {\n\t\t\t\t\t\t$node->parentNode->removeChild($node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->post_saveHTML();\n\t\t}\n\t}",
"public abstract function getHTML();",
"function cleanup_data($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n \n return $data;\n }",
"function clearData($cadena)\n{\n $cadenaLimpia = htmlspecialchars($cadena);\n $cadenaLimpia = trim($cadenaLimpia); // para quitar espacios al principio y al final\n $cadenaLimpia = stripslashes($cadenaLimpia); // para quitar las barras de un string\n\n return $cadenaLimpia;\n}"
] | [
"0.6493186",
"0.6493186",
"0.6162339",
"0.60709465",
"0.6070935",
"0.6059613",
"0.6052733",
"0.59972847",
"0.59694993",
"0.59533733",
"0.58538944",
"0.5848763",
"0.58120966",
"0.5769949",
"0.57454884",
"0.56835407",
"0.5671758",
"0.5665696",
"0.56564623",
"0.56564623",
"0.5647566",
"0.5646043",
"0.5643662",
"0.5634292",
"0.5629817",
"0.5627128",
"0.5623456",
"0.5571258",
"0.55709225",
"0.55660367"
] | 0.671731 | 1 |
/ function to create xml file created by NK created on 19 July'17 $phoneNumber : From the master bucket table | public function create_save_xml_fie($phoneNumber='9780058718')
{
$xml = "<?xml version='1.0' encoding='UTF-8'?><phone>$phoneNumber</phone>";
$xmlFilePath = public_path('templateBackup').DIRECTORY_SEPARATOR;
$file = fopen($xmlFilePath."phonenumber.xml","w");
fwrite($file,$xml);
fclose($file);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createmanifestxml($params_array,$company_client_number){\n\t\t\n\t\t// getting UUID\n\t\t$uuid = file_get_contents('https://www.uuidgenerator.net/api/version4');\n\t\t$val = array(\"\\n\",\"\\r\");\n\t\t$uuid = str_replace($val, \"\", $uuid);\n\n\t\t// getting current timestamp\n\t\t\n\t\t$time = $params_array['time'];\n\t\t$date = date('Ymd',$time);\n\t\t$h = date('H',$time);\n\t\t$i = date('i',$time);\n\t\t$s = date('s',$time);\n\t\t$current_date = date('Y-m-d',$time);\n\t\t$current_time = date('H:i:s',$time);\n\t\t$current_timestamp = $current_date.'T'.$current_time.'Z';\n\n\t\t//getting reporting year\n\t\t$reporting_year = trim($params_array['reporting_year']);\t\t\n\n\t\t//getting 1094c company name (1)\n\t\t$company_name = trim($params_array['employer_name']);\n\t\t\n\t\t// getting company EIN (2)\n\t\t$company_ein = trim($params_array['clean_ein']);\n\t\t\n\t\t//getting 1094c address one (3.1)\n\t\t$address_one = trim($params_array['addressone']);\n\t\t\n\t\t//getting 1094c address two (3.2)\n\t\t$address_two = trim($params_array['addresstwo']);\n\t\t\n\t\t//getting 1094c city (4)\n\t\t$city = trim($params_array['city']);\n\t\t\n\t\t//getting 1094c state (5)\n\t\t$state = trim($params_array['state']);\n\t\t\n\t\t//getting 1094c zip (6)\n\t\t$zip = trim($params_array['zip']);\n\t\t\n\t\t//getting 1094c contact_first_name (7.1)\n\t\t$contact_first_name = trim($params_array['contact_first_name']);\n\t\t\n\t\t//getting 1094c contact_middle_name (7.2)\n\t\t$contact_middle_name = trim($params_array['contact_middle_name']);\n\t\t\n\t\t//getting 1094c contact_last_name (7.3)\n\t\t$contact_last_name = trim($params_array['contact_last_name']);\n\t\t\n\t\t//getting 1094c contact_suffix (7.4)\n\t\t$contact_suffix = trim($params_array['contact_suffix']);\n\t\t\n\t\t//getting 1094c contact_phone (8)\n\t\t$contact_phone = trim($params_array['contact_phone']);\n\n\t\t// getting payee record count (18)\n\t\t$payee_record_count = trim($params_array['total_no_records_submitted']);\n\t\tif($payee_record_count != ''){$payee_record_count = $payee_record_count; }\n\t\telse{$payee_record_count = 0;}\n\n\t\t// getting 1095c data file size\n\t\t/*$onezeroninefive_datafile_size = '';*/\n\t\t$onezeroninefive_datafile_size = filesize(getcwd().'/files/xml/'.$company_client_number.'/1094C_Request_BB2K6_'.$date.''.$time.'Z.xml');\n\t\t\n\t\t// getting unique md5 hash for ChecksumAugmentationNum\n\t\t\n\t\t$unique_hash = md5($time);\n\n\t\t$xmlString = '<ACAUIBusinessHeader xmlns:p4=\"urn:us:gov:treasury:irs:common\" xmlns:p3=\"urn:us:gov:treasury:irs:ext:aca:air:ty16\" xmlns:p2=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:p1=\"urn:us:gov:treasury:irs:msg:acabusinessheader\" xsi:schemaLocation=\"urn:us:gov:treasury:irs:msg:acauibusinessheader IRS-ACAUserInterfaceHeaderMessage.xsd \" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:us:gov:treasury:irs:msg:acauibusinessheader\">\n\t\t\t\t\t\t\t<p1:ACABusinessHeader>\n\t\t\t\t\t\t\t\t<p3:UniqueTransmissionId>'.$uuid.':SYS12:BB2K6::T</p3:UniqueTransmissionId>\n\t\t\t\t\t\t\t\t<p4:Timestamp>'.$current_timestamp.'</p4:Timestamp>\n\t\t\t\t\t\t\t</p1:ACABusinessHeader>\n\t\t\t\t\t\t\t<p3:ACATransmitterManifestReqDtl>\n\t\t\t\t\t\t\t\t<p3:PaymentYr>'.$reporting_year.'</p3:PaymentYr>\n\t\t\t\t\t\t\t\t<p3:PriorYearDataInd>0</p3:PriorYearDataInd>\n\t\t\t\t\t\t\t\t<p4:EIN>'.$company_ein.'</p4:EIN>\n\t\t\t\t\t\t\t\t<p3:TransmissionTypeCd>O</p3:TransmissionTypeCd>\n\t\t\t\t\t\t\t\t<p3:TestFileCd>P</p3:TestFileCd>\n\t\t\t\t\t\t\t\t<p3:TransmitterNameGrp>\n\t\t\t\t\t\t\t\t\t<p3:BusinessNameLine1Txt>SKY INSURANCE TECHNOLOGIES LLC</p3:BusinessNameLine1Txt>\n\t\t\t\t\t\t\t\t</p3:TransmitterNameGrp>\n\t\t\t\t\t\t\t\t<p3:CompanyInformationGrp>\n\t\t\t\t\t\t\t\t\t<p3:CompanyNm>'.$company_name.'</p3:CompanyNm>\n\t\t\t\t\t\t\t\t\t<p3:MailingAddressGrp>\n\t\t\t\t\t\t\t\t\t\t<p3:USAddressGrp>';\n\t\t\t\t\t\t\t\t\t\t\tif($address_one !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:AddressLine1Txt>'.$address_one.'</p3:AddressLine1Txt>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($address_two !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:AddressLine2Txt>'.$address_two.'</p3:AddressLine2Txt>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($city !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p4:CityNm>'.$city.'</p4:CityNm>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($state !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:USStateCd>'.$state.'</p3:USStateCd>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif($zip !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p4:USZIPCd>'.$zip.'</p4:USZIPCd>';\n\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t$xmlString .= \t\t\t\t\t\t'</p3:USAddressGrp>\n\t\t\t\t\t\t\t\t\t</p3:MailingAddressGrp>\n\t\t\t\t\t\t\t\t\t<p3:ContactNameGrp>';\n\t\t\t\t\t\t\t\t\t\tif($contact_first_name !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:PersonFirstNm>'.$contact_first_name.'</p3:PersonFirstNm>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif($contact_middle_name !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:PersonMiddleNm>'.$contact_middle_name.'</p3:PersonMiddleNm>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif($contact_last_name !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:PersonLastNm>'.$contact_last_name.'</p3:PersonLastNm>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif($contact_suffix !=''){\n\t\t$xmlString .= \t\t\t\t\t\t'<p3:SuffixNm>'.$contact_suffix.'</p3:SuffixNm>';\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t$xmlString .= \t\t\t\t'</p3:ContactNameGrp>';\n\t\t\t\t\t\t\t\t\tif($contact_phone !=''){\n\t\t$xmlString .= \t\t\t\t\t'<p3:ContactPhoneNum>'.$contact_phone.'</p3:ContactPhoneNum>';\n\t\t\t\t\t\t\t\t\t}\n\t\t$xmlString .= \t\t\t'</p3:CompanyInformationGrp>\n\t\t\t\t\t\t\t\t<p3:VendorInformationGrp>\n\t\t\t\t\t\t\t\t\t<p3:VendorCd>I</p3:VendorCd>\n\t\t\t\t\t\t\t\t\t<p3:ContactNameGrp>\n\t\t\t\t\t\t\t\t\t\t<p3:PersonFirstNm>Jordan</p3:PersonFirstNm>\n\t\t\t\t\t\t\t\t\t\t<p3:PersonMiddleNm>O</p3:PersonMiddleNm>\n\t\t\t\t\t\t\t\t\t\t<p3:PersonLastNm>Smith</p3:PersonLastNm>\n\t\t\t\t\t\t\t\t\t</p3:ContactNameGrp>\n\t\t\t\t\t\t\t\t\t<p3:ContactPhoneNum>8886636503</p3:ContactPhoneNum>\n\t\t\t\t\t\t\t\t</p3:VendorInformationGrp>\n\t\t\t\t\t\t\t\t<p3:TotalPayeeRecordCnt>'.$payee_record_count.'</p3:TotalPayeeRecordCnt>\n\t\t\t\t\t\t\t\t<p3:TotalPayerRecordCnt>1</p3:TotalPayerRecordCnt>\n\t\t\t\t\t\t\t\t<p3:SoftwareId>15A0000123</p3:SoftwareId>\n\t\t\t\t\t\t\t\t<p3:FormTypeCd>1094/1095C</p3:FormTypeCd>\n\t\t\t\t\t\t\t\t<p4:BinaryFormatCd>application/xml</p4:BinaryFormatCd>\n\t\t\t\t\t\t\t\t<p4:ChecksumAugmentationNum>'.$unique_hash.'</p4:ChecksumAugmentationNum>\n\t\t\t\t\t\t\t\t<p4:AttachmentByteSizeNum>'.$onezeroninefive_datafile_size.'</p4:AttachmentByteSizeNum>';\n\t\t\t\t\t\t\t\t/*<p3:DocumentSystemFileNm>1094C_Request_BB2K6_'.$date.'T'.$h.''.$i.''.$s.'000Z.xml</p3:DocumentSystemFileNm>*/\n\t\t$xmlString .=\t\t\t'<p3:DocumentSystemFileNm>1094C_Request_BB2K6_'.$date.''.$time.'Z.xml</p3:DocumentSystemFileNm>\n\t\t\t\t\t\t\t</p3:ACATransmitterManifestReqDtl>\n\t\t\t\t\t\t</ACAUIBusinessHeader>';\n\t\t//print_r($xmlString);die();\n\t\t$dom = new \\DOMDocument();\n\t\t//$dom->preserveWhiteSpace = FALSE;\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$dom->formatOutput = true;\n\t\t$dom->loadXML($xmlString);\n\t\t\n\t\t\n\t\t// create folder\n\t\tif (!file_exists(getcwd().'/files/xml/'.$company_client_number)) {\n\t\t\tmkdir(getcwd().'/files/xml/'.$company_client_number, 0777, true);\n\t\t}\n\t\t//Save XML as a file\n\t\tif($dom->save(getcwd().'/files/xml/'.$company_client_number.'/Manifest_soapheader_P.xml')){\n\t\t\treturn 'success';\n\t\t}\n\t\telse{\n\t\t\treturn 'fail';\n\t\t}\n\t}",
"private function _create()\n\t{\n\t\t$this->_xml->newXMLDocument();\n\t\t$this->_xml->addElement( 'xmlarchive', '', array( 'generator' => 'IPS_KERNEL', 'created' => time() ) );\n\t\t$this->_xml->addElement( 'fileset', 'xmlarchive' );\n\t\t\n\t\tforeach( $this->_fileArray as $f )\n\t\t{\n\t\t\t$f['content'] = chunk_split(base64_encode($f['content']));\n\t\t\t\n\t\t\t$this->_xml->addElementAsRecord( 'fileset', 'file', $f );\n\t\t}\n\t}",
"function createxmltable($databasename, $tablename, $fields, $path = \".\", $singlefilename = false)\n{\n if (!file_exists(\"$path/$databasename\") || !is_dir(\"$path/$databasename\"))\n return \"xml databse not exists\";\n if (file_exists(\"$path/$databasename/$tablename\") && file_exists(\"$path/$databasename/$tablename.php\"))\n return \"xml table exists\";\n if (!is_writable(\"$path/$databasename/\"))\n return \"xml database not writable\";\n $str = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<?php exit(0);?>\\n<tables>\";\n foreach ($fields as $field)\n {\n $str .= \"\\n\\t<field>\";\n foreach ($field as $key => $value)\n {\n $str .= \"\\n\\t\\t<$key>$value</$key>\";\n }\n $str .= \"\\n\\t</field>\";\n }\n if ($singlefilename != false)\n {\n if (is_array($singlefilename))\n {\n foreach ($singlefilename as $key => $values)\n {\n $str .= \"\\n\\t<$key>\" . xmlenc($values) . \"</$key>\";\n }\n }\n else\n {\n $str .= \"\\n<filename>$singlefilename</filename>\";\n }\n }\n $str .= \"\\n</tables>\";\n if (!file_exists(\"$path/$databasename/$tablename\"))\n {\n mkdir(\"$path/$databasename/$tablename\");\n //dprint_r(\"$path/$databasename/$tablename\");\n }\n $file = fopen(\"$path/$databasename/$tablename.php\", \"w\");\n fwrite($file, $str);\n fclose($file);\n return false;\n}",
"function generateXML () {\n \t$xml_string = \"\";\n // print out document to the browser\n // need to use stripslashes for the damn \">\"\n $xml_string.= stripslashes ($this->header);\n // add the styles\n $xml_string.= $this->styles;\n $xml_string.= \"\\n<Worksheet ss:Name=\\\"\" . $this->worksheet_title . \"\\\">\\n<Table>\\n\";\n $xml_string.= \"<Column ss:Width=\\\"220\\\" />\\n\";\n // add the header row\n $xml_string.= \"\\n\".$this->headerrow;\n // add the data rows\n $xml_string.= implode (\"\\n\", $this->rows);\n $xml_string.= \"</Table>\\n</Worksheet>\\n\";\n $xml_string.= $this->footer;\n \n return $xml_string;\n\n }",
"abstract protected function generateXML(): void;",
"public function makeXMLFile($request_params) {\n //CREATING XML FILE FOR TWILLIO\n $file_name = str_replace('+', '0', $request_params['phone_no']) . '.xml';\n $file_path = base_path('public') . '/callxmls/' . $file_name;\n //PREPARING TWIML RESPONSE(XML CONTENT)\n $response = $this->makeCodeTwiml($request_params['verification_code']);\n //WRITTING XML INTO IT\n $fp = fopen($file_path, 'w');\n fwrite($fp, $response);\n fclose($fp);\n //GIVING 777 PERMISSION SO THAT TWILLIO CAN READ IT \n chmod($file_path, 0777);\n $localPath = base_path('public') . '/callxmls/' . $file_name;\n $s3_destination = $this->getCommonUtils()->call_paths['s3_path'] . $file_name;\n $upload = \\Storage::disk('s3')->put($s3_destination, file_get_contents($localPath));\n if ($upload) {\n unlink($localPath);\n }\n return $file_name;\n }",
"private function createdataxml($params_array,$company_client_number){\n\t\t\n\t\t$time = $params_array['time'];\n\t\t$date = date('Ymd',$time);\n\t\t\n\t\t//getting form_id\n\t\t$form_id = trim($params_array['form_id']);\n\t\t\n\t\t//getting reporting year\n\t\t$reporting_year = trim($params_array['reporting_year']);\n\t\t\n\t\t//getting 1094c company name (1)\n\t\t$company_name = trim($params_array['employer_name']);\n\t\t\n\t\t// getting company EIN (2)\n\t\t$company_ein = trim($params_array['clean_ein']);\n\t\t\n\t\t//getting 1094c address one (3.1)\n\t\t$address_one = trim($params_array['addressone']);\n\t\t\n\t\t//getting 1094c address two (3.2)\n\t\t$address_two = trim($params_array['addresstwo']);\n\t\t\n\t\t//getting 1094c city (4)\n\t\t$city = trim($params_array['city']);\n\t\t\n\t\t//getting 1094c state (5)\n\t\t$state = trim($params_array['state']);\n\t\t\n\t\t//getting 1094c zip (6)\n\t\t$zip = trim($params_array['zip']);\n\t\t\n\t\t//getting 1094c contact_first_name (7.1)\n\t\t$contact_first_name = trim($params_array['contact_first_name']);\n\t\t\n\t\t//getting 1094c contact_middle_name (7.2)\n\t\t$contact_middle_name = trim($params_array['contact_middle_name']);\n\t\t\n\t\t//getting 1094c contact_last_name (7.3)\n\t\t$contact_last_name = trim($params_array['contact_last_name']);\n\t\t\n\t\t//getting 1094c contact_suffix (7.4)\n\t\t$contact_suffix = trim($params_array['contact_suffix']);\n\t\t\n\t\t//getting 1094c contact_phone (8)\n\t\t$contact_phone = trim($params_array['contact_phone']);\n\t\t\n\t\t//getting 1094c govt_entity_name (9)\n\t\t$govt_entity_name = trim($params_array['govt_entity_name']);\n\t\t\n\t\t//getting 1094c employer_ein (10)\n\t\t$employer_ein = trim($params_array['employer_ein']);\n\t\t\n\t\t//getting 1094c govt_entity_name (11.1)\n\t\t$address_line_one = trim($params_array['address_line_one']);\n\t\t\n\t\t//getting 1094c govt_entity_name (11.2)\n\t\t$address_line_two = trim($params_array['address_line_two']);\n\t\t\n\t\t//getting 1094c govt_city (12)\n\t\t$govt_city = trim($params_array['city_or_town_2_I']);\n\t\t\n\t\t//getting 1094c govt_state (13)\n\t\t$govt_state = trim($params_array['state_or_province_2_I']);\n\t\t\n\t\t//getting 1094c govt_zip (14)\n\t\t$govt_zip = trim($params_array['country_and_zip_2_I']);\n\t\t\n\t\t//getting 1094c person_first_name (15.1)\n\t\t$person_first_name = trim($params_array['first_name_of_person_to_contact_2_I']);\n\t\t\n\t\t//getting 1094c person_middle_name (15.2)\n\t\t$person_middle_name = trim($params_array['middle_name_of_person_to_contact_2_I']);\n\t\t\n\t\t//getting 1094c person_last_name (15.3)\n\t\t$person_last_name = trim($params_array['last_name_of_person_to_contact_2_I']);\n\t\t\n\t\t//getting 1094c person_suffix_name (15.4)\n\t\t$person_suffix_name = trim($params_array['suffix_name_of_person_to_contact_2_I']);\n\t\t\n\t\t//getting 1094c person_phone (16)\n\t\t$person_phone = trim($params_array['contact_telephone_number_2_I']);\n\t\t\n\t\t// getting 1094payee record count (18)\n\t\t$payee_record_count = trim($params_array['total_no_records_submitted']);\n\t\tif($payee_record_count != ''){$payee_record_count = $payee_record_count; }\n\t\telse{$payee_record_count = 0;}\n\t\t\n\t\t// getting 1094 filled record count (20)\n\t\t$filled_record_count = trim($params_array['total_no_of_1095c_filled_II']);\n\t\t\n\t\t// getting 1094 ale_member_check (21)\n\t\t$ale_member_check = trim($params_array['ale_member_check']);\n\t\t\n\t\t// getting 1094 quality_offer_method (22A)\n\t\t$quality_offer_method = trim($params_array['quality_offer_method']);\n\t\t\n\t\t// getting 1094 section_4980_transition (22C)\n\t\t$section_4980_transition = trim($params_array['section_4980_transition']);\n\t\t\n\t\t// getting 1094 offer_method (22D)\n\t\t$offer_method = trim($params_array['offer_method']);\n\t\t\n\t\t// getting 1094 offer_method (23A)\n\t\t$minimal_essential_coverage = trim($params_array['minimal_essential_coverage']);\n\t\t\n\t\t// getting 1094 section 4980 (23B)\n\t\t$full_time_employee_count_for_ale_member = trim($params_array['full_time_employee_count']);\n\t\t\n\t\t// getting 1094 total employee count for ale member (23C)\n\t\t$total_employee_count_for_ale_member = trim($params_array['total_employee_count_for_ale_member']);\n\t\t\n\t\t// getting 1094 aggregate_group_indecator (23D)\n\t\t$aggregate_group_indicator = trim($params_array['aggregate_group_all']);\n\t\t\n\t\t// getting 1094 array of minimum essential cover offered (24A-35A)\n\t\t$arr_minimal_essential_coverage = $params_array['arr_minimal_essential_coverage'];\n\t\t\n\t\t// getting 1094 array of total employee count for ALE member (24C-35C)\n\t\t$arr_total_employee_count = $params_array['arr_total_employee_count'];\n\t\t\n\t\t// getting 1094 array of aggregated grp count (24D-35D)\n\t\t$arr_aggrigated_grp_indicator = $params_array['arr_aggrigated_grp_indicator'];\n\t\t\n\t\t// getting 1094 array of Section 4980H Transition Relief Indicator (24E-35E)\n\t\t$arr_section_4980h_transition = $params_array['arr_section_4980h_transition'];\n\t\t\n\t\t// getting total 1095 forms count\n\t\t$_1095_count = $params_array['total_1095_count'];\n\t\t\n\t\t$other_ale_member = trim($params_array['other_ale_member']);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$xmlString = '<n1:Form109495CTransmittalUpstream xmlns=\"urn:us:gov:treasury:irs:ext:aca:air:ty16\" xmlns:irs=\"urn:us:gov:treasury:irs:common\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:n1=\"urn:us:gov:treasury:irs:msg:form1094-1095Ctransmitterupstreammessage\" xsi:schemaLocation=\"urn:us:gov:treasury:irs:msg:form1094-1095Ctransmitterupstreammessage IRS-Form1094-1095CTransmitterUpstreamMessage.xsd\">\n\t\t\t\t\t\t<Form1094CUpstreamDetail recordType=\"String\" lineNum=\"0\">\n\t\t\t\t\t\t\t<SubmissionId>1</SubmissionId>\n\t\t\t\t\t\t\t<TaxYr>'.$reporting_year.'</TaxYr>\n\t\t\t\t\t\t\t<CorrectedInd>0</CorrectedInd>\n\t\t\t\t\t\t\t<EmployerInformationGrp>\n\t\t\t\t\t\t\t\t<BusinessName>\n\t\t\t\t\t\t\t\t\t<BusinessNameLine1Txt>'.$company_name.'</BusinessNameLine1Txt>\n\t\t\t\t\t\t\t\t</BusinessName>\n\t\t\t\t\t\t\t\t<irs:TINRequestTypeCd>BUSINESS_TIN</irs:TINRequestTypeCd>\n\t\t\t\t\t\t\t\t<irs:EmployerEIN>'.$company_ein.'</irs:EmployerEIN>\n\t\t\t\t\t\t\t\t<MailingAddressGrp>\n\t\t\t\t\t\t\t\t\t<USAddressGrp>';\n\t\t\t\t\t\t\t\tif($address_one !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<AddressLine1Txt>'.$address_one.'</AddressLine1Txt>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($address_two !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<AddressLine2Txt>'.$address_two.'</AddressLine2Txt>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($city !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<irs:CityNm>'.$city.'</irs:CityNm>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($state !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<USStateCd>'.$state.'</USStateCd>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($zip !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<irs:USZIPCd>'.$zip.'</irs:USZIPCd>';\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\t\t$xmlString .=\t\t\t\t'</USAddressGrp>\n\t\t\t\t\t\t\t\t</MailingAddressGrp>\n\t\t\t\t\t\t\t\t<ContactNameGrp>';\n\t\t\t\t\t\t\tif($contact_first_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonFirstNm>'.$contact_first_name.'</PersonFirstNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($contact_middle_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonMiddleNm>'.$contact_middle_name.'</PersonMiddleNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($contact_last_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonLastNm>'.$contact_last_name.'</PersonLastNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($contact_suffix !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<SuffixNm>'.$contact_suffix.'</SuffixNm>';\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t$xmlString .=\t\t\t'</ContactNameGrp>';\n\t\t\t\t\t\tif($contact_phone !=''){\n\t\t$xmlString .= \t\t\t'\n\t\t\t\t\t\t\t\t<ContactPhoneNum>'.$contact_phone.'</ContactPhoneNum>';\n\t\t\t\t\t\t}\n\t\t$xmlString .=\t\t'</EmployerInformationGrp>';\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\tif($govt_entity_name!='' || $employer_ein!='') {\t\t\t\t\t \n\t\t$xmlString .=\t\t'<GovtEntityEmployerInfoGrp>\n\t\t\t\t\t\t\t\t<BusinessName>\n\t\t\t\t\t\t\t\t\t<BusinessNameLine1Txt>'.$govt_entity_name.'</BusinessNameLine1Txt>\n\t\t\t\t\t\t\t\t</BusinessName>\n\t\t\t\t\t\t\t\t<BusinessNameControlTxt>BUSI</BusinessNameControlTxt>\n\t\t\t\t\t\t\t\t<irs:TINRequestTypeCd>BUSINESS_TIN</irs:TINRequestTypeCd>';\n\t\t\t\t\t\t\tif($employer_ein !=''){\n\t\t$xmlString .=\t\t\t'<irs:EmployerEIN>'.$employer_ein.'</irs:EmployerEIN>\n\t\t\t\t\t\t\t\t<MailingAddressGrp>\n\t\t\t\t\t\t\t\t\t<USAddressGrp>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($address_line_one !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<AddressLine1Txt>'.$address_line_one.'</AddressLine1Txt>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($address_line_two !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<AddressLine2Txt>'.$address_line_two.'</AddressLine2Txt>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($govt_city !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<irs:CityNm>'.$govt_city.'</irs:CityNm>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($govt_state !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<USStateCd>'.$govt_state.'</USStateCd>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($govt_zip !=''){\n\t\t$xmlString .= \t\t\t\t\t'\n\t\t\t\t\t\t\t\t\t\t<irs:USZIPCd>'.$govt_zip.'</irs:USZIPCd>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t$xmlString .=\t\t\t\t'</USAddressGrp>\n\t\t\t\t\t\t\t\t</MailingAddressGrp>\n\t\t\t\t\t\t\t\t<ContactNameGrp>';\n\t\t\t\t\t\t\tif($person_first_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonFirstNm>'.$person_first_name.'</PersonFirstNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($person_middle_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonMiddleNm>'.$person_middle_name.'</PersonMiddleNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($person_last_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<PersonLastNm>'.$person_last_name.'</PersonLastNm>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($person_suffix_name !=''){\n\t\t$xmlString .= \t\t\t\t'\n\t\t\t\t\t\t\t\t\t<SuffixNm>'.$person_suffix_name.'</SuffixNm>';\n\t\t\t\t\t\t\t}\n\t\t$xmlString .=\t\t\t'</ContactNameGrp>';\n\t\t\t\t\t\t\tif($person_phone !=''){\n\t\t$xmlString .= \t\t\t'\n\t\t\t\t\t\t\t\t<ContactPhoneNum>'.$person_phone.'</ContactPhoneNum>';\n\t\t\t\t\t\t}\t\t\t\t\t \n\t\t$xmlString .=\t\t'</GovtEntityEmployerInfoGrp>';\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t$xmlString .=\t\t'<Form1095CAttachedCnt>'.$payee_record_count.'</Form1095CAttachedCnt>\n\t\t\t\t\t\t\t<AuthoritativeTransmittalInd>1</AuthoritativeTransmittalInd>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!empty($filled_record_count))\n\t\t\t\t\t\t\t{\n\t\t$xmlString .=\t\t'<TotalForm1095CALEMemberCnt>'.$filled_record_count.'</TotalForm1095CALEMemberCnt>';\n\t\t\t\t\t\t\t}\n\t\t\n\t\t\n\t\t$xmlString .=\t\t'<AggregatedGroupMemberCd>'.$ale_member_check.'</AggregatedGroupMemberCd>\n\t\t\t\t\t\t\t<QualifyingOfferMethodInd>'.$quality_offer_method.'</QualifyingOfferMethodInd>\n\t\t\t\t\t\t\t<Section4980HReliefInd>'.$section_4980_transition.'</Section4980HReliefInd>\n\t\t\t\t\t\t\t<NinetyEightPctOfferMethodInd>'.$offer_method.'</NinetyEightPctOfferMethodInd>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<ALEMemberInformationGrp>\n\t\t\t\t\t\t\t\t<YearlyALEMemberDetail>\n\t\t\t\t\t\t\t\t\t<MinEssentialCvrOffrCd>'.$minimal_essential_coverage.'</MinEssentialCvrOffrCd>';\n\t\t\t\t\t\t\t\tif($full_time_employee_count_for_ale_member!=''){\n\t\t$xmlString .=\t\t\t\t'<ALEMemberFTECnt>'.$full_time_employee_count_for_ale_member.'</ALEMemberFTECnt>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif($total_employee_count_for_ale_member!=''){\n\t\t$xmlString .=\t\t\t\t'<TotalEmployeeCnt>'.$total_employee_count_for_ale_member.'</TotalEmployeeCnt>';\n\t\t\t\t\t\t\t\t}\n\t\t$xmlString .=\t\t\t\t'<AggregatedGroupInd>'.$aggregate_group_indicator.'</AggregatedGroupInd>\n\t\t\t\t\t\t\t\t</YearlyALEMemberDetail>';\n\t\t\t\t\t\t/*for($i=0;$i<12;$i++){\n\t\t\t\t\t\t\tif(!empty($arr_minimal_essential_coverage[$i])){\n\t\t$xmlString .=\t\t\t$arr_minimal_essential_coverage[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\tfor($i=0;$i<12;$i++){\t\n\t\t\t\t\t\t\tif(!empty($arr_total_employee_count[$i])){\n\t\t$xmlString .=\t\t\t$arr_total_employee_count[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/*for($i=0;$i<12;$i++){\n\t\t\t\t\t\t\tif(!empty($arr_aggrigated_grp_indicator[$i])){\n\t\t$xmlString .=\t\t\t$arr_aggrigated_grp_indicator[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\tfor($i=0;$i<12;$i++){\n\t\t\t\t\t\t\tif(!empty($arr_section_4980h_transition[$i])){\n\t\t$xmlString .=\t\t\t$arr_section_4980h_transition[$i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t$xmlString .=\t\t'</ALEMemberInformationGrp>';\n\t\t\n\t\t$xmlString .=\t$other_ale_member;\n\t\t\n\t\t\n\t\t$xmlString .= $this->getindividual1095details($form_id, $reporting_year);\n\t\t\n\t\t$xmlString .=\t'</Form1094CUpstreamDetail>\n\t\t\t\t\t</n1:Form109495CTransmittalUpstream>';\n\n\t\t$dom = new \\DOMDocument();\n\t\t//$dom->preserveWhiteSpace = FALSE;\n\t\t$dom->preserveWhiteSpace = false;\n\t\t$dom->formatOutput = true;\n\t\t$dom->loadXML($xmlString);\n\n\t\t// create folder\n\t\tif (!file_exists(getcwd().'/files/xml/'.$company_client_number)) {\n\t\t\tmkdir(getcwd().'/files/xml/'.$company_client_number, 0777, true);\n\t\t}\n\t\t\n\t\t//Save XML as a file 1094C_Request_BB2K6_<date><timestamp>Z\n\t\tif($dom->save(getcwd().'/files/xml/'.$company_client_number.'/1094C_Request_BB2K6_'.$date.''.$time.'Z.xml')){\n\t\t\treturn 'success';\n\t\t}\n\t\telse{\n\t\t\treturn 'fail';\n\t\t}\n\t}",
"public function actionGeneratexml(){\n\t\t\n\ttry{\n\t\t$clean_ein='';\n\t\t$reporting_year='';\n\t\t$employer_name='';\n\t\t$addressone='';\n\t\t$addresstwo='';\n\t\t$city='';\n\t\t$state ='';\n\t\t$zip='';\n\t\t$contact_first_name='';\n\t\t$contact_middle_name='';\n\t\t$contact_last_name='';\n\t\t$contact_suffix='';\n\t\t$clean_phone='';\n\t\t$govt_entity_name='';\n\t\t$employer_ein='';\n\t\t$total_no_records_submitted='';\n\t\t$_1094c_box23B = '';\n\t\t$_1094c_box23C = '';\n\t\t$arr_minimal_essential_coverage = array();\n\t\t$other_ale_member='';\n\t\t$address_line_one = '';\n\t\t$address_line_two = '';\n\t\t$city_or_town_2_I = '';\n\t\t$state_or_province_2_I = '';\n\t\t$country_and_zip_2_I = '';\n\t\t$first_name_of_person_to_contact_2_I = '';\n\t\t$middle_name_of_person_to_contact_2_I = '';\n\t\t$last_name_of_person_to_contact_2_I = '';\n\t\t$suffix_name_of_person_to_contact_2_I = '';\n\t\t$contact_telephone_number_2_I = '';\n\t\t$total_no_records_submitted = '';\n\t\t$total_no_of_1095c_filled_II = '';\n\t\t$ale_member_check = '';\n\t\t$quality_offer_method ='';\n\t\t$section_4980_transition = '';\n\t\t$offer_method = '';\n\t\t$minimal_essential_coverage = '';\n\t\t$full_time_employee_count = '';\n\t\t$total_employee_count_for_ale_member = '';\n\t\t$aggregate_group_all ='';\n\t\t$arr_minimal_essential_coverage = array();\n\t\t$arr_total_employee_count = array();\n\t\t$arr_aggrigated_grp_indicator = array();\n\t\t$arr_section_4980h_transition = array();\n\t\t$other_ale_member = '';\n\t\t$total_1095_count = '';\n\t\t\n\t\t// get the efile approved companies\n\t\t$companies = TblAcaForms::find()->where(['is_approved'=>1])->andWhere(['xml_file'=>NULL])->All();\t\n\t\t\n\t\tforeach($companies as $company){\n\t\t\t\t\t\n\t\t\t$time = time();\n\t\t\t\n\t\t\t$unique_company_id = $company->company_id;\n\t\t\t\n\t\t\t$company_details = TblAcaCompanies::find()->where(['company_id'=>$unique_company_id])->One();\n\t\t\t\n\t\t\t$company_client_number = $company_details->company_client_number;\n\t\t\t\n\t\t\t$form_id = $company->id;\n\t\t\t\n\t\t\t// getting compamy EIN (2)\n\t\t\t$company_ein = $company->company->company_ein;\n\t\t\t$clean_ein = preg_replace ( '/[^0-9]/s', '', $company_ein );\n\t\t\t\n\t\t\t// getting company year\n\t\t\t$reporting_year = $company->companyreportingyear->year->lookup_value;\n\t\t\t$model_1094 = TblAca1094::find()->where(['form_id'=>$form_id])->one();\n\t\t\t//print_r($model_1094);die();\n\t\t\t// getting 1094c data\n\t\t\t\n\t\t\t//part 1\n\t\t\tif(!empty($model_1094->serialise_data1)){\n\t\t\t\t$unserialise_data_part1 = unserialize ( $model_1094->serialise_data1 );\n\t\t\t\t$part1 = json_decode ( $unserialise_data_part1 );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$part1 = array();\n\t\t\t}\n\t\t \n\t\t\t\n\t\t\t//part 2\n\t\t\tif(!empty($model_1094->serialise_data2)){\n\t\t\t\t$unserialise_data_part2 = unserialize ( $model_1094->serialise_data2 );\n\t\t\t\t$part2 = json_decode ( $unserialise_data_part2 );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$part2 = array();\n\t\t\t}\n\t\t\t\n\t\t\t//part 3\n\t\t\tif(!empty($model_1094->serialise_data3)){\n\t\t\t\t$unserialise_data_part3 = unserialize ( $model_1094->serialise_data3 );\n\t\t\t\t$part3 = json_decode ( $unserialise_data_part3 );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$part3 = array();\n\t\t\t}\n\t\t\t\n\t\t\t//part 4\n\t\t\tif(!empty($model_1094->serialise_data4)){\n\t\t\t\t$unserialise_data_part4 = unserialize ( $model_1094->serialise_data4 );\n\t\t\t\t$part4 = json_decode ( $unserialise_data_part4 );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$part4 = array();\n\t\t\t}\n\t\t\t\n\t\t\t//part 5\n\t\t\tif(!empty($model_1094->xml_data)){\n\t\t\t\t$unserialise_data_part5 = unserialize ( $model_1094->xml_data );\n\t\t\t\t$part5 = json_decode ( $unserialise_data_part5 );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$part5 = array();\n\t\t\t}\n\t\t\t\n\t\t\t///////////////////////\n\t\t\t\n\t\t\t//getting 1094c company name (1)\n\t\t\tif(!empty($part1->name_of_ale_member_1_I)){\n\t\t\t\t$employer_name = $part1->name_of_ale_member_1_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c address one (3.1)\n\t\t\tif(!empty($part5->street_address_1__3)){\n\t\t\t\t$addressone = $part5->street_address_1__3;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c address two (3.2)\n\t\t\tif(!empty($part5->street_address_2__3)){\n\t\t\t\t$addresstwo = $part5->street_address_2__3;\n\t\t\t}\n\t\t\t \n\t\t\t//getting 1094c city (4)\n\t\t\tif(!empty($part1->city_or_town_I)){\n\t\t\t\t$city = $part1->city_or_town_I;\n\t\t\t}\n\t\t \n\t\t\t//getting 1094c state (5)\n\t\t\tif(!empty($part1->state_or_province_I)){\n\t\t\t\t$state = $part1->state_or_province_I;\n\t\t\t}\n\t\t \n\t\t\t//getting 1094c zip (6)\n\t\t\tif(!empty($part1->country_and_zip_I)){\n\t\t\t\t$zip = $part1->country_and_zip_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c contact_first_name (7.1)\n\t\t\t/*if(!empty($part1->first_name_of_the_person_contact_I)){\n\t\t\t\t$contact_first_name = $part1->first_name_of_the_person_contact_I;\n\t\t\t}\n\t\t\t$contact_first_name = $part1->name_of_the_person_contact_I;*/\n\t\t\tif(!empty($part5->first_name__7)){\n\t\t\t\t$contact_first_name = $part5->first_name__7;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//getting 1094c contact_middle_name (7.2)\n\t\t\tif(!empty($part5->middle_name__7)){\n\t\t\t\t$contact_middle_name = $part5->middle_name__7;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c contact_last_name (7.3)\n\t\t\tif(!empty($part5->last_name__7)){\n\t\t\t\t$contact_last_name = $part5->last_name__7;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c contact_suffix (7.4)\n\t\t\tif(!empty($part5->suffix__7)){\n\t\t\t\t$contact_suffix = $part5->suffix__7;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c contact_phone (8)\n\t\t\tif(!empty($part1->contact_telephone_number_I)){\n\t\t\t\t$contact_phone = $part1->contact_telephone_number_I;\n\t\t\t\t$clean_phone = preg_replace ( '/[^0-9\\']/', '', $contact_phone);\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c name of DGE (9)\n\t\t\tif(!empty($part1->name_of_designated_government_entity_I)){\n\t\t\t\t$govt_entity_name = $part1->name_of_designated_government_entity_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c employer EIN (10)\n\t\t\tif(!empty($part1->employer_identification_number_2_I)){\n\t\t\t\t$employer_ein = preg_replace ( '/[^0-9]/s', '', $part1->employer_identification_number_2_I );\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c address_line_one (11.1)\n\t\t\tif(!empty($part5->street_address_1__11)){\n\t\t\t\t$address_line_one = $part5->street_address_1__11;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c address_line_two (11.2)\n\t\t\tif(!empty($part5->street_address_2__11)){\n\t\t\t\t$address_line_two = $part5->street_address_2__11;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c city_or_town_2_I (12)\n\t\t\tif(!empty($part1->city_or_town_2_I)){\n\t\t\t\t$city_or_town_2_I = $part1->city_or_town_2_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c state_or_province_2_I (13)\n\t\t\tif(!empty($part1->state_or_province_2_I)){\n\t\t\t\t$state_or_province_2_I = $part1->state_or_province_2_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c country_and_zip_2_I (14)\n\t\t\tif(!empty($part1->country_and_zip_2_I)){\n\t\t\t\t$country_and_zip_2_I = $part1->country_and_zip_2_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c first_name_of_person_to_contact_2_I (15.1)\n\t\t\tif(!empty($part5->first_name__15)){\n\t\t\t\t$first_name_of_person_to_contact_2_I = $part5->first_name__15;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c last_name_of_person_to_contact_2_I (15.3)\n\t\t\tif(!empty($part5->last_name__15)){\n\t\t\t\t$last_name_of_person_to_contact_2_I = $part5->last_name__15;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c middle_name_of_person_to_contact_2_I (15.2)\n\t\t\tif(!empty($part5->middle_name__15)){\n\t\t\t\t$middle_name_of_person_to_contact_2_I = $part5->middle_name__15;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c suffix_name_of_person_to_contact_2_I (15.4)\n\t\t\tif(!empty($part5->suffix__15)){\n\t\t\t\t$suffix_name_of_person_to_contact_2_I = $part5->suffix__15;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c contact_telephone_number_2_I (16)\n\t\t\tif(!empty($part1->contact_telephone_number_2_I)){\n\t\t\t\t$contact_telephone_number_2_I = $part1->contact_telephone_number_2_I;\n\t\t\t\t$contact_telephone_number_2_I = preg_replace ( '/[^0-9\\']/', '', $contact_telephone_number_2_I);\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c total number of forms submitted (18)\n\t\t\tif(!empty($part1->total_no_of_1095c_submitted_I)){\n\t\t\t\t$total_no_records_submitted = $part1->total_no_of_1095c_submitted_I;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c total number of forms filled (20)\n\t\t\tif(!empty($part2->total_no_of_1095c_filled_II)){\n\t\t\t\t$total_no_of_1095c_filled_II = $part2->total_no_of_1095c_filled_II;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c ale member check (21)\n\t\t\tif(isset($part2->is_ale_member_yes_II) && $part2->is_ale_member_yes_II == 1){\n\t\t\t\t$ale_member_check = 1;\n\t\t\t}\n\t\t\telse if(isset($part2->is_ale_member_no_II) && $part2->is_ale_member_no_II == 1){\n\t\t\t\t$ale_member_check = 2;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c quality_offer_method (22A)\n\t\t\tif(!empty($part2->quality_offer_method_II) && $part2->quality_offer_method_II== 1){\n\t\t\t\t$quality_offer_method = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$quality_offer_method = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c section_4980_transition (22C)\n\t\t\tif(!empty($part2->section_4980_transition_II) && $part2->section_4980_transition_II== 1){\n\t\t\t\t$section_4980_transition = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$section_4980_transition = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c offer_method (22D)\n\t\t\tif(!empty($part2->offer_method_II) && $part2->offer_method_II== 1){\n\t\t\t\t$offer_method = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$offer_method = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c section_4980_transition (22C)\n\t\t\tif(!empty($part3->minimal_essential_coverage_all_yes_III) && $part3->minimal_essential_coverage_all_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_all_no_III) && $part3->minimal_essential_coverage_all_no_III == 1){\n\t\t\t\t$minimal_essential_coverage = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c full_time_employee_count (23B)\n\t\t\tif(!empty($part3->section_4980h_fulltime_employee_count_all_III)){\n\t\t\t\t$full_time_employee_count = $part3->section_4980h_fulltime_employee_count_all_III;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c total_employee_count_for_ale_member (23C)\n\t\t\tif(!empty($part3->total_employee_count_all_III)){\n\t\t\t\t$total_employee_count_for_ale_member = $part3->total_employee_count_all_III;\n\t\t\t}\n\t\t\t\n\t\t\t//getting 1094c aggregate_group_all (23D)\n\t\t\tif(!empty($part3->aggregate_group_all_III) && $part3->aggregate_group_all_III== 1){\n\t\t\t\t$aggregate_group_all = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_all = 0;\n\t\t\t}\n\t\t\t\n\t\t\t/////////////////////////////////////////////////\n\t\t\t//getting 1094c 24-35 A values (preparing array)\n\t\t\t\n\t\t\t// jan value\n\t\t\tif(!empty($part3->minimal_essential_coverage_jan_yes_III) && $part3->minimal_essential_coverage_jan_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_jan = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_jan_no_III) && $part3->minimal_essential_coverage_jan_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_jan = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_jan = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[0] = '<JanMinEssentialCvrOffrCd>'.$minimal_essential_coverage_jan.'</JanMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// feb value\n\t\t\tif(!empty($part3->minimal_essential_coverage_feb_yes_III) && $part3->minimal_essential_coverage_feb_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_feb = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_feb_no_III) && $part3->minimal_essential_coverage_feb_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_feb = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_feb = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[1] = '<FebMinEssentialCvrOffrCd>'.$minimal_essential_coverage_feb.'</FebMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// mar value\n\t\t\tif(!empty($part3->minimal_essential_coverage_mar_yes_III) && $part3->minimal_essential_coverage_mar_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_mar = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_feb_no_III) && $part3->minimal_essential_coverage_feb_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_mar = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_mar = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[2] = '<MarMinEssentialCvrOffrCd>'.$minimal_essential_coverage_mar.'</MarMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// apr value\n\t\t\tif(!empty($part3->minimal_essential_coverage_apr_yes_III) && $part3->minimal_essential_coverage_apr_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_apr = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_apr_no_III) && $part3->minimal_essential_coverage_apr_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_apr = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_apr = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[3] = '<AprMinEssentialCvrOffrCd>'.$minimal_essential_coverage_apr.'</AprMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// may value\n\t\t\tif(!empty($part3->minimal_essential_coverage_may_yes_III) && $part3->minimal_essential_coverage_may_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_may = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_may_no_III) && $part3->minimal_essential_coverage_may_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_may = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_may = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[4] = '<MayMinEssentialCvrOffrCd>'.$minimal_essential_coverage_may.'</MayMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// jun value\n\t\t\tif(!empty($part3->minimal_essential_coverage_june_yes_III) && $part3->minimal_essential_coverage_june_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_june = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_june_no_III) && $part3->minimal_essential_coverage_june_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_june = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_june = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[5] = '<JunMinEssentialCvrOffrCd>'.$minimal_essential_coverage_june.'</JunMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// jul value\n\t\t\tif(!empty($part3->minimal_essential_coverage_july_yes_III) && $part3->minimal_essential_coverage_july_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_july = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_july_no_III) && $part3->minimal_essential_coverage_july_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_july = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_july = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[6] = '<JulMinEssentialCvrOffrCd>'.$minimal_essential_coverage_july.'</JulMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// aug value\n\t\t\tif(!empty($part3->minimal_essential_coverage_aug_yes_III) && $part3->minimal_essential_coverage_aug_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_aug = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_aug_no_III) && $part3->minimal_essential_coverage_aug_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_aug = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_aug = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[7] = '<AugMinEssentialCvrOffrCd>'.$minimal_essential_coverage_aug.'</AugMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// sep value\n\t\t\tif(!empty($part3->minimal_essential_coverage_sept_yes_III) && $part3->minimal_essential_coverage_sept_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_sept = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_sept_no_III) && $part3->minimal_essential_coverage_sept_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_sept = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_sept = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[8] = '<SepMinEssentialCvrOffrCd>'.$minimal_essential_coverage_sept.'</SepMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// oct value\n\t\t\tif(!empty($part3->minimal_essential_coverage_oct_yes_III) && $part3->minimal_essential_coverage_oct_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_oct = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_oct_no_III) && $part3->minimal_essential_coverage_oct_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_oct = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_oct = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[9] = '<OctMinEssentialCvrOffrCd>'.$minimal_essential_coverage_oct.'</OctMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// nov value\n\t\t\tif(!empty($part3->minimal_essential_coverage_nov_yes_III) && $part3->minimal_essential_coverage_nov_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_nov = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_nov_no_III) && $part3->minimal_essential_coverage_nov_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_nov = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_nov = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[10] = '<NovMinEssentialCvrOffrCd>'.$minimal_essential_coverage_nov.'</NovMinEssentialCvrOffrCd>';\n\t\t\t\n\t\t\t// dec value\n\t\t\tif(!empty($part3->minimal_essential_coverage_dec_yes_III) && $part3->minimal_essential_coverage_dec_yes_III== 1){\n\t\t\t\t$minimal_essential_coverage_dec = 1;\n\t\t\t}\n\t\t\telse if(!empty($part3->minimal_essential_coverage_dec_no_III) && $part3->minimal_essential_coverage_dec_no_III== 1){\n\t\t\t\t$minimal_essential_coverage_dec = 2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$minimal_essential_coverage_dec = 0;\n\t\t\t}\n\t\t\t$arr_minimal_essential_coverage[11] = '<DecMinEssentialCvrOffrCd>'.$minimal_essential_coverage_dec.'</DecMinEssentialCvrOffrCd>';\n\t\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\n\t\t\t\n\t\t\t/////////////////////////////////////////////////\n\t\t\t//getting 1094c 24-35 C values (preparing array)\n\t\t\t\n\t\t\t// jan value\n\t\t\tif(isset($part3->total_employee_count_jan_III)){\n\t\t\t\t$total_employee_count_jan = $part3->total_employee_count_jan_III;\n\t\t\t\tif(!empty($total_employee_count_jan)){\n\t\t\t\t$arr_total_employee_count[0] = '<JanALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_jan.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</JanALEMonthlyInfoGrp>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[0] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// feb value\n\t\t\tif(isset($part3->total_employee_count_feb_III)){\n\t\t\t\t$total_employee_count_feb = $part3->total_employee_count_feb_III;\n\t\t\t\tif(!empty($total_employee_count_feb)){\n\t\t\t\t$arr_total_employee_count[1] = '<FebALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_feb.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</FebALEMonthlyInfoGrp>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[1] = '';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// mar value\n\t\t\tif(isset($part3->total_employee_count_mar_III)){\n\t\t\t\t$total_employee_count_mar = $part3->total_employee_count_mar_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_mar)){\n\t\t\t\t$arr_total_employee_count[2] = '<MarALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_mar.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</MarALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[2] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// apr value\n\t\t\tif(isset($part3->total_employee_count_apr_III)){\n\t\t\t\t$total_employee_count_apr = $part3->total_employee_count_apr_III;\n\t\t\t\tif(!empty($total_employee_count_apr)){\n\t\t\t\t$arr_total_employee_count[3] = '<AprALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_apr.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</AprALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[3] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// may value\n\t\t\tif(isset($part3->total_employee_count_may_III)){\n\t\t\t\t$total_employee_count_may = $part3->total_employee_count_may_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_may)){\n\t\t\t\t$arr_total_employee_count[4] = '<MayALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_may.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</MayALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[4] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// jun value\n\t\t\tif(isset($part3->total_employee_count_jun_III)){\n\t\t\t\t$total_employee_count_jun = $part3->total_employee_count_june_III;\n\t\t\t\tif(!empty($total_employee_count_jun)){\n\t\t\t\t$arr_total_employee_count[5] = '<JunALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_jun.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</JunALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[5] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// jul value\n\t\t\tif(isset($part3->total_employee_count_jul_III)){\n\t\t\t\t$total_employee_count_jul = $part3->total_employee_count_july_III;\n\t\t\t\tif(!empty($total_employee_count_jul)){\n\t\t\t\t$arr_total_employee_count[6] = '<JulALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_jul.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</JulALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[6] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// aug value\n\t\t\tif(isset($part3->total_employee_count_aug_III)){\n\t\t\t\t$total_employee_count_aug = $part3->total_employee_count_aug_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_aug)){\n\t\t\t\t$arr_total_employee_count[7] = '<AugALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_aug.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</AugALEMonthlyInfoGrp>';\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[7] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// sep value\n\t\t\tif(isset($part3->total_employee_count_sept_III)){\n\t\t\t\t$total_employee_count_sep = $part3->total_employee_count_sept_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_sep)){\n\t\t\t\t$arr_total_employee_count[8] = '<SeptALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_sep.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</SeptALEMonthlyInfoGrp>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[8] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// oct value\n\t\t\tif(isset($part3->total_employee_count_oct_III)){\n\t\t\t\t$total_employee_count_oct = $part3->total_employee_count_oct_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_oct)){\n\t\t\t\t$arr_total_employee_count[9] = '<OctALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_oct.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</OctALEMonthlyInfoGrp>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[9] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// nov value\n\t\t\tif(isset($part3->total_employee_count_nov_III)){\n\t\t\t\t$total_employee_count_nov = $part3->total_employee_count_nov_III;\n\t\t\t\t\n\t\t\t\tif(!empty($total_employee_count_nov)){\n\t\t\t\t$arr_total_employee_count[10] = '<NovALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_nov.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</NovALEMonthlyInfoGrp>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[10] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// dec value\n\t\t\tif(isset($part3->total_employee_count_dec_III)){\n\t\t\t\t$total_employee_count_dec = $part3->total_employee_count_dec_III;\n\t\t\t\tif(!empty($total_employee_count_dec)){\n\t\t\t\t$arr_total_employee_count[11] = '<DecALEMonthlyInfoGrp>\n\t\t\t\t\t\t\t\t\t\t\t\t<TotalEmployeeCnt>'.$total_employee_count_dec.'</TotalEmployeeCnt>\n\t\t\t\t\t\t\t\t\t\t\t</DecALEMonthlyInfoGrp>';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t$arr_total_employee_count[10] = '';\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\n\t\t\t/////////////////////////////////////////////////\n\t\t\t//getting 1094c 24-35 D values (preparing array)\n\t\t\t\n\t\t\t// jan value\n\t\t\tif(!empty($part3->aggregate_group_jan_III)){\n\t\t\t\t$aggregate_group_jan = $part3->aggregate_group_jan_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_jan = 0;\n\t\t\t}\n\t\t\t$arr_aggrigated_grp_indicator[0] = '<JanAggregatedGroupInd>'.$aggregate_group_jan.'</JanAggregatedGroupInd>';\n\t\t\t\n\t\t\t// feb value\n\t\t\tif(!empty($part3->aggregate_group_feb_III)){\n\t\t\t\t$aggregate_group_feb = $part3->aggregate_group_feb_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_feb = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[1] = '<FebAggregatedGroupInd>'.$aggregate_group_feb.'</FebAggregatedGroupInd>';\n\t\t\t\n\t\t\t// mar value\n\t\t\tif(!empty($part3->aggregate_group_mar_III)){\n\t\t\t\t$aggregate_group_mar = $part3->aggregate_group_mar_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_mar = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[2] = '<MarAggregatedGroupInd>'.$aggregate_group_mar.'</MarAggregatedGroupInd>';\n\t\t\t\n\t\t\t// apr value\n\t\t\tif(!empty($part3->aggregate_group_apr_III)){\n\t\t\t\t$aggregate_group_apr = $part3->aggregate_group_apr_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_apr = 0;\n\t\t\t}\n\t\t\t$arr_aggrigated_grp_indicator[3] = '<AprAggregatedGroupInd>'.$aggregate_group_apr.'</AprAggregatedGroupInd>';\n\t\t\t\n\t\t\t// may value\n\t\t\tif(!empty($part3->aggregate_group_may_III)){\n\t\t\t\t$aggregate_group_may = $part3->aggregate_group_may_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_may = 0;\n\t\t\t}\n\t\t\t$arr_aggrigated_grp_indicator[4] = '<MayAggregatedGroupInd>'.$aggregate_group_may.'</MayAggregatedGroupInd>';\n\t\t\t\n\t\t\t// jun value\n\t\t\tif(!empty($part3->aggregate_group_jun_III)){\n\t\t\t\t$aggregate_group_jun = $part3->aggregate_group_jun_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_jun = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[5] = '<JunAggregatedGroupInd>'.$aggregate_group_jun.'</JunAggregatedGroupInd>';\n\t\t\t\n\t\t\t// jul value\n\t\t\tif(!empty($part3->aggregate_group_jul_III)){\n\t\t\t\t$aggregate_group_jul = $part3->aggregate_group_jul_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_jul = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[6] = '<JulAggregatedGroupInd>'.$aggregate_group_jul.'</JulAggregatedGroupInd>';\n\t\t\t\n\t\t\t// aug value\n\t\t\tif(!empty($part3->aggregate_group_aug_III)){\n\t\t\t\t$aggregate_group_aug = $part3->aggregate_group_aug_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_aug = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[7] = '<AugAggregatedGroupInd>'.$aggregate_group_aug.'</AugAggregatedGroupInd>';\n\t\t\t\n\t\t\t// sep value\n\t\t\tif(!empty($part3->aggregate_group_sep_III)){\n\t\t\t\t$aggregate_group_sep = $part3->aggregate_group_sep_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_sep = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[8] = '<SepAggregatedGroupInd>'.$aggregate_group_sep.'</SepAggregatedGroupInd>';\t\t\t\n\t\t\t\n\t\t\t// oct value\n\t\t\tif(!empty($part3->aggregate_group_oct_III)){\n\t\t\t\t$aggregate_group_oct = $part3->aggregate_group_oct_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_oct = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[9] = '<OctAggregatedGroupInd>'.$aggregate_group_oct.'</OctAggregatedGroupInd>';\n\t\t\t\n\t\t\t// nov value\n\t\t\tif(!empty($part3->aggregate_group_nov_III)){\n\t\t\t\t$aggregate_group_nov = $part3->aggregate_group_nov_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_nov = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[10] = '<NovAggregatedGroupInd>'.$aggregate_group_nov.'</NovAggregatedGroupInd>';\n\t\t\t\n\t\t\t// dec value\n\t\t\tif(!empty($part3->aggregate_group_dec_III)){\n\t\t\t\t$aggregate_group_dec = $part3->aggregate_group_dec_III;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$aggregate_group_dec = 0;\n\t\t\t}\t\t\t\n\t\t\t$arr_aggrigated_grp_indicator[11] = '<DecAggregatedGroupInd>'.$aggregate_group_dec.'</DecAggregatedGroupInd>';\t\t\t\n\t\t\t\n\t\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\n\t\t\t/////////////////////////////////////////////////\n\t\t\t//getting 1094c 24-35 E values (preparing array)\n\t\t\t\n\t\t\t// jan value\n\t\t\tif(!empty($part3->section_4980h_transition_jan_III)){\n\t\t\t\t$section_4980h_transition_jan = $part3->section_4980h_transition_jan_III;\n\t\t\t\t$arr_section_4980h_transition[0] = '<JanALESect4980HTrnstReliefCd>'.$section_4980h_transition_jan.'</JanALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// feb value\n\t\t\tif(!empty($part3->section_4980h_transition_feb_III)){\n\t\t\t\t$section_4980h_transition_feb = $part3->section_4980h_transition_feb_III;\n\t\t\t\t$arr_section_4980h_transition[1] = '<FebALESect4980HTrnstReliefCd>'.$section_4980h_transition_feb.'</FebALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// mar value\n\t\t\tif(!empty($part3->section_4980h_transition_mar_III)){\n\t\t\t\t$section_4980h_transition_mar = $part3->section_4980h_transition_mar_III;\n\t\t\t\t$arr_section_4980h_transition[2] = '<MarALESect4980HTrnstReliefCd>'.$section_4980h_transition_mar.'</MarALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// apr value\n\t\t\tif(!empty($part3->section_4980h_transition_apr_III)){\n\t\t\t\t$section_4980h_transition_apr = $part3->section_4980h_transition_apr_III;\n\t\t\t\t$arr_section_4980h_transition[3] = '<AprALESect4980HTrnstReliefCd>'.$section_4980h_transition_apr.'</AprALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// may value\n\t\t\tif(!empty($part3->section_4980h_transition_may_III)){\n\t\t\t\t$section_4980h_transition_may = $part3->section_4980h_transition_may_III;\n\t\t\t\t$arr_section_4980h_transition[4] = '<MayALESect4980HTrnstReliefCd>'.$section_4980h_transition_may.'</MayALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// jun value\n\t\t\tif(!empty($part3->section_4980h_transition_jun_III)){\n\t\t\t\t$section_4980h_transition_jun = $part3->section_4980h_transition_jun_III;\n\t\t\t\t$arr_section_4980h_transition[5] = '<JunALESect4980HTrnstReliefCd>'.$section_4980h_transition_jun.'</JunALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// jul value\n\t\t\tif(!empty($part3->section_4980h_transition_jul_III)){\n\t\t\t\t$section_4980h_transition_jul = $part3->section_4980h_transition_jul_III;\n\t\t\t\t$arr_section_4980h_transition[6] = '<JulALESect4980HTrnstReliefCd>'.$section_4980h_transition_jul.'</JulALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// aug value\n\t\t\tif(!empty($part3->section_4980h_transition_aug_III)){\n\t\t\t\t$section_4980h_transition_aug = $part3->section_4980h_transition_aug_III;\n\t\t\t\t$arr_section_4980h_transition[7] = '<AugALESect4980HTrnstReliefCd>'.$section_4980h_transition_aug.'</AugALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// sep value\n\t\t\tif(!empty($part3->section_4980h_transition_sep_III)){\n\t\t\t\t$section_4980h_transition_sep = $part3->section_4980h_transition_sep_III;\n\t\t\t\t$arr_section_4980h_transition[8] = '<SepALESect4980HTrnstReliefCd>'.$section_4980h_transition_sep.'</SepALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// oct value\n\t\t\tif(!empty($part3->section_4980h_transition_oct_III)){\n\t\t\t\t$section_4980h_transition_oct = $part3->section_4980h_transition_oct_III;\n\t\t\t\t$arr_section_4980h_transition[9] = '<OctALESect4980HTrnstReliefCd>'.$section_4980h_transition_oct.'</OctALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// nov value\n\t\t\tif(!empty($part3->section_4980h_transition_nov_III)){\n\t\t\t\t$section_4980h_transition_nov = $part3->section_4980h_transition_nov_III;\n\t\t\t\t$arr_section_4980h_transition[10] = '<NovALESect4980HTrnstReliefCd>'.$section_4980h_transition_nov.'</NovALESect4980HTrnstReliefCd>';\n\t\t\t}\n\t\t\t\n\t\t\t// dec value\n\t\t\tif(!empty($part3->section_4980h_transition_dec_III)){\n\t\t\t\t$section_4980h_transition_dec = $part3->section_4980h_transition_dec_III;\n\t\t\t\t$arr_section_4980h_transition[11] = '<DecALESect4980HTrnstReliefCd>'.$section_4980h_transition_dec.'</DecALESect4980HTrnstReliefCd>';\n\t\t\t}\t\t\t\n\t\t\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t\n\t\t\t//preparing array of other ALE members of aggrigated ALE Group\n\t\t\tfor($i=36;$i<=65;$i++){\n\t\t\t\t$val = 'name_IV_'.$i;\n\t\t\t\t$ein_val = 'ein_IV_'.$i;\n\t\t\t\tif(!empty($part4->$val) || !empty($part4->$ein_val)){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$other_ale_member .= '<OtherALEMembersGrp>';\n\t\t\t\t\t\t\t\t\t\tif(!empty($part4->$val)){\n\t\t\t\t\t$other_ale_member .=\t'<BusinessName>\n\t\t\t\t\t\t\t\t\t\t\t\t<BusinessNameLine1Txt>'.$part4->$val.'</BusinessNameLine1Txt>\n\t\t\t\t\t\t\t\t\t\t\t</BusinessName>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t$other_ale_member .=\t'<irs:TINRequestTypeCd>BUSINESS_TIN</irs:TINRequestTypeCd>';\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(!empty($part4->$ein_val) && preg_replace ( '/[^0-9]/s', '', $part4->$ein_val )!= ''){\n\t\t\t\t\t$other_ale_member .= \t'<irs:EIN>'.preg_replace ( '/[^0-9]/s', '', $part4->$ein_val ).'</irs:EIN>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t$other_ale_member .= '</OtherALEMembersGrp>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/////// getting total 1095 records count\n\t\t\t$total_1095_count = TblAca1095::find()->where(['form_id'=>$form_id])->count();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//assigning all values into an array\n\t\t\t//array is for \n\t\t\t$params_array = array(\n\t\t\t\t'form_id'=>$form_id,\n\t\t\t\t'clean_ein'=>$clean_ein,\n\t\t\t\t'reporting_year'=>$reporting_year,\n\t\t\t\t'employer_name'=>$employer_name,\n\t\t\t\t'addressone'=>$addressone,\n\t\t\t\t'addresstwo'=>$addresstwo,\n\t\t\t\t'city'=>$city,\n\t\t\t\t'state'=>$state,\n\t\t\t\t'zip'=>$zip,\n\t\t\t\t'contact_first_name'=>$contact_first_name,\n\t\t\t\t'contact_middle_name'=>$contact_middle_name,\n\t\t\t\t'contact_last_name'=>$contact_last_name,\n\t\t\t\t'contact_suffix'=>$contact_suffix,\n\t\t\t\t'contact_phone'=>$clean_phone,\n\t\t\t\t'govt_entity_name'=>$govt_entity_name,\n\t\t\t\t'employer_ein'=>$employer_ein,\n\t\t\t\t'address_line_one'=>$address_line_one,\n\t\t\t\t'address_line_two'=>$address_line_two,\n\t\t\t\t'city_or_town_2_I'=>$city_or_town_2_I,\n\t\t\t\t'state_or_province_2_I'=>$state_or_province_2_I,\n\t\t\t\t'country_and_zip_2_I'=>$country_and_zip_2_I,\n\t\t\t\t'first_name_of_person_to_contact_2_I'=>$first_name_of_person_to_contact_2_I,\n\t\t\t\t'middle_name_of_person_to_contact_2_I'=>$middle_name_of_person_to_contact_2_I,\n\t\t\t\t'last_name_of_person_to_contact_2_I'=>$last_name_of_person_to_contact_2_I,\n\t\t\t\t'suffix_name_of_person_to_contact_2_I'=>$suffix_name_of_person_to_contact_2_I,\n\t\t\t\t'contact_telephone_number_2_I'=>$contact_telephone_number_2_I,\n\t\t\t\t'total_no_records_submitted'=>$total_no_records_submitted,\n\t\t\t\t'total_no_of_1095c_filled_II'=>$total_no_of_1095c_filled_II,\n\t\t\t\t'ale_member_check'=>$ale_member_check,\n\t\t\t\t'quality_offer_method'=>$quality_offer_method,\n\t\t\t\t'section_4980_transition'=>$section_4980_transition,\n\t\t\t\t'offer_method'=>$offer_method,\n\t\t\t\t'minimal_essential_coverage'=>$minimal_essential_coverage,\n\t\t\t\t'full_time_employee_count'=>$full_time_employee_count,\n\t\t\t\t'total_employee_count_for_ale_member'=>$total_employee_count_for_ale_member,\n\t\t\t\t'aggregate_group_all'=>$aggregate_group_all,\n\t\t\t\t'arr_minimal_essential_coverage'=>$arr_minimal_essential_coverage,\n\t\t\t\t'arr_total_employee_count'=>$arr_total_employee_count,\n\t\t\t\t'arr_aggrigated_grp_indicator'=>$arr_aggrigated_grp_indicator,\n\t\t\t\t'arr_section_4980h_transition'=>$arr_section_4980h_transition,\n\t\t\t\t'other_ale_member'=>$other_ale_member,\n\t\t\t\t'total_1095_count'=>$total_1095_count,\n\t\t\t\t'time'=>$time\n\t\t\t);\n\t\t\t\n\t\t\t// calling create data xml function\t\t\t\n\t\t\t$create_data_xml = $this->createdataxml($params_array,$company_client_number);\n\t\t\t\n\t\t\t// calling create manifest xml function\t\t\t\n\t\t\tif($create_data_xml == 'success'){\n\t\t\t\t$create_xml = $this->createmanifestxml($params_array,$company_client_number);\n\t\t\t\t\n\t\t\t\t// creating zip files\n\t\t\t\tif($create_xml == 'success'){\n\t\t\t\t\t$result = \\Yii::$app->Sharefile->zipaDirectory ( getcwd () . '/files/xml/'.$company_client_number. '/', getcwd () . '/files/xml/' . $company_client_number . '.zip' );\n\t\t\t\t\tif ($result == 'success') {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * ** removing files & folders from server **\n\t\t\t\t\t\t*/\n\t\t\t\t\t\texec ( 'rm -R ' . getcwd () . '/files/xml/'.$company_client_number );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$imgData = file_get_contents(getcwd () . '/files/xml/'.$company_client_number. '.zip');\n\t\t\t\t\t\t\n\t\t\t\t\t\t/// update in table\n\t\t\t\t\t\t$sql = \"UPDATE tbl_aca_forms SET xml_file='\".addslashes($imgData).\"' WHERE id=$form_id\";\n\n\t\t\t\t\t\tYii::$app->db->createCommand($sql)->execute();\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * ** removing files **\n\t\t\t\t\t\t*/\n\t\t\t\t\t\texec ( 'rm ' . getcwd () . '/files/xml/'.$company_client_number .'.zip' );\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t}\n\t\t\n\t\t} catch ( \\Exception $e ) { // catching the exception\n\t\t\t\t\n\t\t\t$msg = $e->getMessage ().' at line no '.$e->getLine();\n\t\t\t\n\t\t\t$arrerror ['error_desc'] = $msg;\n\t\t\t$arrerror ['error_type'] = 5;\n\n\t\t\tif(!empty($company_id)){\n\t\t\t\t$arrerror ['company_id'] = $company_id;\n\t\t\t}\n\t\t\t\t\n\t\t\t// Below function saves exceptions if occurs\n\t\t\t$this->Saveerrors ( $arrerror );\n\t\t}\n\t}",
"public function toXML();",
"public function process()\n {\n $this->writer = $writer = new \\XMLWriter();\n $writer->openMemory();\n $writer->setIndent(true);\n $writer->startDocument('1.0', 'UTF-8');\n \n $writer->startElement('export');\n \n $writer->writeAttribute('name','S5Games');\n \n $this->processPersons($this->conn,$writer);\n \n $writer->endElement(); // Export\n\n $writer->endDocument();\n //echo $writer->outputMemory(true); \n \n return $writer;\n }",
"abstract public function toXML();",
"public function createXML() {\r\n\t\t$tw = new TMXWriter($this->_xmlFile);\r\n\t\t$tc = $this->_scan($this->_directory);\r\n\r\n\t\t$tw->createTranslations($tc);\r\n\t}",
"function createXFDF($file,$info,$enc='UTF-8'){ \n $data = '<?xml version=\"1.0\" encoding=\"'.$enc.'\"?>'.\"\\n\";\n $data .= '<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">'.\"\\n\"; \n $data .= '<fields>'.\"\\n\"; \n foreach($info as $field => $val){ \n $data.='<field name=\"'.$field.'\">'.\"\\n\"; \n if(is_array($val)){ \n foreach($val as $opt) \n $data.='<value>'.$opt.'</value>'.\"\\n\"; \n }else{ \n $data.='<value>'.$val.'</value>'.\"\\n\"; \n } \n $data.='</field>'.\"\\n\"; \n } \n $data .= '</fields>'.\"\\n\";\n $data .= '<ids original=\"'.md5($file).'\" modified=\"'.time().'\" />'.\"\\n\";\n $data .= '<f href=\"'.$file.'\" />'.\"\\n\";\n $data .= '</xfdf>'.\"\\n\"; \n return $data; \n}",
"function contact_to_xml($contact, $study=null, $has_events=true, $app=false) {\n\t\n\t$xml = new XMLWriter();\n\t\n\t$xml->openMemory();\n\t$xml->startDocument('1.0', 'UTF-8');\n\t$xml->setIndent(true);\n\t$xml->startElement(\"pdo:patient_data\");\n\t\n\tadd_attributes($xml, \n\t\tarray(\n\t\t\t\"xmlns:pdo\"=>PDO_STRING\n\t\t)\n\t);\n\t\n\tif ($has_events) {\n\t\t$event_id = $contact['brisskit_id'].\"_\".date(DATE_ATOM);\n\t\t_add_event_set($contact, $xml,$event_id);\n\t\t_add_pid_set($contact, $xml);\n\t\t_add_eid_set($contact, $xml,$event_id);\n\t}\n\t_add_patient_set($contact, $xml,$study, $app);\n\t$xml->endElement();\n\t$content = $xml->outputMemory();\n\treturn $content;\n}",
"public function save() {\n while ($this->number == 0) {\n // pick random 3 digit #\n $test = rand(100,999);\n // use this if the file doesn't exist\n if (!file_exists('../data/order'.$test.'.xml'))\n $this->number = $test;\n }\n // and establish the checkout time\n $this->datetime = date(DATE_ATOM);\n\n // start empty\n $xml = new SimpleXMLElement('<order/>');\n // add the main properties\n $xml->addChild('number',$this->number);\n $xml->addChild('datetime',$this->datetime);\n foreach ($this->items as $key => $value) {\n $lineitem = $xml->addChild('item');\n $lineitem->addChild('code',$key);\n $lineitem->addChild('quantity',$value);\n }\n\n // save it\n $xml->asXML('../data/order' . $this->number . '.xml');\n }",
"function makeXMLfile($conn){ \n\t\t\n\t\t$id = ''; //clean id if this script is run more than once\n $DBdata = runSQL($conn); //run SQL\n $xml = new SimpleXMLElement('<players/>'); //new SimpleXMLElement\n\t\t\n\t\t//engine - go through the database\n while($row = mysqli_fetch_array($DBdata)){\n\t\t\t\n\t\t\t//time to create new player\n if($id != $row[\"idChampions\"] ){ \n \n\t\t\t //add child \"player\"\n $playerChild = $xml->addChild('player'); \n\t\t\t\t\t$name = $playerChild->addChild(\n\t\t\t\t\t\t'playerName',$row[\"playerName\"]\t\t\t\t\t\t\t\t\t//player name\n\t\t\t\t\t);\t\n\t\t\t\t\t$name->addAttribute(\n\t\t\t\t\t\t'wikiLink',$row[\"playerLink\"]\t\t\t\t\t\t\t\t\t//player link\n\t\t\t\t\t); \t \t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//add child \"dates\"\n\t\t\t\t\t$dates = $playerChild->addChild('championYears'); \n\t\t\t\t\t\t$dates->addChild(\n\t\t\t\t\t\t\t'firstYears',$row[\"firstYear\"]\t\t\t\t\t\t\t\t// there is always first year\n\t\t\t\t\t\t); \t\t\t\t\n\t\t\t\t\t\tif(!empty($secondYear)){ \t\t\t\t\t\t\t\t\t\t//check for a second date\n\t\t\t\t\t\t$dates->addChild(\n\t\t\t\t\t\t\t'secondYears',$row[\"secondYear\"]\t\t\t\t\t\t\t\t//add second year if not empty\n\t\t\t\t\t\t); \t\t\t\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif(!empty($thirdYear)){ \t\t\t\t\t\t\t\t\t\t//check for a third year\n\t\t\t\t\t\t\t$dates->addChild(\n\t\t\t\t\t\t\t\t'thirdYears',$row[\"thirdYear\"]\t\t\t\t\t\t\t//add third year if not empty\n\t\t\t\t\t\t\t); \t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t//add child \"countries\"\n\t\t\t\t\t$country = $playerChild->addChild('countries'); \t\t\t\t\t\t//there is always at least one country\n\t\t\t\t\t\t$countryName = $country->addChild(\n\t\t\t\t\t\t\t'country',$row[\"countryName\"]\t\t\t\t\t\t\t\t\t//create country name $row[\"countryName\"]\n\t\t\t\t\t\t);\t\n\t\t\t\t\t\t$countryName->addAttribute(\n\t\t\t\t\t\t\t'wikiLink',$row[\"countryLink\"]\t\t\t\t\t\t\t\t\t//add country URL attribute\n\t\t\t\t\t\t);\t\t\t \n\t\t\t\t\t\t$countryName->addAttribute(\n\t\t\t\t\t\t\t'flag',$row[\"countryFlag\"]\t\t\t\t\t\t\t\t\t\t//add country flag attribute\n\t\t\t\t\t\t);\t\t\t\t\n }\n\t\t\telse //if there is more than one country - stay within current element and add more countries\n\t\t\t\t{ \n\t\t\t\t\n\t\t\t\tif (empty($countryFlag)) {\t\t\t\t\t\t\t\t\t\t\t\t//check if there is a flag for the country \n\t\t\t\t\t$countryName = $country->addChild(\n\t\t\t\t\t\t'country',$row[\"countryName\"]\t\t\t\t\t\t\t\t\t//create country name\n\t\t\t\t\t);\t \n $countryName->addAttribute(\n\t\t\t\t\t\t'wikiLink',$row[\"countryLink\"]\t\t\t\t\t\t\t\t\t//add country URL attribute\n\t\t\t\t\t); \t\t\n }\n\t\t\t\telse{ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if there is a flag for country\n $countryName = $country->addChild(\n\t\t\t\t\t\t'country',$row[\"countryName\"]\t\t\t\t\t\t\t\t\t//create country name\n\t\t\t\t\t); \t\n $countryName->addAttribute(\n\t\t\t\t\t\t'wikiLink',$row[\"countryLink\"]\t\t\t\t\t\t\t\t\t//add country URL attribute\n\t\t\t\t\t); \t\t\n $countryName->addAttribute(\n\t\t\t\t\t\t'flag',$row[\"countryFlag\"]\t\t\t\t\t\t\t\t\t\t//add country flag attribute\n\t\t\t\t\t); \t\t\t\n }\n }\n $id = $row[\"idChampions\"] ; //change player id\n } \n $xml = $xml->asXML(); \n return $xml; // end the function\n }",
"public function write()\n\t{\n\t\t// load template array, fill data and convert to XML\n\t\t$this->_init()->_addCustomer()->_addItens()->_addOtherInfo()->_toXML();\n\t\t$io = new Varien_Io_File();\n\t\t$io->setAllowCreateFolders(true);\n\t\t$io->createDestinationDir($this->_path);\n\n\t\t$return = $io->write($this->_path . $this->_getFileName(), $this->_stringFinalXML);\n\n\t\treturn true;\n\t}",
"function GenerateXML($obj)\n\t{\t\t\t\n\t\t$sqlXML=\"CALL USP_ADMIN_GLINK('V','0','','0','0','0',@P_OUT);\";\n\t\t$XMLResult=$obj->ExecuteQuery($sqlXML);\n\t\t\tif($XMLResult)\n\t\t\t{\n\t\t\t\t$file= fopen(\"../xml/GLink.xml\", \"w\");\n\t\t\t\t$strXMLData=\"<?xml version='1.0' encoding='UTF-8' ?>\\n\";\n\t\t\t\t$strXMLData.=\"<GLMaster>\\n\";\n\t\t\t\t\twhile($rows=mysqli_fetch_array($XMLResult))\n\t\t\t\t\t{\n\t\t\t\t\t\t$strXMLData.=\"\\t<GLink>\\n\";\t\t\n\t\t\t\t\t\t$strXMLData.=\"\\t\\t<GLID>\".$rows['INT_GL'].\"</GLID>\\n\";\n\t\t\t\t\t\t$strXMLData.=\"\\t\\t<GLName>\".$rows['VCH_GL_NAME'].\"</GLName>\\n\";\n\t\t\t\t\t\t$strXMLData.=\"\\t\\t<SlNo>\".$rows['INT_SL_NO'].\"</SlNo>\\n\";\n\t\t\t\t\t\t$strXMLData.=\"\\t\\t<Status>\".$rows['INT_STATUS'].\"</Status>\\n\";\n\t\t\t\t\t\t$strXMLData.=\"\\t</GLink>\\n\";\n\t\t\t\t\t}\n\t\t\t\t$strXMLData.=\"</GLMaster>\";\n\t\t\t\tfwrite($file, $strXMLData);\n\t\t\t\tfclose($file);\n\t\t\t}\n\t}",
"function add_book ($xmlDoc,$subNode,$nameInput,$pagesInput,$authorInput){\n\n $book=$xmlDoc->createElement('book');\n $subNode->appendChild($book);\n \n $name =$xmlDoc->createElement('name',$nameInput);\n $book->appendChild($name);\n \n $pages=$xmlDoc->createElement('pages',$pagesInput);\n $book->appendChild($pages);\n \n $author =$xmlDoc->createElement('auther',$authorInput);\n $book->appendChild($author);\n \n}",
"public function generate() {\n\t\t// generate xml\n\t\t$this->xml();\n\n\t\t// generate csv\n//\t\t$this->csv();\n\t}",
"public function apiXmlWriter() {\n\t\t$this->openMemory();\n\t\t$this->setIndent(true);\n\t\t$this->setIndentString(self::XML_INDENT);\n\t\t$this->startDocument(self::XML_VERSION, self::XML_FORMAT);\n\t}",
"public function createXML() {\n\n $this->_orderData = new SimpleXMLElement(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><Order></Order>\");\n $this->_consumerNode = $this->_orderData->addChild('Consumer');\n $this->_addressesNode = $this->_orderData->addChild('Addresses');\n $this->_productsNode = $this->_orderData->addChild('Products');\n\n // Set Consumer\n $this->array_to_xml($this->_data['consumer'], $this->_consumerNode);\n\n // Set Addresses\n $shippingNode = $this->_addressesNode->addChild('Address');\n $shippingNode->addAttribute('id', 'shipping');\n\n $this->array_to_xml($this->_data['shippingAddress'], $shippingNode);\n\n $billingNode = $this->_addressesNode->addChild('Address');\n $billingNode->addAttribute('id', 'billing');\n\n $this->array_to_xml($this->_data['billingAddress'], $billingNode);\n\n // Set Products\n foreach ($this->_data['products'] as $product) {\n $productNode = $this->_productsNode->addChild('Product');\n $this->array_to_xml($product, $productNode);\n }\n\n if ($this->_debug == true) {\n header(\"Content-type: text/xml\");\n echo $this->_orderData->asXML();\n exit;\n }\n\n return $this->_orderData->asXML();\n }",
"public function gen(){\n $urlset = '';\n $mapindex = '';\n if(!empty($this->urls)){\n foreach ($this->urls as $url){\n $urlset.=\"<url>\";\n foreach ($url as $k => $v){\n $urlset.=\"<$k>\".$v.\"</$k>\";\n }\n $urlset.=\"</url>\".\"\\n\";\n }\n $urlset = \"\\n\".self::__URLSET_HEADER.\"\\n\".$urlset.self::__URLSET_FOOTER;\n }\n if(!empty($this->maps)){\n foreach ($this->maps as $url){\n $mapindex.=\"<sitemap>\";\n foreach ($url as $k => $v){\n $mapindex.=\"<$k>\".$v.\"</$k>\";\n }\n $mapindex.=\"</sitemap>\".\"\\n\";\n }\n $mapindex = \"\\n\".self::__MAPI_HEADER.\"\\n\".$mapindex.self::__MAPI_FOOTER;\n }\n return self::__XML_DEF.$urlset.$mapindex;\n }",
"public function aaiGenerateTenderXML($node, $tendername) {\n Global $base_url;\n $functions = AAI::getInstance();\n $lang = $functions->aaiCurrentLang();\n // getting airport location\n $tenderAirVAl = $node->field_airport[$lang][0]['tid'];\n $tenderAirArr = taxonomy_term_load($tenderAirVAl);\n $tenderAirName = $tenderAirArr->name;\n //Opening date\n $openingDate = $node->field_opening_of_tender[$lang][0]['value'];\n $openingDateformated = date('d-m-Y',strtotime($openingDate));\n $openingTimeformated = date('H:i',strtotime($openingDate));\n\n //Opening date\n $saleDate = $node->field_sale_of_tender[$lang][0]['value'];\n $saleDateformated = date('d-m-Y',strtotime($saleDate));\n $saleTimeformated = date('H:i',strtotime($saleDate));\n \n // created\n $createDate = $node->created;\n $createDateformated = format_date($createDate, 'd-m-Y');\n\n $nidpath = 'node/' . $node->nid;\n $nodeUrl = $base_url . '/' . drupal_get_path_alias($nidpath);\n\n $tender_val = $node->field_tender_estimate_cost[$lang][0]['value'];\n \n //Creating Xml to save for the new tender\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n $xml .= \"\\n <NOOFTENDER>\";\n $xml .= \"\\n\\t <TENDERS>\";\n $xml .= \"\\n\\t\\t <ORGNAME>Airports Authority of India</ORGNAME>\";\n $xml .= \"\\n\\t\\t <TENDERURL>\" . $nodeUrl . \"</TENDERURL>\";\n $xml .= \"\\n\\t\\t <ORGTYPE>5</ORGTYPE>\";\n $xml .= \"\\n\\t\\t <T_TITLE>\" . $node->title . \"</T_TITLE>\";\n $xml .= \"\\n\\t\\t <T_REF_NO>\" . $tendername . \"</T_REF_NO>\";\n $xml .= \"\\n\\t\\t <TENDER_VAL>\" . $tender_val . \"</TENDER_VAL>\";\n $xml .= \"\\n\\t\\t <LOCATION>\" . $tenderAirName . \"</LOCATION>\";\n $xml .= \"\\n\\t\\t <FIRST_A_DATE>\" . $createDateformated . \"</FIRST_A_DATE>\"; \n $xml .= \"\\n\\t\\t <LAST_COLL_DATE>\" . $saleDateformated . \"</LAST_COLL_DATE>\";\n $xml .= \"\\n\\t\\t <LAST_COLL_TIME>\" . $saleTimeformated . \"</LAST_COLL_TIME>\";\n $xml .= \"\\n\\t\\t <LAST_SUBMIT>\" . $saleDateformated . \"</LAST_SUBMIT>\";\n $xml .= \"\\n\\t\\t <LAST_SUBMIT_TIME>\" . $saleTimeformated . \"</LAST_SUBMIT_TIME>\"; \n $xml .= \"\\n\\t\\t <WORK_DESC>\" . $node->title . \"</WORK_DESC>\";\n $xml .= \"\\n\\t\\t <OPEN_DATE>\" . $openingDateformated . \"</OPEN_DATE>\";\n $xml .= \"\\n\\t\\t <OPEN_TIME>\" . $openingTimeformated . \"</OPEN_TIME>\";\n $xml .= \"\\n\\t\\t <T_TYPT>1</T_TYPT>\";\n $xml .= \"\\n\\t\\t <WORKNO>3</WORKNO>\";\n $xml .= \"\\n\\t\\t <PRODUCT_CAT>62</PRODUCT_CAT>\";\n $xml .= \"\\n\\t\\t <SUB_CAT>No Sub</SUB_CAT>\";\n $xml .= \"\\n\\t\\t <EMD>Read Document</EMD>\";\n $xml .= \"\\n\\t\\t <DOC_COST>Read Document</DOC_COST>\";\n $xml .= \"\\n\\t\\t <PRE_QUAL>For Further details see the tender document</PRE_QUAL>\";\n $xml .= \"\\n\\t\\t <SECTOR>45</SECTOR>\";\n $xml .= \"\\n\\t\\t <STATE>10</STATE>\";\n $xml .= \"\\n\\t\\t <NAME>Asim Sayeed</NAME>\";\n $xml .= \"\\n\\t\\t <E_MAIL>[email protected]</E_MAIL>\";\n $xml .= \"\\n\\t\\t <PHONE>1124642005</PHONE>\";\n $xml .= \"\\n\\t\\t <FAX>1124642005</FAX>\";\n $xml .= \"\\n\\t\\t <CITY>\" . $tenderAirName . \"</CITY>\";\n $xml .= \"\\n\\t\\t <ADDRESS>Delhi</ADDRESS>\";\n $xml .= \"\\n\\t\\t <PREBID> </PREBID>\";\n $xml .= \"\\n\\t </TENDERS>\";\n $xml .= \"\\n </NOOFTENDER>\";\n\n return $xml;\n }",
"function outputXML($time) {\n\tconnect();\n\n\t// Select all the rows in the table\n\t$query = \"SELECT map, lat, long AS lng, COUNT(macid)\n\tFROM tsp.data NATURAL JOIN tsp.coordinates\n\tWHERE timestart < $time AND (timestart + duration) > $time\n\tGROUP BY map, lat, lng;\";\n\n\t// query is executed\n\t$result = pg_query($connection, $query) or die(\"Cannot execute query: $query\\n\");\n\n\t// Create the XML file\n\theader(\"Content-type: text/xml\");\n\n\t// Start XML file, echo parent node\n\techo '<markers>';\n\t// Iterate through the rows, printing XML nodes for each\n\twhile($row = pg_fetch_assoc($result)){\n\t echo '<marker ';\n\t echo 'map=\"' . parseToXML($row['map']) . '\" ';\n\t echo 'lat=\"' .parseToXML($row['lat']) . '\" ';\n\t echo 'lng=\"' .parseToXML($row['lng']) . '\" ';\n\t echo 'count=\"' .parseToXML($row['count']) . '\" ';\n\t echo '/>';\n\t}\n\t// end XML file\n\techo '</markers>';\n}",
"private function _compileXML(){\n\t\t// array_walk_recursive($this->result, array($xml, 'addChild'));\n\t\t// return $xml->asXML();\n\t\t$string = '<?xml version=\"1.0\"?>' . \"\\r\\n\";\n\n\t\t$string .= '<friendlist>' . \"\\r\\n\";\n\n\t\tforeach ($this->result as $array) {\n\n\t\t\t$string .= \"\\t\".'<friend>' . \"\\r\\n\";\n\n\t\t\t\t$string .= \"\\t\\t\".'<'.$this->IDkey.'>' . \"\\r\\n\";\n\n\t\t\t\t\t$string .= \"\\t\\t\\t\".$array[$this->IDkey] . \"\\r\\n\";\n\n\t\t\t\t$string .= \"\\t\\t\".'</'.$this->IDkey.'>' . \"\\r\\n\";\n\n\t\t\t\t$string .= \"\\t\\t\".'<'.$this->Nicknamekey.'>' . \"\\r\\n\";\n\n\t\t\t\t\t$string .= \"\\t\\t\\t\".$array[$this->Nicknamekey] . \"\\r\\n\";\n\n\t\t\t\t$string .= \"\\t\\t\".'</'.$this->Nicknamekey.'>' . \"\\r\\n\";\n\n\t\t\t$string .= \"\\t\".'</friend>' . \"\\r\\n\";\n\n\t\t}\n\n\t\t$string .= '</friendlist>';\n\n\t\treturn $string;\n\t}",
"function createChatroomXML($id, $filename) {\n $dom = new DOMDocument('1.0', 'UTF-8');\n $dom->formatOutput = true;\n \n $xmlRoot = $dom->createElement(\"Room\");\n $xmlRoot = $dom->appendChild($xmlRoot);\n $roomIdAtt = $xmlRoot->setAttribute('id', $id);\n $dom->save(\"xml/$filename\");\n}",
"function pnAddressBook_user_export() {\r\n\r\n\t// SQL Query\r\n\tlist($dbconn) = pnDBGetConn();\r\n $pntable = pnDBGetTables();\r\n\t$address_table = $pntable['pnaddressbook_address'];\r\n $address_column = &$pntable['pnaddressbook_address_column'];\r\n\r\n\t$sql = \"SELECT \" . $address_column['prefix'] .\",\r\n\t\t\t\t \" . $address_column['lname'] .\",\r\n\t\t\t\t \" . $address_column['fname'] .\",\r\n\t\t\t\t \" . $address_column['title'] .\",\r\n\t\t\t\t \" . $address_column['company'] .\",\r\n\t\t\t\t \" . $address_column['zip'] .\",\r\n\t\t\t\t \" . $address_column['city'] .\",\r\n\t\t\t\t \" . $address_column['address1'] .\",\r\n\t\t\t\t \" . $address_column['address2'] .\",\r\n\t\t\t\t \" . $address_column['state'] .\",\r\n\t\t\t\t \" . $address_column['country'] .\",\r\n\t\t\t\t \" . $address_column['contact_1'] .\",\r\n\t\t\t\t \" . $address_column['contact_2'] .\",\r\n\t\t\t\t \" . $address_column['contact_3'] .\",\r\n\t\t\t\t \" . $address_column['contact_4'] .\",\r\n\t\t\t\t \" . $address_column['contact_5'] .\",\r\n\t\t\t\t \" . $address_column['custom_1'] .\",\r\n\t\t\t\t \" . $address_column['custom_2'] .\",\r\n\t\t\t\t \" . $address_column['custom_3'] .\",\r\n\t\t\t\t \" . $address_column['custom_4'] .\",\r\n\t\t\t\t \tadr_custom_5,\r\n\t\t\t\t \tadr_custom_6,\r\n\t\t\t\t \tadr_custom_7,\r\n\t\t\t\t \tadr_custom_8,\r\n\t\t\t\t \tadr_custom_9,\r\n\t\t\t\t\tadr_custom_10,\r\n\t\t\t\t\tadr_custom_11,\r\n\t\t\t\t\tadr_custom_12,\r\n\t\t\t\t\tadr_custom_13,\r\n\t\t\t\t\tadr_custom_14,\r\n\t\t\t\t\tadr_custom_17,\r\n\t\t\t\t\tadr_custom_18,\r\n\t\t\t\t\tadr_custom_19,\r\n\t\t\t\t\tadr_custom_20,\r\n\t\t\t\t\tadr_custom_21,\r\n\t\t\t\t\tadr_custom_22,\r\n\t\t\t\t\tadr_custom_23,\r\n\r\n\t\t\t\t\tadr_custom_15,\r\n\t\t\t\t\tadr_custom_16,\r\n\r\n\t\t\t\t \" . $address_column['note'] . \",\r\n\t\t\t\t \" . $address_column['date'];\r\n\r\n\t$sql .= \" FROM \" . $address_table . \" ORDER BY \" . $address_column['lname'] . \"\";\r\n\r\n\t$result = $dbconn->Execute($sql);\r\n\r\n\tif ($dbconn->ErrorNo() != 0) {\r\n\t\tglobal $bgcolor1,$bgcolor2,$bgcolor3,$bgcolor4;\r\n\t\r\n\t\t$output = new pnHTML();\r\n\t\t$output->SetInputMode(_PNH_VERBATIMINPUT);\r\n\t\t$output->Text(pnAddressBook_themetable('start'));\r\n \t$output->Text('ERROR ' . $dbconn->ErrorNo() . \"<br>\" . $sql);\r\n\t\t$output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n// List Header\r\n\t$address_export = '\"Prefix\",\"First Name\",\"Last Name\",\"Title\",\"Company\",\"Address 1\",\"Address 2\",\"City\",\"State\",\"Zipcode\",\"Country\",';\r\n\t$address_export .= '\"Contact 1\",\"Contact 2\",\"Contact 3\",\"Contact 4\",\"Contact 5\",';\r\n//geh Custom fields\r\n\t$address_export .= '\"Donor\",'; \t\t\t// adr_custom_1\r\n\t$address_export .= '\"Caretaker\",'; \t\t// adr_custom_2\r\n\t$address_export .= '\"Member\",';\t\t\t// adr_custom_3\t\t\r\n\t$address_export .= '\"TNR\",'; \t\t\t// adr_custom_4\r\n\t$address_export .= '\"Volunteer\",'; \t\t// adr_custom_5\r\n\t$address_export .= '\"Foster\",';\t\t\t// adr_custom_6\r\n\t$address_export .= '\"Feeder\",';\t\t\t// adr_custom_7\r\n\t$address_export .= '\"Food Source\",';\t// adr_custom_8\r\n\t$address_export .= '\"Packet\",';\t\t\t// adr_custom_9\r\n\t$address_export .= '\"Contact Date\",';\t// adr_custom_10\r\n\t$address_export .= '\"2002 Donations\",';\t// adr_custom_11\r\n\t$address_export .= '\"2003 Donations\",';\t// adr_custom_12\r\n\t$address_export .= '\"2004 Donations\",';\t// adr_custom_13\r\n\t$address_export .= '\"2005 Donations\",';\t// adr_custom_14\r\n\t$address_export .= '\"2006 Donations\",';\t// adr_custom_17\r\n\t$address_export .= '\"2007 Donations\",';\t// adr_custom_18\r\n\t$address_export .= '\"2008 Donations\",';\t// adr_custom_19\r\n\t$address_export .= '\"2009 Donations\",';\t// adr_custom_20\r\n\t$address_export .= '\"2010 Donations\",';\t// adr_custom_21\r\n\t$address_export .= '\"2011 Donations\",';\t// adr_custom_22\r\n\t$address_export .= '\"2012 Donations\",';\t// adr_custom_23\r\n\r\n\t$address_export .= '\"Referred By\",';\t// adr_custom_15\r\n\t$address_export .= '\"Graduate\",';\t\t// adr_custom_16\r\n\r\n\t$address_export .= '\"Note\",';\t\t\t// note\r\n\t$address_export .= '\"Last Updated\"';\t// date\r\n\t$address_export .= '\"\\n\"';\r\n\r\n\tfor (; !$result->EOF; $result->MoveNext()) {\r\n\t\tlist($prefix\r\n\t\t ,$lname\r\n\t\t\t,$fname\r\n\t\t\t,$title\r\n\t\t\t,$company\r\n\t\t\t,$zip\r\n\t\t\t,$city\r\n\t\t\t,$address1\r\n\t\t\t,$address2\r\n\t\t\t,$state\r\n\t\t\t,$country\r\n\t\t\t,$contact_1\r\n\t\t\t,$contact_2\r\n\t\t\t,$contact_3\r\n\t\t\t,$contact_4\r\n\t\t\t,$contact_5\r\n\t\t\t,$custom_1\r\n\t\t\t,$custom_2\r\n\t\t\t,$custom_3\r\n\t\t\t,$custom_4\r\n\t\t\t,$custom_5\r\n\t\t\t,$custom_6\r\n\t\t\t,$custom_7\r\n\t\t\t,$custom_8\r\n\t\t\t,$custom_9\r\n\t\t\t,$custom_10\r\n\t\t\t,$custom_11\r\n\t\t\t,$custom_12\r\n\t\t\t,$custom_13\r\n\t\t\t,$custom_14\r\n\t\t\t,$custom_17\r\n\t\t\t,$custom_18\r\n\t\t\t,$custom_19\r\n\t\t\t,$custom_20\r\n\t\t\t,$custom_21\r\n\t\t\t,$custom_22\r\n\t\t\t,$custom_23\r\n\r\n\t\t\t,$custom_15\t\t// Referred By\r\n\t\t\t,$custom_16\t\t// Graduate\r\n\r\n\t\t\t,$note\r\n\t\t\t,$lastupdate) = $result->fields;\r\n\r\n\r\n\t\tswitch ($prefix) {\r\n\t\t\tcase 1: $address_export .= '\"Mr.\",'; break;\r\n\t\t\tcase 2: $address_export .= '\"Mrs.\",'; break;\r\n\t\t\tcase 3: $address_export .= '\"Dr.\",'; break;\r\n\t\t\tcase 4: $address_export .= '\"Ms.\",'; break;\r\n\t\t\tdefault: $address_export .= '\"\",'; break;\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$address_export .= '\"'.$fname.'\",';\r\n\t\t$address_export .= '\"'.$lname.'\",';\r\n\t\t$address_export .= '\"'.$title.'\",';\r\n\t\t$address_export .= '\"'.$company.'\",';\r\n\t\t$address_export .= '\"'.$address1.'\",';\r\n\t\t$address_export .= '\"'.$address2.'\",';\r\n\t\t$address_export .= '\"'.$city.'\",';\r\n\t\t$address_export .= '\"'.$state.'\",';\r\n\t\t$address_export .= '\"'.$zip.'\",';\r\n\t\t$address_export .= '\"'.$country.'\",';\r\n\t\t$address_export .= '\"'.$contact_1.'\",';\r\n\t\t$address_export .= '\"'.$contact_2.'\",';\r\n\t\t$address_export .= '\"'.$contact_3.'\",';\r\n\t\t$address_export .= '\"'.$contact_4.'\",';\r\n\t\t$address_export .= '\"'.$contact_5.'\",';\r\n\t\tif (!empty($custom_1)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_2)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_3)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_4)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_5)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_6)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_7)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_8)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\t\tif (!empty($custom_9)) {$address_export .='\"Y\",'; } else {$address_export .='\"\",'; }\r\n\r\n\t\t$address_export .= '\"'.date($custom_10).'\",';\r\n\t\t$address_export .= '\"'.$custom_11.'\",';\r\n\t\t$address_export .= '\"'.$custom_12.'\",';\r\n\t\t$address_export .= '\"'.$custom_13.'\",';\r\n\t\t$address_export .= '\"'.$custom_14.'\",';\r\n\t\t$address_export .= '\"'.$custom_17.'\",';\r\n\t\t$address_export .= '\"'.$custom_18.'\",';\r\n\t\t$address_export .= '\"'.$custom_19.'\",';\r\n\t\t$address_export .= '\"'.$custom_20.'\",';\r\n\t\t$address_export .= '\"'.$custom_21.'\",';\r\n\t\t$address_export .= '\"'.$custom_22.'\",';\r\n\t\t$address_export .= '\"'.$custom_23.'\",';\r\n\r\n\t\t$address_export .= '\"'.$custom_15.'\",';\r\n\t\t$address_export .= '\"'.$custom_16.'\",';\r\n\r\n\t\t$address_export .= '\"'.$note.'\",';\r\n\t\t$address_export .= '\"'.date(\"m-d-Y\",$lastupdate).'\"';\r\n\t\t$address_export .=\"\\n\";\r\n\t}\r\n\r\n\theader(\"Content-type: ext/x-csv\");\r\n\theader('Content-Disposition: filename=\"FCCC_AddressList_'.date(\"Y-m-d_h-i-s\").'.csv\"');\r\n\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n\tprint $address_export;\r\n\r\n\treturn TRUE;\r\n}",
"function generaXmlNew($x_factura_id,$conn){\r\n\t$x_factura = $x_factura_id ;\r\n\t$x_sello = $x_sello;\r\n\t$conn = $conn;\r\n\t$X_FECHA_CAR = date(\"Y-m-d\");\r\n\t$x_t_d = trim(date(\"Y-m-d\").'T'.date(\"H:i:s\"));\r\n\t \r\n\t\r\n#echo \"id\".$x_factura .\"<br>\";\r\n\t$sqlFactura = \"SELECT * FROM factura WHERE factura_id = $x_factura \";\r\n\t$rsFactura = phpmkr_query($sqlFactura,$conn) or die (\"Error al seleccionar la factura en la genracion del xml\". phpmkr_error().\"Query:\".$sqlFactura);\r\n\t$rowFactura = phpmkr_fetch_array($rsFactura);\r\n\t$x_cliente_id = $rowFactura[\"cliente_id\"];\r\n\t$x_fecha_generacion = $rowFactura[\"fecha_generacion\"];\r\n\t$x_folio = $rowFactura[\"folio\"];\r\n\t$x_sub_total_XML = $rowFactura[\"sub_total\"];\r\n\t$x_total_XML = $rowFactura[\"total\"];\r\n\t$x_forma_pago = limpiaTexto($rowFactura[\"forma_pago\"]);\r\n\t$x_metodo_pago = limpiaTexto($rowFactura[\"metodo_pago\"]);\r\n\t$x_tipo_comprobante = limpiaTexto($rowFactura[\"tipo_comprobante\"]);\r\n\t$x_total_iva = ($x_total_XML - $x_sub_total_XML);\r\n\t$x_importe_iva = $x_total_iva;\r\n\t#echo \"XML SUBTOTAL XML*****\".$x_sub_total_XML.\"<BR>***\";\r\n\tmysql_free_result($rsFactura);\r\n\t\r\n\t$sqlCliente = \"SELECT * FROM factura_datos WHERE factura_id = $x_factura \" ;\r\n\t$rsCliente = phpmkr_query($sqlCliente, $conn) or die (\"Error al seleccionar los datos del cliente en la genracion del xml\". phpmkr_error().\"Query:\".$sqlCliente);\r\n\t$rowCliente = phpmkr_fetch_array($rsCliente);\r\n\t$x_cliente_id = $rowCliente[\"cliente_id\"];\r\n\t$x_nombre = limpiaTexto($rowCliente[\"nombre\"]);\r\n\t$x_paterno = limpiaTexto($rowCliente[\"paterno\"]);\r\n\t$x_materno = limpiaTexto($rowCliente[\"materno\"]);\r\n\t$x_rfc = limpiaTexto($rowCliente[\"rfc\"]);\r\n\t$x_calle = limpiaTexto($rowCliente[\"calle\"]);\r\n\t$x_colonia = limpiaTexto($rowCliente[\"colonia\"]);\r\n\t$x_numero = limpiaTexto($rowCliente[\"numero\"]);\r\n\t$x_delegacion = limpiaTexto($rowCliente[\"delegacion\"]);\r\n\t$x_estado = limpiaTexto($rowCliente[\"estado\"]);\r\n\t$x_codigo_postal = limpiaTexto($rowCliente[\"codigo_postal\"]);\r\n\t$x_nombre_completo = $x_nombre.\" \".$x_paterno.\" \".$x_materno;\r\n\t$x_nombre_completo = limpiaTexto($x_nombre_completo);\r\n\tmysql_free_result($rsCliente);\r\n\t\r\n\t$sqlPagos = \"SELECT * FROM factura_pago WHERE factura_id = $x_factura\";\r\n\t$rsPagos = phpmkr_query($sqlPagos,$conn) or die (\"Error al seleccionar los datos de los pagos en la genracion del xml\". phpmkr_error().\"Query:\".$sqlPagos);\r\n\t$x_cont = 0;\r\n\twhile($rowPagos = phpmkr_fetch_array($rsPagos)){\r\n\t\t$x_cont ++;\r\n\t\t// mientras hay pagos se genera un renglon del xml por cada pago.\r\n\t\t$GLOBALS[\"x_recibo_id_$x_cont\"] = $rowPagos[\"recibo_id\"];\r\n\t\t${\"x_cantidad_\".$x_cont} = $rowPagos[\"cantidad\"];\r\n\t\t${\"x_unidad_\".$x_cont} = $rowPagos[\"unidad\"];\r\n\t\t${\"x_descripcion_\".$x_cont} = limpiaTexto($rowPagos[\"descripcion\"]);\r\n\t\t${\"x_valor_unitario_\".$x_cont} = $rowPagos[\"valor_unitario\"];\r\n\t\t${\"x_importe_\".$x_cont} = $rowPagos[\"importe\"];\r\n\t\t${\"x_impuesto_\".$x_cont} = $rowPagos[\"impuesto\"];\r\n\t\t${\"x_importe_impuesto_\".$x_cont} = $rowPagos[\"importe_impuesto\"];\r\n\t\t${\"x_tasa_\".$x_cont} = $rowPagos[\"tasa\"];\r\n\t\t}\r\n\t#\techo \"total de pagos++++++++++++>\".$x_cont.\"<br>\";\r\n\t\t$GLOBALS[\"x_total_pagos\"] = $x_cont;\r\n\t\t$x_factura_certificado_id = 1;\r\n\t#\techo \"x_valor_unitario_\".$x_valor_unitario_1.\"************************************<br>\";\r\n\tmysql_free_result($rsPagos);\r\n\t\r\n\t$sqlCertificado = \"SELECT * FROM factura_certificado WHERE factura_certificado_id = $x_factura_certificado_id\";\r\n\t$rsCertificado = phpmkr_query($sqlCertificado, $conn) or die (\"Error al seleccionar los datos de los pagos en la genracion del xml\". phpmkr_error().\"Query:\".$sqlCertificado);\r\n\t$rowCertificado = phpmkr_fetch_array($rsCertificado);\r\n\t$x_rfc_contribuyente = $rowCertificado[\"rfc_contribuyente\"];\r\n\t$x_numero_aprobacion = $rowCertificado[\"numero_aprobacion\"];\r\n\t$x_anio_aprobacion = $rowCertificado[\"anio_aprobacion\"];\r\n\t$x_serie_certificado = $rowCertificado[\"serie_certificado\"];\r\n\t$x_serie = $rowCertificado[\"serie\"];\r\n\t$x_fecha_transaccion = $rowCertificado[\"fecha_transaccion\"];\r\n\t$x_hora_transaccion = $rowCertificado[\"hora_transaccion\"];\r\n\t$x_hora_transaccion = $rowCertificado[\"hora_transaccion\"];\r\n\t$x_hora_transaccion = $rowCertificado[\"hora_transaccion\"];\r\n\t$x_hora_transaccion = $rowCertificado[\"hora_transaccion\"];\r\n\t$x_fecha_T = \t$x_fecha_transaccion.\"T\".$x_hora_transaccion;\r\n\t\r\n\tmysql_free_result($rsCertificado);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t//datos de la empresa que factura\r\n$rfc_emisor= $x_rfc_contribuyente;\r\n$razon_social_emisor='Microfinanciera Crece, S.A. de C.V., SOFOM, E.N.R.';\r\n$calle_emisor='AVENIDA REVOLUCION';\r\n$num_exterior_emisor='1909';\r\n$colonia_emisor='San Angel';\r\n$municipio_emisor='ALVARO OBREGON';\r\n$estado_emisor='Distrito Federal';\r\n$codigo_postal_emisor='01000';\r\n$pais_emisor='México';\r\n\r\n$ar=fopen(\"certificados/certificado.txt\",\"r\") or die(\"No se pudo abrir el archivo\");\r\n\r\nwhile (!feof($ar))\r\n\t {\r\n\t\t$certificado_texto.= fgets($ar);\r\n\t }\r\nfclose($ar);\r\n\t\r\n\t$x_fecha = date(\"Y-m-d\");\r\n\t\t\r\n//recupero las variables\r\n$forma_pago=trim($x_forma_pago);\r\n$tipo_cfd=trim($x_tipo_comprobante);\r\ntrim($fecha=$x_fecha);\r\n$aprobacion=trim($x_anio_aprobacion);\r\n$year_aprobacion=trim($x_anio_aprobacion);\r\n$serie=trim($x_serie ); $folio=trim($x_folio); \r\n$dias_credito=0; \r\n$iva=16;\r\n$num_certificado=trim($x_serie_certificado);\r\n\t\r\n$rfc=trim($x_rfc);\r\n$razon_social=trim($x_nombre_completo);\r\n$calle= trim($x_calle);\r\n$num_exterior= trim($x_numero);\r\n//$num_interior= trim($_REQUEST[num_interior]);\r\n$colonia= trim($x_colonia);\r\n$localidad=trim($x_delegacion);\r\n$municipio=trim($x_delegacion);\r\n$estado=trim($x_estado);\r\n$pais=\"Mexico\";\r\n$codigo_postal=trim($x_codigo_postal); \r\n//$referencia=trim($_REQUEST[referencia]);\r\n\t/*$x_conta = 1;\r\n\twhile($x_conta <= $x_cont ){\r\n$x_cantidad_n = \"x_cantidad_$x_cuenta\";\r\n$x_cantidad = $$x_cantidad_n;\r\n$x_unidad_n = \"x_unidad_$x_cuenta\";\r\n$x_unidad = $$x_unidad_n;\r\n$x_descripcion_n = \"x_descripcion_$x_cuenta\";\r\n$x_descripcion = $$x_descripcion_n;\r\n$x_valor_unitario_n = \"x_valor_unitario_$x_cuenta\";\r\n$x_valor_unitario = $$x_valor_unitario_n;\r\n$x_importe_n = \"x_importe_$x_cuenta\";\r\n$x_importe = $$x_importe_n;\r\n\r\n$x_file_xml .= '<Concepto cantidad=\"'.$x_cantidad.'\" unidad=\"'.$x_unidad.'\" descripcion=\"'.$x_descripcion.'\" valorUnitario=\"'.$x_valor_unitario.'\" importe=\"'.$x_importe.'\"/>';\r\n\r\n$x_cuenta++;\r\n\t\r\n${\"d_\".$x_conta} =trim($x_cantidad); ${\"precio_\".$x_conta}=trim($x_valor_unitario); ${\"cantidad_\".$x_conta}=trim($x_cantidad); ${\"unidad1_\".$x_conta}=$x_unidad;\r\n\r\n${\"monto_\".$x_conta} = ${\"precio_\".$x_conta} * ${\"cantidad_\".$x_conta};\r\n\r\n$x_conta++;\t\r\n}*/\r\n\r\n\r\n$x_conta = 1;\r\n\twhile($x_conta <= $x_cont ){\r\n$x_cantidad_n = \"x_cantidad_$x_cuenta\";\r\n$x_cantidad = $$x_cantidad_n;\r\n$x_unidad_n = \"x_unidad_$x_cuenta\";\r\n$x_unidad = $$x_unidad_n;\r\n$x_descripcion_n = \"x_descripcion_$x_cuenta\";\r\n$x_descripcion = $$x_descripcion_n;\r\n$x_valor_unitario_n = \"x_valor_unitario_$x_cuenta\";\r\n$x_valor_unitario = $$x_valor_unitario_n;\r\n$x_importe_n = \"x_importe_$x_cuenta\";\r\n$x_importe = $$x_importe_n;\r\n\r\n$x_conta++;\r\n\t}\r\n\r\n$d1=trim($x_descripcion_1); $precio1=trim($x_valor_unitario_1); $cantidad1=trim($x_cantidad_1 ); $unidad1=$x_unidad_1;\r\n$d2=trim($x_descripcion_2); $precio2=trim($x_valor_unitario_2); $cantidad2=trim($x_cantidad_2 ); $unidad2=$x_unidad_2;\r\n$d3=trim($x_descripcion_3); $precio3=trim($x_valor_unitario_3); $cantidad3=trim($x_cantidad_3); $unidad3=$x_unidad_3;\r\n$d4=trim($x_descripcion_4); $precio4=trim($x_valor_unitario_4); $cantidad4=trim($x_cantidad_4 ); $unidad4=$x_unidad_4;\r\n$d5=trim($x_descripcion_5); $precio5=trim($x_valor_unitario_5); $cantidad5=trim($x_cantidad_5); $unidad5=$x_unidad_5;\r\n$d6=trim($x_descripcion_6); $precio6=trim($x_valor_unitario_6); $cantidad6=trim($x_cantidad_6 ); $unidad6=$x_unidad_6;\r\n$d7=trim($x_descripcion_7); $precio7=trim($x_valor_unitario_7); $cantidad7=trim($x_cantidad_7 ); $unidad7=$x_unidad_7;\r\n$d8=trim($x_descripcion_8); $precio8=trim($x_valor_unitario_8); $cantidad8=trim($x_cantidad_8); $unidad8=$x_unidad_8;\r\n$d9=trim($x_descripcion_9); $precio9=trim($x_valor_unitario_9); $cantidad9=trim($x_cantidad_9 ); $unidad9=$x_unidad_9;\r\n$d10=trim($x_descripcion_10); $precio10=trim($x_valor_unitario_10); $cantidad10=trim($x_cantidad_10); $unidad10=$x_unidad_10;\r\n$d11=trim($x_descripcion_11); $precio11=trim($x_valor_unitario_11); $cantidad11=trim($x_cantidad_11); $unidad11=$x_unidad_11;\r\n$d12=trim($x_descripcion_12); $precio12=trim($x_valor_unitario_12); $cantidad12=trim($x_cantidad_12); $unidad12=$x_unidad_12;\r\n$d13=trim($x_descripcion_13); $precio13=trim($x_valor_unitario_13); $cantidad13=trim($x_cantidad_13); $unidad13=$x_unidad_13;\r\n$d14=trim($x_descripcion_14); $precio14=trim($x_valor_unitario_14); $cantidad14=trim($x_cantidad_14); $unidad14=$x_unidad_14;\r\n$d15=trim($x_descripcion_15); $precio15=trim($x_valor_unitario_15); $cantidad15=trim($x_cantidad_15); $unidad15=$x_unidad_15;\r\n$descuento=0;\r\n\t\r\n\t$iva= $x_iva/100; \r\n \t$numero = $serie.\"-\".$folio; //numero de factura\r\n\t$monto1 = $cantidad1 * $precio1;\r\n\t$monto2 = $cantidad2 * $precio2;\r\n\t$monto3 = $cantidad3 * $precio3;\r\n\t$monto4 = $cantidad4 * $precio4;\r\n\t$monto5 = $cantidad5 * $precio5;\r\n $subtotal = $monto1+$monto2+$monto3+$monto4+$monto5;\r\n $subtotal2 = $subtotal - $descuento;\r\n\t$iva = $iva*$subtotal2;\r\n $total = $subtotal2 + $iva;\r\n\r\n$descuento=0;\r\n\t\r\n\t$iva= $iva/100; \r\n \t$numero = $serie.\"-\".$folio; //numero de factura\r\n\t$monto1 = $cantidad1 * $precio1;\r\n\t$monto2 = $cantidad2 * $precio2;\r\n\t$monto3 = $cantidad3 * $precio3;\r\n\t$monto4 = $cantidad4 * $precio4;\r\n\t$monto5 = $cantidad5 * $precio5;\r\n\t$monto1 = $cantidad1 * $precio1;\r\n\t$monto2 = $cantidad2 * $precio2;\r\n\t$monto3 = $cantidad3 * $precio3;\r\n\t$monto4 = $cantidad4 * $precio4;\r\n\t$monto5 = $cantidad5 * $precio5;\r\n $subtotal = $monto1+$monto2+$monto3+$monto4+$monto5;\r\n $subtotal2 = $subtotal - $descuento;\r\n\t$iva = $iva*$subtotal2;\r\n $total = $subtotal2 + $iva;\r\n\t\t\t\r\n\r\n \r\n $pdf=new PDF('P','mm','Letter');\r\n $pdf->AliasNbPages();\r\n $pdf->AddPage(); \r\n $pdf->Ln(7);\r\n\t$pdf->SetFillColor(140,240,90);\r\n\t$pdf->SetFont('Arial','B',8);\r\n\t$pdf->Cell(105,4,\"CLIENTE\",1,0,'C',true);\r\n\t$pdf->Cell(10,4,\"\",0,0,'C');\r\n\t$pdf->SetFont('Arial','',8);\r\n\t\r\n\t//datos del cliente y datos del CFD\r\n\t$pdf->Cell(80,4,utf8_decode(\"Lugar de Expedición: $pais_emisor $estado_emisor.\"),\"LRT\",1,'L');\r\n\t$pdf->Cell(105,4,utf8_decode($x_nombre_completo),\"LR\",0,'L');\r\n\t$pdf->Cell(10,4,\"\",0,0,'C');\r\n\t$pdf->Cell(80,4,utf8_decode(\"Fecha y Hora: $fecha\"),\"LR\",1,'L');\r\n\t$pdf->Cell(105,4,\"RFC: \".$rfc,\"LR\",0,'L');\r\n\t$pdf->Cell(10,4,\"\",0,0,'C');\r\n\t$pdf->Cell(80,4,utf8_decode(\"Certificado: $num_certificado\"),\"LR\",1,'L');\r\n\t$pdf->Cell(105,4,utf8_decode(\"Calle $calle #$num_exterior $num_interior, Col. $colonia\"),\"LR\",0,'L');\r\n\t$pdf->Cell(10,4,\"\",0,0,'C');\r\n\t$pdf->Cell(80,4,utf8_decode(\"Aprobación: $aprobacion Año: $year_aprobacion\"),\"LR\",1,'L');\r\n\t$pdf->Cell(105,4,utf8_decode(\"$municipio, $estado, $pais CP.$codigo_postal\"),\"LBR\",0,'L');\r\n\t$pdf->Cell(10,4,\"\",0,0,'C');\r\n\t$pdf->Cell(80,4,\"\",\"LRB\",1,'L');\r\n \r\n\t//detalle de conceptos\r\n\t$pdf->Ln(5);\r\n\t$pdf->SetFont('Arial','B',8);\r\n $pdf->Cell(105,5,utf8_decode('DESCRIPCIÓN'),1,0,'C',true);\r\n $pdf->Cell(30,5,'PRECIO',1,0,'C',true);\r\n $pdf->Cell(30,5,\"CANTIDAD\",1,0,'C',true);\r\n $pdf->Cell(30,5,\"MONTO\",1,1,'C',true);\r\n\t$pdf->SetFont('Arial','',8);\r\n \r\n\tif ($d1!=\"\"){\r\n $posy1=$pdf->GetY();//posición antes de escribir concepto\r\n $pdf->MultiCell(105,5,\"\\n\".utf8_decode($d1),\"L\",'L');\r\n $posy2=$pdf->GetY();$posX2=$pdf->GetX();//posicion despues de escribir concepto\r\n $dif_y = $posy2-$posy1;//obtengo alto de las siguientes celdas\r\n $pdf->SetY($posy1);$pdf->SetX(115);//reposiciono Y y X despues del concepto, 10 de margen en x\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($precio1, 2, '.', ','),'L',0,'C');\r\n $pdf->Cell(30,$dif_y,$cantidad1.\" unidad1\",'L',0,'C');\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($monto1, 2, '.', ','),'LR',1,'C');} \t\r\n\t\t\t\t\t\t\t\t\r\n if ($d2!=\"\"){\r\n\t$posy1=$pdf->GetY();//posición antes de escribir concepto\r\n $pdf->MultiCell(105,5,\"\\n\".utf8_decode($d2),'L','L');\r\n $posy2=$pdf->GetY();$posX2=$pdf->GetX();//posicion despues de escribir concepto\r\n $dif_y = $posy2-$posy1;//obtengo alto de las siguientes celdas\r\n $pdf->SetY($posy1);$pdf->SetX(115);//reposiciono Y y X despues del concepto, 10 de margen en x\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($precio2, 2, '.', ','),\"L\",0,'C');\r\n $pdf->Cell(30,$dif_y,$cantidad2.\" $unidad2\",'L',0,'C');\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($monto2, 2, '.', ','),'LR',1,'C');} \r\n \r\n if ($d3!=\"\"){ \r\n\t$posy1=$pdf->GetY();//posición antes de escribir concepto\r\n $pdf->MultiCell(105,5,\"\\n\".utf8_decode($d3),'L','L');\r\n $posy2=$pdf->GetY();$posX2=$pdf->GetX();//posicion despues de escribir concepto\r\n $dif_y = $posy2-$posy1;//obtengo alto de las siguientes celdas\r\n $pdf->SetY($posy1);$pdf->SetX(115);//reposiciono Y y X despues del concepto, 10 de margen en x\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($precio3, 2, '.', ','),'L',0,'C');\r\n $pdf->Cell(30,$dif_y,$cantidad3.\" $unidad3\",'L',0,'C');\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($monto3, 2, '.', ','),'LR',1,'C');}\r\n \r\n if ($d4!=\"\"){\r\n\t$posy1=$pdf->GetY();//posición antes de escribir concepto\r\n $pdf->MultiCell(105,5,\"\\n\".utf8_decode($d4),'L','L');\r\n $posy2=$pdf->GetY();$posX2=$pdf->GetX();//posicion despues de escribir concepto\r\n $dif_y = $posy2-$posy1;//obtengo alto de las siguientes celdas\r\n $pdf->SetY($posy1);$pdf->SetX(115);//reposiciono Y y X despues del concepto, 10 de margen en x\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($precio4, 2, '.', ','),'L',0,'C');\r\n $pdf->Cell(30,$dif_y,$cantidad4.\" $unidad4\",'L',0,'C');\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($monto4, 2, '.', ','),'LR',1,'C');}\r\n \r\n if ($d5!=\"\"){\r\n\t$posy1=$pdf->GetY();//posición antes de escribir concepto\r\n $pdf->MultiCell(105,4,\"\\n\".utf8_decode($d5),'L','L');\r\n $posy2=$pdf->GetY();$posX2=$pdf->GetX();//posicion despues de escribir concepto\r\n $dif_y = $posy2-$posy1;//obtengo alto de las siguientes celdas\r\n $pdf->SetY($posy1);$pdf->SetX(115);//reposiciono Y y X despues del concepto, 10 de margen en x\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($precio5, 2, '.', ','),'L',0,'C');\r\n $pdf->Cell(30,$dif_y,$cantidad5.\" $unidad5\",'L',0,'C');\r\n $pdf->Cell(30,$dif_y,\"$\".number_format($monto5, 2, '.', ','),'LR',1,'C');}\r\n \r\n\t//cerrar tabla de conceptos\r\n $h = 190-($pdf->GetY());\r\n $pdf->Cell(105,$h,\" \",'LB',0,'C');\r\n $pdf->Cell(30,$h,\" \",'LB',0,'C');\r\n $pdf->Cell(30,$h,\" \",'LB',0,'C');\r\n $pdf->Cell(30,$h,\" \",'LRB',1,'C');\r\n \r\n //subtotal y pagarè\r\n\t$pdf->SetFont('Arial','',6);\r\n $pdf->Cell(42,4,\" \",0,0,'L');\r\n $pdf->Cell(93,4,utf8_decode(\"Debo y pagaré a la orden de $razon_social_emisor \"),0,0,'L');\r\n\t$pdf->SetFont('Arial','',8); $pdf->Cell(30,5,\"Subtotal: \",0,0,'R');\r\n $pdf->Cell(30,4,\"$\".number_format($subtotal, 2, '.', ','),0,1,'C');\r\n\r\n //descuento \r\n $pdf->SetFont('Arial','',6);\r\n\t$pdf->Cell(42,4,\" \",0,0,'L');\r\n $pdf->Cell(93,4,utf8_decode(\"en cualquier plaza donde se requiera el pago de la cantidad consignada\"),0,0,'L');\r\n $pdf->SetFont('Arial','',8); $pdf->Cell(30,4,\"Descuento: \",0,0,'R');\r\n $pdf->Cell(30,4,\"$\".number_format($descuento, 2, '.', ','),0,1,'C');\r\n\r\n //subtotal 2\r\n $pdf->SetFont('Arial','',6);\r\n\t$pdf->Cell(42,4,\" \",0,0,'L');\r\n $pdf->Cell(93,4,utf8_decode(\"en éste título de credito, en un plazo no mayor a $dias_credito dias a partir del $fecha\"),0,0,'L');\r\n $pdf->SetFont('Arial','',8); $pdf->Cell(30,4,\"Subtotal: \",0,0,'R');\r\n $pdf->Cell(30,4,\"$\".number_format($subtotal2, 2, '.', ','),0,1,'C');\r\n\r\n //IVA y ejecutivo\r\n $pdf->Cell(165,4,\"IVA: \",0,0,'R');\r\n $pdf->Cell(30,4,\"$\".number_format($iva, 2, '.', ','),0,1,'C');\r\n\r\n //cantidad con letra y total\r\n $letras=utf8_decode(num2letras($total,0,0).\" pesos \");\r\n\t$total_cadena=$total;\r\n\t$total = \"$\".number_format($total, 2, '.', ',');\r\n\t$ultimo = substr (strrchr ($total, \".\"), 1 ); //recupero lo que este despues del decimal\r\n\t$letras = $letras.\" \".$ultimo.\"/100 M. N.\";\r\n\t\t\t\r\n\t$pdf->SetFont('Arial','',6);\r\n $pdf->Cell(35,4,\"\",0,0,'R');\r\n\t$pdf->Cell(100,4,\"____________________\",0,0,'C');\r\n\t\t\t\r\n\t$pdf->SetFont('Arial','B',8);\r\n\t$pdf->Cell(30,4,\"Total: \",0,0,'R');\r\n $pdf->Cell(30,4,$total,0,1,'C');\r\n\t\t\t\r\n\t$pdf->SetFont('Arial','',6);\r\n\t$pdf->Cell(35,4,\"\",0,0,'R');\r\n\t$pdf->Cell(100,4,\"Firma\",0,1,'C');\r\n\t\t\t\r\n\t$pdf->Ln(3);$pdf->SetFont('Arial','B',8);\r\n\t$pdf->Cell(35,4,\"\",0,0,'R');\r\n\t$pdf->Cell(160,4,\"Importe en letra: \".$letras,0,1,'C');\r\n\t$pdf->Ln(3);\t\r\n\t\t\r\n\t// genera cadena original para ingresos, para traslados hay que agregar a la cadena las condicionales\r\n\t// de los campos de cada traslado\r\n\t//datos del comprobante\r\n\t$cadena_original=\"||2.0|$serie|$folio|$x_t_d|$aprobacion|$year_aprobacion|$tipo_cfd|$forma_pago|$dias_credito días\";\r\n\t$cadena_original.=\"|\".number_format($x_sub_total_XML, 2, '.','').\"|\".number_format($x_total_XML, 2, '.','');\r\n\t//datos del emisor\r\n\t$cadena_original.=\"|$rfc_emisor|$razon_social_emisor|$calle_emisor|$num_exterior_emisor|$colonia_emisor|$municipio_emisor\";\r\n\t$cadena_original.=\"|$estado_emisor|$pais_emisor|$codigo_postal_emisor\";\r\n\t//datos del cliente\r\n\t$cadena_original.=\"|$rfc|$razon_social|$calle|$num_exterior\";\r\n\tif($num_interior!=\"\"){$cadena_original.=\"|$num_interior\";}\r\n\t$cadena_original.=\"|$colonia\";\r\n\tif($localidad!=\"\"){$cadena_original.=\"|$localidad\";}\r\n\tif($referencia!=\"\"){$cadena_original.=\"|$referencia\";}\r\n\t$cadena_original.=\"|$municipio|$estado|$pais|$codigo_postal\";\r\n\t//detalle de conceptos\r\n\tif ($d1!=\"\")\r\n\t{$cadena_original.=\"|$cantidad1|$unidad1|$d1|\".number_format($precio1, 2, '.','').\"|\".number_format($monto1, 2, '.','');}\r\n\tif ($d2!=\"\")\r\n\t{$cadena_original.=\"|$cantidad2|$unidad2|$d2|\".number_format($precio2, 2, '.','').\"|\".number_format($monto2, 2, '.','');}\r\n\tif ($d3!=\"\")\r\n\t{$cadena_original.=\"|$cantidad3|$unidad3|$d3|\".number_format($precio3, 2, '.','').\"|\".number_format($monto3, 2, '.','');}\r\n\tif ($d4!=\"\")\r\n\t{$cadena_original.=\"|$cantidad4|$unidad4|$d4|\".number_format($precio4, 2, '.','').\"|\".number_format($monto4, 2, '.','');}\r\n\tif ($d5!=\"\")\r\n\t{$cadena_original.=\"|$cantidad5|$unidad5|$d5|\".number_format($precio5, 2, '.','').\"|\".number_format($monto5, 2, '.','');}\r\n\tif ($d6!=\"\")\r\n\t{$cadena_original.=\"|$cantidad6|$unidad6|$d6|\".number_format($precio6, 2, '.','').\"|\".number_format($monto6, 2, '.','');}\r\n\tif ($d7!=\"\")\r\n\t{$cadena_original.=\"|$cantidad7|$unidad7|$d7|\".number_format($precio7, 2, '.','').\"|\".number_format($monto7, 2, '.','');}\r\n\tif ($d8!=\"\")\r\n\t{$cadena_original.=\"|$cantidad8|$unidad8|$d8|\".number_format($precio8, 2, '.','').\"|\".number_format($monto8, 2, '.','');}\r\n\tif ($d9!=\"\")\r\n\t{$cadena_original.=\"|$cantidad9|$unidad9|$d9|\".number_format($precio9, 2, '.','').\"|\".number_format($monto9, 2, '.','');}\r\n\tif ($d10!=\"\")\r\n\t{$cadena_original.=\"|$cantidad10|$unidad10|$d10|\".number_format($precio10, 2, '.','').\"|\".number_format($monto10, 2, '.','');}\r\n\tif ($d11!=\"\")\r\n\t{$cadena_original.=\"|$cantidad11|$unidad11|$d11|\".number_format($precio11, 2, '.','').\"|\".number_format($monto11, 2, '.','');}\r\n\tif ($d12!=\"\")\r\n\t{$cadena_original.=\"|$cantidad12|$unidad12|$d12|\".number_format($precio12, 2, '.','').\"|\".number_format($monto12, 2, '.','');}\r\n\tif ($d13!=\"\")\r\n\t{$cadena_original.=\"|$cantidad13|$unidad13|$d13|\".number_format($precio13, 2, '.','').\"|\".number_format($monto13, 2, '.','');}\r\n\tif ($d14!=\"\")\r\n\t{$cadena_original.=\"|$cantidad14|$unidad14|$d14|\".number_format($precio14, 2, '.','').\"|\".number_format($monto14, 2, '.','');}\r\n\tif ($d15!=\"\")\r\n\t{$cadena_original.=\"|$cantidad15|$unidad15|$d15|\".number_format($precio15, 2, '.','').\"|\".number_format($monto15, 2, '.','');}\r\n\t\r\n\t//detalle de impuestos\t\t\r\n\t$cadena_original.=\"|IVA|16|\".number_format($x_importe_iva, 2, '.','').\"|\".number_format($x_importe_iva, 2, '.','').\"||\";\t\r\n\t$cadena_original=str_replace(\" \",\" \",$cadena_original);\r\n\t\t\t\r\n\t//Digestion SHA1, firmamos con nuestra clave y pasamos a base 64, requiere de openssl instalado\t\t\r\n\t$key='certificados/mcr070419kn2_1012292351s.key.pem';\r\n\t$fp = fopen($key, \"r\");\r\n\t$priv_key = fread($fp, 8192);\r\n\tfclose($fp);\t\t\r\n\t$pkeyid = openssl_get_privatekey($priv_key);\r\n\t#openssl_sign($cadena_original,$cadenafirmada,$pkeyid,OPENSSL_ALGO_SHA1);\r\n\topenssl_sign($cadena_original,$cadenafirmada,$pkeyid);\r\n\t$sello = base64_encode($cadenafirmada);\r\n\t\t\t\r\n\t$pdf->SetFont('Arial','B',5);\r\n\t$pdf->Cell(42,3,\"\",0,0,'C');\r\n\t$pdf->MultiCell(0,3,utf8_decode(\"Cadena Original\"),0,'L');\r\n\t$pdf->SetFont('Arial','',4);\r\n\t$pdf->Cell(42,3,\"\",0,0,'C');\r\n\t$pdf->MultiCell(0,3,utf8_decode($cadena_original),0,'L');\r\n\t$pdf->Ln(1);\r\n\t$pdf->SetFont('Arial','B',5);\r\n\t$pdf->Cell(42,3,\"\",0,0,'C');\r\n\t$pdf->MultiCell(0,3,utf8_decode(\"Sello Digital\"),0,'L');\r\n\t$pdf->SetFont('Arial','',4);\r\n\t$pdf->Cell(42,3,\"\",0,0,'C');\r\n\t$pdf->MultiCell(0,3,utf8_decode($sello),0,'L');\r\n\t$pdf->Ln(1);\r\n\t$pdf->SetFont('Arial','B',5);\r\n\t$pdf->Cell(42,3,\"\",0,0,'C');\r\n\t$pdf->MultiCell(0,3,utf8_decode('Este documento es una representación impresa de un CFD'),0,'L');\r\n\r\n\t//creo el xml en memoria\r\n\t$cadena_xml='<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'.\"\\r\\n\";\r\n\t$cadena_xml.='<Comprobante xmlns=\"http://www.sat.gob.mx/cfd/2\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"';\r\n\t$cadena_xml.=' version=\"2.0\" serie=\"'.$serie.'\" folio=\"'.$folio.'\" fecha=\"'.$x_t_d.'\" sello=\"'.$sello.'\"';\r\n\t$cadena_xml.=' noAprobacion=\"'.$aprobacion.'\" anoAprobacion=\"'.$year_aprobacion.'\" formaDePago=\"'.$forma_pago.'\" noCertificado=\"'.$num_certificado.'\" certificado=\"'.$certificado_texto.'\"';\r\n\t$cadena_xml.=' condicionesDePago=\"'.$dias_credito.' días\"';\r\n\t$cadena_xml.=' subTotal=\"'.number_format($x_sub_total_XML, 2, '.','').'\" total=\"'.number_format($x_total_XML, 2, '.','').'\" tipoDeComprobante=\"'.$tipo_cfd.'\"';\r\n\t$cadena_xml.=' xsi:schemaLocation=\"http://www.sat.gob.mx/cfd/2 http://www.sat.gob.mx/sitio_internet/cfd/2/cfdv2.xsd\">'.\"\\r\\n\";\r\n\t$cadena_xml.='<Emisor rfc=\"'.$rfc_emisor.'\" nombre=\"'.$razon_social_emisor.'\">'.\"\\r\\n\";\r\n\t$cadena_xml.='<DomicilioFiscal calle=\"'.$calle_emisor.'\" noExterior=\"'.$num_exterior_emisor.'\" colonia=\"'.$colonia_emisor.'\" municipio=\"'.$municipio_emisor.'\"';\r\n\t$cadena_xml.=' estado=\"'.$estado_emisor.'\" pais=\"'.$pais_emisor.'\" codigoPostal=\"'.$codigo_postal_emisor.'\"/>'.\"\\r\".'</Emisor>'.\"\\r\\n\";\r\n\t$cadena_xml.='<Receptor rfc=\"'.$rfc.'\" nombre=\"'.$razon_social.'\">'.\"\\r\\n\";\r\n\t$cadena_xml.='<Domicilio calle=\"'.$calle.'\" noExterior=\"'.$num_exterior.'\"';\r\n\tif ($num_interior!=''){$cadena_xml.=' noInterior=\"'.$num_interior.'\"';}\r\n\t$cadena_xml.=' colonia=\"'.$colonia.'\"';\r\n\tif ($localidad!=''){$cadena_xml.=' localidad=\"'.$localidad.'\"';}\r\n\tif ($referencia!=''){$cadena_xml.=' referencia=\"'.$referencia.'\"';}\r\n\t$cadena_xml.=' municipio=\"'.$municipio.'\" estado=\"'.$estado.'\" pais=\"'.$pais.'\" codigoPostal=\"'.$codigo_postal.'\"/>'.\"\\r\\n\".'</Receptor>'.\"\\r\\n\".'<Conceptos>'.\"\\r\\n\";\r\n\t\t\t\r\n\tif ($d1!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad1.'\" unidad=\"'.$unidad1.'\" descripcion=\"'.$d1.'\" valorUnitario=\"'.number_format($precio1, 2, '.','').'\" importe=\"'.number_format($monto1, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\t\t\r\n\tif ($d2!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad2.'\" unidad=\"'.$unidad2.'\" descripcion=\"'.$d2.'\" valorUnitario=\"'.number_format($precio2, 2, '.','').'\" importe=\"'.number_format($monto2, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\t\t\r\n\tif ($d3!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad3.'\" unidad=\"'.$unidad3.'\" descripcion=\"'.$d3.'\" valorUnitario=\"'.number_format($precio3, 2, '.','').'\" importe=\"'.number_format($monto3, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\t\t\r\n\tif ($d4!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad4.'\" unidad=\"'.$unidad4.'\" descripcion=\"'.$d4.'\" valorUnitario=\"'.number_format($precio4, 2, '.','').'\" importe=\"'.number_format($monto4, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\t\t\r\n\tif ($d5!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad5.'\" unidad=\"'.$unidad5.'\" descripcion=\"'.$d5.'\" valorUnitario=\"'.number_format($precio5, 2, '.','').'\" importe=\"'.number_format($monto5, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\r\n\tif ($d6!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad6.'\" unidad=\"'.$unidad6.'\" descripcion=\"'.$d6.'\" valorUnitario=\"'.number_format($precio6, 2, '.','').'\" importe=\"'.number_format($monto6, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\r\n\tif ($d7!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad7.'\" unidad=\"'.$unidad7.'\" descripcion=\"'.$d7.'\" valorUnitario=\"'.number_format($precio7, 2, '.','').'\" importe=\"'.number_format($monto7, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\r\n\tif ($d8!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad8.'\" unidad=\"'.$unidad8.'\" descripcion=\"'.$d8.'\" valorUnitario=\"'.number_format($precio8, 2, '.','').'\" importe=\"'.number_format($monto8, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\r\n\tif ($d9!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad9.'\" unidad=\"'.$unidad9.'\" descripcion=\"'.$d9.'\" valorUnitario=\"'.number_format($precio9, 2, '.','').'\" importe=\"'.number_format($monto9, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\r\n\tif ($d10!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad10.'\" unidad=\"'.$unidad10.'\" descripcion=\"'.$d10.'\" valorUnitario=\"'.number_format($precio10, 2, '.','').'\" importe=\"'.number_format($monto10, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\tif ($d11!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad11.'\" unidad=\"'.$unidad11.'\" descripcion=\"'.$d11.'\" valorUnitario=\"'.number_format($precio11, 2, '.','').'\" importe=\"'.number_format($monto11, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\tif ($d10!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad12.'\" unidad=\"'.$unidad12.'\" descripcion=\"'.$d12.'\" valorUnitario=\"'.number_format($precio12, 2, '.','').'\" importe=\"'.number_format($monto12, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\tif ($d13!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad13.'\" unidad=\"'.$unidad13.'\" descripcion=\"'.$d13.'\" valorUnitario=\"'.number_format($precio13, 2, '.','').'\" importe=\"'.number_format($monto13, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\tif ($d14!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad14.'\" unidad=\"'.$unidad14.'\" descripcion=\"'.$d14.'\" valorUnitario=\"'.number_format($precio14, 2, '.','').'\" importe=\"'.number_format($monto14, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\tif ($d15!=\"\")\r\n\t{$cadena_xml.='<Concepto cantidad=\"'.$cantidad15.'\" unidad=\"'.$unidad15.'\" descripcion=\"'.$d15.'\" valorUnitario=\"'.number_format($precio15, 2, '.','').'\" importe=\"'.number_format($monto15, 2, '.','').'\"/>'.\"\\r\\n\";}\r\n\t\t\t\r\n\t$cadena_xml.='</Conceptos>'.\"\\r\\n\";\r\n\t$cadena_xml.='<Impuestos totalImpuestosTrasladados=\"'.number_format($x_importe_iva, 2, '.','').'\">'.\"\\r\".'<Traslados>'.\"\\r\".'<Traslado impuesto=\"IVA\" tasa=\"16\" importe=\"'.number_format($x_importe_iva, 2, '.','').'\"/>'.\"\\r\\n\";\r\n\t$cadena_xml.='</Traslados>'.\"\\r\\n\".'</Impuestos>'.\"\\r\\n\".'</Comprobante>';\r\n\t\t\t\r\n\t$cadena_xml=str_replace(\" \",\" \",$cadena_xml);\r\n\t\t\r\n\t$x_fecha_actual = date(\"Y-m-d\");\t\r\n\t$x_no_ale = rand(100, 1000);\r\n\t$x_nn = str_replace(\" \", \"_\",$x_nombre);\r\n\t$x_nombre_cfd = \"CFD_\".$x_fecha_actual.\"_\".$x_nn.\"_\".$x_paterno.\"_\".$x_materno.\"_\".$serie.\"_\".$folio.\".xml\";\t\r\n\t//creo un archivo de texto plano y meto la cadena del xml\r\n\t$new_xml = fopen (\"CFDS/XML/$x_nombre_cfd\", \"w\");\r\n\tfwrite($new_xml,$cadena_xml);\r\n\tfclose($new_xml);\r\n #$x_nombre_pdf = \"PDF_\".$x_fecha_actual.\"_\".$x_nn.\"_\".$x_paterno.\"_\".$x_materno.\"_\".$serie.\"_\".$folio.\".pdf\";\t\t\r\n #$pdf->Output(\"CFDS/PDF/$x_nombre_pdf\",\"F\"); //guardo en disco\r\n #$pdf->Output();//muestro el pdf\r\n\r\n\r\n\t#INSERTAMOS EL ARCHIVO EN LA TABLA\r\n\t$sqlxml = \"INSERT INTO factura_cfd (`factura_cfd_id`, `factura_id`, `archivo`, `fecha`) VALUES (NULL, $x_factura,'$x_nombre_cfd', '$x_fecha_actual');\";\r\n\t$rsxml = phpmkr_query($sqlxml, $conn) or die(\"Error al seleccionar\".phpmkr_error().\"sql :\".$sqlxml);\r\n\tif($rsxml){\r\n\t\t#echo \"sen inserto en xml\";\r\n\t\t}\t\t\r\n\t$x_pdf = generaPDF($x_factura, $conn,$cadena_original, $sello, $x_t_d);\r\n\t\r\n\t\r\n\t\r\n\treturn true;\r\n\t\t\r\n\t\r\n\t\r\n\t}",
"function create_narrative_xml($xml, $file, $startTimes, $duration, $endTimes, $audio_image)\n{\n $name = $xml->createElement(\"Mp3Name\");\n $mp3Name = $xml->createTextNode($file);\n $name->appendChild($mp3Name);\n\n $start = $xml->createElement(\"Start\");\n $startTime = $xml->createTextNode($startTimes);\n $start->appendChild($startTime);\n\n $length = $xml->createElement(\"Duration\");\n $lengthTime = $xml->createTextNode($duration);\n $length->appendChild($lengthTime);\n\n $end = $xml->createElement(\"End\");\n $endTime = $xml->createTextNode($endTimes);\n $end->appendChild($endTime);\n\n $image = $xml->createElement(\"Image\");\n $imageNarrative = $xml->createTextNode($audio_image);\n $image->appendChild($imageNarrative);\n\n $narrative = $xml->createElement(\"Narrative\");\n $narrative->appendChild($name);\n $narrative->appendChild($start);\n $narrative->appendChild($end);\n $narrative->appendChild($length);\n $narrative->appendChild($image);\n\n return $narrative;\n}"
] | [
"0.55859333",
"0.5580716",
"0.55180013",
"0.5460037",
"0.5367277",
"0.5356628",
"0.53286254",
"0.5286601",
"0.52689505",
"0.52263254",
"0.5146572",
"0.5142453",
"0.5119721",
"0.50843954",
"0.5072537",
"0.5054293",
"0.50214237",
"0.50181484",
"0.49300635",
"0.49283302",
"0.49068236",
"0.48696464",
"0.48316264",
"0.47987688",
"0.4796688",
"0.47629815",
"0.4741582",
"0.47408032",
"0.4725428",
"0.4723104"
] | 0.7160276 | 0 |
/ function to export/backup template created by NK created on 17 august 2017 | public function exportTemplate()
{
$tempalteIdArr = explode(",",input::get('template_id'));
$templatesArr = BucketTemplates::whereIn('id',$tempalteIdArr)->get();
$rootFolderPath = public_path('templateBackup');
$rootFolderPathZip = public_path('templateBackup.zip');
if (is_dir($rootFolderPath))
{
$this->deleteDirTemplateBackup($rootFolderPath);
if(file_exists($rootFolderPathZip)){
unlink($rootFolderPathZip);
}
mkdir($rootFolderPath, 0777);
}
else
{
mkdir($rootFolderPath, 0777);
}
$xml = "<?xml version='1.0' encoding='UTF-8'?>";
$xmlFilePath = public_path('templateBackup').DIRECTORY_SEPARATOR;
$file = fopen($xmlFilePath."templateData.xml","w");
foreach($templatesArr as $templatesVal)
{
$src = public_path('template_data').DIRECTORY_SEPARATOR.$templatesVal['id'];
$des = $rootFolderPath.DIRECTORY_SEPARATOR.$templatesVal['id']."_".$templatesVal['template_name'];
$xml.="<templateData>";
$xml.="<templateId>".$templatesVal['id']."</templateId>";
$xml.="<templateName>".$templatesVal['template_name']."</templateURL>";
$xml.="<templateURL>".$templatesVal['template_region']."</templateURL>";
$xml.="<templateAwsName>".$templatesVal['aws_name']."</templateAwsName>";
$xml.="</templateData>";
$this->copy_directory($src,$des);
}
fwrite($file,$xml);
fclose($file);
$realPath = public_path('templateBackup');
$this->zipBackup($realPath);
flash("Template backup has been created successfully");
return redirect()->route('export-template-complete');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _saveTplIndexPage()\n {\n $html = $this->pageContent;\n\n $html = str_replace('{{ root }}', $this->nameVariableRoot, $html);\n\n $html = str_replace('{% tpl %}', '', $html);\n\n preg_match('/{% else %}(.*?){% end %}/s', $html, $matches);\n\n $html = str_replace($matches, '', $html);\n\n file_put_contents(dirname(__DIR__) . \"/../../../../app/game.tpl\", $html);\n }",
"public function viewExportTemplate()\n {\n $primary = \"yes\";\n $bucketAuthCredentials = ConfigAuth::where('primary_network', \"=\", $primary)->first();\n $activeConfigId \t\t= $bucketAuthCredentials['id'];\n $templatesArr \t\t\t= BucketTemplates::where('aws_server_id', \"=\", $activeConfigId)->get();\n return view('adminsOnly.templatesBackup.index', compact('templatesArr'));\n }",
"public function globo_exim_export_template_download() {\n\t $date = new DateTime();\n\t $ts = $date->format( 'Y-m-d H:i:s' );\n\n\t // A name with a time stamp, to avoid duplicate filenames\n\t $filename = $_POST['globo_type'] .\"-$ts.csv\";\n\n\t // Tells the browser to expect a CSV file and bring up the\n\t // save dialog in the browser\n\t header( 'Content-Type: text/csv' );\n\t header( 'Content-Disposition: attachment;filename='.$filename);\n\t\t\n\t\t\n\n\t\tif($_POST['data']){\n\t\t print stripslashes_deep( $_POST['data'] );\n\t\t}\n\n\t\twp_die();\n }",
"public function exports() {\n return $this->buildPageTemplate('export');\n }",
"function saveResultAsTemplate($str,$out_name,$vuename,$prefix,$postfix){\n //remove extension from filename\n $path_parts = pathinfo($vuename);\n\n $filename = $path_parts['filename']; // Since PHP 5.2.0\n //$main=$this;\n $main=RequestContext::getMain();\n //get token for storing file\n $user = $main->getUser(); // Or User::newFromName, etc.\n $token = $user->editToken();\n\n //set parameters to save $str in template\n $templateTitle='IM '.$prefix .' '.$filename .' '.$postfix;\n $params = new DerivativeRequest( \n//In an API module context, one can use $this->getMain()->getRequest()\n//same goes for getUser()\n//You can access the main request context using RequestContext::getMain();\n\t $main->getRequest(),\n\t array(\n\t 'action' => 'edit',\n\t 'title' => ''. self::TEMPLATE.':'.$templateTitle,\n\t //'section' => 0,//Omit to act on the entire page\n 'basetimestamp' => wfTimestamp( TS_ISO_8601, wfTimestampNow() ),\n\t 'summary' => 'Image template '.$filename,\n\t 'text' => $str,\n\t 'token' => $token),\n\t true\n );\n\n\n //save template in wiki\n $api = new ApiMain( $params ,true);//true = enable write: important!\n $api->execute();\n /*$tTitle = Title::makeTitle( NS_TEMPLATE, $templateTitle );\n\t\n #now create the page \n $templatePage = new Article( $tTitle );\n $templatePage->doEdit( $str, 'Image template '.$filename, EDIT_NEW );*/\n\n //return template title to be used in calling function\n return ''. self::TEMPLATE.':'.$templateTitle;\n}",
"public function generateExport()\n {\n }",
"public function create_template() {\n\n $new_file_name = $this->MIGRATE_FILE_PREFIX . date('Ymdhms');\n $template = file_get_contents(Utility::current_dir() . $this->MIGRATIONS_TEMPLATE);\n if(empty($template)) {\n echo \"Template file failed to load!\\n\";\n exit;\n }\n $template = str_replace(\"VERSION\", $new_file_name, $template);\n $path = $this->migration_full_path() . $new_file_name .'.'. $this->FILE_TYPE;\n echo \"Adding a new migration version file ...\\n\";\n\n $f = @fopen($path, 'w');\n if ($f) {\n fputs($f, $template);\n fclose($f);\n echo \"Done.\\nYou can now write php scripts to run the sql alter query(s) in the up() method of $this->MIGRATIONS_DIR\" . $new_file_name .'.'. $this->FILE_TYPE . \". \\n\";\n }\n else {\n echo \"Failed.\\n\";\n }\n }",
"private function createFromTemplate($template)\n {\n\n global $wpdb;\n\n DUP_Log::Info(\"Preping for use\");\n $installer = DUP_Util::safePath(DUPLICATOR_SSDIR_PATH_TMP).\"/{$this->Package->NameHash}_installer.php\";\n\n //Option values to delete at install time\n $deleteOpts = $GLOBALS['DUPLICATOR_OPTS_DELETE'];\n\n\t\t DUP_Log::Info(\"PACK SIZE: {$this->Package->Size}\");\n\n\t\t $hasher = new DUP_PasswordHash(8, FALSE);\n\t\t $pass_hash = $hasher->HashPassword($this->Package->Installer->OptsSecurePass);\n\n $replace_items = Array(\n //COMPARE VALUES\n \"fwrite_created\" => $this->Package->Created,\n \"fwrite_version_dup\" => DUPLICATOR_VERSION,\n \"fwrite_version_wp\" => $this->Package->VersionWP,\n \"fwrite_version_db\" => $this->Package->VersionDB,\n \"fwrite_version_php\" => $this->Package->VersionPHP,\n \"fwrite_version_os\" => $this->Package->VersionOS,\n //GENERAL\n \"fwrite_url_old\" => get_option('siteurl'),\n \"fwrite_archive_name\" => \"{$this->Package->NameHash}_archive.zip\",\n\t\t\t\"fwrite_archive_onlydb\" => $this->Package->Archive->ExportOnlyDB,\n \"fwrite_package_notes\"\t=> $this->Package->Notes,\n\t\t\t\"fwrite_package_size\"\t=> $this->Package->Archive->Size,\n \"fwrite_secure_name\"\t=> $this->Package->NameHash,\n \"fwrite_dbhost\"\t\t\t=> $this->Package->Installer->OptsDBHost,\n \"fwrite_dbport\"\t\t\t=> $this->Package->Installer->OptsDBPort,\n \"fwrite_dbname\"\t\t\t=> $this->Package->Installer->OptsDBName,\n \"fwrite_dbuser\"\t\t\t=> $this->Package->Installer->OptsDBUser,\n\t\t\t\"fwrite_secureon\"\t\t=> $this->Package->Installer->OptsSecureOn,\n\t\t\t\"fwrite_securepass\"\t\t=> $pass_hash,\n \"fwrite_dbpass\" => '',\n \"fwrite_wp_tableprefix\" => $wpdb->prefix,\n \"fwrite_opts_delete\" => json_encode($deleteOpts),\n \"fwrite_blogname\" => esc_html(get_option('blogname')),\n \"fwrite_wproot\" => DUPLICATOR_WPROOTPATH,\n\t\t\t\"fwrite_wplogin_url\" => wp_login_url(),\n \"fwrite_duplicator_version\" => DUPLICATOR_VERSION);\n\n if (file_exists($template) && is_readable($template)) {\n $err_msg = \"ERROR: Unable to read/write installer. \\nERROR INFO: Check permission/owner on file and parent folder.\\nInstaller File = <{$installer}>\";\n $install_str = $this->parseTemplate($template, $replace_items);\n (empty($install_str)) ? DUP_Log::Error(\"{$err_msg}\", \"DUP_Installer::createFromTemplate => file-empty-read\") : DUP_Log::Info(\"Template parsed with new data\");\n\n //INSTALLER FILE\n $fp = (!file_exists($installer)) ? fopen($installer, 'x+') : fopen($installer, 'w');\n if (!$fp || !fwrite($fp, $install_str, strlen($install_str))) {\n DUP_Log::Error(\"{$err_msg}\", \"DUP_Installer::createFromTemplate => file-write-error\");\n }\n\n @fclose($fp);\n } else {\n DUP_Log::Error(\"Installer Template missing or unreadable.\", \"Template [{$template}]\");\n }\n @unlink($template);\n DUP_Log::Info(\"Complete [{$installer}]\");\n }",
"public function getexportcsvtemplate() {\n\t\t$i=0;\n\t\t\n\t\t$template_array[0][0]\t\t=\t\t'Company Name';\n\t\t$template_array[0][1]\t\t=\t\t'Email Address';\n\t\t$template_array[0][2]\t\t=\t\t'Phone';\n\t\t$template_array[0][3]\t\t=\t\t'Website';\n\t\t$template_array[0][4]\t\t=\t\t'Twitter';\n\t\t$template_array[0][5]\t\t=\t\t'Facebook';\n\t\t$template_array[0][6]\t\t=\t\t'Linkedin';\n\t\t$template_array[0][7]\t\t=\t\t'Address';\n\t\t$template_array[0][8]\t\t=\t\t'City';\n\t\t$template_array[0][9]\t\t=\t\t'County/State';\n\t\t$template_array[0][10]\t\t=\t\t'Country';\n\t\t$template_array[0][11]\t\t=\t\t'Zip/Postal Code';\n\t\t$template_array[0][12]\t\t=\t\t'Primary Contact Firstname';\n\t\t$template_array[0][13]\t\t=\t\t'Lastname';\n\t\t$template_array[0][14]\t\t=\t\t'Job Title';\n\t\t$template_array[0][15]\t\t=\t\t'Title (Mr/Mrs etc)';\n\t\t$template_array[0][16]\t\t=\t\t'Phone'; \n\t\t//echo var_dump($template_array);exit;\n\t\t\t\n\t\t$this->Filemanagement->getExportcsv($template_array, 'import_partner_template.csv', ',');\n\t\techo 'export complete';\n\t\texit;\n\t\t\t\t\t\n}",
"public function template() {}",
"function getPackageTemplate();",
"public function templates()\n {\n global $g_comp_database, $g_comp_template, $g_comp_template_language_manager;\n\n $l_navbar = $this->m_userrequest->get_navbar();\n\n $l_navbar->set_active(\n isys_auth_export::instance()\n ->is_allowed_to(isys_auth::DELETE, 'EXPORT/' . C__MODULE__EXPORT . '2'),\n C__NAVBAR_BUTTON__DELETE\n )\n ->set_visible(true, C__NAVBAR_BUTTON__DELETE);\n\n $l_dao = new isys_export_dao($g_comp_database);\n $l_exports = $l_dao->get_data();\n\n /**\n * Display template list\n */\n $l_arTableHeader = [\n \"isys_export__title\" => $g_comp_template_language_manager->{\"LC__WORKFLOW__TEMPLATES\"},\n \"save_as\" => \"Export \" . $g_comp_template_language_manager->{\"LC__CMDB__CATG__TYPE\"},\n \"isys_export__datetime\" => $g_comp_template_language_manager->{\"LC__TASK__DETAIL__WORKORDER__CREATION_DATE\"},\n \"exported_count\" => $g_comp_template_language_manager->{\"LC__EXPORT__EXECUTED\"},\n ];\n\n $l_objList = new isys_component_list(ISYS_NULL, $l_exports);\n $l_objList->set_row_modifier($this, \"row_mod_tpl\");\n\n $l_objList->config(\n $l_arTableHeader,\n \"?\" . $_SERVER[\"QUERY_STRING\"] . \"&id=[{isys_export__id}]\",\n \"[{isys_export__id}]\",\n true\n );\n\n $l_objList->createTempTable();\n\n $g_comp_template->smarty_tom_add_rule('tom.content.navbar.cRecStatus.p_bInvisible=1');\n $g_comp_template->assign(\"g_list\", $l_objList->getTempTableHtml());\n\n if ($_GET[\"id\"])\n {\n /**\n * Start export\n */\n $l_exports = $l_dao->get_data($_GET[\"id\"]);\n\n if ($l_exports->num_rows() > 0)\n {\n /* Get export options (_POST parameters) */\n $l_data = $l_exports->__to_array();\n $l_params = unserialize($l_data[\"isys_export__params\"]);\n\n /* Increment export counter */\n $l_dao->count($_GET[\"id\"]);\n\n /* Do the export with parameters: $l_params */\n $this->export($l_params);\n }\n }\n }",
"function template() { }",
"public function exportThemeSql() {\n $ignore_insert_table = array(\n _DB_PREFIX_ . 'connections', _DB_PREFIX_ . 'connections_page', _DB_PREFIX_ . 'connections_source',\n _DB_PREFIX_ . 'guest', _DB_PREFIX_ . 'statssearch',\n _DB_PREFIX_ . 'sekeyword', _DB_PREFIX_ . 'favorite_product',\n _DB_PREFIX_ . 'pagenotfound', _DB_PREFIX_ . 'shop_url',\n _DB_PREFIX_ . 'employee', _DB_PREFIX_ . 'employee_shop',\n _DB_PREFIX_ . 'contact', _DB_PREFIX_ . 'contact_lang',\n _DB_PREFIX_ . 'contact', _DB_PREFIX_ . 'contact_shop'\n );\n $installFolder = _PS_MODULE_DIR_ . \"leotempcp/install\";\n if (!is_dir($installFolder))\n mkdir($installFolder, 0755);\n $backupfile = $installFolder . \"/theme.sql\";\n \n $fp = @fopen($backupfile, 'w');\n if ($fp === false) {\n $this->_html[\"error\"] = \"Error when export DbStruct! Can not write file in leotemcp/install\";\n return false;\n }\n fwrite($fp, 'SET NAMES \\'utf8\\';' . \"\\n\\n\");\n // Find all tables\n $tables = Db::getInstance()->executeS('SHOW TABLES');\n $found = 0;\n $sql = '';\n foreach ($tables as $table) {\n $table = current($table);\n\n // Skip tables which do not start with _DB_PREFIX_\n if (Tools::strlen($table) < Tools::strlen(_DB_PREFIX_) || strncmp($table, _DB_PREFIX_, Tools::strlen(_DB_PREFIX_)) != 0)\n continue;\n\n // Export the table schema\n $schema = Db::getInstance()->executeS('SHOW CREATE TABLE `' . $table . '`');\n\n if (count($schema) != 1 || !isset($schema[0]['Table']) || !isset($schema[0]['Create Table'])) {\n fclose($fp);\n //$this->delete();\n //echo Tools::displayError('An error occurred while backing up. Unable to obtain the schema of').' \"'.$table;\n $this->_html[\"error\"] = \"An error occurred while backing up. Unable to obtain the schema of \".$table;\n return false;\n }\n\n if (!in_array($schema[0]['Table'], $ignore_insert_table)) {\n $sql .= \"\\n\" . 'TRUNCATE TABLE ' . str_replace(\"`\"._DB_PREFIX_ , \"`PREFIX_\", \"`\".$schema[0]['Table']) . '`;' . \"\\n\";\n\n $data = Db::getInstance()->query('SELECT * FROM `' . $schema[0]['Table'] . '`', false);\n $sizeof = DB::getInstance()->NumRows();\n $lines = explode(\"\\n\", $schema[0]['Create Table']);\n\n if ($data && $sizeof > 0) {\n // Export the table data\n $sql .= 'INSERT INTO ' . str_replace('`'._DB_PREFIX_, '`PREFIX_', '`'.$schema[0]['Table']) . \"` VALUES\\n\";\n //fwrite($fp, 'INSERT INTO `'.$schema[0]['Table'].\"` VALUES\\n\");\n $i = 1;\n while ($row = DB::getInstance()->nextRow($data)) {\n $s = '(';\n\n foreach ($row as $field => $value) {\n //special table\n if ($schema[0]['Table'] == _DB_PREFIX_ . \"leowidgets\" && $field == \"params\") {\n $configs = Tools::jsonDecode(base64_decode($value) ,true);\n \n foreach ($configs as $kconfig => $vconfig) {\n if (strpos($kconfig, \"htmlcontent\") !== false || strpos($kconfig, \"content\") !== false || strpos($kconfig, \"information\") !== false || strpos($kconfig, \"raw_html\") !== false) {\n $vconfig = str_replace('\"' . __PS_BASE_URI__ . 'modules/', '\"modules/', $vconfig);\n $configs[$kconfig] = str_replace('\"' . __PS_BASE_URI__ . 'themes/', '\"themes/', $vconfig);\n }\n \n }\n $value = base64_encode(Tools::jsonEncode($configs));\n }\n\n $tmp = \"'\" . pSQL($value, true) . \"',\";\n if ($tmp != \"'',\")\n $s .= $tmp;\n else {\n foreach ($lines as $line)\n if (strpos($line, '`' . $field . '`') !== false) {\n if (preg_match('/(.*NOT NULL.*)/Ui', $line))\n $s .= \"'',\";\n else\n $s .= 'NULL,';\n break;\n }\n }\n }\n $s = rtrim($s, ',');\n\n if (($i % 200 == 0 || ($schema[0]['Table'] == _DB_PREFIX_ . \"leowidgets\" && $i % 20 == 0)) && $i < $sizeof)\n $s .= \");\\nINSERT INTO \" . str_replace('`'._DB_PREFIX_, '`PREFIX_', '`'.$schema[0]['Table']) . \"` VALUES\\n\";\n elseif ($i < $sizeof)\n $s .= \"),\\n\";\n else\n $s .= \");\\n\";\n $sql .= $s;\n \n //fwrite($fp, $s);\n ++$i;\n }\n }\n }\n $found++;\n }\n //table PREFIX_condition\n $sql = str_replace(\" \"._DB_PREFIX_, \" PREFIX_\", $sql);\n //img link\n //$sql = str_replace('src=\\\"' . __PS_BASE_URI__ . 'modules/', 'src=\\\"modules/', $sql);\n \n fwrite($fp, $sql);\n fclose($fp);\n if ($found == 0) {\n //echo Tools::displayError('No valid tables were found to backup.' );\n $this->_html[\"error\"] = \"No valid tables were found to backup.\";\n return false;\n }\n\n $this->_html[\"confirm\"][] .= 'Create theme.sql was successful';\n }",
"public function globo_exim_export_template() {\n\t\t$csv = new CSV();\n\t\t\n\t\t// set headings\n\t\tif( $_GET['download_type'] == 'company' ) {\n\t\t\t$csv->setHeading( $this->post_heading );\t\n\t\t} else {\n\t\t\t$csv->setHeading( $this->industry_heading );\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t \n\t\t// output the csv\n\t\t$csv->output();\n\t\t\n\t\t// clear the buffer\n\t\t$csv->clear();\n\n\n\t\twp_die();\n\n }",
"public function gerenciar(){\n\t\t\n\t\tload_template();\n\t}",
"protected function copyTemplate() {\n\t\t$copyFrom = tx_templavoilaframework_lib::getSkinPath(t3lib_div::_GP('copySkin'));\n\t\t$copyTo = tx_templavoilaframework_lib::getCustomSkinPath();\n\n\t\t$filemounts['1'] = array(\n\t\t\t'name' => $copyTo,\n\t\t\t'path' => PATH_site . $copyTo\n\t\t);\n\t\t$filemounts['2'] = array(\n\t\t\t'name' => 'typo3conf/ext/',\n\t\t\t'path' => PATH_site . 'typo3conf/ext/'\n\t\t);\n\n\t\t$fileCommands = array(\n\t\t\t'copy' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'data' => PATH_site . $copyFrom,\n\t\t\t\t\t'target' => PATH_site . $copyTo,\n\t\t\t\t\t'altName' => 1\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$fileHandler = t3lib_div::makeInstance('t3lib_extFileFunctions');\n\t\t$fileHandler->init($filemounts, $TYPO3_CONF_VARS['BE']['fileExtensions']);\n\t\t$fileHandler->init_actionPerms($GLOBALS['BE_USER']->getFileoperationPermissions());\n\t\t$fileHandler->start($fileCommands);\n\n\t\t$fileHandler->processData();\n\t\t$fileHandler->printLogErrorMessages();\n\t}",
"private function makeDoc() {\n $template_path = $this->file_folder . $this->template->file_guid;\n \n $templateProcessor = new \\PhpOffice\\PhpWord\\TemplateProcessor($template_path);\n \n $fld_arr = $templateProcessor->getVariables();\n\n foreach($fld_arr as $fld)\n {\n $templateProcessor->setValue($fld, $this->getFieldValue($fld));\n }\n \n $this->file_name = $this->getFileName() . \".\" . File::extension($this->template->file_name);\n $this->file_guid = Uuid::generate(4) . \".\" . File::extension($this->template->file_name);\n\n $this->file_path = $this->file_folder . $this->file_guid;\n\n $templateProcessor->saveAs($this->file_path);\n }",
"public function exportDBStruct() {\n $ignore_insert_table = array(\n _DB_PREFIX_ . 'sekeyword', _DB_PREFIX_ . 'statssearch', _DB_PREFIX_ . 'favorite_product',\n _DB_PREFIX_ . 'pagenotfound');\n //copy + export to \n $installFolder = _PS_MODULE_DIR_ . \"leotempcp/install\";\n if (!is_dir($installFolder))\n mkdir($installFolder, 0755);\n $backupfile = $installFolder . \"/db_structure.sql\";\n\n $fp = @fopen($backupfile, 'w');\n if ($fp === false) {\n $this->_html[\"error\"] = \"Error when export DbStruct! Can not write file in leotemcp/install\";\n return false;\n }\n fwrite($fp, 'SET NAMES \\'utf8\\';' . \"\\n\\n\");\n // Find all tables\n $tables = Db::getInstance()->executeS('SHOW TABLES');\n //$found = 0;\n $data = \"\";\n \n foreach ($tables as $table) {\n $table = current($table);\n\n // Skip tables which do not start with _DB_PREFIX_\n if (Tools::strlen($table) < Tools::strlen(_DB_PREFIX_) || strncmp($table, _DB_PREFIX_, Tools::strlen(_DB_PREFIX_)) != 0)\n continue;\n // Export the table schema\n $schema = Db::getInstance()->executeS('SHOW CREATE TABLE `' . $table . '`');\n if (in_array($schema[0]['Table'], $ignore_insert_table)) {\n continue;\n }\n \n $data .= $schema[0]['Create Table'] . \";\\n\\n\";\n if (count($schema) != 1 || !isset($schema[0]['Table']) || !isset($schema[0]['Create Table'])) {\n fclose($fp);\n $this->_html[\"error\"] = \"An error occurred while backing up. Unable to obtain the schema of \".$table;\n return false;\n }\n }\n \n $data = str_replace(\"CREATE TABLE `\" . _DB_PREFIX_, \"CREATE TABLE `PREFIX_\", $data);\n //$tableName = str_replace(_DB_PREFIX_, \"_DB_PREFIX_\", $table);\n fwrite($fp, $data);\n fclose($fp);\n $this->_html[\"confirm\"][] .= 'Create datastruct was successful';\n }",
"public function generate()\n {\n if (!$this->configurationHandler->isTheme() || $this->theme->getName() != $this->configurationHandler->handledTheme()) {\n return;\n }\n\n $templates = array_keys($this->templates[\"template\"]);\n $homepage = json_decode(file_get_contents($this->configurationHandler->pagesDir() . '/' .$this->configurationHandler->homepage() . '/page.json'), true);\n $homepageTemplate = $homepage[\"template\"];\n if (!in_array($homepageTemplate, $templates)) {\n $homepageTemplate = $templates[0];\n }\n\n $themeDefinition = array(\n \"home_template\" => $homepageTemplate,\n \"templates\" => $templates,\n );\n\n $this->synchronizeThemeSlots();\n FilesystemTools::writeFile($this->themeDir . '/theme.json', json_encode($themeDefinition));\n }",
"protected function writeFile(){\n\t\t\t$output = array();\n\t\t\t$output['filename'] = $this->typoscript['fileNameFormat'];\n\t\t\t$output['relative'] = $this->typoscript['renderedPdfStorageFolder'] . $output['filename'];\n\t\t\t$output['absolute'] = t3lib_div::getFileAbsFileName($output['relative']);\n\t\t\t$outputFilename = $output[$this->typoscript['returnFormat']];\n\n\t\t\tif(\n\t\t\tarray_key_exists('createFolders', $this->typoscript)\n\t\t\t&& $this->typoscript['createFolders']\n\t\t\t&& !file_exists(dirname($output['absolute']))\n\t\t\t){\n\t\t\t\tmkdir(dirname($output['absolute']),0777,true);\n\t\t\t}\n\t\t\t$this->pdfTemplate->writeAndClose($output['absolute']);\n\t\t\treturn $outputFilename;\n\n\t\t}",
"public function SaveTemplate()\n {\n $template = Template::where('id', Input::get('id'))->first();\n if(count($template) != 1) {\n $template = new Template;\n }\n\n $templateheader = \"@extends('OS.Templates.templatemaster') @section('template') \";\n $templatedata = str_replace(\">\" , \">\" , Input::get('content'));\n $templatedata = str_replace(\"'\" , \"'\" , $templatedata);\n $templatefooter = \" @stop\";\n\n $template->name = Input::get('name');\n $template->content = \"\";\n $template->type = Input::get('type');\n $template->subgroup = Input::get('subgroup');\n $template->user_id = Auth::user()->id;\n $template->save();\n\n $backup = new TemplateContent;\n $backup->content = $templateheader.$templatedata.$templatefooter;\n $backup->template_id = $template->id;\n $backup->save();\n\n $this->CheckSubgroup($template->type, $template->subgroup);\n\n return ['status' => 'OK', 'id' => $template->id];\n\n }",
"private function cookpage() {\r\n $fn=$this->page_filename;\r\n $buf=$this->page_buffer;\r\n $path=$this->template_path;\r\n $buf=str_replace($path,\"\",$buf);\r\n $fh=fopen($path.$fn.\"_cooked.html\",\"w+\");\r\n if (!$fh)\r\n return false;\r\n fwrite($fh,$buf);\r\n fclose($fh);\r\n\t}",
"function process_backup($smarty, $local_templates_dir, $module_name)\n{\n $opcionesBackup = Array_Options();\n $clavesBackup = array();\n foreach ($opcionesBackup as $opcionBackup) {\n \t$clavesBackup = array_merge($clavesBackup, array_keys($opcionBackup));\n }\n $clavesSeleccion = array_intersect($clavesBackup, array_keys($_POST));\n\n // Ejecución del comando en sí\n $sArchivoBackup = 'elastixbackup-'.date('YmdHis').'-'.substr(session_id(), 0, 1).substr(session_id(), -1, 1).'.tar';\n $sDirBackup = '/var/www/backup';\n $sOpcionesBackup = implode(',', $clavesSeleccion);\n $output = $retval = NULL;\n $sComando = '/usr/bin/elastix-helper backupengine --backup'.\n \" --backupfile $sArchivoBackup\".\n \" --tmpdir $sDirBackup\".\n \" --components $sOpcionesBackup\".\n ' 2>&1';\n exec($sComando, $output, $retval);\n if ($retval == 0) {\n \t$smarty->assign('ERROR_MSG', _tr('Backup Complete!').': '.$sArchivoBackup);\n } else {\n \t$sMensaje = _tr('Could not generate backup file').': '.$sArchivoBackup.'<br/>'.\n _tr('Output follows: ').'<br/><br/>'.\n implode(\"<br/>\\n\", $output);\n $smarty->assign('ERROR_MSG', $sMensaje);\n }\n\n return backup_form($smarty, $local_templates_dir, $module_name);\n}",
"public function generateFile()\n {\n if ($this->agreementTemplate && $this->agreementFlat && $this->agreementClient) {\n $templateFilePathFull = Yii::getAlias('@frontend/web' . $this->agreementTemplate->file);\n if (file_exists($templateFilePathFull)) {\n $templateProcessor = new \\common\\override\\PhpWord\\TemplateProcessor($templateFilePathFull);\n \n // image\n if ($this->getPlanImage(true)) {\n $templateProcessor->setImageValueRaw('image1.jpeg', $this->getPlanImage(true));\n }\n\n // plan\n $templateProcessor->cloneRow('ROW_N', $this->flat->getPayments()->count());\n \n $cashboxUsd = Cashbox::getCashboxByCurrency(Cashbox::CURRENCY_USD);\n $paymentPricePlanTotal = 0;\n $paymentPricePlanUahTotal = 0;\n foreach ($this->flat->payments as $k => $payment) {\n $paymentPricePlan = round($payment->price_plan, 2);\n $paymentPricePlanUah = round($cashboxUsd->rate * $payment->price_plan, 2);\n $paymentPricePlanTotal += $paymentPricePlan;\n $paymentPricePlanUahTotal += $paymentPricePlanUah;\n \n $r = $k + 1;\n $templateProcessor->setValue('ROW_N#' . $r, $payment->pay_number);\n $templateProcessor->setValue('ROW_USD#' . $r, $paymentPricePlan);\n $templateProcessor->setValue('ROW_UAH#' . $r, $paymentPricePlanUah);\n $templateProcessor->setValue('ROW_DATE#' . $r, $payment->getPayDate());\n }\n \n // text values\n $templateProcessor->setValue([\n 'HOUSE_ADDRESS',\n 'HOUSE_NAME',\n 'FLAT_NUMBER_INDEX',\n 'CLIENT_FULLNAME_SHORT',\n 'CLIENT_FULLNAME',\n 'AGREEMENT_DATE',\n 'AGREEMENT_NUMBER',\n \n 'CLIENT_BIRTHDATE_TEXT',\n 'CLIENT_PASSPORT_SERIES',\n 'CLIENT_PASSPORT_NUMBER',\n 'CLIENT_PASSPORT_FROM',\n 'CLIENT_INN',\n 'CLIENT_PHONE',\n 'FLAT_SQUARE',\n 'FLAT_FLOOR',\n 'PRICE_UAH',\n 'PRICE_UAH_TEXT',\n 'PRICE_USD',\n 'PRICE_USD_TEXT',\n 'RATE_USD',\n 'RATE_USD_TEXT',\n 'HOUSE_SECTION',\n 'FLAT_BUILD_NUMBER',\n 'HOUSE_COMPANY_REG_INFO',\n 'PAYMENT_PRICE_TOTAL_USD',\n 'PAYMENT_PRICE_TOTAL_UAH',\n //'FLAT_FLOOR_PLAN_IMG',\n //'PAYMENT_PLAN',\n ], [\n $this->tpl_house_address ?: $this->agreementFlat->address,\n $this->flat->house->name,\n $this->agreementFlat->number . ($this->agreementFlat->number_index ? ('/' . $this->agreementFlat->number_index) : ''),\n $this->tpl_client_fullname_short ?: ($this->agreementClient->lastname \n . ($this->agreementClient->firstname ? ' ' . mb_substr($this->agreementClient->firstname, 0, 1) . '.' : '')\n . ($this->agreementClient->middlename ? ' ' . mb_substr($this->agreementClient->middlename, 0, 1) . '.' : '')),\n $this->tpl_client_fullname ?: ($this->agreementClient->lastname \n . ($this->agreementClient->firstname ? ' ' . $this->agreementClient->firstname : '')\n . ($this->agreementClient->middlename ? ' ' . $this->agreementClient->middlename : '')),\n $this->getUidDate(),\n $this->uid,\n \n $this->tpl_client_birthdate_text ?: $this->agreementClient->birthdateText,\n $this->agreementClient->passport_series,\n $this->agreementClient->passport_number,\n $this->tpl_client_passport_from ?: $this->agreementClient->passport_from,\n $this->agreementClient->inn,\n $this->agreementClient->phone,\n $this->agreementFlat->square,\n $this->agreementFlat->floor,\n PriceHelper::format($this->agreementFlat->getPriceForCashbox(Cashbox::CURRENCY_UAH), false, false, '', '', ''),\n $this->agreementFlat->getPriceTextForCashbox(Cashbox::CURRENCY_UAH),\n PriceHelper::format($this->agreementFlat->getPriceForCashbox(Cashbox::CURRENCY_USD), false, false, '', '', ''),\n $this->agreementFlat->getPriceTextForCashbox(Cashbox::CURRENCY_USD),\n round($this->agreementFlat->rate, 2),\n $this->agreementFlat->getRateText(),\n $this->flat->house->section,\n $this->flat->getBuildNumber(),\n $this->flat->house->getCompanyRegInfo(),\n $paymentPricePlanTotal,\n $paymentPricePlanUahTotal\n //$this->flat->getFloorFlatImg(true, false),\n //'TMP', // $this->flat->getPaymentPlanForAgreement($this),\n ]);\n \n // save file\n $path = '/upload/Agreement/' . $this->id . '/agreement-'.$this->uid.'.docx';\n $pathFull = Yii::getAlias('@frontend/web' . $path);\n $dir = dirname($pathFull);\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n \n $templateProcessor->saveAs($pathFull);\n }\n }\n }",
"function get_maintemplate ( $PATH_PREFIX = \"\", $BASE = FALSE )\r\n{\r\n global $global_config_arr, $db, $TEXT;\r\n\r\n // Main Template\r\n $template = '\r\n{..doctype..}\r\n<html lang=\"'.$global_config_arr['language'].'\">\r\n <head>\r\n {..base..}{..title..}{..meta..}{..link..}{..script..}\r\n </head>\r\n\r\n {..body..}\r\n</html>\r\n ';\r\n // Get Doctype\r\n $template_doctype = new template();\r\n $template_doctype->setFile(\"0_general.tpl\");\r\n $template_doctype->load(\"DOCTYPE\");\r\n $template_doctype = $template_doctype->display();\r\n \r\n // Base for Images\r\n if ( $BASE !== FALSE ) { echo \"a\";\r\n $template_base = '<base href=\"'.$BASE .'\">\r\n ';\r\n } else {\r\n $template_base = \"\";\r\n }\r\n\r\n // Create link-Rows\r\n $template_link = \"\";\r\n if ( $global_config_arr['show_favicon'] == 1 ) {\r\n $template_link .= '\r\n <link rel=\"shortcut icon\" href=\"styles/'.$global_config_arr['style'].'/icons/favicon.ico\">';\r\n }\r\n $template_link .= '\r\n <link rel=\"alternate\" type=\"application/rss+xml\" href=\"'.$PATH_PREFIX .'feeds/'.$global_config_arr['feed'].'.php\" title=\"'.$global_config_arr['title'].' '.$TEXT->get(\"news_feed\").'\">\r\n '. get_css ( $PATH_PREFIX );\r\n\r\n // Create script-Rows\r\n $template_script = \"\";\r\n $template_script .= '\r\n <script type=\"text/javascript\" src=\"'.$PATH_PREFIX .'resources/jquery/jquery-1.4.min.js\"></script>'. get_js ( $PATH_PREFIX ) .'\r\n <script type=\"text/javascript\" src=\"'.$PATH_PREFIX .'includes/js_functions.js\"></script>';\r\n\r\n // Replace Placeholders\r\n $template = str_replace(\"{..doctype..}\", $template_doctype, $template);\r\n $template = str_replace(\"{..base..}\", $template_base, $template);\r\n $template = str_replace(\"{..title..}\", \"<title>\".get_title().\"</title>\", $template);\r\n $template = str_replace(\"{..meta..}\", get_meta (), $template);\r\n $template = str_replace(\"{..link..}\", $template_link, $template);\r\n $template = str_replace(\"{..script..}\", $template_script, $template);\r\n\r\n // Return Template\r\n return $template;\r\n}",
"abstract public function template();",
"function formatTemplateFile(Control $control);",
"function _template_uninstall()\n{\n}",
"public function backup_structure()\n\t{\n\t\t// TODO Implement Backup function\n\t\treturn '';\n\t}"
] | [
"0.6482994",
"0.6455974",
"0.64249265",
"0.61870486",
"0.6185206",
"0.6161589",
"0.6094677",
"0.6081187",
"0.6064088",
"0.6011594",
"0.60060465",
"0.60007",
"0.5973058",
"0.59582734",
"0.5937962",
"0.59374523",
"0.5892163",
"0.58899",
"0.5887767",
"0.58722574",
"0.5835403",
"0.5821278",
"0.58012867",
"0.5773634",
"0.57561576",
"0.5739357",
"0.57237226",
"0.56879115",
"0.5687621",
"0.56721205"
] | 0.7169331 | 0 |
Lazy load function to prevent regex from being stuffed in cache. | protected function _loadRegex()
{
$oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255
$this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRegEx();",
"public static function needCache()\n\t{\n\t\treturn defined('static::ENABLE_SLUG_CACHE') ? static::ENABLE_SLUG_CACHE : false;\n\t}",
"public function define_caching(){}",
"function recompileCache()\n {\n }",
"private function getRegex(): string\n {\n if ($this->compiled === null) {\n $this->compiled = $this->compileRegex();\n }\n\n return $this->compiled;\n }",
"public static function mla_reset_regex_matches() {\r\n\t\tMLAData::$regex_matches = array();\r\n\t}",
"public static function __static() {\n # Check whether we have initialized the regular expressions:\n static $initialized = false;\n if ($initialized) return;\n # Get a shorter reference to the regular expression array:\n $re =& self::$patterns;\n # Initialise local storage arrays:\n $tmp = array();\n\n # Expression to match at and hash sign characters:\n $tmp['at_signs'] = '@@';\n $tmp['hash_signs'] = '##';\n\n # Expression to match latin accented characters.\n #\n # 0x00C0-0x00D6\n # 0x00D8-0x00F6\n # 0x00F8-0x00FF\n # 0x0100-0x024f\n # 0x0253-0x0254\n # 0x0256-0x0257\n # 0x0259\n # 0x025b\n # 0x0263\n # 0x0268\n # 0x026f\n # 0x0272\n # 0x0289\n # 0x028b\n # 0x02bb\n # 0x0300-0x036f\n # 0x1e00-0x1eff\n #\n # Excludes 0x00D7 - multiplication sign (confusable with 'x').\n # Excludes 0x00F7 - division sign.\n $tmp['latin_accents'] = '\\x{00c0}-\\x{00d6}\\x{00d8}-\\x{00f6}\\x{00f8}-\\x{00ff}';\n $tmp['latin_accents'] .= '\\x{0100}-\\x{024f}\\x{0253}-\\x{0254}\\x{0256}-\\x{0257}';\n $tmp['latin_accents'] .= '\\x{0259}\\x{025b}\\x{0263}\\x{0268}\\x{026f}\\x{0272}\\x{0289}\\x{028b}\\x{02bb}\\x{0300}-\\x{036f}\\x{1e00}-\\x{1eff}';\n\n # Expression to match non-latin characters.\n #\n # Cyrillic (Russian, Ukranian, ...):\n #\n # 0x0400-0x04FF Cyrillic\n # 0x0500-0x0527 Cyrillic Supplement\n # 0x2DE0-0x2DFF Cyrillic Extended A\n # 0xA640-0xA69F Cyrillic Extended B\n $tmp['non_latin_chars'] = '\\x{0400}-\\x{04ff}\\x{0500}-\\x{0527}\\x{2de0}-\\x{2dff}\\x{a640}-\\x{a69f}';\n # Hebrew:\n #\n # 0x0591-0x05bf Hebrew\n # 0x05c1-0x05c2\n # 0x05c4-0x05c5\n # 0x05c7\n # 0x05d0-0x05ea\n # 0x05f0-0x05f4\n # 0xfb12-0xfb28 Hebrew Presentation Forms\n # 0xfb2a-0xfb36\n # 0xfb38-0xfb3c\n # 0xfb3e\n # 0xfb40-0xfb41\n # 0xfb43-0xfb44\n # 0xfb46-0xfb4f\n $tmp['non_latin_chars'] .= '\\x{0591}-\\x{05bf}\\x{05c1}-\\x{05c2}\\x{05c4}-\\x{05c5}\\x{05c7}\\x{05d0}-\\x{05ea}\\x{05f0}-\\x{05f4}';\n $tmp['non_latin_chars'] .= '\\x{fb12}-\\x{fb28}\\x{fb2a}-\\x{fb36}\\x{fb38}-\\x{fb3c}\\x{fb3e}\\x{fb40}-\\x{fb41}\\x{fb43}-\\x{fb44}\\x{fb46}-\\x{fb4f}';\n # Arabic:\n #\n # 0x0610-0x061a Arabic\n # 0x0620-0x065f\n # 0x066e-0x06d3\n # 0x06d5-0x06dc\n # 0x06de-0x06e8\n # 0x06ea-0x06ef\n # 0x06fa-0x06fc\n # 0x06ff\n # 0x0750-0x077f Arabic Supplement\n # 0x08a0 Arabic Extended A\n # 0x08a2-0x08ac\n # 0x08e4-0x08fe\n # 0xfb50-0xfbb1 Arabic Pres. Forms A\n # 0xfbd3-0xfd3d\n # 0xfd50-0xfd8f\n # 0xfd92-0xfdc7\n # 0xfdf0-0xfdfb\n # 0xfe70-0xfe74 Arabic Pres. Forms B\n # 0xfe76-0xfefc\n $tmp['non_latin_chars'] .= '\\x{0610}-\\x{061a}\\x{0620}-\\x{065f}\\x{066e}-\\x{06d3}\\x{06d5}-\\x{06dc}\\x{06de}-\\x{06e8}\\x{06ea}-\\x{06ef}\\x{06fa}-\\x{06fc}\\x{06ff}';\n $tmp['non_latin_chars'] .= '\\x{0750}-\\x{077f}\\x{08a0}\\x{08a2}-\\x{08ac}\\x{08e4}-\\x{08fe}';\n $tmp['non_latin_chars'] .= '\\x{fb50}-\\x{fbb1}\\x{fbd3}-\\x{fd3d}\\x{fd50}-\\x{fd8f}\\x{fd92}-\\x{fdc7}\\x{fdf0}-\\x{fdfb}\\x{fe70}-\\x{fe74}\\x{fe76}-\\x{fefc}';\n #\n # 0x200c-0x200c Zero-Width Non-Joiner\n # 0x0e01-0x0e3a Thai\n $tmp['non_latin_chars'] .= '\\x{200c}\\x{0e01}-\\x{0e3a}';\n # Hangul (Korean):\n #\n # 0x0e40-0x0e4e Hangul (Korean)\n # 0x1100-0x11FF Hangul Jamo\n # 0x3130-0x3185 Hangul Compatibility Jamo\n # 0xA960-0xA97F Hangul Jamo Extended A\n # 0xAC00-0xD7AF Hangul Syllables\n # 0xD7B0-0xD7FF Hangul Jamo Extended B\n # 0xFFA1-0xFFDC Half-Width Hangul\n $tmp['non_latin_chars'] .= '\\x{0e40}-\\x{0e4e}\\x{1100}-\\x{11ff}\\x{3130}-\\x{3185}\\x{a960}-\\x{a97f}\\x{ac00}-\\x{d7af}\\x{d7b0}-\\x{d7ff}\\x{ffa1}-\\x{ffdc}';\n\n # Expression to match other characters.\n #\n # 0x30A1-0x30FA Katakana (Full-Width)\n # 0x30FC-0x30FE Katakana (Full-Width)\n # 0xFF66-0xFF9F Katakana (Half-Width)\n # 0xFF10-0xFF19 Latin (Full-Width)\n # 0xFF21-0xFF3A Latin (Full-Width)\n # 0xFF41-0xFF5A Latin (Full-Width)\n # 0x3041-0x3096 Hiragana\n # 0x3099-0x309E Hiragana\n # 0x3400-0x4DBF Kanji (CJK Extension A)\n # 0x4E00-0x9FFF Kanji (Unified)\n # 0x20000-0x2A6DF Kanji (CJK Extension B)\n # 0x2A700-0x2B73F Kanji (CJK Extension C)\n # 0x2B740-0x2B81F Kanji (CJK Extension D)\n # 0x2F800-0x2FA1F Kanji (CJK supplement)\n # 0x3003 Kanji (CJK supplement)\n # 0x3005 Kanji (CJK supplement)\n # 0x303B Kanji (CJK supplement)\n $tmp['cj_characters'] = '\\x{30A1}-\\x{30FA}\\x{30FC}-\\x{30FE}\\x{FF66}-\\x{FF9F}\\x{FF10}-\\x{FF19}\\x{FF21}-\\x{FF3A}\\x{FF41}-\\x{FF5A}\\x{3041}-\\x{3096}\\x{3099}-\\x{309E}\\x{3400}-\\x{4DBF}\\x{4E00}-\\x{9FFF}\\x{3003}\\x{3005}\\x{303B}\\x{020000}-\\x{02a6df}\\x{02a700}-\\x{02b73f}\\x{02b740}-\\x{02b81f}\\x{02f800}-\\x{02fa1f}';\n\n $tmp['tag_alpha'] = '[a-z_'.$tmp['latin_accents'].$tmp['non_latin_chars'].$tmp['cj_characters'].']';\n $tmp['tag_alphanumeric'] = '[a-z0-9_'.$tmp['latin_accents'].$tmp['non_latin_chars'].$tmp['cj_characters'].']';\n $tmp['tag_boundary'] = '(?:\\A|\\z|[^&a-z0-9_'.$tmp['latin_accents'].$tmp['non_latin_chars'].$tmp['cj_characters'].'])';\n $tmp['hashtag'] = '('.$tmp['tag_boundary'].')(#|#)('.$tmp['tag_alphanumeric'].'*'.$tmp['tag_alpha'].$tmp['tag_alphanumeric'].'*)';\n\n\n $tmp['hashtag'] = '(' . $tmp['tag_boundary'] . ')([' . $tmp['hash_signs'] . '])(' . $tmp['tag_alphanumeric'] . '*' . $tmp['tag_alpha'] . $tmp['tag_alphanumeric'] . '*)';\n $re['valid_hashtag'] = '/' . $tmp['hashtag'] . '(?=(.*|$))/iu';\n\n $tmp['usertag'] = '(' . $tmp['tag_boundary'] . ')([' . $tmp['at_signs'] . '])(' . $tmp['tag_alphanumeric'] . '*' . $tmp['tag_alpha'] . $tmp['tag_alphanumeric'] . '*)';\n $re['valid_usertag'] = '/' . $tmp['usertag'] . '(?=(.*|$))/iu';\n\n # Flag that initialization is complete:\n $initialized = true;\n }",
"protected function _extendRegex()\n {\n return [];\n }",
"public function cached();",
"public function maybeByPassCache();",
"public function loadCache();",
"function recompileCache()\n\t{\n\t}",
"public static function getRegexPattern();",
"public function testParseLineCachedPattern()\n {\n /** @var \\PHPUnit_Framework_MockObject_MockObject|AccessLogParser $parser */\n $parser = $this->getMock(\n '\\\\MVar\\\\Apache2LogParser\\\\AccessLogParser',\n ['getCallbackPatterns'],\n ['%%']\n );\n\n $parser->expects($this->once())->method('getCallbackPatterns');\n\n $parser->parseLine('%');\n\n // Pattern should be cached\n $parser->parseLine('%');\n }",
"public function fix_lazyload_src()\n {\n static $pattern =\n [\n '#src=\"/static/images/pixel\\.gif\" alt=\"(.*)\" (.*)title=\"(.*)\"#Uui',\n '#class=\"content-image-float(left|right)\"#'\n ];\n\n static $replacement = ['src=\"\\\\3\" alt=\"\\\\1\" title=\"\\\\1\" \\\\2', 'style=\"float:\\\\1\"'];\n return preg_replace($pattern, $replacement, $this->string);\n }",
"public function testShouldBeImuuneOFRegexDenialOfServiceAttack(): void\n {\n $startTime = microtime(true);\n\n $purifiedHtml = $this->purifier->purify($this->rawHtml);\n\n $endTime = microtime(true);\n\n $executionTimeInSeconds = ($endTime - $startTime) * 1000;\n\n $this->assertGreaterThan(\n self::PURIFING_MAX_EXECUTION_TIME,\n $executionTimeInSeconds,\n \"Result must be equals to pre purified content.\"\n );\n }",
"function regex($regex) {\n return '~' . LIB . '(?:' . str_replace('~', '\\~', $regex) . ')~';\n}",
"function &setFileCache() {\n static $cache;\n if(!isset($cache)) {\n\t\t$cache = new I18Ncache();\n } // end if\n return $cache;\n}",
"public function restore_cache_invalidation()\n {\n }",
"protected function processRegex($path) {\n\n $slashPlaceholder = null;\n if (strpos($path, '%2F')) {\n $i = 0;\n do {\n $slashPlaceholder = 's42' . $i;\n $i++;\n\n $isUnique = strpos($path, $slashPlaceholder) === false;\n $isUnique = $isUnique && strpos($this->compiledRegex, $slashPlaceholder) === false;\n\n } while (!$isUnique);\n $path = str_replace('%2F', $slashPlaceholder, $path);\n }\n\n $path = rawurldecode($path);\n\n $regex = \"(^\" . $this->compiledRegex . \"$)\";\n\n\n if (preg_match($regex, $path, $matches)) {\n $resultParams = [];\n foreach ($matches as $paramName => $paramValue) {\n if (!is_int($paramName) && $paramValue !== '') {\n if (!is_null($slashPlaceholder)) {\n $paramValue = str_replace($slashPlaceholder, '/', $paramValue);\n }\n $resultParams[$paramName] = $paramValue;\n }\n }\n return $resultParams;\n } else {\n return null;\n }\n }",
"public function loadFromCache($text = '') {\n\t\tif (__CACHE::getInstance()->get(md5($text) != '')) {\n\t\t\treturn __CACHE::getInstance()->get(md5($text));\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public function loadExtractorsFromCache($class);",
"function safe_scrape_cached($url, $cache_time = CACHE_TIME){\n\n\t\t$cache = cache::factory($cache_time);\n\n\t\t$cached = $cache->get($url);\n\t\tif (isset($cached) && $cached !== false) {\n\t\t\treturn $cached;\n\t\t}else{\n\t\t\t$page = safe_scrape($url);\n\t\t $cache->set($url, $page, \"safe_scrape\");\t\n\t\t\treturn $page;\n\t\t}\n\t\t\n\t}",
"function fielding_dont_cache() {\n\tdefine('DONOTCACHEPAGE', 1);\n}",
"public function providerRegex()\n\t{\n\t\treturn array(\n\t\t\tarray('hello world', '/[a-zA-Z\\s]++/', TRUE),\n\t\t\tarray('123456789', '/[0-9]++/', TRUE),\n\t\t\tarray('£$%£%', '/[abc]/', FALSE),\n\t\t\tarray('Good evening', '/hello/', FALSE),\n\t\t);\n\t}",
"public function getRegexp();",
"function page_cache_disable_caching() {}",
"function check_rules_cache() {\n $path = w3_get_minify_rules_cache_path();\n $search = $this->generate_rules_cache();\n\n return (($data = @file_get_contents($path)) && strstr(w3_clean_rules($data), w3_clean_rules($search)) !== false);\n }",
"public static function enableSubstCache()\n {\n self::$substCacheEnabled = true;\n }",
"public function cache();"
] | [
"0.5742227",
"0.56660944",
"0.5570154",
"0.54731923",
"0.54656774",
"0.5455077",
"0.53750294",
"0.53688425",
"0.5338707",
"0.5305307",
"0.5281407",
"0.52743626",
"0.5170624",
"0.51676875",
"0.5167185",
"0.5145172",
"0.5130521",
"0.5124241",
"0.5105148",
"0.5093814",
"0.5090386",
"0.5077019",
"0.5022109",
"0.5017073",
"0.5014946",
"0.49923128",
"0.49921414",
"0.49883702",
"0.49726996",
"0.49576673"
] | 0.5744925 | 0 |
Get all cities from DPD and store it in Cache | public function getCities()
{
if (Cache::has(self::DPD_CITIES_CACHE_NAME)) {
$cities = collect(Cache::get(self::DPD_CITIES_CACHE_NAME));
}
else {
$cities = Cache::remember(self::DPD_CITIES_CACHE_NAME, $this->client->cacheLifeTimeInMinutes, function () {
$data['auth'] = $this->client->getAuthData();
$request['request'] = $data; //помещаем наш масив авторизации в масив запроса request.
$result = $this->soapClient->getCitiesCashPay($request); //обращаемся к функции getCitiesCashPay и получаем список городов.
$result = self::stdToArray($result);
return collect($result['return']);
});
}
return $cities;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __getAllCity()\r\n {\r\n $this->allCityArray = array();\r\n $content = file_get_contents(self::CITY_URL);\r\n $reg = \"/<dl class=\\\"city-mod\\\">(.+?)<\\/dl>/is\";\r\n $regid = \"/<span><a[^>].+? id=\\\"(.+?)\\\".+?>.+?<\\/a><\\/span>/is\";\r\n $reguid = \"/<span><a[^>].+? uid=\\\"(.+?)\\\">.+?<\\/a><\\/span>/si\";\r\n $regname = \"/<span><a[^>].+?>(.+?)<\\/a><\\/span>/si\";\r\n $regchar = \"/<dt>(.+?)<\\/dt>/si\";\r\n\r\n preg_match_all($reg,$content,$match);\r\n $cityStrArray = $match[1];\r\n foreach($cityStrArray as $v)\r\n {\r\n //获取A,B,C,D\r\n preg_match($regchar,$v,$match);\r\n $charkey = $match[1];\r\n //获取豆瓣城市ID\r\n preg_match_all($regid,$v,$match);\r\n $this->allCityArray[$charkey]['id'] = $match[1];\r\n //获取豆瓣城市拼音\r\n preg_match_all($reguid,$v,$match);\r\n $this->allCityArray[$charkey]['zh_name'] = $match[1];\r\n //获取豆瓣城市名称\r\n preg_match_all($regname,$v,$match);\r\n $this->allCityArray[$charkey]['name'] = $match[1];\r\n }\r\n }",
"abstract public function getCitiesList();",
"public function getAllCities(): array{\n\t\treturn $this->db->select(\"SELECT * FROM cities\");\n\t}",
"public function getAll()\n {\n $cityDAO = new CityDAO();\n $cities = $cityDAO->getAll();\n \n return $cities;\n }",
"public function getCityList()\n {\n return Mage::getResourceModel('stores/stores')->getCityList();\n }",
"public function getCities() {\r\n \r\n $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_realtymanager_domain_model_objectimmo');\r\n $sql = \"SELECT uid, title from tx_realtymanager_domain_model_cities order by uid\";\r\n \r\n $cities = $connection->executeQuery($sql)->fetchAll();\r\n return $cities;\r\n }",
"public function get_cities(){\n $DB = Database::newInstance();\n $query = \"SELECT * FROM tbl_cities ORDER BY id DESC\";\n $data = $DB->read_db($query);\n\n return $data;\n }",
"public function cities() {\n\n $this->autoRender = false;\n\n $cities_tbl = TableRegistry::get('tbl_cities');\n\n $results = $cities_tbl->find(\"all\")->all()->toArray();\n\n $cities_array = array();\n\n foreach ($results as $cities):\n array_push($cities_array, array(\n \"id\" => $cities->id,\n \"state_id\" => $cities->state_id,\n \"name\" => $cities->name\n ));\n endforeach;\n\n $this->json(1, 'cities found', $cities_array);\n }",
"public static function getAllCities() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $sql = sprintf('select distinct(city.city) as city from restaurants inner join city on restaurants.cityId=city.id order by city.city');\n $result = $db->fetchAll($sql);\n return $result;\n }",
"private function cities()\n {\n try {\n $cities = DB::table('venues')\n ->join('locations', 'locations.id', '=' ,'venues.location_id')\n ->select('locations.city')\n ->where('venues.is_featured','>',0)\n ->whereNotNull('venues.logo_url')\n ->orderBy('locations.city')->groupBy('locations.city')\n ->distinct()->get();\n return $cities;\n } catch (Exception $ex) {\n return [];\n }\n }",
"function getAllCity(){\n\t\n\t \t\tApp::import('model','City');\n\t\t $this->City = new City(); \n\t\t\t\n\t\t\t$CitiesList = $this->City->find('list', array('fields' => array('id', 'cityname'),'order' => 'City.cityname ASC','recursive' => -1,'conditions' => array('City.publish' => 'yes'))); \n\t\t\t\n\t\t\treturn $CitiesList;\n\t }",
"public function getAllCitiesByCountryID()\n\t{\n\t\t//retrieve the country ID\n\t\t$pCountryID = Input::get('country_id');\n\n\t\t$cities = $this -> cityRepo -> getAllCitiesByCountryID($pCountryID);\n\n\t\treturn json_encode($cities);\n\t}",
"public function getAll()\n {\n try\n {\n return $this->db->get('city')->result_array();\n }\n catch(Exception $e)\n {\n return false;\n }\n }",
"function get_cities_in_state( $settings = array() ){\n\t\tif( isset( $_SESSION['temp_storage']['selected_state_id'] ) && $_SESSION['temp_storage']['selected_state_id'] ){\n $settings['state_id'] = $_SESSION['temp_storage']['selected_state_id'];\n }\n $return = array();\n if( isset( $settings['state_id'] ) && $settings['state_id'] ){\n\t\t\t$cache_key = 'cities_list';\n\t\t\t$cached_values = get_from_cached( array(\n\t\t\t\t'cache_key' => $cache_key . '-' . $settings['state_id'],\n\t\t\t\t'directory_name' => $cache_key,\n\t\t\t) );\n \n if( is_array($cached_values) ){\n foreach( $cached_values as $id => $val ){\n if( isset( $val['city'] ) )\n $return[ $id ] = $val['city'];\n }\n }\n\t\t}\n return $return;\n\t}",
"public function admin_getCities() {\t\t\n\t\t$cities = array();\n\t\tif (isset($this->request['data']['id'])) {\n\t\t\t$cities = $this->City->find('list', array(\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'id',\n\t\t\t\t\t'city',\n\t\t\t\t),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'City.state_id' => $this->request['data']['id']\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($cities);\n\t\texit();\n\t}",
"public function getCities($stateId)\n {\n $query = \" SELECT city FROM $this->cityTable WHERE stateId = :stateId \";\n $exist = $this->conn->prepare($query);\n $exist->bindParam(\":stateId\",$stateId);\n $exist->execute();\n while($row = $exist->fetch(PDO::FETCH_ASSOC)){\n $data[]=$row[\"city\"];\n }\n return $data;\n }",
"public static function getAllCitiesWithOrders() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $sql = sprintf('select distinct(orte.ort) as city from restaurants inner join orders on orders.restaurantId=restaurants.id join orte on restaurants.plz=orte.plz where orders.state>0 and restaurants.isOnline=0 and restaurants.status=0 and restaurants.deleted=0 order by city');\n $result = $db->fetchAll($sql);\n return $result;\n }",
"function get_countries_data(){\n $cache_key = 'country_list';\n $cached_values = get_from_cached( array(\n 'cache_key' => $cache_key,\n ) );\n \n if( isset( $cached_values ) && $cached_values ){\n return $cached_values;\n }\n \n\t\treturn array();\n\t}",
"public static function getAllDataFromLocality() {\n $rs = Yii::app()->cache->get('exc_getAllDataFromLocality');\n if ($rs === false) {\n $sql = 'SELECT `id`, `name` FROM `tbl_location` WHERE `parentId` = 0 ORDER BY `order` DESC, `id`, `name` ASC';\n $command = Yii::app()->db->createCommand($sql);\n $rs = $command->queryAll();\n Yii::app()->cache->set('exc_getAllDataFromLocality', $rs, 600);\n }\n return $rs;\n }",
"public function getCitiesByState($state){\n\t\t// Instantiate CityDataService\n\t\t$CityDataService = new Service\\CityDataService($this->_App['db']);\n\n\t\t// Determine state type\n\t\t$stateType = Service\\StateDataService::getStateType($state);\n\n\t\t// Lookup cities\n\t\t$returnArray = $CityDataService->fetchByState($state, $stateType);\n\t\t\n\t\tif($this->_format === 'json'){\n\t\t\treturn json_encode($returnArray);\n\t\t} else {\n\t\t\treturn $returnArray;\n\t\t}\n\t}",
"function getAllCityByCounty($countyid){\n\t\n\t \t\tApp::import('model','City');\n\t\t $this->City = new City(); \n\t\t\t\n\t\t\t$CityList = $this->City->find('list', array('fields' => array('id', 'cityname'),'order' => 'City.cityname ASC','recursive' => -1,'conditions' => array('City.publish' => 'yes','City.county_id' => $countyid))); \n\t\t\t\n\t\t\treturn $CityList;\n\t }",
"public function fetchAll() {\n\t\t$translator = Lumia_Translator::get ();\n\t\t\n\t\t$continents = array (\n\t\t\t\t'Africa',\n\t\t\t\t'America',\n\t\t\t\t'Antarctica',\n\t\t\t\t'Arctic',\n\t\t\t\t'Asia',\n\t\t\t\t'Atlantic',\n\t\t\t\t'Australia',\n\t\t\t\t'Europe',\n\t\t\t\t'Indian',\n\t\t\t\t'Pacific' \n\t\t);\n\t\t\n\t\t$zonen = array ();\n\t\tforeach ( timezone_identifiers_list () as $zone ) {\n\t\t\t$zone = explode ( '/', $zone );\n\t\t\t\n\t\t\tif (! in_array ( $zone [0], $continents )) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// This determines what gets set and translated - we don't translate Etc/* strings here, they are done later\n\t\t\t$exists = array (\n\t\t\t\t\t0 => (isset ( $zone [0] ) && $zone [0]),\n\t\t\t\t\t1 => (isset ( $zone [1] ) && $zone [1]),\n\t\t\t\t\t2 => (isset ( $zone [2] ) && $zone [2]) \n\t\t\t);\n\t\t\t$exists [3] = ($exists [0] && 'Etc' !== $zone [0]);\n\t\t\t$exists [4] = ($exists [1] && $exists [3]);\n\t\t\t$exists [5] = ($exists [2] && $exists [3]);\n\t\t\t\n\t\t\t$continent = ($exists [0] ? $zone [0] : '');\n\t\t\t$tContinent = ($exists [3] ? $translator->translate ( str_replace ( '_', ' ', $zone [0] ) ) : '');\n\t\t\t$city = ($exists [1] ? $zone [1] : '');\n\t\t\t$tCity = ($exists [4] ? $translator->translate ( str_replace ( '_', ' ', $zone [1] ) ) : '');\n\t\t\t$subCity = ($exists [2] ? $zone [2] : '');\n\t\t\t$tSubcity = ($exists [5] ? $translator->translate ( str_replace ( '_', ' ', $zone [2] ) ) : '');\n\t\t\t\n\t\t\tif (! array_key_exists ( $continent, $zonen )) {\n\t\t\t\t$zonen [$continent] = array ();\n\t\t\t}\n\t\t\t\n\t\t\t// Build value in an array to join later\n\t\t\t$value = array ( $continent );\n\t\t\t\n\t\t\tif (empty ( $city )) {\n\t\t\t\t// It's at the continent level (generally won't happen)\n\t\t\t\t$display = $tContinent;\n\t\t\t} else {\n\t\t\t\t// It's inside a continent group\n\t\t\t\t\n\t\t\t\t// Add the city to the value\n\t\t\t\t$value [] = $city;\n\t\t\t\t\n\t\t\t\t$display = $tCity;\n\t\t\t\tif (! empty ( $subCity )) {\n\t\t\t\t\t// Add the subcity to the value\n\t\t\t\t\t$value [] = $subCity;\n\t\t\t\t\t$display .= ' - ' . $tSubcity;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Build the value\n\t\t\t$value = join ( '/', $value );\n\t\t\t\n\t\t\t$zonen [$continent][$value] = $display;\n\t\t}\n\t\t\n\t\t// Do UTC\n\t\t$utcLabel = $translator->translate ('UTC');\n\t\t$zonen [$utcLabel]['UTC'] = $utcLabel;\n\t\t\n\t\t// Do manual UTC offsets\n\t\t$manualOffsetsLabel = $translator->translate ('Manual Offsets');\n\t\t$zonen[$manualOffsetsLabel] = array();\n\t\t$offset_range = array (-12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5,\n\t\t0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14);\n\t\tforeach ( $offset_range as $offset ) {\n\t\t\tif (0 <= $offset)\n\t\t\t\t$offsetName = '+' . $offset;\n\t\t\telse\n\t\t\t\t$offsetName = ( string ) $offset;\n\t\t\t\n\t\t\t$offsetValue = $offsetName;\n\t\t\t$offsetName = str_replace ( array ( '.25', '.5', '.75' ), array ( ':15', ':30', ':45' ), $offsetName );\n\t\t\t$offsetName = 'UTC' . $offsetName;\n\t\t\t$offsetValue = 'UTC' . $offsetValue;\n\t\t\t$zonen [$manualOffsetsLabel][$offsetValue] = $offsetName;\n\t\t}\n\t\t\n\t\treturn $zonen;\n\t}",
"public static function getKnownCitys() {\n if (self::$_knownLocations === null) {\n self::$_knownLocations = array();\n $return = array();\n $result = db_query('select field_address_city_value from {field_data_field_address_city} group by field_address_city_value');\n foreach ($result as $entity) {\n $return[strtolower($entity->field_address_city_value)] = strtolower($entity->field_address_city_value);\n }\n self::$_knownLocations = $return;\n }\n return self::$_knownLocations;\n }",
"public static function getCities($stateId) {\n try {\n $query = \"SELECT id, name FROM cities WHERE state_id=\".$stateId;\n $result = dbconfig::run($query);\n if(!$result) {\n throw new exception(\"City not found.\");\n }\n $res = array();\n while($resultSet = mysqli_fetch_assoc($result)) {\n $res[$resultSet['id']] = $resultSet['name'];\n }\n $data = array('status'=>'success', 'tp'=>1, 'msg'=>\"Cities fetched successfully.\", 'result'=>$res);\n } catch (Exception $e) {\n $data = array('status'=>'error', 'tp'=>0, 'msg'=>$e->getMessage());\n } finally {\n return $data;\n }\n }",
"public static function getCities($stateId) {\n try {\n $query = \"SELECT id, name FROM cities WHERE state_id=\".$stateId;\n $result = dbconfig::run($query);\n if(!$result) {\n throw new exception(\"City not found.\");\n }\n $res = array();\n while($resultSet = mysqli_fetch_assoc($result)) {\n $res[$resultSet['id']] = $resultSet['name'];\n }\n $data = array('status'=>'success', 'tp'=>1, 'msg'=>\"Cities fetched successfully.\", 'result'=>$res);\n } catch (Exception $e) {\n $data = array('status'=>'error', 'tp'=>0, 'msg'=>$e->getMessage());\n } finally {\n return $data;\n }\n }",
"public static function getCities($stateId) {\n try {\n $query = \"SELECT id, name FROM cities WHERE state_id=\".$stateId;\n $result = dbconfig::run($query);\n if(!$result) {\n throw new exception(\"City not found.\");\n }\n $res = array();\n while($resultSet = mysqli_fetch_assoc($result)) {\n $res[$resultSet['id']] = $resultSet['name'];\n }\n $data = array('status'=>'success', 'tp'=>1, 'msg'=>\"Cities fetched successfully.\", 'result'=>$res);\n } catch (Exception $e) {\n $data = array('status'=>'error', 'tp'=>0, 'msg'=>$e->getMessage());\n } finally {\n return $data;\n }\n }",
"public function forCities()\n {\n $this->endpoint = 'scripts/cities-load.php';\n\n $this->reportType = 'city';\n\n return $this;\n }",
"public function getCitiesForState(){\n\t\t\t$citiesInState = array();\n\t\t\t\t\n\t\t\tif ($this->stateExists()){\n\t\t\t\t//Write query\n\t\t\t\t$sqlQuery = \"select distinct c.city_name\n\t\t\t\t\t\t\t from cities c\n\t\t\t\t\t\t\t join states s on c.state_id = s.id\n\t\t\t\t\t\t\t where s.state_name = (ltrim(rtrim(?))) or s.abbreviation = ltrim(rtrim(?)) \n\t\t\t\t\t\t\t \";\n\t\t\t\t//store query parameters\n\t\t\t\t$params = array($this->stateName.\"\", $this->stateName.\"\");\n\t\t\t\t//execute query\n\t\t\t\t$stmt = sqlsrv_query( $this->conn, $sqlQuery, $params);\n\t\t\n\t\t\t\t//Error Occured Executing the SQL Query\n\t\t\t\tif( $stmt === false ) {\n\t\t\t\t\t//Free SQL Statement from Resources\n\t\t\t\t\t\t\n\t\t\t\t\t//Eventually throw an exception\n\t\t\t\t\tdie( print_r( sqlsrv_errors(), true));\n\t\t\n\t\t\t\t}\n\t\t\t\t//SQL Query Executed Fine\n\t\t\t\telse {\n\t\t\t\t\t//Loop Through Result Set\n\t\t\t\t\twhile ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){\n\t\t\t\t\t\tarray_push($citiesInState, $row['city_name']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t//Return List of States This User Visited\n\t\t\treturn $citiesInState;\n\t\t}",
"function citySet($country_id = '') {\n if (!empty($country_id)) {\n $query = $this->obj->db->get_where(CITY, array('deleted' => '0', 'country_id' => $country_id, 'status' => 'Active'));\n return $query->result_array();\n } else {\n $query = $this->obj->db->get_where(CITY, array('deleted' => '0', 'status' => 'Active'));\n return $query->result_array();\n }\n }",
"public function getEventCity()\n {\n $db = $this->getDatabaseObject();\n $query = \"SELECT DISTINCT city_name from area\";\n $temp = $db->query($query);\n $result =array();\n if($temp->num_rows>0){\n while($row = $temp->fetch_row())\n {\n $rows[] = $row;\n }\n $result['status'] = 'success';\n $result['message'] = 'Cities fetched successfully';\n $result['data'] = $rows;\n return $result;\n }\n else\n {\n $result['status'] = \"failure\";\n $result['message'] = 'Cities NOT fetched successfully '.$db->error;\n $result['data'] = '';\n return $result;\n }\n }"
] | [
"0.71856445",
"0.70226467",
"0.69232535",
"0.68723786",
"0.68709886",
"0.67477995",
"0.67057735",
"0.6674994",
"0.6592116",
"0.6492946",
"0.6456389",
"0.64408576",
"0.6333617",
"0.63005865",
"0.62902397",
"0.62785393",
"0.6263613",
"0.62626976",
"0.61988986",
"0.6196785",
"0.6161546",
"0.6150271",
"0.6133455",
"0.6119973",
"0.6119973",
"0.6119973",
"0.6075176",
"0.6062441",
"0.6054089",
"0.60534906"
] | 0.7535279 | 0 |
Get all terminals from DPD | public function getTerminals()
{
$data['auth'] = $this->client->getAuthData();
$result = $this->soapClient->getTerminalsSelfDelivery2($data);
$result = self::stdToArray($result);
if(!isset($result['return']))
throw new \Exception('Wrong response structure', 400);
return collect($result['return'])->get('terminal');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAll(){\n \t$terminals = Terminal::all();\n\n \treturn $terminals;\n }",
"public function index()\n {\n $data['terminals'] = Terminal::all();\n return view('terminal.index')->with($data);\n }",
"public function getList(): void\n {\n $console = new Console();\n $this->cmds = $console->getCommands();\n }",
"function getTerminalsByHost($host, $limit = -1, $order = 'ID', $sort = 'ASC')\n{\n $localhost = array(\n 'localhost',\n '127.0.0.1',\n 'ip6-localhost',\n 'ip6-loopback',\n 'ipv6-localhost',\n 'ipv6-loopback',\n '::1',\n '0:0:0:0:0:0:0:1',\n );\n if (in_array(strtolower($host), $localhost)) {\n $sqlQuery = \"SELECT * FROM `terminals` WHERE `HOST` = '\" . implode(\"' OR `HOST` = '\", $localhost) . \"' ORDER BY `\" . DBSafe($order) . \"` \" . DBSafe($sort);\n } else {\n $sqlQuery = \"SELECT * FROM `terminals` WHERE `HOST` = '\" . DBSafe($host) . \"' ORDER BY `\" . DBSafe($order) . \"` \" . DBSafe($sort);\n }\n if ($limit >= 0) {\n $sqlQuery .= ' LIMIT ' . intval($limit);\n }\n if (!$terminals = SQLSelect($sqlQuery)) {\n $terminals = array(NULL);\n }\n return $terminals;\n}",
"function getTerminalsByCANTTS($order = 'ID', $sort = 'ASC')\n{\n $sqlQuery = \"SELECT * FROM `terminals` WHERE `CANTTS` = '\" . DBSafe('1') . \"' ORDER BY `\" . DBSafe($order) . \"` \" . DBSafe($sort);\n if (!$terminals = SQLSelect($sqlQuery)) {\n $terminals = array(NULL);\n }\n return $terminals;\n}",
"static public function console()\n {\n $rootPath = Config::getRootPath();\n \n return [\n \n ];\n }",
"public function listDevices() {\n $response = $this->api->get('/device');\n\n return $response->success ? $response->data : array();\n }",
"function get_terminal_lines_cols() {\n\t$lines = 20;\n\t$columns = 80;\n\n\tif ( 'Windows' === os() ) {\n\t\texec( 'mode', $output, $status );\n\n\t\tif ( 0 !== $status ) {\n\t\t\t// We cannot fetch information, bail.\n\t\t\treturn [ $lines, $columns ];\n\t\t}\n\n\t\t/*\n\t\t * Output looks like this, it's localized in the OS language.\n\t\t *\n\t\t * Status for device CON:\n\t\t * ----------------------\n\t\t * Lines: 9001\n\t\t * Columns: 120\n\t\t * Keyboard rate: 31\n\t\t * Keyboard delay: 1\n\t\t * Code page: 437\n\t\t */\n\n\t\tforeach ( $output as $line ) {\n\t\t\t// Since the output might be localized to the OS language, we need to parse the format, not the words.\n\t\t\tif ( ! preg_match( '/\\\\s{4}\\\\w+:\\\\s+(?<val>\\\\d+)/', $line, $m ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$lines = $lines ? $lines : $m['val'];\n\t\t\t$columns = $m['val'];\n\t\t}\n\t} elseif ( getenv( 'TERM' ) ) {\n\t\tforeach ( [ 'cols' => 'columns', 'lines' => 'lines' ] as $tput_key => $var_name ) {\n\t\t\texec( \"tput {$tput_key}\", $output, $status );\n\t\t\t$output = array_filter( $output );\n\n\t\t\tif ( 0 !== $status || empty( $output ) ) {\n\t\t\t\t// We cannot fetch information, bail.\n\t\t\t\treturn [ $lines, $columns ];\n\t\t\t}\n\n\t\t\t$$var_name = abs( (int) $output[0] );\n\t\t\t$output = [];\n\t\t}\n\t}\n\n\treturn [ $lines, $columns ];\n}",
"function getGenreConsole(){\n $bdd = dbAccess();\n $requete =$bdd->query(\"SELECT console \n FROM `hardware`\") or die (print_r($requete->errorInfo(), TRUE));\n // Distribuer les données recue dans une variable tableau \n while($donnéesJeux= $requete->fetch()){\n $listeGenreConsole[] = $donnéesJeux;\n }\n return $listeGenreConsole;\n }",
"public function getAll()\n {\n return $this->devices;\n }",
"protected function shellCommands()\n {\n return collect($this->commands)->mapInto(ShellCommand::class);\n }",
"public function getCommands();",
"public function getCommands();",
"public function getCommands();",
"public function getTerminal(){\n\t\t// include the terminal iframe that use js to refesh status of services and tasks.\n\t\t$terminal = '<div id=\"div_terminal\"><iframe id=\"iframe_terminal\" name=\"iframe_terminal\" src=\"system/podserver_terminal.php\" scrolling=\"no\"></iframe></div>';\n\t\treturn $terminal;\n\n\t}",
"public function get_terminos() {\n $consulta = $this->_db->get_results(\"SELECT * FROM terminos WHERE 1;\");\n //Se retorna la consulta y se recorren los registros\n return $consulta;\n }",
"public function getConsoleCommands(Container $app);",
"public function getDevices(): array\n {\n return $this->devices;\n }",
"private function terminalResult()\n {\n if($this->session->resultTerminal === []) return $this->session->resultTerminal;\n\n if($this->session->resultTerminal === null) {\n global $db;\n $result = new Genius_Model_FiltreTerminal();\n $result = $result->select();\n $result = $db->query($result)->fetchAll();\n $this->session->resultTerminal = $result;\n }\n }",
"function getTerminal($login, $conn)\n{\n $sql = \"SELECT T.numSerie num, M.designation desig, M.constructeur cons, S.version v, S.constructeur os\nfrom terminal T, modele M, os S\nWHERE T.client='$login' AND T.idmodele=M.id AND M.idos = S.id\";\n\n $query = pg_query($conn, $sql);\n\n while($res = pg_fetch_array($query))\n {\n echo \"<tr>\";\n echo \"<td>$res[num]</td>\";\n echo \"<td>$res[desig]</td>\";\n echo \"<td>$res[cons]</td>\";\n echo \"<td>$res[v]</td>\";\n echo \"<td>$res[os]</td>\";\n echo \"</tr>\";\n }\n}",
"public function getCommands(): array\n {\n return $this->commands;\n }",
"public static function getAll(){\n return $_SESSION['d'];\n }",
"private function _getTerminalApi()\n {\n return Mage::getSingleton('smartbox_smartboxparcels/api_smartbox_terminals');\n }",
"public function terminal()\n {\n return new Terminal([\n 'colors' => !$this->commandLine()->get('no-colors'),\n 'header' => !$this->commandLine()->get('no-header')\n ]);\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"private function getDiskCommands()\n {\n $path = realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.$this->config['commandpath']);\n if (false === $path)\n {\n print(\n 'Command path not found '.\n dirname(__FILE__).\n DIRECTORY_SEPARATOR.\n $this->config['commandpath'].\"\\n\"\n );\n return array();\n }\n $commands = array();\n $handle = opendir($path);\n while (false !== ($command = readdir($handle)))\n {\n if (true === is_file($path.DIRECTORY_SEPARATOR.$command) &&\n is_executable($path.DIRECTORY_SEPARATOR.$command))\n {\n $commands[] = '?'.pathinfo($path.DIRECTORY_SEPARATOR.$command, PATHINFO_FILENAME);\n }\n }\n return $commands;\n }",
"public function getCommands() \n {\n return $this->_commands; \n }"
] | [
"0.745419",
"0.57223874",
"0.5699771",
"0.566361",
"0.5531007",
"0.55283004",
"0.5441995",
"0.5408145",
"0.53014183",
"0.530058",
"0.5277292",
"0.5257666",
"0.5257666",
"0.5257666",
"0.52559763",
"0.52360904",
"0.52273154",
"0.5221256",
"0.52124065",
"0.5200325",
"0.51981777",
"0.51812",
"0.5166117",
"0.51545227",
"0.51513594",
"0.51513594",
"0.51513594",
"0.51513594",
"0.51056504",
"0.5102101"
] | 0.607326 | 1 |
Function to set and get ext AppointmentID | public function setExternalAppoinmentId($extappointmentid){
$this->_extappointmentid = $extappointmentid ;
return $this ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAppID()\n\t{\n\t\treturn $this->AppID;\n\t}",
"public function getSelfServiceAppointmentId()\n {\n if (array_key_exists(\"selfServiceAppointmentId\", $this->_propDict)) {\n return $this->_propDict[\"selfServiceAppointmentId\"];\n } else {\n return null;\n }\n }",
"public function setSelfServiceAppointmentId($val)\n {\n $this->_propDict[\"selfServiceAppointmentId\"] = $val;\n return $this;\n }",
"public function getApplicationId()\n {\n return $this->appId;\n }",
"public function getApplicationIdentifier()\n {\n if (array_key_exists(\"applicationIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"applicationIdentifier\"];\n } else {\n return null;\n }\n }",
"protected function defineId($app_name, $ext_name)\n\t{\n\t\t$ext_callable = function ($id) {\n\t\t\treturn empty($id) ? null : new ObjectId($id);\n\t\t};\n\n\t\t$this->define($app_name, $ext_name, 'strval', $ext_callable);\n\t}",
"public function getAppId()\n {\n return $this->app_id;\n }",
"public function getAppId()\n {\n return $this->app_id;\n }",
"public function getAppId()\n {\n return $this->app_id;\n }",
"public function getAppId()\n {\n return $this->app_id;\n }",
"public function getAppId()\n {\n return $this->app_id;\n }",
"public function get_application_id() {\n\t\t$mode = $this->get_mode();\n\t\tif ( $this->get_plugin_setting( 'custom_app_' . $mode ) === '1' ) {\n\t\t\treturn $this->get_plugin_setting( 'custom_app_id_' . $mode );\n\t\t}\n\t\tif ( $this->is_sandbox() ) {\n\t\t\treturn defined( 'SQUARE_SANDBOX_APP_ID' ) ? SQUARE_SANDBOX_APP_ID : 'sandbox-sq0idb-pNhEAzS58zAaqOrijuSLxQ';\n\t\t}\n\n\t\treturn defined( 'SQUARE_APP_ID' ) ? SQUARE_APP_ID : 'sq0idp-6IFu0hb9rVdgZpUBxDF1Ug';\n\t}",
"public function getApplicationId()\n {\n return $this->application_id;\n }",
"private function getAppId() {\n $inventoryClass = new ReflectionClass(get_class($this));\n return $inventoryClass->getConstant('APP_ID');\n }",
"public function getApplicationId()\n\t{\n\t\treturn $this->application_id;\n\t}",
"public static function set_app_id($value) {\n\t\tself::set_config('appID', $value);\n\t}",
"public function getAppId()\n {\n return isset($this->app_id) ? $this->app_id : null;\n }",
"private function SetAppID($appID){\n\t\t$this->appID = $appID;\n\t}",
"public function setApplicationIdentifier($val)\n {\n $this->_propDict[\"applicationIdentifier\"] = $val;\n return $this;\n }",
"public function saveAppointment() {\n\n \n\n $data = array(\n\n 'reference_code' => $this->getReferenceCode(),\n\n 'user_id' => $this->getUserId(),\n\n 'fname' => $this->getFname(),\n\n 'lname' => $this->getLname(),\n\n 'zipcode' => $this->getZipcode(),\n\n 'phone' => $this->getPhone(),\n\n 'email' => $this->getEmail(),\n\n 'age' => $this->getAge(),\n\n 'gender' => $this->getGender(),\n\n 'first_visit' => $this->getFirstVisit(),\n\n 'patient_status' => $this->getPatientStatus(),\n\n 'notes' => $this->getNotes(),\n\n 'appointment_date' => $this->getAppointmentDate(),\n\n 'appointment_time' => $this->getAppointmentTime(),\n\n 'booking_date' => $this->getBookingDate(),\n\n 'doctor_id' => $this->getDoctorId(),\n\n 'reason_for_visit' => $this->getReasonForVisit(),\n\n 'needs' => $this->getNeeds(),\n\n 'insurance' => $this->getInsurance(),\n\n 'plan' => $this->getPlan(),\n\n 'appointment_type' => $this->getAppointmentType(),\n\n 'month_dob' => $this->getMonthDob(),\n\n 'date_dob' => $this->getDateDob(),\n\n 'year_dob' => $this->getYearDob(),\n\n 'mail_counter_for_doctor' => $this->getMailCounterForDoctor(),\n\n 'cancelled_by' => $this->getCancelledBy(),\n\n 'called_status' => $this->getCalledStatus(),\n\n 'onbehalf' => $this->getOnbehalf(),\n\n 'rescheduled' => $this->getRescheduled(),\n\n 'externalappointmentid' => $this->getExternalAppointmentId(),\n 'charexternalappointmentid' => $this->getCharExternalAppointmentId(),\n \n\t\t\t'api_outbound_sid' => $this->getApiOutboundSid(),\n\n 'api_outbound_to' => $this->getApiOutboundTo(),\n\n 'api_outbound_time' => $this->getApiOutboundTime(),\n\n 'api_outbound_date' => $this->getApiOutboundDate(),\n\n 'api_inbound_sid' => $this->getApiInboundSid(),\n\n 'api_inbound_date' => $this->getApiInboundDate(),\n\n 'api_inbound_time' => $this->getApiInboundTime(),\n\n 'api_inbound_reply' => $this->getApiInboundReply(),\n\n 'mobile' => $this->getMobile(),\n\n 'call_type' => $this->getCallType(),\n\n 'delivery_status' => $this->getDeliveryStatus(),\n\n 'text_message_reply' => $this->getTextMessageReply(),\n \n 'reply_to_doctor' => $this->getReplyToDoctor()\n\n\n );\n\n\n\n // $external_id= 1070 ;\n\n\n\n\n if (null === ($id = $this->getId())) {\n\n \n unset($data['id']);\n\n $data['approve'] = 1;\n\n $data['deleted'] = 0;\n\t\t return $this->getMapper()->getDbTable()->insert($data);\n\n \n\n } else {\n\n \n $data['approve'] = $this->getApprove();\n\n $data['deleted'] = $this->getDeleted();\n\n $data['update_date'] = time();\n\t\t\t return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n\n }\n\n }",
"function bookAppointment()\n{\n\t$app = Application::getInstance();\n\t$app->bookAppointment();\n}",
"public function getIveriApplicationId()\n {\n return $this->iveriApplicationId;\n }",
"public function getAppId()\n {\n return $this->get(self::APPID);\n }",
"abstract public function getAppId();",
"public function getAppId()\n {\n return $this->get(self::APP_ID);\n }",
"public function getAppId()\r\n \t{\r\n \treturn $this->appId;\r\n \t}",
"public function set_appointment_info()\n {\n $check = $this->Generic_model->getSingleRecord('doctors', array(\n 'doctor_id' => $this->input->post('d_id')\n ), $order = '');\n\n $newdata = array(\n 'dname' => \"DR. \" . $check->first_name . \" \" . $check->last_name,\n 'did' => $this->input->post('d_id'),\n 'app_date' => date(\"Y-m-d\", strtotime($this->input->post('date'))),\n 'priority' => $this->input->post('priority'),\n 'app_slot' => $this->input->post('slot'),\n 'sms' => $this->input->post('sms')\n );\n\n $this->session->set_userdata($newdata);\n }",
"private function _checkAppointment($id) {\n $dbId = $this->db->getEntry($id);\n if ($dbId !== $id) { \n throw new Exception(\"appointment doesn't exists\");\n }\n }",
"public function getAppId()\n {\n if (array_key_exists(\"appId\", $this->_propDict)) {\n return $this->_propDict[\"appId\"];\n } else {\n return null;\n }\n }",
"public function getExternalId();"
] | [
"0.63902193",
"0.6368609",
"0.6213778",
"0.603739",
"0.59388214",
"0.5913945",
"0.57975507",
"0.57975507",
"0.57975507",
"0.57975507",
"0.57975507",
"0.57773346",
"0.5772792",
"0.5756801",
"0.5756641",
"0.5714132",
"0.57136375",
"0.5706014",
"0.5681603",
"0.5673782",
"0.56635827",
"0.56127644",
"0.5529456",
"0.55194795",
"0.5491122",
"0.5479551",
"0.54622364",
"0.54581153",
"0.5454711",
"0.54411805"
] | 0.6851964 | 0 |
Save the ext Appointments | public function saveAppointment() {
$data = array(
'reference_code' => $this->getReferenceCode(),
'user_id' => $this->getUserId(),
'fname' => $this->getFname(),
'lname' => $this->getLname(),
'zipcode' => $this->getZipcode(),
'phone' => $this->getPhone(),
'email' => $this->getEmail(),
'age' => $this->getAge(),
'gender' => $this->getGender(),
'first_visit' => $this->getFirstVisit(),
'patient_status' => $this->getPatientStatus(),
'notes' => $this->getNotes(),
'appointment_date' => $this->getAppointmentDate(),
'appointment_time' => $this->getAppointmentTime(),
'booking_date' => $this->getBookingDate(),
'doctor_id' => $this->getDoctorId(),
'reason_for_visit' => $this->getReasonForVisit(),
'needs' => $this->getNeeds(),
'insurance' => $this->getInsurance(),
'plan' => $this->getPlan(),
'appointment_type' => $this->getAppointmentType(),
'month_dob' => $this->getMonthDob(),
'date_dob' => $this->getDateDob(),
'year_dob' => $this->getYearDob(),
'mail_counter_for_doctor' => $this->getMailCounterForDoctor(),
'cancelled_by' => $this->getCancelledBy(),
'called_status' => $this->getCalledStatus(),
'onbehalf' => $this->getOnbehalf(),
'rescheduled' => $this->getRescheduled(),
'externalappointmentid' => $this->getExternalAppointmentId(),
'charexternalappointmentid' => $this->getCharExternalAppointmentId(),
'api_outbound_sid' => $this->getApiOutboundSid(),
'api_outbound_to' => $this->getApiOutboundTo(),
'api_outbound_time' => $this->getApiOutboundTime(),
'api_outbound_date' => $this->getApiOutboundDate(),
'api_inbound_sid' => $this->getApiInboundSid(),
'api_inbound_date' => $this->getApiInboundDate(),
'api_inbound_time' => $this->getApiInboundTime(),
'api_inbound_reply' => $this->getApiInboundReply(),
'mobile' => $this->getMobile(),
'call_type' => $this->getCallType(),
'delivery_status' => $this->getDeliveryStatus(),
'text_message_reply' => $this->getTextMessageReply(),
'reply_to_doctor' => $this->getReplyToDoctor()
);
// $external_id= 1070 ;
if (null === ($id = $this->getId())) {
unset($data['id']);
$data['approve'] = 1;
$data['deleted'] = 0;
return $this->getMapper()->getDbTable()->insert($data);
} else {
$data['approve'] = $this->getApprove();
$data['deleted'] = $this->getDeleted();
$data['update_date'] = time();
return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveAppointment(){\n\n\n $data = $this->request->data;\n\n $data['consents'] = 0; // no se ha firmado un consentimiento \n\n $data['expected_date'] = substr( $data['expected_date'], 0, 10 );\n\n $appointment = $this->Appointments->newEntity();\n\n $appointment = $this->Appointments->patchEntity($appointment, $data);\n\n if ($this->Appointments->save($appointment)) {\n\n\n $success = true;\n\n $this->set(compact('success','appointment'));\n\n\n } else {\n\n $success = false;\n\n $errors = $appointment->errors();\n\n $this->set(compact('success','errors'));\n\n }\n }",
"public function store(StoreAppointment $request)\n {\n // dd($request->all());\n\n\n $appoint = new Appointment();\n if ($request->type == \"new\") {\n $appoint->name = $request->new_client;\n\n } else {\n $appoint->client_id = $request->exists_client;\n\n }\n // $advocate_id = $this->getLoginUserId();\n $appoint->mobile = $request->mobile;\n $appoint->date = date('Y-m-d H:i:s', strtotime(LogActivity::commonDateFromat($request->date)));\n\n $appoint->time = date('H:i:s', strtotime($request->time));\n $appoint->note = $request->note;\n $appoint->type = $request->type;\n $appoint->advocate_id = 1;\n\n $appoint->save();\n\n\n return redirect()->route('appointment.index')->with('success', \"Appointment added successfully.\");\n }",
"function save_appointment() {\n\t\t$response\t\t\t=\tarray('success' => false, 'last_id' => 1);\n\t\t$your_first_name\t=\t$_POST['your_first_name'];\n\t\t$startLocation\t\t=\t$_POST['startLocation'];\n\t\t$endLocation\t\t=\t$_POST['endLocation'];\n\t\t$phoneNumber\t\t=\t$_POST['phoneNumber'];\n\t\t$email\t\t\t\t=\t$_POST['youremail'];\n\t\t$departureTime\t\t=\t$_POST['departureTime'];\n\t\t$departureDate\t\t=\t$_POST['departureDate'];\n\n\t\tswitch( true ){\n\t\t\tcase ( \t!empty($your_first_name) \n\t\t\t\t&& \t!empty($startLocation) \n\t\t\t\t&&\t!empty($endLocation)\n\t\t\t\t&&\t!empty($phoneNumber)\n\t\t\t\t&&\t!empty($email)\n\t\t\t\t&&\t!empty($departureTime) \n\t\t\t\t&&\t!empty($departureDate) ):\n\t\t\t{\n\t\t\t\t$response['success'] = true;\n\t\t\t\tbreak;\n\t\t\t}\t\t\n\t\t\tdefault:{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\twhile(!is_file('wp-config.php')){\n\t\t if(is_dir('../')) chdir('../');\n\t\t else die('Could not find WordPress.');\n\n\t\t}\n\n\t\tinclude( 'wp-config.php' );\n\t\tglobal $wpdb; // this is how you get access to the database\n\n\t\t$table\t\t=\t\"drh_appointments\";\n\n\t\t$sql\t\t=\t\"INSERT INTO $table \".\n\t\t \"(first_name,phone,email,start_location,end_location,departure_time,departure_date,status) \".\n\t\t \"VALUES \".\n\t\t \"('$your_first_name','$phoneNumber','$email','$startLocation','$endLocation','$departureTime',\n\t\t '$departureDate','Booked')\";\n\t\t$sql\t\t=\tstrip_tags ( htmlentities ( trim ( $sql ) , ENT_NOQUOTES ) );\n\t\t$result\t\t=\t$wpdb->query($sql);\n\t\t$response['success'] = true;\n\t\t$response['last_id'] = $wpdb->insert_id;\n\t\techo json_encode($response);\n\t\t$rows = $wpdb->get_results( \"SELECT first_name,phone,email,start_location,end_location,departure_time,departure_date,status FROM $table where id=$lastid\");\t\t\n\t\tdie();\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n \"customerid\" => \"required\",\n \"apartmentid\" => \"required\",\n \"startdate\" => \"required\",\n \"enddate\" => \"required\",\n ]);\n\n $appointment = new Appointment();\n $appointment->customerid = $request->customerid;\n $appointment->apartmentid = $request->apartmentid;\n $appointment->startdate = date('Y-m-d H:i:s', strtotime($request->startdate));\n $appointment->enddate = date('Y-m-d H:i:s', strtotime($request->enddate));\n\n $appointmentDateControl = self::appointmentDateControl($request);\n if($appointmentDateControl){\n return response()->json([\n \"status\" => false,\n \"message\" => \"Belirtilen randevu tarihi müsait değildir...\"\n ], 500);\n }\n else{\n if ($this->user->appointments()->save($appointment)) {\n return response()->json([\n \"status\" => true,\n \"appointment\" => $appointment\n ]);\n } else {\n return response()->json([\n \"status\" => false,\n \"message\" => \"Ops, task could not be saved.\"\n ], 500);\n }\n }\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Appointment::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tAppointment::create($data);\n\n\t\treturn Redirect::route('appointments.index');\n\t}",
"function bookAppointment()\n{\n\t$app = Application::getInstance();\n\t$app->bookAppointment();\n}",
"public function store(AppointmentRequest $request)\n {\n $appointment = new Appointment;\n\n $day = explode('T', $request->date);\n $date = explode('Z', $request->date);\n $date = $day[0] . $date[1]; \n\n $appointment->title = $request->title;\n $appointment->professional_id = $request->professional_id;\n $appointment->patient_id = $request->patient_id;\n $appointment->specialty_id = $request->specialty_id;\n $appointment->treatment_id = $request->treatment_id;\n $appointment->series_id = $request->series_id;\n $appointment->date = $date;\n $appointment->hour = $request->hour;\n\n $res = $appointment->save();\n \n return response()->json(['status' => 'success', 'appointment' => $appointment], 201);\n }",
"public function store(AppointmentRequest $request)\n {\n $appointment = new Appointment();\n\n $appointment->fill($request->all());\n\n $appointment->save();\n\n return redirect()->intended(route('admin.appointments'));\n }",
"public function store(Request $request)\n {\n // ONLY STUDENTS CAN SET AN APPOINTMENTS\n // return $request->all();\n $this->validate($request,[\n 'agenda' => 'required',\n 'date' => 'required',\n 'time' => 'required',\n ]);\n // return $request->all();\n $appointment = new Appointments;\n $appointment->agenda = $request->input('agenda');\n $appointment->date = $request->input('date');\n $appointment->time = $request->input('time');\n $appointment->status = 'Pending'; //default\n $appointment->user_id = auth()->user()->id; //default\n // return $appointment;\n // date in 12 hour format\n // return date('g:i a', strtotime($appointment->time));\n $appointment->save();\n return redirect('/studentappointments');\n }",
"public function store(Request $request)\n {\n /*$this->validate($request, [\n 'CaptchaCode' => 'required|valid_captcha'\n ]);*/\n $previous_appointment = Appointment::where('doctor_id',$request['doctor'])->whereDate('date','=',date($request['date']))->orderBy('appointment_no','desc')->first();\n $time=new \\DateTime($previous_appointment['time']);\n $new_time=$time->add(new \\DateInterval('PT10M'));\n $appointment= Appointment::create([\"date\" => $request->date,\"time\" =>$time->format('h:i:s'),\"illness\" =>'',\"appointment_no\" =>($previous_appointment==null)?'1':($previous_appointment->appointment_no+1),\"is_over\" =>0,\"payment_settled\"=>0,\"doctor_id\" =>$request->doctor,\"patient_id\"=>$request->patient]);\n $online_apointment= \\Modules\\OnlineAppointment\\Entities\\OnlineAppointment::create([\"appointment_id\"=>$appointment->id,\"payment_method\"=> $request->payment_method]);\n \n }",
"function backup_scheduler_appointments($bf, $preferences, $slots) {\n global $CFG;\n\n $status = true;\n\n //Write start tag\n $status = $status && fwrite ($bf, start_tag('APPOINTMENTS', 4, true));\n\n foreach($slots as $slot){\n $appointments = scheduler_get_appointments($slot->id);\n //If there is slots\n if ($appointments) {\n //Iterate over each slots\n foreach ($appointments as $appointment) {\n //Start slot\n $status = $status && fwrite ($bf, start_tag('APPOINTMENT', 5, true));\n //Print appointment data\n fwrite ($bf, full_tag('ID', 6, false, $appointment->id));\n fwrite ($bf, full_tag('SLOTID', 6, false, $appointment->slotid)); \n fwrite ($bf, full_tag('STUDENTID', 6, false, $appointment->studentid)); \n fwrite ($bf, full_tag('ATTENDED', 6, false, $appointment->attended)); \n fwrite ($bf, full_tag('GRADE', 6, false, $appointment->grade));\n fwrite ($bf, full_tag('APPOINTMENTNOTE', 6, false, $appointment->appointmentnote)); \n fwrite ($bf, full_tag('TIMECREATED', 6, false, $appointment->timecreated)); \n fwrite ($bf, full_tag('TIMEMODIFIED', 6, false, $appointment->timemodified)); \n //End appointment\n $status = $status && fwrite ($bf, end_tag('APPOINTMENT', 5, true));\n }\n }\n }\n\n //Write end tag\n $status = $status && fwrite($bf, end_tag('APPOINTMENTS', 4, true));\n return $status;\n }",
"public function store(AppointmentRequest $request)\n {\n $data = $request->all();\n $data['created_by'] = \\Auth::id();\n $appointment = $this->executeCommand('\\App\\Commands\\AppointmentCommand', $data);\n\n if ($appointment) {\n return ApiResponse::success([\n 'message' => Lang::get('response.success.saved', ['attribute' => 'Appointment']),\n 'appointment' => $this->response->item($appointment, new AppointmentsTransformer)\n ]);\n }\n\n return ApiResponse::errorInternal();\n }",
"public function store(StoreAppointmentRequest $request)\n {\n $data = $request->except('_token');\n $data['bookdate'] = date_format(date_create($request->bookdate), 'j M Y');\n\n $storeAppointment = Appointment::create($data);\n\n if (!$storeAppointment)\n return redirect()->route('appointments.create')->with('error', __('website\\includes\\sessionDisplay.wrong'));\n\n return redirect()->route('appointments.index')->with('success', 'Successfully added');\n }",
"public function store(MeetingRequest $request)\n {\n $response = array();\n $meeting = new Meeting();\n $meeting->venue = $request['venue'];\n $meeting->title = $request['title'];\n $meeting->description = $request['description'];\n $meeting->date = $request['date'];\n $meeting->start_time = $request['start_time'];\n $meeting->end_time = $request['end_time'];\n $meeting->created_by = \\Auth::user()->id;\n $meeting->save();\n\n\n $userObj = User::find(\\Auth::user()->id);\n $cellphone = '27'.(ltrim($userObj->cellphone,'0'));\n $meetingAttendee = new MeetingAttendee();\n $meetingAttendee->meeting = $meeting->id;\n $meetingAttendee->attendee = \\Auth::user()->id;\n $meetingAttendee->phonebook = 0;\n $meetingAttendee->mobile = $cellphone;\n $meetingAttendee->created_by = \\Auth::user()->id;\n $meetingAttendee->save();\n\n\n $calendarEvent = new CalendarEvent();\n $calendarEvent->name = $request['title'];\n $calendarEvent->start_date = $request['date'];\n $calendarEvent->end_date = $request['date'];\n $calendarEvent->start_time = $request['start_time'];\n $calendarEvent->end_time = $request['end_time'];\n $calendarEvent->event_type_id = 1;\n $calendarEvent->meeting_id = $meeting->id;\n $calendarEvent->locked = 1;\n $calendarEvent->created_by = \\Auth::user()->id;\n $calendarEvent->save();\n\n\n\n\n\n\n $facilitators = explode(',',$request['facilitators']);\n\n foreach ($facilitators as $facilitator) {\n\n $userObj = User::where('email','=',$facilitator)->first();\n $userId = 0;\n $addressbook = 0;\n\n if (count($userObj) > 0) {\n\n $userId = $userObj->id;\n\n\n } else {\n\n $userObj = addressbook::where('email','=',$facilitator)->first();\n $userId = $userObj->id;\n $addressbook = 1;\n }\n\n\n $meetingFacilitator = new MeetingFacilitator();\n $meetingFacilitator->meeting = $meeting->id;\n $meetingFacilitator->facilitator = $userId;\n $meetingFacilitator->addressbook = $addressbook;\n $meetingFacilitator->created_by = \\Auth::user()->id;\n $meetingFacilitator->save();\n\n\n }\n\n return \\Response::make('Meeting Created!');\n\n\n\n }",
"function save($mail = true){\n\t\tglobal $wpdb;\n\t\t$table = EM_BOOKINGS_TABLE;\n\t\tdo_action('em_booking_save_pre',$this);\n\t\tif( $this->can_manage() ){\n\t\t\t//update prices, spaces, person_id\n\t\t\t$this->get_spaces(true);\n\t\t\t$this->calculate_price();\n\t\t\t$this->person_id = (empty($this->person_id)) ? $this->get_person()->ID : $this->person_id;\t\t\t\n\t\t\t//Step 1. Save the booking\n\t\t\t$data = $this->to_array();\n\t\t\t$data['booking_meta'] = serialize($data['booking_meta']);\n\t\t\t//update or save\n\t\t\tif($this->booking_id != ''){\n\t\t\t\t$update = true;\n\t\t\t\t$where = array( 'booking_id' => $this->booking_id ); \n\t\t\t\t$result = $wpdb->update($table, $data, $where, $this->get_types($data));\n\t\t\t\t$result = ($result !== false);\n\t\t\t\t$this->feedback_message = __('Changes saved','events-manager');\n\t\t\t}else{\n\t\t\t\t$update = false;\n\t\t\t\t$data_types = $this->get_types($data);\n\t\t\t\t$data['booking_date'] = $this->booking_date = gmdate('Y-m-d H:i:s');\n\t\t\t\t$data_types[] = '%s';\n\t\t\t\t$result = $wpdb->insert($table, $data, $data_types);\n\t\t\t $this->booking_id = $wpdb->insert_id; \n\t\t\t\t$this->feedback_message = __('Your booking has been recorded','events-manager'); \n\t\t\t}\n\t\t\t//Step 2. Insert ticket bookings for this booking id if no errors so far\n\t\t\tif( $result === false ){\n\t\t\t\t$this->feedback_message = __('There was a problem saving the booking.', 'events-manager');\n\t\t\t\t$this->errors[] = __('There was a problem saving the booking.', 'events-manager');\n\t\t\t}else{\n\t\t\t\t$tickets_bookings_result = $this->get_tickets_bookings()->save();\n\t\t\t\tif( !$tickets_bookings_result ){\n\t\t\t\t\tif( !$update ){\n\t\t\t\t\t\t//delete the booking and tickets, instead of a transaction\n\t\t\t\t\t\t$this->delete();\n\t\t\t\t\t}\n\t\t\t\t\t$this->errors[] = __('There was a problem saving the booking.', 'events-manager');\n\t\t\t\t\t$this->add_error( $this->get_tickets_bookings()->get_errors() );\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Step 3. email if necessary\n\t\t\tif ( count($this->errors) == 0 && $mail ) {\n\t\t\t\t$this->email();\n\t\t\t}\n\t\t\t$this->compat_keys();\n\t\t\treturn apply_filters('em_booking_save', ( count($this->errors) == 0 ), $this);\n\t\t}else{\n\t\t\t$this->feedback_message = __('There was a problem saving the booking.', 'events-manager');\n\t\t\tif( !$this->can_manage() ){\n\t\t\t\t$this->add_error(sprintf(__('You cannot manage this %s.', 'events-manager'),__('Booking','events-manager')));\n\t\t\t}\n\t\t}\n\t\treturn apply_filters('em_booking_save', false, $this);\n\t}",
"public function store(Request $request)\n {\n $appointment = new Appointment();\n $appointment->user_id = Auth::user()->id;\n $appointment->service_id = $request->service_id;\n $appointment->specialist_id = $request->specialist_id;\n $appointment->date = $request->date;\n $appointment->rate = $request->rate;\n $appointment->time = $request->time;\n $appointment->save();\n return back()->with('success','Appointment Created Successfuly!');\n\n }",
"public function store(Request $request)\n {\n //\n $patient = Patient::where('user_id', Auth::id())->first();\n $appointment = new Appointment();\n $appointment->doctor_id = $request->doctor_id;\n $appointment->issue_id = $request->issue_id;\n $appointment->patient_id = $patient->id;\n $appointment->title = $request->title;\n $appointment->date = $request->date;\n $appointment->time = $request->time;\n $appointment->notes = $request->notes;\n\n if ($appointment->save()) {\n return response()->json(['message' => 'Appointment has been scheduled', 'appointment' => $appointment]);\n }\n return response()->json(['message' => 'Appointment not saved']);\n }",
"public function store(AppointmentStoreRequest $request)\n {\n $overlap_appointment = AppointmentHelper::checkIfTimeIsPossibleForDoctor($request);\n if($overlap_appointment==null){\n $array_request = $this->processStoreRequest($request);\n $appointment = Appointment::create($array_request);\n $request->session()->flash('store_appointment',\n 'Le Patient \"' . $appointment->patient->last_name . ' ' . $appointment->patient->first_name .'\"\n a un Rendez-vous avec Le Docteur \"' . $appointment->doctor->last_name . ' ' . $appointment->doctor->first_name .\n '\" Le ' . $appointment->date . ' a ' . $appointment->start_at . '.');\n return redirect(route('patient.show',['patient'=>$appointment->patient->id]));\n }else{\n return redirect()->back()->withErrors([\"appointment_time_taken\"=>\n \"le medecin conserne a deja un rendez-vous le \" . $overlap_appointment->date . \" \" .\n $overlap_appointment->start_at . \"-\" . $overlap_appointment->end_at . \" .\"]);\n }\n\n }",
"public function saveSchedule()\n {\n $data = $this->input->post(null, true);\n $result = ActivityScheduleService::getInstance()->save($data);\n $this->_success($result);\n }",
"public function doctorAppointmentBackupAction() {\n\t\n\t\t$this->view->headTitle('Doctor Appointments');\n $usersNs = new zend_Session_Namespace(\"members\");\n $Doctor = new Application_Model_Doctor();\n $doctor = $Doctor->fetchRow(\"user_id='{$usersNs->userId}'\");\n $Appointment = new Application_Model_Appointment();\n\t\n $id = $this->_getParam('id');\n\t\n\t\t$upcomingWhere = \"deleted!=1 AND doctor_id={$doctor->getId()} AND DATEDIFF(NOW(),appointment_date)<=0 AND approve!=2\";\n $pastWhere = \"deleted!=1 AND doctor_id={$doctor->getId()} AND DATEDIFF(NOW(),appointment_date)>0 AND approve!=2\";\t\t\n\t\t$cancellWhere = \"deleted!=1 AND doctor_id={$doctor->getId()} AND approve=2\";\n /*\n\t\t$this->view->upcomingObject = $Appointment->fetchAll($upcomingWhere, \"ADDTIME( appointment_date, appointment_time ) asc \");\n \t\t $this->view->pastObject = $Appointment->fetchAll($pastWhere, \"ADDTIME( appointment_date, appointment_time ) desc \");\n\t\t$this->view->cancelObjects = $Appointment->fetchAll($cancellWhere, \"ADDTIME( appointment_date, appointment_time ) desc \");\n */\n \n if($id==''){\n $this->view->color='diff1';\n $this->view->upcomingObject = $Appointment->fetchAll($upcomingWhere, \"appointment_date ASC\");\n }else if($id=='past'){\n $this->view->color='diff2';\n $this->view->pastObject = $Appointment->fetchAll($pastWhere, \"appointment_date DESC\");\n }else if($id=='cancell'){\n $this->view->color='diff3';\n $this->view->cancelObjects = $Appointment->fetchAll($cancellWhere, \"appointment_date DESC\");\n }\n\n $this->view->doctor = $doctor;\n\n\t\t$settings = new Admin_Model_GlobalSettings();\n\t\t$this->view->dateFormat = $settings->settingValue('date_format');\n\t\t\n\t\t$form = new User_Form_DoctorPatient();\n $elements = $form->getElements();\n $form->clearDecorators();\n foreach ($elements as $element) {\n $element->removeDecorator('label');\n $element->removeDecorator('row');\n $element->removeDecorator('data');\n }\n $this->view->form = $form;\n }",
"public function submitAppointment(Request $request){\n /* Validate form fields */\n $validator = Validator::make($request->all(), [\n 'appointmentmoment' => ['required', 'max:255'],\n 'appointmenttime' => ['required'],\n 'firstname' => ['required', 'max:40', 'string'],\n 'lastname' => ['required', 'max:40', 'string'],\n 'email' => ['required', 'email', 'max:100'],\n 'phone' => ['required'],\n 'comments' => ['max:300'],\n 'treatments' => ['required']\n ]);\n\n /* If validator fails, return error message */\n if ($validator->fails()) {\n flash(__('Er is iets mis gegaan bij het maken van de afspraak. Probeer het later opnieuw!'))->error();\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n /* Find treatment by incoming id */\n $treatment = Treatment::find($request->treatments);\n /* Find timetable by incoming timetable id */\n $timetable = Timetable::find($request->appointmenttime);\n\n /* Create new appointment and fill all fields below*/\n $appointment = new Appointment();\n /* Generate unique hash for appointment and check if there are duplicates */\n $duplicates = true;\n while($duplicates){\n $hash = $this->generateHash();\n if (!$this->checkHashDuplicate($hash)){\n $duplicates = false;\n $appointment->hash = $hash;\n }\n }\n $appointment->firstname = $request->firstname;\n $appointment->lastname = $request->lastname;\n $appointment->email = $request->email;\n $appointment->phone = $request->phone[\"full\"];\n /* Fill in date, but first create Carbon class to make sure the variable is saved in the correct format */\n $appointment->date = Carbon::createFromFormat('d/m/Y', $request->appointmentmoment);\n $appointment->time_from = $timetable->time_from;\n $appointment->time_until = $timetable->time_until;\n $appointment->comments = !empty($request->comments) ? $request->comments : null;\n $appointment->save();\n /* Attach incoming treatment to the appointment. */\n $appointment->treatments()->attach($treatment);\n\n /* If sms is enabled, send sms */\n if (env('SMS_ENABLED')){\n $smsMessage = new SmsMessage();\n $smsMessage->originator = env('SMS_NAME');\n $smsMessage->recipients = [ $request->phone[\"full\"] ];\n $smsMessage->body = __('Beste :firstname, uw afspraak bij :name is aangemaakt. Voor het bekijken en wijzigen van uw afspraak kunt u op de volgende link klikken. :link',['firstname' => $request->firstname, 'name' => env('APP_NAME'), 'link' => route('editappointment', $appointment->hash)]);\n $smsMessage->send();\n }\n /* If mail is enabled, send mail */\n if(env('MAIL_ENABLED')) Mail::to($appointment->email)->send(new AppointmentMailer($appointment, \"created\"));\n\n /* Various checks to check what message to display */\n if (!env('MAIL_ENABLED') && !env('SMS_ENABLED')) {\n flash(__('De afspraak is succesvol gemaakt.'))->success();\n }\n else if(env('MAIL_ENABLED') && !env('SMS_ENABLED')){\n flash(__('De afspraak is succesvol gemaakt. Een bevestiging is gestuurd naar het email adres'))->success();\n }\n else if (!env('MAIL_ENABLED') && env('SMS_ENABLED')){\n flash(__('DE afspraak is succesvol gemaakt. Een bevestiging is gestuurd naar het telefoonnummer'))->success();\n }\n else {\n flash(__('De afspraak is succesvol gemaakt. Een bevestiging is gestuurd naar het email adres en telefoonnummer'))->success();\n }\n return redirect()->back();\n }",
"public function submitAppointmentAdmin(Request $request){\n $validator = Validator::make($request->all(), [\n 'appointmentmoment' => ['required', 'max:255'],\n 'timefrom' => ['required'],\n 'timeuntil' => ['required'],\n 'comments' => ['max:300'],\n 'firstname' => ['required', 'max:40', 'string'],\n 'lastname' => ['required', 'max:40', 'string'],\n 'email' => ['required', 'email', 'max:100'],\n 'phone' => ['required'],\n 'treatments' => ['required']\n ]);\n\n if ($validator->fails()) {\n flash(__('Er is iets mis gegaan bij het bijwerken van de afspraak. Probeer het later opnieuw!'))->error();\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n /* Find appointment */\n $appointment = Appointment::find($request->appointment_id);\n /* Fill in fields with fields from the request */\n $appointment->firstname = $request->firstname;\n $appointment->lastname = $request->lastname;\n $appointment->email = $request->email;\n $appointment->phone = $request->phone['full'];\n $appointment->time_from = $request->timefrom;\n $appointment->time_until = $request->timeuntil;\n $appointment->comments = !empty($request->comments) ? $request->comments : null;\n $appointment->date = Carbon::createFromFormat('d/m/Y', $request->appointmentmoment);\n /* Remove all treatments from appointment */\n $appointment->treatments()->detach();\n /*\n If treatments are array then loop through it and attach treatments to appointment.\n If treatments are not array then directly attach treatment to appointment\n */\n if (is_array($request->treatments)) {\n foreach ($request->treatments as $item) {\n $treatment = Treatment::find($item);\n $appointment->treatments()->attach($treatment);\n }\n }\n else{\n $treatment = Treatment::find($request->treatments);\n $appointment->treatments()->attach($treatment);\n }\n $appointment->save();\n /* If sms is enabled, send sms */\n if (env('SMS_ENABLED')){\n $smsMessage = new SmsMessage();\n $smsMessage->originator = env('SMS_NAME');\n $smsMessage->recipients = [ $request->phone[\"full\"] ];\n $smsMessage->body = __('Beste :firstname, uw afspraak bij :name is gewijzigd. Bekijk of verander uw wijzigingen via de volgende link. :link',['firstname' => $request->firstname, 'name' => env('APP_NAME'), 'link' => route('editappointment', $appointment->hash)]);\n $smsMessage->send();\n }\n /* If mail is enabled, send mail */\n if(env('MAIL_ENABLED')) Mail::to($appointment->email)->send(new AppointmentMailer($appointment, \"changed\"));\n\n /* Various checks to check what message to display */\n if (!env('MAIL_ENABLED') && !env('SMS_ENABLED')) {\n flash(__('De afspraak is succesvol bijgewerkt.'))->success();\n }\n else if(env('MAIL_ENABLED') && !env('SMS_ENABLED')){\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het email adres'))->success();\n }\n else if (!env('MAIL_ENABLED') && env('SMS_ENABLED')){\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het telefoonnummer'))->success();\n }\n else {\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het email adres en telefoonnummer'))->success();\n }\n\n return redirect()->back();\n\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'first_name'=>'required',\n 'last_name'=> 'required',\n 'date' => 'required|date',\n 'treatment' => 'required',\n 'email' => 'required',\n 'phone_number' => 'required'\n ]);\n\n $appointment = new Appointment([\n 'first_name' => $request->get('first_name'),\n 'last_name'=> $request->get('last_name'),\n 'date'=> $request->get('date'),\n 'treatment'=> $request->get('treatment'),\n 'email'=> $request->get('email'),\n 'phone_number'=> $request->get('phone_number')\n ]);\n\n $appointment->save();\n return redirect('/appointments')->with('success', 'Your appointment has been booked');\n }",
"public function saveParticipateSchedule()\n {\n $data = $this->input->post(null, true);\n $result = ActivityParticipateScheduleService::getInstance()->save($data);\n $this->_success($result);\n }",
"public function submitAppointmentEdit(Request $request){\n /* Validate form fields */\n $validator = Validator::make($request->all(), [\n 'email' => ['required', 'email', 'max:100'],\n 'phone' => ['required'],\n 'comments' => ['max:300'],\n ]);\n\n /* If validator fails, return error message */\n if ($validator->fails()) {\n flash(__('Er is iets mis gegaan bij het maken van de afspraak. Probeer het later opnieuw!'))->error();\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n /* Create new appointment and fill all fields below*/\n $appointment = Appointment::where('hash', $request->appointment_hash)->first();\n $appointment->email = $request->email;\n $appointment->phone = $request->phone[\"full\"];\n $appointment->comments = !empty($request->comments) ? $request->comments : null;\n\n /* Do a lot of checks if treatments are submitted, if it is only one treatment and check if the time is submitted */\n if ($request->appointmentmoment && $request->treatments && $request->treatmentanddatechange == \"true\" && $request->appointmenttime && $appointment->treatments()->count() < 2){\n /* Fill in date, but first create Carbon class to make sure the variable is saved in the correct format */\n $appointment->date = Carbon::createFromFormat('d/m/Y', $request->appointmentmoment);\n /* Find timetable by incoming timetable id */\n $timetable = Timetable::find($request->appointmenttime);\n /* Fill in values */\n $appointment->time_from = $timetable->time_from;\n $appointment->time_until = $timetable->time_until;\n\n /* Find treatment by incoming id */\n $treatment = Treatment::find($request->treatments);\n /* Attach incoming treatment to the appointment. */\n $appointment->treatments()->detach();\n $appointment->treatments()->attach($treatment);\n }\n $appointment->save();\n\n /* If sms is enabled, send sms */\n if (env('SMS_ENABLED')){\n $smsMessage = new SmsMessage();\n $smsMessage->originator = env('SMS_NAME');\n $smsMessage->recipients = [ $request->phone[\"full\"] ];\n $smsMessage->body = __('Beste :firstname, uw afspraak bij :name is gewijzigd. Voor het bekijken en wijzigen van uw afspraak kunt u op de volgende link klikken. :link',['firstname' => $request->firstname, 'name' => env('APP_NAME'), 'link' => route('editappointment', $appointment->hash)]);\n $smsMessage->send();\n }\n /* If mail is enabled, send mail */\n if(env('MAIL_ENABLED')) Mail::to($appointment->email)->send(new AppointmentMailer($appointment, \"changed\"));\n\n /* Various checks to check what message to display */\n if (!env('MAIL_ENABLED') && !env('SMS_ENABLED')) {\n flash(__('De afspraak is succesvol bijgewerkt.'))->success();\n }\n else if(env('MAIL_ENABLED') && !env('SMS_ENABLED')){\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het email adres'))->success();\n }\n else if (!env('MAIL_ENABLED') && env('SMS_ENABLED')){\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het telefoonnummer'))->success();\n }\n else {\n flash(__('De afspraak is succesvol bijgewerkt. Een bevestiging is gestuurd naar het email adres en telefoonnummer'))->success();\n }\n return redirect()->back();\n }",
"function createAppointment(){\n\n}",
"public function store(Request $request) {\n $attributes = $request->all();\n\n $salon = salon::findOrFail($attributes['appointment']['salon_id']);\n\n $customer = Customer::updateOrCreate([\n 'email' => $attributes['customer']['email']],\n $attributes['customer']\n );\n\n $data = array_merge($attributes['appointment'], ['customer_id' => $customer->id]);\n\n $appointment = Appointment::create($data);\n\n if ($appointment) {\n $customer->notify(new BookingRequested($appointment));\n $salon->notify(new BookingRequested($appointment));\n }\n\n return 'Done';\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|max:30',\n 'phone_number' => 'max:100',\n 'email' => 'max:100',\n 'artwork_id' => 'required|exists:artworks,id',\n 'datetime' => 'date_format:Y-m-d H:i:s'\n ]);\n\n // confirm that timeslot is still available\n $timeslot = new Timeslot;\n\n $timeslot->datetime = $request->input('datetime');\n\n if($timeslot->isAvailable() == FALSE)\n {\n return redirect('/timeslots/' . $request->input('artwork_id'));\n }\n \n $appointment=$request->all();\n $appointment = Appointment::create($appointment);\n \\Session::flash('flash_message', 'The appointment was created successfully');\n\n return redirect('/artworks');\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'doctor_speciality_id' => ['required'],\n 'begin_date' => ['required']\n ]);\n\n $appointment = new Appointment;\n $appointment->user_id = $request->get('user_id');\n $appointment->doctor_speciality_id = $request->get('doctor_speciality_id');\n $appointment->begin_date = $request->get('begin_date');\n $appointment->status = empty($request->get('user_id')) ? AppointmentStatus::Available : AppointmentStatus::Booked;\n $appointment->save();\n\n LogHelper::log(ActionType::Create, __('messages.appointments_succed_create'), $appointment);\n\n Mail::to($appointment->user->email)\n ->send(new AppointmentsNotification($appointment));\n\n return redirect('appointments')->with('success', __('messages.appointments_succed_create'));\n }",
"public function appointmentWasSet(){\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData(true);\n\n\t\t$org = OrganizationBranch::find($data['org_branch_id']);\n\t\t$org->set_goal_reminder = 1;\n\t\t$org->appointment_set = 1;\n\t\t$org->save();\n\n\t\tSession::put('userinfo.session_reset', 1);\n\n\t\treturn 'success';\n\t}"
] | [
"0.7609418",
"0.6516856",
"0.64588016",
"0.6432462",
"0.6414515",
"0.6364657",
"0.6342202",
"0.6328307",
"0.6276455",
"0.62624437",
"0.6235879",
"0.6223198",
"0.6194108",
"0.61675775",
"0.6156054",
"0.61114657",
"0.6064636",
"0.60617656",
"0.6058198",
"0.6049695",
"0.6043373",
"0.60077417",
"0.600621",
"0.6006017",
"0.5997051",
"0.59801155",
"0.5952578",
"0.59313947",
"0.5916753",
"0.5911076"
] | 0.7399553 | 1 |
Colocar el id del usuario que crea a Prodcuto | public function getIdUsuarioCreacion()
{
return $this->idUsuarioCreacion;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario()\n {\n return $this->id_usuario;\n }",
"public function getIdUsuario()\r\n {\r\n return $this->idUsuario;\r\n }",
"public function getId_usuario()\n {\n return $this->id_usuario;\n }",
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario() {\n return $this->idUsuario;\n }",
"public function getUsuario_id(){\n return $this->usuario_id;\n }",
"public function getIdUsuario()\n\t{\n\t\treturn $this->id_usuario;\n\t}",
"public function getUsuarioId(){\n\t\treturn $this->usuario_id;\n\t}",
"public function getIdusuario(){\n return $this->idusuario;\n }",
"public function getUsuarioId()\n {\n return $this->usuario_id;\n }",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getUsuarioId()\n {\n return $this->usuarioId;\n }",
"public function getID() { // GET ID \n return $this->utilisateur_id; // SET ID\n }",
"public function getUsuarioId()\n\t{\n\t\treturn $this->usuario_id;\n\t}",
"public function generateUser(){\n $usuario= new \\frontend\\modules\\sigi\\models\\users\\SignupForm();\n \n $usuario->email=$this->correo;\n $usuario->username=$this->unidad->generateUsername();\n $usuario->password=$this->unidad->generatePwd();\n $usuario->signupResidente($this->edificio_id);\n /* if(!$usuario->hasErrors()){\n $this->user_id=$usuario->id;\n $this->save();\n }*/\n return $usuario; \n \n }",
"private function create_test_user() {\n global $CFG;\n require_once($CFG->dirroot.'/elis/program/lib/data/user.class.php');\n\n $user = new user(array(\n 'idnumber' => 'testuseridnumber',\n 'username' => 'testuserusername',\n 'firstname' => 'testuserfirstname',\n 'lastname' => 'testuserlastname',\n 'email' => '[email protected]',\n 'country' => 'CA'\n ));\n $user->save();\n\n return $user->id;\n }",
"public function createUsuario()\n {\n $hash = password_hash($this->clave, PASSWORD_DEFAULT);\n $sql = 'INSERT INTO administrador(nombre, apellido, correo, telefono, clave, id_cargo)\n VALUES(?, ?, ?, ?, ?,?)';\n $params = array($this->nombres, $this->apellidos, $this->correo, $this->telefono, $hash, 1);\n return Database::executeRow($sql, $params);\n }",
"public function setIdUsuarioCreacion($idUsuarioCreacion = 1)\n {\n $this->idUsuarioCreacion = $idUsuarioCreacion;\n }",
"public function getId_utilisateur()\n {\n return $this->id_utilisateur;\n }",
"function _usersId(){\n $admin = false;\n if($this->Auth->user())\n return $this->Auth->user('nhanvien_id');\n }",
"public function getIdUsuario() {\n $identity = $this->session->get('auth-identity');\n return $identity['id'];\n }",
"public function getIdUtilisateur()\n {\n return $this->id_utilisateur;\n }",
"public function getIdUtilisateur()\n {\n return $this->Id_utilisateur;\n }",
"public function crear() {\n $sentencia = $this->bd->prepare(\"INSERT INTO usuario (nombre, correo, contraseña) VALUES (?, ?, ?);\");\n $respuesta = $sentencia->execute([$this->nombre, $this->correo, $this->contraseña]);\n $this->id = $this->bd->lastInsertId();\n return $respuesta;\n }",
"private function id()\n {\n return $this->user->id ?? null;\n }"
] | [
"0.6826983",
"0.6826983",
"0.6822851",
"0.68106014",
"0.67731416",
"0.67529374",
"0.67529374",
"0.67272854",
"0.67245466",
"0.67143756",
"0.6699043",
"0.66832674",
"0.66708875",
"0.66533947",
"0.66490835",
"0.66490835",
"0.66245633",
"0.6610696",
"0.655871",
"0.65397793",
"0.6524419",
"0.64743596",
"0.6425768",
"0.64161026",
"0.6404188",
"0.6400926",
"0.6395522",
"0.6392143",
"0.6371973",
"0.6368594"
] | 0.749759 | 0 |
Obtener el id del usuario que modifica a Producto | public function getIdUsuarioModificacion()
{
return $this->idUsuarioModificacion;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getId_usuario()\n {\n return $this->id_usuario;\n }",
"public function getIdUsuario()\n {\n return $this->id_usuario;\n }",
"public function getIdusuario(){\n return $this->idusuario;\n }",
"public function getIdUsuario()\r\n {\r\n return $this->idUsuario;\r\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getUsuario_id(){\n return $this->usuario_id;\n }",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getIdUsuario()\n\t{\n\t\treturn $this->id_usuario;\n\t}",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getUsuarioId()\n {\n return $this->usuarioId;\n }",
"public function getUsuarioId()\n {\n return $this->usuario_id;\n }",
"public function getIdUsuario() {\n return $this->idUsuario;\n }",
"public function getUsuarioId(){\n\t\treturn $this->usuario_id;\n\t}",
"public function GetIdProducto()\n\t{\n\t\treturn $this->id_producto;\n\t}",
"public function getId(){\n return $this->productos_id;\n }",
"public function getIdProducto()\n {\n return $this->idProducto;\n }",
"public function getUsuarioId()\n\t{\n\t\treturn $this->usuario_id;\n\t}",
"public function setIdUsuarioModificacion($idUsuarioModificacion = 1)\n {\n $this->idUsuarioModificacion = $idUsuarioModificacion;\n }",
"public function setIdusuario($value){\n\n\t\t$this->idusuario = $value;\n\n\t}",
"public function getIdProducto()\n {\n return $this->IdProducto;\n }",
"public function setIdUsuario($usuario)\n\t{\n\t\t$model = Usuarios::model()->findByAttributes(array('usuario'=>$usuario));\n\t\tif ($model == NULL)\n\t\t\t$model = Usuarios::model()->findByAttributes(array('correo'=>$usuario));\n\t\tYii::app()->user->setState('id_usuario', $model->id);\n\t}",
"public function getIdUsuarioCreacion()\n {\n return $this->idUsuarioCreacion;\n }",
"public function getID() { // GET ID \n return $this->utilisateur_id; // SET ID\n }",
"public function getId()\n {\n return $this->user->id;\n }",
"public function modificar_usuario() {\n\n\n try{\n \n $pdo = AccesoDB::getCon();\n\n $sql_mod_usu = \"UPDATE `usuario`\n SET\n `nom_usu` = :nombre\n WHERE `id_usu` = :id \";\n\n\n $stmt = $pdo->prepare($sql_mod_usu);\n $stmt->bindParam(\":nombre\", $this->nombre, PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $this->id_usu, PDO::PARAM_INT);\n\n $stmt->execute();\n \n\n } catch (Exception $e) {\n echo \"-1\";\n //echo\"Error, comuniquese con el administrador\". $e->getMessage().\"\";\n }\n }",
"public function setIdusuario($idusuario){\n $this->idusuario = $idusuario;\n }"
] | [
"0.68412966",
"0.68412966",
"0.683481",
"0.6785618",
"0.6776393",
"0.6685711",
"0.6682569",
"0.6682569",
"0.6675576",
"0.66700125",
"0.66700125",
"0.6656674",
"0.6624504",
"0.6595253",
"0.65869707",
"0.65764797",
"0.65678746",
"0.656162",
"0.6524691",
"0.65075904",
"0.64838326",
"0.6480059",
"0.64531213",
"0.6429279",
"0.6427452",
"0.6412952",
"0.6399547",
"0.6339978",
"0.6332535",
"0.6313143"
] | 0.742913 | 0 |
Colocar el id del usuario que modifica a Producto | public function setIdUsuarioModificacion($idUsuarioModificacion = 1)
{
$this->idUsuarioModificacion = $idUsuarioModificacion;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdUsuarioModificacion()\n {\n return $this->idUsuarioModificacion;\n }",
"public function getId_usuario()\n {\n return $this->id_usuario;\n }",
"public function modificar_usuario() {\n\n\n try{\n \n $pdo = AccesoDB::getCon();\n\n $sql_mod_usu = \"UPDATE `usuario`\n SET\n `nom_usu` = :nombre\n WHERE `id_usu` = :id \";\n\n\n $stmt = $pdo->prepare($sql_mod_usu);\n $stmt->bindParam(\":nombre\", $this->nombre, PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $this->id_usu, PDO::PARAM_INT);\n\n $stmt->execute();\n \n\n } catch (Exception $e) {\n echo \"-1\";\n //echo\"Error, comuniquese con el administrador\". $e->getMessage().\"\";\n }\n }",
"public function getIdusuario(){\n return $this->idusuario;\n }",
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getIdusuario()\n {\n return $this->idusuario;\n }",
"public function getIdUsuario()\n {\n return $this->id_usuario;\n }",
"public function setIdUsuario($usuario)\n\t{\n\t\t$model = Usuarios::model()->findByAttributes(array('usuario'=>$usuario));\n\t\tif ($model == NULL)\n\t\t\t$model = Usuarios::model()->findByAttributes(array('correo'=>$usuario));\n\t\tYii::app()->user->setState('id_usuario', $model->id);\n\t}",
"public function getUsuario_id(){\n return $this->usuario_id;\n }",
"public function setIdusuario($value){\n\n\t\t$this->idusuario = $value;\n\n\t}",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getUsuario_id()\n {\n return $this->usuario_id;\n }",
"public function getIdUsuario()\r\n {\r\n return $this->idUsuario;\r\n }",
"public function setIdusuario($idusuario){\n $this->idusuario = $idusuario;\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function editarComent(){\n\t\t \n$sql=\"Update usuarios set id_usuario=$this->id_usuario,observaciones='$this->observaciones' where id_usuario=\".$this->id_usuario;\n\t\t $this->con->query($sql);\n\t\t \n\t\t \n\t\t }",
"function aeph_renovarMembresiaConId($id_usuario){\n\t\t\t\n\t\t\t$expiracion=(int)get_the_author_meta( 'exp_date', $id_usuario );\n\t\t\t$nuevaExpiracion = strtotime('+1 years', $expiracion);\n\t\t\t\n\t\t\t$this->aeph_set_member_role($id_usuario,'Miembro');\t\t\t\n\t\t\tupdate_user_meta( $id_usuario, \"exp_date\",$nuevaExpiracion);\n\t\t\techo '<div class=\"updated fade\"><p>'.'ID: '.$id_usuario.'Vieja Fecha: '.$expiracion.' Nueva Fecha:'.$nuevaExpiracion.'</p></div>';\n\t\t}",
"public function getIdUsuario()\n {\n return $this->idUsuario;\n }",
"public function getIdUsuario()\n\t{\n\t\treturn $this->id_usuario;\n\t}",
"public function modificar()\n\t{\n\t\t$personasModelo = new PersonasModelo();\t\n\t\t$personasModelo->ModificarPersona($this->personaID, $this->nombre, $this->apellido, $this->usuario,$this->password, $this->telefono, $this->email, $this->direccion, $this->direccionCoordenadas, $this->direccionDefault, $this->direccionTipo, $this->estado, $this->rolID, $this->documento, $this->agenciaID);\n\t\techo \" La persona con ID: \", $this->personaID . \" es la persona actualizada\";\t\t\n\t}",
"public static function editarUsuario($usuario){\n try {\n $conexion = database::conexion();\n $id = $usuario->get_id();\n $actualizacion = \"UPDATE usuarios SET email=:email, password=:password, id=:id WHERE id=$id\";\n $consultaPreparada = $conexion->prepare($actualizacion);\n $consultaPreparada->bindValue(':email', $usuario->get_email());\n $consultaPreparada->bindValue(':password', $usuario->get_password());\n $consultaPreparada->bindValue(':id', $usuario->get_id());\n $consultaPreparada->execute();\n $exito = 1;\n return $exito;\n } catch (exception $e) {\n $exito = 0;\n return $exito;\n }\n}",
"public function getIdUsuario() {\n return $this->idUsuario;\n }",
"public function getUsuarioId(){\n\t\treturn $this->usuario_id;\n\t}",
"public function getId(){\n return $this->productos_id;\n }",
"public function getUsuarioId()\n {\n return $this->usuario_id;\n }",
"public function GetIdProducto()\n\t{\n\t\treturn $this->id_producto;\n\t}",
"public function getUsuarioId()\n {\n return $this->usuarioId;\n }",
"public static function modifica() {\n $method = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($method === \"POST\") {\n $id = $_POST[\"utente\"];\n\n if (self::isLogged() && CUtente::getUtente()->getId() == $id) {\n $pm = FPersistentManager::getInstance();\n\n $utente = self::getUtente();\n\n try {\n if (isset($_POST[\"nome\"])) {\n $utente->setNome($_POST[\"nome\"]);\n $pm->update($utente->getId(), \"id\", $utente->getNome(), \"nome\", \"EUtente\");\n }\n\n if (isset($_POST[\"cognome\"])) {\n $utente->setCognome($_POST[\"cognome\"]);\n $pm->update($utente->getId(), \"id\", $utente->getCognome(), \"cognome\", \"EUtente\");\n }\n\n if (isset($_POST[\"username\"])) {\n $usr = FPersistentManager::getInstance()->load($_POST[\"username\"], \"username\", \"EUtente\");\n if($usr instanceof EUtente && ($utente->getUsername() !== $_POST[\"username\"])){\n VUtente::modifica($utente, FPersistentManager::getInstance()->load($utente->getId(),\"idUtente\",\"EMediaUtente\"), EGenere::getAll(), FPersistentManager::getInstance()->isASub($utente), explode(\";\", FPersistentManager::getInstance()->load($utente->getId(), \"idUtente\", \"FNewsLetter\")), \"username già in uso da un altro utente\");\n die;\n }\n $utente->setUsername($_POST[\"username\"]);\n $pm->update($utente->getId(), \"id\", $utente->getUsername(), \"username\", \"EUtente\");\n }\n\n if (isset($_POST[\"email\"])) {\n $usr = FPersistentManager::getInstance()->load($_POST[\"email\"], \"email\", \"EUtente\");\n if($usr instanceof EUtente && ($utente->getEmail() !== $_POST[\"email\"])){\n VUtente::modifica($utente, FPersistentManager::getInstance()->load($utente->getId(),\"idUtente\",\"EMediaUtente\"), EGenere::getAll(), FPersistentManager::getInstance()->isASub($utente), explode(\";\", FPersistentManager::getInstance()->load($utente->getId(), \"idUtente\", \"FNewsLetter\")), \"email già in uso da un altro utente\");\n die;\n }\n $utente->setEmail($_POST[\"email\"]);\n $pm->update($utente->getId(), \"id\", $utente->getEmail(), \"email\", \"EUtente\");\n }\n\n if (isset($_POST[\"vecchiaPassword\"]) && $_POST[\"vecchiaPassword\"] != \"\") {\n if (password_verify($_POST[\"vecchiaPassword\"], $utente->getPassword())) {\n $utente->setPassword($_POST[\"nuovaPassword\"]); //Check password\n\n $pm->updatePasswordUser($utente);\n } else {\n VUtente::modifica($utente, FPersistentManager::getInstance()->load($utente->getId(),\"idUtente\",\"EMediaUtente\"), EGenere::getAll(), FPersistentManager::getInstance()->isASub($utente), explode(\";\", FPersistentManager::getInstance()->load($utente->getId(), \"idUtente\", \"FNewsLetter\")), \"La password vecchia non coincide\");\n die;\n }\n }\n if (is_uploaded_file($_FILES[\"propic\"][\"tmp_name\"])) {\n if (EInputChecker::getInstance()->isImage($_FILES[\"propic\"][\"type\"]) && EInputChecker::getInstance()->isLight($_FILES[\"propic\"][\"size\"])) {\n $propic = $_FILES[\"propic\"];\n\n $name = $propic[\"name\"];\n $mimeType = $propic[\"type\"];\n\n $propic = file_get_contents($propic[\"tmp_name\"]);\n $propic = base64_encode($propic);\n\n $data = new DateTime('now');\n $data = $data->format('Y-m-d');\n\n FPersistentManager::getInstance()->update($utente->getId(), \"idUtente\", $propic, \"immagine\", \"EMediaUtente\");\n FPersistentManager::getInstance()->update($utente->getId(), \"idUtente\", $data, \"date\", \"EMediaUtente\");\n FPersistentManager::getInstance()->update($utente->getId(), \"idUtente\", $name, \"fileName\", \"EMediaUtente\");\n FPersistentManager::getInstance()->update($utente->getId(), \"idUtente\", $mimeType, \"mimeType\", \"EMediaUtente\");\n } else {\n VError::error(10);\n }\n\n }\n\n if(isset($_POST[\"newsletter\"])){\n $prefs = \"\";\n foreach (EGenere::getAll() as $genere){\n if(isset($_POST[$genere])){\n $prefs .= $genere . \";\";\n }\n }\n $prefs = substr($prefs,0,-1);\n if(FPersistentManager::getInstance()->isASub($utente)){\n FPersistentManager::getInstance()->update($utente->getId(), \"idUtente\", $prefs, \"preferenze\", \"ENewsLetter\");\n } else {\n FPersistentManager::getInstance()->saveNS($utente, $prefs);\n }\n } else {\n if(FPersistentManager::getInstance()->isASub($utente)){\n FPersistentManager::getInstance()->delete($utente->getId(), \"idUtente\", \"ENewsLetter\");\n }\n }\n\n self::saveSession($utente);\n header(\"Location: /MagicBoulevardCinema/Utente/show/?id=\" . $utente->getId());\n } catch (Exception $e) {\n VUtente::modifica($utente, FPersistentManager::getInstance()->load($utente->getId(),\"idUtente\",\"EMediaUtente\"), EGenere::getAll(), FPersistentManager::getInstance()->isASub($utente), explode(\";\", FPersistentManager::getInstance()->load($utente->getId(), \"idUtente\", \"FNewsLetter\")));\n }\n } else {\n CFrontController::unauthorized();\n }\n } elseif ($method === \"GET\") {\n $id = $_GET[\"id\"];\n\n if (self::isLogged() && CUtente::getUtente()->getId() == $id) {\n $pm = FPersistentManager::getInstance();\n $utente = CUtente::getUtente();\n\n $propic = $pm->load($utente->getId(),\"idUtente\",\"EMediaUtente\");\n\n VUtente::modifica($utente, $propic, EGenere::getAll(), FPersistentManager::getInstance()->isASub($utente), explode(\";\", FPersistentManager::getInstance()->load($utente->getId(), \"idUtente\", \"FNewsLetter\")));\n } else {\n CFrontController::unauthorized();\n }\n } else {\n CFrontController::methodNotAllowed();\n }\n }",
"public function getIdProducto()\n {\n return $this->idProducto;\n }"
] | [
"0.7205439",
"0.653718",
"0.653509",
"0.65261084",
"0.65133154",
"0.65133154",
"0.65110314",
"0.6475831",
"0.6460665",
"0.6446215",
"0.6425173",
"0.6425173",
"0.6418441",
"0.6400874",
"0.63964576",
"0.63964576",
"0.6387045",
"0.6386535",
"0.63772553",
"0.6369127",
"0.6338707",
"0.63076234",
"0.6287934",
"0.6243737",
"0.62435",
"0.6237478",
"0.6227429",
"0.6215766",
"0.62124026",
"0.61997855"
] | 0.65553486 | 1 |
Eliminar Producto de la base de datos | public function Eliminar()
{
$sentenciaSql = "DELETE FROM producto
WHERE id_producto = $this->idProducto";
$this->conn->preparar($sentenciaSql);
$this->conn->ejecutar();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function eliminarProductoModel($produ){\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE productos SET eliminado=1 WHERE id_producto='$produ'\");\n\t\t//se ejecuta la consulta\n\t\treturn $stmt->execute();\n\t\t$stmt->close();\n\t}",
"public function delete($idProducto);",
"function erase()\n\t\t{\n\t\tif ($this->id<>0)\n\t\t\t{\n\n\t\t\t\t$conn = new Conexion();\n\t\t\t\t$sql = $conn->prepare(\"DELETE FROM productos WHERE id = $this->id \");\n\t\t\t\t$sql->execute();\n\t\t\t}\n\t\t\n\t\t}",
"public function eliminar()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['id']) && !empty($_POST['id'])) :\n if ($this->model->actualizarProducto([], 'update', 'Estado_P', 4, $_POST['id'])) {\n echo \"true\";\n } else {\n echo \"false\";\n }\n endif;\n }",
"static public function ctrEliminarProducto(){\n\n\t\tif(isset($_GET[\"idProducto\"])){\n\n\t\t\t$tabla =\"productos\";\n\t\t\t$datos = $_GET[\"idProducto\"];\n\n\t\t\tif($_GET[\"imagen\"] != \"\" && $_GET[\"imagen\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\tunlink($_GET[\"imagen\"]);\n\t\t\t\trmdir('vistas/img/productos/'.$_GET[\"codigo\"]);\n\n\t\t\t}\n\n\t\t\tControladorProductos::ctrbKProductos($tabla, \"id\", $_GET[\"idProducto\"], \"ELIMINAR\");\n\n\t\t\t$respuesta = ModeloProductos::mdlEliminarProducto($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"El producto ha sido borrado correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\t\t}\n\n\n\t}",
"static public function ctrEliminarProducto(){\n\n\t\tif(isset($_GET[\"idProducto\"])){\n\n\t\t\t$tabla =\"productos\";\n\t\t\t$datos = $_GET[\"idProducto\"];\n\n\t\t\tif($_GET[\"imagen\"] != \"\" && $_GET[\"imagen\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\tunlink($_GET[\"imagen\"]);\n\t\t\t\trmdir('vistas/img/productos/'.$_GET[\"codigo\"]);\n\n\t\t\t}\n\n\t\t\t$respuesta = ModeloProductos::mdlEliminarProducto($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"El producto ha sido borrado correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\t\t}\n\n\n\t}",
"static public function mdlEliminarProducto($tabla, $datos){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id = :id\");\r\n\r\n\t\t$stmt -> bindParam(\":id\", $datos, PDO::PARAM_INT);\r\n\r\n\t\tif($stmt -> execute()){\r\n\r\n\t\t\treturn \"ok\";\r\n\t\t\r\n\t\t}else{\r\n\r\n\t\t\treturn \"error\";\t\r\n\r\n\t\t}\r\n\r\n\t\t$stmt -> close();\r\n\r\n\t\t$stmt = null;\r\n\r\n\t}",
"function eliminar_Productos(){\n $conexion = Conexion(); \n $sql = \"DELETE FROM tbl_productos WHERE sku = '$this->sku';\"; \n $conexion->query($sql);\n echo\"<script type=\\\"text/javascript\\\">alert('producto Eliminado'); window.location='../Vista/Productos.php'; </script>\";\n }",
"public function eliminar_producto()\n {\n $id = $this->uri->segment(2);\n $data = array(\n 'eliminado' => 'SI',\n );\n\n $this->producto_model->estado_producto($id, $data);\n redirect('productos_todos', 'refresh');\n }",
"function borrarProductoBD($id){\n $manager = new ManageProduct($this->getDataBase());\n return $manager->removeProducto($id);\n }",
"function eliminarProducto($idProducto,$categoria){ //Función para eliminar un producto\n $conexion = conectar();\n $query = \"UPDATE producto SET estado = FALSE WHERE idProducto='\".$idProducto.\"' AND Categoria_idCategoria = '\".$categoria.\"'\";\n $conexion->query($query); //El query no elimina el registro de la base de datos sino que modifica la variable estado ya que si se elimina\n }",
"public function productDeleting($data){\n //Se obtiene el ID del producto que se desea eliminar\n $this->db->select('product_id');\n $this->db->from('product');\n $this->db->where('product_name', $data['product_name']);\n $result = $this->db->get();\n $product_id = $result->row();\n \n //Se borra el producto\n $this->db->where('product_id', $product_id->product_id);\n $this->db->delete('product', $data);\n \n //Y todos los clientes que tenia ofrecidos\n $queryDeleteProduct =\"DELETE FROM product_client WHERE product_id = '\".$product_id->product_id.\"';\";\n $this->db->query($queryDeleteProduct);\n }",
"function delete_produto($id)\n {\n $this->db->delete('produto',array('id'=>$id));\n }",
"public function ExcluirEstoqueProdutoById(EstoqueProdutoDTO $EstoqueProdutoDTO){\n try {\n //Conexão com o banco de dados pela classe PDO\n $pdo = Conexao::getinstance();\n //Comando em SQL para excluir os dados na tabela estoque_produto cujo o id seja igual ao do bind\n $sql = \"DELETE FROM estoque_produto WHERE produto = ?\";\n //Prepara o sql para receber o bind\n $stmt = $pdo->prepare($sql);\n //Metodo que guarda o valor setado no atributo produto\n $stmt->bindValue(1, $EstoqueProdutoDTO->getProduto());\n //Executa o SQL\n $stmt->execute();\n } catch (PDOException $ex) {\n echo \"\".$ex;\n }\n }",
"function delete()\n {\n $productDao = new ProductDao();\n $row = new product(1, \"trung\", \"abc\");\n return $productDao->delete($row);\n }",
"static public function mdlEliminarProducto( $tabla, $id){\n\n\n\n \t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE codproducto = :$id\");\n\n\t\t\n \t\t$stmt -> bindParam(\":\".$id , $id, PDO::PARAM_STR);\n \t\t\n \t\tif( $stmt -> execute()) \n \t\t\treturn \"ok\";\n \t\telse \n \t\t\treturn \"error\";\n\n \t\t$stmt-> close();\n \t\t$stmt= null;\n \t}",
"public function destroy($id) /* elimina el producto */\n {\n\n }",
"public function proceso_eliminar_compra() {\n\n require 'model/ItemModel.php';\n $items = new ItemModel();\n if ((!empty($_POST[\"idsElimina\"]) && is_array($_POST[\"idsElimina\"]))) {\n $arrayidEliminar = $_POST[\"idsElimina\"];\n $array_num = count($arrayidEliminar);\n for ($i = 0; $i < $array_num; $i++) {\n\n\n $items->eliminar_articulo_agregado_al_carrito($arrayidEliminar[$i]);\n }\n }\n $idCliente = $_SESSION['idCliente'];\n $data['listadoCarrito'] = $items->listarArticulosAgregadosCarrito($idCliente);\n $this->view->show(\"vistaClienteEliminarArticulo.php\", $data);\n }",
"public function Borrar()\n {\n // section 10-25-2--51--31a7ca5b:13394855662:-8000:000000000000110A begin\n if (@$_REQUEST[Aceptar]) {\n\t\t\t$this->miModelo->deleteRow(@$_REQUEST[id]);\n\t\t\t$this->mensage = \"El registro ha sido borrado\";\n\t\t\t$this->Lista();\n\t\t}\n\t\telse {\t\t\t\t\n\t\t\t$datos = $this->miModelo->searchById(@$_REQUEST[id]);\n\t\t\t$this->miVista->showPlantilla(\"VistaPlantillaFormaBorrarProductos.php\",$datos);\t\t\t\t\t\t\n\t\t}\t \n // section 10-25-2--51--31a7ca5b:13394855662:-8000:000000000000110A end\n }",
"public function eliminarProductsModel($datosModel,$tabla){\n\t\t\t$stmt = Conexion::conectar()->prepare(\"DELETE FROM $tabla WHERE id_product = :id\");\n\t\t\t$stmt->bindParam(\":id\",$datosModel,PDO::PARAM_INT);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn \"success\";\n\t\t\t}else{\n\t\t\t\treturn \"error\";\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t}",
"public function eliminar($param) {\n extract($param);\n // error_log(print_r($param, TRUE)); // quitar comentario para ver lo que se recibe del front-end\n $sql = \"DELETE FROM proveedores WHERE id_proveedor= :id_proveedor\";\n $instruccion = $conexion->pdo->prepare($sql);\n\n if ($instruccion) {\n if ($instruccion->execute([\":id_proveedor\" => $id_proveedor])) {\n $estado = $conexion->errorInfo($instruccion);\n echo $conexion->errorInfo($instruccion);\n } else {\n echo $conexion->errorInfo($instruccion);\n }\n } else {\n echo json_encode(['ok' => FALSE, 'mensaje' => 'Falló en la eliminación de clientes']);\n }\n }",
"public function delete(){\n\n //fazer a conexao com o BD\n $sql = new Sql();\n \n //realiza a operacao de deletar\n $sql->query(\"DELETE FROM tb_orders WHERE idorder = :idorder\", [\n //faz o bind dos parametros\n ':idorder'=>$this->getidorder()//pega o objeto dentro da propria classe\n ]);\n\n }",
"public function remove()\n {\n // ambil id unique dari product mau di hapus dari cart, bukan id dari database\n $row_id = $_POST[\"row_id\"];\n $data = [\n 'rowid' => $row_id, // rowid adalah id unique dari library cart\n 'qty' => 0\n ];\n $this->cart->update($data);\n echo $this->view();\n }",
"function elimina_producto($linea){ \n \t$this->array_id_prod[$linea]=0; \n \t}",
"function elimina_producto($linea){ \n \t$this->array_id_prod[$linea]=0; \n \t}",
"public function remove()\n {\n if (isset($_GET['id'])) {\n\n $id = $_GET['id'];\n $borrdo = false;\n $indice = 0;\n\n // Estraigo en array para poder usarlo con mas facilidad\n\n $array = $_SESSION['carrito'];\n for ($i = 0; $i < count($array); $i++) {\n // con el ciclo for recoro mi array y busco si exite ese producto en mi carrito\n if ($array[$i]['producto_id'] == $id) {\n $indice = $i;\n $borrdo = true;\n }\n }\n // Si llego a esta parte si encontro el valor el articulo en nuestro carrtio\n if ($borrdo == true) {\n\n unset($array[$indice]);\n $arrays = array_values($array);\n $_SESSION['carrito'] = $arrays;\n header('location:' . URL_BASE . 'carrito/index');\n }\n\n\n // echo '<pre>';\n // print_r($_SESSION['carrito']);\n // echo '</pre>';\n\n\n }\n }",
"public function remove(Product $product);",
"public function postEliminar(Request $request){\n\n $carrito = Carrito::find($request->input(\"id\"));\n if($carrito){\n if($carrito->delete()){\n return response()->json([\n \"status\" => 200,\n \"message\" => \"Producto eliminado del carrito satisfactoriamente\",\n ],200);\n }\n }\n\n return response()->json([\n \"status\" => 500,\n \"message\" => \"Ha ocurrido un error interno\",\n ], 500);\n }",
"public function delete(Product $product)\n {\n\n }",
"function eliminar_producto_d_carro($id_carro, $id_producto){\n $con = getConexion(); \n $sql = \"DELETE FROM asoc_producto_carro WHERE id_carro = $id_carro AND id_producto = $id_producto\";\n $result = $con->query($sql);\n if($con->connect_errno){\n $con->close(); \n return false; \n }\n return $result;\n }"
] | [
"0.74042106",
"0.73632765",
"0.73546755",
"0.72566605",
"0.7244113",
"0.717484",
"0.71627986",
"0.7162087",
"0.7152096",
"0.71509653",
"0.7070126",
"0.7040267",
"0.70318586",
"0.702371",
"0.70096487",
"0.7007265",
"0.70070404",
"0.69677913",
"0.6965839",
"0.6949036",
"0.6947514",
"0.6943528",
"0.69339734",
"0.69159436",
"0.69159436",
"0.6906539",
"0.6886956",
"0.6865683",
"0.6840834",
"0.68279475"
] | 0.7579989 | 0 |
/$ccData = new SimpleXMLElement('servicePrefix . ':CreditCardInformation>servicePrefix . ':CreditCardInformation>'); $ccData>addChild('CreditCardInformation>Type', NULL); // Visa/Mastercard/AmericanExpress $ccData>addChild('CreditCardInformation>Number', NULL); $ccData>addChild('CreditCardInformation>Name', NULL); $ccData>addChild('CreditCardInformation>ExpiryMonth', NULL); $ccData>addChild('CreditCardInformation>CVV', NULL); | function buildCreditCard() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getBasePaymentXMLWithCard()\n {\n $this->getCard()->validate();\n\n $xml = $this->getBasePaymentXML();\n\n $card = $xml->Payment->TxnList->Txn->addChild('CreditCardInfo');\n $card->addChild('cardNumber', $this->getCard()->getNumber());\n $card->addChild('cvv', $this->getCard()->getCvv());\n $card->addChild('expiryDate', $this->getCard()->getExpiryDate('m/y'));\n $card->addChild('cardHolderName', $this->getCard()->getName());\n $card->addChild('recurringflag', 'no');\n\n return $xml;\n }",
"function Create_Card($security_key, $transaction_code, $account_number, $tariff, $uipass, $credit, $language, $activated, $simultaccess, $currency, $runservice, \n\t $typepaid, $creditlimit, $enableexpire, $expirationdate, $expiredays, $lastname, $firstname, $address, $city, $state, $country, $zipcode, $phone, $fax, \n\t $callerid_list, $iax_friend, $sip_friend){ \n\t \n\t \t\t\n\t\t\t// The wrapper variables for security\n \t\t\t// $security_key = API_SECURITY_KEY;\n\t\t\t$logfile=SOAP_LOGFILE;\t\n\n\t\t\t$mysecurity_key = API_SECURITY_KEY;\n\t\t\t\t\t\t\n\t\t\t$mail_content = \"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\"SOAP API - Request asked: Create_Card [$transaction_code, $account_number, $tariff, $uipass, $credit, $language, $activated, $simultaccess, $currency, $runservice, $typepaid, $creditlimit, $enableexpire, $expirationdate, $expiredays, $lastname, $firstname, $address, $city, $state, $country, $zipcode, $phone, $fax, $callerid_list, $iax_friend, $sip_friend]\";\n\t\t\t\n\t\t\t// CHECK SECURITY KEY\n\t\t\t if (md5($mysecurity_key) !== $security_key || strlen($security_key)==0)\n\t\t\t {\n\t\t\t\t mail(EMAIL_ADMIN, \"ALARM : API - CODE_ERROR SECURITY_KEY \", $mail_content);\n\t\t\t\t error_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\" CODE_ERROR SECURITY_KEY\".\"\\n\", 3, $logfile);\n\t\t\t\t sleep(2);\n\t\t\t\t return array($transaction_code, '', '', '', '', 'Error', 'KEY - BAD PARAMETER'.\"$security_key - $mysecurity_key\");\t\t\t\t \n\t\t\t } \n\t\t\t \n\t\t\t \n\t\t\t// Create new account\t\t\t\n\t\t\t$FG_ADITION_SECOND_ADD_TABLE = \"cc_card\";\t\t\n\t\t\t$FG_ADITION_SECOND_ADD_FIELDS = \"username, useralias, credit, tariff, id_didgroup, activated, lastname, firstname, email, address, city, state, country,\".\n\t\t\t\"zipcode, phone, fax, userpass, simultaccess, currency, typepaid, creditlimit, language, runservice, enableexpire, expirationdate, expiredays, uipass, sip_buddy, iax_buddy\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$arr_card_alias = gen_card_with_alias('cc_card', 1);\n\t\t\t$cardnum = $arr_card_alias[0];\n\t\t\t$useralias = $arr_card_alias[1];\n\t\t\tif ($uipass=='' || \tstrlen($uipass)==0)\t\t$uipass = MDP_STRING();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t \t// CHECK PARAMETERS LASTNAME ; FIRSTNAME ; ADDRESS ; ....\n \t\t \tif (!is_numeric($credit) || !is_numeric($creditlimit) || !is_numeric($expiredays) || ($activated!=0 && $activated!=1) || ($simultaccess!=0 && $simultaccess!=1) || ($runservice!=0 && $runservice!=1) || strlen($lastname)>40 || strlen($firstname)>40 || strlen($address)>100 || strlen($city)>40 || strlen($state)>40 || strlen($country)>40 || strlen($zipcode)>40 || strlen($phone)>40 || strlen($email)>60 || strlen($fax)>40)\n \t\t\t{\n\t \t\t\tmail(EMAIL_ADMIN, \"ALARM : API - BAD PARAMETER \", $mail_content);\t \t\t\t\n\t \t\t\terror_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\" - BAD PARAMETER \".\"\\n\", 3, $logfile);\n\t\t\t\treturn array($transaction_code, '', '', '', '', 'Error', 'BAD PARAMETER');\n \t\t\t}else{\n \t\t\t\t\n\t\t\t\tif ($expirationdate=='') $expirationdate=\"now()\";\n\t\t\t\telse $expirationdate=\"'$expirationdate'\";\n\t\t\t\t$DBHandle = DbConnect();\n\t\t\t\t\n\t\t\t\t$instance_sub_table = new Table($FG_ADITION_SECOND_ADD_TABLE, $FG_ADITION_SECOND_ADD_FIELDS);\n\t\t\t\t$FG_ADITION_SECOND_ADD_VALUE = \"'$cardnum', '$useralias', '\".$credit.\"', '\".$tariff.\"', '0', '$activated', '$lastname', '$firstname', '$email', '$address', '$city', \"\n\t\t\t\t.\"'$state', '$country', '$zipcode', '$phone', '$fax', '$cardnum', \".$simultaccess.\", '\".$currency.\"', '\".$typepaid.\"','\".$creditlimit.\"', '\".$language.\"', '\".$runservice.\"', '\"\n\t\t\t\t.$enableexpire.\"', $expirationdate, '$expiredays', '$uipass', '$iax_friend', '$sip_friend'\";\n\t\t\t\t\n\t\t\t\t$result_query = $instance_sub_table -> Add_table ($DBHandle, $FG_ADITION_SECOND_ADD_VALUE, null, null, 'id');\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($result_query){\t\n\t\t\t\t\t\n\t\t\t\t\t$id_cc_card = $result_query;\n\t\t\t\t\t\n\t\t\t\t\tif (strlen($callerid_list)>1){\n\t\t\t\t\t\t$callerid_list = split(',',$callerid_list);\n\t\t\t\t\t\tif (count($callerid_list)>0){\n\t\t\t\t\t\t\t$k=0;\n\t\t\t\t\t\t\tforeach ($callerid_list as $mycallerid){\n\t\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t\t\tif (strlen($mycallerid)>1){\n\t\t\t\t\t\t\t\t\t$QUERY = \"SELECT * FROM cc_callerid WHERE cid='$mycallerid'\";\n\t\t\t\t\t\t\t\t\t$result = $instance_sub_table -> SQLExec ($DBHandle, $QUERY);\n\t\t\t\t\t\t\t\t\tif (!is_array($result)){\n\t\t\t\t\t\t\t\t\t\t$QUERY = \"INSERT INTO cc_callerid (cid, id_cc_card) VALUES ('$mycallerid', '$id_cc_card')\";\n\t\t\t\t\t\t\t\t\t\t$result = $instance_sub_table -> SQLExec ($DBHandle, $QUERY, 0);\n\t\t\t\t\t\t\t\t\t\tif ($result==false)\n\t\t\t\t\t\t\t\t\t\t\t$callerid_result .= \"|callerid$k-$mycallerid=NOK\"; \n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t$callerid_result .= \"|callerid$k-$mycallerid=OK\"; \n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$callerid_result .= \"|callerid$k-$mycallerid=NOK\"; \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\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//return array('transaction_code', 'account_number', 'card_number', $useralias, 'uipass', 'result', \"IDCARD_CREATED=$id_cc_card\".\"$callerid_result\");\n\t\t\t\t\t//|LASTQUERY=$QUERY\n\t\t\t\t\t\n\t\t\t\t\t// CHECK IF THERE IS A FRIEND TO CREATE\n\t\t\t\t\tif ($iax_friend || $sip_friend){\n\t\t\t\t\t\n\t\t\t\t\t\t// NEW ACCOUNT CREATED \t\t\t\t\t\n\t\t\t\t\t\t$type = FRIEND_TYPE;\n\t\t\t\t\t\t$allow = FRIEND_ALLOW;\n\t\t\t\t\t\t$context = FRIEND_CONTEXT;\n\t\t\t\t\t\t$nat = FRIEND_NAT;\n\t\t\t\t\t\t$amaflags = FRIEND_AMAFLAGS;\n\t\t\t\t\t\t$qualify = FRIEND_QUALIFY;\n\t\t\t\t\t\t$host = FRIEND_HOST; \n\t\t\t\t\t\t$dtmfmode = FRIEND_DTMFMODE;\n\t\t\t\t\t\t$uipass = MDP_STRING();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$FG_QUERY_ADITION_SIP_IAX='name, type, username, accountcode, regexten, callerid, amaflags, secret, md5secret, nat, dtmfmode, qualify, canreinvite,disallow, allow, host, callgroup, context, defaultip, fromuser, fromdomain, insecure, language, mailbox, permit, deny, mask, pickupgroup, port,restrictcid, rtptimeout, rtpholdtimeout, musiconhold, regseconds, ipaddr, cancallforward';\n\t\t\t\t\t\t\n\t\t\t\t\t\t// For IAX and SIP\n\t\t\t\t\t\t$param_add_fields = \"name, accountcode, regexten, amaflags, callerid, context, dtmfmode, host, type, username, allow, secret\";\n\t\t\t\t\t\t$param_add_value = \"'$cardnum', '$cardnum', '$cardnum', '$amaflags', '$cardnum', '$context', '$dtmfmode','$host', '$type', '$cardnum', '$allow', '\".$uipass.\"', '$id_cc_card', '$nat', '$qualify'\";\n\t\t\t\t\t\t$list_names = explode(\",\",$FG_QUERY_ADITION_SIP_IAX);\n\t\t\t\t\t\t$FG_TABLE_SIP_NAME=\"cc_sip_buddies\";\n\t\t\t\t\t\t$FG_TABLE_IAX_NAME=\"cc_iax_buddies\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($ki=0;$ki<2;$ki++){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($ki==0){\n\t\t\t\t\t\t\t\tif (!$sip_friend) continue;\n\t\t\t\t\t\t\t\t$cfriend='sip'; $FG_TABLE_NAME=\"cc_sip_buddies\";\n\t\t\t\t\t\t\t\t$buddyfile = BUDDY_SIP_FILE;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tif (!$iax_friend) continue;\n\t\t\t\t\t\t\t\t$cfriend='iax'; $FG_TABLE_NAME=\"cc_iax_buddies\";\n\t\t\t\t\t\t\t\t$buddyfile = BUDDY_IAX_FILE;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Insert Sip/Iax account info\n\t\t\t\t\t\t\tif (($ki==0 && $sip_friend) || ($ki==1 && $iax_friend)){\n\t\t\t\t\t\t\t\t$instance_table1 = new Table($FG_TABLE_NAME, $FG_QUERY_ADITION_SIP_IAX);\n\t\t\t\t\t\t\t\t$result_query1=$instance_table1 -> Add_table ($DBHandle, $param_add_value, $param_add_fields, null, null);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$instance_table_friend = new Table($FG_TABLE_NAME,'id, '.$FG_QUERY_ADITION_SIP_IAX);\n\t\t\t\t\t\t\t\t$list_friend = $instance_table_friend -> Get_list ($DBHandle, '', null, null, null, null);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$fd=fopen($buddyfile,\"w\");\n\t\t\t\t\t\t\t\tif (!$fd){\t\t\n\t\t\t\t\t\t\t\t\tmail($email_alarm, \"ALARM : SOAP-API - Could not open buddy file '$buddyfile'\", $mail_content);\n\t\t\t\t\t\t\t\t\terror_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\"[Could not open buddy file '$buddyfile'] - SOAP-API \".\"\\n\", 3, $logfile);\n\t\t\t\t\t\t\t\t\treturn array($transaction_code, '', '', '', '', 'Error', 'SOAP-API - Could not open buddy file $buddyfile');\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t foreach ($list_friend as $data){\n\t\t\t\t\t\t\t\t\t\t$line=\"\\n\\n[\".$data[1].\"]\\n\";\n\t\t\t\t\t\t\t\t\t\tif (fwrite($fd, $line) === FALSE) {\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\terror_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\"[Impossible to write to the file ($buddyfile)] - CODE_ERROR 8\".\"\\n\", 3, $logfile);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\treturn array($transaction_code, '', '', '', '', 'Error', 'SOAP-API Impossible to write to the file ($buddyfile)');\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i=1;$i<count($data)-1;$i++){\n\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($data[$i+1])>0){\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (trim($list_names[$i]) == 'allow'){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$codecs = explode(\",\",$data[$i+1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$line = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($codecs as $value)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$line .= trim($list_names[$i]).'='.$value.\"\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\t$line = (trim($list_names[$i]).'='.$data[$i+1].\"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (fwrite($fd, $line) === FALSE){ \n\t\t\t\t\t\t\t\t\t\t\t\t\t\terror_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\"[Impossible to write to the file ($buddyfile)] - CODE_ERROR 8\".\"\\n\", 3, $logfile);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn array($transaction_code, '', '', '', '', 'Error', 'SOAP-API ERROR : Card created in the DB but Impossible to write to the file ($buddyfile)');\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfclose($fd);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t} // END OF FOR - KI\n\t\t\t\t\t\t\n\t\t\t\t\t} // END if ($iax_friend || $sip_friend)\n\t\t\t\t\t\n\t\t\t\t\treturn array($transaction_code, $account_number, $cardnum, $useralias, $uipass, 'result=OK', \"ID CARD_CREATED=$result_query$callerid_result\");\n\t\t\t\t\t\n\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\tmail(EMAIL_ADMIN, \"ALARM : SOAP-API (Add_table)\", \"$FG_ADITION_SECOND_ADD_VALUE\\n\\n\".$mail_content);\n\t\t\t\t\terror_log (\"[\" . date(\"Y/m/d G:i:s\", mktime()) . \"] \".\"[SOAP-API CODE_ERROR Add_table \".\"\\n\", 3, $logfile);\n\t\t\t\t\treturn array($transaction_code, '', '', '', '', 'Error', 'SOAP-API CODE_ERROR Add_table');\n\t\t\t\t}\n\t\t\t\n\t\t\t} // END - CHECK PARAMETERS LASTNAME ; FIRSTNAME ; ADDRESS ; ....\n \n }",
"function construct_value_array() {\n $this->credit_card_details = array(\n 'card_number' => $_POST['card_number'],\n 'expiry_date' => array('year' => $_POST['expiry']['year'], 'month' => $_POST['expiry']['month']),\n 'card_code' => $_POST['card_code']\n );\n\n /*\n (TransRequestID,(((CreditCardNumber|CreditCardToken),ExpirationMonth,ExpirationYear,(IsCardPresent|IsECommerce|IsRecurring)?)|(Track1Data|Track2Data)),Amount,NameOnCard?,CreditCardAddress?,CreditCardCity?,CreditCardState?,CreditCardPostalCode?,CommercialCardCode?,SalesTaxAmount?,CardSecurityCode?,Lodging?,Restaurant?,BatchID?,ClientTransID?,InvoiceID?,UserID?,Comment?)\n */\n $gateway_doc = <<<EOXML\n<?xml version=\"1.0\"?>\n<?qbmsxml version=\"4.4\"?>\n<QBMSXML>\n<SignonMsgsRq>\n <SignonDesktopRq>\nEOXML;\n $gateway_doc .= \"<ClientDateTime>\" . date('Y-m-d\\TH:i:s') . \"</ClientDateTime>\";\n $gateway_doc .= \"<ApplicationLogin>\" . QBMS_APP_NAME . \"</ApplicationLogin>\";\n $gateway_doc .= \"<ConnectionTicket>\" . qbms_get_ticket() . \"</ConnectionTicket>\";\n $gateway_doc .= <<<EOXML\n </SignonDesktopRq>\n</SignonMsgsRq>\n<QBMSXMLMsgsRq>\n <CustomerCreditCardChargeRq>\nEOXML;\n $gateway_doc .= \"<TransRequestID>\" . $this->cart_data['session_id'] . \"</TransRequestID>\";\n $gateway_doc .= \"<CreditCardNumber>\" . $this->credit_card_details['card_number'] . \"</CreditCardNumber>\";\n $gateway_doc .= \"<ExpirationMonth>\" . $this->credit_card_details['expiry_date']['month'] . \"</ExpirationMonth>\";\n $gateway_doc .= \"<ExpirationYear>\" . $this->credit_card_details['expiry_date']['year'] . \"</ExpirationYear>\";\n $gateway_doc .= \"<IsCardPresent>false</IsCardPresent>\";\n $gateway_doc .= \"<Amount>\" . number_format($this->cart_data['total_price'],2,'.','') . \"</Amount>\";\n $gateway_doc .= \"<NameOnCard>\" . $this->cart_data['billing_address']['first_name'] . \" \" . $this->cart_data['billing_address']['last_name'] . \"</NameOnCard>\";\n $gateway_doc .= \"<CreditCardAddress>\" . $this->cart_data['billing_address']['address'] . \"</CreditCardAddress>\";\n $gateway_doc .= \"<CreditCardCity>\" . $this->cart_data['billing_address']['city'] . \"</CreditCardCity>\";\n //$gateway_doc .= \"<CreditCardState>\" . $this->cart_data['billing_address'][''] . \"</CreditCardState>\";\n $gateway_doc .= \"<CreditCardPostalCode>\" . $this->cart_data['billing_address']['post_code'] . \"</CreditCardPostalCode>\";\n $gateway_doc .= \"<CardSecurityCode>\" . $this->credit_card_details['card_code'] . \"</CardSecurityCode>\";\n $gateway_doc .= \"<InvoiceID>\" . $this->cart_data['session_id'] . \"</InvoiceID>\";\n $gateway_doc .= \"<Comment>\" . get_option('qbms_form_description') . \"</Comment>\";\n $gateway_doc .= <<<EOXML\n </CustomerCreditCardChargeRq>\n </QBMSXMLMsgsRq>\n</QBMSXML>\nEOXML;\n\n $this->collected_gateway_data = $gateway_doc;\n }",
"function addcard($name,$amount,$numcard,$tipocard,$cvv,$mes,$year,$orderId){\n $authRes = getAuthKey();\n $accessKey = $authRes['accessKey'];\n $accessSecret = $authRes['accessSecret']; \n $json=[\"hotelogix\"=>[\"version\"=>\"1.0\",\"datetime\"=>gmdate(\"Y-m-d\\TH:i:s\"),\"request\"=>[\"method\"=>\"confirmbooking\",\"key\"=>$accessKey,\"languagecode\"=>\"en\",\"data\"=>[\"payment\"=>[\"amount\"=>$amount,\"isguestcc\"=>\"0\",\"type\"=>\"CC\",\"payType\"=>\"agent\", \"description\"=>\"Reservación Hotel Márquez Del Ángel\"],\"creditcard\"=>[\"nameoncard\"=>$name,\"cardno\"=>$numcard,\"cardtype\"=>$tipocard,\"cvc\"=>$cvv,\"expirymonth\"=>$mes,\"expiryyear\"=>$year],\"orderId\"=>[\"value\"=>$orderId],\"ignoreSourceError\"=>[\"value\"=>true],\"errorIfNotConfirm\"=>[\"value\"=>1]]]]];\n $resXmlDom = postCurl('confirmbooking', json_encode($json), $accessSecret, TRUE);\n return json_decode($resXmlDom);\n}",
"private function addCreditcard(CreditCard $creditcard)\n {\n $this->post->addChild('Card_Number', $creditcard->number);\n $this->post->addChild('Expiry_Date', $this->expdate($creditcard));\n $this->post->addChild('CardHoldersName', $creditcard->name());\n if ($cvv = $creditcard->verification_value) {\n $this->post->addChild('CVD_Presence_Ind', 1);\n $this->post->addChild('VerificationStr2', $cvv);\n }\n }",
"private function apiXmlData() {\n\n $cardType = isset($this->jsonData['Payment']['DebitCard']) ? 'DebitCard' : 'CreditCard';\n $product = '1';\n\n if ($cardType == 'CreditCard') {\n if ($this->jsonData['Payment']['Installments'] > 1) $product = '2';\n } else {\n $product = 'A';\n }\n\n $authorize = '3';\n $generateToken = isset($this->jsonData['Payment']['RecurrentPayment']) ? '<gerar-token>true</gerar-token>' : '';\n\n $cardValidDate = explode('/', $this->jsonData['Payment'][$cardType]['ExpirationDate']);\n $cardValidDate = $cardValidDate[1] . $cardValidDate[0];\n\n $currencies = array(\n 'BRL' => 986\n );\n\n $paymentCurrency = $this->jsonData['Payment']['Currency'];\n $currency = isset($currencies[$paymentCurrency]) ? $currencies[$paymentCurrency] : 986;\n\n $this->transactionId = md5(date(\"YmdHisu\"));\n\n /**\n * Unfortunately, this is the simplest way to generate the request body\n */\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n <requisicao-transacao id=\"' . $this->transactionId . '\" versao=\"1.2.1\">\n <dados-ec>\n <numero>' . ($this->sandbox ? $this->sandboxId : $this->merchantId) . '</numero>\n <chave>' . ($this->sandbox ? $this->sandboxKey : $this->merchantKey) . '</chave>\n </dados-ec>\n <dados-portador>\n <numero>' . $this->jsonData['Payment'][$cardType]['CardNumber'] . '</numero>\n <validade>' . $cardValidDate . '</validade>\n <indicador>1</indicador>\n <codigo-seguranca>' . $this->jsonData['Payment'][$cardType]['SecurityCode'] . '</codigo-seguranca>\n <nome-portador>' . $this->jsonData['Payment'][$cardType]['Holder'] . '</nome-portador>\n </dados-portador>\n <dados-pedido>\n <numero>' . $this->jsonData['MerchantOrderId'] . '</numero>\n <valor>' . $this->jsonData['Payment']['Amount'] . '</valor>\n <moeda>' . $currency . '</moeda>\n <data-hora>' . date('Y-m-d') . 'T' . date('h:i:s') . '</data-hora>\n </dados-pedido>\n <forma-pagamento>\n <bandeira>' . strtolower($this->jsonData['Payment'][$cardType]['Brand']) . '</bandeira>\n <produto>' . $product . '</produto>\n <parcelas>' . $this->jsonData['Payment']['Installments'] . '</parcelas>\n </forma-pagamento>\n <url-retorno>null</url-retorno>\n <autorizar>' . $authorize . '</autorizar>\n <capturar>false</capturar>\n '. $generateToken .'\n </requisicao-transacao>';\n\n return $xml;\n }",
"public function createCreditCard($creditCardData)\n\t{\n\t\ttry\n\t\t{\n\t\t\tif (isset($creditCardData['paymentMethodNonce'])) {\n\t\t\t\t// PaymentMethodNonce provided by client application\n\t\t\t\t// (for example iOS/Android app) can be used instead\n\t\t\t\t// of cc details\n\t\t\t\treturn Braintree_CreditCard::create(array(\n\t\t\t\t\t'customerId' => $creditCardData['customerId'],\n\t\t\t\t\t'paymentMethodNonce' => $creditCardData['paymentMethodNonce'],\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'verifyCard' => true,\n\t\t \t\t)\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\treturn Braintree_CreditCard::create(array(\n\t\t\t\t 'customerId' => $creditCardData['customerId'],\n\t\t\t 'number' => $creditCardData['number'],\n\t\t\t 'cardholderName' => $creditCardData['card_name'],\n\t\t\t 'expirationDate' => $creditCardData['expiration_month'] . '/' . substr($creditCardData['expiration_year'], -2),\n\t\t\t 'cvv' => $creditCardData['cvv'],\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'verifyCard' => true,\n\t\t \t\t\t//'failOnDuplicatePaymentMethod' => true\n\t\t \t\t)\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->_log('Credit card creation exception: ' . $e);\n\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function create($creditcard, $options = []);",
"function chargeCreditCard($amount)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"7ZRy8r3t6ub5\");\n $merchantAuthentication->setTransactionKey(\"235JBf4W7v5dxF9K\");\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber(\"4111111111111111\");\n $creditCard->setExpirationDate(\"2038-12\");\n $creditCard->setCardCode(\"123\");\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"10101\");\n $order->setDescription(\"Golf Shirts\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName(\"Ellen\");\n $customerAddress->setLastName(\"Johnson\");\n $customerAddress->setCompany(\"Souveniropolis\");\n $customerAddress->setAddress(\"14 Main Street\");\n $customerAddress->setCity(\"Pecan Springs\");\n $customerAddress->setState(\"TX\");\n $customerAddress->setZip(\"44628\");\n $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"99999456654\");\n $customerData->setEmail(\"[email protected]\");\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($amount);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \\SampleCode\\Constants::RESPONSE_OK) {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getMessages() != null) {\n echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n } else {\n echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n } else {\n echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } } else {\n echo \"No response returned \\n\";\n }\n\n return $response;\n}",
"function Cards() {\n\n // Necessary for WSDL creation\n\t\t\n $this->__dispatch_map['Create_Card'] =\n array('in' => array('security_key' => 'string', 'transaction_code' => 'string', 'account_number' => 'string',\n\t\t\t\t\t\t\t\t'tariff' => 'integer', 'uipass' => 'string', 'credit' => 'float', 'language' => 'string', 'activated' => 'integer', \n\t\t\t\t\t\t\t\t'simultaccess' => 'integer', 'currency' => 'string', 'runservice' => 'integer', 'typepaid' => 'integer', 'creditlimit' => 'integer', \n\t\t\t\t\t\t\t\t'enableexpire' => 'integer', 'expirationdate' => 'string', 'expiredays' => 'integer', 'lastname' => 'string', \n\t\t\t\t\t\t\t\t'firstname' => 'string', 'address' => 'string', 'city' => 'string', 'state' => 'string', 'country' => 'string', \n\t\t\t\t\t\t\t\t'zipcode' => 'string', 'phone' => 'string', 'fax' => 'string', 'callerid_list' => 'string',\n\t\t\t\t\t\t\t\t'iax_friend' => 'integer', 'sip_friend' => 'integer'),\n 'out' => array('transaction_code' => 'string', 'account_number' => 'string', 'card_number' => 'string', 'card_alias' => 'string', 'uipass' => 'string', 'result' => 'string', 'details' => 'string')\n );\n\t\t\t\t \n $this->__dispatch_map['Remove_Card'] =\n array('in' => array('security_key' => 'string', 'transaction_code' => 'string', 'account_number' => 'string',\n\t\t\t\t\t\t\t\t'cardnumber' => 'string'),\n 'out' => array('transaction_code' => 'string', 'account_number' => 'string', 'card_number' => 'string', 'result' => 'string', 'details' => 'string')\n );\n\t\t\t\t \n\t\t$this->__dispatch_map['Update_CallerID'] =\n array('in' => array('security_key' => 'string', 'transaction_code' => 'string', 'account_number' => 'string'\n\t\t\t \t\t\t\t\t, 'cardnumber' => 'string', 'callerid_list' => 'string'),\n 'out' => array('transaction_code' => 'string', 'account_number' => 'string', 'card_number' => 'string', 'result' => 'string', 'details' => 'string')\n );\n }",
"function retrieveServiceDescription($SCPDURL){\n\n $strURL = trim($SCPDURL);\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_USERAGENT, \t'SKY');\n curl_setopt($ch, CURLOPT_URL, $strURL );\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n\n $rtn = curl_exec($ch);\n\n if(($rtn) === false) {\n $err = 'Curl error: ' . curl_error($ch);\n die($err);\n }\n\n curl_close($ch);\n\n return simplexml_load_string($rtn);\n\n}",
"private function _setRatepayContentCustomer()\n {\n $customerInfo = $this->_requestDataObjects['CustomerInfo']->getData();\n $customer = $this->_request->content->addChild('customer');\n\n $customer->addCDataChild('first-name', Data::removeSpecialChars($customerInfo['firstName']));\n $customer->addCDataChild('last-name', Data::removeSpecialChars($customerInfo['lastName']));\n $customer->addChild('gender', strtoupper($customerInfo['gender']));\n $customer->addChild('date-of-birth', $customerInfo['dob']);\n $customer->addChild('ip-address', $customerInfo['ip']);\n\n if (!empty($customerInfo['company'])) {\n $customer->addCDataChild('company-name', Data::removeSpecialChars($customerInfo['company']));\n }\n\n $contacts = $customer->addChild('contacts');\n $contacts->addChild('email', $customerInfo['email']);\n $phone = $contacts->addChild('phone');\n $phone->addChild('direct-dial', $customerInfo['phone']);\n\n if (!empty($customer['fax'])) {\n $fax = $contacts->addChild('fax');\n $fax->addChild('direct-dial', $customerInfo['fax']);\n }\n\n $addresses = $customer->addChild('addresses');\n\n $billingAddress = $addresses->addChild('address');\n $billingAddress->addAttribute('type', $customerInfo['billing']['type']);\n $billingAddress->addCDataChild('street', Data::removeSpecialChars($customerInfo['billing']['street']));\n if (!empty($customerInfo['billing']['streetNumber'])) {\n $billingAddress->addCDataChild('street-number', $customerInfo['billing']['streetNumber']);\n }\n $billingAddress->addChild('zip-code', $customerInfo['billing']['zipCode']);\n $billingAddress->addCDataChild('city', Data::removeSpecialChars($customerInfo['billing']['city']));\n $billingAddress->addChild('country-code', strtoupper($customerInfo['billing']['countryId']));\n\n $shippingAddress = $addresses->addChild('address');\n $shippingAddress->addAttribute('type', $customerInfo['shipping']['type']);\n $shippingAddress->addCDataChild('street', Data::removeSpecialChars($customerInfo['shipping']['street']));\n if (!empty($customerInfo['shipping']['streetNumber'])) {\n $shippingAddress->addCDataChild('street-number', $customerInfo['shipping']['streetNumber']);\n }\n $shippingAddress->addChild('zip-code', $customerInfo['shipping']['zipCode']);\n $shippingAddress->addCDataChild('city', Data::removeSpecialChars($customerInfo['shipping']['city']));\n $shippingAddress->addChild('country-code', strtoupper($customerInfo['shipping']['countryId']));\n\n if (!empty($customerInfo['bankAccount']['owner'])) {\n $bankData = $customer->addChild('bank-account');\n $bankData->addCDataChild('owner', Data::removeSpecialChars($customerInfo['bankAccount']['owner']));\n if (!empty($customerInfo['bankAccount']['bank-account-number']) && empty($customerInfo['bankAccount']['iban'])) {\n $bankData->addChild('bank-account-number', $customerInfo['bankAccount']['bank-account-number']);\n $bankData->addChild('bank-code', $customerInfo['bankAccount']['bank-code']);\n }\n $bankData->addCDataChild('bank-name', Data::removeSpecialChars($customerInfo['bankAccount']['bank-name']));\n if (!empty($customerInfo['bankAccount']['iban'])) {\n $bankData->addChild('iban', $customerInfo['bankAccount']['iban']);\n if (!empty($customerInfo['bankAccount']['bic-swift'])) {\n $bankData->addChild('bic-swift', $customerInfo['bankAccount']['bic-swift']);\n }\n }\n }\n\n $customer->addChild('nationality', $customerInfo['nationality']);\n $customer->addChild('customer-allow-credit-inquiry', $customerInfo['creditInquiry']);\n \n if (!empty($customerInfo['company'])) {\n $customer->addChild('vat-id', $customerInfo['vatId']);\n }\n \n return $this;\n }",
"function actionGetCreditCard() {\n if (!isset(Yii::app()->getSession()->get('wsadvisor')->id)) {\n $this->sendResponse(200, CJSON::encode(array(\"status\" => \"ERROR\", \"message\" => \"Session Expired\")));\n }\n $advisorId = Yii::app()->getSession()->get('wsadvisor')->id;\n $advisorEmail = Yii::app()->getSession()->get('wsadvisor')->email;\n\n $hasSubscription = false;\n $advisorSubscriptionObj = AdvisorSubscription::model()->find(array('condition' => \"advisor_id=:advisor_id\", 'params' => array(\"advisor_id\" => $advisorId)));\n\n if ($advisorSubscriptionObj && $advisorSubscriptionObj->stripesubscriptionid != NULL) {\n $hasSubscription = true;\n $creditcard['email'] = $advisorEmail;\n $creditcard['type'] = $advisorSubscriptionObj->cardtype;\n $creditcard['last4'] = $advisorSubscriptionObj->cardlast4;\n $creditcard['expiration_date'] = date(\"F Y\", strtotime($advisorSubscriptionObj->cardexpirationdate));\n $d1 = date(\"Y-m-d\");\n $d2 = date(\"Y-m-d\", strtotime($advisorSubscriptionObj->cardexpirationdate));\n $expirystatus = \"\";\n $expirydays = (strtotime($d2) - strtotime($d1)) / 86400;\n if ($expirydays >= 0 && $expirydays <= 10) {\n $expirystatus = \"expiring soon!\";\n } else if ($expirydays < 0) {\n $expirystatus = \"expired!\";\n }\n $creditcard['expiration_days'] = $expirydays;\n $creditcard['expirystatus'] = $expirystatus;\n } else {\n $this->sendResponse(200, CJSON::encode(array('status' => 'ERROR', 'hasSubscription' => $hasSubscription, 'message' => 'There are no credit cards.')));\n }\n $this->sendResponse(200, CJSON::encode(array('status' => 'OK', 'hasSubscription' => $hasSubscription, 'creditcard' => $creditcard)));\n }",
"public function chargeIt() {\n\t\t/*** Let's build our curl request ***/\n\t\t$soapBody = '<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">';\n\t\t$soapBody .= '<SOAP-ENV:Header /><SOAP-ENV:Body>';\n\t\t$soapBody .= '\n\t\t\t<fdggwsapi:FDGGWSApiOrderRequest xmlns:v1=\"http://secure.linkpt.net/fdggwsapi/schemas_us/v1\" xmlns:fdggwsapi=\"http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi\">\n\t\t\t\t<v1:Transaction>\n\t\t\t\t\t<v1:CreditCardTxType>\n\t\t\t\t\t\t<v1:Type>sale</v1:Type>\n\t\t\t\t\t</v1:CreditCardTxType>\n\t\t\t\t\t<v1:CreditCardData>\n\t\t\t\t\t\t<v1:CardNumber>'.$this->cardInfo['cardnumber'].'</v1:CardNumber>\n\t\t\t\t\t\t<v1:ExpMonth>'.$this->cardInfo['expmonth'].'</v1:ExpMonth>\n\t\t\t\t\t\t<v1:ExpYear>'.$this->cardInfo['expyear'].'</v1:ExpYear>\n\t\t\t\t\t\t<v1:CardCodeValue>'.$this->cardInfo['cvm'].'</v1:CardCodeValue>\n\t\t\t\t\t</v1:CreditCardData>\n\t\t\t\t\t<v1:Payment>\n\t\t\t\t\t\t<v1:ChargeTotal>'.$this->totals['chargetotal'].'</v1:ChargeTotal>\n\t\t\t\t\t\t<v1:SubTotal>'.$this->totals['subtotal'].'</v1:SubTotal>\n\t\t\t\t\t\t<v1:VATTax>'.$this->totals['tax'].'</v1:VATTax>\n\t\t\t\t\t\t<v1:Shipping>'.$this->totals['shipping'].'</v1:Shipping>\n\t\t\t\t\t</v1:Payment>\n\t\t\t\t\t<v1:TransactionDetails>\n\t\t\t\t\t\t<v1:OrderId>'.$this->oid.'</v1:OrderId>\n\t\t\t\t\t\t<v1:TransactionOrigin>ECI</v1:TransactionOrigin>\n\t\t\t\t\t</v1:TransactionDetails>\n\t\t\t\t\t<v1:Billing>\n\t\t\t\t\t\t<v1:Name>'.$this->billingInfo['name'].'</v1:Name>\n\t\t\t\t\t\t<v1:Company>'.$this->billingInfo['company'].'</v1:Company>\n\t\t\t\t\t\t<v1:Address1>'.$this->billingInfo['addr1'].'</v1:Address1>\n\t\t\t\t\t\t<v1:Address2>'.$this->billingInfo['addr2'].'</v1:Address2>\n\t\t\t\t\t\t<v1:City>'.$this->billingInfo['city'].'</v1:City>\n\t\t\t\t\t\t<v1:State>'.$this->billingInfo['state'].'</v1:State>\n\t\t\t\t\t\t<v1:Zip>'.$this->billingInfo['zip'].'</v1:Zip>\n\t\t\t\t\t\t<v1:Country>'.$this->billingInfo['country'].'</v1:Country>\n\t\t\t\t\t\t<v1:Phone>'.$this->billingInfo['phone'].'</v1:Phone>\n\t\t\t\t\t\t<v1:Fax>'.$this->billingInfo['fax'].'</v1:Fax>\n\t\t\t\t\t</v1:Billing>\n\t\t\t\t\t<v1:Shipping>\n\t\t\t\t\t\t<v1:Name>'.$this->shippingInfo['name'].'</v1:Name>\n\t\t\t\t\t\t<v1:Address1>'.$this-> shippingInfo['addr1'].'</v1:Address1>\n\t\t\t\t\t\t<v1:Address2>'.$this->shippingInfo['addr2'].'</v1:Address2>\n\t\t\t\t\t\t<v1:City>'.$this->shippingInfo['city'].'</v1:City>\n\t\t\t\t\t\t<v1:State>'.$this->shippingInfo['state'].'</v1:State>\n\t\t\t\t\t\t<v1:Zip>'.$this->shippingInfo['zip'].'</v1:Zip>\n\t\t\t\t\t\t<v1:Country>'.$this->shippingInfo['country'].'</v1:Country>\n\t\t\t\t\t</v1:Shipping>\n\t\t\t\t</v1:Transaction>\n\t\t\t</fdggwsapi:FDGGWSApiOrderRequest>';\n\t\t$soapBody .= '</SOAP-ENV:Body></SOAP-ENV:Envelope>';\n\t\t/*** ***/\n\t\t//echo $soapBody;exit;\n\t\t\n\t\ttry {\n\t\t\t$response = $this->curlIt($soapBody);\n\t\t} catch (Exception $e) {\n\t\t\t//Handle this gracefully. Overload errorMessage as you desire\n\t\t\treturn array(\n\t\t\t\t\t'approved'\t\t\t\t\t=> false,\n\t\t\t\t\t'errorMessage'\t\t\t=> 'Internal Server Error. If this persists, please contact the administrator.',\n\t\t\t\t\t'exception'\t\t\t\t\t=> true,\n\t\t\t\t\t'exceptionMessage'\t=> $e->getMessage()\n\t\t\t);\n\t\t}\n\t\t\n\t\t$result = array(\n\t\t\t\t'exception' => false\n\t\t);\n\t\t//Was the transaction approved?\n\t\tif ($response->ProcessorResponseCode == 'A' && $response->TransactionResult == 'APPROVED') {\n\t\t\t$result['approved'] = true;\n\t\t\t$this->oid = (string)$response->OrderId;\n\t\t} else {\n\t\t\t$result['approved'] = false;\n\t\t}\n\t\t$result['errorMessage'] = (string)$response->ErrorMessage;\n\t\t$result['transactionTime'] = (string)$response->TransactionTime;\n\t\t$result['tDate'] = (string)$response->TDate;\n\t\t$result['oid']\t= $this->oid;\n\t\t$result['reference'] = (string)$response->ProcessorReferenceNumber;\n\t\t$result['approvalCode'] = (string)$response->ApprovalCode;\n\t\t\n\t\treturn $result;\n }",
"public function setCCInformation($params){\r\n $this->paymentType = \"CREDIT\"; \r\n if(isset($params[\"cardNumber\"])) {\r\n $this->ccNum = $params[\"cardNumber\"];\r\n } \r\n if(isset($params[\"cardExpire\"])) {\r\n $this->cardExpire = $params[\"cardExpire\"];\r\n } \r\n if(isset($params[\"cvv2\"])) {\r\n $this->cvv2 = $params[\"cvv2\"];\r\n }\r\n }",
"function verify_card_detail($cc_number) {\n $cc_details = $this->validateCreditcard_number($cc_number);\n echo json_encode($cc_details);\n }",
"public function getXMLCredentialNode($xmlAction, $countryCode = 'AU')\n\t{\n\t\t$xml = new SimpleXMLElement('<' . $xmlAction . '></' . $xmlAction . '>');\n\t\t$xml->addAttribute('xmlns', self::DEFAULT_XMLNS);\n\t\t$xml->addAttribute('xmlns:xsi', self::DEFAULT_XMLNS_XSI);\n\t\t$xml->addAttribute('xsi:schemaLocation', self::DEFAULT_XMLNS. ' ' . $xmlAction . '.xsd');\n\t\t$xml->addAttribute('Version', self::DEFAULT_VERSION);\n\t\t$xml->addAttribute('SequenceNmbr', date_format(date_create(), 'U'));\n\t\t$xml->addAttribute('MaxResponses', self::DEFAULT_MAXRESPONSE);\t\t\n\n\t\t$posNode = $xml->addChild('POS');\n\t\t$sourceNode = $posNode->addChild('Source');\n\t\t$sourceNode->addAttribute('ISOCountry', $countryCode);\n\t\t$sourceNode->addAttribute('AgentDutyCode', $this->apiValidationCode);\n\n\t\t$requestNode = $sourceNode->addChild('RequestorID');\n\t\t$requestNode->addAttribute('Type', self::DEFAULT_REQUEST_TYPE);\n\t\t$requestNode->addAttribute('ID', $this->apiValidationNumber);\n\n\t\t$companyNameNode = $requestNode->addChild('CompanyName');\n\t\t$companyNameNode->addAttribute('Code', self::DEFAULT_CONSUMER_PRODUCT);\n\t\t$companyNameNode->addAttribute('CodeContext', $this->apiConsumerProductCode);\n\n\t\treturn $xml;\t\n\t}",
"public static function _register()\n {\n self::assignElements([\n 'AccountDetailsEntryType' => ['type' => 'AccountDetailEntryCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'Description' => [],\n 'Balance' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'Date' => [],\n 'GrossDetailAmount' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'ItemID' => ['type' => 'ItemIDType', 'xmlns' => self::XMLNS],\n 'Memo' => [],\n 'ConversionRate' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'NetDetailAmount' => ['type' => 'AmountType', 'xmlns' => self::XMLNS],\n 'RefNumber' => [],\n 'VATPercent' => ['type' => 'float'],\n 'Title' => [],\n 'OrderLineItemID' => [],\n 'TransactionID' => [],\n 'ReceivedTopRatedDiscount' => ['type' => 'bool'],\n 'OrderId' => [],\n 'DiscountDetail' => ['type' => 'DiscountDetailType', 'xmlns' => self::XMLNS],\n 'Netted' => ['type' => 'bool']\n ], parent::NAME);\n\n self::assignAttributes([]);\n }",
"function generateXmlHeader()\n{\n print \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n print \"<ADI3 xmlns=\\\"urn:cablelabs:md:xsd:core:3.0\\\" xmlns:content=\\\"urn:cablelabs:md:xsd:content:3.0\\\"\\n\";\n print \" xmlns:core=\\\"urn:cablelabs:md:xsd:core:3.0\\\" xmlns:offer=\\\"urn:cablelabs:md:xsd:offer:3.0\\\"\\n\";\n print \" xmlns:terms=\\\"urn:cablelabs:md:xsd:terms:3.0\\\" xmlns:title=\\\"urn:cablelabs:md:xsd:title:3.0\\\"\\n\";\n print \" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:irdeto=\\\"http://www.irdeto.com/schemas/metadata/1.0\\\"\\n\";\n print \" xsi:schemaLocation=\\\"urn:cablelabs:md:xsd:core:3.0 MD-SP-CORE-I02.xsd\\n\";\n print \" urn:cablelabs:md:xsd:offer:3.0 MD-SP-OFFER-I02.xsd\\n\";\n print \" urn:cablelabs:md:xsd:title:3.0 MD-SP-TITLE-I02.xsd\\n\";\n print \" urn:cablelabs:md:xsd:content:3.0 MD-SP-CONTENT-I02.xsd\\n\";\n print \" urn:cablelabs:md:xsd:terms:3.0 MD-SP-TERMS-I02.xsd\\n\";\n print \" http://www.irdeto.com/schemas/metadata/1.0 Irdeto-ADI-3_0-extension.xsd\\\">\\n\";\n}",
"function _addXMLchild( & $parent, $name, $type, $content, $params=array()) {\r\n static $fmtYmd = '%04d-%02d-%02d';\r\n static $fmtYmdHis = '%04d-%02d-%02dT%02d:%02d:%02d';\r\n /** create new child node */\r\n $name = strtolower( $name );\r\n $child = $parent->addChild( $name );\r\n if( !empty( $params )) {\r\n $parameters = $child->addChild( 'parameters' );\r\n foreach( $params as $param => $parVal ) {\r\n if( 'VALUE' == $param )\r\n continue;\r\n $param = strtolower( $param );\r\n if( 'x-' == substr( $param, 0, 2 )) {\r\n $p1 = $parameters->addChild( $param );\r\n $p2 = $p1->addChild( 'unknown', htmlspecialchars( $parVal ));\r\n }\r\n else {\r\n $p1 = $parameters->addChild( $param );\r\n switch( $param ) {\r\n case 'altrep':\r\n case 'dir': $ptype = 'uri'; break;\r\n case 'delegated-from':\r\n case 'delegated-to':\r\n case 'member':\r\n case 'sent-by': $ptype = 'cal-address'; break;\r\n case 'rsvp': $ptype = 'boolean'; break ;\r\n default: $ptype = 'text'; break;\r\n }\r\n if( is_array( $parVal )) {\r\n foreach( $parVal as $pV )\r\n $p2 = $p1->addChild( $ptype, htmlspecialchars( $pV ));\r\n }\r\n else\r\n $p2 = $p1->addChild( $ptype, htmlspecialchars( $parVal ));\r\n }\r\n }\r\n } // end if( !empty( $params ))\r\n if(( empty( $content ) && ( '0' != $content )) || ( !is_array( $content) && ( '-' != substr( $content, 0, 1 ) && ( 0 > $content ))))\r\n return;\r\n /** store content */\r\n switch( $type ) {\r\n case 'binary':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'boolean':\r\n break;\r\n case 'cal-address':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'date':\r\n if( array_key_exists( 'year', $content ))\r\n $content = array( $content );\r\n foreach( $content as $date ) {\r\n $str = sprintf( $fmtYmd, (int) $date['year'], (int) $date['month'], (int) $date['day'] );\r\n $v = $child->addChild( $type, $str );\r\n }\r\n break;\r\n case 'date-time':\r\n if( array_key_exists( 'year', $content ))\r\n $content = array( $content );\r\n foreach( $content as $dt ) {\r\n if( !isset( $dt['hour'] )) $dt['hour'] = 0;\r\n if( !isset( $dt['min'] )) $dt['min'] = 0;\r\n if( !isset( $dt['sec'] )) $dt['sec'] = 0;\r\n $str = sprintf( $fmtYmdHis, (int) $dt['year'], (int) $dt['month'], (int) $dt['day'], (int) $dt['hour'], (int) $dt['min'], (int) $dt['sec'] );\r\n if( isset( $dt['tz'] ) && ( 'Z' == $dt['tz'] ))\r\n $str .= 'Z';\r\n $v = $child->addChild( $type, $str );\r\n }\r\n break;\r\n case 'duration':\r\n $output = (( 'trigger' == $name ) && ( FALSE !== $content['before'] )) ? '-' : '';\r\n $v = $child->addChild( $type, $output.iCalUtilityFunctions::_duration2str( $content ) );\r\n break;\r\n case 'geo':\r\n if( !empty( $content )) {\r\n $v1 = $child->addChild( 'latitude', iCalUtilityFunctions::_geo2str2( $content['latitude'], iCalUtilityFunctions::$geoLatFmt ));\r\n $v1 = $child->addChild( 'longitude', iCalUtilityFunctions::_geo2str2( $content['longitude'], iCalUtilityFunctions::$geoLongFmt ));\r\n }\r\n break;\r\n case 'integer':\r\n $v = $child->addChild( $type, (string) $content );\r\n break;\r\n case 'period':\r\n if( !is_array( $content ))\r\n break;\r\n foreach( $content as $period ) {\r\n $v1 = $child->addChild( $type );\r\n $str = sprintf( $fmtYmdHis, (int) $period[0]['year'], (int) $period[0]['month'], (int) $period[0]['day'], (int) $period[0]['hour'], (int) $period[0]['min'], (int) $period[0]['sec'] );\r\n if( isset( $period[0]['tz'] ) && ( 'Z' == $period[0]['tz'] ))\r\n $str .= 'Z';\r\n $v2 = $v1->addChild( 'start', $str );\r\n if( array_key_exists( 'year', $period[1] )) {\r\n $str = sprintf( $fmtYmdHis, (int) $period[1]['year'], (int) $period[1]['month'], (int) $period[1]['day'], (int) $period[1]['hour'], (int) $period[1]['min'], (int) $period[1]['sec'] );\r\n if( isset($period[1]['tz'] ) && ( 'Z' == $period[1]['tz'] ))\r\n $str .= 'Z';\r\n $v2 = $v1->addChild( 'end', $str );\r\n }\r\n else\r\n $v2 = $v1->addChild( 'duration', iCalUtilityFunctions::_duration2str( $period[1] ));\r\n }\r\n break;\r\n case 'recur':\r\n $content = array_change_key_case( $content );\r\n foreach( $content as $rulelabel => $rulevalue ) {\r\n switch( $rulelabel ) {\r\n case 'until':\r\n if( isset( $rulevalue['hour'] ))\r\n $str = sprintf( $fmtYmdHis, (int) $rulevalue['year'], (int) $rulevalue['month'], (int) $rulevalue['day'], (int) $rulevalue['hour'], (int) $rulevalue['min'], (int) $rulevalue['sec'] ).'Z';\r\n else\r\n $str = sprintf( $fmtYmd, (int) $rulevalue['year'], (int) $rulevalue['month'], (int) $rulevalue['day'] );\r\n $v = $child->addChild( $rulelabel, $str );\r\n break;\r\n case 'bysecond':\r\n case 'byminute':\r\n case 'byhour':\r\n case 'bymonthday':\r\n case 'byyearday':\r\n case 'byweekno':\r\n case 'bymonth':\r\n case 'bysetpos': {\r\n if( is_array( $rulevalue )) {\r\n foreach( $rulevalue as $vix => $valuePart )\r\n $v = $child->addChild( $rulelabel, $valuePart );\r\n }\r\n else\r\n $v = $child->addChild( $rulelabel, $rulevalue );\r\n break;\r\n }\r\n case 'byday': {\r\n if( isset( $rulevalue['DAY'] )) {\r\n $str = ( isset( $rulevalue[0] )) ? $rulevalue[0] : '';\r\n $str .= $rulevalue['DAY'];\r\n $p = $child->addChild( $rulelabel, $str );\r\n }\r\n else {\r\n foreach( $rulevalue as $valuePart ) {\r\n if( isset( $valuePart['DAY'] )) {\r\n $str = ( isset( $valuePart[0] )) ? $valuePart[0] : '';\r\n $str .= $valuePart['DAY'];\r\n $p = $child->addChild( $rulelabel, $str );\r\n }\r\n else\r\n $p = $child->addChild( $rulelabel, $valuePart );\r\n }\r\n }\r\n break;\r\n }\r\n case 'freq':\r\n case 'count':\r\n case 'interval':\r\n case 'wkst':\r\n default:\r\n $p = $child->addChild( $rulelabel, $rulevalue );\r\n break;\r\n } // end switch( $rulelabel )\r\n } // end foreach( $content as $rulelabel => $rulevalue )\r\n break;\r\n case 'rstatus':\r\n $v = $child->addChild( 'code', number_format( (float) $content['statcode'], 2, '.', ''));\r\n $v = $child->addChild( 'description', htmlspecialchars( $content['text'] ));\r\n if( isset( $content['extdata'] ))\r\n $v = $child->addChild( 'data', htmlspecialchars( $content['extdata'] ));\r\n break;\r\n case 'text':\r\n if( !is_array( $content ))\r\n $content = array( $content );\r\n foreach( $content as $part )\r\n $v = $child->addChild( $type, htmlspecialchars( $part ));\r\n break;\r\n case 'time':\r\n break;\r\n case 'uri':\r\n $v = $child->addChild( $type, $content );\r\n break;\r\n case 'utc-offset':\r\n if( in_array( substr( $content, 0, 1 ), array( '-', '+' ))) {\r\n $str = substr( $content, 0, 1 );\r\n $content = substr( $content, 1 );\r\n }\r\n else\r\n $str = '+';\r\n $str .= substr( $content, 0, 2 ).':'.substr( $content, 2, 2 );\r\n if( 4 < strlen( $content ))\r\n $str .= ':'.substr( $content, 4 );\r\n $v = $child->addChild( $type, $str );\r\n break;\r\n case 'unknown':\r\n default:\r\n if( is_array( $content ))\r\n $content = implode( '', $content );\r\n $v = $child->addChild( 'unknown', htmlspecialchars( $content ));\r\n break;\r\n }\r\n}",
"function set_customer_creditcard_data() {\n\t\tif ($this->check_return_creditcard()) { // create an empty record if there is no shipment data\n\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE cust_id=%d And order_id=%d\", CREDIT_CARD, $_SESSION['cust_id'], $_SESSION['order_id']);\n\t\tif ($result = mysql_query($sql)) {\n\t\t\t$obj = mysql_fetch_object($result);\n\t\t\t\t$this->cc_number \t\t= $obj->number;\n\t\t\t\t$this->cc_date_month \t= $obj->exp_month;\n\t\t\t\t$this->cc_date_year \t= $obj->exp_year;\n\t\t\t\t$this->cc_holder \t\t= $obj->holder;\n\t\t\t\t$this->cc_CVN \t\t\t= $obj->CVN;\n\t\t\t\t$this->cc_type \t\t\t= $obj->type;\n\t\t\t\t\n\t\t\t\t\t} \n\t\telse {\n\t\t\t\t$this->error = $this->messages(1);\t}\n\t\t}\n\t}",
"function xmlString($sensitive_data, $string){\n $json= json_encode(simplexml_load_string($string));\n $array = json_decode($json, TRUE);\n $array = $array[\"NewOrder\"];\n $array =searchInfo($sensitive_data, $string);\n $array = array_flip($array);\n $xml = new SimpleXMLElement('<Request/>');\n array_walk_recursive($array, array ($xml, 'addChild'));\n $string = $xml->asXML();\n return strval($string);\n}",
"public function capture_token($ccdetails) {\n\n $options=array();\n $options['x_login'] = $this->configuration['API Login']['value'];\n $options['x_tran_key'] = $this->configuration['Transaction Key']['value'];\n\n\n /* CUSTOMER INFORMATION */\n $options['x_first_name'] = $this->client['firstname'];\n $options['x_last_name'] = $this->client['lastname'];\n $options['x_address'] = $this->client['address1'];\n $options['x_city'] = $this->client['city'];\n $options['x_state'] = $this->client['state'];\n $options['x_zip'] = $this->client['postcode'];\n $options['x_country'] = $this->client['country'];\n $options['x_phone'] = $this->client['phonenumber'];\n $options['x_email'] = $this->client['email'];\n $options['x_cust_id'] = $this->client['client_id'];\n\n\n /* ORDER INFORMATION */\n $options['x_invoice_num'] = $this->invoice_id;\n $options['x_description'] = $this->subject;\n $options['x_amount'] = $this->amount;\n\n\n /* CREDIT CARD INFORMATION */\n // we have token available, use it against payment gateway\n if ($ccdetails['token']) {\n $options['x_card_token'] = $ccdetails['token'];\n } else {\n $options['x_card_num'] = $ccdetails['cardnum'];\n $options['x_exp_date'] = $ccdetails['expdate']; //MMYY\n if($ccdetails['cvv']) {\n //this is manual payment, client passed cvv code\n $options['x_card_code'] = $ccdetails['cvv'];\n }\n }\n\n\n //\n //SEND details to your credit card processor to validate and attempt to charge\n //\n $response = $this->processData($options);\n\n switch ($response['code']) {\n case 1:\n //charge succeeded, add transaction and log it\n $this->logActivity(array(\n 'output' => $response,\n 'result' => PaymentModule::PAYMENT_SUCCESS\n ));\n $this->addTransaction(array(\n 'client_id' => $this->client['client_id'],\n 'invoice_id' => $this->invoice_id,\n 'description' => \"Payment for invoice \".$this->invoice_id,\n 'number' => $response['Transaction ID'],\n 'in' => $this->amount,\n 'fee' => '0'\n ));\n\n //Store token only if client allowed to - $ccetails['store']==true\n if($response['Token'] && $ccdetails['store']) {\n return $response['Token']; //return token to be stored\n } else {\n return true; //capture success\n }\n break;\n\n case 2:\n $this->logActivity(array(\n 'output' => $response,\n 'result' => PaymentModule::PAYMENT_FAILURE\n ));\n return false;\n\n break;\n }\n }",
"protected function _instantiateCreditCard($data)\n {\n if ($data->token) {\n unset($data['creditcard']);\n unset($data['contact']);\n return;\n }\n\n $data->append(array(\n 'creditcard' => new KConfig(),\n ));\n\n $creditcard = $data->creditcard;\n $name = trim($creditcard->name);\n $space = KHelperString::strpos($name, ' ');\n\n $creditcard_data = array(\n 'type' => $creditcard->type,\n 'first_name' => KHelperString::ucwords(KHelperString::substr($name, 0, $space)),\n 'last_name' => KHelperString::ucwords(KHelperString::substr($name, $space + 1)),\n 'number' => $creditcard->number,\n 'month' => $creditcard->month,\n 'year' => $creditcard->year,\n 'verification_value' => $creditcard->csv,\n );\n\n $creditcard = new Merchant_Billing_CreditCard($creditcard_data);\n $this->creditcard = $creditcard;\n $contact = $this->_instantiateContact($data);\n $this->order->setPaymentMethod(new ComSubscriptionsDomainPaymentMethodCreditcard($creditcard, $contact));\n\n return $creditcard;\n }",
"public abstract function createCard(String $customerToken, Array $card): ?String;",
"function createpaymentprofile($profileid = NULL ,$card = \"4111111111111111\", $expdate = \"2020-11\", $firstname = \"John\", $lastname = \"Smith\", $phone= \"000-000-0000\") {\n\t\t$content =\n\t\t\t\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\" .\n\t\t\t\"<createCustomerPaymentProfileRequest xmlns=\\\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\\\">\" .\n\t\t\t$this->MerchantAuthenticationBlock().\n\t\t\t\"<customerProfileId>\" . $profileid . \"</customerProfileId>\".\n\t\t\t\"<paymentProfile>\".\n\t\t\t\"<billTo>\".\n\t\t\t \"<firstName>\".$firstname.\"</firstName>\".\n\t\t\t \"<lastName>\".$lastname.\"</lastName>\".\n\t\t\t \"<phoneNumber>\".$phone.\"</phoneNumber>\".\n\t\t\t\"</billTo>\".\n\t\t\t\"<payment>\".\n\t\t\t \"<creditCard>\".\n\t\t\t \"<cardNumber>\".$card.\"</cardNumber>\".\n\t\t\t \"<expirationDate>\".$expdate.\"</expirationDate>\". // required format for API is YYYY-MM\n\t\t\t \"</creditCard>\".\n\t\t\t\"</payment>\".\n\t\t\t\"</paymentProfile>\".\n\t\t\t\"<validationMode>\".AUTHMODE.\"</validationMode>\". // or testMode\n\t\t\t\"</createCustomerPaymentProfileRequest>\";\n\n\t\t//echo \"Raw request: \" . htmlspecialchars($content) . \"<br><br>\";\n\t\t$response = $this->send_xml_request($content);\n\t\t//echo \"Raw response: \" . htmlspecialchars($response) . \"<br><br>\";\n\t\t$parsedresponse = $this->parse_api_response($response);\n\t\tif (\"Ok\" == $parsedresponse->messages->resultCode) {\n\t\t\t/*echo \"customerPaymentProfileId <b>\"\n\t\t\t\t. htmlspecialchars($parsedresponse->customerPaymentProfileId)\n\t\t\t\t. \"</b> was successfully created for customerProfileId <b>\"\n\t\t\t\t. htmlspecialchars($profileid)\n\t\t\t\t. \"</b>.<br><br>\";*/\n\t\t\treturn htmlspecialchars($parsedresponse->customerPaymentProfileId);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function testBuildCreditCardSaleTransactionSetup()\n {\n $transactionSetup = TransactionSetupBuilder::buildStandardSaleTransactionSetup(self::$testConfig);\n $this->assertInstanceOf('\\SinglePay\\PaymentService\\Element\\Express\\Type\\TransactionSetup', $transactionSetup);\n $this->assertEquals($transactionSetup->TransactionSetupMethod, 'CreditCardSale');\n $this->assertEquals($transactionSetup->Device, 'Null');\n }",
"function checkCredit( $custNumber, $amount ){\n $wsdl='https://www.usaepay.com/soap/gate/3213EA2A/usaepay.wsdl';\n\n // instantiate SoapClient object as $client\n $client = new SoapClient($wsdl);\n\n $sourcekey = 'YuFvOqWk7DP0fHo2sYKUDY16q0oyV0Gt';\n $pin = '5989';\n\n // generate random seed value\n $seed=mktime() . rand();\n\n // make hash value using sha1 function\n $clear= $sourcekey . $seed . $pin;\n $hash=sha1($clear);\n\n // assembly ueSecurityToken as an array\n $token=array(\n 'SourceKey'=>$sourcekey,\n 'PinHash'=>array(\n 'Type'=>'sha1',\n 'Seed'=>$seed,\n 'HashValue'=>$hash\n ),\n 'ClientIP'=>$_SERVER['REMOTE_ADDR'],\n );\n\n try {\n\n $Details=array(\n 'Invoice' => rand(),\n 'PONum' => '',\n 'OrderID' => '',\n 'Description' => 'Sample Credit Card Sale',\n 'Amount'=> $amount\n );\n\n $CustNum='28517843';\n $PayMethod='0';\n $Command='AuthOnly';\n\n $res=$client->runCustomerTransaction($token, $CustNum, $Details, $Command, $PayMethod);\n\n if( $res->Result == 'Approved' ){\n return true;\n }else{\n return false;\n }\n\n }\n\n catch (SoapFault $e) {\n $this->Session->setFlash(__(\"Your credit account has exceeded its credit limit. Please contact your salesman.\"), 'default', array('class' => 'failure'));\n\n }\n }",
"function addBank($BankName,$ShortName,$Phone,$BankAddress,$Fax,$Email,$MaximumLoanMoney,$MinimumLoanMoney,$MaximumPayMoney,$MinimumPayMoney,$CreatedBy)\r\n {\r\n $class_name = $this->class_name;\r\n $function_name = 'addBank';\r\n if ( authenUser(func_get_args(), $this, $function_name) > 0 )\r\n return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this );\r\n $fields_values = array(\r\n \"BankName\" => $BankName,\r\n \"ShortName\" => $ShortName,\r\n \"Phone\" => $Phone,\r\n \"BankAddress\" => $BankAddress,\r\n \"Fax\" => $Fax,\r\n \"Email\" => $Email,\r\n \"MaximumLoanMoney\" => $MaximumLoanMoney,\r\n \"MinimumLoanMoney\" => $MinimumLoanMoney,\r\n \"MaximumPayMoney\" => $MaximumPayMoney,\r\n \"MinimumPayMoney\" => $MinimumPayMoney,\r\n \"CreatedBy\" => $CreatedBy,\r\n \"CreatedDate\" => $this->_MDB2_WRITE->date->mdbnow()\r\n );\r\n $this->_ERROR_CODE = $this->checkBankValidate($fields_values);\r\n if($this->_ERROR_CODE == 0)\r\n {\r\n\r\n $query = sprintf( \"CALL sp_insertBank ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')\", $BankName, $ShortName, $BankAddress, $Fax, $Phone, $Email, $MaximumLoanMoney, $MinimumLoanMoney, $MaximumPayMoney, $MinimumPayMoney, $CreatedBy);\r\n $result = $this->_MDB2_WRITE->extended->getAll($query);\r\n //Can not insert\r\n if(empty($result)) $this->_ERROR_CODE = 13002;\r\n else{\r\n if(isset($result[0]['varerror']))\r\n {\r\n //Bank_Short_Name have been exist\r\n if($result[0]['varerror'] == -1) $this->_ERROR_CODE = 13014;\r\n //success\r\n if($result[0]['varerror'] >0)\r\n {\r\n $this->items[0] = new SOAP_Value(\r\n 'items',\r\n '{urn:'. $class_name .'}'.$function_name.'Struct',\r\n array(\r\n 'ID' => new SOAP_Value(\"ID\", \"string\", $result[0]['varerror'])\r\n )\r\n );\r\n }\r\n }\r\n }\r\n }\r\n return returnXML(func_get_args(), $this->class_name, $function_name, $this->_ERROR_CODE, $this->items, $this );\r\n }",
"private function addCreditcard(CreditCard $creditcard)\n {\n $this->post['CardNumber'] = $creditcard->number;\n $this->post['CardExpiryMonth'] = $this->cc_format($creditcard->month, 'two_digits');\n $this->post['CardExpiryYear'] = $this->cc_format($creditcard->year, 'two_digits');\n $this->post['CustomerFirstName'] = $creditcard->first_name;\n $this->post['CustomerLastName'] = $creditcard->last_name;\n $this->post['CardHoldersName'] = $creditcard->name();\n\n if ($creditcard->verification_value) {\n $this->post['CVN'] = $creditcard->verification_value;\n }\n }"
] | [
"0.6335692",
"0.5951118",
"0.5805216",
"0.5760594",
"0.57583344",
"0.5720199",
"0.5715506",
"0.5427092",
"0.54074156",
"0.53783935",
"0.5361032",
"0.5340544",
"0.52678084",
"0.5240009",
"0.5227197",
"0.5216466",
"0.5182387",
"0.51801497",
"0.5170355",
"0.5160316",
"0.51464653",
"0.51351947",
"0.51327235",
"0.51075166",
"0.51047474",
"0.5082583",
"0.50680816",
"0.5064044",
"0.5057347",
"0.50363284"
] | 0.6304274 | 1 |
$trackingData>appendChild($dom>createElementNS($this>serviceNamespace, $this>servicePrefix . ':Reference1', $referenceData)); | function buildTracking() {
//$trackingData->appendChild($dom->createElementNS($this->serviceNamespace, $this->servicePrefix . ':Reference1', $referenceData));
//$trackingData->appendChild( $dom->createElementNS( $this->serviceNamespace, $this->servicePrefix . ':Reference2', "Items: " . implode(', ', $itemsDesc) ) );
//$trackingData->appendChild( $dom->createElementNS( $this->serviceNamespace, $this->servicePrefix . ':Reference3', "Product IDs: " . implode(', ', $productIds) ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createReference();",
"function set_XML($timeStamp, $traceUniqueId, $ussdString, $msgType, $ussdOpType, $msisdn, $interface, $current_service)\r\n{\r\n return '<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n <soapenv:Header>\r\n <ns1:NotifySOAPHeader xmlns:ns1=\"http://www.huawei.com.cn/schema/common/v2_1\">\r\n <ns1:spId>'.$current_service->sp_id.'</ns1:spId>\r\n <ns1:serviceId>'.$current_service->service_sdp_id.'</ns1:serviceId>\r\n <ns1:timeStamp>'. $timeStamp. '</ns1:timeStamp>\r\n <ns1:linkid>09090943076202503225</ns1:linkid>\r\n <ns1:traceUniqueID>'. $traceUniqueId.'</ns1:traceUniqueID>\r\n <ns1:OperatorID>24201</ns1:OperatorID>\r\n </ns1:NotifySOAPHeader>\r\n </soapenv:Header>\r\n <soapenv:Body>\r\n <ns2:notifyUssdReception xmlns:ns2=\"http://www.csapi.org/schema/parlayx/ussd/notification/v1_0/local\">\r\n <ns2:msgType>'.$msgType.'</ns2:msgType>\r\n <ns2:senderCB>1904855568</ns2:senderCB>\r\n <ns2:receiveCB>FFFFFFFF</ns2:receiveCB>\r\n <ns2:ussdOpType>'.$ussdOpType.'</ns2:ussdOpType>\r\n <ns2:msIsdn>'. $msisdn. '</ns2:msIsdn>\r\n <ns2:serviceCode>166</ns2:serviceCode>\r\n <ns2:codeScheme>15</ns2:codeScheme>\r\n <ns2:ussdString>'.$ussdString.'</ns2:ussdString>\r\n <ns2:ussdInterface>'.$interface.'</ns2:ussdInterface>\r\n </ns2:notifyUssdReception>\r\n </soapenv:Body>\r\n</soapenv:Envelope>';\r\n}",
"function addSelfToDocument($domtree, $parentElement) {\n $parentElement->appendChild($domtree->createElement('homeurl', home_url()));\n $parentElement->appendChild($domtree->createElement('selectiondate', $this->selectionDate->format('Y-m-d')));\n $parentElement->appendChild($domtree->createElement('selectiondate_long', $this->selectionDate->format('D, d M Y')));\n\n if( $this->lastCompletedAllocScraperJob ) {\n $parentElement->appendChild($domtree->createElement('last_completed_job', \n DateTime::createFromFormat('Y-m-d H:i:s', $this->lastCompletedAllocScraperJob)->format('D, d M Y H:i:s')));\n }\n\n if( $this->isRefreshJobInProgress ) {\n $parentElement->appendChild($domtree->createElement('job_in_progress', 'true' ));\n }\n\n // did the last job fail to run?\n if( $this->lastJob ) {\n $parentElement->appendChild($domtree->createElement('last_job_id', $this->lastJob['jobId'] ));\n $parentElement->appendChild($domtree->createElement('last_job_status', $this->lastJob['status'] ));\n $parentElement->appendChild($domtree->createElement('check_credentials', $this->lastJob['lastJobFailedDueToCredentials'] ? 'true' : 'false' ));\n $parentElement->appendChild($domtree->createElement('last_job_error_log', \n get_option('hbo_log_directory_url') . $this->lastJob['jobId'] ));\n }\n\n $xmlRoot = $parentElement->appendChild($domtree->createElement('bedcounts'));\n foreach( $this->bedcountData as $row ) {\n $roomRoot = $xmlRoot->appendChild($domtree->createElement('room'));\n $roomRoot->appendChild($domtree->createElement('id', htmlspecialchars($row->room)));\n $roomRoot->appendChild($domtree->createElement('capacity', $row->capacity));\n $roomRoot->appendChild($domtree->createElement('room_type', $row->room_type));\n $roomRoot->appendChild($domtree->createElement('num_empty', $row->num_empty));\n $roomRoot->appendChild($domtree->createElement('num_staff', $row->num_staff));\n $roomRoot->appendChild($domtree->createElement('num_paid', $row->num_paid));\n $roomRoot->appendChild($domtree->createElement('num_noshow', $row->num_noshow));\n }\n }",
"function ws_tags_add($params, &$service)\n{\n include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');\n\n $creation_output = create_tag($params['name']);\n\n if (isset($creation_output['error']))\n {\n return new PwgError(WS_ERR_INVALID_PARAM, $creation_output['error']);\n }\n\n pwg_activity('tag', $creation_output['id'], 'add');\n\n $query = '\nSELECT name, url_name \nFROM `'.TAGS_TABLE.'`\nWHERE id = '.$creation_output['id'].';';\n\n$new_tag = query2array($query);\n\n return array(\n 'info' => $creation_output['info'],\n 'id' => $creation_output['id'],\n 'name' => $new_tag[0]['name'],\n 'url_name' => $new_tag[0]['url_name']\n );\n}",
"function addKeyword($keywordItem) {\n global $xml;\n global $xml_keyword;\n $xml_keywordItem = $xml ->createElement(\"KeyItem\",$keywordItem);\n $xml_keyword->appendChild($xml_keywordItem);\n}",
"function createReference()\n\t{\n\t\t$this->ilias->raiseError(\"Operation ilObjStyleSheet::createReference() not allowed.\",$this->ilias->error_obj->FATAL);\n\t}",
"function _erpal_projects_service_timetracking_create($timetracking) {\n $returns = array();\n foreach ($timetracking['timetracking'] as $value) {\n $newTimetracking = (object) NULL;\n $newTimetracking->type = 'erpal_timetracking';\n $newTimetracking->title = $value['title'];\n $newTimetracking->field_date_time[LANGUAGE_NONE][0]['value'] = $value['startdate'];\n $newTimetracking->field_date_time[LANGUAGE_NONE][0]['value2'] = $value['enddate'];\n $newTimetracking->field_date_time[LANGUAGE_NONE][0]['timezone'] = $value['timezone'];\n $newTimetracking->field_billing_duration[LANGUAGE_NONE][0]['value'] = $value['billing_duration'];\n $newTimetracking->field_timetracking_duration[LANGUAGE_NONE][0]['value'] = $value['duration'];\n $newTimetracking->field_timetracking_subject[LANGUAGE_NONE][0]['target_id'] = $value['subject'];\n $newTimetracking->field_project_tags[LANGUAGE_NONE][0]['tid'] = $value['project_tags'];\n node_save($newTimetracking);\n $returnnode['title'] = $newTimetracking->title;\n $returnnode['timetracking'] = url('rest/projects/timetracking/' . $newTimetracking->nid, array('absolute' => TRUE));\n $returnnode['duration'] = $newTimetracking->field_timetracking_duration[LANGUAGE_NONE][0]['value'];\n $returns[] = $returnnode;\n }\n return $returns;\n}",
"public function created(Ref $ref)\n {\n //\n }",
"function addNodeGraphicsXml($blank_xml, $tmpXml){\n\t$node = $blank_xml -> addChild(\"shape\",$tmpXml);\n\treturn($blank_xml);\n}",
"private function createRef(): string\n {\n return sprintf(\n '{{Quelle|url=%s|title=Galactapedia %s|date=%s|access_date=%s|ref=true|ref_name=galactapedia}}',\n $this->article->url,\n $this->article->cleanTitle,\n $this->article->created_at->format('d.m.Y'),\n $this->article->updated_at->format('d.m.Y'),\n );\n }",
"function vtws_create($elementType, $element, $user) {\n\n\t$types = vtws_listtypes(null, $user);\n\tif (!in_array($elementType, $types['types'])) {\n\t\tthrow new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, \"Permission to perform the operation is denied\");\n\t}\n\n\tglobal $log, $adb, $app_strings;\n\n\t//setting $app_strings \n\tif(empty($app_strings)) { \n\t\t$currentLanguage = Vtiger_Language_Handler::getLanguage(); \n\t\t$moduleLanguageStrings = Vtiger_Language_Handler::getModuleStringsFromFile($currentLanguage); \n\t\t$app_strings = $moduleLanguageStrings['languageStrings']; \n\t}\n\n\t// Cache the instance for re-use\n\tif(!isset($vtws_create_cache[$elementType]['webserviceobject'])) {\n\t\t$webserviceObject = VtigerWebserviceObject::fromName($adb,$elementType);\n\t\t$vtws_create_cache[$elementType]['webserviceobject'] = $webserviceObject;\n\t} else {\n\t\t$webserviceObject = $vtws_create_cache[$elementType]['webserviceobject'];\n\t}\n\t// END\t\t\t\n\n\t$handlerPath = $webserviceObject->getHandlerPath();\n\t$handlerClass = $webserviceObject->getHandlerClass();\n\n\trequire_once $handlerPath;\n\n\t$handler = new $handlerClass($webserviceObject, $user, $adb, $log);\n\t$meta = $handler->getMeta();\n\tif ($meta->hasCreateAccess() !== true) {\n\t\tthrow new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, \"Permission to write is denied\");\n\t}\n\n\t$referenceFields = $meta->getReferenceFieldDetails();\n\tforeach ($referenceFields as $fieldName => $details) {\n\t\tif (isset($element[$fieldName]) && strlen($element[$fieldName]) > 0) {\n\t\t\t$ids = vtws_getIdComponents($element[$fieldName]);\n\t\t\t$elemTypeId = $ids[0];\n\t\t\t$elemId = $ids[1];\n\t\t\t$referenceObject = VtigerWebserviceObject::fromId($adb, $elemTypeId);\n\t\t\tif (!in_array($referenceObject->getEntityName(), $details)) {\n\t\t\t\tthrow new WebServiceException(WebServiceErrorCode::$REFERENCEINVALID,\n\t\t\t\t\t\t\"Invalid reference specified for $fieldName\");\n\t\t\t}\n\t\t\tif ($referenceObject->getEntityName() == 'Users') {\n\t\t\t\tif(!$meta->hasAssignPrivilege($element[$fieldName])) {\n\t\t\t\t\tthrow new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, \"Cannot assign record to the given user\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!in_array($referenceObject->getEntityName(), $types['types']) && $referenceObject->getEntityName() != 'Users') {\n\t\t\t\tthrow new WebServiceException(WebServiceErrorCode::$ACCESSDENIED,\n\t\t\t\t\t\t\"Permission to access reference type is denied\" . $referenceObject->getEntityName());\n\t\t\t}\n\t\t} else if ($element[$fieldName] !== NULL) {\n\t\t\tunset($element[$fieldName]);\n\t\t}\n\t}\n\n\tif ($meta->hasMandatoryFields($element)) {\n\n\t\t$ownerFields = $meta->getOwnerFields();\n\t\tif (is_array($ownerFields) && sizeof($ownerFields) > 0) {\n\t\t\tforeach ($ownerFields as $ownerField) {\n\t\t\t\tif (isset($element[$ownerField]) && $element[$ownerField] !== null &&\n\t\t\t\t\t\t!$meta->hasAssignPrivilege($element[$ownerField])) {\n\t\t\t\t\tthrow new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, \"Cannot assign record to the given user\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$entity = $handler->create($elementType, $element);\n\t\tVTWS_PreserveGlobal::flush();\n\t\treturn $entity;\n\t} else {\n\n\t\treturn null;\n\t}\n}",
"function createReference() {\n $num = array_push($this->references, new PhingReference());\n return $this->references[$num-1];\n }",
"function addReference($ref)\n{\n\t$this->SetFont( \"Arial\", \"\", 10);\n\t$length = $this->GetStringWidth( \"Références : \" . $ref );\n\t$r1 = 10;\n\t$r2 = $r1 + $length;\n\t$y1 = 92;\n\t$y2 = $y1+5;\n\t$this->SetXY( $r1 , $y1 );\n\t$this->Cell($length,4, \"Références : \" . $ref);\n}",
"public function createReferenceNumber(){\n Log::notice('Generating Reference Number....');\n if($this->overrideTransactionReference){\n $this->txref = $this->transactionPrefix;\n }else{\n $this->txref = uniqid($this->transactionPrefix);\n }\n Log::notice('Generated Reference Number....'.$this->txref);\n return $this;\n }",
"public function constructXml()\n {\n $this->xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">';\n $this->xml .= $this->xmlBody;\n $this->xml .= '</soapenv:Envelope>';\n }",
"protected function _createElement()\r\n {\r\n $key = $this->_key;\r\n $this->_key = $this->_name;\r\n parent::_createElement();\r\n $this->_key = $key;\r\n }",
"function addClient( $ref )\n{\n\t$r1 = $this->w - 31;\n\t$r2 = $r1 + 19;\n\t$y1 = 17;\n\t$y2 = $y1;\n\t$mid = $y1 + ($y2 / 2);\n\t$this->RoundedRect($r1, $y1, ($r2 - $r1), $y2, 3.5, 'D');\n\t$this->Line( $r1, $mid, $r2, $mid);\n\t$this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1+3 );\n\t$this->SetFont( \"Arial\", \"B\", 10);\n\t$this->Cell(10,5, \"CLIENT\", 0, 0, \"C\");\n\t$this->SetXY( $r1 + ($r2-$r1)/2 - 5, $y1 + 9 );\n\t$this->SetFont( \"Arial\", \"\", 10);\n\t$this->Cell(10,5,$ref, 0,0, \"C\");\n}",
"public function __construct($_industId = NULL,$_name = NULL,$_legalName = NULL,$_contactInfo = NULL,$_deptDivGrp = NULL,$_tINInfo = NULL,$_establishDt = NULL,$_numEmployees = NULL,$_orgId = NULL,$_corpType = NULL,$_corpStatus = NULL,$_corpStatusDt = NULL,$_message = NULL,$_incorporationDt = NULL,$_charterInfo = NULL,$_agentInfo = NULL,$_mergedName = NULL,$_dBAName = NULL,$_priorName = NULL,$_origDtFiled = NULL,$_recentFilingDt = NULL,$_busType = NULL,$_activeStatusInd = NULL,$_busStatusDesc = NULL,$_forProfitInd = NULL,$_ownerRegistrantInfo = NULL,$_orgType = NULL,$_recordID = NULL,$_pRInd = NULL,$_fileNumber = NULL,$_bIN = NULL,$_incorporationState = NULL,$_significantPRInd = NULL,$_busLicense = NULL,$_registrationDetails = NULL)\n {\n MicrobiltCriminalReportWsdlClass::__construct(array('IndustId'=>$_industId,'Name'=>$_name,'LegalName'=>$_legalName,'ContactInfo'=>$_contactInfo,'DeptDivGrp'=>$_deptDivGrp,'TINInfo'=>$_tINInfo,'EstablishDt'=>$_establishDt,'NumEmployees'=>$_numEmployees,'OrgId'=>$_orgId,'CorpType'=>$_corpType,'CorpStatus'=>$_corpStatus,'CorpStatusDt'=>$_corpStatusDt,'Message'=>$_message,'IncorporationDt'=>$_incorporationDt,'CharterInfo'=>$_charterInfo,'AgentInfo'=>$_agentInfo,'MergedName'=>$_mergedName,'DBAName'=>$_dBAName,'PriorName'=>$_priorName,'OrigDtFiled'=>$_origDtFiled,'RecentFilingDt'=>$_recentFilingDt,'BusType'=>$_busType,'ActiveStatusInd'=>$_activeStatusInd,'BusStatusDesc'=>$_busStatusDesc,'ForProfitInd'=>$_forProfitInd,'OwnerRegistrantInfo'=>$_ownerRegistrantInfo,'OrgType'=>$_orgType,'RecordID'=>$_recordID,'PRInd'=>$_pRInd,'FileNumber'=>$_fileNumber,'BIN'=>$_bIN,'IncorporationState'=>$_incorporationState,'SignificantPRInd'=>$_significantPRInd,'BusLicense'=>$_busLicense,'RegistrationDetails'=>$_registrationDetails),false);\n }",
"public function appendXML($data);",
"function cria_Definitions(){\n\t\t\tglobal $novoXML_Definitions, $novoXML;\n\t\t\t$novoXML_Definitions = $novoXML->createElement( \"tosca:Definitions\" );\n\t\t\t$novoXML_Definitions->setAttribute( \"id\", \"TOSCADefinition\" );\n\t\t\t$novoXML_Definitions->setIdAttribute(\"id\",TRUE);\t\t\t\n\t\t\t$novoXML_Definitions->setAttribute( \"xmlns:tosca\",\"http://docs.oasis-open.org/tosca/ns/2011/12\"); \n\t\t\t$novoXML_Definitions->setAttribute( \"targetNamespace\",\"http://docs.oasis-open.org/tosca/ns/2011/12/ToscaSpecificTypes\");\n\t\t\t//$novoXML_Definitions->setAttribute( \"xmlns:my\",\"http://vtconverter.esy.es/Definitions/\");\t\t\t\n\t\t\t\n\t\t\t$novoXML_Import = $novoXML->createElement( \"tosca:Import\" );\n\t\t\t$novoXML_Import->setAttribute( \"importType\", \"http://www.w3.org/2001/XMLSchema\" );\n\t\t\t$novoXML_Import->setAttribute( \"namespace\", \"http://www.example.com/tcc/udesc\" );\n\t\t\t$novoXML_Import->setAttribute( \"location\", \"../imports/Definitions.xsd\"); \t\t\t\n\t\t\t$novoXML_Definitions->appendChild( $novoXML_Import );\n\t\t\t$novoXML->appendChild( $novoXML_Definitions );\n\t\t}",
"public function appendRecord(){\n $record = $this->document->createElement('record');\n $this->parentElement->appendChild($record);\n // Sets the parent of the next append functions\n $this->parentElement = $record;\n $this->appendHeader();\n $this->appendMetadata();\n }",
"function createElement($name) {\n $tmp = new XMLNode();\n $tmp->nodeName = $name;\n return $tmp;\n }",
"function add_reports($data) {\n \t//Report\n\t\tforeach($data['Report'] as $report) {\n\t\t\t$this->startElementNS(NULL,'Report',XMLNS_COUNTER);\n //$this->writeAttribute(\"xmlns\", XMLNS_COUNTER);\n\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Created'])) {\n\t\t\t\t\t$this->writeAttribute('Created',$report['Created']);\n\t\t\t\t}\n\t\t\t\t$this->writeAttribute('ID',$report['ID']);\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Version'])) {\n\t\t\t\t\t$this->writeAttribute('Version',$report['Version']);\n\t\t\t\t}\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Name'])) {\n\t\t\t\t\t$this->writeAttribute('Name',$report['Name']);\n\t\t\t\t}\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Title'])) {\n\t\t\t\t\t$this->writeAttribute('Title',$report['Title']);\n\t\t\t\t}\n\n\t\t\t//Vendor\n\t\t\t$this->startElementNS(NULL,'Vendor',XMLNS_COUNTER);\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Vendor']['Name'])) {\n\t\t\t\t\t$this->writeElementNS(NULL,'Name',XMLNS_COUNTER,$report['Vendor']['Name']);\n\t\t\t\t}\n\t $this->writeElementNS(NULL,'ID',XMLNS_COUNTER,$report['Vendor']['ID']);\n \t//optional\n \tif(!empty($report['Vendor']['Contact'])) {\n\t \tforeach($report['Vendor']['Contact'] as $vendor_contact) {\n\t\t \t$this->startElementNS(NULL,'Contact',XMLNS_COUNTER);\n\t\t\t\t\t\t\tif(!empty($vendor_contact['Contact'])) {\n\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'Contact',XMLNS_COUNTER,$vendor_contact['Contact']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($vendor_contact['E-mail'])) {\n\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'E-mail',XMLNS_COUNTER,$vendor_contact['E-mail']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->endElement(); //Contact\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Vendor']['WebSiteUrl'])) {\n\t\t\t\t\t$this->writeElementNS(NULL,'WebSiteUrl',XMLNS_COUNTER,$report['Vendor']['WebSiteUrl']);\n\t\t\t\t}\n\t\t\t\t//optional\n\t\t\t\tif(!empty($report['Vendor']['LogoUrl'])) {\n\t\t\t\t\t$this->writeElementNS(NULL,'LogoUrl',XMLNS_COUNTER,$report['Vendor']['LogoUrl']);\n\t\t\t\t}\n\t $this->endElement(); // Vendor\n\n\t //Customer\n\t foreach($report['Customer'] as $customer) {\n\t\t $this->startElementNS(NULL,'Customer',XMLNS_COUNTER);\n\t\t \t//optional\n\t\t \tif(!empty($customer['Name'])) {\n\t\t \t\t$this->writeElementNS(NULL,'Name',XMLNS_COUNTER,$customer['Name']);\n\t\t \t}\n\t\t \t$this->writeElementNS(NULL,'ID',XMLNS_COUNTER,$customer['ID']);\n\t\t \t//optional\n\t\t \tif(!empty($customer['Contact'])) {\n\t\t\t \tforeach($customer['Contact'] as $customer_contact) {\n\t\t \t\t$this->startElementNS(NULL,'Contact',XMLNS_COUNTER);\n\t\t\t\t\t\t\t\tif(!empty($customer_contact['Contact'])) {\n\t\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'Contact',XMLNS_COUNTER,$customer_contact['Contact']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($customer_contact['E-mail'])) {\n\t\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'E-mail',XMLNS_COUNTER,$customer_contact['E-mail']);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->endElement();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//optional\n\t\t\t\t\tif(!empty($customer['WebSiteUrl'])) {\n\t\t \t\t$this->writeElementNS(NULL,'WebSiteUrl',XMLNS_COUNTER,$customer['WebSiteUrl']);\n\t\t \t}\n\t\t \t//optional\n\t\t \tif(!empty($customer['LogoUrl'])) {\n\t\t \t\t$this->writeElementNS(NULL,'LogoUrl',XMLNS_COUNTER,$customer['LogoUrl']);\n\t\t \t}\n\n\t\t //optional\n\t\t if(!empty($customer['Consortium'])) {\n\t\t \t//optional\n\t\t \tif(!empty($customer['Consortium']['Code'])) {\n\t\t \t\t$this->writeElementNS(NULL,'Code',XMLNS_COUNTER,$customer['Consortium']['Code']);\n\t\t \t}\n\t\t \t$this->writeElementNS(NULL,'WellKnownName',XMLNS_COUNTER,$customer['Consortium']['WellKnownName']);\n\t\t }\n\n\t\t //optional\n\t\t if(!empty($customer['InstitutionalIdentifier'])) {\n\t\t\t foreach($customer['InstitutionalIdentifier'] as $institutionalidentifier) {\n\t\t\t \t$this->writeElementNS(NULL,'Type',XMLNS_COUNTER,$institutionalidentifier['Type']);\n\t\t\t \t$this->writeElementNS(NULL,'Value',XMLNS_COUNTER,$institutionalidentifier['Value']);\n\t\t\t }\n\t\t\t }\n\n\t\t\t\t//ReportItems\n\t\t \tforeach($customer['ReportItems'] as $reportitem) {\n\t\t\t \t$this->startElementNS(NULL,'ReportItems',XMLNS_COUNTER);\n\t\t\t \t\t//optional\n\t\t\t \t\tif(!empty($customer['ItemIdentifier'])) {\n\t\t\t\t \t\tforeach($reportitem['ItemIdentifier'] as $itemidentifier) {\n\t\t\t \t\t\t$this->writeElementNS(NULL,'Type',XMLNS_COUNTER,$itemidentifier['Type']);\n\t\t\t \t\t\t$this->writeElementNS(NULL,'Value',XMLNS_COUNTER,$itemidentifier['Value']);\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \t\t$this->writeElementNS(NULL,'ItemPlatform',XMLNS_COUNTER,$reportitem['ItemPlatform']);\n\t\t\t \t\t//optional\n\t\t\t \t\tif(!empty($reportitem['ItemPublisher'])) {\n\t\t\t\t\t\t\t$this->writeElementNS(NULL,'ItemPublisher',XMLNS_COUNTER,$reportitem['ItemPublisher']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->writeElementNS(NULL,'ItemName',XMLNS_COUNTER,$reportitem['ItemName']);\n\t\t\t\t\t\t$this->writeElementNS(NULL,'ItemDataType',XMLNS_COUNTER,$reportitem['ItemDataType']);\n\n\t\t\t\t\t\tforeach($reportitem['ItemPerformance'] as $item) {\n\t\t\t\t\t\t\t//optional attribute\n\t\t\t\t\t\t\tif (!empty($item['PubYr'])) {\n\t\t\t\t\t\t\t\t$this->writeAttribute('PubYr',$item['PubYr']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//optional attribute\n\t\t\t\t\t\t\tif (!empty($item['PubYrFrom'])) {\n\t\t\t\t\t\t\t\t$this->writeAttribute('PubYrFrom',$item['PubYrFrom']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//optional attribute\n\t\t\t\t\t\t\tif (!empty($item['PubYrTo'])) {\n\t\t\t\t\t\t\t\t$this->writeAttribute('PubYrTo',$item['PubYrTo']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->startElementNS(NULL,'ItemPerformance',XMLNS_COUNTER);\n\t\t\t\t\t\t\t$this->startElementNS(NULL,'Period',XMLNS_COUNTER);\n\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'Begin',XMLNS_COUNTER,$item['Period']['Begin']);\n\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'End',XMLNS_COUNTER,$item['Period']['End']);\n\t\t\t\t\t\t\t$this->endElement(); //Period\n\t\t\t\t\t\t\t$this->writeElementNS(NULL,'Category',XMLNS_COUNTER,$item['Category']);\n\t\t\t\t\t\t\tforeach($item['Instance'] as $instance) {\n\t\t\t\t\t\t\t\t$this->startElementNS(NULL,'Instance',XMLNS_COUNTER);\n\t\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'MetricType',XMLNS_COUNTER,$instance['MetricType']);\n\t\t\t\t\t\t\t\t\t$this->writeElementNS(NULL,'Count',XMLNS_COUNTER,$instance['Count']);\n\t\t\t\t\t\t\t\t$this->endElement();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->endElement(); //ItemPerformance\n\t\t\t\t\t\t}\n\t\t\t\t\t$this->endElement(); //ReportItems\n\t\t\t\t\t}\n\t\t\t\t$this->endElement(); //Customer\n\t\t\t}\n\t\t\t$this->endElement(); //Report\n\t\t}\n }",
"function buildWeight(&$dom, &$targetNode, $w, $units) {\n $targetNode->appendChild($dom->createElementNS($this->serviceNamespace, $this->servicePrefix . ':Value', $w)); // Required\n $targetNode->appendChild($dom->createElementNS($this->serviceNamespace, $this->servicePrefix . ':WeightUnit', $units)); // Required\n\t}",
"public function __construct($_codigoBaseGeografica = NULL,$_codigoIndicador = NULL,$_codigoMomento = NULL,$_codigoPeriodicidade = NULL,$_codigoPrograma = NULL,$_codigoUnidadeMedidaIndicador = NULL,$_dataApuracao = NULL,$_descricao = NULL,$_exercicio = NULL,$_fonte = NULL,$_formula = NULL,$_identificadorUnico = NULL,$_snApuracaoReferencia = NULL,$_snExclusaoLogica = NULL,$_valorReferencia = NULL)\n\t{\n\t\tQualitativoWsdlClass::__construct(array('codigoBaseGeografica'=>$_codigoBaseGeografica,'codigoIndicador'=>$_codigoIndicador,'codigoMomento'=>$_codigoMomento,'codigoPeriodicidade'=>$_codigoPeriodicidade,'codigoPrograma'=>$_codigoPrograma,'codigoUnidadeMedidaIndicador'=>$_codigoUnidadeMedidaIndicador,'dataApuracao'=>$_dataApuracao,'descricao'=>$_descricao,'exercicio'=>$_exercicio,'fonte'=>$_fonte,'formula'=>$_formula,'identificadorUnico'=>$_identificadorUnico,'snApuracaoReferencia'=>$_snApuracaoReferencia,'snExclusaoLogica'=>$_snExclusaoLogica,'valorReferencia'=>$_valorReferencia));\n\t}",
"public function LiteratureReferenceType()\n{\n$com['sim'][0]=[];\n$com['sim'][0]['ext'][0]=['base'=>'xsd:string'];\nreturn $com;\n}",
"function respond($tf) {\nprint '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <notifications xmlns=\"http://soap.sforce.com/2005/09/outbound\">\n <Ack>' .$tf.'</Ack>\n </notifications>\n </soapenv:Body>\n </soapenv:Envelope>';\n}",
"public function MySimpleXml_inser_xmlPhotoNode($targetParentName, $targetName, $tagNameToAdd, xmlPhotoElement $xmlElement){\n $photoIDXmlNode = new xmlListNode(\"\");\n $this->MySimpleXml_get_xmlNode($this->xmlTreeHead, \"root\",\"photoId\", \"\", $photoIDXmlNode);\n $photoIDXmlNode->data += 1;\n //echo $photoIDXmlNode->data;\n //$this->xmlTreeArray[\"root\"][\"photoId\"] +=1 ;\n \n /* Method 1 to generate and insert a photo node +++++ */\n /*$photoXmlNode = new xmlListNode(\"\");\n $photoXmlNode->name = \"photo\";\n $photoXmlNode->next = new xmlListNode($xmlElement->name);//name\n $photoXmlNode->next->name = \"name\";\n $photoXmlNode->next->next = NULL;\n \n $photoXmlNode->next->youngerBrother = new xmlListNode($photoIDXmlNode->data);//id\n $photoXmlNode->next->youngerBrother->name = \"id\";\n $photoXmlNode->next->youngerBrother->next = NULL;\n \n $photoXmlNode->next->youngerBrother->youngerBrother = new xmlListNode($xmlElement->time);//time\n $photoXmlNode->next->youngerBrother->youngerBrother->name = \"time\";\n $photoXmlNode->next->youngerBrother->youngerBrother->next = NULL;\n \n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother = new xmlListNode(\"\");//owner\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->name = \"owner\";\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->youngerBrother = NULL;\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next = new xmlListNode($xmlElement->owner->firstName);//owner:first name\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next->name = \"first_name\";\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next->youngerBrother = new xmlListNode($xmlElement->owner->lastName);//owner:first name\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next->youngerBrother->name = \"last_name\";\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next->youngerBrother->youngerBrother = NULL;\n $photoXmlNode->next->youngerBrother->youngerBrother->youngerBrother->next->youngerBrother->next = NULL;\n \n $lastPhoto = new xmlListNode(\"\"); \n if($xmlNode->next)\n {\n $lastPhoto = $xmlNode->next;\n }\n while($lastPhoto->youngerBrother)\n {\n $lastPhoto = $lastPhoto->youngerBrother;\n }\n $lastPhoto->youngerBrother = $photoXmlNode;\n $photoXmlNode->parent = $lastPhoto->youngerBrother->parent;\n $photoXmlNode->youngerBrother = NULL;*/\n /* Method 1 to generate and insert a photo node ----- */\n \n /* Method 2 to generate and insert a photo node +++++ */\n $xmlPhotoNode = new xmlListNode(\"\");\n $xmlPhotoNode->name = \"photo\";\n \n $xmlPhotoNameNode = new xmlListNode($xmlElement->name);\n $xmlPhotoNameNode->name = \"name\";\n \n $this->MySimpleXml_insert_childXmlNode_to($xmlPhotoNameNode, $xmlPhotoNode);\n \n $xmlPhotoIDNode = new xmlListNode($photoIDXmlNode->data);\n $xmlPhotoIDNode->name = \"id\";\n \n $this->MySimpleXml_insert_youngerBrotherXmlNode_to($xmlPhotoIDNode, $xmlPhotoNameNode);\n $xmlPhotoOwnerNode = new xmlListNode(\"\");\n $xmlPhotoOwnerNode->name = \"owner\";\n \n $xmlPhotoOwnerFirstNameNode = new xmlListNode($xmlElement->owner->firstName);\n $xmlPhotoOwnerFirstNameNode->name = \"first_name\";\n \n $this->MySimpleXml_insert_childXmlNode_to($xmlPhotoOwnerFirstNameNode, $xmlPhotoOwnerNode);\n \n $xmlPhotoOwnerLastNameNode = new xmlListNode($xmlElement->owner->lastName);\n $xmlPhotoOwnerLastNameNode->name = \"last_name\";\n \n $this->MySimpleXml_insert_youngerBrotherXmlNode_to($xmlPhotoOwnerLastNameNode, $xmlPhotoOwnerFirstNameNode);\n \n $this->MySimpleXml_insert_youngerBrotherXmlNode_to($xmlPhotoOwnerNode, $xmlPhotoIDNode);\n \n //$xmlPhotoTreeArray = array();\n //$this->reverse_breadth_first_trace($xmlPhotoNode->next, $xmlPhotoNode, $xmlPhotoTreeArray);\n //$this->breadth_first_trace($xmlPhotoNode->next, $xmlPhotoNode, $xmlPhotoTreeArray);\n //print_r($xmlPhotoTreeArray);\n \n /* Method 1 to add photo to xml tree +++++ */\n $this->MySimpleXml_insert_youngerBrotherXmlNode_to($xmlPhotoNode, $this->xmlTreeHead->next->next);\n /* Method 1 to add photo to xml tree ----- */\n \n /* Method 2 to add photo to xml tree +++++ */\n /* $head__ = $this->xmlTreeHead->next->next;\n while($head__->youngerBrother)\n {\n $head__ = $head__->youngerBrother;\n }\n $head__->youngerBrother = $xmlPhotoNode;*/\n /* Method 2 to add photo to xml tree ----- */\n /* Method 2 to generate and insert a photo node +++++ */\n\n $xmlPhotoTreeArray = array();\n $this->breadth_first_trace($this->xmlTreeHead->next, $this->xmlTreeHead, $xmlPhotoTreeArray);\n //print_r($xmlPhotoTreeArray);\n \n return $this->MySimpleXml_save_file('database.xml');\n }",
"private function initialize () {\r\n $rss=$this->dom->createElement('rdf:RDF');\r\n\r\n // Namespace hack\r\n $rss->setAttribute('xmlns:rdf',\r\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');\r\n $rss->setAttribute('xmlns',\r\n 'http://purl.org/rss/1.0/');\r\n $this->rss=$this->dom->appendChild($rss);\r\n $this->channel=$this->dom->createElement('channel');\r\n $this->itemSequence=$this->dom->createElement('rdf:seq');\r\n }",
"public function toXML() {\n $wsdl = new DomDocument(\"1.0\");\n //$root = $wsdl->createElementNS('http://schemas.xmlsoap.org/wsdl/', 'definitions');\n $root = $wsdl->createElement('wsdl:definitions');\n $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsd','http://www.w3.org/2001/XMLSchema');\n $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:tns', $this->ns);\n $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:soap-env',self::SCHEMA_SOAP);\n $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:wsdl',self::SCHEMA_WSDL);\n $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:soapenc',self::SOAP_SCHEMA_ENCODING);\n $root->setAttribute('targetNamespace', $this->ns);\n $this->addTypes($wsdl, $root);\n $this->addMessages($wsdl, $root);\n $this->addPortType($wsdl, $root);\n $this->addBinding($wsdl, $root);\n $this->addService($wsdl, $root);\n\n $wsdl->appendChild($root);\n return $wsdl->saveXML();\n }"
] | [
"0.57386136",
"0.52881896",
"0.52387035",
"0.51780355",
"0.5105792",
"0.50823855",
"0.50560975",
"0.5021821",
"0.5003027",
"0.49627924",
"0.49566665",
"0.4946914",
"0.4946262",
"0.4936556",
"0.49181435",
"0.48833263",
"0.4870043",
"0.4808673",
"0.47916916",
"0.4790051",
"0.47893485",
"0.47641766",
"0.47621426",
"0.47592166",
"0.4751086",
"0.47295085",
"0.4728174",
"0.47272924",
"0.47095096",
"0.47067317"
] | 0.7948366 | 0 |
SETTLE THE SQL to retrieve itinerary details table, review details table, payment table | public function retrieveByUserIdAndPayment() {
// select all query
$query = "SELECT a.*, b.*, c.* from payment a LEFT JOIN itinerary_details b ON a.itineraryid = b.itineraryid
LEFT JOIN reviewdetails c ON b.detailsid = c.itinerary_details WHERE a.paymentid = ?
GROUP BY b.location";
// prepare query statement
$stmt = $this->conn->prepare($query);
// bind
$stmt->bindParam(1, $this->paymentid);
// execute query
$stmt->execute();
return $stmt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function retrieveItineraryByUserid() {\n \n // select all query\n $query = \"SELECT DISTINCT(a.paymentid), a.userid, a.itineraryid, a.ispaid,b.*, c.*, d.tourtitle,\n e.ActivityRate, e.ReviewdetailsID\n from payment a LEFT join itinerary_details c ON a.itineraryid = c.itineraryid\n LEFT join review_table b ON c.itineraryid = b.itineraryid INNER JOIN itinerary d on c.itineraryid = d.itineraryid\n LEFT JOIN reviewdetails e ON b.reviewid = e.reviewid\n where a.userid = ?\n AND c.itineraryowner IS NOT NULL\n GROUP BY a.paymentid\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // bind\n $stmt->bindParam(1, $this->userid);\n \n // execute query\n $stmt->execute();\n return $stmt;\n }",
"function getReview($reviewId){\n $db = phpmotorsConnect();\n $sql = 'SELECT \n reviews.*, inventory.invMake, inventory.invModel, inventory.invId, clients.clientFirstname, clients.clientLastname, clients.clientId\n FROM \n reviews, inventory, clients\n WHERE \n reviews.reviewId = :reviewId\n AND\n inventory.invId = reviews.invId\n AND\n clients.clientId = reviews.clientId';\n\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':reviewId', $reviewId, PDO::PARAM_STR);\n $stmt->execute();\n $invInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $invInfo;\n}",
"function listApprovalDetailDataBase($parameters = array()) {\n global $db, $db_table_prefix, $db_name, $loggedInUser;\n \n $data = array();\n $parameters['jtsorting'] = (isset($parameters['jtsorting'])) ? $parameters['jtsorting'] : 'ap.id DESC ';\n $parameters['jtstartindex'] = (isset($parameters['jtstartindex'])) ? $parameters['jtstartindex'] : '';\n $parameters['approval_id'] = (isset($parameters['approval_id'])) ? $parameters['approval_id'] : '0'; \n $sql = \"\";\n $sql_size = \"\";\n if($parameters['jtpagesize'] != ''){\n $parameters['jtpagesize'] = (int)$parameters['jtstartindex'] + (int)$parameters['jtpagesize'];\n $sql = \"SELECT * FROM\n (\n SELECT ROW_NUMBER() OVER (ORDER BY \".$parameters['jtsorting'].\") AS Row, \n ap.id as detail_id, \n ap.description DisplayText,\n ap.description detail_description,\n (SELECT name FROM admin WHERE id=ap.editor_id) as name_edit,\n CONVERT(VARCHAR(19), ap.edit_date, 100) edit_date,\n am.approved_by,\n (SELECT name FROM admin WHERE id=am.approved_by) as name_aprovade,\n CONVERT(VARCHAR(19), am.approval_date, 100) aprov_date\n FROM \n approval_d ap\n INNER JOIN approval_m am ON\n am.id= ap.approval_m\n WHERE\n ap.approval_m = \".$db->sql_escape($parameters['approval_id']).\"\n \n )\n AS user_with_numbers\n WHERE Row > \".$parameters['jtstartindex'].\" AND Row <= \".$parameters['jtpagesize'].\"\";\n }else{\n $sql = \" \n SELECT ap.id as detail_id, \n ap.description DisplayText,\n ap.description detail_description,\n (SELECT name FROM admin WHERE id=ap.editor_id) as name_edit,\n CONVERT(VARCHAR(19), ap.edit_date, 100) edit_date,\n am.approved_by,\n (SELECT name FROM admin WHERE id=am.approved_by) as name_aprovade,\n CONVERT(VARCHAR(19), am.approval_date, 100) aprov_date\n FROM \n [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_d] ap\n INNER JOIN [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_m] am ON\n am.id= ap.approval_m\n WHERE\n ap.approval_m = \".$db->sql_escape($parameters['approval_id']).\"\";\n }\n\n\n \n $sql_count = \"SELECT COUNT(*) total \";\n $sql_count .=\" FROM \n [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_d] ap\n INNER JOIN [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_m] am ON\n am.id= ap.approval_m\n WHERE\n ap.approval_m = \".$db->sql_escape($parameters['approval_id']).\"\"; \n \n\n //error_log(\"La consulta>\".$sql);\n $result = $db->sql_query($sql);\n $result_count = $db->sql_query($sql_count);\n\n $result= $db->sql_fetchrowset($result);\n $result_count= $db->sql_fetchrow($result_count);\n //dumpear($result);\n $data[\"rows\"] = $result;\n $data[\"count\"] = $result_count['total'];\n \n return $data;\n}",
"public static function showAllDetails() {\r\n\t\t$reviews = (array_key_exists('reviews', $_SESSION))?$_SESSION['reviews']:array();\r\n\t\t$base = (array_key_exists('base', $_SESSION))?$_SESSION['base']:\"\";\r\n\t\techo '<div class=\"container\">';\r\n\t\techo '<h1>List of reviews</h1>';\r\n\t\techo '<div class=\"table-responsive\">';\r\n\t\techo '<table class=\"table table-striped\">';\r\n\t\techo '<thead>';\r\n\t\techo '<tr><th>Review Id</th><th>Submission Id</th>\r\n\t\t\t <th>Reviewer name</th> <th>Review score</th>\r\n\t\t\t <th>Show review</td> <th> Update review</th></tr>';\r\n\t\techo '</thead>';\r\n\t\techo '<tbody>';\r\n\t\r\n\t\tforeach($reviews as $review) {\r\n\t\t\techo '<tr>';\r\n\t\t\techo '<td>'. $review->getReviewId().'</td>';\r\n\t\t\techo '<td><a href=\"/'.$base.'/submission/show/'.$review->getSubmissionId().'\">Submission '. $review->getSubmissionId().'</a></td>';\r\n\t\t\techo '<td>'.$review->getReviewerName().'</td>';\r\n\t\t\techo '<td>'.$review->getScore().'</td>';\r\n\t\t\techo '<td><a href=\"/'.$base.'/review/show/'.$review->getReviewId().'\">Show</a></td>';\r\n\t\t\techo '<td><a href=\"/'.$base.'/review/update/'.$review->getReviewId().'\">Update</a></td>';\r\n\t echo '</tr>';\r\n\t\t}\r\n\t\techo '</tbody>';\r\n\t\techo '</table>';\r\n\t\techo '</div>';\r\n\t\techo '</div>';\r\n\t}",
"public function retrieve_data(){\n\n\t\t\t$sql_team = 'SELECT * FROM indicators WHERE save_status = \"locked\" ';\n\t\t\t$sql_weights = 'SELECT * FROM weights_and_thresholds';\n\n\t\t\tglobal $wpdb;\n\t\t\t$this -> team_results = $wpdb -> get_results( $sql_team, ARRAY_A );\n\t\t\t$this -> weights = $wpdb -> get_results( $sql_weights, ARRAY_A );\n\t\t}",
"function paypal_transaction_page()\n {\n\n global $wpdb;\n\n /** getting data of resume */\n $result = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}subscribe_deals INNER JOIN {$wpdb->prefix}users ON {$wpdb->prefix}users.ID = {$wpdb->prefix}subscribe_deals.user_id INNER JOIN {$wpdb->prefix}paypal_detail on {$wpdb->prefix}users.ID = {$wpdb->prefix}paypal_detail.user_id\");\n\n// var_dump($result); exit;\n\n ?>\n\n <div class=\"container\">\n <h2>Resume Review Data</h2><br>\n <table class=\"table table-striped table-bordered table-responsive\" id=\"myTable\">\n <thead>\n <tr>\n <th>User Name</th>\n <th>Deal Name</th>\n <th>Token</th>\n <th>Transaction ID</th>\n <th>Currency</th>\n <th>CM</th>\n <th>Item Number</th>\n <th>Signature</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n <?php\n foreach ($result as $key => $value) {\n ?>\n <tr>\n <td><?= $value->user_login ?></td>\n <td><?= $value->deal_name ?></td>\n <td><?= $value->token ?></td>\n <td><?= $value->tx ?></td>\n <td><?= $value->currency ?></td>\n <td><?= $value->cm ?></td>\n <td><?= $value->item_number ?></td>\n <td><?= $value->signature ?></td>\n <td><?= $value->status ?></td>\n </tr>\n <?php\n }\n ?>\n </tbody>\n </table>\n </div>\n <?php\n }",
"public function getStudentReceiptPrintDetail($condition='') {\n \n global $sessionHandler;\n \n $systemDatabaseManager = SystemDatabaseManager::getInstance(); \n \n $sessionId = $sessionHandler->getSessionVariable('SessionId');\n $instituteId = $sessionHandler->getSessionVariable('InstituteId');\n \n $query = \"SELECT\n ins.instituteName, ins.instituteCode, ins.instituteAbbr, IFNULL(ins.instituteLogo,'') AS instituteLogo,\n CONCAT(IFNULL(ins.instituteAddress1,''),' ',IFNULL(ins.instituteAddress2,'')) AS insAddress,\n IFNULL((SELECT cityName FROM city WHERE cityId = IFNULL(ins.cityId,'')),'') AS insCityName, \n IFNULL((SELECT stateName FROM states WHERE stateId = IFNULL(ins.stateId,'')),'') AS insStateName, \n IFNULL((SELECT countryName FROM countries WHERE countryId = IFNULL(ins.countryId,'')),'') AS insCountryName, \n IFNULL(ins.pin,'') AS insPinCode, IFNULL(ins.employeePhone,'') AS insContactNo, \n IFNULL(ins.instituteEmail,'') AS insEmail, IFNULL(ins.instituteWebsite,'') AS insWebsite,\n \n f.feeReceiptId, CONCAT(IFNULL(s.firstName,''),' ',IFNULL(s.lastName,'')) AS studentName,\n IF(studentGender='M','Mr.','Miss') AS by1, IF(studentGender='M','S/o','D/o') AS by2, \n IF(IFNULL(s.fatherName,'')='','\".NOT_APPLICABLE_STRING.\"',s.fatherName) AS fatherName, \n s.isLeet, IFNULL(s.quotaId,'') AS quotaId, s.rollNo, s.regNo, sp.periodName AS semester, b.branchName,\n f.receiptNo, f.receiptDate, f.feeType, f.totalAmountPaid, f.fine, f.cashAmount, IFNULL(f.feePaid,0) AS feePaid,\n s.studentId, f.feeClassId, f.classId, f.feeCycleId, f.installmentCount, f.favouringBankBranchId,\n f.hostelDues, f.hostelFine, f.hostelConcession, IFNULL(f.hostelPaid,0) AS hostelPaid, \n IFNULL(applHostel,'') AS applHostel, IFNULL(applHostelFine,'') AS applHostelFine,\n f.transportDues, f.transportFine, f.transportConcession, IFNULL(f.transportPaid,0) AS transportPaid,\n IFNULL(applTransport,'') AS applTransport, IFNULL(applTransportFine,'') AS applTransportFine\n FROM \n institute ins, student s, `fee_receipt` f, class c, study_period sp, branch b\n WHERE\n c.instituteId = ins.instituteId AND \n s.studentId = f.studentId AND\n c.classId = f.feeClassId AND\n sp.studyPeriodId = c.studyPeriodId AND\n b.branchId = c.branchId\n $condition \";\n \n return $systemDatabaseManager->executeQuery($query,\"Query: $query\");\n }",
"function getProductReviews($invId){\n $db = acmeConnect();\n\n $sql = 'SELECT reviewId, reviewText, reviewDate, clients.clientFirstname FROM reviews JOIN clients ON clients.clientID = reviews.clientId WHERE invId = :invId ORDER BY reviews.reviewDate DESC';\n\n//$sql = 'SELECT imgId, imgPath, imgName, imgDate, inventory.invId, invName FROM images JOIN inventory ON images.invId = inventory.invId';\n\n $stmt = $db->prepare($sql);\n $stmt->bindParam(':invId', $invId, PDO::PARAM_INT);\n $stmt->execute();\n $clientData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n //var_dump($clientData);\n //exit;\n\n return $clientData;\n}",
"public function index()\n { \n $user = Auth::user();\n $receipts = DB::table('receipts as rcp')\n ->join('purchase_orders as po', 'rcp.purchase_order_id', '=', 'po.id')\n ->join('purchase_requests as pr', 'po.purchase_request_id', '=', 'pr.id')\n ->join('suppliers as supp', 'pr.supplier_id', '=', 'supp.id')\n ->join('users as u', 'pr.approved_by', '=', 'u.id')\n ->join('roles as r', 'u.role', '=', 'r.role_id')\n ->select('rcp.id as id',\n 'rcp.invoice_date as invoice_date',\n 'rcp.due_date as due_date',\n 'po.id as delivery_order_id',\n 'pr.id as sales_order_id',\n 'pr.supplier_id as supplier_id',\n 'pr.invoice_number as invoice_number',\n 'pr.order_date as pr_date',\n 'pr.discount as discount',\n 'pr.down_payment as down_payment',\n 'pr.ppn as ppn',\n 'pr.total as total',\n 'pr.attachment_url as attachment_url',\n 'pr.account_id as account_id',\n 'pr.is_approved as is_so_approved',\n 'pr.approved_by as so_approved_by',\n 'po.delivery_date as po_date',\n 'po.is_approved as is_po_approved',\n 'po.approved_by as po_approved_by',\n 'supp.email as supplier_email',\n 'u.name as approved_by',\n 'r.name as role'\n )\n ->where('po.company_id', '=', $user->business->id)\n ->where('rcp.is_approved', '=', false)\n\n ->get();\n\n return view('receipt.index', compact('receipts'));\n }",
"function listApprovalDetailTotalDataBase($parameters = array()) {\n global $db, $db_table_prefix, $db_name, $loggedInUser;\n \n $data = array();\n\n $sql = \"\";\n $sql = \" \n SELECT ap.id as detail_id, \n ap.approval_m, \n ap.description detail_description,\n (SELECT name FROM admin WHERE id=ap.editor_id) as name_edit,\n CONVERT(VARCHAR(19), ap.edit_date, 100) edit_date,\n am.approved_by,\n (SELECT name FROM admin WHERE id=am.approved_by) as name_aprovade,\n CONVERT(VARCHAR(19), am.approval_date, 100) aprov_date\n FROM \n [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_d] ap\n INNER JOIN [\".$db_name.\"].[dbo].[\".$db_table_prefix.\"approval_m] am ON\n am.id= ap.approval_m\n WHERE\n ap.approval_m IN( \".$db->sql_escape($parameters['ids']).\" )\";\n \n\n\n $result = $db->sql_query($sql);\n $result= $db->sql_fetchrowset($result);\n\n\n $data[\"result\"] = $result;\n\n \n\n \n return $data;\n}",
"function getReview($reviewId){\n $db = acmeConnect();\n $sql = 'SELECT reviewText, reviewDate, reviews.invId, invName FROM reviews JOIN inventory ON inventory.invId = reviews.invId WHERE reviewId = :reviewId';\n $stmt = $db->prepare($sql);\n $stmt->bindParam(':reviewId', $reviewId, PDO::PARAM_INT);\n $stmt->execute();\n $clientData = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $clientData;\n}",
"function get_self_review_detail($req, $con){\r\n\r\n\t$user_id = $_REQUEST['user_id'];\r\n\t$review_id=$_REQUEST['review_id'];\r\n\r\n\tif($user_id != '')\r\n\t{ \r\n\t\t$res = mysqli_query($con,\"SELECT a.*, b.profile_image , b.user_name FROM `athlete_self_review` a left JOIN `athlete_users` b on a.user_id = b.user_id WHERE a.user_id='$user_id' and a.id='$review_id' \") ;\r\n\t\t$i=0;\r\n\t\twhile($row = mysqli_fetch_array($res)) \r\n\t\t{\r\n//$review_sys;\r\n//$sub = $row['subject'];\r\n\t\t\t$alldata[$i]['id'] = $row['id'];\r\n\t\t\t$alldata[$i]['profile_image'] = $row['profile_image'];\r\n\t\t\t$alldata[$i]['user_name'] = $row['user_name'];\r\n\t\t\t$alldata[$i]['comment'] = $row['comments'];\r\n\t\t\t$alldata[$i]['label'] = $row['label'];\r\n\t\t\t$alldata[$i]['date'] = $row['date_time'];\r\n\r\n\t\t\t$alldata[$i]['strengths'] = $row['strengths'];\r\n\t\t\t$alldata[$i]['improvements_needed'] = $row['improvements_needed'];\r\n\t\t\t$alldata[$i]['suggestions'] = $row['suggestions'];\r\n\t\t\t$alldata[$i]['assistance_requested'] = $row['assistance_requested'];\r\n//echo \"SELECT * from `athlete_school_review_details` WHERE review_id=\".$row['id'];\r\n\t\t\t$res1 = mysqli_query($con,\"SELECT * from `athlete_self_review_details` WHERE review_id=\".$row['id'].\" \") ;\r\n\t\t\t$j=0;\r\n\t\t\twhile ($row1 = mysqli_fetch_array($res1))\r\n\t\t\t{\r\n\t\t\t\t$review_sys[$j]['subject'] = $row1['subject'];\r\n\t\t\t\t$review_sys[$j]['subject_id'] = $row1['id'];\r\n\t\t\t\t$review_sys[$j]['grade'] = $row1['grade'];\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\r\n\t\t\t$alldata[$i]['review'] = $review_sys;\r\n\t\t\tunset($review_sys);\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tif ($alldata) \r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '1', \"message\"=>'Message List', \"data\" => $alldata);\r\n\t\t\techo json_encode($empt1);\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '0', \"message\" => 'Data Not Found');\r\n\t\t\techo json_encode($empt1);\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$data['success'] = \"0\";\r\n\t\t$data['message'] = \"Please enter all required fields.\";\r\n\t\techo json_encode($data);\r\n\t}\r\n}",
"function fetch_receipt_list(){\n \t\t$this->db->select('customer.NAME, customer.ACCOUNT_NO, reciepts.DATE_CREATED, reciepts.RECIEPT_NUMBER, reciepts.BATCH, reciepts.RECIEPT_TYPE');\n \t\t$this->db->from('reciepts');\n \t\t$this->db->join('customer', 'reciepts.ACCOUNT_NUMBER=customer.ACCOUNT_NO', 'left');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}",
"public function get_review()\r\n {\r\n $value=$this->db->select('tab_1.id,tab_1.rating,tab_1.review,tab_1.created')->\r\n select('tab_2.name as user_name,tab_2.profile_img as user_image,tab_3.name as provider_name,tab_3.profile_img as provider_image,tab_4.service_title,tab_5.name as type_name')->\r\n from('rating_review tab_1')->\r\n join(\"users tab_2\",\"tab_1.user_id=tab_2.id\",\"LEFT\")->\r\n join(\"providers tab_3\",\"tab_1.provider_id=tab_3.id\",\"LEFT\")->\r\n join(\"services tab_4\",\"tab_1.service_id=tab_4.id\",\"LEFT\")->\r\n join(\"rating_type tab_5\",\"tab_1.type=tab_5.id\",\"LEFT\")->\r\n where('tab_1.status',1)->\r\n order_by('tab_1.id','DESC')->\r\n get()->result_array();\r\n return $value;\r\n\r\n\r\n \r\n }",
"function getReviewsByVehicle($invId){\n $db = phpmotorsConnect();\n $sql = 'SELECT \n reviews.*, clients.clientFirstname, clients.clientLastname, clients.clientId\n FROM\n reviews, clients\n WHERE \n reviews.invId = :invId\n AND\n\t reviews.clientId = clients.clientId\n ORDER BY reviews.reviewDate DESC;';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':invId', $invId, PDO::PARAM_STR);\n $stmt->execute();\n $invInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $invInfo;\n}",
"function get_school_review_detail($req, $con){\r\n\r\n\t$user_id = $_REQUEST['user_id'];\r\n\t$review_id=$_REQUEST['review_id'];\r\n\r\n\tif($user_id != '')\r\n\t{ \r\n\t\t$res = mysqli_query($con,\"SELECT a.*, b.profile_image , b.user_name FROM `athlete_school_review` a left JOIN `athlete_users` b on a.user_id = b.user_id WHERE a.user_id='$user_id' and a.id='$review_id' \") ;\r\n\t\t$i=0;\r\n\t\twhile($row = mysqli_fetch_array($res)) \r\n\t\t{ \r\n//$review_sys;\r\n//$sub = $row['subject'];\r\n\t\t\t$alldata[$i]['id'] = $row['id'];\r\n\t\t\t$alldata[$i]['profile_image'] = $row['profile_image'];\r\n\t\t\t$alldata[$i]['user_name'] = $row['user_name'];\r\n\t\t\t$alldata[$i]['comment'] = $row['comments'];\r\n\t\t\t$tach_id = $row['teacher_id'];\r\n\t\t\t$teacher_name=get_user_name($tach_id);\r\n\t\t\t$alldata[$i]['teacher_name'] = $teacher_name;\r\n\t\t\t$alldata[$i]['date'] = $row['date_time'];\r\n\r\n\t\t\t$alldata[$i]['strengths'] = $row['strengths'];\r\n\t\t\t$alldata[$i]['improvements_needed'] = $row['improvements_needed'];\r\n\t\t\t$alldata[$i]['suggestions'] = $row['suggestions'];\r\n\t\t\t$alldata[$i]['assistance_requested'] = $row['assistance_requested'];\r\n\t\t\t$alldata[$i]['qualification'] = $row['qualification'];\r\n\r\n//echo \"SELECT * from `athlete_school_review_details` WHERE review_id=\".$row['id'];\r\n\t\t\t$res1 = mysqli_query($con,\"SELECT * from `athlete_school_review_details` WHERE review_id=\".$row['id'].\" \") ;\r\n\t\t\t$j=0;\r\n\t\t\twhile ($row1 = mysqli_fetch_array($res1))\r\n\t\t\t{\r\n\t\t\t\t$review_sys[$j]['subject'] = $row1['subject'];\r\n\t\t\t\t$review_sys[$j]['subject_id'] = $row1['id'];\r\n\t\t\t\t$review_sys[$j]['grade'] = $row1['grade'];\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\r\n\t\t\t$alldata[$i]['review'] = $review_sys;\r\n\t\t\tunset($review_sys);\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\tif ($alldata) \r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '1', \"message\"=>'Message List', \"data\" => $alldata);\r\n\t\t\techo json_encode($empt1);\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$empt1 = array(\"res\" => '0', \"message\" => 'Data Not Found');\r\n\t\t\techo json_encode($empt1);\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$data['success'] = \"0\";\r\n\t\t$data['message'] = \"Please enter all required fields.\";\r\n\t\techo json_encode($data);\r\n\t}\r\n}",
"function GetBaiscInfo()\r\n {\r\n $sql = <<<eof\r\n select company_id,\r\n dept_seq_no,\r\n dept_id,\r\n dept_name,\r\n emp_seq_no,\r\n emp_id,\r\n emp_name,\r\n name_en,\r\n decode(sex,'M','男','F','女') as sex,\r\n sex as sex_code,\r\n birthday,\r\n nationality_id,\r\n nationality,\r\n nations,\r\n birthplace,\r\n title_id,\r\n title_name,\r\n emp_type_id,\r\n emp_type_name,\r\n title_grade,\r\n salary_level,\r\n is_foreigner,\r\n cellphone_no,\r\n home_tel,\r\n extension,\r\n permanent_address,\r\n address_contactor,\r\n postcode,\r\n mail_address,\r\n mail_postcode,\r\n mail_contactor,\r\n emergency_contractor,\r\n emergency_tel,\r\n e_mail,\r\n hiredate,\r\n id_no,\r\n is_served,\r\n blood_type,\r\n is_marriage,\r\n edu_level,\r\n join_date,\r\n leave_date,\r\n year_sal_startdate,\r\n work_years,\r\n overtime_fee_id,\r\n overtime_fee_name,\r\n absence_fee_id,\r\n absence_fee_name,\r\n year_vacation_id,\r\n year_vacation_name,\r\n salary_type,\r\n brush_card_type,\r\n remark,\r\n emp_status_id,\r\n emp_staus,\r\n bank_account,\r\n bank_id,\r\n bank_account1,\r\n room_no,\r\n factory_zone_id,\r\n factory_zone,\r\n passport,\r\n probation_endate,\r\n residence_permit_no,\r\n privilege_level,\r\n insurance_no,\r\n constellation,\r\n icq,\r\n history_data_id,\r\n is_trainee,\r\n job_id,\r\n job_name,\r\n nonleave_pay_id,\r\n sal_period_id,\r\n sal_period_name,\r\n contract_type_id,\r\n contract_type,\r\n to_formal_date,\r\n salary_ratio,\r\n tax_area,\r\n tax_type_id,\r\n tax_type_name,\r\n pay_welfare,\r\n jobid,\r\n id_type,\r\n permanent_address_contactor,\r\n current_contactor,\r\n emp_archives_loc,\r\n is_insured,\r\n is_reseve_fund,\r\n introductor_emp_id,\r\n introductor_emp_name,\r\n work_address,\r\n phone_no\r\n from ehr_employee_v \r\n where company_id = :companyid\r\n and emp_seq_no = :emp_seqno\r\neof;\r\n //$this->DBConn->debug = true;\r\n $stmt = 'begin pk_erp.P_SET_SEGMENT_NO(:companyid); end;';\r\n $this->DBConn->Execute($stmt,array('companyid'=>$this->companyID));\r\n $this->DBConn->SetFetchMode(ADODB_FETCH_ASSOC);\r\n return $this->DBConn->CacheGetRow(self::DATA_CACHE_SECONDS,$sql,array('companyid'=>$this->companyID,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'emp_seqno'=>$this->empSeqNO));\r\n }",
"function getReviewsByClient($clientId){\n $db = phpmotorsConnect();\n $sql = 'SELECT \n reviews.*, clients.clientFirstname, clients.clientLastname, clients.clientId, inventory.invId, inventory.invMake, inventory.invModel\n FROM\n reviews, clients, inventory\n WHERE \n clients.clientId = :clientId\n AND \n clients.clientId = reviews.clientId\n AND\n reviews.invId = inventory.invId\n ORDER BY reviews.reviewDate DESC;';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_STR);\n $stmt->execute();\n $invInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $invInfo;\n}",
"abstract public function getPaymentDb();",
"function invoiceDetail($user_id) {\n //$query = \"SELECT * FROM `nfw_order_invoice` where id = $style_id and user_id = $user_id\";\n $query = \"SELECT nv.*,no.order_no,no.coupon_id,no.wallet_amount FROM `nfw_order_invoice` as nv join nfw_product_order as no \n on nv.order_id = no.id where nv.user_id = $user_id order by nv.op_date desc,nv.invoice_no desc\";\n $result = resultAssociate($query);\n return $result;\n }",
"public function get_assessment($assessmentID) {\n\t\t$app_id = $this->db\n\t\t\t\t ->select('app_id')\n\t\t\t\t ->from('assessments')\n\t\t\t\t ->where('assessment_id',$assessmentID)\n\t\t\t\t ->get();\n\t\t$app_id = $app_id->result();\n\t\t\n\n\t\t//get application_id (New or Renew)\n\t\t$application_id = $this->db\n\t\t\t\t\t\t ->select('application_id')\n\t\t\t\t\t\t ->from('applications')\n\t\t\t\t\t\t ->where('app_id',$app_id[0]->app_id)\n\t\t\t\t\t\t ->get();\n\t\t$application_id = $application_id->result();\n\n\t\t//get business_nature in business_line table for the business\n\t\t$buss_nature_id = $this->db\n\t\t\t\t\t\t ->select('buss_nature_id')\n\t\t\t\t\t\t ->from('business_line')\n\t\t\t\t\t\t ->where('app_id',$app_id[0]->app_id)\n\t\t\t\t\t\t ->get();\n\t\t$buss_nature_id = $buss_nature_id->result();\n\n \t$assessments = $this->db\n\t\t\t\t\t\t->distinct()\n\t\t\t\t\t\t->select('bn.business_nature, apptype.types application_type,b.payment_id,b.permit_number,b.old_permit_number')\n\t\t\t\t\t\t->select('bar.brgy')\n\t\t\t\t\t\t->select('b.ownership_id,o.firstname, o.middlename, o.lastname, o.house_no_bldg_name,o.o_subdivision_street,o.o_muni,o.o_province, o.contact_number')\n\t\t\t\t\t\t->select('assess.total_tax_due, assess.assessment_id,assess.breakdowns, assess.status, assess.assessment_date,assess.flag_paid_all,assess.tfos,assess.addtltfo')\n\t\t\t\t\t\t->select('a.buss_id, a.owner_id, bl.capital')\n\t\t\t\t\t\t->select('a.application_id, pt.types payment_type')\n\t\t\t\t\t\t->select('p.pay_id,p.count,p.pay_status')\n\t\t\t\t\t\t->from('assessments assess')\n\t\t\t\t\t\t->join('applications a', 'assess.app_id=a.app_id', 'inner')\n\t\t\t\t\t\t->join('business_line bl', 'a.app_id=bl.app_id', 'inner')\n\t\t\t\t\t\t->join('businessess b', 'a.buss_id=b.buss_id', 'inner')\n\t\t\t\t\t\t->join('payment_type pt', 'b.payment_id=pt.payment_id', 'inner')\n\t\t\t\t\t\t->join('business_nature bn', 'bl.buss_nature_id=bn.buss_nature_id', 'inner')\n\t\t\t\t\t\t->join('payments p','assess.assessment_id=p.assessment_id','left')\n\t\t\t\t\t\t/* ->join('required_tfo rtfo', 'bn.buss_nature_id=rtfo.buss_nature_id', 'inner')\n\t\t\t\t\t\t->join('tfo t', 'rtfo.tfo_id=t.tfo_id', 'inner') */\n\t\t\t\t\t\t->join('application_type apptype', 'a.application_id=apptype.application_id', 'inner')\n\t\t\t\t\t\t->join('owners o', 'a.owner_id=o.owner_id', 'inner')\n\t\t\t\t\t\t->join('brgys bar', 'bar.brgy_id=o.brgy_id', 'inner')\n\t\t\t\t\t\t->where(array('assess.assessment_id' =>$assessmentID,\n\t\t\t\t\t\t'bl.buss_nature_id'\t =>$buss_nature_id[0]->buss_nature_id\n\t\t\t\t\t\t))->get();\n \t\t/* ->where(array('assess.assessment_id' =>$assessmentID,\n\t\t\t\t\t\t 'rtfo.application_id' =>$application_id[0]->application_id,\n\t\t\t\t\t\t 'bl.buss_nature_id'\t =>$buss_nature_id[0]->buss_nature_id\n\t\t\t\t ))->get(); */\n\t\t\t//echo $this->db->_error_message();\n\t\t// echo $this->db->last_query();\n \t$tfos = array();\n\t\t$owner = array();\n\t\t$current_date = date('m/d/Y');\n\n \tif($assessments->num_rows() > 0) {\n \t\t$tfo = $assessments->result();\n\t\t\t//print_r($tfo);\n \t\t$i = 0;\n \t\tforeach ($tfo as $item) {\n\t\t\t// print_r($item);\n\t\t\t\t$owner['owner'] = $item->firstname . ' ' . $item->middlename . ' ' . $item->lastname;\n\t\t\t\t$owner['address'] = (($item->house_no_bldg_name == 'N/A') ? ' ' : $item->house_no_bldg_name).' '. (($item->house_no_bldg_name=='N/A') ? ' ' : $item->house_no_bldg_name) .' '.(($item->brgy == 'N/A') ? ' ' : $item->brgy).' '. (($item->o_subdivision_street == 'N/A') ? ' ' : $item->o_subdivision_street) .' ' .(($item->o_muni) ? ' ' : $item->o_muni);\n\t\t\t\t$owner['contact_number'] = $item->contact_number;\n\t\t\t\t$owner['application_type'] = $item->application_type;\n\t\t\t\t$owner['payment_type'] = $item->payment_type;\n\t\t\t\t$owner['business_nature'] = $item->business_nature;\n\t\t\t\t$owner['assessment_id'] = $item->assessment_id;\n\t\t\t\t$owner['buss_id'] = $item->buss_id;\n\t\t\t\t$owner['pay_status'] = $item->pay_status;\t\t\t\t\n\t\t\t\t$owner['owner_id'] = $item->owner_id;\n\t\t\t\t$owner['payment_id'] = $item->payment_id;\n\t\t\t\t$owner['total'] = (float)$item->total_tax_due;\n\t\t\t\t$owner['paid_all'] = $item->flag_paid_all;\n\t\t\t\t$owner['pay_id'] = $item->pay_id;\n\t\t\t\t$owner['permit_number'] = $item->permit_number;\n\t\t\t\t$owner['ownership_id'] = $item->ownership_id;\n\t\t\t\t$owner['breakdowns'] = json_decode($item->breakdowns,true);\n\t\t\t\t$owner['bustax'] = json_decode($item->tfos,true);\n\t\t\t\t$owner['bustax2'] = json_decode($item->addtltfo,true);\n\t\t\t\t$count[] = $item->count;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$owner['count'] = $count;\n\t\t\t return [\n\t\t\t\t'owner' => $owner\n\t\t\t\t\t];\n \t} else {\n \t\treturn false;\n\n \t}\n\t}",
"public function getizin(){\n $this->db->select('*');\n $this->db->from('izin');\n $this->db->join('detail_izin', 'detail_izin.id_detail_izin = izin.id_detail_izin');\n $data = $this->db->get();\n return $data;\n }",
"public function showOpenRentals()\n {\n \n return DB::table('rentalrelation')\n ->join('rental', 'rental.id', '=', 'rentalrelation.RentalID')\n ->join('user', 'user.id', '=', 'rental.User_id')\n ->where('rental.state', 0)\n ->select('rentalrelation.RentalID as Id', 'user.Lastname as Lastname', 'user.Firstname as Firstname', 'user.Email as Email', 'rental.EndDate as EndDate', 'rental.State', 'rental.created_at', 'rental.created_at as Created_at')\n ->groupBy('rental.ID')\n ->get();\n\n }",
"function showAllInvoice()\n\t{\n\t\t\n\t\t\t\t\t$sql=\"select * from \".INFINITE_INVOICE_PRE.\" order by timestamp\";\n\t\t\t\t\t $resultpages= $this->db->query($sql,__FILE__,__LINE__);\n\t\t\t\t\tif($_REQUEST['pg'])\n\t\t\t\t\t{\n\t\t\t\t\t$st= ($_REQUEST['pg'] - 1) * 10;\n\t\t\t\t\t$sql.=\" limit \".$st.\",10 \";\t\n\t\t\t\t\t$x=(($_REQUEST['pg'] - 1)*10)+1;\n\t\t\t\t\t$pgr=$_REQUEST['pg'];\n\t\t\t\t\t}\n\t\t\t\t\tif($_REQUEST['pg'] == '')\n\t\t\t\t\t{\n\t\t\t\t\t$sql.=\" limit 0,10 \";\n\t\t\t\t\t$x=1;\n\t\t\t\t\t$pgr=1;\n\t\t\t\t\t}\t\t\t\n\t\t?>\n \t\t\t\t<div class=\"row-fluid\">\n \t\t\t\t<div class=\"span12\">\n <a class=\"btn btn-danger\" href=\"create_invoice.php\" style=\"float:right;\">Billing</a>\n </div>\n </div>\n <div class=\"span10\">\n <h2> All Invoice Record</h2>\n <hr />\n <table class=\"table table-striped table-bordered dTableR\" >\n <thead>\n <tr>\n <th width=\"9%\">S.No.</th>\n <th width=\"15%\">Invoice No.</th>\n <th width=\"15%\">Invoice Date</th>\n <th width=\"20%\">Client Name</th>\n <th width=\"15%\">Contact No. </th>\n <th width=\"20%\">total Amount</th>\n \n <th>Action</th>\n </tr>\n </thead>\n <tbody>\n <?php\n\t\t\t\t\t\t$result= $this->db->query($sql,__FILE__,__LINE__);\n\t\t\t\t\t\t$cnt = $this->db->num_rows($result);\n\t\t\t\t\t\tif($cnt>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$x=1;\n\t\t\t\t\t\t\twhile($row = $this->db->fetch_array($result))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sql_client = \"select * from \".INFINITE_CLIENT.\" where id='\".$row['client_id'].\"'\";\n\t\t\t\t\t\t\t$record_client = $this->db->query($sql_client,__FILE__,__LINE__);\n\t\t\t\t\t\t\t$row_client = $this->db->fetch_array($record_client);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t?>\t\n <tr>\n <td><?php echo $x;?></td>\n <td><?php echo $row['invoice_id'];?></td>\n <td><?php echo $row['invoice_date'];?></td>\n <td><?php echo $row_client['client_name'];?></td>\n <td><?php echo $row_client['contact'];?></td>\n <td>₹ <?php echo $row['total_due'];?></td>\n <td>\n <a title=\"Print\" href=\"invoice.php?invoiceId=<?php echo $row['id'];?>\" target=\"_blank\"><i class=\"splashy-document_letter_new\"></i></a>\n </td>\n </tr>\n <?php\n\t\t\t\t\t\t\t$i++;\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\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr style=\"height:55px;\">\n\t\t\t\t\t\t\t<td align=\"center\" style=\"font-family:'Comic Sans MS', cursive; font-size:16px; font-weight:600; color:#3B5998;\" colspan=\"7\">Sorry! No Record Found....</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n </tbody>\n </table>\n <div align=\"center\">\n <div class=\"btn-group\">\n\t\t\t<?php\n\t\t\t$numpages= $this->db->num_rows($resultpages);\n\t\t\t//echo $numpages;\n\t\t\t$tmppage = $numpages/10;\n\t\t\t$remndr=$numpages%10;\n\t\t\tif($remndr >= 1)\n\t\t\t{\n\t\t\t\t$t1=explode('.',$tmppage);\n\t\t\t\t$lastpage = $t1[0]+1;\n\t\t\t}\n\t\t\telse\n\t\t\t{ $lastpage = $numpages/10; }\n\t\t\t ?>\n\t\t\t\n\t\t\t\t<a href=\"show_allinvoice.php\" class=\"btn btn-info\">««</a>\n<a href=\"show_allinvoice.php<?php if($pgr >=2 ) {echo '?pg=';echo $pgr-1; } else { echo $pg; }?>\" class=\"btn btn-info\">«</a>\n\t\t\t\t\n\t\t\t\t<?php if($pgr == $lastpage && ($pgr-4) >= 1 ) { ?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr-4;?>\" class=\"btn btn-info\"><?php echo $pgr-4; ?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<?php if($pgr == $lastpage || $pgr == $lastpage-1) { \n\t\t\t\tif(($pgr-3) >= 1){\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr-3;?>\" class=\"btn btn-info\"><?php echo $pgr-3; ?></a>\n\t\t\t\t<?php } }?>\n\t\t\t\t\n\t\t\t\t<?php $temp0=$pgr-2;\n\t\t\t\t\tif($temp0 >= 1) {\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr-2;?>\" class=\"btn btn-info\"><?php echo $pgr-2;?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<?php $temp1=$pgr-1;\n\t\t\t\t\tif($temp1 >= 1) {\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr-1;?>\" class=\"btn btn-info\"><?php echo $pgr-1;?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php if($pgr !='') {echo $pgr;} else { echo 1; }?>\" class=\"btn btn-info active\"><?php if($pgr !='') {echo $pgr;} else { echo 1; }?></a>\n\t\t\t\t\n\t\t\t\t<?php $temp2=$pgr+1;\n\t\t\t\t\tif($temp2 <= $lastpage) {\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr+1;?>\" class=\"btn btn-info\"><?php echo $pgr+1;?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php $temp3=$pgr+2;\n\t\t\t\t\tif($temp3 <= $lastpage) {\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr+2;?>\" class=\"btn btn-info\"><?php echo $pgr+2;?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<?php if($pgr == 1 || $pgr == 2) { \n\t\t\t\tif(($pgr+3) <= $lastpage) {\n\t\t\t\t?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr+3;?>\" class=\"btn btn-info\"><?php echo $pgr+3; ?></a>\n\t\t\t\t<?php } }?>\n\t\t\t\t\n\t\t\t\t<?php if($pgr == 1 && ($pgr+4) <= $lastpage) { ?>\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr+4;?>\" class=\"btn btn-info\"><?php echo $pgr+4; ?></a>\n\t\t\t\t<?php } ?>\n\t\t\t\t\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $pgr+1;?>\" class=\"btn btn-info\">»</a>\n\t\t\t\t\n\t\t\t\t<a href=\"show_allinvoice.php?pg=<?php echo $lastpage;?>\" class=\"btn btn-info\">»»</a>\n\t\t\t</div>\n </div>\n <div align=\"right\">Total Pages - <?php echo $lastpage;?></div>\n\t\t\t<div align=\"right\">Total Records - <?php echo $numpages;?></div>\n \n </div>\n \n <?php\n\t\t\n\t\n\t}",
"function printInvoicePaymentsReport() {\n\tglobal $ftsdb;\n\n\t// Prep our IN clause data\n\t$preparedInClause = $ftsdb->prepareInClauseVariable( getMyClientIDs() );\n\t$selectBindData = $preparedInClause['data'];\n\n\t$result = $ftsdb->select( \"`\" . DBTABLEPREFIX . \"invoices_payments` ipa LEFT JOIN `\" . DBTABLEPREFIX . \"invoices` i ON ipa.invoice_id = i.id LEFT JOIN `\" . DBTABLEPREFIX . \"clients` c ON i.client_id = c.id\", \"c.id IN (\" . $preparedInClause['binds'] . \") ORDER BY i.status, c.last_name, c.first_name, ipa.datetimestamp\", $selectBindData, 'ipa.*, i.id AS invoiceID, c.first_name, c.last_name' );\n\n\t// Create our new table\n\t$table = new Table( '', '', '', \"table table-striped table-bordered tablesorter\", \"invoicePaymentsReportTable\" );\n\n\t// Create table title\n\t$table->addNewRow( array( array( 'data' => \"Invoice Payments\", \"colspan\" => \"9\" ) ), '', 'title1', 'thead' );\n\n\t// Create column headers\n\t$table->addNewRow(\n\t\tarray(\n\t\t\tarray( 'type' => 'th', 'data' => \"Date\" ),\n\t\t\tarray( 'type' => 'th', 'data' => \"Invoice Number\" ),\n\t\t\tarray( 'type' => 'th', 'data' => \"Client\" ),\n\t\t\tarray( 'type' => 'th', 'data' => \"Payment Type\" ),\n\t\t\tarray( 'type' => 'th', 'data' => \"Amount Paid\" )\n\t\t), \"\", \"title2 noWrap\", \"thead\"\n\t);\n\n\t// Add our data\n\tif ( ! $result ) {\n\t\t$table->addNewRow( array(\n\t\t\tarray(\n\t\t\t\t'data' => \"There are no payments in the system.\",\n\t\t\t\t\"colspan\" => \"9\"\n\t\t\t)\n\t\t), \"invoicePaymentsReportTableDefaultRow\", \"greenRow\" );\n\t} else {\n\t\tforeach ( $result as $row ) {\n\t\t\t$table->addNewRow( array(\n\t\t\t\tarray( 'data' => makeShortDateTime( $row['datetimestamp'] ) ),\n\t\t\t\tarray( 'data' => $row['invoiceID'] ),\n\t\t\t\tarray( 'data' => $row['last_name'] . \", \" . $row['first_name'] ),\n\t\t\t\tarray( 'data' => printInvoicePaymentType( $row['type'] ) ),\n\t\t\t\tarray( 'data' => formatCurrency( $row['paid'] ) )\n\t\t\t), \"\", \"noWrap\" );\n\t\t}\n\t\t$result = null;\n\t}\n\n\t// Return the table's HTML\n\treturn $table->returnTableHTML();\n}",
"public function readRatings() {\r\n $query =\r\n 'SELECT *\r\n FROM product_reviews pr\r\n JOIN products p\r\n ON pr.movie_id = p.movie_id\r\n ORDER BY pr.movie_id';\r\n\r\n $stmt = $this->conn->prepare($query);\r\n\r\n $stmt->execute();\r\n\r\n return $stmt;\r\n }",
"function get_arrests()\n {\n global $conn;\n //query the database to select all data from the qp_arrest_warrant table and some data from qp_poi and qp_station by status arrest (1)\n $sql = 'SELECT qp_arrest_warrant.*, qp_poi.firstName AS poiFirstName, qp_poi.lastName AS poiLastName, qp_station.name AS stationName FROM qp_arrest_warrant INNER JOIN qp_poi USING (poiID) INNER JOIN qp_station USING (stationID) WHERE status = 1 ORDER BY updatedDate';\n //use a prepared statement to enhance security\n $statement = $conn->prepare($sql);\n $statement->execute();\n $result = $statement->fetchAll();\n $statement->closeCursor();\n return $result;\n }",
"public function query($payment);",
"public function showAllRentals()\n {\n \n $borrower = DB::table('rentalrelation')\n ->join('rental', 'rental.id', '=', 'rentalrelation.RentalID')\n ->join('user', 'user.id', '=', 'rental.User_id')\n ->select('rentalrelation.RentalID as Id', 'user.Lastname as Lastname', 'user.Firstname as Firstname', 'user.Email as Email', 'rental.EndDate as EndDate', 'rental.State', 'rental.created_at', 'rental.created_at as Created_at')\n ->groupBy('rentalrelation.RentalID')\n ->get();\n\n\n return $borrower;\n }",
"function select(){\n\treturn 'SELECT r.record_id, p.full_name, \n\t\td.full_name as doctor_name, f.full_name as radiologist_name, r.test_type, r.prescribing_date,\n\t\tr.test_date, r.diagnosis, r.description\n\t\tFROM radiology_record r, persons p, persons d, persons f\n\t\tWHERE r.patient_id = p.person_id AND r.doctor_id = d.person_id\n\t\tAND r.radiologist_id = f.person_id' ;\n}"
] | [
"0.66456145",
"0.57928854",
"0.57867783",
"0.5466915",
"0.545189",
"0.53516537",
"0.53364015",
"0.5332094",
"0.5292001",
"0.52744967",
"0.52604204",
"0.5243716",
"0.5240197",
"0.52374667",
"0.52318096",
"0.51961946",
"0.5180202",
"0.5152683",
"0.51138645",
"0.51020783",
"0.5096159",
"0.5095013",
"0.50930357",
"0.50763446",
"0.5073464",
"0.5047585",
"0.5042333",
"0.5034448",
"0.50137323",
"0.5005839"
] | 0.59258175 | 1 |
Connects the UDP socket to the host with the given IP address and port number | public function connect(InetAddress $ipAddress, $portNumber)
{
$this->ipAddress = $ipAddress;
$this->portNumber = $portNumber;
if($this->socketsEnabled)
{
if(!$this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP))
{
$errorCode = socket_last_error($this->socket);
throw new Exception("Could not create socket: " . socket_strerror($errorCode));
}
if(@!socket_connect($this->socket, $ipAddress, $portNumber))
{
$errorCode = socket_last_error($this->socket);
throw new Exception("Could not connect socket: " . socket_strerror($errorCode));
}
if($this->isBlocking)
{
socket_set_block($this->socket);
}
else
{
socket_set_nonblock($this->socket);
}
}
else
{
if(!$this->socket = fsockopen("udp://$ipAddress", $portNumber, $socketErrno, $socketErrstr, 2))
{
throw new Exception("Could not create socket: $socketErrstr");
}
stream_set_blocking($this->socket, $this->isBlocking);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function connect()\r\n {\r\n $errnum = null;\r\n\r\n $errstr = null;\r\n\r\n $this->socket = fsockopen($this->hostAddress, $this->portNumber, $errnum, $errstr, $this->timeout);\r\n }",
"function sendUDPdata($data, $ip, $port)\n{\n if ($socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP)) {\n socket_sendto($socket, $data, strlen($data), 0, $ip, $port);\n socket_close($socket);\n } else {\n print('Error');\n }\n}",
"function _connectsocket($ip, $port, $proto='udp') {\r\n\tif ($this->DEBUG) print \"DEBUG: Opening socket to $ip:$port >>>\\n\";\r\n\t$this->sock = @fsockopen(\"$proto://$ip\", $port, $this->errno, $this->errstr);\r\n\t$this->_set_timeout($this->conf['timeout']);\r\n\treturn $this->sock;\r\n}",
"function &createUdpConnection($address, $port)\n {\n require_once SYSTEM_SOCKET_ROOT . '/Socket/Connection.php';\n\n $sock = &new System_Socket;\n $sock->type = SOCK_DGRAM;\n $sock->proto = SOL_UDP;\n $sock->address = $address;\n $sock->port = $port;\n\n if ($sock->create() && $sock->connect()) {\n return new System_Socket_Connection($sock);\n }\n\n return System_Socket::lastError();\n }",
"public function connect($ip, $port)\n {\n if(($result = socket_connect($this->socket, $ip, $port)) === false)\n {\n throw new Exception(socket_strerror(socket_last_error()));\n }\n\n if(($bytes = socket_recv($this->socket, $four, 4, MSG_WAITALL)) === false)\n {\n throw new Exception(socket_strerror(socket_last_error()));\n }\n\n if(($bytes = socket_recv($this->socket, $protocol, 11, MSG_WAITALL)) === false)\n {\n throw new Exception(socket_strerror(socket_last_error()));\n }\n\n if($protocol != \"GBXRemote 2\")\n {\n throw new Exception(\"Unsupported protocol: \".$protocol);\n }\n\n return true;\n }",
"private function connect() {\n if (!$this->isConnected) {\n $this->clientSocket = @stream_socket_client(\"tcp://\".$this->hostname.\":\".$this->port, $errno, $msg, 5);\n }\n if ($this->clientSocket === false)\n $this->isConnected = false;\n else\n $this->isConnected = true;\n }",
"function connect() {\n $this->state = 'connecting';\n\n if ($this->ipv == 4) {\n $this->sock = $this->pSockets->createTCP($this, 'handleRead', 'handleError', 1, 'handleConnected', 1, $this->bind);\n } else {\n $this->sock = $this->pSockets->createTCPv6($this, 'handleRead', 'handleError', 1, 'handleConnected', 1, $this->bind);\n }\n\n if (!$this->sock) {\n die(\"IRC Couldn't create socket\");\n }\n\n //TODO Make this config variable\n $this->pSockets->setReconTime($this->sock, 65);\n\n $a = $this->pSockets->getOurAddr($this->sock);\n $p = $this->pSockets->getOurPort($this->sock);\n\n echo \"IRC Local IP/PORT: $a/$p\\n\";\n echo \"IRC Connecting to Host: $this->server Port: $this->port IPv$this->ipv\\n\";\n\n if (!$this->pSockets->connect($this->sock, $this->server, $this->port, $this->timeout)) {\n list($errno, $errstr) = $this->pSockets->getLastErr($this->sock);\n echo \"IRC Error connecting [$errno] $errstr (ignoring)\\n\";\n }\n\n $this->pSockets->setRTO($this->RTO, $this->sock);\n }",
"public function connect($hostname = [], $port = 389);",
"public function connect($host, $port = NULL, $timeout = NULL) {\n\n }",
"public function connect()\n {\n $options = $this->getOptions();\n $request = new TCPRequest($options->host, $options->port, $options->secure);\n\n if ($this->getTransport()\n ->connect($request)) {\n Logger::log(LogLevel::DEBUG, 'Connected to {host}:{port}',\n ['host' => $options->host, 'port' => $options->port]);\n\n $this->setConnected(true);\n } else {\n Logger::log(LogLevel::DEBUG, 'Could not connect to {host}:{port}',\n ['host' => $options->host, 'port' => $options->port]);\n\n $this->setConnected(false);\n }\n }",
"private function connectSocket(){\n\t\t/* Create a TCP/IP socket. */\n\t\t$this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\t\tif ($this->socket === false) {\n\t\t\t//echo \"[CLIENT] socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n\t\t\treturn;\n\t\t}\n\t\t$result = socket_connect($this->socket, $this->address, $this->serviceport);\n\t\tif ($result === false) {\n\t\t\treturn;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\t\n\t}",
"public function connect($serveraddr, $username, $password);",
"public function connect()\n { \n if ($this->_handle) { \n return;\n }\n \n $this->_handle = fsockopen($this->_protocol . '://' . $this->_host, $this->_port);\n\n if (!$this->_handle) {\n throw new \\Exception(\"Unable to open connetion\");\n }\n }",
"public function connect(): void\n {\n $this->getSocket();\n }",
"public function pconnect($host, $port = NULL, $timeout = NULL) {\n\n }",
"function ngx_connect($fd, $addr, $port)\n{\n return socket_connect($fd,$addr,$port);\n}",
"protected static function sendAsUDP($data) {\n // Wrap this in a try/catch -\n // failures in any of this should be silently ignored\n try {\n $host = static::$host;\n $port = static::$port;\n $fp = fsockopen(\"udp://$host\", $port, $errno, $errstr);\n if (! $fp) { return; }\n // Non-blocking I/O, please.\n stream_set_blocking($fp, 0);\n fwrite($fp, $data);\n fclose($fp);\n } catch (Exception $e) {\n }\n }",
"public function connect() {\r\n $this->socket->event->addEvent(\"connect\",function($socket,$uid) {\r\n $socket->event->emitMessage('connect',$uid);\r\n });\r\n }",
"function connect() {\n try {\n $this->client = stream_socket_client(\"tcp://\" . \\common\\Config::$cfg['db']['akumuli']['host'] . \":\" . \\common\\Config::$cfg['db']['akumuli']['port'], $errno, $errmsg);\n\n if ($this->client === false) throw new \\Exception(\"Failed to connect to Akumuli: \" . $errmsg);\n\n } catch (\\Exception $e) {\n $this->d->dpr($e);\n }\n }",
"public function connect()\n {\n $this->fileDescriptor = @fsockopen(\n $this->parameters['server_host'],\n $this->parameters['server_port']\n );\n\n if (false === $this->fileDescriptor) {\n $this->output->manageMessageOfGivenLogLevel('Error: Could not connect to the NetSoul server', Logger::CRITICAL);\n die();\n }\n\n $rawResponse = fgets($this->fileDescriptor);\n $this->output->manageMessageOfGivenLogLevel('Server: '.$rawResponse, Logger::INFO);\n\n $this->connectionResponse = new ConnectionResponse();\n $this->connectionResponse->setAttributesFromRawResponse($rawResponse);\n }",
"public function setAddress($host, $port);",
"private function connect()\n {\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n\n if (!socket_connect($this->socket, $this->host, $this->port)) {\n return false;\n }\n\n return true;\n }",
"public function connect($host, $port, $user, $password, $db, $new_link = false);",
"public function connect(string $address, int $port = 0): bool\n {\n return static::exceptionOnFalse(\n $this->resource,\n static function ($resource) use ($address, $port) {\n return @socket_connect($resource, $address, $port);\n }\n );\n }",
"public function connect($room = null, $host = null, $port = null)\n {\n if (is_null($room)) {\n $room = Configure::read('Room.name');\n }\n $room = Room::getRoomInfo($room);\n\n $array = $this->Room->join($this->Network->loginInfos, $room, $host, $port);\n\n $this->Socket = $array['socket'];\n $this->Network->loginInfos = $array['network'];\n\n $this->ModuleManager->addPrefixArgument($this);\n $this->PacketManager->addPrefixArgument($this);\n\n //Handle the loop.\n $this->_handleWhile();\n }",
"public function connect()\n {\n $this->connection = new AsyncTcpConnection('frame://' . $this->serverIP . ':' . $this->serverPort);\n $this->connection->onClose = function () {\n $this->onRemoteClose();\n };\n $this->connection->onConnect = function () {\n $this->onRemoteConnect();\n };\n $this->connection->onMessage = function ($connection, $data) {\n $this->onRemoteMessage($connection, $data);\n };\n $this->connection->connect();\n }",
"public function __construct() {\r\n // IPv4 Internet based protocols, Supports datagrams, UDP \r\n $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); \r\n socket_set_option($this->socket,SOL_SOCKET,SO_REUSEADDR, 1);\r\n socket_set_option($this->socket, IPPROTO_IP, MCAST_JOIN_GROUP, array('group'=>'224.0.0.251', 'interface'=>0));\r\n socket_set_option($this->socket, SOL_SOCKET,SO_RCVTIMEO,array(\"sec\"=>1,\"usec\"=>0));\r\n $bind = socket_bind($this->socket, \"0.0.0.0\", 5353);\r\n }",
"public function connect()\n {\n try {\n return socket_connect($this->resource, $this->address, $this->port);\n } catch (SocketException $e) {\n return false;\n }\n }",
"public function __construct($address = \"10.0.1.182\", $port = 5001)\n {\n\n print \" Iniciando socket ... \";\n\n // criamos o server SOCKET, utilizando os parametros:\n // AF_INET :: IPv4 para TCP\n // SOCK_STREAM :: conexao sequencial baseda em \"byte streams\"\n // SOL_TCP :: Protocolo TCP\n if (($this->_socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n $code = socket_last_error($this->_socket);\n exit (sprintf(\"Falha ao conectar: %s (%s)\", socket_strerror($code), $code));\n }\n\n print \" feito \\n\";\n\n socket_set_option($this->_socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n printf(\" Escutando em %s:%s ... \", $address, $port);\n\n // passando os dados que iremos escutar nosso socket\n if (socket_bind($this->_socket, $address, $port) === false) {\n $code = socket_last_error($this->_socket);\n exit (sprintf(\"erro ao escutar em %s:%s: %s (%s)\", $address, $port, socket_strerror($code), $code));\n }\n\n print \" feito \\n\";\n\n // aguardamos por escuta\n if (socket_listen($this->_socket) === false) {\n $code = socket_last_error($this->_socket);\n exit (sprintf(\"erro ao escutar em %s:%s: %s (%s)\", $address, $port, socket_strerror($code), $code));\n }\n\n // adiciona esta Conexao a lista de sockets\n $this->_sockets = array($this->_socket);\n\n // XXX FIXME :: Quick Fix para correcao Bug no php menor que 5.3\n // https://bugs.php.net/bug.php?id=48326\n if (!defined('MSG_DONTWAIT')) {\n define('MSG_DONTWAIT', 0x40);\n return 1;\n }\n }",
"public function connect($host, $port, $dbName, $username, $password) {\n\t\tself::$conn = new PDO(\"mysql:host={$host};dbname={$dbName};port:{$port}\", $username, $password);\n\t}"
] | [
"0.6714141",
"0.6288565",
"0.62117875",
"0.6067139",
"0.6028532",
"0.59814006",
"0.59412575",
"0.58939576",
"0.58784837",
"0.5855604",
"0.58089715",
"0.56773096",
"0.56601936",
"0.5522857",
"0.5492548",
"0.54910135",
"0.5460146",
"0.5446896",
"0.54446685",
"0.5429168",
"0.5414024",
"0.5354768",
"0.5329194",
"0.5326304",
"0.5311222",
"0.52923685",
"0.52866477",
"0.5267728",
"0.5234238",
"0.52181786"
] | 0.66419184 | 1 |
Object initialization done by slot. | protected final function slotInit()
{
// nothing to do here
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _init(){}",
"public function initializeObject()\n {\n }",
"public function __construct() {\n\t\t$this->registerSlots();\n\t}",
"public function initializeObject() {\n\t}",
"public function init(){}",
"public function init(){}",
"public function init(){}",
"public function init() {}",
"public function init() {}",
"public function init() {}",
"public function init() {}",
"public function init() {}",
"abstract public function init();",
"abstract public function init();",
"abstract public function init();",
"abstract public function init();",
"abstract public function init();",
"abstract public function init();",
"public function init ()\n {}",
"public function init()\n {}",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"abstract protected function init();",
"protected abstract function init();",
"protected abstract function init();",
"public function init() { }",
"public function init() { }",
"public function init() { }"
] | [
"0.75294316",
"0.75204986",
"0.7518372",
"0.75150806",
"0.7487102",
"0.7487102",
"0.7487102",
"0.74814475",
"0.74814475",
"0.74814475",
"0.74814475",
"0.74814475",
"0.7477506",
"0.7477506",
"0.7477506",
"0.7477506",
"0.7477506",
"0.7477506",
"0.7421396",
"0.7410818",
"0.73904836",
"0.73904836",
"0.73904836",
"0.73904836",
"0.73904836",
"0.7378184",
"0.7378184",
"0.73484623",
"0.73484623",
"0.73484623"
] | 0.78847504 | 1 |
Receive a count of all marketing events | public function count()
{
$endpoint = 'marketing_events/count.json';
$response = $this->request($endpoint);
return $response['count'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tsml_count_meetings() {\n\treturn count(tsml_get_all_meetings('publish'));\n}",
"public function count()\n {\n return count($this->events);\n }",
"public function count()\n {\n return count($this->_events);\n }",
"public function count(): int\n {\n return count($this->events);\n }",
"public function count()\n\t{\n return count($this->_events);\n }",
"public function getEventsCount()\n {\n return $this->count(self::EVENTS);\n }",
"function fetchNewsletterBounceCount()\n {\n return array( 'result' => eZBounce::count() );\n }",
"function allevent_count()\n { \n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from(DB_PREFIX.'events');\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}",
"public static function update_total_email_sent_count() {\n\n\t\t$current_date = ig_es_get_current_date();\n\t\t$current_hour = ig_es_get_current_hour();\n\n\t\t$email_sent_data_option = 'email_sent_data';\n\n\t\t//Get total emails sent in this hour\n\t\t$email_sent_data = ES_Common::get_ig_option( $email_sent_data_option, array() );\n\n\t\t$total_emails_sent = 0;\n\t\t$data = array();\n\t\tif ( is_array( $email_sent_data ) && ! empty( $email_sent_data[ $current_date ] ) && ! empty( $email_sent_data[ $current_date ][ $current_hour ] ) ) {\n\t\t\t$total_emails_sent = $email_sent_data[ $current_date ][ $current_hour ];\n\t\t}\n\n\t\t$total_emails_sent += 1;\n\t\t// We want to store only current hour data.\n\t\t$data[ $current_date ][ $current_hour ] = $total_emails_sent;\n\n\t\tES_Common::set_ig_option( $email_sent_data_option, $data );\n\n\t}",
"public function getEventMemberCount() {\n return($this->eventMemberCount);\n }",
"public function getAttendingCountAttribute(): int\n {\n $responses = $this->eventResponses()->get();\n $responses->filter(function ($e) {\n return 'Attending' === $e->responseType->name;\n });\n\n return \\count($responses);\n }",
"public function consumerCount();",
"public function getNumEventsAttend($id)\n\t{\n\t\t$sum = 0;\n\t\t$events = ProgReport::getList(\"org_id = $id\");\n\t\t\n\t\tforeach( $events as $event)\n\t\t{\n\t\t\tif($event->getSpon() == 0)\n\t\t\t{\n\t\t\t\t$sum++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $sum;\n\t\t\n\t}",
"private function getPendingEventNum() {\n // get pending message\n return Event::where('published', '=', '0')\n ->where('pushed', '=', '0')\n ->count();\n }",
"public function count()\n {\n return count($this->notifications);\n }",
"public static function counterEvents()\n {\n include ($_SERVER[\"DOCUMENT_ROOT\"] . \"/venue/venue-finder/config/db_config.php\");\n $query = \"SELECT COUNT(*) FROM events\";\n $result = mysqli_query($mysqli,$query);\n $rows = mysqli_fetch_row($result);\n\n // Debug increase value.\n $rows[0] = $rows[0] * 1;\n\n // Simplify the number if over 1000.\n if ($rows[0] > 1000) {\n // If over 1000.\n $rows[0] = number_format((float)$rows[0] / 1000, 2, '.', '') . \"K\";\n }\n\n return $rows[0];\n }",
"public function getCount()\n {\n// $query = $this->DbConn->select();\n// $query->from('calendar_event_reminders', array('CNT' => new Zend_Db_Table_Abstract('COUNT(*)')));\n// $query->where('reminder_event_id = ?', $this->getEvent()->getId());\n// $result = $this->DbConn->fetchOne($query);\n// return $result;\n }",
"public static function getNumberEventsOfToday()\n {\n \n // this isn't really optimized but this is the real answer of the question\n $start_date = date(\"Y-m-d \").\" 00:00:00\";\n $end_date = date('Y-m-d H:i:s', strtotime($start_date . ' +1 day'));\n\n // new way to manage events\n // we get the PDO for the Sabre connection from the Propel connection\n $pdo = Propel::getConnection(); \n \n // We set the BackEnd for sabre Backends\n $calendarBackend = new CalDavPDO($pdo->getWrappedConnection());\n $principalBackend = new PrincipalPDO($pdo->getWrappedConnection());\n // get all the calendars for the current user\n \n $calendars = $calendarBackend->getCalendarsForUser('principals/'.strtolower(SessionUser::getUser()->getUserName()),\"displayname\",false);\n \n $count = 0;\n \n foreach ($calendars as $calendar) {\n $eventsForCal = $calendarBackend->getCalendarObjects($calendar['id']);\n \n foreach ($eventsForCal as $eventForCal) {\n \n $calObj = $calendarBackend->getCalendarObject($calendar['id'],$eventForCal['uri']);\n $vcalendar = VObject\\Reader::read($calObj['calendardata']);\n \n // we have to expand the event to get the right events in the range fixed over\n $newVCalendar = $vcalendar->expand(new \\DateTime($start_date), new \\DateTime($end_date));\n $count += count($newVCalendar->VEVENT);\n \n }\n \n }\n\n return $count;\n }",
"public function appointmentsCount()\n {\n $input = Request::all();\n\n if (!isset($input['for']) || !isset($input['users'])) {\n $input['for'] = 'users';\n $input['users'] = (array)\\Auth::id();\n }\n\n if (!isset($input['duration'])) {\n $input['duration'] = 'upcoming';\n }\n\n $input['appointment_counts_only'] = true;\n\n $appointments = $this->repo->getFilteredAppointments($input);\n\n $count = $appointments->count();\n\n return ApiResponse::success(['count' => $count]);\n }",
"public function getActiveEmergencyCount();",
"public static function AllEvents() {return 4;}",
"public function messagesCount();",
"public static function get_events() {\n global $wpdb;\n $full_order_list = array();\n $wpdb->query(\"\n SELECT * FROM {$wpdb->prefix}posts\n WHERE post_type = 'product'\n AND post_title NOT LIKE '%lid%'\n AND post_excerpt NOT LIKE '%lid%'\n AND post_name NOT LIKE '%lid%'\n AND post_content NOT LIKE '%lid%'\");\n $results = $wpdb->last_result;\n foreach ( $results as $result ) {\n $full_order_list[] = array(\n 'ID' => $result->ID,\n 'title' => $result->post_title,\n 'attendees' => self::record_attendees_count($result->ID)\n );\n \n \n }\n \n \n \n usort($full_order_list, 'woocommerce_attendance_usort');\n $wpdb->flush();\n\n if(isset($_POST['s']) && strlen($_POST['s']) > 0) {\n $search = strtolower($_POST['s']);\n\n return array_filter($full_order_list, function ($el) use ($search) {\n $stay = false;\n foreach ( $el as $element ) {\n if ( strpos(strtolower($element), $search) !== false ) {\n $stay = true;\n }\n }\n return $stay;\n });\n }\n if(isset($_POST['attendeeAll']) ) {\n $event = $_POST['attendeeAll'];\n \n /*$attendees = */$wpdb->get_results($wpdb->prepare(\"\n SELECT post_id\n FROM {$wpdb->prefix}postmeta WHERE post_id IN (\n SELECT post_id FROM {$wpdb->prefix}postmeta\n WHERE meta_key = '_product_id'\n AND meta_value = '%s'\n )\n GROUP BY post_id\",\n $event\n ));\n $result = $wpdb->last_result;\n \n $attendees = array();\n foreach($result as $attendee){\n $attendees[] += $attendee->post_id; \n \n }\n //echo $attendees[0];\n \n //echo $attendees->post_id;\n //echo $attendees[0]->post_id. \" \" .$attendees[1]->post_id;\n //$attendees = $wpdb->last_result;\n \n //echo $results[2]->post_title;\n //$attendee = $_GET[''];\n //$attendees $results => $result->ID\n woocommerce_attendance_send_email($event, $attendees, \"All\");\n \n }\n\n\n return $full_order_list;\n }",
"protected function countEvents()\n {\n $eventDispatcher = app()->make('events');\n $reflectionClass = new \\ReflectionClass($eventDispatcher);\n $property = $reflectionClass->getProperty('events');\n $property->setAccessible(true);\n\n // Remove the RequestHandled event\n return collect($property->getValue($eventDispatcher))->reject(function ($value, $key) {\n return $key === 'Illuminate\\Foundation\\Http\\Events\\RequestHandled';\n })->count();\n }",
"public function countAllGroups()\n {\n $CI =& get_instance();\n $venueId = $CI->session->userdata('venue_id');\n\n $this->db->select(\"count(venue_meeting_id) as cnt\");\n $this->db->from($this->table);\n $this->db->where('starting_date_time >=', date('Y-m-d H:i:s'));\n\n if( !empty($venueId) ) {\n $this->db->where('venue_id', $venueId);\n }\n\n $result = $this->db->get()->row();\n\n return empty($result)? 0:(int)$result->cnt;\n }",
"public static function count_total_email_clicks( $args = array() ) {\n\t\t$default = array(\n\t\t\t'event_type' => 'click'\n\t\t);\n\t\t$args = wp_parse_args( $args, $default );\n\t\t$events = self::get_tracking_events( $args );\n\n\t\treturn count( $events );\n\t}",
"function count_all_outbox()\r\n\t{\r\n\t\t$query = $this->db->get('sents_messages');\r\n\t\treturn $query->num_rows();\r\n\t}",
"function getPendingRequestsAndReceivedReferencesCountAction()\n {\n \techo Zend_Json::encode( \\Extended\\reference_request::countReceivedReferenceAndPendingRequests(Auth_UserAdapter::getIdentity()->getId()) );\n \tdie;\n }",
"static function getNotificationsCount(){\n \t$approve_requests = Servicer::where(['status' => 0 ])->count();\n \treturn [ 'approve_requests' => $approve_requests ];\n\n }",
"public function countAdvertisement();"
] | [
"0.6639669",
"0.65377504",
"0.6474724",
"0.6443202",
"0.6423014",
"0.639102",
"0.61056715",
"0.60486037",
"0.60072035",
"0.59925336",
"0.5957481",
"0.59389484",
"0.59046626",
"0.58431613",
"0.5818135",
"0.58029914",
"0.57891023",
"0.57480055",
"0.57413036",
"0.57283574",
"0.5717718",
"0.57066506",
"0.5696745",
"0.5688067",
"0.5684603",
"0.566919",
"0.5647674",
"0.56321996",
"0.56252325",
"0.55936927"
] | 0.71028423 | 0 |
Create a marketing event | public function create(MarketingEvent &$marketingEvent)
{
$data = $marketingEvent->exportData();
$endpoint = 'marketing_events.json';
$response = $this->request(
$endpoint, 'POST', array(
'marketing_event' => $data
)
);
$marketingEvent->setData($response['marketing_event']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createEngagements(MarketingEvent $marketingEvent)\n {\n throw new ShopifySdkException('MarketingEventService::createEngagements() not implemented');\n }",
"public function createEvent($eventCreator,$eventName,$eventDesc,$eventDate,$eventLoc,$noOfInvites,$inviteType,$eventID,$dateOfCreation){\n\t\treturn ($this->qrticketsDAO->insertNewEvent($eventCreator,$eventName,$eventDesc,$eventDate,$eventLoc,$noOfInvites,$inviteType,$eventID,$dateOfCreation));\n\t}",
"public static function createMeeting($meeting, $attendees){\n $meeting_sql_values = [\n 'location' => db::in_quotes($meeting->getLocation()),\n 'title' => db::in_quotes($meeting->getTitle()),\n 'datetime_sched' => db::in_quotes($meeting->getSched()),\n 'person_id' => db::in_quotes($meeting->getOwner())\n ];\n $meeting = db::insert('meeting', $meeting_sql_values);\n\n //Build insert statement for meeting_participant table\n foreach ($attendees as $attendee) {\n $attendee_sql_values = [\n 'meeting_id' => db::in_quotes($meeting->insert_id),\n 'person_id' => db::in_quotes($attendee),\n 'speaking_duration' => db::in_quotes(0),\n 'is_active' => db::in_quotes(0)\n ];\n\n db::insert('meeting_participant', $attendee_sql_values);\n }\n }",
"public function store_event(Request $request)\n {\n // Determine whether this is a request to make the event or feedback form\n $this->validateMeeting();\n $meeting = new Meeting(request(['name', 'meeting_start', 'meeting_end']));\n\n // Store the meeting information in the user's session\n session(compact('meeting'));\n\n // Render form for user to create a feedback form\n return redirect(route('meetings.create_form'));\n }",
"public function createEvent(Request $request)\n {\n $request->validate([\n 'title' => 'required',\n 'details' => 'required',\n 'startdate' => 'required',\n 'enddate' => 'required',\n 'programmeId' => 'exists:programmes,id'\n ]);\n\n $programme = Programme::find($request->programmeId);\n $programme->events()->create([\n 'title' => $request->title,\n 'details' => $request->details,\n 'start_date' => $request->startdate,\n 'end_date' => $request->enddate,\n ]);\n\n Session::flash('success','Event is added to calender');\n return redirect()->back();\n }",
"public function create() : Meeting\n {\n return $this->meeting->forceCreate($this->formatParams());\n }",
"function createAppointment(){\n\n}",
"public function test_it_can_create_an_event() {\n $response = $this->requester->postRequest($this->user, '/events/create', $this->event->toArray());\n $this->assertOkAndHas($response, $this->event);\n }",
"public function create()\n {\n $this->authorize('create-event');\n $event_types = App\\EventType::select('id','name')\n ->get()->toArray();\n\n $statuses = App\\Status::select('id','name')\n ->get()->toArray();\n\n $authorizations = [\"can_update_event\"=>true,\n \"can_show_event\"=>true,\n \"can_create_event\"=>true];\n\n return view('event.manage', [\n 'event'=>json_encode(null),\n 'organization'=>json_encode(null),\n 'team'=>json_encode(null),\n 'statuses'=>json_encode($statuses),\n 'event_types'=>json_encode($event_types),\n 'attachments'=>json_encode(null),\n 'authorizations'=>json_encode($authorizations),\n 'mode'=>'Create'\n ]);\n }",
"public function create(Event $event);",
"public function create($vEvent);",
"public function create(array $params = [])\n {\n /* Defined account is a precondition due to middleware. */\n $account = MiddleAuth::get();\n\n $storeId = self::from('store', self::getBody(), null);\n if ($storeId === null) {\n self::fail(\"A store must be specified.\");\n }\n v::intVal()->min(0)->check($storeId);\n\n /* Check WRITE permissions for store. */\n $store = EStore::queryId($storeId);\n if ($store == null || !$account->getPermissions($store)->canWrite()) {\n self::fail(\"Store is invalid or missing necessary permissions.\", \\HTTP::BAD_PARAMS);\n }\n\n $title = self::from('title', self::getBody(), null);\n if ($title === null) {\n self::fail(\"An event title is required.\");\n }\n\n $title = trim($title);\n /* 100 char limit is schema restriction. */\n v::stringType()->notEmpty()->length(1, 100)->alnum('-\"\\'?_()&%$#@!/\\\\')->check($title);\n\n $maxTime = time() + (\\Brv\\core\\data\\Data::SECONDS_YEAR * 10);\n\n $from = self::from('from_unix', self::getBody(), null);\n if ($from === null) {\n self::fail(\"A from date must be specified.\");\n }\n\n if (!v::intVal()->min(0)->max($maxTime)->validate($from)) {\n self::fail(\"You cannot plan an event that far in advance.\");\n }\n\n $to = self::from('to_unix', self::getBody(), null);\n if ($to == -1) {\n $to = null;\n }\n\n if ($to !== null && !v::intVal()->min($from)->max($maxTime)->validate($to)) {\n self::fail(\"The end date must be after the start date.\");\n }\n\n // Create and return id.\n $event = new EEvent();\n $event->setTitle($title);\n $event->setStoreId($storeId);\n $event->setFrom($from);\n if ($to !== null) {\n $event->setTo($to);\n }\n try {\n $eventId = $event->commit();\n } catch (\\Exception $ex) {\n self::fail(\"Failed to create new event.\");\n }\n\n return new View([\n 'id' => $eventId\n ]);\n }",
"public function create()\n {\n //\n return view('dashboard.event.create');\n }",
"protected abstract function createEvent();",
"public function create()\n\t{\n\t\t$this->layout = null;\n $data = array('error' => true, 'msg' => '');\n\n $event = new EventModel;\n\t\t$event->title = Input::get('eventTitle');\n\t\t$event->from = Carbon::createFromFormat(Lang::get('app.format.date'), Input::get('startTime'));\n\t\t$event->to = Carbon::createFromFormat(Lang::get('app.format.date'), Input::get('endTime'));\n\t\t$event->description = Input::get('description');\n\t\t$event->user_id = Auth::getUser()->id;\n\t\t$event->save();\n\t\t\n\t\t$data['error'] = false;\n\t\t$data['event'] = $event->toArray();\n\n\t\treturn json_encode($data);\n\t}",
"public function create()\n {\n //\n return view('pages.event.create');\n }",
"public function createEvent($token, $calender_id, $summary, $description='', $event_start, $event_end, $time_zone){\n\t\t$url = self::CALENDER_EVENT . '/' . urlencode($calender_id) . '/events';\n\t\t\t\t\n\t\t$data = sprintf('{\n\t\t\t\"summary\": \"%s\",\n\t\t\t\"description\": \"%s\",\n\t\t\t\"start\": {\n\t\t\t\t\"dateTime\": \"%s\",\n\t\t\t\t\"timeZone\": \"%s\"\n\t\t\t },\n\t\t\t\"end\": {\n\t\t\t\t\"dateTime\": \"%s\",\n\t\t\t\t\"timeZone\": \"%s\"\n\t\t\t}\t\t \n\t\t}', $summary, $description, $event_start, $time_zone, $event_end, $time_zone);\n\t\t\n\t\t\t\t\n\t\t\n\t\t$ch = $this->curlPostHandle($url, $token);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($ch);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\tcurl_close($ch);\n\t\t\t\n\t\tif($http_code == 200){\n\t\t\treturn json_decode($response);\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public function create()\n {\n $parse = [\n 'title' => 'Create a new Event'\n ];\n\n return view('admin_pages/event/create', ['parse' => $parse]);\n }",
"public function create()\n {\n return view('Evenements/create_event');\n }",
"function createCalPost($name, $email, $startdate, $enddate, $addinfo) {\n $arg_list = func_get_args();\n foreach($arg_list as $key => $arg){\n $arg_list[$key] = urlencode($arg);\n }\n $postargs = new stdClass();\n $postargs->start = new stdClass();\n $postargs->start->date = $startdate;\n $postargs->end = new stdClass();\n $postargs->end->date = $enddate;\n $postargs->summary = $name;\n $postargs->description = $addinfo;\n // add user email as attendee\n //$postargs->attendees = array(json_decode('{\"email\":\"' . $email . '\",\"optional\":\"true\"}'));\n return json_encode($postargs);\n }",
"function newEvent($start = null, $end = null, $summary = null, $description = null);",
"public function create()\n {\n $newid = 'events';\n\n $test = Null;\n\n \n return view('event.create', compact('test', 'newid'));\n }",
"public static function noteCalendar($task){\n Event::create([\n 'title' => $task->name,\n 'start' => $task->start,\n 'end' => $task->end,\n 'description' => $task->details,\n 'model_id' => $task->assign,\n 'task_id' => $task->id\n ]);\n }",
"public function store(MeetingRequest $request)\n {\n $response = array();\n $meeting = new Meeting();\n $meeting->venue = $request['venue'];\n $meeting->title = $request['title'];\n $meeting->description = $request['description'];\n $meeting->date = $request['date'];\n $meeting->start_time = $request['start_time'];\n $meeting->end_time = $request['end_time'];\n $meeting->created_by = \\Auth::user()->id;\n $meeting->save();\n\n\n $userObj = User::find(\\Auth::user()->id);\n $cellphone = '27'.(ltrim($userObj->cellphone,'0'));\n $meetingAttendee = new MeetingAttendee();\n $meetingAttendee->meeting = $meeting->id;\n $meetingAttendee->attendee = \\Auth::user()->id;\n $meetingAttendee->phonebook = 0;\n $meetingAttendee->mobile = $cellphone;\n $meetingAttendee->created_by = \\Auth::user()->id;\n $meetingAttendee->save();\n\n\n $calendarEvent = new CalendarEvent();\n $calendarEvent->name = $request['title'];\n $calendarEvent->start_date = $request['date'];\n $calendarEvent->end_date = $request['date'];\n $calendarEvent->start_time = $request['start_time'];\n $calendarEvent->end_time = $request['end_time'];\n $calendarEvent->event_type_id = 1;\n $calendarEvent->meeting_id = $meeting->id;\n $calendarEvent->locked = 1;\n $calendarEvent->created_by = \\Auth::user()->id;\n $calendarEvent->save();\n\n\n\n\n\n\n $facilitators = explode(',',$request['facilitators']);\n\n foreach ($facilitators as $facilitator) {\n\n $userObj = User::where('email','=',$facilitator)->first();\n $userId = 0;\n $addressbook = 0;\n\n if (count($userObj) > 0) {\n\n $userId = $userObj->id;\n\n\n } else {\n\n $userObj = addressbook::where('email','=',$facilitator)->first();\n $userId = $userObj->id;\n $addressbook = 1;\n }\n\n\n $meetingFacilitator = new MeetingFacilitator();\n $meetingFacilitator->meeting = $meeting->id;\n $meetingFacilitator->facilitator = $userId;\n $meetingFacilitator->addressbook = $addressbook;\n $meetingFacilitator->created_by = \\Auth::user()->id;\n $meetingFacilitator->save();\n\n\n }\n\n return \\Response::make('Meeting Created!');\n\n\n\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function create()\n {\n return view('admin.event.create');\n }",
"public function run()\n {\n Event::create([\n 'title' => 'Taller de Arduino',\n 'startTime' => '2019-11-13',\n 'endTime' => '2019-11-13',\n 'timeZone' => 'Pe',\n 'descrption' => 'Taller de introducción para el uso de Arduino',\n 'header' => 'Taller',\n 'footer' => 'Universidad Autónoma del Perú',\n 'agenda' => 'Usar Arduino',\n 'keywords' => 'Arduino',\n 'inviteStudents' => 1,\n 'remotelyAccessible' => 1,\n 'status' => 1,\n 'eventSubCategory_id' => null,\n 'eventCategory_id' => null,\n ]);\n }",
"public function testMeetingCreate()\n {\n }",
"function createEvent()\n {\n DB::table('events')->insert(\n [\n 'location' => 'Unicorn Bloodbath',\n 'tutorID' => '4',\n 'date' => '2000-01-01',\n 'time' => '12:03:04',\n 'studentID' => '3'\n ]);\n\n //return view('student');\n }",
"public function create()\n {\n return view('backend.event.create');\n }"
] | [
"0.63600725",
"0.6262604",
"0.6227886",
"0.6223699",
"0.62205267",
"0.6181214",
"0.61546093",
"0.6146667",
"0.61170256",
"0.6109154",
"0.6103558",
"0.6096514",
"0.60416263",
"0.6017037",
"0.5998175",
"0.598958",
"0.5982066",
"0.59496033",
"0.5942707",
"0.59008014",
"0.5897443",
"0.5868613",
"0.5865763",
"0.58639157",
"0.5861084",
"0.5861084",
"0.5860651",
"0.58516735",
"0.5848924",
"0.58440566"
] | 0.69727325 | 0 |
Create marketing engagements on a marketing events | public function createEngagements(MarketingEvent $marketingEvent)
{
throw new ShopifySdkException('MarketingEventService::createEngagements() not implemented');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createMeeting($meeting, $attendees){\n $meeting_sql_values = [\n 'location' => db::in_quotes($meeting->getLocation()),\n 'title' => db::in_quotes($meeting->getTitle()),\n 'datetime_sched' => db::in_quotes($meeting->getSched()),\n 'person_id' => db::in_quotes($meeting->getOwner())\n ];\n $meeting = db::insert('meeting', $meeting_sql_values);\n\n //Build insert statement for meeting_participant table\n foreach ($attendees as $attendee) {\n $attendee_sql_values = [\n 'meeting_id' => db::in_quotes($meeting->insert_id),\n 'person_id' => db::in_quotes($attendee),\n 'speaking_duration' => db::in_quotes(0),\n 'is_active' => db::in_quotes(0)\n ];\n\n db::insert('meeting_participant', $attendee_sql_values);\n }\n }",
"public function create(MarketingEvent &$marketingEvent)\n {\n $data = $marketingEvent->exportData();\n $endpoint = 'marketing_events.json';\n $response = $this->request(\n $endpoint, 'POST', array(\n 'marketing_event' => $data\n )\n );\n $marketingEvent->setData($response['marketing_event']);\n }",
"public function store(MeetingRequest $request)\n {\n $response = array();\n $meeting = new Meeting();\n $meeting->venue = $request['venue'];\n $meeting->title = $request['title'];\n $meeting->description = $request['description'];\n $meeting->date = $request['date'];\n $meeting->start_time = $request['start_time'];\n $meeting->end_time = $request['end_time'];\n $meeting->created_by = \\Auth::user()->id;\n $meeting->save();\n\n\n $userObj = User::find(\\Auth::user()->id);\n $cellphone = '27'.(ltrim($userObj->cellphone,'0'));\n $meetingAttendee = new MeetingAttendee();\n $meetingAttendee->meeting = $meeting->id;\n $meetingAttendee->attendee = \\Auth::user()->id;\n $meetingAttendee->phonebook = 0;\n $meetingAttendee->mobile = $cellphone;\n $meetingAttendee->created_by = \\Auth::user()->id;\n $meetingAttendee->save();\n\n\n $calendarEvent = new CalendarEvent();\n $calendarEvent->name = $request['title'];\n $calendarEvent->start_date = $request['date'];\n $calendarEvent->end_date = $request['date'];\n $calendarEvent->start_time = $request['start_time'];\n $calendarEvent->end_time = $request['end_time'];\n $calendarEvent->event_type_id = 1;\n $calendarEvent->meeting_id = $meeting->id;\n $calendarEvent->locked = 1;\n $calendarEvent->created_by = \\Auth::user()->id;\n $calendarEvent->save();\n\n\n\n\n\n\n $facilitators = explode(',',$request['facilitators']);\n\n foreach ($facilitators as $facilitator) {\n\n $userObj = User::where('email','=',$facilitator)->first();\n $userId = 0;\n $addressbook = 0;\n\n if (count($userObj) > 0) {\n\n $userId = $userObj->id;\n\n\n } else {\n\n $userObj = addressbook::where('email','=',$facilitator)->first();\n $userId = $userObj->id;\n $addressbook = 1;\n }\n\n\n $meetingFacilitator = new MeetingFacilitator();\n $meetingFacilitator->meeting = $meeting->id;\n $meetingFacilitator->facilitator = $userId;\n $meetingFacilitator->addressbook = $addressbook;\n $meetingFacilitator->created_by = \\Auth::user()->id;\n $meetingFacilitator->save();\n\n\n }\n\n return \\Response::make('Meeting Created!');\n\n\n\n }",
"public function store_event(Request $request)\n {\n // Determine whether this is a request to make the event or feedback form\n $this->validateMeeting();\n $meeting = new Meeting(request(['name', 'meeting_start', 'meeting_end']));\n\n // Store the meeting information in the user's session\n session(compact('meeting'));\n\n // Render form for user to create a feedback form\n return redirect(route('meetings.create_form'));\n }",
"public function run()\n {\n $event = Event::create([\n 'title' => 'Lorem ipsum dolor sit amet consectetur',\n 'description' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui, totam maiores? Quis in expedita facilis temporibus saepe deleniti dolore ad aut sed tenetur, officiis magni. Accusantium, nihil quia. Porro, cumque',\n 'participants' => 12,\n 'start' => '2020-06-20',\n 'end' => '2020-06-20',\n ]);\n $event->post()->create(['guide_id' => 25]);\n\n $event = Event::create([\n 'title' => 'Lorem ipsum dolor sit amet consectetur',\n 'description' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui, totam maiores? Quis in expedita facilis temporibus saepe deleniti dolore ad aut sed tenetur, officiis magni. Accusantium, nihil quia. Porro, cumque',\n 'participants' => 10,\n 'start' => '2020-06-20',\n 'end' => '2020-06-20',\n ]);\n $event->post()->create(['guide_id' => 25]);\n\n $event = Event::create([\n 'title' => 'Lorem ipsum dolor sit amet consectetur',\n 'description' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui, totam maiores? Quis in expedita facilis temporibus saepe deleniti dolore ad aut sed tenetur, officiis magni. Accusantium, nihil quia. Porro, cumque',\n 'participants' => 50,\n 'start' => '2020-06-20',\n 'end' => '2020-06-20',\n ]);\n $event->post()->create(['guide_id' => 25]);\n\n }",
"public function create(Engagement $engagement)\n {\n //\n }",
"public function create_events()\n {\n $today = Carbon::parse($this->course->start_date);\n $end = Carbon::parse($this->course->end_date);\n \n // for each day in the course period span\n while ($today <= $end) {\n\n // if today is a day of class, create the event\n if($this->day == $today->format('w'))\n {\n Event::create([\n 'course_id' => $this->course->id,\n 'teacher_id' => $this->course->teacher_id,\n 'room_id' => $this->course->room_id,\n 'start' => $today->setTimeFromTimeString($this->start)->toDateTimeString(),\n 'end' => $today->setTimeFromTimeString($this->end)->toDateTimeString(),\n 'name' => $this->course->name,\n 'course_time_id' => $this->id,\n 'exempt_attendance' => $this->course->exempt_attendance\n ]);\n }\n $today->addDay();\n }\n }",
"public function addMeeting(){\n\n $addParameters = array(\n\t\t\t\t'met_time_slot_id' => $this->input->post('timeslotId'),\n\t\t\t\t'met_title' => $this->input->post('title'),\n\t\t\t\t'met_lecturer_id' => $this->input->post('lecturerId'),\n\t\t\t\t'met_student_id' => $this->input->post('studentId')\n );\n $this->db->insert('meeting', $addParameters);\n }",
"public function create() : Meeting\n {\n return $this->meeting->forceCreate($this->formatParams());\n }",
"public function create()\n {\n $this->authorize('create-event');\n $event_types = App\\EventType::select('id','name')\n ->get()->toArray();\n\n $statuses = App\\Status::select('id','name')\n ->get()->toArray();\n\n $authorizations = [\"can_update_event\"=>true,\n \"can_show_event\"=>true,\n \"can_create_event\"=>true];\n\n return view('event.manage', [\n 'event'=>json_encode(null),\n 'organization'=>json_encode(null),\n 'team'=>json_encode(null),\n 'statuses'=>json_encode($statuses),\n 'event_types'=>json_encode($event_types),\n 'attachments'=>json_encode(null),\n 'authorizations'=>json_encode($authorizations),\n 'mode'=>'Create'\n ]);\n }",
"public function store(Request $request)\n {\n $this->validateFeedbackForm();\n\n // Event access code generator\n $isUnique = true;\n $code = \"\";\n $factory = new Factory;\n $generator = $factory->getLowStrengthGenerator();\n do {\n $code = $generator->generateString(7, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ');\n // $code = substr(str_shuffle('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 1, 7);\n $isUnique = Meeting::where('meeting_reference', $code)->doesntExist();\n } while ($isUnique == false);\n\n $meeting = request()->session()->pull('meeting');\n \\DB::beginTransaction();\n try{\n $meeting->meeting_reference = $code;\n $meeting->user_id = auth()->id();\n $meeting->save();\n\n foreach (request('questions') as $item) {\n $question = new FeedbackQuestion();\n $question->question = $item['question'];\n $question->question_type = $item['question_type'];\n $question->meeting_id = $meeting->id;\n $question->save();\n }\n\n }\n catch(\\Exception $e)\n {\n \\DB::rollback();\n return redirect(route('meetings.index'));\n }\n\n \\DB::commit();\n return redirect(route('meetings.show', compact('meeting')));\n }",
"public function run()\n {\n $events = [\n array(\n 'id' => '1',\n 'title' => 'The wedding ceremony',\n 'venue_id' => '1',\n 'service_id' => '2',\n 'start_date' => '2020-05-25 00:00:00',\n 'end_date' => '2020-05-25 00:00:00',\n 'description' => 'What is Lorem Ipsum?. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',\n 'active' => '1',\n 'avatar' => 'cooked.jpg',\n 'licensor_id' => '1',\n 'product_id' => '2',\n 'store_id' => '1',\n 'created_at' => '2020-02-25 00:00:00',\n 'updated_at' => '2020-02-25 00:00:00',\n ),\n array(\n 'id' => '10',\n 'title' => 'annual general meeting',\n 'venue_id' => '1',\n 'service_id' => '1',\n 'start_date' => '2020-05-25 00:00:00',\n 'end_date' => '2020-05-25 00:00:00',\n 'description' => 'What is Lorem Ipsum?. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',\n 'active' => '1',\n 'avatar' => 'beaf.jpg',\n 'licensor_id' => '1',\n 'product_id' => '4',\n 'store_id' => '1',\n 'created_at' => '2020-02-25 00:00:00',\n 'updated_at' => '2020-02-25 00:00:00',\n ),\n array(\n 'id' => '2',\n 'title' => 'PNP Tableview',\n 'venue_id' => '1',\n 'service_id' => '3',\n 'start_date' => '2020-05-25 00:00:00',\n 'end_date' => '2020-05-25 00:00:00',\n 'description' => 'What is Lorem Ipsum?. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.',\n 'active' => '1',\n 'avatar' => 'barbecue.jpg',\n 'licensor_id' => '1',\n 'product_id' => '4',\n 'store_id' => '1',\n 'created_at' => '2020-02-25 00:00:00',\n 'updated_at' => '2020-02-25 00:00:00',\n ),\n ];\n foreach ($events as $event) {\n Event::create($event);\n }\n }",
"public function store(Request $request)\n {\n\n if( config('custom.minimal_tickets_required') > 0) {\n $this->validate(request(), [\n\n 'title' => 'required|min:3',\n 'event_date' => 'required',//|date',\n 'start_time' => 'required',\n 'end_time' => 'required',\n 'capacity' => 'required|numeric|min:1',\n 'ticket_group_id' => 'required',\n ],\n [\n 'ticket_group_id.required' => 'Please select a ticket group'\n ]);\n }\n else {\n $this->validate(request(), [\n\n 'title' => 'required|min:3',\n 'event_date' => 'required',//|date',\n 'start_time' => 'required',\n 'end_time' => 'required',\n 'capacity' => 'required|numeric|min:1',\n 'ticket_group_id' => 'required',\n ],\n [\n 'ticket_group_id.required' => 'Please select a ticket group'\n ]);\n }\n\n\n //get all dates\n $event_dates = $request->event_date;\n\n //and loop through them to create identical events\n foreach ($event_dates as $event_date) {\n\n //first we need to correct the ISO8601 date by changing the timezone from utc (z) to local time, otherwise we end up with the wrong date!\n $corrected_date = new \\DateTime( $event_date, new \\DateTimeZone( 'UTC' ) ); // as the original datetime string is in Zulu time, set the datetimezone as UTC first\n $corrected_date->setTimezone( new \\DateTimeZone( 'Europe/Amsterdam' ) ); // this is what actually sets the timezone\n\n //create new event\n $event = new Event;\n\n //fill all aparams except date\n $event->event_date = $corrected_date;\n if (!$request->tickets_reserved) $request->tickets_reserved=0;\n $event->title = $request->title;\n $event->description = $request->description;\n $event->start_time = $request->start_time;\n $event->end_time = $request->end_time;\n $event->capacity = $request->capacity;\n $event->ticket_group_id = $request->ticket_group_id;\n if($request->min_per_sale) {$event->min_per_sale = $request->min_per_sale;}else $event->min_per_sale = 1;\n if($request->max_per_sale) {$event->max_per_sale = $request->max_per_sale;}else $event->max_per_sale =$event->capacity;\n if($request->tickets_reserved) {$event->tickets_reserved = $request->tickets_reserved;}else $event->tickets_reserved = 0;\n $event->active = $request->active;\n $event->save();\n\n // $event->ticketgroups()->sync($request->checkedTicketGroup);//attach tickets to event\n $event->categories()->sync($request->checkedCategories);//attach categories to event\n\n // $event_date = date('d-m-Y', strtotime($corrected_date));//convert to readable for log\n logger()->channel('info')->info('Event: \"'.$event->title.', date: '. $event_date.'\" created by '.auth()->user()->name);\n }\n\n //session()->flash('alert-success', 'Event added');\n return response()->json([\n 'message' => 'New Event(s) created'\n ], 200);\n }",
"public function testMeetingCreate()\n {\n }",
"public function createEvent(Request $request)\n {\n $request->validate([\n 'title' => 'required',\n 'details' => 'required',\n 'startdate' => 'required',\n 'enddate' => 'required',\n 'programmeId' => 'exists:programmes,id'\n ]);\n\n $programme = Programme::find($request->programmeId);\n $programme->events()->create([\n 'title' => $request->title,\n 'details' => $request->details,\n 'start_date' => $request->startdate,\n 'end_date' => $request->enddate,\n ]);\n\n Session::flash('success','Event is added to calender');\n return redirect()->back();\n }",
"function create_meetings($project_key){\n\t\t$assignee_override = array();\n\t\t$meetings = $this->sprint_meetings();\n\t\t\n\t\t$issues_created = 0;\n\t\t$project = $this->jira->get_project(strtoupper($project_key));//Get the project, we will need its ID and description later\n\t\tif(isset($assignee_override[0])){//Check if a user override was supplied\n\t\t\t$project_team = $assignee_override;//If it was use this instead of the user in the project description\n\t\t}else{\n\t\t\t$project_team = explode(',', $project->description);//We are storing the users in the project description as a comma seperated string. Turn this into an array\n\t\t}\n\t\t$project_boards = $this->jira->get_boards($project_key);//Get all boards that this project is a part of\n\t\tforeach($project_boards->values as $project_board){\n\t\t\t$sprints = $this->jira->get_sprints($project_board->id);//Get all sprints for this board\n\t\t\tforeach($sprints->values as $sprint){\n\t\t\t\tif($sprint->state == \"future\"){//If sprint is in the future\n\t\t\t\t\tforeach($project_team as $assignee){//For each user in the production team\n\t\t\t\t\t\t$jql = \"project=\" . $project_key . \" AND assignee=\" . $assignee . \" AND sprint =\" . $sprint->id . \" AND labels = Meetings\";\n\t\t\t\t\t\t$results = $this->jira->jql($jql);\n\t\t\t\t\t\tif(isset($results->errorMessages[0])){//If the JQL is invalid and Jira gives us an error pass it on, not great but better than nothing\n\t\t\t\t\t\t\t$this->send_error($results->errorMessages[0]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($results->total == 0){//If there aren't any results lets create some!\n\t\t\t\t\t\t\tforeach($meetings as $meeting){\n\t\t\t\t\t\t\t\tif($this->jira->create_meeting_issue($project->id, $sprint->id, $assignee, $meeting->summary, $meeting->description, $meeting->originalEstimate, $meeting->labels) === TRUE){//If the issue is successfully created increment the counter\n\t\t\t\t\t\t\t\t\t++$issues_created;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Build and Send the payload\n\t\t$payload['status'] = 200;\n\t\t$payload['success'] = 'true';\n\t\t$payload['result'] = $issues_created . ' JIRA Issues Created. Have a great day!';\n\t\t$this->output->set_status_header('200');\n\t\t$this->output->set_header('Content-Type: application/json; charset=utf-8');\n\t\techo json_encode($payload);\n\t}",
"public function create()\n {\n $announcement = [];\n $data = Announcement::all();\n if($data->count()) {\n foreach ($data as $key => $value) {\n $announcement[] = Calendar::event(\n $value->name,\n true,\n new \\DateTime($value->date),\n new \\DateTime($value->date.' +1 day'),\n null,\n // Add color and link on event\n [\n 'color' => 'blue',\n 'url' => \"/admin/announcements/$value->id/edit\",\n ]\n );\n }\n }\n $calendar = Calendar::addEvents($announcement);\n return view('announcements.create', compact('calendar'));\n }",
"public function attendee_CreateMeetingAttendee($attendees) {\r\n $xml = '';\r\n foreach ($attendees as $attendee) {\r\n //$xml .= '<attendees>';\r\n $xml .= '<person>';\r\n foreach ($attendee['info'] as $attr => $val) {\r\n if (!is_array($val) && !empty($val))\r\n $xml .= '<' . $attr . '>' . $val . '</' . $attr . '>';\r\n\r\n if (is_array($val)) {\r\n $xml .= '<' . $attr . '>';\r\n foreach ($val as $att => $val) {\r\n if (!empty($val))\r\n $xml .= '<' . $att . '>' . $val . '</' . $att . '>';\r\n }\r\n $xml .= '</' . $attr . '>';\r\n }\r\n }\r\n $xml .= '</person>';\r\n\r\n foreach ($attendee['options'] as $attr => $val) {\r\n if (!empty($val))\r\n $xml .= '<' . $attr . '>' . $val . '</' . $attr . '>';\r\n }\r\n //$xml .= '</attendees>';\r\n }\r\n\r\n $payload['xml'] = $xml;\r\n $payload['service'] = str_replace(\"_\", \".\", __FUNCTION__);\r\n\r\n return $this->transmit($payload);\r\n }",
"public function store(Request $request)\n {\n $start_date = date('c', strtotime(str_replace(\"/\", \"-\", Input::get('start_date'))));\n $end_date = date('c', strtotime(str_replace(\"/\", \"-\", Input::get('end_date'))));\n\n $validation = Validator::make($request->all(), [\n 'project_id' => 'required',\n 'start_date' => 'required',\n 'end_date' => 'required',\n 'type_id' => 'required',\n 'description' => 'required',\n 'estimated_length' => 'required|numeric',\n 'priority_id' => 'required',\n ]);\n\n if ($validation->fails()) {\n return Redirect::to('meeting')\n ->withInput()\n ->withErrors($validation->messages());\n }\n\n $meeting = new Meeting();\n $meeting->project_id = Input::get('project_id');\n $meeting->user_id = Auth::user()->user_id;\n $meeting->start_date = $start_date;\n $meeting->end_date = $end_date;\n $meeting->type_id = Input::get('type_id');\n $meeting->description = Input::get('description');\n $meeting->estimated_length = Input::get('estimated_length');\n $meeting->priority_id = Input::get('priority_id');\n $meeting->attendees = Input::get('attendees') ? json_encode(Input::get('attendees')) : '';\n $meeting->meeting_url = Input::get('meeting_url');\n $meeting->save();\n\n return Redirect::to('meeting')\n ->withSuccess(\"Meeting added successfully!!\");\n }",
"function bbp_setup_engagements()\n{\n}",
"function meetups_add( array $contents ) : mixed\n{\n // Check if the required files have been included\n require_included_file('meetups.lang.php');\n\n // Only moderators can run this action\n user_restrict_to_moderators();\n\n // Sanitize and prepare the data\n $meetup_date = sanitize_array_element($contents, 'date', 'string', convert_date: 'to_mysql', default: 0);\n $meetup_location = sanitize_array_element($contents, 'location', 'string', max: 20);\n $meetup_details_en = sanitize_array_element($contents, 'details_en', 'string');\n $meetup_details_fr = sanitize_array_element($contents, 'details_fr', 'string');\n $meetup_lang = ($contents['lang_en']) ? 'EN' : '';\n $meetup_lang .= ($contents['lang_fr']) ? 'FR' : '';\n\n // Error: Incorrect date\n if(!$meetup_date || $meetup_date === '0000-00-00')\n return __('meetups_new_error_date');\n\n // Error: No location\n if(!$meetup_location)\n return __('meetups_new_error_location');\n\n // Error: No language\n if(!$meetup_lang)\n return __('meetups_new_error_language');\n\n // Create the meetup\n query(\" INSERT INTO meetups\n SET meetups.event_date = '$meetup_date' ,\n meetups.location = '$meetup_location' ,\n meetups.languages = '$meetup_lang' ,\n meetups.details_en = '$meetup_details_en' ,\n meetups.details_fr = '$meetup_details_fr' \");\n\n // Fetch the newly created meetup's id\n $meetup_id = query_id();\n\n // Scheduled task\n $meetup_end_date = strtotime(date('Y-m-d H:i:s', strtotime(\"+1 day +1 hour +1 minute\", strtotime($meetup_date))));\n $meetup_end_name = $meetup_date.' '.$meetup_location;\n schedule_task( action_type: 'meetups_end' ,\n action_id: $meetup_id ,\n action_planned_at: $meetup_end_date ,\n action_description: $meetup_end_name ,\n sanitize_data: true );\n\n // Fetch the username of the moderator creating the meetup\n $mod_username = user_get_username();\n\n // Activity log, for future meetups only\n if(strtotime($meetup_date) > strtotime(date('Y-m-d')))\n log_activity( 'meetups_new' ,\n language: $meetup_lang ,\n activity_id: $meetup_id ,\n activity_summary_en: $meetup_date ,\n activity_summary_fr: $meetup_date );\n\n // Moderation log\n log_activity( 'meetups_new' ,\n is_moderators_only: true ,\n activity_id: $meetup_id ,\n activity_summary_en: $meetup_date ,\n activity_summary_fr: $meetup_date ,\n moderator_username: $mod_username );\n\n // Plain text meetup dates\n $meetup_date_en = date_to_text($meetup_date, lang: 'EN');\n $meetup_date_fr = date_to_text($meetup_date, lang: 'FR');\n\n // IRC bot message\n if(strtotime($meetup_date) > strtotime(date('Y-m-d')))\n {\n if(str_contains($meetup_lang, 'EN'))\n irc_bot_send_message(\"A new real life meetup is being planned on $meetup_date_en - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'english');\n if(str_contains($meetup_lang, 'FR'))\n irc_bot_send_message(\"Une nouvelle rencontre IRL est planifiée le $meetup_date_fr - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'french');\n }\n else\n irc_bot_send_message(\"A real life meetup has been created in the past by $mod_username on $meetup_date_en - \".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id, 'mod');\n\n // Discord message\n if(strtotime($meetup_date) > strtotime(date('Y-m-d')))\n {\n if(str_contains($meetup_lang, 'EN') && str_contains($meetup_lang, 'FR'))\n {\n $discord_message = \"A new real life meetup is being organized on $meetup_date_en\";\n $discord_message .= PHP_EOL.\"Une nouvelle rencontre IRL est planifiée le $meetup_date_fr\";\n $discord_message .= PHP_EOL.\"@here <\".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id.\">\";\n discord_send_message($discord_message, 'main');\n }\n else if(str_contains($meetup_lang, 'EN'))\n {\n $discord_message = \"A new english speaking real life meetup is being organized on $meetup_date_en\";\n $discord_message .= PHP_EOL.\"Une nouvelle rencontre IRL anglophone est planifiée le $meetup_date_en\";\n $discord_message .= PHP_EOL.\"@here <\".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id.\">\";\n discord_send_message($discord_message, 'main');\n }\n else if(str_contains($meetup_lang, 'FR'))\n {\n $discord_message = \"A new french speaking real life meetup is being organized on $meetup_date_en\";\n $discord_message .= PHP_EOL.\"Une nouvelle rencontre IRL francophone est planifiée le $meetup_date_en\";\n $discord_message .= PHP_EOL.\"@here <\".$GLOBALS['website_url'].\"pages/meetups/\".$meetup_id.\">\";\n discord_send_message($discord_message, 'main');\n }\n }\n\n // Return the meetup's id\n return $meetup_id;\n}",
"public function createMeeting_action()\n {\n if (!$this->perm == 'mod') {\n $this->error();\n }\n\n $course = Course::find($this->meetingId);\n \n $creationParams = array(\n 'meetingId' => $this->meetingId, // REQUIRED\n 'meetingName' => $course->name, // REQUIRED\n 'attendeePw' => $this->attPw, \n 'moderatorPw' => $this->modPw, \n 'welcomeMsg' => '', \n 'dialNumber' => '',\n 'voiceBridge' => rand(10000, 99999), // 5 digit PIN to join voice conference. Required.\n 'webVoice' => '',\n 'logoutUrl' => '',\n 'maxParticipants' => '-1', \n 'record' => 'false', // New. 'true' will tell BBB to record the meeting.\n 'duration' => '0', // Default = 0 which means no set duration in minutes. [number]\n );\n\n $result = $this->bbb->createMeetingWithXmlResponseArray($creationParams);\n\n if ($result['returncode'] == 'SUCCESS') {\n // get the join url\n $joinParams = array(\n 'meetingId' => $this->meetingId, // REQUIRED - We have to know which meeting to join.\n 'username' => get_username($GLOBALS['user']->id), // REQUIRED - The user display name that will show in the BBB meeting.\n );\n if ($GLOBALS['perm']->have_studip_perm('tutor', $this->meetingId)) {\n $joinParams['password'] = $this->modPw;\n } else {\n $joinParams['password'] = $this->attPw;\n }\n\n $this->redirect($this->bbb->getJoinMeetingURL($joinParams));\n }\n\n }",
"public function create()\n {\n return view('advisor.exams.create',['title'=>'Create Event']);\n }",
"public function saveCommitteeMembersToAttendees($meeting){\n if($meeting->committee->type == 'Associations') {\n $committeeBoard = Committee::where('parent_id', $meeting->committee_id)->first();\n $committeeMembers = CommitteeMember::whereIn('committee_id', [$meeting->committee_id, $committeeBoard->id])->get();\n } else {\n $committeeMembers = CommitteeMember::where('committee_id', $meeting->committee_id)->get();\n }\n\n foreach($committeeMembers as $committeeMember){\n $input['shares'] = $committeeMember->shares;\n $input['member_id']=$committeeMember->member_id;\n\n $input['position_id']=$committeeMember->position_id;\n $input['membership_id']=$committeeMember->membership_id;\n $input['organization_name']=$committeeMember->organization_name;\n \n $input['meeting_id']=$meeting->id;\n $input['is_committee_member']=1;\n $input['committee_id']=$meeting->committee_id;\n \n Attendee::create($input);\n }\n }",
"function createAppointment(){\n\n}",
"public function promoteAttendeeAction()\n {\n $get = Zend_Registry::get('getFilter');\n \n if (!isset($get->eventId)) {\n throw new Ot_Exception_Input('msg-error-eventIdNotSet');\n }\n \n $eventId = $get->eventId;\n \n if (!isset($get->accountId)) {\n throw new Ot_Exception_Input('msg-error-accountIdNotSet');\n }\n \n $accountId = $get->accountId;\n \n $attendee = new Event_Attendee();\n \n // lookup the event\n $event = new Event();\n $thisEvent = $event->find($eventId);\n \n if (is_null($thisEvent)) {\n throw new Ot_Exception_Data('msg-error-noEvent');\n }\n \n $workshop = new Workshop();\n $thisWorkshop = $workshop->find($thisEvent->workshopId); \n if (is_null($thisWorkshop)) {\n throw new Ot_Exception_Data('msg-error-noWorkshop');\n }\n \n $location = new Location();\n $thisLocation = $location->find($thisEvent->locationId);\n \n if (is_null($thisLocation)) {\n throw new Ot_Exception_Data('msg-error-noLocation');\n } \n \n $instructor = new Event_Instructor();\n $instructors = $instructor->getInstructorsForEvent($thisEvent->eventId);\n \n $instructorNames = array();\n $instructorEmails = array();\n \n foreach ($instructors as $i) {\n $instructorNames[] = $i['firstName'] . ' ' . $i['lastName'];\n $instructorEmails[] = $i['emailAddress'];\n }\n \n $otAccount = new Ot_Account(); \n $up = $otAccount->find($accountId);\n \n if (is_null($up)) {\n throw new Ot_Exception_Input('msg-error-noAccount');\n } \n \n $attendee->makeReservation($accountId, $eventId, 'attending');\n \n $startDt = strtotime($thisEvent->date . ' ' . $thisEvent->startTime);\n $endDt = strtotime($thisEvent->date . ' ' . $thisEvent->endTime);\n \n $data = array(\n 'workshopName' => $thisWorkshop->title,\n 'workshopDate' => date('m/d/Y', $startDt),\n 'workshopStartTime' => date('g:i a', $startDt),\n 'workshopEndTime' => date('g:i a', $endDt),\n 'workshopMinimumEnrollment' => $thisEvent->minSize,\n 'locationName' => $thisLocation->name,\n 'locationAddress' => $thisLocation->address,\n 'studentAccountId' => $accountId,\n 'instructorNames' => implode(', ', $instructorNames),\n 'instructorEmails' => implode(', ', $instructorEmails),\n 'studentEmail' => $up->emailAddress,\n 'studentFirstName' => $up->firstName,\n 'studentLastName' => $up->lastName,\n 'studentUsername' => $up->username\n );\n \n $trigger = new Ot_Trigger();\n $trigger->setVariables($data);\n $trigger->dispatch('Instructor_Promote_User_Waitlist_To_Attending');\n \n $this->_helper->flashMessenger->addMessage('msg-info-userPromoted'); \n $this->_redirect('/workshop/instructor/?eventId=' . $eventId);\n }",
"function ws_add_attendee( $entry, $form ){\n\n\t$attendee_first_name \t= ucfirst( $entry[\"1.3\"] );\n\t$attendee_last_name\t\t= ucfirst( $entry[\"1.6\"] );\n\t$attendee_email \t\t= $entry['2'];\n\t$attendee_city \t\t\t= $entry['3'];\n\t$attendee_country \t\t= $entry['4'];\n\t$attendee_state \t\t= $entry['5'];\n\t$attendee_title = $attendee_first_name . ' ' . $attendee_last_name;\n\t$attendee = array(\n\t 'post_title' => esc_html( $attendee_title ),\n\t 'post_content' => '',\n\t 'post_status' => 'pending',\n\t 'post_author' => 1,\n\t 'post_type' => 'team-member'\n\t);\n\t$attendee_id = wp_insert_post( $attendee );\n\n\tupdate_post_meta( $attendee_id, 'ws_attendee_first_name', esc_html( $attendee_first_name ) );\n\tupdate_post_meta( $attendee_id, 'ws_attendee_last_name', esc_html( $attendee_last_name ) );\n\tupdate_post_meta( $attendee_id, '_gravatar_email', esc_html( $attendee_email ) );\n\tupdate_post_meta( $attendee_id, 'ws_attendee_city', esc_html( $attendee_city ) );\n\tupdate_post_meta( $attendee_id, 'ws_attendee_country', esc_html( $attendee_country ) );\n\tupdate_post_meta( $attendee_id, 'ws_attendee_state', esc_html( $attendee_state ) );\n\n}",
"public function run()\n {\n $events = [\n [ \n \n 'name' => 'ISAT Meeting',\n 'description' => 'First ISAT meeting in the history of time.',\n 'location' => 'ISAT 100', \n 'time' => '8:00 PM Decemeber 25, 2014',\n 'created_at' => '2013-05-24 00:00:00',\n 'updated_at' => '2013-05-24 00:00:00'\n ],\n [ \n 'name' => 'ISAT Meeting 2',\n 'description' => 'Second ISAT meeting in the history of time.',\n 'location' => 'ISAT 100', \n 'time' => '8:00 PM Decemeber 26, 2014',\n 'created_at' => '2013-05-25 00:00:00',\n 'updated_at' => '2013-05-25 00:00:00'\n ] \n ];\n \n DB::table('events')->insert($events);\n }",
"function createCalPost($name, $email, $startdate, $enddate, $addinfo) {\n $arg_list = func_get_args();\n foreach($arg_list as $key => $arg){\n $arg_list[$key] = urlencode($arg);\n }\n $postargs = new stdClass();\n $postargs->start = new stdClass();\n $postargs->start->date = $startdate;\n $postargs->end = new stdClass();\n $postargs->end->date = $enddate;\n $postargs->summary = $name;\n $postargs->description = $addinfo;\n // add user email as attendee\n //$postargs->attendees = array(json_decode('{\"email\":\"' . $email . '\",\"optional\":\"true\"}'));\n return json_encode($postargs);\n }",
"public function store(Request $request)\n {\n $id = Auth::user()->id;\n $meetings = Meeting::where('user_id',$id)\n ->Where('receiver_id',$request->receiver_id)\n ->where('meeting_status','2')\n ->get();\n if (count($meetings) == 0) {\n $meeting = new Meeting();\n $meeting->user_id = $id;\n $meeting->receiver_id = $request->receiver_id;\n $meeting->meetingtype_id = $request->type_id;\n $meeting->start_time = $request->approx_start_time;\n $meeting->end_time = $request->approx_end_time;\n $meeting->note = $request->note;\n $meeting->venue = $request->venue;\n $meeting->save();\n return response()->json([\n 'code' => 200,\n 'status' => true,\n 'message' => 'Meeting request successfully sent.',\n 'data' => $meeting\n ]);\n }else {\n return response()->json([\n 'code' => 200,\n 'status' => false,\n 'data' => [\n 'user' => []\n ],\n 'message' => 'Other Meeting Already Is Pending From User.'\n ]);\n }\n \n }"
] | [
"0.657624",
"0.6084249",
"0.6063012",
"0.5964115",
"0.5789657",
"0.56922084",
"0.56810707",
"0.56758887",
"0.5641433",
"0.5626412",
"0.55690277",
"0.55339396",
"0.5533149",
"0.55139077",
"0.55097157",
"0.54663557",
"0.54663455",
"0.5457636",
"0.5442099",
"0.5438102",
"0.54364645",
"0.5433244",
"0.54293704",
"0.5414052",
"0.5402364",
"0.53567624",
"0.5293118",
"0.5279399",
"0.5278458",
"0.52651364"
] | 0.7236662 | 0 |
Constructor. Opens a connection to an LDAP host. | public function __construct($host)
{
$this->_setIsOpen(false);
if (!$this->_connect($host))
{
throw new Exception('Could not connect to LDAP server.');
}
if (!$this->_bind()) {
throw new Exception('Could not bind to LDAP directory.');
}
$this->_setIsOpen(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function connect()\n {\n $port = $this->ssl ? $this::PORT_SSL : $this::PORT;\n\n $hostname = $this->domainController->getHostname();\n\n return $this->connection = ldap_connect($hostname, $port);\n }",
"private function connect()\n {\n if( is_resource( $this->resource ) ) return;\n\n $this->resource = ldap_connect( $this->server, $this->port );\n if( $this->active_directory )\n {\n if( false == @ldap_set_option( $this->resource, LDAP_OPT_PROTOCOL_VERSION, 3 ) )\n throw new exc\\ldap( ldap_error( $this->resource ), ldap_errno( $this->resource ) );\n }\n\n if( !( @ldap_bind( $this->resource, $this->username, $this->password ) ) )\n throw new exc\\ldap( ldap_error( $this->resource ), ldap_errno( $this->resource ) );\n }",
"public function connect() {\n $useSsl = $this->getOption(modActiveDirectoryDriver::OPT_USE_SSL,false);\n $useTls = $this->getOption(modActiveDirectoryDriver::OPT_USE_TLS,false);\n \n // Connect to the AD/LDAP server as the username/password\n $dc = $this->getRandomController();\n if ($useSsl) {\n $this->_conn = ldap_connect(\"ldaps://\".$dc, (int)$this->getOption(modActiveDirectoryDriver::OPT_LDAP_SSL_PORT,636));\n } else {\n $this->_conn = ldap_connect($dc);\n }\n\n // Set some ldap options for talking to AD\n ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, (int)$this->getOption(modActiveDirectoryDriver::OPT_LDAP_PROTOCOL_VERSION,3));\n ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, (int)$this->getOption(modActiveDirectoryDriver::OPT_LDAP_REFERRALS,0));\n ldap_set_option($this->_conn, LDAP_OPT_TIMELIMIT, (int)$this->getOption(modActiveDirectoryDriver::OPT_LDAP_TIMELIMIT,10));\n\n if ($useTls) {\n ldap_start_tls($this->_conn);\n }\n\n // Bind as a domain admin if they've set it up\n $username = $this->getOption(modActiveDirectoryDriver::OPT_ADMIN_USERNAME,'');\n $password = $this->getOption(modActiveDirectoryDriver::OPT_ADMIN_PASSWORD,'');\n $accountSuffix = $this->getOption(modActiveDirectoryDriver::OPT_ACCOUNT_SUFFIX,'@forest.local');\n if (!empty($password) && !empty($password)) {\n $this->_bind = @ldap_bind($this->_conn,$username.$accountSuffix,$password);\n if (!$this->_bind) {\n if ($useSsl && !$useTls) {\n // If you have problems troubleshooting, remove the @ character from the ldap_bind command above to get the actual error message\n $this->modx->log(modX::LOG_LEVEL_ERROR,'Bind to Active Directory failed. Either the LDAPs connection failed or the login credentials are incorrect. AD said: ' . $this->getLastError());\n } else {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'Bind to Active Directory failed. Check the login credentials and/or server details. AD said: ' . $this->getLastError());\n }\n }\n }\n\n $baseDn = $this->getOption(modActiveDirectoryDriver::OPT_BASE_DN,'');\n if (empty($baseDn)) {\n $this->setOption(modActiveDirectoryDriver::OPT_BASE_DN,$this->findBaseDn());\n }\n\n return true;\n }",
"public function connect() {\n $this->ldapConnexion = ldap_connect($this->uri);\n $this->bind();\n\n return $this->ldapConnexion;\n }",
"public function __construct($ldapUrl = null)\n {\n $ldapUrl && $this->connect($ldapUrl);\n }",
"private function __ldapConnect() {\n\t\t$ldapConnection = @ldap_connect($this->settings['ldap_url']);\n\n\t\tif (!$ldapConnection) {\n\t\t\tthrow new CakeException(\"Could not connect to LDAP authentication server\");\n\t\t}\n\n\t\t// avoid protocol mismatch\n ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, Configure::read('ldap.protocol_version'));\n\n // bind to search user\n @ldap_bind($ldapConnection, Configure::read('ldap.search_dn'), Configure::read('ldap.search_pass'));\n\n\t\treturn $ldapConnection;\n\t}",
"function _connect( $host, $username, $password, $ldapbase)\n\t{\n\t\tglobal $LDAP_CONNECT_OPTIONS;\n\n\t\tif ( !function_exists( 'ldap_connect' ) ) return null;\n\n\t\tif (strpos($host,'ldap://') === 0 || strpos($host,'ldaps://') === 0) {\n\t\t\t$this->_connectionID = @ldap_connect($host);\n\t\t} else {\n\t\t\t$conn_info = array( $host,$this->port);\n\n\t\t\tif ( strstr( $host, ':' ) ) {\n\t\t\t\t$conn_info = explode( ':', $host );\n\t\t\t}\n\n\t\t\t$this->_connectionID = @ldap_connect( $conn_info[0], $conn_info[1] );\n\t\t}\n\t\tif (!$this->_connectionID) {\n\t\t\t$e = 'Could not connect to ' . $conn_info[0];\n\t\t\t$this->_errorMsg = $e;\n\t\t\tif ($this->debug) ADOConnection::outp($e);\n\t\t\treturn false;\n\t\t}\n\t\tif( count( $LDAP_CONNECT_OPTIONS ) > 0 ) {\n\t\t\t$this->_inject_bind_options( $LDAP_CONNECT_OPTIONS );\n\t\t}\n\n\t\tif ($username) {\n\t\t\t$bind = @ldap_bind( $this->_connectionID, $username, $password );\n\t\t} else {\n\t\t\t$username = 'anonymous';\n\t\t\t$bind = @ldap_bind( $this->_connectionID );\n\t\t}\n\n\t\tif (!$bind) {\n\t\t\t$e = sprintf($this->_bind_errmsg,ldap_error($this->_connectionID));\n\t\t\t$this->_errorMsg = $e;\n\t\t\tif ($this->debug) ADOConnection::outp($e);\n\t\t\treturn false;\n\t\t}\n\t\t$this->_errorMsg = '';\n\t\t$this->database = $ldapbase;\n\t\treturn $this->_connectionID;\n\t}",
"public function connect()\n\t{\n\t\t$this->link\t= ldap_connect($this->host, $this->port)\n\t\t\t\t\t or die (\"Can't connect to \". $this->host . \":\". $this->port . \"!\");\n\t\treturn $this->link;\n\t}",
"function Connect() {\n\t\t\t\n\t\t\t// Enable error reporting for all errors\n\t\t\terror_reporting(E_ALL);\n\t\t\t$this->_Connection = ldap_connect($this->Server, $this->Port) or die('LDAP Fehler: ' . ldap_error($this->_Connection));\n\t\t\t\n\t\t\t// Set any protokoll options\n\t\t\tldap_set_option($this->_Connection, LDAP_OPT_PROTOKOL_OPTION, $this->ProtokollVersion);\n\t\t\t\n\t\t\t// Try to bind the local user to the serverconnection\n\t\t\tif ($this->UserName != '' && $this->Password != '') {\n\t\t\t\t$this->_UserBinding = ldap_bind($this->_Connection, $this->UserName, $this->Password) or die('LDAP Fehler: ' . ldap_error($this->_Connection));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t// Try anonymous login\n\t\t\t\t$this->_UserBinding = ldap_bind($this->_Connection);\n\t\t\t}\n\t\t}",
"public function connect(string $ldapUrl): self\n {\n // Make sure the connection has been established successfully\n if (! $this->resource = @ldap_connect($ldapUrl)) {\n throw new \\Exception(sprintf(\"Unable to connect to ldap server %s\", $ldapUrl));\n }\n\n // Set sane defaults for ldap v3 protocol\n $this->setOption(LDAP_OPT_PROTOCOL_VERSION, 3)\n ->setOption(LDAP_OPT_REFERRALS, 0);\n\n return $this;\n }",
"public function connect()\n\t{\n\t\tif ( ! is_null($this->connection)) return $this->connection;\n\n\t\t$this->connection = ldap_connect($this->config['server'], $this->config['port']);\n\n\t\tif ($this->connection === false)\n\t\t{\n\t\t\tthrow new \\Exception(\"Connection to Ldap server {$this->server} impossible.\");\n\t\t}\n\n\t\tldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t\tldap_set_option($this->connection, LDAP_OPT_REFERRALS, 0);\n\t}",
"function ldap_connect($hostname = NULL, $port = 389)\n{\n}",
"public function __construct ()\r\n {\r\n // getting all parameters\r\n $this->ldap = System::getConfig ('ldap');\r\n // connecting to the server\r\n $this->ds = ldap_connect ($this->ldap['host']);\r\n if (!$this->ds)\r\n throw new GameError ('Unable to connect to ldap server');\r\n // binding to it (you need to bind to general searching user, in order to speed up search)\r\n if (!ldap_bind ($this->ds, $this->ldap['bindRdn'], $this->ldap['bindPass']))\r\n throw new GameError ('Initial bind was unsuccessfull');\r\n }",
"public function __construct($ldap_host, $ldap_port, $ldap_user, $ldap_pass, $baseDN, Logger $logger)\n {\n $this->ldapHost = $ldap_host;\n $this->ldapPort = $ldap_port;\n $this->ldapUser = $ldap_user;\n $this->ldapPassword = $ldap_pass;\n $this->baseDN = $baseDN;\n $this->logger = $logger;\n\n //Start logger\n //$this->startLogging();\n }",
"function connect($arguments)\n\t{\t\t\t\t\n \t$this->server_name = $arguments['server_name'];\n \t$this->base_dn = $arguments['base_dn'];\n \t$this->min_uid_number = 1000;\n \t$this->min_gid_number = 1000;\n \t\n \t$this->user_filter = (isset($arguments['user_filter'])) ?\n \t\t$arguments['user_filter'] : '(uid=%USERNAME%)';\n\t\t$this->bind_username = (isset($arguments['bind_username'])) ?\n\t\t\t$arguments['bind_username'] : null;\n\t\t$this->bind_password = (isset($arguments['bind_password'])) ?\n\t\t\t$arguments['bind_password'] : null;\n\n\t\t$admin_username = (isset($arguments['admin_username'])) ?\n\t\t\t$arguments['admin_username'] : $this->bind_username;\n\t\t$admin_password = (isset($arguments['admin_password'])) ?\n\t\t\t$arguments['admin_password'] : $this->bind_password;\n\n\t\tif ($this->server_name == null || $this->base_dn == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->conn = ldap_connect($this->server_name);\n\t\tif (ldap_errno($this->conn) !== 0 | $this->conn === FALSE) {\n\t\t\ttrigger_error(ldap_error($this->conn), E_USER_ERROR);\n\t\t}\n\t\t\n\t\t$result = ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t\tif ($result === FALSE) {\n\t\t\ttrigger_error(ldap_error($this->conn), E_USER_ERROR);\n\t\t}\n \t$result = ldap_set_option($this->conn, LDAP_OPT_DEREF, LDAP_DEREF_ALWAYS);\n \tif ($result === FALSE) {\n\t\t\ttrigger_error(ldap_error($this->conn), E_USER_ERROR);\n\t\t}\n \t\n \t// @ldap_start_tls($this->conn);\n \t$result = ldap_bind($this->conn, $this->bind_username, $this->bind_password);\n \tif ($result == FALSE) {\n \t\treturn false;\n \t}\n \t\n\t\tif ($this->bind_username == $admin_username) {\n\t\t\t$this->priv_conn =& $this->conn;\n\t\t} else {\n\t\t\t$this->priv_conn = ldap_connect('ldap://' .$this->server_name, 389);\n\t\t\tldap_set_option($this->priv_conn, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t \tldap_set_option($this->priv_conn, LDAP_OPT_DEREF, LDAP_DEREF_ALWAYS);\n\t \t// @ldap_start_tls($this->priv_conn);\n\t \t$result = ldap_bind($this->priv_conn, $admin_username, $admin_password);\n\t \tif ($result == FALSE) {\n\t \t\treturn false;\n\t \t}\n\t\t}\n\t\t\n \treturn true;\n }",
"public function connect()\n {\n //Connection to LDAP\n //ldap_connect always has a return value, even if LDAP is not reachable\n $this->ldapConnection = ldap_connect($this->ldapHost);\n\n //Set options\n ldap_set_option($this->ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($this->ldapConnection, LDAP_OPT_REFERRALS, 0);\n //ldap_set_option($this->ldapConnection, LDAP_OPT_DEBUG_LEVEL, 7);\n\n //StartTLS\n ldap_start_tls($this->ldapConnection);\n\n //Check trough anonymous bind if LDAP is reachable\n if (ldap_bind($this->ldapConnection)) {\n $message = \"connect - Connection to LDAP-Server (\" . $this->ldapHost . \") successfully established.\";\n $this->logger->info($message);\n //$this->setStatus($message, LOGLEVEL::INFO);\n } else {\n $errorMessage = $this->getLdapError(\"connect - Error: Connection to LDAP-Server (\" . $this->ldapHost . \") could not be established.\");\n $this->logger->error($errorMessage);\n //$this->setStatus($errorMessage, LOGLEVEL::ERROR);\n $this->connected = false;\n return false;\n }\n\n //Authentication bind to access data (anonymous cant read)\n if (ldap_bind($this->ldapConnection, $this->ldapUser, $this->ldapPassword)) {\n $message = \"connect - Bind successfull.\";\n $this->logger->info($message);\n //$this->setStatus($message, LOGLEVEL::INFO);\n $this->connected = true;\n } else {\n $errorMessage = $this->getLdapError(\"connect - Error: Bind failed.\");\n $this->logger->error($errorMessage);\n //$this->setStatus($errorMessage, LOGLEVEL::ERROR);\n $this->connected = false;\n return false;\n }\n return true;\n }",
"private function _connect($host)\n\t{\n\t\t$this->_setLink(ldap_connect($host));\n return $this->_getLink();\n\t}",
"public function __construct()\n {\n $this->openLDAP = new openLDAP();\n }",
"function connect()\n\t{\n\t\tglobal $lang;\n\t\t$this->ldapconn = ldap_connect($this->ldapconfig['host'])\n\t \tor die($lang['posixldapauth_could_not_connect_to_ldap_server']);\n\t\tldap_set_option($this->ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);\n\t\t// set referals to 0 to search the entire AD! - Added April 2014\n\t\t\n\t\tif ($this->ldap_debug) { error_log( __FILE__ . \" \" . __METHOD__ . \" \" . __LINE__ . \" Connected to LDAP Server \" . $this->ldapconfig['host']); }\n\t\treturn 1;\n\t}",
"public function &connect($params=array())\n {\n if(is_array($params)){\n if(array_key_exists('ldapServer', $params)) $this->ldapServer = $params['ldapServer'];\n if(array_key_exists('ldapServerPort', $params)) $this->ldapServerPort = $params['ldapServerPort'];\n if(array_key_exists('ldapDomain', $params)) $this->ldapDomain = $params['ldapDomain'];\n if(array_key_exists('bindUsername', $params)) $this->bindUsername = $params['bindUsername'];\n if(array_key_exists('bindPassword', $params)) $this->bindPassword = $params['bindPassword'];\n if(array_key_exists('baseDN', $params)) $this->baseDN = $params['baseDN'];\n }\n $ldapConnection = ldap_connect($this->ldapServer, $this->ldapServerPort);\n if($ldapConnection === FALSE){\n errorHandle::newError(__METHOD__.'() - Failed to open LDAP connection. '.ldap_errno($ldapConnection).':'.ldap_error($ldapConnection), errorHandle::HIGH);\n return NULL;\n }else{\n ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($ldapConnection, LDAP_OPT_REFERRALS, 0);\n return $ldapConnection;\n }\n }",
"public function get_ldap_handle()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (is_null($this->config['base_dn']))\n $this->_load_config();\n\n $read_config['protocol'] = 'ldap';\n $read_config['base_dn'] = $this->config['base_dn'];\n $read_config['bind_dn'] = $this->config['bind_dn'];\n $read_config['bind_pw'] = $this->config['bind_pw'];\n $read_config['bind_host'] = '127.0.0.1';\n\n $mode = $this->get_mode();\n\n if ($mode === self::MODE_SLAVE) {\n $write_config['base_dn'] = $this->config['base_dn'];\n $write_config['bind_dn'] = $this->get_syncuser_dn();\n $write_config['bind_pw'] = $this->config['sync_key'];\n $write_config['bind_host'] = $this->config['master_hostname'];\n $write_config['protocol'] = 'ldaps';\n } else {\n $write_config = $read_config;\n }\n\n // TODO: revisit hack\n if (file_exists('/var/clearos/samba_directory/ldap.conf')) {\n $read_config['protocol'] = 'ldaps';\n $write_config['protocol'] = 'ldaps';\n }\n\n $ldaph = new LDAP_Client($read_config, $write_config);\n\n return $ldaph;\n }",
"public function getConnection()\n {\n return $this->ldapConnection;\n }",
"function connect($arguments)\n\t{\n\t\t$options = array();\n\t\t// $options['account_suffix'] = '';\n\t\t$options['base_dn'] = $arguments['base_dn'];\n\t\t$options['domain_controllers'] = array($arguments['server_name']);\n\t\t \n\t\tif (isset($arguments['admin_username'])) {\n\t\t\t$options['ad_username'] = $arguments['admin_username'];\n\t\t}\n\t\tif (isset($arguments['admin_password'])) {\n\t\t\t$options['ad_password'] = $arguments['admin_password'];\n\t\t}\n\t\t$options['use_ssl'] = true;\n\t\t$this->ad = new adLDAP($options);\n\n \tif ($this->ad == NULL) {\n \t\treturn FALSE;\n \t} else {\n \t\treturn TRUE;\n \t}\n }",
"private function directory_connect ($authparams) {\n # adLDAP script\n\trequire_once(dirname(__FILE__) . \"/../adLDAP/src/adLDAP.php\");\n $dirparams = Array();\n $dirparams['base_dn'] = @$authparams['base_dn'];\n $dirparams['ad_port'] = @$authparams['ad_port'];\n $dirparams['account_suffix'] = @$authparams['account_suffix'];\n $dirparams['domain_controllers'] = explode(\";\", str_replace(\" \", \"\", $authparams['domain_controllers']));\n // set ssl and tls separate for ldap and AD\n if ($this->ldap) {\n // set ssl and tls\n $dirparams['use_ssl'] = false;\n $dirparams['use_tls'] = false;\n // Support the pre-1.2 auth settings as well as the current version\n // TODO: remove legacy support at some point\n if ($authparams['ldap_security'] == 'tls' || $authparams['use_tls'] == 1) { $dirparams['use_tls'] = true; }\n elseif ($authparams['ldap_security'] == 'ssl' || $authparams['use_ssl'] == 1) { $dirparams['use_ssl'] = true; }\n if (isset($authparams['admin_username']) && isset($authparams['admin_password'])) {\n $dirparams['admin_username'] = $authparams['adminUsername'];\n $dirparams['admin_password'] = $authparams['adminPassword'];\n }\n }\n else {\n $dirparams['use_ssl'] = @$authparams['use_ssl'];\n $dirparams['use_tls'] = @$authparams['use_tls'];\n }\n # open connection\n try {\n # Initialize adLDAP\n $dirconn = new adLDAP($dirparams);\n } catch (adLDAPException $e) {\n $this->Log->write( _(\"Directory connection error\"), _(\"Failed to connect\").\": \" . $e->getMessage(), 2, null);\n $this->Result->show(\"danger\", _(\"Error: \") . $e->getMessage(), true);\n }\n return $dirconn;\n }",
"function __construct()\n {\n\n $config = new \\Adldap\\Connections\\Configuration();\n $config->setAccountSuffix(\\Registry::get('_config')['ad']['account_suffix']);\n $config->setDomainControllers(explode(\",\",str_replace(\" \", '', \\Registry::get('_config')['ad']['domain_controllers'])));\n $config->setBaseDn(\\Registry::get('_config')['ad']['base_dn']);\n $config->setAdminUsername(\\Registry::get('_config')['ad']['admin_username']);\n $config->setAdminPassword(\\Registry::get('_config')['ad']['admin_password']);\n\n $this->ad = new \\Adldap\\Adldap($config);\n //$this->ad = new \\Adldap\\Connections\\Provider($config);\n }",
"public static function newInstance() {\n return new self(\n \\ConfigIgestisGlobalVars::ldapUri(),\n \\ConfigIgestisGlobalVars::ldapBaseDn(),\n \\ConfigIgestisGlobalVars::ldapAdmin(),\n \\ConfigIgestisGlobalVars::ldapPassword(),\n \\ConfigIgestisGlobalVars::ldapUserFilter()\n );\n }",
"function ldap_connect_ex() {\r\tglobal $CBT_config;\r\r\t$connection = ldap_connect($CBT_config['ldap_host'], $CBT_config['ldap_port']);\r\tldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);\r\r\treturn $connection;\r}",
"public function __construct()\n\t{\n\t\t$this->host \t= config('laravel_simple_ldap.ldap_host');\n\t\t$this->port\t\t= config('laravel_simple_ldap.ldap_port');\n\t\t$this->userRDN = config('laravel_simple_ldap.ldap_user_rdn');\n\t\t$this->baseDN \t= config('laravel_simple_ldap.ldap_base_dn');\n\t\t$this->passwd \t= config('laravel_simple_ldap.ldap_password');\t\t\n\t}",
"public function __construct($server, $dn)\n {\n $this->server = $server;\n $this->dn = $dn;\n $this->ldap = ldap_connect($this->server);\n }",
"public function __construct($server, $domain) \n {\n $this->connection = ldap_connect($server);\n $this->baseDn = 'dc='.strtr($domain, array('.' => ',dc=')); // foo.example.com -> dc=foo,dc=example,dc=com\n $this->baseDomain = $domain;\n }"
] | [
"0.7339997",
"0.7082611",
"0.7002466",
"0.7001601",
"0.69952554",
"0.68927395",
"0.68498325",
"0.6776045",
"0.67200744",
"0.66579145",
"0.665614",
"0.6643112",
"0.6603017",
"0.6574375",
"0.646932",
"0.64430344",
"0.64329773",
"0.6432306",
"0.64261794",
"0.6425742",
"0.64204586",
"0.62339103",
"0.6180307",
"0.6147941",
"0.6123398",
"0.60744554",
"0.6027407",
"0.6022314",
"0.599629",
"0.58980703"
] | 0.7189537 | 1 |
Replaces parameter tokens with filter arguments (for instance, array(':foo' => 'bar') will replace occurrences of ':foo' with the text 'bar'. | private static function _replaceFilterArgs($filter, $filterArgs)
{
$filteredSearch = $filter;
foreach ($filterArgs as $paramKey => $paramValue)
{
$filteredParamValue = preg_replace('#[^\\w *]#', '', $paramValue);
$filteredSearch = preg_replace('%' . $paramKey . '%', $filteredParamValue, $filteredSearch);
}
return $filteredSearch;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function replaceFilterParams(string $sql, array &$values) : string {\n $finalValues = [];\n foreach($values as $k=>$v) {\n if(strpos($k, $sql)) {\n $sql = str_replace($k, '?', $sql);\n $finalValues[] = $v;\n }\n }\n $values = $finalValues;\n return $sql;\n }",
"private function replaceParams($replace)\n {\n return preg_replace_callback($replace, [$this, 'paramMatch'], $this->path);\n }",
"public function tokenReplaceFilter($text) {\n return \\Drupal::token()->replace($text);\n }",
"protected function replace($filter, $content, $token, $flags = [], $options = [])\n {\n $class = \\App::make($filter['class']);\n\n $replace = '';\n if ($string = $class->{$filter['method']}($content, $token, $flags, $options)) {\n $replace = $string;\n }\n\n return str_replace($token, $replace, $content);\n }",
"private function processParams($translation, $params)\n {\n foreach ($params as $param => $value) {\n $translation = str_replace(':' . $param, $value, $translation);\n }\n\n return $translation;\n }",
"function token_replace( $key, $value, $string ) {\n\n $string = str_replace( '[[' . $key . ']]', $value, $string );\n $string = str_replace( '[[' . $key . '|urlencode]]', urlencode( $value ), $string );\n\n if ( function_exists( 'filter_var' ) ) {\n $string = str_replace( '[[' . $key . '|html]]', filter_var( $value, FILTER_SANITIZE_FULL_SPECIAL_CHARS ), $string );\n } else {\n $string = str_replace( '[[' . $key . '|html]]', htmlentities( $value, ENT_QUOTES ), $string );\n }\n\n return $string;\n}",
"private function replaceForFilter($a)\n {\n if (strpbrk($a, '?')) {\n $filterType = substr($a, strpos($a, ':') + 1, -2);\n return $a = str_replace($a, $this->filter[$filterType], $a);\n } elseif (strpbrk($a, ':') && !strpbrk($a, '?')) {\n $filterType = substr($a, strpos($a, ':') + 1, -1);\n return $a = str_replace($a, $this->filter[$filterType], $a);\n } elseif (strpbrk($a, '(')) {\n return $a = str_replace($a, $this->filter['any'], $a);\n }\n\n return $a;\n\n }",
"function lingotek_filter_placeholders($segment_text, $protect_vars = FALSE) {\n // NOTE: This regex is only a generalization of the variable names possible using\n // the t-function's variable interpolation. This finds all sets of word\n // characters (A-Z, a-z, - or _) that begin with either !, @, or %, that do not\n // fall between angle brackets (which would indicate being on the inside\n // of an HTML tag). It also protects everything inside square brackets\n // that do not fall inside angle brackets.\n $patterns = array(\n '/(\\[[!@%\\w:=\\/\\s_-]+\\]\\s*)(?![^<]*\\>)/', // wrap everything in square brackets\n );\n if ($protect_vars) {\n $patterns[] = '/([!@%][\\w_-]+\\s*)(?![^<]*\\>)/'; // wrap everything beginning with !,@,%\n }\n // Provide the ability to modify the pattern for searching variables.\n drupal_alter('lingotek_protect_variables', $patterns, $protect_vars);\n\n $replacement = '<drupalvar>${1}</drupalvar>';\n\n foreach ($patterns as $p) {\n $segment_text = preg_replace($p, $replacement, $segment_text);\n }\n return $segment_text;\n}",
"private function _substituteParams($params)\n\t{\n\t\tif (isset($this->replace_array)) {\n\t\t\t$replace = $this->replace_array;\n\t\t} else {\n\t\t\t$replace = $this->replace_array = $this->_buildReplaceArray();\n\t\t}\n\t\tif (count($replace)>0) {\n\t\t\t\n\t\t\t//field names have to be escaped before they can be used in the preg below\n\t\t\t$replace_for_preg = array();\n\t\t\tforeach ($replace as $field => $value) {\n\t\t\t\t$replace_for_preg[preg_quote($field)] = is_array($value)?'array':$value;\n\t\t\t}\n\t\t\t$preg = '^(' . implode('|', array_keys($replace_for_preg)) . ')^';\n\t\t\tforeach ($params as $key => $val) {\n\t\t\t\tif (preg_match_all($preg, $val, $matches)) {\n\t\t\t\t\t$params[$key . '_fields'] = $matches[1];\n\t\t\t\t\tif (count($matches[1])==1 && isset($replace[$matches[1][0]])) {\n\t\t\t\t\t\t$params[$key] = $replace[$matches[1][0]];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params[$key] = str_replace(array_keys($replace), $replace_for_preg, $val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $params;\n\t}",
"public function testShortNameWithValueSetSpaceCapturesMultipleInstanceOfParameter() {\n $argv = explode(\" \", './test.php -x me -x you -x them');\n\n $argFilter = new \\Clapp\\CommandArgumentFilter($this->defaultDefinition, $argv);\n\n $this->assertEquals(sizeof($argFilter->getParam('x')), 3);\n $this->assertEquals(sizeof($argFilter->getParam('exclude')), 3);\n\n $this->assertEquals($argFilter->getParam('x')[2], \"them\");\n $this->assertEquals($argFilter->getParam('exclude')[2], \"them\");\n\n }",
"public function testShortNameWithValueSetWithEqualSignCapturesMultipleInstanceOfParameter() {\n $argv = explode(\" \", './test.php -x=me -x=you -x=them');\n\n $argFilter = new \\Clapp\\CommandArgumentFilter($this->defaultDefinition, $argv);\n\n $this->assertEquals(sizeof($argFilter->getParam('x')), 3);\n $this->assertEquals(sizeof($argFilter->getParam('exclude')), 3);\n\n $this->assertEquals($argFilter->getParam('x')[2], \"them\");\n $this->assertEquals($argFilter->getParam('exclude')[2], \"them\");\n\n }",
"public function getParameter($name, $filter = FILTER_SANITIZE_STRING);",
"public function replace();",
"public function filter($parameters, $term)\n {\n foreach ($parameters as $key => $value) {\n if (preg_match('/'.$term.'/i', $key)) {\n $parameters[$key] = '[PROTECTED]';\n\n } elseif (is_array($value)) {\n $parameters[$key] = $this->filter($value, $term);\n }\n }\n\n return $parameters;\n }",
"public function replace(array $parameters = array())\n {\n $this->parameters = $parameters;\n }",
"function cotpl_callback_replace(&$arg, $i, $val)\n{\n\tif (mb_strpos($arg, '$this') !== FALSE)\n\t{\n\t\tif (is_array($val) || is_object($val))\n\t\t{\n\t\t\t$arg = $val;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arg = str_replace('$this', (string)$val, $arg);\n\t\t}\n\t}\n}",
"public function testLongNameWithValueSetWithEqualSignCapturesMultipleInstanceOfParameter() {\n $argv = explode(\" \", './test.php --exclude=me --exclude=you --exclude=them');\n\n $argFilter = new \\Clapp\\CommandArgumentFilter($this->defaultDefinition, $argv);\n\n $this->assertEquals(sizeof($argFilter->getParam('x')), 3);\n $this->assertEquals(sizeof($argFilter->getParam('exclude')), 3);\n\n $this->assertEquals($argFilter->getParam('x')[2], \"them\");\n $this->assertEquals($argFilter->getParam('exclude')[2], \"them\");\n\n }",
"public function testLongNameWithValueSetSpaceCapturesMultipleInstanceOfParameter() {\n $argv = explode(\" \", './test.php --exclude me --exclude you --exclude them');\n\n $argFilter = new \\Clapp\\CommandArgumentFilter($this->defaultDefinition, $argv);\n\n $this->assertEquals(sizeof($argFilter->getParam('x')), 3);\n $this->assertEquals(sizeof($argFilter->getParam('exclude')), 3);\n\n $this->assertEquals($argFilter->getParam('x')[2], \"them\");\n $this->assertEquals($argFilter->getParam('exclude')[2], \"them\");\n\n }",
"private function updateArguments(array $values, ParameterBagInterface $parameterBag)\n {\n foreach ($values as $key => $value) {\n if ($value instanceof Definition) {\n $this->updateDefinitionArguments($value, $parameterBag);\n\n continue;\n }\n\n if ($value instanceof Parameter && isset($this->parameterExpressions[(string) $value])) {\n $values[$key] = new Expression($this->parameterExpressions[(string) $value]);\n\n continue;\n }\n\n if (is_array($value)) {\n $values[$key] = $this->updateArguments($value, $parameterBag);\n\n continue;\n }\n\n if (!is_string($value)) {\n continue;\n }\n\n $tmpValue = $this->resolveArrayOrNull($value, $parameterBag);\n if ($this->isArrayWithDynamicParametersInside($tmpValue, $parameterBag)) {\n $values[$key] = $this->updateArguments($tmpValue, $parameterBag);\n continue;\n }\n\n $value = $this->flattenParameterValueToClosestDynamicParameters($value, $parameterBag);\n\n foreach ($this->parameterExpressions as $parameterName => $expression) {\n $value = str_replace('${' . $parameterName . '}', '%' . $parameterName . '%', $value);\n }\n\n // Argument with parameters\n if (preg_match_all('/%%|%([^%\\s]+)%/', $value, $match)) {\n $parameters = array_filter($match[1]);\n\n // Do not replace argument if there are no dynamic parameters inside\n if (!array_intersect($parameters, array_keys($this->parameterExpressions))) {\n continue;\n }\n\n // Next two preg_replace_callback calls are transforming argument string like \"%foo%-text-%bar%\"\n // into expression like \"dynamic_parameter('foo', 'SYMFONY_FOO')~'-text-'~static_parameter('bar')\"\n // see use cases in ParameterReplacementPassTest::examplesOfConcatenatedDynamicParameters\n $tmpValue = preg_replace_callback(\n '/(?P<text>.*?)(?:(?P<parameter>%(?:' . join('|', array_map('preg_quote', $parameters)) . ')%)|$)/',\n function ($match) {\n if (!$match['text']) {\n return $match[0];\n }\n\n return str_replace($match['text'], '\\'' . $match['text'] . '\\'~', $match[0]);\n },\n $value\n );\n\n $parameterExpressions = $this->parameterExpressions;\n $tmpValue = preg_replace_callback(\n '/%%|%([^%\\s]+)%/',\n function ($match) use ($parameterExpressions) {\n // skip %%\n if (!isset($match[1])) {\n return $match[0];\n }\n\n $parameter = $match[1];\n\n $expression = isset($parameterExpressions[$parameter]) ?\n $parameterExpressions[$parameter] :\n sprintf('static_parameter(%s)', var_export($parameter, true));\n\n return str_replace('%' . $parameter . '%', $expression . '~', $match[0]);\n },\n $tmpValue\n );\n $tmpValue = substr($tmpValue, 0, -1);// remove trailing ~\n $tmpValue = str_replace('%%', '%', $tmpValue);// un-escape % in expression string\n $values[$key] = new Expression($tmpValue);\n continue;\n }\n }\n\n return $values;\n }",
"public function setFilters()\n\t{\n\t\t$filters =& $this->conf('filters');\n\t\t$filters = (array) @func_get_args();\n\t}",
"private function _replaceMessageParameters() {\n\t\t$pattern = \"/%[A-Za-z0-9]+((\\-|\\_)[A-Za-z0-9]+)*%/\";\n\t\tforeach ($this->_parameters as $key => $value) {\n\t\t\tif (preg_match($pattern, \"%\".$key.\"%\")) {\n\t\t\t\t$this->_message = preg_replace(\"/%\".$key.\"%/\", $value, $this->_message);\n\t\t\t} else {\n\t\t\t\t$this->_errorMessage = \"Parameter with wrong syntax\";\n\t\t\t}\n\t\t}\n\t\tif ( preg_match($pattern, $this->_message) ) {\n\t\t\t$this->_errorMessage = \"Tag from template not filled\";\n\t\t\treturn false;\n\t\t}\n\t\treturn true; \n\t}",
"public function replace(array $parameters = [])\n {\n $this->parameters = $parameters;\n }",
"private function replacePlaceholdersInMessage()\n\t{\n\t\tif (($count = preg_match_all(\"/%(\\d+)%/\", $this->messageString, $matches)) == FALSE)\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tforeach ($matches[1] as $match)\n\t\t{\n\t\t\t// This is the subpattern in $matchArray[1] which has the arg index.\n\t\t\t$num = trim($match);\n\t\t\t$patterns[] = \"/%$num%/\" ;\n\t\t\t$replacements[] = $this->messageArgs[$num];\n\t\t}\n\t\t\n\t\t$this->messageString = preg_replace($patterns, $replacements, $this->messageString);\n\t}",
"protected function _filterParameters( $allowedParameters )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\t$safeParameters = array( );\r\n\r\n\t\t$unsafeParameters = array( );\r\n\t\t$unsafeParameters += $this->rawParameters[ 'GET' ];\r\n\t\t$unsafeParameters += $this->rawParameters[ 'POST' ];\r\n\t\t$unsafeParameters += $this->rawParameters[ 'COOKIE' ];\r\n\r\n\t\tforeach ( $allowedParameters as $parametername => $parameterdefinition )\r\n\t\t{\r\n\t\t\tif ( $this->_checkParameter( $parametername, $parameterdefinition ) )\r\n\t\t\t{\r\n\t\t\t\t$safeParameters[ $parametername ] = $this->rawParameters[ $parameterdefinition[ 'source' ] ][ $parametername ];\r\n\r\n\t\t\t\t// strip slashes\r\n\t\t\t\tif ( ( !empty( $parameterdefinition[ 'stripslashes' ] ) ) && ( $parameterdefinition[ 'stripslashes' ] == 'true' ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_array( $safeParameters[ $parametername ] ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ( $safeParameters[ $parametername ] as $key => $value )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$safeParameters[ $parametername ][ $key ] = stripslashes( $value );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$safeParameters[ $parametername ] = stripslashes( $safeParameters[ $parametername ] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// escape parameter\r\n\t\t\t\tif ( ( !empty( $parameterdefinition[ 'escape' ] ) ) && ( $parameterdefinition[ 'escape' ] == 'true' ) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_array( $safeParameters[ $parametername ] ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ( $safeParameters[ $parametername ] as $key => $value )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$safeParameters[ $parametername ][ $key ] = mysql_real_escape_string( $value );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$safeParameters[ $parametername ] = mysql_real_escape_string( $safeParameters[ $parametername ] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tunset( $unsafeParameters[ $parametername ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->objects->storeObject( 'unsafeParameters', $unsafeParameters );\r\n\r\n\t\t$this->debug->unguard( $safeParameters );\r\n\t\treturn $safeParameters;\r\n\t}",
"function match_filters(&$text,&$res) {\n\t//%##\\d++@ then a number of |text{...} or |text} or |text) or |text\n\twhile(preg_match(\"@%##(\\d++)\\@((?:\\s*+\\|{1,2}+[^][(){}]++(?:(?:\\{[^][{}]*+\\})|(?=[})]|$)))++)@s\",$text,$reg)) {\n\t\t//1: num token\n\t\t//2: filters\n\t\t$res[$reg[1]][1]->fonctions = trim($reg[2]);\n\t\t//do not add a new resource; just store the fonctions in the field\n\t\t//this will delete the filter from the parent token\n\t\t$text = substr_replace($text,\"%##\".$reg[1].\"@\",strpos($text,$reg[0]),strlen($reg[0]));\n\t}\n\treturn $text;\n}",
"function replace(...$args) {\n $replace = curry(function($search, $replace, $subject) {\n return str_replace($search, $replace, $subject);\n });\n\n return call_user_func_array($replace, $args);\n}",
"private function executeParameters($translation, $parameters)\n {\n foreach($parameters as $valueToFind => $output) {\n $translation = str_replace(':' . $valueToFind, $output, $translation);\n }\n\n return $translation;\n }",
"function replace_params ($inputvalues, $sql)\n\t {\n\t $lastplace = 1; //Mustn't go back in the replace\n\t for ($i = 1; $i < sizeof($inputvalues); $i++)\n {\n $tryme = $inputvalues[$i];\n $inputvalues[$i] = str_replace (\"'\", \"''\", $inputvalues[$i]); //some strings have single ' which make it break on replacing!\n $inputvalues[$i] = \"'\".$inputvalues[$i].\"'\";\n\t \n\t\t $lastpos = 1;\n\n \t\twhile ($lastpos <> 0)\n \t\t{\n \t\t $lastpos = strpos ($sql, \"?\", $lastplace);\n \t\t if ($lastpos == \"\") break; //This checks that lastpos\n if ($sql[$lastpos-1] != \"<\" || $sql[$lastpos+1] != \">\")\n {\n $sql = substr_replace($sql, $inputvalues[$i], $lastpos, 1);\n $lastplace = $lastpos+strlen($inputvalues[$i]);\n } \n \t\t $lastpos = 0;\n \t\t}\n \t\t$count++;\n \t}\n\t return $sql; \t\t \n }",
"public function filter($filter_param);",
"function makeReplaceQuery($table, $columns, $tokens);"
] | [
"0.63507116",
"0.56188005",
"0.5603622",
"0.55642164",
"0.554527",
"0.55039877",
"0.5501778",
"0.5478712",
"0.54031634",
"0.5363102",
"0.5358166",
"0.5260046",
"0.5257697",
"0.52448523",
"0.524256",
"0.52352756",
"0.5216863",
"0.5212866",
"0.51956797",
"0.51815957",
"0.5160528",
"0.5140651",
"0.5133363",
"0.512444",
"0.50918406",
"0.50225043",
"0.499832",
"0.4996228",
"0.49897793",
"0.49839583"
] | 0.6002557 | 1 |
Signals that a Watermark was added to the Document. | public function add(Watermark $watermark); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onSaved()\n {\n if ((!isset($this->shouldTrace) || $this->shouldTrace)\n && $this->updating\n ) {\n $this->createPaperTrails();\n }\n }",
"public function addWaterMark($waterMarkPath)\n {\n $stamp = $this->openImage($waterMarkPath) ;\n\n// Set the margins for the stamp and get the height/width of the stamp image\n $marge_right = 5 ;\n $marge_bottom = 5 ;\n $sx = imagesx($stamp) ;\n $sy = imagesy($stamp) ;\n \n //\\f\\pre('ok');\n\n// Copy the stamp image onto our photo using the margin offsets and the photo \n// width to calculate positioning of the stamp. \n $this->editedImage = $this->image ;\n imagecopy($this->editedImage, $stamp,\n imagesx($this->editedImage) - $sx - $marge_right,\n imagesy($this->editedImage) - $sy - $marge_bottom, 0,\n 0, imagesx($stamp), imagesy($stamp)) ;\n\n// Output and free memory\n }",
"public function markNew();",
"public function afterAdd();",
"public function checkpoint(object $document): void;",
"public function on_insert() {}",
"public function addPlaceMarking(PlaceMarkingInterface $marking);",
"public function postHeaderEvent() {\n\t\t\tcreateDocumentLink();\n\t\t}",
"public function onSaving()\n {\n if (!isset($this->shouldTrace) || $this->shouldTrace) {\n $this->originalTrail = $this->original;\n $this->updatedTrail = $this->attributes;\n $this->updating = $this->exists;\n }\n }",
"public function onBeforeWrite()\n {\n parent::onBeforeWrite();\n }",
"public function onBeforeWrite() {\n\t\tparent::onBeforeWrite();\n\t}",
"protected function beforesaved()\r\n\t{\r\n\t\tif (!$this->id)\r\n\t\t\t$this->newlyCreated = true;\r\n\t}",
"public function onBeforeWrite()\n {\n parent::onBeforeWrite();\n\n $this->audit();\n }",
"public function putMark(Mark $mark)\n {\n $this->mark = $mark;\n $this->notify();\n }",
"public function add()\n {\n $msg = JText::_('COM_PARKWAY_POST_ADDED');\n $this->setRedirect('index.php?option=com_parkway', $msg);\n }",
"public function save()\n {\n //todo save comments\n $this->notify();\n }",
"function add_note()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($_POST)) {\n\t\t\t# Upload the file before you proceed with the rest of the process\n\t\t\tif(!empty($_FILES['document__fileurl'])) $fileUrl = upload_file($_FILES, 'document__fileurl', 'document_', 'pdf,doc,docx,jpeg,jpg,tiff');\n\t\t\t$_POST['document'] = !empty($fileUrl)? $fileUrl: \"\";\n\t\t\t$result = $this->_contract->add_note($_POST);\n\t\t\t\n\t\t\t# do not go away from the current list but show a message\n\t\t\tif(!$result['boolean']) echo \"ERROR: The note could not be added. \".$result['reason'];\n\t\t}\n\t\t# a message area\n\t\telse if(!empty($data['a'])) {\n\t\t\t$data['msg'] = 'The note has been added. Click below to refresh the list.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['contract'] = $this->_contract->details($data['d']);\n\t\t\t$this->load->view('contracts/new_note', $data);\n\t\t}\n\t}",
"protected function onBeforeWrite() {\n\t\t// attached to this object in a text column so it can be indexed.\n\t\t$this->KeywordsText = implode(', ', $this->Keywords()->map());\n\n\t\tif ($this->TypeID) {\n\t\t\t$this->KeywordsText = $this->KeywordsText . ', ' . $this->Type()->Title;\n\t\t}\n\n\t\tparent::onBeforeWrite();\n\t}",
"public function addMarker($content) \n {\n $this->appendPreScript($this->getProperty(\"marker\", $content, \"\", true));\n }",
"public function add_bookmark()\n { \n $this->labcast_model->bookmarks( array(\n 'post_id' => $this->input->get('id'),\n 'user_id' => $this->session->user_id,\n 'type' => 'labcast',\n )); \n redirect('labcast');\n }",
"public function afterSave(): void;",
"public function save() {\n $this->notify('database.save');\n }",
"public function ElementAdded( $definition ){\r\n\t\t// Store in alias lookup\r\n\t\tif( $definition->alias ){\r\n\t\t\tif( !$this->alias_lookup ){\r\n\t\t\t\t$this->alias_lookup = new \\stdClass;\r\n\t\t\t}\r\n\t\t\t$this->alias_lookup->{ $definition->alias } = $definition;\r\n\t\t}\r\n\t\t// Notify parent\r\n\t\tif( $this->parent ){\r\n\t\t\t$this->parent->ElementAdded( $definition );\r\n\t\t}\r\n\t}",
"public function document() {\n $this->category = \"DOCUMENT\";\n }",
"function isTextAdded() {\n return ($this->_text_added) ? true : false;\n }",
"function record($update = FALSE) {\n if (!$this->eid || $update) {\n drupal_write_record('notifications_event', $this, $this->eid ? 'eid' : array());\n }\n }",
"public function addWatermark(FileUploadEvent $event)\n {\n $uploadedFile = $event->getUploadedFile();\n\n if (Image::isSupportedExtension($uploadedFile->getExtension()) && $uploadedFile->isValidImage()) {\n $uploadedImage = Image::create($uploadedFile->getContents());\n $uploadedImageGD = $uploadedImage->getGDImage();\n\n $watermarkImagePath = $this->app['config']->get('ImageWatermark.imagePath');\n\n if (Image::isSupportedExtension(pathinfo($watermarkImagePath, PATHINFO_EXTENSION))) {\n $watermarkImage = Image::create(file_get_contents($watermarkImagePath));\n $watermarkImageGD = $watermarkImage->getGDImage();\n\n // Calculate position\n list($dstX, $dstY) = $this->calculatePosition($uploadedImage->getWidth(), $uploadedImage->getHeight(), $watermarkImage->getWidth(), $uploadedImage->getHeight());\n\n imagecopy($uploadedImageGD, $watermarkImageGD, $dstX, $dstY, 0, 0, $watermarkImage->getWidth(), $watermarkImage->getHeight());\n\n $uploadedFile->setContents($uploadedImage->getData());\n\n unset($watermarkImage);\n }\n\n unset($uploadedImage);\n }\n }",
"public function store(Request $request)\n {\n //\n\n // $chk_type = $request['text_text'];\n \n // header(\"Content-type: application/vnd.ms-word\");\n // header(\"Content-Disposition: attachment;Filename=\".rand().\".doc\");\n // header(\"Pragma: no-cache\");\n // header(\"Expires: 0\");\n\n // echo $request['text_text'];\n\n // Creating the new document...\n $phpWord = new \\PhpOffice\\PhpWord\\PhpWord();\n\n /* Note: any element you append to a document must reside inside of a Section. */\n\n // Adding an empty Section to the document...\n $section = $phpWord->addSection();\n $chk_type = $request['text_text'];\n\n // Adding Text element to the Section having font styled by default...\n $section->addText($request[\"text_text\"]);\n\n // Saving the document as HTML file...\n $objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($phpWord, 'Word2007');\n $objWriter->save('helloWorld.docx');\n\n alert()->success('Yes, it got here')->autoclose(4000);\n return redirect()->back();\n }",
"function eventclass_pdf()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"public static function published($callback)\n {\n static::registerModelEvent('published', $callback);\n }"
] | [
"0.5541973",
"0.5295295",
"0.52464896",
"0.49908417",
"0.492772",
"0.48362473",
"0.48136532",
"0.47711486",
"0.47539136",
"0.47533667",
"0.47513828",
"0.4744563",
"0.46985233",
"0.465822",
"0.46389928",
"0.4632962",
"0.46300337",
"0.46046084",
"0.45824707",
"0.45571172",
"0.4557057",
"0.45523652",
"0.45516488",
"0.45500815",
"0.454387",
"0.45435882",
"0.45071286",
"0.44956177",
"0.44893506",
"0.44825134"
] | 0.6057844 | 0 |
Parameter that allows you to do margin mirroring (odd/even pages) | public function setMarginMirroring($marginMirroring); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMirrorMargins() {\t \r\n\t $this->mirrorMargins = true;\r\n\t}",
"public function margin($margin);",
"function setOddEvenDifferent() {\t \r\n\t \t$this->oddEvenDifferent = 1;\t \r\n\t}",
"function bootstrap_dss_digital_pager($variables) {\n\n $output = \"\";\n $tags = $variables['tags'];\n $element = $variables['element'];\n $parameters = $variables['parameters'];\n $quantity = $variables['quantity'];\n\n global $pager_page_array, $pager_total;\n\n // Calculate various markers within this pager piece:\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil($quantity / 2);\n // current is the page we are currently paged to\n $pager_current = $pager_page_array[$element] + 1;\n // first is the first page listed by this pager piece (re quantity)\n $pager_first = $pager_current - $pager_middle + 1;\n // last is the last page listed by this pager piece (re quantity)\n $pager_last = $pager_current + $quantity - $pager_middle;\n // max is the maximum page number\n $pager_max = $pager_total[$element];\n // End of marker calculations.\n\n // Prepare for generation loop.\n $i = $pager_first;\n if ($pager_last > $pager_max) {\n // Adjust \"center\" if at end of query.\n $i = $i + ($pager_max - $pager_last);\n $pager_last = $pager_max;\n }\n if ($i <= 0) {\n // Adjust \"center\" if at start of query.\n $pager_last = $pager_last + (1 - $i);\n $i = 1;\n }\n\n\n /**\n * Interval of 1\n *\n */\n\n // End of generation loop preparation.\n // First\n $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('|<')), 'element' => $element, 'parameters' => $parameters));\n // Interval of 10\n $li_previous_set = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('<<')), 'element' => $element, 'interval' => 10, 'parameters' => $parameters));\n // Interval of 1\n $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('<')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n\n // Interval of 1\n $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('>')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n // Interval of 10\n $li_next_set = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('>>')), 'element' => $element, 'interval' => 10, 'parameters' => $parameters));\n $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('>|')), 'element' => $element, 'parameters' => $parameters));\n\n /**\n * Replacing the functionality for handling the theming of individual pagination controls\n * (Some of these are disabled or hidden within the bootstrap theme)\n *\n */\n\n if ($pager_total[$element] > 1) {\n\n if ($li_first) {\n $items[] = array(\n 'class' => array('pager-first'),\n 'data' => $li_first,\n );\n }\n\n if ($li_previous_set) {\n $items[] = array(\n\t\t 'class' => array('prev'),\n\t\t 'data' => $li_previous_set,\n\t\t );\n }\n\n if ($li_previous) {\n $items[] = array(\n\t\t 'class' => array('prev'),\n\t\t 'data' => $li_previous,\n\t\t );\n }\n\n // When there is more than one page, create the pager list.\n if ($i != $pager_max) {\n\n // Prepend the ellipsis\n if ($i > 1) {\n $items[] = array(\n 'class' => array('pager-ellipsis', 'disabled'),\n 'data' => '<span>…</span>',\n );\n }\n // Now generate the actual pager piece.\n for (; $i <= $pager_last && $i <= $pager_max; $i++) {\n\n if ($i < $pager_current) {\n $items[] = array('class' => array('pager-item'),\n\t\t\t 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)),\n\t\t\t );\n }\n\n if ($i == $pager_current) {\n $items[] = array(\n\t\t\t //'class' => array('active'), // Add the active class\n\t\t\t /**\n\t\t\t * For styling the active pagination element\n\t\t\t * This resolves DSSSM-513\n\t\t\t *\n\t\t\t */\n\t\t\t 'class' => array('pager-item', 'pager-current'), // Add the active class\n\t\t\t 'data' => l($i, '#', array('fragment' => '','external' => TRUE)),\n\t\t\t );\n }\n\n if ($i > $pager_current) {\n\n $items[] = array(\n //'class' => array('pager-item'),\n 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)),\n );\n }\n }\n\n if ($i < $pager_max) {\n $items[] = array(\n 'class' => array('pager-ellipsis', 'disabled'),\n 'data' => '<span>…</span>',\n );\n }\n }\n // End generation.\n\n if ($li_next) {\n\n $items[] = array(\n 'class' => array('next'),\n 'data' => $li_next,\n );\n }\n\n if ($li_next_set) {\n\n $items[] = array(\n 'class' => array('next'),\n 'data' => $li_next_set,\n );\n }\n\n if ($li_last) {\n $items[] = array(\n 'class' => array('pager-last'),\n 'data' => $li_last,\n );\n }\n\n return '<div class=\"pagination pagination-centered\">'. theme('item_list', array(\n 'items' => $items,\n //'attributes' => array('class' => array('pager')),\n )) . '</div>';\n }\n\n return $output;\n}",
"function mirror(){\n\n\t\t$bottom = floor(($this->Mirror[3] / 100) * $this->thumby) + $this->Mirror[4];\n\t\t$this->newimage = imagecreatetruecolor($this->thumbx, $this->thumby + $bottom);\n\t\timagefilledrectangle($this->newimage, 0, 0, $this->thumbx, $this->thumby + $bottom, imagecolorallocate($this->newimage, hexdec(substr($this->Backgroundcolor, 1, 2)), hexdec(substr($this->Backgroundcolor, 3, 2)), hexdec(substr($this->Backgroundcolor, 5, 2))));\n\t\timagecopy($this->newimage, $this->thumb, 0, 0, 0, 0, $this->thumbx, $this->thumby);\n\t\timagedestroy($this->thumb);\n\t\t$this->thumb = imagecreatetruecolor($this->thumbx, $this->thumby + $bottom);\n\t\timagecopy($this->thumb, $this->newimage, 0, 0, 0, 0, $this->thumbx, $this->thumby + $bottom);\n\t\timagedestroy($this->newimage);\n\t\t$this->thumbx = imagesx($this->thumb);\n\t\t$this->thumby = imagesy($this->thumb);\n\t\tfor($px = 0; $px < $this->thumbx; $px++){\n\t\t\tfor($py = $this->thumby - ($bottom * 2) + $this->Mirror[4]; $py < ($this->thumby - $bottom); $py++){\n\t\t\t\timagecopy($this->thumb, $this->thumb, $px, $this->thumby - ($py - ($this->thumby - ($bottom * 2))) - 1 + $this->Mirror[4], $px, $py, 1, 1);\n\t\t\t}\n\t\t}\n\t\t$this->newimage = imagecreatetruecolor($this->thumbx, 1);\n\t\timagefilledrectangle($this->newimage, 0, 0, $this->thumbx, 1, imagecolorallocate($this->newimage, hexdec(substr($this->Mirrorcolor, 1, 2)), hexdec(substr($this->Mirrorcolor, 3, 2)), hexdec(substr($this->Mirrorcolor, 5, 2))));\n\t\t$shadingstrength = ($this->Mirror[2] - $this->Mirror[1]) / $bottom;\n\t\tfor($c = $this->thumby - $bottom; $c < $this->thumby; $c++){\n\t\t\t$opacity = $this->Mirror[1] + floor(($bottom - ($this->thumby - $c)) * $shadingstrength);\n\t\t\timagecopymerge($this->thumb, $this->newimage, 0, $c, 0, 0, $this->thumbx, 1, max(min($opacity, 100), 0));\n\t\t}\n\t\timagedestroy($this->newimage);\n\n\t}",
"private function setMargins()\n {\n $this->tcpdf->SetMargins(\n self::MARGIN_LEFT,\n self::MARGIN_TOP,\n self::MARGIN_RIGHT\n );\n }",
"function bootstraporama_pager($variables) {\n $tags = $variables['tags'];\n $element = $variables['element'];\n $parameters = $variables['parameters'];\n $quantity = $variables['quantity'];\n global $pager_page_array, $pager_total;\n\n // Calculate various markers within this pager piece:\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil($quantity / 2);\n // current is the page we are currently paged to\n $pager_current = $pager_page_array[$element] + 1;\n // first is the first page listed by this pager piece (re quantity)\n $pager_first = $pager_current - $pager_middle + 1;\n // last is the last page listed by this pager piece (re quantity)\n $pager_last = $pager_current + $quantity - $pager_middle;\n // max is the maximum page number\n $pager_max = $pager_total[$element];\n // End of marker calculations.\n\n // Prepare for generation loop.\n $i = $pager_first;\n if ($pager_last > $pager_max) {\n // Adjust \"center\" if at end of query.\n $i = $i + ($pager_max - $pager_last);\n $pager_last = $pager_max;\n }\n if ($i <= 0) {\n // Adjust \"center\" if at start of query.\n $pager_last = $pager_last + (1 - $i);\n $i = 1;\n }\n // End of generation loop preparation.\n\n $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('« first')), 'element' => $element, 'parameters' => $parameters));\n $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next ›')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('last »')), 'element' => $element, 'parameters' => $parameters));\n\n if ($pager_total[$element] > 1) {\n if ($li_first) {\n $items[] = array(\n 'class' => array('pager-first'),\n 'data' => $li_first,\n );\n }\n if ($li_previous) {\n $items[] = array(\n 'class' => array('prev'),\n 'data' => $li_previous,\n );\n }\n\n // When there is more than one page, create the pager list.\n if ($i != $pager_max) {\n /* Don't use ellipsis\n if ($i > 1) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n */\n // Now generate the actual pager piece.\n for (; $i <= $pager_last && $i <= $pager_max; $i++) {\n if ($i < $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)),\n );\n }\n if ($i == $pager_current) {\n $items[] = array(\n 'class' => array('active'), // Add the active class\n 'data' => l($i, '#', array('fragment' => '', 'external' => TRUE)),\n );\n }\n if ($i > $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)),\n );\n }\n }\n /* Don't use ellipsis\n if ($i < $pager_max) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n */\n }\n // End generation.\n if ($li_next) {\n $items[] = array(\n 'class' => array('next'),\n 'data' => $li_next,\n );\n }\n if ($li_last) {\n $items[] = array(\n 'class' => array('pager-last'),\n 'data' => $li_last,\n );\n }\n\n return '<div class=\"pagination\">' . theme('item_list', array(\n 'items' => $items,\n // pager class is used for rounded, bubbly boxes in Bootstrap\n //'attributes' => array('class' => array('pager')),\n )) . '</div>';\n }\n}",
"function setMargins($marginLeft, $marginTop, $marginRight, $marginBottom) {\t \r\n\t\t$this->marginLeft = $marginLeft; \r\n\t\t$this->marginTop = $marginTop;\r\n\t\t$this->marginRight = $marginRight;\r\n\t\t$this->marginBottom = $marginBottom;\r\n\t}",
"function getOffset($page){\n return $page-1>0?($page-1)*10:0;\n}",
"public function turnPage();",
"function page_break($db_object,$return_content,$adjacents,$total_pages,$limit,$targetpage,$page) {\n if ($page == 0) $page = 1;\n $prev = $page - 1;\n $next = $page + 1;\n $lastpage = ceil($total_pages/$limit);\n $lpm1 = $lastpage - 1;\n $targetpage = $targetpage.\"page\";\n $pagination = \"\";\n if($lastpage > 1) {\n $pagination .= \"<div class=\\\"pagination\\\">\";\n if ($page > 1)\n $pagination.= \"<a href=\\\"$targetpage=$prev\\\">« previous</a>\";\n else\n $pagination.= \"<span class=\\\"disabled\\\">« previous</span>\";\n if ($lastpage < 7 + ($adjacents * 2)) {\n for ($counter = 1; $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= \"<a href=\\\"$targetpage=$counter\\\">$counter</a>\";\n }\n }\n elseif($lastpage > 5 + ($adjacents * 2)) {\n if($page < 1 + ($adjacents * 2)) {\n for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) {\n if ($counter == $page)\n $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= \"<a href=\\\"$targetpage=$counter\\\">$counter</a>\";\n }\n $pagination.= \"...\";\n $pagination.= \"<a href=\\\"$targetpage=$lpm1\\\">$lpm1</a>\";\n $pagination.= \"<a href=\\\"$targetpage=$lastpage\\\">$lastpage</a>\";\n }\n elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) {\n $pagination.= \"<a href=\\\"$targetpage=1\\\">1</a>\";\n //$pagination.= \"<a href=\\\"$targetpage=2\\\">2</a>\";\n $pagination.= \"...\";\n for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) {\n if ($counter == $page)\n $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= \"<a href=\\\"$targetpage=$counter\\\">$counter</a>\";\n }\n $pagination.= \"...\";\n $pagination.= \"<a href=\\\"$targetpage=$lpm1\\\">$lpm1</a>\";\n $pagination.= \"<a href=\\\"$targetpage=$lastpage\\\">$lastpage</a>\";\n }\n //close to end; only hide early pages\n else {\n $pagination.= \"<a href=\\\"$targetpage=1\\\">1</a>\";\n $pagination.= \"<a href=\\\"$targetpage=2\\\">2</a>\";\n $pagination.= \"...\";\n for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) {\n if ($counter == $page)\n $pagination.= \"<span class=\\\"current\\\">$counter</span>\";\n else\n $pagination.= \"<a href=\\\"$targetpage=$counter\\\">$counter</a>\";\n }\n }\n }\n if ($page < $counter - 1)\n $pagination.= \"<a href=\\\"$targetpage=$next\\\">next »</a>\";\n else\n $pagination.= \"<span class=\\\"disabled\\\">next »</span>\";\n $pagination.= \"</div>\\n\";\n }\n $return_content=str_replace ( \"<{pagination}>\", $pagination, $return_content);\n return $return_content;\n }",
"function setMargins($css){\n $x = getAttrValue($css, \"width\")/-2;\n $y = getAttrValue($css, \"height\")/-2;\n return $css . \" margin-left: {$x}px; margin-top: {$y}px;\";\n}",
"private function calculateOffset() {\n $this->offset = ($this->currentpage - 1) * $this->limit;\n }",
"function thumbnailPages($type, $page, $max, $section) {\n if ($section != '') {\n $section = \"/$section\";\n }\n \n echo '<div id=\"pageNav\">';\n // number of pages\n $pages = ($max/12)-1;\n\n $pagesround = (ceil($pages));\n $from = $limit+1;\n $to = $from+11;\n $start = 0; \n $thelimit = $limit+12;\n $themax = $max-1;\n \n if ($pagesround <= 11 && $pagesround > 0){ // // Page navigation when there are between 1 and 11 (inclusive) pages\n\n // Make Previous Page Link\n\n if ($page != 0) {\n $previousPage = $max - ( ($page - 1) * 12);\n echo \"<a href='/$type$section/$previousPage'><< </a> \";\n } else {\n echo '<span class=\"gray\"><< </span>';\n }\n\n // Make the Number Links\n\n while ($start <= $pagesround) {\n $pieceLink = $max - ($start * 12);\n echo '<a ';\n if($page == $start){\n echo 'class=\"on\" ';\n }\n echo \"href='/$type$section/$pieceLink'>\";\n $start +=1;\n echo $start;\n echo '</a> ';\n }\n\n // Make Next Page Link\n\n if ($page != $pagesround) {\n $nextPage = $max - ( ($page + 1) * 12);\n echo \"<a href='/$type$section/$nextPage'> >></a>\";\n } else {\n echo '<span class=\"gray\"> >></span>';\n }\n } elseif ($pagesround == 0) { // // Page navigation when there is only one page\n echo '<span class=\"gray\"><< 1 >></span>';\n } else { // // Page navigation when there are more than 11 pages\n\n // Make Previous Page Link\n\n if ($page != 0) {\n $previousPage = $max - ( ($page - 1) * 12);\n echo \"<a href='/$type$section/$previousPage'><< </a> \";\n } else {\n echo '<span class=\"gray\"><< </span>';\n }\n\n\n // Make the Number Links\n\n // page one always displays\n\n echo '<a ';\n if($page == 0){\n echo 'class=\"on\" ';\n }\n echo \"href='/$type$section/$max'>1</a> \";\n\n if ($page >= 0 && $page < 6) { // if you are on pages 0-4 (inclusive)\n $start = 1;\n while ($start <= 8) {\n $pieceLink = $max - ($start * 12);\n echo '<a ';\n if($page == $start){\n echo 'class=\"on\" ';\n }\n echo \"href='/$type$section/$pieceLink'>\";\n $start += 1;\n echo $start;\n echo '</a> ';\n }\n echo '… ';\n } elseif ($page >= 6 && $page < ($pagesround - 4)) { // pages 5 to (max-5)\n echo '… ';\n $start = $page - 2;\n while ($start <= $page + 2) {\n $pieceLink = $max - ($start * 12);\n echo '<a ';\n if ($page == $start) {\n echo 'class=\"on\" ';\n }\n echo \"href='/$type$section/$pieceLink'>\";\n $start +=1;\n echo $start;\n echo '</a> ';\n }\n echo '… ';\n } elseif ($page >= ($pagesround - 4)) { // pages (max-4) to (max-1)\n echo '… ';\n $start = $pagesround - 7;\n while ($start <= $pagesround - 1) {\n $pieceLink = $max - ($start * 12);\n echo '<a ';\n if ($page == $start) {\n echo 'class=\"on\" ';\n }\n echo \"href='/photography$section/$pieceLink'>\";\n $start +=1;\n echo $start;\n echo '</a> ';\n }\n }\n\n // the last page always displays\n\n echo '<a ';\n if($page == $pagesround){\n echo 'class=\"on\" ';\n }\n echo \"href='/$type$section/\" . ($max - ($pagesround * 12)) . \"'>\" . ($pagesround + 1) . \"</a> \";\n\n // Make Next Page Link\n\n if ($page != $pagesround) {\n $nextPage = $max - ( ($page + 1) * 12);\n echo \"<a href='/$type$section/$nextPage'> >></a>\";\n } else {\n echo '<span class=\"gray\"> >></span>';\n }\n }\n echo '</div>';\n }",
"function draw($array){\r\n $pages = min(count($array)/12,5);\r\n if (isset($_GET[\"id7\"])){\r\n $id = $_GET[\"id7\"];\r\n }elseif (isset($_GET[\"id5\"])){\r\n $id = $_GET[\"id5\"];\r\n }\r\n elseif (isset($_GET[\"id6\"])){\r\n $id = $_GET[\"id6\"];\r\n }\r\n echo \"<div>\";\r\n if ($array==null){\r\n echo \"<b>没有图片</b>\";\r\n }\r\n elseif (isset($_GET[\"page\"])&&$page = $_GET[\"page\"]){\r\n if ($page>=0&&$page<=1){\r\n $page=1;\r\n }\r\n for ($i = 0;$i<min(12,count($array)-12*($page-1));$i++){\r\n echo $array[12*($page-1)+$i];\r\n }\r\n if ($pages>0) {\r\n echo \"<h4>\";\r\n echo \"<div class='transform-line'>\";\r\n $previous = $page + $pages;\r\n echo \"<div class='pageFoot'>\" . \"<a href='Browser.php?id$id=$id&page=\" . ($previous % ($pages + 1) + $pages * floor(($pages + 1) / $previous)) . \"'><<</a>\" . \" \";\r\n for ($p = 1; $p <= $pages; $p++){\r\n if ($p == $page)\r\n echo \"<span class='currentPage'>$p</span> \";\r\n else\r\n echo \"<a href='Browser.php?id$id=$id&page=$p'>$p</a> \";\r\n }\r\n $next = $page + 1;\r\n echo \"<a href='Browser.php?id$id=$id&page=\" . ($next % ($pages + 1) + floor($next / ($pages + 1))) . \"'>>></a>\";\r\n echo \"</div>\";\r\n echo \"</h4>\";\r\n }\r\n }\r\n else\r\n header(\"Refresh:0.1;url=Browser.php?id'$id'='$id'page=1\");\r\n echo \"</div>\";\r\n}",
"function AcceptPageBreak() {\n $this->current_y = 0 + $this->tMargin;\n return parent::AcceptPageBreak();\n }",
"public function margin($value) {\n return $this->setProperty('margin', $value);\n }",
"public function margin($value) {\n return $this->setProperty('margin', $value);\n }",
"public function margin($value) {\n return $this->setProperty('margin', $value);\n }",
"public function sectionSpacing(): void;",
"function PageWidth(){\r\n\treturn (int) $this->w-$this->rMargin-$this->lMargin;\r\n}",
"abstract protected function getPaginationView();",
"function setup_page($pdf, &$margin_left, &$margin_top, &$height, &$width){\n\t\t$pdf->AddPage();\n\t\t$pdf->SetX(-1);\n\t\t$width = $pdf->GetX() + 1;\n\t\t$pdf->SetY(-1);\n\t\t$height = $pdf->GetY()+ 1;\n\t\t$pdf->SetFillColor(220);\n\t\t$pdf->Rect(0, 0, $width, $height, 'F');\n\t\t$inset = 18;\n\t\t$pdf->SetLineWidth(6);\n\t\t$pdf->SetDrawColor(190);\n\t\t$pdf->SetFillColor(255);\n\t\t$pdf->Rect($inset, $inset, $width - 2 * $inset, $height - 2 * $inset, 'DF');\n\t\t$margin_left = $inset + 20;\n\t\t$margin_top = $inset + 20;\n\t\t$pdf->Image(\"../images/html5.png\", $margin_left, $margin_top, 36, 36, \"png\");\n\t\t$x = $margin_left + 50;\n\t\t$pdf->SetFont(\"Helvetica\", \"BI\", 16);\n\t\t$pdf->SetTextColor(220);\n\t\t$pdf->Text($x, $margin_top + 20, \"HTML5 @ HACK REACTOR\");\n\t\t$pdf->SetFont(\"Helvetica\", \"I\", 9);\n\t\t$pdf->SetTextColor(180);\n\t\t$pdf->Text($x, $margin_top + 30, \"220 Fool Street, River Park Drive, CA\");\n\t\t$pdf->SetLineWidth(1);\n\t\t$pdf->Line($margin_left, $margin_top + 50, $width - $margin_left, $margin_top + 50);\n\t\t$pdf->SetFont(\"Times\", \"\", 10);\n\t\t$pdf->SetTextColor(0);\n\t}",
"function _mollom_manage_paginate($current_page = 1, $count = 0, $per_page = 15) {\r\n\tif ($count == 0) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// calculate total amount of pages\r\n\tif ($count < $per_page) {\r\n\t\treturn false;\r\n\t} else {\r\n\t\t$total_pages = (int)($count/$per_page);\r\n\t}\r\n\t\r\n\tif (($count%$per_page) > 0) {\r\n\t\t$total_pages += 1;\r\n\t}\r\n\r\n\t// calculate pagination context\r\n\t$buffer = 1;\r\n\tfor ($i = 1; $i <= $total_pages; $i++) {\r\n\t\t// break if the last page is reached\r\n\t\tif ($current_page == $total_pages) {\r\n\t\t\tif ($total_pages > 1) {\r\n\t\t\t\t$start_offset = $total_pages - 1;\r\n\t\t\t} else {\r\n\t\t\t\t$start_offset = 1;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t// calculate offset depending on which page we are\r\n\t\tif ((($i % 2) == 0)) {\r\n\t\t\tif ($i > $current_page) {\r\n\t\t\t\t$start_offset = $buffer;\r\n\t\t\t\tbreak;\r\n\t\t\t} elseif ($i == $current_page) {\r\n\t\t\t\t$start_offset = $buffer + 1;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t$buffer = $i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// previous/next buttons\r\n\t$prev_page = false;\r\n\tif ($current_page > 1) {\r\n\t\t$prev_page = $current_page - 1;\r\n\t}\r\n\t\r\n\t$next_page = false;\r\n\tif ($current_page < $total_pages) {\r\n\t\t$next_page = $current_page + 1;\r\n\t}\r\n\t\r\n\t$pages = '';\r\n\t\r\n\t// start generating links and such\r\n\tif ($prev_page) {\r\n\t\t$pages = \"<a href='edit-comments.php?page=mollommanage&apage=$prev_page'>\" . __('«', MOLLOM_I8N) . \"</a>\";\r\n\t}\r\n\r\n\t$context = 3;\r\n\t$context = (($context < $total_pages) ? $context : ($total_pages + 1));\r\n\tfor ($i = 0; $i < $context; $i++) {\r\n\t\t$page = $start_offset + $i;\r\n\t\tif (($page * $per_page) <= $count) {\r\n\t\t\tif($page != $current_page) {\r\n\t\t\t\t$pages .= \" <a href='edit-comments.php?page=mollommanage&apage=$page' class='page-numbers'>\" . $page . \"</a>\";\r\n\t\t\t} else {\r\n\t\t\t\t$pages .= \" <span class='page-numbers current'>\" . $page . \"</span> \";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//we're approaching the last page now\r\n\tif ($start_offset < ($total_pages - 2)) {\r\n\t\tif ($start_offset < ($total_pages - $context)) {\r\n\t\t\t$pages .= \" ... \";\t\r\n\t\t}\r\n\t\t$pages .= \"<a href='edit-comments.php?page=mollommanage&apage=$total_pages' class='page-numbers'>\" . $total_pages . \"</a>\";\r\n\t} \r\n\t\r\n\tif ($next_page) {\r\n\t\t$pages .= \" <a href='edit-comments.php?page=mollommanage&apage=$next_page'>\" . __('»', MOLLOM_I8N) . \"</a>\";\r\n\t}\r\n\r\n\treturn $pages;\r\n}",
"function pagination() {\n\tglobal $curr_light_key;\n\tglobal $numeric_leftsidebar;\n// $numeric_leftsidebar - это массив, в котором первым идут ключи-числа, \n// а вторым - значения, равные названию ссылок (ключей) массива sidebar\n\tinclude(VIEW.'pagination.php');\n}",
"public function setPage ($width, $height, $x, $y) {}",
"function odin_paging_nav() {\n\t\t$mid = 2; // Total of items that will show along with the current page.\n\t\t$end = 1; // Total of items displayed for the last few pages.\n\t\t$show = false; // Show all items.\n\n\t\techo odin_pagination( $mid, $end, false );\n\t}",
"protected function lessFour(): void\n {\n foreach ([2, 3] as $page) {\n $this->addButtonIf($this->pages >= $page, $page);\n }\n }",
"public function resetPageCount();",
"function philosophy_pagination() {\n global $wp_query;\n $links = paginate_links(array(\n 'current' => max(1, get_query_var('paged')),\n 'total' => $wp_query ->max_num_pages,\n 'type' => 'list',\n 'mid_size'=> apply_filters(\"change_mid_size\",2),\n ));\n\n $links = str_replace(\"page-numbers\", \"pgn__num\", $links);\n $links = str_replace(\"<ul class='pgn__num'>\", \"<ul>\", $links);\n $links = str_replace(\"next pgn__num\", \"pgn__next\", $links);\n $links = str_replace(\"prev pgn__num\", \"pgn__prev\", $links);\n echo $links;\n}"
] | [
"0.72645855",
"0.5635615",
"0.4973932",
"0.49604836",
"0.49459228",
"0.48991975",
"0.4777819",
"0.47456554",
"0.46964118",
"0.46869713",
"0.468453",
"0.45988333",
"0.45682383",
"0.45395878",
"0.45255375",
"0.45191365",
"0.45135817",
"0.45135817",
"0.45135817",
"0.4484735",
"0.44815364",
"0.44768655",
"0.44612354",
"0.44492346",
"0.44389176",
"0.43811727",
"0.4380848",
"0.4375907",
"0.43755454",
"0.43688127"
] | 0.72294855 | 1 |
Signals that an new page has to be started. | public function newPage(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function start()\n\t{\n\t\t$this->send_page(array('app/page-start'));\n\t}",
"protected function handlePageBegin()\n {\n if (!$this->title) {\n $this->title = $this->site_name;\n }\n\n if ($this->suffix) {\n\n $this->title = sprintf('%s | %s', $this->title, $this->suffix);\n }\n\n $this->_registerMetas();\n\n if ($this->handleOg) {\n $this->_registerOpenGraphs();\n }\n }",
"public function beginPage()\n {\n ob_start();\n ob_implicit_flush(false);\n\n $this->trigger(self::EVENT_BEGIN_PAGE);\n }",
"function start() {\n\t\tif (!empty($this->startPage)) {\n\t\t\t$this->extractPageLinks($this->startPage);\n\t\t}\n\t}",
"function new_page() {\n $this->data['menu_highlight'] = \"Pages\";\n $id = null;\n\n if (isset($_POST['content']))\n $id = $this->_save(null);\n\n $page = new page_model();\n if ($id) \n $page = $page->get_from_id($id);\n\n $this->_edit_pages($page, $id, \"New Page\");\n }",
"public function onPageLoaded($page);",
"public function attachPage() { }",
"function register_new_pages() {\n\n\t\t\t// Register main menu item\n\t\t\tadd_menu_page(\n\t\t\t\t__( 'Monstroid Dashboard', 'monstroid-dashboard' ),\n\t\t\t\tsprintf( __( 'Monstroid %s', 'monstroid-dashboard' ), $this->get_menu_badge() ),\n\t\t\t\t'manage_options',\n\t\t\t\t'monstroid-dashboard',\n\t\t\t\tarray( $this, 'build_page' ),\n\t\t\t\tmonstroid_dashboard()->plugin_url( 'assets/images/icon.png' ),\n\t\t\t\t$this->start_position + 1\n\t\t\t);\n\n\t\t\t// register subitems\n\t\t\tforeach ( $this->subpages() as $slug => $data ) {\n\t\t\t\tadd_submenu_page( 'monstroid-dashboard', $data['page-title'], $data['menu-title'], 'manage_options', $slug, array( $this, 'build_page' ) );\n\t\t\t}\n\t\t}",
"protected function newPage($request) {\n\t\t$model = new PageModel();\n\t\t$newPageName = $request->getValue(CONTROLLER_PAGE_NAME);\n\t\t$genericResult = $model->createPage($newPageName);\n\t\t$view = new SimpleView($genericResult);\n\t\t$view->render();\n\t}",
"public function open()\n {\n $this->page = 1;\n }",
"public function action_new()\n {\n // Get slug\n $slug = isset(Router::$params['slug']) ? Router::$params['slug'] : '';\n\n $this->title(l('new'));\n\n // Fetch the page from the database\n $page = new WikiPage(array('slug' => $slug));\n\n // Check if the form has been submitted\n if (Request::method() == 'post') {\n // Update the page information\n $page->set(array(\n 'title' => Request::post('title'),\n 'slug' => Request::post('slug'),\n 'project_id' => $this->project->id\n ));\n\n // Set revision data\n $page->revision->set(array(\n 'revision' => 1,\n 'user_id' => $this->user->id,\n 'content' => Request::post('body')\n ));\n\n // Save and redirect\n if ($page->save()) {\n // Save revision\n $page->revision->wiki_page_id = $page->id;\n $page->revision->save();\n\n // Set pages revision ID\n $page->revision_id = $page->revision->id;\n $page->_is_new(false);\n $page->save();\n\n // Insert timeline event\n $timeline = new Timeline(array(\n 'project_id' => $this->project->id,\n 'owner_id' => $page->id,\n 'action' => 'wiki_page_created',\n 'user_id' => $this->user->id\n ));\n $timeline->save();\n\n if ($this->is_api) {\n return \\API::response(1, array('page' => $page));\n } else {\n Request::redirectTo($page->href());\n }\n }\n }\n\n View::set('page', $page);\n }",
"public function executeCreateJustGivingPage(sfWebRequest $request) \n \n die('--1');",
"public function startAction()\n {\n /**\n * Clear old values for invoice qty's\n */\n $this->_getSession()->getInvoiceItemQtys(true);\n $this->_redirect('*/*/new', array('order_id'=>$this->getRequest()->getParam('order_id')));\n }",
"private function _new_page($slug)\n {\n $this->render['view'] = 'wiki/new';\n $this->action_new($slug);\n }",
"public function __construct(){\n //echo 'Pages loaded';\n\n }",
"public function nextPageLoad()\n {\n $destroyInstance = function () {\n static::$instance = null;\n };\n $destroyInstance = $destroyInstance->bindTo(null, Flash::class);\n $destroyInstance();\n }",
"public function newpage() {\n // Get the new page name.\n $name = $this->ask('Name of the new page:', 'My awesome page');\n // Now ask for the slug\n $slug = $this->ask('Slug for the new page:', 'awesomepage');\n\n // Some bootstrap for the user:\n $page = <<<HTML\n<?php\n/*\nTemplate Name: $name\n*/\n\nget_header();\n?>\n\n<!-- Write your HTML code here -->\n<!-- Generated by 420 -->\n\n<?php get_footer(); ?>\nHTML;\n\n // Call file_put_contents.\n if(file_put_contents('./page-' . $slug . '.php', $page)) {\n $this->e('File page-' . $slug . '.php has been successfully created!');\n }else {\n $this->e('There has been an erroring creating page-' . $slug . '.php!', FALSE);\n }\n }",
"public function init()\n {\n $this->event->trigger('pageInit', [$this]);\n }",
"public function turnPage()\n {\n $this->page++;\n }",
"public function run()\n {\n $this->createGeneralPages();\n }",
"function premise_activate()\n{\n$pages = get_pages(array(\n\t'meta_key' => '_wp_page_template',\n\t'meta_value' => 'homepage.php',\n));\nif ( (!$pages) && isset($_GET['activated']) ){\n\t$new_page_title = 'Premise Home Page';\n\t$new_page_content = 'This is the page content';\n\t$new_page_template = 'homepage.php'; \n\t$new_page = array(\n\t\t\t'post_type' => 'page',\n\t\t\t'post_title' => $new_page_title,\n\t\t\t'post_content' => $new_page_content,\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_author' => 1,\n\t);\n\tif(!isset($page_check->ID)){\n\t\t$new_page_id = wp_insert_post($new_page);\n\t\tif(!empty($new_page_template)){\n\t\t\tupdate_post_meta($new_page_id, '_wp_page_template', $new_page_template);\n\t\t\tdo_action( 'premise_activated', $new_page_id );\n\t\t}\n\t}\n}\n}",
"public function register_page() {\n\n\t\tdo_action( 'slack_before_page_register', $this );\n\t\tdo_action( 'slack_before_' . $this->page_slug . '_page_register', $this );\n\n\t\tadd_submenu_page(\n\t\t\tSLACK_NOTIFICATIONS_SLUG,\n\t\t\t$this->page_title,\n\t\t\t$this->menu_title,\n\t\t\t'manage_options',\n\t\t\tSLACK_NOTIFICATIONS_SLUG . '-' . $this->page_slug,\n\t\t\t[\n\t\t\t\t$this,\n\t\t\t\t'print_settings_page',\n\t\t\t]\n\t\t);\n\n\t\tdo_action( 'slack_after_page_register', $this );\n\t\tdo_action( 'slack_after_' . $this->page_slug . '_page_register', $this );\n\n\t}",
"public function setStarted() {\n \n }",
"public function startPage(){\n\t\t$this->setTitle(\"Welcome to Smartest\");\n\t}",
"public function run()\n {\n App\\Page::create([\n 'title' => 'Homepage',\n 'url' => '/',\n 'published' => 1,\n ]);\n }",
"public function start()\n {\n $this->active = true;\n }",
"function page_handler_init() {\n\telgg_register_plugin_hook_handler('forward', '404', 'elgg_error_page_handler');\n}",
"function setStartPage($startPage) {\t \t \r\n\t\t$this->startPage = $startPage;\r\n\t}",
"function start_new_story(){\n\t\t// update with new story id,\n\t\t// then redirect to first chapter of the story\n\t\tif (isset($_GET['story']) && intval($_GET['story']) > 0){\n\t\t\t\t// The story variable is set, meaning we're starting a new story.\n\t\t\t\t// This variable is only set when clicking a story from a story list (e.g. my_stories or index)\n\t\t\t\t$_SESSION['story_id'] = intval($_GET['story']);\n\t\t\t\tredirect_to(\"read_chapter.php?story=\" . $_SESSION['story_id']);\n\t\t\t} else {\n\t\t\t\tredirect_to(\"index.php\");\n\t\t\t}\n\t}",
"public function start()\n {\n $isRequiredRoute = isset($this->requiredAccess[$this->urlCurrent]) ? true : false;\n if ($isRequiredRoute) {\n if (!$this->checkCredentials() || !$this->checkPermission()) {\n $this->request->redirect(ROOT . $this->urlFailure);\n }\n }\n }"
] | [
"0.6596631",
"0.6003644",
"0.5944335",
"0.58843017",
"0.580314",
"0.5581117",
"0.5571669",
"0.5565899",
"0.5561837",
"0.5529226",
"0.5521207",
"0.545182",
"0.5445574",
"0.5431518",
"0.54313457",
"0.54028046",
"0.53780615",
"0.5371234",
"0.5344174",
"0.5323795",
"0.52202266",
"0.52199525",
"0.52064806",
"0.5195068",
"0.5170993",
"0.51673603",
"0.5165218",
"0.51563156",
"0.5153905",
"0.51061493"
] | 0.6206684 | 1 |
Resets the header of this document. | public function resetHeader(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function reset(): void\n {\n unset($this->header);\n\n $this->records = [];\n $this->validColumnNames = [];\n }",
"public function clearHeaders() {\n }",
"public function reset()\n {\n $this->values[self::RESPONSE_HEADER] = null;\n $this->values[self::ENTITY] = array();\n }",
"public function reset()\n\t{\n\t\t$this->app->view->make('header', $this->getHeaderVariables());\n\t\t$this->generateCsrfToken('rst');\n\t\t$this->app->view->make('resetForm');\n\t\t$this->app->view->make('footer');\n\t}",
"public function reset()\n {\n $this->values[self::M_STMSGHEAD] = null;\n $this->values[self::M_STMSGBODY] = null;\n }",
"function ClearCustomHeaders() {\n $this->CustomHeader = array();\n }",
"public function saveHeader()\n\t{\n\t\t$i = strpos($this->buffer, '<head');\n\t\t$j = strpos($this->buffer, '</head>') + 7;\n\t\t$this->head = substr($this->buffer, $i, $j - $i);\n\t}",
"public static function clearDefaultHeaders()\n {\n Unirest::$defaultHeaders = array();\n }",
"public function rewind()\n {\n $this->file->rewind();\n if (null !== $this->headerRowNumber) {\n $this->file->seek($this->headerRowNumber + 1);\n }\n }",
"public function reset()\n\t{\n\t\t$this->index = $this->original_index;\n\t}",
"public function reset () {\n\t\t$this->index = -1;\n\t}",
"public function setHeader()\n {\n return $this->setOpt(CURLOPT_HEADER, 0);\n }",
"public function setHeader($header){\n $this->header = $header;\n }",
"function setHeader($header) {\n $this->header = $header;\n }",
"public function reset() {\n $this->values[self::CONTENTS] = array();\n }",
"public function reset()\n {\n $this->values[self::MAJOR] = 0;\n $this->values[self::MINOR] = 0;\n $this->values[self::MICRO] = 0;\n }",
"public function Header() {\n $this->imprime($this->format['header']);\n }",
"public static function clear ()\n\t{\n\t\tself::$headers = new Map();\n\t\tself::$responseHeaders = new Map();\n\n\t\tself::header ('Accept: text/html,application/json,application/xhtml+xml,application/xml, */*');\n\t}",
"public function setHeader($header) {\n\t\t$this->header = $header;\n\t}",
"public function rewind(): void {\n $this->page = $this->firstPage;\n $this->page->rewind();\n $this->currentPage = 1;\n $this->currentRecord = 1;\n }",
"public function reset()\n {\n $this->values[self::DOCUMENTSTATUS] = self::$fields[self::DOCUMENTSTATUS]['default'];\n $this->values[self::PRICELISTEFFECTIVEDATE] = null;\n $this->values[self::CONTRACTDOCUMENTDATE] = null;\n $this->values[self::CONTRACTDOCUMENTNUMBER] = null;\n $this->values[self::RECEIPTSTATUS] = self::$fields[self::RECEIPTSTATUS]['default'];\n }",
"public function setHeader($header) {\n $this->header = $header;\n }",
"public function setHeader($header){\n\t\t$this->attributes['header'] = $header;\n\t}",
"public final function remove()\n\t{\n\t\tZoombi_Headers::removeHeader($this->m_key);\n\t}",
"private function normalize_header() {\n\t\tif (!$this->skeleton->built('header')) $header = self::fetch('header', [$this->id()]);\n\t\telse {\n\t\t\t$header = $this->skeleton->get('header');\n\t\t\t$this->skeleton->rebuild('header');\n\t\t}\n\n\t\tif (!empty($header)) {\n\t\t\t$date_fields = ['created_at'];\n\t\t\tforeach ($date_fields as $field) {\n\t\t\t\tif (!self::date_is_empty($header[$field])) $header[$field] = self::DateTime($header[$field]);\n\t\t\t\telse $header[$field] = NULL;\n\t\t\t}\n\t\t}\n\n\t\t$this->skeleton->load('header', $header);\n\t}",
"private function setHeader($header){\n $this->header = $header ;\n }",
"public function clearHeader($name = null)\n {\n if (!is_null($name)) {\n unset($this->headers[$name]);\n } else {\n $this->headers = array();\n }\n return $this;\n }",
"public function reset()\n {\n $this->flags = 0;\n }",
"function reset()\n\t{\n\t\t$this->contents = NULL;\n\t\t$this->name = NULL;\n\t\t$this->expires = NULL;\n\t\t$this->created = NULL;\n\t\t$this->dependencies = array();\n\t}",
"protected function reset()\n {\n $this->serializer = null;\n $this->statusCode = 200;\n $this->headers = [];\n $this->meta = [];\n }"
] | [
"0.7190159",
"0.68345547",
"0.66954374",
"0.64010423",
"0.6375065",
"0.62958896",
"0.62613326",
"0.62405044",
"0.61167455",
"0.5995463",
"0.5969859",
"0.5954972",
"0.59495336",
"0.59459877",
"0.59447324",
"0.5943943",
"0.59422696",
"0.59317833",
"0.59116566",
"0.5905603",
"0.59006405",
"0.588991",
"0.5869255",
"0.5867753",
"0.58651423",
"0.58601886",
"0.584311",
"0.5828647",
"0.58278275",
"0.581915"
] | 0.8355675 | 0 |
Resets the footer of this document. | public function resetFooter(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setFooter() {\n $footer= $this->fetch('footer.tpl');\n $this->assign('footer', $footer);\n \n }",
"public function clear()\n {\n $this->footnotes = [];\n }",
"public function Footer() {\n $this->imprime($this->format['footer']);\n }",
"public function footer()\n\t{\n\t\t$this->buf .= \"</body></html>\";\n\t}",
"public function initFooter() {\n if (self::$_footer) {\n $this->partial(self::$_footer);\n }\n }",
"function Footer(){\n\t\t\t$this->SetY(-15);\n\t\t\t\t\t\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t\n\t\t\t//width = 0 means the cell is extended up to the right margin\n\t\t\t$this->Cell(0,10,'Page '.$this->PageNo().\" / {0} | Copyright : Orbit Law Tech\",0,0,'C');\n\t\t}",
"function Footer() {\n\t $this->SetY(-15);\n\t //Arial italic 8\n\t $this->SetTextColor(0);\n\t //Page number\n\t $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n\t}",
"public function Footer() {\t\t\t\t\r\n\t\t$cur_y = $this->GetY();\r\n\t\t$ormargins = $this->getOriginalMargins();\r\n\t\t$this->SetTextColor(0, 0, 0);\r\n\t\tif (empty($this->pagegroups)) {\r\n\t\t\t$pagenumtxt = $this->getAliasNumPage();\r\n\t\t} else {\r\n\t\t\t$pagenumtxt = $this->getPageNumGroupAlias();\r\n\t\t}\t\r\n\t\t$this->SetY($cur_y);\r\n\t\t//Print page number\r\n\t\t$this->Cell(0, 0, $pagenumtxt, 0, 0, 'C');\r\n\t}",
"function Footer()\n\t{\n\t $this->SetY(-10);\n\t // Arial italic 8\n\t $this->SetFont('Arial','I',8);\n\t // Page number\n\t $pno = FIRST_PAGE_NO + $this->pageNo();\n\t $this->Cell(0,10,'Page '.$pno,0,0,'R');\n\t}",
"public function setFooter($footer) {\n $this->footer = $footer;\n }",
"public function Footer()\n {\n $this->SetY(-15);\n\n $font_name = get_option('pdf_font');\n $font_size = get_option('pdf_font_size');\n\n if ($font_size == '') {\n $font_size = 10;\n }\n\n $this->SetFont($font_name, '', $font_size);\n\n do_action('pdf_footer', ['pdf_instance' => $this, 'type' => $this->pdf_type]);\n\n if (get_option('show_page_number_on_pdf') == 1) {\n $this->SetFont($font_name, 'I', 8);\n $this->SetTextColor(142, 142, 142);\n $this->Cell(0, 15, $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }\n }",
"function Footer() {\n\t\t\t$this->SetY(-15);\n\t\t\t// Set font\n\t\t\t$this->SetFont('Helvetica', '', 8);\n\t\t\t// Page number\n\t\t\t$this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t\t}",
"public function setFooter(HeaderFooter $footer);",
"function footer(){\n\t $this->SetY(-15);\n\t // Arial italic 8\n\t $this->SetFont('Arial','',8);\n\t // Page number\n\t $this->Cell(0,10,$this->PageNo(),0,0,'R');\n\t}",
"function Footer()\n {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\n }",
"public function Footer()\r\n {\r\n $this->SetY(-15);\r\n // Set font\r\n $this->SetFont('helvetica', 'I', 8);\r\n // Page number\r\n $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\r\n }",
"function Footer() {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(50, 10, 'Page ' . $this->PageNo(), 0, 0, 'L');\n $this->Cell(0, 10, 'Date ' . date('d-M-Y'), 0, 0, 'R');\n }",
"public function footer() {\n $this->footer = true;\n\n return $this;\n }",
"public static function footer(){\t?>\r\n\t\t\t<footer>\r\n\t\t\t\t<p>(c)2017 Web programada por: Jose Montes & Juan Javier Ligero Rambla</p>\r\n\t\t\t</footer>\r\n\t\t<?php }",
"public function Footer(){\n $this->SetY(-15);\n $this->SetFont('Arial','I',8);\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n $date = date('Y-m-d');\n $this->Cell(0,10,$date,0,0,'C');\n }",
"protected function initFooter()\n {\n if ($this->footer === null) {\n $this->footer = [\n [\n [\n 'content' => $this->getCreateEntryButton() . ($this->showSelection ? $this->getSelectionButton() : ''),\n 'options' => ['class' => 'col'],\n ],\n ],\n ];\n }\n }",
"function Footer()\n {\n $this->SetY(-12);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(335,10,'copyright @ 2RA Technology Limited',0,0,'C');\n }",
"public function Footer() {\n\t\t\t\t// $this->SetY(-15);\n\t\t\t\t// $this->SetFont('helvetica', '', 9);\n\t\t\t\t// $footer_text = '<p style=\"text-align:right;\">Page '.$this->getAliasNumPage().' of '.$this->getAliasNbPages().'</p>';\n\t\t\t\t// $this->writeHTMLCell(0, 0, '', '', $footer_text, 0, 0, false, \"R\", true);\n\t\t\t\t$this->SetY(-25);\n\t\t\t\t$this->SetFont('helvetica', '', 9);\n\t\t\t\t$this->writeHTMLCell(0, 0, '', '', html_entity_decode(TICKET_FOOTER), 0, 0, false, \"C\", true);\n\t\t\t}",
"function Footer() {\r\n $this->SetY(-15);\r\n // Select Arial italic 8\r\n $this->SetFont('Arial','B',8);\r\n // Print centered page number\r\n //$this->Cell(0,10,'Halaman '.$this->PageNo(),0,0,'R');\r\n }",
"protected function writeFooter() {\n\t\t$this->file->write(pack('a512', ''));\n\t}",
"function setFooter($fText) {\n $this->footer = $fText;\n }",
"public function Footer()\n {\n $this->SetY(-25);\n // Set font\n $this->SetFont('times', 'I', 8);\n // Page number\n $this->Cell(0, 10, \"Tierra Fértil - Atención al Ciudadano. Elaborado (\".fechaactual().\") por \".$this->author.\". Página \".$this->getAliasNumPage().\"/\".$this->getAliasNbPages(), 0, 0, 'C');\n\t}",
"function Footer()\n{\n\t$this->SetY(-20);\n\t// Arial italic 8\n\t$this->SetFont('Arial','I',9);\n\t// Text color in gray\n\t$this->SetTextColor(128);\n\t// Page number\n#\t$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\n//\t$this->Cell(0,10,'1800 Century Park East, 2nd Floor - Los Angeles, California 90067 ','','','C');\n//\t$this->Ln(3);\n//\t$this->Cell(0,10,'877-515-4712 Main - 310.861.9051 Fax - www.InitiativeLegal.com ','','','C');\n//\t$this->Ln(4);\n//\t$this->Cell(0,10,'CLIENT INITIALS _______','','','R');\n//\t$this->Ln(9);\n}",
"function Footer() {\n $this->SetY(-1);\n // Arial italic 8\n $this->SetFont('Arial', NULL, 6.5);\n $this->SetLineWidth(0);\n // Page number\n// $this->Cell(16, .8, 'F71 SISTEMAS WEB - módulo contábil', 'T', 0, 'L');\n $this->Cell(7.25, .8, 'PAY ALL FAST 3.0 - F71 SISTEMAS WEB', 'T', 0, 'L');\n $this->Cell(7.25, .8, 'Módulo Contabilidade - versão 1.0', 'T', 0, 'L');\n $this->Cell(3, .8, 'Página ' . $this->PageNo(), 'T', 0, 'R');\n }",
"function Footer()\n\t\t{\n\t\t\t// Go to 1.5 cm from bottom\n\t\t\t$this->SetY(-15);\n\t\t\t// Select Arial italic 8\n\t\t\t$this->SetFont('Arial','',5);\n\t\t\t// Print centered page number\n\t\t\t$this->Cell(0,10,'DGR ',0,0,'L');\n\t\t\t$this->Cell(0,10,utf8_decode('REPORTE DEL ESTADO DE GUERRERO - Página ').$this->PageNo(),0,0,'R');\n\t\t}"
] | [
"0.67648065",
"0.6555486",
"0.6538066",
"0.6523942",
"0.64759856",
"0.64022255",
"0.6251765",
"0.62337285",
"0.61948603",
"0.6146951",
"0.6134123",
"0.61289823",
"0.6119801",
"0.6092424",
"0.6065399",
"0.6061707",
"0.6056632",
"0.6049935",
"0.6026168",
"0.6016924",
"0.60126805",
"0.6012103",
"0.6008744",
"0.60043514",
"0.5997998",
"0.5980387",
"0.5963592",
"0.59601516",
"0.5956432",
"0.5954616"
] | 0.82784694 | 0 |
Sets the page number to 0. | public function resetPageCount(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCurrentPageNo()\n {\n if (empty($this->currentPageNo)) {\n $this->currentPageNo = 1;\n } else {\n $this->currentPageNo++;\n }\n }",
"private function bootstrapPages()\n {\n $this->pages = array_fill(0, $this->total_pages, 0);\n }",
"public function clearPagess()\n\t{\n\t\t$this->collPagess = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function reset()\n {\n $this->_batch = null;\n $this->_value = null;\n $this->_key = null;\n $this->_page = 1;\n $this->_totalPages = null;\n }",
"public function setPage(int $page): void {\n $this->page = intval($page);\n $this->offset = ($page - 1) * $this->pageSize;\n }",
"public function rewind(): void {\n $this->page = $this->firstPage;\n $this->page->rewind();\n $this->currentPage = 1;\n $this->currentRecord = 1;\n }",
"protected function setPagingLimitOffset()\n {\n $this->setLimit(0);\n $this->setOffset(0);\n if ($this->page) {\n $this->setLimit($this->paging);\n $this->setOffset($this->paging * ($this->page - 1));\n }\n }",
"public function setPage(int $page);",
"public function reset () {\n\t\t$this->index = -1;\n\t}",
"public static function PageReset()\n\t\t{\n\t\t\tparent::StartSession();\n\t\t\t$_SESSION['liste_recette_page'] = 0;\n\t\t\treturn 0;\n\t\t}",
"public static function clearPage()\n {\n static::$page = null;\n }",
"public function resetCount(): void\n {\n $this->totalCount = null;\n }",
"public function resetImagePage ($page) {}",
"private function beginning()\n {\n if ($this->boundaries > 1) {\n for ($i = 1; $i < $this->boundaries + 1; $i ++) {\n $this->pages[$i - 1] = 1;\n }\n } else {\n $this->pages[0] = 1;\n }\n }",
"public function getPageUidForNoPageUidSetReturnsZero() {\n\t\t$this->subject->setData(array());\n\n\t\t$this->assertSame(\n\t\t\t0,\n\t\t\t$this->subject->getPageUid()\n\t\t);\n\t}",
"public function rewind()\n {\n $this->_currentItem = 0;\n if($this->_startPage != null) {\n $this->_currentPage = $this->_startPage;\n } else {\n $this->_currentPage = 1;\n }\n $this->load();\n }",
"public function setCurrentPage($page = 0);",
"public function reset() {\n $this->itemcount = 0;\n parent::reset();\n }",
"protected function setCurrentPage(){\n\n if ($this->per_page == -1) return ;\n if( $this->hasInput('page') ){\n $this->page = $this->getInput('page');\n }\n }",
"public function setCurrentPage(AbsoluteInt $page): void;",
"public function rewind()\n {\n $this->scroll_id = null;\n }",
"public function setCurrentPageNumber($currentPageNumber);",
"public function setPage(int $page) {\n $this->page = $page;\n }",
"public function noPaging(): self\n {\n $this->queryVars['nopaging'] = true;\n unset($this->queryVars['paged']);\n\n return $this;\n }",
"public function reset()\n {\n $this->pointer = 0;\n }",
"public function emptypages()\n {\n $this->page->emptybin();\n $this->message->pageEmptyBin();\n }",
"public function reset()\n {\n $this->wordCount = 0;\n $this->points = 0;\n $this->start = null;\n $this->end = null;\n $this->id = 0;\n }",
"protected function reset()\n {\n $this->requestParams['Offset'] = 0;\n }",
"protected function reset(Page $page)\n {\n $this->page = $page;\n $this->html = null;\n $this->doc = null;\n }",
"function set_page($page)\n {\n $this->list_page = (int)$page;\n }"
] | [
"0.7199317",
"0.6745005",
"0.6329994",
"0.6280569",
"0.6260347",
"0.62558347",
"0.6122441",
"0.6046987",
"0.5994504",
"0.59844327",
"0.5920822",
"0.59176064",
"0.5859504",
"0.5843436",
"0.58428985",
"0.58412975",
"0.58200365",
"0.5818944",
"0.57763904",
"0.5773637",
"0.5763221",
"0.57579094",
"0.57251924",
"0.5706475",
"0.56961894",
"0.5604042",
"0.5603278",
"0.5585897",
"0.5575368",
"0.5543728"
] | 0.765567 | 0 |
Clears text wrapping around images (if applicable). Method suggested by Pelikan Stephan | public function clearTextWrap(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function stripImage () {}",
"public function stripImage() {\n\t}",
"function imageTextWrapped(&$img, $x, $y, $width, $font, $color, $text, $textSize, $align = \"l\")\r\n{\r\n\t\t//Recalculate X and Y to have the proper top/left coordinates instead of TTF base-point\r\n\t\t$y += $textSize;\r\n\t\t$dimensions = imagettfbbox($textSize, 0, $font, \" \"); //use a custom string to get a fixed height.\r\n\t\t$x -= $dimensions[4] - $dimensions[0];\r\n\t\t$text = str_replace(\"\\r\", '', $text); //Remove windows line-breaks\r\n\t\t$srcLines = split(\"\\n\", $text); //Split text into \"lines\"\r\n\t\t$dstLines = array(); // The destination lines array.\r\n\t\tforeach ($srcLines as $currentL)\r\n\t\t{\r\n\t\t\t\t$line = '';\r\n\t\t\t\t$words = split(\" \", $currentL); //Split line into words.\r\n\t\t\t\tforeach ($words as $word)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t$dimensions = imagettfbbox($textSize, 0, $font, $line . $word);\r\n\t\t\t\t\t\t$lineWidth = $dimensions[4] - $dimensions[0]; // get the length of this line, if the word is to be included\r\n\t\t\t\t\t\tif ($lineWidth > $width && !empty($line))\r\n\t\t\t\t\t\t{ // check if it is too big if the word was added, if so, then move on.\r\n\t\t\t\t\t\t\t\t$dstLines[] = ' ' . trim($line); //Add the line like it was without spaces.\r\n\t\t\t\t\t\t\t\t$line = '';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$line .= $word . ' ';\r\n\t\t\t\t}\r\n\t\t\t\t$dstLines[] = ' ' . trim($line); //Add the line when the line ends.\r\n\t\t}\r\n\t\t//Calculate lineheight by common characters.\r\n\t\t$dimensions = imagettfbbox($textSize, 0, $font, \"MXQJPmxqjp123\"); //use a custom string to get a fixed height.\r\n\t\t$lineHeight = $dimensions[1] - $dimensions[5]; // get the heightof this line\r\n\t\t$align = strtolower(substr($align, 0, 1)); //Takes the first letter and converts to lower string. Support for Left, left and l etc.\r\n\t\tif (count($dstLines) > 2)\r\n\t\t{\r\n\t\t\t\techo \"<strong>Sorry,<br /> Your text exceeds the size of this sign.<br /> Please shorten your message or try a smaller font size and try again!</strong><br />\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\tforeach ($dstLines as $nr => $line)\r\n\t\t\t\t{\r\n\t\t\t\t\t\tif ($align != \"l\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$dimensions = imagettfbbox($textSize, 0, $font, $line);\r\n\t\t\t\t\t\t\t\t$lineWidth = $dimensions[4] - $dimensions[0]; // get the length of this line\r\n\t\t\t\t\t\t\t\tif ($align == \"r\")\r\n\t\t\t\t\t\t\t\t{ //If the align is Right\r\n\t\t\t\t\t\t\t\t\t\t$locX = $x + $width - $lineWidth;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{ //If the align is Center\r\n\t\t\t\t\t\t\t\t\t\t$locX = $x + ($width / 2) - ($lineWidth / 2);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{ //if the align is Left\r\n\t\t\t\t\t\t\t\t$locX = $x;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$locY = $y + ($nr * $lineHeight);\r\n\t\t\t\t\t\t//Print the line.\r\n\t\t\t\t\t\tif (count($dstLines) < 2)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$locY = $locY + 8;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\timagettftext($img, $textSize, 0, $locX, $locY, $color, $font, $line);\r\n\t\t\t\t}\r\n\t\t}\r\n}",
"public function despeckleImage () {}",
"function flotheme_clear_images($content)\n{\n\treturn preg_replace('/<a[^>]*>(<img[^>]*>)<\\/a>/iu', '$1', $content);\n}",
"function none_image($width = 150, $height = 150, $text = 'none image')\n { \n return \"http://www.placehold.it/{$width}x{$height}/EFEFEF/AAAAAA&text=\"\n . preg_replage('/\\s/', '+', $text);\n }",
"public function removeImagesFromContent() {\n\t\t$this->content = preg_replace('/<img[^>]*>/Ui', '', $this->content );\n\t}",
"public static function clear()\n {\n echo Background::DEFAULT . Text::DEFAULT . \"\\n\";\n }",
"public function despeckleImage() {\n\t}",
"function <%= name %>_remove_p_around_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}",
"function hrld_remove_filters(){\n\tremove_filter('image_send_to_editor', 'image_add_caption', 20, 8);\n}",
"public function clear() {\n $this->textBuf = \"\";\n $this->newBreak = true;\n }",
"function content_remove_wrapping_p( $html ) {\n\n // Iterating a nodelist while manipulating it is not a good thing, because\n // the nodelist dynamically updates itself. Get all things that must be\n // unwrapped and put them in an array.\n $tagNames = array( 'img', 'picture', 'video', 'audio', 'iframe' );\n $mediaElements = array();\n foreach ( $tagNames as $tagName ) {\n $nodes = $html->getElementsByTagName( $tagName );\n foreach ( $nodes as $node ) {\n $mediaElements[] = $node;\n }\n }\n\n foreach ( $mediaElements as $element ) {\n\n // Get a reference to the parent paragraph that may have been added by\n // WordPress. It might be the direct parent node or the grandparent\n // (LOL) in case of links\n $paragraph = null;\n\n // Get a reference to the image itself or to the link containing the\n // image, so we can later remove the wrapping paragraph\n $theElement = null;\n\n if ( $element->parentNode->nodeName == 'p' ) {\n $paragraph = $element->parentNode;\n $theElement = $element;\n } else if ( $element->parentNode->nodeName == 'a' &&\n $element->parentNode->parentNode->nodeName == 'p' ) {\n $paragraph = $element->parentNode->parentNode;\n $theElement = $element->parentNode;\n }\n\n // Make sure the wrapping paragraph only contains this child\n if ( $paragraph && $paragraph->textContent == '' ) {\n $paragraph->parentNode->replaceChild( $theElement, $paragraph );\n }\n }\n\n}",
"public function removeImage () {}",
"public function clear()\n {\n $this->footnotes = [];\n }",
"public function removeWatermark();",
"private function custom_clear()\n\t{\n\t\t$props = array('library_path', 'source_image', 'new_image', 'width', 'height', 'rotation_angle', 'x_axis', 'y_axis', 'wm_text', 'wm_overlay_path', 'wm_font_path', 'wm_shadow_color', 'source_folder', 'dest_folder', 'mime_type', 'orig_width', 'orig_height', 'image_type', 'size_str', 'full_src_path', 'full_dst_path');\n\n\t\tforeach ($props as $val)\n\t\t{\n\t\t\t$this->CI->image_lib->$val = '';\n\t\t}\n\n\t\t$this->CI->image_lib->image_library \t\t= 'gd2';\n\t\t$this->CI->image_lib->dynamic_output \t\t= FALSE;\n\t\t$this->CI->image_lib->quality \t\t\t\t= '90';\n\t\t$this->CI->image_lib->create_thumb \t\t\t= FALSE;\n\t\t$this->CI->image_lib->thumb_marker \t\t\t= '_thumb';\n\t\t$this->CI->image_lib->maintain_ratio \t\t= TRUE;\n\t\t$this->CI->image_lib->master_dim \t\t\t= 'auto';\n\t\t$this->CI->image_lib->wm_type \t\t\t\t= 'text';\n\t\t$this->CI->image_lib->wm_x_transp \t\t\t= 4;\n\t\t$this->CI->image_lib->wm_y_transp \t\t\t= 4;\n\t\t$this->CI->image_lib->wm_font_size \t\t\t= 17;\n\t\t$this->CI->image_lib->wm_vrt_alignment \t\t= 'B';\n\t\t$this->CI->image_lib->wm_hor_alignment \t\t= 'C';\n\t\t$this->CI->image_lib->wm_padding \t\t\t= 0;\n\t\t$this->CI->image_lib->wm_hor_offset \t\t= 0;\n\t\t$this->CI->image_lib->wm_vrt_offset \t\t= 0;\n\t\t$this->CI->image_lib->wm_font_color\t\t\t= '#ffffff';\n\t\t$this->CI->image_lib->wm_shadow_distance \t= 2;\n\t\t$this->CI->image_lib->wm_opacity \t\t\t= 50;\n\t\t$this->CI->image_lib->create_fnc \t\t\t= 'imagecreatetruecolor';\n\t\t$this->CI->image_lib->copy_fnc \t\t\t\t= 'imagecopyresampled';\n\t\t$this->CI->image_lib->error_msg \t\t\t= array();\n\t\t$this->CI->image_lib->wm_use_drop_shadow \t= FALSE;\n\t\t$this->CI->image_lib->wm_use_truetype \t\t= FALSE;\n\t}",
"private function removeATags ($text)\n\t{\n\t\t$search = \"/(<a[^>]+>)(<img[^>]+>)(<\\/a>)/i\";\n\n\t\t$replace = '$2';\n\n\t\t$text = preg_replace($search, $replace, $text);\n\t\n\t\treturn $text;\n\n\t}",
"function hrld_cleanup_image_add_caption( $matches ) {\n\treturn preg_replace( '/[\\r\\n\\t]+/', ' ', $matches[0] );\n}",
"function remove_p_on_img($content) {\r\n return preg_replace('/<p>[^<>]*(<img .+?>)[^<>]*<\\/p>/i', '\\1', $content);\r\n}",
"function remove_($string) {\n $string = nl2br($string);\n $string = str_replace(\"[center]\",\"\",$string);\n $string = str_replace(\"[/center]\",\"\",$string);\n $string = str_replace(\"<br />\",\"\",$string);\n $string = delete_all_between(\"[img]\",\"[/img]\",$string);\n $string = getStringBetween($string,\"΅\",\"΅\");\n $string = substr($string,1);\n return $string;\n}",
"public function clearLines();",
"function remove_ptags_on_images( $content ) {\n\n return preg_replace( '/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content );\n\n}",
"private function clearStyles()\n {\n return \"\\e[0m\";\n }",
"function clear()\n {\n if ($this->closed) throw new \\Exception(\"CommandLiner instance close()d\");\n\n // We do it like this because the backspace seemingly doesn't clear text.\n // In other words, we back up, fill with spaces, and back up again.\n $text = str_repeat(\"\\x08\", $this->characters)\n . str_repeat(\" \" , $this->characters)\n . str_repeat(\"\\x08\", $this->characters);\n $this->output($text);\n\n $this->characters = 0;\n }",
"function flotheme_remove_first_image($content = null) \n{\n if (!$content) {\n $content = get_the_content();\n }\n $content = trim(preg_replace('~(<img[^>]+>)~sim', '', $content, 1));\n return $content;\n}",
"public function removeImage() {\n\t}",
"function clear() { \n // clear all the class member variables\n $this->image_original=0; \n $this->file_original=\"\"; \n $this->image_original_width=0; \n $this->image_original_height =0; \n $this->image_original_type_code=0; \n $this->image_original_type_abbr=\"\"; \n $this->image_original_html_sizes =\"\"; \n $this->image_resized=0; \n $this->file_resized=\"\"; \n $this->image_resized_width=0; \n $this->image_resized_height=0; \n $this->image_resized_type_code=-1; \n $this->image_resized_type_abbr=\"\"; \n $this->image_resized_html_sizes=\"\"; \n $this->set_parameters(); \n}",
"function flotheme_remove_images($content = null) {\n if (!$content) {\n $content = get_the_content();\n }\n $content = trim(preg_replace('~(<a[^>]+>)?\\s*(<img[^>]+>)\\s*(</a>)?~sim', '', $content));\n return $content;\n}",
"function ale_remove_images($content = null) {\n if (!$content) {\n $content = get_the_content();\n }\n $content = trim(preg_replace('~(<a[^>]+>)?\\s*(<img[^>]+>)\\s*(</a>)?~sim', '', $content));\n return $content;\n}"
] | [
"0.6315739",
"0.62049305",
"0.6113617",
"0.6050976",
"0.60509604",
"0.601212",
"0.59835845",
"0.596086",
"0.59453946",
"0.5824035",
"0.57820207",
"0.5737631",
"0.57302994",
"0.56260353",
"0.55929226",
"0.5571697",
"0.5558325",
"0.5511429",
"0.55077475",
"0.55042887",
"0.54597116",
"0.5449371",
"0.5404733",
"0.5387475",
"0.5380597",
"0.53756636",
"0.53732646",
"0.5354175",
"0.53325933",
"0.5330354"
] | 0.75909793 | 0 |
Resets the size settings of the component | public function resetSize() {
$this->removeCssClass(...self::$sizes);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function reset()\n {\n $this->values[self::WIDTH] = 0;\n $this->values[self::HEIGHT] = 0;\n }",
"public static function clearSizeContentPost() \n\t{ \n\t\tself::setSizeContentPost(100); \n\t}",
"public function setSize($size) {\n $this->setData('size', $size);\n }",
"public function setSize($size) {\n $this->size = $size;\n }",
"public function setSize($size)\n {\n $this->size = $size;\n }",
"private function reset_packed_dimensions() {\n\t\t$this->packed_length = $this->length;\n\t\t$this->packed_width = $this->width;\n\t\t$this->packed_height = $this->height;\n\t}",
"public function setSize($size)\n {\n $this->size = $size;\n }",
"function shrink() {\n if ($this->scale == 0.5) {\n return;\n }\n foreach (array_keys($this->largeWidgets) as $w) {\n $this->largeWidgets[$w]->hide();\n }\n foreach(array_keys($this->fields) as $i=>$name) {\n $this->fields[$name]->shrink();\n }\n $this->scale = 0.5;\n $this->x *= 0.5;\n $this->y *= 0.8;\n //$this->title->hide();\n //$this->table->remove($this->title);\n //$this->table->attach( $this->title,\n // 1,2,\n // 1,2,\n // GTK_FILL, // xdir\n // GTK_SHRINK // ydir\n //);\n $this->widgets['addRow']->set_sensitive(false);\n $this->database->move($this->frame, $this->x, $this->y );\n \n \n }",
"public function set_size($size = 100) {\n\n // Resize\n if ($this->x_input > $size && $this->y_input > $size) {\n\n // Wide\n if ($this->x_input >= $this->y_input) {\n\n $this->x_output = $size;\n $this->y_output = ($this->x_output / $this->x_input) * $this->y_input;\n\n } // Tall\n else {\n\n $this->y_output = $size;\n $this->x_output = ($this->y_output / $this->y_input) * $this->x_input;\n\n }\n\n // Ready\n $this->resize = TRUE;\n\n } // Don't resize\n else { $this->resize = FALSE; }\n\n }",
"public function erase()\n {\n $this->widths = null;\n $this->frame->clearComponents();\n $this->frame->destroy();\n $this->destroyComponents();\n parent::destroy();\n }",
"function setSize()\n\t\t{\t\n\t\t\t$ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t$ratio=$this->reduction_width/$this->reduction_height;\n\t\t\tif($ratio_image<$ratio)\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t $this->resizeY=$this->reduction_height;\n\t\t\t $this->resizeX=round($ratio_image*$this->resizeY);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeY/$this->imageSizeX;\n\t\t\t $this->resizeX=$this->reduction_width;\n\t\t\t $this->resizeY=round($ratio_image*$this->resizeX);\n\t\t\t}\n\t\t\n /*if($this->imageSizeY<$this->imageSizeX){\n $ratio=$this->imageSizeY/$this->imageSizeX;\n $this->resizeX=$this->reduction_width;\n $this->resizeY=round($ratio*$this->reduction_width);\n }else{\n $ratio=$this->imageSizeX/$this->imageSizeY;\n $this->resizeY=$this->reduction_height;\n $this->resizeX=round($ratio*$this->reduction_height);\n }*/\n }",
"public function setSize($data) {$this->_size = $data; }",
"public function set_size($size = 100)\n {\n\n // Resize\n if($this->x_input > $size && $this->y_input > $size)\n {\n\n // Wide\n if($this->x_input >= $this->y_input)\n {\n\n $this->x_output = $size;\n $this->y_output = ($this->x_output / $this->x_input) * $this->y_input;\n\n }\n\n // Tall\n else\n {\n\n $this->y_output = $size;\n $this->x_output = ($this->y_output / $this->y_input) * $this->x_input;\n\n }\n\n // Ready\n $this->resize = TRUE;\n\n }\n\n // Don't resize\n else { $this->resize = FALSE; }\n\n }",
"public function setSize($size) {\n $this->size = intval($size);\n }",
"public function renderSize()\n {\n $this->setRender(\" size='{$this->component->getSize()}'\");\n return $this;\n }",
"public final function setSize($size){\n\t\tif(FW_Validate::isInteger($size)){\n\t\t\t$this->size = $size;\n\t\t}\n\t}",
"function set_size($size)\r\n {\r\n $this->size = $size;\r\n }",
"function set_size($size)\r\n {\r\n $this->size = $size;\r\n }",
"function setWidth( $value )\r\n {\r\n $this->Width = $value;\r\n }",
"public function setSize($size)\n {\n $this->_size = $size;\n return $this;\n }",
"public function setSize($value)\n {\n $this->setProperty(\"Size\", $value, true);\n }",
"public function reset() {\n $this->values[self::NORMAL] = null;\n $this->values[self::IMAGE] = null;\n $this->values[self::PANEL] = null;\n }",
"public function setSize(Vector2U $size): void\r\n {\r\n $this->sfml->window->ffi->sfWindow_setSize($this->cdata, $size->asWindow());\r\n }",
"public function setWidth(): void\n {\n global $content_width;\n $content_width = $this->contentWidth;\n }",
"public function resetStyles() {\n $this->style = array();\n }",
"public function setSize($Size){\n return $this->size = $Size;\n }",
"public function setSize($size = null) {\n\t\t$this->size = $size;\n\t\treturn $this;\n\t}",
"public function setSize($size)\n {\n $this->size = $size;\n return $this;\n }",
"public function setSize($size)\n {\n $this->size = $size;\n return $this;\n }",
"protected function clearLayout() {\n \t$this->layout = null;\n }"
] | [
"0.6345371",
"0.616597",
"0.6127592",
"0.6127204",
"0.60682625",
"0.59674245",
"0.59627527",
"0.5939923",
"0.589846",
"0.58902806",
"0.5882805",
"0.58739334",
"0.5828534",
"0.5761175",
"0.574683",
"0.56924695",
"0.56910354",
"0.56910354",
"0.5682017",
"0.56423986",
"0.56403303",
"0.55822545",
"0.5536479",
"0.55298686",
"0.5525857",
"0.5485148",
"0.54566747",
"0.5414656",
"0.5414656",
"0.5410659"
] | 0.6839972 | 0 |
load not installed page if script is not installed | function index() {
include(BASE_PATH.'installer/not_installed.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function external_script_install()\n{\n return true;\n}",
"function checkInstall() {\n\tif ((getOption('zenphoto_release') != ZENPHOTO_RELEASE) ||\n\t\t\t(defined('RELEASE') && (getOption('zenphoto_install') != installSignature()))) {\n\t\tif (file_exists(dirname(__FILE__).'/setup.php')) {\n\t\t\theader(\"Location: \" . FULLWEBPATH . \"/\" . ZENFOLDER . \"/setup.php\");\n\t\t\texit();\n\t\t} else {\n\t\t\tdie('setup scripts missing');\n\t\t}\n\t}\n}",
"function jsautodiscovery() \r\n\t\t{\r\n\t\t\tglobal $CONF;\r\n\t\t\r\n\t\t\t?>\r\n\t\t\t\t<script type='text/javascript' src='<?php echo $this->getAdminURL(); ?>autodetect.php'></script>\t\r\n\t\t\t<?php\r\n\t\t}",
"function udi_dspe_fail_load() {\r\n\t$screen = get_current_screen();\r\n\tif ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {\r\n\t\treturn;\r\n\t}\r\n\t$plugin = 'elementor/elementor.php';\r\n\tif ( _is_elementor_installed() ) {\r\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin );\r\n\t\t$message = '<p>' . __( 'Display Specific Products for Elementor is not working because you need to activate the Elementor plugin.', 'udi-dspe' ) . '</p>';\r\n\t\t$message .= '<p>' . sprintf( '<a href=\"%s\" class=\"button-primary\">%s</a>', $activation_url, __( 'Activate Elementor Now', 'udi-dspe' ) ) . '</p>';\r\n\t} else {\r\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );\r\n\t\t$message = '<p>' . __( 'Display Specific Products for Elementor is not working because you need to install the Elementor plugin', 'udi-dspe' ) . '</p>';\r\n\t\t$message .= '<p>' . sprintf( '<a href=\"%s\" class=\"button-primary\">%s</a>', $install_url, __( 'Install Elementor Now', 'udi-dspe' ) ) . '</p>';\r\n\t}\r\n\techo '<div class=\"error\"><p>' . $message . '</p></div>';\r\n}",
"function html5blank_conditional_scripts()\n{\n if (is_page('pagenamehere')) {\n wp_register_script('scriptname', get_template_directory_uri() . '/js/scriptname.js', array('jquery'), '1.0.0'); // Conditional script(s)\n wp_enqueue_script('scriptname'); // Enqueue it!\n }\n}",
"function Install() {\n if ($this->checkInstall()) {\n include($this->_addon . \"install.php\");\n return true;\n }\n \n function NotInstall(){\n if ($this->checkInstall()){\n include($this->_addon . \"install.php\")}\n return false;\n } \n \n }",
"function checkInstall() {\n if (file_exists($this->_addon . \"install.php\"))\n return true;\n }",
"function odiogo_listen_now_js ()\r\n{\r\n\tif (! odiogo_get_option ('odiogo_safe_include'))\r\n\t{\r\n\t\techo odiogo_listen_now_js_code ();\r\n\t}\r\n}",
"function installed() {\r\n include(BASE_PATH.'installer/installed.php');\r\n }",
"public function loadScript(){\n \t\treturn null;\n \t}",
"public function testNonExistingJavaScriptFilesAccess(): void\n {\n $client = static::createPantherClient();\n\n $jsFile = '/build/app-non-existing.js';\n\n $crawler = $client->request('GET', $jsFile);\n\n $this->assertPageTitleContains('No route found for \"GET '.$jsFile.'\" (404 Not Found)');\n }",
"function html_include_script($script_path)\n{\n\tglobal $config;\n\t\n\tif (preg_match('/^http:/', $script_path))\n\t{\n\t\t// Externally hosted\n\t\treturn '<script type=\"text/javascript\" src=\"' . $script_path . '\"></script>' . \"\\n\";\n\t}\n\telse\n\t{\n\t\treturn '<script type=\"text/javascript\" src=\"' . $config['web_root'] . $script_path . '\"></script>' . \"\\n\";\n\t}\n}",
"public function missing() {\n require APP . 'view/_templates/header.php';\n require APP . 'view/season/no_season_exists.php';\n require APP . 'view/_templates/footer.php';\n }",
"function _manually_load_plugin() {\n\n\trequire dirname( dirname( __FILE__ ) ) . '/ufhealth-who-wrote-what.php';\n\n}",
"function showInstall()\n {\n /** @var \\Base $f3 */\n $f3 = \\Base::instance();\n\n if (!$this->isInstalled()) {\n// $f3->set('languages', $f3->get('languages'));\n echo Template::instance()->render('installation/install.php');\n } else {\n // todo: change to template\n echo \"WorkTime ist already installed\";\n }\n\n }",
"public static function isPortalMustNotBeLoaded()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\tif (!defined('LP_NAME') || !empty($context['uninstalling']) || Helpers::request()->is('printpage')) {\n\t\t\t$modSettings['minimize_files'] = 0;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function init_scripts() {\n\treturn true;\n}",
"public function page_missing()\n\t{\n\t\t$this->error_not_found();\n\t}",
"function livewebteaching_install() {\n return true;\n}",
"public function load_default_fp_scripts(){ $this->frontend->load_default_fp_scripts(); }",
"public static function loadInstalled($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function hestia_require() {\n\t\tthemeisle_hestia_require();\n\t}",
"function test_cf7_js_should_not_be_loaded()\n\t{\n\t\tdo_action( 'wp_enqueue_scripts' );\n\t\t$this->assertFalse( wp_script_is( 'contact-form-7' ) );\n\t}",
"function booklovers_instagram_widget_importer_required_plugins($not_installed='', $list='') {\n\t\tif (booklovers_strpos($list, 'instagram_widget')!==false && !booklovers_exists_instagram_widget() )\n\t\t\t$not_installed .= '<br>' . esc_html__('WP Instagram Widget', 'booklovers');\n\t\treturn $not_installed;\n\t}",
"public function rel_include_scripts() {\n \n }",
"function getJs(string $pageName){\n global $js,$error404;\n\n if( file_exists($js.$pageName.\".js\") ){\n echo '<script src=\"'.$js.$pageName.'.js\"></script><br />';\n return true;\n } else {\n $_SESSION['404Error'] = \" This javaScript file [ ' $pageName'.js ] Not Found <br /><br /> هذه الصفحة غير موجودة <hr />\";\n include($error404);\n return true;\n }\n }",
"function bframework_instllation_ok(){\ninclude(bframework_installation('template').'ok.php');\n}",
"function from_scratch_scripts_load() {\n if (!is_admin()) {\n\n\t\t// JS \n\t\t\n\t\twp_enqueue_script( 'jquery' );\n\n\t\twp_enqueue_script(\n\t\t\t'from-scratch-skip-link-focus-fix', \n\t\t\tget_template_directory_uri() . '/js/skip-link-focus-fix.js', \n\t\t\tarray(), \n\t\t\tfalse, \n\t\t\ttrue\n\t\t);\n\t\t\n\t wp_enqueue_script( \n\t \t'main', \n\t \tget_template_directory_uri() . '/js/main.js',\n\t \tarray('jquery'), \n\t \t'1.0', \n\t \ttrue\n\t );\n\t \n\t if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t\t\n\t\t\n\t\t// CSS\n\t\t\n\t\twp_enqueue_style( \n\t\t\t'pridx', \n\t\t\tget_template_directory_uri() . '/css/pridx.css',\n\t\t\tarray(), \n\t\t\t'1.7', \n\t\t\t'screen' \n\t\t);\n\t\t\n\t\t\n\t\t// Main stylesheet\n\t\t\n\t\twp_enqueue_style( 'from-scratch-style', get_stylesheet_uri() );\n\n\t}\n}",
"private static function executeWithoutPage($requestedTemplate){\n\t\tself::interalPreExecute(); //Call the global RequestHandler pre-execution function. Take care of anything that should happen before the page begins loading.\n\t\t$templateReferenceVar = new NoPage(); //This is essentially to make error reporting obvious. If the template without an associated php file tries to call functions as though there is a php file for it, this will output some nice helpful errors.\n\t\t$templateReferenceVar->executeTemplate($requestedTemplate);\n\t}",
"function mcw_efu_VCNotActivated() {\r\n echo '<div class=\"updated\"><p><strong>Elements for Users - Addon for WPBakery Page Builder</strong> plugin requires <strong>WPBakery Page Builder</strong> plugin installed and activated.</p></div>';\r\n }"
] | [
"0.63937014",
"0.6135083",
"0.6011612",
"0.59980196",
"0.59033257",
"0.58988565",
"0.58133006",
"0.5780355",
"0.5708872",
"0.56890273",
"0.5679957",
"0.56759495",
"0.56756306",
"0.5653943",
"0.5649887",
"0.56416214",
"0.5610139",
"0.56021273",
"0.55954677",
"0.55824465",
"0.55689657",
"0.55656904",
"0.5550844",
"0.5544518",
"0.5536253",
"0.55345255",
"0.5530278",
"0.5526193",
"0.5523094",
"0.54956645"
] | 0.68749934 | 0 |
handles installer ajax requests | function ajax(){
include(BASE_PATH.'installer/ajax.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function ajaxInstallPlugin()\n {\n // Find the product ID\n $product = isset($_POST['slug']) ? $_POST['slug'] : null;\n\n // Run the installer\n static::ajaxInstallProduct($product);\n }",
"public static function ajaxUpdatePlugin()\n {\n // Find the product ID\n $products = isset($_POST['checked']) ? $_POST['checked'] : null;\n $product = isset($_POST['slug']) ? $_POST['slug'] : null;\n\n // Run the installer\n if ($products) {\n static::ajaxInstallProducts($products);\n } else {\n static::ajaxInstallProduct($product);\n }\n }",
"public static function ajaxInstallTheme()\n {\n // Find the product ID\n $product = isset($_POST['slug']) ? $_POST['slug'] : null;\n\n // Run the installer\n static::ajaxInstallProduct($product);\n }",
"public function installAction()\n\t{\n\t\t$this->ajax->disableArray();\n\t\t\n\t\t$plugin = (string) $this->request->get('id');\n\n\t\t$row = Plugins::findFirstByName($plugin);\n\n\t\t$resp = $this->ajax->error(\"{$plugin} : Unknown Plugin !\");\n\t\tif ($row)\n\t\t\treturn $this->ajax->error(strip_tags($row->title).': Plugin Already Installed')->sendResponse();\n\n\t\tif ( !preg_match('/^[a-zA-Z0-9]{2,31}$/', $plugin) )\n\t\t\treturn $this->ajax->error(\"Plugin \".strip_tags($plugin).\" Name is invalid !\")->sendResponse();\n\n\n\t\t$plugins_path_url = \"{$this->plugins_server}{$plugin}/\".self::PLUGIN_CONFIG_JSON.\"?i=\".rand();\n\t\t// get plugin info\n\t\t$plugin_info_json = $this->getRequestContent($plugins_path_url);\n\n\t\ttry {\n\t\t\t$plugin_info = json_decode($plugin_info_json);\n\n\t\t\tif (!empty($plugin_info->name)) {\n\t\t\t\t$this->ajax->setData(['json'=>$plugin_info,'path'=>$plugins_path_url]);\n\t\t\t\t\n\t\t\t\t$zipFileUrl = $plugin_info->zip ?? null;\n\t\t\t\tif(!$zipFileUrl)\n\t\t\t\t\treturn $this->ajax->error('Unknown Plugin zip path file !')->sendResponse();\n\n\t\t\t\t$zipFileUrl = \"{$this->plugins_server}{$zipFileUrl}\";\n\n\t\t\t\tif (!\\Sakura\\Helpers\\Functions::_isUrlAZipFile($zipFileUrl)) {\n\t\t\t\t\t$this->ajax->error(\"Plugin ($zipFileUrl) file is not a zip file \");\n\t\t\t\t}else{\n\t\t\t\t\t$zipFileSavePath = $this->config->application->cache->plugins . $plugin . \".zip\";\n\n\t\t\t\t\t$download = \\Sakura\\Helpers\\Functions::_downloadZipFile($zipFileUrl , $zipFileSavePath);\n\n\t\t\t\t\tif (!$download) \n\t\t\t\t\t\treturn $this->ajax->error(\"Download plugin failed ! $zipFileUrl\")->sendResponse();\n\t\t\t\t\t\n\n\t\t\t\t\t$unzip = $this->unzipPlugin($plugin_info, $zipFileSavePath);\n\t\t\t\t\tif (!$unzip) \n\t\t\t\t\t\treturn $this->ajax->error('Unzipping plugin failed ! ')->sendResponse();\n\n\t\t\t\t\t$row = new Plugins();\n\t\t\t\t\tforeach (['image','name','title','description','author','version','tags'] as $key) {\n\t\t\t\t\t\tif (isset($plugin_info->$key)) \n\t\t\t\t\t\t\t$row->$key = $plugin_info->$key;\n\t\t\t\t\t}\n\t\t\t\t\t$row->status = $this::ACTIVE;\n\t\t\t\t\t$row->setIp($this->request);\n\n\t\t\t\t\tif ($row->save()) {\n\t\t\t\t\t\t$this->ajax->clearMessages()->success(\"Plugin {$plugin_info->name} installed successfully !\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tforeach ($row->getMessages() as $msg)\n\t\t\t\t\t\t\t$this->ajax->error($msg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $this->ajax->sendResponse();\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->ajax->error('Invalid Plugins info\\'s '. $e->getMessage())->sendResponse();\n\t\t}\n\n \treturn $this->ajax->sendResponse();\n\t}",
"public static function ajaxUpdateTheme()\n {\n // Find the product ID\n $product = isset($_POST['slug']) ? $_POST['slug'] : null;\n\n // Run the installer\n static::ajaxInstallProduct($product);\n }",
"public function ajax_handler() {\n\t\tif ( empty( $_REQUEST['step'] ) ) {\n\t\t\t$response = array(\n\t\t\t\t'error' => 'Invalid step',\n\t\t\t);\n\t\t} else {\n\t\t\t$response = (array) $this->execute_step( sanitize_text_field( $_REQUEST['step'] ) );\n\t\t}\n\n\t\twp_send_json( $response );\n\t}",
"public function installAJAXscripts()\n {\n $log = start_install_log(\"installAJAXscripts\");\n if (self::copySystemFiles(\"ajax\", $this->src_path, ajaxPath)) {\n $log->write(\"Installed AJAX scripts of module\" . $this->module, LOG_INFO);\n return true;\n } else\n return false;\n }",
"public function ajax()\n\t{\n\t\t/*\n\t\t * Note: we don't do a token check as we're fetching information\n\t\t * asynchronously. This means that between requests the token might\n\t\t * change, making it impossible for AJAX to work.\n\t\t */\n\n\t\t$eid = $this->input->getInt('eid', 0);\n\t\t$skip = $this->input->get('skip', array(), 'array');\n\n\t\t$cache_timeout = $this->input->getInt('cache_timeout', 0);\n\t\tif ($cache_timeout == 0)\n\t\t{\n\t\t\t$component = JComponentHelper::getComponent('com_installer');\n\t\t\t$params = $component->params;\n\t\t\t$cache_timeout = $params->get('cachetimeout', 6, 'int');\n\t\t\t$cache_timeout = 3600 * $cache_timeout;\n\t\t}\n\n\t\t$model = $this->getModel('update');\n\t\t$model->findUpdates($eid, $cache_timeout);\n\n\t\t$model->setState('list.start', 0);\n\t\t$model->setState('list.limit', 0);\n\t\tif ($eid != 0)\n\t\t{\n\t\t\t$model->setState('filter.extension_id', $eid);\n\t\t}\n\t\t$updates = $model->getItems();\n\n\t\tif (!empty($skip))\n\t\t{\n\t\t\t$unfiltered_updates = $updates;\n\t\t\t$updates = array();\n\t\t\tforeach ($unfiltered_updates as $update)\n\t\t\t{\n\t\t\t\tif (!in_array($update->extension_id, $skip))\n\t\t\t\t{\n\t\t\t\t\t$updates[] = $update;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo json_encode($updates);\n\n\t\tJFactory::getApplication()->close();\n\t}",
"public function ajaxRequestInfo() {\r\n\t\tif ( $_POST['slug'] !== $this->updateChecker->slug ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->preAjaxReqest();\r\n\t\t$info = $this->updateChecker->requestInfo();\r\n\t\tif ( $info !== null ) {\r\n\t\t\techo 'Successfully retrieved plugin info from the metadata URL:';\r\n\t\t\techo '<pre>', htmlentities(print_r($info, true)), '</pre>';\r\n\t\t} else {\r\n\t\t\techo 'Failed to retrieve plugin info from the metadata URL.';\r\n\t\t}\r\n\t\texit;\r\n\t}",
"abstract protected function processAJAX();",
"function HD_program_ajax(){\n\trequire_once(HD_PLUGIN_DIR.'/program/ajax.program.php');\n\t$function = 'HD_program_ajax_'.$_POST['handle'];\n\t$function();\n}",
"public function ajaxProcess()\n {\n }",
"public function aj_steps() {\n require_once('asyncjsAllAjax.php');\n }",
"public function handleRequest()\n {\n if (isset($_POST[\"ajaxaction\"]) || isset($_GET[\"ajaxaction\"]))\n {\n // $this->handleAjaxRequest();\n }\n else\n {\n $this->handleHttpRequest();\n } \n }",
"public static function pageAjax() {\n if ( isset($_POST['get_started']) ) {\n // check for required privileges to perform action\n if ( function_exists('current_user_can') && !current_user_can('manage_options') ) {\n echo Zend_Json::encode(array('success' => false));\n die;\n }\n\n if ( function_exists('check_admin_referer') ) {\n check_admin_referer('laterpay_form');\n }\n\n // save initial settings\n update_option('laterpay_sandbox_api_key', $_POST['get_started']['laterpay_sandbox_api_key']);\n update_option('laterpay_sandbox_merchant_id', $_POST['get_started']['laterpay_sandbox_merchant_id']);\n update_option('laterpay_global_price', $_POST['get_started']['laterpay_global_price']);\n update_option('laterpay_currency', $_POST['get_started']['laterpay_currency']);\n update_option('laterpay_plugin_is_activated', '1');\n\n // automatically dismiss pointer to LaterPay plugin after saving the initial settings\n $current_user_id = get_current_user_id();\n $dismissed_pointers = explode(',', (string)get_user_meta($current_user_id, 'dismissed_wp_pointers', true));\n\n if ( !in_array(AdminController::ADMIN_MENU_POINTER, $dismissed_pointers) ) {\n update_user_meta($current_user_id, 'dismissed_wp_pointers', AdminController::ADMIN_MENU_POINTER);\n }\n\n echo Zend_Json::encode(array('success' => true));\n die;\n }\n }",
"public function handleRequest()\n {\n if (isset($_POST[\"ajaxaction\"]) || isset($_GET[\"ajaxaction\"]))\n {\n $this->ajax->handleAjaxRequest();\n }\n else\n {\n $this->handleHttpRequest();\n } \n }",
"private function preAjaxReqest() {\r\n\t\tif ( !current_user_can('update_plugins') ) {\r\n\t\t\tdie('Access denied');\r\n\t\t}\r\n\t\tcheck_ajax_referer('puc-ajax');\r\n\r\n\t\terror_reporting(E_ALL);\r\n\t\t@ini_set('display_errors','On');\r\n\t}",
"public function ajaxProcess()\n\t{\n\t}",
"public function userinfoajax()\n {\n \t//kani na part kay ajax ni kabalo ko na kabalo ka mu ajax.\n }",
"public function admin_init(){\n\t\tif(isset($_GET['page']) && $_GET['page'] == 'zip-search' && $this->ajaxable()){\n\t\t\twp_enqueue_script(\n\t\t\t\t'hametuha-zip-search',\n\t\t\t\tplugin_dir_url(__FILE__).'ajax.js',\n\t\t\t\tarray('jquery'),\n\t\t\t\t$this->version\n\t\t\t);\n\t\t\twp_localize_script('hametuha-zip-search', 'HametuhaZipSearch', array(\n\t\t\t\t'endpoint' => admin_url('admin-ajax.php'),\n\t\t\t\t'action' => 'hametuha_zip_edit',\n\t\t\t\t'nonce' => wp_create_nonce('hametuha_zip_edit'),\n\t\t\t\t'csv' => $this->current_csv(),\n\t\t\t\t'action_name' => $this->current_action()\n\t\t\t));\n\t\t}\n\t}",
"function install_from_folder($tpl = null) \n {\n $shellob =& VWP::getShell();\n \n // Initialize tabs\n \n $current_widget = 'install';\n $shellob->setVar('current_widget',$current_widget);\n \n $menu = $this->getWidget(\"tabs\");\n \n if (!VWP::isWarning($menu)) {\n $menu = $menu->build(); \n }\n \n $menu_foot = $this->getWidget(\"tabs\");\n \n if (!VWP::isWarning($menu_foot)) {\n $menu_foot = $menu_foot->build('foot'); \n }\n \n if (VWP::isWarning($menu)) {\n $menu->ethrow();\n $menu = null;\n }\n\n if (VWP::isWarning($menu_foot)) {\n $menu_foot->ethrow();\n $menu_foot = null;\n } \n\n $this->assignRef('menu',$menu);\n $this->assignRef('menu_foot',$menu_foot); \n \n // Install module\n \n $install = $this->getModel('install');\n $install_processed = true;\n $success = false;\n $complete = true;\n \n $folder = $shellob->getVar('folder',false);\n if ($folder === false) {\n VWP::raiseError('Missing folder in request!',get_class($this).\":install_from_folder\");\n } else {\n $result = $install->doInstall($folder);\n if (VWP::isWarning($result)) {\n $result->ethrow();\n } else {\n $success = $result[\"success\"];\n $complete = $result[\"complete\"];\n } \n }\n\n if ($success) {\n VWP::addNotice(\"Install Successful\");\n }\n \n $this->assignRef('install_processed',$install_processed); \n $this->assignRef('success',$success);\n $this->assignRef('complete',$complete);\n \n // Display result\n \n $screen = $shellob->getScreen();\n $this->assignRef('screen',$screen); \n parent::display($tpl);\n }",
"public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}",
"public function administrator_ajax_requests() {\r\n\r\n\t\t$is_administrator = false;\r\n\t\t$active_user = wp_get_current_user();\r\n\r\n\t\tif ( in_array( 'administrator', $active_user->roles, true ) ) {\r\n\t\t\t$is_administrator = true;\r\n\t\t}\r\n\r\n\t\tif ( true !== $is_administrator ) {\r\n\t\t\treturn false;\r\n\t\t\tdie();\r\n\t\t}\r\n\r\n\t\tswitch ( $_POST['section'] ) {\r\n\r\n\t\t\tcase 'update-fields-order':\r\n\r\n\t\t\t\t$filter_data = get_option( PluginMainModel::$meta_name_plugin_settings, true );\r\n\t\t\t\t$filter_data = json_decode( $filter_data, true );\r\n\r\n\t\t\t\tif ( ! isset( $filter_data['filterList'][ $_POST['filter_id'] ] ) ) {\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t\t$data = json_decode( wp_unslash( $_POST['fields'] ) );\r\n\r\n\t\t\t\t$filter_data['filterList'][ $_POST['filter_id'] ]['fields'] = json_decode( stripslashes( $_POST['fields'] ), true );\r\n\t\t\t\t$filter_data['filterList'][ $_POST['filter_id'] ]['shortcode_options'] = $_POST['options'];\r\n\r\n\t\t\t\tupdate_option( PluginMainModel::$meta_name_plugin_settings, wp_json_encode( $filter_data ) );\r\n\r\n\t\t\t\tdie();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'generate-theme-olor-style':\r\n\r\n\t\t\t\t$color = sanitize_text_field( wp_unslash( $_POST['color']['hex'] ) );\r\n\t\t\t\t$rgb_color = sanitize_text_field( wp_unslash( $_POST['color']['rgb'] ) );\r\n\r\n\t\t\t\techo esc_html( $this->generate_dynamic_css_color( array( 'hex' => $color, 'rgb' => $rgb_color ) ) );\r\n\r\n\t\t\t\tdie();\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'save-filter-settings':\r\n\r\n\t\t\t\t$filter_data = get_option( PluginMainModel::$meta_name_plugin_settings, true );\r\n\t\t\t\t$filter_data = json_decode( $filter_data, true );\r\n\r\n\t\t\t\t$filter_id = sanitize_text_field( wp_unslash( $_POST['filter_id'] ) );\r\n\r\n\t\t\t\tif ( ! isset( $filter_data['filterList'][ $filter_id ] ) ) {\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$f_data = json_decode( wp_unslash( $_POST['settings'] ), true );\r\n\r\n\t\t\t\t$filter_data['filterList'][ $filter_id ]['settings'] = $f_data['filterSettings'];\r\n\t\t\t\t$filter_data['filterList'][ $filter_id ]['options'] = $f_data['generalSettings'];\r\n\r\n\t\t\t\tupdate_option( PluginMainModel::$meta_name_plugin_settings, wp_json_encode( $filter_data ) );\r\n\r\n\t\t\t\tdie();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'get_taxonomies_and_terms':\r\n\r\n\t\t\t\t$post_type = sanitize_text_field( wp_unslash( $_POST['post_type'] ) );\r\n\t\t\t\t$model = $this->model;\r\n\r\n\t\t\t\t$data_categories = $model->get_post_categories( $post_type );\r\n\r\n\t\t\t\t$taxonomies = array();\r\n\r\n\t\t\t\t$count = 0;\r\n\r\n\t\t\t\tforeach ( $data_categories as $category ) {\r\n\r\n\t\t\t\t\tif ( isset( $category['categs'] ) && count( $category['categs'] ) > 0 ) {\r\n\r\n\t\t\t\t\t\t$taxonomies[ $count ]['categs'] = $category['categs'];\r\n\t\t\t\t\t\t$taxonomies[ $count ]['taxonomy'] = $category['taxonomy'];\r\n\r\n\t\t\t\t\t\t$count++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\techo wp_json_encode( $taxonomies );\r\n\r\n\t\t\t\tdie();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}",
"static public function handle_ajax() {\n\t\tlib2()->array->equip_post( 'do', 'order' );\n\n\t\t$action = $_POST['do'];\n\n\t\tswitch ( $action ) {\n\t\t\tcase 'order':\n\t\t\t\t$order = explode( ',', $_POST['order'] );\n\t\t\t\tself::post_order( $order );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t/**\n\t\t\t\t * Allow other modules to handle their own ajax requests.\n\t\t\t\t *\n\t\t\t\t * @since 4.6.1.1\n\t\t\t\t */\n\t\t\t\tdo_action( 'popup-ajax-' . $action );\n\t\t\t\treturn;\n\t\t}\n\n\t\tdie();\n\t}",
"function s2ajax_handle_client_request() {\n\t\tglobal $s2ajax_export_list, $inflector;\n\t\t\n\t\t$mode = \"\";\n\t\t\n\t\tif (! empty($_GET[\"rs\"])) \n\t\t\t$mode = \"get\";\n\t\t\n\t\tif (!empty($_POST[\"rs\"]))\n\t\t\t$mode = \"post\";\n\t\t\t\n\t\tif (empty($mode)) \n\t\t\treturn;\n\n\t\t$target = \"\";\n\t\t$rsuuid = false;\n\t\t\n\t\tif ($mode == \"get\") {\n\t\t\t// Bust cache in the head\n\t\t\theader (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n\t\t\theader (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t\t// always modified\n\t\t\theader (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n\t\t\theader (\"Pragma: no-cache\"); // HTTP/1.0\n\t\t\t$func_name = $_GET[\"rs\"];\n\t\t\tif (! empty($_GET[\"rsargs\"])) \n\t\t\t\t$args = $_GET[\"rsargs\"];\n\t\t\telse\n\t\t\t\t$args = array();\n\t\t\tif(!empty($_GET[\"rsuuid\"]))\n\t\t\t\t$rsuuid = $_GET[\"rsuuid\"];\n\t\t}\n\t\telse {\n\t\t\t$func_name = $_POST[\"rs\"];\n\t\t\tif (! empty($_POST[\"rsargs\"])) \n\t\t\t\t$args = $_POST[\"rsargs\"];\n\t\t\telse\n\t\t\t\t$args = array();\n\t\t\tif(!empty($_POST[\"rsuuid\"]))\n\t\t\t\t$rsuuid = $_POST[\"rsuuid\"];\n\t\t}\n\t\t\n\t\tlist($cn, $mn) = explode('$', $func_name);\n\t\tif(!empty($mn))\n\t\t{\n\t\t\t// A method, not a function...currently only works in a controller\n#\t\t\tinclude('controllers/' . $inflector->inflectee($cn)->toFile()->value() . '.php');\n\t\t}\n\t\t// CHECK!\n\t\tif($rsuuid) {\n\t\t\tif(\tempty($s2ajax_export_list[CLASSES][$cn]) ||\n\t\t\t\tempty($s2ajax_export_list[CLASSES][$cn]['methods'][$mn])) {\n\t\t\t\techo \"-:$func_name not callable\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Grab/create instance\n\t\t\t\tif('' == session_id()) {\n\t\t\t\t\tsession_start();\n\t\t\t\t}\n\n\t\t\t\tif(!isset($_SESSION['S2AJAX'])) {\n\t\t\t\t\t$_SESSION['S2AJAX'] = array(OBJECTS => array());\n\t\t\t\t}\n\t\t\t\tif(!isset($_SESSION['S2AJAX'][OBJECTS][$rsuuid])) {\n\t\t\t\t\t$instance = new $cn();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$instance = unserialize(\n\t\t\t\t\t\t$_SESSION['S2AJAX'][OBJECTS][$rsuuid]);\n\t\t\t\t}\n\n\t\t\t\techo \"+:\";\n\t\t\t\t$result = call_user_func_array(array($instance, $mn), $args);\n\n\t\t\t\t$si = serialize($instance);\n\t\t\t\t$_SESSION['S2AJAX'][OBJECTS][$rsuuid] = $si;\n\n\t\t\t\techo \"var res = \" . trim(_s2ajax_get_js_repr($result)) . \"; res;\";\n\t\t\t}\n\t\t\texit;\n\t\t}\n\n\t\tif(empty($s2ajax_export_list[LEGACY][$func_name]))\n\t\t\techo \"-:$func_name not callable\";\n\t\telse {\n\t\t\techo \"+:\";\n\t\t\tlist($cn, $mn) = $s2ajax_export_list[LEGACY][$func_name];\n\t\t\tif(empty($cn))\n\t\t\t\t$result = call_user_func_array($func_name, $args);\n\t\t\telse\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\tif(!method_exists($cn, $mn))\n\t\t\t\t{\n\t\t\t\t\t// Special case: the method we are looking for was in fact\n\t\t\t\t\t// declared in a mixin object -- or not.\n\t\t\t\t\t$links = call_user_func_array(array($cn, 'links'), array());\n\t\t\t\t\t$found = false;\n\t\t\t\t\tforeach($links as $key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$packages = ClassLoader::instance()->packages($key);\n\t\t\t\t\t\tforeach($packages as $package)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(method_exists($package, $mn))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$cn = $package;\n\t\t\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($found)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$result = call_user_func_array(array($cn, $mn), $args);\n\t\t\t}\n\t\t\techo \"var res = \" . trim(_s2ajax_get_js_repr($result)) . \"; res;\";\n\t\t}\n\t\texit;\n\t}",
"function HandleAjaxRequest()\n\t{\n\t\t$data = $this->GetAjaxJson();\n\t\tif ($data == null) \n\t\t\treturn;\n\t\t$ajaxAction = $data['ajaxAction'];\n\t\tunset($data['ajaxAction']);\n\n\t\t$response = null;\n\t\tswitch ($ajaxAction)\n\t\t{\n\t\t\tcase 'VerifyCategory': \n\t\t\t\t$response = $this->VerifyCategory($data);\n\t\t\tbreak;\n\t\t\tcase 'change_order': $this->CheckSortableAction(); break;\n\t\t}\n\t\t\n\t\tif ($response != null)\n\t\t{\n\t\t\t$this->WriteResponse($response);\n\t\t\tdie();\n\t\t}\n\t}",
"public function inits() {\r\n\t\tadd_action( 'admin_menu', array($this, 'register_market_downloads_settings_page' ));\r\n\t\tadd_action( 'admin_enqueue_scripts', array($this, 'include_admin_assets'));\r\n\t\tadd_action( 'wp_ajax_sort_report_file', array($this, 'sort_report_file'));\r\n\t}",
"public function process_ajax() {\r\n\t\tob_start();\r\n\r\n\t\t/*\r\n\t\t * Do nothing if function was called incorrectly.\r\n\t\t *\r\n\t\t * Note: `hash` is a normal wp-nonce.\r\n\t\t * We just use name=\"hash\" instead of name=\"_wpnonce\"\r\n\t\t */\r\n\t\tif ( empty( $_REQUEST['action'] ) || empty( $_REQUEST['hash'] ) ) {\r\n\t\t\twp_send_json_error(\r\n\t\t\t\tarray( 'message' => __( 'Required field missing', 'wpmudev' ) )\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$action = str_replace( 'wdp-', '', $_REQUEST['action'] );\r\n\t\t$nonce = $_REQUEST['hash'];\r\n\t\t// Do nothing if the nonce is invalid.\r\n\t\tif ( ! wp_verify_nonce( $nonce, $action ) ) {\r\n\t\t\twp_send_json_error(\r\n\t\t\t\tarray( 'message' => __( 'Something went wrong, please refresh the page and try again.', 'wpmudev' ) )\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t// Do nothing if the user is not allowed to use the Dashboard. Exception for specific ajax actions\r\n\t\tif ( ! in_array( $action, $this->ajax_allowed_bypasses ) && ! $this->allowed_user() ) {\r\n\t\t\twp_send_json_error(\r\n\t\t\t\tarray( 'message' => __( 'Sorry, you are not allowed to do this.', 'wpmudev' ) )\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$this->_process_ajax( $action, false );\r\n\r\n\t\t// When the _projess_ajax function did not send a response assume error.\r\n\t\twp_send_json_error(\r\n\t\t\tarray( 'message' => __( 'Unexpected action, we could not handle it.', 'wpmudev' ) )\r\n\t\t);\r\n\t}",
"function ale_ajax_post_install_plugin() {\n $nonce = $_POST['olins_plugin_nonce'];\n $plugin = $_POST['olins_plugin_slug'];\n $plugin_installed = false;\n\n\tadd_filter('woocommerce_enable_setup_wizard', false);\n\n if ( ! wp_verify_nonce( $nonce, 'install-plugin_' . $plugin ) ) {\n die( 'This action was stopped for security purposes.' );\n }\n\n\t$plugins = new ale_plugin_installer();\n\t$plugins->set_plugins_data( ale_global::$plugins_list );\n\n // Check if the plugin is not already installed\n if ( $plugins->is_plugin_installed( $plugin ) ) {\n $plugin_installed = true;\n } else {\n\n // Try to install the plugin.\n $plugin_installed = $plugins->install_plugin( $plugin );\n }\n\n // If the plugins is installed\n if ( $plugin_installed === true ) {\n\n // Check if the plugin is not already activated\n if ( $plugins->is_plugin_activated( $plugin ) === false ) {\n\n // Get the file path of the plugin in order to pass it to the activation method\n $plugin_file_path = $plugins->get_plugin_file_path( $plugin );\n\n // Try to activate the plugin\n $activation_result = $plugins->activate_plugin( $plugin_file_path );\n\n if ( $activation_result === true ) {\n echo 'successful installation';\n } else {\n echo 'failed activation';\n }\n } else {\n echo 'successful installation';\n }\n } else {\n $plugin_source = $plugins->get_download_link( $plugin );\n\n echo sprintf( ale_wp_kses(__( 'The plugin failed to install. Please check the permissions for the \"plugins\" directory or <a href=\"%s\" target=\"_blank\">download</a> the plugin and install it manually.', 'gardener' )), $plugin_source );\n }\n die();\n}",
"private function bootstrap(){\n\n\t\t//ajax\n\t\tadd_action( 'wp_ajax_api-con-manager', array( &$this, 'response_listener' ) );\n\t\tadd_action( 'wp_ajax_nopriv_api-con-manager', array( &$this, 'response_listener' ) );\n\t\tadd_action( 'admin_menu', array( &$this, 'action_admin_menu' ) );\n\n\t}"
] | [
"0.69661415",
"0.6807464",
"0.66538113",
"0.6585561",
"0.6427464",
"0.6426871",
"0.63657707",
"0.6300846",
"0.62200475",
"0.6145409",
"0.60121155",
"0.600563",
"0.60006166",
"0.59974325",
"0.58973086",
"0.58929664",
"0.58871937",
"0.5863114",
"0.5830173",
"0.58182985",
"0.5816424",
"0.58028716",
"0.5786281",
"0.57513535",
"0.57480824",
"0.5736196",
"0.57350785",
"0.5726467",
"0.57234013",
"0.57189506"
] | 0.7674395 | 0 |
Method formats REST exception object | protected function jsonFormatter(Rest\Exception $e): object
{
$error = $this->baseFormatter($e);
$error->call_stack = $this->formatCallStack($e);
$error->call_stack[] = $this->formatBody($e->getHttpBody());
$error->http_body = '<parsed>';
return $error;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function baseFormatter(\\Exception $e): object\n {\n $error = new \\stdClass();\n $error->message = $e->getMessage();\n $error->code = $e->getCode();\n\n if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REQUEST_URI'])) {\n $error->host = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n } else {\n $error->host = 'undefined';\n }\n return $error;\n }",
"public function formatError()\r\n\t{\r\n\t\t$json = json_decode($this->_responseBody);\r\n\r\n\t\t// descricao vinda do servidor\r\n\t\tif($json && isset($json->errorDesc))\r\n\t\t{\r\n\t\t\t$errorDesc = $json->errorDesc . \" (code \" . $this->_responseCode . \").\";\r\n\t\t}\r\n\t\telse if($this->_responseBody)\r\n\t\t{\r\n\t\t\t$errorDesc = $this->_responseBody . \" (code \" . $this->_responseCode . \").\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$errorDesc = \"\";\r\n\t\t}\r\n\r\n\t\t// tipo do erro\r\n\t\tif($this->_responseCode == 400)\r\n\t\t{\r\n\t\t\treturn \"badly formatted request: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 401)\r\n\t\t{\r\n\t\t\treturn \"request needs authentication: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 403)\r\n\t\t{\r\n\t\t\treturn \"denied request: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 404)\r\n\t\t{\r\n\t\t\treturn \"resource not found: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 405)\r\n\t\t{\r\n\t\t\treturn \"not permited action: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 406)\r\n\t\t{\r\n\t\t\treturn \"not permited action: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 415)\r\n\t\t{\r\n\t\t\treturn \"invalid media type: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 422)\r\n\t\t{\r\n\t\t\treturn \"logic exception: \" . $errorDesc;\r\n\t\t}\r\n\t\telse if($this->_responseCode == 500)\r\n\t\t{\r\n\t\t\treturn \"server error.\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn \"unrecognized exception: \" . $this->_responseCode;\r\n\t\t}\r\n\t}",
"static function exception_out($e)\n {\n HttpResp::json_out($e->getCode(),[\"errors\"=>[[\"message\"=>$e->getMessage()]]]);\n }",
"function exceptionResponseAsJSON(Exception $e) {\n $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); // use the protocol format sent by the client, or use the HTTP/1.0 protocol.\n header($protocol . ' ' . 400 . ' ' . \"Bad Request\");\n $message = array(\n \"message\" => $e->getMessage()\n );\n //echo json_encode($message);\n responseAsJSON($message);\n}",
"public function formatException(\\Exception $e) {\r\n $entry = array();\r\n\r\n $entry['class'] = get_class($e);\r\n $entry['message'] = $e->getMessage();\r\n $entry['file'] = $e->getFile();\r\n $entry['line'] = $e->getLine();\r\n $entry['trace'] = $e->getTraceAsString();\r\n\r\n return $entry;\r\n }",
"public function processRestExceptionResult(\\Exception $e)\n {\n $error = json_decode($e->getMessage(), true);\n if (json_last_error() !== JSON_ERROR_NONE) {\n $error['message'] = $e->getMessage();\n }\n //Remove line breaks and replace with space\n $error['message'] = trim(preg_replace('/\\s+/', ' ', $error['message']));\n // remove trace and type, will only be present if server is in dev mode\n unset($error['trace']);\n unset($error['type']);\n return $error;\n }",
"public function render($request, Exception $exception)\n {\n\n $errors = [];\n $meta = [];\n $http_status = null;\n\n\n if ($exception instanceof ValidationException && $exception->errors()) {\n foreach ($exception->errors() as $key => $field) {\n foreach ($field as $error) {\n $error = preg_replace_callback('/data.([A-z\\_\\.]+)/', function ($matches) {\n return str_replace('.', ' ', $matches[1]);\n }, $error);\n $errors[] = [\n 'title' => 'Invalid Attribute',\n 'detail' => $error,\n 'status' => $exception->status,\n 'source' => ['pointer' => '/' . str_replace('.', '/', $key) ]\n ];\n }\n }\n } else if ($exception instanceof ModelNotFoundException) {\n $errors[] = [\n 'title' => \"Resource Not Found\",\n 'status' => (string) Response::HTTP_NOT_FOUND,\n 'detail' => $exception->getMessage()\n ];\n } else if ($exception instanceof HttpException) {\n $errors[] = [\n 'title' => Response::$statusTexts[$exception->getStatusCode()],\n 'status' => (string) $exception->getStatusCode(),\n 'detail' => $exception->getMessage()\n ];\n } else {\n $errors[] = [\n 'title' => \"An internal server error has occurred. If you continue to experience issues, please contact customer service. This error has been logged.\",\n 'status' => (string) Response::HTTP_INTERNAL_SERVER_ERROR,\n 'detail' => $exception->getMessage()\n ];\n }\n\n if (count($errors) == 0) {\n $errors[] = [\n 'title' => \"An internal server error has occurred. If you continue to experience issues, please contact customer service. This error has been logged.\",\n 'status' => (string) Response::HTTP_INTERNAL_SERVER_ERROR,\n 'detail' => $exception->getMessage()\n ];\n }\n if ($http_status == null) {\n $http_status = isset($errors[0]['status'])?$errors[0]['status']:500;\n }\n\n $json = ['errors' => $errors];\n\n if (!empty($meta)) {\n $json['meta'] = $meta;\n }\n\n return response()->json($json, $http_status);\n\n }",
"function handleInvalidErrors($e){\n if( $e->getApiErrorCode() == \"invalid_state_for_request\") {\n\t // Error due to invalid state to perform the API call.\n \t error_log(\"Error : \" . json_encode($e->getJSONObject()));\n\t $errorResponse = array(\"error_msg\" => \"Invalid state for this operation\");\n \t print json_encode($errorResponse, true);\n\t header(\"HTTP/1.0 400 Invalid Request\");\n } else {\n \t handleInvalidRequestException($e);\n } \n}",
"protected function exceptionContent() {\n\t\treturn Formatter::formatExceptionPlain($this->getInspector());\n\t}",
"public function apiException($request, $exception){\n if($this->isModel($exception)){\n return $this->exceptionResponse('Not Found', Response::HTTP_NOT_FOUND);\n } elseif($this->isHttp($exception)){\n return $this->exceptionResponse('Rota incorreta', Response::HTTP_NOT_FOUND);\n } else {\n return parent::render($request, $exception);\n }\n }",
"public function apiException($request,$exception)\n {\n if($this->isModelException($exception))\n {\n return $this->modelExceptionResponse();\n }\n\n // Check if exception was cause by incorrect route\n\n if($this->isHTTPException($exception))\n {\n return $this->httpExceptionResponse();\n }\n\n return parent::render($request, $exception);\n }",
"public function render(\\Throwable $exception): FlattenException;",
"public function render($request, Exception $e)\n {\n if (explode('/',$request->path())[0] == 'api-merchant' || explode('/',$request->path())[0] == 'api-web' || $request->ajax()) {\n $apiFormatter = $this->getAPIFormatter();\n $apiModel = $this->getAPIModel($e);\n if($e instanceof AuthenticationException){\n return response()->json($apiFormatter->error($apiModel), 401);\n }\n if ($e instanceof Exception) {\n return $apiFormatter->error($apiModel);\n }\n\n if ($e instanceof HttpResponseException) {\n return $e->getResponse();\n }\n\n\n $class = get_class($e);\n\n switch ($class) {\n case 'Illuminate\\\\Http\\\\Exception\\\\HttpResponseException':\n return parent::render($request, $e);\n break;\n case 'Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException':\n $code = 'NotFound';\n $msg = 'Not Found.';\n $statusCode = 404;\n break;\n case 'Illuminate\\Database\\Eloquent\\ModelNotFoundException':\n $code = 'ModelNotFound';\n $model = str_replace('App\\\\Models\\\\', '', $e->getModel());\n $msg = $model . ' not found.';\n $statusCode = 404;\n break;\n case 'Illuminate\\Auth\\Access\\AuthorizationException':\n $code = 'InvalidCredentials';\n $msg = 'Credentials are invalid.';\n $statusCode = 400;\n break;\n default:\n $code = 'SystemError';\n $msg = $e->getMessage();\n $file = $e->getFile();\n $line = $e->getLine();\n $statusCode = 500;\n }\n\n $data = [\n 'status' => 'error',\n 'exception' => $class,\n 'code' => $code,\n 'msg' => $msg\n ];\n\n if (isset($file)) {\n $data['file'] = $file;\n }\n\n if (isset($line)) {\n $data['line'] = $line;\n }\n\n return response($data, $statusCode)\n ->header('Access-Control-Allow-Origin', '*')\n ->header('Access-Control-Allow-Headers', 'Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With')\n ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');\n } else{\n if ($request->format() == 'html') {\n // custom error message\n if ($e instanceof \\ErrorException) {\n return response()->view('errors.500', [], 500);\n }\n }\n return parent::render($request, $e);\n }\n //Log::useDailyFiles(storage_path().'/logs/laravel.log');\n //Log::error($e);\n\n }",
"public function __toString()\n {\n return \"WebFramework Exception: {$this->message}\\n\";\n }",
"protected function normalizeException($e) : string\n {\n \t\t$previousText = '';\n if ($previous = $e->getPrevious()) {\n do {\n $previousText .= ', ' . get_class($previous) . '(code: ' . $previous->getCode() . '): ' . $previous->getMessage() . ' at ' . $previous->getFile() . ':' . $previous->getLine();\n } while ($previous = $previous->getPrevious());\n }\n\n $str = '[object] (' . get_class($e) . '(code: ' . $e->getCode() . '): ' . $e->getMessage() . ' at ' . $e->getFile() . ':' . $e->getLine() . $previousText . ')';\n if ($this->includeStacktraces) {\n $str .= \"\\n[stacktrace]\\n\" . $e->getTraceAsString() . \"\\n\";\n }\n\n return $str;\n }",
"public function render(\\Exception $e)\n {\n if ($e instanceof BaseException){\n //to assign the custom exctpion data;\n $this->code = $e->code;\n $this->msg = $e->msg;\n $this->errorCode = $e->errorCode;\n }else{\n //return the frendly exception when the debug mode is true \n if (Config::get('app.app_debug')) {\n return parent::render($e);\n } else {\n $this->code = 500;\n $this->msg = 'sorry,we make a mistake. (^o^)Y';\n $this->errorCode = 999;\n $this->recordErrorLog($e); \n }\n }\n return json([\n 'msg' => $this->msg,\n 'url' => Request::url(),\n 'errorCode' => $this->errorCode\n ], $this->code);\n }",
"public function handleConstructException(\\Throwable $exception): Response;",
"public function renderJSON($request, \\Exception $rawException): JsonResponse\n {\n $e = FlattenException::create($rawException);\n switch ($this->title($e->getClass())) {\n case \"ModelNotFoundException\":\n $e->setStatusCode(404);\n $e->setMessage(\"404 Not found\");\n break;\n }\n if (env('APP_DEBUG')) {\n $errors = [\n 'message' => (!empty($e->getMessage())) ? $e->getMessage() : $this->title($e->getClass()),\n 'exception' => $e->getClass(),\n 'status' => $e->getStatusCode(),\n 'file' => $e->getFile(),\n 'line' => $e->getLine(),\n 'trace' => collect($e->getTrace())->map(function ($trace) {\n unset($trace['args']);\n return $trace;\n })->all(),\n ];\n if ($this->title($e->getClass()) == 'BackOfficeHttpException') {\n $errors['response'] = $rawException->getResponse();\n $errors['HEADER'] = $rawException->getHeaders();\n }\n } else {\n $errors = [\n 'message' => (!empty($e->getMessage())) ? $e->getMessage() : $this->title($e->getClass()),\n 'status' => $e->getStatusCode(),\n ];\n if ($this->title($e->getClass()) == 'BackOfficeHttpException') {\n $errors['response'] = $rawException->getResponse();\n $errors['HEADER'] = $rawException->getHeaders();\n }\n\n }\n $errors_log = [\n 'message' => (!empty($e->getMessage())) ? $e->getMessage() : $this->title($e->getClass()),\n 'status' => $e->getStatusCode(),\n ];\n if ($this->title($e->getClass()) == 'BackOfficeHttpException') {\n $errors_log['response'] = $rawException->getResponse();\n $errors_log['HEADER'] = $rawException->getHeaders();\n }\n return new JsonResponse($errors, $e->getStatusCode());\n }",
"protected function generate_error($ex) {\n $errorobject = new stdClass;\n $errorobject->exception = get_class($ex);\n $errorobject->errorcode = $ex->errorcode;\n $errorobject->message = $ex->getMessage();\n if (debugging() and isset($ex->debuginfo)) {\n $errorobject->debuginfo = $ex->debuginfo;\n }\n $error = json_encode($errorobject);\n return $error;\n }",
"public function getExtendedError();",
"public function format_error() {\n $source = empty($this->page->actual_url) ? 'Unknown' : $this->page->actual_url;\n $referrer = empty($this->page->referrer) ? 'None' : $this->page->referrer;\n $statuscode = $this->page->statuscode;\n\n $out = 'ERROR: ' . $this->message . \"\\n\";\n $out .= 'Page: ' . $source . \"\\n\";\n $out .= 'Referrer: ' . $referrer . \"\\n\";\n // only include status if an error\n if ($statuscode >= 400) {\n $out .= 'HTTP Status: ' . $statuscode . \"\\n\";\n }\n $out .= \"\\n\";\n\n return $out;\n }",
"public function render($request, Throwable $exception)\n {\n\n if ($request->expectsJson()) {\n if ($exception instanceof PostTooLargeException) {\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => \"Size of attached file should be less \" . ini_get(\"upload_max_filesize\") . \"B\"\n ],\n 400\n );\n }\n\n if ($exception instanceof AuthenticationException) {\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => 'Unauthenticated or Token Expired, Please Login'\n ],\n 401\n );\n }\n if ($exception instanceof ThrottleRequestsException) {\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => 'Too Many Requests,Please Slow Down'\n ],\n 429\n );\n }\n if ($exception instanceof ModelNotFoundException) {\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => 'No results found'\n ],\n 404\n );\n }\n if ($exception instanceof ValidationException) {\n\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => $exception->getMessage(),\n 'errors' => $exception->errors()\n ],\n 422\n );\n }\n if ($exception instanceof QueryException) {\n\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => 'There was Issue with the Query',\n 'exception' => $exception\n\n ],\n 500\n );\n }\n // if ($exception instanceof HttpResponseException) {\n // // $exception = $exception->getResponse();\n // return $this->apiResponse(\n // [\n // 'success' => false,\n // 'message' => \"There was some internal error\",\n // 'exception' => $exception\n // ],\n // 500\n // );\n // }\n if ($exception instanceof \\Error) {\n // $exception = $exception->getResponse();\n return $this->apiResponse(\n [\n 'success' => false,\n 'message' => \"There was some internal error\",\n 'exception' => $exception\n ],\n 500\n );\n }\n }\n\n\n return parent::render($request, $exception);\n }",
"public function render($request, Throwable $exception)\n {\n if (!($exception instanceof \\ErrorException) && $request->wantsJson()) {\n if ($exception instanceof \\Illuminate\\Auth\\AuthenticationException) {\n return (new API())->setMessage(__('unauthenticated'))\n ->setStatusUnauthorized()\n ->build();\n }\n if ($exception instanceof \\Illuminate\\Validation\\ValidationException) {\n return (new API())->setMessage(__('unauthenticated'))\n ->setErrors($exception->errors())\n ->setStatusUnauthorized()\n ->build();\n }\n if ($exception instanceof ModelNotFoundException) {\n $message = array_reverse(explode('\\\\',$exception->getMessage()));\n $message = explode(']',$message[0]);\n return (new API())->setMessage(__('This :MODEL not found',['MODEL'=>$message[0]]))\n ->setStatusError()\n ->build();\n }\n }\n return parent::render($request, $exception);\n }",
"public function data_exceptionResponse() {\n\t\treturn array(\n\t\t\t'default configuration' => array(\n\t\t\t\tarray(),\n\t\t\t\t'BadRequestException',\n\t\t\t\t'Unknown error',\n\t\t\t\t0\n\t\t\t),\n\n\t\t\t'change exception class' => array(\n\t\t\t\tarray('class' => 'CakeException'),\n\t\t\t\t'CakeException',\n\t\t\t\t'Unknown error',\n\t\t\t\t0\n\t\t\t),\n\n\t\t\t'change exception code' => array(\n\t\t\t\tarray('code' => 10),\n\t\t\t\t'BadRequestException',\n\t\t\t\t'Unknown error',\n\t\t\t\t10\n\t\t\t),\n\n\t\t\t'change exception message' => array(\n\t\t\t\tarray('message' => 'epic message'),\n\t\t\t\t'BadRequestException',\n\t\t\t\t'epic message',\n\t\t\t\t10\n\t\t\t),\n\n\t\t\t'Validate case #1 - no validation errors' => array(\n\t\t\t\tarray('class' => 'CrudValidationException', 'type' => 'validate'),\n\t\t\t\t'CrudValidationException',\n\t\t\t\t'0 validation errors occurred',\n\t\t\t\t0\n\t\t\t),\n\n\t\t\t'Validate case #2 - one validation error' => array(\n\t\t\t\tarray('class' => 'CrudValidationException', 'type' => 'validate'),\n\t\t\t\t'CrudValidationException',\n\t\t\t\t'A validation error occurred',\n\t\t\t\t0,\n\t\t\t\tarray(array('id' => 'hello world'))\n\t\t\t),\n\n\t\t\t'Validate case #3 - two validation errors' => array(\n\t\t\t\tarray('class' => 'CrudValidationException', 'type' => 'validate'),\n\t\t\t\t'CrudValidationException',\n\t\t\t\t'2 validation errors occurred',\n\t\t\t\t0,\n\t\t\t\tarray(array('id' => 'hello world', 'name' => 'fail me'))\n\t\t\t)\n\t\t);\n\t}",
"function throwException (&$body, $exception) {\n\t\t$body->responseURI = $body->responseIndex . \"/onStatus\";\n\t\t$results = &$body->getResults();\n\n\t\tif($GLOBALS['amfphp']['encoding'] == 'amf3')\n\t\t{\n\t\t\t$errorMessageClass = conf(\"options/debug-mode\", false, false) ? \"AerialErrorMessage\" : \"ErrorMessage\";\n\n\t\t\t$results = new $errorMessageClass();\n\t\t\t$results->correlationId = $GLOBALS['amfphp']['lastMessageId'];\n\t\t\t$results->faultCode = $exception->code;\n\t\t\t$results->faultDetail = $exception->details . ' on line ' . $exception->line;\n\t\t\t$results->faultString = $exception->description;\n\t\t\tif(conf(\"options/debug-mode\", false, false))\n\t\t\t\t$results->debug = $exception->debug;\n\t\t}\n\t\telseif($GLOBALS['amfphp']['encoding'] == 'amf0')\n\t\t{\n\t\t\t$results[\"description\"] = $exception->description;\n\t\t\t$results[\"details\"] = $exception->details;\n\t\t\t$results[\"level\"] = $exception->level;\n\t\t\t$results[\"line\"] = $exception->line;\n\t\t\t$results[\"code\"] = $exception->code;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$results['faultCode'] = $exception->code;\n\t\t\t$results['faultDetail'] = $exception->details . ' on line ' . $exception->line;\n\t\t\t$results['faultString'] = $exception->description;\n\t\t}\n\t}",
"public function render($request, Exception $e);",
"public function render($request, \\Exception $e)\n {\n }",
"function exceptionToString(Exception $ex)\n{\n return get_class($ex) . \" Object\\n{\\n\"\n . \" [message] => \" . $ex->getMessage() . \"\\n\"\n . \" [code] => \" . $ex->getCode() . \"\\n\"\n . \" [file] => \" . $ex->getFile() . \"\\n\"\n . \" [line] => \" . $ex->getLine() . \"\\n\"\n . \" [previous] => \" . $ex->getPrevious() . \"\\n\"\n . ' [trace] => <div style=\"margin: 10px 0 10px 60px\">' . $ex->getTraceAsString() . \"</div>\"\n . '}';\n}",
"public function render($request, Exception $exception)\n {\n if (env('APP_ENV') === 'local') {\n return parent::render($request, $exception);\n }\n /**\n * Api Request\n */\n if ( $request->expectsJson() ) {\n\n if ($exception instanceof ThrottleRequestsException)\n return $this->errorResponse( __('validation.handler.max_attempts'), 429 );\n\n if ($exception instanceof ValidationException)\n return $this->convertValidationExceptionToResponse( $exception, $request );\n\n if ($exception instanceof ModelNotFoundException)\n return $this->errorResponse(__('validation.handler.resource_not_found'), 404);\n\n if ($exception instanceof AuthenticationException)\n return $this->unauthenticated($request, $exception);\n\n if ($exception instanceof NotFoundHttpException)\n return $this->errorResponse(__('validation.handler.resource_not_found_url'), 404);\n\n if ($exception instanceof RelationNotFoundException)\n return $this->errorResponse(__('validation.handler.relation_not_found'), 404);\n\n if ($exception instanceof AuthorizationException)\n return $this->errorResponse(__('validation.handler.unauthorized'), 403);\n\n if ($exception instanceof AccessDeniedHttpException)\n return $this->errorResponse(__('validation.handler.unauthorized'), 403);\n\n if ($exception instanceof MethodNotAllowedHttpException)\n return $this->errorResponse(__('validation.handler.method_allow'), 405);\n\n if ($exception instanceof ConnectionException)\n return $this->errorResponse(__('validation.handler.connection_refused', ['db' => 'Redis']), 405);\n\n if ( $exception instanceof Connection) {\n dd($exception);\n }\n\n if ($exception instanceof HttpException)\n return $this->errorResponse($exception->getMessage(), $exception->getStatusCode());\n\n if ( $exception instanceof ErrorException )\n return $this->errorResponse(__('validation.handler.unexpected_failure'), 500);\n\n if ($exception instanceof PDOException)\n return $exception->getCode();\n\n if ($exception instanceof FatalThrowableError)\n return $this->errorResponse(__('validation.handler.conflict'), 409);\n\n if ($exception instanceof QueryException) {\n\n if ($exception->errorInfo[0] === \"23503\")\n return $this->errorResponse(__('validation.handler.relation_not_delete'), 409);\n\n if ($exception->errorInfo[0] === \"42S22\")\n return $this->errorResponse(__('validation.handler.column_not_found'), 409);\n\n if ($exception->errorInfo[0] === \"42S02\")\n return $this->errorResponse(__('validation.handler.column_not_found'), 409);\n\n if ($exception->errorInfo[1] == 2002)\n return $this->errorResponse( __('validation.handler.connection_refused', ['db' => 'MySQL'] ), 405);\n\n if ($exception->errorInfo[1] == 1451)\n return $this->errorResponse(__('validation.handler.relation_not_delete'), 409);\n\n if ($exception->errorInfo[1] == 7)\n return $this->errorResponse(__('validation.handler.conflict'), 409);\n\n if ($exception->getCode() == 7)\n return $this->errorResponse(__('validation.handler.service_unavailable'), 503);\n }\n\n if ($exception instanceof TokenMismatchException)\n return $this->errorResponse(__('validation.handler.token_mismatch'), 422);\n }\n\n /**\n * Request Web\n */\n if ($exception instanceof TokenMismatchException)\n return redirect()->back()->withInput($request->input());\n\n if ($exception instanceof QueryException) {\n if ($exception->getCode() == 7)\n return response()->view('errors.503');\n }\n\n if ($exception instanceof AuthenticationException)\n return $this->unauthenticated($request, $exception);\n\n if ($exception instanceof ClientException || $exception instanceof ServerException) {\n $status = $exception->getResponse()->getStatusCode();\n if ( view()->exists(\"errors.{$status}\"))\n return response()->view(\"errors.{$status}\");\n }\n\n if ($exception instanceof ErrorException) {\n return parent::render($request, $exception);\n// $status = $exception->getPrevious()->getResponse()->getStatusCode();\n// if (view()->exists(\"errors.{$status}\"))\n// return response()->view(\"errors.{$status}\");\n }\n\n if ($exception instanceof PDOException) {\n if ($exception->getCode() == 7)\n return response()->view('errors.503');\n\n if ($exception->getCode() == 2002)\n return $this->errorResponse( __('validation.handler.connection_refused', ['db' => 'MySQL'] ), 405);\n }\n\n if ($exception instanceof HttpException) {\n $status = $exception->getStatusCode();\n if (view()->exists(\"errors.{$status}\"))\n return response()->view(\"errors.{$status}\", ['exception' => $exception], $status, $exception->getHeaders());\n }\n\n return parent::render($request, $exception);\n }",
"public function render($request, Throwable $e)\n {\n $message = $e->getMessage() . ' in file ' . $e->getFile() . ' at line ' . $e->getLine();\n\n switch (get_class($e)) {\n\n case 'Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException':\n try {\n throw new ApiException('client', 404, 'not_found_http', '', 0);\n } catch (Exception $e) {\n $exceptionData = self::getExceptionData($request, $e);\n }\n break;\n\n case 'PDOException':\n case 'Illuminate\\Database\\QueryException':\n try {\n throw new DbException($e);\n } catch (Exception $e) {\n $exceptionData = self::getExceptionData($request, $e);\n }\n break;\n\n case 'Symfony\\Component\\Debug\\Exception\\FatalErrorException':\n try {\n throw new ApiException('semantic', 500, 'semantic_error', '', 0, ['message' => $message]);\n } catch (Exception $e) {\n $exceptionData = self::getExceptionData($request, $e);\n }\n break;\n\n\n case 'App\\Exceptions\\ApiException':\n $exceptionData = self::getExceptionData($request, $e);\n break;\n\n\n case 'Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException':\n try {\n throw new ApiException('client', 405, 'method_not_allowed', '', 0);\n } catch (Exception $e) {\n $exceptionData = self::getExceptionData($request, $e);\n }\n break;\n\n default:\n if (get_parent_class($e) == 'App\\Exceptions\\ApiException') {\n $exceptionData = self::getExceptionData($request, $e);\n break;\n }\n\n try {\n throw new ApiException('server', 500, 'internal_server_error', '', 0, ['message' => $message]);\n } catch (Exception $e) {\n $exceptionData = self::getExceptionData($request, $e);\n }\n break;\n }\n\n return response()->json($exceptionData, $e->getStatusCode(), [], JSON_PRETTY_PRINT);\n }"
] | [
"0.6441816",
"0.6349772",
"0.62637043",
"0.62363946",
"0.6130136",
"0.61035454",
"0.6074883",
"0.6003905",
"0.59393597",
"0.59315085",
"0.58605397",
"0.58053404",
"0.576393",
"0.57550615",
"0.5746712",
"0.57394665",
"0.5703428",
"0.5703372",
"0.566996",
"0.5652165",
"0.56415963",
"0.5615026",
"0.5603833",
"0.5580219",
"0.5577656",
"0.5576336",
"0.5559411",
"0.55550677",
"0.55374265",
"0.55178726"
] | 0.66134965 | 0 |
Method loads all actions from ./Actions directory | private function loadActionsFromConfig(): void
{
$this->loadActionsFromDirectory(Fs::getClassPath($this) . '/Actions/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function initActions()\n {\n // TODO\n $this->actions = [\n ];\n }",
"public function getAllActions();",
"public static function get_actions();",
"protected function register_actions() {}",
"public static function get_all_actions()\n {\n $actions = [];\n \n $controllers = scandir(self::$dirroot.'/modules');\n foreach ($controllers as $controller) {\n if (in_array($controller, ['.', '..', '_new_controller'])) {\n continue;\n }\n try {\n $controller_full = '\\\\modules\\\\'.$controller.'\\\\module';\n if (!class_exists($controller_full)) {\n continue;\n }\n } catch (\\LogicException $ex) {\n continue;\n }\n $methods = get_class_methods($controller_full);\n foreach ($methods as $method) {\n if (substr($method, 0, 7) !== 'action_') {\n continue;\n }\n $actions[$controller][] = str_replace('action_', '', $method);\n }\n }\n \n return $actions;\n }",
"private function actions() {\n\t}",
"public function run()\n {\n $actions = Action::all();\n $routeCollection = Route::getRoutes();\n\n if ( $actions->isEmpty() )\n {\n Action::setAllActionsByRouteCollection( $routeCollection );\n }\n }",
"public function getActions();",
"public function getActions();",
"private function getActions() \n\t{\n\t\t// create a new ReflectionClass instance for the current class \n\t\t$c = new ReflectionClass(get_class($this));\n\t\t\n\t\t// get all the defined methods\n\t\t$methods = $c->getMethods();\n\t\t\n\t\t$actions = array();\n\t\t\n\t\t// iterate through the methods filtering out any that are not\n\t\t// prefixed with action_.\n\t\tforeach ($methods as $method) \n\t\t{\t\t\t\n\t\t\tif (stristr($method->getName(),'action_')) \n\t\t\t{\n\t\t\t\t// remove the prefix to get the action name\n\t\t\t\t$action = str_replace('action_','',$method->getName());\n\t\t\t\t\n\t\t\t\t// iterate through the parameters adding each to an array\n\t\t\t\t// wrapping optional params. with []\n\t\t\t\t$actions[$action] = array();\n\t\t\t\tforeach ($method->getParameters() as $param) \n\t\t\t\t{\n\t\t\t\t\t$name = strtoupper($param->getName());\n\t\t\t\t\tif ($param->isOptional()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$name = '['.$name.']';\t\n\t\t\t\t\t} \n\t\t\t\t\t$actions[$action][] = $name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_actions = $actions;\n\t}",
"private function setup_actions()\n {\n }",
"private function setup_actions()\n {\n }",
"private function setup_actions()\n {\n }",
"private function setup_actions()\n {\n }",
"private function setup_actions()\n {\n }",
"public function init() {\n\n\t\tadd_action( \"init\", array( $this, 'load_actions' ), 10 );\n\n\t}",
"function PreActions()\n {\n array_push($this->ActionPaths,\"../EventApp/System/Events\");\n }",
"private function setup_actions() {\n\n\n\n }",
"public static function getActions()\n\t{\n\t\t$assetName = self::$extension;\n\n\t\t$path = dirname(__DIR__) . '/config/access.xml';\n\n\t\t$actions = \\Hubzero\\Access\\Access::getActionsFromFile($path);\n\t\t$actions ?: array();\n\n\t\t$result = new Obj;\n\n\t\tforeach ($actions as $action)\n\t\t{\n\t\t\t$result->set($action->name, User::authorise($action->name, $assetName));\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getActions() {\n\t\t$tree = [];\n\t\t$access = [\n\t\t\t'public' => 'public',\n\t\t\t'logged_in' => 'logged in only',\n\t\t\t'admin' => 'admin only',\n\t\t];\n\t\t$start = strlen(elgg_get_root_path());\n\t\tforeach (_elgg_services()->actions->getAllActions() as $action => $info) {\n\t\t\t$info['file'] = substr($info['file'], $start);\n\t\t\t$tree[$action] = [$info['file'], $access[$info['access']]];\n\t\t}\n\t\tksort($tree);\n\t\treturn $tree;\n\t}",
"public function load_actions() {\n\n\t\t$this->create_custom_post_type( $this->type );\n\n\t\tadd_action( \"add_meta_boxes_{$this->cpt_name}\", array( $this, 'create_metabox' ) );\n\t}",
"public static function listActions();",
"public function load_actions()\n {\n // Register MEC function to be called in WordPress footer hook\n $this->action('wp_footer', array($this, 'load_footer'), 9999);\n \n // Parse WordPress query\n $this->action('parse_query', array($this->parser, 'WPQ_parse'), 99);\n \n // Add custom styles to header\n $this->action('wp_head', array($this->main, 'include_styles'), 9999);\n \n // MEC iCal export\n $this->action('init', array($this->main, 'ical'), 9999);\n \n // Redirect to MEC Dashboard\n $this->action('admin_init', array($this->main, 'mec_redirect_after_activate'));\n \n // Add Events to Tag Archive Page\n $this->action('pre_get_posts', array($this->main, 'add_events_to_tags_archive'));\n \n // MEC booking verification and cancellation\n $this->action('mec_before_main_content', array($this->main, 'do_endpoints'), 9999);\n \n // Add AJAX actions\n $this->action('wp_ajax_mec_save_styles', array($this->main, 'save_options'));\n $this->action('wp_ajax_mec_save_settings', array($this->main, 'save_options'));\n $this->action('wp_ajax_mec_save_reg_form', array($this->main, 'save_options'));\n $this->action('wp_ajax_mec_save_gateways', array($this->main, 'save_options'));\n $this->action('wp_ajax_mec_save_styling', array($this->main, 'save_options'));\n $this->action('wp_ajax_mec_save_notifications', array($this->main, 'save_notifications'));\n $this->action('wp_ajax_mec_save_messages', array($this->main, 'save_options'));\n }",
"public function setup_actions()\n {\n }",
"public function actions();",
"public function actions();",
"function setup_actions()\n {\n }",
"protected function initializeActions(): void\n {\n if (isset($this->transitionBranchConfig[BehaviorType::Action->value])) {\n $this->actions = is_array($this->transitionBranchConfig[BehaviorType::Action->value])\n ? $this->transitionBranchConfig[BehaviorType::Action->value]\n : [$this->transitionBranchConfig[BehaviorType::Action->value]];\n\n $this->initializeInlineBehaviors(\n inlineBehaviors: $this->actions,\n behaviorType: BehaviorType::Action\n );\n }\n }",
"public function actions_manager(){\n\t\tadd_action( 'after_setup_theme', array($this, 'setup_theme') );\n\t\tadd_action( 'wp_enqueue_scripts', array($this, 'enqueue_styles') );\n\t\tadd_action( 'wp_enqueue_scripts', array($this, 'enqueue_scripts') );\n\t\tadd_action( 'enqueue_scripts', array($this, 'enqueue_scripts') );\n\t\t//add_action( 'admin_enqueue_scripts', array($this, 'admin_enqueue_scripts') );\n\t\tadd_action('init', array($this, 'init_functions') );\n\t\tadd_action('init', array($this,'register_menus_locations') );\n\t}",
"public function getActions()\n\t{\n\t\t$oClass = new ReflectionClass(get_class($this));\n\t\t$consts = $oClass->getConstants();\n\t\t$this->actions = array();\n\t\tforeach ($consts as $name => $item) {\n\t\t\tif (substr($name, 0, 6) == 'ACTION') {\n\t\t\t\t$this->actions[$name] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $this->actions;\n\t}"
] | [
"0.72273123",
"0.70171505",
"0.69578546",
"0.69347596",
"0.6718758",
"0.6704905",
"0.6668038",
"0.66275364",
"0.66275364",
"0.6615377",
"0.6591425",
"0.6591425",
"0.6591425",
"0.6591425",
"0.65905607",
"0.65663576",
"0.65470946",
"0.6537294",
"0.6460727",
"0.6454386",
"0.64343697",
"0.642331",
"0.642209",
"0.6381421",
"0.63635886",
"0.63635886",
"0.6358416",
"0.63389206",
"0.63368404",
"0.6319554"
] | 0.78030527 | 0 |
each profile uses different cookie file and useragent | final public function setProfileID($id){
// Windows does not like special characters in filenames...
$id = str_replace(array('\\', '/', ':', '*', '?', '"', '<', '>', '|'), '-', $id);
$this->profile_id = $id;
// generate random user agent using profile_id as salt
$hash = md5($id);
// max at 7, otherwise it generates an INT beyond PHP_INT_MAX for that system
$hash = substr($hash, 0, 7);
$rand_index = hexdec($hash) % count($this->agents);
// set it
$agent = $this->agents[$rand_index];
$this->default_options['headers']['User-Agent'] = $agent;
// generate cookie file based on profile_id
$cookie_file = $this->cookie_dir.'/'.$this->cookie_prefix.$this->profile_id.'.json';
// TODO: if this cookie_file already exists and was created by another USER, then writing to it will fail and RuntimeException will be thrown by Guzzle
// cookies will be stored here
$jar = new FileCookieJar($cookie_file);
//$this->client->setDefaultOption('cookies', $jar);
$this->default_options['cookies'] = $jar;
$this->reloadClient();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function request_analytics(){\n\t\t$cookie_is_valid = true;\n\t\tif(isset($_COOKIE['magic_id'])){\n\t\t\tif(VisitorSearcher::Factory()->search_by_id(base_convert($_COOKIE['magic_id'], 36,10))->count() == 0){\n\t\t\t\t$cookie_is_valid = false;\n\t\t\t}\n\t\t}\n\t\t#echo \"Cookie is \" . ($cookie_is_valid?'valid':'not valid');\n\t\t\n\t\t// Give the user a magic_id if they've not got one.\n\t\tif(!isset($_COOKIE['magic_id']) || $cookie_is_valid === false){\n\t\t\t//Look for Visitors from this location before...\n\t\t\t$oVisitor = VisitorSearcher::Factory()->search_by_ip($_SERVER['REMOTE_ADDR'])->execute_one();\n\t\t\tif($oVisitor === false ){\n\t\t\t\t$oVisitor = Visitor::Factory()\n\t\t\t\t\t->set_ip($_SERVER['REMOTE_ADDR'])\n\t\t\t\t\t->save();\n\t\t\t}\n\t\t\t$oVisitor = Visitor::Cast($oVisitor);\n\t\t\t$time_to_expire = strtotime(\"now + 4 weeks\");\n\t\t\tsetcookie(\"magic_id\", $oVisitor->get_id36(), $time_to_expire,\"/\");\n\t\t}\n\n\t\t// Load their Visitor record...\n\t\tif($oVisitor === null){\n\t\t\t$oVisitor = VisitorSearcher::Factory()\n\t\t\t\t->search_by_id(base_convert($_COOKIE['magic_id'], 36,10))\n\t\t\t\t->execute_one();\n\t\t}\n\t\t\n\t\t$oVisitor = Visitor::Cast($oVisitor);\n\t\tif(isset($_SERVER['REDIRECT_URL'])){\n\t\t\t$path = $_SERVER['REDIRECT_URL'];\n\t\t}elseif(isset($_SERVER['REQUEST_URI'])){\n\t\t\t$path = $_SERVER['REQUEST_URI'];\n\t\t}else{\n\t\t\t$path = \"unknown_path\";\n\t\t}\n\t\t$oThisView = View::Factory()\n\t\t\t->set_visitor($oVisitor->get_id())\n\t\t\t->set_path($path)\n\t\t\t->set_accesstime(time())\n\t\t\t->save();\n\t}",
"function setUserCookies($userInfo,$location,$userToken){\n $cookiePath = \"/\";\n $cookieExp = time()+(60*60*24);//one day -> seconds*minutes*hours\n if($location == 'developers'){\n setrawcookie('JWT', $userToken, $cookieExp, $cookiePath);\n\n }elseif($location == 'businesses'){\n setrawcookie('JWT', $userToken, $cookieExp, $cookiePath);\n }\n }",
"public function useragent() {\n\n $testString = \"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_4 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B350 Safari/8536.25\";\n $para = \"general.useragent.override\";\n\n shell_exec(\"mkdir firefox-profile\");\n shell_exec(\"cd ./firefox-profile && echo 'user_pref(\\\"$para\\\", \\\"$testString\\\");' >> prefs.js && zip -r ../firefox-profile *\");\n $data = file_get_contents('firefox-profile.zip');\n shell_exec(\"rm -rf firefox-profile && rm firefox-profile.zip\");\n return base64_encode($data);\n\n }",
"function setCookie() \n { \n $dir = $this->options['home_dir'] . '/sessions';\n if (!is_dir($dir)) {\n mkdir($dir);\n }\n if (!isset($_COOKIE['CSid'])) {\n $CSid = md5(date('U'));\n setcookie('CSid', $CSid, 0, '/');\n } else {\n $CSid = $_COOKIE['CSid'];\n }\n $ckfile = $dir.'/'.$CSid;\n $this->setOption('CURLOPT_COOKIEJAR', $ckfile);\n $this->setOption('CURLOPT_COOKIEFILE', $ckfile);\n }",
"public function setCookies(){\n $this->setOption(CURLOPT_COOKIEFILE, '/tmp/curl-session');\n $this->setOption(CURLOPT_COOKIEJAR, '/tmp/curl-session');\n }",
"public static function _autoload()\r\n {\r\n static::$cookieName = Config::get('user.cookie.name', static::$cookieName);\r\n static::$cookieDuration = Config::get('user.cookie.duration', static::$cookieDuration);\r\n }",
"function ses_name()\n\t{\n\t\tif (isset($_COOKIE['username']) && $_COOKIE['user_id'] && $_COOKIE['user_type'])\n\t\t{\n\t\t\t$_SESSION['username'] = $_COOKIE['username'];\n\t\t\t$_SESSION['user_id'] = $_COOKIE['user_id'];\n\t\t\t$_SESSION['user_type'] = $_COOKIE['user_type'];\n\t\t}\n\t}",
"protected function setUp()\r\n {\r\n $_SERVER['REMOTE_ADDR'] = \"REMOTE_ADDR\";\r\n $_SERVER['HTTP_USER_AGENT'] = \"HTTP_USER_AGENT\";\r\n $_SERVER['HTTP_ACCEPT'] = \"HTTP_ACCEPT\";\r\n $_COOKIE['crystalpure-user'] = \"mcsiljcincklsdncvklsdvisdn\";\r\n }",
"function cookie_auth($user_login, $user){\n\n $url = $_SERVER['HTTP_REFERER'];\n $Token = md5(uniqid(rand(), true));\n\n setcookie(\"wp_la_token\", $Token, time() + 86400 , \"/\", \".churchfuel.com\"); // 86400 = 1 day\n //setcookie(\"User_detail\", $user_detail, time() + 86400, \".churchfuel.com\"); // 86400 = 1 day\n database_conn($Token, $user);\n la_flag($url);\n}",
"function cookieset($c_name) { \n \n $more1 = substr(md5(rand()), 0, 3);\n $more2 = substr(md5(rand()), 0, 3);\n \n if ( $this->email && $this->pw ) {\n\n $usertoken = $this->getUserToken();\n\n $cookie = \"$more1$usertoken$more2$this->pw\";\n\n }\n \n else {\n\n $cookie = '';\n\n }\n\n if ($this->cookie_duration == 0) setcookie($c_name, $cookie, 0, \"/\"); \n else setcookie($c_name, $cookie, time()+365*3600*24, \"/\");\n \n }",
"public function cookies();",
"private static function iniSet() {\n \tini_set('session.use_cookies', true);\n \tini_set('session.cookie_lifetime', self::get('login_expiry', 24) * 3600);\n \tini_set('session.gc_maxlifetime', self::get('login_expiry', 24) * 3600); \n }",
"function cookies( $file = 'cookie.txt' )\n\t{\n\t\tif( !$file )\n\t\t\treturn;\n\t\t\n\t\t//Set cookie parameters\n\t\tcurl_setopt( $this->ch, CURLOPT_COOKIEJAR, $file );\n\t\tcurl_setopt( $this->ch, CURLOPT_COOKIEFILE, $file ); \n\t}",
"private function loadProfiles() {\n switch(D3P_STORAGE) {\n\t case 'file':\n\t $this->loadProfilesFromFile();\n\t break;\n }\n\t}",
"function set_visitors() {\r\n $link = $GLOBALS['link'];\r\n $obj = new OS_BR();\r\n $browser = $obj->showInfo('browser') . ' ' . $obj->showInfo('version');\r\n $os = $obj->showInfo('os');\r\n $ip_addr = substr(sha1($_SERVER['REMOTE_ADDR']), 0, 10);\r\n $i_vi = isset($_COOKIE['i_vi']) ? $_COOKIE['i_vi'] : NULL;\r\n if ($i_vi != $ip_addr) {\r\n \r\n if ($res = mysqli_query($link, \"SELECT * FROM `visitors` where `visitor_token` = '$ip_addr'\")) {\r\n if (mysqli_num_rows($res) > 0) {\r\n \r\n setcookie(\"i_vi\", $ip_addr, strtotime('+300 days'), \"/\");\r\n } else {\r\n setcookie(\"i_vi\", $ip_addr, strtotime('+300 days'), \"/\");\r\n $sql = \"INSERT INTO `visitors` ( `visitor_ip`, `visitor_os`, `visitor_browser`, `visitor_token`) VALUES ('\" . $_SERVER['REMOTE_ADDR'] . \"', '$os', '$browser', '$ip_addr')\";\r\n mysqli_query($link, $sql);\r\n }\r\n }\r\n }\r\n}",
"public function setCookies() {\n\t\tsetcookie(self::$cookieName, $this->getRequestUserName(), time() + (86400), \"/\"); // 86400 = 1 day\n\t\tsetcookie(self::$cookiePassword, $this->getRequestPassword(), time() + (86400), \"/\"); // 86400 = 1 day\n\t}",
"function __construct($cookie_file_location){\n\t\t$this->cookie = $cookie_file_location;\n\t\n\t}",
"public function addprofilecookie($profilecookie)\n\t{\n\t\t$this->_profilecookiearray[] = $profilecookie;\n\t}",
"public function fetchallcookies($request,$emailtocook,$passwordtocook)\n {\n $front_id_sess= $request->session()->get('front_id_sess');\n $useridhere=base64_encode($front_id_sess);\n $emailhere=$emailtocook;\n $passhere=$passwordtocook;\n Cookie::queue('cookuserid', $useridhere, 1440);\n Cookie::queue('cookuseremail', $emailhere, 1440);\n Cookie::queue('cookuserpassword', $passhere, 1440);\n }",
"function cookievalues($input){ \n\t \n\t $email = $_GET[\"email\"];\n\t $ga_name = $_GET[\"firstname\"];\n\t $ga_name = $_GET[\"lastname\"];\n\t$ga_transaction_id = $_GET[\"transaction_id\"];\n $ga_storename = \"TameHisHeart\";\n\t$ga_total = \"0.50\";\n\t$ga_tax = \"0.00\";\n $ga_shipping = \"0.00\";\n\t$ga_city = $_GET[\"billing_city\"];\n\t$ga_state = $_GET[\"billing_state\"];\n\t$ga_country = $_GET[\"country\"];\n\t$ga_skucode = \"THH-EBOOK-Optin\";\n\t$ga_product = \"1. Tame His Heart eBook optin\";\n\t$ga_category = \"none\";\n\t$ga_unit_price = \"0.50\";\n\t$ga_quantity = \"1\";\n\t\n\tsetcookie('email', $email, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('firstname', $ga_name, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('transaction_id', $ga_transaction_id, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('storename', $ga_storename, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('total', $ga_total, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('tax', $ga_tax, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('shipping', $ga_shipping, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('city', $ga_city, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('state', $ga_state, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('country', $ga_country, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('skucode', $ga_skucode, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('product', $ga_product, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('category', $ga_category, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('unit_price', $ga_unit_price, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('quantity', $ga_quantity, time() + (10 * 365 * 24 * 60 * 60));\n\t\n\treturn $ga_name;\n\t }",
"function cookievalues($input){ \n\t \n\t $email = $_GET[\"email\"];\n\t $ga_name = $_GET[\"firstname\"];\n\t $ga_name = $_GET[\"lastname\"];\n\t$ga_transaction_id = $_GET[\"transaction_id\"];\n $ga_storename = \"TameHisHeart\";\n\t$ga_total = \"0.50\";\n\t$ga_tax = \"0.00\";\n $ga_shipping = \"0.00\";\n\t$ga_city = $_GET[\"billing_city\"];\n\t$ga_state = $_GET[\"billing_state\"];\n\t$ga_country = $_GET[\"country\"];\n\t$ga_skucode = \"THH-EBOOK-Optin\";\n\t$ga_product = \"1. Tame His Heart eBook optin\";\n\t$ga_category = \"none\";\n\t$ga_unit_price = \"0.50\";\n\t$ga_quantity = \"1\";\n\t\n\tsetcookie('email', $email, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('firstname', $ga_name, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('transaction_id', $ga_transaction_id, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('storename', $ga_storename, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('total', $ga_total, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('tax', $ga_tax, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('shipping', $ga_shipping, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('city', $ga_city, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('state', $ga_state, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('country', $ga_country, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('skucode', $ga_skucode, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('product', $ga_product, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('category', $ga_category, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('unit_price', $ga_unit_price, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('quantity', $ga_quantity, time() + (10 * 365 * 24 * 60 * 60));\n\t\n\treturn $ga_name;\n\t }",
"private function setProfile()\n\t{\n\t\t// Set profile\n\t\t$profile = $this->input->get('profile', 1, 'int');\n\n\t\tif (empty($profile))\n\t\t{\n\t\t\t$profile = 1;\n\t\t}\n\n\t\t$session = Application::getInstance()->getContainer()->segment;\n\t\t$session->profile = $profile;\n\n\t\t/**\n\t\t * DO NOT REMOVE!\n\t\t *\n\t\t * The Model will only try to load the configuration after nuking the factory. This causes Profile 1 to be\n\t\t * loaded first. Then it figures out it needs to load a different profile and it does – but the protected keys\n\t\t * are NOT replaced, meaning that certain configuration parameters are not replaced. Most notably, the chain.\n\t\t * This causes backups to behave weirdly. So, DON'T REMOVE THIS UNLESS WE REFACTOR THE MODEL.\n\t\t */\n\t\tPlatform::getInstance()->load_configuration($profile);\n\t}",
"private function loginWithCookie()\n {\n }",
"function cookievalues($input){ \n\t \n\t $email = $_GET[\"email\"];\n\t $ga_name = $_GET[\"firstname\"];\n\t $ga_name = $_GET[\"lastname\"];\n\t$ga_transaction_id = $_GET[\"transaction_id\"];\n $ga_storename = \"TameHisHeart\";\n\t$ga_total = \"29.97\";\n\t$ga_tax = \"0.00\";\n $ga_shipping = \"0.00\";\n\t$ga_city = $_GET[\"billing_city\"];\n\t$ga_state = $_GET[\"billing_state\"];\n\t$ga_country = $_GET[\"country\"];\n\t$ga_skucode = \"THH-EBOOK\";\n\t$ga_product = \"1. Tame His Heart eBook\";\n\t$ga_category = \"none\";\n\t$ga_unit_price = \"29.97\";\n\t$ga_quantity = \"1\";\n\t\n\tsetcookie('email', $email, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('firstname', $ga_name, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('transaction_id', $ga_transaction_id, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('storename', $ga_storename, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('total', $ga_total, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('tax', $ga_tax, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('shipping', $ga_shipping, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('city', $ga_city, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('state', $ga_state, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('country', $ga_country, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('skucode', $ga_skucode, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('product', $ga_product, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('category', $ga_category, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('unit_price', $ga_unit_price, time() + (10 * 365 * 24 * 60 * 60));\n\tsetcookie('quantity', $ga_quantity, time() + (10 * 365 * 24 * 60 * 60));\n\t\n\treturn $ga_name;\n\t }",
"public function setCookies()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'set cookies form object',\n debug_backtrace(),\n '#213A59'\n ));\n }\n\n foreach ($this as $key => $val) {\n if ($key === 'PHPSESSID') {\n session_regenerate_id();\n $val = session_id();\n }\n\n $time = time() + core_class::options('cookielifetime');\n setcookie($key, $val, $time);\n }\n }",
"function setcookies()\n\t{\n\t\tfor ($x=0; $x<count($this->headers); $x++)\n\t\t{\n\t\t\tif (preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t{\n\t\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t\t}\n\t\t}\n\t}",
"public function cookie()\n {\n $data['result'] = $this->model('User_Setting_Model')->cookie($_COOKIE);\n\n //jika cookie username di client ada, tetapi bukan karena settingan disengaja oleh user\n if ($data['result'] === 406) {\n Message::setCookie406();\n header('Location: ' . URL . '/user/form_login');\n exit;\n }\n\n //jika cookie di clien ada, tetapi username tidak terdaftar\n if ($data['result'] === 404) {\n Message::setCookie404();\n header('Location: ' . URL . '/user/form_login');\n exit;\n }\n\n header('Location: ' . URL . '/home/index/' . $_COOKIE['name']);\n }",
"function loadUserSettings()\n{\n\tglobal $modSettings, $user_settings;\n\tglobal $ID_MEMBER, $db_prefix, $cookiename, $user_info, $language;\n\n\t// Check first the cookie, then the session.\n\tif (isset($_COOKIE[$cookiename]))\n\t{\n\t\t$_COOKIE[$cookiename] = stripslashes($_COOKIE[$cookiename]);\n\n\t\t// Fix a security hole in PHP 4.3.9 and below...\n\t\tif (preg_match('~^a:3:\\{i:0;(i:\\d{1,6}|s:[1-6]:\"\\d{1,6}\");i:1;s:(0|32):\"([a-fA-F0-9]{32})?\";i:2;i:\\d{1,12};\\}$~', $_COOKIE[$cookiename]) == 1)\n\t\t\tlist ($ID_MEMBER, $password) = @unserialize($_COOKIE[$cookiename]);\n\t\t$ID_MEMBER = !empty($ID_MEMBER) ? (int) $ID_MEMBER : 0;\n\t}\n\telseif (isset($_SESSION['login_' . $cookiename]) && ($_SESSION['USER_AGENT'] == $_SERVER['HTTP_USER_AGENT'] || !empty($modSettings['disableCheckUA'])))\n\t{\n\t\tlist ($ID_MEMBER, $password, $login_span) = @unserialize(stripslashes($_SESSION['login_' . $cookiename]));\n\t\t$ID_MEMBER = !empty($ID_MEMBER) && $login_span > time() ? (int) $ID_MEMBER : 0;\n\t}\n\telse\n\t\t$ID_MEMBER = 0;\n\n\t// Only load this stuff if the user isn't a guest.\n\tif ($ID_MEMBER != 0)\n\t{\n\t\t$request = db_query(\"\n\t\t\tSELECT mem.*, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH\n\t\t\tFROM {$db_prefix}members AS mem\n\t\t\t\tLEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = $ID_MEMBER)\n\t\t\tWHERE mem.ID_MEMBER = $ID_MEMBER\n\t\t\tLIMIT 1\", __FILE__, __LINE__);\n\t\t// Did we find 'im? If not, junk it.\n\t\tif (mysql_num_rows($request) != 0)\n\t\t{\n\t\t\t// The base settings array.\n\t\t\t$user_settings = mysql_fetch_assoc($request);\n\n\t\t\t// Wrong password or not activated - either way, you're going nowhere.\n\t\t\t$ID_MEMBER = md5_hmac($user_settings['passwd'], 'ys') != $password || empty($user_settings['is_activated']) ? 0 : $user_settings['ID_MEMBER'];\n\t\t}\n\t\telse\n\t\t\t$ID_MEMBER = 0;\n\t\tmysql_free_result($request);\n\t}\n\n\t// Found 'im, let's set up the variables.\n\tif ($ID_MEMBER != 0)\n\t{\n\t\tif (empty($_SESSION['ID_MSG_LAST_VISIT']))\n\t\t{\n\t\t\t$_SESSION['ID_MSG_LAST_VISIT'] = $user_settings['ID_MSG_LAST_VISIT'];\n\t\t\tunset($user_settings['ID_MSG_LAST_VISIT']);\n\n\t\t\tupdateMemberData($ID_MEMBER, array('ID_MSG_LAST_VISIT' => (int) $modSettings['maxMsgID'], 'lastLogin' => time(), 'memberIP' => '\\'' . $_SERVER['REMOTE_ADDR'] . '\\''));\n\n\t\t\t$user_settings['lastLogin'] = time();\n\t\t}\n\n\t\t$username = $user_settings['memberName'];\n\n\t\tif (empty($user_settings['additionalGroups']))\n\t\t\t$user_info = array(\n\t\t\t\t'groups' => array($user_settings['ID_GROUP'], $user_settings['ID_POST_GROUP'])\n\t\t\t);\n\t\telse\n\t\t\t$user_info = array(\n\t\t\t\t'groups' => array_merge(\n\t\t\t\t\tarray($user_settings['ID_GROUP'], $user_settings['ID_POST_GROUP']),\n\t\t\t\t\texplode(',', $user_settings['additionalGroups'])\n\t\t\t\t)\n\t\t\t);\n\t}\n\t// If the user is a guest, initialize all the critial user settings.\n\telse\n\t{\n\t\t// This is what a guest's variables should be.\n\t\t$username = '';\n\t\t$user_info = array('groups' => array(-1));\n\t\t$user_settings = array();\n\n\t\tif (isset($_COOKIE[$cookiename]))\n\t\t\t$_COOKIE[$cookiename] = '';\n\t}\n\n\t// Set up the $user_info array.\n\t$user_info += array(\n\t\t'username' => $username,\n\t\t'name' => isset($user_settings['realName']) ? $user_settings['realName'] : '',\n\t\t'email' => isset($user_settings['emailAddress']) ? $user_settings['emailAddress'] : '',\n\t\t'passwd' => isset($user_settings['passwd']) ? $user_settings['passwd'] : '',\n\t\t'language' => empty($user_settings['lngfile']) || empty($modSettings['userLanguage']) ? $language : $user_settings['lngfile'],\n\t\t'is_guest' => $ID_MEMBER == 0,\n\t\t'is_admin' => in_array(1, $user_info['groups']),\n\t\t'theme' => empty($user_settings['ID_THEME']) ? 0 : $user_settings['ID_THEME'],\n\t\t'last_login' => empty($user_settings['lastLogin']) ? 0 : $user_settings['lastLogin'],\n\t\t'ip' => $_SERVER['REMOTE_ADDR'],\n\t\t'posts' => empty($user_settings['posts']) ? 0 : $user_settings['posts'],\n\t\t'time_format' => empty($user_settings['timeFormat']) ? $modSettings['time_format'] : $user_settings['timeFormat'],\n\t\t'time_offset' => empty($user_settings['timeOffset']) ? 0 : $user_settings['timeOffset'],\n\t\t'avatar' => array(\n\t\t\t'url' => isset($user_settings['avatar']) ? $user_settings['avatar'] : '',\n\t\t\t'ID_ATTACH' => isset($user_settings['ID_ATTACH']) ? $user_settings['ID_ATTACH'] : 0\n\t\t),\n\t\t'smiley_set' => isset($user_settings['smileySet']) ? $user_settings['smileySet'] : '',\n\t\t'messages' => empty($user_settings['instantMessages']) ? 0 : $user_settings['instantMessages'],\n\t\t'unread_messages' => empty($user_settings['unreadMessages']) ? 0 : $user_settings['unreadMessages'],\n\t\t'total_time_logged_in' => empty($user_settings['totalTimeLoggedIn']) ? 0 : $user_settings['totalTimeLoggedIn'],\n\t\t'permissions' => array()\n\t);\n\t$user_info['groups'] = array_unique($user_info['groups']);\n\n\tif (!empty($modSettings['userLanguage']) && !empty($_REQUEST['language']))\n\t{\n\t\t$user_info['language'] = strtr($_REQUEST['language'], './\\\\:', '____');\n\t\t$_SESSION['language'] = $user_info['language'];\n\t}\n\telseif (!empty($modSettings['userLanguage']) && !empty($_SESSION['language']))\n\t\t$user_info['language'] = strtr($_SESSION['language'], './\\\\:', '____');\n\n\t// Just build this here, it makes it easier to change/use.\n\tif ($user_info['is_guest'])\n\t\t$user_info['query_see_board'] = 'FIND_IN_SET(-1, b.memberGroups)';\n\t// Administrators can see all boards.\n\telseif ($user_info['is_admin'])\n\t\t$user_info['query_see_board'] = '1';\n\t// Registered user.... just the groups in $user_info['groups'].\n\telse\n\t\t$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';\n}",
"private function _proccessCookies() {\n\t\tif(isset($_COOKIE)) {\n\t\t\tforeach($_COOKIE as $key => $value) {\n\t\t\t\tif(!empty($value)) {\n\t\t\t\t\t$this->_cookies[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}",
"private function updateCookies()\n {\n // Extract cookies. \n if (isset($this->request_headers['Cookie'])) {\n $cookies = explode(';', $this->request_headers['Cookie']);\n $cookies_count = count($cookies);\n\n // Set cookies.\n for ($i=0; $i<$cookies_count; $i++) {\n if (strpos($cookies[$i], '=') !== false) {\n list($name, $val) = explode('=', trim($cookies[$i]));\n $this->cookies[$name] = $name . '=' . $val . ';';\n $this->cookies_original[$name] = $val;\n }\n }\n }\n }"
] | [
"0.59505165",
"0.593354",
"0.59009236",
"0.58335435",
"0.5821779",
"0.5799418",
"0.5781181",
"0.5749495",
"0.5718722",
"0.56815976",
"0.5677121",
"0.5631829",
"0.556727",
"0.5563555",
"0.5560823",
"0.5517468",
"0.5515856",
"0.55092114",
"0.55034167",
"0.5463267",
"0.5463267",
"0.5453681",
"0.54425144",
"0.5442272",
"0.54344255",
"0.543061",
"0.54244643",
"0.5416736",
"0.54106104",
"0.5409433"
] | 0.59868205 | 0 |
Determine if the value of the model's "marked as" attribute is equal to the "completed" value. | public function isCompleted()
{
return $this->markedAs($this->getCompletedValue());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCompletedAttribute($completed)\n {\n return (bool) $completed;\n }",
"public function isComplete()\n {\n return (bool) $this->completed_at;\n }",
"public function isComplete()\n {\n return !is_null($this->completed_at);\n }",
"public function isCompleted()\n {\n return $this->statuses->where('name', 'Completed')->isNotEmpty();\n }",
"public function isCompleted()\n {\n return (bool) $this->getIsCompleted();\n }",
"public function isCompleted()\n {\n return $this->completed;\n }",
"public static function iscomplete()\n\t{\n\t\treturn static::where('completed', 1)->get(); \n\t}",
"public function setCompleted()\n {\n return $this->setMarkedAs($this->getCompletedValue());\n }",
"public function isCompleted()\n {\n return $this->status === self::STATUS_COMPLETED;\n }",
"public function isCompleted()\n {\n return (\n $this->getTime() !== null\n );\n }",
"public function setCompletedAttribute($completed)\n {\n $this->attributes['completed'] = (bool) $completed;\n }",
"public function isComplete()\n {\n return $this->isComplete;\n }",
"protected function getCompletedAttribute()\n {\n return $this->confirmed->filter(function($programSpeaker){\n return $programSpeaker->program->is_completed\n or $programSpeaker->program->is_closed\n or $programSpeaker->program->is_closed_out;\n });\n }",
"public function isIsComplete()\n {\n return $this->isComplete;\n }",
"public function isComplete()\n {\n foreach($this->fieldValues as $record => $fieldValue)\n { \n if($fieldValue->Value)\n {\n $fieldValue->save();\n }\n } \n return true;\n }",
"public function isActive()\n {\n $member = \\PanicHDMember::findOrFail(auth()->user()->id);\n if ($member->currentLevel() >= 2) {\n return (bool) (is_null($this->completed_at) and $this->status_id != Setting::grab('default_status_id'));\n } else {\n return (bool) is_null($this->completed_at);\n }\n\n return (bool) $this->completed_at;\n }",
"public function isComplete(){\n\t\treturn $this->Status == 'Captured' ||\n\t\t\t\t$this->Status == 'Refunded' ||\n\t\t\t\t$this->Status == 'Void';\n\t}",
"public function isComplete(): bool\n {\n return (bool) $this->data(\"_arcanist.{$this->slug}\", false);\n }",
"public function completed()\n {\n $user_id = auth()->user()->id;\n\n $lessons = $this->lessons();\n\n $completed = true;\n\n foreach($lessons as $lesson){\n $les_completed = $lesson->completed();\n if($les_completed !== true){\n return $les_completed;\n }\n }\n\n return $completed;\n }",
"public function asCompleted()\n {\n return $this->markAs($this->getCompletedValue());\n }",
"public function getCompletedValue()\n {\n return defined('static::COMPLEtED_VALUE') ? static::COMPLEtED_VALUE : 'completed';\n }",
"function isComplete()\n\t{\n\t\treturn ($this->isEmpty());\n\t}",
"public function getApproved()\n {\n return $this->hasTransaction() && (string) $this->data->Payment->TxnList->Txn->approved == 'Yes';\n }",
"public function isComplete()\n {\n $this->storeCurrentValue();\n \n //save all of the recorded fields \n foreach($this->fieldValues as $record => $fieldValue)\n {\n //if a value has been set, save the field \n if($fieldValue->Value != \"\")\n {\n $fieldValue->save();\n }\n else\n { \n $fieldValue->delete();\n $this->fieldValues[$record] = $this->newFieldValue();\n }\n }\n return true;\n }",
"private function isCompletedState(string $modelKey)\n {\n return in_array($modelKey, $this->loaded_fields);\n }",
"public function getComplete()\n {\n return $this->Complete;\n }",
"public function check_completed()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t// Set the language to Dutch (TODO: set to language of participant?)\n\t\treset_language(L::DUTCH);\n\n\t\t// Get all testinvites that have not yet been completed\n\t\t$testinvites = $this->testInviteModel->get_not_completed_testinvites(); \n\t\tforeach ($testinvites as $testinvite)\n\t\t{\n\t\t\t$testsurvey = $this->testInviteModel->get_testsurvey_by_testinvite($testinvite);\n\t\t\t// If the survey still exists in LimeSurvey...\n\t\t\tif ($this->surveyModel->get_survey_by_id($testsurvey->limesurvey_id))\n\t\t\t{\n\t\t\t\t// Check with LimeSurvey whether the survey has actually been completed\n\t\t\t\t$result = $this->surveyModel->get_result_by_token($testsurvey->limesurvey_id, $testinvite->token);\n\t\t\t\tif ($result) \n\t\t\t\t{\n\t\t\t\t\t// If there is actually a result row, set the survey to completed\n\t\t\t\t\t$this->testInviteModel->set_completed($testinvite->id, $result->submitdate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function orderComplete(){\n if($this->status == \"complete\") return true;\n return false;\n }",
"public function valid() {\n return $this->is_complete == false;\n }",
"function isDue()\n {\n return $this->model->isTenMinuteDue();\n }"
] | [
"0.71210116",
"0.6898434",
"0.67936087",
"0.6707276",
"0.6697463",
"0.6619125",
"0.6613099",
"0.6443795",
"0.6340761",
"0.6268573",
"0.6230815",
"0.6177934",
"0.6172207",
"0.60974544",
"0.60796696",
"0.6059642",
"0.60512114",
"0.6037864",
"0.60331964",
"0.59969294",
"0.59789276",
"0.59554195",
"0.5897655",
"0.5894974",
"0.5886463",
"0.58726",
"0.5846098",
"0.58391917",
"0.58214444",
"0.5817467"
] | 0.7376994 | 0 |
Set the value of the "marked as" attribute as "completed" value. | public function setCompleted()
{
return $this->setMarkedAs($this->getCompletedValue());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCompletedAttribute($completed)\n {\n $this->attributes['completed'] = (bool) $completed;\n }",
"public function setCompleted($completed)\n {\n $this->completed = $completed;\n }",
"public function markAsCompleted() {\n // Set attributes\n $this->status = self::STATUS_COMPLETED;\n // Save input data\n $this->save(false);\n \n // Return self object in order to allow chaining the methods\n return $this;\n }",
"public function complete($completed = true){\n\n $this->update(compact('completed'));\n\n }",
"function setComplete($a_complete)\n\t{\n\t\t$this->complete = ($a_complete) ? 1 : 0;\n\t}",
"public function asCompleted()\n {\n return $this->markAs($this->getCompletedValue());\n }",
"function sajax_update_completed ($completed) {\n\t\tglobal $card, $Utilisateur;\n\t\t$card->completed = $completed;\n\t\t$card->updated_date = time();\n\t\t$card->updated_by = $Utilisateur['user_id'];\n\t\t$card->save();\n\t}",
"public function getCompletedAttribute($completed)\n {\n return (bool) $completed;\n }",
"public function complete()\n {\n $this->update(['completed_at' => Carbon::now()]);\n }",
"public function markAsFinished()\n {\n $this->status = self::STATUS_INACTIVE;\n $this->save();\n }",
"public function setComplete( $complete ) {\n\t\t\n\t\t$this->complete = $complete;\n\t}",
"public function markFinished(){\n $this->status = self::STATUS_FINISHED;\n return $this->save(false,['status']);\n }",
"public function markComplete($input_goal)\n {\n // TODO I could just index the goals array by goal id and then I don't\n // need to cycle through to find it\n foreach ($this->goals as &$goal) {\n if ($input_goal->id == $goal->id) {\n $goal->status = self::STATUS_COMPLETED;\n $goal->date_completed = date('Y-m-d H:i:s');\n }\n }\n\n $this->saveGoals();\n }",
"public function setCompletedFlag(?string $completedFlag): self\n {\n $this->completedFlag = $completedFlag;\n\n return $this;\n }",
"public function markAsComplete($task_id);",
"public function isCompleted()\n {\n return $this->markedAs($this->getCompletedValue());\n }",
"public function markProfileAsCompleted()\n {\n return $this->forceFill([\n 'profile_updated_at' => $this->freshTimestamp(),\n ])->save();\n }",
"public function markAsComplete()\n {\n $send_email = false;\n if (empty($this->end_time)) {\n //This method can be called on single page scans. Don't update the end time in that case.\n $this->end_time = Util::epochToDateTime();\n $send_email = true; //Only send emails if the scan isn't being updated by a single page scan.\n } else {\n //Set the updated tme\n $this->date_updated = Util::epochToDateTime();\n }\n \n $this->status = self::STATUS_COMPLETE;\n $this->gpa = $this->computeGPA();\n \n if ($this->save()) {\n //remove any extra scans\n $site = $this->getSite();\n $site->cleanScans();\n }\n \n //Add a historical record of the GPA\n SiteHistory::createNewSiteHistory($this, $this->gpa, $this->getDistinctPageCount());\n \n if ($send_email) {\n $this->sendChangedScanEmail();\n }\n }",
"public function testMarkAsComplete() {\n $this->state\n ->expects($this->once())\n ->method('set')\n ->with('cron_timer.foo.zip', $this->time);\n $this->cronTimer->markAsComplete('foo.zip');\n }",
"function markStepAsCompleted($step) {\n $stepName = is_string($step) ? $step : $step->name;\n if (isset($this->state['step_details'][$stepName]) == false) {\n return false;\n }\n\n $this->state['step_details'][$stepName]['completed'] = date('Y-m-d H:i:s');\n return true;\n }",
"public function markTaskAsDone(): void\n {\n $this->done = true;\n }",
"public function markAsCompleted(): self\n {\n if (! $this->user_id) {\n throw new OrderNotAssignedToUser('No user assigned to order', 1);\n }\n\n $this->update([\n 'paid_at' => now(),\n 'status' => Order::STATUS_COMPLETED,\n ]);\n\n if ($this->coupon && $this->coupon_total) {\n event(new CouponRedeemed($this->coupon));\n }\n\n event(new OrderCompleted($this));\n\n return $this;\n }",
"public function complete(): void\n {\n $this->status = \"completed\";\n echo \"Order: #{$this->id} is now {$this->status}.\";\n }",
"public function changeTaskCompletion($taskId, $changeToComplete){\n $this->db->query('UPDATE tasks SET Task_Completed = :completionValue WHERE Task_Id = :taskid && User_Id = :userId');\n\n\n if($changeToComplete == true){\n $this->db->bind(':completionValue', 1);\n }else{\n $this->db->bind(':completionValue', 0);\n }\n $this->db->bind(':taskid', $taskId);\n $this->db->bind(':userId', $_SESSION['user_id']);\n\n //call execute if you want to insert\n if($this->db->execute()){\n return true;\n }else{\n return false;\n }\n\n }",
"public function setClaimed()\n {\n $this->status = self::STATUS_CLAIMED;\n $this->save();\n }",
"public function mark()\n {\n $sqlString = new SQLbuilder();\n $queryResult = $sqlString\n ->setTableName(self::TABLE)\n ->update('is_done', $this->getIsDone())\n ->where('id', $this->getId(), '=')\n ->execute($this->conn);\n return $queryResult;\n }",
"public function setPending()\n {\n $this->attributes['status'] = 'pending';\n self::save();\n }",
"public function markAsCompleted(Request $request)\n {\n $todo = Todo::find($request->id);\n $todo->completed = 1;\n $todo->save();\n return redirect('/todo');\n }",
"public function setClassificationFinishedAtAttribute($value)\n {\n $this->attributes['classification_finished_at'] = new UTCDateTime(strtotime($value) * 1000);\n }",
"public function markAsDone();"
] | [
"0.7798963",
"0.7566598",
"0.7143837",
"0.7025443",
"0.68265426",
"0.6805935",
"0.6798092",
"0.6667501",
"0.661726",
"0.6589061",
"0.6553243",
"0.64300996",
"0.6318121",
"0.6304127",
"0.6279727",
"0.6255942",
"0.6246196",
"0.6233984",
"0.6206734",
"0.6042985",
"0.6001882",
"0.5987099",
"0.5983344",
"0.5877127",
"0.5855813",
"0.5829723",
"0.5826012",
"0.582344",
"0.58091784",
"0.58089834"
] | 0.7856949 | 0 |
Get the value of the "completed" mark. | public function getCompletedValue()
{
return defined('static::COMPLEtED_VALUE') ? static::COMPLEtED_VALUE : 'completed';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComplete()\n {\n return $this->complete;\n }",
"public function getComplete()\n {\n return $this->Complete;\n }",
"public function asCompleted()\n {\n return $this->markAs($this->getCompletedValue());\n }",
"public function getComplete() {\n\t\t\n\t\treturn $this->complete;\n\t}",
"public function getComplete()\n {\n return $this->_complete;\n }",
"public function setCompleted()\n {\n return $this->setMarkedAs($this->getCompletedValue());\n }",
"public function getDone()\n {\n return $this->done;\n }",
"public function getCompletedFlag(): ?string\n {\n return $this->completedFlag;\n }",
"public function isCompleted()\n {\n return $this->markedAs($this->getCompletedValue());\n }",
"public function getPercentCompleted()\n {\n return $this->percent_completed;\n }",
"public static function iscomplete()\n\t{\n\t\treturn static::where('completed', 1)->get(); \n\t}",
"public function isCompleted()\n {\n return $this->completed;\n }",
"public function isCompleted()\n {\n return (bool) $this->getIsCompleted();\n }",
"public function getCompletedAttribute($completed)\n {\n return (bool) $completed;\n }",
"function getDateFinalCompleted() {\n\t\treturn $this->getData('dateFinalCompleted');\n\t}",
"public function isComplete()\n {\n return (bool) $this->completed_at;\n }",
"function getDateCompleted() {\n\t\treturn $this->getData('dateCompleted');\n\t}",
"public function isComplete()\n {\n return $this->isComplete;\n }",
"public function getPercentageCompletedAttribute()\n {\n // Get Total count of work items.\n $totalWorkItems = $this->workItemsOfProject()->count();\n\n // No work items.\n if ($totalWorkItems == 0) {\n return '0%';\n }\n\n // Get number of work items which are completed.\n $totalCompletedWorkItems = $this->workItemsOfProject()->where('status', '=', 'closed')->count();\n\n return floor(($totalCompletedWorkItems / $totalWorkItems) * 100).'%';\n }",
"public function getProgressAttribute()\n {\n return $this->total_tasks == 0 ? 0 : number_format( ($this->completed_tasks / $this->total_tasks) * 100 );\n }",
"public function isIsComplete()\n {\n return $this->isComplete;\n }",
"public function getCompletion()\n {\n\t\t\treturn $this->_completion;\n }",
"public function getCompletion(): ?bool\n {\n return $this->completion;\n }",
"public function getData()\n {\n return $this->getEntityData('Done');\n }",
"function col_completion_status($values) {\n if($values->completion_status == \"completed\") {\n return \"Completed\"; \n }\n }",
"protected function getCompletedAttribute()\n {\n return $this->confirmed->filter(function($programSpeaker){\n return $programSpeaker->program->is_completed\n or $programSpeaker->program->is_closed\n or $programSpeaker->program->is_closed_out;\n });\n }",
"public function getDateCompleted() \n {\n return $this->_fields['DateCompleted']['FieldValue'];\n }",
"public function getPercentTasksCompleteAttribute()\n {\n return $this->countTasksComplete / $this->countTasks;\n }",
"public function getValue()\n {\n return $this->status;\n }",
"public function getCompletedTasksAttribute()\n {\n return $this->subTasks()->where('completed', 1)->get()->count();\n }"
] | [
"0.73545283",
"0.7307656",
"0.7278844",
"0.7270033",
"0.7119061",
"0.70590943",
"0.6994195",
"0.69759774",
"0.6975295",
"0.68454355",
"0.66020817",
"0.6571703",
"0.6426472",
"0.6417062",
"0.6392567",
"0.63727885",
"0.6290507",
"0.6263931",
"0.62412685",
"0.61529976",
"0.602854",
"0.5976461",
"0.59554714",
"0.59440947",
"0.59289587",
"0.59058523",
"0.58989596",
"0.5896171",
"0.5861522",
"0.58610946"
] | 0.7755349 | 0 |
/ have the following form fields: 'ticket_id' 'customer_id' 'date' 'duration' 'time_depart' 'time_arrive' 'flight_id' 'pay_id' so when request>all() it'll capture the customer_id. | public function store(Request $request) {
$booking = new Booking;
// $reqToLog = $request->all();
Log::info($request->all());
$booking->ticket_id = $request->input('ticket_id');
$booking->customer_id= $request->input('customer_id');
$booking->flight_date=$request->input('flight_date');
$booking->duration = $request->input('duration');
$booking->time_depart = $request->input('time_depart');
$booking->time_arrive = $request->input('time_arrive');
$booking->flight_id = $request->input('flight_id');
$booking->pay_id = $request->input('pay_id');
$booking->save();
// return Booking::create([
// 'ticket_id' => $request->input('ticket_id'),
// 'customer_id'=> $request->input('customer_id'),
// 'flight_date' => $request->input('flight_date'),
// 'duration' => $request->input('duration'),
// 'time_depart' => $request->input('time_depart'),
// 'time_arrive' => $request->input('time_arrive'),
// 'flight_id' => $request->input('flight_id'),
// 'pay_id' => $request->input('pay_id'),
// ]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ticketIncomplete(AirlineRequest $request)\n {\n\n $ticket=Ticket::where('id',$request->id)->first();\n \n $ticket->fill($request->all())->save();\n return redirect('/ticketTripDetailIndex');//goto ticketTripDetailIndex\n }",
"public function ticketTripDetailStore(TicketTripDetailRequest $request)\n {\n $ticket=Ticket::where('id',$request->id)->first();\n $ticket->fill($request->all())->save();\n return redirect('/ticketPassengerIndex');//goto ticketTripDetailIndex\n }",
"public function updateTicket(Request $req){\n\t\t// echo $req->ticket_number_3party . \"<br>\";\n\n\t\t$result = DB::table('ticketing__detail')\n\t\t\t->where('id_ticket','=',$req->id_ticket)\n\t\t\t->update([\n\t\t\t\t\"engineer\" => $req->engineer,\n\t\t\t\t\"ticket_number_3party\" => $req->ticket_number_3party,\n\t\t\t]);\n\n\n\t\t$update = DB::table('ticketing__activity')\n\t\t\t->insert([\n\t\t\t\t\"id_ticket\" => $req->id_ticket,\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s.000000\"),\n\t\t\t\t\"activity\" => \"ON PROGRESS\",\n\t\t\t\t\"operator\" => Auth::user()->nickname,\n\t\t\t\t\"note\" => $req->note\n\t\t\t]);\n\t\t\t// ->get();\n\n\t\t$result = DB::table('ticketing__detail')\n\t\t\t->where('id_ticket','=',$req->id_ticket)\n\t\t\t// ->update([\n\t\t\t// \t\"engineer\" => $req->engineer,\n\t\t\t// \t\"ticket_number_3party\" => $req->ticket_number_3party,\n\t\t\t// ]);\n\t\t\t->get();\n\n\t\t$result = DB::table('ticketing__id')\n\t\t\t->where('ticketing__id.id_ticket','=',$req->id_ticket)\n\t\t\t->join('ticketing__client','ticketing__client.id','=','ticketing__id.id_client')\n\t\t\t->value('ticketing__client.client_acronym');\n\n\t\treturn $result;\n\n\t\t// echo \"<pre>\";\n\t\t// print_r($result);\n\t\t// echo \"</pre>\";\n\t}",
"public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'event_id' => 'required',\n 'amount' => 'required',\n 'available_from' => 'required',\n 'available_to' => 'required',\n\n ]);\n\n if ($validator->fails()) {\n return redirect('create-ticket')\n ->withErrors($validator)\n ->withInput();\n }\n $data = [\n 'event_id' => $request->event_id,\n 'amount' => $request->amount,\n 'available_from' =>$request->available_from,\n 'available_to' => $request->available_to,\n\n ];\n if($request->member_price){\n $data['member_price'] = $request->member_price;\n }\n if($request->nonmember_adult){\n $data['nonmember_adult'] = $request->nonmember_adult;\n }\n if($request->nonmember_kid){\n $data['nonmember_kid'] = $request->nonmember_kid;\n }\n\n Ticket::create($data);\n\n return redirect('tickets')->with('message','Ticket created');\n\n }",
"public function collectBillProcess(Request $request) {\n if($request->input('customer_code')) {\n $customer = Customer::find($request->input('customer_code'));\n } elseif ($request->input('customer_id')) {\n $customer = Customer::find($request->input('customer_id'));\n }\n\n $form_data = $request->all();\n $form_data['customers_id'] = $customer->customers_id; \n $form_data['due'] = 0; \n // Get previous last paid date and format it\n $last_paid_carbon = \\Carbon\\Carbon::createFromFormat('Y-m-d', $customer->last_paid);\n $last_paid_date_num = $request->input('last_paid_date_num');\n $form_data['last_paid_date_num'] = $last_paid_date_num; \n // Add that number of months to the last_paid_carbon date \n $last_paid_date = $last_paid_carbon->addMonth($last_paid_date_num);\n $form_data['last_paid_date'] = $last_paid_date->toDateString();\n // Calculate total bill and store it\n $form_data['total'] = ($customer->monthly_bill)*$last_paid_date_num;\n $form_data['users_id'] = Auth::user()->id;\n $form_data['timestamp'] = \\Carbon\\Carbon::now()->format('d-m-Y H:i:s');\n CustomerDetails::create($form_data);\n \n // Update last_paid in customer table\n $last_paid_carbon = (new \\Carbon\\Carbon($customer->last_paid))->addMonth($last_paid_date_num)->format('d/m/Y');\n $customer->last_paid = $last_paid_carbon;\n $customer->save();\n\n $journal = new Journal();\n $journal->transaction_date = Carbon::createFromFormat('Y-m-d', Carbon::now()->toDateString())->format('d/m/Y');\n $journal->note = 'Customer(Name: ' .$customer->name.', Code: ' . $customer->customer_code . ') has paid total ' . $form_data['total'] . ' Taka';\n $journal->ref_number = $customer->customer_code;\n $journal->save();\n\n $cash = ChartOfAccount::where('name', 'Cash')->first();\n $request = (object) ['amount' => $form_data['total'], 'expense_category' => $cash->id];\n $debit = (new Posting)->debitExpense($request, $journal);\n\n $sales = ChartOfAccount::where('name', 'Sales')->first();\n $request = (object) ['amount' => $form_data['total'], 'paid_with' => $sales->id];\n $credit = (new Posting)->creditPayable($request, $journal);\n\n return redirect('internetbillcollectionlist');\n }",
"public function fields()\n {\n return [\n //Gravatar::make('requester.email')->withDefault('https://raw.githubusercontent.com/BadChoice/handesk/master/public/images/default-avatar.png'),\n TicketStatusField::make('id', ''),\n Link::make('title', __('ticket.subject'))->rowClass('notification')->displayCallback(function ($ticket) {\n return \"#{$ticket->id} · \" . $ticket->request_type;\n })->route('tickets.show')->sortable(),\n Link::make('requester.id', trans_choice('ticket.requester', 1))->displayCallback(function ($ticket) {\n return $ticket->requester->name ?? '--';\n })->link('tickets?requester_id={field}'),\n Link::make('tickets.view', __('Note'))->displayCallback(function ($ticket) {\n if (auth()->user()->admin == 1) {\n if ($ticket->view != Tickets::ADMIN_SEEN && $ticket->view != Tickets::SEEN) {\n return '<i class=\"fa fa-bell\"></i>';\n }\n } else {\n if ($ticket->view != Tickets::USER_SEEN && $ticket->view != Tickets::SEEN) {\n return '<i class=\"fa fa-bell\"></i>';\n }\n }\n\n }),\n Link::make('team.id', __('ticket.team'))->displayCallback(function ($ticket) {\n return $ticket->team->name ?? '--';\n })->link('tickets?team_id={field}'),\n Link::make('user.id', trans_choice('ticket.user', 1))->displayCallback(function ($ticket) {\n return $ticket->user->name ?? '--';\n })->link('tickets?user_id={field}'),\n Rating::make('rating', ''),\n Date::make('created_at', __('ticket.requested'))->showInTimeAgo()->sortable(),\n Date::make('updated_at', __('ticket.updated'))->showInTimeAgo()->sortable(),\n ];\n }",
"public function store(Request $request)\n {\n $flight_schedule = new flight_schedule;\n $messages = [];\n if (!empty($request->flight_up) && ($request->flight_type_up == 2)) {\n foreach ($request->flight_up as $flight) {\n $messages['up_departure_' . $flight . '.required'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.date_format'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.date'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.after'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.before'] = 'Please enter valid Departure Time';\n\n $messages['up_arrival_' . $flight . '.required'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.date_format'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.date'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.after'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.before'] = 'Please enter valid Arrival Time';\n }\n }\n if (!empty($request->flight_down) && ($request->flight_type_down == 2)) {\n foreach ($request->flight_down as $flight) {\n $messages['down_departure_' . $flight . '.required'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.date_format'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.date'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.after'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.before'] = 'Please enter valid Departure Time';\n\n $messages['down_arrival_' . $flight . '.required'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.date_format'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.date'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.after'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.before'] = 'Please enter valid Arrival Time';\n }\n }\n $valid_array = array(\n 'flight_sche_title' => 'required|unique:flight_schedules',\n 'airline_up' => 'required',\n 'flight_up' => 'required',\n 'flight_profit' => 'required|numeric',\n 'price_per_person' => 'required|numeric',\n 'flight_profit' => 'required|numeric',\n 'profit_curr' => 'required|numeric|digits_between:1,4',\n 'flight_type_up' => 'required|numeric|digits_between:1,2',\n 'flight_type_down' => 'required|numeric|digits_between:1,2',\n );\n if ($request->flight_type_up == 1) {\n $valid_array['up_departure_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:up_arrival_time';\n $valid_array['up_arrival_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:up_departure_time';\n }\n if ($request->flight_type_down == 1) {\n $valid_array['down_departure_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:down_arrival_time';\n $valid_array['down_arrival_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:down_departure_time';\n }\n if (($request->flight_type_up == 2) && (!empty($request->flight_up))) {\n foreach ($request->flight_up as $flight) {\n $valid_array['up_departure_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:up_arrival_' . $flight;\n $valid_array['up_arrival_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:up_departure_' . $flight;\n }\n }\n if (($request->flight_type_down == 2) && (!empty($request->flight_down))) {\n foreach ($request->flight_down as $flight) {\n $valid_array['down_departure_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:down_arrival_' . $flight;\n $valid_array['down_arrival_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:down_departure_' . $flight;\n }\n }\n $this->validate($request, $valid_array, $messages);\n $flight_schedule->flight_sche_title = $request->flight_sche_title;\n $flight_schedule->price_per_person = $request->price_per_person;\n $flight_schedule->price_curr = $request->price_curr;\n $flight_schedule->profit_type = $request->profit_type;\n $flight_schedule->flight_profit = $request->flight_profit;\n $flight_schedule->package_profit = $request->package_profit;\n $flight_schedule->profit_curr = $request->profit_curr;\n $flight_schedule->flight_pnr_no = $request->flight_pnr_no;\n $flight_schedule->flight_type_up = $request->flight_type_up;\n $flight_schedule->flight_type_down = $request->flight_type_down;\n $flight_schedule->num_available_seat = $request->num_available_seat;\n $flight_schedule->num_total_seat = $request->num_total_seat;\n $flight_schedule->flight_incr_price_str = $request->flight_incr_price_str;\n $flight_schedule->price_incr_90 = $request->price_incr_90;\n $flight_schedule->price_incr_80 = $request->price_incr_80;\n $flight_schedule->price_incr_70 = $request->price_incr_70;\n $flight_schedule->price_incr_60 = $request->price_incr_60;\n $flight_schedule->price_incr_50 = $request->price_incr_50;\n $flight_schedule->price_incr_40 = $request->price_incr_40;\n $flight_schedule->price_incr_30 = $request->price_incr_30;\n $flight_schedule->price_incr_20 = $request->price_incr_20;\n $flight_schedule->price_incr_10 = $request->price_incr_10;\n $flight_schedule->flight_sche_desc = $request->flight_sche_desc;\n $flight_schedule->flight_sche_status = $request->flight_sche_status;\n if ($request->flight_type_up == 1) {\n $flight_schedule->airline_up = $request->airline_up;\n $flight_schedule->flight_up = $request->flight_up;\n $flight_schedule->up_departure_time = $request->up_departure_time;\n $flight_schedule->up_arrival_time = $request->up_arrival_time;\n }\n if ($request->flight_type_down == 1) {\n $flight_schedule->airline_down = $request->airline_down;\n $flight_schedule->flight_down = $request->flight_down;\n $flight_schedule->down_departure_time = $request->down_departure_time;\n $flight_schedule->down_arrival_time = $request->down_arrival_time;\n\n }\n $flight_schedule->save();\n\n // Update the relevants packages\n // ===============================\n $this->updatePackagesProfit($flight_schedule);\n //================================\n if ($request->flight_type_up == 2) {\n $flight_schedule->multi_airline_up = serialize($request->airline_up);\n $flight_schedule->multi_flight_up = serialize($request->flight_up);\n foreach ($request->flight_up as $flight) {\n $new_conn = new flight_schedule_connection;\n $new_conn->flight_id = $flight;\n $new_conn->flight_schedule_id = $flight_schedule->id;\n $new_conn->departure_time = $request->{'up_departure_' . $flight};\n $new_conn->arrival_time = $request->{'up_arrival_' . $flight};\n $new_conn->type = 1;\n $new_conn->save();\n }\n $departure_flight = flight_schedule_connection::where([['type', 1], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'asc')->get()->first();\n $arrival_flight = flight_schedule_connection::where([['type', 1], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'desc')->get()->first();\n $flight_schedule->up_departure_time = $departure_flight->departure_time;\n $flight_schedule->up_arrival_time = $arrival_flight->arrival_time;\n $flight_schedule->airline_up = $departure_flight->flight->flight_airline;\n $flight_schedule->flight_up = $departure_flight->flight_id;\n }\n if ($request->flight_type_down == 2) {\n $flight_schedule->multi_airline_down = serialize($request->airline_down);\n $flight_schedule->multi_flight_down = serialize($request->flight_down);\n foreach ($request->flight_down as $flight) {\n $new_conn = new flight_schedule_connection;\n $new_conn->flight_id = $flight;\n $new_conn->flight_schedule_id = $flight_schedule->id;\n $new_conn->departure_time = $request->{'down_departure_' . $flight};\n $new_conn->arrival_time = $request->{'down_arrival_' . $flight};\n $new_conn->type = 2;\n $new_conn->save();\n }\n $departure_flight_down = flight_schedule_connection::where([['type', 2], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'asc')->get()->first();\n $arrival_flight_down = flight_schedule_connection::where([['type', 2], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'desc')->get()->first();\n $flight_schedule->down_departure_time = $departure_flight_down->departure_time;\n $flight_schedule->down_arrival_time = $arrival_flight_down->arrival_time;\n $flight_schedule->airline_down = $arrival_flight_down->flight->flight_airline;\n $flight_schedule->flight_down = $arrival_flight_down->flight_id;\n }\n $flight_schedule->save();\n set_flash_msg('flash_success', 'Flight Schedule Inserted Successsfully.');\n return redirect('admin/flight-schedule');\n }",
"private function composeTicketCreateForm()\n {\n View::composer(\n\n 'admin.account._create_ticket',\n\n function($view)\n {\n $view->with('ticket_categories', ListHelper::ticket_categories());\n $view->with('priorities', ListHelper::ticket_priorities());\n }\n );\n }",
"public function update(Request $request,$id)\n {\n $ticket=Ticket::find($id);\n $ticket->title=$request->input('title');\n $ticket->priority=$request->input('priority');\n $ticket->status=$request->input('status');\n $ticket->severity=$request->input('severity');\n $ticket->ticket_num=$request->input('ticket_num');\n $ticket->description=$request->input('description');\n //Get the real time\n //$ticket->create_time=$request->input(create_time);\n //$ticket->modified_time=$request->input(modified_time);\n // $ticket->assign_to=$request->input(assign_to);\n //Update\n //假装有\n $ticket->update=\"\";\n //这样写行不行\n //$lead->update=\"创建票务 \".$request->input(title).\" 于 \".$ticket->create_time;\n\n $organization_name=$request->input('organization_name');\n $contact_name=$request->input('contact_name');\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $contactId=DB::table('contacts')->where('full_name',$contact_name)\n ->value('id');\n\n //If the organization doesn't exist\n if($organizationId=='') {\n //Create a new organization\n $organization=new Organization;\n $organization->organization_name=$request->input('organization_name');\n $organization->assign_to=Auth::id();\n $organization->city=\"\";\n $organization->website=\"\";\n $organization->phone=\"\";\n $organization->update=\"\";\n $organization->save();\n\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $ticket->organization_id=$organizationId;\n }\n //If the organization exists\n else{\n $ticket->organization_id=$organizationId;\n }\n\n //If the organization doesn't exist\n if($contactId=='') {\n //Create a new contact\n $contact=new Contact;\n $contact->assign_to=Auth::id();\n $contact->first_name=\"\";\n $contact->last_name=\"\";\n $contact->full_name=$request->input('contact_name');\n $contact->title=\"\";\n $contact->organization_id=\"\";\n $contact->email=\"\";\n $contact->update=\"\";\n $contact->save();\n\n $contactId=DB::table('contacts')->where('contact_name',$contact_name)\n ->value('id');\n $ticket->contact_id=$contactId;\n }\n //If the organization exists\n else{\n $ticket->contact_id=$contactId;\n }\n\n if($ticket->save())\n { return Redirect::to('ticket/list'); }\n else\n { return Redirect::back()->withInput()->withErrors('保存失败!'); }\n }",
"public function store(AirlineRequest $request)\n {\n $request['user_id']=Auth::user()->id;\n $request['status']=\"Incomplete\";\n $t=DB::table('visas')->where('user_id','=',Auth::user()->id)->where('status','=','incomplete')->first();\n if($t==null){\n if(Ticket::create($request->all()))\n {\n return redirect('/ticketTripDetailIndex');\n }\n else\n {\n return \"Data Not Saving\";\n }\n\n }\n return redirect('/ticketTripDetailIndex');\n }",
"public function store(TicketFormRequest $request)\n {\n $data = $request->all();\n $data['opened_at'] = \\Carbon\\Carbon::now()->toDateTimeString();\n $data['user_id'] = auth()->user()->id;\n\n // dd($data);\n $ticket = Ticket::create($data);\n return redirect()->route('tickets.index')->with('success','Chamado criado com sucesso!');\n }",
"public function store(Request $request)\n {\n $ticket=new Ticket;\n $ticket->title=$request->input('title');\n $ticket->priority=$request->input('priority');\n $ticket->status=$request->input('status');\n $ticket->severity=$request->input('severity');\n $ticket->ticket_num=$request->input('ticket_num');\n $ticket->description=$request->input('description');\n //Get the real time\n //$ticket->create_time=$request->input(create_time);\n //$ticket->modified_time=$request->input(modified_time);\n $ticket->assign_to=Auth::id();\n //Update\n //假装有\n $ticket->update=\"\";\n //这样写行不行\n //$lead->update=\"创建票务 \".$request->input(title).\" 于 \".$ticket->create_time;\n\n $organization_name=$request->input('organization_name');\n $contact_name=$request->input('contact_name');\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $contactId=DB::table('contacts')->where('full_name',$contact_name)\n ->value('id');\n\n //If the organization doesn't exist\n if($organizationId=='') {\n //Create a new organization\n $organization=new Organization;\n $organization->organization_name=$request->input('organization_name');\n $organization->assign_to=Auth::id();\n $organization->city=\"\";\n $organization->website=\"\";\n $organization->phone=\"\";\n $organization->update=\"\";\n $organization->save();\n\n $organizationId=DB::table('organizations')->where('organization_name',$organization_name)\n ->value('id');\n $ticket->organization_id=$organizationId;\n }\n //If the organization exists\n else{\n $ticket->organization_id=$organizationId;\n }\n\n //If the organization doesn't exist\n if($contactId=='') {\n //Create a new contact\n $contact=new Contact;\n $contact->assign_to=Auth::id();\n $contact->first_name=\"\";\n $contact->last_name=\"\";\n $contact->full_name=$request->input('contact_name');\n $contact->title=\"\";\n $contact->organization_id=\"\";\n $contact->email=\"\";\n $contact->update=\"\";\n $contact->save();\n\n $contactId=DB::table('contacts')->where('contact_name',$contact_name)\n ->value('id');\n $ticket->contact_id=$contactId;\n }\n //If the organization exists\n else{\n $ticket->contact_id=$contactId;\n }\n\n if($ticket->save())\n { return Redirect::to('ticket/list'); }\n else\n { return Redirect::back()->withInput()->withErrors('保存失败!'); }\n }",
"public function bookFlightForMatch($match_id, Request $request) {\n $response['status'] = \"error\";\n $response['message'] = \"There Should select departure and return flights\";\n $rules = [\n \"dept_flight\" => \"required\",\n \"return_flight\" => \"required\"\n ];\n $validate = Validator::make($request->all(), $rules);\n if($validate->valid()) {\n $flight_array = [\n \"name\" => \"Flight Ticket\",\n \"dept_flight\" => $request->input(\"dept_flight\"),\n \"return_flight\" => $request->input(\"return_flight\"),\n ];\n $request->session()->set(\"cart_flight\", $flight_array);\n $out = Flight::findOrFail($request->input(\"dept_flight\"));\n $return = Flight::findOrFail($request->input(\"return_flight\"));\n $date1 = new DateTime($return->departure_date);\n $date2 = new DateTime($out->arrive_date);\n $interval = $date1->diff($date2);\n// $days_book = $interval->d + 1;\n $days_book = $interval->d; // Booking days is equal to the difference of flight dates\n $hotel = $request->session()->get(\"cart_room\");\n $hotel['room_days'] = $days_book;\n $request->session()->set(\"cart_room\", $hotel);\n $response['status'] = \"success\";\n $response['nextpage'] = url(\"match/\".$match_id.\"/accomodation\");\n if($request->input(\"edit\") == \"yes\") {\n $response['nextpage'] = url(\"cart/summary\");\n }\n }\n return response()->json($response);\n }",
"public function newTicket(Request $request, $id)\r\n {\r\n// $data = Records::getRecord($id);\r\n// Exchange1C::netTicket($data);\r\n Exchange1C::updateNewTickets();\r\n }",
"public function store(Request $request)\n {\n $common_data = $this->validation_common($request);\n extract($common_data);\n\n DB::beginTransaction();\n $ticket = new Ticket();\n\n $ticket->subject = $request->subject;\n $ticket->creator_id = $this->member->id;\n $ticket->user_id = $request->owner_id;\n\n if ($permission_level > 1) {\n $ticket->hidden = $request->hidden;\n\n if ($request->complete == 'yes') {\n $ticket->completed_at = Carbon::now();\n }\n\n $ticket->status_id = $request->status_id;\n $ticket->priority_id = $request->priority_id;\n } else {\n $ticket->status_id = Setting::grab('default_status_id');\n $default_priority_id = Setting::grab('default_priority_id');\n $ticket->priority_id = $default_priority_id == 0 ? Models\\Priority::first()->id : $default_priority_id;\n }\n\n if ($request->start_date != '') {\n $ticket->start_date = date('Y-m-d H:i:s', strtotime($request->start_date));\n } else {\n $ticket->start_date = Carbon::now();\n }\n if ($request->limit_date == '') {\n $ticket->limit_date = null;\n } else {\n $ticket->limit_date = date('Y-m-d H:i:s', strtotime($request->limit_date));\n }\n\n $ticket->category_id = $request->category_id;\n\n if ($permission_level == 1 or $request->input('agent_id') == 'auto') {\n $ticket->autoSelectAgent();\n } else {\n $ticket->agent_id = $request->input('agent_id');\n }\n\n $ticket->content = $a_content['content'];\n $ticket->html = $a_content['html'];\n\n if ($permission_level > 1) {\n $ticket->intervention = $a_intervention['intervention'];\n $ticket->intervention_html = $a_intervention['intervention_html'];\n }\n\n if ($ticket->agent_id != $this->member->id) {\n // Ticket will be unread for assigned agent\n $ticket->read_by_agent = 0;\n }\n\n $ticket->save();\n\n if (Setting::grab('ticket_attachments_feature')) {\n // Create attachments from embedded images\n $this->embedded_images_to_attachments($permission_level, $ticket);\n\n // Attached files\n $a_result_errors = $this->saveAttachments(compact('request', 'a_result_errors', 'ticket'));\n }\n\n // Embedded Comments\n list($a_new_comments, $a_result_errors) = $this->add_embedded_comments($permission_level, $request, $ticket, $a_result_errors);\n\n // If errors present\n if ($a_result_errors) {\n return response()->json(array_merge(\n ['result' => 'error'],\n $a_result_errors\n ));\n }\n\n // End transaction\n DB::commit();\n\n // Ticket event\n event(new TicketCreated($ticket));\n\n // Comment events\n if ($a_new_comments) {\n foreach ($a_new_comments as $comment) {\n event(new CommentCreated($comment, $request));\n }\n }\n\n $this->sync_ticket_tags($request, $ticket);\n\n session()->flash('status', trans('panichd::lang.the-ticket-has-been-created', [\n 'name' => '#'.$ticket->id.' '.$ticket->subject,\n 'link' => route(Setting::grab('main_route').'.show', $ticket->id),\n 'title' => trans('panichd::lang.ticket-status-link-title'),\n ]));\n\n return response()->json([\n 'result' => 'ok',\n 'url' => action('\\PanicHD\\PanicHD\\Controllers\\TicketsController@index'),\n ]);\n }",
"public function update(Request $request, Ticket $ticket)\n {\n $validator = Validator::make($request->all(), [\n 'event_id' => 'required',\n 'amount' => 'required',\n 'available_from' => 'required',\n 'available_to' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect('ticket/'.$ticket->id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = [\n 'event_id' => $request->event_id,\n 'amount' => $request->amount,\n 'available_from' =>$request->available_from,\n 'available_to' => $request->available_to,\n\n ];\n if($request->member_price){\n $data['member_price'] = $request->member_price;\n }\n if($request->nonmember_adult){\n $data['nonmember_adult'] = $request->nonmember_adult;\n }\n if($request->nonmember_kid){\n $data['nonmember_kid'] = $request->nonmember_kid;\n }\n\n $ticket->update($data);\n\n\n return redirect('tickets')->with('message','Ticket update');\n\n }",
"public function update(Request $request, $id)\n {\n $flight_schedule = flight_schedule::find($id);\n $messages = [];\n if (!empty($request->flight_up) && ($request->flight_type_up == 2)) {\n foreach ($request->flight_up as $flight) {\n $messages['up_departure_' . $flight . '.required'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.date_format'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.date'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.after'] = 'Please enter valid Departure Time';\n $messages['up_departure_' . $flight . '.before'] = 'Please enter valid Departure Time';\n\n $messages['up_arrival_' . $flight . '.required'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.date_format'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.date'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.after'] = 'Please enter valid Arrival Time';\n $messages['up_arrival_' . $flight . '.before'] = 'Please enter valid Arrival Time';\n }\n }\n if (!empty($request->flight_down) && ($request->flight_type_down == 2)) {\n foreach ($request->flight_down as $flight) {\n $messages['down_departure_' . $flight . '.required'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.date_format'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.date'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.after'] = 'Please enter valid Departure Time';\n $messages['down_departure_' . $flight . '.before'] = 'Please enter valid Departure Time';\n\n $messages['down_arrival_' . $flight . '.required'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.date_format'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.date'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.after'] = 'Please enter valid Arrival Time';\n $messages['down_arrival_' . $flight . '.before'] = 'Please enter valid Arrival Time';\n }\n }\n $valid_array = array(\n 'flight_sche_title' => 'required',\n 'airline_up' => 'required',\n 'flight_up' => 'required',\n 'flight_profit' => 'required|numeric',\n 'price_per_person' => 'required|numeric',\n 'flight_profit' => 'required|numeric',\n 'profit_curr' => 'required|numeric|digits_between:1,4',\n 'flight_type_up' => 'required|numeric|digits_between:1,2',\n 'flight_type_down' => 'required|numeric|digits_between:1,2',\n );\n if ($request->flight_type_up == 1) {\n $valid_array['up_departure_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:up_arrival_time';\n $valid_array['up_arrival_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:up_departure_time';\n }\n if ($request->flight_type_down == 1) {\n $valid_array['down_departure_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:down_arrival_time';\n $valid_array['down_arrival_time'] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:down_departure_time';\n }\n if (($request->flight_type_up == 2) && (!empty($request->flight_up))) {\n foreach ($request->flight_up as $flight) {\n $valid_array['up_departure_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:up_arrival_' . $flight;\n $valid_array['up_arrival_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:up_departure_' . $flight;\n }\n }\n if (($request->flight_type_down == 2) && (!empty($request->flight_down))) {\n foreach ($request->flight_down as $flight) {\n $valid_array['down_departure_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|before:down_arrival_' . $flight;\n $valid_array['down_arrival_' . $flight] = 'required|date|date_format:Y-m-d H:i:s|after:yesterday|after:down_departure_' . $flight;\n }\n }\n $this->validate($request, $valid_array, $messages);\n $flight_schedule->flight_sche_title = $request->flight_sche_title;\n $flight_schedule->price_per_person = $request->price_per_person;\n $flight_schedule->price_curr = $request->price_curr;\n $flight_schedule->profit_type = $request->profit_type;\n $flight_schedule->flight_profit = $request->flight_profit;\n $flight_schedule->package_profit = $request->package_profit;\n $flight_schedule->profit_curr = $request->profit_curr;\n $flight_schedule->flight_pnr_no = $request->flight_pnr_no;\n $flight_schedule->flight_type_up = $request->flight_type_up;\n $flight_schedule->flight_type_down = $request->flight_type_down;\n $flight_schedule->num_available_seat = $request->num_available_seat;\n $flight_schedule->num_total_seat = $request->num_total_seat;\n $flight_schedule->flight_incr_price_str = $request->flight_incr_price_str;\n $flight_schedule->price_incr_90 = $request->price_incr_90;\n $flight_schedule->price_incr_80 = $request->price_incr_80;\n $flight_schedule->price_incr_70 = $request->price_incr_70;\n $flight_schedule->price_incr_60 = $request->price_incr_60;\n $flight_schedule->price_incr_50 = $request->price_incr_50;\n $flight_schedule->price_incr_40 = $request->price_incr_40;\n $flight_schedule->price_incr_30 = $request->price_incr_30;\n $flight_schedule->price_incr_20 = $request->price_incr_20;\n $flight_schedule->price_incr_10 = $request->price_incr_10;\n $flight_schedule->flight_sche_desc = $request->flight_sche_desc;\n $flight_schedule->flight_sche_status = $request->flight_sche_status;\n if ($request->flight_type_up == 1) {\n $flight_schedule->airline_up = $request->airline_up;\n $flight_schedule->flight_up = $request->flight_up;\n $flight_schedule->up_departure_time = $request->up_departure_time;\n $flight_schedule->up_arrival_time = $request->up_arrival_time;\n }\n if ($request->flight_type_down == 1) {\n $flight_schedule->airline_down = $request->airline_down;\n $flight_schedule->flight_down = $request->flight_down;\n $flight_schedule->down_departure_time = $request->down_departure_time;\n $flight_schedule->down_arrival_time = $request->down_arrival_time;\n\n }\n $flight_schedule->save();\n // Update the relevants packages\n // ===============================\n $this->updatePackagesProfit($flight_schedule);\n //================================\n if (($request->flight_type_up == 2) || ($request->flight_type_down == 2)) {\n $new_conn = flight_schedule_connection::where([['flight_schedule_id', $flight_schedule->id]]);\n $new_conn->delete();\n }\n if ($request->flight_type_up == 2) {\n $flight_schedule->multi_airline_up = serialize($request->airline_up);\n $flight_schedule->multi_flight_up = serialize($request->flight_up);\n foreach ($request->flight_up as $flight) {\n $new_conn = new flight_schedule_connection;\n $new_conn->flight_id = $flight;\n $new_conn->flight_schedule_id = $flight_schedule->id;\n $new_conn->departure_time = $request->{'up_departure_' . $flight};\n $new_conn->arrival_time = $request->{'up_arrival_' . $flight};\n $new_conn->type = 1;\n $new_conn->save();\n }\n $departure_flight = flight_schedule_connection::where([['type', 1], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'asc')->get()->first();\n $arrival_flight = flight_schedule_connection::where([['type', 1], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'desc')->get()->first();\n $flight_schedule->up_departure_time = $departure_flight->departure_time;\n $flight_schedule->up_arrival_time = $arrival_flight->arrival_time;\n $flight_schedule->airline_up = $departure_flight->flight->flight_airline;\n $flight_schedule->flight_up = $departure_flight->flight_id;\n }\n if ($request->flight_type_down == 2) {\n $flight_schedule->multi_airline_down = serialize($request->airline_down);\n $flight_schedule->multi_flight_down = serialize($request->flight_down);\n foreach ($request->flight_down as $flight) {\n $new_conn = new flight_schedule_connection;\n $new_conn->flight_id = $flight;\n $new_conn->flight_schedule_id = $flight_schedule->id;\n $new_conn->departure_time = $request->{'down_departure_' . $flight};\n $new_conn->arrival_time = $request->{'down_arrival_' . $flight};\n $new_conn->type = 2;\n $new_conn->save();\n }\n $departure_flight = flight_schedule_connection::where([['type', 2], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'asc')->get()->first();\n $arrival_flight = flight_schedule_connection::where([['type', 2], ['flight_schedule_id', $flight_schedule->id]])->orderBy('departure_time', 'desc')->get()->first();\n $flight_schedule->down_departure_time = $departure_flight->departure_time;\n $flight_schedule->down_arrival_time = $arrival_flight->arrival_time;\n $flight_schedule->airline_down = $departure_flight->flight->flight_airline;\n $flight_schedule->flight_down = $arrival_flight->flight_id;\n }\n $flight_schedule->save();\n set_flash_msg('flash_success', 'Flight Schedule Updated Successsfully.');\n return redirect('admin/flight-schedule');\n }",
"public function run()\n {\n $oFlight = new Flight;\n //$oFlight->id = 1;\n $oFlight->airline = 'Tame';\n $oFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Lima';\n $oTicketFlight->destination_city = 'Cali';\n $oTicketFlight->date_flight = '2021-07-01 10:00:00';\n $oTicketFlight->return_date = '2021-07-05 21:00:00';\n $oTicketFlight->scalas_number = 2;\n $oTicketFlight->flight_duration = 5;\n $oTicketFlight->price = 149.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Quito';\n $oTicketFlight->destination_city = 'Guayaquil';\n $oTicketFlight->date_flight = '2021-06-22 09:00:00';\n $oTicketFlight->return_date = '2021-06-30 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 50.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n \n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Guayaquil';\n $oTicketFlight->destination_city = 'Cuenca';\n $oTicketFlight->date_flight = '2021-08-13 13:30:00';\n $oTicketFlight->return_date = '2021-08-18 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 50.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n\n $oFlight = new Flight;\n //$oFlight->id = 2;\n $oFlight->airline = 'LAN';\n $oFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Lima';\n $oTicketFlight->destination_city = 'Cali';\n $oTicketFlight->date_flight = '2021-07-01 10:00:00';\n $oTicketFlight->return_date = '2021-07-05 21:00:00';\n $oTicketFlight->scalas_number = 5;\n $oTicketFlight->flight_duration = 8;\n $oTicketFlight->price = 110.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Quito';\n $oTicketFlight->destination_city = 'Guayaquil';\n $oTicketFlight->date_flight = '2021-06-22 09:00:00';\n $oTicketFlight->return_date = '2021-06-30 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 50.00;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n \n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Guayaquil';\n $oTicketFlight->destination_city = 'Cuenca';\n $oTicketFlight->date_flight = '2021-08-13 13:30:00';\n $oTicketFlight->return_date = '2021-08-18 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 50.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n\n $oFlight = new Flight;\n //$oFlight->id = 3;\n $oFlight->airline = 'LATAM';\n $oFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Lima';\n $oTicketFlight->destination_city = 'Cali';\n $oTicketFlight->date_flight = '2021-07-01 10:00:00';\n $oTicketFlight->return_date = '2021-07-05 21:00:00';\n $oTicketFlight->scalas_number = 1;\n $oTicketFlight->flight_duration = 3;\n $oTicketFlight->price = 340.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n\n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Quito';\n $oTicketFlight->destination_city = 'Guayaquil';\n $oTicketFlight->date_flight = '2021-06-22 09:00:00';\n $oTicketFlight->return_date = '2021-06-30 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 60.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n \n $oTicketFlight = new TicketsFlight;\n $oTicketFlight->city_origin = 'Guayaquil';\n $oTicketFlight->destination_city = 'Cuenca';\n $oTicketFlight->date_flight = '2021-08-13 13:30:00';\n $oTicketFlight->return_date = '2021-08-18 09:00:00';\n $oTicketFlight->scalas_number = 0;\n $oTicketFlight->flight_duration = 1;\n $oTicketFlight->price = 54.99;\n $oTicketFlight->flight_id = $oFlight->id;\n $oTicketFlight->save();\n }",
"public function add(Request $request)\n {\n if(isSpam($request, \"addTicketSpam\")){\n return redirect()->back()->withErrors([\"spam\" => \"you will have to wait 10s to add new ticket\"]);\n die();\n }\n\n $this->validate($request, [\n 'description' => 'required|string|max:255',\n 'amount' => 'numeric|required|regex:/^\\d*(\\.\\d{1,2})?$/|min:0|max:1000000000',\n 'quantity_initial' => 'numeric|required|min:0|max:100000',\n 'quantity_left' => 'numeric|required|min:0|max:100000',\n ], ['regex' => 'The :attribute is currency therefore has to be formatted : x.xx or x.x or x ',\n ]\n );\n\n\n $concert_id = $request->session()->get(\"concertId\");\n $description = $request->input('description', '');\n $amount = $request->input('amount', '');\n $quantity_initial = $request->input('quantity_initial', '');\n $quantity_left = $request->input('quantity_left', '');\n $ticket = new Ticket();\n\n\n\n $ticket->concert_id = $concert_id;\n $ticket->description = $description;\n $ticket->amount = $amount;\n $ticket->quantity_initial = $quantity_initial;\n $ticket->quantity_left = $quantity_left;\n\n $ticket->save();\n\n return redirect()->route(\"manageTicketPanel\");\n }",
"public function fields(Request $request)\n {\n return [\n ID::make(__('ID'), 'id')->sortable(),\n\n DateTime::make(__('Departure time'), 'flight_datetime')\n ->sortable(),\n\n Number::make(__('Duration in minutes'), 'duration')\n ->sortable()\n ->rules('required|numeric|min:1'),\n\n Textarea::make(__('Description'), 'description'),\n\n $this->getApproveStatusField(__('Approval status'), 'approve_status'),\n $this->getFlightStatusField(__('Flight status'), 'flight_status'),\n\n BelongsTo::make(__('Administrator'), 'administrator', Administrator::class)\n ->readonly(),\n BelongsTo::make(__('Departure from'), 'airportDepart', Airport::class),\n BelongsTo::make(__('Arrives to'), 'airportArrival', Airport::class),\n\n HasMany::make(__('Status history'), 'approveStatusChanges', FlightApproveStatusChange::class)\n ->readonly(),\n\n HasMany::make(__('Events'), 'events', FlightApproveStatusChange::class)\n ->readonly(),\n HasMany::make(__('Ticket Types'), 'ticketTypes', FlightTicketType::class),\n ];\n }",
"public function save(Request $request)\r\n {\r\n\r\n $user_id = session(\"ID\");\r\n $group_id = session(\"group_id\");\r\n $group_name = session(\"group_name\");\r\n $status_default = session(\"StatusDefault\");\r\n\r\n $validation = Validator::make($request->all(), $this->validation_create_ticket);\r\n\r\n if ($validation->fails()) {\r\n return response()->json([\r\n 'error' => $validation->errors()->first()\r\n ]);\r\n }\r\n\r\n $date_issue = Carbon::createFromFormat(\"d/m/Y h:i:s A\", $request->issue_date)->format(\"d-M-Y h:i:s A\");\r\n $date_expired = Carbon::createFromFormat(\"d/m/Y h:i:s A\", $request->expired_date)->format(\"d-M-Y h:i:s A\");\r\n\r\n $status = 0;\r\n $IsOnlyMoney = 0;\r\n\r\n $count_credit = count($request->credit_note);\r\n $diesel_return_amount = 0;\r\n\r\n //check credit is available\r\n if ($count_credit > 0) {\r\n $get_credit = $this->call_api_by_parameter(\"webGetCreditNoteFilterByID\", [\"UserID\" => $user_id, \"CreditID\" => $request->credit_note]);\r\n if ($get_credit) {\r\n $decode_credit = json_decode($get_credit);\r\n if ($decode_credit->id) {\r\n\r\n $credit_id = \"\";\r\n $count_credit_data = count($decode_credit->data);\r\n $k = 0;\r\n\r\n foreach ($decode_credit->data as $data_credit) {\r\n $k++;\r\n $coma = \",\";\r\n if ($count_credit_data == $k) {\r\n $coma = \"\";\r\n }\r\n\r\n $credit_id .= $data_credit->ID . $coma;\r\n $diesel_return_amount += $data_credit->Amount;\r\n }\r\n }\r\n }\r\n }\r\n\r\n //start ticket\r\n $data = array(\r\n \"IssueDateTime\" => $date_issue,\r\n \"ExpireDateTime\" => $date_expired,\r\n \"UserID\" => $user_id,\r\n \"StationID\" => \"\",\r\n \"TrailerID\" => $request->trailer,\r\n \"FleetID\" => $request->truck_number,\r\n \"DriverID\" => $request->driver,\r\n \"TotalAmountFuel\" => ($diesel_return_amount > 0 ? (($request->total_all_amount_original) + ((-1) * $diesel_return_amount)) : $request->total_all_amount_original),\r\n \"TotalPayTripAmount\" => $request->total_amount_pay_trip,\r\n \"LoloAmount\" => $request->total_amount_mtpickup,\r\n \"Status\" => $status\r\n );\r\n\r\n $call_ticket = $this->call_api_by_parameter(\"webAddTicket\", $data);\r\n\r\n if ($call_ticket) {\r\n\r\n $encode_ticket = json_decode($call_ticket);\r\n\r\n if ($encode_ticket->id) {\r\n\r\n $ticket_id = $encode_ticket->data[0]->ID;\r\n\r\n if ($status_default == 0) {\r\n\r\n $ticket_number = $encode_ticket->data[0]->TicketNumber;\r\n } else {\r\n $ticket_number = $group_name . $encode_ticket->data[0]->TicketNumber;\r\n }\r\n\r\n $count_destination = count($request->destination);\r\n\r\n $container1_id = 0;\r\n $container2_id = 0;\r\n $customer_id = 0;\r\n $amount_paytrip = 0;\r\n $amount_mt = 0;\r\n $amount_fuel = 0;\r\n $count_con1 = 0;\r\n $count_con2 = 0;\r\n\r\n for ($i = 0; $i < $count_destination; $i++) {\r\n\r\n if ($request->destination[$i] != \"\") {\r\n\r\n if ($i === 0) {\r\n $status_detail = 0;\r\n } else {\r\n $status_detail = 1;\r\n }\r\n\r\n if ($request->lolo[$i] != \"\") {\r\n $amount_mt += $request->lolo[$i];\r\n }\r\n\r\n if (($request->container1[$i] != \"\") && ($request->container1[$i] != \"28257\")) {\r\n $count_con1++;\r\n }\r\n\r\n if (($request->container2[$i] != \"\") && ($request->container2[$i] != \"28257\")) {\r\n $count_con2++;\r\n }\r\n\r\n $amount_paytrip += $request->total_amount_paytrip[$i];\r\n $amount_fuel += $request->total_amount[$i];\r\n\r\n //get customer id\r\n $get_customer_id = $this->call_api_by_parameter(\"webGetCustomerID\",\r\n [\r\n \"CustomerName\" => $request->customer[$i],\r\n \"UserID\" => $user_id,\r\n \"GroupID\" => $group_id\r\n ]\r\n );\r\n\r\n $decode_customer = json_decode($get_customer_id);\r\n\r\n if ($decode_customer->id) {\r\n $customer_id = $decode_customer->data[0]->ID;\r\n }\r\n\r\n //get container id 1\r\n $check_container1 = $this->call_api_by_parameter(\"webGetContainerID\",\r\n [\r\n \"ContainerNumber\" => $request->container1[$i],\r\n \"Feet\" => $request->feet1[$i],\r\n \"UserID\" => $user_id,\r\n \"GroupID\" => $group_id\r\n ]);\r\n\r\n $decode_insert1 = json_decode($check_container1);\r\n\r\n if ($decode_insert1->id) {\r\n $container1_id = $decode_insert1->data[0]->ID;\r\n }\r\n\r\n //get container id 2\r\n $check_container2 = $this->call_api_by_parameter(\"webGetContainerID\",\r\n [\r\n \"ContainerNumber\" => $request->container2[$i],\r\n \"Feet\" => $request->feet2[$i],\r\n \"UserID\" => $user_id,\r\n \"GroupID\" => $group_id\r\n ]);\r\n\r\n $decode_insert2 = json_decode($check_container2);\r\n\r\n if ($decode_insert2->id) {\r\n $container2_id = $decode_insert2->data[0]->ID;\r\n }\r\n\r\n $parms_detail = [\r\n \"TicketID\" => $ticket_id,\r\n \"CustomerID\" => $customer_id,\r\n \"Container1ID\" => $container1_id,\r\n \"Container2ID\" => $container2_id,\r\n \"ReasonID\" => $request->reason[$i],\r\n \"DestinationID\" => $request->destination[$i],\r\n \"Fuel\" => $request->fuel[$i],\r\n \"FuelAdd\" => $request->add_more[$i],\r\n \"DieselReturnAmount\" => $request->diesel_return_amount[$i],\r\n \"TotalFuel\" => $request->total_amount[$i],\r\n \"Note\" => $request->note[$i],\r\n \"StatusNote\" => $status_detail,\r\n \"AdvancePayID\" => $request->mtpickup[$i],\r\n \"PayTripID\" => $request->paytrip_id[$i],\r\n \"PayTrip\" => $request->paytrip[$i],\r\n \"PayTripAdd\" => $request->add_cut_paytrip[$i],\r\n \"PayTripNote\" => $request->note_paytrip[$i],\r\n \"TotalPayTrip\" => $request->total_amount_paytrip[$i],\r\n \"Version\" => \"V0\",\r\n \"TeamLeader\" => $request->team_leader[$i],\r\n \"ReferenceNumber\" => $request->reference_number[$i],\r\n \"LoloAmount\" => $request->lolo[$i],\r\n \"MTPickUp\" => $request->mtpickup_name[$i],\r\n ];\r\n\r\n $this->call_api_by_parameter(\"webUpdateFleetAvailable\", [\"ReasonID\" => $request->destination[$i], \"FleetID\" => $request->truck_number]);\r\n\r\n $call_ticket_detail = $this->call_api_by_parameter(\"webAddTicketDetail\", $parms_detail);\r\n\r\n }\r\n }\r\n\r\n\r\n if (($amount_mt > 0) && (($count_con1 <= 0) && ($count_con2 <= 0))) {\r\n $status = 5;\r\n } else if (($amount_mt > 0) && (($count_con1 > 0) || ($count_con2 > 0))) {\r\n $status = 0;\r\n } else if (($amount_mt > 0) && (($count_con1 > 0) || ($count_con2 >= 0))) {\r\n $status = 0;\r\n } else if (($amount_mt > 0) && (($count_con1 >= 0) || ($count_con2 > 0))) {\r\n $status = 0;\r\n } else if (($amount_mt == 0) && ($amount_fuel == 0) && ($amount_paytrip > 0)) {\r\n $status = 1;\r\n $IsOnlyMoney = 1;\r\n }\r\n\r\n $this->call_api_by_parameter(\"webUpdateTicketNumber\",\r\n [\r\n \"TicketNumber\" => $ticket_number,\r\n \"TicketID\" => $ticket_id,\r\n \"Status\" => $status,\r\n \"IsOnlyMoney\" => $IsOnlyMoney,\r\n \"AmountLolo\" => ((-1) * $amount_mt),\r\n \"AmountPayTrip\" => ((-1) * $amount_paytrip),\r\n \"UserID\" => $user_id\r\n ]\r\n );\r\n\r\n $get_ticket_de = $this->call_api_by_parameter(\"webGetTicketDetail\", [\"TicketID\" => $ticket_id]);\r\n\r\n if ($count_credit > 0) {\r\n $update_credit = $this->call_api_by_parameter(\"webUpdateCreditNote\", [\"ID\" => $credit_id, \"TicketID\" => $ticket_id]);\r\n }\r\n\r\n if ($get_ticket_de) {\r\n\r\n $encode_detail = json_decode($get_ticket_de);\r\n\r\n if ($encode_detail->id) {\r\n\r\n $data['data'] = $encode_detail->data;\r\n $data['barcode'] = $encode_detail->data[0]->Barcode;\r\n $data['img'] = DNS1D::getBarcodePNG($encode_detail->data[0]->Barcode, 'C39');\r\n\r\n $label = view('pages.backend.ticket.print_new', compact('data'))->render();\r\n\r\n return response()->json([\r\n 'error' => 0,\r\n 'Label' => $label\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'error' => \"something wrong with your data.\"\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'error' => 'You are losing your connection. Please check your connection'\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'error' => \"something wrong with your data.\"\r\n ]);\r\n }\r\n\r\n return response()->json([\r\n 'error' => 'You are losing your connection. Please check your connection'\r\n ]);\r\n }",
"public function reservationAction()\n {\n // specify required fields\n $requirements = array(\n array('name' => 'title', 'required' => true, 'type' => 'integer'),\n array('name' => 'firstName', 'required' => true, 'type' => 'string'),\n array('name' => 'lastName', 'required' => true, 'type' => 'string'),\n array('name' => 'email', 'required' => true, 'type' => 'string', 'constraints' => array('email' => 1)),\n array('name' => 'country', 'required' => true, 'type' => 'string'),\n array('name' => 'mobileCountryCode', 'required' => true, 'type' => 'string'),\n //array('name' => 'mobile', 'required' => true, 'type' => 'string'),\n array('name' => 'guestFirstName', 'required' => true, 'type' => 'array'),\n array('name' => 'guestLastName', 'required' => true, 'type' => 'array'),\n array('name' => 'ccType', 'required' => true),\n array('name' => 'ccCardHolder', 'required' => true),\n array('name' => 'ccNumber', 'required' => true),\n array('name' => 'ccExpiryMonth', 'required' => true),\n array('name' => 'ccExpiryYear', 'required' => true),\n array('name' => 'ccCVC', 'required' => true),\n array('name' => 'fromDate', 'required' => true, 'type' => 'string', 'constraints' => array('date' => 1)),\n array('name' => 'toDate', 'required' => true, 'type' => 'string', 'constraints' => array('date' => 1)),\n array('name' => 'hotelDetails', 'required' => true, 'type' => 'array'),\n array('name' => 'selectedOffers', 'required' => true, 'type' => 'array'),\n array('name' => 'transactionId', 'required' => true, 'type' => 'string'),\n );\n\n // fetch post json data\n $requestData = $this->fetchRequestData($requirements);\n\n for ($key = 0; $key < count($requestData['selectedOffers']); $key++) {\n if (!isset($requestData['guestFirstName'][$key]) || empty($requestData['guestFirstName'][$key]) || !isset($requestData['guestLastName'][$key]) || empty($requestData['guestLastName'][$key])) {\n return array(\"code\" => 400, \"message\" => $this->translator->trans(\"Invalid guest params\"));\n }\n }\n\n //prebook\n $prebook = $this->prebook($requestData);\n\n $serviceConfig = $this->getHotelServiceConfig();\n\n $requestData['reference'] = $prebook['reference'];\n $requestData['ccRequired'] = $prebook['ccRequired'];\n $requestData['ccCodeRequired'] = $prebook['ccCodeRequired'];\n $requestData['reservationMode'] = $prebook['reservationMode'];\n $requestData['offersSelectedSerialize'] = json_encode($prebook['selectedOffers']);\n $requestData['transactionSourceId'] = $this->transactionSourceId;\n $requestData['userId'] = $this->userGetID();\n if (isset($requestData['arrivalTime'])) {\n $requestData['arrival_time'] = $requestData['arrivalTime'];\n unset($requestData['arrivalTime']);\n }\n unset($requestData['selectedOffers']);\n\n $hotelBC = $this->get('HRSServices')->getHotelBookingCriteria($requestData);\n\n $toreturn = $this->get('HRSServices')->processHotelReservationRequest($serviceConfig, $hotelBC);\n\n return $toreturn;\n }",
"public function postValidateTickets(Request $request, $event_id)\n {\n /*\n * Order expires after X min\n */\n $order_expires_time = Carbon::now()->addMinutes(config('attendize.checkout_timeout_after'));\n\n $event = Event::findOrFail($event_id);\n\n if (!$request->has('tickets')) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No tickets selected',\n ]);\n }\n\n $ticket_ids = $request->get('tickets');\n\n /*\n * Remove any tickets the user has reserved\n */\n ReservedTickets::where('session_id', '=', session()->getId())->delete();\n\n /*\n * Go though the selected tickets and check if they're available\n * , tot up the price and reserve them to prevent over selling.\n */\n\n $validation_rules = [];\n $validation_messages = [];\n $tickets = [];\n $order_total = 0;\n $total_ticket_quantity = 0;\n $booking_fee = 0;\n $organiser_booking_fee = 0;\n $quantity_available_validation_rules = [];\n\n foreach ($ticket_ids as $ticket_id) {\n $current_ticket_quantity = (int)$request->get('ticket_' . $ticket_id);\n\n if ($current_ticket_quantity < 1) {\n continue;\n }\n\n $total_ticket_quantity = $total_ticket_quantity + $current_ticket_quantity;\n $ticket = Ticket::find($ticket_id);\n $max_per_person = min($ticket->quantity_remaining, $ticket->max_per_person);\n\n $quantity_available_validation_rules['ticket_' . $ticket_id] = [\n 'numeric',\n 'min:' . $ticket->min_per_person,\n 'max:' . $max_per_person\n ];\n\n $quantity_available_validation_messages = [\n 'ticket_' . $ticket_id . '.max' => 'The maximum number of tickets you can register is ' . $max_per_person,\n 'ticket_' . $ticket_id . '.min' => 'You must select at least ' . $ticket->min_per_person . ' tickets.',\n ];\n\n $validator = Validator::make(['ticket_' . $ticket_id => (int)$request->get('ticket_' . $ticket_id)],\n $quantity_available_validation_rules, $quantity_available_validation_messages);\n\n if ($validator->fails()) {\n return response()->json([\n 'status' => 'error',\n 'messages' => $validator->messages()->toArray(),\n ]);\n }\n\n $order_total = $order_total + ($current_ticket_quantity * $ticket->price);\n $booking_fee = $booking_fee + ($current_ticket_quantity * $ticket->booking_fee);\n $organiser_booking_fee = $organiser_booking_fee + ($current_ticket_quantity * $ticket->organiser_booking_fee);\n\n $tickets[] = [\n 'ticket' => $ticket,\n 'qty' => $current_ticket_quantity,\n 'price' => ($current_ticket_quantity * $ticket->price),\n 'booking_fee' => ($current_ticket_quantity * $ticket->booking_fee),\n 'organiser_booking_fee' => ($current_ticket_quantity * $ticket->organiser_booking_fee),\n 'full_price' => $ticket->price + $ticket->total_booking_fee,\n ];\n\n /*\n * Reserve the tickets for X amount of minutes\n */\n $reservedTickets = new ReservedTickets();\n $reservedTickets->ticket_id = $ticket_id;\n $reservedTickets->event_id = $event_id;\n $reservedTickets->quantity_reserved = $current_ticket_quantity;\n $reservedTickets->expires = $order_expires_time;\n $reservedTickets->session_id = session()->getId();\n $reservedTickets->save();\n\n for ($i = 0; $i < $current_ticket_quantity; $i++) {\n /*\n * Create our validation rules here\n */\n $validation_rules['ticket_holder_first_name.' . $i . '.' . $ticket_id] = ['required'];\n $validation_rules['ticket_holder_last_name.' . $i . '.' . $ticket_id] = ['required'];\n $validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['required', 'email'];\n\n $validation_messages['ticket_holder_first_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s first name is required';\n $validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s last name is required';\n $validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\\'s email is required';\n $validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\\'s email appears to be invalid';\n\n /*\n * Validation rules for custom questions\n */\n foreach ($ticket->questions as $question) {\n if ($question->is_required && $question->is_enabled) {\n $validation_rules['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id] = ['required'];\n $validation_messages['ticket_holder_questions.' . $ticket_id . '.' . $i . '.' . $question->id . '.required'] = \"This question is required\";\n }\n }\n }\n }\n\n if (empty($tickets)) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No tickets selected.',\n ]);\n }\n\n $activeAccountPaymentGateway = $event->account->getGateway($event->account->payment_gateway_id);\n //if no payment gateway configured and no offline pay, don't go to the next step and show user error\n if (empty($activeAccountPaymentGateway) && !$event->enable_offline_payments) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'No payment gateway configured',\n ]);\n }\n\n $paymentGateway = $activeAccountPaymentGateway ? $activeAccountPaymentGateway->payment_gateway : false;\n\n /*\n * The 'ticket_order_{event_id}' session stores everything we need to complete the transaction.\n */\n session()->put('ticket_order_' . $event->id, [\n 'validation_rules' => $validation_rules,\n 'validation_messages' => $validation_messages,\n 'event_id' => $event->id,\n 'tickets' => $tickets,\n 'total_ticket_quantity' => $total_ticket_quantity,\n 'order_started' => time(),\n 'expires' => $order_expires_time,\n 'reserved_tickets_id' => $reservedTickets->id,\n 'order_total' => $order_total,\n 'booking_fee' => $booking_fee,\n 'organiser_booking_fee' => $organiser_booking_fee,\n 'total_booking_fee' => $booking_fee + $organiser_booking_fee,\n 'order_requires_payment' => PaymentUtils::requiresPayment($order_total),\n 'account_id' => $event->account->id,\n 'affiliate_referral' => Cookie::get('affiliate_' . $event_id),\n 'account_payment_gateway' => $activeAccountPaymentGateway,\n 'payment_gateway' => $paymentGateway\n ]);\n\n /*\n * If we're this far assume everything is OK and redirect them\n * to the the checkout page.\n */\n if ($request->ajax()) {\n return response()->json([\n 'status' => 'success',\n 'isEmbedded' => $this->is_embedded,\n 'redirectUrl' => route('showEventCheckout', [\n 'event_id' => $event_id,\n ]) . '#order_form',\n ]);\n }\n\n /*\n * Maybe display something prettier than this?\n */\n exit('Please enable Javascript in your browser.');\n }",
"public function addANewFlight(Request $request)\n {\n //Parameters required to add a flight\n $parameters = [\n 'departure' => 'int',\n 'arrival' => 'int',\n 'plane_id' => 'int',\n 'date_departure' => 'timestamp',\n 'date_arrival' => 'timestamp',\n 'airline_id' => 'int'\n ];\n\n $errors = [];\n foreach ($parameters as $key => $value) {\n switch ($value) {\n case \"int\":\n //If the value isn't a number or isn't greater than 0\n if (!is_numeric($request->{$key}) || !$request->{$key} > 0) {\n $errors[] = \"The variable {$key} must be a number and must be greater than 0\";\n }\n break;\n case \"timestamp\":\n //Convert timestamp to date\n $request->{$key} = date('Y-m-d H:i:s', $request->{$key});\n case \"date\":\n //Validating the date\n if (!Flight::validateDate($request->{$key})) {\n $errors[] = \"The variable {$key} does not have a correct date format [{$request->{$key}}]\";\n }\n break;\n default:\n //Check to make sure the value is not null or it will error out\n if (is_null($request->{$key})) {\n $errors[] = \"You can not submit empty value. Make sure you have all the parameter required.\";\n }\n }\n }\n\n $flight = [];\n foreach ($parameters as $key => $value) {\n if ($value == \"int\") {\n $flight[$key] = (int)$request->{$key};\n } else {\n $flight[$key] = $request->{$key};\n }\n\n }\n\n //Making sure there's no error\n if (count($errors) == 0 && Flight::insertFlight($flight)) {\n return ['error' => false, 'message' => 'Your flight have been added!'];\n } else {\n return ['error' => true, 'message' => $errors];\n }\n }",
"public function store(Request $request)\n {\n $booking=new CustomerBookings();\n $booking->customer_name=$request->name;\n $booking->customer_email=$request->email;\n $booking->customer_phone=$request->phonenumber;\n $booking->passport_number=$request->passnumber;\n $booking->address=$request->address;\n $return=Carbon::parse($request->dob);\n $booking->birth_date = date(\"d-m-Y\", strtotime($return));\n function test_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n if (empty($_POST[\"trip\"])) {\n $genderErr = \"trip is required\";\n } else {\n $trip = test_input($_POST[\"trip\"]);\n \n }\n }\n $booking->flight_type= $trip;\n $booking->source=$request->state;\n $booking->destination=$request->city;\n $departure=Carbon::parse($request->deparure);\n $booking->departure_date = date(\"d-m-Y\", strtotime( $departure));\n $departure1=Carbon::parse($request->return1);\n $booking->return_date = date(\"d-m-Y\", strtotime( $departure1));\n $booking->save();\n return view ('thankyou');\n }",
"public function updateFare_details($request){\n\t\t\t$userid =Auth::user()->id;\n\t\t\t$fare = Fare::find($request['fare_id']);\n\t\t\t$fare->car_id = $request['taxt_type'];\n\t\t\t$fare->ride_category = $request['ride_category'];\n\t\t\t$fare->fare_type = $request['fare_type'];\n\t\t\t$fare->ride_each_km=1;\n\t\t\t\n\t\t\tif(isset($request['ride_fare'])) {\t$fare->ride_fare=$request['ride_fare'];}\n\t\t\tif(isset($request['minimum_km'])) {\t$fare->min_km = $request['minimum_km'];}\n\t\t\tif(isset($request['minimum_fare'])) {\t$fare->min_fare_amount = $request['minimum_fare'];}\n\t\t\tif(isset($request['booking_type'])) {\t$fare->booking_type = $request['booking_type'];}\n\t\t\t//if(isset($request['distance_time'])) {\t$fare->distance_time=1;}\n\t\t\tif(isset($request['distance_fare'])) {\t$fare->distance_fare=$request['distance_fare'];}\n\t\t\t//if(isset($request['waiting_time'])) {\t$fare->waiting_time = 1;}\n\t\t\tif(isset($request['waiting_time_fare'])) {$fare->waiting_charge =$request['waiting_time_fare'];}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(isset($request['mstart_time'])) {\t$fare->ride_start_time=date(\"H:i:s\",strtotime($request['mstart_time']));}\n\t\t\tif(isset($request['mend_time'])) { $fare->ride_end_time=date(\"H:i:s\",strtotime($request['mend_time']));}\n\t\t\tif(isset($request['fare_value'])) {\t$fare->fare_percent=$request['fare_value'];}\n\t\t\tif(isset($request['estart_time'])) {\t$fare->nit_start_time=date(\"H:i:s\",strtotime($request['estart_time']));}\n\t\t\tif(isset($request['eend_time'])) {$fare->nit_end_time=date(\"H:i:s\",strtotime($request['eend_time']));}\n\t\t\t\n\t\t\n\t\t\t$fare->updated_by = $userid;\n\t\t\t$fare->updated_date = date(\"Y-m-d H:i:s\"); \n\t\t\t$fare->save();\n\t\t\treturn true;\n\t}",
"public function getFormFields($order)\n {\n\n if (empty($order)) {\n if (!($order = $this->getOrder())) {\n return array();\n }\n }\n\n $send_sms = Mage::getStoreConfig('payment/plationline/send_customer_sms');\n $send_sms = isset($send_sms) ? Mage::getStoreConfig('payment/plationline/send_customer_sms') : 0;\n\n $f_request = array();\n\n $f_request['f_order_number'] = $order->getIncrementId();\n $f_request['f_amount'] = number_format($order->getBaseGrandTotal(), 2, '.', '');\n $f_request['f_currency'] = Mage::app()->getStore()->getBaseCurrencyCode();\n //$f_request['f_auth_minutes'] = 20; // 0 - waiting forever, 20 - default (in minutes)\n $f_request['f_language'] = Mage::getStoreConfig('general/country/default');\n\n $customer_info = array();\n\n $billingAddress = $order->getBillingAddress();\n //contact\n $customer_info['contact']['f_email'] = $order->getCustomerEmail();\n if (strlen($billingAddress->getTelephone()) >= 10) {\n $customer_info['contact']['f_phone'] = $billingAddress->getTelephone();\n $customer_info['contact']['f_mobile_number'] = $billingAddress->getTelephone();\n }\n $customer_info['contact']['f_send_sms'] = $send_sms;\n $customer_info['contact']['f_first_name'] = $billingAddress->getFirstname();\n $customer_info['contact']['f_last_name'] = $billingAddress->getLastname();\n //$customer_info['contact']['f_middle_name'] = '';\n\n $regionModel = Mage::getModel(\"directory/region\")->load($billingAddress->getRegion_id());\n $region = $regionModel->getName();\n //invoice\n if ($billingAddress->getCompany()) {\n $customer_info['invoice']['f_company'] = $billingAddress->getCompany();\n }\n\n //$customer_info['invoice']['f_cui'] = '111111';\n //$customer_info['invoice']['f_reg_com'] = 'J55/99/2000';\n //$customer_info['invoice']['f_cnp'] = '9999999999999';\n $customer_info['invoice']['f_zip'] = $billingAddress->getPostcode();\n $customer_info['invoice']['f_country'] = $billingAddress->getCountry();\n $customer_info['invoice']['f_state'] = $region;\n $customer_info['invoice']['f_city'] = $billingAddress->getCity();\n $customer_info['invoice']['f_address'] = str_replace(\"\\n\", ' ', $billingAddress->getStreet(-1));\n\n $f_request['customer_info'] = $customer_info;\n\n $shipping_info = array();\n\n $shipping_info['same_info_as'] = '1'; // 0 - different info, 1- same info as customer_info\n\n $shipping = $order->getShippingAddress();\n if (isset($shipping) && !empty($shipping)) {\n $shipping_info['same_info_as'] = '0';\n\n $regionModel = Mage::getModel(\"directory/region\")->load($shipping->getRegion_id());\n $region = $regionModel->getName();\n\n //contact\n $shipping_info['contact']['f_email'] = $order->getCustomerEmail();\n if (strlen($shipping->getTelephone()) >= 10) {\n $shipping_info['contact']['f_phone'] = $shipping->getTelephone();\n $shipping_info['contact']['f_mobile_number'] = $shipping->getTelephone();\n }\n $shipping_info['contact']['f_send_sms'] = $send_sms;\n $shipping_info['contact']['f_first_name'] = $shipping->getFirstname();\n $shipping_info['contact']['f_last_name'] = $shipping->getLastname();\n //$shipping_info['contact']['f_middle_name'] = '';\n\n //address\n if ($shipping->getCompany()) {\n $shipping_info['address']['f_company'] = $shipping->getCompany();\n }\n\n $shipping_info['address']['f_zip'] = $shipping->getPostcode();\n $shipping_info['address']['f_country'] = $shipping->getCountry();\n $shipping_info['address']['f_state'] = $region;\n $shipping_info['address']['f_city'] = $shipping->getCity();\n $shipping_info['address']['f_address'] = str_replace(\"\\n\", ' ', $shipping->getStreet(-1));\n }\n\n $f_request['shipping_info'] = $shipping_info;\n $card_holder_info = array();\n $card_holder_info['same_info_as'] = 0; // 0 - different info, 1- same info as customer_info\n $f_request['card_holder_info'] = $card_holder_info;\n\n $transaction_relay_response = array();\n\n $transaction_relay_response['f_relay_response_url'] = Mage::app()->getStore()->getBaseUrl() . \"/plationline/api/postBack\";\n\n $transaction_relay_response['f_relay_method'] = Mage::getStoreConfig('payment/plationline/relay_method'); // PTOR, POST_S2S_PO_PAGE, POST_S2S_MT_PAGE, SOAP_PO_PAGE, SOAP_MT_PAGE\n $transaction_relay_response['f_post_declined'] = 1; // Valoarea = 1 (default value; sistemul PO trimite rezultatul la f_relay_response_url prin metoda f_relay_method) Valoarea = 0 (systemul PO trimite rezultatul doar pentru tranzactiile \"Autorizate\" si \"In curs de verificare\" la <f_relay_response_url> prin metoda <f_relay_method>)\n $transaction_relay_response['f_relay_handshake'] = 1; // default 0\n $f_request['transaction_relay_response'] = $transaction_relay_response;\n\n $f_request['f_order_cart'] = array();\n\n foreach ($order->getAllItems() as $item) {\n if ($item->getParentItem()) {\n continue;\n }\n\n $myitem = array();\n $myitem['prodid'] = $item->getId();\n $myitem['name'] = $item->getName();\n $myitem['description'] = $item->getDescription();\n $myitem['qty'] = $item->getQtyOrdered();\n $myitem['itemprice'] = (float) $item->getPrice();\n $myitem['vat'] = (float) $item->getTaxAmount();\n $myitem['stamp'] = date('Y-m-d');\n $myitem['prodtype_id'] = 0;\n\n $f_request['f_order_cart'][] = $myitem;\n }\n\n $coupon1 = array();\n if (abs($order->getDiscountAmount()) > 0) {\n //coupon 1\n $coupon1['key'] = '0';\n $coupon1['value'] = abs($order->getDiscountAmount());\n $coupon1['percent'] = 0;\n $coupon1['workingname'] = Mage::helper('plationline')->__('Discount');\n $coupon1['type'] = 0;\n $coupon1['scop'] = 1;\n $coupon1['vat'] = 0;\n $f_request['f_order_cart']['coupon1'] = $coupon1;\n }\n\n $coupon2 = array();\n if (abs($order->getGiftCardsAmountUsed()) > 0) {\n //coupon 2\n $coupon2['key'] = '0';\n $coupon2['value'] = abs($order->getGiftCardsAmountUsed());\n $coupon2['percent'] = 0;\n $coupon2['workingname'] = Mage::helper('plationline')->__('Discount');\n $coupon2['type'] = 0;\n $coupon2['scop'] = 1;\n $coupon2['vat'] = 0;\n $f_request['f_order_cart']['coupon2'] = $coupon2;\n }\n\n // declare $f_request['f_order_cart']['coupon1'], $f_request['f_order_cart']['coupon2']; we index the field ['coupon'] to have different names in array and to avoid overwriting the values\n // the array to xml method takes care of this case by looking for \"coupon\" substring\n\n $shipping = array();\n if ($order->getShippingAmount() > 0) {\n //shipping\n $shipping['name'] = Mage::helper('sales')->__('Shipping & Handling');\n $shipping['price'] = number_format($order->getShippingAmount(), 2, '.', '');\n $shipping['pimg'] = 0;\n $shipping['vat'] = number_format($order->getShippingTaxAmount(), 2, '.', '');\n }\n\n $f_request['f_order_cart']['shipping'] = $shipping;\n// $f_request['f_order_string'] = 'test';\n\t$f_request['f_order_string'] = 'Comanda nr. '.$order->getIncrementId().' pe site-ul '.Mage::app()->getStore()->getBaseUrl();\n\n\n $po = new PO5();\n //f_login and RSA key will be saved in config\n $po->f_login = Mage::getStoreConfig('payment/plationline/login_id');\n\n\n// $f_request['f_website'] = $po->f_login;\n\t$f_request['f_website'] = str_replace('www.', '',$_SERVER['SERVER_NAME']);\n\n // RSA Public AUTH [Merchant side]:\n $po->setRSAKeyEncrypt(Mage::getStoreConfig('payment/plationline/rsa_public_auth'));\n\n // IV AUTH:\n $po->setIV(Mage::getStoreConfig('payment/plationline/iv_auth'));\n //end f_login and RSA key will be saved in config\n\n // test mode: 0 - disabled, 1 - enabled\n $po->test_mode = Mage::getStoreConfig('payment/plationline/test_flag');\n\n //plationline autorizare\n $po->auth($f_request, 2);\n }",
"public function update(Request $request, $id)\n {\n $common_data = $this->validation_common($request, false);\n extract($common_data);\n\n $original_ticket = Ticket::findOrFail($id); // Requires a specific object instance\n $ticket = Ticket::findOrFail($id);\n\n DB::beginTransaction();\n\n $ticket->subject = $request->subject;\n $ticket->user_id = $request->owner_id;\n $ticket->hidden = $request->hidden;\n\n $ticket->content = $a_content['content'];\n $ticket->html = $a_content['html'];\n\n if ($this->member->isAgent() or $this->member->isAdmin()) {\n $ticket->intervention = $a_intervention['intervention'];\n $ticket->intervention_html = $a_intervention['intervention_html'];\n }\n\n if ($request->complete == 'yes') {\n $ticket->completed_at = Carbon::now();\n } else {\n $ticket->completed_at = null;\n }\n\n $ticket->status_id = $request->status_id;\n $ticket->category_id = $request->category_id;\n $ticket->priority_id = $request->priority_id;\n\n if ($request->start_date != '') {\n $ticket->start_date = date('Y-m-d H:i:s', strtotime($request->start_date));\n } else {\n $ticket->start_date = $ticket->created_at;\n }\n if ($request->limit_date == '') {\n $ticket->limit_date = null;\n } else {\n $ticket->limit_date = date('Y-m-d H:i:s', strtotime($request->limit_date));\n }\n\n if ($request->input('agent_id') == 'auto') {\n $ticket->autoSelectAgent();\n } else {\n $ticket->agent_id = $request->input('agent_id');\n }\n\n if ($ticket->agent_id != $this->member->id and $ticket->read_by_agent != '2') {\n // Ticket will be unread for assigned agent\n $ticket->read_by_agent = 0;\n }\n\n $ticket->save();\n\n if (Setting::grab('ticket_attachments_feature')) {\n // Create attachments from embedded images\n $this->embedded_images_to_attachments($permission_level, $ticket);\n\n // 1 - update existing attachment fields\n $a_result_errors = $this->updateAttachments($request, $a_result_errors, $ticket->attachments()->get());\n\n // 2 - add new attachments\n $a_result_errors = $this->saveAttachments(compact('request', 'a_result_errors', 'ticket'));\n\n if (!$a_result_errors) {\n // 3 - destroy checked attachments\n if ($request->input('delete_files') != '') {\n $destroy_error = $this->destroyAttachmentIds($request->delete_files);\n\n if ($destroy_error) {\n $a_result_errors['messages'][] = $destroy_error;\n }\n }\n }\n }\n\n // Embedded Comments\n list($a_new_comments, $a_result_errors) = $this->add_embedded_comments($permission_level, $request, $ticket, $a_result_errors);\n\n // If errors present\n if ($a_result_errors) {\n return response()->json(array_merge(\n ['result' => 'error'],\n $a_result_errors\n ));\n }\n\n // If ticket hidden changes, execute related actions\n if ($original_ticket->hidden != $ticket->hidden) {\n $this->hide_actions($ticket);\n }\n\n // End transaction\n DB::commit();\n event(new TicketUpdated($original_ticket, $ticket));\n\n // Comment events\n if ($a_new_comments) {\n foreach ($a_new_comments as $comment) {\n event(new CommentCreated($comment, $request));\n }\n }\n\n // Add complete/reopen comment\n if ($original_ticket->completed_at != $ticket->completed_at and ($original_ticket->completed_at == '' or $ticket->completed_at == '')) {\n $this->complete_change_actions($ticket, $this->member);\n }\n\n $this->sync_ticket_tags($request, $ticket);\n\n session()->flash('status', trans('panichd::lang.the-ticket-has-been-modified', ['name' => '#'.$ticket->id.' \"'.$ticket->subject.'\"']));\n\n return response()->json([\n 'result' => 'ok',\n 'url' => route(Setting::grab('main_route').'.show', $id),\n ]);\n }",
"public function searchFlight(Request $request){\n if ($request->trip_type == 'R') {\n $this->validate($request, [\n 'departure' => 'required',\n 'arrival' => 'required',\n 'date_depart' => 'required',\n 'date_return' => 'required',\n 'trip_type' => 'required',\n 'adult' => 'required',\n 'country' => 'required',\n ]);\n }else{\n $this->validate($request, [\n 'departure' => 'required',\n 'arrival' => 'required',\n 'date_depart' => 'required',\n 'trip_type' => 'required',\n 'adult' => 'required',\n 'country' => 'required',\n ]);\n}\n// return $request->all();\n$departure = $request->departure;\n$departureFull = $request->depart_full;\n$arrival = $request->arrival;\n$arrivalFull = $request->arrival_full;\n$country = $request->country;\n$date_depart = $request->date_depart;\n$trip_type = $request->trip_type;\n$adult = $request->adult;\n$child = $request->child;\n$infant = $request->infant;\nif ($request->trip_type == 'R') {\n $date_return = $request->date_return;\n}else{\n $request->request->add(['date_return' => '']);\n $date_return = $request->date_return;\n}\n$menus = Menu::where('parent_id', 0)->orderby('order')->get();\n$meta_title= 'Choose a Flight | Upeverest';\n$meta_keywords= 'Flight Booking, Upeverest';\n$meta_desc= 'Flight Booking, Upeverest'; \n // return $request->all();\n\n // $request->session()->put('departure', $request->departure);\n // $request->session()->put('arrival', $request->arrival);\n // $request->session()->put('date_depart', $request->date_depart);\n // $request->session()->put('trip_type', $request->trip_type);\n // $request->session()->put('adult', $request->adult);\n // $request->session()->put('child', $request->child);\n // $request->session()->put('infant', $request->infant);\n // $request->session()->put('date_return', $request->date_return);\n // return $request->all();\n\nini_set(\"max_execution_time\",240);\n$wsdl = $this->strWsdl;\n$endpoint = array('location'=>$this->strEndpoint);\n$soapClient = new \\SoapClient($wsdl, $endpoint);\n$soapHeaders = array();\n$namespace = $this->strNamespace;\n$elementName = 'FlightAvailability';\n\n$authenticationHeader = array('strUserId' => $this->strUserId,'strPassword'=>$this->strPassword,'strAgencyId'=>$this->strAgencyId,'strSectorFrom'=>$request->departure,'strSectorTo'=>$request->arrival,'strFlightDate'=>$request->date_depart,'strReturnDate'=>$request->date_return,'strTripType'=>$request->trip_type,'strNationality'=>$request->country,'intAdult'=>$request->adult,'intChild'=>$request->child);\n$soapHeader = new \\SoapHeader($namespace, $elementName, $authenticationHeader); $soapHeaders[] = $soapHeader; $soapClient->__setSoapHeaders($soapHeaders);\n\n$result = $soapClient->FlightAvailability($authenticationHeader);\n$res_xml = simplexml_load_string($result->return);\n\n$elementName = 'SectorCode';\n$authenticationHeader = array('strUserId' => $this->strUserId);\n$soapHeader = new \\SoapHeader($namespace, $elementName, $authenticationHeader); $soapHeaders[] = $soapHeader; $soapClient->__setSoapHeaders($soapHeaders);\n\n$result2 = $soapClient->SectorCode($authenticationHeader);\n$res_xml2 = simplexml_load_string($result2->return);\n$sector = $res_xml2->Sector;\n\nforeach($sector as $sect){\n if ($sect->SectorCode == $departure) {\n $departureFull = ucfirst(strtolower($sect->SectorName));\n break;\n }\n}\n\nforeach($sector as $sect){\n if ($sect->SectorCode == $arrival) {\n $arrivalFull = ucfirst(strtolower($sect->SectorName));\n break;\n }\n}\n\n$outAvailability = $res_xml->Outbound->Availability;\n$inAvailability = $res_xml->Inbound->Availability;\n\nreturn view('frontend.flight.flightselection', compact('outAvailability', 'inAvailability', 'sector', 'departure', 'departureFull', 'arrival', 'arrivalFull', 'country', 'date_depart', 'date_return', 'trip_type', 'adult', 'child', 'infant', 'menus', 'meta_title', 'meta_keywords', 'meta_desc'))->with('class', 'home')->with('countries', $this->countries);\n}",
"public function ticket(Request $request)\n {\n //\n $tempBook = TempBooking::findOrFail($request->temp_booking_id);\n //dd(!Auth::guard('admin')->check());\n if((Auth::guard('admin')->check() != true) && (Auth::check() != true)){\n try{\n $accessId = env(\"PAYMENT_ACCESS_ID\");\n $secretKey = env(\"PAYMENT_SECRET_KEY\");\n $api = new PayabbhiClient($accessId, $secretKey);\n $api->utility->verifyPaymentSignature([\n 'payment_id' => $request->get(\"payment_id\"),\n 'order_id' => $request->get(\"order_id\"),\n 'payment_signature' => $request->get(\"payment_signature\"),\n ]);\n $payment = $api->payment->retrieve($request->get(\"payment_id\"));\n // verification passed\n //dd($payment);\n } catch (\\Payabbhi\\Error\\SignatureVerification $e) {\n // verification failed\n Session::flash('errors','Payment Details fetching error. Wait sometimes or contact to helpline no.');\n return view(\"world.payment-error\");\n }\n }\n DB::beginTransaction();\n try{\n $data['temp_booking_id'] = $tempBook->id;\n $data['transaction_id'] = $tempBook->transaction_id;\n $data['date'] = $tempBook->date;\n $data['doctor_id'] = $tempBook->doctor_id;\n $data['clinic_id'] = $tempBook->clinic_id;\n $data['slot_id'] = $tempBook->slot_id;\n $data['consultation_fees'] = $tempBook->consultation_fees;\n $data['service_charge'] = $tempBook->service_charge;\n $data['agent_charge'] = $tempBook->agent_charge;\n $data['amount_payable'] = $tempBook->amount_payable;\n $data['fees_mode'] = $tempBook->fees_mode;\n $data['patient_name'] = $tempBook->patient_name;\n $data['patient_city'] = $tempBook->patient_city;\n $data['patient_email'] = $tempBook->patient_email;\n $data['patient_phone'] = $tempBook->patient_phone;\n $data['patient_gender'] = $tempBook->patient_gender;\n $data['patient_age'] = $tempBook->patient_age;\n $data['status'] = 1;\n $data['user_id'] = $tempBook->user_id;\n $data['user_type'] = $tempBook->user_type;\n if((Auth::guard('admin')->check() != true) && (Auth::check() != true)){\n $data['order_id'] = $payment->order_id;\n $data['payment_amount'] = ($payment->amount)/100;\n $data['payment_status'] = $payment->status;\n }\n\n if($booking = Booking::firstOrCreate($data)){\n //dd($booking);\n if ($booking->wasRecentlyCreated) {\n TempBooking::findOrFail($request->temp_booking_id)->update(['status'=>1,'payment_done'=>1,'online_payment_successes_id'=>$booking->id]);\n $dailyAvaliable = DailyAvailable::where([['doctor_id',$booking->doctor_id],['schedule_id',$booking->slot_id],['date',$booking->date]])->first();\n $booked_seat = intval($dailyAvaliable->booked_seat)+intval(1);\n //dd($dailyAvaliable);\n if($dailyAvaliable->available_seat > $dailyAvaliable->booked_seat){\n DailyAvailable::where([['doctor_id',$booking->doctor_id],['schedule_id',$booking->slot_id],['date',$booking->date]])->update(['booked_seat'=>$booked_seat]);\n }\n\n $daily = DailyAvailable::where([['doctor_id',$booking->doctor_id],['schedule_id',$booking->slot_id],['date',$booking->date]])->first();\n\n if($daily->available_seat == $daily->booked_seat){\n DailyAvailable::where([['doctor_id',$booking->doctor_id],['schedule_id',$booking->slot_id],['date',$booking->date]])->update(['status'=>2]);\n }\n if(Auth::user()){\n if(Auth::user()->type == \"franchise\"){\n $recharge['franchise_id'] = Auth::user()->id;\n $recharge['amount'] = $booking->amount_payable;\n $recharge['type'] = 'd';\n if(RechargeTransaction::create($recharge)){\n $updated_balance = intval(Auth::user()->amount)-intval($booking->amount_payable);\n User::where('id',Auth::user()->id)->update(['amount'=>$updated_balance]);\n }\n }\n }\n //::\n Booking::where('id',$booking->id)->update(['sl_no_ticket'=>$booked_seat]);\n $doctor = DoctorMaster::findOrFail($booking->doctor_id);\n $clinic = Clinic::with('region')->findOrFail($booking->clinic_id);\n $schedule = ScheduleMaster::findOrFail($booking->slot_id);\n DB::commit();\n $message = \"\";\n $bookingDetails = BookingDetail::where('id',$booking->id)->first();\n $message .= \"www.bookurdoc.com\\n\";\n $message .= $bookingDetails->transaction_id.\"\\n\";\n if($bookingDetails->fees_mode == 1){\n $message .= \"Recieved Rs \".$bookingDetails->amount_payable.\" from \".$bookingDetails->patient_name.\". Ticket booked for \".$bookingDetails->doctor_name.\" for \".date('d-M-Y',strtotime($bookingDetails->date)).\" at \".$bookingDetails->slot.\" in \".$bookingDetails->clinic_name. $bookingDetails->clinic_address. \". Chamber will provide serial no. For any query call 8812907328/8876657929.\\n\";\n }\n else{\n $message .= \"Recieved Rs \".$bookingDetails->amount_payable.\" from \".$bookingDetails->patient_name.\" Ticket booked for \".$bookingDetails->doctor_name.\" for \".date('d-M-Y',strtotime($bookingDetails->date)).\" at \".$bookingDetails->slot .\" in \".$bookingDetails->clinic_name. $bookingDetails->clinic_address. \". Please pay consultation fee of Rs \".$bookingDetails->amount_payable.\" to the Doctor. Chamber will provide serial no. For any query call 8812907328/8876657929.\\n\";\n }\n $message .= \"GET WELL SOON\";\n sendSMS($booking->patient_phone,$message);\n }\n else{\n $booking = Booking::findOrFail($booking->id);\n $doctor = DoctorMaster::findOrFail($booking->doctor_id);\n $clinic = Clinic::with('region')->findOrFail($booking->clinic_id);\n $schedule = ScheduleMaster::findOrFail($booking->slot_id);\n\n }\n return view('world.ticket',compact('booking','doctor','clinic','schedule'));\n }\n }\n catch (Exception $e){\n DB::rollback();\n Session::flash('errors','Something Went Wrong');\n return back();\n }\n\n}"
] | [
"0.5710424",
"0.54622275",
"0.5459812",
"0.5358054",
"0.5351705",
"0.53313106",
"0.5329358",
"0.5317583",
"0.52830565",
"0.52677923",
"0.5252591",
"0.5246638",
"0.5245564",
"0.5244872",
"0.52270436",
"0.5222547",
"0.5213372",
"0.52121615",
"0.520151",
"0.518944",
"0.5186026",
"0.51820254",
"0.5157632",
"0.5149116",
"0.5147951",
"0.5145555",
"0.51312995",
"0.51295406",
"0.51243186",
"0.5111075"
] | 0.5627784 | 1 |
/Test 0: test_getName Desc: check class Cuisine is made and can call name by getName() Input: "Sam's Pizza" Output: "Sam's Pizza" | function test_getName()
{
//Arrange
$cuisine_type = "American";
$test_cuisine = new Cuisine($cuisine_type);
//Act
$test_cuisine->getCuisineType();
//Assert
$result = $test_cuisine;
$this->assertEquals($test_cuisine, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_getName()\n\t\t{\n\t\t\t//Arrange\n\t\t\t$name = \"Molly\";\n\t\t\t$id = 1;\n\t\t\t$test_stylist = new Stylist($name, $id);\n\n\t\t\t//Act\n\t\t\t$result = $test_stylist->getName();\n\n\t\t\t//Assert\n\t\t\t$this->assertEquals($name, $result);\n\n\t\t}",
"public function testGetName(){\n $name = 'Meatloaf';\n $this->recipe->setName($name);\n $this->assertEquals($name, $this->recipe->getName());\n }",
"public function testGetName()\r\n\t{\r\n\t}",
"abstract public function get_name();",
"function testGetName()\n {\n //Arrange\n $name = \"HIST100\";\n $number = 909098;\n $id=3;\n $test_class = new Course($name,$id, $number);\n //No need to save here because we are communicating with the object only and not the database.\n //Act\n $result = $test_class->getName();\n //Assert\n $this->assertEquals($name, $result);\n }",
"public function testGetName()\n {\n $rule = new Formagic_Rule_Mock_MockRule();\n $actual = $rule->getName();\n $this->assertEquals('Mock_MockRule', $actual);\n }",
"function testSetName()\n { //Arrange\n $name = \"HIST100\";\n $number = 909098;\n $id=3;\n $test_class = new Course($name,$id, $number);\n //No need to save here because we are communicating with the object only and not the database.\n //Act\n $test_class->setName(\"BIO423\");\n $result = $test_class->getName();\n //Assert\n $this->assertEquals(\"BIO423\", $result);\n }",
"public function get_name();",
"public function get_name();",
"public function get_name();",
"public function testPlayerName()\n {\n $diceGame = new DiceGame();\n $this->assertInstanceOf(\"\\Chai17\\Dice\\DiceGame\", $diceGame);\n $diceGame->setPlayerName(\"Claes\");\n $res = $diceGame->getPlayerName();\n $exp = \"Claes\";\n $this->assertEquals($exp, $res);\n }",
"abstract function getName();",
"abstract public function getName(): string;",
"abstract public function getName(): string;",
"abstract public function getName(): string;",
"abstract public function getName(): string;",
"abstract public function getName(): string;",
"abstract public function name();",
"public function GetName ();",
"abstract public function getName() : string;",
"public function testReturnUserName(){\n $user = new \\App\\Model\\User;\n $user->setUserName('arefin');\n $this->assertEquals($user->getUserName(), 'arefin');\n }",
"function testRename() {\n $this->abc->rename('def');\n $result = $this->abc->toString();\n $expected = \"def\";\n $this->assertTrue($result == $expected);\n }",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();",
"abstract public function getName();"
] | [
"0.79124594",
"0.72498596",
"0.72118753",
"0.71296567",
"0.7095073",
"0.67929834",
"0.6743166",
"0.67036617",
"0.67036617",
"0.67036617",
"0.6702163",
"0.66653305",
"0.6644065",
"0.6644065",
"0.6644065",
"0.6644065",
"0.6644065",
"0.66363233",
"0.6620947",
"0.65868104",
"0.65752435",
"0.6572951",
"0.657076",
"0.657076",
"0.657076",
"0.657076",
"0.657076",
"0.657076",
"0.657076",
"0.657076"
] | 0.7968628 | 0 |
//Test 1: test_save We need to create and test save() getAll() Desc: add cuisine_type restaurant table and return Input: "Sam's Pizza" Output: "Sam's Pizza" | function test_save()
{
//Arrange
$cuisine_type = "American";
$test_cuisine = new Cuisine($cuisine_type);
//Act
$test_cuisine->save();
//Assert
$result = Cuisine::getAll();
$this->assertEquals($test_cuisine, $result[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_find()\n {\n //Arrange\n $cuisine_type = \"American\";\n $cuisine_type2 = \"Greek\";\n $test_cuisine = new Cuisine($cuisine_type);\n $test_cuisine2 = new Cuisine($cuisine_type2);\n $test_cuisine->save();\n $test_cuisine2->save();\n\n\n //Act\n $result = Cuisine::find($test_cuisine->getId());\n\n //Assert\n $this->assertEquals($test_cuisine, $result);\n }",
"function test_save_new() {\n\t}",
"public function test_store(){\n Antrian::create([\n 'id_antrian' => 1,\n 'id_dokter' => 16,\n 'id_poli' => 2,\n 'nama_pasien' => 'Firman Syah',\n 'jk' => 'laki-laki',\n 'umur' => 20,\n 'no_telp' => '08917293123',\n 'tanggal' => '2020-07-15',\n 'status' => 0\n ]);\n\n $this->assertDatabaseHas('antrian',[\n 'id_antrian' => 1\n ]);\n }",
"public function testModelSaveTopsisDGagal1()\n {\n $input = [\n 'IdSaveTopsis' => '',\n 'IdMAlternatif' => '',\n 'Nilai' => '' \n ];\n $validator = Validator::make($input, savetopsisd::rules());\n if (!$validator->fails()){\n $user = factory(savetopsisd::class, 1)->create($input);\n } \n return $this->assertDatabaseHas('savetopsisds', [\n 'IdSaveTopsis' => 10,\n 'IdMAlternatif' => 3,\n 'Nilai' => 0.50\n ]); \n }",
"function testSave()\n {\n //Arrange\n $brand_name = \"Super Kicks\";\n $test_brand = new Brand($brand_name);\n\n //Act\n $test_brand->save();\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals($test_brand, $result[0]);\n }",
"public function TestBaseInsert()\n {\n $this->assertDatabaseHas('schools', ['name' => 'Mariam Will']);\n }",
"public function test_create_county_contractor_account() {\n $output = $this->request(\n 'POST',\n ['user', 'create_county_contractor_account'],\n [\n 'id' => 'county12',\n 'password' => '123456789',\n 'userName' => 'county12'\n ]\n );\n $this->assertContains('新增成功', $output);\n // check user table has new user row\n $query = $this->CI->db->query(\"select 1 from users where id = 'county12' and name = 'county12' and manager = 0 and county = 1;\");\n $isUserExist = $query->num_rows();\n $this->assertEquals(1, $isUserExist);\n // clear up fake data\n $this->CI->db->query(\"delete from users where id = 'county12' and name = 'county12' and manager = 0 and county = 1;\");\n }",
"function test_deleteAll()\n {\n // Arrange\n $cuisine_type1 = \"American\";\n $cuisine_type2 = \"Greek\";\n $test_cuisine1 = new Cuisine($cuisine_type1);\n $test_cuisine1->save();\n $test_cuisine2= new Cuisine($cuisine_type2);\n $test_cuisine2->save();\n\n //Act\n Cuisine::deleteAll();\n $result = Cuisine::getAll();\n\n //Assert\n $this->assertEquals([], $result);\n }",
"public function test_db () {\n\t\t$qry = 'INSERT INTO users\n\t\t\t\tSET first_name = \"Finn\",\n\t\t\t\tlast_name = \"McKinnon\"';\n\n\n\t\t# test update for practice\n\t\t$qry2 = 'UPDATE users\n\t\t\t\tSET email = \"[email protected]\"\n\t\t\t\tWHERE first_name = \"Finn\"';\n\n\t\t# DB::instance(DB_NAME)->query($qry2);\n\n\n\t\t# test the insert_row method\n\t\t$new_user = Array(\n\t\t\t'first_name' => 'Marcelline',\n\t\t\t'last_name' => 'McKinnon',\n\t\t\t'email' => '[email protected]'\n\t\t\t);\n\n\t\t# DB::instance(DB_NAME)->insert('users', $new_user);\n\n\t\t$_POST['first_name'] = 'Marcelline';\n\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t$qry3 = 'SELECT email\n\t\t\t\tFROM users\n\t\t\t\tWHERE first_name = \"'.$_POST['first_name'].'\"';\n\n\t\techo DB::instance(DB_NAME)->select_field($qry3);\n\n\t}",
"public function testTodoItemsTable() {\n\n //arrange\n factory(App\\User::class)->create();\n $todo_name = factory(App\\TodoItem::class)->create()->name;\n\n //assert\n $this->assertDatabaseHas('todo_items', [\n 'name' => $todo_name\n ]);\n }",
"public function testOfficesSave()\n {\n }",
"public function saveRestaurant()\n {\n global $db;\n\n $qry = \"UPDATE restaurant SET \n name = '$this->name',\n description = '$this->description',\n postalcode = '$this->postalcode',\n streetaddress = '$this->streetaddress',\n city = '$this->city',\n restaurant_type = '$this->restaurant_type'\n WHERE restaurant_id = '$this->restaurant_id'\";\n $result = $db->query($qry);\n if($result)\n return true;\n\n return false;\n }",
"function addBusinessType( $id,\r\n $banking,\r\n $food,\r\n $coffee,\r\n $recreation,\r\n $family,\r\n $nonprofit,\r\n $other )\r\n{\r\n // Create a database connection\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n\r\n // make db connection, query for business record, and return result\r\n $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);\r\n\r\n $query = \"INSERT INTO ilr_business_type ( id, banking, food, coffee,\";\r\n $query .= \" recreation, family, nonprofit, other \";\r\n $query .= \") VALUES ( '{$id}', '{$banking}', '{$food}', '{$coffee}',\";\r\n $query .= \" '{$recreation}', '{$family}', '{$nonprofit}', '{$other}' )\";\r\n\r\n $result = mysqli_query( $connection, $query );\r\n\r\n if( $result )\r\n {\r\n return 1;\r\n }\r\n\r\n // close db connection\r\n mysqli_close($connection);\r\n return 0;\r\n}",
"public function test_db(){\n\n\n\n\n\n\n\t}",
"public function testExample()\n {\n {\n $users = Cars::all();\n\n Cars::where('cars')->insert([\n\n 'make' => 'ford',\n 'model' => 'Explorer',\n 'year' => '2017',\n\n ]);\n\n }\n $this->assertTrue(true);\n\n }",
"public function run()\n {\n \n $testTypeNames = ['Blood Analysis','Gastric Fluid','Kidney Function Test','Liver Function Test','Lumbar Puncture','Malabsorption Tests' ,'Pregnancy Test','Prenatal Testing','Thyroid Function Test','Urinalysis'];\n foreach($testTypeNames as $testTypeName)\n {\n DB::table('test_types')->insert([\n 'name' => $testTypeName,\n 'description' => \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s\",\n 'slug'=> Str::slug($testTypeName),\n ]);\n }\n \n \n }",
"public function insertmodel(){\n$this->autoRender=false;\n$x=$this->Fruits->newEntity();\n$x->name=\"Niteesh\";\n$this->Fruits->save($x);\n//using \"Query builder\"\n$y=$this->Fruits->query();\n$y->insert([\"name\"])->values([\"name\"=>\"jaswanth\"])->execute();\n}",
"public function testExample()\n {\n $this->assertTrue(true);\n $thisCompany = new \\App\\Company;\n $companyNameList = $thisCompany->names();\n $this->assertTrue(count($companyNameList)>0);\n $thisCompanyType = new \\App\\CompanyType;\n $companyTypesList = $thisCompanyType->getCompanyTypes();\n $this->assertTrue(count($companyTypesList)==7);\n $companyTypesList = $thisCompanyType->getCompanySellerTypes();\n $this->assertTrue(count($companyTypesList)==3);\n $companyTypesList = $thisCompanyType->getCompanyBuyerTypes();\n $this->assertTrue(count($companyTypesList)==4);\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('Rings With Bing');\n $this->assertTrue($thisCompanyId==1);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('baloney');\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n try {\n $newCompanyId = $thisCompany->addNewCompany('New Company Name3', 'newweb.com', '999-999-9999', [2], 1, '98989898.jpg');\n } catch (Exception $e) {\n echo($e->getMessage());\n $this->assertTrue(false);\n }\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('New Company Name3');\n $this->assertTrue($newCompanyId==$thisCompanyId);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n try {\n $thisCompany->deleteCompany($thisCompanyId);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('New Company Name3');\n $this->assertTrue($newCompanyId==$thisCompanyId);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('Trinkets Unlimited');\n $this->assertTrue($thisCompanyId==3);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n\n try {\n $thisCompany->editCompany($thisCompanyId, 'Cheap Trinkets Unlimited', 'www.ultracheaptrinkets.com', '451) 307-2650 x71724', [9], [1, 3]);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n try {\n $thisCompanyId = $thisCompany->getCompanyByName('Cheap Trinkets Unlimited');\n $this->assertTrue($thisCompanyId==3);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n try {\n $thisCompany->editCompany($thisCompanyId, 'Trinkets Unlimited', 'www.ultracheaptrinkets.com', '451) 307-2650 x71724', [9], [1, 3]);\n } catch (Exception $e) {\n $this->assertTrue(false);\n }\n\n\n\n\n }",
"public function testWarehouseTransferOutSAVERequestSaveGet()\n {\n }",
"public function testSalesOpportunitiesTypesIdPut()\n {\n\n }",
"public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_gerechten (restaurant_id, gerechtnaam, gerechtprijs, gerechttype )\r\n\t\t\tVALUES ('\".$_SESSION['restaurant_id'].\"',\r\n\t\t\t\t'\".$db->conn->real_escape_string($this->m_sGerecht).\"',\r\n\t\t\t\t\t REPLACE('\".$db->conn->real_escape_string($this->m_iPrijs).\"',',','.'),\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sType).\"'\r\n\t\t\t\t\t\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\t\t\t//echo \"query is : \" . \"</br>\" . $sql;\r\n\t\t}",
"public function test_create_counselor_account() {\n $identification = 'N123456000';\n $gender = '132';\n $birth = '1994-03-21';\n $department = 'NCNU';\n $fax = '00xx00';\n $phone = '09009900';\n $email = '[email protected]';\n $householdAddress = 'xx市x區xx路12號';\n $resideAddress = 'xx市x區xx路12號';\n $educationStartDate = '2012-07-01';\n $educationCompleteDate = '2012-09-01';\n $educationSchool = 'NCNU';\n $educationDepartment = 'IM';\n $workStartDate = '2012-07-01';\n $workCompleteDate = '2012-09-01';\n $workDepartment = 'IM';\n $workPosition = 'Programmer';\n $dutyDate = '2012-10-01';\n $qualification = '223,446';\n $output = $this->request(\n 'POST',\n ['user', 'create_counselor_account'],\n [\n 'id' => 'counselor11',\n 'password' => '123456789',\n 'userName' => 'counselor11',\n 'identification' => $identification,\n 'gender' => $gender,\n 'birth' => $birth,\n 'department' => $department,\n 'fax' => $fax,\n 'phone' => $phone,\n 'email' => $email,\n 'householdAddress' => $householdAddress,\n 'resideAddress' => $resideAddress,\n 'educationStartDate' => $educationStartDate,\n 'educationCompleteDate' => $educationCompleteDate,\n 'educationSchool' => $educationSchool,\n 'educationDepartment' => $educationDepartment,\n 'workStartDate' => $workStartDate,\n 'workCompleteDate' => $workCompleteDate,\n 'workDepartment' => $workDepartment,\n 'workPosition' => $workPosition,\n 'dutyDate' => $dutyDate,\n 'qualification' => explode(\",\", $qualification)\n ]\n );\n $this->assertContains('新增成功', $output);\n // check user table has new user row\n $query = $this->CI->db->query(\"select counselor from users where id = 'counselor11' \n and name = 'counselor11' and manager = 0 and county = 1 and organization = 1;\");\n $isUserExist = $query->num_rows();\n $userCounselor = $query->row(0)->counselor;\n $this->assertEquals(1, $isUserExist);\n $query = $this->CI->db->query(\"select no from counselor where identification = ? \n and gender = ? and birth = ? and department = ? and fax = ? and phone = ? and email = ? \n and household_address = ? and reside_address = ? and education_start_date = ? \n and education_complete_date = ? and education_school = ? and education_department = ? \n and work_start_date = ? and work_complete_date = ? and work_department = ? and work_position = ? \n and duty_date = ? and qualification = ?;\", \n array($identification, $gender, $birth, $department, $fax, $phone, $email, $householdAddress,\n $resideAddress, $educationStartDate, $educationCompleteDate, $educationSchool, $educationDepartment,\n $workStartDate, $workCompleteDate, $workDepartment, $workPosition, $dutyDate, $qualification));\n $counselorNo = $query->row(0)->no;\n $this->assertEquals($userCounselor, $counselorNo);\n // clear up fake data\n $this->CI->db->query(\"delete from users where id = 'counselor11' \n and name = 'counselor11' and manager = 0 and county = 1 and organization = 1;\");\n $this->CI->db->query(\"delete from counselor where identification = ? \n and gender = ? and birth = ? and department = ? and fax = ? and phone = ? and email = ? \n and household_address = ? and reside_address = ? and education_start_date = ? \n and education_complete_date = ? and education_school = ? and education_department = ? \n and work_start_date = ? and work_complete_date = ? and work_department = ? and work_position = ? \n and duty_date = ? and qualification = ?;\", \n array($identification, $gender, $birth, $department, $fax, $phone, $email, $householdAddress,\n $resideAddress, $educationStartDate, $educationCompleteDate, $educationSchool, $educationDepartment,\n $workStartDate, $workCompleteDate, $workDepartment, $workPosition, $dutyDate, $qualification));\n }",
"function testSave()\n {\n //Arrange\n $name = \"BIO423\";\n $id = 1;\n $number = 909098;\n $test_class = new Course($name, $id, $number);\n $test_class->save();\n //Act\n $result = Course::getAll();\n\n //Assert\n $this->assertEquals($test_class, $result[0]);\n }",
"public function run()\n {\n $faker = Faker\\Factory::create();\n for ($i=0; $i < 100; $i++) {\n $data[] = [\n 'title' => $faker->jobTitle,\n 'first_name' => $faker->name,\n 'last_name' => $faker->lastName,\n 'RFC' => $faker->ean13,\n 'user_id' => rand(1, 10),\n 'customer_type_id' => rand(1, 3),\n ];\n }\n $table = $this->table('customers');\n $table->insert($data)->save();\n }",
"public function testExample()\r\n {\r\n $this->assertDatabaseHas('product' , ['product_type'=>\"Digital Art\"]);\r\n\r\n $this->assertDatabaseHas('product' , ['product_name'=>\"Beautifu Art\"]);\r\n }",
"public function testInsertFavorite(): void {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"favorite\");\n\n\t\t// create a new favorite and insert to into mySQL\n\t\t$favorite = new Favorite($this->profile->getProfileId(), $this->truck->getTruckId());\n\t\t$this->assertEquals($this->getConnection()->getRowCount(\"truck\"), 1);\n\t\t$favorite->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoFavorite = Favorite::getFavoriteByFavoriteProfileIdAndFavoriteTruckId($this->getPDO(),$this->profile->getProfileId() , $this->truck->getTruckId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"favorite\"));\n $this->assertEquals($pdoFavorite->getFavoriteProfileId(), $this->profile->getProfileId());\n $this->assertEquals($pdoFavorite->getFavoriteTruckId(), $this->truck->getTruckId());\n\n\n\t}",
"public function test_likeUpsert() {\n\n }",
"public function testUsersIdFoodDiaryPost()\n {\n\n }",
"public function run() {\n // $table->string('name',50);\n // $table->string('logi',250);\n // $table->string('long',250);\n // $table->string('popularity',250);\n DB::table('places')->insert(array(\n 0 =>\n array(\n 'logi' => (10),\n 'long' => (20),\n 'popularity' => ('Very popular')\n ),\n 1 =>\n array(\n 'logi' => (5),\n 'long' => (11),\n 'popularity' => ('Less popular')\n ),\n 2 =>\n array(\n 'logi' => (6),\n 'long' => (4),\n 'popularity' => ('Moderately popular')\n ),\n ));\n }",
"function testSaveGeneral()\r\n { \r\n $params['app'] = \"crm\";\r\n $params['title'] = \"Customer Relationship Management\";\r\n $params['short_title'] = \"CRM\";\r\n $params['scope'] = \"system\";\r\n \r\n $appController = new ApplicationController($this->ant, $this->user);\r\n $appController->debug = true;\r\n \r\n $ret = $appController->saveGeneral($params);\r\n $this->assertTrue($ret > 0); \r\n }"
] | [
"0.6408376",
"0.6054374",
"0.5985878",
"0.59469384",
"0.5906432",
"0.5897441",
"0.586789",
"0.5816522",
"0.58009124",
"0.5746635",
"0.573871",
"0.5730516",
"0.5714978",
"0.5689797",
"0.56856716",
"0.56683403",
"0.565677",
"0.5653349",
"0.5651695",
"0.5637757",
"0.5631913",
"0.56216156",
"0.5609084",
"0.55949736",
"0.5593898",
"0.55908996",
"0.55881834",
"0.5584642",
"0.55804574",
"0.557024"
] | 0.7187479 | 0 |
/Test 2: test_deleteAll() don't forget tearDown!! We need deleteAll() Desc: delete all records from cuisine_type Input: "Sam's Pizza", "Tom's Burgers" Output: " " | function test_deleteAll()
{
// Arrange
$cuisine_type1 = "American";
$cuisine_type2 = "Greek";
$test_cuisine1 = new Cuisine($cuisine_type1);
$test_cuisine1->save();
$test_cuisine2= new Cuisine($cuisine_type2);
$test_cuisine2->save();
//Act
Cuisine::deleteAll();
$result = Cuisine::getAll();
//Assert
$this->assertEquals([], $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testDeleteAll()\n {\n //Arrange\n $brand_name = \"Super Kicks\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n $brand_name2 = \"Cool Shoes\";\n $test_brand2 = new Brand($brand_name2);\n $test_brand->save();\n\n //Act\n Brand::deleteAll();\n $result = Brand::getAll();\n\n //Assert\n $this->assertEquals([], $result);\n\n }",
"function testDeleteAll()\n {\n //Arrange\n //We need some categories saved into the database so that we can make sure our deleteAll method removes them all.\n $name = \"MTH321\";\n $id = 1;\n $number = 200808;\n $test_class = new Course($name, $id, $number);\n $test_class->save();\n $name2 = \"Epicodus Ruby\";\n $id2 = 2;\n $number2 = 200808;\n $test_class2 = new Course($name2, $id2, $number2);\n $test_class2->save();\n //Act\n //Delete categories.\n Course::deleteAll();\n //Assert\n //Now when we call getAll, we should get an empty array because we deleted all categories.\n $result = Course::getAll();\n $this->assertEquals([], $result);\n }",
"public function testDeleteAll()\n {\n $this->markTestIncomplete('このテストは、まだ実装されていません。');\n }",
"public function deleteAll();",
"public function tearDown(){\n\n $where = new Where();\n $where->lessThan(\"id\",\"110000\")\n ->greaterThan(\"id\",\"100000\");\n $table = new AdminTable($this->_dbAdapter);\n $table->delete($where);\n $table = new UserTable($this->_dbAdapter);\n $table->delete($where);\n $table = new SellerTable($this->_dbAdapter);\n $table->delete($where);\n $table = new WorkerTable($this->_dbAdapter);\n $table->delete($where);\n\n }",
"public function deleteAll()\n\t{}",
"public function tearDown() {\r\n $conn = $this->CI->my_database->conn;\r\n \r\n $conn->query(\"DELETE FROM korisnik WHERE KIme='KorisnikTest';\");\r\n $conn->query(\"DELETE FROM konobar WHERE KIme='KonobarTest';\");\r\n $conn->query(\"DELETE FROM restoran WHERE KIme='RestoranTest';\");\r\n $conn->query(\"DELETE FROM admin WHERE KIme='AdminTest';\");\r\n }",
"public function testSalesOpportunitiesTypesIdDelete()\n {\n\n }",
"public function testDeleteStringKey(): void\r\n {\r\n $this->Db->setKey(array(RW_App_Model_Db::KEY_STRING => 'id'));\r\n $this->dropTables()->createTables(array('album_string'));\r\n\r\n // Abaixo é igual ao testDelete trocando 1, 2 por A, B\r\n $row1 = array(\r\n 'id' => 'A',\r\n 'artist' => 'Rush',\r\n 'title' => 'Presto',\r\n 'deleted' => 0\r\n );\r\n $row2 = array(\r\n 'id' => 'B',\r\n 'artist' => 'Rush',\r\n 'title' => 'Moving Pictures',\r\n 'deleted' => 0\r\n );\r\n\r\n $this->Db->insert($row1);\r\n $this->Db->insert($row2);\r\n\r\n // Verifica se o registro existe\r\n $this->assertEquals($row1, $this->Db->fetchRow('A'), 'row1 existe');\r\n $this->assertEquals($row2, $this->Db->fetchRow('B'), 'row2 existe');\r\n\r\n // Marca para usar o campo deleted\r\n $this->Db->setUseDeleted(true)->setShowDeleted(true);\r\n\r\n // Remove o registro\r\n $this->Db->delete('A');\r\n $row1['deleted'] = 1;\r\n\r\n // Verifica se foi removido\r\n $row = $this->Db->fetchRow('A');\r\n $this->assertEquals(1, $row['deleted'], 'row1 marcado como deleted');\r\n $this->assertEquals($row2, $this->Db->fetchRow('B'), 'row2 ainda existe v1');\r\n\r\n // Marca para mostrar os removidos\r\n $this->Db->setShowDeleted(true);\r\n\r\n // Verifica se o registro existe\r\n $this->assertEquals($row1, $this->Db->fetchRow('A'), 'row1 ainda existe v1');\r\n $this->assertEquals($row2, $this->Db->fetchRow('B'), 'row2 ainda existe v2');\r\n\r\n // Marca para remover o registro da tabela\r\n $this->Db->setUseDeleted(false);\r\n\r\n // Remove o registro qwue não existe\r\n $this->Db->delete('C');\r\n\r\n // Verifica se ele foi removido\r\n $this->assertNotEmpty($this->Db->fetchRow('A'), 'row1 ainda existe v3');\r\n $this->assertNotEmpty($this->Db->fetchRow('B'), 'row2 ainda existe v3');\r\n\r\n // Remove o registro\r\n $this->Db->delete('A');\r\n\r\n // Verifica se ele foi removido\r\n $this->assertNull($this->Db->fetchRow('A'), 'row1 não existe v4');\r\n $this->assertNotEmpty($this->Db->fetchRow('B'), 'row2 ainda existe v4');\r\n }",
"protected function tearDown(): void {\n DB::run(\"DELETE FROM courses WHERE name LIKE 'test course'\");\n }",
"public function testBulkDelete(){\n $this->browse(function (Browser $browser){\n $postType = factory(PostType::class)->create();\n $faker = Factory::create();\n $title = [];\n $description = [];\n $slug = [];\n $isVisible = [];\n foreach (Language::all() as $language){\n $title[$language->slug] = $faker->name(8);\n $description[$language->slug] = $faker->name(15);\n $slug[$language->slug] = $faker->slug;\n $isVisible[$language->slug] = 1;\n }\n\n $category = new Category();\n $category->createdByUserID = 1;\n $category->postTypeID = $postType->postTypeID;\n $category->title = $title;\n $category->description = $description;\n $category->slug = $slug;\n $category->isVisible = $isVisible;\n $category->order = Category::all()->count();\n\n if($category->save()){\n $browser->loginAs($this->getAnAdmin()->userID, 'admin')\n ->visit('admin/'.\\App::getLocale().'/post-type/categorylist/'.$postType->postTypeID)\n ->waitUntilMissing('@spinner')\n ->click('#ID'.$category->categoryID)\n ->click('#deleteList')\n ->waitFor('.noty_type__success')\n ->assertVisible('.noty_type__success');\n\n PostType::find($postType->postTypeID)->delete();\n }\n\n });\n }",
"public function testDeleteAllAccounts()\r\n {\r\n }",
"public function testOfficesDelete()\n {\n }",
"static function deleteAll(){\n\tglobal $bdd;\n\t\n\ttry {\n\t\t$req = \"DELETE FROM habilite\";\n\t\t$bdd->exec($req);\n\n\t\t$req = \"DELETE FROM conseille\";\n\t\t$bdd->exec($req);\n\n\t\t$req = \"DELETE FROM pole\";\n\t\t$bdd->exec($req);\t\t\n\t\n\t\t$req = \"DELETE FROM ec\";\n\t\t$bdd->exec($req);\n\t} catch(PDOException $e) { die (\"Erreur lors de l'exécution de la requéte\" . $e->getMessage()); }\n}",
"public function testDeleteTableWithArrayCriteria()\n {\n $this->assertEquals(9, $this->manager->count(Demo\\Artist::class, 'artistTypeId=?', [1]));\n \n $this->manager->deleteTable(Demo\\Artist::class, array('where'=>'artistTypeId=:id', 'params'=>array(':id'=>1)));\n \n $this->assertEquals(0, $this->manager->count(Demo\\Artist::class, 'artistTypeId=?', [1]));\n\n // sanity check: make sure we didn't delete everything!\n $this->assertEquals(4, $this->manager->count(Demo\\Artist::class));\n }",
"public function testDeleteLook()\n {\n }",
"public function testOrmDeleteAll()\n {\n $eventsModel = new IdiormDbal('events');\n\n $this->assertEquals(7, $eventsModel->count());\n\n $eventsModel->criteria('title', '=', 'Dance');\n\n $eventsModel->deleteAll();\n\n $eventsModel = new IdiormDbal('events');\n\n $this->assertCount(6, $eventsModel->get());\n\n $eventsModel->criteria('title', '=', 'Dance');\n\n $this->assertEmpty($eventsModel->get());\n }",
"public static function deleteAll()\n {\n\t\t$mysqli = DatabaseManager::getDatabase();\n\n if($stmt = $mysqli->prepare(\"DELETE FROM \".self::$TABLENAME)) {\n $stmt->execute();\n $stmt->close();\n }\n\t}",
"public function testDeleteCustomerData()\n {\n }",
"public function testDeletingAll()\n {\n $this->open(route('hulpverleners.index'))\n ->click('actions')\n ->click('select-all')\n ->click('actions')\n ->click('remove')\n ->click('confirm');\n\n $this->open(route('hulpverleners.index'))\n ->click('actions')\n ->click('select-all')\n ->click('actions')\n ->click('remove')\n ->click('confirm')\n ->wait();\n\n //we should keep one user\n $this->assertSame(User::count(), 1);\n }",
"public function deleteAll()\n {\n log::add('MerossIOT','debug','***** DELETE ALL *****');\n $eqLogics = eqLogic::byType('MerossIOT');\n foreach ($eqLogics as $eqLogic) {\n $eqLogic->remove();\n }\n return array(true, 'OK');\n }",
"public function test_can_delete_records() {\n global $DB;\n require_once(elis::lib('data/data_filter.class.php'));\n $dataset = $this->createCsvDataSet(array(\n 'config' => elis::component_file('core', 'tests/fixtures/phpunit_data_object_test.csv')\n ));\n\n $this->loadDataSet($dataset);\n\n config_object::delete_records(new field_filter('name', 'foo'), $DB);\n\n $result = new moodle_recordset_phpunit_datatable('config', config_object::find(new field_filter('id', 10000, field_filter::GE), array(), 0, 0, $DB));\n $dataset = $this->createCsvDataSet(array(\n 'config' => elis::component_file('core', 'tests/fixtures/phpunit_data_object_delete_test_result.csv')\n ));\n $this->assertTablesEqual($dataset->getTable('config'), $result);\n }",
"public function testDeleteAll()\n {\n $models = array();\n for ($i = 0; $i < 10; $i++) {\n $models[] = array(\n 'hash_before' => md5(uniqid()),\n 'hash_after' => md5(uniqid()),\n );\n }\n\n $this->createModels('tiny_compressimages/image', $models);\n\n $this->assertEquals(10, $this->_instance->getCollection()->getSize());\n\n $this->_instance->deleteAll();\n\n $this->assertEquals(0, $this->_instance->getCollection()->getSize());\n }",
"public function testDeleteTableWithArraySetAndNamedWhere()\n {\n $this->assertEquals(9, $this->manager->count(Demo\\Artist::class, 'artistTypeId=?', [1]));\n \n $this->manager->deleteTable(Demo\\Artist::class, 'artistTypeId=:id', array(':id'=>1));\n \n $this->assertEquals(0, $this->manager->count(Demo\\Artist::class, 'artistTypeId=?', [1]));\n \n // sanity check: make sure we didn't delete everything!\n $this->assertEquals(4, $this->manager->count(Demo\\Artist::class));\n }",
"public function delete_all() {\n $this->db->prepare(\"TRUNCATE cayl_cache\")->execute();\n $this->db->prepare(\"TRUNCATE cayl_check\")->execute();\n }",
"public function testDeleteDeviceUsers()\n {\n }",
"public function deleteAll()\n {\n $this->_preDeleteAll();\n foreach ($this->_data as $key => $val) {\n $this->deleteOne($key);\n }\n $this->_postDeleteAll();\n }",
"function testCategoryDelete() {\n //========================================= \n \n // To verify delete Parlay Category is valid\n //========================================= \n }",
"public function testDelete16()\n {\n }",
"protected function tearDown()\n {\n $myDB = oxDb::getDB();\n $sDelete = 'delete from oxrecommlists where oxid like \"test%\" ';\n $myDB->execute($sDelete);\n\n $sDelete = 'delete from oxobject2list where oxlistid like \"test%\" ';\n $myDB->execute($sDelete);\n\n $sDelete = 'delete from oxreviews where oxobjectid like \"test%\" ';\n $myDB->execute($sDelete);\n\n $sDelete = 'delete from oxratings where oxobjectid like \"test%\" ';\n $myDB->execute($sDelete);\n\n $this->cleanUpTable('oxreviews');\n\n parent::tearDown();\n }"
] | [
"0.6843616",
"0.67384243",
"0.66884285",
"0.6547125",
"0.6503354",
"0.6354225",
"0.631088",
"0.63058513",
"0.6299612",
"0.6292248",
"0.6284466",
"0.62729406",
"0.6197975",
"0.6130825",
"0.610249",
"0.609096",
"0.6076268",
"0.607585",
"0.6074796",
"0.607124",
"0.605954",
"0.6035409",
"0.60040605",
"0.5979016",
"0.5965378",
"0.5948484",
"0.59383154",
"0.59246594",
"0.5915555",
"0.5910939"
] | 0.83352804 | 0 |
/Test 3: test_getId() update save(), getAll() func use getId() desc: return hardcoded value Input: cuisine_type = "Bob's Burgers", id = 1 Output: 1 | function test_getId()
{
//Arrange
$cuisine_type = "American";
$cuisine_id = 1;
$test_cuisine = new Cuisine($cuisine_type, $cuisine_id);
//Act
$result = $test_cuisine->getId();
//Assert
$this->assertEquals(true, is_numeric($result));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testSaveSetsId()\n {\n //Arrange\n $name = \"BIO423\";\n $number = 200808;\n $id = 1;\n $test_class = new Course($name, $id, $number);\n //Act\n //save it. Id should be assigned in database, then stored in object.\n $test_class->save();\n //Assert\n //That id in the object should be numeric (not null)\n $this->assertEquals(true, is_numeric($test_class->getId()));\n }",
"public function testGetId()\r\n\t{\r\n\t}",
"function test_getId()\n\t\t{\n\t\t\t//Arrange\n\t\t\t//assign a specific id so we can be sure to get it back from the object.\n\t\t\t$name = \"Vernon\";\n\t\t\t$id = 1;\n\t\t\t$test_stylist = new Stylist($name, $id);\n\n\t\t\t//Act\n\t\t\t$result = $test_stylist->getId();\n\n\t\t\t//Assert\n\t\t\t$this->assertEquals($id, $result);\n\t\t}",
"function testGetId()\n {\n //Arrange\n $brand_name = \"Super Kicks\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n //Act\n $result = $test_brand->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n }",
"function test_find()\n {\n //Arrange\n $cuisine_type = \"American\";\n $cuisine_type2 = \"Greek\";\n $test_cuisine = new Cuisine($cuisine_type);\n $test_cuisine2 = new Cuisine($cuisine_type2);\n $test_cuisine->save();\n $test_cuisine2->save();\n\n\n //Act\n $result = Cuisine::find($test_cuisine->getId());\n\n //Assert\n $this->assertEquals($test_cuisine, $result);\n }",
"function test_save()\n {\n //Arrange\n $cuisine_type = \"American\";\n $test_cuisine = new Cuisine($cuisine_type);\n\n //Act\n $test_cuisine->save();\n\n //Assert\n $result = Cuisine::getAll();\n $this->assertEquals($test_cuisine, $result[0]);\n }",
"function test_setId()\n {\n //Arrange\n $id = 1;\n $name = \"Dansko\";\n $test_brand = new Brand($name, $id);\n\n //Act\n $test_brand->setId(2);\n\n //Assert\n $result = $test_brand->getId();\n $this->assertEquals(2, $result);\n }",
"public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\n\t\t$this->stubedProtein->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedProtein->getId () );\n\t}",
"public function testGettingById()\n {\n $this->repo->add($this->entity1);\n $this->unitOfWork->commit();\n $this->assertEquals($this->entity1, $this->repo->getById($this->entity1->getId()));\n }",
"function testGetId()\n {\n //Arrange\n $id = 1;\n $number = 909098;\n $name = \"BIO423\";\n $test_class = new Course($name, $id, $number);\n //Act\n $result = $test_class->getId();\n //Assert\n $this->assertEquals(1, $result);\n }",
"public function getId(): int;",
"public function getId(): int;",
"public function getId(): int;",
"public function getId(): int;",
"public function getId(): int\n {\n }",
"public function testIdValue()\n {\n $this->assertInstanceOf(Customer::class, $this->entity->setId(1));\n $this->assertTrue(is_int($this->entity->getId()));\n }",
"public function testSalesOpportunitiesTypesIdGet()\n {\n\n }",
"public function testUsersIdPut()\n {\n\n }",
"public function testUsersIdGet()\n {\n\n }",
"public function testId()\n {\n $obj_doc = new \\Search\\Document();\n $obj_doc2 = $obj_doc->setId('121gw');\n $this->assertEquals('121gw', $obj_doc->getId());\n $this->assertSame($obj_doc, $obj_doc2);\n }",
"public function testSetAndGetId(){\n $id = 1;\n $this->recipe->setId($id);\n $this->assertEquals($this->recipe->getId(), $id);\n }",
"function testSetId()\n {\n //Arrange\n $id = 1;\n $number = 909098;\n $name = \"BIO423\";\n $test_class = new Course($name, $id, $number);\n //Act\n $test_class->setId(2);\n //Assert\n $result = $test_class->getId();\n $this->assertEquals(2, $result);\n }",
"function findByIdTest()\n {\n $productDao = new ProductDao();\n return $productDao->findById(2);\n }",
"public function testSalesOpportunitiesTypesIdPatch()\n {\n\n }",
"public function getWithId()\n {\n }",
"public function testId(){\n $this->noteBean->setId(1);\n $this->assertEquals(1, $this->noteBean->getId());\n }",
"public function testEntryById()\n {\n }",
"public function testSalesOpportunitiesTypesIdPut()\n {\n\n }",
"abstract public function getId();",
"abstract public function getId();"
] | [
"0.6702551",
"0.6614732",
"0.6574701",
"0.6495492",
"0.6401167",
"0.6370419",
"0.6339058",
"0.62498605",
"0.61545074",
"0.61541337",
"0.61197066",
"0.61197066",
"0.61197066",
"0.61197066",
"0.6110916",
"0.610317",
"0.60804814",
"0.60731494",
"0.6064817",
"0.60353464",
"0.6027931",
"0.59647864",
"0.596346",
"0.59598196",
"0.59575516",
"0.59539497",
"0.5946213",
"0.5940076",
"0.59332126",
"0.59332126"
] | 0.6863198 | 0 |
Remove the default post type from menu | public static function remove_default_post_type() {
remove_menu_page('edit.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function remove_default_post_type_menu_bar($wp_admin_bar) {\n\t\t$wp_admin_bar->remove_node('new-post');\n\t}",
"public function sr_remove_posts_menu()\n\t\t{\n\t\t\tremove_menu_page('edit.php');\n\t\t}",
"function remove_menus()\n{\n remove_menu_page('edit-tags.php?taxonomy=category'); // Post tags\n remove_menu_page('edit-tags.php?taxonomy=post_tag'); // Post tags\n}",
"function remove_hide_posts_wp_menu() {\n remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=hide_posts' );\n remove_submenu_page( 'edit.php?post_type=ibm_news', 'edit-tags.php?taxonomy=hide_posts&post_type=ibm_news' );\n}",
"function remove_menu_items() {\n remove_menu_page('edit.php'); // Posts\n}",
"function admin_menu() {\n\t// New pledges should only be created through the front end form.\n\tremove_submenu_page( 'edit.php?post_type=' . CPT_ID, 'post-new.php?post_type=' . CPT_ID );\n}",
"public function hide_add_new_custom_type() {\n\t\tglobal $submenu;\n\t\t// replace my_type with the name of your post type\n\t\tunset($submenu['edit.php?post_type=insta'][10]);\n\t}",
"function post_remove(){\n // remove_menu_page( 'jetpack' ); //Jetpack* \n remove_menu_page( 'edit.php' ); //Posts\n // remove_menu_page( 'upload.php' ); //Media\n // remove_menu_page( 'edit.php?post_type=page' ); //Pages\n remove_menu_page( 'edit-comments.php' ); //Comments\n // remove_menu_page( 'themes.php' ); //Appearance\n // remove_menu_page( 'plugins.php' ); //Plugins\n // remove_menu_page( 'users.php' ); //Users\n // remove_menu_page( 'tools.php' ); //Tools\n // remove_menu_page( 'options-general.php' ); //Settings\n }",
"function remove_acf(){\n remove_menu_page( 'edit.php?post_type=acf' ); \n}",
"public function trainee_remove_default_post_type($args, $postType)\n {\n if ($postType === 'post' || $postType === 'comments') {\n $args['public'] = false;\n $args['show_ui'] = false;\n $args['show_in_menu'] = false;\n $args['show_in_admin_bar'] = false;\n $args['show_in_nav_menus'] = false;\n $args['can_export'] = false;\n $args['has_archive'] = false;\n $args['exclude_from_search'] = true;\n $args['publicly_queryable'] = false;\n $args['show_in_rest'] = false;\n }\n\n return $args;\n }",
"function removeDefaultCustomFields( $type, $context, $post ) {\n foreach (['normal', 'advanced', 'side'] as $context )\n foreach ( $this->postTypes as $postType )\n remove_meta_box( 'postcustom', $postType, $context );\n }",
"function grg_remove_menu_items(){\n\n\t\t\tremove_menu_page( 'edit-comments.php' ); // Posts\n\t\t\t// remove_menu_page( 'users.php'); // Users\n\t}",
"function removePostLabel()\n {\n remove_menu_page('edit.php');\n }",
"function deact_post_type_ui()\r\n\t{\r\n\t\tflush_rewrite_rules();\r\n\t}",
"function removeDefaultCustomFields( $type, $context, $post ) {\n foreach ( array( 'normal', 'advanced', 'side' ) as $context ) {\n foreach ( $this->postTypes as $postType ) {\n remove_meta_box( 'postcustom', $postType, $context );\n }\n }\n }",
"function plume_remove_admin_menu () {\n\tremove_menu_page('edit-comments.php');\n\tremove_menu_page('edit.php');\n\tremove_menu_page('edit.php?post_type=page');\n}",
"function wpdocs_remove_menus()\n{\n\n\tif (!current_user_can('update_plugins')) {\n\t\tremove_menu_page('edit.php?post_type=mitra');\n\t\tremove_menu_page('edit.php?post_type=kkn');\n\t\tremove_menu_page('edit-comments.php');\n\t\tremove_menu_page('edit.php');\n\t\tremove_menu_page('tools.php');\n\t}\n}",
"function hide_menu_items() {\t\t\t//remove_menu_page( 'edit.php?post_type=team' );\n\n \t\t\t// Jobs: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=jobs' );\n\n\t\t\t// Clients: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=clients' );\n\n\t\t\t// Portfolio: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=portfolio' );\n\n\t\t\t// Testiminials: We are using this on the HP\n\t\t\t//remove_menu_page( 'edit.php?post_type=testimonials' );\n\n\t\t\t// FAQ: we are not using but we may should be\n\t\t\tremove_menu_page( 'edit.php?post_type=faqs' );\n\n\t\t\t// There are no posts that allow commenting\n\t\t\tremove_menu_page( 'edit-comments.php' );\n\t\t}",
"function post_remove() { \n\n remove_menu_page('edit.php');\n\n}",
"function remove_acf_menu() {\n remove_menu_page('edit.php?post_type=acf-field-group');\n }",
"function landtalk_remove_unused_menu_options() {\n\tremove_menu_page( 'edit.php' ); // Removes Posts.\n\tremove_menu_page( 'edit-comments.php' ); // Removes Comments.\n}",
"function remove_menus() {\n\tremove_menu_page( 'edit.php?post_type=page' ); // Pages\n\tremove_menu_page( 'edit-comments.php' ); // Comments\n\tremove_menu_page( 'themes.php' ); // Appearance\n\tremove_menu_page( 'tools.php' ); //Tools\n\tremove_menu_page( 'options-permalink.php' ); // Permalinks\n\tremove_menu_page( 'options-discussion.php' ); // Discussion\n\tremove_menu_page( 'options-reading.php' ); // Reading\n\tremove_menu_page( 'edit.php?post_type=acf-field-group' ); // Reading\n}",
"function strl_remove_menus() {\n\t// ACF Settings.\n\tremove_menu_page( 'edit.php?post_type=acf-field-group' );\n\n\t// Comments.\n\tremove_menu_page( 'edit-comments.php' );\n}",
"function remove_editor_menu() {\n remove_action('admin_menu', '_add_themes_utility_last', 101);\n}",
"function ecovila_remove_menu_pages()\n{\n remove_menu_page('edit.php'); //Posts\n remove_menu_page('edit-comments.php'); //Comments \n}",
"function remove_menus(){\n remove_menu_page( 'edit.php' ); //Posts\n remove_menu_page( 'edit-comments.php' ); //Comments\n}",
"function aitMenuPostType()\n{\n\tregister_post_type( 'ait-menu',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name'\t\t\t=> MENU_CT_NAME.'s',\n\t\t\t\t'singular_name' => MENU_CT_NAME,\n\t\t\t\t'add_new'\t\t=> 'Add new',\n\t\t\t\t'add_new_item'\t=> 'Add new '.strtolower(MENU_CT_NAME),\n\t\t\t\t'edit_item'\t\t=> 'Edit '.strtolower(MENU_CT_NAME),\n\t\t\t\t'new_item'\t\t=> 'New '.strtolower(MENU_CT_NAME),\n\t\t\t\t'not_found'\t\t=> 'No '.strtolower(MENU_CT_NAME).'s found',\n\t\t\t\t'not_found_in_trash' => 'No '.strtolower(MENU_CT_NAME).'s found in Trash',\n\t\t\t\t'menu_name'\t\t=> MENU_CT_NAME.'s',\n\t\t\t),\n\t\t\t'description' => 'Manipulating with '.strtolower(MENU_CT_NAME).'s',\n\t\t\t'public' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'page-attributes',\n\t\t\t\t'comments',\n\t\t\t\t'tags',\n\t\t\t),\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_icon' => AIT_FRAMEWORK_URL . '/CustomTypes/menu/menu.png',\n\t\t\t'menu_position' => $GLOBALS['aitThemeCustomTypes']['menu'],\n\t\t\t'has_archive' => 'menus',\n\t\t\t'query_var' => 'menu',\n\t\t\t'rewrite' => array('slug' => 'menu'),\n\t\t)\n\t);\n\taitMenuTaxonomies();\n\n flush_rewrite_rules(false);\n}",
"function flt_admin_bar_menu( &$bar ) {\n\t\tif ( is_content_administrator_rs() )\n\t\t\treturn;\n\n\t\t$type = 'new-content';\n\t\t\t\n\t\tforeach( get_post_types( array( 'public' => true ), 'object' ) as $_post_type => $type_obj ) {\n\t\t\t$var = 'new-' . $_post_type;\n\t\t\t\n\t\t\tif ( isset( $bar->menu->{$type}['children']->{$var} ) ) {\n\t\t\t\tif ( ! cr_user_can( $type_obj->cap->edit_posts, 0, 0, array('skip_id_generation' => true, 'skip_any_object_check' => true ) ) )\n\t\t\t\t\tunset( $bar->menu->{$type}['children']->{$var} );\n\t\t\t}\n\t\t}\n\t}",
"function remove_editor_menu()\n\t{\n\t\t//remove_action('admin_menu', '_add_themes_utility_last', 101);\n\t}",
"function remove_menus() {\nremove_menu_page( 'edit.php' ); //Posts\nremove_menu_page( 'edit-comments.php' ); //Comments\n}"
] | [
"0.7530687",
"0.72479177",
"0.7164135",
"0.7131323",
"0.7107804",
"0.70952",
"0.70824546",
"0.7064912",
"0.69640744",
"0.6944146",
"0.6906804",
"0.6899749",
"0.6897163",
"0.68883944",
"0.68697435",
"0.68350625",
"0.67570186",
"0.6729462",
"0.6725591",
"0.67091954",
"0.6682749",
"0.6660066",
"0.6642841",
"0.6606089",
"0.6587803",
"0.65657055",
"0.6564636",
"0.6545025",
"0.65411377",
"0.6538873"
] | 0.907208 | 0 |
Remove the default post type from menu bar | public static function remove_default_post_type_menu_bar($wp_admin_bar) {
$wp_admin_bar->remove_node('new-post');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function remove_default_post_type() {\n\t\tremove_menu_page('edit.php');\n\t}",
"function remove_hide_posts_wp_menu() {\n remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=hide_posts' );\n remove_submenu_page( 'edit.php?post_type=ibm_news', 'edit-tags.php?taxonomy=hide_posts&post_type=ibm_news' );\n}",
"function remove_menus()\n{\n remove_menu_page('edit-tags.php?taxonomy=category'); // Post tags\n remove_menu_page('edit-tags.php?taxonomy=post_tag'); // Post tags\n}",
"public function sr_remove_posts_menu()\n\t\t{\n\t\t\tremove_menu_page('edit.php');\n\t\t}",
"public function hide_add_new_custom_type() {\n\t\tglobal $submenu;\n\t\t// replace my_type with the name of your post type\n\t\tunset($submenu['edit.php?post_type=insta'][10]);\n\t}",
"function admin_menu() {\n\t// New pledges should only be created through the front end form.\n\tremove_submenu_page( 'edit.php?post_type=' . CPT_ID, 'post-new.php?post_type=' . CPT_ID );\n}",
"function post_remove(){\n // remove_menu_page( 'jetpack' ); //Jetpack* \n remove_menu_page( 'edit.php' ); //Posts\n // remove_menu_page( 'upload.php' ); //Media\n // remove_menu_page( 'edit.php?post_type=page' ); //Pages\n remove_menu_page( 'edit-comments.php' ); //Comments\n // remove_menu_page( 'themes.php' ); //Appearance\n // remove_menu_page( 'plugins.php' ); //Plugins\n // remove_menu_page( 'users.php' ); //Users\n // remove_menu_page( 'tools.php' ); //Tools\n // remove_menu_page( 'options-general.php' ); //Settings\n }",
"function remove_menu_items() {\n remove_menu_page('edit.php'); // Posts\n}",
"function removePostLabel()\n {\n remove_menu_page('edit.php');\n }",
"function remove_acf(){\n remove_menu_page( 'edit.php?post_type=acf' ); \n}",
"public function trainee_remove_default_post_type($args, $postType)\n {\n if ($postType === 'post' || $postType === 'comments') {\n $args['public'] = false;\n $args['show_ui'] = false;\n $args['show_in_menu'] = false;\n $args['show_in_admin_bar'] = false;\n $args['show_in_nav_menus'] = false;\n $args['can_export'] = false;\n $args['has_archive'] = false;\n $args['exclude_from_search'] = true;\n $args['publicly_queryable'] = false;\n $args['show_in_rest'] = false;\n }\n\n return $args;\n }",
"function grg_remove_menu_items(){\n\n\t\t\tremove_menu_page( 'edit-comments.php' ); // Posts\n\t\t\t// remove_menu_page( 'users.php'); // Users\n\t}",
"function hide_menu_items() {\t\t\t//remove_menu_page( 'edit.php?post_type=team' );\n\n \t\t\t// Jobs: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=jobs' );\n\n\t\t\t// Clients: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=clients' );\n\n\t\t\t// Portfolio: not using\n\t\t\tremove_menu_page( 'edit.php?post_type=portfolio' );\n\n\t\t\t// Testiminials: We are using this on the HP\n\t\t\t//remove_menu_page( 'edit.php?post_type=testimonials' );\n\n\t\t\t// FAQ: we are not using but we may should be\n\t\t\tremove_menu_page( 'edit.php?post_type=faqs' );\n\n\t\t\t// There are no posts that allow commenting\n\t\t\tremove_menu_page( 'edit-comments.php' );\n\t\t}",
"function flt_admin_bar_menu( &$bar ) {\n\t\tif ( is_content_administrator_rs() )\n\t\t\treturn;\n\n\t\t$type = 'new-content';\n\t\t\t\n\t\tforeach( get_post_types( array( 'public' => true ), 'object' ) as $_post_type => $type_obj ) {\n\t\t\t$var = 'new-' . $_post_type;\n\t\t\t\n\t\t\tif ( isset( $bar->menu->{$type}['children']->{$var} ) ) {\n\t\t\t\tif ( ! cr_user_can( $type_obj->cap->edit_posts, 0, 0, array('skip_id_generation' => true, 'skip_any_object_check' => true ) ) )\n\t\t\t\t\tunset( $bar->menu->{$type}['children']->{$var} );\n\t\t\t}\n\t\t}\n\t}",
"function deact_post_type_ui()\r\n\t{\r\n\t\tflush_rewrite_rules();\r\n\t}",
"function plume_remove_admin_menu () {\n\tremove_menu_page('edit-comments.php');\n\tremove_menu_page('edit.php');\n\tremove_menu_page('edit.php?post_type=page');\n}",
"function landtalk_remove_unused_menu_options() {\n\tremove_menu_page( 'edit.php' ); // Removes Posts.\n\tremove_menu_page( 'edit-comments.php' ); // Removes Comments.\n}",
"function wpdocs_remove_menus()\n{\n\n\tif (!current_user_can('update_plugins')) {\n\t\tremove_menu_page('edit.php?post_type=mitra');\n\t\tremove_menu_page('edit.php?post_type=kkn');\n\t\tremove_menu_page('edit-comments.php');\n\t\tremove_menu_page('edit.php');\n\t\tremove_menu_page('tools.php');\n\t}\n}",
"function thistle_remove_admin_bar_archive_node() {\n global $wp_admin_bar;\n\n $wp_admin_bar->remove_menu( 'archive' );\n }",
"function remove_menus() {\n\tremove_menu_page( 'edit.php?post_type=page' ); // Pages\n\tremove_menu_page( 'edit-comments.php' ); // Comments\n\tremove_menu_page( 'themes.php' ); // Appearance\n\tremove_menu_page( 'tools.php' ); //Tools\n\tremove_menu_page( 'options-permalink.php' ); // Permalinks\n\tremove_menu_page( 'options-discussion.php' ); // Discussion\n\tremove_menu_page( 'options-reading.php' ); // Reading\n\tremove_menu_page( 'edit.php?post_type=acf-field-group' ); // Reading\n}",
"function removeDefaultCustomFields( $type, $context, $post ) {\n foreach (['normal', 'advanced', 'side'] as $context )\n foreach ( $this->postTypes as $postType )\n remove_meta_box( 'postcustom', $postType, $context );\n }",
"public function hide_custom_post_types(){\n $agency_options = get_option('agency_settings');\n if(isset($agency_options)) {\n $website_use = (isset($agency_options['website_use'])?$agency_options['website_use']:null);\n $all_posttypes = Common::getExperiensCPT();\n $to_hide = array();\n if (isset($website_use)) {\n $posttypes = array();\n switch ($website_use) {\n case 'travel':\n $posttypes = $agency_options['travel_agency_posttypes'];\n break;\n case 'hotel':\n $posttypes = $agency_options['hotel_posttypes'];\n break;\n default:\n $posttypes = $agency_options['tourist_office_posttypes'];\n break;\n }\n $to_hide = array_diff($all_posttypes, $posttypes);\n }\n foreach ($to_hide as $value) {\n if (post_type_exists($value))\n remove_menu_page('edit.php?post_type=' . $value);\n }\n }\n }",
"function ecovila_remove_menu_pages()\n{\n remove_menu_page('edit.php'); //Posts\n remove_menu_page('edit-comments.php'); //Comments \n}",
"function remove_acf_menu() {\n remove_menu_page('edit.php?post_type=acf-field-group');\n }",
"function post_remove() { \n\n remove_menu_page('edit.php');\n\n}",
"function removeDefaultCustomFields( $type, $context, $post ) {\n foreach ( array( 'normal', 'advanced', 'side' ) as $context ) {\n foreach ( $this->postTypes as $postType ) {\n remove_meta_box( 'postcustom', $postType, $context );\n }\n }\n }",
"function strl_remove_menus() {\n\t// ACF Settings.\n\tremove_menu_page( 'edit.php?post_type=acf-field-group' );\n\n\t// Comments.\n\tremove_menu_page( 'edit-comments.php' );\n}",
"function remove_menus(){\n remove_menu_page( 'edit.php' ); //Posts\n remove_menu_page( 'edit-comments.php' ); //Comments\n}",
"function wpdocs_remove_menus(){\n\n //remove_menu_page( 'index.php' ); //Dashboard\n //remove_menu_page( 'jetpack' ); //Jetpack*\n //remove_menu_page( 'edit.php' ); //Posts\n //remove_menu_page( 'upload.php' ); //Media\n //remove_menu_page( 'edit.php?post_type=page' ); //Pages\n remove_menu_page( 'edit-comments.php' ); //Comments\n //remove_menu_page( 'themes.php' ); //Appearance\n //remove_menu_page( 'plugins.php' ); //Plugins\n //remove_menu_page( 'users.php' ); //Users\n //remove_menu_page( 'tools.php' ); //Tools\n //remove_menu_page( 'options-general.php' ); //Settings\n\n}",
"function remove_menus() {\nremove_menu_page( 'edit.php' ); //Posts\nremove_menu_page( 'edit-comments.php' ); //Comments\n}"
] | [
"0.8893702",
"0.7306851",
"0.723004",
"0.7226405",
"0.71490765",
"0.7101017",
"0.7070469",
"0.7026078",
"0.6991826",
"0.6947149",
"0.69358516",
"0.690529",
"0.69044363",
"0.68922716",
"0.6866296",
"0.6787023",
"0.67844355",
"0.67509985",
"0.66714585",
"0.6656957",
"0.66378534",
"0.66245925",
"0.6617492",
"0.66116697",
"0.6593344",
"0.6591407",
"0.65873826",
"0.6582386",
"0.6557798",
"0.65485173"
] | 0.7749307 | 1 |
Remove the comments tab from menu bar | public static function remove_comments_menu_bar() {
remove_menu_page('edit-comments.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function df_disable_comments_admin_menu() {\n\t remove_menu_page('edit-comments.php');\n\t remove_menu_page('edit.php');\n\t}",
"function remove_menu_from_admin() {\n\t\tremove_menu_page('edit-comments.php');\n\t}",
"function df_disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n}",
"function df_disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n}",
"function df_disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n}",
"function clus_disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n}",
"function df_disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n\tremove_submenu_page( 'options-general.php', 'options-discussion.php' );\n}",
"public function onWPAdminMenu()\n {\n // Disable comments\n remove_menu_page('edit-comments.php');\n }",
"function dez_remove_comments_link_top_bar() {\n\n\tglobal $wp_admin_bar;\n\n\t$wp_admin_bar->remove_menu('comments');\n}",
"public function disable_comments_admin_menu() {\n remove_menu_page('edit-comments.php');\n remove_submenu_page('options-general.php', 'options-discussion.php');\n}",
"function disable_comments_admin_menu() {\n\tremove_menu_page('edit-comments.php');\n}",
"function turnerbatson_disable_comments_admin_menu() {\n\tremove_menu_page( 'edit-comments.php' );\n}",
"public function lctrainee_comments_remove_admin_menus()\n {\n remove_menu_page( 'edit-comments.php' );\n }",
"function qod_remove_admin_menus() {\n remove_menu_page( 'edit-comments.php' );\n}",
"public function remove_admin_bar_items() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu(\"comments\");\n }",
"function clus_admin_bar_render() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('comments');\n}",
"public function remove_menu_items() {\n remove_menu_page(\"edit-comments.php\");\n remove_menu_page(\"edit.php\");\n }",
"function customize_menu() {\n\t\tremove_menu_page('edit.php');\n\t\tremove_menu_page('edit-comments.php');\n\t}",
"function qod_admin_bar_render() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('comments');\n}",
"function mytheme_admin_bar_render() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('comments');\n}",
"function remove_menus(){\r\n\t \r\n\t remove_menu_page( 'edit-comments.php' ); //Comments\r\n\t \r\n\t}",
"function my_admin_bar_render() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('comments');\n}",
"function plume_admin_bar_render() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->remove_menu('comments');\n}",
"function grg_remove_menu_items(){\n\n\t\t\tremove_menu_page( 'edit-comments.php' ); // Posts\n\t\t\t// remove_menu_page( 'users.php'); // Users\n\t}",
"function ilusix_remove_backend_menu_items() {\n remove_menu_page( 'edit.php' );\n remove_menu_page( 'edit-comments.php' );\n}",
"function remove_admin_menus()\n{\n\n remove_menu_page('edit-comments.php');\n\n}",
"public function remove_admin_menus() {\n\t\tremove_menu_page( 'edit-comments.php' );\n\t}",
"function remove_menus(){\n\n remove_menu_page( 'edit-comments.php' ); //Comments\n\n}",
"function style_remove_new_menu() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('new-content'); // This removes the complete menu “Add New”.\n $wp_admin_bar->remove_menu('comments'); // This removes the comments link\n}",
"function sandbox_admin_bar_render() {\n global $wp_admin_bar;\n $wp_admin_bar->remove_menu('comments');\n}"
] | [
"0.782524",
"0.7824328",
"0.7801337",
"0.7801337",
"0.7801337",
"0.77906597",
"0.7760185",
"0.7759126",
"0.7754832",
"0.77526706",
"0.77009684",
"0.76916045",
"0.76223284",
"0.76049453",
"0.7592376",
"0.75578433",
"0.7549573",
"0.75451845",
"0.7534322",
"0.748151",
"0.7479428",
"0.7461551",
"0.7440792",
"0.74226934",
"0.741109",
"0.7376045",
"0.7335067",
"0.73137796",
"0.7305602",
"0.72724617"
] | 0.86220384 | 0 |
Remove the new post link in Admin Bar | public static function remove_add_new_post_admin_bar() {
?>
<script type="text/javascript">
function remove_add_new_post_admin_bar() {
var add_new = document.getElementById('wp-admin-bar-new-content');
if(!add_new) return;
var add_new_a = add_new.getElementsByTagName('a')[0];
if(add_new_a) add_new_a.setAttribute('href','#!');
}
remove_add_new_post_admin_bar();
</script>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function muiteer_remove_new_link_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-link');\n }",
"function muiteer_remove_new_link_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-link');\n }",
"function muiteer_remove_new_post_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-post');\n }",
"function muiteer_remove_new_post_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-post');\n }",
"function zaxu_remove_new_link_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-link');\n }",
"function zaxu_remove_new_post_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-post');\n }",
"function zaxu_remove_new_link_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-link');\n }",
"function zaxu_remove_new_post_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-post');\n }",
"function removePostLabel()\n {\n remove_menu_page('edit.php');\n }",
"function remove_edit_post_link($link) {\n return '';\n }",
"function dtp_remove_delete_link() {\n\tglobal $pagenow, $post;\n\t\n\tif (!$post) return;\n\t\n\tif ( $pagenow == 'post.php' && is_default_page($post) ) {\n\t\techo \"<!-- DTP remove delete link -->\" . PHP_EOL;\n\t\techo \"<style type=\\\"text/css\\\" media=\\\"screen\\\">\" . PHP_EOL;\n\t\techo \"\t#misc-publishing-actions > .misc-pub-section:first-child, #delete-action { display: none !important}\" . PHP_EOL;\n\t\techo \"</style>\" . PHP_EOL;\n\t}\n}",
"function remove_edit_post_link($link) {\n return '';\n }",
"function muiteer_remove_new_page_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-page');\n }",
"function muiteer_remove_new_page_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-page');\n }",
"function zaxu_remove_new_page_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-page');\n }",
"function zaxu_remove_new_page_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-page');\n }",
"function admin_menu() {\n\t// New pledges should only be created through the front end form.\n\tremove_submenu_page( 'edit.php?post_type=' . CPT_ID, 'post-new.php?post_type=' . CPT_ID );\n}",
"function remove_wp_nodes() {\r\n global $wp_admin_bar;\r\n $wp_admin_bar->remove_node( 'new-post' );\r\n $wp_admin_bar->remove_node( 'new-link' );\r\n // $wp_admin_bar->remove_node( 'new-media' );\r\n}",
"function capweb_admin_bar_items() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\n}",
"function be_admin_bar_items() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\n}",
"function be_admin_bar_items() {\n\tglobal $wp_admin_bar;\n\t$wp_admin_bar->remove_menu( 'new-link', 'new-content' );\n}",
"public function sr_remove_posts_menu()\n\t\t{\n\t\t\tremove_menu_page('edit.php');\n\t\t}",
"function post_remove() { \n\n remove_menu_page('edit.php');\n\n}",
"function admin_remove() { return; }",
"function naph_admin_actions_register_menu()\n{\n add_options_page(\"Newly Added Post Highliter\", \"New Post Highliter\", 'manage_options', \"naph\", \"naph_admin_page\");\n}",
"function wpu_newposts_link() {\n\techo get_wpu_newposts_link();\n}",
"private function deletePostPermanently() {\n // The CSS selector for 'Delete Permanently' is actually exactly the same as when trashing\n // the post, so is the update message, so we just use that method internally\n $this->trashPost();\n }",
"public static function remove_default_post_type_menu_bar($wp_admin_bar) {\n\t\t$wp_admin_bar->remove_node('new-post');\n\t}",
"function remove_menu_items() {\n remove_menu_page('edit.php'); // Posts\n}",
"function muiteer_remove_new_portfolio_item() {\n global $wp_admin_bar; \n $wp_admin_bar->remove_node('new-portfolio');\n }"
] | [
"0.7708157",
"0.76989913",
"0.76437163",
"0.7629703",
"0.76153755",
"0.7581203",
"0.75764835",
"0.7544277",
"0.7280692",
"0.7221793",
"0.7194154",
"0.71670806",
"0.7113449",
"0.7098377",
"0.70454",
"0.6995117",
"0.6927515",
"0.6808349",
"0.668453",
"0.661451",
"0.661451",
"0.65995675",
"0.65392226",
"0.650866",
"0.6490755",
"0.6447289",
"0.637781",
"0.635489",
"0.6352415",
"0.63468343"
] | 0.8047479 | 0 |
Add Google Tag Manager | public static function add_gtm_script() {
$GTM_ID = env('GTM_CONTAINER_ID') ?: null;
if ($GTM_ID) {
if ((!defined('WP_ENV') || \WP_ENV === 'production') &&
!current_user_can('manage_options')) { ?>
<script nonce="<?= wp_create_nonce(); ?>">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','<?= $GTM_ID; ?>');
</script>
<?php } else { ?>
<script nonce="<?= wp_create_nonce(); ?>">console.log('Google Tag Manager Container: <?= $GTM_ID; ?>');</script>
<?php }
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_google_tag_manager_code(){\n?>\n\n<noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-P48CTBL\"\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\n\n<?php \n}",
"public function loadGoogleTagManagerHead()\n {\n if($this->environment === \"production\" && isset($this->gjOptions->google_tag_manager) && $this->gjOptions->google_tag_manager) {\n echo \"\n <!-- Google Tag Manager -->\n <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','\" .$this->gjOptions->google_tag_manager. \"');</script>\n <!-- End Google Tag Manager -->\n \";\n }\n }",
"function insert_gtm_head() {\n ?>\n <!-- Google Tag Manager -->\n <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','GTM-TTR686');</script>\n <!-- End Google Tag Manager -->\n <?php\n }",
"public static function add_gtag_script() {\n\t\t$gtag_id = isset($_SERVER['GTAG_ID']) ? $_SERVER['GTAG_ID'] : null;\n\n\t\tif ($gtag_id) {\n\t\t\tif ((!defined('WP_ENV') || \\WP_ENV === 'production') &&\n\t\t\t\t!current_user_can('manage_options')) { ?>\n\t\t\t\t<script async src=\"https://www.googletagmanager.com/gtag/js?id=<?= $gtag_id; ?>\"></script>\n\t\t\t\t<script>\n\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\tgtag('config', '<?= $gtag_id; ?>', {'anonymize_ip': true});\n\t\t\t\t</script>\n\t\t\t<?php } else { ?>\n\t\t\t\t<script>console.log('Google Analytics Measurement ID: <?= $gtag_id; ?>');</script>\n\t\t\t<?php }\n\t\t}\n\t}",
"function ws_tags_add($params, &$service)\n{\n include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');\n\n $creation_output = create_tag($params['name']);\n\n if (isset($creation_output['error']))\n {\n return new PwgError(WS_ERR_INVALID_PARAM, $creation_output['error']);\n }\n\n pwg_activity('tag', $creation_output['id'], 'add');\n\n $query = '\nSELECT name, url_name \nFROM `'.TAGS_TABLE.'`\nWHERE id = '.$creation_output['id'].';';\n\n$new_tag = query2array($query);\n\n return array(\n 'info' => $creation_output['info'],\n 'id' => $creation_output['id'],\n 'name' => $new_tag[0]['name'],\n 'url_name' => $new_tag[0]['url_name']\n );\n}",
"public function addTag($tag);",
"function add_gtm_head() {\n\t\t$tag_manager_code = \\trends\\helper\\utils::get_option( 'tag_manager_code', '' );\n\t\t$site_url = get_site_url();\n\n\t\tif (!empty($tag_manager_code) && strpos($site_url, 'wpengine.com') === false) {\n\n\t\t\tTrends()->view->load( '/template-parts/tgm', array('head' => true, 'tag_manager_code' => $tag_manager_code) );\n\n\t\t}\n\t}",
"public function addTag(string $tag): void;",
"function exa_register_google_analytics() {\n\n\t$js = <<<\"GTAG\"\n\n\t<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-2337436-1\"></script>\n\t<script>\n\t\twindow.dataLayer = window.dataLayer || [];\n\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\tgtag('js', new Date());\n\t\tgtag('config', 'UA-2337436-1');\n\n\t\tgtag('config', 'UA-2337436-1', {\n\t\t\t'custom_map': {\n\t\t\t\t'dimension1': 'days_old',\n\t\t\t}\n\t\t});\n\nGTAG;\n\n\t$days_old = ( current_time('timestamp') - get_the_time('U') ) / ( 24 * 60 * 60 );\n\t$days_old = intval($days_old);\n\t$js .= \"\\t\\tgtag('event', 'load', { 'days_old': $days_old });\";\n\t$js .= \"\\t</script>\";\n\t\n\techo $js;\n\n}",
"public function addTag($tag) \n {\n $this->tags[] = $tag; \n }",
"private function set_google_code() {\n\t\t$this->js[] = \"(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\";\n\t}",
"public function getGTMCode()\r\n\t{\r\n\t\t$gtm_code = Config::get('enterpriseCore.google_tag_manager_code');\r\n\t\t\r\n\t\tif (!$gtm_code) {\r\n\t\t\treturn '<!-- no google tag manager code defined -->';\r\n\t\t}\r\n\r\n\t\treturn \"<noscript><iframe src=\\\"//www.googletagmanager.com/ns.html?id={$gtm_code}\\\" height=\\\"0\\\" width=\\\"0\\\" style=\\\"display:none;visibility:hidden\\\"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{$gtm_code}');</script>\";\r\n\t}",
"public function loadGoogleTagManagerBody()\n {\n if($this->environment === \"production\" && isset($this->gjOptions->google_tag_manager) && $this->gjOptions->google_tag_manager) {\n echo '\n <!-- Google Tag Manager (noscript) -->\n <noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id='.$this->gjOptions->google_tag_manager.'\"\n height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\n <!-- End Google Tag Manager (noscript) -->\n ';\n }\n }",
"function google_analytics()\n{\n ?>\n <!-- Global site tag (gtag.js) - Google Analytics -->\n <script async src=\"https://www.googletagmanager.com/gtag/js?id=YOUR_SITE_ID\"></script>\n <script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', 'ID');\n </script>\n <?php\n}",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"public function addTag($tag)\n {\n $this->tags[] = $tag;\n }",
"function add_google_analytics() { ?>\n <!-- Insert the Google code here -->\n<?php }",
"public function addTags($tag_ids = array())\n {\n $this->data['Tag']['Tag'] = $tag_ids;\n }",
"function video_addTag($videoid=null,$sessionid=null,$newtag=null) {\n \n $videodetails = $this->video_details($videoid,$sessionid);\n \n if (is_array($videodetails['video']['tags']['global']) && count($videodetails['video']['tags']['global']) > 1) {\n for ($i=0;$i<count($videodetails['video']['tags']['global']);$i++) {\n $videodetails['video']['tags']['global'][$i] = '\"'.$videodetails['video']['tags']['global'][$i].'\"';\n }\n $tags = implode(\",\",$videodetails['video']['tags']['global']);\n } else {\n $tags = $videodetails['video']['tags']['global'];\n }\n \n if ($tags == '') {\n $tags = $newtag;\n } else {\n $tags .= ','.$newtag;\n }\n \n $newvideodetails = $this->video_setdetails(array('video_id'=>$videoid,'sessionid'=>$sessionid,'tags'=>$tags));\n \n return $newvideodetails;\n \n }",
"public function addTag($tag) {\n $this->changes[] = [\n 'type' => 'tag',\n 'add' => $tag\n ];\n }",
"private function addTag(Tag $tag): void\n {\n $this->tags[] = $tag;\n }",
"public static function add_tag($name)\n\t{\n\t\t// Get or create the GUID for the tag.\n\t\t$guid = self::new_tag(trim($name));\n\t\tself::$_tags[] = trim($name);\n\t}",
"public function addTag($tag) {\n $this->tag[] = strtolower($tag);\n }",
"public function addTags(): void\n {\n $tags = $this->getTags();\n $currentStructureUuid = $this->getCurrentStructureUuid();\n if ($currentStructureUuid && !\\in_array($currentStructureUuid, $tags)) {\n $tags[] = $currentStructureUuid;\n }\n\n if (\\count($tags) <= 0) {\n return;\n }\n\n $this->symfonyResponseTagger->addTags($tags);\n }",
"function add_google_analytics() {\n\techo '<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>';\n\techo '<script type=\"text/javascript\">';\n\techo 'var pageTracker = _gat._getTracker(\"UA-64472308-1\");';\n\techo 'pageTracker._trackPageview();';\n\techo '</script>';\n}",
"function setMetaTags() {\n\n }",
"function addTag($tag)\n {\n global $_phpDocumentor_setting;\n if (phpDocumentor_setup::checkIgnoreTag($tag->keyword)) return;\n $value = $tag->value;\n if (is_array($value)) {\n $value = empty($value[0]) ? '' : $value[0];\n }\n if ($tag->keyword == 'uses')\n {\n $this->addUses($value, $tag->_description);\n } else\n {\n $this->addKeyword($tag->keyword, $value);\n }\n }",
"function add_plugin_googleMap($plugin_array) {\n $plugin_array['googleMap'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}",
"function register_googleMap($buttons) {\n array_push($buttons, \"googleMap\"); \n return $buttons; \n}",
"protected function renderGoogleScript()\n {\n if (empty($this->google))\n return '';\n\n return <<<EOT\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=$this->google\"></script>\n<script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '$this->google');\n</script>\nEOT;\n }"
] | [
"0.66987705",
"0.6488449",
"0.6474202",
"0.6326131",
"0.6308478",
"0.6255334",
"0.60854495",
"0.5923086",
"0.5897702",
"0.58537126",
"0.5811468",
"0.5775311",
"0.56464255",
"0.5632027",
"0.5608169",
"0.5608169",
"0.55431086",
"0.55355316",
"0.54857105",
"0.54816",
"0.5475121",
"0.54745924",
"0.5467767",
"0.5462568",
"0.54542047",
"0.545234",
"0.5452034",
"0.5426409",
"0.54249215",
"0.54214257"
] | 0.6715334 | 0 |
/ Add Google Tag Manager (noscript) in body | public static function add_gtm_noscript() {
$GTM_ID = env('GTM_CONTAINER_ID') ?: null;
if ($GTM_ID && (!defined('WP_ENV') || \WP_ENV === 'production') &&
!current_user_can('manage_options')) {
echo '<noscript><iframe src="https://www.googletagmanager.com/ns.html?id='. $GTM_ID .'" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_google_tag_manager_code(){\n?>\n\n<noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-P48CTBL\"\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\n\n<?php \n}",
"public function loadGoogleTagManagerBody()\n {\n if($this->environment === \"production\" && isset($this->gjOptions->google_tag_manager) && $this->gjOptions->google_tag_manager) {\n echo '\n <!-- Google Tag Manager (noscript) -->\n <noscript><iframe src=\"https://www.googletagmanager.com/ns.html?id='.$this->gjOptions->google_tag_manager.'\"\n height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe></noscript>\n <!-- End Google Tag Manager (noscript) -->\n ';\n }\n }",
"public function loadGoogleTagManagerHead()\n {\n if($this->environment === \"production\" && isset($this->gjOptions->google_tag_manager) && $this->gjOptions->google_tag_manager) {\n echo \"\n <!-- Google Tag Manager -->\n <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','\" .$this->gjOptions->google_tag_manager. \"');</script>\n <!-- End Google Tag Manager -->\n \";\n }\n }",
"public static function add_gtm_script() {\n\t\t$GTM_ID = env('GTM_CONTAINER_ID') ?: null;\n\n\t\tif ($GTM_ID) {\n\t\t\tif ((!defined('WP_ENV') || \\WP_ENV === 'production') &&\n\t\t\t\t!current_user_can('manage_options')) { ?>\n\t\t\t\t<script nonce=\"<?= wp_create_nonce(); ?>\">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n\t\t\t\t\tnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n\t\t\t\t\tj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n\t\t\t\t\t'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n\t\t\t\t\t})(window,document,'script','dataLayer','<?= $GTM_ID; ?>');\n\t\t\t\t</script>\n\t\t\t<?php } else { ?>\n\t\t\t\t<script nonce=\"<?= wp_create_nonce(); ?>\">console.log('Google Tag Manager Container: <?= $GTM_ID; ?>');</script>\n\t\t\t<?php }\n\t\t}\n\t}",
"function cs_gallery_noscript() {\n\t?>\n\t<noscript><style>.communityservice-task-gallery{ opacity: 1 !important; }</style></noscript>\n\t<?php\n}",
"function insert_gtm_head() {\n ?>\n <!-- Google Tag Manager -->\n <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','GTM-TTR686');</script>\n <!-- End Google Tag Manager -->\n <?php\n }",
"public function start_hide_form_for_noscript() {\n\n\t\t// Ignore if user is logged in\n\t\tif ( is_user_logged_in() )\n\t\t\treturn;\n\n\t\t// If high spam protection is set, then non JS users are blocked\n\t\tif ( $this->protection == 'high' ) {\n\t\t\techo '<noscript><div style=\"display: none;\"></noscript>';\n\t\t}\n\t}",
"private function hide_noscripts( string $html ): string {\n\t\t$replace = preg_replace( '#<noscript[^>]*>.*?<\\/noscript\\s*>#mis', '', $html );\n\n\t\tif ( null === $replace ) {\n\t\t\treturn $html;\n\t\t}\n\n\t\treturn $replace;\n\t}",
"function add_gtm_head() {\n\t\t$tag_manager_code = \\trends\\helper\\utils::get_option( 'tag_manager_code', '' );\n\t\t$site_url = get_site_url();\n\n\t\tif (!empty($tag_manager_code) && strpos($site_url, 'wpengine.com') === false) {\n\n\t\t\tTrends()->view->load( '/template-parts/tgm', array('head' => true, 'tag_manager_code' => $tag_manager_code) );\n\n\t\t}\n\t}",
"public static function add_gtag_script() {\n\t\t$gtag_id = isset($_SERVER['GTAG_ID']) ? $_SERVER['GTAG_ID'] : null;\n\n\t\tif ($gtag_id) {\n\t\t\tif ((!defined('WP_ENV') || \\WP_ENV === 'production') &&\n\t\t\t\t!current_user_can('manage_options')) { ?>\n\t\t\t\t<script async src=\"https://www.googletagmanager.com/gtag/js?id=<?= $gtag_id; ?>\"></script>\n\t\t\t\t<script>\n\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\tgtag('config', '<?= $gtag_id; ?>', {'anonymize_ip': true});\n\t\t\t\t</script>\n\t\t\t<?php } else { ?>\n\t\t\t\t<script>console.log('Google Analytics Measurement ID: <?= $gtag_id; ?>');</script>\n\t\t\t<?php }\n\t\t}\n\t}",
"protected function renderGoogleScript()\n {\n if (empty($this->google))\n return '';\n\n return <<<EOT\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=$this->google\"></script>\n<script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '$this->google');\n</script>\nEOT;\n }",
"function template_shd_nojs_above()\n{\n\tglobal $txt, $settings;\n\techo '<noscript><div class=\"errorbox\"><img src=\"', $settings['default_images_url'], '/simpledesk/warning.png\" alt=\"*\" class=\"shd_icon_minihead\" /> ', $txt['shd_helpdesk_nojs'], '</div></noscript>';\n}",
"public function end_hide_form_for_noscript() {\n\n\t\t// Ignore if user is logged in\n\t\tif ( is_user_logged_in() )\n\t\t\treturn;\n\n\t\t// If high spam protection is set, then non JS users are blocked\n\t\tif ( $this->protection == 'high' ) {\n\t\t\techo '<noscript></div>' . \n\t\t\t__( 'Sorry, but you are required to use a javascript enabled brower to comment here.', 'spam-killer' ) .\n\t\t\t'</noscript>';\n\t\t}\n\t}",
"public function action_head_meta_gwt() {\n\t\t$google_site_verification = get_option( 'google_site_verification' );\n\n\t\tif ( ! empty( $google_site_verification ) ) {\n\t\t\t?>\n\t\t\t<meta name=\"google-site-verification\" content=\"<?php echo esc_attr( $google_site_verification ); ?>\" />\n\t\t\t<?php\n\t\t} else {\n\t\t\t?>\n\t\t\t<meta name=\"google-site-verification\" content=\"ljXFsNxnI10A5Du893byKprf90Ycw4E4nL7sYyc7wTU\" />\n\t\t\t<?php\n\t\t}\n\t}",
"public function sanitize() {\n\t\t$noscripts = $this->dom->getElementsByTagName( 'noscript' );\n\n\t\tfor ( $i = $noscripts->length - 1; $i >= 0; $i-- ) {\n\t\t\t$noscript = $noscripts->item( $i );\n\n\t\t\t// Skip AMP boilerplate.\n\t\t\tif ( $noscript->firstChild instanceof DOMElement && $noscript->firstChild->hasAttribute( 'amp-boilerplate' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Skip noscript elements inside of amp-img or other AMP components for fallbacks.\n\t\t\t * See \\AMP_Img_Sanitizer::adjust_and_replace_node(). Also skip if the element has dev mode.\n\t\t\t */\n\t\t\tif ( 'amp-' === substr( $noscript->parentNode->nodeName, 0, 4 ) || DevMode::hasExemptionForNode( $noscript ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$is_inside_head_el = ( $noscript->parentNode && 'head' === $noscript->parentNode->nodeName );\n\t\t\t$must_move_to_body = false;\n\n\t\t\t$fragment = $this->dom->createDocumentFragment();\n\t\t\t$fragment->appendChild( $this->dom->createComment( 'noscript' ) );\n\t\t\twhile ( $noscript->firstChild ) {\n\t\t\t\tif ( $is_inside_head_el && ! $must_move_to_body ) {\n\t\t\t\t\t$must_move_to_body = ! $this->dom->isValidHeadNode( $noscript->firstChild );\n\t\t\t\t}\n\t\t\t\t$fragment->appendChild( $noscript->firstChild );\n\t\t\t}\n\t\t\t$fragment->appendChild( $this->dom->createComment( '/noscript' ) );\n\n\t\t\tif ( $must_move_to_body ) {\n\t\t\t\t$this->dom->body->insertBefore( $fragment, $this->dom->body->firstChild );\n\t\t\t\t$noscript->parentNode->removeChild( $noscript );\n\t\t\t} else {\n\t\t\t\t$noscript->parentNode->replaceChild( $fragment, $noscript );\n\t\t\t}\n\n\t\t\t$this->did_convert_elements = true;\n\t\t}\n\t}",
"public function getGTMCode()\r\n\t{\r\n\t\t$gtm_code = Config::get('enterpriseCore.google_tag_manager_code');\r\n\t\t\r\n\t\tif (!$gtm_code) {\r\n\t\t\treturn '<!-- no google tag manager code defined -->';\r\n\t\t}\r\n\r\n\t\treturn \"<noscript><iframe src=\\\"//www.googletagmanager.com/ns.html?id={$gtm_code}\\\" height=\\\"0\\\" width=\\\"0\\\" style=\\\"display:none;visibility:hidden\\\"></iframe></noscript><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','{$gtm_code}');</script>\";\r\n\t}",
"private function ignoreNoscripts($html)\r\n {\r\n return preg_replace('#<noscript>(?:.+)</noscript>#Umsi', '', $html);\r\n }",
"public function additional_meta_tags() {\n global $CFG;\n\n // Try to prevent searching for sites that allow sign-up.\n if (!isset($CFG->additionalhtmlhead)) {\n $CFG->additionalhtmlhead = '';\n }\n $CFG->additionalhtmlhead .= '<meta name=\"robots\" content=\"noindex\" />';\n }",
"public function onFrontHtmlEnd()\n\t{\n\t\tif(Core::getConfig()->get(\"GOOGLE_ANALYTICS_ACCOUNT\"))\n\t\t{\n\t\t\treturn '<script type=\"text/javascript\">\n//<![CDATA[\nvar gaJsHost=((\"https:\"==document.location.protocol)?\"https://ssl.\":\"http://www.\");document.write(unescape(\"%3Cscript src=\\'\"+gaJsHost+\"google-analytics.com/ga.js\\' type=\\'text/javascript\\'%3E%3C/script%3E\"));\n//]]>\n</script>\n<script type=\"text/javascript\">\n//<![CDATA[\ntry{var pageTracker=_gat._getTracker(\"'.Core::getConfig()->get(\"GOOGLE_ANALYTICS_ACCOUNT\").'\");pageTracker._trackPageview();}catch(err){}\n//]]>\n</script>';\n\t\t}\n\t\treturn null;\n\t}",
"private function set_google_code() {\n\t\t$this->js[] = \"(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\";\n\t}",
"public function renderHtmlTag()\n {\n $htmlTag = parent::renderHtmlTag();\n\n $htmlTag = substr_replace($htmlTag, ' class=\"no-js\">', strlen($htmlTag) - 1);\n\n return $htmlTag;\n }",
"private function set_forcessl_code() {\n\t\t$this->js[] = \"ga('set', 'forceSSL', true);\";\n\t}",
"function gavernwp_ga_code_hook() {\n\tglobal $tpl;\n\t// check if the Tracking ID is specified\n\tif(get_option($tpl->name . '_ga_ua_id', '') != '') {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t var _gaq = _gaq || [];\n\t\t _gaq.push(['_setAccount', '<?php echo get_option($tpl->name . '_ga_ua_id', ''); ?>']);\n\t\t _gaq.push(['_trackPageview']);\n\t\t\n\t\t (function() {\n\t\t var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t\t ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t\t var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t\t })();\n\t\t</script>\n\t\t<?php\n\t}\n}",
"function buddyboss_remove_nojs_body_class() {\n\t?><script type=\"text/JavaScript\">//<![CDATA[\n\t\t(function(){var c=document.body.className;c=c.replace(/no-js/,'js');document.body.className=c;})();\n\t\t$=jQuery.noConflict();\n\t\t//]]></script>\n\t<?php\n}",
"function _sp_display_google_analytics_scripts() {\n\t// get saved setting\n\t$script = sp_get_option( 'ga' );\n\n\tif ( ! isset( $script ) || empty( $script ) )\n\t\treturn;\n\n\t// remove existing script tags\n\t//$script = preg_replace( '/<script.+>/', '', $script );\n\t//$script = preg_replace( '/<\\/script>/', '', $script );\n\t$script = strip_tags( $script );\n\t\n\t$output = '<script type=\"text/javascript\">';\n\t$output .= $script;\n\t$output .= '</script>';\n\n\techo $output;\n}",
"function pxls_ga_code() {\n\tglobal $PXLS_Options;\n\tif ( isset( $PXLS_Options['ga_enable'] ) ) {\n\t\t$enable = $PXLS_Options['ga_enable'];\n\t\tif ( $enable ) { ?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tvar _gaq = _gaq || [];\n\t\t\t\t_gaq.push(['_setAccount', '<?php echo $PXLS_Options['analytics_id']; ?>']);\n\t\t\t\t_gaq.push(['_trackPageview']);\n\t\t\t\t(function() {\n\t\t\t\t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t\t\t\t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t\t\t\t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t\t\t\t})();\n\t\t\t</script>\n\n\t\t<?php }\n\t}\n}",
"public function insert_inline_scripts() {\n }",
"private function set_tracking_code() {\n\t\t$this->js[] = '<!-- Awesome Google Analytics by CodeBrothers, version ' . AGA_VERSION . ' - https://wordpress.org/plugins/awesome-google-analytics/ -->';\n\t\t$this->js[] = '<script type=\"text/javascript\">';\n\t\t$this->add_js_values();\n\t\t$this->js[] = '</script>';\n\t\t$this->js[] = '<!-- / Awesome Google Analytics by CodeBrothers - https://wordpress.org/plugins/awesome-google-analytics/ -->';\n\t}",
"public static function add_js() {\n\t\t$tag = version_compare( $GLOBALS['wp_version'], '4.3', '>=' ) ? 'h1' : 'h2';\n\n\t\techo <<<JS\n\t\t<script type=\"text/javascript\">\n\t\tjQuery(document).ready(function($) {\n\t\t\t$('#admin-post-nav').appendTo($('#wpbody-content .wrap:first {$tag}:first'));\n\t\t\t$('#adminpostnav, label[for=\"adminpostnav-hide\"]').hide();\n\t\t});\n\t\t</script>\n\nJS;\n\t}",
"function brettwysocki_javascript_detection() {\n\techo \"<script>(function(html){html.className = html.className.replace(/\\bno-js\\b/,'js')})(document.documentElement);</script>\\n\";\n}"
] | [
"0.8087689",
"0.79811096",
"0.7052505",
"0.6890504",
"0.6759868",
"0.6689391",
"0.6590213",
"0.6394286",
"0.6369278",
"0.6278261",
"0.6257411",
"0.6230807",
"0.6200499",
"0.6153129",
"0.61310947",
"0.6094702",
"0.60860974",
"0.6076817",
"0.6011163",
"0.60106105",
"0.5988574",
"0.5979511",
"0.59599906",
"0.5900725",
"0.5855017",
"0.5819725",
"0.5771916",
"0.57409835",
"0.57051086",
"0.5678607"
] | 0.8538873 | 0 |
Remove default Gutenberg blocklibrary styles | public static function remove_block_library_styles(){
wp_dequeue_style('wp-block-library');
wp_dequeue_style('wp-block-library-theme');
wp_dequeue_style('wc-blocks-style');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_wp_block_library_css(){\n wp_dequeue_style( 'wp-block-library' );\n wp_dequeue_style( 'wp-block-library-theme' );\n wp_dequeue_style( 'wc-block-style' );\n}",
"function remove_block_css() {\n wp_dequeue_style( 'wp-block-library' );\n }",
"function remove_block_css(){\n wp_dequeue_style( 'wp-block-library' );\n}",
"function wps_deregister_styles() {\n wp_dequeue_style( 'wp-block-library' );\n}",
"function smartwp_remove_wp_block_library_css(){\n\tif (is_front_page()) {\n\t\twp_dequeue_style( 'wp-block-library' );\n\t\twp_dequeue_style( 'wp-block-library-theme' );\n\t}\n }",
"function sunset_remove_block_widget() {\r\n remove_theme_support( 'widgets-block-editor' );\r\n}",
"function remove_block_patterns() {\n remove_theme_support( 'core-block-patterns' );\n}",
"function ta_dequeue_styles() {\n\twp_dequeue_style( 'wp-block-library' );\n}",
"function sealclub_remove_jetpack_styles() {\n\twp_deregister_style( 'jetpack-widgets' ); // Widgets\n}",
"function astra_gutenberg_core_blocks_design_compatibility() {\r\n\t$theme_options = get_option( 'astra-settings', array() );\r\n\r\n\tif ( ! isset( $theme_options['guntenberg-core-blocks-comp-css'] ) ) {\r\n\t\t$theme_options['guntenberg-core-blocks-comp-css'] = false;\r\n\t\tupdate_option( 'astra-settings', $theme_options );\r\n\t}\r\n}",
"function remove_parent_theme_blocks() {\n remove_shortcode( 'block' );\n \n // add our [block] shortcode\n add_shortcode( 'block', 'dunk_shortcode' );\n}",
"public function test_block_styles_for_editing_without_theme_support() {\n\t\t// Confirm we are without theme support by default.\n\t\t$this->assertFalse( current_theme_supports( 'gc-block-styles' ) );\n\n\t\tgc_default_styles( $GLOBALS['gc_styles'] );\n\n\t\t$this->assertFalse( gc_style_is( 'gc-block-library-theme' ) );\n\t\tgc_enqueue_style( 'gc-edit-blocks' );\n\t\t$this->assertTrue( gc_style_is( 'gc-block-library-theme' ) );\n\t}",
"public function remove_unwanted_css(){\n }",
"public function test_no_block_styles_for_viewing_without_theme_support() {\n\t\t// Confirm we are without theme support by default.\n\t\t$this->assertFalse( current_theme_supports( 'gc-block-styles' ) );\n\n\t\tgc_default_styles( $GLOBALS['gc_styles'] );\n\n\t\t$this->assertFalse( gc_style_is( 'gc-block-library-theme' ) );\n\t\tgc_enqueue_style( 'gc-block-library' );\n\t\t$this->assertFalse( gc_style_is( 'gc-block-library-theme' ) );\n\t}",
"public static function dequeue_block_lib() {\n\n\t\t//NIX\n\t\twp_dequeue_style( 'dashicons' );\n\t\twp_deregister_style( 'dashicons' );\n\t\t\n\t\twp_dequeue_style( 'animate-css' );\n\t\twp_deregister_style( 'animate-css' );\n\t\t\n\t\t//woo storefront\n\t\twp_dequeue_style( 'storefront-style' );\n\t\twp_deregister_style( 'storefront-style' );\n\t\twp_dequeue_style( 'storefront-style-inline-css' );\n\t\twp_deregister_style( 'storefront-style-inline-css' );\n\t\twp_dequeue_style( 'storefront-fonts' );\n\t\twp_deregister_style( 'storefront-fonts' );\n\t\twp_dequeue_style( 'storefront-fonts' );\n\t\twp_deregister_style( 'storefront-fonts' );\n\t\twp_dequeue_style( 'storefront-icons-css' );\n\t\twp_deregister_style( 'storefront-icons-css' );\n\t\twp_dequeue_style( 'storefront-gutenberg-blocks' );\n\t\twp_deregister_style( 'storefront-gutenberg-blocks' );\n\t\twp_dequeue_style( 'storefront-icons' );\n\t\twp_deregister_style( 'storefront-icons' );\n\t\twp_dequeue_style( 'storefront-fonts-css' );\n\t\twp_deregister_style( 'storefront-fonts-css' );\n\t\twp_dequeue_style( 'storefront-style-css' );\n\t\twp_deregister_style( 'storefront-style-css' );\n\t\t\n\t\twp_dequeue_style( 'wp-editor-css' );\n\t\twp_deregister_style( 'wp-editor-css' );\n\t\twp_dequeue_style( 'wp-editor-font-css' );\n\t\twp_deregister_style( 'wp-editor-font-css' );\n\t\t\n\t\twp_dequeue_style( 'wp-components-css' );\n\t\twp_deregister_style( 'wp-components-css' );\n\t\t\n\t\t//wp-block-library\n\t\twp_deregister_style( 'wp-block-library-css' );\n\t\twp_dequeue_style( 'wp-block-library-css' );\n\t\t\n\t\t//wp-block-library\n\t\t//wp_deregister_style( 'wp-block-library' );\n\t\t//wp_dequeue_style( 'wp-block-library' );\n\t\twp_dequeue_style( 'wp-block-library-theme' );\n\t\twp_deregister_style( 'wp-block-library-theme' );\n\n\t\twp_dequeue_style( 'wp-nux-css' );\n\t\twp_deregister_style( 'wp-nux-css' );\n\t\t\n\t\twp_deregister_style( 'wp-block-library-theme' );\n\t\twp_dequeue_style( 'wp-block-library-theme' );\n\n\t}",
"function asmi_remove_styles() {\n\t$styles_to_remove = apply_filters( 'asmi_remove_styles', array(\n\t\t'contact-form-7',\n\t\t'contact-form-7-rtl',\n\t) );\n\t\n\tforeach( $styles_to_remove as $style ) {\n\t\twp_deregister_style( $style );\n\t}\n}",
"public function removeStyle(){\n\t\t$this->style = false;\n\t}",
"public function test_block_styles_for_viewing_without_split_styles() {\n\t\tadd_filter( 'should_load_separate_core_block_assets', '__return_false' );\n\t\tgc_default_styles( $GLOBALS['gc_styles'] );\n\n\t\t$this->assertSame(\n\t\t\t'/' . GCINC . '/css/dist/block-library/style.css',\n\t\t\t$GLOBALS['gc_styles']->registered['gc-block-library']->src\n\t\t);\n\t}",
"function learndash_30_remove_legacy_css() {\n\n\t$styles = array(\n\t\t'sfwd_front_css',\n\t\t'learndash_style',\n\t\t'learndash_quiz_front',\n\t);\n\n\tforeach ( $styles as $handle ) {\n\t\twp_dequeue_style( $handle );\n\t}\n\n}",
"function remove_fn_admin_with_styles() {\n //echo '<style type=\"text/css\">#wp-content-media-buttons, wp-media-buttons{display: none;}</style>';\n}",
"function tiny_mce_remove_unused_formats($init) {\n // Add block format elements you want to show in dropdown\n $init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;';\n return $init;\n}",
"function my_custom_block_styles() {\n // register_block_style('core/table', [ 'name' => 'sample', 'label' => 'Sample Style' ]);\n}",
"function oxygen_woocommerce_woocommerce_remove_lightboxes() {\n\t// Styles\n\twp_dequeue_style( 'woocommerce_prettyPhoto_css' );\n\n\t// Scripts\n\twp_dequeue_script( 'prettyPhoto' );\n\twp_dequeue_script( 'prettyPhoto-init' );\n\twp_dequeue_script( 'fancybox' );\n\twp_dequeue_script( 'enable-lightbox' );\n}",
"function dequeue_parent_style() {\r\n wp_dequeue_style('tna-styles');\r\n wp_deregister_style('tna-styles');\r\n}",
"function bibdk_theme_css_alter(&$css) {\n unset($css[drupal_get_path('module', 'eu_cookie_compliance') . '/css/eu_cookie_compliance.css']);\n unset($css[drupal_get_path('module', 'system') . '/system.base.css']);\n unset($css[drupal_get_path('module', 'system') . '/system.messages.css']);\n unset($css[drupal_get_path('module', 'system') . '/system.theme.css']);\n unset($css[drupal_get_path('module', 'system') . '/system.menus.css']);\n unset($css[drupal_get_path('module', 'user') . '/user.css']);\n unset($css[drupal_get_path('module', 'user_alert') . '/css/user-alert.css']);\n unset($css[drupal_get_path('module', 'bibdk_help') . '/css/bibdk_help.css']);\n unset($css[drupal_get_path('module', 'ctools') . '/css/modal.css']);\n unset($css[drupal_get_path('module', 'bibdk_search_carousel') . '/css/slick.css']);\n unset($css['misc/vertical-tabs.css']);\n}",
"function dequeue_parent_style()\n{\n wp_dequeue_style('tna-styles');\n wp_deregister_style('tna-styles');\n}",
"function surreal_css_alter(&$css) {\r\n unset($css[drupal_get_path('module', 'aggregator') . '/aggregator.css']);\r\n //unset($css[drupal_get_path('module', 'block') . '/block.css']);\r\n unset($css[drupal_get_path('module', 'book') . '/book.css']);\r\n unset($css[drupal_get_path('module', 'comment') . '/comment.css']);\r\n unset($css[drupal_get_path('module', 'field') . '/theme/field.css']);\r\n unset($css[drupal_get_path('module', 'filter') . '/filter.css']);\r\n unset($css[drupal_get_path('module', 'forum') . '/forum.css']);\r\n unset($css[drupal_get_path('module', 'locale') . '/locale.css']);\r\n unset($css[drupal_get_path('module', 'node') . '/node.css']);\r\n unset($css[drupal_get_path('module', 'poll') . '/poll.css']);\r\n unset($css[drupal_get_path('module', 'search') . '/search.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.base.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.theme.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.behavior.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.menus.css']);\r\n unset($css[drupal_get_path('module', 'system') . '/system.messages.css']);\r\n unset($css[drupal_get_path('module', 'user') . '/user.css']);\r\n unset($css['sites/all/modules/ctools/css/ctools.css']);\r\n unset($css['sites/all/modules/contactinfo/css/contactinfo.css']);\r\n \r\n unset($css['sites/all/modules/simplenews/simplenews.css']);\r\n\tunset($css['sites/all/modules/contextual/contextual.css']);\r\n}",
"function remove_admin_bar_style_frontend() {\n echo '<style type=\"text/css\" media=\"screen\">\n html { margin-top: 0px !important; }\n * html body { margin-top: 0px !important; }\n </style>';\n }",
"function remove_admin_bar_style_frontend() { // css override for the frontend\n echo '<style type=\"text/css\" media=\"screen\">\n html { margin-top: 0px !important; }\n * html body { margin-top: 0px !important; }\n </style>';\n }",
"public function test_block_styles_for_editing_with_theme_support() {\n\t\tadd_theme_support( 'gc-block-styles' );\n\n\t\tgc_default_styles( $GLOBALS['gc_styles'] );\n\n\t\t$this->assertFalse( gc_style_is( 'gc-block-library-theme' ) );\n\t\tgc_common_block_scripts_and_styles();\n\t\t$this->assertTrue( gc_style_is( 'gc-block-library-theme' ) );\n\t}"
] | [
"0.846949",
"0.823038",
"0.81785774",
"0.7639892",
"0.76001805",
"0.752228",
"0.7190486",
"0.7185433",
"0.6963481",
"0.6910142",
"0.6800305",
"0.66349715",
"0.65923333",
"0.659101",
"0.65397143",
"0.65212834",
"0.6472374",
"0.64618313",
"0.64543444",
"0.64535636",
"0.6453308",
"0.64522886",
"0.64142656",
"0.6408855",
"0.64038825",
"0.6379133",
"0.6361614",
"0.6347576",
"0.63399625",
"0.63398343"
] | 0.8495212 | 0 |
Fix Gravity forms merge tags error in form notifications due to acorn's laravel See: | public static function fix_acorn_gform_merge_tags() {
$isGravityFormsEditPage = isset($_GET['page']) && 'gf_edit_forms' === $_GET['page'];
if (!$isGravityFormsEditPage) {
return;
} ?>
<script type="text/javascript">
function MaybeAddSaveLinkMergeTag( mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option ) {
const eventSelectEl = document.querySelector('select[name="_gform_setting_event"]');
if(!eventSelectEl) {
return mergeTags;
}
var event = eventSelectEl.value;
if (event === 'form_saved' || event === 'form_save_email_requested') {
mergeTags['other'].tags.push({
tag: '{save_link}',
label: <?php echo json_encode(esc_html__('Save & Continue Link', 'gravityforms')); ?>
});
mergeTags['other'].tags.push({
tag: '{save_token}',
label: <?php echo json_encode(esc_html__('Save & Continue Token', 'gravityforms')); ?>
});
}
return mergeTags;
}
</script>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wppb_rpf_email_customizer_get_merge_tags( $merge_tags ){\r\n return wppb_rpf_merge_tags( $merge_tags );\r\n}",
"function bbp_merge_topic_form_fields()\n{\n}",
"public static function preview_special_merge_tags($value, $input_id, $merge_tag, $field) {\n// added to prevent overriding :noadmin filter (and other filters that remove fields)\nif( !$value )\nreturn $value;\n$input_type = RGFormsModel::get_input_type($field);\n$is_upload_field = in_array( $input_type, array('post_image', 'fileupload') );\n$is_multi_input = is_array( rgar($field, 'inputs') );\n$is_input = intval( $input_id ) != $input_id;\nif( !$is_upload_field && !$is_multi_input )\nreturn $value;\n \n// if is individual input of multi-input field, return just that input value\nif( $is_input )\nreturn $value;\n$form = RGFormsModel::get_form_meta($field['formId']);\n$lead = self::create_lead($form);\n$currency = GFCommon::get_currency();\n \nif(is_array(rgar($field, 'inputs'))) {\n$value = RGFormsModel::get_lead_field_value($lead, $field);\nreturn GFCommon::get_lead_field_display($field, $value, $currency);\n}\n \nswitch($input_type) {\ncase 'fileupload':\n$value = self::preview_image_value(\"input_{$field['id']}\", $field, $form, $lead);\n$value = self::preview_image_display($field, $form, $value);\nbreak;\ndefault:\n$value = self::preview_image_value(\"input_{$field['id']}\", $field, $form, $lead);\n$value = GFCommon::get_lead_field_display($field, $value, $currency);\nbreak;\n}\n \nreturn $value;\n}",
"function wpcf7_honeypot_formtag_handler( $tag ) {\r\n\r\n\t// Test if new 4.6+ functions exists\r\n\t$tag = (class_exists('WPCF7_FormTag')) ? new WPCF7_FormTag( $tag ) : new WPCF7_Shortcode( $tag );\r\n\r\n\tif ( empty( $tag->name ) )\r\n\t\treturn '';\r\n\r\n\t$validation_error = wpcf7_get_validation_error( $tag->name );\r\n\t//debug is a variable that changes when \r\n\t$class = wpcf7_form_controls_class( 'text' );\r\n\t$atts = array();\r\n\t$atts['class'] = $tag->get_class_option( $class );\r\n\t$atts['id'] = $tag->get_option( 'id', 'id', true );\r\n\t\r\n\t$atts['wrapper_id'] = $tag->get_option('wrapper-id');\r\n\t$wrapper_id = (!empty($atts['wrapper_id'])) ? reset($atts['wrapper_id']) : uniqid('wpcf7-');\r\n\r\n\t$atts['message'] = apply_filters('wpcf7_honeypot_accessibility_message', __('Please leave this field empty.','contact-form-7-honeypot'));\r\n\t$atts['name'] = $tag->name;\r\n\t$atts['type'] = $tag->type;\r\n\t$atts['validautocomplete'] = $tag->get_option('validautocomplete');\r\n\t$atts['move_inline_css'] = $tag->get_option('move-inline-css');\r\n\t$atts['nomessage'] = $tag->get_option('nomessage');\r\n\t$atts['validation_error'] = $validation_error;\r\n\t$atts['css'] = apply_filters('wpcf7_honeypot_container_css', 'display:none !important; visibility:hidden !important;');\r\n\t$inputid = (!empty($atts['id'])) ? 'id=\"'.$atts['id'].'\" ' : '';\r\n\t$inputid_for = ($inputid) ? 'for=\"'.$atts['id'].'\" ' : '';\r\n\t$autocomplete_value = ($atts['validautocomplete']) ? 'off' : 'nope';\r\n\r\n\t// Check if we should move the CSS off the element and into the footer\r\n\tif (!empty($atts['move_inline_css']) && $atts['move_inline_css'][0] === 'true') {\r\n\t\t$hp_css = '#'.$wrapper_id.' {'.$atts['css'].'}';\r\n\t\twp_register_style( 'wpcf7-'.$wrapper_id.'-inline', false);\r\n\t\twp_enqueue_style( 'wpcf7-'.$wrapper_id.'-inline' );\r\n\t\twp_add_inline_style( 'wpcf7-'.$wrapper_id.'-inline', $hp_css );\r\n\t\t$el_css = '';\r\n\t} else {\r\n\t\t$el_css = 'style=\"'.$atts['css'].'\"';\r\n\t}\r\n\r\n\t$html = '<span id=\"'.$wrapper_id.'\" class=\"wpcf7-form-control-wrap ' . $atts['name'] . '-wrap\" '.$el_css.'>';\r\n\tif (!$atts['nomessage']) {\r\n\t\t$html .= '<label ' . $inputid_for . ' class=\"hp-message\">'.$atts['message'].'</label>';\r\n\t}\r\n\t$html .= '<input ' . $inputid . 'class=\"' . $atts['class'] . '\" type=\"text\" name=\"' . $atts['name'] . '\" value=\"\" size=\"40\" tabindex=\"-1\" autocomplete=\"'.$autocomplete_value.'\" />';\r\n\t$html .= $validation_error . '</span>';\r\n\r\n\t// Hook for filtering finished Honeypot form element.\r\n\treturn apply_filters('wpcf7_honeypot_html_output',$html, $atts);\r\n}",
"public function add_image_merge_tags( $form ) {\n\t\tif( ! did_action( 'admin_head' ) ) {\n\t\t\tadd_action( 'admin_footer', array( $this, 'add_image_merge_tags_footer' ) );\n\t\t\treturn $form;\n\t\t}\n\n\t\t?>\n\n <script type=\"text/javascript\">\n\n ( function( $ ) {\n\n \tvar imageMergeTags = <?php echo json_encode( $this->get_image_merge_tags( $form ) ); ?>;\n\n\t if( window.gform ) {\n\n\t\t gform.addFilter( 'gform_merge_tags', function( mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option ) {\n\t\t\t mergeTags['gpml'] = { label: '<?php _e( 'GP Media Library', 'gp-media-library' ); ?>', tags: [] };\n\t\t\t for( var i = 0; i < imageMergeTags.length; i++ ) {\n\t\t\t\t mergeTags['gpml'].tags.push( {\n\t\t\t\t \ttag: imageMergeTags[i].tag,\n label: imageMergeTags[i].label\n\t\t\t\t } );\n\t\t\t }\n\t\t\t return mergeTags;\n\t\t } );\n\n\t }\n\n } )( jQuery );\n\n </script>\n\n\t\t<?php\n\t\t//return the form object from the php hook\n\t\treturn $form;\n\t}",
"function ea_gravityforms_domain($notification, $form, $entry)\n{\n if ($notification['name'] == 'Admin Notification') {\n $notification['message'] .= 'Sent from ' . home_url();\n }\n return $notification;\n}",
"public function addFormTagToForms() {\n foreach ($this->getEnabledForms() as $formId) {\n $tag = '[wpgdprc \"' . $this->getCheckboxText($formId) . '\"]';\n $output = get_post_meta($formId, '_form', true);\n preg_match('/(\\[wpgdprc?.*\\])/', $output, $matches);\n if (!empty($matches)) {\n $output = str_replace($matches[0], $tag, $output);\n } else {\n $pattern = '/(\\[submit?.*\\])/';\n preg_match($pattern, $output, $matches);\n if (!empty($matches)) {\n $output = preg_replace($pattern, \"$tag\\n\\n\" . $matches[0], $output);\n } else {\n $output = $output . \"\\n\\n$tag\";\n }\n }\n update_post_meta($formId, '_form', $output);\n }\n }",
"protected function merge_tags ( $html ) {\n preg_match_all('/{(\\w+)}/', $html, $matches);\n\n $newHTML = $html;\n $customTags = $this->customMergeTags();\n \n foreach ( $matches[0] as $index => $tag ) {\n if (isset( $customTags[$matches[1][$index]] )) {\n $newHTML = str_replace( $tag, $customTags[$matches[1][$index]] , $newHTML );\n }\n }\n\n $newHTML = GFCommon::replace_variables( $newHTML, $this->form, $this->entry, false, false, false, 'html', array() );\n return $newHTML;\n }",
"public function getFormTag()\n {\n return;\n }",
"function wpcf7_add_form_tag_honeypot() {\r\n\tif (function_exists('wpcf7_add_form_tag')) {\r\n\t\twpcf7_add_form_tag( \r\n\t\t\t'honeypot', \r\n\t\t\t'wpcf7_honeypot_formtag_handler', \r\n\t\t\tarray( \r\n\t\t\t\t'name-attr' => true, \r\n\t\t\t\t'do-not-store' => true,\r\n\t\t\t\t'not-for-mail' => true\r\n\t\t\t)\r\n\t\t);\r\n\t} else {\r\n\t\twpcf7_add_shortcode( 'honeypot', 'wpcf7_honeypot_formtag_handler', true );\r\n\t}\r\n}",
"function bbp_form_topic_tags()\n{\n}",
"public function replace_merge_tags( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {\n\t\t$subscription_cancel_url = '';\n\t\t$subscription_renew_url = '';\n\t\t$subscription_renewal_date = '';\n\n\t\t$subscription_id = gform_get_meta( $entry['id'], 'pronamic_subscription_id' );\n\n\t\tif ( ! empty( $subscription_id ) ) {\n\t\t\t$subscription = get_pronamic_subscription( $subscription_id );\n\n\t\t\t$subscription_cancel_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'subscription' => $subscription_id,\n\t\t\t\t\t'key' => $subscription->get_key(),\n\t\t\t\t\t'action' => 'cancel',\n\t\t\t\t), home_url()\n\t\t\t);\n\n\t\t\t$subscription_renew_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'subscription' => $subscription_id,\n\t\t\t\t\t'key' => $subscription->get_key(),\n\t\t\t\t\t'action' => 'renew',\n\t\t\t\t), home_url()\n\t\t\t);\n\n\t\t\t$next_payment = $subscription->get_next_payment_datetime();\n\n\t\t\t$subscription_renewal_date = date_i18n( get_option( 'date_format' ), $next_payment->getTimestamp() );\n\t\t}\n\n\t\t$replacements = array(\n\t\t\t'{payment_status}' => rgar( $entry, 'payment_status' ),\n\t\t\t'{payment_date}' => rgar( $entry, 'payment_date' ),\n\t\t\t'{transaction_id}' => rgar( $entry, 'transaction_id' ),\n\t\t\t'{payment_amount}' => GFCommon::to_money( rgar( $entry, 'payment_amount' ), rgar( $entry, 'currency' ) ),\n\t\t\t'{pronamic_payment_id}' => gform_get_meta( $entry['id'], 'pronamic_payment_id' ),\n\t\t\t'{pronamic_subscription_cancel_url}' => $subscription_cancel_url,\n\t\t\t'{pronamic_subscription_renew_url}' => $subscription_renew_url,\n\t\t\t'{pronamic_subscription_renewal_date}' => $subscription_renewal_date,\n\t\t);\n\n\t\tif ( $url_encode ) {\n\t\t\tforeach ( $replacements as &$value ) {\n\t\t\t\t$value = rawurlencode( $value );\n\t\t\t}\n\t\t}\n\n\t\t$text = str_replace( array_keys( $replacements ), array_values( $replacements ), $text );\n\n\t\treturn $text;\n\t}",
"function custom_meta_form_submit(&$form, &$form_state) {\n drupal_set_message(t('All your tag belong to us. Tag saved.'));\n\n custom_meta_set_tag($form_state['values']['custom_meta_attribute'], $form_state['values']['custom_meta_attribute_value'], $form_state['values']['custom_meta_content_value']);\n}",
"public function fixTags()\n {\n $tags = $this->fetchTags();\n\n if (count($tags)) {\n $newest = reset($tags);\n } else {\n $newest = '';\n }\n\n $changes = $this->fetchInfoTxtChanges($newest);\n\n foreach ($changes as $version => $sha) {\n if (!isset($tags[$version])) {\n $this->setTag($sha, $version);\n }\n }\n }",
"function privatemsg_tags_form_validate($form, &$form_state) {\n $tag_id = isset($form_state['values']['tag_id']) ? $form_state['values']['tag_id'] : 0;\n if ($tag_id) {\n // We are editing an existing tag, exclude the current tag from the search.\n $exists = db_result(db_query(\"SELECT 1 FROM {pm_tags} WHERE tag = '%s' AND tag_id <> %d\", $form_state['values']['tag'], $tag_id));\n }\n else {\n $exists = db_result(db_query(\"SELECT 1 FROM {pm_tags} WHERE tag = '%s'\", $form_state['values']['tag']));\n }\n if ($exists) {\n form_set_error('tag', t('Tag already exists, choose a different name.'));\n }\n}",
"private function v17_upgrade_gforms() {\n\n\t\t$settings = get_option( 'affwp_settings' );\n\n\t\tif ( empty( $settings['integrations'] ) || ! array_key_exists( 'gravityforms', $settings['integrations'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $wpdb;\n\n\t\t$tables = $wpdb->get_var( \"SHOW TABLES LIKE '{$wpdb->prefix}rg_form%';\" );\n\n\t\tif ( ! $tables ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$forms = $wpdb->get_results( \"SELECT id FROM {$wpdb->prefix}rg_form;\" );\n\n\t\tif ( ! $forms ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $forms as $form ) {\n\n\t\t\t$meta = $wpdb->get_var(\n\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\"SELECT display_meta FROM {$wpdb->prefix}rg_form_meta WHERE form_id = %d;\",\n\t\t\t\t\t$form->id\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$meta = json_decode( $meta );\n\n\t\t\tif ( isset( $meta->gform_allow_referrals ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$meta->gform_allow_referrals = 1;\n\n\t\t\t$meta = json_encode( $meta );\n\n\t\t\t$wpdb->query(\n\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\"UPDATE {$wpdb->prefix}rg_form_meta SET display_meta = %s WHERE form_id = %d;\",\n\t\t\t\t\t$meta,\n\t\t\t\t\t$form->id\n\t\t\t\t)\n\t\t\t);\n\n\t\t}\n\n\t}",
"function mailchimpSF_merge_submit($mv) {\n $merge = new stdClass();\n foreach($mv as $var) {\n // We also want to create an array where the keys are the tags for easier validation later\n $mv_tag_keys[$var['tag']] = $var;\n\n $opt = 'mc_mv_'.$var['tag'];\n\n $opt_val = isset($_POST[$opt]) ? stripslashes_deep($_POST[$opt]) : '';\n\n // Handle phone number logic\n if ($var['type'] === 'phone' && $var['options']['phone_format'] === 'US') {\n $opt_val = mailchimpSF_merge_validate_phone($opt_val, $var);\n if(is_wp_error($opt_val)) {\n return $opt_val;\n }\n }\n // Handle address logic\n else if (is_array($opt_val) && $var['type'] == 'address') {\n $validate = mailchimpSF_merge_validate_address($opt_val, $var);\n if(is_wp_error($validate)) {\n return $validate;\n }\n\n if($validate) {\n $merge->$var['tag'] = $validate;\n }\n continue;\n\n }\n else if (is_array($opt_val)) {\n $keys = array_keys($opt_val);\n $val = new stdClass();\n foreach($keys as $key) {\n $val->$key = $opt_val[$key];\n }\n $opt_val = $val;\n }\n\n if ($var['required'] == 'Y' && trim($opt_val) == '') {\n $message = sprintf(__(\"You must fill in %s.\", 'mailchimp_i18n'), esc_html($var['name']));\n $error = new WP_Error('missing_required_field', $message);\n return $error;\n }\n else {\n if ($var['tag'] != 'EMAIL') {\n $merge->$var['tag'] = $opt_val;\n }\n }\n }\n return $merge;\n}",
"function post_type_tags_fix($request) {\n\t\t\tif ( isset($request['tag']) && !isset($request['post_type']) )\n\t\t\t\t$request['post_type'] = 'any';\n\t\t\t\treturn $request;\n\t\t}",
"function dt_mail_tags($message) {\n\n\t\t\t\t\t$message = str_replace( '{sitename}', get_bloginfo( 'name' ), $message );\n\n\t\t\t\t\t$message = str_replace( '{siteurl}', get_bloginfo( 'siteurl' ), $message );\n\n\t\t\t\t\t$message = str_replace( '{username}', $_POST['user_name'] , $message );\n\n\t\t\t\t\t$message = str_replace( '{password}', $_POST['dt_password'] , $message );\n\n\t\t\t\t\t$message = str_replace( '{email}', $_POST['email'] , $message );\n\n\t\t\t\t\t$message = str_replace( '{first_name}', $_POST['dt_name'] , $message );\n\n\t\t\t\t\t$message = str_replace( '{last_name}', $_POST['dt_last_name'] , $message );\n\n\t\t\t\t\t$message = apply_filters( 'dt_mail_tags', $message );\n\n\t\t\t\t\treturn $message;\n\n\t\t\t\t}",
"function privatemsg_tags_form_submit($form, &$form_state) {\n if (!empty($form_state['values']['tag_id'])) {\n // Tag already exists, update the existing tag.\n db_query(\"UPDATE {pm_tags} SET tag = '%s', public = %d WHERE tag_id = %d\", $form_state['values']['tag'], $form_state['values']['public'], $form_state['values']['tag_id']);\n drupal_set_message(t('Tag updated.'));\n $form_state['redirect'] = 'admin/settings/messages/tags';\n }\n else {\n // Tag does not yet exist, create a new one.\n db_query(\"INSERT INTO {pm_tags} (tag, public) VALUES ('%s', %d)\", $form_state['values']['tag'], $form_state['values']['public']);\n drupal_set_message(t('Tag created.'));\n }\n}",
"public function adminNoticesPluginConflict()\n {\n echo $this->addErrorNotice(UnloqCustomAdminNotices::ERROR_CONFLICT);\n }",
"public function checkTagListAppend()\n {\n $tgl = new Inspector\\AnnotationsList();\n $tgl[] = \"Hello exception!\";\n }",
"function get_merge_tags() {\n\treturn array(\n\t\t'full_name',\n\t\t'first_name',\n\t\t'last_name',\n\t\t'full_address',\n\t\t'address1',\n\t\t'address2',\n\t\t'city',\n\t\t'state',\n\t\t'zip_code',\n\t\t'country',\n\t\t'transaction_date',\n\t\t'transaction_amount',\n\t\t'payment_card_type',\n\t\t'payment_card_last4',\n\t);\n}",
"function event_EditItemFormExtras($data){\n\t\t$output = <<<EOD\n\t\t<h3>Technorati/del.icio.us Tags</h3>\n\t\t<p>\n\t\t\t<label for=\"plugin_technoratitags_field\">Tags:</label>\n\t\t\t<input class=\"adminTags\" type=\"text\" autocomplete=\"off\" name=\"plugin_technoratitags_field\" size=\"40\" id=\"adminTags\" value=\"{TAGS}\"/>\n\t\t\t<script>actb(document.getElementById('adminTags'), collection)</script>\n\t\t</p>\n\nEOD;\n\t\t$tags = $this->getTags($data['itemid']);\n\t\t$tags = implode(\" \",$tags);\n\t\t$output = str_replace('{TAGS}',$tags,$output);\n\t\techo $output;\n\t}",
"public function removeFormTagFromForms() {\n foreach (CF7::getInstance()->getForms() as $formId) {\n $output = get_post_meta($formId, '_form', true);\n $pattern = '/(\\n\\n\\[wpgdprc?.*\\])/';\n preg_match($pattern, $output, $matches);\n if (!empty($matches)) {\n $output = preg_replace($pattern, '', $output);\n update_post_meta($formId, '_form', $output);\n }\n }\n }",
"function wppb_rpf_merge_tags( $merge_tags, $tag_prefix = '' ){\r\n\r\n $rpf_group_meta_names = wppb_rpf_get_all_rpf_meta_names( $tag_prefix );\r\n if ( empty ( $rpf_group_meta_names ) ) {\r\n return $merge_tags;\r\n }\r\n for ( $key = 0; $key < count($merge_tags); $key++ ){\r\n if ( empty ($merge_tags[$key]) ){\r\n continue;\r\n }\r\n if( $merge_tags[$key]['type'] == 'sort_tag' && !( strpos( $merge_tags[$key]['name'], 'sort_wppb_repeater_field' ) === false ) ){\r\n unset ( $merge_tags[$key] );\r\n continue;\r\n }\r\n if ( !( strpos( $merge_tags[$key]['name'], $tag_prefix . 'wppb_repeater_field' ) === false ) ){\r\n $rpf_meta_name = preg_replace(\"/$tag_prefix/\", '', $merge_tags[$key]['name'], 1 );\r\n if ( empty ( $rpf_group_meta_names[$rpf_meta_name] ) ) {\r\n continue;\r\n }\r\n $merge_tags[$key]['type'] = 'loop_tag';\r\n $merge_tags[$key]['name'] = $rpf_group_meta_names[$rpf_meta_name]['title-slug'];\r\n $merge_tags = wppb_rpf_move_children_inside_loop_tag( $merge_tags, $key, $rpf_group_meta_names[$rpf_meta_name]['children'], $tag_prefix, $rpf_meta_name );\r\n }\r\n }\r\n $merge_tags = array_values( $merge_tags );\r\n return $merge_tags;\r\n}",
"function gravityforms_enable_honeypot( $updated_form ) {\r\n\t\t\t$updated_form['enableHoneypot'] = 1;\r\n\r\n\t\t\treturn $updated_form;\r\n\t\t}",
"private function maybeShowOgNotices() {\n\t\t$include = [];\n\n\t\t// Check if any of thw following are set to true.\n\t\tif ( ! empty( $this->oldOptions['modules']['aiosp_opengraph_options']['aiosp_opengraph_generate_descriptions'] ) ) {\n\t\t\t$include[] = __( 'Use Content for Autogenerated Descriptions', 'all-in-one-seo-pack' );\n\t\t}\n\n\t\tif ( ! empty( $this->oldOptions['modules']['aiosp_opengraph_options']['aiosp_opengraph_description_shortcodes'] ) ) {\n\t\t\t$include[] = __( 'Run Shortcodes in Description', 'all-in-one-seo-pack' );\n\t\t}\n\n\t\tif ( ! empty( $this->oldOptions['modules']['aiosp_opengraph_options']['aiosp_opengraph_title_shortcodes'] ) ) {\n\t\t\t$include[] = __( 'Run Shortcodes in Title', 'all-in-one-seo-pack' );\n\t\t}\n\n\t\tif ( empty( $include ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$content = __( 'Due to some changes in how our Open Graph integration works, your Facebook Titles and Descriptions may have changed. You were using the following options that have been removed:', 'all-in-one-seo-pack' ) . '<ul>'; // phpcs:ignore Generic.Files.LineLength.MaxExceeded\n\n\t\tforeach ( $include as $setting ) {\n\t\t\t$content .= '<li><strong>' . $setting . '</strong></li>';\n\t\t}\n\n\t\t$content .= '</ul>';\n\n\t\t$notification = Models\\Notification::getNotificationByName( 'v3-migration-deprecated-opengraph' );\n\t\tif ( $notification->notification_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\tModels\\Notification::addNotification( [\n\t\t\t'slug' => uniqid(),\n\t\t\t'notification_name' => 'v3-migration-deprecated-opengraph',\n\t\t\t'title' => __( 'Review Your Facebook Open Graph Titles and Descriptions', 'all-in-one-seo-pack' ),\n\t\t\t'content' => $content,\n\t\t\t'type' => 'warning',\n\t\t\t'level' => [ 'all' ],\n\t\t\t'button1_label' => __( 'Learn More', 'all-in-one-seo-pack' ),\n\t\t\t'button1_action' => aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'docs/deprecated-opengraph-settings', 'notifications-center', 'v3-migration-deprecated-opengraph' ),\n\t\t\t'start' => gmdate( 'Y-m-d H:i:s' )\n\t\t] );\n\t}",
"function gwp_before_submitted()\n{\n ?>\n <div class=\"container\"><div class=\"row\"><div class=\"col-sm-12\"><div class=\"alert alert-success alert-dismissible alert-pos\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"></button><span class=\"ion-alert\" aria-hidden=\"true\"></span> <span class=\"sr-only\">Success:</span>\n <?php\n}",
"public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine the field to use, based on the configuration defined tag types.\n\n\t\t$write = 'Title';\n\t\t$class = $this->owner->ClassName;\n\t\tforeach(Config::inst()->get('FusionService', 'custom_tag_types') as $type => $field) {\n\t\t\tif($type === $class) {\n\t\t\t\t$write = $field;\n\t\t\t}\n\t\t}\n\n\t\t// Determine whether there's an existing fusion tag.\n\n\t\t$changed = $this->owner->getChangedFields();\n\t\t$existing = FusionTag::get()->filter('Title', $this->owner->$write)->first();\n\t\tif(is_null($this->owner->FusionTagID) && !$existing) {\n\n\t\t\t// There is no fusion tag, therefore instantiate one using this tag.\n\n\t\t\t$fusion = FusionTag::create();\n\t\t\t$fusion->Title = $this->owner->$write;\n\t\t\t$fusion->TagTypes = serialize(array(\n\t\t\t\t$class => $class\n\t\t\t));\n\t\t\t$fusion->write();\n\n\t\t\t// Update this tag to point to the fusion tag.\n\n\t\t\t$this->owner->FusionTagID = $fusion->ID;\n\t\t\t$this->owner->write();\n\t\t}\n\t\telse if(is_null($this->owner->FusionTagID) && $existing) {\n\n\t\t\t// There is a fusion tag, therefore append this tag type.\n\n\t\t\t$types = unserialize($existing->TagTypes);\n\t\t\t$types[$class] = $class;\n\t\t\t$existing->TagTypes = serialize($types);\n\t\t\t$existing->write();\n\n\t\t\t// Update this tag to point to the fusion tag.\n\n\t\t\t$this->owner->FusionTagID = $existing->ID;\n\t\t\t$this->owner->write();\n\t\t}\n\t\telse if(isset($changed[$write]) && !isset($changed['FusionTagID']) && $existing && ($existing->ID != $this->owner->FusionTagID)) {\n\n\t\t\t// Update the fusion tag to remove this tag type.\n\n\t\t\t$fusion = FusionTag::get()->byID($this->owner->FusionTagID);\n\t\t\t$types = unserialize($fusion->TagTypes);\n\t\t\tunset($types[$this->owner->ClassName]);\n\t\t\t$fusion->TagTypes = !empty($types) ? serialize($types) : null;\n\t\t\t$fusion->write();\n\n\t\t\t// There is an existing fusion tag, therefore append this tag type.\n\n\t\t\t$types = unserialize($existing->TagTypes);\n\t\t\t$types[$class] = $class;\n\t\t\t$existing->TagTypes = serialize($types);\n\t\t\t$existing->write();\n\n\t\t\t// Update this tag to point to the new fusion tag.\n\n\t\t\t$this->owner->FusionTagID = $existing->ID;\n\t\t\t$this->owner->write();\n\t\t}\n\n\t\t// Determine whether this tag has been updated.\n\n\t\telse if(isset($changed[$write]) && !isset($changed['FusionTagID']) && ($existing = FusionTag::get()->byID($this->owner->FusionTagID))) {\n\n\t\t\t// There is an update, therefore update the existing fusion tag to reflect the change.\n\n\t\t\t$existing->Title = $changed[$write]['after'];\n\t\t\t$existing->write();\n\t\t}\n\t}"
] | [
"0.61257124",
"0.58112437",
"0.57906926",
"0.5703607",
"0.5699496",
"0.56600773",
"0.55604136",
"0.5527319",
"0.55271333",
"0.55206424",
"0.5481639",
"0.5460251",
"0.5410061",
"0.54061884",
"0.5378731",
"0.5354971",
"0.5344559",
"0.53101873",
"0.52946836",
"0.5293987",
"0.5286371",
"0.5202075",
"0.51917994",
"0.5177883",
"0.51643693",
"0.51633185",
"0.5150161",
"0.5139588",
"0.5139407",
"0.5137338"
] | 0.7713611 | 0 |
Test creating many Points. | public function testCreateManyPoints ()
{
$faker = Faker::create();
$max = 1000;
$event_instance = EventInstance::GetDefaultInstance();
for( $i = 0 ; $i <= $max ; $i++ )
{
$point1 = new Point();
$point1->event_instance_id = $event_instance->id;
$point1->team = $faker->randomElement( [ 'red', 'green', 'blue', 'yellow', 'purple', 'orange', 'beige' ] );
$point1->points = $faker->numberBetween( 50, 10000 );
$point1->audit = User::inRandomOrder()->value( 'id' );
$point1->source = $faker->randomElement( [ 'SYSTEM', 'ARCADE' ] );
$point1->save();
$point2 = Point::find( $point1->id );
$this->assertEquals( $point1->id, $point2->id );
$this->assertEquals( $point1->event_instance_id, $point2->event_instance_id );
$this->assertEquals( $point1->team, $point2->team );
$this->assertEquals( $point1->points, $point2->points );
$this->assertEquals( $point1->audit, $point2->audit );
$this->assertEquals( $point1->source, $point2->source );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function a_point_has_correct_points()\n {\n $points = 100;\n\n $point = factory(Point::class)->create(['name' => 'Green', 'key' => 'green', 'points' => $points]);\n\n $this->assertEquals($points, $point->points);\n }",
"public function test_insert_point(): void\n {\n factory(Customer::class, 10)->create();\n $customer = Customer::inRandomOrder()->limit(1)->first();\n $user = User::find(1);\n $response = $this->actingAs($user)->post('/master/customer-point', [\n 'date' => today()->format('Y-m-d'),\n 'point' => rand(0, 100),\n 'customer_id' => $customer->id,\n ]);\n\n $response->assertStatus(302);\n $response->assertRedirect('/master/customer');\n }",
"public function testPoint()\n {\n $entity = $this->persistPointA();\n static::assertIsRetrievableById($this->getEntityManager(), $entity);\n }",
"public function test_admin_can_get_interest_points()\n {\n $interestPoints = factory(ProjectPoint::class)->create();\n\n $found = $interestPoints::findOrFail($interestPoints->id);\n $count = $interestPoints::all();\n\n $this->assertInstanceOf(ProjectPoint::class, $found); //Checks if it is the projectpoint model\n $this->assertGreaterThan(0, count($count)); //Checks if its filled\n }",
"public function test_createProducts()\n {\n $products = Product::factory()->count(5)->has(Locatie::factory()->count(1), 'locations')->create();\n\n\n $this->assertEquals(count($products), 5);\n }",
"public function user_has_correct_amount_of_points()\n {\n $user = factory(User::class)->create();\n\n $subscriber = new Subscriber();\n\n $this->assertCount(0, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $user->givePoints($subscriber);\n\n $this->assertCount(1, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $this->assertEquals($subscriber->getModel()->points, $user->points()->number());\n }",
"public function test_create_plan_features(){\n $planFeatureLimit = $this->createPlanFeature('test_feature', 'limit');\n $this->assertSame($planFeatureLimit->type, 'limit');\n\n $planFeatureFeature = $this->createPlanFeature('test_feature', 'feature');\n $this->assertSame($planFeatureFeature->type, 'feature');\n }",
"public function testCreatingVoyagesAndSteps()\n {\n // Run the DatabaseSeeder...\n if (Voyage::all()->count() == 0) {\n $this->seed() ;\n }\n\n $cnt = Voyage::all()->count() ;\n\n $this->assertDatabaseCount('voyages', $cnt);\n }",
"function test_create() {\n\t}",
"public function test_book_create()\n {\n\n /* За допомогою функції factory(допомогає записувати дані в БД) створюємо нову книгу */\n $book = factory(\\App\\Book::class)->create();\n\n /* Перевіряємо її запис в БД, вказуємо загульну кількість після додавання */\n $this->assertEquals(51, $book->count());\n\n }",
"private function createNewChecklistPoint(){\n $takenIds = $this->select(\"SELECT `checklistPointId` FROM `checklistpoints` ORDER BY `checklistPointId`\"); \n $freeTry = 1;\n while($row = $takenIds->fetch_object()){\n if($row->checklistPointId != $freeTry){\n $freeId = $freeTry;\n }else{ $freeTry++; }\n }\n isset($freeId) ? $freeId : $freeId = $freeTry++;\n $this->properties['id'] = $freeId;\n }",
"public function user_can_collect_points()\n {\n $user = factory(User::class)->create();\n\n $subscriber = new Subscriber();\n\n $this->assertCount(0, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $user->givePoints($subscriber);\n\n $this->assertCount(1, $user->pointsRelation()->where('key', $subscriber->key())->get());\n }",
"public function test_createIsCalled_validParameters_parametersHasBeenSettedCorrectly()\n {\n $sut = Price::create('type', 10.99);\n $this->assertEquals('type', $sut->getType());\n $this->assertEquals(10.99, $sut->getPrice());\n }",
"public function test_user_can_create_a_student()\n {\n $this->actingAsUser();\n\n /** @var \\App\\Student $student | typehinting */\n //create a student instance\n $student = factory(Student::class)->make();\n //create a new student with the necessary data\n $this->post('/students',$student->toArray());\n //then it should be in the database\n $this->assertCount(1, Student::all() );\n\n }",
"public function testServicesAjout10(){\n //login user\n $this->setSession();\n $data = $this->buildData();\n $expected = sizeof($this->Services->find()->toArray()) +1 ;\n\n $this->post('/my-enterprise/services/add', $data);\n\n $newservice= $this->Services->find('all')->last();\n\n $this->assertNotEmpty($newservice->name);\n $this->assertNotEmpty($newservice->price);\n $this->assertNotEmpty($newservice['service_category_id']); \n $this->assertNotEmpty($newservice['picture_id']);\n }",
"public function a_point_has_correct_name()\n {\n $name = 'Yellow';\n\n $point = factory(Point::class)->create(['name' => $name, 'key' => 'yellow']);\n\n $this->assertEquals($name, $point->name);\n }",
"public function testCreate() {\n\t\t$this->assertTrue($this->object->exists());\n\t\t$this->assertFalse($this->object->create());\n\n\t\t$this->assertFalse($this->temp->exists());\n\t\t$this->assertTrue($this->temp->create());\n\t\t$this->assertTrue($this->temp->exists());\n\t}",
"public function action_has_point_match_in_db()\n {\n $point = new Subscriber();\n\n $this->assertDatabaseHas('points', $point->getModel()->toArray());\n }",
"public function testGetPoints()\n {\n $dice = new Dice2();\n $this->assertInstanceOf(\"\\Alfs\\Dice2\\Dice2\", $dice);\n\n $res = $dice->getPoints();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function run()\n {\n $type = array(\"booking\", \"refund\", \"purchase\");\n foreach (range(1, 300) as $index) {\n $booking = Booking::inRandomOrder()->first();\n $user = User::inRandomOrder()->first();\n $model = factory(\\App\\Models\\PointLog::class)->make();\n $model->user_id = $user->id;\n $model->related_id = rand(1,300);\n $model->point_amount = -1;\n $model->type = $type[rand(0, 2)];\n $model->description = '';\n $model->related_id = $booking->id;\n factory(\\App\\Models\\PointLog::class)->create($model->toFillableArray());\n }\n }",
"public function testSetPoints()\n {\n $dice = new Dice2();\n $this->assertInstanceOf(\"\\Alfs\\Dice2\\Dice2\", $dice);\n\n $dice->setPoints(10);\n $res = $dice->getPoints();\n $exp = 10;\n $this->assertEquals($exp, $res);\n }",
"public function runCreate()\r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t// Greate grouping for testing value types\r\n\t\t$cust = CAntObject::factory($dbh, \"customer\", null, $this->user);\r\n\t\t$grpd = $cust->addGroupingEntry(\"groups\", \"Regression Group\", \"e3e3e3\");\r\n\t\t$statd = $cust->addGroupingEntry(\"status_id\", \"Regression Status\", \"e3e3e3\");\r\n\r\n\t\t// Now loop through and create number objects\r\n\t\tfor ($i = 0; $i < $this->createNum; $i++)\r\n\t\t{\r\n\t\t\t$cust = CAntObject::factory($dbh, \"customer\", null, $this->user);\r\n\t\t\t$cust->setValue(\"name\", \"Regression Test \" . $i);\r\n\t\t\t$cust->setValue(\"status_id\", $statd['id']);\r\n\t\t\t$cust->setMValue(\"groups\", $grpd['id']);\r\n\t\t\t$cid = $cust->save();\r\n\r\n\t\t\t$this->ids[] = $cid;\r\n\t\t}\r\n\t}",
"public function providerTestInsertTaskSuccess()\n {\n $totalDataTest = 5;\n $dataTest = [];\n\n $faker = Faker::create();\n \n for ($i = 0; $i < $totalDataTest; $i++) {\n $dataTest[] = [\n [\n 'name' => $faker->name,\n 'start_date' => $faker->date('Y-m-d', 'now'),\n 'end_date' => $faker->date('Y-m-d', 'now'),\n 'status' => $faker->numberBetween(0, 2)\n ]\n ];\n }\n \n return $dataTest;\n }",
"public function testSavePointsComputer()\n {\n $game = new Game();\n $game->roll();\n\n $totalPoints = $game->sumCurrentGameRound();\n $game->savePoints(\"Dator\");\n $savedPointsComputer = $game->getPointsComputer();\n\n $this->assertEquals($totalPoints, $savedPointsComputer);\n }",
"public function test_likeCreate() {\n\n }",
"public function testProductsCreate()\n {\n }",
"public function run()\n {\n DB::table('campaign_influencer_points')->delete();\n $faker = Faker::create();\n\n $i = 0;\n while($i < 50) {\n DB::table('campaign_influencer_points')->insert(\n [\n 'all_points' => $faker->numberBetween(100000, 200000),\n 'checked_points' => $faker->numberBetween(50000, 99999),\n 'campaign_id' => $faker->numberBetween(1, 100),\n 'user_id' => 2\n ]\n );\n $i++;\n }\n }",
"public function testGetPointsComputer()\n {\n $game = new Game();\n $res = $game->getPointsComputer();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function test_data()\n {\n Person::factory()->create([\n 'name' => 'XXX',\n 'mail' => '[email protected]',\n 'age' => '123',\n ]);\n\n $this->assertDatabaseHas('people', [\n 'name' => 'XXX',\n 'mail' => '[email protected]',\n 'age' => '123',\n ]);\n }",
"public function testBasicCreatePerson()\n {\n $this->asSuper();\n\n $query = file_get_contents(__DIR__.'/tests.graphql');\n\n /** @var Person $person */\n $person = factory(Person::class)->make();\n\n $variables = [\n 'name_first' => $person->name_first,\n 'name_initials' => $person->name_initials,\n 'name_last' => $person->name_last,\n 'name_middle' => $person->name_middle,\n 'name_prefix' => $person->name_prefix,\n 'name_nickname' => $person->name_nickname,\n 'birth_date' => $person->birth_date,\n 'remarks' => $person->remarks,\n ];\n\n $res = $this->graphql($query, $variables, 'testCreatePerson')->assertNoErrors();\n $id = $res->data('createPerson.id');\n $this->assertDatabaseHas('persons', [\n 'id' => $id,\n 'name_first' => $person->name_first,\n 'name_initials' => $person->name_initials,\n 'name_last' => $person->name_last,\n 'name_middle' => $person->name_middle,\n 'name_prefix' => $person->name_prefix,\n 'name_nickname' => $person->name_nickname,\n 'birth_date' => $person->birth_date,\n 'remarks' => $person->remarks,\n ]);\n }"
] | [
"0.7454052",
"0.65497655",
"0.6511187",
"0.64409375",
"0.643581",
"0.63131267",
"0.62320185",
"0.6205848",
"0.6190367",
"0.60295904",
"0.60168815",
"0.5931427",
"0.5909124",
"0.58971924",
"0.58864176",
"0.587841",
"0.5850355",
"0.5848471",
"0.5835594",
"0.5803606",
"0.5799933",
"0.57883483",
"0.57877517",
"0.5782114",
"0.5762594",
"0.57349336",
"0.5728704",
"0.57255834",
"0.57229084",
"0.571077"
] | 0.82223374 | 0 |
TODO: Implement canHandleTask() method. | public function canHandleTask($task): bool
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function handleTask(TaskInterface $task);",
"protected abstract function perform($task);",
"public function canProcessTask(TaskInterface $task);",
"public abstract function run($task);",
"public function takeTask($task)\n {\n }",
"public function processTask($task) { // method wrap left for compatibility reasons\r\n\t\t$this->_processTask($task);\r\n\t}",
"public function withTask(): ?TaskInterface;",
"public function processTask(TaskInterface $task);",
"public function execute(TaskInterface $task);",
"public function getActiveTask(){ }",
"public function testTaskWorkSetTaskRead()\n {\n }",
"public function getTaskClass(){ }",
"public function handleAddingTask()\n {\n $post = $this->ci->input->post();\n\n $params = isset($post['params']) ? $post['params'] : array();\n\n $params['type'] = $post['type'];\n $params['id'] = $post['id'];\n\n $task = [\n 'name' => $post['name'],\n 'type' => 'POKE',\n 'frequency' => 'ONCE',\n 'priority' => isset($post['priority']) ? $post['priority'] : 1,\n 'params' => http_build_query($params)\n ];\n\n return $this->taskManager->addTask($task);\n }",
"public static function hasTasks();",
"protected function task( $item ) {\n\n // Your Logic here\n return false;\n }",
"public function process(TaskInterface $event) : TaskInterface;",
"public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}",
"public function handleTasksInCalendar()\n {\n return false;\n }",
"public function run(Tide $tide, Task $task);",
"private function checkTask() : bool\n {\n\n $check = true;\n if (isset($_POST['task'])) {\n $task = $_POST['task'];\n\n if ($task === 'createMenuItem' && $this->checkNewItem()) {\n $this->task = $task;\n\n } elseif ($task === 'createMenuCategory' && $this->checkNewCategory()) {\n $this->task = $task;\n\n } else {\n $check = false;\n\n }\n } else {\n $check = false;\n }\n\n return $check;\n }",
"protected function passToRemoteProcessor(Task $task)\n {\n return $this->getRemoteProcessor($task)->run($task, function ($type, $host, $line) {\n if (Str::startsWith($line, 'Warning: Permanently added ')) {\n return;\n }\n\n $this->displayOutput($type, $host, $line);\n });\n }",
"abstract protected function task( $item );",
"public function testTaskWorkCanFinalizeTaskByIds()\n {\n }",
"function onTask(\\swoole_http_server $server, $taskId, $fromId, $taskObj)\n {\n }",
"public function handle()\n {\n if (!Helper::Lock($this->signature)) {\n $this->comment($this->signature . \" script is exists.\\n\");\n return false;\n }\n\n $t_now = time();\n\n try {\n while (true) {\n $task_list = DB::table('tasks')\n ->where('status', 0)\n ->get();\n\n if (!$task_list) {\n $this->comment(\"task list is none\");\n sleep(5);\n }\n\n $now = date('Y-m-d H:i:s', time());\n foreach ($task_list as $item) {\n if (!in_array($item->work_id, [\"share\", \"order\", \"transfer\"])) {\n continue;\n }\n if ($item->run_time <= $now) {\n $factory = new Factory($item->work_id);\n $factory->createCmd($item);\n $factory->runCmd();\n $this->comment($factory->getCmd() . \" is start run.\\n\");\n $this->updateStatus($item->id, $item->work_id, $item->run_time);\n }\n }\n\n unset($task_list);\n if ((time() - $t_now) > 1200) {\n $this->comment($this->signature . \" script is run 20 minutes.\\n\");\n Helper::unlock($this->signature);\n return true;\n }\n\n $this->comment(\"task sleep 5 seconds.\");\n sleep(5);\n }\n } catch (\\Exception $e) {\n $this->comment($e->getMessage());\n } finally {\n Helper::unlock($this->signature);\n return true;\n }\n\n }",
"abstract function synch($task, $entity);",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"abstract public function run(Task $task, \\Closure $callback = null);",
"private function processTask($task = '') {\n\n //sanity - make sure this is a valid task object\n if ($task instanceof \\App\\Models\\Task) {\n\n //default values\n $task->assigned_to_me = false;\n $task->running_timers = false;\n $task->timer_current_status = false;\n $task->has_attachments = false;\n $task->has_comments = false;\n $task->has_checklist = false;\n\n //check if the task is assigned to me\n foreach ($task->assigned as $user) {\n if ($user->id == auth()->id()) {\n //its assigned to me\n $task->assigned_to_me = true;\n }\n }\n\n $task->has_attachments = ($task->attachments_count > 0) ? true : false;\n $task->has_comments = ($task->comments_count > 0) ? true : false;\n $task->has_checklist = ($task->checklists_count > 0) ? true : false;\n\n //check if there are any running timers\n foreach ($task->timers as $timer) {\n if ($timer->timer_status == 'running') {\n //its has a running timer\n $task->running_timers = true;\n if ($timer->timer_creatorid == auth()->id()) {\n $task->timer_current_status = true;\n }\n }\n }\n\n //get users current/refreshed time for the task (if applcable)\n $task->my_time = $this->timerrepo->sumTimers($task->task_id, auth()->id());\n }\n }"
] | [
"0.75210595",
"0.6980265",
"0.6964647",
"0.67624736",
"0.6516274",
"0.65131867",
"0.6399468",
"0.63535386",
"0.6260033",
"0.61838067",
"0.6147063",
"0.61363983",
"0.6067541",
"0.60601336",
"0.60253656",
"0.5984005",
"0.5942983",
"0.5929786",
"0.5906399",
"0.58778274",
"0.58661234",
"0.5853397",
"0.5838076",
"0.58236235",
"0.58215636",
"0.5800198",
"0.57907915",
"0.57907915",
"0.577379",
"0.57683045"
] | 0.7817339 | 0 |
TODO: Implement takeTask() method. | public function takeTask($task)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTaskWorkSetTaskRead()\n {\n }",
"public function getLastTask(){ }",
"protected function take(){\n $temp = explode(',', $_POST['task']);\n if(TransitionModel::model()->isEnabled($temp[0], $temp[1])){\n $reset = TransitionModel::model()->fireStart($temp[0], $temp[1]);\n $caseProgress = new Case_ProgressModel;\n $caseProgress->id_case = $temp[0];\n $caseProgress->id_transition = $temp[1];\n $caseProgress->started_by = Flow::app()->auth->getUserId();\n $caseProgress->timestamp_start= date(\"Y-m-d H:i:s\");\n $caseProgress->save(TRUE);\n if(!empty($reset)){\n foreach ($reset as $r){\n $query = 'INSERT INTO `reset_arc_cancel` (`case_progress_id`,`consumed_tokens`, `arc_id`) VALUES (' . $caseProgress->id . ', ' . $r->tokens . ', ' . $r->id . ');'; \n Flow::app()->pdo->query($query);\n }\n }\n \n }\n else{\n Flow::app()->alertmanager->setAlert('task-error', 'alert-danger', 'Task uz nie je k dispozicii');\n }\n header('Location:' . ENTRY_SCRIPT_URL . 'task/listAvailable', TRUE, 301);\n }",
"protected abstract function perform($task);",
"public abstract function run($task);",
"public function applyTask()\n\t{\n\t\t$this->saveTask(false);\n\t}",
"abstract protected function task( $item );",
"public function withTask(): ?TaskInterface;",
"public function getActiveTask(){ }",
"public function testTaskWorkGetTasks()\n {\n }",
"public function testTaskWorkGetTaskWorkForAutoAssign()\n {\n }",
"public function takeOrder($task) {\n $task->setWorker($this);\n $dao = new TaskDAO;\n $dao->update($task);\n }",
"public function copy() {\n $task = new Task();\n $task->isDone = $this->isDone;\n $task->cost = $this->cost;\n $task->finishTime = $this->finishTime;\n $task->quantity = $this->quantity;\n $task->worksheet = $this->worksheet;\n $task->invItem = $this->invItem;\n }",
"public function readTheTask () \n\t{\n\t\t$this->descipiton;\n\t}",
"public function testTaskWorkAutoAssign()\n {\n }",
"public static function generatorTask()\n {\n if (!Balancer::hasTask(self::TASK)) {\n Balancer::task(self::TASK);\n }\n\n return Balancer::getTask(self::TASK);\n }",
"public function run()\n\t{\n\t\tforeach ( $this->data as $source ) {\n\t\t\tTask::create($source);\n\t }\n\t}",
"public function push(Task $task): Task;",
"public function execute(TaskInterface $task);",
"public function run(Tide $tide, Task $task);",
"public function getTaskClass(){ }",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"function pass_task( $this_task )\n\t{\n\t\t$this->task = $this_task;\n\t}",
"public function getTask() {\n return $this;\n }",
"public function testTaskWorkSetTaskUnRead()\n {\n }",
"public function process(TaskInterface $event) : TaskInterface;",
"public function testTaskWorkGetActiveTaskWork()\n {\n }",
"public function getTask()\n {\n return $this->task;\n }",
"abstract public function handleTask(TaskInterface $task);",
"abstract public function run(Task $task, \\Closure $callback = null);"
] | [
"0.6316194",
"0.61451465",
"0.6130292",
"0.61183536",
"0.61177385",
"0.5957049",
"0.5952121",
"0.59338516",
"0.587952",
"0.586197",
"0.58385575",
"0.58135426",
"0.57557786",
"0.57304573",
"0.57288885",
"0.5713982",
"0.57008296",
"0.56803703",
"0.56496334",
"0.56264096",
"0.5607861",
"0.56006056",
"0.56006056",
"0.55943096",
"0.5571846",
"0.55706203",
"0.55589426",
"0.55352604",
"0.55128086",
"0.5510715"
] | 0.77479535 | 0 |
Encode a value as json, with pretty printing enabled if DEBUGGING is defined. | private static function encodeJson($value) {
if (defined('DEBUGGING')) {
return json_encode($value, JSON_PRETTY_PRINT);
}
return json_encode($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function encode($value)\n {\n if (!defined('JSON_PRESERVE_ZERO_FRACTION')) define('JSON_PRESERVE_ZERO_FRACTION',1024);\n $str=json_encode($value,JSON_PRESERVE_ZERO_FRACTION);\n self::errorCheck();\n return $str;\n }",
"protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }",
"protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }",
"protected function asJson($value)\n {\n return json_encode($value, JSON_UNESCAPED_UNICODE);\n }",
"public function asJson($value)\n {\n if ($value === null) {\n return $this->nullDisplay;\n }\n\n return is_array($value) ? Html::encode(json_encode($value)) : $value;\n }",
"function json_encode($value, $options = 0)\n {\n global $services_json;\n if (!isset($services_json)) {\n require_code('json_inner');\n $services_json = new Services_JSON();\n }\n return $services_json->encode($value);\n }",
"public function serializeValue($value)\n {\n // encode arrays/objects as JSON\n if (is_array($value) || is_object($value)) {\n return json_encode($value);\n }\n\n return $value;\n }",
"public static function jsonEncode($value, int $options=128)\n {\n return json_encode($value, $options);\n\n }",
"public function prettyJsonEncode($values)\n\t{\n\t\treturn version_compare(PHP_VERSION, '5.4.0', '>=') ? json_encode($values, JSON_PRETTY_PRINT) : json_encode($values);\n\t}",
"function maybe_json_encode($value)\n {\n if (is_array($value) || is_object($value)) {\n $value = json_encode($value);\n }\n\n return $value;\n }",
"public static function jsonEncode($value) : string\n {\n $result = \\json_encode($value, \\JSON_UNESCAPED_SLASHES | \\JSON_UNESCAPED_UNICODE | \\JSON_PARTIAL_OUTPUT_ON_ERROR);\n return \\is_string($result) ? $result : '(invalid data)';\n }",
"public function serialize($value)\n {\n $options = $this->getOptions();\n $cycleCheck = $options->getCycleCheck();\n $opts = [\n 'enableJsonExprFinder' => $options->getEnableJsonExprFinder(),\n 'objectDecodeType' => $options->getObjectDecodeType(),\n ];\n\n try {\n return ZendJson::encode($value, $cycleCheck, $opts);\n } catch (\\InvalidArgumentException $e) {\n throw new Exception\\InvalidArgumentException('Serialization failed: ' . $e->getMessage(), 0, $e);\n } catch (\\Exception $e) {\n throw new Exception\\RuntimeException('Serialization failed: ' . $e->getMessage(), 0, $e);\n }\n }",
"public static function encode($value, int $options = self::DEFAULT_OPTIONS_ENCODE, int $depth = 512): string\n {\n return json_encode($value, $options, $depth);\n }",
"public static function &encode($value, int $options = 0, int $depth = 512)\n\t{\n\t\t$enc = json_encode($value, $options, $depth);\n\t\tself::handleError(json_last_error(), 'encode');\n\t\treturn $enc;\n\t}",
"protected static function jsonArmor($value)\r\n {\r\n return str_replace(\r\n static::$ESCAPE_JSON_CHARACTERS,\r\n static::$ENCODED_JSON_CHARACTERS,\r\n utf8_encode($value)\r\n );\r\n }",
"public static function encode($value, $options = 0, $depth = 512)\n\t{\n\t\tif (version_compare(PHP_VERSION, '5.5.0', '>='))\n\t\t{\n\t\t\t$raw = json_encode($value, $options, $depth);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$raw = json_encode($value, $options);\n\t\t}\n\n\t\t// json_encode() does not escape <, > and &, so we do it with str_replace().\n\t\treturn str_replace(array('<', '>', '&'), array('\\u003c', '\\u003e', '\\u0026'), $raw);\n\t}",
"public function toJson(): string\n {\n return json_encode($this->var, JSON_THROW_ON_ERROR);\n }",
"public function encodeValue($value)\n\t{\n\t\tif($this->type == 'object')\n\t\t{\n\t\t\treturn serialize($value);\n\t\t}\n\t\telseif($this->type == 'boolean')\n\t\t{\n\t\t\treturn $value ? 1 : 0;\n\t\t}\n\t\treturn $value;\n\t}",
"protected function json_encode( $val ) {\r\n\r\n\t\tif( is_array( $val ) || is_object( $val ) )\r\n\t\t\t$val = json_encode( $val );\r\n\r\n\t\treturn $val;\r\n\r\n\t}",
"protected function _encode($value, $format)\n\t{\n\t\tswitch ($format)\n\t\t{\n\t\t\tcase self::FORMAT_PHP:\n\t\t\t\t$value = serialize($value);\n\t\t\t\tbreak;\n\t\t\tcase self::FORMAT_JSON:\n\t\t\t\t$value = json_encode($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function stringEncode($value)\n {\n return $value\n ? json_encode(array_values($value))\n : null;\n }",
"public static function stringify ($value, $replacer = null, $space = null) {\n\t\t#/opt/haxe/std/php/_std/haxe/Json.hx:42: characters 3-47\n\t\treturn Json::phpJsonEncode($value, $replacer, $space);\n\t}",
"public function toPrettyJson(): string\n {\n return json_encode($this->buildDataForExport(), JSON_PRETTY_PRINT);\n }",
"public static function encodeValue($value) : string\n {\n return \\var_export($value, true);\n }",
"function json_response($value, $options = 0, $depth = 512) {\n\t\theader('Content-type: application/json; charset=utf-8');\n\t\techo json_encode($value, $options, $depth);\n\t\treturn;\n\t}",
"function encode($value)\n {\n switch (gettype($value)) {\n case 'boolean':\n return $value ? 'true' : 'false';\n case 'integer':\n case 'double':\n return $value;\n case 'string':\n return '\"' . $this->quote($value) . '\"';\n case 'array':\n if (array_keys($value) === range(0, count($value) - 1)) {\n // encode as array\n $elts = array();\n foreach ($value as $val) {\n $elts[] = $this->encode($val);\n }\n return '[' . implode(',', $elts) . ']';\n } else {\n // encode as object\n $members = array();\n foreach ($value as $key => $val) {\n $members[] = '\"' . $this->quote($key) . '\":'\n . $this->encode($val);\n }\n return '{' . implode(',', $members) . '}';\n }\n case 'object':\n return $this->encode(get_object_vars($value));\n case 'NULL':\n return 'null';\n default:\n $msg = __FUNCTION__ . '(): type is unsupported, encoded as null';\n trigger_error($msg, E_USER_WARNING);\n return 'null';\n }\n }",
"private function serializeValue($value)\n {\n $serializeValue = (is_string($value) && !($this->flags & self::NO_SERIALIZE_STRINGS))\n // or we have an array and array serialization is enabled...\n || (is_array($value) && !($this->flags & self::NO_SERIALIZE_ARRAYS))\n // or we have any other non-scalar, non-null value\n || (null !== $value && !is_scalar($value) && !is_array($value));\n\n if ($serializeValue) {\n return Serializer::serialize($value);\n }\n\n // If we have an array and array serialization is disabled, serialize\n // its entries if necessary\n if (is_array($value)) {\n return array_map(array($this, 'serializeValue'), $value);\n }\n\n return $value;\n }",
"public function toJSON($pretty);",
"public function jsonSerialize(): mixed\n {\n if (static::$_jsonEncodeFormat instanceof Closure) {\n return call_user_func(static::$_jsonEncodeFormat, $this);\n }\n\n return $this->i18nFormat(static::$_jsonEncodeFormat);\n }",
"public function to_json() {\n\t\tparent::to_json();\n\t\t$this->json['max'] = $this->max;\n\t\t$this->json['levels'] = $this->levels;\n\t\t$this->json['object_type'] = $this->object_type;\n\t\t$this->json['object_subtype'] = $this->object_subtype;\n\t\t$this->json['fsettings'] = json_encode( $this->fsettings );\n\t}"
] | [
"0.7458968",
"0.70018876",
"0.70018876",
"0.70018876",
"0.68809974",
"0.6878451",
"0.6866882",
"0.6859756",
"0.6820804",
"0.6814561",
"0.67915815",
"0.67737365",
"0.6752251",
"0.67396104",
"0.661517",
"0.6454101",
"0.6443262",
"0.630106",
"0.626535",
"0.6231922",
"0.61978924",
"0.6197531",
"0.6180295",
"0.6133613",
"0.6096804",
"0.6039117",
"0.6025661",
"0.60122913",
"0.60057837",
"0.5993589"
] | 0.8643665 | 0 |
fonction backoffice_nextgames permet d'afficher la liste des prochains matchs | function backoffice_nextgames(){
//on charge le model
$this->loadModel('Game');
// fonction pagination
$d['elementPerPage'] = 25; // NB d'elements par pages
$d['page'] = $this->request->page; // Nb de pages (voir fonction request)
// pr($this->request);
$limit = $d['elementPerPage'] * ($d['page']-1); // limit par pages
//Conditions matchs pas terminés
$conditions = array('end_game' => 0);
$d['nbGames'] = $this->Game->findCount($conditions);
$d['games'] = $this->Game->find(array(
'conditions'=> $conditions,
'order' => 'id DESC',
'limit'=> $limit.', '.$d['elementPerPage'],
));
$d['nbPages'] = ceil($d['nbGames'] / $d['elementPerPage']);
$this->set($d);
//Conditions matchs pas terminés
$conditions = array('end_game'=> 0);
$nbGames = $this->Game->findCount($conditions);
$this->set('nbGames', $nbGames);
// Chargement du fichier qui contient tous les findlists
require(ROOT.DS.'controllers'.DS.'findlist_controller.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchList($param)\n{\n unset($param);\n\n $ec = new ExtractorConfig();\n\n $matches = [];\n foreach ($ec->getConfig('matches') as $match) {\n $matches[] = [\n 'match' => $match['match'],\n 'teamNum' => $match[$ec->getConfig('team')],\n 'current' => ($ec->getConfig('currentMatch') === $match['match'])\n ];\n }\n\n // Handle any extra matches.\n $extra = ExtractorStorage::fetch('sys', 'extraMatches');\n if ($extra !== false) {\n foreach ($extra as $match) {\n $matches[] = [\n 'match' => $match['match'],\n 'teamNum' => $match['team'],\n 'current' => ($ec->getConfig('currentMatch') === $match['match'])\n ];\n }\n }\n\n $context = [\n 'team' => ExtractorUtil::teamNiceName($ec->getConfig('team')),\n 'teamColor' => ExtractorUtil::teamColor($ec->getConfig('team')),\n 'matches' => $matches,\n ];\n\n echo render('matchList', $context, 'Match List');\n\n return;\n}",
"public function getPLmatches()\n\t{\n\t\t// Recupera as página com as tabelas\n\t\t$pageContents = $this->getPageContents('https://www.gazetaesportiva.com/campeonatos/paulista/');\n\n\t\t// Inicia um documento DOM\n\t\t$doc = new DOMDocument();\n\t\t$doc->loadHTML($pageContents);\n\n\t\t// Pega o conteudo HTML do documento\n\t\t$xpath = new DOMXPath($doc);\n\n\t\t// Guarda o código fonte das rodadas\n\t\t$rounds = array();\n\n\t\t// Guarda os dados das partidas\n\t\t$matches = array();\n\n\t\t// Loop for (1 a 12)\n\t\tfor ($a=1; $a <= 12; $a++) {\n\t\t\t// Separa as rodadas\n\t\t\t$rounds[$a] = $xpath->query(\"//div[contains(@class,'rodadas_grupo__numero_rodada_{$a}')]\");\n\t\t}\n\n\t\t// Loop for (1 a 12)\n\t\tfor ($c=1; $c <= 12; $c++) {\n\t\t\t// Loop for (0 a 8)\n\t\t\tfor ($i=0; $i < 8; $i++) {\n\t\t\t\t// Pega a data e o lugar da partida\n\t\t\t\t$matchDatePlace = $rounds[$c]->item(0);\n\t\t\t\t$matchDatePlace = $matchDatePlace->getElementsByTagName('li')->item($i);\n\t\t\t\t$matchDatePlace = $matchDatePlace->getElementsByTagName('span')->item(0)->nodeValue;\n\n\t\t\t\t// Separa a data do local\n\t\t\t\t$matchDatePlace = explode(\"•\", $matchDatePlace);\n\t\t\t\t$matchDate = $matchDatePlace[0];\n\t\t\t\t$matchPlace = $matchDatePlace[1];\n\n\t\t\t\t// Pega o nome do primeiro time\n\t\t\t\t$teams[0]['name'] = $rounds[$c]->item(0)->getElementsByTagName('li')->item($i)->getElementsByTagName('span')->item(3)->nodeValue;\n\n\t\t\t\t// Pega o placar do primeiro time\n\t\t\t\t$teams[0]['score'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[0]['score'] = $teams[0]['score']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[0]['score'] = $teams[0]['score']->getElementsByTagName('span')->item(5)->nodeValue;\n\n\t\t\t\t// Pega o nome do segundo time\n\t\t\t\t$teams[1]['name'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('span')->item(7);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('a')->item(2)->nodeValue;\n\t\t\t\t\n\t\t\t\t// Pega o placar do segundo time\n\t\t\t\t$teams[1]['score'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[1]['score'] = $teams[1]['score']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[1]['score'] = $teams[1]['score']->getElementsByTagName('span')->item(6)->nodeValue;\n\n\t\t\t\t// Adiciona a partida ao array de dados\n\t\t\t\t$matches[$c][$i] = array(\n\t\t\t\t\tstr_replace(\"\\n\", '', $teams[0]['name']) => str_replace(\"\\n\", '',$teams[0]['score']),\n\t\t\t\t\tstr_replace(\"\\n\", '', $teams[1]['name']) => str_replace(\"\\n\", '',$teams[1]['score']),\n\t\t\t\t\t'date' => str_replace(\"\\n\", '',$matchDate),\n\t\t\t\t\t'place' => substr(str_replace(\"\\n\", '', $matchPlace), 1)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Retorna o array com as partidas\n\t\treturn $matches;\n\t}",
"public function playAllMatches()\n {\n try {\n $weeks = Week::all();\n foreach ($weeks as $week) {\n\n $matches = $week->matches;\n\n foreach ($matches as $match) {\n DB::transaction(function()use($match) {\n $home_team_goals = rand(0, 8);\n $guest_team_goals = rand(0, 8);\n\n $home_team_match = $match->homeTeamMatch;\n $home_team_match->result = $home_team_goals < $guest_team_goals ? 0 : ($home_team_goals > $guest_team_goals ? 3 : 1);\n $home_team_match->goals_count = $home_team_goals < $guest_team_goals ? 0 : $home_team_goals;\n $home_team_match->save();\n\n $guest_team_match = $match->guestTeamMatch;\n $guest_team_match->result = $home_team_goals > $guest_team_goals ? 0 : ($home_team_goals < $guest_team_goals ? 3 : 1);\n $guest_team_match->goals_count = $home_team_goals > $guest_team_goals ? 0 : $guest_team_goals;\n $guest_team_match->save();\n\n $match->is_played = true;\n $match->save();\n });\n\n }\n\n\n }\n return ['matches'=>$weeks->last()->matches()->with(['homeTeamMatch.team', 'guestTeamMatch.team'])->get(), 'week'=>$weeks->last()];\n\n }catch(Exception $ex){}\n\n }",
"public function get_all_match() {\n /* Puis tous les matchs de cette dernière saison */\n $query = $this->_bdd->query(\"select * from MATCHS order by Id DESC\");\n $this->_nb = 0;\n if( $query->rowCount() > 0) {\n while ($data = $query->fetch()) {\n $this->_data[$this->_nb] = $data;\n $this->_data[$this->_nb]['Saison'] = $this->_bdd->query(\"select Saison from SAISONS where Id = \".$data['IdSaison']);\n $this->_nb++;\n }\n }\n }",
"function getAllMatchesToBet($friendlist){\n // Get sql connexion\n global $sql;\n // Get all not played matches\n $req = \"SELECT * FROM matches\n WHERE\n status = '\"._PLANNED.\"'\n ORDER BY date\n \";\n $res = $sql->doQuery($req);\n $matches = $sql->fetchAssoc($res);\n \n // Now for each match, check if the user has already done a bet\n $return = array();\n foreach($matches as $match){\n $req = \"SELECT * FROM pronostics\n WHERE\n members_login = '\".mysqli_real_escape_string($sql->dbhandle, $this->login).\"' AND\n matches_id_match = '\".mysqli_real_escape_string($sql->dbhandle, $match['id_match']).\"' AND\n friendlist_name = '\".mysqli_real_escape_string($sql->dbhandle, $friendlist).\"'\n \";\n $bet = $sql->doQuery($req, true);\n // If no bet is found for this match, return it\n if (!$bet){\n $return[] = $match;\n }\n }\n // Return the matches\n return $return;\n }",
"function getNextMatchToBet($friendlist){\n // Get sql connexion\n global $sql;\n // Get all not played matches\n $req = \"SELECT * FROM matches\n WHERE\n status = '\"._PLANNED.\"'\n ORDER BY date\n \";\n $res = $sql->doQuery($req);\n $matches = $sql->fetchAssoc($res);\n \n // Now for each match, check if the user has already done a bet\n foreach($matches as $match){\n $req = \"SELECT * FROM pronostics\n WHERE\n members_login = '\".mysqli_real_escape_string($sql->dbhandle, $this->login).\"' AND\n matches_id_match = '\".mysqli_real_escape_string($sql->dbhandle, $match['id_match']).\"' AND\n friendlist_name = '\".mysqli_real_escape_string($sql->dbhandle, $friendlist).\"'\n \";\n $bet = $sql->doQuery($req, true);\n // If no bet is found for this match, return it\n if (!$bet){\n return $match;\n }\n }\n // No matches found\n return null;\n }",
"private function generateGames() {\n\t\n\t}",
"public function createFirstMatches() {\n $teamRepository = new TeamRepository();\n $currentMatches = [];\n $teams = $this->teamRepository->getTeams();\n //check the errors\n if (count($teams) !== 8) {\n $this->errors[] = 'Il doit y avoir 8 équipes pour lancer un tournoi.';\n require_once 'src/View/Match/show.php';\n exit;\n } else {\n $isCorrect = true;\n foreach ($teams as $team) {\n if(!$this->hasEnoughPlayer($team)) {\n $isCorrect = false;\n }\n }\n if (!$isCorrect) {\n $this->errors[] = 'Il doit y avoir au moins 2 joueurs par équipe.';\n require_once 'src/View/Match/show.php';\n exit;\n } else {\n //generate the matches\n for ($i=0; $i < 4 ; $i++) { \n $match = new Match();\n $randomKeys = array_rand($teams, 2);\n $match->setTeamOne($teams[$randomKeys[0]]->getId());\n $match->setTeamTwo($teams[$randomKeys[1]]->getId());\n array_splice($teams,$randomKeys[1], 1);\n array_splice($teams,$randomKeys[0], 1);\n $this->matchRepository->insert($match);\n $currentMatches[] = $this->matchRepository->getMatch(\"WHERE match_id =\" . $this->getCurrentMatchId(4));\n }\n }\n return $currentMatches;\n }\n }",
"function matchShowMaplist(){\n\tglobal $_debug,$_match_conf,$_match_map,$_ChallengeList;\n\t\n\t$maxi = $_match_conf['ShowNextMaps'] - $_match_map + 1;\n\tif($maxi < 1)\n\t\treturn;\n\n\t$msg = localeText(null,'server_message').'Next challenges: ';\n\t$msg .= stringMapList($maxi);\n\t\n\t// send message in offical chat\n\taddCall(null,'ChatSendServerMessage', $msg);\n}",
"public function getBRmatches()\n\t{\n\t\t// Recupera as página com as tabelas\n\t\t$pageContents = $this->getPageContents('https://www.gazetaesportiva.com/campeonatos/brasileiro-serie-a/');\n\n\t\t// Inicia um documento DOM\n\t\t$doc = new DOMDocument();\n\t\t$doc->loadHTML($pageContents);\n\n\t\t// Pega o conteudo HTML do documento\n\t\t$xpath = new DOMXPath($doc);\n\n\t\t// Guarda o código fonte das rodadas\n\t\t$rounds = array();\n\n\t\t// Guarda os dados das partidas\n\t\t$matches = array();\n\n\t\t// Loop for (1 a 38)\n\t\tfor ($a=1; $a <= 38; $a++) {\n\t\t\t// Separa as rodadas\n\t\t\t$rounds[$a] = $xpath->query(\"//div[contains(@class,'rodadas_grupo_A_numero_rodada_{$a}')]\");\n\t\t}\n\n\t\t// Loop for (1 a 38)\n\t\tfor ($c=1; $c <= 38; $c++) {\n\t\t\t// Loop for (0 a 9)\n\t\t\tfor ($i=0; $i < 10; $i++) {\n\t\t\t\t// Pega a data e o lugar da partida\n\t\t\t\t$matchDatePlace = $rounds[$c]->item(0);\n\t\t\t\t$matchDatePlace = $matchDatePlace->getElementsByTagName('li')->item($i);\n\t\t\t\t$matchDatePlace = $matchDatePlace->getElementsByTagName('span')->item(0)->nodeValue;\n\n\t\t\t\t// Separa a data do local\n\t\t\t\t$matchDatePlace = explode(\"•\", $matchDatePlace);\n\t\t\t\t$matchDate = $matchDatePlace[0];\n\t\t\t\t$matchPlace = $matchDatePlace[1];\n\n\t\t\t\t// Pega o nome do primeiro time\n\t\t\t\t$teams[0]['name'] = $rounds[$c]->item(0)->getElementsByTagName('li')->item($i)->getElementsByTagName('span')->item(3)->nodeValue;\n\n\t\t\t\t// Pega o placar do primeiro time\n\t\t\t\t$teams[0]['score'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[0]['score'] = $teams[0]['score']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[0]['score'] = $teams[0]['score']->getElementsByTagName('span')->item(5)->nodeValue;\n\n\t\t\t\t// Pega o nome do segundo time\n\t\t\t\t$teams[1]['name'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('span')->item(7);\n\t\t\t\t$teams[1]['name'] = $teams[1]['name']->getElementsByTagName('a')->item(2)->nodeValue;\n\t\t\t\t\n\t\t\t\t// Pega o placar do segundo time\n\t\t\t\t$teams[1]['score'] = $rounds[$c]->item(0);\n\t\t\t\t$teams[1]['score'] = $teams[1]['score']->getElementsByTagName('li')->item($i);\n\t\t\t\t$teams[1]['score'] = $teams[1]['score']->getElementsByTagName('span')->item(6)->nodeValue;\n\n\t\t\t\t// Adiciona a partida ao array de dados\n\t\t\t\t$matches[$c][$i] = array(\n\t\t\t\t\tstr_replace(\"\\n\", '', $teams[0]['name']) => str_replace(\"\\n\", '',$teams[0]['score']),\n\t\t\t\t\tstr_replace(\"\\n\", '', $teams[1]['name']) => str_replace(\"\\n\", '',$teams[1]['score']),\n\t\t\t\t\t'date' => str_replace(\"\\n\", '',$matchDate),\n\t\t\t\t\t'place' => substr(str_replace(\"\\n\", '', $matchPlace), 1)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Retorna o array com as partidas\n\t\treturn $matches;\n\t}",
"static public function playWeekMatches($week) {\n $possibleScores = [];\n $j = self::MAX_SCORE;\n for ($i = self::MIN_SCORE; $i <= self::MAX_SCORE; $i++) {\n $possibleScores[$i] = $j - $i;\n }\n\n $weekMatches = Match::where('week', $week)->get();\n foreach ($weekMatches as &$match) {\n $firstScore = CalculationHelper::getWeightedRandVal($possibleScores);\n $secondScore = CalculationHelper::getWeightedRandVal($possibleScores);\n $homeTeam = Team::find($match->home_team_id);\n $awayTeam = Team::find($match->away_team_id);\n $possibleWinners = [\n $homeTeam->id => $homeTeam->strength + self::HOME_TEAM_STRENGTH,\n $awayTeam->id => $awayTeam->strength\n ];\n $winnerTeamId = CalculationHelper::getWeightedRandVal($possibleWinners);\n $maxScore = max($firstScore, $secondScore);\n $minScore = min($firstScore, $secondScore);\n\n // Store match result\n if ($winnerTeamId == $match->home_team_id) {\n $match->home_score = $maxScore;\n $match->away_score = $minScore;\n } else {\n $match->home_score = $minScore;\n $match->away_score = $maxScore;\n }\n $match->save();\n\n\n // Update league (team) table\n if ($match->home_score == $match->min_score) {\n $homeTeam->pts++;\n $awayTeam->pts++;\n } elseif ($match->home_score > $match->min_score) {\n $homeTeam->pts += 3;\n } else {\n $awayTeam->pts += 3;\n }\n $homeTeam->goals_scored += $match->home_score;\n $homeTeam->goals_conceded += $match->away_score;\n $awayTeam->goals_scored += $match->away_score;\n $awayTeam->goals_conceded += $match->home_score;\n\n $homeTeam->plays++;\n $awayTeam->plays++;\n\n $homeTeam->save();\n $awayTeam->save();\n $match->home_team_title = $homeTeam->title;\n $match->away_team_title = $awayTeam->title;\n }\n unset($match);\n\n return $weekMatches;\n }",
"function getAllMatchesWithBets($friendlist){\n // Get sql connexion\n global $sql;\n \n $return = array();\n \n // Get all not played matches\n $req = \"SELECT * FROM matches\n WHERE\n status = '\"._PLANNED.\"'\n ORDER BY date\n \";\n $matches = $sql->fetchAssoc($sql->doQuery($req));\n \n // Now for each match, check if the user has already done a bet\n foreach($matches as $match){\n $req = \"SELECT * FROM pronostics\n WHERE\n members_login = '\".mysqli_real_escape_string($sql->dbhandle, $this->login).\"' AND\n matches_id_match = '\".mysqli_real_escape_string($sql->dbhandle, $match['id_match']).\"' AND\n friendlist_name = '\".mysqli_real_escape_string($sql->dbhandle, $friendlist).\"'\n \";\n $bet = $sql->doQuery($req, true);\n // If no bet is found for this match, return it\n $return[] = array( 'match' => $match, \n 'bet' => $bet,\n );\n }\n // Return the matches\n return $return;\n }",
"function mostplayedMatch(){\n\n\t\t$data = array();\n\t\t$data = $this->query(\"select count(*) as totalbets, b.id as bet_id,bp.name as bet_part_name, bp.odd as bet_part_odd, e.league_id, l.name as league_name, s.name as sport_name, l.sport_id,e.id as event_id,e.name as event_name,e.date as event_date FROM bet_parts as bp,bets as b, events as e, leagues as l, sports as s where e.active = 1 and l.active = 1 and s.active = 1 and b.event_id = e.id and l.id = e.league_id and s.id = l.sport_id and b.id = bp.bet_id and e.date >= DATE(NOW()) AND (e.result = '' or e.result = 'NULL') group by e.league_id order by totalbets DESC\");\n\t\treturn $data;\n\t}",
"public function showNbaPlayoffsMatches($ptr) {\n $_matches = Match::scopeNbaPlayoffsMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n \n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break; \n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"public function getPairings() {\n $sql = \"SELECT\tevents_paarungen.*\n FROM events_paarungen\n\t\t\t\tWHERE event_ID=\".$this->eventID.\"\n AND gameday = \".$this->gameday;\n if($this->event['art'] == 2) {\n $sql .= \" ORDER BY events_paarungen.event_group ASC, events_paarungen.gamenumber ASC\";\n }\n $result = WCF::getDB()->sendQuery($sql);\n while ($row = WCF::getDB()->fetchArray($result)) {\n $row['username_1'] = self::getUserOnlineMarking($row['userID1']);\n $row['username_2'] = self::getUserOnlineMarking($row['userID2']);\n\n if($this->event['art'] == 2) {\n $sql2 = \"SELECT id, teamname\n FROM events_team\n WHERE id=\".$row['teamID1'].\" OR id=\".$row['teamID2'];\n $result2 = WCF::getDB()->sendQuery($sql2);\n while ($row2 = WCF::getDB()->fetchArray($result2)) {\n if ($row2['id'] == $row['teamID1']) {\n $row['teamname1'] = $row2['teamname'];\n }\n elseif ($row2['id'] == $row['teamID2']) {\n $row['teamname2'] = $row2['teamname'];\n }\n }\n if(!isset($row['teamname1'])) $row['teamname1'] = 'Freilos';\n if(!isset($row['teamname2'])) $row['teamname2'] = 'Freilos';\n\n if(!isset($row['matches_1'])) {\n $row['matches_1'] = 0;\n }\n\t\t\t\tif(!isset($row['matches_2'])) {\n\t\t\t\t $row['matches_2'] = 0;\n }\n\n \t\t\tif($row['scoreID_1'] > $row['scoreID_2']) {\n $row['matches_1'] += 1;\n $row['matches_2'] += 0;\n }\n elseif($row['scoreID_1'] < $row['scoreID_2']) {\n $row['matches_1'] += 0;\n $row['matches_2'] += 1;\n }\n else {\n $row['matches_1'] += 0;\n $row['matches_2'] += 0;\n \t\t\t}\n }\n $this->pairings[] = $row;\n }\n\n if($this->event['art'] == 2) {\n $this->removeDoubles();\n }\n }",
"function havePlayersInEarlyGame($earliestGame, $fantasyTeamName, $leagueName, $leagueYear) \n{\n $retval = false;\n $found = false;\n\n $CNFLPlayer = new NFLPlayer($leagueName, $leagueYear);\n $CNFLTeam = new NFLTeam($leagueYear);\n\n //Step 1 -- convert time of earliest game to YYYYMMDD000000\n $dayOfGame = substr(makeTimeStamp($earliestGame), 0, 8) . \"000000\";\n //Find all games for that day\n $CNFLSchedule = new NFLSchedule($leagueName, $leagueYear);\n $CNFLSchedule->GetAllGamesForDate($dayOfGame);\n while ($CNFLSchedule->GetNextRecord()) \n {\n //Get nfl teams for the week\n $visitorName = $CNFLTeam->getShortNameFromID($CNFLSchedule->getVisitorNumber());\n $homeName = $CNFLTeam->getShortNameFromID($CNFLSchedule->getHomeNumber());\n $CNFLPlayer->GetPlayersOnFantasyTeam($fantasyTeamName);\n while ($CNFLPlayer->GetNextRecord()) \n {\n if ($CNFLPlayer->getNFLTeam() == $visitorName || $CNFLPlayer->getNFLTeam() == $homeName) \n {\n $found = true;\n break;\n }\n }\n if ($found == true) \n {\n $retval = true;\n break;\n }\n }\n\n $CNFLTeam->Destroy();\n $CNFLSchedule->Destroy();\n $CNFLPlayer->Destroy(); \n\n return $retval;\n}",
"public function getHomeMatches()\n {\n return $this->hasMany(OddsGGMatch::className(), ['HomeTeamId' => 'id'])\n ->inverseOf('homeTeam');\n }",
"function getMatchsForRes($tieId, $teamL, $teamR)\r\n\t{\r\n\t\t$ut = new utils();\r\n\t\t// Select the matchs of the tie\r\n\t\t$fields = array('mtch_id', 'mtch_discipline', 'mtch_score',\r\n\t\t 'mtch_order', 'mtch_status', 'mtch_disci');\r\n\t\t$tables[] = 'matchs';\r\n\t\t$where = \"mtch_del != \".WBS_DATA_DELETE.\r\n\t\" AND mtch_tieId = $tieId\";\r\n\t\t$order = \"mtch_rank\";\r\n\t\t$res = $this->_select($tables, $fields, $where, $order);\r\n\r\n\t\t// Construc a table with the match\r\n\t\twhile ($match = $res->fetchRow(DB_FETCHMODE_ASSOC))\r\n\t\t{\r\n\t $match['mtch_regiId00'] = -10;\r\n\t $match['mtch_regiId01'] = -10;\r\n\t $match['mtch_regiId10'] = -10;\r\n\t $match['mtch_regiId11'] = -10;\r\n\t $match['mtch_result0'] = WBS_RES_NOPLAY;\r\n\t $match['mtch_result1'] = WBS_RES_NOPLAY;\r\n\t $match['mtch_teamId0'] = $teamL;\r\n\t $match['mtch_teamId1'] = $teamR;\n\t if ($match['mtch_discipline'] < 6) $match['mtch_num'] = $ut->getSmaLabel($match['mtch_discipline']);\n\t else $match['mtch_num'] = 'SP';\n\t $match['mtch_num'] .= ' ' . $match['mtch_order'];\r\n\t $matches[$match['mtch_id']] = $match;\r\n\t\t}\r\n\r\n\t\t// Select the players of the matchs of the tie\r\n\t\t$fields = array('mtch_id', 'regi_id', 'regi_teamId', 'i2p_pairId',\r\n\t\t 'rkdf_label', 'p2m_result');\r\n\t\t$tables = array('matchs', 'p2m', 'i2p', 'registration',\r\n\t\t 'ranks', 'rankdef', 'members');\r\n\t\t$where = \" mtch_del != \".WBS_DATA_DELETE.\r\n\t\" AND mtch_tieId = $tieId\".\r\n\t\" AND mtch_id = p2m_matchId\".\r\n\t\" AND p2m_pairId = i2p_pairId\".\r\n\t\" AND i2p_regiId = regi_id\".\r\n\t\" AND rank_regiId = regi_id\".\r\n\t\" AND rank_rankdefId = rkdf_id\".\r\n\t\" AND rank_discipline = mtch_disci\".\r\n\t\" AND regi_memberId = mber_id\";\r\n\t\t$order = \"mtch_id, regi_teamId, mber_sexe\";\r\n\t\t$res = $this->_select($tables, $fields, $where, $order);\r\n\r\n\t\t// Coomplete the table with player's match\r\n\t\t$uts = new utscore();\r\n\t\t$pairId=-1;\r\n\t\twhile ($player = $res->fetchRow(DB_FETCHMODE_ASSOC))\r\n\t\t{\r\n\t $match = $matches[$player['mtch_id']];\r\n\t $uts->setScore($match['mtch_score']);\r\n\t if ($player['regi_teamId'] == $teamL)\r\n\t {\r\n\t \tif ($pairId != $player['i2p_pairId'])\r\n\t \t{\r\n\t \t\t$match['mtch_regiId00'] = $player['regi_id'];\r\n\t \t\t$match['mtch_result0'] = $player['p2m_result'];\r\n\t \t\t$pairId = $player['i2p_pairId'];\r\n\t \t}\r\n\t \telse\r\n\t\t $match['mtch_regiId01' ] = $player['regi_id'];\r\n\t }\r\n\t else\r\n\t {\r\n\t \tif ($pairId != $player['i2p_pairId'])\r\n\t \t{\r\n\t \t\t$match['mtch_regiId10'] = $player['regi_id'];\r\n\t \t\t$match['mtch_result1'] = $player['p2m_result'];\r\n\t \t\t$pairId = $player['i2p_pairId'];\r\n\t \t}\r\n\t \telse\r\n\t\t $match['mtch_regiId11' ] = $player['regi_id'];\r\n\r\n\t }\r\n\t $matches[$player['mtch_id']] = $match;\r\n\t\t}\r\n\r\n\t\treturn $matches;\r\n\r\n\t}",
"static public function generateMatches() {\n DB::table('matches')->truncate();\n\n $team_ids = [];\n $teams = DB::table('teams')->select('id')->get();\n $weeks = 2 * (count($teams)-1);\n foreach($teams as $team) {\n $team_ids[$team->id] = $team->id;\n }\n for ($w = 1; $w <= $weeks; $w++) {\n $week_team_ids = $team_ids;\n while(count($week_team_ids) > 1) {\n $match = new Match;\n $match->home_team_id = array_pop($week_team_ids);\n $match->away_team_id = array_rand($week_team_ids, 1);\n $match->week = $w;\n unset($week_team_ids[$match->away_team_id]);\n $match->save();\n }\n }\n\n return 1;\n }",
"public function matches() {\n\t\treturn $this->matchTeamOne->merge($this->matchTeamSecond);\n\t}",
"public function showCsgoMatches($ptr) {\n $_matches = Match::csgoMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n\n }\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break;\n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"public function showLolMatches($ptr) {\n $_matches = Match::LolMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n\n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break; \n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"function teams() {\n\t\tglobal $db;\n\n\t\t$sql = \"\n\t\tSELECT\n\t\t\tuser.username as username,\n\t\t\tuser.id as user_id,\n\t\t\tstl_players.team_id as team_id,\n\t\t\tstl_positions.*\n\t\tFROM stl_players\n\t\t\tLEFT JOIN user\n\t\t\t\tON\n\t\t\t\tuser.id = stl_players.user_id\n\t\t\tINNER JOIN stl_positions\n\t\t\t\tON\n\t\t\t\tstl_players.user_id = stl_positions.ship_user_id\n\t\tWHERE\n\t\t\tstl_players.game_id = '$_GET[game_id]'\n\t\t\tAND\n\t\t\tstl_positions.game_id = '$_GET[game_id]'\n\n\n\t\t\";\n\t\t$result = $db->query($sql,__FILE__,__LINE__);\n\t\t$add1 = \"<b>\";\n\t\twhile($rs = $db->fetch($result)) {\n\t\t\t$add1 = ($rs['hit_user_id']) ? \"<b style='text-decoration: line-through'>\" : \"<b>\";\n\t\t\tif($rs['team_id'] == 0) {\n\t\t\t\t$this->data['team_gelb'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t} else {\n\t\t\t\t$this->data['team_gruen'] .= $add1.$rs['username'].\"</b><br>\";\n\t\t\t}\n\t\t}\n\n\t}",
"public function loadNextMatchesPage($teamID){\n \n $_SESSION['section'] = \"wattBall\";\n $pageName = \"teams\";\n $team = new Team($this->db, $teamID);\n $team->getTeamInfo();\n $team->getEvent();\n $matchesDone = $team->getMatchesDone();\n $matchesResults = array();\n $comingMatches = $team->getComingMatches();\n \n for($i=0;$i<count($matchesDone);$i++){\n $result = $this->db->query(\"SELECT * FROM wattball_results WHERE matchID = \".$matchesDone[$i]->getID());\n $data = $result->fetch();\n if($data != FALSE)\n {\n $matchesResults[$i] = new Result($data['resultID'], new Team($this->db , $data['team1']) , new Team($this->db , $data['team2']) , $data['team1Score'] , $data['team2Score'] , $this->db);\n $matchesResults[$i]->getGoals();\n }\n }\n \n $this->addBasicView();\n require_once 'view/wattBallNav.php';\n require_once 'view/nextMatches.php';\n require_once 'view/login.php';\n $this->addFooterFile();\n }",
"public function showSportsMatches($ptr) {\n $_matches = Match::sportsMatches()->mainMatches()->whereNotIn('matches.status',['open','ongoing'])->orderBy('schedule', 'desc')->offset($ptr)->limit(10)->get()->load('league','teamA', 'teamB', 'teamC');\n $currList = collect();\n $oldList = collect();\n $query = \\DB::table('bets')->whereIn('match_id', $_matches->pluck('id'))\n ->selectRaw(\"COUNT(id) AS bet_count, SUM(amount) AS total_bets, team_id, match_id\")\n ->groupBy('match_id', 'team_id')->get();\n foreach ($_matches as $index => $_m) {\n $match_details = $query->where('match_id', $_m->id);\n $team_a_percentage = 50;\n $team_b_percentage = 50;\n $team_c_percentage = 0;\n \n if($match_details->count()) {\n $total_bets = $query->where('match_id', $_m->id)->sum('total_bets');\n $team_a_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_a)->sum('total_bets');\n $team_a_percentage = $total_bets ? ($team_a_bets / $total_bets) * 100 : 0;\n\n $team_b_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_b)->sum('total_bets');\n $team_b_percentage = $total_bets ? ($team_b_bets / $total_bets) * 100 : 0;\n\n $team_c_bets = $query->where('match_id', $_m->id)->where('team_id', $_m->team_c)->sum('total_bets');\n $team_c_percentage = $total_bets ? ($team_c_bets / $total_bets) * 100 : 0; \n }\n $_m->teamawin_percentage = number_format($team_a_percentage, 2);\n $_m->teambwin_percentage = number_format($team_b_percentage, 2);\n $_m->teamcwin_percentage = number_format($team_c_percentage, 2);\n\n // $_matches[$index]->team_a_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamA->id), 2);\n // $_matches[$index]->team_b_winPercentage = number_format(matchWinPercentagePerTeam($_m->id, $_m->teamB->id), 2);\n $_matches[$index]->match_sched = $_m->schedule->diffForHumans();\n unset($_matches[$index]->fee);\n \n switch($_m->status) {\n case 'open':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = '';\n case 'ongoing':\n $_matches[$index]->is_current = true;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #72A326; text-shadow: 1px 1px 0px #4A7010; font-weight: bold; font-size: 16px\"> LIVE</span>';\n break;\n case 'settled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() . \n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> SETTLED</span>';\n $_matches[$index]->team_a_winner = ($_m->teamA->id == $_m->team_winner);\n $_matches[$index]->team_b_winner = ($_m->teamB->id == $_m->team_winner);\n $_matches[$index]->team_c_winner = !empty($_m->team_c) && ($_m->teamC->id == $_m->team_winner);\n break;\n case 'draw':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> DRAW - CREDITS RETURNED</span>';\n break;\n case 'cancelled':\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = $_m->schedule->diffForHumans() .\n ' <span style=\"color: #606060; font-weight: bold; font-size: 16px\"> CANCELLED</span>';\n break; \n default:\n $_matches[$index]->is_current = false;\n $_matches[$index]->status = '';\n break;\n }\n \n $oldList->push($_m);\n }\n return [\n 'matches' => $oldList,\n 'pointer' => $ptr += 10\n ];\n }",
"function getWinners() {\n global $players, $winners;\n \n $winnersPoints = getWinnersPoint();\n for ($i = 0; $i < 4; $i++) {\n if ($players[$i] == $winnersPoints) {\n array_push($winners, $i + 1);\n }\n }\n }",
"public function generateMatches()\n {\n $weeks = Week::all();\n $teams = Team::all();\n foreach ($weeks as $week) {\n $wmatches = $week->matches;\n if(count( $wmatches) == 2)\n {\n\n foreach ($wmatches as $wmatch) {\n $wmatch->is_played = 0;\n $wmatch->save();\n $tms = $wmatch->teamMatches;\n foreach ($tms as $tm) {\n $tm->result = 0;\n// $tm->type = 0;\n $tm->goals_count = 0;\n $tm->save();\n }\n\n }\n continue;\n }\n //else\n DB::transaction(function()use($week, $teams) {\n $match1 = Match::create(['week_id'=> $week->id]);\n $this->generateMatch($week, $match1);\n $match2 = Match::create(['week_id'=> $week->id]);\n $this->generateMatch($week, $match2);\n\n\n\n });\n }\n\n $init = new Week(['id'=>0,'order'=>0, 'name'=>'0th']);\n return ['matches' => $weeks->first()->matches()->with(['homeTeamMatch.team', 'guestTeamMatch.team'])->get(), 'week'=>$init];\n// dd( Match::all());\n }",
"function listgames($game = '') {\n $protocols_array = GameQ::getGames(); $games = '';\n $block = array('teamspeak3','gamespy','gamespy2','gamespy3','source');\n foreach ($protocols_array AS $gameq => $info) {\n if(in_array($gameq,$block)) { continue; }\n $selected = (!empty($game) && $game != false && $game == $gameq ? 'selected=\"selected\" ' : '');\n $games .= '<option '.$selected.'value=\"'.$gameq.'\">'.htmlentities($info['name']).'</option>';\n }\n\n return $games;\n}",
"public function getLeaderBoard() {\n\t\t$query = \"SELECT game_id, person.person_id, person.person_name, sum(points + bonus_points) AS score \" .\n\t\t\t\"FROM person_table JOIN person ON person_table.person_id = person.person_id \" .\n\t\t\t\"JOIN (SELECT answer.team_id, round.round_id, sum(answer_is_correct - 1) AS points FROM answer JOIN question ON question.question_id = answer.question_id JOIN round ON question.round_id = round.round_id WHERE round.game_id =:game_id1 AND answer_is_correct > 0 GROUP BY team_id, round_id) AS normalpts ON normalpts.team_id = person_table.team_id AND normalpts.round_id = person_table.round_id \" .\n\t\t\t\"JOIN team_round ON team_round.team_team_id = person_table.team_id AND team_round.round_round_id = person_table.round_id \" .\n\t\t\t\"WHERE person.game_id =:game_id2 \" .\n\t\t\t\"GROUP BY game_id, person_id ORDER BY score DESC\";\n\t\t$data = array('game_id1' => $this -> get_game_id(), 'game_id2' => $this -> get_game_id());\n\t\t$sth = database::$dbh -> prepare($query);\n\t\t$sth -> execute($data);\r\n\t\t$rows = $sth -> fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $rows;\n\t}",
"public function doEverything() {\n //create first matches\n $currentMatches = $this->createFirstMatches();\n //put first matches results\n foreach ($currentMatches as $currentMatch) {\n $this->putResults($currentMatch);\n }\n //generate semi finals\n $currentSemiMatches = $this->createSemiFinals($currentMatches);\n //put semi finals results\n foreach ($currentSemiMatches as $currentMatch) {\n $this->putResults($currentMatch);\n }\n //generate finals\n $finals = $this->createFinals($currentSemiMatches);\n //put finals results\n foreach ($finals as $final) {\n $this->putResults($final);\n }\n //get the winner \n if ($finals[0]->getResultOne() < $finals[0]->getResultTwo()) {\n $winner = $this->teamRepository->getTeam('WHERE team_id =' . \n $this->matchRepository->getMatch('WHERE match_id =' . \n $finals[0]->getId())->getTeamTwo())->getName();\n } else {\n $winner = $this->teamRepository->getTeam('WHERE team_id =' . \n $this->matchRepository->getMatch('WHERE match_id =' . \n $finals[0]->getId())->getTeamOne())->getName();\n }\n require_once 'src/View/Match/show.php';\n }"
] | [
"0.62688124",
"0.606894",
"0.597401",
"0.582453",
"0.5821195",
"0.58122003",
"0.57486206",
"0.57411355",
"0.5677264",
"0.56657153",
"0.5624038",
"0.5622542",
"0.5620504",
"0.56088156",
"0.5599715",
"0.5597888",
"0.55691534",
"0.551512",
"0.5509836",
"0.54861456",
"0.54814136",
"0.5464319",
"0.544989",
"0.53999686",
"0.5396457",
"0.5393283",
"0.5389267",
"0.5354139",
"0.53529596",
"0.53474486"
] | 0.6226476 | 1 |
+ Class : Method : FetchSOAP Created : Richard E. Dye Date : 10/9/2003 Comment : Attempt to retrieve an XML document from Ebsco visibility :public Parameters : string&$inQueryBoolean query (reference!) string$inDBWhich Ebsco database (glh | gkh) number$inNoRecHow many records to retrieve number$inStartRecNoFirst record number string$inModeRetrieval mode (Full for article, Detailed for index) string$inSearchTextFull text search? Returns : stringEbsco XML document (may be error) or false Revisions :12/4/2003: R.E. Dye added $inSearchText paramter to instruct the Ebsco searchPresent call to be set to 'full text' rather than just titles and abstracts. | function FetchSOAP(&$inQuery, $inDB, $inNoRec, $inStartRecNo, $inMode, $inSearchText='')
{
$wsdl = new SOAP_WSDL("http://xml.epnet.com/oemdirectxml/oemdirectxml.asmx?wsdl");
if(!$wsdl || $wsdl->fault)
{
echo "<br><b>Unable to retrive the WSDL from Ebsco.<br></b>\n";
echo $wsdl->fault->message."\n";
return false;
}
$webservice=$wsdl->getProxy();
if(!$webservice)
{
echo "<br>Unable to create the Ebsco WSDL proxy.<br>\n";
return false;
}
/*
$authRequest = array(
'userID'=>'beta.grolier.doug',
'userPwd'=>'doug',
'profileID'=>''
);
*/
$authRequest = array(
'userID' => '',
'userPwd' => '',
'profileID' => 'ehost'
);
//echo "<!-- \$authrequest=\n";
//print_r($authRequest);
//echo " -->\n";
$retval=$webservice->Init($authRequest);
//echo "<!-- \$retval= \n";
//print_r($retval);
//echo " -->\n";
if(!$retval || $retval->errors)
{
echo "<br><b>Unable to initialize an Ebsco session.<br>\n";
echo $retval->errors->error."</b><br>\n";
return false;
}
if(isset($retval->error_message_prefix))
{
echo "<br><b>Unable to initialize an Ebsco session.<br>\n";
echo $retval->message."</b><br>\n";
return false;
}
$sessionID = $retval->sessionID;
//echo "<!-- \$sessionID = $sessionID -->\n";
if($inSearchText == 'y')
$searchText = 'True';
else
$searchText = 'False';
$searchRequest = array(
'db' => $inDB,
'booleanQuery' => $inQuery,
'searchText' => $searchText,
'applyThes' => 'False',
'sort' => 'Date'
);
echo "<!-- \$searchRequest['searchText'] = ".$searchRequest['searchText']." -->\n";
$documentRequest = array(
'startRecNo' => $inStartRecNo,
'noRecs' => $inNoRec,
'format' => $inMode,
'mode' => 'XHTML',
'highlight' => 'False'
);
$oldparse = $webservice->setXMLParse('noparse');
$article=$webservice->SearchPresent($authRequest, $sessionID, $searchRequest, $documentRequest);
$result=$webservice->setXMLParse($oldparse);
//echo "<!-- \$article= $article -->\n";
return $article;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function search()\n {\n// $client = new SoapClient($this->ePrintsHost.\"/wsdl/SearchServ.wsdl\", array(\"trace\" => 1, \"exception\" => 0, 'cache_wsdl' => WSDL_CACHE_NONE));\n// new \\SoapClient();\n\n try {\n ini_set('soap.wsdl_cache_enable', 0);\n ini_set('soap.wsdl_cache_ttl', 0);\n $client = new LocalSoapClient(\"http://192.168.99.100/wsdl/lib.iita.gov.ua/SearchServ.wsdl\",\n array(\"trace\" => 1, \"exception\" => 0, 'cache_wsdl' => WSDL_CACHE_NONE));\n\n if (isset($this->data_range)) {\n $result = $client->searchEprint($this->key, $this->fileds, $this->data_range, $this->order,\n $this->typeIo);\n\n } else {\n $result = $client->searchEprint($this->key, $this->fileds, $this->order);\n }\n// var_dump($client->__getLastRequest());\n// var_dump($client->__getLastResponse());\n// var_dump($client->__getLastRequest());\n } catch (SoapFault $e) {\n var_dump($e);\n\n\n }\n //debug\n// var_dump($client->__getLastResponse());\n\n return $result;\n }",
"function obiee11g_interface_get_requestxml($obiee11gClient,$obiee11gPath){\r\n\t$session_id = $obiee11gClient->_cookies['ORA_BIPS_NQID'][0]; \r\n\t$parameters = array(\r\n\t 'paths' => array($obiee11gPath),\r\n \t'resolveLinks' => true,\r\n\t 'errorMode' => \"FullDetails\",\r\n \t'returnOptions' => \"ObjectAsString\",\r\n\t 'sessionID' => $session_id\r\n\t);\r\n\ttry {\r\n\t\t$result = $obiee11gClient -> __call ('readObjects', array($parameters)); \r\n\t\t$requestXML = $result->catalogObject->catalogObject;\r\n\t\treturn $requestXML; \r\n\t} catch(SoapFault $fault) {\r\n\t\t//drupal_set_message($fault->faultstring);\r\n\t\treturn false;\r\n\t}\r\n}",
"public function search($param){\n\t\t$query=isset($_GET['query'])?$_GET['query']:null;\n\t\t$page=isset($_GET['page'])?$_GET['page']:1;\n\t\t$collections=isset($_GET['collections'])?$_GET['collections']:1;\n\t\t\n\t\t$soapRequest=new stdClass();\n\t\t$soapRequest->Token=TOKEN;\n\t\t$soapRequest->SearchTerm=$query;\n\t\t$soapRequest->NumHits=10;\t\t\n\t\t$soapRequest->SetNumber=($page*$soapRequest->NumHits)+1;\n\t\t\n\t\t$soapRequest->CollectionIIDsToSearch=\"2 578 722\";\n\t\ttry{\n\t\t\t$soapClient=new EBSCOWebserviceModel(LIBRARYWS);\n\t\t\t$ws = $soapClient->GetSearchResults($soapRequest);\t\t\n\t\t\t\n\t\t\t$XMLDoc = new DOMDocument();\n\t\t\t$XMLDoc->loadXML( $ws->GetSearchResultsResult->any);\n\t\t\t\n\t\t\t$results=$XMLDoc->getElementsByTagName(\"results\");\n\t\t\t$resultItem=$results->item(0); \n\t\t\t\n\t\t\tif($resultItem->hasAttributes()){\n\t\t\t\t$attribs=$resultItem->attributes;\n\t\t\t\t$first=$attribs->getNamedItem(\"first\")->textContent;\n\t\t\t\t$last=$attribs->getNamedItem(\"last\")->textContent;\n\t\t\t\t$total=$attribs->getNamedItem(\"total\")->textContent;\t\t\t\t\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$first=$last=$total=0;\n\t\t\t}\n\t\t\t$last=$total_pages=floor($total/$soapRequest->NumHits);\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t$saveStart=$page;\n\t\t\t$over=null;\n\t\t\n\t\t\t$start=$page;\n\t\t\tif($start+$soapRequest->NumHits>$last){\n\t\t\t\t$over=($start+$soapRequest->NumHits)-$last-1;\n\t\t\t\t$start=$start-$over;\n\t\t\t\tif($start<1) $start=1;\n\t\t\t\t$end=$last;\n\t\t\t}else{\n\t\t\t\t$end=$start+$soapRequest->NumHits-1;\n\t\t\t}\n\n\t\t\t$pager=array();\n\t\t\t$pager['current_page']=$saveStart;\n\t\t\t$pager['first_page']=1;\n\t\t\tif($over>1){\n\t\t\t\tif($saveStart-1>0){ //dont' show if no previous page exists.\n\t\t\t\t\t$pager['previous_page']=$saveStart-1;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\n\t\t\tfor($x=$start;$x<=$end;$x++){\n\t\t \t\t$pager['page'.($x-$start+1)]=$x;\n\t\t\t}\n\t\t\tif($saveStart<$last){ //only show if the current page is not the last page\n\t\t\t\t$pager['next_page']=$saveStart+1;\n\t\t\t}\t\t\t\t\t\n\t\t\t$pager['last_page']=$last;\n\t\t\n\t\t\t$html=$soapClient->translateDoc($XMLDoc);\n\t\t\t\n\t\t}//catch (SoapFault $e) {\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t} \n\t\t$template=TemplateParser::enqueue(TEMPLATE_DIR.\"frontend/EBSCO/search.tpt\");\n\t\t$template->addVar(\"results\",true);\n\t\t$template->addVar(\"GET\",$_GET);\n\t\t$template->addVar(\"pager\",$pager);\n\t\t$template->addVar(\"html\",$html);\n\t\treturn $template;\n\t}",
"function opensky_doi_get_wos_response($id) {\n // dpm ('getting WOS DATA from web ..');\n $auth_url = \"http://search.webofknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl\";\n\n try {\n // see http://php.net/manual/en/class.soapclient.php\n $opts = array(\n 'ssl' => array(\n 'verify_peer'=>false,\n 'verify_peer_name'=>false\n )\n );\n // SOAP 1.2 client\n $params = array (\n 'login' => \"NCAR\",\n 'password' => \"OLCP2YXI\",\n 'stream_context' => stream_context_create($opts)\n );\n\n $auth_client = new SoapClient ( $auth_url, $params );\n\n } catch (Exception $e) {\n error_log ('ERROR: ' . $e->getErrorMessage());\n }\n\n $auth_response = @$auth_client->authenticate();\n\n if (!$auth_response) {\n throw new Exception (\"Could not authenticate NCAR client for WOS\");\n }\n\n $search_url = \"http://search.webofknowledge.com/esti/wokmws/ws/WokSearch?wsdl\";\n $search_client = @new SoapClient($search_url);\n $search_client->__setCookie('SID', $auth_response->return);\n $id = '\"' . $id . '\"';\n\n $search_array = array(\n 'queryParameters' => array(\n 'databaseId' => 'WOS',\n 'userQuery' => 'DO=' . $id,\n 'editions' => array(\n array('collection' => 'WOS', 'edition' => 'SCI')\n ),\n 'queryLanguage' => 'en'\n ),\n 'retrieveParameters' => array(\n 'count' => '5',\n 'fields' => array(\n array('name' => 'Date', 'sort' => 'D')\n ),\n 'firstRecord' => '1',\n 'viewField' => array('collectionName' => 'WOS', 'fieldName' => array ('abstract', 'grants'))\n )\n );\n\n try {\n $search_response = $search_client->search($search_array);\n if ($search_response->return->recordsFound > 0) {\n $returnedxml = simplexml_load_string($search_response->return->records);\n $returnedxml_str = $returnedxml->asXML();\n } else {\n $returnedxml_str = NULL;\n }\n } catch (Exception $e) {\n echo $e->getMessage();\n $abstract = \"Error\";\n }\n return $returnedxml_str; // return xml string\n}",
"function sr_request()\n{\n\tif (isset($_POST['table'])) {\n\t\t$wsdl = SR_URL;\n\n\t\ttry {\n\t\t $client = new nusoap_client($wsdl, 'wsdl');\n\t\t $client->soap_defencoding = 'UTF-8';\n \t\t$client->decode_utf8 = FALSE;\n\n\t\t $client->namespaces['dat'] = \"http://ws.wso2.org/dataservice\";\n\n\t\t $action = \"consultaCUN\"; // webservice method name\n\n\t\t $result = array();\n\n\t\t $inputs = [\n\t\t 'identificadorOperador' => is_null($_POST['identificadorOperador'])\t? 0 : intval($_POST['identificadorOperador']),\n\t\t 'anoRadicacionCun' => is_null($_POST['anoRadicacionCun']) \t\t? 0 : intval($_POST['anoRadicacionCun']),\n\t\t 'ConsecutivoRadCun' => is_null($_POST['ConsecutivoRadCun']) \t? 0 : intval($_POST['ConsecutivoRadCun']),\n\t\t 'numeroRadicacion' => is_null($_POST['numeroRadicacion']) \t\t? 0 : intval($_POST['numeroRadicacion']),\n\t\t 'anoRadicacion' => is_null($_POST['anoRadicacion']) \t\t? 0 : intval($_POST['anoRadicacion']),\n\t\t 'nombreOperador' => is_null($_POST['nombreOperador']) \t\t? \"%\" : $_POST['nombreOperador'],\n\t\t 'tipoIdentificacion' => is_null($_POST['tipoIdentificacion']) \t? \"%\" : $_POST['tipoIdentificacion'],\n\t\t 'numeroIdentificacion' => is_null($_POST['numeroIdentificacion']) \t? 0 : intval($_POST['numeroIdentificacion']),\n\t\t ];\n\n\t\t $input = \"<dat:consultaCUN>\n\t\t <dat:identificadorOperador>{$inputs['identificadorOperador']}</dat:identificadorOperador>\n\t\t <dat:anoRadicacionCun>{$inputs['anoRadicacionCun']}</dat:anoRadicacionCun>\n\t\t <dat:ConsecutivoRadCun>{$inputs['ConsecutivoRadCun']}</dat:ConsecutivoRadCun>\n\t\t <dat:numeroRadicacion>{$inputs['numeroRadicacion']}</dat:numeroRadicacion>\n\t\t <dat:anoRadicacion>{$inputs['anoRadicacion']}</dat:anoRadicacion>\n\t\t <dat:nombreOperador>{$inputs['nombreOperador']}</dat:nombreOperador>\n\t\t <dat:tipoIdentificacion>{$inputs['tipoIdentificacion']}</dat:tipoIdentificacion>\n\t\t <dat:numeroIdentificacion>{$inputs['numeroIdentificacion']}</dat:numeroIdentificacion>\n\t\t </dat:consultaCUN>\";\n\n\t\t if (isset($action))\n\t\t {\n\t\t $result['response'] = $client->call($action, $input, $namespace = 'dat');\n\t\t }\n\t\t} catch (nusoap_fault $e) {\n\t\t echo $e->getMessage();\n\t\t}\n\t}\n\t\n\tinclude('form.php');\n}",
"public function returnOnRealEstate() {\n try {\n $serviceToCall = \"InvestmentWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <inv04>\n <purchasePrice>0</purchasePrice>\n <cash>0</cash>\n <realEstate>0.8</realEstate>\n <loanAmount>0</loanAmount>\n <interestRate>0.0</interestRate>\n <loanTerm>5</loanTerm>\n <closingCosts>0</closingCosts>\n <rentalIncome>0</rentalIncome>\n <incomeFrequency>0</incomeFrequency>\n <rentIncreases>0.0</rentIncreases>\n <propertyTax>0</propertyTax>\n <insurance>0</insurance>\n <maintenance>0</maintenance>\n <expenseIncreases>0.0</expenseIncreases>\n <analysisYears>20</analysisYears>\n <realtorFees>0.0</realtorFees>\n <appreciation>0.0</appreciation>\n <taxBracket>0.25</taxBracket>\n <capitalGains>0.15</capitalGains>\n </inv04>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <inv04 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </inv04>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"inv04Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"inv04Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"inv04Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"public function myLoadPaymentBe() {\n try {\n $serviceToCall = \"CreditWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <det03>\n <loanAmount>5000</loanAmount>\n <interestRate>0.05</interestRate>\n <termMonths>60</termMonths>\n <amortization>1</amortization>\n </det03>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <det03 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </det03>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"det03Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"det03Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"det03Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"abstract public function fetchXML($parameters);",
"public function disablityIncomeInsurance() {\n try {\n $serviceToCall = \"InsuranceWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <ins04>\n\n </ins04>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <ins04 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </ins04>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"ins04Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"ins04Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"ins04Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"function testAffecteDigicode($adresseServeur,$idOrganisme) {\n $client = new SoapClient($adresseServeur);\n try {\n \n //ATTENTION : tester avec un organisme qui a une réunion réservée aujourd'hui\n //TODO mettre une (ou plusieurs instructions) insert qui ajoute une réservation à la date du jour\n $lesTypes = $client->affecteDigicode($idOrganisme);\n \n if ($lesTypes[2] == \"accès non autorisé\") {\n echo 'Pas de réunion. Accès non autorisé';\n }\n else {\n echo \"les infos sont <br />\";\n// echo htmlentities($lesTypes['batiment'],null,\"UTF-8\").'<br />'.\n// ' salle : '.htmlentities($lesTypes['salle'],null,\"UTF-8\").'<br />'.\n// 'digicode : '.htmlentities($lesTypes['digicode'],null,\"UTF-8\").'<br />';\n echo htmlentities($lesTypes[0],null,\"UTF-8\").'<br />'.\n ' salle : '.htmlentities($lesTypes[1],null,\"UTF-8\").'<br />'.\n 'digicode : '.htmlentities($lesTypes[2],null,\"UTF-8\").'<br />';\n }\n \n }\n \n catch (SoapFault $exception) {\n echo $exception;\n }\n}",
"private function _googleSoap($query, $start=0, $max=10, $filter=false, $restrict=\"\", $safe=false, $lr=\"\", $ie=\"\", $oe=\"\")\n\t{\n\t\t$wsdl = new SOAP_WSDL('http://api.google.com/GoogleSearch.wsdl');\n\t\t$soapclient = $wsdl->getProxy();\n\t\t\n\t\tif (get_class($soapclient) != \"SOAP_Fault\")\n\t\t{\n\t\t\t$result = $soapclient->doGoogleSearch($this->Key,$query,$start,$max,$filter,$restrict,$safe,$lr,$ie,$oe);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"SOAP_Fault: \" . $soapclient->message);\n\t\t}\n\t\t\n\t\tif (PEAR::isError($result)) \n\t\t{\n\t\t\tthrow new Exception(\"PEAR Exception: \" . $result->message);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t}",
"function GetResult($sRequestUrl,$sReturnValue)\n\t{\n\n\t\t$sRequest = $this->sWebServiceUrl . '/' . $sReturnValue.'?';\n if(!empty($sRequestUrl)) $sRequest .= $sRequestUrl.'&';\n $sRequest .= 'Sitekey=' . $this->sSiteKey;\n \n $oQwiserParser = $this->GetQwiserParser($sRequest); \n $oQwiserParser->set_enconig_converter('UTF-8','ISO-8859-1',2);\n\t $this->oSearchResponce = $oQwiserParser->run();\n\n // $sReturnValue = __FUNCTION__: The function name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the function name as it was declared (case-sensitive). In PHP 4 its value is always lowercased. \n $sReturnValue = strtolower($sReturnValue);\n $oResult = false;\n \n $dictResult[\"getallproductfields\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->ProductFields; \n\t\t$dictResult[\"getproductanswers\"] = $dictResult[\"getseveralproductsanswers\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->ProductAnswers;\n $dictResult[\"getallquestions\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->Questions;\n $dictResult[\"getproductsearchpath\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->SearchPath;\n $dictResult[\"getquestionanswers\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->Answers;\n \t$dictResult[\"getsearchprofilequestions\"]= $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->Questions;\n $dictResult[\"getenginestatus\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->SearchEngineStatus;\n $dictResult[\"removeproductfromstock\"] = $dictResult[\"restoreproducttostock\"]= $this->oSearchResponce->QwiserSearchFacadeWrapper;\n $dictResult[\"getallsearchprofiles\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->QwiserSimpleStringCollection;\n $dictResult[\"default\"] = $this->oSearchResponce->QwiserSearchFacadeWrapper->ReturnValue->QwiserSearchResults;\n \tif(!isset($dictResult[$sReturnValue])) $sReturnValue = \"default\";\n \t$oResult = $dictResult[$sReturnValue];\n \t\n $this->blLastOperationSucceeded = $oQwiserParser->blLastOperationSucceeded;\n $this->sLastOperationErrorMessage = $oQwiserParser->sLastOperationErrorMessage;\n\n return $oResult;\n\t}",
"function retrieveServiceDescription($SCPDURL){\n\n $strURL = trim($SCPDURL);\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_USERAGENT, \t'SKY');\n curl_setopt($ch, CURLOPT_URL, $strURL );\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n\n $rtn = curl_exec($ch);\n\n if(($rtn) === false) {\n $err = 'Curl error: ' . curl_error($ch);\n die($err);\n }\n\n curl_close($ch);\n\n return simplexml_load_string($rtn);\n\n}",
"public function asXml()\n {\n if (empty($this->_query)) {\r\n throw new Exception(\"You must set the main query\");\r\n }\n \n $manager = UpCloo_Manager::getInstance();\n \n $document = new DOMDocument(\"1.0\", \"utf-8\");\n $model = $document->createElement(\"model\");\n \n $searchNode = $document->createElement(\"search\");\n $searchNode->setAttribute(\"sitekey\", $manager->getSiteKey());\n $searchNode->setAttribute(\"password\", $manager->getPassword());\n \n if ($this->_page) {\n $searchNode->setAttribute(\"page\", $this->_page);\n }\n \n if ($this->_numPerPage) {\n $searchNode->setAttribute(\"numperpage\", $this->_numPerPage);\n }\n \n if ($this->_relevancy) {\n $searchNode->setAttribute(\"relevancy\", $this->_relevancy);\n }\n\n $q = $document->createElement(\"q\", $this->_query);\n $searchNode->appendChild($q);\n \n //Facet section\n if (count($this->_facets) > 0) {\n foreach ($this->_facets as $facet) {\n $facet = $document->createElement(\"facet\", $facet);\n $searchNode->appendChild($facet);\n }\n }\n \n if (count($this->_ranges) > 0) {\n foreach ($this->_ranges as $range) {\n $rangeNode = $document->createElement(\"range\", $range->value);\n $rangeNode->setAttribute(\"type\", $range->type);\n $rangeNode->setAttribute(\"field\", $range->field);\n $rangeNode->setAttribute(\"gap\", $range->gap);\n $rangeNode->setAttribute(\"direction\", $range->direction);\n $rangeNode->setAttribute(\"from\", $range->from);\n $rangeNode->setAttribute(\"to\", $range->to);\n \n $searchNode->appendChild($rangeNode);\n }\n }\n \n //Filters section\n if (count($this->_filters) > 0) {\n foreach ($this->_filters as $filter) {\n $filterNode = $document->createElement(\"filter\", $filter->value);\n $filterNode->setAttribute(\"by\", $filter->by);\n $searchNode->appendChild($filterNode);\n }\n }\n \n //Network section\n if (count($this->_networks) > 0) {\n $networkNode = $document->createElement(\"network\");\n foreach ($this->_networks as $network) {\n $sitekey = $document->createElement(\"sitekey\", $network);\n $networkNode->appendChild($sitekey);\n }\n $searchNode->appendChild($networkNode);\n }\n \n $model->appendChild($searchNode);\n $document->appendChild($model);\n \n return $document->saveXML();\n }",
"function Services_Hatena_Search()\n {\n require_once 'Services/OpenSearch.php';\n $this->os = new Services_OpenSearch($this->osxml_url);\n }",
"public function __construct($query) {\n\t\t\n\t\t//$db = \"(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))(CONNECT_DATA=(SID=orcl)))\" ;\n\n\t\tif ($c=oci_connect(\"ecd\", \"ecd\", \"//oratest.avensys.ch:1521/ECDP1\")) {\n\t\t\t\n\t\t\t$s = oci_parse($c, $query); \n\t\t\toci_execute($s);\n\t\t\t\n\t\t\t$this->officeArray = array();\n\t\t\twhile ($res = oci_fetch_array($s)) {\n\t\t\t\t$office = new Office();\n\t\t\t\t$office->office_id = $res['OFFICEID'];\n\t\t\t\t$office->office_status = $res['OFFICESTATUS'];\n\t\t\t\t$office->company_id = $res['COMPANYID'];\n\t\t\t\t$office->office_type = $res['OFFICETYPE'];\n\t\t\t\t$office->office_name = $res['OFFICENAME'];\n\t\t\t\t$office->address = $res['ADDRESS'];\n\t\t\t\t$office->address_zip = $res['ADDRESSZIP'];\n\t\t\t\t$office->address_city_id = $res['ADDRESSCITYID'];\n\t\t\t\t$office->address_city = $res['ADDRESSCITY'];\n\t\t\t\t$office->postbox = $res['POSTBOX'];\n\t\t\t\t$office->website_url = $res['WEBSITEURL'];\n\t\t\t\t$office->website_priority = $res['WEBSITEPRIORITY'];\n\t\t\t\t$office->website_id = $res['WEBSITEID'];\n\t\t\t\t$office->representative = $res['REPRESENTATIVE'];\n\t\t\t\t$office->employees = $res['EMPLOYEES'];\n\t\t\t\t$office->agent_id = $res['AGENTID'];\n\t\t\t\t$office->last_modified = $res['LASTMODIFIED'];\n\t\t\t\t$office->office_language = $res['OFFICELANGUAGE'];\n\t\t\t\t$office->office_marketname = $res['OFFICEMARKETNAME'];\n\t\t\t\t$office->office_description = $res['OFFICEHRDESCRIPTION'];\n\t\t\t\t$office->office_keywords_german = $res['OFFICEKEYWORDSGERMAN'];\n\t\t\t\t$office->office_keywords_french = $res['OFFICEKEYWORDSFRENCH'];\n\t\t\t\t$office->office_keywords_italian = $res['OFFICEKEYWORDSITALIAN'];\n\t\t\t\t$office->office_keywords_english = $res['OFFICEKEYWORDSENGLISH'];\n\t\t\t\tarray_push($this->officeArray, $office);\n\t\t\t\t/* echo $res['RUBRIC_ID'] . ', ' . $res['RUBRIC_NAME'] . \"<br />\"; */\n\t\t\t}\n\t\t\t\n\t\t\toci_close($c);\n\n\t\t} else {\n\n\t\t\t$err = oci_error();\n\n\t\t\t/* echo \"Connection failed.\" . $err[text]; */\n\n\t\t}\n\t\t\n\t}",
"function getAutocompleteContacts($email, $num, $token) {\n if ($token != SOAP_TOKEN)\n return new soap_fault('Server', '', 'Supplied token does not match our records', '');\n\n $email = strtolower(trim($email));\n\n if (!ereg('^' . email_reg . '$', $email))\n return new soap_fault('Client', '', 'Must supply a valid email address: $email not valid', '');\n\n $aDB = DB::connect(ADDR_DSN);\n if (DB::isError($aDB)) {\n return new soap_fault('Server', '', 'Service temporarily unavailable: could not connect to ADDR_DSN DB', '');\n }\n $aDB->setFetchMode(DB_FETCHMODE_ASSOC);\n\n// REALLY YOU SHOULD DO YOU'RE OWN QUERY, BUT FOR THE SAKE\n// OF THIS EXAMPLE, I'M JUST GOING TO INJECT A COUPLE RESULTS:\n $result = array();\n $result[] = array('contact' => 'Chaos Captain', 'email' => '[email protected]');\n $result[] = array('contact' => 'Joe Joe', 'email' => '[email protected]');\n\n return $result;\n\n#return new soap_fault('Server', '', 'Fallthrough error, should have faulted on invalid type above','');\n}",
"function search()\n\t{\n\t\t\n\t\tif (!isset($this->name))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif (!isset($this->start))\n\t\t{\n\t\t\t$this->start = 0;\n\t\t}\n\t\t\n\t\tif (!isset($this->num))\n\t\t{\n\t\t\t$this->num = 25;\n\t\t}\n\t\t\n\t\t$url = 'https://sccefile.scc.virginia.gov/Find/AjaxBusiness?searchTerm=' . $this->name\n\t\t\t. '&searchPattern=C&sEcho=1&iDisplayStart=' . $this->start . '&iDisplayLength=' . $this->num;\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$allowed_protocols = CURLPROTO_HTTP | CURLPROTO_HTTPS;\n\t\tcurl_setopt($ch, CURLOPT_PROTOCOLS, $allowed_protocols);\n\t\tcurl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, $allowed_protocols & ~(CURLPROTO_FILE | CURLPROTO_SCP));\n\t\t$this->json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\tif ($this->json === FALSE)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/*\n\t\t * Turn the JSON into a PHP object.\n\t\t */\n\t\t$this->results = json_decode($this->json);\n\t\t\n\t\t/*\n\t\t * Remove records we don't need.\n\t\t */\n\t\tunset($this->results->sEcho);\n\t\tunset($this->results->iTotalDisplayRecords);\n\t\t\n\t\t/*\n\t\t * Rename \"iTotalRecords\" to \"count.\"\n\t\t */\n\t\t$this->results->count = $this->results->iTotalRecords;\n\t\tunset($this->results->iTotalRecords);\n\t\t\n\t\t/*\n\t\t * Rename \"aaData\" to \"results,\" and convert it from an array into an object.\n\t\t */\n\t\t$this->results->list = (object) $this->results->aaData;\n\t\tunset($this->results->aaData);\n\t\t\n\t\t/*\n\t\t * Iterate through each result and convert it into a keyed object.\n\t\t */\n\t\tforeach ($this->results->list as &$result)\n\t\t{\n\t\t\n\t\t\t$new = new stdClass();\n\t\t\t$new->number = strip_tags($result[1]);\n\t\t\t$new->name = strip_tags($result[2]);\n\t\t\t$new->type = $result[3];\n\t\t\t$new->status = $result[4];\n\t\t\t$result = $new;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn TRUE;\n\n\n\t}",
"function webDescription(){\n\t\t$b = '\n\t\t<html><head><title>NuSOAP: '.$this->wsdl->serviceName.'</title>\n\t\t<style type=\"text/css\">\n\t\t body { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }\n\t\t p { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }\n\t\t pre { background-color: silver; padding: 5px; font-family: Courier New; font-size: x-small; color: #000000;}\n\t\t ul { margin-top: 10px; margin-left: 20px; }\n\t\t li { list-style-type: none; margin-top: 10px; color: #000000; }\n\t\t .content{\n\t\t\tmargin-left: 0px; padding-bottom: 2em; }\n\t\t .nav {\n\t\t\tpadding-top: 10px; padding-bottom: 10px; padding-left: 15px; font-size: .70em;\n\t\t\tmargin-top: 10px; margin-left: 0px; color: #000000;\n\t\t\tbackground-color: #ccccff; width: 20%; margin-left: 20px; margin-top: 20px; }\n\t\t .title {\n\t\t\tfont-family: arial; font-size: 26px; color: #ffffff;\n\t\t\tbackground-color: #999999; width: 105%; margin-left: 0px;\n\t\t\tpadding-top: 10px; padding-bottom: 10px; padding-left: 15px;}\n\t\t .hidden {\n\t\t\tposition: absolute; visibility: hidden; z-index: 200; left: 250px; top: 100px;\n\t\t\tfont-family: arial; overflow: hidden; width: 600;\n\t\t\tpadding: 20px; font-size: 10px; background-color: #999999;\n\t\t\tlayer-background-color:#FFFFFF; }\n\t\t a,a:active { color: charcoal; font-weight: bold; }\n\t\t a:visited { color: #666666; font-weight: bold; }\n\t\t a:hover { color: cc3300; font-weight: bold; }\n\t\t</style>\n\t\t<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t<!--\n\t\t// POP-UP CAPTIONS...\n\t\tfunction lib_bwcheck(){ //Browsercheck (needed)\n\t\t this.ver=navigator.appVersion\n\t\t this.agent=navigator.userAgent\n\t\t this.dom=document.getElementById?1:0\n\t\t this.opera5=this.agent.indexOf(\"Opera 5\")>-1\n\t\t this.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom && !this.opera5)?1:0;\n\t\t this.ie6=(this.ver.indexOf(\"MSIE 6\")>-1 && this.dom && !this.opera5)?1:0;\n\t\t this.ie4=(document.all && !this.dom && !this.opera5)?1:0;\n\t\t this.ie=this.ie4||this.ie5||this.ie6\n\t\t this.mac=this.agent.indexOf(\"Mac\")>-1\n\t\t this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;\n\t\t this.ns4=(document.layers && !this.dom)?1:0;\n\t\t this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)\n\t\t return this\n\t\t}\n\t\tvar bw = new lib_bwcheck()\n\t\t//Makes crossbrowser object.\n\t\tfunction makeObj(obj){\n\t\t this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;\n\t\t if(!this.evnt) return false\n\t\t this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;\n\t\t this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;\n\t\t this.writeIt=b_writeIt;\n\t\t return this\n\t\t}\n\t\t// A unit of measure that will be added when setting the position of a layer.\n\t\t//var px = bw.ns4||window.opera?\"\":\"px\";\n\t\tfunction b_writeIt(text){\n\t\t if (bw.ns4){this.wref.write(text);this.wref.close()}\n\t\t else this.wref.innerHTML = text\n\t\t}\n\t\t//Shows the messages\n\t\tvar oDesc;\n\t\tfunction popup(divid){\n\t\t if(oDesc = new makeObj(divid)){\n\t\t\toDesc.css.visibility = \"visible\"\n\t\t }\n\t\t}\n\t\tfunction popout(){ // Hides message\n\t\t if(oDesc) oDesc.css.visibility = \"hidden\"\n\t\t}\n\t\t//-->\n\t\t</script>\n\t\t</head>\n\t\t<body>\n\t\t<div class=content>\n\t\t\t<br><br>\n\t\t\t<div class=title>'.$this->wsdl->serviceName.'</div>\n\t\t\t<div class=nav>\n\t\t\t\t<p>View the <a href=\"'.(isset($GLOBALS['PHP_SELF']) ? $GLOBALS['PHP_SELF'] : $_SERVER['PHP_SELF']).'?wsdl\">WSDL</a> for the service.\n\t\t\t\tClick on an operation name to view it's details.</p>\n\t\t\t\t<ul>';\n\t\t\t\tforeach($this->wsdl->getOperations() as $op => $data){\n\t\t\t\t $b .= \"<li><a href='#' onclick=\\\"popup('$op')\\\">$op</a></li>\";\n\t\t\t\t // create hidden div\n\t\t\t\t $b .= \"<div id='$op' class='hidden'>\n\t\t\t\t <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>\";\n\t\t\t\t foreach($data as $donnie => $marie){ // loop through opdata\n\t\t\t\t\t\tif($donnie == 'input' || $donnie == 'output'){ // show input/output data\n\t\t\t\t\t\t $b .= \"<font color='white'>\".ucfirst($donnie).':</font><br>';\n\t\t\t\t\t\t foreach($marie as $captain => $tenille){ // loop through data\n\t\t\t\t\t\t\t\tif($captain == 'parts'){ // loop thru parts\n\t\t\t\t\t\t\t\t $b .= \" $captain:<br>\";\n\t\t\t\t\t //if(is_array($tenille)){\n\t\t\t\t\t\t\t\t \tforeach($tenille as $joanie => $chachi){\n\t\t\t\t\t\t\t\t\t\t\t$b .= \" $joanie: $chachi<br>\";\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t \t\t//}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t $b .= \" $captain: $tenille<br>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t $b .= \"<font color='white'>\".ucfirst($donnie).\":</font> $marie<br>\";\n\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t\t$b .= '</div>';\n\t\t\t\t}\n\t\t\t\t$b .= '\n\t\t\t\t<ul>\n\t\t\t</div>\n\t\t</div></body></html>';\n\t\treturn $b;\n }",
"function doSearch($query, $start){\n\t\treturn $this->loadXML($query, $start);\n\t}",
"function get_ezbxmlfeed($configo,$partnr,$filter,$type,$m_r,$m_e,$format){\n\t\n\t$max_split_products=75;\n\t$partnra = array();\n\t$partnr=str_replace(\"#\",\"%23\",$partnr); // added by sunetra mhaske 16/06/2015\n\t$pn = explode(\";\", $partnr);\n\t$pn_list=\"\";\n\t$j=0;\n\tfor($i=0; $i < count($pn);$i++){\n\t\tif($i==0)\n\t\t\t$pn_list=$pn[$i];\n\n\t\telse\n\t\t\t$pn_list=$pn_list .\";\". $pn[$i];\n\n\t\tif(($i+1)>$max_split_products*($j+1)){\n\t\t\t$pn_list=$pn[$i];\n\t\t\t$j++;\n\t\t}\n\t\t$partnra[$j]=$pn_list;\n\n\t}\n\t/* build URL to get raw pricing data */\n\tif($configo[\"dataserverSource\"]!=\"\" && $configo[\"searchXmlQuerySource\"]!=\"\"){\n\t\t/* this is when direct access to raw data is not made but HP proxy (getEzbData) in between */\n\t\t$searchxmlurl=\"http://\".$configo[\"dataserverSource\"].\"/\".$configo[\"searchXmlQuerySource\"];\n\t}else\n\t\t$searchxmlurl=\"http://\".$configo[\"dataserver\"].\"/\".$configo[\"searchXmlQuery\"];\n\t$pos = strpos($searchxmlurl, \".hp.com/\");\n\tif($pos!=false){ /* raw data pricing must be fetched from outside HP... */\n\t\t$ezbxmls='<?xml version=\"1.0\" encoding=\"utf-8\"?><ezb f=\"1.0.network.route\" s=\"kelkoo\"></ezb>';\t\n\t\treturn($ezbxmls);\n\t}\t \n\t\n\t\n\t\n\tif($filter)\n\t\t$searchxmlurl=$searchxmlurl.\"&filter=\".$filter;\n\tif($type)\n\t\t$searchxmlurl=$searchxmlurl.\"&type=\".$type;\n\tif($m_e)\n\t\t$searchxmlurl=$searchxmlurl.\"&m_e=\".$m_e;\n\tif($m_r)\n\t\t$searchxmlurl=$searchxmlurl.\"&m_r=\".$m_r; \n\tif($format)\n\t\t$searchxmlurl=$searchxmlurl.\"&p_format=\".$format;\n\t\n\t$use_proxy=0;\n\tif((strpos(php_uname(),'linux')===false)&& (strpos(strtolower(php_uname()),'g9t0296g')>0 || strpos(strtolower(php_uname()),'g9t0295g')>0 ) ) \n\t{ //hp-ux env check\n\t\t$proxy=array('web-proxy','web-proxy.bbn.hp.com','web-proxy.corp.hp.com','rio.india.hp.com');\n\t\t$use_proxy=1;\n\t}\n\t$ezbxmlalls=\"\";\n\t$proxy_cont=\"\";\n\tfor($j=0; $j < count($partnra);$j++){\n\t\t$url=str_replace('#PN#',$partnra[$j],$searchxmlurl);\n\t\t//Need some logic to pass the partnernum as a last parameter\n\t\tif(strpos($url,\"country=us\")!==false)\n\t\t{\n\t\t\t$url = str_replace('productNumber=','',$url);\n\t\t\t$url = str_replace($partnra[$j].'&','',$url);\t\n\t\t\t$url = $url.\"&productNumber=\".$partnra[$j];\n\t\t}\n\t\t//end\n\t\t\n\t\t\n\t\tif(!$use_proxy){ /* assuming hp-ux env means no need of proxy */\n\t\t\t$ezbxmls=file_get_contents($url);\n\t\t\tif(strstr(substr($ezbxmls,0,100),'<ezb')===FALSE){\n\t\t\t\t$f=fopen(getenv(\"APACHE_INSTANCE\") . \"/logs/php_log.\" . date(\"Ymd\"),\"a+\");\n\t\t\t\tfwrite($f,date(\"[S M d G:i:s Y]\") . \"[error] [client \" . $_SERVER['REMOTE_ADDR'] .\"] ERROR GETTING $url ($ezbxmls)\\n\");\n\t\t\t\tfclose($f);\n\t\t\t\tbreak;\t\t\n\t\t\t}else{\n\t\t\t\t$proxy_cont=\"ok\";\n\t\t\t}\n\t\t}else{\n\t\t\tfor($i=0;$i<count($proxy);$i++){\n\t\t\t\t$proxy_fp=fsockopen($proxy[$i],\"8088\");\n\t\t\t\tif($proxy_fp){\n\t\t\t\t\t$proxy_cont=\"\";\n\t\t\t\t\tfputs($proxy_fp, \"GET $url HTTP/1.0\\r\\n\\r\\n\");\n\t\t\t\t\twhile(!feof($proxy_fp)){\n\t\t\t\t\t\t$proxy_cont .= fread($proxy_fp,1024);\n\t\t\t\t\t}\n \t\t\t\t\tfclose($proxy_fp);\n \t\t\t\t\t$proxy_cont = substr($proxy_cont, strpos($proxy_cont,\"\\r\\n\\r\\n\")+4);\n\t\t\t\t\tif($proxy_fp && $proxy_cont!=\"\"){\n\t\t\t\t\t\t$ezbxmls=$proxy_cont;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\t\n\t\t$ezbxmlalls=$ezbxmlalls.$ezbxmls;\n\t}\n\tif($proxy_cont==\"\"){\n\t\t$ezbxmls='<?xml version=\"1.0\" encoding=\"utf-8\"?><ezb f=\"1.0.network\" s=\"kelkoo\"></ezb>';\n\t}\n\n\tif(count($partnra)>1){\n\t\t$ezbxmlalls=preg_replace('/<.*?kelkoo\">/i', '', $ezbxmlalls);\n\t\t$ezbxmlalls=preg_replace('/<\\?xml.*>/i', '', $ezbxmlalls);\n\t\t$ezbxmlalls=preg_replace('/<\\/ezb>/i', '', $ezbxmlalls);\n\t\t$ezbxmls='<?xml version=\"1.0\" encoding=\"utf-8\"?><ezb f=\"1.0\" s=\"kelkoo\">'.$ezbxmlalls.'</ezb>';\n\t}\n\n\treturn ($ezbxmls);\n}",
"function get_book_detail() {\r\n\t$book_id = isset($_POST[\"book_id\"]) && !empty($_POST[\"book_id\"]) ? trim($_POST[\"book_id\"]) : 0;\r\n\t$user_id = isset($_POST[\"user_id\"]) && !empty($_POST[\"user_id\"]) ? trim($_POST[\"user_id\"]) : 0;\r\n\t$currency = isset($_POST[\"currency\"]) && !empty($_POST[\"currency\"]) ? trim($_POST[\"currency\"]) : \"HKD\";\r\n\t$lang_code = isset($_POST[\"lang_code\"]) && !empty($_POST[\"lang_code\"]) ? trim($_POST[\"lang_code\"]) : \"ZH\";\r\n\t$reg_code = isset($_POST[\"reg_code\"]) && !empty($_POST[\"reg_code\"]) ? trim($_POST[\"reg_code\"]) : \"HK\";\r\n\t\r\n\t$webServiceControl = new webServiceControl();\r\n\treturn $webServiceControl->get_book_detail( $book_id, $user_id, $currency, $lang_code, $reg_code );\r\n}",
"public function __construct($_codigoBaseGeografica = NULL,$_codigoIndicador = NULL,$_codigoMomento = NULL,$_codigoPeriodicidade = NULL,$_codigoPrograma = NULL,$_codigoUnidadeMedidaIndicador = NULL,$_dataApuracao = NULL,$_descricao = NULL,$_exercicio = NULL,$_fonte = NULL,$_formula = NULL,$_identificadorUnico = NULL,$_snApuracaoReferencia = NULL,$_snExclusaoLogica = NULL,$_valorReferencia = NULL)\n\t{\n\t\tQualitativoWsdlClass::__construct(array('codigoBaseGeografica'=>$_codigoBaseGeografica,'codigoIndicador'=>$_codigoIndicador,'codigoMomento'=>$_codigoMomento,'codigoPeriodicidade'=>$_codigoPeriodicidade,'codigoPrograma'=>$_codigoPrograma,'codigoUnidadeMedidaIndicador'=>$_codigoUnidadeMedidaIndicador,'dataApuracao'=>$_dataApuracao,'descricao'=>$_descricao,'exercicio'=>$_exercicio,'fonte'=>$_fonte,'formula'=>$_formula,'identificadorUnico'=>$_identificadorUnico,'snApuracaoReferencia'=>$_snApuracaoReferencia,'snExclusaoLogica'=>$_snExclusaoLogica,'valorReferencia'=>$_valorReferencia));\n\t}",
"public function my401KWorth() {\n try {\n $serviceToCall = \"PaycheckBenefitsWS\";\n\n $lsCalcXmlClientObject = new nusoap_client($this->serviceUrl . \"/\" . $serviceToCall);\n\n $lsCalcXmlClientObject->setCurlOption(CURLOPT_SSLVERSION, 3);\n\n $lsCalcXmlReqestXmlBody = <<<END\n <calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"{$this->user}\" password=\"{$this->password}\" responseType=\"raw\" returnRelevantLinks=\"false\" chartLibrary=\"none\" version=\"1.3\"><dataTable><cssClassName>simpletable</cssClassName></dataTable>\n <calcInput includeInResponse=\"true\">\n <pay07>\n <yrstoretirement>30</yrstoretirement>\n <clientIncome>0</clientIncome>\n <salaryIncreases>0.03</salaryIncreases>\n <planBalance>0</planBalance>\n <compounding>26</compounding>\n <beforeTaxReturn>0.08</beforeTaxReturn>\n <employerMatch>1.0</employerMatch>\n <maximumMatch>0.03</maximumMatch>\n <currentContribution>0.04</currentContribution>\n </pay07>\n </calcInput>\n</calcxmlRequest>\nEND;\n $lsCalcXmlReqestXmlBodyENT = self::xmlentities($lsCalcXmlReqestXmlBody);\n\n //request to soap service\n $lsCalcXmlReqestXml = <<<END\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <pay07 xmlns=\"http://webservice.calcxml.com\">\n <in0 xsi:type=\"xsd:string\">\n {$lsCalcXmlReqestXmlBodyENT}\n </in0>\n </pay07>\n </soapenv:Body>\n</soapenv:Envelope>\nEND;\n $lsCalcXMLResponseArray = $lsCalcXmlClientObject->send($lsCalcXmlReqestXml);\n\n if ($lsCalcXmlClientObject->fault) {\n //throw the exception\n // throw new CException('');\n } else {\n\n if (isset($lsCalcXMLResponseArray[\"pay07Return\"])) {\n $lsXmlResponseDom = new DOMDocument();\n $lsXmlResponseDom->loadXML($lsCalcXMLResponseArray[\"pay07Return\"]);\n $outputCalc = $lsXmlResponseDom->getElementsByTagName(\"pay07Out\")->item(0);\n print_r($outputCalc);\n die;\n }\n }\n } catch (SoapFault $E) {\n print_r($E);\n die;\n throw new CException('');\n }\n }",
"function loadXML($query, $start){\n\t\t// nejdriv si parametry nadefinuju\n\n\t\t$params = array();\n\t\t$params['cx'] = \"010876191616094810175:nh4ey9ow_ii\";\n\t\t$params['client'] = \"google-csbe\";\n\t\t$params['ie'] = \"windows-1250\";\n\t\t$params['oe'] = \"windows-1250\";\n\t\t$params['output'] = \"xml_no_dtd\";\n\t\t$params['q'] = urlencode($query);\n\t\t$params['lr'] = \"lang_cs\";\n\t\t$params['start'] = $start;\n\t\t$params['filter'] = 0;\n\n\t\t// pretransformuju si je do URL\n\t\t$urlParams = array();\n\t\tforeach ( $params as $param => $value ){\n\t\t\t$value = &$value;\n\t\t\t$urlParams[] = \"$param=$value\";\n\t\t}\n\t\t$urlParams = implode(\"&\", $urlParams);\n\n\t\t// nazev souboru, ktery budu stahovat\n\t\t$file = \"http://www.google.com/search?\" . $urlParams;\n\n\t\t// natahnu si tridu pro praci s XML\n\t\tApp::import('Vendor', 'ParseXML', array('file' => 'lib-xml/lib.xml.php'));\n\n\t\t// vytvorim si instanci\n\t\t$xmlparser = &new ParseXML;\n\n\t\t// nactu XML a prevedu do pole\n\t\t$xml = $xmlparser->GetXMLTree($file);\n\t\treturn $xml;\n\t}",
"function get_flow_car_status($parms)\n{\n global $mydb;\n\n // dereference function parameters\n \n foreach($parms as $key=>$val)\n {\n $$key = \"$val\";\n $s .= \"$key = $val , \";\n }\n\n $company = explode(\",\", $company);\n // return new soap_fault(\"Client\", \"\", $s);\n // Build the ORDER BY clause for the SQL statement...\n if($order_seq != \"\")\n {\n $ords = explode(\"~\", $order_seq);\n if($ords[1] == \"the_item\")\n {\n $ords[1] = \"item\";\n }\n if($ords[1] == \"carinit\")\n {\n $ords[0] .= \", carnum\";\n }\n\n switch ($report_by)\n {\n case \"InboundStatus\":\n {\n $order_clause = \" order by inbound_status_proc_order asc, $ords[1] $ords[0]\";\n break;\n }\n case \"Car\":\n {\n $order_clause = \" order by $ords[1] $ords[0]\";\n break;\n }\n default:\n {\n $order_clause = \" order by inbound_status_proc_order asc, $ords[1] $ords[0]\";\n break;\n }\n }\n }\n else\n {\n switch ($report_by)\n {\n case \"InboundStatus\":\n {\n $order_clause = \" order by inbound_status_proc_order asc\";\n break;\n }\n case \"Car\":\n {\n $order_clause = \" order by carinit asc, carnum asc\";\n break;\n }\n default:\n {\n $order_clause = \" order by inbound_status_proc_order asc\";\n break;\n }\n }\n }\n \n //return new soap_fault(\"Client\", \"\", htmlspecialchars($order_clause));\n \n $sql_query = array();\n $inbutil = new inbound_utils_class();\n\n foreach($company as $comp)\n {\n if ($comp == \"\")\n {\n continue;\n }\n\n $sql = \"select t.seq seq,\n t.owner owner,\n t.carinit carinit,\n t.carnum carnum,\n (t.track || ' ' || t.track_pos) track,\n t.inbound_status inbound_status,\n s.inbound_status inbound_status_desc,\n s.proc_order inbound_status_proc_order,\n to_char(t.inbound_date, 'MM/DD/YY') inbound_date,\n to_char(t.fcast_rel_date, 'MM/YYYY') month_to_bill,\n to_char(t.fcast_rel_date, 'MM/DD/YY') fcast_rel_date,\n to_char(t.repair_comp_date, 'MM/DD/YY') repair_comp_date,\n to_char(t.outbound_date, 'MM/DD/YY') outbound_date,\n (select rc.turn_around\n from (select tab.inbound_seq, tar.turn_around,\n (CASE \n WHEN NVL(tab.program, 'X') = NVL(tar.program, 'X') AND\n NVL(tab.customer, 'X') = NVL(tar.customer, 'X') THEN 1\n WHEN tar.program is null AND\n NVL(tab.customer, 'X') = NVL(tar.customer, 'X') THEN 2\n WHEN tar.customer is null AND\n NVL(tab.program, 'X') = NVL(tar.program, 'X') THEN 3\n WHEN tar.customer is null AND\n tar.program is null THEN 4\n END) ord\n from ${comp}billing tab, ${comp}repair_customer tar\n where tab.repair_type = tar.repair_type\n and tab.job_code_type = tar.job_code_type order by ord asc) rc\n where rownum = 1\n and rc.inbound_seq = t.seq) turnaround,\n (select b1.cust_approval\n from ${comp}billing b1,\n (select ssb1.inbound_seq, ssb1.customer, max(ssb1.cust_apprv_date) cust_apprv_date\n from ${comp}billing ssb1\n group by inbound_seq, customer) sb1\n where rownum = 1\n and t.seq = b1.inbound_seq\n and nvl(t.lessee,'X') <> b1.customer\n and t.seq = sb1.inbound_seq\n and b1.cust_apprv_date = sb1.cust_apprv_date) cust_approval,\n (select b2.apprv_req_date\n from ${comp}billing b2,\n (select ssb2.inbound_seq, ssb2.customer, min(ssb2.apprv_req_date) apprv_req_date\n from ${comp}billing ssb2\n group by inbound_seq, customer) sb2\n where rownum = 1\n and t.seq = b2.inbound_seq\n and nvl(t.lessee,'X') <> b2.customer\n and t.seq = sb2.inbound_seq\n and b2.apprv_req_date = sb2.apprv_req_date) cust_apprv_req_date,\n (select b3.cust_apprv_date\n from ${comp}billing b3,\n (select ssb3.inbound_seq, ssb3.customer, max(ssb3.cust_apprv_date) cust_apprv_date\n from ${comp}billing ssb3\n group by inbound_seq, customer) sb3\n where rownum = 1\n and t.seq = b3.inbound_seq\n and nvl(t.lessee,'X') <> b3.customer\n and t.seq = sb3.inbound_seq\n and b3.cust_apprv_date = sb3.cust_apprv_date) cust_apprv_date,\n (select b4.cust_approval\n from ${comp}billing b4,\n (select ssb4.inbound_seq, ssb4.customer, max(ssb4.cust_apprv_date) cust_apprv_date\n from ${comp}billing ssb4\n group by inbound_seq, customer) sb4\n where rownum = 1\n and t.seq = b4.inbound_seq\n and nvl(t.lessee, 'X') = b4.customer\n and t.seq = sb4.inbound_seq\n and b4.cust_apprv_date = sb4.cust_apprv_date) lessee_approval,\n (select b5.apprv_req_date\n from ${comp}billing b5,\n (select ssb5.inbound_seq, ssb5.customer, min(ssb5.apprv_req_date) apprv_req_date\n from ${comp}billing ssb5\n group by inbound_seq, customer) sb5\n where rownum = 1\n and t.seq = b5.inbound_seq\n and nvl(t.lessee,'X') = b5.customer\n and t.seq = sb5.inbound_seq\n and b5.apprv_req_date = sb5.apprv_req_date) lessee_apprv_req_date,\n (select b6.cust_apprv_date\n from ${comp}billing b6,\n (select ssb6.inbound_seq, ssb6.customer, max(ssb6.cust_apprv_date) cust_apprv_date\n from ${comp}billing ssb6\n group by inbound_seq, customer) sb6\n where rownum = 1\n and t.seq = b6.inbound_seq\n and nvl(t.lessee,'X') = b6.customer\n and t.seq = sb6.inbound_seq\n and b6.cust_apprv_date = sb6.cust_apprv_date) lessee_apprv_date,\n (NVL(t.outbound_date, sysdate) - t.inbound_date) dis,\n t.comments comments,\n t.reason_shipped reason_shipped,\n t.additional_remarks additional_remarks,\n t.reason_chg_fcast_date reason_chg_fcast_date,\n to_char(t.cust_insp_date, 'MM/DD/YY') cust_insp_date,\n to_char(t.notified_date, 'MM/DD/YY') notified_date,\n to_char(t.hold_yd_date, 'MM/DD/YY') hold_yd_date,\n to_char(t.repair_pod, 'MM/DD/YY') repair_pod,\n to_char(t.repair_in, 'MM/DD/YY') repair_in,\n to_char(t.repair_out, 'MM/DD/YY') repair_out,\n to_char(t.int_paint_pod, 'MM/DD/YY') int_paint_pod,\n to_char(t.int_paint_in, 'MM/DD/YY') int_paint_in,\n to_char(t.int_paint_out, 'MM/DD/YY') int_paint_out,\n to_char(t.ext_paint_pod, 'MM/DD/YY') ext_paint_pod,\n to_char(t.ext_paint_in, 'MM/DD/YY') ext_paint_in,\n to_char(t.ext_paint_out, 'MM/DD/YY') ext_paint_out,\n to_char(t.cleaning_pod, 'MM/DD/YY') cleaning_pod,\n to_char(t.cleaning_in, 'MM/DD/YY') cleaning_in,\n to_char(t.cleaning_out, 'MM/DD/YY') cleaning_out,\n to_char(t.rev_fcast_rel_date, 'MM/DD/YY') rev_fcast_rel_date,\n t.lessee lessee,\n t.int_paint_sys int_paint_sys,\n t.ext_paint_sys ext_paint_sys,\n (select name from customers tmpca\n where tmpca.customer = t.owner) cust_name,\n (select name from customers tmpcb\n where tmpcb.customer = t.lessee) lessee_name,\n (select nvl(sum(matl_price),0)\n from ${comp}billing tmpba,\n ${comp}estimate_lines tmpesta\n where tmpba.seq = tmpesta.billing_seq\n and tmpba.inbound_seq = t.seq) totmatl,\n (select nvl(sum(labor_price),0)\n from ${comp}billing tmpbb,\n ${comp}estimate_lines tmpestb\n where tmpbb.seq = tmpestb.billing_seq\n and tmpbb.inbound_seq = t.seq) totlabor,\n \n \t\t\t\t\t\t\t\t\t\t\t\t\t(select nvl(sum(labor_hours * quantity),0)\n from ${comp}billing tmpbl,\n ${comp}estimate_lines tmpestl\n where tmpbl.seq = tmpestl.billing_seq\n and tmpbl.inbound_seq = t.seq) tothours,\n\n (select nvl(sum(hours),0)\n from ${comp}hours_accounting tmpha\n where tmpha.inbound_seq = t.seq) acthours,\n\n (select nvl(sum(labor_hours * quantity),0)\n from ${comp}billing tmpbc,\n ${comp}estimate_lines tmpestc,\n ${comp}prod_depts pd1\n where tmpbc.seq = tmpestc.billing_seq\n and tmpbc.inbound_seq = t.seq\n and tmpestc.prod_dept_seq = pd1.prod_dept_seq\n and pd1.prod_dept_code = 'PAINT') paint_hours,\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n (select nvl(sum(hours),0)\n from ${comp}hours_accounting tmphax,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t${comp}std_labor_codes tmpslcx\n where tmphax.inbound_seq=t.seq\n and tmphax.code = tmpslcx.code\n and tmpslcx.dept = 'PAINT') paint_act_hours,\n\n (select nvl(sum(labor_hours * quantity),0)\n from ${comp}billing tmpbd,\n ${comp}estimate_lines tmpestd,\n ${comp}prod_depts pd2\n where tmpbd.seq = tmpestd.billing_seq\n and tmpbd.inbound_seq = t.seq\n and tmpestd.prod_dept_seq = pd2.prod_dept_seq\n and pd2.prod_dept_code = 'CLEAN') cleaning_hours,\n\n (select nvl(sum(hours),0)\n from ${comp}hours_accounting tmphay,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t${comp}std_labor_codes tmpslcy\n where tmphay.inbound_seq = t.seq\n and tmphay.code = tmpslcy.code\n and tmpslcy.dept = 'CLEAN') cleaning_act_hours,\n\n (select nvl(sum(labor_hours * quantity),0)\n from ${comp}billing tmpbe,\n ${comp}estimate_lines tmpeste,\n ${comp}prod_depts pd3\n where tmpbe.seq = tmpeste.billing_seq\n and tmpbe.inbound_seq = t.seq\n and tmpeste.prod_dept_seq = pd3.prod_dept_seq\n and pd3.prod_dept_code = 'REPAIR') repair_hours,\n\n (select nvl(sum(hours),0)\n from ${comp}hours_accounting tmphaz,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t${comp}std_labor_codes tmpslcz\n where tmphaz.inbound_seq = t.seq\n and tmphaz.code = tmpslcz.code\n and tmpslcz.dept = 'REPAIR') repair_act_hours,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n (select nvl(sum(matl_price),0)\n from ${comp}billing tmpbf,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t${comp}estimate_lines tmpestf,\n ${comp}prod_depts pd4\n where tmpbf.seq = tmpestf.billing_seq\n and tmpbf.inbound_seq = t.seq\n and tmpestf.prod_dept_seq = pd4.prod_dept_seq\n and pd4.prod_dept_code = 'PAINT') paint_matl,\n\n (select nvl(sum(matl_price),0)\n from ${comp}billing tmpbg,\n ${comp}estimate_lines tmpestg,\n ${comp}prod_depts pd5\n where tmpbg.seq = tmpestg.billing_seq\n and tmpbg.inbound_seq = t.seq\n and tmpestg.prod_dept_seq = pd5.prod_dept_seq\n and pd5.prod_dept_code = 'CLEAN') cleaning_matl,\n (select nvl(sum(matl_price),0)\n from ${comp}billing tmpbh,\n ${comp}estimate_lines tmpesth,\n ${comp}prod_depts pd6\n where tmpbh.seq = tmpesth.billing_seq\n and tmpbh.inbound_seq = t.seq\n and tmpesth.prod_dept_seq = pd6.prod_dept_seq\n and pd6.prod_dept_code = 'REPAIR') repair_matl,\n (select nvl(sum(labor_price),0)\n from ${comp}billing tmpbi,\n ${comp}estimate_lines tmpesti,\n ${comp}prod_depts pd7\n where tmpbi.seq = tmpesti.billing_seq\n and tmpbi.inbound_seq = t.seq\n and tmpesti.prod_dept_seq = pd7.prod_dept_seq\n and pd7.prod_dept_code = 'PAINT') paint_labor,\n (select nvl(sum(labor_price),0)\n from ${comp}billing tmpbj,\n ${comp}estimate_lines tmpestj,\n ${comp}prod_depts pd8\n where tmpbj.seq = tmpestj.billing_seq\n and tmpbj.inbound_seq = t.seq\n and tmpestj.prod_dept_seq = pd8.prod_dept_seq\n and pd8.prod_dept_code = 'CLEAN') cleaning_labor,\n (select nvl(sum(labor_price),0)\n from ${comp}billing tmpbk,\n ${comp}estimate_lines tmpestk,\n ${comp}prod_depts pd9\n where tmpbk.seq = tmpestk.billing_seq\n and tmpbk.inbound_seq = t.seq\n and tmpestk.prod_dept_seq = pd9.prod_dept_seq\n and pd9.prod_dept_code = 'REPAIR') repair_labor\n from ${comp}inbound t,\n inbound_statuses s\n where t.inbound_status = s.inbound_status_id \n and s.proc_order between \" . $inbutil->get_range_start('BEFORE_OUTBOUNDED') . \"\n and \" . $inbutil->get_range_end('BEFORE_OUTBOUNDED');\n $wherecls = \"\";\n if ($f_carinit != \"\") $wherecls .= \" and t.carinit >= '$f_carinit'\";\n if ($t_carinit != \"\") $wherecls .= \" and t.carinit <= '$t_carinit'\";\n if ($f_carnum != \"\") $wherecls .= \" and t.carnum >= '$f_carnum'\";\n if ($t_carnum != \"\") $wherecls .= \" and t.carnum <= '$t_carnum'\";\n if ($f_owner != \"\") $wherecls .= \" and t.owner >= '$f_owner'\";\n if ($t_owner != \"\") $wherecls .= \" and t.owner <= '$t_owner'\";\n if ($f_inbound_date != \"\") $wherecls .= \" and t.inbound_date >= to_date('$f_inbound_date', 'MM/DD/YYYY')\";\n if ($t_inbound_date != \"\") $wherecls .= \" and t.inbound_date <= to_date('$t_inbound_date', 'MM/DD/YYYY')\";\n if ($f_fcast_rel_date != \"\") $wherecls .= \" and t.fcast_rel_date >= to_date('$f_fcast_rel_date', 'MM/DD/YYYY')\";\n if ($t_fcast_rel_date != \"\") $wherecls .= \" and t.fcast_rel_date <= to_date('$t_fcast_rel_date', 'MM/DD/YYYY')\";\n if ($f_inbound_status != \"\") $wherecls .= \" and s.proc_order >= '$f_inbound_status'\";\n if ($t_inbound_status != \"\") $wherecls .= \" and s.proc_order <= '$t_inbound_status'\";\n\n $select = \"inbound_status, \n inbound_status_desc, \n inbound_status_proc_order, \n seq, \n carnum, \n carinit, \n month_to_bill,\n inbound_date,\n fcast_rel_date,\n repair_comp_date,\n outbound_date,\n NVL(turnaround, 0) turnaround,\n cust_approval,\n to_char(cust_apprv_req_date, 'MM/DD/YY') cust_apprv_req_date,\n to_char(cust_apprv_date, 'MM/DD/YY') cust_apprv_date,\n lessee_approval,\n to_char(lessee_apprv_req_date, 'MM/DD/YY') lessee_apprv_req_date,\n to_char(lessee_apprv_date, 'MM/DD/YY') lessee_apprv_date,\n cust_insp_date,\n dis,\n comments,\n cust_name,\n reason_shipped,\n additional_remarks,\n reason_chg_fcast_date,\n notified_date,\n hold_yd_date,\n repair_pod,\n repair_in,\n repair_out,\n int_paint_pod,\n int_paint_in,\n int_paint_out,\n ext_paint_pod,\n ext_paint_in,\n ext_paint_out,\n cleaning_pod,\n cleaning_in,\n cleaning_out,\n rev_fcast_rel_date,\n lessee,\n lessee_name,\n int_paint_sys,\n ext_paint_sys,\n totmatl,\n totlabor,\n tothours,\n acthours,\n (CASE cleaning_act_hours\n WHEN 0 THEN 1\n ELSE (round((cleaning_hours / cleaning_act_hours), 2))\n END) cleaning_efficiency,\n (CASE repair_act_hours\n WHEN 0 THEN 1\n ELSE (round((repair_hours / repair_act_hours), 2))\n END) repair_efficiency,\n (CASE paint_act_hours\n WHEN 0 THEN 1\n ELSE (round((paint_hours / paint_act_hours), 2))\n END) paint_efficiency,\n (CASE acthours\n WHEN 0 THEN 1\n ELSE (round((tothours/acthours), 2))\n END) efficiency,\n paint_hours,\n\t\t\t\t\t\t\t\t paint_act_hours,\n cleaning_hours,\n\t\t\t\t\t\t\t\t cleaning_act_hours,\n repair_hours,\n\t\t\t\t\t\t\t\t repair_act_hours,\n paint_matl,\n cleaning_matl,\n repair_matl,\n paint_labor,\n cleaning_labor,\n repair_labor\";\n $sql .= $wherecls;\n array_push($sql_query, $sql);\n }\n// $order_clause =\" order by inbound_status\";\n \n if (sizeof($sql_query) > 0)\n {\n $sql_text = \"select $select from ( \" . implode(\" union all \", $sql_query) . \") $order_clause\";\n $fp = fopen('/tmp/tempfile.txt', 'w+');\n fputs($fp, $sql_text);\n fclose($fp);\n }\n else\n {\n return new soap_fault(\"Client\", \"\", \"A company selection is required for this report\");\n }\n\n $qry = $mydb->query($sql_text);\n\n if ($report_by == \"InboundStatus\")\n {\n $xmlnodes = array(\"INBOUND_STATUS\" => array( \"INBOUND_STATUS_DESC\" => \"1\",\n \"REC\" => array(\"CARINIT\" => \"1\",\n \"CARNUM\" => \"1\",\n \"INBOUND_DATE\" => \"1\",\n \"MONTH_TO_BILL\" => \"1\",\n \"FCAST_REL_DATE\" => \"1\",\n \"REPAIR_COMP_DATE\" => \"1\",\n \"TURNAROUND\" => \"1\",\n \"OUTBOUND_DATE\" => \"1\",\n \"CUST_APPROVAL\" => \"1\",\n \"CUST_APPRV_REQ_DATE\" => \"1\",\n \"CUST_APPRV_DATE\" => \"1\",\n \"LESSEE_APPROVAL\" => \"1\",\n \"LESSEE_APPRV_REQ_DATE\" => \"1\",\n \"LESSEE_APPRV_DATE\" => \"1\",\n \"CUST_INSP_DATE\" => \"1\",\n \"DIS\" => \"1\",\n \"COMMENTS\" => \"1\",\n \"CUST_NAME\" => \"1\",\n \"REASON_SHIPPED\" => \"1\",\n \"ADDITIONAL_REMARKS\" => \"1\",\n \"REASON_CHG_FCAST_DATE\" => \"1\",\n \"NOTIFIED_DATE\" => \"1\",\n \"HOLD_YD_DATE\" => \"1\",\n \"REPAIR_POD\" => \"1\",\n \"REPAIR_IN\" => \"1\",\n \"REPAIR_OUT\" => \"1\",\n \"INT_PAINT_POD\" => \"1\",\n \"INT_PAINT_IN\" => \"1\",\n \"INT_PAINT_OUT\" => \"1\",\n \"EXT_PAINT_POD\" => \"1\",\n \"EXT_PAINT_IN\" => \"1\",\n \"EXT_PAINT_OUT\" => \"1\",\n \"CLEANING_POD\" => \"1\",\n \"CLEANING_IN\" => \"1\",\n \"CLEANING_OUT\" => \"1\",\n \"REV_FCAST_REL_DATE\" => \"1\",\n \"LESSEE\" => \"1\",\n \"LESSEE_NAME\" => \"1\",\n \"INT_PAINT_SYS\" => \"1\",\n \"EXT_PAINT_SYS\" => \"1\",\n \"TOTMATL\" => \"1\",\n \"TOTLABOR\" => \"1\",\n \"TOTHOURS\" => \"1\",\n \"ACTHOURS\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"CLEANING_EFFICIENCY\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"REPAIR_EFFICIENCY\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"PAINT_EFFICIENCY\" => \"1\",\n \"EFFICIENCY\" => \"1\",\n \"PAINT_HOURS\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"PAINT_ACT_HOURS\" => \"1\",\n \"CLEANING_HOURS\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"CLEANING_ACT_HOURS\" => \"1\",\n \"REPAIR_HOURS\" => \"1\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"REPAIR_ACT_HOURS\" => \"1\",\n \"PAINT_MATL\" => \"1\",\n \"CLEANING_MATL\" => \"1\",\n \"REPAIR_MATL\" => \"1\",\n \"PAINT_LABOR\" => \"1\",\n \"CLEANING_LABOR\" => \"1\",\n \"REPAIR_LABOR\" => \"1\"\n )\n )\n );\n $xml_res = $qry->get_result_xml_nodes(\"main\", $xmlnodes, $start, $stop);\n }\n else if ($report_by == \"Car\")\n {\n $xml_res = $qry->get_result_xml(\"main\", \"rec\", $start, $stop);\n }\n\n// $xml_res = $qry->get_result_xml(\"main\", \"rec\", $start, $stop);\n\n // Create a new soap val object here...\n $myval = new soapval('', 'xml', $xml_res);\n\n // And return it...\n return $myval;\n}",
"function querySearchService($hostname, $port, $query, $type)\n\t\t{\t\t //echo \"enter\";\n\t\t\t\t$sock = socket_create(AF_INET, SOCK_STREAM, 0);\n\t\t\t\t$message = $type.\" | \".$query;\n\n\t\t\t\tif(!($sock = socket_create(AF_INET, SOCK_STREAM, 0)))\n\t\t\t\t{\n\t\t\t\t\t\t$errorcode = socket_last_error();\n\t\t\t\t\t\t$errormsg = socket_strerror($errorcode);\n\t\t\t\t\t\tdie(\"Couldn't create socket: [$errorcode] $errormsg \\n\");\n\t\t\t\t}\n\t\t\t\t//echo \"creation\";\n\t\t\t\tif(!socket_connect($sock , $hostname, $port))\n\t\t\t\t{\n\t\t\t\t\t\t$errorcode = socket_last_error();\n\t\t\t\t\t\t$errormsg = socket_strerror($errorcode);\n\t\t\t\t\t\tdie(\"Could not connect: [$errorcode] $errormsg \\n\");\n\t\t\t\t}\n\n\t\t\t\t//Send the message to the server\n\t\t\t\tif( ! socket_send ( $sock , $message , strlen($message) , 0))\n\t\t\t\t{\n\t\t\t\t\t\t$errorcode = socket_last_error();\n\t\t\t\t\t\t$errormsg = socket_strerror($errorcode);\n\t\t\t\t\t\tdie(\"Could not send data: [$errorcode] $errormsg \\n\");\n\t\t\t\t}\t \n\t\t\t\t \n\t\t\t\t//Now receive reply from server into \n\t\t\t\t$buffer = \"\";\n\t\t\t\t$in = \"\";\n\n\t\t\t\t//while( ( $res = socket_recv($sock, $buffer, 1, MSG_PEEK) ) != FALSE && $buffer != \"\\0\" )\n\t\t\t\t//{\n\n\t\t\t\t\tsocket_recv($sock, $buffer, 2048, MSG_WAITALL);\n\t\t\t\t\t$in .= $buffer;\n\t\t\t\t\t//echo $buffer . \"\t\";\n\t\t\t\t//}\n\t\t\t\t$message = \"ack\";\n\t\t\t\tif( !socket_send( $sock, $message, strlen($message), 0 ) )\n\t\t\t\t{\n\t\t\t\t\t$errorcode = socket_last_error();\n\t\t\t\t\t$errormsg = socket_strerror($errorcode);\n\t\t\t\t\t\t\tdie(\"Could not send acknowledgement: [$errorcode] $errrormsg \\n\");\n\t\t\t\t}\n\n\t\t\t\t//return the search results\n\t\t\t\treturn $in;\n\t\t}",
"public function sendSoapRequest();",
"function wsContentsSearch($buscar=\"\",$page=\"\",$offset=\"\") {\n\t\tif (! $this->AccessTokenValid) {\n\t\t\t$Resultado=$this->AccessTokenResult;\n\t\t\treturn $Resultado;\t\t\n\t\t}\t\t\n\t\t$this->id=0;\n\t\t$paginado=false;\n\t\tif ($offset!=\"\") { $this->offset=$offset; $paginado=true; }\n\t\tif ($page!=\"\") { $this->page=$page; $paginado=true; }\n\t\t$this->GetItems(\"\",$paginado,$order=\"Orden\",$buscar);\n\t\tif ($this->ItemsCount>0) {\n\t\t\tforeach ($this->Items as $idelemento=>$elemento) {\n\t\t\t\tunset($this->Items[$idelemento]['IDBusiness']);\n\t\t\t\tunset($this->Items[$idelemento]['Orden']);\n\t\t\t}\n\t\t\t$Resultado['Success']=1;\n\t\t\t$Resultado['Result']['ItemCount']=$this->ItemsCount;\n\t\t\t$Resultado['Result']['Items']=$this->Items;\n\t\t} else {\n\t\t\t$Resultado['Success']=0;\n\t\t\t$Resultado['Result']=\"No records found\";\n\t\t}\t\t\t\n\t\treturn $Resultado;\n\t}",
"public function Inquiry($data)\r\n {\r\n $data = array_merge($this->default_param,$data);\r\n if($this->nusoap_status)\r\n {\r\n $soap_param = array(\r\n 'version'=>$this->version,\r\n 'transInit'=>'WEB',\r\n 'transTimeLcl'=>$data['LclTime'],\r\n 'transTimeSt'=>$data['StTime'],\r\n 'partnerId'=>$this->partnerId,\r\n 'rrf'=>$data['RRF'],\r\n 'transType'=>'INQQ'\r\n );\r\n $soap_param['api-sign'] = $this->createSignature($this->secret_key, $soap_param);\r\n \r\n $row = $this->nusoap_client->call(\r\n 'transactionQueryService',\r\n array('arg0'=>$this->createArg($soap_param))\r\n );\r\n if(!$err = $this->nusoap_client->getError()) \r\n {\r\n log_message('error',$err);\r\n }\r\n $result = $this->proccessXML($row['return']);\r\n return $this->array_to_obj($result);\r\n }\r\n }"
] | [
"0.66490275",
"0.61296254",
"0.60291505",
"0.5943626",
"0.5864209",
"0.57887316",
"0.56226444",
"0.54186094",
"0.5274316",
"0.5268095",
"0.52611965",
"0.52605593",
"0.52534074",
"0.5233552",
"0.5151342",
"0.5146903",
"0.5144904",
"0.5122699",
"0.5116763",
"0.5104308",
"0.50753534",
"0.50697374",
"0.50533557",
"0.50470906",
"0.5044353",
"0.5042889",
"0.5030211",
"0.5009571",
"0.5007826",
"0.5007689"
] | 0.8574127 | 0 |
Disable creation of logs while inerting and updating entities | public function disable_logs() {
$this->use_logs = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function disableLog(): void\n\t{\n\t\t$this->enableLog = false;\n\t}",
"protected function logOffEntree() {\r\n\r\n\t}",
"protected function disableDatabaseLogging()\n {\n // TODO: Implement disableDatabaseLogging() method.\n }",
"public function logOff() {\r\n\t\t$this->logOffTYPO3();\r\n\t\t$this->logOffEntree();\r\n\t}",
"public function disableRevisioning();",
"protected function _disableLoggingInAdminUser()\r\n {\r\n $this->_logInAdminUser = false;\r\n }",
"public function enableLog(): void\n\t{\n\t\t$this->enableLog = true;\n\t}",
"public function enable_logs() {\n\t\t$this->use_logs = true;\n\t}",
"public function prevent_log_history(){\n\t\t$user_id = $this->ion_auth->user()->row()->id;\n\t\t$val = $this->input->post('val');\n\t\t$this->login_model->prevent_log_history($user_id,$val); \n\t\n\t}",
"public function disableUpdate() {\n\t\t$this->doNotUpdate = true;\n\t}",
"public function setLog(){\n $model= Useraudit::instance();\n $model->setAttributes($this->attrMin());$model->save();\n }",
"public function disableLogger() {\n\t\t$this->activated = false;\n\t}",
"public static function NoLogging() {return 1;}",
"public function ignore()\n\t{\n\t\tnewrelic_ignore_transaction();\n\t\tnewrelic_ignore_apdex();\n\t}",
"public function flushLogs()\n {\n }",
"public function disable()\n {\n $this->getProfiler()->setEnabled(false);\n $queries = $this->getProfiler()->getQueryProfiles() ?: [];\n foreach ($queries as $query) {\n if ($query->getQueryType() === Profiler::INSERT || $this->isReplaceQuery($query)) {\n // For generator we do not care about REPLACE query and can use INSERT instead\n // due to it's not support parallel execution\n $this->addSql($query->getQuery(), $query->getQueryParams());\n }\n }\n }",
"public function setTableUnloggedForTesting()\n {\n if ($this->isTesting()) {\n $this->addJob('ALTER TABLE ' . $this->table_name . ' SET UNLOGGED');\n }\n }",
"protected function preventSave()\n {\n $this->allowSave = false;\n }",
"public function clear_log() {\r\n\t\t$this->log = false;\r\n\t}",
"public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n // check if entity is tracked by loggable and without foreign key\n if (array_key_exists($meta->name, $this->configurations) && count($this->pendingLogInserts)) {\n $oid = spl_object_hash($object);\n\n // there should be single identifier\n $identifierField = $this->getSingleIdentifierFieldName($meta);\n $logMeta = $om->getClassMetadata($this->getLogClass($meta->name));\n if (array_key_exists($oid, $this->pendingLogInserts)) {\n // load the pending logs without key\n $log = $this->pendingLogInserts[$oid];\n $logMeta->getReflectionProperty('foreignKey')->setValue(\n $log,\n $meta->getReflectionProperty($identifierField)->getValue($object)\n );\n $this->insertLogRecord($om, $log);\n }\n }\n }",
"public function disable() {\n\t\t$this->enabled = 'false';\n\t\t$this->save();\n\t}",
"protected function disableLogger(): bool\n {\n return true;\n }",
"public function onBeforeWrite()\n {\n parent::onBeforeWrite();\n\n $this->audit();\n }",
"public function enableLogging()\n {\n return $this->saveMetadata($this->appendToMetadata(array(\n HeaderConst::ACCESS_LOGS => 'True'\n )));\n }",
"protected function enableDatabaseLogging()\n {\n // TODO: Implement enableDatabaseLogging() method.\n }",
"private function log_erase()\n {\n if (isset($this->logger)) {\n $this->logger->clear('woochimp_log');\n }\n }",
"public function beforeSave() { return true; }",
"function WriteAuditTrailDummy($typ) {\r\n\t\t$table = 'usuario';\r\n\t\t$usr = CurrentUserID();\r\n\t\tew_WriteAuditTrail(\"log\", ew_StdCurrentDateTime(), ew_ScriptName(), $usr, $typ, $table, \"\", \"\", \"\", \"\");\r\n\t}",
"protected function afterSave() {\n parent::afterSave();\n if (!$this->isNewRecord) {\n $newAttrs = json_encode($this->getAttributes());\n $oldAttrs = json_encode($this->getOldAttributes());\n $log = new Log();\n $data = array('login_id' => '', 'user_id' => Yii::app()->session['user_id'], 'name' => 'retailer ', 'action' => 'update', 'oldAttrs' => $oldAttrs, 'newAttrs' => $newAttrs);\n $log->insertRetailerListLog($data);\n }\n if ($this->isNewRecord) {\n $newAttrs = json_encode($this->getAttributes());\n $oldAttrs = json_encode(array());\n $log = new Log();\n $data = array('login_id' => '', 'user_id' => Yii::app()->session['user_id'], 'name' => 'retailer', 'action' => 'create', 'oldAttrs' => $oldAttrs, 'newAttrs' => $newAttrs);\n $log->insertRetailerListLog($data);\n }\n }",
"public function clear_logs()\n {\n $to_delete = Mage::getModel(\"izberg/log\")\n ->getCollection()\n ->addFieldToFilter('created_at', array(\n 'to' => strtotime('-30 day', time()),\n 'datetime' => true\n ));\n foreach($to_delete as $log) {\n $log->delete();\n }\n }"
] | [
"0.648235",
"0.60931396",
"0.573146",
"0.56406564",
"0.5617696",
"0.5583989",
"0.5567403",
"0.5456314",
"0.5453408",
"0.5448847",
"0.54105777",
"0.540029",
"0.53790843",
"0.5344369",
"0.532601",
"0.5273452",
"0.52553123",
"0.5247172",
"0.52278787",
"0.5224073",
"0.5169338",
"0.51564413",
"0.5155474",
"0.5154663",
"0.5140436",
"0.5139115",
"0.5127627",
"0.51169723",
"0.5109922",
"0.510929"
] | 0.6620009 | 0 |
Enable creation of logs while inserting and updating entities if it was disabled | public function enable_logs() {
$this->use_logs = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function enableLog(): void\n\t{\n\t\t$this->enableLog = true;\n\t}",
"protected function enableDatabaseLogging()\n {\n // TODO: Implement enableDatabaseLogging() method.\n }",
"public function setEnableLogging($isLoggingEnabled);",
"protected function beforeSave()\n\t{\n\t\tif(parent::beforeSave())\n\t\t{\n\t\t\tif($this->isNewRecord)\n\t\t\t{\n\t\t\t\t$this->log_created = time();\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function enableLogging()\n {\n return $this->saveMetadata($this->appendToMetadata(array(\n HeaderConst::ACCESS_LOGS => 'True'\n )));\n }",
"public static function enableQueryLog() {\n\t\tDBConnection::$_queryLogEnabled = true;\n\t}",
"public function disable_logs() {\n\t\t$this->use_logs = false;\n\t}",
"private function logToDB()\n {\n\n //insert the info into the database, don't allow logging of any error\n $this->DB->insert(\"logger.logs\",$this->logData,null,1);\n \n }",
"public function enableThrottlingAndLogging() {\n\t\tif ($this->verifyDatabaseConnection()) {\n\t\t\t$this->isThrottlingAndLoggingEnabled = TRUE;\n\t\t}\n\t}",
"public function beforeInsert() { return true; }",
"function post_log_activate()\n{\n post_log_create_tables();\n}",
"public function doEnableLogger()\n\t{\n\t\t$logger = new Logger('payments_log');\n\n\t\t//Create MysqlHandler\n\t\t$eloquentHandler = new EloquentHandler('\\FintechFab\\Payments\\CreditPilotPayment\\CreditPilotLog');\n\n\t\t$logger->pushHandler($eloquentHandler);\n\n\t\t$this->paymentLog = new PaymentsLog($logger);\n\t}",
"public function disableLog(): void\n\t{\n\t\t$this->enableLog = false;\n\t}",
"public function isLoggingEnabled(): bool;",
"private function _log_transaction()\n { global $wpdb;\n\n $table = WTYPE::DB(WTYPE::DB_PRIMARY);\n\n $transaction = array(\n 'uid' => $this->uid,\n 'currency' => $this->type,\n 'transaction' => $this->code,\n 'points' => $this->points\n );\n\n $transaction = apply_filters('before_points_transaction', $transaction);\n\n $results = $wpdb->insert($table, $transaction, array('%d','%d','%d','%f'));\n\n if ($results){\n $this->insert_id = $wpdb->insert_id;\n do_action('after_transaction_log', $this->insert_id, $transaction);\n }\n\n }",
"public function shouldLog()\n {\n return config('corporate.logging', false);\n }",
"public function beforeSave() { return true; }",
"public function postPersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n // check if entity is tracked by loggable and without foreign key\n if (array_key_exists($meta->name, $this->configurations) && count($this->pendingLogInserts)) {\n $oid = spl_object_hash($object);\n\n // there should be single identifier\n $identifierField = $this->getSingleIdentifierFieldName($meta);\n $logMeta = $om->getClassMetadata($this->getLogClass($meta->name));\n if (array_key_exists($oid, $this->pendingLogInserts)) {\n // load the pending logs without key\n $log = $this->pendingLogInserts[$oid];\n $logMeta->getReflectionProperty('foreignKey')->setValue(\n $log,\n $meta->getReflectionProperty($identifierField)->getValue($object)\n );\n $this->insertLogRecord($om, $log);\n }\n }\n }",
"public function enableQueryLogging(): void\n {\n $this->conn->enableQueryLogging();\n }",
"public function beforeSave() {\n\t \n // /////////////////////////////////////////////////////////////////\n // Set the create time and user for new records\n // /////////////////////////////////////////////////////////////////\n if ($this->isNewRecord) {\n $this->created_time = new CDbExpression('NOW()');\n $this->created_by = Yii::app()->user->id;\n }\n \n // /////////////////////////////////////////////////////////////////\n // The modified log details is set for record creation and update\n // /////////////////////////////////////////////////////////////////\n $this->modified_time = new CDbExpression('NOW()');\n $this->modified_by = Yii::app()->user->id;\n \n\t return parent::beforeSave();\n\t}",
"public function isLogEnabled() {\r\n $config = $this->config; \r\n return $config->getPropertyValue(\"log.enabled\");\r\n }",
"function elgg_batch_enable_callback($object) {\n\t// our db functions return the number of rows affected...\n\treturn $object->enable() ? true : false;\n}",
"public function logQueries($enable = null)\n {\n }",
"public function afterDelete()\n\t{\n\t\tif ($this->logEnabled)\n\t\t{\n\t\t\t$logModel = new Log();\n\t\t\t$logModel->save(\n\t\t\t\tarray(\n\t\t\t\t\t'Log' => array(\n\t\t\t\t\t\t'model'\t\t\t=> $this->alias,\n\t\t\t\t\t\t'foreign_key'\t=> $this->id,\n\t\t\t\t\t\t'action'\t\t=> 'delete'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\t\t\n\t\tparent::afterDelete();\n\t}",
"public function afterInsert() { return true; }",
"public function preExecute()\n { \n if (sfConfig::get('app_sfDoctrineRestBasic_logging_enabled'))\n {\n $this->logger = new sfDoctrineRestBasicLogger();\n $log_data = $this->logger->getRequestLogData();\n $this->logger->log($log_data, sfConfig::get('app_sfDoctrineRestBasic_request_log_prefix').date('Y-m-d').'.log');\n } \n }",
"public function create_log($insert)\r\n {\r\n\r\n $insert['ip_address'] = get_ip();\r\n $insert['user_id'] = $this->session->userdata('admin_id');\r\n $insert['date'] = date('Y-m-d:H:i:s');\r\n $insert['module_name'] = \"Slider\";\r\n $this->db->insert('igc_user_logs', $insert);\r\n }",
"public function shouldLog(): bool\n {\n return $this->shouldLog;\n }",
"public function disable()\n {\n $this->getProfiler()->setEnabled(false);\n $queries = $this->getProfiler()->getQueryProfiles() ?: [];\n foreach ($queries as $query) {\n if ($query->getQueryType() === Profiler::INSERT || $this->isReplaceQuery($query)) {\n // For generator we do not care about REPLACE query and can use INSERT instead\n // due to it's not support parallel execution\n $this->addSql($query->getQuery(), $query->getQueryParams());\n }\n }\n }",
"public function setLog(){\n $model= Useraudit::instance();\n $model->setAttributes($this->attrMin());$model->save();\n }"
] | [
"0.65322727",
"0.6173972",
"0.6079539",
"0.5920677",
"0.59022266",
"0.5778881",
"0.5758492",
"0.5752546",
"0.5743204",
"0.571717",
"0.5595931",
"0.55862594",
"0.55746794",
"0.55197626",
"0.5464621",
"0.54533565",
"0.54173565",
"0.5361118",
"0.531579",
"0.5314057",
"0.53089523",
"0.52942556",
"0.5292878",
"0.5290939",
"0.52874285",
"0.5276981",
"0.52650034",
"0.5253289",
"0.5239404",
"0.52291924"
] | 0.6385157 | 1 |
Prepare the output for the fetch() methods. Possible outputs are: WP_Query (default) returns the WP_Object itself OBJECT return an Array of Tainacan\Entities | public function fetch_output( \WP_Query $WP_Query, $output = 'WP_Query' ) {
if ( is_null( $output ) ) {
$output = 'WP_Query';
}
if ( $output === 'WP_Query' ) {
return $WP_Query;
} else if ( $output === 'OBJECT' ) {
$result = [];
if ( $WP_Query->have_posts() ) {
/**
* Using WordPress Loop here would cause problems
*
* @see https://core.trac.wordpress.org/ticket/18408
*/
foreach ( $WP_Query->get_posts() as $p ) {
$result[] = new $this->entities_type( $p->ID );
}
}
return $result;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function get_results($query = '', $output = \\OBJECT)\n {\n }",
"function fleming_get_content()\r\n{\r\n $query_result = get_query_results();\r\n $fleming_content = array(\r\n \"title\" => 'Search results for \"' . $query_result[\"query\"] . '\"',\r\n \"css_filename\" => get_css_filename(),\r\n \"fields\" => get_field_objects(),\r\n \"query_result\" => $query_result,\r\n \"nav\" => get_nav_builder()\r\n ->withAdditionalBreadcrumb('Search for \"'.$query_result[\"query\"].'\"')\r\n ->build()\r\n );\r\n\r\n foreach ($fleming_content['query_result']['posts'] as &$post) {\r\n $post = entity_with_post_data_and_fields($post);\r\n }\r\n\r\n return $fleming_content;\r\n}",
"public function fetch( $args, $output = null ) {\n\n\t\tif ( is_numeric( $args ) ) {\n\t\t\t$existing_post = get_post( $args );\n\t\t\tif ( $existing_post instanceof \\WP_Post ) {\n\t\t\t\ttry {\n\t\t\t\t\treturn new Entities\\Metadatum( $existing_post );\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t} elseif ( is_array( $args ) ) {\n\n\t\t\t$args = array_merge( [\n\t\t\t\t'posts_per_page' => - 1,\n\t\t\t], $args );\n\n\t\t\t$args = $this->parse_fetch_args( $args );\n\n\t\t\t$args['post_type'] = Entities\\Metadatum::get_post_type();\n\n\t\t\t$args = apply_filters( 'tainacan_fetch_args', $args, 'metadata' );\n\n\t\t\t$wp_query = new \\WP_Query( $args );\n\n\t\t\treturn $this->fetch_output( $wp_query, $output );\n\t\t}\n\t}",
"protected function fetchData() {\n // Maintain the original logic\n if(!$this->allowOverride) {\n return parent::fetchData();\n }\n \n /*if (($sort = $this->getSort()) !== false && ($order = $sort->getOrderBy()) != '')\n $this->sortData($this->getSortDirections($order));*/\n\n if (($pagination = $this->getPagination()) !== false)\n $pagination->setItemCount($this->getTotalItemCount());\n\n return $this->rawData;\n }",
"public function results_obj ( /* void */ )\n {\n return $this->results(DB_FETCH_OBJ);\n }",
"public function fetch() {\n\t\tforeach($this->_data AS $index=>$value) {\n\t\t\tif(is_object($value)) {\n\t\t\t\t$this->_data[$index] = null;\n\t\t\t}\n\t\t}\n\t\t$xml = $this->toXml($this->_data);\n\t\treturn $xml;\n\t}",
"function get_object_ciudades(){\n $ciudades = array();\n $args = array(\n 'post_type' => 'ciudad',\n 'posts_per_page' => -1,\n 'post_status' => 'publish'\n );\n $ciudades = new WP_Query($args);\n wp_reset_query();\n return $ciudades;\n}",
"protected function hydrateAllData()\n {\n return $this->_stmt->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"function NormalizeResults($input = array())\n{\n $output = array();\n foreach ($input as $key => $post) \n {\n if (empty($post->blog_id)) {\n $post->blog_id = $post->col_shorthand ;\n $post->blog_author_twitter_username = $post->col_author_twitter_username ;\n $post->blog_name = $post->col_name ;\n // optional\n if (!empty($post->col_description)) {\n $post->blog_description = $post->col_description;\n }\n if (!empty($post->col_tags)) {\n $post->blog_tags = $post->col_tags;\n } \n if (!empty($post->col_home_page)) {\n $post->blog_url = $post->col_home_page;\n } \n }\n array_push($output, $post);\n }\n return $output;\n}",
"public function output()\n {\n return array_slice($this->objects, $this->offset, $this->limit); \n }",
"function get_results($query=null, $output = OBJECT)\n\t\t{\n\n\t\t\t// Log how the function was called\n\t\t\t$this->func_call = \"\\$db->get_results(\\\"$query\\\", $output)\";\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// Send back array of objects. Each row is an object\n\t\t\tif ( $output == OBJECT )\n\t\t\t{\n\t\t\t\treturn $this->last_result;\n\t\t\t}\n\t\t\telseif ( $output == ARRAY_A || $output == ARRAY_N )\n\t\t\t{\n\t\t\t\tif ( $this->last_result )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach( $this->last_result as $row )\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$new_array[$i] = get_object_vars($row);\n\n\t\t\t\t\t\tif ( $output == ARRAY_N )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$new_array[$i] = array_values($new_array[$i]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $new_array;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function prepareOutput()\n\t{\n\t\t$this->determineOffsetAndOrder(true);\n\t\t$this->getEntries();\n\t}",
"abstract protected function fetchAllObject();",
"function get_results($query=null, $output = OBJECT)\n\t\t{\n\n\t\t\t// Log how the function was called\n\t\t\t$this->func_call = \"\\$db->get_results(\\\"$query\\\", $output)\";\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// Send back array of objects. Each row is an object\n\t\t\tif ( $output == OBJECT )\n\t\t\t{\n\t\t\t\treturn $this->last_result;\n\t\t\t}\n\t\t\telseif ( $output == ARRAY_A || $output == ARRAY_N )\n\t\t\t{\n\t\t\t\tif ( $this->last_result )\n\t\t\t\t{\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach( $this->last_result as $row )\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$new_array[$i] = get_object_vars($row);\n\n\t\t\t\t\t\tif ( $output == ARRAY_N )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$new_array[$i] = array_values($new_array[$i]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $new_array;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn array();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM wiki_articleforobject';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"protected function executeQuery()\n {\n $this->attributes['paged'] = $this->getCurrentPage();\n $this->wpdb = new WP_Query($this->attributes);\n if (count($this->wpdb->posts)) {\n $this->entries = $this->wpdb->posts;\n foreach ($this->entries as $entry) {\n $entry->post_content = apply_filters('the_content', $entry->post_content);\n $entry->permalink = get_the_permalink($entry->ID);\n $this->getMeta($entry);\n $this->getImages($entry);\n $this->transformContent($entry);\n }\n }\n }",
"public function query($args = [])\n {\n $request = [\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'order' => 'ASC',\n 'orderby' => 'menu_order',\n 'post_type' => $this->postType,\n 'post_status' => 'publish',\n 'exclude' => get_option('page_on_front')\n ];\n\n $postList = get_posts( array_merge( $request, $args ) );\n\n $output = [];\n foreach ( $postList as $post ) {\n $object = new \\stdClass;\n $object->ID = $post->ID;\n $object->title = $post->post_title;\n $object->slug = $post->post_name;\n $object->date = $post->post_date;\n $object->photo = $post->post_photo;\n $object->link = get_permalink($post->ID);\n $object->days_ago = $this->getDaysAgo($post->post_date);\n\n if($this->enableTaxonomy){\n $term = wp_get_object_terms( $post->ID, $this->taxonomy );\n $object->taxonomy = ( isset($term[0]) ? $term[0]->name : '');\n }\n\n foreach($this->customFields as $metaKey){\n $object->{$metaKey} = get_field($metaKey, $post->ID);\n }\n\n $output[] = $object;\n }\n\n return $output;\n }",
"public function getEntities();",
"public function getEntities();",
"abstract public function getEntities();",
"public function prepare(){\n $bson = array( \n 'alias'=>$this->alias, \n 'pageID'=>$this->pageID\n );\n return parent::prepare() + $bson;\n }",
"public function get_all() {\n// $query = $this->db->get(static::$table_name);\n// return $query->custom_result_object(get_called_class());\n return self::result($this->db->get(static::$table_name), get_called_class());\n }",
"public function fetchAllObject() {\n\t\t$objects = [];\n\t\twhile($row = $this->fetchObject()) {\n\t\t\t$objects[] = $row;\n\t\t}\n\t\treturn $objects;\n\t}",
"public function FetchInto()\n {\n $this->attributes = array();\n return parent::FetchInto();\n }",
"public function fetch_objects()\n {\n $rows = array();\n while($row = $this->fetch_object())\n {\n $rows[$row->id] = $row;\n\n }\n return $rows;\n }",
"public function data_call()\r\r\n {\r\r\n\r\r\n global $wpdb;\r\r\n\r\r\n $value = $wpdb->get_results(\"SELECT * FROM $this->table_name WHERE post_ID = '$this->post_ID' AND type = '$this->type' AND archived is NULL ORDER BY due_date ASC\");\r\r\n\r\r\n $result = array();\r\r\n if ($value) {\r\r\n foreach ($value as $key) {\r\r\n $result[] = ($key ? get_object_vars($key) : false);\r\r\n }\r\r\n }\r\r\n return $result;\r\r\n }",
"private function resultObjectToArray($obj){ \n return $obj->fetchAll(); \n }",
"public function toObject()\n {\n $st = $this->_build();\n return $st->fetchAll(\\PDO::FETCH_OBJ);\n }",
"public function result($obj = false) \n {\n if ((bool)$obj) {\n while ($row = $this->query->fetch_object($obj))\n {\n $this->object[] = $row;\n }\n return $this->object;\n } else {\n while ($row = $this->query->fetch_object())\n {\n $this->object[] = $row;\n }\n return $this->object;\n }\n }",
"private function getQueriedObject() {\n global $_context;\n $data = $this->getBaseMeta();\n \n // if IS a query on archives, global type IS set & global term IS NOT set (a main archive)\n if(array_key_exists('archive', $_context) && isset($_context['type']) && !isset($_context['term'])) $data = $this->getArchiveMeta();\n \n // if IS a query on archives, & global term IS set (a term archive)\n if(array_key_exists('archive', $_context) && isset($_context['term'])) $data = $this->getTermMeta();\n \n // if global type IS NOT set but type query param IS set (a search query)\n if(!isset($_context['type']) && $this->typeParam()){\n $data['title'] = 'Query: '.$this->typeParam();\n }\n \n // if IS a query on single, like a custom query\n if(array_key_exists('single', $_context)) {\n $data = '';\n }\n \n return $data;\n }"
] | [
"0.58870625",
"0.58447427",
"0.57681525",
"0.5758732",
"0.5752164",
"0.56526345",
"0.5604012",
"0.5573426",
"0.5559563",
"0.5558425",
"0.55397487",
"0.5519248",
"0.55120325",
"0.5496732",
"0.5490727",
"0.5475498",
"0.54633784",
"0.5426508",
"0.5426508",
"0.5398125",
"0.5393292",
"0.53773487",
"0.5371423",
"0.5341861",
"0.53409046",
"0.5290747",
"0.52833426",
"0.5279804",
"0.52776283",
"0.5274297"
] | 0.69547075 | 0 |
Maps repository mapped properties to WP_Query arguments. This allows to build fetch arguments using both WP_Query arguments and the mapped properties for the repository. For example, you can use any of the following methods to browse collections by name: $TainacanCollections>fetch(['title' => 'test']); $TainacanCollections>fetch(['name' => 'test']); The property `name` is transformed into the native WordPress property `post_title`. (actually only title for query purpouses) Example 2, this also works with properties mapped to postmeta. The following methods are the same: $TainacanMetadatas>fetch(['required' => 'yes']); $TainacanMetadatas>fetch(['meta_query' => [ [ 'key' => 'required', 'value' => 'yes' ] ]]); | public function parse_fetch_args( $args = [] ) {
$map = $this->get_map();
$wp_query_exceptions = [
'ID' => 'p',
'post_title' => 'title'
];
$meta_query = [];
foreach ( $map as $prop => $mapped ) {
if ( array_key_exists( $prop, $args ) ) {
$prop_value = $args[ $prop ];
unset( $args[ $prop ] );
if ( $mapped['map'] == 'meta' || $mapped['map'] == 'meta_multi' ) {
$meta_query[] = [
'key' => $prop,
'value' => $prop_value
];
} else {
$prop_search_name = array_key_exists( $mapped['map'], $wp_query_exceptions ) ? $wp_query_exceptions[ $mapped['map'] ] : $mapped['map'];
$args[ $prop_search_name ] = $prop_value;
}
}
}
if ( isset( $args['meta_query'] ) && is_array( $args['meta_query'] ) && ! empty( $args['meta_query'] ) ) {
$meta_query = array_merge( $args['meta_query'], $meta_query );
}
$args['meta_query'] = $meta_query;
// Map orderby parameter
if ( isset( $args['orderby'] ) ) {
if ( array_key_exists( $args['orderby'], $map ) ) {
$args['orderby'] = $map[ $args['orderby'] ]['map'];
}
}
return $args;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fetch() {\n $args = func_get_args();\n\n $query = call_user_func_array(array('self', 'query'), $args);\n return $query->fetch($this->_fetchMode);\n }",
"abstract protected function getFetchParameters();",
"protected function _fetchPropertyDynamicAccess(&$class, &$method, $fetch) {\n $fcall = [\n 'type' => 'fcall',\n 'name' => 'zephir_fetch_property',\n 'call-type' => 1,\n 'parameters' => [$fetch['left'], $fetch['right']['left'], $fetch['right']['right']],\n 'file' => $fetch['file'],\n 'line' => $fetch['line'],\n 'char' => $fetch['char']\n ];\n\n return [null, $fcall, null];\n }",
"public function fetch(string $query, array $bindings = []);",
"protected function doFetch($args) {\n\t}",
"public function test_query_args_setup_with_custom() {\n\n\t\t$args = array(\n\t\t\t'include' => array( 1, 2, 3 ),\n\t\t\t'exclude' => array( 4, 5, 6 ),\n\t\t\t'permissions' => 'read',\n\t\t\t'user' => array( 3 ),\n\t\t\t'user_not_in' => array( 234, 432 ),\n\t\t\t'page' => 5,\n\t\t\t'per_page' => 500,\n\t\t\t'sort' => array(\n\t\t\t\t'description' => 'ASC',\n\t\t\t\t'id' => 'DESC',\n\t\t\t),\n\t\t);\n\n\t\t$query = new LLMS_REST_API_Keys_Query( $args );\n\n\t\tforeach ( $args as $arg => $expect ) {\n\t\t\t$this->assertEquals( $expect, $query->get( $arg ), $arg );\n\t\t}\n\n\t}",
"abstract public function getQueryProperty();",
"public function get(...$args): Collection;",
"public function fetch()\n {\n $params = func_get_args();\n return call_user_func_array(array($this->result_id, 'fetch'), $params);\n }",
"public function getFetchQuery($config)\n {\n }",
"function fetch_object( )\n\t{\n\t\t$num_args = func_num_args( );\n\t\t$args = func_get_args( );\n\n\t\t// get the arguments, if any\n\t\tif (0 != $num_args)\n\t\t{\n\t\t\t$this->clear_arguments( );\n\t\t\t$this->load_arguments($args);\n\t\t}\n\n\t\tif ($this->super_debug)\n\t\t{\n\t\t\techo 'FETCH_OBJECT ';\n\t\t\techo '<pre>';\n\t\t\tprint_r($this->get_arguments( ));\n\t\t\techo '</pre>';\n\t\t}\n\n\t\tif (false !== $this->pass_query)\n\t\t{\n\t\t\t$this->query = $this->pass_query;\n\t\t\t$this->query( );\n\t\t}\n\n\t\t$row = @mysql_fetch_object($this->result);\n\t\treturn $row;\n\t}",
"public function query($args = [])\n {\n $request = [\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'order' => 'ASC',\n 'orderby' => 'menu_order',\n 'post_type' => $this->postType,\n 'post_status' => 'publish',\n 'exclude' => get_option('page_on_front')\n ];\n\n $postList = get_posts( array_merge( $request, $args ) );\n\n $output = [];\n foreach ( $postList as $post ) {\n $object = new \\stdClass;\n $object->ID = $post->ID;\n $object->title = $post->post_title;\n $object->slug = $post->post_name;\n $object->date = $post->post_date;\n $object->photo = $post->post_photo;\n $object->link = get_permalink($post->ID);\n $object->days_ago = $this->getDaysAgo($post->post_date);\n\n if($this->enableTaxonomy){\n $term = wp_get_object_terms( $post->ID, $this->taxonomy );\n $object->taxonomy = ( isset($term[0]) ? $term[0]->name : '');\n }\n\n foreach($this->customFields as $metaKey){\n $object->{$metaKey} = get_field($metaKey, $post->ID);\n }\n\n $output[] = $object;\n }\n\n return $output;\n }",
"public function get($properties = [])\n {\n $original = $this->properties;\n\n if (is_null($original)) {\n $this->properties = $properties;\n }\n\n $results = $this->processor->processSelect($this, $this->runGet());\n\n $this->properties = $original;\n\n //return collect($results);\n return $results;\n }",
"public function test_query_args_setup_with_merge() {\n\n\t\t$args = array(\n\t\t\t'include' => array( 1, 2, 3 ),\n\t\t\t'exclude' => array( 4, 5, 6 ),\n\t\t\t'sort' => array(\n\t\t\t\t'description' => 'ASC',\n\t\t\t\t'id' => 'DESC',\n\t\t\t),\n\t\t);\n\n\t\t$query = new LLMS_REST_API_Keys_Query( $args );\n\n\t\t$args['page'] = 1;\n\t\t$args['per_page'] = 10;\n\t\t$args['permissions'] = '';\n\t\t$args['user'] = array();\n\t\t$args['user_not_in'] = array();\n\n\t\tforeach ( $args as $arg => $expect ) {\n\t\t\t$this->assertEquals( $expect, $query->get( $arg ), $arg );\n\t\t}\n\n\t}",
"private function find( array $args ) {\n\t\t$args = array_merge( array(\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => true,\n\t\t\t'update_post_term_cache' => false,\n\t\t), $args );\n\n\t\t$args[ 'post_type' ] = array( $this->post_type_name );\n\n\t\treturn $this->query->query( $args );\n\n\t}",
"public static function fetch($criteria, $order = null, $limit = 0, $offset = 0) {\n\t\treturn forward_static_call(['Mudpuppy\\DataObject', 'fetch'], $criteria, $order, $limit, $offset);\n\t}",
"public function testFetch()\n {\n $sql = \"select 1 as a, 2 as b\";\n $res = $this->mysql->run($sql)->fetch();\n $this->assertEquals($res, ['a' => 1, 'b' => 2], \"Fetch without speciefied field.\");\n\n $res = $this->mysql->run($sql)->fetch('a');\n $this->assertEquals($res, 1, \"Fetch by field name\");\n\n $res = $this->mysql->run($sql)->fetch(1);\n $this->assertEquals($res, 2, \"Fetch by field position.\");\n }",
"public function fetch($fetchMode=null, $fetchArgument=null, $ctorArgs=null);",
"function byUrl($args) {\n\t\t$this->validate();\n\t\tlist($crosswalks, $fields, $archives) = $this->setupTemplate();\n\t\t$plugin =& $this->getPlugin();\n\t\t$plugin->import('Search');\n\t\t$rangeInfo = PKPHandler::getRangeInfo('search');\n\n\t\t$query = Request::getUserVar('query');\n\t\t$forwardParams = array();\n\n\t\t$keywords = array(\n\t\t\t'all' => Search::parseQuery($query),\n\t\t\t'crosswalk' => array(),\n\t\t\t'field' => array(),\n\t\t\t'date-from' => array(),\n\t\t\t'date-to' => array()\n\t\t);\n\t\t$dates = array(\n\t\t\t'field' => array(),\n\t\t\t'crosswalk' => array()\n\t\t);\n\n\t\timport('classes.field.Field');\n\n\t\tif (is_array($fields)) foreach ($fields as $field) switch ($field->getType()) {\n\t\t\tcase FIELD_TYPE_DATE:\n\t\t\t\t$varName = $field->getName();\n\t\t\t\t$dateFromName = \"$varName-from\";\n\t\t\t\t$dateToName = \"$varName-to\";\n\n\t\t\t\t$dateFrom = Request::getUserVar($dateFromName);\n\t\t\t\t$dateTo = Request::getUserVar($dateToName);\n\t\t\t\t$dates['field'][$field->getFieldId()] = array($dateFrom, $dateTo);\n\t\t\t\tforeach (array('Month', 'Day', 'Year') as $datePart) {\n\t\t\t\t\t$forwardParams[$dateFromName . $datePart] = Request::getUserVar($dateFromName . $datePart);\n\t\t\t\t\t$forwardParams[$dateToName . $datePart] = Request::getUserVar($dateToName . $datePart);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FIELD_TYPE_STRING:\n\t\t\tcase FIELD_TYPE_SELECT:\n\t\t\t\t$value = Request::getUserVar($field->getName());\n\t\t\t\tif (!empty($value)) {\n\t\t\t\t\t$forwardParams[$field->getName()] = $value;\n\t\t\t\t\tif (is_array($value)) $value = '\"' . implode('\" OR \"', $value) . '\"';\n\t\t\t\t\t$keywords['field'][$field->getFieldId()] = Search::parseQuery($value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (is_array($crosswalks)) foreach ($crosswalks as $crosswalk) switch ($crosswalk->getType()) {\n\t\t\tcase FIELD_TYPE_DATE:\n\t\t\t\t$varName = $crosswalk->getPublicCrosswalkId();\n\t\t\t\t$dateFromName = \"$varName-from\";\n\t\t\t\t$dateToName = \"$varName-to\";\n\n\t\t\t\t$dateFrom = Request::getUserVar($dateFromName);\n\t\t\t\t$dateTo = Request::getUserVar($dateToName);\n\t\t\t\t$dates['crosswalk'][$crosswalk->getCrosswalkId()] = array($dateFrom, $dateTo);\n\t\t\t\tforeach (array('Month', 'Day', 'Year') as $datePart) {\n\t\t\t\t\t$forwardParams[$dateFromName . $datePart] = Request::getUserVar($dateFromName . $datePart);\n\t\t\t\t\t$forwardParams[$dateToName . $datePart] = Request::getUserVar($dateToName . $datePart);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FIELD_TYPE_SELECT:\n\t\t\tcase FIELD_TYPE_STRING:\n\t\t\t\t$value = Request::getUserVar($crosswalk->getPublicCrosswalkId());\n\t\t\t\tif (!empty($value)) {\n\t\t\t\t\t$forwardParams[$crosswalk->getPublicCrosswalkId()] = $value;\n\t\t\t\t\tif (is_array($value)) $value = '\"' . implode('\" OR \"', $value) . '\"';\n\t\t\t\t\t$keywords['crosswalk'][$crosswalk->getCrosswalkId()] = Search::parseQuery($value);\n\t\t\t\t}\n\t\t}\n\n\t\t$archiveIds = array();\n\t\tif (empty($archives)) $archiveIds = null;\n\t\tforeach ($archives as $archive) {\n\t\t\tif (is_object($archive)) $archiveIds[] = $archive->getArchiveId();\n\t\t}\n\n\t\t$results =& Search::retrieveResults($keywords, $dates, $archiveIds, $rangeInfo);\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t// Give the results page access to the search parameters\n\t\t$templateMgr->assign('isAdvanced', Request::getUserVar('isAdvanced'));\n\t\t$templateMgr->assign('importance', Request::getUserVar('importance')); // Field importance\n\n\t\tforeach ($forwardParams as $key => $value) if ($value == '') unset($forwardParams[$key]);\n\t\t$templateMgr->assign('forwardParams', $forwardParams);\n\n\t\t$templateMgr->assign_by_ref('results', $results);\n\t\t$plugin =& $this->getPlugin();\n\t\t$templateMgr->display($plugin->getTemplatePath() . 'results.tpl');\n\t}",
"public static function fetch(array $where = NULL, $limit = 0, $offset = 0, array $order_by = array())\n{\n\treturn self::objects(static::$k,0,0,$where,$limit,$offset,$order_by);\n}",
"protected function fetch($results=null, $options=array()) {\n \t\n \t\t$set_mode = \\Gino\\gOpt('set_mode', $options, true);\n \t\t$fetchAll = \\Gino\\gOpt('fetchAll', $options, false);\n \t\n \t\tif(is_null($results)) $results = $this->_result;\n \t\n \t\tif($set_mode) $this->setFetchMode($results, $options);\n \t\t\n \t\t$method = $fetchAll ? 'fetchAll' : 'fetch';\n \t\t\n \t\treturn $results->$method();\n \t}",
"public function test_query_args_setup_with_defaults() {\n\n\t\t$query = new LLMS_REST_API_Keys_Query();\n\n\t\t$args = array(\n\t\t\t'include' => array(),\n\t\t\t'exclude' => array(),\n\t\t\t'permissions' => '',\n\t\t\t'user' => array(),\n\t\t\t'user_not_in' => array(),\n\t\t\t'page' => 1,\n\t\t\t'per_page' => 10,\n\t\t\t'sort' => array(\n\t\t\t\t'id' => 'ASC'\n\t\t\t),\n\t\t);\n\n\t\tforeach ( $args as $arg => $expect ) {\n\t\t\t$this->assertEquals( $expect, $query->get( $arg ), $arg );\n\t\t}\n\n\t}",
"public function fetch( $args, $output = null ) {\n\n\t\tif ( is_numeric( $args ) ) {\n\t\t\t$existing_post = get_post( $args );\n\t\t\tif ( $existing_post instanceof \\WP_Post ) {\n\t\t\t\ttry {\n\t\t\t\t\treturn new Entities\\Metadatum( $existing_post );\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t} elseif ( is_array( $args ) ) {\n\n\t\t\t$args = array_merge( [\n\t\t\t\t'posts_per_page' => - 1,\n\t\t\t], $args );\n\n\t\t\t$args = $this->parse_fetch_args( $args );\n\n\t\t\t$args['post_type'] = Entities\\Metadatum::get_post_type();\n\n\t\t\t$args = apply_filters( 'tainacan_fetch_args', $args, 'metadata' );\n\n\t\t\t$wp_query = new \\WP_Query( $args );\n\n\t\t\treturn $this->fetch_output( $wp_query, $output );\n\t\t}\n\t}",
"public function fetch($args = array())\n\t{\n\t\t$defaults = array(\n\t\t\t// The column for our WHERE clause\n\t\t\t'type' => 'id',\n\t\t\t// The identifier from that column we should select\n\t\t\t'id' => 1,\n\t\t\t// What kind of data we should output\n\t\t\t'output_type' => 'object',\n\t\t);\n\t\t$args = array_merge($defaults, $args);\n\t\textract($args);\n\t\t\n\t\t$sql = 'SELECT work.id, type, title, filename, work.description, rating, votes, views, date,\n\t\t\t\taccounts.username, firstname, lastname\n\t\t\t\tFROM work\n\t\t\t\tLEFT JOIN accounts ON work.owner = accounts.id\n\t\t\t\tWHERE work.'.Database::sanitize($type).' = :id';\n\t\t\n\t\t$st = $this->db->prepare($sql);\n\t\t//$st->bindParam(':type', $type);\n\t\t$st->bindParam(':id', $id);\n\t\t\n\t\tif(! $st->execute())\n\t\t\tthrow new Exception('Database query failed.');\n\t\t\n\t\tif($st->rowCount() == 0)\n\t\t\tthrow new Exception(404);\n\t\t\n\t\tswitch($output_type)\n\t\t{\n\t\t\tcase 'object':\n\t\t\t{\n\t\t\t\t$output = $st->fetch(PDO::FETCH_CLASS, 'Work');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'array':\n\t\t\t{\n\t\t\t\t$output = $st->fetch(PDO::FETCH_ASSOC);\n\t\t\t\tif($output['type'] == 0)\n\t\t\t\t\t$output['filename'] = UPLOAD_PATH.$output['filename'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'json':\n\t\t\t{\n\t\t\t\t$output = $st->fetch(PDO::FETCH_ASSOC);\n\t\t\t\tif($output['type'] == 0)\n\t\t\t\t\t$output['filename'] = UPLOAD_PATH.$output['filename'];\n\t\t\t\t$output = json_encode($output);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $output;\n\t}",
"protected function _expressionFetch(&$class, &$method, $fetch) {\n list($before, $right, $after) = $this->_processExpression($class, $method, $fetch['right']);\n $fetch['right'] = $right;\n\n // Do we have Specific Handler?\n $type = $right['type'];\n $handler = $this->_handlerName(\"_fetch\", $type);\n if (!method_exists($this, $handler)) { // NO: Unhandled Fetch Option\n throw new \\Exception(\"Cannot use this expression for \\\"fetch\\\" operators: ${type}\");\n }\n // ELSE: Yes - Use Handler to Convert Fetch\n list($prepend, $fetch, $append) = $this->$handler($class, $method, $fetch);\n if (isset($prepend) && count($prepend)) {\n $before = array_merge($before, $prepend);\n }\n if (isset($append) && count($append)) {\n $after = array_merge($after, $append);\n }\n\n return [$before, $fetch, $after];\n }",
"public function fetch_by_collection( Entities\\Collection $collection, $args = [], $output = null ) {\n\t\t$collection_id = $collection->get_id();\n\n\t\t//get parent collections\n\t\t$parents = get_post_ancestors( $collection_id );\n\n\t\t//insert the actual collection\n\t\t$parents[] = $collection_id;\n\n\t\t//search for default metadatum\n\t\t$parents[] = $this->get_default_metadata_attribute();\n\n\t\t$meta_query = array(\n\t\t\t'key' => 'collection_id',\n\t\t\t'value' => $parents,\n\t\t\t'compare' => 'IN',\n\t\t);\n\n\t\t$args = array_merge( [\n\t\t\t'parent' => 0\n\t\t], $args );\n\n\t\tif ( isset( $args['meta_query'] ) ) {\n\t\t\t$args['meta_query'][] = $meta_query;\n\t\t} elseif ( is_array( $args ) ) {\n\t\t\t$args['meta_query'] = array( $meta_query );\n\t\t}\n\n\t\treturn $this->order_result(\n\t\t\t$this->fetch( $args, $output ),\n\t\t\t$collection,\n\t\t\tisset( $args['include_disabled'] ) ? $args['include_disabled'] : false\n\t\t);\n\t}",
"abstract public function fetch($fetchType = null);",
"function _fetch($method, $where = null, $order = null, $count = null, $offset = null)\n {\n\t\t// selection tool\n $select = $this->_db->select();\n\t\t$select->initFromObject( $this->getSelect() );\n\n $where = (array) $where;\n foreach ($where as $key => $val) {\n // is $key an int?\n if (is_int($key)) {\n // $val is the full condition\n $select->where($val);\n } else {\n // $key is the condition with placeholder,\n // and $val is quoted into the condition\n $select->where($key, $val);\n }\n }\n\n // the ORDER clause\n\t\tif( $order ) {\n\t\t\tif(!is_array($order)) $order = array($order);\n\t\t\t$select->order($order, true);\n\t\t}\n\n // the LIMIT clause\n if($count)\n\t\t\t$select->limit($count, $offset);\n\n // return the results\n\t\t$this->_lastSelectObj = $select;\n return $this->_db->$method($select->toString());\n }",
"public function findOneBy(array ...$args);",
"public function __get($property)\n {\n if (method_exists($this, $property)) {\n return $this->{$property}();\n }\n\n return $this->query->get($property);\n }"
] | [
"0.5523883",
"0.5303414",
"0.50624746",
"0.50001276",
"0.49565095",
"0.4951728",
"0.49144232",
"0.49116018",
"0.48754108",
"0.48643953",
"0.47768942",
"0.47615072",
"0.47150582",
"0.46846303",
"0.46543148",
"0.46205702",
"0.46024323",
"0.45936495",
"0.45670113",
"0.45582265",
"0.45531642",
"0.45255485",
"0.45065266",
"0.44985616",
"0.44807395",
"0.44560894",
"0.4452862",
"0.44423547",
"0.44331485",
"0.4418859"
] | 0.67636 | 0 |
Return array of collections db identifiers | public static function get_collections_db_identifiers() {
$Tainacan_Collections = \Tainacan\Repositories\Collections::get_instance();
$collections = $Tainacan_Collections->fetch( [], 'OBJECT' );
$cpts = [];
foreach ( $collections as $col ) {
$cpts[] = $col->get_db_identifier();
}
return $cpts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCollectionsIdsAttribute()\n\t{\n\t\treturn $this->collections->pluck('id');\n\t}",
"public function getIdentities()\n {\n return [\\Ss\\Collection\\Model\\Collection::CACHE_TAG . '_' . $this->getCollection()->getId()];\n }",
"static function listCollections($sdb) { # [ \"db.col\", \"db.col\", ... ]\n $server = \"\";\n $db = $sdb;\n if ($p=strpos($sdb, \":\")) {\n $server = substr($sdb, 0, $p+1);\n $db = substr($sdb, $p+1);\n }\n $a=[];\n foreach(M::i($server)->__get($db)->listCollections() as $c)\n $a[]=$db.\".\".$c->getName();\n return $a;\n }",
"public function getIds(): array;",
"public function getIds();",
"function selectAllCollections($db) {\n\t\tif (!($stmtSelectAllCollections = $db->prepare(' SELECT collection_name, collection_id \n\t\t FROM collections\n\t\t ORDER BY collection_name' ))) {\n\t\t\t//echo ' Prepare select failed: (' . $db->errno . ' ) ' . $db->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!$stmtSelectAllCollections->execute()) {\n\t\t\t//echo ' Execute select failed: (' . $stmtSelectAllCollections->errno . ' ) ' . $stmtSelectAllCollections->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/* store result */\n\t\t$stmtSelectAllCollections->store_result();\n\t\t\n\t\t/* bind result variables */\n\t\t$stmtSelectAllCollections->bind_result($collectionName, $collectionId);\n\t\t\n\t\t/* fetch values */\n\t\t$collections = array();\n\t\tif($stmtSelectAllCollections->num_rows > 0) {\n\t\t\twhile ($row = $stmtSelectAllCollections->fetch()) {\n\t\t\t\t$collections[$collectionId] = $collectionName; \n\t\t\t}\n\t\t}\n\t\t$stmtSelectAllCollections->close();\n\t\t\n\t\t//echo print_r($collections, true);\n\t\treturn $collections;\n\t}",
"public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(PrWorkCenter::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}",
"public function GetAll()\n {\n $ids = array();\n $sql = 'SELECT id FROM client_cmake ORDER BY version';\n $query = pdo_query($sql);\n while ($query_array = pdo_fetch_array($query)) {\n $ids[] = $query_array['id'];\n }\n return $ids;\n }",
"public function ids(): array;",
"function &MetaDatabases()\r\n\t{\r\n\t\t$qid = mysql_list_dbs($this->connectionId);\r\n\t\t$arr = array();\r\n\t\t$i = 0;\r\n\t\t$max = mysql_num_rows($qid);\r\n\t\twhile ($i < $max) {\r\n\t\t\t$db = mysql_tablename($qid,$i);\r\n\t\t\tif ($db != 'mysql') $arr[] = $db;\r\n\t\t\t$i += 1;\r\n\t\t}\r\n\t\treturn $arr;\r\n\t}",
"public static function getIds($collection)\n {\n return self::get('id', $collection);\n }",
"public function realIds() {\n $returnArray = array();\n\n $query = 'SELECT * FROM projects ORDER BY random() LIMIT 3';\n $result = pg_query($query) or die('DB operation failed: ' . pg_last_error());\n $projects = pg_fetch_all($result);\n pg_free_result($result);\n $i=0;\n foreach($projects as $project) {\n $returnArray[$i] = array($project['id']);\n $i++;\n }\n\n return $returnArray;\n }",
"public static function getIds()\n {\n return self::query()->orderBy('id')->pluck('id');\n }",
"function database_list(){\n\t\treturn(array($this->dbdatabase));\n\t}",
"public function getAllCollectionName() {\n return $this->_collection->where ( 'is_active', 1 )->select ( 'id', StringLiterals::TITLE )->get ();\n }",
"public static function db_names() {\n return array(array('id', 'customlabel', 'timemodified', 'timemodified', 'customlabel', ''));\n }",
"public static function getDocumentsCategoriesIds()\n {\n $query = new Query();\n $query->select(['documenti_categorie_id'])->distinct();\n $query->from(Documenti::tableName());\n $query->where(['deleted_at' => null]);\n $documentsCategoriesIds = $query->column();\n return $documentsCategoriesIds;\n }",
"public function ids() {\n $ids = array_keys($this->models);\n return $ids;\n }",
"public function keys()\n {\n return Config::find()->select('namedId')->column();\n }",
"function GetDatabaseNames() {\n\tglobal $db, $db_excludes;\n\n\t$query = \"select name from master.dbo.sysdatabases\";\n\t$result = sqlsrv_query( $db, $query );\n\tdo {\n\t\twhile ($row = sqlsrv_fetch_array($result)) {\n\t\t\t$databases[] = $row[0];\n\t\t}\n\t} while ( sqlsrv_next_result($result));\n\tsqlsrv_free_stmt($result);\n\n\treturn array_diff( $databases, $db_excludes);\n}",
"public function getIds(){\n\t\t/*$ids = array();\n\t\tforeach($this->vos as $key => $value){\n\t\t\t$ids[] = $key;\n\t\t}*/\n\t\treturn (array)$this->idSet;\n\t}",
"public function findAllCategoriesIds(): array\n {\n return Category::find()->select('id')->asArray()->column();\n }",
"private function _getBlogIds()\n {\n global $wpdb;\n \n \tif (is_multisite()) {\n\t\t\t$blogIds = $wpdb->get_col(\n\t\t\t\t\"SELECT blog_id\n\t\t\t\tFROM $wpdb->blogs\"\n\t\t\t);\n\t\t\t\n\t\t\treturn $blogIds;\n \t}\n \t\n \treturn array();\n }",
"public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(ArPriceCode::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}",
"public function getServiceIds(): array;",
"public function getAllDatabases(): array\n {\n return $this->request('GET', '/_all_dbs');\n }",
"public function ids()\n\t{\n\t\treturn $this->_ids;\n\t\t\n\t}",
"public function getIds()\n {\n return $this->pluck('id');\n }",
"function &getIdentifierIds()\n\t{\n\t\tinclude_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier.php';\n\n\t\treturn ilMDIdentifier::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_general');\n\t}",
"public function getIds()\n {\n $ids = array_map('intval', $this->connection->smembers($this->getIdsKey()));\n\n if (count($ids)) {\n sort($ids);\n }\n\n return $ids;\n }"
] | [
"0.6666069",
"0.66439044",
"0.6466435",
"0.6359856",
"0.6338796",
"0.6329951",
"0.6271686",
"0.6270351",
"0.62446797",
"0.62336135",
"0.6231753",
"0.6128493",
"0.6111913",
"0.60825545",
"0.603752",
"0.60341924",
"0.59676397",
"0.5967555",
"0.5923952",
"0.59236765",
"0.59149873",
"0.5904545",
"0.58986616",
"0.5887974",
"0.5867767",
"0.5865999",
"0.5863303",
"0.5829576",
"0.5799026",
"0.5791033"
] | 0.8702291 | 0 |
Fetch one Entity based on query args. Note: Does not work with Item_Metadata Repository | public function fetch_one( $args ) {
if ( $this->get_name() == 'Item_Metadata' ) {
return false;
}
$args['posts_per_page'] = 1;
$results = $this->fetch( $args, 'OBJECT' );
if ( is_array( $results ) && sizeof( $results ) > 0 && $results[0] instanceof \Tainacan\Entities\Entity ) {
return $results[0];
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fetchEntityById($id);",
"public function findOneBy(array ...$args);",
"public function fetch() {\n $args = func_get_args();\n\n $query = call_user_func_array(array('self', 'query'), $args);\n return $query->fetch($this->_fetchMode);\n }",
"public function findOne()\n {\n // This is a select\n $this->operation = \"SELECT\";\n\n // Set the limit to one\n $this->limit(1);\n\n // Prepare the statement\n $stmt = $this->prepareAndExecute();\n\n // Fetch\n $entity = $this->fetchOne($stmt);\n\n // If empty, we return null\n if ($entity === null) {\n return null;\n }\n\n // Return the entity\n return $entity;\n }",
"abstract protected function fetchOneObject();",
"public function getEntity($where=null,$order=null,$offset=null){\r\n $row=$this->fetchRow($where,$order,$offset);\r\n if($row) return $this->composeEntity($row);\r\n return null;\r\n }",
"public function first(): ?EntityInterface;",
"public static function one_entity();",
"protected static function fetchSingle(...$args)\n { \n $args[] = QB::limit(1);\n $select = static::select($args);\n return $select->fetch();\n }",
"public function execute($params = array()) {\n \n $this->getQueryBuilder()->where($params);\n $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY);\n \n $firstResult = $this->query($query);\n $entityName = get_class($this->entity);\n $this->request->setAttribute($entityName, current($firstResult)); \n //add it to the request but return it also\n return $firstResult;\n }",
"public function getEntityById($id);",
"public static function retrieveForModeration() {\n return self::retrieve()\n ->where('entity.status = ?', 0)\n ->order('entity.id desc')\n ->limit(1)\n ->setRowClass('Model_Entity')\n ->fetchAll();\n }",
"public function getEntityFrom(ClassMetadata $metadata);",
"abstract protected function getEntity();",
"abstract public function getFirstEntityByName($entityName);",
"public function getImmediateEntityForPersistence(): ?IEntity;",
"public function getEntity();",
"public function getEntity();",
"public function getEntity();",
"public function getEntity();",
"public function getEntity();",
"public function getOne($query, array $parameters = []);",
"public function first()\n {\n $return = null;\n if (count($entityIDs = $this->findEntityIDs())) {\n $this->primary($entityIDs);\n $additionalFields = $this->findAdditionalFields($entityIDs);\n\n if (null !== ($foundEntity = parent::first())) {\n $return = $this->fillEntityFields($foundEntity, $additionalFields);\n }\n }\n\n return $return;\n }",
"abstract function getQboEntity($entity_id);",
"public function fetchOneBy($params = [])\n {\n return $this->getEntityRepository()->findOneBy($params);\n }",
"public function query(...$args)\n {\n return $this->doctrine->query(...$args);\n }",
"public function getEntity(string $identifier): object;",
"abstract public function getMappedFirstEntities();",
"abstract public function getEntities();",
"abstract public function getEntity();"
] | [
"0.62928885",
"0.6225404",
"0.61517215",
"0.60772383",
"0.6030094",
"0.5993366",
"0.5989416",
"0.59861076",
"0.5962588",
"0.5885425",
"0.58816576",
"0.5816708",
"0.5810041",
"0.5802536",
"0.57910025",
"0.5786042",
"0.5779345",
"0.5779345",
"0.5779345",
"0.5779345",
"0.5779345",
"0.57717675",
"0.576327",
"0.575971",
"0.5757253",
"0.5739007",
"0.57151556",
"0.5709848",
"0.5699893",
"0.56843007"
] | 0.75840294 | 0 |
Check if $user can edit/create a entity | public function can_edit( Entities\Entity $entity, $user = null ) {
if ( is_null( $user ) ) {
$user = get_current_user_id();
} elseif ( is_object( $user ) ) {
$user = $user->ID;
}
$entity = self::get_entity_by_post( $entity );
$entity_cap = $entity->get_capabilities();
if ( ! isset( $entity_cap->edit_post ) ) {
return false;
}
if ( is_integer( $entity->get_id() ) ) {
return user_can( $user, $entity_cap->edit_post, $entity->get_id() );
} else {
// creating new
return user_can( $user, $entity_cap->edit_posts );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canEdit(User $user) {\n return false;\n }",
"function can_edit() {\n\t\tif ($this->permissions['all']) {\n\t\t\treturn $this->check_permission($this->permissions['all']);\n\t\t} elseif ($this->permissions['update']) {\n\t\t\treturn $this->check_permission($this->permissions['update']);\n\t\t} elseif ($this->object && $this->permissions['update_own']) {\n\t\t\tif (current_user()->id == $this->object->author) {\n\t\t\t\treturn $this->check_permission($this->permissions['update_own']);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function canEdit()\n\t{\n\t\tif(!Auth::check())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t//If the user is active/logged in, return true so that we can display user's specific objects\n\t\tif(Auth::user()->id===$this->user_id)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t//By default\n\t\treturn false;\n\t}",
"function user_can_edit() {\n\tif( current_user_can('administrator')) {\n\t\treturn true;\n\t}\n\n\t// si logged in\n\tif( is_user_logged_in() ) {\n\t\t// si auteur\n\t\tif( current_user_can('author')) {\n\t\t\t// si editor\n\t\t\tif(can_user_edit_project()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}",
"function _can_manage_content_entity($entity, $managingUser = null)\n{\n if (!$managingUser && \\Auth::check()) $managingUser = \\Auth::user();\n\n // if user found and this user is the entity author, return TRUE\n return ($managingUser && (($managingUser->id == $entity->user->id) || $managingUser->is_admin));\n}",
"public function isEditableFor( User_Model_User $user ){\n\t\treturn $user->getId() == $this->getId() ||\n\t\t\t Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'user', 'edit' );\n\t}",
"public function isEditableFor( User_Model_User $user ){\n\t\tif( false == $this->getOwnerId() ){\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post', 'create' );\t\t\n\t\t} elseif( $this->getOwnerId() == $user->getId() ){\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post', 'edit' );\n\t\t} else {\n\t\t\treturn Zend_Registry::get( 'acl' )->isAllowed( $user->getRole(), 'forum_post_foreign', 'edit' );\n\t\t}\n\t}",
"function canEdit(?User $p_user): bool\n {\n if($p_user===null){\n return false;\n }\n if ($p_user->isAdmin()) {\n return true;\n }\n return $this->id_user == $p_user->id;\n }",
"public function canEdit()\n {\n if ($this->getRegistry()->getUser() === $this->getIdentity() && $this->getRegistry()->getStatus() === RegistryEntity::REGISTRY_STATUS_DRAFT) {\n return true;\n }\n\n return false;\n }",
"function has_access_to_entity($entity, $user = null) {\n\tglobal $CONFIG;\n\n\tif (!isset($user)) {\n\t\t$access_bit = get_access_sql_suffix(\"e\");\n\t} else {\n\t\t$access_bit = get_access_sql_suffix(\"e\", $user->getGUID());\n\t}\n\n\t$query = \"SELECT guid from {$CONFIG->dbprefix}entities e WHERE e.guid = \" . $entity->getGUID();\n\t// Add access controls\n\t$query .= \" AND \" . $access_bit;\n\tif (get_data($query)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function authorize()\n {\n $accessor = $this->user();\n $user = $this->route('user');\n\n return $accessor->isAdmin() || \n ($accessor->isCommittee() && $accessor->hasKey('put-users')) || \n ($accessor->isEntrant() && $accessor->entry->id === $user->entry_id) || \n $accessor->id === $user->id;\n }",
"public function authorize()\n {\n // only allow updates if the user is logged in\n return Auth::user()->can('update genes');\n }",
"public function checkIfUserCanEdit($user) {\n return $this->owner==$user->getUsername() || $this->hasAdditionalUser($user->getUsername()) || $user->isAdmin();\n }",
"public function canEdit($user)\n {\n if ($user) {\n if ($user->isAdmin) {\n return true;\n }\n if ($this->userId == $user->id) {\n return true;\n }\n }\n\n return false;\n }",
"public function canEdit()\n {\n }",
"public function isAuthorized($user) {\n \tif ($this->action === 'add') {\n\t return true;\n \t}\n \t// The owner of a pedido can edit and delete it\n \tif (in_array($this->action, array('edit', 'delete'))) {\n \t$pedidoId = $this->request->params['pass'][0];\n \tif ($this->Pedido->isOwnedBy($pedidoId, $user['id'])) {\n \treturn true;\n \t}\n \t}\n\t\treturn parent::isAuthorized($user);\n\t}",
"public function isAuthorized($user) {\n // All registered users can add posts\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $postId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($postId, $user['id'])) { //loggin and own edit/delete/view \n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}",
"public function mayEdit(EntityAccess $entity, ?int $userId = null): bool\n {\n return $this->hasEntityPermission($entity, ACCESS_EDIT, $userId);\n }",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n \n if (!$this->current_user) {\n return false;\n }\n\n if ($this->current_user->isAdmin()) {\n return true;\n }\n \n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n \n return false;\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }",
"function bbp_is_single_user_edit()\n{\n}",
"public function authorize()\n {\n return $this->user()->can('update', $this->user);\n }",
"private function allowModification(Inquiry $entity = NULL) {\n \treturn\n \t$this->get('security.context')->isGranted('ROLE_ADMIN') ||\n \t$entity &&\n \t$entity->getTraveller() == $this->getUser()\n \t;\n }",
"public function user_is_editing() {\n global $USER;\n return !empty($USER->editing) && $this->user_allowed_editing();\n }",
"public function userCanEdit(sfGuardUser $user)\n {\n $q = $this->getTable()->createQuery()\n ->addWhere('id = ?', $this['id']);\n Doctrine::getTable('aBlogItem')->filterByEditable($q, $user['id']);\n return count($q->execute());\n }",
"public function authorize()\n {\n return $this->user()->can('update', [\n Article::class,\n $this->route('article'),\n ]);\n }",
"private function canEdit(User $user, ?Thing $subject): bool\n {\n $validRoles = ['ROLE_ADMIN', 'ROLE_HEALTH'];\n\n foreach ($validRoles as $validRole) {\n if ($this->security->isGranted($validRole)) {\n return true;\n }\n }\n\n return null !== $subject && $user === $subject->owner();\n }",
"public function edit($user, $model = null)\n {\n return $user->can($this->authorisationPrefix() . '.edit');\n }",
"public function edit(User $user)\n {\n return $user->isAdmin();\n }",
"public function determine_if_model_has_permission()\n {\n $this->assertFalse($this->testUser->can('edit-articles'));\n }"
] | [
"0.7682579",
"0.74073297",
"0.7384736",
"0.72768706",
"0.7240629",
"0.7136444",
"0.71145564",
"0.7107715",
"0.7045697",
"0.70320123",
"0.6999091",
"0.6958057",
"0.6928341",
"0.692497",
"0.69245577",
"0.6878475",
"0.68678004",
"0.6833261",
"0.6831648",
"0.6813118",
"0.6807698",
"0.679421",
"0.6784746",
"0.67626655",
"0.67368263",
"0.6723967",
"0.6712677",
"0.67012775",
"0.66396135",
"0.66374385"
] | 0.7445478 | 1 |
Check if $user can delete the entity | public function can_delete( $entity, $user = null ) {
if ( is_null( $user ) ) {
$user = get_current_user_id();
} elseif ( is_object( $user ) ) {
$user = $user->ID;
}
$entity = self::get_entity_by_post( $entity );
$entity_cap = $entity->get_capabilities();
if ( ! isset( $entity_cap->delete_post ) ) {
return false;
}
return user_can( $user, $entity_cap->delete_post, $entity->get_id() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canDelete(User $user) {\n return $this instanceof IState ? $this->state()->canDelete($user) : false;\n }",
"public function canDelete(Model_User $user)\n\t{\n\t\treturn false;\n\t}",
"public function checkIfUserCanDelete($user) {\n return $this->owner==$user->getUsername() || $user->isAdmin();\n }",
"public function canDelete()\n {\n if ($this->created_by == Yii::$app->user->id) {\n return true;\n }\n\n return false;\n }",
"function canDelete($user) {\n if($this->isBuiltIn() || $this->isDefault()) {\n return false;\n } // if\n \n return $user->isAdministrator();\n }",
"public function delete($user)\n {\n return $user->permission == 1 ? true : false ;\n }",
"function can_delete() {\n\t\tif ($this->permissions['all']) {\n\t\t\treturn $this->check_permission($this->permissions['all']);\n\t\t} elseif ($this->permissions['delete']) {\n\t\t\treturn $this->check_permission($this->permissions['delete']);\n\t\t} elseif ($this->object && $this->permissions['delete_own']) {\n\t\t\tif (current_user()->id == $this->object->author) {\n\t\t\t\treturn $this->check_permission($this->permissions['delete_own']);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function CanDelete()\n\t{\treturn $this->id && $this->CanAdminUserDelete();\n\t}",
"public function delete(User $user)\n {\n if ($user->can('delete_user') || $user->can('manage_users')) {\n return true;\n }\n\n return false;\n }",
"public function delete($user, $model = null)\n {\n return $user->can($this->authorisationPrefix() . '.delete');\n }",
"public function delete(User $user)\n {\n if($user->can($this->common_permission.'delete') || $user->can($this->common_permission.'delete')) {\n return true;\n }\n return false;\n }",
"abstract public function canDelete();",
"public function delete(User $user)\n {\n return $user->can('delete_education');\n }",
"function canDeleteItem() {\n\n if (($this->fields[\"users_id\"] == Session::getLoginUserID())\n || Session::haveRight(static::$rightname, DELETE)) {\n return true;\n }\n return false;\n }",
"function delete(){\n global $USER;\n if($this->may($USER, DELETE)) {\n self::deleteFromMenu();\n return parent::delete();\n } return false;\n }",
"public function delete(User $user)\n {\n return $user->can('delete_pages');\n }",
"public function delete(User $user)\n {\n return $this->hasPermission($user, 'delete', $this->modelName);\n }",
"public function delete(User $userWithRequest, User $user): bool\n {\n $name = $this->getOwnerName($user);\n return $userWithRequest->hasPermissionTo(\"{$name}..user.delete.{$user->id}\");\n }",
"public function delete(User $user)\n {\n if($user->hasPermissionTo('destroy_educational_tool')){\n return true;\n }\n return false;\n }",
"function canDeleteItem() {\n\n if (!Session::haveAccessToEntity($this->getEntityID())) {\n return false;\n }\n\n // user can delete his ticket if no action on it\n if ($_SESSION[\"glpiactiveprofile\"][\"interface\"] == \"helpdesk\"\n && (!($this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || $this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n || $this->numberOfFollowups() > 0\n || $this->numberOfTasks() > 0\n || $this->fields[\"date\"] != $this->fields[\"date_mod\"])) {\n return false;\n }\n\n return static::canDelete();\n }",
"public function authorize()\n {\n return Auth::user()->UserDeleted == false;\n }",
"#[Pure] public function delete(User $user): bool\n {\n return $user->isAdmin();\n }",
"public function forceDelete(User $userWithRequest, User $user): bool\n {\n $name = $this->getOwnerName($user);\n return $userWithRequest->hasPermissionTo(\"{$name}..user.delete.{$user->id}\");\n }",
"public function delete(User $current, User $user)\n {\n if($user->id==$current->id){\n \treturn false;\n }\n \tif($user->isSuperAdmin()){//only super admin can delete other superadmin\n \treturn $current->isSuperAdmin();\n }\n return $current->can('delete_user');\n }",
"public function delete()\n {\n return \\Auth::user()->hasRight('delete-role');\n }",
"public function delete(User $user)\n {\n $permissions = $user->getAllPermissions();\n\n return $permissions->contains('name','delete_entidad');\n }",
"public function canDelete(IdentityInterface $user, User $resource)\n {\n return $this->isUser($user, $resource);\n }",
"public function mayDelete(EntityAccess $entity, ?int $userId = null): bool\n {\n return $this->hasEntityPermission($entity, ACCESS_DELETE, $userId);\n }",
"public function can_delete() {\n\t\treturn false;\n\t}",
"public function userCanDelete($user) {\n // if the user is a guest\n if (!isset($user)) return false;\n\n // if the user is the author of the post\n if ($this->author->user_id == $user->user_id) return true;\n\n // if the user can delete posts for this post's page\n $permissions = Permission::where('user_id', '=', $user->user_id)\n ->where('charity_id', '=', $this->page->charity->charity_id)\n ->where(function($query) {\n $query->where('page_id', '=', $this->page->page_id)\n ->orWhere('page_id', '=', 0);\n })\n ->count();\n \n return $permissions > 0;\n\n }"
] | [
"0.7862284",
"0.7817009",
"0.7635145",
"0.7621417",
"0.75037676",
"0.7496062",
"0.7441806",
"0.74308664",
"0.7427865",
"0.74006706",
"0.7389204",
"0.7388541",
"0.738633",
"0.7302283",
"0.7267154",
"0.72610754",
"0.7260124",
"0.72488636",
"0.72321314",
"0.7185747",
"0.71614647",
"0.7156433",
"0.71552366",
"0.7129484",
"0.711267",
"0.70804113",
"0.70437205",
"0.7043523",
"0.7027109",
"0.7024231"
] | 0.79330456 | 0 |
Check if $user can publish the entity | public function can_publish( $entity, $user = null ) {
if ( is_null( $user ) ) {
$user = get_current_user_id();
} elseif ( is_object( $user ) ) {
$user = $user->ID;
}
$entity = self::get_entity_by_post( $entity );
$entity_cap = $entity->get_capabilities();
if ( ! isset( $entity_cap->publish_posts ) ) {
return false;
}
return user_can( $user, $entity_cap->publish_posts, $entity->get_id() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function publish($user)\n {\n return User::findOrFail($user->id)->hasPermission('laralum::blog.posts.publish');\n }",
"function canShow(?User $p_user): bool\n {\n if($this->publish){\n return true;\n }\n if($p_user){\n if ($p_user->isAdmin()) {\n return true;\n }\n if ($this->id_user == $p_user->id) {\n return true;\n }\n }\n return false;\n }",
"public function isPublishable();",
"public function canPublish()\n {\n if($this->open == null){\n return false;\n }\n \n if(!$this->byInvitationOnly and $this->close == null){\n return false;\n }\n\n return true;\n }",
"public function canPublish() {\n\t\tif ($active = $this->getWorkflowInstance()) {\n\t\t\treturn $active->canPublishTarget($this->owner);\n\t\t}\n\n\t\t// otherwise, see if there's any workflows applied. If there are, then we shouldn't be able\n\t\t// to directly publish\n\t\tif ($effective = singleton('WorkflowService')->getDefinitionFor($this->owner)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public function isAuthorized($user) {\n // All registered users can add posts\n if ($this->action === 'add') {\n return true;\n }\n\n // The owner of a post can edit and delete it\n if (in_array($this->action, array('edit', 'delete'))) {\n $postId = $this->request->params['pass'][0];\n if ($this->Post->isOwnedBy($postId, $user['id'])) { //loggin and own edit/delete/view \n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}",
"public function publish( User &$user = null )\r\n\t\t{\r\n\t\t\t$result = false;\r\n\t\t\t\r\n\t\t\tif ( $this->status == self::DENIED )\r\n\t\t\t{\r\n\t\t\t\t$this->status = self::PENDING;\r\n\t\t\t\t$this->update( $user->id );\r\n\t\t\t\t$result = true;\r\n\t\t\t}\r\n\t\t\tif( $user && $user->is_moderator_of( $this->table ) )\r\n\t\t\t\t$this->approve( $user );\r\n\t\t\t\t\r\n\t\t\treturn $result;\r\n\t\t}",
"public function authorize()\n {\n return \\Auth::user()->hasPermission('bauk.schedule.post');\n }",
"public function publish(User $user)\n {\n if($user->hasRole('Teacher')){\n return true;\n }\n else {\n return false;}\n }",
"public function canPublish()\n\t{\n\t\t$photos = ListingImages::where('listing_id', '=', $this->id)->get();\n\t\t$address = ListingAddress::where('id', '=', $this->id)->first();\n\t\t$user = User::where('id', '=', $this->user_id)->first();\n\t\t\n\t\tif(\n\t\t\tisset($this->name) &&\n\t\t\tisset($this->property_type_id) &&\n\t\t\tisset($this->max_vehicle_length) &&\n\t\t\tisset($this->check_in) &&\n\t\t\tisset($this->check_out) &&\n\t\t\t( \n\t\t\t\t( $this->day_rental == 1 && isset($this->day_pricing) ) || \n\t\t\t\t( $this->month_rental == 1 && isset($this->month_pricing) )\n\t\t\t) &&\n\t\t\tisset($photos) &&\n\t\t\tisset($address->city) &&\n\t\t\tisset($address->state) &&\n\t\t\tisset($address->zipcode) &&\n\t\t\tisset($address->address) &&\n\t\t\tisset($address->lat) &&\n\t\t\tisset($address->lng) &&\n\t\t\tisset($user->stripe_acc) &&\n\t\t\t$this->admin_lock == 0\n\t\t){\n\t\t\treturn true;\n\t\t} \n\t\t\n\t\treturn false;\n\t}",
"public function testCanPublish() {\n\t\t$this->logInWithPermission('ADMIN');\n\t\t$changeSet = new ChangeSet();\n\t\t$changeSet->write();\n\t\t$base = $this->objFromFixture(ChangeSetTest_Base::class, 'base');\n\t\t$changeSet->addObject($base);\n\t\t$changeSet->sync();\n\t\t$this->assertEquals(5, $changeSet->Changes()->count());\n\n\t\t// Test un-authenticated user cannot publish\n\t\tSession::clear(\"loggedInAs\");\n\t\t$this->assertFalse($changeSet->canPublish());\n\n\t\t// campaign admin only permission doesn't grant publishing rights\n\t\t$this->logInWithPermission('CMS_ACCESS_CampaignAdmin');\n\t\t$this->assertFalse($changeSet->canPublish());\n\n\t\t// With model publish permissions only publish is allowed\n\t\t$this->logInWithPermission('PERM_canPublish');\n\t\t$this->assertTrue($changeSet->canPublish());\n\n\t\t// Test user with the necessary minimum permissions can login\n\t\t$this->logInWithPermission([\n\t\t\t'CMS_ACCESS_CampaignAdmin',\n\t\t\t'PERM_canPublish'\n\t\t]);\n\t\t$this->assertTrue($changeSet->canPublish());\n\t}",
"public function authorize()\n {\n $QEH = QEH::where('id', $this->input('qeh_id'))->first();\n if ($QEH->published) {\n return false;\n }\n return true;\n }",
"function _can_manage_content_entity($entity, $managingUser = null)\n{\n if (!$managingUser && \\Auth::check()) $managingUser = \\Auth::user();\n\n // if user found and this user is the entity author, return TRUE\n return ($managingUser && (($managingUser->id == $entity->user->id) || $managingUser->is_admin));\n}",
"public function canPublish($user, Article $article)\n {\n if ($article->get('visibility') === 'public') {\n return new Result(false, 'public');\n }\n\n return new Result($article->get('user_id') === $user['id']);\n }",
"public function authorize() {\n\t\treturn $this->user()->can('create', Stage::class);\n\t}",
"function publication_write_permission_check($hook, $type, $return_value, $params){\n\t\n\tif (!empty($return_value)) {\n\t\t// already allowed\n\t\treturn;\n\t}\n\t\n\tif (empty($params) || !is_array($params)) {\n\t\treturn;\n\t}\n\t\n\t$entity = elgg_extract(\"entity\", $params);\n\t$user = elgg_extract(\"user\", $params);\n\t\n\tif (!($user instanceof ElggUser)) {\n\t\treturn;\n\t}\n\t\n\tif (empty($entity) || !($entity instanceof Publication)) {\n\t\treturn;\n\t}\n\t\n\tif (check_entity_relationship($entity->getGUID(), \"author\", $user->getGUID())) {\n\t\treturn true;\n\t}\n}",
"public function authorize()\n { \n return ($this->user()->canPost()) ? true : false;\n }",
"function bbp_current_user_can_publish_topics()\n{\n}",
"public function authorize()\n {\n if (user()->can('forum-report-post')) {\n return true;\n }\n }",
"protected function canPublish(Request $request)\n {\n $collection = $request->input('extra.collection');\n\n return $request->user()->can(\n $request->new ? \"collections:$collection:create\" : \"collections:$collection:edit\"\n );\n }",
"public function isAuthorized($user) {\n\t\tif ($this->action === 'add') {\n\t\t\treturn true;\n\t\t}\n\n\t\t// The owner of a post can edit and delete it\n\t\tif (in_array($this->action, array('edit', 'delete'))) {\n\t\t\t$postId = (int) $this->request->params['pass'][0];\n\t\t\tif ($this->Post->isOwnedBy($postId, $user['id'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::isAuthorized($user);\n\t}",
"public function shouldPublish()\n {\n if(!$this->canPublish()){\n return false;\n }\n\n foreach ($this->cycle->getRequiredPages() as $requiredPage) {\n if (!$this->hasPage($requiredPage)) {\n return false;\n }\n }\n\n return true;\n }",
"public function authorize()\n {\n return auth()->user() && auth()->id() === $this->post->user_id;\n }",
"public function authorize()\n {\n return $this->user()->can('auteur-create');\n }",
"public function isPublished();",
"public function isPublished();",
"public function isPublished();",
"public function isPublished();",
"public function isPublished();",
"public function isPublished();"
] | [
"0.78187263",
"0.72221667",
"0.71969944",
"0.7017291",
"0.7002159",
"0.69511956",
"0.6928586",
"0.6861378",
"0.6860343",
"0.67930645",
"0.668697",
"0.6673889",
"0.6648541",
"0.6646861",
"0.66450834",
"0.6606622",
"0.6594441",
"0.6571966",
"0.6567841",
"0.65622956",
"0.65497315",
"0.654376",
"0.6531697",
"0.6516194",
"0.6506256",
"0.6506256",
"0.6506256",
"0.6506256",
"0.6506256",
"0.6506256"
] | 0.76795596 | 1 |
test that the source setting only allows Documentors. | function testSourceSetting() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->setSource($reflection);
$this->assertTrue($result);
$fail = new StdClass();
$result = $analyze->setSource($fail);
$this->assertFalse($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isDocument();",
"public function isDocument() {\n\t\treturn $this->contentUrl != null;\n\t}",
"function validate_content(DocumentInfo $doc) {\n // need not be checked by load_content.\n return true;\n }",
"protected function validateDocument()\n {\n // no-op\n }",
"public static function isTransformationAllowedInOptions()\n\t{\n\t\treturn Configuration::allowDocumentTransformation();\n\t}",
"function _authorized_for_stylesheet_action()\n {\n return M_Security::is_allowed('nextgen_edit_style');\n }",
"public function isToolsAllowed();",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/instructordoc');\n }",
"public static function authorizable()\n {\n return false;\n }",
"public function shouldBeSearchable()\n {\n return !$this->isAdministrator();\n }",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/administrativedocument');\n }",
"public function can_test() {\n\t\treturn false;\n\t}",
"public function isRestricted()\n {\n return $this->restrictions == ToolRestriction::RESTRICTED;\n }",
"public function testEditorNoAccess(){\n // Lets first login as an editor\n $this->loginEditor();\n \n // Now we will attempt to access the content types section\n $this->dispatch('/contenttypefields/index/id/1');\n $this->assertRedirectTo('/error/not-the-droids');\n }",
"public function isDocument()\n {\n return $this->isDocument;\n }",
"public function allowed();",
"public function allowSingleTest();",
"public function isAllowed()\n {\n return true;\n }",
"public function hasDocs() {\n\n\t}",
"function disabled_rich_editor($allow_rich_editor) {\n\t\tglobal $post;\n\n\t\tif($post->post_name == 'contact') {\n\t\t\treturn false;\t\t \n\t\t}\n\t\treturn $allow_rich_editor;\n\t}",
"public function test_admin_can_see_band_member_pdf() {\n\t\t$this->assertTrue(true);\n\t}",
"public static function right_public(){return false;}",
"public function canView($member = null)\n {\n if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {\n $member = Member::currentUser();\n }\n\n if ($member &&\n Permission::checkMember(\n $member,\n array(\n 'CMS_ACCESS_DMSDocumentAdmin',\n )\n )\n ) {\n return true;\n }\n return parent::canView($member);\n }",
"public function canEdit()\n\t{\n\t\treturn $this->source->canEdit();\n\t}",
"public function canEdit()\r\n {\r\n return false;\r\n }",
"public function supports($document)\n {\n return $document instanceof SecurityBehavior;\n }",
"function allow_reviews() {\r\n return (boolean) \\query\\main::get_option( 'allow_reviews' );\r\n}",
"public function testCreateDocumentUser ()\n {\n $faker = Factory::create();\n $user = User::where('is_admin', 0)->first();\n $group = Group::inRandomOrder()->first();\n\n $response = $this->actingAs($user, 'api')\n ->json('POST', '/api/documents', [\n 'name' => $faker->company,\n 'content' => $faker->randomHtml(),\n 'group' => $group->id,\n ]);\n\n $response->assertStatus(403);\n }",
"public function canEdit()\n {\n }",
"function load_content(DocumentInfo $doc) {\n // On return true, at least one of `$doc->content` and\n // `$doc->filestore` must be set.\n return false;\n }"
] | [
"0.6279044",
"0.6119331",
"0.5858625",
"0.58411884",
"0.57958657",
"0.57807076",
"0.57324135",
"0.566493",
"0.56323725",
"0.5628669",
"0.54441583",
"0.5443599",
"0.53927666",
"0.5382312",
"0.53796303",
"0.5368155",
"0.5325304",
"0.5321193",
"0.5311046",
"0.52972794",
"0.5287523",
"0.52873474",
"0.5271205",
"0.52643085",
"0.5251693",
"0.52467966",
"0.52359843",
"0.52070975",
"0.52017945",
"0.51964945"
] | 0.68472344 | 0 |
test the link tag rule | function testLinkTagRule() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$links = Set::extract($result['properties'], '{n}.scores.{n}.rule');
$this->assertEqual(count($links), count($result['properties']));
$rules = Set::extract($result['methods'], '{n}.scores.{n}.rule');
$this->assertNotEqual(count($rules[1]), count($rules[3]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isLink(): bool;",
"public function checkLink($link);",
"public function shouldCheckLink($url);",
"static protected function isLink($val)\n {\n return preg_match('/#[0-9]+:[0-9]+/', $val) !== 0;\n }",
"public function testLinkAlternate()\n\t{\n\t\t// <link rel=\"alternate\" hreflang=\"en\" href=\"https://www.exolnet.com/en/services\">\n\t\t$this->markTestIncomplete();\n\t}",
"public function testLinkSearch()\n\t{\n\t\t$this->markTestIncomplete();\n\t}",
"function is_link ($filename) {}",
"function link ($target, $link) {}",
"public function testCheckTrueAnchorCase()\n {\n $html = '<div><p><a name=\"anchor\">Click Here</a></p></div>';\n $dom = new \\DOMDocument('1.0', 'utf-8');\n $dom->loadHTML($html);\n $rule = new AnchorSuspiciousLinkText($dom);\n\n $this->assertEquals(0, $rule->check(), 'Anchor Suspicious Link Test should have no issues.');\n }",
"public function checkIfItIsCustomLink()\n {\n $check = Validator::make($this->node, [\n 'title' => 'required',\n 'link' => 'required',\n ]);\n\n if ($check->fails()) {\n throw new InvalidMenuStructureException($check->errors());\n }\n\n return true;\n }",
"public function testLinkFirst()\n\t{\n\t\t$this->markTestIncomplete();\n\t}",
"public function testCheckFalseLinkAsTextCase()\n {\n $html = '<div><p><a href=\"https://cnn.com\">https://cnn.com</a></p></div>';\n $dom = new \\DOMDocument('1.0', 'utf-8');\n $dom->loadHTML($html);\n $rule = new AnchorSuspiciousLinkText($dom);\n\n $this->assertEquals(1, $rule->check(), 'Anchor Suspicious Link Test should have one issue.');\n }",
"protected function getLinkTag($content) {\n if($content===false)\n return false; \n try {\n $dom = @new Zend_Dom_Query($content);\n //$linkTags = $dom->query('link[rel=\"shortcut icon\"]'); // don't work\n $linkTags = @$dom->query('link');\n foreach($linkTags as $link) {\n if($link->getAttribute('rel') == 'shortcut icon')\n return $linkTags->current()->getAttribute(\"href\"); \n }\n } catch(Exception $e) {\n \n }\n \n return false;\n }",
"public function hasLink()\n {\n return (bool)$this->link;\n }",
"private function checkLinks($parsed)\n {\n $slugs = array();\n\n // Collect the headline slugs\n foreach ($parsed[\"headlines\"] as $ln => $headline) {\n $slugs['#' . $headline[\"slug\"]] = '#' . $headline[\"slug\"];\n }\n\n $return = true;\n $links = array();\n // Collect the links urls\n foreach ($parsed[\"links\"] as $ln => $line) {\n foreach ($line[\"links\"] as $key => $link) {\n $this->addVerboseDetail(\n \"Checking link with target \" . $link[\"url\"]\n );\n if ($link[\"url\"][0] === '#') {\n if (!isset($slugs[$link[\"url\"]])) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n } elseif (filter_var($link[\"url\"], FILTER_VALIDATE_URL)) {\n try {\n $response = $this->browser->request(\n 'GET',\n $link[\"url\"]\n );\n } catch (\\GuzzleHttp\\Exception\\RequestException $e) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n } catch (Exception $e) {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n\n if ($response->getStatusCode() == \"404\") {\n $this->addVerboseDetail(\n \"\\t Link is broken.\"\n );\n $return = false;\n continue;\n }\n } else {\n // It is not an anchor or a url, so it is file\n // Clear the anchor text with file name\n // like CONTRIBUTING.md#add-new-metric\n $file = $link[\"url\"];\n $file = explode('#', $link[\"url\"]);\n $file = $file[0];\n\n if (!file_exists($file)) {\n $return = false;\n continue;\n }\n }\n\n $links[] = $link[\"url\"];\n }\n }\n\n $this->addVerboseDetail(\n \"There is/are \" . count($links) . \" link(s) in README.\"\n );\n\n return $return;\n }",
"public function linkAttributes();",
"public function testGetAttribute()\n {\n $root = new Node('<a href=\"#\" class=\"test\">Test</a>');\n $anchor = $root->getFirstChild();\n $this->assertEquals('#', $anchor->getAttribute('href'));\n }",
"public function testGetTagLinkSeoOn()\n {\n $this->getConfig()->setConfigParam('blSeoMode', true);\n\n $oTag = oxNew('oxTag');\n\n $oTag->set(\"zauber\");\n $this->assertEquals($this->getConfig()->getConfigParam(\"sShopURL\") . \"tag/zauber/\", $oTag->getLink());\n\n $oTag->set(\"testTag\");\n $this->assertEquals($this->getConfig()->getConfigParam(\"sShopURL\") . \"tag/testtag/\", $oTag->getLink());\n }",
"public function isInternalUrl(&$link);",
"function testPackageLink() {\n\t\t$result = $this->ApiDoc->packageLink('foo');\n\t\t$expected = array(\n\t\t\t'a' => array('href' => 'http://localhost/api_generator/api_packages/view/foo'),\n\t\t\t'foo',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->ApiDoc->packageLink('some.package.deep');\n\t\t$expected = array(\n\t\t\t'a' => array('href' => 'http://localhost/api_generator/api_packages/view/some/package/deep'),\n\t\t\t'some.package.deep',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->ApiDoc->packageLink(' some.package.deep');\n\t\t$expected = array(\n\t\t\t'a' => array('href' => 'http://localhost/api_generator/api_packages/view/some/package/deep'),\n\t\t\t' some.package.deep',\n\t\t\t'/a'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}",
"function plugin_autotags_links2($op, $content = '', $autotag = '')\n{\n global $_CONF, $_TABLES, $LANG_LI_AUTOTAG;\n\n if ($op == 'tagname' ) {\n return 'link';\n } else if ($op == 'tagusage') {\n $tagUsage = array(\n array('namespace' => 'links','usage' => 'description')\n );\n return $tagUsage;\n } elseif ( $op == 'desc' ) {\n $tagDescription = $LANG_LI_AUTOTAG['desc_link'];\n return $tagDescription;\n } else if ($op == 'parse') {\n $lid = COM_applyFilter($autotag['parm1']);\n $url = COM_buildUrl($_CONF['site_url']\n . '/links/portal.php?what=link&item=' . $lid);\n\n $sql = \"SELECT l.url, l.title, lc.owner_id,lc.group_id,lc.perm_owner,lc.perm_group,lc.perm_members,lc.perm_anon,\n l.owner_id as lowner_id,l.group_id as lgroup_id,l.perm_owner as lperm_owner,l.perm_group as lperm_group,l.perm_members as lperm_members,l.perm_anon as lperm_anon\n FROM {$_TABLES['links']} AS l LEFT JOIN {$_TABLES['linkcategories']} AS lc ON l.cid=lc.cid WHERE l.lid = '\".DB_escapeString($lid).\"'\";\n\n $result = DB_query($sql);\n $L = DB_fetchArray($result);\n\n $link = '';\n\n if (SEC_hasAccess ($L['owner_id'], $L['group_id'], $L['perm_owner'], $L['perm_group'], $L['perm_members'], $L['perm_anon']) >= 2) {\n if (SEC_hasAccess ($L['lowner_id'], $L['lgroup_id'], $L['lperm_owner'], $L['lperm_group'], $L['lperm_members'], $L['lperm_anon']) >= 2) {\n if (empty($autotag['parm2'])) {\n $siteurl = $L['url'];\n $linktext = $L['title'];\n } else {\n $linktext = $autotag['parm2'];\n $siteurl = $L['url'];\n }\n $attr = array(\n 'title' => $siteurl,\n 'class' => 'ext-link'\n );\n if (\n isset($_CONF['open_ext_url_new_window']) &&\n $_CONF['open_ext_url_new_window'] == true &&\n stristr($siteurl,$_CONF['site_url']) === false\n ) {\n $attr['target'] = '_blank';\n $attr['rel'] = $_LI_CONF['ext_rel'];\n }\n\n $link = COM_createLink($linktext, $url, $attr);\n }\n }\n\n $content = str_replace($autotag['tagstr'], $link, $content);\n\n return $content;\n }\n}",
"function on_page($link, $type = \"name\")\n {\n switch ($type) {\n case \"url\":\n $result = ($link == request()->fullUrl());\n break;\n\n default:\n $result = ($link == request()->route()->getName());\n }\n\n return $result;\n }",
"function is_viewing_ua_webtide_link( $link, $starts_with = false ) {\n\t\n\t// Build the current URL\n\t$current_url = ! ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == 'on' ) ? ( 'http://' . $_SERVER[ 'SERVER_NAME' ] ) : ( 'https://' . $_SERVER[ 'SERVER_NAME' ] );\n\n\t// Add on the request path\n\t$current_url .= isset( $_SERVER[ 'REQUEST_URI' ] ) ? $_SERVER[ 'REQUEST_URI' ] : NULL;\n\t\n\t// If true, this means to test the start of the URL, is helping for testing parent permalinks\n\tif ( $starts_with ) {\n\t\t\n\t\t// Do the URLs match?\n\t\treturn preg_match( '/^' . preg_replace( '/([^a-z])/i', '\\\\\\\\\\1', $link ) . '/i', $current_url );\n\t\t\n\t}\n\t\n\t// Do the URLs match?\n\treturn preg_match( '/^' . preg_replace( '/([^a-z])/i', '\\\\\\\\\\1', $link ) . '$/i', $current_url );\n\t\n}",
"public function defineLinkTypeRequirements();",
"public function isLinkableNode(): bool;",
"public function call_parse_link( $matches ) {\r\n $link = $matches[ 0 ];\r\n $label = $matches[ 2 ];\r\n $created_link = $link;\r\n\r\n // parse attributes\r\n\t\t$attrs = $matches[ 1 ];\r\n\t\t$attrs = stripslashes( $attrs );\r\n\t\t$attrs = $this->parse_attrs( $attrs );\r\n\r\n\t\t$rel = ( isset( $attrs[ 'rel' ] ) ) ? strtolower( $attrs[ 'rel' ] ) : '';\r\n\r\n\t\t// href preperation\r\n\t\t$href = $attrs[ 'href' ];\r\n\t\t$href = strtolower( $href );\r\n\t\t$href = trim( $href );\r\n\r\n // checks\r\n $is_external = $this->is_external( $href, $rel );\r\n $is_ignored = $this->is_ignored( $href );\r\n $has_rel_external = (strpos( $rel, 'external' ) !== FALSE);\r\n\r\n\t\t// is an internal link?\r\n // rel=external will be threaded as external link\r\n\t\tif ( ! $is_external && ! $has_rel_external) {\r\n \t\treturn apply_filters('wpel_internal_link', $created_link, $label, $attrs);\r\n }\r\n\r\n // is an ignored link?\r\n // rel=external will be threaded as external link\r\n if ( $is_ignored && ! $has_rel_external ) {\r\n \t\treturn apply_filters('wpel_external_link', $created_link, $link, $label, $attrs, TRUE);\r\n }\r\n\r\n\t\t// set rel=\"external\" (when not already set)\r\n\t\tif ( $this->get_opt( 'external' ) )\r\n\t\t\t$this->add_attr_value( $attrs, 'rel', 'external' );\r\n\r\n\t\t// set rel=\"nofollow\" when doesn't have \"follow\" (or already \"nofollow\")\r\n\t\tif ( $this->get_opt( 'nofollow' ) AND strpos( $rel, 'follow' ) === FALSE )\r\n\t\t\t$this->add_attr_value( $attrs, 'rel', 'nofollow' );\r\n\r\n\t\t// set title\r\n\t\t$title_format = $this->get_opt( 'title' );\r\n $title = ( isset( $attrs[ 'title' ] ) ) ? $attrs[ 'title' ] : '';\r\n\t\t$attrs[ 'title' ] = str_replace( '%title%', $title, $title_format );\r\n\r\n\t\t// set user-defined class\r\n\t\t$class = $this->get_opt( 'class_name' );\r\n\t\tif ( $class )\r\n\t\t\t$this->add_attr_value( $attrs, 'class', $class );\r\n\r\n\t\t// set icon class, unless no-icon class isset or another icon class ('ext-icon-...') is found or content contains image\r\n\t\tif ( $this->get_opt( 'icon' ) > 0\r\n\t\t\t\t\tAND ( ! $this->get_opt( 'no_icon_class' ) OR strpos( $attrs[ 'class' ], $this->get_opt( 'no_icon_class' ) ) === FALSE )\r\n\t\t\t\t\tAND strpos( $attrs[ 'class' ], 'ext-icon-' ) === FALSE\r\n\t\t\t\t\tAND !( $this->get_opt( 'image_no_icon' ) AND (bool) preg_match( '/<img([^>]*)>/is', $label )) ){\r\n\t\t\t$icon_class = 'ext-icon-'. $this->get_opt( 'icon', 'style' );\r\n\t\t\t$this->add_attr_value( $attrs, 'class', $icon_class );\r\n\t\t}\r\n\r\n // set target\r\n $no_icon_class = $this->get_opt( 'no_icon_class' );\r\n $target = $this->get_opt( 'target' );\r\n\r\n // remove target\r\n unset($attrs[ 'target' ]);\r\n\r\n if ($this->get_opt( 'no_icon_same_window' )\r\n\t\t\t\t\tAND $no_icon_class AND strpos( $attrs[ 'class' ], $no_icon_class ) !== FALSE) {\r\n // open in same window\r\n } elseif ($target && $target !== '_none') {\r\n if ($this->get_opt( 'use_js' )) {\r\n // add data-attr for javascript\r\n $attrs['data-wpel-target'] = $target;\r\n } else {\r\n // set target value\r\n $attrs[ 'target' ] = $this->get_opt( 'target' );\r\n }\r\n }\r\n\r\n\t\t// create element code\r\n\t\t$created_link = '<a';\r\n\r\n\t\tforeach ( $attrs AS $key => $value ) {\r\n\t\t\t$created_link .= ' '. $key .'=\"'. $value .'\"';\r\n }\r\n\r\n\t\t$created_link .= '>'. $label .'</a>';\r\n\r\n\t\t// filter\r\n\t\t$created_link = apply_filters('wpel_external_link', $created_link, $link, $label, $attrs, FALSE);\r\n\r\n\t\treturn $created_link;\r\n\t}",
"private function checkContentHasLinks() {\n\n\t\t$html = $this->owner->Content;\n\n\t\t// for newly created page\n\t\tif ($html == '') {\n\t\t\treturn false;\n\t\t}\n\n\t\t$dom = new DOMDocument;\n\t\t$dom->loadHTML($html);\n\n\t\t$elements = $dom->getElementsByTagName('a');\n\t\treturn ($elements->length) ? true : false;\n\n\t}",
"public function testCanonical()\n\t{\n\t\t$this->assertLink('canonical');\n\t}",
"public function testStylesheetLinkOverrideRelLink()\n {\n $this->specify(\n \"stylesheetLink overriding rel local returns invalid HTML Strict\",\n function () {\n Tag::resetInput();\n $options = [\n 'css/phalcon.css',\n 'rel' => 'stylesheet/less',\n ];\n $expected = '<link rel=\"stylesheet/less\" type=\"text/css\" '\n . 'href=\"/css/phalcon.css\" />'\n . PHP_EOL;\n\n Tag::setDocType(Tag::XHTML10_STRICT);\n $actual = Tag::stylesheetLink($options);\n\n expect($actual)->equals($expected);\n }\n );\n\n $this->specify(\n \"stylesheetLink overriding rel local returns invalid HTML Strict\",\n function () {\n Tag::resetInput();\n $options = [\n 'css/phalcon.css',\n 'rel' => 'stylesheet/less',\n ];\n $expected = '<link rel=\"stylesheet/less\" type=\"text/css\" '\n . 'href=\"/css/phalcon.css\">'\n . PHP_EOL;\n\n Tag::setDocType(Tag::HTML5);\n $actual = Tag::stylesheetLink($options);\n\n expect($actual)->equals($expected);\n }\n );\n }",
"public function hasLinktarget()\n {\n return $this->linktarget !== null;\n }"
] | [
"0.7020864",
"0.700814",
"0.66748846",
"0.6342439",
"0.63258004",
"0.62714666",
"0.6097241",
"0.6075385",
"0.6042239",
"0.6030751",
"0.5994231",
"0.5974095",
"0.5926166",
"0.5925227",
"0.5924172",
"0.59196067",
"0.5918061",
"0.59173924",
"0.58898395",
"0.58689076",
"0.58648103",
"0.5845532",
"0.5806348",
"0.57915896",
"0.5775555",
"0.5756749",
"0.5753758",
"0.5726042",
"0.57212526",
"0.5720397"
] | 0.76260525 | 0 |
test the missing param tag rule | function testParamTagRule() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$result = $result['methods'][2];
$this->assertEqual($result['scores'][1]['rule'], 'MissingParams');
$this->assertEqual($result['scores'][1]['score'], 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testMissingParameterGetCheck() {\n $this->pingdom->getCheck(null);\n }",
"public function testMissingParameterAddCheckNull() {\n $this->pingdom->addCheck(null);\n }",
"protected function checkSpecificParams()\n {\n }",
"public function testMissingParametersEnsureParameters() {\n $this->pingdom->ensureParameters(null, __method__);\n }",
"public function testMissingParametersModifyCheckCheckId() {\n $this->pingdom->modifyCheck(null, array('parameter' => 'value'));\n }",
"public function testMissingParametersEnsureParametersEmptyValues() {\n $parameters = array(\n 'bool' => FALSE,\n 'int' => 0,\n 'float' => 0.0,\n 'string' => '',\n 'array' => array(),\n );\n try {\n $error = FALSE;\n $this->pingdom->ensureParameters($parameters, __method__);\n }\n catch (MissingParameterException $e) {\n $error = TRUE;\n }\n $this->assertFalse($error);\n }",
"public function testMissingParametersModifyCheckParameters() {\n $this->pingdom->modifyCheck(12345678, null);\n }",
"public function testMissingParametersModifyChecksCheckId() {\n $this->pingdom->modifyChecks(null, array('parameter' => 'value'));\n }",
"abstract protected function validate_params();",
"public function testMissingParametersModifyChecksParameters() {\n $this->pingdom->modifyChecks(12345678, null);\n }",
"public function testMissingParametersEnsureMethod() {\n $this->pingdom->ensureParameters(array(), null);\n }",
"public function testMissingParameterAddCheckName() {\n $check = $this->default_check;\n $check['name'] = null;\n $this->pingdom->addCheck($check);\n }",
"public function testMissingParametersModifyAllChecks() {\n $this->pingdom->modifyAllChecks(null);\n }",
"public function testMissingParametersRemoveCheck() {\n $this->pingdom->removeCheck(null);\n }",
"public function hasParams() {}",
"public function testMissingParametersRemoveChecks() {\n $this->pingdom->removeChecks(null);\n }",
"public function test_param()\n\t{\n\t\t$uri = 'foo/bar/id';\n\t\t$request = Request::factory($uri);\n\n\t\t$this->assertArrayHasKey('id', $request->param());\n\t\t$this->assertArrayNotHasKey('foo', $request->param());\n\t\t$this->assertEquals($request->uri(), $uri);\n\n\t\t// Ensure the params do not contain contamination from controller, action, route, uri etc etc\n\t\t$params = $request->param();\n\n\t\t// Test for illegal components\n\t\t$this->assertArrayNotHasKey('controller', $params);\n\t\t$this->assertArrayNotHasKey('action', $params);\n\t\t$this->assertArrayNotHasKey('directory', $params);\n\t\t$this->assertArrayNotHasKey('uri', $params);\n\t\t$this->assertArrayNotHasKey('route', $params);\n\t}",
"public function testMissingParametersGetAnalysis() {\n $this->pingdom->getAnalysis(null);\n }",
"public function testFailsValidationMissingParams()\n {\n $result = $this->tool->validateAuto(\n array(),\n $this->site_id,\n $this->form_id\n );\n\n $this->assertFalse($result);\n }",
"public function testPassingInvalidAtrributeThrowsException()\r\n {\r\n \t$this->_helper->bodyTag('notvalid');\r\n }",
"function validParam($element, $value, $args){\n\t$suffix = $args[1];\n\t$gcmd = $args[0]->exportValue('gcmd_science_key_'.$suffix);\n\t$varName = $args[0]->exportValue('new_variable_'.$suffix);\n\n\t//echo 'validParam: '.$gcmd[0].' - '.$varName.' - '.$value;\n\n\tif (!empty($value) && ($gcmd[0] == 0) && empty($varName) ){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n\n}",
"function valid($param){\n return (isset($param) && !empty($param)) ? true : false;\n }",
"public function testGetNonExistingParameter()\n {\n $this\n ->get('elcodi.manager.configuration')\n ->get('non_existent_parameter');\n }",
"public function shouldRequestFacetValueForMissing();",
"public function validateParams()\n\t{\n\t\t// Validate that a 'tag' was passed\n\t\tif (!$this->tag)\n\t\t{\n\t\t\tthrow new Memberfuse_Menu_Decorator_Exception(\n\t\t\t\t'No tag provided for the tag decorator'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Get an array of valid positions\n\t\t$positions = array('prepend', 'append', 'wrap');\n\t\t\n\t\t// Validate the position\n\t\tif (!in_array($this->position, $positions))\n\t\t{\n\t\t\tthrow new Memberfuse_Menu_Decorator_Exception(\n\t\t\t\tsprintf('Invalid position %s provided.', $this->position)\n\t\t\t);\n\t\t}\n\t\t\n\t\t// If the position is wrap, make sure the user did not enter custom contents\n\t\tif ($this->contents && $this->position == 'wrap')\n\t\t{\n\t\t\tthrow new Memberfuse_Menu_Decorator_Exception(\n\t\t\t\t'Cannot include contents for wrapping tags'\n\t\t\t);\n\t\t}\n\t}",
"function mandatoryCheck($param){\r\n\t\tif(!empty($param) && $param != \" \"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"abstract protected function _validateParams($args, $spec);",
"function test_empty_get_param_filter() {\n\t\tself::clear_get_values();\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\n\t\t// Add filter \"Single Line Text is equal to [get param=test]\"\n\t\t$filter_args = array(\n\t\t\tarray( 'type' => 'field',\n\t\t\t\t'col' => '493ito',\n\t\t\t\t'op' => '=',\n\t\t\t\t'val' => '[get param=test]',\n\t\t\t),\n\t\t);\n\t\tself::add_filter_to_view( $dynamic_view, $filter_args );\n\n\t\t$expected_content = array( 'Jamie', 'Steph', 'Steve' );\n\t\t$d = self::get_default_args( $dynamic_view, $expected_content, array() );\n\n\t\tself::run_get_display_data_tests( $d, 'view with empty get param filter' );\n\t}",
"protected function validateArguments()\n {\n /** @var \\phpDocumentor\\Reflection\\FunctionReflector $source */\n $source = $this->source;\n $params = $this->docblock->getTagsByName('param');\n $arguments = $source->getArguments();\n\n foreach (array_values($arguments) as $key => $argument) {\n if (!$this->isArgumentInDocBlock($key, $argument, $params)) {\n continue;\n }\n\n $this->doesArgumentNameMatchParam($params[$key], $argument);\n $this->doesArgumentTypehintMatchParam($params[$key], $argument);\n }\n\n foreach ($params as $param) {\n $param_name = $param->getVariableName();\n $this->isDefaultIdeType($param);\n\n if (isset($arguments[$param_name])) {\n continue;\n }\n\n $this->logParserError(\n 'NOTICE', 50013, $this->lineNumber,\n array($param_name, $this->entityName . '()')\n );\n }\n }",
"public function hasNoParams($one, $two, $three) {\n\t\t\n\t}"
] | [
"0.6980156",
"0.69347715",
"0.689315",
"0.6860548",
"0.67176473",
"0.6680197",
"0.66141945",
"0.6605437",
"0.6559257",
"0.6554184",
"0.6551622",
"0.65307367",
"0.6436935",
"0.641026",
"0.6380606",
"0.6331764",
"0.6224564",
"0.6161954",
"0.61492157",
"0.6076308",
"0.60421616",
"0.6019941",
"0.60073197",
"0.6003944",
"0.5959642",
"0.58964723",
"0.5878888",
"0.58691067",
"0.5831116",
"0.58266985"
] | 0.77361685 | 0 |
test the empty doc block rule | function testEmptyDocblockRule() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$result = $result['methods'][0];
$this->assertEqual($result['subject'], 'hasNoDocs');
$this->assertEqual($result['scores'][1]['rule'], 'Empty');
$this->assertEqual($result['scores'][1]['score'], '0');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testThereMayNotBeAnyContentBeforeTheOpeningTag(): void\n {\n }",
"function testConstruction() {\n\t\t$analyze = new DocBlockAnalyzer(array('MissingLink', 'IncompleteTags'));\n\t\t$rules = $analyze->getRules();\n\t\t$this->assertEqual(array_keys($rules), array('MissingLink', 'IncompleteTags'));\n\t}",
"public function testGetDocCommentReturnsFalseIfNoCommentIsAvailable()\n {\n $method = $this->createReflection('Reflection_NoDocBlockAspect', 'notDocumentedMethod');\n $this->assertFalse($method->getDocComment());\n }",
"public function testEmpty0()\n {\n $axyml = $this->getFile('empty0.axyml');\n $html = $this->getFile('empty0.html');\n $plain = $this->getFile('empty0.txt');\n $parser = new Parser();\n $result = $parser->parse($axyml);\n $this->assertSame($html, rtrim($result->html));\n $this->assertSame($plain, $result->plain);\n $this->assertEmpty($result->errors);\n }",
"public function testCheckBlockDefinitionsMissing()\n {\n $cont = <<<EOT\n<!-- BEGIN one -->\n<!-- BEGIN two -->\n<!-- END two -->\n<!-- END three -->\n<!-- BEGIN four -->\n<!-- BEGIN four -->\n<!-- END four -->\n<!-- BEGIN five -->\n<!-- END five -->\n<!-- END five -->\nEOT;\n $arErrors = HTML_Template_PHPLIB_Validator::checkBlockDefinitions(\n HTML_Template_PHPLIB_Helper::getLines(null, $cont)\n );\n $arErrors = self::stripMessages($arErrors);\n $this->assertEquals(\narray (\n array (\n 'short' => 'UNFINISHED_BLOCK',\n 'line' => 1,\n 'code' => 'one',\n ),\n array (\n 'short' => 'DUPLICATE_BLOCK',\n 'line' => 5,\n 'code' => 'four',\n ),\n array (\n 'short' => 'UNFINISHED_BLOCK',\n 'line' => 4,\n 'code' => 'three',\n ),\n array (\n 'short' => 'DUPLICATE_BLOCK',\n 'line' => 9,\n 'code' => 'five',\n ),\n array (\n 'short' => 'WRONG_NESTING',\n 'line' => 4,\n 'code' => '<!-- END three -->',\n ),\n array (\n 'short' => 'WRONG_NESTING',\n 'line' => 10,\n 'code' => '<!-- END five -->',\n ),\n),\n $arErrors\n );\n }",
"public function testHasDocCommentReturnsFalseIfCommentIsNotAvailable()\n {\n $method = $this->createReflection('Reflection_NoDocBlockAspect', 'notDocumentedMethod');\r\n $this->assertFalse($method->hasDocComment());\n }",
"public function isNoPhpDoc ()\n {\n return $this->params['no-phpdoc'];\n }",
"public function testEmpty() {\r\n }",
"function parserDocBlock()\n {\n global $phpDocumentor_DefaultPackageName;\n $this->package = $GLOBALS['phpDocumentor_DefaultPackageName'];\n $this->category = $GLOBALS['phpDocumentor_DefaultCategoryName'];\n }",
"function commonDocBlock($word, $pevent, $deschandler)\n {\n $this->_wp->backupPos();\n $this->_event_stack->popEvent();\n $word = $this->_pv_last_word[1];\n $dtype = '_pv_docblock';\n if (strpos($word, '/**') !== 0) {\n // not a docblock\n // $this->_wp->backupPos();\n $this->_event_stack->pushEvent(PARSER_EVENT_COMMENT);\n return;\n }\n if ($word == '/**#@-*/') {\n // stop using docblock template\n $this->publishEvent(PHPDOCUMENTOR_EVENT_NEWSTATE,\n PHPDOCUMENTOR_EVENT_END_DOCBLOCK_TEMPLATE);\n unset($this->_pv_dtemplate);\n return;\n }\n if (strpos($word, '/**#@+') === 0) {\n // docblock template definition\n $dtype = '_pv_dtemplate';\n // strip /**#@+ and */\n $word = substr($word, 6).'*';\n $word = trim(substr($word, 0, strlen($word) - 3));\n if (strlen($word) && $word{0} != '*') {\n $word = \"* $word\";\n }\n } else {\n // strip /** and */\n $word = substr($word, 2);\n $word = substr($word, 0, strlen($word) - 2);\n }\n $lines = explode(\"\\n\", trim($word));\n $go = count($lines);\n for ($i=0; $i < $go; $i++) {\n if (substr(trim($lines[$i]), 0, 1) != '*') {\n unset($lines[$i]);\n } else {\n // remove leading \"* \"\n $lines[$i] = substr(trim($lines[$i]), 1);\n }\n }\n // remove empty lines\n if ($lines == array(false)) { \n // prevent PHP 5.2 segfault (see http://bugs.php.net/bug.php?id=39350)\n $lines = array('');\n }\n $lines = explode(\"\\n\", trim(join(\"\\n\", $lines)));\n for ($i = 0; $i < count($lines); $i++) {\n if (substr(trim($lines[$i]), 0, 1) == '@' && \n substr(trim($lines[$i]), 0, 2) != '@ '\n ) {\n $tagindex = $i;\n $i = count($lines);\n }\n }\n if (isset($tagindex)) {\n $tags = array_slice($lines, $tagindex);\n $desc = array_slice($lines, 0, $tagindex);\n } else {\n $tags = array();\n $desc = $lines;\n }\n //var_dump($desc,$tags);\n $this->$dtype = new parserDocBlock;\n $this->$dtype->setLineNumber($this->_wp->_docblock_linenum + 1);\n $this->$dtype->setEndLineNumber($this->_wp->linenum);\n $this->_pv_dtype = $dtype;\n $this->$deschandler($desc);\n $this->handleTags($tags);\n if ($dtype == '_pv_docblock') {\n $this->publishEvent(PHPDOCUMENTOR_EVENT_DOCBLOCK, $this->$dtype);\n $this->$dtype = new parserDocBlock();\n } else {\n $this->publishEvent(PHPDOCUMENTOR_EVENT_DOCBLOCK_TEMPLATE,\n $this->$dtype);\n }\n }",
"public function methodWithDocblocks()\n {\n\n }",
"protected function hasDocBlock()\n {\n if ($this->docblock) {\n return true;\n }\n\n $this->logParserError(\n 'ERROR',\n $this instanceof MethodValidator ? 50010 : 50009,\n $this->lineNumber,\n array($this->entityName . '()')\n );\n\n return false;\n }",
"public function testInvalidAnnotation()\n {\n $doc = '/** @asdasd */';\n $this->parser->parseDoc($doc);\n }",
"public function testTheShortOpenTagMayNotBeUsed(): void\n {\n }",
"function method_with_comment()\n {\n /**\n * Invalid doc comment location.\n */\n }",
"public function testViewCommentsAreNotDisplayed()\n {\n $this->view->setContents('{# Testing #}');\n $this->assertEquals('', $this->fortuneCompiler->compile($this->view));\n }",
"public function testCheckBlockDefinitionsWrongOrder()\n {\n $cont = <<<EOT\n<!-- END one -->\n<!-- BEGIN one -->\nEOT;\n $arErrors = HTML_Template_PHPLIB_Validator::checkBlockDefinitions(\n HTML_Template_PHPLIB_Helper::getLines(null, $cont)\n );\n $arErrors = self::stripMessages($arErrors);\n $this->assertEquals(\narray(\n array (\n 'short' => 'WRONG_ORDER',\n 'line' => 2,\n 'code' => 'one',\n ),\n array (\n 'short' => 'WRONG_NESTING',\n 'line' => 1,\n 'code' => '<!-- END one -->',\n ),\n),\n $arErrors\n );\n }",
"public function testReturnContentIsCorrect()\n {\n $this->assertNotEmpty($this->pageParser->getContent()[1]);\n }",
"public function testEmptyContent()\n\t{\n\t\t$this->assertSame('', static::$parserClean\n\t\t\t->setContent('')\n\t\t\t->parse()\n\t\t\t->getContent(), 'Clean instance: empty content should return empty result');\n\t}",
"public function testThereMayNotBeInlineHtml(): void\n {\n }",
"protected function validateDocument()\n {\n // no-op\n }",
"public function isBlankNode();",
"#[@test]\n public function readEmpty() {\n $this->assertRead('');\n }",
"public function testNoneToken() {\n\n\t\t$lexer = new AnnotationLexer();\n\t\t$stream = $lexer->scan(' # ');\n\n\t\t$actual = $this->buildActualTokens($stream);\n\t\t$expected = array(\n\t\t\tarray(AnnotationLexer::T_NONE => '#'),\n\t\t);\n\t\t$this->assertSame($expected, $actual);\n\t}",
"public function testHeredoc()\n {\n $token = $this->getTargetToken('/* testHeredoc */', T_FN);\n $this->backfillHelper($token);\n $this->scopePositionTestHelper($token, 4, 9);\n\n }",
"function validate_content(DocumentInfo $doc) {\n // need not be checked by load_content.\n return true;\n }",
"public function hasDocComment()\n {\n return !empty($this->docComment);\n }",
"public function testEmptyData()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/admin')\n ->clickLink('Home Page')\n ->assertSee('Categories')\n ->assertSee('Places')\n ->assertSee('News')\n ->assertSee('Booking Rooms')\n ->assertSee('Hotels')\n ->assertSee('Users')\n ->assertSeeIn('.small-box .inner h3', '0');\n });\n }",
"public function testNoStopAtEofError()\n {\n $res = $this->cndParser->parseFile(__DIR__.'/resources/cnd/no-stop-at-eof.cnd');\n\n $this->assertArrayHasKey('namespaces', $res);\n $this->assertEquals(['phpcr' => 'http://www.doctrine-project.org/projects/phpcr_odm'], $res['namespaces']);\n\n $this->assertArrayHasKey('nodeTypes', $res);\n }",
"public function test_phpdoc_tags_inline() {\n global $PAGE;\n $output = $PAGE->get_renderer('local_moodlecheck');\n $path = new local_moodlecheck_path('local/moodlecheck/tests/fixtures/phpdoc_tags_inline.php ', null);\n $result = $output->display_path($path, 'xml');\n\n // Convert results to XML Objext.\n $xmlresult = new DOMDocument();\n $xmlresult->loadXML($result);\n\n // Let's verify we have received a xml with file top element and 8 children.\n $xpath = new DOMXpath($xmlresult);\n $found = $xpath->query(\"//file/error\");\n // TODO: Change to DOMNodeList::count() when php71 support is gone.\n $this->assertSame(8, $found->length);\n\n // Also verify various bits by content.\n $this->assertStringContainsString('packagevalid', $result);\n $this->assertStringContainsString('Invalid inline phpdocs tag @param found', $result);\n $this->assertStringContainsString('Invalid inline phpdocs tag @throws found', $result);\n $this->assertStringContainsString('Inline phpdocs tag {@link tags have to be 1 url} with incorrect', $result);\n $this->assertStringContainsString('Inline phpdocs tag {@see must be 1 word only} with incorrect', $result);\n $this->assertStringContainsString('Inline phpdocs tag {@see $this->tagrules['url']} with incorrect', $result);\n $this->assertStringContainsString('Inline phpdocs tag not enclosed with curly brackets @see found', $result);\n $this->assertStringContainsString('It must match {@link valid URL} or {@see valid FQSEN}', $result);\n $this->assertStringNotContainsString('{@link https://moodle.org}', $result);\n $this->assertStringNotContainsString('{@see has_capability}', $result);\n $this->assertStringNotContainsString('ba8by}', $result);\n }"
] | [
"0.6823039",
"0.64174885",
"0.6303223",
"0.6196758",
"0.60994714",
"0.609282",
"0.6091145",
"0.60609275",
"0.59924823",
"0.59546363",
"0.59322363",
"0.5924333",
"0.5873038",
"0.5853318",
"0.57638973",
"0.5760246",
"0.57141405",
"0.5712879",
"0.5692523",
"0.56822085",
"0.56312263",
"0.56219107",
"0.5614631",
"0.5600144",
"0.55871475",
"0.557033",
"0.5556634",
"0.5554311",
"0.5540044",
"0.55346763"
] | 0.8527792 | 0 |
test that the classInfo scoring works as intended. | function testClassInfoScoring() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$this->assertEqual($result['classInfo']['subject'], 'classInfo');
$this->assertEqual($result['classInfo']['scores'][0]['rule'], 'MissingLink');
$this->assertEqual($result['classInfo']['scores'][1]['rule'], 'IncompleteTags');
$this->assertEqual($result['classInfo']['totalScore'], 0.5);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testClassAccess()\n\t{\n\t\tforeach ($this->classes as $key => $name)\n\t\t{\n\t\t\t$this->assertSame( $name, $this->definition->classname( $key ) );\n\t\t}\n\t}",
"function testMethodScoring() {\n\t\t$analyze = new DocBlockAnalyzer();\n\t\t$reflection = new ClassDocumentor('TestSubjectOne');\n\t\t$result = $analyze->analyze($reflection);\n\t\t\n\t\t$this->assertEqual($result['methods'][0]['subject'], 'hasNoDocs');\n\t\t$this->assertEqual($result['methods'][0]['scores'][0]['rule'], 'MissingLink');\n\t\t$this->assertEqual($result['methods'][0]['scores'][1]['rule'], 'Empty');\n\t\t$this->assertEqual($result['methods'][0]['scores'][2]['rule'], 'IncompleteTags');\n\t\t$this->assertEqual($result['methods'][0]['totalScore'], 0.25);\n\t}",
"public function testGetClasses()\r\n\t{\r\n\t}",
"abstract public function getNumTestedClasses(): int;",
"function testPropertyScoring() {\n\t\t$analyze = new DocBlockAnalyzer();\n\t\t$reflection = new ClassDocumentor('TestSubjectOne');\n\t\t$result = $analyze->analyze($reflection);\n\n\t\t$this->assertEqual($result['properties'][1]['subject'], 'hasDoc');\n\t\t$this->assertEqual($result['properties'][1]['scores'][0]['rule'], 'MissingLink');\n\t\t$this->assertEqual($result['properties'][1]['totalScore'], 0.75);\n\t}",
"public function testRating()\n {\n $title = $this->getTitle(\"0133093\"); // The Matrix\n $this->assertEquals('8.7', $title->rating());\n }",
"function isCapped($className)\n{\n include(\"dbForGreeley.php\");\n $numberInClass = countClassStudents($className);\n $results = $mysqli->query(\"SELECT * FROM classInfo\"); //Individual class info\n if($results)\n {\n for ($i = 0; $i < $results->num_rows; $i++)\n {\n $results->data_seek($i);\n $row = $results->fetch_assoc();\n if($className == $row['className'])\n {\n $classCap = $row['classCap'];\n if($classCap == $numberInClass)\n {\n return true; //Class is capped\n }\n else\n {\n return false; //Class is not capped\n }\n }\n }\n }\n else\n {\n echo \"false\";\n }\n}",
"public function testGetScoreBeforeEvaluating()\n {\n $this->expectException(Exception::class);\n\n $evaluator = new LanguageDetector();\n $evaluator->getScores();\n }",
"public function testSensitivityAnalysis()\n {\n }",
"public function testValidateClassSuccess()\n {\n $this->validateClass('Henk', 'henk');\n }",
"public function testInfo()\n {\n }",
"public function testCloudPosCheckFastTrackCourse()\n {\n }",
"public function testGetClassReturnsCorrectValue()\n {\n $this->assertEquals(__CLASS__, $this->joinPoint->getClass());\n }",
"#[@test]\n public function objectClassAttribute() {\n $this->assertEquals(\n $this->attributes['objectClass'],\n $this->entry->getAttribute('objectclass')\n );\n }",
"public function testHitung(){\n\t\t$myclass = new pendaftaran();\n\t\t$result = $myclass->hitung(1,1);\n\t\t$this->assertEquals(2, $result);\n\t}",
"public function testGetContextReturnsCorrectValueIfClassNameWasProvided()\n {\n $joinPoint = new AspectPHP_JoinPoint(__FUNCTION__, __CLASS__);\n $this->assertEquals(__CLASS__, $joinPoint->getContext());\n }",
"public function testCount(): void\n {\n self::assertSame(count($this->value), $this->class->count());\n }",
"abstract protected function createScoreInstance();",
"public function testSupportResistance()\n {\n }",
"public function test_countnamesearchfound() {\n $this->load_csv_data();\n $result = track_assignment_count_records(1, \"alphaclass\");\n $this->assertEquals(1, (int)$result);\n }",
"public function testClassDefinition() : void {\n\t\t$obj = new Check(\"id\",\"name\",\"desc\",\"xpath\",\"type\");\n\t\t$this->assertTrue(\n\t\t\tmethod_exists($obj, 'fromArray'), \n\t\t\t'Class does not have method fromArray'\n\t\t);\n\t\t$this->assertTrue(\n\t\t\tmethod_exists($obj, 'listFromArray'), \n\t\t\t'Class does not have method listFromArray'\n\t\t);\n\t}",
"public function testConstuct()\n {\n $input = new \\RugbyRankings\\RatingsInput(0, 0, 0, 0);\n $rugby = new \\RugbyRankings\\Main($input);\n $this->assertInstanceOf('\\RugbyRankings\\Main', $rugby);\n }",
"function test_product_class() \n\t{\n\t\tglobal $suiteCount;\n\t\tglobal $productInfo;\n\t\t/* Start test suite */\n\t\tstart_SUITE($suiteCount, \"Test product class\");\n \t$caseCount = 1;\n \t$numPass = 0;\n\t\t$numFail = 0;\n \t/* Test cases start */\n\t\t/* Test case 1\n\t\t * Test: Creating a new product object\n\t\t */\n\t\tstart_Case($caseCount, \"Creating a new product object\");\n\t\t$product = new product($productInfo);\n\t\tif (get_class($product) == \"product\" && $product != null)\n\t\t{\n\t\t\techo_PASS();\n\t\t\t$numPass++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo_FAIL();\n\t\t\t$numFail++;\n\t\t}\n\t\tend_Case();\n\t\t$caseCount++;\n\t\t/* Test case 2\n\t\t * Test: Check if product info is correct\n\t\t */\n\t\tstart_Case($caseCount, \"Check if product info is correct\");\n\t\tif ($product->getInfo() === $productInfo)\n\t\t{\n\t\t\techo_PASS();\n\t\t\t$numPass++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo_FAIL();\n\t\t\t$numFail++;\n\t\t}\n\t\tend_Case();\n\t\t$caseCount++;\n\t\t/* Test case 3\n\t\t * Test: Updating product info\n\t\t */\n\t\tstart_Case($caseCount, \"Updating product info\");\n\t\t$productInfo->buildID = 2;\n\t\t$product->updateInfo($productInfo);\n\t\tif ($product->getInfo() === $productInfo)\n\t\t{\n\t\t\techo_PASS();\n\t\t\t$numPass++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo_FAIL();\n\t\t\t$numFail++;\n\t\t}\n\t\tend_Case();\n\t\t$caseCount++;\n\t\t/* End test suite */\n\t\tend_SUITE($numPass,$numFail);\n\t\t$suiteCount++;\n\t}",
"abstract protected function getClassUnderTest(): string;",
"public function readClassMetaData()\n {\n\n /** @var Inspector\\Annotation[]|Inspector\\AnnotationsList $result */\n $result = $this->_inspector->getClassAnnotations();\n $this->assertInstanceOf('Slick\\Common\\Inspector\\AnnotationsList', $result);\n $this->assertTrue($result['package']->getValue() == 'Test\\Common\\Examples');\n $this->assertTrue($result['author']->getValue() == 'Filipe Silva <[email protected]>');\n $this->assertTrue($result['test']->getValue());\n\n $this->assertTrue($result->hasAnnotation('@author'));\n\n $this->assertFalse($result->hasAnnotation('@read'));\n \n $inspector = new Inspector('\\Common\\Examples\\Motor');\n $this->assertTrue(count($inspector->getClassAnnotations()) == 0);\n unset($inspector);\n }",
"public function testProjectScore(): void\n {\n /** @var User $user */\n $user = User::factory()->create();\n $this->be($user);\n /** @var Project $project */\n $project = Project::factory()->create();\n $this->assertEquals(0, $project->score);\n $this\n ->actingAs($user)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'pig']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'up']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0.5, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(-.25, $project->score);\n }",
"public function testCheckScore()\n {\n session_start();\n $this->initSession();\n\n commandCheck('throw');\n commandCheck('stop');\n\n $actual = $_SESSION['game']['winner'];\n\n $this->assertNotEquals('None', $actual);\n\n destroySession();\n }",
"public function testNewClassificationOk(){\n\t\t\n\t\t$data = array(\n\t\t\t'Classification' => array(\n\t\t\t\t'id' => 2,\n\t\t\t\t'name' => 'Biblioteca',\n\t\t\t\t'color' => '#2c5aa0',\n\t\t\t\t'sort' => '0',\n\t\t\t\t'created' => '2013-10-03 19:51:17',\n\t\t\t\t'modified' => '2013-10-03 19:51:17'\n\t\t));\n\t\t\n\t\t$result = $this->Classification->save($data);\n\t\t$resultado = $this->Classification->find('count', array(\n\t\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t'id' => 2\n\t\t\t\t\t\t\t\t\t\t)));\n\t\t$this->assertEquals($resultado, 1);\n\t}",
"public function testExecutionBasicClass() : void\n {\n $cw = $this->getClassWriter();\n\n $this->assertExecutionResult(['Hello world!'], $cw);\n }",
"public function testReviewPrototypeCountLikes()\n {\n\n }"
] | [
"0.645861",
"0.60174257",
"0.5990944",
"0.592874",
"0.5864059",
"0.5690179",
"0.5646344",
"0.5619509",
"0.56008166",
"0.5575836",
"0.5533671",
"0.55107963",
"0.5508913",
"0.5439332",
"0.54381627",
"0.53788745",
"0.5378661",
"0.5369557",
"0.53685534",
"0.53506523",
"0.5335719",
"0.5333134",
"0.53283894",
"0.5327193",
"0.5291931",
"0.5276623",
"0.52390176",
"0.52333736",
"0.5217529",
"0.51823413"
] | 0.79059184 | 0 |
test method scoring results. | function testMethodScoring() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$this->assertEqual($result['methods'][0]['subject'], 'hasNoDocs');
$this->assertEqual($result['methods'][0]['scores'][0]['rule'], 'MissingLink');
$this->assertEqual($result['methods'][0]['scores'][1]['rule'], 'Empty');
$this->assertEqual($result['methods'][0]['scores'][2]['rule'], 'IncompleteTags');
$this->assertEqual($result['methods'][0]['totalScore'], 0.25);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getScore();",
"public function getScore(){\n $score = 0;\n \n if($this->_search_run){\n foreach($this->getFoundTotals() as $group => $count){\n $value = $this->_search_groups[$group];\n $score += $value * $count;\n }\n }\n\n return $score;\n }",
"public function getResults() {\n\t\treturn $this->correct;\n\t}",
"function getTotalScore(){\n\t\treturn $this->quizcreator_score + $this->quiztaker_score;\n\t}",
"public function score($updateStatus = true)\n {\n if (empty($this->answers)) {\n $this->answers = '[]';\n }\n\n // the number of items per subject according to the testplan for this test\n $planItems = $this->testform->testplan->items_by_subject;\n // get rid of any subjects that don't have testplan items defined\n $planItems = array_filter((array) $planItems);\n // Array like subjectID => 0 setup to hold correct by subject\n $correctBySubject = array_fill_keys(array_keys($planItems), 0);\n\n // Get testitems with just the subject for this exam\n $items = $this->testform->testitems->load(['subjects' => function ($query) {\n $query->where('exam_testitem.exam_id', '=', $this->exam_id);\n }]);\n\n // get the answers, keyed by testitems.id\n // testitems.id => distractor_id\n $answers = $items->lists('answer', 'id')->all();\n\n // the person's responses, keyed by testitems.id like \n // testitems.id => distractors.id (choice)\n $responses = $this->answers;\n $totalCorrect = 0;\n\n // check each question\n foreach ($responses as $itemId => $answer) {\n // Was an answer provided to this question?\n if (isset($responses->$itemId)) {\n // does their answer match the actual answer?\n if ($answer == $answers[$itemId]) {\n $subjects = $items->find($itemId)->subjects;\n\n if (! $subjects->isEmpty()) {\n $subject = $subjects->first();\n $subjectId = $subject->report_as ? $subject->report_as : $subject->id;\n \n // Yes, they answered correctly\n // Add one to the count of total correct for this subject\n $correctBySubject[$subjectId]++;\n }\n\n // update the total # correct so far\n $totalCorrect++;\n }\n }\n }\n\n // Post-process the number of correct items by subject to account for subject report_as\n $correctBySubject = $this->mapCorrectBySubject($correctBySubject);\n\n // Tally up the regular total and find score\n $total = count($answers);\n $score = ($totalCorrect / $total) * 100;\n $minimum_score = $this->testform->testplan->minimum_score;\n\n $status = $this->status;\n\n // update the status?\n if ($updateStatus === true) {\n $status = $score >= $minimum_score ? 'passed' : 'failed';\n }\n\n // If there were no answers at all\n // and this test hasn't been rescheduled, they were a no-show\n if (empty($this->answers) && $this->status != 'rescheduled') {\n $status = 'noshow';\n }\n\n // Update the testattempt\n $updated = $this->update([\n 'score' => $score,\n 'correct_answers' => $totalCorrect,\n 'total_questions' => $total,\n 'status' => $status,\n 'correct_by_subject' => $correctBySubject\n ]);\n\n return $updated;\n }",
"public function admin_evaluate_score() {\n $this->autoRender = false;\n if ($this->request->is('ajax')) {\n $resultId = $this->params['url']['resultId'];\n $questionNo = $this->params['url']['questionNo'];\n $scoreNo = $this->params['url']['score'];\n \n $result = $this->Result->find('first', array('conditions' => array('Result.id' => $resultId)));\n \n $questionIds = explode(',', $result['Result']['question_ids']);\n $scores = explode(',', $result['Result']['individual_score']);\n $scores[$questionNo] = $scoreNo;\n $questionScores = array();\n $correctScore = 1;\n $incorrectScore = 0;\n $marks = 0;\n $valuation = 0;\n $percentage = 0;\n\n foreach ($scores as $score) {\n\n switch($score) {\n case 1:\n $marks += $correctScore;\n break;\n case 2: \n $marks += $incorrectScore;\n break;\n case 3:\n $valuation = 1;\n }\n }\n\n $percentage = ($marks/$result['Quiz']['no_of_questions']) * 100;\n if ($percentage <= $result['Quiz']['pass_percentage']) {\n $status = 'Fail';\n } else if ($valuation == 1) {\n $status = 'Pending';\n } else {\n $status = 'Pass';\n }\n\n $data = array(\n 'individual_score' => implode(',', $scores),\n 'score' => $marks,\n 'percentage' => $percentage,\n 'manual_valuation' => $valuation,\n 'status' => $status\n );\n \n $this->Result->id = $resultId;\n \n if ($this->Result->save($data)) {\n \n $this->Question->id = $questionIds[$questionNo];\n \n switch ($scoreNo) {\n case 1:\n $this->Question->saveField('times_corrected', (int)$this->Question->field('times_corrected') + 1);\n break;\n case 2:\n $this->Question->saveField('times_incorrected', (int)$this->Question->field('times_incorrected') + 1);\n break;\n }\n\n $this->Session->setFlash(__d('croogo', 'Succefully Submitted'), 'default', array('class' => 'success'));\n switch ($status) {\n case 'Pass':\n $this->sendEmail($resultId);\n break;\n }\n return true;\n } else {\n $this->Session->setFlash(__d('croogo', 'Error Occoured!'), 'default', array('class' => 'error'));\n return false;\n }\n } \n }",
"function results() {\r\n\t\t$this->validate();\r\n\t\t$this->advancedResults();\r\n\t}",
"public function testGenerateResults()\n {\n $data = file_get_contents('./fixtures/games-24.txt');\n $testGames = unserialize($data);\n $data = file_get_contents('./fixtures/franchises.txt');\n $testFranchises = unserialize($data);\n\n // We don't need to pass in a DB connection if we're not using the DB\n $mapper = new \\IBL\\GameMapper();\n $testResults = $mapper->generateResults($testGames, $testFranchises);\n $testResult = $testResults['MAD'];\n $expectedResult = array(\n 'homeTeam' => 'MAD',\n 'awayTeam' => 'BOW',\n 'awayScores' => array(4, 5, 2),\n 'homeScores' => array(3, 6, 3)\n );\n $this->assertEquals($expectedResult, $testResult);\n }",
"public function testWithTermThatHasMultipleResults()\n {\n $this->fixture->config->id = 'spotif';\n $this->fixture->config->key = 'averageUserRating';\n $result = $this->fixture->run();\n // validate result\n $this->assertInternalType('float', $result);\n $this->assertGreaterThanOrEqual(0.5, $result);\n }",
"public function score(){\n\t\treturn $this->score;\n\t}",
"function results() {\n\t\t$this->validate();\n\t\t$this->advancedResults();\n\t}",
"public function getTestCaseResults(): array;",
"function calc_match($user,$set,$extra=2) {\n $results = array();\n foreach ($set as $s) {\n $sum = 0;\n $count = 0;\n if (isset($user['votes']) and count($user['votes']) > 0) {\n foreach($user['votes'] as $key => $uv) {\n //weight\n if (isset($user['weight']->$key) and $user['weight']->$key == \"true\") $w = $extra;\n else $w = 1;\n // echo \"w: \" . $w . \"<br/>\\n\";\n //existing divisions only:\n if ((property_exists($s,'votes')) and (property_exists($s->votes,$key))) {\n $sum = $sum + $w*$s->votes->$key*sign($uv);\n $count = $count + $w*abs(sign($uv));\n }\n else {\n $count = $count + abs(sign($uv));\n }\n }\n }\n if ($count == 0) $count = 1; // to allow match = 0/1 = 0;\n //read what data should go to result\n $res = array();\n foreach ($s as $key=>$item) {\n $res[$key] = $s->$key;\n }\n //common results for any calc\n $res['result'] = (1+$sum/$count)/2;\n $res['result_percent'] = round((100+100*$sum/$count)/2);\n $res['id'] = $s->id;\n $res['random'] = rand(0,1000000);\n $results[] = $res;\n }\n\n //sort by result\n foreach ($results as $key => $row) {\n $result[$key] = $row['result'];\n $random[$key] = $row['random'];\n }\n array_multisort($result, SORT_DESC, $random, SORT_ASC, $results);\n\n return $results;\n}",
"function score()\n {\n access::ensure(\"scoring\");\n $achid = vsql::retr(\"SELECT id FROM achievements WHERE deleted = 0 AND \" . vsql::id_condition($_REQUEST[\"id\"], \"ground\"));\n insider_achievements::score(array_keys($achid));\n }",
"public function testSensitivityAnalysis()\n {\n }",
"public function testProjectScore(): void\n {\n /** @var User $user */\n $user = User::factory()->create();\n $this->be($user);\n /** @var Project $project */\n $project = Project::factory()->create();\n $this->assertEquals(0, $project->score);\n $this\n ->actingAs($user)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'pig']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'up']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0.5, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(-.25, $project->score);\n }",
"public function testUpdateScore()\n {\n\n $rank[1] = array('matchsWon' => 0, 'setsWon' => 0, 'setsLost' => 0, 'gamesWon' => 0, 'gamesLost' => 0, 'points' => 0);\n $rank[2] = array('matchsWon' => 0, 'setsWon' => 0, 'setsLost' => 0, 'gamesWon' => 0, 'gamesLost' => 0, 'points' => 0);\n\n $rankResult[1] = array('matchsWon' => 2, 'setsWon' => 5, 'setsLost' => 3, 'gamesWon' => 35, 'gamesLost' => 38, 'points' => 6);\n $rankResult[2] = array('matchsWon' => 1, 'setsWon' => 3, 'setsLost' => 5, 'gamesWon' => 38, 'gamesLost' => 35, 'points' => 3);\n\n $gameService = new GameService();\n $gameService->setManager($this->em);\n $rank = $gameService->updateScore(\"6/3 2/6 7/5\", $rank, 1, 2);\n $rank = $gameService->updateScore(\"6/4 7/5\", $rank, 1, 2);\n $rank = $gameService->updateScore(\"0/6 6/3 1/6\", $rank, 1, 2);\n $this->assertEquals($rank, $rankResult);\n }",
"public static function game_score_returns() {\n return new external_value(PARAM_TEXT, 'Success or fail');\n }",
"function display_api_results($test_code){\n\n\t\t$api=new api();\n\t\t$curl_result=$api->connect_api($test_code);\n\t\t$i=0;\n\t\techo \"<pre>\";\n\t\t$size=sizeof($curl_result['report']['completed_test']);\n\t\tfor($i;$i<$size;$i++)\n\t\t\techo $i+1 .\". \" . $curl_result['report']['completed_test'][$i]['candidate_name'].\" & Score : \".$curl_result['report']['completed_test'][$i]['candidate_total_score'] .\"<br>\";\n\n}",
"public function testReviewCount()\n {\n\n }",
"function testPropertyScoring() {\n\t\t$analyze = new DocBlockAnalyzer();\n\t\t$reflection = new ClassDocumentor('TestSubjectOne');\n\t\t$result = $analyze->analyze($reflection);\n\n\t\t$this->assertEqual($result['properties'][1]['subject'], 'hasDoc');\n\t\t$this->assertEqual($result['properties'][1]['scores'][0]['rule'], 'MissingLink');\n\t\t$this->assertEqual($result['properties'][1]['totalScore'], 0.75);\n\t}",
"function test_the_post_score_is_calculated_correctly(){\n // creamos un post de forma directa de cualquier usuario\n Vote::create([\n 'post_id' => $this->post->id,\n 'user_id' => $this->anyone()->id,\n 'vote' => 1\n ]);\n\n // registramos un voto con le usuario conectado\n // Vote::upvote($this->post);\n // cargamos el repositorio para crear un voto\n // app(voteRepository::class)->upvote($this->post);\n $this->post->upvote();\n\n $this->assertSame(2, Vote::count());\n\n // agregamos una nueva columna de score al modelo de post el cual despues de llamar al metodo\n // upvote una sola vez deberia ser igual a \"1\"\n $this->assertSame(2, $this->post->score);\n }",
"public function testGetResults()\n {\n $is_array = is_array($this->calc->getResults());\n $this->assertTrue($is_array);\n }",
"function getScore()\n {\n return $this->score;\n }",
"public function getScore ()\r\n {\r\n return $this->score;\r\n }",
"public function getScore(){\n\t\t$base = 30; //Ben's request\n\t\t/*$passes = $this->printJob == null ? 0 : $this->printJob->PASS;\n\t\t$lines = 0; //for quantity of all lines\n\t\tforeach($this->jobLines as $line) {\n\t\t\t$lines += $line->QUANTITY;\n\t\t}*/\n\t\treturn $base + $this->totalPasses;\n\t}",
"public function display_results() {\n\n \techo \"\\n\\n############# Test Results #################\\n\\n\";\n\n foreach ($this->test_results as $key => $value) {\n\n echo \"********************************************\\n\";\n echo \"Results for URL: \" . $key . \" \\n\";\n echo \"--------------------------------------------\\n\\n\";\n\n echo \"The URL was requested \" . count($this->test_results[$key]) . \" time(s).\\n\";\n $average_request_time = 0.0;\n $request_fail_count = 0;\n foreach ($value as $k1 => $v1) {\n \t$average_request_time += (float)$v1['time'];\n \t$status = (int)$v1['status'];\n \tif ($status >= 400) {\n \t $request_fail_count += 1;\n \t}\n }\n echo \"The average response time is: \" . ($average_request_time / count($this->test_results[$key])) . \"\\n\";\n echo \"The request failed \" . $request_fail_count . \" time(s).\\n\";\n echo \"\\n\\n\";\n }\n \n }",
"function runTests() {\n $this->resetStats();\n\n foreach ($this->_tests_to_run as $testClass) {\n\n $test = new $testClass();\n\n /* @var $test Zend_Environment_Security_Test */\n\n if ($test->isTestable()) {\n $test->test();\n\n $rs = array('name' => $test->getTestName(),\n 'group' => $test->getTestGroup(),\n 'result_code' => $test->getResult(),\n 'result' => $this->_getResultAsString($test->getResult()),\n 'details' => $test->getMessage(),\n 'current_value' => $test->getCurrentTestValue(),\n 'recommended_value' => $test->getRecommendedTestValue(),\n 'link' => $test->getMoreInfoURL(),\n );\n $sec_field = new Zend_Environment_Security_Field($rs);\n\n //$this->_test_results[] = $sec_field;\n\n // initialize if not yet set\n if (!isset ($this->_result_counts[$sec_field->result]) ) {\n $this->_result_counts[$sec_field->result] = 0;\n }\n $this->_result_counts[$sec_field->result]++;\n $this->_num_tests_run++;\n } else {\n $rs = array('name' => $test->getTestName(),\n 'group' => $test->getTestGroup(),\n 'result_code' => $test->getResult(),\n 'result' => $this->_getResultAsString($test->getResult()),\n 'details' => $test->getMessage(),\n 'current_value' => $test->getCurrentTestValue(),\n 'recommended_value' => $test->getRecommendedTestValue(),\n 'link' => $test->getMoreInfoURL(),\n );\n $sec_field = new Zend_Environment_Security_Field($rs);\n\n // initialize if not yet set\n if (!isset ($this->_result_counts[Zend_Environment_Security_Test::RESULT_NOTRUN]) ) {\n $this->_result_counts[Zend_Environment_Security_Test::RESULT_NOTRUN] = 0;\n }\n $this->_result_counts[Zend_Environment_Security_Test::RESULT_NOTRUN]++;\n $this->_tests_not_run[] = $sec_field;\n }\n\n $this->{$sec_field->group.\"__\".$sec_field->name} = $sec_field;\n }\n }",
"public function testResult()\n {\n // /TestResult\n }",
"public function testMakeDecisionReturnSave()\n {\n $computer = new ComputerPlayer();\n $computer->addScore(90); \n\n for ($i = 0; $i <= 100; $i++) {\n $computer->dices->roll();\n \n $rolls = $computer->dices->getHistogramSerie();\n $roundPoints = array_sum($rolls);\n\n\n if ($roundPoints > 100) {\n $this->assertEquals(\"save\", $computer->makeDecision());\n }\n\n if ($computer->getscore() + $roundPoints >= 100) {\n $this->assertEquals(\"save\", $computer->makeDecision());\n }\n }\n }"
] | [
"0.6795603",
"0.6516051",
"0.6495078",
"0.6352568",
"0.62750185",
"0.6247357",
"0.61584115",
"0.61296254",
"0.61162686",
"0.61154467",
"0.6112143",
"0.61098933",
"0.61040944",
"0.60468495",
"0.6018754",
"0.60120857",
"0.600904",
"0.59201634",
"0.5883923",
"0.58756685",
"0.5867669",
"0.58606374",
"0.5853591",
"0.58444357",
"0.5815076",
"0.5812294",
"0.58109725",
"0.580752",
"0.5805462",
"0.5792466"
] | 0.6939785 | 0 |
test property scoring results. | function testPropertyScoring() {
$analyze = new DocBlockAnalyzer();
$reflection = new ClassDocumentor('TestSubjectOne');
$result = $analyze->analyze($reflection);
$this->assertEqual($result['properties'][1]['subject'], 'hasDoc');
$this->assertEqual($result['properties'][1]['scores'][0]['rule'], 'MissingLink');
$this->assertEqual($result['properties'][1]['totalScore'], 0.75);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getScore();",
"function test_the_post_score_is_calculated_correctly(){\n // creamos un post de forma directa de cualquier usuario\n Vote::create([\n 'post_id' => $this->post->id,\n 'user_id' => $this->anyone()->id,\n 'vote' => 1\n ]);\n\n // registramos un voto con le usuario conectado\n // Vote::upvote($this->post);\n // cargamos el repositorio para crear un voto\n // app(voteRepository::class)->upvote($this->post);\n $this->post->upvote();\n\n $this->assertSame(2, Vote::count());\n\n // agregamos una nueva columna de score al modelo de post el cual despues de llamar al metodo\n // upvote una sola vez deberia ser igual a \"1\"\n $this->assertSame(2, $this->post->score);\n }",
"public function testWithTermThatHasMultipleResults()\n {\n $this->fixture->config->id = 'spotif';\n $this->fixture->config->key = 'averageUserRating';\n $result = $this->fixture->run();\n // validate result\n $this->assertInternalType('float', $result);\n $this->assertGreaterThanOrEqual(0.5, $result);\n }",
"public function getResults() {\n\t\treturn $this->correct;\n\t}",
"public function testProjectScore(): void\n {\n /** @var User $user */\n $user = User::factory()->create();\n $this->be($user);\n /** @var Project $project */\n $project = Project::factory()->create();\n $this->assertEquals(0, $project->score);\n $this\n ->actingAs($user)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'pig']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'up']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(0.5, $project->score);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var User $otherUser */\n $otherUser = User::factory()->create();\n $this\n ->actingAs($otherUser)\n ->call('post', '/votes', ['project_id' => $project->id, 'type' => 'down']);\n /** @var Project $project */\n $project = Project::find($project->id);\n $this->assertEquals(-.25, $project->score);\n }",
"function testMethodScoring() {\n\t\t$analyze = new DocBlockAnalyzer();\n\t\t$reflection = new ClassDocumentor('TestSubjectOne');\n\t\t$result = $analyze->analyze($reflection);\n\t\t\n\t\t$this->assertEqual($result['methods'][0]['subject'], 'hasNoDocs');\n\t\t$this->assertEqual($result['methods'][0]['scores'][0]['rule'], 'MissingLink');\n\t\t$this->assertEqual($result['methods'][0]['scores'][1]['rule'], 'Empty');\n\t\t$this->assertEqual($result['methods'][0]['scores'][2]['rule'], 'IncompleteTags');\n\t\t$this->assertEqual($result['methods'][0]['totalScore'], 0.25);\n\t}",
"public function score(){\n\t\treturn $this->score;\n\t}",
"function getScore()\n {\n return $this->score;\n }",
"function getTotalScore(){\n\t\treturn $this->quizcreator_score + $this->quiztaker_score;\n\t}",
"public function getScore(){\n $score = 0;\n \n if($this->_search_run){\n foreach($this->getFoundTotals() as $group => $count){\n $value = $this->_search_groups[$group];\n $score += $value * $count;\n }\n }\n\n return $score;\n }",
"public function getScore ()\r\n {\r\n return $this->score;\r\n }",
"public function testRoundScore()\n {\n $player = new Player(\"Jimmy\");\n\n $this->assertEquals($player->roundScore(), 0);\n $this->assertEmpty($player->values());\n $player->roll();\n $this->assertNotEmpty($player->values());\n $player->addToRoundScore($player->sum());\n $this->assertNotEquals($player->roundScore(), 0);\n $player->emptyRoundScore();\n $this->assertEquals($player->roundScore(), 0);\n }",
"public function getTestRandomMonitorPropertyForPromethues()\n {\n // login\n $response = self::$client->post('/user/login', array(\n 'login' => 'test',\n 'password' => 'test'\n ));\n $this->assertResponseStatusCode($response, 200, 'Fail to login');\n\n $response = self::$client->get('/monitor/tags/test/metrics/random', array(\n '_px_format' => 'text/prometheus'\n ));\n $this->assertResponseNotNull($response, 'Find result is empty');\n }",
"public function testRoundSetScore()\n {\n $player = new Player();\n $diceRound = new DiceRound($player, 10);\n\n $diceRound->setRoundScore(10);\n $res = $diceRound->getRoundScore();\n $exp = 20;\n $this->assertEquals($exp, $res);\n }",
"public function getScore() { return $this->_score; }",
"public function getScore()\n {\n return $this->_score;\n }",
"public function getScore() {\n return $this->score;\n }",
"public function testZScore() {\n\t\t\t$client = $this->connect();\t\n\t\t\t$client->DEL('set');\n\t\t\t$client->ZADD('set', 1, 'a');\n\t\t\t$client->ZADD('set', 2, 'b');\n\t\t\t$client->ZADD('set', 3, 'c');\n\t\t\t$this->assertEquals(1, $client->ZSCORE('set', 'a'));\n\t\t}",
"public function testScores($items, $expected) {\n\t\t$this->Player->score($items[0], $items[1]);\n\t\t$output = $this->Player->goalCount();\n\t\t$this->assertEquals(\n\t\t\t$expected,\n\t\t\t$output,\n\t\t\t\"The player should have {$expected} goals\"\n\t\t);\n\t}",
"public function testGenerateResults()\n {\n $data = file_get_contents('./fixtures/games-24.txt');\n $testGames = unserialize($data);\n $data = file_get_contents('./fixtures/franchises.txt');\n $testFranchises = unserialize($data);\n\n // We don't need to pass in a DB connection if we're not using the DB\n $mapper = new \\IBL\\GameMapper();\n $testResults = $mapper->generateResults($testGames, $testFranchises);\n $testResult = $testResults['MAD'];\n $expectedResult = array(\n 'homeTeam' => 'MAD',\n 'awayTeam' => 'BOW',\n 'awayScores' => array(4, 5, 2),\n 'homeScores' => array(3, 6, 3)\n );\n $this->assertEquals($expectedResult, $testResult);\n }",
"protected function calculatePercentage() {\n\t\t$this->percentage = $this->score->getRightAnswers() \n\t\t\t\t\t\t\t\t/ $this->score->getPlayedQuestions();\t\n\t}",
"public function admin_evaluate_score() {\n $this->autoRender = false;\n if ($this->request->is('ajax')) {\n $resultId = $this->params['url']['resultId'];\n $questionNo = $this->params['url']['questionNo'];\n $scoreNo = $this->params['url']['score'];\n \n $result = $this->Result->find('first', array('conditions' => array('Result.id' => $resultId)));\n \n $questionIds = explode(',', $result['Result']['question_ids']);\n $scores = explode(',', $result['Result']['individual_score']);\n $scores[$questionNo] = $scoreNo;\n $questionScores = array();\n $correctScore = 1;\n $incorrectScore = 0;\n $marks = 0;\n $valuation = 0;\n $percentage = 0;\n\n foreach ($scores as $score) {\n\n switch($score) {\n case 1:\n $marks += $correctScore;\n break;\n case 2: \n $marks += $incorrectScore;\n break;\n case 3:\n $valuation = 1;\n }\n }\n\n $percentage = ($marks/$result['Quiz']['no_of_questions']) * 100;\n if ($percentage <= $result['Quiz']['pass_percentage']) {\n $status = 'Fail';\n } else if ($valuation == 1) {\n $status = 'Pending';\n } else {\n $status = 'Pass';\n }\n\n $data = array(\n 'individual_score' => implode(',', $scores),\n 'score' => $marks,\n 'percentage' => $percentage,\n 'manual_valuation' => $valuation,\n 'status' => $status\n );\n \n $this->Result->id = $resultId;\n \n if ($this->Result->save($data)) {\n \n $this->Question->id = $questionIds[$questionNo];\n \n switch ($scoreNo) {\n case 1:\n $this->Question->saveField('times_corrected', (int)$this->Question->field('times_corrected') + 1);\n break;\n case 2:\n $this->Question->saveField('times_incorrected', (int)$this->Question->field('times_incorrected') + 1);\n break;\n }\n\n $this->Session->setFlash(__d('croogo', 'Succefully Submitted'), 'default', array('class' => 'success'));\n switch ($status) {\n case 'Pass':\n $this->sendEmail($resultId);\n break;\n }\n return true;\n } else {\n $this->Session->setFlash(__d('croogo', 'Error Occoured!'), 'default', array('class' => 'error'));\n return false;\n }\n } \n }",
"public function testGetResults()\n {\n $is_array = is_array($this->calc->getResults());\n $this->assertTrue($is_array);\n }",
"function calc_match($user,$set,$extra=2) {\n $results = array();\n foreach ($set as $s) {\n $sum = 0;\n $count = 0;\n if (isset($user['votes']) and count($user['votes']) > 0) {\n foreach($user['votes'] as $key => $uv) {\n //weight\n if (isset($user['weight']->$key) and $user['weight']->$key == \"true\") $w = $extra;\n else $w = 1;\n // echo \"w: \" . $w . \"<br/>\\n\";\n //existing divisions only:\n if ((property_exists($s,'votes')) and (property_exists($s->votes,$key))) {\n $sum = $sum + $w*$s->votes->$key*sign($uv);\n $count = $count + $w*abs(sign($uv));\n }\n else {\n $count = $count + abs(sign($uv));\n }\n }\n }\n if ($count == 0) $count = 1; // to allow match = 0/1 = 0;\n //read what data should go to result\n $res = array();\n foreach ($s as $key=>$item) {\n $res[$key] = $s->$key;\n }\n //common results for any calc\n $res['result'] = (1+$sum/$count)/2;\n $res['result_percent'] = round((100+100*$sum/$count)/2);\n $res['id'] = $s->id;\n $res['random'] = rand(0,1000000);\n $results[] = $res;\n }\n\n //sort by result\n foreach ($results as $key => $row) {\n $result[$key] = $row['result'];\n $random[$key] = $row['random'];\n }\n array_multisort($result, SORT_DESC, $random, SORT_ASC, $results);\n\n return $results;\n}",
"function score()\n {\n access::ensure(\"scoring\");\n $achid = vsql::retr(\"SELECT id FROM achievements WHERE deleted = 0 AND \" . vsql::id_condition($_REQUEST[\"id\"], \"ground\"));\n insider_achievements::score(array_keys($achid));\n }",
"public function testSensitivityAnalysis()\n {\n }",
"function results() {\r\n\t\t$this->validate();\r\n\t\t$this->advancedResults();\r\n\t}",
"public function getScore()\n {\n return $this->score;\n }",
"public function getScore()\n {\n return $this->score;\n }",
"public function getScore()\n {\n return $this->score;\n }"
] | [
"0.61557066",
"0.5951078",
"0.5916178",
"0.58957165",
"0.58818793",
"0.58642924",
"0.5837631",
"0.57115465",
"0.57010543",
"0.5700344",
"0.56956464",
"0.5690224",
"0.5672511",
"0.5664637",
"0.56606317",
"0.5564976",
"0.55567694",
"0.5550493",
"0.55431056",
"0.552969",
"0.5514342",
"0.5490827",
"0.5470496",
"0.5468518",
"0.54400384",
"0.5435513",
"0.54232824",
"0.54146844",
"0.54146844",
"0.54146844"
] | 0.7549764 | 0 |
/ Function : SetOverdueType Set an overdue type to invoices if the invoice is overdue! Input : Returns : | Function SetOverdueTypes() {
global $db_iwex;
$str_date_now = date("Y-m-d");
$sql_invoices = SQL_INVOICES_PAYMENT;
$sql_invoices .= " WHERE not paid_yn AND overduetypeID != 99 AND DispuutID != '" . DB_INVOICE_OVERDUE_DISPUUT . "'
OR (paid_yn AND overduetypeID)";
$str_results = $db_iwex->query($sql_invoices);
$ary_update_events = array();
$ary_update_events_num = array();
while ($objshipment = mysql_fetch_object($str_results)) {
$int_dispuut_days = 0;
$ary_dispuut_calls = array();
$str_dispuut_end_time = "";
$str_dispuut_begin_time = "";
// Get the last inserted type
$lastoptie_result = $db_iwex->query("SELECT DispuutID, overduetypeID
FROM invoices
WHERE invoiceID = '$objshipment->InvoiceID'");
$obj_lastoptie = mysql_fetch_object($lastoptie_result);
$int_lasttypeid = isset($obj_lastoptie->overduetypeID) ? $obj_lastoptie->overduetypeID : FALSE;
$int_lastdispuutid = isset($obj_lastoptie->DispuutID) ? $obj_lastoptie->DispuutID : FALSE;
// Check overdue type end date and begin date if there is an overdue end type.
// First we get the history from the database table invoices_call and calls.
// because it is orderd by callID we will get first the "end dispuut" than "dispuut status" and than "no dispuut".
if ($int_lastdispuutid == DB_INVOICE_OVERDUE_END_DISPUUT) {
$dispuut_result = $db_iwex->query("SELECT invoices_call.callID, CallDate, DispuutID FROM invoices_call
LEFT JOIN calls ON invoices_call.callID = calls.callID
WHERE invoiceID = '". $objshipment->InvoiceID . "'
ORDER BY callID desc");
// First we set the numbers of dispuut history calls to zero. Than we loop the results from the database.
while ($obj_dispuut_time = mysql_fetch_object($dispuut_result)) {
// Now if the dispuutID is an end dispuut we set the dispuut_end_time.
// And because it will only set if it's not set it can not be overwrited if there is an another dispuut end ID.
if ($obj_dispuut_time->DispuutID == DB_INVOICE_OVERDUE_END_DISPUUT) {
$str_dispuut_end_time = $obj_dispuut_time->CallDate;
// This if will alwase be skiped the first time because the dispuut status will be set in the array $ary_dispuut_calls.
// So to get the first beginning dispuut date we need the last inserted time into the array.
} else if ($obj_dispuut_time->DispuutID == DB_INVOICE_OVERDUE_NEW_DISPUUT) {
$str_dispuut_begin_time = $obj_dispuut_time->CallDate;
// If the status is dispuut we will set all the dipuut times into a array. the last one will be the begin time
}
// Get extra day's
if ($str_dispuut_begin_time && $str_dispuut_end_time) {
$int_dispuut_days = Getdays($str_dispuut_end_time, $str_dispuut_begin_time);
}
}
}
$int_overdue_days = $objshipment->dayslate - $int_dispuut_days;
if ($int_overdue_days > 0 && !$objshipment->paid_yn && $objshipment->amount > 0) {
$int_update_events = FALSE;
// check to see what option must be set
if ($int_overdue_days >= FIRST_MAIL_OVERDUE_DAYS && $int_overdue_days < SECOND_MAIL_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_FIRST_MAIL;
$int_update_events = 5;
} else if ($int_overdue_days >= SECOND_MAIL_OVERDUE_DAYS && $int_overdue_days < TELEPHONE_CALL_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_SECOND_MAIL;
$int_update_event = 6;
} else if ($int_overdue_days >= TELEPHONE_CALL_OVERDUE_DAYS && $int_overdue_days < FAX_OR_LETTER_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_TELEPHONE_CALL;
$int_update_event = 7;
} else if ($int_overdue_days >= FAX_OR_LETTER_OVERDUE_DAYS && $int_overdue_days < SIGNATURE_LETTER_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_FAX_OR_LETTER;
$int_update_event = 8;
} else if ($int_overdue_days >= SIGNATURE_LETTER_OVERDUE_DAYS && $int_overdue_days <= BAILIFF_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_SIGNATURE_LETTER;
$int_update_event = 9;
} else if ($int_overdue_days > BAILIFF_OVERDUE_DAYS) {
$str_type = DB_INVOICE_OVERDUE_BAILIFF;
$int_update_event = 10;
}
if ($str_type != $int_lasttypeid) {
$ary_update_events["$int_update_event"] = TRUE;
if ($ary_update_events_num["$int_update_event"] > 0) {
$ary_update_events_num["$int_update_event"]++;
} else {
$ary_update_events_num["$int_update_event"] = 1;
}
$db_iwex->query("UPDATE invoices SET overduetypeID = '$str_type'
WHERE InvoiceID = '" . $objshipment->InvoiceID . "'");
}
} else {
$db_iwex->query("UPDATE invoices SET overduetypeID = 0 WHERE InvoiceID = $objshipment->InvoiceID");
}
}
foreach ($ary_update_events AS $int_event_id => $bl_event_set) {
if ($bl_event_set) {
$result_event_desc = $db_iwex->query("SELECT id, title from events WHERE ID = '$int_event_id'");
$obj_event_desc = mysql_fetch_object($result_event_desc);
$db_iwex->free_result($result_event_desc);
$ary_event_desc = explode(" ", $obj_event_desc->title);
foreach ($ary_event_desc As $int_value => $str_event_desc_num) {
if(is_numeric($str_event_desc_num)) {
$int_number_value = $int_value;
}
}
$str_new_desc = str_replace($ary_event_desc[$int_number_value] ,$ary_event_desc[$int_number_value] + $ary_update_events_num["$int_event_id"], $obj_event_desc->title);
$db_iwex->query("UPDATE events SET title = '$str_new_desc', action_performed_date = '$str_date_now', action_done_by ='".DB_WEB_EMPLOYEE. "'
WHERE id = '" . $obj_event_desc->id . "'");
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function overdue()\n\t{\n\t\t$data = array();\n\t\t$this->activemenu \t\t\t= 'overdue';\n\t\t$data['title'] \t\t\t\t= $this->title;\n\t\t$data['activemenu'] \t\t= $this->activemenu;\n\t\t$data['overdue_invoices']\t= $this->invoice_model->overdue_invoices();\n\t\t$data['pagecontent'] \t\t= 'invoices/overdue_invoices';\n\t\t$this->load->view('common/holder', $data);\n\t}",
"public function setTypeDue($typeDue) {\n $this->typeDue = $typeDue;\n return $this;\n }",
"function overdue_invoices($id = null) {\r\n $this->layout = false;\r\n $invoice_due_date = date(\"Y-m-d H:i:s\");\r\n $conditions = array(\"Invoice.invoice_status\" => \"Invoices Awaiting Payment\", \"Invoice.invoice_due_date <\" => $invoice_due_date);\r\n $fields = array(\"Invoice.id\", \"Invoice.invoice_date\", \"Invoice.invoice_due_date\", \"Invoice.invoice_status\");\r\n $overdue_invoices = $this->Invoice->find(\"all\", array(\"conditions\" => $conditions, \"fields\" => $fields));\r\n $i = 0;\r\n foreach ($overdue_invoices as $overdue_invoice) {\r\n $this->data['Invoice'][$i]['id'] = $overdue_invoice['Invoice']['id'];\r\n $this->data['Invoice'][$i]['invoice_status'][$i] = \"Overdue Invoices\";\r\n $this->data['Invoice'][$i]['invoice_due_date'][$i] = date(\"Y-m-d H:i:s\", strtotime($overdue_invoice['Invoice']['invoice_date']) + (7 * 60 * 60));\r\n $i++;\r\n }\r\n $this->Invoice->saveAll($this->data['Invoice']);\r\n\r\n $this->autoRender = false;\r\n }",
"public function getInvoiceType();",
"function setDueOn($value) {\n return $this->setFieldValue('due_on', $value);\n }",
"public function setDueDate($dueDate);",
"public function getInvoiceType()\n {\n return $this->invoiceType;\n }",
"public function getInvoiceType()\n {\n return $this->invoiceType;\n }",
"public function set_bussines_type($p_bussines_type){\n\t\t$this->v_bussines_type = (int) $p_bussines_type;\n\t}",
"public function setInvoiceType($invoiceType)\n {\n $this->invoiceType = $invoiceType;\n\n return $this;\n }",
"public function setInvoiceType($invoiceType)\n {\n $this->invoiceType = $invoiceType;\n\n return $this;\n }",
"private function exceedStarted($exceedType) {\n\t\t$cerruntExceedEvent = new TaxibotExceedEvent ();\n\t\t$date = $this->GetDateTimeFromCsvFormat ( $this->_currentRowDateTime );\n\t\t$cerruntExceedEvent->setStartTime ( $date );\n\t\t$cerruntExceedEvent->setStartMilisecond($date->format('u'));\n\t\t$cerruntExceedEvent->setExceedType ( $exceedType );\n\t\t\t\t\n\t\tif ($exceedType == EXCEED_TYPE::FATIGUE_LONGITUDAL) {\n\t\t\t$this->_exceedEventFatigueLongitudal = $cerruntExceedEvent;\n\t\t} else if ($exceedType == EXCEED_TYPE::STATIC_LONGITUDAL) {\n\t\t\t$this->_exceedEventStaticLongitudal = $cerruntExceedEvent;\n\t\t} else if ($exceedType == EXCEED_TYPE::STATIC_LATERAL) {\n\t\t\t$this->_exceedEventStaticLateral = $cerruntExceedEvent;\n\t\t}\n\t\t\n\t\t/*\n\t\t * if ($exceedType == EXCEED_TYPE::FATIGUE_LONGITUDAL) { ++ $this->_exceedEventFatigueLongitudalNum; //$this->_exceedEventFatigueLongitudals [$this->_exceedEventFatigueLongitudalNum] = $cerruntExceedEvent; } else if ($exceedType == EXCEED_TYPE::STATIC_LATERAL) { ++ $this->_exceedEventStaticLateralNum; //$this->_exceedEventStaticLaterals [$this->_exceedEventStaticLateralNum] = $cerruntExceedEvent; } else if ($exceedType == EXCEED_TYPE::STATIC_LONGITUDAL) { ++ $this->_exceedEventStaticLongitudalNum; //$this->_exceedEventStaticLongitudals [$this->_exceedEventStaticLongitudalNum] = $cerruntExceedEvent; }\n\t\t */\n\t\t\n\t\t// $test = $cerruntExceedEvent->getExceedType();echo \"exceedStarted TEST = $test<br/>\"; //DEBUG\n\t}",
"private function setDueDate($invoice)\n {\n if (!$invoice instanceof Invoice) {\n return;\n }\n\n $invoiceDate = $invoice->getInvoiceDate();\n $dueDate = clone $invoiceDate;\n $dueDate->add(new \\DateInterval('P30D'));\n\n $invoice->setDueDate($dueDate);\n }",
"public function setOpenType($type)\n {\n $this->openType = $type;\n }",
"public function setType($type){\r\n if (($type === Payment::CASH) || ($type === Payment::CREDIT_CARD) || ($type === Payment::REFUND)){\r\n $this->type = $type;\r\n }\r\n else{\r\n throw new Exception(\"Type is invalid\");\r\n }\r\n }",
"public function canWriteOffInvoice()\n {\n // Arrange\n $invoiceList = Ezypay::getInvoices(false, null, null, 'PAST_DUE', null, null, 1);\n\n // Act\n $invoice = Ezypay::writeOffAnInvoice($invoiceList['data'][0]['id']);\n\n // Assert\n $this->assertEquals($invoiceList['data'][0]['id'], $invoice['id']);\n $this->assertTrue(array_key_exists('id', $invoice));\n $this->assertEquals('WRITTEN_OFF', $invoice['status']);\n }",
"public function getTypeDue() {\n return $this->typeDue;\n }",
"function increase_due() {\n \n }",
"function auditlocking_invoices($type)\n{\n\tlog_debug(\"auditlocking\", \"Executing auditlocking_invoices($type)\");\n\n\t// fetch number of days to perform locking for\n\t$lockdays = sql_get_singlevalue(\"SELECT value FROM config WHERE name='ACCOUNTS_INVOICE_LOCK'\");\n\n\tif ($lockdays)\n\t{\n\t\t// fetch all fully paid, unlocked invoices\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id, code_invoice FROM account_$type WHERE amount_total=amount_paid AND locked='0'\";\n\t\t$sql_obj->execute();\n\n\t\tif ($sql_obj->num_rows())\n\t\t{\n\t\t\t$sql_obj->fetch_array();\n\n\t\t\tforeach ($sql_obj->data as $data_invoice)\n\t\t\t{\n\t\t\t\t// hold the highest payment timestamp here - we then run through all the payment items to find the one with the most recent date.\n\t\t\t\t$timestamp = 0;\n\t\t\t\t\n\t\t\t\t// fetch all the payment items for this invoice\n\t\t\t\t$sql_item_obj\t\t= New sql_query;\n\t\t\t\t$sql_item_obj->string\t= \"SELECT id FROM account_items WHERE invoiceid='\". $data_invoice .\"' AND invoicetype='$type' AND type='payment'\";\n\t\t\t\t$sql_item_obj->execute();\n\t\t\t\t\n\t\t\t\tif ($sql_item_obj->num_rows())\n\t\t\t\t{\n\t\t\t\t\t$sql_item_obj->fetch_array();\n\n\t\t\t\t\tforeach ($sql_item_obj->data as $data_item)\n\t\t\t\t\t{\n\t\t\t\t\t\t// fetch only the latest payment date\n\t\t\t\t\t\t$sql_date_obj\t\t= New sql_query;\n\t\t\t\t\t\t$sql_date_obj->string\t= \"SELECT option_value FROM account_items_options WHERE option_name='DATE_TRANS' AND itemid='\". $data_item[\"id\"] .\"' ORDER BY option_value DESC LIMIT 1\";\n\t\t\t\t\t\t$sql_date_obj->execute();\n\t\t\t\t\t\t$sql_date_obj->fetch_array();\n\n\t\t\t\t\t\t// convert date to timestamp\n\t\t\t\t\t\t$timestamp_tmp = time_date_to_timestamp($data_date[\"option_value\"]);\n\t\t\t\t\t\n\t\t\t\t\t\tif ($timestamp_tmp > $timestamp)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$timestamp = $timestamp_tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// if the date is older than (today - ACCOUNTS_INVOICE_LOCK), then lock the invoice\n\t\t\t\tif ((mktime() - (86400 * $lockdays)) > $timestamp)\n\t\t\t\t{\n\t\t\t\t\t// lock invoice\n\t\t\t\t\tprint \"Locked $type invoice \". $data_invoice[\"code_invoice\"] .\"\\n\";\n\t\t\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t\t\t$sql_obj->string\t= \"UPDATE account_$type SET locked='1' WHERE id='\". $data_invoice[\"id\"] .\"' LIMIT 1\";\n\t\t\t\t\t$sql_obj->execute();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} // end of loop through invoices\n\t\t\n\t} // end of lockdays\n\n}",
"public function setOppoType($value)\r\n {\r\n return $this->set(self::_OPPO_TYPE, $value);\r\n }",
"public function setEmploymentType($value)\n {\n $this->employmentType = $value;\n }",
"public function set_type ($type) {}",
"protected function set_type() {\n\t\t$this->type = 'kirki-date';\n\t}",
"public function setInvoiceDate($invoiceDate);",
"public function makeInvoiceItemName($object, $type)\n {\n if ($type == 'payment') {\n if ($object['subject'] == '維修費') {\n return '管理服務費(維修費)';\n } elseif ($object['subject'] == '電費') {\n return '管理服務費(代收電費)';\n } elseif ($object['subject'] == '水雜費') {\n return '管理服務費(代收水費)';\n } elseif ($object['subject'] == '設備扣款') {\n return '違約金';\n } elseif ($object['subject'] == '清潔費(公司)') {\n return '管理服務費(預收清潔費)';\n } elseif (\n in_array($object['subject'], ['轉房費', '換約費', '滯納金'])\n ) {\n return '行政手續費';\n } elseif (\n in_array($object['subject'], [\n '管理服務費',\n '服務費',\n '垃圾費',\n '車馬費',\n '第四台',\n '鑰匙費',\n '磁扣費',\n '聲請費'\n ])\n ) {\n return '管理服務費';\n } else {\n return '管理服務費(查無對應科目)';\n }\n }\n else if($type == 'pay_off'){\n if ($object['subject'] == '沒收押金') {\n return '違約金';\n }\n else if( $object['subject'] == '電費' ){\n return '管理服務費(代收電費)';\n }\n else if( $object['subject'] == '水費' ){\n return '管理服務費(代收水費)';\n }\n else if( $object['subject'] == '遲繳扣款' ){\n return '行政手續費';\n }\n else if( $object['subject'] == '設備扣款' ){\n return '違約金';\n }\n else if( $object['subject'] == '維修費' ){\n return '管理服務費(維修費)';\n }\n else {\n return '管理服務費';\n }\n }\n }",
"function updateType($objectType) {\n\t\tthrow new CmisNotImplementedException(\"updateType\");\n\t}",
"public function setFixType($type);",
"public function setTipoEvento($iTipoEvento){\n \n $this->iTipoEvento = $iTipoEvento;\n }",
"public function tax_report_invoice_wise()\n\t{\n\t\tif ($this->session->userdata('user_type') == '2') {\n $this->session->set_userdata(array('error_message'=>display('you_are_not_access_this_part')));\n redirect('Admin_dashboard');\n }\n\t\t\n\t\t$this->auth->check_admin_auth();\n\t\t$from_date = $this->input->post('from_date');\n\t\t$to_date = $this->input->post('to_date');\n\n\t\t$content = $this->lreport->tax_report_invoice_wise($from_date,$to_date);\n\t\t$this->template->full_admin_html_view($content);\n\t}",
"protected function set_type($type) {\n\t\t/*\n\t\t$this->valid_types = array('tesauro','toponimia','lenguaje','all');\t\t\n\t\tif( !in_array($type, $this->valid_types) && $type<1 ) die(__METHOD__.\" Tesauro Error: type not valid! [<b>$type</b>] <br> Use a valid type to access.\");\n\t\t*/\n\t\t$this->type = $type;\t\t\n\t}"
] | [
"0.5747477",
"0.5651747",
"0.5644637",
"0.5248365",
"0.51008135",
"0.5058872",
"0.50298494",
"0.50298494",
"0.4916106",
"0.4913224",
"0.4913224",
"0.49053827",
"0.48624027",
"0.48623008",
"0.4856333",
"0.4856006",
"0.48466176",
"0.4822418",
"0.4791252",
"0.47788912",
"0.47679183",
"0.47040182",
"0.46893346",
"0.46245706",
"0.4621966",
"0.46012762",
"0.4587383",
"0.45757583",
"0.45498258",
"0.45420146"
] | 0.69622374 | 0 |
Return the autonumber configuration array for this model. | public function getAutoNumberOptions()
{
return [
'reference_no' => [
'format' => 'BL/'.date('Y').'-'.date('m').'/?', // Format kode yang akan digunakan.
'length' => 5 // Jumlah digit yang akan digunakan sebagai nomor urut
]
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAutoNumberOptions()\n {\n return [\n 'no_kredit_disetujui' => [\n 'format' => function () {\n return 'KD/' . date('Ymd') . '/?';\n },\n 'length' => 3\n ]\n ];\n }",
"public function getAutoNumberOptions()\n {\n return [\n 'no_surat' => [\n 'format' => function () {\n return '?/DC-KT/X/' . date('Y');\n },\n 'length' => 3\n ]\n ];\n }",
"public function defineProperties() {\n return [\n 'order_id' => [\n 'title' => 'Order ID',\n 'description' => 'ID of the order',\n 'default' => 0,\n 'validationPattern' => '^[0-9]+$',\n 'validationMessage' => 'Enter a valid number'\n ]\n ];\n }",
"public function getAutoIdsAttribute()\n {\n return $this->autos()->get()->pluck('id')->toArray();\n }",
"public function get_array() {\n return $this->config;\n }",
"public static function getAutoincrementFields() {\n\t\treturn self::$AUTOINCREMENT_FIELDS;\n\t}",
"public function getConfigList()\n {\n $configArray = array();\n $configArray['columns'][0]['alias'] = 'td.noTipoDocumento';\n $configArray['columns'][1]['alias'] = 'd.txValor';\n\n return $configArray;\n }",
"protected function getIdAttributes()\n {\n return [\n '/config/section' => 'name',\n '/config/section/group' => 'name',\n '/config/section/group/item' => 'name',\n '/config/section/group/item/renderer' => 'name',\n '/config/order/available_product_type' => 'name',\n ];\n }",
"public function config()\n {\n return $this->map(function ($field, $key) {\n return [$key => $field['namespace']];\n })\n ->collapse()\n ->all();\n }",
"public function toArray()\n {\n return [\n \"id\" => $this->id,\n \"property_id\" => $this->property_id,\n \"native_coa_id\" => $this->native_coa_id,\n \"nativeCoa\" => $this->nativeCoaFull->toArray(),\n\n \"created_at\" => $this->perhaps_format_date($this->created_at),\n \"updated_at\" => $this->perhaps_format_date($this->updated_at),\n\n \"model_name\" => self::class,\n ];\n }",
"final public function get_config() {\n\t\treturn [\n\t\t\t'post_prefix' => $this->post_prefix,\n\t\t\t'chunk_size' => $this->chunk_size,\n\t\t\t'max_filesize' => $this->max_filesize,\n\t\t];\n\t}",
"public function getHydratorConfig(): array;",
"public function getUserConfig()\n\t{\n\t\treturn array(\n\t\t\tGDT_UInt::make('likes')->initial('0'),\n\t\t);\n\t}",
"public function getDefaultConfigurationArray(): array;",
"public function toArray()\n {\n return [\n 'id' => $this->id,\n 'key' => $this->key,\n 'secret' => $this->secret,\n 'maxConnections' => $this->maxConnections,\n 'enableStats' => $this->enableStats,\n 'enableClientMessages' => $this->enableClientMessages,\n 'maxBackendEventsPerMinute' => $this->maxBackendEventsPerMinute,\n 'maxClientEventsPerMinute' => $this->maxClientEventsPerMinute,\n 'maxReadRequestsPerMinute' => $this->maxReadRequestsPerMinute,\n ];\n }",
"public function toArray()\n\t{\n\t\treturn array(\n\t\t\t'id' => $this->getId(),\n\t\t\t'code' => $this->getCode(),\n\t\t\t'enabled' => (int) $this->getEnabled(),\n\t\t\t'can_be_user_disabled' => (int) $this->getCanBeUserDisabled(),\n\t\t);\n\t}",
"public function getAutoFields(): array\n {\n return $this->autoFields;\n }",
"protected function _initial_config()\n {\n return array();\n }",
"public function getConfiguration()\n {\n return array(\n 'key' \t\t\t=> $this->key,\n 'init_vector' => $this->initVector,\n 'padding' \t\t=> $this->padding,\n 'mode' \t\t\t=> $this->mode,\n 'encryption'\t=> $this->encryption . ' Bit',\n 'block_size'\t=> $this->block_size,\n );\n }",
"public function getBillingAddressConfigArray()\n {\n return json_decode(\n $this->scopeConfig->getValue(\n self::BILLING_ADDRESS_GRID,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n ),\n true\n );\n }",
"public function toArray()\n {\n return [\n 'app_id' => $this->appId,\n 'peak_connections_count' => $this->peakConnectionsCount,\n 'websocket_messages_count' => $this->webSocketMessagesCount,\n 'api_messages_count' => $this->apiMessagesCount,\n ];\n }",
"public function getValuesArray() {\n return $this->config;\n }",
"public function definition()\n {\n return [\n //\n 'brand_id'=>1,\n 'assigned_id'=>1,\n 'lead_owner'=> 1,\n 'user_id'=>1,\n 'title'=> Str::random(10),\n 'company'=>Str::random(10),\n 'firstname' => Str::random(10),\n 'lastname'=>Str::random(10),\n 'email' => Str::random(10).'@gmail.com',\n 'mobile'=> Str::random(10),\n 'website' => 'www'.Str::random(5).'.com',\n 'lead_source' => 'Advertisement',\n 'lead_status'=> 'Pre-Qualified',\n 'Industry'=>'ASP(Application Service Provider)',\n 'total_employees'=>10,\n 'annual_revenue'=>1000,\n 'ratings'=>'Active',\n 'skype_id'=>'',\n 'twitter'=>'@Test_twitter',\n 'secondary_email'=>'',\n 'street'=>Str::random(3).' Street',\n 'city'=>Str::random(3).' City',\n 'state'=>Str::random(2),\n 'zip_code'=>'12345',\n 'country'=>'Pakistan',\n 'description'=>Str::random(10),\n 'image'=>'leads/dummy_image.png',\n\n ];\n }",
"public function config(): array;",
"public function configuration(): array\n {\n return [\n 'settings' => $this->settings(),\n 'mappings' => $this->mapping(),\n 'aliases' => $this->aliases(),\n ];\n }",
"public function getConfig()\n {\n return [\n 'controller_plugins' => [\n 'aliases' => [\n 'identity' => Identity::class,\n 'Identity' => Identity::class,\n 'Zend\\Mvc\\Controller\\Plugin\\Identity' => Identity::class,\n ],\n 'factories' => [\n Identity::class => IdentityFactory::class,\n ],\n ],\n ];\n }",
"public function toArray(): array\n {\n return [\n \"id\" => $this->id,\n \"native_coa_id\" => $this->native_coa_id,\n \"client_id\" => $this->client_id,\n \"native_account_type_name\" => $this->native_account_type_name,\n \"native_account_type_description\" => $this->native_account_type_description,\n \"display_name\" => $this->display_name,\n\n \"created_at\" => $this->perhaps_format_date($this->created_at),\n \"updated_at\" => $this->perhaps_format_date($this->updated_at),\n\n \"model_name\" => self::class,\n ];\n }",
"public function getAutoIncrement()\n {\n return $this->model()->getAutoIncrement();\n }",
"public function toArray()\n {\n return $this->_settings;\n }",
"public static function get_config_ids() {\n\t\t$configs = array();\n\t\tforeach ( self::$instances as $instance ) {\n\t\t\t$configs[] = $instance->id;\n\t\t}\n\t\treturn array_unique( $configs );\n\t}"
] | [
"0.6389719",
"0.6340704",
"0.60451794",
"0.6033975",
"0.5981074",
"0.5941256",
"0.58546185",
"0.5762333",
"0.57444996",
"0.5719374",
"0.5701924",
"0.5662049",
"0.5652999",
"0.5648367",
"0.56146693",
"0.5611206",
"0.5607755",
"0.5599481",
"0.5590567",
"0.55570155",
"0.5551297",
"0.5547434",
"0.55405337",
"0.55360645",
"0.5526624",
"0.55254215",
"0.54830354",
"0.5479277",
"0.5477631",
"0.5477208"
] | 0.70282775 | 0 |
Carica il file indicato nel gridfs e crea il Node che lo contiene | public function rpcAddNodeAction($parentid, $filename) {
// legge da db (o crea) nodo padre
if ($parentid !== null) {
$parent = $this->getDoctrine()->getRepository('OpenviewTreeRepoBundle:Node')->find($parentid);
} else {
$parent = new Node();
}
// creazione nodo
$node = new Node();
$node->setName($filename);
$node->setType(Node::TYPE_FILE);
$node->setParent($parent);
// creazione elemento gridfs
$uploadedFile = 'vendor/blueimp/jQuery-File-Upload-9.5.4/server/php/files/' .
session_id() . '/' . $filename;
$document = new StoredItem();
$document->setFile($uploadedFile);
$document->setFilename($filename);
$document->setMimeType('application/octet-stream');
$dm = $this->get('doctrine.odm.mongodb.document_manager');
//$dm = $this->get('doctrine_mongodb');
$dm->persist($document);
$dm->flush();
// aggiornamento nodo
$em = $this->getDoctrine()->getManager();
$em->persist($node);
$em->flush();
// eliminazione file temporaneo uploadato
unlink($uploadedFile);
return new Response('Ok');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function willitbuild_dataloader_create_article($article_number, $title, $body, $file) {\n $node = Node::create([\n 'type' => 'article',\n 'title' => $title,\n 'field_image' => [\n 'target_id' => $file->id(),\n 'alt' => $title,\n 'title' => $title,\n ],\n 'body' => [\n 'value' => $body,\n 'format' => 'basic_html',\n ],\n ]);\n\n $node->save();\n\n $path_alias = PathAlias::create([\n 'path' => '/node/' . $node->id(),\n 'alias' => '/' . str_replace(' ', '-', strtolower($title)),\n ]);\n $path_alias->save();\n\n return $node;\n}",
"function createSubmissionFileNode($doc, $submissionFile) {\n\n\t\t$deployment = $this->getDeployment();\n\t\t$submissionFileNode = parent::createSubmissionFileNode($doc, $submissionFile);\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'creator', $submissionFile->getCreator(null));\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'subject', $submissionFile->getSubject(null));\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'description', $submissionFile->getDescription(null));\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'publisher', $submissionFile->getPublisher(null));\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'sponsor', $submissionFile->getSponsor(null));\n\t\tif ($dateCreated = $submissionFile->getDateCreated()) {\n\t\t\t$submissionFileNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'date_created',$dateCreated));\n\t\t}\n\t\t$this->createLocalizedNodes($doc, $submissionFileNode, 'source', $submissionFile->getSource(null));\n\t\tif ($language = $submissionFile->getLanguage()) {\n\t\t\t$submissionFileNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'language', htmlspecialchars($language, ENT_COMPAT, 'UTF-8')));\n\t\t}\n\t\treturn $submissionFileNode;\n\t}",
"public function createFileOfLocation()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\FileOfLocationEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initFileOfLocation($entity);\n\n return $entity;\n }",
"public function insertOneFile($file) {\n\n $description = '';\n $name = $file['file_name'];\n $path = $file['file_path'];\n\n if(!empty($file['file_description'])){\n $description = $file['file_description'];\n }\n\n\n $query = \\Drupal::database()->insert('yml_maker')\n ->fields([\n 'file_name' => $file['file_name'],\n 'file_path' => $file['file_path'],\n 'file_description' => $description,\n ])\n ->execute();\n\n }",
"public function create( BinaryFileCreateStruct $file )\n {\n if ( $this->exists( $file->path ) )\n {\n throw new PathExists( $file->path );\n }\n\n // @todo Build a path / scope mapper\n $scope = 'todo';\n $this->getClusterHandler()->fileStoreContents(\n $file->path,\n fread( $file->getInputStream(), $file->size ),\n (string)$file->contentType,\n $scope\n );\n\n return $this->load( $file->path );\n }",
"public function import($import)\n {\n //parse le xml\n $this->parse($import,false);\n\n\n\n $note=\"Parse OK \".count($this->nuxeotab).\" objets\";\n\n $nuxeo=new NuxeoGestion;\n\n //crée un folder\n //$idfolder=$nuxeo->createDocument(\"1f992202-3b57-4e14-a649-f370b15c0e55\",\"Folder\",\"laravel folder\".date(\"Y-m-d H:i:s\"));\n /*\n $idfolder=\"1f992202-3b57-4e14-a649-f370b15c0e55\";\n //crée le document\n $id=$nuxeo->createDocument($idfolder,\"File\",\"laravel \".date(\"Y-m-d H:i:s\"));\n //crée un batch e trécupère son id\n $batchid=$nuxeo->createbatch();\n //on upload le fichier\n $upload=$nuxeo->uploadFile('patate.jpg',\"patate.jpg\",$batchid);\n\n\n\n $nuxeo->linkUploadedFile($id,$batchid);\n */\n\n #$id=$nuxeo->createDocumentWithFile(\"1f992202-3b57-4e14-a649-f370b15c0e55\",\"BBB62.mp4\",\"Une video de lapin\");\n\n\n\n //$note=\"<a href=https://ged.mines-telecom.fr/nuxeo/nxdoc/default/\".$id.\"/view_documents>Lien vers document</a>\";\n\n //creation du document racine \"nuxeoroot\"\n print $this->nuxeoroot;\n\n #print_r($this->nuxeotab);\n\n $id=$nuxeo->createDocument(\"1f992202-3b57-4e14-a649-f370b15c0e55\",'Folder',$this->nuxeotab[$this->nuxeoroot]['title']);\n\n //creation de la descendance ( arborescence )\n\n $out=$nuxeo->createChilds($id,$this->nuxeoroot,$this->nuxeotab,$this->nuxeoroot);\n\n\n\n //test : creation à plat des docs\n /* dev desactive = creation a plat\n\n\n $ok=0;\n foreach ($this->nuxeotab as $key => $value) {\n print \"racine =\".$this->nuxeoroot;\n print \"key \". $key ;\n print_r($value);\n print\"<br><br>\";\n\n\n if($value['type']=='Document')\n {\n /*print \"<font color=red>import !!</font><br>\";\n\n $pathtodoc=\"/\".$import.\"/documents/r_\".$key;\n print $pathtodoc.\"<br>\";*//*\n $pathtodoc=\"\".$import.\"/documents/r_\".$key.\"_0\";\n $id=$nuxeo->createDocumentWithFile(\"1f992202-3b57-4e14-a649-f370b15c0e55\",$pathtodoc,$value['title']);\n $ok=1;\n }\n\n\n\n\n\n\n }\n dev deactive fin*/\n\n //$note=\"\";\n $id=\"\";\n\n return view('generic_view')->withNote('Message '.$note.\" \".$id)->withDatas([]);\n\n }",
"public function getFileNode($filename)\n {\n foreach ($this->files->file->iterateItems() as $NodeKey => $NodeValue) {\n if ($filename == $NodeValue->filename) {\n return $NodeValue;\n }\n }\n // add a new node\n $node = $this->files->file->Add();\n $node->filename = $filename;\n\n return $node;\n }",
"public function node_migration_photo_gallery() {\n $query = \\Drupal::database()->select('z_old_d7_node__photo_gallery', 'n_pg');\n $query->fields('n_pg', ['nid','vid','title', 'language', 'uid', 'STATUS', 'created', 'changed', 'field_op_author_nid', 'field_op_section_term_tid', 'field_op_related_nref_nid']);\n $query->condition('move_status', '0', '='); //This record is ready to process and Status - 0\n $query->orderBy('nid', 'ASC');\n $query->range(0, 30);\n $z_results = $query->execute()->fetchAll();\n\n$fp = fopen(\"photo_gallery.txt\",\"a+\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"Start-------------\".date(\"Y-m-d H:i:s\").\"-----------------\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n\n foreach ($z_results as $z_result) {\n\n //Update Status - This record is inprocess and Set - Status - 1\n $upd1 = \\Drupal::database()->update('z_old_d7_node__photo_gallery');\n $upd1->fields(['move_status' =>1,]);\n $upd1->condition('nid', $z_result->nid, '=');\n $upd1->execute();\n\n\nfwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"--\");\n fwrite($fp, $z_result->nid);\n fwrite($fp, \"--\");\n fwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n\n\t $node = Node::create([\n 'type' => 'photo_gallery',\n\t\t 'nid' => $z_result->nid,\n\t\t 'vid' => $z_result->vid,\n 'langcode' => $z_result->language,\n 'uid' => $z_result->uid,\n 'status' => $z_result->STATUS,\n 'created' => $z_result->created,\n 'changed' => $z_result->changed,\n 'title' => $z_result->title,\n //Extra Fields\n\t\t 'field_by_author' => $z_result->field_op_author_nid,\n\t\t 'field_op_related_nref' => $z_result->field_op_related_nref_nid,\n 'field_section' => $z_result->field_op_section_term_tid,\n\t\t 'field_old_d7_nid' => $z_result->nid,\n ]);\n $node->save();\n \n\t //Update Status - This record has been processed and Set - Status - 2\n $upd = \\Drupal::database()->update('z_old_d7_node__photo_gallery');\n $upd->fields(['move_status' =>2,]);\n $upd->condition('nid', $z_result->nid, '=');\n $upd->execute();\n }//end for loop\n\nfwrite($fp, PHP_EOL.\"\\n\".\"\\r\\n\");\n fwrite($fp, \"END-------------\".date(\"Y-m-d H:i:s\").\"-----------------\").PHP_EOL;\n fclose($fp);\nreturn array('#title' => \"Content Type - Photo Gallery Migration\", '#markup' => \"Records has been Processed!\",);\n}",
"function createNet($graph){\n\n//FIXME added parameters making it possible to specify which\n//attributes should be written as partition or vectors in the file\n\n//setup an array of vertex ids to consecutive id numbers\n$idLookup = array();\n$idNum =1;\nforeach ($graph['nodetypes'] as $nodetype){\n\t//for each node\n\tforeach ($graph['nodes'][$nodetype] as $node){\n\t//make sure it is not already on the list\n\t if (!array_key_exists($node['id'], $idLookup)){\n\t\t $idLookup[$node['id']] = $idNum; //id of node\n\t\t $idNum++;\n\t\t} else {\n\t\t\t//warn about duplicate id\n\t\t\techo(\"WARNING: duplicate ids \".$node['id'].\" when building pajek file, 2nd ignored\\n\");\n\t\t}\n\t}\n}\n//string to hold file data\n$net = \"Vertices \".sizeof($idLookup).\"\\n\";\n//now loop over nodes to write them\nforeach ($graph['nodetypes'] as $nodetype){\n\t//for each node\n\tforeach ($graph['nodes'][$nodetype] as $node){\n\t $label = $node['label'];\n\t if ($label == null){$label = $node['id'];}\n\t\n\t\t$net .= \" \".$idLookup[$node['id']].\" \\\"\".$label.\n\t\t\t\t\"\\\" 0.000 0.000 ic \".\n\t\t\t\t$node['color'].\n\t\t\t\t\" \".$node['shape'].\n\t\t\t\t\"\\n\"; //id of node\n\t}\n}\nprint_r($idLookup);\n\n//now write edges data. Assume they are directed, so write as arcs\n$net .= \"*Arcs \\n\";\n//this will crash if there is an edge id not in node id\n//for each edge type\nforeach(array_keys($graph['edgetypes']) as $edgetype){\n\t//for each edge\n\tforeach($graph['edges'][$edgetype] as $edge ){\n\t\t//lookup the from and to id numbers\n\t\t$fromNum = $idLookup[$edge['fromId']];\n\t\t$toNum = $idLookup[$edge['toId']];\n\t\tif ($fromNum == null | $toNum == null){ //give a warning that this is a bad file\n\t\t echo(\"ERROR building .net file: there is no node id (\".$edge['fromId'].\n\t\t \" \".$edge['toId'].\") for an id on edge id\".$edge['id'].\"\\n\");\n\t\t\treturn;\n\t\t}\n\t\t//write out the edge properties\n\t\t//FIXME add weight info\n\t\t$net .= \" \".$fromNum.\" \".$toNum.\" \".getWeightPJ($edge['weight']).\" \\n\";\n\t\t//include more edge properties\n\t}\n}\n\n//add more graph properties as vectors and partitions\nreturn ($net);\t\n\n}",
"protected function addFileFields(): void\n {\n //the relative path to the file project main dir, e.g. output/images/\n $this->addField(\n\n 'path',\n [\n 'type' => 'string'\n ]\n );\n\n //extra field to further classify file if needed, e.g. \"ATTACHMENT\", \"TEMPORARY\"\n $this->addField(\n 'type',\n [\n 'type' => 'string'\n ]\n );\n\n //pdf, jpg etc\n $this->addField(\n 'filetype',\n [\n 'type' => 'string'\n ]\n );\n\n //indicates if the file was generated by Script (true) or uploaded by user (false)\n $this->addField(\n 'auto_generated',\n [\n 'type' => 'boolean',\n 'default' => false\n ]\n );\n\n //crypt_id, used when file is made available for download\n $this->addField(\n 'crypt_id',\n [\n 'type' => 'string',\n 'system' => true\n ]\n );\n\n $this->addField(\n 'sort',\n [\n 'type' => 'string'\n ]\n );\n }",
"public function testCreateFile()\n {\n $this->prepareDataTables();\n\n $config = $this->prepareConfig();\n $config['parameters']['tables'][] = [\n 'id' => 0,\n 'title' => 'titanic',\n 'enabled' => true,\n 'folder' => ['id' => getenv('GOOGLE_DRIVE_FOLDER')],\n 'action' => ConfigDefinition::ACTION_CREATE,\n 'tableId' => 'titanic',\n ];\n\n $process = $this->runProcess($config);\n $this->assertEquals(0, $process->getExitCode(), $process->getOutput());\n\n $gdFiles = $this->client->listFiles(\"name contains 'titanic (\" . date('Y-m-d') . \"' and trashed != true\");\n $this->assertArrayHasKey('files', $gdFiles);\n $this->assertNotEmpty($gdFiles['files']);\n $this->assertCount(1, $gdFiles['files']);\n }",
"public function getLeafNode($name_of_leaf)\n\t{\n\t\t// naive way is to use dot to distinct file node\n\t\tif(strstr($name_of_leaf, '.'))\n\t\t{\n\t\t\tif(strstr($name_of_leaf, ':'))\n\t\t\t{\n\t\t\t\t// first element of temp_arry is filename \n\t\t\t\t// second element is name of file template\n\t\t\t\t// filenode second argument receive full path to file template \n\t\t\t\t$temp_array = explode(':', $name_of_leaf);\n\t\t\t\t$new_node = new FileNode($temp_array[0], SKEBUILDER_FILE_TEMPLATE_DIR . $temp_array[1]);\n\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$new_node = new FileNode($name_of_leaf);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$new_node = new FolderNode($name_of_leaf);\n\t\t}\n\n\t\treturn $new_node;\n\t}",
"function _erpal_projects_service_task_create($task) {\n $newTask = new stdClass();\n $newTask->uid = $task['uid'];\n $newTask->type = 'erpal_task';\n $newTask->language = LANGUAGE_NONE;\n $newTask->title = $task['title'];\n $newTask->body[LANGUAGE_NONE][0]['value'] = $task['body'];\n $newTask->field_is_ticket[LANGUAGE_NONE][0]['value'] = $task['ticket'];\n $newTask->field_project_ref[LANGUAGE_NONE][0]['target_id'] = $task['project'];\n $newTask->field_task_status_term[LANGUAGE_NONE][0]['tid'] = $task['status'];\n $newTask->field_priority_term[LANGUAGE_NONE][0]['tid'] = $task['priority'];\n $newTask->field_task_type_term[LANGUAGE_NONE][0]['tid'] = $task['task_type'];\n\n if (isset($task['parent'])) {\n $newTask->field_parent[LANGUAGE_NONE][0]['target_id'] = $task['parent'];\n }\n\n if (isset($task['file'])) {\n $newFile = new stdClass();\n $newFile->uid = $task['uid'];\n $newFile->type = 'erpal_file';\n $newFile->language = LANGUAGE_NONE;\n $fid = _file_resource_create($task['file']);\n $newFile->field_docs_file[LANGUAGE_NONE][] = array(\n 'fid' => $fid['fid'],\n 'display' => 1,\n );\n $newFile->title = $task['file']['filename'];\n node_save($newFile);\n\n $newTask->field_asset_files[LANGUAGE_NONE][0]['target_id'] = $newFile->nid;\n }\n\n node_save($newTask);\n\n $field_collection_item = entity_create('field_collection_item', array('field_name' => 'field_pricing'));\n $field_collection_item->setHostEntity('node', $newTask);\n $field_collection_item->field_price_mode[LANGUAGE_NONE][0]['value'] = 'none';\n $field_collection_item->save();\n\n return $newTask->nid;\n}",
"public function validateToNode($filename = null) {}",
"public function create()\n {\n $extra = array(\n 'return' => 'admin/news/newsfile',\n 'success_message' => lang('newsfile:submit_success'),\n 'failure_message' => lang('newsfile:submit_failure'),\n 'title' => 'lang:newsfile:new'\n );\n\n $this->streams->cp->entry_form('newsfiles', 'newsfile', 'new', null, true, $extra);\n \n }",
"public function source(): DimageFile {\n return new DimageFile($this->fs,\n $this->identity, $this->index, $this->ext,\n $this->entity, '', '', $this->tenant);\n }",
"public function AddGridFSFileFromData($data, Array $args=[])\n\t{\n\t\t$temp = tmpfile();\n\t\tfwrite($temp, $data);\n\t\t$id = $this->AddGridFSFile($temp, $args);\n\t\tfclose($temp);\n\t\treturn $id;\n\t}",
"function load_file($project_id = null,$file_id = null) {\r\n if($this->Session->read(\"User.user_id\") && $this->request->is('post')){\r\n\r\n $this->TreeFile = ClassRegistry::init('TreeFile'); \r\n $this->TreeFile->id = $file_id ; \r\n \r\n //$results = $this->TreeFile->read(null,$file_id) ; \r\n App::import('Component','Filesoperations');\r\n $file = new FilesoperationsComponent() ; \r\n if($file->get_file_main_route($file_id,$project_id)){\r\n //header(\"HTTP/1.0 200 OK\");\r\n $this->set(\"output\",$file->get_file_main_route($file_id,$project_id));\r\n //highlight_file();\r\n } else {\r\n header(\"HTTP/1.0 404 Not Found\"); \r\n }\r\n\r\n\t }else {\r\n\t\t header(\"HTTP/1.0 404 Not Found\"); \r\n\t }\r\n \r\n }",
"public function __construct(){\n if(!gd_info())\n die('Please install php-gd');\n\n if(!defined('CLUSTER_UPLOAD_FILES'))\n die('Please set the constant CLUSTER_UPLOAD in the settings.php file');\n\n /* $this->cluster = BASE_DIR . CLUSTER_UPLOAD;\n\n if(!file_exists($this->cluster))\n mkdir($this->cluster, 0755);*/\n $this->cluster_name = CLUSTER_UPLOAD_FILES . date('m-Y') . '/';\n $this->cluster = BASE_DIR . $this->cluster_name;\n\n if(!file_exists($this->cluster)){\n mkdir($this->cluster, 0755, true);\n }\n\n /* crear cluster por meses del año */\n\n }",
"abstract protected function fetchFromFile();",
"public function createFromFile($file, array $params = []);",
"protected function createFile() {\n\t\t$json = json_decode(file_get_contents(\"php://input\"));\n\t\t$viewmodel = new ManualsourceModel();\n\t\treturn $viewmodel->createFile($json, 1);\n\t}",
"function createJSON($filename) {\n\n\t$nodeTemplate = \"\\n\" .'{ \"data\": { \"id\": \"%s\", \"type\":\"%s\", \"in_disease\":\"%s\", \"regulation\":\"%s\", \"shape\":\"%s\", \"color\":\"%s\"} }';\n\t$edgeTemplate = \"\\n\" .'{ \"data\": { \"id\": \"%d\", \"source\":\"%s\", \"target\":\"%s\", \"interaction\":\"%s\", \"evidence\":\"%s\", \"dataSource\":\"%s\", \"name\":\"%s (%s) %s\" } }';\n\n //$nodeTemplate = \"\\n{ \\\"data\\\": { \\\"id\\\": \\\"%s\\\"', type:'%s', in_disease:'%s', regulation:'%s', shape:'%s', color:'%s'} }\";\n //$edgeTemplate = \"\\n{ \\\"data\\\": { \\\"id\\\": '%d', source:'%s', target:'%s', type:'%s', evidence:'%s', dataSource:'%s' } }\";\n\n\n\tif (!file_exists($filename) || ($f = fopen($filename, \"r\")) === false) { return \"Not available for this type of interaction\"; };\n \n \t// get table header\n \t$first = fgetcsv($f, 0, \"\\t\");\n\n \t$header = array();\n \tforeach($first as $head) array_push($header, $head);\n\n\t$nodes = array();\n\n\t$edges = array();\n\t$edge_id = 0;\n\twhile (($line = fgetcsv($f, 0, \"\\t\")) !== false) {\n \t\t$cell_no = 0;\n \t\t//foreach($line as $cell) {\n \t\t//\tif ($header[$cell_no] == 'regulator' | $header[$cell_no] == 'target') {\n \t\t//\t\tarray_push($nodes, $cell)\n \t\t//\t}\n \t\t\n \t\t$node_1 = $line[array_search('regulator', $header)];\n \t\t$node_2 = $line[array_search('target', $header)];\n\n \t\t$categoryString = $line[array_search('category', $header)];\n\n \t\t$categories = explode('-',$categoryString);\n\n \t\t$reg_in_disease = $line[array_search('is_regulator_in_disease', $header)];\n \t\t$target_in_disease = $line[array_search('is_target_in_disease', $header)];\n\n \t\tif (array_search('regulator.reg', $header) !== false) {\n \t\t\t$regulator_regulation = $line[array_search('regulator.reg', $header)];\n \t\t\t$target_regulation = $line[array_search('target.reg', $header)];\n \t\t} else {\n \t\t\t$regulator_regulation = 0;\n \t\t\t$target_regulation = 0;\n \t\t}\n\n \t\t$evidence = $line[array_search('evidence', $header)];\n \t\t$dataSource = $line[array_search('source', $header)];\n\n \t\t$categoryShape = array('tf' => 'hexagon', 'mirna' => 'ellipse', 'gene' => 'rectangle' );\n \t\t$categoryColor = array('tf' => '#66d15c', 'mirna' => '#fffb7d', 'gene' => '#f2780c' );\n\n \t\tarray_push($nodes, sprintf($nodeTemplate, $node_1, $categories[0], $reg_in_disease, $regulator_regulation, $categoryShape[$categories[0]], $categoryColor[$categories[0]]));\n \t\tarray_push($nodes, sprintf($nodeTemplate, $node_2, $categories[1], $target_in_disease, $target_regulation, $categoryShape[$categories[1]], $categoryColor[$categories[1]])); \t\t\n \t\tarray_push($edges, sprintf($edgeTemplate, $edge_id, $node_1, $node_2, $categoryString, $evidence, $dataSource, $node_1, $categoryString, $node_2));\n\n// \t\t$categories = explode('-',$line[2]);\n// \t\tarray_push($nodes, sprintf($nodeTemplate, $line[0], $categories[0], $line[7], $line[9]));\n// \t\tarray_push($nodes, sprintf($nodeTemplate, $line[1], $categories[1], $line[8], $line[10])); \t\t\n// \t\tarray_push($edges, sprintf($edgeTemplate, $edge_id, $line[0], $line[1], $line[2], $line[3], $line[4]));\n \t\t$edge_id += 1;\n \t}\n \t$nodes = array_unique($nodes);\n \t//echo '{ \"data\": { \"name\":\"TFmir\" },'. \"\\n\";\n //echo '\"elements\": {';\n\n $pb = \"{\";\n $pb .= '\"nodes\" : [ ' . implode($nodes, \",\") . \"],\\n\";\n\t $pb .= '\"edges\" : [ ' . implode($edges, \",\") . \"]\";\n $pb .= \"}\";\n return($pb);\n //echo \"}\\n };\";\n}",
"public function testLoadNodeFromFile()\n {\n $node = new Node();\n $node->loadFile($this->getFixturesPath('document.html'));\n $this->assertInstanceOf(simple_html_dom_node::class, $node->getSimpleNode());\n }",
"function update_file_node($node, $parent) {\n\t\t$match_count = preg_match('/folder_([0-9]+)/i', $node['attributes']['id'], $matches);\n\t\tif ($match_count == 1)\n\t\t{\n\t\t\t$id = $matches[1];\n\t\t\t$f = new Folder($id);\n\t\t\t$f->ParentID = ($parent == null) ? 0 : $parent;\n\t\t\t$f->commit(); \n\t\t\t\n\t\t\t// okay it's a folder, so recurse for child folders / files \n\t\t\tif (isset($node['children']) && is_array($node['children'])) {\n\t\t\t\tforeach($node['children'] as $child) {\n\t\t\t\t\t$this->update_file_node($child, $f->ID);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// hrmm, maybe it's a file.\n\t\t\t$match_count = preg_match('/file_([0-9]+)/i', $node['attributes']['id'], $matches);\n\t\t\tif ($match_count == 1)\n\t\t\t{\n\t\t\t\t$id = $matches[1];\n\t\t\t\t$f = new File($id);\n\t\t\t\t$f->Folder = ($parent == null) ? 0 : $parent;\n\t\t\t\t$f->commit(); \n\t\t\t}\t\n\t\t}\n\t\t\n\t}",
"function vikinger_file_create_task($args) {\r\n $task_execute = function ($args) {\r\n $result = vikinger_upload_file($args['file_data'], $args['component'], $args['file_data_type']);\r\n\r\n return $result;\r\n };\r\n\r\n $task_rewind = function ($args) {\r\n $filepath = vikinger_get_component_upload_path($args['component']) . '/' . $args['file_data']['name'];\r\n $result = vikinger_delete_file($filepath);\r\n };\r\n\r\n $task = new Vikinger_Task($task_execute, $task_rewind, $args);\r\n\r\n return $task;\r\n}",
"function createPath($path)\n {\n\n $tree = $this->explodePath($path);\n\n $inode = NULL;\n \n foreach ($tree as $branch)\n {\n $thisBranch = $this->locateInode($branch, $inode);\n \n if ($thisBranch[\"inode\"] == \"\")\n $inode = $this->createItem($branch, $inode, \"16893\");\n else\n $inode = $thisBranch[\"inode\"];\n \n }\n\n\n }",
"public function createFakeFileObject(){\n $columns = $this->getColumnsFiles();\n $integerColumns = [\n 'victim_mf_weight','victim_mf_height','take_documents_or_clothes','leave_document_or_message',\n 'fact_have_strange_attitude_before_disappearance','fact_vehiculo_victim','suspicious_vehicles',\n 'family_labor_social_religious_conflicts','domestic_violence','threats','credits_departments_debits_cards',\n 'real_estate_properties','power_charges','criminal_records','smoking','alcohol','drugs','organized_crime',\n 'informer_years','victim_year_or_mounth_when_fact'\n\n ];\n $dateColumns = [\n 'dna_date_providing_sample','victim_birthdate','fact_date','fact_last_day_saw','informer_birthdate',\n 'date_of_low_file'\n ];\n $specifictColumns = [\n 'victim_mounth_or_year' => 'year'\n ];\n $record = [];\n foreach ($columns as $key => $groupColumns){\n foreach($groupColumns as $keyColumn => $column){\n $value = 'lorem itsu';\n if(str_contains($column,'_id') !== false){\n $value = 1;\n }\n if(in_array($column,$integerColumns)){\n $value = 23;\n }\n if(in_array($column,$dateColumns)){\n $value = date('Y-m-d');\n }\n if( isset($specifictColumns[$column]) ){\n $value = $specifictColumns[$column];\n }\n $record[$key][$column] = $value;\n }\n }\n return $record;\n }",
"public function parse($import,$display=True)\n {\n //DSI\n //$xmlfile=\"/USERS/phpinfo/laravel/nupload/imports/Collection-15616/Collection-15616.xml\";\n //FAYOL\n //$xmlfile=\"/USERS/phpinfo/laravel/nupload/imports/Collection-5745/Collection-5745.xml\";\n //$xml = simplexml_load_file($xmlfile);\n\n //reconstruit le chemin de telle sorte\n $pathtoxml=\"/\".$import.\"/\".$import.\".xml\";\n\n $note=\"\";\n\n //recupere le contenu du fichier\n $xmlcontent = Storage::disk('imports')->get($pathtoxml);\n\n //convertit le texte xml en objet simplexml_load_file\n $xml = simplexml_load_string($xmlcontent);\n\n //print $import.$xmlcontent;\n\n $this->nuxeotab=\"\";\n\n #tableau contenant les données nuxeo\n\n\n //$file=fopen($xmlfile);\n\n foreach ($xml as $id => $dsobject) {\n #print_r($dsobject);\n\n\n //Type de document\n $ds_type=(string)$dsobject->attributes()->classname;\n\n\n //Nom Docushare du document\n $ds_id=(string)$dsobject->attributes()->handle;\n\n\n //description du document\n $this->getXmlProp($dsobject,\"description\",$ds_id);\n\n\n\n //Libellé du document/Collection\n $this->getXmlProp($dsobject,\"title\",$ds_id);\n\n\n //nom original du fichier\n $this->getXmlProp($dsobject,\"filename\",$ds_id);\n\n //résumé du fichier ( keywords)\n $this->getXmlProp($dsobject,\"keywords\",$ds_id);\n\n //résumé du fichier ( keywords)\n $this->getXmlProp($dsobject,\"original_file_name\",$ds_id);\n\n //Collections contenant le fichier/la collection\n $ds_father=(string)$dsobject->sourcelinks->containment;\n\n\n //Listre des contenus de la collection\n $ds_childs=\"\";\n $ds_child=\"\";\n $ds_child=array();\n $ds_childs=$dsobject->destinationlinks->containment;\n $i_father=0;\n\n foreach ($ds_childs as $child) {\n $ds_child[]=(string)$child;\n\n }\n\n //si aucun enfant et que c'est une collection, c'est la racine d'import\n if(count($dsobject->sourcelinks->containment)==0 && $ds_type==\"Collection\")\n {\n\n $this->nuxeoroot=$ds_id;\n }\n\n //Le propriétaire de l'objet\n $ds_owner=(string)$dsobject->destinationlinks->owner;\n\n\n\n $this->nuxeotab[$ds_id]['type']=$ds_type;\n\n $this->nuxeotab[$ds_id]['father']=$ds_father;\n $this->nuxeotab[$ds_id]['childs']=$ds_child;\n $this->nuxeotab[$ds_id]['owner']=$ds_owner;\n\n\n\n\n\nif($ds_id==\"Collection-16730\")\n{\n /*print_r($dsobject);\n print_r($this->nuxeotab[$ds_id]);*/\n}\n\n\n # $this->nuxeotab[$dsobject->attributes()['handle'][0]]=1;\n #$this->nuxeotab[$ds_id]['type']=1;\n\n\n #print \"$id *****<br>\";\n }\n\n\n #print_r($xml);\n if($display==true)\n print_r($this->nuxeotab);\n\n #return view('generic_view')->withNote('Test de connexion à '.$xml.$xmlfile)->withDatas(['tab1','tab2']);\n return view('generic_view')->withNote('Message '.$note)->withDatas([]);\n }",
"public function populateImageDataFromFileSystem(){\n\n\n //Scan for main image\n //Add to database if exist\n\n //Scan for square image (could be jpg png etc)\n //Add to database if exist\n\n //scan for extra carousel images\n //Loop over each carousel images\n //Add to database \n\n\n }"
] | [
"0.57881576",
"0.5641113",
"0.55541",
"0.5463985",
"0.5357366",
"0.535238",
"0.53027344",
"0.52620196",
"0.51956457",
"0.51463073",
"0.51425564",
"0.5128538",
"0.5119918",
"0.5118346",
"0.5117917",
"0.5082973",
"0.50748354",
"0.50524765",
"0.5047964",
"0.50416243",
"0.50303966",
"0.5025706",
"0.5018636",
"0.500227",
"0.50020343",
"0.49980557",
"0.49967504",
"0.4979111",
"0.49600652",
"0.494986"
] | 0.59345734 | 0 |
Unlink form for Meetup account. | function meetup_login_unlink_form($form, &$form_state, $id) {
$form['id'] = array(
'#type' => 'value',
'#value' => $id,
);
return confirm_form($form,
t('Are you sure you want to unlink'),
isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/services/meetup/unlink' . $id,
t('This action cannot be undone.'),
t('Unlink'),
t('Cancel')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function meetup_login_unlink_form_submit($form, &$form_state) {\n meetup_login_unlink_confirm($form_state['values']['id']);\n $form_state['redirect'] = 'admin/config/services/meetup/';\n}",
"public function actionUnlink()\n {\n\n if (Yii::$app->request->isAjax) {\n\n $data = Yii::$app->request->post();\n\n\n if( $data and isset( $data['accounts'] ) ) {\n\n $current_user_id = Yii::$app->user->id;\n foreach ($data['accounts'] as $account_id ) {\n $unlink_account = UserAccount::find()\n ->where( ['user_id' => $current_user_id ] )\n ->andwhere( ['account_id' => $account_id] )\n ->one();\n if($unlink_account){\n $unlink_account->delete();\n }\n\n\n }\n\n return $this->renderPage();\n\n }\n\n\n\n }\n return false;\n }",
"function c4m_user_profile_remove_account_form($form, $form_state, $account) {\n if ($groups = c4m_og_get_user_owned_groups($account->uid, [\n 'group',\n 'project',\n ])) {\n $items = [];\n\n foreach ($groups as $nid => $title) {\n $items[] = l($title, 'node/' . $nid);\n }\n\n $form['warning'] = [\n '#markup' => '<p>' . t(\"You can't leave the platform meanwhile you still own groups and projects. Please, transfer the ownership first.\") . '</p>' . theme('item_list', ['items' => $items]),\n ];\n\n return $form;\n }\n\n // We emulate the default user deletion form values to use\n // the default process.\n $form['_account'] = [\n '#type' => 'value',\n '#value' => $account,\n ];\n\n $form['uid'] = [\n '#type' => 'value',\n '#value' => $account->uid,\n ];\n\n $form['user_cancel_confirm'] = [\n '#type' => 'value',\n '#value' => FALSE,\n ];\n\n $form['user_cancel_notify'] = [\n '#type' => 'value',\n '#value' => FALSE,\n ];\n\n $form['user_cancel_method'] = [\n '#type' => 'value',\n // This method will block the user but leave the content\n // assigned to the user.\n '#value' => 'user_cancel_block',\n ];\n\n $form['anonymize'] = [\n '#type' => 'checkbox',\n '#title' => t('I no longer want my name to appear on contents I have contributed - please make all my content anonymous.'),\n ];\n\n $form['feedback'] = [\n '#type' => 'textarea',\n '#title' => t('Provide a reason (optional)'),\n ];\n\n $question = t('Are you sure you want to leave the platform? This action is irreversible');\n\n return confirm_form($form, $question, 'user');\n}",
"function asb_scheme_delete_membership_submit($form, &$form_state) {\n $path = $form_state['goto'];\n $membership = $form_state['og_membership'];\n $group_type = $membership->group_type;\n $gid = $membership->gid;\n if(count($path) > 1){\n $goto = $path[1];\n $message = explode('/',$goto);\n $thread_id = $message[2];\n $tag_ids = array(2);\n global $user;\n privatemsg_filter_remove_tags(array($thread_id), $tag_ids, $user);\n }else{\n $goto = $group_type .'/' .$gid .'/' . 'group';\n }\n $membership->delete();\n // $form_state['redirect'] = 'group/' . $membership->group_type . '/' . $membership->gid . '/admin/people';\n $form_state['redirect'] = $goto;\n drupal_set_message(t('The membership was removed.'));\n}",
"function c4m_user_profile_remove_account_form_submit($form, &$form_state) {\n $values = $form_state['values'];\n $account = $values['_account'];\n\n if ($values['anonymize']) {\n // This cancel method will reassign all the content of the user\n // to the anonymous user.\n $values['user_cancel_method'] = 'c4m_user_admin_block_anonymous';\n }\n\n $gids = c4m_og_get_user_group_ids_by_bundle(NULL, $account);\n\n if (!empty($gids)) {\n // Remove all memberships of the user.\n foreach ($gids as $gid) {\n og_ungroup('node', $gid, 'user', $account->uid);\n }\n }\n\n // This calls the default Drupal workflow for cancelling an account.\n user_cancel($values, $values['uid'], $values['user_cancel_method']);\n\n drupal_set_message(t('Your account has been successfully removed from the platform.'));\n\n // As the user no longer exists, it doesn't have access to the\n // current page (user profile). So we redirect it to the homepage.\n $form_state['redirect'] = '<front>';\n}",
"function meetup_login_delete_form_submit($form, &$form_state) {\n meetup_login_delete_confirm($form_state['values']['id']);\n $form_state['redirect'] = 'admin/config/services/meetup/';\n}",
"function meetup_login_unlink_confirm($id) {\n db_delete('meetup_account')\n ->condition('meetup_uid', $id)\n ->execute();\n}",
"function drubo_remove_confirm($form_state) {\n global $user;\n if ($data = db_fetch_object(db_query('SELECT uid FROM {drubo} WHERE uid = %d', $user->uid))) {\n $form['uid'] = array('#type' => 'value', '#value' => $user->uid);\n return confirm_form($form,\n t('Unbind weibo account'),\n 'sns/remove',\n t('Are you sure to unbind your weibo account?'),\n t('Confirm'),\n t('Cancel'));\n } else {\n drupal_access_denied();\n exit;\n }\n}",
"function member_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $member = $form['#member'];\n $member_uri = member_uri($member);\n $member_uri_path = $member_uri['path'];\n $form_state['redirect'] = array(\n $member_uri_path . '/delete',\n array('query' => $destination),\n );\n}",
"function tobenski_dgp_contact_form_deactivate() {\n // Unregister the post type, so the rules are no longer in memory.\n unregister_post_type( 'message' );\n // Clear the permalinks to remove our post type's rules from the database.\n flush_rewrite_rules();\n}",
"function yubikey_login_form_user_yubikey_login_clear_submit($form, &$form_state) {\n $account_uid = $form_state['input']['yubikey-login-account-uid'];\n $account = user_load($account_uid);\n $user_config_path = \"user/{$account_uid}/yubikey-login\";\n\n yubikey_login_user_remove_user_data($account_uid);\n\n $form_state['redirect'] = $user_config_path;\n\n drupal_set_message(t('Your credentials have been cleared.'));\n yubikey_login_send_notification('removed_credentials', $account);\n}",
"public function unfollow() {\n }",
"public function ajaxUnlinkAction()\r\n {\r\n if (!$this->getRequest()->isXmlHttpRequest()) {\r\n return $this->notFoundAction();\r\n }\r\n\r\n $pupil_id = (int)$this->params()->fromPost('pupil_id');\r\n if (!$pupil_id) {\r\n return new JsonModel(['error' => 'no pupil_id']);\r\n }\r\n\r\n $teacher_id = (int)$this->params()->fromPost('teacher_id');\r\n if (!$teacher_id) {\r\n return new JsonModel(['error' => 'no teacher_id']);\r\n }\r\n\r\n $teacherPupilService = $this->getTeacherPupilService();\r\n $link = $teacherPupilService->getItem([\r\n 'teacher_id' => $teacher_id,\r\n 'pupil_id' => $pupil_id,\r\n ]);\r\n\r\n if ($link) {\r\n $teacherPupilService->delete($link->id);\r\n }\r\n\r\n return new JsonModel([\r\n 'success' => true,\r\n ]);\r\n }",
"function meetup_login_delete_confirm($id) {\n $uid = db_select(\"meetup_account\", \"ma\")\n ->fields(\"ma\", array(\"uid\"))\n ->condition('meetup_uid', $id)\n ->execute()\n ->fetchField();\n user_delete($uid);\n db_delete('meetup_account')\n ->condition('meetup_uid', $id)\n ->execute();\n}",
"function member_form_delete_confirm_submit($form, &$form_state) {\n if ($form_state['values']['confirm']) {\n $member = member_load($form_state['values']['member_id']);\n member_delete($form_state['values']['member_id']);\n watchdog('member', 'Deleted member \"%label\" (type: @type)', array('@type' => $member->type, '%label' => entity_label('member', $member)));\n\n $type = member_type_get_info($member->type);\n\n drupal_set_message(\n t('The @type %label has been deleted.', array('@type' => $type['name'], '%label' => entity_label('member', $member)))\n );\n }\n\n if (empty($_GET['destination'])) {\n $form_state['redirect'] = 'admin/members';\n }\n\n\n}",
"function _reply_action_unpublish_form($form, &$form_states, $reply = 0) {\n $form['id'] = array(\n '#type' => 'hidden',\n '#value' => $reply['id'],\n );\n\n $form['reason'] = array(\n '#title' => t('Reason'),\n '#type' => 'select_or_other',\n '#required' => TRUE,\n '#options' => array(\n 'Abusing language' => t('Abusing language'),\n 'Bad review' => t('Bad language'),\n ),\n );\n\n $form['status'] = array(\n '#type' => 'hidden',\n '#value' => 0,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Unpublish'),\n );\n\n return $form;\n}",
"function eventUnlink(){\r\n\t\t$playerid = util::getData(\"player\");\r\n\r\n\t\t//now for all the long permission checks...\r\n\r\n\t\t//first, do they have permission?\r\n\t\tif( !$this->HasPermission(\"TableEditPlayers\",$this->tableid) )\r\n\t\t\treturn $this->setEventResult(false, \"You do not have permissions to perform this action.\");\r\n\r\n\t\t//next, did they pass a valid playerid?\r\n\t\t$player = new dkpUser();\r\n\t\t$player->loadFromDatabase($playerid);\r\n\t\tif($player->id == \"\")\r\n\t\t\treturn $this->setEventResult(false, \"Invalid Player Selected.\");\r\n\r\n\t\t//are the player in the table\r\n\t\t//if(!$this->updater->PlayerInAnyTable($player->id, $this->tableid)) {\r\n\t\t//\treturn $this->setEventResult(false, \"Player or Main are not in your table. You cannot make this assignment.\");\r\n\t\t//}\r\n\r\n\t\t//perform the update\r\n\t\t$player->main = 0;\r\n\t\t$player->save();\r\n\r\n\t\t//$this->updater->CombineAltsWithMain();\r\n\r\n\t\t$this->setEventResult(true, \"This character has been unlinked. Is it now its own main.\");\r\n\t}",
"function micro_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $micro = $form['#micro'];\n $form_state['redirect'] = array('micro/' . $micro->mid . '/delete', array('query' => $destination));\n}",
"function removeAddress()\n {\n $user = common_current_user();\n\n $screenname = $this->trimmed('screenname');\n $transport = $this->trimmed('transport');\n\n // Maybe an old tab open...?\n\n $user_im_prefs = new User_im_prefs();\n $user_im_prefs->user_id = $user->id;\n if(! ($user_im_prefs->find() && $user_im_prefs->fetch())) {\n // TRANS: Message given trying to remove an IM address that is not\n // TRANS: registered for the active user.\n $this->showForm(_('That is not your screenname.'));\n return;\n }\n\n $result = $user_im_prefs->delete();\n\n if (!$result) {\n common_log_db_error($user, 'UPDATE', __FILE__);\n // TRANS: Server error thrown on database error removing a registered IM address.\n $this->serverError(_('Could not update user IM preferences.'));\n return;\n }\n\n // XXX: unsubscribe to the old address\n\n // TRANS: Message given after successfully removing a registered Instant Messaging address.\n $this->showForm(_('The IM address was removed.'), true);\n }",
"public function action_unsubscribe()\n {\n $email = $this->request->param('email');\n $this->template_params = $this->request->param();\n $validation = Validation::factory($this->template_params)\n ->rule('email', 'not_empty')\n ->rule('email', 'email')\n ->rule('email', 'Model_Email::exist_email')\n ->rule('hash', 'not_empty')\n ->rule('hash', 'alpha_numeric');\n if ( ! $validation->check())\n {\n $this->template_params['errors'] = $validation->errors('validation');\n }\n else\n {\n $validation = Validation::factory($this->template_params)\n ->rule('hash', 'Model_Email::check_email_hash', array($email, ':value'));\n if ( ! $validation->check())\n {\n $this->template_params['errors'] = $validation->errors('validation');\n }\n else\n {\n Model::factory('email')->delete_email($email);\n }\n }\n\n $this->template->content = View::factory('unsubscribe')->set($this->template_params);\n }",
"public function testThatUnlinkAccountRequestIsFormedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users->unlinkAccount(\n '__test_user_id__',\n '__test_provider__',\n '__test_identity_id__'\n );\n\n $this->assertEquals( 'DELETE', $api->getHistoryMethod() );\n $this->assertEquals(\n 'https://api.test.local/api/v2/users/__test_user_id__/identities/__test_provider__/__test_identity_id__',\n $api->getHistoryUrl()\n );\n $this->assertEmpty( $api->getHistoryQuery() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }",
"public function unConfirm($login) {\n $login = EfrontUser::convertArgumentToUserLogin($login);\n foreach ($this -> getCourseLessons() as $lesson) {\n $lesson -> unConfirm($login);\n }\n $fields = array(\"from_timestamp\" => 0);\n $where = \"users_LOGIN='\".$login.\"' and courses_ID=\".$this -> course['id'];\n self::persistCourseUsers($fields, $where, $this -> course['id'], $login);\n }",
"function yubikey_login_form_user_yubikey_login_clear_credentials_submit($form, &$form_state, $yubikey_state) {\n $account_uid = $yubikey_state['account_uid'];\n $form_state['redirect'] = \"user/{$account_uid}/yubikey-login/clear\";\n}",
"function bmap_assoc_delete_confirm_form_submit($form, &$form_state) {\n $bmapAssoc = $form_state['bmap_assoc'];\n $bmapAssoc->delete();\n drupal_set_message(t('Delete bmap assoc for Bid: %bid , Nid: %nid .', array('%bid' => $bmapAssoc->bid, '%nid' => $bmapAssoc->nid)));\n $form_state['redirect'] = 'admin/structure/bmap_assoc';\n}",
"public static function delete_outbox() {\n $id = isset($_SESSION['uid']) ? (int)$_SESSION['uid'] : null;\n if(isset($_POST['delete_outbox'])):\n foreach($_POST as $key => $value):\n if($key != 'delete_outbox'):\n db::pdo()->query('UPDATE `private` SET `delete_from` = \"yes\" WHERE `id` = :id AND `from` = :from LIMIT 1');\n db::pdo()->bind(array(':id' => $value, ':from' => $id));\n db::pdo()->execute();\n endif;\n endforeach;\n self::delete_privates();\n return header(\"Location:?act=outbox\");\n endif;\n }",
"public function unban();",
"public function privacy_meta_html_delete()\n {\n ?>\n <form method=\"post\" action=\"\">\n <div id=\"universal-message-container\">\n <div class=\"options\">\n <p>\n <label><?php _e('Enter User’s Mobile Number', 'wp-sms'); ?></label>\n <br/>\n <input type=\"tel\" name=\"mobile-number-delete\" value=\"\"/>\n <br/>\n <span class=\"description\"><?php _e('Note: You cannot undo these actions.', 'wp-sms'); ?></span>\n </p>\n </div><!-- #universal-message-container -->\n <?php submit_button( __('Delete'), 'primary', 'submit', false ); ?>\n </div>\n <input type=\"hidden\" name=\"wp_sms_nonce_privacy\" value=\"<?php echo $this->wp_nounce; ?>\">\n </form>\n <div class=\"clear\"></div>\n <style>\n\n </style>\n <?php\n }",
"function yubikey_login_form_login_form_submit($form, &$form_state) {\n $account_uid = $form_state['uid'];\n\n yubikey_login_user_clear_attempts($account_uid);\n}",
"function opinionstage_disconnect_account_action() {\n\tif ( OPINIONSTAGE_DISCONNECT_PAGE === filter_input(INPUT_GET, 'page') && $_SERVER['REQUEST_METHOD'] === 'POST' ) {\n\t\tdelete_option(OPINIONSTAGE_OPTIONS_KEY);\n\n\t\t$redirect_url = get_admin_url(null, 'admin.php?page='.OPINIONSTAGE_GETTING_STARTED_SLUG);\n\n\t\topinionstage_error_log( 'user logged out, redirect to ' . $redirect_url );\n\t\tif ( wp_redirect( $redirect_url, 302 ) ) {\n\t\t\texit;\n\t\t}\n\t}\n}",
"function edd_manual_remove_cc_form() {\n\t// we only register the action so that the default CC form is not shown\n}"
] | [
"0.65675116",
"0.655015",
"0.61848766",
"0.61257195",
"0.6068984",
"0.59033793",
"0.5889874",
"0.5800654",
"0.5694243",
"0.56417865",
"0.563879",
"0.56095797",
"0.55792063",
"0.5527987",
"0.5510556",
"0.55041033",
"0.54900837",
"0.54470205",
"0.5438401",
"0.54304993",
"0.5411812",
"0.5374961",
"0.53669685",
"0.5360308",
"0.53558534",
"0.5347673",
"0.53352594",
"0.53271747",
"0.5306334",
"0.5303786"
] | 0.66928625 | 0 |
Form submit for the Meetup Unlink. | function meetup_login_unlink_form_submit($form, &$form_state) {
meetup_login_unlink_confirm($form_state['values']['id']);
$form_state['redirect'] = 'admin/config/services/meetup/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function asb_scheme_delete_membership_submit($form, &$form_state) {\n $path = $form_state['goto'];\n $membership = $form_state['og_membership'];\n $group_type = $membership->group_type;\n $gid = $membership->gid;\n if(count($path) > 1){\n $goto = $path[1];\n $message = explode('/',$goto);\n $thread_id = $message[2];\n $tag_ids = array(2);\n global $user;\n privatemsg_filter_remove_tags(array($thread_id), $tag_ids, $user);\n }else{\n $goto = $group_type .'/' .$gid .'/' . 'group';\n }\n $membership->delete();\n // $form_state['redirect'] = 'group/' . $membership->group_type . '/' . $membership->gid . '/admin/people';\n $form_state['redirect'] = $goto;\n drupal_set_message(t('The membership was removed.'));\n}",
"function _reply_action_unpublish_form_submit($form, &$form_states) {\n $reply = $form_states['build_info']['args'][0];\n $values['reason'] = $form_states['values']['reason'];\n $values['action'] = 'publish';\n $values['value'] = 0;\n finditreply::update($reply['id'], $values);\n drupal_set_message(t('Review have been saved.'));\n $commands[] = ctools_ajax_command_reload();\n print ajax_render($commands);\n exit;\n}",
"function micro_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $micro = $form['#micro'];\n $form_state['redirect'] = array('micro/' . $micro->mid . '/delete', array('query' => $destination));\n}",
"function meetup_login_delete_form_submit($form, &$form_state) {\n meetup_login_delete_confirm($form_state['values']['id']);\n $form_state['redirect'] = 'admin/config/services/meetup/';\n}",
"function type_unblock_callback($form, $form_state){\n return $form['submit'];\n}",
"function member_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $member = $form['#member'];\n $member_uri = member_uri($member);\n $member_uri_path = $member_uri['path'];\n $form_state['redirect'] = array(\n $member_uri_path . '/delete',\n array('query' => $destination),\n );\n}",
"function meetup_login_unlink_form($form, &$form_state, $id) {\n $form['id'] = array(\n '#type' => 'value',\n '#value' => $id,\n );\n return confirm_form($form,\n t('Are you sure you want to unlink'),\n isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/services/meetup/unlink' . $id,\n t('This action cannot be undone.'),\n t('Unlink'),\n t('Cancel')\n );\n}",
"function member_form_delete_confirm_submit($form, &$form_state) {\n if ($form_state['values']['confirm']) {\n $member = member_load($form_state['values']['member_id']);\n member_delete($form_state['values']['member_id']);\n watchdog('member', 'Deleted member \"%label\" (type: @type)', array('@type' => $member->type, '%label' => entity_label('member', $member)));\n\n $type = member_type_get_info($member->type);\n\n drupal_set_message(\n t('The @type %label has been deleted.', array('@type' => $type['name'], '%label' => entity_label('member', $member)))\n );\n }\n\n if (empty($_GET['destination'])) {\n $form_state['redirect'] = 'admin/members';\n }\n\n\n}",
"function remove_iwacontact_submission_publish() {\n\tremove_meta_box( 'submitdiv', 'iwacontactsubmission', 'side' ); \n}",
"public function fetchSubmit() {\n return '';\n }",
"protected function submit()\n\t{\n\t}",
"function forena_edit_delete_submit($form, &$form_state) {\n $link = 'reports/' . $form_state['values']['name_in'] ;\n $destination = '';\n if (isset($_REQUEST['destination'])) {\n $destination = drupal_get_destination();\n unset($_REQUEST['destination']);\n }\n $form_state['redirect'] = array('path' => $link . '/delete', 'query' => array('destination' => $destination));\n}",
"function EndForm() {\n\n?>\n<!-- Adding the submit and reset buttons -->\n<input type = \"button\"\n value = \"Submit\"\n OnClick = \"JavaPowUpload.clickDownload();\"\n >\n<input type = \"reset\"\n value = \"Clear fields\"\n >\n</form>\n<!-- The Form Ends -->\n<?php\n\n }",
"public function delAfterSubmit() {\n\t\t$this->registerAfterSubmit ( \"del\" );\n\t}",
"function election_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $election = $form['#election'];\n $form_state['redirect'] = array(\n election_uri_path($election) . '/delete',\n array('query' => $destination),\n );\n}",
"function _reply_action_unpublish_form($form, &$form_states, $reply = 0) {\n $form['id'] = array(\n '#type' => 'hidden',\n '#value' => $reply['id'],\n );\n\n $form['reason'] = array(\n '#title' => t('Reason'),\n '#type' => 'select_or_other',\n '#required' => TRUE,\n '#options' => array(\n 'Abusing language' => t('Abusing language'),\n 'Bad review' => t('Bad language'),\n ),\n );\n\n $form['status'] = array(\n '#type' => 'hidden',\n '#value' => 0,\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Unpublish'),\n );\n\n return $form;\n}",
"function time_tracker_entry_confirm_delete_submit($form , &$form_state) {\n $entity = $form_state['values']['info']['entity'];\n $uri = $form_state['values']['info']['uri'];\n $user = $form_state['values']['info']['user'];\n $tracked = $form_state['values']['info']['tracked'];\n\n time_tracker_entry_delete($entity);\n\n drupal_set_message(t('The time entry for %name on %title has been deleted.',\n array('%name' => $user->name, '%title' => $tracked->title))\n );\n $form_state['redirect'] = $uri;\n}",
"protected function getSubmitAction(){\n\t\treturn \"update_tipoUnidad\";\n\t}",
"private function displayDone()\n\t{\n\t\tgotoURL(\"/?pUpdate=formSigned\");\n\n\t}",
"private function trashPost() {\n $this->executeScript(\"jQuery('#the-list tr:first-child .row-actions .submitdelete')[0].click()\");\n $this->waitForElement('#message.updated');\n }",
"function inbound_checker_form_submit($form, &$form_state) {\n // FIX: @farhang: Aftering editing an entry, I got redirected to \"E\" path.\n\n $link = new stdClass();\n $link->site_name = $form_state['values']['inbound_checker_site_name'];\n $link->site_address = $form_state['values']['inbound_checker_site_address'];\n $link->expiry = _inbound_checker_mktime($form_state['values']['inbound_checker_site_expiry']);\n $link->price = $form_state['values']['inbound_checker_link_price'];\n if($form_state['values']['inbound_checker_id'] != '') {\n $link->icid = $form_state['values']['inbound_checker_id'];\n }\n\n // Saves the inbound link.\n _inbound_checker_site_save($link);\n\n // Notify.\n drupal_set_message(t('Website entry has been successfully created.'));\n\n // FIX: @farhang: That's not the way to redirect user in this case.\n drupal_goto('admin/reports/inbound-links');\n}",
"function fbunlike_ajax_submit() {\n\t\t$nonce = $_POST['dcv_nonce'];\n\n\t\tif ( !wp_verify_nonce( $nonce, 'dcv_submit_nonce' ) )\n\t\t\twp_die( 'Don\\'t Cheat!' );\n\n\t\t$postID\t= $_POST['postID'];\n\t\t$userID\t\t= $_POST['userID'];\n\t\t$voteType\t= $_POST['voteType'];\n\t\t$voteValue = $_POST['voteValue'];\n\t\t$authorID \t= $_POST['authorID'];\n\t\t$userIP \t= $this->get_the_ip();\n\n\t\tif ( !empty( $postID ) && ( $userID >= 0 ) && !empty( $authorID ) && !empty( $userIP ) ) {\n\t\t\tif ( $this->remove_vote( $postID, $userID, $voteType, $voteValue, $authorID, $userIP ) ) {\n\t\t\t\t$response = $this->get_vote( $postID, $authorID );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response = $this->get_vote( $postID, $authorID );\n\t\t\t}\n\t\t}\n\t\techo $response;\n\t\texit;\n\t}",
"function bmap_assoc_delete_confirm_form_submit($form, &$form_state) {\n $bmapAssoc = $form_state['bmap_assoc'];\n $bmapAssoc->delete();\n drupal_set_message(t('Delete bmap assoc for Bid: %bid , Nid: %nid .', array('%bid' => $bmapAssoc->bid, '%nid' => $bmapAssoc->nid)));\n $form_state['redirect'] = 'admin/structure/bmap_assoc';\n}",
"function ding_navigation_box_plugin_form_submit($form, &$form_state) {\n\t// Nothing yet.\n}",
"function menu_item_delete_form_submit($form, &$form_state) {\n $item = $form['#item'];\n menu_link_delete($item['mlid']);\n $t_args = array('%title' => $item['link_title']);\n drupal_set_message(t('The menu link %title has been deleted.', $t_args));\n watchdog('menu', 'Deleted menu link %title.', $t_args, WATCHDOG_NOTICE);\n $form_state['redirect'] = 'admin/structure/menu/manage/' . $item['menu_name'];\n}",
"public function ajaxUnlinkAction()\r\n {\r\n if (!$this->getRequest()->isXmlHttpRequest()) {\r\n return $this->notFoundAction();\r\n }\r\n\r\n $pupil_id = (int)$this->params()->fromPost('pupil_id');\r\n if (!$pupil_id) {\r\n return new JsonModel(['error' => 'no pupil_id']);\r\n }\r\n\r\n $teacher_id = (int)$this->params()->fromPost('teacher_id');\r\n if (!$teacher_id) {\r\n return new JsonModel(['error' => 'no teacher_id']);\r\n }\r\n\r\n $teacherPupilService = $this->getTeacherPupilService();\r\n $link = $teacherPupilService->getItem([\r\n 'teacher_id' => $teacher_id,\r\n 'pupil_id' => $pupil_id,\r\n ]);\r\n\r\n if ($link) {\r\n $teacherPupilService->delete($link->id);\r\n }\r\n\r\n return new JsonModel([\r\n 'success' => true,\r\n ]);\r\n }",
"public function actionUnlink()\n {\n\n if (Yii::$app->request->isAjax) {\n\n $data = Yii::$app->request->post();\n\n\n if( $data and isset( $data['accounts'] ) ) {\n\n $current_user_id = Yii::$app->user->id;\n foreach ($data['accounts'] as $account_id ) {\n $unlink_account = UserAccount::find()\n ->where( ['user_id' => $current_user_id ] )\n ->andwhere( ['account_id' => $account_id] )\n ->one();\n if($unlink_account){\n $unlink_account->delete();\n }\n\n\n }\n\n return $this->renderPage();\n\n }\n\n\n\n }\n return false;\n }",
"protected abstract function getSubmitAction();",
"protected abstract function getSubmitAction();",
"function advertising_delete_form_submit($form, &$form_state) {\n $advertising = $form_state['advertising'];\n\n advertising_delete($advertising);\n\n drupal_set_message(t('The advertising %name has been deleted.', array('%name' => $advertising->name)));\n watchdog('advertising', 'Deleted advertising %name.', array('%name' => $advertising->name));\n\n $form_state['redirect'] = 'admin/content/advertisings';\n}"
] | [
"0.6317787",
"0.62531054",
"0.6043215",
"0.6007491",
"0.5981881",
"0.59468263",
"0.5858799",
"0.5835047",
"0.5751684",
"0.5736817",
"0.5718413",
"0.5699773",
"0.5681598",
"0.56206053",
"0.5583474",
"0.55776745",
"0.5562802",
"0.55552554",
"0.5544239",
"0.55181867",
"0.5511035",
"0.55053157",
"0.54955447",
"0.54855615",
"0.5480465",
"0.5468826",
"0.54625154",
"0.54482913",
"0.54482913",
"0.5438786"
] | 0.6752515 | 0 |
Form submit for the Meetup delete. | function meetup_login_delete_form_submit($form, &$form_state) {
meetup_login_delete_confirm($form_state['values']['id']);
$form_state['redirect'] = 'admin/config/services/meetup/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function action() {\n\n if (isset($_POST['delete'])) {\n\n $this->_delete();\n\n }else{ // delete needs to be sent or else it will always save, for example when hitting enter on keyboard\n\n $this->_save();\n\n }\n\n }",
"function form_action()\n {\n $swimmer = new SwimTeamSwimmer() ;\n $swimmer->setId($this->get_hidden_element_value('swimmerid')) ;\n $success = $swimmer->deleteSwimmer() ;\n\n if ($success) \n $this->set_action_message('Swimmer successfully deleted.') ;\n else\n $this->set_action_message('Swimmer was not successfully deleted.') ;\n\n return $success ;\n }",
"public function Display_delete_form(){\r\n\r\n echo '<form action=\"' . $_SERVER[\"PHP_SELF\"] . '\" method=\"post\">\r\n <b><font size=\"+1\">Are you sure you want to delete this record?</b></font>';\r\n\r\n echo \"<input type='hidden' name= 'fc' value='\" . $this->GetValue($this->fckeyname) . \"' />\";\r\n echo \"<br><input type='submit' name = 'deleterecord_forsure' value='YES, DELETE RECORD'><br><br>\";\r\n echo \"<input type='hidden' name='\" . $this->keyId_name . \"' value='\" . $this->keyId . \"'></form>\";\r\n\r\n }",
"function micro_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $micro = $form['#micro'];\n $form_state['redirect'] = array('micro/' . $micro->mid . '/delete', array('query' => $destination));\n}",
"function member_form_delete_submit($form, &$form_state) {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n $member = $form['#member'];\n $member_uri = member_uri($member);\n $member_uri_path = $member_uri['path'];\n $form_state['redirect'] = array(\n $member_uri_path . '/delete',\n array('query' => $destination),\n );\n}",
"public function delete() {\n\n $id = $this->request->getParameter(\"actionid\");\n $this->model->delete($id);\n\n // generate view\n $this->redirect(\"psentryreason\");\n }",
"function time_tracker_entry_confirm_delete_submit($form , &$form_state) {\n $entity = $form_state['values']['info']['entity'];\n $uri = $form_state['values']['info']['uri'];\n $user = $form_state['values']['info']['user'];\n $tracked = $form_state['values']['info']['tracked'];\n\n time_tracker_entry_delete($entity);\n\n drupal_set_message(t('The time entry for %name on %title has been deleted.',\n array('%name' => $user->name, '%title' => $tracked->title))\n );\n $form_state['redirect'] = $uri;\n}",
"private function trashPost() {\n $this->executeScript(\"jQuery('#the-list tr:first-child .row-actions .submitdelete')[0].click()\");\n $this->waitForElement('#message.updated');\n }",
"public function actionDeletemetaname()\n {\n SeoMain::model()->findByPk($_POST['id'])->delete();\n }",
"function member_form_delete_confirm_submit($form, &$form_state) {\n if ($form_state['values']['confirm']) {\n $member = member_load($form_state['values']['member_id']);\n member_delete($form_state['values']['member_id']);\n watchdog('member', 'Deleted member \"%label\" (type: @type)', array('@type' => $member->type, '%label' => entity_label('member', $member)));\n\n $type = member_type_get_info($member->type);\n\n drupal_set_message(\n t('The @type %label has been deleted.', array('@type' => $type['name'], '%label' => entity_label('member', $member)))\n );\n }\n\n if (empty($_GET['destination'])) {\n $form_state['redirect'] = 'admin/members';\n }\n\n\n}",
"function asb_scheme_delete_membership_submit($form, &$form_state) {\n $path = $form_state['goto'];\n $membership = $form_state['og_membership'];\n $group_type = $membership->group_type;\n $gid = $membership->gid;\n if(count($path) > 1){\n $goto = $path[1];\n $message = explode('/',$goto);\n $thread_id = $message[2];\n $tag_ids = array(2);\n global $user;\n privatemsg_filter_remove_tags(array($thread_id), $tag_ids, $user);\n }else{\n $goto = $group_type .'/' .$gid .'/' . 'group';\n }\n $membership->delete();\n // $form_state['redirect'] = 'group/' . $membership->group_type . '/' . $membership->gid . '/admin/people';\n $form_state['redirect'] = $goto;\n drupal_set_message(t('The membership was removed.'));\n}",
"public function deleteNemovitostFormSucceeded()\n {\n $id = (int) $this->getParameter('id'); \n \n // smazu vsechny fotky z adresare\n if (is_dir(WWW_DIR . \"/images/auction/\".$id.\"/\"))\n $this->deleteDir(WWW_DIR . \"/images/auction/\".$id.\"/\"); \n \n // smazu vsechny soubory z adresare\n if (is_dir(WWW_DIR . \"/files/auction/\".$id.\"/\"))\n $this->deleteDir(WWW_DIR . \"/files/auction/\".$id.\"/\"); \n \n $this->database->findById('nemovitost', $id)->delete();\n $this->flashMessage('Nemovitost byla smazána.');\n $this->redirect('Homepage:default');\n }",
"public function privacy_meta_html_delete()\n {\n ?>\n <form method=\"post\" action=\"\">\n <div id=\"universal-message-container\">\n <div class=\"options\">\n <p>\n <label><?php _e('Enter User’s Mobile Number', 'wp-sms'); ?></label>\n <br/>\n <input type=\"tel\" name=\"mobile-number-delete\" value=\"\"/>\n <br/>\n <span class=\"description\"><?php _e('Note: You cannot undo these actions.', 'wp-sms'); ?></span>\n </p>\n </div><!-- #universal-message-container -->\n <?php submit_button( __('Delete'), 'primary', 'submit', false ); ?>\n </div>\n <input type=\"hidden\" name=\"wp_sms_nonce_privacy\" value=\"<?php echo $this->wp_nounce; ?>\">\n </form>\n <div class=\"clear\"></div>\n <style>\n\n </style>\n <?php\n }",
"function impression_delete_form_submit($data) {\n $impression = new Impression();\n $delete = $impression->delete($data['id']);\n if ($delete['code']==200) {\n return $data['id'];\n } else {\n return FALSE;\n }\n}",
"public function delAfterSubmit() {\n\t\t$this->registerAfterSubmit ( \"del\" );\n\t}",
"public function delete()\n {\n $this->submissions()->each->delete();\n\n FormModel::where('handle', $this->handle())->delete();\n\n FormDeleted::dispatch($this);\n }",
"function _reply_complete_delete_action_form_submit($form, &$form_states) {\n $reply = $form_states['build_info']['args'][0];\n $value = finditreply::delete($reply['id'], $reply);\n drupal_set_message(t('Review have been Deleted'));\n $commands[] = ctools_ajax_command_reload();\n print ajax_render($commands);\n exit;\n}",
"function deletecomponentform_submit(Pieform $form, $values) {\n global $SESSION, $bookset, $componentid;\n\n $bookset->deletecomponent($componentid);\n $SESSION->add_ok_msg(get_string('componentdeletedsuccessfully', 'artefact.bookset'));\n\n redirect('/artefact/bookset/bookset.php?id='.$bookset->get('id'));\n}",
"function _reply_action_delete_form_submit($form, &$form_states) {\n global $user;\n $reply = $form_states['build_info']['args'][0];\n\n $values['reason'] = $form_states['values']['reason'];\n $values['action'] = 'deleted';\n $values['report_to_findit'] = $form_states['values']['report_to_findit'];\n $values['value'] = 1;\n $review = finditreply::update($reply['id'], $values);\n db_insert('reply_extra_info')\n ->fields(array('rid', 'deleted_date', 'deleted_by'))\n ->values(array(\n 'rid' => $reply['id'],\n 'deleted_date' => time(),\n 'deleted_by' => $user->uid,\n ))\n ->execute();\n\n // Send mail to merchant for unpunlish of review by findit user.\n if ($form_states['values']['report_to_findit'] == TRUE) {\n // findit_reply_send_mail_merchant_comment_status($form_states['values']['reply']);\n report_to_findit_unpublish_mail_to_merchant($review);\n }\n drupal_set_message(t('Review have been rejected.'));\n $commands[] = ctools_ajax_command_reload();\n print ajax_render($commands);\n exit;\n}",
"function advertising_delete_form_submit($form, &$form_state) {\n $advertising = $form_state['advertising'];\n\n advertising_delete($advertising);\n\n drupal_set_message(t('The advertising %name has been deleted.', array('%name' => $advertising->name)));\n watchdog('advertising', 'Deleted advertising %name.', array('%name' => $advertising->name));\n\n $form_state['redirect'] = 'admin/content/advertisings';\n}",
"function election_form_delete_confirm_submit($form, &$form_state) {\n if ($form_state['values']['confirm']) {\n $election = election_load($form_state['values']['election_id']);\n\n election_delete($form_state['values']['election_id']);\n watchdog('election', 'Deleted election \"%title\" (type: @type)', array('@type' => $election->type, '%title' => $election->title));\n\n $type = _election_type_get_info($election->type);\n\n drupal_set_message(\n t('The @type %title has been deleted.', array('@type' => $type['name'], '%title' => $election->title))\n );\n }\n if (empty($_GET['destination'])) {\n $form_state['redirect'] = 'elections';\n }\n}",
"public function confirmDeleteForm(){\n\t$loggedIn = CUser::adminIsAuthenticated();\n\t$htmlcode=null;\n\tif ($loggedIn) {\n\t\t// Checka att indata, id, är ok\n\t\t$id = isset($_GET['id']) ? strip_tags($_GET['id']) : null;\n\t\tis_numeric($id) or die('Check: Id must be numeric.');\n\t\t$title = isset($_GET['title']) ? strip_tags($_GET['title']) : null;\n\t\t\n\t\t$htmlcode .= <<<EOD\n\t\t<form method=\"post\">\n\t\t<fieldset>\n\t\t<legend>Ta bort innehåll</legend>\n\t\t<label>Titel: {$title}</label><br>\n\t\t<input type=\"hidden\" name=\"id\" size=\"45\" value=\"{$id}\">\n\t\t<button type=\"submit\" name=\"tabort\">Ta bort</button>\n\t\t</fieldset>\n\t\t</form>\nEOD;\n\t\t$htmlcode .= \"<p><br><a href='blog.php'>Visa alla</a></p>\";\n\t} else {\n\t$htmlcode = \"<b>Du måste logga in!</b>\";\n\t}\n\treturn $htmlcode;\n }",
"function forena_edit_delete_submit($form, &$form_state) {\n $link = 'reports/' . $form_state['values']['name_in'] ;\n $destination = '';\n if (isset($_REQUEST['destination'])) {\n $destination = drupal_get_destination();\n unset($_REQUEST['destination']);\n }\n $form_state['redirect'] = array('path' => $link . '/delete', 'query' => array('destination' => $destination));\n}",
"public function deleteEloquaSubmittedData();",
"function bat_booking_form_submit_delete(&$form, &$form_state) {\n if (isset($form_state['ajax'])) {\n bat_booking_delete($form_state['bat_booking']);\n drupal_set_message(t('The booking has been removed'));\n $form_state['booking_deleted'] = TRUE;\n }\n else {\n $destination = array();\n if (isset($_GET['destination'])) {\n $destination = drupal_get_destination();\n unset($_GET['destination']);\n }\n\n $form_state['redirect'] = array('admin/bat/config/booking/manage/' . $form_state['bat_booking']->booking_id . '/delete', array('query' => $destination));\n }\n}",
"public function delete()\n {\n $this->sendDelete('');\n }",
"function thumbwhere_contentupload_delete_form_submit($form, &$form_state) {\n $thumbwhere_contentupload = $form_state['thumbwhere_contentupload'];\n\n thumbwhere_contentupload_delete($thumbwhere_contentupload);\n\n drupal_set_message(t('The thumbwhere_contentupload %name has been deleted.', array('%name' => $thumbwhere_contentupload->pk_contentupload)));\n watchdog('thumbwhere_contentupload', 'Deleted thumbwhere_contentupload %name.', array('%name' => $thumbwhere_contentupload->pk_contentupload));\n\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_contentuploads';\n}",
"function delete_button_post($conn){\n echo \"<input type='submit' name='delete_record_post' value='Kustuta kirje'>\";\n if(isset($_POST['delete_record_post'])){\n delete_record_post($conn);\n }\n}",
"function fileshare_type_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/structure/fileshare_types/manage/' . $form_state['fileshare_type']->type . '/delete';\n}",
"function readytalk_components_form_delete_submit($form = array(), &$form_state = array()) {\n $node = $form['#node'];\n db_delete('readytalk_webform')\n ->condition('nid', $node->nid)\n ->execute();\n\n drupal_set_message(t('Readytalk settings for this webform have been deleted.'), 'status');\n}"
] | [
"0.69833773",
"0.68873006",
"0.6741714",
"0.6683474",
"0.66430295",
"0.6624376",
"0.66238844",
"0.6596566",
"0.65790534",
"0.6579047",
"0.65654474",
"0.6513671",
"0.6502698",
"0.6499979",
"0.6491641",
"0.6487373",
"0.64750856",
"0.6458931",
"0.6453053",
"0.64278394",
"0.6423895",
"0.6406722",
"0.63976073",
"0.6382293",
"0.63761586",
"0.63682896",
"0.63607556",
"0.6344585",
"0.6344404",
"0.6339494"
] | 0.7120983 | 0 |
This form was built in response to the oauth return request from Meetup. | function meetup_login_oauth_callback_form($form, &$form_state) {
$secret_token = variable_get('meetup_login_secret_information', '');
$form['#post']['oauth_token'] = $secret_token;
$form['oauth_token'] = array(
'#type' => 'hidden',
'#default_value' => $secret_token,
);
return $form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function page_fields() {\n\t\techo '<input type=\"hidden\" name=\"consumer\" value=\"' . absint( $this->consumer->ID ) . '\" />';\n\t\techo '<input type=\"hidden\" name=\"oauth_token\" value=\"' . esc_attr( $this->token['key'] ) . '\" />';\n\t\twp_nonce_field( 'json_oauth1_authorize' );\n\t}",
"public function process_oauth() {\n $config = $this->config('sumup.registered_app_settings');\n $encryption_service = $this->encryption_service;\n $sumup = $this->sumup_auth_service;\n // set field before processing authentication request.\n $access_flow = $config->get('sumup_client_credentials_flow');\n\n if(!$access_flow) {\n $payload = $sumup->requestScopeAccess(); \n } else {\n $payload = $sumup->clientCredentialsFlow();\n }\n\n $messenger = \\Drupal::messenger();\n $messenger->addMessage($payload);\n \n return;\n }",
"function client_credential_post() {\n $format = $this->response->get_default_format();\n $this->oauth->client_credentials($format);\n }",
"function meetup_login_oauth_callback_form_submit($form, &$form_state) {\n global $user;\n $uid = $user->uid;\n $account = user_load($uid);\n $mail = $account->mail;\n $response = $form_state['response'];\n meetup_login_account_save($response, TRUE);\n $form_state['programmed'] = FALSE;\n if ($mail == NULL) {\n $destination = '/user/' . $uid . '/edit';\n $query = array('meetup' => 'useredit');\n }\n else {\n $destination = '/user/' . $uid . '/view';\n $query = array('meetup' => 'userview');\n }\n $form_state['redirect'] = array(\n $destination,\n array(\n 'query' => $query,\n ),\n );\n}",
"public function outputRequestToken()\n {\n $token \t\t\t= CTOAuth::generateToken();\n $tokenSecret \t= CTOAuth::generateToken();\n $requestToken \t= new Tokens();\n\n $requestToken->consumer_key = $this->provider->consumer_key;\n $requestToken->token = $token;\n $requestToken->token_secret = $tokenSecret;\n $requestToken->callback_url = Yii::app()->request->getParam('oauth_callback');\n $requestToken->timestamp = time();\n $requestToken->scope = $_GET['scope'];\n\n if(!$requestToken->save())\n CVarDumper::dump($requestToken->errors,10,true);\n\n echo \"oauth_token=$token&oauth_token_secret=$tokenSecret&oauth_callback_confirmed=true\";\n }",
"public function setOauth()\n {\n if(!empty($_POST))\n {\n $provider = $this->post->provider;\n $oauth = array($provider => helper::jsonEncode($_POST));\n $result = $this->loadModel('setting')->setItems('system.common.oauth', $oauth);\n if($result) $this->send(array('result' => 'success', 'message' => $this->lang->setSuccess));\n $this->send(array('result' => 'fail', 'message' => $this->lang->fail));\n }\n $this->view->setting = array();\n\n if(!empty($this->config->site->yangcong))\n {\n $this->view->setting = json_decode($this->config->site->yangcong);\n }\n\n $this->view->title = $this->lang->site->setOauth;\n $this->display();\n }",
"function get_sumup_token($fields) {\n // need to get an auth token first using the TOKEN_URL\n $clientid=$fields['client_id']['g_value'];\n $clientse=$fields['client_secret']['g_value'];\n $granttype=\"client_credentials\";\n $authurl=$fields['token_url']['g_value']; \n /* echo \"<pre>\"; print_r($clientid); print_r($clientse); print_r($authurl); echo \"</pre>\"; */\n $tokenpayload=Array('client_id'=>$clientid,'client_secret'=>$clientse,'grant_type'=>$granttype);\n $authresponse=sumup_query($authurl, $tokenpayload, \"=\", \"POST\",\"\");\n // do we have access_token?\n $dresponse=json_decode($authresponse);\n /* echo \"<pre>\"; print_r($dresponse); echo \"</pre>\"; */\n $accesstoken=$dresponse->access_token; // this worked to here \n return $accesstoken;\n}",
"function meetup_login_oauth_callback_form_validate($form, &$form_state) {\n $libpath = libraries_get_path('meetup_login') . '/Meetup.php';\n $localpath = variable_get('meetup_login_local_path');\n $path = $localpath . '/Meetup.php';\n if (file_exists($path)) {\n require \"$path\";\n }\n else {\n require \"$libpath\";\n }\n $secret_token = variable_get('meetup_login_secret_information', '');\n if (isset($secret_token)) {\n $form_state['meetup_oauth'] = $secret_token;\n unset($_SESSION['meetup_access_token']);\n }\n else {\n form_set_error('oauth_token', t('Invalid Meetup OAuth request'));\n }\n $accesstoken = $form_state['meetup_oauth'];\n $connection = new MeetupOAuth2Connection($accesstoken);\n if ($accesstoken) {\n $url_self = 'https://api.meetup.com/2/member/self?access_token=' . $accesstoken;\n $page = file_get_contents($url_self);\n $results = json_decode($page, TRUE);\n $memberid = $results['id'];\n $group_url_name = variable_get('meetup_login_group_url');\n $members = new MeetupMembers($connection);\n $member_profile = $members->getMembers(array('member_id' => $memberid));\n $groups = $members->getProfiles(array('group_urlname' => $group_url_name, 'member_id' => $memberid));\n $group_photo_link = isset($groups[0]['photo_url']) ? $groups[0]['photo_url'] : '';\n $profile_photo_link = isset($member_profile[0]['photo']) ? $member_profile[0]['photo']['photo_link'] : '';\n $name = array(\"name\" => $results['name']);\n $upper_country = $results['country'];\n $upper_country = strtoupper($upper_country);\n $country = array('country' => $upper_country);\n $city = array('city' => $results['city']);\n $photo_url = isset($group_photo_link) ? $group_photo_link : $profile_photo_link;\n $photo_url = array('photo_url' => $photo_url);\n $twitter_identifier = array('twitter' => $results['other_services']['twitter']['identifier']);\n $flicker_identifier = array('flickr' => $results['other_services']['flickr']['identifier']);\n $facebook_identifier = array('facebook' => $results['other_services']['facebook']['identifier']);\n $memberid = array('member_id' => $memberid);\n $accesstoken = array('oauth_token' => $accesstoken);\n $response = array_merge($name, $country, $city, $photo_url, $twitter_identifier, $flicker_identifier, $facebook_identifier, $memberid, $accesstoken);\n $form_state['response'] = $response;\n }\n else {\n form_set_error('oauth_token', t('Invalid Meetup OAuth request'));\n }\n}",
"public function oauth()\n {\n return OauthHelper::authed($this->oauth_token, $this->oauth_token_secret);\n }",
"public function showOAuthDetails() {\n// print_r($this->_oauthData);\n// die(\"Line 113\");\n if (is_object($this->_oauthData)) {\n $var_retstr = '<h2>Hello ' . $this->_oauthData->name . '</h2>' .\n '<img src=\"' . $this->_oauthData->imageUrl . '\">';\n $gravatar_link = 'http://www.gravatar.com/avatar/' . md5($this->_oauthData->email) . '?s=32';\n $var_retstr .= '<img src=\"' . $gravatar_link . '\" />';\n } else\n $var_retstr = '';\n \n $this->$this->_html['oauthHTML']=$var_retstr;\n return $var_retstr;\n }",
"public function hiddenEndpointFieldsCallback() {\n \t$viewData = array();\n \tif ($this->endpoints) {\n \t\treset($this->endpoints);\n \t\t$first_key = key($this->endpoints);\n \t\t$endpoint = (array)json_decode($this->endpoints[$first_key], true);\n \t\t$viewData['endpointName'] = (isset($endpoint['name']) ? esc_attr($endpoint['name']) : \"\");\n \t\t$viewData['authentication_method'] = $endpoint['authentication_method'];\n\n \t}\n \t\n \t$ssl_trust = false;\n \t$clientAccess = true;\n \t$server_type = '';\n \t$basic_auth_method = '';\n \t$endpointVersion = '';\n \t$callbackURL = '';\n \t$require_sign_on = true;\n \tif ($this->endpoints) {\n \t\tforeach ($this->endpoints as $val) {\n \t\t\t$endpoint = (array)json_decode($val, true);\n \t\t\tif ($endpoint['selected']) {\n \t\t\t\tif (isset($endpoint['allow_client_access']) && $endpoint['allow_client_access'] == 'allow_client_access') {\n \t\t\t\t\t$clientAccess = true;\n \t\t\t\t} else {\n\t\t\t\t\t\t$clientAccess = false;\n\t\t\t\t\t}\n \t\t\t\tif (isset($endpoint['force_ssl_trust']) && $endpoint['force_ssl_trust'] == 'force_ssl_trust') {\n \t\t\t\t\t$ssl_trust = true;\n \t\t\t\t}\n \t\t\t\tif (isset($endpoint['server_type'])) {\n \t\t\t\t\t$server_type = $endpoint['server_type'];\n \t\t\t\t}\n \t\t\t\tif (isset($endpoint['require_sign_on']) && $endpoint['require_sign_on'] != 'require_sign_on') {\n \t\t\t\t\t$require_sign_on = false;\n \t\t\t\t}\n \t\t\t\tif (isset($endpoint['basic_auth_method'])) {\n \t\t\t\t\t$basic_auth_method = $endpoint['basic_auth_method'];\n \t\t\t\t}\n \t\t\t\tif (isset($endpoint['oauth2_callback_url'])) {\n \t\t\t\t\t$callbackURL = $endpoint['oauth2_callback_url'];\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\t$endpointVersion = (isset($endpoint['endpoint_version']) ? $endpoint['endpoint_version'] : \"\");\n \t\t\t}\n \t\t}\n \t}\n\n \t$viewData['callback_url'] = $callbackURL;\n \t$viewData['basic_auth_method'] = $basic_auth_method;\n \t$viewData['server_type'] = $server_type;\n \t$viewData['force_ssl_trust'] = $ssl_trust;\n \t$viewData['allow_client_access'] = $clientAccess;\n \t$viewData['endpoint_version'] = $endpointVersion; \n \t$viewData['require_sign_on'] = $require_sign_on;\n \t$this->loadView('wp-settings/hiddenEndpointFields', $viewData);\n }",
"function oauth_str() {\r\n\t$chr = curl_init ( OAUTH_CALLBACK_URL );\r\n\tcurl_setopt ( $chr, CURLOPT_POST, TRUE );\r\n\tcurl_setopt ( $chr, CURLOPT_POSTFIELDS, user_pw () );\r\n\tcurl_setopt ( $chr, CURLOPT_RETURNTRANSFER, TRUE );\r\n\tcurl_setopt ( $chr, CURLOPT_FOLLOWLOCATION, TRUE );\r\n\t$oauthStr = curl_exec ( $chr );\r\n\tcurl_close ( $chr );\r\n\treturn trim ( strip_tags ( $oauthStr ) );\r\n}",
"private function composeDisputeResponseForm()\n {\n View::composer(\n\n 'admin.dispute._response',\n\n function($view)\n {\n $view->with('statuses', ListHelper::dispute_statuses());\n }\n );\n }",
"public function getResponseType()\n {\n return 'credentials';\n }",
"static function url_auth()\n {\n $js = '';\n $js .= \"const point = Cataviz.chart.form.lastElementChild;\\n\";\n $js .= \"let el = null;\\n\";\n $terms = http::pars('auth');\n $sql = \"SELECT * FROM auth WHERE id = ?\";\n $stmt = Cataviz::prepare($sql);\n foreach($terms as $auth_id) {\n $stmt->execute([$auth_id]);\n $auth_row = $stmt->fetch();\n if (!$auth_row) continue;\n $label = addslashes(Cataviz::auth_label($auth_row));\n $js .= \"el = Suggest.input('auth', '$auth_id', '$label', Cataviz.chartUp);\\n\";\n $js .= \"point.parentNode.insertBefore(el, point);\\n\";\n }\n return $js;\n }",
"function meetup_login_token_callback() {\n $secret_token = variable_get('meetup_login_secret_information', '');\n if (isset($_GET['denied']) || empty($secret_token)) {\n drupal_set_message(t('The connection to Meetup failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Meetup account.\n drupal_goto('admin/config/services/meetup');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $secret_token;\n drupal_form_submit('meetup_login_oauth_callback_form', $form_state);\n}",
"public function tokenProtectForm()\n {\n return \"<input type=\\\"hidden\\\" id =\\\"OLIF_TOKEN\\\" name=\\\"OLIF_TOKEN\\\" value=\\\"\" . $this->getSessionToken() . \"\\\" />\";\n }",
"public function getOauthCallback();",
"public function aai_twitter_system_setting_form() { //out($_SESSION); die('functionnnnnn');\n $airport = strtolower($_SESSION['aai_api_airportcode']);\n $api_for = $_SESSION['api_for'];\n print_r($_SESSION);\n unset($_SESSION['aai_api_airportcode']);\n unset($_SESSION['api_for']);\n\n if ($airport != '') {\n // fields for Twitter API Confugrations\n $form['aai_'.$airport.'_twitter_oauth_access_token'] = array(\n '#type' => 'textfield',\n '#title' => t('Access Token'),\n '#description' => t('Please Provide Oauth Access Token.'),\n '#size' => 40,\n '#default_value' => variable_get('aai_'.$airport.'_twitter_oauth_access_token', FALSE),\n '#required' => TRUE,\n );\n $form['aai_'.$airport.'_twitter_oauth_access_token_secret'] = array(\n '#type' => 'textfield',\n '#title' => t('Access Token Secret'),\n '#description' => t('Please Provide Oauth Access Token Secret.'),\n '#size' => 40,\n '#default_value' => variable_get('aai_'.$airport.'_twitter_oauth_access_token_secret', FALSE),\n '#required' => TRUE,\n );\n $form['aai_'.$airport.'_twitter_consumer_key'] = array(\n '#type' => 'textfield',\n '#title' => t('Consumer Key'),\n '#description' => t('Please Provide Consumer Key.'),\n '#size' => 40,\n '#default_value' => variable_get('aai_'.$airport.'_twitter_consumer_key', FALSE),\n '#required' => TRUE,\n );\n $form['aai_'.$airport.'_twitter_consumer_secret'] = array(\n '#type' => 'textfield',\n '#title' => t('Consumer Secret'),\n '#description' => t('Please Provide Consumer Secret.'),\n '#size' => 40,\n '#default_value' => variable_get('aai_'.$airport.'_twitter_consumer_secret', FALSE),\n '#required' => TRUE,\n );\n\n $form['#submit'] = array('submit_social_api_form');\n return system_settings_form($form);\n\n //return $form;\n } else { die('elseee');\n drupal_goto(\"/administer/api/$api_for\");\n }\n }",
"function callback()\n\t{\n\t\tif(isset($_REQUEST['oauth_token']) && isset($_REQUEST['oauth_verifier'])) {\t\t\t\n\t\t\t$access_token = $this->freshbooks_oauth->getAccessToken($_REQUEST['oauth_token'], $_REQUEST['oauth_verifier']);\n\n\t\t\t$this->session->set_userdata('oauth_token', $access_token['oauth_token']);\n\t\t\t$this->session->set_userdata('oauth_token_secret', $access_token['oauth_token_secret']);\n\t\t\tredirect('/freshbooks/demo');\n\t\t}\n\t}",
"protected function getRegistrationForm() {\n\t\n\t\t$action = $this->getAPIDomain() . self::URL_PATH_ACTION . '/' . self::ACTION_INITIALIZE;\n\t\t$action = htmlspecialchars($action);\n\t\n\t\t$content = $this->getInputHidden(self::FIELD_PROJECT_URL, $this->getProjectUrl())\n\t\t. $this->getInputHidden(self::FIELD_PROJECT_CALLBACK_URL, $this->getCallbackUrl())\n\t\t. $this->getInputHidden(self::FIELD_PROJECT_DATA, json_encode($this->getProjectData()))\n\t\t. $this->getInputHidden(self::FIELD_COMMUNICATION_URL, $this->getCommunicationUrl())\n\t\t. $this->getInputHidden(self::FIELD_TEMP_KEY, $this->getTempKey());\n\t\n\t\treturn sprintf(self::TEMPLATE_FORM_POST, $action, $content);\n\t\n\t}",
"public function create_auth_url() {\r\n\t\t$params = array(\r\n\t\t\t'response_type' => 'code',\r\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\r\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\r\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\r\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\r\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\r\n\t\t);\r\n\r\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\r\n\t}",
"abstract public function authenticationForm( \\IPS\\Member $member, \\IPS\\Http\\Url $url );",
"function home()\n{\n global $CLIENT_ID;\n global $STATE;\n global $URL;\n\n $link = \"http://localhost:7070/auth?response_type=code&client_id={$CLIENT_ID}&scope=['email']&state={$STATE}&redirect_uri={$URL}/cb\";\n echo \"<a href=\\\"{$link}\\\">Connect with oauth-server</a>\";\n}",
"static function nev_get_form_data(){\n $nonce = $_POST['nonce'];\n if( !wp_verify_nonce($nonce, 'nev_nonce') ){\n header(\"HTTP/1.0 403 Security Check.\");\n die('Security Check');\n }\n \n \tif (!is_user_logged_in()){\n header(\"HTTP/1.0 403 Security Check.\");\n exit;\n\t\t\t}\n \t\n \t$result = nev_core::get_last_video();\n \t$html5_encoding = (bool) get_site_option( 'nev_html5_encoding' );\n \techo json_encode( array( 'data' => $result, 'bool' => $html5_encoding));\n \texit;\n }",
"public function getSignUpForm() {\n $ret = array();\n\n //get the possible statuses (m4w...)\n $sql = $this->_db->prepare(\"SELECT * FROM statuses ORDER BY ID ASC\");\n $sql->execute();\n if($sql->rowCount() > 0) {\n $statuses = $sql->fetchAll(PDO::FETCH_ASSOC);\n\n $i = 0;\n\n foreach($statuses AS $s) {\n\n $status[$i] = $s;\n\n $i++;\n\n } \n }\n\n $ret['statuses'] = $status;\n\n //get the metro areas\n $sql = $this->_db->prepare(\"SELECT * FROM metro_areas ORDER BY metro_area ASC\");\n $sql->execute();\n if($sql->rowCount() > 0) {\n $metros = $sql->fetchAll(PDO::FETCH_ASSOC);\n\n $i = 0;\n\n foreach($metros AS $m) {\n\n $metro[$i] = $m;\n\n $i++;\n\n } \n }\n\n $ret['metros'] = $metro;\n\n return $ret;\n\n }",
"private function set_oauth_hash()\r\n {\r\n $time = time();\r\n $oauth_hash = array\r\n (\r\n 'oauth_consumer_key' => $this->consumer_key,\r\n 'oauth_nonce' => $time,\r\n 'oauth_signature_method' => self::TWITTER_OAUTH_SIGNATURE_METHOD,\r\n 'oauth_timestamp' => $time,\r\n 'oauth_token' => $this->access_token,\r\n 'oauth_version' => self::TWITTER_OAUTH_VERSION\r\n );\r\n return http_build_query($oauth_hash);\r\n }",
"function ajax_fb_save_keys() {\n if (current_user_can('administrator')) {\n if (!self::is_mu()) {\n update_option(self::OPTION_API_KEY, $_REQUEST['api_key']);\n update_option(self::OPTION_APP_SECRET, $_REQUEST['app_secret']);\n }\n echo self::facebook()->getLoginUrl(array(\n 'redirect_uri' => $_REQUEST['current_url'],\n 'scope' => 'read_stream,publish_actions,manage_pages,share_item'\n ));\n \n } else {\n header('Status: 403 Not Allowed');\n }\n exit;\n }",
"public static function printAuthInput(){\n\t\techo sprintf(\"<input type=\\\"hidden\\\" name=\\\"auth_token\\\" value=\\\"%s\\\">\", htmlspecialchars($_SESSION[\"user\"][\"auth_token\"]));\n\t}",
"public function _settings_section_api_setting_form()\n\t{\n\t\t_e('Please enter your Kayako API Key, Secret Key, Kayako URL for further connection !', 'kayako');\n\t}"
] | [
"0.6538683",
"0.61204165",
"0.5951125",
"0.58802813",
"0.579289",
"0.57250667",
"0.5512651",
"0.5448431",
"0.5430846",
"0.54254377",
"0.54178315",
"0.5388932",
"0.5380815",
"0.53688365",
"0.53528494",
"0.53435886",
"0.5342889",
"0.5326987",
"0.53193897",
"0.53111213",
"0.5301117",
"0.5300068",
"0.5278456",
"0.5274258",
"0.5255912",
"0.52487916",
"0.5242766",
"0.5242701",
"0.52135503",
"0.5207983"
] | 0.65243775 | 1 |
Form submit for the Meetup_login_oauth_callback. | function meetup_login_oauth_callback_form_submit($form, &$form_state) {
global $user;
$uid = $user->uid;
$account = user_load($uid);
$mail = $account->mail;
$response = $form_state['response'];
meetup_login_account_save($response, TRUE);
$form_state['programmed'] = FALSE;
if ($mail == NULL) {
$destination = '/user/' . $uid . '/edit';
$query = array('meetup' => 'useredit');
}
else {
$destination = '/user/' . $uid . '/view';
$query = array('meetup' => 'userview');
}
$form_state['redirect'] = array(
$destination,
array(
'query' => $query,
),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function meetup_login_oauth_callback_form($form, &$form_state) {\n $secret_token = variable_get('meetup_login_secret_information', '');\n $form['#post']['oauth_token'] = $secret_token;\n $form['oauth_token'] = array(\n '#type' => 'hidden',\n '#default_value' => $secret_token,\n );\n return $form;\n}",
"function meetup_login_token_callback() {\n $secret_token = variable_get('meetup_login_secret_information', '');\n if (isset($_GET['denied']) || empty($secret_token)) {\n drupal_set_message(t('The connection to Meetup failed. Please try again.'), 'error');\n global $user;\n if ($user->uid) {\n // User is logged in, was attempting to OAuth a Meetup account.\n drupal_goto('admin/config/services/meetup');\n }\n else {\n // Anonymous user, redirect to front page.\n drupal_goto('<front>');\n }\n }\n $form_state['values']['oauth_token'] = $secret_token;\n drupal_form_submit('meetup_login_oauth_callback_form', $form_state);\n}",
"function submit(){\n\t\t$this->form_validation->set_rules('user_name', 'Username', 'required');\n\t\t$this->form_validation->set_rules('password', 'Password', 'callback_password_check|required');\n\t\tif ($this->form_validation->run($this) == FALSE){\n\t\t\t$this->login();\n\t\t}else{\n\t\t\t$username = $this->input->post('user_name', TRUE);\n\t\t\t$this->_doLogin($username);\n\t\t}\n\t}",
"public function loginform() {\n echo \"\\t<p>\\n\";\n echo \"\\t\\t<button type=\\\"button\\\" id=\\\"btn_twoauth\\\" class=\\\"button button-primary button-small\\\" style=\\\"float:none;width:100%;margin-bottom:8px;\\\">\". __('Get TwoAuth Token', 'twoauth') .\"</button>\\n\";\n echo \"\\t</p>\\n\";\n echo \"\\t<p>\\n\";\n echo \"\\t\\t<label for=\\\"user_twoauth\\\">\". __('TwoAuth Token', 'twoauth') .\"<br>\";\n echo \"\\t\\t<input type=\\\"text\\\" name=\\\"user_twoauth\\\" id=\\\"user_twoauth\\\" class=\\\"input\\\" value=\\\"\\\" size=\\\"20\\\"></label>\\n\";\n echo \"\\t</p>\\n\";\n }",
"function yubikey_login_form_user_yubikey_login_submit($form, &$form_state) {\n $op = $form_state['input']['op'];\n $account = $form['#user'];\n $yubikey_state = yubikey_login_form_yubikey_state_for_account($account);\n\n if ($op == t('Create backup codes') || $op == t('Create new backup codes')) {\n yubikey_login_form_backup_codes_form_submit($form, $form_state, $yubikey_state);\n }\n elseif ($op == t('Save credentials') || $op == t('Create new account')) {\n yubikey_login_form_otp_credentials_form_submit($form, $form_state, $yubikey_state);\n }\n elseif ($op == t('Clear credentials...')) {\n yubikey_login_form_user_yubikey_login_clear_credentials_submit($form, $form_state, $yubikey_state);\n }\n}",
"public function loginSubmitAction(): void\n {\n if (!$this->isPost()) {\n header('Location: /');\n return;\n }\n\n if (!isset($_POST['email'], $_POST['password'])) {\n // set error message\n header('Location: /user/login');\n return;\n }\n\n $user = User::getOne('email', $_POST['email']);\n\n if (!$user->getId() || !password_verify($_POST['password'], $user->getPassword())) {\n // set error message\n header('Location: /user/login');\n return;\n }\n\n // todo session and logout\n header('Location: /');\n }",
"public function login() {\n\t\t$form = $this->Form();\n\t\t\n\t\t$twitterApp = TwitterApp::get()->first();\n\t\tif(!$twitterApp || !$twitterApp->EnableTwitterLogin) {\n\t\t\t$form->sessionMessage(\"Twitter Login is disabled.\", \"bad\");\n\t\t} else {\n\t\t\tif($member = Member::currentUser())\n\t\t\t\t$member->logOut();\n\n\t\t\t$twitter = $twitterApp->getTwitter();\n\t\t\tif($twitter) {\n\t\t\t\t$twitter->setOAuthCallback(Director::absoluteURL(Controller::join_links(\"twitter\", \"login\")));\n\n\t\t\t\t$request = Session::get(\"Twitter.Request\");\n\t\t\t\tif($request) {\n\t\t\t\t\t$twitter->setRequest(unserialize($request));\n\t\t\t\t\tSession::clear(\"Twitter.Request\");\n\t\t\t\t} else {\n\t\t\t\t\t$request = $twitter->getRequestToken();\n\t\t\t\t\tif($request) {\n\t\t\t\t\t\tSession::set(\"Twitter.Request\", serialize($request));\n\t\t\t\t\t\treturn $this->redirect($twitter->getLoginURL());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Check to see if we have our access tokens stored in the db.\n\t\t\t\tif ($access = $twitter->getAccessToken()) {\n\t\t\t\t\t$user = $twitter->getUser();\n\t\t\t\t\tif($user) {\n\t\t\t\t\t\t// The twitter user is logged in. Find their account.\n\t\t\t\t\t\t$member = Member::get()->filter(\"TwitterUserID\", $user['id_str'])->first();\n\t\t\t\t\t\tif($member) {\n\t\t\t\t\t\t\t$member->logIn();\n\t\t\t\t\t\t\t$form->sessionMessage(\"You have logged in using Twitter.\", \"good\");\n\t\t\t\t\t\t\t$this->extend(\"onAfterTwitterLogin\", $member);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$form->sessionMessage(\"Unable to find your account.\", \"bad\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$form->sessionMessage(\"Unable to fetch your Twitter account.\", \"bad\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$form->sessionMessage(\"Unable to obtain access to Twitter.\", \"bad\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Extend Failed twitter login\n\t\tif(!Member::currentUser()) $this->extend(\"onAfterFailedTwitterLogin\");\n\n\t\treturn $this->renderWith(array(\"TwitterController\", \"Page\", \"Controller\"));\n\t}",
"public function login() {\n\n\t\tJavaScript::addScript('form');\n\t\tCss::add('form');\n\n\t\t$this->nest('accounts.login', ['url_redirect' => Session::get('url_redirect')]);\n\t}",
"public function loginSubmitAction() {\n $username = $_POST['username'];\n $password = $_POST['password'];\n\n // First, we try to log in the user.\n if(UserAuth::login($username, $password)) {\n // if there are no errors, redirect the user to appropriate employee/admin home page.\n if (UserAuth::user()->role == 'employee') {\n header(\"Location: index.php?controller=vacation&action=request\");\n } else if (UserAuth::user()->role == 'admin') {\n header(\"Location: index.php?controller=vacation&action=approve\");\n }\n } else {\n // if there are errors, redirect back to login page and show error to user\n header(\"Location: index.php?controller=user&action=login&error=true\");\n }\n }",
"public function demo_login()\n\t{\n\t\tif ($code = Arr::get($_REQUEST, 'code'))\n\t\t{\n\t\t\t// We will need a callback URL for the user to return to\n\t\t\t$callback = $this->request->url(TRUE);\n\n\t\t\t// Add the callback URL to the consumer\n\t\t\t$this->client->callback($callback);\n\n\t\t\t// Exchange the authorization code for an access token\n\t\t\t$token = $this->provider->access_token($this->client, $code);\n\n\t\t\t// Store the access token\n\t\t\t$this->session->set($this->key('access'), $token);\n\n\t\t\t// Refresh the page to prevent errors\n\t\t\t$this->request->redirect($this->request->uri());\n\t\t}\n\n\t\tif ($this->token)\n\t\t{\n\t\t\t// Login succesful\n\t\t\t$this->content = Debug::vars('Access token granted:', $this->token);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We will need a callback URL for the user to return to\n\t\t\t$callback = $this->request->url(TRUE);\n\n\t\t\t// Add the callback URL to the consumer\n\t\t\t$this->client->callback($callback);\n\n\t\t\t// Get the login URL from the provider\n\t\t\t$url = $this->provider->authorize_url($this->client);\n\n\t\t\t// Redirect to the twitter login page\n\t\t\t$this->content = HTML::anchor($url, \"Login to {$this->api}\");\n\t\t}\n\t}",
"public function getPostLogin()\n {\n $title = \"A login page\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $form = new LoginForm($this->di);\n\n $form->check();\n\n $data = [\n \"content\" => $form->getHTML(),\n ];\n\n $view->add(\"login/login\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"function meetup_login_unlink_form_submit($form, &$form_state) {\n meetup_login_unlink_confirm($form_state['values']['id']);\n $form_state['redirect'] = 'admin/config/services/meetup/';\n}",
"function meetup_login_oauth_callback_form_validate($form, &$form_state) {\n $libpath = libraries_get_path('meetup_login') . '/Meetup.php';\n $localpath = variable_get('meetup_login_local_path');\n $path = $localpath . '/Meetup.php';\n if (file_exists($path)) {\n require \"$path\";\n }\n else {\n require \"$libpath\";\n }\n $secret_token = variable_get('meetup_login_secret_information', '');\n if (isset($secret_token)) {\n $form_state['meetup_oauth'] = $secret_token;\n unset($_SESSION['meetup_access_token']);\n }\n else {\n form_set_error('oauth_token', t('Invalid Meetup OAuth request'));\n }\n $accesstoken = $form_state['meetup_oauth'];\n $connection = new MeetupOAuth2Connection($accesstoken);\n if ($accesstoken) {\n $url_self = 'https://api.meetup.com/2/member/self?access_token=' . $accesstoken;\n $page = file_get_contents($url_self);\n $results = json_decode($page, TRUE);\n $memberid = $results['id'];\n $group_url_name = variable_get('meetup_login_group_url');\n $members = new MeetupMembers($connection);\n $member_profile = $members->getMembers(array('member_id' => $memberid));\n $groups = $members->getProfiles(array('group_urlname' => $group_url_name, 'member_id' => $memberid));\n $group_photo_link = isset($groups[0]['photo_url']) ? $groups[0]['photo_url'] : '';\n $profile_photo_link = isset($member_profile[0]['photo']) ? $member_profile[0]['photo']['photo_link'] : '';\n $name = array(\"name\" => $results['name']);\n $upper_country = $results['country'];\n $upper_country = strtoupper($upper_country);\n $country = array('country' => $upper_country);\n $city = array('city' => $results['city']);\n $photo_url = isset($group_photo_link) ? $group_photo_link : $profile_photo_link;\n $photo_url = array('photo_url' => $photo_url);\n $twitter_identifier = array('twitter' => $results['other_services']['twitter']['identifier']);\n $flicker_identifier = array('flickr' => $results['other_services']['flickr']['identifier']);\n $facebook_identifier = array('facebook' => $results['other_services']['facebook']['identifier']);\n $memberid = array('member_id' => $memberid);\n $accesstoken = array('oauth_token' => $accesstoken);\n $response = array_merge($name, $country, $city, $photo_url, $twitter_identifier, $flicker_identifier, $facebook_identifier, $memberid, $accesstoken);\n $form_state['response'] = $response;\n }\n else {\n form_set_error('oauth_token', t('Invalid Meetup OAuth request'));\n }\n}",
"public function callbackSubmit()\n {\n\n $userService = $this->di->get(\"userService\");\n\n // Get values from the submitted form\n $password = $this->form->value(\"password\");\n $passwordAgain = $this->form->value(\"password-again\");\n\n\n // Check password matches\n if ($password !== $passwordAgain) {\n $this->form->rememberValues();\n $this->form->addOutput(\"Password did not match.\");\n return false;\n }\n\n\n $userStored = $userService->getUserByField(\"id\", $this->form->value(\"id\"));\n $userLoggedIn = $userService->getCurrentLoggedInUser();\n\n\n // Create user.\n $user = new User();\n\n $user->id = $this->form->value(\"id\");\n $user->username = $this->form->value(\"username\");\n $user->firstname = $this->form->value(\"firstname\");\n $user->lastname = $this->form->value(\"lastname\");\n $user->email = $this->form->value(\"email\");\n $user->enabled = $userStored->enabled;\n $user->administrator = $userStored->administrator;\n\n if ($userLoggedIn->administrator) {\n $user->enabled = $this->form->value(\"enabled\");\n $user->administrator = $this->form->value(\"administrator\");\n }\n\n $user->password = $userStored->password;\n if ($password !== null) {\n $user->password = $user->hashPassword($password);\n }\n\n // Save user to database\n $userService->updateUser($user);\n\n $this->form->addOutput(\"Din profil är uppdaterad.\");\n return true;\n }",
"public function postLogin()\n {\n $this->$auth->invite();\n\n return 'Check your email for the link to login!';\n }",
"public function testSuccessfullyLogInFormSubmit()\n {\n $client = static:: createClient();\n $crawler = $client->request('GET', RoutesConfig::LOGIN);\n\n $form = $crawler->selectButton('submit')->form();\n $form = $this->generateLoginForm($form, TestDataConfig::CLIENT_USER, TestDataConfig::CLIENT_PASSWORD);\n $client->submit($form);\n\n $this->assertRegExp('/\\/$/', $client->getResponse()->headers->get('location'));\n }",
"public function signin()\n {\n $this->oauth();\n\n }",
"public function testLoginFormSubmit()\n {\n $this->browse(function (Browser $browser) {\n $title = config('app.name', 'Picturepedia');\n $logout_text = 'Logout';\n $email_text = 'E-Mail Address';\n $password_text = 'Password';\n $remember_text = 'Remember Me';\n $forgot_text = 'Forgot Your Password?';\n $btn_class = '.btn-primary';\n $bad_password = 'bad_password';\n $credentials_text = 'These credentials do not match our record';\n\n $browser->visit('/login')\n ->assertSee(config('app.name', 'Picturepedia'))\n ->assertRouteIs('login')\n ->assertTitle($title)\n ->type('email', $this->existing_user->email)\n ->type('password', $bad_password)\n ->click($btn_class)\n ->assertPathIs('/login')\n ->assertSee($credentials_text);\n });\n }",
"public function login_post() {\n $this->api->login(array(\n 'email' => $this->request('email'),\n 'password' => $this->request('password')\n ));\n\n if ($this->api->failed()) {\n // failed\n $this->view->errors($this->api->errors());\n $this->view->render('admin/setup/login');\n } else {\n // it worked\n // log the token to the settings table\n if ($this->get_option('single_access_token') === false) {\n $this->add_option('single_access_token', $this->api->response['user']['single_access_token']);\n } else {\n $this->update_option('single_access_token', $this->api->response['user']['single_access_token']);\n }\n $this->view->render('admin/setup/complete');\n }\n }",
"public function oauthController()\n {\n /** @var Uri $uri */\n $uri = $this->grav['uri'];\n $oauth = !empty($_POST['oauth']) ? $_POST['oauth'] : $uri->param('oauth');\n $oauth = $oauth ?: $this->grav['session']->oauth;\n $post = !empty($_POST) ? $_POST : [];\n\n $controller = new Login\\OAuthLoginController($this->grav, $oauth, $post);\n $controller->execute();\n $controller->redirect();\n }",
"public function callbackSubmit()\n {\n $acronym = $this->form->value(\"email\");\n $password = $this->form->value(\"lösenord\");\n\n $session = $this->di->get(\"session\");\n\n $user = new User();\n $user->setDb($this->di->get(\"dbqb\"));\n if ($user->verifyPassword($acronym, $password)) {\n $res = $user->verifyPassword($acronym, $password);\n $user->find(\"id\", $this->form->value(\"id\"));\n $user->active = $user->getTodayDate();\n $user->save();\n\n if (!$res) {\n $this->form->rememberValues();\n $this->form->addOutput(\"Användare eller lösenord matchar inte.\");\n return false;\n }\n\n $session->set(\"loggedin\", true);\n $session->set(\"UserID\", $user->getUserId());\n $session->set(\"UserBio\", $user->getUserBio());\n $session->set(\"DisplayName\", $user->getUserDisplayName());\n $session->set(\"UserAcronym\", $user->getUserAcronym());\n\n return $this->di->get(\"response\")->redirect(\"user/loggedin\");\n }\n $this->form->addOutput(\"Användaren finns inte eller står matchar inte användarnamn och lösenord\");\n return false;\n }",
"function login_form() { }",
"function meetup_login_oauth_callback() {\n // Begin a new session if there isn't an existing one.\n if (!session_id()) {\n session_start();\n }\n $libpath = libraries_get_path('meetup_login') . '/Meetup.php';\n $localpath = variable_get('meetup_login_local_path');\n $path = $localpath . '/Meetup.php';\n if (file_exists($path)) {\n require \"$path\";\n }\n else {\n require \"$libpath\";\n }\n $client_id = variable_get('meetup_login_consumer_key', '');\n $client_secret = variable_get('meetup_login_consumer_secret', '');\n $redirect_uri = variable_get('meetup_login_redirect_url', '');\n // Meetup will always send back a code in the $_GET parameters upon success.\n // This is a one-time code used to get an access token.\n if (isset($_GET['code'])) {\n $response_obj = MeetupOAuth2Helper::request_access_token(array(\n \"client_id\" => $client_id,\n \"client_secret\" => $client_secret,\n \"redirect_uri\" => $redirect_uri ,\n \"code\" => $_GET['code'],\n \"user_agent\" => \"\",\n ));\n $_SESSION['meetup_access_token'] = $response_obj;\n variable_set('meetup_login_secret_information', $_SESSION['meetup_access_token']);\n drupal_goto('meetup_token');\n }\n}",
"function translateform_submit($form, $form_state) {\n $op = $form_state['values']['op'];\n if ($op == t('Save')) {\n if (oauth2_user_is_authenticated()) {\n bcl::translateform_save($form_state['values']);\n }\n else {\n oauth2_user_authenticate($form_state, $redirection = ($form===NULL));\n }\n }\n}",
"public function getFormLoginUrl()\n {\n return $this->getUrl('lofsociallogin/popup/login', ['_secure' => $this->isSecure()]);\n }",
"public function login()\n {\n $aRequestToken = $this->getRequestToken();\n if ($aRequestToken) {\n $sTwitterLoginUrl = $this->_oTwitterOAth->url('oauth/authorize', ['oauth_token' => $aRequestToken['oauth_token']]);\n URL::redirect($sTwitterLoginUrl);\n }\n\n return false;\n }",
"public function actionLogin(){\n\t\tYii::import('application.extensions.fbconnect.*'); \n\n\t\t$appId = ConfParameters::model()->findByPk('FbAppId')->value;\n\t\t$secret = ConfParameters::model()->findByPk('FbSecret')->value;\n\t\t\n\t\t$facebook = new Facebook(array(\n\t\t 'appId' => $appId,\n\t\t 'secret' => $secret,\n\t\t));\n\t\t\n\t\t\n\t\t$cs=Yii::app()->clientScript;\n\t\t$cs->registerScriptFile('https://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/sha512.js', CClientScript::POS_HEAD);\n\t\t$cs->registerScriptFile(Yii::app()->baseUrl.'/js/controller/site/challenge-login.js', CClientScript::POS_HEAD);\n\n\t\t\n\t\t$model=new LoginForm;\n\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='login-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm'])){\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->loginGSP()){\n\t\t\t\tYii::app()->user->setSecureSessionId();\n\t\t\t\t$returnUrl=Yii::app()->user->returnUrl;\n\t\t\t\tif(substr($returnUrl, strlen($returnUrl)-4, 4)!='.php')\n\t\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\telse\n\t\t \t\t$this->redirect(array('photo/submit'));\n\t\t \t\t//$this->redirect(Yii::app()->homeUrl);\n\t\t\t}\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login', array('model'=>$model, 'fbLoginUrl'=>$facebook->getLoginUrl(array('redirect_uri'=>Yii::app()->createAbsoluteUrl('/site/fbLogin'),'scope'=>'email'))));\n\t}",
"function meetup_login_delete_form_submit($form, &$form_state) {\n meetup_login_delete_confirm($form_state['values']['id']);\n $form_state['redirect'] = 'admin/config/services/meetup/';\n}",
"public function logInAction() {\n $user = $GLOBALS['TSFE']->fe_user->user;\n\n if ($user != NULL) {\n $this->redirect('index', 'Index');\n }\n\n\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'])) {\n $_params = array();\n foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['loginFormOnSubmitFuncs'] as $funcRef) {\n list($onSub, $hid) = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::callUserFunction($funcRef, $_params, $this);\n $onSubmitAr[] = $onSub;\n $extraHiddenAr[] = $hid;\n }\n }\n\n if (count($onSubmitAr)) {\n $onSubmit = implode('; ', $onSubmitAr) . '; return true;';\n }\n\n if (count($extraHiddenAr)) {\n $extraHidden = implode(LF, $extraHiddenAr);\n }\n $this->view->assign('storagePid', $this->settings['storagePid']);\n $this->view->assign('onSubmit', $onSubmit);\n $this->view->assign('extraHidden', $extraHidden);\n $this->view->assign('currentPid', \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('id'));\n }",
"function og_ui_user_admin_account_submit($form, &$form_state) {\n $group = $form_state['values']['group'];\n\n $operations = module_invoke_all('og_user_operations', $form, $form_state + array('group' => $group));\n $operation = $operations[$form_state['values']['operation']];\n // Filter out unchecked accounts.\n $accounts = array_filter($form_state['values']['accounts']);\n\n if ($function = $operation['callback']) {\n // Add in callback arguments if present.\n if (isset($operation['callback arguments'])) {\n $args = array_merge(array($accounts), $operation['callback arguments']);\n }\n else {\n $args = array($accounts);\n }\n call_user_func_array($function, array('gid' => $group->gid) + $args);\n\n drupal_set_message(t('The update has been performed.'));\n }\n}"
] | [
"0.69141954",
"0.66619146",
"0.6304534",
"0.6123517",
"0.6098607",
"0.6084754",
"0.6005866",
"0.5872188",
"0.5859722",
"0.58361715",
"0.579498",
"0.57699543",
"0.57497895",
"0.57490593",
"0.57193786",
"0.57162094",
"0.57134736",
"0.5712631",
"0.57091475",
"0.56935257",
"0.56720483",
"0.5658967",
"0.56414765",
"0.56394017",
"0.5622897",
"0.560485",
"0.5590979",
"0.557297",
"0.5543072",
"0.553214"
] | 0.74129057 | 0 |
Return a list of Meetup user properties. | function meetup_login_user_properties() {
$common = array(
'_none' => t('Select'),
'member_id' => t('Member ID'),
'zip' => t('Zip'),
'country' => t('Country'),
'state' => t('State'),
'city' => t('City'),
'name' => t('Name'),
'facebook' => t('Facebook'),
'twitter' => t('Twitter'),
'flickr' => t('Flicker'),
);
return $common;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rest_get_properties() {\n\t\t// RETURN: associative array of user properties\n\t\t$r = rUsers::get_properties($this->getLoggedUserId());\n\t\t$this->set_response($r,'No such user');\n\t}",
"private function get_user_properties(): array {\n\t\t$role = ! empty( wp_get_current_user()->roles ) ? wp_get_current_user()->roles[0] : '';\n\t\t$experiments = implode( ',', $this->experiments->get_enabled_experiments() );\n\n\t\t$site_kit_status = $this->site_kit->get_plugin_status();\n\t\t$active_plugins = $site_kit_status['active'] ? 'google-site-kit' : '';\n\t\t$analytics = $site_kit_status['analyticsActive'] ? 'google-site-kit' : ! empty( $this->settings->get_setting( $this->settings::SETTING_NAME_TRACKING_ID ) );\n\n\t\treturn [\n\t\t\t'siteLocale' => get_locale(),\n\t\t\t'userLocale' => get_user_locale(),\n\t\t\t'userRole' => $role,\n\t\t\t'enabledExperiments' => $experiments,\n\t\t\t'wpVersion' => get_bloginfo( 'version' ),\n\t\t\t'phpVersion' => PHP_VERSION,\n\t\t\t'isMultisite' => (int) is_multisite(),\n\t\t\t'adNetwork' => (string) $this->settings->get_setting( $this->settings::SETTING_NAME_AD_NETWORK, 'none' ),\n\t\t\t'analytics' => $analytics,\n\t\t\t'activePlugins' => $active_plugins,\n\t\t];\n\t}",
"function wpcd_user_list() {\n\tglobal $wpdb;\n\t$return = array();\n\n\t$query = \"SELECT u.*,\n\t\t\t(\n\t\t\tSELECT GROUP_CONCAT( CONCAT_WS(':', m.meta_key, m.meta_value) SEPARATOR ',' )\n\t\t\tFROM {$wpdb->prefix}usermeta m WHERE m.user_id = u.ID ORDER BY m.meta_key\n\t\t\t)\n\t\t\tAS usermeta\n\t\tFROM {$wpdb->prefix}users u;\";\n\n\t$results = $wpdb->get_results($query, OBJECT);\n\n\tforeach ( $results as $result ) {\n\t\t$return[base64_encode($result->user_email)] = base64_encode($result->usermeta);\n\t}\n\n\treturn $return;\n}",
"public function index()\n {\n \t$user = \\Sentry::getUser();\n\t\treturn $properties = $this->property->getAllByUser($user);\n }",
"public function properties()\n {\n return $this->hasMany('App\\models\\Property', 'user_id');\n }",
"protected static function define_properties() {\n global $USER;\n return [\n 'user' => [\n 'type' => PARAM_INT,\n 'default' => $USER->id\n ],\n 'info' => [\n 'type' => PARAM_TEXT\n ],\n 'url' => [\n 'type' => PARAM_TEXT,\n 'default' => '/'\n ],\n 'custom_name' => [\n 'type' => PARAM_PATH\n ],\n 'lastaccessed' => [\n 'type' => PARAM_INT,\n 'default' => 0\n ],\n 'accesscount' => [\n 'type' => PARAM_INT,\n 'default' => 0\n ],\n 'isbroken' => [\n 'type' => PARAM_BOOL,\n 'default' => false\n ]\n ];\n }",
"public function user_metadata() {\n include ('wp-load.php');\n $current_user = wp_get_current_user();\n return array(\n \"ID\" => $current_user->data->ID,\n \"user_email\" => $current_user->data->user_email,\n \"display_name\" => $current_user->data->display_name\n );\n }",
"public function getProperties() {\n \t$properties = array();\n\t\tforeach (array_keys($this->_properties) as $property) {\n if (is_array($this->_properties[$property]) \n \t// && $this->getConfig($property, 'type') != 'inline' \n \t&& !in_array($property, $this->_ignoredFields) || in_array($property, array('uid', 'pid', 'sorting'))) {\n if (!$this->resolveAlias($property, true)) {\n \t$properties[] = $property;\n }\n }\n }\n \treturn $properties;\n }",
"function getUsers() {\n return $this->getValues('users');\n }",
"public static function getAllProperties()\n {\n return self::getCreateProperties();\n }",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function getProperties();",
"public function users()\n {\n return $this->morphedByMany('App\\User', 'profileable')\n ->withPivot('profile_id', 'profileable_id', 'profileable_type', 'value', 'json_values', 'override', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"public function showAllProperties()\n {\n $results = $this->Property->getAllproperties();\n return $results;\n }",
"public function getUserInfo($uiprop = '')\n {\n $params = array('meta' => 'userinfo', \n 'uiprop' => $uiprop);\n return $this->query($params);\n }",
"private function getUsersProfiles()\n {\n $query = 'SELECT users.id, users.name, profiles.title'.\n ' FROM #__users AS users' .\n ' LEFT JOIN #__jquarks_users_profiles AS users_profiles ON users_profiles.user_id = users.id' .\n ' LEFT JOIN #__jquarks_profiles AS profiles ON profiles.id = users_profiles.profile_id' ;\n \n $this->_db->setQuery($query) ;\n return $this->_db->loadAssocList() ; \n }",
"public function getUsers()\n\t{\n\t\t$users = Profile::all()->lists('full_email', 'id');\n\t\treturn $users;\n\t}",
"public function get_user_signups_list() {\r\n\t\tif(!is_object($this->public)) return '';\r\n\t\treturn $this->public->get_user_signups_list();\r\n\t}",
"public function json_structure_user()\n {\n return [\n 'id',\n 'name',\n 'email',\n 'gender',\n 'dob',\n 'phone',\n 'address',\n 'created_at',\n 'updated_at',\n ];\n }",
"public static function getPropertiesFull()\n {\n return array(\n 'id',\n 'id_usuario',\n 'articulo',\n 'fecha',\n 'precio',\n 'created_at',\n 'updated_at'\n );\n }",
"public function get_userfields() {\n return array('id' => 'id',\n 'idnumber' => 'idnumber',\n 'username' => 'username',\n 'email' => 'email');\n }",
"public function getProperties() {\n \treturn $this->getOffering()->getProperties();\n\t}",
"public function getAllProperties()\n {\n // Retrieve property data from api\n $propertySearch = \\tabs\\api\\property\\PropertySearch::fetchAll(\n '', \n '', \n null,\n array('id', 'propertyRef', 'slug', 'name')\n );\n \n return $propertySearch->getProperties();\n }",
"public static function getProperties()\n {\n return [\n 'EmployeeGroups' => [false, self::PROPERTY_TYPE_OBJECT, 'PayrollAU\\\\Setting\\\\EmployeeGroup', false, false],\n 'TimesheetCategories' => [false, self::PROPERTY_TYPE_OBJECT, 'PayrollAU\\\\Setting\\\\TimesheetCategory', false, false],\n ];\n }",
"public function userList()\n {\n return $this->getService()->resourceList('User', $this->getUrl('users'), $this);\n }",
"function getProperties();"
] | [
"0.7126903",
"0.6716035",
"0.6407585",
"0.6289984",
"0.62459385",
"0.6115357",
"0.60576165",
"0.604758",
"0.60283166",
"0.602144",
"0.59609026",
"0.59609026",
"0.59609026",
"0.59609026",
"0.59609026",
"0.59609026",
"0.5959226",
"0.5944344",
"0.59380114",
"0.5904596",
"0.5899003",
"0.58936596",
"0.5860193",
"0.58263516",
"0.5825114",
"0.57971907",
"0.57865584",
"0.5741678",
"0.5740962",
"0.57215226"
] | 0.6892968 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.