query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Transform the given resource, and serialize the data with the given serializer.
public function make(ResourceInterface $resource, SerializerAbstract $serializer, array $options = []) { $options = $this->parseOptions($options, $resource); return $this->manager->setSerializer($serializer) ->parseIncludes($options['includes']) ->parseExcludes($options['excludes']) ->parseFieldsets($options['fieldsets']) ->createData($resource) ->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transformResource($resource);", "public function serialize(ResourceInterface $resource, ResourceSerializationContext $context): string;", "public function transform()\n {\n $object = $this->resource;\n\n $data = $object instanceof Collection || $object instanceof AbstractPaginator\n ? $object->map([$this, 'transformResource'])->toArray()\n : $this->transformResource($object);\n\n if ($object instanceof AbstractPaginator) {\n $this->withMeta(array_merge(\n $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])\n ));\n }\n\n $data = array_filter(compact('data') + $this->extras);\n ksort($data);\n\n return $data;\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function transform($resource)\n {\n return [\n\n 'store_id' => $resource->store_id,\n 'store_name' => $resource->store_name,\n 'logo' => $resource->logo,\n 'store_score' => $resource->store_score,\n 'month_sale_num' => $resource->month_sale_num,\n 'average_price' => $resource->average_price,\n 'delivery_fee' => $resource->delivery_fee,\n 'min_price' => $resource->min_price,\n\n ];\n }", "public function transform($resource)\n {\n return [];\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource->id,\n 'sname' => $resource->field_sname,\n 'cname' => $resource->field_cname,\n 'type' => $this->getType($resource->field_type),\n 'typeId' => $resource->field_type,\n 'length' => $resource->field_length,\n 'desc' => $resource->field_desc,\n 'default' => $resource->field_default,\n 'fieldType' => $resource->type->name,\n 'fieldTypeId' => $resource->field_type_id,\n 'dict' => $resource->field_dict,\n 'model' => $resource->dict_table,\n 'url' => $resource->url,\n 'system' => $resource->system,\n 'created_at' => $resource->created_at->format('Y-m-d H:i:s'),\n 'updated_at' => $resource->updated_at->format('Y-m-d H:i:s'),\n ];\n }", "public function renderOne($resource)\n {\n $transformer = new $this->transformerClass;\n $item = new Item($resource, $transformer);\n\n return $this->manager->createData($item)->toArray();\n }", "public function intoResource($resource): void {\n\t\tforeach ($this as $value) {\n\t\t\tfwrite($resource, $value);\n\t\t}\n\t}", "abstract protected function createElement($data, SerializerInterface $serializer);", "abstract public function serialize($data);", "abstract protected function serializeData();", "public function format($resource, Headers $headers);", "public function getSerializer();", "public function transform($transformer);", "public function transform($resource)\n {\n $keys = array_keys($resource->getAttributes());\n $ret = [];\n foreach($keys as $k) {\n $value = DeviceRepository::transform($k, $resource->$k, $tkey,$this->type);\n if(!empty($tkey)) {\n $ret[$tkey] = $value;\n $ret[$k] = $resource->$k;\n }\n else {\n $ret[$k] = $value;\n }\n }\n\n $ret['category'] = $resource->category->name;\n $ret['sub_category'] = $resource->sub_category->name;\n return $ret;\n }", "public static function getSerializer();", "public static function toJson($resource)\n {\n return json_encode($resource);\n }", "public function resource($resource, $transformer, $parameters = [], Closure $after = null)\n {\n return $this->item($resource, $transformer, $parameters, $after);\n }", "public function store($data, Resource $resource);", "public function serialize($data)\n {\n }", "public function serialize($data);", "public function representationOf($serializer, $value, $context= array());", "public function testToBaseResourceObject()\n {\n $user = factory(User::class)->make();\n $serializer = new ResourceSerializer($user);\n $resource = $serializer->toBaseResourceObject();\n\n $this->assertInternalType('array', $resource);\n $this->assertArrayHasKey('attributes', $resource);\n $this->assertInternalType('array', $resource['attributes']);\n $this->assertArraySubset($resource['attributes'], $user->getAttributes());\n $this->assertArrayNotHasKey('id', $resource['attributes'], 'ID incorrectly included in attribute list');\n $this->assertArrayNotHasKey('password', $resource['attributes'], 'Hidden model field incorrectly included');\n }", "public function convertToResource($data)\n {\n return $this->get($data->id)->init($data);\n }", "protected function transform($result, $transformer, $resourceKey = null)\n {\n $transformer = is_string($transformer) ? new $transformer : $transformer;\n $transformed = $transformer->transformResult($result, $transformer);\n if (!$this->isPaginated($result) && !is_null($resourceKey)) {\n return [$resourceKey => $transformed];\n }\n return $transformed;\n }", "protected function renderSerialized($data): string\n {\n $documentData;\n\n $serializer = $this->resource->getSerializer();\n $relationships = $serializer->getDefaultRelationships();\n // @todo récupérer les relationships passées par la request (parameter included)\n\n if ($data instanceof \\ArrayAccess) {\n\n $documentData = new Collection($data, $serializer); \n\n } elseif ($data instanceof Model) {\n\n $documentData = new Resource($data, $serializer); \n\n } else {\n\n return json_encode(new Document(), JSON_PRETTY_PRINT);\n }\n\n $documentData->with($relationships);\n\n if ($json = json_encode(new Document($documentData))) {\n\n return $json;\n } else {\n\n throw new \\Exception(sprintf('An error has occured during serialization : %s', json_last_error_msg()));\n }\n }", "private function transformCollection(Collection $collection, $resource, $resourceCollection){\n $transform = $resource::collection($collection); \n \n return new $resourceCollection($transform);\n }", "public function visit(RequestInterface $object, Serializer $serializer)\n {\n $data = $object->getSerializerData();\n\n $data = $this->checkSerializeArray($data, $serializer);\n\n return json_encode($data);\n\n }", "public function serialize($data, $format)\n\t{\n\t\treturn $this->get('swagger_server.model.model_serializer')->serialize($data, $format);\n\t}", "public function serialize($entity)\n {\n }", "public function serialize($data, string $format, ?SerializationContext $context = null, ?Type $type = null);", "public abstract function serialize();", "protected function intoResource($payload)\n {\n // Transformer are intended to singular resources,\n // so what to do with collections\n if ($this->transformer != null) {\n $payload = $this->transformPayload($payload);\n }\n\n if($payload instanceof Collection || $payload instanceof AbstractPaginator) {\n return is_array($payload->first()) \n ? new ResourceCollection($payload->map(function($item) {\n return new ArrayWrapper($item);\n }))\n : new ResourceCollection($payload);\n }\n\n if($payload instanceof Arrayable) {\n return $this->instantiateJsonResource($payload);\n }\n \n if(is_array($payload)) {\n return $this->instantiateJsonResource(new ArrayWrapper($payload));\n }\n \n if($payload instanceof \\JsonSerializable) {\n return $this->instantiateJsonResource($payload);\n }\n\n throw new ResponderException(\"Cannot serialize object\");\n }", "private function transformModel(Model $model, $resource){\n $transform = new $resource($model);\n\n return $transform;\n }", "public function serializer() {\n }", "protected function transform($data)\n {\n $fractalManager = new Manager();\n $manager = $this->applyIncludes($fractalManager);\n $this->resetIncldues();\n $manager->setSerializer(new ArraySerializer());\n\n return $manager->createData($data)->toArray();\n }", "public function writeStream($resource);", "protected function _dataToSerialize($serialize)\n {\n $data = parent::_dataToSerialize($serialize);\n\n $serializerClass = $this->getConfig('serializer');\n if (!$serializerClass) {\n $serializer = new ArraySerializer();\n } elseif (is_object($serializerClass)) {\n $serializer = $serializerClass;\n } elseif (class_exists($serializerClass)) {\n $serializer = new $serializerClass;\n } else {\n throw new Exception('Invalid serializer option');\n }\n $manager = new Manager();\n $manager->setSerializer($serializer);\n\n $includes = $this->getConfig('includes');\n if ($includes) {\n $manager->parseIncludes($includes);\n }\n\n if (is_array($data)) {\n foreach ($data as $varName => $var) {\n $data[$varName] = $this->transform($manager, $var, $varName);\n }\n } else {\n $data = $this->transform($manager, $data);\n }\n\n return $data;\n }", "private function convertSerializedData()\n {\n $layoutUpdateQueryModifier = $this->queryModifierFactory->create(\n 'like',\n [\n 'values' => [\n 'xml' => '%conditions_encoded%'\n ]\n ]\n );\n $this->aggregatedFieldDataConverter->convert(\n [\n new FieldToConvert(\n SerializedToJson::class,\n $this->moduleDataSetup->getTable('widget_instance'),\n 'instance_id',\n 'widget_parameters'\n ),\n new FieldToConvert(\n LayoutUpdateConverter::class,\n $this->moduleDataSetup->getTable('layout_update'),\n 'layout_update_id',\n 'xml',\n $layoutUpdateQueryModifier\n ),\n ],\n $this->moduleDataSetup->getConnection()\n );\n }", "public function valueOf($serializer, $serialized, $context= array());", "abstract public function serialize();", "abstract public function serialize();", "public function deserialize(string $data, string $resourceClass, ResourceSerializationContext $context): ResourceInterface;", "public function serialize($data): string\n {\n if( $this->serializer ){\n return \\call_user_func($this->serializer, $data);\n }\n\n return \\json_encode($data);\n }", "protected function serialize($data)\n {\n return serialize($data);\n }", "public function visit(RequestInterface $object, Serializer $serializer)\n {\n $data = $object->getSerializerData();\n\n $data = $this->checkSerializeArray($data, $serializer);\n\n /**\n * Do not serialize the whole data instead return it as an array\n */\n return $data;\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function setResource($resource);", "public function item($data, $transformer, $resource = null)\n {\n\n return $this->_fractal->item($data, $transformer, $resource);\n }", "public function toApi(): JsonResource\n {\n return resolve(InputResourcerContract::class, ['input' => $this]);\n }", "public function withTransformer($transformer);", "protected function sendResource(\n ResourceInterface $resource,\n string $method = 'post',\n array $meta = [],\n array $headers = [],\n ): ResourceInterface {\n $response = $this->doRequest(\n $this->getResourceUri($resource->getType(), $resource->getId()),\n $method,\n array_filter([\n 'data' => $resource,\n 'meta' => array_filter($meta),\n ]),\n $this->authenticator->getAuthorizationHeader() + [\n AuthenticatorInterface::HEADER_ACCEPT => AuthenticatorInterface::MIME_TYPE_JSONAPI,\n ] + $headers\n );\n\n $json = json_decode((string) $response->getBody(), true);\n $included = $json['included'] ?? null;\n $resources = $this->jsonToResources($json['data'], $included);\n\n return reset($resources);\n }", "public function __toString()\n {\n if (is_object($this->resource) and method_exists($this->resource, '__toString')) {\n\n return $this->resource->__toString();\n }\n\n return json_encode($this->resource);\n }", "private function serialize($data)\n {\n $context = new SerializationContext();\n $context->setSerializeNull(true);\n\n return $this->get('jms_serializer')->serialize($data, 'json', $context);\n }", "abstract protected function serializeData($unSerializedData);", "public function transform()\n\t{\n\t\t$this->createCollection();\n\n\t\tif($this->hasPaginator) {\n\t\t\t$output = $this->tagCollection\n\t\t\t\t->setPaginator(\n\t\t\t\t\tnew IlluminatePaginatorAdapter($this->tag)\n\t\t\t\t);\n\t\t}\n\n\t\t$output = $this->manager\n\t\t\t->createData($output)\n\t\t\t->toJson();\n\n\t\treturn $output;\n\t}", "final public function __invoke($data) {\n return $this->serialize($data);\n }", "public function serialize(stubObject $entity);", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize($data)\n {\n $context = new SerializationContext();\n $context->setSerializeNull(true);\n \n /* @var $qwe \\JMS\\Serializer\\Serializer */\n\n return $this->get('jms_serializer')\n ->serialize($data, 'json', $context);\n }", "protected function serializeData($data) {\n return $data;\n }", "private function serializer()\n {\n $this->setSerializableOptionsArray();\n\n return new Serializer($this->serializableOptions());\n }", "public function serializeDetails(RestifyRequest $request, $serialized)\n {\n return $serialized;\n }", "public function serialize($data, $format = '', array $context = [])\n {\n $serializer = self::getInstance();\n\n try {\n return $serializer->serialize(\n $data,\n $format,\n $context\n );\n } catch (\\Throwable $t) {\n throw new SerializationException($t->getMessage(), $t->getCode(), $t);\n }\n }", "public function fromResource(Resource $resource)\n {\n $file = $resource->getFilenameShort(false);\n $path = $resource->getRelativePath(true);\n return $this->urlizeRecursive($path . '/' . $file);\n }", "public function testToResourceIdentifier()\n {\n $record = factory(User::class)->make();\n $serializer = new ResourceSerializer($record);\n $data = $serializer->toResourceIdentifier();\n\n $this->assertJsonApiResourceIdentifier(compact('data'), 'users', $record->id);\n }", "public function transform($data)\n {\n $this->resolveFieldMapping($data, $this->field_map);\n return $data;\n }", "protected function postResource(\n ResourceInterface $resource,\n array $meta = [],\n array $headers = [],\n ): ResourceInterface {\n return $this->sendResource($resource, 'post', $meta, $headers);\n }", "public static function fromResource(Resource $resource)\n {\n if (isset($resource->query['with_billets'])) {\n return static::withBillets($resource);\n }\n return parent::fromResource($resource);\n }", "public function transform(TransformableContract $model);", "protected function renderResponseBody(Request $request, ResourceResponseInterface $response, SerializerInterface $serializer, $format) {\n $data = $response->getResponseData();\n\n // If there is data to send, serialize and set it as the response body.\n if ($data !== NULL) {\n $serialization_context = [\n 'request' => $request,\n CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY => new CacheableMetadata(),\n ];\n\n $output = $serializer->serialize($data, $format, $serialization_context);\n\n if ($response instanceof CacheableResponseInterface) {\n $response->addCacheableDependency($serialization_context[CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY]);\n }\n\n $response->setContent($output);\n $response->headers->set('Content-Type', $request->getMimeType($format));\n }\n }", "public function serialize();", "public function serialize();", "public function serialize();", "public function resolve($resource, $attribute = null)\n {\n $attribute = $attribute ?? $this->attribute;\n\n $value = $resource->{$attribute} ?? null;\n\n $value = is_object($value) || is_array($value) ? $value : json_decode($value);\n\n $fields = $this->fields->whereInstanceOf(Resolvable::class)->reduce(function ($values, $field) {\n return $values->map(function ($row) use ($field) {\n $key = $field->attribute;\n $cb = $field->resolveCallback;\n\n if ($field instanceof Date) {\n $cb = function ($value) {\n return \\Carbon\\Carbon::parse($value)->format('Y-m-d');\n };\n };\n\n if (isset($row->{$key})) {\n $row->{$key} = $cb ? call_user_func($cb, $row->{$key}) : $row->{$key};\n }\n\n if (property_exists($field, 'computeCallback') && $field->computeCallback) {\n $row->{$key} = call_user_func($field->computeCallback, $row);\n }\n\n return $row;\n });\n }, collect($value));\n\n if (!$this->resolveCallback) {\n $this->resolveCallback = function () use ($fields) {\n return $fields->toArray();\n };\n }\n\n $this->withMeta(['fields' => $this->fields]);\n\n parent::resolve($resource, $attribute);\n }", "public function transform()\n\t{\n\t\t$this->createCollection();\n\n\t\tif($this->hasPaginator) {\n\t\t\t$output = $this->ticketCollection\n\t\t\t\t->setPaginator(\n\t\t\t\t\tnew IlluminatePaginatorAdapter($this->ticket)\n\t\t\t\t);\n\t\t}\n\n\t\t$output = $this->manager\n\t\t\t->createData($output)\n\t\t\t->toJson();\n\n\t\treturn $output;\n\t}", "public function fromResource($resource)\n {\n if ($resource instanceof TitleSeoInterface) {\n // backward compatibility\n $this->setTitle($resource->getSeoTitle());\n }\n if ($resource instanceof DescriptionSeoInterface) {\n // backward compatibility\n $this->setDescription($resource->getSeoDescription());\n }\n if ($resource instanceof KeywordsSeoInterface) {\n // backward compatibility\n $this->setKeywords($resource->getSeoKeywords());\n }\n\n // Pagination\n if ($resource instanceof PaginationAwareInterface) {\n $this->setPreviousUrl($resource->getPreviousUrl());\n $this->setNextUrl($resource->getPreviousUrl());\n }\n\n // Resource\n if ($resource instanceof ResourceInterface) {\n $this->setTitle($resource->getTitle());\n $this->setDescription($resource->getDescription());\n if ($keywords = $resource->getKeywords()) {\n $this->setKeywords((is_array($keywords)) ? $keywords : [$keywords]);\n }\n }\n\n return $this;\n }", "abstract public function resource($resource);", "public function serialize($data, $format, SerializationContext $context = null)\n {\n $this->checkMediaType($format);\n return json_encode($data);\n }", "function encode($data) {\n $format = $this->params['xformat'];\n $format_method = \"encode_{$format}\";\n if (!method_exists($this, $format_method)) throw new xException(\"REST format output not available: {$format}\", 501);\n $output = $this->$format_method($data);\n // Recodes output stream if necessary\n if ($this->encoding != 'UTF-8') {\n $output = iconv('UTF-8', \"{$this->encoding}//TRANSLIT\", $output);\n }\n // Returns output\n return $output;\n }", "public function __construct($data, SerializerRegistryInterface $serializers)\n {\n $this->resources = $this->buildResources($data, $serializers);\n }", "public function setSerializer(ICommandSerializer $serializer);", "abstract public function transform();", "public function setToResource()\n {\n $this->type = \"resource\";\n }", "public function setSerializer($serializer) {\n\t\t\t$this->serializer = $serializer;\n\t\t\treturn $this;\n\t\t}", "public function getSerializer()\n {\n return $this->serializer;\n }", "public static function transformer();", "public function serialize(){ }", "public function serialize(SerializationWriter $writer): void {\n parent::serialize($writer);\n $writer->writeBooleanValue('distributeForStudentWork', $this->getDistributeForStudentWork());\n $writer->writeObjectValue('resource', $this->getResource());\n }", "public function getSerializer(): AbstractSerializer\n {\n return new FlarumPostsSerializer();\n }", "public function versionedResource($resource) {\n \treturn Celsus_Resource::version($resource);\n }" ]
[ "0.7339129", "0.6275892", "0.6226187", "0.61327666", "0.60439295", "0.59515953", "0.5933684", "0.5906503", "0.58640724", "0.5722398", "0.56925803", "0.5649679", "0.56295997", "0.5601711", "0.5487312", "0.5470276", "0.54135346", "0.5395011", "0.5345062", "0.5339683", "0.5328383", "0.53212154", "0.5308143", "0.5271724", "0.52691716", "0.5257224", "0.5245008", "0.5219761", "0.5219148", "0.5202711", "0.51960385", "0.5178035", "0.5155297", "0.51532495", "0.5123213", "0.50998235", "0.5092267", "0.50825626", "0.5059697", "0.5056883", "0.50414246", "0.5036236", "0.5035838", "0.5035838", "0.5019227", "0.5006363", "0.49927652", "0.49681216", "0.49679366", "0.4958441", "0.4925106", "0.4916075", "0.49137202", "0.48814344", "0.4872259", "0.48591948", "0.4856502", "0.48442858", "0.4839212", "0.4832707", "0.48248836", "0.48248836", "0.48236805", "0.48236805", "0.48236805", "0.48236805", "0.48236805", "0.48236805", "0.48125422", "0.4791776", "0.47898653", "0.47820297", "0.47704563", "0.47696042", "0.47691178", "0.47661084", "0.4754504", "0.47475296", "0.47434592", "0.47290558", "0.47285053", "0.47285053", "0.47285053", "0.47198278", "0.46994576", "0.4686912", "0.46781805", "0.46717075", "0.4667996", "0.4651893", "0.46471986", "0.4644567", "0.46428978", "0.4613816", "0.4611076", "0.45980933", "0.45964366", "0.4591272", "0.458824", "0.45738757" ]
0.6287341
1
Parse the transformation options.
protected function parseOptions(array $options, ResourceInterface $resource): array { $options = array_merge([ 'includes' => [], 'excludes' => [], 'fieldsets' => [], ], $options); if (! empty($options['fieldsets'])) { if (is_null($resourceKey = $resource->getResourceKey())) { throw new LogicException('Filtering fields using sparse fieldsets require resource key to be set.'); } $options['fieldsets'] = $this->parseFieldsets($options['fieldsets'], $resourceKey, $options['includes']); } return $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _parseOptions($options) {\n\n if ( isset($options['dir']) ) {\n $this->dir = $options['dir'];\n }\n\n if ( isset($options['output'] ) ) {\n $this->output = $options['output'];\n }\n }", "protected function parse(): void\n {\n $parseOptions = true;\n $this->parsed = $this->getTokens();\n \n while (null !== $token = array_shift($this->parsed)) {\n if ($parseOptions && '--' == $token) {\n $parseOptions = false;\n } elseif ($parseOptions && 0 === strpos($token, '--')) {\n $this->parseLongOption($token);\n } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {\n $this->parseShortOption($token);\n }\n }\n }", "public function parse() {\n\t\t$strShortOpts = $this->getShortOptionsString();\n\t\t$arrLongOpts = $this->getLongOptionsArray();\n\t\t$opts = getopt(trim($strShortOpts), $arrLongOpts);\n\n\t\t// hotfix that: php css.php -a=\"Web\" -l=\"blackrockdigital\" -t=\"main\"\n\t\t// because, it have more options given as defined... result is that:\n\t\t//array(1) {\n\t\t// 'a' =>\n\t\t// array(3) {\n\t\t// [0] =>\n\t\t// string(3) \"Web\"\n\t\t// [1] =>\n\t\t// string(13) \"ckrockdigital\"\n\t\t// [2] =>\n\t\t// string(2) \"in\"\n\t\t// }\n\t\t//}\n\t\t// and should convert into ['a' => 'Web']\n\t\t$arrayKeys = (is_array($opts) ? array_keys($opts) : []);\n\t\tif (is_array($opts) && count($opts) === 1 && !empty($opts[current($arrayKeys)]) && is_array($opts['a']) && $arrayKeys[0] === 'a') {\n\t\t\t$opts = ['a' => current($opts[current($arrayKeys)])];\n\t\t}\n\n\t\tforeach ($opts as $strOptionName => $strOptionValue) {\n\t\t\t$config = $this->getConfigByKey($strOptionName);\n\n\t\t\t/**\n\t\t\t * Fallback: if the no_value option is set, this value should set to true.\n\t\t\t */\n\t\t\tif ($config->getType() === self::OPTION_TYPE_NO_VALUE) {\n\t\t\t\t$strOptionValue = true;\n\t\t\t}\n\n\t\t\t$this->givenOptions[$strOptionName] = $strOptionValue;\n\t\t}\n\n\t\tif ($this->isSetOption('help')) {\n\t\t\t$this->printHelp();\n\t\t}\n\n\t\t// validate required params\n\t\t$options = $this->getAllConfigOptions();\n\t\tforeach ($options as $key => $config) {\n\t\t\tif ($config->getType() !== self::OPTION_TYPE_REQUIRED) {\n\t\t\t\t// check there is not given options and have default values.\n\t\t\t\t$optional = $config->getDefaultValue();\n\n\t\t\t\tif (false === $this->isSetOption($key) && $optional != null) {\n\t\t\t\t\t$this->givenOptions[$key] = $optional;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$optionValue = $this->getOptionValue($key);\n\t\t\tif (empty($optionValue)) {\n\t\t\t\t$this->printHelp('Missing required param [' . $key . '].');\n\t\t\t}\n\t\t}\n\t}", "public function parse_options(){\n\t\t\n\t\t//switch (explode(',',$this->options)){case title: $return[]='title: {usw}';break;} $this->parsed_options=implode(',',return);\n\t\t\n\t\t$this->parsed_options=\"chart: {\trenderTo: 'container',\tdefaultSeriesType: 'area',\t\tinverted: true},\n\t\t\t\t\ttitle: {\ttext: 'ein Beispiel'},\n\t\t\t\t\tsubtitle: {\tstyle: {position: 'absolute',right: '0px',\tbottom: '10px'\t}},\n\t\t\t\t\tlegend: {\tlayout: 'vertical',\talign: 'right',\tverticalAlign: 'top',x: -150,y: 100,floating: true,\tborderWidth: 1,\tbackgroundColor: '#FFFFFF'},\n\t\t\t\t\txAxis: {categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']},\n\t\t\t\t\tyAxis: {title: {text: 'x-Axentitel'},labels: {formatter: function() {return this.value;}},min: 0},\n\t\t\t\t\t\";\n\t\treturn true;\n\t}", "public function parseOptions()\n {\n echo \"Parsing command line options...\";\n\n $options = getopt(\"c:s:v:f:x:p:b:\");\n\n // Check whether arguments were passed as required correctly\n\n // The config file\n if (is_null($options['c'])) {\n $this->getUsage(\"You must specify a config file.\");\n }\n\n // Section in the config file\n if (is_null($options['s'])) {\n $this->getUsage(\"You must specify a section in the config file.\");\n }\n\n // Target version specified (if specified)\n if (array_key_exists('v', $options)) {\n if (!is_null($options['v']) && !is_numeric($options['v'])) {\n $this->getUsage(\"Version should be numeric or null.\");\n } else if ($options['v'] < 0) {\n $this->getUsage(\"Target version is less than 0. Preventing space-time continuum collapse: exiting...\");\n }\n } else {\n // if option v was not specified, set it to its default of null\n $options['v'] = null;\n }\n\n // Which branch are the deltas coming from?\n if (!array_key_exists('b', $options)) {\n $this->setBranch('trunk');\n } else {\n $this->setBranch($options['b']);\n }\n\n $this->setRequestedVersion($options['v']);\n\n // if no parser update provider is given, sets it to null in order for\n // the setter method to set the default one\n if (!array_key_exists('p', $options)) {\n $options['p'] = null;\n }\n\n $this->setUpdateParserProvider($options['p']);\n\n // Current version (if specified)\n if (array_key_exists('f', $options)) {\n if (!is_null($options['f']) && !is_numeric($options['f'])) {\n $this->getUsage(\"Current version should be numeric or null.\");\n } else if ($options['f'] < 0) {\n $this->getUsage(\"Current version specified is less than 0. Preventing space-time continuum collapse: exiting...\");\n }\n } else {\n // if option f was not specified, set it to null\n $options['f'] = null;\n }\n\n $this->setForceCurrentVersion($options['f']);\n\n // Check whether the specified config file exists\n if (!file_exists($options['c'])) {\n $this->getUsage(\"Specified config file does not exist.\");\n }\n\n try {\n $config = new Zend_Config_Xml($options['c'], $options['s']);\n } catch (Zend_Config_Exception $e) {\n $this->getUsage($e);\n }\n\n $this->setConfig($config);\n\n // Get dbManager config which tells us the association of deltas\n // to branches.\n $this->parseDbManagerConfig();\n\n echo \"done.\\n\";\n }", "public function parse_opts() : array {\n\t\tself::$opts = (object) json_decode( @file_get_contents( __DIR__.\"/opts.json\" ) );\n\t\tself::$opts = [ self::$opts->paste, self::$opts->expire ];\n\t\treturn self::$opts;\n\t}", "abstract function options();", "abstract protected function readOptions(array $options);", "public function testOptionParsing() {\n\t\t$JsEngine = new OptionEngineHelper($this->View);\n\n\t\t$result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'key' => 1));\n\t\t$expected = 'key:1, url:\"\\\\/posts\\\\/view\\\\/1\"';\n\t\t$this->assertEquals($expected, $result);\n\n\t\t$result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'success' => 'doSuccess'), array('success'));\n\t\t$expected = 'success:doSuccess, url:\"\\\\/posts\\\\/view\\\\/1\"';\n\t\t$this->assertEquals($expected, $result);\n\t}", "protected function prepareOptions()\n {\n $options = $this->getOptions();\n $input = [];\n\n foreach($options as $option)\n {\n $input[] = $this->option($option[0]);\n }\n\n $larapath = $this->laravel['path'];\n $lastnsdelim = strrpos($input[1], '\\\\');\n\n $this->options[$options[0][0]] = $input[0] ?: substr($input[1], 0, $lastnsdelim);\n $this->options[$options[1][0]] = substr($input[1], $lastnsdelim);\n $this->options[$options[2][0]] = $input[2] ?: ExtStr::tableize($input[1]);\n $this->options[$options[3][0]] = $input[3] ?: $this->options[$options[1][0]].'Closure';\n $this->options[$options[4][0]] = $input[4] ?: ExtStr::tableize($input[1].'Closure');\n $this->options[$options[5][0]] = $input[5] ? $input[5] : $larapath . '/models';\n $this->options[$options[6][0]] = $input[6] ? $input[6] : $larapath . '/database/migrations';\n }", "function magictoolbox_WordPress_MagicScroll_parse_option_from_string($options) {\n $opt = array();\n\n $options = explode(\";\", $options);\n array_pop($options);\n\n foreach ($options as $value) {\n $value = trim($value);\n if (!empty($value)) {\n $value = explode(\":\", $value);\n // $opt[$value[0]] = trim($value[1]);\n $k = array_shift($value);\n $v = join(\":\",$value);\n $opt[$k] = trim($v);\n }\n }\n return $opt;\n}", "private function parseArguments($_arg)\n {\n /**\n * ARGUMENT LIST:\n * ::TASK TO PERFORM\n * --create-upload : create new mms order templates and upload accepted state xml file to MAX\n * --create-only : Only generate xml files and do not upload\n * --upload-xml '/path/to/file.xml': Only upload xml file to MAX. Specify /path/to/file.xml\n * --create-templates : Delete, if any existing templates, and create new templates for mms orders\n *\n * ::CONFIG\n * --set-data-path '/path/to/folder': set directory to save mms xml files.\n * --set-config-path '/path/to/file.json' : set path to file to read/write configuration.\n * --get-config-path : Give location of config file\n * --get-data-path '/path/to/folder': set directory to save mms xml files.\n * --create-config-file '/path/to/config.json' : create a default config file.\n * --set-config 'key:value'\n * --get-config\n */\n if ($_arg && is_array($_arg)) {\n if (count($_arg) >= 1 && count($_arg) <= 3) {\n // Fetch double hyphen specified argument\n $_arg_items = preg_grep(\"/--/\", $_arg);\n \n if (count($_arg_items) == 1) {\n // : Expected argument count - we expect only 1 argument\n switch ($_arg_items[1]) {\n case \"--create-only\":\n {\n $this->create_only();\n break;\n }\n case \"--upload-xml\":\n {\n $this->upload_xml();\n break;\n }\n case \"--set-data-path\":\n {\n break;\n }\n case \"--set-config-path\":\n {\n break;\n }\n case \"--get-data-path\":\n {\n break;\n }\n case \"--get-config-path\":\n {\n break;\n }\n case \"--create-config-file\":\n {\n break;\n }\n case \"--set-config\":\n {\n break;\n }\n case \"--get-config\":\n {\n break;\n }\n case \"--create-upload\":\n {\n $this->create_upload();\n break;\n }\n // If option not any of the above options given then print usage\n default:\n {\n $this->printUsage();\n break;\n }\n }\n } else \n if (count($_arg_items) >= 2) {\n // : Cannot have more than 1 option given as an argument => return FALSE and add to error array\n $this->printUsage('Too many arguments given. Please see usage print out below.');\n } else \n if (count($_arg_items) == 0) {\n $this->add_to_log(__FUNCTION__, \"No arguments provided, using default behaviour: \" . $this->_default_func);\n // : No arguments given => return default task\n $this->_default();\n }\n }\n }\n }", "public function parse()// : void\n\t{\n\t\tforeach( $this -> options[ 'command' ] as $command => $params )\n\t\t{\n\t\t\t//- Parsing -//\n\t\t\t$result = null;\n\t\t\tpreg_match_all(\n\t\t\t\t$params[ 'regex' ], \n\t\t\t\t$this -> text, \n\t\t\t\t$result, \n\t\t\t\tPREG_PATTERN_ORDER\n\t\t\t);\n\n\t\t\t//- Set result -//\n\t\t\t$this -> value[ $command ] = array();\n\t\t\t$this -> errors[ $command ] = array();\n\t\t\tforeach( $params[ 'value' ] as $key => $index )\n\t\t\t{\n\t\t\t\tif( !isset( $result[ $index ][ 0 ] ) )\n\t\t\t\t{\n\t\t\t\t\t$this -> errors[ $command ][ $key ] = \"Command not valid\";//TODO: change\n\t\t\t\t\t\n\t\t\t\t\t$this -> valid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//- Set value -//\n\t\t\t\t$this -> value[ $command ][ $key ] = $result[ $index ][ 0 ];\n\t\t\t}\t\t\t\n\t\t}\n\t}", "function parseCliOptions() {\n // ENABLE the following line you want to use the Command library.\n // $cmdOptions = new Commando\\Command();\n\n // Define first option\n $cmdOptions->option()\n ->require()\n ->aka('site_path')\n ->describedAs('Site path you want to export (e.g. /var/www/myproject)');\n\n // Define a boolean flag \"-c\" aka \"--capitalize\"\n $cmdOptions->option('v')\n ->aka('verbose')\n ->describedAs('Verbose output')\n ->boolean();\n\n global $verbose;\n $verbose = $cmdOptions['verbose'];\n\n global $site_path;\n $site_path = $cmdOptions[0];\n}", "private function parseSettings($opts){\n\t\tif (!is_array($opts)) $opts=array('authz_reuse'=>(bool)$opts);\n\t\tif (!isset($opts['authz_reuse'])) $opts['authz_reuse']=true;\n\n\t\t$diff=array_diff_key(\n\t\t\t$opts,\n\t\t\tarray_flip(array('authz_reuse','notAfter','notBefore'))\n\t\t);\n\n\t\tif (!empty($diff)){\n\t\t\tthrow new Exception('getCertificateChain(s): Invalid option \"'.key($diff).'\"');\n\t\t}\n\n\t\treturn $opts;\n\t}", "public function processOptions(array &$options)\n {\n }", "public function testParsingMultipleSeparateShortOptions()\n {\n $request = $this->parser->parse('foo -r -f -d');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertNull($request->getOptionValue('r'));\n $this->assertNull($request->getOptionValue('f'));\n $this->assertNull($request->getOptionValue('d'));\n $this->assertEquals([], $request->getArgumentValues());\n }", "protected function parser_options() {\n\n return [\n 'allow_php_eval' => $this->option( 'allow_php_eval' ),\n 'template' => rtrim( $this->template_dir(), '/' ) . '/' . ltrim( $this->template, '/' ),\n ];\n\n }", "abstract protected function options(): array;", "public function getOptionParser(){\n $parser = parent::getOptionParser();\n $parser->description(__('RADIUSdesk console for various tasks'));\n \n $parser->addOption('ping', array(\n 'help' => 'Do a ping monitor test',\n 'boolean' => true\n ));\n $parser->addOption('heartbeat', array(\n 'help' => 'Do a heartbeat monitor test',\n 'boolean' => true\n ));\n\n $parser->addArgument('action', array(\n 'help' => 'The action to do',\n 'required' => true,\n 'choices' => array('mon','restart_check','debug_check','auto_close','mon_dynamic')\n ));\n \n $parser->epilog('Have alot of fun....');\n return $parser;\n }", "protected static abstract function getOptions();", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n $parser->addSubcommand('check', [\n 'help' => 'Checking if domain is available',\n 'parser' => [\n 'arguments' => [\n 'domain' => [\n 'required' => true\n ],\n ]\n ]\n ]);\n $parser->addSubcommand('create', [\n 'help' => 'Register domain',\n 'parser' => [\n 'arguments' => [\n 'domain' => [\n 'required' => true\n ],\n 'owner' => [\n 'required' => true\n ],\n 'admin' => [\n 'required' => true\n ],\n ],\n 'options' => [\n 'period' => [\n 'help' => 'Number of years (default 1)'\n ],\n ],\n ]\n ]);\n $parser->addSubcommand('info', [\n 'help' => 'Domain info',\n 'parser' => [\n 'arguments' => [\n 'name' => [\n 'required' => true\n ],\n ]\n ]\n ]);\n $parser->addSubcommand('transfer', [\n 'help' => 'Domain transfer',\n 'parser' => [\n 'arguments' => [\n 'name' => [\n 'required' => true\n ],\n 'authInfo' => [\n 'required' => true\n ],\n 'fname' => [\n 'required' => true\n ],\n 'lname' => [\n 'required' => true\n ],\n ]\n ]\n ]);\n return $parser;\n }", "abstract public function getOptions();", "public function processOptions()\n {\n $sShortOptions = '';\n $aLongOptions = [];\n\n foreach ($this->hOptionList as $hOption)\n {\n $sOptionValueMod = '';\n\n if (isset($hOption['value']))\n {\n if ($hOption['value'] == self::OPTION_VALUE_ALLOW)\n {\n $sOptionValueMod = '::';\n }\n elseif ($hOption['value'] == self::OPTION_VALUE_REQUIRE)\n {\n $sOptionValueMod = ':';\n }\n }\n\n if (isset($hOption['short']))\n {\n $sShortOptions .= $hOption['short'] . $sOptionValueMod;\n }\n\n if (isset($hOption['long']))\n {\n $aLongOptions[] = $hOption['long'] . $sOptionValueMod;\n }\n }\n\n $hActiveOptions = getopt($sShortOptions, $aLongOptions);\n\n if (isset($hActiveOptions['h']) || isset($hActiveOptions['help']))\n {\n $this->displayHelp();\n }\n\n return $hActiveOptions;\n }", "function parseOptions($optionsArray) {\n\n print \"\\nParsing options...\\n\";\n\n // need to check $optionsArray for dependencies\n $fileOpt = array_search(\"--file\", $optionsArray);\n $dryOpt = array_search(\"--dry_run\", $optionsArray);\n $dbOpt = array_search(\"--create_table\", $optionsArray);\n $testOpt = array_search(\"--test\", $optionsArray);\n \n if (($dryOpt >= 1) && ($fileOpt === FALSE)) {\n // d'oh\n print \"\\nWARN: a filename option was not found.\\n\";\n outputHelp();\n interceptExit();\n } \n elseif (($dryOpt >= 1) && ($fileOpt >= 1)) {\n if ($fileOpt + 1 > (sizeof($optionsArray) - 1)) {\n print \"\\nWARN: no filename option.\\n\";\n outputHelp();\n interceptExit();\n }\n else {\n parseFilename($optionsArray[$fileOpt + 1], FALSE);\n }\n }\n elseif ($fileOpt >= 1) {\n // check have a filename too\n if ($fileOpt + 1 > (sizeof($optionsArray) - 1)) {\n print \"\\nWARN: no filename option.\\n\";\n outputHelp();\n interceptExit();\n }\n else {\n // check have sql connection info\n parseSQLoptions($optionsArray);\n parseFilename($optionsArray[$fileOpt + 1], TRUE);\n }\n }\n elseif ($dbOpt >= 1) {\n parseSQLoptions();\n createTable(); \n }\n elseif ($testOpt >=1) {\n parseSQLoptions($optionsArray);\n testDBconnect();\n }\n else {\n print \"\\nWARN: error parsing commandline options.\\n\";\n outputHelp();\n interceptExit();\n }\n }", "public static function parse_args() {\n self::$args = getopt('ha:t:l', array('help'));\n\n switch(true) {\n case array_key_exists('h', self::$args):\n case array_key_exists('help', self::$args):\n print self::$help_usage . self::$help_short_desc . self::$help_args_list;\n exit;\n case array_key_exists('t', self::$args):\n case array_key_exists('l', self::$args):\n return self::$args;\n default:\n print self::$help_usage . PHP_EOL;\n exit;\n }\n }", "private function getOptions()\n {\n $inputString = (string) $this->input;\n $options = [];\n\n // Remove the first two arguments from the array (c/call and the name)\n $content = explode(' ', $inputString, 3);\n if (sizeof($content) > 2 && strpos($inputString, '=') === false) {\n throw new \\Exception(\"Option syntax should contain an equal sign. Ex: --executable=php\");\n }\n if (sizeof($content) > 2 && strpos($inputString, '--') === false) {\n throw new \\Exception(\"Option syntax should contain double dashes. Ex: --executable=php\");\n }\n\n // Parse out all of the options\n $pieces = explode('--', $content[2]);\n array_shift($pieces);\n\n foreach ($pieces as $piece) {\n $piece = trim($piece);\n list($name, $value) = explode('=', $piece, 2);\n\n if (strpos($value, \"'[\") === 0 && strpos($value, \"]'\") === (strlen($value) - 2)) {\n $csv = trim(str_replace(['[', ']'], '', $value), \"'\");\n $value = str_getcsv($csv, ',');\n }\n\n $options[$name] = $value;\n }\n\n return $options;\n }", "function process_cli_options($aStageManager)\n{\n\t//by the time this function is executed, Regisseur class will have been loaded & usable.\n\treturn $aStageManager->processOptionsForCLI(Regisseur::DEFAULT_CLI_SHORT_OPTIONS . 'b');\n}", "public function testParsingMultipleShortOptions()\n {\n $request = $this->parser->parse('foo -rfd');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertNull($request->getOptionValue('r'));\n $this->assertNull($request->getOptionValue('f'));\n $this->assertNull($request->getOptionValue('d'));\n $this->assertEquals([], $request->getArgumentValues());\n }", "public function parse(): OptionPage;", "protected function getOptions() {}", "protected function getOptions() {}", "protected function getOptions() {}", "private function parse_options()\n\t\t{\n\t\t\t$options = $this->options;\n\n\t\t\tforeach ( $options as $option ) {\n\n\t\t\t\tif ( $option[ 'type' ] == 'heading' ) {\n\t\t\t\t\t$tab_name = sanitize_title( $option[ 'name' ] );\n\t\t\t\t\t$this->tab_headers = array( $tab_name => $option[ 'name' ] );\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$option[ 'tab' ] = $tab_name;\n\t\t\t\t$tabs[ $tab_name ][ ] = $option;\n\n\t\t\t}\n\n\t\t\t$this->tabs = $tabs;\n\n\t\t\treturn $tabs;\n\t\t}", "function plugin_validate_options($opts){ \t\r\n\t\treturn $opts;\r\n\t}", "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n $parser->setDescription('This is RBAC utility, which wraps acl cli');\n // $parser->addArgument('add_rule',[\n // 'help' => 'Add hierachical rules to acos table',\n // ]);\n\n return $parser;\n }", "protected function getOptions()\n {\n return [\n [\n 'filter',\n null,\n InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,\n 'A string pattern used to match entities that should be processed.'\n ],\n [\n 'force',\n 'f',\n InputOption::VALUE_NONE,\n 'Force to overwrite existing mapping files.'\n ],\n [\n 'from-database',\n null,\n null,\n 'Whether or not to convert mapping information from existing database.'\n ],\n [\n 'extend',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Defines a base class to be extended by generated entity classes.'\n ],\n [\n 'num-spaces',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Defines the number of indentation spaces.',\n 4\n ],\n [\n 'namespace',\n null,\n InputOption::VALUE_OPTIONAL,\n 'Defines a namespace for the generated entity classes, if converted from database.'\n ],\n ];\n }", "function arg_check($argv,$argc,$opt){\n $parse_error = false;\n foreach ($argv as $param_count => $value) {\n\n if ($param_count == 0) continue; //TODO: handle stdin and\n\n if ($value == \"--help\" && $param_count === 1) { //help was called, exiting with 0\n help();\n }\n if ($value == \"-n\" ){\n $opt->generate_header = false;\n continue;\n }\n if (preg_match(INPUTRGX, $value) === 1 ) { //--input=\n $opt->in_filename = get_filename(MATCHINFILENAME,$value);\n continue;\n }\n if (preg_match(OUTPUTRGX, $value) === 1 ) { //--output=\n $opt->out_filename = get_filename(MATCHOUTFILENAME,$value);\n $opt->write_to_file = true;\n continue;\n }\n if (preg_match(ROOTRGX, $value) === 1 ) { //-r=\n $opt->wrap_root = true;\n $opt->wrap_root_text = get_filename(MATCHROOTRGX,$value); // actually returns name of root tag not filename\n continue;\n }\n if (preg_match(ARRAYRGX, $value) === 1 ) { //--array-name\n $opt->array_text = get_filename(MATCHARRAYRGX,$value);\n continue;\n }\n if (preg_match(ITEMRGX, $value) === 1 ) { //--item-name\n $opt->item_text = get_filename(MATCHITEMRGX,$value);\n continue;\n }\n if ($value === \"-s\") { //-s\n $opt->string_is_attribute = false;\n continue;\n }\n if ($value === \"-i\") { //-i\n $opt->int_is_attribute = false;\n continue;\n }\n if ($value === \"-l\") { //-l\n $opt->values_to_elements = true;\n continue;\n }\n if ($value === \"-t\" || $value === \"--index-items\" ) { //-t\n $opt->index_items = true;\n continue;\n }\n if ($value === \"-a\" || $value === \"--array-size\" ) { //-a\n $opt->array_size = true;\n continue;\n }\n if (preg_match(REPLACEELEMENTRGX, $value) === 1 ) { //--h\n $opt->substitute_element = true;\n $opt->substitute_string = get_filename(MATCHELEMENTREPLACEMENTTGX,$value);\n continue;\n }\n if ($value === \"-c\" ) { //-c\n $opt->substitute_value = true;\n continue;\n }\n if (preg_match(STARTINDEXRGX, $value) === 1 ) { //--start\n $opt->change_start_index = true;\n $opt->index = get_filename(MATCHSTARTINDEXRGX,$value);\n continue;\n }\n $parse_error = true; //ending with error\n break;\n }\n check_start_index($opt); //check value entered after --start=\n\n if (check_element_validity($opt->wrap_root_text,$opt) || //check validity of\n check_element_validity($opt->array_text,$opt) || //entered params\n check_element_validity($opt->item_text,$opt) ) {\n err(\"Invalid element\",50);\n }\n\n if ($parse_error ) {\n err(\"Invalid parameters, try --help for more\",1); //ERR\n }\n }", "protected function _parseOptions ($data) {\n $mode = 0;\n $section = '';\n $values = array ();\n\n # Character classes\n $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $digits = '0123456789';\n $sectionchar = $letters . $digits . '_-.';\n $separatorchar = $sectionchar;\n\n # Convert Mac and MS-DOS line-feeds into Unix line-feeds. This\n # simplifies code below.\n $data = preg_replace ('/\\r\\n|\\r/', \"\\n\", $data);\n\n # Read line of data into buffer\n $i = 0;\n $n = strlen ($data);\n $done = false;\n while (!$done) {\n\n # Peek next character\n if ($i < $n) {\n $c = substr ($data, $i, 1);\n } else {\n $c = 'EOF';\n }\n\n # Deal with line\n switch ($mode) {\n case 0:\n # Initial mode\n switch ($c) {\n case ' ':\n case \"\\n\":\n case \"\\t\":\n # Ignore white space\n $i += strspn ($data, \" \\n\\t\", $i);\n break;\n\n case '[':\n # Start of section name\n $mode = 100;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case 'EOF':\n # Normal end of file\n $done = true;\n break;\n\n case ';':\n # Ignore\n $i++;\n break;\n\n default:\n if (strpos ($letters, $c) !== false) {\n # Option name\n $mode = 200;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 100:\n # Start of section name\n $i++;\n $section = '';\n $mode = 101;\n break;\n\n case 101:\n # Section name continued\n switch ($c) {\n case ']':\n # End of section name\n $mode = 0;\n $i++;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n $len = strspn ($data, $sectionchar, $i);\n if ($len > 0) {\n # Character in section name\n $section .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 200:\n # Start of option name\n $key = '';\n $value = '';\n $mode = 201;\n /*FALLTHROUGH*/\n\n case 201:\n # Option name continued\n switch ($c) {\n case ':':\n case '=':\n # Start of value\n $i++;\n $mode = 300;\n break;\n\n case ' ':\n case \"\\t\":\n # End of option name\n $mode = 202;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case \"\\n\":\n # Option name does not end in colon\n $mode = 999;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n $len = strspn ($data, $letters . $digits, $i);\n if ($len > 0) {\n # Option name\n $key .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 202:\n # Space after option name\n switch ($c) {\n case ':':\n case '=':\n # Start of value\n $i++;\n $mode = 300;\n break;\n\n case ' ':\n case \"\\t\":\n # Ignore white space\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n case \"\\n\":\n # Option name does not end in colon\n $mode = 999;\n break;\n\n case 'EOF':\n # Unexpected end of file\n $mode = 998;\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 300:\n # Space before option value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore white space before value\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case ';':\n case \"\\n\":\n # Line feed means no value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # No value provided\n $mode = 398;\n break;\n\n case '\"':\n # Start of quoted string\n $i++;\n $mode = 320;\n break;\n\n case '<':\n # Start of multiline-data\n $i++;\n $mode = 330;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Start of unquoted string\n $mode = 310;\n }\n break;\n\n case 310:\n # Start of unquoted string\n switch ($c) {\n case ';':\n case \"\\n\":\n # Linefeed ends value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # EOF ends value\n $mode = 398;\n break;\n\n case ' ':\n case \"\\t\":\n # Space ends value\n $i++;\n $mode = 312;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Slash in value\n $value .= $c;\n $i++;\n }\n break;\n\n default:\n # Regular characters within unqouted string\n $len = strcspn ($data, \" \\t\\n/#;\", $i);\n if ($len > 0) {\n $value .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 312:\n # Space after unquoted value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore excess white space\n $i++;\n break;\n\n case ';':\n case \"\\n\":\n # End of value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # End of value\n $mode = 399;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 320:\n # Inside quoted string\n switch ($c) {\n case 'EOF':\n # Missing close quote\n $mode = 998;\n break;\n\n case '\\\\':\n # Escape character\n $i++;\n $mode = 322;\n break;\n\n case '\"':\n # End of quoted string\n $i++;\n $mode = 323;\n break;\n\n default:\n # Regular characters inside string\n $len = strcspn ($data, '\\\\\"', $i);\n if ($len > 0) {\n $value .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 322:\n # Escaped character inside quoted string\n switch ($c) {\n case 'EOF':\n # Backslash at the end of file\n $mode = 998;\n break;\n\n default:\n # Escaped character\n $value .= $c;\n $i++;\n $mode = 320;\n }\n break;\n\n case 323:\n # Space after quoted value\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore excess white space after quoted value\n $i++;\n break;\n\n case ';':\n case \"\\n\":\n # End of value\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # End of value\n $mode = 399;\n break;\n\n case '#':\n case '/':\n # Comment\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n } else {\n # Not a comment\n $mode = 999;\n }\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 330:\n # Start of multi-line value\n switch ($c) {\n case '<':\n # Ignore any number of less than signs. That is,\n # sequences <EOF, <<<EOF and <<<<<<EOF all begin\n # multi-line value alike.\n $i++;\n break;\n\n case ' ':\n case \"\\t\":\n case \"\\n\":\n # Missing separator string\n $mode = 999;\n break;\n\n case 'EOF':\n # Missing separator string\n $mode = 998;\n break;\n\n default:\n # Any other character starts separator string\n $separator = '';\n $mode = 331;\n }\n break;\n\n case 331:\n # Separator string\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Space ends separator\n $mode = 332;\n break;\n\n case \"\\n\":\n # Line-feed starts the value\n $i++;\n $mode = 333;\n break;\n\n case 'EOF':\n # Unterminated value\n $mode = 998;\n break;\n\n default:\n # Collect separator string\n $len = strspn ($data, $separatorchar, $i);\n if ($len > 0) {\n $separator .= substr ($data, $i, $len);\n $i += $len;\n } else {\n # Invalid character\n $mode = 999;\n }\n }\n break;\n\n case 332:\n # Space after separator string\n switch ($c) {\n case ' ':\n case \"\\t\":\n # Ignore spaces\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case \"\\n\":\n # Line-feed starts the multi-line value\n $i++;\n $mode = 333;\n break;\n\n case 'EOF':\n # Unterminated string\n $mode = 998;\n break;\n\n default:\n # Invalid character\n $mode = 999;\n }\n break;\n\n case 333:\n # Inside multi-line value\n $pos = strpos ($data, \"\\n$separator\", $i - 1);\n if ($pos !== false) {\n\n # Compute length of value\n $len = $pos - $i;\n if ($len > 0) {\n\n # Extract value up until the possible separator\n $value .= substr ($data, $i, $len);\n $i += $len;\n\n }\n\n # Remember starting position of possible separator\n $separatorpos = $i;\n\n # Skip separator\n if (substr ($data, $i, 1) == \"\\n\") {\n $i++;\n }\n $i += strlen ($separator);\n\n # Continue parsing after separator\n $mode = 334;\n\n } else {\n\n # Unterminated string\n $mode = 998;\n\n }\n break;\n\n case 334:\n # White space after possible separator\n switch ($c) {\n case ';':\n case \"\\n\":\n # End of row\n $i++;\n /*FALLTHROUGH*/\n\n case 'EOF':\n # Store value as string\n $mode = 399;\n break;\n\n case ' ':\n case \"\\t\":\n # Ignore excess white space\n $i += strspn ($data, \" \\t\", $i);\n break;\n\n case '#':\n case '/':\n # Skip comments\n $len = $this->_getComment ($data, $i);\n if ($len > 0) {\n # Valid comment\n $i += $len;\n break;\n }\n /*FALLTHROUGH*/\n\n default:\n # Text follows separator so the separator was\n # fake. Store separator as value and continue\n # looking for real separator.\n $i = $separatorpos;\n if (substr ($data, $i, 1) == \"\\n\") {\n $value .= \"\\n\";\n $i++;\n }\n $len = strlen ($separator);\n $value .= substr ($data, $i, $len);\n $i += $len;\n $mode = 333;\n }\n break;\n\n case 398:\n # Convert value to proper data type and store\n $value = $this->_convertValue ($value);\n /*FALLTHROUGH*/\n\n case 399:\n # Store value as is\n if ($section != '' && $section != 'global') {\n\n # Store in named section\n $key = $section . '.' . $key;\n\n } else {\n\n # Store in global section\n $key = \"global.$key\";\n\n }\n $values[$key] = $value;\n $mode = 0;\n break;\n\n case 998:\n throw new Exception ('Unexpected EOF');\n\n case 999:\n $str = substr ($data, $i, 15);\n throw new Exception (\"Parse error near $str\");\n\n default:\n throw new Exception (\"Invalid mode $mode\");\n }\n }\n return $values;\n }", "public function options() {}", "public function parse(array $args, $permuteArgs = TRUE)\n\t{\n\t\t$this->triggeredOpts = array();\n\t\t$this->wantsArg = NULL;\n\t\t$toPermuteArgs = array();\n\t\twhile (!empty($args)) {\n\t\t\t$arg = array_shift($args);\n\t\t\tif ($this->isOptionsEnd($arg)) {\n\t\t\t\tbreak;\n\n\t\t\t} elseif (($opt = $this->isLongOpt($arg)) !== FALSE) {\n\t\t\t\t$this->checkArgAlreadyRequired();\n\t\t\t\t$this->parseLongOpt($opt);\n\n\t\t\t} elseif (($opts = $this->isShortOpt($arg)) !== FALSE) {\n\t\t\t\t$this->checkArgAlreadyRequired();\n\t\t\t\t$this->parseShortOpts($opts);\n\n\t\t\t} elseif ($this->wantsArg) {\n\t\t\t\t$this->wantsArg->value = $arg;\n\t\t\t\t$this->wantsArg = NULL;\n\n\t\t\t} else {\n\t\t\t\t$toPermuteArgs[] = $arg;\n\t\t\t\tif ($permuteArgs === FALSE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->checkArgAlreadyRequired();\n\t\t$this->arguments = array_merge($toPermuteArgs, $args);\n\t\treturn $this;\n\t}", "function parseCommandOptions(&$optionInfo)\n{\n global $optionList;\n global $argc;\n global $argv;\n $addMsg = \"\\nTry \\\"pg_stats_reporter --help\\\" for more information.\";\n\n for ($i = 1; $i < $argc; $i++) {\n\n if (strncmp($argv[$i], '--', 2) == 0) {\n $opt_array = explode(\"=\", ltrim($argv[$i], \"-\"), 2);\n switch ($opt_array[0]) {\n case \"elevel\":\n break;\n case \"help\":\n displayUsage();\n exit(0);\n case \"version\":\n displayVersion();\n exit(0);\n case \"list\":\n case \"dblist\":\n case \"size\":\n case \"index\":\n case \"onlybody\":\n case \"all\":\n case \"inline\":\n $optionInfo[$opt_array[0]] = true;\n break;\n case \"host\":\n case \"port\":\n case \"username\":\n case \"password\":\n case \"dbname\":\n case \"repositorydb\":\n case \"instid\":\n case \"beginid\":\n case \"endid\":\n case \"begindate\":\n case \"enddate\":\n case \"outputdir\":\n case \"resprefix\":\n if (count($opt_array) == 2)\n $optionInfo[$opt_array[0]] = $opt_array[1];\n else {\n if (++$i == $argc) {\n elog(ERROR, \"Option requires argument -- '%s'\" . $addMsg, $opt_array[0]);\n }\n $optionInfo[$opt_array[0]] = $argv[$i];\n }\n break;\n default:\n elog(ERROR, \"Invalid option -- '%s'\" . $addMsg, $opt_array[0]);\n }\n } else if ($argv[$i][0] == '-') {\n $opt = ltrim($argv[$i], \"-\");\n switch ($opt) {\n case \"l\":\n case \"L\":\n case \"s\":\n case \"a\":\n $optionInfo[$optionList[$opt]] = true;\n break;\n case \"R\":\n case \"i\":\n case \"b\":\n case \"e\":\n case \"B\":\n case \"E\":\n case \"O\":\n if (++$i == $argc) {\n elog(ERROR, \"Option requires argument -- '%s'\" . $addMsg, $opt);\n }\n $optionInfo[$optionList[$opt]] = $argv[$i];\n break;\n default:\n elog(ERROR, \"Invalid option -- '%s'\" . $addMsg, $opt);\n }\n } else {\n elog(ERROR, \"Unrecognized option: '%s'\" . $addMsg, $opt);\n }\n }\n checkOptionCombination($optionInfo, $addMsg);\n}", "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n\n $parser->addOptions([\n 'dry' => ['short' => 'd', 'help' => 'Dry run'],\n 'process' => ['short' => 'p', 'help' => 'Process Pay Period']\n ]);\n\n return $parser;\n }", "public function getOptionParser()\n\t{\n\t\n\t\t$parser = parent::getOptionParser();\n\t\t\n\t\t$parser->description(__d('cake_console', 'The Update Shell runs all needed jobs to update production\\'s database.'));\n\t\t\n\t\t$parser->addSubcommand('vector_scan', array(\n\t\t\t'help' => __d('cake_console', 'Scans vectors and makes sure they are associated with a hostnames/ipaddresses listing.'),\n\t\t\t'parser' => array(\n\t\t\t\t'arguments' => array(\n//\t\t\t\t\t'minutes' => array('help' => __d('cake_console', 'Change the time frame from 5 minutes ago.'))\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\t\n\t\treturn $parser;\n\t}", "function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = \\false)\n {\n }", "protected function get_options()\n\t{}", "function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}", "static function extractOptions( $frame, array $args ) {\n\t\t//initiate variables\n\t\t$options = array();\n\t\t$tempTasks = array();\n\t\t$tasks = array();\n\t\t$taskDetails = array();\n\t\t$options['eva duration in minutes'] = 0;\n\t\t$tasksDurationPercentTotal = array();\n\t\t$tasksDurationPercentTotal['actor1'] = 0;\n\t\t$tasksDurationPercentTotal['actor2'] = 0;\n\t\t$tasksDurationPercentTotal['actor3'] = 0;\n\t\t// $tasksDurationPercentTotal['ev2'] = 0; DELETE\n\t\t// $tasksDurationPercentTotal['iv'] = 0; /* This will be removed once the IV section is fixed */\n\t\t$options['number of colors designated'] = 0;\n\t\t$options[\"color red meaning\"]=\"\";\n\t\t$options[\"color white meaning\"]=\"\";\n\t\t$options[\"color orange meaning\"]=\"\";\n\t\t$options[\"color pink meaning\"]=\"\";\n\t\t$options[\"color green meaning\"]=\"\";\n\t\t$options[\"color yellow meaning\"]=\"\";\n\t\t$options[\"color blue meaning\"]=\"\";\n\t\t$options[\"color gray meaning\"]=\"\";\n\t\t$options[\"color black meaning\"]=\"\";\n\t\t$options[\"color white meaning\"]=\"\";\n\t\t$options[\"color purple meaning\"]=\"\";\n $options['rows']['actor1']['tasks']=array();\n $options['rows']['actor2']['tasks']=array();\n $options['rows']['actor3']['tasks']=array();\n $options['hardware required for eva']=array();\n\t\t$options['fixedwidth']=\"\";\n\t\t$options['insolation duration']=\"\";\n\t\t$options['eclipse duration']=\"\";\n\t\t$options['include day night']=\"\";\n\t\t$options['first cycle day night']=\"\";\n\t\t$options['first cycle duration']=\"\";\n\n\t\tforeach ( $args as $arg ) {\n\t\t\t//Convert args with \"=\" into an array of options\n\t\t\t$pair = explode( '=', $frame->expand($arg) , 2 );\n\t\t\tif ( count( $pair ) == 2 ) {\n\t\t\t\t$name = strtolower(trim( $pair[0] )); //Convert to lower case so it is case-insensitive\n\t\t\t\t$value = trim( $pair[1] );\n\n\t\t\t\t//this switch could be consolidated\n\t\t\t\tswitch ($name) {\n\t\t\t\t\tcase 'format':\n\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\tif ( $value==\"full\" ) {\n\t\t\t\t \t$options[$name] = \"full\";\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = \"compact\";\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t\tcase 'fixedwidth':\n\t\t\t\t\t\tif ( $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'st index':\n\t\t\t\t $options[$name] = $value;\n\t\t\t\t break;\n\t\t\t\t case 'title':\n\t\t\t\t\t if ( !isset($value) || $value==\"\" ) {\n\t\t\t\t \t$options['title']= \"No title set!\";\n\t\t\t\t } else {\n\t\t\t\t \t$titleParts = explode( '@@@', $value);\n\t\t\t\t \t$options[$name] = $titleParts[0];\n\t\t\t\t \t$options['title link'] = $titleParts[1];\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'eva title':\n\t\t\t\t\t if ( isset($value) && $value!=\"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'depends on':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'hardware required for eva':\n\t\t\t\t $i = 1; /* Task id */\n\t\t\t\t\t if( isset($value) && $value!=\"\" ){\n\t\t\t\t\t\t $tempHardware = explode ( '&&&', $value, 2 );\n\t\t\t\t\t\t $hardware = explode ( '&&&', $tempHardware[1] );\n\t\t\t\t\t\t foreach ( $hardware as $item ) {\n\t\t\t\t\t\t \t$itemDetails = explode( '@@@', $item);\n\t\t\t\t\t\t \t$options['hardware required for eva'][$i]['title'] = trim($itemDetails[0]);\n\t\t\t\t\t\t \t$options['hardware required for eva'][$i]['mission'] = trim($itemDetails[1]);\n\t\t\t\t\t\t \t$i++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t break;\n\t\t\t case 'parent related article':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'eva duration hours':\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['eva duration in minutes'] += (60 * $value);\n\t\t\t\t break;\n\t\t\t\t case 'eva duration minutes':\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['eva duration in minutes'] += $value;\n\t\t\t\t break;\n\t\t\t case 'actor 1 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 1';\n\t\t\t\t \t$options['rows']['actor1']['name'] = 'Actor 1';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 2';\n\t\t\t\t \t$options['rows']['actor2']['name'] = 'Actor 2';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 3';\n\t\t\t\t \t$options['rows']['actor3']['name'] = 'Actor 3';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 1 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 1 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'actor1': // NEED TO SPLIT OUT SO THIS DOESN'T HAVE GET-AHEADS ADDED\n\t\t\t\t\t // this should have blocks with \"Start time\" (not duration)\n\t\t\t\t\t // an option should be included to sync with a task on EV1 and/or EV2\n\t\t\t\t\t // break;\n\t\t\t\t case 'actor2':\n\t\t\t\t case 'actor3':\n\t\t\t\t\t $i = 1; /* Task id */\n\t\t\t\t\t\t$tasksDuration = 0;\n\t\t\t\t\t if( isset($value) && $value!=\"\" ){\n\t\t\t\t\t\t $tempTasks = explode ( '&&&', $value, 2 );\n\t\t\t\t\t\t $tasks = explode ( '&&&', $tempTasks[1] );\n\n\t\t\t\t\t\t foreach ( $tasks as $task ) {\n\t\t\t\t\t\t \t$taskDetails = explode( '@@@', $task);\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['title'] = $taskDetails[0];\n\t\t\t\t\t\t \tif ($taskDetails[1] == ''){$taskDetails[1] = '0';}\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationHour'] = $taskDetails[1];\n\t\t\t\t\t\t \tif ($taskDetails[2] == ''|'0'){$taskDetails[2] = '00';}\n\t\t\t\t\t\t \tif ( strlen($taskDetails[2]) == 1 ){\n\t\t\t\t\t\t \t\t$temp = $taskDetails[2];\n\t\t\t\t\t\t \t\t$taskDetails[2] = '0' . $temp;}\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationMinute'] = $taskDetails[2];\n\t\t\t\t\t\t \t//Lame attempt to set min block width - move value out?\n\t\t\t\t\t\t \t// if ($options['rows'][$name]['tasks'][$i]['durationHour'] == 0 && $options['rows'][$name]['tasks'][$i]['durationMinute']<15){\n\t\t\t\t\t\t \t// \t$options['rows'][$name]['tasks'][$i]['blockWidth'] = 15;\n\t\t\t\t\t\t \t// }\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['relatedArticles'] = $taskDetails[3];\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['color'] = $taskDetails[4];\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['details'] = trim($taskDetails[5]);\n\n\t\t\t\t\t\t \t// Calc task duration as % of total EVA duration\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationPercent'] = round((((60 * $taskDetails[1]) + $taskDetails[2]) / $options['eva duration in minutes']) * 100);\n\n\t\t\t\t\t\t \t// append task duration\n\t\t\t\t\t\t \t$tasksDuration += (60 * $taskDetails[1]) + $taskDetails[2];\n\t\t\t\t\t\t \t// append task duration percent\n\t\t\t\t\t\t \t$tasksDurationPercentTotal[$name] += $options['rows'][$name]['tasks'][$i]['durationPercent'];\n\t\t\t\t\t\t \t// print_r( $tasksDurationPercentTotal['ev1'] );\n\t\t\t\t\t\t \t$i++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t // NEED TO ADD EGRESS/INGRESS DURATION TO $tasksDuration\n\t\t\t\t\t // NEED TO ACCOUNT FOR EV1 vs EV2\n\n\t\t\t\t\t // Commented out due to new template structure including egress/ingress as tasks\n\t\t\t\t\t // $tasksDuration += $options['ev2 egress duration minutes']['durationMinutes'] + $options['ev2 ingress duration minutes']['durationMinutes'];\n\n\t\t\t\t\t // sum of time allotted to tasks\n\t\t\t\t\t $options['rows'][$name]['tasksDuration'] = $tasksDuration;\n\n\t\t\t\t\t // $options[$name] = self::extractTasks( $value );\n\n\t\t\t\t\t // Check if $tasksDuration < $options['duration'] (EVA duration)\n\t\t\t\t\t if( $options['rows'][$name]['enable get aheads']=='true' && $tasksDuration < $options['eva duration in minutes'] ){\n\t\t\t\t\t \t// Need to add \"Get Aheads\" block to fill timeline gap\n\n\t\t\t\t\t \t// Calculate difference between EVA duration and tasksDuration\n\t\t\t\t\t \t$timeLeft = $options['eva duration in minutes'] - $tasksDuration;\n\t\t\t\t\t \t$timeLeftHours = floor($timeLeft/60);\n\t\t\t\t\t \t$timeLeftMinutes = $timeLeft%60;\n\n\t\t\t\t\t\t\t// THE FOLLOWING MOVES GET-AHEADS TO SECOND-TO-LAST SPOT\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['title'] = $options['rows'][$name]['tasks'][$i-1]['title'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationHour'] = $options['rows'][$name]['tasks'][$i-1]['durationHour'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationMinute'] = $options['rows'][$name]['tasks'][$i-1]['durationMinute'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['relatedArticles'] = $options['rows'][$name]['tasks'][$i-1]['relatedArticles'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['color'] = $options['rows'][$name]['tasks'][$i-1]['color'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['details'] = trim($options['rows'][$name]['tasks'][$i-1]['details']);\n\n\t\t\t\t\t \t// Now set Get-Aheads block data\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['title'] = 'Get-Aheads';\n\t\t\t\t\t\t \tif ($timeLeftHours == ''){$timeLeftHours = '0';}\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['durationHour'] = $timeLeftHours;\n\t\t\t\t\t\t \tif ($timeLeftMinutes == ''|'0'){$timeLeftMinutes = '00';}\n\t\t\t\t\t\t \tif ( strlen($timeLeftMinutes) == 1 ){\n\t\t\t\t\t\t \t\t$temp = $timeLeftMinutes;\n\t\t\t\t\t\t \t\t$timeLeftMinutes = '0' . $temp;}\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['durationMinute'] = $timeLeftMinutes;\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['relatedArticles'] = 'Get-Ahead Task';\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['color'] = 'white';\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['details'] = 'Auto-generated block based on total EVA duration and sum of task durations';\n\t\t\t\t\t \t// Calc task duration as % of total EVA duration\n\t\t\t\t\t \t// $options['rows'][$name]['tasks'][$i]['durationPercent'] = round((((60 * $timeLeftHours) + $timeLeftMinutes) / $options['eva duration in minutes']) * 100);\n\t\t\t\t\t\t\t$options['rows'][$name]['tasks'][$i-1]['durationPercent'] = 100 - $tasksDurationPercentTotal[$name];\n\n\t\t\t\t\t }\n\n\t\t\t\t break;\n\t\t\t case 'color white meaning':\n\t\t\t case 'color red meaning':\n\t\t\t case 'color orange meaning':\n\t\t\t case 'color yellow meaning':\n\t\t\t case 'color blue meaning':\n\t\t\t case 'color green meaning':\n\t\t\t case 'color pink meaning':\n\t\t\t case 'color purple meaning':\n\t\t\t case 'color gray meaning':\n\t\t\t case 'color black meaning':\n\t\t\t\t if ( isset($value) && $value!=\"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['number of colors designated'] ++;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'ev1':\n\t\t\t\t // Unique things for this column? Would have to split above into these two (can't do both cases)\n\t\t\t\t break;\n\t\t\t case 'ev2':\n\t\t\t\t // Unique things for this column?\n\t\t\t\t break;\n\t\t\t case 'insolation duration':\n\t\t\t case 'eclipse duration':\n\t\t\t case 'first cycle duration':\n\t\t\t case 'include day night':\n\t\t\t case 'first cycle day night':\n\t\t\t\t $value = strtolower(trim($value));\n\t\t\t \tif ( isset($value) && $value!=\"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t \tbreak;\n\t\t\t default: //What to do with args not defined above\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//Check for empties, set defaults\n\t\t//Default 'title'\n\t\t// if ( !isset($options['title']) || $options['title']==\"\" ) {\n\t\t// \t$options['title']= \"No title set!\"; //no default, but left here for future options\n\t // }\n\n\t //Logic for $duration\n\t //Need logic for\n\t //1. What to do if not 14:254? (e.g. 'Dog')\n\t //2. split hours:minutes and sum minutes\n\t //3. default = 6:30\n\t // if ( isset($value) ) {\n\t // \t$input_time = explode( ':', $value , 2 );\n\t\t// if ( count ( $input_time ) == 2) {\n\t\t// \t$hours = trim( $input_time[0] );\n\t\t// \t$minutes = trim( $input_time[1] );\n\t\t// \t$duration = ($hours * 60) + $minutes;\n\t\t// } else {\n\t\t// \t$duration = $value;\n\t\t// }\n\t\t// }\n\n\t\t// foreach ($variable as $key => $value) {\n\t\t// \t# code...\n\t\t// }\n\n\t\treturn $options;\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['attach', '-a', InputOption::VALUE_OPTIONAL, 'The pipes to attach to the workflow.', null],\n\t\t\t['unguard', '-u', InputOption::VALUE_NONE, 'Do not make this workflow validate data.', null],\n\t\t];\n\t}", "public function getOptionParser() {\n\t\t$subcommandParser = [\n\t\t\t'options' => [\n\t\t\t\t'project' => [\n\t\t\t\t\t'short' => 'P',\n\t\t\t\t\t'help' => 'Project',\n\t\t\t\t\t'default' => '',\n\t\t\t\t],\n\t\t\t\t'debug' => [\n\t\t\t\t\t'help' => 'Debug output (for network/connection details).',\n\t\t\t\t\t'boolean' => true\n\t\t\t\t],\n\t\t\t]\n\t\t];\n\t\t$subcommandParserPull = $subcommandParser;\n\t\t$subcommandParserPull['options'] += [\n\t\t\t'language' => [\n\t\t\t\t\t'short' => 'l',\n\t\t\t\t\t'help' => 'Language',\n\t\t\t\t\t'default' => ''\n\t\t\t\t],\n\t\t\t\t'resource' => [\n\t\t\t\t\t'short' => 'r',\n\t\t\t\t\t'help' => 'Resource',\n\t\t\t\t\t'default' => '',\n\t\t\t\t],\n\t\t\t\t'reviewed-only' => [\n\t\t\t\t\t'short' => 'R',\n\t\t\t\t\t'help' => 'Only reviewed translations',\n\t\t\t\t\t'boolean' => true,\n\t\t\t\t],\n\t\t\t\t'plugin' => [\n\t\t\t\t\t'short' => 'p',\n\t\t\t\t\t'help' => 'Plugin',\n\t\t\t\t\t'default' => ''\n\t\t\t\t],\n\t\t\t\t'dry-run' => [\n\t\t\t\t\t'short' => 'd',\n\t\t\t\t\t'help' => 'Dry run the command, no files will actually be modified. Should be combined with verbose!',\n\t\t\t\t\t'boolean' => true\n\t\t\t\t],\n\t\t];\n\n\t\treturn parent::getOptionParser()\n\t\t\t->description('The Convert Shell converts files from dos/unix/mac to another system')\n\t\t\t->addSubcommand('resources', [\n\t\t\t\t'help' => 'List all resources.',\n\t\t\t\t'parser' => $subcommandParser\n\t\t\t])\n\t\t\t->addSubcommand('languages', [\n\t\t\t\t'help' => 'List all languages.',\n\t\t\t\t'parser' => $subcommandParser\n\t\t\t])\n\t\t\t->addSubcommand('language', [\n\t\t\t\t'help' => 'Get project infos to a specific language.',\n\t\t\t\t'parser' => $subcommandParser\n\t\t\t])\n\t\t\t->addSubcommand('statistics', [\n\t\t\t\t'help' => 'Display project statistics.',\n\t\t\t\t'parser' => $subcommandParser\n\t\t\t])\n\t\t\t->addSubcommand('pull', [\n\t\t\t\t'help' => 'Pull PO files.',\n\t\t\t\t'parser' => $subcommandParserPull\n\t\t\t])\n\t\t\t->addSubcommand('push', [\n\t\t\t\t'help' => 'Push PO files.',\n\t\t\t\t'parser' => $subcommandParserPull\n\t\t\t])\n\t\t\t->addSubcommand('update', [\n\t\t\t\t'help' => 'Update POT files.',\n\t\t\t\t'parser' => $subcommandParserPull\n\t\t\t])\n\t\t\t->addSubcommand('language_info', [\n\t\t\t\t'help' => 'Get infos to a specific language.',\n\t\t\t\t'parser' => $subcommandParser\n\t\t\t]);\n\t}", "protected function getOptions()\n {\n return [\n ['format', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The names of formats you would like to generate.', null],\n ['regenerate', 'r', InputOption::VALUE_NONE, 'Whether all files must be regenerated even if exist.', null],\n ['temp', 't', InputOption::VALUE_NONE, 'Whether the temporary storage must be processed.', null],\n ];\n }", "public function getOptionParser() {\n\t\t$parser = Shell::getOptionParser();\n\t\treturn $parser->description(\n\t\t\t\t__d('cake_console', 'I18nJS Shell generates a .pot file with JS translations and generates JS file(s) from .po file(s).')\n\t\t\t)->addSubcommand('extract_js', array(\n\t\t\t\t'help' => __d('cake_console', 'Extract JS translatable strings and create I18nJS .pot file'),\n\t\t\t\t'parser' => $this->ExtractJs->getOptionParser()\n\t\t\t))->addSubcommand('create_js', array(\n\t\t\t\t'help' => __d('cake_console', 'Create JS translation files from .po file(s)'),\n\t\t\t\t'parser' => $this->CreateJs->getOptionParser()\n\t\t));\n\t}", "public function testParse()\n {\n $args=array(\n 'script_name.php',\n '-a',\n 1,\n '-b',\n 2,\n '--c',\n 3,\n '--d',\n 4,\n '--ee',\n 6,\n '-ff',\n 7,\n '-g',\n '-i',\n '8',\n 'tow',\n 'three'\n\n );\n\n $_SERVER['argv'] = $args;\n $go = new Getopt();\n $options = $go->parse()->getParsedOptions();\n\n $expected = array(\n '_'=>array('--c',3,'--d',4,'-ff',7, 'tow', 'three'),\n 'a'=>1,\n 'b'=>2,\n 'ee'=>6,\n 'g'=>1,\n 'i'=>8\n\n );\n\n $this->assertArraysEqual($options, $expected);\n\n }", "public function setupOptions()\n {\n $action = new Action('generate', 'Generate fake data');\n //output adapter\n $option = new Option('o', 'output', 'Specify output adapter. Available outputs: db.[orm|odm], file.[csv|json|xml]');\n $option->setRequired(true);\n $action->addOption($option);\n\n $option = new Option('d', 'dest', 'Specify the destination point. It might be a file, or database collection or table');\n $option->setRequired(true);\n $action->addOption($option);\n\n //data specification\n $option = new Option('s', 'spec', 'Specify the file path containing data specification in JSON format');\n $option->setRequired(true);\n $action->addOption($option);\n\n //count of data\n $option = new Option('c', 'count', 'Specify the count of data to generate');\n $option->setRequired(true);\n $action->addOption($option);\n\n $this->addTaskAction($action);\n }", "protected function initOptions()\n {\n }", "public function testGetOptionParser()\n {\n $this->shell->loadTasks();\n $parser = $this->shell->getOptionParser();\n $this->assertArrayHasKey('init', $parser->subcommands());\n $this->assertArrayHasKey('extract', $parser->subcommands());\n }", "protected function parseCliArguments()\n {\n $shortOptions = 'm::h::';\n $longOptions = array(\n 'months:',\n 'output:',\n 'output_folder:',\n 'help::'\n );\n $options = getopt($shortOptions, $longOptions);\n\n if (isset($options['h']) || isset($options['help']))\n {\n throw new NoticeException('Please see information on how to use this tool below', 1);\n }\n\n if (!isset($options['m']) && !isset($options['months']))\n {\n throw new ErrorException('You must supply a months value using either -m or --months');\n }\n\n if (isset($options['m']) || isset($options['months']))\n {\n $months = (isset($options['m'])) ? $options['m'] : $options['months'];\n if (!is_numeric($months))\n {\n throw new ErrorException('The months value provided is not a numeric');\n }\n if ($months < 1)\n {\n throw new ErrorException('The months value needs to be greater than zero');\n }\n if ($months > 1200)\n {\n throw new ErrorException('You want \"' . $months . '\" months of output? Come on now, your being a bit silly. How about we try using \"1200\", Surely ten years will be enough for now?');\n }\n $this->setNumberOfMonths($months);\n }\n\n if (isset($options['output']))\n {\n $this->setOutput($options['output']);\n }\n\n if (isset($options['output_folder']))\n {\n $this->setOutputFolder($options['output_folder']);\n }\n }", "static function extractOptions( $frame, array $args ) {\n\t\t\n\t\t// set default options\n\t\t$options = array(\n\t\t\t'example' => 1\n\t\t);\n\n\t\t\n\t\t$tempTasks = array();\n\t\t$tasks = array();\n\t\t$taskDetails = array();\n\t\t$tasksDurationPercentTotal = array();\n\t\t$tasksDurationPercentTotal['actor1'] = 0;\n\t\t$tasksDurationPercentTotal['actor2'] = 0;\n\t\t$tasksDurationPercentTotal['actor3'] = 0;\n\n\t\t\n\t\tforeach ( $args as $arg ) {\n\t\t\t//Convert args with \"=\" into an array of options\n\t\t\t$pair = explode( '=', $frame->expand($arg) , 2 );\n\t\t\tif ( count( $pair ) == 2 ) {\n\t\t\t\t$name = strtolower(trim( $pair[0] )); //Convert to lower case so it is case-insensitive\n\t\t\t\t$value = trim( $pair[1] );\n\n\t\t\t\t//this switch could be consolidated\n\t\t\t\tswitch ($name) {\n\t\t\t\t\tcase 'format': \n\t\t\t\t\t\t$value = strtolower($value);\n\t\t\t\t\t\tif ( $value==\"full\" ) {\n\t\t\t\t \t$options[$name] = \"full\";\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = \"compact\";\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t\tcase 'fixedwidth': \n\t\t\t\t\t\tif ( $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'st index':\n\t\t\t\t $options[$name] = $value;\n\t\t\t\t break;\n\t\t\t\t case 'title':\n\t\t\t\t\t if ( !isset($value) || $value==\"\" ) {\n\t\t\t\t \t$options['title']= \"No title set!\";\n\t\t\t\t } else {\n\t\t\t\t \t$titleParts = explode( '@@@', $value);\n\t\t\t\t \t$options[$name] = $titleParts[0];\n\t\t\t\t \t$options['title link'] = $titleParts[1];\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'eva title':\n\t\t\t\t\t if ( isset($value) && $value!=\"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'depends on':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'hardware required for eva':\n\t\t\t\t $i = 1; /* Task id */\n\t\t\t\t\t if( isset($value) && $value!=\"\" ){\n\t\t\t\t\t\t $tempHardware = explode ( '&&&', $value, 2 );\n\t\t\t\t\t\t $hardware = explode ( '&&&', $tempHardware[1] );\n\t\t\t\t\t\t foreach ( $hardware as $item ) {\n\t\t\t\t\t\t \t$itemDetails = explode( '@@@', $item);\n\t\t\t\t\t\t \t$options['hardware required for eva'][$i]['title'] = trim($itemDetails[0]);\n\t\t\t\t\t\t \t$options['hardware required for eva'][$i]['mission'] = trim($itemDetails[1]);\n\t\t\t\t\t\t \t$i++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t break;\n\t\t\t case 'parent related article':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'eva duration hours':\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['eva duration in minutes'] += (60 * $value);\n\t\t\t\t break;\n\t\t\t\t case 'eva duration minutes':\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['eva duration in minutes'] += $value;\n\t\t\t\t break;\n\t\t\t case 'actor 1 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 1';\n\t\t\t\t \t$options['rows']['actor1']['name'] = 'Actor 1';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 2';\n\t\t\t\t \t$options['rows']['actor2']['name'] = 'Actor 2';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 name':\n\t\t\t\t if ( isset($value) && $value != \"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['name'] = $value;\n\t\t\t\t } else {\n\t\t\t\t \t$options[$name] = 'Actor 3';\n\t\t\t\t \t$options['rows']['actor3']['name'] = 'Actor 3';\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 1 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 display in compact view':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['display in compact view'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 1 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor1']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 2 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor2']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'actor 3 enable get aheads':\n\t\t\t\t if ( isset($value) ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['rows']['actor3']['enable get aheads'] = $value;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t\t case 'actor1': // NEED TO SPLIT OUT SO THIS DOESN'T HAVE GET-AHEADS ADDED\n\t\t\t\t\t // this should have blocks with \"Start time\" (not duration)\n\t\t\t\t\t // an option should be included to sync with a task on EV1 and/or EV2\n\t\t\t\t\t // break;\n\t\t\t\t case 'actor2':\n\t\t\t\t case 'actor3':\n\t\t\t\t\t $i = 1; /* Task id */\n\t\t\t\t\t\t$tasksDuration = 0;\n\t\t\t\t\t if( isset($value) && $value!=\"\" ){\n\t\t\t\t\t\t $tempTasks = explode ( '&&&', $value, 2 );\n\t\t\t\t\t\t $tasks = explode ( '&&&', $tempTasks[1] );\n\t\t\t\t\t\t \n\t\t\t\t\t\t foreach ( $tasks as $task ) {\n\t\t\t\t\t\t \t$taskDetails = explode( '@@@', $task);\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['title'] = $taskDetails[0];\n\t\t\t\t\t\t \tif ($taskDetails[1] == ''){$taskDetails[1] = '0';}\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationHour'] = $taskDetails[1];\n\t\t\t\t\t\t \tif ($taskDetails[2] == ''|'0'){$taskDetails[2] = '00';}\n\t\t\t\t\t\t \tif ( strlen($taskDetails[2]) == 1 ){\n\t\t\t\t\t\t \t\t$temp = $taskDetails[2];\n\t\t\t\t\t\t \t\t$taskDetails[2] = '0' . $temp;}\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationMinute'] = $taskDetails[2];\n\t\t\t\t\t\t \t//Lame attempt to set min block width - move value out?\n\t\t\t\t\t\t \t// if ($options['rows'][$name]['tasks'][$i]['durationHour'] == 0 && $options['rows'][$name]['tasks'][$i]['durationMinute']<15){\n\t\t\t\t\t\t \t// \t$options['rows'][$name]['tasks'][$i]['blockWidth'] = 15;\n\t\t\t\t\t\t \t// }\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['relatedArticles'] = $taskDetails[3];\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['color'] = $taskDetails[4];\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['details'] = trim($taskDetails[5]);\n\n\t\t\t\t\t\t \t// Calc task duration as % of total EVA duration\n\t\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationPercent'] = round((((60 * $taskDetails[1]) + $taskDetails[2]) / $options['eva duration in minutes']) * 100);\n\n\t\t\t\t\t\t \t// append task duration\n\t\t\t\t\t\t \t$tasksDuration += (60 * $taskDetails[1]) + $taskDetails[2];\n\t\t\t\t\t\t \t// append task duration percent\n\t\t\t\t\t\t \t$tasksDurationPercentTotal[$name] += $options['rows'][$name]['tasks'][$i]['durationPercent'];\n\t\t\t\t\t\t \t// print_r( $tasksDurationPercentTotal['ev1'] );\n\t\t\t\t\t\t \t$i++;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\n\t\t\t\t\t // NEED TO ADD EGRESS/INGRESS DURATION TO $tasksDuration\n\t\t\t\t\t // NEED TO ACCOUNT FOR EV1 vs EV2\n\n\t\t\t\t\t // Commented out due to new template structure including egress/ingress as tasks\n\t\t\t\t\t // $tasksDuration += $options['ev2 egress duration minutes']['durationMinutes'] + $options['ev2 ingress duration minutes']['durationMinutes'];\n\n\t\t\t\t\t // sum of time allotted to tasks\n\t\t\t\t\t $options['rows'][$name]['tasksDuration'] = $tasksDuration;\n\n\t\t\t\t\t // $options[$name] = self::extractTasks( $value );\n\n\t\t\t\t\t // Check if $tasksDuration < $options['duration'] (EVA duration)\n\t\t\t\t\t if( $options['rows'][$name]['enable get aheads']=='true' && $tasksDuration < $options['eva duration in minutes'] ){\n\t\t\t\t\t \t// Need to add \"Get Aheads\" block to fill timeline gap\n\n\t\t\t\t\t \t// Calculate difference between EVA duration and tasksDuration\n\t\t\t\t\t \t$timeLeft = $options['eva duration in minutes'] - $tasksDuration;\n\t\t\t\t\t \t$timeLeftHours = floor($timeLeft/60);\n\t\t\t\t\t \t$timeLeftMinutes = $timeLeft%60;\n\n\t\t\t\t\t\t\t// THE FOLLOWING MOVES GET-AHEADS TO SECOND-TO-LAST SPOT\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['title'] = $options['rows'][$name]['tasks'][$i-1]['title'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationHour'] = $options['rows'][$name]['tasks'][$i-1]['durationHour'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['durationMinute'] = $options['rows'][$name]['tasks'][$i-1]['durationMinute'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['relatedArticles'] = $options['rows'][$name]['tasks'][$i-1]['relatedArticles'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['color'] = $options['rows'][$name]['tasks'][$i-1]['color'];\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i]['details'] = trim($options['rows'][$name]['tasks'][$i-1]['details']);\n\n\t\t\t\t\t \t// Now set Get-Aheads block data\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['title'] = 'Get-Aheads';\n\t\t\t\t\t\t \tif ($timeLeftHours == ''){$timeLeftHours = '0';}\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['durationHour'] = $timeLeftHours;\n\t\t\t\t\t\t \tif ($timeLeftMinutes == ''|'0'){$timeLeftMinutes = '00';}\n\t\t\t\t\t\t \tif ( strlen($timeLeftMinutes) == 1 ){\n\t\t\t\t\t\t \t\t$temp = $timeLeftMinutes;\n\t\t\t\t\t\t \t\t$timeLeftMinutes = '0' . $temp;}\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['durationMinute'] = $timeLeftMinutes;\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['relatedArticles'] = 'Get-Ahead Task';\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['color'] = 'white';\n\t\t\t\t\t \t$options['rows'][$name]['tasks'][$i-1]['details'] = 'Auto-generated block based on total EVA duration and sum of task durations';\n\t\t\t\t\t \t// Calc task duration as % of total EVA duration\n\t\t\t\t\t \t// $options['rows'][$name]['tasks'][$i]['durationPercent'] = round((((60 * $timeLeftHours) + $timeLeftMinutes) / $options['eva duration in minutes']) * 100);\n\t\t\t\t\t\t\t$options['rows'][$name]['tasks'][$i-1]['durationPercent'] = 100 - $tasksDurationPercentTotal[$name];\n\n\t\t\t\t\t }\n\n\t\t\t\t break;\n\t\t\t case 'color white meaning':\n\t\t\t case 'color red meaning':\n\t\t\t case 'color orange meaning':\n\t\t\t case 'color yellow meaning':\n\t\t\t case 'color blue meaning':\n\t\t\t case 'color green meaning':\n\t\t\t case 'color pink meaning':\n\t\t\t case 'color purple meaning':\n\t\t\t\t if ( isset($value) && $value!=\"\" ) {\n\t\t\t\t \t$options[$name] = $value;\n\t\t\t\t \t$options['number of colors designated'] ++;\n\t\t\t\t }\n\t\t\t\t break;\n\t\t\t case 'ev1':\n\t\t\t\t // Unique things for this column? Would have to split above into these two (can't do both cases)\n\t\t\t\t break;\n\t\t\t case 'ev2':\n\t\t\t\t // Unique things for this column?\n\t\t\t\t break;\n\t\t\t default: //What to do with args not defined above\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $options;\n\t}", "public function parseOption(string $token);", "protected function parseOptions($opts)\n {\n $options = $this->defaultOptions;\n\n foreach (explode('&', $opts) as $opt) {\n $options[$opt] = true;\n }\n\n if ($options['js']) $options['full'] = true;\n\n return $options;\n }", "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n foreach ($this->_taskMap as $task => $option) {\n $taskParser = $this->{$task}->getOptionParser();\n $parser->addSubcommand(Inflector::underscore($task), [\n 'help' => $taskParser->getDescription(),\n 'parser' => $taskParser,\n ]);\n }\n\n return $parser;\n }", "public function configureOptions();", "private function parseArgs(){\n $args=$GLOBALS['argv'];\n $this->fileMode = 'w';\n \n if (count($args) < 2) {\n die(\"\\nNo conversion script selected\\n\\nUsage: php CreateFileFromCsv.php updateShipping [--verbose] [--sample] [--append]\\n\\n\");\n }\n\n $scriptName = $args[1];\n\n if($scriptName == 'list') {\n $this->listScripts();\n die(\"\\n\\n\");\n }\n\n if (class_exists($scriptName, true)) {\n $this->script = new $scriptName();\n } else {\n die(\"\\nCould not find script model of class $scriptName\\n\\n\");\n }\n\n unset($args[0], $args[1]);\n \n foreach($args as $arg) {\n\n $a = explode('=', $arg);\n\n switch(strtolower($a[0])) {\n case '--verbose':\n $this->verbose = true;\n break;\n \n case '--sample':\n if($a[1] ?? null && is_numeric($a[1])) {\n $this->sample = $a[1];\n echo \"Number of samples: {$this->sample}\";\n } else {\n $this->sample = 1;\n }\n\n $this->verbose = true;\n break;\n \n case '--append':\n $this->fileMode = 'a';\n break;\n\n case '--input':\n if($a[1]) {\n $this->input = $a[1];\n } else {\n die(\"No file specified with --input\");\n }\n break;\n\n case '--output':\n if($a[1]) {\n $this->output = $a[1];\n } else {\n die(\"No file specified with --output\");\n }\n break;\n\n case '--nonewline':\n $this->newline = '';\n break;\n\n case '--newline':\n $this->newline = \"\\n\";\n break;\n }\n }\n }", "public function process_options( $options )\n\t{\n\t\t// Trim strings\n\t\tforeach( $options as $k => &$v )\n\t\t{\n\t\t\tif( is_string($v) ) $v = trim( $v );\n\t\t}\n\t\t\n\t\treturn $options;\n\t}", "protected abstract function prepareConstructOption($options);", "protected function extractFormatOptions(array $options): array {\n\n\t\t\t// first option is the format\n\t\t\tarray_shift($options);\n\n\t\t\treturn $this->extractNamedOptions($options);\n\t\t}", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function settingsWithValidOptions()\n {\n return array(\n array(\n array('-o', 'option_value', '-f'),\n array('option1' => 'option_value', 'flag1' => true)\n ),\n array(\n array('--option1', 'option_value', '--flag1'),\n array('option1' => 'option_value', 'flag1' => true)\n ),\n array(\n array('-f', '--option1', 'option_value'),\n array('flag1' => true, 'option1' => 'option_value')\n )\n );\n }", "public function getOptionParser() {\n\t\t$parser = parent::getOptionParser();\n\t\t$parser->addSubcommand('generate', array('help' => 'Find models and regenerate the thumbnails.'));\n\t\treturn $parser;\n\t}", "function option_definition() {\n $options = parent::option_definition();\n $options['year_range'] = array('default' => '-3:+3');\n $options['granularity'] = array('default' => 'month');\n $options['default_argument_type']['default'] = 'date';\n $options['add_delta'] = array('default' => '');\n $options['use_fromto'] = array('default' => '');\n $options['title_format'] = array('default' => '');\n $options['title_format_custom'] = array('default' => '');\n return $options;\n }", "protected function parse() {}", "private function validOptions()\n {\n return $this->isNumeric() ? $this->options : array_keys($this->options);\n }", "public function options_load();", "protected function compileOptions(array $options)\n {\n $this->master = array_pull($options, 'master');\n\n $this->setPropertyFromOptions($options);\n\n if ([] !== $options) {\n foreach ($options as $key => $value) {\n if (is_numeric($key)) {\n// Multiple inputs in one container\n if (is_array($value)) {\n $group = [];\n foreach ($value as $key1 => $value1) {\n $group[$key1] = $value1;\n }\n $this->inputs[count($this->inputs) + 1] = $group;\n } else {\n $this->inputs[$value] = [];\n }\n } elseif (str_contains($key, '.')) {\n $this->inputs[$key] = $value;\n } else {\n $this->attributes[$key] = $value;\n }\n }\n }\n }", "protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}", "protected function _setOptions()\r\n {\r\n $this->addValidator('Extension',false, array('jpeg', 'jpg', 'png', 'case' => FALSE));\r\n \r\n $this->addValidator('MimeType', false, \r\n array('application/octet-stream', \r\n 'image/jpeg', 'image/png', 'headerCheck'=>TRUE));\r\n \r\n }", "public function parse($argv)\n {\n $this->parseCommandLineOptions($this->stripSpaces($argv));\n }", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('format', '%isd% %mobile%');\n }", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "function parse_argv() {\n \n // Get arguments.\n $arguments = $_SERVER['argv'];\n \n // Remove the calling script from the arguments.\n array_shift($arguments);\n \n // Parse the remaining arguments.\n foreach( $arguments as $index => $argument ) {\n \n // Split the argument.\n $split = explode('=', $argument);\n \n // Extract the option and value if applicable.\n $option = str_starts_with($split[0], '-') ? $split[0] : false;\n $value = $option ? $split[1] ?? null : $split[0];\n \n // Save the named option if found.\n if( $option ) {\n \n // Remove options delimiters from the option.\n $option = preg_replace('/^--?/', '', $option);\n \n // Save the option with its value.\n $arguments[$option] = $value;\n \n // Unset the original index.\n unset($arguments[$index]);\n \n }\n \n \n }\n \n // Return the parsed arguments.\n return $arguments;\n \n}", "private function createCommandLineOptions()\n {\n $options = $this->options;\n\n $cmdOptions = [];\n\n // Metadata (all, exif, icc, xmp or none (default))\n // Comma-separated list of existing metadata to copy from input to output\n $cmdOptions[] = '-metadata ' . $options['metadata'];\n\n // preset. Appears first in the list as recommended in the docs\n if (!is_null($options['preset'])) {\n if ($options['preset'] != 'none') {\n $cmdOptions[] = '-preset ' . $options['preset'];\n }\n }\n\n // Size\n $addedSizeOption = false;\n if (!is_null($options['size-in-percentage'])) {\n $sizeSource = filesize($this->source);\n if ($sizeSource !== false) {\n $targetSize = floor($sizeSource * $options['size-in-percentage'] / 100);\n $cmdOptions[] = '-size ' . $targetSize;\n $addedSizeOption = true;\n }\n }\n\n // quality\n if (!$addedSizeOption) {\n $cmdOptions[] = '-q ' . $this->getCalculatedQuality();\n }\n\n // alpha-quality\n if ($this->options['alpha-quality'] !== 100) {\n $cmdOptions[] = '-alpha_q ' . escapeshellarg($this->options['alpha-quality']);\n }\n\n // Losless PNG conversion\n if ($options['encoding'] == 'lossless') {\n // No need to add -lossless when near-lossless is used\n if ($options['near-lossless'] === 100) {\n $cmdOptions[] = '-lossless';\n }\n }\n\n // Near-lossles\n if ($options['near-lossless'] !== 100) {\n // We only let near_lossless have effect when encoding is set to \"lossless\"\n // otherwise encoding=auto would not work as expected\n if ($options['encoding'] == 'lossless') {\n $cmdOptions[] ='-near_lossless ' . $options['near-lossless'];\n }\n }\n\n if ($options['auto-filter'] === true) {\n $cmdOptions[] = '-af';\n }\n\n // Built-in method option\n $cmdOptions[] = '-m ' . strval($options['method']);\n\n // Built-in low memory option\n if ($options['low-memory']) {\n $cmdOptions[] = '-low_memory';\n }\n\n // command-line-options\n if ($options['command-line-options']) {\n array_push(\n $cmdOptions,\n ...self::escapeShellArgOnCommandLineOptions($options['command-line-options'])\n );\n }\n\n // Source file\n $cmdOptions[] = escapeshellarg($this->source);\n\n // Output\n $cmdOptions[] = '-o ' . escapeshellarg($this->destination);\n\n // Redirect stderr to same place as stdout\n // https://www.brianstorti.com/understanding-shell-script-idiom-redirect/\n $cmdOptions[] = '2>&1';\n\n $commandOptions = implode(' ', $cmdOptions);\n $this->logLn('command line options:' . $commandOptions);\n\n return $commandOptions;\n }", "public static function parse($argv = null) {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $argv);\n\n\t\t$argv = self::_applyFilter(get_class(), __FUNCTION__, $argv, array('event' => 'args'));\n\n\t\t$argv = ($argv) ? : $_SERVER['argv'];\n\n\t\tarray_shift($argv);\n\t\t\n\t\t$out = array();\n\n\t\tfor ($i = 0, $j = count($argv); $i < $j; $i++) {\n\t\t\t$arg = $argv[$i];\n\n\t\t\t// --foo --bar=baz\n\t\t\tif (substr($arg, 0, 2) === '--') {\n\t\t\t\t$eqPos = strpos($arg, '=');\n\n\t\t\t\t// --foo\n\t\t\t\tif ($eqPos === false) {\n\t\t\t\t\t$key = substr($arg, 2);\n\n\t\t\t\t\t// --foo value\n\t\t\t\t\tif ($i + 1 < $j && $argv[$i + 1][0] !== '-') {\n\t\t\t\t\t\t$value = $argv[$i + 1];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = isset($out[$key]) ? $out[$key] : true;\n\t\t\t\t\t}\n\t\t\t\t\t$out[$key] = $value;\n\t\t\t\t}\n\n\t\t\t\t// --bar=baz\n\t\t\t\telse {\n\t\t\t\t\t$key = substr($arg, 2, $eqPos - 2);\n\t\t\t\t\t$value = substr($arg, $eqPos + 1);\n\t\t\t\t\t$out[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -k=value -abc\n\t\t\telse if (substr($arg, 0, 1) === '-') {\n\t\t\t\t// -k=value\n\t\t\t\tif (substr($arg, 2, 1) === '=') {\n\t\t\t\t\t$key = substr($arg, 1, 1);\n\t\t\t\t\t$value = substr($arg, 3);\n\t\t\t\t\t$out[$key] = $value;\n\t\t\t\t}\n\t\t\t\t// -abc\n\t\t\t\telse {\n\t\t\t\t\t$chars = str_split(substr($arg, 1));\n\t\t\t\t\tforeach ($chars as $char) {\n\t\t\t\t\t\t$key = $char;\n\t\t\t\t\t\t$value = isset($out[$key]) ? $out[$key] : true;\n\t\t\t\t\t\t$out[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t\t// -a value1 -abc value2\n\t\t\t\t\tif ($i + 1 < $j && $argv[$i + 1][0] !== '-') {\n\t\t\t\t\t\t$out[$key] = $argv[$i + 1];\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// plain-arg\n\t\t\telse {\n\t\t\t\t$value = $arg;\n\t\t\t\t$out[] = $value;\n\t\t\t}\n\t\t}\n\n\t\tself::$args = $out;\n\n\t\t$out = self::_applyFilter(get_class(), __FUNCTION__, $out, array('event' => 'return'));\n\n\t\treturn $out;\n\t}", "private function parseArguments($argv) {\n\t\t$shortopts = \"h::i:o:p::d::s:c::\";\n\n\t\t$longopts = array(\n\t\t\t\"help::\", // --help\n\t\t\t\"input:\", // --input=file\n\t\t\t\"output:\", // --output=file\n\t\t\t\"pretty-xml::\", // --pretty-xml=k\n\t\t\t\"details::\", // --details=class_uses\n\t\t\t\"search:\", // --search=XPATH\n\t\t\t\"conflicts::\" // --conflicts\n\t\t);\n\n\t\t// Parsovani argumentu\n\t\t$options = getopt($shortopts, $longopts);\n\n\t\t// Pokud byl zadan neplatny argument typu: -hxxxxx\n\t\tif (array_key_exists('h', $options))\n\t\t\tif (is_bool($options['h']) === false)\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\n\t\t// Osetreni opakujicich se prepinacu\n\t\tforeach ($options as $value) {\n\t\t\tif (is_array($value))\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\t\t}\n\n\t\t// Osetreni neznameho argumentu\n\t\t$optionsLen = count($options);\n\t\tif ($optionsLen != (count($argv) - 1))\n\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\n\t\t// Kontrola kratkych prepinacu a dlouhych prepinacu: --output=file -o=file\n\t\t// Sjednoceni formatu na dlouhe prepinace, pro jednotne pouzivani dale\n\t\tforeach ($longopts as $value) {\n\t\t\t$firstChar = substr($value, 0, 1);\n\t\t\t$value = str_replace(\":\", \"\", $value);\n\n\t\t\t// Duplikace prepinacu\n\t\t\tif (array_key_exists($value, $options) && array_key_exists($firstChar, $options))\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\t\t\telse {\n\t\t\t\t// Sjednoceni na dlouhe prepinace: -o=file >>> --output=file\n\t\t\t\tif (array_key_exists($firstChar, $options)) {\n\t\t\t\t\t$options[$value] = $options[$firstChar];\n\t\t\t\t\tunset($options[$firstChar]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Test zda byl zadany --help|-h prepinac bez ostatnich\n\t\tif (array_key_exists(\"help\", $options)) {\n\t\t\tif ($optionsLen > 1)\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\n\t\t\t$this->getHelp();\n\t\t\texit(self::OK);\n\t\t}\n\n\t\t// Kontrola vstupu, zda existuje a jestli se da z daneho souboru cist\n\t\tif (array_key_exists(\"input\", $options)) {\n\t\t\tif (!file_exists($options['input']) || !is_readable($options['input']))\n\t\t\t\tthrow new customException(\"Bad input file.\", self::E_INPUT_FILE);\n\n\t\t\t$this->input = $options['input'];\n\t\t}\n\n\t\t// Kontrola vystupniho souboru, zda se da vytvorit a zapsat do neho\n\t\tif (array_key_exists(\"output\", $options)) {\n\t\t\tif (is_writable($options['output'])) {\n\t\t\t\t// Vytvori soubor pro zapis, pokud se nepodari skonci chybou\n\t\t\t\tif ( !($fw = fopen($options['output'], \"w\")) )\n\t\t\t\t\tthrow new customException(\"Bad output file.\", self::E_OUTPUT_FILE);\n\t\t\t} else {\n\t\t\t\t// Pokud existuje ale neni pro zapis, skonci chybou\n\t\t\t\tif (file_exists($options['output']))\n\t\t\t\t\tthrow new customException(\"Bad output file.\", self::E_OUTPUT_FILE);\n\n\t\t\t\t// Soubor neexistuje, vytvori se a pokud se nepodari, skonci chybou\n\t\t\t\tif ( !($fw = fopen($options['output'], \"w\")) )\n\t\t\t\t\tthrow new customException(\"Bad output file.\", self::E_OUTPUT_FILE);\n\t\t\t}\n\t\t\t$this->output = $options['output'];\n\t\t}\n\n\t\t// Kontrola pretty-xml, kontrola zda je to kladne cele cislo,\n\t\t// pokud nebylo zadane, nastavi se na predvolenou hodnotu\n\t\tif (array_key_exists(\"pretty-xml\", $options)) {\n\t\t\t// Kontrola zda obsahuje jen cisla\n\t\t\tif (ctype_digit($options['pretty-xml']))\n\t\t\t\t$this->prettyXml = intval($options['pretty-xml']);\n\n\t\t\t// Pokud nebyla nastavena prepinaci hodnota, pouzije se predvolena\n\t\t\telseif (is_bool($options['pretty-xml']) === true)\n\t\t\t\t$this->prettyXml = 4;\n\t\t\telse\n\t\t\t \tthrow new customException(\"Bad input format.\", self::E_ARG);\n\t\t}\n\n\t\t// Kontrola details, zda byl zadany a jestli byla zadana trida\n\t\tif (array_key_exists(\"details\", $options)) {\n\t\t\t$this->details = true;\n\n\t\t\tif ($options['details'] != \"\")\n\t\t\t\t$this->detailName = $options['details'];\n\t\t}\n\n\t\t// Zpracovani XPATH vyrazu\n\t\tif (array_key_exists(\"search\", $options)) {\n\t\t\tif ($options['search'] == \"\")\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\n\t\t\t$this->search = $options['search'];\n\t\t}\n\n\t\t// Zpracovani konfliktu a jejich vygenerovani do souboru\n\t\tif (array_key_exists(\"conflicts\", $options)) {\n\t\t\t$this->conflicts = true;\n\t\t\tif (is_bool($options['conflicts']) === false)\n\t\t\t\tthrow new customException(\"Bad input arguments. Try --help.\", self::E_ARG);\n\t\t}\n\t}", "public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n\n $parser->addSubcommand('event');\n $parser->addSubcommand('tracks');\n $parser->addSubcommand('talks');\n\n return $parser;\n }", "public function getOptionParser()\n {\n $parser = new ConsoleOptionParser('ouvidoria');\n $parser->setDescription(\n \"Este sistema foi feito para gerenciamento de ouvidoria do sistema, via Shell Console. \" .\n \"Para saber como manipular os comandos necessários, consulte a lista abaixo.\"\n );\n\n $parser->addSubcommand('status', [\n 'help' => 'Mostra todo o andamento estatístico da ouvidoria da Prefeitura de Coqueiral, mostranto dados quantitativos e os chamados (manifestos).',\n 'parser' => [\n 'description' => [\n 'Mostra todo o andamento estatístico da ouvidoria da Prefeitura de Coqueiral, mostranto dados quantitativos e os chamados (manifestos).',\n 'Esta funcionalidade mostra as informaçõe necessárias para execução de dados estatísticos do sistema'\n ],\n 'arguments' => [\n 'mode' => [\n 'help' => 'Modo de exibição do status do andamento da ouvidoria',\n 'default' => 'simple',\n 'choices' => ['simples', 'completo', 'chamados']\n ]\n ],\n 'options' => [\n 'email' => [\n 'short' => 'e',\n 'boolean' => true,\n 'help' => 'Envia as informações estatísticas para e-mail'\n ],\n 'email-address' => [\n 'short' => 'd',\n 'help' => 'Envia as informações estatísticas para e-mail pré-determinado'\n ],\n 'ocultar' => [\n 'short' => 'o',\n 'boolean' => true,\n 'help' => 'Não envia as informações no corpo do e-mail. As informações são enviadas em arquivo texto anexo.'\n ],\n 'mesclar' => [\n 'short' => 'm',\n 'boolean' => true,\n 'help' => 'Mescla o arquivo criado, enviado e-mail como arquivo anexo. Requer que seja salvo arquivo.'\n ],\n 'file' => [\n 'short' => 'f',\n 'boolean' => true,\n 'help' => 'Salva as informações num arquivo.'\n ],\n 'file-save' => [\n 'short' => 's',\n 'help' => 'Salva as informações no arquivo pré-determinado.'\n ],\n 'file-type' => [\n 'short' => 't',\n 'help' => 'Determina o formato do arquivo a ser salvo.',\n 'choices' => ['txt', 'csv', 'xml', 'json']\n ],\n 'file-type-auto' => [\n 'short' => 'a',\n 'boolean' => true,\n 'help' => 'Faz com que o sistema escolha automaticamente o formato do arquivo a ser salvo.'\n ]\n ]\n ]\n ]);\n\n return $parser;\n }", "protected function _options() {\n\t\t\treturn array();\n\t\t}", "public function parseGlobalOptions(stdClass $a_options)\n\t{\n\t\t\t\t\n\t}", "protected function createOptions()\n {\n $isPng = ($this->getMimeTypeOfSource() == 'image/png');\n\n $this->options2 = new Options();\n $this->options2->addOptions(\n new IntegerOption('alpha-quality', 85, 0, 100),\n new BooleanOption('auto-filter', false),\n new IntegerOption('default-quality', ($isPng ? 85 : 75), 0, 100),\n new StringOption('encoding', 'auto', ['lossy', 'lossless', 'auto']),\n new BooleanOption('low-memory', false),\n new BooleanOption('log-call-arguments', false),\n new IntegerOption('max-quality', 85, 0, 100),\n new MetadataOption('metadata', 'none'),\n new IntegerOption('method', 6, 0, 6),\n new IntegerOption('near-lossless', 60, 0, 100),\n new StringOption('preset', 'none', ['none', 'default', 'photo', 'picture', 'drawing', 'icon', 'text']),\n new QualityOption('quality', ($isPng ? 85 : 'auto')),\n new IntegerOrNullOption('size-in-percentage', null, 0, 100),\n new BooleanOption('skip', false),\n new BooleanOption('use-nice', false),\n new ArrayOption('jpeg', []),\n new ArrayOption('png', [])\n );\n }", "protected function assignOptions($options)\n {\n $this->parseTemplate=$options['template'];\n $this->extraOptions=$options['extraOptions'];\n }", "public function getOptionParser() {\n\t\t$parser = parent::getOptionParser();\n\t\treturn $parser->description(__d('users', 'The Users shell.'))\n\t\t\t->addSubcommand('user_import', array(\n\t\t\t\t'help' => __d('user_manager', 'Import description'),\n\t\t\t\t'parser' => $this->UserImport->getOptionParser(),\n\t\t\t));\n\t}", "function getOptions() ;", "function tidy_getopt(tidy $object, $option) {}", "protected function _prepareOptions()\n {\n // apply options\n if (isset($this->_deploy['set_time_limit'])) {\n // script needs time to proces huge amount of data (important)\n set_time_limit($this->_deploy['set_time_limit']);\n }\n if (isset($this->_deploy['memory_limit'])) {\n // adjust memory_limit if needed (not very important)\n ini_set('memory_limit', $this->_deploy['memory_limit']);\n }\n }", "function parse() {\n\t\t$this->parse_zones($this->get_product_text());\n\n\t\t// STEP 2: Parse out VTEC\n\t\t$this->parse_vtec();\n\n\t\t// STEP 3: Relay readiness\n\t\t$this->properties['relay'] = true;\n\n\t\t// FINAL: Return the properties array\n\t\treturn $this->properties;\n\t}" ]
[ "0.64434844", "0.63370687", "0.61559653", "0.583622", "0.569475", "0.5576943", "0.55347776", "0.5509084", "0.5475196", "0.5471261", "0.5428163", "0.54002935", "0.53544784", "0.53475493", "0.53296775", "0.5323861", "0.5245392", "0.52443326", "0.52404094", "0.52160716", "0.5211633", "0.52056277", "0.52056277", "0.52056277", "0.52056277", "0.52056277", "0.5195232", "0.5179747", "0.5170262", "0.5154126", "0.5144743", "0.5132806", "0.5114785", "0.51135975", "0.51125634", "0.51093304", "0.51089513", "0.51089513", "0.5105621", "0.51049197", "0.51017743", "0.509841", "0.50922203", "0.5078628", "0.5062329", "0.50616413", "0.50607884", "0.5058932", "0.50432813", "0.50343734", "0.5033161", "0.5029206", "0.5018567", "0.50143236", "0.50040185", "0.49891937", "0.49873137", "0.49826953", "0.49776888", "0.4966877", "0.4965348", "0.49612808", "0.494432", "0.4933214", "0.4918331", "0.4915504", "0.49154523", "0.48924506", "0.4879949", "0.48725894", "0.48673218", "0.48425418", "0.4824041", "0.482285", "0.48203322", "0.4808605", "0.4806091", "0.47918263", "0.47780514", "0.47728232", "0.47683966", "0.4767133", "0.4765408", "0.47549608", "0.47549608", "0.47534516", "0.47494766", "0.47405827", "0.47318736", "0.47188142", "0.47003832", "0.46856126", "0.46826115", "0.4671792", "0.46690753", "0.46604863", "0.46571895", "0.46524444", "0.46499985", "0.46425402", "0.46281186" ]
0.0
-1
Parse the fieldsets for Fractal.
protected function parseFieldsets(array $fieldsets, string $resourceKey, array $includes): array { $includes = array_map(function ($include) use ($resourceKey) { return "$resourceKey.$include"; }, $includes); foreach ($fieldsets as $key => $fields) { if (is_numeric($key)) { unset($fieldsets[$key]); $key = $resourceKey; } $fields = $this->parseFieldset($key, (array) $fields, $includes); $fieldsets[$key] = array_unique(array_merge(key_exists($key, $fieldsets) ? (array) $fieldsets[$key] : [], $fields)); } return array_map(function ($fields) { return implode(',', $fields); }, $fieldsets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFieldsetsAndFields() {\n\t\t$Dataset = new FormularFieldset(__('Your Dataset'));\n\t\t$Dataset->setHtmlCode($this->getCode());\n\t\t$Dataset->addInfo( __('You can specify which values show up in the overview of your activities.').'<br>'.\n\t\t\t\t\t\t\t__('This does not influence the detailed activity view, the form or any plugin.') );\n\n\t\t$this->Formular->addFieldset($Dataset);\n\t}", "private function setFields(): void\n {\n $fields = acf_get_block_fields(array('name' => 'acf/' . strtolower(str_replace('-', '', $this->getId()))));\n if (!empty($fields)) {\n if ('data' === $fields[0]['name']) {\n $parsedFields = $this->parseField($fields[0]);\n if (!empty($parsedFields['data'])) {\n $this->fields = $parsedFields['data'];\n }\n }\n }\n }", "public function parseFlexibles($flexibles)\n {\n foreach ($flexibles as $index => $flexible) {\n $flexible['__index'] = $index;\n $flexible['__layout'] = $flexible['acf_fc_layout'];\n unset($flexible['acf_fc_layout']);\n $flexibles[$index] = new FieldSet($flexible);\n }\n\n return $flexibles;\n }", "public function getFieldsets()\n {\n return $this->fieldsets;\n }", "public function prepareFieldset();", "public function getFieldSets() {\n\t\treturn $this->fieldsets;\n\t}", "public function getFieldsets(): Collection\n {\n if (! $this->hasFieldsets()) {\n return collect();\n }\n\n return collect(File::files($this->path().'/fieldsets'))\n ->map(function ($file) {\n return $file->getFilenameWithoutExtension();\n });\n }", "private function parseFields(): void\n {\n foreach ($this->reflect->getProperties() as $item) {\n $name = $item->getName();\n if (in_array($name, self::SKIP_FIELDS, true)) {\n continue;\n }\n\n $docblock = $item->getDocComment();\n $defType = $this->getFieldType($name, $docblock);\n $varType = $this->getVarType($name, $docblock);\n $isRequired = $this->isRequired($name, $docblock);\n $storage = &$this->fieldsBuffer[$defType];\n\n switch ($defType) {\n case self::FIELD_SIMPLE_TYPE:\n $storage[] = $this->processSimpleField($name, $varType, $isRequired);\n break;\n case self::FIELD_DATE_TYPE:\n $storage[] = $this->processDateField($name, $varType, $isRequired);\n break;\n case self::FIELD_MO_TYPE:\n $storage[] = $this->processManyToOneField($name, $varType, $isRequired);\n break;\n case self::FIELD_OM_TYPE:\n $storage[] = $this->processOneToManyField($name);\n break;\n }\n }\n\n unset($storage);\n }", "abstract public function showFieldSets();", "private static function _parse()\n {\n $data = array();\n $data['tab-label'] = $_POST['tab-label'];\n $data['title-disabled'] = (bool) @$_POST['title-disabled'];\n $data['languages'] = $_POST['languages'];\n \n $data['languages'] = $_POST['languages'] ? explode(',',$_POST['languages']) : array(); \n $data['info'] = trim($_POST['info']); \n\t\t\n\t\t\n $data['required-width-comparator'] = $_POST['required-width-comparator']; \n $data['required-width'] = $_POST['required-width']; //do not cast to int\n\t\t$data['required-width-ranges'] = $_POST['required-width-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-width-ranges'])) : array(); //twice explode\n\n\n\t\t$data['required-height-comparator'] = $_POST['required-height-comparator']; \n $data['required-height'] = $_POST['required-height']; //do not cast to int\n\t\t$data['required-height-ranges'] = $_POST['required-height-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-height-ranges'])) : array(); //twice explode\n\n \n $data['fields'] = array();\n \n for ($i=0; isset($_POST['field-'.$i.'-type']); $i++) {\n $field = array();\n \n $field['label'] = $_POST['field-'.$i.'-label'];\n $field['type'] = $_POST['field-'.$i.'-type'];\n $field['required'] = (bool)@$_POST['field-'.$i.'-required'];\n \n if ($field['type'] == 'select')\n $field['options'] = preg_replace('/\\s\\s+/', ',', $_POST['field-'.$i.'-options']);\n \n $data['fields'][] = $field;\n } \n\n $data['thumbnails'] = array();\n \n //thumbs\n for ($i=0; $i <= 1; $i++) {\n $thumb = array();\n\n $thumb['enabled'] = (bool) @$_POST['thumb-'.$i.'-enabled'];\n $thumb['required'] = (bool) @$_POST['thumb-'.$i.'-required'];\n $thumb['label'] = @$_POST['thumb-'.$i.'-label'];\n $thumb['width'] = @$_POST['thumb-'.$i.'-width'];\n $thumb['height'] = @$_POST['thumb-'.$i.'-height'];\n $thumb['auto-crop'] = @$_POST['thumb-'.$i.'-auto-crop'];\n \n $data['thumbnails'][] = $thumb;\n }\n\n return $data;\n }", "public function getFormFields() {\n $fields = array(\n 'shapes[]' => array(\n 'type' => 'select',\n 'multiplicate' => '5',\n 'values' => array(\n '-' => '-',\n 'cube' => 'cube',\n 'round' => 'round',\n )\n ),\n 'width[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Width'\n ),\n 'higth[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Higth'\n ),\n 'x_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'X position'\n ),\n 'y_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Y position'\n ),\n 'red[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color red',\n ),\n 'green[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color green',\n ),\n 'blue[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color blue',\n ),\n 'size[]' => array(\n 'type' => 'text',\n 'multiplicate' => '1',\n 'label' => 'Size holst'\n ),\n 'enable[]' => array(\n 'type' => 'checkbox',\n 'multiplicate' => '5',\n 'label' => 'enable'\n )\n );\n return $fields;\n }", "public function getFieldSet(string $name = null): FieldSet;", "private function _parseFields()\n {\n // make a new array from the field_types array where all values are ZERO\n $num_types = array_fill_keys(array_keys($this->field_types), 0);\n\n // create a new fillable array\n $fillable = [];\n\n // loop fields\n foreach($this->fields as &$field_config){\n\n // DB FIELD NAME ---------------------------------------------------\n // get the schema type (eg: string, text etc.)\n $type = $this->field_types[$field_config['type']]['schema_type'];\n // create the field name based on the type and count\n $field_config['name'] = $type . (++$num_types[$type]);\n\n // FILLABLE ENTRIES ---------------------------------------------------\n // add a 'fillable' value like \"string1\", \"decimal3\" etc.\n $fillable[] = $field_config['name'];\n \n // VALIDATION RULES --------------------------------------------------\n // get the related rules from either the class fields or the field_types arrays\n $field_rules = isset($field_config['rules']) ? $field_config['rules'] : $this->field_types[$type]['rules']; \n // store\n $this->validation_rules[$field_config['name']] = $field_rules;\n\n // VALIDATION MESSAGES\n // copy all the validation messages from the lang file into a \n // FIELD specific array so we can swap all the attribute names out\n foreach(explode('|', $field_rules) as $field_rule){\n $rule_name = preg_replace('@:.*@','',$field_rule);\n $this->validation_messages[$field_config['name'].'.'.$rule_name] = $this->_swapValidationAttrs($rule_name, $field_config['label'], $field_rules);\n }\n\n }\n\n // merge the dynamic fillable fields with the defaults\n $merged_fillable = array_merge($this->fillable, $fillable);\n\n // set the fillable array using the appropriate parent method\n $this->fillable($merged_fillable);\n\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'categoryFilterGroups' => fn(ParseNode $n) => $o->setCategoryFilterGroups($n->getCollectionOfObjectValues([FilterGroup::class, 'createFromDiscriminatorValue'])),\n 'groups' => fn(ParseNode $n) => $o->setGroups($n->getCollectionOfObjectValues([FilterGroup::class, 'createFromDiscriminatorValue'])),\n 'inputFilterGroups' => fn(ParseNode $n) => $o->setInputFilterGroups($n->getCollectionOfObjectValues([FilterGroup::class, 'createFromDiscriminatorValue'])),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'cameraMake' => fn(ParseNode $n) => $o->setCameraMake($n->getStringValue()),\n 'cameraModel' => fn(ParseNode $n) => $o->setCameraModel($n->getStringValue()),\n 'exposureDenominator' => fn(ParseNode $n) => $o->setExposureDenominator($n->getFloatValue()),\n 'exposureNumerator' => fn(ParseNode $n) => $o->setExposureNumerator($n->getFloatValue()),\n 'fNumber' => fn(ParseNode $n) => $o->setFNumber($n->getFloatValue()),\n 'focalLength' => fn(ParseNode $n) => $o->setFocalLength($n->getFloatValue()),\n 'iso' => fn(ParseNode $n) => $o->setIso($n->getIntegerValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'orientation' => fn(ParseNode $n) => $o->setOrientation($n->getIntegerValue()),\n 'takenDateTime' => fn(ParseNode $n) => $o->setTakenDateTime($n->getDateTimeValue()),\n ];\n }", "public function set_parsed_fields($fields)\n\t{\n\t\t$this->_parsed_fields = $fields;\n\t}", "protected function metaFieldDefinitions()\n {\n return [\n [\n \"name\" => \"type\",\n \"required\" => true,\n \"type\" => \"string\",\n \"label\" => \"Field type\",\n \"editable\" => false,\n ],\n [\n \"name\" => \"label\",\n \"type\" => \"string\",\n \"label\" => \"Label\"\n ],\n [\n \"name\" => \"protected\",\n \"type\" => \"boolean\",\n \"default\" => false,\n \"editable\" => false,\n \"label\" => \"Schema protected\"\n ],\n [\n \"name\" => \"editable\",\n \"type\" => \"boolean\",\n \"default\" => true,\n \"label\" => \"Field value can be altered\",\n \"editable\" => false\n ],\n [\n \"name\" => \"description\",\n \"type\" => \"string\",\n \"label\" => \"Description\"\n ],\n [\n \"name\" => \"required\",\n \"type\" => \"boolean\",\n \"label\" => \"Required\",\n \"default\" => false\n ],\n [\n \"name\" => \"mode\",\n \"type\" => \"option\",\n \"label\" => \"Data mode\",\n \"options\" => \"prefer_local|Use local data, failing that use external data\\nprefer_external|Use external data, failing that use local data\\nonly_local|Only use local data\\nonly_external|Only use external data\"\n ],\n [\n \"name\" => \"script\",\n \"type\" => \"string\", # should be a special type later on.\n \"label\" => \"Calculated value script\",\n # \"config\" => $documentRevision->configRecordType()\n ],\n [\n \"name\" => \"external_column\",\n \"type\" => \"string\",\n \"label\" => \"External data column\"\n ],\n [\n \"name\" => \"external_table\",\n \"type\" => \"string\",\n \"label\" => \"External Data Table\"\n ],\n [\n \"name\" => \"external_key\",\n \"type\" => \"string\",\n \"label\" => \"External Data Key\"\n ],\n [\n \"name\" => \"external_local_key\",\n \"type\" => \"string\",\n \"label\" => \"External Data Local Key\"\n ],\n [\n \"name\" => \"prefix\",\n \"type\" => \"string\",\n \"label\" => \"Prefix text\"\n ],\n [\n \"name\" => \"suffix\",\n \"type\" => \"string\",\n \"label\" => \"Suffix text\"\n ]\n\n ];\n }", "public function set_fields() {\n $this->fields = apply_filters('wpucommentmetas_fields', $this->fields);\n foreach ($this->fields as $id => $field) {\n if (!is_array($field)) {\n $this->fields[$id] = array();\n }\n if (!isset($field['label'])) {\n $this->fields[$id]['label'] = ucfirst($id);\n }\n if (!isset($field['admin_label'])) {\n $this->fields[$id]['admin_label'] = $this->fields[$id]['label'];\n }\n if (!isset($field['type'])) {\n $this->fields[$id]['type'] = 'text';\n }\n if (!isset($field['help'])) {\n $this->fields[$id]['help'] = '';\n }\n if (!isset($field['required'])) {\n $this->fields[$id]['required'] = false;\n }\n if (!isset($field['admin_visible'])) {\n $this->fields[$id]['admin_visible'] = true;\n }\n if (!isset($field['admin_column'])) {\n $this->fields[$id]['admin_column'] = false;\n }\n if (!isset($field['admin_list_visible'])) {\n $this->fields[$id]['admin_list_visible'] = false;\n }\n if (!isset($field['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array(\n 'comment_form_logged_in_after',\n 'comment_form_after_fields'\n );\n }\n if (!is_array($this->fields[$id]['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array($this->fields[$id]['display_hooks']);\n }\n }\n }", "public static function set_fields() {\r\n if ( ! function_exists( 'acf_add_local_field_group' ) ) {\r\n return;\r\n }\r\n $options = get_option( 'myhome_redux' );\r\n $fields = array(\r\n /*\r\n * General tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_general',\r\n 'label' => esc_html__( 'General', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'top',\r\n 'wrapper' => array (\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ),\r\n ),\r\n // Featured\r\n array(\r\n 'key' => 'myhome_estate_featured',\r\n 'label' => esc_html__( 'Featured', 'myhome-core' ),\r\n 'name' => 'estate_featured',\r\n 'type' => 'true_false',\r\n 'default_value' => false,\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ),\r\n );\r\n\r\n foreach ( My_Home_Attribute::get_attributes() as $attr ) {\r\n if ( $attr->get_type() != 'field' ) {\r\n continue;\r\n }\r\n\r\n $name = $attr->get_name();\r\n $display_after = $attr->get_display_after();\r\n if ( ! empty( $display_after ) ) {\r\n $name .= ' (' . $display_after . ')';\r\n }\r\n\r\n array_push( $fields, array(\r\n 'key' => 'myhome_estate_attr_' . $attr->get_slug(),\r\n 'label' => $name,\r\n 'name' => 'estate_attr_' . $attr->get_slug(),\r\n 'type' => 'text',\r\n 'default_value' => '',\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ) );\r\n }\r\n\r\n\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Location tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'type' => 'tab',\r\n ),\r\n // Location\r\n array(\r\n 'key' => 'myhome_estate_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'name' => 'estate_location',\r\n 'type' => 'google_map',\r\n ),\r\n /*\r\n * Gallery tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_gallery',\r\n 'label' => 'Gallery',\r\n 'instructions' => 'Click \"Add to gallery\" below to upload files',\r\n 'type' => 'tab',\r\n ),\r\n // Gallery\r\n array(\r\n 'key' => 'myhome_estate_gallery',\r\n 'label' => 'Gallery',\r\n 'name' => 'estate_gallery',\r\n 'type' => 'gallery',\r\n 'preview_size' => 'thumbnail',\r\n 'library' => 'all',\r\n )\r\n ) );\r\n\r\n if ( isset( $options['mh-estate_plans'] ) && $options['mh-estate_plans'] ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Plans tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Plan\r\n array(\r\n 'key' => 'myhome_estate_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'name' => 'estate_plans',\r\n 'type' => 'repeater',\r\n 'button_label' => esc_html__( 'Add plan', 'myhome-core' ),\r\n 'sub_fields' => array(\r\n // Name\r\n array(\r\n 'key' => 'myhome_estate_plans_name',\r\n 'label' => esc_html__( 'Name', 'myhome-core' ),\r\n 'name' => 'estate_plans_name',\r\n 'type' => 'text',\r\n ),\r\n // Image\r\n array(\r\n 'key' => 'myhome_estate_plans_image',\r\n 'label' => esc_html__( 'Image', 'myhome-core' ),\r\n 'name' => 'estate_plans_image',\r\n 'type' => 'image',\r\n ),\r\n ),\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_video'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Video tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_video',\r\n 'label' => esc_html__( 'Video', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Video\r\n array(\r\n 'key' => 'myhome_estate_video',\r\n 'label' => esc_html__( 'Video link (Youtube / Vimeo / Facebook / Twitter / Instagram / link to .mp4)', 'myhome-core' ),\r\n 'name' => 'estate_video',\r\n 'type' => 'oembed',\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_virtual_tour'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Virtual tour tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_virtual_tour',\r\n 'label' => esc_html__( 'Virtual tour', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Virtual tour\r\n array(\r\n 'key' => 'myhome_estate_virtual_tour',\r\n 'label' => esc_html__( 'Add embed code', 'myhome-core' ),\r\n 'name' => 'virtual_tour',\r\n 'type' => 'text',\r\n )\r\n ) );\r\n }\r\n\r\n acf_add_local_field_group(\r\n array(\r\n 'key' => 'myhome_estate',\r\n 'title' => '<span class=\"dashicons dashicons-admin-home\"></span> ' . esc_html__( 'Property details', 'myhome-core' ),\r\n 'fields' => $fields,\r\n 'menu_order' => 10,\r\n 'location' => array(\r\n array(\r\n array(\r\n 'param' => 'post_type',\r\n 'operator' => '==',\r\n 'value' => 'estate',\r\n ),\r\n ),\r\n ),\r\n )\r\n );\r\n }", "protected function processFields()\n\t{\n\t\t// Check for existence of a model\n\t\tif (NULL === ($model = $this->getModel())) {\n\t\t\tthrow new Scil_Services_Model_Decorator_Exception(__METHOD__.' no model available to process!');\n\t\t}\n\n\t\t// Get the fields\n\t\t$fields = $model->getFieldsAsContainer();\n\n\t\t// Create output array\n\t\t$zendFormElements = array();\n\n\t\t// Process each form field\n\t\tforeach ($fields as $key => $value) {\n\t\t\tif (FALSE === $this->_selectSpecificFields or in_array($key, $this->_selectSpecificFields)) {\n\t\t\t\t$zendFormElements[$key] = $this->createZendFormElement($value);\n\t\t\t}\n\t\t}\n\n\t\t// Return the rendered elements\n\t\treturn $zendFormElements;\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'settingDefinitionId' => fn(ParseNode $n) => $o->setSettingDefinitionId($n->getStringValue()),\n 'settingInstanceTemplateReference' => fn(ParseNode $n) => $o->setSettingInstanceTemplateReference($n->getObjectValue([DeviceManagementConfigurationSettingInstanceTemplateReference::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public function getFieldDefinitions();", "public function getFieldDefinitions();", "public function getFieldDefinitions();", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'operation' => fn(ParseNode $n) => $o->setOperation($n->getEnumValue(RuleOperation::class)),\n 'property' => fn(ParseNode $n) => $o->setProperty($n->getStringValue()),\n 'values' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setValues($val);\n },\n 'valuesJoinedBy' => fn(ParseNode $n) => $o->setValuesJoinedBy($n->getEnumValue(BinaryOperator::class)),\n ];\n }", "public function setFieldSets($fieldsets) {\n\t\t$this->fieldsets = $fieldsets;\n\t}", "protected function traverseFields(): void\n {\n $columns = $this->definition->tca['columns'] ?? [];\n foreach ($this->definition->data as $fieldName => $value) {\n if (! is_array($columns[$fieldName])) {\n continue;\n }\n \n $this->registerHandlerDefinitions($fieldName, $columns[$fieldName], [$fieldName]);\n \n // Handle flex form fields\n if (isset($columns[$fieldName]['config']['type']) && $columns[$fieldName]['config']['type'] === 'flex') {\n $this->flexFormTraverser->initialize($this->definition, [$fieldName])->traverse();\n }\n }\n }", "function acf_prepare_fields_for_import($fields = array())\n{\n}", "abstract protected function _getFeedFields();", "function _field_grouped_fieldset ($fval) {\n\n $res = '';\n $setName = $this->name;\n\n // how many sets to show to begin w/?\n if (!empty($fval) and is_array($fval))\n $numsets = count($fval);\n\t\telse\n\t\t\t$numsets = (isset($this->attribs['numsets']))? $this->attribs['numsets'] : 1;\n\n $hiddens = '';\n $res .= \"<div id=\\\"proto_{$setName}\\\" data-numsets=\\\"{$numsets}\\\" data-setname=\\\"{$setName}\\\" class=\\\"formex_group\\\" style=\\\"display: none; margin:0; padding: 0\\\">\n <fieldset class=\\\"formex_grouped_fieldset {$this->element_class}\\\"><ul>\";\n\t\t\t\t\t\n\n foreach ($this->opts as $name => $parms) {\n\t\t\t$newelem = new formex_field($this->fex, $name, $parms);\n\n\t\t\t$res .= '<li>';\n\t\t\tif ($newelem->type != 'hidden') {\n\t\t\t\t$res .= $this->fex->field_label($newelem);\n\t\t\t\t$res .= $newelem->get_html('');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$hiddens = $newelem->get_html('');\n\t\t\t}\n\t\t\t$res .= '</li>';\n }\n\n $res .= \"</ul>$hiddens</fieldset></div>\";\n\n $labelclass = (!empty($this->attribs['enable_showhide']))? 'enable_showhide' : '';\n\n /* \"+\" and \"-\" controls for adding and removing sets */\n $res .= \"<span id=\\\"fieldsetControl$setName\\\" data-setname=\\\"$setName\\\" class=\\\"controls {$this->element_class}\\\">\";\n\t\t$res .= \"<label class=\\\"$labelclass\\\">{$this->descrip}</label>\";\n\t\t$res .= '<a href=\"#\" class=\"add\">+</a> <a href=\"#\" class=\"sub\">&ndash;</a></span>';\n\n\t\t$res .= \"<script type=\\\"text/javascript\\\">\n\t\t\t\t\t\tvar formex_groupvalues = formex_groupvalues || [];\n\t\t\t\t\t\tformex_groupvalues['{$setName}'] = \".json_encode($fval).\";\n\t\t\t\t</script>\";\n return $res;\n }", "private function loadFields() {\n\t\tif (count($this->fields) > 0) return;\n\t\t$db = getDB();\n\t\t$stat = $db->prepare(\"SELECT * FROM collection_has_field WHERE collection_id=:cid ORDER BY sort_order DESC\");\n\t\t$stat->execute(array('cid'=>$this->collection_id));\n\t\twhile($d = $stat->fetch()) {\n\t\t\tif ($d['type'] == \"STRING\") {\n\t\t\t\t$this->fields[] = new ItemFieldString( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"TEXT\") {\n\t\t\t\t$this->fields[] = new ItemFieldText( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"HTML\") {\n\t\t\t\t$this->fields[] = new ItemFieldHTML( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"EMAIL\") {\n\t\t\t\t$this->fields[] = new ItemFieldEmail( $d, $this->collection_id, $this);\n\t\t\t} else if ($d['type'] == \"PHONE\") {\n\t\t\t\t$this->fields[] = new ItemFieldPhone( $d, $this->collection_id, $this);\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"We don't know about type: \".$d['type']);\n\t\t\t}\n\t\t}\n\t}", "public function getAllfieldsets($channel)\n {\n /**\n * Call the percolate API and try to import fieldsets\n */\n $key = $channel->key;\n $method = \"v5/schema/\";\n $fields = array(\n 'scope_ids' => 'license:' . $channel->license,\n 'type' => 'metadata'\n );\n\n $res_fieldsets = $this->Percolate->callAPI($key, $method, $fields);\n\n return $res_fieldsets['data'];\n }", "protected function parseFields($key = \"fields.\") {\n\t\t$queryFields = array();\n\t\tif (!is_array($this->settings[$key])) return $queryFields;\n\n\t\t//parse mapping\n\t\tforeach ($this->settings[$key] as $fieldname => $options) {\n\t\t\t$fieldname = str_replace('.', '', $fieldname);\n\t\t\tif (isset($options) && is_array($options)) {\n\t\t\t\tif(!isset($options['special'])) {\n\t\t\t\t\t$mapping = $options['mapping'];\n\n\t\t\t\t\t//if no mapping default to the name of the form field\n\t\t\t\t\tif (!$mapping) {\n\t\t\t\t\t\t$mapping = $fieldname;\n\t\t\t\t\t}\n\n\t\t\t\t\t$fieldValue = $this->gp[$mapping];\n\n\t\t\t\t\t//pre process the field value. e.g. to format a date\n\t\t\t\t\tif (isset($options['preProcessing.']) && is_array($options['preProcessing.'])) {\n\t\t\t\t\t\t$options['preProcessing.']['value'] = $fieldValue;\n\t\t\t\t\t\t$fieldValue = $this->utilityFuncs->getSingle($options, 'preProcessing');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($options['mapping.']) && is_array($options['mapping.'])) {\n\t\t\t\t\t\t$options['mapping.']['value'] = $fieldValue;\n\t\t\t\t\t\t$fieldValue = $this->utilityFuncs->getSingle($options, 'mapping');\n\t\t\t\t\t}\n\n\t\t\t\t\t//process empty value handling\n\t\t\t\t\tif ($options['ifIsEmpty'] && strlen($fieldValue) == 0) {\n\t\t\t\t\t\t$fieldValue = $this->utilityFuncs->getSingle($options, 'ifIsEmpty');\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($options['zeroIfEmpty'] && strlen($fieldValue) == 0) {\n\t\t\t\t\t\t$fieldValue = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t//process array handling\n\t\t\t\t\tif (is_array($fieldValue)) {\n\t\t\t\t\t\t$separator = ',';\n\t\t\t\t\t\tif ($options['separator']) {\n\t\t\t\t\t\t\t$separator = $options['separator'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldValue = implode($separator, $fieldValue);\n\t\t\t\t\t}\n\n\t\t\t\t\t//process uploaded files\n\t\t\t\t\t$files = $this->globals->getSession()->get('files');\n\t\t\t\t\tif (isset($files[$fieldname]) && is_array($files[$fieldname])) {\n\t\t\t\t\t\t$fieldValue = $this->getFileList($files, $fieldname);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tswitch ($options['special']) {\n\t\t\t\t\t\tcase 'sub_datetime':\n\t\t\t\t\t\t\t$dateFormat = 'Y-m-d H:i:s';\n\t\t\t\t\t\t\tif($options['special.']['dateFormat']) {\n\t\t\t\t\t\t\t\t$dateFormat = $this->utilityFuncs->getSingle($options['special.'], 'dateFormat');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$fieldValue = date($dateFormat, time());\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sub_tstamp':\n\t\t\t\t\t\t\t$fieldValue = time();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'ip':\n\t\t\t\t\t\t\t$fieldValue = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv('REMOTE_ADDR');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'inserted_uid':\n\t\t\t\t\t\t\t$table = $options['special.']['table'];\n\t\t\t\t\t\t\tif (is_array($this->gp['saveDB'])) {\n\t\t\t\t\t\t\t\tforeach ($this->gp['saveDB'] as $idx => $info) {\n\t\t\t\t\t\t\t\t\tif ($info['table'] === $table) {\n\t\t\t\t\t\t\t\t\t\t$fieldValue = $info['uid'];\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\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$fieldValue = $options;\n\t\t\t}\n\n\t\t\t//post process the field value after formhandler did it's magic.\n\t\t\tif (is_array($options['postProcessing.'])) {\n\t\t\t\t$options['postProcessing.']['value'] = $fieldValue;\n\t\t\t\t$fieldValue = $this->utilityFuncs->getSingle($options, 'postProcessing');\n\t\t\t}\n\n\t\t\t$queryFields[$fieldname] = $fieldValue;\n\n\t\t\tif ($options['nullIfEmpty'] && strlen($queryFields[$fieldname]) == 0) {\n\t\t\t\tunset($queryFields[$fieldname]);\n\t\t\t}\n\t\t}\n\t\treturn $queryFields;\n\t}", "public function feed_settings_fields() {\n\t\t\n\t\treturn array(\n\t\t\tarray(\t\n\t\t\t\t'title' => '',\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feed_name',\n\t\t\t\t\t\t'label' => esc_html__( 'Feed Name', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Name', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Enter a feed name to uniquely identify this setup.', 'gravityformsicontact' ),\n\t\t\t\t\t\t'default_value' => $this->get_default_feed_name(),\n\t\t\t\t\t\t'class' => 'medium',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'list',\n\t\t\t\t\t\t'label' => esc_html__( 'iContact List', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t'choices' => $this->lists_for_feed_setting(),\n\t\t\t\t\t\t'no_choices' => esc_html__( 'Unable to retrieve Lists.', 'gravityformsicontact' ),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'iContact List', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Select which iContact list this feed will add contacts to.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'fields',\n\t\t\t\t\t\t'label' => esc_html__( 'Map Fields', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'field_map',\n\t\t\t\t\t\t'field_map' => $this->fields_for_feed_mapping(),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Map Fields', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'Select which Gravity Form fields pair with their respective iContact fields.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'custom_fields',\n\t\t\t\t\t\t'label' => '',\n\t\t\t\t\t\t'type' => 'dynamic_field_map',\n\t\t\t\t\t\t'field_map' => version_compare( GFForms::$version, '2.5-dev-1', '<' ) ? $this->custom_fields_for_feed_setting() : array( $this, 'custom_fields_for_feed_setting' ),\n\t\t\t\t\t\t'save_callback' => array( $this, 'create_new_custom_fields' ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'feed_condition',\n\t\t\t\t\t\t'label' => esc_html__( 'Opt-In Condition', 'gravityformsicontact' ),\n\t\t\t\t\t\t'type' => 'feed_condition',\n\t\t\t\t\t\t'checkbox_label' => esc_html__( 'Enable', 'gravityformsicontact' ),\n\t\t\t\t\t\t'instructions' => esc_html__( 'Export to iContact if', 'gravityformsicontact' ),\n\t\t\t\t\t\t'tooltip' => '<h6>'. esc_html__( 'Opt-In Condition', 'gravityformsicontact' ) .'</h6>' . esc_html__( 'When the opt-in condition is enabled, form submissions will only be exported to iContact when the condition is met. When disabled, all form submissions will be exported.', 'gravityformsicontact' )\n\t\t\t\t\t),\n\t\t\t\t)\t\n\t\t\t)\n\t\t);\n\t\t\n\t}", "private function parseFieldsAndGroups(array $fields, array $generalConfig)\n {\n $acceptableFileTypes = $generalConfig['accept_file_types'];\n\n $currentGroup = 'ungrouped';\n $groups = array();\n $hasGroups = false;\n\n foreach ($fields as $key => $field) {\n unset($fields[$key]);\n $key = str_replace('-', '_', strtolower(Str::makeSafe($key, true)));\n\n // If field is a \"file\" type, make sure the 'extensions' are set, and it's an array.\n if ($field['type'] == 'file' || $field['type'] == 'filelist') {\n if (empty($field['extensions'])) {\n $field['extensions'] = $acceptableFileTypes;\n }\n\n if (!is_array($field['extensions'])) {\n $field['extensions'] = array($field['extensions']);\n }\n }\n\n // If field is an \"image\" type, make sure the 'extensions' are set, and it's an array.\n if ($field['type'] == 'image' || $field['type'] == 'imagelist') {\n if (empty($field['extensions'])) {\n $field['extensions'] = array_intersect(\n array('gif', 'jpg', 'jpeg', 'png'),\n $acceptableFileTypes\n );\n }\n\n if (!is_array($field['extensions'])) {\n $field['extensions'] = array($field['extensions']);\n }\n }\n\n // If field is a \"Select\" type, make sure the array is a \"hash\" (as opposed to a \"map\")\n // For example: [ 'yes', 'no' ] => { 'yes': 'yes', 'no': 'no' }\n // The reason that we do this, is because if you set values to ['blue', 'green'], that is\n // what you'd expect to see in the database. Not '0' and '1', which is what would happen,\n // if we didn't \"correct\" it here.\n // @see used hack: http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential\n if ($field['type'] == 'select' && isset($field['values']) && is_array($field['values']) &&\n array_values($field['values']) === $field['values']) {\n $field['values'] = array_combine($field['values'], $field['values']);\n }\n\n if (!empty($field['group'])) {\n $hasGroups = true;\n }\n\n // Make sure we have these keys and every field has a group set\n $field = array_replace(\n array(\n 'label' => '',\n 'variant' => '',\n 'default' => '',\n 'pattern' => '',\n 'group' => $currentGroup,\n ),\n $field\n );\n\n // Collect group data for rendering.\n // Make sure that once you started with group all following have that group, too.\n $currentGroup = $field['group'];\n $groups[$currentGroup] = 1;\n\n // Prefix class with \"form-control\"\n $field['class'] = 'form-control' . (isset($field['class']) ? ' ' . $field['class'] : '');\n\n $fields[$key] = $field;\n }\n\n // Make sure the 'uses' of the slug is an array.\n if (isset($fields['slug']) && isset($fields['slug']['uses']) &&\n !is_array($fields['slug']['uses'])\n ) {\n $fields['slug']['uses'] = array($fields['slug']['uses']);\n }\n\n return array($fields, $hasGroups ? array_keys($groups) : false);\n }", "function _prepareForm() {\n\t\t\t$this->getFieldset( );\n\t\t\t$fieldset = parent::_prepareForm( );\n\n\t\t\tif ($fieldset) {\n\t\t\t\t$this->getTextHelper( );\n\t\t\t\t$model = $helper = $this->getModel( );\n\t\t\t\t$isElementDisabled = !$this->isSaveAllowed( );\n\t\t\t\t$fieldset->addField( 'country_id', 'select', array( 'name' => 'country_id', 'label' => $helper->__( 'Country' ), 'title' => $helper->__( 'Country' ), 'required' => false, 'value' => $model->getCountryId( ), 'default' => '0', 'values' => $this->getCountryValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'region_id', 'select', array( 'name' => 'region_id', 'label' => $helper->__( 'Region/State' ), 'title' => $helper->__( 'Region/State' ), 'required' => false, 'value' => $model->getRegionId( ), 'default' => '0', 'values' => $this->getRegionValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'zip', 'text', array( 'name' => 'zip', 'label' => $helper->__( 'Zip/Postal Code' ), 'title' => $helper->__( 'Zip/Postal Code' ), 'note' => $helper->__( '* or blank - matches any' ), 'required' => false, 'value' => $this->getZipValue( ), 'default' => '', 'disabled' => $isElementDisabled ) );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'clickAction' => fn(ParseNode $n) => $o->setClickAction($n->getStringValue()),\n 'clickDateTime' => fn(ParseNode $n) => $o->setClickDateTime($n->getDateTimeValue()),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'sourceId' => fn(ParseNode $n) => $o->setSourceId($n->getStringValue()),\n 'uriDomain' => fn(ParseNode $n) => $o->setUriDomain($n->getStringValue()),\n 'verdict' => fn(ParseNode $n) => $o->setVerdict($n->getStringValue()),\n ];\n }", "function processObjecFields() {\n\t\t\t\n\t\t\tif($this->selectedObject === null) return;\n\t\t\t\n\t\t\t// Process List Fields and tis views\n\t\t\tif(strlen($this->selectedObject['DirectoryObject_ListFields'])) {\n\t \t$tmp = explode(\"\\n\",$this->selectedObject['DirectoryObject_ListFields']);\n\t\t\t\tfor ($j=0,$i=0,$tr=count($tmp); $i < $tr; $i++) if(strlen(trim($tmp[$i]))) {\n\t\t\t\t\t$tmp[$i] = trim($tmp[$i]);\n\t\t\t\t \tif(strpos($tmp[$i], 'View=') !== false) {\n\t\t\t\t \t\tif(strlen($_views[$j]['fields'])) {\n if(!strlen($_views[$j]['title'])) $_views[$j]['title'] = 'General';\n\t\t\t\t \t\t $j++;\n }\n\t\t\t\t \t\t$_views[$j]['title'] = str_replace('View=', '', $tmp[$i]);\n\t\t\t\t\t\t$_rViews[$_views[$j]['title']] = $j;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t \t} \n\t\t\t\t \t$_views[$j]['fields'] .= trim($tmp[$i]);\n\t\t\t\t\t\n\t\t\t\t\t$key = trim(str_replace(',', '', $tmp[$i]));\n\t\t\t\t\t$_label[$key] = $key;\n\t\t\t\t\t$_rLabel[$key] = $key;\n\t\t\t\t\t$this->selectedObject['fieldDBTypes'][$key]['label'] = $key;\n\t\t\t\t\t\n\t\t\t\t\t//if(strpos($tmp[$i], ',') === false) $j++;\n\t\t\t\t}\n\t\n\t } // If the DirectoryObject_ListFields is empty we take the fields form fieldDBTypes\n\t else if(is_array($this->selectedObject['fieldDBTypes'])) foreach ($this->selectedObject['fieldDBTypes'] as $key => $value) {\n\t \t$_views[0]['fields'] .= (strlen($_views[0]['fields']))?','.$key:$key;\n\t\t\t\t$this->selectedObject['fieldDBTypes'][$key]['label'] = $key;\n\t\t\t\t$_label[$key] = $key;\n\t\t\t\t$_rLabel[$key] = $key;\n\t }\n\t\t\tif(!strlen($_views[0]['title'])) {\n\t\t\t\t $_views[0]['title'] = 'General';\n\t\t\t\t $_rViews['General'] = 0;\n\t\t\t} \n\n\t\t\t// $cfFilters is used also in the top menu\n\t if(($tr = count($_views))>0) {\n\t\t\t \tfor ($i=0,$cffilter=''; $i < $tr; $i++) {\n\t\t\t\t\t\n\t\t\t $cfFilters[$i]['id'] = 'javascript:document.ExploreObjects.view.value=\\''.$i.'\\';document.ExploreObjects.submit();';\n\t\t\t $cfFilters[$i]['name'] = 'View: '.$_views[$i]['title'];\n\t\t\t\t\t$cfFilters['_keys_'][]= $i;\n\t\t\t\t\tif($_currentView== $i) {\n\t\t\t\t\t\t$_fields = $_views[$i]['fields'];\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tif(!strlen($_fields)) \t$_fields = $_views[0]['fields'];\n\t }\t\n\t\t\t\t\t\t\n\t\t\t$this->selectedObject['views'] = $_views;\n\t\t\t$this->selectedObject['rViews'] = $_rViews;\n\t\t\t$this->selectedObject['filterViews'] = $cfFilters;\n\t\t\t\n\t\t\t\n\t\t\t// Let's explore DirectoryObject_Params divided by views 0..n\n\t\t\t\n\t\t\t\n\t\t\tif(strlen($this->selectedObject['DirectoryObject_Params'])) {\n\t\t\t\t// split in lines..\n\t \t$tmp = explode(\"\\n\",$this->selectedObject['DirectoryObject_Params']);\n\t\t\t\t\n\t\t\t\t// Start analyzing fields separated by views\n\t\t\t\t$_paramView='fieldDBTypes';\n\t\t\t\tfor ($j=0,$i=0,$tr=count($tmp); $i < $tr; $i++) if(strlen(trim($tmp[$i])) && strpos($tmp[$i], '--') === false) { // avoid comments\n\t\t\t\t \t\n\t\t\t\t\t// $key is the field\n\t list($_field,$value) = explode(\"=\",$tmp[$i],2);\n\t $key = trim($_field); $value = trim($value);\t\n\t\t\t\t\t\n\t\t\t\t\t// View controler\n\t\t\t\t \tif($_field == 'View') {\n\t\t\t\t \t\t$_paramView = 'fieldDBTypes_'.$value; continue;\n\t\t\t\t \t}\n\t\t\t\t\t\n\t\t\t\t\t// virtual Fields\n\t if(strripos($value, \"virtualField\") !== false) {\n\t unset($matchs);\n\t preg_match('/virtualField\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\t\n\t if(strlen($matchs[1])) {\n\t \t\n\t \t$this->selectedObject[$_paramView][$key]['type'] = 'virtual';\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['value'] = str_replace('query=', '', $matchs[1]);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tif(strpos($_fields, ','.$key) !== false) {\n\t \t$_fields = str_replace(','.$key, '', $_fields); // Extract this field \n\t \t$_qfields = str_replace(','.$key, ',('.$this->selectedObject['virtualField'][$key].') '.$key,$_qfields); // Extract this field \n\t\t\t\t\t\t\t} else {\n\t $_fields = str_replace($key.',', '', $_fields);\n\t \t$_qfields = str_replace($key.',', '('.$this->selectedObject['virtualField'][$key].') '.$key.',',$_qfields); // Extract this field \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t }\n\t } \n\t \t\n\t // Columns Calc\n\t if(strripos($value, \"sumColumn\") !== false) $this->selectedObject[$_paramView][$key]['calcColumn'] = 'sum';\n\t \n\t\t\t\t\t// List Order\n\t\t\t if(strripos($value, \"order\") !== false) {\n\t\t\t \tif(strlen($this->selectedObject[$_paramView]['_order_'])) $this->selectedObject[$_paramView]['_order_'].=',';\n\t\t\t\t\t\t$this->selectedObject[$_paramView]['_order_'].= $key;\n\t\t\t \tif(strpos($value, \"order DESC\") !== false) $this->selectedObject[$_paramView]['_order_'].= ' DESC';\n\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t// Filter Dynamic from select\n\t\t\t if(strripos($value, \"selectDynamic\") !== false && !strlen($_GET['force_'.$key])) $this->selectedObject[$_paramView][$key]['filterDynamic'] = true;\n\t\t\t \n\t\t\t\t\t// Read only\t\t\t\t\t\t\t\t\n\t\t\t if(strripos($value, \"readonly\") !== false) $this->selectedObject[$_paramView][$key]['readOnly'] = true;\n\n\t\t\t\t\t// Allow System\n\t\t\t if(strripos($value, \"allowSystem\") !== false) $this->selectedObject[$_paramView][$key]['allowSystem'] = true;\n\n\t // External URL \n\t $_format[$key] = '';\n\t if(strpos($value, \"externalURL\") !== false) {\n\t $_format[$key] = \"externalURL\";\n\t unset($matchs);\n\t preg_match('/externalURL\\[([^\\]]*)\\]/', $value,$matchs);\n\t if(strlen($matchs[1])) {\n\t \t$this->selectedObject[$_paramView][$key]['externalURL'] = $matchs[1];\n\t }\n\t } \n\t\t\t\t\t\n\t // Formats \n\t\t\t\t\tif(strripos($value, \"currency\") !== false) {\n\t\t\t $this->selectedObject[$_paramView][$key]['format'] = \"currency\";\n\t\t\t } else if(strripos($value, \"date\") !== false) {\n\t $this->selectedObject[$_paramView][$key]['format'] = \"date\";\n\t } \n\t\t\t\t\t\n\t\t\t\t\t// Convert a text field in autoselect\t\t\t\n\t\t\t if(strripos($value, \"autoselect\") !== false) {\n\t\t\t \t$this->selectedObject[$_paramView][$key]['autoSelect'] = true;\n\t\t\t $_autoSelect[$key] = true;\n\t\t\t\t\t\t// $db->setAutoSelectField($key);\n\t\t\t\t\t\t//$_filterDynamic[$key]=true;\n\t\t\t } \n\t\t\t\t\t\t\n\n\t\t\t\t\t// To define external fields instead of <external_field>_Name\t\t\t\n\t\t\t if(strpos($value, \"referalFields\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/referalFields\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen($matchs[1])) {\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['referalFields'] = $matchs[1];\n\t\t\t\t // $_referalFields[$key] = $matchs[1];\n\t\t\t\t\t\t\t// $db->setReferalField($key,$this->strCFReplace($matchs[1]));\n\t\t\t\t\t\t}\n\t\t\t } \t\n\t\t\t\t\t\n\t\t\t\t\t// Force a where value for this field\n\t\t\t if(strpos($value, \"forceWhere\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/forceWhere\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen($matchs[1])) {\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['forceWhere'] = $matchs[1];\n\t\t\t\t\t\t\t//$db->addWhereField($key,$this->strCFReplace($matchs[1]));\n\t\t\t\t //$_forceWhere[$key] = $this->strCFReplace($matchs[1]);\n\t\t\t\t\t\t}\n\t\t\t } \n\t\t\t\t\t\n\t\t\t\t\t// Get the value to field from a external list\n\t\t\t if(strpos($value, \"pickExternalValue\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/pickExternalValue\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen($matchs[1])) {\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['pickExternalValue'] =$matchs[1];\n\t\t\t\t\t\t\t/*\n\t\t\t\t $_pickExternalField[$key] = $this->strCFReplace($matchs[1]);\n\t\t\t\t\t\t\tif(strpos( $_pickExternalField[$key],'?')) $_pickExternalField[$key].='&';\n\t\t\t\t\t\t\telse $_pickExternalField[$key].='?';\n\t\t\t\t\t\t\t$_pickExternalField[$key].='noheader&pickExternal';\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t}\n\t\t\t } \n\t\t\t\t\t\n\t\t\t\t\t// Modify the filter for this field only for Where values\n\t\t\t if(strpos($value, \"filterWhere\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/filterWhere\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen($matchs[1])) {\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['filterWhere'] = $matchs[1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//$db->addFilterWhereField($key,$this->strCFReplace($matchs[1]));\n\t\t\t\t //$_filterWhere[$key] = $this->strCFReplace($matchs[1]);\n\t\t\t\t\t\t}\n\t\t\t } \n\t\t\t\t\t\n\t\t\t\t\t// The value to show DependOf other values\n\t\t\t if(strpos($value, \"dependOf\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/dependOf\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen($matchs[1]))\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['dependOf'] = $matchs[1];\n\t\t\t \n\t\t\t // $_dependOf[$key] = (strlen($matchs[1]))?$this->strCFReplace($matchs[1]):false;\n\t\t\t } \n\t\n\t\t\t\t // Asign label[XXX] tag\n\t\t\t if(!isset($_GET['showFields']) && strpos($value, \"label\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/label\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\tif(strlen(trim($matchs[1]))) {\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['label'] = $matchs[1];\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView]['_reverseLabels_'][$matchs[1]] = $key;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$this->selectedObject[$_paramView]['_reverseLabels_'][$key] = $key;\n\t\t\t\t\t\t\n\t\t\t } else\n\t\t\t\t\t\t$this->selectedObject[$_paramView]['_reverseLabels_'][$key] = $key;\n\t\t\t\t\t\n\t\t\t\t // Required field?\n\t\t\t if(strpos($value, \"required\") !== false) {\n\t\t\t \t$this->selectedObject[$_paramView][$key]['required'] = true;\n\t\t\t // $_required[$key] = true;\n\t\t\t } \t\n\t\n\t\t\t if(strpos($value, \"default\") !== false) {\n\t\t\t \tunset($matchs);\n\t\t\t \tpreg_match('/default\\[([^\\]]*)\\]/', $value,$matchs);\n\t\t\t\t\t\t$this->selectedObject[$_paramView][$key]['default'] = $matchs[1];\n\t\t\t // $_default[$key] = $this->strCFReplace($matchs[1]);\t\t\t\t\t\n\t\t\t } \n\t\t\t\t} \t\n\t }\n\n\t\t\t\n\t\t}", "public function getFieldSet() {\n\t\treturn $this->fieldset;\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'parentSiteId' => fn(ParseNode $n) => $o->setParentSiteId($n->getStringValue()),\n 'scope' => fn(ParseNode $n) => $o->setScope($n->getEnumValue(TermGroupScope::class)),\n 'sets' => fn(ParseNode $n) => $o->setSets($n->getCollectionOfObjectValues([Set::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function init_fields() {\n\t\t/**\n\t\t * @var \\WPO\\Container $options\n\t\t * @var \\WPO\\Container $section\n\t\t */\n\t\tforeach ( $this->fields()->get() as $options ) {\n\t\t\tif ( $options->has_callback() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( $options->has_containers() ) {\n\t\t\t\tforeach ( $options->containers() as $section ) {\n\t\t\t\t\tif ( ! $section->has_callback() && $section->has_fields() ) {\n\t\t\t\t\t\tforeach ( $section->fields() as $field ) {\n\t\t\t\t\t\t\t$this->render_field( $field, $options, $section );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ( $options->has_fields() ) {\n\t\t\t\tforeach ( $options->fields() as $field ) {\n\t\t\t\t\t$this->render_field( $field, $options, false );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _readFormFields() {}", "public function fields(): FieldCollection\n {\n // Extract the field collections frmo the steps.\n return $this->reduce(function($collection, Step $step) {\n return $collection->merge($step->fields());\n }, new FieldCollection);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'assignmentFilterType' => fn(ParseNode $n) => $o->setAssignmentFilterType($n->getEnumValue(DeviceAndAppManagementAssignmentFilterType::class)),\n 'groupId' => fn(ParseNode $n) => $o->setGroupId($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'payloadId' => fn(ParseNode $n) => $o->setPayloadId($n->getStringValue()),\n 'payloadType' => fn(ParseNode $n) => $o->setPayloadType($n->getEnumValue(AssociatedAssignmentPayloadType::class)),\n ];\n }", "public function set_fields() {\n\n\t\t$this->fields = Pngx__Meta__Fields::get_fields();\n\t}", "public function getFields()\r\n {\r\n $effects = [\r\n \"fadeInUp\"=>\"fadeInUp\",\r\n \"fadeInDown\"=>\"fadeInDown\",\r\n \"fadeInLeft\"=>\"fadeInLeft\",\r\n \"fadeInRight\"=>\"fadeInRight\",\r\n \"lightSpeedIn\"=>\"lightSpeedIn\",\r\n \"slideInUp\"=>\"slideInUp\",\r\n \"slideInDown\"=>\"slideInDown\",\r\n \"slideInLeft\"=>\"slideInLeft\",\r\n \"slideInRight\"=>\"slideInRight\",\r\n \"zoomIn\"=>\"zoomIn\"\r\n ];\r\n \r\n $fields = [\r\n [\r\n 'name' => 'basic_information',\r\n 'type' => 'group',\r\n 'visible' => 'ce',\r\n 'tabs' => [\r\n [\r\n 'name' => 'slide_information',\r\n 'type' => 'tab',\r\n 'visible' => 'ce',\r\n 'fields' => [\r\n [\r\n 'name' => 'id',\r\n 'type' => 'text',\r\n 'visible' => 'io',\r\n ],\r\n [\r\n 'name' => 'slider_id',\r\n 'display' => 'slider',\r\n 'type' => 'relation',\r\n 'relation' => ['slider', 'name'],\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'file',\r\n 'type' => 'image',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'caption_1',\r\n 'type' => 'text',\r\n 'visible' => 'ice',\r\n ],\r\n [\r\n 'name' => 'caption_2',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'caption_3',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'call_to_action_text',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'call_to_action_url',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'open_in_new_window',\r\n 'type' => 'select',\r\n 'data' => ['1' => trans('slider::panel.yes'), '0' => trans('slider::panel.no')],\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'position',\r\n 'type' => 'position',\r\n 'visible' => 'ce',\r\n ]\r\n\r\n ]\r\n ],\r\n [\r\n 'name' => 'options',\r\n 'type' => 'tab',\r\n 'visible' => 'ce',\r\n 'fields' => [\r\n [\r\n 'name' => 'options[caption_1][delay]',\r\n 'display' => 'caption_1_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_1][color]',\r\n 'display' => 'caption_1_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_1][effect]',\r\n 'display' => 'caption_1_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][delay]',\r\n 'display' => 'caption_2_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][color]',\r\n 'display' => 'caption_2_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_2][effect]',\r\n 'display' => 'caption_2_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][delay]',\r\n 'display' => 'caption_3_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][color]',\r\n 'display' => 'caption_3_color',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[caption_3][effect]',\r\n 'display' => 'caption_3_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[call_to_action][delay]',\r\n 'display' => 'call_to_action_delay',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'text',\r\n 'visible' => 'ce',\r\n ],\r\n [\r\n 'name' => 'options[call_to_action][effect]',\r\n 'display' => 'call_to_action_effect',\r\n 'col' => 'col-sm-4',\r\n 'type' => 'select',\r\n 'data' => $effects,\r\n 'visible' => 'ce',\r\n ],\r\n ]\r\n ]\r\n ]\r\n ]\r\n ];\r\n return $fields;\r\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'identity' => fn(ParseNode $n) => $o->setIdentity($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'role' => fn(ParseNode $n) => $o->setRole($n->getEnumValue(OnlineMeetingRole::class)),\n 'upn' => fn(ParseNode $n) => $o->setUpn($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'bold' => fn(ParseNode $n) => $o->setBold($n->getBooleanValue()),\n 'color' => fn(ParseNode $n) => $o->setColor($n->getStringValue()),\n 'italic' => fn(ParseNode $n) => $o->setItalic($n->getBooleanValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'size' => fn(ParseNode $n) => $o->setSize($n->getFloatValue()),\n 'underline' => fn(ParseNode $n) => $o->setUnderline($n->getStringValue()),\n ]);\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'allowAutoFilter' => fn(ParseNode $n) => $o->setAllowAutoFilter($n->getBooleanValue()),\n 'allowDeleteColumns' => fn(ParseNode $n) => $o->setAllowDeleteColumns($n->getBooleanValue()),\n 'allowDeleteRows' => fn(ParseNode $n) => $o->setAllowDeleteRows($n->getBooleanValue()),\n 'allowFormatCells' => fn(ParseNode $n) => $o->setAllowFormatCells($n->getBooleanValue()),\n 'allowFormatColumns' => fn(ParseNode $n) => $o->setAllowFormatColumns($n->getBooleanValue()),\n 'allowFormatRows' => fn(ParseNode $n) => $o->setAllowFormatRows($n->getBooleanValue()),\n 'allowInsertColumns' => fn(ParseNode $n) => $o->setAllowInsertColumns($n->getBooleanValue()),\n 'allowInsertHyperlinks' => fn(ParseNode $n) => $o->setAllowInsertHyperlinks($n->getBooleanValue()),\n 'allowInsertRows' => fn(ParseNode $n) => $o->setAllowInsertRows($n->getBooleanValue()),\n 'allowPivotTables' => fn(ParseNode $n) => $o->setAllowPivotTables($n->getBooleanValue()),\n 'allowSort' => fn(ParseNode $n) => $o->setAllowSort($n->getBooleanValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'file' => fn(ParseNode $n) => $o->setFile($n->getBinaryContent()),\n 'sensitiveTypeIds' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setSensitiveTypeIds($val);\n },\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'response' => fn(ParseNode $n) => $o->setResponse($n->getEnumValue(ResponseType::class)),\n 'time' => fn(ParseNode $n) => $o->setTime($n->getDateTimeValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'content' => fn(ParseNode $n) => $o->setContent($n->getBinaryContent()),\n 'dateTime' => fn(ParseNode $n) => $o->setDateTime($n->getDateTimeValue()),\n 'extension' => fn(ParseNode $n) => $o->setExtension($n->getStringValue()),\n 'extractedTextContent' => fn(ParseNode $n) => $o->setExtractedTextContent($n->getBinaryContent()),\n 'mediaType' => fn(ParseNode $n) => $o->setMediaType($n->getStringValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'otherProperties' => fn(ParseNode $n) => $o->setOtherProperties($n->getObjectValue([StringValueDictionary::class, 'createFromDiscriminatorValue'])),\n 'processingStatus' => fn(ParseNode $n) => $o->setProcessingStatus($n->getEnumValue(FileProcessingStatus::class)),\n 'senderOrAuthors' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setSenderOrAuthors($val);\n },\n 'size' => fn(ParseNode $n) => $o->setSize($n->getIntegerValue()),\n 'sourceType' => fn(ParseNode $n) => $o->setSourceType($n->getEnumValue(SourceType::class)),\n 'subjectTitle' => fn(ParseNode $n) => $o->setSubjectTitle($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'templateId' => fn(ParseNode $n) => $o->setTemplateId($n->getStringValue()),\n 'values' => fn(ParseNode $n) => $o->setValues($n->getCollectionOfObjectValues([SettingValue::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'addedDateTime' => fn(ParseNode $n) => $o->setAddedDateTime($n->getDateTimeValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'verifiedPublisherId' => fn(ParseNode $n) => $o->setVerifiedPublisherId($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'appDisplayName' => fn(ParseNode $n) => $o->setAppDisplayName($n->getStringValue()),\n 'dataType' => fn(ParseNode $n) => $o->setDataType($n->getStringValue()),\n 'isMultiValued' => fn(ParseNode $n) => $o->setIsMultiValued($n->getBooleanValue()),\n 'isSyncedFromOnPremises' => fn(ParseNode $n) => $o->setIsSyncedFromOnPremises($n->getBooleanValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'targetObjects' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setTargetObjects($val);\n },\n ]);\n }", "public function initSubFields() {\n $post = $this->getData('post');\n switch ($post['custom_type']) {\n case 'shop_customer':\n case 'import_users':\n $optionName = 'wpcf-usermeta';\n break;\n case 'taxonomies':\n $optionName = 'wpcf-termmeta';\n break;\n default:\n $optionName = 'wpcf-field';\n break;\n }\n\n $this->fieldsData = wpcf_admin_fields_get_fields_by_group(\n $this->groupPost->ID,\n 'slug',\n false,\n false,\n false,\n TYPES_CUSTOM_FIELD_GROUP_CPT_NAME,\n $optionName,\n true\n );\n\n foreach ($this->getFieldsData() as $fieldData) {\n $field = FieldFactory::create($fieldData, $post, $this->getFieldName(), $this);\n $this->subFields[] = $field;\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'assignmentFilterDisplayName' => fn(ParseNode $n) => $o->setAssignmentFilterDisplayName($n->getStringValue()),\n 'assignmentFilterId' => fn(ParseNode $n) => $o->setAssignmentFilterId($n->getStringValue()),\n 'assignmentFilterLastModifiedDateTime' => fn(ParseNode $n) => $o->setAssignmentFilterLastModifiedDateTime($n->getDateTimeValue()),\n 'assignmentFilterPlatform' => fn(ParseNode $n) => $o->setAssignmentFilterPlatform($n->getEnumValue(DevicePlatformType::class)),\n 'assignmentFilterType' => fn(ParseNode $n) => $o->setAssignmentFilterType($n->getEnumValue(DeviceAndAppManagementAssignmentFilterType::class)),\n 'assignmentFilterTypeAndEvaluationResults' => fn(ParseNode $n) => $o->setAssignmentFilterTypeAndEvaluationResults($n->getCollectionOfObjectValues([AssignmentFilterTypeAndEvaluationResult::class, 'createFromDiscriminatorValue'])),\n 'evaluationDateTime' => fn(ParseNode $n) => $o->setEvaluationDateTime($n->getDateTimeValue()),\n 'evaluationResult' => fn(ParseNode $n) => $o->setEvaluationResult($n->getEnumValue(AssignmentFilterEvaluationResult::class)),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'entryType' => fn(ParseNode $n) => $o->setEntryType($n->getStringValue()),\n 'errorCode' => fn(ParseNode $n) => $o->setErrorCode($n->getStringValue()),\n 'errorMessage' => fn(ParseNode $n) => $o->setErrorMessage($n->getStringValue()),\n 'joiningValue' => fn(ParseNode $n) => $o->setJoiningValue($n->getStringValue()),\n 'recordedDateTime' => fn(ParseNode $n) => $o->setRecordedDateTime($n->getDateTimeValue()),\n 'reportableIdentifier' => fn(ParseNode $n) => $o->setReportableIdentifier($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'preFetchMedia' => fn(ParseNode $n) => $o->setPreFetchMedia($n->getCollectionOfObjectValues([MediaInfo::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'comment' => fn(ParseNode $n) => $o->setComment($n->getStringValue()),\n 'createdBy' => fn(ParseNode $n) => $o->setCreatedBy($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'items' => fn(ParseNode $n) => $o->setItems($n->getCollectionOfObjectValues([DocumentSetVersionItem::class, 'createFromDiscriminatorValue'])),\n 'shouldCaptureMinorVersion' => fn(ParseNode $n) => $o->setShouldCaptureMinorVersion($n->getBooleanValue()),\n ]);\n }", "abstract protected function getFields();", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'archiveFolder' => fn(ParseNode $n) => $o->setArchiveFolder($n->getStringValue()),\n 'automaticRepliesSetting' => fn(ParseNode $n) => $o->setAutomaticRepliesSetting($n->getObjectValue([AutomaticRepliesSetting::class, 'createFromDiscriminatorValue'])),\n 'dateFormat' => fn(ParseNode $n) => $o->setDateFormat($n->getStringValue()),\n 'delegateMeetingMessageDeliveryOptions' => fn(ParseNode $n) => $o->setDelegateMeetingMessageDeliveryOptions($n->getEnumValue(DelegateMeetingMessageDeliveryOptions::class)),\n 'language' => fn(ParseNode $n) => $o->setLanguage($n->getObjectValue([LocaleInfo::class, 'createFromDiscriminatorValue'])),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'timeFormat' => fn(ParseNode $n) => $o->setTimeFormat($n->getStringValue()),\n 'timeZone' => fn(ParseNode $n) => $o->setTimeZone($n->getStringValue()),\n 'userPurpose' => fn(ParseNode $n) => $o->setUserPurpose($n->getEnumValue(UserPurpose::class)),\n 'userPurposeV2' => fn(ParseNode $n) => $o->setUserPurposeV2($n->getEnumValue(MailboxRecipientType::class)),\n 'workingHours' => fn(ParseNode $n) => $o->setWorkingHours($n->getObjectValue([WorkingHours::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'createdBy' => fn(ParseNode $n) => $o->setCreatedBy($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'lastModifiedBy' => fn(ParseNode $n) => $o->setLastModifiedBy($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n 'lastModifiedDateTime' => fn(ParseNode $n) => $o->setLastModifiedDateTime($n->getDateTimeValue()),\n 'ownerAppIds' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setOwnerAppIds($val);\n },\n 'planner' => fn(ParseNode $n) => $o->setPlanner($n->getObjectValue([BusinessScenarioPlanner::class, 'createFromDiscriminatorValue'])),\n 'uniqueName' => fn(ParseNode $n) => $o->setUniqueName($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'currentLabel' => fn(ParseNode $n) => $o->setCurrentLabel($n->getObjectValue([CurrentLabel::class, 'createFromDiscriminatorValue'])),\n 'discoveredSensitiveTypes' => fn(ParseNode $n) => $o->setDiscoveredSensitiveTypes($n->getCollectionOfObjectValues([DiscoveredSensitiveType::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n 'isAnswerEditable' => fn(ParseNode $n) => $o->setIsAnswerEditable($n->getBooleanValue()),\n 'isRequired' => fn(ParseNode $n) => $o->setIsRequired($n->getBooleanValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'sequence' => fn(ParseNode $n) => $o->setSequence($n->getIntegerValue()),\n 'text' => fn(ParseNode $n) => $o->setText($n->getObjectValue([AccessPackageLocalizedContent::class, 'createFromDiscriminatorValue'])),\n ];\n }", "public function fields()\n {\n $series = [];\n for ($i = 1; $i <= 110; $i++) {\n $name = \"第${i}集\";\n $series[$name] = $name;\n }\n return [\n Select::make('剧集', 'name')\n ->options($series)\n ->withMeta([\n 'value' => '第1集',\n 'extraAttributes' => [\n 'placeholder' => '第几集...'],\n ]),\n Text::make(\"播放地址\", 'url', )->withMeta(['extraAttributes' => [\n 'placeholder' => '目前仅支持m3u8播放地址'],\n ]),\n Select::make(\"是否完成求片处理\", 'fixed')->options([\n 0 => '否',\n 1 => '是',\n ])\n ->withMeta(['value' => 0])\n ->displayUsingLabels(),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'failedTasks' => fn(ParseNode $n) => $o->setFailedTasks($n->getIntegerValue()),\n 'failedUsers' => fn(ParseNode $n) => $o->setFailedUsers($n->getIntegerValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'successfulUsers' => fn(ParseNode $n) => $o->setSuccessfulUsers($n->getIntegerValue()),\n 'totalTasks' => fn(ParseNode $n) => $o->setTotalTasks($n->getIntegerValue()),\n 'totalUsers' => fn(ParseNode $n) => $o->setTotalUsers($n->getIntegerValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'attributeMappings' => fn(ParseNode $n) => $o->setAttributeMappings($n->getCollectionOfObjectValues([AttributeMapping::class, 'createFromDiscriminatorValue'])),\n 'enabled' => fn(ParseNode $n) => $o->setEnabled($n->getBooleanValue()),\n 'flowTypes' => fn(ParseNode $n) => $o->setFlowTypes($n->getEnumValue(ObjectFlowTypes::class)),\n 'metadata' => fn(ParseNode $n) => $o->setMetadata($n->getCollectionOfObjectValues([ObjectMappingMetadataEntry::class, 'createFromDiscriminatorValue'])),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'scope' => fn(ParseNode $n) => $o->setScope($n->getObjectValue([Filter::class, 'createFromDiscriminatorValue'])),\n 'sourceObjectName' => fn(ParseNode $n) => $o->setSourceObjectName($n->getStringValue()),\n 'targetObjectName' => fn(ParseNode $n) => $o->setTargetObjectName($n->getStringValue()),\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'aliases' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setAliases($val);\n },\n 'isExactMatchRequired' => fn(ParseNode $n) => $o->setIsExactMatchRequired($n->getBooleanValue()),\n 'isQueryable' => fn(ParseNode $n) => $o->setIsQueryable($n->getBooleanValue()),\n 'isRefinable' => fn(ParseNode $n) => $o->setIsRefinable($n->getBooleanValue()),\n 'isRetrievable' => fn(ParseNode $n) => $o->setIsRetrievable($n->getBooleanValue()),\n 'isSearchable' => fn(ParseNode $n) => $o->setIsSearchable($n->getBooleanValue()),\n 'labels' => fn(ParseNode $n) => $o->setLabels($n->getCollectionOfEnumValues(Label::class)),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'rankingHint' => fn(ParseNode $n) => $o->setRankingHint($n->getObjectValue([RankingHint::class, 'createFromDiscriminatorValue'])),\n 'type' => fn(ParseNode $n) => $o->setType($n->getEnumValue(PropertyType::class)),\n ];\n }", "function portal_load_meta_fields() {\n\tif(function_exists(\"register_field_group\")) {\n\n\t\t// Load the fields via portal_load_field_template so users can import their own\n\n\t\tportal_load_field_template( 'overview' );\n\t\tportal_load_field_template( 'milestones' );\n\t\tportal_load_field_template( 'phases' );\n\t\tportal_load_field_template( 'teams' );\n\n\t}\n\n}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'query' => fn(ParseNode $n) => $o->setQuery($n->getStringValue()),\n 'queryRoot' => fn(ParseNode $n) => $o->setQueryRoot($n->getStringValue()),\n 'queryType' => fn(ParseNode $n) => $o->setQueryType($n->getStringValue()),\n ]);\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'calculateDiscountOnCreditMemos' => fn(ParseNode $n) => $o->setCalculateDiscountOnCreditMemos($n->getBooleanValue()),\n 'code' => fn(ParseNode $n) => $o->setCode($n->getStringValue()),\n 'discountDateCalculation' => fn(ParseNode $n) => $o->setDiscountDateCalculation($n->getStringValue()),\n 'discountPercent' => fn(ParseNode $n) => $o->setDiscountPercent($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'dueDateCalculation' => fn(ParseNode $n) => $o->setDueDateCalculation($n->getStringValue()),\n 'id' => fn(ParseNode $n) => $o->setId($n->getStringValue()),\n 'lastModifiedDateTime' => fn(ParseNode $n) => $o->setLastModifiedDateTime($n->getDateTimeValue()),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n ];\n }", "public function init() {\n \tif( function_exists('acf_add_local_field_group') ) {\n\n acf_add_local_field_group(array(\n 'key' => 'group_5ee94d2948740',\n 'title' => 'Podcast options',\n 'fields' => array(\n array(\n 'key' => 'field_5ecc54b234178',\n 'label' => 'All episodes page',\n 'name' => 'all_episodes_page',\n 'type' => 'page_link',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '50',\n 'class' => '',\n 'id' => '',\n ),\n 'post_type' => array(\n 0 => 'page',\n ),\n 'taxonomy' => '',\n 'allow_null' => 0,\n 'allow_archives' => 1,\n 'multiple' => 0,\n ),\n array(\n 'key' => 'field_5ee94d63fd8a0',\n 'label' => 'All Podcast Button',\n 'name' => 'all_podcast_button',\n 'type' => 'text',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '50',\n 'class' => '',\n 'id' => '',\n ),\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_5ee94d86fd8a1',\n 'label' => 'Hide Podcast Player Bar?',\n 'name' => 'hide_podcast_player_bar',\n 'type' => 'true_false',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 0,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n ),\n 'location' => array(\n array(\n array(\n 'param' => 'options_page',\n 'operator' => '==',\n 'value' => self::SLUG,\n ),\n ),\n ),\n 'menu_order' => 0,\n 'position' => 'normal',\n 'style' => 'default',\n 'label_placement' => 'top',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => '',\n 'active' => true,\n 'description' => '',\n ));\n\n }\n\t\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return [\n 'kerberosSignOnSettings' => fn(ParseNode $n) => $o->setKerberosSignOnSettings($n->getObjectValue([KerberosSignOnSettings::class, 'createFromDiscriminatorValue'])),\n '@odata.type' => fn(ParseNode $n) => $o->setOdataType($n->getStringValue()),\n 'singleSignOnMode' => fn(ParseNode $n) => $o->setSingleSignOnMode($n->getEnumValue(SingleSignOnMode::class)),\n ];\n }", "private function setFields($fields = [])\n {\n foreach ($fields as $key => $input) {\n $name = array_key_exists('name', $input) ? $input['name'] : $key;\n $type = array_key_exists('type', $input) ? $input['type'] : Mystique::TEXT;\n $type_fallback = array_key_exists('type_fallback', $input) ? $input['type_fallback'] : false;\n\n $field = $input;\n if(array_key_exists('type', $field)) {\n unset($field['type']);\n }\n\n if(strpos($type, 'Inputfield') === false) {\n $type = 'Inputfield' . ucfirst($type);\n }\n if($type_fallback && strpos($type_fallback, 'Inputfield') === false) {\n $type_fallback = 'Inputfield' . ucfirst($type_fallback);\n }\n\n if($this->modules->isInstalled($type)) {\n $field['type'] = $type;\n } else if($this->modules->isInstalled($type_fallback)) {\n $field['type'] = $type_fallback;\n }\n\n if(array_key_exists('type', $field)) {\n\n if(array_key_exists('useLanguages', $field) && $field['useLanguages']) {\n $this->languageFields[] = $name;\n }\n\n if(!$type != Mystique::FIELDSET && !$type != Mystique::MARKUP) {\n $value = array_key_exists('value', $field) ? $field['value'] : '';\n if(!$value && array_key_exists('defaultValue', $field)) {\n $value = $field['defaultValue'];\n }\n $this->inputFields[$name] = $value;\n }\n\n if ($type == Mystique::CHECKBOX || $type == Mystique::TOGGLE_CHECKBOX) {\n $this->checkboxFields[] = $name;\n }\n\n if(array_key_exists('children', $field)) {\n $this->setFields($field['children']);\n }\n }\n }\n }", "abstract public function getFields();", "abstract public function getFields();", "public function set_fields() {\n\n $this->add_field( (new acf_fields\\repeater(\"Documents - {$this->label}\", 'call_off_schedule', '202205171525a', [\n 'button_label' => 'Add Document'\n ]))\n ->add_sub_field( new acf_fields\\text( 'Document Name', 'document_name', '202205171525b', [\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\file( 'Document', 'document', '202205171525c', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\radio( 'Document type', 'document_type', '202205171525d', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'choices' => array(\n 'essential'\t=> 'Essential document',\n 'optional'\t=> 'Optional document',\n ),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\radio( 'Document Usage', 'document_usage', '202205171525e', [\n 'wrapper' => array (\n 'width' => '33',\n 'class' => '',\n 'id' => ''),\n 'choices' => array(\n 'read_only'\t=> 'Read only',\n 'enter_detail'\t=> 'You will need to enter details in this document',\n 'enter_detail_optional'\t=> 'If you use this schedule, you will need to enter details in this document',\n ),\n 'required' => 1,\n ] ) )\n \n ->add_sub_field( new acf_fields\\wysiwyg( 'Document Description', 'document_description', '202205171525f',[\n 'required' => 1,\n ] ) )\n );\n\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'callEventType' => fn(ParseNode $n) => $o->setCallEventType($n->getEnumValue(TeamworkCallEventType::class)),\n 'callId' => fn(ParseNode $n) => $o->setCallId($n->getStringValue()),\n 'initiator' => fn(ParseNode $n) => $o->setInitiator($n->getObjectValue([IdentitySet::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "function acf_parse_types($array)\n{\n}", "public function getFields(){\n if($fields = json_decode($this->fields)){\n\n // si la variable es un array, tengo que concatenar sus valores porque el component/slot no admite paso de arrays\n // foreach ($fields as &$value) {\n // if(is_array($value) && sizeof($value)){\n\n // if(!is_object($value[0])){ // tengo que dejar tranquilos a los arrays que tienen objetos dentro, que son del repeater y no de un select2 multiple por ej\n // $value = implode($value,',');\n // }\n\n // }\n // }\n\n return $fields;\n }\n else{\n return [];\n }\n }", "public function getFields() : FieldCollection;", "protected function forms()\r\n {\r\n $metaFileInfo = $this->getFormObj()->GetMetaFileInfo();\r\n $modulePath = $metaFileInfo['modules_path'];\r\n $modulePath = substr($modulePath,0,strlen($modulePath)-1);\r\n global $g_MetaFiles;\r\n php_grep(\"<EasyForm\", $modulePath);\r\n \r\n for ($i=0; $i<count($g_MetaFiles); $i++)\r\n {\r\n $g_MetaFiles[$i] = str_replace('/','.',str_replace(array($modulePath.'/','.xml'),'', $g_MetaFiles[$i]));\r\n $list[$i]['val'] = $g_MetaFiles[$i];\r\n $list[$i]['txt'] = $g_MetaFiles[$i];\r\n }\r\n\r\n return $list; \r\n }", "protected abstract function setFields();", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'mailExchange' => fn(ParseNode $n) => $o->setMailExchange($n->getStringValue()),\n 'preference' => fn(ParseNode $n) => $o->setPreference($n->getIntegerValue()),\n ]);\n }", "public function getFieldDefinitions()\n {\n return $this->innerContentType->getFieldDefinitions();\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'appliesTo' => fn(ParseNode $n) => $o->setAppliesTo($n->getCollectionOfObjectValues([DirectoryObject::class, 'createFromDiscriminatorValue'])),\n 'definition' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setDefinition($val);\n },\n 'isOrganizationDefault' => fn(ParseNode $n) => $o->setIsOrganizationDefault($n->getBooleanValue()),\n ]);\n }", "protected function parse() {}", "private function _parseForm()\n {\n if( !empty( $this->boundary ) )\n {\n $chunks = @preg_split( '/[\\-]+'.$this->boundary.'(\\-\\-)?/', $this->input, -1, PREG_SPLIT_NO_EMPTY );\n $request = array();\n $files = array();\n $nd = 0;\n $nf = 0;\n\n if( is_array( $chunks ) )\n {\n foreach( $chunks as $index => $chunk )\n {\n $chunk = ltrim( $chunk, \"-\\r\\n\\t\\s \" );\n $lines = explode( \"\\r\\n\", $chunk );\n $levels = '';\n $name = '';\n $file = '';\n $type = '';\n $value = '';\n $path = '';\n $copy = false;\n\n // skip empty chunks\n if( empty( $chunk ) || empty( $lines ) ) continue;\n\n // extract name/filename\n if( strpos( $lines[0], 'Content-Disposition' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $name = $this->_value( @$line['name'], '', true );\n $file = $this->_value( @$line['filename'], '', true );\n }\n // extract content-type\n if( strpos( $lines[0], 'Content-Type' ) !== false )\n {\n $line = $this->_line( array_shift( $lines ) );\n $type = $this->_value( @$line['content'], '', true );\n }\n // rebuild value\n $value = trim( implode( \"\\r\\n\", $lines ) );\n\n // FILES data\n if( !empty( $type ) )\n {\n if( !empty( $value ) )\n {\n $path = str_replace( '\\\\', '/', sys_get_temp_dir() .'/php'. substr( sha1( rand() ), 0, 6 ) );\n $copy = file_put_contents( $path, $value );\n }\n if( preg_match( '/(\\[.*?\\])$/', $name, $tmp ) )\n {\n $name = str_replace( $tmp[1], '', $name );\n $levels = preg_replace( '/\\[\\]/', '['.$nf.']', $tmp[1] );\n }\n $files[ $name.'[name]'.$levels ] = $file;\n $files[ $name.'[type]'.$levels ] = $type;\n $files[ $name.'[tmp_name]'.$levels ] = $path;\n $files[ $name.'[error]'.$levels ] = !empty( $copy ) ? 0 : UPLOAD_ERR_NO_FILE;\n $files[ $name.'[size]'.$levels ] = !empty( $copy ) ? filesize( $path ) : 0;\n $nf++;\n }\n else // POST data\n {\n $name = preg_replace( '/\\[\\]/', '['.$nd.']', $name );\n $request[ $name ] = $value;\n $nd++;\n }\n }\n // finalize arrays\n $_REQUEST = array_merge( $_GET, $this->_data( $request ) );\n $_FILES = $this->_data( $files );\n return true;\n }\n }\n return false;\n }", "abstract protected function loadFields();", "function getFields();", "public function create_fields() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\t\t$method = $this->determine_method( $v, 'form' );\n\t\t\t\t$name = $v['name'];\n\t\t\t\tif ( $v['type'] == 'info' ) { $name = ''; }\n\t\t\t\tadd_settings_field( $k, $name, $method, $this->token, $v['section'], array( 'key' => $k, 'data' => $v ) );\n\n\t\t\t\t// Let the API know that we have a colourpicker field.\n\t\t\t\tif ( $v['type'] == 'range' && $this->_has_range == false ) { $this->_has_range = true; }\n\t\t\t}\n\t\t}\n\t}", "function get_fields( $custom_field_set , $custom_field_item )\n\t{\t\n\t\t$post_type_fields = include( get_template_directory().'/module/'.$custom_field_set.'/'.$custom_field_item.'/config.fields.php' );\n\t\treturn $post_type_fields;\n\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'detectionStatus' => fn(ParseNode $n) => $o->setDetectionStatus($n->getEnumValue(DetectionStatus::class)),\n 'imageFile' => fn(ParseNode $n) => $o->setImageFile($n->getObjectValue([FileDetails::class, 'createFromDiscriminatorValue'])),\n 'mdeDeviceId' => fn(ParseNode $n) => $o->setMdeDeviceId($n->getStringValue()),\n 'parentProcessCreationDateTime' => fn(ParseNode $n) => $o->setParentProcessCreationDateTime($n->getDateTimeValue()),\n 'parentProcessId' => fn(ParseNode $n) => $o->setParentProcessId($n->getIntegerValue()),\n 'parentProcessImageFile' => fn(ParseNode $n) => $o->setParentProcessImageFile($n->getObjectValue([FileDetails::class, 'createFromDiscriminatorValue'])),\n 'processCommandLine' => fn(ParseNode $n) => $o->setProcessCommandLine($n->getStringValue()),\n 'processCreationDateTime' => fn(ParseNode $n) => $o->setProcessCreationDateTime($n->getDateTimeValue()),\n 'processId' => fn(ParseNode $n) => $o->setProcessId($n->getIntegerValue()),\n 'userAccount' => fn(ParseNode $n) => $o->setUserAccount($n->getObjectValue([UserAccount::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "function indexFields()\n\t{\n\t\tif (empty($this->name)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$set = array();\n\t\t// Field is not tokenized nor indexed, but is stored in the index.\n\n\t\t// Field is not tokenized, but is indexed and stored within the index\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('link','/' . strtolower(get_class($this)) . '/view/' . $this->id);\n\t\t$set[] = Zend_Search_Lucene_Field::Keyword('name',$this->name);\n\t\t// $set[] = Zend_Search_Lucene_Field::Keyword('title',$this->name);\n\n\t\t// Field is tokenized and indexed, but is not stored in the index.\n\t\t$content = null;\n\t\tforeach ($this->_properties as $p) {\n\t\t\t$x = substr($p,-2);\n\t\t\tif ( ($x=='id') || ($x=='ts') ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$content.= $this->$p . ' ';\n\t\t}\n\t\t$set[] = Zend_Search_Lucene_Field::UnStored('text',trim($content));\n\t\treturn $set;\n\t}", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}" ]
[ "0.621226", "0.6145185", "0.60931283", "0.60651743", "0.60604435", "0.5899877", "0.5846825", "0.57718366", "0.5608294", "0.55899405", "0.55829585", "0.55675024", "0.55483866", "0.5535791", "0.5424805", "0.5421479", "0.5404015", "0.5360718", "0.5338165", "0.53086716", "0.5305769", "0.5303562", "0.5303562", "0.5303562", "0.5275942", "0.5268664", "0.5261987", "0.5247295", "0.524706", "0.5246866", "0.5237943", "0.52251977", "0.5215967", "0.5206893", "0.520155", "0.51956886", "0.5186601", "0.51811165", "0.51783466", "0.5166035", "0.5159734", "0.5151199", "0.5136599", "0.5132778", "0.51308066", "0.51285803", "0.51236826", "0.51019937", "0.51001906", "0.5092028", "0.50867265", "0.5086471", "0.50804037", "0.50728315", "0.507066", "0.5066433", "0.5062326", "0.5061743", "0.505409", "0.50533473", "0.505187", "0.50377005", "0.50363714", "0.503284", "0.5030221", "0.50275457", "0.50267833", "0.5023725", "0.502205", "0.5008964", "0.5006096", "0.49990314", "0.4998617", "0.49945948", "0.499184", "0.49874362", "0.49845943", "0.49845943", "0.49828088", "0.49792448", "0.49784726", "0.49766588", "0.4975329", "0.4969628", "0.4966658", "0.4965257", "0.4965244", "0.4963045", "0.49585578", "0.49509037", "0.49455914", "0.49433792", "0.49320087", "0.4928173", "0.49241954", "0.49232763", "0.4921201", "0.49157828", "0.49157828", "0.49157828" ]
0.53864276
17
Parse the given fieldset and append any related resource keys.
protected function parseFieldset(string $key, array $fields, array $includes): array { $childIncludes = array_reduce($includes, function ($segments, $include) use ($key) { return array_merge($segments, $this->resolveChildIncludes($key, $include)); }, []); return array_merge($fields, array_unique($childIncludes)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFieldSet($fieldset) {\n\t\t$this->fieldsets[] = $fieldset;\n\t}", "public function prepareFieldset();", "public static function getFormFields($model, $fieldset = null, $mapping = null){\n\t\tif (!$fieldset || strtolower($fieldset) == 'form') {\n\t\t\t$fieldset = 'scaffold';\n\t\t}\n\t\t$binding = null;\n\t\tif (is_object($model)) {\n\t\t\t$binding = $model;\n\t\t\t$model = $binding->model();\n\t\t}\n\n\t\t$setName = Inflector::camelize($fieldset, false);\n\t\tif (substr($setName, -4) != 'Form') {\n\t\t\t$setName .= 'Form';\n\t\t}\n\t\t$setName .= 'Fields';\n\t\t$getters = array(\n\t\t\t\"get\" . ucfirst($setName),\n\t\t\t\"getScaffoldFormFields\"\n\t\t);\n\n\t\t$fields = array();\n\t\tswitch (true) {\n\t\t\tcase method_exists($model, $getters[0]):\n\t\t\t\t$fields = $model::$getters[0]($binding);\n\t\t\t\tbreak;\n\t\t\tcase isset($model::$$setName):\n\t\t\t\t$fields = $model::$$setName;\n\t\t\t\tbreak;\n\t\t\tcase $getters[0] != $getters[1] && method_exists($model, $getters[1]):\n\t\t\t\t$fields = $model::$getters[1]($binding);\n\t\t\t\tbreak;\n\t\t\tcase isset($model::$scaffoldFormFields):\n\t\t\t\t$fields = $model::$scaffoldFormFields;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$filter = function($self, $params) {\n\t\t\textract($params);\n\t\t\tif (empty($fields)) {\n\t\t\t\t$fields[] = array(\n\t\t\t\t\t'legend' => null,\n\t\t\t\t\t'fields' => $self::invokeMethod('mapSchemaFields', array($model, $mapping))\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$first = reset($fields);\n\t\t\t\tif (!is_array($first) || !isset($first['fields'])) {\n\t\t\t\t\t$fields = array(compact('fields'));\n\t\t\t\t}\n\t\t\t\tforeach ($fields as $key => &$_fieldset) {\n\t\t\t\t\tif (!isset($_fieldset['fields'])) {\n\t\t\t\t\t\t$_fieldset = array(\n\t\t\t\t\t\t\t'fields' => $_fieldset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t$_fieldset['fields'] = $self::mapFormFields($model, $_fieldset['fields'], $mapping);\n\t\t\t\t\tif (!isset($_fieldset['legend'])) {\n\t\t\t\t\t\t$_fieldset['legend'] = !is_int($key) ? $key : null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $fields;\n\t\t};\n\n\t\t$params = compact('fields', 'fieldset', 'mapping', 'model');\n\t\treturn static::_filter(__FUNCTION__, $params, $filter);\n\t}", "protected function _addFieldset(\n TDProject_Core_Interfaces_Block_Widget_Fieldset $fieldset) {\n \t$this->addBlock($fieldset);\n \treturn $fieldset;\n }", "public function modify(Fieldset $fieldset);", "public function setFieldsetsAndFields() {\n\t\t$Dataset = new FormularFieldset(__('Your Dataset'));\n\t\t$Dataset->setHtmlCode($this->getCode());\n\t\t$Dataset->addInfo( __('You can specify which values show up in the overview of your activities.').'<br>'.\n\t\t\t\t\t\t\t__('This does not influence the detailed activity view, the form or any plugin.') );\n\n\t\t$this->Formular->addFieldset($Dataset);\n\t}", "function admin_fieldset( $fieldset, $legend = '' )\n{\n\t$eol = \"\\n\";\n\t$html = '<fieldset class=\"admin_fieldset\">'.$eol;\n\n\tif ($legend != '')\n\t{\n\t\t$html .= \"<legend>$legend</legend>$eol\";\n\t}\n\t$html .= $fieldset;\n\n\t$html .= '</fieldset>'.$eol;\n\n\treturn $html;\n}", "public static function mapFormFields($model, $fieldset = array(), $mapping = null){\n\t\tif (!is_array($mapping)) {\n\t\t\t$mapping = static::getFieldMapping($mapping);\n\t\t}\n\t\tif (!$fieldset) {\n\t\t\treturn static::mapSchemaFields($model, $mapping);\n\t\t}\n\t\t$schema = $model::schema()->fields();\n\t\t$key = $model::meta('key');\n\t\t$fields = array();\n\t\tforeach ($fieldset as $field => $settings) {\n\t\t\tif (is_int($field)) {\n\t\t\t\t$field = current((array) $settings);\n\t\t\t\t$settings = array();\n\t\t\t}\n\t\t\t$fields[$field] = $settings;\n\t\t\tif ($field == $key && isset($mapping['__key'])) {\n\t\t\t\t$fields[$field]+= $mapping['__key'];\n\t\t\t}\n\t\t\t$type = isset($schema[$field]) ? $schema[$field]['type'] : null;\n\t\t\tif ($type && isset($mapping[$type])) {\n\t\t\t\t$fields[$field]+= $mapping[$type];\n\t\t\t}\n\t\t\tif ($type != $field && isset($mapping[$field])) {\n\t\t\t\t$fields[$field]+= $mapping[$field];\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "public static function set_fields($obj, $fieldset = null) {\n\t\tstatic $_generated = array ();\n\t\tstatic $_tabular_rows = array ();\n\t\t\n\t\t$class = is_object ( $obj ) ? get_class ( $obj ) : $obj;\n\t\tif (is_null ( $fieldset )) {\n\t\t\t$fieldset = \\Fieldset::instance ( $class );\n\t\t\tif (! $fieldset) {\n\t\t\t\t$fieldset = \\Fieldset::forge ( $class );\n\t\t\t}\n\t\t}\n\t\t\n\t\t// is our parent fieldset a tabular form set?\n\t\t$tabular_form = is_object ( $fieldset->parent () ) ? $fieldset->parent ()->get_tabular_form () : false;\n\t\t\n\t\t// don't cache tabular form fieldsets\n\t\tif (! $tabular_form) {\n\t\t\t! array_key_exists ( $class, $_generated ) and $_generated [$class] = array ();\n\t\t\tif (in_array ( $fieldset, $_generated [$class], true )) {\n\t\t\t\treturn $fieldset;\n\t\t\t}\n\t\t\t$_generated [$class] [] = $fieldset;\n\t\t}\n\t\t\n\t\t$primary_keys = is_object ( $obj ) ? $obj->primary_key () : $class::primary_key ();\n\t\t$primary_key = count ( $primary_keys ) === 1 ? reset ( $primary_keys ) : false;\n\t\t$properties = is_object ( $obj ) ? $obj->properties () : $class::properties ();\n\t\t\n\t\tif ($tabular_form and $primary_key and ! is_object ( $obj )) {\n\t\t\tisset ( $_tabular_rows [$class] ) or $_tabular_rows [$class] = 0;\n\t\t}\n\t\t\n\t\tforeach ( $properties as $p => $settings ) {\n\t\t\tif (\\Arr::get ( $settings, 'skip', in_array ( $p, $primary_keys ) )) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (isset ( $settings ['form'] ['options'] )) {\n\t\t\t\tforeach ( $settings ['form'] ['options'] as $key => $value ) {\n\t\t\t\t\tis_array ( $value ) or $settings ['form'] ['options'] [$key] = \\Lang::get ( $value, array (), false ) ? : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// field attributes can be passed in form key\n\t\t\t$attributes = isset ( $settings ['form'] ) ? $settings ['form'] : array ();\n\t\t\t// label is either set in property setting, as part of form attributes or defaults to fieldname\n\t\t\t$label = isset ( $settings ['label'] ) ? $settings ['label'] : (isset ( $attributes ['label'] ) ? $attributes ['label'] : $p);\n\t\t\t$label = \\Lang::get ( $label, array (), false ) ? : $label;\n\t\t\t\n\t\t\t// change the fieldname and label for tabular form fieldset children\n\t\t\tif ($tabular_form and $primary_key) {\n\t\t\t\tif (is_object ( $obj )) {\n\t\t\t\t\t$p = $tabular_form . '[' . $obj->{$primary_key} . '][' . $p . ']';\n\t\t\t\t} else {\n\t\t\t\t\t$p = $tabular_form . '_new[' . $_tabular_rows [$class] . '][' . $p . ']';\n\t\t\t\t}\n\t\t\t\t$label = '';\n\t\t\t}\n\t\t\t\n\t\t\t// create the field and add validation rules\n\t\t\t$field = $fieldset->add ( $p, $label, $attributes );\n\t\t\tif (! empty ( $settings ['validation'] )) {\n\t\t\t\tforeach ( $settings ['validation'] as $rule => $args ) {\n\t\t\t\t\tif (is_int ( $rule ) and is_string ( $args )) {\n\t\t\t\t\t\t$args = array (\n\t\t\t\t\t\t\t\t$args \n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_unshift ( $args, $rule );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcall_fuel_func_array ( array (\n\t\t\t\t\t\t\t$field,\n\t\t\t\t\t\t\t'add_rule' \n\t\t\t\t\t), $args );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// increase the row counter for tabular row fieldsets\n\t\tif ($tabular_form and $primary_key and ! is_object ( $obj )) {\n\t\t\t$_tabular_rows [$class] ++;\n\t\t}\n\t\t\n\t\treturn $fieldset;\n\t}", "function _prepareForm() {\n\t\t\t$this->getFieldset( );\n\t\t\t$fieldset = parent::_prepareForm( );\n\n\t\t\tif ($fieldset) {\n\t\t\t\t$this->getTextHelper( );\n\t\t\t\t$model = $helper = $this->getModel( );\n\t\t\t\t$isElementDisabled = !$this->isSaveAllowed( );\n\t\t\t\t$fieldset->addField( 'country_id', 'select', array( 'name' => 'country_id', 'label' => $helper->__( 'Country' ), 'title' => $helper->__( 'Country' ), 'required' => false, 'value' => $model->getCountryId( ), 'default' => '0', 'values' => $this->getCountryValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'region_id', 'select', array( 'name' => 'region_id', 'label' => $helper->__( 'Region/State' ), 'title' => $helper->__( 'Region/State' ), 'required' => false, 'value' => $model->getRegionId( ), 'default' => '0', 'values' => $this->getRegionValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'zip', 'text', array( 'name' => 'zip', 'label' => $helper->__( 'Zip/Postal Code' ), 'title' => $helper->__( 'Zip/Postal Code' ), 'note' => $helper->__( '* or blank - matches any' ), 'required' => false, 'value' => $this->getZipValue( ), 'default' => '', 'disabled' => $isElementDisabled ) );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function end_fieldset()\n\t{\n\t\t$fs_attrs = array('marker' => 'end');\n\t\t$fieldset = new GenElement('fieldset', '', $fs_attrs);\n\t\tarray_push($this->form_elements, array($fieldset->render(1), 0, 'fieldset'));\n\t}", "protected function parseFieldsets(array $fieldsets, string $resourceKey, array $includes): array\n {\n $includes = array_map(function ($include) use ($resourceKey) {\n return \"$resourceKey.$include\";\n }, $includes);\n\n foreach ($fieldsets as $key => $fields) {\n if (is_numeric($key)) {\n unset($fieldsets[$key]);\n $key = $resourceKey;\n }\n\n $fields = $this->parseFieldset($key, (array) $fields, $includes);\n $fieldsets[$key] = array_unique(array_merge(key_exists($key, $fieldsets) ? (array) $fieldsets[$key] : [], $fields));\n }\n\n return array_map(function ($fields) {\n return implode(',', $fields);\n }, $fieldsets);\n }", "function _field_grouped_fieldset ($fval) {\n\n $res = '';\n $setName = $this->name;\n\n // how many sets to show to begin w/?\n if (!empty($fval) and is_array($fval))\n $numsets = count($fval);\n\t\telse\n\t\t\t$numsets = (isset($this->attribs['numsets']))? $this->attribs['numsets'] : 1;\n\n $hiddens = '';\n $res .= \"<div id=\\\"proto_{$setName}\\\" data-numsets=\\\"{$numsets}\\\" data-setname=\\\"{$setName}\\\" class=\\\"formex_group\\\" style=\\\"display: none; margin:0; padding: 0\\\">\n <fieldset class=\\\"formex_grouped_fieldset {$this->element_class}\\\"><ul>\";\n\t\t\t\t\t\n\n foreach ($this->opts as $name => $parms) {\n\t\t\t$newelem = new formex_field($this->fex, $name, $parms);\n\n\t\t\t$res .= '<li>';\n\t\t\tif ($newelem->type != 'hidden') {\n\t\t\t\t$res .= $this->fex->field_label($newelem);\n\t\t\t\t$res .= $newelem->get_html('');\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$hiddens = $newelem->get_html('');\n\t\t\t}\n\t\t\t$res .= '</li>';\n }\n\n $res .= \"</ul>$hiddens</fieldset></div>\";\n\n $labelclass = (!empty($this->attribs['enable_showhide']))? 'enable_showhide' : '';\n\n /* \"+\" and \"-\" controls for adding and removing sets */\n $res .= \"<span id=\\\"fieldsetControl$setName\\\" data-setname=\\\"$setName\\\" class=\\\"controls {$this->element_class}\\\">\";\n\t\t$res .= \"<label class=\\\"$labelclass\\\">{$this->descrip}</label>\";\n\t\t$res .= '<a href=\"#\" class=\"add\">+</a> <a href=\"#\" class=\"sub\">&ndash;</a></span>';\n\n\t\t$res .= \"<script type=\\\"text/javascript\\\">\n\t\t\t\t\t\tvar formex_groupvalues = formex_groupvalues || [];\n\t\t\t\t\t\tformex_groupvalues['{$setName}'] = \".json_encode($fval).\";\n\t\t\t\t</script>\";\n return $res;\n }", "protected function add_child(Fieldset $fieldset) {\n\t\tif (is_null ( $fieldset->fieldset_tag )) {\n\t\t\t$fieldset->fieldset_tag = 'fieldset';\n\t\t}\n\t\t\n\t\t$this->fieldset_children [$fieldset->name] = $fieldset;\n\t\treturn $this;\n\t}", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "function set_fieldset( $fieldset_id ){\n\t\t$this->fieldset_id = $fieldset_id;\n\t}", "function fieldset ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tfieldset');\n return $rc->newInstanceArgs( $arguments ); \n}", "function _voicemail_fieldset_group_definition() {\n return array (\n 'label' => 'Voice Mail Settings',\n 'group_type' => 'standard',\n 'settings' =>\n array (\n 'form' =>\n array (\n 'style' => 'fieldset_collapsible',\n 'description' => '',\n ),\n 'display' =>\n array (\n 'description' => '',\n 'teaser' =>\n array (\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'full' =>\n array (\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 4 =>\n array (\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'token' =>\n array (\n 'format' => 'fieldset',\n 'exclude' => 0,\n ),\n 'label' => 'above',\n ),\n ),\n 'weight' => '3',\n 'group_name' => VOICEMAIL_GROUP_FIELD_NAME,\n );\n}", "protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }", "abstract public function showFieldSets();", "function efflab_cb_get_module_fieldset() {\n\n $pluginModuleArray = efflab_cb_get_plugin_module_slugs();\n $themeModuleArray = efflab_cb_get_theme_module_slugs();\n \n // See if there is a matching module in theme\n $matchedModules = array_intersect( $themeModuleArray, $pluginModuleArray ); \n $themeOnlyModules = array_diff( $themeModuleArray, $matchedModules );\n $pluginOnlyModules = array_diff( $pluginModuleArray, $matchedModules );\n \n //print_r( $matchedModules );\n //print_r( $themeOnlyModules );\n //print_r( $pluginOnlyModules );\n \n\tif( $matchedModules ){\n\t\n\t\tforeach ( $matchedModules as $matchedModule ) {\n\t\t\t// A match was found check if a custom fieldset exists in theme direcory\n\t\t\tif( file_exists( get_stylesheet_directory().'/effigylabs/acf-content-builder/modules/'.$matchedModule.'/'.$matchedModule.'-fieldset.php' ) ) {\n\t\t\t\tinclude_once get_stylesheet_directory().'/effigylabs/acf-content-builder/modules/'.$matchedModule.'/'.$matchedModule.'-fieldset.php';\n\t\t\t} \n\t\t\t// Else check if a fieldset exists in module directory\n\t\t\telseif( file_exists( EFFLAB_CB_BASE_DIR .'/modules/'.$matchedModule.'/'.$matchedModule.'-fieldset.php' ) ) {\n\t\t\t\tinclude_once EFFLAB_CB_BASE_DIR .'/modules/'.$matchedModule.'/'.$matchedModule.'-fieldset.php';\n\t\t\t} //endif\n\t\t}// end foreach\n\n\t} // endif\n\t\n\tif ( $themeOnlyModules ) {\n\t\n\t\tforeach ( $themeOnlyModules as $themeOnlyModule ) {\n\t\t\t// A match was found check if a custom fieldset exists in theme direcory\n\t\t\tif( file_exists( get_stylesheet_directory().'/effigylabs/acf-content-builder/modules/'.$themeOnlyModule.'/'.$themeOnlyModule.'-fieldset.php' ) ) {\n\t\t\t\tinclude_once get_stylesheet_directory().'/effigylabs/acf-content-builder/modules/'.$themeOnlyModule.'/'.$themeOnlyModule.'-fieldset.php';\n\t\t\t}//endif\n\t\t}// end foreach\n\t\t\n\t} // endif\n\t\n\tif ( $pluginOnlyModules ) {\n\t\n\t\tforeach ( $pluginOnlyModules as $pluginOnlyModule ) {\n\t\t\t// A match was found check if a custom fieldset exists in theme direcory\n\t\t\tif( file_exists( EFFLAB_CB_BASE_DIR .'/modules/'.$pluginOnlyModule.'/'.$pluginOnlyModule.'-fieldset.php' ) ) {\n\t\t\t\tinclude_once EFFLAB_CB_BASE_DIR .'/modules/'.$pluginOnlyModule.'/'.$pluginOnlyModule.'-fieldset.php';\n\t\t\t} //endif\n\t\t}// end foreach\n\t\t\n\t} // endif\n}", "public static function getFields($model, $fieldset = null) {\n\t\tif (!$fieldset) {\n\t\t\t$fieldset = 'scaffold';\n\t\t}\n\t\t$binding = null;\n\t\tif (is_object($model)) {\n\t\t\t$binding = $model;\n\t\t\t$model = $binding->model();\n\t\t}\n\t\t$setName = Inflector::camelize($fieldset, false) . 'Fields';\n\t\t$getters = array(\n\t\t\t\"get\" . ucfirst($setName),\n\t\t\t\"getScaffoldFields\"\n\t\t);\n\n\t\t$fields = array();\n\t\tswitch (true) {\n\t\t\tcase method_exists($model, $getters[0]):\n\t\t\t\t$fields = $model::$getters[0]($binding);\n\t\t\t\tbreak;\n\t\t\tcase isset($model::$$setName):\n\t\t\t\t$fields = $model::$$setName;\n\t\t\t\tbreak;\n\t\t\tcase $getters[0] != $getters[1] && method_exists($model, $getters[1]):\n\t\t\t\t$fields = $model::$getters[1]($binding);\n\t\t\t\tbreak;\n\t\t\tcase isset($model::$scaffoldFields):\n\t\t\t\t$fields = $model::$scaffoldFields;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$filter = function($self, $params) {\n\t\t\textract($params);\n\t\t\tif (empty($fields)) {\n\t\t\t\t$schema = $model::schema()->fields();\n\t\t\t\t$keys = array_keys($schema);\n\t\t\t\t$fieldsNames = array_map('lithium\\util\\Inflector::humanize', $keys);\n\t\t\t\t$fields = array_combine($keys, $fieldsNames);\n\t\t\t} else {\n\t\t\t\t$_fields = $fields;\n\t\t\t\t$fields = array();\n\t\t\t\tforeach ($_fields as $field => $name) {\n\t\t\t\t\tif (is_int($field)) {\n\t\t\t\t\t\t$field = $name;\n\t\t\t\t\t\t$name = Inflector::humanize($name);\n\t\t\t\t\t}\n\t\t\t\t\t$fields[$field] = $name;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $fields;\n\t\t};\n\n\t\t$params = compact('fields', 'fieldset', 'model');\n\t\treturn static::_filter(__FUNCTION__, $params, $filter);\n\t}", "public function getFieldSet(string $name = null): FieldSet;", "protected function _getExtraInputFields( &$aField ) {\n \n $_aOutput = array();\n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][input_id]\",\n 'value' => $aField['input_id'],\n ) \n )\n . \" />\";\n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][field_id]\",\n 'value' => $aField['field_id'],\n ) \n )\n . \" />\";\n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][name]\",\n 'value' => $aField['_input_name_flat'],\n ) \n )\n . \" />\";\n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][section_id]\",\n 'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] \n ? $aField['section_id'] \n : '',\n ) \n )\n . \" />\";\n \n /* for the redirect_url key */\n if ( $aField['redirect_url'] ) {\n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][redirect_url]\",\n 'value' => $aField['redirect_url'],\n ) \n )\n . \" />\";\n }\n /* for the href key */\n if ( $aField['href'] ) { \n $_aOutput[] = \"<input \" \n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][link_url]\",\n 'value' => $aField['href'],\n ) \n )\n . \" />\";\n }\n /* for the 'reset' key */\n if ( $aField['reset'] ) { \n $_aOutput[] = ! $this->_checkConfirmationDisplayed( $aField['_input_name_flat'], 'reset' )\n ? \"<input \"\n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][is_reset]\",\n 'value' => '1',\n ) \n )\n . \" />\"\n : \"<input \"\n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][reset_key]\",\n 'value' => is_array( $aField['reset'] ) // set the option array key to delete.\n ? implode( '|', $aField['reset'] )\n : $aField['reset'],\n )\n )\n . \" />\"; \n }\n /* for the 'email' key */\n if ( ! empty( $aField['email'] ) ) {\n \n $this->setTransient( 'apf_em_' . md5( $aField['_input_name_flat'] . get_current_user_id() ), $aField['email'] );\n $_aOutput[] = ! $this->_checkConfirmationDisplayed( $aField['_input_name_flat'], 'email' )\n ? \"<input \"\n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][confirming_sending_email]\",\n 'value' => '1',\n ) \n )\n . \" />\" \n : \"<input \"\n . $this->generateAttributes( \n array(\n 'type' => 'hidden',\n 'name' => \"__submit[{$aField['input_id']}][confirmed_sending_email]\",\n 'value' => '1',\n ) \n )\n . \" />\";\n }\n return implode( PHP_EOL, $_aOutput ); \n \n }", "function add_local_field_group(){\n \n $actions_layouts = apply_filters('acfe/form/actions', array());\n ksort($actions_layouts);\n \n acf_add_local_field_group(array(\n 'key' => 'group_acfe_dynamic_form',\n 'title' => 'Dynamic Form',\n 'acfe_display_title' => '',\n 'fields' => array(\n \n /*\n * Actions\n */\n array(\n 'key' => 'field_acfe_form_tab_general',\n 'label' => 'General',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n 'data-no-preference' => true,\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_name',\n 'label' => 'Form name',\n 'name' => 'acfe_form_name',\n 'type' => 'acfe_slug',\n 'instructions' => 'The unique form slug',\n 'required' => 1,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_form_field_groups',\n 'label' => 'Field groups',\n 'name' => 'acfe_form_field_groups',\n 'type' => 'select',\n 'instructions' => 'Render & map fields of the following field groups',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n ),\n 'default_value' => array(\n ),\n 'allow_null' => 0,\n 'multiple' => 1,\n 'ui' => 1,\n 'ajax' => 0,\n 'return_format' => 'value',\n 'placeholder' => '',\n ),\n array(\n 'key' => 'field_acfe_form_actions',\n 'label' => 'Actions',\n 'name' => 'acfe_form_actions',\n 'type' => 'flexible_content',\n 'instructions' => 'Add actions on form submission',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_flexible_stylised_button' => 1,\n 'layouts' => $actions_layouts,\n 'button_label' => 'Add action',\n 'min' => '',\n 'max' => '',\n ),\n \n /*\n * Settings\n */\n array(\n 'key' => 'field_acfe_form_tab_settings',\n 'label' => 'Settings',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_field_groups_rules',\n 'label' => 'Field groups locations rules',\n 'name' => 'acfe_form_field_groups_rules',\n 'type' => 'true_false',\n 'instructions' => 'Apply field groups locations rules for front-end display',\n 'required' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_form_element',\n 'label' => 'Form element',\n 'name' => 'acfe_form_form_element',\n 'type' => 'true_false',\n 'instructions' => 'Whether or not to create a <code>&lt;form&gt;</code> element',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 1,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_attributes',\n 'label' => 'Form attributes',\n 'name' => 'acfe_form_attributes',\n 'type' => 'group',\n 'instructions' => 'Form class and id',\n 'required' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'layout' => 'block',\n 'acfe_seamless_style' => true,\n 'acfe_group_modal' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_form_element',\n 'operator' => '==',\n 'value' => '1',\n ),\n ),\n ),\n 'sub_fields' => array(\n array(\n 'key' => 'field_acfe_form_attributes_class',\n 'label' => '',\n 'name' => 'acfe_form_attributes_class',\n 'type' => 'text',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => array(),\n 'wrapper' => array(\n 'width' => '33',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => 'acf-form',\n 'placeholder' => '',\n 'prepend' => 'class',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_form_attributes_id',\n 'label' => '',\n 'name' => 'acfe_form_attributes_id',\n 'type' => 'text',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => array(),\n 'wrapper' => array(\n 'width' => '33',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => 'id',\n 'append' => '',\n 'maxlength' => '',\n ),\n \n ),\n ),\n array(\n 'key' => 'field_acfe_form_fields_attributes',\n 'label' => 'Fields class',\n 'name' => 'acfe_form_fields_attributes',\n 'type' => 'group',\n 'instructions' => 'Add class to all fields',\n 'required' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'layout' => 'block',\n 'acfe_seamless_style' => true,\n 'acfe_group_modal' => 0,\n 'conditional_logic' => array(),\n 'sub_fields' => array(\n array(\n 'key' => 'field_acfe_form_fields_wrapper_class',\n 'label' => '',\n 'name' => 'acfe_form_fields_wrapper_class',\n 'type' => 'text',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => array(),\n 'wrapper' => array(\n 'width' => '33',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => 'wrapper class',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_form_fields_class',\n 'label' => '',\n 'name' => 'acfe_form_fields_class',\n 'type' => 'text',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => array(),\n 'wrapper' => array(\n 'width' => '33',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => 'input class',\n 'append' => '',\n 'maxlength' => '',\n ),\n ),\n ),\n array(\n 'key' => 'field_acfe_form_form_submit',\n 'label' => 'Submit button',\n 'name' => 'acfe_form_form_submit',\n 'type' => 'true_false',\n 'instructions' => 'Whether or not to create a form submit button. Defaults to true',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 1,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_submit_value',\n 'label' => 'Submit value',\n 'name' => 'acfe_form_submit_value',\n 'type' => 'text',\n 'instructions' => 'The text displayed on the submit button',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_form_submit',\n 'operator' => '==',\n 'value' => '1',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => 'Submit',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_form_html_submit_button',\n 'label' => 'Submit button',\n 'name' => 'acfe_form_html_submit_button',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'HTML used to render the submit button.',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_form_submit',\n 'operator' => '==',\n 'value' => '1',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '<input type=\"submit\" class=\"acf-button button button-primary button-large\" value=\"%s\" />',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 2,\n ),\n array(\n 'key' => 'field_acfe_form_html_submit_spinner',\n 'label' => 'Submit spinner',\n 'name' => 'acfe_form_html_submit_spinner',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'HTML used to render the submit button loading spinner.',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_form_submit',\n 'operator' => '==',\n 'value' => '1',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '<span class=\"acf-spinner\"></span>',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 2,\n ),\n array(\n 'key' => 'field_acfe_form_honeypot',\n 'label' => 'Honeypot',\n 'name' => 'acfe_form_honeypot',\n 'type' => 'true_false',\n 'instructions' => 'Whether to include a hidden input field to capture non human form submission. Defaults to true.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 1,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_kses',\n 'label' => 'Kses',\n 'name' => 'acfe_form_kses',\n 'type' => 'true_false',\n 'instructions' => 'Whether or not to sanitize all $_POST data with the wp_kses_post() function. Defaults to true.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 1,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_uploader',\n 'label' => 'Uploader',\n 'name' => 'acfe_form_uploader',\n 'type' => 'radio',\n 'instructions' => 'Whether to use the WP uploader or a basic input for image and file fields. Defaults to \\'wp\\'\n Choices of \\'wp\\' or \\'basic\\'.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n 'default' => 'Default',\n 'wp' => 'WordPress',\n 'basic' => 'Browser',\n ),\n 'allow_null' => 0,\n 'other_choice' => 0,\n 'default_value' => 'default',\n 'layout' => 'vertical',\n 'return_format' => 'value',\n 'save_other_choice' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_form_field_el',\n 'label' => 'Field element',\n 'name' => 'acfe_form_form_field_el',\n 'type' => 'radio',\n 'instructions' => 'Determines element used to wrap a field. Defaults to \\'div\\'',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n 'div' => '&lt;div&gt;',\n 'tr' => '&lt;tr&gt;',\n 'td' => '&lt;td&gt;',\n 'ul' => '&lt;ul&gt;',\n 'ol' => '&lt;ol&gt;',\n 'dl' => '&lt;dl&gt;',\n ),\n 'allow_null' => 0,\n 'other_choice' => 0,\n 'default_value' => 'div',\n 'layout' => 'vertical',\n 'return_format' => 'value',\n 'save_other_choice' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_label_placement',\n 'label' => 'Label placement',\n 'name' => 'acfe_form_label_placement',\n 'type' => 'radio',\n 'instructions' => 'Determines where field labels are places in relation to fields. Defaults to \\'top\\'. <br />\n Choices of \\'top\\' (Above fields) or \\'left\\' (Beside fields)',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n 'top' => 'Top',\n 'left' => 'Left',\n 'hidden' => 'Hidden',\n ),\n 'allow_null' => 0,\n 'other_choice' => 0,\n 'default_value' => 'top',\n 'layout' => 'vertical',\n 'return_format' => 'value',\n 'save_other_choice' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_instruction_placement',\n 'label' => 'Instruction placement',\n 'name' => 'acfe_form_instruction_placement',\n 'type' => 'radio',\n 'instructions' => 'Determines where field instructions are places in relation to fields. Defaults to \\'label\\'. <br />\n Choices of \\'label\\' (Below labels) or \\'field\\' (Below fields)',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n 'label' => 'Label',\n 'field' => 'Field',\n ),\n 'allow_null' => 0,\n 'other_choice' => 0,\n 'default_value' => 'label',\n 'layout' => 'vertical',\n 'return_format' => 'value',\n 'save_other_choice' => 0,\n ),\n \n /*\n * HTML\n */\n array(\n 'key' => 'field_acfe_form_tab_html',\n 'label' => 'HTML',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_custom_html_enable',\n 'label' => 'Override Form render',\n 'name' => 'acfe_form_custom_html_enable',\n 'type' => 'true_false',\n 'instructions' => 'Override the native field groups HTML render',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => false,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_html_before_fields',\n 'label' => 'HTML Before render',\n 'name' => 'acfe_form_html_before_fields',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'Extra HTML to add before the fields',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 2,\n ),\n array(\n 'key' => 'field_acfe_form_custom_html',\n 'label' => 'HTML Form render',\n 'name' => 'acfe_form_custom_html',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'Render your own customized HTML.<br /><br />\n Field groups may be included using <code>{field_group:group_key}</code><br/><code>{field_group:Group title}</code><br/><br/>\n Fields may be included using <code>{field:field_key}</code><br/><code>{field:field_name}</code>',\n 'required' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 12,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_custom_html_enable',\n 'operator' => '==',\n 'value' => '1',\n ),\n ),\n ),\n ),\n array(\n 'key' => 'field_acfe_form_html_after_fields',\n 'label' => 'HTML After render',\n 'name' => 'acfe_form_html_after_fields',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'Extra HTML to add after the fields',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 2,\n ),\n \n /*\n * Validation\n */\n array(\n 'key' => 'field_acfe_form_tab_validation',\n 'label' => 'Validation',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_hide_error',\n 'label' => 'Hide general error',\n 'name' => 'acfe_form_hide_error',\n 'type' => 'true_false',\n 'instructions' => 'Hide the general error message: \"Validation failed. 1 field requires attention\"',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_hide_revalidation',\n 'label' => 'Hide successful re-validation',\n 'name' => 'acfe_form_hide_revalidation',\n 'type' => 'true_false',\n 'instructions' => 'Hide the successful notice when an error has been thrown',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_hide_unload',\n 'label' => 'Hide confirmation on exit',\n 'name' => 'acfe_form_hide_unload',\n 'type' => 'true_false',\n 'instructions' => 'Do not prompt user on page refresh',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_errors_position',\n 'label' => 'Fields errors position',\n 'name' => 'acfe_form_errors_position',\n 'type' => 'radio',\n 'instructions' => 'Choose where to display field errors',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'choices' => array(\n 'above' => 'Above fields',\n 'below' => 'Below fields',\n 'group' => 'Group errors',\n 'hide' => 'Hide errors',\n ),\n 'allow_null' => 0,\n 'other_choice' => 0,\n 'default_value' => 'above',\n 'layout' => 'vertical',\n 'return_format' => 'value',\n 'save_other_choice' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_errors_class',\n 'label' => 'Fields errors class',\n 'name' => 'acfe_form_errors_class',\n 'type' => 'text',\n 'instructions' => 'Add class to error message',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_errors_position',\n 'operator' => '!=',\n 'value' => 'group',\n ),\n array(\n 'field' => 'field_acfe_form_errors_position',\n 'operator' => '!=',\n 'value' => 'hide',\n ),\n )\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n \n /*\n * Submission\n */\n array(\n 'key' => 'field_acfe_form_tab_submission',\n 'label' => 'Success Page',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_return',\n 'label' => 'Redirection',\n 'name' => 'acfe_form_return',\n 'type' => 'text',\n 'instructions' => 'The URL to be redirected to after the form is submitted. See \"Cheatsheet\" tab for all available template tags.<br/><br/><u>This setting is deprecated, use the new \"Redirect Action\" instead.</u>',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n 'data-enable-switch' => true\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_form_updated_hide_form',\n 'label' => 'Hide form',\n 'name' => 'acfe_form_updated_hide_form',\n 'type' => 'true_false',\n 'instructions' => 'Hide form on successful submission',\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_return',\n 'operator' => '==',\n 'value' => '',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => '',\n 'ui_off_text' => '',\n ),\n array(\n 'key' => 'field_acfe_form_updated_message',\n 'label' => 'Success message',\n 'name' => 'acfe_form_updated_message',\n 'type' => 'wysiwyg',\n 'instructions' => 'A message displayed above the form after being redirected. See \"Cheatsheet\" tab for all available template tags.',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_return',\n 'operator' => '==',\n 'value' => '',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n 'data-instruction-placement' => 'field'\n ),\n 'acfe_permissions' => '',\n 'default_value' => __('Post updated', 'acf'),\n 'tabs' => 'all',\n 'toolbar' => 'full',\n 'media_upload' => 1,\n 'delay' => 0,\n ),\n array(\n 'key' => 'field_acfe_form_html_updated_message',\n 'label' => 'Success wrapper HTML',\n 'name' => 'acfe_form_html_updated_message',\n 'type' => 'acfe_code_editor',\n 'instructions' => 'HTML used to render the updated message.<br />\nIf used, you have to include the following code <code>%s</code> to print the actual \"Success message\" above.',\n 'required' => 0,\n 'conditional_logic' => array(\n array(\n array(\n 'field' => 'field_acfe_form_return',\n 'operator' => '==',\n 'value' => '',\n ),\n ),\n ),\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n 'data-instruction-placement' => 'field'\n ),\n 'acfe_permissions' => '',\n 'default_value' => '<div id=\"message\" class=\"updated\">%s</div>',\n 'placeholder' => '',\n 'maxlength' => '',\n 'rows' => 2,\n ),\n \n /*\n * Cheatsheet\n */\n array(\n 'key' => 'field_acfe_form_tab_cheatsheet',\n 'label' => 'Cheatsheet',\n 'name' => '',\n 'type' => 'tab',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_permissions' => '',\n 'placement' => 'top',\n 'endpoint' => 0,\n ),\n \n array(\n 'key' => 'field_acfe_form_cheatsheet_field',\n 'label' => 'Field',\n 'name' => 'acfe_form_cheatsheet_field',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve user input from the current form',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_fields',\n 'label' => 'Fields',\n 'name' => 'acfe_form_cheatsheet_fields',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve all user inputs from the current form',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_get_field',\n 'label' => 'Get Field',\n 'name' => 'acfe_form_cheatsheet_get_field',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve ACF field value from database',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_get_option',\n 'label' => 'Get Option',\n 'name' => 'acfe_form_cheatsheet_get_option',\n 'type' => 'acfe_dynamic_message',\n 'value' => '',\n 'instructions' => 'Retrieve option value from database',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_request',\n 'label' => 'Request',\n 'name' => 'acfe_form_cheatsheet_request',\n 'type' => 'acfe_dynamic_message',\n 'value' => '',\n 'instructions' => 'Retrieve <code>$_REQUEST</code> value',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_query_var',\n 'label' => 'Query Var',\n 'name' => 'acfe_form_cheatsheet_query_var',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve query var values. Can be used to get data from previous action',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_current_form',\n 'label' => 'Form Settings',\n 'name' => 'acfe_form_cheatsheet_current_form',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve current Dynamic Form data',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_actions_post',\n 'label' => 'Action Output: Post',\n 'name' => 'acfe_form_cheatsheet_actions_post',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve actions output',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'acfe_form_cheatsheet_actions_term',\n 'label' => 'Action Output: Term',\n 'name' => 'acfe_form_cheatsheet_actions_term',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve actions output',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'acfe_form_cheatsheet_actions_user',\n 'label' => 'Action Output: User',\n 'name' => 'acfe_form_cheatsheet_actions_user',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve actions output',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'acfe_form_cheatsheet_actions_email',\n 'label' => 'Action Output: Email',\n 'name' => 'acfe_form_cheatsheet_actions_email',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve actions output',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_current_post',\n 'label' => 'Current Post',\n 'name' => 'acfe_form_cheatsheet_current_post',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve current post data (where the form is being printed)',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_current_term',\n 'label' => 'Current Term',\n 'name' => 'acfe_form_cheatsheet_current_term',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve current term data (where the form is being printed)',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_current_user',\n 'label' => 'Current User',\n 'name' => 'acfe_form_cheatsheet_current_user',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve currently logged user data',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n array(\n 'key' => 'field_acfe_form_cheatsheet_current_author',\n 'label' => 'Current Author',\n 'name' => 'acfe_form_cheatsheet_current_author',\n 'type' => 'acfe_dynamic_message',\n 'instructions' => 'Retrieve current post author data (where the form is being printed)',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n ),\n ),\n 'location' => array(\n array(\n array(\n 'param' => 'post_type',\n 'operator' => '==',\n 'value' => $this->post_type,\n ),\n ),\n ),\n 'menu_order' => 0,\n 'position' => 'acf_after_title',\n 'style' => 'default',\n 'label_placement' => 'left',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => '',\n 'active' => true,\n 'description' => '',\n 'acfe_permissions' => '',\n 'acfe_form' => 0,\n 'acfe_meta' => '',\n 'acfe_note' => '',\n ));\n \n }", "public function end_fieldset()\n\t{\n\t\tif( $this->has_fieldset )\n\t\t\t$this->buffer.= '</fieldset>';\n\t\t$this->has_fieldset = false;\n\t}", "private function parseFields($arrSectionFields) {\r\n $result = array();\r\n foreach ($arrSectionFields as $key => $value) {\r\n $newField = $this->recursiveParseKey($key, $value);\r\n $result = self::mergeArrayResult($result, $newField);\r\n }\r\n return $result;\r\n }", "protected function _prepareForm()\r\n {\r\n /* @var $model Amasty_Xlanding_Model_Page */\r\n $model = Mage::registry('amlanding_page');\r\n\r\n /* @var $helper Amasty_Xlanding_Helper_Data */\r\n $helper = Mage::helper('amlanding');\r\n $attributeSets = $helper->getAvailableAttributeSets();\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('page_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array('legend' => $helper->__('Page Information')));\r\n\r\n if ($model->getPageId()) {\r\n $fieldset->addField('page_id', 'hidden', array(\r\n 'name' => 'page_id',\r\n ));\r\n }\r\n\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $helper->__('Page Name'),\r\n 'title' => $helper->__('Page Name'),\r\n 'required' => true,\r\n ));\r\n\r\n $fieldset->addField('identifier', 'text', array(\r\n 'name' => 'identifier',\r\n 'label' => $helper->__('URL Key'),\r\n 'title' => $helper->__('URL Key'),\r\n 'required' => true,\r\n 'class' => 'validate-identifier',\r\n 'note' => $helper->__('Relative to Website Base URL'),\r\n ));\r\n\r\n /**\r\n * Check is single store mode\r\n */\r\n if (!Mage::app()->isSingleStoreMode()) {\r\n\r\n $fieldset->addField('store_id', 'multiselect', array(\r\n 'label' => $helper->__('Stores'),\r\n 'name' => 'stores[]',\r\n 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()\r\n ));\r\n } else {\r\n $fieldset->addField('store_id', 'hidden', array(\r\n 'name' => 'stores[]',\r\n 'value' => Mage::app()->getStore(true)->getId()\r\n ));\r\n $model->setStoreId(Mage::app()->getStore(true)->getId());\r\n }\r\n\r\n $fieldset->addField('is_active', 'select', array(\r\n 'label' => $helper->__('Status'),\r\n 'title' => $helper->__('Page Status'),\r\n 'name' => 'is_active',\r\n 'required' => true,\r\n 'options' => $helper->getAvailableStatuses()\r\n ));\r\n\r\n /**\r\n * Adding field in the form to select the default attribute store used for optimization purposes\r\n */\r\n $fieldset->addField('default_attribute_set', 'select', array(\r\n 'label' => $helper->__('Default Attribute Set'),\r\n 'title' => $helper->__('Default Attribute Set'),\r\n 'name' => 'default_attribute_set',\r\n 'options' => $attributeSets,\r\n 'required' => true\r\n ));\r\n $form->setValues($model->getData());\r\n $this->setForm($form);\r\n\r\n }", "abstract protected function getFormIntroductionFields();", "public static function get_fields() {\n\n\t\trequire_once 'tables/class-llms-rest-table-api-keys.php';\n\n\t\t$add_key = '1' === llms_filter_input( INPUT_GET, 'add-key', FILTER_SANITIZE_NUMBER_INT );\n\t\t$key_id = llms_filter_input( INPUT_GET, 'edit-key', FILTER_SANITIZE_NUMBER_INT );\n\n\t\t$settings = array();\n\n\t\t$settings[] = array(\n\t\t\t'class' => 'top',\n\t\t\t'id' => 'rest_keys_options_start',\n\t\t\t'type' => 'sectionstart',\n\t\t);\n\n\t\t$settings[] = array(\n\t\t\t'title' => $key_id || $add_key ? __( 'API Key Details', 'lifterlms' ) : __( 'API Keys', 'lifterlms' ),\n\t\t\t'type' => 'title-with-html',\n\t\t\t'id' => 'rest_keys_options_title',\n\t\t\t'html' => $key_id || $add_key ? '' : '<a href=\"' . esc_url( admin_url( 'admin.php?page=llms-settings&tab=rest-api&section=keys&add-key=1' ) ) . '\" class=\"llms-button-primary small\" type=\"submit\" style=\"top:-2px;\">' . __( 'Add API Key', 'lifterlms' ) . '</a>',\n\t\t);\n\n\t\tif ( $add_key || $key_id ) {\n\n\t\t\t$key = $add_key ? false : new LLMS_REST_API_Key( $key_id );\n\t\t\tif ( self::$generated_key ) {\n\t\t\t\t$key = self::$generated_key;\n\t\t\t}\n\t\t\tif ( $add_key || $key->exists() ) {\n\n\t\t\t\t$user_id = $key ? $key->get( 'user_id' ) : get_current_user_id();\n\n\t\t\t\t$settings[] = array(\n\t\t\t\t\t'title' => __( 'Description', 'lifterlms' ),\n\t\t\t\t\t'desc' => '<br>' . __( 'A friendly, human-readable, name used to identify the key.', 'lifterlms' ),\n\t\t\t\t\t'id' => 'llms_rest_key_description',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'value' => $key ? $key->get( 'description' ) : '',\n\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t'required' => 'required',\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t$settings[] = array(\n\t\t\t\t\t'title' => __( 'User', 'lifterlms' ),\n\t\t\t\t\t'class' => 'llms-select2-student',\n\t\t\t\t\t'desc' => sprintf(\n\t\t\t\t\t\t// Translators: %1$s = opening anchor tag to capabilities doc; %2$s closing anchor tag.\n\t\t\t\t\t\t__( 'The owner is used to determine what user %1$scapabilities%2$s are available to the API key.', 'lifterlms' ),\n\t\t\t\t\t\t'<a href=\"https://lifterlms.com/docs/roles-and-capabilities/\" target=\"_blank\">',\n\t\t\t\t\t\t'</a>'\n\t\t\t\t\t),\n\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t'data-placeholder' => __( 'Select a user', 'lifterlms' ),\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'llms_rest_key_user_id',\n\t\t\t\t\t'options' => llms_make_select2_student_array( array( $user_id ) ),\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t);\n\n\t\t\t\t$settings[] = array(\n\t\t\t\t\t'title' => __( 'Permissions', 'lifterlms' ),\n\t\t\t\t\t'desc' => '<br>' . sprintf(\n\t\t\t\t\t\t// Translators: %1$s = opening anchor tag to doc; %2$s closing anchor tag.\n\t\t\t\t\t\t__( 'Determines what kind of requests can be made with the API key. %1$sRead more%2$s.', 'lifterlms' ),\n\t\t\t\t\t\t'<a href=\"https://lifterlms.com/docs/getting-started-with-the-lifterlms-rest-api/#api-keys\" target=\"_blank\">',\n\t\t\t\t\t\t'</a>'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'llms_rest_key_permissions',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'options' => LLMS_REST_API()->keys()->get_permissions(),\n\t\t\t\t\t'value' => $key ? $key->get( 'permissions' ) : '',\n\t\t\t\t);\n\n\t\t\t\tif ( $key && ! self::$generated_key ) {\n\n\t\t\t\t\t$settings[] = array(\n\t\t\t\t\t\t'title' => __( 'Consumer key ending in', 'lifterlms' ),\n\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t'readonly' => 'readonly',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'class' => 'code',\n\t\t\t\t\t\t'id' => 'llms_rest_key__read_only_key',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '&hellip;' . $key->get( 'truncated_key' ),\n\t\t\t\t\t);\n\n\t\t\t\t\t$settings[] = array(\n\t\t\t\t\t\t'title' => __( 'Last accessed at', 'lifterlms' ),\n\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t'readonly' => 'readonly',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'id' => 'llms_rest_key__read_only_date',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => $key->get_last_access_date(),\n\t\t\t\t\t);\n\n\t\t\t\t} elseif ( self::$generated_key ) {\n\n\t\t\t\t\t$settings[] = array(\n\t\t\t\t\t\t'type' => 'custom-html',\n\t\t\t\t\t\t'id' => 'llms_rest_key_onetime_notice',\n\t\t\t\t\t\t'value' => '<p style=\"padding: 10px;border-left:4px solid #ff922b;background:rgba(255, 146, 43, 0.3);\">' . __( 'Make sure to copy or download the consumer key and consumer secret. After leaving this page they will not be displayed again.', 'lifterlms' ) . '</p>',\n\t\t\t\t\t);\n\n\t\t\t\t\t$settings[] = array(\n\t\t\t\t\t\t'title' => __( 'Consumer key', 'lifterlms' ),\n\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t'readonly' => 'readonly',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'css' => 'width:400px',\n\t\t\t\t\t\t'class' => 'code widefat',\n\t\t\t\t\t\t'id' => 'llms_rest_key__read_only_key',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => $key->get( 'consumer_key_one_time' ),\n\t\t\t\t\t);\n\n\t\t\t\t\t$settings[] = array(\n\t\t\t\t\t\t'title' => __( 'Consumer secret', 'lifterlms' ),\n\t\t\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t\t\t'readonly' => 'readonly',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'css' => 'width:400px',\n\t\t\t\t\t\t'class' => 'code widefat',\n\t\t\t\t\t\t'id' => 'llms_rest_key__read_only_secret',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => $key->get( 'consumer_secret' ),\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\t$buttons = '<br><br>';\n\t\t\t\tif ( self::$generated_key ) {\n\t\t\t\t\t$download_url = wp_nonce_url(\n\t\t\t\t\t\tadmin_url(\n\t\t\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id' => $key->get( 'id' ),\n\t\t\t\t\t\t\t\t\t'ck' => base64_encode( $key->get( 'consumer_key_one_time' ) ), //phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- This is benign usage.\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'admin.php'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'dl-key',\n\t\t\t\t\t\t'dl-key-nonce'\n\t\t\t\t\t);\n\t\t\t\t\t$buttons .= '<a class=\"llms-button-primary\" href=\"' . $download_url . '\" target=\"_blank\"><i class=\"fa fa-download\" aria-hidden=\"true\"></i> ' . __( 'Download Keys', 'lifterlms' ) . '</a>';\n\t\t\t\t} else {\n\t\t\t\t\t$buttons .= '<button class=\"llms-button-primary\" type=\"submit\" value=\"llms-rest-save-key\">' . __( 'Save', 'lifterlms' ) . '</button>';\n\t\t\t\t}\n\t\t\t\tif ( $key ) {\n\t\t\t\t\t$buttons .= $buttons ? '&nbsp;&nbsp;&nbsp;' : '<br><br>';\n\t\t\t\t\t$buttons .= '<a class=\"llms-button-danger\" href=\"' . esc_url( $key->get_delete_link() ) . '\">' . __( 'Revoke', 'lifterlms' ) . '</a>';\n\t\t\t\t}\n\t\t\t\t$buttons .= wp_nonce_field( 'lifterlms-settings', '_wpnonce', true, false );\n\n\t\t\t\t$settings[] = array(\n\t\t\t\t\t'type' => 'custom-html',\n\t\t\t\t\t'id' => 'llms_rest_key_buttons',\n\t\t\t\t\t'value' => $buttons,\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\t$settings[] = array(\n\t\t\t\t\t'id' => 'rest_keys_options_invalid_error',\n\t\t\t\t\t'type' => 'custom-html',\n\t\t\t\t\t'value' => __( 'Invalid api key.', 'lifterlms' ),\n\t\t\t\t);\n\n\t\t\t}\n\t\t} else {\n\n\t\t\t$settings[] = array(\n\t\t\t\t'id' => 'llms_api_keys_table',\n\t\t\t\t'table' => new LLMS_REST_Table_API_Keys(),\n\t\t\t\t'type' => 'table',\n\t\t\t);\n\n\t\t}\n\n\t\t$settings[] = array(\n\t\t\t'id' => 'rest_keys_options_end',\n\t\t\t'type' => 'sectionend',\n\t\t);\n\n\t\treturn $settings;\n\n\t}", "function add_local_field_group(){\n // ...\n }", "function awm_basic_meta_structure($fields)\n {\n $metas = array();\n\n foreach ($fields as $field) {\n $meta_key = awm_clean_string($field['key']);\n $metas[$meta_key] = $field;\n $metas[$meta_key]['label'] = __($field['label'], 'extend-wp');\n\n $metas[$meta_key]['class'] = !empty($field['class']) ? explode(',', $field['class']) : array();\n $attributes = array();\n if (isset($field['attributes'])) {\n foreach ($field['attributes'] as $attribute) {\n if (!empty($attribute['label']) && !empty($attribute['value'])) {\n $attributes[$attribute['label']] = $attribute['value'];\n }\n }\n }\n $metas[$meta_key]['attributes'] = $attributes;\n switch ($field['case']) {\n case 'select':\n case 'radio':\n $metas[$meta_key]['options'] = array();\n if (!empty($field['options'])) {\n foreach ($field['options'] as $option) {\n $metas[$meta_key]['options'][$option['option']] = array('label' => __($option['label'], 'extend-wp'));\n }\n }\n break;\n }\n }\n\n return $metas;\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "public function add_formidable_key_field( $fields ) {\n\t\t$fields['key_validator'] = array(\n\t\t\t'name' => FormidableKeyFieldManager::t( \"Key validator\" ),\n\t\t\t'icon' => 'icon fkg-flashlight'\n\t\t);\n\t\t\n\t\treturn $fields;\n\t}", "public function get_fieldset() {\n\t\treturn $this->fieldset;\n\t}", "protected function _prepareForm()\n {\n $model = Mage::registry('navision_customermapping');\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Customer Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n ));\n }\n\n $fieldset->addField('customeremail', 'text', array(\n 'name' => 'customeremail',\n 'label' => Mage::helper('checkout')->__('Customer Email'),\n 'title' => Mage::helper('checkout')->__('Customer Email'),\n 'required' => true,\n ));\n\n $fieldset->addField('magentocustomerid', 'text', array(\n 'name' => 'magentocustomerid',\n 'label' => Mage::helper('checkout')->__('Magento Customer ID'),\n 'title' => Mage::helper('checkout')->__('Magento Customer ID'),\n 'required' => true,\n ));\n $fieldset->addField('navisioncustomerid', 'text', array(\n 'name' => 'navisioncustomerid',\n 'label' => Mage::helper('checkout')->__('Navision Customer ID'),\n 'title' => Mage::helper('checkout')->__('Navision Customer ID'),\n 'required' => true,\n ));\n\n$fieldset->addField('createdby', 'text', array(\n 'name' => 'createdby',\n 'label' => Mage::helper('checkout')->__('Created By'),\n 'title' => Mage::helper('checkout')->__('Created By'),\n 'required' => true,\n ));\n\n $fieldset->addField('needsync', 'checkbox', array(\n \n\n 'name' => 'needsync',\n 'label' => Mage::helper('checkout')->__('Need Sync'),\n\t\t'onclick' => 'this.value = this.checked ? 1 : 0;',\n 'title' => Mage::helper('checkout')->__('Need Sync'),\n 'required' => true,\n ));\n\n\n $form->setValues($model->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "function _addMetadataFields()\n {\n $config =& NDB_Config::singleton();\n $this->dateOptions = array(\n 'language' => 'en',\n 'format' => 'YMd',\n 'minYear' => $config->getSetting('startYear'),\n 'maxYear' => $config->getSetting('endYear'),\n 'addEmptyOption' => true,\n 'emptyOptionValue' => null\n );\n\n $this->form->addElement('date', 'Date_taken', 'Date of Administration', $this->dateOptions);\n\n $examiners = $this->_getExaminerNames();\n $this->form->addElement('select', 'Examiner', 'Radiologist', $examiners);\n\n \t$this->form->addGroupRule('Date_taken', 'Date of Administration is required', 'required');\n\n $this->form->registerRule('checkdate', 'callback', '_checkDate');\n $this->form->addRule('Date_taken', 'Date of Administration is invalid', 'checkdate');\n\n $this->form->addRule('Examiner', 'Examiner is required', 'required');\n }", "public function set_fieldset_tag($tag) {\n\t\t$this->fieldset_tag = $tag;\n\t\t\n\t\treturn $this;\n\t}", "public function renderFieldsetContent( FieldsetInterface $fieldset,\n $class = '' )\n {\n $markup = '';\n $elements = array();\n $markup .= $this->renderDescription( $fieldset );\n $markup .= sprintf( $this->formOpen, $class );\n $markup .= PHP_EOL;\n\n /* @var $element \\Zend\\Form\\ElementInterface */\n foreach ( $fieldset as $element )\n {\n $group = $element->getOption( 'display_group' );\n\n if ( empty( $group ) )\n {\n $elements[] = $element;\n }\n else\n {\n $elements[$group][] = $element;\n }\n }\n\n foreach ( $elements as $key => $item )\n {\n if ( is_array( $item ) )\n {\n if ( $this->isTranslatorEnabled() )\n {\n $key = $this->getTranslator()\n ->translate( $key,\n $this->getTranslatorTextDomain() );\n }\n\n $markup .= sprintf( $this->inputOpen, 'display-group' );\n $markup .= PHP_EOL;\n $markup .= '<fieldset class=\"display-group\">';\n $markup .= PHP_EOL;\n $markup .= sprintf( '<legend>%s</legend>', $key );\n $markup .= PHP_EOL;\n $markup .= sprintf( $this->formOpen, 'display-group-items' );\n $markup .= PHP_EOL;\n\n foreach ( $item as $element )\n {\n $markup .= $this->renderFieldsetItem( $element );\n }\n\n $markup .= PHP_EOL;\n $markup .= $this->formClose;\n $markup .= PHP_EOL;\n $markup .= '</fieldset>';\n $markup .= PHP_EOL;\n $markup .= $this->inputClose;\n }\n else\n {\n $markup .= $this->renderFieldsetItem( $item );\n }\n }\n\n $markup .= $this->formClose;\n return $markup;\n }", "public function setupFilterSpecs($fieldset, $specification)\n {\n $this->get($fieldset)->setInputFilterSpecification($specification);\n }", "function fieldset(array $fields = [])\n {\n return new \\Grogu\\Acf\\Entities\\FieldSet($fields);\n }", "function add_sections_and_fields(): void {}", "public function defineFormFields()\n {\n return 'fields.yaml';\n }", "public static function prepare_file_attachments_fieldset( $field, $key, $args ) {\n\t\t$field_body = '<a href=\"#\" class=\"woocommerce-button button wc-cs-add-file\">' . esc_html__( 'Add Attachment', 'credits-for-woocommerce' ) . '</a>' ;\n\t\t$field_body .= '<table><tbody></tbody></table>' ;\n\n\t\treturn self::prepare_fieldset( $field_body, $args, 'wc-cs-file-attachments' ) ;\n\t}", "function get_button_group_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T521zN1cd48f4',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_N121z7ocd48f5',\n\t\t\t'label' => 'Contet',\n\t\t\t'name' => 'content',\n\t\t\t'type' => 'wysiwyg',\n\t\t\t'required' => '',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_59944311d4a7b',\n\t\t\t'label' => 'Button',\n\t\t\t'name' => 'button',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'bttn_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_T521zN1cd48f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T5MtzN1cd48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T5MbzN1cD59q4',\n\t\t\t'label' => 'Align',\n\t\t\t'name' => 'align',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'center' => 'Center',\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'right' => 'Right'\n\t\t\t),\n\t\t\t'default_values' => array ( 'center' )\n\t\t),\n\t);\n}", "protected function addFieldGroupConfigs()\n {\n // TODO: add acf field group configs\n }", "public function getFieldSet() {\n\t\treturn $this->fieldset;\n\t}", "public function get_fields( $specific_field = \"\" )\n {\n\n $fields = array(\n \n 'ue_id' => array(\n 'table' => $this->_table,\n 'name' => 'ue_id',\n 'label' => 'id #',\n 'type' => 'hidden',\n 'type_dt' => 'text',\n 'attributes' => array(),\n 'dt_attributes' => array(\"width\"=>\"5%\"),\n 'js_rules' => '',\n 'rules' => 'trim'\n ),\n\n 'ue_user_id' => array(\n 'table' => $this->_table,\n 'name' => 'ue_user_id',\n 'label' => 'User ID',\n 'type' => 'text',\n 'type_dt' => 'text',\n 'type_filter_dt' => 'text',\n 'attributes' => array(),\n 'dt_attributes' => array(\"width\"=>\"10%\"),\n 'js_rules' => 'required',\n 'rules' => 'required|trim'\n ),\n\n 'ue_order_item_id' => array(\n 'table' => $this->_table,\n 'name' => 'ue_order_item_id',\n 'label' => 'Order Item ID',\n 'type' => 'text',\n 'attributes' => array(),\n 'js_rules' => 'required',\n 'rules' => 'required|trim|htmlentities'\n ),\n\n 'ue_exam_list_id' => array(\n 'table' => $this->_table,\n 'name' => 'ue_exam_list_id',\n 'label' => 'Exam Item ID',\n 'type' => 'text',\n 'attributes' => array(),\n 'js_rules' => array(),\n 'rules' => 'required|htmlentities'\n ),\n 'ue_exam_id' => array(\n 'table' => $this->_table,\n 'name' => 'ue_exam_id',\n 'label' => 'Exam ID',\n 'type' => 'text',\n 'attributes' => array(),\n 'js_rules' => array(),\n 'rules' => 'required|htmlentities'\n ),\n 'ue_position' => array(\n 'table' => $this->_table,\n 'name' => 'ue_position',\n 'label' => 'Position',\n 'type' => 'text',\n 'attributes' => array(),\n 'js_rules' => array(),\n 'rules' => 'required|htmlentities'\n ),\n 'ue_exam_answer' => array(\n 'table' => $this->_table,\n 'name' => 'ue_exam_answer',\n 'label' => 'Answer',\n 'type' => 'text',\n 'attributes' => array(),\n 'js_rules' => array(),\n 'rules' => 'required|htmlentities'\n ),\n\n 'ue_status' => array(\n 'table' => $this->_table,\n 'name' => 'ue_status',\n 'label' => 'Status?',\n 'type' => 'switch',\n 'type_dt' => 'dropdown',\n 'type_filter_dt' => 'dropdown',\n 'list_data_key' => \"user_exam_status\" ,\n 'list_data' => array(\n 0 => \"<span class=\\\"label label-default\\\">Inactive</span>\" ,\n 1 => \"<span class=\\\"label label-primary\\\">Active</span>\"\n ) ,\n 'default' => '1',\n 'attributes' => array(),\n 'dt_attributes' => array(\"width\"=>\"7%\"),\n 'rules' => 'trim'\n ),\n \n );\n \n if($specific_field)\n return $fields[ $specific_field ];\n else\n return $fields;\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'entryType' => fn(ParseNode $n) => $o->setEntryType($n->getStringValue()),\n 'errorCode' => fn(ParseNode $n) => $o->setErrorCode($n->getStringValue()),\n 'errorMessage' => fn(ParseNode $n) => $o->setErrorMessage($n->getStringValue()),\n 'joiningValue' => fn(ParseNode $n) => $o->setJoiningValue($n->getStringValue()),\n 'recordedDateTime' => fn(ParseNode $n) => $o->setRecordedDateTime($n->getDateTimeValue()),\n 'reportableIdentifier' => fn(ParseNode $n) => $o->setReportableIdentifier($n->getStringValue()),\n ]);\n }", "protected function generate_active_field_list(array $fieldsets, array $fields_by_fieldset, array $active_fields_by_fieldset,\n array $overridden_names = array()) {\n $html = '';\n $rename_default = get_string('rename', 'rlipexport_version1elis');\n foreach ($active_fields_by_fieldset as $fieldsetfield => $header) {\n $fieldsetfield_parts = explode('/', $fieldsetfield, 2);\n $fieldset = $fieldsetfield_parts[0];\n $field = $fieldsetfield_parts[1];\n $fieldset_label = (isset($fieldsets[$fieldset])) ? $fieldsets[$fieldset] : $fieldset;\n\n $name_override = (isset($overridden_names[$fieldset.'/'.$field])) ? $overridden_names[$fieldset.'/'.$field] : '';\n $name_override_display = ($name_override !== '') ? $overridden_names[$fieldset.'/'.$field] : $rename_default;\n\n $field_attrs = array(\n 'data-fieldset' => $fieldset,\n 'data-fieldsetlabel' => $fieldset_label,\n 'data-field' => $field,\n 'class' => 'fieldset_'.$fieldset.' field_'.$field\n );\n $field_body = html_writer::tag('span', 'X', array('class' => 'remove'));\n $field_body .= html_writer::tag('span', $fieldset_label.': '.$header);\n\n // Field input.\n $field_input_attrs = array(\n 'name' => 'fields[]',\n 'type' => 'hidden',\n 'value' => $fieldset.'/'.$field\n );\n $field_body .= html_writer::empty_tag('input', $field_input_attrs);\n\n $fieldname_attrs = array(\n 'class' => 'fieldname',\n 'name' => 'fieldnames[]',\n 'type' => 'hidden',\n 'value' => $name_override\n );\n $field_body .= html_writer::empty_tag('input', $fieldname_attrs);\n\n // Rename link.\n $rename_link_attrs = array('class' => 'rename', 'data-default' => $rename_default, 'href' => 'javascript:;');\n $field_body .= html_writer::tag('a', $name_override_display, $rename_link_attrs);\n\n $html .= html_writer::tag('li', $field_body, $field_attrs);\n }\n return $html;\n }", "function add_local_field_group(){\n \n acf_add_local_field_group(array(\n 'key' => 'group_acfe_dynamic_options_page',\n 'title' => __('Options Page', 'acfe'),\n \n 'location' => array(\n array(\n array(\n 'param' => 'post_type',\n 'operator' => '==',\n 'value' => $this->post_type,\n ),\n ),\n ),\n \n 'menu_order' => 0,\n 'position' => 'normal',\n 'style' => 'default',\n 'label_placement' => 'left',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => '',\n 'active' => 1,\n 'description' => '',\n \n 'fields' => array(\n array(\n 'key' => 'field_acfe_dop_menu_slug',\n 'label' => 'Menu slug',\n 'name' => 'menu_slug',\n 'type' => 'acfe_slug',\n 'instructions' => '(string) The URL slug used to uniquely identify this options page. Defaults to a url friendly version of Menu Title',\n 'required' => 1,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => array(\n '5cd2a4d60fbf2' => array(\n 'acfe_update_function' => 'sanitize_title',\n ),\n ),\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_menu_title',\n 'label' => 'Menu title',\n 'name' => 'menu_title',\n 'type' => 'text',\n 'instructions' => '(string) The title displayed in the wp-admin sidebar. Defaults to Page Title',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_capability',\n 'label' => 'Capability',\n 'name' => 'capability',\n 'type' => 'text',\n 'instructions' => '(string) The capability required for this menu to be displayed to the user. Defaults to edit_posts.<br /><br />\n\nRead more about capability here: <a href=\"https://wordpress.org/support/article/roles-and-capabilities/\">https://wordpress.org/support/article/roles-and-capabilities/</a>',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => 'edit_posts',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_position',\n 'label' => 'Position',\n 'name' => 'position',\n 'type' => 'text',\n 'instructions' => '(int|string) The position in the menu order this menu should appear. Defaults to bottom of utility menu items.<br /><br />\n\nWARNING: if two menu items use the same position attribute, one of the items may be overwritten so that only one item displays!<br />\nRisk of conflict can be reduced by using decimal instead of integer values, e.g. \\'63.3\\' instead of 63 (must use quotes).',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_parent_slug',\n 'label' => 'Parent slug',\n 'name' => 'parent_slug',\n 'type' => 'text',\n 'instructions' => '(string) The slug of another WP admin page. if set, this will become a child page.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_icon_url',\n 'label' => 'Icon url',\n 'name' => 'icon_url',\n 'type' => 'text',\n 'instructions' => '(string) The icon class for this menu. Defaults to default WordPress gear.<br /><br />\nRead more about dashicons here: <a href=\"https://developer.wordpress.org/resource/dashicons/\">https://developer.wordpress.org/resource/dashicons/</a>',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => '',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_redirect',\n 'label' => 'Redirect',\n 'name' => 'redirect',\n 'type' => 'true_false',\n 'instructions' => '(boolean) If set to true, this options page will redirect to the first child page (if a child page exists).\nIf set to false, this parent page will appear alongside any child pages. Defaults to true',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 1,\n 'ui' => 1,\n 'ui_on_text' => 'True',\n 'ui_off_text' => 'False',\n ),\n array(\n 'key' => 'field_acfe_dop_post_id',\n 'label' => 'Post ID',\n 'name' => 'post_id',\n 'type' => 'text',\n 'instructions' => '(int|string) The \\'$post_id\\' to save/load data to/from. Can be set to a numeric post ID (123), or a string (\\'user_2\\').\nDefaults to \\'options\\'.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => 'options',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_autoload',\n 'label' => 'Autoload',\n 'name' => 'autoload',\n 'type' => 'true_false',\n 'instructions' => '(boolean) Whether to load the option (values saved from this options page) when WordPress starts up.\nDefaults to false.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'message' => '',\n 'default_value' => 0,\n 'ui' => 1,\n 'ui_on_text' => 'True',\n 'ui_off_text' => 'False',\n ),\n array(\n 'key' => 'field_acfe_dop_update_button',\n 'label' => 'Update button',\n 'name' => 'update_button',\n 'type' => 'text',\n 'instructions' => '(string) The update button text.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => 'Update',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n array(\n 'key' => 'field_acfe_dop_updated_message',\n 'label' => 'Updated Message',\n 'name' => 'updated_message',\n 'type' => 'text',\n 'instructions' => '(string) The message shown above the form on submit.',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => array(\n 'width' => '',\n 'class' => '',\n 'id' => '',\n ),\n 'acfe_validate' => '',\n 'acfe_update' => '',\n 'acfe_permissions' => '',\n 'default_value' => 'Options Updated',\n 'placeholder' => '',\n 'prepend' => '',\n 'append' => '',\n 'maxlength' => '',\n ),\n ),\n ));\n \n }", "function awm_fields_configuration()\n {\n $metas = array(\n 'awm_fields' => array(\n 'item_name' => __('Field', 'extend-wp'),\n 'label' => __('Fields', 'extend-wp'),\n 'case' => 'repeater',\n 'include' => array(\n 'key' => array(\n 'label' => __('Meta key', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'label' => array(\n 'label' => __('Meta label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'case' => array(\n 'label' => __('Field type', 'extend-wp'),\n 'case' => 'select',\n 'options' => awmInputFields(),\n 'label_class' => array('awm-needed'),\n 'attributes' => array('data-callback' => \"awm_get_case_fields\"),\n ),\n 'case_extras' => array(\n 'label' => __('Field type configuration', 'extend-wp'),\n 'case' => 'html',\n 'value' => '<div class=\"awm-field-type-configuration\"></div>',\n 'exclude_meta' => true,\n 'show_label' => true\n ),\n 'attributes' => array(\n 'label' => __('Attributes', 'extend-wp'),\n 'explanation' => __('like min=0 / onchange=action etc'),\n 'minrows' => 0,\n 'case' => 'repeater',\n 'item_name' => __('Attribute', 'extend-wp'),\n 'include' => array(\n 'label' => array(\n 'label' => __('Attribute label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'value' => array(\n 'label' => __('Attribute value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n )\n ),\n 'class' => array(\n 'label' => __('Class', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'attributes' => array('placeholder' => __('Seperated with (,) comma', 'extend-wp')),\n ),\n 'required' => array(\n 'label' => __('Required', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'admin_list' => array(\n 'label' => __('Show in admin list', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'auto_translate' => array(\n 'label' => __('Auto translate', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'checkbox',\n ),\n 'order' => array(\n 'label' => __('Order', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'number',\n ),\n 'explanation' => array(\n 'label' => __('User message', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'attributes' => array('placeholder' => __('Guidelines for the user', 'extend-wp')),\n ),\n )\n )\n );\n return apply_filters('awm_fields_configuration_filter', $metas);\n }", "function get_section_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_5821ee172a4d4',\n\t\t\t'label' => 'Rows',\n\t\t\t'name' => 'Rows_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821e254f6599',\n\t\t\t'label' => 'Rows of content',\n\t\t\t'name' => 'rows',\n\t\t\t'type' => 'flexible_content',\n\t\t\t'required' => 0,\n\t\t\t'button_label' => 'Add Row',\n\t\t\t'layouts' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => '5821e26955f33',\n\t\t\t\t\t'name' => 'row',\n\t\t\t\t\t'label' => 'Row',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_row_local_field( $id )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821d6ba5de39',\n\t\t\t'label' => 'Wrapper options',\n\t\t\t'name' => 'Wrapper_Options_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_1111e711149fe',\n\t\t\t'label' => 'Enable paddings for section?',\n\t\t\t'name' => 'paddings',\n\t\t\t'type' => 'checkbox',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'right' => 'Right',\n\t\t\t\t'top' => 'Top',\n\t\t\t\t'bottom' => 'Bottom',\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'left',\n\t\t\t\t1 => 'right',\n\t\t\t\t2 => 'top',\n\t\t\t\t3 => 'bottom'\n\t\t\t),\n\t\t\t'layout' => 'horizontal',\n\t\t\t'toggle' => 1,\n\t\t),\n\t\tarray (\n\t\t\t'key' => 'bgrd_582si7ez6imbg',\n\t\t\t'label' => 'Expande the section',\n\t\t\t'name' => 'expanded',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'nope' => 'No',\n\t\t\t\t'yep' => 'Yes',\n\t\t\t),\n\t\t\t'default_values' => array ( 'nope' ),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821d6ba6de39',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'Background_Options_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821t6ba6ze48',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'background',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'bgrd_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821da4aabd7c',\n\t\t\t'label' => 'Divider Options',\n\t\t\t'name' => 'Divider_Options_tab',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5821da4aabd8r',\n\t\t\t'label' => 'Dividers',\n\t\t\t'name' => 'dividers',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'dibo_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a4d4',\n\t\t\t'label' => 'AJAX',\n\t\t\t'name' => 'Ajax_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a3d5',\n\t\t\t'label' => 'Type',\n\t\t\t'name' => 'ajax_type',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'false' => 'No, thanks',\n\t\t\t\t'underneath' => 'Load underneath'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'false'\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a1d7',\n\t\t\t'name' => 'separator_1',\n\t\t\t'type' => 'message',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => 0,\n\t\t\t'message' => '<hr />',\n\t\t\t'new_lines' => '',\n\t\t\t'esc_html' => 0,\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a2d6',\n\t\t\t'label' => 'Loading button',\n\t\t\t'name' => 'ajax_button',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'under-rows' => 'Button under rows',\n\t\t\t\t'in-context' => 'In context'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'under-rows'\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a0d8',\n\t\t\t'label' => 'Show more button label',\n\t\t\t'name' => 'ajax_label_show',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t),\n\t\t\t'placeholder' => 'Show more'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a9c9',\n\t\t\t'label' => 'Hide button label',\n\t\t\t'name' => 'ajax_label_hide',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t),\n\t\t\t'placeholder' => 'Show less'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x2a8c9',\n\t\t\t'label' => 'AJAX trigger',\n\t\t\t'name' => 'ajax_trigger',\n\t\t\t'type' => 'text',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '50'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'in-context'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'prepend' => 'ajax-trigger=',\n\t\t\t'placeholder' => 'example-trigger'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a1v7',\n\t\t\t'name' => 'separator_2',\n\t\t\t'type' => 'message',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => 0,\n\t\t\t'message' => '<hr />',\n\t\t\t'new_lines' => '',\n\t\t\t'esc_html' => 0,\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a0v8',\n\t\t\t'label' => 'Show at once',\n\t\t\t'name' => 'ajax_at_once',\n\t\t\t'type' => 'number',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'append' => 'row(s)',\n\t\t\t'default_value' => '1',\n\t\t\t'min' => '0'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5a2jea1x1a9v9',\n\t\t\t'label' => 'Showing steps',\n\t\t\t'name' => 'ajax_steps',\n\t\t\t'type' => 'select',\n\t\t\t'required' => '',\n\t\t\t'choices' => array (\n\t\t\t\t'all' => 'All hidden rows',\n\t\t\t\t'one-by-one' => 'One by one'\n\t\t\t),\n\t\t\t'default_values' => array (\n\t\t\t\t'under-rows'\n\t\t\t),\n\t\t\t'conditional_logic' => array(\n\t\t\t\tarray(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a2d6',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'under-rows'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5a2jea1x2a3d5',\n\t\t\t\t\t\t'operator' => '!=',\n\t\t\t\t\t\t'value' => 'false'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t);\n}", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => [\n 'id' => 'edit_form',\n 'action' => $this->getUrl('reverbsync/reverbsync_field/save'),\n 'method' => 'post',\n\t\t\t\t\t'enctype' => 'multipart/form-data',\n ],\n ]\n );\n $form->setUseContainer(true);\n\t\t$model = $this->_coreRegistry->registry('reverbsync_field_mapping');\n\t\t$fieldset = $form->addFieldset(\n 'base_fieldset',\n array('legend' => __('Magento-Reverb Field Mapping'), 'class'=>'fieldset-wide')\n );\n\t\t\n\t\tif ($model->getMappingId()) {\n $fieldset->addField(\n\t\t\t\t'mapping_id',\n\t\t\t\t'hidden', \n\t\t\t\t['name' => 'mapping_id']\n\t\t\t);\n }\n\t\t$fieldset->addField(\n 'magento_attribute_code',\n 'select',\n [\n\t\t\t\t'name' => 'magento_attribute_code', \n\t\t\t\t'label' => __('Magento Attribute'), \n\t\t\t\t'title' => __('Magento Attribute Code'),\n\t\t\t\t'values' => $this->_productAttribute->toOptionArray(),\n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$fieldset->addField(\n 'reverb_api_field',\n 'text',\n [\n\t\t\t\t'name' => 'reverb_api_field', \n\t\t\t\t'label' => __('Reverb API Field'), \n\t\t\t\t'title' => __('Reverb API Field'), \n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$form->setValues($model->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }", "function element_set_form($record, $elementSetName)\n{\n $recordType = get_class($record);\n if ($recordType == 'Item' && $elementSetName == 'Item Type Metadata') {\n $elements = $record->getItemTypeElements();\n } else {\n $elements = get_db()->getTable('Element')->findBySet($elementSetName);\n }\n $filterName = array('ElementSetForm', $recordType, $elementSetName);\n $elements = apply_filters(\n $filterName,\n $elements,\n array('record_type' => $recordType, 'record' => $record, 'element_set_name' => $elementSetName)\n );\n $html = element_form($elements, $record);\n return $html;\n}", "function acf_prepare_field_group_for_import($field_group)\n{\n}", "protected function _prepareForm()\n {\n $model = $this->_coreRegistry->registry('current_amasty_finder_finder');\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('finder_');\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General')]);\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', ['name' => 'id']);\n }\n $fieldset->addField(\n 'name',\n 'text',\n ['name' => 'name', 'label' => __('Title'), 'title' => __('Title'), 'required' => true]\n );\n\n if (!$model->getId()) {\n $fieldset->addField(\n 'cnt',\n 'text',\n [\n 'name' => 'cnt',\n 'label' => __('Number of Dropdowns'),\n 'title' => __('Number of Dropdowns'),\n 'class' => 'validate-greater-than-zero',\n 'required' => true\n ]\n );\n }\n\n $fieldset->addField(\n 'template',\n 'select',\n [\n 'name' => 'template',\n 'label' => __('Template'),\n 'title' => __('Template'),\n 'required' => false,\n 'values' => [\n ['value' => 'horizontal', 'label' => __('Horizontal')],\n ['value' => 'vertical', 'label' => __('Vertical')]\n ],\n 'note' => __('The `horizontal` option is responsive and set by default')\n ]\n );\n\n $fieldset->addField(\n 'custom_url',\n 'text',\n [\n 'name' => 'custom_url',\n 'label' => __('Custom Destination URL'),\n 'title' => __('Custom Destination URL'),\n 'required' => false,\n 'note' =>\n __(\n 'It determines the page the Finder will redirect customers to when the Find button is pressed. \n Enter category URL, e.g. special-category.html to redirect search results to one category.'\n )\n ]\n );\n\n $fieldset->addField(\n 'default_category',\n 'select',\n [\n 'name' => 'default_category',\n 'label' => __('Add Finder to the Default Category'),\n 'title' => __('Add Finder to the Default Category'),\n 'required' => false,\n 'values' => $this->yesno->toOptionArray(),\n 'note' =>\n __(\n 'Keep \\'Yes\\' to get the Finder working properly at the home and cms pages.'\n )\n ]\n );\n\n $fieldset->addField(\n 'hide_finder',\n 'select',\n [\n 'name' => 'hide_finder',\n 'label' => __('Finder block visibility on the Default Category'),\n 'title' => __('Finder block visibility on the Default Category'),\n 'required' => false,\n 'values' => [\n ['value' => 0, 'label' => __('Hide')],\n ['value' => 1, 'label' => __('Show')]\n ],\n 'note' =>\n __(\n 'Keep \\'Hide\\' to not display this finder block on the default category on the frontend. \n It is useful when there are several finders added to the default category but you need to \n display only one of them at the frontend.'\n )\n ]\n );\n\n $fieldset->addField(\n 'search_page',\n 'select',\n [\n 'name' => 'search_page',\n 'label' => __('Add Finder to the Search Page'),\n 'title' => __('Add Finder to the Search Page'),\n 'required' => false,\n 'values' => $this->yesno->toOptionArray()\n ]\n );\n\n $fieldset->addField(\n 'position',\n 'text',\n [\n 'name' => 'position',\n 'label' => __('Add the finder block in'),\n 'title' => __('Add the finder block in'),\n 'required' => false,\n 'note' =>\n __(\n 'Place the product finder in particular themes, categories, and other locations.\n Possible options: sidebar.main, content, content.top, footer.'\n )\n ]\n );\n\n $fieldset->addField(\n 'categories',\n 'multiselect',\n [\n 'name' => 'categories',\n 'label' => __('Categories'),\n 'title' => __('Categories'),\n 'style' => 'height: 500px; width: 300px;',\n 'values' => $this->categorySource->toOptionArray(),\n ]\n );\n\n if ($model->getId()) {\n $fieldset->addField(\n 'code_for_inserting',\n 'textarea',\n [\n 'label' => __('Code for inserting'),\n 'title' => __('Code for inserting'),\n 'disabled' => 1,\n 'note' =>\n 'Use this code if you want to put product finder in any CMS page or block.'\n ]\n );\n $fieldSettings = [\n 'label' => __('Code for inserting in Layout Update XML'),\n 'title' => __('Code for inserting in Layout Update XML'),\n 'disabled' => 1,\n ];\n\n if (version_compare($this->magentoVersion->get(), '2.3.4', '<')) {\n $fieldSettings['note'] = 'To add a product finder to a category manually, navigate to \n Catalog > Categories > Select your category (i.e. Wheels). \n In the Design section find Layout Update XML field and paste the code there.';\n }\n\n $fieldset->addField(\n 'code_for_inserting_in_layout',\n 'textarea',\n $fieldSettings\n );\n }\n\n if (!$model->getId()) {\n $form->addValues(\n [\n 'default_category' => 1,\n 'hide_finder' => 0\n ]\n );\n }\n\n $htmlIdPrefix = $form->getHtmlIdPrefix();\n\n $this->setChild(\n 'form_after',\n $this->getLayout()->createBlock(\\Magento\\Backend\\Block\\Widget\\Form\\Element\\Dependence::class)\n ->addFieldMap($htmlIdPrefix . 'default_category', 'default_category')\n ->addFieldMap($htmlIdPrefix . 'hide_finder', 'hide_finder')\n ->addFieldDependence('hide_finder', 'default_category', 1)\n );\n\n $form->setValues($model->getData());\n $form->addValues(\n [\n 'id' => $model->getId(),\n 'code_for_inserting' =>\n '{{block class=\"Amasty\\\\Finder\\\\Block\\\\Form\" block_id=\"finder_form\" '\n . 'location=\"cms\" id=\"' . $model->getId() . '\"}}',\n 'code_for_inserting_in_layout' => $model->getFinderXmlCode()\n ]\n );\n\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "protected function _prepareLayout()\n {\n parent::_prepareLayout();\n $form = new Varien_Data_Form();\n $package = Mage::registry('current_package');\n\n $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('genmato_composerrepo')->__('Package Information')));\n\n $fieldset->addField('name', 'text',\n array(\n 'name' => 'name',\n 'label' => Mage::helper('genmato_composerrepo')->__('Package Name'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Package Name'),\n 'note' => Mage::helper('genmato_composerrepo')->__('Composer package name [vender]/[module-name]'),\n 'required' => true,\n )\n );\n\n $fieldset->addField('status', 'select',\n array(\n 'name' => 'status',\n 'label' => Mage::helper('genmato_composerrepo')->__('Status'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Status'),\n 'class' => 'required-entry',\n 'required' => true,\n 'values' => Mage::getSingleton('genmato_composerrepo/system_source_packages_status')->toOptionArray()\n )\n );\n\n $fieldset->addField('bundled_package', 'select',\n array(\n 'name' => 'bundled_package',\n 'label' => Mage::helper('genmato_composerrepo')->__('Package Type'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Package Type'),\n 'note' => Mage::helper('genmato_composerrepo')->__('Bundled packages will always be available in the packages.json, this can be useful for required library packages'),\n 'class' => 'required-entry',\n 'required' => true,\n 'values' => Mage::getSingleton('genmato_composerrepo/system_source_packages_type')->toOptionArray()\n )\n );\n\n $fieldset->addField('description', 'text',\n array(\n 'name' => 'description',\n 'label' => Mage::helper('genmato_composerrepo')->__('Package Title'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Package Title'),\n 'note' => Mage::helper('genmato_composerrepo')->__('Used to describe package in customer menu'),\n 'required' => true,\n )\n );\n\n $fieldset->addField('product_id', 'text',\n array(\n 'name' => 'product_id',\n 'label' => Mage::helper('genmato_composerrepo')->__('Magento Product ID'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Magento Product ID'),\n 'required' => true,\n )\n );\n\n $fieldset->addField('repository_url', 'text',\n array(\n 'name' => 'repository_url',\n 'label' => Mage::helper('genmato_composerrepo')->__('Repository URL'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Repository URL'),\n 'required' => true,\n )\n );\n\n $fieldset->addField('repository_options', 'textarea',\n array(\n 'name' => 'repository_options',\n 'label' => Mage::helper('genmato_composerrepo')->__('Repository options'),\n 'title' => Mage::helper('genmato_composerrepo')->__('Repository options'),\n 'note' => Mage::helper('genmato_composerrepo')->__('Repository extra parameters in JSON format'),\n )\n );\n\n\n $form->addValues($package->getData());\n\n $form->setUseContainer(true);\n $form->setId('edit_form');\n $form->setAction($this->getUrl('*/*/save', array('id'=>$package->getId())));\n $form->setMethod('post');\n $this->setForm($form);\n }", "function get_required_fields($field, $html = false) {\n\n $meta_keys = fields\\get_field_ids($field, $html);\n\n if (isset($field['required'])) {\n if (gettype($field['required']) == 'boolean' && $field['required']) return $meta_keys;\n if (is_array($field['required'])) {\n if (count($field['required']) == count($meta_keys)) {\n $meta_keys = lib\\array_mask($meta_keys, $field['required']);\n } else {\n log\\error('INVALID_FIELD', 'The field is invalid because the length of the required array != number of meta keys ids for this type of field. Details '.json_encode($field));\n }\n } \n } else if ($field['type'] == 'REPEAT-GROUP') {\n $res = array_map(function($f) { return get_required_fields($f, true);}, $field['fields']);\n $meta_keys = lib\\array_flatten($res);\n }\n\n return $meta_keys;\n}", "private function createFieldset(Form $form)\n {\n $fieldset = $form->addFieldset(\n 'elasticsuite_cms_attribute_fieldset',\n [\n 'legend' => __('Search Configuration'),\n ],\n 'content_fieldset'\n );\n\n return $fieldset;\n }", "public function field_groups() {\n\t\tinclude_once KCN_PATH . '/includes/fields/acf-sample-options.php';\n\t}", "public static function get_input_fields() {\n\t\t$allowed_settings = DataSource::get_allowed_settings();\n\n\t\t$input_fields = [];\n\n\t\tif ( ! empty( $allowed_settings ) ) {\n\n\t\t\t/**\n\t\t\t * Loop through the $allowed_settings and build fields\n\t\t\t * for the individual settings\n\t\t\t */\n\t\t\tforeach ( $allowed_settings as $key => $setting ) {\n\n\t\t\t\t/**\n\t\t\t\t * Determine if the individual setting already has a\n\t\t\t\t * REST API name, if not use the option name.\n\t\t\t\t * Sanitize the field name to be camelcase\n\t\t\t\t */\n\t\t\t\tif ( ! empty( $setting['show_in_rest']['name'] ) ) {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) );\n\t\t\t\t}\n\n\t\t\t\t$replaced_setting_key = preg_replace( '[^a-zA-Z0-9 -]', ' ', $individual_setting_key );\n\n\t\t\t\tif ( ! empty( $replaced_setting_key ) ) {\n\t\t\t\t\t$individual_setting_key = $replaced_setting_key;\n\t\t\t\t}\n\n\t\t\t\t$individual_setting_key = lcfirst( $individual_setting_key );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '_', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( '-', ' ', ucwords( $individual_setting_key, '_' ) ) );\n\t\t\t\t$individual_setting_key = lcfirst( str_replace( ' ', '', ucwords( $individual_setting_key, ' ' ) ) );\n\n\t\t\t\t/**\n\t\t\t\t * Dynamically build the individual setting,\n\t\t\t\t * then add it to the $input_fields\n\t\t\t\t */\n\t\t\t\t$input_fields[ $individual_setting_key ] = [\n\t\t\t\t\t'type' => $setting['type'],\n\t\t\t\t\t'description' => $setting['description'],\n\t\t\t\t];\n\n\t\t\t}\n\t\t}\n\n\t\treturn $input_fields;\n\t}", "public static function set_fields() {\r\n if ( ! function_exists( 'acf_add_local_field_group' ) ) {\r\n return;\r\n }\r\n $options = get_option( 'myhome_redux' );\r\n $fields = array(\r\n /*\r\n * General tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_general',\r\n 'label' => esc_html__( 'General', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'top',\r\n 'wrapper' => array (\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ),\r\n ),\r\n // Featured\r\n array(\r\n 'key' => 'myhome_estate_featured',\r\n 'label' => esc_html__( 'Featured', 'myhome-core' ),\r\n 'name' => 'estate_featured',\r\n 'type' => 'true_false',\r\n 'default_value' => false,\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ),\r\n );\r\n\r\n foreach ( My_Home_Attribute::get_attributes() as $attr ) {\r\n if ( $attr->get_type() != 'field' ) {\r\n continue;\r\n }\r\n\r\n $name = $attr->get_name();\r\n $display_after = $attr->get_display_after();\r\n if ( ! empty( $display_after ) ) {\r\n $name .= ' (' . $display_after . ')';\r\n }\r\n\r\n array_push( $fields, array(\r\n 'key' => 'myhome_estate_attr_' . $attr->get_slug(),\r\n 'label' => $name,\r\n 'name' => 'estate_attr_' . $attr->get_slug(),\r\n 'type' => 'text',\r\n 'default_value' => '',\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ) );\r\n }\r\n\r\n\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Location tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'type' => 'tab',\r\n ),\r\n // Location\r\n array(\r\n 'key' => 'myhome_estate_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'name' => 'estate_location',\r\n 'type' => 'google_map',\r\n ),\r\n /*\r\n * Gallery tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_gallery',\r\n 'label' => 'Gallery',\r\n 'instructions' => 'Click \"Add to gallery\" below to upload files',\r\n 'type' => 'tab',\r\n ),\r\n // Gallery\r\n array(\r\n 'key' => 'myhome_estate_gallery',\r\n 'label' => 'Gallery',\r\n 'name' => 'estate_gallery',\r\n 'type' => 'gallery',\r\n 'preview_size' => 'thumbnail',\r\n 'library' => 'all',\r\n )\r\n ) );\r\n\r\n if ( isset( $options['mh-estate_plans'] ) && $options['mh-estate_plans'] ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Plans tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Plan\r\n array(\r\n 'key' => 'myhome_estate_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'name' => 'estate_plans',\r\n 'type' => 'repeater',\r\n 'button_label' => esc_html__( 'Add plan', 'myhome-core' ),\r\n 'sub_fields' => array(\r\n // Name\r\n array(\r\n 'key' => 'myhome_estate_plans_name',\r\n 'label' => esc_html__( 'Name', 'myhome-core' ),\r\n 'name' => 'estate_plans_name',\r\n 'type' => 'text',\r\n ),\r\n // Image\r\n array(\r\n 'key' => 'myhome_estate_plans_image',\r\n 'label' => esc_html__( 'Image', 'myhome-core' ),\r\n 'name' => 'estate_plans_image',\r\n 'type' => 'image',\r\n ),\r\n ),\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_video'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Video tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_video',\r\n 'label' => esc_html__( 'Video', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Video\r\n array(\r\n 'key' => 'myhome_estate_video',\r\n 'label' => esc_html__( 'Video link (Youtube / Vimeo / Facebook / Twitter / Instagram / link to .mp4)', 'myhome-core' ),\r\n 'name' => 'estate_video',\r\n 'type' => 'oembed',\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_virtual_tour'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Virtual tour tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_virtual_tour',\r\n 'label' => esc_html__( 'Virtual tour', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Virtual tour\r\n array(\r\n 'key' => 'myhome_estate_virtual_tour',\r\n 'label' => esc_html__( 'Add embed code', 'myhome-core' ),\r\n 'name' => 'virtual_tour',\r\n 'type' => 'text',\r\n )\r\n ) );\r\n }\r\n\r\n acf_add_local_field_group(\r\n array(\r\n 'key' => 'myhome_estate',\r\n 'title' => '<span class=\"dashicons dashicons-admin-home\"></span> ' . esc_html__( 'Property details', 'myhome-core' ),\r\n 'fields' => $fields,\r\n 'menu_order' => 10,\r\n 'location' => array(\r\n array(\r\n array(\r\n 'param' => 'post_type',\r\n 'operator' => '==',\r\n 'value' => 'estate',\r\n ),\r\n ),\r\n ),\r\n )\r\n );\r\n }", "abstract protected function loadFields();", "private static function _parse()\n {\n $data = array();\n $data['tab-label'] = $_POST['tab-label'];\n $data['title-disabled'] = (bool) @$_POST['title-disabled'];\n $data['languages'] = $_POST['languages'];\n \n $data['languages'] = $_POST['languages'] ? explode(',',$_POST['languages']) : array(); \n $data['info'] = trim($_POST['info']); \n\t\t\n\t\t\n $data['required-width-comparator'] = $_POST['required-width-comparator']; \n $data['required-width'] = $_POST['required-width']; //do not cast to int\n\t\t$data['required-width-ranges'] = $_POST['required-width-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-width-ranges'])) : array(); //twice explode\n\n\n\t\t$data['required-height-comparator'] = $_POST['required-height-comparator']; \n $data['required-height'] = $_POST['required-height']; //do not cast to int\n\t\t$data['required-height-ranges'] = $_POST['required-height-ranges'] ? array_map('self::_explodeRangeRow', explode(';', $_POST['required-height-ranges'])) : array(); //twice explode\n\n \n $data['fields'] = array();\n \n for ($i=0; isset($_POST['field-'.$i.'-type']); $i++) {\n $field = array();\n \n $field['label'] = $_POST['field-'.$i.'-label'];\n $field['type'] = $_POST['field-'.$i.'-type'];\n $field['required'] = (bool)@$_POST['field-'.$i.'-required'];\n \n if ($field['type'] == 'select')\n $field['options'] = preg_replace('/\\s\\s+/', ',', $_POST['field-'.$i.'-options']);\n \n $data['fields'][] = $field;\n } \n\n $data['thumbnails'] = array();\n \n //thumbs\n for ($i=0; $i <= 1; $i++) {\n $thumb = array();\n\n $thumb['enabled'] = (bool) @$_POST['thumb-'.$i.'-enabled'];\n $thumb['required'] = (bool) @$_POST['thumb-'.$i.'-required'];\n $thumb['label'] = @$_POST['thumb-'.$i.'-label'];\n $thumb['width'] = @$_POST['thumb-'.$i.'-width'];\n $thumb['height'] = @$_POST['thumb-'.$i.'-height'];\n $thumb['auto-crop'] = @$_POST['thumb-'.$i.'-auto-crop'];\n \n $data['thumbnails'][] = $thumb;\n }\n\n return $data;\n }", "function acf_write_json_field_group($field_group)\n{\n}", "public function create_fieldset_end()\n\t{\n\t\treturn '</fieldset>'.\"\\n\";\n\t}", "public static function fieldset($data, $options = array()) {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $data, $options);\n\n\t\t$filtered = self::_applyFilter(get_class(), __FUNCTION__, array(\n\t\t\t'data' => $data,\n\t\t\t'options' => $options\n\t\t), array('event' => 'args'));\n\t\t\n\t\t$data = $filtered['data'];\n\t\t$options = $filtered['options'];\n\n\t\t$tag = Html::generateHtmlTag('fieldset', $data, $options);\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $tag, $data, $options);\n\t\t$tag = self::_applyFilter(get_class(), __FUNCTION__, $tag, array('event' => 'return'));\n\n\t\treturn $tag;\n\t}", "public function testJsonSerialize(): void {\n $fieldset = new \\codename\\core\\ui\\fieldset([\n 'fieldset_id' => 'example',\n 'fieldset_name' => 'example',\n 'fieldset_name_override' => 'example_override',\n ]);\n\n $fieldset->addField(new \\codename\\core\\ui\\field([\n 'field_name' => 'example',\n 'field_type' => 'text',\n 'field_value' => 'example',\n ]));\n\n $fieldset->setType('default');\n\n $outputData = $fieldset->output(true);\n\n $jsonData = json_decode(json_encode($fieldset), true);\n\n $this->assertEquals('example', $jsonData['fieldset_id']);\n $this->assertEquals('example_override', $jsonData['fieldset_name']);\n\n $this->assertCount(1, $jsonData['fields']);\n $fieldData = $jsonData['fields'][0];\n $this->assertEquals('example', $fieldData['field_name']);\n $this->assertEquals('text', $fieldData['field_type']);\n $this->assertEquals('example', $fieldData['field_value']);\n }", "protected function _prepareForm()\n {\n // @codingStandardsIgnoreEnd\n $locatorId = $this->getLocator()->getId();\n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]\n );\n\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Settings')]);\n\n $fieldset->addField(\n 'description',\n 'textarea',\n [\n 'name' => 'description',\n 'label' => __('Description'),\n 'title' => __('Description'),\n 'required' => false,\n ]\n );\n\n $fieldset->addField(\n 'extra_info',\n 'textarea',\n [\n 'name' => 'extra_info',\n 'label' => __('Extra Information'),\n 'title' => __('Extra Information'),\n 'required' => false,\n ]\n );\n\n $fieldset->addField(\n 'email',\n 'text',\n [\n 'name' => 'email',\n 'label' => __('Email'),\n 'title' => __('Email')\n ]\n );\n\n $fieldset->addField(\n 'visiting_hours',\n 'text',\n [\n 'name' => 'visiting_hours',\n 'label' => __('Visiting Hours'),\n 'title' => __('Visiting Hours')\n ]\n );\n\n $fieldset->addField(\n 'website',\n 'text',\n [\n 'name' => 'website',\n 'label' => __('Website'),\n 'title' => __('Website')\n ]\n );\n\n $fieldset->addField(\n 'banner',\n 'hidden',\n [\n 'name' => 'banner'\n ]\n );\n\n $locatorId = $this->getLocator()->getId();\n $value = '';\n if ($locatorId) {\n $value = $this->getLocator()->getBanner();\n }\n $fieldset->addField(\n 'banner_locator',\n 'image',\n [\n 'name' => 'banner_locator',\n 'label' => __('Banner'),\n 'title' => __('Banner'),\n 'value' => $value,\n 'note' => __('Allowed image types: jpg, jpeg, gif, png.')\n ]\n );\n\n if ($locatorId) {\n $form->addValues($this->getLocator()->getData());\n }\n\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "protected function _prepareForm() {\r\n\t $form = new Varien_Data_Form();\r\n\t $this->setForm($form);\r\n\t $fieldset = $form->addFieldset(\"reason_form\", array(\"legend\" => Mage::helper(\"mprmasystem\")->__(\"RMA Reason\")));\r\n\r\n\t\t\t$fieldset->addField(\"reason\", \"textarea\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Reason Provided\"),\r\n\t\t\t\t\"name\" => \"reason\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$fieldset->addField(\"status\", \"select\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Status\"),\r\n\t\t\t\t\"name\" \t\t=> \"status\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true,\r\n\t\t\t\t\"values\"\t=> array(\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Please Select\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"1\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Enable\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"0\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Disable\"))\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t));\r\n\t\t\t\r\n\t if(Mage::registry(\"mprmareason_data\"))\r\n\t $form->setValues(Mage::registry(\"mprmareason_data\")->getData());\t\t\t\r\n\t return parent::_prepareForm();\r\n\t }", "protected function _prepareForm()\n {\n $model = $this->_coreRegistry->registry('current_dcs_faq_items');\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('item_');\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('FAQ Information')]);\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', ['name' => 'id']);\n }\n $fieldset->addField(\n 'question',\n 'text',\n ['name' => 'question', 'label' => __('Question'), 'title' => __('Question'), 'required' => true]\n );\n \n $wysiwygConfig = $this->_wysiwygConfig->getConfig();\n $fieldset->addField(\n 'answer',\n 'editor',\n [\n 'name' => 'answer',\n 'label' => __('Answer'), \n 'title' => __('Answer'), \n 'required' => true ,\n 'config' => $wysiwygConfig \n ]\n );\n\n $fieldset->addField(\n 'category',\n 'select',\n ['name' => 'category',\n 'label' => __('Select Category'),\n 'title' => __('Select Category'),\n 'required' => false ,\n 'options' => $this->_catData->getLoadedFaqCategoryCollection()\n ]\n );\n \n /*$fieldset->addField(\n 'Answer',\n 'editor',\n ['name' => 'answer', 'label' => __('Answer'), 'title' => __('Answer'), 'required' => true, 'style' => 'height:36em',\n 'required' => true]\n );*/\n \n $fieldset->addField(\n 'rank',\n 'text',\n ['name' => 'rank', 'label' => __('Rank'), 'title' => __('Rank'), 'required' => true, 'class' => 'required-entry validate-number validate-greater-than-zero']\n );\n $fieldset->addField(\n 'status',\n 'select',\n ['name' => 'status', 'label' => __('Publish'), 'title' => __('Publish'), 'required' => true, 'options' => $this->_options->getOptionArray()]\n );\n $form->setValues($model->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }", "function get_fields( $custom_field_set , $custom_field_item )\n\t{\t\n\t\t$post_type_fields = include( get_template_directory().'/module/'.$custom_field_set.'/'.$custom_field_item.'/config.fields.php' );\n\t\treturn $post_type_fields;\n\t}", "protected function _prepareForm()\n {\n $model = $this->_coreRegistry->registry('current_lapisbard_storelocator_locations');\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('item_');\n\n $countries = [['value' => 'UK', 'label' => __('UK')], ['value' => 'India', 'label' => __('India')]];\n $yesno = [['value' => 'Enabled', 'label' => __('Enabled')], ['value' => 'Disabled', 'label' => __('Disabled')]];\n\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Location Information')]);\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', ['name' => 'id']);\n }\n\n $fieldset->addField(\n 'store_title',\n 'text',\n ['name' => 'store_title', 'label' => __('Store Title'), 'title' => __('Store Title'), 'required' => true]\n );\n $fieldset->addField(\n 'address',\n 'text',\n ['name' => 'address', 'label' => __('Address'), 'title' => __('Address'), 'required' => true]\n );\n $fieldset->addField(\n 'city',\n 'text',\n ['name' => 'city', 'label' => __('City'), 'title' => __('City'), 'required' => false]\n );\n $fieldset->addField(\n 'state',\n 'text',\n ['name' => 'state', 'label' => __('State'), 'title' => __('State'), 'required' => true]\n );\n $fieldset->addField(\n 'pincode',\n 'text',\n ['name' => 'pincode', 'label' => __('Pin Code'), 'title' => __('Pin Code'), 'required' => true]\n );\n $fieldset->addField(\n 'country',\n 'select',\n ['name' => 'country', 'label' => __('Country'), 'title' => __('Country'), 'values' => $countries]\n );\n $fieldset->addField(\n 'phone',\n 'text',\n ['name' => 'phone', 'label' => __('Phone Number'), 'title' => __('Phone Number'), 'required' => true]\n );\n $fieldset->addField(\n 'email',\n 'text',\n ['name' => 'email', 'label' => __('Email'), 'title' => __('Email'), 'required' => false]\n );\n $fieldset->addField(\n 'is_enable',\n 'select',\n [\n 'name' => 'is_enable',\n 'label' => __('Status'),\n 'title' => __('Status'),\n 'values' => $yesno\n ]\n );\n $form->setValues($model->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }", "function cmc_framework_markets_landing_settings_tab_section(&$form, $i) {\n \n $fieldset_key = 'tab' . $i;\n $title_key = 'cmc_framework_markets_tab' . $i;\n $content_key = 'cmc_framework_markets_tab' . $i . '_content';\n $pricing_key = 'cmc_framework_markets_tab' . $i . '_pricing';\n $image_key = 'cmc_framework_markets_tab' . $i . '_image';\n $image_key_delete = 'cmc_framework_markets_tab' . $i . '_image_delete';\n \n $form[$fieldset_key] = array(\n '#type' => 'fieldset',\n '#title' => t('Tab') . $i,\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n \n $form[$fieldset_key][$title_key] = array(\n '#type' => 'textfield',\n '#title' => t('Title'),\n '#default_value' => variable_get($title_key, 'Tab title'),\n );\n \n\n $textarea_defaults = variable_get($content_key, 'Content');\n $form[$fieldset_key][$content_key] = array(\n '#type' => 'text_format',\n '#title' => t('Content'),\n \t'#default_value' => $textarea_defaults['value'],\n '#format' => $textarea_defaults['format'],\n '#description' => 'Please do not put in images in textarea',\n );\n \n// http://stackoverflow.com/questions/7690295/drupal-module-configuration-process-uploaded-file\n $form[$fieldset_key][$image_key] = array(\n '#type' => 'managed_file',\n '#title' => t('Content Image'),\n '#description' => t('Uploading a file will replace the content image. This should be a generic image so it can be used for multiple languages. E.g. Don\\'t put text into it'),\n '#upload_location' => 'public://cmc_framework/markets-landing'\n );\n \n $image_fid = variable_get($image_key, '');\n $image = file_load($image_fid);\n \n if (!empty($image->fid)) {\n $data = array(\n 'path' => file_create_url($image->uri),\n );\n $form[$fieldset_key][$image_key]['#description'] .= '<br />' . theme('image', $data);\n \n }\n \n $form[$fieldset_key][$image_key_delete] = array(\n '#type' => 'checkbox',\n '#title' => t('Delete Image'),\n );\n \n \n \n // pricing, only do this if module is on\n if (module_exists('cmc_pricing')) {\n \n $view = views_get_view('cmc_pricing');\n $content = $view->preview('pricing_panel_list');\n \n $options = array('' => 'None');\n foreach ($view->result as $res) {\n $options[$res->nid] = $res->node_title;\n }\n \n $form[$fieldset_key][$pricing_key] = array(\n '#type' => 'select',\n '#options' => $options,\n '#title' => t('Tab Pricing panel'),\n //'#description' => t('Time in seconds, should be < 30. Feed returns last 30 movements and we might have more than 1 movement per second'),\n '#default_value' => variable_get($pricing_key, ''),\n );\n }\n}", "abstract public function getSettingsFields();", "function get_hr_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T9X5zN1cd48f1',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T9X1zN6cd48f2',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_AImGW71cd48fw',\n\t\t\t'label' => 'Width',\n\t\t\t'name' => 'width',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'half' => '50% of container',\n\t\t\t\t'full' => 'Full'\n\t\t\t),\n\t\t\t'default_value' => 'auto',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_AImGW62cd39fu',\n\t\t\t'label' => 'Style',\n\t\t\t'name' => 'style',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'solid' => 'Solid',\n\t\t\t\t'dashed' => 'Dashed',\n\t\t\t\t'dotted' => 'Dotted',\n\t\t\t),\n\t\t\t'default_value' => 'solid',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t);\n}", "function get_headline_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T121zN1cd48f3',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_N121zN1cd48f3',\n\t\t\t'label' => 'Text',\n\t\t\t'name' => 'text',\n\t\t\t'type' => 'text',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '75',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_N121zN1cd48f1',\n\t\t\t'label' => 'Tag',\n\t\t\t'name' => 'tag',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'p' => 'Paragraf',\n\t\t\t\t'h1' => 'H1',\n\t\t\t\t'h2' => 'H2',\n\t\t\t\t'h3' => 'H3',\n\t\t\t\t'h4' => 'H4',\n\t\t\t\t'h5' => 'H5',\n\t\t\t\t'h6' => 'H6',\n\t\t\t),\n\t\t\t'allow_null' => 0,\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T221zN1cd48f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T2MtzN1cd48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_N121zN1cd48f4',\n\t\t\t'label' => 'Alignment',\n\t\t\t'name' => 'align',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'center' => 'Center',\n\t\t\t\t'right' => 'Right',\n\t\t\t),\n\t\t\t'allow_null' => 0,\n\t\t),\n\t);\n}", "private function process_fieldset($recipe = NULL)\n\t{\n\t\t// check for recipe object\n\t\tif ($recipe == NULL)\n\t\t{\n\t\t\t$recipe = ORM::factory('Recipe');\n\t\t}\n\n\t\t$edit = $recipe->loaded();\n\n\t\t// check if request method is POST\n\t\tif ($this->request->method() == HTTP_Request::POST)\n\t\t{\n\t\t\t// load $_POST object\n\t\t\t$post = $this->request->post();\n\n\t\t\t// load post values to recipe object\n\t\t\t$recipe->values($post, array(\n\t\t\t\t'name',\n\t\t\t\t'description',\n\t\t\t\t'cooktime',\n\t\t\t\t'preptime',\n\t\t\t\t'serving_size',\n\t\t\t\t'serving_type',\n\t\t\t\t'source',\n\t\t\t\t'tags'\n\t\t\t));\n\n\t\t\t// recipe public flag only when admin\n\t\t\t$recipe->public = ($this->user->logged_in('admin') ? 1 : 0);\n\n\t\t\t// check for the photo\n\t\t\tif ( ! empty($_FILES['photo']['tmp_name']))\n\t\t\t{\n\t\t\t\t$recipe->photo = file_get_contents($_FILES['photo']['tmp_name']);\n\t\t\t}\n\n\t\t\t// try recipe for validation\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// save recipe \n\t\t\t\t$recipe->save();\n\n\t\t\t\t// add categories\n\t\t\t\tforeach (ORM::factory('Category')->find_all() as $cat)\n\t\t\t\t{\n\t\t\t\t\t// remove category from recipe\n\t\t\t\t\t$recipe->remove('categories', $cat);\n\n\t\t\t\t\t// check if category is wanted\n\t\t\t\t\tif (isset($post['category']) AND in_array($cat->id, $post['category']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// add category to recipe\n\t\t\t\t\t\t$recipe->add('categories', $cat);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// remove all ingredients before re-insertion\n\t\t\t\tDB::delete('recipe_ingredient')\n\t\t\t\t->where('recipe_id', '=', $recipe->id)\n\t\t\t\t->execute();\n\t\n\t\t\t\t// ingredients re-add\n\t\t\t\tforeach ($post['unit'] as $k => $item)\n\t\t\t\t{\n\t\t\t\t\t// check if ingredient has unit and amount defined\n\t\t\t\t\tif ($post['unit'][$k] > 0 AND ! empty( $post['amount'][$k]) AND $post['ingredient'][$k] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// load unit object\n\t\t\t\t\t\t$unit = ORM::factory('Unit', $item);\n\n\t\t\t\t\t\t// build data to insert\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'recipe_id' => $recipe->id,\n\t\t\t\t\t\t\t'ingredient_id' => $post['ingredient'][$k],\n\t\t\t\t\t\t\t'unit_id' => $post['unit'][$k],\n\t\t\t\t\t\t\t'amount' => str_replace(' '.__($unit->short), NULL, $post['amount'][$k]),\n\t\t\t\t\t\t\t'group' => '',\n\t\t\t\t\t\t\t'note' => $post['note'][$k]\n\t\t\t\t\t\t);\n\t\n\t\t\t\t\t\t// insert ingredient to relation table\n\t\t\t\t\t\tDB::insert('recipe_ingredient', array_keys($data))\n\t\t\t\t\t\t->values($data)\n\t\t\t\t\t\t->execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get recipe nutritions\n\t\t\t\t$nutritions = $recipe->nutritions();\n\t\t\t\t$recipe->calories = $nutritions['calories'] / $nutritions['weight'] * 100;\n\t\t\t\t$recipe->protein = $nutritions['protein'] / $nutritions['weight'] * 100;\n\t\t\t\t$recipe->fat = $nutritions['fat_total'] / $nutritions['weight'] * 100;\n\t\t\t\t$recipe->carbs = $nutritions['carbohydrate'] / $nutritions['weight'] * 100;\n\t\t\t\t$recipe->sugars = $nutritions['sugars'] / $nutritions['weight'] * 100;\n\t\t\t\t$recipe->save();\n\n\t\t\t\t// set view success\n\t\t\t\t$this->view->success = TRUE;\n\n\t\t\t\tif ($edit == TRUE OR $this->user->logged_in('admin'))\n\t\t\t\t{\n\t\t\t\t\tHTTP::redirect('/recipe/detail/'.$recipe->id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (ORM_Validation_Exception $e)\n\t\t\t{\n // set errors using custom messages\n $this->view->errors = $e->errors('is/models');\n }\n\t\t}\n\n\t\t// return the recipe OBject\n\t\treturn $recipe;\n\t}", "public function provideMetaDataFieldsDefinition(AbstractCrudForm $form): array;", "public function addElements()\n {\n $username = new Element(['name' => 'username']);\n $password = new Element(['name' => 'password']);\n $fullName = new Element(['name' => 'fullName']);\n $fieldset = new Fieldset();\n $fieldset->add($username)\n ->add($password)\n ->add($fullName, 10);\n $fieldset->elements->next();\n\n $data = $fieldset->elements->current();\n $this->assertEquals($fullName, $data);\n $this->assertEquals(10, $fieldset->elements->weight());\n $elements = $fieldset->getElements();\n $this->assertFalse($fieldset->has('name'));\n $this->assertTrue($fieldset->has('password'));\n $this->assertTrue($fieldset->remove('password'));\n\n $this->assertEquals(2, count($fieldset->elements));\n $this->assertInstanceOf('Slick\\Form\\Fieldset', $fieldset->setElements($elements));\n $this->assertEquals($elements, $fieldset->getElements());\n\n $group = new Fieldset();\n $group->add(new Element(['name' => 'age']));\n $fieldset->add($group);\n\n $data = [\n 'username' => 'fsilva',\n 'password' => 'test',\n 'fullName' => 'Filipe',\n 'id' => '1',\n 'age' => '20'\n ];\n\n $fieldset->populateValues($data);\n $field = $fieldset->get('username');\n $this->assertInstanceOf('Slick\\Form\\ElementInterface', $field);\n $this->assertEquals('fsilva', $field->getValue());\n\n $expected = \"This is a test\";\n $this->assertInstanceOf(\n 'Slick\\Form\\Fieldset',\n $fieldset->setValue($expected)\n );\n $this->assertEquals($expected, $fieldset->getValue());\n }", "protected function _readFormFields() {}", "function get_product_section_local_field( $id = '1234QWERasdf' ) {\n\treturn array(\n\n\t\t// Headline\n\t\tarray (\n\t\t\t'key' => $id . '_N121zN1cd48f3',\n\t\t\t'name' => 'headline',\n\t\t\t'label' => 'Headline',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_headline_local_field( $id ),\n\t\t),\n\n\t\t// Editor\n\t\tarray (\n\t\t\t'key' => $id . '_N121z7Ocd48f2',\n\t\t\t'name' => 'editor',\n\t\t\t'label' => 'Editor',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_editor_local_field( $id ),\n\t\t),\n\n\t\t// Horizontal line\n\t\tarray (\n\t\t\t'key' => $id . '_N1Viz71cHe8f0',\n\t\t\t'name' => 'line',\n\t\t\t'label' => 'Horizontal Line',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_hr_local_field( $id ),\n\t\t),\n\n\t\t// Testimonial\n\t\tarray (\n\t\t\t'key' => $id . '_Nj2j271cd48f0',\n\t\t\t'name' => 'testimonials',\n\t\t\t'label' => 'Testimonials',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_content_testimonial_local_field( $id ),\n\t\t),\n\n\t\t// Gallery\n\t\tarray (\n\t\t\t'key' => $id . '_Nj43251cd48f0',\n\t\t\t'name' => 'gallery',\n\t\t\t'label' => 'Gallery',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_gallery_local_field( $id ),\n\t\t),\n\n\t\t// Image card\n\t\tarray (\n\t\t\t'key' => $id . '_ICD3251cd48f0',\n\t\t\t'name' => 'image-card',\n\t\t\t'label' => 'Image Card',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_image_card_local_field( $id ),\n\t\t),\n\n\t\t// Video\n\t\tarray (\n\t\t\t'key' => $id . '_N1Viz71cd48f0',\n\t\t\t'name' => 'oembed',\n\t\t\t'label' => 'oEmbed Video',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_oembed_local_field( $id ),\n\t\t),\n\n\t\t// Trip details\n\t\tarray (\n\t\t\t'key' => $id . '_DRViip71cd48f0',\n\t\t\t'name' => 'trip-details',\n\t\t\t'label' => 'Trip Details',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_trip_details_local_field( $id ),\n\t\t),\n\n\t\t// Accordion\n\t\tarray (\n\t\t\t'key' => $id . '_HRhiip71cd48f1',\n\t\t\t'name' => 'accordion',\n\t\t\t'label' => 'Accordion',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_accordion_local_field( $id )\n\t\t),\n\n\t\t// Icons list\n\t\tarray (\n\t\t\t'key' => $id . '_HRhiip71cd48f0',\n\t\t\t'name' => 'icons-list',\n\t\t\t'label' => 'Icons list',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_icons_list_local_field( $id ),\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_A2982bc6o4CF73',\n\t\t\t'label' => 'Form',\n\t\t\t'name' => 'form',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_gform_local_field( $id )\n\t\t)\n\t);\n}", "static function openFieldset($legend = null, $attributes = null)\n {\n self::renderOpenTag('fieldset', $attributes);\n if ($legend)\n {\n echo '<legend>' . $legend.'</legend>'.PHP_EOL;\n }\n echo '<ul>';\n }", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "public function ves_vendorsconfig_form_fieldset_prepare_before(Varien_Event_Observer $observer){\r\n \t$fieldsetId = $observer->getEvent()->getGroupId();\r\n \tif(!Mage::helper('vendorscms')->moduleEnable()){\r\n \t\tif($fieldsetId == 'design_config'){\r\n \t\t\t$group\t= $observer->getEvent()->getGroup();\r\n \t\t\t$fields = $group->getFields();\r\n \t\t\tunset($fields['cms_home_page']);\r\n \t\t\tunset($fields['show_cms_breadcrumbs']);\r\n \t\t\t$group->setData('fields',$fields);\r\n \t\t}\r\n \t\treturn;\r\n \t}\r\n \t\r\n \tif($fieldsetId == 'design_home'){\r\n \t\t$group\t= $observer->getEvent()->getGroup();\r\n \t\t$group->setData('fields',null);\r\n \t}elseif($fieldsetId == 'design_config'){\r\n \t\t$group\t= $observer->getEvent()->getGroup();\r\n \t\t//$fields = $group->getFields();\r\n \t\t//unset($fields['cms_home_page']);\r\n \t\t//unset($fields['show_cms_breadcrumbs']);\r\n \t\t//$group->setData('fields',$fields);\r\n \t}\r\n }", "function awm_fields_usages()\n {\n return array(\n 'awm_type' => array(\n 'case' => 'select',\n 'label' => __('Type of usage', 'extend-wp'),\n 'removeEmpty' => true,\n 'admin_list' => true,\n 'options' => array(\n 'simple_use' => array('label' => __('Simple inputs', 'extend-wp')),\n 'repeater' => array(\n 'label' => __('Repeater', 'extend-wp')\n ),\n ),\n ),\n 'repeater_key' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater Meta key', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'repeater_item' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater item', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'repeater_label' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater Meta label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'label_class' => array('awm-needed'),\n ),\n 'repeater_attributes' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater Attributes', 'extend-wp'),\n 'case' => 'repeater',\n 'item_name' => __('Attribute', 'extend-wp'),\n 'include' => array(\n 'label' => array(\n 'label' => __('Attribute label', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n 'value' => array(\n 'label' => __('Attribute value', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n ),\n )\n ),\n 'repeater_class' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater Class', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'text',\n 'attributes' => array('placeholder' => __('Seperated with (,) comma', 'extend-wp')),\n ),\n 'repeater_order' => array(\n 'show-when' => array('awm_type' => array('values' => array('repeater' => true))),\n 'label' => __('Repeater Order', 'extend-wp'),\n 'case' => 'input',\n 'type' => 'number',\n ),\n 'awm_explanation' => array(\n 'case' => 'textarea',\n 'label' => __('Input box explanation', 'extend-wp'),\n ),\n );\n }", "protected function addFormFieldNamesToViewHelperVariableContainer() {}", "private function getSectionSettingFields(){\n\t\t\t\n\t\t\t$fields = array(\n\n\t\t\t\tField::text(\n\t\t\t\t\t'name',\n\t\t\t\t\t__( 'Template name', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t\tField::text( \n\t\t\t\t\t'classes',\n\t\t\t\t\t__( 'CSS Classes', 'chefsections' ),\n\t\t\t\t\tarray( \n\t\t\t\t\t\t'placeholder' => __( 'Seperate with commas\\'s', 'chefsections' ),\n\t\t\t\t\t)\n\t\t\t\t),\n\n\t\t\t\tField::checkbox(\n\t\t\t\t\t'hide_container',\n\t\t\t\t\t__( 'Hide Container', 'chefsections' )\n\t\t\t\t),\n\n\t\t\t);\n\n\t\t\t$fields = apply_filters( 'chef_sections_setting_fields', $fields, $this );\n\n\t\t\treturn $fields;\n\t\t}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'categoryDescription' => fn(ParseNode $n) => $o->setCategoryDescription($n->getStringValue()),\n 'childCategoryIds' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setChildCategoryIds($val);\n },\n 'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'helpText' => fn(ParseNode $n) => $o->setHelpText($n->getStringValue()),\n 'name' => fn(ParseNode $n) => $o->setName($n->getStringValue()),\n 'parentCategoryId' => fn(ParseNode $n) => $o->setParentCategoryId($n->getStringValue()),\n 'platforms' => fn(ParseNode $n) => $o->setPlatforms($n->getEnumValue(DeviceManagementConfigurationPlatforms::class)),\n 'rootCategoryId' => fn(ParseNode $n) => $o->setRootCategoryId($n->getStringValue()),\n 'settingUsage' => fn(ParseNode $n) => $o->setSettingUsage($n->getEnumValue(DeviceManagementConfigurationSettingUsage::class)),\n 'technologies' => fn(ParseNode $n) => $o->setTechnologies($n->getEnumValue(DeviceManagementConfigurationTechnologies::class)),\n ]);\n }", "public function getDomObject()\n\t\t{\n\t\t\t$fieldset = new \\System\\XML\\DomObject( 'fieldset' );\n\t\t\t$fieldset->setAttribute( 'id', $this->getHTMLControlId() );\n//\t\t\t$fieldset->setAttribute( 'class', ' radiobuttonlist' );\n\n\t\t\tif( !$this->visible )\n\t\t\t{\n\t\t\t\t$fieldset->setAttribute( 'style', 'display:none;' );\n\t\t\t}\n\n\t\t\tfor( $i = 0, $count = $this->items->count; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$input = $this->createDomObject( 'input' );\n\t\t\t\t$input->setAttribute( 'id', $this->getHTMLControlId() . '__' . $i );\n//\t\t\t\t$input->setAttribute( 'class', 'radiobuttonlist_input' );\n\t\t\t\t$input->setAttribute( 'value', $this->items->itemAt( $i ));\n\t\t\t\t$input->setAttribute( 'title', $this->tooltip );\n\n\t\t\t\tif( $this->submitted && !$this->validate() )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'class', 'invalid' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->autoPostBack )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'onclick', 'Rum.id(\\''.$this->getParentByType('\\System\\Web\\WebControls\\Form')->getHTMLControlId().'\\').submit();' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->ajaxPostBack )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'onclick', 'Rum.evalAsync(\\'' . $this->ajaxCallback . '\\',\\''.$this->getHTMLControlId().'=\\'+encodeURIComponent(this.value)+\\'&'.$this->getRequestData().'\\',\\'POST\\','.\\addslashes($this->ajaxStartHandler).','.\\addslashes($this->ajaxCompletionHandler).');' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->readonly )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'readonly', 'readonly' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->disabled )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'disabled', 'disabled' );\n\t\t\t\t}\n\n\t\t\t\tif( $this->multiple )\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'type', 'checkbox' );\n\t\t\t\t\t$input->setAttribute( 'name', $this->getHTMLControlId() .'[]' );\n\n\t\t\t\t\tif( in_array( $this->items->itemAt( $i ), $this->value, false ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$input->setAttribute( 'checked', 'checked' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$input->setAttribute( 'type', 'radio' );\n\t\t\t\t\t$input->setAttribute( 'name', $this->getHTMLControlId() );\n\n\t\t\t\t\tif( $this->value === $this->items->itemAt( $i ))\n\t\t\t\t\t{\n\t\t\t\t\t\t$input->setAttribute( 'checked', 'checked' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$input->setAttribute( 'onclick',\tstr_replace( '%value%', $this->items->itemAt( $i ), $this->onclick ));\n\t\t\t\t$input->setAttribute( 'ondblclick', str_replace( '%value%', $this->items->itemAt( $i ), $this->ondblclick ));\n\n\t\t\t\t$label = new \\System\\XML\\DomObject( 'label' );\n\t\t\t\t$label->addChild( $input );\n\t\t\t\t$label->addChild( new \\System\\XML\\TextNode( $this->items->keyAt( $i )) );\n\t\t\t\t$fieldset->addChild( $label );\n\t\t\t}\n\n\t\t\treturn $fieldset;\n\t\t}", "protected function generate_available_field_list(array $fieldsets, array $fields_by_fieldset, array $active_fields_by_fieldset) {\n $html = '';\n $rename_default = get_string('rename', 'rlipexport_version1elis');\n foreach ($fields_by_fieldset as $fieldset => $fields) {\n $fieldset_label = (isset($fieldsets[$fieldset])) ? $fieldsets[$fieldset] : $fieldset;\n foreach ($fields as $field => $header) {\n $field_attrs = array(\n 'data-fieldset' => $fieldset,\n 'data-fieldsetlabel' => $fieldset_label,\n 'data-field' => $field,\n 'data-renamedefault' => $rename_default,\n 'class' => 'fieldset_'.$fieldset.' field_'.$field\n );\n if (isset($active_fields_by_fieldset[$fieldset.'/'.$field])) {\n $field_attrs['class'] .= ' active';\n }\n\n $html .= html_writer::tag('li', $header, $field_attrs);\n }\n }\n return $html;\n }", "function get_flexi_local_field( $id = '1234QWERasdf' ) {\n\treturn array(\n\t\tarray (\n\t\t\t'key' => $id . '_FC12qiX8p1A9',\n\t\t\t'label' => 'Components',\n\t\t\t'name' => 'components',\n\t\t\t'type' => 'flexible_content',\n\t\t\t'required' => '',\n\t\t\t'button_label' => 'Add component',\n\t\t\t'layouts' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_FC12qiX7p2A8',\n\t\t\t\t\t'name' => 'image',\n\t\t\t\t\t'label' => 'Image',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'max' => 1,\n\t\t\t\t\t'sub_fields' => array (\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX4p5b7',\n\t\t\t\t\t\t\t'label' => 'Content',\n\t\t\t\t\t\t\t'name' => 'tab1',\n\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX5p4b6',\n\t\t\t\t\t\t\t'label' => 'Image',\n\t\t\t\t\t\t\t'name' => 'image',\n\t\t\t\t\t\t\t'type' => 'image',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'return_format' => 'object',\n\t\t\t\t\t\t\t'preview_size' => 'full'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX2p1C1',\n\t\t\t\t\t\t\t'label' => 'Layouts',\n\t\t\t\t\t\t\t'name' => 'layout',\n\t\t\t\t\t\t\t'type' => 'flexible_content',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'button_label' => 'Add layout',\n\t\t\t\t\t\t\t'layouts' => array (\n\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX2p0C2',\n\t\t\t\t\t\t\t\t\t'name' => 'over-image',\n\t\t\t\t\t\t\t\t\t'label' => 'Over image',\n\t\t\t\t\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t\t\t\t'sub_fields' => array (\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX6i3B7',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'tab1',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Content',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX2p3c5',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Title',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'title',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 30\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX1p8c9',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Description',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 40\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q3X9p6c8',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Price',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'price',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q4X8p5c7',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Label',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'label',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX7i3B7',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'tab2',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Settings',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX6i4B6',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'type',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Type',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => '33'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'choices' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'Default',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 1',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 2',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 3'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'default_values' => array( 0 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX3p1C3',\n\t\t\t\t\t\t\t\t\t'name' => 'mouseover',\n\t\t\t\t\t\t\t\t\t'label' => 'Mouseover',\n\t\t\t\t\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t\t\t\t\t'max' => 1,\n\t\t\t\t\t\t\t\t\t'sub_fields' => array (\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX7P3c7',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'tab1',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Content',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q5X1p3c5',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Title',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'title',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 30\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q6X7p8c9',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Description',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 40\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q7X9p6c8',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Price',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'price',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12q8X8p5c7',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Label',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'label',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX7i3c7',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'tab2',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Settings',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t\t\t\t\t'key' => $id . '_FC12qiX6i4c6',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'type',\n\t\t\t\t\t\t\t\t\t\t\t'label' => 'Type',\n\t\t\t\t\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'width' => '33'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'choices' => array (\n\t\t\t\t\t\t\t\t\t\t\t\t'Default',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 1',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 2',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type 3'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'default_values' => array( 0 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX3p6b4',\n\t\t\t\t\t\t\t'label' => 'Settings',\n\t\t\t\t\t\t\t'name' => 'tab2',\n\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX4p7b3',\n\t\t\t\t\t\t\t'label' => 'Height',\n\t\t\t\t\t\t\t'name' => 'height',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => 33\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'choices' => array (\n\t\t\t\t\t\t\t\t'auto' => 'Auto',\n\t\t\t\t\t\t\t\t'scuare' => 'Square',\n\t\t\t\t\t\t\t\t'200' => '200 pixels',\n\t\t\t\t\t\t\t\t'300' => '300 pixels',\n\t\t\t\t\t\t\t\t'400' => '400 pixels',\n\t\t\t\t\t\t\t\t'500' => '500 pixels',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default_value' => 'auto'\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_FC12qiX6p3A7',\n\t\t\t\t\t'name' => 'content',\n\t\t\t\t\t'label' => 'Content',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'max' => 2,\n\t\t\t\t\t'sub_fields' => array (\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX7k3N7',\n\t\t\t\t\t\t\t'name' => 'tab1',\n\t\t\t\t\t\t\t'label' => 'Settings',\n\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12q9X1p3c5',\n\t\t\t\t\t\t\t'label' => 'Title',\n\t\t\t\t\t\t\t'name' => 'title',\n\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => 30\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12q917p8c9',\n\t\t\t\t\t\t\t'label' => 'Description',\n\t\t\t\t\t\t\t'name' => 'description',\n\t\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'rows' => '1',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => 40\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12q329p6c8',\n\t\t\t\t\t\t\t'label' => 'Price',\n\t\t\t\t\t\t\t'name' => 'price',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12q328p5c7',\n\t\t\t\t\t\t\t'label' => 'Label',\n\t\t\t\t\t\t\t'name' => 'label',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => 15\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX7i3N7',\n\t\t\t\t\t\t\t'name' => 'tab2',\n\t\t\t\t\t\t\t'label' => 'Settings',\n\t\t\t\t\t\t\t'type' => 'tab',\n\t\t\t\t\t\t\t'required' => ''\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'key' => $id . '_FC12qiX6i4N6',\n\t\t\t\t\t\t\t'name' => 'type',\n\t\t\t\t\t\t\t'label' => 'Type',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'required' => '',\n\t\t\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t\t\t'width' => '33'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'choices' => array (\n\t\t\t\t\t\t\t\t'Default',\n\t\t\t\t\t\t\t\t'Type 1',\n\t\t\t\t\t\t\t\t'Type 2',\n\t\t\t\t\t\t\t\t'Type 3'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default_values' => array( 0 )\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t);\n}", "public function set(){\n\t\t\t//Get incoming data\t\t\n\t\t\t$data = $this->data;\n\t\t\t\n\t\t\t//what action are we taking?\n\t\t\t$action = $this->action;\n\t\t\t\n\t\t\t//What data set are we taking action on. \n\t\t\t$action_set = $action. '_set';\n\t\t\t\n\t\t\t//load keys from that data set. \n\t\t\t$keys = $this->$action_set;\n\t\t\t//dump( __LINE__, __METHOD__, $data ); \n\t\t\t\n\t\t\t//Now we start to build. \n\t\t\tforeach( $keys as $key ){\n\t\t\t\tif( !empty( $data[ $key ] ) ){\n\t\t\t\t\t$this->data_set[ $key ] = $data[ $key ];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( !empty( $data[ 'data' ] ) && is_array( $data[ 'data' ] ) ){\n\t\t\t\t\t//looking deeper into the source arrays for data that matches the requesting field.\n\t\t\n\t\t\t\t\t//first check if field is available in top level of nested array. \n\t\t\t\t\tif( !empty( $data[ 'data' ][ $key ] ) ){\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $key ];\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//else look deeper by referencing the first word of the key to find it's associated array. \n\t\t\t\t\t$pos = strpos( $key, '_' );\n\t\t\t\t\t$sub_arr = substr( $key, 0, $pos );\n\t\t\t\t\t\n\t\t\t\t\tif( !isset( $data[ 'data' ][ $sub_arr ] ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t \n\t\t\t\t\tif( is_array( $data[ 'data' ][ $sub_arr ] ) ){\n\t\t\t\t\t\t$sub_key = substr( $key, $pos + 1 );\t\t\t\t\t\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $sub_arr ][ $sub_key ] ?? '';\n\t\t\t\t\t\tcontinue;\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/* if( strcmp( $key, 'src_data' ) === 0 ){\n\t\t\t\t\t$this->data_set[ 'src_data' ] = $data;\n\t\t\t\t\tcontinue;\n\t\t\t\t} */\n\t\t\t\t\n\t\t\t\t$this->data_set[ $key ] = '';\n\t\t\t}\t\n\t\t\t\n\t\t\t\n\t\t\t//The final data set is specific to the initiating action being performed \n\t\t\t//$this->data_set = $this->$action();\n\t\t\t\n\t\t\treturn true;\n\t\t}", "abstract protected function _getFeedFields();", "protected function getLinkAttributeFieldDefinitions() {}", "protected function getLinkAttributeFieldDefinitions() {}", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'definitions' => fn(ParseNode $n) => $o->setDefinitions($n->getCollectionOfObjectValues([GroupPolicyDefinition::class, 'createFromDiscriminatorValue'])),\n 'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'fileName' => fn(ParseNode $n) => $o->setFileName($n->getStringValue()),\n 'languageCodes' => function (ParseNode $n) {\n $val = $n->getCollectionOfPrimitiveValues();\n if (is_array($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n }\n /** @var array<string>|null $val */\n $this->setLanguageCodes($val);\n },\n 'lastModifiedDateTime' => fn(ParseNode $n) => $o->setLastModifiedDateTime($n->getDateTimeValue()),\n 'policyType' => fn(ParseNode $n) => $o->setPolicyType($n->getEnumValue(GroupPolicyType::class)),\n 'revision' => fn(ParseNode $n) => $o->setRevision($n->getStringValue()),\n 'targetNamespace' => fn(ParseNode $n) => $o->setTargetNamespace($n->getStringValue()),\n 'targetPrefix' => fn(ParseNode $n) => $o->setTargetPrefix($n->getStringValue()),\n ]);\n }", "public function initSubFields() {\n $post = $this->getData('post');\n switch ($post['custom_type']) {\n case 'shop_customer':\n case 'import_users':\n $optionName = 'wpcf-usermeta';\n break;\n case 'taxonomies':\n $optionName = 'wpcf-termmeta';\n break;\n default:\n $optionName = 'wpcf-field';\n break;\n }\n\n $this->fieldsData = wpcf_admin_fields_get_fields_by_group(\n $this->groupPost->ID,\n 'slug',\n false,\n false,\n false,\n TYPES_CUSTOM_FIELD_GROUP_CPT_NAME,\n $optionName,\n true\n );\n\n foreach ($this->getFieldsData() as $fieldData) {\n $field = FieldFactory::create($fieldData, $post, $this->getFieldName(), $this);\n $this->subFields[] = $field;\n }\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'createdDateTime' => fn(ParseNode $n) => $o->setCreatedDateTime($n->getDateTimeValue()),\n 'description' => fn(ParseNode $n) => $o->setDescription($n->getStringValue()),\n 'displayName' => fn(ParseNode $n) => $o->setDisplayName($n->getStringValue()),\n 'parentSiteId' => fn(ParseNode $n) => $o->setParentSiteId($n->getStringValue()),\n 'scope' => fn(ParseNode $n) => $o->setScope($n->getEnumValue(TermGroupScope::class)),\n 'sets' => fn(ParseNode $n) => $o->setSets($n->getCollectionOfObjectValues([Set::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public static function fieldset_close() {\n\t\t\treturn '</fieldset>';\n\t\t}" ]
[ "0.57472545", "0.5323171", "0.5310453", "0.52477765", "0.517298", "0.517025", "0.51319945", "0.51095396", "0.5089681", "0.49296865", "0.49261364", "0.48760328", "0.48755682", "0.48265404", "0.48222604", "0.4759858", "0.46920496", "0.46641815", "0.46522045", "0.46432373", "0.46258044", "0.4618582", "0.45767355", "0.4514371", "0.45097783", "0.45021835", "0.4497398", "0.4467268", "0.44538504", "0.44497058", "0.44439322", "0.4436841", "0.44318357", "0.4425119", "0.44113976", "0.44036162", "0.4403343", "0.43947205", "0.43876988", "0.4384472", "0.43840688", "0.4383698", "0.43760124", "0.43715554", "0.43620408", "0.43608612", "0.43576849", "0.43551898", "0.4350653", "0.43434706", "0.43400115", "0.4335746", "0.4329803", "0.43260425", "0.43213955", "0.4318473", "0.43167195", "0.4314798", "0.4311521", "0.4299578", "0.42992544", "0.42835107", "0.4281064", "0.42776385", "0.4276897", "0.42748776", "0.42682377", "0.42536855", "0.42471623", "0.42420924", "0.42397118", "0.42376152", "0.42351103", "0.4232124", "0.42289662", "0.42244205", "0.42211682", "0.42188558", "0.42181605", "0.4217", "0.42159367", "0.42085582", "0.42020896", "0.42007384", "0.41935483", "0.41904178", "0.41821575", "0.41736633", "0.41673607", "0.4165708", "0.4165597", "0.41571853", "0.41551134", "0.41454154", "0.41392356", "0.41386765", "0.41386765", "0.41377094", "0.41371763", "0.4134905", "0.4130585" ]
0.0
-1
Resolve included segments that are a direct child to the given resource key.
protected function resolveChildIncludes($key, string $include): array { if (count($segments = explode('.', $include)) <= 1) { return []; } $relation = $key === array_shift($segments) ? [$segments[0]] : []; return array_merge($relation, $this->resolveChildIncludes($key, implode('.', $segments))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSegment($key);", "public function resolve($key);", "public function getByParent($key);", "public function Resolve($key);", "protected function parseNamespacedSegments($key)\n {\n list($namespace, $item) = explode('::', $key);\n\n // If the namespace is registered as a package, we will just assume the group\n // is equal to the namespace since all packages cascade in this way having\n // a single file per package, otherwise we'll just parse them as normal.\n if (in_array($namespace, $this->packages)) {\n return $this->parsePackageSegments($key, $namespace, $item);\n }\n\n // Next we'll just explode the first segment to get the namespace and group\n // since the item should be in the remaining segments. Once we have these\n // two pieces of data we can proceed with parsing out the item's value.\n $itemSegments = explode('.', $item);\n\n $groupAndItem = array_slice($this->parseBasicSegments($itemSegments), 1);\n\n return array_merge([$namespace], $groupAndItem);\n }", "public function __get($childKey);", "protected function parseNamespacedSegments($key)\n {\n [$namespace, $item] = explode('::', $key);\n\n // First we'll just explode the first segment to get the namespace and group\n // since the item should be in the remaining segments. Once we have these\n // two pieces of data we can proceed with parsing out the item's value.\n $itemSegments = explode('.', $item);\n\n $groupAndItem = array_slice(\n $this->parseBasicSegments($itemSegments), 1\n );\n\n return array_merge([$namespace], $groupAndItem);\n }", "public function getSegment($key)\n {\n return $this->_baseRequester->getSegment($key);\n }", "public static function resourceForKey($key)\n {\n return collect(static::$resources)->first(function ($value) use ($key) {\n return $value::uriKey() === $key;\n });\n }", "public function find_parent($key, Database_Query_Builder_Select $query = NULL)\n\t{\n\t\t$parent = AutoModeler::factory(inflector::singular($key));\n\t\t$columns = $parent->fields();\n\n\t\tif ( ! $query)\n\t\t{\n\t\t\t$query = db::select_array($parent->fields());\n\t\t}\n\n\t\tif ($this->field_exists($key.'_id')) // Look for a one to many relationship\n\t\t{\n\t\t\treturn $parent->load($query->where('id', '=', $this->_data[$key.'_id']), NULL);\n\t\t}\n\t\telseif(in_array($key, $this->_belongs_to)) // Get a many to many relationship.\n\t\t{\n\t\t\t$related_table = $parent->get_table_name();\n\t\t\t$join_table = $related_table.'_'.$this->_table_name;\n\t\t\t$f_key = inflector::singular($this->_table_name).'_id';\n\t\t\t$this_key = inflector::singular($related_table).'_id';\n\n\t\t\t$columns = AutoModeler::factory(inflector::singular($key))->fields();\n\n\t\t\t$query = $query->join($join_table)->on($join_table.'.'.$this_key, '=', $related_table.'.id')->from($related_table)->where($join_table.'.'.$f_key, '=', $this->_data['id']);\n\t\t\treturn $parent->load($query, NULL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new AutoModeler_Exception('Relationship \"'.$key.'\" doesn\\'t exist in '.get_class($this));\n\t\t}\n\t}", "public function GetParentChildAddress($token,$childIdentifier);", "static function resolve( $key, $conf ) {\n\t\tif ( isset( self::$resolvers[ $key ] ) ) {\n\t\t\tcall_user_func_array( self::$resolvers[ $key ], array( $conf ) );\n\t\t}\n\t}", "function CrowdfundingParseRoute($segments)\n{\n $total = count($segments);\n $vars = array();\n\n for ($i = 0; $i < $total; $i++) {\n $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1);\n }\n\n //Get the active menu item.\n $app = JFactory::getApplication();\n $menu = $app->getMenu();\n $item = $menu->getActive();\n\n // Count route segments\n $count = count($segments);\n\n // Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments\n // the first segment is the view and the last segment is the id of the details, category or payment.\n if (!isset($item)) {\n $vars['view'] = $segments[0];\n $vars['id'] = $segments[$count - 1];\n\n return $vars;\n }\n\n // COUNT == 1\n\n // Category\n if ($count == 1) {\n\n // We check to see if an alias is given. If not, we assume it is a project,\n // because categories have always alias.\n // If it is a menu item \"Details\" that could be one of its specific views - backing, embed,...\n if (false == strpos($segments[0], ':')) {\n\n switch ($segments[0]) {\n\n case \"backing\":\n case \"embed\":\n\n $id = $item->query[\"id\"];\n $project = CrowdfundingHelperRoute::getProject($id);\n\n $vars['view'] = $segments[0];\n $vars['catid'] = (int)$project[\"catid\"];\n $vars['id'] = (int)$project[\"id\"];\n\n break;\n\n default:\n $vars['view'] = 'details';\n $vars['id'] = (int)$segments[0];\n break;\n }\n\n return $vars;\n }\n\n list($id, $alias) = explode(':', $segments[0], 2);\n $alias = str_replace(\":\", \"-\", $alias);\n\n // first we check if it is a category\n $category = JCategories::getInstance('Crowdfunding')->get($id);\n\n if ($category and (strcmp($category->alias, $alias) == 0)) {\n $vars['view'] = 'category';\n $vars['id'] = $id;\n\n return $vars;\n } else {\n $project = CrowdfundingHelperRoute::getProject($id);\n if (!empty($project)) {\n if ($project[\"alias\"] == $alias) {\n\n $vars['view'] = 'details';\n $vars['catid'] = (int)$project[\"catid\"];\n $vars['id'] = (int)$id;\n\n return $vars;\n }\n }\n }\n\n }\n\n // COUNT >= 2\n\n if ($count >= 2) {\n\n $view = $segments[$count - 1];\n\n switch ($view) {\n\n case \"backing\":\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'backing';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n break;\n\n case \"embed\": // Backing without reward\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'embed';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n break;\n\n case \"updates\": // Screens of details - \"updates\", \"comments\", \"funders\"\n case \"comments\":\n case \"funders\":\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'details';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n // Get screen\n $screen = $segments[$count - 1];\n $allowedScreens = array(\"updates\", \"comments\", \"funders\");\n if (in_array($screen, $allowedScreens)) {\n $vars['screen'] = $screen;\n }\n\n break;\n\n default:\n\n // if there was more than one segment, then we can determine where the URL points to\n // because the first segment will have the target category id prepended to it. If the\n // last segment has a number prepended, it is details, otherwise, it is a category.\n $catId = (int)$segments[$count - 2];\n $id = (int)$segments[$count - 1];\n\n if ($id > 0 and $catId > 0) {\n $vars['view'] = 'details';\n $vars['catid'] = $catId;\n $vars['id'] = $id;\n } else {\n $vars['view'] = 'category';\n $vars['id'] = $id;\n }\n\n break;\n\n }\n\n }\n\n return $vars;\n}", "protected static function lookup($segments) {\n $items = &static::$items;\n\n foreach($segments as $step) {\n if (is_array($items) && array_key_exists($step, $items)) {\n $items = &$items[$step]; \n } else {\n return null;\n }\n }\n\n return $items;\n }", "public function relationLoaded( $key );", "protected static function resolveCollectionReference($data, &$context = null)\n {\n $found = array();\n\n if ($context)\n {\n if (isset($context['included']) && isset($context['included'][$data['type']]))\n {\n foreach ($data['ids'] as $id)\n {\n // Attempt to find a 'sideloaded' object\n if (isset($context['included'][$data['type']][$id])) {\n $found[$id] = $context['included'][$data['type']][$id];\n continue;\n }\n\n // If the type is equal to the base type of the context, try and find it from the main 'data' array\n if (isset($context['meta']) && $data['type'] == @$context['meta']['type'])\n {\n foreach ($context['data'] as $rootEntity)\n {\n if (@$rootEntity['id'] == $id) {\n $found[$id] = $rootEntity;\n break;\n }\n }\n }\n }\n }\n }\n\n // As a last resort, we will try and load any missing entities from the 'href' location\n if (count($found) < count($data['ids']) && !empty($data['href']))\n {\n try {\n $hrefData = static::getDataFromUrl($data['href']);\n $loaded = null;\n if(is_array($hrefData) && isset($hrefData['body']))\n $loaded = $hrefData['body'];\n if (isset($loaded['data'])) {\n foreach ($loaded['data'] as $value)\n {\n $id = @$value['id'];\n if ($id && !isset($found[$id])) $found[$id] = $value;\n }\n }\n if (is_array(@$loaded['included'])) {\n $context['included'] = \\Arr::merge(\\Arr::get($context, 'included', array()), $loaded['included']);\n }\n } catch (\\Exception $e) {}\n }\n\n // Build the output array\n $output = array();\n foreach ($data['ids'] as $id)\n {\n if (isset($found[$id])) $output[] = $found[$id];\n }\n\n return $output;\n }", "function seattlemennonite_get_section($map, $child) {\n // upward until the top-level ancestor is found. Then\n // return an array containing its title and URL.\n \n $parent = $child->menu_item_parent;\n if ( $parent == 0 ) {\n return array(\n 'title' => $child->title,\n 'url' => $child->url,\n );\n } elseif ( in_array( $parent, array_keys( $map ) ) ) {\n return seattlemennonite_get_section( $map, $map[$parent] );\n }\n}", "protected function loadPartial(string $key)\n {\n $this->pairs = $this\n ->loader\n ->load($this->pairs, $key);\n }", "public static function Segment($key = null, $default = false)\n\t{\n\t\tstatic $result = null;\n\n\t\tif (is_null($result) === true)\n\t\t{\n\t\t\tif (count($result = explode('/', substr(self::Value($_SERVER, 'PHP_SELF'), strlen(self::Value($_SERVER, 'SCRIPT_NAME'))))) > 0)\n\t\t\t{\n\t\t\t\t$result = array_values(array_filter($result, 'strlen'));\n\t\t\t}\n\t\t}\n\n\t\treturn (isset($key) === true) ? self::Value($result, (is_int($key) === true) ? $key : (array_search($key, $result) + 1), $default) : $result;\n\t}", "public function resolveParams(&$segments)\n {\n \n $this->params = $segments; \n \n }", "public function resolve($resource);", "public function fetch($key) {\n\t\treturn include ($this->_getPath($key));\n\t}", "public function substituteMarkerAndSubpartArrayRecursiveResolvesMarkersAndSubpartsArrayDataProvider() {}", "protected function parentRoutesFor(ResourceConfiguration $config)\n {\n if ($config->getParent()) {\n $parentConfig = $this->configuration->resourceConfigurationFor($config->getParent());\n\n return $this->parentRoutesFor($parentConfig) . \"/{$config->getParent()}/:{$config->getParent()}_id\";\n }\n }", "function opensky_get_searchable_subcollections ($pid) {\n $descendants = opensky_get_subcollections_recursive($pid);\n $tree = array();\n foreach($descendants as $child) {\n if (!opensky_has_subcollections($child)) {\n $tree[] = $child;\n }\n }\n return $tree;\n}", "public function processIncludes() {}", "public function pull(string $key): array\n {\n if (array_key_exists($key, $this->resources)) {\n $chain = $this->resolve($key);\n $result = [];\n foreach ($chain as $c) {\n $result[$c] = $this->resources[$c];\n unset($this->resources[$c]);\n unset($this->dependencies[$c]);\n $this->released[] = $c;\n }\n return $result;\n }\n if (in_array($key, $this->released, true)) {\n return [];\n }\n throw new OutOfBoundsException(\"Undefined resource found: $key\");\n }", "private function loadMatchedCollection()\n {\n $this->matchedCollection = collect();\n\n foreach ($this->baseCollection as $key => $item)\n {\n\n $found = true;\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n if(!$this->mergeCollection->whereIn($mergePivot,$item->$basePivot)->first())\n {\n $found = false;\n continue 2;\n }\n }\n\n if($found){\n $this->matchedCollection->push($item);\n }\n\n }\n }", "function get_segments($ignore_custom_routes=NULL) {\n $psuedo_url = str_replace('://', '', BASE_URL);\n $psuedo_url = rtrim($psuedo_url, '/');\n $bits = explode('/', $psuedo_url);\n $num_bits = count($bits);\n\n if ($num_bits>1) {\n $num_segments_to_ditch = $num_bits-1;\n } else {\n $num_segments_to_ditch = 0;\n }\n\n $assumed_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n if (!isset($ignore_custom_routes)) {\n $assumed_url = attempt_add_custom_routes($assumed_url);\n }\n\n $data['assumed_url'] = $assumed_url;\n\n $assumed_url = str_replace('://', '', $assumed_url);\n $assumed_url = rtrim($assumed_url, '/');\n\n $segments = explode('/', $assumed_url);\n\n for ($i=0; $i < $num_segments_to_ditch; $i++) { \n unset($segments[$i]);\n }\n\n $data['segments'] = array_values($segments); \n return $data;\n}", "protected function getRelationshipFromMethod($key, $camelKey)\n {\n $results = parent::getRelationshipFromMethod($key, $camelKey);\n\n $relations = $this->$camelKey();\n if ( ( !$this->exists || !$results ) && ( $relations instanceof BelongsTo || $relations instanceof HasOne) ) {\n $results = $relations->getRelated()->newInstance();\n }\n\n return $this->relations[$key] = $results;\n\n }", "private static function find($subdir, $script, $included = false)\n {\n $pieces = explode(\"/\", $script);\n\n while (array_pop($pieces)) {\n $parent = implode(\"/\", $pieces);\n $target = sprintf(\"%s/%s\", $parent, $subdir);\n\n if (file_exists($target)) {\n return $included ? $target : $parent;\n }\n }\n }", "public function checkRootlineForIncludeSection() {}", "protected function resolveChildren()\n {\n foreach ($this->unresolvedChildren as $name => $info) {\n $this->children[$name] = $this->create($name, $info['type'], $info['init_options'], $info['exec_options']);\n }\n\n $this->unresolvedChildren = array();\n }", "function rest_get_queried_resource_route()\n {\n }", "public function &onResourcesSubAreas($resource)\n\t{\n\t\t$areas = array(\n\t\t\t'related' => Lang::txt('PLG_RESOURCES_RELATED')\n\t\t);\n\t\treturn $areas;\n\t}", "function detectParentIncludes( $id )\n\t{\n\t\tif ( $id == 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/* get parent */\n\t\t$parent = $this -> fetch(array('Parent_ID', 'Add_sub', 'Add'), array('ID' => $id), null, 1, 'categories', 'row');\n\t\t\n\t\tif (!empty($parent))\n\t\t{\n\t\t\t/* check relations */\n\t\t\tif ( $parent['Add_sub'] == '1' )\n\t\t\t{\n\t\t\t\treturn $parent['Add'];\n\t\t\t}\n\t\t\treturn $this -> detectParentIncludes($parent['Parent_ID']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function opensky_get_subcollections_recursive($parent_pid){\n\n $key = 'subcollections_recursive_'.$parent_pid;\n\n if ($cache = cache_get($key)) {\n $subs = $cache->data;\n } else {\n $subs = array($parent_pid);\n $children = opensky_get_pid_subcollections_pids($parent_pid);\n if (count($children)) {\n foreach ($children as $child) {\n $subs = array_merge($subs, opensky_get_subcollections_recursive($child));\n }\n }\n cache_set($key, $subs);\n }\n\n return $subs;\n \n}", "protected function resolveKey($key, $array)\n {\n if(array_key_exists($key, $array))\n {\n return $array[$key];\n }\n\n foreach($array as $value)\n {\n if(is_array($value))\n {\n return $this->resolveKey($key, $value);\n }\n }\n\n return null;\n }", "protected function hasSuccessFromAncestor($key)\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->hasSuccess($key);\n }\n\n return null;\n }", "public function resolveResourceSet($name);", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "public function findCollectionByKey($key);", "protected static function addParentSortingToResolvedChildRelationItems(\n array &$resolvedChildItemsList,\n array $resolvedParentItemsList\n ): void {\n foreach ($resolvedParentItemsList as $pIndex => $pResolvedItem) {\n foreach ($resolvedChildItemsList as $cIndex => $cResolvedItem) {\n if ($cResolvedItem['identifier'] === $pResolvedItem['identifier']) {\n $resolvedChildItemsList[$cIndex]['parent_sorting'] = $pIndex;\n }\n }\n }\n }", "static function linked_posts($post_type, $key, $parent_id) {\n\t\treturn get_posts(array(\n\t\t'post_type' => $post_type,\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => $key,\n\t\t\t\t'value' => '\"' . $parent_id . '\"',\n\t\t\t\t'compare' => 'LIKE'\n\t\t\t)\n\t\t)\n\t\t));\n\t}", "protected function setKnownChildElement($xml) {\r\n $happened = false;\r\n if (($xml->localName == 'survivorResource') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\r\n $child = new ResourceReference($xml);\r\n if (!isset($this->survivorResources)) {\r\n $this->survivorResources = array();\r\n }\r\n array_push($this->survivorResources, $child);\r\n $happened = true;\r\n }\r\n else if (($xml->localName == 'duplicateResource') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\r\n $child = new ResourceReference($xml);\r\n if (!isset($this->duplicateResources)) {\r\n $this->duplicateResources = array();\r\n }\r\n array_push($this->duplicateResources, $child);\r\n $happened = true;\r\n }\r\n else if (($xml->localName == 'conflictingResource') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\r\n $child = new MergeConflict($xml);\r\n if (!isset($this->conflictingResources)) {\r\n $this->conflictingResources = array();\r\n }\r\n array_push($this->conflictingResources, $child);\r\n $happened = true;\r\n }\r\n else if (($xml->localName == 'survivor') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\r\n $child = new ResourceReference($xml);\r\n $this->survivor = $child;\r\n $happened = true;\r\n }\r\n else if (($xml->localName == 'duplicate') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\r\n $child = new ResourceReference($xml);\r\n $this->duplicate = $child;\r\n $happened = true;\r\n }\r\n return $happened;\r\n }", "public function find(string $key)\n {\n if (!preg_match('/^[\\w\\-]+(\\.[\\w\\-]+)+$/i', $key)) {\n return $this->get($key);\n }\n\n $tokens = explode(\".\", $key);\n $arr = $this->get($tokens[0]);\n array_shift($tokens);\n\n if (!is_array($arr)) {\n return null;\n }\n\n $deep = array_map(function ($prop) {\n return sprintf('[\"%s\"]', $prop);\n }, $tokens);\n\n $eval = \"return \\$arr\" . implode($deep) . \" ?? null;\";\n return eval($eval);\n }", "function CrowdfundingBuildRoute(&$query)\n{\n $segments = array();\n\n // get a menu item based on Itemid or currently active\n $app = JFactory::getApplication();\n $menu = $app->getMenu();\n\n // we need a menu item. Either the one specified in the query, or the current active one if none specified\n if (empty($query['Itemid'])) {\n $menuItem = $menu->getActive();\n $menuItemGiven = false;\n } else {\n $menuItem = $menu->getItem($query['Itemid']);\n $menuItemGiven = (isset($menuItem->query)) ? true : false ;\n }\n\n // Check again\n if ($menuItemGiven and isset($menuItem) and strcmp(\"com_crowdfunding\", $menuItem->component) != 0) {\n $menuItemGiven = false;\n unset($query['Itemid']);\n }\n\n $mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view'];\n $mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id'];\n// $mOption = (empty($menuItem->query['option'])) ? null : $menuItem->query['option'];\n// $mCatid = (empty($menuItem->query['catid'])) ? null : $menuItem->query['catid'];\n\n // If is set view and Itemid missing, we have to put the view to the segments\n if (isset($query['view'])) {\n $view = $query['view'];\n } else {\n return $segments;\n }\n\n // Are we dealing with a category that is attached to a menu item?\n if (($menuItem instanceof stdClass) and isset($view) and ($mView == $view) and (isset($query['id'])) and ($mId == (int)$query['id'])) {\n\n unset($query['view']);\n\n if (isset($query['catid'])) {\n unset($query['catid']);\n }\n\n if (isset($query['layout'])) {\n unset($query['layout']);\n }\n\n unset($query['id']);\n\n return $segments;\n }\n \n // Views\n if (isset($view)) {\n\n switch ($view) {\n\n case \"category\":\n\n if (!$menuItemGiven) {\n $segments[] = $view;\n }\n unset($query['view']);\n\n if (isset($query['id'])) {\n $categoryId = $query['id'];\n } else {\n // We should have id set for this view. If we don't, it is an error.\n return $segments;\n }\n\n $segments = CrowdfundingHelperRoute::prepareCategoriesSegments($categoryId, $segments, $menuItem, $menuItemGiven);\n\n unset($query['id']);\n\n break;\n\n case \"backing\":\n case \"embed\":\n case \"details\":\n\n if (!$menuItemGiven) {\n $segments[] = $view;\n }\n unset($query['view']);\n\n // If a project is assigned to a menu item.\n if ($menuItemGiven and (strcmp(\"details\", $menuItem->query[\"view\"]) == 0) and ($menuItem->query[\"id\"] == (int)$query['id'])) {\n\n } else {\n\n // If a project is NOT assigned to a menu item.\n if (isset($query['id']) and isset($query['catid']) and !empty($query['catid'])) {\n $categoryId = (int)$query['catid'];\n\n if (false === strpos($query['id'], \":\")) {\n $alias = CrowdfundingHelperRoute::getProjectAlias($query['id']);\n $query['id'] = $query['id'] . \":\" . $alias;\n }\n } else {\n // We should have these two set for this view. If we don't, it is an error.\n return $segments;\n }\n\n $segments = CrowdfundingHelperRoute::prepareCategoriesSegments($categoryId, $segments, $menuItem, $menuItemGiven);\n\n $segments[] = $query['id'];\n }\n\n unset($query['id']);\n unset($query['catid']);\n\n if (strcmp(\"backing\", $view) == 0) {\n $segments[] = \"backing\";\n }\n\n if (strcmp(\"embed\", $view) == 0) {\n $segments[] = \"embed\";\n }\n\n break;\n\n case \"report\":\n if ($menuItemGiven and (strcmp(\"report\", $menuItem->query[\"view\"]) == 0) and isset($query['view'])) {\n unset($query['view']);\n }\n break;\n\n case \"categories\":\n case \"discover\":\n case \"transactions\":\n case \"projects\":\n case \"project\": // Form for adding projects\n\n if (isset($query['view'])) {\n unset($query['view']);\n }\n break;\n\n }\n\n }\n\n // Layout\n if (isset($query['layout'])) {\n if ($menuItemGiven and isset($menuItem->query['layout'])) {\n if ($query['layout'] == $menuItem->query['layout']) {\n unset($query['layout']);\n }\n } else {\n if ($query['layout'] == 'default') {\n unset($query['layout']);\n }\n }\n }\n\n // Screen\n if (isset($query[\"screen\"])) {\n $segments[] = $query[\"screen\"];\n unset($query['screen']);\n }\n\n $total = count($segments);\n\n for ($i = 0; $i < $total; $i++) {\n $segments[$i] = str_replace(':', '-', $segments[$i]);\n }\n\n return $segments;\n}", "public function getIncludeChainByParent($id, &$result)\n {\n $sql = 'SELECT t.timeperiod_include_id AS `id` '\n . 'FROM timeperiod_include_relations AS t '\n . 'WHERE t.timeperiod_include_id IS NOT NULL AND t.timeperiod_id = :id '\n . 'GROUP BY t.timeperiod_include_id';\n\n $stmt = $this->db->prepare($sql);\n $stmt->bindValue(':id', $id, PDO::PARAM_INT);\n $stmt->execute();\n\n while ($row = $stmt->fetch()) {\n $isExisting = array_key_exists($row['id'], $result);\n $result[$row['id']] = $row['id'];\n\n if (!$isExisting) {\n $this->getIncludeChainByParent($row['id'], $result);\n }\n }\n\n return $result;\n }", "public function resolveResource($path);", "public static function getURIparts($include_i18n_segment=false)\n\t{\n\t\t$_uri_parts = explode(\"/\",ltrim(Core::getURI(),\"/\"));\n\t\tif($_uri_parts[0] == \"public\")\n\t\t{\n\t\t\tarray_shift($_uri_parts);\n\t\t}\n\n\t\tif(!$include_i18n_segment && is_array($_ENV['config']['i18n_segments']) && preg_grep(\"/$_uri_parts[0]/i\",$_ENV['config']['i18n_segments']))\n\t\t{\n\t\t\tarray_shift($_uri_parts);\n\t\t}\n\n\t\treturn $_uri_parts;\n\t}", "public function testResourceHasKey()\n {\n $this->assertTrue($this->resource->has('books'),\n 'has() does not return true if param is set');\n $this->assertFalse($this->resource->has('dwarfs'),\n 'has() does not return false if param is not set');\n $this->assertTrue($this->resource->hasRecursive('books/0/title'),\n 'hasRecursive() does not return true if param is set');\n $this->assertTrue($this->resource->hasRecursive('books/0'),\n 'hasRecursive() does not return true if param is set and not at the and of the path');\n $this->assertFalse($this->resource->hasRecursive('books/0/soldCount'),\n 'hasRecursive() does not return false if param is not set');\n $this->assertFalse($this->resource->hasRecursive('dwarfs/0/gimli'),\n 'hasRecursive() does not return false if param is not set and not at the end of a valid path');\n }", "private function getRoutes($webspaceKey, $languageCode, $segmentKey)\n {\n // trailing slash\n return $this->sessionManager->getRouteNode($webspaceKey, $languageCode, $segmentKey);\n }", "public function validateSegments($account_id, $site_id, $api_key, $secret_key) {\n $base_url = \\Drupal::configFactory()->get('as_lift.settings.lift')->get('decision_api');\n $lift_client = new Lift($account_id, $site_id, $api_key, $secret_key, [\n 'base_url' => $base_url,\n ]);\n\n $segment_manager = $lift_client->getSegmentManager();\n $segment_ids = [];\n foreach ($segment_manager->query() as $segment) {\n $segment_ids[] = $segment->getId();\n }\n $slots = $this->getSettings()->get('slots');\n $segmentsValid = TRUE;\n foreach ($slots as $slot) {\n foreach ($slot['rules'] as $rule) {\n if (!empty($rule['segment']) && !in_array($rule['segment'], $segment_ids)) {\n $segmentsValid = FALSE;\n \\Drupal::logger('as_lift')->warning('Lift site @site_id is missing the segment @segment.', ['@site_id' => $this->site_id, '@segment' => $rule['segment']]);\n }\n }\n }\n\n return $segmentsValid;\n }", "public function get($key): Collection\n {\n if (\\array_key_exists($key, $this->routes)) {\n return $this->routes[$key];\n }\n\n throw new RuntimeException(\"Route Group with key: `$key` doesn't exists.\");\n }", "public function search($key)\n {\n return $this->root->search($key);\n }", "public function getContentSegments();", "protected function firstKeySegments($key, $count=1)\n {\n $segments = explode('.', $key);\n return implode('.', array_slice($segments, 0, $count));\n }", "protected function detectDirectoryChildren()\n\t{\n\t\t$children = array();\n\n\t\tforeach (new DirectoryIterator($this->resource) as $file)\n\t\t{\n\t\t\tif ($file->isDir() and ! $file->isDot())\n\t\t\t{\n\t\t\t\t$resource = new DirectoryResource($file->getRealPath(), $this->files);\n\n\t\t\t\t$children[$resource->getKey()] = $resource;\n\t\t\t}\n\t\t\telseif ($file->isFile())\n\t\t\t{\n\t\t\t\t$resource = new FileResource($file->getRealPath(), $this->files);\n\n\t\t\t\t$children[$resource->getKey()] = $resource;\n\t\t\t}\n\t\t}\n\n\t\treturn $children;\n\t}", "protected function isRequiredFromAncestor($key)\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isRequired($key);\n }\n\n return null;\n }", "public function find ($key);", "public function GetCombinedSegments() {\n\n $Out= array();\n $Segments= explode('/', ltrim($this->UrlParts['path'], '/'));\n $Segments= array_slice($Segments, $this->PathPrefixSegments);\n $xMax= count($Segments);\n for($x= 0; $x < $xMax; $x= $x+2) {\n $Out[$Segments[$x]]= isset($Segments[$x+1]) ? $Segments[$x+1] : null;\n }\n return $Out;\n }", "public function selectResourceRelation($vhInfo)\n {\n $qq = 'select_resources';\n $this->sdb->prepare($qq,\n 'select r.id as resource_id, r.version as resource_version, r.type as document_type, r.href, r.object_xml_wrap,\n r.title, r.extent, r.abstract, r.date, r.display_entry, r.repo_ic_id from\n (select id, max(version) as version from resource_cache where id in\n (select aa.resource_id\n from related_resource as aa,\n (select id, max(version) as version from related_resource where version<=$1\n and ic_id=$2 group by id) as bb\n where not aa.is_deleted and\n aa.id=bb.id\n and aa.version=bb.version)\n group by id) as ridvers,\n resource_cache r\n where not r.is_deleted and r.id = ridvers.id and r.version = ridvers.version;');\n\n $result = $this->sdb->execute($qq,\n array($vhInfo['version'],\n $vhInfo['ic_id']));\n $resources = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n $resources[$row[\"resource_id\"]] = $row;\n }\n $this->sdb->deallocate($qq);\n\n $qq = 'select_related_resource';\n $this->sdb->prepare($qq,\n 'select rr.* from\n (select aa.id, aa.version, aa.ic_id,\n aa.relation_entry, aa.descriptive_note, aa.arcrole,\n aa.resource_id, aa.resource_version\n from related_resource as aa,\n (select id, max(version) as version from related_resource where version<=$1 and ic_id=$2 group by id) as bb\n where not aa.is_deleted and\n aa.id=bb.id\n and aa.version=bb.version) rr;');\n\n $result = $this->sdb->execute($qq,\n array($vhInfo['version'],\n $vhInfo['ic_id']));\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n // the following merge will preserve the resource_version from the resource_cache table and drop the one from related_resource\n // since the resource_cache results are merged first.\n array_push($all, array_merge($resources[$row[\"resource_id\"]], $row));\n }\n $this->sdb->deallocate($qq);\n\n\n\n\n\n\n return $all;\n }", "public function resolveChildRouteBinding($childType, $value, $field)\n {\n }", "public function resolveChildRouteBinding($childType, $value, $field)\n {\n }", "private function getChildConfigKey($key)\n {\n $childKey = '';\n $dotPosition = strpos($key, '.');\n if (false !== $dotPosition) {\n $childKey = substr($key, $dotPosition + 1, strlen($key) - $dotPosition);\n }\n return $childKey;\n }", "public function getLoader($key)\n {\n }", "function wp_find_hierarchy_loop($callback, $start, $start_parent, $callback_args = array())\n {\n }", "function _wswwpx_page_get_child_ids ( $parent = 0 ) {\n\tglobal $wpdb;\n\tif ( $parent > 0 ) {\n\t\t// Get the ID of the parent.\n\n\t\t$results = $wpdb->get_results(\"\n\t \t\t\t\t\t\t\tSELECT ID\n\t \t\t\t\t\t\t\t\t FROM $wpdb->posts\n\t \t\t\t\t\t\t\t\t WHERE post_parent = $parent\", ARRAY_N );\n \t\tif ($results) {\n\t\t\tforeach ($results AS $r) {\n\t\t\t \tforeach ($r AS $v) {\n\t\t\t \t\t$result[] = $v;\n\t\t\t \t}\n\t\t\t }\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t} else {\n\t\t// ... or set a zero result.\n\t\t$pages = get_pages();\n\t\tforeach ($pages AS $page) {\n\t\t\t$result[]=$page->ID;\n\t\t}\n//\t\t$result = 0;\n\t}\n\t//\n\treturn $result;\n}", "public function _cleanResourceIdentifier($identifier) {\n if (empty ($identifier)) {\n if ($this->modx->getOption('base_url', null, MODX_BASE_URL) !== strtok($_SERVER[\"REQUEST_URI\"],'?')) {\n $this->modx->sendRedirect($this->modx->getOption('site_url', null, MODX_SITE_URL), array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n $identifier = $this->modx->getOption('site_start', null, 1);\n $this->modx->resourceMethod = 'id';\n }\n elseif ($this->modx->getOption('friendly_urls', null, false) && $this->modx->resourceMethod = 'alias') {\n $containerSuffix = trim($this->modx->getOption('container_suffix', null, ''));\n $found = $this->findResource($identifier);\n if ($found === false && !empty ($containerSuffix)) {\n $suffixLen = strlen($containerSuffix);\n $identifierLen = strlen($identifier);\n if (substr($identifier, $identifierLen - $suffixLen) === $containerSuffix) {\n $identifier = substr($identifier, 0, $identifierLen - $suffixLen);\n $found = $this->findResource($identifier);\n } else {\n $identifier = \"{$identifier}{$containerSuffix}\";\n $found = $this->findResource(\"{$identifier}{$containerSuffix}\");\n }\n if ($found) {\n $parameters = $this->getParameters();\n unset($parameters[$this->modx->getOption('request_param_alias')]);\n $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full');\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n $this->modx->resourceMethod = 'alias';\n } elseif ((integer) $this->modx->getOption('site_start', null, 1) === $found) {\n $parameters = $this->getParameters();\n unset($parameters[$this->modx->getOption('request_param_alias')]);\n $url = $this->modx->makeUrl($this->modx->getOption('site_start', null, 1), $this->modx->context->get('key'), $parameters, 'full');\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n } else {\n if ($this->modx->getOption('friendly_urls_strict', null, false)) {\n $requestUri = $_SERVER['REQUEST_URI'];\n $qsPos = strpos($requestUri, '?');\n if ($qsPos !== false) $requestUri = substr($requestUri, 0, $qsPos);\n $fullId = $this->modx->getOption('base_url', null, MODX_BASE_URL) . $identifier;\n $requestUri = urldecode($requestUri);\n if ($fullId !== $requestUri && strpos($requestUri, $fullId) !== 0) {\n $parameters = $this->getParameters();\n unset($parameters[$this->modx->getOption('request_param_alias')]);\n $url = $this->modx->makeUrl($found, $this->modx->context->get('key'), $parameters, 'full');\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n $this->modx->resourceMethod = 'alias';\n }\n } else {\n $this->modx->resourceMethod = 'id';\n }\n return $identifier;\n }", "public function resolve(): array\n {\n $relation = [$this->relationName => $this->decorateBuilder];\n\n return RelationFetcher\n ::countedParentModels($this->keys, $relation)\n ->all();\n }", "function tep_get_parent_sections(&$sections, $sections_id) {\r\n\t$parent_section_query = tep_db_query(\"select parent_id from \" . TABLE_SECTIONS . \" where sections_id = '\" . (int)$sections_id . \"' limit 1\");\r\n\t$parent_section = tep_db_fetch_array($parent_section_query);\r\n\tif ($parent_section['parent_id'] == 0) return true;\r\n\t$sections[sizeof($sections)] = $parent_section['parent_id'];\r\n\tif ($parent_section['parent_id'] != $sections_id) {\r\n\t tep_get_parent_sections($sections, $parent_section['parent_id']);\r\n\t}\r\n }", "private function addParentsToResource(array $resourcesHash, $nodeName)\n {\n $output = [];\n foreach ($resourcesHash as $resource => $children) {\n if ($resource == $nodeName) {\n $output = [$resource];\n break;\n }\n if (!empty($children)) {\n $names = $this->addParentsToResource($children, $nodeName);\n if (!empty($names)) {\n $output = array_merge([$resource], $names);\n break;\n } else {\n continue;\n }\n }\n }\n return $output;\n }", "abstract public function resolve();", "function _get_item_segments()\n{\n$segments = \"musical/instrument/\";\nreturn $segments;\n\n}", "public function getContext(string $key);", "function rst_load_parents($appGlobals,$keyType, $keyValue) {\n // includes kidProgram data when not using kidId (maybe need flag for this)\n $fields = array();\n $fields = dbRecord_parentFamilyCombo::stdRec_addFieldList($fields);\n $fields = stdData_kidProgram_exRecord::stdRec_addFieldList($fields);\n $fieldList = \"`\".implode(\"`,`\",$fields).\"`\";\n $sql = array();\n //???????? need kid program so can load all parents for program\n $sql[] = \"SELECT \".$fieldList;\n switch ($keyType) {\n case ROSTERKEY_KIDID:\n $sql[] = \"FROM `ro:kid`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"WHERE `rKd:KidId` ='{$keyValue}'\";\n break;\n case ROSTERKEY_KIDPERIODID:\n $sql[] = \"FROM `ro:kid_period`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPe:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPe:KidPeriodId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentId`\"; // each row is a unique parent\n break;\n case ROSTERKEY_KIDPROGRAMID:\n $sql[] = \"FROM `ro:kid_program`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPr:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPr:KidProgramId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentIdt`\"; // each row is a unique parent\n break;\n }\n $sql[] = \"ORDER BY `rPU:ContactPriority`\";\n $query = implode( $sql, ' ');\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n while ($row=$result->fetch_array()) {\n $kidId = $row['rKd:KidId'];\n $kidProgramId = $row['rKPr:KidProgramId'];\n $kid = $this->rst_get_kid($kidId);\n if ( $kid->rstKid_parent == NULL) {\n $kid->rstKid_parent = new dbRecord_parentFamilyCombo;\n if ( !isset($this->rst_map_kidProgram[$kidProgramId]) ) {\n $kidProgram = new stdData_kidProgram_exRecord;\n $kidProgram->stdRec_loadRow($row);\n $this->rst_map_kidProgram[$kidProgramId] = $kidProgram;\n }\n }\n $kid->rstKid_parent->stdRec_loadRow($row);\n }\n}", "function __get($key)\n {\n if (array_key_exists($key,$this->children)) {\n return $this->children[$key];\n } else {\n throw new InvalidArgumentException(\"child $key doesn't exist\");\n }\n }", "function getBelongsToReference(string $table, string $key): ?array;", "private function loadMatchUnMatchedCollection()\n {\n foreach ($this->mergeCollection as $key => $item) {\n $search = $this->baseCollection;\n foreach ($this->pivots as $basePivot => $mergePivot) {\n $search = $search->whereIn($basePivot, $item->$mergePivot);\n }\n\n $found = $search->first();\n\n if (!$found) {\n $this->report->unmatched()->push($item);\n } else {\n $this->report->matched()->push($found);\n }\n\n }\n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT ID, ROUTEID, PROVIDERID, PROVIDERNAME, NAMEZH, NAMEEN, PATHATTRIBUTEID, PATHATTRIBUTENAME, PATHATTRIBUTEENAME, BUILDPERIOD, DEPARTUREZH, DEPARTUREEN, DESTINATIONZH, DESTINATIONEN, REALSEQUENCE, DISTANCE, GOFIRSTBUSTIME, BACKFIRSTBUSTIME, GOLASTBUSTIME, BACKLASTBUSTIME, OFFPEAKHEADWAY FROM routes_2011 WHERE ID = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Routes2011();\n\t\t\t$obj->hydrate($row);\n\t\t\tRoutes2011Peer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "function findChildrens($sourceArr, $id, &$arrChidrens) {\r\n\tforeach ( $sourceArr as $key => $value ) {\r\n\t\tif ($value ['parents'] == $id) {\r\n\t\t\t\t$arrChidrens [] = $value ['id'];\r\n\t\t\t\tunset ( $sourceArr [$key] );\r\n\t\t\t\t$newID = $value ['id'];\r\n\t\t\t\tfindChildrens( $sourceArr, $newID, $arrChidrens );\r\n\t\t}\r\n\t}\r\n}", "protected function parentKey(string|int $key): string\n {\n return $this->parent->getAlias() . '.' . $this->parent->fieldAlias($this->schema[$key]);\n }", "protected function _getRecursiveKey($keyString) {\n $keyString = $this->_prepareString($keyString);\n $keyPieces = explode('.', $keyString);\n\n $configArray = Config::get()->getConfig()->toArray();\n $value = $configArray;\n foreach($keyPieces as $keyPiece) {\n if (isset($value[$keyPiece])) {\n $value = $value[$keyPiece];\n } else {\n throw new \\Exception('Config option does not exists: ' . $keyString);\n }\n }\n return $value;\n }", "public function __get(string $key)\n\t{\n\t\t$result = parent::__get($key);\n\n\t\tif ($result !== null)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t// Check for a matching collection\n\t\tif (array_key_exists($key, $this->collections()) && $this->document())\n\t\t{\n\t\t\t// If there's nothing there yet then get a new CollectionReference\n\t\t\tif (is_null($this->collections[$key]))\n\t\t\t{\n\t\t\t\t$this->collections[$key] = $this->document()->collection($key);\n\t\t\t}\n\t\t\t// If it is a model then load the model and set the builder\n\t\t\telseif (is_string($this->collections[$key]))\n\t\t\t{\n\t\t\t\t$collection = $this->document()->collection($key);\n\t\t\t\t$this->collections[$key] = model($this->collections[$key])->setBuilder($collection);\n\t\t\t}\n\n\t\t\treturn $this->collections[$key];\n\t\t}\n\n\t\treturn null;\n\t}", "protected function findPkSimple($key, ConnectionInterface $con)\n {\n $sql = 'SELECT scene_id, name, description, update_time, update_user FROM scene WHERE scene_id = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(\\PDO::FETCH_NUM)) {\n /** @var ChildScene $obj */\n $obj = new ChildScene();\n $obj->hydrate($row);\n SceneTableMap::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function findResource($sResource){\n $iPos = strpos($sResource, '?');\n $sResource = $iPos ? substr($sResource, 0, $iPos) : $sResource;\n $sResource= str_replace('/', '_', $sResource);\n// echo $sResource;\n return $this->findFile($sResource, 'resource');\n }", "public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(Routes2011Peer::ID, $key, Criteria::EQUAL);\n\t}", "private function selectChildListItemDefinitionIds() {\n\t\ttry {\n\t\t\t$sth = $this->context->connection->prepare(\n\t\t\t\t\"SELECT\tlist_item_definition_id\n\t\t\t\tFROM parent_list_item_definitions\n\t\t\t\tWHERE instance_id = :instId AND parent_list_item_definition_id = :id\");\n\n\t\t\t$this->context->connection->bindInstance($sth);\n\t\t\t$sth->bindValue(\":id\", $this->id, \\PDO::PARAM_INT);\n\n\t\t\t$sth->execute();\n\n\t\t\t$res = array();\n\n\t\t\twhile ($rd = $sth->fetch(\\PDO::FETCH_ASSOC)) {\n\t\t\t\t$id = intval($rd[\"list_item_definition_id\"]);\n\t\t\t\t$res[$id] = (object)array(\"id\" => $id);\n\t\t\t}\n\n\t\t\treturn $res;\n\n\t\t} catch(\\PDOException $e) {\n\t\t\tthrow new \\Scrivo\\ResourceException($e);\n\t\t}\n\t}", "function attemptWideLinkFix() {\n\t\t$ref = array();\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\t$lft = $asset->lft;\n\t\t\t$rgt = $asset->rgt;\n\t\t\tif ($rgt > $lft) {\n\t\t\t\tfor ($i=($lft+1); $i<=$rgt; $i++) {\n\t\t\t\t\t$ref[$i][] = $asset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\tif ((!isset($asset->parent_asset)) && ($asset->errors)) {\n\t\t\t\tif (isset($ref[$asset->lft])) {\n\t\t\t\t\t$widths = array();\n\t\t\t\t\tforeach ($ref[$asset->lft] as $tgt) {\n\t\t\t\t\t\t$wdt = $tgt->rgt - $tgt->lft;\n\t\t\t\t\t\t$widths[$wdt][] = $asset;\n\t\t\t\t\t}\n\t\t\t\t\tksort($widths);\n\t\t\t\t\t$sel = array_shift($widths);\n\t\t\t\t\t$sel = $sel[0]; // If width is same, just go by random\n\t\t\t\t\t$asset->parent_asset = $sel[0];\n\t\t\t\t\t$asset->parent_asset->addChild($asset);\n\t\t\t\t\t$asset->fixes[] = 'Parent assigned by attemptWideLinkFix';\n\t\t\t\t\t$this->removeRoot($asset->id);\n\t\t\t\t\t$this->fixed[] = $asset;\n\t\t\t\t} else {\n//\t\t\t\t\tprint 'No ref for '.$asset->lft.\"\\n\"; if (@$ccc++ > 5) die();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\n\t}", "protected function collectResource($resource)\n {\n if ($resource instanceof MissingValue) {\n return $resource;\n }\n\n $collects = $this->collects();\n\n $this->collection = $collects && ! $resource->first() instanceof $collects\n ? $this->getFiltered($resource, $collects)\n : $resource->toBase();\n\n return $resource instanceof AbstractPaginator\n ? $resource->setCollection($this->collection)\n : $this->collection;\n }", "public function get_segments($num = false)\n\t{\n\t\tif($num !== false)\n\t\t{\n\t\t\treturn isset($this->segments[$num]) ? $this->segments[$num] : false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->segments;\n\t\t}\n\t}", "function custom_is_child($pid)\n{\n global $post; // load details about this page\n $anc = get_post_ancestors($post->ID);\n foreach ($anc as $ancestor) {\n if (is_page() && $ancestor == $pid) {\n return true;\n }\n }\n return false; // we're elsewhere\n}", "protected function beforeShow(Request $request, Model $parentEntity, $key)\n {\n return null;\n }", "function data_has($target, $key)\n {\n if (is_null($key)) {\n return true;\n }\n\n $key = is_array($key) ? $key : explode('.', $key);\n\n while (! is_null($segment = array_shift($key))) {\n if ($segment === '*') {\n if ($target instanceof Collection) {\n $target = $target->all();\n } elseif (! is_array($target)) {\n return false;\n }\n\n $result = [];\n\n foreach ($target as $item) {\n $result[] = data_get($item, $key);\n }\n\n return true;\n }\n\n if (Arr::accessible($target) && Arr::exists($target, $segment)) {\n $target = $target[$segment];\n } elseif (is_object($target) && isset($target->{$segment})) {\n $target = $target->{$segment};\n } else {\n return false;\n }\n }\n\n return true;\n }", "public function resolveDetailsRelationships($request)\n {\n if (is_null($request->get('with'))) {\n return [];\n }\n\n $withs = [];\n\n if ($this->resource instanceof RestifySearchable) {\n with(explode(',', $request->get('with')), function ($relations) use ($request, &$withs) {\n foreach ($relations as $relation) {\n if (in_array($relation, $this->resource::getWiths())) {\n /**\n * @var AbstractPaginator\n */\n $paginator = $this->resource->{$relation}()->paginate($request->get('relatablePerPage') ?? ($this->resource::$defaultRelatablePerPage ?? RestifySearchable::DEFAULT_RELATABLE_PER_PAGE));\n /** * @var Builder $q */\n $q = $this->resource->{$relation}->first();\n /** * @var Repository $repository */\n if ($q && $repository = Restify::repositoryForModel($q->getModel())) {\n // This will serialize into the repository dedicated for model\n $relatable = $paginator->getCollection()->map(function ($value) use ($repository) {\n return $repository::resolveWith($value);\n });\n } else {\n // This will fallback into serialization of the parent formatting\n $relatable = $paginator->getCollection()->map(function ($value) use ($repository) {\n return $repository::resolveWith($value);\n });\n }\n\n unset($relatable['meta']);\n unset($relatable['links']);\n\n $withs[$relation] = $relatable;\n }\n }\n });\n }\n\n return $withs;\n }", "public function getResourcesRelatedConstellationIDs($resourceID) {\n if ($this->connector != null) {\n // Returning a single array of ids using collect()\n $result = $this->connector->run(\"MATCH (r:Resource {id: '{$resourceID}' })-[:RRELATION]-(i:Identity) return collect(i.id) as ids \");\n $relatedConstellationIDs = $result->getRecord()->get(\"ids\");\n return $relatedConstellationIDs;\n }\n }", "protected static function childRelationHaveItemWithIdentifier(\n string $identifier,\n array $resolvedChildItemsList\n ): bool {\n foreach ($resolvedChildItemsList as $resolvedChildItem) {\n if ((string)$resolvedChildItem['identifier'] === $identifier) {\n return true;\n }\n }\n\n return false;\n }", "function sfgov_utilities_deploy_10_dept_part_of() {\n try {\n $deptNodes = Utility::getNodes('department');\n\n foreach($deptNodes as $dept) {\n $deptId = $dept->id();\n\n // get part of values\n $partOf = $dept->get('field_parent_department')->getValue();\n\n if (!empty($partOf)) {\n $partOfRefId = $partOf[0]['target_id'];\n $langcode = $dept->get('langcode')->value;\n\n // load tagged parent\n $parentDept = Node::load($partOfRefId);\n\n if ($parentDept->hasTranslation($langcode)) { // check translation\n $parentDeptTranslation = $parentDept->getTranslation($langcode);\n $parentDivisions = $parentDeptTranslation->get('field_divisions')->getValue();\n\n // check that this dept isn't already added as a division on the parent dept\n $found = false;\n foreach ($parentDivisions as $parentDivision) {\n if ($deptId == $parentDivision[\"target_id\"]) {\n $found = true;\n break;\n }\n }\n \n if ($found == false) {\n $parentDivisions[] = [\n 'target_id' => $deptId\n ];\n $parentDeptTranslation->set('field_divisions', $parentDivisions);\n $parentDeptTranslation->save();\n }\n }\n }\n }\n } catch (\\Exception $e) {\n error_log($e->getMessage());\n }\n}", "public function getPartialRootPaths() {}", "public function childrenOfSection($filename)\n {\n $node = $this->lookupNode($filename);\n if (is_null($node) || ! array_key_exists('sub', $node)) {\n return null;\n }\n\n $children = new ArrayList();\n foreach ($node['sub'] as $node) {\n $child = $this->lookupSection($node['link']);\n $children->push($child);\n }\n\n return $children;\n }" ]
[ "0.51943487", "0.50396746", "0.500474", "0.4793643", "0.4777115", "0.46048528", "0.45161134", "0.44900838", "0.44562134", "0.44359654", "0.44185326", "0.440884", "0.4380058", "0.43690786", "0.43619815", "0.4318091", "0.42415175", "0.41752437", "0.41444394", "0.41420126", "0.41401264", "0.4109102", "0.4084249", "0.4066078", "0.40608275", "0.40516406", "0.40353966", "0.39949548", "0.39943856", "0.3985171", "0.39647162", "0.39493865", "0.3939948", "0.39373", "0.39230916", "0.39209569", "0.39161512", "0.39149725", "0.3912452", "0.39021924", "0.389593", "0.38958013", "0.38917255", "0.3844805", "0.3835158", "0.38341072", "0.382868", "0.38207725", "0.38166162", "0.38154677", "0.3811938", "0.38011536", "0.3795903", "0.37949404", "0.37946403", "0.3792801", "0.3779658", "0.37793726", "0.37778342", "0.37724477", "0.37710276", "0.37673718", "0.37604645", "0.37604645", "0.37573305", "0.37517095", "0.37487835", "0.3738104", "0.37375686", "0.37347397", "0.3731738", "0.37237808", "0.37164453", "0.37152347", "0.37134475", "0.37125996", "0.37115166", "0.3708756", "0.37044346", "0.37042674", "0.3699168", "0.36870593", "0.3686945", "0.36803102", "0.36671433", "0.36487165", "0.36453524", "0.36391854", "0.36366397", "0.36357477", "0.3634874", "0.36339653", "0.36328286", "0.36299473", "0.36269754", "0.36220372", "0.36216298", "0.36204052", "0.36189142", "0.36172345" ]
0.5911619
0
Returns description of macro, use, and accepted arguments
public function description() { $txt = array(); $txt['wiki'] = "Displays group events"; $txt['html'] = '<p>Displays group events.</p>'; $txt['html'] = '<p>Examples:</p> <ul> <li><code>[[Groupevent(number=3)]]</code> - Displays the next three group events</li> <li><code>[[Groupevent(title=Group Events, number=2)]]</code> - Adds title above event list. Displays 2 events.</li> <li><code>[[Groupevent(id=123)]]</code> - Displays single group event with ID # 123</li> </ul>'; return $txt['html']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMacroString(): string\n {\n return $this->macroString;\n }", "function defineDescription() {\n return 'List all available commands with a short description';\n }", "static function help($description, $cmdline, array $parameters) \n {\n\n }", "function fpg_definitions($name, $params) {\n\t$format = \"\\tPHP_FE(fann_%-41s arginfo_fann_%s_$name)\";\n\tif ($params['has_getter']) \n\t\tfpg_printf($format, \"get_$name,\", \"get\");\n\tif ($params['has_setter'])\n\t\tfpg_printf($format, \"set_$name,\", \"set\");\n}", "public function macros()\n\t{\n\t\treturn $this->macronutrients();\n\t}", "function xdescribe($title, \\Closure $closure)\n{\n pho\\xdescribe($title, $closure);\n}", "function getDescription() {\n\t\treturn __('plugins.preprocessors.regex.description');\n\t}", "function exampleHelpFunction()\n {\n //用法 >> exampleHelpFunction() \n return '這樣就能使用全域function了!';\n }", "public function testMacros() {\n $lower = function($value) {\n return strtolower($value);\n };\n\n $upper = function($value) {\n return strtoupper($value);\n };\n\n String::macro('lower', $lower);\n String::macro('upper', $upper);\n\n $this->assertEquals(array(\n 'lower' => $lower,\n 'upper' => $upper\n ), String::macros());\n }", "public function buildHelp($route_name, RouteMatchInterface $route_match);", "static function Describe() { return \"\"; }", "function descriptor_def()\n {\n return \"[description]\";\n }", "function mDESCRIBE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DESCRIBE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:136:3: ( 'describe' ) \n // Tokenizer11.g:137:3: 'describe' \n {\n $this->matchString(\"describe\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function describe($title, \\Closure $closure)\n{\n pho\\describe($title, $closure);\n}", "public function help();", "public function printHelp();", "public function usage() {}", "public function describe() {}", "public static function definition();", "function __construct()\n\t{\n\t\t$this->name = basename(__FILE__,'.inc');\n\t\t$this->shortdesc = 'A skeleton built-in command for QQSearch. Does nothing.';\n\t\t$this->longdesc = <<<EOS\n{$this->name} is just an example command, showing a pure skeleton built-in.\n\nIt does nothing, but its source shows how to implement a built-in command for\nQQSearch.\nEOS;\n\t}", "public abstract function describe();", "public abstract function describe();", "public function macroNameAttr(MacroNode $node, PhpWriter $writer)\n\t{\n\t\t$words = $node->tokenizer->fetchWords();\n\t\tif (!$words) {\n\t\t\tthrow new CompileException('Missing name in ' . $node->getNotation());\n\t\t}\n\t\t$name = array_shift($words);\n\t\t$tagName = strtolower($node->htmlNode->name);\n\t\t$node->empty = $tagName === 'input';\n\n\t\t$definedHtmlAttributes = array_keys($node->htmlNode->attrs);\n\t\tif (isset($node->htmlNode->macroAttrs['class'])) {\n\t\t\t$definedHtmlAttributes[] = 'class';\n\t\t}\n\n\t\tif ($tagName === 'form') {\n\t\t\t$node->openingCode = $writer->write(\n\t\t\t\t'<?php $form = $_form = $this->global->formsStack[] = '\n\t\t\t\t. ($name[0] === '$' ? 'is_object(%0.word) ? %0.word : ' : '')\n\t\t\t\t. '$this->global->uiControl[%0.word]; ?>',\n\t\t\t\t$name\n\t\t\t);\n\t\t\treturn $writer->write(\n\t\t\t\t'echo Nette\\Bridges\\FormsLatte\\Runtime::renderFormBegin(end($this->global->formsStack), %0.var, false)',\n\t\t\t\tarray_fill_keys($definedHtmlAttributes, null)\n\t\t\t);\n\t\t} else {\n\t\t\t$method = $tagName === 'label' ? 'getLabel' : 'getControl';\n\t\t\treturn $writer->write(\n\t\t\t\t'$_input = ' . ($name[0] === '$' ? 'is_object(%0.word) ? %0.word : ' : '')\n\t\t\t\t\t. 'end($this->global->formsStack)[%0.word]; echo $_input->%1.raw'\n\t\t\t\t\t. ($definedHtmlAttributes ? '->addAttributes(%2.var)' : '') . '->attributes()',\n\t\t\t\t$name,\n\t\t\t\t$method . 'Part(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')',\n\t\t\t\tarray_fill_keys($definedHtmlAttributes, null)\n\t\t\t);\n\t\t}\n\t}", "function non_functional()\n{\n $lots = of_code();\n //goes here\n\n /**\n * this is an example doc block that should be detected. It sits above an action inside a function.\n */\n $defaults = do_action('single_quote_name_no_spaces', $first = array('fake', array(1,2,3)), $second, $last);\n}", "public function cli_help() {}", "public function getHelpLines()\n {\n return array(\n 'Usage: php [function] [full]',\n '[function] - the PHP function you want to search for',\n //'[full] (optional) - add \"full\" after the function name to include the description',\n 'Returns information about the specified PHP function'\n );\n }", "public function get_macros () {\n\t\treturn array(\n\t\t\t'site_name' => get_bloginfo('name', 'display'),\n\t\t\t'site_description' => get_bloginfo('description', 'display'),\n\t\t);\n\t}", "public function get_macro ($part) {\n\t\t$fallback = $this->fallback() . '(.*)';\n\t\treturn $this->open() . $part . $fallback . $this->close();\n\t}", "abstract public function define($defn);", "public function description();", "public function description();", "public function get_help()\n\t{\n\t\treturn '';\n\t}", "private function getCommandHelp(): string\n {\n return <<<'HELP'\nThe <info>%command.name%</info> command creates a bundle skeleton in /lib:\n\n <info>php %command.full_name%</info> <comment>domain-name bundle-name</comment>\n\nBy default the command creates AcmeFooBundle in /lib/acme/foo-bundle directory.\n\nIf you omit any of the three required arguments, the command will ask you to\nprovide the missing values:\n\n # command will ask you for the domain name\n <info>php %command.full_name%</info> <comment>bundle-name</comment>\n\n # command will ask you for all arguments\n <info>php %command.full_name%</info>\n\nHELP;\n }", "function macro_grep($args) {\n $regexp = getattr($args, 'regexp');\n $substr = getattr($args, 'substr');\n $page = getattr($args, 'page');\n\n if (!$substr && !$regexp) {\n return macro_error('Expecting parameter `substr` or `regexp`');\n }\n if ($substr && $regexp) {\n return macro_error(\"Parameters `substr` and `regexp` can't be used together\");\n }\n if (!$page) {\n return macro_error('Expecting parameter `page`');\n }\n\n if (!identity_can('macro-grep', $args)) {\n return macro_permission_error();\n }\n\n if ($substr) {\n $textblocks = textblock_grep($substr, $page, false);\n } else {\n $textblocks = textblock_grep($regexp, $page, true);\n }\n $textblocks_good = array();\n foreach ($textblocks as $textblock) {\n if (identity_can(\"textblock-view\", $textblock)) {\n $textblocks_good[] = $textblock;\n }\n }\n\n ob_start();\n?>\n<div class=\"macroToc\">\n<p><strong><?= count($textblocks_good) ?></strong> rezultate.</p>\n<ul>\n<?php foreach ($textblocks_good as $textblock) { ?>\n <li><?= format_link(url_textblock($textblock['name']), $textblock['title']) ?></li>\n<?php } ?>\n</ul>\n</div>\n<?php\n $buffer = ob_get_clean();\n\n return $buffer;\n}", "function wp_idolondemand_concept_extraction($args) {\n\textract($args);\n\techo $before_widget;\n\techo $before_title;?>Concept Extraction<?php echo $after_title;\n\tdisplay_wp_idolondemand_concept_extraction();\n\techo $after_widget;\n}", "function usage()\n\t{\n\tob_start(); \n\t?>\n\tWrap anything you want to be processed between the tag pairs. Useful for {segment} variables, filenames, and other \"_\" and \"-\" separated strings.\n\n\t{exp:uri_prettify}\n\n\ttext you want processed\n\n\t{/exp:uri_prettify}\n\n\tExample: today_i_win_the_game\n\tResults: Today I Win the Game\n\n\n\tParameters: \n\n\t===============================================================\n\t\n\tuncap_keywords=\"yes\" (defaults to \"no\")\n\tUncapitalized certain words for proper grammar's sake. E.g. articles, prepositions and coordinate conjunctions. Will keep them capitalized if they're at the start of a sentence (not prefaced with a space). Default keywords are: \"and\", \"to\", \"with\", \"for\", \"the\" and \"or\".\n\t\n\tcase=\"title|sentence\" (defaults to \"sentence\")\n\tWould you like Title case (all words) or Sentence case (only first word)? Your choice.\n\t\n\t===============================================================\n\t\n\tkeywords=\"word1|word2|word3\"\n\t\n\tOverride the default list of words with your own. Words must be separated by pipe (\"|\") delimiters.\n\n\t<?php\n\t$buffer = ob_get_contents();\n\n\tob_end_clean(); \n\n\treturn $buffer;\n\t}", "function help()\n {\n return\n \"\\n -------------------------------------------------------------------------\\n\".\n \" ---- ~ BidVest Data : Assessment Commands ~ -------\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" All comamnds begin with '\\e[1m\\033[92mphp run.php\\033[0m'\\e[0m\\n\".\n \" Then append of the folling options: \\n\".\n \" -------------------------------------------------------------------------\\n\".\n \"\\n\\n\".\n \" 1. \\e[1m --action=\\033[34madd \\033[0m \\e[0m : \\e[3mThis allows you to add a record.\\e[0m \\n\\n\".\n \" 2. \\e[1m --action=\\033[33medit \\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mEdit a student record.\\e[0m \\n\\n\".\n \" (leave filed blank to keep previous value)\\n\\n\".\n \" 3. \\e[1m --action=\\033[91mdelete\\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mDelete a student record (remove file only).\\e[0m \\n\\n\".\n \" 4. \\e[1m --action=\\033[36msearch \\033[0m \\e[0m : \\e[3mSearch for a student record. \\e[0m \\n\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" Where \\e[1m<valid_id>\\e[0m must be an 8-digit number.\\n\\n\".\n \" -------------------------------------------------------------------------\\n\";\n }", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "static function help($command) {\n return 'TO-DO';\n }", "function help($message = null) {\n if (!is_null($message))\n echo($message.NL.NL);\n\n $self = baseName($_SERVER['PHP_SELF']);\n\necho <<<HELP\n\n Syntax: $self [symbol ...]\n\n\nHELP;\n}", "function def($param)\n {\n //a. a default function incase anything was called unexpectedly\n return \"\\033[91m\" .print_r($param). \"InputError: \\033[0m \".\n \"\\033[31mI require atleast a single paramater. \\033[0m \".\n \"add the correct parameter --action=help \\n\";\n }", "public function helpStubCommand() {}", "public function testMacroable()\n {\n Rule::macro('phone', function () {\n return 'regex:/^([0-9\\s\\-\\+\\(\\)]*)$/';\n });\n $c = Rule::phone();\n $this->assertSame('regex:/^([0-9\\s\\-\\+\\(\\)]*)$/', $c);\n }", "public function testMacroable()\n {\n Rule::macro('phone', function () {\n return 'regex:/^([0-9\\s\\-\\+\\(\\)]*)$/';\n });\n $c = Rule::phone();\n $this->assertSame('regex:/^([0-9\\s\\-\\+\\(\\)]*)$/', $c);\n }", "public function usageHelp()\n {\n return <<<USAGE\nGenerates file mappings for a Modman or Composer Magento module\nUsage: php -f modman_files.php -- --module_name=Mage_Catalog --prefix=\"mycustom_dir\"\nOptions:\n--module_name Custom module name (REQUIRED) e.g Namespace_ModuleName\n--prefix Your module module base directory from Magento root directory\n--strip string to strip out of mapping\n \nUSAGE;\n }", "function wp_user_request_action_description($action_name)\n {\n }", "public function get_description()\n {\n if ( isset($this->description) )\n return $this->description;\n\n return \"Defines the {$this->name}\";\n }", "public function actionDoc($detail=true){\n if($detail)\n echo $this->getHelp();\n else\n echo $this->getHelpSummary();\n // getActionHelp($action)\n // getActionArgsHelp($action)\n // getActionOptionsHelp($action)\n \n // getActionMethodReflection($action) -- protected\n }", "public function usageHelp() {\r\r\n return <<<USAGE\r\r\nUsage: php -f inventory.php -- [options]\r\r\n php -f inventory.php \r\r\n\r\r\n\r\r\nUSAGE;\r\r\n }", "public function usageHelp() {\r\r\n return <<<USAGE\r\r\nUsage: php -f inventory.php -- [options]\r\r\n php -f inventory.php \r\r\n\r\r\n\r\r\nUSAGE;\r\r\n }", "function ren_help($mode = 1, $addtextfunc = \"addtext\", $helpfunc = \"help\")\n{\n return display_help(\"helpb\", $mode, $addtextfunc, $helpfunc = \"help\");\n}", "public static function getCurrentMacroName()\n {\n return static::$currentMacroName;\n }", "public function define();", "function inspect()\n{\n\t$args=func_get_args();\n\n\t_inspect($args,false);\n}", "public function custom_definition() {}", "public function custom_definition() {}", "public function custom_definition() {}", "function macro_get_named_argument($name)\n{\n $data = getopt('', array($name . '::'));\n\n return isset($data[$name]) ? $data[$name] : null;\n}", "public function drupal_help_arg($arg = array())\n {\n return drupal_help_arg($arg);\n }", "function spizer_usage()\n{\n if (! isset($argv)) $argv = $_SERVER['argv'];\n \n echo <<<USAGE\nSpizer - the flexible web spider, v. 0.1\nUsage: {$argv[0]} [options] <Start URL>\n\nWhere [options] can be:\n --delay | -d <seconds> Number of seconds to delay between requests\n --log | -l <log file> Send messages to file instead of to stdout\n --savecookies | -s Save and resend cookies throughout session\n --help | -h Show this help message\n\n\nUSAGE;\n}", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "public function getProcessedHelp(): string\n {\n $name = $this->name;\n $isSingleCommand = $this->application?->isSingleCommand();\n\n $placeholders = [\n '%command.name%',\n '%command.full_name%',\n ];\n $replacements = [\n $name,\n $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,\n ];\n\n return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());\n }", "public function usageHelp()\n {\n global $argv;\n $self = basename($argv[0]);\n return <<<USAGE\n\nGuardia importer\n\nUpdates orders statuses and add tracking codes loaded from CSV file\n\nUsage: php -f $self -- [options]\n\nOptions:\n\n help This help\n import Import orders statuses and shippings\n\nUSAGE;\n }", "public function getCommandHelp()\n {\n return <<<HELP\n\n\\e[33mOutputs information about PHP's configuration.\\e[0m\n\n\\e[36mUsage:\\e[0m \\e[32mcfg info get [--what WHAT]\\e[0m\n \n Displays information about the current state of PHP.\n The output may be customized by passing constant \\e[30;1mWHAT\\e[0m which corresponds to the appropriate parameter of function phpinfo().\n\nHELP;\n }", "protected function buildDescription($called, $args) {\n $text = (($this->invert) ? 'not ' : '').$this->tester->toWords($called);\n $when = ucfirst($this->tester->toWords(get_class($this->tester)));\n $it = $this->tester->toWords($this->tester->method);\n $args = (empty($args)) ? \"\" : $this->displayValue($args[0]);\n\n return \" : $when, $it : Expected {$this->displayValue($this->subject)} {$text} {$args}\\n\";\n }", "function usage() {\n echo \"Usage:\\n\";\n echo \" php \".__FILE__.\" FILE KEYWORD\\n\";\n}", "public function help()\r\n{\r\n // You could include a file and return it here.\r\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n}", "function macro_get_plain_argument($number)\n{\n return isset($_SERVER['argv'][$number]) ? $_SERVER['argv'][$number] : null;\n}", "function commandSynopsis($skip_global = true)\n {\n if ($skip_global) {\n return array(\n );\n } else {\n return array(\n array(\n 'type' => 'positional',\n 'name' => 'addon_slug',\n 'description' => 'The slug used to reference this add-on. Used for generating classnames and other references for the addon.',\n 'optional' => false,\n 'multiple' => false,\n ),\n array(\n 'type' => 'assoc',\n 'name' => 'addon_author',\n 'description' => 'Adds the given name with the @author tag in any phpdocs',\n 'optional' => true,\n ),\n array(\n 'type' => 'flag',\n 'name' => 'force',\n 'description' => 'Use this to indicate overwriting any files that already exist.',\n 'optional' => true,\n ),\n );\n }\n }", "protected function configure()\n {\n $this\n ->setName(\"{$this->namespace}:{$this->method}\")\n ->setDescription($this->description)\n ->addArgument($this->argName, InputArgument::REQUIRED, 'The input string.')\n ->configureOptions();\n }", "protected abstract function describeCommand(\\RectorPrefix20210607\\Symfony\\Component\\Console\\Command\\Command $command, array $options = []);", "function runkit_function_redefine($funcname, $arglist, $code)\n{\n}", "public function help()\n {\n // You could include a file and return it here.\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\n }", "public function usageHelp()\n {\n return <<<USAGE\nUsage:\n php -f export.php [--attr1 val1 --attr2 val2] [--images|--skus]\n --skus Export sku,name csv (could be used in Import to delete products)\n --images Export images\nThe script export sku,name (if --sku) or images (if --media) for products with attr1 = val1 AND attr2 = val2; If you want to use LIKE condition, put % in val\n\nExample\n To get a list with images:\n php exportskus.php --name 'My%' --images | sort -u \n To get a csv with sku,name:\n php exportskus.php --name 'My%' --skus > skutodelete.csv\n\n\nUSAGE;\n }", "function getDescription() ;", "function getDisplayName() {\n\t\treturn __('plugins.preprocessors.regex.displayName');\n\t}", "public function help()\n\t{\n\t\t$this\n\t\t\t->output\n\t\t\t->addOverview(\n\t\t\t\t'Store shared configuration variables used by the command line tool.\n\t\t\t\tThese will, for example, be used to fill in docblock stubs when\n\t\t\t\tusing the scaffolding command.'\n\t\t\t)\n\t\t\t->addTasks($this)\n\t\t\t->addArgument(\n\t\t\t\t'--{keyName}',\n\t\t\t\t'Sets the variable keyName to the given value.',\n\t\t\t\t'Example: --name=\"John Doe\"'\n\t\t\t);\n\t}", "function training_menu_arguments($arg1 = NULL, $arg2 = NULL) {\n $output = '';\n if (!empty($arg1)) {\n $output .= t('Argument 1=%arg', array('%arg' => $arg1)) . '</br>';\n }\n if (!empty($arg2)) {\n $output .= t('Argument 2=%arg', array('%arg' => $arg2));\n }\n\n return $output;\n}", "function getCorrectUse($command){\n\t$use = $command;\n\t$use .= \" [-l]\";\n\t$use .= \" [-t title]\";\n\t$use .= \" [-f format]\";\n\t$use .= \" [-c]\";\n\t$use .= \" youtube-url\";\n\n\treturn $use;\n}", "public function getArgumentDefinitions() {}", "function inspect_plain()\n{\n\t$args=func_get_args();\n\n\t_inspect($args,true);\n}", "function manual($cword)\r\n{\r\n\t$conv = \"( set manual: \". $cword->syntax;\r\n\t\r\n\tif ($cword->NrParams == 1 && isset($cword->parameter_1))\r\n\t{\r\n\t\t$conv = $conv . \" \" . $cword->parameter_1 ;\r\n\t}\t\r\n\t\r\n\t$conv = $conv . \")\";\r\n\t\r\n\treturn $conv;\r\n}", "public function usageHelp()\n {\n return <<<USAGE\nUsage: php -f indexer.php -- [options]\n\n --status <indexer> Show Indexer(s) Status\n --status-reindex_required <indexer> Set status to \"Reindex Required\"\n --mode <indexer> Show Indexer(s) Index Mode\n --mode-realtime <indexer> Set index mode type \"Update on Save\"\n --mode-manual <indexer> Set index mode type \"Manual Update\"\n --mode-queued <indexer> Set index mode type \"Queue Events\"\n --reindex <indexer> Reindex Data\n info Show allowed indexers\n reindexall Reindex Data by all indexers\n help This help\n\n <indexer> Comma separated indexer codes or value \"all\" for all indexers\n\nUSAGE;\n }", "function shortCodeMagic($att, $content = NULL)\n {\n\n }", "public function help ()\n {\n $msg = 'sassファイルをコンパスコンパイル';\n\n return $msg;\n }", "public function usage()\n\t{\n\t\treturn 'For usage visit: http://www.devdemon.com/';\n\t}", "public function npMacroControlOptions($macro)\n {\n if (preg_match('~^file-([0-9]+)(_.+)?$~', $macro[1], $m)) {\n return \"#-file-$m[1]\" .\n FilesModel::getFile($m[1])->getControlMacroOptions(\n isset($m[2]) ? $m[2] : null\n ) .\n \"-#\";\n } else {\n return $macro[0];\n }\n }", "public function customizer_help() {\n\t\techo '\n\t\t<li>\n\t\t\t<p>\n\t\t\t\t' . __( 'Example text:', 'hellish-simplicity' ) . ' <code>' . esc_html( $this->default_header_text ) . '</code>\n\t\t\t</p>\n\t\t</li>';\n\t}", "public function help()\r\n\t{\r\n\t\t// You could include a file and return it here.\r\n\t\treturn \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n\t}", "public function describe($description, \\Closure $spec);", "public function usage() {\n\t\treturn \"usage: cobweb [flags] [command] [arguments]\\n\";\n\t}", "function t($name)\n{\n static $map = array(\n '.' => 'ACCESSOR',\n '[' => 'ARRAY_START',\n ']' => 'ARRAY_END',\n '@' => 'AT_SIGN',\n '=>' => 'BOUND_FUNC',\n ':' => 'COLON',\n ',' => 'COMMA',\n '--' => 'DECREMENT',\n '=' => 'EQUALS',\n '?' => 'EXISTENTIAL',\n '?.' => 'EXISTENTIAL_ACCESSOR',\n '->' => 'FUNC',\n '++' => 'INCREMENT',\n '&' => 'LOGIC',\n '&&' => 'LOGIC',\n '||' => 'LOGIC',\n '-' => 'MINUS',\n '{' => 'OBJECT_START',\n '}' => 'OBJECT_END',\n '(' => 'PAREN_START',\n ')' => 'PAREN_END',\n '+' => 'PLUS',\n '::' => 'PROTOTYPE',\n '...' => 'RANGE_EXCLUSIVE',\n '..' => 'RANGE_INCLUSIVE',\n );\n\n if (func_num_args() > 1)\n {\n $name = func_get_args();\n }\n\n if (is_array($name) || (func_num_args() > 1 && $name = func_get_args()))\n {\n $tags = array();\n\n foreach ($name as $v)\n {\n $tags[] = t($v);\n }\n\n return $tags;\n }\n\n $name = 'CoffeeScript\\Parser::YY_'.(isset($map[$name]) ? $map[$name] : $name);\n\n // Don't return the original name if there's no matching constant, in some\n // cases intermediate token types are created and the value returned by this\n // function still needs to be unique.\n return defined($name) ? constant($name) : $name;\n}", "public function Name()\n {\n return parent::CallMethod(__FUNCTION__, array(), func_get_args());\n }", "public function getUsage()\n {\n return Horde_Kolab_Cli_Translation::t(\" format - Handle the Kolab format (the default action is \\\"read\\\")\n\n - read TYPE [FILE|FOLDER UID PART]: Read a Kolab format file of the specified\n type. Specify either a direct file name\n or a combination of an IMAP folder, a UID\n within that folder and the specific part\n that should be parsed.\n\n\n\");\n }", "function describe() {\n print(\"\\nI am \" . $this->getName() . \" - \" . $this->getCode() . \" price: \" . $this->price);\n }", "public function usageHelp()\n {\n $defaultExcludeCategories = self::DEFAULT_EXCLUDE_CATEGORIES;\n $defaultExcludeAreaOfBusiness = self::DEFAULT_EXCLUDE_AREA_OF_BUSINESS;\n\n return <<<USAGE\nCreate Trade Me categories inside an existing category structure from the Trade Me public API:\nhttps://developer.trademe.co.nz/api-reference/catalogue-methods/retrieve-general-categories/\n\nWARNING: This doesn't de-duplicate. If the categories already exist it will make new ones anyway. URL keys may overlap.\n\nUsage: php -f trademe_category_create.php -- [options]\n\n --catid <id> Target Magento category ID to create the structure under\n\n --tmjson <url> Trade Me JSON url e.g. 'https://api.trademe.co.nz/v1/Categories.json' (default)\n or 'https://api.trademe.co.nz/v1/Categories/0187-.json' (for a subset)\n\n --active Set category to active? (default: false)\n\n --menu Set category to include in menu? (default: false)\n\n --exclude-categories Comma separated list of Trade Me category \"Numbers\" to exclude\n (default: '$defaultExcludeCategories'), Area of business is preferred\n\n --exclude-area-of-business Comma separated list of Trade Me AreaOfBusiness exclude\n (default: '$defaultExcludeAreaOfBusiness' i.e. only Marketplace)\n\n help This help\n\n\nUSAGE;\n }", "public function getGeneralDocumentation();", "function showHelp()\n{\n $myName = basename(__FILE__);\n echo \"Usage:\\n\";\n echo sprintf(\" %s \\033[32m{tool name}\\033[0m\\n\", $myName);\n echo PHP_EOL;\n echo \" Tool names:\\n\";\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Convert SASS/SCSS to CSS:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sasstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scsstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'css');\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Dump autoload classes map:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dumpautoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dump');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'classmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadclassmap');\n exit(0);\n}", "public function getDocumentation(): string;", "protected function makeConfigure()\n {\n $this\n ->setDescription('< not implemented >')\n ->addArgument('phone', InputArgument::REQUIRED, 'phone')\n ->addArgument('product_id', InputArgument::REQUIRED, 'product_id')\n ->addArgument('amount', InputArgument::REQUIRED, 'amount')\n ->addArgument('transaction_external_id', InputArgument::OPTIONAL, '...')\n ->addArgument('transaction_id', InputArgument::OPTIONAL, '...')\n ->addArgument('transaction_date', InputArgument::OPTIONAL, '...')\n ->addArgument('account', InputArgument::OPTIONAL, '...')\n ->addArgument('info', InputArgument::OPTIONAL, '...')\n ->addArgument('additional_params', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '...')\n ;\n }", "public function getDescription()\n {\n return 'Developer at Afrihost. Design Patterns acolyte. Dangerous sysadmin using \\'DevOps\\' as an excuse. I like '.\n 'long walks on the beach and craft beer.';\n }" ]
[ "0.58642614", "0.57198465", "0.5688616", "0.5616013", "0.5475116", "0.54723245", "0.5419684", "0.538304", "0.5355571", "0.53491145", "0.5341322", "0.53347474", "0.5318063", "0.53105116", "0.5303859", "0.52531683", "0.5237085", "0.5209911", "0.5204668", "0.52001834", "0.5182222", "0.5182222", "0.516059", "0.51271117", "0.5123019", "0.5110123", "0.5107933", "0.51074404", "0.5096586", "0.5080083", "0.5080083", "0.50753874", "0.5063796", "0.5063248", "0.50527424", "0.50456285", "0.5036266", "0.50362074", "0.5028459", "0.50279665", "0.5016712", "0.50149125", "0.5004071", "0.5004071", "0.50031537", "0.50006336", "0.49964994", "0.4983274", "0.4972481", "0.4972481", "0.4971071", "0.49692863", "0.49675134", "0.49671888", "0.49656186", "0.49656186", "0.49656186", "0.49643826", "0.49590376", "0.49375057", "0.49326462", "0.4929246", "0.49224916", "0.49222213", "0.49190295", "0.49182892", "0.49121484", "0.49104264", "0.4907684", "0.4900164", "0.48948777", "0.4887281", "0.4856567", "0.48556295", "0.48507446", "0.4836265", "0.4835397", "0.48311687", "0.4825094", "0.48238695", "0.48184326", "0.48181027", "0.48173925", "0.48131132", "0.4812813", "0.48123467", "0.48108917", "0.48022223", "0.47997093", "0.4787849", "0.4785911", "0.47809902", "0.4777833", "0.47736177", "0.47681335", "0.47638935", "0.47624668", "0.47525424", "0.47514883", "0.47476968", "0.4731595" ]
0.0
-1
Query for group events
private function getGroupEvents( $group, $filters = array() ) { //instantiate database $database = App::get('db'); //build query $sql = "SELECT * FROM `#__events` WHERE publish_up >= UTC_TIMESTAMP() AND scope=" . $database->quote('group') . " AND scope_id=" . $database->Quote($group->get('gidNumber')) . " AND state=1"; //do we have an ID set if (isset($filters['id'])) { $sql .= " AND id=" . $database->Quote( $filters['id'] ); } //add ordering $sql .= " ORDER BY publish_up ASC"; //do we have a limit set if (isset($filters['number'])) { $sql .= " LIMIT " . $filters['number']; } //return result $database->setQuery($sql); return $database->loadObjectList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getGroupEvents($id){\n $events = DB::table('group_events')\n ->where('group_id', '=', $id)\n ->whereNull('deleted_at');\n return $events;\n }", "public function events( $fields = '' ) {\n\t\treturn $this->client->getGroup( [\n\t\t\t'urlname' => $this->group,\n\t\t 'fields' => $fields\n\t\t] );\n\t}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function ajax_get_group_events() {\n\n\t\t// Get the posts.\n\t\t$posts = get_posts(\n\t\t\t[\n\t\t\t\t'post_type' => 'schedule',\n\t\t\t\t'posts_per_page' => - 1,\n\t\t\t\t'post_status' => [ 'publish', 'future', 'draft', 'pending' ],\n\t\t\t\t'orderby' => 'title',\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'suppress_filters' => true,\n\t\t\t\t'meta_key' => 'event_type',\n\t\t\t\t'meta_value' => 'group',\n\t\t\t]\n\t\t);\n\n\t\tif ( ! empty( $posts ) ) {\n\n\t\t\t// If we're trying to detect an event's parent...\n\t\t\t$select_parent = isset( $_GET['select_parent'] ) ? $_GET['select_parent'] : 0;\n\t\t\tif ( $select_parent > 0 ) {\n\n\t\t\t\t// Get event parent.\n\t\t\t\t$selected_parent = get_post_field( 'post_parent', $select_parent );\n\n\t\t\t\t// Mark selected posts.\n\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t$post->is_selected = ( $selected_parent == $post->ID );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo json_encode( $posts );\n\n\t\twp_die();\n\t}", "function testGetGroupListByEventId()\n {\n $groups = $this->GroupEvent->getGroupListByEventId(1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), array(1,2));\n\n //Test invalid event\n $groups = $this->GroupEvent->getGroupListByEventId(999);\n $this->assertEqual($groups, null);\n }", "function testGetGroupIDsByEventId()\n {\n $groups = $this->GroupEvent->getGroupIDsByEventId(1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), array(1,2));\n\n //Test invalid event\n $groups = $this->GroupEvent->getGroupIDsByEventId(999);\n $this->assertEqual($groups, null);\n }", "function get_group_by_event($event_id) {\n\t\t$data = $this->db->query('SELECT org_title \n\t\t\t\tFROM organization JOIN organization_event ON(organization.org_id = organization_event.org_id)\n\t\t\t\tWHERE event_id='.$event_id.'');\n\t\treturn $data->result();\n\t}", "function testGetGroupEventByEventIdAndGroupId()\n {\n $group = $this->GroupEvent->getGroupEventByEventIdAndGroupId(2, 1);\n $this->assertEqual($group, 3);\n\n //Test invalid event and valid group\n $group = $this->GroupEvent->getGroupEventByEventIdAndGroupId(999, 1);\n $this->assertEqual($group, null);\n\n //Test valid event and invalid group\n $group = $this->GroupEvent->getGroupEventByEventIdAndGroupId(1, 999);\n $this->assertEqual($group, null);\n\n //Test invalid event and invalid group\n $group = $this->GroupEvent->getGroupEventByEventIdAndGroupId(999, 9);\n $this->assertEqual($group, null);\n\n }", "function testGetGroupEventByEventIdGroupId()\n {\n $group = $this->GroupEvent->getGroupEventByEventIdGroupId(1, 1);\n $this->assertEqual($group['GroupEvent']['group_id'], '1');\n $this->assertEqual($group['GroupEvent']['event_id'], '1');\n\n //Test valid event and invalid group\n $group = $this->GroupEvent->getGroupEventByEventIdGroupId(1, 999);\n $this->assertEqual($group, null);\n\n //Test invalid event and valid group\n $group = $this->GroupEvent->getGroupEventByEventIdGroupId(999,1);\n $this->assertEqual($group, null);\n\n //Test invalid event and invalid group\n $group = $this->GroupEvent->getGroupEventByEventIdGroupId(999, 999);\n $this->assertEqual($group, null);\n }", "function testGetGroupEventByUserId()\n {\n $groups = $this->GroupEvent->getGroupEventByUserId(5, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), array(1));\n\n //Test valid user not in group\n $groups = $this->GroupEvent->getGroupEventByUserId(8, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n\n //Test invalid user\n $groups = $this->GroupEvent->getGroupEventByUserId(999, 1);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n\n //Test invalid event\n $groups = $this->GroupEvent->getGroupEventByUserId(3, 999);\n $this->assertEqual(Set::extract('/GroupEvent/group_id', $groups), null);\n }", "function getEventByWorkingGroup($idWG)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT Events_idEvents FROM bdd_satisfevent.workinggroups_has_events WHERE Workinggroups_idWorkinggroups = ?');\n $request->execute(array($idWG));\n $result = $request->fetchAll();\n return $result[0];\n}", "function statistics_extended_groups_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}system_log \";\r\n\t$query.=\"WHERE event IN ('create','delete') \";\r\n\t$query.=\"AND object_type='group' \";\r\n\t$query.=\"GROUP BY zoom,event\";\r\n\r\n\treturn get_data($query);\r\n}", "function testGetGroupsByEventId()\n {\n $groups = $this->GroupEvent->getGroupsByEventId(1);\n $this->assertEqual($groups[0]['GroupEvent']['id'], '1');\n $this->assertEqual($groups[0]['GroupEvent']['group_id'], '1');\n $this->assertEqual($groups[0]['GroupEvent']['event_id'], '1');\n $this->assertEqual($groups[1]['GroupEvent']['id'], '2');\n $this->assertEqual($groups[1]['GroupEvent']['group_id'], '2');\n $this->assertEqual($groups[1]['GroupEvent']['event_id'], '1');\n\n //Test invalid event\n $groups = $this->GroupEvent->getGroupsByEventId(999);\n $this->assertEqual($groups, null);\n }", "public function get_eventlist($gid = 0, $digest = false, $pattern = null, $num = 0, $start = 0, $orderby = 'starts', $orderdir = 'ASC', $archived = false)\n {\n // Support for filtering out events from groups not included in result set according to query type\n $eventListFilter = ($gid == 'NULL') ? array('', '') : $this->getQueryTypeFilter($gid);\n $gidFilter = $this->getGroupAndShareFilter($gid);\n $return = array();\n $query = 'SELECT e.`id`,UNIX_TIMESTAMP(e.starts) `start`,UNIX_TIMESTAMP(e.ends) `end`,e.`starts`,e.`ends`'\n .',e.`title`,e.`description`,e.`location`,e.`type`,e.`status`,e.`opaque`,e.`gid`,e.`uuid`,UNIX_TIMESTAMP(e.`lastmod`) mtime,fs.`val` `colour`'\n .($digest ? ',COUNT(rep.id) `repetitions`,COUNT(rem.id) `reminders`,COUNT(rem2.id) `reminders_sms`,COUNT(rem3.id) `reminders_email`' : '')\n .' FROM '.$this->Tbl['cal_event'].' e'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=e.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=e.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .$eventListFilter[0]\n .($digest ? ' LEFT JOIN '.$this->Tbl['cal_repetition'].' rep ON rep.`type`!=\"-\" AND rep.`eid`=e.`id` AND rep.`ref`=\"evt\"' : '')\n .($digest ? ' LEFT JOIN '.$this->Tbl['cal_reminder'].' rem ON rem.`eid`=e.`id` AND rem.`ref`=\"evt\"' : '')\n .($digest ? ' LEFT JOIN '.$this->Tbl['cal_reminder'].' rem2 ON rem2.`eid`=e.`id` AND rem2.`ref`=\"evt\" AND rem2.`smsto`!=\"\"' : '')\n .($digest ? ' LEFT JOIN '.$this->Tbl['cal_reminder'].' rem3 ON rem3.`eid`=e.`id` AND rem3.`ref`=\"evt\" AND rem3.`mailto`!=\"\"' : '')\n .' WHERE ('.$gidFilter.')'.$eventListFilter[1].' AND e.`archived`=\"'.($archived ? 1 : 0).'\"';\n if ($gid === 'NULL') {\n $query .= ' AND e.gid=0';\n } elseif ($gid > 0) {\n $query .= ' AND e.gid='.doubleval($gid);\n }\n\n // Do we have a search pattern set?\n if ($pattern == '@@upcoming@@') { // Special filter for upcoming events (pinboard)\n $query .= ' AND (`starts`>=NOW() OR (`starts`<=NOW() AND `ends`>=NOW()))';\n } elseif ($pattern) {\n $pattern = $this->esc($pattern);\n $pattern = (strstr($pattern, '*')) ? str_replace('*', '%', $pattern) : '%'.$pattern.'%';\n // Flatten the field list\n $v = array();\n foreach (array('title', 'location', 'description') as $k) { $v[] = 'e.`'.$k.'` LIKE \"'.$pattern.'\"'; }\n $query .=' AND ('.implode(' OR ', $v).')';\n }\n if ($digest) {\n $query .= ' GROUP BY e.`id`';\n }\n $query .= ' ORDER BY `'.$this->esc($orderby).'` '.($orderdir == 'ASC' ? 'ASC' : 'DESC');\n if ($num > 0) {\n $query .= ' LIMIT '.doubleval($start).', '.doubleval($num);\n }\n $qid = $this->query($query);\n while ($line = $this->assoc($qid)) {\n if (!$digest) {\n $line['reminders'] = array();\n $qid2 = $this->query('SELECT `id`,`time`,`mode`,`text`,`mailto`,`smsto` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$line['id'].' AND `ref`=\"evt\" ORDER BY `mode` DESC, `time` DESC');\n while ($line2 = $this->assoc($qid2)) { $line['reminders'][] = $line2; }\n $line['repetitions'] = array();\n $qid2 = $this->query('SELECT `id`,`type`,`repeat`,`extra`,`until`, IF (`until` IS NOT NULL, unix_timestamp(`until`), 0) `until_unix`'\n .' FROM '.$this->Tbl['cal_repetition'].' WHERE `eid`='.$line['id'].' AND `ref`=\"evt\" ORDER BY `id` ASC');\n while ($line2 = $this->assoc($qid2)) { $line['repetitions'][] = $line2; }\n\n $line['attendees'] = $this->get_event_attendees($line['id']);\n }\n $return[$line['id']] = $line;\n }\n return $return;\n }", "function getEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function date_has_events($date, $gid = 0)\n {\n if (is_array($date)) {\n $from = $this->esc($date[0]);\n $to = $this->esc($date[1]);\n } else {\n $date = $from = $to = $this->esc($date);\n }\n\n // Support for filtering out events from groups not included in result set according to query type\n $eventListFilter = $this->getQueryTypeFilter($gid);\n $gidFilter = $this->getGroupAndShareFilter($gid);\n\n $query = 'SELECT 1 FROM '.$this->Tbl['cal_repetition'].' rp, '.$this->Tbl['cal_event'].' e'\n .$eventListFilter[0]\n .' WHERE rp.`eid`=e.`id` AND rp.`ref`=\"evt\" AND ('.$gidFilter.')'.$eventListFilter[1]\n .' AND IF (rp.`type`!=\"-\", DATE_FORMAT(e.`starts`, \"%Y%m%d\") <= DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\"), 1)'\n .' AND IF (rp.`type`!=\"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until`>\"'.$date.'\", 1) AND ('\n // Begins or ends today\n .'DATE_FORMAT(starts, \"%Y%m%d\") = DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR DATE_FORMAT(e.ends, \"%Y%m%d\") = DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR '\n // Begins in the past AND ends in the future\n .'(DATE_FORMAT(starts, \"%Y%m%d\") <= DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") AND DATE_FORMAT(e.ends, \"%Y%m%d\") >= DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\")) OR '\n // Is an event occuring yearly. Todays date matches the repetition date\n .'(rp.`type`=\"year\" AND (DATE_FORMAT(e.starts, \"%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%m%d\") OR DATE_FORMAT(e.ends, \"%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%m%d\") ) ) OR '\n // A monthly event, repetition day is today\n .'(rp.`type`=\"month\" AND rp.`repeat` = DATE_FORMAT(\"'.$date.'\", \"%e\") AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) ) OR '\n // Monthly event on e.g. the 31st of month with months shorter than 31 days, this is only supported from MySQL 4.1.1 onward\n .'(rp.`type`=\"month\" AND rp.`repeat`=31 AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) AND LAST_DAY(\"'.$date.'\")=DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\") ) OR '\n // A weekly event, repetition weekday is today\n .'(rp.`type`=\"week\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%w\") AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, \"'.$date.'\")/7, rp.`extra`))=0) ) OR '\n // A \"daily\" event, where the bit pattern should match today's weekday\n .'(rp.`type`=\"day\" AND (rp.`repeat`=\"0\" OR SUBSTRING(LPAD(BIN(rp.`repeat`),8,0), IF(DATE_FORMAT(\"'.$date.'\", \"%w\")=0,8,DATE_FORMAT(\"'.$date.'\", \"%w\")+1), 1) = 1 ) )'\n .') LIMIT 1';\n list ($true) = $this->fetchrow($this->query($query));\n return (bool) $true;\n }", "function getUserWorkinggroups($user, $event)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n SELECT * FROM users_has_workinggroups\n INNER JOIN workinggroups_has_events on workinggroups_has_events.workinggroups_idworkinggroups = users_has_workinggroups.workinggroups_idworkinggroups\n\t\tINNER JOIN workinggroups on workinggroups.idWorkingGroups = users_has_workinggroups.WorkingGroups_idWorkingGroups \n WHERE users_has_workinggroups.users_idusers = ?\n AND workinggroups_has_events.Events_idEvents = ?'\n );\n $request->execute(array($user, $event));\n $result = $request->fetchAll();\n return $result;\n}", "public function date_get_eventlist($date, $gid = 0)\n {\n if (is_array($date)) {\n $from = $this->esc($date[0]);\n $to = $this->esc($date[1]);\n } else {\n $date = $from = $to = $this->esc($date);\n }\n // Support for filtering out events from groups not included in result set according to query type\n $eventListFilter = $this->getQueryTypeFilter($gid);\n $gidFilter = $this->getGroupAndShareFilter($gid);\n\n $return = array();\n $query = 'SELECT DISTINCT e.`id` '\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`starts`, \"%T\")) ), UNIX_TIMESTAMP(e.`starts`) ) as start'\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`ends`, \"%T\")) ), UNIX_TIMESTAMP(e.`ends`) ) as end'\n .',e.`starts`, e.`ends`, e.`location`, e.`title`, e.`description`, e.`type`, e.`status`, e.`opaque`, rp.`type` `repeat_type`, rp.`until` `repeat_until`'\n .',IF(fs.`val` IS NULL, \"\", fs.`val`) `colour`'\n .', (SELECT `mode` FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `eid`=e.`id` AND `ref`=\"evt\" LIMIT 1) `warn_mode`'\n .' FROM '.$this->Tbl['cal_repetition'].' rp, '.$this->Tbl['cal_event'].' e'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=e.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=e.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .$eventListFilter[0]\n .' WHERE rp.`eid`=e.`id` AND rp.`ref`=\"evt\" AND ('.$gidFilter.')'.$eventListFilter[1]\n .' AND IF (rp.`type`!=\"-\", DATE_FORMAT(e.`starts`, \"%Y%m%d\") <= DATE_FORMAT(\"'.$from.'\", \"%Y%m%d\"), 1)'\n .' AND IF (rp.`type`!=\"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until`>\"'.$to.'\",1) AND ('\n // Begins or ends today\n .'DATE_FORMAT(e.`starts`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR DATE_FORMAT(e.`ends`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR '\n // Begins in the past AND ends in the future\n .'( DATE_FORMAT(e.`starts`, \"%Y%m%d\")<=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") AND DATE_FORMAT(e.`ends`, \"%Y%m%d\")>=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") ) OR '\n // Is an event occuring yearly. Todays date matches the repetition date\n .'(rp.`type`=\"year\" AND (DATE_FORMAT(e.`starts`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%m%d\") OR DATE_FORMAT(e.`ends`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\",\"%m%d\"))) OR '\n // A monthly event, repetition day is today, repetition month is empty or matches\n .'(rp.`type`=\"month\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%e\") AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) ) OR '\n // Monthly event on e.g. the 31st of month with months shorter than 31 days, this is only supported from MySQL 4.1.1 onward\n .'(rp.`type`=\"month\" AND rp.`repeat`=31 AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) AND LAST_DAY(\"'.$date.'\")=DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"))'\n // A weekly event, repetition weekday is today\n .' OR (rp.`type`=\"week\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%w\") AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, \"'.$date.'\")/7, rp.`extra`))=0) ) OR '\n // A \"daily\" event, where the bit pattern should match today's weekday\n .'(rp.`type`=\"day\" AND (rp.`repeat`=\"0\" OR SUBSTRING(LPAD(BIN(rp.`repeat`), 8, 0), IF(DATE_FORMAT(\"'.$date.'\", \"%w\")=0, 8, DATE_FORMAT(\"'.$date.'\", \"%w\")+1), 1) = 1 ) )'\n .') ORDER BY `start` ASC';\n $qh = $this->query($query);\n while ($line = $this->assoc($qh)) {\n if ($line['warn_mode'] == '?') {\n $qid2 = $this->query('SELECT `mode` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$line['id'].' AND `ref`=\"evt\" AND `mode` != \"-\" LIMIT 1');\n list ($rem) = $this->fetchrow($qid2);\n $line['warn_mode'] = $rem ? $rem : '-';\n } elseif ($line['warn_mode'] == '' || is_null($line['warn_mode'])) {\n $line['warn_mode'] = '-';\n }\n $return[] = $line;\n }\n return $return;\n }", "function get_AllEvents(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT e.EventID, e.EventTitle, e.Event, e.EventDate, e.endTime, e.EventURL, e.DatePosted, e.Location\r\n FROM MYEVENTLOOKUP L\r\n LEFT JOIN MYEVENT e ON e.EventID = L.EventID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber\r\n ORDER BY e.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "public function testQueryEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getEvents();", "public function getEvents();", "function get_all_events(){\n global $database_ged;\n $events = array();\n $sql = \"SELECT id FROM nagios_queue_active\";\n $result = sql($database_ged, $sql);\n foreach($result as $row){\n array_push($events,$row[\"id\"].\":nagios\");\n }\n $result = null;\n $sql = \"SELECT id FROM snmptrap_queue_active\";\n $result = sql($database_ged, $sql);\n foreach($result as $row){\n array_push($events,$row[\"id\"].\":snmptrap\");\n }\n\n return $events;\n}", "public function groupCalendar($id){\n $groupId = Crypt::decrypt($id);\n $group = Group::findOrFail($groupId);\n // create event array\n $eventCollection = [];\n\n //create variable for user id\n $userid = \\Auth::user()->id;\n\n //fetch user events\n $events = DB::table('events')\n ->where('is_shared', '=', 1)\n ->get();\n\n $holidays = DB::table('holidays')->get();\n\n $repeatEvent = DB::table('repeat_event')\n ->where('is_shared', '=', 1)\n ->get();\n $group_events = GroupEvents::getGroupEvents($groupId)->get();\n\n //iterate all events where user id = logged in user then add them to the array\n foreach ($events as $event) {\n $eventCollection[] = Calendar::event(\n $event->event_title, //event title\n false,\n $event->time_start,\n $event->time_end,\n $event->id,\n [\n 'url' => 'event/'. Crypt::encrypt($event->id) ,\n 'color' => $event->color,\n ]\n );\n }\n foreach ($repeatEvent as $repeat) {\n $eventCollection[] = Calendar::event(\n $repeat->event_title,\n false,\n $repeat->time_start,\n $repeat->time_end,\n $repeat->id,\n [\n 'url' => 'groupRepeatEvent/'. Crypt::encrypt($repeat->id) ,\n 'color' => $repeat->color,\n ]\n );\n }\n foreach ($holidays as $holiday) {\n $eventCollection[] = Calendar::event(\n $holiday->event_title,\n true,\n $holiday->time_start,\n $holiday->time_end,\n $holiday->id,\n [\n 'color' => $holiday->color,\n ]\n );\n }\n foreach ($group_events as $grpEvent) {\n $eventCollection[] = Calendar::event(\n $grpEvent->event_title,\n false,\n $grpEvent->time_start,\n $grpEvent->time_end,\n $grpEvent->id,\n [\n 'url' => 'groupEvent/'. Crypt::encrypt($grpEvent->id) ,\n 'color' => $grpEvent->color,\n ]\n );\n }\n $calendar = Calendar::addEvents($eventCollection);\n return view('group.group-calendar', compact('calendar', 'group'));\n }", "public static function get_eid_list_group($gid) \n\t\t{\n\t\t\t$event_ids = array();\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('SELECT eid FROM group2event WHERE gid=? AND role>=? ORDER BY mtime DESC LIMIT 1000;');\n\t\t\t$role = Role::Admin;\n\t\t\t$stmt->bind_param('ii', $gid, $role);\n\t\t\t$stmt->execute();\n\t\t\t$result = $stmt->get_result();\n\t\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t\tarray_push($event_ids, $row['eid']);\n\t\t\t}\n\t\t\t$stmt->close();\n\t\t\treturn $event_ids;\n\t\t}", "function getEvents($date, $groupe){\n\t/*La date nous est donnée au format JJ-MM-AAAA*/\n\t$ex_date = explode('-', $date);\n\t$dateCherchee = new DateTime($ex_date[2].'-'.$ex_date[1].'-'.$ex_date[0]);\n\t\n try{\n\t\t$bdd = new PDO('mysql:host=localhost;dbname=trip_manager;charset=utf8', 'root', '');\n\t}catch (Exception $e){\n\t\tdie('Erreur : ' . $e->getMessage());\n\t}\n\t\n $eventListHTML = '';\n\n $result = $bdd->query(\"SELECT * FROM events WHERE groupe = '\".$groupe.\"' AND status = 1\");\n \n while($donnees = $result->fetch()){\n\t\tif($donnees['date'] !== ''){\n\t\t\t$ranges = explode('+', $donnees['date']);\n\t\t\tfor($i=0; $i<count($ranges); $i++){\n\t\t\t\t$dates = explode(';', $ranges[$i]);\n\t\t\t\t$date_debut = $dates[0];\n\t\t\t\t$date_fin = $dates[1];\n\t\t\t\t\n\t\t\t\t$start_date = new DateTime($date_debut);\n\t\t\t\t\n\t\t\t\t$end_date = new DateTime($date_fin);\n\t\t\t\t\n\t\t\t\tif(($start_date<=$dateCherchee) && ($end_date>= $dateCherchee)){\n\t\t\t\t\t$membre_id = str_replace(\"Disponibilité de \", \"\", $donnees['title']);\n\t\t\t\t\t\n\t\t\t\t\t$couleur = getColorS($groupe,$membre_id);\n\t\t\t\t\t\n\t\t\t\t\t$eventListHTML .= '<span class=\"color\" style=\"background-color: '.$couleur.';\"></span>';\n\t\t\t\t\tbreak 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n \n return $eventListHTML;\n}", "function get_events($start, $event_limit, $cond=array())\r\n\t{\r\n\t\t$c_filter = '';\r\n\t\tif (is_domain_user() == true) {\r\n\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t}\r\n\t\tif (valid_array($cond)) {\r\n\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t}\r\n\t\tif (is_app_user()) {\r\n\t\t\t$c_filter .= ' AND TL.created_by_id = '.intval($this->CI->entity_user_id);\r\n\t\t}\r\n\t\t$query = 'select TL.*, TLE.event_title, TLE.event_icon \r\n\t\t\t\tfrom timeline TL \r\n\t\t\t\tJOIN timeline_master_event TLE \r\n\t\t\t\twhere TL.event_origin=TLE.origin '.$c_filter.' order by TL.origin desc limit '.$start.','.$event_limit;\r\n\t\treturn $this->CI->db->query($query)->result_array();\r\n\t}", "public function SeeMyPageEvents($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT * \n FROM cp_user_has_group A, cp_event_has_group B\n JOIN cp_event C \n ON C.event_id = B.event_event_id \n WHERE A.user_user_id = :userID\n AND A.group_group_id = B.group_group_id \");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "public function events(\\App\\Group $group) {\n $monthly_upcoming_events = $group->getMonthlyUpcomingEvents();\n $monthly_past_events = $group->getMonthlyPastEvents();\n\n return view('groups.events', [\n 'group'=>$group,\n 'monthly_upcoming_events' => $monthly_upcoming_events,\n 'monthly_past_events' => $monthly_past_events\n ]);\n }", "public function SeeOneUserEvents($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT * \n FROM cp_user_has_group A, cp_event_has_group B\n JOIN cp_event C \n ON C.event_id = B.event_event_id \n WHERE A.user_user_id = :userID\n AND A.group_group_id = B.group_group_id \");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "function fetch_events($event_id=SELECT_ALL_EVENTS, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n\t\t$date_time_option=SELECT_DT_BOTH, $privacy=PRIVACY_ALL, $tag_name=NULL) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$ret_events= NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry {\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \"; \n\t\t// Set up event id selection\n\t\tif ($event_id != NULL AND $event_id != SELECT_ALL_EVENTS) {\n\t\t\t$where = $where . $sql_and . \" eID = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t$param_values [] = $event_id; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif (($sdate_time != NULL AND $sdate_time != MIN_DATE_TIME) OR\n\t\t\t\t($edate_time != NULL AND $edate_time != MAX_DATE_TIME)) {\n\t\t\t// Check and set up if need to compare both (start and end time) or just start or end time\n\t\t\t// Set up Start date\n\t\t\tif ($date_time_option == SELECT_DT_START) {\n\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Set up end date\n\t\t\t\tif ($date_time_option == SELECT_DT_END) {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) \";\n\t\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" ( (sdate_time BETWEEN ? AND ? )\"\n\t\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) )\";\n\t\t\t\t\t$param_types = $param_types . \"ssss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values,$sdate_time, $edate_time, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t\n\t\t// Set up privacy \n\t\tif ($privacy != NULL AND $privacy != PRIVACY_ALL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t//\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\t\t// build sqlstring \n\t\t$sqlString = \n\t\t \"SELECT * FROM events_all_v \"\n\t\t \t\t. $where .\n\t\t \" ORDER BY sdate_time, edate_time, eID\";\n\t\t// prepare statement\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t\t\t\n\t\t// bind parameters\n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\n\t\tif (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t// execute statement\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting events, event id: \" . $event_id .\n\t\t\" Date time: \" . $start_date_time . \" \" . $end_date_time .\n\t\t\" Date time option: \" . $date_time_option . \" privacy: \" . $privacy;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "public function testGetQueryGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public static function deleteGroupEvent($id){\n $query = GroupEvents::where('id', $id)->delete();\n return $query;\n }", "function getEvents(){\n \n $query = \"SELECT *\n FROM \" . $this->table_name . \"\n WHERE \n MONTH(date) = MONTH(NOW()) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 0, 12, MONTH(NOW()) - 1) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 13, 1, MONTH(NOW()) + 1) \n ORDER BY date DESC\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n \n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function selectEventsWithName($name)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE events.name LIKE :name ;\";\n return executeQuerySelect($query, createBinds([[\":name\", $name]]));\n}", "function fetch_user_events_by_email ($pass_email=NULL, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n \t\t $privacy=NULL, $role_ids=NULL, $tag_name=NULL) {\n \tglobal $cxn;\n \t// Initialize variables\n \t$ret_events=NULL;\n \t// Check and replace start date time and end date time\n \tif ($sdate_time == NULL ) {\n \t\t$sdate_time = MIN_DATE_TIME;\n \t} \n \tif ($edate_time == NULL ) {\n \t\t$edate_time = MAX_DATE_TIME;\n \t}\n\n \t$errArr=init_errArr(__FUNCTION__);\n \ttry\n\t{\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \";\n\t\t// Set email selection\n\t\tif ($pass_email != NULL) {\n\t\t\t$where = $where . $sql_and . \" email = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t$param_values [] = $pass_email; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif ($sdate_time != MIN_DATE_TIME OR $edate_time != MAX_DATE_TIME) {\n\t\t\t$where = $where . $sql_and .\n\t\t\t \" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t// Initialize parameter types and parameter values\n\t\t\t$param_types = $param_types . \"ss\";\n\t\t\tarray_push($param_values, $sdate_time, $edate_time);\n\t\t}\n\t\t// set up privacy\n\t\tif ($privacy != NULL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ?\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t// set up Role selection\n\t\tif ($role_ids != NULL and count($role_ids) > 0) {\n\t\t\t$where = $where . $sql_and . \" role_id IN (\";\n\t\t\t$first_element=TRUE;\n\t\t\tforeach ($role_ids as $rid) {\n\t\t\t\tif ($first_element) {\n\t\t\t\t\t$first_element = FALSE;\n\t\t\t\t\t$comma = \"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$comma = \",\";\n\t\t\t\t}\n\t\t\t\t$where = $where . $comma . \"?\";\n\t\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t\t$param_values [] = $rid; // add parameter value\n\t\t\t}\n\t\t\t$where = $where . \")\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\t\t\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\n\t\t// SQL String\n\t\t$sqlString = \"SELECT * \"\n\t\t\t \t. \" FROM users_events_dtl_v \"\n\t\t\t \t. $where . \n\t\t\t \t\" ORDER BY sdate_time, eID\";\t\t\n\t\t\t \t\n \t$stmt = $cxn->prepare($sqlString);\n\t\t// bind parameters \n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\t\t\n\t if (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code = 1;\n\t\t$err_descr = \"Error selecting user events for the email: \" . $pass_email . \" \" .\n\t\t\t\t$sdate_time . \" \" . $edate_time . \" \" .\n \t\t $privacy . \" \" . $role_ids . \" \" . $tag_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "function selectEventSpecific($name, $start, $end)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT * FROM events WHERE name LIKE :name AND start LIKE :start AND end LIKE :end LIMIT 1\";\n return executeQuerySelect($query, createBinds([[\":name\", $name], [\":start\", $start], [\":end\", $end]]))[0] ?? null;\n}", "function dbGetEvents()\r\n\t{\r\n\t\t//$sql = \"SELECT idEvents,NameEnglish, DateStart, DateEnd, countries.Country, Website FROM events inner join countries on events.Countries_idCountries = countries.idCountries ORDER BY DateStart\";\r\n\t\t\r\n\t\t$sql = \"SELECT p.id as idEvents, p.post_title as NameEnglish, \".\r\n\t\t\t\t\" e.post_id, e.country as Country, e.start as DateStart, e.end as DateEnd, e.contact_url as Website\".\r\n\t\t\t\t\" from wordpress.wp_posts p inner join wordpress.wp_ai1ec_events e on ( p.id = e.post_id)\".\r\n\t\t\t\t\" where post_type = \\\"ai1ec_event\\\" and post_status=\\\"publish\\\" order by DateStart;\";\r\n\t\t$result = $this->conn->query($sql);\r\n\t\treturn $result;\r\n\t}", "public function viewAllEvents();", "public function getevents()\n\t{\n\t$query = mysql_query(\"SELECT * from events ORDER BY eventid DESC\");\n $data_result = array();\n\t\t\tif($query)\n\t\t\t{\n\t\t\t\twhile ($row = mysql_fetch_array($query)) {\n\t\t\t\t\tarray_push($data_result, $row);\n\t\t\t\t}\n\t\t\t\treturn $data_result;\n\t\t\t\n\t\t\t\t\n\t\t\t} \n\t\t\n\t\telse\n\t\t{\n\t\t\t\n\t\t\treturn false;\n\t\t}\t\n \n\t}", "function block_ranking_get_points_evolution_by_group($groupid) {\n global $DB;\n\n $sql = \"SELECT\n rl.id, rl.points, rl.timecreated\n FROM {ranking_logs} rl\n INNER JOIN {ranking_points} rp ON rp.id = rl.rankingid\n INNER JOIN {groups_members} gm ON gm.userid = rp.userid\n INNER JOIN {groups} g ON g.id = gm.groupid\n WHERE g.id = :groupid AND rl.timecreated > :lastweek\";\n\n $lastweek = time() - (7 * 24 * 60 * 60);\n\n $params['groupid'] = $groupid;\n $params['lastweek'] = $lastweek;\n\n return array_values($DB->get_records_sql($sql, $params));\n}", "public function onItemgroup(){\n\t\t$sql = \"SELECT * FROM `itemgroup` WHERE `status` = 'ON'\";\n\t\t$query = $this->execute($sql);\n\t\tif($query){\n\t\t\treturn $query;\n\t\t}\n\t}", "function getCurrentEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime < CURRENT_DATE && event_complete != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function fetchGroupData() {}", "public function fetchGroupData() {}", "public function getEvents(array $filters = array());", "function getWorkinggroups($idEvent){\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n SELECT workinggroups.idWorkinggroups, workinggroups.Title, Cost \n FROM bdd_satisfevent.WorkingGroups_has_Events \n INNER JOIN bdd_satisfevent.WorkingGroups \n ON WorkingGroups_has_Events.WorkingGroups_idWorkingGroups = WorkingGroups.idWorkingGroups \n WHERE workinggroups_has_events.Events_idEvents = ?');\n $request->execute(array($idEvent));\n $result = $request->fetchAll();\n return $result;\n}", "function agenda_get_item_list($course_id, $user_id, $user_group_list, $order='DESC')\n\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t event.master_event_id\t\t\tAS master_event_id,\n\t\t\t\t rel_event_recipient.user_id\t \tAS user_id,\n\t\t\t\t rel_event_recipient.group_id \tAS group_id,\n\t\t\t\t rel_event_recipient.visibility \tAS visibility\n\t\tFROM \" . $tbl . \"\n\t\tWHERE \t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id = \" . (int) $user_id .\")\n\t\t\tOR\n\t\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\tAND rel_event_recipient.group_id is NULL)\";\n\t\tforeach($user_group_list as $this_group)\n\t\t{\n\t\t\t$sql .=\" OR\n\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\tAND rel_event_recipient.group_id = \". (int) $this_group .\")\";\n\t\t}\n\n\n\t\t$sql .=\"ORDER BY event.start_date \" . ('DESC' == $order?'DESC':'ASC');\n\n\treturn claro_sql_query_fetch_all($sql);\n}", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_group\n\t\t\t\tWHERE gru_id=?\";\n\t\t$query = $this->db->query($sql, array($this->gru_id));\n\t\treturn $query;\n\t}", "public function testQueryGroupCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getEvents()\n {\n\n $cached = $this->getFromCache('events_cache');\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch past and future events (only upcoming contains the current event)\n $events = $this->client->getEvents(\n array(\n 'group_urlname' => $this->group,\n 'status' => 'past,upcoming',\n 'desc' => 'desc'\n )\n );\n\n // Filter out events further in the future than a day\n $dayFromNow = (time() + (24 * 60 * 60)) * 1000;\n $events = $events->filter(function($value) use ($dayFromNow) {\n return ($value['time'] < $dayFromNow)? true : false;\n });\n\n $this->saveInCache('events_cache', $events);\n\n return $events;\n }", "public function getQueryGroupby() {\n // SubmittedOn is stored in the artifact\n return 'a.submitted_on';\n }", "public function testQueryRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function get_alertable_events($min = 5, $allusers = false, $onlyexternal = false)\n {\n // $date = date('Y-m-d');\n $return = array();\n $userfilter = ($allusers != false) ? '' : ' AND ('.$this->getGroupAndShareFilter().')';\n $alertfilter = ($onlyexternal) ? ' AND (rm.`mailto` != \"\" OR rm.`smsto` != \"\")' : '';\n\n $query = 'SELECT\n DISTINCT e.`id`, e.`uuid`, rm.`id` `reminder_id`, rm.`text` `reminder`, rm.mailto, rm.smsto, e.uid, e.title, e.description, e.location\n ,IF (rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.starts, \"%T\")) ), UNIX_TIMESTAMP(e.starts) ) `start`\n ,IF (rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.ends, \"%T\")) ), UNIX_TIMESTAMP(e.ends) ) `end`\n ,IF\n (UNIX_TIMESTAMP(rm.snooze) != 0\n ,UNIX_TIMESTAMP(rm.snooze)\n ,IF\n (rm.mode = \"s\"\n ,UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.starts, \"%T\")), INTERVAL rm.`time` SECOND))\n ,UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.ends, \"%T\")), INTERVAL rm.`time` SECOND))\n )\n ) `warntime`\nFROM\n '.$this->Tbl['cal_event'].' e\n ,'.$this->Tbl['cal_reminder'].' rm\n ,'.$this->Tbl['cal_repetition'].' rp\nWHERE e.`archived`=\"0\" AND e.`id` = rm.`eid` AND rm.`ref` = \"evt\" AND e.id = rp.eid AND rp.`ref` = \"evt\" AND rm.mode != \"-\"'.$userfilter.$alertfilter.'\n /* Dont alert cancelled events */\n AND `e`.`status` != 3\n /* Nonrepeated events get selected when they were not alerted yet or their warn_snooze is later than now */\n AND IF (rp.`type` = \"-\" AND rm.lastinfo != 0 AND rm.`snooze` < NOW(), 0, 1)\n AND IF (rp.`type` != \"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until` > NOW(), 1)\n AND\n (\n /* A rescheduled alert */\n IF (UNIX_TIMESTAMP(rm.`snooze`) > 0 AND UNIX_TIMESTAMP(rm.`snooze`)-'.($min * 60).' < UNIX_TIMESTAMP(NOW()), 1, 0)\n OR\n (\n rp.`type` = \"-\"\n AND\n IF\n (rm.`mode` = \"s\"\n , e.starts > NOW() AND rm.lastinfo != e.starts AND DATE_SUB(e.starts, INTERVAL rm.`time` + '.($min * 60).' SECOND) < NOW()\n , e.ends > NOW() AND rm.lastinfo != e.ends AND DATE_SUB(e.ends, INTERVAL rm.`time` + '.($min * 60).' SECOND) < NOW()\n )\n )\n OR\n /* Yearly event */\n (\n rp.`type` = \"year\"\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y\") != DATE_FORMAT(NOW(), \"%Y\")\n AND\n IF\n (rm.`mode` = \"s\"\n ,CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`starts`, \"%m-%d %T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`starts`, \"%m-%d %T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n ,CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`ends`, \"%m-%d %T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`ends`, \"%m-%d %T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n )\n )\n OR\n /* Monthly event */\n (\n rp.`type` = \"month\"\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y%m\") != DATE_FORMAT(NOW(), \"%Y%m\")\n AND\n (\n rp.`extra` = \"\"\n OR\n FIND_IN_SET(DATE_FORMAT(NOW(), \"%c\"), rp.`extra`) > 0\n )\n AND\n IF\n (rm.`mode` = \"s\"\n ,CONCAT(DATE_FORMAT(NOW(),\"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`starts`, \"%T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`starts`, \"%T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n ,CONCAT(DATE_FORMAT(NOW(),\"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`ends`, \"%T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`ends`, \"%T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n )\n )\n OR\n /* Monthly event on e.g. the 31st of month with months shorter than 31 days, will only work with alerts set for the same day */\n (\n LAST_DAY(NOW()) = CURDATE()\n AND\n rp.`type` = \"month\"\n AND\n rp.`repeat` = 31\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y%m\") != DATE_FORMAT(NOW(), \"%Y%m\")\n AND\n (\n rp.`extra` = \"\"\n OR\n FIND_IN_SET(DATE_FORMAT(NOW(), \"%c\"), rp.`extra`) > 0\n )\n AND\n IF\n (rm.`mode` = \"s\"\n ,DATE_FORMAT(e.`starts`, \"%d%H%i%s\") > DATE_FORMAT(LAST_DAY(NOW()), \"%d%H%i%s\")\n AND DATE_FORMAT(UNIX_TIMESTAMP(e.`starts`) - (rm.`time` + '.($min * 60).'), \"%H%i%s\") < DATE_FORMAT(NOW(), \"%H%i%s\")\n ,DATE_FORMAT(e.`ends`, \"%d%H%i%s\") > DATE_FORMAT(LAST_DAY(NOW()), \"%d%H%i%s\")\n AND DATE_FORMAT(UNIX_TIMESTAMP(e.`ends`) - (rm.`time` + '.($min * 60).'), \"%H%i%s\") < DATE_FORMAT(NOW(), \"%H%i%s\")\n )\n )\n OR\n /* Weekly event */\n (\n rp.`type` = \"week\"\n AND\n (UNIX_TIMESTAMP(rm.lastinfo) = 0 OR DATE_FORMAT(rm.`lastinfo`, \"%Y%m%d\") != DATE_FORMAT(NOW(), \"%Y%m%d\"))\n AND\n IF\n (rm.`mode`=\"s\"\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w%H%i\") >= DATE_FORMAT(e.`starts`, \"%w%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%w%H%i\") <= DATE_FORMAT(e.`starts`, \"%w%H%i\")\n AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, NOW()) / 7, rp.`extra`)) = 0)\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w%H%i\") >= DATE_FORMAT(e.`ends`, \"%w%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%w%H%i\") <= DATE_FORMAT(e.`ends`, \"%w%H%i\")\n AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`ends`, NOW()) / 7, rp.`extra`)) = 0)\n )\n )\n OR\n /* \"Daily\" event, where the bit pattern should match today\\'s weekday */\n (\n rp.`type` = \"day\"\n AND\n (UNIX_TIMESTAMP(rm.lastinfo) = 0 OR DATE_FORMAT(rm.`lastinfo`, \"%Y%m%d\") != DATE_FORMAT(NOW(), \"%Y%m%d\"))\n AND\n (rp.`repeat`=\"0\"\n OR\n SUBSTRING(LPAD(BIN(rp.`repeat`), 8, 0), IF(DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w\") = 0, 8, DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w\")), 1) = 1\n )\n AND\n IF\n (rm.`mode`=\"s\"\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%H%i\") >= DATE_FORMAT(e.`starts`, \"%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%H%i\") <= DATE_FORMAT(e.`starts`, \"%H%i\")\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%H%i\") >= DATE_FORMAT(e.`ends`, \"%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%H%i\") <= DATE_FORMAT(e.`ends`, \"%H%i\")\n )\n )\n )\nORDER BY `warntime` ASC';\n\n // echo $query.LF;\n\n $qid = $this->query($query);\n if (false === $qid) {\n $error = $this->error();\n if ($error && function_exists('vecho')) {\n error_log($error);\n vecho($error);\n\n }\n return array();\n }\n while ($line = $this->assoc($qid)) {\n $return[$line['id']] = array\n ('warn_time' => $line['warntime'], 'mailto' => $line['mailto']\n ,'smsto' => $line['smsto'], 'uid' => $line['uid']\n ,'title' => $line['title'], 'description' => $line['description']\n ,'location' => $line['location'], 'starts' => $line['start'], 'ends' => $line['end']\n ,'reminder' => $line['reminder'], 'reminder_id' => $line['reminder_id']\n );\n }\n // print_r($return);\n return $return;\n }", "public function get_events($args = [])\n {\n global $db, $system;\n /* initialize arguments */\n $user_id = !isset($args['user_id']) ? null : $args['user_id'];\n $offset = !isset($args['offset']) ? 0 : $args['offset'];\n $get_all = !isset($args['get_all']) ? false : true;\n $suggested = !isset($args['suggested']) ? false : true;\n $random = !isset($args['random']) ? false : true;\n $managed = !isset($args['managed']) ? false : true;\n $filter = !isset($args['filter']) ? \"admin\" : $args['filter'];\n $results = !isset($args['results']) ? $system['max_results_even'] : $args['results'];\n /* initialize vars */\n $events = [];\n $offset *= $results;\n /* get suggested events */\n if ($suggested) {\n $where_statement = \"\";\n /* make a list from joined events */\n $events_ids = $this->get_events_ids();\n if ($events_ids) {\n $events_list = implode(',', $events_ids);\n $where_statement .= \"AND event_id NOT IN (\" . $events_list . \") \";\n }\n $sort_statement = ($random) ? \" ORDER BY RAND() \" : \" ORDER BY event_id DESC \";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(\"SELECT * FROM `events` WHERE event_privacy != 'secret' \" . $where_statement . $sort_statement . $limit_statement) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"taget\" all events who admin */\n } elseif ($managed) {\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"viewer\" events who (going|interested|invited|admin) */\n } elseif ($user_id == null) {\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n switch ($filter) {\n case 'going':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_going = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'interested':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_interested = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'invited':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_invited = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n default:\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n /* get the \"target\" events */\n } else {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_events FROM users WHERE user_id = %s\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_events'], $user_id)) {\n return $events;\n }\n /* if the viewer not the target exclude secret groups */\n $where_statement = ($this->_data['user_id'] == $user_id) ? \"\" : \"AND `events`.event_privacy != 'secret'\";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE (events_members.is_going = '1' OR events_members.is_interested = '1') AND events_members.user_id = %s \" . $where_statement . \" ORDER BY event_id DESC \" . $limit_statement, secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_events->num_rows > 0) {\n while ($event = $get_events->fetch_assoc()) {\n $event['event_picture'] = get_picture($event['event_cover'], 'event');\n /* check if the viewer joined the event */\n $event['i_joined'] = $this->check_event_membership($this->_data['user_id'], $event['event_id']);;\n $events[] = $event;\n }\n }\n return $events;\n }", "public function getAllEvents() {\n\n $stmt = $this->conn->prepare(\"SELECT * FROM events\");\n\n\n\n if ($stmt->execute()) {\n $events = $stmt->get_result();\n $stmt->close();\n return $events;\n } else {\n return NULL;\n }\n }", "public function listEvents()\n\t{\n\n\t\t$table=CaseItemModel::getInstance()->getTable();\n $pTable=ProcessModel::getInstance()->getTable();\n $piTable=ProcessItemModel::getInstance()->getTable();\n \n\t\t$status =\"status not in ('Complete','Terminated') \";\n \n\t\t$sql=\"select 'Case Item' as source,id,null as processName, processNodeId,caseId,type,subType,label,timer,timerDue,message,signalName \"\n . \" from $table \"\n . \" where $status\"\n .\" and subType in('timer','message','signal')\";\n\t\t$arr1= $this->db->select($sql);\n\n\t\t$sql=\"select 'Process Item' as source ,p.processName as processName, pi.id as id,pi.processNodeId,null as caseId,pi.type,subType,label,timer,timerDue,message,signalName \"\n . \" from $piTable pi\n join $pTable p on p.processId=pi.processId\n where subType in('timer','message','signal')\";\n \n \n\t\t$arr2= $this->db->select($sql);\n\t\t$results= array_merge($arr1,$arr2);\n\n\t\treturn $results;\n\t}", "public function listAllQuery() {\n \n $dql = \"select e\n from Vibby\\Bundle\\BookingBundle\\Entity\\Event e\n order by e.date_from\n \";\n\n return $this->getEntityManager()->createQuery($dql);\n \n }", "function theme_intranet_haarlem_search_events($options = array()){\n\t$defaults = array(\t'past_events' \t\t=> false,\n\t\t\t\t\t\t'count' \t\t\t=> false,\n\t\t\t\t\t\t'offset' \t\t\t=> 0,\n\t\t\t\t\t\t'limit'\t\t\t\t=> EVENT_MANAGER_SEARCH_LIST_LIMIT,\n\t\t\t\t\t\t'container_guid'\t=> null,\n\t\t\t\t\t\t'query'\t\t\t\t=> false,\n\t\t\t\t\t\t'meattending'\t\t=> false,\n\t\t\t\t\t\t'owning'\t\t\t=> false,\n\t\t\t\t\t\t'friendsattending' \t=> false,\n\t\t\t\t\t\t'region'\t\t\t=> null,\n\t\t\t\t\t\t'latitude'\t\t\t=> null,\n\t\t\t\t\t\t'longitude'\t\t\t=> null,\n\t\t\t\t\t\t'distance'\t\t\t=> null,\n\t\t\t\t\t\t'event_type'\t\t=> false,\n\t\t\t\t\t\t'past_events'\t\t=> false,\n\t\t\t\t\t\t'search_type'\t\t=> \"list\"\n\t\t\t\t\t\t\n\t);\n\t\n\t$options = array_merge($defaults, $options);\n\t\n\t$entities_options = array(\n\t\t'type' \t\t\t=> 'object',\n\t\t'subtype' \t\t=> 'event',\n\t\t'offset' \t\t=> $options['offset'],\n\t\t'limit' \t\t=> $options['limit'],\n\t\t'joins' => array(),\n\t\t'wheres' => array(),\n\t\t'order_by_metadata' => array(\"name\" => 'start_day', \"direction\" => 'ASC', \"as\" => \"integer\")\n\t);\n\t\n\tif (isset($options['entities_options'])) {\n\t\t$entities_options = array_merge($entities_options, $options['entities_options']);\n\t}\n\t\n\tif($options[\"container_guid\"]){\n\t\t// limit for a group\n\t\t$entities_options['container_guid'] = $options['container_guid'];\n\t}\n\t\n\tif($options['query']) {\n\t\t$entities_options[\"joins\"][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"objects_entity oe ON e.guid = oe.guid\";\n\t\t$entities_options['wheres'][] = event_manager_search_get_where_sql('oe', array('title', 'description'), $options, false);\n\t}\n\t\t\t\t\n\tif(!empty($options['start_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['start_day'], 'operand' => '>=');\n\t}\n\t\n\tif(!empty($options['end_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['end_day'], 'operand' => '<=');\n\t}\n\t\n\tif(!$options['past_events']) {\n\t\t// only show from current day or newer\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => mktime(0, 0, 1), 'operand' => '>=');\n\t}\n\t\n\tif($options['meattending']) {\n\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_r ON e.guid = e_r.guid_one\";\n\t\t\n\t\t$entities_options['wheres'][] = \"e_r.guid_two = \" . elgg_get_logged_in_user_guid();\n\t\t$entities_options['wheres'][] = \"e_r.relationship = '\" . EVENT_MANAGER_RELATION_ATTENDING . \"'\";\n\t}\n\t\n\tif($options['owning']) {\n\t\t$entities_options['owner_guids'] = array(elgg_get_logged_in_user_guid());\n\t}\n\t\n\tif($options[\"region\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'region', 'value' => $options[\"region\"]);\n\t}\n\t\n\tif($options[\"event_type\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'event_type', 'value' => $options[\"event_type\"]);\n\t}\n\t\n\tif($options['friendsattending']){\n\t\t$friends_guids = array();\n\t\t\n\t\tif($friends = elgg_get_logged_in_user_entity()->getFriends(\"\", false)) {\n\t\t\tforeach($friends as $user) {\n\t\t\t\t$friends_guids[] = $user->getGUID();\n\t\t\t}\n\t\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_ra ON e.guid = e_ra.guid_one\";\n\t\t\t$entities_options['wheres'][] = \"(e_ra.guid_two IN (\" . implode(\", \", $friends_guids) . \"))\";\n\t\t} else\t{\n\t\t\t// return no result\n\t\t\t$entities_options['joins'] = array();\n\t\t\t$entities_options['wheres'] = array(\"(1=0)\");\n\t\t}\n\t}\n\t\n\tif(($options[\"search_type\"] == \"onthemap\") && !empty($options['latitude']) && !empty($options['longitude']) && !empty($options['distance'])){\n\t\t$entities_options[\"latitude\"] = $options['latitude'];\n\t\t$entities_options[\"longitude\"] = $options['longitude'];\n\t\t$entities_options[\"distance\"] = $options['distance'];\n\t\t$entities = elgg_get_entities_from_location($entities_options);\n\t\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_location($entities_options);\n\t\t\n\t} else {\n\t\t\n\t\t$entities = elgg_get_entities_from_metadata($entities_options);\n\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_metadata($entities_options);\n\t}\n\t\n\t$result = array(\n\t\t\"entities\" \t=> $entities,\n\t\t\"count\" \t=> $count_entities\n\t\t);\n\t\t\n\treturn $result;\n}", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "protected function getStatQueryEvents()\n\t{\n\t\tif (is_object($this->statQueryEvents))\n\t\t{\n\t\t\treturn $this->statQueryEvents;\n\t\t}\n\n\t\t$db\t= $this->getDbo();\n\n\t\t// Compose subquery for statistics of totals\n\t\t$queryTotals = $db->getQuery(true)\n\t\t\t->select($db->quoteName('id_project', 'id'))\n\t\t\t->select(Helper::COMMON_STATE_TOTAL . ' AS state')\n\t\t\t->select('COUNT(*) AS events, SUM(duration) AS events_duration'\n\t\t\t)\n\t\t\t->from($db->quoteName(Helper::getTableName('events')))\n\t\t\t->group($db->quoteName('id_project'));\n\n\t\t// Compose subquery for statistics of states distribution\n\t\t$this->statQueryEvents = $db->getQuery(true)\n\t\t\t->select($db->quoteName('id_project', 'id'))\n\t\t\t->select($db->quoteName('state'))\n\t\t\t->select('COUNT(*) AS events, SUM(duration) AS events_duration'\n\t\t\t)\n\t\t\t->from($db->quoteName(Helper::getTableName('events')))\n\t\t\t->group($db->quoteName('id_project'))\n\t\t\t->group($db->quoteName('state'))\n\t\t\t->union($queryTotals);\n\n\t\treturn $this->statQueryEvents;\n\t}", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "function selectAllEvents($date){\n\n\n $selectAllEventsQuery=\"SELECT * FROM events WHERE date ='$date'\";\n \trequire_once 'model/dbConnector.php';\n\n \t$result = executeQuerySelect($selectAllEventsQuery);\n\n return $result;\n}", "public static function get_calendar_events($scope = \"month\", $startdate = null, $enddate = null, $user_id = NULL) {\r\n global $uid;\r\n\r\n if (is_null($user_id)) {\r\n $user_id = $uid;\r\n }\r\n\r\n //form date range condition\r\n $dateconditions = array(\"month\" => \"date_format(?t\".',\"%Y-%m\") = date_format(start,\"%Y-%m\")',\r\n \"week\" => \"YEARWEEK(?t,1) = YEARWEEK(start,1)\",\r\n \"day\" => \"date_format(?t\".',\"%Y-%m-%d\") = date_format(start,\"%Y-%m-%d\")');\r\n if (!is_null($startdate) && !is_null($enddate)) {\r\n $datecond = \" AND start >= ?t AND start <= ?t\";\r\n } elseif (!is_null($startdate)) {\r\n $datecond = \" AND \";\r\n $datecond .= (array_key_exists($scope, $dateconditions))? $dateconditions[$scope]:$dateconditions[\"month\"];\r\n } else {\r\n $datecond = \"\";\r\n }\r\n $student_groups = array_map(function ($item) {\r\n return $item->group_id;\r\n }, Database::get()->queryArray('SELECT group_id\r\n FROM group_members, `group`\r\n WHERE group_id = `group`.id AND user_id = ?d', $uid));\r\n if (count($student_groups)) {\r\n $group_sql_template = 'OR group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n $group_sql_template2 = 'AND group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n } else {\r\n $group_sql_template = '';\r\n $group_sql_template2 = '';\r\n }\r\n //retrieve events from various tables according to user preferences on what type of events to show\r\n $q = '';\r\n $q_args = array();\r\n $q_args_templ = array($user_id);\r\n if (!is_null($startdate)) {\r\n $q_args_templ[] = $startdate;\r\n }\r\n if (!is_null($enddate)) {\r\n $q_args_templ[] = $enddate;\r\n }\r\n\r\n if (isset($uid)) {\r\n Calendar_Events::get_calendar_settings();\r\n if (Calendar_Events::$calsettings->show_personal == 1) {\r\n $dc = str_replace('start', 'pc.start', $datecond);\r\n $q .= \"SELECT id, title, start, date_format(start,'%Y-%m-%d') startdate, duration, date_format(addtime(start, time(duration)), '%Y-%m-%d %H:%i') `end`, content, 'personal' event_group, 'event-special' class, 'personal' event_type, null as course FROM personal_calendar pc \"\r\n . \"WHERE user_id = ?d \" . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n }\r\n if (Calendar_Events::$calsettings->show_admin == 1) {\r\n //admin\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'adm.start', $datecond);\r\n $q .= \"SELECT id, title, start, date_format(start, '%Y-%m-%d') startdate, duration, date_format(addtime(start, time(duration)), '%Y-%m-%d %H:%i') `end`, content, 'admin' event_group, 'event-success' class, 'admin' event_type, null as course FROM admin_calendar adm \"\r\n . \"WHERE visibility_level >= ?d \" . $dc;\r\n $q_admin_events_args = $q_args_templ;\r\n $q_admin_events_args[0] = Calendar_Events::get_user_visibility_level();\r\n $q_args = array_merge($q_args, $q_admin_events_args);\r\n }\r\n if (Calendar_Events::$calsettings->show_course == 1) {\r\n // agenda\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ag.start', $datecond);\r\n $q .= \"SELECT ag.id, CONCAT(c.title,': ',ag.title), ag.start, date_format(ag.start,'%Y-%m-%d') startdate, ag.duration, date_format(addtime(ag.start, time(ag.duration)), '%Y-%m-%d %H:%i') `end`, content, 'course' event_group, 'event-info' class, 'agenda' event_type, c.code course \"\r\n . \"FROM agenda ag JOIN course_user cu ON ag.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id \"\r\n . \"JOIN course_module cm ON c.id=cm.course_id \"\r\n . \"WHERE cu.user_id = ?d \"\r\n . \"AND ag.visible = 1 \"\r\n . \"AND cm.module_id = \" . MODULE_ID_AGENDA . \" \"\r\n . \"AND cm.visible = 1 \"\r\n . \"AND c.visible != \" . COURSE_INACTIVE . \" \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n // BigBlueButton\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'tc.start_date', $datecond);\r\n $q .= \"SELECT tc.id, CONCAT(c.title,': ',tc.title), tc.start_date start, date_format(tc.start_date,'%Y-%m-%d') startdate, '00:00' duration, date_format(tc.start_date, '%Y-%m-%d %H:%i') `end`, tc.description content, 'course' event_group, 'event-info' class, 'teleconference' event_type, c.code course \"\r\n . \"FROM tc_session tc JOIN course_user cu ON tc.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id \"\r\n . \"WHERE cu.user_id = ?d AND tc.active = '1' AND c.visible != \" . COURSE_INACTIVE . \" \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n // requests\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'rfd.data', $datecond);\r\n $q .= \"SELECT req.id, concat(c.title, ?s, req.title), concat(rfd.data, ' 08:00:00') start, rfd.data startdate, '00:00' duration, concat(rfd.data, ' 08:00:01') `end`, concat(req.description, '\\n', '(deadline: ', rfd.data, ')') content, 'course' event_group, 'event-info' class, 'request' event_type, c.code course \"\r\n . \"FROM request req JOIN course c ON req.course_id = c.id\r\n JOIN request_field_data rfd ON rfd.request_id = req.id\r\n JOIN request_field rf ON rf.id = rfd.field_id\r\n LEFT JOIN request_watcher rw ON req.id = rw.request_id\r\n WHERE req.state NOT IN (?d, ?d)\r\n AND (req.creator_id = ?d OR rw.user_id = ?d) \"\r\n . $dc;\r\n $q_args = array_merge($q_args, [': ' . trans('langSingleRequest') . ': ',\r\n REQUEST_STATE_LOCKED, REQUEST_STATE_CLOSED, $uid], $q_args_templ);\r\n }\r\n if (Calendar_Events::$calsettings->show_deadline == 1) {\r\n // assignments\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n\r\n $dc = str_replace('start', 'ass.deadline', $datecond);\r\n $q .= \"SELECT ass.id, CONCAT(c.title,': ',ass.title), ass.deadline start, date_format(ass.deadline,'%Y-%m-%d') startdate, '00:00' duration, date_format(ass.deadline, '%Y-%m-%d %H:%i') `end`, concat(ass.description,'\\n','(deadline: ',deadline,')') content, 'deadline' event_group, 'event-important' class, 'assignment' event_type, c.code course \"\r\n . \"FROM assignment ass JOIN course_user cu ON ass.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id LEFT JOIN assignment_to_specific ass_sp ON ass.id=ass_sp.assignment_id \"\r\n . \"WHERE cu.user_id = ?d \" . $dc\r\n . \"AND (assign_to_specific = 0 OR\r\n ass.id IN\r\n (SELECT assignment_id FROM assignment_to_specific WHERE user_id = ?d\r\n UNION\r\n SELECT assignment_id FROM assignment_to_specific\r\n WHERE group_id != 0 $group_sql_template2)\r\n OR cu.status = 1) \"\r\n . \"AND ass.active = 1 AND c.visible != \" . COURSE_INACTIVE . \" \";\r\n $q_args = array_merge($q_args, $q_args_templ, array($user_id), $student_groups);\r\n\r\n // exercises\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ex.end_date', $datecond);\r\n $q .= \"SELECT ex.id, CONCAT(c.title,': ',ex.title), ex.end_date start, date_format(ex.end_date,'%Y-%m-%d') startdate, '00:00' duration, date_format(addtime(ex.end_date, time('00:00')), '%Y-%m-%d %H:%i') `end`, concat(ex.description,'\\n','(deadline: ',ex.end_date,')') content, 'deadline' event_group, 'event-important' class, 'exercise' event_type, c.code course \"\r\n . \"FROM exercise ex JOIN course_user cu ON ex.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id LEFT JOIN exercise_to_specific ex_sp ON ex.id = ex_sp.exercise_id \"\r\n . \"WHERE cu.user_id = ?d \" . $dc\r\n . \"AND ex.public = 1 AND ex.active = 1 AND (assign_to_specific = 0 OR ex_sp.user_id = ?d $group_sql_template) AND c.visible != \" . COURSE_INACTIVE . \" \";\r\n $q_args = array_merge($q_args, $q_args_templ, array($user_id), $student_groups);\r\n }\r\n }\r\n if (empty($q)) {\r\n return null;\r\n }\r\n $q .= \" ORDER BY start, event_type\";\r\n return Database::get()->queryArray($q, $q_args);\r\n }", "private function _get_event_entries()\n\t{\n\t\t// --------------------------------------\n\t\t// Default status to open\n\t\t// --------------------------------------\n\n\t\tif ( ! $this->EE->TMPL->fetch_param('status'))\n\t\t{\n\t\t\t$this->EE->TMPL->tagparams['status'] = 'open';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Start composing query\n\t\t// --------------------------------------\n\n\t\t$this->EE->db->select($this->model->entry_attributes('e.'))\n\t\t ->from($this->model->table(). ' e')\n\t\t ->join('channel_titles t', 'e.entry_id = t.entry_id')\n\t\t ->where_in('t.site_id', $this->EE->TMPL->site_ids);\n\n\t\t// --------------------------------------\n\t\t// Apply simple filters\n\t\t// --------------------------------------\n\n\t\t$filters = array(\n\t\t\t'entry_id' => 't.entry_id',\n\t\t\t'url_title' => 't.url_title',\n\t\t\t'channel_id' => 't.channel_id',\n\t\t\t'author_id' => 't.author_id',\n\t\t\t'status' => 't.status'\n\t\t);\n\n\t\tforeach ($filters AS $param => $attr)\n\t\t{\n\t\t\t$this->_simple_filter($param, $attr);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by events field, prefixed\n\t\t// --------------------------------------\n\n\t\t$this->_event_field_filter('e');\n\n\t\t// --------------------------------------\n\t\t// Are we getting all events or just upcoming\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_passed') == 'no')\n\t\t{\n\t\t\t$this->EE->db->where('e.end_date >=', $this->today);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by channel name\n\t\t// --------------------------------------\n\n\t\tif ($channel = $this->EE->TMPL->fetch_param('channel'))\n\t\t{\n\t\t\t// Determine which channels to filter by\n\t\t\tlist($channel, $in) = low_explode_param($channel);\n\n\t\t\t// Adjust query accordingly\n\t\t\t$this->EE->db->join('channels c', 'c.channel_id = t.channel_id');\n\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('c.channel_name', $channel);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by category\n\t\t// --------------------------------------\n\n\t\tif ($categories_param = $this->EE->TMPL->fetch_param('category'))\n\t\t{\n\t\t\t// Determine which categories to filter by\n\t\t\tlist($categories, $in) = low_explode_param($categories_param);\n\n\t\t\t// Allow for inclusive list: category=\"1&2&3\"\n\t\t\tif (strpos($categories_param, '&'))\n\t\t\t{\n\t\t\t\t// Execute query the old-fashioned way, so we don't interfere with active record\n\t\t\t\t// Get the entry ids that have all given categories assigned\n\t\t\t\t$query = $this->EE->db->query(\n\t\t\t\t\t\"SELECT entry_id, COUNT(*) AS num\n\t\t\t\t\tFROM exp_category_posts\n\t\t\t\t\tWHERE cat_id IN (\".implode(',', $categories).\")\n\t\t\t\t\tGROUP BY entry_id HAVING num = \". count($categories));\n\n\t\t\t\t// If no entries are found, make sure we limit the query accordingly\n\t\t\t\tif ( ! ($entry_ids = low_flatten_results($query->result_array(), 'entry_id')))\n\t\t\t\t{\n\t\t\t\t\t$entry_ids = array(0);\n\t\t\t\t}\n\n\t\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('t.entry_id', $entry_ids);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Join category table\n\t\t\t\t$this->EE->db->join('category_posts cp', 'cp.entry_id = t.entry_id');\n\t\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('cp.cat_id', $categories);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Hide expired entries\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_expired', 'no') != 'yes')\n\t\t{\n\t\t\t$this->EE->db->where('(t.expiration_date = 0 OR t.expiration_date >= '.$this->date->now().')');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Hide future entries\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_future_entries', 'no') != 'yes')\n\t\t{\n\t\t\t$this->EE->db->where('t.entry_date <=', $this->date->now());\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Handle search fields\n\t\t// --------------------------------------\n\n\t\tif ($search_fields = $this->_search_where($this->EE->TMPL->search_fields, 'd.'))\n\t\t{\n\t\t\t// Join exp_channel_data table\n\t\t\t$this->EE->db->join('channel_data d', 't.entry_id = d.entry_id');\n\t\t\t$this->EE->db->where(implode(' AND ', $search_fields), NULL, FALSE);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Return the results\n\t\t// --------------------------------------\n\n\t\treturn $this->EE->db->get()->result_array();\n\t}", "public function getDataByQuery($query){\r\n \r\n $mmtrend_group = DB::connection(DBUtils::getDBName())->select($query);\r\n //$mmtrend_group = DB::connection('mysql_ais_47')->select($query);\r\n Log::info(json_encode($mmtrend_group));\r\n }", "public function getOtherEvents();", "public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }", "function getUpcomingEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime > CURRENT_DATE && archive != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getEvents()\n {\n if ($this->input->get('start') === null || $this->input->get('end') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array('start' => $this->input->get('start'), 'end' => $this->input->get('end'));\n\n $events = $this->model->getEvents($reqData);\n\n $this->send(200, $events);\n }", "public function getEvents($start, $end)\n {\n $e2=date('Y-m-d', strtotime($end. ' - 60 days'));\n $sql = \"SELECT * FROM geopos_events WHERE (geopos_events.start BETWEEN ? AND ?) OR (geopos_events.end > ? ) ORDER BY geopos_events.start ASC\";\n return $this->db->query($sql, array($start, $end,$e2))->result();\n\n }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "function event_list(){\n\tglobal $DB;\n\t$currenttime = time();\n\t$query = \"SELECT * FROM {event} WHERE eventtype='site' ORDER By id DESC\";\n $result = $DB->get_records_sql($query);\n\treturn $result;\n}", "public function getSearchGroupData($queryParam){ \n $user_id = \\Auth::user()->userid;\n $query = Group::where('user_id', '=', $user_id);\n if(isset($queryParam['q']) && !empty($queryParam['q'])){\n $query->where('name', \"LIKE\",\"%\".$queryParam['q'].\"%\");\n }\n $list = $query->get()->toArray();\n return $list;\n }", "public function getEventos(){\t\n\t\t$sql=\"SELECT Evento.idEvento as idEvento,Nombre,Descripcion,FechaInicio,FechaFin,idLocal,idTipoEvento,Precio,Director,Interpretes,\n\t\tDuracion, HoraInicio, Coalesce( avg( Puntuacion ), 0 ) as media, Evento.idImagen, Imagen.NombreImg, Imagen.FechaImg\t\t\t\t\n\t\tFROM Evento LEFT JOIN Puntuacion on Puntuacion.idEvento=Evento.idEvento LEFT JOIN Imagen ON Evento.idImagen=Imagen.idImagen \n\t\tGROUP BY Evento.idEvento\";\t\t\n\t\t$db = new bdadministrador();\n\t\treturn $db->executeQuery($sql);\n\t}", "public function nextEvents() {\n\t\t$events = $this->client->getGroupEvents( [\n\t\t\t'urlname' => $this->group,\n\t\t\t'scroll' => 'next_upcoming',\n\t\t] );\n\n\t\treturn $events->getData();\n\t}", "function getEvents()\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events ORDER BY Date Desc');\n $request->execute(array());\n $result = $request->fetchAll();\n return $result;\n}", "function groupSearchHandler() {\n global $inputs;\n\n $keyword = $inputs['keyword'];\n $res = getAll(\"SELECT * \n FROM `group` \n WHERE group_name LIKE '%$keyword%' OR description LIKE '%$keyword%'\");\n \n formatOutput(true, 'success',$res);\n}", "function selectEvent($id)\n{\n require_once(\"model/database.php\");\n $query = \"SELECT events.*, images.path, lans.start AS 'minTime', lans.end AS 'maxTime', lans.name AS 'lan' FROM events LEFT JOIN lan_contains_event AS j ON j.event_id = events.id LEFT JOIN lans ON lans.id = j.lan_id LEFT JOIN images ON images.id = events.image_id WHERE events.id = :id LIMIT 1;\";\n return executeQuerySelect($query, createBinds([[\":id\", $id, PDO::PARAM_INT]]))[0] ?? null;\n}", "function get_events( $args = array() ) {\n\tglobal $wpdb, $cache_life, $cache_group;\n\n\t// Sort to ensure consistent cache keys.\n\tksort( $args );\n\n\t// number should be between 0 and 100, with a default of 10.\n\t$args['number'] = $args['number'] ?? 10;\n\t$args['number'] = max( 0, min( $args['number'], 100 ) );\n\n\t// Distances in kilometers\n\t$event_distances = array(\n\t\t'meetup' => 100,\n\t\t'wordcamp' => 400,\n\t);\n\n\tif ( time() < COVID_IMPACT_EXPIRATION ) {\n\t\t$event_distances['wordcamp'] = 600;\n\t}\n\n\t$cache_key = 'events:' . md5( serialize( $args ) );\n\tif ( false !== ( $data = wp_cache_get( $cache_key, $cache_group ) ) ) {\n\t\treturn $data;\n\t}\n\n\t$wheres = array(\n\t\t/*\n\t\t * This group is online-only events, and `pin_next_workshop_discussion_group()` will take care of adding\n\t\t * them to the event array. Meetup.com requires groups to claim a physical location, so this one uses\n\t\t * San Francisco.\n\t\t *\n\t\t * If these events weren't excluded here, then people in San Francisco would get them mixed in with their\n\t\t * actual local meetup events, and the local events would often be pushed out of the widget.\n\t\t *\n\t\t * @todo This do mean that non-Core requests will never see events from this group, but there isn't a\n\t\t * tangible use case for that yet. We could maybe support an `online` value for the `location` parameter\n\t\t * in the future if that's desired. If we do that, the Codex documentation should be updated.\n\t\t */\n\t\t\"( `meetup_url` IS NULL OR `meetup_url` <> 'https://www.meetup.com/learn-wordpress-discussions/' ) \",\n\t);\n\n\tif ( ! empty( $args['type'] ) && in_array( $args['type'], array( 'meetup', 'wordcamp' ) ) ) {\n\t\t$wheres[] = '`type` = %s';\n\t\t$sql_values[] = $args['type'];\n\t}\n\n\t// If we want nearby events, create a WHERE based on a bounded box of lat/long co-ordinates.\n\tif ( ! empty( $args['nearby'] ) ) {\n\t\t$nearby_where = array();\n\n\t\tforeach ( $event_distances as $type => $distance ) {\n\t\t\tif ( ! empty( $args['type'] ) && $type != $args['type'] ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$bounded_box = get_bounded_coordinates( $args['nearby']['latitude'], $args['nearby']['longitude'], $distance );\n\t\t\t$nearby_where[] = '( `type` = %s AND `latitude` BETWEEN %f AND %f AND `longitude` BETWEEN %f AND %f )';\n\t\t\t$sql_values[] = $type;\n\t\t\t$sql_values[] = $bounded_box['latitude']['min'];\n\t\t\t$sql_values[] = $bounded_box['latitude']['max'];\n\t\t\t$sql_values[] = $bounded_box['longitude']['min'];\n\t\t\t$sql_values[] = $bounded_box['longitude']['max'];\n\t\t}\n\t\t// Build the nearby where as a OR as different event types have different distances.\n\t\t$wheres[] = '(' . implode( ' OR ', $nearby_where ) . ')';\n\t}\n\n\t// Allow queries for limiting to specific countries.\n\tif ( $args['restrict_by_country'] && ! empty( $args['country'] ) && preg_match( '![a-z]{2}!i', $args['country'] ) ) {\n\t\t$wheres[] = '`country` = %s';\n\t\t$sql_values[] = $args['country'];\n\t}\n\n\t// Just show events that are currently scheduled (as opposed to cancelled/planning/postponed).\n\t$wheres[] = '`status` = %s';\n\t$sql_values[] = 'scheduled';\n\n\t// Just show upcoming events\n\t$wheres[] = '`date_utc` >= %s'; // Not actually UTC. WordCamp posts don't store a timezone value.\n\n\t// Dates are in local-time not UTC, so the API output will contain events that have already happened in some parts of the world.\n\t// TODO update this when the UTC dates are stored.\n\t$sql_values[] = gmdate( 'Y-m-d', time() - DAY_IN_SECONDS );\n\n\t// Limit\n\tif ( isset( $args['number'] ) ) {\n\t\t$sql_limits = 'LIMIT %d';\n\t\t$sql_values[] = $args['number'];\n\t}\n\n\t$sql_where = $sql_limit = '';\n\tif ( $wheres ) {\n\t\t$sql_where = 'WHERE ' . implode( ' AND ', $wheres );\n\t}\n\n\t$raw_events = $wpdb->get_results( $wpdb->prepare(\n\t\t\"SELECT\n\t\t\t`type`, `title`, `url`,\n\t\t\t`meetup`, `meetup_url`,\n\t\t\t`date_utc`, `date_utc_offset`, `end_date`,\n\t\t\t`location`, `country`, `latitude`, `longitude`\n\t\tFROM `wporg_events`\n\t\t$sql_where\n\t\tORDER BY `date_utc` ASC\n\t\t$sql_limits\",\n\t\t$sql_values\n\t) );\n\n\tif ( should_stick_wordcamp( $args, $raw_events ) ) {\n\t\t$sticky_wordcamp = get_sticky_wordcamp( $args, $event_distances['wordcamp'] );\n\n\t\tif ( $sticky_wordcamp ) {\n\t\t\tarray_pop( $raw_events );\n\t\t\tarray_push( $raw_events, $sticky_wordcamp );\n\t\t}\n\t}\n\n\t$events = array();\n\tforeach ( $raw_events as $event ) {\n\t\t$events[] = array(\n\t\t\t'type' => $event->type,\n\t\t\t'title' => $event->title,\n\t\t\t'url' => $event->url,\n\t\t\t'meetup' => $event->meetup,\n\t\t\t'meetup_url' => $event->meetup_url,\n\n\t\t\t/*\n\t\t\t * The `date_utc` column in the database is misnomed, and contains times in the event's local\n\t\t\t * timezone. So the `date` field in the response is the local time, and the `date_utc` field in\n\t\t\t * the response here is _actually_ UTC.\n\t\t\t */\n\t\t\t'date' => $event->date_utc,\n\t\t\t'end_date' => $event->end_date,\n\t\t\t'start_unix_timestamp' => strtotime( $event->date_utc ) - $event->date_utc_offset,\n\t\t\t'end_unix_timestamp' => strtotime( $event->end_date ) - $event->date_utc_offset,\n\n\t\t\t'location' => array(\n\t\t\t\t// Capitalize it for use in presentation contexts, like the Events Widget.\n\t\t\t\t'location' => 'online' === $event->location ? 'Online' : $event->location,\n\t\t\t\t'country' => $event->country,\n\t\t\t\t'latitude' => (float) $event->latitude,\n\t\t\t\t'longitude' => (float) $event->longitude,\n\t\t\t),\n\t\t);\n\t}\n\n\twp_cache_set( $cache_key, $events, $cache_group, $cache_life );\n\n\treturn $events;\n}", "function get_events_notification($start, $event_limit, $cond=array(), $count=false)\r\n\t{\r\n\t\t$c_filter = '';\r\n\t\tif (is_domain_user() == true) {\r\n\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t}\r\n\t\tif (valid_array($cond)) {\r\n\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t}\r\n\t\tif(!$count) {\r\n\t\t\t$query = 'select TL.*, TLE.event_title, TLE.event_icon \r\n\t\t\t\t\tfrom timeline TL \r\n\t\t\t\t\tJOIN timeline_master_event TLE\r\n\t\t\t\t\tJOIN timeline_event_user_map TEU ON TEU.timeline_fk=TL.origin\r\n\t\t\t\t\tJOIN user U on U.user_id=TEU.user_id and TEU.user_id='.intval($this->CI->entity_user_id).'\r\n\t\t\t\t\twhere TL.event_origin=TLE.origin '.$c_filter.' order by TL.origin desc limit '.$start.','.$event_limit;\r\n\t\t\treturn $this->CI->db->query($query)->result_array();\r\n\t\t} else {\r\n\t\t\t$query = 'select count(*) as total \r\n\t\t\t\tfrom timeline TL\r\n\t\t\t\tJOIN timeline_master_event TLE\r\n\t\t\t\tJOIN timeline_event_user_map TEU ON TEU.timeline_fk=TL.origin\r\n\t\t\t\tJOIN user U on U.user_id=TEU.user_id and TEU.user_id='.intval($this->CI->entity_user_id).'\r\n\t\t\t\twhere TL.event_origin=TLE.origin '. $c_filter.' group by TL.origin';\r\n\t\t\t\treturn $this->CI->db->query($query)->row();\r\n\t\t}\r\n\t}", "function getMyClubApiEventsViaGroupName($url, $groupName,$amountOfEvents)\n{\n\t$returnString=\"\";\n\t\n\t//form get group url from original event request url \"https://<club>.myclub.fi/api/groups\"\n\t$pu = parse_url($url);\n \t$baseurl=$pu[\"scheme\"] . \"://\" . $pu[\"host\"];\n\t$groupurl=$baseurl . \"/api/groups\";\n\t\n\t// Get groupid with other api call\n\t$groupId=GetGroupIdByName($groupName,$groupurl);\t\n\t\n\tif (CheckError($groupId))\n\t{\n\t\treturn $groupId;\n\t}\n\t// Append group id to api call\n\t$url = $url . $groupId;\n\t\n\t// Get Json with url\n\t$url=$url . \"&start_date=\" . date(\"Y-m-d\");\n\t$json=GetMyClubApiJson($url);\n\t\n\tif (CheckError($json))\n\t{\n\t\treturn $json;\n\t}\n\t$decoded = json_decode($json);\n\n\t// Tidy and put JSON to a class array (for sorting), there is propably a tricky way to sort this decoded JSON objects directly...\n\tclass Event{\n\t\tpublic $startsAt;\n\t\tpublic $endsAt;\n\t\tpublic $eventName;\n\t}\n\n\t// Push requested amount of events to event arraż\t\n\t$eventArr=array();\n\tforeach ($decoded as $item)\n\t{\n\t\t$event=new Event();\n\t\t$event->startsAt=$item->event->starts_at;\n\t\t$event->endsAt=$item->event->ends_at;\n\t\t$event->eventName=$item->event->name;\n\t \tarray_push($eventArr,$event);\n\t}\n\t\n\t// Sort events by start date\n\tusort($eventArr, function($a, $b)\n\t{ \n\t\treturn $a->startsAt < $b->startsAt ? -1 : 1;\n\t}); \n\n\t// generate output html\n\t$returnString = $returnString . \"<div class='myclubapi-events'>\";\n\t$i=0;\n\tforeach ($eventArr as $item)\n\t{\n\t\t$returnString = $returnString . \"<div id='myclubapi-event-single'>\";\n\t\t$returnString = $returnString . \"<p id='myclubapi-event-time'>\" . TidyTimeStamp($item->startsAt). \"-\" .TidyTimeStampJustTime($item->endsAt) .\"</p>\" ;\n\t\t$returnString = $returnString . \"<p id='myclubapi-event-name'>\" .$item->eventName. \"</p>\" ;\n\t\t$returnString = $returnString . \"</div>\";\n\t\tif ($i>=$amountOfEvents)\n\t\t\tbreak;\n\t\t$i++;\n\t}\n\t\n\t$returnString = $returnString . \"</div>\";\n\treturn $returnString;\n}", "public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}", "public function getDayEvents($date){\n\t\t$object = $this->events_ob;\n\t\t$event = new $object();\n\t\t$events = array();\n\t\t\n\t\t# Get Non-Reoccurring events\n\t\t$query = \"WHERE `start_date` = '\".$date.\"' AND `repeating` = '0' AND `active` = '1'\";\n\t\t$events = array_merge($events, $event->fetchQuery($query));\n\t\t\n\t\t# Get Reoccurring events\n\t\t# Get Events that Reoccur on a daily basis\n\t\t$query = \"WHERE `repeating` = '1' AND `start_date` <= '\".$date.\"' AND (`repeat_end` >= '\".$date.\"' OR `repeat_end` = '0000-00-00') AND `repeat_type` = 'daily' AND `repeat_every` <> 0 AND MOD(TIMESTAMPDIFF(DAY, `start_date`, '\".$date.\"'), `repeat_every`) = 0 AND `active` = '1'\";\n\t\t$events = array_merge($events, $event->fetchQuery($query));\n\t\t\n\t\t# Get Events that Reoccur on a weekly basis\n\t\t$query = \"WHERE `repeating` = '1' AND `start_date` <= '\".$date.\"' AND (`repeat_end` >= '\".$date.\"' OR `repeat_end` = '0000-00-00') AND `repeat_type` = 'weekly' AND `repeat_wednesday` = '1' AND `repeat_every` <> 0 AND MOD(TIMESTAMPDIFF(WEEK, `start_date`, '\".$date.\"'), `repeat_every`) = 0 AND `active` = '1'\";\n\t\t$events = array_merge($events, $event->fetchQuery($query));\n\t\t\n\t\t# Get Events that Reoccur on a monthly basis\n\t\t$query = \"WHERE `repeating` = '1' AND `start_date` <= '\".$date.\"' AND (`repeat_end` >= '\".$date.\"' OR `repeat_end` = '0000-00-00') AND `repeat_type` = 'monthly' AND ((`repeat_by` = 'day_of_month' AND DAY(`start_date`) = '16') OR (`repeat_by` = 'day_of_week' AND DAYOFWEEK(`start_date`) = '4' AND MOD((TIMESTAMPDIFF(WEEK, '2017-08-01', '\".$date.\"')+1), `repeat_every`) = 0)) AND `repeat_every` <> 0 AND `active` = '1'\";\n\t\t$events = array_merge($events, $event->fetchQuery($query));\n\t\t\n\t\t# Get Events that Reoccur on a yearly basis\n\t\t$query = \"WHERE `repeating` = '1' AND `start_date` <= '\".$date.\"' AND (`repeat_end` >= '\".$date.\"' OR `repeat_end` = '0000-00-00') AND `repeat_type` = 'yearly' AND DAY(`start_date`) = '16' AND MONTH(`start_date`) = '8' AND `repeat_every` <> 0 AND MOD(TIMESTAMPDIFF(YEAR, `start_date`, '\".$date.\"'), `repeat_every`) = 0 AND `active` = '1'\";\n\t\t$events = array_merge($events, $event->fetchQuery($query));\n\t\t\n\t\treturn $events;\n\t}", "private function _getEventData()\n {\n $query = $this->app->query->newSelect();\n $query->cols(['*'])\n ->from('events')\n ->orderBy(['event_date desc', 'post_date desc'])\n ->limit(3);\n\n return $this->app->db->fetchAll($query);\n }", "function fetchEvents($gala, $sex) {\n $events = array();\n global $db_gala_name;\n $mysqli = openDatabase($db_gala_name);\n if ($stmt = $mysqli->prepare('SELECT sex, event_name, event_type, event_number FROM gala_events WHERE gala = ? AND sex = ?')) {\n $stmt->bind_param('ss', $gala, $sex);\n $stmt->execute();\n $stmt->store_result();\n $stmt->bind_result($sex, $eventName, $eventType, $eventNumber);\n \n while ($stmt->fetch()) {\n $event = array();\n $event['sex']=$sex;\n $event['name']=$eventName;\n $event['type']=$eventType;\n $event['number']=$eventNumber;\n $events[]=$event;\n }\n }\n \n return $events;\n}", "public function get_event_matches($event_id);", "function get_new_events( $options=array() ){\n\t\t\n\t\tglobal $gamo, $dbh;\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'start' => 0,\n\t\t\t\t'number' => 1\n\t\t\t),\n\t\t$options);\n\t\t\n\t\t$sql = \"SELECT id FROM \" . CORE_DB . \".\" . self::$table_name.\n\t\t\" WHERE active = 1 and hide = 0 ORDER BY date_time ASC LIMIT \".$options['start'].\",\".$options['number'];\n\n\t\t$sth = $dbh->prepare($sql);\n\n\t\t$vevents = array();\n\t\t$sth->execute();\n\n\t\twhile($row = $sth->fetch()) {\n\n\t\t\t$row = Core::r('virtual_events')->get_event(array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'public_has' => 1,\n\t\t\t\t\t'show_private_has' => 0\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tarray_push($vevents, $row);\n\n\t\t}\n\n\t\treturn $vevents;\n\t\t\n\t}", "public function getEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 0')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public function isGroupEvent()\n {\n return $this->baseEvent->isGroupEvent();\n }", "function select($query){\n $select = $this->db->prepare($query);\n $select->bindParam('id_event', $this->id_event, PDO::PARAM_STR);\n $select->bindParam('eventName', $this->eventName, PDO::PARAM_STR);\n $select->bindParam('relay', $this->relay, PDO::PARAM_INT);\n $select->bindParam('type', $this->type, PDO::PARAM_STR);\n $select->bindParam('weight', $this->weight, PDO::PARAM_INT);\n $select->execute();\n return $select->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getAll(){\n //old : \n // $events = $this->events;\n // return $events;\n $repo = $this->om->getRepository(Event::class); \n return $repo->findAll();\n }", "public function findByName($group_name);", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "public function iCanSeeEventsForTheGroup()\n {\n $main = $this->getMainContext();\n /** @var \\Behat\\MinkExtension\\Context\\MinkContext $mink */\n $mink = $main->getSubcontext('mink');\n\n // Verify the existance of some things on the page that\n $mink->assertElementOnPage('#upcomingTab');\n $mink->assertElementOnPage('#pastTab');\n }", "public function testAggregateEvents()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function EventsTable()\n {\n return \n $this->ItemsTableDataGroup\n (\n \"\",\n 0,\n $this->ApplicationObj()->EventGroup,\n $this->ApplicationObj()->Events\n );\n }", "function get_Events(){\r\n $sql = $this->db->prepare(\"CALL SPgetEvents(:userid,:chamberid,:businessID)\");\r\n $result = $sql->execute(array(\r\n \"userid\" => $_SESSION['userid'],\r\n \"chamberid\" => $_SESSION['chamber'],\r\n \"businessID\" => $_SESSION['businessid']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "public function searchEvents(Message $request, ParsedQuery $parsedQuery, Message $response, array $curies = [], array $context = []): void;" ]
[ "0.65181583", "0.6408002", "0.60112226", "0.5999194", "0.5971994", "0.58897424", "0.5871323", "0.5864656", "0.58483195", "0.58332855", "0.5816507", "0.57964534", "0.5775302", "0.5770582", "0.5756007", "0.5734936", "0.5725029", "0.5685236", "0.56606984", "0.56358355", "0.5631177", "0.56297284", "0.56297284", "0.5620451", "0.56141144", "0.5613568", "0.5599002", "0.5589178", "0.55734926", "0.5565933", "0.5554169", "0.55468255", "0.5541139", "0.55376405", "0.55206907", "0.55173284", "0.55041814", "0.5480158", "0.54781824", "0.5476869", "0.5413979", "0.5412923", "0.5389146", "0.53810424", "0.53740084", "0.53740084", "0.5360472", "0.5340824", "0.53381807", "0.53377974", "0.53327274", "0.53151774", "0.53138214", "0.531135", "0.5311018", "0.53109413", "0.5310499", "0.5293347", "0.52609855", "0.52569157", "0.52426547", "0.52345496", "0.523208", "0.5230521", "0.5227365", "0.52248234", "0.5224483", "0.52230436", "0.5216536", "0.51892483", "0.5188167", "0.5187032", "0.51869917", "0.5185813", "0.517612", "0.51748204", "0.51738054", "0.5172493", "0.5171316", "0.51699394", "0.51675296", "0.5164018", "0.5163634", "0.5159996", "0.5154882", "0.5151005", "0.5147387", "0.5147073", "0.51468444", "0.5142481", "0.511569", "0.5113159", "0.5108472", "0.50959074", "0.5089226", "0.50887924", "0.50863767", "0.5083933", "0.5079518", "0.5076887" ]
0.62323684
2
/si existe el objeto
public function index(Request $request) { if($request) { /*podre obtener todos los registros de la base de datos*/ $query=trim($request->get('searchText')); /* se coloca el nombre de la tabla en donde se obtendran los registros*/ $especialidades=DB::table('Especialidad')->where('nombre','LIKE','%'.$query.'%') ->where ('condicion','=','1') ->orderBy('idEspecialidad','desc') ->paginate(5); /*aqui es donde se crean las carpetas*/ return view('registro.especialidad.index',["especialidades"=>$especialidades,"searchText"=>$query]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exist($id){\n $rq = \"SELECT * FROM Objets WHERE id = :id\";\n $stmt = $this->pdo->prepare($rq);\n $data = array(\":id\" => $id);\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n if($stmt->rowCount() > 0){\n return true;\n } else {\n $this->erreur = \"Objet inexistant\";\n return false;\n }\n }", "function exists()\n {\n return false;\n }", "public function Exists();", "public function testExiste() {\n\n $mazo = new Mazo(\"Espanol\", [1,2,3,4,5]); //Creo un mazo\n \n $this->assertTrue(isset($mazo)); //Compruebo que fue creado correctamente\n }", "static private function _doesExist($object) {\n $id = $object->_id;\n $type = $object->_type;\n if (!isset(self::$cache[$type])) {\n self::$cache[$type] = self::getStack($type);\n }\n if(isset(self::$cache[$type][$id])){\n return TRUE;\n }\n return FALSE;\n }", "public function exists(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\t\t\t\r\n\t\t\t$bReturn = false;\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE lp_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\t\t\t\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $bReturn;\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function objectExists()\n {\n if ($this->data()->useObjectExistsHandling()) {\n return singleton($this->CreateType)->objectExists($this->request->postVars(), $this->pid);\n }\n }", "public function exists(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$bReturn = false;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE dsh_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn $bReturn;\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function is_object_exist($id, $table_name) {\n\n $primary_field = $this->ci->generic_model->primary($table_name);\n\n $result = $this->ci->generic_model->retrieve_one(\n $table_name,\n array(\n $primary_field => $id\n )\n );\n\n if ($result) { // there exists an object.\n return TRUE;\n } else { // object is not found.\n $this->ci->form_validation->set_message(\"is_object_exist\", \"Object is not exist.\");\n return FALSE;\n }\n }", "public function exists($ret_obj = true){\t\t$exists_db = parent::exists(true);\n\t\tif($exists_db){\n\t\t\t$exists_db = new File($exists_db);\n\t\t\t//check if our file interface agrees\n\t\t\t$interface = new $exists_db['interface']($exists_db);\n\t\t\tif($interface->exists()){\n\t\t\t\t//honor the original exists return values\n\t\t\t\tif($ret_obj){\n\t\t\t\t\treturn $exists_db;\n\t\t\t\t}else{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t//nope the actually file doesn't exist so delete the db record and return false;\n\t\t\t\t$exists_db->delete();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function _exists() {\n // taky typ uz existuje ?\n $id = $this->equipment->getID();\n if ($id > 0) {\n $this->flash(\"Také vybavenie už existuje.<br/>Presmerované na jeho editáciu.\", \"error\");\n $this->redirect(\"ape/equipment/edit/$id\");\n }\n }", "public function exists()\r\n {\r\n }", "public function hasObject();", "public function exists()\n {\n }", "public function exists()\n {\n }", "protected function exists() {}", "function _pgsql_object_exists($name) {\n $sql = \"select relname from pg_class where relname = '$name'\";\n $r = db_query($sql);\n if($r['rows'] == 1) {\n return true;\n }\n return false;\n}", "function objetosDuplicados($param){\r\n\t\tswitch ($param){\r\n\t\t\tcase 1:\r\n\t\t\t\treturn \"El usuario ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn \"El libro ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn \"El ejemplar ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn \"Error de Categoria. Sin embargo el objeto ya existe en el sistema\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "protected function _ifExists($object){\n if (is_null($object)) {\n return redirect()->route('404')->send();\n }\n }", "public function exists(): bool;", "public function exists(): bool;", "public function exists(): bool;", "public function exists() {}", "private function existe_usuario()\n\t{\n\t\t$data = $this->request->getRawInput();\n\t\t$ruc = $data['nick']; \n\t\t$usu = new Admin_model();\n\t\t$usuarioObject = $usu->where(\"nick\", $ruc) \n\t\t->first();\n\t\treturn !is_null($usuarioObject);\n\t\t \n\t}", "function exists($id);", "public function existe()\n\t{\n\t\treturn CADModelo::existePorId($this->id);\n\t}", "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}", "public static function exists($id) {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$instance = db::findOne(db::table($table), \" id = :id \", array(\":id\" => $id));\n\t\treturn (!(is_null($instance)));\n\t}", "public function existeLugar(){\n $modelSearch = new LugarSearch();\n $resultado = $modelSearch->busquedadGeneral($this->attributes);\n if($resultado->getTotalCount()){ \n foreach ($resultado->models as $modeloEncontrado){\n $modeloEncontrado = $modeloEncontrado->toArray();\n $lugar[\"id\"]=$modeloEncontrado['id']; \n #borramos el id, ya que el modelo a registrar aun no tiene id\n $modeloEncontrado['id']=\"\";\n \n //si $this viene con id cargado, nunca va a encontrar el parecido\n if($this->attributes==$modeloEncontrado){\n $this->addError(\"notificacion\", \"El lugar a registrar ya existe!\");\n $this->addError(\"lugarEncontrado\", $lugar);\n }\n }\n }\n }", "abstract public function exists();", "abstract public function exists();", "public function return_existing_if_exists()\n {\n $author = factory( Author::class )->create();\n $data = array_add( $this->authorDataFormat, 'data.id', $author->id );\n\n $newAuthor = $this->dispatch( new StoreAuthor( $data ) );\n\n $this->assertEquals( $author->id, $newAuthor->id );\n }", "static public function doesExist($object) {\n self::debug('*DOESEXIST*');\n $object = self::checkRequirments($object);\n return self::_doesExist($object);\n }", "public function exists();", "public function exists();", "public function exists();", "public function exists()\n {\n return false;\n }", "function exist()\n{\n $STK = $_POST[\"TKDen\"];\n $temp = new TKNganHang();\n if ($temp->exists($STK))\n echo 1;\n else echo 0;\n\n}", "function existeUsuario($usuario){\n\tif (hasKey(BUCKET_USUARIOS,$usuario))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function exists($id)\r\n\t{\r\n\t\t$id = mysql_clean($id);\r\n\t\t$obj = $this->obj_class;\r\n\t\tglobal ${$obj};\r\n\t\t$obj = ${$obj};\r\n\t\t$func = $this->check_func;\r\n\t\treturn $obj->{$func}($id);\r\n\t}", "private function consolaObjeto() {\r\n\t\t\t$clase = '\\\\Consola\\\\'.implode('\\\\', $this->objeto);\r\n\t\t\tif(class_exists($clase) == true):\r\n\t\t\t\t$this->consolaObjetoMetodo($clase);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('La clase: %, no existe dentro del archivo: %s, de la aplicación: %s', $this->objeto, $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "function exists() {\n\t return !empty($this->id);\n\t}", "public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isNotFound();", "public function is_transaction_exist() {\n\n $transaction = $this->ci->generic_model->retrieve_one(\n \"transaction_general\",\n array(\n \"package_id\" => $this->ci->input->post(\"package_id\"),\n \"package_type\" => $this->ci->input->post(\"package_type\")\n )\n );\n\n if ($transaction) { // there exists an object.\n return TRUE;\n } else { // object is not found.\n $this->ci->form_validation->set_message(\"is_transaction_exist\", \"Paket belum dibeli.\");\n return FALSE;\n }\n }", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "static function exists($id) {\n $result = self::get($id);\n if (count($result) > 0) return true;\n return false;\n }", "public function exists($id);", "public function exists($id);", "public function objectExists($request)\n {\n $returnType = '\\Aspose\\Imaging\\Model\\ObjectExist';\n $isBinary = false;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "public function exists()\n {\n return ($this->id) ? true : false;\n }", "public function exists()\n {\n return true;\n }", "function buscar() //funcion para ver si el registro existe \n\t{\n\t$sql=\"select * from slc_unid_medida where nomenc_unid_medida= '$this->abr' and desc_unid_medida= '$this->des'\"; \n\t $result=mysql_query($sql,$this->conexion);\n\t $n=mysql_num_rows($result);\n\t if($n==0)\n\t\t\t return 'false';\n\t\t\telse\n\t\t\t return 'true';\n\t}", "public function returnExists($id);", "public function isExistById($id){\n//\t\tprint_r(\"##Count=##\");\n//\t\tprint_r($this->find($id)->count());\n return $this->find($id)->count() ;\n }", "public function existe (){\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); // Important : on libère le curseur pour la prochaine requête\n\t\tif ($donnees[0] == 0){ // Si l'id n'est pas dans la base de donnée, l'article n'existe pas\n\t\t\treturn false;\n\t\t}\n\t\treturn true ;\n\t}", "public function testExisteSolicitud(){\n /*** CREAR REGISTRO */\n $user_id = 3;\n $controlador = new SolicitudesController();\n $nuevasolic = $controlador->crearSolicitud(0, $user_id, 4);\n\n $consultarsolicitud = Solicitud::where('solicitud_id', $nuevasolic->solicitud_id)->first();\n\n /** EJECUTAR LA PRUEBA */\n $this->assertEquals($nuevasolic->solicitud_id, $consultarsolicitud->solicitud_id);\n $nuevasolic->delete();\n }", "public function exists( $id ) {\r\r\n if ($this->refresh) {\r\r\n $this->init();\r\r\n $this->refresh = false;\r\r\n }\r\r\n return isset($this->instances[$id]);\r\r\n }", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function exists() {\n\t\treturn !is_null($this->id);\n\t}", "public function find($obj){\n\t}", "function existe($id_desig){\r\n $sql=\"select * from suplente where id_desig_suplente=$id_desig\";\r\n $res=toba::db('designa')->consultar($sql);\r\n \r\n if(count($res)>0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public function exists($resource);", "public function exists()\n {\n return ($this->id > 0) ? true : false;\n }", "function exists($id)\n{\n\tif ($id && file_exists('datas/data')){\n\t\t$file = unserialize(file_get_contents('datas/data'));\n\t\tforeach ($file as $value){\n\t\t\tif(trim($value['nom']) === trim($id))\n\t\t\t\treturn true;\n\t\t}\n\t}\n return false;\n}", "function __isset($name) {\n\t\treturn array_key_exists($name,$this->object);\n\t}", "static function exists($ident) {\n\t\n\t\trequire_once 'DBO.class.php';\n\t\n\t\t$db = DBO::getInstance();\n\t\t$ids = $db->prepare('SELECT id FROM projects');\n\t\t$ids->execute();\n\t\tif($ids->errorCode() != 0)\t{\n\t\t\t$error = $ids->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\t\n\t\twhile($id = $ids->fetch())\n\t\t\tif($ident == $id[id])\n\t\t\t\treturn true;\n\t\n\t\treturn false;\n\t}", "function CheckForDBobject(&$dbh, $objectname, $dml_sql = '')\n {\n $sp = array('obj' => $objectname);\n $result = $dbh->QueryHash(\"SELECT COUNT(*) AS CNT FROM USER_OBJECTS WHERE OBJECT_NAME = :obj\", OCI_ASSOC, 0, $sp);\n if(intval($result['CNT']) > 0)\n {\n return(true);\n }\n /* If no sql to create object is supplied we return false as object does not exist. */\n if($dml_sql == '')\n {\n return(false);\n }\n /* If $dml_sql != '' we try to create the object in question, and if this does not work we return false. */\n $result = $dbh->Query($dml_sql,OCI_ASSOC, 1);\n if($result)\n {\n $d = WhichBR();\n $error = $dbh->GetErrorText();\n printf(\"OCI ERROR: %s-%s%s\",$result,$error,$d['LF']);\n return(false);\n }\n /* All is okay return true now. */\n return(true);\n }", "public function exist($username){\n $conditions = array('Utilisateur.username'=>$username);\n $obj = $this->Utilisateur->find('first',array('conditions'=>$conditions));\n $exist = count($obj) > 0 ? $obj['Utilisateur']['id'] : false;\n return $exist;\n }", "function check_exists()\n\t{\n\t\t$name = url_title($this->input->post('name'));\n\n\t\t$exists = $this->content_type_model->check_exists(\n\t\t\t'name',\n\t\t\t$name,\n\t\t\t$this->input->post('id_content_type')\n\t\t);\n\n\t\t$this->xhr_output($exists);\n\t}", "public static function existePorId($id)\n\t{\n\t\treturn CADModelo::existePorId($id);\n\t}", "public function insertar($objeto){\r\n\t}", "function no_existe_versiculo_en_referencia($versiculo_id, $cita)\n{\n $dato = torrefuerte\\Models\\Referencia::where('versiculo_id', $versiculo_id)\n ->where('cita', $cita)->first();\n\n if( is_null($dato)){\n return true;\n }else{\n return false;\n }\n}", "private function appConsolaExistencia() {\r\n\t\t\t$archivo = implode(DIRECTORY_SEPARATOR, array_merge(array($this->consolaRuta), $this->objeto)).'.php';\r\n\t\t\tif(file_exists($archivo) == true):\r\n\t\t\t\t$this->appConsolaLectura($archivo);\r\n\t\t\telse:\r\n\t\t\t\tthrow new \\RuntimeException(sprintf('El Archivo de Consola: %s, de la aplicación: %s, no existe', $this->objeto, $this->aplicacion));\r\n\t\t\tendif;\r\n\t\t}", "function existe_ocupacion ($ocupacion){\n\t\t\t\tinclude(\"bd_conection.php\");\n\t\t\t\t$result = @mysqli_query($con, \"SELECT * FROM ocupaciones WHERE ocupacion_tipo LIKE '$ocupacion'\");\n\t\t\t\t$rowcount=mysqli_num_rows($result);\n\t\t\t\tif ($rowcount > 0){\t\n\t\t\t\t\twhile($ocupacionExist = @mysqli_fetch_assoc($result)) { \n\t\t\t\t\t\treturn $ocupacionExist['ocupacion_tipo'];\n\t\t\t\t\t}\n\t\t\t\t}else if ($ocupacion !== \"\") {\n\t\t\t\t\t@mysqli_query($con, \"INSERT INTO ocupaciones (ocupacion_tipo) VALUES ('$ocupacion')\");\t\t\t\n\t\t\t\t\treturn $ocupacion;\n\t\t\t\t}\n\t\t\t}", "abstract public function exists($target);", "function is_exists_doc($doc_id){\n\tif(!filter_var($doc_id, FILTER_VALIDATE_INT)){\n\t\n\treturn false;\n\t\n\t}\n\telse{\n\t\tglobal $prefix_doc;\n\t\t$query = borno_query(\"SELECT * FROM $prefix_doc WHERE id='$doc_id'\");\n\t\t\n\t\t$count = mysqli_num_rows($query);\n\t\tif($count==1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\n\t}\n\n}", "private function validate_exists() {\n\t\tif ( ! $this->exists ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_EXIST );\n\t\t}\n\t}", "private static function existsProdotto($id){\n $dbResponse=\\Singleton::DB()->query(\"SELECT COUNT(*) as num FROM `prodotti` WHERE prodotti.id=$id;\");\n while($r = mysqli_fetch_assoc($dbResponse)) {$rows[] = $r; }\n if($rows[0]['num']==1) return TRUE;\n else return FALSE;\n }", "public function resourceExists($resource);", "public function objectExists($string = \"\") {\n\t\tif (!empty($string)) {\n\t\t\tforeach ($this->objects as $str) {\n\t\t\t\t$trimmedStr = trim($str);\n\t\t\t\t$string = trim($string);\n\t\t\t\tif (strtolower($string) == strtolower($trimmedStr)) { return true; }\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\treturn -1;\n\t}", "public static function exist($key) ;", "function existeTitulacion($base, $id)\n{\n $query = \"SELECT `id` FROM `titulaciones` WHERE `id`=\" . $id;\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "public function alreadyExists()\n\t{\n\t\tif(file_exists($this->getSavePath())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function existe_tracker( $id ) {\n\treturn false !== obt_tracker($id);\n}", "function exists()\r\n\t{\r\n\t\treturn ( ! empty($this->id));\r\n\t}", "public static function Exists($name);", "function existeGrupo($base, $id, $id_asignatura)\n{\n $query = \"SELECT `id` FROM `grupos`\n WHERE `id`=\" . $id . \" AND `id_asignatura`=\" . $id_asignatura . \";\";\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "public static function VerificarExistencia($ufologo)\n {\n $ret = new stdClass();\n $ret->exito = false;\n $ret->mensaje = 'No existe el ufologo en el archivo';\n\n //traigo el array de todos\n $ufologo_array = Ufologo::TraerTodos();\n\n //lo recorro\n foreach($ufologo_array as $obj)\n {\n //comparo legajo y calve\n if($obj->legajo === $ufologo->legajo && $obj->clave === $ufologo->clave)\n {\n //si existe devuelvo true\n $ret->exito = true;\n $ret->mensaje = 'El ufologo existe en el archivo';\n break; \n }\n }\n //devuelvo ret formateado como json\n return json_encode($ret);\n }", "public function isCreatable();", "public function exists($entity): bool;", "function usuario_existe($usuario){\n\t$sql = \"SELECT id FROM usuarios WHERE usuario = '$usuario'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function exists()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->getModel();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch(ECash_Application_NotFoundException $e)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function existeProfesor($base, $id, $id_grupo)\n{\n $query = \"SELECT `id` FROM `profesores`\n WHERE `id`=\" . $id . \" AND `id_grupo`=\" . $id_grupo . \";\";\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "function create() {\n\t\tglobal $default, $lang_err_doc_exist, $lang_err_database;\n\t\t//if the id >= 0, then the object has already been created\n\t\tif ($this->iId < 0) {\n\t\t\t//check to see if name exsits\n\t\t\t$sql = $default->db;\n\t\t\t$sQuery = \"SELECT id FROM \". $default->document_type_fields_table .\" WHERE document_type_id = ? and field_id = ?\";/*ok*/\n $aParams = array($this->iDocumentTypeID, $this->iFieldID);\n $sql->query(array($sQuery, $aParams));\n $rows = $sql->num_rows($sql);\n \n if ($rows > 0){\n $_SESSION[\"errorMessage\"] = \"DocTypes::The DocumentType name \" . $this->sName . \" is already in use!\";\n return false;\n }\n\t\t}\n\n return parent::create();\n\t}", "function load($clase, $metodo) {\n $load = \"../Modelo/$clase.php\";\n if (file_exists($load)) {\n include_once ($load);\n if (!method_exists($clase, $metodo)) {\n throw new Exception(\"No existe el metodo $metodo\");\n return false;\n }\n return true;\n } else {\n throw new Exception(\"No existe la clase $clase\");\n return false;\n }\n}", "public function isNew(): bool;", "public function isNew(): bool;", "public function existAuthItem()\n {\n if ($this->type === Item::TYPE_PERMISSION) {\n $authItem = Yii::$app->authManager->getPermission($this->name);\n } else {\n $authItem = Yii::$app->authManager->getRole($this->name);\n }\n if ($this->getIsNewRecord()) {\n if (!empty($authItem)) {\n $this->addError('name', \"This name has already been taken.\");\n }\n } else {\n if (!empty($authItem) && $authItem->name !== $this->item->name) {\n $this->addError('name', \"This name has already been taken.\");\n }\n }\n }", "public static function exists(int $id): bool;" ]
[ "0.68431485", "0.667574", "0.661937", "0.6577944", "0.65403473", "0.65100527", "0.6501511", "0.649743", "0.64866936", "0.64082694", "0.640642", "0.6362405", "0.63334703", "0.6304506", "0.63017946", "0.6301141", "0.62321895", "0.6205071", "0.6184529", "0.61618346", "0.61618346", "0.61618346", "0.61414826", "0.61263704", "0.61225903", "0.6108399", "0.60846454", "0.60831136", "0.607023", "0.6063685", "0.6063053", "0.6063053", "0.6058946", "0.60556966", "0.6036541", "0.6036541", "0.6036541", "0.6011175", "0.5962819", "0.594803", "0.5941082", "0.5904907", "0.58830655", "0.58813953", "0.5852399", "0.582716", "0.5820333", "0.58147734", "0.5781877", "0.5781877", "0.57552624", "0.57228506", "0.57203823", "0.5698491", "0.56972337", "0.5688598", "0.5682023", "0.5680813", "0.5676573", "0.56680524", "0.56637853", "0.5645711", "0.5642773", "0.56375986", "0.563357", "0.5624485", "0.56243175", "0.5609953", "0.560377", "0.5572948", "0.5561408", "0.55595726", "0.55575013", "0.55574375", "0.5525561", "0.5501156", "0.550109", "0.55005753", "0.54997057", "0.5497619", "0.54974586", "0.54912406", "0.5489793", "0.54809713", "0.5478276", "0.54723895", "0.54692566", "0.54544926", "0.5452331", "0.5447928", "0.5436752", "0.5435614", "0.543314", "0.54156154", "0.54109883", "0.5407608", "0.54036903", "0.54024774", "0.54024774", "0.539327", "0.538988" ]
0.0
-1
/en esta seccion se realizo un cambi o de letra por mayuscula
public function show($id) { return view("registro.especialidad.show",["especialidad"=>Especialidad::findOrFail($id)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function procesar_cambio ($datos){\n //validamos que no exista otro periodo, para ello tomamos la fecha actual y obtenemos todos los periodo \n //que existen con sus respectivos dias y verificamos que el espacio que se quiere cargar no este ocupado en esos \n //dias\n \n }", "function analisaCaminho($lab, $qtdL, $qtdC, $pLI, $pCI, $pLF, $pCF, $pLA, $pCA){ \n if ($pLA == $pLF && $pCA == $pCF){\n exibelab($lab, $qtdL, $qtdC);\n }else{\n $lab[$pLA][$pCA] = 5;\n\n //define vizinhança\n for($c = -1; $c <= +1; $c++){\n for($l = -1; $l <= +1; $l++){\n $liA = $pLA+ $c; // linha atual\n $coA = $pCA+ $l; // coluna atual\n \n //verifica se está dentro dos limites\n if ( ($liA > 0 && $liA <=$qtdL-1) && ($coA > 0 && $coA <= $qtdC-1) ){ \n // verifica se EXISTE, e se é caminho ou saida\n if (isset($lab[$liA][$coA]) && ( $lab[$liA][$coA] == 0 || $lab[$liA][$coA] == 3 )){ \n // exclui diagonais\n if ($c * $l == 0){\n //exclui limites\n if ($lab[$liA][$coA] != 4){ \n analisaCaminho($lab, $qtdL, $qtdC, $pLI, $pCI, $pLF, $pCF, $liA,$coA);\n }\n }\n }\n } // fim limites\n \n }\n }\n // e se eu resetar o caminho aqui? \n }\n }", "function matricularVehiculo(){\r\n $matricula _aleatoria = rand();\r\n\r\n $encontrado = false;\r\n for ($i=0; $i< count ($this->vehiculos) && ($encontrado==false); $i++) {\r\n if ($this->vehiculos[$i] != null) {\r\n if($this->vehiculos[$i]->getMatricula() =='') {}\r\n $this->vehiculos[$i]->getMatricula($matricula_aleatoria);\r\n $encontrado = true;\r\n $pos = $i;\r\n }\r\n }\r\n }", "function motivoDeAnulacionDesin(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function motivoDeAnulacionDev(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDV' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function alejarCamaraPresidencia() {\n\n self::$presidencia->alejarZoom();\n\n }", "public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }", "function verMas()\t\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $use;\r\n\t\t\tglobal $priv;\r\n\r\n\t\t\t//NOTA: Para ver si funciona tienen que asociarle un adherente en la tabla socios, ya que en los datos de ejemplo todos son titulares\r\n\t\t\t//NOTA: Lo que hice fue: en tabla socios en numero_soc=00044 cambiar el campo soc_titula de manera que quede soc_titula=00277\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t$numero_socio = $_GET['num_soc']; //Es el número del socio titular que debe ser tomado del PASO 1\r\n\t\t\t\r\n\r\n\t\t\t\t$resultadoTitular = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t\t\t\t\t\t FROM socios,persona \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\");\r\n\t\t\t\t\t\t\t\t\t \r\n\r\n\t\t\tif(!$resultadoTitular)\r\n\t\t\t{\r\n\t\t\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"verMas\",\r\n\t\t\t\t'descripcion'\t=>\"No se encuentra al titular $numero_socio\"\r\n\t\t\t\t];\r\n\t\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t///---FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$fecha=$resultadoTitular[0]['fecnacim'];\r\n\t\t\t$dias = explode(\"-\", $fecha, 3);\r\n\t\t\t\r\n\t\t\t// $dias[0] es el año\r\n\t\t\t// $dias[1] es el mes\r\n\t\t\t// $dias[2] es el dia\r\n\t\t\t\r\n\t\t\t// mktime toma los datos en el orden (0,0,0, mes, dia, año) \r\n\t\t\t$dias = mktime(0,0,0,$dias[1],$dias[2],$dias[0]);\r\n\t\t\t$edad = (int)((time()-$dias)/31556926 );\r\n\t\t\t$resultadoTitular[0]['edad']=$edad;\r\n\t\t\t\r\n\t\t\t///---FIN FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$estado[0]='1';\r\n\t\t\t$estado[1]='1';\r\n\t\t\t$estado[2]='1';\r\n\t\t\t$estado[3]='1';\r\n\t\t\t$estado[4]='1';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS SERVICIOS DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t//Por cuota\r\n\t\t\t$resultadoTitularServicios1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\tif(!$resultadoTitularServicios1)\r\n\t\t\t\t$estado[0]='0';\r\n\t\t\t\r\n\t\t\t//Por tarjeta\r\n\t\t\t$resultadoTitularServicios2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.soc_titula \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoTitularServicios2)\r\n\t\t\t\t$estado[1]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR CUOTA----------------\r\n\t\t\t\r\n\r\n\t\t $resultadoAdherentes1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes1)\r\n\t\t\t\t$estado[2]='0';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR TARJETA----------------\r\n\r\n\t\t\t$resultadoAdherentes2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\t\r\n\r\n\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes2)\r\n\t\t\t\t$estado[3]='0';\r\n\t\t\r\n\t\t \r\n\t\t\t//---------------CONSULTA QUE DEVUELVE EL LISTADO DE TODAS LAS ASISTENCIAS----------------\r\n\t\t\t\r\n\t\t\t//NOTA: Para que puedan ver si funciona o no hacer la prueba con el siguiente ejemplo:\r\n\t\t\t// En la tabla fme_asistencia modifiquen en cualquier lado y pongan alguno con doctitu = 06948018 (o busquen cualquier DNI de un socio titular y usen ese)\r\n\t\t\t// Cuando prueben el sistema vayan al ver más de Barrionuevo Samuel y van a ver el listado de atenciones que tiene asociado\r\n\t\t\t\r\n\t\t\t$asistencias = $GLOBALS['db']->select(\"SELECT fme_asistencia.doctitu, fme_asistencia.numdoc, fme_asistencia.nombre,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.fec_pedido, fme_asistencia.hora_pedido, fme_asistencia.dessit, fme_asistencia.fec_ate,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.sintomas, fme_asistencia.diagnostico, fme_asistencia.tratamiento, fme_asistencia.hora_aten,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.profesional\r\n\t\t\t\t\t\t\t\t\t FROM fme_asistencia, socios, persona \r\n\t\t\t\t\t\t\t\t\t WHERE soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND numero_soc = soc_titula\r\n\t\t\t\t\t\t\t\t\t AND persona.numdoc = fme_asistencia.doctitu\");\r\n\t\t\t\r\n\t\t\tif(!$asistencias)\r\n\t\t\t\t$estado[4]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/perfil.html', compact('resultadoTitular', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios1', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios2', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes2',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'asistencias',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'estado','use','priv'));\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function motivoDeAnulacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNRE' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function tiltDownCamaraPresidencia() {\n\n self::$presidencia->moverAbajo();\n\n }", "function en_rojo($anio){\n $ar=array();\n $ar['anio']=$anio;\n $sql=\"select sigla,descripcion from unidad_acad \";\n $sql = toba::perfil_de_datos()->filtrar($sql);\n $resul=toba::db('designa')->consultar($sql);\n $ar['uni_acad']=$resul[0]['sigla'];\n $res=$this->get_totales($ar);//monto1+monto2=gastado\n $band=false;\n $i=0;\n $long=count($res);\n while(!$band && $i<$long){\n \n if(($res[$i]['credito']-($res[$i]['monto1']+$res[$i]['monto2']))<-50){//if($gaste>$resul[$i]['cred']){\n $band=true;\n }\n \n $i++;\n }\n return $band;\n \n }", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "function autorizar_venta_directa($id_movimiento_material) {\r\n global $_ses_user,$db; \r\n\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n \r\n \r\n $sql = \"select id_factura from movimiento_factura where id_movimiento_material = $id_movimiento_material\";\r\n $fact = sql($sql) or fin_pagina(); \r\n $id_factura = $fact->fields[\"id_factura\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++) { \t \r\n \t\r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n \r\n \r\n //tengo que eliminar del stock los productos correspondientes \r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //pongo las banderas de la factura en cuenta asi se produce\r\n //el movimiento correcto en el balance\r\n $detalle_mov->movenext(); \r\n }//del for \r\n \r\n if ($id_factura) {\r\n \r\n $sql = \"update licitaciones.cobranzas \r\n set renglones_entregados=1, licitacion_entregada=1\r\n where cobranzas.id_factura=$id_factura\";\r\n sql($sql) or fin_pagina();\r\n } \r\n \r\n \r\n \r\n\r\n}", "function ler($nome) {\n $x = 1;\n\t while($x < $this->bd[0][0] && !$this->str_igual($nome, $this->bd[$x][2])) {$x++;}\n if($x >= $this->bd[0][0]) {return 0;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\nreturn 1;\n }", "public function Cambiar_Estado_permiso($data){\n date_default_timezone_set('America/Bogota'); \n $fecha_actual = date('Y-m-d');\n try{\n $idusuario = $_SESSION['idUsuario'];\n $modelo = new HojaVida();\n \n $fechahora = $modelo->get_fecha_actual();\n $datosfecha = explode(\" \",$fechahora);\n $fechalog = $datosfecha[0];\n $horalog = $datosfecha[1];\n\n $accion = \"Se Actualiza de Estado la Solicitud de Permiso de Estudio \";\n $detalle = utf8_encode($_SESSION['nombre']).\" \".\"Se actualiza una Solicitud de Permiso \".$fechalog.\" \".\"a las: \".$horalog;\n $tipolog = 15;\n \n $idusuario = $_SESSION['idUsuario'];\n $dato_sec = $modelo->get_max_cons_resolucion();\n while($row = $dato_sec->fetch()){\n $contador = $row['con_consecutivo']+1;\n }\n $max = $contador;\n if($contador >= 0 && $contador <= 9){$contador = \"00\".$contador;}\n if($contador > 9 && $contador <= 99){$contador = \"0\".$contador;}\n\n if( $data->estado == 1){\n $valor = \"Se Aprueba \";\n }else if ($data->estado == 2){\n $valor = \"No Se Aprueba \";\n }else{\n $valor = \" \";\n }\n if($data->estado == 1)\n {\n $this->pdo->exec(\"UPDATE th_contador_resoluciones SET con_consecutivo ='$max'\");\n $sql = \"UPDATE th_permiso_estudio SET \n per_est_num_resolucion = ?, \n per_est_id_usuarioE = ?,\n per_est_fechaE = ?,\n per_est_estado = ?,\n per_est_observaciones = ?\n WHERE per_est_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array( \n $contador, \n $idusuario,\n $fecha_actual,\n $data->estado,\n $data->observaciones,\n $data->id\n )\n ); \n }\n else if ($data->estado == 2)\n {\n $sql = \"UPDATE th_permiso_estudio SET \n per_est_id_usuarioE = ?,\n per_est_fechaE = ?,\n per_est_estado = ?,\n per_est_observaciones = ?\n WHERE per_est_id = ?\";\n\n $this->pdo->prepare($sql)\n ->execute(\n array( \n $idusuario,\n $fecha_actual,\n $data->estado,\n $data->observaciones,\n $data->id\n )\n ); \n }\n $this->pdo->exec(\"INSERT INTO log (fecha, accion,detalle,idusuario,idtipolog) VALUES ('$fechalog', '$accion','$detalle','$idusuario','$tipolog')\");\n\n /*$bandera=1;\n if ($bandera == 1){ \n echo 'son las variables iguales';\n echo '<script language=\"javascript\">notifyMe();</script> ';\n } else {echo \"No son iguales!\";}*/\n } \n catch (Exception $ex) \n {\n die($ex->getMessage());\n }\n }", "function anular_PM_MM($id_mov)\r\n{\r\n global $db,$_ses_user;\r\n\r\n $db->StartTrans();\r\n $query=\"update movimiento_material set estado=3 where id_movimiento_material=$id_mov\";\r\n sql($query) or fin_pagina();\r\n $usuario=$_ses_user['name'];\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n //agregamos el log de anulacion del movimiento\r\n $query=\"insert into log_movimiento(fecha,usuario,tipo,id_movimiento_material)\r\n values('$fecha_hoy','$usuario','anulado',$id_mov)\";\r\n sql($query) or fin_pagina();\r\n\r\n //traemos el deposito de origen del MM o PM\r\n $query=\"select movimiento_material.deposito_origen\r\n \t\t from mov_material.movimiento_material\r\n \t\t where id_movimiento_material=$id_mov\";\r\n $orig=sql($query,\"<br>Error al traer el deposito origen del PM o MM<br>\") or fin_pagina();\r\n\r\n $deposito_origen=$orig->fields['deposito_origen'];\r\n descontar_reservados_mov($id_mov,$deposito_origen,1);\r\n\r\n $db->CompleteTrans();\r\n\r\n return \"El $titulo_pagina Nº $id_mov fue anulado con éxito\";\r\n}", "function marcadeagua($img_original, $img_marcadeagua, $img_nueva, $calidad)\n{\n $info_original = getimagesize($img_original);\n $anchura_original = $info_original[0];\n $altura_original = $info_original[1];\n // obtener datos de la \"marca de agua\" \n $info_marcadeagua = getimagesize($img_marcadeagua);\n $anchura_marcadeagua = $info_marcadeagua[0];\n $altura_marcadeagua = $info_marcadeagua[1];\n // calcular la posición donde debe copiarse la \"marca de agua\" en la fotografia \n $horizmargen = ($anchura_original - $anchura_marcadeagua)/2;\n $vertmargen = ($altura_original - $altura_marcadeagua)/2;\n // crear imagen desde el original \n $original = ImageCreateFromJPEG($img_original);\n ImageAlphaBlending($original, true);\n // crear nueva imagen desde la marca de agua \n $marcadeagua = ImageCreateFromPNG($img_marcadeagua);\n // copiar la \"marca de agua\" en la fotografia \n ImageCopy($original, $marcadeagua, $horizmargen, $vertmargen, 0, 0, $anchura_marcadeagua, $altura_marcadeagua);\n // guardar la nueva imagen \n ImageJPEG($original, $img_nueva, $calidad);\n // cerrar las imágenes \n ImageDestroy($original);\n ImageDestroy($marcadeagua);\n}", "function setCambiarTarjetas($tarjeta1,$tarjeta2,$tarjeta3,$tarjeta4,$tarjeta5,$partida){\n\t\t\t$cambio_afirmativo=0;\n\t\t\t\n\t\t\t$tarjetas=array(0=>$tarjeta1,1=>$tarjeta2,2=>$tarjeta3,3=>$tarjeta4,4=>$tarjeta5);\n\t\t\t\n\t\t\t$cantidad=0;\n\t\t\t\n\t\t\t$arreglo_tarjetas=array(0=>NULL,1=>NULL,2=>NULL);\n\t\t\t\t//meto en arreglo_tarjetas las tarjetas seleccionadas y cuentos cuantas son, si son mas de tres o menos de tres posteriormente retorno con 0\n\t\t\t$avanzar_arreglo=0;\n\t\t\t$veces_entre_foreach=0;\n\t\t\tforeach($tarjetas as $tarjeta){\n\t\t\t\tif($tarjeta == 1)\n\t\t\t\t\t\t\tif($partida->turno_usuario->getTarjeta($veces_entre_foreach)!=NULL){\n\t\t\t\t\t\t\t\t\t//digo que la tarjeta que esta en la posicion $avanzar_arreglo del usuario fue seleccionada\n\t\t\t\t\t\t\t\t$arreglo_tarjetas[$avanzar_arreglo]=$partida->turno_usuario->getTarjeta($veces_entre_foreach);\n\t\t\t\t\t\t\t\t$cantidad++;\n\t\t\t\t\t\t\t\t$avanzar_arreglo++;\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t$veces_entre_foreach++;\n\t\t\t}\n\t\t\t\t//envio mas o menos de tres tarjetas\n\t\t\tif($cantidad != 3){\n\t\t\t\treturn 1;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{ //envio tres tarjetas\n\t\t\t\t\n\t\t\t\t\t//alguna de las tres es un comodin\n\t\t\t\t\t\n\t\t\t\tif($arreglo_tarjetas[0]->getLogo() == 3 || $arreglo_tarjetas[1]->getLogo() == 3 || $arreglo_tarjetas[2]->getLogo() == 3 )\t{\n\t\t\t\t\t\t//realizar si o si cambio\n\t\t\t\t\t$cambio_afirmativo=1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t//si son todas iguales\n\t\t\t\t\tif(($arreglo_tarjetas[0]->getLogo() == $arreglo_tarjetas[1]->getLogo()) && ($arreglo_tarjetas[0]->getLogo() == $arreglo_tarjetas[2]->getLogo())){\n\t\t\t\t\t\t//realizar cambio\n\t\t\t\t\t$cambio_afirmativo=1;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//si son todas distintas\n\t\t\t\t\tif(($arreglo_tarjetas[0]->getLogo() != $arreglo_tarjetas[1]->getLogo()) && ($arreglo_tarjetas[0]->getLogo() != $arreglo_tarjetas[2]->getLogo()) && ($arreglo_tarjetas[1]->getLogo() != $arreglo_tarjetas[2]->getLogo()))\n\t\t\t\t\t\t//realizar cambio\n\t\t\t\t\t$cambio_afirmativo=1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t///se pueden cambiar, devuelvo las tarjetas al arreglo y le entrego fichas al usuario\n\t\t\t\tif($cambio_afirmativo == 1){\n\t\t\t\t\tfor($i=0;$i<3;$i++)\n\t\t\t\t\t\t\t//devuelve todas las tarjetas\n\t\t\t\t\t\t\t$partida->turno_usuario->setDevolverTarjeta($arreglo_tarjetas[$i],$partida);\n\n\t\t\t\t\t$partida->turno_usuario->getObjetoIncorporar()->setCambio($partida->turno_usuario->getNumeroDeCambio());\n\t\t\t\t\t$partida->turno_usuario->setNumeroDeCambio();\t\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n}", "function mot($chaine){\r\n $retourFinal = \"faux\";\r\n for($i=0;$i<laTaille($chaine);$i++){\r\n if(testAlphabet($chaine[$i])==\"vrai\"){\r\n $retour[$i]=\"vrai\";\r\n }\r\n else{\r\n $retour[$i]=\"faux\";\r\n }\r\n }\r\n $j=0;\r\n while($j<laTaille($chaine) && $retour[$j]==\"vrai\"){\r\n $j++;\r\n }\r\n if($j==laTaille($chaine)){\r\n $retourFinal = \"vrai\";\r\n }\r\n return $retourFinal;\r\n }", "public function tiltUpCamaraPresidencia() {\n\n self::$presidencia->moverArriba();\n\n }", "function motivoDeAnulacionAsig(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNAS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "protected function convertirMayuscula(){\n $cadena=strtoupper($this->tipo);\n $this->tipo=$cadena;\n }", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "function autorizar_producto_san_luis($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen,deposito_destino\r\n from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_origen = $res->fields[\"deposito_origen\"];\r\n $id_deposito_destino = $res->fields[\"deposito_destino\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM Producto San Luis nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"]; \r\n ///////////////////////////////////////\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n /////////////////////////////////////// \r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_origen,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n $comentario = \"Producto San Luis perteneciente al PM nro: $id_mov\";\r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$id_deposito_destino,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "public function pasaje_abonado();", "public function alterar(){\r\n // recebe dados do formulario\r\n $post = DadosFormulario::formularioCadastroSicasEspecialidadeMedica(2);\r\n // valida dados do formulario\r\n $oValidador = new ValidadorFormulario();\r\n if(!$oValidador->validaFormularioCadastroSicasEspecialidadeMedica($post, 2)){\r\n $this->msg = $oValidador->msg;\r\n return false;\r\n }\r\n // cria variaveis para validacao com as chaves do array\r\n foreach($post as $i => $v) $$i = utf8_encode($v);\r\n \r\n // cria objeto para grava-lo no BD\r\n $oSicasEspecialidadeMedica = new SicasEspecialidadeMedica($cd_especialidade_medica, $nm_especialidade, $status);\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n if(!$oSicasEspecialidadeMedicaBD->alterar($oSicasEspecialidadeMedica)){\r\n $this->msg = $oSicasEspecialidadeMedicaBD->msg;\r\n return false;\r\n }\r\n return true;\r\n }", "static public function agregarCamionesControlador()\n\t{\n\n\t\tif (isset($_POST[\"nuevoDescripcion\"])) {\n\n\t\t\tif (preg_match('/^[a-zA-ZñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoDescripcion\"])) {\n\n\n\t\t\t\t$tabla = \"CAMIONES\";\n\n\t\t\t\t$conductor = null;\n\t\t\t\tif (empty($_POST[\"nuevoConductorCamiones\"])) {\n\t\t\t\t\t$conductor = \"1\";\n\t\t\t\t} else {\n\t\t\t\t\t$conductor = $_POST[\"nuevoConductorCamiones\"];\n\t\t\t\t}\n\t\t\t\t$datos = array(\n\t\t\t\t\t\"DESCRIPCION\" => $_POST[\"nuevoDescripcion\"],\n\t\t\t\t\t\"NUMERO_SERIE\" => $_POST[\"nuevoNumSerie\"],\n\t\t\t\t\t\"NUMERO_PLACAS\" => $_POST[\"nuevoPlacas\"],\n\t\t\t\t\t\"NOMBRE_CAMION\" => $_POST[\"nuevoNombreCamion\"],\n\t\t\t\t\t\"MODELO\" => $_POST[\"nuevoModelo\"],\n\t\t\t\t\t\"TIPO_CAMION\" => $_POST[\"nuevoTipoCamiones\"],\n\t\t\t\t\t\"ID_SUCURSALES\" => $_POST[\"nuevoSucursalConductores\"],\n\t\t\t\t\t\"ID_CONDUCTORES\" => $conductor,\n\t\t\t\t\t\"ESTATUS_CAMIONES\" => $_POST[\"nuevoEstatusCamiones\"]\n\t\t\t\t);\n\n\t\t\t\t$respuesta = ModeloCamiones::agregarCamionesModelo($tabla, $datos);\n\n\n\t\t\t\tif ($respuesta == \"ok\") {\n\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\tswal({\n\t\t\t\t\t\t\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡Registro guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\n\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"camiones\";\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t</script>';\n\t\t\t\t} else {\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\tswal({\n\t\t\t\t\t\t\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El registro no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\n\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\twindow.location = \"camiones\";\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t</script>';\n\t\t\t\t}\n\n\t\t\t\tif ($respuesta != \"ok\") {\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\tswal({\n\t\t\t\t\t\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\ttitle: \"¡Error con Base de Datos !\",\n\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\n\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\n\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\twindow.location = \"camiones\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\n \t</script>';\n\n\t\t\t\t\t// var_dump($datos);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\tswal({\n\t\t\t\t\t\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\ttitle: \"¡El registro contiene numeros!\",\n\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\n\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\n\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\twindow.location = \"camiones\";\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\t</script>';\n\t\t\t}\n\t\t}\n\t}", "function setCobrar($tarjeta1,$tarjeta2,$tarjeta3,$tarjeta4,$tarjeta5,$partida){\n\t$tarjetas=array(0=>$tarjeta1,1=>$tarjeta2,2=>$tarjeta3,3=>$tarjeta4,4=>$tarjeta5);\n\t$tarjeta_cambio;\n\t$veces_entre_foreach=0;\n\t$cantidad=0;\n\t\t\t//pregunta si el usuario saco tarjeta en la ronda, si no saco no puede cambiar ninguna de las que ya tiene(por esto ese if)\n\tif($partida->turno_usuario->getSaqueTarjeta() == 1){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tforeach($tarjetas as $tarjeta){\n\t\t\t\tif($tarjeta == 1){\n\t\t\t\t\tif($partida->turno_usuario->getTarjeta($veces_entre_foreach)!=NULL ){\n\t\t\t\t\t\t\t//solamente puede tomar una tarjeta, porque es cobrar, si hay mas de una seleccionadada cantidad de hace mas de 1 y el cambio no se realiza\n\t\t\t\t\t\tif($cantidad < 1){\n\t\t\t\t\t\t\t\t//digo que la tarjeta que esta en la posicion $avanzar_arreglo del usuario fue seleccionada\n\t\t\t\t\t\t\t$tarjeta_cambio=$partida->turno_usuario->getTarjeta($veces_entre_foreach);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cantidad++;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$veces_entre_foreach++;\n\t\t\t}//foreach($tarjetas as $tarjeta){\n\t\t\t\n\t\t\t\t//si se selecciono una y solo una tarjeta\n\t\t\tif($cantidad == 1){\n\t\t\t\t\t//compruebo si la tarjeta esta en estado de ser cambiada\n\t\t\t\tif($tarjeta_cambio->getEstado() == 0 ){\n\t\t\t\t\t\t\n\t\t\t\t\t$id_pais=$tarjeta_cambio->getIdPais();\n\t\t\t\t\t\t//recorro todos los paises \n\t\t\t\t\tforeach($partida->paises as $pais){\t\n\t\t\t\t\t\t\t//compruebo si id del usuario en turno es igual al del propietario del pais que selecciona el foreach Y aparte compruebo que \n\t\t\t\t\t\t\t//el pais al que hace referencia la tarjeta sea el seleccionado por el foreach\n\t\t\t\t\t\tif($id_pais == $pais->getId() && $partida->turno_usuario->getId() == $pais->getPropietario()->getId() )\t{\n\t\t\t\t\t\t\t\t//cambio el estado de la tarjeta\n\t\t\t\t\t\t\t$tarjeta_cambio->setEstado(1);\n\t\t\t\t\t\t\t\t//le entrego al pais al que hace referencia 2 fichas\n\t\t\t\t\t\t\t$pais->setFichas(2);\n\t\t\t\t\t\t\t\t//reseteo el saco tarjeta, para que en la misma ronda no pueda cobrar dos tarjetas\n\t\t\t\t\t\t\t$partida->turno_usuario->setSaqueTarjetaReset();\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//if($cantidad == 1){\n\t\t\t\n\t}//if($partida->turno_usuario->getSaqueTarjeta() == 1){\t\n}", "public function valorpasaje();", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "public function verCamara1EnPlasma( ) {\n\n $respuesta=self::$plasma->verEntradaPantallaAV2();\n return $this->isError($respuesta,\"ver la camara1 en\");\n }", "public function ruta_critica()\n {\n $this->tpi_mas_dij();\n $this->tp_j();\n $this->ttj_menos_dij();\n $this->tt_i();\n\n // Identificaión de las actividades de la ruta crítica\n $this->identificacion();\n // TT¡ (2) = TP¡ (0)\n // TTj (3) = TPj (1)\n // TTj (3) - TT¡ (2) = TPj (1) - TP¡ (0) = d¡j\n $ruta_critica = [[]];\n $num_act = -1;\n $this->tablero->imprimir(false);\n for ($m = 0; $m < $this->d->_m; $m++) {\n for ($n = 0; $n < $this->d->_n; $n++) {\n if ($this->d->_datos[$m][$n] >= 0 && $n < $this->d->_n) {\n $num_act++;\n $ruta_critica[$num_act][0] = 0;\n if ($this->tablero->_datos[$num_act][3] !== $this->tablero->_datos[$num_act][1]) continue;\n if ($this->tablero->_datos[$num_act][4] !== $this->tablero->_datos[$num_act][2]) continue;\n if ($this->tablero->_datos[$num_act][4] - $this->tablero->_datos[$num_act][3] !== $this->d->_datos[$m][$n]) continue;\n if ($this->tablero->_datos[$num_act][2] - $this->tablero->_datos[$num_act][1] !== $this->d->_datos[$m][$n]) continue;\n //echo \"num: $num_act: \" . $this->tablero->_datos[$num_act][0] . ' ' . $this->tablero->_datos[$num_act][1] . ' '. $this->tablero->_datos[$num_act][2] . ' ' . $this->tablero->_datos[$num_act][3] . '<br>';\n //echo \"num: $num_act<br>\" ;\n $ruta_critica[$num_act][0] = 1;\n }\n }\n }\n $tablero_index = new Matriz([\n ['ACT','TPi', 'TPj', 'TTi', 'TTj', 'dij', 'ITij', 'FPij', 'HTij', 'HLij']\n ]);\n $RC = new Matriz($ruta_critica);\n $RC->imprimir(true);\n $tablero_index->imprimir(true);\n\n }", "function verificarSolapamiento($horario, $duracion, $idTeatroNuevaFuncion){\r\n $funcionTeatro = new FuncionTeatro('', '', '', '', '');\r\n $coleccionFuncionesTeatro = $funcionTeatro->listar(\"\");\r\n $cine = new Cine('','','','','','','');\r\n $coleccionCines = $cine->listar(\"\");\r\n $musical = new Musical('','','','','','','');\r\n $coleccionMusicales = $musical->listar(\"\");\r\n\r\n $retorno = false;\r\n\r\n list($horaFuncion, $minutosFuncion) = explode(\":\", $horario); //Extraigo la hora y los minutos separados por el \":\"\r\n $hora = intval($horaFuncion); //Convierto la hora de string a entero\r\n $minutos = intval($minutosFuncion); //Convierto los minutos de string a entero\r\n\r\n $horarioInicioFuncion = (($hora * 60) + $minutos); //Convierto el horario de INICIO de la nueva funcion a minutos\r\n $horarioCierreFuncion = $horarioInicioFuncion + $duracion; //Horario de CIERRE de la nueva funcion\r\n\r\n $horarioFuncionNueva = array('inicio'=>$horarioInicioFuncion, 'cierre'=>$horarioCierreFuncion);\r\n\r\n $coleccionHorarios = [];\r\n\r\n //Sumo los horarios de cada tipo\r\n $coleccionHorarios = armarColeccionHorarios($coleccionFuncionesTeatro, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionCines, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n $coleccionHorarios = armarColeccionHorarios($coleccionMusicales, $idTeatroNuevaFuncion, $coleccionHorarios);\r\n\r\n if (count($coleccionHorarios)>0){\r\n $horarioDisponible = verificarHorario($horarioFuncionNueva, $coleccionHorarios);\r\n if ($horarioDisponible){\r\n $retorno = true;\r\n }\r\n } else {\r\n $retorno = true;\r\n }\r\n\r\n return $retorno;\r\n}", "function hitungDenda(){\n\n return 0;\n }", "function autorizar_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock de RMA \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \t\r\n\t incrementar_stock_rma($id_prod_esp,$cantidad,\"\",$comentario,1,\"\",$descripcion,1,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",$id_mov);\r\n\t $res->movenext();\r\n }//del \r\n $db->completetrans();\r\n\r\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento('pagina', $_GET['id_tabla'], 'insercion');\n\n Armado_Titulo::forzarTitulo(Generales_FiltrosOrden::obtenerMenuLinkTitulo());\n\n // encabezados necesarios para el funcionamiento de los elementos de la pagina\n $this->_armadoPlantillaSet('cabeceras', Armado_Cabeceras::armado('formulario'));\n\n $armado_botonera = new Armado_Botonera();\n\n $this->_armadoPlantillaSet('datos_pagina', 'url=\"' . $_SERVER['REQUEST_URI'] . '\"');\n\n if (isset($_GET['id_ocultar_cp'])) {\n Armado_DesplegableOcultos::agregarComponenteOculto($_GET['id_tabla'], $_GET['id_ocultar_cp']);\n exit;\n } elseif (isset($_GET['id_mostrar_cp'])) {\n Armado_DesplegableOcultos::eliminarComponenteOculto($_GET['id_tabla'], $_GET['id_mostrar_cp']);\n exit;\n } elseif (isset($_GET['mostrar_todo'])) {\n Armado_DesplegableOcultos::eliminarComponenteOcultoTodos($_GET['id_tabla']);\n exit;\n }\n\n if (!isset($_GET['tipo_pagina']) || ($_GET['tipo_pagina'] != 'pop')) {\n\n $parametros = array('kk_generar' => '0', 'accion' => '38', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('guardar', $parametros);\n\n $parametros = array('kk_generar' => '0', 'accion' => '38', 'id_tabla' => $_GET['id_tabla'], 'siguiente' => 'ver');\n $armado_botonera->armar('guardar_ver', $parametros);\n\n $parametros = array('kk_generar' => '0', 'accion' => '37', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('volver_post', $parametros, 'volver');\n } else {\n\n $parametros = array('kk_generar' => '0', 'accion' => '38', 'id_tabla' => $_GET['id_tabla'], 'tipo_pagina' => 'pop');\n $armado_botonera->armar('guardar', $parametros);\n\n $parametros = array('kk_generar' => '0', 'accion' => '37', 'id_tabla' => $_GET['id_tabla'], 'tipo_pagina' => 'pop');\n $armado_botonera->armar('volver_post', $parametros, 'volver');\n }\n\n // se obtiene el nombre de la pagina y el id de la misma\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado();\n $tabla_nombre = $datos_tabla['prefijo'] . '_' . $datos_tabla['nombre'];\n $tabla_tipo = $datos_tabla['tipo'];\n\n // creo una matriz con los campos de los componentes de la pagina\n $matriz_componentes = Consultas_MatrizObtenerDeComponenteTablaYParametros::armado('todos');\n\n $componente_armado = '<div class=\"contenido_separador\"></div>';\n\n if ($matriz_componentes) {\n foreach ($matriz_componentes as $id => $value) {\n $componente_armado .= Generales_LlamadoAComponentesYTraduccion::armar('RegistroVer', 'registroAltaPrevia', '', $value, $value['cp_nombre'], $value['cp_id']);\n\n if (Armado_DesplegableOcultos::mostrarOcultos() === true) {\n if ($value['idioma_' . Generales_Idioma::obtener()] == '') {\n $value['idioma_' . Generales_Idioma::obtener()] = '---';\n }\n Armado_DesplegableOcultos::cargaIdComponente($value['cp_id'], $value['idioma_' . Generales_Idioma::obtener()]);\n }\n }\n }\n\n if (Armado_DesplegableOcultos::mostrarOcultos() === true) {\n $desplegable_ocultos = new Armado_DesplegableOcultos();\n $desplegable_ocultos->armar();\n }\n\n return $componente_armado;\n }", "function autorizar_esp_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov, a travez de una Autorizacion Especial\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el deposito origen es Buenos Aires que es igual a 2 segun la tabla general.depositos \r\n\t $deposito_origen='2';\r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$deposito_origen,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function updateLevanteCabeza($arregloDatos) {\n if($arregloDatos[parcial]) {\n $arregloDatos[num_grupo] = $this->datos->ultimoGrupoCreado($arregloDatos) + 1;\n $this->datos->updateConteoParciales($arregloDatos);\n } else { // si no marco como parcial se hace de nuevo el conteo y se actualiza\n $gruposcreados = $this->datos->ultimoGrupoCreado($arregloDatos);\n $grupossolicitados = $this->datos->ultimoGrupo($arregloDatos);\n if(grupossolicitados > $gruposcreados) { // se decidio no crear el parcial\n $arregloDatos[num_grupo] = $gruposcreados; // se actualiza el numero real de grupos\n $this->datos->updateConteoParciales($arregloDatos);\n }\n }\n $arregloDatos[mostrar] = 1;\n $this->datos->setCabezaLevante($arregloDatos);\n $arregloDatos[plantilla] = 'levanteCabeza.html';\n $arregloDatos[thisFunction] = 'getCabezaLevante';\n $this->pantalla->setFuncion($arregloDatos,$this->datos);\n }", "public function recivirClases( ) {\n AccesoGui::$guiSistema->esperarInicioSistema();\n\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_RECIBIR_CLASE);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n ConexionServidorCliente::$ctrlGuiPantallas->bajarPantallaElectrica();\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLuzSala(Automata::$intensidades[\"media\"]);//intensidad media\n AccesoControladoresDispositivos::$ctrlLuz->encenderLucesSuelo();\n if(!AccesoControladoresDispositivos::$ctrlPantallas->isEncendidaPresidencia()) {\n ConexionServidorCliente::$ctrlGuiPantallas->presidenciaEncender();\n usleep(5000000);\n AccesoControladoresDispositivos::$ctrlPantallas->verEntradaPresidenciaAV1();\n }else {\n AccesoControladoresDispositivos::$ctrlPantallas->quitarPIPPresidencia();\n }\n usleep(1000000);\n ConexionServidorCliente::$ctrlGuiPantallas->presidenciaVideoConferencia();\n ConexionServidorCliente::$ctrlGuiPlasmas->encender();\n ConexionServidorCliente::$ctrlGuiProyectores->encenderCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->encenderPizarra();\n AccesoControladoresDispositivos::$ctrlFoco->encender();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\nAccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n ConexionServidorCliente::$ctrlGuiPlasmas->verVideoSalaEnPlasma();\n ConexionServidorCliente::$ctrlGuiProyectores->activarCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->activarPizarra();\n ConexionServidorCliente::$ctrlGuiProyectores->verPCSalaEnCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->verVideoconferenciaEnPizarra();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarNuestroSonido();\n AccesoControladoresDispositivos::$ctrlVideoconferencia->conectar();\n AccesoGui::$guiEscenarios->escenarioRecivirClase();\n AccesoGui::$guiMenus->menuPrincipal(true);\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n\n\n }", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "function cc_ho_vetrina($agenzia, $rif){\n\tglobal $invetrina;\n\t\n\t// $agenzia qua è il numero interno di Cometa\n\tif( isset( $invetrina[$agenzia] ) ){\t\t\n\t\t\n\t\tif ($invetrina[$agenzia]['imm'] == $rif) {\n\t\t\t// questo immobile è in vetrina\n\t\t\t$vetrina = '1';\n\t\t\tcc_import_immobili_error_log($rif.\" è in vetrina\");\n\t\t\t\n\t\t\t// vediamo se è lo stesso di quello che era già in vetrina o meno\n\t\t\t$oldrif = cc_get_rif_vetrina( substr($rif, 0, 2) );\n\t\t\tcc_import_immobili_error_log(\"oldrif: \".$oldrif);\n\t\t\t\n\t\t\t// se l'immobile attualemnte in vetrina non è questo tolgo quello attuale da vetrina\n\t\t\tif($oldrif != $rif) {\n\t\t\t\tcc_updateVetrina($oldrif); \n\t\t\t\tcc_import_immobili_error_log(\"Tolgo vetrina da \".$oldrif);\n\t\t\t}\n\t\t}else{\n\t\t\t$vetrina = '0';\n\t\t}\t\t\n\t\n\t}else{\n\t\t$vetrina = '0';\n\t}\n\t\n\treturn $vetrina;\n}", "function agrega_emergencia_ctraslado (\n $_fecha,$_telefono,\n $_plan,$_horallam,\n $_socio,$_nombre,\n $_tiposocio,$_edad,$_sexo,\n $_identificacion,$_documento,\n $_calle,$_numero,\n $_piso,$_depto,\n $_casa,$_monoblok,\n $_barrio,$_entre1,\n $_entre2,$_localidad,\n $_referencia,$_zona,\n $_motivo1,\n $_color,\n $_observa1,$_observa2,\n $_opedesp ,\n\t\t\t\t\t\t\t$_nosocio1 , $_noedad1 , $_nosexo1, $_noiden1 , $_nodocum1 ,\n\t\t\t\t\t\t\t$_nosocio2 , $_noedad2 , $_nosexo2, $_noiden2 , $_nodocum2 ,\n\t\t\t\t\t\t\t$_nosocio3 , $_noedad3 , $_nosexo3, $_noiden3 , $_nodocum3 ,\n\t\t\t\t\t\t\t$_nosocio4 , $_noedad4 , $_nosexo4, $_noiden4 , $_nodocum4 ,\n\t\t\t\t\t\t\t$_nosocio5 , $_noedad5 , $_nosexo5, $_noiden5 , $_nodocum5 ,\n $_bandera_nosocio1 ,$_bandera_nosocio2 ,$_bandera_nosocio3 ,$_bandera_nosocio4 ,\n\t\t\t\t\t\t\t$_bandera_nosocio5 \n )\n{\n $moti_explode ['0'] = substr($_motivo1, 0, 1);\n $moti_explode ['1'] = substr($_motivo1, 1, 2);\n\n // CALCULO DE FECHA Y DIA EN QUE SE MUESTRA EL TRASLADO EN PANTALLA\n $fecha_aux = explode (\".\" ,$_fecha );\n $hora_aux = explode (\":\" ,$_horallam);\n\n $_dia_tr =$fecha_aux[2];\n $_mes_tr =$fecha_aux[1];\n $_anio_tr =$fecha_aux[0];\n $_hora_tr =$hora_aux[0];\n $_min_tr =$hora_aux[1];\n $_param_tr =12; // parametro para mostrar en pantalla\n \n $traslado_aux = restaTimestamp ($_dia_tr , $_mes_tr, $_anio_tr , $_hora_tr , $_min_tr , $_param_tr);\n //***********************************************************\n $_plan = $_plan + 0;\n $insert_atencion = '\n insert into atenciones_temp\n (fecha,telefono,plan,\n horallam,socio,\n nombre,tiposocio,\n edad,sexo,\n identificacion,documento,\n calle,numero,\n piso,depto,casa,\n monoblok,barrio,\n entre1,entre2,\n localidad,referencia,\n zona,motivo1,\n motivo2,\n color,observa1,\n observa2,operec,traslado_aux ,fechallam)\n\n values\n\n (\n \"'.$_fecha.'\" , \"'.$_telefono.'\" , \"'.$_plan.'\" ,\n \"'.$_horallam.'\",\"'.$_socio.'\",\n \"'.utf8_decode($_nombre).'\",\"'.$_tiposocio.'\",\n \"'.$_edad.'\",\"'.$_sexo.'\",\n \"'.utf8_decode($_identificacion).'\",\"'.$_documento.'\",\n \"'.utf8_decode($_calle).'\",\"'.utf8_decode($_numero).'\",\n \"'.utf8_decode($_piso).'\",\"'.utf8_decode($_depto).'\",\n \"'.utf8_decode($_casa).'\",\"'.utf8_decode($_monoblok).'\",\n \"'.utf8_decode($_barrio).'\",\"'.utf8_decode($_entre1).'\",\n \"'.utf8_decode($_entre2).'\",\"'.utf8_decode($_localidad).'\",\n \"'.utf8_decode($_referencia).'\",\"'.$_zona.'\",\n '.$moti_explode[0].',\n '.$moti_explode[1].','.$_color.',\n \"'.utf8_decode($_observa1).'\",\"'.utf8_decode($_observa2).'\",\n \"'.utf8_decode($_opedesp).'\", \"'.$traslado_aux.'\" , \"'.$_fecha.'\"\n )\n ';\n\n // insert de la emergencia en atenciones temp\n global $G_legajo , $parametros_js;\n $result = mysql_query($insert_atencion);\n if (!$result) {\n $boton = '<input type=\"button\" value=\"Error! modificar y presionar nuevamente\"\n\t\t\t onclick=\" check_emergencia(\n\t\t\t document.formulario.muestra_fecha.value,document.formulario.telefono.value,\n\t\t\t document.formulario.i_busca_plan.value,document.formulario.hora.value,\n\t\t\t document.formulario.td_padron_idpadron.value,document.formulario.td_padron_nombre.value,\n\t\t\t document.formulario.td_padron_tiposocio.value,document.formulario.td_padron_edad.value,\n\t\t\t document.formulario.td_padron_sexo.value,document.formulario.td_padron_identi.value,\n\t\t\t document.formulario.td_padron_docum.value,document.formulario.td_padron_calle.value,\n\t\t\t document.formulario.td_padron_nro.value,document.formulario.td_padron_piso.value,\n\t\t\t document.formulario.td_padron_depto.value,document.formulario.td_padron_casa.value,\n\t\t\t document.formulario.td_padron_mon.value,document.formulario.td_padron_barrio.value,\n\t\t\t document.formulario.td_padron_entre1.value,document.formulario.td_padron_entre2.value,\n\t\t\t document.formulario.td_padron_localidad.value,document.formulario.referencia.value,\n\t\t\t document.formulario.s_lista_zonas.value,document.formulario.i_busca_motivos.value,\n\t\t\t document.formulario.s_lista_colores.value,document.formulario.obs1.value,\n\t\t\t document.formulario.obs2.value,'.$G_legajo.' ,\n\t\t\t document.formulario.check_traslado.value , document.formulario.dia_traslado.value ,\n\t\t\t document.formulario.mes_traslado.value , document.formulario.anio_traslado.value ,\n\t\t\t document.formulario.hora_traslado.value , document.formulario.minuto_traslado.value ,\n\t\t\t\t\t '.$parametros_js.' \n \t );\"/> ';\n \n }else \n {\n $boton = '<input type=\"button\" value=\"CERRAR CON EXITO\" onclick=\"window.close();\"/>';\n \n\n\n\t // recupero id para hacer altas de clientes no apadronados\n\t $consulta_id = mysql_query ('select id from atenciones_temp\n\t where fecha = \"'.$_fecha.'\" and plan = \"'.$_plan.'\"\n\t and horallam = \"'.$_horallam.'\" and nombre = \"'.$_nombre.'\"\n\t and tiposocio = \"'.$_tiposocio.'\" and motivo1 = '.$moti_explode[0].'\n\t and motivo2 = '.$moti_explode[1]);\n\n\n\t $fetch_idatencion=mysql_fetch_array($consulta_id);\n\n\n\t\tif ($_bandera_nosocio1 == 1) { $insert_nosocio1 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio1.'\" , \"'.$_noedad1.'\" , \"'.$_nosexo1.'\" , \"'.$_noiden1.'\" , \"'.$_nodocum1.'\" ) '); }\n\t\tif ($_bandera_nosocio2 == 1) { $insert_nosocio2 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio2.'\" , \"'.$_noedad2.'\" , \"'.$_nosexo2.'\" , \"'.$_noiden2.'\" , \"'.$_nodocum2.'\" ) '); }\n\t\tif ($_bandera_nosocio3 == 1) { $insert_nosocio3 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio3.'\" , \"'.$_noedad3.'\" , \"'.$_nosexo3.'\" , \"'.$_noiden3.'\" , \"'.$_nodocum3.'\" ) '); }\n\t\tif ($_bandera_nosocio4 == 1) { $insert_nosocio4 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio4.'\" , \"'.$_noedad4.'\" , \"'.$_nosexo4.'\" , \"'.$_noiden4.'\" , \"'.$_nodocum4.'\" ) '); }\n\t\tif ($_bandera_nosocio5 == 1) { $insert_nosocio5 = mysql_query ('insert into clientes_nopadron (idatencion , nombre , edad , sexo , os , dni) values (\"'.$fetch_idatencion['id'].'\" , \"'.$_nosocio5.'\" , \"'.$_noedad5.'\" , \"'.$_nosexo5.'\" , \"'.$_noiden5.'\" , \"'.$_nodocum5.'\" ) '); }\n }\n // mysql_query($insert_atencion);\n $insert_atencion='';\n //$insert_atencion='';\n //instanciamos el objeto para generar la respuesta con ajax\n $respuesta = new xajaxResponse();\n //escribimos en la capa con id=\"respuesta\" el texto que aparece en $salida\n $respuesta->addAssign(\"mensaje_agrega\",\"innerHTML\",$boton);\n\n //tenemos que devolver la instanciaci�n del objeto xajaxResponse\n return $respuesta;\n}", "public function panRightCamaraPresidencia() {\n\n self::$presidencia->moverALaDerecha();\n\n }", "private function comprobarCasillasLibres()\r\n {\r\n if (($this->minasMarcadas <= $this->getMaxMinas()) && ($this->minasMarcadas + $this->casillasDescubiertas) == $this->maxCasillas) //victoria\r\n $this->finalizarJuego(true);\r\n }", "function getMerezcoTarjeta(){\n\t\tif($this->numero_cambio >= 3)\n\t\t\t$necesito=2;\n\t\telse\n\t\t\t$necesito=1;\n\t\t\n\t\tif($necesito <= $this->sacar_tarjeta){\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 0;\n\t\t}\n\t}", "function Actualizar() {\n /**\n * Crear instancia de EstacionHidrometrica\n */\n $EstacionHidrometrica = new EstacionHidrometrica();\n /**\n * Colocar los datos del POST por medio de los metodos SET\n */\n $EstacionHidrometrica->setIdEstacion(filter_input(INPUT_GET, 'clave'));\n $EstacionHidrometrica->setNombre(filter_input(INPUT_GET, 'nombre'));\n $EstacionHidrometrica->setCuenca_id(filter_input(INPUT_GET, 'cuenca_id'));\n $EstacionHidrometrica->setCorriente(filter_input(INPUT_GET, 'corriente'));\n $EstacionHidrometrica->setRegion_id(filter_input(INPUT_GET, 'region_id'));\n $EstacionHidrometrica->setEstado_id(filter_input(INPUT_GET, 'estado_id'));\n $EstacionHidrometrica->setLatitud(filter_input(INPUT_GET, 'latitud'));\n $EstacionHidrometrica->setLongitud(filter_input(INPUT_GET, 'longitud'));\n if ($EstacionHidrometrica->Update() != null) {\n echo 'OK';\n } else {\n echo 'Algo salío mal :(';\n }\n}", "function sobre_planeacion($minimoMes,$maximoMes,$vigencia,$unidades,$tipo_usuario)\n\t\t{\n\t\t\t//$tipo_usuario ALMACENA EL TIPO DE USUARIO( I O E), EN UN ARRAY, ESTE SE CARGA EN LA PAGINA DE PLANEACION DE PROYECTOS (upHTplaneacionProy.PHP)\t\n//echo $unidades[0].\" - $minimoMes - $maximoMes - $vigencia ********************** <br><br>\";\n\t\t?>\n\n<?\t\t\n\t\t$ban_reg=0; //PERMITE IDENTIFICAR, SI SE ENCONTRO ALMENOS, UN USUARIO SOBRE PLANEADO, DE NO SER ASI, NO SE ENVIA EL CORREO\n\t\t$pTema ='<table width=\"100%\" border=\"0\">\n\t\t <tr class=\"Estilo2\" >\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td width=\"5%\" >Asunto:</td>\n\t\t\t<td >Sobre planeaci&oacute;n de participantes.</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t \n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\">Los siguientes participantes, tienen una dedicaci&oacute;n superior a 1 en los siguientes proyectos:</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t </tr>\n\t\t\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\" >\n\t\t\t\t<table width=\"100%\" border=\"1\" >\n\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t\t<td colspan=\"'.(($maximoMes-$minimoMes)+1).'\" align=\"center\" >'.$vigencia.'</td>\n\t\t\t\t </tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td>Unidad</td>\n\t\t\t\t\t<td>Nombre</td>\n\t\t\t\t\t<td>Departamento</td>\n\t\t\t\t\t<td>Divisi&oacute;n</td>\n\t\t\t\t\t<td>Proyecto</td>';\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$vMeses= array(\"\",\"Ene\",\"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"); \n\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t{\n\n\t\t\t\t\t $pTema = $pTema.'<td>'.$vMeses[$m].' </td>';\n\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\n\t\t\t\t $pTema = $pTema.' </tr>';\n\t\t\t\t$cur_tipo_usu=0; //CURSOR DEL ARRAY, DEL TIPO DE USUARIO \n\t\t\t\tforeach($unidades as $unid)\n\t\t\t\t{\n//tipo_usuario\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"I\")\t\n\t\t\t\t\t{\n\t\t\t\t\t//CONSULTA SI EL USUARIO ESTA SOBREPLANEADO EN ALMENOS, UN MES DURANTE LA VIGENCIA\n\n\t\t\t\t\t//COSNULTA PARA LOS USUARIOS INTERNOS\n\t\t\t\t\t\t\t$sql_planea_usu=\"select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, Usuarios.nombre, \n\t\t\t\t\t\t\t\t\t\t\tUsuarios.apellidos ,Divisiones.nombre as div,Departamentos.nombre as dep\n\t\t\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t\t inner join Usuarios on PlaneacionProyectos.unidad=Usuarios.unidad \n\t\t\t\t\t\t\t\t\t\t\t inner join Departamentos on Departamentos.id_departamento=Usuarios.id_departamento \n\t\t\t\t\t\t\t\t\t\t\t inner join Divisiones on Divisiones.id_division=Departamentos.id_division \n\t\t\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \"; \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\t\t//PlaneacionProyectos.id_proyecto,\t\t\t\t\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\t\t\tand esInterno='I'\n\t\t\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,Usuarios.nombre, Usuarios.apellidos,Divisiones.nombre ,Departamentos.nombre \n\t\t\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"E\")\t\n\t\t\t\t\t{\n\t\t\t\t\t\t//COSNULTA PARA LOS USUARIOS EXTERNOS\n\t\t\t\t\t\t$sql_planea_usu=\" select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, TrabajadoresExternos.nombre, \n\t\t\t\t\t\t\t\t\tTrabajadoresExternos.apellidos,'' div, ''dep\n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t inner join TrabajadoresExternos on PlaneacionProyectos.unidad=TrabajadoresExternos.consecutivo \n\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\tand esInterno='E'\n\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,TrabajadoresExternos.nombre, TrabajadoresExternos.apellidos\n\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \t\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$cur_planea_usu=mssql_query($sql_planea_usu);\n//echo $sql_planea_usu.\" ---- <br>\".mssql_get_last_message().\" *** \".mssql_num_rows($cur_planea_usu).\"<br>\";\n\t\t\t\t\twhile($datos__planea_usu=mssql_fetch_array($cur_planea_usu))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ban_reg=1; //SI ENCUENTRA ALMENOS UN USUARIO SOBREPLANEADO, ENVIA EL CORREO\n\t\t\t\t\n\t\t\t\t\t\t//CONSULTA LOS PROYECTOS, EN LOS CUALES EL PARTICIAPENTE HA SIDO PLANEADO, ESTO PARA PODER DOBUJAR LA TABLA DE FORMA CORRECTA\n\t\t\t\t\t\t$sql_uu=\" select distinct(id_proyecto),nombre,codigo,cargo_defecto from (select SUM (hombresMes) as total_hombre_mes ,unidad, mes,PlaneacionProyectos.id_proyecto ,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto \n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos\n\t\t\t\t\t\t\t\t\t\tinner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\n\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql_uu=$sql_uu.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]=0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql_uu=$sql_uu.\"0) and unidad in(\".$unid.\") and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by unidad, mes , PlaneacionProyectos.id_proyecto,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto ) aa \";\n// HAVING (SUM (hombresMes)\t>1\t\n\t\t\t\t\t\t$cur_uu=mssql_query($sql_uu);\n\t\t\t\t\t\t$cant_proy=mssql_num_rows($cur_uu);\n//echo \"<br><BR>---//**************--------------\".$sql_uu.\" \".mssql_get_last_message().\"<br>\".$cant_proy.\"<br>\";\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<?\n\t\t\t\t//echo $sql_proy_planea.\" ---- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\n\t\t\t\t\t\t$total_planeado= array();\n\t\t\t\t\t\t$cont=0;\n\t\t\t\t\t\twhile($datos_uu=mssql_fetch_array($cur_uu))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($cont==0)\n\t\t\t\t\t\t\t{\n\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\t\t\t\t\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \"> '.$datos__planea_usu[\"unidad\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'.$datos__planea_usu[\"apellidos\"].' '.$datos__planea_usu[\"nombre\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"dep\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"div\"].' </td>';\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" >['.$datos_uu[\"codigo\"].'.'.$datos_uu[\"cargo_defecto\"].'] '. $datos_uu[\"nombre\"].' </td>';\n\n\t\t\t\t\t\t\t//CONSULTA LA INFORMACION DE LO PLANEADO EN CADA MES, DE ACUERDO AL PORYECTO CONSULTADO\n\t\t\t\t\t\t\t$sql_pro=\"select SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.id_proyecto,PlaneacionProyectos.unidad,mes\n\t\t\t\t\t\t\t\t\t\t from PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and PlaneacionProyectos.unidad=\".$unid.\" and id_proyecto=\".$datos_uu[\"id_proyecto\"].\" and mes in(\";\n\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" 0) and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by PlaneacionProyectos.id_proyecto ,PlaneacionProyectos.unidad ,mes order by (mes) \";\n// HAVING (SUM (hombresMes))>1\n\t\t\t\t\t\t\t$cur_proy_planea=mssql_query($sql_pro);\n//\t\t\t\techo $sql_pro.\" --22222222222-- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\t\t\t$m=$minimoMes;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($datos_proy_planea=mssql_fetch_array($cur_proy_planea))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tfor ($m;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($datos_proy_planea[\"mes\"]==$m)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]+=( (float) $datos_proy_planea[\"total_hombre_mes\"]);\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" align=\"right\" >'.((float) $datos_proy_planea[\"total_hombre_mes\"] ).'</td>';\n\n\t\t\t\t\t\t\t\t\t\t$m=$datos_proy_planea[\"mes\"];\n\t\t\t\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp; </td>';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m--;\n\t\t\t\t\t\t\tfor ($m++;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t\tunset($datos_proy_planea);\n\n\t\t\t\t\t\t\t $pTema = $pTema.' </tr>';\n\n\t\t\t\t//\t\t\techo $datos_proy_planea[\"total_hombre_mes\"].\"<br>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\n\t\t\t\t\t\t<td colspan=\"4\" >&nbsp;</td>\n\n\t\t\t\t\t\t<td>Total planeaci&oacute;n</td>';\n\n\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($total_planeado[$m]==0)\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>'.$total_planeado[$m].'</td>';\n\t\t\t\t\t\t}\n \n\t\t\t\t\t $pTema = $pTema.' </tr>\n\t\t\t\t\t <tr >\n\t\t\t\t\t\t<td colspan=\"17\">&nbsp;</td>\n\t\t\t\t\t </tr>\t';\n\n\t\t\t\t\t}\n\t\t\t\t\t$cur_tipo_usu++;\n\t\t\t\t}\n\t\t\t\t$pTema = $pTema.'\n\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t </tr>\n\t\t<tr class=\"Estilo2\"><td colspan=\"2\" >Para consultar en detalle la planeaci&oacute;n de un participante, en un proyecto especifico, utilice el reporte Usuarios por proyecto, accediendo a el, atravez del boton Consolidados por divisi&oacute;n, ubicado en la parte superior de la pagina principal de la planeaci&oacute;n por proyectos. </td></tr>\n\t\t</table>';\n\n\t\t/*\n\t\t\t\t//consulta la unidad del director y el coordinador de proyecto\n\t\t\t\t$sql=\"SELECT id_director,id_coordinador FROM HojaDeTiempo.dbo.proyectos where id_proyecto = \" . $cualProyecto.\" \" ;\n\t\t\t\t$eCursorMsql=mssql_query($sql);\n\t\t\t\t$usu_correo= array(); //almacena la unidad de los usuarios a los que se le enviara el correo\n\t\t\t\t$i=1;\n\t\t\t\twhile($datos_dir_cor=mssql_fetch_array($eCursorMsql))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_coordinador\"];\n\t\t\t\t\t$i++;\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_director\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\n\t\t\t\t//consulta la unidad porgramadores y ordenadores de gasto\t\t\t\n\t\t//select unidad from HojaDeTiempo.dbo.Programadores where id_proyecto=\".$cualProyecto.\" union\n\t\t\t\t$sql_pro_orde=\" select unidadOrdenador from GestiondeInformacionDigital.dbo.OrdenadorGasto where id_proyecto=\".$cualProyecto;\n\t\t\t\t$cur_pro_orde=mssql_query($sql_pro_orde);\n\t\t\t\twhile($datos_pro_orde=mssql_fetch_array($cur_pro_orde))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_pro_orde[\"unidad\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\t\t\t\n\t\t\n\t\t\t\t$i=0;\n\t\t\t\t//consulta el correo de los usuarios(director,cordinador,ordenadroes de G, y programadores) asociados al proyecto\n\t\t\t\t$sql_usu=\" select email from HojaDeTiempo.dbo.Usuarios where unidad in(\";\n\t\t\t\tforeach($usu_correo as $unid)\n\t\t\t\t{\n\t\t\t\t\tif($i==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" \".$unid;\t\t\n\t\t\t\t\t\t$i=1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" ,\".$unid;\n\t\t\t\t}\n\t\t\t\t$sql_usu=$sql_usu.\") and retirado is null\";\n\t\t\t\t$cur_usu=mssql_query($sql_usu);\t\t\t\t\n\t\t\n\t\t\t\t//se envia el correo a el director, cordinador, orenadores de gasto, y programadores del proyecto\t\n\t\t\t\twhile($eRegMsql = mssql_fetch_array($cur_usu))\n\t\t\t\t{\t\t\n\t\t\t\t $miMailUsuarioEM = $eRegMsql[email] ;\n\t\t\t\n\t\t\t\t //***EnviarMailPEAR\t\n\t\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\n\t\t\t\n\t\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\n\t\t\t\n\t\t\t\t //***FIN EnviarMailPEAR\n\t\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t\n\t\t\t\t}\n\t\t*/\n\t\t\tif($ban_reg==1) //SEW ENVIA EL CORREO SI EXISTE ALMENOS UN USUARIO SOBREPLANEADO\n\t\t\t{\n\t\t///////////////////////////**********************************************************PARA QUITAR\n\t\t\t $miMailUsuarioEM = 'carlosmaguirre'; //$eRegMsql[email] ;\t\n\t\t\t\t$pAsunto='Sobre planeaci&oacute;n de proyectos';\n\t\t\t //***EnviarMailPEAR\t\n\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\t\n\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\t\n\t\t\t //***FIN EnviarMailPEAR\n\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t}\n\t\t\n\t\t?>\n\n<?\n}", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaUsuarioSesion();\n\n $this->_mail = $_POST['mail'];\n $this->_telefono = $_POST['telefono'];\n\n $this->_actualizarDatos();\n\n if (Inicio::confVars('generar_log') == 's') {\n $this->_cargaLog();\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '13');\n $armado_botonera->armar('redirigir', $parametros);\n }", "public function videoconferenciaLlamando( ) {\n $this->setComando(\"LLAMANDO\");\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n // encabezados necesarios para el funcionamiento de los elementos de la pagina\n $this->_armadoPlantillaSet('cabeceras', Armado_Cabeceras::armado('formulario'));\n\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '7', 'id_tabla' => $_GET['id_tabla'], 'cp_id' => $_GET['cp_id']);\n $armado_botonera->armar('guardar', $parametros);\n\n $parametros = array('kk_generar' => '0', 'accion' => '5', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('volver', $parametros);\n\n // creo una matriz con los campos de los componentes de la pagina\n $matriz_componentes = Consultas_MatrizObtenerDeComponenteTablaYParametros::armado($_GET['cp_id']);\n\n return Generales_LlamadoAComponentesYTraduccion::armar('ComponenteVer', 'componenteModificacion', '', $matriz_componentes, $matriz_componentes['cp_nombre']);\n }", "function setLlamadasDiariasCreditos360($fecha_operacion){\n\t//TODO: Terminar esta canija funcion\n\t$msg\t= \"====================== GENERAR_LLAMADAS_POR_CREDITOS_360 \\r\\n\";\n\t$msg\t.= \"====================== SE OMITEN \\r\\n\";\n\treturn $msg;\n}", "function cariPosisi($batas){\nif(empty($_GET['halvideo'])){\n\t$posisi=0;\n\t$_GET['halvideo']=1;\n}\nelse{\n\t$posisi = ($_GET['halvideo']-1) * $batas;\n}\nreturn $posisi;\n}", "public function presetCamaraPresidencia($posicion) {\n\n self::$presidencia->preset($posicion);\n\n }", "public function traerCualquiera()\n {\n }", "function setLlamadasDiariasCreditosNo360($fecha_operacion, $recibo = 0){\n$msg\t= \"====================== GENERAR_LLAMADAS_POR_CREDITOS_NO_360 \\r\\n\";\n$msg\t.= \"====================== GENERAR LLAMADAS POR PRIMERA PARCIALIDAD \\r\\n\";\n$msg\t.= \"====================== GENERAR LLAMADAS CON \" . DIAS_DE_ANTICIPACION_PARA_LLAMADAS . \" DIAS DE ANTICIPACION \\r\\n\";\n$msg\t.= \"====================== GENERAR LLAMADAS PARA EL \" . getFechaLarga(sumardias($fecha_operacion, DIAS_DE_ANTICIPACION_PARA_LLAMADAS)) . \"\\r\\n\";\n$msg\t.= \"\\tSocio\\tCredito\\tObservaciones\\r\\n\";\n//obtener una muestra de la letra\n/**\n * seleccionar\n */\n$sucursal\t\t= getSucursal();\n\n$sql = \"SELECT\n\t`operaciones_mvtos`.`socio_afectado`,\n\t`operaciones_mvtos`.`docto_afectado`,\n\t`operaciones_mvtos`.`tipo_operacion`,\n\t`operaciones_mvtos`.`fecha_afectacion`,\n\t`operaciones_mvtos`.`periodo_socio`,\n\t`operaciones_mvtos`.`afectacion_real`,\n\t`operaciones_mvtos`.`docto_neutralizador`\nFROM\n\t`operaciones_mvtos` `operaciones_mvtos`\n\nWHERE\n\t(`operaciones_mvtos`.`tipo_operacion` = 410) AND\n\t(`operaciones_mvtos`.`fecha_afectacion` = DATE_ADD('$fecha_operacion', INTERVAL \" . DIAS_DE_ANTICIPACION_PARA_LLAMADAS . \" DAY) ) AND\n\t(`operaciones_mvtos`.`periodo_socio` =1) AND\n\t(`operaciones_mvtos`.`docto_neutralizador` = 1)\n\tAND\n\t(`operaciones_mvtos`.`sucursal` ='$sucursal')\nORDER BY\n\t`operaciones_mvtos`.`fecha_afectacion`,\n\t`operaciones_mvtos`.`socio_afectado`\";\n//$msg\t.= \"$sql\\r\\n\";\n\n$rs = mysql_query($sql, cnnGeneral());\n\twhile($rw = mysql_fetch_array($rs)){\n\t\t$socio\t\t= $rw[\"socio_afectado\"];\n\t\t$credito\t= $rw[\"docto_afectado\"];\n\t\t$oficial\t= $_SESSION[\"SN_b80bb7740288fda1f201890375a60c8f\"];\n\t\t$txt\t\t= setNewLlamadaBySocio($socio, $credito, $fecha_operacion, date(\"H:i:s\"), \"LLAMADAS AUTOMATICAS : $recibo\" );\n\t\t$msg \t\t.= date(\"H:i:s\") . \"\\t\" . $txt . \"\\r\\n\";\n\t}\n\n\treturn $msg;\n}", "function evt__form_integrante_i__modificacion($datos)\r\n {\r\n $perfil = toba::usuario()->get_perfil_datos();\r\n if ($perfil == null) {//es usuario de SCyT\r\n if($this->chequeo_formato_norma($datos['rescd_bm'])){ \r\n $datos2['rescd_bm']=$datos['rescd_bm'];\r\n $datos2['resaval']=$datos['resaval'];\r\n $datos2['cat_investigador']=$datos['cat_investigador'];\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos2);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar('Guardado. Solo modifica ResCD baja/modif, Res Aval, Cat Investigador', 'info');\r\n }\r\n }else{//es usuario de la UA\r\n $pi=$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->get();\r\n $int=$this->dep('datos')->tabla('integrante_interno_pi')->get(); \r\n if($datos['desde']<$pi['fec_desde'] or $datos['hasta']>$pi['fec_hasta']){//no puede ir fuera del periodo del proyecto\r\n //toba::notificacion()->agregar('Revise las fechas. Fuera del periodo del proyecto!', 'error'); \r\n throw new toba_error(\"Revise las fechas. Fuera del periodo del proyecto!\");\r\n }else{ \r\n //Pendiente verificar que la modificacion no haga que se superpongan las fechas\r\n $haysuperposicion=false;//no es igual al del alta porque no tengo que considerar el registro vigente$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->superposicion_modif($pi['id_pinv'],$datos['id_docente'],$datos['desde'],$datos['hasta'],$registro['id_designacion'],$registro['desde']);\r\n if(!$haysuperposicion){\r\n $band=false;\r\n if($pi['estado']=='A'){\r\n $band=$this->dep('datos')->tabla('logs_integrante_interno_pi')->fue_chequeado($int['id_designacion'],$int['pinvest'],$int['desde']);\r\n } \r\n $regenorma = '/^[0-9]{4}\\/[0-9]{4}$/';\r\n if ( !preg_match($regenorma, $datos['rescd'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if (isset($datos['rescd_bm']) && !preg_match($regenorma, $datos['rescd_bm'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD Baja/Modif invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if($band){//si alguna vez fue chequeado por SCyT entonces solo puede modificar fecha_hasta y nada mas (se supone que lo demas ya es correcto) \r\n //fecha_hasta porque puede ocurrir que haya una baja del participante o la modificacion de funcion o carga horaria\r\n unset($datos['funcion_p']);\r\n unset($datos['cat_investigador']);\r\n unset($datos['identificador_personal']);\r\n unset($datos['carga_horaria']);\r\n unset($datos['desde']);\r\n unset($datos['rescd']);\r\n unset($datos['cat_invest_conicet']);\r\n unset($datos['resaval']);\r\n unset($datos['hs_finan_otrafuente']);\r\n //Solo si cambia hasta y resol bm pierde el check\r\n if( $int['hasta']<>$datos['hasta'] or $int['rescd_bm']<>$datos['rescd_bm'] ){\r\n $datos['check_inv']=0;//pierde el check si es que lo tuviera. Solo cuando cambia algo\r\n }\r\n $mensaje='Ha sido chequeado por SCyT, solo puede modificar fecha hasta y resCD baja/modif';\r\n }else{//band false significa que puede modificar cualquier cosa\r\n //esto lo hago porque el set de toba no modifica la fecha desde por ser parte de la clave \r\n $this->dep('datos')->tabla('integrante_interno_pi')->modificar_fecha_desde($int['id_designacion'],$int['pinvest'],$int['desde'],$datos['desde']);\r\n $mensaje=\"Los datos se han guardado correctamente\";\r\n }\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar($mensaje, 'info'); \r\n }\r\n }\r\n }else{\r\n //toba::notificacion()->agregar('Hay superposicion de fechas', 'error'); \r\n throw new toba_error(\"Hay superposicion de fechas\");\r\n }\r\n }\r\n }\r\n //nuevo Lo coloco para que el formulario se oculte al finalizar\r\n $this->dep('datos')->tabla('integrante_interno_pi')->resetear();\r\n $this->s__mostrar_i=0;\r\n }", "function tcapturando($curso){\n\t\t\tif(Session::get_data('tipousuario')!=\"PROFESOR\"){\n\t\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\t//ELIMINAR CONTENIDO DE LAS VARIABLES QUE PERTENECERÁN A LA CLASE\n\t\t\tunset($this -> excel);\n\t\t\tunset($this -> alumnado);\n\t\t\tunset($this -> registro);\n\t\t\tunset($this -> nombre);\n\t\t\tunset($this -> curso);\n\t\t\tunset($this -> materia);\n\t\t\tunset($this -> clave);\n\t\t\tunset($this -> situacion);\n\t\t\tunset($this -> especialidad);\n\t\t\tunset($this -> profesor);\n\t\t\tunset($this -> periodo);\n\t\t\tunset($this -> nomina);\n\t\t\tunset($this -> parcial);\n\t\t\tunset($this -> idcapturaesp);\n\n\t\t\t$maestros = new Maestros();\n\t\t\t$id = Session::get_data('registro');\n\t\t\t$this -> nomina = $id;\n\t\t\t$profesor = $maestros -> find_first(\"nomina=\".$this -> nomina.\"\");\n\t\t\t$this -> profesor = $profesor -> nombre;\n\n\t\t\t$periodo = $this -> actual;\n\n\t\t\t$xcursos = new Xtcursos();\n\t\t\t$pertenece = $xcursos -> count(\"clavecurso='\".$curso.\"' AND nomina=\".$id.\" AND periodo='\".$periodo.\"'\");\n\n\t\t\tif($pertenece<1){\n\t\t\t\t$log = new Xtlogcalificacion();\n\t\t\t\t$log -> clavecurso = $curso;\n\t\t\t\t$log -> nomina = Session::get_data('registro');\n\t\t\t\t$log -> accion = \"INTENTANDO MODIFICAR UNA CALIFICACION QUE NO LE CORRESPONDE\";\n\t\t\t\t$log -> ip = $this -> getIP();;\n\t\t\t\t$log -> fecha = time();\n\t\t\t\t$log -> save();\n\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t}\n\n\n\t\t\t$Xccursos = new Xtcursos();\n\t\t\t$maestros = new Maestros();\n\t\t\t$materias = new Materia();\n\t\t\t$xtalumnocursos = new Xtalumnocursos();\n\t\t\t$alumnos = new Alumnos();\n\t\t\t$especialidades = new Especialidades();\n\n\n\t\t\t$xccursos = $Xccursos -> find_first(\"clavecurso='\".$curso.\"'\");\n\t\t\tif( $this -> post(\"tparcial\") == \"\" ){\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> horas = $xccursos -> horas1; break;\n\t\t\t\t\tcase 2: $this -> horas = $xccursos -> horas2; break;\n\t\t\t\t\tcase 3: $this -> horas = $xccursos -> horas3; break;\n\t\t\t}\n\n\t\t\t$this -> horas1 = $xccursos -> horas1;\n\t\t\t$this -> horas2 = $xccursos -> horas2;\n\t\t\t$this -> horas3 = $xccursos -> horas3;\n\n\t\t\tif($this -> horas==0){\n\t\t\t\t\t$this -> horas = \"\";\n\t\t\t}\n\n\t\t\tif($this -> horas1==0){\n\t\t\t\t\t$this -> horas1 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas2==0){\n\t\t\t\t\t$this -> horas2 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas3==0){\n\t\t\t\t\t$this -> horas3 = \"-\";\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> avance = $xccursos -> avance1; break;\n\t\t\t\t\tcase 2: $this -> avance = $xccursos -> avance2; break;\n\t\t\t\t\tcase 3: $this -> avance = $xccursos -> avance3; break;\n\t\t\t}\n\n\t\t\t$this -> avance1 = $xccursos -> avance1;\n\t\t\t$this -> avance2 = $xccursos -> avance2;\n\t\t\t$this -> avance3 = $xccursos -> avance3;\n\n\t\t\tif($this -> avance==0){\n\t\t\t\t\t$this -> avance = \"\";\n\t\t\t}\n\n\t\t\tif($this -> avance1==0){\n\t\t\t\t\t$this -> avance1 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance1 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance2==0){\n\t\t\t\t\t$this -> avance2 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance2 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance3==0){\n\t\t\t\t\t$this -> avance3 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance3 .= \"%\";\n\t\t\t}\n\t\t\t$total = 0;\n\n\t\t\t$xpermcapturaesp\t= new Xpermisoscapturaesp();\n\t\t\t$xpermcapturaespdet\t= new XpermisoscapturaespDetalle();\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$hour = date (\"H\");\n\t\t\t$minute = date (\"i\");\n\t\t\t$second = date (\"s\");\n\t\t\t\n\t\t\t$fecha = mktime( $hour, $minute, $second, $month, $day, $year );\n\t\t\t\n\t\t\t$aux = 0;\n\t\t\t$aux5 = 0;\n\t\t\tforeach( $xpermcapturaesp -> find_all_by_sql\n\t\t\t\t\t( \"select * from xpermisoscapturaesp\n\t\t\t\t\t\twhere clavecurso = '\".$curso.\"'\n\t\t\t\t\t\tand parcial = \".$this -> post(\"tparcial\").\"\n\t\t\t\t\t\tand fin > \".$fecha.\"\n\t\t\t\t\t\tand captura = 0\n\t\t\t\t\t\torder by id desc\n\t\t\t\t\t\tlimit 1\" ) as $xpcapesp ){\n\t\t\t\t$aux5 = 1;\n\t\t\t\t// Para checar los permisosdecapturasespeciales\n\t\t\t\tif( $xpermcapturaespdet -> find_first\n\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) ){\n\t\t\t\t\t$aux ++;\n\t\t\t\t}\n\t\t\t\t$this -> idcapturaesp = $xpcapesp -> id;\n\t\t\t\tif( $aux == 1 ){\n\t\t\t\t\tforeach( $xpermcapturaespdet -> find\n\t\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) as $xpdetalle ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($xtalumnocursos -> find\n\t\t\t\t\t\t\t\t(\"curso_id='\".$xccursos->id.\"' \n\t\t\t\t\t\t\t\tand registro = \".$xpdetalle -> registro.\"\n\t\t\t\t\t\t\t\tORDER BY registro\") as $alumno){\n\t\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$total++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$total++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $aux5 == 0 ){\n foreach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t}\n\t\t\t\t\t$total++;\n }\n\t\t\t}\n }", "function autorizar_PM_MM($id_mov,$comentarios)\r\n{\r\n\tglobal $db,$_ses_user;\r\n\t\r\n\t $db->StartTrans();\r\n\r\n\t $query = \"update movimiento_material set comentarios='$comentarios',estado=2 where id_movimiento_material=$id_mov\";\r\n\t //die($query);\r\n\t sql($query) or fin_pagina();\r\n\t $usuario = $_ses_user['name'];\r\n\t $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n\t //agregamos el log de creción del reclamo de partes\r\n\t $query=\"insert into log_movimiento(fecha,usuario,tipo,id_movimiento_material)\r\n\t values('$fecha_hoy','$usuario','autorización',$id_mov)\";\r\n\t sql($query) or fin_pagina();\r\n\t $datos_mail['Fecha'] = $fecha_hoy;\r\n\t $datos_mail['Usuario'] = $usuario;\r\n\t $datos_mail['Id'] = $id_mov;\r\n\t //variables que utilizo para el mail cuando tiene logistica integrada\r\n\t $datos_mail['id_logistica_integrada'] = $_POST['id_logistica_integrada'];\r\n\t $datos_mail['asociado_a'] = $_POST['asociado_a'];\r\n\t //fin de variables que utilizo cuando hay logistica integrada\r\n\t //enviar_mail_mov($datos_mail);\r\n\r\n\t $db->CompleteTrans();\r\n\r\n\t return \"<b>El $titulo_pagina Nº $id_mov, se autorizó con éxito.</b>\";\r\n\r\n}", "function autorizar_esp_ckd_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov, a travez de una Autorizacion Especial\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el deposito origen es San Luis que es igual a 1 segun la tabla general.depositos \r\n\t $deposito_origen='1';\r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$deposito_origen,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function motivoDeRecepcion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='RECEPCIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function guardare(){\n\t\t$m = intval($_POST['totalitem']);\n\t\t$t = 0;\n\t\t// calcula el total de\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$t += $_POST['cana_'.$i];\n\t\t}\n\t\tif ( $t <= 0 ) {\n\t\t\techo \"No hay cambios\";\n\t\t\treturn;\n\t\t}\n\n\t\t$ids = '';\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t// Guarda\n\t\t\t$cana = $_POST['cana_'.$i];\n\t\t\t$id = intval($_POST['codigo_'.$i]);\n\t\t\t$mSQL = \"UPDATE itprdop SET producido = ${cana} WHERE id= ${id}\";\n\t\t\t$this->db->query($mSQL);\n\t\t}\n\n\t\t$data['fechap'] = substr($_POST['fechap'],-4).substr($_POST['fechap'],3,2).substr($_POST['fechap'],0,2);\n\n\t\t$id = intval($_POST['codigo_0']);\n\t\t$numero = $this->datasis->dameval(\"SELECT numero FROM itprdop WHERE id=$id\");\n\n\t\t$this->db->where('numero',$id);\n\t\t$this->db->update('prdo', $data);\n\n\t\techo \"Produccion Guardada \".substr($_POST['fechap'],-4).substr($_POST['fechap'],3,2).substr($_POST['fechap'],0,2);\n\t}", "function guardarCambios() {\n\t\t// Si el id_nombre_producto es NULL lo toma como un nuevo producto\n\t\tif($this->id_nombre_producto == NULL) {\n\t\t\t// Comprueba si hay otro producto con el mismo nombre\n\t\t\tif(!$this->comprobarProductoDuplicado()) {\n\t\t\t\t$consulta = sprintf(\"insert into nombre_producto (nombre,codigo,version,id_familia,fecha_creado,activo) value (%s,%s,%s,%s,current_timestamp,1)\",\n\t\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t\t$this->makeValue($this->codigo, \"text\"),\n\t\t\t\t\t$this->makeValue($this->version, \"text\"),\n\t\t\t\t\t$this->makeValue($this->familia, \"int\"));\n\n\t\t\t\t$this->setConsulta($consulta);\n\t\t\t\tif($this->ejecutarSoloConsulta()) {\n\t\t\t\t\t$this->id_nombre_producto = $this->getUltimoID();\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t} else {\n\t\t\tif(!$this->comprobarProductoDuplicado()) {\n\t\t\t\t$consulta = sprintf(\"update nombre_producto set nombre=%s, codigo=%s, version=%s, id_familia=%s where id_nombre_producto=%s\",\n\t\t\t\t\t$this->makeValue($this->nombre, \"text\"),\n\t\t\t\t\t$this->makeValue($this->codigo, \"text\"),\n\t\t\t\t\t$this->makeValue($this->version, \"double\"),\n\t\t\t\t\t$this->makeValue($this->familia, \"int\"),\n\t\t\t\t\t$this->makeValue($this->id_nombre_producto, \"int\"));\n\t\t\t\t$this->setConsulta($consulta);\n\t\t\t\tif($this->ejecutarSoloConsulta()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 4;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}\n\t}", "function guardarReclamo()\n\t\t{\n\t\t}", "function getCorrelativoComprobante() {\n\t\tglobal $bd;\n\t\tglobal $x_correlativo_comprobante;\n\t\t/// buscamos el ultimo correlativo\n\t\t$x_array_comprobante = $_POST['p_comprobante'];\n\t\t$correlativo_comprobante = 0; \n\t\t$idtipo_comprobante_serie = $x_array_comprobante['idtipo_comprobante_serie'];\n\t\tif ($x_array_comprobante['idtipo_comprobante'] != \"0\"){ // 0 = ninguno | no imprimir comprobante\n\n\t\n\t\t\t$sql_doc_correlativo=\"select (correlativo + 1) as d1 from tipo_comprobante_serie where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\t\t\n\t\t\t$correlativo_comprobante = $bd->xDevolverUnDato($sql_doc_correlativo);\n\n\t\t\t// if ($x_array_comprobante['codsunat'] === \"0\") { // si no es factura electronica\n\t\t\t\t// guardamos el correlativo //\n\t\t\t\t$sql_doc_correlativo = \"update tipo_comprobante_serie set correlativo = \".$correlativo_comprobante.\" where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\n\t\t\t\t$bd->xConsulta_NoReturn($sql_doc_correlativo);\n\t\t\t// } \n\t\t\t// si es factura elctronica guarda despues tigger ce \n\t\t} else {\n\t\t\t$correlativo_comprobante='0';\n\t\t}\n\n\t\t// SI TAMBIEN MODIFICA EN REGISTRO PAGO\n\t\t$x_correlativo_comprobante = $correlativo_comprobante;\n\t\tif ( strrpos($x_from, \"e\") !== false ) { $x_from = str_replace('e','',$x_from); setComprobantePagoARegistroPago(); }\n\n\t\t// print $correlativo_comprobante;\n\t\t$x_respuesta = json_encode(array('correlativo_comprobante' => $correlativo_comprobante));\n\t\tprint $x_respuesta.'|';\n\t}", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n // creo una matriz con los campos de los componentes de la pagina\n $componentes = Consultas_MatrizObtenerDeComponenteTablaYParametros::armado('todos');\n\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado($_GET['id_tabla']);\n $tabla_tipo = $datos_tabla['tipo'];\n \n // borro del los atributos del usuario si tiene oculto algun componente de la tabla\n Armado_DesplegableOcultos::eliminarComponenteOcultoTodos($_GET['id_tabla']);\n\n // elimino los componentes con sus propias herramientas\n if (is_array($componentes)) {\n foreach ($componentes as $id => $dcp) {\n\n // llama al componente para eliminarlo\n $llamado_componente = Generales_LlamadoAComponentesYTraduccion::armar('ComponenteBaja', '', '', $dcp, $dcp['cp_nombre'], $dcp['cp_id']);\n\n // si el objeto anterior devuelve true\n if ($llamado_componente == true) {\n\n // elimina la columna si la tabla es tipo 'registro' o crea el registro para\n // cargar el valor de la variable\n if ($tabla_tipo == 'registros') {\n\n // elimino el campo de la tabla\n Consultas_CampoEliminar::armado(__FILE__, __LINE__, $dcp['tb_prefijo'] . '_' . $dcp['tb_nombre'], $dcp['tb_campo']);\n } elseif ($tabla_tipo == 'variables') {\n\n // elimino el campo de la tabla\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, $dcp['tb_nombre'], 'variables', $dcp['tb_campo']);\n }\n }\n\n // condiciones para eliminar los registros que definen al componente\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $dcp['cp_id']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $dcp['cp_id']);\n }\n }\n\n // Consulta nombre de tabla y nombre de campo\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado();\n $tabla_nombre = $datos_tabla['prefijo'] . '_' . $datos_tabla['nombre'];\n\n // elimino el campo de la tabla\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre);\n\n if (($tabla_tipo == 'menu') || $tabla_tipo == 'tabuladores') {\n\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_trd');\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_rel');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_trd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_trd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_rel');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_rel');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n if ($tabla_tipo == 'tabuladores') {\n \n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_prd');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_prd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_prd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n \n $consulta = new Bases_RegistroConsulta(__FILE__, __LINE__);\n $consulta->tablas('kirke_tabla_parametro');\n $consulta->campos('kirke_tabla_parametro', 'valor');\n $consulta->condiciones('', 'kirke_tabla_parametro', 'parametro', 'iguales', '', '', 'cp_id');\n $consulta->condiciones('y', 'kirke_tabla_parametro', 'id_tabla', 'iguales', '', '', $_GET['id_tabla']);\n //$consulta->verConsulta();\n $parametros_tabla = $consulta->realizarConsulta();\n\n // condiciones para eliminar los registros que definen al componente necesario para que se puedan cargar los tabuladores\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $parametros_tabla[0]['valor']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $parametros_tabla[0]['valor']);\n }\n }\n\n // eliminacion de los roles relacionados con la pagina\n Consultas_RollDetalle::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // condiciones para la eliminacion de los nombres de los links del menu\n $matriz_link_nombre = Consultas_MenuLink::RegistroConsultaIdTabla(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de los links\n if (is_array($matriz_link_nombre)) {\n foreach ($matriz_link_nombre as $id => $value) {\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_menu_link_nombre', 'id_menu_link', $value['id_menu_link']);\n }\n }\n\n // condiciones para la eliminacion\n // elimino los links de la pagina\n Consultas_MenuLink::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_nombre_idioma', 'id_tabla', $_GET['id_tabla']);\n\n // elimino los parametros de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_parametro', 'id_tabla', $_GET['id_tabla']);\n\n // elimino la pagina\n Consultas_Tabla::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n \n if (Inicio::confVars('generar_log') == 's') {\n $this->_cargaLog();\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '30', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('redirigir', $parametros);\n }", "public function panLeftCamaraPresidencia() {\n\n self::$presidencia->moverALaIzquierda();\n }", "public function imagenTemporalArticuloController($datos){\n \n list($ancho, $alto) = getimagesize($datos);\n\n if($ancho < 800 || $alto < 400){\n echo 0;\n }else{\n\n $numAleatorio = mt_rand(100, 999);\n\n $ruta = \"../../views/images/articulos/temp/articulo\" . $numAleatorio . \".jpg\";\n\n $origen = imagecreatefromjpeg($datos);\t\t\t\n\n $destino = imagecrop($origen, [\"x\" => 0, \"y\" => 0, \"width\" => 800, \"height\" => 400]); \n\n imagejpeg($destino, $ruta); \n \n echo $ruta;\n\n }\n\n }", "function identificar_pago_cli_mercantil($acceso,$id_cuba,$abrev_cuba){\n\t$acceso2=conexion();\n\t\n\t\tsession_start();\n\t\t$ini_u = $_SESSION[\"ini_u\"]; \n\t\tif($ini_u==''){\n\t\t\t$ini_u =\"AA\";\n\t\t}\n\t$acceso->objeto->ejecutarSql(\"select *from pagodeposito where (id_pd ILIKE '$ini_u%') ORDER BY id_pd desc\"); \n\t$id_pd = $ini_u.verCoo($acceso,\"id_pd\");\n\t$login = $_SESSION[\"login\"]; \n\t$fecha= date(\"Y-m-d\");\n\t$hora= date(\"H:i:s\");\n\t\n\t$palabra_clave='DEPOSITO EN EFECTIVO';\n\t$palabra_clave1='DEPO-FACIL ELECTRONICO';\n\t//ECHO \" select * from vista_tablabancos where id_cuba='$id_cuba' and descrip_tb ilike 'REC. INT. CARGO CUENTA%'\";\n\t$acceso2->objeto->ejecutarSql(\" select * from vista_tablabancos where id_cuba='$id_cuba' and (descrip_tb ilike '$palabra_clave%' or descrip_tb ilike '$palabra_clave1%' )AND (Status_tb='REGISTRADO' or status_tb='NO RELACIONADO')order by id_tb \");\n\t\twhile($row=row($acceso2)){\n\t\t\t$abrev_cuba=trim($row[\"abrev_cuba\"]);\n\t\t\t$id_tb=trim($row[\"id_tb\"]);\n\t\t\t//echo \"<br>$abrev_cuba:\";\n\t\t\t$fecha_tb=trim($row[\"fecha_tb\"]);\n\t\t\t$referencia_tb=trim($row[\"referencia_tb\"]);\n\t\t\t$monto_tb=trim($row[\"monto_tb\"]);\n\t\t\t$descrip_tb=trim($row[\"descrip_tb\"]);\n\t\t\t$valor=explode($palabra_clave,$descrip_tb);\n\t\t\t$ini=substr($referencia_tb, 0, 3);\n\t\t\t$nro_contrato='00000000000000000000000000';\n\t\t\t//echo \"<br>:$referencia_tb:\";\n\t\t\t//if($ini=='000'){\n\t\t\t\t//$nro_contrato=\t$ano=substr($referencia_tb, 3, 8);\n\t\t\t\t$nro_contrato=\t$referencia_tb;\n\t\t\t\tif(strlen($nro_contrato)!=8 && strlen($nro_contrato)!=7){\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\techo \"<br>nro_contrato:$nro_contrato:\";\n\t\t\t//}\n\t\t\t//echo \"<br>$referencia_tb: select * from contrato where nro_contrato ilike '%$nro_contrato%' \";\n\t\t\t$acceso->objeto->ejecutarSql(\" select * from contrato where nro_contrato ilike '%$nro_contrato%' \");\n\t\t\tif($row=row($acceso)){\n\t\t\t\t$id_contrato=trim($row[\"id_contrato\"]);\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pagodeposito(id_pd,id_contrato,fecha_reg,hora_reg,login_reg,fecha_dep,banco,numero_ref,status_pd,tipo_dt,monto_dep,obser_p,id_tb,fecha_conf,hora_conf,login_conf) values \n\t\t\t\t('$id_pd','$id_contrato','$fecha','$hora','$login','$fecha_tb','$id_cuba','$referencia_tb','CONFIRMADO','DEPOSITO','$monto_tb','$descrip_tb','$id_tb','$fecha','$hora','$login')\");\t\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='CONCILIADO' , tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t\t$id_pd=$ini_u.verCoo_inc($acceso,$id_pd);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='NO RELACIONADO', tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t}\n\t\t}\n\treturn $cad;\t\n}", "function evt__form_integrante_e__guardar($datos)\r\n\t{\r\n $pi=$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->get();\r\n if($pi['estado']<>'A' and $pi['estado']<>'I'){\r\n toba::notificacion()->agregar('No pueden agregar participantes al proyecto', 'error'); \r\n }else{ \r\n $band=$this->dep('datos')->tabla('integrante_externo_pi')->es_docente($datos['desde'],$datos['hasta'],$datos['integrante'][0],$datos['integrante'][1]);\r\n if($band){\r\n //toba::notificacion()->agregar('Este integrante es docente, ingreselo en la solapa Participantes con Cargo Docente en UNCO');\r\n throw new toba_error(\"Este integrante es docente, ingreselo en la solapa Participantes con Cargo Docente en UNCO\");\r\n } else{\r\n if($datos['desde']>=$datos['hasta']){\r\n throw new toba_error(\"La fecha desde debe ser menor a la fecha hasta!\");\r\n }else{\r\n if($datos['desde']<$pi['fec_desde'] or $datos['hasta']>$pi['fec_hasta']){\r\n throw new toba_error(\"Revise las fechas. Fuera del periodo del proyecto!\");\r\n }else{\r\n $regenorma = '/^[0-9]{4}\\/[0-9]{4}$/';\r\n if ( !preg_match($regenorma, $datos['rescd'], $matchFecha) ) {\r\n //toba::notificacion()->agregar('Resolucion CD Invalida. Debe ingresar en formato XXXX/YYYY','error');\r\n throw new toba_error('Resolucion CD Invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if ( isset($datos['rescd_bm']) && !preg_match($regenorma, $datos['rescd_bm'], $matchFecha) ) {\r\n throw new toba_error('Resolucion CD de Baja o Modificacion Invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n $datos['pinvest']=$pi['id_pinv'];\r\n $datos['nro_tabla']=1;\r\n $datos['tipo_docum']=$datos['integrante'][0];\r\n $datos['nro_docum']=$datos['integrante'][1];\r\n $datos['check_inv']=0;\r\n $this->dep('datos')->tabla('integrante_externo_pi')->set($datos);\r\n $this->dep('datos')->tabla('integrante_externo_pi')->sincronizar();\r\n $this->dep('datos')->tabla('integrante_externo_pi')->resetear();\r\n $this->s__mostrar_e=0;\r\n toba::notificacion()->agregar('El integrante se ha dado de alta correctamente', 'info'); \r\n }\r\n } \r\n }\r\n }\r\n }\r\n }\r\n\t}", "public function enviarClases( ) {\n\n AccesoGui::$guiSistema->esperarInicioSistema();\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_ENVIAR_CLASE);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n \n\n AccesoControladoresDispositivos::$ctrlAutomata->escenarioEnviarClase();\n if(!AccesoControladoresDispositivos::$ctrlPantallas->isEncendidaPresidencia()) {\n AccesoControladoresDispositivos::$ctrlPantallas->encenderPresidencia();\n AccesoGui::$guiPantallas->pantallaPresidenciaEncender();\n usleep(3000000);\n AccesoControladoresDispositivos::$ctrlPantallas->verEntradaPresidenciaAV1();\n } else {\n AccesoControladoresDispositivos::$ctrlPantallas->quitarPIPPresidencia();\n\n }\n usleep(1000000);\n AccesoControladoresDispositivos::$ctrlGuiPantalla->presidenciaVideoConferencia();\n AccesoControladoresDispositivos::$ctrlPlasma->encender();\n AccesoGui::$guiPlasma->encenderPlasma();\n AccesoControladoresDispositivos::$ctrlProyectores->encenderCentral();\n AccesoControladoresDispositivos::$ctrlProyectores->encenderPizarra();\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarVideo(7,8);\n //AccesoControladoresDispositivos::$ctrlGuiPantalla->presidenciaVideoconferencia();\n AccesoControladoresDispositivos::$ctrlFoco->encender();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\n\t//AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n AccesoControladoresDispositivos::$ctrlGuiPlasma->verVideoconferenciaEnPlasma();//begiratzeko\n AccesoControladoresDispositivos::$ctrlProyectores->activarCentral();\n AccesoControladoresDispositivos::$ctrlProyectores->activarPizarra();\n usleep(3000);\n AccesoControladoresDispositivos::$ctrlGuiProyectores->verPCSalaEnCentral();\n AccesoControladoresDispositivos::$ctrlGuiProyectores->verPCSalaEnPizarra();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarNuestroSonido();//volumen videoconferencia on\n AccesoControladoresDispositivos::$ctrlVideoconferencia->conectar();\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiMenus->menuPrincipal(true);\n //AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n //AccesoGui::$guiEscenarios->escenarioEnviarClase();\n AccesoGui::$guiVideoconferencia->dibujarPantalla();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n sleep(1);\n }", "function capturarCampoActualizar(Detallesmantenimientosdetablas $detalle,$numeroGrid,$ValorPorDefecto=''){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=$ValorPorDefecto;\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n $ayuda=$detalle->getDescripcionCampo();\n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n return;\n } else {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n Campos::finColumnaGrid();\n }\n Campos::columnaGrid($numeroGrid);\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::fecha($id,$valorPorDefecto,$resFecha);\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::fechaHora($id,$valorPorDefecto,$resFecha);\n }else if($tipo==3){\n C::hora($id, $valorPorDefecto);\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript);\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript);\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado);\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id, $rsT, $valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, $valorPorDefecto, $detalle->getNombreCampo());\n }else if($tipo==21){\n C::persona($id, $valorPorDefecto);\n }else if($tipo==25){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==26){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==28){\n C::textoConMascara($id,$detalle->getQueryFiltro(),$valorPorDefecto);\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n\n \n C::finColumnaGrid();\n\n}", "public function masodik()\n {\n }", "public function _validarHelado()\n {\n $listaHelados = Helado::_traerHelados();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n if($this->_precio < 0 || $this->_tipo != \"agua\" && $this->_tipo != \"crema\" || $this->_cantidad < 0)\n {\n return 1;\n }\n foreach($listaHelados as $helado)\n { \n if($this->_sabor == $helado->_sabor && $this->_tipo == $helado->_tipo)\n {\n $helado->_cantidad = $this->_cantidad;\n $helado->_precio = $this->_precio;\n Helado::_actualizarHelado($listaHelados);\n $retorno = 0;\n break;\n }\n }\n return $retorno;\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "public function claseLocal( ) {\n\n\n AccesoGui::$guiSistema->esperarInicioSistema();\n\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_CLASE_LOCAL);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n ConexionServidorCliente::$ctrlGuiPantallas->bajarPantallaElectrica();\n usleep(500000);\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLuzSala(Automata::$intensidades[\"media\"]);\n AccesoControladoresDispositivos::$ctrlFoco->apagar();\n ConexionServidorCliente::$ctrlGuiPantallas->pipEnPantallaPresi();//control_pantallas.pipEnPantallaPresi()\n ConexionServidorCliente::$ctrlGuiPlasmas->encender();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\n//AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n ConexionServidorCliente::$ctrlGuiProyectores->encenderCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->encenderPizarra();\n //ConexionServidorCliente::$ctrlGuiProyectores->activarCentral();\n //ConexionServidorCliente::$ctrlGuiProyectores->activarPizarra();\n //usleep(3000000);\n ConexionServidorCliente::$ctrlGuiProyectores->verPCSalaEnPizarra();\n ConexionServidorCliente::$ctrlGuiProyectores->verPCSalaEnCentral();\n //usleep(3000000);\n AccesoControladoresDispositivos::$ctrlProyectores->forzarEstadoOnCentral();\n AccesoControladoresDispositivos::$ctrlProyectores->forzarEstadoOnPizarra();\n\tAccesoGui::$guiSistema->esperarInicioSistema();\n AccesoControladoresDispositivos::$ctrlPlasma->verVideoSalaEnPlasma();\n AccesoGui::$guiEscenarios->escenarioClaseLocal();\n AccesoGui::$guiMenus->menuPrincipal(true);\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n\t#AccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\t#AccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n }", "static public function ctrActualizarMarca()\n {\n\n if (isset($_POST[\"editNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \n \"nombre\" => $_POST[\"editNomMarca\"],\n \"idMarca\" => $_POST[\"editIdMarca\"]\n );\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, false);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n /*=============================================\n VALIDAR LA EXISTENCIA DE LA IMAGEN\n =============================================*/\n if (isset($_FILES[\"editfotoMarca\"][\"tmp_name\"]) && $_FILES[\"editfotoMarca\"][\"tmp_name\"] != \"\") {\n list($ancho, $alto) = getimagesize($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Preguntar si existe una Imagen en la BD\n if (!empty($_POST[\"editFotoActualMarca\"])) {\n unlink($_POST[\"editFotoActualMarca\"]);\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n\n #Valida si existe el directorio y con la imagen actual\n if (file_exists($directorioActual)) {\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n } else {\n mkdir(\"views/img/Marcas/\" . $_POST[\"editNomMarca\"], 0755);\n }\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n } else { #En caso de no venir una imagen nueva\n #Asigna la ruta actual que tiene el producto\n $ruta = $_POST[\"editFotoActualMarca\"];\n if ($ruta) { #Evaluar si el producto tiene un imagen o no en la ruta actual\n #Separa la ruta\n $valoresRuta = explode(\"/\", $ruta);\n #Obtiene el nombre de la imagen\n $nombreImagen = $valoresRuta[4];\n #Asinga un nueva ruta cambiando el nombre de la carpeta por el nuevo nombre del producto\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $nombreImagen;\n } else {\n #Deja la ruta vacía en caso de que el producto no tenga una imagen asignada\n $ruta = \"\";\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n }\n\n $datos += [\"foto\" => $ruta];\n\n $actualizar = ModeloMarca::mdlActualizarMarca($tabla, $datos);\n\n return $actualizar;\n }\n }\n }", "function EstaMarcaModeloMonitor($marca,$modelo,&$salida) {\n\t// Devuelve 1 si el registro ya esta cargado\n\t\trequire(\"UsarGestion.php\");\n\t\t$consulta=\"SELECT * FROM monitor WHERE idmarcamonitor='\".$marca.\"' AND modelo='\".$modelo.\"'\" ;\n\t\t//echo ($consulta); \n\t\t$hacerconsulta=mysql_query($consulta,$manejador);\n\t\t$numeroerror=mysql_errno();\n\t\t$descripcionerror=mysql_error();\n\t\tif ($numeroerror !=0) {\n\t\t\techo (\"<br>\".$numeroerror.\"<br>\".$descripcionerror);\n\t\t} \n\t\t$numeroderegistros= mysql_num_rows($hacerconsulta);\n // echo (\" NUM REG \".$numeroderegistros);\n\t\tif ($numeroderegistros==0) {\n $salida=0;\n // echo (\"SALIDA \".$salida);\n\t\t\treturn $salida;\n\t\t\tdie();\n\t\t} else {\n $salida=1;\n // echo (\"SALIDA \".$salida);\n\t\t\t return $salida;\n\t\t\t die();\n\t\t}\n\t}", "public function pelicula( ) {\n\n\n AccesoGui::$guiSistema->esperarInicioSistema();\n\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_PELICULA);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n ConexionServidorCliente::$ctrlGuiPantallas->bajarPantallaElectrica();\n usleep(500000);\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLuzSala(Automata::$intensidades[\"minima\"]);\n if(!AccesoControladoresDispositivos::$ctrlPantallas->isEncendidaPresidencia()) {\n ConexionServidorCliente::$ctrlGuiPantallas->presidenciaEncender();\n }\n else {\n AccesoControladoresDispositivos::$ctrlPantallas->quitarPIPPresidencia();\n }\n usleep(3000000);\n AccesoControladoresDispositivos::$ctrlFoco->apagar();\n ConexionServidorCliente::$ctrlGuiPlasmas->apagar();\n ConexionServidorCliente::$ctrlGuiProyectores->apagarPizarra();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\n\tAccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n ConexionServidorCliente::$ctrlGuiPantallas->presidenciaDVD();\n usleep(100000);\n AccesoControladoresDispositivos::$ctrlPantallas->verEntradaPresidenciaAV1();\n ConexionServidorCliente::$ctrlGuiProyectores->encenderCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->activarCentral();\n AccesoGui::$guiSistema->esperarInicioSistema();\n usleep(5000000);\n ConexionServidorCliente::$ctrlGuiProyectores->verDVDEnCentral();\n ConexionServidorCliente::$ctrlGuiDvd->onOffDVD();\n //Comentado mientras se repara la visor de opacos\n\t//ConexionServidorCliente::$ctrlGuiCamaraDocumentos->camaraDocumentosApagar();//apagarDoc\n usleep(100000);\n AccesoGui::$guiSistema->esperarInicioSistema();\n AccesoGui::$guiEscenarios->escenarioPelicula();\n AccesoGui::$guiMenus->menuPrincipal(true);\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n usleep(3000000);\n ConexionServidorCliente::$ctrlGuiDvd->playDVD();\n AccesoGui::$guiDispositivos->seleccionarDvd();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n\n }", "public function AggiornaPrezzi(){\n\t}", "function procesar_vinculo ($datos){\n $hora_inicio=$this->s__aula_disponible['hora_inicio'];\n $hora_inicio_datos=\"{$datos['hora_inicio']}:00\";\n $hora_fin=$this->s__aula_disponible['hora_fin'];\n $hora_fin_datos=\"{$datos['hora_fin']}:00\";\n \n if(($hora_inicio_datos < $hora_fin_datos) && (($hora_inicio_datos >= $hora_inicio) && ($hora_inicio_datos <= $hora_fin)) && ($hora_fin_datos <= $hora_fin)){\n $this->procesar_carga($datos);\n $this->s__accion=\"Nop\";\n }\n else{\n $mensaje=\" El horario especificado no pertenece al rango disponible : $hora_inicio y $hora_fin hs \";\n toba::notificacion()->agregar($mensaje);\n }\n }", "public function partidos_cancha()\n\t{\n\t\tif($this->moguardia->isloged(true) and $torneo > 0)\n\t\t{\n\t\t\t$this->load->view('torneos/partidos_cancha');\n\t\t}\n\t}", "public function verificarCambioEstadoCarrera($idAlumnoCarrera,$idEstado){\n //Devuelve un string vacio si esta OK, un string con el mensaje si no se puede.\n //$db =& $this->POROTO->DB; \n //$ses =& $this->POROTO->Session;\n //$db->dbConnect(\"analiticoalumno/verificarCambioEstadoCarrera/\" . $idAlumnoCarrera);\n \n $bOk = true;\n $sMsg=\"\";\n \n $dataIdAlumnoCarrera = $idAlumnoCarrera;\n $dataIdEstado = $idEstado;\n\n //Definiciones a tener en cuenta para evaluar si es posible finalizar o pre finalizar.\n $instrumentosNoPuedenArmonico=array(\"1\",\"4\",\"5\",\"8\",\"12\",\"14\",\"18\");\n $carrerasIMP_PIMP=array(\"2\",\"3\");\n $carrerasFOBA=array(\"1\",\"5\");\n $fobaCantoCursadas = array(\"104\",\"102\",\"103\",\"106\",\"105\",\"99\",\"100\",\"107\");\n $fobaCantoAprobadas = array(\"101\");\n $fobaInstrumentoCursadas = array(\"104\",\"102\",\"103\",\"105\",\"99\",\"100\");\n $fobaInstrumentoAprobadas = array(\"101\"); \n\n //Obtengo datos adicionales de AlumnoCarrera\n $sql= \"select idpersona,idcarrera,idinstrumento,idarea,estado from alumnocarrera where idalumnocarrera=\".$dataIdAlumnoCarrera;\n //$alumnocarrera = $db->getSQLArray($sql);\n $this->PDO->execute($sql, \"AlumnoCarreraModel/DatosCarrera\");\n $alumnocarrera = $this->PDO->fetchAll(PDO::FETCH_ASSOC);\n \n if(count($alumnocarrera)==0){\n $bOk=false;\n $sMsg=\"Error al intentar obtener los datos de la carrera.\";\n }else{\n $idInstrumento=$alumnocarrera[0][\"idinstrumento\"];\n $idCarrera=$alumnocarrera[0][\"idcarrera\"];\n $idArea=$alumnocarrera[0][\"idarea\"];\n $dataIdAlumno=$alumnocarrera[0][\"idpersona\"];\n $dataIdEstadoActual=$alumnocarrera[0][\"estado\"];\n }\n \n // 1) Chequeo si el estado nuevo no es igual al actual.\n if($dataIdEstado==$dataIdEstadoActual && $bOk){\n $bOk=false;\n $sMsg=\"El estado actual de la carrera es igual al estado al cual se desea cambiar. No es posible el cambio.\";\n }\n \n if ($dataIdEstado == 2 && $bOk) { //Pasar a estado Finalizada \n $sql= \"select cm.idmateria from carreramateria cm \";\n $sql.=\"inner join materias m on cm.idmateria=m.idmateria \";\n $sql.=\"left join alumnomateria am on cm.idmateria=am.idmateria and \";\n $sql.=\"(am.idestadoalumnomateria in (\".$this->POROTO->Config['estado_alumnomateria_aprobada'].\",\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_aprobadaxequiv'].\",\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_nivelacion'].\")) \";\n $sql.=\"and am.idpersona=\". $dataIdAlumno .\" \";\n $sql.=\"and am.idalumnocarrera=\". $dataIdAlumnoCarrera .\" \";\n $sql.=\"where cm.idcarrera=\".$idCarrera.\" and m.estado=1 \";\n //Si esta en IMP o PIMP y no le corresponde armonico.\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico) && in_array($idCarrera,$carrerasIMP_PIMP)){\n $sql.=\"and m.idmateria not in (4,11) \";\n }\n //Si esta en FOBA y no le corresponde armonico.\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico) && in_array($idCarrera,$carrerasFOBA)){\n $sql.=\"and m.idmateria not in (105) \";\n }\n //Si esta en IMP o PIMP y area distinta de folklore no le corresponde cursar espontanea.\n if(($idArea!=3) && in_array($idCarrera,$carrerasIMP_PIMP)){\n $sql.=\"and m.idmateria not in (122,123,124) \";\n }\n $sql.=\"group by cm.idmateria \";\n $sql.=\"having max(am.idalumnomateria) is null\";\n //$arr = $db->getSQLArray($sql);\n $this->PDO->execute($sql, \"AlumnoCarreraModel/DatosCarrera\");\n $arr = $this->PDO->fetchAll(PDO::FETCH_ASSOC);\n if (count($arr)>0) {\n $bOk = false; //Si trae registros no permito cambiar estado. \n $sMsg=\"No es posible finalizar la carrera. El alumno posee materias sin aprobar.\";\n }\n\t\t}\n \n if ($dataIdEstado == 3 && !in_array($idCarrera,$carrerasFOBA) && $bOk){ //Chequeo si es posible pasar a estado pre finalizado\n $bOk=false;\n $sMsg=\"No es posible pre finalizar la carrera. Solamente las FOBA aceptan el estado PRE FINALIZAR.\";\n }\n \n if ($dataIdEstado == 3 && $bOk) { //PRE Finalizada \n $sql= \" select idmateria from alumnomateria \";\n $sql.=\" where idpersona=\".$dataIdAlumno.\" and idalumnocarrera =\".$dataIdAlumnoCarrera;\n $sql.=\" and idestadoalumnomateria in (\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_aprobada'].\",\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_aprobadaxequiv'].\",\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_nivelacion'].\")\";\n //$materiasAprobadas = $db->getSQLArray($sql);\n $this->PDO->execute($sql, \"AlumnoCarreraModel/DatosCarrera\");\n $materiasAprobadas = $this->PDO->fetchAll(PDO::FETCH_ASSOC);\n\n $sql= \" select idmateria from alumnomateria where idpersona=\".$dataIdAlumno;\n $sql.=\" and idalumnocarrera =\".$dataIdAlumnoCarrera;\n $sql.=\" and idestadoalumnomateria =\";\n $sql.=$this->POROTO->Config['estado_alumnomateria_cursadaaprobada'];\n //$materiasCursadaAprobada = $db->getSQLArray($sql);\n $this->PDO->execute($sql, \"AlumnoCarreraModel/DatosCarrera\");\n $materiasCursadaAprobada = $this->PDO->fetchAll(PDO::FETCH_ASSOC);\n\n $cumple=true;\n if($idCarrera==1){ //Foba Instrumento\n foreach($fobaInstrumentoCursadas as $fo){\n if($cumple){\n $encontre=false;\n foreach ($materiasCursadaAprobada as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n foreach ($materiasAprobadas as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n //Si el instrumento del alumno es uno de los indicados, no es necesario Instrumento Armonico III\n if($fo==\"105\"){\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico)){\n $encontre=true;\n }\n }\n }\n if(!$encontre){\n $cumple=false;\n }\n }\n foreach($fobaInstrumentoAprobadas as $fo){\n if($cumple){\n $encontre=false;\n foreach ($materiasAprobadas as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n //Si el instrumento del alumno es uno de los indicados, no es necesario Instrumento Armonico III\n if($fo==\"105\"){\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico)){\n $encontre=true;\n }\n }\n }\n if(!$encontre){\n $cumple=false;\n }\n }\n }\n if($idCarrera==5){ //Foba Canto\n foreach($fobaCantoCursadas as $fo){\n if($cumple){\n $encontre=false;\n foreach ($materiasCursadaAprobada as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n foreach ($materiasAprobadas as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n //Si el instrumento del alumno es uno de los indicados, no es necesario Instrumento Armonico III\n if($fo==\"105\"){\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico)){\n $encontre=true;\n }\n }\n }\n if(!$encontre){\n $cumple=false;\n }\n }\n foreach($fobaCantoAprobadas as $fo){\n if($cumple){\n $encontre=false;\n foreach ($materiasAprobadas as $value) {\n if($value[\"idmateria\"]==$fo){\n $encontre=true;\n }\n }\n //Si el instrumento del alumno es uno de los indicados, no es necesario Instrumento Armonico III\n if($fo==\"105\"){\n if(in_array($idInstrumento,$instrumentosNoPuedenArmonico)){\n $encontre=true;\n }\n }\n }\n if(!$encontre){\n $cumple=false;\n }\n }\n }\n if(!$cumple){\n $sMsg=\"No es posible pre finalizar la carrera. El alumno no cumple con las condiciones mínimas para pre finalizar una carrera.\";\n }\n \n $bOk=$cumple;\n }\n \n //$db->dbDisconnect();\n return $sMsg; //Si el MSG tengo algo es porque no es posible el cambio, sino, lo hago.\n }", "function SuoritaLisaysToimet(){\n /*Otetaan puuhaId piilotetustaKentasta*/\n $puuhaid = $_POST['puuha_id'];\n \n /* Hae puuhan tiedot */\n $puuha = Puuhat::EtsiPuuha($puuhaid);\n $suositus=luoSuositus($puuhaid,null);\n \n /*Tarkistetaan oliko suosituksessa virheita*/\n if(OlioOnVirheeton($suositus)){\n LisaaSuositus($suositus,$puuhaid);\n header('Location: puuhanTiedotK.php?puuhanid=' . $puuhaid . '.php');\n } else {\n $virheet = $suositus->getVirheet();\n naytaNakymaSuosituksenKirjoitusSivulle($puuha, $suositus, $virheet, \"Lisays\");\n }\n}", "public function insertPlanes()\n {\n $atributos=array( $this->asignatura , $this->correlativ , $this->ciclo , $this->fechaplan , $this->uv , $this->acuerdo );\n //descomentarear la l�nea siguiente y comentarear la anterior si la llave primaria no es autoincremental\n //$atributos=array( $this->codigopla , $this->asignatura , $this->correlativ , $this->ciclo , $this->fechaplan , $this->uv , $this->acuerdo );\n\n return $this->conexionPlanes->insertarRegistro($atributos);\n }", "function compara_valores($id_restauro)\n{\n global $db,$msg_dest;\n \n $sql_fixo=\"SELECT a.material_tecnica as mat,a.altura_interna as alt,largura_interna as larg,altura_externa as imp_alt,largura_externa as imp_larg\n\t\t\tFROM moldura AS a, restauro AS b WHERE a.moldura=b.moldura AND b.restauro='$id_restauro'\";\n $db->query($sql_fixo);\n $res=$db->dados();\n $conteudo1=array($res['mat'],$res['alt'],$res['larg'],$res['imp_alt'],$res['imp_larg']);\n $conteudo2=array($_REQUEST['tecnica'],formata_valor(trim($_REQUEST['altura_obra'])),formata_valor(trim($_REQUEST['largura_obra'])),formata_valor(trim($_REQUEST['altura_imagem'])),formata_valor(trim($_REQUEST['largura_imagem'])));\n ///\n $sql_usu=\"SELECT responsavel, tecnico from colecao where nome = '$_REQUEST[colecao]'\";\n $db->query($sql_usu);\n $usu_destino=$db->dados(); \n $usu_responsavel=$usu_destino['responsavel'];\n $usu_tecnico=$usu_destino['tecnico'];\n ///\n reset($conteudo1);\n reset($conteudo2);\n $msg=array();\n reset($msg);\n $msg_dest='';\n if($conteudo1[0]!=$conteudo2[0]){\n $msg[]='Técnica original:'.$conteudo1[0].' - Técnica atual:'.$conteudo2[0]. '\\n';}\n if($conteudo1[1]!=$conteudo2[1]){\n $msg[]='Altura original:'.$conteudo1[1].'cm - Altura atual:'.$conteudo2[1].' cm \\n';}\n if($conteudo1[2]!=$conteudo2[2]){\n $msg[]='Largura original:'.$conteudo1[2].' cm - Largura atual:'.$conteudo2[2].' cm \\n';}\n if($conteudo1[3]!=$conteudo2[3]){\n $msg[]='Altura da Imagem original:'.$conteudo1[3].' cm - Altura da Imagem atual:'.$conteudo2[3].' cm \\n';}\n if($conteudo1[4]!=$conteudo2[4]){\n $msg[]='Largura da Imagem original:'.$conteudo1[4].' cm - Largura da Imagem atual:'.$conteudo2[4].' cm \\n ';}\n\nif(count($msg)>0) // Se houver mudanças......\n{\n for($i=0;$i<count($msg);$i++){ \n $msg_dest.=$msg[$i];}\n}\n\nif ($usu_responsavel!='') {\n\n\tif($msg_dest!='')\n\t{\n \t\t$texto.='Modificações de catalogação na Ficha de Restauro\\n';\n \t\t$texto.='Nº DE REGISTRO:'.$_REQUEST['pNum_registro']. '- Objeto: '.$_REQUEST['nome_objeto']. '- Sequencial:'.$_REQUEST['seq_restauro'].'\\n';\n \t\t$texto.='TÍTULO:'.$_REQUEST['titulo'].'\\n';\n \t\t$texto.='ALTERAÇÕES:\\n';\n \t\t$texto.=$msg_dest;\n \t\t$dataInc= date(\"Y-m-d\");\n \t\t$assunto='Ficha de Restauro-Nº de registro:'.$_REQUEST['pNum_registro'].'';\n \t\t$sql= \"INSERT INTO agenda(assunto,texto,data_aviso,eh_lida,data_inclusao,usuario_origem,usuario) \n \t\tvalues('$assunto','$texto',now(),'0','$dataInc','$_SESSION[susuario]','$usu_responsavel')\";\n \t\t$db->query($sql);\n\t\tif ($usu_responsavel <> $usu_tecnico) {\n\t \t\t$sql= \"INSERT INTO agenda(assunto,texto,data_aviso,eh_lida,data_inclusao,usuario_origem,usuario) \n \t\tvalues('$assunto','$texto',now(),'0','$dataInc','$_SESSION[susuario]','$usu_tecnico')\";\n\t \t\t$db->query($sql);\n\t\t}\n \t}\n} \n}", "public function getMovimientoCamion(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | getMovimientoCamion()\");\n \n $motr_id = $this->input->post(\"motr_id\");\n $resp = $this->Camiones->getMovimientoTransporte($motr_id);\n\n echo json_encode($resp);\n }", "function cl_conplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function posicionactual($idreg,$link,&$contador) {\n $pos=0;\n $ban=0;\n $contador=0;\n //$consulta = \"select * from (select id_registro,MAX(score) MaxScore,fecha from bdlt_participacion group by id_registro) P order by MaxScore desc;\";\n\n\n $consulta = \"select * from (select a.id_registro,a.score,MIN(fecha) fecha from (select id_registro,MAX(score) MaxScore from bdlt_participacion where score < 25000 and id_registro in (3642,2100,2441,2865,3386) group by id_registro union select id_registro,MAX(score) MaxScore from bdlt_participacion where score < 30000 and id not in (29356,29128,25875) and id_registro not in (3642,2100,2441,2865,3386) group by id_registro) P inner join bdlt_participacion a on a.id_registro=P.id_registro and a.score=P.MaxScore group by a.id_registro,a.score) Res order by score desc,fecha asc LIMIT 10000000;\";\n if ($resultado = mysqli_query($link, $consulta)) {\n while ($fila = mysqli_fetch_row($resultado)) {\n \t $contador++;\n $idregenbd=$fila[0];\n if($idregenbd==$idreg&&$ban==0)\n {\n \t$pos=$contador;\n \t$ban=1;\n }\n }\n /* liberar el conjunto de resultados */\n mysqli_free_result($resultado);\n }\n return $pos;\n}", "function cl_conplanoconplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoconplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function controlPracticasRelacionadas($clavebeneficiario, $fecha_comprobante, $datosnomenclador) {\r\n\r\n $ctrl['debito'] = false;\r\n $query = \"SELECT *\r\n FROM facturacion.cfg_practicas_relac\r\n WHERE modo=1 and\r\n trim(pracorigen)=trim('$datosnomenclador[3]')\";\r\n $res_origen = sql($query, \"Error 1\") or fin_pagina();\r\n\r\n if ($res_origen->RecordCount() > 0) {\r\n $ctrl['msj_error'] = \"\";\r\n $res_origen->MoveFirst();\r\n while (!$res_origen->EOF) {\r\n $anexo = $res_origen->fields['anexopracrel'];\r\n $nomencladordetalles['tipo'] = $datosnomenclador[2];\r\n $nomencladordetalles['codigo'] = $res_origen->fields['pracrel'];\r\n //busca si ese afiliado se realiza la practica relacionada\r\n $comprobantedelarelacionada = traemeLaPractica($clavebeneficiario, $nomencladordetalles, $fecha_comprobante, $anexo);\r\n if ($comprobantedelarelacionada != null) {\r\n $limite_dias = $res_origen->fields['dias'];\r\n $limite_dias_time = dias_time($limite_dias);\r\n $fecha_comprobante_time = strtotime(date($fecha_comprobante));\r\n $comprobantedelarelacionada_time = strtotime(date($comprobantedelarelacionada));\r\n $resta_time = $fecha_comprobante_time - $comprobantedelarelacionada_time;\r\n if ($resta_time <= $limite_dias_time) {\r\n //una vez que esta comprobado que se realizo la practica dentro de los 30 dias,\r\n //comprueba si existe otra condicion, o si no es obligatoria y sale. \r\n //TODO: no existe while para otras practicas obligatorias\r\n if (($res_origen->fields['otras'] == 'N') || ($res_origen->fields['tipo'] == 'OR')) {\r\n $ctrl['debito'] = false;\r\n break;\r\n }\r\n } else {\r\n if ($ctrl['msj_error'] != \"\") {\r\n $ctrl['msj_error'].=\" y \";\r\n }\r\n $ctrl['debito'] = true;\r\n $ctrl['msj_error'] .= 'No se realizo la practica relacionada [' . $nomencladordetalles['codigo'] . '] dentro del limite de tiempo';\r\n $ctrl['id_error'] = '76';\r\n $ctrl['nomenclador_rel'] = $nomencladordetalles['codigo'];\r\n if ($res_origen->fields['tipo'] == 'AND')\r\n break;\r\n }\r\n } else {\r\n if ($ctrl['msj_error'] != \"\") {\r\n $ctrl['msj_error'].=\" y \";\r\n }\r\n $ctrl['debito'] = true;\r\n $ctrl['msj_error'] .= 'No se realizo la practica relacionada [' . $nomencladordetalles['codigo'] . ']';\r\n $ctrl['id_error'] = '75';\r\n $ctrl['nomenclador_rel'] = $nomencladordetalles['codigo'];\r\n if ($res_origen->fields['tipo'] == 'AND')\r\n break;\r\n }\r\n $res_origen->MoveNext();\r\n }\r\n }\r\n return $ctrl;\r\n}", "function limite_trazadora($fecha) {\r\n $fecha = strtotime(fecha_db($fecha));\r\n $actualm = date('m', $fecha);\r\n $actualy = $actualy2 = date('Y', $fecha);\r\n // $ano = date('Y', $fecha);\r\n $desdem1 = '01';\r\n $hastam1 = '04';\r\n $desdem2 = '05';\r\n $hastam2 = '08';\r\n $desdem3 = '09';\r\n $hastam3 = '12';\r\n if ($actualm >= $desdem1 && $actualm <= $hastam1) {\r\n $cuatrimestre = 1;\r\n $cuatrimestrem = 3;\r\n //$actualy2++;\r\n }\r\n if ($actualm >= $desdem2 && $actualm <= $hastam2) {\r\n $cuatrimestre = 2;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n // $actualy2++;\r\n }\r\n if ($actualm >= $desdem3 && $actualm <= $hastam3) {\r\n $cuatrimestre = 3;\r\n $cuatrimestrem = $cuatrimestre - 1;\r\n $actualy2++;\r\n }\r\n\r\n $query2 = \"SELECT desde\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n $valor['desde'] = $actualy . '-' . $res_sql2->fields['desde'];\r\n\r\n $query2 = \"SELECT limite\r\n\t\t\t\t\tFROM facturacion.cuatrimestres\r\n\t\t\t\t\t WHERE cuatrimestre='$cuatrimestre'\";\r\n $res_sql2 = sql($query2) or excepcion(\"Error al buscar cuatrimestre\");\r\n\r\n $valor['limite'] = $actualy2 . '-' . $res_sql2->fields['limite'];\r\n\r\n return $valor;\r\n}", "function actualiza_nro_cargo($id_desig,$nro_cargo){\n if(is_null($nro_cargo)){\n $sql=\"update designacion set nro_cargo=null\"\n . \" where id_designacion=$id_desig\";\n toba::db('designa')->consultar($sql); \n return true;\n \n }else{\n if($id_desig<>-1 and $nro_cargo<>-1){\n $sql=\"select * from designacion where nro_cargo=$nro_cargo and id_designacion<>$id_desig\";\n $res=toba::db('designa')->consultar($sql); \n if(count($res)>0){//ya hay otra designacion con ese numero de cargo\n return false;\n }else{\n $sql=\"update designacion set nro_cargo=$nro_cargo\"\n . \" where id_designacion=$id_desig\";\n toba::db('designa')->consultar($sql); \n return true;\n }\n \n }else{\n return false;\n }\n } \n }", "public function verCamaraEnPizarra( $camara ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"CAMARA_\".$camara);\n\n }", "public function ejecutar(){\r\n\t\tmove_uploaded_file($this->carpeta_temporal,$this->carpeta_destino.$this->nuevo_nombre_imagen);\r\n\t\tchmod($this->carpeta_destino.$this->nuevo_nombre_imagen, 0777);\r\n\t\techo $this->carpeta_temporal;\r\n\t\techo \"<br>\";\r\n\t\t$this->carpeta_donde_esta_imagen=$this->carpeta_destino.$this->nuevo_nombre_imagen;\r\n\t\techo $this->carpeta_donde_esta_imagen;\r\n\t}", "private function datosSuficientes()\n\t{\t// Comprobamos el Origen y Destino de la imagen que existan\n\t\t// Con estos dos parametros solo ya funcionaria.\n\t\tif(!$this->imagenOrigen)\n\t\t{\t//echo Imagen::$msjError[\"ERR_Ori\"];\n\t\t\treturn false;\n\t\t}\n\t\tif($this->imagenDestino)\n\t\t{\t//echo Imagen::$msjError[\"ERR_Des\"];\n\t\t\treturn false;\n\t\t}\n\t\t// Compruebo seguridad de la Imagen\n\t\t$seguridad\t= $this->cargarImagen($this->imagenOrigen);\n\t\tif(!$seguridad)\n\t\t{\treturn false;\t}\n\t\t// Veo los parametros por defecto\n\t\tif(!$this->anchoDestino)\n\t\t{\t$this->anchoDestino\t= $this->propiedadesImagen[0];\t}\n\t\tif(!$this->altoDestino)\n\t\t{\t$this->altoDestino\t= $this->propiedadesImagen[1];\t}\n\t\t// Controles de Modo\n\t\tif($this->modo==2)\n\t\t{\tif( (int)($this->recorte[\"filas\"])<1 || (int)($this->recorte[\"columnas\"])<1 )\n\t\t\t{\t$this->recorte\t\t\t= array('filas'\t=> 3, 'columnas'\t=> 3, 'centrado'\t=>\t4);\t}\n\t\t\telse\n\t\t\t{\t$opcionesRecorte\t\t= $this->recorte[\"filas\"]*$this->recorte[\"columnas\"]-1;\n\t\t\t\tif($this->recorte[\"centrado\"]>$opcionesRecorte)\n\t\t\t\t{\t$this->recorte[\"centrado\"]\t= $opcionesRecorte;\t}\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}", "public function getCambio($moneda, $fecha){\n\n $sql = \"SELECT tc.TIPCAMC_FactorConversion FROM cji_tipocambio tc WHERE tc.TIPCAMC_Fecha BETWEEN '$fecha 00:00:00' AND '$fecha 23:59:59' AND tc.COMPP_Codigo = $this->compania AND tc.TIPCAMC_MonedaDestino = '$moneda'\";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows() > 0){\n $tasa = $query->result();\n return $tasa[0]->TIPCAMC_FactorConversion;\n }\n else\n return 0;\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento('administrador_usuarios');\n\n $armado_botonera = new Armado_Botonera();\n\n if(($_GET['id_usuario'] == '1') && (Inicio::usuario('tipo') != 'administrador general') ){\n $parametros = array('kk_generar' => '0', 'accion' => '57');\n $armado_botonera->armar('redirigir', $parametros);\n }\n \n // encabezados necesarios para el funcionamiento de los elementos de la pagina\n $this->_armadoPlantillaSet('cabeceras', Armado_Cabeceras::armado('formulario'));\n \n $parametros = array('kk_generar' => '0', 'accion' => '58', 'id_tabla' => $_GET['id_tabla'], 'id_usuario' => $_GET['id_usuario']);\n $armado_botonera->armar('editar', $parametros);\n\n $parametros = array('kk_generar' => '0', 'accion' => '57');\n $armado_botonera->armar('volver', $parametros);\n\n $this->_tabla = Consultas_Usuario::RegistroConsulta(__FILE__, __LINE__, $_GET['id_usuario'], 'nombre,apellido,mail,telefono,habilitado');\n\n return $this->usuarioVer();\n }", "function precio($precioUnidad, $cantidad, $descuento = 0 ){ // las variables que tenemos son arbitrarias, por lo cual hay que mirar bien si ponerlas en () de la funcion\n\n\n\n$multiplicar = $precioUnidad * $cantidad;\n\n// $descuento es un porcentaje\n\n// $restar = $multiplicar - $descuento; // este descuento debe ir en % por lo cual no es lo mismo que un entero, por lo cual lo colocaremos en entero\n\n\n// si esto fuera un porcentaje entonces seria $multiplicar = $precioUnidad * $cantidad; // $porcentaje = $multiplicar - $descuento; // $solucion = $multiplicar - $porcentaje; lo cual es lo que haremos\n\n$porcentaje = $multiplicar * $descuento;\n\n$solucion = $multiplicar - $porcentaje;\nreturn $solucion;\n// si colocamos todos los datos en solo sitio o una sola linea, sin especificar es e novatos, porque hay que haber un orden\n\n}", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function motivoDeAsignacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ASIGNACIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}" ]
[ "0.63051873", "0.6178388", "0.59874576", "0.59498256", "0.5944988", "0.594424", "0.59440386", "0.5902308", "0.5867017", "0.58595", "0.58540356", "0.58509314", "0.5823323", "0.5812478", "0.57747006", "0.57692826", "0.57575256", "0.5755964", "0.5751442", "0.5749754", "0.5742307", "0.57359964", "0.5721796", "0.5713726", "0.5712822", "0.5708658", "0.5680141", "0.56588435", "0.5651206", "0.5644893", "0.56424105", "0.56357694", "0.56235474", "0.56184655", "0.56121075", "0.56091875", "0.560779", "0.56001645", "0.55967474", "0.559388", "0.55922043", "0.5583495", "0.55815256", "0.55773085", "0.55748916", "0.5570008", "0.55674326", "0.55665463", "0.5565666", "0.5564404", "0.5558221", "0.555169", "0.554863", "0.5548069", "0.55469036", "0.55267024", "0.5508523", "0.55071366", "0.5503739", "0.54999804", "0.5488431", "0.5487728", "0.5485137", "0.5475725", "0.5462408", "0.54602975", "0.5457529", "0.54566795", "0.54477257", "0.5445522", "0.54446363", "0.5438799", "0.54244035", "0.5422701", "0.542204", "0.5421632", "0.54189694", "0.5418535", "0.5406287", "0.5401684", "0.53838354", "0.5379672", "0.53770715", "0.5377065", "0.5376187", "0.5373861", "0.53713566", "0.53566283", "0.53526783", "0.5352606", "0.5350122", "0.53461486", "0.533828", "0.53370565", "0.53354913", "0.53309", "0.53299946", "0.53220415", "0.53215516", "0.53191906", "0.5316297" ]
0.0
-1
Create a new controller instance.
public function __construct() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index() { return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Given a datetime, returns two datetimes, one with first second of the given day, and the other with the first second of next day
protected function getDayRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, $date->format('m'), $date->format('d'), $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 day'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function snapToSecond(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->second()->startDate(),\n DatePoint::fromDate($this->endDate)->second()->endDate(),\n $this->bounds\n );\n }", "function getNextDay(){\r\n $dia = Data_Calc::proxDia($this->dia, $this->mes, $this->ano, \"%Y-%m-%d\");\r\n $data = sprintf(\"%s %02d:%02d:%02d\", $dia, $this->hora, $this->minuto, $this->segundo);\r\n $newDate = new Date();\r\n $newDate->setData($data);\r\n return $newDate;\r\n }", "public function twiceDaily()\n {\n return $this->cron('0 1,13 * * * *');\n }", "private static function nextRepeatDate($dt, $event) {\n switch ($event->type) {\n case JSchedEvent::TYPE_DAY:\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + $event->every, date(\"Y\", $dt)); \n //logit(\"dt0=\" . date(\"l, d-M-Y\", $dt));\n return $dt;\n case JSchedEvent::TYPE_WEEK:\n $dow = date(\"w\", $dt);\n for ($i = 0; $i < 7; $i++) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 1, date(\"Y\", $dt)); // next day\n// logit(\"dt1=\" . date(\"l, d-M-Y\", $dt));\n $dow = ($dow + 1) % 7;\n if ($dow == JSchedEvent::ON_SUN) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 7 * ($event->every - 1), date(\"Y\", $dt)); // skip (every-1) weeks\n// logit(\"dt2=\" . date(\"l, d-M-Y\", $dt));\n }\n if ($event->dowArray[$dow]) {\n return $dt;\n }\n }\n return null;\n case JSchedEvent::TYPE_MONTH:\n if ($event->by == JSchedEvent::BY_DATE) {\n \n // By date (\"15th\")\n $nextm = (date(\"n\", $dt) + $event->every - 1) % 12 + 1; // next month expected \n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every, date(\"j\", $dt), date(\"Y\", $dt)); \n// logit(\"dt3=\" . date(\"l, d-M-Y\", $dt));\n if (date(\"n\", $dt) > $nextm) { \n $dt = mktime(0, 0, 0, date(\"n\", $dt), 0, date(\"Y\", $dt)); // went too far, use last day of month instead\n// logit(\"dt4=\" . date(\"l, d-M-Y\", $dt)); \n }\n return $dt;\n } else {\n \n // By month day (\"4th Wednesday\")\n $week = ceil(date(\"j\", $dt) / 7);\n $dow = date(\"w\", $dt);\n if ($week == 5 || $event->by == JSchedEvent::BY_DAY_OF_LAST_WEEK) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every + 1, 0, date(\"Y\", $dt)); // last day of next month\n// logit(\"dt5=\" . date(\"l, d-M-Y\", $dt));\n for ($i = 0; $i < 7; $i++) {\n if (date(\"w\", $dt) == $dow) {\n return $dt;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) - 1, date(\"Y\", $dt)); // prev day\n// logit(\"dt6=\" . date(\"l, d-M-Y\", $dt));\n }\n return null;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every, 1, date(\"Y\", $dt)); // next month\n// logit(\"dt6=\" . date(\"l, d-M-Y\", $dt));\n $dt = mktime(0, 0, 0, date(\"n\", $dt), (8 + ($dow - date(\"w\", $dt))) % 7, date(\"Y\", $dt)); // first dow of month\n// logit(\"dt6a=\" . date(\"l, d-M-Y\", $dt));\n// logit(\"dt7=\" . date(\"l, d-M-Y\", $dt));\n for ($i = 0; $i <= 5; $i++) {\n if (ceil(date(\"j\", $dt) / 7) == $week) {\n return $dt;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 7, date(\"Y\", $dt)); // skip week \n// logit(\"dt8=\" . date(\"l, d-M-Y\", $dt));\n }\n }\n return null;\n case JSchedEvent::TYPE_YEAR:\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt), date(\"Y\", $dt) + $event->every);\n// logit(\"dt9=\" . date(\"l, d-M-Y\", $dt));\n return $dt;\n }\n }", "function sumDateTimes($fecha1, $fecha2)\n{\n $aux = new DateTime();\n $aux->setTimestamp($fecha1->getTimestamp() + $fecha2->getTimestamp());\n return $aux;\n}", "function Get_Next_Payday($first_date, $info, $rules)\n{\n\t// Grab a list of dates from the fund_date onward. Remove dates prior to today\n\t$date_list = Get_Date_List($info, $first_date, $rules, 20);\n\n\t$date_pair = array();\n\twhile(strtotime($date_list['event'][0]) < strtotime(date('Y-m-d')))\n\t{\n\t\tarray_shift($date_list['event']);\n\t\tarray_shift($date_list['effective']);\n\t}\n\n\t$date_pair['event'] = $date_list['event'][0];\n\t$date_pair['effective'] = $date_list['effective'][0];\n\n\treturn $date_pair;\n}", "public static function firstSecondOfDay(int $epoch = null, bool $gmt = false) {\r\n $epoch = $epoch ?? time();\r\n $function = $gmt ? 'gmmktime' : 'mktime';\r\n return $function(0, 0, 0, date('n', $epoch), date('j', $epoch),\r\n date('Y', $epoch));\r\n }", "function dateDiff($dt1, $dt2, $split) \r\n{\r\n\t$date1 = (strtotime($dt1) != -1) ? strtotime($dt1) : $dt1;\r\n\t$date2 = (strtotime($dt2) != -1) ? strtotime($dt2) : $dt2;\r\n\t$dtDiff = $date1 - $date2;\r\n\t$totalDays = intval($dtDiff/(24*60*60));\r\n\t\r\n\t$totalSecs = $dtDiff-($totalDays*24*60*60); // this doesnt look at days!?! .. so check $dif['d'] == 0 to see if its the same day.\r\n\t$dif['totalSecs'] = $totalSecs; // not including any days in the total seconds. you would think 1 day difference with identical minutes/seconds should equal == 86,400 seconds, but actually this var will say zero.\r\n\t$dif['h'] = $h = intval($totalSecs/(60*60));\r\n\t$dif['m'] = $m = intval(($totalSecs-($h*60*60))/60);\r\n\t$dif['s'] = $totalSecs-($h*60*60)-($m*60);\r\n\t\r\n\t// use this if you want the TOTAL seconds between two dates. above, the $dif['totalSecs'] could be the same if you compare \r\n\t// two different days...\r\n\t$dif['totalSecs_including_days'] = $totalSecs + ($totalDays*24*60*60); // 86400seconds in one full day..ie 24 hours. ie 1440 mins.\r\n\t\r\n // set up array as necessary\r\n \tswitch($split) \r\n\t{\r\n\t\tcase 'yw': # split years-weeks-days\r\n\t\t\t$dif['y'] = $y = intval($totalDays/365);\r\n\t\t\t$dif['w'] = $w = intval(($totalDays-($y*365))/7);\r\n\t\t\t$dif['d'] = $totalDays-($y*365)-($w*7);\r\n\t\t\tbreak;\r\n\t\tcase 'y': # split years-days\r\n\t\t\t$dif['y'] = $y = intval($totalDays/365);\r\n\t\t\t$dif['d'] = $totalDays-($y*365);\r\n\t\t\tbreak;\r\n\t\tcase 'w': # split weeks-days\r\n\t\t\t$dif['w'] = $w = intval($totalDays/7);\r\n\t\t\t$dif['d'] = $totalDays-($w*7);\r\n\t\t\tbreak;\r\n\t\tcase 'd': # don't split -- total days\r\n\t\t\t$dif['d'] = $totalDays;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tdie(\"Error in dateDiff(). Unrecognized \\$split parameter. Valid values are 'yw', 'y', 'w', 'd'. Default is 'yw'.\");\r\n }\r\n return $dif;\r\n}", "private function datetime2second($date)\n {\n return intval($date->format('G'))*3600+intval($date->format('i'))*60+intval($date->format('s'));\n }", "function diffInSeconds ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\treturn $diff;\n\t}", "function next_day(&$offset)\n\t{\n\t\tdo\n\t\t{\n\t\t\t$offset++;\n\t\t}\n\t\twhile(\n\t\t\tin_array(gmdate('D', gmmktime() + ($offset * 24 * 60 * 60)), array('Sat', 'Sun'))\n\t\t\t||\n\t\t\tin_array(gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60)), $GLOBALS['config']['non-work_dates'])\n\t\t);\n\t\treturn gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60));\t\t\n\t}", "function addOneDay($currentDay)\n {\n if ( empty($currentDay) ) {\n $currentDay = date('Y-m-d');\n }\n\n $nextDate = strtotime ( '+ 1 day' , strtotime ( $currentDay ) ) ;\n $nextDate = date ( 'Y-m-d' , $nextDate );\n\n return $nextDate;\n }", "protected function getNextOccurrence($day, \\DateTime $date)\n {\n if (strtolower($date->format('l')) === strtolower($day)) {\n return $date;\n }\n\n return new \\DateTime(\"next {$day} {$date->format('c')}\");\n }", "function get_next_date($this_date){\n\t$year = \"\";\n\t$month = \"\";\n\t$day = \"\";\n\tif( preg_match(\"/(\\d+)\\-(\\d+)-(\\d+)/\", $this_date, $match) ){\n\t\t$year = $match[1];\n\t\t$month = $match[2];\n\t\t$day = $match[3];\n\t};\n\t$next_date = date(\"Y-m-d\",mktime(0,0,0, $month, $day+1, $year));\n\n\treturn $next_date;\n\n}", "private function nextDay(){\n\t\t$oneDay = new \\DateInterval('P1D');\n\t\tdo {\n\t\t\t$this->curDate->add($oneDay);\n\t\t} while($this->isVocation($this->curDate));\n\t\tif($this->curDate > $this->endDate)\n\t\t\t$this->curDate = null;\n\t}", "function getNextDateTime($from) {\n $secMinutes = empty($this->data['minutes']) ? 0 : $this->data['minutes'] * 60;\n $secHours = empty($this->data['hours']) ? 0 : $this->data['hours'] * 3600;\n $secDays = empty($this->data['days']) ? 0 : $this->data['days'] * 86400;\n $frame = $secMinutes + $secHours + $secDays;\n return (($frame > 0) ? ($from + $frame) : 0);\n }", "function move_to_start_of_day()\n {\n $hour=0;\n $minute=0;\n $second=0;\n $day=$this->get_day();\n $month=$this->get_month();\n $year=$this->get_year();\n $newtimestamp=mktime( $hour, $minute, $second, $day, $month, $year);\n }", "function diffInDays ($firstDate, $secondDate)\n\t{\n\t\t$diff = $firstDate - $secondDate;\n\t\t$dayInSecs = 60 * 60 * 24;\n\t\treturn ($diff/$dayInSecs);\n\t}", "public function next()\n {\n if ($this->_current === null) {\n $this->_current = clone $this->_startDate;\n } else {\n $this->_current = clone $this->_current;\n $this->_current->add($this->_dateInterval);\n }\n }", "function date_diff2($date1, $date2) {\n\tif(empty($date2)) return array(\"d\"=>1); // considering only [d] so if date 2 is empty then return 1\n\n $s = strtotime($date2)-strtotime($date1);\n $d = intval($s/86400); \n $s -= $d*86400;\n $h = intval($s/3600);\n $s -= $h*3600;\n $m = intval($s/60); \n $s -= $m*60;\n return array(\"d\"=>$d,\"h\"=>$h,\"m\"=>$m,\"s\"=>$s);\n}", "function testRecurNextStartDay() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t\r\n\t\t// Daily\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_DAILY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dateStart = \"1/1/2010\";\r\n\t\t$rp->dateEnd = \"3/1/2010\";\r\n\t\t\r\n\t\t// First instance should be today\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/01/2010\");\r\n\t\t// Set today to processed, instance should be tomorrow\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/02/2010\");\r\n\t\t// Change interval to skip a day - same processed to above\r\n\t\t$rp->dateProcessedTo = \"1/2/2010\";\r\n\t\t$rp->interval = 2;\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/03/2010\");\r\n\r\n\t\t// Weekly\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_WEEKLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dateStart = \"1/2/2011\"; // First sunday\r\n\t\t$rp->dateEnd = \"1/15/2011\";\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_WEDNESDAY;\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/02/2011\"); // Sun\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/05/2011\"); // Wed\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/09/2011\"); // Sun\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/12/2011\"); // Wed\r\n\t\t// Next should fail because it is beyond the endDate\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext);\r\n\r\n\t\t// Monthly\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth= 1;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t// The frist of each month\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/01/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/01/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"03/01/2011\");\r\n\r\n\t\t// Skip over non-existant dates\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth= 30;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/30/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"03/30/2011\"); // Should skip of ver 2/30 because does not exist\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"04/30/2011\");\r\n\r\n\t\t// MonthlyNth (the nth weekday(s) of every month)\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 4; // The 4th Sunday of each month\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/23/2011\"); // The 4th Sunday in January\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/27/2011\"); // The 4th Sunday in February\r\n\r\n\t\t// Test last\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 5; // The last monday of each month\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_MONDAY;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/31/2011\"); // The 4th Sunday in January\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/28/2011\"); // The 4th Sunday in February\r\n\r\n\r\n\t\t// Yearly - on the dayofmonth/monthofyear\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_YEARLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth = 8;\r\n\t\t$rp->monthOfYear = 10;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"1/1/2013\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"10/08/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"10/08/2012\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext); // Past the dateEnd\r\n\r\n\t\t// YearlyNth\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_YEARNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 4; // The 4th Sunday of January\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->monthOfYear = 1;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"1/1/2013\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/23/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/22/2012\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext); // Past the dateEnd\r\n\t}", "function get_dy_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],($date_split[0]+ 1),$date_split[2]));\n }", "function the_date_range($start_dt,$end_dt, $one_day = false){\r\n\t\r\n\t$duration = $start_dt->diff($end_dt);\r\n\t$start = explode(\" \",$start_dt->format('l F j Y g i a'));\r\n\t$end = explode(\" \",$end_dt->format('l F j Y g i a'));\r\n\t\r\n\t//happening at the same time\r\n\tif($start == $end){\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : time_compact_ap_format($start[4],$start[5],$start[6])\r\n\t\t);\r\n\t}\t\r\n\t//happening on the same day\r\n\telseif($start[2] == $end[2] || ($duration->days < 1 && $duration->h < 24)){\r\n\t\t//Monday, March 4; 9:00 p.m.\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : sprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\t //formatted date\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//happening in the same month\r\n\t//check if happening all day; if not, return eo_all_day ? : \r\n\telseif($start[1] == $end[1]){\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\tsprintf(\r\n\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t$start[1], //month\r\n\t\t\t$start[2], //day of month\r\n\t\t\t$end[2]\r\n\t\t)\r\n\t\t: \r\n\t\tarray(\r\n\t\t\t\"date\" => sprintf(\r\n\t\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"datetime\" => sprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\tsprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\t//happening in the same year\r\n\telseif($start[3] == $end[3]){\r\n\t\treturn (eo_is_all_day() || $one_day) ?\r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s %s&ndash;%s %s\",\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//just plain happening\r\n\r\n\telse{\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n}", "public function getTwoYearDates()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n\n return Holiday::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->orderBy('date', 'asc')\n ->paginate(25);\n }", "protected function expires( $first, $second )\n\t{\n\t\treturn ( $first !== null ? ( $second !== null ? min( $first, $second ) : $first ) : $second );\n\t}", "public static function addTimeSec2DateTime(DateTime $dateTime, $sec) {\r\n $dateTime->add(new DateInterval(\"PT\".$sec.\"S\"));\r\n return $dateTime;\r\n }", "public function getNextDate($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime(\"+1 day\", strtotime($date)));\n\t\treturn $dateNew;\n\t}", "public function getTwoBusinessDaysBefore(\\Datetime $date)\n {\n return $this->getTwoBusinessDaysFrom($date, 'sub');\n }", "function nextRdate2($curD, $rI, $rP, $rM, $i) { //$i=0: 1st occurrence; $i=1: next occurrence\n\tif ($rM) {\n\t\t$curM = $rM; //one specific month\n\t\t$curY = substr($curD,0,4)+$i+((substr($curD,5,2) <= $rM) ? 0 : 1);\n\t} else { //each month\n\t\t$curM = substr($curD,5,2)+$i;\n\t\t$curY = substr($curD,0,4);\n\t}\n\t$day1Ts = mktime(12,0,0,$curM,1,$curY);\n\t$dowDif = $rP - date('N',$day1Ts); //day of week difference\n\t$offset = $dowDif + 7 * $rI;\n\tif ($dowDif >= 0) { $offset -= 7; }\n\tif ($offset >= date('t',$day1Ts)) { $offset -= 7; } //'t' : number of days in the month\n\t$nxtD = date('Y-m-d', $day1Ts + (86400 * $offset));\n\treturn $nxtD;\n}", "function create_date_time_in_loop( $date, $time) {\n\t\n\t// Convert the time to 24-hour time\n\t$event_time_start = date('Hi', strtotime($time));\n\t$event_date = date('Ymd', strtotime($date));\n\t\n\treturn $event_date . $event_time_start;\n}", "public function testGetNextDateTimeCycle()\n {\n /* @var $startDate \\DateTime */\n /* @var $interval \\DateInterval */\n\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/Timer_StartEvent_TimeCycle.bpmn');\n\n //Load a process from a bpmn repository by Id\n $process = $bpmnRepository->getProcess('Process');\n $this->engine->loadProcess($process);\n\n //Get scheduled job information\n $job = $this->jobs[0];\n $startDate = $job['timer']->getStartDate();\n $interval = $job['timer']->getDateInterval();\n\n //Get the next DateTime cycle after the start date of the timer.\n $nextDate = $this->getNextDateTimeCycle($job['timer'], $startDate);\n\n //Assertion: The next DateTime must be the start date plus one interval.\n $expected = clone $startDate;\n $expected->add($interval);\n $this->assertEquals($expected, $nextDate);\n\n //Get the next DateTime cycle\n $nextDateTwo = $this->getNextDateTimeCycle($job['timer'], $expected);\n\n //Assertion: The next DateTime must be the start date plus two intervals.\n $expectedNext = clone $startDate;\n $expectedNext->add($interval);\n $expectedNext->add($interval);\n $this->assertEquals($expectedNext, $nextDateTwo);\n }", "public function tuesdays()\n {\n return $this->days(2);\n }", "public function addSecond($second)\r\n {\r\n $date = date(self::MASK_TIMESTAMP_USER, mktime($this->hour, $this->minute, $this->second + $second, $this->month, $this->day, $this->year));\r\n $this->setValue($date);\r\n\r\n return $this;\r\n }", "function intervalAdd($interval1,$interval2)\n{\n\n $e = new DateTime('00:00');\n $f = clone $e;\n $e->add($interval1);\n $e->add($interval2); \n\n return $f->diff($e);\n}", "public function getStartOfDayDate()\n\t{\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\n\t\treturn $objectManager->create('\\Magento\\Framework\\Stdlib\\DateTime\\DateTime')->date(null, '0:0:0');\n\t}", "function get_time_difference( $time1, $time2 ) {\n\t$time1 = (int)$time1;\n\t$time2 = (int)$time2;\n\t$result = array(\n\t\t'days' => 0,\n\t\t'hours' => 0,\n\t\t'minutes' => 0,\n\t\t'seconds' => 0\n\t);\n\tif( $time1 == 0 || $time2 == 0) return $result;\n\t\n\tif($time2 > $time1) {\n\t\t$start = date(\"H:i\",$time1);\n\t\t$end = date(\"H:i\",$time2);\n\t} else {\n\t\t$start = date(\"H:i\",$time2);\n\t\t$end = date(\"H:i\",$time1);\t\n\t}\t\n\t\n\t$uts['start'] = $time2;\n\t$uts['end'] = $time1;\n\tif( $uts['start']!==-1 && $uts['end']!==-1 ) {\n\t\tif( $uts['end'] >= $uts['start'] ) {\n\t\t\n\t\t\t$diff = $uts['end'] - $uts['start'];\n\t\t\tif( $days=intval((floor($diff/86400))) ) $diff = $diff % 86400;\n\t\t\tif( $hours=intval((floor($diff/3600))) ) $diff = $diff % 3600;\n\t\t\tif( $minutes=intval((floor($diff/60))) ) $diff = $diff % 60;\n\t\t\t$diff = intval( $diff ); \n\t\t\tif($days > 0) $hours += $days*24;\n\t\t\treturn( array('days'=>str_pad($days,2,0, STR_PAD_LEFT), 'hours'=>str_pad($hours,2,0, STR_PAD_LEFT), 'minutes'=>str_pad($minutes,2,0, STR_PAD_LEFT), 'seconds'=>str_pad($diff,2,0, STR_PAD_LEFT)) );\n\t\t}\t\n\t}\t\n\treturn $result;\n}", "public function testCycleBetweenDatesExpression()\n {\n /* @var $startDate \\DateTime */\n /* @var $interval \\DateInterval */\n\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/Timer_StartEvent_TimeCycle.bpmn');\n\n //Load a process from a bpmn repository by Id\n $process = $bpmnRepository->getProcess('Process');\n $timerEventDefinition = $bpmnRepository->getTimerEventDefinition('_9_ED_1');\n\n //Set a time cycle between two dates\n $expression = $this->repository->createFormalExpression();\n $expression->setRepository($this->repository);\n $expression->setProperty('body', 'R/2018-05-01T00:00:00Z/PT1M/2018-06-01T00:00:00Z');\n $timerEventDefinition->setTimeCycle($expression);\n\n $this->engine->loadProcess($process);\n\n //Get scheduled job information\n $job = $this->jobs[0];\n $startDate = $job['timer']->getStartDate();\n $interval = $job['timer']->getDateInterval();\n\n //Get the next DateTime cycle after the start date of the timer.\n $nextDate = $this->getNextDateTimeCycle($job['timer'], $startDate);\n\n //Assertion: The next DateTime must be the start date plus one interval.\n $expected = clone $startDate;\n $expected->add($interval);\n $this->assertEquals($expected, $nextDate);\n\n //Get the next DateTime cycle\n $nextDateTwo = $this->getNextDateTimeCycle($job['timer'], $expected);\n\n //Assertion: The next DateTime must be the start date plus two intervals.\n $expectedNext = clone $startDate;\n $expectedNext->add($interval);\n $expectedNext->add($interval);\n $this->assertEquals($expectedNext, $nextDateTwo);\n }", "public static function yesterdaySameTime()\n {\n return new Date(strtotime(\"yesterday \" . date('H:i:s')));\n }", "function getdays($date1,$date2)\r\n {\r\n return round((strtotime($date2)-strtotime($date1))/(24*60*60),0);\r\n }", "function getSomeDayFromDay($currentDay, $number)\n {\n if ( $number == 0 ) {\n return $tmpDates[$currentDay] = $currentDay;\n }\n\n $tmpDates = array();\n $newdate = '';\n for ( $i = $number; $i >= 1; $i-- ) {\n $newdate = strtotime ( '-' . $i . ' day' , strtotime ( $currentDay ) ) ;\n $newdate = date ( 'Y-m-j' , $newdate );\n $tmpDates[$newdate] = $newdate;\n }\n $tmpDates[$currentDay] = $currentDay;\n for ( $i = 1; $i <= $number; $i++ ) {\n $newdate = strtotime ( '+' . $i . ' day' , strtotime ( $currentDay ) ) ;\n $newdate = date ( 'Y-m-j' , $newdate );\n $tmpDates[$newdate] = $newdate;\n }\n\n return $tmpDates;\n }", "public static function firstSecondOfMonth(int $epoch = null,\r\n bool $gmt = false) {\r\n $epoch = $epoch ?? time();\r\n $function = $gmt ? 'gmmktime' : 'mktime';\r\n return $function(0, 0, 0, date('n', $epoch), 1, date('Y', $epoch));\r\n }", "public function getNext() {\r\n $nextDate = $this->getStartDate();\r\n $nextDate->modify('+1 ' . $this->getMode());\r\n\r\n return $nextDate->getTimestamp();\r\n }", "public function closestDate()\n\t{\n\t\tif($this->beforeDate == null)\n\t\t{\n\t\t\treturn $this->afterDate;\n\t\t}\n\n\t\tif($this->afterDate == null)\n\t\t{\n\t\t\treturn $this->beforeDate;\n\t\t}\n\n\t\t$beforeDays = $this->beforeDate->diffInDays($this->targetDate);\n\t\t$afterDays = $this->afterDate->diffInDays($this->targetDate);\n\n\t\tif(abs($beforeDays) < abs($afterDays))\n\t\t{\n\t\t\treturn $this->beforeDate;\n\t\t}\n\n\t\treturn $this->afterDate;\n\t}", "private function _calendar_array_two($start_d)\n\t{\n\t $days_array = array();\n $days_url_array = array();\n $days_in_month = days_in_month($this->month, $this->year) + 1;\n \n for($i = $start_d; $i < $days_in_month; $i++):\n array_push($days_array, $i);\n endfor;\n \n foreach($days_array as $day):\n $stampeddate = strtotime($this->year.\"-\".$this->month.\"-\".$day);\n array_push($days_url_array, URL::base(TRUE, TRUE).\"calendar_day/\".date(\"j\", $stampeddate).\"/\".date(\"n\", $stampeddate).\"/\".date(\"Y\", $stampeddate));\n endforeach;\n \n array_push($this->callinks, array_combine($days_array, $days_url_array));\n\t}", "function GetDiffDays($dt1, $dt2){\n \n list($dia1, $mes1, $anio1) = explode( '/', $dt1); \n list($dia2, $mes2, $anio2) = explode( '/', $dt2);\n \n //calculo timestam de las dos fechas \n $timestamp1 = mktime(0,0,0,$mes1,$dia1,$anio1); \n $timestamp2 = mktime(4,12,0,$mes2,$dia2,$anio2); \n\n //resto a una fecha la otra \n $segundos_diferencia = $timestamp1 - $timestamp2; \n //echo $segundos_diferencia; \n\n //convierto segundos en días \n $dias_diferencia = $segundos_diferencia / (60 * 60 * 24); \n\n //obtengo el valor absoulto de los días (quito el posible signo negativo) \n $dias_diferencia = abs($dias_diferencia); \n\n //quito los decimales a los días de diferencia \n $dias_diferencia = floor($dias_diferencia); \n\n return $dias_diferencia; \n}", "public function countSecond($beginDate,$endDate){\n\t\t$beginDate = new DateTime('2010-01-01 10:12:55');\n\t\t$endDate = new DateTime('2010-01-01 10:17:55');\n\t\t$interval = $endDate->diff($beginDate);\n\n\t\treturn $interval->format('%s');\n\t}", "public static function getNextDate($date)\n {\n $date = TimezoneHelper::getDateFromString($date);\n $date->add(new DateInterval(\"P1D\"));\n return TimezoneHelper::getDateFromString($date->format('Y-m-d'));\n }", "public function getFirstDay(){$day = getdate(mktime(0, 0, 0, $this->getMonth(), 1, $this->getYear())); return $day['wday'];}", "public function getNextRunTime($time = null) {\n if ($time === null) {\n if ($this->lastRunTime) {\n $time = $this->lastRunTime;\n } else {\n $time = time();\n }\n }\n\n $second = date('s', $time);\n $minute = date('i', $time);\n $hour = date('G', $time);\n $day = date('j', $time);\n $month = date('n', $time);\n $year = date('Y', $time);\n $dayOfWeek = date('w', $time);\n\n if ($this->second == self::ASTERIX && $this->minute == self::ASTERIX && $this->hour == self::ASTERIX && $this->day == self::ASTERIX && $this->month == self::ASTERIX && $this->dayOfWeek == self::ASTERIX) {\n $this->addSecond($second, $minute, $hour, $day, $month, $year);\n return mktime($hour, $minute, $second, $month, $day, $year);\n }\n\n $newMinute = $minute;\n $newHour = $hour;\n $newDay = $day;\n $newMonth = $month;\n $newYear = $year;\n $changed = false;\n\n $newSecond = $this->getNextRunIntervalValue($this->second, $second, null, false);\n if ($newSecond === null) {\n $newSecond = $second;\n $this->addSecond($newSecond, $newMinute, $newHour, $newDay, $newMonth, $newYear);\n }\n\n if ($newSecond != $second) {\n $changed = true;\n }\n\n $tmpMinute = $newMinute;\n if ($second < $newSecond) {\n $newMinute = $this->getNextRunIntervalValue($this->minute, $newMinute, $newMinute, true);\n } else {\n $newMinute = $this->getNextRunIntervalValue($this->minute, $newMinute, null, false);\n }\n if ($newMinute === null) {\n $newMinute = $tmpMinute;\n if ($newMinute == $minute) {\n $this->addMinute($newMinute, $newHour, $newDay, $newMonth, $newYear);\n }\n }\n\n if ($newMinute != $minute) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n }\n\n $tmpHour = $newHour;\n if ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)) {\n $newHour = $this->getNextRunIntervalValue($this->hour, $newHour, null, false);\n } else {\n $newHour = $this->getNextRunIntervalValue($this->hour, $newHour, $newHour, true);\n }\n if ($newHour === null) {\n $newHour = $tmpHour;\n if ($newHour == $hour) {\n $this->addHour($newHour, $newDay, $newMonth, $newYear);\n }\n }\n\n if ($newHour != $hour) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n }\n\n $tmpDay = $newDay;\n if ($newHour < $hour || ($newHour == $hour && ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)))) {\n $newDay = $this->getNextRunIntervalValue($this->day, $newDay, null, false);\n } else {\n $newDay = $this->getNextRunIntervalValue($this->day, $newDay, $newDay, true);\n }\n if ($newDay === null) {\n $newDay = $tmpDay;\n if ($newDay == $day) {\n $this->addDay($newDay, $newMonth, $newYear);\n }\n }\n\n if ($newDay != $day) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n $newHour = $this->getFirstRunIntervalValue($this->hour, 0);\n }\n\n $tmpMonth = $newMonth;\n if ($newDay < $day || ($newDay == $day && ($newHour < $hour || ($newHour == $hour && ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)))))) {\n $newMonth = $this->getNextRunIntervalValue($this->month, $newMonth, null, false);\n } else {\n $newMonth = $this->getNextRunIntervalValue($this->month, $newMonth, $newMonth, true);\n }\n if ($newMonth == null) {\n $newMonth = $tmpMonth;\n if ($newMonth == $month) {\n $this->addMonth($newMonth, $newYear);\n }\n }\n\n if ($newMonth != $month) {\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n $newHour = $this->getFirstRunIntervalValue($this->hour, 0);\n $newDay = $this->getFirstRunIntervalValue($this->day, 1);\n }\n\n $nextRunTime = mktime($newHour, $newMinute, $newSecond, $newMonth, $newDay, $newYear);\n\n if ($this->dayOfWeek != self::ASTERIX && !isset($this->dayOfWeek[date('w', $nextRunTime)])) {\n $nextRunTime = DateTime::roundTimeToDay($nextRunTime) + DateTime::DAY - 1;\n return $this->getNextRunTime($nextRunTime);\n }\n\n return $nextRunTime;\n }", "public static function eitherWayRound(JustDate $a, JustDate $b): DateRange\n {\n return new DateRange(JustDate::earliest($a, $b), JustDate::latest($a, $b));\n }", "protected function findNextSuitableDay(Carbon $date)\n\t{\n\t\tif($date->isWeekend() && !$this -> cup -> play_weekends)\n\t\t{\n\t\t\t// if sunday move one day in advance, otherwise move two days\n\t\t\t$date -> addWeekdays($date->dayOfWeek == 0 ? 1 : 2);\n\t\t}\n\t\t// we do not play during the week\n\t\telseif($date->isWeekday() && !$this -> cup -> play_weekdays)\n\t\t{\n\t\t\t// 1 mon - 5 fri; adds number of days depending on week day\n\t\t\t$date -> addWeekdays(5 - $date->dayOfWeek);\n\t\t}\n\t\treturn $date;\n\t}", "public static function getIntervalSemBetweenNowAndDate($date)\n {\n //si la date est un string\n if (is_string($date)) {\n $stop = new DateTime($date);\n } if ($date instanceof DateTime) {\n $stop = $date;\n } else {\n return null;\n }\n $stop = $stop->format('d/m/Y');\n\n //génération de la date now\n $start = new DateTime(date(DATE_ATOM));\n $start->modify('Monday this week');\n $start = $start->format('d/m/Y');\n //expode\n $start = explode('/', $start);\n $stop = explode('/', $stop);\n //timestamp\n $start = mktime(0, 0, 0, $start[1], $start[0], $start[2]);\n $stop = mktime(0, 0, 0, $stop[1], $stop[0], $stop[2]);\n //calcul\n $result = $stop - $start;\n $s = ($result / 86400);\n\n $s = floor($s / 7);\n return $s;\n }", "function get_mnt_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,($date_split[1]+1),$date_split[0],$date_split[2]));\n }", "function wac_datetimeleft($totaltime){\n\t$seconds = floor($totaltime);\n $minutes = floor($seconds / 60);\n $hours \t = floor($minutes / 60);\n $days \t = floor($hours / 24);\n\t\n\t$hours %= 24;\n $minutes %= 60;\n $seconds %= 60;\n\t \n\treturn ['d'=>$days,'h'=>$hours,'m'=>$minutes,'s'=>$seconds];\n}", "function from($date)\n{\n $duration = 10 ** 9;\n \n $from_date = $date->add(\n new DateInterval(\"PT\" . $duration. \"S\")\n );\n\n return $from_date;\n}", "function timecomp($a,$b)\n{\n // Returns a negative number if $b is a date before $a,\n // otherwise positive.\n\n return strtotime($b[1])-strtotime($a[1]);\n}", "function diffDate($date1 ,$date2){\n\t$diff = abs(strtotime($date2) - strtotime($date1));\n\t$years = floor($diff / (365*60*60*24));\n\t$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));\n\t$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));\n\t$hours = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24)/ (60*60));\n\t$minuts = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60)/ 60);\n\t$seconds = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24 - $days*60*60*24 - $hours*60*60 - $minuts*60));\n\t$result [0]= $years;\n\t$result [1]= $months;\n\t$result [2]= $days;\n\t$result [3]= $hours;\n\t$result [4]= $minuts;\n\t$result [5]= $seconds;\n\treturn $result;\n}", "function randomSleep($first, $second) {\r\n\t\t$rand = rand($first, $second);\r\n\t\tsleep($rand);\r\n\r\n\t\treturn $rand;\r\n\t}", "public function getRunningSecond()\n {\n return $this->get(self::RUNNING_SECOND);\n }", "public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}", "public static function setSecondsOfDateTime(\\DateTime $date, int $seconds): \\DateTime\n {\n $date = clone $date;\n $date->setTime(0, 0, 0);\n $date->modify(\"+$seconds seconds\");\n\n return $date;\n }", "function swapdate($temp){\n\t$d\t\t\t= explode(\"-\",$temp);\n\t$ndate \t= ($d[0] - 543).\"-\".$d[1].\"-\".$d[2];\n\treturn $ndate;\n}", "public static function getDateFromSeconds($scd) {\n $date = date('m/d/Y h:i:s', time());\n $stamp = strtotime($date) - $scd;\n return date(\"d/m/y\", $stamp);\n }", "public function next()\n {\n if (empty($this->startDate) || empty($this->endDate)) {\n return false;\n }\n\n $today = DateTimeHelper::toDateTime(new DateTime('now', new DateTimeZone(Craft::$app->getTimeZone())));\n $numericValueOfToday = $today->format('w');\n $days = $this->days;\n $diff = $this->endDate->getTimestamp() - $this->startDate->getTimestamp();\n\n // This event isnt in range just yet...\n if ($today->format('Y-m-d') < $this->startDate->format('Y-m-d')) {\n return new Occurrence($this->owner, $this->startDate, $diff);\n }\n\n // if repeats find the next occurrence else return the start date\n if ($this->repeats) {\n if (!empty($this->endRepeatDate)) {\n $this->endRepeatDate->setTime($this->startDate->format('H'), $this->startDate->format('i'));\n }\n\n // if it ends at somepoint and we are passed that date, return the last occurrence\n if ($this->endRepeat !== 'never' && $today > $this->endRepeatDate) {\n return new Occurrence($this->owner, $this->endRepeatDate, $diff);\n }\n\n $occurrences = $this->getOccurrencesBetween($today, null, 1);\n\n if (count($occurrences)) {\n $nextOffer = $occurrences[0];\n\n if ($this->endRepeat !== 'never' && !empty($this->endRepeatDate)) {\n if ($nextOffer > $this->endRepeatDate) {\n return new Occurrence($this->owner, $this->endRepeatDate, $diff);\n }\n }\n\n return $nextOffer;\n }\n }\n\n return new Occurrence($this->owner, $this->startDate, $diff);\n }", "private function calculateSecondInternationalWorkersDay(): void\n {\n if ($this->year >= 2018) {\n return;\n }\n\n $this->addHoliday(new Holiday('secondInternationalWorkersDay', [\n 'uk' => 'День міжнародної солідарності трудящих',\n 'ru' => 'День международной солидарности трудящихся',\n ], new \\DateTime(\"$this->year-05-02\", new \\DateTimeZone($this->timezone)), $this->locale));\n }", "public function getStartDateAndTime() {}", "function One_hour_later($time_begin) {\n\n\t$time_begin = substr($time_begin, 0, 10). ' '. substr($time_begin, 11, 10);\n\t// echo '$time_begin = '. $time_begin. '<br>';\n\t$d = strtotime($time_begin);\n\t$d = $d + 3600;\n\t$One_hour_later = date('Y-m-d', $d). \"T\".date('h:i:s', $d);\n\t// echo '$One_hour_later = '. $One_hour_later. '<br>';\n return $One_hour_later;\n\t}", "public static function getFirstDayOfGivenDate($date)\n\t{\n\t\t$full_date = explode('-', $date);\n\t\t$year = $full_date[0];\n\t\t$month = $full_date[1];\n\t\t$day = $full_date[2];\n\t\t\n\t\t$dateInSeconds = mktime(0, 0, 0, $month, 1, $year);\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "public function getNextTriggerTimeForDaily($scheduledTime) {\n\t\t$now = strtotime(date('Y-m-d H:i:s'));\n\t\t$todayScheduledTime = strtotime(date('Y-m-d H:i:s', strtotime($scheduledTime)));\n\t\tif ($now > $todayScheduledTime) {\n\t\t\t$nextTime = date('Y-m-d H:i:s', strtotime('+1 day ' . $scheduledTime));\n\t\t} else {\n\t\t\t$nextTime = date('Y-m-d H:i:s', $todayScheduledTime);\n\t\t}\n\t\treturn $nextTime;\n\t}", "function get_first_day($day_number=1, $month=false, $year=false) {\r\n $month = ($month === false) ? strftime(\"%m\"): $month;\r\n $year = ($year === false) ? strftime(\"%Y\"): $year;\r\n \r\n $first_day = 1 + ((7+$day_number - strftime(\"%w\", mktime(0,0,0,$month, 1, $year)))%7);\r\n \r\n return mktime(0,0,0,$month, $first_day, $year);\r\n }", "function jours($date1, $date2){\n\t\t\t$diff = abs($date1 - $date2); \n\t\t\t$retour = array();\n\t\t \n\t\t\t$tmp = $diff;\n\t\t\t$retour['second'] = $tmp % 60;\n\t\t \n\t\t\t$tmp = floor( ($tmp - $retour['second']) /60 );\n\t\t\t$retour['minute'] = $tmp % 60;\n\t\t\t\n\t\t\t$tmp = floor( ($tmp - $retour['minute'])/60 );\n\t\t\t$retour['hour'] = $tmp % 24;\n\t\t\t\t \n\t\t\t$tmp = floor( ($tmp - $retour['hour']) /24 );\n\t\t\t$retour['day'] = $tmp;\n\t\t\t\t \n\t\t\treturn $retour['day'];\n\t\t}", "function jours($date1, $date2){\n\t\t\t$diff = abs($date1 - $date2); \n\t\t\t$retour = array();\n\t\t \n\t\t\t$tmp = $diff;\n\t\t\t$retour['second'] = $tmp % 60;\n\t\t \n\t\t\t$tmp = floor( ($tmp - $retour['second']) /60 );\n\t\t\t$retour['minute'] = $tmp % 60;\n\t\t\t\n\t\t\t$tmp = floor( ($tmp - $retour['minute'])/60 );\n\t\t\t$retour['hour'] = $tmp % 24;\n\t\t\t\t \n\t\t\t$tmp = floor( ($tmp - $retour['hour']) /24 );\n\t\t\t$retour['day'] = $tmp;\n\t\t\t\t \n\t\t\treturn $retour['day'];\n\t\t}", "public function firstDay(int $day)\n {\n return $this->set('first_day', $day);\n }", "function DateToSec($date)\n{\n $date = ltrim($date);\n $arr = explode(\"-\", $date);\n if( count($arr) == 1 ) {\n $arr = explode(\"/\", $date);\n }\n if( count($arr) != 3 ) {\n return \"\";\n }\n return(mktime(0,0,0, $arr[0], $arr[1], $arr[2]));\n}", "private function nextDayShiftInfo($shiftForTheDay,$nextDay,$nextDate)\n {\n $this->outOfShiftMin = $this->todayMaxTime;\n $this->nextDayShift = $this->shiftForPunchInCheck($shiftForTheDay,$nextDay,$nextDate);\n $this->outOfShiftMax = $this->todayMinTime;\n }", "static public function findDateTimeStep($stepValue) {\r\n $tmpDateTimeStep = new DateTimeStep();\r\n for ($t = DateTimeStep::$ONEYEAR - 1;\r\n $t >= DateTimeStep::$ONEMILLISECOND; $t--) {\r\n if ((abs($tmpDateTimeStep->STEP[$t] - $stepValue)) <\r\n ($tmpDateTimeStep->STEP[DateTimeStep::$ONEMILLISECOND])) {\r\n return $t;\r\n }\r\n }\r\n return DateTimeStep::$NONE;\r\n }", "public static function secondly($interval = 1) {\n return new SecondlyRule($interval);\n }", "function set_second_day_flag($id,$acc_number)\n\t{\n\t $data['second_day'] = 1;\n\t return $this->db->where('number',$acc_number)\n\t\t ->where('id',$id)\t\t \n\t \t ->limit(1)\n\t \t ->update('pamm_tp', $data);\n\t}", "function date_compare($first_date, $second_date)\n{\n $first_date = date('Ymd', strtotime($first_date));\n $second_date = date('Ymd', strtotime($second_date));\n\n if ($first_date == $second_date) {\n return 0;\n } else {\n if ($first_date > $second_date) {\n return 1;\n } else {\n return 2;\n }\n }\n}", "function nextRdate1($curD, $rI, $rP) {\n\t$curT = mktime(12,0,0,substr($curD,5,2),substr($curD,8,2),substr($curD,0,4));\n\t$curDoM = date('j',$curT);\n\tswitch ($rP) { //period\n\tcase 1: //day\n\t\t$nxtD = date('Y-m-d',strtotime(\"+$rI days\",$curT)); break;\n\tcase 2: //week\n\t\t$nxtD = date('Y-m-d',strtotime(\"+$rI weeks\",$curT)); break;\n\tcase 3: //month\n\t\t$i = 1;\n\t\twhile(date('j',strtotime('+'.$i*$rI.' months',$curT)) != $curDoM) { $i++; } //deal with 31st\n\t\t$nxtD = date('Y-m-d',strtotime('+'.$i*$rI.' months',$curT));\n\t\tbreak;\n\tcase 4: //year\n\t\t$i = 1;\n\t\twhile(date('j',strtotime('+'.$i*$rI.' years',$curT)) != $curDoM) { $i++; } //deal with 29/02\n\t\t$nxtD = date('Y-m-d',strtotime('+'.$i*$rI.' years',$curT));\n\t\tbreak;\n\t}\n\treturn $nxtD;\n}", "function date_dates_between( $date1, $date2 ) {\n\tif ( is_int( $date1 ) ) {\n\t\t$date1 = date( 'Y-m-d H:i:s', $date1 );\n\t\t$date2 = date( 'Y-m-d H:i:s', $date2 );\n\t}\n\t$dates = array();\n\t$date = substr( $date1, 0, 10 );\n\n\twhile ( $date <= $date2 ) {\n\t\t$dates[] = $date;\n\t\t$date = date( 'Y-m-d', mktime( 0, 0, 0, substr( $date, 5, 2 ), substr( $date, 8, 2 ) + 1, substr( $date, 0, 4 ) ) );\n\t}\n\n\treturn $dates;\n}", "public function getStartOfDayDate()\n {\n return $this->_date->date(null, '0:0:0');\n }", "public function calculeDureVie($date1,$date2){\n //$datenow=strtotime(date(\"Y-m-d\"));\n // $date=selectDateStartCampagne();\n\n $diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative\n $retour = array();\n\n $tmp = $diff;\n $retour['second'] = $tmp % 60;\n\n $tmp = floor( ($tmp - $retour['second']) /60 );\n $retour['minute'] = $tmp % 60;\n\n $tmp = floor( ($tmp - $retour['minute'])/60 );\n $retour['hour'] = $tmp % 24;\n\n $tmp = floor( ($tmp - $retour['hour']) /24 );\n $retour['day'] = $tmp;\n\n return $retour['day'] ;\n }", "function DateTimeToInt ($s) {\n\tGlobal $iTimeType;\n\t\n\t$y = (int)substr($s, 0, 4);\t\t// year\n\t$m = (int)substr($s, 4, 2);\t\t// month\n\t$d = (int)substr($s, 6, 2);\t\t// day\n\t$h = (int)substr($s, 8, 2);\t\t// hour\n\t$n = (int)substr($s,10, 2);\t\t// minute\n\t\n\tif ($m < 1) $m = 1;\n\tif (12 < $m) $m = 12;\n\tif ($d < 1) $d = 1;\n\tif (31 < $d) $d = 31;\n\tif ($h < 0) $h = 0;\n\tif (23 < $h) $h = 23;\n\tif ($n < 0) $n = 0;\n\tif (59 < $n) $n = 59;\n\t\n\tif ($iTimeType == 1) {\n\t\t$z = (int)substr($s,12, 2);\t// second\n\t\tif ($y < 1970) $y = 1970;\n\t\tif (2037 < $y) $y = 2037;\n\t\tif ($z < 0) $z = 0;\n\t\tif (59 < $z) $z = 59;\n\t\treturn mktime($h,$n,$z,$m,$d,$y);\n\t}\n\t\n\t$y -= 2000;\n\tif ($y < 0) $y = 0;\n\tif (213 < $y) $y = 213;\n\treturn ($y*10000000)+((50+$m*50+$d)*10000) + ($h*100) + $n;\t// 3+3+2+2\n}", "public static function diff(Date $a, Date $b) {\n return new TimeSpan($a->getTime() - $b->getTime());\n }", "public function getTwoBusinessDaysFrom(\\DateTime $date, $op)\n {\n $from = $date->format('Y-m-d');\n $sign = $op == 'add' ? '+' : '-';\n $to = (new \\DateTime(\"$from {$sign}2 weeks\"));\n $this->current_holidays = $this->holidays->getHolidaysForPeriod(\n $to,\n $from\n );\n if (! $this->isABusinessDay($date)) {\n $date->setTime(0, 0);\n while (! $this->isABusinessDay($date)) {\n $date->$op(new \\DateInterval('P1D'));\n }\n }\n $n = 0;\n while ($n < 2) {\n $date->$op(new \\DateInterval('P1D'));\n while (! $this->isABusinessDay($date)) {\n $date->$op(new \\DateInterval('P1D'));\n continue;\n }\n $n++;\n }\n\n return $date;\n }", "public static function getSecondsToWholeDays($seconds) {\n\t\treturn round($seconds / (3600 * 24));\n\t}", "function addSeconds ($date, $seconds)\n\t{\n\t\treturn new date (\"Y-m-d H:i:s\", strtotime ($date) + $seconds);\n\t}", "public function get_next_payment_date( $cycle = 0 ) {\n\n\t\t$next_payment = $this->get_meta( 'next_payment' );\n\n\t\tif ( '' === $next_payment ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$next = new DateTime( $next_payment );\n\n\t\tif ( 0 !== $cycle ) {\n\t\t\t$next->modify( sprintf(\n\t\t\t\t'+%d %s',\n\t\t\t\t( $cycle * $this->get_interval() ),\n\t\t\t\tPronamic_WP_Util::to_interval_name( $this->get_interval_period() )\n\t\t\t) );\n\t\t}\n\n\t\treturn $next;\n\t}", "public function testGetNextDate()\n {\n $test_data = array(\n array('20130101', array('2013', '01', '02')),\n array('20130102', array('2013', '01', '03')),\n array('20130103', array('2013', '01', '04')),\n array('20130104', array('2013', '01', '05')),\n array('20130131', array('2013', '02', '01')),\n array('20130228', array('2013', '03', '01')),\n array('20130331', array('2013', '04', '01')),\n array('20130430', array('2013', '05', '01')),\n array('20130531', array('2013', '06', '01')),\n array('20130630', array('2013', '07', '01')),\n array('20130731', array('2013', '08', '01')),\n array('20130831', array('2013', '09', '01')),\n array('20130930', array('2013', '10', '01')),\n array('20131031', array('2013', '11', '01')),\n array('20131130', array('2013', '12', '01')),\n array('20131231', array('2014', '01', '01')),\n );\n foreach ($test_data as $data) {\n $result = DateUtility::getNextDate($data[0]);\n $this->assertEquals($data[1], $result);\n }\n }", "function time_since($original)\n{\n// http://www.dreamincode.net/code/snippet86.htm\n\n // array of time period chunks\n $chunks = array(\n array(60 * 60 * 24 * 365, 'year'),\n array(60 * 60 * 24 * 30, 'month'),\n array(60 * 60 * 24 * 7, 'week'),\n array(60 * 60 * 24, 'day'),\n array(60 * 60, 'hour'),\n array(60, 'minute'),\n );\n \n $today = time();\n $since = $today - $original;\n \n // $j saves performing the count function each time around the loop\n for( $i=0, $j=count($chunks); $i<$j; $i++ )\n {\n \n $seconds = $chunks[$i][0];\n $name = $chunks[$i][1];\n \n // finding the biggest chunk (if the chunk fits, break)\n if( ($count = floor($since / $seconds)) != 0 )\n {\n break;\n }\n }\n \n $print = ($count == 1) ? '1 '.$name : \"$count {$name}s\";\n \n if( $i + 1 < $j )\n {\n // now getting the second item\n $seconds2 = $chunks[$i + 1][0];\n $name2 = $chunks[$i + 1][1];\n \n // add second item if it's greater than 0\n if( ($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0 )\n {\n $print .= ($count2 == 1) ? ', 1 '.$name2 : \", $count2 {$name2}s\";\n }\n }\n return $print;\n}", "public static function tomorrow(): string\n {\n $d = new DateTime;\n $i = new DateInterval(\"P1D\");\n $d->add($i);\n return $d->format(\"Y-m-d\");\n }", "public function secondStar()\n {\n $guardSleepDist = $this->getSleepDistributionForGuards();\n\n // Find the most slept minutes of all and the guard behind it\n $highestCount = 0;\n $mostSleptMinute = null;\n $sleepingGuard = null;\n foreach ($guardSleepDist as $guardId => $minutes) {\n foreach ($minutes as $minute => $count) {\n if ($count > $highestCount) {\n $highestCount = $count;\n $mostSleptMinute = $minute;\n $sleepingGuard = $guardId;\n }\n }\n }\n\n return $sleepingGuard * $mostSleptMinute;\n }", "public function proposeNextEventDate($formated = true)\n\t{\n\t\t$date = $this->getLastEvent()->getDate(false);\n\n\t\t$date = explode(' - ', $date);\n\t\t$startDate = trim(reset($date));\n\t\t$endDate = trim(end($date));\n\n\t\t$str = ' +' . $this->getIntervalValue() . ' ' . $this->getIntervalUnit();\n\t\t$startDate = new Zend_Date(strtotime($startDate . $str));\n\t\t$endDate = new Zend_Date(strtotime($endDate . $str));\n\n\n\t\twhile ($startDate->isEarlier(date('Y-m-d'))) {\n\t\t\t$intervalInDays = new Zend_Date(\n\t\t\t\tstrtotime(date('Y-m-d') . ' +' . $this->_intervalValue . ' ' . $this->_intervalUnit)\n\t\t\t);\n\t\t\t$intervalInDays = $intervalInDays->sub(time());\n\t\t\t$measure = new Zend_Measure_Time($intervalInDays->toValue(), Zend_Measure_Time::SECOND);\n\t\t\t$measure->convertTo(Zend_Measure_Time::DAY);\n\t\t\t$intervalInDays = ceil($measure->getValue(0) / 2);\n\n\t\t\t$diff = $endDate->sub($startDate)->toValue();\n\t\t\t$startDate->addDay($intervalInDays);\n\t\t\t$endDate = clone $startDate;\n\t\t\t$endDate->addDay($diff);\n\t\t}\n\n\t\t$format = $formated ? Zend_Date::DATES : 'YYYY-MM-dd';\n\t\t$date = $startDate->equals($endDate)\n\t\t\t? $startDate->toString($format)\n\t\t\t: ($startDate->toString($format) . ' - ' . $endDate->toString($format));\n\n\t\treturn $date;\n\t}", "function aspire_get_start_datetime($startdate, $starttime){\n\n date_default_timezone_set('US/Eastern');\n\n $start_datetime = strtotime($startdate . $starttime);\n\n return $start_datetime;\n\n}", "function dateDiff($date1, $date2)\r\n{\r\n\t$diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative\r\n\t$retour = array();\r\n \r\n\t$tmp = $diff;\r\n\t$retour['second'] = $tmp % 60;\r\n \r\n\t$tmp = floor( ($tmp - $retour['second']) /60 );\r\n\t$retour['minute'] = $tmp % 60;\r\n \r\n\t$tmp = floor( ($tmp - $retour['minute'])/60 );\r\n\t$retour['hour'] = $tmp % 24;\r\n \r\n\t$tmp = floor( ($tmp - $retour['hour']) /24 );\r\n\t$retour['day'] = $tmp;\r\n \r\n\treturn $retour;\r\n}", "function second()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n\r\n return $second;\r\n }", "static function splitDates($first_date, $second_date, $max_difference = 0)\n\t{\n\t\tdate_default_timezone_set('UTC');\n\t\tif( !self::checkDate($first_date) || !self::checkDate($second_date)){\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!self::isInt($max_difference, 0)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$date1 = new DateTime($first_date);\n\t\t$date2 = new DateTime($second_date);\n\t\t$interval = $date1->diff($date2, false);\n\t\t\n\t\tif((int)$interval->format('%R%a') < 0){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif($max_difference != 0){\n\t\t\tif((int)$interval->format('%R%a') > $max_difference){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlist($year,$month,$day) = array_pad(explode(\"-\",$first_date), 3, 0);\n\t\t\t\n\t\t$i = 0;\n\t\t$new_date = $first_date;\n $dates = array();\n\t\t\n\t\twhile($new_date <= $second_date)\n\t\t{\n\t\t\t$dates[] = $new_date;\n\t\t\t$i++;\n\t\t\t$new_date = date(\"Y-m-d\",mktime(0,0,0,$month,$day+$i,$year));\n\t\t}\n\t\t\n\t\treturn $dates;\n\t}", "function dateDiff($t1, $t2) {\r\n\t\t$t1 = strtotime($t1);\r\n\t\t$t2 = strtotime($t1);\r\n\t\t$delta_T = ($t2 - $t1);\r\n\t\t$day = round(($delta_T % 604800) / 86400); \r\n\t\t$hours = round((($delta_T % 604800) % 86400) / 3600); \r\n\t\t$minutes = round(((($delta_T % 604800) % 86400) % 3600) / 60); \r\n\t\t$sec = round((((($delta_T % 604800) % 86400) % 3600) % 60));\r\n\r\n\t\treturn \"$day days $hours hours $minutes minutes $sec secs\";\t \r\n }", "protected function dateIntervalSeconds($dateInterval){\n $hourSeconds = $dateInterval->h * 60 * 60;\n $minuteSeconds = $dateInterval->i * 60;\n\n return $dateInterval->s + $minuteSeconds + $hourSeconds; \n }", "function connection_opened_date($sec)\n {\n $sec = intval($sec);\n $f = 'g:i a';\n if (!$sec) {\n return date($f);\n } else {\n return date($f, time() - $sec);\n }\n }" ]
[ "0.511757", "0.50206476", "0.48857266", "0.48644817", "0.48464334", "0.47891855", "0.47503102", "0.4727731", "0.46840614", "0.46599853", "0.46309114", "0.46084163", "0.46014196", "0.4518214", "0.45135102", "0.44815618", "0.4479986", "0.44434792", "0.4385757", "0.43846914", "0.43549544", "0.43342334", "0.42975253", "0.4287066", "0.42860916", "0.42773104", "0.42542228", "0.42440796", "0.42229438", "0.42215666", "0.42090487", "0.4204997", "0.4185713", "0.41855037", "0.41751137", "0.41663912", "0.416436", "0.4157927", "0.41549483", "0.41534007", "0.41446155", "0.4142286", "0.41409805", "0.41359922", "0.4134875", "0.41149762", "0.41073138", "0.41025746", "0.40965447", "0.40899196", "0.40803337", "0.40802374", "0.4063407", "0.40616244", "0.40608272", "0.40517518", "0.4028601", "0.40180987", "0.40145996", "0.4009078", "0.4008101", "0.40071544", "0.40031183", "0.39994004", "0.39988154", "0.39949617", "0.39873016", "0.39818576", "0.39741954", "0.39629498", "0.3955618", "0.3955618", "0.39538097", "0.39454776", "0.3943484", "0.39376885", "0.39318243", "0.3928922", "0.39270604", "0.39239255", "0.39213032", "0.39196527", "0.39187032", "0.39181072", "0.39085385", "0.39070535", "0.39050835", "0.39033788", "0.38950998", "0.3894103", "0.38773793", "0.3869666", "0.38690487", "0.38675684", "0.38658172", "0.3864436", "0.38618076", "0.3857301", "0.38567904", "0.38347492", "0.38324" ]
0.0
-1
Given a datetime, returns two datetimes, one with first day of the given month, and the other with the first day of next month
protected function getMonthRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, $date->format('m'), 1, $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 month'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function data_first_month() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}", "protected function startDate()\n {\n $d = new DateTime('first day of last month');\n $d->setTime(0, 0, 0);\n return $d;\n }", "function _data_first_month_day()\n {\n $month = date('m');\n $year = date('Y');\n return date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));\n }", "function _data_first_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}", "function monthPeriod_start_end($begin, $end)\n{\n $begin = (new DateTime($begin.'-01-01'))->modify('first day of this month');\n $end = (new DateTime($end.'-12-01 +1 month'))->modify('first day of this month');\n $daterange = new DatePeriod($begin, new DateInterval('P1M'), $end);\n\n foreach ($daterange as $date) {\n $dates[] = $date->format(\"m\");\n }\n return $dates;\n}", "public function getDateStartMonth($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime('first day of this month', strtotime($date)));\n\t\treturn $dateNew;\n\t}", "function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }", "static public function getFirstDayOfMonth($month='', $year=''){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t}\n\t\tif(!$year){\n\t\t\t$year = date('Y');\n\t\t}\n\t\treturn $year.'-'.sprintf('%02s', $month).'-01';\n\t}", "public static function getFirstDayOfCurrentMonth()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, date('m'), 1, date('Y'));\n\t\t$date = date('Y-m-01', $dateInSeconds);\n\t\treturn $date;\n\t}", "function nextMonth($interval=1){ return $this->_getDate(0,$interval); }", "function get_first_day($month) {\r\n $data = new DateTime('01-' . $month .'-'.date('Y'));\r\n $first_day = $data->format('D');\r\n switch($first_day) {\r\n case 'Sun':\r\n $initial_day_of_month = 1;\r\n break;\r\n case 'Mon':\r\n $initial_day_of_month = 2;\r\n break;\r\n case 'Tue':\r\n $initial_day_of_month = 3;\r\n break;\r\n case 'Wed':\r\n $initial_day_of_month = 4;\r\n break;\r\n case 'Thu':\r\n $initial_day_of_month = 5;\r\n break;\r\n case 'Fri':\r\n $initial_day_of_month = 6;\r\n break;\r\n case 'Sat':\r\n $initial_day_of_month = 7;\r\n break;\r\n }\r\n\r\n return $initial_day_of_month;\r\n }", "function getFirstDayOfDate(string $date): string {\n $d = new DateTime($date);\n $d->modify('first day of this month');\n return $d->format('Y-m-d');\n}", "public function nextMonth(): Month{\n $month = $this->month +1;\n $year=$this->year;\n if($month > 12){\n $month = 1;\n $year += 1;\n }\n return new Month($month, $year);\n }", "function getFirstDayInMonth()\n {\n return $this->firstDayInMonth;\n }", "function firstDay($monthname, $year) {\r\n if (empty($month)) {\r\n $month = date('m');\r\n }\r\n if (empty($year)) {\r\n $year = date('Y');\r\n }\r\n $result = strtotime(\"{$year}-{$month}-01\");\r\n return date('Y-m-d', $result);\r\n }", "public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}", "public function calculateFirstDayOfMonth($date)\n {\n return $date->copy()->startOfMonth()->addMonth();\n }", "public function setToFirstDayOfMonth(int $month = null) : Time /*PHP8:static*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n if ($month !== null) {\n if ($month < 1 || $month > 12) {\n throw new \\InvalidArgumentException('Arg month[' . $month . '] isn\\'t null or 1 through 12.');\n }\n $mnth = $month;\n }\n else {\n $mnth = (int) $this->format('m');\n }\n return $this->setDate(\n (int) $this->format('Y'),\n $mnth,\n 1\n );\n }", "function nextMonth($dates)\n\t{\n\t$dates='2015-11-01';\n \treturn date('F d,Y',strtotime($dates));\n\t}", "function add_month($start, $months)\n{\n $date1 = new DateTime($start->format(\"Y-m-d\\TH:i:sP\"));\n $day1 = intval($date1->format(\"d\"));\n\n $date2 = $date1->add(new DateInterval('P'.strval($months).'M'));\n $year2 = intval($date2->format(\"Y\"));\n $month2 = intval($date2->format(\"m\"));\n $day2 = intval($date1->format(\"d\"));\n\n if ($day1 <= $day2)\n {\n return $date2;\n }\n $date2->setDate($year2, $month2, 0);\n return $date2;\n}", "public function getStartAndEndDateByMonthAndYear($year = null, $month = null)\n {\n if ($year == null) {\n $year = new \\DateTime('now');\n $startDate = new \\DateTime($year->format('Y') . '-' . $month . '-01');\n $endDate = clone $startDate;\n } else if ($month == null) {\n $startDate = new \\DateTime($year . '-01-01');\n $endDate = new \\DateTime($year . '-12-01');\n } else {\n $startDate = new \\DateTime($year . '-' . $month . '-01');\n $endDate = clone $startDate;\n }\n $startDate->modify('first day of this month');\n $endDate->modify('last day of this month');\n return [\n 'startDate' => $startDate,\n 'endDate' => $endDate\n ];\n }", "protected function endDate()\n {\n $d = new DateTime('first day of this month');\n $d->setTime(0, 0, 0);\n return $d;\n }", "function this_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of this month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of this month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "function BeginMonth($time,$week,$backwards) {\n\tif ($backwards > 0) { $time = $time - ($backwards * 604800); } \n\t$month = date(\"n\", $time);\n\t$year = date(\"Y\", $time);\n\t$firstday = mktime(12,0,0,$month,1,$year);\n\tif ($week != NULL) { $firstday = BeginWeek($firstday); }\n\treturn($firstday);\n}", "public function testGetStartEndOfMonth() {\n // We only allow start dates in 31-day months.\n $now = new \\DateTimeImmutable('2019-09-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'monthly',\n 'day_of_month' => '-1',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2019-09-30', $date->format('Y-m-d'));\n\n // Tricky value as there is a Feb 29.\n $now = new \\DateTimeImmutable('2020-02-15');\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2020-02-29', $date->format('Y-m-d'));\n }", "private function getDatesInMonth() {\n $viewer = $this->getViewer();\n\n $timezone = new DateTimeZone($viewer->getTimezoneIdentifier());\n\n $month = $this->month;\n $year = $this->year;\n\n list($next_year, $next_month) = $this->getNextYearAndMonth();\n\n $end_date = new DateTime(\"{$next_year}-{$next_month}-01\", $timezone);\n\n list($start_of_week, $end_of_week) = $this->getWeekStartAndEnd();\n\n $days_in_month = id(clone $end_date)->modify('-1 day')->format('d');\n\n $first_month_day_date = new DateTime(\"{$year}-{$month}-01\", $timezone);\n $last_month_day_date = id(clone $end_date)->modify('-1 day');\n\n $first_weekday_of_month = $first_month_day_date->format('w');\n $last_weekday_of_month = $last_month_day_date->format('w');\n\n $day_date = id(clone $first_month_day_date);\n\n $num_days_display = $days_in_month;\n if ($start_of_week !== $first_weekday_of_month) {\n $interim_start_num = ($first_weekday_of_month + 7 - $start_of_week) % 7;\n $num_days_display += $interim_start_num;\n\n $day_date->modify('-'.$interim_start_num.' days');\n }\n if ($end_of_week !== $last_weekday_of_month) {\n $interim_end_day_num = ($end_of_week - $last_weekday_of_month + 7) % 7;\n $num_days_display += $interim_end_day_num;\n $end_date->modify('+'.$interim_end_day_num.' days');\n }\n\n $days = array();\n\n for ($day = 1; $day <= $num_days_display; $day++) {\n $day_epoch = $day_date->format('U');\n $end_epoch = $end_date->format('U');\n if ($day_epoch >= $end_epoch) {\n break;\n } else {\n $days[] = clone $day_date;\n }\n $day_date->modify('+1 day');\n }\n\n return $days;\n }", "public static function getFirstDayOfMonth( $date = false )\n\t{\n\t\tif ( $date === false )\n\t\t{\n\t\t\treturn date( 'Y-m-01' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn date( 'Y-m-d', strtotime( date( 'Y-m-01', strtotime( $date ) ) ) );\n\t\t}\n\t}", "public static function firstDayOfMonth(?DateTimeInterface $date = null): static\n\t{\n\t\t$date = self::checkDate($date);\n\t\treturn static::from($date->format('Y-m-01'));\n\t}", "public function getNextMonth($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime(\"+1 month\", strtotime($date)));\n\t\treturn $dateNew;\n\t}", "function same_day_next_month($time)\n{\n global $_initial_weeknumber;\n\n $days_in_month = date(\"t\", $time);\n $day = date(\"d\", $time);\n $weeknumber = (int)(($day - 1) / 7) + 1;\n $temp1 = ($day + 7 * (5 - $weeknumber) <= $days_in_month);\n\n // keep month number > 12 for the test purpose in line beginning with \"days_jump = 28 +...\"\n $next_month = date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day +35, date(\"Y\", $time))) + (date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day +35, date(\"Y\", $time))) < date(\"n\", $time)) * 12;\n\n // prevent 2 months jumps if $time is in 5th week\n $days_jump = 28 + (($temp1 && !($next_month - date(\"n\", $time) - 1)) * 7);\n\n /* if initial week number is 5 and the new occurence month number ($time + $days_jump)\n * is not changed if we add 7 days, then we can add 7 days to $days_jump to come\n * back to the 5th week (yuh!) */\n $days_jump += 7 * (($_initial_weeknumber == 5) && (date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day + $days_jump, date(\"Y\", $time))) == date(\"n\", mktime(11, 0 ,0, date(\"n\", $time), $day + $days_jump + 7, date(\"Y\", $time)))));\n\n return $days_jump;\n}", "public static function getFirstDayOfLastMonth()\n\t{\n\t\treturn date( 'Y-m-d', strtotime( ' '. date( 'F Y', strtotime( '-1 month' ) ) ) );\n\t}", "function incrementDate($startDate, $monthIncrement = 0) {\n\n $startingTimeStamp = $startDate->getTimestamp();\n // Get the month value of the given date:\n $monthString = date('Y-m', $startingTimeStamp);\n // Create a date string corresponding to the 1st of the give month,\n // making it safe for monthly calculations:\n $safeDateString = \"first day of $monthString\";\n // Increment date by given month increments:\n $incrementedDateString = \"$safeDateString $monthIncrement month\";\n $newTimeStamp = strtotime($incrementedDateString);\n $newDate = DateTime::createFromFormat('U', $newTimeStamp);\n return $newDate;\n}", "function get_first_day($day_number=1, $month=false, $year=false) {\r\n $month = ($month === false) ? strftime(\"%m\"): $month;\r\n $year = ($year === false) ? strftime(\"%Y\"): $year;\r\n \r\n $first_day = 1 + ((7+$day_number - strftime(\"%w\", mktime(0,0,0,$month, 1, $year)))%7);\r\n \r\n return mktime(0,0,0,$month, $first_day, $year);\r\n }", "function _makeMonth($date){\n // YYYY-MM and return an array of all the days\n // in the the month. The array that is returned\n // is in the same formate which is returned by\n // 'makeWeek' function\n $start = Carbon::parse($date)->startOfMonth();\n $end = Carbon::parse($date)->endOfMonth();\n $month = [];\n while ($start->lte($end)) {\n $carbon = $start;\n $month[] = $this->_makeDay($carbon);\n $start->addDay();\n }\n return $month;\n }", "public function createFromDateOrFirstDayOfMonth($text): DateTimeHolder\n {\n $holder = new DateTimeHolder;\n $date = date_create_from_format(\"j. n. Y\", $text);\n $holder->typed = $date ? $date : new DateTime('first day of this month');\n $holder->textual = $holder->typed->format(\"j. n. Y\");\n return $holder;\n }", "public function nextMonth(): Week{\n $week = $this->week;\n $year = $this->year;\n\n\n $begin = new DateTime(\"{$this->year}-01-01\");\n \n if ($begin->format('w')!=1) $begin->modify(\"next monday\");\n \n $dateact = $begin->modify(\"+\".($this->week-1).\" weeks\");\n\n $moisfin = $dateact->modify(\"next month\");\n\n $moisfin = intval($moisfin->format('m'));\n\n //tant que le mois 'm' ne change pas on ajoute des semaines\n do{\n $begin = new DateTime(\"{$this->year}-01-01\");\n if ($begin->format('w')!=1) $begin->modify(\"next monday\");\n $dateact = $begin->modify(\"+\".($week-1).\" weeks\");\n $moisdebut = intval($dateact->format('m'));\n $week += 1;\n if($week==53){\n \n \n $firstweek = New DateTime(\"{$year}-01-01\");\n if($firstweek->format('w')!=1) $firstweek->modify(\"next monday\");\n $lastweek = $firstweek->modify('+52 weeks'); \n $test = intval($lastweek->format('Y'));\n \n \n if($year != $test){ \n $week = 1;\n $year +=1;\n }; \n \n }elseif($week>53){\n $week = 1;\n $year +=1;\n }\n\n }while ($moisdebut != $moisfin);\n\n //si le mois d'arrivé est janvier c'est qu'on a changé d'année\n\n \n $week-=1;\n\n return new Week($week, $year);\n\n }", "public function setStartMonth($month)\n {\n $this->start_month = $month;\n $date = date('Y', time()) . '-' . $month . '-01';\n $this->start_date = new DateTime($date);\n }", "function the_date_range($start_dt,$end_dt, $one_day = false){\r\n\t\r\n\t$duration = $start_dt->diff($end_dt);\r\n\t$start = explode(\" \",$start_dt->format('l F j Y g i a'));\r\n\t$end = explode(\" \",$end_dt->format('l F j Y g i a'));\r\n\t\r\n\t//happening at the same time\r\n\tif($start == $end){\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : time_compact_ap_format($start[4],$start[5],$start[6])\r\n\t\t);\r\n\t}\t\r\n\t//happening on the same day\r\n\telseif($start[2] == $end[2] || ($duration->days < 1 && $duration->h < 24)){\r\n\t\t//Monday, March 4; 9:00 p.m.\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : sprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\t //formatted date\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//happening in the same month\r\n\t//check if happening all day; if not, return eo_all_day ? : \r\n\telseif($start[1] == $end[1]){\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\tsprintf(\r\n\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t$start[1], //month\r\n\t\t\t$start[2], //day of month\r\n\t\t\t$end[2]\r\n\t\t)\r\n\t\t: \r\n\t\tarray(\r\n\t\t\t\"date\" => sprintf(\r\n\t\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"datetime\" => sprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\tsprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\t//happening in the same year\r\n\telseif($start[3] == $end[3]){\r\n\t\treturn (eo_is_all_day() || $one_day) ?\r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s %s&ndash;%s %s\",\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//just plain happening\r\n\r\n\telse{\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n}", "public function getNextMonth(){\n\t\tif($this->getMonth() == 12){return 1;}\n\t\telse{return $this->getMonth()+1;}\n\t}", "function getDays_ym($month, $year){\n // Start of Month\n $start = new DateTime(\"{$year}-{$month}-01\");\n $month = $start->format('F');\n\n // Prepare results array\n $results = array();\n\n // While same month\n while($start->format('F') == $month){\n // Add to array\n $day = $start->format('D');\n $sort_date = $start->format('j');\n $date = $start->format('Y-m-d');\n $results[$date] = ['day' => $day,'sort_date' => $sort_date,'date' => $date];\n\n // Next Day\n $start->add(new DateInterval(\"P1D\"));\n }\n // Return results\n return $results;\n}", "public function testGetStartDateFeb31() {\n $now = new \\DateTimeImmutable('2019-09-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'day_of_month' => '31',\n 'month' => '2',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2020-02-29', $date->format('Y-m-d'));\n }", "function monthdate($date) {\n #print \"monthdate($date)<br>\\n\";\n return trim(substr($date, 5, 2) . substr($date, 8, 2));\n }", "function getFirstDayInMonth($y, $m)\n {\n return (int)Date_Calc::dayOfWeek(1, $m, $y);\n }", "function getNextMonth() {\n\t\t$nextDate = date ( \"Y-m-d\", strtotime ( \"+1 months\" ) );\n\t\t$dateArray = split ( \"-\", $nextDate );\n\t\t$nextMonth = FormatClass::getMonthName ( $dateArray [1], \"full\" );\n\t\treturn $nextMonth;\n\t}", "public function testGetStartDate() {\n $now = new \\DateTimeImmutable('2019-09-15');\n $next_month = new \\DateTime('2019-10-15');\n\n // No date values:\n $line_item = $this->lineItemStub([], ['interval_unit' => 'monthly']);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEmpty($date);\n\n // Day of month:\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'monthly',\n 'day_of_month' => '5',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('05', $date->format('d'));\n $this->assertTrue($date > $now);\n\n // Month:\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'month' => '5',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('05', $date->format('m'));\n $this->assertTrue($date > $now);\n\n // Start date in the future:\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'start_date' => $next_month,\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEquals($date->format('Y-m-d'), $next_month->format('Y-m-d'));\n\n // Start date in the past:\n $last_month = new \\DateTime('2019-08-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'start_date' => $last_month,\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertNotEquals($date->format('Y-m-d'), $last_month->format('Y-m-d'));\n $this->assertTrue($date > $now);\n\n // Start date + day of month + interval value:\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'monthly',\n 'interval_value' => '3',\n 'start_date' => new \\DateTime('2019-10-10'),\n 'day_of_month' => '1',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEquals($date->format('Y-m-d'), '2019-11-01');\n\n // Start date + day of month + month + interval value:\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'monthly',\n 'interval_value' => '3',\n 'start_date' => new \\DateTime('2019-10-10'),\n 'day_of_month' => '1',\n 'month' => '9',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2019-12-01', $date->format('Y-m-d'));\n\n // Weekly: everything but start date shouldn't matter.\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'weekly',\n 'interval_value' => '3',\n 'start_date' => new \\DateTime('2019-10-10'),\n 'day_of_month' => '1',\n 'month' => '9',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEquals($date->format('Y-m-d'), '2019-10-10');\n }", "public static function getFirstDayOfPreviousMonth()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, date('m')-1, 1, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "function _nextMonthTimestamp() {\n\t\treturn mktime(0,0,0,$this->_currentMonth+1,1,$this->_currentYear);\n\t}", "public function getTwelveMonth() {\n $result = array();\n $cur = strtotime(date('Y-m-01', time()));\n for ($i = 0; $i <= 11; $i++) {\n $result[$i] = date('M', $cur);\n $cur = strtotime('next month', $cur);\n }\n\n return $result;\n }", "private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }", "public function ga_calendar_next_month()\n {\n $current_date = isset($_POST['current_month']) ? esc_html($_POST['current_month']) : '';\n $service_id = isset($_POST['service_id']) ? (int) $_POST['service_id'] : 0;\n $provider_id = isset($_POST['provider_id']) && 'ga_providers' == get_post_type($_POST['provider_id']) ? (int) $_POST['provider_id'] : 0;\n $form_id = isset($_POST['form_id']) ? (int) $_POST['form_id'] : 0;\n\n if ('ga_services' == get_post_type($service_id) && ga_valid_year_month_format($current_date)) {\n $timezone = ga_time_zone();\n\n $date = new DateTime($current_date, new DateTimeZone($timezone));\n $date->modify('+1 month');\n\n $ga_calendar = new GA_Calendar($form_id, $date->format('n'), $date->format('Y'), $service_id, $provider_id);\n echo $ga_calendar->show();\n } else {\n wp_die(\"Something went wrong.\");\n }\n\n wp_die(); // Don't forget to stop execution afterward.\n }", "public function addMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month+$month>12){\n\t\t\t$year = ceil(($month+$this->_month)/12) - 1;\n\t\t\t$this->_month = ($year * 12) - $this->_month + $month;\n\t\t\t$this->_year+= $year;\n\t\t} else {\n\t\t\t$this->_month+=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "function erp_get_financial_year_dates( $date = null ) {\n $start_month = erp_get_option( 'gen_financial_month', 'erp_settings_general', 1 );\n if ( $date == null ) {\n $year = date( 'Y' );\n $month = date( 'n' );\n } else {\n if ( ! is_numeric( $date ) ) {\n $timestamp = strtotime( $date );\n }\n else {\n $timestamp = $date;\n }\n $year = date( 'Y', $timestamp );\n $month = date( 'n', $timestamp );\n }\n\n /**\n * Suppose, $start_month is July and today is May 2017. Then we should get\n * start = 2016-07-01 00:00:00 and end = 2017-06-30 23:59:59.\n *\n * On the other hand, if $start_month = January, then we should get\n * start = 2017-01-01 00:00:00 and end = 2017-12-31 23:59:59.\n */\n if ( $month < $start_month ) {\n $year = $year - 1;\n }\n\n $months = erp_months_dropdown();\n $start = date( 'Y-m-d 00:00:00', strtotime( \"first day of $months[$start_month] $year\" ) );\n $end = date( 'Y-m-d 23:59:59', strtotime( \"$start + 12 months - 1 day\" ) );\n\n return [\n 'start' => $start,\n 'end' => $end\n ];\n}", "function getDateMonth()\n{\n $dateMonth = strtotime(\"-1 month\");\n return $dateMonth;\n}", "private function setNextMonth (DateTime $date)\n\t{\n\t\t$tempDate = clone $date;\n\t\t$this->nextMonth = $tempDate->add(DateInterval::createFromDateString('1 month'));\n\t\tunset($tempDate);\n\t}", "public function get_month($month) {\n\t\t$start_time = 'first day of ' . date( 'M Y', $month );\n\t\t$end_time = 'last day of ' . date( 'M Y', $month );\n\n\t\treturn array(\n\t\t\t'start'\t\t\t=>\tdate('Y-m-d', strtotime($start_time)),\n\t\t\t'end'\t\t\t=>\tdate('Y-m-d', strtotime($end_time)),\n\t\t\t'start_time'\t\t=>\tstrtotime( $start_time ),\n\t\t\t'end_time'\t\t=>\tstrtotime( $end_time )\n\t\t);\n\t}", "function getMonthlyHiredDays( $startDate, $endDate ) {\n \n $startDate = DateTime::createFromFormat('Y-m-d H:i:s', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d H:i:s', $endDate);\n \n if ( !$startDate || !$endDate ) {\n \n echo 'Invalid arguments';\n return;\n }\n \n if ( $startDate > $endDate) {\n \n echo 'The start date is greater than the end date';\n return;\n }\n \n $hiredDays = array(); \n if ( $startDate->format('n') == $endDate->format('n') && $startDate->format('Y') == $endDate->format('Y') ) {\n \n // Get ddays between days and push to the array\n array_push( $hiredDays,\n array(\n 'year' => $startDate->format('Y'),\n 'month' => $startDate->format('n'),\n 'days' => $startDate->diff($endDate, true)->days\n )\n );\n \n }else {\n \n // Loop until the last date and get the days of every month \n while( true ) { \n \n if( !isset($startPoint) ) {\n \n $startPoint = $startDate; \n $m = $startDate->format('n');\n }else {\n \n $startPoint = $endPoint->add(new DateInterval('P1D'));\n $startPoint = $startPoint->setTime(0,0,0);\n $m = $startPoint->format('n');\n }\n \n if ( $m == 11 //30 days\n || $m == 4\n || $m == 6\n || $m == 9 ) {\n \n $monthDays = 30;\n }elseif ( $m == 2 ) { // 28 days\n \n $monthDays = $startPoint->format('L') == 1 ? 29 : 28;\n \n }else { // 31 days \n \n $monthDays = 31;\n }\n \n $endPoint = DateTime::createFromFormat('Y-m-d H:i:s', $startPoint->format('Y').'-'.$m.'-'.$monthDays.' 23:59:59');\n \n if ( $endPoint > $endDate ) {\n \n $endPoint = $endDate;\n } \n \n array_push( $hiredDays,\n array(\n 'year' => $startPoint->format('Y'),\n 'month' => $startPoint->format('n'),\n 'days' => $startPoint->diff($endPoint, true)->days + 1\n )\n );\n\n if ( $endPoint == $endDate ) {\n break;\n }\n \n $m = $m == 12 ? 1 : $m + 1;\n }\n } \n return $hiredDays;\n }", "public function monthly()\n {\n return $this->cron('0 0 1 * * *');\n }", "function createNextMonthArray() { \n\t\t$date = date(\"Ymd\");\n\t\t$result = array($date);\n\n\n\t\tfor ($i=0; $i < 5; $i++) { \n\t\t\t$timestamp = strtotime($date);\n\t\t\t$date =date(\"Ymd\", strtotime('+1 day', $timestamp));\n\t\t\tarray_push($result,$date);\n\t\t}\n\t\treturn $result;\n\t}", "private function startMonthSpacers()\n\t{\n\t\tif($this->firstDayOfTheMonth != '0') {\n\t\t\t$this->calWeekDays .= \"\\t\\t<td colspan=\\\"\".$this->firstDayOfTheMonth.\"\\\" class=\\\"spacerDays\\\">&nbsp;</td>\\n\";\n\t\t\t$this->outArray['firstday'] = $this->firstDayOfTheMonth;\n\t\t}\n\t}", "function getFirstDay($year, $month, $day_of_week) {\n $num = date(\"w\",mktime(0,0,0,$month,1,$year));\n if($num==$day_of_week) {\n return date(\"j\",mktime(0,0,0,$month,1,$year));\n }\n elseif($num>$day_of_week) {\n return date(\"j\",mktime(0,0,0,$month,1,$year)+(86400*((7+$day_of_week)-$num)));\n }\n else {\n return date(\"j\",mktime(0,0,0,$month,1,$year)+(86400*($day_of_week-$num)));\n }\n}", "public function takePostBaseOnMonth();", "public function firstDayOfMonth($month, $year) {\n\n $day = (int) date(\"w\", strtotime(\\DateTime::createFromFormat('m/d/Y', $month . '/' . '1/' . $year)->format('M') . ' 01,' . $year . ' 00:00:00'));\n return $day;\n }", "public static function nextMonth(?Time $now = null): Time\n\t{\n\t\t$now = $now ? $now->unix : time();\n\n\t\t$nextMonth = date('n', $now) + 1;\n\t\t$thisYear = (int) date('Y', $now);\n\t\t// Actual date vs. next month's number of days\n\t\t$day = min((int) date('j', $now), (int) date('t', mktime(0, 0, 0, $nextMonth, 1, $thisYear)));\n\n\t\t// Create the date\n\t\t$date = mktime((int) date('H', $now), (int) date('i', $now), (int) date('s', $now), $nextMonth, $day, $thisYear);\n\n\t\treturn new Time($date);\n\t}", "public function testGetStartDateSep31() {\n $now = new \\DateTimeImmutable('2020-02-15');\n $line_item = $this->lineItemStub([], [\n 'interval_unit' => 'yearly',\n 'day_of_month' => '31',\n 'month' => '9',\n ]);\n $date = Utils::getStartDate($line_item, $now);\n $this->assertEqual('2020-09-30', $date->format('Y-m-d'));\n }", "public function snapToMonth(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->month()->startDate(),\n DatePoint::fromDate($this->endDate)->month()->endDate(),\n $this->bounds\n );\n }", "protected static function months_between(DateTime $date1, DateTime $date2){\r\n \r\n\r\n $months_between = array();\r\n $m1 = $date1->format('n');\r\n $m2 = $date2->format('n');\r\n $y1 = $date1->format('Y');\r\n $y2 = $date2->format('Y');\r\n// echo \"<h5>1: $m1 $y1 2: $m2 $y2</h5>\";\r\n \r\n $total_months_between = $m2-$m1 + ($y2-$y1)*12 ;\r\n// echo \"<h5>ukupno izmedju $total_months_between</h5>\";\r\n \r\n $date1->modify('first day of this month');\r\n $date2->modify('first day of this month');\r\n $date1->modify('+1 month');\r\n\r\nfor ($i=1; $i<=$total_months_between; $i++){\r\n $month = $date1->format('F');\r\n $month = strtolower($month);\r\n $year = $date1->format('Y');\r\n \r\n $months_between[$year][] = $month;\r\n $date1->modify('+1 month');\r\n }\r\n\r\n \r\n// var_dump($months_between);\r\n return $months_between;\r\n\r\n }", "function getMonthRange( $start, $end ){\n\n\t$current = $start;\n\t$ret = array();\n\n\t// date iteration method via: https://gist.github.com/daithi-coombes/9779776\n\twhile( $current<$end ){\n\t\t$next = date('Y-M-01', $current) . \"+1 month\";\n\t\t$current = strtotime($next);\n\t\t$ret[] = $current;\n\t}\n\t$ret = array_reverse($ret);\n\n\t// convert timestamp into expected date format array\n\tforeach ($ret as $key => $value) {\n\t\t$ret[$key] = date('F Y', $value);\n\t}\n\treturn $ret;\n}", "function getNextMonthTimestamp()\n{\n return Carbon::now()->addMonth()->toDateTimeString();\n}", "public function setDayOfMonth($date, $day_of_month)\n {\n $carbon_date = Carbon::parse($date);\n \n $set_date = $carbon_date->copy()->setUnitNoOverflow('day', $day_of_month, 'month');\n\n //If the set date is less than the original date we need to add a month.\n //If we are overflowing dates, then we need to diff the dates and ensure it doesn't equal 0\n if ($set_date->lte($date) || $set_date->diffInDays($carbon_date) == 0) {\n $set_date->addMonthNoOverflow();\n }\n\n if ($day_of_month == '31') {\n $set_date->endOfMonth();\n }\n\n\n return $set_date;\n }", "public function determineMidMonthMeetingDate($date)\r\n {\r\n // Construct a new DateTime object\r\n try {\r\n $date = new DateTime($date);\r\n // Check if the supplied date falls on a weekend\r\n if (self::isWeekend($date->format('Y-m-d'))) {\r\n // If it is Sunday, Get the monday of the same week as the week begins on Sunday by default in PHP's date functions, else, get the Monday of next week\r\n $monday = clone $date->modify(('Sunday' == $date->format('l')) ? 'Monday this week' : 'Monday next week');\r\n // Return the monday after the weekend\r\n return $monday;\r\n } else {\r\n // Return the original date as it does not fall on a weekend\r\n return $date;\r\n }\r\n } catch (Exception $e) {\r\n echo 'Exception: ', $e->getMessage(), \"\\n\";\r\n }\r\n \r\n }", "function initMonth()\n {\n //! Si aucun mois ou année n'est recupéré on prend le mois et l'année actuel\n if (!$this->currentMonthName || !$this->year) {\n $this->currentMonthIndex = (int)date(\"m\", time()) - 1;\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n $this->year = (int)date(\"Y\", time());\n }\n // recalcule le premier jour pour ce mois et le nombre de jour total du mois\n $this->firstDayInMonth = strftime('%u', strtotime(strval($this->currentMonthIndex + 1) . '/01/' . strval($this->year)));\n $this->nbDaysMonth = cal_days_in_month(CAL_GREGORIAN, $this->currentMonthIndex + 1, $this->year);\n $this->currentMonthName = $this->months[$this->currentMonthIndex];\n }", "public function findOneByMonth(\\DateTime $date);", "function getMonth($requestField)\n{\n\t// Get the requested month, if any. If none was requested, return the current month.\n\tif (isset($_REQUEST[$requestField]))\n\t{\n\t\t$iStartMonth = (int)$_REQUEST[$requestField];\n\t\tif ($iStartMonth > 0 && $iStartMonth < 13) // Reasonable bounds checks\n\t\t{\n\t\t\t$startMonth = $iStartMonth;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$startMonth = date('n'); // The current month\n\t\t}\n\t}\n\telse\n\t{\n\t\t$startMonth = date('n'); // The current month\n\t}\n\treturn $startMonth;\n}", "function date_month($date){\r\n\t$month = NULL;\r\n\t$cont = 0;\r\n\tfor($i = 0; $i < strlen($date); $i++){\r\n\t\tif(is_numeric(substr($date, $i, 1))){\r\n\t\t\tif($cont == 1){\r\n\t\t\t\t$month .= substr($date, $i, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($cont > 0){\r\n\t\t\t\treturn $month;\r\n\t\t\t}else{\r\n\t\t\t\t$cont++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $month;\r\n}", "function display_month($month, $year) {\n\techo '<br/>';\n\techo \"month = $month, year = $year<br/>\"; \n\t//demo mktime, get unix timestamp for a date\n\t// mktime syntax: mktime($hour, $minute, $second, $month, $day, $year)\n\t$first_day_of_month = mktime(0, 0, 0, $month, 1, $year);\n\n\techo '<br/>';\n\n\techo \" \\n \\r The day's Unix time stamp is: \" . $first_day_of_month . \". &nbsp &nbsp This way of showing time is not user friendly!\";\n\techo '<br/>';\n\t// To display the timestamp in a user readable form \n\n\techo \" The first day of the \" . $month . \"&nbsp month of the year &nbsp\" . $year . \" is: &nbsp\" . date('Y-M-d', $first_day_of_month) . \"!\";\n\techo '<br/>';\n\techo \" The day is: \" . date('Y-M-d H:i:sa', $first_day_of_month) . \"!\";\n\n}", "public function testYearOnlyDateWithParamJanuary1()\n {\n $this->assertContains(\n '1066-01-01', neatlinetime_convert_date('1066', 'january_1')\n );\n $this->assertFalse(\n neatlinetime_convert_date('1066', 'skip')\n );\n }", "protected function getThisMonthInterval(): array\n\t{\n\t\treturn [\n\t\t\tnew \\DateTime(date('Y-m-01', strtotime(date('Y-m-d')))),\n\t\t\tnew \\DateTime(date('Y-m-t', strtotime(date('Y-m-d'))))\n\t\t];\n\t}", "function first_quarter_month($t) {\n $mon = $t['tm_mon'];\n if ($mon <= 3) \n {\n return 1;\n }\n elseif ($mon <= 6) \n {\n return 4;\n }\n elseif ($mon <= 9) \n {\n return 7;\n }\n elseif ($mon <= 12) \n {\n return 10;\n }\n // ?\n return 99;\n}", "public static function getMonthDates()\n {\n $current_year = date('Y-01-01 00:00:00');\n $month_names = self::getMonthNames();\n $months = array();\n for ($i=0; $i<12; $i++) {\n $months[$i] = array( 'name'=>$month_names[$i],'date'=>date('Y-m-d 00:00:00',strtotime(\"$current_year + $i months\")));\n }\n\n return $months;\n }", "public function diffMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month-$month<1){\n\t\t\t$year = floor(($month-$this->_month)/12) + 1;\n\t\t\t$this->_month = $this->_month + ($year * 12) - $month;\n\t\t\t$this->_year-= $year;\n\t\t} else {\n\t\t\t$this->_month-=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}", "public static function createFromMonth($year, $month)\n {\n return static::createFromYearInterval(1, $year, $month);\n }", "public static function createFromMonth($year, $month)\n {\n return static::createFromYearInterval(1, $year, $month);\n }", "function get_year_dates($year = null, $start_month = 12, $end_month = 11)\n{\n if (!isset($year)) {\n $year = date('Y');\n }\n $start_date = $year - 1 . '-' . $start_month . '-01';\n $end_date = $year . '-' . $end_month . '-30';\n return [\n 'start_date' => $start_date,\n 'end_date' => $end_date\n ];\n}", "public function getIncMonth($date=null,$inc){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime(\"+\".$inc.\" month\", strtotime($date)));\n\t\treturn $dateNew;\n\t}", "public function getNextMonth()\n {\n return $this->calendarMonth->getNextMonth();\n }", "public function setStartMonth($value)\n {\n return $this->setParameter('startMonth', (int) $value);\n }", "public function assertFirstDayOfMonth($selector)\n {\n date_default_timezone_set('UTC');\n\n $actualValue = $this->retrieveElementUsingJquery($selector);\n assertEquals($actualValue, date('Y-m-01'));\n }", "function ShowDayOfMonth($get_month){\n\t$arr_d1 = explode(\"-\",$get_month);\n\t$xdd = \"01\";\n\t$xmm = \"$arr_d1[1]\";\n\t$xyy = \"$arr_d1[0]\";\n\t$get_date = \"$xyy-$xmm-$xdd\"; // วันเริ่มต้น\n\t//echo $get_date.\"<br>\";\n\t$xFTime1 = getdate(date(mktime(0, 0, 0, intval($xmm+1), intval($xdd-1), intval($xyy))));\n\t$numcount = $xFTime1['mday']; // ฝันที่สุดท้ายของเดือน\n\tif($numcount > 0){\n\t\t$j=1;\n\t\t\tfor($i = 0 ; $i < $numcount ; $i++){\n\t\t\t\t$xbasedate = strtotime(\"$get_date\");\n\t\t\t\t $xdate = strtotime(\"$i day\",$xbasedate);\n\t\t\t\t $xsdate = date(\"Y-m-d\",$xdate);// วันถัดไป\t\t\n\t\t\t\t $arr_d2 = explode(\"-\",$xsdate);\n\t\t\t\t $xFTime = getdate(date(mktime(0, 0, 0, intval($arr_d2[1]), intval($arr_d2[2]), intval($arr_d2[0]))));\t\n\t\t\t\t if($xFTime['wday'] == 0){\n\t\t\t\t\t $j++;\n\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\tif($xFTime['wday'] != \"0\"){\n\t\t\t\t\t\t$arr_date[$j][$xFTime['wday']] = $xsdate;\t\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}//end if($numcount > 0){\n\treturn $arr_date;\t\n}", "public function testGetDayOfMonth()\n {\n $test_data = array(\n array(1985, 1, 31),\n array(1985, 2, 28),\n array(2000, 2, 29),\n array(2012, 2, 29),\n array(1985, 3, 31),\n array(1985, 4, 30),\n array(1985, 5, 31),\n array(1985, 6, 30),\n array(1985, 7, 31),\n array(1985, 8, 31),\n array(1985, 9, 30),\n array(1985, 10, 31), \n array(1985, 11, 30),\n array(1985, 12, 31),\n );\n foreach ($test_data as $data) {\n $result = DateUtility::getDayOfMonth($data[0], $data[1]);\n $this->assertEquals($data[2], $result);\n }\n }", "public function monthPadDates()\n {\n return date('w', strtotime(date('Y-m-01', strtotime($this->strStart))));\n }", "public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}", "function getDateofMonthEnd($date){\n return date(\"Y-m-t\", strtotime($date));\n }", "function GetAllMonthsTillDate($date,$year)\n\t{\n\t\t$date1=$date;\n\t\t$yr1=$year;\n\t\t$yr2='2014';\n\t\t$date2=date('Y-m-d');\n\t\t$time1 = strtotime($date1);\n\t\t$time2 = strtotime($date2);\n\t\t$my = date('mY', $time2);\n\n\t\t$months = array(date($yr1.'-m-d', $time1));\n\n\t\twhile($time1 < $time2) {\n\t\t\t$time1 = strtotime(date('Y-m-d', $time1).' +1 month');\n\t\t\tif(date('mY', $time1) != $my && ($time1 < $time2)){\n\t\t\t\tif(count($months)>=12)\n\t\t\t\t{$yr1=$yr2;}\n\t\t\t\t\n\t\t\t\t$months[] = date($yr1.'-m-d', $time1);\n\n\t\t\t}\n\t\t}\n\n\t\treturn $months;\n\t\t\t\n\t}", "public function getMonth($date=null){\n\t\treturn date_format($this->createDate($date),\"m\");\n\t}", "public function getNextTriggerTimeForMonthlyByDate($scheduledDayOfMonth, $scheduledTime) {\n\t\t$currentDayOfMonth = date('j', time());\n\t\tif ($scheduledDayOfMonth) {\n\t\t\t$scheduledDaysOfMonth = json_decode($scheduledDayOfMonth, true);\n\t\t\tif (is_array($scheduledDaysOfMonth)) {\n\t\t\t\t// algorithm :\n\t\t\t\t//1. First sort all the days in ascending order and find the closest day which is greater than currentDayOfMonth\n\t\t\t\t//2. If found, set the next trigger date to the found value which is in the same month.\n\t\t\t\t//3. If not found, set the trigger date to the next month's first selected value.\n\t\t\t\t$nextTriggerDay = null;\n\t\t\t\tsort($scheduledDaysOfMonth);\n\t\t\t\tforeach ($scheduledDaysOfMonth as $day) {\n\t\t\t\t\tif ($day == $currentDayOfMonth) {\n\t\t\t\t\t\t$currentTime = time();\n\t\t\t\t\t\t$schTime = strtotime(date('Y-m-').$day.' '.$scheduledTime);\n\t\t\t\t\t\tif ($schTime > $currentTime) {\n\t\t\t\t\t\t\t$nextTriggerDay = $day;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif ($day > $currentDayOfMonth) {\n\t\t\t\t\t\t$nextTriggerDay = $day;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!empty($nextTriggerDay)) {\n\t\t\t\t\t$firstDayofNextMonth = date('Y:m:d H:i:s', strtotime('first day of this month'));\n\t\t\t\t\t$nextTime = date('Y:m:d', strtotime($firstDayofNextMonth.' + '.($nextTriggerDay-1).' days'));\n\t\t\t\t\t$nextTime = $nextTime.' '.$scheduledTime;\n\t\t\t\t} else {\n\t\t\t\t\t$firstDayofNextMonth = date('Y:m:d H:i:s', strtotime('first day of next month'));\n\t\t\t\t\t$nextTime = date('Y:m:d', strtotime($firstDayofNextMonth.' + '.($scheduledDaysOfMonth[0]-1).' days'));\n\t\t\t\t\t$nextTime = $nextTime.' '.$scheduledTime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $nextTime;\n\t}", "function nextRdate2($curD, $rI, $rP, $rM, $i) { //$i=0: 1st occurrence; $i=1: next occurrence\n\tif ($rM) {\n\t\t$curM = $rM; //one specific month\n\t\t$curY = substr($curD,0,4)+$i+((substr($curD,5,2) <= $rM) ? 0 : 1);\n\t} else { //each month\n\t\t$curM = substr($curD,5,2)+$i;\n\t\t$curY = substr($curD,0,4);\n\t}\n\t$day1Ts = mktime(12,0,0,$curM,1,$curY);\n\t$dowDif = $rP - date('N',$day1Ts); //day of week difference\n\t$offset = $dowDif + 7 * $rI;\n\tif ($dowDif >= 0) { $offset -= 7; }\n\tif ($offset >= date('t',$day1Ts)) { $offset -= 7; } //'t' : number of days in the month\n\t$nxtD = date('Y-m-d', $day1Ts + (86400 * $offset));\n\treturn $nxtD;\n}", "function add_months(&$t, $m)\n{\n $t['tm_mon'] += $m;\n if ($t['tm_mon'] > 12) \n {\n $t['tm_mon'] -= 12;\n $t['tm_year'] ++;\n }\n elseif ($t['tm_mon'] < 1) \n {\n $t['tm_mon'] += 12;\n $t['tm_year'] --;\n }\n return;\n}", "public function getNextMonth($current)\n {\n return strtotime(\"+1 month\", $current);\n }", "private function getMonth($callDate) \n\t{\n\t\tglobal $user;\n\n\t\t$this->makeTimestamp($callDate);\n\t\t// last or first day of some months need to be treated in a special way\n\t\tif (!empty($this->mini_cal_month))\n\t\t{\n\t\t\t$today_timestamp = time() + $user->timezone + $user->dst;\n\t\t\t$cur_month = date(\"n\", $today_timestamp);\n\t\t\t$correct_month = $cur_month + $this->mini_cal_month;\n\n\t\t\t// move back or forth the correct number of years\n\t\t\twhile ($correct_month < 1 || $correct_month > self::MONTHS_PER_YEAR)\n\t\t\t{\n\t\t\t\tif ($correct_month < 1)\n\t\t\t\t{\n\t\t\t\t\t$correct_month = $correct_month + self::MONTHS_PER_YEAR;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$correct_month = $correct_month - self::MONTHS_PER_YEAR;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// fix incorrect months\n\t\t\twhile (date(\"n\", $this->stamp) != $correct_month)\n\t\t\t{\n\t\t\t\tif (date(\"n\", $this->stamp) > $correct_month)\n\t\t\t\t{\n\t\t\t\t\t$this->stamp = $this->stamp - self::TIME_DAY; // go back one day\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->stamp = $this->stamp + self::TIME_DAY; // move forward one day\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->dateYYYY = date(\"Y\", $this->stamp);\n\t\t$this->dateMM = date(\"n\", $this->stamp);\n\t\t$this->ext_dateMM = date(\"F\", $this->stamp);\n\t\t$this->dateDD = date(\"d\", $this->stamp);\n\t\t$this->daysMonth = date(\"t\", $this->stamp);\n\n\t\tfor ($i = 1; $i < $this->daysMonth + 1; $i++)\n\t\t{\n\t\t\t$this->makeTimestamp(\"$i {$this->ext_dateMM} {$this->dateYYYY}\");\n\t\t\t$this->day[] = array(\n\t\t\t\t'0' => \"$i\",\n\t\t\t\t'1' => $this->dateMM,\n\t\t\t\t'2' => $this->dateYYYY,\n\t\t\t\t'3' => date('w', $this->stamp)\n\t\t\t\t);\n\t\t}\n\t}", "function getMonthFromDate ($theDate)\n\t{\n\t\tif (gettype($theDate) == 'string')\n\t\t{\n\t\t\t$theDate = strtotime ($theDate);\n\t\t}\n\t\t$dateArray = getdate ($theDate);\n\t\treturn $dateArray ['mon'];\n\t}" ]
[ "0.65510756", "0.64819825", "0.64037824", "0.63896966", "0.6341828", "0.629297", "0.6232996", "0.6113486", "0.61058354", "0.6081079", "0.5987621", "0.5950634", "0.59351784", "0.5933844", "0.593269", "0.58682024", "0.5866758", "0.5862977", "0.5812257", "0.58082753", "0.5796713", "0.5769198", "0.5723455", "0.5708202", "0.5611856", "0.55802596", "0.557241", "0.55356354", "0.5518343", "0.54950774", "0.5490927", "0.5489028", "0.5471342", "0.5450811", "0.54261345", "0.54137874", "0.5380715", "0.5369677", "0.53527343", "0.53193283", "0.53179187", "0.5302406", "0.524366", "0.52417696", "0.52303654", "0.5225495", "0.5214674", "0.5195744", "0.51905274", "0.518935", "0.5156756", "0.5156414", "0.51563483", "0.5154944", "0.5115718", "0.5106057", "0.5104614", "0.5103397", "0.51022196", "0.5096074", "0.5080528", "0.5066186", "0.50593317", "0.50213933", "0.50172424", "0.5005053", "0.49997097", "0.49712566", "0.49677396", "0.49518344", "0.49487165", "0.49446929", "0.49284038", "0.4909204", "0.4877949", "0.48690265", "0.4868973", "0.48573408", "0.48550135", "0.48454633", "0.48235753", "0.48235753", "0.481832", "0.48072898", "0.4806451", "0.48029578", "0.4798711", "0.47599804", "0.47526804", "0.47435224", "0.47424594", "0.47357106", "0.47355536", "0.47230583", "0.47178298", "0.4711406", "0.47087666", "0.4688864", "0.4688732", "0.4683326" ]
0.5217193
46
Given a datetime, returns two datetimes, one with first day of the given year, and the other with the first day of next year
protected function getYearRange($date = null) { $date = !is_object($date) ? new \DateTime('TODAY') : $date; $startAt = \DateTime::createFromFormat('Y-m-d H:i:s', date("Y-m-d H:i:s", mktime(0, 0, 0, 1, 1, $date->format('Y')))); $endAt = clone $startAt; $endAt->modify('+1 year'); return array($startAt, $endAt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFirstDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 1, 1, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "function nextYear($interval=1){ return $this->_getDate(0,0,$interval); }", "public static function createFromYear($year)\n {\n $startDate = new DateTimeImmutable(static::validateYear($year).'-01-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P1Y')));\n }", "public static function createFromYear($year)\n {\n $startDate = new DateTimeImmutable(static::validateYear($year).'-01-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P1Y')));\n }", "public function setYear($year)\n {\n $ts = $this->timestamp;\n $result = mktime(\n date('H', $ts),\n date('i', $ts),\n date('s', $ts),\n date('n', $ts),\n date('j', $ts),\n $year\n );\n return new Date($result, $this->timezone);\n }", "public function getDateStartYear($date=null){\n\t\t$dateNew = date(\"Y-01-01 H:i:s\",strtotime($date));\n\t\treturn $dateNew;\n\t}", "function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}", "public function getTwoYearDates()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n\n return Holiday::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->orderBy('date', 'asc')\n ->paginate(25);\n }", "public function testYearOnlyDateWithParamFullYear()\n {\n $this->assertFalse(neatlinetime_convert_date('1066', 'full_year'));\n $result = neatlinetime_convert_single_date('1066', 'full_year');\n $this->assertContains('1066-01-01', $result[0]);\n $this->assertContains('1066-12-31', $result[1]);\n }", "public function get_year($year) {\n\t\t$start_time = 'first day of January ' . date( 'Y', strtotime($year) );\n\t\t$end_time = 'last day of December ' . date( 'Y', strtotime($year) );\n\t\n\t\treturn array(\n\t\t\t'start'\t\t\t=>\tdate('Y-m-d', strtotime($start_time)),\n\t\t\t'end'\t\t\t=>\tdate('Y-m-d', strtotime($end_time)),\n\t\t\t'start_time'\t\t=>\tstrtotime( $start_time ),\n\t\t\t'end_time'\t\t=>\tstrtotime( $end_time )\n\t\t);\n\t}", "function get_yr_nxt($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]+1)));\n }", "function get_financial_year_from_date( $date ) {\n $fy_start_month = erp_get_option( 'gen_financial_month', 'erp_settings_general', 1 );\n $fy_start_month = absint( $fy_start_month );\n\n $date_timestamp = !is_numeric( $date ) ? strtotime( $date ) : $date;\n $date_year = absint( date( 'Y', $date_timestamp ) );\n $date_month = absint( date( 'n', $date_timestamp ) );\n\n if ( 1 === $fy_start_month ) {\n return [\n 'start' => $date_year,\n 'end' => $date_year\n ];\n\n } else if ( $date_month <= ( $fy_start_month - 1 ) ) {\n return [\n 'start' => ( $date_year - 1 ),\n 'end' => $date_year\n ];\n\n } else {\n return [\n 'start' => $date_year,\n 'end' => ( $date_year + 1 )\n ];\n }\n}", "function erp_get_financial_year_dates( $date = null ) {\n $start_month = erp_get_option( 'gen_financial_month', 'erp_settings_general', 1 );\n if ( $date == null ) {\n $year = date( 'Y' );\n $month = date( 'n' );\n } else {\n if ( ! is_numeric( $date ) ) {\n $timestamp = strtotime( $date );\n }\n else {\n $timestamp = $date;\n }\n $year = date( 'Y', $timestamp );\n $month = date( 'n', $timestamp );\n }\n\n /**\n * Suppose, $start_month is July and today is May 2017. Then we should get\n * start = 2016-07-01 00:00:00 and end = 2017-06-30 23:59:59.\n *\n * On the other hand, if $start_month = January, then we should get\n * start = 2017-01-01 00:00:00 and end = 2017-12-31 23:59:59.\n */\n if ( $month < $start_month ) {\n $year = $year - 1;\n }\n\n $months = erp_months_dropdown();\n $start = date( 'Y-m-d 00:00:00', strtotime( \"first day of $months[$start_month] $year\" ) );\n $end = date( 'Y-m-d 23:59:59', strtotime( \"$start + 12 months - 1 day\" ) );\n\n return [\n 'start' => $start,\n 'end' => $end\n ];\n}", "public function getAcademicYearStartEndDates( $currentYear=NULL, $asDateTimeObject=false, $yearOffset=NULL ) {\n\n $userServiceUtil = $this->container->get('user_service_utility');\n\n //1) get start/end dates from resapp site settings\n $startEndDates = $userServiceUtil->getAcademicYearStartEndDates($currentYear,$asDateTimeObject,$yearOffset,'resapp','resappAcademicYearStart','resappAcademicYearEnd');\n\n $startDate = $startEndDates['startDate'];\n $endDate = $startEndDates['endDate'];\n\n //echo \"startDate=\".$startDate.\"<br>\";\n //echo \"endDate=\".$endDate.\"<br>\";\n\n if( $startDate == NULL || $endDate == NULL ) {\n //2) get start/end dates from default site settings\n $startEndDates = $userServiceUtil->getAcademicYearStartEndDates($currentYear,$asDateTimeObject,$yearOffset);\n\n if( $startDate == NULL ) {\n $startDate = $startEndDates['startDate'];\n }\n\n if( $endDate == NULL ) {\n $endDate = $startEndDates['endDate'];\n }\n\n if( $startDate == NULL || $endDate == NULL ) {\n $currentYear = intval(date(\"Y\"));\n\n //3) If still missing, set to the default value to July 1st\n if( $startDate == NULL ) {\n //$startDate = new \\DateTime($currentYear.\"-07-01\");\n if( $asDateTimeObject ) {\n $startDate = new \\DateTime($currentYear.\"-07-01\");\n } else {\n $startDate = $currentYear.\"-07-01\";\n }\n }\n\n //3) If still missing, set to the default value to June 30\n if( $endDate == NULL ) {\n //$endDate = new \\DateTime($currentYear.\"-06-30\");\n if( $asDateTimeObject ) {\n $endDate = new \\DateTime($currentYear . \"-06-30\");\n } else {\n $endDate = $currentYear . \"-06-30\";\n }\n }\n }\n }\n\n return array(\n 'startDate'=> $startDate,\n 'endDate'=> $endDate,\n );\n }", "public function getAllSaintsDay($year)\n {\n $date = new \\DateTime($year.'-10-31');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "public function start($year) {\n static $days= ['MO' => 1, 'TU' => 2, 'WE' => 3, 'TH' => 4, 'FR' => 5, 'SA' => 6, 'SU' => 0];\n\n $start= sscanf($this->dtstart, '%4d%2d%2dT%2d%2d%d');\n if (null === $this->rrule) {\n return gmmktime($start[3], $start[4], $start[5], $start[1], $start[2], $year);\n } else {\n\n // RRULE: https://tools.ietf.org/html/rfc5545#section-3.3.10\n $r= [];\n foreach (explode(';', $this->rrule) as $attributes) {\n sscanf($attributes, \"%[^=]=%[^\\r]\", $key, $value);\n $r[$key]= $value;\n }\n\n if ('YEARLY' !== $r['FREQ']) {\n throw new IllegalStateException('Unexpected frequency '.$r['FREQ']);\n }\n\n // -1SU = \"Last Sunday in month\"\n // 1SU = \"First Sunday in month\"\n // 2SU = \"Second Sunday in month\"\n if ('-' === $r['BYDAY'][0]) {\n $month= (int)$r['BYMONTH'] + 1;\n $by= $days[substr($r['BYDAY'], 2)];\n $last= idate('w', gmmktime(0, 0, 0, $month, -1, $year));\n $day= $by - $last - 1;\n } else {\n $month= (int)$r['BYMONTH'];\n $by= $days[substr($r['BYDAY'], 1)];\n $first= idate('w', gmmktime(0, 0, 0, $month, 0, $year));\n $day= $by + $first + 1 + 7 * ($r['BYDAY'][0] - 1);\n }\n\n return gmmktime($start[3], $start[4], $start[5], $month, $day, $year);\n }\n }", "public function snapToYear(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->year()->startDate(),\n DatePoint::fromDate($this->endDate)->year()->endDate(),\n $this->bounds\n );\n }", "public function calculate( int $year ): \\DateTime\n {\n\n if ( self::HEMISPHERE_NORTH === $this->_hemisphere && $year > 1499 && $year < 2150 )\n {\n switch ( $this->_type )\n {\n case self::TYPE_SPRING:\n return new DateTime( $year . '-03-' . self::SPRING_DAYS[ $year ] . ' 00:00:00 UTC' );\n case self::TYPE_SUMMER:\n return new DateTime( $year . '-06-' . self::SUMMER_DAYS[ $year ] . ' 00:00:00 UTC' );\n case self::TYPE_AUTUMN:\n return new DateTime( $year . '-09-' . self::AUTUMN_DAYS[ $year ] . ' 00:00:00 UTC' );\n #case self::TYPE_WINTER:\n default:\n return new DateTime( $year . '-12-' . self::WINTER_DAYS[ $year ] . ' 00:00:00 UTC' );\n }\n }\n\n $foundIdx = -1;\n $idx = 0;\n\n // Search the index of the reference date that covers the defined year\n foreach ( self::REFERENCES[ $this->_type ][ $this->_hemisphere ] as $reference )\n {\n if ( 0 > $foundIdx && $reference[ 'min-year' ] <= $year && $reference[ 'max-year' ] >= $year )\n {\n $foundIdx = $idx;\n break;\n }\n $idx++;\n }\n\n if ( $foundIdx < 0 )\n {\n // There is no calculation available for defined year => use the static default date\n return new DateTime( $year . self::DEFAULTS[ $this->_type ][ $this->_hemisphere ] );\n }\n\n // The reference date was found => Init it as DateTime instance\n $refDate = new DateTime( self::REFERENCES[ $this->_type ][ $this->_hemisphere ][ $foundIdx ][ 'date' ] );\n\n // Calculate the difference in year (can be also negative!)\n $diffYears = $year - $refDate->year;\n\n if ( 0 !== $diffYears )\n {\n $refDate->addSeconds( $diffYears * self::DIFFS[ $this->_type ][ $this->_hemisphere ] );\n }\n\n return $refDate;\n\n }", "public function testYearlyByYearDayImmutable()\n {\n $start = '2011-07-10 03:07:00';\n $rule = 'FREQ=YEARLY;COUNT=7;INTERVAL=2;BYYEARDAY=190';\n $tz = 'UTC';\n\n $dt = new DateTimeImmutable($start, new DateTimeZone($tz));\n $parser = new RRuleIterator($rule, $dt);\n\n $parser->next();\n\n $item = $parser->current();\n $this->assertEquals($item->format('Y-m-d H:i:s'), '2013-07-09 03:07:00');\n }", "function years($lowfirst=NO)\n\t{\n\t\tglobal $db;\n\n\t\t$this->error = new error('Year');\n\n\t\t$this->years = array();\n\n\t\t$curyear = date('Y');\n\t\t$hascuryear = NO;\n\t\t$unknown = array();\n\n\t\t$sql = \"SELECT * FROM years WHERE yer_year<=\".(date('Y')+1).\" ORDER BY yer_year \".($lowfirst==YES?'ASC':'DESC');\n\t\t//#echo $sql;\n\t\t$result = mysql_query($sql,$db);\n\t\t//#print_r ($result);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif ($row['yer_year'] != 'Unknown')\n\t\t\t{\n\t\t\t\t$this->years[] = $row;\n\n\t\t\t\t$year = $row['yer_year'];\n\t\t\t\tif ($year == $curyear) { $hascuryear = YES; }\n\t\t\t}\n\t\t\telse { $unknown = array($row); }\n\t\t}\n\t\t$this->years = array_merge($this->years,$unknown);\n\n\t\tif ($hascuryear == NO)\n\t\t{\n\t\t\t// insert the current year\n\t\t\t$sql = \"INSERT INTO year VALUES (NULL,$curyear)\";\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\t$curarr = array('yer_yearID'=>mysql_insert_id(),'yer_year'=>$curyear);\n\t\t\tif ($lowfirst == YES) { $this->years[] = $curarr; }\n\t\t\telse { $this->years = array_merge(array($curarr),$this->years); }\n\t\t}\n\t}", "function get_corresponding_fiscal_year($date) {\n $year = $date->format('Y');\n if ($date <= DateTime::createFromFormat('Y-m-d', $year . '-6-30')) {\n return $year;\n } else {\n return $year + 1;\n }\n}", "function first_post_year($format = \"Y\") {\n $args = array(\n\t 'numberposts' => -1,\n\t 'post_status' => 'publish',\n\t 'order' => 'ASC'\n );\n $get_all = get_posts($args);\n $first_post = $get_all[0];\n $first_post_year = $first_post->post_date;\n $year = date($format, strtotime($first_post_year));\n\n return $year;\n}", "public function testYearOnlyDate() {\n $this->assertEquals('2012-01-01T00:00:00+00:00',\n neatlinetime_convert_date('2012')\n );\n }", "function get_year($cur_date,$type){\n $date_split=split(\"-\",$cur_date);\n if ($type=='1'){\n // Return 2003 Format\n return date(\"Y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n elseif ($type=='2'){\n // Return 03 format\n return date(\"y\",mktime (0,0,0,$date_split[1],$date_split[0],$date_split[2]));}\n }", "function x_current_year($a) {\n return date('Y');\n}", "public function calculate( int $year ): \\DateTime\n {\n\n $refDate = new DateTime( $year . '-12-24 00:00:00' );\n $multiplier = 4 - $this->_adventDay;\n\n $refDate->modify( '-' . ( $refDate->getDayNumberOfWeek() + ( $multiplier * 7 ) ) . ' days' );\n\n if ( 0 !== $this->_modifyDays )\n {\n $refDate->modify( ( $this->_modifyDays > 0 ? '+' : '-' ) . abs( $this->_modifyDays ) . ' days' );\n }\n\n return $refDate;\n\n }", "function get_date_previous_year($dateval) {\n\t\t$arr_date = explode(\"-\",$dateval);\n\t\t$retval = $arr_date[0]-1 . \"-\". $arr_date[1] . \"-\". $arr_date[2];\n\t\treturn $retval;\n\t\t}", "public function addYear($year = 1)\r\n {\r\n $date = date(self::MASK_TIMESTAMP_USER, mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year + $year));\r\n $this->setValue($date);\r\n return $this;\r\n }", "function date_year($date){\r\n\t$year = NULL;\r\n\t$cont = 0;\r\n\tfor($i = 0; $i < strlen($date); $i++){\r\n\t\tif(is_numeric(substr($date, $i, 1))){\r\n\t\t\tif($cont == 2){\r\n\t\t\t\t$year .= substr($date, $i, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif($cont > 1){\r\n\t\t\t\treturn $year;\r\n\t\t\t}else{\r\n\t\t\t\t$cont++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $year;\r\n}", "function get_year_dates($year = null, $start_month = 12, $end_month = 11)\n{\n if (!isset($year)) {\n $year = date('Y');\n }\n $start_date = $year - 1 . '-' . $start_month . '-01';\n $end_date = $year . '-' . $end_month . '-30';\n return [\n 'start_date' => $start_date,\n 'end_date' => $end_date\n ];\n}", "public function setFirstYearRange($value)\n {\n return $this->set('FirstYearRange', $value);\n }", "public function setFirstYearRange($value)\n {\n return $this->set('FirstYearRange', $value);\n }", "public function setFirstYearRange($value)\n {\n return $this->set('FirstYearRange', $value);\n }", "public function getResAppAcademicYearStartEndDates( $currentYear=null, $formatStr=\"Y-m-d\", $asDateTimeObject=false ) {\n //$userServiceUtil = $this->container->get('user_service_utility');\n\n //$startEndDates = $userServiceUtil->getAcademicYearStartEndDates($currentYear,true); //return dates as Date object\n $startEndDates = $this->getAcademicYearStartEndDates($currentYear,true); //return dates as Date object\n\n $startDateObject = $startEndDates['startDate'];\n $endDateObject = $startEndDates['endDate'];\n\n if( $asDateTimeObject ) {\n $resArr['Season Start Date'] = $startDateObject;\n $resArr['Season End Date'] = $endDateObject;\n\n //duplicate with legacy key from getAcademicYearStartEndDates 'startDate'\n $resArr['startDate'] = $startDateObject;\n $resArr['endDate'] = $endDateObject;\n } else {\n $startDate = $startDateObject->format($formatStr);\n $endDate = $endDateObject->format($formatStr);\n //echo \"startDate=\".$startDate.\"<br>\";\n //echo \"endDate=\".$endDate.\"<br>\";\n //exit('111');\n\n $resArr['Season Start Date'] = $startDate;\n $resArr['Season End Date'] = $endDate;\n\n //duplicate with legacy key from getAcademicYearStartEndDates 'startDate'\n $resArr['startDate'] = $startDate;\n $resArr['endDate'] = $endDate;\n }\n\n $startDateObject->add(new \\DateInterval('P1Y')); //P1Y = +1 year\n $endDateObject->add(new \\DateInterval('P1Y'));\n\n if( $asDateTimeObject ) {\n $resArr['Residency Start Date'] = $startDateObject; //Application Season Start Year + 1 year\n $resArr['Residency End Date'] = $endDateObject;\n } else {\n $residencyStartDate = $startDateObject->format($formatStr);\n $residencyEndDate = $endDateObject->format($formatStr);\n\n $resArr['Residency Start Date'] = $residencyStartDate; //Application Season Start Year + 1 year\n $resArr['Residency End Date'] = $residencyEndDate;\n }\n\n return $resArr;\n }", "private function get_start_date_for_this_ac_year() {\n\t\t\t$ac_year = $this->resolve_year();\n\t\t\t$query = sprintf(\"SELECT TO_CHAR(START_DATE, 'dd/mm/yyyy') AS START_DATE_FORMATTED FROM FES.SESSIONS WHERE SESSION_LONG_DESC = '%s'\", $ac_year);\n\t\t\t\t\t\n\t\t\t//print_r($query);\n\t\t\t\t\t\n\t\t\tif ($data = $this->execute_query($query)) {\n\t\t\t\tforeach ($data as $datum) {\n\t\t\t\t\t$start = $datum->START_DATE_FORMATTED;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$d = explode('/', $start);\n\t\t\t$day = (substr($d[0], 0, 1) == 0) ? sprintf('%1d', $d[0]) : $d[0];\n\t\t\t$month = (substr($d[1], 0, 1) == 0) ? sprintf('%1d', $d[1]) : $d[1];\n\t\t\t$year = $d[2];\n\t\t\t$start_date = mktime(0,0,0,$month,$day,$year, 0);\n\t\t\treturn $start_date;\n\t\t}", "protected function getThisYearInterval(): array\n\t{\n\t\treturn [\n\t\t\tnew \\DateTime(date('Y-01-01', strtotime(date('Y-m-d')))),\n\t\t\tnew \\DateTime(date('Y-12-t', strtotime(date('Y-m-d'))))\n\t\t];\n\t}", "function centuryFromYear($year)\n{\n return $year%100==0?(int)floor($year/100):(int)floor($year/100)+1;\n}", "public function getYear() {}", "function get_next_date($this_date){\n\t$year = \"\";\n\t$month = \"\";\n\t$day = \"\";\n\tif( preg_match(\"/(\\d+)\\-(\\d+)-(\\d+)/\", $this_date, $match) ){\n\t\t$year = $match[1];\n\t\t$month = $match[2];\n\t\t$day = $match[3];\n\t};\n\t$next_date = date(\"Y-m-d\",mktime(0,0,0, $month, $day+1, $year));\n\n\treturn $next_date;\n\n}", "public function getMinYearBuilt();", "public static function getLastDayOfCurrentYear()\n\t{\n\t\t$dateInSeconds = mktime(0, 0, 0, 12, 31, date('Y'));\n\t\t$date = date('Y-m-d', $dateInSeconds);\n\t\treturn $date;\n\t}", "function happyNewYear () {\n $day = (int) date('z');\n $year = date('Y');\n $yearCheck = ((int)$year ? $year % 4 == 0 ? $year % 400 == 0 && $year % 100 == 0 ? 366 : 365 : 365 : \"ERROR\");\n $daytill = $yearCheck-$day;\n echo \"До Нового Года осталось: $daytill дней\";\n}", "function firstDay($monthname, $year) {\r\n if (empty($month)) {\r\n $month = date('m');\r\n }\r\n if (empty($year)) {\r\n $year = date('Y');\r\n }\r\n $result = strtotime(\"{$year}-{$month}-01\");\r\n return date('Y-m-d', $result);\r\n }", "function getYearFromDate ($theDate)\n\t{\n\t\tif (gettype($theDate) == 'string')\n\t\t{\n\t\t\t$theDate = strtotime ($theDate);\n\t\t}\n\t\t$dateArray = getdate ($theDate);\n\t\treturn $dateArray ['year'];\n\t}", "function tep_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n }", "public function findOneByYear(\\DateTime $date);", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public static function getByDate(DateTime $date)\n {\n $month = $date->format('n');\n $year = $date->format('Y');\n\n if ($month <= 6) {\n $startYear = $year - 1;\n } else {\n $startYear = $year;\n }\n\n $startDateTime = DateTime::createFromFormat('Y-m-d H:i:s', $startYear . '-07-01 00:00:00');\n $endDateTime = DateTime::createFromFormat('Y-m-d H:i:s', ($startYear + 1) . '-06-30 23:59:59');\n\n return new FinancialYear($startDateTime, $endDateTime);\n }", "function tep_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n}", "function bbconnect_kpi_calculate_fiscal_year_for_date($inputDate, $fyStart = '07-01', $fyEnd = '06-30') {\n if ($inputDate instanceof DateTime) {\n $date = $inputDate->getTimestamp();\n } elseif (is_int($inputDate)) {\n $date = $inputDate;\n } else {\n $date = strtotime($inputDate);\n }\n $inputyear = date('Y', $date);\n\n $fystartdate = strtotime($inputyear.'-'.$fyStart);\n $fyenddate = strtotime($inputyear.'-'.$fyEnd);\n\n if ($date <= $fyenddate) {\n $fy = intval($inputyear);\n } else {\n $fy = intval(intval($inputyear) + 1);\n }\n\n return $fy;\n}", "public static function getCurrentYear() {\n return date('Y');\n }", "public function getFullYear()\r\n\t{\r\n\t\treturn $this->format('Y');\r\n\t}", "public static function from_year($year = null)\n {\n // create\n $class = __CLASS__;\n $object = new $class;\n\n // set vars\n if (!$year) $year = Date::forge()->format('%Y');\n $year = (int) $year;\n\n // set givens\n $object->year = 2007;\n $object->congress = 110;\n $object->session = 1;\n\n // loop thru years to target...\n while($object->year !== $year)\n {\n if($object->year < $year)\n {\n $object->year++;\n $object->session++;\n }\n elseif($object->year > $year)\n {\n $object->year--;\n $object->session--;\n }\n\n if($object->session === 3)\n {\n $object->congress++;\n $object->session = 1;\n }\n elseif($object->session === 0)\n {\n $object->congress--;\n $object->session = 2;\n }\n }\n\n // cleaup\n $object->year = $year;\n $object->calc_cycle();\n\n // return\n return $object;\n }", "public function snapToIsoYear(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->isoYear()->startDate(),\n DatePoint::fromDate($this->endDate)->isoYear()->endDate(),\n $this->bounds\n );\n }", "public function dateYearDay($prolepticYear, $dayOfYear)\n {\n return ThaiBuddhistDate::ofIsoDate(LocalDate::ofYearDay($prolepticYear - self::YEARS_DIFFERENCE, $dayOfYear));\n }", "function get_date($day, $year) {\n\t\t\t\t\n\t\t\t\t$number_date = date('D d F, Y', mktime(0, 0, 0, 0+1, $day, $year));\n\t\t\t\t\n\t\t\t\treturn $number_date;\n\t\t\t\n\t\t\t}", "function get_yr_prev($cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,$date_split[1],$date_split[0],($date_split[2]-1)));\n }", "public function setStartYear($value)\n {\n return $this->setYearParameter('startYear', $value);\n }", "private function getSelectedYear() {\n\t\t$selectedYear = $this->request->query('selectedYear');\n\t\tif (is_null($selectedYear)) $selectedYear = $thisYear;\n\t\t$nextYear = $selectedYear+1;\n\t\treturn array($selectedYear, $nextYear);\n\t}", "function GetYearHoliday($the_year = NULL, $cond_1, $cond_2) {\n\t\t$_where = empty($the_year) ? \"\" : \"and my_year = $the_year\";\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year,\n\t\t\t\t\t in_date,\n\t\t\t\t\t year_holidays,\n\t\t\t\t\t /*year_adjust_days,--HCP version v.1.0.5.4.1 no this filed*/\n\t\t\t\t\t nvl(already_rest_days,0) as already_rest_days,\n\t\t\t\t\t defered_year_days,\n\t\t\t\t\t defered_adjust_days,\n\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t nvl(already_rest_ddays,0) as already_rest_ddays,\n\t\t\t\t\t active_date,\n\t\t\t\t\t expired_date\n\t\t\t\t\tfrom (select A.*,rownum rn\n\t\t\t\t\t\t from (select my_year,\n\t\t\t\t\t\t\t\t\t\t in_date,\n\t\t\t\t\t\t\t\t\t year_holidays,\n\t\t\t\t\t\t\t\t\t already_rest_days,\n\t\t\t\t\t\t\t\t\t defered_year_days,\n\t\t\t\t\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t\t\t\t\t already_rest_ddays,\n\t\t\t\t\t\t\t\t\t active_date,\n\t\t\t\t\t\t\t\t\t expired_date\n\t\t\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t and emp_seq_no = '$emp_seqno'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t order by year_holidays desc) A\n\t\t\t\t\t\t\t\t where rownum <=$cond_2)\n\t\t\t\t\t\t\twhere rn >=$cond_1\n\t\t\t\t\t\t\torder by year_holidays desc\n_YearHolidayList_;\n\t\t// print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\n\t}", "protected function year(){\n return $this->now->format('Y');\n }", "public static function getCurrentSchoolYear() {\n\t\t$year = date('Y');\n\t\t$month = date('m');\n\t\tif ($month >= 9) {\n\t\t\t$year++;\n\t\t}\n\t\treturn $year;\n\t}", "function get_date_frm_loc_in_yr($location_in_year,$cur_date){\n $date_split=split(\"-\",$cur_date);\n return date(\"d-m-Y\",mktime (0,0,0,1,$location_in_year,$date_split[2]));\n }", "public static function from_years_range($start_year, $end_year)\r\n {\r\n $newstart = new DateTime($start_year . '-01-01', new DateTimeZone('GMT'));\r\n $newend = new DateTime($end_year . '-12-31', new DateTimeZone('GMT'));\r\n return new PiplApi_DateRange($newstart, $newend);\r\n }", "public function isLeapYear();", "function get_year()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"year\"];\n }", "function getCurrentYear ()\n\t{\n\t\treturn date ('Y');\n\t}", "private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }", "public function modelYear();", "public function reverseTransform($year)\n {\n // no issue number? It's optional, so that's ok\n if (!$year) {\n return;\n }\n\n //$year = $forms['startYear']->getData();\n $newYear = new \\DateTime(\"$year-01-01\");\n\n if (null === $newYear) {\n // causes a validation error\n // this message is not shown to the user\n // see the invalid_message option\n throw new TransformationFailedException(sprintf(\n 'próba użycia roku \"%s\"!',\n $year\n ));\n }\n\n return $newYear;\n }", "function aa_is_leap_year($year)\n{\n if (aa_is_gregorian_date($year, 1, 1) === true) {\n $is_leap_year = aa_is_gregorian_leap_year($year);\n } else {\n $is_leap_year = aa_is_julian_leap_year($year);\n }\n\n return $is_leap_year;\n}", "public function getCurrentYear()\n {\n if (! $this->hasGeoLocator()) {\n return (new \\DateTime)->format('Y');\n }\n $timezone = $this->geoLocator->getTimezone($this->getClientIp());\n\n return (new \\DateTime(null, new \\DateTimeZone($timezone)))->format('Y');\n }", "function dayOfProgrammer($year) {\n if($year <1918 && $year%400!=0 && $year%100==0 ) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"254 days\"));\n return date_format($date,\"d.m.Y\"); \n } else if($year == 1918) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"268 days\"));\n return date_format($date,\"d.m.Y\");\n } else {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"255 days\"));\n return date_format($date,\"d.m.Y\");\n }\n}", "function doy2mmdd($year, $doy) \n{\n $quit = false;\n $inx = 1;\n \n while ((!$quit) && ($inx < 12)) {\n if (daysInMonth($year, $inx) < $doy) {\n $doy -= daysInMonth($year, $inx);\n $inx++;\n } else {\n $quit = true;\n }\n }\n $month = $inx;\n $day = $doy;\n \n return array(\"month\" => $month, \"day\" => $day);\n \n}", "public function generate_year()\n {\n $current_year = date('Y');\n $year = [];\n for ($i = $current_year; $i <= $current_year + 5; $i++) {\n array_push($year, $i);\n }\n return $year;\n }", "public function getCurrentYear() {\n return date('Y');\n }", "public function yearly()\n {\n return $this->cron('0 0 1 1 * *');\n }", "public function GetThisYear()\n\t\t{\n\t\t\t$year = date('Y');\n\t\t\treturn $year;\n\t\t}", "public static function firstDayOfYear(?DateTimeInterface $date = null): static\n\t{\n\t\t$date = self::checkDate($date);\n\t\treturn static::from(sprintf('%04d-01-01', $date->format('Y')));\n\t}", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "function autoUpdatingCopyright($startYear){\n $startYear = intval($startYear);\n \n // current year (e.g. 2007)\n $year = intval(date('Y'));\n \n // is the current year greater than the\n // given start year?\n if ($year > $startYear)\n return $startYear .'-'. $year;\n else\n return $startYear;\n}", "public function setValidFromYear($var)\n {\n GPBUtil::checkInt32($var);\n $this->valid_from_year = $var;\n\n return $this;\n }", "function currentYear() {\n\t\tif (func_num_args()) {\n\t\t\tif (func_get_arg(0) >= 1901 && func_get_arg(0) <= 2037) { //See note section above\n\t\t\t\t$this->_currentYear = func_get_arg(0);\n\t\t\t\t$this->_monthTimestamp = $this->_dayTimestamp = mktime(0,0,0,$this->_currentMonth,1,$this->_currentYear);\n\t\t\t\t$this->_currentMonthNumDays = intval(date('t',$this->_monthTimestamp));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"You can only set the currentYear property of the Calendar class to a value between 1901 and 2037\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\telse return $this->_currentYear;\n\t}", "private function get_year_for_tables() {\n if (empty($this->courseid)) {\n return \\local_ousearch\\year_tables::get_year_for_tables(null);\n } else {\n return \\local_ousearch\\year_tables::get_year_for_tables(get_course($this->courseid));\n }\n }", "public function getYear($date=null){\n\t\treturn date_format($this->createDate($date),\"Y\");\n\t}", "function dateDiffYears($time1, $time2){\n \n $yrs = 0;\n $time1 = date_create($time1);\n $time2 = date_create($time2);\n $diffArray = date_diff($time1, $time2); \n $yrs = $diffArray->format('%R%y'); \n return $yrs * 1;\n}", "protected static function createFromYearInterval($duration, $year, $index)\n {\n $month = sprintf('%02s', ((static::validateRange($index, 1, 12 / $duration) - 1) * $duration) + 1);\n $startDate = new DateTimeImmutable(static::validateYear($year).'-'.$month.'-01');\n\n return new static($startDate, $startDate->add(new DateInterval('P'.$duration.'M')));\n }", "function tep_date_short($raw_date) {\n if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;\n\n $year = substr($raw_date, 0, 4);\n $month = (int)substr($raw_date, 5, 2);\n $day = (int)substr($raw_date, 8, 2);\n $hour = (int)substr($raw_date, 11, 2);\n $minute = (int)substr($raw_date, 14, 2);\n $second = (int)substr($raw_date, 17, 2);\n\n if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {\n return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));\n } else {\n $base_year = tep_is_leap_year($year) ? 2036 : 2037;\n return ereg_replace((string)$base_year, $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $base_year)));\n }\n\n}", "public function GetYear() {\n return $this->format('Y');\n }", "public function getMidSummerDay($year)\n {\n $date = new \\DateTime($year.'-06-20');\n for ($i = 0; $i < 7; $i++) {\n if ($date->format('w') == 6) {\n break;\n }\n $date->add(new \\DateInterval('P1D'));\n }\n\n return $date;\n }", "public function getYear()\r\n\t{\r\n\t\treturn $this->format('y');\r\n\t}", "function previousYear($interval=1){ return $this->_getDate(0,0,-$interval); }", "public function getYear()\n\t{\n\t\treturn $this->year \n\t\t\t?? $this->year = date('Y');\n\t}", "public function convert_quater_year($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$c_d = date('Y', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "function copyright($startYear){\n $currentYear = date('Y');\n if ($startYear < $currentYear) {\n $currentYear = date('y');\n return \"&copy; $startYear&ndash;$currentYear\";\n } else {\n return \"&copy; $startYear;\";\n }\n}", "public static function createYearWeeks($year) {\n\n\t\t$firstDayOfYear = mktime(0, 0, 0, 1, 1, $year);\n\t\t$nextMonday = strtotime('monday', $firstDayOfYear);\n\t\t$nextSunday = strtotime('sunday', $nextMonday);\n\t\t$i = 1;\n\n\t\twhile (date('Y', $nextMonday) == $year) {\n\t\t\t$thematicWeek = new ThematicWeek();\n\t\t\t$thematicWeek->setWeekNumber($i);\n\t\t\t$thematicWeek->setYear($year);\n\t\t\t$thematicWeek->setMonday($nextMonday);\n\t\t\t$thematicWeek->setSunday($nextSunday);\n\t\t\ttry {\n\t\t\t\t$thematicWeek->save();\n\t\t\t}\n\t\t\tcatch (PropelException $exp) {\n\t\t\t\tif (ConfigModule::get(\"global\",\"showPropelExceptions\"))\n\t\t\t\t\tprint_r($exp->getMessage());\n\t\t\t}\n\t\t\t$nextMonday = strtotime('+1 week', $nextMonday);\n\t\t\t$nextSunday = strtotime('+1 week', $nextSunday);\n\t\t\t$i++;\n\t\t}\n\t}", "public function setYearStarted($yearStarted)\n {\n $this->yearStarted = $yearStarted;\n return $this;\n }", "public function setStartMonthYear($val)\n {\n $this->_propDict[\"startMonthYear\"] = $val;\n return $this;\n }", "function jr_week_start_date($week, $year, $format = \"d-m-Y\") {\r\n\r\n\t$first_day_year = date(\"N\", mktime(0,0,0,1,1,$year));\r\n\tif ($first_day_year < 5)\r\n\t\t$shift =-($first_day_year-1)*86400;\r\n\telse\r\n\t\t$shift=(8-$first_day_year)*86400;\r\n\tif ($week > 1) $week_seconds = ($week-1)*604800; else $week_seconds = 0;\r\n\t$timestamp = mktime(0,0,0,1,1,$year) + $week_seconds + $shift;\r\n\r\n\treturn date($format, $timestamp);\r\n}", "public function getStartingDay() : \\DateTime{\n return new \\DateTime(\"{$this->year}-{$this->month}-01\");\n}" ]
[ "0.6728055", "0.66671145", "0.6460425", "0.6460425", "0.62270594", "0.6204767", "0.618731", "0.61327356", "0.60020375", "0.5997086", "0.59464645", "0.5903922", "0.5865142", "0.5826837", "0.5823007", "0.57446814", "0.5740973", "0.57207304", "0.56946987", "0.56843156", "0.567143", "0.5640852", "0.56385124", "0.5629348", "0.5596311", "0.5570173", "0.5557434", "0.5534635", "0.5520544", "0.54997694", "0.54719734", "0.54719734", "0.54719734", "0.5465442", "0.5437379", "0.54366726", "0.54312164", "0.54231167", "0.534158", "0.53366005", "0.53343296", "0.53029925", "0.52953506", "0.52950966", "0.52943265", "0.529252", "0.52887875", "0.52790743", "0.5278436", "0.5252961", "0.52491766", "0.5244227", "0.5240333", "0.523715", "0.5233931", "0.5230743", "0.5213892", "0.5209603", "0.5175295", "0.51712143", "0.51692337", "0.5168296", "0.51657623", "0.51549804", "0.5154408", "0.5147315", "0.51363105", "0.5134282", "0.51244277", "0.51198876", "0.5117845", "0.51106834", "0.51078683", "0.51015115", "0.5097493", "0.50971055", "0.50810444", "0.50732034", "0.5072805", "0.5070934", "0.5070934", "0.5064156", "0.50632685", "0.50631815", "0.5062426", "0.505588", "0.50499654", "0.50479573", "0.5045528", "0.5038578", "0.5036192", "0.50346506", "0.5031788", "0.5028144", "0.5001962", "0.49935994", "0.49906978", "0.49799734", "0.4978106", "0.4977273" ]
0.56817096
20
Action of getting list of main categories
public function run(): ActiveDataProvider { /** @var $category MainCategorySectionEntity.php */ $category = new $this->modelClass; return $category->search(Yii::$app->request->queryParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showMainCategories()\n {\n $category = new Category;\n \n return new ViewResponse(\"frontend::categories::main.php\", [\n 'categories' => $category->getCollection( $category->byName($category->allParent()) ) \n ]);\n }", "public function getAllMainCategories(){\n\t\t$query = $this->db->query('\n\t\t\tselect c.id, c.name\n\t\t\tfrom food_category c\n\t\t\twhere\n\t\t\t\tmain = 1\n\t\t\torder by\n\t\t\t\tname asc');\n\t\treturn $query->result();\n\t}", "public function getCategories();", "public function getCategories();", "public function main_category_list()\n\t{\n\t \t$main_categories = MainCategories::select('*')->orderBy('id', 'desc')->get();\n\t \treturn view('admin.main_categories.main_categorylist', compact('main_categories'));\n\t}", "public function getAllCategories();", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function frontpage_categories_list() {\n global $CFG;\n $content = html_writer::start_tag('div', array('class' => 'container'));\n $content .= html_writer::tag('h2', get_string('categories'));\n\n global $CFG;\n $chelper = new coursecat_helper();\n $chelper->set_subcat_depth($CFG->maxcategorydepth)->set_show_courses(\n self::COURSECAT_SHOW_COURSES_COUNT)->set_categories_display_options(\n array(\n 'limit' => $CFG->coursesperpage,\n 'viewmoreurl' => new moodle_url('/course/index.php',\n array('browse' => 'categories', 'page' => 1))\n ))->set_attributes(array('class' => 'frontpage-category-names'));\n $categories = $this->get_categories();\n\n $attributes = $chelper->get_and_erase_attributes('course_category_tree clearfix');\n $content .= html_writer::start_tag('div', $attributes);\n $content .= html_writer::start_tag('div', array('class' => 'content'));\n $content .= html_writer::start_tag('div', array('class' => 'subcategories'));\n foreach ($categories as $key => $value) {\n $content .= $this->enlightlite_coursecat_category($chelper, core_course_category::get($key), 1);\n }\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n $content .= html_writer::end_tag('div');\n return $content;\n }", "public static function getActiveCategories(){}", "function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}", "public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}", "public function getCategoriesForListView(): Collection;", "public function findCategories();", "public function get_list_categories() {\n\t\t\t$categories = TableRegistry::get('Administrator.Categories');\n\t\t\t$all = $categories->find('treeList', ['conditions' => ['type' => 'Category', 'status' => $this->active], 'spacer' => '— '])->toArray();\n\t\t\treturn $all;\n\t}", "public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function index()\n {\n $categories = $this->category_model->get();\n\n return $categories;\n }", "public function getCategoryList()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$categoryId = $app->input->get('id', 'root', 'STRING');\n\n\t\t$model = JCategories::getInstance('Content', ['countItems' => 1]);\n\t\t$mainCategory = $model->get($categoryId);\n\n\t\t/*$model = new ContentModelCategories();*/\n\t\t/*$categories = $model->getItems();*/\n\n/*\t\t$categoryId = $app->input->get('id', 'root', 'STRING');\n\t\t$model = JCategories::getInstance('Content');\n\t\t$category = $model->get($categoryId, true);\n\t\t$categories = $category->getChildren();*/\n\n\t\t$params = json_decode($mainCategory->params);\n\n\t\t$result = [\n\t\t\t'id' => $mainCategory->id,\n\t\t\t'parent_id' => $mainCategory->parent_id,\n\t\t\t'count' => $mainCategory->numitems,\n\t\t\t'title' => $mainCategory->title,\n\t\t\t'alias' => $mainCategory->alias,\n\t\t\t'description' => $mainCategory->description,\n\t\t\t'image' => ['url' => $params->image, 'alt' => $params->image_alt],\n\t\t\t'children' => [],\n\t\t];\n\t\t$categories = $mainCategory->getChildren();\n\n\t\tforeach ($categories as $node) {\n\t\t\t$params = json_decode($node->params);\n\t\t\t$result['children'][] = [\n\t\t\t\t'id' => $node->id,\n\t\t\t\t'parent_id' => $node->parent_id,\n\t\t\t\t'count' => $node->numitems,\n\t\t\t\t'title' => $node->title,\n\t\t\t\t'alias' => $node->alias,\n\t\t\t\t'image' => ['url' => $params->image, 'alt' => $params->image_alt],\n\t\t\t];\n\t\t}\n\n\t\treturn $result;\n\t\t\n\t}", "function get_categories()\n\t\t{\n\t\t\t$categories = $this->manage_content->getValue('vertical_navbar','menu_name');\n\t\t\treturn $categories;\n\t\t}", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function executeListCategories()\n {\n $this->adminLayout();\n\n $this->page->addVar('title', 'Liste des catégories');\n\n $listCategories = $this->manager->getManagerOf('Category')->getAllCategories();\n\n $this->page->addVar('categories', $listCategories);\n }", "public function indexAction()\n {\n $categories = $this->getCategoryRepository()->findAll();\n\n return [\n 'categories' => $categories,\n ];\n }", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function indexContentCategories()\n {\n return $this->contentCategoryRepo->all();\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function categoryList()\n {\n return view(\"Category::list\");\n }", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function index()\n {\n return CategoryResource::collection(\n Category::parents()->ordered()->with('children')->get()\n );\n }", "public function get_categories() {\n\t\treturn [ 'basic' ];\n\t}", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function listOfCategory()\n {\n //$sub_category = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.categoryList');\n }", "public function categories() {\n\n $this->load->model('Model_Bird_Wiki');\n $result['categories'] = $this->Model_Bird_Wiki->get_categories();\n\n if($result!=false) {\n $this->load->view('category_main', $result);\n }\n else {\n echo \"Something went wrong !\";\n }\n\n }", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "function getHomeCategoriesList()\n {\n $strReturn = '<ul class=\"blogCategoriesList\">';\n $arrCategories = $this->createCategoryArray();\n foreach($arrCategories as $intCategoryId => $arrCategoryValues) {\n if($arrCategoryValues[$this->_intLanguageId]['is_active']) {\n $strReturn .= '<li class=\"blogCategoriesListItem\"><a href=\"index.php?section=Blog&amp;cmd=search&amp;category='.$intCategoryId.'\">'.$arrCategoryValues[$this->_intLanguageId]['name'].'&nbsp;('.$this->countEntriesOfCategory($intCategoryId).')</a></li>';\n }\n }\n $strReturn .= '</ul>';\n return $strReturn;\n }", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }", "function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "public function categoryList()\n {\n $category = categories::orderBy('id', 'desc')->get();\n return view('backend.admin-panel.pages.viewCategories', compact('category'));\n }", "public function index()\n {\n return CategoryResource::collection(Category::latest()->get());\n }", "function getCategories(){\n\treturn dbSelect('categories');\n}", "function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}", "public function getAllCategoryNames();", "public function index()\n {\n $categories = Postcategory::all();\n\n return $categories;\n }", "public function getAllWithCategory();", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "public function getCategories() : array;", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function index()\n {\n return Category::all();\n }", "public function index()\n {\n return Category::all();\n }", "public function index()\n {\n return Category::all();\n }", "public function get_categories()\n {\n return ['basic'];\n }", "public function getCategoryList(){\n\t\t$recordLimit = Input::get('limit');\n\t\t$recordLimit = (!empty($recordLimit) && in_array($recordLimit, parent::$pagination_limits)) ? \n\t\t\t$recordLimit : parent::recordLimit;\n\t\t\t\n\t\t$colors = $this->shift->getCategoryColors();\n\t\t$categories = $this->shift->getCategories(null, $recordLimit == 'all' ? null : $recordLimit);\n\t\t\n\t\treturn View::make('admin.shifts.list_category')\n\t\t\t->withColors($colors)\n\t\t\t->withCategories($categories)\n\t\t\t//->withRecordlimit(parent::recordLimit);\n\t\t\t->withRecordlimit($recordLimit);\n\t}", "public function index()\n {\n return CategoryResource::collection(Category::all());\n }", "public function index()\n {\n $categories = Category::all();\n return $categories;\n \n }", "public function index(){\n return CategoryResource::collection(Category::all());\n }", "public function showCategories(){\n return ArticleModel::showCategories();\n }", "public function index()\n {\n $categories = Category::all();\n return view('adminlte::categories.main',compact('categories'));\n }", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "public function categoriesPageAction()\n {\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n // Retrive all exsisting categories\n $categories = $em->getRepository('VideotechBundle:Category')\n ->findAll();\n\n\n // Render display\n return $this->render('@Videotech/Category/list.twig', array(\n \"categories\" => $categories\n ));\n }", "public function index()\n {\n $categories = Category::paginate(10);\n return (new CategoryCollection($categories))->additional([\n \"message\" => \"categories fetch successfully.\"\n ]);\n }", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function allCategories()\n {\n return Category::all();\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public function list() {\n $list = CategoryModel::orderby('id')->get();\n return view('cms.categories', compact('list'));\n }", "public function index()\n {\n return new CategoryCollection(Category::all());\n }", "public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }", "public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }", "public function indexAction()\r\n {\r\n \t$this->_redirect($this->_currentModuleUrl);\r\n//\t\t$c_path = $this->_request->getParam('c_path',0);\r\n//\t\t\r\n// \t$s_field = $this->_request->getParam('s_field');\r\n// \t$s_type = $this->_request->getParam('s_type');\r\n// \t\r\n// \t$rsCats = $this->_objCats->fetchAllData('parent_id = ' . $c_path,$s_field,$s_type);\r\n\r\n// \t$this->view->strPaging = $this->createPaginator($rsCats);\r\n// \t$this->view->rsCats = $rsCats;\r\n \t\r\n \t// Headers column\r\n// \t$this->view->nameTX = $this->view->SortColumn($this->view->getTranslation('Name'),'name',$s_type,$this->_currentActionUrl,$s_field);\r\n// \t$this->view->valueTX = $this->view->SortColumn($this->view->getTranslation('Value'),'value',$s_type,$this->_currentActionUrl,$s_field);\r\n// \t$this->view->activeTX = $this->view->SortColumn('Active','active',$s_type,$this->_currentActionUrl,$s_field);\r\n\t\t\r\n\t\t\r\n// \t$arr = $this->_objCats->getDataCategories();\r\n// \t\r\n// \t$this->loadHelper();\r\n// \t\r\n// \techo \"<pre>\";\r\n// \tprint_r($this->view->showSelectCats('name'));\r\n// \techo \"</pre>\";\r\n// \texit();\r\n \t\r\n }", "public function get_categories()\n {\n return ['hsblog'];\n }", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\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}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "function product_category_list(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\t$product_category_list = mysql_q(\"SELECT *\n\t\t\tFROM product_category\n\t\t\tORDER BY id\");\n\t\t$tpl->assign(\"product_category_list\", $product_category_list);\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_list.tpl\");\n\t\tdisplay($main);\n\t}", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "public function listAction()\n {\n $module = $this->params('module');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Set info\n $categories = [];\n $where = ['status' => 1];\n $order = ['display_order DESC', 'title ASC', 'id DESC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n\n // Make list\n foreach ($rowSet as $row) {\n $categories[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n\n // Set category tree\n $categoryTree = [];\n if (!empty($categories)) {\n $categoryTree = Pi::api('category', 'video')->makeTreeOrder($categories);\n }\n\n // Set header and title\n $title = __('Category list');\n\n // Set seo_keywords\n $filter = new Filter\\HeadKeywords;\n $filter->setOptions(\n [\n 'force_replace_space' => true,\n ]\n );\n $seoKeywords = $filter($title);\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'categoryList');\n }\n\n // Set view\n $this->view()->headTitle($title);\n $this->view()->headDescription($title, 'set');\n $this->view()->headKeywords($seoKeywords, 'set');\n $this->view()->setTemplate('category-list');\n $this->view()->assign('categories', $categories);\n $this->view()->assign('categoryTree', $categoryTree);\n $this->view()->assign('config', $config);\n }", "public function getCategoryList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$category = D('Category');\n\t\t\t$sql = \"SELECT * FROM lib_category;\";\n\t\t\t$return = $category->query($sql);\n\t\t\t$result = array();\n\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\tarray_push($result, $return[$k]['category']);\n\t\t\t}\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return),\n\t\t\t\t\t'cat' => json_encode($result)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function get_categories() {\n return array( 'apr-core' );\n }", "public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}", "public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}", "public function get_categories()\n\t{\n\t\treturn array('general');\n\t}", "public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }", "public function main_categories(){\n $categories = Category::whereNull('parent_id')->get();\n return response()->json($categories);\n }", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "public function indexAction() {\r\n\t\t$page = intval($this->getInput('page'));\r\n\t\t\r\n\t\t$perpage = $this->perpage;\r\n\t\t\r\n\t\tlist($total, $result) = Game_Service_Category::getList($page, $perpage);\r\n\t\t\r\n\t\t$this->assign('result', $result);\r\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'?'));\r\n\t}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function get_categories() {\n return [ 'yx-super-cat' ];\n }", "public function index()\n {\n return IngramCategory::all();\n }", "private function actionGetCategories() {\n\t\tglobal $publishthis;\n\n\t\t$categories = array();\n\t\t$obj = new stdClass();\n\n\t\t//get taxonomies categories\n\t\t$all_taxonomies = get_taxonomies( array( 'public' => true ), $output = 'objects', $operator = 'and' );\n\t\t$taxonomies_keys = array_keys( $all_taxonomies );\n\t\t$all_terms = get_terms( $taxonomies_keys, array( 'orderby' => 'id', 'hide_empty' => 0, 'exclude' => array(1) ) );\n\n\t\t$tax_maps = $publishthis->get_option( 'tax_mapping' );\n\t\t$tax_maps = array_values($tax_maps);\n\n\t\tforeach ( $all_terms as $term ) {\n\t\t\tif ( !in_array( $term->taxonomy, array( 'post_format', 'post_tag' ) ) ) {\n\t\t\tif ( !in_array( $term->taxonomy, $tax_maps ) && !in_array( 'pt_tax_all', $tax_maps ) ) continue;\n\n\t\t\t$category = array(\n\t\t\t\t'id' => intval( $term->term_id ),\n\t\t\t\t'name' => $term->name,\n\t\t\t\t'taxonomyId' => intval( $term->term_taxonomy_id ),\n\t\t\t\t'taxonomyName' => $term->taxonomy,\n\t\t\t\t'subcategories' => array() );\n\t\t\tif( intval( $term->parent ) > 0 ) {\n\t\t\t\t\t$categories[ $term->parent ]['subcategories'][ $term->term_id ] = $category;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\t$categories[ $term->term_id ] = $category;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$obj->success = true;\n\t\t$obj->errorMessage = null;\n\t\t$obj->categories = $this->array_values_recursive( $categories );\n\n\t\t$this->sendJSON( $obj );\n\t}", "private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }", "public function get_categories() {\n return array ( 'general' );\n }" ]
[ "0.7731627", "0.76224846", "0.756345", "0.756345", "0.7478371", "0.7471747", "0.73586774", "0.73557115", "0.73111844", "0.7269482", "0.72247195", "0.71986455", "0.71982497", "0.7124903", "0.71246314", "0.7118776", "0.7077425", "0.7069198", "0.7024604", "0.7006243", "0.70034546", "0.7000664", "0.70006096", "0.6988802", "0.6986622", "0.696097", "0.6957248", "0.695247", "0.69416577", "0.6939756", "0.6937571", "0.6936681", "0.6905899", "0.6902839", "0.69004405", "0.6895462", "0.6891847", "0.68848306", "0.68750954", "0.6874306", "0.68566614", "0.68531156", "0.6851434", "0.6850749", "0.68371546", "0.6832028", "0.68211204", "0.6818055", "0.6809362", "0.68004", "0.67997295", "0.67900693", "0.67824423", "0.67777294", "0.67777294", "0.67777294", "0.67702806", "0.67697835", "0.67690635", "0.67549837", "0.6748372", "0.6733681", "0.6732999", "0.67313904", "0.67313904", "0.67313904", "0.67309445", "0.6728357", "0.67222166", "0.67207867", "0.67090535", "0.67090225", "0.6708659", "0.6706737", "0.6698776", "0.6698672", "0.6695573", "0.6694308", "0.6693563", "0.66905826", "0.6689711", "0.6687491", "0.66846967", "0.668447", "0.66843873", "0.66842", "0.6679447", "0.6679317", "0.6679317", "0.66764647", "0.66761506", "0.66760164", "0.6671561", "0.6648721", "0.6648447", "0.6647841", "0.6645756", "0.6643647", "0.66392756", "0.6638441", "0.663843" ]
0.0
-1
Create tables in db
public static function up(){ DBW::create('Comment',function($t){ $t -> varchar('name') -> text('message') -> tinyint('public_flag') -> datetime('timestamp'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }", "public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }", "public function createTables () {\n $this->usersDB->createTables();\n $this->categoriesDB->createTables();\n $this->itemsDB->createTables();\n }", "protected function createTables()\n {\n $sql = $this->create_table;\n $this->connection->query($sql);\n\n // create again in schema 2\n $sql = str_replace($this->table, \"{$this->schema2}.{$this->table}\", $sql);\n $this->connection->query($sql);\n }", "function createDBTables() {\n $installer = new TrelloInstaller();\n return $installer->install();\n }", "function createTables()\n {\n $sqls = $this->simplexmlObject->xpath(\"//table\");\n foreach($sqls as $sql) {\n try {\n $db = $this->getConnection();\n $db->exec($sql);\n $tablename = $sql->getName();\n print(\"Created $tablename table.\\n\");\n $this->closeConnection($db, $sql);\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }\n \n }", "protected function createTables() {\n $foreignKeys = array();\n $this->sortTableQueue($this->_tableCreateQueue, $foreignKeys);\n foreach($this->_tableCreateQueue as $table => $fields) {\n $this->createTable($table, $fields);\n }\n foreach($foreignKeys as $table => $columns) {\n $this->useTable($table);\n foreach($columns as $column => $module) {\n $this->useColumn($column.\"_id\");\n $this->toForeignKey($module.\"_\".$column);\n }\n }\n $this->_tableCreateQueue = array();\n }", "private function createDBTables(){\n\t\tif (!$this['db']->getSchemaManager()->tablesExist('bookings')){\n\t\t\t$this['db']->executeQuery(\"CREATE TABLE bookings (\n\t\t\t\tid INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tfirstName VARCHAR(40) NOT NULL,\n\t\t\t\tlastName VARCHAR(40) NOT NULL,\n\t\t\t\tphone VARCHAR(10) NOT NULL,\n\t\t\t\temail VARCHAR(20) DEFAULT NULL,\n\t\t\t\tbirthday DATE NOT NULL,\n\t\t\t\tstartDate DATE NOT NULL,\n\t\t\t\tendDate DATE NOT NULL,\n\t\t\t\tarrivalTime TIME DEFAULT NULL,\n\t\t\t\tadditionalInformation TEXT,\n\t\t\t\tnrOfPeople INT NOT NULL,\n\t\t\t\tpayingMethod VARCHAR(10) NOT NULL\n\t\t\t\t);\");\n\t\t}\n\t}", "public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}", "private function createTables()\n {\n $categoryTable = 'CREATE TABLE IF NOT EXISTS categories(\n category_id INT AUTO_INCREMENT,\n category_name VARCHAR(255) UNIQUE NOT NULL,\n category_view_count INT DEFAULT 0,\n PRIMARY KEY (category_id)\n )';\n $stmt = $this->dbConnection->prepare($categoryTable);\n $stmt->execute();\n\n $playlistTable = 'CREATE TABLE IF NOT EXISTS playlists(\n playlist_id INT AUTO_INCREMENT,\n category_id INT,\n playlist_name VARCHAR(255) NOT NULL,\n playlist_description VARCHAR(255) DEFAULT \"\",\n playlist_view_count INT DEFAULT 0,\n created_at TIMESTAMP NOT NULL,\n PRIMARY KEY (playlist_id),\n FOREIGN KEY (category_id) REFERENCES categories (category_id) ON DELETE CASCADE\n )';\n $stmt = $this->dbConnection->prepare($playlistTable);\n $stmt->execute();\n\n $playlistLinkTable = 'CREATE TABLE IF NOT EXISTS playlistLink(\n link_id INT AUTO_INCREMENT,\n link VARCHAR(255) NOT NULL,\n title VARCHAR(255) NOT NULL,\n author_name VARCHAR(255) NOT NULL,\n author_url VARCHAR(255) NOT NULL,\n thumbnail_url VARCHAR(255) NOT NULL,\n playlist_id INT,\n PRIMARY KEY (link_id),\n FOREIGN KEY (playlist_id) REFERENCES playlists (playlist_id) ON DELETE CASCADE\n )';\n $stmt = $this->dbConnection->prepare($playlistLinkTable);\n $stmt->execute();\n\n }", "public function createTables(){\n $commands = [\n 'CREATE TABLE IF NOT EXISTS posts (\n post_id TEXT PRIMARY KEY,\n post_title TEXT,\n post_subreddit TEXT,\n post_content TEXT,\n post_html TEXT,\n post_link TEXT,\n post_media TEXT,\n post_is_video TEXT,\n post_video_height INTEGER,\n post_video_width INTEGER\n )',\n 'CREATE TABLE IF NOT EXISTS tags (\n tag_id INTEGER PRIMARY KEY,\n tag_name TEXT NOT NULL\n )',\n 'CREATE TABLE IF NOT EXISTS postTags (\n tag_id INTEGER NOT NULL,\n post_id TEXT NOT NULL,\n \t\t\t\t\t\tPRIMARY KEY (tag_id,post_id)\n FOREIGN KEY (post_id)\n REFERENCES posts(post_id) \n ON UPDATE CASCADE\n ON DELETE CASCADE,\n \t\t\t\t\t\tFOREIGN KEY (post_id)\n REFERENCES posts(post_id) \n ON UPDATE CASCADE\n ON DELETE CASCADE)'];\n // execute the sql commands to create new tables\n foreach ($commands as $command) {\n try{\n $this->pdo->exec($command);\n }catch (\\PDOException $e) {\n echo $e;\n }\n }\n }", "public function create_tables() {\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$schema = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}cn_addressbooks` ( \n\t\t\t`id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(100) NOT NULL , `address` VARCHAR(255) NULL , \n\t\t\t`phone` VARCHAR(30) NULL , `created_by` BIGINT(20) NOT NULL , `created_at` DATETIME NOT NULL , \n\t\t\tPRIMARY KEY (`id`)) \n\t\t\t$charset_collate\";\n\n\t\tif ( ! function_exists( 'dbDelta') ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\t}\n\n\t\tdbDelta( $schema );\n\t}", "public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "private function createTables()\n {\n $query = array();\n\n // creating games table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS games (\n id INTEGER PRIMARY KEY,\n player1_hash TEXT,\n player1_name TEXT,\n player1_ships TEXT,\n player2_hash TEXT,\n player2_name TEXT,\n player2_ships TEXT,\n timestamp NUMERIC\n )\n \";\n\n // creating events table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY,\n game_id INTEGER,\n player INTEGER,\n event_type TEXT,\n event_value TEXT,\n timestamp NUMERIC\n )\n \";\n\n foreach ($query as $value) {\n $this->oDB->query($value);\n }\n }", "public function createSchemaTable();", "protected function createTestTables()\n {\n $db = $this->getDb();\n\n $table = 'EmailTemplateAr';\n $columns = [\n 'id' => 'pk',\n 'name' => 'string',\n 'subject' => 'string',\n 'bodyHtml' => 'text',\n ];\n $db->createCommand()->createTable($table, $columns)->execute();\n\n $columns = [\n 'name' => 'TestActiveMessage',\n 'subject' => 'test subject',\n 'bodyHtml' => 'test body HTML',\n ];\n $db->createCommand()->insert($table, $columns)->execute();\n }", "function createTable() {\n print \"\\nCreate table: \".$dbtable.\"\\n\";\n if (createDB()) {\n print \"OK\\n\";\n }\n interceptExit();\n }", "function mikado_create_db_tables() {\n\tinclude_once (WP_PLUGIN_DIR . '/mikado/lib/install-db.php');\t\t\t\n\tmikado_install_db();\n}", "private function create_tables()\n {\n global $wpdb;\n\n /* http://wiip.fr/content/choisir-le-type-de-colonne-de-ses-tables-mysql */\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n nom VARCHAR(255) NOT NULL,\n prenom VARCHAR(255) NOT NULL,\n email VARCHAR(320) NOT NULL,\n password VARCHAR(500) NOT NULL,\n adresse CHAR(255),\n codepostal CHAR(10),\n ville CHAR(60),\n pays CHAR(60),\n telephone_professionnel CHAR(20),\n dateinscription CHAR(20) NOT NULL,\n statut VARCHAR(15),\n evenement VARCHAR(255),\n date_evenement DATE,\n specialite VARCHAR(100),\n categorie VARCHAR(20),\n isUpdate VARCHAR(10),\n organisme_facturation CHAR(100),\n email_facturation CHAR(255),\n adresse_facturation CHAR(255),\n ville_facturation CHAR(60),\n codepostal_facturation CHAR(10),\n pays_facturation CHAR(50),\n contacts TEXT\n \n\n )';\n\n dbDelta($sql);\n\n $sql = '\n CREATE TABLE IF NOT EXISTS '.$this->tables['users_file'].'(\n id int(11) NOT NULL auto_increment,\n PRIMARY KEY (id),\n email VARCHAR(320) NOT NULL,\n fichier VARCHAR(500) NOT NULL,\n chemin VARCHAR(500) NOT NULL,\n date_enregistrement VARCHAR(500) NOT NULL,\n type_doc VARCHAR(100) NOT NULL\n \n )';\n\n dbDelta($sql);\n }", "public function create_tables() {\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n $schema = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}wc_addresses` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,\n `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_by` bigint(20) unsigned NOT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) $charset_collate\";\n if ( !function_exists( 'dbDelta' ) ) {\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n }\n\n dbDelta( $schema );\n }", "static function create_tables(){\n\t\t$tables = self::get_tables_name();\n\t\textract($tables);\n\t\t\n\t\t$sql[] = \"CREATE TABLE IF NOT EXISTS $cookie(\n\t\t\t\tID bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tcontent text(100) NOT NULL,\n\t\t\t\ttype varchar(30) NOT NULL,\n\t\t\t\tcamp_id bigint unsigned NOT NULL,\n\t\t\t\taction varchar(30) NOT NULL\t \t\t\t\n\t\t\t)\";\n\t\t\n\t\t$sql[] = \"CREATE TABLE IF NOT EXISTS $display(\n\t\t\t\tID bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\tcontent text(100) NOT NULL,\n\t\t\t\ttype varchar(30) NOT NULL,\n\t\t\t\tcamp_id bigint unsigned NOT NULL\t\t\t\t \t\t\t\n\t\t\t)\";\n\t\t\n\t\tif(!function_exists('dbDelta')) :\n\t\t\tinclude ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tendif;\n\t\tforeach($sql as $s){\n\t\t\tdbDelta($s);\n\t\t}\n\t\t\n\t}", "public static function generateDatabase()\n\t{\n\t\t$entities\t=\tself::getEntities();\n\t\t$query\t\t=\tself::$current_db->query('SHOW TABLES');\n\t\t$tables\t\t=\tarray();\n\n\t\twhile($table = $query->fetch(\\PDO::FETCH_NUM))\n\t\t\t$tables[]\t=\tstrtolower($table[0]);\n\n\t\tforeach($entities as $entity)\n\t\t{\n\t\t\tif( ! in_array(strtolower($entity::getTableName()), $tables))\n\t\t\t\t$entity::createTable();\n\t\t\telse\n\t\t\t\t$entity::updateTable();\n\t\t}\n\t}", "public function createTables() {\n\t\t$schemas = glob(FORUM_SCHEMA . '*.sql');\n\t\t$executed = 0;\n\t\t$total = count($schemas);\n\t\t$tables = array();\n\n\t\tforeach ($schemas as $schema) {\n\t\t\t$contents = file_get_contents($schema);\n\t\t\t$contents = String::insert($contents, array('prefix' => $this->install['prefix']), array('before' => '{', 'after' => '}'));\n\t\t\t$contents = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $contents);\n\n\t\t\t$queries = explode(';', $contents);\n\t\t\t$tables[] = $this->install['prefix'] . str_replace('.sql', '', basename($schema));\n\n\t\t\tforeach ($queries as $query) {\n\t\t\t\t$query = trim($query);\n\n\t\t\t\tif ($query !== '' && $this->db->execute($query)) {\n\t\t\t\t\t$command = trim(substr($query, 0, 6));\n\n\t\t\t\t\tif ($command === 'CREATE' || $command === 'ALTER') {\n\t\t\t\t\t\t$executed++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($executed != $total) {\n\t\t\t$this->out('Error: Failed to create database tables!');\n\t\t\t$this->out('Rolling back and dropping any created tables.');\n\n\t\t\tforeach ($tables as $table) {\n\t\t\t\t$this->db->execute(sprintf('DROP TABLE `%s`;', $table));\n\t\t\t}\n\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$this->out('Tables created successfully...');\n\t\t}\n\n\t\treturn true;\n\t}", "protected function generateDbTables()\n\t{\n\t\t$dbTables = $this->getDbTables();\n\t\t\n\t\t//get the describe of the table\n\t\tforeach ($dbTables as $table) {\n\t\t\t$describeTable = $this->describeTable($table);\n\t\t\t\n\t\t\tif ($describeTable) {\n\t\t\t\t$primaryKey = $this->getPrimaryKey($describeTable);\n\t\t\t\t$code = $this->generateDbTableCode($table, $primaryKey);\n\t\t\t\t$this->saveDbTableFile($code);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function createTables()\r\n {\r\n $sql = \"\r\n CREATE TABLE IF NOT EXISTS coins\r\n (\r\n id INT NOT NULL AUTO_INCREMENT,\r\n playername VARCHAR(32) NOT NULL,\r\n coins INT NOT NULL,\r\n ip VARCHAR(32) NOT NULL,\r\n cid VARCHAR(64) NOT NULL,\r\n PRIMARY KEY (id)\r\n );\r\n \";\r\n self::update($sql);\r\n }", "abstract public function createTable();", "protected function createTable() {\n $this->db->initializeQuery();\n $query = \"\nCREATE TABLE `items` (\n`id`INTEGER,\n`name`TEXT,\n`price`REAL,\nPRIMARY KEY(`id`)\n);\n\";\n\n $r = $this->db->q->Expr($query)->execute($this->db->c);\n \n }", "public function generateDatabase()\n {\n $this->generateUserTable();\n $this->generateEmployerTable();\n $this->generateCandidateTable();\n $this->generateGuidTable();\n $this->generateWorkExperienceTable();\n $this->generateShortListTable();\n $this->generateQualTypeTable();\n $this->generateQualLevelTable();\n $this->generateQualificationsTable();\n $this->generateFieldTable();\n $this->generateSubFieldTable();\n $this->generateSkillTable();\n $this->generatePreferencesTable();\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }", "function init_tables(){\n $db = new PDO('sqlite:history.pyramid.sqlite');\n $db->exec(\"PRAGMA foreign_keys = ON\");\n $db->exec(\"drop table if exists areas\");\n $db->exec(\"drop table if exists codigos\");\n $db->exec(\"drop table if exists outs\");\n $db->exec(\"CREATE TABLE Areas (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE codigos (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE outs (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n}", "protected function createTables()\n {\n $this->table = new SwooleTable;\n\n $tables = $this->container['config']->get('swoole_http.tables', []);\n foreach ($tables as $key => $value) {\n $table = new Table($value['size']);\n $columns = $value['columns'] ?? [];\n foreach ($columns as $column) {\n if (isset($column['size'])) {\n $table->column($column['name'], $column['type'], $column['size']);\n } else {\n $table->column($column['name'], $column['type']);\n }\n }\n $table->create();\n\n $this->table->add($key, $table);\n }\n }", "public function createTable()\n\t{\n\t\tphpCAS::traceBegin();\n\n\t\t// initialize the PDO object for this method\n\t\t$pdo = $this->getPdo();\n\t\t$this->setErrorMode();\n\n\t\ttry {\n\t\t\t$pdo->beginTransaction();\n\n\t\t\t$query = $pdo->query($this->_createTableSQL());\n\t\t\t$query->closeCursor();\n\n\t\t\t$pdo->commit();\n\t\t}\n\t\tcatch(PDOException $e) {\n\t\t\t// attempt rolling back the transaction before throwing a phpCAS error\n\t\t\ttry {\n\t\t\t\t$pdo->rollBack();\n\t\t\t}\n\t\t\tcatch(PDOException $e) {}\n\t\t\tphpCAS::error('error creating PGT storage table: ' . $e->getMessage());\n\t\t}\n\n\t\t// reset the PDO object\n\t\t$this->resetErrorMode();\n\n\t\tphpCAS::traceEnd();\n\t}", "protected function createDatabaseStructure() {}", "private function createNewTable() {\n //generate the create table statement\n $sql = \"create table $this->tableName(\";\n $comma = \"\";\n $keyNameList = [];\n foreach ($this->columns as $column /* @var $column DbColumn */) {\n $sql .= \" $comma $column->columnName $column->dataType $column->extraStuff\";\n $comma = \",\";\n if ($column->primaryKey === true) {\n $keyNameList[] = $column->columnName;\n }\n }\n //generate the primary key list, if any are present\n $primaryKeySql = \"\";\n if (count($keyNameList) > 0) {\n $primaryKeySql = \"primary key(\";\n $comma = \"\";\n foreach ($keyNameList as $keyName) {\n $primaryKeySql = \"$primaryKeySql $comma $keyName\";\n $comma = \",\";\n }\n $primaryKeySql = \",$primaryKeySql)\";\n }\n\n //constraints\n $cSql = \"\";\n //we are assuming that there is at least one table. otherwise, the query would fail anyway.\n $comma = \",\";\n foreach ($this->constraints as $c) {\n $cSql .= \" $comma\";\n switch ($c->constraintType) {\n case \"foreign key\":\n $cSql .= \" FOREIGN KEY($c->columnName) REFERENCES $c->referencesTableName($c->referencesColumnName)\";\n break;\n }\n }\n $sql = \"$sql $primaryKeySql $cSql)\";\n return DbManager::nonQuery($sql);\n }", "public function test_create_table()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( \"DROP TABLE IF EXISTS people\" );\n\t\t\n\t\t$handler->run( \n\t\t\"CREATE TABLE people ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\tname VARCHAR, \n\t\t\tage INTEGER\n\t\t);\");\n\t}", "private static function create_tables() {\n\t\t// phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved -- False positive.\n\t\tself::$dbo = new \\SQLite3( WP_CLI_SNAPSHOT_DB );\n\n\t\t// Create snapshots table.\n\t\t$snapshots_table_query = 'CREATE TABLE IF NOT EXISTS snapshots (\n\t\t\tid INTEGER,\n\t\t\tname VARCHAR,\n\t\t\tcreated_at DATETIME,\n\t\t\tbackup_type INTEGER DEFAULT 0,\n\t\t\tbackup_zip_size VARCHAR,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $snapshots_table_query );\n\n\t\t// Create snapshot_extra_info table.\n\t\t$extra_info_table_query = 'CREATE TABLE IF NOT EXISTS snapshot_extra_info (\n\t\t\tid INTEGER,\n\t\t\tinfo_key VARCHAR,\n\t\t\tinfo_value VARCHAR,\n\t\t\tsnapshot_id INTEGER,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $extra_info_table_query );\n\n\t\t// Create storage_credentials table.\n\t\t$storage_credentials_table_query = 'CREATE TABLE IF NOT EXISTS snapshot_storage_credentials (\n\t\t\tid INTEGER,\n\t\t\tstorage_service VARCHAR,\n\t\t\tinfo_key VARCHAR,\n\t\t\tinfo_value VARCHAR,\n\t\t\tPRIMARY KEY (id)\n\t\t);';\n\t\tself::$dbo->exec( $storage_credentials_table_query );\n\n\t}", "private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}", "private static function setupDB() {\n\t\t$tbl = self::$table;\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\twfDebugLog( __METHOD__, \"\\tCreating tables\\n\" );\n\t\t$dbw->query(\n\t\t\t\"CREATE TABLE IF NOT EXISTS $tbl ( pathway varchar(255), day varchar(50) )\", DB_MASTER\n\t\t);\n\t\twfDebugLog( __METHOD__, \"\\tDone!\\n\" );\n\t}", "protected function _initDbTables($db) {\n\t\t$tables = array_keys($this->schema);\n\t\t$buffer = array();\n\t\tforeach($this->schema as $sql) {\n\t\t\t$buffer[] = $sql['create'];\n\t\t}\n\t\t$db->exec(implode(\"\\n\", $buffer));\n\n\t\t// Check for fatal failures?\n\t\tif ($db->errorCode() !== '00000') {\n\t\t\t$info = $db->errorInfo();\n\t\t\tdie('FeedAggregatorPdoStorage->_initDbTables: PDO Error: ' . \n\t\t\t\timplode(', ', $info) . \"\\n\");\n\t\t}\n\t}", "protected function createTable() {\n\t\t$query = \"\n\t\tCREATE TABLE `items` (\n\t\t\t`id`\tINTEGER,\n\t\t\t`firstName`\tTEXT,\n\t\t\t`lastName`\tTEXT,\n\t\t\t`address`\tTEXT,\n\t\t\t'occupation' TEXT,\n\t\t\tPRIMARY KEY(`id`)\n\t\t);\n\t\t\";\n\t\t$this->PDO->query($query);\n\t}", "private function createDatabase()\n {\n // get entity manager\n $em = $this->modelManager;\n\n // get our schema tool\n $tool = new SchemaTool( $em );\n\n // ...\n $classes = array_map(\n function( $model ) use ( $em ) {\n return $em->getClassMetadata( $model );\n },\n $this->models\n );\n\n // remove them\n $tool->createSchema( $classes );\n }", "public function __construct(){\n \n $this->create_tables();\n \n }", "protected function createTables()\n {\n $tablesCreated = false;\n\n if (Craft::$app->db->schema->getTableSchema(Page::tableName()) === null) {\n $tablesCreated = true;\n $this->createTable(Page::tableName(), [\n 'id' => $this->primaryKey(),\n 'url' => $this->string(255)->notNull()->unique(),\n 'password' => $this->string(),\n 'anonymous' => $this->boolean()->defaultValue(false),\n 'startDate' => $this->dateTime(),\n 'expiryDate' => $this->dateTime(),\n\n 'dateCreated' => $this->dateTime()->notNull(),\n 'dateUpdated' => $this->dateTime()->notNull(),\n 'uid' => $this->uid(),\n ]);\n }\n\n if (Craft::$app->db->schema->getTableSchema(Comment::tableName()) === null) {\n $tablesCreated = true;\n $this->createTable(Comment::tableName(), [\n 'id' => $this->primaryKey(),\n 'pageId' => $this->integer()->notNull(),\n 'content' => $this->text()->notNull(),\n 'target' => $this->text(),\n 'name' => $this->string(100),\n\n 'dateCreated' => $this->dateTime()->notNull(),\n 'dateUpdated' => $this->dateTime()->notNull(),\n 'uid' => $this->uid(),\n ]);\n }\n\n return $tablesCreated;\n }", "public function create_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t\n $db_charset_collate = '';\n if( !empty($wpdb->charset) )\n\t\t\t$db_charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if( !empty($wpdb->collate) )\n\t\t\t$db_charset_collate .= \" COLLATE $wpdb->collate\";\n\t\t\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\t$sql = \"CREATE TABLE \".self::$site_table.\" (\n\t\t\t\t id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t blog_id bigint(20) unsigned NOT NULL UNIQUE,\n\t\t\t\t url text NOT NULL DEFAULT '',\n\t\t\t\t title text NOT NULL DEFAULT '',\n\t\t\t\t num_posts bigint(20) NOT NULL DEFAULT 0,\n\t\t\t\t num_pages bigint(20) NOT NULL DEFAULT 0,\n\t\t\t\t num_comments bigint(20) NOT NULL DEFAULT 0,\n\t\t\t\t last_post_url text NOT NULL DEFAULT '',\n\t\t\t\t last_post_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t last_post_author text NOT NULL DEFAULT '',\n\t\t\t\t last_post_status text NOT NULL DEFAULT '',\n\t\t\t\t last_comment_url text NOT NULL DEFAULT '',\n\t\t\t\t last_comment_date datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t admin_email text NOT NULL DEFAULT '',\n\t\t\t\t status text NOT NULL DEFAULT ''\";\n\t\t$sql = apply_filters('orghub_create_table', $sql);\n\t\t$sql .= \"PRIMARY KEY (id)\n\t\t\t\t) ENGINE=InnoDB $db_charset_collate;\";\n dbDelta($sql);\n\t}", "function createTable($objSchema);", "public function createTable()\n {\n $sql = \"\n CREATE TABLE IF NOT EXISTS `\".self::TABLE.\"`(\n `migration` VARCHAR(20) NOT NULL,\n `up` VARCHAR(1000) NOT NULL,\n `down` VARCHAR(1000) NOT NULL\n ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n \";\n\n $this->adapter->query($sql, Adapter::QUERY_MODE_EXECUTE);\n }", "public function createTables()\r\n {\r\n // create the admin table\r\n $admin_table = new Ddl\\CreateTable('admins');\r\n $admin_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $admin_table->addColumn(new Column\\Char('username', 15));\r\n $admin_table->addColumn(new Column\\Char('password', 255));\r\n $admin_table->addColumn(new Column\\Integer('setup_ran', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $admin_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $admin_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the members table\r\n $members_table = new Ddl\\CreateTable('members');\r\n $members_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $members_table->addColumn(new Column\\Char('username', 15));\r\n $members_table->addColumn(new Column\\Char('password', 150));\r\n $members_table->addColumn(new Column\\Blob('avatar', true));\r\n $members_table->addColumn(new Column\\Boolean('new', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $members_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $members_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the profile table\r\n $profile_table = new Ddl\\CreateTable('profiles');\r\n $profile_table->addColumn(new Column\\Integer('profile_id', false, null, array('unsigned' => true)));\r\n $profile_table->addColumn(new Column\\Char('display_name', 75));\r\n $profile_table->addColumn(new Column\\Char('email_address', 75));\r\n $profile_table->addColumn(new Column\\Integer('age', false, null, array('unsigned' => true)));\r\n $profile_table->addColumn(new Column\\Char('location', 150));\r\n $profile_table->addColumn(new Column\\Text('bio'));\r\n $profile_table->addColumn(new Column\\Integer('views', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $profile_table->addConstraint(new Constraint\\UniqueKey('display_name'));\r\n $profile_table->addConstraint(new Constraint\\UniqueKey('email_address'));\r\n $profile_table->addConstraint(new Constraint\\PrimaryKey('profile_id'));\r\n\r\n\r\n // create the profile settings table\r\n $profile_settings_table = new Ddl\\CreateTable('profile_settings');\r\n $profile_settings_table->addColumn(new Column\\Integer('profile_id', false, null, array('unsigned' => true)));\r\n $profile_settings_table->addColumn(new Column\\Char('setting', 75));\r\n $profile_settings_table->addColumn(new Column\\Integer('value', false, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $profile_settings_table->addConstraint(new Constraint\\ForeignKey('profile_id_fk', 'profile_id', 'profiles', 'profile_id', 'cascade', 'cascade'));\r\n $profile_settings_table->addConstraint(new Constraint\\UniqueKey('setting'));\r\n $profile_settings_table->addConstraint(new Constraint\\PrimaryKey('profile_id'));\r\n\r\n\r\n // create the groups table\r\n $groups_table = new Ddl\\CreateTable('groups');\r\n $groups_table->addColumn(new Column\\Integer('id', false, null, array('unsigned' => true, 'auto_increment' => true)));\r\n $groups_table->addColumn(new Column\\Char('group_name', 100));\r\n $groups_table->addColumn(new Column\\Char('group_creator', 15));\r\n $groups_table->addColumn(new Column\\Datetime('group_created_date'));\r\n $groups_table->addColumn(new Column\\Text('group_description'));\r\n\r\n // add the constraints\r\n $groups_table->addConstraint(new Constraint\\UniqueKey('group_name'));\r\n $groups_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the group settings table\r\n $group_settings_table = new Ddl\\CreateTable('group_settings');\r\n $group_settings_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_settings_table->addColumn(new Column\\Char('setting', 75));\r\n\r\n // add the constraints\r\n $group_settings_table->addConstraint(new Constraint\\ForeignKey('group_settings_id', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_settings_table->addConstraint(new Constraint\\PrimaryKey('group_id'));\r\n\r\n\r\n // create the group_members table\r\n $group_mems_table = new Ddl\\CreateTable('group_members');\r\n $group_mems_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_mems_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_mems_table->addColumn(new Column\\Boolean('banned', false, 0));\r\n $group_mems_table->addColumn(new Column\\Boolean('suspended', false, 0));\r\n\r\n // add the constraints\r\n $group_mems_table->addConstraint(new Constraint\\ForeignKey('group_id_fk', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_mems_table->addConstraint(new Constraint\\ForeignKey('member_id_fk', 'member_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_mems_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'member_id')));\r\n\r\n\r\n // create the group_admin table\r\n $group_admins_table = new Ddl\\CreateTable('group_admins');\r\n $group_admins_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_admins_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $group_admins_table->addConstraint(new Constraint\\ForeignKey('fk_group_id', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_admins_table->addConstraint(new Constraint\\ForeignKey('fk_user_id', 'user_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_admins_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'user_id')));\r\n\r\n\r\n // create the group_ranks table\r\n $group_ranks_table = new Ddl\\CreateTable('group_ranks');\r\n $group_ranks_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_ranks_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n $group_ranks_table->addColumn(new Column\\Integer('rank', false, null, array('unsigned' => true)));\r\n\r\n // add the constraints\r\n $group_ranks_table->addConstraint(new Constraint\\ForeignKey('fk_group_id_rank', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_ranks_table->addConstraint(new Constraint\\ForeignKey('fk_user_id_rank', 'user_id', 'members', 'id', 'cascade', 'cascade'));\r\n $group_ranks_table->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'user_id')));\r\n\r\n\r\n // create the group members online table\r\n $group_members_online_table = new Ddl\\CreateTable('group_members_online');\r\n $group_members_online_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_members_online_table->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_members_online_table->addColumn(new Column\\Boolean('status', true, null, array('unsigned' => false)));\r\n\r\n // add the constraints\r\n $group_members_online_table->addConstraint(new Constraint\\ForeignKey('fk_group_user_id', 'member_id', 'group_members', 'member_id', 'cascade', 'cascade'));\r\n $group_members_online_table->addConstraint(new Constraint\\ForeignKey('fk_groups_online', 'group_id', 'groups', 'id', 'cascade', 'cascade'));\r\n $group_members_online_table->addConstraint(new Constraint\\PrimaryKey(array('member_id', 'group_id')));\r\n\r\n \r\n // create the group join requests table\r\n $group_join_requests = new Ddl\\CreateTable('group_join_requests');\r\n $group_join_requests->addColumn(new Column\\Integer('group_id', false, null, array('unsigned' => true)));\r\n $group_join_requests->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $group_join_requests->addColumn(new Column\\Text('user_data'));\r\n \r\n // add the constraints\r\n $group_join_requests->addConstraint(new Constraint\\PrimaryKey(array('group_id', 'member_id')));\r\n \r\n\r\n // create the boards table\r\n $boards_table = new Ddl\\CreateTable('boards');\r\n $boards_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $boards_table->addColumn(new Column\\Char('board_name', 150));\r\n $boards_table->addColumn(new Column\\Text('board_moderators'));\r\n\r\n // add the constraints\r\n $boards_table->addConstraint(new Constraint\\UniqueKey('board_name'));\r\n $boards_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the board messages table\r\n $boards_msg_table = new Ddl\\CreateTable('board_messages');\r\n $boards_msg_table->addColumn(new Column\\Integer('message_id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $boards_msg_table->addColumn(new Column\\Integer('board_id', false, null, array('unsigned' => true)));\r\n $boards_msg_table->addColumn(new Column\\Integer('num_of_posts', false, 0, array('unsigned' => false)));\r\n $boards_msg_table->addColumn(new Column\\Char('author', 15));\r\n $boards_msg_table->addColumn(new Column\\Char('subject', 150));\r\n $boards_msg_table->addColumn(new Column\\Text('messages'));\r\n $boards_msg_table->addColumn(new Column\\Text('replies'));\r\n $boards_msg_table->addColumn(new Column\\Blob('attachments'));\r\n\r\n // add the constraints\r\n $boards_msg_table->addConstraint(new Constraint\\ForeignKey('fk_board_id', 'board_id', 'boards', 'id', 'cascade', 'cascade'));\r\n $boards_msg_table->addConstraint(new Constraint\\PrimaryKey('message_id'));\r\n\r\n\r\n // create the trending topics table\r\n $trending_topics = new Ddl\\CreateTable('trending_topics');\r\n $trending_topics->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $trending_topics->addColumn(new Column\\Char('topic', 150));\r\n $trending_topics->addColumn(new Column\\Char('author', 15));\r\n $trending_topics->addColumn(new Column\\Integer('number_of_views', false, null, array('unsigned' => true)));\r\n $trending_topics->addColumn(new Column\\Text('topic_message'));\r\n\r\n // add the constraints\r\n $trending_topics->addConstraint(new Constraint\\UniqueKey('topic'));\r\n $trending_topics->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the private messages table\r\n $private_messages = new Ddl\\CreateTable('private_messages');\r\n $private_messages->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $private_messages->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n $private_messages->addColumn(new Column\\Text('to'));\r\n $private_messages->addColumn(new Column\\Char('from', 15));\r\n $private_messages->addColumn(new Column\\Char('subject', 150));\r\n $private_messages->addColumn(new Column\\Text('message'));\r\n $private_messages->addColumn(new Column\\Datetime('date_received'));\r\n $private_messages->addColumn(new Column\\Integer('active', true, null));\r\n $private_messages->addColumn(new Column\\Integer('archived', true, null));\r\n\r\n // add the constraints\r\n $private_messages->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the themes table\r\n $themes_table = new Ddl\\CreateTable('themes');\r\n $themes_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $themes_table->addColumn(new Column\\Char('theme_name', 150));\r\n $themes_table->addColumn(new Column\\Char('theme_author'. 15));\r\n $themes_table->addColumn(new Column\\Char('theme_css_file', 200));\r\n $themes_table->addColumn(new Column\\Char('theme_images', 200));\r\n\r\n // add the constraints\r\n $themes_table->addConstraint(new Constraint\\UniqueKey('theme_name'));\r\n $themes_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the events table\r\n $events_table = new Ddl\\CreateTable('events');\r\n $events_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $events_table->addColumn(new Column\\Integer('member_id', false, null, array('unsigned' => true)));\r\n $events_table->addColumn(new Column\\Char('event_name', 150));\r\n $events_table->addColumn(new Column\\Text('event_description'));\r\n $events_table->addColumn(new Column\\Datetime('start_date'));\r\n $events_table->addColumn(new Column\\Datetime('end_date'));\r\n\r\n // add the constraints\r\n $events_table->addConstraint(new Constraint\\PrimaryKey(array('id', 'member_id')));\r\n\r\n $pending_users_table = new Ddl\\CreateTable('pending_users');\r\n $pending_users_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $pending_users_table->addColumn(new Column\\Char('username', 15));\r\n $pending_users_table->addColumn(new Column\\Char('password', 255));\r\n $pending_users_table->addColumn(new Column\\Char('email', 75));\r\n $pending_users_table->addColumn(new Column\\Char('pending_code', 255));\r\n\r\n // add the constraints\r\n $pending_users_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n $pending_users_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n\r\n // create the sessions table\r\n $sessions_table = new Ddl\\CreateTable('sessions');\r\n $sessions_table->addColumn(new Column\\Char('username', 30));\r\n $sessions_table->addColumn(new Column\\Char('password', 255));\r\n $sessions_table->addColumn(new Column\\Integer('active', false, null, array('unsigned' => true)));\r\n $sessions_table->addColumn(new Column\\Char('session_id', 150));\r\n\r\n // add the constraints\r\n $sessions_table->addConstraint(new Constraint\\UniqueKey('username'));\r\n\r\n \r\n // create the status table\r\n $status_table = new Ddl\\CreateTable('status');\r\n $status_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $status_table->addColumn(new Column\\Char('status', 150));\r\n $status_table->addColumn(new Column\\Integer('time_status', false, null, array('auto_increment' => false)));\r\n \r\n // add the constraints\r\n $status_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n\r\n \r\n // create the friends table\r\n $friends_table = new Ddl\\CreateTable('friends');\r\n $friends_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $friends_table->addColumn(new Column\\Integer('friend_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $friends_table->addColumn(new Column\\Integer('user_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n \r\n // add the constraints\r\n $friends_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // create the friend requests table\r\n $friend_requests_table = new Ddl\\CreateTable('friend_requests');\r\n $friend_requests_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $friend_requests_table->addColumn(new Column\\Integer('request_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n $friend_requests_table->addColumn(new Column\\Integer('friend_id', false, null, array('auto_increment' => false, 'unsigned' => true)));\r\n\r\n // add the constraints\r\n $friend_requests_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // create the friends online table\r\n $friends_online_table = new Ddl\\CreateTable('friends_online');\r\n $friends_online_table->addColumn(new Column\\Integer('user_id', false, null, array('unsigned' => true)));\r\n \r\n // add the constraints\r\n $friends_online_table->addConstraint(new Constraint\\PrimaryKey('user_id'));\r\n \r\n \r\n // create the chat table\r\n $chat_table = new Ddl\\CreateTable('chat');\r\n $chat_table->addColumn(new Column\\Integer('id', false, null, array('auto_increment' => true, 'unsigned' => true)));\r\n $chat_table->addColumn(new Column\\Char('who', 15));\r\n $chat_table->addColumn(new Column\\Char('from', 15));\r\n $chat_table->addColumn(new Column\\Datetime('chat_date', false, null));\r\n $chat_table->addColumn(new Column\\Datetime('chat_end_date', false, null));\r\n $chat_table->addColumn(new Column\\Integer('active', true, null, array('unsigned' => false)));\r\n \r\n // add the constraints\r\n $chat_table->addConstraint(new Constraint\\PrimaryKey('id'));\r\n \r\n \r\n // make the tables\r\n $this->query(array(\r\n $admin_table,\r\n $members_table,\r\n $profile_table,\r\n $profile_settings_table,\r\n $groups_table,\r\n $group_settings_table,\r\n $group_mems_table,\r\n $group_admins_table,\r\n $group_ranks_table,\r\n $group_members_online_table,\r\n $group_join_requests,\r\n $boards_table,\r\n $boards_msg_table,\r\n $trending_topics,\r\n $private_messages,\r\n $themes_table,\r\n $events_table,\r\n $pending_users_table,\r\n $sessions_table,\r\n $status_table,\r\n $friends_table,\r\n $friend_requests_table,\r\n $friends_online_table,\r\n $chat_table\r\n ));\r\n\r\n return true;\r\n }", "private function _createTables()\r\n {\r\n return true;\r\n }", "public function createDatabase()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n $tool = new \\Doctrine\\ORM\\Tools\\SchemaTool($em);\n\n $classes = [\n $em->getClassMetadata('Shopware\\CustomModels\\CustomSort\\ArticleSort'),\n ];\n\n try {\n $tool->createSchema($classes);\n } catch (\\Doctrine\\ORM\\Tools\\ToolsException $e) {\n //\n }\n }", "public function createTable()\n {\n $this->dbInstance->query(\"CREATE TABLE IF NOT EXISTS Image\n (\n ImageID int NOT NULL AUTO_INCREMENT,\n Name varchar(255) NOT NULL,\n File varchar(255) NOT NULL,\n Thumb varchar(255) NOT NULL,\n uploadDate DATETIME DEFAULT CURRENT_TIMESTAMP,\n UserFK int,\n PRIMARY KEY (ImageID),\n FOREIGN KEY (UserFK) REFERENCES User(UserID) ON DELETE CASCADE\n )\n \");\n }", "private function createSchema(): void\n {\n $this->schema()->create('books', function (Blueprint $table) {\n $table->id();\n $table->timestamps();\n });\n\n $this->schema()->create('book_translations', function (Blueprint $table) {\n $table->id();\n $table->foreignId('book_id');\n $table->string('title');\n $table->string('description');\n $table->string('locale');\n $table->timestamps();\n });\n }", "public function create_missing_tables() {\n\n\t\t/* Create the network snippets table if it doesn't exist */\n\t\tif ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t/* Create the table if it doesn't exist */\n\t\tif ( ! self::table_exists( $this->table ) ) {\n\t\t\t$this->create_table( $this->table );\n\t\t}\n\t}", "protected function createTables()\n\t{\n\t\t$this->db->createTable($this->mainTable, 'name TEXT NOT NULL');\n\t\t$this->db->createTable($this->relationsTable,\n\t\t\t\t\t'child INTEGER NOT NULL, parent INTEGER NOT NULL');\n\t\treturn $this;\n\t}", "public function migrate()\n {\n $db = new \\SQLite3(\"ATM.db\");\n\n $query = \"CREATE TABLE IF NOT EXISTS \" . $this->table_name . \" \";\n $fields = array();\n\n foreach($this->fields as $name=>$type) {\n $fields[] = \"$name $type\";\n }\n\n $query .= \"(\" . implode(\", \", $fields) . \")\";\n\n $db->exec($query);\n }", "private function dropAndCreateTables(){\n \n $migration = new MikeMigration($this::genPrefix(10));\n $save = 0;\n\n // Prepare Dropped Tables\n if($this->droppedTables){\n $save++;\n foreach($this->droppedTables as $item){\n\n $migration->up(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n $migration->down($this::prepareTableBlueprint($item));\n\n \n // Delete Model\n Storage::disk('models')->delete($this->appNamePath.'/'.$item[\"name\"].'.php');\n // Delete Controller\n Storage::disk('controllers')->delete($this->appNamePath.'/'.$item[\"name\"].'Controller.php');\n // Delete Routes\n //...\n\n }\n }\n // Prepare New Tables \n if($this->newTables){\n $save++;\n foreach($this->newTables as $item){\n\n\n $migration->up($this::prepareTableBlueprint($item));\n\n $migration->down(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n }\n }\n // If Exist Dropped pr New Tables \n if($save > 0){\n $migration->save();\n }\n \n\n\n }", "abstract protected function createTableDb(array $tableDef, array $options = []);", "abstract public function create_table($table_name, $fields, $primary_key = TRUE);", "public function create_tables()\n\t{\n\t//\t$link = mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password']);\n\n\t\t$link = e107::getDb()->connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password']);\n\n\t\tif(!$link)\n\t\t{\n\t\t\treturn nl2br(LANINS_084.\"\\n\\n<b>\".LANINS_083.\"\\n</b><i>\".e107::getDb()->getLastErrorText().\"</i>\");\n\t\t}\n\n\t\t$this->dbLink = $link;\t\t// Needed for mysql_close() to work round bug in PHP 5.3\n\t//\t$db_selected = mysql_select_db($this->previous_steps['mysql']['db'], $link);\n\t\t$db_selected = e107::getDb()->database($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\tif(!$db_selected)\n\t\t{\n\t\t\treturn nl2br(LANINS_085.\" '{$this->previous_steps['mysql']['db']}'\\n\\n<b>\".LANINS_083.\"\\n</b><i>\".e107::getDb()->getLastErrorText().\"</i>\");\n\t\t}\n\n\t\t$filename = \"{$this->e107->e107_dirs['CORE_DIRECTORY']}sql/core_sql.php\";\n\t\t$fd = fopen ($filename, \"r\");\n\t\t$sql_data = fread($fd, filesize($filename));\n\t\t$sql_data = preg_replace(\"#\\/\\*.*?\\*\\/#mis\", '', $sql_data);\t\t// Strip comments\n\t\tfclose ($fd);\n\n\t\tif (!$sql_data)\n\t\t{\n\t\t\treturn nl2br(LANINS_060).\"<br /><br />\";\n\t\t}\n\n\t\tpreg_match_all(\"/create(.*?)(?:myisam|innodb);/si\", $sql_data, $result );\n\n\t\t// Force UTF-8 again\n\t\t$this->dbqry('SET NAMES `utf8`');\n\n\t\t$srch = array(\"CREATE TABLE\",\"(\");\n\t\t$repl = array(\"DROP TABLE IF EXISTS\",\"\");\n\n\t\tforeach ($result[0] as $sql_table)\n\t\t{\n\t\t\t$sql_table = preg_replace(\"/create table\\s/si\", \"CREATE TABLE {$this->previous_steps['mysql']['prefix']}\", $sql_table);\n\n\t\t\t// Drop existing tables before creating.\n\t\t\t$tmp = explode(\"\\n\",$sql_table);\n\t\t\t$drop_table = str_replace($srch,$repl,$tmp[0]);\n\t\t\t$this->dbqry($drop_table);\n\n\t\t\tif (!$this->dbqry($sql_table, $link))\n\t\t\t{\n\t\t\t\tif($this->debug)\n\t\t\t\t{\n\t\t\t\t\techo \"<h3>filename</h3>\";\n\t\t\t\t\tvar_dump($filename);\n\n\t\t\t\t\techo \"<h3>sql_table</h3>\";\n\t\t\t\t\tvar_dump($sql_table);\n\t\t\t\t\techo \"<h3>result[0]</h3>\";\n\t\t\t\t\tvar_dump($result[0]);\n\t\t\t\t}\n\t\t\t\treturn nl2br(LANINS_061.\"\\n\\n<b>\".LANINS_083.\"\\n</b><i>\".e107::getDb()->getLastErrorText().\"</i>\");\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public function createTable()\n\t{\n\t\t$table = $this->getTableName();\n\t\t$indexes = $this->defineIndexes();\n\t\t$columns = array();\n\n\t\t// Add any Foreign Key columns\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$required = !empty($config['required']);\n\t\t\t$columns[$config[2]] = array('column' => ColumnType::Int, 'required' => $required);\n\n\t\t\t// Add unique index for this column?\n\t\t\t// (foreign keys already get indexed, so we're only concerned with whether it should be unique)\n\t\t\tif (!empty($config['unique']))\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($config[2]), 'unique' => true);\n\t\t\t}\n\t\t}\n\n\t\t// Add all other columns\n\t\tforeach ($this->defineAttributes() as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\n\t\t\t// Add (unique) index for this column?\n\t\t\t$indexed = !empty($config['indexed']);\n\t\t\t$unique = !empty($config['unique']);\n\n\t\t\tif ($unique || $indexed)\n\t\t\t{\n\t\t\t\t$indexes[] = array('columns' => array($name), 'unique' => $unique);\n\t\t\t}\n\n\t\t\t$columns[$name] = $config;\n\t\t}\n\n\t\t// Create the table\n\t\tblx()->db->createCommand()->createTable($table, $columns);\n\n\t\t// Create the indexes\n\t\tforeach ($indexes as $index)\n\t\t{\n\t\t\t$columns = ArrayHelper::stringToArray($index['columns']);\n\t\t\t$unique = !empty($index['unique']);\n\t\t\t$name = \"{$table}_\".implode('_', $columns).($unique ? '_unique' : '').'_idx';\n\t\t\tblx()->db->createCommand()->createIndex($name, $table, implode(',', $columns), $unique);\n\t\t}\n\t}", "static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }", "private function prepareTables() {}", "private function make_db() {\n ee()->load->dbforge();\n $fields = array(\n 'id' => array('type' => 'varchar', 'constraint' => '32'),\n 'access' => array('type' => 'integer', 'constraint' => '10', 'unsigned' => true),\n 'data' => array('type' => 'text')\n );\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n ee()->dbforge->create_table($this->table_name);\n\n return true;\n }", "public function createTable( $table ) {\n\t\t$idfield = $this->getIDfield($table, true);\n\t\t$table = $this->safeTable($table);\n\t\t$sql = \"\n CREATE TABLE $table ( $idfield INTEGER PRIMARY KEY AUTOINCREMENT )\n\t\t\t\t \";\n\t\t$this->adapter->exec( $sql );\n\t}", "protected function createLoadTables()\n {\n // foreach table, replace it with an empty table\n $tables = $this->schema->getTables();\n foreach ($tables as $table) {\n $this->dbcon->replaceTable($table);\n\n $msg = \"Created table '\".$table->name.\"'\";\n\n // If this table uses the Lookup table, create a view\n if ($table->usesLookup === true) {\n $this->dbcon->replaceLookupView($table, $this->schema->getLookupTable());\n $msg .= '; Lookup table created';\n }\n\n $this->log($msg);\n }\n return true;\n }", "public function createTable( $table ) {\n\t\t$rawTable = $this->safeTable($table,true);\n\t\t$table = $this->safeTable($table);\n\n\t\t$sql = ' CREATE TABLE '.$table.' (\n \"id\" integer AUTO_INCREMENT,\n\t\t\t\t\t CONSTRAINT \"pk_'.$rawTable.'_id\" PRIMARY KEY(\"id\")\n\t\t )';\n\t\t$this->adapter->exec( $sql );\n\t}", "private final function _createDbStructure()\n {\n if ($conn = $this->_getConnection()) {\n $installer = new lib_Install('install');\n try {\n $installer->install();\n } catch (Exception $e) {\n app::log($e->getMessage(), app::LOG_LEVEL_ERROR);\n }\n }\n }", "protected function setUpTable()\n {\n if (!Schema::hasTable($this->TABLE)){\n Schema::create($this->TABLE, function (Blueprint $table) {\n $table->string(self::ID)->primary();\n $table->string(self::TEXT);\n $table->integer(self::DATE);\n $table->string(self::SENDER_ID);\n $table->string(self::RECIPIENT_ID);\n });\n }\n }", "function table_creation(){\n\t\tglobal $wpdb;\n\t\t\t$table = $wpdb->prefix.'wiki';\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `$table`(\n\t\t\t\t`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t`post_id` bigint(20) NOT NULL,\n\t\t\t\t`author_id` bigint(20) NOT NULL,\t\n\t\t\t\t`post_content` longtext collate utf8_general_ci,\n\t\t\t\t`percent` int(100),\n\t\t\t\t`matched_keys` longtext collate utf8_general_ci,\n\t\t\t\t`time` TIMESTAMP,\t\t\t\t\n\t\t\t\tPRIMARY KEY(id)\n\t\t\t\t\n\t\t\t\t)\";\n\t\t\t//loading the dbDelta function manually\n\t\t\tif(!function_exists('dbDelta')) :\n\t\t\t\trequire_once(ABSPATH.'wp-admin/includes/upgrade.php');\n\t\t\tendif;\n\t\t\tdbDelta($sql);\n\t}", "protected function createOldTable()\n {\n $this->setUpNewTable();\n $this->getSchemaManager()->createTable($this->getOldTable());\n }", "public function installDB()\n {\n Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'onehop_sms_rulesets` (\n `ruleid` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n `rule_name` varchar(200) NOT NULL,\n `template` varchar(100) NOT NULL,\n `label` varchar(100) NOT NULL,\n `senderid` varchar(100) NOT NULL,\n `active` enum(\"1\",\"0\") NOT NULL DEFAULT \"1\" \n ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;');\n \n return Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'onehop_sms_templates` (\n `temp_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n `temp_name` varchar(200) NOT NULL,\n `temp_body` text NOT NULL,\n `submitdate` datetime NOT NULL\n ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;');\n }", "public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }", "private function createDummyTable() {}", "protected function createMigrationTable()\n {\n $migration_table = $this->config_file->getMigrationTable();\n\n $resource = $this->db_adapter->query(\"\n CREATE TABLE $this->migration_table (\n file VARCHAR PRIMARY KEY,\n ran_at TIMESTAMP DEFAULT NOW()\n );\n \");\n }", "public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '$this->table_name'\" ) == $this->table_name ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\tuser_id bigint(20) NOT NULL,\n\t\tusername varchar(50) NOT NULL,\n\t\temail varchar(50) NOT NULL,\n\t\tname mediumtext NOT NULL,\n\t\tproduct_count bigint(20) NOT NULL,\n\t\tsales_value mediumtext NOT NULL,\n\t\tsales_count bigint(20) NOT NULL,\n\t\tstatus mediumtext NOT NULL,\n\t\tnotes longtext NOT NULL,\n\t\tdate_created datetime NOT NULL,\n\t\tPRIMARY KEY (id),\n\t\tUNIQUE KEY email (email),\n\t\tKEY user (user_id)\n\t\t) CHARACTER SET utf8 COLLATE utf8_general_ci;\";\n\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( $this->table_name . '_db_version', $this->version );\n\t}", "private function createSchema(): void\n {\n $this->schema()->create('books', function (Blueprint $table) {\n $table->id();\n $table->timestamps();\n });\n }", "private function createSchema(): void\n {\n $this->schema()->create('books', function (Blueprint $table) {\n $table->id();\n $table->timestamps();\n });\n }", "function create_tables($data)\n\t{\n\t\t// Connect to the database\n\t\t$mysqli = new mysqli($data['db_host'],$data['db_username'],$data['db_password'],$data['db_name']);\n\n\t\t// Check for errors\n\t\tif(mysqli_connect_errno())\n\t\t\treturn false;\n\n\t\t// Open the default SQL file\n\t\t$query = file_get_contents('db.sql');\n\n\t\t// Execute a multi query\n\t\t$mysqli->multi_query($query);\n\n\t\t// Close the connection\n\t\t$mysqli->close();\n\n\t\t// Deletes the default SQL file\n\t\t@unlink('db.sql');\n\t\t\n\t\treturn true;\n\t}", "private function createDBSchemaTable()\n\t\t{\n\t\t\t\\System\\Base\\ApplicationBase::getInstance()->dataAdapter->addTableSchema(new \\System\\DB\\TableSchema(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => __DB_SCHEMA_VERSION_TABLENAME__),\n\t\t\t\t\tarray(),\n\t\t\t\t\tarray(new \\System\\DB\\ColumnSchema(array(\n\t\t\t\t\t\t'name' => 'version',\n\t\t\t\t\t\t'table' => __DB_SCHEMA_VERSION_TABLENAME__,\n\t\t\t\t\t\t'type' => 'decimal',\n\t\t\t\t\t\t'primaryKey' => true,\n\t\t\t\t\t\t'length' => '6,2',\n\t\t\t\t\t\t'notNull' => true,\n\t\t\t\t\t\t'real' => true)))));\n\t\t}", "public function create_table_config(){\n $sql = \" CREATE TABLE IF NOT EXISTS {$this->table_config} (\n `id` varchar(100),\n `day` varchar(50) DEFAULT NULL,\n `range` varchar(50) DEFAULT NULL,\n `qty` smallint DEFAULT 0,\n `type` varchar(50) DEFAULT NULL,\n `order` smallint DEFAULT 0,\n PRIMARY KEY (`id`)\n )\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }", "static private function createTables($file)\n\t{\n\t\t$config = Config::instance();\n\t\tforeach($config->sqlite_table AS $t)\n\t\t{\n\t\t\tself::$instance[$file]->exec($t);\n\t\t}\n\t}", "function create_db_tables(){\n\tglobal $status;\n\tglobal $connection;\n\t\n\t$sql_engine = \"CREATE TABLE IF NOT EXISTS engine (\nid int NOT NULL AUTO_INCREMENT, \nPRIMARY KEY(id),\nurl varchar(55)\n)\";\n$sql_number = \"CREATE TABLE IF NOT EXISTS number (\nid int NOT NULL, \nPRIMARY KEY(id),\nnum int(1)\n)\";\n\n$sql_users=\"CREATE TABLE IF NOT EXISTS users (\nid int AUTO_INCREMENT, \nusername varchar(65) NOT NULL,\npassword varchar(65) NOT NULL,\nPRIMARY KEY(id)\n)\";\n\n\n$make_engines=mysql_query($sql_engine,$connection);\n\tif($make_engines){\n\t\t$status.=\"TABLE 'engine' created successfuly! </br>\";\n\t\t}else{\n\t\t\tdie(\"TABLE 'engine' failed!!! </br>\". mysql_error());\n\t\t\t};\n\n$make_nums=mysql_query($sql_number,$connection);\n\tif($make_nums){\n\t\t$status.=\"TABLE 'number' created successfuly! </br>\";\n\t\t}else{\n\t\t\tdie(\"TABLE 'number' failed!!! </br>\". mysql_error());\n\t\t\t};\n\n$make_users=mysql_query($sql_users,$connection);\n\tif($make_users){\n\t\t$status.=\"TABLE 'users' created successfuly! </br>\";\n\t\t}else{\n\t\t\tdie(\"TABLE 'users' failed!!! </br>\". mysql_error());\n\t\t\t};\n}", "function create_tables($pdo){\n $pdo->exec(SQL_CREATE_FILM_TABLE);\n $pdo->exec(SQL_CREATE_ORDER_CHECK_TABLE);\n $pdo->exec(SQL_CREATE_CARRIER_TABLE);\n $pdo->exec(SQL_CREATE_FILM_CARIER_TABLE);\n $pdo->exec(SQL_CREATE_GANRE_TABLE);\n\n $pdo->exec(SQL_CREATE_FILM_GANRE_TABLE);\n\n $pdo->exec(SQL_CREATE_DIRECTOR_TABLE);\n $pdo->exec(SQL_CREATE_FILM_DIRECTOR_TABLE);\n $pdo->exec(SQL_CREATE_ACTOR_TABLE);\n $pdo->exec(SQL_CREATE_FILM_ACTOR_TABLE);\n}", "private function initialiseDatabaseStructure(){\r\n $this->exec($this->userTableSQL);\r\n $query = \"INSERT INTO `user` (`userName`,`userEmail`,`userFirstName`,`userSurname`,`userPassword`,`userIsActive`,`userIsAdmin`) VALUES(?,?,?,?,?,?,?);\";\r\n $statement = $this->prepare($query);\r\n $password = md5('Halipenek3');\r\n $statement->execute(array('admin','[email protected]','Super','Admin',$password,1,1));\r\n\r\n //Create the knowledge Table\r\n $this->exec($this->knowledgeTableSQL);\r\n $this->exec($this->tagTableSQL);\r\n $this->exec($this->tagsTableSQL);\r\n }", "public static function setupTables( $db = null )\n {\n $db = ( $db === null ? ezcDbInstance::get() : $db );\n $schema = ezcDbSchema::createFromFile( \"array\", dirname( __FILE__ ) . \"/relation.dba\" );\n $schema->writeToDb( $db );\n }", "private function createDBTable() {\n\t\tglobal $wpdb;\n\n\t\tif ( $wpdb->get_var( \"SHOW TABLES LIKE '\" . $this->debug_table . \"'\" ) !== $this->debug_table ) {\n\t\t\t$sql = 'CREATE TABLE `' . $this->debug_table . '` (\n\t\t\t\t`id` INT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t`timestamp` TIMESTAMP NOT NULL,\n\t\t\t\t`blog` INT(9) NOT NULL,\n\t\t\t\t`message` text NOT NULL\n\t\t\t);';\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}", "public function createMigrationsTable(): void;", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "private function newPostTable () {\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_posts (hostname VARCHAR(100), url VARCHAR(100), date VARCHAR(20), image VARCHAR(100), text VARCHAR(100), PRIMARY KEY (url))\";\n\t\t$this->sendQuery($query);\n\t}", "public static function setupTables( $autoIncrement = true )\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromFile( 'array', dirname( __FILE__ ) . '/database_type.dba' );\n $schema->writeToDb( $db );\n }", "function createTable(){\n \n $conn = $this->connect();\n \n $sql = 'CREATE TABLE IF NOT EXISTS ' . $this->dbtable . \n\t\t\t\t\t'( codigo INTEGER NOT NULL AUTO_INCREMENT, email VARCHAR(100), CONSTRAINT pk_' . $this->dbtable . \n\t\t\t\t\t' PRIMARY KEY (codigo)) ENGINE=INNODB CHARSET=utf8';\n $ret = mysql_query( $sql, $conn);\n mysql_close( $conn );\n\t\t\treturn $ret;\n }", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`lang_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`lang_iso` VARCHAR(2) NOT NULL DEFAULT 'nn', \".\n \"`lang_local` VARCHAR(64) NOT NULL DEFAULT '-undefined-', \".\n \"`lang_english` VARCHAR(64) NOT NULL DEFAULT '-undefined-', \".\n \"PRIMARY KEY (`lang_id`), KEY (`lang_iso`, `lang_english`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "function create_table(){\n global $wpdb;\n\n require_once(ABSPATH . \"wp-admin\" . '/includes/upgrade.php');\n\n $table_name = $wpdb->base_prefix . $this->table;\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n post_id bigint(20) unsigned,\n blog_id mediumint(9) NOT NULL,\n post_author bigint(20) unsigned,\n post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_date_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_content longtext,\n post_title text,\n post_excerpt text,\n post_status varchar(20) DEFAULT 'post_status',\n post_type varchar(20) DEFAULT 'post',\n post_modified_gmt datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n post_modified datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n guid varchar(255),\n UNIQUE KEY id (id)\n );\";\n\n dbDelta( $sql );\n }", "public function createTables($force = false) {\n $this->dbh->beginTransaction();\n foreach ($this->tables as $tableName => $sql) {\n $this->_createTable($tableName, $sql);\n }\n return $this->dbh->commit();\n }", "private function createTables() {\r\n\r\n\t\t\t//User table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `users` (\r\n\t\t\t\t\tuser_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\temail varchar(100),\r\n\t\t\t\t\tstudent_id varchar(30),\r\n\t\t\t\t\tpassword varchar(50),\r\n\t\t\t\t\tsociety_id int DEFAULT 0,\r\n\t\t\t\t\tactive BOOL DEFAULT 1,\r\n\t\t\t\t\tPRIMARY KEY(user_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\tif (!$this->userExists($this->config->admin[\"defaultAdmin\"])) $this->addUser($this->config->admin[\"defaultAdmin\"], $this->config->admin[\"defaultPass\"], 'A000000', 1);\r\n\t\t\t\r\n\t\t\t//Society table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `societies` (\r\n\t\t\t\t\tsociety_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\temail varchar(100),\r\n\t\t\t\t\tsociety_name varchar(50),\r\n\t\t\t\t\tPRIMARY KEY(society_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t$sql = \"INSERT IGNORE INTO `societies` (society_id, email, society_name)\r\n\t\t\t\t\tVALUES (1, '[email protected]', 'LSUCS')\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Products table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `products` (\r\n\t\t\t\t\tproduct_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tproduct_name varchar(100),\r\n\t\t\t\t\tprice DECIMAL(10, 2) NOT NULL,\r\n\t\t\t\t\tsociety_id int DEFAULT 0,\r\n\t\t\t\t\tavailable BOOL DEFAULT 1,\r\n\t\t\t\t\tPRIMARY KEY(product_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Receipts table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `receipts` (\r\n\t\t\t\t\treceipt_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\tuser_id int,\r\n\t\t\t\t\tstudent_id varchar(30),\r\n\t\t\t\t\tcust_email varchar(100),\r\n\t\t\t\t\tname varchar(100),\r\n\t\t\t\t\tcomments text,\r\n\t\t\t\t\tproducts varchar(100),\r\n\t\t\t\t\tsociety_id int,\r\n\t\t\t\t\tPRIMARY KEY(receipt_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t\t//Refund table\r\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `refunds` (\r\n\t\t\t\t\trefund_id int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\treceipt_id int,\r\n\t\t\t\t\trefund_amount DECIMAL(10, 2) NOT NULL,\r\n\t\t\t\t\tcomments text,\r\n\t\t\t\t\tPRIMARY KEY(refund_id)\r\n\t\t\t\t\t)\";\r\n\t\t\t$this->query($sql);\r\n\t\t\t\r\n\t\t}", "private function createTable ()\n {\n $db = $this->getDefaultAdapter();\n \n try {\n $db->query(\n 'CREATE TABLE IF NOT EXISTS `acl_role` (\n `acl_role_id` int(11) NOT NULL AUTO_INCREMENT,\n `acl_role_name` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n `acl_role_display` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,\n `acl_role_child` int(11) NOT NULL DEFAULT \\'0\\',\n `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`acl_role_id`)\n ) ENGINE=InnoDB');\n } catch (Exception $e) {\n throw new Zend_Exception($e->getMessage());\n }\n }", "public function createTable() {\n global $database;\n $SQL = \"CREATE TABLE IF NOT EXISTS `\".self::getTableName().\"` ( \".\n \"`trans_id` INT(11) NOT NULL AUTO_INCREMENT, \".\n \"`i18n_id` INT(11) NOT NULL DEFAULT '-1', \".\n \"`trans_language` VARCHAR(2) NOT NULL DEFAULT 'EN', \".\n \"`trans_translation` TEXT, \".\n \"`trans_usage` ENUM('TEXT','MESSAGE','ERROR','HINT','LABEL','BUTTON') NOT NULL DEFAULT 'TEXT', \".\n \"`trans_type` ENUM('REGULAR','CUSTOM') NOT NULL DEFAULT 'REGULAR', \".\n \"`trans_status` ENUM('ACTIVE','BACKUP') NOT NULL DEFAULT 'ACTIVE', \".\n \"`trans_author` VARCHAR(64) NOT NULL DEFAULT '- unknown -', \".\n \"`trans_quality` FLOAT NOT NULL DEFAULT '0', \".\n \"`trans_is_empty` TINYINT NOT NULL DEFAULT '0', \".\n \"`trans_timestamp` TIMESTAMP, \".\"PRIMARY KEY (`trans_id`), KEY (`i18n_id`, `trans_language`)\".\n \" ) ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci\";\n if (null == $database->query($SQL)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $database->get_error()));\n return false;\n }\n return true;\n }", "public function createFromConfig()\n { \n // Begin transation\n $this->pdo->beginTransaction();\n\n // Create tables\n foreach ($this->schema['create'] as $name => $schema) {\n $table = $this->tables[$name];\n $this->pdo->exec($this->getDropTable($table));\n $sql = $this->getCreateTable($table, $schema);\n $this->pdo->exec($sql);\n }\n\n // Commit changes\n $this->pdo->commit();\n }", "protected function migrateTable()\n {\n DB::schema()->create('models', function ($table) {\n $table->id();\n $table->string('default');\n $table->text('input');\n });\n\n Model::create(['default' => 'model', 'input' => ['en' => 'translation', 'nl' => 'vertaling']]);\n }" ]
[ "0.84406036", "0.83542097", "0.82980263", "0.8195946", "0.8002375", "0.7942317", "0.7939871", "0.79369557", "0.7888796", "0.7834099", "0.78016144", "0.77424884", "0.7728628", "0.76959133", "0.7690026", "0.7623613", "0.7524307", "0.7523996", "0.7511739", "0.74675983", "0.7434241", "0.7431567", "0.74188954", "0.73835856", "0.73803556", "0.7378231", "0.73642904", "0.7358136", "0.7333516", "0.7318254", "0.7298891", "0.7278697", "0.7252881", "0.72313803", "0.72308517", "0.7222503", "0.7211611", "0.72100306", "0.7209245", "0.7204923", "0.71858096", "0.7159331", "0.7151743", "0.71448547", "0.71289635", "0.71260715", "0.71231383", "0.71158797", "0.7110764", "0.71064144", "0.7068803", "0.70622593", "0.7046896", "0.70298505", "0.70090866", "0.70014673", "0.69755477", "0.6969289", "0.6967098", "0.69497854", "0.69115365", "0.6870041", "0.6864148", "0.68494284", "0.6845705", "0.6844485", "0.6836687", "0.68174195", "0.68141156", "0.6810405", "0.6787086", "0.67861533", "0.67712337", "0.6769521", "0.67656034", "0.6759897", "0.6753684", "0.6748811", "0.6748811", "0.67356825", "0.67340773", "0.6711959", "0.6707274", "0.67071587", "0.6695786", "0.6683102", "0.66753536", "0.66713125", "0.66655153", "0.6661834", "0.66606224", "0.665315", "0.6652993", "0.66475606", "0.66381353", "0.66300476", "0.6627743", "0.66252106", "0.6624115", "0.66205245", "0.6615846" ]
0.0
-1
Drop tables from db
public static function down(){ DBW::drop('Comment'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function dropDatabaseTables()\n {\n $this->useCamundaDatabase(function() {\n if ($tables = DB::select('SHOW TABLES')) {\n $this->line('Dropping existing database tables...');\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n foreach ($tables as $table) {\n $array = get_object_vars($table);\n Schema::drop($array[key($array)]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\n $this->info('All tables dropped.');\n }\n });\n }", "public function dropAllTables()\n {\n $this->connection->statement($this->grammar->compileDropAllForeignKeys());\n\n $this->connection->statement($this->grammar->compileDropAllTables());\n }", "public function deleteTables()\n {\n $db = Core::$db;\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_forms\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_form_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_templates\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_sets\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholders\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_placeholder_opts\");\n $db->execute();\n\n $db->query(\"DROP TABLE IF EXISTS {PREFIX}module_form_builder_template_set_resources\");\n $db->execute();\n }", "function dropOldTables(Sqlite3 $db)\n{\n\t$drop_script = \"DROP TABLE \";\n\tforeach (['airports', 'carriers', 'statistics', 'statistics_flights', 'statistics_delays', 'statistics_minutes_delayed'] as $table_name) {\n\t //echo \"\\tDropping \" . $table_name . PHP_EOL;\n\t $db->query($drop_script . $table_name);\n\t}\n\t//echo 'Done.' . PHP_EOL;\n}", "public static function dropTables()\n\t{\n\t}", "public function deleteTables()\n {\n Artisan::call('db:wipe');\n Artisan::call('migrate');\n\n }", "public function deleteTables () {\n $this->usersDB->deleteTables();\n $this->categoriesDB->deleteTables();\n $this->itemsDB->deleteTables();\n }", "private function delete_tables()\n {\n global $wpdb;\n\n // this needs to occur at this level, and not in the\n foreach ($this->tables as $tablename) {\n $sql = 'DROP TABLE IF EXISTS ' . $tablename;\n $wpdb->query($sql);\n }\n }", "private static function _dropTables()\n\t{\n\t\tMySQL::query(\"\n\t\t\tSET FOREIGN_KEY_CHECKS = 0;\n\t\t\tSET GROUP_CONCAT_MAX_LEN=32768;\n\t\t\tSET @views = NULL;\n\t\t\tSELECT GROUP_CONCAT('`', TABLE_NAME, '`') INTO @views\n\t\t\t FROM information_schema.views\n\t\t\t WHERE table_schema = (SELECT DATABASE());\n\t\t\tSELECT IFNULL(@views,'dummy') INTO @views;\n\n\t\t\tSET @views = CONCAT('DROP VIEW IF EXISTS ', @views);\n\t\t\tPREPARE stmt FROM @views;\n\t\t\tEXECUTE stmt;\n\t\t\tDEALLOCATE PREPARE stmt;\n\t\t\tSET FOREIGN_KEY_CHECKS = 1;\n\t\t\");\n\t}", "public function dropAllTables()\n {\n $tables = [];\n\n $excludedTables = $this->connection->getConfig('dont_drop') ?? ['spatial_ref_sys'];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array) $row;\n\n $table = reset($row);\n\n if (! in_array($table, $excludedTables)) {\n $tables[] = $table;\n }\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n }", "public function dropAllTables()\n {\n $tables = [];\n\n $excludedTables = $this->connection->getConfig('dont_drop') ?? ['spatial_ref_sys'];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array) $row;\n\n $table = reset($row);\n\n if (! in_array($table, $excludedTables)) {\n $tables[] = $table;\n }\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->connection->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n }", "function drop_all_tables($db)\n{\n $db->query(\"SET foreign_key_checks = 0\");\n\n if ($result = $db->query(\"SHOW TABLES\")) {\n while ($row = $result->fetch_array(MYSQLI_NUM)) {\n $db->query(\"DROP TABLE IF EXISTS \" . $row[0]);\n }\n }\n\n $db->query(\"SET foreign_key_checks = 1\");\n}", "public function dropAllTables()\n {\n $tables = [];\n\n foreach ($this->getAllTables() as $row) {\n $row = (array)$row;\n\n $tables[] = reset($row);\n }\n\n if (empty($tables)) {\n return;\n }\n\n $this->disableForeignKeyConstraints();\n\n $this->getConnection()->statement(\n $this->grammar->compileDropAllTables($tables)\n );\n\n $this->enableForeignKeyConstraints();\n }", "public function actionDrop()\n {\n $dbName = Yii::$app->db->createCommand('SELECT DATABASE()')->queryScalar();\n if ($this->confirm('This will drop all tables of current database [' . $dbName . '].')) {\n Yii::$app->db->createCommand(\"SET foreign_key_checks = 0\")->execute();\n $tables = Yii::$app->db->schema->getTableNames();\n foreach ($tables as $table) {\n $this->stdout('Dropping table ' . $table . PHP_EOL, Console::FG_RED);\n Yii::$app->db->createCommand()->dropTable($table)->execute();\n }\n Yii::$app->db->createCommand(\"SET foreign_key_checks = 1\")->execute();\n }\n }", "public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }", "public function delete_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DROP TABLE '.self::$site_table.';' );\n\t}", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function dropTable()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tblx()->db->createCommand()->dropTable($table);\n\t\t}\n\t}", "protected static function dropTable(): void\n {\n $pdo = static::getDb();\n $pdo->query('DROP TABLE IF EXISTS ' . Store\\MySQL::DEFAULT_TABLE);\n }", "private function dropAndCreateTables(){\n \n $migration = new MikeMigration($this::genPrefix(10));\n $save = 0;\n\n // Prepare Dropped Tables\n if($this->droppedTables){\n $save++;\n foreach($this->droppedTables as $item){\n\n $migration->up(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n $migration->down($this::prepareTableBlueprint($item));\n\n \n // Delete Model\n Storage::disk('models')->delete($this->appNamePath.'/'.$item[\"name\"].'.php');\n // Delete Controller\n Storage::disk('controllers')->delete($this->appNamePath.'/'.$item[\"name\"].'Controller.php');\n // Delete Routes\n //...\n\n }\n }\n // Prepare New Tables \n if($this->newTables){\n $save++;\n foreach($this->newTables as $item){\n\n\n $migration->up($this::prepareTableBlueprint($item));\n\n $migration->down(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n }\n }\n // If Exist Dropped pr New Tables \n if($save > 0){\n $migration->save();\n }\n \n\n\n }", "public function dropAllData()\n {\n $database_name = $this->conn->getDatabase();\n\n $tables = $this->conn->query(\"SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = '$database_name';\")->fetchAll();\n\n $queries = \"SET FOREIGN_KEY_CHECKS=0;\\n\";\n\n foreach ($tables as $aTable){\n $queries .= reset($aTable);\n }\n\n $this->conn->executeQuery($queries);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }", "public function testDrop()\n {\n // make sure all tables were created\n $this->fixture->setup();\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n $this->assertEquals(6, \\count($tables));\n\n // remove all tables\n $this->fixture->drop();\n\n // check that all tables were removed\n $tables = $this->fixture->getDBObject()->fetchList('SHOW TABLES');\n $this->assertEquals(0, \\count($tables));\n }", "public function tearDown()\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users32');\n $this->schema()->drop('usersb');\n $this->schema()->drop('posts');\n $this->schema()->drop('posts32');\n $this->schema()->drop('postsb');\n $this->schema()->drop('rolesb');\n $this->schema()->drop('roles32');\n $this->schema()->drop('user32_role32');\n $this->schema()->drop('userb_roleb');\n }", "public function destroy() {\n $this->connection->schema()->dropTable($this->mapTable);\n $this->connection->schema()->dropTable($this->messageTable);\n }", "function dropTables(Doctrine\\DBAL\\Connection $connection)\n{\n $connection->query('SET FOREIGN_KEY_CHECKS=0');\n foreach ($connection->getSchemaManager()->listTableNames() as $table) {\n $connection->getSchemaManager()->dropTable($table);\n }\n $connection->query('SET FOREIGN_KEY_CHECKS=1');\n}", "public function down() {\n\n\t\t$query = 'DROP TABLE sites;';\n\n\t\ttry {\n\t\t\tself::$pdo->exec( $query );\n\t\t} catch ( PDOException $exception ) {\n\t\t\tEE::error( 'Encountered Error while dropping table: ' . $exception->getMessage(), false );\n\t\t}\n\t}", "abstract protected function dropTableDb(string $table, array $options = []);", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "function dropTable($table);", "public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }", "protected function dropDatabaseTable(): void\n {\n /** @var Connection $connection */\n $connection = $this->container->get(Connection::class);\n\n if (method_exists($connection, 'executeStatement')) {\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=0;');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->executeStatement('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=1;');\n } else {\n $connection->exec('SET FOREIGN_KEY_CHECKS=0;');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->exec('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->exec('SET FOREIGN_KEY_CHECKS=1;');\n }\n }", "private function dropDataTable(Datastore $db)\n {\n $stmt = $db->prepare('DROP TABLE ' . $this->dataTableName());\n $db->execute($stmt);\n }", "public function uninstallDB()\n {\n Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_rulesets`;');\n return Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_templates`;');\n }", "function myplugin_deactivate_dbtables( $tables )\n{\n\tglobal $wpdb;\n\t\n\tforeach ($tables as $table_name => $sql) {\n\n\t\tif ($wpdb->get_var(\"SHOW TABLES LIKE '\".$table_name.\"'\") == $table_name) {\n\n\t\t\t$wpdb->query( \"DROP TABLE \".$table_name.\"\" );\n\t\t}\n\t}\n}", "protected function dropSchemas()\n {\n }", "public static function uninstall() {\n $sql = 'DROP TABLE IF EXISTS `'.self::tableName.'`;';\n db_query($sql);\n }", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "public function afterTearDown()\n {\n $this->schema()->dropIfExists('users');\n $this->schema()->dropIfExists('friends');\n $this->schema()->dropIfExists('posts');\n $this->schema()->dropIfExists('comments');\n $this->schema()->dropIfExists('photos');\n $this->schema()->dropIfExists('invalid_kids');\n $this->schema()->dropIfExists('profiles');\n }", "public static function drop()\n {\n global $wpdb;\n $tableName = static::getTableName($wpdb->prefix);\n\n $sql = \"DROP TABLE IF EXISTS $tableName;\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n $wpdb->query($sql);\n \\delete_option($tableName . '_version');\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'DROP TABLE `stores`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_inventories`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_restocks`;');\n\t\t$db->query(NULL, 'DROP TABLE `user_shops`;');\n\t}", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "private function drop_tables($tables) {\n\t\tforeach ($tables as $table) $this->sql_exec('DROP TABLE IF EXISTS '.UpdraftPlus_Manipulation_Functions::backquote($table), 1, '', false);\n\t}", "public function dropDatabase($name);", "public function clearDb ()\n {\n // Empty tables and reset auto-increment values\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 0');\n foreach (self::$dbTables as $table) {\n $stmt = $this->_dbh->prepare('TRUNCATE `' . $table . '`');\n $stmt->execute();\n $stmt = $this->_dbh->prepare('ALTER TABLE `' . $table . '` AUTO_INCREMENT = 1');\n $stmt->execute();\n }\n // Re-enable checks only if set as such in config\n $config = parse_ini_file('config/AcToBs.ini', true);\n if (isset($config['checks']['fk_constraints']) && $config['checks']['fk_constraints'] == 1) {\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 1');\n }\n // Delete denormalized tables\n foreach (self::$dbDenormalizedTables as $table) {\n $stmt = $this->_dbh->prepare('DROP TABLE IF EXISTS `' . $table . '`');\n $stmt->execute();\n }\n // Delete non-standard taxonomic ranks\n $stmt = $this->_dbh->prepare(\n 'DELETE FROM `taxonomic_rank` WHERE `standard` = ?');\n $stmt->execute(array(\n 0\n ));\n unset($stmt);\n }", "protected function _teardownDb()\n {\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n try {\n Sopha_Db::deleteDb($db, $host, $port);\n } catch (Sopha_Db_Exception $e) {\n if ($e->getCode() != 404) {\n throw $e;\n }\n }\n }", "function cp_delete_db_tables() {\r\n global $wpdb, $app_db_tables;\r\n\r\n echo '<p class=\"info\">';\r\n\r\n foreach ( $app_db_tables as $key => $value ) {\r\n $sql = \"DROP TABLE IF EXISTS \". $wpdb->prefix . $value;\r\n $wpdb->query($sql);\r\n\r\n printf( __(\"Table '%s' has been deleted.\", 'appthemes'), $value);\r\n echo '<br/>';\r\n }\r\n\r\n echo '</p>';\r\n}", "protected function removeTables()\n {\n $this->dropTableIfExists('{{%hubspottoolbox_accesstoken}}');\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t// $db->query(NULL, 'DROP TABLE ... ');\n\t}", "public function down(Kohana_Database $db)\n\t{\n\t\t// $db->query(NULL, 'DROP TABLE ... ');\n\t}", "public function drop()\r\n\t{\r\n\t\t$this->db->drop('users');\r\n\t}", "function deleteDatabase()\n{\n // codes to perform during unistallation\n $free_book_table = $GLOBALS['wpdb']->prefix . 'free_books';\n $sale_book_table = $GLOBALS['wpdb']->prefix . 'sale_books';\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $free_book_table . \"`\");\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $sale_book_table . \"`\");\n}", "protected function tearDown(): void\n {\n $this->schema()->drop('users');\n $this->schema()->drop('users_created_at');\n $this->schema()->drop('users_updated_at');\n }", "public function dropTable()\n {\n try {\n $table = self::$table_name;\n $SQL = <<<EOD\n SET foreign_key_checks = 0;\n DROP TABLE IF EXISTS `$table`;\n SET foreign_key_checks = 1;\nEOD;\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Drop table 'contact_address'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "function dropTables($tableNames) {\n\n $tableNames = (array)$tableNames;\n $db = $this->getDb();\n foreach ($tableNames as $tableName) {\n $db->exec('DROP TABLE IF EXISTS ' . $tableName);\n }\n\n\n }", "public function drop()\n {\n $this->db->command(array('drop'=>$this->name));\n }", "public function uninstallDb()\n {\n return Db::getInstance()->execute('DROP TABLE `' . _DB_PREFIX_ . 'doofinder_updates`')\n && Db::getInstance()->execute('DROP TABLE `' . _DB_PREFIX_ . 'doofinder_landing`');\n }", "public function dropDatabase($name)\r\n {\r\n $sql = <<<SQL\r\nBEGIN\r\n -- user_tables contains also materialized views\r\n FOR I IN (SELECT table_name FROM user_tables WHERE table_name NOT IN (SELECT mview_name FROM user_mviews))\r\n LOOP \r\n EXECUTE IMMEDIATE 'DROP TABLE \"'||I.table_name||'\" CASCADE CONSTRAINTS';\r\n END LOOP;\r\n \r\n FOR I IN (SELECT SEQUENCE_NAME FROM USER_SEQUENCES)\r\n LOOP\r\n EXECUTE IMMEDIATE 'DROP SEQUENCE \"'||I.SEQUENCE_NAME||'\"';\r\n END LOOP;\r\nEND;\r\n\r\nSQL;\r\n\r\n $this->conn->exec($sql);\r\n\r\n if ($this->conn->getAttribute(Doctrine_Core::ATTR_EMULATE_DATABASE)) {\r\n $username = $name;\r\n $this->conn->exec('DROP USER ' . $username . ' CASCADE');\r\n }\r\n }", "public function cleanupDatabase() {\n\t\t\tif ( !$this->getTableExists() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$sQuery = \"\n\t\t\t\tDELETE from `%s`\n\t\t\t\tWHERE\n\t\t\t\t\t`day_id`\t\t\t!= '0'\n\t\t\t\t\tAND `created_at`\t< '%s'\n\t\t\t\";\n\t\t\t$sQuery = sprintf( $sQuery,\n\t\t\t\t$this->getTableName(),\n\t\t\t\t( $this->loadDP()->time() - 31*DAY_IN_SECONDS )\n\t\t\t);\n\t\t\t$this->loadDbProcessor()->doSql( $sQuery );\n\t\t}", "public function safeDown()\n {\n $this->dropTable($this->tableName);\n }", "function caldera_forms_pro_drop_tables(){\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'cf_pro_messages';\n\t$sql = \"DROP TABLE IF EXISTS $table_name\";\n\t$wpdb->query($sql);\n\tdelete_option('cf_pro_db_v');\n}", "protected function _clearSchema()\n {\n\n // Show all tables in the installation.\n foreach (get_db()->query('SHOW TABLES')->fetchAll() as $row) {\n\n // Extract the table name.\n $rv = array_values($row);\n $table = $rv[0];\n\n // If the table is a Neatline table, drop it.\n if (in_array('neatline', explode('_', $table))) {\n $this->db->query(\"DROP TABLE $table\");\n }\n\n }\n\n }", "public function drop_db($dbname) {\n $sql = \"DROP DATABASE \".$dbname;\n try {\n $result = $this->conn->exec($sql);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function dropAllTables()\n {\n throw new LogicException('This database driver does not support dropping all tables.');\n }", "function clear() {\n\n switch ($this->type) {\n case 'sqlite':\n case 'mysql':\n $query[0] = 'DROP TABLE `enrolled`;';\n\n $query[1] = 'DROP TABLE `paid`;';\n\n $query[2] = 'DROP TABLE `admin`;';\n\n $query[3] = 'DROP TABLE `log`';\n\n $query[4] = 'DROP TABLE `stage`';\n\n\t\t\t\t$query[5] = 'DROP TABLE `guest`';\n\n break;\n\n default:\n throw new Exception($this->type . \" is not a valid database type.\");\n break;\n\n }\n\n foreach ($query as $drop) {\n $this->query($drop);\n }\n\n /**\n * Integrity Checking goes here\n */\n\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n {\n //return false;\n $this->dropTable($this->tablePost);\n $this->dropTable($this->tableUser);\n }", "public function dropTable()\n {\n try {\n $table = self::$table_name;\n $SQL = <<<EOD\n SET foreign_key_checks = 0;\n DROP TABLE IF EXISTS `$table`;\n SET foreign_key_checks = 1;\nEOD;\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Drop table 'contact_communication_usage'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public static function truncate()\n {\n include self::dbFile();\n $pdo = self::createPDO($dbuser, $dbpass);\n $pdo->query(\"DROP DATABASE IF EXISTS $dbname\");\n $pdo->query(\"DROP DATABASE IF EXISTS {$dbname}_test\");\n $pdo->query(\"CREATE DATABASE $dbname\");\n $pdo->query(\"CREATE DATABASE {$dbname}_test\");\n }", "public function tearDown() {\r\n global $cfg;\r\n try {\r\n $dbConn = new mysqli(\r\n $cfg['db']['host'],\r\n $cfg['db']['user'],\r\n $cfg['db']['pass'],\r\n $cfg['db']['db']\r\n );\r\n }catch (Exception $e){\r\n throw new Exception(\"connection error\");\r\n }\r\n $sql = \"DROP TABLE `users`\";\r\n //run sql query\r\n $dbConn->query($sql);\r\n }", "function plugin_remove_database() {\n\n global $wpdb;\n\n\n\n $trips_tbl=$wpdb->prefix.'tb_trips_tbl';\n\n $sql_1 = \"DROP TABLE IF EXISTS $trips_tbl\";\n\n\n\n $tb_contacts_tbl=$wpdb->prefix.'tb_contacts_tbl';\n\n $sql_4 = \"DROP TABLE IF EXISTS $tb_contacts_tbl\";\n\n\n\n $tb_booking_tbl=$wpdb->prefix.'tb_booking_tbl';\n\n $sql_5 = \"DROP TABLE IF EXISTS $tb_booking_tbl\";\n\n\n\n\n\n $tb_zoho_crm_auth=$wpdb->prefix.'tb_zoho_crm_auth';\n\n $sql_2 = \"DROP TABLE IF EXISTS $tb_zoho_crm_auth\";\n\n $tb_zoho_books_auth=$wpdb->prefix.'tb_zoho_books_auth';\n\n $sql_3 = \"DROP TABLE IF EXISTS $tb_zoho_books_auth\";\n\n\n\n $wpdb->query($sql_1);\n\n $wpdb->query($sql_4);\n\n $wpdb->query($sql_5);\n\n\n\n $wpdb->query($sql_2);\n\n $wpdb->query($sql_3);\n\n delete_option(\"my_plugin_db_version\");\n\n }", "function truncate_database($db, $excluded_names)\n{\n $excluded_names[] = 'sqlite_sequence';\n $excluded_names[] = 'sqlite_master';\n $excluded_names = array_unique($excluded_names);\n\n $db->exec(\"PRAGMA writable_schema = 1;\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'table' AND name NOT IN ('\" . join(\"', '\", $excluded_names) . \"');\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'index';\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'trigger';\");\n $db->exec(\"PRAGMA writable_schema = 0;\");\n\n $in_transaction = $db->inTransaction();\n if ($in_transaction) {\n $db->commit();\n }\n $db->exec(\"VACUUM\");\n if ($in_transaction) {\n $db->beginTransaction();\n }\n}", "public function dropTable($table) {\n\t\t$this->getDbConnection()->createCommand()->dropTable($table);\n\t}", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function dropDatabase($database);", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"{{rights}}\");\n\t\t}\n\t}", "protected function tearDown(): void\n {\n foreach (['default'] as $connection) {\n $this->schema($connection)->drop('users');\n $this->schema($connection)->drop('friends');\n $this->schema($connection)->drop('posts');\n $this->schema($connection)->drop('photos');\n }\n\n Relation::morphMap([], false);\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'DROP TABLE `services`');\n\t}", "public function clear_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DELETE FROM '.self::$site_table.';' );\n\t}", "public static function unlockTables(){\n\t $statement = App::getDBO()->prepare('UNLOCK TABLES');\n\t\tApp::getDBO()->query();\n\t}", "function dropTable( string $name, PDO $db ) {\n $drop = \"DROP TABLE \".$name;\n try{\n // Preparamos la eliminacion\n $stmt = $db->prepare($drop);\n \n // Ejecutamos\n $stmt->execute();\n }\n\n catch( Exception $exception ){\n echo \"<br>\";\n echo \"Error al eliminar la tabla\".$name.\": \".$exception->getMessage();\n }\n}", "protected function _after()\n {\n $this->_adapter->execute('drop table if exists comments;\n drop table if exists posts_tags;\n drop table if exists posts;\n drop table if exists tags;\n drop table if exists profiles;\n drop table if exists credentials;\n drop table if exists people;\n ');\n parent::_after();\n }", "public function unlockTables(): void\n {\n $sql = 'unlock tables';\n\n $this->executeNone($sql);\n }", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "public function uninstall() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->deleteTable();\r\n\t}\r\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t $db->query(NULL, 'DROP TABLE `user_shops` ');\n\t}", "protected function tearDown() {\n try {\n if ($this->dbh != null) {\n if (!$this->dbh->query('DROP TABLE users')) {\n $this->fail('Couldn\\'t teardown db. Query didn\\'t succeed');\n }\n }\n } catch (PDOException $ex) {\n $this->fail('Couldn\\'t teardown db ('. $ex->getMessage() .')');\n }\n }", "public function deleteOldTables() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"DROP TABLE tblfees, tbltimetable\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows_affected() > 0) {\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t}", "public function dropTestTable()\n {\n try {\n $this->_db->query('DROP TABLE IF EXISTS galette_test');\n Analog::log('Test table successfully dropped.', Analog::DEBUG);\n } catch (\\Exception $e) {\n Analog::log(\n 'Cannot drop test table! ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function dropTable($table)\n {\n $this->db->createCommand()->dropTable($table)->execute();\n }", "public function dropSchema()\n {\n Schema::drop($this->table);\n }", "function uninstall() {\n SQLExec('DROP TABLE IF EXISTS lagartoservers');\n SQLExec('DROP TABLE IF EXISTS lagartoendpoints');\n parent::uninstall();\n }", "public function dropSchemaCommand()\n {\n $this->outputLine('<error>Warning</error>');\n $this->outputLine('You are about to drop all Event Store related tables in database \"%s\" on host %s.', [ $this->configuration['backendOptions']['dbname'], $this->configuration['backendOptions']['host']]);\n if (!$this->output->askConfirmation('Are you sure? ', false)) {\n $this->outputLine('Aborted.');\n $this->quit(0);\n }\n\n try {\n $connection = $this->connectionFactory->get();\n\n $schema = $connection->getSchemaManager()->createSchema();\n $toSchema = clone $schema;\n\n if ($schema->hasTable($this->connectionFactory->getStreamTableName())) {\n EventStoreSchema::drop($toSchema, $this->connectionFactory->getStreamTableName());\n }\n\n $connection->beginTransaction();\n $statements = $schema->getMigrateToSql($toSchema, $connection->getDatabasePlatform());\n foreach ($statements as $statement) {\n $this->outputLine('<info>++</info> %s', [$statement]);\n $connection->exec($statement);\n }\n $connection->commit();\n\n $this->outputLine();\n } catch (ConnectionException $exception) {\n $this->outputLine('<error>Connection failed</error>');\n $this->outputLine('%s', [ $exception->getMessage() ]);\n $this->quit(1);\n }\n }", "protected function removeTables() {\n while(!empty($this->_tableDeleteQueue)) {\n $deleted = array();\n foreach($this->_tableDeleteQueue as $table => $fields) {\n $this->removeTable($table);\n // if the error code is 00000, the execution of the sql was successful\n // and the table was deleted\n // if it's not 00000, try to delete this table in the next round\n if($this->errorCode() === \"00000\") {\n $deleted[] = $table;\n }\n }\n foreach($deleted as $deletedTable) {\n unset($this->_tableDeleteQueue[$deletedTable]);\n }\n }\n $this->_tableDeleteQueue = array();\n }", "public function wp_clean_sql()\n\t{\n\t\t$bdd = Bdd::getInstance();\n\n\t\t$sql = $bdd->dbh->prepare(\"SHOW TABLES LIKE '\".$this->_table_prefix.\"%'\");\n\t\t$sql->execute();\n\t\t$tables = $sql->fetchAll();\n\n\t\tforeach ($tables as $table)\t{\n\t\t\t$table_name = $table[0];\n\n\t\t\t// To rename the table\n\t\t\t$sql1 = $bdd->dbh->prepare(\"DROP TABLE `{$table_name}`\");\n\t\t\t$sql1->execute();\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public static function down()\n {\n Schema::dropIfExists(static::getTableName());\n }", "public function drop_table($tablename, $flag = false) {\n if ($flag) {\n $sql = \"DROP TABLE \".$tablename;\n try {\n $result = $this->conn->query($sql);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }\n }" ]
[ "0.8187412", "0.7894082", "0.77647614", "0.77567846", "0.77298355", "0.7666467", "0.75771344", "0.7574214", "0.756225", "0.7547076", "0.7547076", "0.7537164", "0.74000776", "0.7391763", "0.7391623", "0.7367011", "0.73607683", "0.73594075", "0.72993624", "0.7298619", "0.7261481", "0.7257661", "0.7253473", "0.7209806", "0.720596", "0.7148875", "0.7125662", "0.7121695", "0.7095739", "0.70850635", "0.70557487", "0.70177466", "0.7009795", "0.69881034", "0.6970294", "0.6968572", "0.6967671", "0.6965691", "0.6954551", "0.6925065", "0.6924049", "0.69044393", "0.6904359", "0.6897585", "0.68873525", "0.68621045", "0.6858259", "0.6846538", "0.6842415", "0.6830904", "0.6830904", "0.683089", "0.68260723", "0.68216497", "0.67975485", "0.6796181", "0.6788176", "0.67791873", "0.676873", "0.6766755", "0.67633575", "0.6762736", "0.6762574", "0.6759595", "0.6757289", "0.6751035", "0.67508143", "0.67508143", "0.67508143", "0.67492783", "0.6734998", "0.67161113", "0.6716075", "0.6711282", "0.66911596", "0.6688126", "0.6683195", "0.66775537", "0.6675112", "0.6674204", "0.6662434", "0.6661473", "0.66404355", "0.6637224", "0.66285783", "0.6606588", "0.65968776", "0.6593223", "0.6580599", "0.6575847", "0.65691286", "0.65611994", "0.6560286", "0.6559742", "0.65577585", "0.6547446", "0.6541619", "0.6524599", "0.65103024", "0.6504776", "0.64954793" ]
0.0
-1
hoja de vida admnin en la sede
function Inhabilitarq_admin1(){ require '../../conexion.php'; $cate=date('Y-m-d'); echo $consultar_nivel= "UPDATE `administradores` SET `INHABILITADO` = '1',`decreto_traslado` = '".$_POST['u']."', `fecha_traslado` = '".$cate."' WHERE `administradores`.`ID_ADMIN` = ".$_POST['io'].""; $consultar_nivel1=$conexion->prepare($consultar_nivel); $consultar_nivel1->execute(array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valorpasaje();", "function cc_ho_vetrina($agenzia, $rif){\n\tglobal $invetrina;\n\t\n\t// $agenzia qua è il numero interno di Cometa\n\tif( isset( $invetrina[$agenzia] ) ){\t\t\n\t\t\n\t\tif ($invetrina[$agenzia]['imm'] == $rif) {\n\t\t\t// questo immobile è in vetrina\n\t\t\t$vetrina = '1';\n\t\t\tcc_import_immobili_error_log($rif.\" è in vetrina\");\n\t\t\t\n\t\t\t// vediamo se è lo stesso di quello che era già in vetrina o meno\n\t\t\t$oldrif = cc_get_rif_vetrina( substr($rif, 0, 2) );\n\t\t\tcc_import_immobili_error_log(\"oldrif: \".$oldrif);\n\t\t\t\n\t\t\t// se l'immobile attualemnte in vetrina non è questo tolgo quello attuale da vetrina\n\t\t\tif($oldrif != $rif) {\n\t\t\t\tcc_updateVetrina($oldrif); \n\t\t\t\tcc_import_immobili_error_log(\"Tolgo vetrina da \".$oldrif);\n\t\t\t}\n\t\t}else{\n\t\t\t$vetrina = '0';\n\t\t}\t\t\n\t\n\t}else{\n\t\t$vetrina = '0';\n\t}\n\t\n\treturn $vetrina;\n}", "function evt__1__entrada()\r\n\t{\r\n\t\t$this->pasadas_por_solapa[1]++;\r\n\t}", "public function verificaAppartenenza(){\n \n $sess_user=$this->session->get_userdata('LOGGEDIN');\n $this->utente=$sess_user[\"LOGGEDIN\"][\"userid\"];\n if(isset($sess_user[\"LOGGEDIN\"][\"business\"])){\n \n $this->azienda=$sess_user[\"LOGGEDIN\"][\"business\"];\n \n \n }\n \n \n }", "public function extra_voor_verp()\n\t{\n\t}", "public function traerCualquiera()\n {\n }", "protected function setVida() {\n $this->vida = 200;\n }", "public function pasaje_abonado();", "function AsignarVacacion(){\n\t $this->procedimiento='asis.ft_vacacion_sel';\n\t\t$this->transaccion='ASIS_ASIGVAC_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\n\t\t$this->setCount(false); \n\t\t\n\t\t$this->tipo_conexion='seguridad';\n\t\t\n\t\t$this->arreglo=array(\"id_usuario\" =>1,\n\t\t\t\t\t\t\t \"tipo\"=>'TODOS'\n\t\t\t\t\t\t\t );\n\t\t\n\t\t$this->setParametro('id_usuario','id_usuario','int4');\t\t\t\t\t\t \n $this->captura('dias_asignados','int4');\n\n\t //Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//echo (\"entro al cron modelo vacacion juan \".$this->consulta.' fin juan');\n\t\t//exit;\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function motivoDeAnulacionAsig(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNAS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function VerIVA()\r\n {\r\n\t\r\n\t$reg=mysql_query(\"SELECT Valor FROM impret WHERE Nombre='IVA'\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n\t$reg=mysql_fetch_array($reg);\t\r\n\t$impuesto=$reg[\"Valor\"];\r\n\treturn($impuesto);\r\n\t}", "public function estVivant(){\n\n }", "public function verlinealista(){\n\t$resultado=$this->producto->verlinealista();\n return $resultado;\n\t\t\t\n\t\t}", "public function veriCode() {}", "function hitungDenda(){\n\n return 0;\n }", "public function avancer($vitesse) {\n $this->vitesse = $vitesse;\n\n return \"la voiture roule à \" .$this->vitesse.\"km/h\";\n}", "public function AggiornaPrezzi(){\n\t}", "function SuoritaLisaysToimet(){\n /*Otetaan puuhaId piilotetustaKentasta*/\n $puuhaid = $_POST['puuha_id'];\n \n /* Hae puuhan tiedot */\n $puuha = Puuhat::EtsiPuuha($puuhaid);\n $suositus=luoSuositus($puuhaid,null);\n \n /*Tarkistetaan oliko suosituksessa virheita*/\n if(OlioOnVirheeton($suositus)){\n LisaaSuositus($suositus,$puuhaid);\n header('Location: puuhanTiedotK.php?puuhanid=' . $puuhaid . '.php');\n } else {\n $virheet = $suositus->getVirheet();\n naytaNakymaSuosituksenKirjoitusSivulle($puuha, $suositus, $virheet, \"Lisays\");\n }\n}", "function verifica_caja_virtual($acceso,$id_pd=''){\n\t$ini_u = 'AA';\n\t$fecha= date(\"Y-m-d\");\n\t$id_caja='BB001';\n\t$id_persona='BB00000001';\n\t$id_est='BB001';\n\t$apertura_caja=date(\"H:i:s\");\n\t$status_caja='ABIRTA';\n\t$acceso->objeto->ejecutarSql(\" select id_caja_cob from caja_cobrador where fecha_caja='$fecha' and id_caja='$id_caja' and id_persona='$id_persona' and id_est='$id_est'\");\n\tif($row=row($acceso)){\n\t\t$id_caja_cob=trim($row[\"id_caja_cob\"]);\n\t}else{\n\t\t$acceso->objeto->ejecutarSql(\"select * from caja_cobrador where (id_caja_cob ILIKE '$ini_u%') ORDER BY id_caja_cob desc\"); \n\t\t$id_caja_cob = $ini_u.verCodLong($acceso,\"id_caja_cob\");\n\n\t\t$acceso->objeto->ejecutarSql(\"insert into caja_cobrador(id_caja_cob,id_caja,id_persona,fecha_caja,apertura_caja,status_caja,id_est,fecha_sugerida) values ('$id_caja_cob','$id_caja','$id_persona','$fecha','$apertura_caja','$status_caja','$id_est','$fecha')\");\n\t\t$acceso->objeto->ejecutarSql(\"Update caja Set status_caja='Abierta' Where id_caja='$id_caja'\");\n\t}\n\treturn $id_caja_cob;\n}", "public function avisoSubirAcuerdoDeAdhesion()\n {\n if (!Auth::user()->firmacorrecta) {\n $fecha = Carbon::now()->format('Y-m-d');\n $codigo = 'WIMPDADH';\n $aviso = 'Por favor, Ud. debe hacernos llegar el documento de acuerdo de adhesión que en\n su día le fue remitido por esta AMPA. Dicho documento deberá estar firmado por Ud.';\n $solucion = 'Realice una de las siguientes acciones: a) Imprímalo, fírmelo y escanéelo\n en formato pdf y súbalo a esta aplicación. Si desea optar por esta solución abra el\n desplegable con su nombre en la parte superior de la página y acceda a su perfil donde\n encontrará la opción correspondiente. b) imprímalo, fírmelo y deposítelo en nuestro\n buzón. c) imprímalo, fírmelo y entréguelo personalmente en nuestro despacho sito en la\n planta superior sobre la secretaría del colegio. d) Acuda a nuestro despacho y firme la\n copia de su documento que obra en nuestro poder.';\n $user_id = Auth::user()->id;\n\n return $this->avisos->crearAviso($codigo, $fecha, $aviso, $solucion, $user_id);\n }\n }", "private function verrouPoser(){\n\t\t$verrou['etat'] = '';\n\t\tself::verrouSupprimer();\n\t\tif($this->formulaire['cle'] != ''){\n\t\t\t$verrou = self::verrouRechercher();\n\t\t\tif(empty($verrou)){\n\t\t\t\t$verrou = self::verrouInserer();\n\t\t\t\t$verrou['etat'] = 'ok';\n\t\t\t}else{\n\t\t\t\t$verrou['etat'] = 'nok';\n\t\t\t\t$verrou['message'] = \"L'enregistrement \".$verrou['ad_ve_cle'].\" est actuellement verrouillé par \".$verrou['ad_ve_nom'].\" depuis le \".$verrou['ad_ve_date'].\".\\nLes modifications, enregistrement et suppression sont donc impossibles sur cet enregistrement.\";\n\t\t\t}//end if\n\t\t}//end if\n\t\treturn $verrou;\n\t}", "function recuperarGanadores(){\n\t\t$votopro = new VotaProfesional();\n\t\t$res = $votopro->recuperarGanadores();\n\t\treturn $res;\n\t}", "function motivoDeAnulacionDesin(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }", "public function aprova()\n {\n $this -> estadoAtual -> aprova($this);\n }", "function verMas()\t\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $use;\r\n\t\t\tglobal $priv;\r\n\r\n\t\t\t//NOTA: Para ver si funciona tienen que asociarle un adherente en la tabla socios, ya que en los datos de ejemplo todos son titulares\r\n\t\t\t//NOTA: Lo que hice fue: en tabla socios en numero_soc=00044 cambiar el campo soc_titula de manera que quede soc_titula=00277\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t$numero_socio = $_GET['num_soc']; //Es el número del socio titular que debe ser tomado del PASO 1\r\n\t\t\t\r\n\r\n\t\t\t\t$resultadoTitular = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t\t\t\t\t\t FROM socios,persona \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\");\r\n\t\t\t\t\t\t\t\t\t \r\n\r\n\t\t\tif(!$resultadoTitular)\r\n\t\t\t{\r\n\t\t\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"verMas\",\r\n\t\t\t\t'descripcion'\t=>\"No se encuentra al titular $numero_socio\"\r\n\t\t\t\t];\r\n\t\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t///---FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$fecha=$resultadoTitular[0]['fecnacim'];\r\n\t\t\t$dias = explode(\"-\", $fecha, 3);\r\n\t\t\t\r\n\t\t\t// $dias[0] es el año\r\n\t\t\t// $dias[1] es el mes\r\n\t\t\t// $dias[2] es el dia\r\n\t\t\t\r\n\t\t\t// mktime toma los datos en el orden (0,0,0, mes, dia, año) \r\n\t\t\t$dias = mktime(0,0,0,$dias[1],$dias[2],$dias[0]);\r\n\t\t\t$edad = (int)((time()-$dias)/31556926 );\r\n\t\t\t$resultadoTitular[0]['edad']=$edad;\r\n\t\t\t\r\n\t\t\t///---FIN FUNCIÓN PARA CALCULAR EDAD----\r\n\t\t\t\r\n\t\t\t$estado[0]='1';\r\n\t\t\t$estado[1]='1';\r\n\t\t\t$estado[2]='1';\r\n\t\t\t$estado[3]='1';\r\n\t\t\t$estado[4]='1';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS SERVICIOS DEL ASOCIADO TITULAR----------------\r\n\t\t\t\r\n\t\t\t//Por cuota\r\n\t\t\t$resultadoTitularServicios1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\tif(!$resultadoTitularServicios1)\r\n\t\t\t\t$estado[0]='0';\r\n\t\t\t\r\n\t\t\t//Por tarjeta\r\n\t\t\t$resultadoTitularServicios2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n AND socios.numero_soc= socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.soc_titula \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoTitularServicios2)\r\n\t\t\t\t$estado[1]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR CUOTA----------------\r\n\t\t\t\r\n\r\n\t\t $resultadoAdherentes1 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,fme_adhsrv.codigo,fme_adhsrv.parentesco,fme_adhsrv.periodoini,fme_adhsrv.periodofin,fme_adhsrv.motivobaja,fme_adhsrv.documento\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.idmutual \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,fme_adhsrv,tar_srv \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND fme_adhsrv.codigo = tar_srv.idmutual\");\r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes1)\r\n\t\t\t\t$estado[2]='0';\r\n\t\t\t\r\n\t\t\t//---------------CONSULTA QUE DEVUELVE TODA LA INFO DE LOS ADHERENTES DEL ASOCIADO TITULAR CON APORTES POR TARJETA----------------\r\n\r\n\t\t\t$resultadoAdherentes2 = $GLOBALS['db']->select(\"SELECT socios.id_persona,socios.numero_soc,socios.beneficio,socios.fec_alt,socios.fec_baja,socios.lugar_pago,socios.soc_titula\r\n\t\t\t\t,persona.id_persona,persona.nombre,persona.numdoc,persona.cuil,persona.sexo,persona.fecnacim,persona.domicilio,persona.casa_nro,persona.barrio,persona.localidad,persona.codpostal\r\n\t\t\t\t,persona.dpmto,persona.tel_fijo,persona.tel_cel,persona.fec_alta AS fec_alta2,persona.fec_baja AS fec_baja2,persona.cbu,persona.banco,persona.usualta\r\n\t\t\t\t,tar_srv.nombre AS nombreplan,tar_srv.codigo AS codigotarsrv, tar_srvadherentes.codigo, tar_srvadherentes.parentesco \r\n\t\t\t\t\t\t\t\t\t FROM socios,persona,tar_srv, tar_srvadherentes \r\n\t\t\t\t\t\t\t\t\t WHERE socios.soc_titula = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t AND socios.numero_soc != socios.soc_titula\r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.socnumero = socios.numero_soc \r\n\t\t\t\t\t\t\t\t\t AND tar_srvadherentes.codigo = tar_srv.codigo\");\t\r\n\r\n\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\r\n\t\t\tif(!$resultadoAdherentes2)\r\n\t\t\t\t$estado[3]='0';\r\n\t\t\r\n\t\t \r\n\t\t\t//---------------CONSULTA QUE DEVUELVE EL LISTADO DE TODAS LAS ASISTENCIAS----------------\r\n\t\t\t\r\n\t\t\t//NOTA: Para que puedan ver si funciona o no hacer la prueba con el siguiente ejemplo:\r\n\t\t\t// En la tabla fme_asistencia modifiquen en cualquier lado y pongan alguno con doctitu = 06948018 (o busquen cualquier DNI de un socio titular y usen ese)\r\n\t\t\t// Cuando prueben el sistema vayan al ver más de Barrionuevo Samuel y van a ver el listado de atenciones que tiene asociado\r\n\t\t\t\r\n\t\t\t$asistencias = $GLOBALS['db']->select(\"SELECT fme_asistencia.doctitu, fme_asistencia.numdoc, fme_asistencia.nombre,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.fec_pedido, fme_asistencia.hora_pedido, fme_asistencia.dessit, fme_asistencia.fec_ate,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.sintomas, fme_asistencia.diagnostico, fme_asistencia.tratamiento, fme_asistencia.hora_aten,\r\n\t\t\t\t\t\t\t\t\t fme_asistencia.profesional\r\n\t\t\t\t\t\t\t\t\t FROM fme_asistencia, socios, persona \r\n\t\t\t\t\t\t\t\t\t WHERE soc_titula = '$numero_socio' \r\n\t\t\t\t\t\t\t\t\t AND socios.id_persona = persona.id_persona\r\n\t\t\t\t\t\t\t\t\t AND numero_soc = soc_titula\r\n\t\t\t\t\t\t\t\t\t AND persona.numdoc = fme_asistencia.doctitu\");\r\n\t\t\t\r\n\t\t\tif(!$asistencias)\r\n\t\t\t\t$estado[4]='0';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/perfil.html', compact('resultadoTitular', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios1', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoTitularServicios2', \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'resultadoAdherentes2',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'asistencias',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'estado','use','priv'));\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "function motivoDeAnulacionDev(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDV' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "public function ver($id) \n {\n $qry_terminos = $this->M_politicas->obtener_terminos($id);\n if($qry_terminos->num_rows() > 0)\n {\n $terminos = $qry_terminos->row();\n $this->data['acc'] = CONSULTAR;\n $this->data['politicas'] = $terminos; \n $this->_vista('comun');\n }\n else\n {\n echo false;\n }\n }", "function afaire_avancement_jalon($jalon='') {\n\t$valeur = 0;\n\t// Nombre total de afaire pour le jalon\n\t$select = array('t1.id_ticket');\n\t$from = array('spip_afaire AS t1');\n\t$where = array('t1.jalon='.sql_quote($jalon));\n\t$result = sql_select($select, $from, $where);\n\t$n1 = sql_count($result);\n\t// Nombre de afaire termines pour le jalon\n\tif ($n1 != 0) {\n\t\t$where = array_merge($where, array(sql_in('t1.statut', array('resolu','ferme'))));\n\t\t$result = sql_select($select, $from, $where);\n\t\t$n2 = sql_count($result);\n\t\t$valeur = floor($n2*100/$n1);\n\t}\n\treturn $valeur;\n}", "function verifVadsAuthResult($data) {\n \n switch ($data) {\n\n case \"03\":\n return '<p style=\"margin-top:1px;\">Accepteur invalide - Ce code est émis par la banque du marchand.</p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">(ex: contrat clos, mauvais code MCC déclaré, etc..).</p>';\n break;\n \n case \"00\":\n return '<p style=\"margin-top:1px;color:green;\"><b>Transaction approuvée ou traitée avec succès</b></p>';\n break;\n\n case \"05\":\n return '<p style=\"margin-top:1px;color:red;\">Ne pas honorer - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">Date d’expiration invalide, CVV invalide, crédit dépassé, solde insuffisant (etc.)</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"51\":\n return '<p style=\"margin-top:1px;color:red;\">Provision insuffisante ou crédit dépassé</p>\n <p style=\"margin-top:1px;color:red;\">Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu si l’acheteur ne dispose pas d’un solde suffisant pour réaliser son achat.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"56\":\n return '<p style=\"margin-top:1px;color:red;\">Carte absente du fichier - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Le numéro de carte saisi est erroné ou le couple numéro de carte + date d\\'expiration n\\'existe pas..</p>';\n break;\n \n case \"57\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">L’acheteur tente d’effectuer un paiement sur internet avec une carte de retrait.</p>\n <p style=\"margin-top:1px;color:red;\">Le plafond d’autorisation de la carte est dépassé.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"59\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général suite à une saisie répétée de CVV ou de date d’expiration erronée.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"60\":\n return '<p style=\"margin-top:1px;\">L’accepteur de carte doit contacter l’acquéreur</p>\n <p style=\"margin-top:1px;\">Ce code est émis par la banque du marchand. </p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">Il est émis en général lorsque le contrat commerçant ne correspond pas au canal de vente utilisé.</p>\n <p style=\"margin-top:1px;\">(ex : une transaction e-commerce avec un contrat VAD-saisie manuelle).</p>\n <p style=\"margin-top:1px;\">Contactez le service client pour régulariser la situation.</p>';\n break;\n \n case \"07\":\n return '<p style=\"margin-top:1px;\">Conserver la carte, conditions spéciales</p>';\n break;\n \n case \"08\":\n return '<p style=\"margin-top:1px;\">Approuver après identification</p>';\n break;\n \n case \"12\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction invalide</p>';\n break;\n \n case \"13\":\n return '<p style=\"margin-top:1px;color:red;\">Montant invalide</p>';\n break;\n \n case \"14\":\n return '<p style=\"margin-top:1px;color:red;\">Numéro de porteur invalide</p>';\n break;\n \n case \"15\":\n return '<p style=\"margin-top:1px;color:red;\">Emetteur de carte inconnu</p>';\n break;\n \n case \"17\":\n return '<p style=\"margin-top:1px;color:red;\">Annulation acheteur</p>';\n break;\n \n case \"19\":\n return '<p style=\"margin-top:1px;\">Répéter la transaction ultérieurement</p>';\n break;\n \n case \"20\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse erronée (erreur dans le domaine serveur)</p>';\n break;\n \n case \"24\":\n return '<p style=\"margin-top:1px;\">Mise à jour de fichier non supportée</p>';\n break;\n \n case \"25\":\n return '<p style=\"margin-top:1px;\">Impossible de localiser l’enregistrement dans le fichier</p>';\n break;\n \n case \"26\":\n return '<p style=\"margin-top:1px;\">Enregistrement dupliqué, ancien enregistrement remplacé</p>';\n break;\n \n case \"27\":\n return '<p style=\"margin-top:1px;\">Erreur en « edit » sur champ de liste à jour fichier</p>';\n break;\n \n case \"28\":\n return '<p style=\"margin-top:1px;\">Accès interdit au fichier</p>';\n break;\n \n case \"29\":\n return '<p style=\"margin-top:1px;\">Mise à jour impossible</p>';\n break;\n \n case \"30\":\n return '<p style=\"margin-top:1px;\">Erreur de format</p>';\n break;\n \n case \"31\":\n return '<p style=\"margin-top:1px;color:red;\">Identifiant de l’organisme acquéreur inconnu</p>';\n break;\n \n case \"33\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"34\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude</p>';\n break;\n \n case \"38\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"41\":\n return '<p style=\"margin-top:1px;color:red;\">Carte perdue</p>';\n break;\n \n case \"43\":\n return '<p style=\"margin-top:1px;color:red;\">Carte volée</p>';\n break;\n \n case \"54\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"55\":\n return '<p style=\"margin-top:1px;color:red;\">Code confidentiel erroné</p>';\n break;\n \n case \"58\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur</p>';\n break;\n \n case \"61\":\n return '<p style=\"margin-top:1px;color:red;\">Montant de retrait hors limite</p>';\n break;\n \n case \"63\":\n return '<p style=\"margin-top:1px;color:red;\">Règles de sécurité non respectées</p>';\n break;\n \n case \"68\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse non parvenue ou reçue trop tard</p>';\n break;\n \n case \"75\":\n return '<p style=\"margin-top:1px;color:red;\">Nombre d’essais code confidentiel dépassé</p>';\n break;\n \n case \"76\":\n return '<p style=\"margin-top:1px;color:red;\">Porteur déjà en opposition, ancien enregistrement conservé</p>';\n break;\n \n case \"90\":\n return '<p style=\"margin-top:1px;color:red;\">Arrêt momentané du système</p>';\n break;\n \n case \"91\":\n return '<p style=\"margin-top:1px;color:red;\">Émetteur de cartes inaccessible</p>';\n break;\n \n case \"94\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction dupliquée</p>';\n break;\n \n case \"96\":\n return '<p style=\"margin-top:1px;color:red;\">Mauvais fonctionnement du système</p>';\n break;\n \n case \"97\":\n return '<p style=\"margin-top:1px;color:red;\">Échéance de la temporisation de surveillance globale</p>';\n break;\n \n case \"98\":\n return '<p style=\"margin-top:1px;color:red;\">Serveur indisponible routage réseau demandé à nouveau</p>';\n break;\n \n case \"99\":\n return '<p style=\"margin-top:1px;color:red;\">Incident domaine initiateur</p>';\n break;\n\n case \"ERRORTYPE\":\n return '<p style=\"margin-top:1px;\">Erreur verifVadsOperationType() type non défini.</p>';\n break;\n\n default;\n return 'Erreur '.$data;\n break;\n\n }\n\n }", "function actualizarEstadisticaV(){\n\t\t\t$sql=\"UPDATE estadistica SET votovalido = votovalido+1,\nvotototal = votototal+1 where idestaditica=(Select max(idestaditica) from estadistica);\";\n\t\t\treturn $sql;\n\t\t}", "function procesar_vinculo ($datos){\n $hora_inicio=$this->s__aula_disponible['hora_inicio'];\n $hora_inicio_datos=\"{$datos['hora_inicio']}:00\";\n $hora_fin=$this->s__aula_disponible['hora_fin'];\n $hora_fin_datos=\"{$datos['hora_fin']}:00\";\n \n if(($hora_inicio_datos < $hora_fin_datos) && (($hora_inicio_datos >= $hora_inicio) && ($hora_inicio_datos <= $hora_fin)) && ($hora_fin_datos <= $hora_fin)){\n $this->procesar_carga($datos);\n $this->s__accion=\"Nop\";\n }\n else{\n $mensaje=\" El horario especificado no pertenece al rango disponible : $hora_inicio y $hora_fin hs \";\n toba::notificacion()->agregar($mensaje);\n }\n }", "public function smanjiCenu(){\n if($this->getGodiste() < 2010){\n $discount=$this->cenapolovnogauta*0.7;\n return $this->cenapolovnogauta=$discount;\n }\n return $this->cenapolovnogauta; \n }", "public function obtenerViajesplusAbonados();", "private static function setHorarioDeVerao() {\n $dataJunta = self::getAnoAtual() . self::getMesAtual() . self::getDiaAtual();\n //self::$horario_de_verao = ($dataJunta > '20121021' && $dataJunta < '20130217' ) ? true : false;\n self::$horario_de_verao = (date('I') == \"1\") ? true : false;\n return self::getHorarioDeVerao();\n }", "function InscricaoAvaliacao($codAtividade, $codAluno){\n\n }", "function verifVentePro($ar){\n $mess = XModEpassLibreWd::verifVentePro($ar);\n XShell::setNext($this->getMainAction());\n setSessionVar('message', $mess);\n }", "public function dajStatusSvomPredvidjanju()\n {\n $korisnik=$this->session->get(\"korisnik\");\n $idPred=$_COOKIE['idTek'];\n setcookie(\"idTek\", \"\", time() - 3600);\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanje=$predvidjanjeModel->dohvati_predvidjanja_id($idPred);\n $danas=date(\"Y-m-d H:i:s\");\n //moze da se podeli u tri ifa, radi lepseg ispisa, ali ovde mislim da su svi slucajevi\n if ($danas<$predvidjanje->DatumEvaluacije || $predvidjanje->Status!=\"CEKA\" || $korisnik->IdK!=$predvidjanje->IdK)//ne sme jos da mu daje status\n {\n echo \"GRESKA\";\n return;\n }\n $statusV=$this->request->getVar(\"dane\");\n if($statusV=='DA') $status=\"ISPUNJENO\";\n else $status=\"NEISPUNJENO\";\n $predvidjanjeModel->postavi_status($predvidjanje, $status);\n if ($status==\"ISPUNJENO\")\n {\n $korisnikModel=new KorisnikModel();\n $korisnikModel->uvecaj_skor($korisnik, $predvidjanje->Tezina);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n \n }", "public function contarInventario(){\n\t}", "public function uputstvo()\n {\n $this->prikaz(\"uputstvo\", []);\n }", "function venta($mysqli,$fecha,$ref,$monto16,$monto0,$iva,$tipo,$factu,$cte){\n\t\t//en todos los casos\n\t\t$table='diario';\n\t\t$tmonto=$monto16+$monto0;\n\t\t$montof=$tmonto+$iva;\n\t\t//inicializa variable resultados\n\t\t\t//calculo del costo de ventas\n\t\t $costoc=$mysqli->query(\"SELECT SUM(haber)FROM inventario WHERE tipomov = 2 AND idoc= $ref\");\n\t\t\t$row=mysqli_fetch_row($costoc);\n\t\t\t$costo=$row[0];\n\t\t\t$costoc->close();\t\n\t\t\t//si existe el costo de ventas?\n\t\t\tif($costo!=''){\n\t\t\t\ttry {\n\t\t\t\t\t$mysqli->autocommit(false);\n\t\t\t\t\t//abono a inventario 115.01\n\t\t\t\t\t$abono=\"115.01\";\n\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//cargo a costo de ventas 501.01\n\t\t\t\t\t$cargo=\"501.01\";\n\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$costo,$fecha,$factu);\n\t\t\t\t\t//abono a ventas segun tasa\n\t\t\t\t\t//ventas tasa general \n\t\t\t\t\t\t$abono=\"401.01\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto16,$fecha,$factu,$cte);\n\t\t\t\t\t//ventas tasa 0 \n\t\t\t\t\t\t$abono=\"401.04\";\n\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$monto0,$fecha,$factu,$cte);\n\t\t\t\t\t//movimientos por tipo de venta\n\t\t\t\t\t\tswitch($tipo){\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t//contado x ahora igual a anterior, luego se manda al cobro\n\t\t\t\t\t\t\t\t//mostrador- cargo a caja y efectivo 101.01\n\t\t\t\t\t\t\t\t$cargo=\"101.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu);\n\t\t\t\t\t\t\t\t//iva trasladado cobrado 208.01\n\t\t\t\t\t\t\t\t$abono=\"208.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t//credito cargo a clientes\n\t\t\t\t\t\t\t\t$cargo=\"105.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$cargo,1,0,$ref,$montof,$fecha,$factu,$cte);\n\t\t\t\t\t\t\t\t//iva trasladado no cobrado 209.01\n\t\t\t\t\t\t\t\t$abono=\"209.01\";\n\t\t\t\t\t\t\t\toperdiario($mysqli,$abono,1,1,$ref,$iva,$fecha,$factu);\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//efectuar la operacion\n\t\t\t\t\t$mysqli->commit();\n\t\t\t\t $resul=0;\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//error en las operaciones de bd\n\t\t\t\t $mysqli->rollback();\n\t\t\t\t \t$resul=-2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//no hay costo de ventas\n\t\t\t\t$resul=-1;\n\t\t\t}\n\t\t\n\t\t return $resul;\n}", "public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}", "public function checkVerrouille()\n {\n $this->ligne->checkVerrouille();\n }", "public function ativar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE EncontroComDeus SET \t ativo = 1\n WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }", "public function vendasHoje(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbpedidos c WHERE DAY(c.data_finaliza) = Day(now()) and c.status = 'F';\";\n $rsvendahj = $this->conexao->query($sql);\n $result = $rsvendahj->fetch_array();\n $vendashoje = $result['total'];\n\n return $vendashoje;\n }", "function verifVadsStatus($data) {\n switch ($data) {\n\n case \"AUTHORISED\":\n return '<p style=\"margin-top:1px;\">En attente de remise : La transaction est acceptée et sera remise en banque automatiquement à la date prévue.</p>';\n break;\n\n case \"ABANDONED\":\n return '<p style=\"margin-top:1px;\">Abandonné : Le paiement a été abandonné par l\\’acheteur.</p>';\n break;\n\n case \"AUTHORISED_TO_VALIDATE\":\n return '<p style=\"margin-top:1px;\">A valider : La transaction, créée en validation manuelle, est autorisée.</p>\n <p style=\"margin-top:1px;\">Le marchand doit valider manuellement la transaction afin qu\\'elle soit remise en banque.</p>\n <p style=\"margin-top:1px;\">La transaction peut être validée tant que la date de remise n’est pas dépassée.</p>\n <p style=\"margin-top:1px;\">Si cette date est dépassée alors le paiement prend le statut EXPIRED.</p>\n <p style=\"margin-top:1px;\">Le statut Expiré est définitif.</p>';\n break;\n\n case \"CANCELLED\":\n return '<p style=\"margin-top:1px;\">Annulée : La transaction est annulée par le marchand.</p>';\n break;\n\n case \"CAPTURED\":\n return '<p style=\"margin-top:1px;\">Remisée : La transaction est remise en banque.</p>';\n break;\n\n case \"CAPTURE_FAILED\":\n return '<p style=\"margin-top:1px;\">Erreur remise : La remise de la transaction a échoué.<br />\n Contactez le Support.</p>';\n break;\n \n case \"EXPIRED\":\n return '<p style=\"margin-top:1px;\">Expirée : La date de remise est atteinte et le marchand n\\’a pas validé la transaction.</p>';\n break;\n \n case \"NOT_CREATED\":\n return '<p style=\"margin-top:1px;\">Transaction non créée : La transaction n\\'est pas créée et n\\'est pas visible dans le Back Office.</p>';\n break;\n\n case \"REFUSED\":\n return '<p style=\"margin-top:1px;\">Refusée : La transaction est refusée.</p>';\n break;\n \n case \"UNDER_VERIFICATION\":\n return '<p style=\"margin-top:1px;\">Vérification PayPal en cours : En attente de vérification par PayPal.</p> \n <p style=\"margin-top:1px;\">PayPal retient la transaction pour suspicion de fraude.</p> \n <p style=\"margin-top:1px;\">Le paiement est dans l’onglet Transactions en cours dans votre backoffice.</p>';\n break;\n\n case \"WAITING_AUTHORISATION\":\n return '<p style=\"margin-top:1px;\">En attente d’autorisation : Le délai de remise en banque est supérieur à la durée de validité de l\\'autorisation.</p>\n <p style=\"margin-top:1px;\">Une autorisation d\\’un euro est réalisée et acceptée par la banque émettrice.</p>\n <p style=\"margin-top:1px;\">La demande d\\’autorisation sera déclenchée automatiquement à J-1 avant la date de remise en banque.</p>\n <p style=\"margin-top:1px;\">Le paiement pourra être accepté ou refusé.</p>\n <p style=\"margin-top:1px;\">La remise en banque est automatique.</p>';\n break;\n \n case \"WAITING_AUTHORISATION_TO_VALIDATE\":\n return '<p style=\"margin-top:1px;\">A valider et autoriser : Le délai de remise en banque est supérieur à la durée de validité de l\\'autorisation.</p>\n <p style=\"margin-top:1px;\">Une autorisation d\\’un euro a été acceptée.</p>\n <p style=\"margin-top:1px;\">Le marchand doit valider manuellement la transaction afin que la demande d’autorisation et la remise aient lieu.</p>';\n break;\n \n case \"ERRORSTATUS\":\n return '<p style=\"margin-top:1px;\">Erreur verifVadsStatus() le paiement n\\'à pu aboutir erreur de status.</p>';\n break;\n\n }\n }", "public function attaquerAdversaire() {\n\n }", "public function videoconferenciaBajarVolumen( ) {\n $this->bajarVolumen();\n //$this->setComando(\"BAJAR_VOLUMEN\");\n }", "abstract public function getPasiekimai();", "public function valordelospasajesplus();", "function confirmarVoto($idactual){\n $sql=\"SELECT * FROM bitacora WHERE idvotante=$idactual;\";\n \t\t\treturn $sql;\n }", "function ini__operacion (){\n \n //obtenemos el arreglo almacenado en la operacion \"aulas disponibles\". Su formato es :\n //Array ('id_aula'=>x 'hora_inicio'=>x 'hora_fin'=>x)\n $datos_ad=toba::memoria()->get_parametros();\n //esta condicion es fundamental para no quedarnos en la misma pantalla\n if(isset($datos_ad['id_aula'])){\n $this->s__accion=\"Vinculo\";\n $this->s__aula_disponible=$datos_ad;\n \n //eliminamos la informacion guardada en el arreglo $_SESSION\n toba::memoria()->limpiar_memoria();\n $this->set_pantalla('pant_persona');\n }\n }", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "function verifikasi()\n\t{\n\t\t$data['belum_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'belum'))->result();\n\t\t$data['sudah_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'sudah','hak_akses !='=>'1'))->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/verifikasi',$data);\n\t\t$this->load->view('static/footer');\n\t}", "public function VerificaVentas()\n{\n\tself::SetNames();\n\t$sql = \" select ivav, simbolo from configuracion\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$ivav = \"0.00\";\n\t $simbolo = \"\";\n\t\t}\n\t\telse\n\t\t{\n\n\t$con = \"select ivav, simbolo from configuracion\";\n\tforeach ($this->dbh->query($con) as $rowcon)\n\t{\n\t\t$this->pcon[] = $rowcon;\n\t}\n\t$ivav = $rowcon['ivav'];\n\t$simbolo = $rowcon['simbolo'];\n\n$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.codventa, ventas.codcaja, ventas.codcliente as cliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.codigo, ventas.observaciones, detalleventas.coddetalleventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.ivaproducto, detalleventas.importe, salas.nombresala, mesas.codmesa, mesas.nombremesa, usuarios.nombres FROM mesas INNER JOIN ventas ON mesas.codmesa = ventas.codmesa INNER JOIN detalleventas ON detalleventas.codventa = ventas.codventa LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente INNER JOIN salas ON salas.codsala = mesas.codsala LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE mesas.codmesa = ? and mesas.statusmesa = '1' AND detalleventas.statusdetalle = '1'\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\t?>\n\t\t\t\n\n<div class=\"col-sm-8\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\"><i class=\"fa fa-cutlery\"></i> Detalles de Productos</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"row\">\n <div class=\"col-sm-12 col-xs-12\">\n <div class=\"box-body\">\n\n\n<div id=\"favoritos\"><?php\n $favoritos = new Login();\n $favoritos = $favoritos->ListarProductosFavoritos();\n $x=1;\n\necho $status = ( $favoritos[0][\"codproducto\"] == '' ? '' : '<label class=\"control-label\"><h4>Productos Favoritos: </h4></label><br>');\n\nif($favoritos==\"\"){\n\n echo \"\"; \n\n} else {\n\n for($i=0;$i<sizeof($favoritos);$i++){ \n ?>\n\n<button type=\"button\" class=\"button ng-scope\" \nstyle=\"font-size:8px;border-radius:5px;width:69px; height:50px;cursor:pointer;\"\n\nert-add-pending-addition=\"\" ng-click=\"afterClick()\" ng-repeat=\"product in ::getFavouriteProducts()\" OnClick=\"DoAction('<?php echo $favoritos[$i]['codproducto']; ?>','<?php echo $favoritos[$i]['producto']; ?>','<?php echo $favoritos[$i]['codcategoria']; ?>','<?php echo $precioconiva = ( $favoritos[$i]['ivaproducto'] == 'SI' ? $favoritos[$i]['preciocompra'] : \"0.00\"); ?>','<?php echo $favoritos[$i]['preciocompra']; ?>','<?php echo $favoritos[$i]['precioventa']; ?>','<?php echo $favoritos[$i]['ivaproducto']; ?>','<?php echo $favoritos[$i]['existencia']; ?>');\" title=\"<?php echo $favoritos[$i]['producto'];?>\">\n\n<?php if (file_exists(\"./fotos/\".$favoritos[$i][\"codproducto\"].\".jpg\")){\n\necho \"<img src='./fotos/\".$favoritos[$i]['codproducto'].\".jpg?' alt='x' style='border-radius:4px;width:40px;height:35px;'>\"; \n}else{\necho \"<img src='./fotos/producto.png' alt='x' style='border-radius:4px;width:40px;height:35px;'>\"; \n} ?>\n\n<span class=\"product-label ng-binding \"><?php echo getSubString($favoritos[$i]['producto'], 8);?></span>\n</button>\n\n <?php if($x==8){ echo \"<div class='clearfix'></div>\"; $x=0; } $x++; } }\n\n echo $status = ( $favoritos[0][\"codproducto\"] == '' ? '' : '<hr>');?></div>\n\n\n<div class=\"row\"> \n\t\t\t\t<div class=\"col-md-12\"> \n\t\t\t\t\t<div class=\"form-group has-feedback\"> \n<label class=\"control-label\">B&uacute;squeda de Productos:<span class=\"symbol required\"></span></label>\n<input class=\"form-control\" type=\"text\" name=\"busquedaproducto\" id=\"busquedaproducto\" onKeyUp=\"this.value=this.value.toUpperCase();\" autocomplete=\"off\" placeholder=\"Realice la B&uacute;squeda de Producto\">\n\t\t\t\t\t<i class=\"fa fa-search form-control-feedback\"></i> \n\t\t\t\t\t</div> \n\t\t\t\t</div>\n\t\t\t</div>\n\n<input type=\"hidden\" name=\"codproducto\" id=\"codproducto\" placeholder=\"Codigo\">\n<input type=\"hidden\" name=\"codcategoria\" id=\"codcategoria\" placeholder=\"Categoria\">\n<input type=\"hidden\" name=\"precioconiva\" id=\"precioconiva\" placeholder=\"Precio con Iva\">\n<input type=\"hidden\" name=\"precio\" id=\"precio\" placeholder=\"Precio de Compra\">\n<input type=\"hidden\" name=\"precio2\" id=\"precio2\" placeholder=\"Precio de Venta\">\n<input type=\"hidden\" name=\"ivaproducto\" id=\"ivaproducto\" placeholder=\"Iva Producto\">\n<input type=\"hidden\" name=\"existencia\" id=\"existencia\" placeholder=\"Existencia\">\n<input type=\"hidden\" name=\"cantidad\" id=\"cantidad\" value=\"1\" placeholder=\"Cantidad\">\n\n\t\t\t\t<div class=\"row\"> \n\t\t\t\t\t<div class=\"col-md-12\"> \n\t\t\t\t\t\t<div class=\"table-responsive\" data-pattern=\"priority-columns\">\n\t\t\t\t\t\t\t<table id=\"carrito\" class=\"table table-small-font table-striped\">\n\t\t\t\t\t\t\t\t<thead>\n<tr style=\"background:#f0ad4e;\">\n<th style=\"color:#FFFFFF;\"><h3 class=\"panel-title\"><div align=\"center\">Cantidad</div></h3></th>\n<th style=\"color:#FFFFFF;\"><h3 class=\"panel-title\"><div align=\"center\">Descripci&oacute;n de Producto</div></h3></th>\n<th style=\"color:#FFFFFF;\"><h3 class=\"panel-title\"><div align=\"center\">Precio</div></h3></th>\n<th style=\"color:#FFFFFF;\"><h3 class=\"panel-title\"><div align=\"center\">Acci&oacute;n</div></h3></th>\n</tr>\n </thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr>\n<td colspan=4><center><label><h5>NO HAY PRODUCTOS AGREGADOS</h5></label></center></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t<table width=\"250\" id=\"carritototal\">\n\t\t\t\t\t\t\t\t<tr>\n<td colspan=3><span class=\"Estilo9\"><label>Total a Confirmar:</label></span></td>\n<td><div align=\"right\" class=\"Estilo9\"><?php echo \"<strong>\".$simbolo.\"</strong>\"; ?><label id=\"lbltotal\" name=\"lbltotal\">0.00</label>\n<input type=\"hidden\" name=\"txtsubtotal\" id=\"txtsubtotal\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"txtsubtotal2\" id=\"txtsubtotal2\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"iva\" id=\"iva\" value=\"<?php echo $ivav ?>\"/>\n<input type=\"hidden\" name=\"txtIva\" id=\"txtIva\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"txtDescuento\" id=\"txtDescuento\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"txtTotal\" id=\"txtTotal\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"txtTotall\" id=\"txtTotall\" value=\"0.00\"/>\n<input type=\"hidden\" name=\"txtTotalCompra\" id=\"txtTotalCompra\" value=\"0.00\"/></div></td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n<hr>\n\n<div class=\"row\">\n <div class=\"col-md-12\"> \n <label id=\"boton\" onClick=\"mostrar();\" style=\"cursor: pointer;\">Agregar Observaciones: </label>\n<div id=\"observaciones\" style=\"display: none;\">\n <div class=\"form-group has-feedback\"> \n<textarea name=\"observaciones\" class=\"form-control\" id=\"observaciones\" onKeyUp=\"this.value=this.value.toUpperCase();\" autocomplete=\"off\" placeholder=\"Ingrese Observaciones\" required=\"\" aria-required=\"true\"></textarea>\n\n <i class=\"fa fa-comments form-control-feedback\"></i>\n </div>\n</div> \n </div> \n </div><br>\n\n\t\t\t\t\t<div class=\"modal-footer\"> \n<button type=\"submit\" name=\"btn-venta\" id=\"btn-venta\" class=\"btn btn-primary\"><span class=\"fa fa-save\"></span> Confirmar Pedido</button> \n<button type=\"button\" id=\"vaciarv\" class=\"btn btn-danger\" title=\"Vaciar Carrito\"><span class=\"fa fa-trash-o\"></span> Limpiar</button> \n\t\t\t\t\t</div>\n\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n\n <div class=\"col-sm-4\">\n <div class=\"panel panel-primary\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\"><i class=\"fa fa-file-pdf-o\"></i> Detalles de Factura</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"row\">\n <div class=\"col-sm-12 col-xs-12\">\n <div class=\"box-body\">\n\n<?php\n$mesa = new Login();\n$mesa = $mesa->MesasPorId();\n?>\n\n<div class=\"row\"> \n\t\t\t\t<div class=\"col-md-12\"> \n\t\t\t\t\t<div class=\"form-group has-feedback\"> \n<strong style=\"color:#990000; font-size:17px;\"><?php echo $mesa[0]['nombresala']; ?></strong><br> \n<strong style=\"color:#990000; font-size:17px;\"><?php echo $mesa[0]['nombremesa']; ?></strong>\n<input type=\"hidden\" name=\"codmesa\" id=\"codmesa\" value=\"<?php echo $mesa[0]['codmesa'] ?>\">\n<input type=\"hidden\" name=\"nombremesa\" id=\"nombremesa\" value=\"<?php echo $mesa[0]['nombremesa'] ?>\">\n<input type=\"hidden\" name=\"delivery\" id=\"delivery\" value=\"0\">\n<input type=\"hidden\" name=\"repartidor\" id=\"repartidor\" value=\"0\">\n<input type=\"hidden\" name=\"cliente\" id=\"cliente\" value=\"\">\n<input type=\"hidden\" name=\"tipo\" id=\"tipo\" value=\"0\">\n\t\t\t\t\t</div> \n\t\t\t\t</div>\n\t\t\t</div>\n\n<div class=\"row\"> \n\t<div class=\"col-md-12\"> \n\t\t<div class=\"form-group has-feedback\"> \n<label for=\"field-6\" class=\"control-label\">B&uacute;squeda de Cliente: <span class=\"symbol required\"></span></label>\n\t\t\t<div class=\"input-group\">\n\t<input type=\"text\" id=\"busquedacliente\" name=\"busquedacliente\" class=\"form-control\" placeholder=\"B&uacute;squeda del Cliente\">\n <span class=\"input-group-btn\">\n <button type=\"button\" class=\"btn waves-effect waves-light btn-primary\" data-toggle=\"modal\" data-target=\"#myModal\" data-backdrop=\"static\" data-keyboard=\"false\"><i class=\"fa fa-user-plus\"></i></button></span>\n </div>\n\t\t</div>\n\t</div>\n</div>\n\n<div class=\"row\"> \n\t<div class=\"col-md-12\"> \n\t\t<div class=\"form-group has-feedback\"> \n\t\t\t<label class=\"control-label\">Mesero: <span class=\"symbol required\"></span></label><br>\n\t\t\t<?php echo $_SESSION[\"nombres\"] ?> \n\t\t</div> \n\t</div>\n</div>\n\n<input type=\"hidden\" name=\"descuento\" id=\"descuento\" value=\"0.00\">\n\n <div class=\"modal-footer\"> \n<button type=\"button\" id=\"mostrar-mesa\" class=\"btn btn-warning\"><span class=\"fa fa-cutlery\"></span> Mostrar Mesas</button> \n\t\t\t\t\t</div>\n\n\t\t\t\t\t </div>\n <!-- /.box-body -->\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\t\t\t\t\t<?php \n\t\t\t\t\texit;\n\t\t\t\t} else {\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$this->p[]=$row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t }\n\t}\n}", "public function getAgenciaConta();", "public function voliPredvidjanje()\n {\n $korisnik= $this->session->get(\"korisnik\");\n $predvidjanjeId= $this->request->uri->getSegment(3); //slobodno promeniti nacin dohvatanja, poenta je da mi treba predvidjanje koje je voljeno\n $voliModel=new VoliModel();\n if ($voliModel->vec_voli($korisnik->IdK, $predvidjanjeId))\n {\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }\n else\n {\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanjeModel->voli($predvidjanjeId, true);\n $posl_id=$voliModel->poslednji_vestackiId();\n $voliModel->voli($korisnik->IdK, $predvidjanjeId, $posl_id+1);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "function get_aut_idautor(){return $this->aut_idautor;}", "function nbr_auteurs_enligne() {\r\n\tglobal $couleur_claire, $connect_id_auteur;\r\n\t$aff = '';\r\n\t$aff .= debut_cadre_relief(\"annonce.gif\", true);\r\n// nombre d_auteurs depuis 15 mn ()\r\n# inc/auth.php update-set en_ligne => NOW() : \"moment\" de session !\r\n# voir ecrire/action:logout.php\r\n# spip update-set 'en_ligne' datetime -15 mn au logout de session !!??!!\r\n# aff' nbr corresp aux auteurs affiches par spip en bandeau sup !\r\n\r\n\t$q = sql_select(\"COUNT(DISTINCT id_auteur) AS nb, statut \" .\r\n\t\t\"FROM spip_auteurs \" .\r\n\t\t\"WHERE en_ligne > DATE_SUB( NOW(), INTERVAL 15 MINUTE) \" .\r\n\t\t\"AND statut IN ('0minirezo', '1comite', '6forum') \" . // limite statuts spip (autres!)\r\n\t\t\"AND id_auteur != $connect_id_auteur \" .\r\n\t\t\"GROUP BY statut\"\r\n\t);\r\n\r\n\tif (sql_count($q)) {\r\n\t\t$aff .= _T(\"actijour:auteurs_en_ligne\") . \"<br />\\n\";\r\n\t\tWhile ($r = sql_fetch($q)) {\r\n\t\t\tif ($r['statut'] == '0minirezo') {\r\n\t\t\t\t$stat = _T('actijour:abrv_administrateur');\r\n\t\t\t} elseif ($r['statut'] == '1comite') {\r\n\t\t\t\t$stat = _T('actijour:abrv_redacteur');\r\n\t\t\t} elseif ($r['statut'] == '6forum') {\r\n\t\t\t\t$stat = _T('actijour:abrv_visiteur');\r\n\t\t\t}\r\n\t\t\t$aff .= $r['nb'] . \" $stat<br />\\n\";\r\n\t\t}\r\n\r\n\t} else {\r\n\t\t$aff .= _T(\"actijour:aucun_auteur_en_ligne\") . \"\\n\";\r\n\t}\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "public function ispisiOsobu(){\n // echo \"$this->ime $this->prezime $this->godRdoj\";\n echo \"<br>Ime: \" . $this->getIme() . \"<br>Prezime: \" . $this->getPrezime() . \"<br>Godina rodjenja: \" . $this->getGodRodj() . \"<br>\";\n }", "public function accueil()\n {\n }", "public function efectivaReserva($cod) {\n $this->db->query('UPDATE venta SET efectiva=1 WHERE cod_venta like \"' . $cod . '\"');\n if ($this->db->affected_rows() > 0) {\n return \"Se ha registrado la venta\";\n } else {\n return \"Error Ha ocurrido un problema, No se ha registrado la venta\";\n }\n }", "public function anioLectivoSiguiente(){\n $fecha= date('d/m/Y');\n $fecha=Carbon::createFromFormat('d/m/Y', date('d/m/Y'));\n $fecha->addYear();\n //$fecha->addYear();\n\n $fechaBuscar=substr($fecha, 0,-15);//$fecha_de_creacion.slice(0,-6);\n $fechaBuscar=(int)$fechaBuscar;\n $anio=Anio::where('año',$fechaBuscar)->select('id')->get()->toArray();\n\n if($anio!=null){\n $var=\"Existe\";\n return $var;\n }else{\n $var=\"NoExiste\";\n return $var;\n }\n }", "public function daEntrada(){\n\t\t$this->hora_entrada = date('d/m/y - H:i:s');\n\t\t$this->numero_visitas = $this->numero_visitas + 1;\n\t}", "public function jarjesta() {\n usort($this->ravinnon_saannit, \"self::vertaaPvm\");\n }", "public function verifAvance($fechaIni,$suc,$codigo,$id_inv){\n $respuesta = array();\n $link = new My();\n \n $link->Query(\"SELECT COUNT(distinct lote) AS inv FROM inventario WHERE codigo = '$codigo' AND suc = '$suc' AND id_inv=$id_inv\");\n $link->NextRecord();\n $respuesta['inventariados'] = $link->Record['inv'];\n \n \n $link->Query(\"SELECT COUNT(DISTINCT l.lote) AS lotes FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote \n INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote \n WHERE s.cantidad > 0 AND s.suc = '$suc' AND a.codigo = '$codigo' AND h.fecha_hora < '$fechaIni' \");\n \n $link->NextRecord();\n $respuesta['lotes'] = $link->Record['lotes'];\n $link->Close();\n \n echo json_encode($respuesta);\n }", "public function iva_articulos(){\r\n\t\t\t$total = $this->cesta_con_iva()-$this->cesta_sin_iva();\t\t\t\r\n\t\t\treturn $total;\r\n\t\t}", "function insertarVacacion(){\n\t\t$this->procedimiento='asis.ft_vacacion_ime';\n\t\t$this->transaccion='ASIS_VAC_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\n\t\t$this->setParametro('fecha_inicio','fecha_inicio','date');\n\t\t$this->setParametro('fecha_fin','fecha_fin','date');\n\t\t$this->setParametro('dias','dias','numeric');\n\t\t$this->setParametro('descripcion','descripcion','text');\n\t\t$this->setParametro('medio_dia','medio_dia','integer'); //medio_dia\n $this->setParametro('dias_efectivo','dias_efectivo','numeric');\n\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function Guardar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\t\t\t$sql = \"INSERT INTO denuncia (ID_VICTIMA, ES_LA_VICTIMA, DESCRIPCION_EVENTO, ASESORADO, \n\t\t\tASISTENCIA_PROFESIONAL, DENUNCIA_POLICIAL, PERPETRADOR_CONOCIDO, PROCEDIMIENTO_PERPETRADOR) VALUES ('$this->victima','$this->esLaVictima','$this->descripcionEvento','$this->yaAsesorado','$this->asistenciaProfesional',\n\t\t\t'$this->denunciaPolicial','$this->perpetradorConocido','$this->procedimientoPerpetrador')\";\n\t\t\tif ($enlace->query($sql) === TRUE) {\n \t\t\techo \"Nueva denuncia creada. Id de denuncia: \" . $enlace->insert_id;\n \t\t\treturn $enlace->insert_id;\n\t\t\t} else {\n \t\t\techo \"Error al guardar la denuncia \";\n\t\t\t}\n\t\t}", "public function inschrijven()\n {\n $vrijwilliger = new stdClass();\n\n $deelnemer = $this->authex->getDeelnemerInfo();\n $vrijwilliger->deelnemerId = $deelnemer->id;\n $vrijwilliger->taakShiftId = $this->input->get('id');\n $vrijwilliger->commentaar = \"\";\n\n\n $this->HelperTaak_model->insertVrijwilliger($vrijwilliger);\n\n $personeelsfeestId = $this->input->get('personeelsfeestId');\n redirect(\"Vrijwilliger/HulpAanbieden/index/\" . $personeelsfeestId);\n }", "function siguienteEstado(){\n $this->procedimiento = 'asis.ft_vacacion_ime';\n $this->transaccion = 'ASIS_SIGAV_IME';\n $this->tipo_procedimiento = 'IME';\n //Define los parametros para la funcion\n $this->setParametro('id_proceso_wf_act', 'id_proceso_wf_act', 'int4');\n $this->setParametro('id_estado_wf_act', 'id_estado_wf_act', 'int4');\n $this->setParametro('id_funcionario_usu', 'id_funcionario_usu', 'int4');\n $this->setParametro('id_tipo_estado', 'id_tipo_estado', 'int4');\n $this->setParametro('id_funcionario_wf', 'id_funcionario_wf', 'int4');\n $this->setParametro('id_depto_wf', 'id_depto_wf', 'int4');\n $this->setParametro('obs', 'obs', 'text');\n $this->setParametro('json_procesos', 'json_procesos', 'text');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function control_suplente($desde,$hasta,$id_desig_suplente){\n //busco todas las licencias de la designacion que ingresa\n //novedades vigentes en el periodo\n $anio=date(\"Y\", strtotime($desde)); \n $pdia = dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($anio);\n $udia = dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($anio);\n $sql=\"SELECT distinct t_n.desde,t_n.hasta \n FROM novedad t_n\n WHERE t_n.id_designacion=$id_desig_suplente\n and t_n.tipo_nov in (2,3,5)\n and t_n.desde<='\".$udia.\"' and t_n.hasta>='\".$pdia.\"'\"\n . \" ORDER BY t_n.desde,t_n.hasta\"; \n $licencias=toba::db('designa')->consultar($sql);\n $i=0;$seguir=true;$long=count($licencias);$primera=true;\n while(($i<$long) and $seguir){\n if($primera){\n $a=$licencias[$i]['desde'];\n $b=$licencias[$i]['hasta'];\n $primera=false;\n }else{\n if($desde>=$licencias[$i]['desde']){\n $a=$licencias[$i]['desde'];\n $b=$licencias[$i]['hasta'];\n }\n if($hasta<=$licencias[$i]['hasta']){\n $seguir=false;\n }\n \n if(($licencias[$i]['desde']==date(\"Y-m-d\",strtotime($b.\"+ 1 days\"))) or ($licencias[$i]['desde']==$b)){\n $b=$licencias[$i]['hasta'];\n }\n }\n $i++;\n }\n if($long>0){\n if($desde>=$a and $hasta<=$b){\n return true;\n }else{\n return false;\n }\n }else{//no tiene novedades\n return false;\n }\n\n// $sql=\"select * from designacion t_d\"\n// . \" INNER JOIN novedad t_n ON (t_d.id_designacion=t_n.id_designacion and t_n.tipo_nov in (2,3,5) )\"\n// . \" where t_d.id_designacion=$id_desig_suplente\"\n// . \" and '\".$desde.\"'>=t_n.desde and '\".$hasta.\"'<=t_n.hasta\";\n// $res=toba::db('designa')->consultar($sql);\n// if(count($res)>0){\n// return true;\n// }else{\n// return false;\n// }\n }", "function verificarCompraPublicacion($cliente,$edicion){\n\t\tinclude \"conexion.php\"; \n\n\t\t\t$sql=\"select * from compra\n\t\t\twhere cliente_id=$cliente and $edicion=edicion_id\n\t\t\t\";\n\t\t\t$result=mysql_query($sql, $conexion) or die (mysql_error());\n\t\t\tif (mysql_num_rows($result)>0)\n\t\t\t{\n\n\t\t\t$error=\"<p>Ya has comprado esta edicion</p>\";\n\t\t\theader (\"Location: errores.php?errores=$error\");\n\t\t\t\t\n\t\t\t\texit();\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t\t}", "function motivoDeAnulacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNRE' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function defiva($subt,$saldoi,$pago){\n $pagoiva;\n $resto = $saldoi -$subt;\n if($resto >0){\n // queda iva por aplicar\n if($resto>$pago){$pagoiva=$pago;}else{$pagoiva=$resto;}\n }else{\n //todo a capital\n $pagoiva = 0;\n }\n return $pagoiva;\n}", "public function enregistrerMauvaisEssaiMDP() {\n\t\t\n\t\t$this->log->debug(\"Usager::enregistrerMauvaisEssaiMDP() Début\");\n\t\t\n\t\t// Incrémenter le compteur\n\t\t$nbEssais = $this->get(\"nb_mauvais_essais\");\n\t\t$nbEssais++;\n\t\t$this->set(\"nb_mauvais_essais\", $nbEssais);\n\t\t\n\t\t// Si plus du nombre d'essais maximum verrouiller le compte\n\t\tif ($nbEssais > SECURITE_NB_MAUVAIS_ESSAIS_VERROUILLAGE) {\n\t\t\t$this->set(\"statut\", 1);\t\n\t\t}\n\t\t\n\t\t// Enregistrer\n\t\t$this->enregistrer();\n\t\t\t\t\n\t\t$this->log->debug(\"Usager::enregistrerMauvaisEssaiMDP() Fin\");\n\t}", "public function alimentar()\n {\n }", "function divorced() \n { \n $this->marsta_id=\"D\";\n $this->marsta_name=\"Divorced\";\n return($this->marsta_id);\n }", "function atuOrcreceitaval($codrec,$mes,$valor){\n $msg = \"0|Registro Atualizado !\";\n $clorcreceitaval = new cl_orcreceitaval;\t\t\n $clorcreceita = new cl_orcreceita;\t\t\n if ($mes == 0 || $mes =='0' || $mes === 0){\n // ajusta o saldo previsto\n\t$clorcreceita->o70_valor = $valor;\n\t$clorcreceita->o70_codrec= $codrec;\n\t$clorcreceita->o70_anousu= db_getsession(\"DB_anousu\");\n $rr= $clorcreceita->alterar(db_getsession(\"DB_anousu\"),$codrec);\n\tif ($clorcreceita->erro_status==='0'){\n\t $msg = \"1|\".$clorcreceita->erro_msg;\n\t}else {\n\t $msg = \"0|\".$clorcreceita->erro_msg; \n\t} \n return $msg;\n } \n if ($valor > 0){\n $clorcreceitaval->o71_coddoc = 100; \n }else{\n $clorcreceitaval->o71_coddoc = 101; \n }\n $clorcreceitaval->o71_anousu = db_getsession(\"DB_anousu\"); \n $clorcreceitaval->o71_mes = $mes; \n $clorcreceitaval->o71_codrec = $codrec;\n $clorcreceitaval->o71_valor = $valor; \n\n\n $rr = $clorcreceitaval->sql_record($clorcreceitaval->sql_query_file(db_getsession(\"DB_anousu\"),$codrec,$clorcreceitaval->o71_coddoc,$mes));\n if ($clorcreceitaval->numrows >0){\n $clorcreceitaval->alterar($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n\n } else { \n $clorcreceitaval->incluir($clorcreceitaval->o71_anousu,$clorcreceitaval->o71_codrec,$clorcreceitaval->o71_coddoc,$clorcreceitaval->o71_mes);\n }\t \n \n $erro = $clorcreceitaval->erro_msg;\n if ($clorcreceitaval->erro_status===0){\n $msg= \"1|\".$erro;\n\treturn $msg;\n } else {\n $msg = \"0|\".$clorcreceitaval->erro_msg;\n return $msg;\n }\n}", "public function affectation()\n {\n session_start();\n $bdd = new PDO('mysql:host=localhost;dbname=projet', 'root', '', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));\n $allmsg = $bdd->query('SELECT * FROM role ORDER BY ordre ASC ');\n //on va devoir ajouter une colonne dans la BD ca sera le pseudo du joueur on va voir ca\n while($msg= $allmsg->fetch())\n {\n ?>\n <br> <b><?php echo $msg['pseudo'].' a choisis le rôle: ' . $msg['role']. ' !' ?> </b> </br>\n <?php\n }\n\n //nombre de lignes dans la table\n $JoueursRestant = 7 - $allmsg->rowCount();\n\n if($JoueursRestant != 0)\n {\n echo \" <p id='avantlancer1'> En attente de \". $JoueursRestant .\" Joueurs</p>\t<img src=\\\"ajax-loader.gif\\\" alt=\\\"patientez...\\\" id='ajax'> </br>\";\n }\n else{\n echo '<p id=\"avantlancer2\">La partie va commencer dans: <p/>';\n\n\n }\n\n }", "public static function dodajArtikelVKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n // ce narocilo ze obstaja mu samo povecamo kolicino \n // drugace narocilo ustvarimo\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n\n if (!$narocilo) {\n\n $id_narocila = NarocilaDB::insert($id, $status);\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $id_narocila);\n\n } else {\n\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n if (!$podrobnost_narocila) {\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $narocilo[\"id\"]);\n } else {\n PodrobnostiNarocilaDB::edit($id_artikla, $podrobnost_narocila[\"kolicina\"] + 1, $narocilo[\"id\"]); \n } \n }\n\n echo ViewHelper::redirect(BASE_URL);\n\n }", "function autorizar_venta_directa($id_movimiento_material) {\r\n global $_ses_user,$db; \r\n\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n \r\n \r\n $sql = \"select id_factura from movimiento_factura where id_movimiento_material = $id_movimiento_material\";\r\n $fact = sql($sql) or fin_pagina(); \r\n $id_factura = $fact->fields[\"id_factura\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++) { \t \r\n \t\r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n \r\n \r\n //tengo que eliminar del stock los productos correspondientes \r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //pongo las banderas de la factura en cuenta asi se produce\r\n //el movimiento correcto en el balance\r\n $detalle_mov->movenext(); \r\n }//del for \r\n \r\n if ($id_factura) {\r\n \r\n $sql = \"update licitaciones.cobranzas \r\n set renglones_entregados=1, licitacion_entregada=1\r\n where cobranzas.id_factura=$id_factura\";\r\n sql($sql) or fin_pagina();\r\n } \r\n \r\n \r\n \r\n\r\n}", "function ventas() {\n// $fecha_limite='2015-08-11';\n// $and_filtro = \" and fecha <='$fecha_limite'\";\n// $and_filtro = \" and cod_cliente in (275,28,586,805)\";\n // $adjudicados = FUNCIONES::lista_bd_sql(\"select * from temp_ventas where urbanizacion!='OKINAWA'\");\n\n $adjudicados = FUNCIONES::lista_bd_sql(\"select * from temp_ventas where 1 $and_filtro\");\n\n echo '-- ' . count($adjudicados) . '<br>';\n\n// return;\n\n $num = 0;\n\n $insert = \"insert into venta(\n\n ven_urb_id,ven_numero,ven_lot_id,ven_lot_ids,ven_int_id,ven_co_propietario,ven_fecha,ven_moneda,\n\n ven_res_id,ven_superficie,ven_metro,ven_valor,ven_decuento,ven_incremento,ven_monto,ven_res_anticipo,ven_monto_intercambio,ven_monto_efectivo,\n\n ven_estado,ven_usu_id,ven_tipo,ven_val_interes,ven_cuota_inicial,ven_tipo_plan,ven_plazo,ven_cuota,ven_rango,ven_frecuencia,\n\n ven_observacion,ven_codigo,ven_vdo_id,ven_comision,ven_concepto,ven_tipo_pago,ven_fecha_firma,ven_fecha_cre,ven_monto_pagar,\n\n ven_form,ven_costo,ven_costo_cub,ven_costo_pag,ven_promotor,ven_importado,\n\n ven_lug_id,ven_ubicacion,ven_suc_id,ven_ufecha_prog,ven_ufecha_pago,ven_ufecha_valor,\n\n ven_cuota_pag,ven_capital_pag,ven_capital_desc,ven_capital_inc,ven_usaldo,ven_sfecha_prog,ven_costo_up,ven_numero_cliente,ven_multinivel,ven_porc_comisiones\n\n ) values\";\n\n $sql_insert = $insert;\n\n $reg = 0;\n\n\n\n $num_ini = 1000000;\n\n\n\n $aurbs = array(\n 'LUJAN' => '2',\n 'BISITO' => '3',\n 'OKINAWA' => '13',\n 'LA QUINTA' => '11'\n );\n\n\n\n $lotes_vendidos = array();\n\n\n\n foreach ($adjudicados as $tven) {\n\n if ($num == 440) {\n\n// echo \"$sql_insert<br>\";\n\n FUNCIONES::bd_query($sql_insert);\n\n $sql_insert = $insert;\n\n $num = 0;\n }\n\n $int_codigo = \"NET-$tven->cod_cliente\";\n\n $interno = FUNCIONES::objeto_bd_sql(\"select * from interno where int_codigo='$int_codigo'\");\n\n $urb_id = $aurbs[$tven->urbanizacion];\n\n\n\n $sql_lote = \"select * from lote\n\n inner join manzano on (lot_man_id=man_id)\n\n where man_urb_id='$urb_id' and man_nro='$tven->mz' and lot_nro='$tven->lote';\n\n \";\n\n\n\n $lote = FUNCIONES::objeto_bd_sql($sql_lote);\n\n\n\n if (!$lote || $lote->lot_estado != 'Disponible') {\n\n $lot_estado = $lote->lot_estado;\n\n $_uv = FUNCIONES::objeto_bd_sql(\"select * from uv where uv_id='$lote->lot_uv_id'\");\n\n $_zona = FUNCIONES::objeto_bd_sql(\"select * from zona where zon_id='$lote->lot_zon_id'\");\n\n $lote_id = importar_lotes($urb_id, $_uv->uv_nombre, $_zona->zon_nombre, $tven->mz, \"NET-$tven->lote\", $lote->lot_superficie);\n\n $sql_lote = \"select * from lote\n\n inner join manzano on (lot_man_id=man_id)\n\n where lot_id='$lote_id';\n\n \";\n\n\n\n $lote = FUNCIONES::objeto_bd_sql($sql_lote);\n\n\n\n echo \"-- no existe lote o esta $lot_estado ;$urb_id-$tven->mz-$tven->lote ---> LOTE ID: $lote_id<br>\";\n }\n\n /*\n\n if(!$lote){\n\n echo \"-- NO EXISTE LOTE $tven->urbanizacion - $tven->mz - $tven->lote <br>\";\n\n }else{\n\n // echo \"-- EXISTE LOTE $tven->urbanizacion - $tven->mz - $tven->lote - $lote->lot_estado<br>\";\n\n if($lote->lot_estado=='Vendido'){\n\n echo \"$tven->cod_venta<br>\";\n\n }\n\n }\n\n */\n\n\n\n// continue;\n\n\n\n if ($lote && $lote->lot_estado == 'Disponible') {\n\n if ($num > 0) {\n\n $sql_insert.=',';\n }\n\n $int_codigo_vdo = \"NET-$tven->cod_vendedor\";\n\n $_vendedor = FUNCIONES::objeto_bd_sql(\"select * from interno where int_codigo='$int_codigo_vdo'\");\n\n $txt_promotor = \"$int_codigo_vdo | $_vendedor->int_nombre\";\n\n\n\n// if($tven->ven_vdo_id>0){\n// $txt_promotor= _db::atributo_sql(\"select concat(int_nombre,' ',int_apellido) as campo from interno,vendedor where vdo_int_id=int_id and vdo_id='$tven->ven_vdo_id'\");\n// }\n// if(!$interno){\n// echo \"-- NO EXISTE INTERNO <BR>\";\n// }\n// if(!$tres){\n// echo \"-- NO EXISTE TEMP_RESERVA *** '$tobj->PY' , '$tobj->Numero_Reserva' <BR>\"; \n// }\n// if(!$tpromotor){\n// echo \"-- NO EXISTE PROMOTOR<BR>\"; \n// }\n\n\n\n $res_anticipo = $tven->cuota_inicial * 1;\n\n\n\n $ven_monto = $tven->precio;\n\n $saldo_efectivo = $tven->saldo_financiar;\n\n $ven_metro = round($ven_monto / $tven->superficie, 2);\n\n $concepto = FUNCIONES::get_concepto($lote->lot_id);\n\n $ven_numero = \"NET-$tven->cod_cliente\";\n\n $ven_numero_cliente = \"NET-$tven->cod_cliente\";\n\n $fecha_cre = date('Y-m-d H:i:s');\n\n// $insert=\"insert into venta(\n// ven_urb_id,ven_numero,ven_lot_id,ven_lot_ids,ven_int_id,ven_co_propietario,ven_fecha,ven_moneda,\n// ven_res_id,ven_superficie,ven_metro,ven_valor,ven_decuento,ven_incremento,ven_monto,ven_res_anticipo,ven_monto_intercambio,ven_monto_efectivo,\n// ven_estado,ven_usu_id,ven_tipo,ven_val_interes,ven_cuota_inicial,ven_tipo_plan,ven_plazo,ven_cuota,ven_rango,ven_frecuencia,\n// ven_observacion,ven_codigo,ven_vdo_id,ven_comision,ven_concepto,ven_tipo_pago,ven_fecha_firma,ven_fecha_cre,ven_monto_pagar,\n// ven_form,ven_costo,ven_costo_cub,ven_costo_pag,ven_promotor,ven_importado,\n// ven_lug_id,ven_ubicacion,ven_suc_id,ven_ufecha_prog,ven_ufecha_pago,ven_ufecha_valor,\n// ven_cuota_pag,ven_capital_pag,ven_capital_desc,ven_capital_inc,ven_usaldo,ven_sfecha_prog,ven_costo_up\n// ) values\";\n\n $ven_fecha = get_fecha($tven->fecha_venta);\n\n $ven_moneda = 2;\n\n $urb = FUNCIONES::objeto_bd_sql(\"select * from urbanizacion where urb_id=$urb_id\");\n\n $costo_m2 = $urb->urb_val_costo;\n\n $costo = $tven->superficie * $costo_m2;\n\n $costo_cub = $res_anticipo;\n\n if ($res_anticipo > $costo) {\n\n $costo_cub = $costo;\n }\n\n $sql_insert.=\"(\n\n '$urb_id','$ven_numero','$lote->lot_id','','$interno->int_id','0','$ven_fecha','$ven_moneda',\n\n '0','$tven->superficie','$ven_metro','$ven_monto','0','0','$ven_monto','$res_anticipo',0,'$saldo_efectivo',\n\n 'Pendiente','admin','Credito','$tven->interes','0','plazo',0,0,1,'dia_mes',\n\n '','',0,0,'$concepto','Normal','0000-00-00','$fecha_cre',0,\n\n 7,'$costo','$costo_cub',0,'$txt_promotor',0,\n\n 1,'Bolivia,Santa Cruz,Santa Cruz de la Sierra',1,\n\n '0000-00-00','0000-00-00','0000-00-00',0,0,0,0,0,'0000-00-00',0,'$ven_numero_cliente','si','{$urb->urb_porc_comisiones}'\n\n )\";\n\n $num++;\n\n $reg++;\n\n $lotes_vendidos[] = $lote->lot_id;\n } else {\n\n\n\n echo \"-- no existe lote o esta $lote->lot_estado;$urb_id-$tven->mz-$tven->lote<br>\";\n }\n }\n\n\n\n if ($num > 0) {\n\n// echo \"$sql_insert<br>\";\n\n FUNCIONES::bd_query($sql_insert);\n }\n\n\n\n $sql_up_lotes = \"update lote set lot_estado='Vendido' where lot_id in (\" . implode(',', $lotes_vendidos) . \")\";\n\n echo $sql_up_lotes . ';<br>';\n\n// FUNCIONES::bd_query($sql_up_lotes);\n\n\n\n echo \"-- <BR>TOTAL REGISTRADOS $reg\";\n}", "function siguienteEstadoBoleta(){\r\n $this->procedimiento='leg.ft_boleta_garantia_dev_ime';\r\n $this->transaccion='LG_POBODEV_IME';\r\n $this->tipo_procedimiento='IME';\r\n \r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4'); \r\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\r\n\t\t$this->setParametro('id_anexo','id_anexo','int4');\r\n\t\t\r\n\t\t\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "public function oceniPredvidjanje()\n {\n $korisnik= $this->session->get(\"korisnik\");\n $predvidjanjeId= $this->request->uri->getSegment(3);\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanje= $predvidjanjeModel->dohvati_predvidjanja_id($predvidjanjeId); \n $ocena=$_POST[$predvidjanjeId];//pretpostavljam da ce tako biti najlakse dohvatiti, slovbodno promeniti\n $oceniModel=new DajeOcenuModel();\n \n if ($oceniModel->vec_dao_ocenu($korisnik->IdK, $predvidjanje->IdP) || date(\"Y-m-d H:i:s\")>$predvidjanje->DatumEvaluacije)\n {\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }\n else\n {\n \n \n $predvidjanjeModel->daje_ocenu($predvidjanje->IdP, $ocena);\n $posl_id=$oceniModel->poslednji_vestackiId();\n $oceniModel->daje_ocenu($korisnik->IdK, $predvidjanje->IdP, $ocena, $posl_id+1);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }", "function en_rojo($anio){\n $ar=array();\n $ar['anio']=$anio;\n $sql=\"select sigla,descripcion from unidad_acad \";\n $sql = toba::perfil_de_datos()->filtrar($sql);\n $resul=toba::db('designa')->consultar($sql);\n $ar['uni_acad']=$resul[0]['sigla'];\n $res=$this->get_totales($ar);//monto1+monto2=gastado\n $band=false;\n $i=0;\n $long=count($res);\n while(!$band && $i<$long){\n \n if(($res[$i]['credito']-($res[$i]['monto1']+$res[$i]['monto2']))<-50){//if($gaste>$resul[$i]['cred']){\n $band=true;\n }\n \n $i++;\n }\n return $band;\n \n }", "function fTraeAuxiliar($pTip, $pCod){\n global $db, $cla, $olEsq;\n $slDato= substr($olEsq->par_Clave,4,2);\n if ($slDato == \"CL\") { // el movimiento se asocia al Cliente\n $iAuxi = $cla->codProv;\n }\n else {\n $iAuxi = NZ(fDBValor($db, \"fistablassri\", \"tab_txtData3\", \"tab_codTabla = '\" . $pTip . \"' AND tab_codigo = '\" . $pCod . \"'\" ),0);\n }\n//echo \"<br>aux\" . $olEsq->par_Clave. \" / \" .$slDato . \" $iAuxi <br>\";\n error_log(\" aux: \" . $iAuxi. \" \\n\", 3,\"/tmp/dimm_log.err\");\t\n return $iAuxi;\n}", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "public function ver($id) \n {\n if(!$this->autentificar->esta_logueado() && !$this->autentificar->es_administrador()) redirect('sesion');\n $usuarios = $this->M_Usuario->listar_usuarios()->result();\n $this->data['usuarios'] = $usuarios;\n $qry_reserva = $this->M_reserva->obtener_reserva($id);\n $viajes = $this->M_viaje->listar_viaje()->result();\n $this->data['viajes'] = $viajes;\n $habitaciones = $this->M_habitacion->listar_habitaciones()->result();\n $this->data['habitaciones'] = $habitaciones;\n if($qry_reserva->num_rows() > 0)\n {\n $reserva = $qry_reserva->row();\n $this->data['acc'] = MODIFICAR;\n\n $this->data['reserva'] = $reserva; \n $this->_vista('comun');\n }\n else\n {\n show_404();\n }\n }", "public function obtenerViajesplus();", "public function ver($id,$leng) {\r\n $this->leng = $leng;\r\n $vercliente = new cliente();\r\n\r\n if (Input::hasPost('cliente')) {\r\n\r\n $cliente = new Cliente(Input::post('cliente'));\r\n\r\n $solicitud_modificacion = new Solicitud ();\r\n $solicitud_modificacion = $solicitud_modificacion->buscar_solicitud($id);\r\n $solicitud_modificacion->modificaciones_sol = \"true\";\r\n\r\n //Paso de datos desde usuario encontrado a cliente a ingresar\r\n $username_usu = $cliente->username_usu;\r\n $password_usu = $cliente->password_usu;\r\n $nombre_usu = $cliente->nombre_usu;\r\n $apellido_usu = $cliente->apellido_usu;\r\n //$rut_usu = $cliente->rut_usu;\r\n $email_usu = $cliente->email_usu;\r\n $nombre_cli = $cliente->nombre_cli;\r\n //$rut_cli = $cliente->rut_cli;\r\n $giro = $cliente->giro_cli;\r\n $telefono = $cliente->telefono_cli;\r\n $plan = $cliente->tipo_plan;\r\n\r\n\r\n if ($cliente->sql(\"UPDATE cliente SET nombre_cli='\" . $nombre_cli . \"', giro_cli='\" . $giro . \"', telefono_cli='\" . $telefono . \"', tipo_plan='\" . $plan . \"' WHERE id_usu =\" . $id . \";\") && $solicitud_modificacion->update()) {\r\n Flash::success(\"Solicitud modificada correctamente\");\r\n Input::delete();\r\n Router::redirect(\"solicitud/ver/\" . $id.\"/\".$leng);\r\n } else {\r\n Flash::error(\"Error en el ingreso del cliente\");\r\n }\r\n } else {\r\n $this->cliente = $vercliente->find($id);\r\n $this->qq = $vercliente->tipo_plan;\r\n }\r\n }", "function addVivienda($calle, $numero_exterior, $codigo_postal = false, $numero_interior = \"\", $referencia = \"\", $telefono_fijo = \"0\", $telefono_movil = \"0\",\n\t\t\t$es_principal = false, $regimen = FALLBACK_PERSONAS_REGIMEN_VIV, $tipo = FALLBACK_PERSONAS_TIPO_VIV, $tiempo_de_residir = DEFAULT_TIEMPO, \n\t\t\t$colonia = \"\", $TipoDeAcceso = \"\", $gps = \"\",\n\t\t\t$clave_de_localidad = false, $clave_de_pais = EACP_CLAVE_DE_PAIS, \n\t\t\t$nombre_pais = \"\", $nombre_estado = \"\", $nombre_municipo = \"\", $nombre_localidad = \"\"){\n\t\t\n\t\t//$xViv\t\t\t\t= new cPersonasVivienda($this->getCodigo(), $tipo);\n\t\t\n\t\t$fechaalta \t\t\t= fechasys();\n\t\t$eacp\t\t\t\t= EACP_CLAVE;\n\t\t$socio\t\t\t\t= $this->mCodigo;\n\t\t$xT\t\t\t\t\t= new cTipos();\n\t\t$xLc\t\t\t\t= new cLocal();\n\t\t$xQL\t\t\t\t= new MQL();\n\t\t//depurar calle y numero 18Jul2013\n\t\t$calle\t\t\t\t= str_replace(\"CALLE\", \"\", strtoupper($calle));\n\t\t//Inicia al Socio 20120620\n\t\t$this->init();\n\t\t$DSocio\t\t\t\t= $this->getDatosInArray();\n\t\t$TipoDeIngreso\t\t= $DSocio[\"tipoingreso\"];\n\t\t$codigo_postal\t\t= setNoMenorQueCero($codigo_postal);\n\t\t$sucursal\t\t\t= getSucursal();\n\t\t$sucess\t\t\t\t= true;\n\t\t$usuario\t\t\t= getUsuarioActual();\n\t\t//Fixed\n\n\t\t\n\t\t\n\t\t$msg\t\t\t\t= \"\";\n\t\t$TipoDeAcceso\t\t= ($TipoDeAcceso == \"\") ? \"calle\" : $TipoDeAcceso;\n\t\t$clave_de_municipio\t= $xLc->DomicilioMunicipioClave();\n\t\t$clave_de_estado\t= $xLc->DomicilioEstadoClaveNum();\n\t\t$clave_de_localidad\t= setNoMenorQueCero($clave_de_localidad);\n\t\t$clave_de_pais\t\t= (trim($clave_de_pais) == \"\") ? EACP_CLAVE_DE_PAIS : $clave_de_pais;\n\t\t/* 1 part 2 fiscal 3 laboral*/\n\t\t//verifica los codigos postales\n\t\t$xCol\t\t\t\t= new cDomiciliosColonias();\n\t\tif($clave_de_pais == EACP_CLAVE_DE_PAIS){\n\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\t\n\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t$msg\t\t\t\t\t.= \"WARN\\t$socio\\tEl CP queda en $codigo_postal, Localidad en $nombre_localidad, municipio en $municipio, Colonia $colonia\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t\t\t.= \"WARN\\tEL C.P.($codigo_postal) No existe, se carga el de la Caja Local\\r\\n\";\n\t\t\t\t\n\t\t\t\t\tif( SISTEMA_CAJASLOCALES_ACTIVA == true){\n\t\t\t\t\t\t$this->init();\n\t\t\t\t\t\t$xCL\t\t\t= new cCajaLocal($this->mCajaLocal);\n\t\t\t\t\t\t$DCols\t\t\t= $xCL->getDatosInArray();\n\t\t\t\t\t\t$codigo_postal\t\t= ( isset($DCols[\"codigo_postal\"]) ) ? setNoMenorQueCero(($DCols[\"codigo_postal\"])) : $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t\t$msg\t\t\t.= \"WARN\\tSe obtiene el C.P. por caja Local ($codigo_postal) \\r\\n\";\n\t\t\t\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\n\t\t\t\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($codigo_postal <= 0){\n\t\t\t\t\t\t$msg\t\t\t.= \"ERROR\\tEL C.P.($codigo_postal) No existe, se carga el de la Sucursal\\r\\n\";\n\t\t\t\t\t\t$codigo_postal\t= $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t}\n\t\n\t\t\t}\n\t\t} else {\n\t\t\t$clave_de_estado\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_ESTADO;\n\t\t\t$clave_de_municipio\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_MUNICIPIO;\n\t\t\tif($codigo_postal <= 0){\t$codigo_postal = 1; } \n\t\t}\n\n\t\t$xLoc\t\t\t\t\t= new cDomicilioLocalidad($clave_de_localidad);\n\t\tif( $clave_de_localidad <= 0 ){\n\t\t\t$clave_de_localidad\t= $xLoc->setBuscar($nombre_localidad, $clave_de_estado, $clave_de_municipio);\n\t\t\tif( setNoMenorQueCero($clave_de_localidad) <= 0 ){\n\t\t\t\t$clave_de_localidad\t\t\t= $xLc->DomicilioLocalidadClave();\n\t\t\t}\n\t\t\t$xLoc->set($clave_de_localidad);\n\t\t} else {\n\t\t\t$xLoc->init();\n\t\t}\n\t\t$nombre_localidad\t\t\t\t= ($nombre_localidad == \"\") ? $xLoc->getNombre() : $nombre_localidad;\n\t\t//Tipos de Acceso calle, avenida, callejon privada, andador\n\t\tif($nombre_pais == \"\"){\n\t\t\t$xPais\t= new cDomiciliosPaises($clave_de_pais);\n\t\t\t//$xPais->getPaisPorMoneda($moneda)\n\t\t\t$xTP\t= new cPersonas_domicilios_paises();\n\t\t\t$xTP->setData( $xTP->query()->initByID($clave_de_pais) );\n\t\t\t$nombre_pais\t= $xTP->nombre_oficial()->v();\n\t\t\t$municipio\t\t= ($nombre_municipo == \"\") ? $nombre_localidad : strtoupper($nombre_municipo);\n\t\t\t$estado\t\t\t= ($nombre_estado == \"\") ? $nombre_localidad : strtoupper($nombre_estado);\n\t\t}\n\t\t\n\t\t$estado\t\t\t\t= ($nombre_estado == \"\") ? $xLc->DomicilioEstado() : strtoupper($nombre_estado);\n\t\t$nombre_localidad\t= ($nombre_localidad == \"\") ? $xLc->DomicilioLocalidad() : strtoupper($nombre_localidad);\n\t\t$municipio\t\t\t= ($nombre_municipo == \"\") ? $xLc->DomicilioMunicipio() : strtoupper($nombre_municipo);\n\t\t\n\t\t$calle\t\t\t\t= setCadenaVal($calle);\n\t\t$colonia\t\t\t= setCadenaVal($colonia);\n\t\t$estado\t\t\t\t= setCadenaVal($estado);\n\t\t$nombre_localidad\t= setCadenaVal($nombre_localidad);\n\t\t$municipio\t\t\t= setCadenaVal($municipio);\n\t\t$sql\t\t= \"INSERT INTO socios_vivienda(socio_numero, tipo_regimen, calle, numero_exterior, numero_interior, colonia,\n\t\t\t\tlocalidad, estado, municipio, telefono_residencial, telefono_movil,\n\t\t\t\ttiempo_residencia, referencia, idusuario, principal, tipo_domicilio, codigo_postal,\n\t\t\t\tfecha_alta, codigo , sucursal,\n\t\t\t\teacp, coordenadas_gps, tipo_de_acceso, fecha_de_verificacion, oficial_de_verificacion, estado_actual, clave_de_localidad,\n\t\t\t\tclave_de_pais, nombre_de_pais)\n\t\t\t\tVALUES\n\t\t\t\t($socio, $regimen, '$calle', '$numero_exterior', '$numero_interior', '$colonia',\n\t\t\t\t'$nombre_localidad', '$estado', '$municipio', '$telefono_fijo','$telefono_movil',\n\t\t\t\t$tiempo_de_residir, '$referencia', $usuario, '$es_principal', $tipo, '$codigo_postal',\n\t\t\t\t'$fechaalta', $socio, '$sucursal',\n\t\t\t\t'$eacp', '$gps', '$TipoDeAcceso', '$fechaalta', $usuario, 99, $clave_de_localidad,\n\t\t\t\t'$clave_de_pais', '$nombre_pais')\";\n\t\t$sucess\t\t= $xQL->setRawQuery($sql);\n\t\tif ( $sucess != false ){\n\t\t\t$id\t\t\t\t\t= $xQL->getLastInsertID();\n\t\t\t$this->mIDVivienda\t= $id;\n\t\t\t$msg\t\t\t.= \"OK\\tSe agrega la Vivienda con ID $id CP $codigo_postal y Localidad $clave_de_localidad del pais $nombre_pais\\r\\n\";\n\t\t\t//Actualiza el Dato de Domicilio del Grupo Solidario\n\t\t\tif( ($TipoDeIngreso == TIPO_INGRESO_GRUPO) AND (intval($es_principal) == SYS_UNO) ){\n\t\t\t\t$xGrp\t= new cGrupo($this->mCodigo);\n\t\t\t\t$DDom\t= $this->getDatosDomicilio();\n\t\t\t\t$arrUp\t= array(\n\t\t\t\t\t\t\"direccion_gruposolidario\" => $this->getDomicilio(),\n\t\t\t\t\t\t\"colonia_gruposolidario\" => $DDom[\"colonia\"]\n\t\t\t\t);\n\t\t\t\t$xGrp->setUpdate($arrUp);\n\t\t\t\t$msg\t.= $xGrp->getMessages();\n\t\t\t}\n\t\t\t$this->setCuandoSeActualiza();\n\t\t}\n\t\t$this->mMessages\t.= $msg;\n\t\treturn $sucess;\n\t}", "public function getCodigoViaje(){\n\t\t$codigo = 'VPI';\n\t\t$codigo .= '-'.str_pad($this->nroViaje['valor'], 4, '0', STR_PAD_LEFT);\n\t\treturn $codigo;\n\t}", "public function boleta()\n\t{\n\t\t//\n\t}", "function ajouterAvis($avis){\n\t\t\t//$sql=\"INSERT INTO avis (text_avis,client) VALUES (:text_avis,'1')\";\n\t\t\t$sql=\"insert into avis (text_avis,client) values (:text_avis,:client) \";\n\t\t\t$db = config::getConnexion();\n\t\t\ttry{\n\t\t\t\t$query = $db->prepare($sql);\n\t\t\t\n\t\t\t\t$query->execute([\n\t\t\t\t\t'text_avis' => $avis->getText_avis(),\n\t\t\t\t\t'client' => '1'\n\t\t\t\t]);\t\t\t\n\t\t\t}\n\t\t\tcatch (Exception $e){\n\t\t\t\techo 'Erreur: '.$e->getMessage();\n\t\t\t}\t\t\t\n\t\t}", "public function correu(){\n echo \" correu !\";\n }", "public function voirsolde()\n {\n echo \"le solde du compte est de $this->solde \";\n }", "public function nadar()\n {\n }" ]
[ "0.67037445", "0.66259015", "0.6406372", "0.6372174", "0.6363704", "0.63108146", "0.6254146", "0.6203818", "0.6180267", "0.6137401", "0.61024684", "0.6098285", "0.6078396", "0.60733074", "0.607026", "0.6037753", "0.6035296", "0.60192764", "0.6011145", "0.6008205", "0.5997702", "0.5983569", "0.59823227", "0.59754485", "0.5973239", "0.5968957", "0.5967732", "0.5940649", "0.59348977", "0.58935285", "0.5872392", "0.5866495", "0.5855881", "0.58483183", "0.5836376", "0.58230054", "0.58183783", "0.58115065", "0.58105296", "0.58103174", "0.57987297", "0.5791572", "0.57775176", "0.57736915", "0.5767032", "0.57645553", "0.5734386", "0.57309586", "0.57306147", "0.57286245", "0.57215184", "0.57198215", "0.5712707", "0.571127", "0.5706784", "0.5699111", "0.56932294", "0.5687707", "0.5686828", "0.5685707", "0.5683231", "0.5680981", "0.56696373", "0.56683576", "0.5667793", "0.566131", "0.5657793", "0.5655627", "0.56543314", "0.5651467", "0.56478834", "0.56428736", "0.5641207", "0.5639907", "0.5626701", "0.5619478", "0.5615639", "0.56115454", "0.5610574", "0.5608421", "0.5603812", "0.56037354", "0.55998677", "0.55995125", "0.5597909", "0.55937433", "0.5589752", "0.5588509", "0.5586937", "0.55755395", "0.55716604", "0.55698943", "0.55632484", "0.5560776", "0.5560243", "0.5559011", "0.5558963", "0.5557397", "0.5557324", "0.5556947", "0.55530477" ]
0.0
-1
hi Some hacky stuff to get rid of that iFrame PayPal introduces Submits the top form after it appends the GET variables from PayPal
public function check_paypal_return() { // Cancel payment if ( isset( $_GET['paypal_digital'] ) && $_GET['paypal_digital'] == 'cancel' ) { wp_print_scripts( 'jquery' ); ?><script> jQuery(function() { var blocker = top.document.getElementById("PPDGFrame"); // Checkout button var button = top.document.getElementsByName('bundle_checkout')[0]; jQuery(button).html('Checkout'); jQuery(button).prop('disabled', false); // Tip button var button = top.document.getElementsByName('giveTip'); jQuery(button[0]).html('Checkout'); jQuery(button[0]).prop('disabled', false); jQuery(button[1]).html('Checkout'); jQuery(button[1]).prop('disabled', false); jQuery(blocker).remove(); }); </script><?php exit; } // Returning from PayPal if ( isset( $_GET['PayerID'] ) && ( isset( $_GET['paypal_digital'] ) && $_GET['paypal_digital'] == 'paid' ) ) { EDD_PPDG_PayPal_IPN::load_block_ui(); ?><script> jQuery(function() { var form = top.document.forms["bundle-checkout-form"]; // If it wasn't the bundle checkout, let's see which tip form it might be if (!form) { // First we try the sharing form form = top.document.forms["tipshare-form"]; var button = jQuery(form).find('[name=giveTip]'); if (button.html() != 'Processing...') { // It wasn't the first tip form, so let's assume it's the second form = top.document.forms["tipster-form"]; } } var paypal_digital = jQuery('<input type="hidden" name="paypal_digital">').val('<?php echo $_GET["paypal_digital"]; ?>'); var payerid = jQuery('<input type="hidden" name="PayerID">').val('<?php echo $_GET["PayerID"]; ?>'); var token = jQuery('<input type="hidden" name="token">').val('<?php echo $_GET["token"]; ?>'); jQuery(form).append(paypal_digital); jQuery(form).append(payerid); jQuery(form).append(token); jQuery(form).submit(); }) </script><?php exit; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submit_paypal_post() {\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form which is submitted to your script\n // to validate the data, which in turn calls this function to create\n // another hidden form and submit to paypal.\n \n // The user will briefly see a message on the screen that reads:\n // \"Please wait, your order is being processed...\" and then immediately\n // is redirected to paypal.\n\n echo \"<html>\\n\";\n echo \"<head><title>Inoltro Pagamento...</title></head>\\n\";\n echo \"<body onLoad=\\\"document.forms['paypal_form'].submit();\\\">\\n\";\n echo \"<center><h2>Attendere, l'ordine &egrave; in fase di inoltro a paypal\";\n echo \" e sarete reindirizzati a breve.</h2></center>\\n\";\n echo \"<form method=\\\"post\\\" name=\\\"paypal_form\\\" \";\n echo \"action=\\\"\".$this->paypal_url.\"\\\">\\n\";\n\n foreach ($this->fields as $name => $value) {\n echo \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$value\\\"/>\\n\";\n }\n echo \"<center><br/><br/>Se non venite reindirizzati al sito \";\n echo \"paypal entro 5 secondi...<br/><br/>\\n\";\n echo \"<input type=\\\"submit\\\" value=\\\"Cliccare qui\\\"></center>\\n\";\n \n echo \"</form>\\n\";\n echo \"</body></html>\\n\";\n\t exit;\n\n }", "function submit_paypal_post() \n \t{\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form which is submitted to your script\n // to validate the data, which in turn calls this function to create\n // another hidden form and submit to paypal.\n \n // The user will briefly see a message on the screen that reads:\n // \"Please wait, your order is being processed...\" and then immediately\n // is redirected to paypal.\n\n echo \"<html>\\n\";\n echo \"<head><title>Processing Payment...</title></head>\\n\";\n echo \"<body onLoad=\\\"document.forms['paypal_form'].submit();\\\">\\n\";\n // echo \"<center><h2>Please wait, your order is being processed and you\";\n //echo \" will be redirected to the paypal website.</h2></center>\\n\";\n echo \"<form method=\\\"post\\\" name=\\\"paypal_form\\\" \";\n echo \"action=\\\"\".$this->paypal_url.\"\\\">\\n\";\n\n foreach ($this->fields as $name => $value) \n\t {\n echo \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$value\\\"/>\\n\";\n }\n // echo \"<center><br/><br/>If you are not automatically redirected to \";\n // echo \"paypal within 5 seconds...<br/><br/>\\n\";\n // echo \"<input type=\\\"submit\\\" value=\\\"Click Here\\\"></center>\\n\";\n \n echo \"</form>\\n\";\n echo \"</body></html>\\n\";\n \n \t}", "function redirectPayment($baseUri, $amount_iUSD, $amount, $currencySymbol, $api_key, $redirect_url) {\n error_log(\"Entered into auto submit-form\");\n error_log(\"Url \".$baseUri . \"?api_key=\" . $api_key);\n // Using Auto-submit form to redirect user\n return \"<form id='form' method='post' action='\". $baseUri . \"?api_key=\" . $api_key.\"'>\".\n \"<input type='hidden' autocomplete='off' name='amount' value='\".$amount.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='amount_iUSD' value='\".$amount_iUSD.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='callBackUrl' value='\".$redirect_url.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='api_key' value='\".$api_key.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='cur' value='\".$currencySymbol.\"'/>\".\n \"</form>\".\n \"<script type='text/javascript'>\".\n \"document.getElementById('form').submit();\".\n \"</script>\";\n}", "function print_direct_payment_form($amount = 0, $description = '', $currency = '', $customencrypted = '', $returnurl = '')\n {\n global $ilance, $ilconfig, $headinclude;\n\t\t$ts = time();\n\t\t$sess_id = md5(rand());\n\t\t$_SESSION['ilancedata']['user']['ts'] = $ts;\n\t\t$order_id = $customencrypted;\n\t\t$amount = str_replace(array(',', '.'), '', sprintf(\"%01.2f\", $ilance->currency->string_to_number($amount)));\n\t\t$sig = md5($ilconfig['platnosci_pos_id'] . $sess_id . $ilconfig['platnosci_pos_auth_key'] . $amount . $description . $order_id . $_SESSION['ilancedata']['user']['firstname'] . $_SESSION['ilancedata']['user']['lastname'] . $_SESSION['ilancedata']['user']['address'] . $_SESSION['ilancedata']['user']['city'] . $_SESSION['ilancedata']['user']['postalzip'] . $_SESSION['ilancedata']['user']['email'] . IPADDRESS . $ts . $ilconfig['platnosci_pos_key1']);\n\t\t$html = '<form action=\"https://www.platnosci.pl/paygw/ISO/NewPayment/xml\" method=\"POST\" name=\"payform\">\n<input type=\"hidden\" name=\"first_name\" value=\"' . $_SESSION['ilancedata']['user']['firstname'] . '\">\n<input type=\"hidden\" name=\"last_name\" value=\"' . $_SESSION['ilancedata']['user']['lastname'] . '\">\n<input type=\"hidden\" name=\"email\" value=\"' . $_SESSION['ilancedata']['user']['email'] . '\">\n<input type=\"hidden\" name=\"street\" value=\"' . $_SESSION['ilancedata']['user']['address'] . '\">\n<input type=\"hidden\" name=\"city\" value=\"' . $_SESSION['ilancedata']['user']['city'] . '\">\n<input type=\"hidden\" name=\"post_code\" value=\"' . $_SESSION['ilancedata']['user']['postalzip'] . '\">\n<input type=\"hidden\" name=\"order_id\" value=\"' . $customencrypted . '\">\n<input type=\"hidden\" name=\"pos_id\" value=\"' . $ilconfig['platnosci_pos_id'] . '\">\n<input type=\"hidden\" name=\"pos_auth_key\" value=\"' . $ilconfig['platnosci_pos_auth_key'] . '\">\n<input type=\"hidden\" name=\"session_id\" value=\"' . $sess_id . '\">\n<input type=\"hidden\" name=\"amount\" value=\"' . $amount . '\">\n<input type=\"hidden\" name=\"desc\" value=\"' . $description . '\">\n<input type=\"hidden\" name=\"client_ip\" value=\"' . IPADDRESS . '\">\n<input type=\"hidden\" name=\"js\" value=\"1\">';\n\t\t\t\t/*\n\t\t\t\t * <input type=\"hidden\" name=\"ts\" value=\"'.$ts.'\">\n\t\t\t\t<input type=\"hidden\" name=\"sig\" value=\"'.$sig.'\">\n\t\t\t\t */\n\t\t\t\t$headinclude .= '<script type=\"text/javascript\">\n<!--\ndocument.forms[\\'payform\\'].js.value=1;\n-->\n</script>';\n return $html; \n }", "function index() {\n if (empty($_GET['action']))\n $_GET['action'] = 'process';\n// echo \"<pre>\";\n// var_dump($_REQUEST);\n// echo \"<pre>\";\n switch ($_GET['action']) {\n case 'process': // Process and order...\n // There should be no output at this point. To process the POST data,\n // the submit_paypal_post() function will output all the HTML tags which\n // contains a FORM which is submited instantaneously using the BODY onload\n // attribute. In other words, don't echo or printf anything when you're\n // going to be calling the submit_paypal_post() function.\n // This is where you would have your form validation and all that jazz.\n // You would take your POST vars and load them into the class like below,\n // only using the POST values instead of constant string expressions.\n // For example, after ensureing all the POST variables from your custom\n // order form are valid, you might have:\n //\n // $this->paypal->add_field('first_name', $_POST['first_name']);\n // $this->paypal->add_field('last_name', $_POST['last_name']);\n// echo \"<pre>\";\n// var_dump($_SESSION);\n// echo \"<pre>\";\n if (!$this->session->userdata('is_logged_in')) {\n $type = $this->session->userdata('type');\n redirect('http://www.streamact.com/', 'refresh');\n }\n try {\n $description = $_POST['description'];\n $payment = $_POST['payment'];\n $type_payment = $_POST['type_payment'];\n $rand = rand(1000, 9999);\n $id = date(\"Ymd\") . date(\"His\") . rand(1000, 9999) . $rand;\n// echo \"<pre>\";\n// var_dump($_POST);\n// echo \"<pre>\";\n //$key = \"track_\".md5(date(\"Y-m-d:\").rand());\n\n $this->paypal->add_field('business', '[email protected]');\n// $this->paypal->add_field('return', 'http://www.streamact.com/panel/user_purchase');\n $this->paypal->add_field('return', 'http://www.streamact.com/panel/paypal/success');\n $this->paypal->add_field('cancel_return', 'http://www.streamact.com/panel/store');\n $this->paypal->add_field('notify_url', 'http://www.streamact.com/panel/paypal/ipn');\n $this->paypal->add_field('item_name', $description);\n $this->paypal->add_field('amount', $payment);\n $this->paypal->add_field('key', $key);\n $this->paypal->add_field('item_number', $id);\n\n\n $paypal_transaction = new stream\\stream_paypal_transactions();\n $paypal_transaction->type_payment = $type_payment;\n $paypal_transaction->amount = $payment;\n $paypal_transaction->id_producto = $_POST['id'];\n $paypal_transaction->notes = isset($_POST['notes']) ? $_POST['notes'] : 0;\n $paypal_transaction->id_seguimiento = $id;\n $paypal_transaction->id_usuario = $_SESSION['user_id'];\n $paypal_transaction->type_user = ($_SESSION['type'] == \"User\") ? \"2\" : $_SESSION['type'] == \"Artist\" ? \"1\" : \"0\";\n $paypal_transaction->type_payment = $_POST['type_payment'];\n $paypal_transaction->fecha_hora = date(\"Y-m-d H:i:s\");\n \n\n $this->stream->persist($paypal_transaction);\n $this->stream->flush();\n // submit the fields to paypal\n $this->paypal->submit_paypal_post();\n } catch (Exception $exc) {\n echo \"<pre>\";\n echo $exc->getTraceAsString();\n echo \"<pre>\";\n }\n\n// $paypal_transaction->ipn_track_id=$myPost[''];\n // $this->paypal->dump_fields(); // for debugging, output a table of all the fields\n break;\n }\n }", "static function pmpro_checkout_after_form()\n\t\t{\n\t\t?>\n\t\t<script>\n\t\t\t<!--\n\t\t\t//choosing payment method\n\t\t\tjQuery('input[name=gateway]').click(function() {\n\t\t\t\tif(jQuery(this).val() == 'paypal')\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').hide();\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').show();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').show();\n\t\t\t\t\tjQuery('#pmpro_submit_span').show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_submit_span').hide();\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//select the radio button if the label is clicked on\n\t\t\tjQuery('a.pmpro_radio').click(function() {\n\t\t\t\tjQuery(this).prev().click();\n\t\t\t});\n\t\t\t-->\n\t\t</script>\n\t\t<?php\n\t\t}", "public function getCheckoutForm(){\r\n\r\n $form='\r\n <form id=\"paypal_checkout\" action=\"https://www.sandbox.paypal.com/cgi-bin/webscr\" method=\"post\">';\r\n\r\n //==> Variables defining a cart, there shouldn't be a need to change those <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"cmd\" value=\"_cart\" />\r\n <input type=\"hidden\" name=\"upload\" value=\"1\" />\t\t\t\r\n <input type=\"hidden\" name=\"no_note\" value=\"0\" />\t\t\t\t\t\t\r\n <input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF\" />\t\t\t\t\t\r\n <input type=\"hidden\" name=\"tax\" value=\"0\" />\t\t\t\r\n <input type=\"hidden\" name=\"rm\" value=\"2\" />';\r\n \r\n //==> Personnalised variables, they get their values from the specified settings nd the class attributes <==//\r\n $form.='\r\n <input type=\"hidden\" name=\"business\" value=\"'.$this->business.'\" />\r\n <input type=\"hidden\" name=\"handling_cart\" value=\"'.$this->shipping.'\" />\r\n <input type=\"hidden\" name=\"currency_code\" value=\"'.$this->currency.'\" />\r\n <input type=\"hidden\" name=\"lc\" value=\"'.$this->location.'\" />\r\n <input type=\"hidden\" name=\"return\" value=\"'.$this->returnurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"cbt\" value=\"'.$this->returntxt.'\" />\r\n <input type=\"hidden\" name=\"cancel_return\" value=\"'.$this->cancelurl.'\" />\t\t\t\r\n <input type=\"hidden\" name=\"custom\" value=\"'.$this->custom.'\" />';\r\n\r\n //==> The items of the cart <==//\r\n $cpt=1;\r\n if(!empty($this->items)){foreach($this->items as $item){\r\n $form.='\r\n <div id=\"item_'.$cpt.'\" class=\"itemwrap\">\r\n <input type=\"hidden\" name=\"item_name_'.$cpt.'\" value=\"'.$item['name'].'\" />\r\n <input type=\"hidden\" name=\"quantity_'.$cpt.'\" value=\"'.$item['quantity'].'\" />\r\n <input type=\"hidden\" name=\"amount_'.$cpt.'\" value=\"'.$item['price'].'\" />\r\n <input type=\"hidden\" name=\"shipping_'.$cpt.'\" value=\"'.$item['shipping'].'\" />\r\n </div>';\r\n $cpt++;\r\n }}\r\n\r\n //==> The submit button, (you can specify here your own button) <==//\r\n $form.='\r\n <input id=\"ppcheckoutbtn\" type=\"submit\" value=\"Checkout\" class=\"button\" />\r\n </form>';\r\n\r\n return $form;\r\n }", "private function _redirectToHostedPaymentForm()\n\t{\n\t\t$model = Mage::getModel('tpg/direct');\n\t\t$szActionURL = $model->getConfigData('hostedpaymentactionurl');\n\t\t$cookies = Mage::getSingleton('core/cookie')->get();\n\t\t$checkoutSession = Mage::getSingleton('checkout/session');\n\t\t$szServerResultURLCookieVariables = '';\n\t\t$szServerResultURLFormVariables = '';\n\t\t$szServerResultURLQueryStringVariables = '';\n\n\t\t// create a Magento form\n\t\t$form = new Varien_Data_Form();\n\t\t$form->setAction($szActionURL)\n\t\t\t->setId('HostedPaymentForm')\n\t\t\t->setName('HostedPaymentForm')\n\t\t\t->setMethod('POST')\n\t\t\t->setUseContainer(true);\n\n\t\t$form->addField(\"HashDigest\", 'hidden', array('name' => \"HashDigest\", 'value' => $checkoutSession->getHashdigest()));\n\t\t$form->addField(\"MerchantID\", 'hidden', array('name' => \"MerchantID\", 'value' => $checkoutSession->getMerchantid()));\n\t\t$form->addField(\"Amount\", 'hidden', array('name' => \"Amount\", 'value' => $checkoutSession->getAmount()));\n\t\t$form->addField(\"CurrencyCode\", 'hidden', array('name' => \"CurrencyCode\", 'value' => $checkoutSession->getCurrencycode()));\n\t\t$form->addField(\"EchoCardType\", 'hidden', array('name' => \"EchoCardType\", 'value' => $checkoutSession->getEchoCardType()));\n\t\t$form->addField(\"OrderID\", 'hidden', array('name' => \"OrderID\", 'value' => $checkoutSession->getOrderid()));\n\t\t$form->addField(\"TransactionType\", 'hidden', array('name' => \"TransactionType\", 'value' => $checkoutSession->getTransactiontype()));\n\t\t$form->addField(\"TransactionDateTime\", 'hidden', array('name' => \"TransactionDateTime\", 'value' => $checkoutSession->getTransactiondatetime()));\n\t\t$form->addField(\"CallbackURL\", 'hidden', array('name' => \"CallbackURL\", 'value' => $checkoutSession->getCallbackurl()));\n\t\t$form->addField(\"OrderDescription\", 'hidden', array('name' => \"OrderDescription\", 'value' => $checkoutSession->getOrderdescription()));\n\t\t$form->addField(\"CustomerName\", 'hidden', array('name' => \"CustomerName\", 'value' => $checkoutSession->getCustomername()));\n\t\t$form->addField(\"Address1\", 'hidden', array('name' => \"Address1\", 'value' => $checkoutSession->getAddress1()));\n\t\t$form->addField(\"Address2\", 'hidden', array('name' => \"Address2\", 'value' => $checkoutSession->getAddress2()));\n\t\t$form->addField(\"Address3\", 'hidden', array('name' => \"Address3\", 'value' => $checkoutSession->getAddress3()));\n\t\t$form->addField(\"Address4\", 'hidden', array('name' => \"Address4\", 'value' => $checkoutSession->getAddress4()));\n\t\t$form->addField(\"City\", 'hidden', array('name' => \"City\", 'value' => $checkoutSession->getCity()));\n\t\t$form->addField(\"State\", 'hidden', array('name' => \"State\", 'value' => $checkoutSession->getState()));\n\t\t$form->addField(\"PostCode\", 'hidden', array('name' => \"PostCode\", 'value' => $checkoutSession->getPostcode()));\n\t\t$form->addField(\"CountryCode\", 'hidden', array('name' => \"CountryCode\", 'value' => $checkoutSession->getCountrycode()));\n\t\t$form->addField(\"CV2Mandatory\", 'hidden', array('name' => \"CV2Mandatory\", 'value' => $checkoutSession->getCv2mandatory()));\n\t\t$form->addField(\"Address1Mandatory\", 'hidden', array('name' => \"Address1Mandatory\", 'value' => $checkoutSession->getAddress1mandatory()));\n\t\t$form->addField(\"CityMandatory\", 'hidden', array('name' => \"CityMandatory\", 'value' => $checkoutSession->getCitymandatory()));\n\t\t$form->addField(\"PostCodeMandatory\", 'hidden', array('name' => \"PostCodeMandatory\", 'value' => $checkoutSession->getPostcodemandatory()));\n\t\t$form->addField(\"StateMandatory\", 'hidden', array('name' => \"StateMandatory\", 'value' => $checkoutSession->getStatemandatory()));\n\t\t$form->addField(\"CountryMandatory\", 'hidden', array('name' => \"CountryMandatory\", 'value' => $checkoutSession->getCountrymandatory()));\n\t\t$form->addField(\"ResultDeliveryMethod\", 'hidden', array('name' => \"ResultDeliveryMethod\", 'value' => $checkoutSession->getResultdeliverymethod()));\n\t\t$form->addField(\"ServerResultURL\", 'hidden', array('name' => \"ServerResultURL\", 'value' => $checkoutSession->getServerresulturl()));\n\t\t$form->addField(\"PaymentFormDisplaysResult\", 'hidden', array('name' => \"PaymentFormDisplaysResult\", 'value' => $checkoutSession->getPaymentformdisplaysresult()));\n\t\t$form->addField(\"ServerResultURLCookieVariables\", 'hidden', array('name' => \"ServerResultURLCookieVariables\", 'value' => $checkoutSession->getServerresulturlcookievariables()));\n\t\t$form->addField(\"ServerResultURLFormVariables\", 'hidden', array('name' => \"ServerResultURLFormVariables\", 'value' => $checkoutSession->getServerresulturlformvariables()));\n\t\t$form->addField(\"ServerResultURLQueryStringVariables\", 'hidden', array('name' => \"ServerResultURLQueryStringVariables\", 'value' => $checkoutSession->getServerresulturlquerystringvariables()));\n\n\t\t// reset the session items\n\t\t$checkoutSession\n\t\t\t->setHashdigest(null)\n\t\t\t->setMerchantid(null)\n\t\t\t->setAmount(null)\n\t\t\t->setCurrencycode(null)\n\t\t\t->setEchoCardType(null)\n\t\t\t->setOrderid(null)\n\t\t\t->setTransactiontype(null)\n\t\t\t->setTransactiondatetime(null)\n\t\t\t->setCallbackurl(null)\n\t\t\t->setOrderdescription(null)\n\t\t\t->setCustomername(null)\n\t\t\t->setAddress1(null)\n\t\t\t->setAddress2(null)\n\t\t\t->setAddress3(null)\n\t\t\t->setAddress4(null)\n\t\t\t->setCity(null)\n\t\t\t->setState(null)\n\t\t\t->setPostcode(null)\n\t\t\t->setCountrycode(null)\n\t\t\t->setCv2mandatory(null)\n\t\t\t->setAddress1mandatory(null)\n\t\t\t->setCitymandatory(null)\n\t\t\t->setPostcodemandatory(null)\n\t\t\t->setStatemandatory(null)\n\t\t\t->setCountrymandatory(null)\n\t\t\t->setResultdeliverymethod(null)\n\t\t\t->setServerresulturl(null)\n\t\t\t->setPaymentformdisplaysresult(null)\n\t\t\t->setServerresulturlcookievariables(null)\n\t\t\t->setServerresulturlformvariables(null)\n\t\t\t->setServerresulturlquerystringvariables(null);\n\n\t\t$html = '<html><body>';\n\t\t$html .= $this->__('You will be redirected to a secure payment page in a few seconds.');\n\t\t$html .= $form->toHtml();\n\t\t$html .= '<script type=\"text/javascript\">document.getElementById(\"HostedPaymentForm\").submit();</script>';\n\t\t$html .= '</body></html>';\n\n\t\treturn $html;\n\t}", "function redirect_form()\n{\n global $pxpay;\n \n $request = new PxPayRequest();\n \n $http_host = getenv(\"HTTP_HOST\");\n $request_uri = getenv(\"SCRIPT_NAME\");\n $server_url = \"http://$http_host\";\n #$script_url = \"$server_url/$request_uri\"; //using this code before PHP version 4.3.4\n #$script_url = \"$server_url$request_uri\"; //Using this code after PHP version 4.3.4\n $script_url = (version_compare(PHP_VERSION, \"4.3.4\", \">=\")) ?\"$server_url$request_uri\" : \"$server_url/$request_uri\";\n $EnableAddBillCard = 1;\n \n # the following variables are read from the form\n $Quantity = $_REQUEST[\"Quantity\"];\n $MerchantReference = sprintf('%04x%04x-%04x-%04x',mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0x0fff) | 0x4000);\n $Address1 = $_REQUEST[\"Address1\"];\n $Address2 = $_REQUEST[\"Address2\"];\n $Address3 = $_REQUEST[\"Address3\"];\n \n #Calculate AmountInput\n $AmountInput = 21.50;\n \n #Generate a unique identifier for the transaction\n $TxnId = uniqid(\"ID\");\n \n #Set PxPay properties\n $request->setMerchantReference($MerchantReference);\n $request->setAmountInput($AmountInput);\n $request->setTxnData1($Address1);\n $request->setTxnData2($Address2);\n $request->setTxnData3($Address3);\n $request->setTxnType(\"Purchase\");\n $request->setCurrencyInput(\"NZD\");\n $request->setEmailAddress(\"[email protected]\");\n $request->setUrlFail($script_url);\t\t\t# can be a dedicated failure page\n $request->setUrlSuccess($script_url);\t\t\t# can be a dedicated success page\n $request->setTxnId($TxnId);\n $request->setRecurringMode(\"recurringinitial\");\n #The following properties are not used in this case\n $request->setEnableAddBillCard($EnableAddBillCard);\n # $request->setBillingId($BillingId);\n # $request->setOpt($Opt);\n\n \n #Call makeRequest function to obtain input XML\n $request_string = $pxpay->makeRequest($request);\n #Obtain output XML\n $response = new MifMessage($request_string);\n \n #Parse output XML\n $url = $response->get_element_text(\"URI\");\n $valid = $response->get_attribute(\"valid\");\n \n #Redirect to payment page\n header(\"Location: \".$url);\n}", "function AfterSubmitRedirect($url){\n \tif ($this->is_context_frame)$url.=\"&contextframe=1\";\n $this->Response->Redirect($url);\n }", "public function getMarkup($autolaunch = true) {\n $action = ($this->sandboxMode == 1) ?\n 'https://www.sandbox.paypal.com/cgi-bin/webscr':\n 'https://www.paypal.com/cgi-bin/webscr';\n\n $this->addHiddenField(\"currency_code\",$this->currencyCode);\n\n if (!empty($this->ipnUrl)) {\n $this->addHiddenField(\"notify_url\",$this->ipnUrl);\n }\n $custom = $this->customValuesToString();\n if (!empty($custom)) {\n $this->addHiddenField('custom', $custom);\n }\n\n $imgsrc = AftmConfiguration::getValue('site','imgsrc','/packages/aftm/images');\n\n $formHeader = \"<FORM id=\\\"paypalform\\\" action=\\\"$action\\\" method=\\\"post\\\">\\n\";\n\n if ($autolaunch) {\n $this->formLines[] = \"<noscript>\";\n }\n\n // $this->formLines[] = '<input type=\"submit\" name=\"submit\" value=\"Continue to PayPal\" />';\n $this->formLines[] = '<h3>Continue to PayPal</h3>';\n $this->formLines[] = '<input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">';\n $this->formLines[] = '<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">';\n\n if ($autolaunch) {\n $this->formLines[] = \"</noscript>\";\n }\n $this->formLines[] = '</form>';\n\n if ($autolaunch) {\n $this->formLines[] = \"<div id='paypal-launcher'>\";\n $this->formLines[] = \"<img src='$imgsrc/ajax-loader.gif' onload='document.getElementById(\\\"paypalform\\\").submit();' />\";\n $this->formLines[] = '<span style=\"font-size: 18px;\">Redirecting to PayPal. Please wait...</span>';\n $this->formLines[] = '</div>';\n }\n\n return $formHeader.implode(\"\\n\",$this->formLines);\n\n }", "function reportsetup_submit( Pieform $form, $values ) {\n $query = http_build_query( $values );\n lib::redirect( \"reportview.php?$query\" );\n}", "public static function\n\t\tprocess_frame_editor_form()\n\t{\n\t\t// NOT USED ANYMORE\n\t\t//\n\t\t//\n\n\t\t// echo 'print_r($_GET)' . \"\\n\";\n\t\t// print_r($_GET);\n\t\t// echo 'print_r($_POST)' . \"\\n\";\n\t\tprint_r($_POST);exit;\n\t\t//echo 'print_r($_SESSION)' . \"\\n\";\n\t\t//print_r($_SESSION);\n\t\t// echo '$_SESSION[\\'name\\']: ' . $_SESSION['name'] . \"\\n\";\n\t\t// echo '$_SESSION[\\'email\\']: ' . $_SESSION['email'] . \"\\n\";\n\t\t// \n\t\t// $return_to_url = self::get_frame_creator_page_url();\n\t\t$return_to_url = new HTMLTags_URL();\n\t\t$return_to_url->set_file('/');\n\t\t$return_to_url->set_get_variable('oo-page', 1);\n\t\t$return_to_url->set_get_variable('page-class', 'Oedipus_FrameCreatorPage');\n\n\t\t$return_to_url->set_get_variable('frame_values', 1);\n\n\t\tforeach ($_POST as $key=>$value)\n\t\t{\n\t\t\t$return_to_url->set_get_variable($key, $value);\n\t\t}\n\n\n\t\t// print_r($_POST);echo $return_to_url->get_as_string();exit;\n\t\t// \n\t\t// if (isset($_GET['add_person'])) {\n\t\t// $mysql_user_fcharactery = Database_MySQLUserFcharactery::get_instance();\n\t\t// $mysql_user = $mysql_user_fcharactery->get_for_this_project();\n\t\t// $database = $mysql_user->get_database();\n\t\t// \n\t\t// $people_frame = $database->get_frame('hpi_mailing_list_people');\n\t\t// \n\t\t// if (isset($_POST['name'])) {\n\t\t// $_SESSION['name'] = $_POST['name'];\n\t\t// }\n\t\t// \n\t\t// if (isset($_POST['email'])) {\n\t\t// $_SESSION['email'] = $_POST['email'];\n\t\t// }\n\t\t// \n\n\t\t// try {\n\t\t// $last_added_id = $oedipus_frames_frame->update_frame(\n\t\t// $_POST['name'],\n\t\t// $_POST['email'],\n\t\t// isset($_POST['force_email'])\n\t\t// );\n\t\t// \n\t\t// $return_to_url->set_get_variable('frame_updated');\n\n\t\t// \n\t\t// $_SESSION['last_added_id'] = $last_added_id;\n\t\t// \n\t\t// unset($_SESSION['name']);\n\t\t// unset($_SESSION['email']);\n\t\t// } catch (MailingList_NameAndEmailException $e) {\n\t\t// $return_to_url->set_get_variable('form_incomplete');\n\t\t// } catch (MailingList_NameTooLongException $e) {\n\t\t// $return_to_url->set_get_variable('name_too_long');\n\t\t// } catch (MailingList_EmailTooLongException $e) {\n\t\t// $return_to_url->set_get_variable('email_too_long');\n\t\t// } catch (MailingList_InvalidEmailException $e) {\n\t\t// $return_to_url->set_get_variable('email_incorrect');\n\t\t// } catch (Database_InvalidUserInputException $e) {\n\t\t// $return_to_url->set_get_variable('error_message', urlencode($e->getMessage()));\n\t\t// }\n\t\t// }\n\t\t// \n\t\t// print_r($return_to_url);\n\t\t#exit;\n\n\t\treturn $return_to_url;\n\t}", "private function form_action($matches){\r\n\t\t// $matches[1] holds single or double quote - whichever was used by webmaster\r\n\t\t\r\n\t\t// $matches[2] holds form submit URL - can be empty which in that case should be replaced with current URL\r\n\t\tif(!$matches[2]){\r\n\t\t\t$matches[2] = $this->base_url;\r\n\t\t}\r\n\t\t$new_action = proxify_url($matches[2], $this->base_url);\r\n//\t\tconsole_log('form_action-debug ' . no_encode_proxify_url($matches[2], $this->base_url));\r\n//\t\tconsole_logs('form_action-debug-new_action ' . $new_action);\r\n\r\n\r\n\t\t// what is form method?\r\n\t\t$form_post = preg_match('@method=([\"\\'])post\\1@i', $matches[0]) == 1;\r\n//\t\tconsole_log('$form_post '. $form_post);\r\n\t\t// take entire form string - find real url and replace it with proxified url\r\n\t\t$result = str_replace($matches[2], $new_action, $matches[0]);\r\n\t\t\r\n\t\t// must be converted to POST otherwise GET form would just start appending name=value pairs to your proxy url\r\n\t\tif(!$form_post){\r\n\t\t\r\n\t\t\t// may throw Duplicate Attribute warning but only first method matters\r\n\t\t\t$result = str_replace(\"<form\", '<form method=\"POST\"', $result);\r\n\t\t\t\r\n\t\t\t// got the idea from Glype - insert this input field to notify proxy later that this form must be converted to GET during http\r\n\t\t\t$result .= '<input type=\"hidden\" name=\"convertGET\" value=\"1\">';\r\n//\t\t\tconsole_log('form_action-debug-result ' );\r\n\t\t}\r\n\r\n//\t\tconsole_log('$result '. $result);\r\n\t\treturn $result;\r\n\t}", "public function submit() {\r\n\t\t$name_value_pairs = array();\r\n\t\tforeach ( $this->request_data as $key => $value ) {\r\n\t\t\t$name_value_pairs[] = $key . '=' . rawurlencode( $value );\r\n\t\t}\r\n\r\n\t\t$url = 'https://mms.paymentsensegateway.com/Pages/PublicPages/PaymentForm.aspx';\r\n\t\t$params = implode( '&', $name_value_pairs );\r\n\t\theader( 'Location: ' . $url . '?' . $params, false );\r\n\t\texit();\r\n\t}", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "function bare_pages_form_submit($form, &$form_state) {\n if (!empty($GLOBALS['bare_pages_close_modal'])) {\n // Hacky, but I don't see how to circumvent the \"?destination=path\" in any other way\n unset($_GET['destination']);\n $form_state['redirect'] = FALSE;// This seems to fail (on its own ?) -> using 'rebuild' as well\n $form_state['rebuild'] = TRUE;\n }\n}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\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\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "public function getForm($total=0, $user_id=0, $type=1 ){\n\t\t$resp = \"\"; \n\t\t$secureToken = uniqid('', true); \n\t\t$postData = \"USER=\". PAYPAL_PF_USER. \n\t\t\t\t\t \"&VENDOR=\".PAYPAL_PF_VENDOR. \n\t\t\t\t\t \"&PARTNER=\". PAYPAL_PF_PARTHER. \n\t\t\t\t\t \"&PWD=\".PAYPAL_PF_PASSWROD. \n\t\t\t\t\t \"&CREATESECURETOKEN=Y\". \n\t\t\t\t\t \"&SECURETOKENID=\" .$secureToken .\n\t\t\t\t\t \"&TRXTYPE=S\". \n\t\t\t\t\t \"&AMT=\" .$total ; \n\t\t\n\t\t $ch= curl_init(); \n\t\t curl_setopt($ch, CURLOPT_URL , PAYPAL_PF_HOST) ; \n\t\t curl_setopt($ch, CURLOPT_RETURNTRANSFER , true) ;\n\t\t curl_setopt($ch, CURLOPT_POST , true) ; \n\t\t curl_setopt($ch, CURLOPT_POSTFIELDS , $postData) ; \n\t\t $resp = curl_exec($ch ) ; \n\t\t if (!$resp)\n\t\t \t$resp = \"Empty Reponse\";\n \t\t parse_str($resp, $arr) ; \n\t \n\t\t if ($arr[\"RESULT\"] != 0 ) \n\t\t \t$resp = \"RETURNED Bad result \" . $arr[\"RESPMSG\"]; \n\t\t else{\n\t\t \t $resp = \" \n\t\t \t <iframe src='https://payflowlink.paypal.com?MODE=\".PAYPAL_PF_MODE.\"&SECURETOKEN={$arr[\"SECURETOKEN\"]}&SECURETOKENID={$secureToken}' width='490px' height='564px' border='0' frameborder='0' allowtransparency='true' > \n\t\t \t </iframe> \"; \n\t\t }\n\t\t return $resp ; \n\t\t\n\t}", "function commerce_oz_eway_3p_redirect_form($form, &$form_state, $order, $payment_method) {\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/eway_68.png';\n\t\n\t$descText = '<br /><a href=\"http://www.eway.com.au\"><img src=\"' . $logopath . '\" /></a><br /><br />Click the \\'Proceed to eWay\\' button to complete payment of your purchase at eWay.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n\n\n $form['commerce_oz_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => $payment_method['title'],\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \t\n \t // Get the order\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $order_id = $order->order_id;\n \t\n \t$transaction = _commerce_oz_open_transaction($payment_method, $order->order_id);\n \t\n \t$request_map = _commerce_oz_eway_3p_build_request($transaction, $payment_method, $order) ;\n \t\n\t$request_string = http_build_query($request_map);\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, COMMERCE_OZ_EWAY_3P_REQUEST_URL . '?' . $request_string);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\n\t$response = curl_exec($ch);\n\n\t$responsemode = _commerce_oz_fetch_data($response, '<result>', '</result>');\n $responseurl = _commerce_oz_fetch_data($response, '<uri>', '</uri>');\n\t\t \n\t$form['#action'] = $responseurl;\n\t\n\t$form_state['redirect'] = 'commerce_oz/eway/response';\n\t\n $form['commerce_oz_3p_head']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Proceed to eWay'),\n );\n\n//\t// dsm($form);\n//\t// dsm($form_state);\n\t\t\n return $form;\n \n}", "function rh_paypal() { \n\tob_start(); ?>\n\n\t<form name=\"input\" method=\"post\" action=\"#\">\n\t\t<br>\n\t\tNama Item <input type=\"Text\" name=\"nm_item\" id=\"nm_item\" value=\"<?php the_title(); ?>\">\n\t\t<br>\n\t\tHarga Rp <input type=\"number\" name=\"harga\" id=\"harga\" value=\"<?= $options; ?>\">\n\t\t<br>\n\t\t<input type=\"submit\" name=\"submit_item\">\n\t</form>\n\t<?php \n\tif (isset($_POST['submit_item'] ) ) {\n\t\t$item = $_POST['nm_item'];\n\t\t$harga = $_POST['harga'];\n\t\t?>\n\t\t<form name=\"_xclick\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_BLANK\">\n\t\t\t<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n\t\t\t<input type=\"hidden\" name=\"business\" value=\"<?= $options; ?>\">\n\t\t\t<input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n\t\t\t<input type=\"hidden\" name=\"item_name\" value=\"<?php echo $item; ?>\">\n\t\t\t<input type=\"hidden\" name=\"amount\" value=\"<?= $harga; ?>\">\n\t\t\t<input src=\"https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif\" name=\"Submit\" type=\"image\" value=\"pruchase\" alt=\"Purchase\" />\n\t\t</form>\n\n\t\t<?php\n\t} elseif (isset($_POST['nm_item']) && $_POST['harga'] == '') {\n\t\techo 'Silahkan isi semua field';\n\t\techo $options;\n\t}\n\n\treturn ob_get_clean();\n\n}", "function instructor_buttons(){\r\n$disabled=\"\";\r\n$myform=\"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\";\r\n\t$myform .= \"\\n\";\r\nif(!ipal_check_active_question()){$disabled= \"disabled=\\\"disabled\\\"\";}\r\n\r\n$myform .= \"<input type=\\\"submit\\\" value=\\\"Stop Polling\\\" name=\\\"clearQuestion\\\" \".$disabled.\"/>\\n</form>\\n\";\r\n\t\r\nreturn($myform);\r\n\t\r\n}", "function showL1editFormPage() {\n /*\n Composing some elements of the form.\n */\n /*\n Composing $nodeDivs.\n */\n $nodeDivs = composeL1EditForm_nodeDivs();\n /*\n Composing $buttonsDiv.\n */\n// $buttonsDiv = composeL1EditForm_buttonsDiv();\n\n//Put $ sign back in front of buttonsDiv in heredoc\n//after debugging.\n\n /*\n Sending the form to the browser.\n */\n $submitToken = time();\n $_SESSION['EKA_submitToken'] = $submitToken;\n\n site_header('Edit Knowledge Article');\n $php_self = $_SERVER['PHP_SELF'];\n $page_str = <<<EOPAGESTR\n\n\n<form action=\"$php_self\" method=\"post\">\n$nodeDivs\nbuttonsDiv\n <div>\n <input type=\"hidden\" name=\"submitToken\" value=\"$submitToken\">\n </div>\n</form>\n\n\nEOPAGESTR;\n echo $page_str;\n site_footer();\n return;\n}", "public function enquiryStep2($formData) {\n\n $logMsg = \"Telling server the period we're looking for, requesting more cookies...<br>\";\n echo $logMsg;\n\n $url = \"https://ebiz.campbelltown.nsw.gov.au/ePathway/Production/Web/GeneralEnquiry/EnquirySearch.aspx\";\n\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mEnquiryListsDropDownList'] = 23;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mSearchButton'] = \"Search\";\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetNameTextBox'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetNumberTextBox'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mStreetTypeDropDown'] = null;\n $formData['ctl00$MainBodyContent$mGeneralEnquirySearchControl$mTabControl$ctl04$mSuburbTextBox'] = null;\n $formData['hiddenInputToUpdateATBuffer_CommonToolkitScripts'] = 1;\n $formData['ctl00$mHeight'] = 653;\n $formData['ctl00$mWidth'] = 786;\n\n $formData = http_build_query($formData);\n\n $requestHeaders = [\n \"Host: ebiz.campbelltown.nsw.gov.au\",\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n \"Accept-Language: en-GB,en;q=0.5\",\n \"Accept-Encoding: none\",\n \"Referer: https://ebiz.campbelltown.nsw.gov.au/ePathway/Production/Web/GeneralEnquiry/EnquiryLists.aspx?ModuleCode=LAP\",\n \"Content-Type: application/x-www-form-urlencoded\"\n ];\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $formData);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_COOKIEFILE, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_COOKIEJAR, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0');\n\n $output = curl_exec($ch);\n $errno = curl_errno($ch);\n $errmsg = curl_error($ch);\n curl_close($ch);\n\n if ($errno !== 0) {\n\n $logMsg = \"cURL error in enquiryStep2 function: \" . $errmsg . \" (\" . $errno . \")\";\n $this->logger->info($logMsg);\n return false;\n }\n\n return $output;\n\n }", "function give_redirect_and_popup_form( $redirect, $args ) {\n\n\t// Check the page has Form Grid.\n\t$is_form_grid = isset( $_POST['is-form-grid'] ) ? give_clean( $_POST['is-form-grid'] ) : '';\n\n\tif ( 'true' === $is_form_grid ) {\n\n\t\t$payment_mode = give_clean( $_POST['payment-mode'] );\n\t\t$form_id = $args['form-id'];\n\n\t\t// Get the URL without Query parameters.\n\t\t$redirect = strtok( $redirect, '?' );\n\n\t\t// Add query parameters 'form-id' and 'payment-mode'.\n\t\t$redirect = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'form-id' => $form_id,\n\t\t\t\t'payment-mode' => $payment_mode,\n\t\t\t), $redirect\n\t\t);\n\t}\n\n\t// Return the modified URL.\n\treturn $redirect;\n}", "function getPayPalBtn($total) {\n $paypal_email = '[email protected]';\n $desc = 'Your order description'; // could be based on order, or static\n $return_url = 'http://www.your_url.com/orders/thankyou.html'; // thank you page\n $cancel_url = 'http://www.your_url.com'; // if user cancels rather than paying\n // could build string of order details (product abbr, qty)\n $custom = ''; // up to 256 chars\n \n $str = <<<EOS\n<form action=\"http://localhost/BadWolf/thanks.php\" method=\"post\">\n <input type=\"hidden\" name=\"cmd\" value=\"_xclick\" />\n <input type=\"hidden\" name=\"business\" value=\"$paypal_email\" />\n <input type=\"hidden\" name=\"amount\" value=\"$total\" />\n <input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n <input type=\"hidden\" name=\"item_name\" value=\"$desc\" />\n <input type=\"hidden\" name=\"custom\" value=\"$custom\" />\n <input type=\"hidden\" name=\"return\" value=\"$return_url\" />\n <input type=\"hidden\" name=\"cancel_return\" value=\"$cancel_url\" />\n <input type=\"image\" name=\"submit \"border=\"0\" \n src=\"http://www.privatepracticepreparedness.com/sites/all/images/BuyButton.png\"\n alt=\"Purchase\" /> \n</form>\nEOS;\n return $str;\n}", "protected function renderHiddenSecuredReferrerField() {}", "function set_submit_normal()\n\t{\n\t\t$this->_submit_type = \"application/x-www-form-urlencoded\";\n\t}", "function urlCanceled()\r\n\t{\r\n\t\t$input_def['id'] = 'urlCanceled';\r\n\t\t$input_def['name'] = 'urlCanceled';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_urloption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}", "public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}", "protected function _toHtml() \n {\n $zaakpay = Mage::getModel('zaakpay/transact');\n $fields = $zaakpay->getCheckoutFormFields();\n $form = '<form id=\"zaakpay_checkout\" method=\"POST\" action=\"' . $zaakpay->getZaakpayTransactAction() . '\">';\n foreach($fields as $key => $value) {\n if ($key == 'returnUrl') {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedURL($value).'\" />'.\"\\n\";\n\t\t\t} else {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedParam($value).'\" />'.\"\\n\";\n\t\t\t}\n }\n $form .= '</form>';\n $html = '<html><body>';\n $html .= $this->__('You will be redirected to the Zaakpay website in a few seconds.');\n $html .= $form;\n $html.= '<script type=\"text/javascript\">document.getElementById(\"zaakpay_checkout\").submit();</script>';\n $html.= '</body></html>';\n return $html;\n }", "function showGettingStartedForm($selectedProductIndex = NO_PRODUCT) {\n\t?>\n\t<iframe src=\"getting-started.php?getStartedProduct=<?=$selectedProductIndex?>\" frameborder=\"0\" name=\"gettingStarted\" style=\"height:290px;width:255px;overflow:hidden;\" scrolling=\"no\">\n\t</iframe>\n\t<?php\n}", "protected function getNoCacheAction() {\n\t\t$url = $this->gatewayPage->getRequest()->getFullRequestURL();\n\t\t$url_parts = wfParseUrl( $url );\n\t\tif ( isset( $url_parts['query'] ) ) {\n\t\t\t$query_array = wfCgiToArray( $url_parts['query'] );\n\t\t} else {\n\t\t\t$query_array = [];\n\t\t}\n\n\t\t// ensure that _cache_ does not get set in the URL\n\t\tunset( $query_array['_cache_'] );\n\n\t\t// make sure no other data that might overwrite posted data makes it into the URL\n\n\t\t$all_form_data = $this->gateway->getData_Unstaged_Escaped();\n\t\t$keys_we_need_for_form_loading = [\n\t\t\t'form_name',\n\t\t\t'ffname',\n\t\t\t'country',\n\t\t\t'currency',\n\t\t\t'language'\n\t\t];\n\t\t$form_data_keys = array_keys( $all_form_data );\n\n\t\tforeach ( $query_array as $key => $value ) {\n\t\t\tif ( in_array( $key, $form_data_keys ) ) {\n\t\t\t\tif ( !in_array( $key, $keys_we_need_for_form_loading ) ) {\n\t\t\t\t\tunset( $query_array[$key] );\n\t\t\t\t} else {\n\t\t\t\t\t$query_array[$key] = $all_form_data[$key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// construct the submission url\n\t\t$title = $this->gatewayPage->getPageTitle();\n\t\treturn wfAppendQuery( $title->getLocalURL(), $query_array );\n\t}", "function getSurveyForm()\n{\n\t$output = '<div id=\"div-survey-form-1\"><script type=\"text/javascript\" src=\"https://wq360.infusionsoft.com/app/form/iframe/4fe0ff1546212fbd13a93be716c6dc04\"></script></div>';\nreturn $output;\n}", "public function on_after_submit() {\n\t\t\n\t\t/*\n\t\t$post = array();\n\t\t$post['cm-name'] = $this->controller->questionAnswerPairs['1']['answer'].' '.$this->controller->questionAnswerPairs['2']['answer'];\n\t\t$post['cm-itutkr-itutkr'] = $this->controller->questionAnswerPairs['3']['answer'];\n\t\t\t\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 0);\n\t\tcurl_setopt($ch, CURLOPT_URL, 'http://url.to.my.campaignmonitor/myform');\n\t\t//Don't ask me what this does, I just know that without this funny header, the whole thing doesn't work!\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER,array('Expect:'));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1 );\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post );\n\t\t\n\t\t$url = curl_exec( $ch );\n\t\tcurl_close ($ch);\n\t\t*/\n\t}", "function PKG_OptionPageTail($layout)\n{\nPKG_OptionPageSaveAlsParameters($layout);\n\nPKG_OptionPageRender($layout);\n\necho(\"\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\\\"2\\\">\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t<input type=\\\"submit\\\" name=\\\"BUT_save\\\" value=\\\"Save\\\">\n\t\t\t\t\t\t</center>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</td>\n<tr>\n</table>\n</form>\n</body>\n</html>\");\n}", "public function action_ajax_get_paypal_form()\n\t{\n\t\t$this->auto_render = FALSE;\n\t\tparse_str(Kohana::sanitize($this->request->post('form_data')), $form_data);\n\t\t$form_data = (Object) $form_data;\n\n\t\t// Log the cart. The card ID will be needed in the PayPal callback to get the form data\n\t\tif (Settings::Instance()->get('cart_logging') == \"TRUE\" AND class_exists('Model_Checkout'))\n\t\t{\n\t\t\t$user = Auth::instance()->get_user();\n\t\t\t$checkout = new Model_Checkout;\n\t\t\t$cart_report = new Model_Cart();\n\t\t\t$details = array(\n\t\t\t\t'id' => (int) (microtime('get as float')*1000000), // unix timestamp in microseconds\n\t\t\t\t'user_agent' => $_SERVER['HTTP_USER_AGENT'],\n\t\t\t\t'ip_address' => $_SERVER['REMOTE_ADDR'],\n\t\t\t\t'user_id' => isset($user['id']) ? $user['id'] : NULL,\n\t\t\t\t'cart_data' => '{}',\n\t\t\t\t'form_data' => json_encode($form_data),\n\t\t\t\t'paid' => 0,\n\t\t\t\t'date_created' => date('Y-m-d H:i:s'),\n\t\t\t\t'date_modified' => date('Y-m-d H:i:s')\n\t\t\t);\n\t\t\t$cart_report->set($details)->save();\n\t\t\t$form_data->custom = $cart_report->get_id();\n\t\t}\n\n\t\t// PayPal data\n\t\t$paypal_data = new stdClass();\n\t\t$paypal_data->cmd = '_cart';\n\t\t$paypal_data->upload = 1;\n\t\t$paypal_data->business = Settings::instance()->get('paypal_email');\n\t\t$paypal_data->currency_code = 'EUR';\n\t\t$paypal_data->no_shipping = 2;\n\t\t$paypal_data->return = isset($form_data->return_url) ? $form_data->return_url : $_SERVER['HTTP_HOST'];\n\t\t$paypal_data->cancel_return = isset($form_data->cancel_return_url) ? $form_data->cancel_return_url : $_SERVER['HTTP_HOST'];\n\t\t$paypal_data->notify_url = URL::base().'/frontend/payments/paypal_callback/invoice';\n\t\t$paypal_data->custom = isset($form_data->custom) ? $form_data->custom : '';\n\t\t$paypal_data->{'item_name_1'} = isset($form_data->item_name) ? $form_data->item_name : 'Invoice Payment';\n\t\t$paypal_data->{'amount_1' } = $form_data->payment_total;\n\t\t$paypal_data->{'quantity_1' } = 1;\n\n\t\t// Return data\n\t\t$return = new stdClass;\n\t\t$return->status = TRUE;\n\t\t$return->data = $paypal_data;\n\t\t$return->data->test_mode = (Settings::instance()->get('paypal_test_mode') == 1);\n\n\t\t$this->response->body(json_encode($return));\n\t}", "public function payment_fields() {\n\n\t\t$this->log( 'Show Payment fields on the checkout page' );\n\n\t\t$referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : \"\";\n\n\t\t$this->log( 'Received GET data from [' . $referer. ']:' );\n\t\t$this->log( print_r($_GET, true ) );\n\n\t\t$this->log( 'Received POST data from [' . $referer. ']:' );\n\t\t$this->log( print_r($_POST, true ) );\n\n\t\tif ( $this->description ) {\n\t\t\techo wpautop( wp_kses_post( $this->description ) );\n\t\t}\n\t}", "function ipal_make_instructor_form(){\r\nglobal $ipal;\r\n$myform=\"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\";\r\n\t$myform .= \"\\n\";\r\n\t\tforeach(ipal_get_questions() as $items){\r\n$myform .= \"<input type=\\\"radio\\\" name=\\\"question\\\" value=\\\"\".$items['id'].\"\\\" />\";\r\n\r\n$myform .=\"<a href=\\\"show_question.php?qid=\".$items['id'].\"&id=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[question]</a>\";\r\n$myform .= \"<a href=\\\"standalone_graph.php?id=\".$items['id'].\"&ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[graph]</a>\".$items['question'].\"<br /><br />\\n\";\r\n\t\t}\r\nif(ipal_check_active_question()){\r\n\t$myform .= \"<input type=\\\"submit\\\" value=\\\"Send Question\\\" />\\n</form>\\n\";\r\n}else{\r\n$myform .= \"<input type=\\\"submit\\\" value=\\\"Start Polling\\\" />\\n</form>\\n\";}\r\n\r\n\treturn($myform);\r\n}", "public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }", "function mfcs_request_proxy_0_form_submit($form, &$form_state) {\n global $mfcs_determined;\n $user = cf_current_user();\n\n $url_arguments = '';\n if (!empty($mfcs_determined['complete'])) {\n $url_arguments .= '?' . $mfcs_determined['complete'];\n }\n\n $clicked_id = '';\n if (isset($form_state['triggering_element']['#id'])) {\n $clicked_id = $form_state['triggering_element']['#id'];\n }\n\n if ($clicked_id == 'submit-proxy-add') {\n $values = array(\n 'user_id' => NULL,\n 'proxy_id' => NULL,\n );\n\n if (cf_is_integer($form_state['values']['proxy']['proxy_id'])) {\n $values['proxy_id'] = $form_state['values']['proxy']['proxy_id'];\n }\n else {\n $matches = array();\n $matched = preg_match('@\\[id:\\s*(\\d+)\\].*@', $form_state['values']['proxy']['proxy_id'], $matches);\n\n if ($matched && !empty($matches[1])) {\n $values['proxy_id'] = $matches[1];\n }\n }\n\n if (cf_is_integer($form_state['values']['proxy']['user_id'])) {\n $values['user_id'] = $form_state['values']['proxy']['user_id'];\n }\n else {\n $matches = array();\n $matched = preg_match('@\\[id:\\s*(\\d+)\\].*@', $form_state['values']['proxy']['user_id'], $matches);\n\n if ($matched && !empty($matches[1])) {\n $values['user_id'] = $matches[1];\n }\n }\n\n $transaction = db_transaction();\n try {\n $query = db_select('mfcs_proxy_venue_coordinator', 'mpvc');\n $query->addField('mpvc', 'id', 'id');\n $query->condition('mpvc.proxy_id', $values['proxy_id']);\n $query->condition('mpvc.user_id', $values['user_id']);\n $query->condition('mpvc.disabled', 1);\n\n $result = $query->execute()->fetchField();\n\n if ($result > 0) {\n $query = db_update('mfcs_proxy_venue_coordinator');\n $query->fields(array('disabled' => 0));\n $query->condition('id', $result);\n $query->execute();\n }\n else {\n $query = db_insert('mfcs_proxy_venue_coordinator');\n $query->fields($values);\n $query->execute();\n }\n }\n catch (Error $e) {\n $transaction->rollback();\n cf_error::on_query_execution($e);\n\n form_set_error('form', 'An error occurred while trying to add the proxy. Please contact the support staff.');\n watchdog(MFCS_WATCHDOG_ID, 'An error occured while trying to create the proxy \\'%proxy_id\\' to proxy as \\'%user_id\\'.', array('%proxy_id' => $values['proxy_id'], '%user_id' => $values['user_id']), WATCHDOG_ERROR);\n\n $form_state['rebuild'] = TRUE;\n $form_state['redirect'] = FALSE;\n $form_state['submitted'] = FALSE;\n\n return;\n }\n catch (Exception $e) {\n $transaction->rollback();\n cf_error::on_query_execution($e);\n\n form_set_error('form', 'An error occurred while trying to add the proxy. Please contact the support staff.');\n watchdog(MFCS_WATCHDOG_ID, 'An error occured while trying to create the proxy \\'%proxy_id\\' to proxy as \\'%user_id\\'.', array('%proxy_id' => $values['proxy_id'], '%user_id' => $values['user_id']), WATCHDOG_ERROR);\n\n $form_state['rebuild'] = TRUE;\n $form_state['redirect'] = FALSE;\n $form_state['submitted'] = FALSE;\n\n return;\n }\n }\n\n // redirect after submitting.\n if (empty($form_state['values']['redirect_to'])) {\n $form_state['redirect'] = mfcs_build_redirect_array('requests/proxy-0');\n }\n else {\n $form_state['redirect'] = $form_state['values']['redirect_to'];\n }\n}", "protected function renderHiddenReferrerFields() {}", "function commerce_oz_eway_3p_redirect_form_submit($order, $payment_method) {\n \n// // dsm($payment_method, 'method');\n// \t// dsm($pane_form, 'pane');\n// \t// dsm($pane_values, 'values');\n// // dsm($order, 'order');\n// // dsm($charge, 'charge');\n \n // dsm($_POST, 'post'); \n // dsm($order, '$order'); \n // dsm($payment_method, '$payment_method'); \n \n if($_POST){\n// return;\n \n }\n \t \t \t\n // Get the order\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $order_id = $order->order_id;\n \n /*\n \n $credit_card = $pane_values['commerce_oz_3p_head']['credit_card'];\n // // dsm($pane_values);\n \n // Get the settings and set some vars for same\n // $settings = $payment_method['settings'];\n $debugmode = 'debug'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_debug'];\n $livemode = 'test'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_mode'];\n \n\t// Transaction record\n\t// Prepare a transaction object to log the API response.\n $transaction = _commerce_oz_open_transaction($payment_method['base'], $order->order_id);\n \n module_load_include('php', 'commerce_oz', 'includes/api/EwayPayment');\n\n\t$eway = new EwayPayment( '87654321', 'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp' );\n\t\n\t// Card Details\n\t\n\t$eway->setCardNumber( $credit_card['number'] );\n\t$eway->setCardExpiryMonth( $credit_card['exp_month'] );\n\t$eway->setCardExpiryYear( substr($credit_card['exp_year'], -2) );\n//\t$eway->setTotalAmount( $charge['amount'] );\n\t$eway->setTotalAmount\t(1000);\n\n\t$eway->setCVN( $credit_card['code'] );\n\t\n\t// Invoice & Transaction Details\n\t\n\t$eway->setCustomerInvoiceDescription( 'Testing' );\n\t$eway->setCustomerInvoiceRef( $order_id );\n\t$eway->setTrxnNumber( $transaction->transaction_id );\n\n \n $request_map = array_filter((array)$eway);\n \n $error = $eway->doPayment();\n \n $response_map = array_filter((array)$eway);\n */\n \n// // dsm($request_map);\n// // dsm($response_map);\n \n // _commerce_oz_eway_3p_close_transaction($transaction, $request_map, $response_map);\n\t\n//\t_commerce_oz_debug_transaction($transaction, $request_map, $response_map, TRUE);\n\t\n\t// Fire completion Rule\n\t//rules_invoke_event('commerce_oz_transaction_complete', $transaction);\n\t\n\t// return _commerce_oz_handle_payment_response($transaction, $request_map, $response_map);\n \n}", "function geneshop_basket_form_submit($form, &$form_state) {\n switch ($form_state['triggering_element']['#name']) {\n case 'clear':\n $form_state['redirect'] = 'basket/clear';\n break;\n/* case 'checkout':\n $form_state['redirect'] = 'basket/checkout';\n break;*/\n case 'phylo':\n $form_state['redirect'] = 'basket/phylo';\n break;\n case 'polypeptides':\n $form_state['redirect'] = 'basket/polypeptides';\n break;\n case 'mrna':\n $form_state['redirect'] = 'basket/mrna';\n break;\n case 'gene':\n $form_state['redirect'] = 'basket/gene';\n break;\n case 'align':\n $form_state['redirect'] = 'basket/align';\n break;\n }\n}", "private function getPageEditIframe($params) {\n\t\tif (!GeneralUtility::_GET('M') && !GeneralUtility::_GET('returnUrl') && $this->uid > 0) {\n\t\t\t$page = BackendUtility::getRecord('pages', $this->uid, 'doktype');\n\n\t\t\t$tsConf = BackendUtility::getPagesTSconfig($this->uid);\n\n\t\t\tif (isset($tsConf['TCEFORM.']['pageHeaderColumns.'][$page['doktype'] . '.']['list'])) {\n\t\t\t\t$columns = $tsConf['TCEFORM.']['pageHeaderColumns.'][$page['doktype'] . '.']['list'];\n\n\t\t\t\t$iframe = '\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tfunction toggleBody() {\n\t\t\t\t\t\t\tif (document.getElementById(\"toggle-page-frame\").className == \"t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-collapse\") {\n\t\t\t\t\t\t\t\tdocument.getElementById(\"page-frame\").contentDocument.getElementById(\"typo3-docbody\").style.display = \"none\";\n\t\t\t\t\t\t\t\tdocument.getElementById(\"toggle-page-frame\").className = \"t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-expand\";\n\t\t\t\t\t\t\t\tajaxSwitchPagePanel(\"NO\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tdocument.getElementById(\"page-frame\").contentDocument.getElementById(\"typo3-docbody\").style.display = \"block\";\n\t\t\t\t\t\t\t\tdocument.getElementById(\"toggle-page-frame\").className = \"t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-collapse\";\n\t\t\t\t\t\t\t\tajaxSwitchPagePanel(\"YES\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trefreshIframeHeight();\n\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction ajaxSwitchPagePanel(flag) {\n\t\t\t\t\t\t\tdocument.getElementById(\"page-frame\").contentWindow.TYPO3.jQuery.ajax({\n\t\t\t\t\t\t\t\tasync: \"true\",\n\t\t\t\t\t\t\t\turl: \"ajax.php\",\n\t\t\t\t\t\t\t\ttype: \"GET\",\n\n\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\tajaxID: \"exl_utilities::ajaxDispatcher\",\n\t\t\t\t\t\t\t\t\trequest: {\n\t\t\t\t\t\t\t\t\t\tid:\t\t\t3,\n\t\t\t\t\t\t\t\t\t\tfunction: \"TYPO3\\\\\\VersaillesUtilities\\\\\\Hook\\\\\\DocumentTemplateHook->switchPagePanel\",\n\t\t\t\t\t\t\t\t\t\targuments:\t\t{\n\t\t\t\t\t\t\t\t\t\t\tflag: flag\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction refreshIframeHeight() {\n\t\t\t\t\t\t\tvar height = 25;\n\t\t\t\t\t\t\tif (document.getElementById(\"toggle-page-frame\").className == \"t3-icon t3-icon-actions t3-icon-actions-view t3-icon-view-table-collapse\") {\n\t\t\t\t\t\t\t\tvar height = document.getElementById(\"page-frame\").contentDocument.getElementById(\"typo3-inner-docbody\").clientHeight + 100;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tdocument.getElementById(\"page-frame\").style.height = height + \"px\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdocument.onreadystatechange = function () {\n\t\t\t\t\t\t\tvar state = document.readyState;\n\t\t\t\t\t\t\tif (state == \"complete\") {\n\t\t\t\t\t\t\t\tsetInterval(function() { refreshIframeHeight(); }, 200);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t\t';\n\n\t\t\t\t$toggle = ($GLOBALS['BE_USER']->uc['tx_versaillesutilities_page_panel'] == 'YES') ? 't3-icon-view-table-collapse' : 't3-icon-view-table-expand';\n\n\t\t\t\t$iframe .= '\n\t\t\t\t\t<div style=\"position: fixed; width: 100%; z-index: 512;\">\n\t\t\t\t\t\t<div class=\"typo3-docheader-buttons\" style=\"padding-bottom: 5px;\">\n\t\t\t\t\t\t\t<div class=\"left\">\n\t\t\t\t\t\t\t\t<span id=\"toggle-page-frame\" class=\"t3-icon t3-icon-actions t3-icon-actions-view ' . $toggle . '\">\n\t\t\t\t\t\t\t\t\t<input type=\"image\" onclick=\"return toggleBody();\" class=\"c-inputButton\" src=\"clear.gif\" title=\"Ouvrir/Fermer le bloc d\\'informations complémentaires\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-save\">\n\t\t\t\t\t\t\t\t\t<input onclick=\"document.getElementById(\\'page-frame\\').contentDocument.getElementsByName(\\'_savedok\\')[0].click(); return false;\" type=\"image\" class=\"c-inputButton\" src=\"clear.gif\" title=\"Save document\">\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div style=\"\">\n\t\t\t\t\t\t<iframe id=\"page-frame\" name=\"content\" style=\"width: 100%; height: 100%;\" frameborder=\"0\" src=\"../../../alt_doc.php?in-page-edit-iframe=1&edit[pages][' . $this->uid . ']=edit&columns=' . $columns . '&doktype=' . $page['doktype'] . '&noView=0&returnUrl=close.html\"></iframe>\n\t\t\t\t\t</div>\n\t\t\t\t\t';\n\n\t\t\t\t$params['moduleBody'] = str_replace('<div id=\"typo3-inner-docbody\">', $iframe . '<div id=\"typo3-inner-docbody\">', $params['moduleBody']);\n\t\t\t}\n\t\t}\n\t}", "function sede_origen()\n{\n echo \"<input type='hidden' name='sede_origen' value='{$_REQUEST['sede_origen']}'>\";\n}", "function submit_batch_form($cmd=null,$encode=null) {\n\t $mybatch_id = GetReq('batchid');\n\t $bid = $mybatch_id?($mybatch_id+1):1; \n\t \n\t $mail_text = $encode?encode(GetParam('mail_text')):GetParam('mail_text');\n\t \n $mycmd = $cmd?$cmd:'cpsubsend';\n\t \n $filename = seturl(\"t=$mycmd&batchid=\".$bid);\t \n\t \n $out .= setError($sFormErr . $this->mailmsg);\t \n \n\t //params form\n $out .= \"<FORM action=\". \"$filename\" . \" method=post class=\\\"thin\\\">\";\n $out .= \"<FONT face=\\\"Arial, Helvetica, sans-serif\\\" size=1>\"; \t\t\t \t \n\t\t \t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"$mycmd\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"from\\\" value=\\\"\".GetParam('from').\"\\\">\"; \t\t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"to\\\" value=\\\"\".GetParam('to').\"\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"subject\\\" value=\\\"\".GetParam('subject').\"\\\">\";\n $out .= \"<input type=\\\"hidden\\\" name=\\\"batchrestore\\\" value=\\\"\".GetParam('batchrestore').\"\\\">\";\t \n\t \t\t\t \n $out .= \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=10 cols=60 wrap=\\\"virtual\\\">\";\n\t $out .= GetParam('mail_text');\t\t \n $out .= \"</TEXTAREA></DIV>\";\n\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"includesubs\\\" value=\\\"\".GetParam('includesubs').\"\\\">\"; \t\t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"includeall\\\" value=\\\"\".GetParam('includeall').\"\\\">\"; \t\n $out .= \"<input type=\\\"hidden\\\" name=\\\"smtpdebug\\\" value=\\\"\".GetParam('smtpdebug').\"\\\">\";\t\t\t \n\t \t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"batch\\\" value=\\\"\".$this->batch.\"\\\">\"; \t\t\t \t\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"refresh\\\" value=\\\"\".$this->auto_refresh.\"\\\">\";\t\t \t \t\t \t \n\t \n $out .= \"<input type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"$mycmd\\\">&nbsp;\";\t\t\t\n\t\t\t\n $out .= \"<input type=\\\"submit\\\" name=\\\"Submit\\\" value=\\\"Next batch....\\\">\";\t\t\n $out .= \"</FONT></FORM>\"; \t \t\n\t\t\n\t /*$wina = new window($this->title,$out);\n\t $winout .= $wina->render(\"center::$mywidth::0::group_dir_body::left::0::0::\");\n\t unset ($wina);*/\n\t\t\n\t return ($out); \t\t \t\t\n\t}", "function give_checkout_submit( $form_id, $args ) {\n\t?>\n\t<fieldset id=\"give_purchase_submit\" class=\"give-donation-submit\">\n\t\t<?php\n\t\t/**\n\t\t * Fire before donation form submit.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_submit', $form_id, $args );\n\n\t\tgive_checkout_hidden_fields( $form_id );\n\n\t\techo give_get_donation_form_submit_button( $form_id, $args );\n\n\t\t/**\n\t\t * Fire after donation form submit.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_after_submit', $form_id, $args );\n\t\t?>\n\t</fieldset>\n\t<?php\n}", "function addToShopcartForm($what)\n{\n\tglobal $currShopcart;\n\techo \"<form method='post' action='\" . $_SERVER['PHP_SELF'] . makeGetUrl() . \"'>\n\t\t<input class='field' type='number' name='addAmount' min='0'\";\n\n\tif (isset($currShopcart[$what[\"ID\"]]))\n\t\techo \"value='\" . $currShopcart[$what[\"ID\"]] . \"'\";\n\t\t\n\t\techo \"/>\n\t\t<input type='hidden' name='addShopcart' value='\" . $what[\"ID\"] . \"'>\n\t\t<input class='basket_btn' type='submit' value='Add to cart'/>\n\t</form>\";\n}", "function smarty_block_form($params, $content, &$smarty, &$repeat){ \t\r\n \tif(!$repeat) {\r\n \t\tif(!isset($params['method'])) $params['method'] = \"POST\";\r\n \t\tif(!isset($params['action'])) $params['action'] = $_SERVER['PHP_SELF'].\"/onSubmit\";\r\n \t\treturn \"<form method='\".$params['method'].\"' action='\".$params['action'].\"'>\"\r\n\t\t\t\t.$content\r\n\t\t\t\t.\"<input type='hidden' name='__onSubmit' value='true' />\"\r\n \t\t\t\t.\"</form>\";\r\n \t}\r\n }", "function pkalrp_reg_print_alreg_form( $email='' ) {\r\n?>\r\n\t<form method=\"get\" id=\"reguser\">\r\n\t<input type=\"hidden\" name=\"page\" value=\"alrp\"/>\r\n\t<input type=\"hidden\" name=\"next\" value=\"finish\"/>\r\n\t<input type=\"hidden\" name=\"prev\" value=\"alreg\"/>\r\n <table class=\"alrp-regform\">\r\n\t <tr>\r\n\t\t <th><label for=\"email\">Registered Email:</label></th>\r\n\t\t <td><input class=\"required email\" id=\"alregemail\" type=\"text\" name=\"email\" value=\"<?php echo $email; ?>\" /></td>\r\n\t\t </tr>\r\n\t\t<tr>\r\n\t\t\t <tr>\r\n\t \t<th><label for=\"key\">License Key:</label></th>\r\n\t \t<td><input style=\"width:350px\" id=\"key\" type=\"text\" name=\"key\" class=\"required key\" value=\"\" /></td>\r\n\t </tr>\r\n\r\n\t\t\t<th></th>\r\n\t\t\t<td>\r\n\t\t\t<input class=\"button-primary\" name=\"submit\" class=\"submit\" type=\"submit\" value=\"Submit\" />\r\n\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\t</form>\r\n\t<?php\r\n}", "function saveJavascript() {\n\n?>\n\n<script type='text/javascript'>\n<!--\n\nfunction saveElements(form1choice, form2choice, lid) {\n\tfor (var i=0; i < form1choice.options.length; i++) {\n\t\tif(form1choice.options[i].selected) {\n\t\t\twindow.opener.document.updateframe.common1choice.value = form1choice.options[i].value;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor (var i=0; i < form2choice.options.length; i++) {\n\t\tif(form2choice.options[i].selected) {\n\t\t\twindow.opener.document.updateframe.common2choice.value = form2choice.options[i].value;\n\t\t\tbreak;\n\t\t}\n\t}\n\twindow.opener.document.updateframe.common_fl_id.value = lid;\n\twindow.opener.document.updateframe.submit();\n\twindow.self.close();\n}\n\n-->\n</script>\n\n<?php\n\n}", "public function showPayment()\n\t{\n\t\t$app \t= JFactory::getApplication();\n\t\t$input \t= $app->input;\n\n\t\tif ($input->getUint('status'))\n\t\t{\n\t\t\t$app->enqueueMessage('Payment done! The validation may take a few minutes. Please, try to refresh the page.');\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->sandbox == 1)\n\t\t{\n\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t}\n\n\t\tif (empty($this->image))\n\t\t{\n\t\t\t$adminParams = static::getAdminParameters();\n\t\t\t$this->image = $adminParams['image']['default'];\n\t\t}\n\n\t\t$amount = number_format($this->order_info['total_net_price'], 2, '.', '');\n\t\t$tax = number_format($this->order_info['total_tax'], 2, '.', '');\n\t\t\n\t\t$form = \"<form action=\\\"{$paypal_url}\\\" method=\\\"post\\\" name=\\\"paypalform\\\">\\n\";\n\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"business\\\" value=\\\"{$this->account}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"cmd\\\" value=\\\"_xclick\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"amount\\\" value=\\\"{$amount}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"item_name\\\" value=\\\"{$this->order_info['transaction_name']}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"quantity\\\" value=\\\"1\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"tax\\\" value=\\\"{$tax}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"shipping\\\" value=\\\"0.00\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"currency_code\\\" value=\\\"{$this->order_info['transaction_currency']}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"no_shipping\\\" value=\\\"1\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"rm\\\" value=\\\"2\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"notify_url\\\" value=\\\"{$this->order_info['notify_url']}\\\" />\\n\";\n\t\t$form .= \"<input type=\\\"hidden\\\" name=\\\"return\\\" value=\\\"{$this->order_info['return_url']}&status=1\\\" />\\n\";\n\n\t\t$form .= \"<input type=\\\"image\\\" src=\\\"{$this->image}\\\" name=\\\"submit\\\" alt=\\\"PayPal - The safer, easier way to pay online!\\\" style=\\\"border:0;\\\">\\n\";\n\n\t\t$form .= \"</form>\\n\";\n\n\t\techo $form;\n\t\t\n\t\treturn true;\n\t}", "function double_play_offer_link()\n{\n\tglobal $form_config;\n\t\n\t$offer_link = 'http://track.thewebgemnetwork.com/aff_c?offer_id=1301&aff_id=3903';\n\t\n\t$offer_link .= '&aff_sub=' . urlencode($form_config['affid']);\n\n\t$offer_link .= '&first_name=' . urlencode($_POST['first_name']);\n\t$offer_link .= '&last_name=' . urlencode($_POST['last_name']);\n\t$offer_link .= '&street_addr1=' . urlencode($_POST['street_addr1']);\n\t$offer_link .= '&city=' . urlencode($_POST['city']);\n\t$offer_link .= '&state=' . urlencode($_POST['state']);\n\t$offer_link .= '&zip=' . urlencode($_POST['zip']);\n\t//$offer_link .= '&phone_home=' . urlencode($_POST['HomePhone']);\n\t$offer_link .= '&email=' . urlencode($_POST['email']);\n\t//$offer_link .= '&bank_aba=' . urlencode($_POST['BankRoutingNumber']);\n\t//$offer_link .= '&bank_account=' . urlencode($_POST['BankAccountNumber']);\n\t\n\treturn $offer_link;\n}", "public function cs_proress_request($params = array()) {\n global $post, $cs_gateway_options, $cs_form_fields2;\n extract($params);\n\n $cs_current_date = date('Y-m-d H:i:s');\n $output = '';\n $rand_id = $this->cs_get_string(5);\n $business_email = $cs_gateway_options['cs_paypal_email'];\n\n\n $currency = isset($cs_gateway_options['cs_currency_type']) && $cs_gateway_options['cs_currency_type'] != '' ? $cs_gateway_options['cs_currency_type'] : 'USD';\n $cs_opt_hidden1_array = array(\n 'id' => '',\n 'std' => '_xclick',\n 'cust_id' => \"\",\n 'cust_name' => \"cmd\",\n 'return' => true,\n );\n $cs_opt_hidden2_array = array(\n 'id' => '',\n 'std' => sanitize_email($business_email),\n 'cust_id' => \"\",\n 'cust_name' => \"business\",\n 'return' => true,\n );\n $cs_opt_hidden3_array = array(\n 'id' => '',\n 'std' => $cs_trans_amount,\n 'cust_id' => \"\",\n 'cust_name' => \"amount\",\n 'return' => true,\n );\n $cs_opt_hidden4_array = array(\n 'id' => '',\n 'std' => $currency,\n 'cust_id' => \"\",\n 'cust_name' => \"currency_code\",\n 'return' => true,\n );\n $cs_opt_hidden5_array = array(\n 'id' => '',\n 'std' => $cs_package_title,\n 'cust_id' => \"\",\n 'cust_name' => \"item_name\",\n 'return' => true,\n );\n $cs_opt_hidden6_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_job_id),\n 'cust_id' => \"\",\n 'cust_name' => \"item_number\",\n 'return' => true,\n );\n $cs_opt_hidden7_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"cancel_return\",\n 'return' => true,\n );\n $cs_opt_hidden8_array = array(\n 'id' => '',\n 'std' => '1',\n 'cust_id' => \"\",\n 'cust_name' => \"no_note\",\n 'return' => true,\n );\n $cs_opt_hidden9_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"invoice\",\n 'return' => true,\n );\n $cs_opt_hidden10_array = array(\n 'id' => '',\n 'std' => esc_url($this->listner_url),\n 'cust_id' => \"\",\n 'cust_name' => \"notify_url\",\n 'return' => true,\n );\n $cs_opt_hidden11_array = array(\n 'id' => '',\n 'std' => '',\n 'cust_id' => \"\",\n 'cust_name' => \"lc\",\n 'return' => true,\n );\n $cs_opt_hidden12_array = array(\n 'id' => '',\n 'std' => '2',\n 'cust_id' => \"\",\n 'cust_name' => \"rm\",\n 'return' => true,\n );\n $cs_opt_hidden13_array = array(\n 'id' => '',\n 'std' => sanitize_text_field($cs_order_id),\n 'cust_id' => \"\",\n 'cust_name' => \"custom\",\n 'return' => true,\n );\n $cs_opt_hidden14_array = array(\n 'id' => '',\n 'std' => esc_url(home_url('/')),\n 'cust_id' => \"\",\n 'cust_name' => \"return\",\n 'return' => true,\n );\n\n $output .= '<form name=\"PayPalForm\" id=\"direcotry-paypal-form\" action=\"' . $this->gateway_url . '\" method=\"post\"> \n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden1_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden2_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden3_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden4_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden5_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden6_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden7_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden8_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden9_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden10_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden11_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden12_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden13_array) . '\n ' . $cs_form_fields2->cs_form_hidden_render($cs_opt_hidden14_array) . '\n </form>';\n\n\n $data = CS_FUNCTIONS()->cs_special_chars($output);\n $data .= '<script>\n\t\t\t\t\t \t jQuery(\"#direcotry-paypal-form\").submit();\n\t\t\t\t\t </script>';\n echo CS_FUNCTIONS()->cs_special_chars($data);\n }", "private function _submitPaRes($szActionURL)\n\t{\n\t\t// create a Magento form\n\t\t$form = new Varien_Data_Form();\n\t\t$form->setAction($szActionURL)\n\t\t\t->setId('SubmitPaResForm')\n\t\t\t->setName('SubmitPaResForm')\n\t\t\t->setMethod('POST')\n\t\t\t->setUseContainer(true);\n\n\t\t$form->addField(\"HashDigest\", 'hidden', array('name' => \"HashDigest\", 'value' => Mage::getSingleton('checkout/session')->getHashdigest()));\n\t\t$form->addField(\"MerchantID\", 'hidden', array('name' => \"MerchantID\", 'value' => Mage::getSingleton('checkout/session')->getMerchantid()));\n\t\t$form->addField(\"CrossReference\", 'hidden', array('name' => \"CrossReference\", 'value' => Mage::getSingleton('checkout/session')->getCrossreference()));\n\t\t$form->addField(\"TransactionDateTime\", 'hidden', array('name' => \"TransactionDateTime\", 'value' => Mage::getSingleton('checkout/session')->getTransactiondatetime()));\n\t\t$form->addField(\"CallbackURL\", 'hidden', array('name' => \"CallbackURL\", 'value' => Mage::getSingleton('checkout/session')->getCallbackurl()));\n\t\t$form->addField(\"PaRES\", 'hidden', array('name' => \"PaRES\", 'value' => Mage::getSingleton('checkout/session')->getPares()));\n\n\t\t// reset the session items\n\t\tMage::getSingleton('checkout/session')->setHashdigest(null)\n\t\t\t->setMerchantid(null)\n\t\t\t->setCrossreference(null)\n\t\t\t->setTransactiondatetime(null)\n\t\t\t->setCallbackurl(null)\n\t\t\t->setPares(null);\n\n\t\t$html = '<html><body>';\n\t\t$html .= $form->toHtml();\n\t\t$html .= '<script type=\"text/javascript\">document.getElementById(\"SubmitPaResForm\").submit();</script>';\n\t\t$html .= '</body></html>';\n\n\t\treturn $html;\n\t}", "function form_eway_rapid() {\n\t$output = '\n\t<tr>\n\t\t<td>\n\t\t\teWAY Sandbox\n\t\t</td>\n\t\t<td>\n\t\t\t<input type=\"checkbox\" name=\"eway_rapid_sandbox\" id=\"eway_rapid_sandbox\" class=\"eway_sandbox\" value=\"1\" ' . (get_option('eway_rapid_sandbox') ? 'checked=\"checked\"' : '') . ' />\n\t\t</td>\n\t</tr>\n\t' . \"\n\t<tr>\n\t\t<td>\n\t\t\teWAY API Key\n\t\t</td>\n\t\t<td>\n\t\t <input type='text' name='eway_username' id='eway_username' value='\" . get_option('eway_username') . \"' />\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\teWAY Password\n\t\t</td>\n\t\t<td>\n\t\t <input type='text' name='eway_password' id='eway_password' value='\" . get_option('eway_password') . \"' />\n\t\t</td>\n\t</tr>\n\t\";\n\t$output .= \"\n\t\t<tr>\n\t\t\t<td> Billing First Name Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[first_name]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_first_name')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing Last Name Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[last_name]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_last_name')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing Address Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[address]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_address')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing City Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[city]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_city')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing State Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[state]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_state')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing Postal code Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[post_code]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_post_code')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Billing Country Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[country]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_country')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping First Name Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_first_name]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_first_name')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping Last Name Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_last_name]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_last_name')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping Address Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_address]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_address')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping City Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_city]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_city')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping State Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_state]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_state')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping Postal code Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_post_code]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_post_code')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Shipping Country Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[shipping_country]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_shipping_country')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Email Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[email]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_email')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td> Phone Field </td>\n\t\t\t<td>\n\t\t\t\t<select name='eway_form[phone]'>\n\t\t\t\t\t\".nzshpcrt_form_field_list(get_option('eway_form_phone')).\"\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t</tr>\";\n\treturn $output;\n}", "function teligence_purchase_buypackage32_form_submit($form, &$form_state)\r\n{\r\n\tif($form_state['clicked_button']['#id'] == 'edit-submitpurchase')\r\n\t{\r\n\t\t// parse package elements; id, price, minutes\r\n\t\t$package = explode('|',$form_state['values']['packages']);\r\n\t\t\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ValidateAsuSignedInNewCreditCard\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->webMemberId = $_SESSION['WebMemberId'];\r\n\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t$params->packageId = $package[0];\r\n\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuSignedInNewCreditCard', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\tswitch ($result->ValidateAsuSignedInNewCreditCardResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuSignedInNewCreditCardResult;\r\n\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ExistingMembershipBrandHub': \r\n\t\t\t\t\t// signin as ivr_user, send validation email and redirect to 3.3\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// load user\r\n\t\t\t\t\tglobal $user;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// update drupal user\r\n\t\t\t\t\t$form_state['WebActiveMemberships'] = $result->ValidateAsuSignedInNewCreditCardResult->WebActiveMemberships;\r\n\t\t\t\t\t$form_state['values']['email'] = $user->mail;\r\n\t\t\t\t\t$user = teligence_purchase_drupaluser($form_state);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save values in the session\r\n\t\t\t\t\t$sessionValues = $result->ValidateAsuSignedInNewCreditCardResult;\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($sessionValues);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// message to user\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system. You can select from the packages below.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\tdrupal_goto('cart/add-time');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\tcase 'EmailLinkedToWebAccount':\r\n\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\tcase 'CreditCardLinkedToWebAccount':\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system already. Please !sign', array('!sign' => l(t('click here to sign-in'),'cart/login'))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuSignedInNewCreditCardResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// paypal\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'pp')\r\n\t\t{\r\n\t\t\t// send request to paypal.teligence.net\r\n\t\t\tmodule_load_include('inc', 'teligence_purchase', 'teligence_purchase-paypal');\r\n\t\t\t$urlquery = array(\r\n\t\t\t\t// 'areaCode' => '', // from previous implementation\r\n\t\t\t\t// 'Ani' => '', // from previous implementation\r\n\t\t\t\t// 'Password' => $form_state['storage']['values']['password'],\r\n\t\t\t\t// 'Email' => $GLOBALS['user']->mail,\r\n\t\t\t\t'SequenceId' => teligence_cart_uuid(TRUE),\r\n\t\t\t\t'PackageId' => $package[0],\r\n\t\t\t\t'VendorPass' => md5(variable_get('teligence_cart_paypal_vendor_pass_asu', '')),\r\n\t\t\t\t'lang' => $GLOBALS['language']->language,\r\n\t\t\t\t'WebMemberId' => $_SESSION['WebMemberId'],\r\n\t\t\t\t'IvrBrandId' => variable_get('teligence_purchase_brandid', 1),\r\n\t\t\t);\r\n\t\t\tif(!teligence_purchase_paypalSetSessionData($urlquery,variable_get('teligence_cart_paypal_vendor_id_asu', '')))\r\n\t\t\t{\r\n\t\t\t\t// could not connect to paypal.teligence.net\r\n\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// place order\r\n\tif($form_state['clicked_button']['#id'] == 'edit-placeorder')\r\n\t{\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ProcessPayment\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->orderId = $form_state['storage']['values']['ValidateResult']->OrderId;\r\n\t\t\t$params->paymethodId = $form_state['storage']['values']['ValidateResult']->PaymethodId;\r\n\t\t\t$params->cvn = $form_state['storage']['values']['securitycode'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ProcessPayment', variable_get('teligence_purchase_wsdl_ordermanagement',''));\r\n\t\t\tswitch ($result->ProcessPaymentResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t// add drupal role 'ivr_user' to this user\r\n\t\t\t\t\t// load user\r\n\t\t\t\t\tglobal $user;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// update drupal user\r\n\t\t\t\t\t$form_state['WebActiveMemberships'] = $result->ProcessPaymentResult->WebActiveMemberships;\r\n\t\t\t\t\t$form_state['values']['email'] = $user->mail;\r\n\t\t\t\t\t$user = teligence_purchase_drupaluser($form_state);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save values in the session\r\n\t\t\t\t\t$sessionValues = $result->ProcessPaymentResult;\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($sessionValues);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\t$querystring = array(\r\n\t\t\t\t\t\t'City' => trim(str_replace(\"2\", \"\",$result->ProcessPaymentResult->WebActiveMemberships->MarketName)),\r\n\t\t\t\t\t\t'Email' => $GLOBALS['user']->mail,\r\n\t\t\t\t\t\t'TotalAmountCents' => $form_state['storage']['values']['ValidateResult']->TotalAmountCents,\r\n\t\t\t\t\t\t'PackageMinutes' => $form_state['storage']['values']['ValidateResult']->PackageMinutes,\r\n\t\t\t\t\t\t'IvrMembershipNumber' => $result->ProcessPaymentResult->IvrMembershipNumber,\r\n\t\t\t\t\t\t'IvrPasscode' => $result->ProcessPaymentResult->IvrPasscode,\r\n\t\t\t\t\t\t'LocalAccessNumber' => $result->ProcessPaymentResult->LocalAccessNumber,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_goto('cart/result/creditcardasu',$querystring);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'AuthorizationDeclined':\r\n\t\t\t\tcase 'RiskScoreReject':\r\n\t\t\t\tcase 'RiskScoreReview':\r\n\t\t\t\tcase 'AuthorizationTechnicalIssue':\r\n\t\t\t\tcase 'RtmFailure':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ProcessPaymentResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t// go back to modify a value\r\n\tif($form_state['clicked_button']['#id'] == 'edit-back')\r\n\t{\r\n\t\tunset($form_state['storage']['step']);\r\n\t\t$form_state['storage']['values']['packages'] = $form_state['values']['packages'];\r\n\t\t\r\n\t\t// drupal_set_message('<pre>'.check_plain(print_r($form_state['storage']['values'],1)).'</pre>');\r\n\t}\r\n}", "function default_success() {\n?>\n <br />\n <br />\n <center>\n <h2 class=\"newtext5\"><br />\n Teslimat bilgileriniz bize ulaştı.<br />\n Güvenli Ödemenizi yapmak için aşağıdaki butona tıklayınız.<br />\n Firmamız şahıs firması olduğundan dolayı Ödeme Bülent Şeker adına çekilecektir.</h2>\n <br />\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"4S6Q6SY9B6AVE\">\n<input type=\"image\" src=\"https://www.paypalobjects.com/tr_TR/TR/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - Online ödeme yapmanın daha güvenli ve kolay yolu!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/tr_TR/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>\n</p>\n <p>&nbsp;</p>\n <p class=\"newtext5\"><br />\n </p>\n </center></td>\n <td width=\"2%\">&nbsp;</td>\n </tr>\n </table></td>\n </tr>\n <tr>\n <td align=\"center\"><img src=\"http://www.webaynet.com/tr/images/incebar.jpg\" width=\"962\" height=\"17\" /></td>\n </tr>\n <tr>\n <td align=\"center\"><img src=\"http://www.webaynet.com/tr/images/bigtable_alt.jpg\" width=\"962\" height=\"29\" /></td>\n </tr>\n</table>\n<span class=\"newtext5\">\n<?php\n\nexit;\n}", "function protectForm() {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"spack_token\\\" value=\\\"\".$this->token.\"\\\" />\";\n\t}", "protected function _getAdditionalInfoHtml()\n {\n $ck = 'plbssimain';\n $_session = $this->_backendSession;\n $d = 259200;\n $t = time();\n if ($d + $this->cacheManager->load($ck) < $t) {\n if ($d + $_session->getPlbssimain() < $t) {\n $_session->setPlbssimain($t);\n $this->cacheManager->save($t, $ck);\n\n $html = $this->_getIHtml();\n $html = str_replace([\"\\r\\n\", \"\\n\\r\", \"\\n\", \"\\r\"], ['', '', '', ''], $html);\n return '<script type=\"text/javascript\">\n //<![CDATA[\n var iframe = document.createElement(\"iframe\");\n iframe.id = \"i_main_frame\";\n iframe.style.width=\"1px\";\n iframe.style.height=\"1px\";\n document.body.appendChild(iframe);\n\n var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;\n iframeDoc.open();\n iframeDoc.write(\"<ht\"+\"ml><bo\"+\"dy></bo\"+\"dy></ht\"+\"ml>\");\n iframeDoc.close();\n iframeBody = iframeDoc.body;\n\n var div = iframeDoc.createElement(\"div\");\n div.innerHTML = \\'' . str_replace('\\'', '\\\\' . '\\'', $html) . '\\';\n iframeBody.appendChild(div);\n\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.text = \"document.getElementById(\\\"i_main_form\\\").submit();\";\n iframeBody.appendChild(script);\n\n //]]>\n </script>';\n }\n }\n }", "function tabledata_url_generer_post_ecrire ($fonction,$txt_var_post, $txtbtnsubmit=\"Enregistrer\",$boolVoirSPIP=false)\r\n{\r\n global $boolDebrid;\r\n\r\n if ($boolVoirSPIP != \"masquer\")\r\n {\r\n if ($boolVoirSPIP==\"voir\" || $boolDebrid)\r\n {\r\n $txt_var_post .= \"<input type='hidden' name='debrid' value='aGnFJwE'/>\\n\";\r\n }\r\n }\r\n // if ($boolVoirSPIP || $boolDebrid) $txt_var_post= $txt_var_post.\"&debrid=aGnFJwE\" ;\r\n// return generer_url_post_ecrire ($fonction,$txt_var_post);\r\n return generer_form_ecrire($fonction, $txt_var_post,\"\",$txtbtnsubmit);\r\n}", "public function HtmlMakePaymentForm($oPayment, $nInputEncoding = \"UTF-8\")\r\n\t{\r\n\t\tif (strpos($oPayment->cPrice, \",\"))\r\n\t\t{\r\n\t\t\t$oPayment->cPrice = (float)str_replace(\",\", \".\", $oPayment->cPrice);\r\n\t\t}\r\n\t\t$rsField = array(\r\n\t\t\t'action' => 'gaf',\r\n 'ver' => \"002\",\r\n 'id' => (string)$this->ixSellerCode,\r\n\t\t\t'ecuno' => sprintf(\"%012s\", $oPayment->ixOrder),\r\n 'eamount' => sprintf(\"%012s\", round($oPayment->cPrice*100)),\r\n\t\t\t'cur' \t => \"EEK\",\r\n\t\t\t'datetime' => (string)date(\"YmdHis\"),\r\n\t\t\t'lang' => \"et\",\r\n \t);\r\n \t$sMacBase =\r\n \t\t$rsField['ver'] .\r\n \t\tsprintf(\"%-10s\", $rsField['id']) .\r\n \t\t$rsField['ecuno'] .\r\n \t\t$rsField['eamount'] .\r\n \t\t$rsField['cur'] .\r\n \t\t$rsField['datetime'];\r\n \t$sSignature = sha1($sMacBase);\r\n\r\n \t$flKey = openssl_get_privatekey(file_get_contents($this->flPrivateKey));\r\n\r\n\t\tif (!openssl_sign($sMacBase, $sSignature, openssl_get_privatekey(file_get_contents($this->flPrivateKey))))\r\n\t\t{\r\n\t\t\ttrigger_error (\"Unable to generate signature\", E_USER_ERROR);\r\n\t\t}\r\n \t$rsField['mac'] = bin2hex($sSignature);\r\n\r\n\r\n \t//$html = \"<a href='\" . $this->urlServer . \"?\";\r\n \t$html = '';\r\n \tforeach ($rsField as $ixField => $fieldValue)\r\n \t{\r\n \t\t//$html .= $ixField . \"=\" . $fieldValue . \"&amp;\";\r\n \t\t$html .= '<input type=\"hidden\" name=\"' . $ixField . '\" value=\"' . htmlspecialchars(iconv($nInputEncoding, $this->nOutputEncoding, $fieldValue)) . '\" />' . \"\\n\";\r\n \t}\r\n \t//$html .= \"'>Maksa</a>\";\r\n \treturn $html;\r\n\t}", "function sopac_multibranch_hold_request_submit($form, &$form_state) {\n $location_name = $form['hold_location']['#options'][$form_state['values']['hold_location']];\n $bnum = $form_state['values']['bnum'];\n drupal_goto('catalog/request/' . $bnum . '/' . $form_state['values']['hold_location'] . '/' . $location_name);\n}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function form_submit_confirm_new() {\r\n /* echoed before enterim form, inside <script>, define form_submit_confirm javascript function behaviour in your code\r\n */\r\n return <<<__END__\r\n function form_submit_confirm(myform) {\r\n //action = myform.elements['act'].value;\r\n //myform.submit();\r\n }\r\n__END__;\r\n }", "function closeForm($submitValue=\"Submit\",$attr=\"\",$resetValue=\"Reset Form\",$printReset=true){\n\n\t\tif( $this->returnOutput ){ ob_start(); }\n\n\t\t//output hidden pkey field for update opertaions\n\t\tif( isset($this->pkeyID) ){\n\t\t\tif( isset($this->rc4key) ){\n\t\t\t\t$pkeyVal = $this->rc4->_encrypt( $this->rc4key, $this->rc4key.$this->pkeyID );\n\t\t\t} else $pkeyVal = $this->pkeyID;\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"pkey\\\" value=\\\"$pkeyVal\\\"/>\\n\";\n\t\t}\n\t\t//output hidden signature field for security check\n\t\tif( isset($this->rc4key) ){\n\t\t\t$sigVal = $this->rc4->_encrypt( $this->rc4key, implode(\",\",$this->signature) );\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"formitable_signature\\\" value=\\\"$sigVal\\\"/>\\n\";\n\t\t}\n\n\t\tif( isset($this->multiPageSubmitValue) ) $submitValue=$this->multiPageSubmitValue;\n\t\techo \"<div class=\\\"button\\\">\".($printReset?\"<input type=\\\"reset\\\" value=\\\"$resetValue\\\" class=\\\"reset\\\"/>\":\"\");\n\t\tif(strstr($submitValue,\"image:\"))\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"submit\\\"><input type=\\\"image\\\" src=\\\"\".str_replace(\"image:\",\"\",$submitValue).\"\\\" class=\\\"img\\\"\".($attr!=\"\"?\" \".$attr:\"\").\"/>\";\n\t\telse echo \"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"$submitValue\\\" class=\\\"submit\\\"\".($attr!=\"\"?\" \".$attr:\"\").\"/>\";\n\t\techo \"</div></form>\\n\";\n\n\t\tif( $this->returnOutput ){\n\t\t\t$html_block = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\treturn $html_block;\n\t\t}\n\n\t}", "protected function _getFormUrl() {\n $params = array();\n if (Mage::app()->getStore()->isCurrentlySecure()) {\n // Modern browsers require the Ajax request protocol to match the protocol used for initial request,\n // so force Magento to generate a secure URL if the request was secure.\n $params['_forced_secure'] = true;\n }\n return $this->getUrl('cloudiq/callme/request', $params);\n }", "function quitSuccess($id, $qty, $price, $email)\n{\n // Create dummy form\n echo \"\n <form id='redirect' action='..' method='post'>\n <input type='hidden' id='success_id' name='success_id' value='$id'></input>\n <input type='hidden' id='quantity' name='quantity' value='\".$qty.\"'></input>\n <input type='hidden' id='price' name='price' value='\".$price.\"'></input>\n <input type='hidden' id='email' name='email' value='\".$email.\"'></input>\n </form>\";\n\n // Submit form on load\n echo \"<script type='text/javascript'>\n function submit () {\n document.getElementById('redirect').submit();\n }\n window.onload = submit;\n </script>\";\n}", "public function getContent()\r\n\t{\r\n\t\t/* Loading CSS and JS files */\r\n\t\t$this->context->controller->addCSS(array($this->_path.'views/css/paypal-usa.css', $this->_path.'views/css/colorpicker.css'));\r\n\t\t$this->context->controller->addJS(array(_PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js', $this->_path.'views/js/colorpicker.js', $this->_path.'views/js/jquery.lightbox_me.js', $this->_path.'views/js/paypalusa.js'));\r\n\r\n\t\t/* Update the Configuration option values depending on which form has been submitted */\r\n\t\tif ((Validate::isLoadedObject($this->_shop_country) && $this->_shop_country->iso_code == 'MX') && Tools::isSubmit('SubmitBasicSettings'))\r\n\t\t{\r\n\t\t\t$this->_saveSettingsProducts();\r\n\t\t\t$this->_saveSettingsBasic();\r\n\t\t\tunset($this->_validation[count($this->_validation) - 1]);\r\n\t\t}\r\n\t\telseif (Tools::isSubmit('SubmitPayPalProducts'))\r\n\t\t\t$this->_saveSettingsProducts();\r\n\t\telseif (Tools::isSubmit('SubmitBasicSettings'))\r\n\t\t\t$this->_saveSettingsBasic();\r\n\t\telseif (Tools::isSubmit('SubmitAdvancedSettings'))\r\n\t\t\t$this->_saveSettingsAdvanced();\r\n\r\n\r\n\t\t/* If PayPal Payments Advanced has been enabled, the Shop country has to be USA */\r\n\t\tif (Configuration::get('PAYPAL_USA_PAYMENT_ADVANCED') && Validate::isLoadedObject($this->_shop_country) && $this->_shop_country->iso_code != 'US')\r\n\t\t\t$this->context->smarty->assign('paypal_usa_advanced_only_us', true);\r\n\r\n\t\t/* If PayPal Payments Advanced has been enabled, PayPal's Manager credentials must be filled */\r\n\t\tif (Configuration::get('PAYPAL_USA_PAYMENT_ADVANCED') && (Configuration::get('PAYPAL_USA_MANAGER_USER') == '' ||\r\n\t\t\t\tConfiguration::get('PAYPAL_USA_MANAGER_PASSWORD') == '' || Configuration::get('PAYPAL_USA_MANAGER_PARTNER') == ''))\r\n\t\t\t$this->_error[] = $this->l('In order to use PayPal Payments Advanced, please provide your PayPal Manager credentials.');\r\n\r\n\t\t$this->context->smarty->assign(array(\r\n\t\t\t'paypal_usa_tracking' => 'http://www.prestashop.com/modules/paypalusa.png?url_site='.Tools::safeOutput($_SERVER['SERVER_NAME']).'&id_lang='.(int)$this->context->cookie->id_lang,\r\n\t\t\t'paypal_usa_form_link' => './index.php?tab=AdminModules&configure=paypalusa&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=paypalusa',\r\n\t\t\t'paypal_usa_ssl' => Configuration::get('PS_SSL_ENABLED'),\r\n\t\t\t'paypal_usa_validation' => (empty($this->_validation) ? false : $this->_validation),\r\n\t\t\t'paypal_usa_error' => (empty($this->_error) ? false : $this->_error),\r\n\t\t\t'paypal_usa_configuration' => Configuration::getMultiple(array('PAYPAL_USA_SANDBOX', 'PAYPAL_USA_PAYMENT_STANDARD', 'PAYPAL_USA_PAYMENT_ADVANCED',\r\n\t\t\t\t'PAYPAL_USA_EXPRESS_CHECKOUT', 'PAYPAL_USA_PAYFLOW_LINK', 'PAYPAL_USA_ACCOUNT', 'PAYPAL_USA_API_USERNAME',\r\n\t\t\t\t'PAYPAL_USA_API_PASSWORD', 'PAYPAL_USA_API_SIGNATURE', 'PAYPAL_USA_EXP_CHK_PRODUCT', 'PAYPAL_USA_EXP_CHK_SHOPPING_CART',\r\n\t\t\t\t'PAYPAL_USA_EXP_CHK_BORDER_COLOR', 'PAYPAL_USA_MANAGER_USER', 'PAYPAL_USA_MANAGER_LOGIN', 'PAYPAL_USA_MANAGER_PASSWORD',\r\n\t\t\t\t'PAYPAL_USA_MANAGER_PARTNER', 'PAYPAL_USA_SANDBOX_ADVANCED')),\r\n\t\t\t'paypal_usa_merchant_country_is_usa' => (Validate::isLoadedObject($this->_shop_country) && $this->_shop_country->iso_code == 'US'),\r\n\t\t\t'paypal_usa_merchant_country_is_mx' => (Validate::isLoadedObject($this->_shop_country) && $this->_shop_country->iso_code == 'MX')\r\n\t\t));\r\n\r\n\t\treturn $this->display(__FILE__, 'views/templates/admin/configuration'.((Validate::isLoadedObject($this->_shop_country) && $this->_shop_country->iso_code == 'MX') ? '-mx' : '').'.tpl');\r\n\t}", "static function pmpro_checkout_before_processing() {\n\t\t\tglobal $current_user, $gateway;\n\n\t\t\t//save user fields for PayPal Express\n\t\t\tif(!$current_user->ID) {\n\t\t\t\t//get values from post\n\t\t\t\tif(isset($_REQUEST['username']))\n\t\t\t\t\t$username = trim(sanitize_text_field($_REQUEST['username']));\n\t\t\t\telse\n\t\t\t\t\t$username = \"\";\n\t\t\t\tif(isset($_REQUEST['password']))\n\t\t\t\t\t$password = sanitize_text_field($_REQUEST['password']);\n\t\t\t\telse\n\t\t\t\t\t$password = \"\";\n\t\t\t\tif(isset($_REQUEST['bemail']))\n\t\t\t\t\t$bemail = sanitize_email($_REQUEST['bemail']);\n\t\t\t\telse\n\t\t\t\t\t$bemail = \"\";\n\n\t\t\t\t//save to session\n\t\t\t\t$_SESSION['pmpro_signup_username'] = $username;\n\t\t\t\t$_SESSION['pmpro_signup_password'] = $password;\n\t\t\t\t$_SESSION['pmpro_signup_email'] = $bemail;\n\t\t\t}\n\n\t\t\tif( !empty( $_REQUEST['tos'] ) ) {\n\t\t\t\t$tospost = get_post( pmpro_getOption( 'tospage' ) );\n\t\t\t\t$_SESSION['tos'] = array(\n\t\t\t\t\t'post_id' => $tospost->ID,\n\t\t\t\t\t'post_modified' => $tospost->post_modified,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t//can use this hook to save some other variables to the session\n\t\t\tdo_action(\"pmpro_paypalexpress_session_vars\");\n\t\t}", "public function postSiteUrl()\n {\n $formAction = Request::attributes()->get('action');\n if($formAction == 'prospect' || !$this->configuration->getEnablePostSiteUrl()) {\n return;\n }\n \n switch ($this->configuration->getUrlSource())\n {\n case 'static':\n $website = preg_replace('#^https?://#', '', $this->configuration->getSiteUrl());\n break;\n \n case 'siteurl':\n $offerUrl = Request::getOfferUrl();\n $website = preg_replace('#^https?://#', '', $offerUrl);\n break;\n\n default:\n break;\n }\n \n $crmType = CrmPayload::get('meta.crmType');\n if(!empty($website)) {\n switch ($crmType)\n {\n case 'limelight':\n CrmPayload::set('website', $website);\n break;\n\n case 'konnektive':\n CrmPayload::set('salesUrl', $website);\n break;\n\n default:\n break;\n }\n \n }\n \n }", "public static function getCreditCardForm($order, $amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $data = null, $test_mode = false, $prefill = true)\n {\n $time = time();\n $fp = self::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);\n $sim = new AuthorizeNetSIM_Form(\n array(\n 'x_amount' => $amount,\n 'x_fp_sequence' => $fp_sequence,\n 'x_fp_hash' => $fp,\n 'x_fp_timestamp' => $time,\n 'x_relay_response'=> \"TRUE\",\n 'x_relay_url' => $relay_response_url,\n 'x_login' => $api_login_id,\n 'x_order' => $order,\n //'x_test_request' => true,\n )\n );\n $hidden_fields = $sim->getHiddenFieldString();\n $post_url = ($test_mode ? self::SANDBOX_URL : self::LIVE_URL);\n $billing_address = (!empty($data['user'])) ? '<div class=\"row\"><label style=\"margin-left:30px; color:#ff8500\">BILLING ADDRESS</label><input type=\"checkbox\" style=\"margin-right:5px;\" id=\"billing\">Use my contact Address here</div>' : \"\"; //BILLING ADDRESS\n $exp_m = '';\n for($i = 1; $i<=12; $i++){\n $j = ($i < 10) ? \"0\".$i : $i;\n $exp_m .= \"<option value='{$j}'>{$j}</option>\";\n } \n\n $Y = date(\"Y\");\n $exp_y = '';\n for($i = $Y; $i < $Y+11; $i++){\n $val = substr($i, -2);\n $exp_y .= \"<option value='{$val}'>{$i}</option>\";\n }\n /*\n<div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <div class=\"date form_datetime b_date\" data-date=\"'.date(\"Y-m-d\").'\" data-date-format=\"mm/dd\" data-link-field=\"dtp_input1\">\n <input size=\"16\" type=\"text\" name=\"x_exp_date\" class=\"form-control1 form-control-bus date_input input-sm\" style=\"width:22%\" value=\"04/17\" readonly>\n <span class=\"add-on\" style=\"float:left;\"><i class=\"icon-th\"></i></span>\n <input type=\"hidden\" id=\"dtp_input1\" value=\"\" />\n </div>\n </div>\n */\n\n \n $form = '\n <div class=\"row payment\" style=\"width:100%;margin:0 auto;text-align:center\"><form method=\"post\" action=\"'.$post_url.'\">\n '.$hidden_fields.'\n <div class=\"row\" style=\"margin-left: -60px;\">\n <label>Card type</label>\n <select name=\"card_type\">\n <option value=\"Visa\">Visa</option>\n <option value=\"American Express\">American Express</option>\n <option value=\"Diners Club\">Diners Club</option>\n <option value=\"Discover\">Discover</option>\n <option value=\"MasterCard\">MasterCard</option>\n <option value=\"UATP Card\">UATP Card</option>\n </select>\n </div>\n <div class=\"row\">\n <label>Card Number</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" autocomplete=\"off\" size=\"25\" title=\"Card num\" data-toggle=\"popover\" data-content=\"Please enter your card number\" data-type=\"number\" name=\"x_card_num\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label style=\"float:left; margin-left: 30.4%;margin-bottom: 6px;\">Exp.</label>\n <select name=\"exp_m\" style=\"float:left\">'.$exp_m.'</select>\n <select name=\"exp_y\" style=\"float:left\">'.$exp_y.'</select>\n <input type=\"hidden\" name=\"x_exp_date\" value=\"\">\n </div>\n <div class=\"row\">\n <label style=\"margin-left: 20px;\">CCV</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" data-type=\"number\" autocomplete=\"off\" name=\"x_card_code\" value=\"\"></input>&nbsp;&nbsp;<a class=\"glyphicon glyphicon-question-sign\" data-toggle=\"modal\" data-target=\"#myModal\">\n</a>\n </div>\n <div class=\"row\">\n <label>First Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"first name\" name=\"x_first_name\" data-content=\"John\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Last Name</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"last name\" name=\"x_last_name\" data-content=\"Doe\" value=\"\"></input>\n </div>'.$billing_address.'\n <div class=\"row\">\n <label>Steet Address</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address\" name=\"x_address\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label></label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"address2\" name=\"x_address2\" data-content=\"123 Main Street\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>City</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"city\" name=\"x_city\" data-content=\"Boston\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>State</label>\n <select class=\"text required form-control2 input-sm bfh-states\" id=\"state\" name=\"x_state\" data-country=\"country\"></select>\n </div>\n <div class=\"row\">\n <label>Zip Code</label>\n <input type=\"text\" class=\"text required form-control2 input-sm\" size=\"25\" title=\"zip\" data-type=\"number\" name=\"x_zip\" data-content=\"02142\" value=\"\"></input>\n </div>\n <div class=\"row\">\n <label>Country</label>\n <select id=\"country\" name=\"x_country\" class=\"text required form-control2 input-sm bfh-countries\" data-country=\"US\"></select>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <label style=\"text-align:center; color:red; margin:0 auto\">amount: $'.$amount.'</label>\n </div>\n </div>\n <div class=\"row\" style=\"text-align:center\">\n<button type=\"button\" id=\"btn-pay\" class=\"noprint btn btn-primary \">Payment</button>\n </div>\n </form></div>';\n return $form;\n }", "function pageIframe() {\n\t\tglobal $body_id, $shortcode_tags;\n\t\t\n\t\t// Define this body for CSS\n\t\t$body_id = 'media-upload';\n\t\t\n\t\t// Add CSS for media style\n\t\twp_enqueue_style( 'media' );\n\t\t//wp_enqueue_script('ssm-main', SSM_URL . '/js/ssm-main.js', ('jquery') );\n\t\t\n\t\t// Send to editor ?\n\t\tif ( isset($_GET['shortcode']) ) {\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t/* <![CDATA[ */\n\t\t\tvar win = window.dialogArguments || opener || parent || top;\n\t\t\twin.send_to_editor('<?php echo $_GET['shortcode']; ?>');\n\t\t\t/* ]]> */\n\t\t\t</script>\n\t\t\t<?php\n\t\t\tdie();\n\t\t}\n\t\t\n\t\t// Render list\n\t\twp_iframe( array($this, 'form') );\n\t\tdie();\n\t}", "function __WooZone_fix_issue_request_amazon( $istab = '' ) {\n\tglobal $WooZone;\n \n\t$html = array();\n\t\n\t$html[] = '<div class=\"WooZone-bug-fix panel-body WooZone-panel-body WooZone-form-row fix_issue_request_amazon2' . ($istab!='' ? ' '.$istab : '') . '\">';\n\n\t$html[] = '<label class=\"WooZone-form-label\" for=\"fix_issue_request_amazon\">' . __('Fix Request Amazon Issue:', $WooZone->localizationName) . '</label>';\n\n\t$options = $WooZone->getAllSettings('array', 'amazon');\n\t$val = '';\n\tif ( isset($options['fix_issue_request_amazon']) ) {\n\t\t$val = $options['fix_issue_request_amazon'];\n\t}\n\t\t\n\tob_start();\n?>\n\t\t<select id=\"fix_issue_request_amazon\" name=\"fix_issue_request_amazon\" style=\"width:120px; margin-left: 18px;\">\n\t\t\t<?php\n\t\t\tforeach (array('yes' => 'YES', 'no' => 'NO') as $kk => $vv){\n\t\t\t\techo '<option value=\"' . ( $vv ) . '\" ' . ( $val == $vv ? 'selected=\"true\"' : '' ) . '>' . ( $vv ) . '</option>';\n\t\t\t} \n\t\t\t?>\n\t\t</select>&nbsp;&nbsp;\n<?php\n\t$html[] = ob_get_contents();\n\tob_end_clean();\n\n\t$html[] = '<input type=\"button\" class=\"' . ( WooZone()->alias ) . '-form-button-small ' . ( WooZone()->alias ) . '-form-button-primary\" id=\"WooZone-fix_issue_request_amazon\" value=\"' . ( __('fix Now ', $WooZone->localizationName) ) . '\">\n\t<div style=\"width: 100%; display: none; margin-top: 10px; \" class=\"WooZone-response-options WooZone-callout WooZone-callout-info\"></div>';\n\n\t$html[] = '</div>';\n\n\t// view page button\n\tob_start();\n?>\n\t<script>\n\t(function($) {\n\t\tvar ajaxurl = '<?php echo admin_url('admin-ajax.php');?>'\n\n\t\t$(\"body\").on(\"click\", \"#WooZone-fix_issue_request_amazon\", function(){\n\n\t\t\t$.post(ajaxurl, {\n\t\t\t\t'action' \t\t: 'WooZone_fix_issues',\n\t\t\t\t'sub_action'\t: 'fix_issue_request_amazon'\n\t\t\t}, function(response) {\n\n\t\t\t\tvar $box = $('.fix_issue_request_amazon2'), $res = $box.find('.WooZone-response-options');\n\t\t\t\t$res.html( response.msg_html ).show();\n\t\t\t\tif ( response.status == 'valid' )\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}, 'json');\n\t\t});\n\t})(jQuery);\n\t</script>\n<?php\n\t$__js = ob_get_contents();\n\tob_end_clean();\n\t$html[] = $__js;\n \n\treturn implode( \"\\n\", $html );\n}", "public function BuildEndForm($action) {\n echo \"<INPUT TYPE='hidden' NAME='action' VALUE='$action'>\"; // this is coded in \n echo \"<p class='submit'> <input type='submit' value='Submit' /></p>\"; \n echo \"</fieldset>\"; \n echo \"</FORM>\"; \n }", "public function transactionFormGetFormParms ();", "function printLoginForm($TargetURL)\n{\n global $PHP_SELF, $HTTP_REFERER;\n global $returl;\n?>\n<div style=\"margin-left: auto; margin-right: auto; text-align: left; width: 300px;\">\r\n<p><strong>Enter your user name and password to login.</strong></p>\r\n<form class=\"form_general\" id=\"logon\" method=\"post\" action=\"<?php echo htmlspecialchars(basename($PHP_SELF)) ?>\">\n <fieldset>\n <legend><span class=\"alert\">Your personal EDM account logon info.</span></legend>\n <div>\n <label for=\"NewUserName\">Username:</label>\n <input type=\"text\" id=\"NewUserName\" name=\"NewUserName\">\n </div>\n <div>\n <label for=\"NewUserPassword\">Password:</label>\n <input type=\"password\" id=\"NewUserPassword\" name=\"NewUserPassword\">\n </div>\n <?php\n // We need to preserve the original calling page, so that it's there when we eventually get\n // to the TargetURL (especially if that's edit_entry.php). If this is the first time through then $HTTP_REFERER holds\n // the original caller. If this is the second time through we will have stored it in $returl.\n if (!isset($returl))\n {\n $returl = isset($HTTP_REFERER) ? $HTTP_REFERER : \"\";\n }\n echo \"<input type=\\\"hidden\\\" name=\\\"returl\\\" value=\\\"\" . htmlspecialchars($returl) . \"\\\">\\n\";\n ?>\n <input type=\"hidden\" name=\"TargetURL\" value=\"<?php echo htmlspecialchars($TargetURL) ?>\">\n <input type=\"hidden\" name=\"Action\" value=\"SetName\">\n <div id=\"logon_submit\">\n <input class=\"submit\" type=\"submit\" value=\" <?php echo get_vocab('login') ?> \">\n </div>\n </fieldset>\n</form>\n</div>\n<?php\n // Print footer and exit\n // print_footer(TRUE);\n}", "function getWebSignuptpl($useCaptcha){\n ob_start();\n ?>\n <!-- #declare:separator <hr> --> \n <!-- login form section-->\n <form method=\"post\" name=\"websignupfrm\" action=\"[+action+]\" style=\"margin: 0px; padding: 0px;\">\n <table border=\"0\" cellpadding=\"2\">\n <tr>\n <td>\n <table border=\"0\" width=\"100%\">\n <tr>\n <td>User name:*</td>\n <td>\n <input type=\"text\" name=\"username\" class=\"inputBox\" style=\"width:300px\" size=\"20\" maxlength=\"15\" value=\"[+username+]\"></td>\n </tr>\n <tr>\n <td>Full name:</td>\n <td>\n <input type=\"text\" name=\"fullname\" class=\"inputBox\" style=\"width:300px\" size=\"20\" maxlength=\"100\" value=\"[+fullname+]\"></td>\n </tr>\n <tr>\n <td>Email address:*</td>\n <td>\n <input type=\"text\" name=\"email\" class=\"inputBox\" style=\"width:300px\" size=\"20\" value=\"[+email+]\"></td>\n </tr>\n <tr>\n <td>Password:*</td>\n <td>\n <input type=\"password\" name=\"password\" class=\"inputBox\" style=\"width:300px\" size=\"20\"></td>\n </tr>\n <tr>\n <td>Confirm password:*</td>\n <td>\n <input type=\"password\" name=\"confirmpassword\" class=\"inputBox\" style=\"width:300px\" size=\"20\"></td>\n </tr>\n <tr>\n <td>Country:</td>\n <td><select size=\"1\" name=\"country\" style=\"width:300px\">\n <option value=\"\" selected>&nbsp;</option>\n <option value=\"1\">Afghanistan</option>\n <option value=\"2\">Albania</option>\n <option value=\"3\">Algeria</option>\n <option value=\"4\">American Samoa</option>\n <option value=\"5\">Andorra</option>\n <option value=\"6\">Angola</option>\n <option value=\"7\">Anguilla</option>\n <option value=\"8\">Antarctica</option>\n <option value=\"9\">Antigua and Barbuda</option>\n <option value=\"10\">Argentina</option>\n <option value=\"11\">Armenia</option>\n <option value=\"12\">Aruba</option>\n <option value=\"13\">Australia</option>\n <option value=\"14\">Austria</option>\n <option value=\"15\">Azerbaijan</option>\n <option value=\"16\">Bahamas</option>\n <option value=\"17\">Bahrain</option>\n <option value=\"18\">Bangladesh</option>\n <option value=\"19\">Barbados</option>\n <option value=\"20\">Belarus</option>\n <option value=\"21\">Belgium</option>\n <option value=\"22\">Belize</option>\n <option value=\"23\">Benin</option>\n <option value=\"24\">Bermuda</option>\n <option value=\"25\">Bhutan</option>\n <option value=\"26\">Bolivia</option>\n <option value=\"27\">Bosnia and Herzegowina</option>\n <option value=\"28\">Botswana</option>\n <option value=\"29\">Bouvet Island</option>\n <option value=\"30\">Brazil</option>\n <option value=\"31\">British Indian Ocean Territory</option>\n <option value=\"32\">Brunei Darussalam</option>\n <option value=\"33\">Bulgaria</option>\n <option value=\"34\">Burkina Faso</option>\n <option value=\"35\">Burundi</option>\n <option value=\"36\">Cambodia</option>\n <option value=\"37\">Cameroon</option>\n <option value=\"38\">Canada</option>\n <option value=\"39\">Cape Verde</option>\n <option value=\"40\">Cayman Islands</option>\n <option value=\"41\">Central African Republic</option>\n <option value=\"42\">Chad</option>\n <option value=\"43\">Chile</option>\n <option value=\"44\">China</option>\n <option value=\"45\">Christmas Island</option>\n <option value=\"46\">Cocos (Keeling) Islands</option>\n <option value=\"47\">Colombia</option>\n <option value=\"48\">Comoros</option>\n <option value=\"49\">Congo</option>\n <option value=\"50\">Cook Islands</option>\n <option value=\"51\">Costa Rica</option>\n <option value=\"52\">Cote D&#39;Ivoire</option>\n <option value=\"53\">Croatia</option>\n <option value=\"54\">Cuba</option>\n <option value=\"55\">Cyprus</option>\n <option value=\"56\">Czech Republic</option>\n <option value=\"57\">Denmark</option>\n <option value=\"58\">Djibouti</option>\n <option value=\"59\">Dominica</option>\n <option value=\"60\">Dominican Republic</option>\n <option value=\"61\">East Timor</option>\n <option value=\"62\">Ecuador</option>\n <option value=\"63\">Egypt</option>\n <option value=\"64\">El Salvador</option>\n <option value=\"65\">Equatorial Guinea</option>\n <option value=\"66\">Eritrea</option>\n <option value=\"67\">Estonia</option>\n <option value=\"68\">Ethiopia</option>\n <option value=\"69\">Falkland Islands (Malvinas)</option>\n <option value=\"70\">Faroe Islands</option>\n <option value=\"71\">Fiji</option>\n <option value=\"72\">Finland</option>\n <option value=\"73\">France</option>\n <option value=\"74\">France, Metropolitan</option>\n <option value=\"75\">French Guiana</option>\n <option value=\"76\">French Polynesia</option>\n <option value=\"77\">French Southern Territories</option>\n <option value=\"78\">Gabon</option>\n <option value=\"79\">Gambia</option>\n <option value=\"80\">Georgia</option>\n <option value=\"81\">Germany</option>\n <option value=\"82\">Ghana</option>\n <option value=\"83\">Gibraltar</option>\n <option value=\"84\">Greece</option>\n <option value=\"85\">Greenland</option>\n <option value=\"86\">Grenada</option>\n <option value=\"87\">Guadeloupe</option>\n <option value=\"88\">Guam</option>\n <option value=\"89\">Guatemala</option>\n <option value=\"90\">Guinea</option>\n <option value=\"91\">Guinea-bissau</option>\n <option value=\"92\">Guyana</option>\n <option value=\"93\">Haiti</option>\n <option value=\"94\">Heard and Mc Donald Islands</option>\n <option value=\"95\">Honduras</option>\n <option value=\"96\">Hong Kong</option>\n <option value=\"97\">Hungary</option>\n <option value=\"98\">Iceland</option>\n <option value=\"99\">India</option>\n <option value=\"100\">Indonesia</option>\n <option value=\"101\">Iran (Islamic Republic of)</option>\n <option value=\"102\">Iraq</option>\n <option value=\"103\">Ireland</option>\n <option value=\"104\">Israel</option>\n <option value=\"105\">Italy</option>\n <option value=\"106\">Jamaica</option>\n <option value=\"107\">Japan</option>\n <option value=\"108\">Jordan</option>\n <option value=\"109\">Kazakhstan</option>\n <option value=\"110\">Kenya</option>\n <option value=\"111\">Kiribati</option>\n <option value=\"112\">Korea, Democratic People&#39;s Republic of</option>\n <option value=\"113\">Korea, Republic of</option>\n <option value=\"114\">Kuwait</option>\n <option value=\"115\">Kyrgyzstan</option>\n <option value=\"116\">Lao People&#39;s Democratic Republic</option>\n <option value=\"117\">Latvia</option>\n <option value=\"118\">Lebanon</option>\n <option value=\"119\">Lesotho</option>\n <option value=\"120\">Liberia</option>\n <option value=\"121\">Libyan Arab Jamahiriya</option>\n <option value=\"122\">Liechtenstein</option>\n <option value=\"123\">Lithuania</option>\n <option value=\"124\">Luxembourg</option>\n <option value=\"125\">Macau</option>\n <option value=\"126\">Macedonia, The Former Yugoslav Republic of</option>\n <option value=\"127\">Madagascar</option>\n <option value=\"128\">Malawi</option>\n <option value=\"129\">Malaysia</option>\n <option value=\"130\">Maldives</option>\n <option value=\"131\">Mali</option>\n <option value=\"132\">Malta</option>\n <option value=\"133\">Marshall Islands</option>\n <option value=\"134\">Martinique</option>\n <option value=\"135\">Mauritania</option>\n <option value=\"136\">Mauritius</option>\n <option value=\"137\">Mayotte</option>\n <option value=\"138\">Mexico</option>\n <option value=\"139\">Micronesia, Federated States of</option>\n <option value=\"140\">Moldova, Republic of</option>\n <option value=\"141\">Monaco</option>\n <option value=\"142\">Mongolia</option>\n <option value=\"143\">Montserrat</option>\n <option value=\"144\">Morocco</option>\n <option value=\"145\">Mozambique</option>\n <option value=\"146\">Myanmar</option>\n <option value=\"147\">Namibia</option>\n <option value=\"148\">Nauru</option>\n <option value=\"149\">Nepal</option>\n <option value=\"150\">Netherlands</option>\n <option value=\"151\">Netherlands Antilles</option>\n <option value=\"152\">New Caledonia</option>\n <option value=\"153\">New Zealand</option>\n <option value=\"154\">Nicaragua</option>\n <option value=\"155\">Niger</option>\n <option value=\"156\">Nigeria</option>\n <option value=\"157\">Niue</option>\n <option value=\"158\">Norfolk Island</option>\n <option value=\"159\">Northern Mariana Islands</option>\n <option value=\"160\">Norway</option>\n <option value=\"161\">Oman</option>\n <option value=\"162\">Pakistan</option>\n <option value=\"163\">Palau</option>\n <option value=\"164\">Panama</option>\n <option value=\"165\">Papua New Guinea</option>\n <option value=\"166\">Paraguay</option>\n <option value=\"167\">Peru</option>\n <option value=\"168\">Philippines</option>\n <option value=\"169\">Pitcairn</option>\n <option value=\"170\">Poland</option>\n <option value=\"171\">Portugal</option>\n <option value=\"172\">Puerto Rico</option>\n <option value=\"173\">Qatar</option>\n <option value=\"174\">Reunion</option>\n <option value=\"175\">Romania</option>\n <option value=\"176\">Russian Federation</option>\n <option value=\"177\">Rwanda</option>\n <option value=\"178\">Saint Kitts and Nevis</option>\n <option value=\"179\">Saint Lucia</option>\n <option value=\"180\">Saint Vincent and the Grenadines</option>\n <option value=\"181\">Samoa</option>\n <option value=\"182\">San Marino</option>\n <option value=\"183\">Sao Tome and Principe</option>\n <option value=\"184\">Saudi Arabia</option>\n <option value=\"185\">Senegal</option>\n <option value=\"186\">Seychelles</option>\n <option value=\"187\">Sierra Leone</option>\n <option value=\"188\">Singapore</option>\n <option value=\"189\">Slovakia (Slovak Republic)</option>\n <option value=\"190\">Slovenia</option>\n <option value=\"191\">Solomon Islands</option>\n <option value=\"192\">Somalia</option>\n <option value=\"193\">South Africa</option>\n <option value=\"194\">South Georgia and the South Sandwich Islands</option>\n <option value=\"195\">Spain</option>\n <option value=\"196\">Sri Lanka</option>\n <option value=\"197\">St. Helena</option>\n <option value=\"198\">St. Pierre and Miquelon</option>\n <option value=\"199\">Sudan</option>\n <option value=\"200\">Suriname</option>\n <option value=\"201\">Svalbard and Jan Mayen Islands</option>\n <option value=\"202\">Swaziland</option>\n <option value=\"203\">Sweden</option>\n <option value=\"204\">Switzerland</option>\n <option value=\"205\">Syrian Arab Republic</option>\n <option value=\"206\">Taiwan</option>\n <option value=\"207\">Tajikistan</option>\n <option value=\"208\">Tanzania, United Republic of</option>\n <option value=\"209\">Thailand</option>\n <option value=\"210\">Togo</option>\n <option value=\"211\">Tokelau</option>\n <option value=\"212\">Tonga</option>\n <option value=\"213\">Trinidad and Tobago</option>\n <option value=\"214\">Tunisia</option>\n <option value=\"215\">Turkey</option>\n <option value=\"216\">Turkmenistan</option>\n <option value=\"217\">Turks and Caicos Islands</option>\n <option value=\"218\">Tuvalu</option>\n <option value=\"219\">Uganda</option>\n <option value=\"220\">Ukraine</option>\n <option value=\"221\">United Arab Emirates</option>\n <option value=\"222\">United Kingdom</option>\n <option value=\"223\">United States</option>\n <option value=\"224\">United States Minor Outlying Islands</option>\n <option value=\"225\">Uruguay</option>\n <option value=\"226\">Uzbekistan</option>\n <option value=\"227\">Vanuatu</option>\n <option value=\"228\">Vatican City State (Holy See)</option>\n <option value=\"229\">Venezuela</option>\n <option value=\"230\">Viet Nam</option>\n <option value=\"231\">Virgin Islands (British)</option>\n <option value=\"232\">Virgin Islands (U.S.)</option>\n <option value=\"233\">Wallis and Futuna Islands</option>\n <option value=\"234\">Western Sahara</option>\n <option value=\"235\">Yemen</option>\n <option value=\"236\">Yugoslavia</option>\n <option value=\"237\">Zaire</option>\n <option value=\"238\">Zambia</option>\n <option value=\"239\">Zimbabwe</option>\n </select></td>\n </tr>\n <tr>\n <td>State:</td>\n <td>\n <input type=\"text\" name=\"state\" class=\"inputBox\" style=\"width:300px\" size=\"20\" maxlength=\"50\" value=\"[+state+]\"></td>\n </tr>\n <tr>\n <td>Zip:</td>\n <td>\n <input type=\"text\" name=\"zip\" class=\"inputBox\" style=\"width:300px\" maxlength=\"50\" size=\"20\" value=\"[+zip+]\"></td>\n </tr>\n <?php if ($useCaptcha){ ?>\n <tr>\n <td valign=\"top\">Form code:*</td>\n <td>\n <input type=\"text\" name=\"formcode\" class=\"inputBox\" style=\"width:150px\" size=\"20\">\n <a href=\"[+action+]\"><img align=\"top\" src=\"[(site_manager_url)]includes/veriword.php?rand=<?php echo rand(); ?>\" width=\"148\" height=\"60\" alt=\"If you have trouble reading the code, click on the code itself to generate a new random code.\" style=\"border: 1px solid #003399\"></a>\n </td>\n </tr>\n <?php } ?>\n <tr>\n <td colspan=\"2\">&nbsp;* - Indicates required fields</td>\n </tr>\n </table>\n </td>\n </tr>\n <tr>\n <td align=\"right\">\n <input type=\"submit\" value=\"Submit\" name=\"cmdwebsignup\" />\n <input type=\"reset\" value=\"Reset\" name=\"cmdreset\" />\n </td>\n </tr>\n </table>\n </form>\n <script language=\"javascript\" type=\"text/javascript\"> \n var id = \"[+country+]\";\n var f = document.websignupfrm;\n var i = parseInt(id);\n if (!isNaN(i)) f.country.options[i].selected = true;\n </script>\n <hr>\n <!-- notification section -->\n <span style=\"font-weight:bold;\">Signup completed successfully</span><br />\n Your account was successfully created.<br />\n A copy of your signup information was sent to your email address.<br /><br />\n <?php \n $t = ob_get_contents();\n ob_end_clean();\n return $t;\n}", "function onGetFormHead($output = false) {\n\t\t\n\t\t$html = '<div id=\"bf_previewform_div_' . $this->_FORM_CONFIG ['id'] . '\"></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_preview\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_submit\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate &amp; submit your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t$html .= \"\\n\\n\" . '<form %s>';\n\t\t\n\t\t$JMenu = JMenu::getInstance ( 'site' );\n\t\t$activeMenu = $JMenu->getActive ();\n\t\t$activeMenu === null ? $Itemid = 1 : $Itemid = $activeMenu->id;\n\t\t\n\t\t$attributes = array ();\n\t\t$attributes ['method'] = 'method=\"' . strtolower ( $this->_FORM_CONFIG ['method'] ) . '\"';\n\t\t$attributes ['action'] = 'action=\"' . ($this->_FORM_CONFIG ['processorurl'] ? $this->_FORM_CONFIG ['processorurl'] : bfCompat::getLiveSite () . '/index.php?Itemid=' . ($Itemid ? $Itemid : '1')) . '\"';\n\t\t$attributes ['name'] = 'name=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['id'] = 'id=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['enctype'] = 'enctype=\"' . $this->_FORM_CONFIG ['enctype'] . '\"';\n\t\t$attributes ['class'] = ' class=\"bfform ' . $this->_FORM_CONFIG ['layout'] . 'form\"';\n\t\t$attributes ['target'] = ' target=\"' . ($this->_FORM_CONFIG ['target'] ? $this->_FORM_CONFIG ['target'] : '_self') . '\"';\n\t\t\n\t\tksort ( $attributes );\n\t\t\n\t\t$attributes = implode ( ' ', $attributes );\n\t\t\n\t\t$html = sprintf ( $html, $attributes );\n\t\t\n\t\tswitch ($output) {\n\t\t\tcase true :\n\t\t\t\techo $html;\n\t\t\t\tbreak;\n\t\t\tcase false :\n\t\t\t\treturn $html;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "public function indexAction() {\n // $_ENV['LIQPAY_PUBLIC_KEY'], \n // $_ENV['LIQPAY_PRIVATE_KEY']\n // );\n // $html = $liqpay->cnb_form(array(\n // 'action' => 'pay',\n // 'amount' => '4',\n // 'currency' => 'UAH',\n // 'description' => 'description text',\n // 'order_id' => 'order_id_10',\n // 'version' => '3',\n // 'language' => 'en',\n // 'result_url' => baseUrl(),\n // 'server_url' => 'https://hi-eddy.com/payment-payment/sdfsdf/payyyy'\n // ));\n\n // debug($html);\n \n $this->setMeta(\n Tone::$app->getProperty('site_name'),\n 'hi-eddy - це освітня платформа',\n 'hi-eddy, освітня платформа'\n );\n }", "public function enquiryStep1($url, $calledByScrapeMethod = true) {\n\n $logMsg = \"Telling the server we're looking for development applications, requesting cookies...<br>\";\n echo $logMsg;\n\n $formData = $this->getAspFormDataByUrl($url);\n $formData['ctl00$MainBodyContent$mContinueButton'] = \"Next\";\n $formData['ctl00$mHeight'] = 653;\n $formData['ctl00$mWidth'] = 786;\n\n // Page gives different output not allowing us to scrape the addresses, change option to 2 when called by scrapeMeta\n if ($calledByScrapeMethod === true) {\n $formData['mDataGrid:Column0:Property'] = 'ctl00$MainBodyContent$mDataList$ctl03$mDataGrid$ctl04$ctl00';\n }\n else {\n $formData['mDataGrid:Column0:Property'] = 'ctl00$MainBodyContent$mDataList$ctl03$mDataGrid$ctl02$ctl00';\n }\n\n $formData['__LASTFOCUS'] = null;\n $formData = http_build_query($formData);\n\n $requestHeaders = [\n \"Host: ebiz.campbelltown.nsw.gov.au\",\n \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\",\n \"Accept-Language: en-GB,en;q=0.5\",\n \"Accept-Encoding: none\",\n \"Referer: https://ebiz.campbelltown.nsw.gov.au/ePathway/Production/Web/GeneralEnquiry/EnquiryLists.aspx?ModuleCode=LAP\",\n \"Content-Type: application/x-www-form-urlencoded\",\n \"Connection: keep-alive\",\n \"DNT: 1\",\n ];\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $formData);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_COOKIEFILE, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_COOKIEJAR, __DIR__ . '/../cookies/cookies.txt');\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0');\n\n $output = curl_exec($ch);\n $errno = curl_errno($ch);\n $errmsg = curl_error($ch);\n curl_close($ch);\n\n if ($errno !== 0) {\n\n $logMsg = \"cURL error in enquiryStep1 function: \" . $errmsg . \" (\" . $errno . \")\";\n echo $logMsg . '<br>';\n return false;\n }\n\n $newFormData = $this->getAspFormDataByString($output);\n return $newFormData;\n\n }", "function hs_login_form($width=\"100%\")\r\n{\r\n $retval = \"\";\r\n\r\n\t//$retval .= \"<div class='hs_main_div'>\"; \r\n\t$retval .= \"<table class='hs_login_membership_main_table' width='100%' border='0' cellspacing='0' cellpadding='0'>\";\r\n\r\n\t$retval .= \"<tr><td style='vertical-align:top;width:40%'>\";\r\n\t$retval .= \"<div class='hs_login_div'>\";\r\n\t$retval .= \"<h2 class='hs_login_membership_header'>Registered Customers</h2>\";\r\n\t$retval .= \"&nbsp;<br />\";\r\n\t$retval .= \"<input type='button' class='hs_form_button' onclick='location.href=\\\"https://online.spectrumng.net/healthsport\\\"' value='Member Login'>\";\r\n\r\n\r\n\t//$retval .= \"<iframe frameborder='0' marginheight='1' marginwidth='1' scrolling='no' src='\".get_option(HS_LOGIN_MEMBERSHIP_CSI_URL).\"' width='330' height='250'></iframe>\"; \r\n\t//$retval .= \"<form id='hs-login-form' method='POST'>\";\r\n\t//$retval .= \"<table class='hs_login_membership_table' width='100%' border='0' cellspacing='0' cellpadding='0'>\";\r\n\t//$retval .= \"<tr><td id='hs_login_membership_messages' colspan='2'></td></tr>\";\r\n\t//$retval .= \"<tr><td>\";\t\r\n\t//$retval .= \"<label for='hs_username' class='hs_login_membership_label'>E-mail Address</label>\";\r\n\t//$retval .= \"</td><td>\";\r\n\t//$retval .= \"<input type='text' autofocus='autofocus' id='hs_username' class='hs_login_membership_input'>\";\r\n\t//$retval .= \"</td></tr>\";\r\n\t//$retval .= \"<tr><td>\";\t\r\n\t//$retval .= \"<label for='hs_password' class='hs_login_membership_label'>Password</label>\";\r\n\t//$retval .= \"</td><td>\";\r\n\t//$retval .= \"<input type='password' id='hs_password' class='hs_login_membership_input'>\";\r\n\t//$retval .= \"</td></tr>\";\r\n\t//$retval .= \"<tr><td></td><td style='text-align:left;'>\";\r\n\t//$retval .= \"<input type='submit' value='Login' class='hs_form_button' id='hs_login' onClick='hs_login_membership_login_user(); return false;'/>\";\r\n\t//$retval .= \"</td></tr>\";\r\n\t//$retval .= \"<tr><td id='hs_login_membership_submit_message' colspan='2'></td></tr>\";\r\n\t//$retval .= \"</table>\";\r\n\t//$retval .= \"</form>\";\r\n\t//$retval .= \"<a href='\".wp_lostpassword_url().\"' title='Lost Password'>Lost Password?</a>\";\r\n\t//$retval .= \"</div>\";\r\n\t//$retval .= \"</td>\";\r\n\r\n\t$retval .= \"<td style='vertical-align:top;'>\";\r\n\t$retval .= \"<div class='hs_membership_div'>\";\r\n\t$retval .= \"<h2 class='hs_login_membership_header'>Create an Account.</h2>\";\r\n\t$retval .= \"&nbsp;<br />\";\r\n\t$retval .= \"<input type='button' class='hs_form_button' onclick='location.href=\\\"\".site_url(HS_LOGIN_MEMBERSHIP_PAGE).\"\\\"' value='Create An Account'>\";\r\n\t$retval .= \"</div>\";\r\n\t$retval .= \"</td>\";\r\n\r\n\t$retval .= \"<td style='vertical-align:top;'>\";\r\n\t$retval .= \"<div class='hs_membership_div'>\";\r\n\t$retval .= \"<h2 class='hs_login_membership_header'>Welcome</h2>\";\r\n\t$retval .= \"&nbsp;<br />\";\r\n\t$retval .= \"<input type='button' class='hs_form_button' onclick='location.href=\\\"\".site_url(\"/new-member/\").\"\\\"' value='Welcome'>\";\r\n\t$retval .= \"</div>\";\r\n\t$retval .= \"</td></tr>\";\r\n\r\n\r\n\t$retval .= \"</table>\";\r\n\t//$retval .= \"</div>\";\r\n\r\n return $retval;\r\n}", "public function after_payment_method_details() {\n\n\t\t$key = isset( $_GET['order'] ) ? $_GET['order'] : '';\n\n\t\t$order = llms_get_order_by_key( $key );\n\t\tif ( ! $order ) {\n\t\t\treturn;\n\t\t} elseif ( 'paypal' !== $order->get( 'payment_gateway' ) ) {\n\t\t\tif ( ! isset( $_GET['confirm-switch'] ) || 'paypal' !== $_GET['confirm-switch'] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$req = new LLMS_PayPal_Request( $this );\n\t\t$r = $req->get_express_checkout_details( $_GET['token'] );\n\n\t\techo '<input name=\"llms_paypal_token\" type=\"hidden\" value=\"' . $_GET['token'] . '\">';\n\t\techo '<input name=\"llms_paypal_payer_id\" type=\"hidden\" value=\"' . $_GET['PayerID'] . '\">';\n\n\t\tif ( isset( $r['EMAIL'] ) ) {\n\t\t\techo '<div class=\"\"><span class=\"llms-label\">' . __( 'PayPal Email:', 'lifterlms-paypal' ) . '</span> ' . $r['EMAIL'] . '</div>';\n\t\t}\n\n\t}", "function edd_pup_email_confirm_html(){\n\t$form = array();\n\tparse_str( $_POST['form'], $form );\n\tparse_str( $_POST['url'], $url );\n\n\t// Nonce security check\n\tif ( empty( $form['edd-pup-send-nonce'] ) || ! wp_verify_nonce( $form['edd-pup-send-nonce'], 'edd-pup-confirm-send' ) ) {\n\t\techo 'noncefail';\n\t\tdie();\n\t}\n\n\t// Make sure there are products to be updated\n\tif ( empty( $form['products'] ) ) {\n\t\techo 'nocheck';\n\t\tdie();\n\t}\n\n\t// Save the email before generating preview\n\t$email_id = edd_pup_sanitize_save( $_POST );\n\n\t// If \"Send Update Email\" was clicked from Add New Email page, trigger browser to refresh to edit page for continued editing\n\tif ( $url['view'] == 'add_pup_email' ) {\n\t\techo absint( $email_id );\n\t\tdie();\n\t}\n\n\t// Necessary for preview HTML\n\tset_transient( 'edd_pup_preview_email_'. get_current_user_id(), $email_id, 60 );\n\n\t$bundlenum\t = 0;\n\t$email = get_post( $email_id );\n\t$emailmeta = get_post_custom( $email_id );\n\t$filters\t = unserialize( $emailmeta['_edd_pup_filters'][0] );\n\t$products \t = get_post_meta( $email_id, '_edd_pup_updated_products', true );\n\t$popup_url \t = add_query_arg( array( 'view' => 'send_pup_ajax', 'id' => $email_id ), admin_url( 'edit.php?post_type=download&page=edd-prod-updates' ) );\n\t$customercount = edd_pup_customer_count( $email_id, $products );\n\t$email_body = isset( $email->post_content ) ? stripslashes( $email->post_content ) : 'Cannot retrieve message content';\n $subject = empty( $emailmeta['_edd_pup_subject'][0] ) ? '(no subject)' : strip_tags( edd_email_preview_template_tags( $emailmeta['_edd_pup_subject'][0] ) );\n $productlist = '';\n\n // No customers in the update\n if ( $customercount == 0 ) {\n\t echo 'nocust';\n\t die();\n }\n\n // Create product list\n\tforeach ( $products as $product_id => $product ) {\n\t\t$bundle = edd_is_bundled_product( $product_id );\n\n\t\t// Filter bundle customers only\n\t\tif ( $filters['bundle_2'] && !$bundle ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$productlist .= '<li data-id=\"'. $product_id .'\">'. $product .'</li>';\n\n\t\tif ( $bundle ) {\n\t\t\t$bundledproducts = edd_get_bundled_products( $product_id );\n\t\t\t$productlist .= '<ul id=\"edd-pup-confirm-bundle-products\">';\n\n\t\t\tforeach ( $bundledproducts as $bundleitem ) {\n\t\t\t\tif ( isset( $products[ $bundleitem ] ) ) {\n\t\t\t\t\t$productlist .= '<li data-id=\"'.$bundleitem.'\">'. $products[$bundleitem ].'</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$productlist .= '</ul>';\n\t\t\t$bundlenum++;\n\t\t}\n\t}\n\n\t// Throw error if no bundled products are selected, but send only to bundle customers option is\n\tif ( empty( $productlist ) ) {\n\t\techo 'nobundles';\n\t\tdie();\n\t}\n\n\t// Construct templated email HTML\n\tadd_filter('edd_email_template', 'edd_pup_template' );\n\n\tif ( version_compare( get_option( 'edd_version' ), '2.1' ) >= 0 ) {\n\t\t$edd_emails = new EDD_Emails;\n\t\t$message = $edd_emails->build_email( edd_email_preview_template_tags( $email_body ) );\n\t} else {\n\t\t$message = edd_apply_email_template( $email_body, null, null );\n\t}\n\n\t// Add max-width for plaintext emails so they don't run off the page\n\tif ( 'none' == edd_pup_template() ) {\n\t\t$message = '<div style=\"width: 640px;\">'. $message .'</div>';\n\t}\n\n\t// Save message to metadata for later retrieval\n\tupdate_post_meta( $email_id, '_edd_pup_message' ,$message );\n\n\tob_start();\n\t?>\n\t\t<!-- Begin send email confirmation message -->\n\t\t\t<h2 id=\"edd-pup-confirm-title\"><strong><?php _e( 'Almost Ready to Send!', 'edd-pup' ); ?></strong></h2>\n\t\t\t<p style=\"text-align: center;\"><?php _e( 'Please carefully check the information below before sending your emails.', 'edd-pup' ); ?></p>\n\t\t\t<div id=\"edd-pup-confirm-message\">\n\t\t\t\t<div id=\"edd-pup-confirm-header\">\n\t\t\t\t\t<h3><?php _e( 'Email Message Preview', 'edd-pup' ); ?></h3>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li><strong><?php _e( 'From:', 'edd-pup' ); ?></strong> <?php echo $emailmeta['_edd_pup_from_name'][0];?> (<?php echo $emailmeta['_edd_pup_from_email'][0];?>)</li>\n\t\t\t\t\t\t<li><strong><?php _e( 'Subject:', 'edd-pup' ); ?></strong> <?php echo $subject;?></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<?php echo $message ?>\n\t\t\t\t<div id=\"edd-pup-confirm-footer\">\n\t\t\t\t\t<h3><?php _e( 'Additional Information', 'edd-pup' ); ?></h3>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li><strong><?php _e( 'Updated Products:', 'edd-pup' ); ?></strong></li>\n\t\t\t\t\t\t\t<ul id=\"edd-pup-confirm-products\">\n\t\t\t\t\t\t\t<?php echo $productlist; ?>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<?php if ( $bundlenum > 0 ):?>\n\t\t\t\t\t\t<li><strong><?php _e( 'Bundle Filters:', 'edd-pup' ); ?></strong></li>\n\t\t\t\t\t\t\t<ul id=\"edd-pup-confirm-products\">\n\t\t\t\t\t\t\t\t<?php foreach ( $filters as $filtername => $filtervalue ): ?>\n\t\t\t\t\t\t\t\t<?php switch ( $filtername ) {\n\t\t\t\t\t\t\t\t\t\tcase 'bundle_1' :\n\t\t\t\t\t\t\t\t\t\t\t$output = $filtervalue == 'all' ? '<li>'.__('Show links for all products within bundles', 'edd-pup').'</li>' : '<li>'.__('Show links for only updated products within bundles', 'edd-pup').'</li>';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\t\tcase 'bundle_2' :\n\t\t\t\t\t\t\t\t\t\t\t$output = $filtervalue == 1 ? '<li>'.__('Send this email to bundle customers only', 'edd-pup').'</li>' : '';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\techo $output;\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<li><strong><?php _e( 'Recipients:', 'edd-pup' ); ?></strong> <?php printf( _n( '1 customer will receive this email and have their downloads reset', '%s customers will receive this email and have their downloads reset', $customercount, 'edd-pup' ), number_format( $customercount ) ); ?></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<a href=\"<?php echo $popup_url; ?>\" id=\"prod-updates-email-ajax\" class=\"button-primary button\" title=\"<?php _e( 'Confirm and Send Emails', 'edd-pup' ); ?>\" onclick=\"window.open(this.href,'targetWindow', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=480');return false;\"><?php _e( 'Confirm and Send Emails', 'edd-pup' ); ?></a>\n\t\t\t\t\t<button class=\"closebutton button-secondary\"><?php _e( 'Close without sending', 'edd-pup' ); ?></button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<!-- End send email confirmation message -->\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery('.postbox .recipient-count').text(\"<?php echo number_format( $customercount );?>\");\n\t\t\tjQuery('.postbox .recipient-input').val(<?php echo $customercount;?>);\n\t\t</script>\n\t<?php\n\techo ob_get_clean();\n\n\tdie();\n}", "function commerce_oz_migs_2p_submit_form($payment_method, $pane_values, $checkout_pane, $order) {\n \n//\t// dsm($payment_method, '$payment_method');\n//\t// dsm($checkout_pane);\n//\t// dsm($pane_values);\n//\t// dsm($order);\n \t \t \t\n // Include the Drupal Commerce credit card file for forms\n module_load_include('inc', 'commerce_payment', 'includes/commerce_payment.credit_card');\n \n\t$settings = _commweb_get_var('commerce_oz_gateway_' . $payment_method['gateway_provider']);\n \n// \tdsm($settings, '$settings');\n\n $form_params = array();\n $form_defaults = array();\n \n // Use CVV Field?\n if($settings['commerce_oz_use_cvv'] == 'cvv')\n {\n \t$form_params['code'] = '';\n }\n \n // Use Card Holder Name Field ?\n if($settings['commerce_oz_use_card_name'] == 'name')\n {\n \t$form_params['owner'] = 'Card Holder';\n }\n \n \n // set the defaults for testing\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n\n\t\t \t$form_defaults['number'] = $settings['commerce_oz_test_card_number'];\n\t\t \t$form_defaults['code'] = $settings['commerce_oz_test_card_cvv'];\n\t\t \t$form_defaults['exp_month'] = $settings['commerce_oz_test_card_exp_month'];\n\t\t \t$form_defaults['exp_year'] = $settings['commerce_oz_test_card_exp_year'];\n\t\t}\n\t\t\n\n $gateway = commerce_oz_load_gateway_provider($payment_method['gateway_provider']);\n \n \t$form = commerce_payment_credit_card_form($form_params, $form_defaults);\n\n\t$logopath = '/' . drupal_get_path('module', 'commerce_oz') . '/image/' . $payment_method['gateway_provider'] . '_68.png';\n\t\n\t$descText = '<a href=\"' . $gateway['owner_website'] . '\"><img src=\"' . $logopath . '\" /></a><br />Enter your payment details below and Click Continue.<br />On completing your transaction, you will be taken to your Receipt information.<br />';\n\n $form['commweb_3p_head'] = array(\n '#type' => 'fieldset',\n '#title' => t($payment_method['title']),\n '#collapsible' => FALSE, \n \t'#collapsed' => FALSE,\n '#description' => t($descText),\n );\n \n\n if($settings['commerce_oz_transaction_mode'] == 'test')\n {\n // // dsm($form);\n \n \n $form['credit_card']['number']['#description'] = t('<strong>Test Mode</strong> - You can only use the credit cards listed here to test in Test Mode. Valid card numbers are:\n \t\t<br /><br />Master:&nbsp;&nbsp;5123456789012346\n <br />Visa:&nbsp;&nbsp;&nbsp;&nbsp;4987654321098769\n <br />Amex:&nbsp;&nbsp;&nbsp;345678901234564\n <br />Diners:&nbsp;&nbsp;30123456789019\n <br /><br />All CommWeb Test Cards must use 05-2013 as the Expiry Date.');\n\n $form['credit_card']['exp_year']['#description'] = t('<strong>est Mode</strong> - All CommWeb Test Cards must use 05-2013 as the Expiry Date');\n\n $form['credit_card']['owner']['#description'] = t('<strong>Test Mode</strong> - Transactions do NOT require or use the Card Owner field. If you choose to request this information from your users it will however be stored with the transaction record.');\n\n \n \n // Provide a textfield to pass different Amounts to MIGS \n $form['credit_card']['test_amount'] = array(\n '#input' => TRUE,\n\n '#type' => 'textfield',\n '#size' => 6,\n '#maxlength' => 10,\n \t\t\n '#title' => t('Test Mode - Custom Amount'), \n '#default_value' => $order->commerce_order_total['und'][0]['amount'],\n '#disabled' => FALSE,\n '#description' => t('<strong>Test Mode</strong> - Update the Amount (in cents) sent for processing to change your desired transaction response.<br /> Valid amounts are <br />xxx00 = Approved\n <br />xxx05 = Declined. Contact Bank.\n <br />xxx10 = Transaction could not be processed.\n <br />xxx33 = Expired Card.\n <br />xxx50 = Unspecified Failure.\n <br />xxx51 = Insufficient Funds.\n <br />xxx68 = Communications failure with bank'),\n '#required' => FALSE, \n ); \n \n }\n \n \n \t$form['commweb_3p_head']['credit_card'] = $form['credit_card'];\n\tunset($form['credit_card']);\n\t\n//\t// dsm($form);\n\t\n return $form;\n \n}", "function print_form_invite_req_fp(){\r\n\techo '<div class=\"form-container\" id=\"fp-form-invite\">';\r\n\tprint_form_invite_req();\r\n\techo '<div class=\"cta-accept-invite\"><a href=\"\" class=\"call-popup-accept-invite\">\r\n\t\t<span class=\"fa-stack fa-lg fa-invite\">\r\n \t\t\t<i class=\"fa fa-heart fa-stack-2x\"></i>\r\n \t\t\t<i class=\"fa fa-arrow-right fa-stack-1x\"></i>\r\n\t\t</span> <strong>Have a code? Accept your invite!</strong></a></div></div></div>';\r\n}", "function teligence_purchase_buypackage31_form_submit($form, &$form_state)\r\n{\r\n\tif($form_state['clicked_button']['#id'] == 'edit-submitpurchase')\r\n\t{\r\n\t\t// parse package elements; id, price, minutes\r\n\t\t$package = explode('|',$form_state['values']['packages']);\r\n\t\t\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ValidateAsuNotSignedIn\r\n\t\t\t$params = new stdClass ();\r\n\t\t $params->ivrBrandId = variable_get('teligence_purchase_brandid', 1);\r\n\t\t\t$params->email = $form_state['values']['email'];\r\n\t\t\t$params->password = $form_state['values']['password'];\r\n\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t$params->packageId = $package[0];\r\n\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuNotSignedIn', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\tswitch ($result->ValidateAsuNotSignedInResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'ExistingMembershipBrandHub': \r\n\t\t\t\t\t// signin as ivr_user, send validation email and redirect to 3.3\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ValidateAsuNotSignedInResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// load user\r\n\t\t\t\t\tglobal $user;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// update drupal user\r\n\t\t\t\t\t$form_state['WebActiveMemberships'] = $result->ValidateAsuNotSignedInResult->WebActiveMemberships;\r\n\t\t\t\t\t$user = teligence_purchase_drupaluser($form_state);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// save values in the session\r\n\t\t\t\t\t$sessionValues = $result->ValidateAsuNotSignedInResult;\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($sessionValues);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// message to user\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system. You can select from the packages below.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\tdrupal_goto('cart/add-time');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\tcase 'EmailLinkedToWebAccount':\r\n\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\tcase 'CreditCardLinkedToWebAccount':\r\n\t\t\t\t\tdrupal_set_message(t('We found you in our system already. Please !sign', array('!sign' => l(t('click here to sign-in'),'cart/login'))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuNotSignedInResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// paypal\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'pp')\r\n\t\t{\r\n\t\t\t// send request to paypal.teligence.net\r\n\t\t\tmodule_load_include('inc', 'teligence_purchase', 'teligence_purchase-paypal');\r\n\t\t\t$urlquery = array(\r\n\t\t\t\t// 'areaCode' => '', // from previous implementation\r\n\t\t\t\t// 'Ani' => '', // from previous implementation\r\n\t\t\t\t'SequenceId' => teligence_cart_uuid(TRUE),\r\n\t\t\t\t'Password' => $form_state['storage']['values']['password'],\r\n\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t'PackageId' => $package[0],\r\n\t\t\t\t'VendorPass' => md5(variable_get('teligence_cart_paypal_vendor_pass_asu', '')),\r\n\t\t\t\t'lang' => $GLOBALS['language']->language,\r\n\t\t\t\t'IvrBrandId' => variable_get('teligence_purchase_brandid', 1),\r\n\t\t\t);\r\n\t\t\tif(!teligence_purchase_paypalSetSessionData($urlquery, variable_get('teligence_cart_paypal_vendor_id_asu', '')))\r\n\t\t\t{\r\n\t\t\t\t// could not connect to paypal.teligence.net\r\n\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// place order\r\n\tif($form_state['clicked_button']['#id'] == 'edit-placeorder')\r\n\t{\r\n\t\t// drupal_set_message('<pre>'.check_plain(print_r($form_state['storage']['values'],1)).'</pre>');\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ProcessPayment\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->orderId = $form_state['storage']['values']['ValidateResult']->OrderId;\r\n\t\t\t$params->paymethodId = $form_state['storage']['values']['ValidateResult']->PaymethodId;\r\n\t\t\t$params->cvn = $form_state['storage']['values']['securitycode'];\r\n\t\t\t$params->email = $form_state['storage']['values']['email'];\r\n\t\t\t$params->password = $form_state['storage']['values']['password'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ProcessPayment', variable_get('teligence_purchase_wsdl_ordermanagement',''));\r\n\t\t\tswitch ($result->ProcessPaymentResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t// send validation email\r\n\t\t\t\t\t$tokens = teligence_purchase_tokens('emailValidateAccount');\r\n\t\t\t\t\t$tokens['[email]'] = $form_state['storage']['values']['email'];\r\n\t\t\t\t\t$tokens['[password]'] = $form_state['storage']['values']['password'];\r\n\t\t\t\t\t$tokens['[url]'] = url('cart/validate-web-account/' . \r\n\t\t\t\t\t\t$result->ProcessPaymentResult->ValidationCode . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['email'] . '/' . \r\n\t\t\t\t\t\t$form_state['storage']['values']['password'], array('absolute' => TRUE)\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_mail('teligence_purchase', 'emailValidateAccount', $form_state['storage']['values']['email'], language_default(), $tokens);\r\n\t\t\t\t\tdrupal_set_message(t('We have sent you an email with a validation link. Please click it to validate your account.'));\r\n\t\t\t\t\t\r\n\t\t\t\t\t// drupal_set_message('<pre>'.check_plain(print_r($result->ProcessPaymentResult->WebActiveMemberships,1)).'</pre>');\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\t$querystring = array(\r\n\t\t\t\t\t\t'City' => trim(str_replace(\"2\", \"\",$result->ProcessPaymentResult->WebActiveMemberships->MarketName)),\r\n\t\t\t\t\t\t'Email' => $form_state['storage']['values']['email'],\r\n\t\t\t\t\t\t'TotalAmountCents' => $form_state['storage']['values']['ValidateResult']->TotalAmountCents,\r\n\t\t\t\t\t\t'PackageMinutes' => $form_state['storage']['values']['ValidateResult']->PackageMinutes,\r\n\t\t\t\t\t\t'IvrMembershipNumber' => $result->ProcessPaymentResult->IvrMembershipNumber,\r\n\t\t\t\t\t\t'IvrPasscode' => $result->ProcessPaymentResult->IvrPasscode,\r\n\t\t\t\t\t\t'LocalAccessNumber' => $result->ProcessPaymentResult->LocalAccessNumber,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_goto('cart/result/creditcardasu',$querystring);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'AuthorizationDeclined':\r\n\t\t\t\tcase 'RiskScoreReject':\r\n\t\t\t\tcase 'RiskScoreReview':\r\n\t\t\t\tcase 'AuthorizationTechnicalIssue':\r\n\t\t\t\tcase 'RtmFailure':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ProcessPaymentResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t// go back to modify a value\r\n\tif($form_state['clicked_button']['#id'] == 'edit-back')\r\n\t{\r\n\t\tunset($form_state['storage']['step']);\r\n\t\t$form_state['storage']['values']['packages'] = $form_state['values']['packages'];\r\n\t\t\r\n\t}\r\n}", "function send_response()\n {\n \t// put all POST variables received from Paypal back into a URL encoded string\n foreach($this->paypal_post_vars AS $key => $value)\n {\n // if magic quotes gpc is on, PHP added slashes to the values so we need\n // to strip them before we send the data back to Paypal.\n if( @get_magic_quotes_gpc() )\n {\n $value = stripslashes($value);\n }\n\n // make an array of URL encoded values\n $values[] = \"$key\" . \"=\" . urlencode($value);\n }\n\n // join the values together into one url encoded string\n $this->url_string .= @implode(\"&\", $values);\n\n // add paypal cmd variable\n $this->url_string .= \"&cmd=_notify-validate\";\n\n\t\t $ch = curl_init();\n \t\tcurl_setopt ($ch, CURLOPT_URL, $this->url_string);\n\t \t\tcurl_setopt ($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; www.ScriptDevelopers.NET; PayPal IPN Class)\");\n \t\tcurl_setopt ($ch, CURLOPT_HEADER, 1);\n \t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\n \t\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);\n \t\tcurl_setopt ($ch, CURLOPT_TIMEOUT, $this->timeout);\n \t\t$this->paypal_response = curl_exec ($ch);\n\t\t\tcurl_close($ch);\n\n }", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is used to remember the action\r\n // which originated from the GUIDataList.\r\n \r\n $this->add_hidden_element(\"_action\") ;\r\n }", "static function pmpro_checkout_default_submit_button($show)\n\t\t{\n\t\t\tglobal $gateway, $pmpro_requirebilling;\n\n\t\t\t//show our submit buttons\n\t\t\t?>\n\t\t\t<span id=\"pmpro_paypalexpress_checkout\" <?php if(($gateway != \"paypalexpress\" && $gateway != \"paypalstandard\") || !$pmpro_requirebilling) { ?>style=\"display: none;\"<?php } ?>>\n\t\t\t\t<input type=\"hidden\" name=\"submit-checkout\" value=\"1\" />\n\t\t\t\t<input type=\"image\" id=\"pmpro_btn-submit-paypalexpress\" class=\"pmpro_btn-submit-checkout\" value=\"<?php _e('Check Out with PayPal', 'paid-memberships-pro' );?> &raquo;\" src=\"<?php echo apply_filters(\"pmpro_paypal_button_image\", \"https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif\");?>\" />\n\t\t\t</span>\n\n\t\t\t<span id=\"pmpro_submit_span\" <?php if(($gateway == \"paypalexpress\" || $gateway == \"paypalstandard\") && $pmpro_requirebilling) { ?>style=\"display: none;\"<?php } ?>>\n\t\t\t\t<input type=\"hidden\" name=\"submit-checkout\" value=\"1\" />\n\t\t\t\t<input type=\"submit\" id=\"pmpro_btn-submit\" class=\"pmpro_btn pmpro_btn-submit-checkout\" value=\"<?php if($pmpro_requirebilling) { _e('Submit and Check Out', 'paid-memberships-pro' ); } else { _e('Submit and Confirm', 'paid-memberships-pro' );}?> &raquo;\" />\n\t\t\t</span>\n\t\t\t<?php\n\n\t\t\t//don't show the default\n\t\t\treturn false;\n\t\t}", "function exam_take_form_submit($form, &$form_state) {\n \n $pExamTitleURL = $_SESSION['exam']['pExamTitleURL'];\n $form_state['redirect'] = array(\n 'exam/take/' . $pExamTitleURL . \n '/' . $_SESSION['exam']['pNextQuestionNumber']\n );\n \n \n return null;\n \n}", "function give_custom_pp_standard_redirect( $paypal_args, $payment_data ) {\n\t$form_id = intval( $payment_data['post_data']['give-form-id'] );\n\t$form_success_page = give_get_meta( $form_id, 'give_custom_pp_redirects_fields_standard_success_page', true );\n\n\t// If this donation form has a custom PP Standard success page.\n\tif ( ! empty( $form_success_page ) ) {\n\t\t$paypal_args['return'] = get_permalink( $form_success_page );\n\t}\n\n\treturn $paypal_args;\n\n}", "protected function _setSelfSubmitUri()\n {\n\t\t$uriSelfSubmit = preg_replace('/\\?.*/', '', $_SERVER['REQUEST_URI']);\n\t\t#$this->getEnv()->setUriSelfSubmit($uriSelfSubmit);\n }", "function teligence_purchase_buypackage33_form_submit($form, &$form_state)\r\n{\r\n\tif($form_state['clicked_button']['#id'] == 'edit-submitpurchase')\r\n\t{\r\n\t\t\r\n\t\t// parse package elements; id, price, minutes\r\n\t\t$package = explode('|',$form_state['values']['packages']);\r\n\t\t$cc = explode('|',$form_state['values']['creditcardslist']);\r\n\t\t\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc')\r\n\t\t{\r\n\t\t\t// ValidateSrOldCreditCard\r\n\t\t\tif($form_state['values']['memberships'] <> 'newmarket')\r\n\t\t\t{\r\n\t\t\t\t$params = new stdClass ();\r\n\t\t\t\t$params->emsMembershipId = $_SESSION['emsMemberships'][$form_state['values']['memberships']]->EmsMembershipId;\r\n\t\t\t\t$params->packageId = $package[0];\r\n\t\t\t\t$params->paymethodId = $cc[0];\r\n\t\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateSrOldCreditCard', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\t\tswitch ($result->ValidateSrOldCreditCardResult->ResponseCode) \r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'Success':\r\n\t\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateSrOldCreditCardResult;\r\n\t\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'MemberHasDebt':\r\n\t\t\t\t\tcase 'CreditCardPaymentRestriction':\r\n\t\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateSrOldCreditCardResult->ErrMsg)),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// ValidateAsuSignedInOldCreditCard\r\n\t\t\tif($form_state['values']['memberships'] == 'newmarket')\r\n\t\t\t{\r\n\t\t\t\t$params = new stdClass ();\r\n\t\t\t\t$params->emsMemberId = $_SESSION['EmsMemberId'];\r\n\t\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t\t$params->packageId = $package[0];\r\n\t\t\t\t$params->paymethodId = $cc[0];\r\n\t\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuSignedInOldCreditCard', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\t\tswitch ($result->ValidateAsuSignedInOldCreditCardResult->ResponseCode) \r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'Success':\r\n\t\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuSignedInOldCreditCardResult;\r\n\t\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'ExistingMembershipBrandHub':\r\n\t\t\t\t\t\tdrupal_set_message(t('You can use your existing @city membership (@ivr) to chat with local singles in @city2.',\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'@ivr'=>$_SESSION['IvrMembershipNumber'],\r\n\t\t\t\t\t\t\t\t'@city'=>$_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->MarketName,\r\n\t\t\t\t\t\t\t\t'@city2'=>$_SESSION['stateprovincecity']['city'][$form_state['values']['stateprovince']][$form_state['values']['city']],\r\n\t\t\t\t\t\t\t)),'error');\r\n\t\t\t\t\t\t$form_state['storage']['values']['memberships']\t= $result->ValidateAsuSignedInOldCreditCardResult->IvrMembershipNumber;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuSignedInOldCreditCardResult->ErrMsg)),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// add new credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'addcc')\r\n\t\t{\r\n\t\t\t// ValidateAsuSignedInNewCreditCard\r\n\t\t\tif($form_state['values']['memberships'] == 'newmarket')\r\n\t\t\t{\r\n\t\t\t\t$params = new stdClass ();\r\n\t\t\t\t$params->webMemberId = $_SESSION['WebMemberId'];\r\n\t\t\t\t$params->marketId = $form_state['values']['city'];\r\n\t\t\t\t$params->packageId = $package[0];\r\n\t\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateAsuSignedInNewCreditCard', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\t\tswitch ($result->ValidateAsuSignedInNewCreditCardResult->ResponseCode) \r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'Success':\r\n\t\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateAsuSignedInNewCreditCardResult;\r\n\t\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'ExistingMembershipBrandHub':\r\n\t\t\t\t\t\tdrupal_set_message(t('You can use your existing @city (@ivr) membership to chat with local singles in @city2.',\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'@ivr'=>$_SESSION['IvrMembershipNumber'],\r\n\t\t\t\t\t\t\t\t'@city'=>$_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->MarketName,\r\n\t\t\t\t\t\t\t\t'@city2'=>$_SESSION['stateprovincecity']['city'][$form_state['values']['stateprovince']][$form_state['values']['city']],\r\n\t\t\t\t\t\t\t)),'error');\r\n\t\t\t\t\t\t$form_state['storage']['values']['memberships']\t= $result->ValidateAsuSignedInNewCreditCardResult->IvrMembershipNumber;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'FraudulentPaymethod':\r\n\t\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\t\tcase 'OlderExpirationDate':\r\n\t\t\t\t\tcase 'InactivePaymethod':\r\n\t\t\t\t\tcase 'DebtOrPaymentRestriction':\r\n\t\t\t\t\tcase 'NegativeCreditStatus':\r\n\t\t\t\t\tcase 'NoSalesPaymentRestriction':\r\n\t\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateAsuSignedInNewCreditCardResult->ErrMsg)),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// ValidateSrNewCreditCard\r\n\t\t\tif($form_state['values']['memberships'] <> 'newmarket')\r\n\t\t\t{\r\n\t\t\t\t$params = new stdClass ();\r\n\t\t\t\t$params->emsMembershipId = $_SESSION['emsMemberships'][$form_state['values']['memberships']]->EmsMembershipId;\r\n\t\t\t\t$params->packageId = $package[0];\r\n\t\t\t\t$params->creditCardNumber = $form_state['values']['cardnumber'];\r\n\t\t\t\t$params->expiryDateMmYy = str_pad($form_state['values']['cc_expiration']['month'].$form_state['values']['cc_expiration']['year'],4,\"0\",STR_PAD_LEFT);\r\n\t\t\t\t$params->cardholderName = $form_state['values']['cardholdername'];\r\n\t\t\t\t$params->zip = $form_state['values']['zippostal'];\r\n\t\t\t\t$result = teligence_purchase_soap_call($params, 'ValidateSrNewCreditCard', variable_get('teligence_purchase_wsdl_ordermanagement',''),TRUE);\r\n\t\t\t\tswitch ($result->ValidateSrNewCreditCardResult->ResponseCode) \r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'Success':\r\n\t\t\t\t\t\t$form_state['storage']['values']['ValidateResult'] = $result->ValidateSrNewCreditCardResult;\r\n\t\t\t\t\t\t$form_state['storage']['step'] = 'verifyorder';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'MemberHasDebt':\r\n\t\t\t\t\tcase 'CreditCardPaymentRestriction':\r\n\t\t\t\t\tcase 'CreditCardBelongsToOtherMember':\r\n\t\t\t\t\tcase 'DuplicateRequestGuid':\r\n\t\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ValidateSrNewCreditCardResult->ErrMsg)),'error');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// paypal\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'pp')\r\n\t\t{\r\n\t\t\t// send request to paypal.teligence.net\r\n\t\t\tmodule_load_include('inc', 'teligence_purchase', 'teligence_purchase-paypal');\r\n\t\t\t$urlquery = array(\r\n\t\t\t\t// 'areaCode' => '', // from previous implementation\r\n\t\t\t\t// 'Ani' => '', // from previous implementation\r\n\t\t\t\t// 'Pass' => $form_state['storage']['values']['password'],\r\n\t\t\t\t// 'Email' => $GLOBALS['user']->mail,\r\n\t\t\t\t'SequenceId' => teligence_cart_uuid(TRUE),\r\n\t\t\t\t'PackageId' => $package[0],\r\n\t\t\t\t'lang' => $GLOBALS['language']->language,\r\n\t\t\t\t'WebMemberId' => $_SESSION['WebMemberId'],\r\n\t\t\t\t'IvrBrandId' => variable_get('teligence_purchase_brandid', 1),\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\tif($form_state['values']['memberships'] == 'newmarket') \r\n\t\t\t// ValidateAsuPurchase\r\n\t\t\t{\r\n\t\t\t\t$vendorId = variable_get('teligence_cart_paypal_vendor_id_asu', '');\r\n\t\t\t\t$urlquery['VendorPass'] = md5(variable_get('teligence_cart_paypal_vendor_pass_asu', ''));\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t// ValidateSrPurchase\r\n\t\t\t{\r\n\t\t\t\t$vendorId = variable_get('teligence_cart_paypal_vendor_id_sr', '');\r\n\t\t\t\t$urlquery['VendorPass'] = md5(variable_get('teligence_cart_paypal_vendor_pass_sr', ''));\r\n\t\t\t\t$urlquery['EmsMembershipId'] = $_SESSION['emsMemberships'][$form_state['values']['memberships']]->EmsMembershipId;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!teligence_purchase_paypalSetSessionData($urlquery,$vendorId))\r\n\t\t\t{\r\n\t\t\t\t// could not connect to paypal.teligence.net\r\n\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// place order\r\n\tif($form_state['clicked_button']['#id'] == 'edit-placeorder')\r\n\t{\r\n\t\t// credit card\r\n\t\tif($form_state['storage']['values']['paymethods'] == 'cc' || $form_state['storage']['values']['paymethods'] == 'addcc')\r\n\t\t{\r\n\t\t\t$params = new stdClass ();\r\n\t\t\t$params->orderId = $form_state['storage']['values']['ValidateResult']->OrderId;\r\n\t\t\t$params->paymethodId = $form_state['storage']['values']['ValidateResult']->PaymethodId;\r\n\t\t\t$params->cvn = $form_state['storage']['values']['securitycode'];\r\n\t\t\t$result = teligence_purchase_soap_call($params, 'ProcessPayment', variable_get('teligence_purchase_wsdl_ordermanagement',''));\r\n\t\t\tswitch ($result->ProcessPaymentResult->ResponseCode) \r\n\t\t\t{\r\n\t\t\t\tcase 'Success':\r\n\t\t\t\t\t// refresh balance\r\n\t\t\t\t\tif($form_state['storage']['values']['memberships'] <> 'newmarket')\r\n\t\t\t\t\t\tunset($_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->Balance);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// drupal_set_message('<pre>'.check_plain(print_r($result->ProcessPaymentResult->WebActiveMemberships,1)).'</pre>');\r\n\t\t\t\t\t// refresh session values\r\n\t\t\t\t\tteligence_purchase_setsessionvalues($result->ProcessPaymentResult);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// redirect to success page\r\n\t\t\t\t\t$querystring = array(\r\n\t\t\t\t\t\t'Email' => $GLOBALS['user']->mail,\r\n\t\t\t\t\t\t'City' => $_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->MarketName,\r\n\t\t\t\t\t\t'IvrMembershipNumber' => $_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->IvrMembershipNumber,\r\n\t\t\t\t\t\t'IvrPasscode' => $_SESSION['emsMemberships'][$_SESSION['IvrMembershipNumber']]->IvrPasscode,\r\n\t\t\t\t\t\t'TotalAmountCents' => $form_state['storage']['values']['ValidateResult']->TotalAmountCents,\r\n\t\t\t\t\t\t'PackageMinutes' => $form_state['storage']['values']['ValidateResult']->PackageMinutes,\r\n\t\t\t\t\t\t'LocalAccessNumber' => $result->ProcessPaymentResult->LocalAccessNumber,\r\n\t\t\t\t\t);\r\n\t\t\t\t\tdrupal_goto('cart/result/creditcardsr',$querystring);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'AuthorizationDeclined':\r\n\t\t\t\tcase 'RiskScoreReject':\r\n\t\t\t\tcase 'RiskScoreReview':\r\n\t\t\t\tcase 'AuthorizationTechnicalIssue':\r\n\t\t\t\tcase 'RtmFailure':\r\n\t\t\t\t\tdrupal_set_message(t('!callcs', array('!callcs' => variable_get('teligence_purchase_customerservice',''))),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'InvalidRequestParams':\r\n\t\t\t\tcase 'TechnicalError':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tdrupal_set_message(t('!error',array('!error'=>$result->ProcessPaymentResult->ErrMsg)),'error');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\t// go back to modify a value\r\n\tif($form_state['clicked_button']['#id'] == 'edit-back')\r\n\t{\r\n\t\tunset($form_state['storage']['step']);\r\n\t\t$form_state['storage']['values']['packages'] = $form_state['values']['packages'];\r\n\t}\r\n}", "function embedForm($formId,$token){\n\t\t$login = url . '/VVlogin?token=' . $token;\n\t\t$returnUrl = '&returnUrl=~%2fFormDetails%3fformid%3d' . $formId;\n\t\t$request = $login . $returnUrl;\n\t\treturn $request;\t\t\t\n\t}", "function display_add_bm_form()\r\n{\r\n?>\r\n<form name=bm_table action=\"add_bms.php\" method=post>\r\n<table width=250 cellpadding=2 cellspacing=0 bgcolor=#cccccc>\r\n<tr><td>New BM:</td><td><input type=text name=new_url value=\"http://\"\r\n size=30 maxlength=255></td></tr>\r\n<tr><td colspan=2 align=center><input type=submit value=\"Add bookmark\"></td></tr>\r\n</table>\r\n</form>\r\n<?\r\n}", "function getLink()\n {\n $url = $this->getPaypal();\n $link = 'https://'.$url.'/cgi-bin/webscr?';\n foreach($this->VARS as $item => $sub){\n $link .= $sub[0].'='.$sub[1].'&';\n }\n return $link;\n }", "function generate_form( $order_id ) {\n\t\tglobal $woocommerce, $wc_authorize_sim;\n\t\t\n\t\t$order = new WC_Order( $order_id );\n\t\t\n\t\t$this->add_log( 'Generating payment form for order #' . $order->id);\n\t\t\n\t\t$pay_url = $this->get_gateway_url();\n\t\t\n\t\t$params = $this->get_params( $order );\n\t\t\n\t\t$time = time();\n $fp_hash = AuthorizeNetSIM_Form::getFingerprint( $this->login_id, $this->tran_key, $params['x_amount'], $params['x_fp_sequence'], $time );\n\t\t\n\t\t$params['x_fp_timestamp'] \t= $time;\n\t\t$params['x_fp_hash'] \t\t= $fp_hash;\n\t\t\n\t\t$this->add_log( \"Sending request: \" . print_r( $params,true ));\n\t\t\n\t\t$form = new AuthorizeNetSIM_Form($params);\n\t\t\n\t\twc_enqueue_js( \n\t\t\t'$.blockUI({\n\t\t\t\tmessage: \"' . esc_js( __( 'Thank you for your order. We are now redirecting you to 2checkout to make payment.', WC_Authorize_SIM::TEXT_DOMAIN ) ) . '\",\n\t\t\t\tbaseZ: 99999,\n\t\t\t\toverlayCSS:\n\t\t\t\t{\n\t\t\t\t\tbackground: \"#fff\",\n\t\t\t\t\topacity: 0.6\n\t\t\t\t},\n\t\t\t\tcss: {\n\t\t\t\t\tpadding: \"20px\",\n\t\t\t\t\tzindex: \"9999999\",\n\t\t\t\t\ttextAlign: \"center\",\n\t\t\t\t\tcolor: \"#555\",\n\t\t\t\t\tborder: \"3px solid #aaa\",\n\t\t\t\t\tbackgroundColor:\"#fff\",\n\t\t\t\t\tcursor: \"wait\",\n\t\t\t\t\tlineHeight:\t\t\"24px\",\n\t\t\t\t}\n\t\t\t});\n\t\t\tjQuery(\"#authorize_sim_payment_form input[type=submit]\").click();' \n\t\t);\n?>\n<form action=\"<?php echo $pay_url ?>\" method=\"post\" id=\"authorize_sim_payment_form\">\n\t<?php echo $form->getHiddenFieldString(); ?>\n\t<?php echo implode( '', $this->line_items ) ?>\n\t<input type=\"submit\" class=\"button button-alt\" id=\"submit_authorize_sim_payment_form\" value=\"<?php _e('Pay via Authorize.Net SIM', WC_Authorize_SIM::TEXT_DOMAIN) ?>\" /> \n\t<a class=\"button cancel\" href=\"<?php echo $order->get_cancel_order_url() ?>\"><?php _e('Cancel order &amp; restore cart', WC_Authorize_SIM::TEXT_DOMAIN) ?></a>\n</form>\n<?php\n\t}", "function re_get_form($var, $ignore=array())\r\n{\r\n $form = '';\r\n foreach($var as $k=>$v)\r\n {\r\n if(!in_array($k, $ignore)){\r\n //$form .= \"{$k}={$v}&\";\r\n $form .= http_build_query(array($k=>$v)).'&';\r\n }\r\n }\r\n\r\n $form = str_replace(\"'\", '&#39;', $form);\r\n $form = str_replace(\"#\", '', $form);\r\n $form = preg_replace(\"/[\\n\\r]/\", 'Xnl2nlX', $form);\r\n\r\n return $form;\r\n}" ]
[ "0.68001527", "0.661467", "0.6596413", "0.6139517", "0.6118776", "0.61084944", "0.60322404", "0.597377", "0.5923005", "0.5874106", "0.5864122", "0.58513916", "0.5819222", "0.5806651", "0.56816393", "0.56504023", "0.56244314", "0.56051666", "0.55267453", "0.5524667", "0.5507331", "0.5475114", "0.54372656", "0.54315305", "0.54265666", "0.5423008", "0.54184055", "0.5415314", "0.53813887", "0.53639907", "0.5344955", "0.5327341", "0.5325352", "0.5313524", "0.530796", "0.5299056", "0.52822053", "0.5276483", "0.5264387", "0.5254741", "0.52348685", "0.52313405", "0.5218781", "0.5216236", "0.5210712", "0.52071357", "0.5205155", "0.52003664", "0.51935166", "0.51919496", "0.5188068", "0.51837546", "0.5182819", "0.5181321", "0.5175369", "0.5174491", "0.51735634", "0.5173146", "0.5155217", "0.5141744", "0.51296026", "0.51231146", "0.51158804", "0.5100616", "0.50910383", "0.5090019", "0.5088736", "0.5086444", "0.5076593", "0.5068327", "0.5051104", "0.50493705", "0.5048145", "0.50319827", "0.50296485", "0.5026436", "0.5026419", "0.50243735", "0.501909", "0.50182647", "0.5018112", "0.5013849", "0.50112545", "0.5011238", "0.5008476", "0.5008033", "0.5002721", "0.5000734", "0.4988649", "0.4982441", "0.496519", "0.49635306", "0.49619365", "0.49608254", "0.49545896", "0.495124", "0.4945237", "0.49420628", "0.4935643", "0.493193" ]
0.59317255
8
Load locally Font Awesome externaly
function enqueue_our_required_stylesheets(){ wp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/css/font-awesome/css/font-awesome.css'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagely_load_font_awesome() {\n\t\n\twp_enqueue_style( 'font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', false, false, false ); \n}", "public function enqueue_font_awesome() {\n\t\tglobal $hestia_load_fa;\n\n\t\tif ( $hestia_load_fa !== true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twp_enqueue_style( 'font-awesome-5-all', get_template_directory_uri() . '/assets/font-awesome/css/all.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\tif ( $this->should_load_shim() ) {\n\t\t\twp_enqueue_style( 'font-awesome-4-shim', get_template_directory_uri() . '/assets/font-awesome/css/v4-shims.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\t}\n\n\t\treturn true;\n\t}", "function enqueue_font_awesome(){\n\twp_enqueue_style('font-awesome', get_stylesheet_directory_uri() . '/library/css/font-awesome.css');\n}", "function font_awesome()\n{\n wp_enqueue_style(\"font_awesome\", \"//use.fontawesome.com/releases/v5.6.3/css/all.css\");\n}", "function demo_plugin_font_awesome() {\n\t\twp_enqueue_style( 'load-fa', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'load-select2-css', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/css/select2.min.css' );\n\t\twp_enqueue_script( 'load-select2-js', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/js/select2.min.js' );\n\t\twp_enqueue_style( 'load-datatables-css', 'https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css' );\n\t\twp_enqueue_script( 'load-datatables-js', 'https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js' );\n\t\twp_enqueue_script( 'load-datepicker-js', 'https://code.jquery.com/ui/1.12.1/jquery-ui.js' );\n\t\twp_enqueue_style( 'load-datepicker-css', 'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' );\n\t}", "function prefix_enqueue_awesome() {\n\twp_enqueue_style( 'prefix-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' );\n}", "public function woo_font_load() {\n echo '<link href=\"https://fonts.googleapis.com/css?family=Raleway\" rel=\"stylesheet\">';\n }", "function _kalatheme_font_icon($name, $bundle = NULL, $attr = array(), $resolvePrefix = TRUE){\n if($bundle === NULL){\n $bundle = theme_get_setting('icon_font_library');\n }\n // Find the icon prefix\n if($resolvePrefix){\n switch($bundle){\n case('font_awesome'):\n $name = 'fa-' . $name;\n break;\n case('bootstrap_glyphicons'):\n $name = 'glyphicon-' . $name;\n break;\n }\n }\n\n $output = NULL;\n if (module_exists('icon')){\n $output = theme('icon', array(\n 'bundle' => $bundle,\n 'icon' => $name,\n 'attributes' => $attr\n ));\n }\n if($output === NULL){\n $attr = array();\n $attr += array('aria-hidden' => 'true' );\n $attr['class'] = array();\n\n if($bundle === 'font_awesome'){\n $attr['class'][] = 'fa';\n }\n elseif($bundle === 'bootstrap_glyphicons'){\n $attr['class'][] = 'glyphicon';\n }\n\n\n $attr['class'][] = $name;\n $output = '<span '. drupal_attributes($attr) . '></span>';\n }\n return $output;\n}", "function maybe_enqueue_font_awesome( $field )\n\t{\n\t\tif( 'font-awesome' == $field['type'] && $field['enqueue_fa'] ) {\n\t\t\tadd_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );\n\t\t}\n\n\t\treturn $field;\n\t}", "function enqueue_font_awesome_stylesheets(){\n wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');\n}", "function load_icons() {\n themify_get_icon( 'ti-import' );\n themify_get_icon( 'ti-export' );\n Themify_Enqueue_Assets::loadIcons();\n }", "function theme_add_bootstrap_fontawesome() {\n\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() . '/css/bootstrap.min.css' );\n\twp_enqueue_style( 'style-css', get_stylesheet_directory_uri() . '/style.css' );\n\twp_enqueue_style( 'fontawesome-css', get_stylesheet_directory_uri() . '/css/font-awesome.min.css' );\n\twp_enqueue_script( 'bootstrap-js', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', array(), '3.0.0', true );\n}", "function clsc_enqueue_frontend() {\n\n\twp_enqueue_style( 'clsc_FontAwesome', plugins_url( '/fonts/FontAwesome/css/font-awesome.min.css', __FILE__) );\n\n}", "function register_scripts_admin() {\n\twp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');\n}", "function vcex_enqueue_icon_font( $family = '', $icon = '' ) {\n\tif ( ! $icon ) {\n\t\treturn;\n\t}\n\n\t// If font family isn't defined lets get it from the icon class.\n\tif ( ! $family ) {\n\t\t$family = vcex_get_icon_type_from_class( $icon );\n\t}\n\n\t// Return if we are using ticons.\n\tif ( 'ticons' === $family || ! $family ) {\n\t\twp_enqueue_style( 'ticons' );\n\t\treturn;\n\t}\n\n\t// Check for custom enqueue.\n\t$fonts = vcex_get_icon_font_families();\n\n\t// Custom stylesheet check.\n\tif ( ! empty( $fonts[$family]['style'] ) ) {\n\t\twp_enqueue_style( $fonts[$family]['style'] );\n\t\treturn;\n\t}\n\n\t// Default vc font icons.\n\tif ( function_exists( 'vc_icon_element_fonts_enqueue' ) ) {\n\t\tvc_icon_element_fonts_enqueue( $family );\n\t}\n}", "function wmpudev_enqueue_icon_stylesheet() {\n\twp_register_style( 'fontawesome', 'http:////maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );\n\twp_enqueue_style( 'fontawesome');\n}", "static function load_font()\n\t{\n\t\t$font_configs \t= self::load_iconfont_list();\n\n\t\t$output\t\t\t= \"\";\n\t\t\n\t\tif(!empty($font_configs))\n\t\t{\n\t\t\t$output .=\"<style type='text/css'>\";\n\t\t\tforeach($font_configs as $font_name => $font_list)\n\t\t\t{\n\t\t\t\t$append = empty($font_list['append']) ? \"\" : $font_list['append'];\n\t\t\t\t$qmark\t= empty($append) ? \"?\" : $append;\n\t\t\t\n\t\t\t\t$fstring \t\t= $font_list['folder'].'/'.$font_name;\n\t\t\t\t\n\t\t\t\t$output .=\"\n@font-face {font-family: '{$font_name}'; font-weight: normal; font-style: normal;\nsrc: url('{$fstring}.eot{$append}');\nsrc: url('{$fstring}.eot{$qmark}#iefix') format('embedded-opentype'), \nurl('{$fstring}.woff{$append}') format('woff'), \nurl('{$fstring}.ttf{$append}') format('truetype'), \nurl('{$fstring}.svg{$append}#{$font_name}') format('svg');\n} #top .avia-font-{$font_name}, body .avia-font-{$font_name}, html body [data-av_iconfont='{$font_name}']:before{ font-family: '{$font_name}'; }\n\";\n\t\t\t}\n\t\t\t\n\t\t$output .=\"</style>\";\n\t\t\n\t\t}\n\t\treturn $output;\n\t}", "function hejtiger_custom_fonts() {\n\n \n \n wp_enqueue_style( 'googleFonts' , 'http://fonts.googleapis.com/css?family=Muli:300,400|Nunito');\n\n wp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.6.3/css/all.css' );\n }", "function ridizain_admin_fonts() {\r\n\twp_enqueue_style( 'ridizain-lato', ridizain_font_url(), array(), null );\r\n}", "public function admin_enqueue_fontawesomeBlock(){\n\t\t}", "function add_custom_fonts(){\n\techo \"<script>\n\t\t\t\t\t (function(d) {\n\t\t\t\t\t var config = {\n\t\t\t\t\t kitId: 'xfz2xyu',\n\t\t\t\t\t scriptTimeout: 3000,\n\t\t\t\t\t async: true\n\t\t\t\t\t },\n\t\t\t\t\t h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\\bwf-loading\\b/g,\\\"\\\")+\\\" wf-inactive\\\";},config.scriptTimeout),tk=d.createElement(\\\"script\\\"),f=false,s=d.getElementsByTagName(\\\"script\\\")[0],a;h.className+=\\\" wf-loading\\\";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!=\\\"complete\\\"&&a!=\\\"loaded\\\")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)\n\t\t\t\t\t })(document);\n\t\t\t\t\t</script>\";\n\t//\techo '<link rel=\"stylesheet\" href=\"\">';\n}", "function font_awesome($icon){\n\treturn \"<span class='fa fa-fw $icon'></span>\";\n}", "public function admin_scripts() {\n\t\twp_enqueue_style( 'wpex-font-awesome', WPEX_CSS_DIR_URI .'font-awesome.min.css' );\n\t}", "public function getFontFile() {}", "public function getFontFile() {}", "function bethel_admin_enqueue_fonts() {\n\twp_enqueue_style ('bethel-font-icons', get_stylesheet_directory_uri().\"/fonts/bethel-icons.css\", array(), CHILD_THEME_VERSION);\n}", "function ridizain_font_url() {\r\n\t$font_url = '';\r\n\t/*\r\n\t * Translators: If there are characters in your language that are not supported\r\n\t * by Lato, translate this to 'off'. Do not translate into your own language.\r\n\t */\r\n\tif ( 'off' !== _x( 'on', 'Lato font: on or off', 'ridizain' ) ) {\r\n\t\t$font_url = esc_url(add_query_arg( 'family', urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), \"//fonts.googleapis.com/css\" ));\r\n\t}\r\n\r\n\treturn $font_url;\r\n}", "function bethel_enqueue_fonts() {\n\twp_enqueue_style ('bethel-font-lato', get_stylesheet_directory_uri().'/fonts/lato.css', array(), CHILD_THEME_VERSION);\n\twp_enqueue_style ('bethel-font-icons', get_stylesheet_directory_uri().\"/fonts/bethel-icons.css\", array(), CHILD_THEME_VERSION);\n}", "function frontend_enqueue_scripts()\n\t{\n\t\twp_register_style('font-awesome', $this->stylesheet, array(), $this->version);\n\n\t\twp_enqueue_style( array( 'font-awesome' ) );\n\t}", "function uwwtd_preprocess_html(&$vars) {\n drupal_add_css('//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css', array(\n 'type' => 'external',\n ));\n}", "function textdomain_scripts_styles() {\n\t\t// We're using the awesome Font Awesome icon font. http://fortawesome.github.io/Font-Awesome\n\t\twp_register_style( 'fontawesome', trailingslashit( get_template_directory_uri() ) . '/inc/assets/css/fontawesome-all.min.css' , array(), '5.8.2', 'all' );\n\t\twp_enqueue_style( 'fontawesome' );\n\t}", "public function get_icon()\n\t{\n\t\treturn 'fab fa-algolia';\n\t}", "function fa_icon( $icon = 'user' ) {\n\t\treturn \"<i class=\\\"fa fa-{$icon}\\\"></i>\";\n\t}", "function enqueue_bootsrap_fonts() {\n if (!is_admin()) {\n //font awesome\n wp_enqueue_style('font_awesome', get_template_directory_uri() . '/css/font-awesome.min.css', null, '');\n //ionicons\n wp_enqueue_style('ionicons', get_template_directory_uri() . '/css/ionicons.css', null, '');\n }\n}", "public function getFontFile3() {}", "public static function newFontAwesomeIcon(): FontAwesomeIconInterface {\n return new FontAwesomeIcon();\n }", "private static function getFaiconsList() {\n\t\n\t\t$content = file_get_contents('https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.json');\n\t\t$json = json_decode($content);\n\t\t$icons = [];\n\t\n\t\tforeach ($json as $icon => $value) {\n\t\t\tforeach ($value->styles as $style) {\n\t\t\t\t$icons[] = 'fa'.substr($style, 0 ,1).' fa-'.$icon;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $icons;\n\t}", "function cmsms_theme_google_font($font, $i) {\n\t$protocol = is_ssl() ? 'https' : 'http';\n\t\n\t\n\twp_enqueue_style('cmsms-google-font-' . $i, $protocol . '://fonts.googleapis.com/css?family=' . $font);\n}", "function PREFIX_add_fonts() {\n\twp_enqueue_style( \"fonts\", FONTS_URL, 100 );\n}", "function __construct()\n\t{\n\t\t$this->name = 'font-awesome';\n\t\t$this->label = __('Font Awesome Icon');\n\t\t$this->category = __(\"Content\",'acf'); // Basic, Content, Choice, etc\n\t\t$this->defaults = array(\n\t\t\t'enqueue_fa' \t=>\t0,\n\t\t\t'allow_null' \t=>\t0,\n\t\t\t'save_format'\t=> 'element',\n\t\t\t'default_value'\t=>\t'',\n\t\t\t'choices'\t\t=>\t$this->get_icons()\n\t\t);\n\n\t\t$this->settings = array(\n\t\t\t'path' => apply_filters('acf/helpers/get_path', __FILE__),\n\t\t\t'dir' => apply_filters('acf/helpers/get_dir', __FILE__),\n\t\t\t'version' => '1.5'\n\t\t);\n\n\t\tadd_filter('acf/load_field', array( $this, 'maybe_enqueue_font_awesome' ) );\n\n \tparent::__construct();\n\t}", "function av_icon($icon, $font = false, $string = 'string')\n{\t\n\treturn avia_font_manager::frontend_icon($icon, $font, $string);\n}", "public function init()\n {\n parent::init();\n \\app\\assets\\FontAwesomeAsset::register($this->getView());\n }", "function add_defer_attribute( $tag, $handle ) {\n\n if ( 'font-awesome' === $handle ) {\n $tag = str_replace( ' src', ' defer src', $tag );\n }\n\n return $tag;\n\n}", "public function registerFontBox(){\n\t\t$param = WPBMap::getParam( 'vc_icon', 'type' );\n\t\t\n\t\t$param['value'][$this->getIconHeader()] = $this->getIconLib();\n\t\tvc_update_shortcode_param( 'vc_icon', $param );\n\t}", "function twentyfourteen_font_url() {\n\t$font_url = '';\n\t/*\n\t * Translators: If there are characters in your language that are not supported\n\t * by Lato, translate this to 'off'. Do not translate into your own language.\n\t */\n\tif ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) {\n\t\t$font_url = add_query_arg( 'family', urlencode( 'Lato:300,400,700,900,300italic,400italic,700italic' ), \"//fonts.googleapis.com/css\" );\n\t}\n\n\treturn $font_url;\n}", "public function get_font_icon() {\n\t\t$icons = array(\n\t\t\t'twitter' => 'twitter',\n\t\t\t'instagram' => 'instagram'\n\t\t\t);\n\t\tif ( isset( $icons[ $this->get_embed_type() ] ) ) {\n\t\t\treturn $icons[ $this->get_embed_type() ];\n\t\t} else {\n\t\t\treturn 'flickr';\n\t\t}\n\t}", "public static function fontawesome_bwc($icon){\n $old_to_new = array(\n 'address-book-o' => 'address-book', 'address-card-o' => 'address-card', 'area-chart' => 'chart-area', 'arrow-circle-o-down' => 'arrow-alt-circle-down', 'arrow-circle-o-left' => 'arrow-alt-circle-left', 'arrow-circle-o-right' => 'arrow-alt-circle-right', 'arrow-circle-o-up' => 'arrow-alt-circle-up', 'arrows' => 'arrows-alt', 'arrows-alt' => 'expand-arrows-alt', 'arrows-h' => 'arrows-alt-h', 'arrows-v' => 'arrows-alt-v', 'asl-interpreting' => 'american-sign-language-interpreting', 'automobile' => 'car', 'bank' => 'university', 'bar-chart' => 'chart-bar', 'bar-chart-o' => 'chart-bar', 'bathtub' => 'bath', 'battery' => 'battery-full', 'battery-0' => 'battery-empty', 'battery-1' => 'battery-quarter', 'battery-2' => 'battery-half', 'battery-3' => 'battery-three-quarters', 'battery-4' => 'battery-full', 'bell-o' => 'bell', 'bell-slash-o' => 'bell-slash', 'bitbucket-square' => 'bitbucket', 'bitcoin' => 'btc', 'bookmark-o' => 'bookmark', 'building-o' => 'building', 'cab' => 'taxi', 'calendar' => 'calendar-alt', 'calendar-check-o' => 'calendar-check', 'calendar-minus-o' => 'calendar-minus', 'calendar-o' => 'calendar', 'calendar-plus-o' => 'calendar-plus', 'calendar-times-o' => 'calendar-times', 'caret-square-o-down' => 'caret-square-down', 'caret-square-o-left' => 'caret-square-left', 'caret-square-o-right' => 'caret-square-right', 'caret-square-o-up' => 'caret-square-up', 'cc' => 'closed-captioning', 'chain' => 'link', 'chain-broken' => 'unlink', 'check-circle-o' => 'check-circle', 'check-square-o' => 'check-square', 'circle-o' => 'circle', 'circle-o-notch' => 'circle-notch', 'circle-thin' => 'circle', 'clock-o' => 'clock', 'close' => 'times', 'cloud-download' => 'cloud-download-alt', 'cloud-upload' => 'cloud-upload-alt', 'cny' => 'yen-sign', 'code-fork' => 'code-branch', 'comment-o' => 'comment', 'commenting' => 'comment-dots', 'commenting-o' => 'comment-dots', 'comments-o' => 'comments', 'credit-card-alt' => 'credit-card', 'cutlery' => 'utensils', 'dashboard' => 'tachometer-alt', 'deafness' => 'deaf', 'dedent' => 'outdent', 'diamond' => 'gem', 'dollar' => 'dollar-sign', 'dot-circle-o' => 'dot-circle', 'drivers-license' => 'id-card', 'drivers-license-o' => 'id-card', 'eercast' => 'sellcast', 'envelope-o' => 'envelope', 'envelope-open-o' => 'envelope-open', 'eur' => 'euro-sign', 'euro' => 'euro-sign', 'exchange' => 'exchange-alt', 'external-link' => 'external-link-alt', 'external-link-square' => 'external-link-square-alt', 'eyedropper' => 'eye-dropper', 'fa' => 'font-awesome', 'facebook' => 'facebook-f', 'facebook-official' => 'facebook', 'feed' => 'rss', 'file-archive-o' => 'file-archive', 'file-audio-o' => 'file-audio', 'file-code-o' => 'file-code', 'file-excel-o' => 'file-excel', 'file-image-o' => 'file-image', 'file-movie-o' => 'file-video', 'file-o' => 'file', 'file-pdf-o' => 'file-pdf', 'file-photo-o' => 'file-image', 'file-picture-o' => 'file-image', 'file-powerpoint-o' => 'file-powerpoint', 'file-sound-o' => 'file-audio', 'file-text' => 'file-alt', 'file-text-o' => 'file-alt', 'file-video-o' => 'file-video', 'file-word-o' => 'file-word', 'file-zip-o' => 'file-archive', 'files-o' => 'copy', 'flag-o' => 'flag', 'flash' => 'bolt', 'floppy-o' => 'save', 'folder-o' => 'folder', 'folder-open-o' => 'folder-open', 'frown-o' => 'frown', 'futbol-o' => 'futbol', 'gbp' => 'pound-sign', 'ge' => 'empire', 'gear' => 'cog', 'gears' => 'cogs', 'gittip' => 'gratipay', 'glass' => 'glass-martini', 'google-plus' => 'google-plus-g', 'google-plus-circle' => 'google-plus', 'google-plus-official' => 'google-plus', 'group' => 'users', 'hand-grab-o' => 'hand-rock', 'hand-lizard-o' => 'hand-lizard', 'hand-o-down' => 'hand-point-down', 'hand-o-left' => 'hand-point-left', 'hand-o-right' => 'hand-point-right', 'hand-o-up' => 'hand-point-up', 'hand-paper-o' => 'hand-paper', 'hand-peace-o' => 'hand-peace', 'hand-pointer-o' => 'hand-pointer', 'hand-rock-o' => 'hand-rock', 'hand-scissors-o' => 'hand-scissors', 'hand-spock-o' => 'hand-spock', 'hand-stop-o' => 'hand-paper', 'handshake-o' => 'handshake', 'hard-of-hearing' => 'deaf', 'hdd-o' => 'hdd', 'header' => 'heading', 'heart-o' => 'heart', 'hospital-o' => 'hospital', 'hotel' => 'bed', 'hourglass-1' => 'hourglass-start', 'hourglass-2' => 'hourglass-half', 'hourglass-3' => 'hourglass-end', 'hourglass-o' => 'hourglass', 'id-card-o' => 'id-card', 'ils' => 'shekel-sign', 'inr' => 'rupee-sign', 'institution' => 'university', 'intersex' => 'transgender', 'jpy' => 'yen-sign', 'keyboard-o' => 'keyboard', 'krw' => 'won-sign', 'legal' => 'gavel', 'lemon-o' => 'lemon', 'level-down' => 'level-down-alt', 'level-up' => 'level-up-alt', 'life-bouy' => 'life-ring', 'life-buoy' => 'life-ring', 'life-saver' => 'life-ring', 'lightbulb-o' => 'lightbulb', 'line-chart' => 'chart-line', 'linkedin' => 'linkedin-in', 'linkedin-square' => 'linkedin', 'long-arrow-down' => 'long-arrow-alt-down', 'long-arrow-left' => 'long-arrow-alt-left', 'long-arrow-right' => 'long-arrow-alt-right', 'long-arrow-up' => 'long-arrow-alt-up', 'mail-forward' => 'share', 'mail-reply' => 'reply', 'mail-reply-all' => 'reply-all', 'map-marker' => 'map-marker-alt', 'map-o' => 'map', 'meanpath' => 'font-awesome', 'meh-o' => 'meh', 'minus-square-o' => 'minus-square', 'mobile' => 'mobile-alt', 'mobile-phone' => 'mobile-alt', 'money' => 'money-bill-alt', 'moon-o' => 'moon', 'mortar-board' => 'graduation-cap', 'navicon' => 'bars', 'newspaper-o' => 'newspaper', 'paper-plane-o' => 'paper-plane', 'paste' => 'clipboard', 'pause-circle-o' => 'pause-circle', 'pencil' => 'pencil-alt', 'pencil-square' => 'pen-square', 'pencil-square-o' => 'edit', 'photo' => 'image', 'picture-o' => 'image', 'pie-chart' => 'chart-pie', 'play-circle-o' => 'play-circle', 'plus-square-o' => 'plus-square', 'question-circle-o' => 'question-circle', 'ra' => 'rebel', 'refresh' => 'sync', 'remove' => 'times', 'reorder' => 'bars', 'repeat' => 'redo', 'resistance' => 'rebel', 'rmb' => 'yen-sign', 'rotate-left' => 'undo', 'rotate-right' => 'redo', 'rouble' => 'ruble-sign', 'rub' => 'ruble-sign', 'ruble' => 'ruble-sign', 'rupee' => 'rupee-sign', 's15' => 'bath', 'scissors' => 'cut', 'send' => 'paper-plane', 'send-o' => 'paper-plane', 'share-square-o' => 'share-square', 'shekel' => 'shekel-sign', 'sheqel' => 'shekel-sign', 'shield' => 'shield-alt', 'sign-in' => 'sign-in-alt', 'sign-out' => 'sign-out-alt', 'signing' => 'sign-language', 'sliders' => 'sliders-h', 'smile-o' => 'smile', 'snowflake-o' => 'snowflake', 'soccer-ball-o' => 'futbol', 'sort-alpha-asc' => 'sort-alpha-down', 'sort-alpha-desc' => 'sort-alpha-up', 'sort-amount-asc' => 'sort-amount-down', 'sort-amount-desc' => 'sort-amount-up', 'sort-asc' => 'sort-up', 'sort-desc' => 'sort-down', 'sort-numeric-asc' => 'sort-numeric-down', 'sort-numeric-desc' => 'sort-numeric-up', 'spoon' => 'utensil-spoon', 'square-o' => 'square', 'star-half-empty' => 'star-half', 'star-half-full' => 'star-half', 'star-half-o' => 'star-half', 'star-o' => 'star', 'sticky-note-o' => 'sticky-note', 'stop-circle-o' => 'stop-circle', 'sun-o' => 'sun', 'support' => 'life-ring', 'tablet' => 'tablet-alt', 'tachometer' => 'tachometer-alt', 'television' => 'tv', 'thermometer' => 'thermometer-full', 'thermometer-0' => 'thermometer-empty', 'thermometer-1' => 'thermometer-quarter', 'thermometer-2' => 'thermometer-half', 'thermometer-3' => 'thermometer-three-quarters', 'thermometer-4' => 'thermometer-full', 'thumb-tack' => 'thumbtack', 'thumbs-o-down' => 'thumbs-down', 'thumbs-o-up' => 'thumbs-up', 'ticket' => 'ticket-alt', 'times-circle-o' => 'times-circle', 'times-rectangle' => 'window-close', 'times-rectangle-o' => 'window-close', 'toggle-down' => 'caret-square-down', 'toggle-left' => 'caret-square-left', 'toggle-right' => 'caret-square-right', 'toggle-up' => 'caret-square-up', 'trash' => 'trash-alt', 'trash-o' => 'trash-alt', 'try' => 'lira-sign', 'turkish-lira' => 'lira-sign', 'unsorted' => 'sort', 'usd' => 'dollar-sign', 'user-circle-o' => 'user-circle', 'user-o' => 'user', 'vcard' => 'address-card', 'vcard-o' => 'address-card', 'video-camera' => 'video', 'vimeo' => 'vimeo-v', 'volume-control-phone' => 'phone-volume', 'warning' => 'exclamation-triangle', 'wechat' => 'weixin', 'wheelchair-alt' => 'accessible-icon', 'window-close-o' => 'window-close', 'won' => 'won-sign', 'y-combinator-square' => 'hacker-news', 'yc' => 'y-combinator', 'yc-square' => 'hacker-news', 'yen' => 'yen-sign', 'youtube-play' => 'youtube',\n );\n // Return new if found\n if(isset($old_to_new[$icon])){\n return $old_to_new[$icon];\n } \n // Otherwise just return original\n return $icon;\n }", "function fonts($file)\n {\n return assets('fonts', $file);\n }", "public function preload_fonts() {\r\n\t\tif ( ! $this->is_allowed() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$fonts = $this->options->get( 'preload_fonts', [] );\r\n\t\t/**\r\n\t\t * Filters the list of fonts to preload\r\n\t\t *\r\n\t\t * @since 3.6\r\n\t\t *\r\n\t\t * @param array $fonts Array of fonts paths.\r\n\t\t */\r\n\t\t$fonts = (array) apply_filters( 'rocket_preload_fonts', $fonts );\r\n\t\t$fonts = array_map( [ $this, 'sanitize_font' ], $fonts );\r\n\t\t$fonts = array_filter( $fonts );\r\n\r\n\t\tif ( empty( $fonts ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$base_url = get_rocket_parse_url( home_url() );\r\n\t\t$base_url = \"{$base_url['scheme']}://{$base_url['host']}\";\r\n\r\n\t\tforeach ( array_unique( $fonts ) as $font ) {\r\n\t\t\tprintf(\r\n\t\t\t\t\"\\n<link rel=\\\"preload\\\" as=\\\"font\\\" href=\\\"%s\\\" crossorigin>\",\r\n\t\t\t\tesc_url( $this->cdn->rewrite_url( $base_url . $font ) )\r\n\t\t\t);\r\n\t\t}\r\n\t}", "function av_icon_class($font)\n{\n\tglobal $avia_config;\n\treturn 'avia-font-'.$avia_config['font_icons'][$font]['font'];\n}", "function enqueue_our_required_stylesheets(){\n\twp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css');\n\twp_enqueue_style('custom', get_stylesheet_directory_uri() . '/custom.css');\n}", "function TS_VCSC_IconFontsEnqueue($forceload = false) {\r\n\t\t\tforeach ($this->TS_VCSC_Installed_Icon_Fonts as $Icon_Font => $iconfont) {\r\n\t\t\t\t$default = ($iconfont == \"Awesome\" ? 1 : 0); \r\n\t\t\t\tif (!$forceload) {\r\n\t\t\t\t\tif ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && ($iconfont != \"Custom\") && ($iconfont != \"Dashicons\")) {\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont));\r\n\t\t\t\t\t} else if ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && ($iconfont != \"Custom\") && ($iconfont == \"Dashicons\")) {\r\n\t\t\t\t\t\twp_enqueue_style('dashicons');\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont));\r\n\t\t\t\t\t} else if ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && ($iconfont == \"Custom\")) {\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc');\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && (get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) && ($iconfont != \"Custom\") && ($iconfont != \"Dashicons\")) {\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont));\r\n\t\t\t\t\t} else if ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && (get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) && ($iconfont != \"Custom\") && ($iconfont == \"Dashicons\")) {\r\n\t\t\t\t\t\twp_enqueue_style('dashicons');\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont));\r\n\t\t\t\t\t} else if ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont, $default) == 1) && (get_option('ts_vcsc_extend_settings_load' . $iconfont, 0) == 1) && ($iconfont == \"Custom\")) {\r\n\t\t\t\t\t\t$Custom_Font_CSS = get_option('ts_vcsc_extend_settings_tinymceCustomPath', '');\r\n\t\t\t\t\t\twp_enqueue_style('ts-font-' . strtolower($iconfont) . 'vcsc');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Enqueue Internal WP Bakery Page Builder Fonts\r\n\t\t\tif ($this->TS_VCSC_EditorIconFontsInternal == \"true\") {\r\n\t\t\t\tforeach ($this->TS_VCSC_Composer_Font_Settings as $Icon_Font => $iconfont) {\r\n\t\t\t\t\tif (!$forceload) {\r\n\t\t\t\t\t\tif (get_option('ts_vcsc_extend_settings_tinymce' . $iconfont['setting'], 0) == 1) {\r\n\t\t\t\t\t\t\twp_enqueue_style(strtolower($iconfont['handle']));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif ((get_option('ts_vcsc_extend_settings_tinymce' . $iconfont['setting'], 0) == 1) && (get_option('ts_vcsc_extend_settings_load' . $iconfont['setting'], 0) == 1)) {\r\n\t\t\t\t\t\t\twp_enqueue_style(strtolower($iconfont['handle']));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function studeon_vc_iconpicker_type_fontawesome($icons) {\n\t\t$list = studeon_get_list_icons();\n\t\tif (!is_array($list) || count($list) == 0) return $icons;\n\t\t$rez = array();\n\t\tforeach ($list as $icon)\n\t\t\t$rez[] = array($icon => str_replace('icon-', '', $icon));\n\t\treturn array_merge( $icons, array(esc_html__('Theme Icons', 'studeon') => $rez) );\n\t}", "public function getFontFile2() {}", "function check_fa4_styles() {\n\n\t\tglobal $wp_styles;\n\t\tforeach ( $wp_styles->queue as $style ) {\n\t\t\tif ( strstr( $wp_styles->registered[ $style ]->src, 'font-awesome.min.css' ) ) {\n\t\t\t\tupdate_option( 'hestia_load_shim', 'yes' );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function classiera_fonts_url() {\r\n\t$fonts_url = '';\r\n\r\n\t/* Translators: If there are characters in your language that are not\r\n\t * supported by Source Sans Pro, translate this to 'off'. Do not translate\r\n\t * into your own language.\r\n\t */\r\n\t$source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'classiera' );\r\n\r\n\t/* Translators: If there are characters in your language that are not\r\n\t * supported by Bitter, translate this to 'off'. Do not translate into your\r\n\t * own language.\r\n\t */\r\n\t$bitter = _x( 'on', 'Bitter font: on or off', 'classiera' );\r\n\r\n\tif ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {\r\n\t\t$font_families = array();\r\n\r\n\t\tif ( 'off' !== $source_sans_pro )\r\n\t\t\t$font_families[] = 'Montserrat:400,700,400italic,700italic';\r\n\r\n\t\tif ( 'off' !== $bitter )\r\n\t\t\t$font_families[] = 'Lato:400,700';\r\n\r\n\t\t$query_args = array(\r\n\t\t\t'family' => urlencode( implode( '%7C', $font_families ) ),\r\n\t\t\t'subset' => urlencode( 'latin,latin-ext' ),\r\n\t\t);\r\n\t\t$fonts_url = esc_url( add_query_arg( $query_args, \"//fonts.googleapis.com/css\" ) ) ;\r\n\t}\r\n\r\n\treturn $fonts_url;\r\n}", "function chocorocco_load_fonts() {\n\t\t$fonts = array();\n\t\tfor ($i=1; $i<=chocorocco_get_theme_setting('max_load_fonts'); $i++) {\n\t\t\tif (($name = chocorocco_get_theme_option(\"load_fonts-{$i}-name\")) != '') {\n\t\t\t\t$fonts[] = array(\n\t\t\t\t\t'name'\t => $name,\n\t\t\t\t\t'family' => chocorocco_get_theme_option(\"load_fonts-{$i}-family\"),\n\t\t\t\t\t'styles' => chocorocco_get_theme_option(\"load_fonts-{$i}-styles\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tchocorocco_storage_set('load_fonts', $fonts);\n\t\tchocorocco_storage_set('load_fonts_subset', chocorocco_get_theme_option(\"load_fonts_subset\"));\n\t\t\n\t\t// Font parameters of the main theme's elements\n\t\t$fonts = chocorocco_get_theme_fonts();\n\t\tforeach ($fonts as $tag=>$v) {\n\t\t\tforeach ($v as $css_prop=>$css_value) {\n\t\t\t\tif (in_array($css_prop, array('title', 'description'))) continue;\n\t\t\t\t$fonts[$tag][$css_prop] = chocorocco_get_theme_option(\"{$tag}_{$css_prop}\");\n\t\t\t}\n\t\t}\n\t\tchocorocco_storage_set('theme_fonts', $fonts);\n\t}", "function skudo_fonts_url() {\n\t\tglobal $skudo_import_fonts;\n\t\t\n\t\t$skudo_import_fonts = skudo_get_import_fonts();\n\t\tif (!is_array($skudo_import_fonts) && is_string($skudo_import_fonts)) $skudo_import_fonts = explode(\"|\",$skudo_import_fonts);\n\t\t\n\t\t$aux = array();\n\t\tforeach ($skudo_import_fonts as $font){\n\t\t\t$aux[] = str_replace(\"|\", \":\", str_replace(\" \", \"+\", $font));\n\t\t}\n\t\t\n\t\t$aux = array_unique($aux);\n\t\t\n\t\t$http = (is_ssl( )) ? \"https:\" : \"http:\";\n\t\t\n\t\t$keys = array(\"Arial\",\"Arial+Black\",\"Helvetica+Neue\",\"Helvetica\",\"Courier+New\",\"Georgia\",\"Impact\",\"Lucida+Sans\",\"Times+New+Roman\",\"Trebuchet+MS\",\"Verdana\");\n\t\t\n\t\tforeach ($keys as $key){\n\t\t\tif (($key_search = array_search($key, $aux)) !== false) {\n\t\t\t unset($aux[$key_search]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$skudo_import_fonts = implode(\"|\", $aux);\n\t $font_url = '';\n\t /*\n\t Translators: If there are characters in your language that are not supported\n\t by chosen font(s), translate this to 'off'. Do not translate into your own language.\n\t */\n\t if ( 'off' !== _x( 'on', 'Google font: on or off', 'skudo' ) ) {\n\t $font_url = add_query_arg( 'family', $skudo_import_fonts, $http.\"//fonts.googleapis.com/css\", array(), null, 'all' );\n\t }\n\t return $font_url;\n\t}", "function fa_load_style( $stylesheet ){\n\n\tif( defined( 'FA_CSS_DEBUG' ) && FA_CSS_DEBUG ){\n\t\t$stylesheet .= '.dev';\n\t}else{\n\t\t$stylesheet .= '.min';\n\t}\t\n\t\n\t$url = fa_get_uri( 'assets/front/css/' . $stylesheet . '.css' );\n\twp_enqueue_style(\n\t\t'fa-style-' . $stylesheet,\n\t\t$url,\n\t\tarray(),\n\t\tfalse\n\t);\n\treturn 'fa-style-' . $stylesheet;\n}", "function twentyfourteen_font_url() {\n\t$font_url = '';\n\t/*\n\t * Translators: If there are characters in your language that are not supported\n\t * by Lato, translate this to 'off'. Do not translate into your own language.\n\t */\n\tif ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentyfourteen' ) ) {\n\t\t$query_args = array(\n\t\t\t'family' => urlencode( 'Open+Sans:400,300,600,700,800' ),\n\t\t\t'subset' => urlencode( 'latin,latin-ext' ),\n\t\t);\n\t\t$font_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css?' );\n\t}\n\n\treturn $font_url;\n}", "function nectar_lovelo_font() {\n\t\t$nectar_custom_font = \"@font-face { font-family: 'Lovelo'; src: url('\".get_template_directory_uri().\"/css/fonts/Lovelo_Black.eot'); src: url('\".get_template_directory_uri().\"/css/fonts/Lovelo_Black.eot?#iefix') format('embedded-opentype'), url('\".get_template_directory_uri().\"/css/fonts/Lovelo_Black.woff') format('woff'), url('\".get_template_directory_uri().\"/css/fonts/Lovelo_Black.ttf') format('truetype'), url('\".get_template_directory_uri().\"/css/fonts/Lovelo_Black.svg#loveloblack') format('svg'); font-weight: normal; font-style: normal; }\";\n\t\t\n\t\twp_add_inline_style( 'main-styles', $nectar_custom_font );\n\t}", "public function icons() {\n\n\t\t$solid_icons = array(\n\t\t\t\"fas-f641\" => \"fas fa-ad\",\n\t\t\t\"fas-f2b9\" => \"fas fa-address-book\",\n\t\t\t\"fas-f2bb\" => \"fas fa-address-card\",\n\t\t\t\"fas-f042\" => \"fas fa-adjust\",\n\t\t\t\"fas-f5d0\" => \"fas fa-air-freshener\",\n\t\t\t\"fas-f037\" => \"fas fa-align-center\",\n\t\t\t\"fas-f039\" => \"fas fa-align-justify\",\n\t\t\t\"fas-f036\" => \"fas fa-align-left\",\n\t\t\t\"fas-f038\" => \"fas fa-align-right\",\n\t\t\t\"fas-f461\" => \"fas fa-allergies\",\n\t\t\t\"fas-f0f9\" => \"fas fa-ambulance\",\n\t\t\t\"fas-f2a3\" => \"fas fa-american-sign-language-interpreting\",\n\t\t\t\"fas-f13d\" => \"fas fa-anchor\",\n\t\t\t\"fas-f103\" => \"fas fa-angle-double-down\",\n\t\t\t\"fas-f100\" => \"fas fa-angle-double-left\",\n\t\t\t\"fas-f101\" => \"fas fa-angle-double-right\",\n\t\t\t\"fas-f102\" => \"fas fa-angle-double-up\",\n\t\t\t\"fas-f107\" => \"fas fa-angle-down\",\n\t\t\t\"fas-f104\" => \"fas fa-angle-left\",\n\t\t\t\"fas-f105\" => \"fas fa-angle-right\",\n\t\t\t\"fas-f106\" => \"fas fa-angle-up\",\n\t\t\t\"fas-f556\" => \"fas fa-angry\",\n\t\t\t\"fas-f644\" => \"fas fa-ankh\",\n\t\t\t\"fas-f5d1\" => \"fas fa-apple-alt\",\n\t\t\t\"fas-f187\" => \"fas fa-archive\",\n\t\t\t\"fas-f557\" => \"fas fa-archway\",\n\t\t\t\"fas-f358\" => \"fas fa-arrow-alt-circle-down\",\n\t\t\t\"fas-f359\" => \"fas fa-arrow-alt-circle-left\",\n\t\t\t\"fas-f35a\" => \"fas fa-arrow-alt-circle-right\",\n\t\t\t\"fas-f35b\" => \"fas fa-arrow-alt-circle-up\",\n\t\t\t\"fas-f0ab\" => \"fas fa-arrow-circle-down\",\n\t\t\t\"fas-f0a8\" => \"fas fa-arrow-circle-left\",\n\t\t\t\"fas-f0a9\" => \"fas fa-arrow-circle-right\",\n\t\t\t\"fas-f0aa\" => \"fas fa-arrow-circle-up\",\n\t\t\t\"fas-f063\" => \"fas fa-arrow-down\",\n\t\t\t\"fas-f060\" => \"fas fa-arrow-left\",\n\t\t\t\"fas-f061\" => \"fas fa-arrow-right\",\n\t\t\t\"fas-f062\" => \"fas fa-arrow-up\",\n\t\t\t\"fas-f0b2\" => \"fas fa-arrows-alt\",\n\t\t\t\"fas-f337\" => \"fas fa-arrows-alt-h\",\n\t\t\t\"fas-f338\" => \"fas fa-arrows-alt-v\",\n\t\t\t\"fas-f2a2\" => \"fas fa-assistive-listening-systems\",\n\t\t\t\"fas-f069\" => \"fas fa-asterisk\",\n\t\t\t\"fas-f1fa\" => \"fas fa-at\",\n\t\t\t\"fas-f558\" => \"fas fa-atlas\",\n\t\t\t\"fas-f5d2\" => \"fas fa-atom\",\n\t\t\t\"fas-f29e\" => \"fas fa-audio-description\",\n\t\t\t\"fas-f559\" => \"fas fa-award\",\n\t\t\t\"fas-f77c\" => \"fas fa-baby\",\n\t\t\t\"fas-f77d\" => \"fas fa-baby-carriage\",\n\t\t\t\"fas-f55a\" => \"fas fa-backspace\",\n\t\t\t\"fas-f04a\" => \"fas fa-backward\",\n\t\t\t\"fas-f7e5\" => \"fas fa-bacon\",\n\t\t\t\"fas-f666\" => \"fas fa-bahai\",\n\t\t\t\"fas-f24e\" => \"fas fa-balance-scale\",\n\t\t\t\"fas-f515\" => \"fas fa-balance-scale-left\",\n\t\t\t\"fas-f516\" => \"fas fa-balance-scale-right\",\n\t\t\t\"fas-f05e\" => \"fas fa-ban\",\n\t\t\t\"fas-f462\" => \"fas fa-band-aid\",\n\t\t\t\"fas-f02a\" => \"fas fa-barcode\",\n\t\t\t\"fas-f0c9\" => \"fas fa-bars\",\n\t\t\t\"fas-f433\" => \"fas fa-baseball-ball\",\n\t\t\t\"fas-f434\" => \"fas fa-basketball-ball\",\n\t\t\t\"fas-f2cd\" => \"fas fa-bath\",\n\t\t\t\"fas-f244\" => \"fas fa-battery-empty\",\n\t\t\t\"fas-f240\" => \"fas fa-battery-full\",\n\t\t\t\"fas-f242\" => \"fas fa-battery-half\",\n\t\t\t\"fas-f243\" => \"fas fa-battery-quarter\",\n\t\t\t\"fas-f241\" => \"fas fa-battery-three-quarters\",\n\t\t\t\"fas-f236\" => \"fas fa-bed\",\n\t\t\t\"fas-f0fc\" => \"fas fa-beer\",\n\t\t\t\"fas-f0f3\" => \"fas fa-bell\",\n\t\t\t\"fas-f1f6\" => \"fas fa-bell-slash\",\n\t\t\t\"fas-f55b\" => \"fas fa-bezier-curve\",\n\t\t\t\"fas-f647\" => \"fas fa-bible\",\n\t\t\t\"fas-f206\" => \"fas fa-bicycle\",\n\t\t\t\"fas-f84a\" => \"fas fa-biking\",\n\t\t\t\"fas-f1e5\" => \"fas fa-binoculars\",\n\t\t\t\"fas-f780\" => \"fas fa-biohazard\",\n\t\t\t\"fas-f1fd\" => \"fas fa-birthday-cake\",\n\t\t\t\"fas-f517\" => \"fas fa-blender\",\n\t\t\t\"fas-f6b6\" => \"fas fa-blender-phone\",\n\t\t\t\"fas-f29d\" => \"fas fa-blind\",\n\t\t\t\"fas-f781\" => \"fas fa-blog\",\n\t\t\t\"fas-f032\" => \"fas fa-bold\",\n\t\t\t\"fas-f0e7\" => \"fas fa-bolt\",\n\t\t\t\"fas-f1e2\" => \"fas fa-bomb\",\n\t\t\t\"fas-f5d7\" => \"fas fa-bone\",\n\t\t\t\"fas-f55c\" => \"fas fa-bong\",\n\t\t\t\"fas-f02d\" => \"fas fa-book\",\n\t\t\t\"fas-f6b7\" => \"fas fa-book-dead\",\n\t\t\t\"fas-f7e6\" => \"fas fa-book-medical\",\n\t\t\t\"fas-f518\" => \"fas fa-book-open\",\n\t\t\t\"fas-f5da\" => \"fas fa-book-reader\",\n\t\t\t\"fas-f02e\" => \"fas fa-bookmark\",\n\t\t\t\"fas-f84c\" => \"fas fa-border-all\",\n\t\t\t\"fas-f850\" => \"fas fa-border-none\",\n\t\t\t\"fas-f853\" => \"fas fa-border-style\",\n\t\t\t\"fas-f436\" => \"fas fa-bowling-ball\",\n\t\t\t\"fas-f466\" => \"fas fa-box\",\n\t\t\t\"fas-f49e\" => \"fas fa-box-open\",\n\t\t\t\"fas-f95b\" => \"fas fa-box-tissue\",\n\t\t\t\"fas-f468\" => \"fas fa-boxes\",\n\t\t\t\"fas-f2a1\" => \"fas fa-braille\",\n\t\t\t\"fas-f5dc\" => \"fas fa-brain\",\n\t\t\t\"fas-f7ec\" => \"fas fa-bread-slice\",\n\t\t\t\"fas-f0b1\" => \"fas fa-briefcase\",\n\t\t\t\"fas-f469\" => \"fas fa-briefcase-medical\",\n\t\t\t\"fas-f519\" => \"fas fa-broadcast-tower\",\n\t\t\t\"fas-f51a\" => \"fas fa-broom\",\n\t\t\t\"fas-f55d\" => \"fas fa-brush\",\n\t\t\t\"fas-f188\" => \"fas fa-bug\",\n\t\t\t\"fas-f1ad\" => \"fas fa-building\",\n\t\t\t\"fas-f0a1\" => \"fas fa-bullhorn\",\n\t\t\t\"fas-f140\" => \"fas fa-bullseye\",\n\t\t\t\"fas-f46a\" => \"fas fa-burn\",\n\t\t\t\"fas-f207\" => \"fas fa-bus\",\n\t\t\t\"fas-f55e\" => \"fas fa-bus-alt\",\n\t\t\t\"fas-f64a\" => \"fas fa-business-time\",\n\t\t\t\"fas-f1ec\" => \"fas fa-calculator\",\n\t\t\t\"fas-f133\" => \"fas fa-calendar\",\n\t\t\t\"fas-f073\" => \"fas fa-calendar-alt\",\n\t\t\t\"fas-f274\" => \"fas fa-calendar-check\",\n\t\t\t\"fas-f783\" => \"fas fa-calendar-day\",\n\t\t\t\"fas-f272\" => \"fas fa-calendar-minus\",\n\t\t\t\"fas-f271\" => \"fas fa-calendar-plus\",\n\t\t\t\"fas-f273\" => \"fas fa-calendar-times\",\n\t\t\t\"fas-f784\" => \"fas fa-calendar-week\",\n\t\t\t\"fas-f030\" => \"fas fa-camera\",\n\t\t\t\"fas-f083\" => \"fas fa-camera-retro\",\n\t\t\t\"fas-f6bb\" => \"fas fa-campground\",\n\t\t\t\"fas-f786\" => \"fas fa-candy-cane\",\n\t\t\t\"fas-f55f\" => \"fas fa-cannabis\",\n\t\t\t\"fas-f46b\" => \"fas fa-capsules\",\n\t\t\t\"fas-f1b9\" => \"fas fa-car\",\n\t\t\t\"fas-f5de\" => \"fas fa-car-alt\",\n\t\t\t\"fas-f5df\" => \"fas fa-car-battery\",\n\t\t\t\"fas-f5e1\" => \"fas fa-car-crash\",\n\t\t\t\"fas-f5e4\" => \"fas fa-car-side\",\n\t\t\t\"fas-f8ff\" => \"fas fa-caravan\",\n\t\t\t\"fas-f0d7\" => \"fas fa-caret-down\",\n\t\t\t\"fas-f0d9\" => \"fas fa-caret-left\",\n\t\t\t\"fas-f0da\" => \"fas fa-caret-right\",\n\t\t\t\"fas-f150\" => \"fas fa-caret-square-down\",\n\t\t\t\"fas-f191\" => \"fas fa-caret-square-left\",\n\t\t\t\"fas-f152\" => \"fas fa-caret-square-right\",\n\t\t\t\"fas-f151\" => \"fas fa-caret-square-up\",\n\t\t\t\"fas-f0d8\" => \"fas fa-caret-up\",\n\t\t\t\"fas-f787\" => \"fas fa-carrot\",\n\t\t\t\"fas-f218\" => \"fas fa-cart-arrow-down\",\n\t\t\t\"fas-f217\" => \"fas fa-cart-plus\",\n\t\t\t\"fas-f788\" => \"fas fa-cash-register\",\n\t\t\t\"fas-f6be\" => \"fas fa-cat\",\n\t\t\t\"fas-f0a3\" => \"fas fa-certificate\",\n\t\t\t\"fas-f6c0\" => \"fas fa-chair\",\n\t\t\t\"fas-f51b\" => \"fas fa-chalkboard\",\n\t\t\t\"fas-f51c\" => \"fas fa-chalkboard-teacher\",\n\t\t\t\"fas-f5e7\" => \"fas fa-charging-station\",\n\t\t\t\"fas-f1fe\" => \"fas fa-chart-area\",\n\t\t\t\"fas-f080\" => \"fas fa-chart-bar\",\n\t\t\t\"fas-f201\" => \"fas fa-chart-line\",\n\t\t\t\"fas-f200\" => \"fas fa-chart-pie\",\n\t\t\t\"fas-f00c\" => \"fas fa-check\",\n\t\t\t\"fas-f058\" => \"fas fa-check-circle\",\n\t\t\t\"fas-f560\" => \"fas fa-check-double\",\n\t\t\t\"fas-f14a\" => \"fas fa-check-square\",\n\t\t\t\"fas-f7ef\" => \"fas fa-cheese\",\n\t\t\t\"fas-f439\" => \"fas fa-chess\",\n\t\t\t\"fas-f43a\" => \"fas fa-chess-bishop\",\n\t\t\t\"fas-f43c\" => \"fas fa-chess-board\",\n\t\t\t\"fas-f43f\" => \"fas fa-chess-king\",\n\t\t\t\"fas-f441\" => \"fas fa-chess-knight\",\n\t\t\t\"fas-f443\" => \"fas fa-chess-pawn\",\n\t\t\t\"fas-f445\" => \"fas fa-chess-queen\",\n\t\t\t\"fas-f447\" => \"fas fa-chess-rook\",\n\t\t\t\"fas-f13a\" => \"fas fa-chevron-circle-down\",\n\t\t\t\"fas-f137\" => \"fas fa-chevron-circle-left\",\n\t\t\t\"fas-f138\" => \"fas fa-chevron-circle-right\",\n\t\t\t\"fas-f139\" => \"fas fa-chevron-circle-up\",\n\t\t\t\"fas-f078\" => \"fas fa-chevron-down\",\n\t\t\t\"fas-f053\" => \"fas fa-chevron-left\",\n\t\t\t\"fas-f054\" => \"fas fa-chevron-right\",\n\t\t\t\"fas-f077\" => \"fas fa-chevron-up\",\n\t\t\t\"fas-f1ae\" => \"fas fa-child\",\n\t\t\t\"fas-f51d\" => \"fas fa-church\",\n\t\t\t\"fas-f111\" => \"fas fa-circle\",\n\t\t\t\"fas-f1ce\" => \"fas fa-circle-notch\",\n\t\t\t\"fas-f64f\" => \"fas fa-city\",\n\t\t\t\"fas-f7f2\" => \"fas fa-clinic-medical\",\n\t\t\t\"fas-f328\" => \"fas fa-clipboard\",\n\t\t\t\"fas-f46c\" => \"fas fa-clipboard-check\",\n\t\t\t\"fas-f46d\" => \"fas fa-clipboard-list\",\n\t\t\t\"fas-f017\" => \"fas fa-clock\",\n\t\t\t\"fas-f24d\" => \"fas fa-clone\",\n\t\t\t\"fas-f20a\" => \"fas fa-closed-captioning\",\n\t\t\t\"fas-f0c2\" => \"fas fa-cloud\",\n\t\t\t\"fas-f381\" => \"fas fa-cloud-download-alt\",\n\t\t\t\"fas-f73b\" => \"fas fa-cloud-meatball\",\n\t\t\t\"fas-f6c3\" => \"fas fa-cloud-moon\",\n\t\t\t\"fas-f73c\" => \"fas fa-cloud-moon-rain\",\n\t\t\t\"fas-f73d\" => \"fas fa-cloud-rain\",\n\t\t\t\"fas-f740\" => \"fas fa-cloud-showers-heavy\",\n\t\t\t\"fas-f6c4\" => \"fas fa-cloud-sun\",\n\t\t\t\"fas-f743\" => \"fas fa-cloud-sun-rain\",\n\t\t\t\"fas-f382\" => \"fas fa-cloud-upload-alt\",\n\t\t\t\"fas-f561\" => \"fas fa-cocktail\",\n\t\t\t\"fas-f121\" => \"fas fa-code\",\n\t\t\t\"fas-f126\" => \"fas fa-code-branch\",\n\t\t\t\"fas-f0f4\" => \"fas fa-coffee\",\n\t\t\t\"fas-f013\" => \"fas fa-cog\",\n\t\t\t\"fas-f085\" => \"fas fa-cogs\",\n\t\t\t\"fas-f51e\" => \"fas fa-coins\",\n\t\t\t\"fas-f0db\" => \"fas fa-columns\",\n\t\t\t\"fas-f075\" => \"fas fa-comment\",\n\t\t\t\"fas-f27a\" => \"fas fa-comment-alt\",\n\t\t\t\"fas-f651\" => \"fas fa-comment-dollar\",\n\t\t\t\"fas-f4ad\" => \"fas fa-comment-dots\",\n\t\t\t\"fas-f7f5\" => \"fas fa-comment-medical\",\n\t\t\t\"fas-f4b3\" => \"fas fa-comment-slash\",\n\t\t\t\"fas-f086\" => \"fas fa-comments\",\n\t\t\t\"fas-f653\" => \"fas fa-comments-dollar\",\n\t\t\t\"fas-f51f\" => \"fas fa-compact-disc\",\n\t\t\t\"fas-f14e\" => \"fas fa-compass\",\n\t\t\t\"fas-f066\" => \"fas fa-compress\",\n\t\t\t\"fas-f422\" => \"fas fa-compress-alt\",\n\t\t\t\"fas-f78c\" => \"fas fa-compress-arrows-alt\",\n\t\t\t\"fas-f562\" => \"fas fa-concierge-bell\",\n\t\t\t\"fas-f563\" => \"fas fa-cookie\",\n\t\t\t\"fas-f564\" => \"fas fa-cookie-bite\",\n\t\t\t\"fas-f0c5\" => \"fas fa-copy\",\n\t\t\t\"fas-f1f9\" => \"fas fa-copyright\",\n\t\t\t\"fas-f4b8\" => \"fas fa-couch\",\n\t\t\t\"fas-f09d\" => \"fas fa-credit-card\",\n\t\t\t\"fas-f125\" => \"fas fa-crop\",\n\t\t\t\"fas-f565\" => \"fas fa-crop-alt\",\n\t\t\t\"fas-f654\" => \"fas fa-cross\",\n\t\t\t\"fas-f05b\" => \"fas fa-crosshairs\",\n\t\t\t\"fas-f520\" => \"fas fa-crow\",\n\t\t\t\"fas-f521\" => \"fas fa-crown\",\n\t\t\t\"fas-f7f7\" => \"fas fa-crutch\",\n\t\t\t\"fas-f1b2\" => \"fas fa-cube\",\n\t\t\t\"fas-f1b3\" => \"fas fa-cubes\",\n\t\t\t\"fas-f0c4\" => \"fas fa-cut\",\n\t\t\t\"fas-f1c0\" => \"fas fa-database\",\n\t\t\t\"fas-f2a4\" => \"fas fa-deaf\",\n\t\t\t\"fas-f747\" => \"fas fa-democrat\",\n\t\t\t\"fas-f108\" => \"fas fa-desktop\",\n\t\t\t\"fas-f655\" => \"fas fa-dharmachakra\",\n\t\t\t\"fas-f470\" => \"fas fa-diagnoses\",\n\t\t\t\"fas-f522\" => \"fas fa-dice\",\n\t\t\t\"fas-f6cf\" => \"fas fa-dice-d20\",\n\t\t\t\"fas-f6d1\" => \"fas fa-dice-d6\",\n\t\t\t\"fas-f523\" => \"fas fa-dice-five\",\n\t\t\t\"fas-f524\" => \"fas fa-dice-four\",\n\t\t\t\"fas-f525\" => \"fas fa-dice-one\",\n\t\t\t\"fas-f526\" => \"fas fa-dice-six\",\n\t\t\t\"fas-f527\" => \"fas fa-dice-three\",\n\t\t\t\"fas-f528\" => \"fas fa-dice-two\",\n\t\t\t\"fas-f566\" => \"fas fa-digital-tachograph\",\n\t\t\t\"fas-f5eb\" => \"fas fa-directions\",\n\t\t\t\"fas-f7fa\" => \"fas fa-disease\",\n\t\t\t\"fas-f529\" => \"fas fa-divide\",\n\t\t\t\"fas-f567\" => \"fas fa-dizzy\",\n\t\t\t\"fas-f471\" => \"fas fa-dna\",\n\t\t\t\"fas-f6d3\" => \"fas fa-dog\",\n\t\t\t\"fas-f155\" => \"fas fa-dollar-sign\",\n\t\t\t\"fas-f472\" => \"fas fa-dolly\",\n\t\t\t\"fas-f474\" => \"fas fa-dolly-flatbed\",\n\t\t\t\"fas-f4b9\" => \"fas fa-donate\",\n\t\t\t\"fas-f52a\" => \"fas fa-door-closed\",\n\t\t\t\"fas-f52b\" => \"fas fa-door-open\",\n\t\t\t\"fas-f192\" => \"fas fa-dot-circle\",\n\t\t\t\"fas-f4ba\" => \"fas fa-dove\",\n\t\t\t\"fas-f019\" => \"fas fa-download\",\n\t\t\t\"fas-f568\" => \"fas fa-drafting-compass\",\n\t\t\t\"fas-f6d5\" => \"fas fa-dragon\",\n\t\t\t\"fas-f5ee\" => \"fas fa-draw-polygon\",\n\t\t\t\"fas-f569\" => \"fas fa-drum\",\n\t\t\t\"fas-f56a\" => \"fas fa-drum-steelpan\",\n\t\t\t\"fas-f6d7\" => \"fas fa-drumstick-bite\",\n\t\t\t\"fas-f44b\" => \"fas fa-dumbbell\",\n\t\t\t\"fas-f793\" => \"fas fa-dumpster\",\n\t\t\t\"fas-f794\" => \"fas fa-dumpster-fire\",\n\t\t\t\"fas-f6d9\" => \"fas fa-dungeon\",\n\t\t\t\"fas-f044\" => \"fas fa-edit\",\n\t\t\t\"fas-f7fb\" => \"fas fa-egg\",\n\t\t\t\"fas-f052\" => \"fas fa-eject\",\n\t\t\t\"fas-f141\" => \"fas fa-ellipsis-h\",\n\t\t\t\"fas-f142\" => \"fas fa-ellipsis-v\",\n\t\t\t\"fas-f0e0\" => \"fas fa-envelope\",\n\t\t\t\"fas-f2b6\" => \"fas fa-envelope-open\",\n\t\t\t\"fas-f658\" => \"fas fa-envelope-open-text\",\n\t\t\t\"fas-f199\" => \"fas fa-envelope-square\",\n\t\t\t\"fas-f52c\" => \"fas fa-equals\",\n\t\t\t\"fas-f12d\" => \"fas fa-eraser\",\n\t\t\t\"fas-f796\" => \"fas fa-ethernet\",\n\t\t\t\"fas-f153\" => \"fas fa-euro-sign\",\n\t\t\t\"fas-f362\" => \"fas fa-exchange-alt\",\n\t\t\t\"fas-f12a\" => \"fas fa-exclamation\",\n\t\t\t\"fas-f06a\" => \"fas fa-exclamation-circle\",\n\t\t\t\"fas-f071\" => \"fas fa-exclamation-triangle\",\n\t\t\t\"fas-f065\" => \"fas fa-expand\",\n\t\t\t\"fas-f424\" => \"fas fa-expand-alt\",\n\t\t\t\"fas-f31e\" => \"fas fa-expand-arrows-alt\",\n\t\t\t\"fas-f35d\" => \"fas fa-external-link-alt\",\n\t\t\t\"fas-f360\" => \"fas fa-external-link-square-alt\",\n\t\t\t\"fas-f06e\" => \"fas fa-eye\",\n\t\t\t\"fas-f1fb\" => \"fas fa-eye-dropper\",\n\t\t\t\"fas-f070\" => \"fas fa-eye-slash\",\n\t\t\t\"fas-f863\" => \"fas fa-fan\",\n\t\t\t\"fas-f049\" => \"fas fa-fast-backward\",\n\t\t\t\"fas-f050\" => \"fas fa-fast-forward\",\n\t\t\t\"fas-f905\" => \"fas fa-faucet\",\n\t\t\t\"fas-f1ac\" => \"fas fa-fax\",\n\t\t\t\"fas-f52d\" => \"fas fa-feather\",\n\t\t\t\"fas-f56b\" => \"fas fa-feather-alt\",\n\t\t\t\"fas-f182\" => \"fas fa-female\",\n\t\t\t\"fas-f0fb\" => \"fas fa-fighter-jet\",\n\t\t\t\"fas-f15b\" => \"fas fa-file\",\n\t\t\t\"fas-f15c\" => \"fas fa-file-alt\",\n\t\t\t\"fas-f1c6\" => \"fas fa-file-archive\",\n\t\t\t\"fas-f1c7\" => \"fas fa-file-audio\",\n\t\t\t\"fas-f1c9\" => \"fas fa-file-code\",\n\t\t\t\"fas-f56c\" => \"fas fa-file-contract\",\n\t\t\t\"fas-f6dd\" => \"fas fa-file-csv\",\n\t\t\t\"fas-f56d\" => \"fas fa-file-download\",\n\t\t\t\"fas-f1c3\" => \"fas fa-file-excel\",\n\t\t\t\"fas-f56e\" => \"fas fa-file-export\",\n\t\t\t\"fas-f1c5\" => \"fas fa-file-image\",\n\t\t\t\"fas-f56f\" => \"fas fa-file-import\",\n\t\t\t\"fas-f570\" => \"fas fa-file-invoice\",\n\t\t\t\"fas-f571\" => \"fas fa-file-invoice-dollar\",\n\t\t\t\"fas-f477\" => \"fas fa-file-medical\",\n\t\t\t\"fas-f478\" => \"fas fa-file-medical-alt\",\n\t\t\t\"fas-f1c1\" => \"fas fa-file-pdf\",\n\t\t\t\"fas-f1c4\" => \"fas fa-file-powerpoint\",\n\t\t\t\"fas-f572\" => \"fas fa-file-prescription\",\n\t\t\t\"fas-f573\" => \"fas fa-file-signature\",\n\t\t\t\"fas-f574\" => \"fas fa-file-upload\",\n\t\t\t\"fas-f1c8\" => \"fas fa-file-video\",\n\t\t\t\"fas-f1c2\" => \"fas fa-file-word\",\n\t\t\t\"fas-f575\" => \"fas fa-fill\",\n\t\t\t\"fas-f576\" => \"fas fa-fill-drip\",\n\t\t\t\"fas-f008\" => \"fas fa-film\",\n\t\t\t\"fas-f0b0\" => \"fas fa-filter\",\n\t\t\t\"fas-f577\" => \"fas fa-fingerprint\",\n\t\t\t\"fas-f06d\" => \"fas fa-fire\",\n\t\t\t\"fas-f7e4\" => \"fas fa-fire-alt\",\n\t\t\t\"fas-f134\" => \"fas fa-fire-extinguisher\",\n\t\t\t\"fas-f479\" => \"fas fa-first-aid\",\n\t\t\t\"fas-f578\" => \"fas fa-fish\",\n\t\t\t\"fas-f6de\" => \"fas fa-fist-raised\",\n\t\t\t\"fas-f024\" => \"fas fa-flag\",\n\t\t\t\"fas-f11e\" => \"fas fa-flag-checkered\",\n\t\t\t\"fas-f74d\" => \"fas fa-flag-usa\",\n\t\t\t\"fas-f0c3\" => \"fas fa-flask\",\n\t\t\t\"fas-f579\" => \"fas fa-flushed\",\n\t\t\t\"fas-f07b\" => \"fas fa-folder\",\n\t\t\t\"fas-f65d\" => \"fas fa-folder-minus\",\n\t\t\t\"fas-f07c\" => \"fas fa-folder-open\",\n\t\t\t\"fas-f65e\" => \"fas fa-folder-plus\",\n\t\t\t\"fas-f031\" => \"fas fa-font\",\n\t\t\t\"fas-f44e\" => \"fas fa-football-ball\",\n\t\t\t\"fas-f04e\" => \"fas fa-forward\",\n\t\t\t\"fas-f52e\" => \"fas fa-frog\",\n\t\t\t\"fas-f119\" => \"fas fa-frown\",\n\t\t\t\"fas-f57a\" => \"fas fa-frown-open\",\n\t\t\t\"fas-f662\" => \"fas fa-funnel-dollar\",\n\t\t\t\"fas-f1e3\" => \"fas fa-futbol\",\n\t\t\t\"fas-f11b\" => \"fas fa-gamepad\",\n\t\t\t\"fas-f52f\" => \"fas fa-gas-pump\",\n\t\t\t\"fas-f0e3\" => \"fas fa-gavel\",\n\t\t\t\"fas-f3a5\" => \"fas fa-gem\",\n\t\t\t\"fas-f22d\" => \"fas fa-genderless\",\n\t\t\t\"fas-f6e2\" => \"fas fa-ghost\",\n\t\t\t\"fas-f06b\" => \"fas fa-gift\",\n\t\t\t\"fas-f79c\" => \"fas fa-gifts\",\n\t\t\t\"fas-f79f\" => \"fas fa-glass-cheers\",\n\t\t\t\"fas-f000\" => \"fas fa-glass-martini\",\n\t\t\t\"fas-f57b\" => \"fas fa-glass-martini-alt\",\n\t\t\t\"fas-f7a0\" => \"fas fa-glass-whiskey\",\n\t\t\t\"fas-f530\" => \"fas fa-glasses\",\n\t\t\t\"fas-f0ac\" => \"fas fa-globe\",\n\t\t\t\"fas-f57c\" => \"fas fa-globe-africa\",\n\t\t\t\"fas-f57d\" => \"fas fa-globe-americas\",\n\t\t\t\"fas-f57e\" => \"fas fa-globe-asia\",\n\t\t\t\"fas-f7a2\" => \"fas fa-globe-europe\",\n\t\t\t\"fas-f450\" => \"fas fa-golf-ball\",\n\t\t\t\"fas-f664\" => \"fas fa-gopuram\",\n\t\t\t\"fas-f19d\" => \"fas fa-graduation-cap\",\n\t\t\t\"fas-f531\" => \"fas fa-greater-than\",\n\t\t\t\"fas-f532\" => \"fas fa-greater-than-equal\",\n\t\t\t\"fas-f57f\" => \"fas fa-grimace\",\n\t\t\t\"fas-f580\" => \"fas fa-grin\",\n\t\t\t\"fas-f581\" => \"fas fa-grin-alt\",\n\t\t\t\"fas-f582\" => \"fas fa-grin-beam\",\n\t\t\t\"fas-f583\" => \"fas fa-grin-beam-sweat\",\n\t\t\t\"fas-f584\" => \"fas fa-grin-hearts\",\n\t\t\t\"fas-f585\" => \"fas fa-grin-squint\",\n\t\t\t\"fas-f586\" => \"fas fa-grin-squint-tears\",\n\t\t\t\"fas-f587\" => \"fas fa-grin-stars\",\n\t\t\t\"fas-f588\" => \"fas fa-grin-tears\",\n\t\t\t\"fas-f589\" => \"fas fa-grin-tongue\",\n\t\t\t\"fas-f58a\" => \"fas fa-grin-tongue-squint\",\n\t\t\t\"fas-f58b\" => \"fas fa-grin-tongue-wink\",\n\t\t\t\"fas-f58c\" => \"fas fa-grin-wink\",\n\t\t\t\"fas-f58d\" => \"fas fa-grip-horizontal\",\n\t\t\t\"fas-f7a4\" => \"fas fa-grip-lines\",\n\t\t\t\"fas-f7a5\" => \"fas fa-grip-lines-vertical\",\n\t\t\t\"fas-f58e\" => \"fas fa-grip-vertical\",\n\t\t\t\"fas-f7a6\" => \"fas fa-guitar\",\n\t\t\t\"fas-f0fd\" => \"fas fa-h-square\",\n\t\t\t\"fas-f805\" => \"fas fa-hamburger\",\n\t\t\t\"fas-f6e3\" => \"fas fa-hammer\",\n\t\t\t\"fas-f665\" => \"fas fa-hamsa\",\n\t\t\t\"fas-f4bd\" => \"fas fa-hand-holding\",\n\t\t\t\"fas-f4be\" => \"fas fa-hand-holding-heart\",\n\t\t\t\"fas-f95c\" => \"fas fa-hand-holding-medical\",\n\t\t\t\"fas-f4c0\" => \"fas fa-hand-holding-usd\",\n\t\t\t\"fas-f4c1\" => \"fas fa-hand-holding-water\",\n\t\t\t\"fas-f258\" => \"fas fa-hand-lizard\",\n\t\t\t\"fas-f806\" => \"fas fa-hand-middle-finger\",\n\t\t\t\"fas-f256\" => \"fas fa-hand-paper\",\n\t\t\t\"fas-f25b\" => \"fas fa-hand-peace\",\n\t\t\t\"fas-f0a7\" => \"fas fa-hand-point-down\",\n\t\t\t\"fas-f0a5\" => \"fas fa-hand-point-left\",\n\t\t\t\"fas-f0a4\" => \"fas fa-hand-point-right\",\n\t\t\t\"fas-f0a6\" => \"fas fa-hand-point-up\",\n\t\t\t\"fas-f25a\" => \"fas fa-hand-pointer\",\n\t\t\t\"fas-f255\" => \"fas fa-hand-rock\",\n\t\t\t\"fas-f257\" => \"fas fa-hand-scissors\",\n\t\t\t\"fas-f95d\" => \"fas fa-hand-sparkles\",\n\t\t\t\"fas-f259\" => \"fas fa-hand-spock\",\n\t\t\t\"fas-f4c2\" => \"fas fa-hands\",\n\t\t\t\"fas-f4c4\" => \"fas fa-hands-helping\",\n\t\t\t\"fas-f95e\" => \"fas fa-hands-wash\",\n\t\t\t\"fas-f2b5\" => \"fas fa-handshake\",\n\t\t\t\"fas-f95f\" => \"fas fa-handshake-alt-slash\",\n\t\t\t\"fas-f960\" => \"fas fa-handshake-slash\",\n\t\t\t\"fas-f6e6\" => \"fas fa-hanukiah\",\n\t\t\t\"fas-f807\" => \"fas fa-hard-hat\",\n\t\t\t\"fas-f292\" => \"fas fa-hashtag\",\n\t\t\t\"fas-f8c0\" => \"fas fa-hat-cowboy\",\n\t\t\t\"fas-f8c1\" => \"fas fa-hat-cowboy-side\",\n\t\t\t\"fas-f6e8\" => \"fas fa-hat-wizard\",\n\t\t\t\"fas-f0a0\" => \"fas fa-hdd\",\n\t\t\t\"fas-f961\" => \"fas fa-head-side-cough\",\n\t\t\t\"fas-f962\" => \"fas fa-head-side-cough-slash\",\n\t\t\t\"fas-f963\" => \"fas fa-head-side-mask\",\n\t\t\t\"fas-f964\" => \"fas fa-head-side-virus\",\n\t\t\t\"fas-f1dc\" => \"fas fa-heading\",\n\t\t\t\"fas-f025\" => \"fas fa-headphones\",\n\t\t\t\"fas-f58f\" => \"fas fa-headphones-alt\",\n\t\t\t\"fas-f590\" => \"fas fa-headset\",\n\t\t\t\"fas-f004\" => \"fas fa-heart\",\n\t\t\t\"fas-f7a9\" => \"fas fa-heart-broken\",\n\t\t\t\"fas-f21e\" => \"fas fa-heartbeat\",\n\t\t\t\"fas-f533\" => \"fas fa-helicopter\",\n\t\t\t\"fas-f591\" => \"fas fa-highlighter\",\n\t\t\t\"fas-f6ec\" => \"fas fa-hiking\",\n\t\t\t\"fas-f6ed\" => \"fas fa-hippo\",\n\t\t\t\"fas-f1da\" => \"fas fa-history\",\n\t\t\t\"fas-f453\" => \"fas fa-hockey-puck\",\n\t\t\t\"fas-f7aa\" => \"fas fa-holly-berry\",\n\t\t\t\"fas-f015\" => \"fas fa-home\",\n\t\t\t\"fas-f6f0\" => \"fas fa-horse\",\n\t\t\t\"fas-f7ab\" => \"fas fa-horse-head\",\n\t\t\t\"fas-f0f8\" => \"fas fa-hospital\",\n\t\t\t\"fas-f47d\" => \"fas fa-hospital-alt\",\n\t\t\t\"fas-f47e\" => \"fas fa-hospital-symbol\",\n\t\t\t\"fas-f80d\" => \"fas fa-hospital-user\",\n\t\t\t\"fas-f593\" => \"fas fa-hot-tub\",\n\t\t\t\"fas-f80f\" => \"fas fa-hotdog\",\n\t\t\t\"fas-f594\" => \"fas fa-hotel\",\n\t\t\t\"fas-f254\" => \"fas fa-hourglass\",\n\t\t\t\"fas-f253\" => \"fas fa-hourglass-end\",\n\t\t\t\"fas-f252\" => \"fas fa-hourglass-half\",\n\t\t\t\"fas-f251\" => \"fas fa-hourglass-start\",\n\t\t\t\"fas-f6f1\" => \"fas fa-house-damage\",\n\t\t\t\"fas-f965\" => \"fas fa-house-user\",\n\t\t\t\"fas-f6f2\" => \"fas fa-hryvnia\",\n\t\t\t\"fas-f246\" => \"fas fa-i-cursor\",\n\t\t\t\"fas-f810\" => \"fas fa-ice-cream\",\n\t\t\t\"fas-f7ad\" => \"fas fa-icicles\",\n\t\t\t\"fas-f86d\" => \"fas fa-icons\",\n\t\t\t\"fas-f2c1\" => \"fas fa-id-badge\",\n\t\t\t\"fas-f2c2\" => \"fas fa-id-card\",\n\t\t\t\"fas-f47f\" => \"fas fa-id-card-alt\",\n\t\t\t\"fas-f7ae\" => \"fas fa-igloo\",\n\t\t\t\"fas-f03e\" => \"fas fa-image\",\n\t\t\t\"fas-f302\" => \"fas fa-images\",\n\t\t\t\"fas-f01c\" => \"fas fa-inbox\",\n\t\t\t\"fas-f03c\" => \"fas fa-indent\",\n\t\t\t\"fas-f275\" => \"fas fa-industry\",\n\t\t\t\"fas-f534\" => \"fas fa-infinity\",\n\t\t\t\"fas-f129\" => \"fas fa-info\",\n\t\t\t\"fas-f05a\" => \"fas fa-info-circle\",\n\t\t\t\"fas-f033\" => \"fas fa-italic\",\n\t\t\t\"fas-f669\" => \"fas fa-jedi\",\n\t\t\t\"fas-f595\" => \"fas fa-joint\",\n\t\t\t\"fas-f66a\" => \"fas fa-journal-whills\",\n\t\t\t\"fas-f66b\" => \"fas fa-kaaba\",\n\t\t\t\"fas-f084\" => \"fas fa-key\",\n\t\t\t\"fas-f11c\" => \"fas fa-keyboard\",\n\t\t\t\"fas-f66d\" => \"fas fa-khanda\",\n\t\t\t\"fas-f596\" => \"fas fa-kiss\",\n\t\t\t\"fas-f597\" => \"fas fa-kiss-beam\",\n\t\t\t\"fas-f598\" => \"fas fa-kiss-wink-heart\",\n\t\t\t\"fas-f535\" => \"fas fa-kiwi-bird\",\n\t\t\t\"fas-f66f\" => \"fas fa-landmark\",\n\t\t\t\"fas-f1ab\" => \"fas fa-language\",\n\t\t\t\"fas-f109\" => \"fas fa-laptop\",\n\t\t\t\"fas-f5fc\" => \"fas fa-laptop-code\",\n\t\t\t\"fas-f966\" => \"fas fa-laptop-house\",\n\t\t\t\"fas-f812\" => \"fas fa-laptop-medical\",\n\t\t\t\"fas-f599\" => \"fas fa-laugh\",\n\t\t\t\"fas-f59a\" => \"fas fa-laugh-beam\",\n\t\t\t\"fas-f59b\" => \"fas fa-laugh-squint\",\n\t\t\t\"fas-f59c\" => \"fas fa-laugh-wink\",\n\t\t\t\"fas-f5fd\" => \"fas fa-layer-group\",\n\t\t\t\"fas-f06c\" => \"fas fa-leaf\",\n\t\t\t\"fas-f094\" => \"fas fa-lemon\",\n\t\t\t\"fas-f536\" => \"fas fa-less-than\",\n\t\t\t\"fas-f537\" => \"fas fa-less-than-equal\",\n\t\t\t\"fas-f3be\" => \"fas fa-level-down-alt\",\n\t\t\t\"fas-f3bf\" => \"fas fa-level-up-alt\",\n\t\t\t\"fas-f1cd\" => \"fas fa-life-ring\",\n\t\t\t\"fas-f0eb\" => \"fas fa-lightbulb\",\n\t\t\t\"fas-f0c1\" => \"fas fa-link\",\n\t\t\t\"fas-f195\" => \"fas fa-lira-sign\",\n\t\t\t\"fas-f03a\" => \"fas fa-list\",\n\t\t\t\"fas-f022\" => \"fas fa-list-alt\",\n\t\t\t\"fas-f0cb\" => \"fas fa-list-ol\",\n\t\t\t\"fas-f0ca\" => \"fas fa-list-ul\",\n\t\t\t\"fas-f124\" => \"fas fa-location-arrow\",\n\t\t\t\"fas-f023\" => \"fas fa-lock\",\n\t\t\t\"fas-f3c1\" => \"fas fa-lock-open\",\n\t\t\t\"fas-f309\" => \"fas fa-long-arrow-alt-down\",\n\t\t\t\"fas-f30a\" => \"fas fa-long-arrow-alt-left\",\n\t\t\t\"fas-f30b\" => \"fas fa-long-arrow-alt-right\",\n\t\t\t\"fas-f30c\" => \"fas fa-long-arrow-alt-up\",\n\t\t\t\"fas-f2a8\" => \"fas fa-low-vision\",\n\t\t\t\"fas-f59d\" => \"fas fa-luggage-cart\",\n\t\t\t\"fas-f604\" => \"fas fa-lungs\",\n\t\t\t\"fas-f967\" => \"fas fa-lungs-virus\",\n\t\t\t\"fas-f0d0\" => \"fas fa-magic\",\n\t\t\t\"fas-f076\" => \"fas fa-magnet\",\n\t\t\t\"fas-f674\" => \"fas fa-mail-bulk\",\n\t\t\t\"fas-f183\" => \"fas fa-male\",\n\t\t\t\"fas-f279\" => \"fas fa-map\",\n\t\t\t\"fas-f59f\" => \"fas fa-map-marked\",\n\t\t\t\"fas-f5a0\" => \"fas fa-map-marked-alt\",\n\t\t\t\"fas-f041\" => \"fas fa-map-marker\",\n\t\t\t\"fas-f3c5\" => \"fas fa-map-marker-alt\",\n\t\t\t\"fas-f276\" => \"fas fa-map-pin\",\n\t\t\t\"fas-f277\" => \"fas fa-map-signs\",\n\t\t\t\"fas-f5a1\" => \"fas fa-marker\",\n\t\t\t\"fas-f222\" => \"fas fa-mars\",\n\t\t\t\"fas-f227\" => \"fas fa-mars-double\",\n\t\t\t\"fas-f229\" => \"fas fa-mars-stroke\",\n\t\t\t\"fas-f22b\" => \"fas fa-mars-stroke-h\",\n\t\t\t\"fas-f22a\" => \"fas fa-mars-stroke-v\",\n\t\t\t\"fas-f6fa\" => \"fas fa-mask\",\n\t\t\t\"fas-f5a2\" => \"fas fa-medal\",\n\t\t\t\"fas-f0fa\" => \"fas fa-medkit\",\n\t\t\t\"fas-f11a\" => \"fas fa-meh\",\n\t\t\t\"fas-f5a4\" => \"fas fa-meh-blank\",\n\t\t\t\"fas-f5a5\" => \"fas fa-meh-rolling-eyes\",\n\t\t\t\"fas-f538\" => \"fas fa-memory\",\n\t\t\t\"fas-f676\" => \"fas fa-menorah\",\n\t\t\t\"fas-f223\" => \"fas fa-mercury\",\n\t\t\t\"fas-f753\" => \"fas fa-meteor\",\n\t\t\t\"fas-f2db\" => \"fas fa-microchip\",\n\t\t\t\"fas-f130\" => \"fas fa-microphone\",\n\t\t\t\"fas-f3c9\" => \"fas fa-microphone-alt\",\n\t\t\t\"fas-f539\" => \"fas fa-microphone-alt-slash\",\n\t\t\t\"fas-f131\" => \"fas fa-microphone-slash\",\n\t\t\t\"fas-f610\" => \"fas fa-microscope\",\n\t\t\t\"fas-f068\" => \"fas fa-minus\",\n\t\t\t\"fas-f056\" => \"fas fa-minus-circle\",\n\t\t\t\"fas-f146\" => \"fas fa-minus-square\",\n\t\t\t\"fas-f7b5\" => \"fas fa-mitten\",\n\t\t\t\"fas-f10b\" => \"fas fa-mobile\",\n\t\t\t\"fas-f3cd\" => \"fas fa-mobile-alt\",\n\t\t\t\"fas-f0d6\" => \"fas fa-money-bill\",\n\t\t\t\"fas-f3d1\" => \"fas fa-money-bill-alt\",\n\t\t\t\"fas-f53a\" => \"fas fa-money-bill-wave\",\n\t\t\t\"fas-f53b\" => \"fas fa-money-bill-wave-alt\",\n\t\t\t\"fas-f53c\" => \"fas fa-money-check\",\n\t\t\t\"fas-f53d\" => \"fas fa-money-check-alt\",\n\t\t\t\"fas-f5a6\" => \"fas fa-monument\",\n\t\t\t\"fas-f186\" => \"fas fa-moon\",\n\t\t\t\"fas-f5a7\" => \"fas fa-mortar-pestle\",\n\t\t\t\"fas-f678\" => \"fas fa-mosque\",\n\t\t\t\"fas-f21c\" => \"fas fa-motorcycle\",\n\t\t\t\"fas-f6fc\" => \"fas fa-mountain\",\n\t\t\t\"fas-f8cc\" => \"fas fa-mouse\",\n\t\t\t\"fas-f245\" => \"fas fa-mouse-pointer\",\n\t\t\t\"fas-f7b6\" => \"fas fa-mug-hot\",\n\t\t\t\"fas-f001\" => \"fas fa-music\",\n\t\t\t\"fas-f6ff\" => \"fas fa-network-wired\",\n\t\t\t\"fas-f22c\" => \"fas fa-neuter\",\n\t\t\t\"fas-f1ea\" => \"fas fa-newspaper\",\n\t\t\t\"fas-f53e\" => \"fas fa-not-equal\",\n\t\t\t\"fas-f481\" => \"fas fa-notes-medical\",\n\t\t\t\"fas-f247\" => \"fas fa-object-group\",\n\t\t\t\"fas-f248\" => \"fas fa-object-ungroup\",\n\t\t\t\"fas-f613\" => \"fas fa-oil-can\",\n\t\t\t\"fas-f679\" => \"fas fa-om\",\n\t\t\t\"fas-f700\" => \"fas fa-otter\",\n\t\t\t\"fas-f03b\" => \"fas fa-outdent\",\n\t\t\t\"fas-f815\" => \"fas fa-pager\",\n\t\t\t\"fas-f1fc\" => \"fas fa-paint-brush\",\n\t\t\t\"fas-f5aa\" => \"fas fa-paint-roller\",\n\t\t\t\"fas-f53f\" => \"fas fa-palette\",\n\t\t\t\"fas-f482\" => \"fas fa-pallet\",\n\t\t\t\"fas-f1d8\" => \"fas fa-paper-plane\",\n\t\t\t\"fas-f0c6\" => \"fas fa-paperclip\",\n\t\t\t\"fas-f4cd\" => \"fas fa-parachute-box\",\n\t\t\t\"fas-f1dd\" => \"fas fa-paragraph\",\n\t\t\t\"fas-f540\" => \"fas fa-parking\",\n\t\t\t\"fas-f5ab\" => \"fas fa-passport\",\n\t\t\t\"fas-f67b\" => \"fas fa-pastafarianism\",\n\t\t\t\"fas-f0ea\" => \"fas fa-paste\",\n\t\t\t\"fas-f04c\" => \"fas fa-pause\",\n\t\t\t\"fas-f28b\" => \"fas fa-pause-circle\",\n\t\t\t\"fas-f1b0\" => \"fas fa-paw\",\n\t\t\t\"fas-f67c\" => \"fas fa-peace\",\n\t\t\t\"fas-f304\" => \"fas fa-pen\",\n\t\t\t\"fas-f305\" => \"fas fa-pen-alt\",\n\t\t\t\"fas-f5ac\" => \"fas fa-pen-fancy\",\n\t\t\t\"fas-f5ad\" => \"fas fa-pen-nib\",\n\t\t\t\"fas-f14b\" => \"fas fa-pen-square\",\n\t\t\t\"fas-f303\" => \"fas fa-pencil-alt\",\n\t\t\t\"fas-f5ae\" => \"fas fa-pencil-ruler\",\n\t\t\t\"fas-f968\" => \"fas fa-people-arrows\",\n\t\t\t\"fas-f4ce\" => \"fas fa-people-carry\",\n\t\t\t\"fas-f816\" => \"fas fa-pepper-hot\",\n\t\t\t\"fas-f295\" => \"fas fa-percent\",\n\t\t\t\"fas-f541\" => \"fas fa-percentage\",\n\t\t\t\"fas-f756\" => \"fas fa-person-booth\",\n\t\t\t\"fas-f095\" => \"fas fa-phone\",\n\t\t\t\"fas-f879\" => \"fas fa-phone-alt\",\n\t\t\t\"fas-f3dd\" => \"fas fa-phone-slash\",\n\t\t\t\"fas-f098\" => \"fas fa-phone-square\",\n\t\t\t\"fas-f87b\" => \"fas fa-phone-square-alt\",\n\t\t\t\"fas-f2a0\" => \"fas fa-phone-volume\",\n\t\t\t\"fas-f87c\" => \"fas fa-photo-video\",\n\t\t\t\"fas-f4d3\" => \"fas fa-piggy-bank\",\n\t\t\t\"fas-f484\" => \"fas fa-pills\",\n\t\t\t\"fas-f818\" => \"fas fa-pizza-slice\",\n\t\t\t\"fas-f67f\" => \"fas fa-place-of-worship\",\n\t\t\t\"fas-f072\" => \"fas fa-plane\",\n\t\t\t\"fas-f5af\" => \"fas fa-plane-arrival\",\n\t\t\t\"fas-f5b0\" => \"fas fa-plane-departure\",\n\t\t\t\"fas-f969\" => \"fas fa-plane-slash\",\n\t\t\t\"fas-f04b\" => \"fas fa-play\",\n\t\t\t\"fas-f144\" => \"fas fa-play-circle\",\n\t\t\t\"fas-f1e6\" => \"fas fa-plug\",\n\t\t\t\"fas-f067\" => \"fas fa-plus\",\n\t\t\t\"fas-f055\" => \"fas fa-plus-circle\",\n\t\t\t\"fas-f0fe\" => \"fas fa-plus-square\",\n\t\t\t\"fas-f2ce\" => \"fas fa-podcast\",\n\t\t\t\"fas-f681\" => \"fas fa-poll\",\n\t\t\t\"fas-f682\" => \"fas fa-poll-h\",\n\t\t\t\"fas-f2fe\" => \"fas fa-poo\",\n\t\t\t\"fas-f75a\" => \"fas fa-poo-storm\",\n\t\t\t\"fas-f619\" => \"fas fa-poop\",\n\t\t\t\"fas-f3e0\" => \"fas fa-portrait\",\n\t\t\t\"fas-f154\" => \"fas fa-pound-sign\",\n\t\t\t\"fas-f011\" => \"fas fa-power-off\",\n\t\t\t\"fas-f683\" => \"fas fa-pray\",\n\t\t\t\"fas-f684\" => \"fas fa-praying-hands\",\n\t\t\t\"fas-f5b1\" => \"fas fa-prescription\",\n\t\t\t\"fas-f485\" => \"fas fa-prescription-bottle\",\n\t\t\t\"fas-f486\" => \"fas fa-prescription-bottle-alt\",\n\t\t\t\"fas-f02f\" => \"fas fa-print\",\n\t\t\t\"fas-f487\" => \"fas fa-procedures\",\n\t\t\t\"fas-f542\" => \"fas fa-project-diagram\",\n\t\t\t\"fas-f96a\" => \"fas fa-pump-medical\",\n\t\t\t\"fas-f96b\" => \"fas fa-pump-soap\",\n\t\t\t\"fas-f12e\" => \"fas fa-puzzle-piece\",\n\t\t\t\"fas-f029\" => \"fas fa-qrcode\",\n\t\t\t\"fas-f128\" => \"fas fa-question\",\n\t\t\t\"fas-f059\" => \"fas fa-question-circle\",\n\t\t\t\"fas-f458\" => \"fas fa-quidditch\",\n\t\t\t\"fas-f10d\" => \"fas fa-quote-left\",\n\t\t\t\"fas-f10e\" => \"fas fa-quote-right\",\n\t\t\t\"fas-f687\" => \"fas fa-quran\",\n\t\t\t\"fas-f7b9\" => \"fas fa-radiation\",\n\t\t\t\"fas-f7ba\" => \"fas fa-radiation-alt\",\n\t\t\t\"fas-f75b\" => \"fas fa-rainbow\",\n\t\t\t\"fas-f074\" => \"fas fa-random\",\n\t\t\t\"fas-f543\" => \"fas fa-receipt\",\n\t\t\t\"fas-f8d9\" => \"fas fa-record-vinyl\",\n\t\t\t\"fas-f1b8\" => \"fas fa-recycle\",\n\t\t\t\"fas-f01e\" => \"fas fa-redo\",\n\t\t\t\"fas-f2f9\" => \"fas fa-redo-alt\",\n\t\t\t\"fas-f25d\" => \"fas fa-registered\",\n\t\t\t\"fas-f87d\" => \"fas fa-remove-format\",\n\t\t\t\"fas-f3e5\" => \"fas fa-reply\",\n\t\t\t\"fas-f122\" => \"fas fa-reply-all\",\n\t\t\t\"fas-f75e\" => \"fas fa-republican\",\n\t\t\t\"fas-f7bd\" => \"fas fa-restroom\",\n\t\t\t\"fas-f079\" => \"fas fa-retweet\",\n\t\t\t\"fas-f4d6\" => \"fas fa-ribbon\",\n\t\t\t\"fas-f70b\" => \"fas fa-ring\",\n\t\t\t\"fas-f018\" => \"fas fa-road\",\n\t\t\t\"fas-f544\" => \"fas fa-robot\",\n\t\t\t\"fas-f135\" => \"fas fa-rocket\",\n\t\t\t\"fas-f4d7\" => \"fas fa-route\",\n\t\t\t\"fas-f09e\" => \"fas fa-rss\",\n\t\t\t\"fas-f143\" => \"fas fa-rss-square\",\n\t\t\t\"fas-f158\" => \"fas fa-ruble-sign\",\n\t\t\t\"fas-f545\" => \"fas fa-ruler\",\n\t\t\t\"fas-f546\" => \"fas fa-ruler-combined\",\n\t\t\t\"fas-f547\" => \"fas fa-ruler-horizontal\",\n\t\t\t\"fas-f548\" => \"fas fa-ruler-vertical\",\n\t\t\t\"fas-f70c\" => \"fas fa-running\",\n\t\t\t\"fas-f156\" => \"fas fa-rupee-sign\",\n\t\t\t\"fas-f5b3\" => \"fas fa-sad-cry\",\n\t\t\t\"fas-f5b4\" => \"fas fa-sad-tear\",\n\t\t\t\"fas-f7bf\" => \"fas fa-satellite\",\n\t\t\t\"fas-f7c0\" => \"fas fa-satellite-dish\",\n\t\t\t\"fas-f0c7\" => \"fas fa-save\",\n\t\t\t\"fas-f549\" => \"fas fa-school\",\n\t\t\t\"fas-f54a\" => \"fas fa-screwdriver\",\n\t\t\t\"fas-f70e\" => \"fas fa-scroll\",\n\t\t\t\"fas-f7c2\" => \"fas fa-sd-card\",\n\t\t\t\"fas-f002\" => \"fas fa-search\",\n\t\t\t\"fas-f688\" => \"fas fa-search-dollar\",\n\t\t\t\"fas-f689\" => \"fas fa-search-location\",\n\t\t\t\"fas-f010\" => \"fas fa-search-minus\",\n\t\t\t\"fas-f00e\" => \"fas fa-search-plus\",\n\t\t\t\"fas-f4d8\" => \"fas fa-seedling\",\n\t\t\t\"fas-f233\" => \"fas fa-server\",\n\t\t\t\"fas-f61f\" => \"fas fa-shapes\",\n\t\t\t\"fas-f064\" => \"fas fa-share\",\n\t\t\t\"fas-f1e0\" => \"fas fa-share-alt\",\n\t\t\t\"fas-f1e1\" => \"fas fa-share-alt-square\",\n\t\t\t\"fas-f14d\" => \"fas fa-share-square\",\n\t\t\t\"fas-f20b\" => \"fas fa-shekel-sign\",\n\t\t\t\"fas-f3ed\" => \"fas fa-shield-alt\",\n\t\t\t\"fas-f96c\" => \"fas fa-shield-virus\",\n\t\t\t\"fas-f21a\" => \"fas fa-ship\",\n\t\t\t\"fas-f48b\" => \"fas fa-shipping-fast\",\n\t\t\t\"fas-f54b\" => \"fas fa-shoe-prints\",\n\t\t\t\"fas-f290\" => \"fas fa-shopping-bag\",\n\t\t\t\"fas-f291\" => \"fas fa-shopping-basket\",\n\t\t\t\"fas-f07a\" => \"fas fa-shopping-cart\",\n\t\t\t\"fas-f2cc\" => \"fas fa-shower\",\n\t\t\t\"fas-f5b6\" => \"fas fa-shuttle-van\",\n\t\t\t\"fas-f4d9\" => \"fas fa-sign\",\n\t\t\t\"fas-f2f6\" => \"fas fa-sign-in-alt\",\n\t\t\t\"fas-f2a7\" => \"fas fa-sign-language\",\n\t\t\t\"fas-f2f5\" => \"fas fa-sign-out-alt\",\n\t\t\t\"fas-f012\" => \"fas fa-signal\",\n\t\t\t\"fas-f5b7\" => \"fas fa-signature\",\n\t\t\t\"fas-f7c4\" => \"fas fa-sim-card\",\n\t\t\t\"fas-f0e8\" => \"fas fa-sitemap\",\n\t\t\t\"fas-f7c5\" => \"fas fa-skating\",\n\t\t\t\"fas-f7c9\" => \"fas fa-skiing\",\n\t\t\t\"fas-f7ca\" => \"fas fa-skiing-nordic\",\n\t\t\t\"fas-f54c\" => \"fas fa-skull\",\n\t\t\t\"fas-f714\" => \"fas fa-skull-crossbones\",\n\t\t\t\"fas-f715\" => \"fas fa-slash\",\n\t\t\t\"fas-f7cc\" => \"fas fa-sleigh\",\n\t\t\t\"fas-f1de\" => \"fas fa-sliders-h\",\n\t\t\t\"fas-f118\" => \"fas fa-smile\",\n\t\t\t\"fas-f5b8\" => \"fas fa-smile-beam\",\n\t\t\t\"fas-f4da\" => \"fas fa-smile-wink\",\n\t\t\t\"fas-f75f\" => \"fas fa-smog\",\n\t\t\t\"fas-f48d\" => \"fas fa-smoking\",\n\t\t\t\"fas-f54d\" => \"fas fa-smoking-ban\",\n\t\t\t\"fas-f7cd\" => \"fas fa-sms\",\n\t\t\t\"fas-f7ce\" => \"fas fa-snowboarding\",\n\t\t\t\"fas-f2dc\" => \"fas fa-snowflake\",\n\t\t\t\"fas-f7d0\" => \"fas fa-snowman\",\n\t\t\t\"fas-f7d2\" => \"fas fa-snowplow\",\n\t\t\t\"fas-f96e\" => \"fas fa-soap\",\n\t\t\t\"fas-f696\" => \"fas fa-socks\",\n\t\t\t\"fas-f5ba\" => \"fas fa-solar-panel\",\n\t\t\t\"fas-f0dc\" => \"fas fa-sort\",\n\t\t\t\"fas-f15d\" => \"fas fa-sort-alpha-down\",\n\t\t\t\"fas-f881\" => \"fas fa-sort-alpha-down-alt\",\n\t\t\t\"fas-f15e\" => \"fas fa-sort-alpha-up\",\n\t\t\t\"fas-f882\" => \"fas fa-sort-alpha-up-alt\",\n\t\t\t\"fas-f160\" => \"fas fa-sort-amount-down\",\n\t\t\t\"fas-f884\" => \"fas fa-sort-amount-down-alt\",\n\t\t\t\"fas-f161\" => \"fas fa-sort-amount-up\",\n\t\t\t\"fas-f885\" => \"fas fa-sort-amount-up-alt\",\n\t\t\t\"fas-f0dd\" => \"fas fa-sort-down\",\n\t\t\t\"fas-f162\" => \"fas fa-sort-numeric-down\",\n\t\t\t\"fas-f886\" => \"fas fa-sort-numeric-down-alt\",\n\t\t\t\"fas-f163\" => \"fas fa-sort-numeric-up\",\n\t\t\t\"fas-f887\" => \"fas fa-sort-numeric-up-alt\",\n\t\t\t\"fas-f0de\" => \"fas fa-sort-up\",\n\t\t\t\"fas-f5bb\" => \"fas fa-spa\",\n\t\t\t\"fas-f197\" => \"fas fa-space-shuttle\",\n\t\t\t\"fas-f891\" => \"fas fa-spell-check\",\n\t\t\t\"fas-f717\" => \"fas fa-spider\",\n\t\t\t\"fas-f110\" => \"fas fa-spinner\",\n\t\t\t\"fas-f5bc\" => \"fas fa-splotch\",\n\t\t\t\"fas-f5bd\" => \"fas fa-spray-can\",\n\t\t\t\"fas-f0c8\" => \"fas fa-square\",\n\t\t\t\"fas-f45c\" => \"fas fa-square-full\",\n\t\t\t\"fas-f698\" => \"fas fa-square-root-alt\",\n\t\t\t\"fas-f5bf\" => \"fas fa-stamp\",\n\t\t\t\"fas-f005\" => \"fas fa-star\",\n\t\t\t\"fas-f699\" => \"fas fa-star-and-crescent\",\n\t\t\t\"fas-f089\" => \"fas fa-star-half\",\n\t\t\t\"fas-f5c0\" => \"fas fa-star-half-alt\",\n\t\t\t\"fas-f69a\" => \"fas fa-star-of-david\",\n\t\t\t\"fas-f621\" => \"fas fa-star-of-life\",\n\t\t\t\"fas-f048\" => \"fas fa-step-backward\",\n\t\t\t\"fas-f051\" => \"fas fa-step-forward\",\n\t\t\t\"fas-f0f1\" => \"fas fa-stethoscope\",\n\t\t\t\"fas-f249\" => \"fas fa-sticky-note\",\n\t\t\t\"fas-f04d\" => \"fas fa-stop\",\n\t\t\t\"fas-f28d\" => \"fas fa-stop-circle\",\n\t\t\t\"fas-f2f2\" => \"fas fa-stopwatch\",\n\t\t\t\"fas-f96f\" => \"fas fa-stopwatch-20\",\n\t\t\t\"fas-f54e\" => \"fas fa-store\",\n\t\t\t\"fas-f54f\" => \"fas fa-store-alt\",\n\t\t\t\"fas-f970\" => \"fas fa-store-alt-slash\",\n\t\t\t\"fas-f971\" => \"fas fa-store-slash\",\n\t\t\t\"fas-f550\" => \"fas fa-stream\",\n\t\t\t\"fas-f21d\" => \"fas fa-street-view\",\n\t\t\t\"fas-f0cc\" => \"fas fa-strikethrough\",\n\t\t\t\"fas-f551\" => \"fas fa-stroopwafel\",\n\t\t\t\"fas-f12c\" => \"fas fa-subscript\",\n\t\t\t\"fas-f239\" => \"fas fa-subway\",\n\t\t\t\"fas-f0f2\" => \"fas fa-suitcase\",\n\t\t\t\"fas-f5c1\" => \"fas fa-suitcase-rolling\",\n\t\t\t\"fas-f185\" => \"fas fa-sun\",\n\t\t\t\"fas-f12b\" => \"fas fa-superscript\",\n\t\t\t\"fas-f5c2\" => \"fas fa-surprise\",\n\t\t\t\"fas-f5c3\" => \"fas fa-swatchbook\",\n\t\t\t\"fas-f5c4\" => \"fas fa-swimmer\",\n\t\t\t\"fas-f5c5\" => \"fas fa-swimming-pool\",\n\t\t\t\"fas-f69b\" => \"fas fa-synagogue\",\n\t\t\t\"fas-f021\" => \"fas fa-sync\",\n\t\t\t\"fas-f2f1\" => \"fas fa-sync-alt\",\n\t\t\t\"fas-f48e\" => \"fas fa-syringe\",\n\t\t\t\"fas-f0ce\" => \"fas fa-table\",\n\t\t\t\"fas-f45d\" => \"fas fa-table-tennis\",\n\t\t\t\"fas-f10a\" => \"fas fa-tablet\",\n\t\t\t\"fas-f3fa\" => \"fas fa-tablet-alt\",\n\t\t\t\"fas-f490\" => \"fas fa-tablets\",\n\t\t\t\"fas-f3fd\" => \"fas fa-tachometer-alt\",\n\t\t\t\"fas-f02b\" => \"fas fa-tag\",\n\t\t\t\"fas-f02c\" => \"fas fa-tags\",\n\t\t\t\"fas-f4db\" => \"fas fa-tape\",\n\t\t\t\"fas-f0ae\" => \"fas fa-tasks\",\n\t\t\t\"fas-f1ba\" => \"fas fa-taxi\",\n\t\t\t\"fas-f62e\" => \"fas fa-teeth\",\n\t\t\t\"fas-f62f\" => \"fas fa-teeth-open\",\n\t\t\t\"fas-f769\" => \"fas fa-temperature-high\",\n\t\t\t\"fas-f76b\" => \"fas fa-temperature-low\",\n\t\t\t\"fas-f7d7\" => \"fas fa-tenge\",\n\t\t\t\"fas-f120\" => \"fas fa-terminal\",\n\t\t\t\"fas-f034\" => \"fas fa-text-height\",\n\t\t\t\"fas-f035\" => \"fas fa-text-width\",\n\t\t\t\"fas-f00a\" => \"fas fa-th\",\n\t\t\t\"fas-f009\" => \"fas fa-th-large\",\n\t\t\t\"fas-f00b\" => \"fas fa-th-list\",\n\t\t\t\"fas-f630\" => \"fas fa-theater-masks\",\n\t\t\t\"fas-f491\" => \"fas fa-thermometer\",\n\t\t\t\"fas-f2cb\" => \"fas fa-thermometer-empty\",\n\t\t\t\"fas-f2c7\" => \"fas fa-thermometer-full\",\n\t\t\t\"fas-f2c9\" => \"fas fa-thermometer-half\",\n\t\t\t\"fas-f2ca\" => \"fas fa-thermometer-quarter\",\n\t\t\t\"fas-f2c8\" => \"fas fa-thermometer-three-quarters\",\n\t\t\t\"fas-f165\" => \"fas fa-thumbs-down\",\n\t\t\t\"fas-f164\" => \"fas fa-thumbs-up\",\n\t\t\t\"fas-f08d\" => \"fas fa-thumbtack\",\n\t\t\t\"fas-f3ff\" => \"fas fa-ticket-alt\",\n\t\t\t\"fas-f00d\" => \"fas fa-times\",\n\t\t\t\"fas-f057\" => \"fas fa-times-circle\",\n\t\t\t\"fas-f043\" => \"fas fa-tint\",\n\t\t\t\"fas-f5c7\" => \"fas fa-tint-slash\",\n\t\t\t\"fas-f5c8\" => \"fas fa-tired\",\n\t\t\t\"fas-f204\" => \"fas fa-toggle-off\",\n\t\t\t\"fas-f205\" => \"fas fa-toggle-on\",\n\t\t\t\"fas-f7d8\" => \"fas fa-toilet\",\n\t\t\t\"fas-f71e\" => \"fas fa-toilet-paper\",\n\t\t\t\"fas-f972\" => \"fas fa-toilet-paper-slash\",\n\t\t\t\"fas-f552\" => \"fas fa-toolbox\",\n\t\t\t\"fas-f7d9\" => \"fas fa-tools\",\n\t\t\t\"fas-f5c9\" => \"fas fa-tooth\",\n\t\t\t\"fas-f6a0\" => \"fas fa-torah\",\n\t\t\t\"fas-f6a1\" => \"fas fa-torii-gate\",\n\t\t\t\"fas-f722\" => \"fas fa-tractor\",\n\t\t\t\"fas-f25c\" => \"fas fa-trademark\",\n\t\t\t\"fas-f637\" => \"fas fa-traffic-light\",\n\t\t\t\"fas-f941\" => \"fas fa-trailer\",\n\t\t\t\"fas-f238\" => \"fas fa-train\",\n\t\t\t\"fas-f7da\" => \"fas fa-tram\",\n\t\t\t\"fas-f224\" => \"fas fa-transgender\",\n\t\t\t\"fas-f225\" => \"fas fa-transgender-alt\",\n\t\t\t\"fas-f1f8\" => \"fas fa-trash\",\n\t\t\t\"fas-f2ed\" => \"fas fa-trash-alt\",\n\t\t\t\"fas-f829\" => \"fas fa-trash-restore\",\n\t\t\t\"fas-f82a\" => \"fas fa-trash-restore-alt\",\n\t\t\t\"fas-f1bb\" => \"fas fa-tree\",\n\t\t\t\"fas-f091\" => \"fas fa-trophy\",\n\t\t\t\"fas-f0d1\" => \"fas fa-truck\",\n\t\t\t\"fas-f4de\" => \"fas fa-truck-loading\",\n\t\t\t\"fas-f63b\" => \"fas fa-truck-monster\",\n\t\t\t\"fas-f4df\" => \"fas fa-truck-moving\",\n\t\t\t\"fas-f63c\" => \"fas fa-truck-pickup\",\n\t\t\t\"fas-f553\" => \"fas fa-tshirt\",\n\t\t\t\"fas-f1e4\" => \"fas fa-tty\",\n\t\t\t\"fas-f26c\" => \"fas fa-tv\",\n\t\t\t\"fas-f0e9\" => \"fas fa-umbrella\",\n\t\t\t\"fas-f5ca\" => \"fas fa-umbrella-beach\",\n\t\t\t\"fas-f0cd\" => \"fas fa-underline\",\n\t\t\t\"fas-f0e2\" => \"fas fa-undo\",\n\t\t\t\"fas-f2ea\" => \"fas fa-undo-alt\",\n\t\t\t\"fas-f29a\" => \"fas fa-universal-access\",\n\t\t\t\"fas-f19c\" => \"fas fa-university\",\n\t\t\t\"fas-f127\" => \"fas fa-unlink\",\n\t\t\t\"fas-f09c\" => \"fas fa-unlock\",\n\t\t\t\"fas-f13e\" => \"fas fa-unlock-alt\",\n\t\t\t\"fas-f093\" => \"fas fa-upload\",\n\t\t\t\"fas-f007\" => \"fas fa-user\",\n\t\t\t\"fas-f406\" => \"fas fa-user-alt\",\n\t\t\t\"fas-f4fa\" => \"fas fa-user-alt-slash\",\n\t\t\t\"fas-f4fb\" => \"fas fa-user-astronaut\",\n\t\t\t\"fas-f4fc\" => \"fas fa-user-check\",\n\t\t\t\"fas-f2bd\" => \"fas fa-user-circle\",\n\t\t\t\"fas-f4fd\" => \"fas fa-user-clock\",\n\t\t\t\"fas-f4fe\" => \"fas fa-user-cog\",\n\t\t\t\"fas-f4ff\" => \"fas fa-user-edit\",\n\t\t\t\"fas-f500\" => \"fas fa-user-friends\",\n\t\t\t\"fas-f501\" => \"fas fa-user-graduate\",\n\t\t\t\"fas-f728\" => \"fas fa-user-injured\",\n\t\t\t\"fas-f502\" => \"fas fa-user-lock\",\n\t\t\t\"fas-f0f0\" => \"fas fa-user-md\",\n\t\t\t\"fas-f503\" => \"fas fa-user-minus\",\n\t\t\t\"fas-f504\" => \"fas fa-user-ninja\",\n\t\t\t\"fas-f82f\" => \"fas fa-user-nurse\",\n\t\t\t\"fas-f234\" => \"fas fa-user-plus\",\n\t\t\t\"fas-f21b\" => \"fas fa-user-secret\",\n\t\t\t\"fas-f505\" => \"fas fa-user-shield\",\n\t\t\t\"fas-f506\" => \"fas fa-user-slash\",\n\t\t\t\"fas-f507\" => \"fas fa-user-tag\",\n\t\t\t\"fas-f508\" => \"fas fa-user-tie\",\n\t\t\t\"fas-f235\" => \"fas fa-user-times\",\n\t\t\t\"fas-f0c0\" => \"fas fa-users\",\n\t\t\t\"fas-f509\" => \"fas fa-users-cog\",\n\t\t\t\"fas-f2e5\" => \"fas fa-utensil-spoon\",\n\t\t\t\"fas-f2e7\" => \"fas fa-utensils\",\n\t\t\t\"fas-f5cb\" => \"fas fa-vector-square\",\n\t\t\t\"fas-f221\" => \"fas fa-venus\",\n\t\t\t\"fas-f226\" => \"fas fa-venus-double\",\n\t\t\t\"fas-f228\" => \"fas fa-venus-mars\",\n\t\t\t\"fas-f492\" => \"fas fa-vial\",\n\t\t\t\"fas-f493\" => \"fas fa-vials\",\n\t\t\t\"fas-f03d\" => \"fas fa-video\",\n\t\t\t\"fas-f4e2\" => \"fas fa-video-slash\",\n\t\t\t\"fas-f6a7\" => \"fas fa-vihara\",\n\t\t\t\"fas-f974\" => \"fas fa-virus\",\n\t\t\t\"fas-f975\" => \"fas fa-virus-slash\",\n\t\t\t\"fas-f976\" => \"fas fa-viruses\",\n\t\t\t\"fas-f897\" => \"fas fa-voicemail\",\n\t\t\t\"fas-f45f\" => \"fas fa-volleyball-ball\",\n\t\t\t\"fas-f027\" => \"fas fa-volume-down\",\n\t\t\t\"fas-f6a9\" => \"fas fa-volume-mute\",\n\t\t\t\"fas-f026\" => \"fas fa-volume-off\",\n\t\t\t\"fas-f028\" => \"fas fa-volume-up\",\n\t\t\t\"fas-f772\" => \"fas fa-vote-yea\",\n\t\t\t\"fas-f729\" => \"fas fa-vr-cardboard\",\n\t\t\t\"fas-f554\" => \"fas fa-walking\",\n\t\t\t\"fas-f555\" => \"fas fa-wallet\",\n\t\t\t\"fas-f494\" => \"fas fa-warehouse\",\n\t\t\t\"fas-f773\" => \"fas fa-water\",\n\t\t\t\"fas-f83e\" => \"fas fa-wave-square\",\n\t\t\t\"fas-f496\" => \"fas fa-weight\",\n\t\t\t\"fas-f5cd\" => \"fas fa-weight-hanging\",\n\t\t\t\"fas-f193\" => \"fas fa-wheelchair\",\n\t\t\t\"fas-f1eb\" => \"fas fa-wifi\",\n\t\t\t\"fas-f72e\" => \"fas fa-wind\",\n\t\t\t\"fas-f410\" => \"fas fa-window-close\",\n\t\t\t\"fas-f2d0\" => \"fas fa-window-maximize\",\n\t\t\t\"fas-f2d1\" => \"fas fa-window-minimize\",\n\t\t\t\"fas-f2d2\" => \"fas fa-window-restore\",\n\t\t\t\"fas-f72f\" => \"fas fa-wine-bottle\",\n\t\t\t\"fas-f4e3\" => \"fas fa-wine-glass\",\n\t\t\t\"fas-f5ce\" => \"fas fa-wine-glass-alt\",\n\t\t\t\"fas-f159\" => \"fas fa-won-sign\",\n\t\t\t\"fas-f0ad\" => \"fas fa-wrench\",\n\t\t\t\"fas-f497\" => \"fas fa-x-ray\",\n\t\t\t\"fas-f157\" => \"fas fa-yen-sign\",\n\t\t\t\"fas-f6ad\" => \"fas fa-yin-y\"\n\t\t);\n\n\t\t$regular_icons = array(\t\n\t\t\t\"far-f2b9\" => \"far fa-address-book\",\n\t\t\t\"far-f2bb\" => \"far fa-address-card\",\n\t\t\t\"far-f556\" => \"far fa-angry\",\n\t\t\t\"far-f358\" => \"far fa-arrow-alt-circle-down\",\n\t\t\t\"far-f359\" => \"far fa-arrow-alt-circle-left\",\n\t\t\t\"far-f35a\" => \"far fa-arrow-alt-circle-right\",\n\t\t\t\"far-f35b\" => \"far fa-arrow-alt-circle-up\",\n\t\t\t\"far-f0f3\" => \"far fa-bell\",\n\t\t\t\"far-f1f6\" => \"far fa-bell-slash\",\n\t\t\t\"far-f02e\" => \"far fa-bookmark\",\n\t\t\t\"far-f1ad\" => \"far fa-building\",\n\t\t\t\"far-f133\" => \"far fa-calendar\",\n\t\t\t\"far-f073\" => \"far fa-calendar-alt\",\n\t\t\t\"far-f274\" => \"far fa-calendar-check\",\n\t\t\t\"far-f272\" => \"far fa-calendar-minus\",\n\t\t\t\"far-f271\" => \"far fa-calendar-plus\",\n\t\t\t\"far-f273\" => \"far fa-calendar-times\",\n\t\t\t\"far-f150\" => \"far fa-caret-square-down\",\n\t\t\t\"far-f191\" => \"far fa-caret-square-left\",\n\t\t\t\"far-f152\" => \"far fa-caret-square-right\",\n\t\t\t\"far-f151\" => \"far fa-caret-square-up\",\n\t\t\t\"far-f080\" => \"far fa-chart-bar\",\n\t\t\t\"far-f058\" => \"far fa-check-circle\",\n\t\t\t\"far-f14a\" => \"far fa-check-square\",\n\t\t\t\"far-f111\" => \"far fa-circle\",\n\t\t\t\"far-f328\" => \"far fa-clipboard\",\n\t\t\t\"far-f017\" => \"far fa-clock\",\n\t\t\t\"far-f24d\" => \"far fa-clone\",\n\t\t\t\"far-f20a\" => \"far fa-closed-captioning\",\n\t\t\t\"far-f075\" => \"far fa-comment\",\n\t\t\t\"far-f27a\" => \"far fa-comment-alt\",\n\t\t\t\"far-f4ad\" => \"far fa-comment-dots\",\n\t\t\t\"far-f086\" => \"far fa-comments\",\n\t\t\t\"far-f14e\" => \"far fa-compass\",\n\t\t\t\"far-f0c5\" => \"far fa-copy\",\n\t\t\t\"far-f1f9\" => \"far fa-copyright\",\n\t\t\t\"far-f09d\" => \"far fa-credit-card\",\n\t\t\t\"far-f567\" => \"far fa-dizzy\",\n\t\t\t\"far-f192\" => \"far fa-dot-circle\",\n\t\t\t\"far-f044\" => \"far fa-edit\",\n\t\t\t\"far-f0e0\" => \"far fa-envelope\",\n\t\t\t\"far-f2b6\" => \"far fa-envelope-open\",\n\t\t\t\"far-f06e\" => \"far fa-eye\",\n\t\t\t\"far-f070\" => \"far fa-eye-slash\",\n\t\t\t\"far-f15b\" => \"far fa-file\",\n\t\t\t\"far-f15c\" => \"far fa-file-alt\",\n\t\t\t\"far-f1c6\" => \"far fa-file-archive\",\n\t\t\t\"far-f1c7\" => \"far fa-file-audio\",\n\t\t\t\"far-f1c9\" => \"far fa-file-code\",\n\t\t\t\"far-f1c3\" => \"far fa-file-excel\",\n\t\t\t\"far-f1c5\" => \"far fa-file-image\",\n\t\t\t\"far-f1c1\" => \"far fa-file-pdf\",\n\t\t\t\"far-f1c4\" => \"far fa-file-powerpoint\",\n\t\t\t\"far-f1c8\" => \"far fa-file-video\",\n\t\t\t\"far-f1c2\" => \"far fa-file-word\",\n\t\t\t\"far-f024\" => \"far fa-flag\",\n\t\t\t\"far-f579\" => \"far fa-flushed\",\n\t\t\t\"far-f07b\" => \"far fa-folder\",\n\t\t\t\"far-f07c\" => \"far fa-folder-open\",\n\t\t\t\"far-f119\" => \"far fa-frown\",\n\t\t\t\"far-f57a\" => \"far fa-frown-open\",\n\t\t\t\"far-f1e3\" => \"far fa-futbol\",\n\t\t\t\"far-f3a5\" => \"far fa-gem\",\n\t\t\t\"far-f57f\" => \"far fa-grimace\",\n\t\t\t\"far-f580\" => \"far fa-grin\",\n\t\t\t\"far-f581\" => \"far fa-grin-alt\",\n\t\t\t\"far-f582\" => \"far fa-grin-beam\",\n\t\t\t\"far-f583\" => \"far fa-grin-beam-sweat\",\n\t\t\t\"far-f584\" => \"far fa-grin-hearts\",\n\t\t\t\"far-f585\" => \"far fa-grin-squint\",\n\t\t\t\"far-f586\" => \"far fa-grin-squint-tears\",\n\t\t\t\"far-f587\" => \"far fa-grin-stars\",\n\t\t\t\"far-f588\" => \"far fa-grin-tears\",\n\t\t\t\"far-f589\" => \"far fa-grin-tongue\",\n\t\t\t\"far-f58a\" => \"far fa-grin-tongue-squint\",\n\t\t\t\"far-f58b\" => \"far fa-grin-tongue-wink\",\n\t\t\t\"far-f58c\" => \"far fa-grin-wink\",\n\t\t\t\"far-f258\" => \"far fa-hand-lizard\",\n\t\t\t\"far-f256\" => \"far fa-hand-paper\",\n\t\t\t\"far-f25b\" => \"far fa-hand-peace\",\n\t\t\t\"far-f0a7\" => \"far fa-hand-point-down\",\n\t\t\t\"far-f0a5\" => \"far fa-hand-point-left\",\n\t\t\t\"far-f0a4\" => \"far fa-hand-point-right\",\n\t\t\t\"far-f0a6\" => \"far fa-hand-point-up\",\n\t\t\t\"far-f25a\" => \"far fa-hand-pointer\",\n\t\t\t\"far-f255\" => \"far fa-hand-rock\",\n\t\t\t\"far-f257\" => \"far fa-hand-scissors\",\n\t\t\t\"far-f259\" => \"far fa-hand-spock\",\n\t\t\t\"far-f2b5\" => \"far fa-handshake\",\n\t\t\t\"far-f0a0\" => \"far fa-hdd\",\n\t\t\t\"far-f004\" => \"far fa-heart\",\n\t\t\t\"far-f0f8\" => \"far fa-hospital\",\n\t\t\t\"far-f254\" => \"far fa-hourglass\",\n\t\t\t\"far-f2c1\" => \"far fa-id-badge\",\n\t\t\t\"far-f2c2\" => \"far fa-id-card\",\n\t\t\t\"far-f03e\" => \"far fa-image\",\n\t\t\t\"far-f302\" => \"far fa-images\",\n\t\t\t\"far-f11c\" => \"far fa-keyboard\",\n\t\t\t\"far-f596\" => \"far fa-kiss\",\n\t\t\t\"far-f597\" => \"far fa-kiss-beam\",\n\t\t\t\"far-f598\" => \"far fa-kiss-wink-heart\",\n\t\t\t\"far-f599\" => \"far fa-laugh\",\n\t\t\t\"far-f59a\" => \"far fa-laugh-beam\",\n\t\t\t\"far-f59b\" => \"far fa-laugh-squint\",\n\t\t\t\"far-f59c\" => \"far fa-laugh-wink\",\n\t\t\t\"far-f094\" => \"far fa-lemon\",\n\t\t\t\"far-f1cd\" => \"far fa-life-ring\",\n\t\t\t\"far-f0eb\" => \"far fa-lightbulb\",\n\t\t\t\"far-f022\" => \"far fa-list-alt\",\n\t\t\t\"far-f279\" => \"far fa-map\",\n\t\t\t\"far-f11a\" => \"far fa-meh\",\n\t\t\t\"far-f5a4\" => \"far fa-meh-blank\",\n\t\t\t\"far-f5a5\" => \"far fa-meh-rolling-eyes\",\n\t\t\t\"far-f146\" => \"far fa-minus-square\",\n\t\t\t\"far-f3d1\" => \"far fa-money-bill-alt\",\n\t\t\t\"far-f186\" => \"far fa-moon\",\n\t\t\t\"far-f1ea\" => \"far fa-newspaper\",\n\t\t\t\"far-f247\" => \"far fa-object-group\",\n\t\t\t\"far-f248\" => \"far fa-object-ungroup\",\n\t\t\t\"far-f1d8\" => \"far fa-paper-plane\",\n\t\t\t\"far-f28b\" => \"far fa-pause-circle\",\n\t\t\t\"far-f144\" => \"far fa-play-circle\",\n\t\t\t\"far-f0fe\" => \"far fa-plus-square\",\n\t\t\t\"far-f059\" => \"far fa-question-circle\",\n\t\t\t\"far-f25d\" => \"far fa-registered\",\n\t\t\t\"far-f5b3\" => \"far fa-sad-cry\",\n\t\t\t\"far-f5b4\" => \"far fa-sad-tear\",\n\t\t\t\"far-f0c7\" => \"far fa-save\",\n\t\t\t\"far-f14d\" => \"far fa-share-square\",\n\t\t\t\"far-f118\" => \"far fa-smile\",\n\t\t\t\"far-f5b8\" => \"far fa-smile-beam\",\n\t\t\t\"far-f4da\" => \"far fa-smile-wink\",\n\t\t\t\"far-f2dc\" => \"far fa-snowflake\",\n\t\t\t\"far-f0c8\" => \"far fa-square\",\n\t\t\t\"far-f005\" => \"far fa-star\",\n\t\t\t\"far-f089\" => \"far fa-star-half\",\n\t\t\t\"far-f249\" => \"far fa-sticky-note\",\n\t\t\t\"far-f28d\" => \"far fa-stop-circle\",\n\t\t\t\"far-f185\" => \"far fa-sun\",\n\t\t\t\"far-f5c2\" => \"far fa-surprise\",\n\t\t\t\"far-f165\" => \"far fa-thumbs-down\",\n\t\t\t\"far-f164\" => \"far fa-thumbs-up\",\n\t\t\t\"far-f057\" => \"far fa-times-circle\",\n\t\t\t\"far-f5c8\" => \"far fa-tired\",\n\t\t\t\"far-f2ed\" => \"far fa-trash-alt\",\n\t\t\t\"far-f007\" => \"far fa-user\",\n\t\t\t\"far-f2bd\" => \"far fa-user-circle\",\n\t\t\t\"far-f410\" => \"far fa-window-close\",\n\t\t\t\"far-f2d0\" => \"far fa-window-maximize\",\n\t\t\t\"far-f2d1\" => \"far fa-window-minimize\",\n\t\t\t\"far-f2d2\" => \"far fa-window-rest\"\n\t\t);\n\n\t\t$brand_icons = array(\n\t\t\t\"fab-f26e\" => \"fab fa-500px\",\n\t\t\t\"fab-f368\" => \"fab fa-accessible-icon\",\n\t\t\t\"fab-f369\" => \"fab fa-accusoft\",\n\t\t\t\"fab-f6af\" => \"fab fa-acquisitions-incorporated\",\n\t\t\t\"fab-f170\" => \"fab fa-adn\",\n\t\t\t\"fab-f778\" => \"fab fa-adobe\",\n\t\t\t\"fab-f36a\" => \"fab fa-adversal\",\n\t\t\t\"fab-f36b\" => \"fab fa-affiliatetheme\",\n\t\t\t\"fab-f834\" => \"fab fa-airbnb\",\n\t\t\t\"fab-f36c\" => \"fab fa-algolia\",\n\t\t\t\"fab-f642\" => \"fab fa-alipay\",\n\t\t\t\"fab-f270\" => \"fab fa-amazon\",\n\t\t\t\"fab-f42c\" => \"fab fa-amazon-pay\",\n\t\t\t\"fab-f36d\" => \"fab fa-amilia\",\n\t\t\t\"fab-f17b\" => \"fab fa-android\",\n\t\t\t\"fab-f209\" => \"fab fa-angellist\",\n\t\t\t\"fab-f36e\" => \"fab fa-angrycreative\",\n\t\t\t\"fab-f420\" => \"fab fa-angular\",\n\t\t\t\"fab-f36f\" => \"fab fa-app-store\",\n\t\t\t\"fab-f370\" => \"fab fa-app-store-ios\",\n\t\t\t\"fab-f371\" => \"fab fa-apper\",\n\t\t\t\"fab-f179\" => \"fab fa-apple\",\n\t\t\t\"fab-f415\" => \"fab fa-apple-pay\",\n\t\t\t\"fab-f77a\" => \"fab fa-artstation\",\n\t\t\t\"fab-f372\" => \"fab fa-asymmetrik\",\n\t\t\t\"fab-f77b\" => \"fab fa-atlassian\",\n\t\t\t\"fab-f373\" => \"fab fa-audible\",\n\t\t\t\"fab-f41c\" => \"fab fa-autoprefixer\",\n\t\t\t\"fab-f374\" => \"fab fa-avianex\",\n\t\t\t\"fab-f421\" => \"fab fa-aviato\",\n\t\t\t\"fab-f375\" => \"fab fa-aws\",\n\t\t\t\"fab-f2d5\" => \"fab fa-bandcamp\",\n\t\t\t\"fab-f835\" => \"fab fa-battle-net\",\n\t\t\t\"fab-f1b4\" => \"fab fa-behance\",\n\t\t\t\"fab-f1b5\" => \"fab fa-behance-square\",\n\t\t\t\"fab-f378\" => \"fab fa-bimobject\",\n\t\t\t\"fab-f171\" => \"fab fa-bitbucket\",\n\t\t\t\"fab-f379\" => \"fab fa-bitcoin\",\n\t\t\t\"fab-f37a\" => \"fab fa-bity\",\n\t\t\t\"fab-f27e\" => \"fab fa-black-tie\",\n\t\t\t\"fab-f37b\" => \"fab fa-blackberry\",\n\t\t\t\"fab-f37c\" => \"fab fa-blogger\",\n\t\t\t\"fab-f37d\" => \"fab fa-blogger-b\",\n\t\t\t\"fab-f293\" => \"fab fa-bluetooth\",\n\t\t\t\"fab-f294\" => \"fab fa-bluetooth-b\",\n\t\t\t\"fab-f836\" => \"fab fa-bootstrap\",\n\t\t\t\"fab-f15a\" => \"fab fa-btc\",\n\t\t\t\"fab-f837\" => \"fab fa-buffer\",\n\t\t\t\"fab-f37f\" => \"fab fa-buromobelexperte\",\n\t\t\t\"fab-f8a6\" => \"fab fa-buy-n-large\",\n\t\t\t\"fab-f20d\" => \"fab fa-buysellads\",\n\t\t\t\"fab-f785\" => \"fab fa-canadian-maple-leaf\",\n\t\t\t\"fab-f42d\" => \"fab fa-cc-amazon-pay\",\n\t\t\t\"fab-f1f3\" => \"fab fa-cc-amex\",\n\t\t\t\"fab-f416\" => \"fab fa-cc-apple-pay\",\n\t\t\t\"fab-f24c\" => \"fab fa-cc-diners-club\",\n\t\t\t\"fab-f1f2\" => \"fab fa-cc-discover\",\n\t\t\t\"fab-f24b\" => \"fab fa-cc-jcb\",\n\t\t\t\"fab-f1f1\" => \"fab fa-cc-mastercard\",\n\t\t\t\"fab-f1f4\" => \"fab fa-cc-paypal\",\n\t\t\t\"fab-f1f5\" => \"fab fa-cc-stripe\",\n\t\t\t\"fab-f1f0\" => \"fab fa-cc-visa\",\n\t\t\t\"fab-f380\" => \"fab fa-centercode\",\n\t\t\t\"fab-f789\" => \"fab fa-centos\",\n\t\t\t\"fab-f268\" => \"fab fa-chrome\",\n\t\t\t\"fab-f838\" => \"fab fa-chromecast\",\n\t\t\t\"fab-f383\" => \"fab fa-cloudscale\",\n\t\t\t\"fab-f384\" => \"fab fa-cloudsmith\",\n\t\t\t\"fab-f385\" => \"fab fa-cloudversify\",\n\t\t\t\"fab-f1cb\" => \"fab fa-codepen\",\n\t\t\t\"fab-f284\" => \"fab fa-codiepie\",\n\t\t\t\"fab-f78d\" => \"fab fa-confluence\",\n\t\t\t\"fab-f20e\" => \"fab fa-connectdevelop\",\n\t\t\t\"fab-f26d\" => \"fab fa-contao\",\n\t\t\t\"fab-f89e\" => \"fab fa-cotton-bureau\",\n\t\t\t\"fab-f388\" => \"fab fa-cpanel\",\n\t\t\t\"fab-f25e\" => \"fab fa-creative-commons\",\n\t\t\t\"fab-f4e7\" => \"fab fa-creative-commons-by\",\n\t\t\t\"fab-f4e8\" => \"fab fa-creative-commons-nc\",\n\t\t\t\"fab-f4e9\" => \"fab fa-creative-commons-nc-eu\",\n\t\t\t\"fab-f4ea\" => \"fab fa-creative-commons-nc-jp\",\n\t\t\t\"fab-f4eb\" => \"fab fa-creative-commons-nd\",\n\t\t\t\"fab-f4ec\" => \"fab fa-creative-commons-pd\",\n\t\t\t\"fab-f4ed\" => \"fab fa-creative-commons-pd-alt\",\n\t\t\t\"fab-f4ee\" => \"fab fa-creative-commons-remix\",\n\t\t\t\"fab-f4ef\" => \"fab fa-creative-commons-sa\",\n\t\t\t\"fab-f4f0\" => \"fab fa-creative-commons-sampling\",\n\t\t\t\"fab-f4f1\" => \"fab fa-creative-commons-sampling-plus\",\n\t\t\t\"fab-f4f2\" => \"fab fa-creative-commons-share\",\n\t\t\t\"fab-f4f3\" => \"fab fa-creative-commons-zero\",\n\t\t\t\"fab-f6c9\" => \"fab fa-critical-role\",\n\t\t\t\"fab-f13c\" => \"fab fa-css3\",\n\t\t\t\"fab-f38b\" => \"fab fa-css3-alt\",\n\t\t\t\"fab-f38c\" => \"fab fa-cuttlefish\",\n\t\t\t\"fab-f38d\" => \"fab fa-d-and-d\",\n\t\t\t\"fab-f6ca\" => \"fab fa-d-and-d-beyond\",\n\t\t\t\"fab-f952\" => \"fab fa-dailymotion\",\n\t\t\t\"fab-f210\" => \"fab fa-dashcube\",\n\t\t\t\"fab-f1a5\" => \"fab fa-delicious\",\n\t\t\t\"fab-f38e\" => \"fab fa-deploydog\",\n\t\t\t\"fab-f38f\" => \"fab fa-deskpro\",\n\t\t\t\"fab-f6cc\" => \"fab fa-dev\",\n\t\t\t\"fab-f1bd\" => \"fab fa-deviantart\",\n\t\t\t\"fab-f790\" => \"fab fa-dhl\",\n\t\t\t\"fab-f791\" => \"fab fa-diaspora\",\n\t\t\t\"fab-f1a6\" => \"fab fa-digg\",\n\t\t\t\"fab-f391\" => \"fab fa-digital-ocean\",\n\t\t\t\"fab-f392\" => \"fab fa-discord\",\n\t\t\t\"fab-f393\" => \"fab fa-discourse\",\n\t\t\t\"fab-f394\" => \"fab fa-dochub\",\n\t\t\t\"fab-f395\" => \"fab fa-docker\",\n\t\t\t\"fab-f396\" => \"fab fa-draft2digital\",\n\t\t\t\"fab-f17d\" => \"fab fa-dribbble\",\n\t\t\t\"fab-f397\" => \"fab fa-dribbble-square\",\n\t\t\t\"fab-f16b\" => \"fab fa-dropbox\",\n\t\t\t\"fab-f1a9\" => \"fab fa-drupal\",\n\t\t\t\"fab-f399\" => \"fab fa-dyalog\",\n\t\t\t\"fab-f39a\" => \"fab fa-earlybirds\",\n\t\t\t\"fab-f4f4\" => \"fab fa-ebay\",\n\t\t\t\"fab-f282\" => \"fab fa-edge\",\n\t\t\t\"fab-f430\" => \"fab fa-elementor\",\n\t\t\t\"fab-f5f1\" => \"fab fa-ello\",\n\t\t\t\"fab-f423\" => \"fab fa-ember\",\n\t\t\t\"fab-f1d1\" => \"fab fa-empire\",\n\t\t\t\"fab-f299\" => \"fab fa-envira\",\n\t\t\t\"fab-f39d\" => \"fab fa-erlang\",\n\t\t\t\"fab-f42e\" => \"fab fa-ethereum\",\n\t\t\t\"fab-f2d7\" => \"fab fa-etsy\",\n\t\t\t\"fab-f839\" => \"fab fa-evernote\",\n\t\t\t\"fab-f23e\" => \"fab fa-expeditedssl\",\n\t\t\t\"fab-f09a\" => \"fab fa-facebook\",\n\t\t\t\"fab-f39e\" => \"fab fa-facebook-f\",\n\t\t\t\"fab-f39f\" => \"fab fa-facebook-messenger\",\n\t\t\t\"fab-f082\" => \"fab fa-facebook-square\",\n\t\t\t\"fab-f6dc\" => \"fab fa-fantasy-flight-games\",\n\t\t\t\"fab-f797\" => \"fab fa-fedex\",\n\t\t\t\"fab-f798\" => \"fab fa-fedora\",\n\t\t\t\"fab-f799\" => \"fab fa-figma\",\n\t\t\t\"fab-f269\" => \"fab fa-firefox\",\n\t\t\t\"fab-f907\" => \"fab fa-firefox-browser\",\n\t\t\t\"fab-f2b0\" => \"fab fa-first-order\",\n\t\t\t\"fab-f50a\" => \"fab fa-first-order-alt\",\n\t\t\t\"fab-f3a1\" => \"fab fa-firstdraft\",\n\t\t\t\"fab-f16e\" => \"fab fa-flickr\",\n\t\t\t\"fab-f44d\" => \"fab fa-flipboard\",\n\t\t\t\"fab-f417\" => \"fab fa-fly\",\n\t\t\t\"fab-f2b4\" => \"fab fa-font-awesome\",\n\t\t\t\"fab-f35c\" => \"fab fa-font-awesome-alt\",\n\t\t\t\"fab-f425\" => \"fab fa-font-awesome-flag\",\n\t\t\t\"fab-f280\" => \"fab fa-fonticons\",\n\t\t\t\"fab-f3a2\" => \"fab fa-fonticons-fi\",\n\t\t\t\"fab-f286\" => \"fab fa-fort-awesome\",\n\t\t\t\"fab-f3a3\" => \"fab fa-fort-awesome-alt\",\n\t\t\t\"fab-f211\" => \"fab fa-forumbee\",\n\t\t\t\"fab-f180\" => \"fab fa-foursquare\",\n\t\t\t\"fab-f2c5\" => \"fab fa-free-code-camp\",\n\t\t\t\"fab-f3a4\" => \"fab fa-freebsd\",\n\t\t\t\"fab-f50b\" => \"fab fa-fulcrum\",\n\t\t\t\"fab-f50c\" => \"fab fa-galactic-republic\",\n\t\t\t\"fab-f50d\" => \"fab fa-galactic-senate\",\n\t\t\t\"fab-f265\" => \"fab fa-get-pocket\",\n\t\t\t\"fab-f260\" => \"fab fa-gg\",\n\t\t\t\"fab-f261\" => \"fab fa-gg-circle\",\n\t\t\t\"fab-f1d3\" => \"fab fa-git\",\n\t\t\t\"fab-f841\" => \"fab fa-git-alt\",\n\t\t\t\"fab-f1d2\" => \"fab fa-git-square\",\n\t\t\t\"fab-f09b\" => \"fab fa-github\",\n\t\t\t\"fab-f113\" => \"fab fa-github-alt\",\n\t\t\t\"fab-f092\" => \"fab fa-github-square\",\n\t\t\t\"fab-f3a6\" => \"fab fa-gitkraken\",\n\t\t\t\"fab-f296\" => \"fab fa-gitlab\",\n\t\t\t\"fab-f426\" => \"fab fa-gitter\",\n\t\t\t\"fab-f2a5\" => \"fab fa-glide\",\n\t\t\t\"fab-f2a6\" => \"fab fa-glide-g\",\n\t\t\t\"fab-f3a7\" => \"fab fa-gofore\",\n\t\t\t\"fab-f3a8\" => \"fab fa-goodreads\",\n\t\t\t\"fab-f3a9\" => \"fab fa-goodreads-g\",\n\t\t\t\"fab-f1a0\" => \"fab fa-google\",\n\t\t\t\"fab-f3aa\" => \"fab fa-google-drive\",\n\t\t\t\"fab-f3ab\" => \"fab fa-google-play\",\n\t\t\t\"fab-f2b3\" => \"fab fa-google-plus\",\n\t\t\t\"fab-f0d5\" => \"fab fa-google-plus-g\",\n\t\t\t\"fab-f0d4\" => \"fab fa-google-plus-square\",\n\t\t\t\"fab-f1ee\" => \"fab fa-google-wallet\",\n\t\t\t\"fab-f184\" => \"fab fa-gratipay\",\n\t\t\t\"fab-f2d6\" => \"fab fa-grav\",\n\t\t\t\"fab-f3ac\" => \"fab fa-gripfire\",\n\t\t\t\"fab-f3ad\" => \"fab fa-grunt\",\n\t\t\t\"fab-f3ae\" => \"fab fa-gulp\",\n\t\t\t\"fab-f1d4\" => \"fab fa-hacker-news\",\n\t\t\t\"fab-f3af\" => \"fab fa-hacker-news-square\",\n\t\t\t\"fab-f5f7\" => \"fab fa-hackerrank\",\n\t\t\t\"fab-f452\" => \"fab fa-hips\",\n\t\t\t\"fab-f3b0\" => \"fab fa-hire-a-helper\",\n\t\t\t\"fab-f427\" => \"fab fa-hooli\",\n\t\t\t\"fab-f592\" => \"fab fa-hornbill\",\n\t\t\t\"fab-f3b1\" => \"fab fa-hotjar\",\n\t\t\t\"fab-f27c\" => \"fab fa-houzz\",\n\t\t\t\"fab-f13b\" => \"fab fa-html5\",\n\t\t\t\"fab-f3b2\" => \"fab fa-hubspot\",\n\t\t\t\"fab-f913\" => \"fab fa-ideal\",\n\t\t\t\"fab-f2d8\" => \"fab fa-imdb\",\n\t\t\t\"fab-f16d\" => \"fab fa-instagram\",\n\t\t\t\"fab-f955\" => \"fab fa-instagram-square\",\n\t\t\t\"fab-f7af\" => \"fab fa-intercom\",\n\t\t\t\"fab-f26b\" => \"fab fa-internet-explorer\",\n\t\t\t\"fab-f7b0\" => \"fab fa-invision\",\n\t\t\t\"fab-f208\" => \"fab fa-ioxhost\",\n\t\t\t\"fab-f83a\" => \"fab fa-itch-io\",\n\t\t\t\"fab-f3b4\" => \"fab fa-itunes\",\n\t\t\t\"fab-f3b5\" => \"fab fa-itunes-note\",\n\t\t\t\"fab-f4e4\" => \"fab fa-java\",\n\t\t\t\"fab-f50e\" => \"fab fa-jedi-order\",\n\t\t\t\"fab-f3b6\" => \"fab fa-jenkins\",\n\t\t\t\"fab-f7b1\" => \"fab fa-jira\",\n\t\t\t\"fab-f3b7\" => \"fab fa-joget\",\n\t\t\t\"fab-f1aa\" => \"fab fa-joomla\",\n\t\t\t\"fab-f3b8\" => \"fab fa-js\",\n\t\t\t\"fab-f3b9\" => \"fab fa-js-square\",\n\t\t\t\"fab-f1cc\" => \"fab fa-jsfiddle\",\n\t\t\t\"fab-f5fa\" => \"fab fa-kaggle\",\n\t\t\t\"fab-f4f5\" => \"fab fa-keybase\",\n\t\t\t\"fab-f3ba\" => \"fab fa-keycdn\",\n\t\t\t\"fab-f3bb\" => \"fab fa-kickstarter\",\n\t\t\t\"fab-f3bc\" => \"fab fa-kickstarter-k\",\n\t\t\t\"fab-f42f\" => \"fab fa-korvue\",\n\t\t\t\"fab-f3bd\" => \"fab fa-laravel\",\n\t\t\t\"fab-f202\" => \"fab fa-lastfm\",\n\t\t\t\"fab-f203\" => \"fab fa-lastfm-square\",\n\t\t\t\"fab-f212\" => \"fab fa-leanpub\",\n\t\t\t\"fab-f41d\" => \"fab fa-less\",\n\t\t\t\"fab-f3c0\" => \"fab fa-line\",\n\t\t\t\"fab-f08c\" => \"fab fa-linkedin\",\n\t\t\t\"fab-f0e1\" => \"fab fa-linkedin-in\",\n\t\t\t\"fab-f2b8\" => \"fab fa-linode\",\n\t\t\t\"fab-f17c\" => \"fab fa-linux\",\n\t\t\t\"fab-f3c3\" => \"fab fa-lyft\",\n\t\t\t\"fab-f3c4\" => \"fab fa-magento\",\n\t\t\t\"fab-f59e\" => \"fab fa-mailchimp\",\n\t\t\t\"fab-f50f\" => \"fab fa-mandalorian\",\n\t\t\t\"fab-f60f\" => \"fab fa-markdown\",\n\t\t\t\"fab-f4f6\" => \"fab fa-mastodon\",\n\t\t\t\"fab-f136\" => \"fab fa-maxcdn\",\n\t\t\t\"fab-f8ca\" => \"fab fa-mdb\",\n\t\t\t\"fab-f3c6\" => \"fab fa-medapps\",\n\t\t\t\"fab-f23a\" => \"fab fa-medium\",\n\t\t\t\"fab-f3c7\" => \"fab fa-medium-m\",\n\t\t\t\"fab-f3c8\" => \"fab fa-medrt\",\n\t\t\t\"fab-f2e0\" => \"fab fa-meetup\",\n\t\t\t\"fab-f5a3\" => \"fab fa-megaport\",\n\t\t\t\"fab-f7b3\" => \"fab fa-mendeley\",\n\t\t\t\"fab-f91a\" => \"fab fa-microblog\",\n\t\t\t\"fab-f3ca\" => \"fab fa-microsoft\",\n\t\t\t\"fab-f3cb\" => \"fab fa-mix\",\n\t\t\t\"fab-f289\" => \"fab fa-mixcloud\",\n\t\t\t\"fab-f956\" => \"fab fa-mixer\",\n\t\t\t\"fab-f3cc\" => \"fab fa-mizuni\",\n\t\t\t\"fab-f285\" => \"fab fa-modx\",\n\t\t\t\"fab-f3d0\" => \"fab fa-monero\",\n\t\t\t\"fab-f3d2\" => \"fab fa-napster\",\n\t\t\t\"fab-f612\" => \"fab fa-neos\",\n\t\t\t\"fab-f5a8\" => \"fab fa-nimblr\",\n\t\t\t\"fab-f419\" => \"fab fa-node\",\n\t\t\t\"fab-f3d3\" => \"fab fa-node-js\",\n\t\t\t\"fab-f3d4\" => \"fab fa-npm\",\n\t\t\t\"fab-f3d5\" => \"fab fa-ns8\",\n\t\t\t\"fab-f3d6\" => \"fab fa-nutritionix\",\n\t\t\t\"fab-f263\" => \"fab fa-odnoklassniki\",\n\t\t\t\"fab-f264\" => \"fab fa-odnoklassniki-square\",\n\t\t\t\"fab-f510\" => \"fab fa-old-republic\",\n\t\t\t\"fab-f23d\" => \"fab fa-opencart\",\n\t\t\t\"fab-f19b\" => \"fab fa-openid\",\n\t\t\t\"fab-f26a\" => \"fab fa-opera\",\n\t\t\t\"fab-f23c\" => \"fab fa-optin-monster\",\n\t\t\t\"fab-f8d2\" => \"fab fa-orcid\",\n\t\t\t\"fab-f41a\" => \"fab fa-osi\",\n\t\t\t\"fab-f3d7\" => \"fab fa-page4\",\n\t\t\t\"fab-f18c\" => \"fab fa-pagelines\",\n\t\t\t\"fab-f3d8\" => \"fab fa-palfed\",\n\t\t\t\"fab-f3d9\" => \"fab fa-patreon\",\n\t\t\t\"fab-f1ed\" => \"fab fa-paypal\",\n\t\t\t\"fab-f704\" => \"fab fa-penny-arcade\",\n\t\t\t\"fab-f3da\" => \"fab fa-periscope\",\n\t\t\t\"fab-f3db\" => \"fab fa-phabricator\",\n\t\t\t\"fab-f3dc\" => \"fab fa-phoenix-framework\",\n\t\t\t\"fab-f511\" => \"fab fa-phoenix-squadron\",\n\t\t\t\"fab-f457\" => \"fab fa-php\",\n\t\t\t\"fab-f2ae\" => \"fab fa-pied-piper\",\n\t\t\t\"fab-f1a8\" => \"fab fa-pied-piper-alt\",\n\t\t\t\"fab-f4e5\" => \"fab fa-pied-piper-hat\",\n\t\t\t\"fab-f1a7\" => \"fab fa-pied-piper-pp\",\n\t\t\t\"fab-f91e\" => \"fab fa-pied-piper-square\",\n\t\t\t\"fab-f0d2\" => \"fab fa-pinterest\",\n\t\t\t\"fab-f231\" => \"fab fa-pinterest-p\",\n\t\t\t\"fab-f0d3\" => \"fab fa-pinterest-square\",\n\t\t\t\"fab-f3df\" => \"fab fa-playstation\",\n\t\t\t\"fab-f288\" => \"fab fa-product-hunt\",\n\t\t\t\"fab-f3e1\" => \"fab fa-pushed\",\n\t\t\t\"fab-f3e2\" => \"fab fa-python\",\n\t\t\t\"fab-f1d6\" => \"fab fa-qq\",\n\t\t\t\"fab-f459\" => \"fab fa-quinscape\",\n\t\t\t\"fab-f2c4\" => \"fab fa-quora\",\n\t\t\t\"fab-f4f7\" => \"fab fa-r-project\",\n\t\t\t\"fab-f7bb\" => \"fab fa-raspberry-pi\",\n\t\t\t\"fab-f2d9\" => \"fab fa-ravelry\",\n\t\t\t\"fab-f41b\" => \"fab fa-react\",\n\t\t\t\"fab-f75d\" => \"fab fa-reacteurope\",\n\t\t\t\"fab-f4d5\" => \"fab fa-readme\",\n\t\t\t\"fab-f1d0\" => \"fab fa-rebel\",\n\t\t\t\"fab-f3e3\" => \"fab fa-red-river\",\n\t\t\t\"fab-f1a1\" => \"fab fa-reddit\",\n\t\t\t\"fab-f281\" => \"fab fa-reddit-alien\",\n\t\t\t\"fab-f1a2\" => \"fab fa-reddit-square\",\n\t\t\t\"fab-f7bc\" => \"fab fa-redhat\",\n\t\t\t\"fab-f18b\" => \"fab fa-renren\",\n\t\t\t\"fab-f3e6\" => \"fab fa-replyd\",\n\t\t\t\"fab-f4f8\" => \"fab fa-researchgate\",\n\t\t\t\"fab-f3e7\" => \"fab fa-resolving\",\n\t\t\t\"fab-f5b2\" => \"fab fa-rev\",\n\t\t\t\"fab-f3e8\" => \"fab fa-rocketchat\",\n\t\t\t\"fab-f3e9\" => \"fab fa-rockrms\",\n\t\t\t\"fab-f267\" => \"fab fa-safari\",\n\t\t\t\"fab-f83b\" => \"fab fa-salesforce\",\n\t\t\t\"fab-f41e\" => \"fab fa-sass\",\n\t\t\t\"fab-f3ea\" => \"fab fa-schlix\",\n\t\t\t\"fab-f28a\" => \"fab fa-scribd\",\n\t\t\t\"fab-f3eb\" => \"fab fa-searchengin\",\n\t\t\t\"fab-f2da\" => \"fab fa-sellcast\",\n\t\t\t\"fab-f213\" => \"fab fa-sellsy\",\n\t\t\t\"fab-f3ec\" => \"fab fa-servicestack\",\n\t\t\t\"fab-f214\" => \"fab fa-shirtsinbulk\",\n\t\t\t\"fab-f957\" => \"fab fa-shopify\",\n\t\t\t\"fab-f5b5\" => \"fab fa-shopware\",\n\t\t\t\"fab-f215\" => \"fab fa-simplybuilt\",\n\t\t\t\"fab-f3ee\" => \"fab fa-sistrix\",\n\t\t\t\"fab-f512\" => \"fab fa-sith\",\n\t\t\t\"fab-f7c6\" => \"fab fa-sketch\",\n\t\t\t\"fab-f216\" => \"fab fa-skyatlas\",\n\t\t\t\"fab-f17e\" => \"fab fa-skype\",\n\t\t\t\"fab-f198\" => \"fab fa-slack\",\n\t\t\t\"fab-f3ef\" => \"fab fa-slack-hash\",\n\t\t\t\"fab-f1e7\" => \"fab fa-slideshare\",\n\t\t\t\"fab-f2ab\" => \"fab fa-snapchat\",\n\t\t\t\"fab-f2ac\" => \"fab fa-snapchat-ghost\",\n\t\t\t\"fab-f2ad\" => \"fab fa-snapchat-square\",\n\t\t\t\"fab-f1be\" => \"fab fa-soundcloud\",\n\t\t\t\"fab-f7d3\" => \"fab fa-sourcetree\",\n\t\t\t\"fab-f3f3\" => \"fab fa-speakap\",\n\t\t\t\"fab-f83c\" => \"fab fa-speaker-deck\",\n\t\t\t\"fab-f1bc\" => \"fab fa-spotify\",\n\t\t\t\"fab-f5be\" => \"fab fa-squarespace\",\n\t\t\t\"fab-f18d\" => \"fab fa-stack-exchange\",\n\t\t\t\"fab-f16c\" => \"fab fa-stack-overflow\",\n\t\t\t\"fab-f842\" => \"fab fa-stackpath\",\n\t\t\t\"fab-f3f5\" => \"fab fa-staylinked\",\n\t\t\t\"fab-f1b6\" => \"fab fa-steam\",\n\t\t\t\"fab-f1b7\" => \"fab fa-steam-square\",\n\t\t\t\"fab-f3f6\" => \"fab fa-steam-symbol\",\n\t\t\t\"fab-f3f7\" => \"fab fa-sticker-mule\",\n\t\t\t\"fab-f428\" => \"fab fa-strava\",\n\t\t\t\"fab-f429\" => \"fab fa-stripe\",\n\t\t\t\"fab-f42a\" => \"fab fa-stripe-s\",\n\t\t\t\"fab-f3f8\" => \"fab fa-studiovinari\",\n\t\t\t\"fab-f1a4\" => \"fab fa-stumbleupon\",\n\t\t\t\"fab-f1a3\" => \"fab fa-stumbleupon-circle\",\n\t\t\t\"fab-f2dd\" => \"fab fa-superpowers\",\n\t\t\t\"fab-f3f9\" => \"fab fa-supple\",\n\t\t\t\"fab-f7d6\" => \"fab fa-suse\",\n\t\t\t\"fab-f8e1\" => \"fab fa-swift\",\n\t\t\t\"fab-f83d\" => \"fab fa-symfony\",\n\t\t\t\"fab-f4f9\" => \"fab fa-teamspeak\",\n\t\t\t\"fab-f2c6\" => \"fab fa-telegram\",\n\t\t\t\"fab-f3fe\" => \"fab fa-telegram-plane\",\n\t\t\t\"fab-f1d5\" => \"fab fa-tencent-weibo\",\n\t\t\t\"fab-f69d\" => \"fab fa-the-red-yeti\",\n\t\t\t\"fab-f5c6\" => \"fab fa-themeco\",\n\t\t\t\"fab-f2b2\" => \"fab fa-themeisle\",\n\t\t\t\"fab-f731\" => \"fab fa-think-peaks\",\n\t\t\t\"fab-f513\" => \"fab fa-trade-federation\",\n\t\t\t\"fab-f181\" => \"fab fa-trello\",\n\t\t\t\"fab-f262\" => \"fab fa-tripadvisor\",\n\t\t\t\"fab-f173\" => \"fab fa-tumblr\",\n\t\t\t\"fab-f174\" => \"fab fa-tumblr-square\",\n\t\t\t\"fab-f1e8\" => \"fab fa-twitch\",\n\t\t\t\"fab-f099\" => \"fab fa-twitter\",\n\t\t\t\"fab-f081\" => \"fab fa-twitter-square\",\n\t\t\t\"fab-f42b\" => \"fab fa-typo3\",\n\t\t\t\"fab-f402\" => \"fab fa-uber\",\n\t\t\t\"fab-f7df\" => \"fab fa-ubuntu\",\n\t\t\t\"fab-f403\" => \"fab fa-uikit\",\n\t\t\t\"fab-f8e8\" => \"fab fa-umbraco\",\n\t\t\t\"fab-f404\" => \"fab fa-uniregistry\",\n\t\t\t\"fab-f949\" => \"fab fa-unity\",\n\t\t\t\"fab-f405\" => \"fab fa-untappd\",\n\t\t\t\"fab-f7e0\" => \"fab fa-ups\",\n\t\t\t\"fab-f287\" => \"fab fa-usb\",\n\t\t\t\"fab-f7e1\" => \"fab fa-usps\",\n\t\t\t\"fab-f407\" => \"fab fa-ussunnah\",\n\t\t\t\"fab-f408\" => \"fab fa-vaadin\",\n\t\t\t\"fab-f237\" => \"fab fa-viacoin\",\n\t\t\t\"fab-f2a9\" => \"fab fa-viadeo\",\n\t\t\t\"fab-f2aa\" => \"fab fa-viadeo-square\",\n\t\t\t\"fab-f409\" => \"fab fa-viber\",\n\t\t\t\"fab-f40a\" => \"fab fa-vimeo\",\n\t\t\t\"fab-f194\" => \"fab fa-vimeo-square\",\n\t\t\t\"fab-f27d\" => \"fab fa-vimeo-v\",\n\t\t\t\"fab-f1ca\" => \"fab fa-vine\",\n\t\t\t\"fab-f189\" => \"fab fa-vk\",\n\t\t\t\"fab-f40b\" => \"fab fa-vnv\",\n\t\t\t\"fab-f41f\" => \"fab fa-vuejs\",\n\t\t\t\"fab-f83f\" => \"fab fa-waze\",\n\t\t\t\"fab-f5cc\" => \"fab fa-weebly\",\n\t\t\t\"fab-f18a\" => \"fab fa-weibo\",\n\t\t\t\"fab-f1d7\" => \"fab fa-weixin\",\n\t\t\t\"fab-f232\" => \"fab fa-whatsapp\",\n\t\t\t\"fab-f40c\" => \"fab fa-whatsapp-square\",\n\t\t\t\"fab-f40d\" => \"fab fa-whmcs\",\n\t\t\t\"fab-f266\" => \"fab fa-wikipedia-w\",\n\t\t\t\"fab-f17a\" => \"fab fa-windows\",\n\t\t\t\"fab-f5cf\" => \"fab fa-wix\",\n\t\t\t\"fab-f730\" => \"fab fa-wizards-of-the-coast\",\n\t\t\t\"fab-f514\" => \"fab fa-wolf-pack-battalion\",\n\t\t\t\"fab-f19a\" => \"fab fa-wordpress\",\n\t\t\t\"fab-f411\" => \"fab fa-wordpress-simple\",\n\t\t\t\"fab-f297\" => \"fab fa-wpbeginner\",\n\t\t\t\"fab-f2de\" => \"fab fa-wpexplorer\",\n\t\t\t\"fab-f298\" => \"fab fa-wpforms\",\n\t\t\t\"fab-f3e4\" => \"fab fa-wpressr\",\n\t\t\t\"fab-f412\" => \"fab fa-xbox\",\n\t\t\t\"fab-f168\" => \"fab fa-xing\",\n\t\t\t\"fab-f169\" => \"fab fa-xing-square\",\n\t\t\t\"fab-f23b\" => \"fab fa-y-combinator\",\n\t\t\t\"fab-f19e\" => \"fab fa-yahoo\",\n\t\t\t\"fab-f840\" => \"fab fa-yammer\",\n\t\t\t\"fab-f413\" => \"fab fa-yandex\",\n\t\t\t\"fab-f414\" => \"fab fa-yandex-international\",\n\t\t\t\"fab-f7e3\" => \"fab fa-yarn\",\n\t\t\t\"fab-f1e9\" => \"fab fa-yelp\",\n\t\t\t\"fab-f2b1\" => \"fab fa-yoast\",\n\t\t\t\"fab-f167\" => \"fab fa-youtube\",\n\t\t\t\"fab-f431\" => \"fab fa-youtube-square\",\n\t\t\t\"fab-f63f\" => \"fab fa-zhihu\"\n\t\t);\n\n\t\t$icons = array_merge( $solid_icons, $regular_icons, $brand_icons );\n\n\t\t$icons = apply_filters( \"megamenu_fontawesome_5_icons\", $icons );\n\n\t\treturn $icons;\n\n\t}", "function fa_load_script( $script, $dependency = array( 'jquery' ) ){\t\n\t\n\tif( defined('FA_SCRIPT_DEBUG') && FA_SCRIPT_DEBUG ){\n\t\t$script .= '.dev';\n\t}\n\t\n\t$url = fa_get_uri( 'assets/front/js/' . $script . '.js' );\n\twp_enqueue_script(\n\t\t'fa-script-' . $script,\n\t\t$url,\n\t\t$dependency,\n\t\tfalse\t\t\n\t);\t\n\treturn 'fa-script-' . $script;\n}", "function twentyfourteen_admin_fonts() {\n\twp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );\n}", "function twentyfourteen_admin_fonts() {\n\twp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );\n}", "function BBFontLibs()\n {\n $fonts = File::directories('public/fonts');\n foreach ($fonts as $font) {\n if (file_exists($font . '/config.json')) {\n $config = json_decode(file_get_contents($font . '/config.json'));\n $resources[] = [\n 'title' => $config->title,\n 'folder' => basename($font)\n ];\n }\n }\n\n return $resources;\n }", "protected function getFont($path)\n {\n $styles = $this->config->getFonts();\n return $this->getUrl($styles.$path);\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "public function get_icon() {\n return 'fa fa-plug';\n }", "function resources() {\n\t\t$t_font_family = config_get('font_family', null, null, ALL_PROJECTS);\n\n\t\tif (isset($this->fonts[$t_font_family])) {\n\t\t\t$spec\t= $this->fonts[$t_font_family];\n\t\t\t$url\t= \"https://fonts.googleapis.com/css2?family={$spec}&display=swap\";\n\n\t\t\tprintf('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" crossorigin=\"anonymous\" />', htmlspecialchars($url));\n\t\t}\n\t}", "public function getIconForResourceWithPdfReturnsPdfIcon() {}", "public function append_fontawesome_scss( $scss ) {\n\t\t$path = trailingslashit( plugin_dir_path( __FILE__ ) ) . 'scss/fontawesome.scss';\n\t\t$contents = file_get_contents( $path );\n \t\treturn $scss . $contents;\n\t}", "function load_file( $name, $file_path, $is_script = false )\n\t\t\t{\n\t\t\n\t\t \t$url = content_url( $file_path, __FILE__ );\n\t\t\t\t$file = $file_path;\n\t\t\t\t\t\n\t\t\t\tif( $is_script )\n\t\t\t\t{\n\n\t\t\t\t\twp_register_script( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_script( $name );\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\twp_register_style( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_style( $name );\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}", "function load_file( $name, $file_path, $is_script = false )\n\t\t\t{\n\t\t\n\t\t \t$url = content_url( $file_path, __FILE__ );\n\t\t\t\t$file = $file_path;\n\t\t\t\t\t\n\t\t\t\tif( $is_script )\n\t\t\t\t{\n\n\t\t\t\t\twp_register_script( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_script( $name );\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\twp_register_style( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_style( $name );\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}", "function updateFont($file){\n\t$filenamepart=explodeFile($file);\n\t$buffer=file_get_contents($file);\n\t$posL = getNextFontFace($buffer,0);\n\tif ($posL===false) {\n\t\techo \"\\n=> NOTICE: $file has no font-face! returning.\\n\"; return;\n\t}\n\tif (getNextFontFace($buffer,$posL+1)!==false) {\n\t\techo \"\\n=> ERROR: $file has more than one font-face! Doing nothing, returning.\\n\"; return;\n\t}\n\t$posR = getNextCurlyBracket($buffer,$posL);\n\t$out=getTextBefore($buffer,0,$posL-1);\n\t$out.=\"@font-face { font-family: Ostrich Sans; src: url(\\\"data:application/font-woff;charset=utf-8;base64,\".FONTBASE64.\"\\\"); }\";\n\t$out.=getTextAfter($buffer,$posR+1);\n\tfile_put_contents($file,$out);\n}", "public function loadFont($name, $encoding = null, $optlist = null);", "public function update_font_awesome_classes( $class ) {\n\t\t\t$exceptions = array(\n\t\t\t\t'icon-envelope' => 'fa-envelope-o',\n\t\t\t\t'icon-star-empty' => 'fa-star-o',\n\t\t\t\t'icon-ok' => 'fa-check',\n\t\t\t\t'icon-zoom-in' => 'fa-search-plus',\n\t\t\t\t'icon-zoom-out' => 'fa-search-minus',\n\t\t\t\t'icon-off' => 'fa-power-off',\n\t\t\t\t'icon-trash' => 'fa-trash-o',\n\t\t\t\t'icon-share' => 'fa-share-square-o',\n\t\t\t\t'icon-check' => 'fa-check-square-o',\n\t\t\t\t'icon-move' => 'fa-arrows',\n\t\t\t\t'icon-file' => 'fa-file-o',\n\t\t\t\t'icon-time' => 'fa-clock-o',\n\t\t\t\t'icon-download-alt' => 'fa-download',\n\t\t\t\t'icon-download' => 'fa-arrow-circle-o-down',\n\t\t\t\t'icon-upload' => 'fa-arrow-circle-o-up',\n\t\t\t\t'icon-play-circle' => 'fa-play-circle-o',\n\t\t\t\t'icon-indent-left' => 'fa-dedent',\n\t\t\t\t'icon-indent-right' => 'fa-indent',\n\t\t\t\t'icon-facetime-video' => 'fa-video-camera',\n\t\t\t\t'icon-picture' => 'fa-picture-o',\n\t\t\t\t'icon-plus-sign' => 'fa-plus-circle',\n\t\t\t\t'icon-minus-sign' => 'fa-minus-circle',\n\t\t\t\t'icon-remove-sign' => 'fa-times-circle',\n\t\t\t\t'icon-ok-sign' => 'fa-check-circle',\n\t\t\t\t'icon-question-sign' => 'fa-question-circle',\n\t\t\t\t'icon-info-sign' => 'fa-info-circle',\n\t\t\t\t'icon-screenshot' => 'fa-crosshairs',\n\t\t\t\t'icon-remove-circle' => 'fa-times-circle-o',\n\t\t\t\t'icon-ok-circle' => 'fa-check-circle-o',\n\t\t\t\t'icon-ban-circle' => 'fa-ban',\n\t\t\t\t'icon-share-alt' => 'fa-share',\n\t\t\t\t'icon-resize-full' => 'fa-expand',\n\t\t\t\t'icon-resize-small' => 'fa-compress',\n\t\t\t\t'icon-exclamation-sign' => 'fa-exclamation-circle',\n\t\t\t\t'icon-eye-open' => 'fa-eye',\n\t\t\t\t'icon-eye-close' => 'fa-eye-slash',\n\t\t\t\t'icon-warning-sign' => 'fa-warning',\n\t\t\t\t'icon-folder-close' => 'fa-folder',\n\t\t\t\t'icon-resize-vertical' => 'fa-arrows-v',\n\t\t\t\t'icon-resize-horizontal' => 'fa-arrows-h',\n\t\t\t\t'icon-twitter-sign' => 'fa-twitter-square',\n\t\t\t\t'icon-facebook-sign' => 'fa-facebook-square',\n\t\t\t\t'icon-thumbs-up' => 'fa-thumbs-o-up',\n\t\t\t\t'icon-thumbs-down' => 'fa-thumbs-o-down',\n\t\t\t\t'icon-heart-empty' => 'fa-heart-o',\n\t\t\t\t'icon-signout' => 'fa-sign-out',\n\t\t\t\t'icon-linkedin-sign' => 'fa-linkedin-square',\n\t\t\t\t'icon-pushpin' => 'fa-thumb-tack',\n\t\t\t\t'icon-signin' => 'fa-sign-in',\n\t\t\t\t'icon-github-sign' => 'fa-github-square',\n\t\t\t\t'icon-upload-alt' => 'fa-upload',\n\t\t\t\t'icon-lemon' => 'fa-lemon-o',\n\t\t\t\t'icon-check-empty' => 'fa-square-o',\n\t\t\t\t'icon-bookmark-empty' => 'fa-bookmark-o',\n\t\t\t\t'icon-phone-sign' => 'fa-phone-square',\n\t\t\t\t'icon-hdd' => 'fa-hdd-o',\n\t\t\t\t'icon-hand-right' => 'fa-hand-o-right',\n\t\t\t\t'icon-hand-left' => 'fa-hand-o-left',\n\t\t\t\t'icon-hand-up' => 'fa-hand-o-up',\n\t\t\t\t'icon-hand-down' => 'fa-hand-o-down',\n\t\t\t\t'icon-circle-arrow-left' => 'fa-arrow-circle-left',\n\t\t\t\t'icon-circle-arrow-right' => 'fa-arrow-circle-right',\n\t\t\t\t'icon-circle-arrow-up' => 'fa-arrow-circle-up',\n\t\t\t\t'icon-circle-arrow-down' => 'fa-arrow-circle-down',\n\t\t\t\t'icon-fullscreen' => 'fa-arrows-alt',\n\t\t\t\t'icon-beaker' => 'fa-flask',\n\t\t\t\t'icon-paper-clip' => 'fa-paperclip',\n\t\t\t\t'icon-sign-blank' => 'fa-square',\n\t\t\t\t'icon-pinterest-sign' => 'fa-pinterest-square',\n\t\t\t\t'icon-google-plus-sign' => 'fa-google-plus-square',\n\t\t\t\t'icon-envelope-alt' => 'fa-envelope',\n\t\t\t\t'icon-comment-alt' => 'fa-comment-o',\n\t\t\t\t'icon-comments-alt' => 'fa-comments-o'\n\t\t\t);\n\n\t\t\tif( in_array( $class, array_keys( $exceptions ) ) ){\n\t\t\t\t$class = $exceptions[ $class ];\n\t\t\t}\n\n\t\t\t$class = str_replace( 'icon-', 'fa-', $class );\n\n\t\t\treturn $class;\n\t\t}", "function quasar_favico() {\n echo '<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"'.xr_get_option('company_logo_favicon', F_WAY.'/images/demo/favico.ico').'\" />';\n}", "public function getFont() {}", "public function getFont() {}", "public function getFont() {}", "function framework_font_admin_scripts( $hook ) {\r\n\t$dev_mode = get_option( 'cp_dev_mode' );\r\n\tif ( '1' === $dev_mode ) {\r\n\t\twp_enqueue_script( 'cp-font-script', CP_FRAMEWORK_URI . '/fields/font/font.js', array(), '1.0.0', true );\r\n\t}\r\n}", "function add_zipped_font()\n\t{\n\t\tcheck_ajax_referer('avia_nonce_save_backend');\n\t\t\n\t\t//check if capability is ok\n\t\t$cap = apply_filters('avf_file_upload_capability', 'update_plugins');\n\t\tif(!current_user_can($cap)) \n\t\t{\n\t\t\texit( \"Using this feature is reserved for Super Admins. You unfortunately don't have the necessary permissions.\" );\n\t\t}\n\t\t\n\t\t//get the file path of the zip file\n\t\t$attachment = $_POST['values'];\n\t\t$path \t\t= realpath(get_attached_file($attachment['id']));\n\t\t$unzipped \t= $this->zip_flatten( $path , array('\\.eot','\\.svg','\\.ttf','\\.woff','\\.json'));\n\t\t\n\t\t// if we were able to unzip the file and save it to our temp folder extract the svg file\n\t\tif($unzipped)\n\t\t{\n\t\t\t$this->create_config();\n\t\t}\n\t\t\n\t\t//if we got no name for the font dont add it and delete the temp folder\n\t\tif($this->font_name == 'unknown')\n\t\t{\n\t\t\t$this->delete_folder($this->paths['tempdir']);\n\t\t\texit('Was not able to retrieve the Font name from your Uploaded Folder');\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\texit('avia_font_added:'.$this->font_name);\n\t}", "private static function _find_icon($name) {\n if ($url = self::$_icon_cache[$name]) {\n return $url;\n }\n\n $filename = 'icon_' . $name . '.png';\n $path = Config::get('theme_path') . '/images/icons/';\n if (!file_exists(Config::get('prefix') . $path . $filename)) {\n $path = '/images/';\n }\n $url = Config::get('web_path') . $path . $filename;\n self::$_icon_cache[$name] = $url;\n\n return $url;\n }", "function wpex_add_custom_fonts() {\n\treturn array( \n\t\n\t\t\"Proxim Nova\" => \"proxima-nova\", \n\t\t\"Museo Slab\" => \"museo-slab\" \n );\n}", "function bones_fonts() {\n wp_enqueue_style('google-fonts', get_stylesheet_directory_uri() . '/library/3p/css/googlefonts.css');\n}", "function spidermag_fonts_url() {\n $fonts_url = '';\n\n /* Translators: If there are characters in your language that are not\n * supported by Open Sans, translate this to 'off'. Do not translate\n * into your own language.\n */\n $Ubuntu = _x( 'on', 'Ubuntu font: on or off', 'spidermag' );\n\n /* Translators: If there are characters in your language that are not\n * supported by Raleway, translate this to 'off'. Do not translate\n * into your own language.\n */\n $OpenSans = _x( 'on', 'Open Sans font: on or off', 'spidermag' );\n\n $PlayfairDisplay = _x( 'on', 'Playfair Display font: on or off', 'spidermag' );\n\n if ( 'off' !== $Ubuntu || 'off' !== $OpenSans || 'off' !== $PlayfairDisplay ) {\n $font_families = array();\n\n if ( 'off' !== $Ubuntu ) {\n $font_families[] = 'Ubuntu:300,300i,400,400i,500,500i,700,700i';\n }\n\n if ( 'off' !== $OpenSans ) {\n $font_families[] = 'Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i';\n }\n\n if ( 'off' !== $PlayfairDisplay ) {\n $font_families[] = 'Playfair+Display:400,400i,700,700i,900,900i';\n }\n\n $query_args = array(\n 'family' => urlencode( implode( '|', $font_families ) ),\n 'subset' => urlencode( 'latin,latin-ext' ),\n );\n\n $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );\n }\n\n return esc_url_raw( $fonts_url );\n }", "function flexiauto_fonts_url() {\n\t\t$fonts_url = '';\n\n\t\t$roboto = _x( 'on', 'Roboto font: on or off', 'flexiauto' );\n\n\t\tif ( 'off' !== $roboto ) {\n\t\t\t$font_families = array();\n\n\t\t\t$font_families[] = 'Roboto:300,400,500,700,900';\n\n\t\t\t$query_args = array(\n\t\t\t\t'family' => urlencode( implode( '|', $font_families ) ),\n\t\t\t\t'subset' => urlencode( 'latin,latin-ext' ),\n\t\t\t);\n\n\t\t\t$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );\n\t\t}\n\n\t\treturn esc_url_raw( $fonts_url );\n\t}", "function mod_escape_get_fontawesome_icon_map() {\n return [\n 'mod_escape:e/copy' => 'fa-clone',\n ];\n}", "function TS_VCSC_IconFontsRequired() {\r\n\t\t\tif (($this->TS_VCSC_PluginFontSummary == \"true\") || ($this->TS_VCSC_VisualComposer_Loading == \"true\") || ($this->TS_VCSC_VCFrontEditMode == \"true\") || ($this->TS_VCSC_Icons_Compliant_Loading == \"true\") || ($this->TS_VCSC_IconicumMenuGenerator == \"true\")) {\r\n\t\t\t\t$this->TS_VCSC_IconFontsArrays(false);\r\n\t\t\t}\r\n\t\t}", "protected function _getFontPath()\n {\n\n $current_dir = rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;\n $font_file = 'captcha.ttf';\n\n return $current_dir . $font_file;\n\n }", "function admin_bar_css()\n{\n queue_css_url('//fonts.googleapis.com/css?family=Arvo:400', 'screen');\n queue_css_file('admin-bar', 'screen');\n}", "private function _getFontFile($key) {}", "function av_icon_css_string($char)\n{\n\tglobal $avia_config;\n\treturn \"content:'\\\\\".str_replace('ue','E',$avia_config['font_icons'][$char]['icon']).\"'; font-family: '\".$avia_config['font_icons'][$char]['font'].\"';\";\n}", "function _barony_base_file_additions() {\n // Add Font Awesome\n drupal_add_js('//use.fontawesome.com/76948938e9.js', 'external');\n // Add Google Fonts\n drupal_add_css('//fonts.googleapis.com/css?family=Uncial+Antiqua|Metamorphous', array('group' => CSS_THEME));\n\n // Custom additions\n drupal_add_js(drupal_get_path('theme', 'barony_base') . '/js/header-movement.js', array('type' => 'file', 'scope' => 'footer'));\n}", "function uni_files(){\n // wp_enqueue_script('uni-main-js', get_theme_file_uri('/js/scripts-bundled.js'), NULL, '1.0', true);\n wp_enqueue_script('uni-main-js', get_theme_file_uri('/js/scripts-bundled.js'), NULL, microtime(), true);\n // wp_enqueue_style('uni_main_styles', get_stylesheet_uri());\n wp_enqueue_style('uni_main_styles', get_stylesheet_uri(), NULL, microtime());\n wp_enqueue_style('custom_google_font','//fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,400,400i,700,700i');\n wp_enqueue_style('font-awesome','//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');\n }", "function twentytwelve_get_font_url() {\n $font_url = '';\n\n /* translators: If there are characters in your language that are not supported\n * by Open Sans, translate this to 'off'. Do not translate into your own language.\n */\n if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {\n $subsets = 'latin,latin-ext';\n\n /* translators: To add an additional Open Sans character subset specific to your language,\n * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.\n */\n $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );\n\n if ( 'cyrillic' == $subset )\n $subsets .= ',cyrillic,cyrillic-ext';\n elseif ( 'greek' == $subset )\n $subsets .= ',greek,greek-ext';\n elseif ( 'vietnamese' == $subset )\n $subsets .= ',vietnamese';\n\n $protocol = is_ssl() ? 'https' : 'http';\n $query_args = array(\n 'family' => 'Open+Sans:400italic,700italic,400,700',\n 'subset' => $subsets,\n );\n $font_url = add_query_arg( $query_args, \"$protocol://fonts.googleapis.com/css\" );\n }\n\n return $font_url;\n }", "public function getFonts();", "public function load_assets() {\n\t\twponion_load_core_assets( $this->option( 'assets' ) );\n\t}" ]
[ "0.72500086", "0.6890719", "0.6795949", "0.6689029", "0.6622551", "0.63101125", "0.62916046", "0.6250702", "0.61850107", "0.617171", "0.61546326", "0.61432326", "0.60146", "0.5901928", "0.5895587", "0.5863318", "0.5846166", "0.5835009", "0.5758817", "0.5757164", "0.57394576", "0.5689895", "0.5651561", "0.5610344", "0.5610278", "0.560315", "0.5600581", "0.5577423", "0.554671", "0.5512066", "0.55024296", "0.5498561", "0.5470692", "0.54695404", "0.54084677", "0.5399787", "0.53937954", "0.5391736", "0.5384575", "0.5381524", "0.53742343", "0.5371733", "0.53704196", "0.5368826", "0.5338713", "0.5338158", "0.5318044", "0.5311904", "0.5298576", "0.5296043", "0.5287206", "0.52670026", "0.525475", "0.5252247", "0.52489775", "0.52324486", "0.5225709", "0.5211298", "0.5209669", "0.5205479", "0.51933163", "0.5170639", "0.5168617", "0.51444995", "0.51444995", "0.5142365", "0.50811094", "0.5077805", "0.5077805", "0.5077805", "0.5073566", "0.5054295", "0.5024325", "0.5024175", "0.5024175", "0.5011408", "0.4994407", "0.49831855", "0.4967597", "0.4964041", "0.4964041", "0.4964041", "0.49489763", "0.49460647", "0.4931288", "0.49098724", "0.49088576", "0.48999882", "0.4895065", "0.48949912", "0.48919564", "0.48899305", "0.48706183", "0.48675802", "0.48628908", "0.48602358", "0.48528063", "0.48486876", "0.48277518", "0.48272735" ]
0.59452474
13
Theme files model initialization
protected function _construct() { $this->_init(\Magento\Theme\Model\ResourceModel\Theme\File::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_theme() {\r\n\r\n\t\t$possible_names = self::get_theme_name();\r\n\r\n\t\tforeach( $possible_names as $type => $name ){\r\n\r\n\t\t\t$theme_class = \"WP_Job_Manager_Field_Editor_Themes_\" . ucfirst( $name );\r\n\r\n\t\t\tif( class_exists( $theme_class ) ) {\r\n\t\t\t\t$theme = new $theme_class();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function init()\n {\n $this->loadThemeComponent();\n $this->loadConfig();\n }", "protected function createThemeModel()\n {\n return new ThemeModel();\n }", "function mu_themes_in_use(){$this->__construct();}", "protected function loadThemeSections(){\n $listSection = Section::lists('fileName');\n\n foreach ($listSection as $sec) {\n $section = Section::find($sec);\n\n if(!$section)\n continue;\n\n $this->themeSections[$section->code] = (object) [\n 'name' => $section->title,\n 'picture' => Url::to('themes/'.$this->theme->getDirName().$section->preview),\n 'code' => $section->code,\n 'configForm' => isset($section->attr)?true:false\n ];\n }\n }", "public function init() {\n\t\t//theme needs to be set TWO times...\n\t\t$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"main\";}SSViewer::set_theme($theme);\n\t\tparent::init();\n\t\tif($theme == \"main\") {\n\t\t\t$this->addBasicMetatagRequirements();\n\t\t}\n\t\t$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"main\";}SSViewer::set_theme($theme);\n\t}", "function MicroBuilder_Theme_Factory () {}", "function init__themes()\n{\n global $THEME_IMAGES_CACHE, $CDN_CONSISTENCY_CHECK, $RECORD_THEME_IMAGES_CACHE, $RECORDED_THEME_IMAGES, $THEME_IMAGES_SMART_CACHE_LOAD;\n $THEME_IMAGES_CACHE = array();\n $CDN_CONSISTENCY_CHECK = array();\n $RECORD_THEME_IMAGES_CACHE = false;\n $RECORDED_THEME_IMAGES = array();\n $THEME_IMAGES_SMART_CACHE_LOAD = 0;\n}", "public function init() {\n\t\t//theme needs to be set TWO times...\n\t\t//$theme = Session::get(\"theme\"); if(!$theme) {$theme = \"simple\";}SSViewer::set_theme($theme);\n\t\tparent::init();\n\t\t$theme = Config::inst()->get(\"SSViewer\", \"theme\");\n\t\tif($theme == \"main\") {\n\t\t\tRequirements::themedCSS('reset');\n\t\t\tRequirements::themedCSS('layout');\n\t\t\tRequirements::themedCSS('typography');\n\t\t\tRequirements::themedCSS('form');\n\t\t\tRequirements::themedCSS('menu');\n\n\t\t\tRequirements::themedCSS('ecommerce');\n\n\t\t\tRequirements::themedCSS('individualPages');\n\t\t\tRequirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');\n\t\t}\n\t\telseif($theme == \"simple\") {\n\t\t}\n\t}", "public function init() {\n\n\t\t// Register theme options\n\t\t$this->addOption('typography', 'radio', array(\n\t\t\t'label' => 'plugins.themes.default.option.typography.label',\n\t\t\t'description' => 'plugins.themes.default.option.typography.description',\n\t\t\t'options' => array(\n\t\t\t\t'notoSans' => 'plugins.themes.default.option.typography.notoSans',\n\t\t\t\t'notoSerif' => 'plugins.themes.default.option.typography.notoSerif',\n\t\t\t\t'notoSerif_notoSans' => 'plugins.themes.default.option.typography.notoSerif_notoSans',\n\t\t\t\t'notoSans_notoSerif' => 'plugins.themes.default.option.typography.notoSans_notoSerif',\n\t\t\t\t'lato' => 'plugins.themes.default.option.typography.lato',\n\t\t\t\t'lora' => 'plugins.themes.default.option.typography.lora',\n\t\t\t\t'lora_openSans' => 'plugins.themes.default.option.typography.lora_openSans',\n\t\t\t)\n\t\t));\n\n\t\t$this->addOption('baseColour', 'colour', array(\n\t\t\t'label' => 'plugins.themes.default.option.colour.label',\n\t\t\t'description' => 'plugins.themes.default.option.colour.description',\n\t\t\t'default' => '#1E6292',\n\t\t));\n\n\t\t// Load primary stylesheet\n\t\t$this->addStyle('stylesheet', 'styles/index.less');\n\n\t\t// Store additional LESS variables to process based on options\n\t\t$additionalLessVariables = array();\n\n\t\t// Load fonts from Google Font CDN\n\t\t// To load extended latin or other character sets, see:\n\t\t// https://www.google.com/fonts#UsePlace:use/Collection:Noto+Sans\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\n\t\t\tif ($this->getOption('typography') === 'notoSerif') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSerif',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Serif:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: \"Noto Serif\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen-Sans\", \"Ubuntu\", \"Cantarell\", \"Helvetica Neue\", sans-serif;';\n\n\t\t\t} elseif (strpos($this->getOption('typography'), 'notoSerif') !== false) {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSansNotoSerif',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i|Noto+Serif:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\n\t\t\t\t// Update LESS font variables\n\t\t\t\tif ($this->getOption('typography') == 'notoSerif_notoSans') {\n\t\t\t\t\t$additionalLessVariables[] = '@font-heading: \"Noto Serif\", serif;';\n\t\t\t\t} elseif ($this->getOption('typography') == 'notoSans_notoSerif') {\n\t\t\t\t\t$additionalLessVariables[] = '@font: \"Noto Serif\", serif;@font-heading: \"Noto Sans\", serif;';\n\t\t\t\t}\n\n\t\t\t} elseif ($this->getOption('typography') == 'lato') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLato',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lato:400,400i,900,900i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: Lato, sans-serif;';\n\n\t\t\t} elseif ($this->getOption('typography') == 'lora') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLora',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lora:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: Lora, serif;';\n\n\t\t\t} elseif ($this->getOption('typography') == 'lora_openSans') {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontLoraOpenSans',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Lora:400,400i,700,700i|Open+Sans:400,400i,700,700i',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t\t$additionalLessVariables[] = '@font: \"Open Sans\", sans-serif;@font-heading: Lora, serif;';\n\n\t\t\t} else {\n\t\t\t\t$this->addStyle(\n\t\t\t\t\t'fontNotoSans',\n\t\t\t\t\t'//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic',\n\t\t\t\t\tarray('baseUrl' => '')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Update colour based on theme option\n\t\tif ($this->getOption('baseColour') !== '#1E6292') {\n\t\t\t$additionalLessVariables[] = '@bg-base:' . $this->getOption('baseColour') . ';';\n\t\t\tif (!$this->isColourDark($this->getOption('baseColour'))) {\n\t\t\t\t$additionalLessVariables[] = '@text-bg-base:rgba(0,0,0,0.84);';\n\t\t\t}\n\t\t}\n\n\t\t// Pass additional LESS variables based on options\n\t\tif (!empty($additionalLessVariables)) {\n\t\t\t$this->modifyStyle('stylesheet', array('addLessVariables' => join($additionalLessVariables)));\n\t\t}\n\n\t\t$request = Application::getRequest();\n\n\t\t// Load icon font FontAwesome - http://fontawesome.io/\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\t\t\t$url = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css';\n\t\t} else {\n\t\t\t$url = $request->getBaseUrl() . '/lib/pkp/styles/fontawesome/fontawesome.css';\n\t\t}\n\t\t$this->addStyle(\n\t\t\t'fontAwesome',\n\t\t\t$url,\n\t\t\tarray('baseUrl' => '')\n\t\t);\n\n\t\t// Load jQuery from a CDN or, if CDNs are disabled, from a local copy.\n\t\t$min = Config::getVar('general', 'enable_minified') ? '.min' : '';\n\t\tif (Config::getVar('general', 'enable_cdn')) {\n\t\t\t$jquery = '//ajax.googleapis.com/ajax/libs/jquery/' . CDN_JQUERY_VERSION . '/jquery' . $min . '.js';\n\t\t\t$jqueryUI = '//ajax.googleapis.com/ajax/libs/jqueryui/' . CDN_JQUERY_UI_VERSION . '/jquery-ui' . $min . '.js';\n\t\t} else {\n\t\t\t// Use OJS's built-in jQuery files\n\t\t\t$jquery = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jquery/jquery' . $min . '.js';\n\t\t\t$jqueryUI = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jqueryui/jquery-ui' . $min . '.js';\n\t\t}\n\t\t// Use an empty `baseUrl` argument to prevent the theme from looking for\n\t\t// the files within the theme directory\n\t\t$this->addScript('jQuery', $jquery, array('baseUrl' => ''));\n\t\t$this->addScript('jQueryUI', $jqueryUI, array('baseUrl' => ''));\n\t\t$this->addScript('jQueryTagIt', $request->getBaseUrl() . '/lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js', array('baseUrl' => ''));\n\n\t\t// Load Bootsrap's dropdown\n\t\t$this->addScript('popper', 'js/lib/popper/popper.js');\n\t\t$this->addScript('bsUtil', 'js/lib/bootstrap/util.js');\n\t\t$this->addScript('bsDropdown', 'js/lib/bootstrap/dropdown.js');\n\n\t\t// Load custom JavaScript for this theme\n\t\t$this->addScript('default', 'js/main.js');\n\n\t\t// Add navigation menu areas for this theme\n\t\t$this->addMenuArea(array('primary', 'user'));\n\t}", "public function init(Theme $theme)\n {\n\n }", "public function setup_theme()\n {\n }", "public function init() {\n //Yii::app()->theme = Yii::app()->user->getCurrentTheme();\n //Yii::app()->theme = 'teacher';\n //parent::init();\n }", "public function __construct()\n\t{\n\t\t$this->setup_theme();\n\t}", "function __construct() {\n\t\tparent::__construct();\n\n\t\t//Prepare theme\n\t\t$this->theme_setup();\n\n\t}", "public function initTheme($theme_name);", "public function index() {\n\n $user = Auth::user();\n\n try {\n $directories = File::directories(Theme::THEMES_DIR);\n } catch (InvalidArgumentException $e) {\n } \n \n foreach ($directories as $directory) {\n\n /* if system is windows */\n $directory = str_replace('\\\\', '/', $directory);\n\n /* if theme is invalid, there is no creation nor update of theme, but it will be removed from DB */\n if ($this->theme_validation($directory) == true) {\n\n /* if theme does not exist in DB yet, create it */ \n try {\n\n $theme = Theme::where('root_dir', $directory)->firstOrFail(); \n\n } catch (ModelNotFoundException $e) {\n\n $contents = (require($directory . '/' . Theme::CONFIG_FILE));\n\n $theme = Theme::create([\n 'root_dir' => $directory,\n 'status' => Theme::STATUS_INACTIVE,\n 'user_id' => $user->id,\n 'config' => json_encode($contents)\n ]);\n\n }\n \n try {\n\n /* add config contents after previous deactivation of theme (which empties config field) */\n $theme = Theme::where('root_dir', $directory)->firstOrFail(); \n $contents = (require($directory . '/' . Theme::CONFIG_FILE));\n $theme->config = json_encode($contents);\n\n $theme_ideaspacevr_version = substr($contents['#ideaspace-version'], 2); \n if (version_compare($theme_ideaspacevr_version, config('app.version'), '>') === true) {\n $theme->status = Theme::STATUS_INCOMPATIBLE;\n } else if ($theme->status == Theme::STATUS_INCOMPATIBLE) {\n $theme->status = Theme::STATUS_INACTIVE;\n } \n\n /* theme passed validation but has error status */\n if ($theme->status == Theme::STATUS_ERROR) {\n $theme->status = Theme::STATUS_INACTIVE;\n }\n $theme->save(); \n\n } catch (ModelNotFoundException $e) {\n }\n\n } else {\n\n try {\n $theme = Theme::where('root_dir', $directory)->firstOrFail();\n $theme->status = Theme::STATUS_ERROR;\n $theme->save();\n } catch (ModelNotFoundException $e) {\n }\n\n } /* if */\n\n } /* foreach */\n\n\n $themes = Theme::orderBy('updated_at', 'desc')->get();\n $themes_mod = array();\n\n foreach ($themes as $theme) { \n $config = json_decode($theme->config, true);\n\n if ($theme->status==Theme::STATUS_ACTIVE) {\n $status_text = trans('template_themes_config.uninstall');\n } else if ($theme->status==Theme::STATUS_INACTIVE) {\n $status_text = trans('template_themes_config.install_theme');\n } else if ($theme->status==Theme::STATUS_INCOMPATIBLE) {\n $status_text = trans('template_themes_config.incompatible_theme');\n } else {\n $status_text = trans('template_themes_config.invalid_theme');\n }\n\n $theme_mod = array();\n $theme_mod['id'] = $theme->id; \n $theme_mod['theme-name'] = $config['#theme-name']; \n $theme_mod['theme-description'] = $config['#theme-description']; \n $theme_mod['theme-version'] = $config['#theme-version']; \n $theme_mod['theme-author-name'] = $config['#theme-author-name']; \n $theme_mod['theme-author-email'] = $config['#theme-author-email']; \n $theme_mod['theme-homepage'] = $config['#theme-homepage']; \n $theme_mod['theme-keywords'] = $config['#theme-keywords']; \n //$theme_mod['theme-compatibility'] = explode(',', $config['#theme-compatibility']); \n $theme_mod['theme-view'] = $config['#theme-view']; \n\n $theme_mod['status'] = $theme->status; \n $theme_mod['status_class'] = (($theme->status==Theme::STATUS_ACTIVE)?Theme::STATUS_ACTIVE:''); \n $theme_mod['status_aria_pressed'] = (($theme->status==Theme::STATUS_ACTIVE)?'true':'false'); \n $theme_mod['status_text'] = $status_text; \n $theme_mod['screenshot'] = url($theme->root_dir . '/' . Theme::SCREENSHOT_FILE); \n\n\t\t\t\t\t\t/* if lang directory exists we assume there are language files; support legacy themes without lang files */\n\t\t\t\t\t\tif (File::exists($theme->root_dir . '/lang')) {\n\t\t\t\t\t\t\t\t$theme_mod['theme-key'] = $config['#theme-key']; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$theme_mod['theme-key'] = null; \n\t\t\t\t\t\t}\n\n $themes_mod[] = $theme_mod;\n }\n\n $vars = [ \n 'themes' => $themes_mod,\n 'js' => array(asset('public/assets/admin/themes_configuration/js/themes_configuration.js'))\n ];\n\n return view('admin.themes_config', $vars);\n }", "private function getAllThemeFiles(){\n\t\t$themeFolder = zweb.\"themes/\";\n\t\t$files = scandir($themeFolder.$this->theme);\n\n\t\tif(gettype($files) != \"array\") $files = array();\n\t\tforeach($files as $file){\n\t\t\tif(!is_dir($themeFolder.$file)){\n\t\t\t\t$info = pathinfo($themeFolder.$file);\n\t\t\t\t$this->$info['filename'] = $this->getThemeFile($info['filename'], @$info['extension']);\n\t\t\t}\n\t\t}\n\t}", "public function __construct(){\n\t\tparent::__construct();\t\t\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->destination_path = \"/public/document/library/own/\";\n\t\t$this->data_view['pipeline_index'] \t= $this->data_view['view_path'] . '.pipeline.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->pipeline_model = new \\CustomerOpportunities\\CustomerOpportunitiesEntity;\n\t}", "public static function loadFromThemes()\n {\n $themePath = database_path('themes');\n $folders = scandir($themePath);\n\n foreach ($folders as $folder) {\n $fullPath = $themePath.'/'.$folder;\n\n if ($folder != '.' && $folder != '..' && is_dir($fullPath)) {\n $files = glob($fullPath . \"/index.html\");\n $content = file_get_contents($files[0]);\n preg_match_all('/(<title\\>([^<]*)\\<\\/title\\>)/i', $content, $m);\n $title = $m[2][0];\n\n // Create admin template\n $template = new self();\n $template->name = $title;\n $template->admin_id = 1;\n\n $template->loadFromDirectory($fullPath);\n }\n }\n }", "public function init()\n {\n\n $this->addWPConfigs();\n $this->addSPLConfigs();\n $this->addControllerConfigs();\n $this->addFieldGroupConfigs();\n $this->addFieldConfigs();\n $this->addImageSizeConfigs();\n $this->addLayoutConfigs();\n $this->addModelConfigs();\n $this->addPostTypeConfigs();\n $this->addTaxonomyConfigs();\n $this->addTemplateFunctionConfigs();\n $this->addHookableConfigs();\n $this->addSearchConfigs();\n $this->addBaseThemeConfigs();\n\n }", "private static function init(): void\n {\n parent::__install();\n $tmpl = _THEMES_ . \"/\" . _THEME_NAME_ . \"/tpl\";\n $smarty = self::getInstance(Smarty::class);\n $smarty->template_dir = $tmpl;\n $smarty->assign(\"template\", $tmpl);\n Modules::loadModules();\n\n }", "final public function init(){\n\t\twp_register_style( 'tify-tinymce_template', self::tFyAppUrl() . '/theme.css', array(), '1.150317' );\n\t}", "public function handle_load_themes_request()\n {\n }", "public function __construct()\n {\n $this->createObjects();\n\n $fileVersion = $this->_fileVersion->get();\n $this->loadResources(array(\n 'css' => $fileVersion['css']['posts'],\n 'js' => $fileVersion['js']['posts'])\n );\n }", "public static function init()\n {\n foreach (self::$_registeredThemes as $registeredTheme) {\n $theme = self::_initializeTheme($registeredTheme);\n self::$_themes[$theme->id()] = $theme;\n }\n\n self::$_initialized = true;\n }", "function __construct() {\n\t\t$config = ROOT_DIR . 'config/site.ini';\n\t\tif (file_exists($config)) {\n\t\t\t$config = new Zend_Config_Ini($config, APP_DEPLOY);\n\t\t\t$theme_location = $config->site->theme ? $config->site->theme : 'themes/default';\n\t\t} else {\n\t\t\t$theme_location = 'themes/default';\n\t\t}\n\n\t\t$this->theme_location = $theme_location;\n\t}", "public function init() {\n\t\t\n\t\t$class = $this->className();\n\t\t$config = $this->wire('config');\n\t\n\t\t$file = $config->paths->$class . \"$class.css\";\n\t\tif($this->loadStyles && is_file($file)) {\n\t\t\t$mtime = filemtime($file);\n\t\t\t$this->config->styles->add($config->urls->$class . \"$class.css?v=$mtime\");\n\t\t}\n\t\t\n\t\t$file = $config->paths->$class . \"$class.js\"; \n\t\t$mtime = 0;\n\t\tif($this->loadScripts && is_file($file)) {\n\t\t\t$minFile = $config->paths->$class . \"$class.min.js\";\n\t\t\tif(!$config->debug && is_file($minFile)) {\n\t\t\t\t$mtime = filemtime($minFile);\n\t\t\t\t$config->scripts->add($config->urls->$class . \"$class.min.js?v=$mtime\");\n\t\t\t} else {\n\t\t\t\t$mtime = filemtime($file);\n\t\t\t\t$config->scripts->add($config->urls->$class . \"$class.js?v=$mtime\");\n\t\t\t}\n\t\t}\n\n\t\tif(count($this->requested)) {\n\t\t\tforeach($this->requested as $name) {\n\t\t\t\t$url = $this->components[$name]; \n\t\t\t\tif(strpos($url, '/') === false) {\n\t\t\t\t\t$mtime = filemtime($config->paths->$class . $url);\n\t\t\t\t\t$url = $config->urls->$class . $url;\n\t\t\t\t}\n\t\t\t\t$url .= \"?v=$mtime\";\n\t\t\t\t$this->wire('config')->scripts->add($url);\n\t\t\t}\n\t\t\t$this->requested = array();\n\t\t}\n\n\t\t$this->initialized = true;\n\t}", "public function init()\n\t{\n\t\tparent::init();\n\t\t//$this->itemFile = Yii::getAlias($this->itemFile);\n\t\t$this->load();\n\t}", "protected function __onInit(): void\n\t{\n\t\tparent::__onInit();\n//\t\t$this->addThemeStyle( 'layout.css' );\n//\t\t$this->addThemeStyle( 'layout.panels.css' );\n\t\t$this->addThemeStyle( 'site.user.css' );\n\t\t$this->addThemeStyle( 'site.work.issue.css' );\n\t\t$this->addBodyClass( 'moduleWorkIssues' );\n\t\t$this->words\t\t= (array) $this->getWords( 'work/issue' );\n\t\t$this->logicProject\t\t= Logic_Project::getInstance( $this->env );\n\t\t$this->modelUser\t\t= new Model_User( $this->env );\t\t\t\t\t\t\t\t\t\t// get model of users\n\t\t$this->modelIssue\t\t= new Model_Issue( $this->env );\t\t\t\t\t\t\t\t\t// get model of issues\n\t\t$this->modelIssueNote\t= new Model_Issue_Note( $this->env );\t\t\t\t\t\t\t\t// get model of issue notes\n\t\t$this->modelIssueChange\t= new Model_Issue_Change( $this->env );\t\t\t\t\t\t\t\t// get model of issue changes\n\t}", "private function initialize() {\n $CI = get_instance();\n $CI->config->load('dwootemplate', TRUE);\n $config = $CI->config->item('dwootemplate');\n foreach ($config as $key => $val) {\n $this->$key = $val;\n }\n }", "protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename('.css'), $file->getPathname());\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_THEMES_NAME, $this->getThemes());\n }\n }", "public static function loadThemes()\n {\n $themesFolder = new Folder(ROOT . DS . 'themes');\n $themes = $themesFolder->read()[0];\n $loader = require ROOT . DS . 'vendor' . DS . 'autoload.php';\n foreach ($themes as $theme) {\n $loader->addPsr4('WasabiTheme\\\\' . $theme . '\\\\', [$themesFolder->path . DS . $theme . DS . 'src']);\n Plugin::load('WasabiTheme/' . $theme, [\n 'path' => $themesFolder->path . DS . $theme . DS,\n 'bootstrap' => true,\n 'routes' => false\n ]);\n }\n }", "private function setup_theme() {\n\n\t\tforeach( $this->get_image_sizes() as $image_size => $values ) {\n\t\t\tadd_image_size( $image_size, $values[0], $values[1] );\n\t\t}\n\n\t}", "public static function load_themes()\n\t{\n\t\t$config = Kohana::$config->load('site');\n\n\t\t//set admin theme based on path info\n\t\t$path = ltrim(Request::detect_uri(), '/');\n\t\tTheme::$is_admin = ( $path == \"admin\" || !strncmp($path, \"admin/\", 6) );\n\n\t\tif (Theme::$is_admin)\n\t\t{\n\t\t\t// Load the admin theme\n\t\t\tTheme::$admin_theme_name = $config->get('admin_theme', Theme::$admin_theme_name);\n\t\t\tTheme::$active = Theme::$admin_theme_name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Load the site theme\n\t\t\tTheme::$site_theme_name = $config->get('theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t//Set mobile theme, if enabled and mobile request\n\t\tif(Request::is_mobile() AND $config->get('mobile_theme', FALSE))\n\t\t{\n\t\t\t// Load the mobile theme\n\t\t\tTheme::$site_theme_name = $config->get('mobile_theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t// Admins can override the site theme, temporarily. This lets us preview themes.\n\t\tif (User::is_admin() AND isset($_GET['theme']) AND $override = $_GET['theme'])\n\t\t{\n\t\t\tif (file_exists(THEMEPATH.$override))\n\t\t\t{\n\t\t\t\tTheme::$site_theme_name = $override;\n\t\t\t\tTheme::$admin_theme_name = $override;\n\t\t\t\tTheme::$active \t\t = $override;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tKohana::$log->add(LOG::ERROR, 'Missing override site theme: :theme', array(':theme' => $override));\n\t\t\t}\n\t\t}\n\n\t\t//Finally set the active theme\n\t\tTheme::set_theme();\n\t}", "public static function init() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$theme = wp_get_theme();\n\t\tself::$version = self::$theme->get( 'Version' );\n\n\t\tself::setup_actions();\n\t}", "function get_themes()\n {\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "function __construct($page, $theme = \"default\")\n {\n $root_dir = dirname(__DIR__) . \"/themes/\";\n \n if (!file_exists(\"$root_dir/$theme\")) die(\"Requested theme '$theme' is not installed.\");\n if (!file_exists(\"$root_dir/$theme/$page.tpl\")) return false;\n $this->templateVars = array();\n\n $this->loadFile(\"$root_dir/$theme/$page.tpl\");\n }", "public function initContent()\n {\n parent::initContent();\n\n $this->setTemplate(_PS_THEME_DIR_.'<%= name %>.tpl');\n }", "public function action_init_theme()\n\t{\n\t\t$this->add_template('block.photoset_randomphotos', dirname(__FILE__) . '/block.photoset_randomphotos.php');\n\t\t$this->add_template('block.singlepage_content', dirname(__FILE__) . '/block.singlepage_content.php');\n\t\t\n\t\tFormat::apply('autop', 'comment_content_out');\n\t\tFormat::apply('autop', 'post_content_excerpt');\n\t\t\n\t\t$this->assign( 'multipleview', false);\n\t\t$action = Controller::get_action();\n\t\tif ($action == 'display_home' || $action == 'display_entries' || $action == 'search' || $action == 'display_tag' || $action == 'display_date') {\n\t\t\t$this->assign('multipleview', true);\n\t\t}\n\t}", "public function __construct($name = 'default')\n\t{\n\t\tif (is_null($this->path))\n\t\t{\n\t\t\t$this->path = path('public').'themes';\n\t\t\t$this->url = rtrim(URL::base(), '/').'/themes';\n\t\t\t$this->relative_url = str_replace(URL::base(), '/', $this->url);\n\t\t}\n\n\t\t// Check if the theme folder actually exist.\n\t\tif (is_dir($theme = $this->path.DS.$name))\n\t\t{\n\t\t\t$this->config = new Definition($theme); \n\t\t\t$this->name = $name;\n\t\t}\n\t}", "public static function setup()\n {\n $theme = static::getTheme();\n\n $className = static::getCalledClass();\n\n if ($theme === null) {\n $theme = new Theme();\n $theme->setClassName($className);\n $theme->setBackendTheme(static::isBackendTheme());\n $theme->setAvailable(true);\n\n Kernel::getService('em')->persist($theme);\n Kernel::getService('em')->flush();\n\n return true;\n }\n\n return false;\n }", "public function theme_installer()\n {\n }", "protected function loadThemes()\n {\n $finder = Finder::create()->directories()->in($this->themesPaths);\n\n foreach ($finder->getIterator() as $theme) {\n if ($theme->getRelativePath()) { // only get top level directories\n continue;\n }\n\n $themeFile = $theme->getRealPath() . '/theme.yml';\n\n if (!file_exists($themeFile)) {\n throw new \\Exception(sprintf('%s doesn\\'t exist.', $themeFile));\n }\n\n $config = (new Parser())->parse(file_get_contents($themeFile));\n\n if (!isset($config['name'])) {\n throw new \\Exception(sprintf('%s must contain a name value.', $themeFile));\n }\n\n $this->put($config['name'], new Theme($config, $theme->getRealPath()));\n }\n\n }", "public function scanThemes()\r\n {\r\n\r\n $parentThemes = [];\r\n $themesConfig = config('themes.themes', []);\r\n\r\n foreach ($this->loadThemesJson() as $data) {\r\n // Are theme settings overriden in config/themes.php?\r\n if (array_key_exists($data['name'], $themesConfig)) {\r\n $data = array_merge($data, $themesConfig[$data['name']]);\r\n }\r\n\r\n // Create theme\r\n $theme = new Theme(\r\n $data['name'],\r\n $data['asset-path'],\r\n $data['views-path']\r\n );\r\n\r\n // Has a parent theme? Store parent name to resolve later.\r\n if ($data['extends']) {\r\n $parentThemes[$theme->name] = $data['extends'];\r\n }\r\n\r\n // Load the rest of the values as theme Settings\r\n $theme->loadSettings($data);\r\n }\r\n\r\n // Add themes from config/themes.php\r\n foreach ($themesConfig as $themeName => $themeConfig) {\r\n\r\n // Is it an element with no values?\r\n if (is_string($themeConfig)) {\r\n $themeName = $themeConfig;\r\n $themeConfig = [];\r\n }\r\n\r\n // Create new or Update existing?\r\n if (!$this->exists($themeName)) {\r\n $theme = new Theme($themeName);\r\n } else {\r\n $theme = $this->find($themeName);\r\n }\r\n\r\n // Load Values from config/themes.php\r\n if (isset($themeConfig['asset-path'])) {\r\n $theme->assetPath = $themeConfig['asset-path'];\r\n }\r\n\r\n if (isset($themeConfig['views-path'])) {\r\n $theme->viewsPath = $themeConfig['views-path'];\r\n }\r\n\r\n if (isset($themeConfig['extends'])) {\r\n $parentThemes[$themeName] = $themeConfig['extends'];\r\n }\r\n\r\n $theme->loadSettings(array_merge($theme->settings, $themeConfig));\r\n }\r\n\r\n // All themes are loaded. Now we can assign the parents to the child-themes\r\n foreach ($parentThemes as $childName => $parentName) {\r\n $child = $this->find($childName);\r\n\r\n if ($this->exists($parentName)) {\r\n $parent = $this->find($parentName);\r\n } else {\r\n $parent = new Theme($parentName);\r\n }\r\n\r\n $child->setParent($parent);\r\n }\r\n }", "protected function loadThemeLayouts()\n {\n $this->layouts = [];\n $layoutsDirectory = new DirectoryIterator($this->getFolder() . '/layouts');\n foreach ($layoutsDirectory as $entry) {\n if ($entry->isDir() && ! $entry->isDot()) {\n $layoutSlug = $entry->getFilename();\n $layout = new ThemeLayout($this, $layoutSlug);\n $this->layouts[$layoutSlug] = $layout;\n }\n }\n }", "public function getTheme()\n {\n $this->appinfo['theme_vendor'] = DEF_VENDOR;\n $this->appinfo['theme_directory'] = DEF_THEME;\n $this->appinfo['theme_path'] = DIR_APP.DIRECTORY_SEPARATOR.$this->appinfo['theme_vendor'].DIRECTORY_SEPARATOR.DIR_THEMES.DIRECTORY_SEPARATOR.$this->appinfo['theme_directory'];\n $this->appinfo['theme_webpath'] = DIR_APP.'/'.$this->appinfo['theme_vendor'].'/'.DIR_THEMES.'/'.$this->appinfo['theme_directory'];\n }", "public function init()\n {\n $this->View()->addTemplateDir(dirname(__FILE__) . \"/Views/\");\n parent::init();\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->data_view \t\t\t\t\t= parent::setupThemes();\n\t\t$this->data_view['client_index'] \t= $this->data_view['view_path'] . '.clients.index';\n\t\t$this->data_view['html_body_class'] = 'page-header-fixed page-quick-sidebar-over-content page-container-bg-solid page-sidebar-closed';\n\t\t$this->data_view['include'] \t\t= $this->data_view['view_path'] . '.sms';\n\t\t$this->noteFolder \t \t\t\t\t= public_path() . '/documents';\n\t\t//'pdf|doc|docx|gif|jpg|png'\n\t\t$this->prefixNoteFileName = \\Auth::id();\n\t}", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'admin.models.*',\n 'admin.components.*',\n ));\n\n // set theme\n $theme_name = 'admin';\n Yii::app()->themeManager->setBaseUrl(Yii::app()->request->baseUrl . '/' . 'module-assets/');\n $theme_path = 'application.modules.admin.themes';\n Yii::app()->themeManager->basePath = Yii::getPathOfAlias($theme_path);\n Yii::app()->theme = $theme_name;\n\n\n // set view path\n $vPath = Yii::getPathOfAlias($theme_path . '.' . $theme_name . '.views');\n $this->setViewPath($vPath);\n\n Yii::app()->errorHandler->errorAction = 'admin/account/error';\n }", "public function init() {\n\t\t$this->add_options_page( 'Theme options' );\n\n\t\t$this->has(\n\t\t\t$this->build('theme_options', [\n\t\t\t\t'style' => 'seamless',\n\t\t\t])\n\t\t\t\t->addTab( 'General' )\n\t\t\t\t->addFields( $this->general_tab() )\n\t\t\t\t->addTab( 'Socials Links' )\n\t\t\t\t->addFields( $this->socials_tab() )\n\t\t\t\t->addTab( '404 Page' )\n\t\t\t\t->addFields( $this->page_404_tab() )\n\t\t\t\t->setLocation( 'options_page', '==', 'acf-options-theme-options' )\n\t\t);\n\t}", "public static function theme(): void\n {\n $smarty = self::getInstance(Smarty::class);\n if (defined(\"_PATH_\"))\n $smarty->assign(\"base\", _PATH_);\n $smarty->assign(\"css\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/css\");\n $smarty->assign(\"data\", _ROOT_ . \"/../data\");\n $smarty->assign(\"root\", _ROOT_);\n $smarty->assign(\"js\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/js\");\n $smarty->assign(\"img\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/img\");\n $smarty->assign(\"template\", _THEME_);\n\n if (file_exists(_APP_ . \"/routes.php\"))\n include_once(_APP_ . \"/routes.php\");\n else\n Display::response(\"No se ha encontrado el archivo routes.php\", \"json\", 500);\n \n if (is_dir(_SRC_ . \"/Routes\"))\n foreach (glob(_SRC_ . \"/Routes/*.php\") as $routeFile)\n require_once $routeFile;\n \n \n if (file_exists(_THEMES_ . \"/\" . _THEME_NAME_ . \"/index.php\")) {\n include_once(_THEMES_ . \"/\" . _THEME_NAME_ . \"/index.php\");\n }\n }", "protected function initializeExtensionFiles() {}", "public function ThemeEngineRender(){\n\t\t// Get the path and settings for the Theme\n\t\t$themeName = $this->config['theme']['name'];\n\t\t$themePath = RAND_INSTALL_PATH . \"/themes/{$themeName}\";\n\t\t$themeUrl = $this->request->base_url . \"themes/{$themeName}\"; \n\n\t\t//Add stylesheet\n\t\t$this->data['stylesheet'] = \"{$themeUrl}/style.css\";\n\n\t\t//Include global functions and functions.php from the theme\n\t\t$rd = &$this;\n\t\t$globalFunctions = RAND_INSTALL_PATH . \"themes/functions.php\";\n\t\tif(is_file($globalFunctions)){\n\t\t\tinclude $globalFunctions;\n\t\t}\n\t\t$functionsPath = \"{$themePath}/functions.php\";\n\t\tif(is_file($functionsPath)){\n\t\t\tinclude $functionsPath;\n\t\t}\n\n\t\textract($this->data);\n\t\tinclude(\"{$themePath}/default.tpl.php\");\n\n\n\n\t}", "function theme_init() {\n\n\t\tstatic $loaded;\n\n\t\tif ( $loaded ) {\n\t\t\treturn;\n\t\t} else {\n\t\t\t$loaded = true;\n\t\t}\n\n\t\t$config = apply_filters( 'publisher-theme-core/post-fields/config', array(\n\t\t\t'subtitle' => $this->subtitle,\n\t\t\t'subtitle-meta-id' => $this->subtitle_meta_id,\n\t\t\t'subtitle-default' => $this->subtitle_default,\n\t\t\t'excerpt' => $this->excerpt,\n\t\t) );\n\n\t\t$this->subtitle = isset( $config['subtitle'] ) ? $config['subtitle'] : $this->subtitle;\n\n\t\t$this->subtitle_meta_id = isset( $config['subtitle-meta-id'] ) ? $config['subtitle-meta-id'] : $this->subtitle_meta_id;\n\n\t\t$this->subtitle_default = isset( $config['subtitle-default'] ) ? $config['subtitle-default'] : $this->subtitle_default;\n\n\t\t$this->excerpt = isset( $config['excerpt'] ) ? $config['excerpt'] : $this->excerpt;\n\n\t\t// Compatibility for third party plugins with same functionality\n\t\tif ( $this->subtitle ) {\n\t\t\t$this->other_plugin_compatibility();\n\t\t}\n\n\t\tif ( $this->subtitle ) {\n\n\t\t\t// Add subtitle support to posts\n\t\t\tadd_post_type_support( 'post', 'bs_subtitle' );\n\n\t\t}\n\n\t\tif ( ( is_admin() && ! bf_is_doing_ajax() ) && ( $this->subtitle || $this->excerpt ) ) {\n\t\t\tadd_action( 'admin_init', array( $this, 'admin_init' ) );\n\t\t}\n\n\t}", "public function init()\n {\n $this->getBootstrap()->bootstrap('view');\n $options = $this->getOptions();\n if(!isset($options['theme'])){\n throw new Zend_Application_Resource_Exception('No theme name is supplied');\n }\n \n $options['layoutPath'] = APPLICATION_PATH . \"/../public/themes/\".$options['theme'];\n if(!file_exists($options['layoutPath'])){\n throw new Zend_Application_Resource_Exception('Theme given is not found');\n }\n\n $this->setOptions($options);\n if(!defined('THEME_BASE_URL'))\n define('THEME_BASE_URL', '/themes/'.$options['theme']);\n\n $view = $this->getLayout()->getView();\n $view->frontend($this->getOptions());\n\n if(file_exists($options['layoutPath'].'/views'))\n {\n $view->setScriptPath(APPLICATION_PATH.'/views/scripts');\n $view->addScriptPath($options['layoutPath'].'/views');\n }\n //now call to Zend layout resource plugin\n return parent::init();\n }", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "public function __construct() {\n\n\t\t// Setup empty class for the global $wpex_theme object\n\t\tglobal $wpex_theme;\n\t\t$wpex_theme = new stdClass;\n\n\t\t// Defines hooks and runs actions on init\n\t\tadd_action( 'init', array( $this, 'actions' ), 0 );\n\n\t\t// Define constants\n\t\tadd_action( 'after_setup_theme', array( $this, 'constants' ), 1 );\n\n\t\t// Load all the theme addons\n\t\tadd_action( 'after_setup_theme', array( &$this, 'addons' ), 2 );\n\n\t\t// Load configuration classes (post types & 3rd party plugins)\n\t\t// Must load first so it can use hooks defined in the classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'configs' ), 3 );\n\n\t\t// Load all core theme function files\n\t\tadd_action( 'after_setup_theme', array( &$this, 'include_functions' ), 4 );\n\n\t\t// Load framework classes\n\t\tadd_action( 'after_setup_theme', array( &$this, 'classes' ), 5 );\n\n\t\t// Load custom widgets\n\t\tadd_action( 'after_setup_theme', array( &$this, 'custom_widgets' ), 5 );\n\n\t\t// Populate the global opject after all core functions are registered and after the WP object is set up\n\t\t// Would be best to use template_redirect, but need to use wp_head to fix a bug with the Visual Composer Media Grid builder...\n\t\tadd_action( 'wp_head', array( $this, 'global_object' ), 0 );\n\n\t\t// Actions & filters\n\t\tadd_action( 'after_setup_theme', array( &$this, 'add_theme_support' ) );\n\n\t\t// Flush rewrites after theme switch to prevent 404 errors\n\t\tadd_action( 'after_switch_theme', array( &$this, 'flush_rewrite_rules' ) );\n\n\t\t// Load scripts in the WP admin\n\t\tadd_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );\n\n\t\t// Load theme CSS\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_css' ) );\n\n\t\t// Load responsive CSS - must be added last\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'responsive_css' ), 99 );\n\n\t\t// Load theme js\n\t\tadd_action( 'wp_enqueue_scripts', array( &$this, 'theme_js' ) );\n\n\t\t// Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_viewport' ), 1 );\n\n\t\t // Add meta viewport tag to header\n\t\tadd_action( 'wp_head', array( &$this, 'meta_edge' ), 0 );\n\n\t\t// Loads CSS for ie8\n\t\tadd_action( 'wp_head', array( &$this, 'ie8_css' ) );\n\n\t\t// Loads html5 shiv script\n\t\tadd_action( 'wp_head', array( &$this, 'html5_shiv' ) );\n\n\t\t// Adds tracking code to the site head\n\t\tadd_action( 'wp_head', array( &$this, 'tracking' ) );\n\n\t\t// Outputs custom CSS to the head\n\t\tadd_action( 'wp_head', array( &$this, 'custom_css' ), 9999 );\n\n\t\t// register sidebar widget areas\n\t\tadd_action( 'widgets_init', array( &$this, 'register_sidebars' ) );\n\n\t\t// Define the directory URI for the gallery metabox calss\n\t\tadd_action( 'wpex_gallery_metabox_dir_uri', array( &$this, 'gallery_metabox_dir_uri' ) );\n\n\t\t// Alter tagcloud widget to display all tags with 1em font size\n\t\tadd_filter( 'widget_tag_cloud_args', array( &$this, 'widget_tag_cloud_args' ) );\n\n\t\t// Alter WP categories widget to display count inside a span\n\t\tadd_filter( 'wp_list_categories', array( &$this, 'wp_list_categories_args' ) );\n\n\t\t// Exclude categories from the blog page\n\t\tadd_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) );\n\n\t\t// Add new social profile fields to the user dashboard\n\t\tadd_filter( 'user_contactmethods', array( &$this, 'add_user_social_fields' ) );\n\n\t\t// Add a responsive wrapper to the WordPress oembed output\n\t\tadd_filter( 'embed_oembed_html', array( &$this, 'add_responsive_wrap_to_oembeds' ), 99, 4 );\n\n\t\t// Allow for the use of shortcodes in the WordPress excerpt\n\t\tadd_filter( 'the_excerpt', 'shortcode_unautop' );\n\t\tadd_filter( 'the_excerpt', 'do_shortcode' );\n\n\t\t// Make sure the wp_get_attachment_url() function returns correct page request (HTTP or HTTPS)\n\t\tadd_filter( 'wp_get_attachment_url', array( &$this, 'honor_ssl_for_attachments' ) );\n\n\t\t// Tweak the default password protection output form\n\t\tadd_filter( 'the_password_form', array( &$this, 'custom_password_protected_form' ) );\n\n\t\t// Exclude posts with custom links from the next and previous post links\n\t\tadd_filter( 'get_previous_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_next_post_join', array( &$this, 'prev_next_join' ) );\n\t\tadd_filter( 'get_previous_post_where', array( &$this, 'prev_next_where' ) );\n\t\tadd_filter( 'get_next_post_where', array( &$this, 'prev_next_where' ) );\n\n\t\t// Redirect posts with custom links\n\t\tadd_filter( 'template_redirect', array( &$this, 'redirect_custom_links' ) );\n\n\t}", "function init() {\n\t\t\tadd_filter( 'mv_custom_schema', array( $this, 'custom_tables' ) );\n\n\t\t\tself::$models = MV_DBI::get_models(\n\t\t\t\tarray(\n\t\t\t\t\t$this->table_name,\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->settings_api = new Settings_API();\n\n\t\t\tadd_action( 'rest_api_init', array( $this, 'routes' ) );\n\t\t}", "private function getDirectories()\n {\n $this->load();\n\n $this->data['themeDirectory'] = 'catalog/view/theme/default/';\n $customizedFile = $this->data['themeDirectory'] . 'stylesheet/mundipagg/mundipagg_customized.css';\n\n if (file_exists($customizedFile)) {\n $this->data['customizedFile'] = $customizedFile;\n }\n }", "function configure_theme($themeFile) {\n $newEntry = $this->GetThemeInfo($this->css_dir.$themeFile);\n $this->products->columns = $newEntry['columns'];\n }", "public function getTheme();", "public function __construct(ThemeHandler $theme_handler, FileSystemInterface $file_system) {\n $this->themeHandler = $theme_handler;\n $this->fileSystem = $file_system;\n parent::__construct();\n }", "function init() {\r\n $this->load_upcss();\r\n }", "public function initialize() {\n $loadjquery = $this->modx->getOption('sekusergalleries.load_jquery');\n $this->setDefaultProperties(array(\n 'tplDirContainer' => 'directory.container',\n 'tplDirGraph' => 'directory.bargraph',\n 'graphcss' => '',\n 'customcss' => '',\n 'loadjquery' => $loadjquery,\n ));\n\n $this->directory_name = $this->modx->user->get('id');\n }", "public function __construct(Config $config, LibraryThemeModel $model, LayoutModel $layoutModel, File $directory) {\n parent::__construct($model);\n\n $this->config = $config;\n $this->layoutModel = $layoutModel;\n $this->templateFacade = null;\n $this->directory = $directory;\n $this->themes = null;\n }", "private function bootstrapTheme()\n {\n $this->setThemeSupport();\n $this->registerMenus();\n $this->registerCPT();\n $this->registerTemplates();\n $this->registerOptionsPages();\n $this->addImageSizes();\n }", "function load_zc_themes()\n{\n\tglobal $context;\n\tglobal $zcFunc, $zc;\n\t\n\t$edit_files = array();\n\t$context['zc']['themes'] = array();\n\t\n\tif (is_dir($zc['themes_dir']))\n\t{\n\t\tif ($dir = @opendir($zc['themes_dir']))\n\t\t{\n\t\t\twhile (($folder = readdir($dir)) !== false)\n\t\t\t{\n\t\t\t\t// skip non-folders\n\t\t\t\tif (!is_dir($zc['themes_dir'] . '/' . $folder))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// we want the theme's info file...\n\t\t\t\tif (file_exists($zc['themes_dir'] . '/' . $folder . '/info.php'))\n\t\t\t\t{\n\t\t\t\t\t$full_path = $zc['themes_dir'] . '/' . $folder . '/info.php';\n\t\t\t\t\t\n\t\t\t\t\t// get the file...\n\t\t\t\t\trequire_once($full_path);\n\t\t\t\t\n\t\t\t\t\tif (!empty($context['zc']['theme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$theme = $context['zc']['theme'];\n\t\t\t\t\t\t// theme ID must be unique!\n\t\t\t\t\t\tif (!isset($context['zc']['themes'][$theme['id']]))\n\t\t\t\t\t\t\t$context['zc']['themes'][$theme['id']] = $theme;\n\t\t\t\t\t\t// we'll have to make it unique then...\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$old_theme_id = $theme['id'];\n\t\t\t\t\t\t\t$theme['id'] = zc_make_unique_array_key($theme['id'], array($context['zc']['themes']));\n\t\t\t\t\t\t\t$context['zc']['themes'][$theme['id']] = $theme;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!isset($edit_files[$full_path]))\n\t\t\t\t\t\t\t\t$edit_files[$full_path] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!isset($edit_files[$full_path]['str_replace']))\n\t\t\t\t\t\t\t\t$edit_files[$full_path]['str_replace'] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$edit_files[$full_path]['str_replace'][] = array('\\''. $old_theme_id .'\\'', '\\''. $theme['id'] .'\\'');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$context['zc']['themes'][$theme['id']]['file'] = $full_path;\n\t\t\t\t\t\tunset($context['zc']['theme'], $theme);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dir);\n\t\t}\n\t}\n\t\n\t$context['zc']['admin_theme_settings'] = array();\n\tif (!empty($context['zc']['themes']))\n\t\tforeach ($context['zc']['themes'] as $theme_id => $array)\n\t\t{\n\t\t\tif (!empty($array['settings']))\n\t\t\t\tforeach ($array['settings'] as $setting => $array2)\n\t\t\t\t\t// if $setting is already taken... we'll need to make a unique key...\n\t\t\t\t\tif (!isset($context['zc']['admin_theme_settings'][$setting]) && !isset($temp[$setting]))\n\t\t\t\t\t\t$temp[$setting] = '';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_setting_key = $setting;\n\t\t\t\t\t\t$setting = zc_make_unique_array_key($setting, array($temp, $context['zc']['admin_theme_settings']));\n\t\t\t\t\t\t$context['zc']['themes'][$theme_id]['settings'][$setting] = $array2;\n\t\t\t\t\t\t$temp[$setting] = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]))\n\t\t\t\t\t\t\t$edit_files[$array['file']] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]['str_replace']))\n\t\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'][] = array('\\''. $old_setting_key .'\\'', '\\''. $setting .'\\'');\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($array['admin_settings']))\n\t\t\t\tforeach ($array['admin_settings'] as $setting => $array2)\n\t\t\t\t\t// make sure $setting is not already taken\n\t\t\t\t\tif (!isset($context['zc']['admin_theme_settings'][$setting]) && !isset($temp[$setting]))\n\t\t\t\t\t\t$context['zc']['admin_theme_settings'][$setting] = $array2;\n\t\t\t\t\t// we have to make a unique key...\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_setting_key = $setting;\n\t\t\t\t\t\t$setting = zc_make_unique_array_key($setting, array($temp, $context['zc']['admin_theme_settings']));\n\t\t\t\t\t\t$context['zc']['admin_theme_settings'][$setting] = $array2;\n\t\t\t\t\t\t$context['zc']['themes'][$theme_id]['admin_settings'][$setting] = $array2;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]))\n\t\t\t\t\t\t\t$edit_files[$array['file']] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]['str_replace']))\n\t\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'][] = array('\\''. $old_setting_key .'\\'', '\\''. $setting .'\\'');\n\t\t\t\t\t}\n\t\t}\n\t\t\n\t// adds the rest of the admin_theme_settings\n\tzc_prepare_admin_theme_settings_array();\n\t\t\n\t// now for admin theme settings...\n\tif (!empty($context['zc']['admin_theme_settings']))\n\t\tforeach($context['zc']['admin_theme_settings'] as $k => $array)\n\t\t{\n\t\t\t// skip base admin theme settings, because we already processed them...\n\t\t\tif (isset($context['zc']['base_admin_theme_settings'][$k]))\n\t\t\t\tcontinue;\n\t\t\n\t\t\tif (!isset($zc['settings'][$k]))\n\t\t\t\t$zc['settings'][$k] = $array['value'];\n\t\t\t\t\n\t\t\tif ($array['type'] == 'text')\n\t\t\t\t$zc['settings'][$k] = $zcFunc['un_htmlspecialchars']($zc['settings'][$k]);\n\t\t\t\t\n\t\t\tif (!empty($array['needs_explode']) && !is_array($zc['settings'][$k]))\n\t\t\t\t$zc['settings'][$k] = !empty($zc['settings'][$k]) ? explode(',', $zc['settings'][$k]) : array();\n\t\t}\n\t\t\n\tif (!empty($edit_files) && file_exists($zc['sources_dir'] . '/Subs-Files.php'))\n\t{\n\t\t// we'll need this...\n\t\trequire_once($zc['sources_dir'] . '/Subs-Files.php');\n\t\t\n\t\tif (function_exists('zcWriteChangeToFile'))\n\t\t\tforeach ($edit_files as $file => $edits)\n\t\t\t\tif (!empty($edits))\n\t\t\t\t\tzcWriteChangeToFile($file, $edits);\n\t}\n}", "function get_theme_data($theme_file)\n {\n }", "public function init() {\n Yii::app()->theme = 'bootstrap';\n }", "protected function init() {\n\t\t$this->load_image_sizes();\n\n\t\t// Set image size to WP\n\t\t$this->add_image_sizes();\n\t}", "public function init()\n {\n $this->loadMeta();\n }", "public function themeSetup()\n\t{\n\n\t\t// This theme styles the visual editor with editor-style.css to match the theme style.\n\t\tadd_editor_style();\n\n\t\t// This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\n\t\t\n\t\tadd_image_size('hero', 1920, 1080, true );\t\n\t\tadd_image_size('hero-news', 480, 250, true );\t\n\t\tadd_image_size('timeline', 768, 450, true );\t\t\n\t\t//add_image_size('660x400', 660, 400, true );\t\t\n\t\t//add_image_size('810x431', 810, 431, true );\t\t\t\n\n\t\t/**\n\t\t * Make theme available for translation\n\t\t * Translations can be filed in the /languages/ directory\n\t\t * If you're building a theme based on _s, use a find and replace\n\t\t * to change '_s' to the name of your theme in all the template files\n\t\t */\n\t\tload_theme_textdomain( DION_THEME_SLUG, get_template_directory() . '/languages' );\n\t\t\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t */\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\n\t\t/**\n\t\t * More menus can be added if necessary\n\t\t */\n\t\tregister_nav_menus( array(\n\t\t\t'primary' => __( 'Ana Menü', DION_THEME_SLUG ),\n\t\t\t'footer-section' => __( 'Alt Menü', DION_THEME_SLUG ),\n\t\t) );\n\n\n\t}", "public function __construct() {\n\t\tforeach ($this->_templates as $key => &$value) {\n\t\t\t$value = file_get_contents(LAYERS_ROOT_PATH . $this->_templateFiles[$key]);\n\t\t}\n\t}", "public function init() {\n \t$plugin_updater = new X_Plugin_Updater;\n \t$theme_updater = new X_Theme_Updater;\n }", "public function theme()\n {\n }", "function load()\n {\n self::loadScriptsAndStyles($this->m_themeLoad ? $this->m_themeName : false);\n }", "public function __construct( $theme = array() ) {\r\n\t\t$this->theme = $theme;\r\n\r\n\t\t$theme = wp_get_theme();\r\n\t\t$arr = array(\r\n\t\t\t'theme-name' => $theme->get( 'Name' ),\r\n\t\t\t'theme-slug' => $theme->get( 'TextDomain' ),\r\n\t\t\t'theme-version' => $theme->get( 'Version' ),\r\n\t\t);\r\n\r\n\t\t$this->theme = wp_parse_args( $this->theme, $arr );\r\n\t\t/**\r\n\t\t * If PHP Version is older than 5.3, we switch back to default theme\r\n\t\t */\r\n\t\tadd_action( 'admin_init', array( $this, 'php_version_check' ) );\r\n\t\t/**\r\n\t\t * Init epsilon dashboard\r\n\t\t */\r\n\t\tadd_filter( 'epsilon-dashboard-setup', array( $this, 'epsilon_dashboard' ) );\r\n\t\tadd_filter( 'epsilon-onboarding-setup', array( $this, 'epsilon_onboarding' ) );\r\n /**\r\n * Enqueue styles and scripts\r\n */\r\n add_action( 'wp_enqueue_scripts', array( $this, 'enqueues' ) );\r\n\t\t/**\r\n\t\t * Customizer enqueues & controls\r\n\t\t */\r\n\t\tadd_action( 'customize_register', array( $this, 'customize_register_init' ) );\r\n\t\t/**\r\n\t\t * Declare content width\r\n\t\t */\r\n\t\tadd_action( 'after_setup_theme', array( $this, 'content_width' ), 10 );\r\n\r\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'customizer_styles' ), 99 );\r\n\t\t/**\r\n\t\t * Grab all class methods and initiate automatically\r\n\t\t */\r\n\t\t$methods = get_class_methods( 'unapp' );\r\n\t\tforeach ( $methods as $method ) {\r\n\t\t\tif ( false !== strpos( $method, 'init_' ) ) {\r\n\t\t\t\t$this->$method();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function init(){\r\n\t\t$this->readDescriptionConfig();\r\n\t\t$this->readKeywordsConfig();\r\n\t\t$this->readMetaConfig();\r\n\t\t$this->readLinksConfig();\r\n\t\t$this->readScriptsConfig();\r\n\t}", "function theme()\n\t{\n\t\t$this->viewdata[\"function_title\"] = __(\"Theme\");\n\n\t\t$form = array();\n\n\t\t$form['open'] = array(\n\t\t\t'type' => 'open'\n\t\t);\n\t\t\n\t\t// build the array for the form\n\t\t$form['fs_gen_site_title'] = array(\n\t\t\t'type' => 'input',\n\t\t\t'label' => 'Title',\n\t\t\t'class' => 'span3',\n\t\t\t'placeholder' => FOOL_PREF_GEN_WEBSITE_TITLE,\n\t\t\t'preferences' => TRUE,\n\t\t\t'validate' => 'trim|max_length[32]',\n\t\t\t'help' => __('Sets the title of your site.')\n\t\t);\n\t\t\n\t\t// build the array for the form\n\t\t$form['fs_gen_index_title'] = array(\n\t\t\t'type' => 'input',\n\t\t\t'label' => 'Index title',\n\t\t\t'class' => 'span3',\n\t\t\t'placeholder' => FOOL_PREF_GEN_INDEX_TITLE,\n\t\t\t'preferences' => TRUE,\n\t\t\t'validate' => 'trim|max_length[32]',\n\t\t\t'help' => __('Sets the title displayed in the index page.')\n\t\t);\n\t\t\n\t\t$form['ff_lang_default'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'label' => __('Default language'),\n\t\t\t'help' => __('The language the users will see as they reach your site.'),\n\t\t\t'options' => config_item('ff_available_languages'),\n\t\t\t'default_value' => FOOL_LANG_DEFAULT,\n\t\t\t'preferences' => TRUE,\n\t\t);\n\n\t\t$form['separator-2'] = array(\n\t\t\t'type' => 'separator'\n\t\t);\n\t\t\n\t\t$themes = array();\n\t\t\n\t\t$this->load->model('theme_model', 'theme');\n\t\t\n\t\tforeach($this->theme->get_all() as $name => $theme)\n\t\t{\n\t\t\t$themes[] = array(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => $theme['name'] . ' theme',\n\t\t\t\t'help' => sprintf(__('Enable %s theme'), $theme['name']),\n\t\t\t\t'array_key' => $name,\n\t\t\t\t'preferences' => TRUE,\n\t\t\t\t'checked' => defined('FOOL_PREF_THEMES_THEME_' . strtoupper($name) . '_ENABLED') ?\n\t\t\t\t\tconstant('FOOL_PREF_THEMES_THEME_' . strtoupper($name) . '_ENABLED'):0\n\t\t\t);\n\t\t}\n\t\t\n\t\t$form['fs_theme_active_themes'] = array(\n\t\t\t'type' => 'checkbox_array',\n\t\t\t'label' => __('Active themes'),\n\t\t\t'help' => __('Choose the themes to make available to the users. Admins are able to access any of them even if disabled.'),\n\t\t\t'checkboxes' => $themes\n\t\t);\n\t\t\n\t\t$themes_default = array();\n\t\t\n\t\tforeach($this->theme->get_all() as $name => $theme)\n\t\t{\n\t\t\t$themes_default[$name] = $theme['name'];\n\t\t}\n\t\t\n\t\t$form['fs_theme_default'] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'label' => __('Default theme'),\n\t\t\t'help' => __('The theme the users will see as they reach your site.'),\n\t\t\t'options' => $themes_default,\n\t\t\t'default_value' => FOOL_THEME_DEFAULT,\n\t\t\t'preferences' => TRUE,\n\t\t);\n\n\t\t$form['fs_theme_google_analytics'] = array(\n\t\t\t'type' => 'input',\n\t\t\t'label' => __('Google Analytics code'),\n\t\t\t'placeholder' => 'UX-XXXXXXX-X',\n\t\t\t'preferences' => TRUE,\n\t\t\t'help' => __(\"Insert your Google Analytics code to get statistics.\"),\n\t\t\t'class' => 'span2'\n\t\t);\n\n\t\t$form['separator-3'] = array(\n\t\t\t'type' => 'separator'\n\t\t);\n\n\t\t$form['fs_theme_header_text'] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => __('Header Text (\"notices\")'),\n\t\t\t'preferences' => TRUE,\n\t\t\t'help' => __(\"Inserts the text above in the header, below the nagivation links.\"),\n\t\t\t'class' => 'span5'\n\t\t);\n\n\t\t$form['fs_theme_header_code'] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => __('Header Code'),\n\t\t\t'preferences' => TRUE,\n\t\t\t'help' => __(\"This will insert the HTML code inside the &lt;HEAD&gt;.\"),\n\t\t\t'class' => 'span5'\n\t\t);\n\n\t\t$form['fs_theme_footer_text'] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => __('Footer Text'),\n\t\t\t'preferences' => TRUE,\n\t\t\t'help' => __('Credits in the footer and similar.'),\n\t\t\t'class' => 'span5'\n\t\t);\n\n\t\t$form['fs_theme_footer_code'] = array(\n\t\t\t'type' => 'textarea',\n\t\t\t'label' => __('Footer Code'),\n\t\t\t'preferences' => TRUE,\n\t\t\t'help' => __(\"This will insert the HTML code above after the &lt;BODY&gt;.\"),\n\t\t\t'class' => 'span5'\n\t\t);\n\n\t\t$form['separator'] = array(\n\t\t\t'type' => 'separator'\n\t\t);\n\n\t\t$form['submit'] = array(\n\t\t\t'type' => 'submit',\n\t\t\t'value' => __('Submit'),\n\t\t\t'class' => 'btn btn-primary'\n\t\t);\n\n\t\t$form['close'] = array(\n\t\t\t'type' => 'close'\n\t\t);\n\n\t\t$this->preferences->submit_auto($form);\n\n\t\t$data['form'] = $form;\n\n\t\t// create a form\n\t\t$this->viewdata[\"main_content_view\"] = $this->load->view(\"admin/form_creator\",\n\t\t\t$data, TRUE);\n\t\t$this->load->view(\"admin/default\", $this->viewdata);\n\t}", "function GetThemeInfo ($filename) { \n $dataBack = array();\n if ($filename != '') {\n $default_headers = array(\n 'label' => 'label',\n 'file' => 'file',\n 'columns' => 'columns'\n );\n \n $dataBack = get_file_data($filename,$default_headers,'');\n $dataBack['file'] = preg_replace('/.css$/','',$dataBack['file']); \n }\n \n return $dataBack;\n }", "function init_files() {\n\t$filenames = [\n\t\t'genesis',\n\t\t'general',\n\t\t'gravity-forms',\n\t\t'yoast-seo',\n\t\t'acf/options-page',\n\t\t'acf/general'\n\t];\n\n\tload_specified_files( $filenames );\n}", "public function init(){\n parent::init();\n \n $this->_contentTypesModel = new Application_Model_ContentTypes();\n $this->_helper->viewRenderer->setNoRender(true); \n }", "function load_local_theme_files(){\n\t$files = array(\n\t\t'classes/Site.php',\n\t\t'classes/RouteCreator.php',\n\t\t'classes/AdminOptions.php',\n\t);\n\n\tif ($files) {\n\t\tforeach ($files as $file) {\n\t\t\trequire_once($file);\n\t\t}\n\t}\n}", "public function init(){\n parent::init();\n $this -> publishAssets();\n }", "public function __construct(){\n\n $this->define_theme_globals();\n $this->define_theme_supports();\n $this->define_image_sizes();\n $this->replace_3rd_party_pugins_hooks();\n $this->remove_actions();\n $this->init_hooks();\n $this->include_global();\n\n if( $this->is_request( 'frontend' )){\n add_action('wp_head', array('theme_construct_page', 'init'));\n }\n\n if( $this->is_request( 'admin' )){\n // $this->include_admin();\n }\n }", "public function init()\n {\n add_action('after_setup_theme', [$this, 'themeSetup']);\n }", "public function init()\n {\n $templates = $this->getConfig($this->getConfigFiles());\n $view = $this->prepare($this->getView());\n return $this->createFactory($templates, $view);\n }", "public function init() {\n//\t\tif (checkTable()) {\n//\t\t\t$this->model->upgrade();\n//\t\t}\n//\t\telse {\n\t\t\t$this->model->install();\n\t\t\t$this->loadDefaults();\n//\t\t}\n\t\t\n\t}", "function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}", "function __construct()\n {\n parent::__construct();\n /* mulai load C_size_model.php di folder model */\n $this->load->model('Mo_slider', 'slider');\n /* cara pemanggilan C_size menjadi size */\n /* selesai load C_size_model.php di folder model */\n }", "public function get_themes()\n\t{\n\t\t// load the helper file\n\t\t$this->load->helper('file');\n\n\t\t// get the list of 'folders' which\n\t\t// just means we're getting a potential\n\t\t// list of new themes that's been installed\n\t\t// since we last looked at themes\n\t\t$folders = get_dir_file_info(APPPATH . 'themes/');\n\n\t\t// foreach of those folders, we're loading the class\n\t\t// from the theme_details.php file, then we pass it\n\t\t// off to the save_theme() function to deal with \n\t\t// duplicates and insert newly added themes.\n\t\tforeach ($folders as &$folder)\n\t\t{\n\t\t\t// spawn that theme class...\n\t\t\t$details = $this->spawn_class($folder['relative_path'], $folder['name']);\n\n\t\t\t// if spawn_class was a success\n\t\t\t// we'll see if it needs saving\n\t\t\tif ($details)\n\t\t\t{\n\t\t\t\t// because this pwnd me for 30 minutes\n\t\t\t\t$details->path = $folder['name'];\n\t\t\t\n\t\t\t\t// save it...\n\t\t\t\t$this->save_theme($details);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// now that we've updated everything, let's\n\t\t// give the end user something to look at.\n\t\treturn $this->db->get($this->_table['templates'])->result();\n\t}", "public function initialize_scripts_and_styles() {\n\t\tTypes_Asset_Manager::get_instance();\n\t}", "public function loadInit() {}", "public function init() {\n parent::init();\n $this -> publishAssets();\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Fontend_model');\n $this->load->model('Package_model');\n }", "public function init(){\n $this->sourcePath = __DIR__ . DIRECTORY_SEPARATOR .'assets';\n\n if($this->theme == 'bootstrap' ){\n $this->depends = [\n 'yii\\web\\YiiAsset',\n 'yii\\bootstrap\\BootstrapAsset',\n ];\n }\n parent::init() ;\n }", "public function __construct( $theme_data ) {\n\n\t\t$this->theme_data = $theme_data;\n\n\t}", "protected function Init() \n {\n // Load the APP config.php and add the defined vars\n $this->load($this->files['app']['file_path'], 'app');\n \n // Load the core.config.php and add the defined vars\n $this->load($this->files['core']['file_path'], 'core', 'config');\n \n // Load the database.config.php and add the defined vars\n $this->load($this->files['db']['file_path'], 'db', 'DB_configs');\n }" ]
[ "0.6800195", "0.6731695", "0.67305124", "0.67175525", "0.6597495", "0.6528827", "0.6504817", "0.6497808", "0.64037544", "0.63582635", "0.6344182", "0.6338255", "0.6320793", "0.6295597", "0.6273367", "0.6236512", "0.6214242", "0.6148983", "0.613683", "0.6130994", "0.61259943", "0.61226374", "0.61024994", "0.607208", "0.607138", "0.60641897", "0.6050765", "0.60272324", "0.60013694", "0.594922", "0.5944089", "0.59406507", "0.59387785", "0.59378505", "0.5933624", "0.5921172", "0.5913148", "0.59095836", "0.5903132", "0.5899518", "0.58945256", "0.5890527", "0.5879858", "0.58730584", "0.587194", "0.58570844", "0.58481836", "0.5835128", "0.58317405", "0.58282894", "0.5826501", "0.5825554", "0.5821382", "0.58156943", "0.58053625", "0.58010256", "0.5786669", "0.5780644", "0.57680565", "0.57662064", "0.5760317", "0.5760165", "0.5759971", "0.57585186", "0.57542115", "0.5753932", "0.5749134", "0.57314485", "0.57304883", "0.572677", "0.57124215", "0.57054454", "0.56933445", "0.5693271", "0.5689429", "0.56854737", "0.568545", "0.5685215", "0.5682695", "0.5679652", "0.5670953", "0.5667093", "0.5663794", "0.56633896", "0.565988", "0.5659604", "0.5657185", "0.56566024", "0.5647799", "0.56434464", "0.56411105", "0.5630144", "0.5627108", "0.56259036", "0.5625029", "0.5622637", "0.56116986", "0.5611071", "0.5610888", "0.56106776" ]
0.7487144
0
Prepare file before it will be saved
public function beforeSave() { $fileService = $this->getCustomizationService(); $fileService->prepareFile($this); $fileService->save($this); return parent::beforeSave(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creating the directory failed\n\t\t\t\tthrow new Exception(elgg_echo('userexport:error:nofiledir'));\n\t\t\t}\n\t\t}\n\n\t\t// Delete any existing file\n\t\tunlink($this->filename);\n\t}", "public function prepareToUpload(): void\n {\n if (!$this->hasFile()) {\n return;\n }\n\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n if ($this->namePrefix !== null) {\n $filename = Uri::getUrl($this->namePrefix) . '_' . $filename;\n }\n $this->fileName = $filename . '.' . $this->getFile()->guessExtension();\n }", "function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "protected function createFile() {}", "protected function prepareEnvForEmptyFile()\n {\n $file = 'magento_empty.jpg';\n\n /** @var \\Magento\\Framework\\Filesystem $filesystem */\n $filesystem = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class);\n $tmpDirectory = $filesystem->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::SYS_TMP);\n $filePath = $tmpDirectory->getAbsolutePath($file);\n\n $_FILES['options_1_file'] = [\n 'name' => 'test.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n ];\n }", "protected function initStorageFile()\n {\n $storageFilePath = $this->getStoragePath();\n if(!file_exists($storageFilePath)) {\n touch($storageFilePath);\n fwrite(fopen($storageFilePath, \"w\"), static::HEADER . \"\\n\");\n }\n }", "public static function prepare_files($file_name, $directory_path){\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\")){ # .in file\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n exec('echo \"0\" >' . \"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n }\n }", "public function prepare() {\n if (!isset($this->Created))\n $this->Created = date('YmdHis', time());\n\n if (isset($this->ConfirmPassword))\n unset($this->ConfirmPassword);\n\n $this->Password = Auth::getHash($this->Password);\n// $this->ProfileImage = $this->_processProfileImage();\n }", "public function save() {\n\t\t$vars = $this->vars;\n\t\t$this->copyFromTemplateIfNeeded();\n\t\t$lines = file($this->filePath);\n\t\tforeach ($lines as $key => $line) {\n\t\t\tif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=(.*)\\\"(.*)\\\";(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]\\\"{$vars[$arr[3]]}\\\";$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t} elseif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=([ \t]+)([0-9]+);(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]{$vars[$arr[3]]};$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t}\n\t\t}\n\n\t\tunset($vars['module_load_paths']); // hacky\n\n\t\t// if there are additional vars which were not present in the config\n\t\t// file or in template file then add them at end of the config file\n\t\tif (!empty($vars)) {\n\t\t\t$lines []= \"<?php\\n\";\n\t\t\tforeach ($vars as $name => $value) {\n\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = \\\"$value\\\";\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = $value;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lines []= \"\\n\";\n\t\t}\n\n\t\tfile_put_contents($this->filePath, $lines);\n\t}", "public function preUpload()\n {\n if (null !== $this->getFile()) {\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->getFile()->guessExtension();\n }\n }", "public function prepareParsing()\n {\n $this->saverHelper->createFirstSheet();\n }", "public function storeFile()\n\t{\n\t\tif (!$this->blnIsModified)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$strFile = trim($this->strTop) . \"\\n\\n\";\n\t\t$strFile .= \"-- LESSON SEGMENT START --\\nCREATE TABLE `tl_cb_lessonsegment` (\\n\";\n\n\t\tforeach ($this->arrData as $k=>$v)\n\t\t{\n\t\t\t$strFile .= \" `$k` $v,\\n\";\n\t\t}\n\n\t\t$strFile .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n-- LESSON SEGMENT STOP --\\n\\n\";\n\n\t\tif ($this->strBottom != '')\n\t\t{\n\t\t\t$strFile .= trim($this->strBottom) . \"\\n\\n\";\n\t\t}\n\n\t\t$objFile = new File('system/modules/course_builder/config/database.sql');\n\t\t$objFile->write($strFile);\n\t\t$objFile->close();\n\t}", "public function preUpload()\n {\n if (null !== $this->file) {\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->file->guessExtension();\n $this->fileName = $this->file->getClientOriginalName();\n $this->size = $this->file->getSize();\n $this->type = $this->file->getMimeType();\n $this->uploadDate = new \\DateTime('now');\n }\n }", "protected function setUp()\n {\n $this->filename = tempnam(sys_get_temp_dir(), 'Prospect');\n file_put_contents($this->filename, \"This is a test file\");\n $this->object = new File('picture',$this->filename,'text/plain');\n }", "private function setup_files() {\n $this->record_progress(\n \"Step 6: Preparing files for further analysis\");\n\n $path_new_input = $this->path_new_input;\n $path_spliceman = $this->path_spliceman;\n $path_RBPs_new = $this->path_RBPs_new;\n $path_errors = $this->path_errors;\n\n exec(\"perl\\\n /var/www/html/spliceman_beta/scripts/setup_spliceman_RBP_files.pl\\\n /var/www/html/spliceman_beta/genome_data/hg19.fa\\\n '$path_new_input'\\\n '$path_spliceman'\\\n '$path_RBPs_new'\\\n '$path_errors'\", \n $output, \n $return);\n\n if ($return) {\n $this->pipeline_error(\n \"Error in pipeline, please contact administrator\n and provide step 6\");\n }\n if (count($output) > 0) {\n $this->pipeline_error($output);\n }\n }", "public function prepareCfg() {\n if($result = DB::get()->query(\"SELECT * FROM `config` WHERE `sid` = '\" . $this->sid . \"'\")) {\n $row = $result->fetch_assoc();\n $result->close();\n\n $file = PATH . '/serverdata/server' . $this->sid . '.cfg';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['cfg']);\n\n $file = PATH . '/serverdata/mapcycle' . $this->sid . '.txt';\n if(!file_exists($file)) {\n touch($file);\n chmod($file, 0777);\n }\n file_put_contents($file, $row['mapcycle']);\n }\n }", "function save()\r\n {\r\n // read the template\r\n\t $str = dirname(__FILE__); \r\n $content = file_get_contents(dirname(__FILE__).'/partinfo.php'); \r\n if (!$content){\r\n return \"fail read template\";\r\n } \t\r\n \r\n\t $tags = array(\"#TITLE#\", \r\n\t \t\"#BRAND#\", \r\n\t \t\"#MODULE#\", \r\n\t \t\"#ENGINE#\", \r\n \"#TYPE#\", \r\n \"#NAME#\", \r\n \"ADDRESS\", \r\n \"#DATE#\", \r\n \"#PRICE#\", \r\n \"DESCRIPTION\");\r\n\t \r\n $fields[0] = $this->title;\r\n $fields[1] = $this->brand;\r\n $fields[2] = $this->series;\r\n $fields[3] = $this->module;\r\n $fields[4] = \"配件\";\r\n $fields[5] = $this->module;\r\n $fields[6] = \"广州\";\r\n $fields[7] = $this->date;\r\n $fields[8] = $this->price;\r\n $fields[9] = $this->description;\r\n \r\n $content = str_replace($tags,$fields,$content); \r\n \r\n $date = date(\"Ymd-Hms\");\r\n $filename = sprintf(\"publish/%d-%d-%s.php\", $this->id, $this->uid, $date);\r\n $fp = fopen($filename, \"w\");\r\n if (!$fp) {\r\n return \"fail create file\";\r\n }\r\n \r\n if (fwrite($fp, $content) == FALSE) { \t \r\n fclose($fp);\r\n return \"fail wirte content\";\r\n }\r\n \r\n fclose($fp);\r\n return $filename;\r\n }", "private function _initSubRipFile()\n {\n file_put_contents($this->fileDir . $this->subtitleFile, '');\n }", "protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }", "public function prepareDatabase()\n {\n // If SQLite database does not exist, create it\n if ($this->config->database['connection'] === 'sqlite') {\n $path = $this->config->database['database'];\n if ( ! $this->fileExists($path) && is_dir(dirname($path))) {\n $this->write(\"Creating $path ...\");\n touch($path);\n }\n }\n }", "public function prepareImportContent();", "function _prepare() {}", "protected function _writeFileHeader() {}", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "private function createNewTmpICal()\n\t{\n\n\t\t$config = Factory::getConfig();\n\t\t$path = $config->get('config.tmp_path') ? $config->get('config.tmp_path') : $config->get('tmp_path');\n\t\techo \"create temp CSV conversion file in \" . $path . \"<br/>\";\n\t\t$this->tmpFileName = tempnam($path, \"phpJE\");\n\t\t//$this->tmpFileName = tempnam(\"/tmp\", \"phpJE\");\n\t\t$this->tmpfile = fopen($this->tmpFileName, \"w\");\n\t\tfwrite($this->tmpfile, \"BEGIN:VCALENDAR\\n\");\n\t\tfwrite($this->tmpfile, \"VERSION:2.0\\n\");\n\t\tfwrite($this->tmpfile, \"PRODID:-//jEvents 2.0 for Joomla//EN\\n\");\n\t\tfwrite($this->tmpfile, \"CALSCALE:GREGORIAN\\n\");\n\t\tfwrite($this->tmpfile, \"METHOD:PUBLISH\\n\");\n\n\t}", "public function prepareImport();", "public function generate() {\n $this->event->getIO()->write(\"<info>Generate settings file:</info>\");\n\n $parameters = $this->getParameters();\n if ($parameters) {\n $new_settings = $this->twigEnvironment->render($this->getTemplateFilename(), $this->getReplacements($parameters));\n $target_settings_file = $this->getDestinationPath() . '/' . $this->getDestinationFile();\n\n // Ensure folder and existing file is writable.\n chmod($this->getDestinationPath(), 0755);\n if (file_exists($target_settings_file)) {\n chmod($target_settings_file, 0644);\n }\n\n file_put_contents($target_settings_file, $new_settings);\n }\n else {\n $this->event->getIO()->write(\"<error>Unable to find any parameters files</error>\");\n }\n }", "function prepareOptionsForWriting()\n {\n $content = $this->bindFields();\n $filename = $this->prepareFile();\n return (object)compact('content','filename');\n }", "public function prepareFilePath()\n {\n $this->_filePath = $this->_config[\"module_path\"] . '/' . $this->_pathRelativeToModule . '/webapi.xml';\n return $this;\n }", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "private function prepareFiles() {\n $zip = new ZipArchive;\n if ($zip->open(self::PARSE_DIR . '/' . self::ARCHIVE_FILENAME) === TRUE) {\n $zip->extractTo($this->tmpFolder);\n $zip->close();\n } else {\n $this->errors[] = 'Невозможно распаковать архив!';\n }\n }", "abstract public function prepareToStore();", "protected function prepare()\n\t{\n\t}", "function beforeSave() {\n\t\t$this->getFile();\n\t\t/** Si no cargo el documento, lo obtengo desde el cuit. */\n\t\tif (empty($this->data['Trabajador']['numero_documento']) && !empty($this->data['Trabajador']['cuil'])) {\n\t\t\t$this->data['Trabajador']['numero_documento'] = substr(str_replace('-', '', $this->data['Trabajador']['cuil']), 2, 8);\n\t\t}\n\t\t\n\t\treturn parent::beforeSave();\n\t}", "protected function prepareGenerationFromHtml(): void\n {\n // Save the HTML in a temporary file and then set the from url.\n $file = $this->makeTemporaryFile();\n\n file_put_contents($file, $this->fromHtml);\n\n $this->from = $file;\n }", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}", "public function prepare() {\n // Initialize instance variables\n $this->postData = $this->bot->getPostData();\n\n $this->findAndReplacesForImageUrls = $this->bot->getSetting(SettingKey::POST_FIND_REPLACE_IMAGE_URLS);\n $this->postSaveImagesAsMedia = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_MEDIA);\n $this->postSaveAllImagesInContent = $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_ALL_IMAGES_IN_CONTENT);\n $this->postSaveImagesAsGallery = $this->postSaveImagesAsMedia && $this->bot->getSettingForCheckbox(SettingKey::POST_SAVE_IMAGES_AS_GALLERY);\n\n // If the user wants to save all images in the post content, set \"save images as media\" to true so that the\n // script can run properly.\n if($this->postSaveAllImagesInContent) {\n $this->postSaveImagesAsMedia = true;\n }\n\n // Save the thumbnail URL first, because the thumbnail may be removed by gallery image selectors later.\n $this->prepareAndSaveThumbnail();\n\n // Prepare the attachment data.\n $this->prepareAttachmentData();\n }", "protected function setUp()\n\t{\n\t\tMisc::$file = (dirname(__FILE__).'/files/config.php');\n\t\tfile_put_contents(Misc::$file, \"<?php return \".var_export(array(\n\t\t\t\t'trees' => array(\n\t\t\t\t\t'oak' => array(\n\t\t\t\t\t\t'fairy' => 'Tinkerbell'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t), true).';');\n\t}", "public function beforeSave()\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n foreach ($this->attributes as $attribute => $attributeConfig) {\n if ($this->hasScenario($attributeConfig)) {\n if (isset($this->files[$attribute]) && $this->validateFile($this->files[$attribute])) {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave') === true) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n } else {\n // Protect attribute\n $model->$attribute = $model->getOldAttribute($attribute);\n }\n } else {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave')) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n }\n }\n $this->fileSave();\n }", "protected function setUp(): void\n {\n /** @var File $file */\n parent::setUp();\n TestAssetStore::activate('UsedOnTableTest');\n $path = dirname(__DIR__) . '/Forms/fixtures/testfile.txt';\n $content = file_get_contents($path ?? '');\n $file = File::get()->find('Name', 'testfile.txt');\n $file->setFromString($content, $file->generateFilename());\n }", "protected function prepareFileContents() {\n\t\t// convert all language values to utf-8\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, TRUE, array('default'));\n\t\t}\n\n\t\t$mainFileContent = array('meta' => $this->prepareMeta());\n\t\t$languages = sgLib::getSystemLanguages();\n\t\tforeach ($languages as $langKey) {\n\t\t\t$mainFileContent = array_merge_recursive(\n\t\t\t\t$mainFileContent,\n\t\t\t\t$this->getLangContent($this->localLang[$langKey], $langKey)\n\t\t\t);\n\t\t}\n\n\t\t// prepare Content for the main file\n\t\t$languageFiles[$this->absFile] = $this->array2xml($mainFileContent, 'T3locallang');\n\n\t\treturn $languageFiles;\n\t}", "public function preSave() {}", "public function createQAfile()\r\n {\r\n $originalFile = realpath(__DIR__ . '/../Resources/files/templates/QA-sample.txt');\r\n $newFile = $this->destination_dir.'/QA.txt';\r\n\r\n $this->createCopiedFile($originalFile, $newFile);\r\n }", "private function resetStorageFile(){\n $newFile = self::STORAGE_FILE_TEMPLATE_HEADER.self::STORAGE_FILE_TEMPLATE_BODY.self::STORAGE_FILE_TEMPLATE_FOOTER;\n if(!file_exists(realpath($newFile))){\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n if(!is_dir($dirName)){\n mkdir($dirName,\"640\",true);\n }\n }\n if(false === @file_put_contents(self::STORAGE_FILE,$newFile)){\n die(\"Could not reset storage file\");\n }else{\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n file_put_contents($dirName.\"/.htaccess\",self::STORAGE_FILE_TEMPLATE_HTACCESS);\n }\n }", "public function preSave() { }", "public function prepareFile($file)\r\n {\r\n $this->file = $file;\r\n\r\n return !!$this->file;\r\n }", "protected function preCommitSetup() :void\n {\n $url = \"https://raw.githubusercontent.com/EngagePHP/pre-commit/master/setup.sh\";\n $content = file_get_contents($url);\n $path = app_path('setup.sh');\n\n Storage::put($path, $content);\n\n chmod($path, 0751); //rwxr-x--x\n }", "protected function _after_save(){\n if(file_exists($this->_path))\n $this->_path_infos = pathinfo($this->_path);\n }", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "protected function _writeFileBody() {}", "public function postImport() {\n $this->closeFile();\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "protected function prepare()\n {\n $this->register('require', function($context, $path) {\n $context->requireAsset($path);\n });\n\n $this->register('depend_on', function($context, $path) {\n $context->dependOn($path);\n });\n\n $this->register('require_tree', function($context, $path) {\n $context->requireTree($path);\n });\n\n $this->body = $this->getData();\n\n if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {\n $this->header = $matches[0];\n $this->body = substr($this->getData(), strlen($matches[0])) ?: '';\n }\n\n $this->processed = array();\n }", "protected function onBeforeWrite()\n {\n // If no title provided, reformat filename\n if (!$this->Title) {\n // Strip the extension\n $this->Title = preg_replace('#\\.[[:alnum:]]*$#', '', $this->Name);\n // Replace all punctuation with space\n $this->Title = preg_replace('#[[:punct:]]#', ' ', $this->Title);\n // Remove unecessary spaces\n $this->Title = preg_replace('#[[:blank:]]+#', ' ', $this->Title);\n }\n return parent::onBeforeWrite();\n }", "private function prepareRequest() {\n foreach ($this->formats as $format) {\n $req = $this->request->addChild('format');\n $format = parse_ini_string($format);\n\n // Destination to save the new encoding.\n $source_info = pathinfo($this->source);\n $prefix = isset($format['file-prefix']) ? $format['file-prefix'] : '';\n unset($format['file-prefix']);\n $format['destination'] = $this->destination . '/' . $source_info['filename'] . '/' . $prefix . $source_info['filename'] . $format['file-suffix'];\n unset($format['file-suffix']);\n\n foreach ($format as $key => $value) {\n $req->addChild($key, $value);\n }\n }\n }", "protected function _afterPrepareDocumentData()\n {\n }", "public function prepareSave()\n {\n $info = $this->getInfoInstance();\n if ($this->_canSaveCc) {\n $info->setCcNumberEnc($info->encrypt($info->getCcNumber()));\n }\n $info->setCcCidEnc($info->encrypt($info->getCcCid()));\n $info->setCcNumber(null)\n ->setCcCid(null);\n return $this;\n }", "private function create_xml_file(){\r\n global $CFG;\r\n \r\n $tmpfileid = time().rand(1,99999);\r\n $tmpfile = 'export_xml_'.$tmpfileid.'.pdf';\r\n $this->attachfile = $CFG->tempdir.'/'.$tmpfile;\r\n \r\n $dom = new DOMDocument('1.0', 'utf-8');\r\n $dom->preserveWhiteSpace = false;\r\n $dom->formatOutput = true;\r\n $dom->loadXML($this->xml_structure);\r\n $dom->save($this->attachfile);\r\n }", "public function set_up()\n {\n $this->filePointer = fopen($this->filePointer, 'r');\n $this->xml = new XMLWriter();\n }", "private function copyFileToTemp($file) \n {\n @mkdir(sys_get_temp_dir().'/moodle');\n $tempFile=@fopen(sys_get_temp_dir().'/moodle/'. $file->get_filename(),\"wb\"); \n if ($tempFile ) {\n fwrite($tempFile,$file->get_content());\n fclose($tempFile); \n } \n }", "public function afterSave()\n {\n if (!$this->files) {\n return;\n } else if ($this->contentAttribute) {\n $this->owner->updateAttributes([$this->contentAttribute => $this->processContentFiles(true)['content']]);\n } else {\n /** @var UploadedFile $file */\n foreach ($this->files as $key => $file) {\n $this->files[$key] = $this->saveFile($file->tempName, $file->name);\n }\n }\n $this->setAttributeValue(\\array_map(function($v){ return basename($v); }, array_filter($this->files)));\n }", "function preSave()\n {\n }", "public function prepareSave()\n {\n $info = $this->getInfoInstance();\n\n $info->setCcNumberEnc($info->encrypt($info->getCcNumber()));\n $info->setCcCidEnc($info->encrypt($info->getCcCid()));\n\n $info\n ->setCcNumber(null)\n ->setCcCid(null);\n\n return $this;\n }", "private function writeConfigFile()\n {\n if (!$this->configFile) {\n $confDir = $this->scratchSpace . DIRECTORY_SEPARATOR . 'config';\n mkdir($confDir);\n $this->configFile = $confDir . DIRECTORY_SEPARATOR . 'config.yml';\n }\n file_put_contents($this->configFile, $this->configYaml);\n $this->container->setParameter('config.filename', $this->configFile);\n }", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "protected function preSave() {\n return TRUE;\n }", "public function prepareSave()\n {\n $info = $this->getInfoInstance();\n if ($this->_canSaveCc) {\n $info->setCcNumberEnc($info->encrypt($info->getCcNumber()));\n }\n $info->setCcNumber(null)\n ->setCcCid(null);\n return $this;\n }", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "public function build()\n\t{\n\t\t// Get our output filename\n\t\t$this->name = $this->hashName();\n\t\t\n\t\t// Save the source if it doesn't already exist\n\t\t$output = $this->path.$this->name;\n\t\tif ( ! file_exists($output) ) {\n\n\t\t\t// Load our asset sources\n\t\t\tforeach ($this->files as $asset) {\n\t\t\t\tif (file_exists($asset)) {\n\t\t\t\t\t$this->source .= file_get_contents($asset);\n\t\t\t\t\tif (!$this->minified) { $this->source .= \"\\n\\n\"; }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Minify the source if needed\n\t\t\tif ($this->minified) {\n\t\t\t\t$this->source = Minify::minify($this->source);\n\t\t\t}\n\n\t\t\t// Output the file\n\t\t\tfile_put_contents($output, $this->source);\n\t\t}\n\t}", "public function setDataFileFromContentRaw($contentRaw)\n {\n $tempFilePath = parent::createTempFile();\n file_put_contents($tempFilePath, $contentRaw);\n $this->dataFilePath = $tempFilePath;\n }", "public function generateAndSave()\n\t{\n\t\t$this->ensureInitials();\n\n\t\tfor($i = 0; $i < $this->config['amount']; $i ++)\n\t\t{\n\t\t\t$codes[] = $this->generateCode();\n\t\t}\n\n\t\tfile_put_contents($this->config['file'], implode($this->newline, $codes) . $this->newline, FILE_APPEND);\n\t}", "public function fileNeedsProcessing() {}", "public function doCreateSourceFile()\n {\n $exporter = new CsvExporter($this->ID);\n //Write Header in temp file\n $exporter->storeRecordInTempFile(array(\n 'first name',\n 'last name',\n 'annual salary',\n 'super rate (%)',\n 'payment start date'\n ));\n\n $faker = Faker\\Factory::create();\n\n for ($i = 0; $i < 500; $i++) {\n $temp = array();\n $temp[] = $faker->firstName;\n $temp[] = $faker->lastName;\n //TODO: make this configurable\n $temp[] = $faker->randomFloat(2, 10000, 250000);//generate salaries between 10k and 250k a year\n $temp[] = $faker->randomFloat(2, 9, 50) . '%';//Create a super rate between 9-50%\n $m = $faker->monthName;\n $l = strtotime('last day of ' . $m);\n $temp[] = '01 ' . $m . ' - ' . date('d M', $l);\n\n $exporter->storeRecordInTempFile($temp);\n unset($temp);\n }\n\n $name = 'dummy-source-' . date('Y-m-d') . '-Job-' . $this->ID . '.csv';\n $filename = '/assets/' . $name;\n $savePath = Director::baseFolder() . $filename;\n $newFile = $exporter->preserveTempFile($savePath);\n if ($newFile) {\n $file = new File();\n $file->Filename = $filename;\n $file->Name = $name;\n $file->Title = $name;\n $file->write();\n $this->SourceFileID = $file->ID;\n $this->write();\n return 'File generated Successfully';\n }\n\n return 'Failed to generate test file';\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "abstract protected function _prepare();", "function readyToSave($image) {\n return addslashes(file_get_contents($image['tmp_name'])); \n }", "public function afterConstruct() {\n\t\tLonely::model()->hiddenFileNames[] = '/^_name\\.txt$/i';\n\t}", "private function setTempFile() {\n $this->filename = tempnam('/tmp/', 'siwiki_relplot_');\n $this->fileresource = fopen($this->filename, 'a+');\n }", "protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "public function preUpload()\n {\n $this->name = str_replace(' ', '-', $this->alt) . uniqid() . \".\" . $this->fichier->guessExtension();\n }", "function _stageFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_stagePath, $this->_claimedFilename);\n\t}", "public function setUp(): void\n {\n $control = sprintf('%s/_files/testfile.txt', dirname(__DIR__));\n $this->tmpPath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, uniqid('laminasilter'));\n mkdir($this->tmpPath, 0775, true);\n\n $this->oldFile = sprintf('%s%stestfile.txt', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->origFile = sprintf('%s%soriginal.file', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newFile = sprintf('%s%snewfile.xml', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDir = sprintf('%s%stestdir', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDirFile = sprintf('%s%stestfile.txt', $this->newDir, DIRECTORY_SEPARATOR);\n\n copy($control, $this->oldFile);\n copy($control, $this->origFile);\n mkdir($this->newDir, 0775, true);\n }", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "public function create_from_file($file);", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "function fileNeedsProcessing() ;", "public function prepare() {}", "public function prepare() {}", "function preSave()\n\t{\n\n\t}", "public function save() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\tif ($this->rows) {\n\t\t\t$fp = fopen($this->filepath, 'w');\n\t\t\t$rowcount = count($this->rows);\n\t\t\tfor ($index = 0; $index < $rowcount; ++$index) {\n\t\t\t\t$row = $this->rows[$index];\n\t\t\t\tif ($row->isEditable()) {\n\t\t\t\t\t$variableName = $row->variableName();\n\t\t\t\t\t$pattern = '/\\$'.$variableName.'[\\s]+=([^;]+);/';\n\t\t\t\t\t$replacement = $row->toString();\n\t\t\t\t\t$fileContent = preg_replace($pattern, $replacement, $fileContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfwrite($fp, $fileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "function save($filePath);", "public function __wakeup() {\n\t\t$this->validateFileContents();\n\t}", "public function save(IO\\File $file) {\n\t\t\tfile_put_contents($file, $this->render());\n\t\t\t$this->file = $file;\n\t\t}", "function beforeSaveLoop()\r\n {\r\n }", "public function generate() {\n if (!$this->filePath) {\n throw new Exception('Trying to save file without path');\n }\n \n $tempDir = codemonkey_pathTempDir;\n \n $content = $this->generateCode();\n \n $this->checkIfTempFolderExists();\n $this->checkIfFoldersExist();\n \n try {\n $fp = fopen($tempDir.$this->filePath, 'w');\n fputs($fp, $content);\n fclose($fp);\n chmod($tempDir.$this->filePath, 0775);\n } catch (Exception $e) {\n echo \"Could not generate file \".$this->filePath.\"<br />\\n\"\n . $e->getMessage().\"<br />\\n\";\n }\n }" ]
[ "0.83557665", "0.72432405", "0.65779614", "0.6370905", "0.6212607", "0.61622685", "0.61367375", "0.5840125", "0.58254534", "0.57053554", "0.5699601", "0.5685358", "0.5624671", "0.56105417", "0.55815697", "0.55481946", "0.55298483", "0.5493701", "0.5485542", "0.5470916", "0.54681224", "0.5459734", "0.5458938", "0.54506826", "0.54461306", "0.5429129", "0.54032516", "0.53939354", "0.53864723", "0.53802514", "0.53685546", "0.5361601", "0.535945", "0.53562135", "0.5343296", "0.53297335", "0.5328695", "0.53272885", "0.5308759", "0.53053826", "0.53037876", "0.53035474", "0.5294327", "0.5291593", "0.5288147", "0.5262274", "0.52592117", "0.52563083", "0.52552354", "0.52549374", "0.5243292", "0.52411973", "0.52270716", "0.5219784", "0.521705", "0.5213602", "0.5209916", "0.51976985", "0.5191379", "0.518931", "0.51857126", "0.51840866", "0.5182077", "0.5180506", "0.51795745", "0.517784", "0.51717985", "0.51711696", "0.5167538", "0.51459664", "0.5145848", "0.5140416", "0.5133189", "0.5132571", "0.51256084", "0.5119936", "0.5117865", "0.5116736", "0.51137906", "0.511056", "0.5109875", "0.5108786", "0.51011235", "0.5093127", "0.509302", "0.5091121", "0.5088854", "0.508439", "0.5081626", "0.507589", "0.50653285", "0.50628364", "0.5061996", "0.50472087", "0.50258625", "0.50215644", "0.5021124", "0.50208724", "0.5018519", "0.50136" ]
0.6321023
4
Prepare file before it will be deleted
public function beforeDelete() { $fileService = $this->getCustomizationService(); $fileService->delete($this); return parent::beforeDelete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "public function prepareFile() {\n\t\t// Check if the file do exists\n\t\tif (!is_dir($this->filedir)) {\n\t\t\t// Create empty directory for the userexport\n\t\t\tif (!mkdir($this->filedir, 0755)) {\n\t\t\t\t// Creating the directory failed\n\t\t\t\tthrow new Exception(elgg_echo('userexport:error:nofiledir'));\n\t\t\t}\n\t\t}\n\n\t\t// Delete any existing file\n\t\tunlink($this->filename);\n\t}", "public function prepareToUpload(): void\n {\n if (!$this->hasFile()) {\n return;\n }\n\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n if ($this->namePrefix !== null) {\n $filename = Uri::getUrl($this->namePrefix) . '_' . $filename;\n }\n $this->fileName = $filename . '.' . $this->getFile()->guessExtension();\n }", "protected function prepareEnvForEmptyFile()\n {\n $file = 'magento_empty.jpg';\n\n /** @var \\Magento\\Framework\\Filesystem $filesystem */\n $filesystem = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class);\n $tmpDirectory = $filesystem->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::SYS_TMP);\n $filePath = $tmpDirectory->getAbsolutePath($file);\n\n $_FILES['options_1_file'] = [\n 'name' => 'test.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n ];\n }", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "protected function createFile() {}", "public static function prepare_files($file_name, $directory_path){\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\")){ # .in file\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n exec('echo \"0\" >' . \"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n }\n }", "public function prepareTarget(): void\n {\n if (! $this->filesystem->has($this->absoluteTargetDir)) {\n $this->filesystem->createDir($this->absoluteTargetDir);\n } else {\n foreach (array_keys($this->files) as $targetRelativeFilepath) {\n $targetAbsoluteFilepath = $this->absoluteTargetDir . $targetRelativeFilepath;\n\n if ($this->filesystem->has($targetAbsoluteFilepath)) {\n $this->filesystem->delete($targetAbsoluteFilepath);\n }\n }\n }\n }", "function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}", "private function resetStorageFile(){\n $newFile = self::STORAGE_FILE_TEMPLATE_HEADER.self::STORAGE_FILE_TEMPLATE_BODY.self::STORAGE_FILE_TEMPLATE_FOOTER;\n if(!file_exists(realpath($newFile))){\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n if(!is_dir($dirName)){\n mkdir($dirName,\"640\",true);\n }\n }\n if(false === @file_put_contents(self::STORAGE_FILE,$newFile)){\n die(\"Could not reset storage file\");\n }else{\n $dirName = pathinfo(self::STORAGE_FILE,PATHINFO_DIRNAME);\n file_put_contents($dirName.\"/.htaccess\",self::STORAGE_FILE_TEMPLATE_HTACCESS);\n }\n }", "protected function initStorageFile()\n {\n $storageFilePath = $this->getStoragePath();\n if(!file_exists($storageFilePath)) {\n touch($storageFilePath);\n fwrite(fopen($storageFilePath, \"w\"), static::HEADER . \"\\n\");\n }\n }", "public function preUpload()\n {\n if (null !== $this->getFile()) {\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->getFile()->guessExtension();\n }\n }", "public function deleteRawFile() {\n if (!$this->rawfiledeleted && !is_null($this->config_dir)) {\n $file_name = config('app.' . $this->config_dir) . $this->name;\n if (file_exists($this->relativepath)) {\n unlink($this->relativepath);\n $this->rawfiledeleted = true;\n $this->save();\n }\n }\n }", "private function _initSubRipFile()\n {\n file_put_contents($this->fileDir . $this->subtitleFile, '');\n }", "function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "public function prepareToDryRun()\n {\n if ($this->fileDriver->isExists($this->getLoggerFile())) {\n if (!$this->fileDriver->isWritable($this->getLoggerFile())) {\n throw new \\Exception(sprintf('Dry run logger file is not writable'));\n }\n\n $this->fileDriver->deleteFile($this->getLoggerFile());\n $this->fileDriver->touch($this->getLoggerFile());\n }\n }", "protected function setUp()\n {\n $_SERVER['argv'] = self::$argvOriginal;\n @unlink(self::$configFile);\n }", "public function cleanFileCache()\n {\n if (is_callable(array('SugarAutoLoader', 'buildCache'))) {\n SugarAutoLoader::buildCache();\n } else {\n // delete dangerous files manually\n @unlink(\"cache/file_map.php\");\n @unlink(\"cache/class_map.php\");\n }\n }", "function InitDumpFile()\r\n{\r\n\t@unlink(DUMP_FILE_FULL_PATH_NAME);\r\n}", "public function prepareDatabase()\n {\n // If SQLite database does not exist, create it\n if ($this->config->database['connection'] === 'sqlite') {\n $path = $this->config->database['database'];\n if ( ! $this->fileExists($path) && is_dir(dirname($path))) {\n $this->write(\"Creating $path ...\");\n touch($path);\n }\n }\n }", "private function prepareFiles() {\n $zip = new ZipArchive;\n if ($zip->open(self::PARSE_DIR . '/' . self::ARCHIVE_FILENAME) === TRUE) {\n $zip->extractTo($this->tmpFolder);\n $zip->close();\n } else {\n $this->errors[] = 'Невозможно распаковать архив!';\n }\n }", "private function finalize()\n {\n $this->temp_files_path[] = L_FRAME_LIST_FILE;\n $this->delete_files();\n }", "public function setUp(): void\n {\n $control = sprintf('%s/_files/testfile.txt', dirname(__DIR__));\n $this->tmpPath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, uniqid('laminasilter'));\n mkdir($this->tmpPath, 0775, true);\n\n $this->oldFile = sprintf('%s%stestfile.txt', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->origFile = sprintf('%s%soriginal.file', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newFile = sprintf('%s%snewfile.xml', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDir = sprintf('%s%stestdir', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDirFile = sprintf('%s%stestfile.txt', $this->newDir, DIRECTORY_SEPARATOR);\n\n copy($control, $this->oldFile);\n copy($control, $this->origFile);\n mkdir($this->newDir, 0775, true);\n }", "public function beforeSave()\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n foreach ($this->attributes as $attribute => $attributeConfig) {\n if ($this->hasScenario($attributeConfig)) {\n if (isset($this->files[$attribute]) && $this->validateFile($this->files[$attribute])) {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave') === true) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n } else {\n // Protect attribute\n $model->$attribute = $model->getOldAttribute($attribute);\n }\n } else {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave')) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n }\n }\n $this->fileSave();\n }", "private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}", "private function setTempFile() {\n $this->filename = tempnam('/tmp/', 'siwiki_relplot_');\n $this->fileresource = fopen($this->filename, 'a+');\n }", "public function clearFile() {\r\n\t\tif ($this->exists) {\r\n\t\t\t// create file\r\n\t\t\t$handler = fopen ( $this->filename, 'w' ) or die ( $this->error ['102'] );\r\n\t\t\t$this->setMetta ();\r\n\t\t\tfclose ( $handler );\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}", "public function postImport() {\n $this->closeFile();\n }", "protected function tearDown()\n {\n unlink($this->filename);\n }", "protected function setUp()\n {\n $this->filename = tempnam(sys_get_temp_dir(), 'Prospect');\n file_put_contents($this->filename, \"This is a test file\");\n $this->object = new File('picture',$this->filename,'text/plain');\n }", "protected function recreatePackageStatesFileIfNotExisting() {}", "public function beforeSave()\n {\n $fileService = $this->getCustomizationService();\n $fileService->prepareFile($this);\n $fileService->save($this);\n return parent::beforeSave();\n }", "final public function createFileWithoutDirectDownload()\n\t{\n\t\t$this->createFile();\n\t}", "public function preUpload()\n {\n if (null !== $this->file) {\n // do whatever you want to generate a unique name\n $filename = sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->file->guessExtension();\n $this->fileName = $this->file->getClientOriginalName();\n $this->size = $this->file->getSize();\n $this->type = $this->file->getMimeType();\n $this->uploadDate = new \\DateTime('now');\n }\n }", "public function postFlush()\n {\n $fileSystem = new Filesystem();\n $fileSystem->remove($this->filesScheduledForDeletion);\n }", "private function deleteLangFileContent() \n {\n $this->read();\n unset($this->arrayLang[$this->key]);\n $this->save();\n }", "public function testConstructFileAlreadyExists()\n {\n file_put_contents($this->file, null);\n\n $SerializedArray = new SerializedArray($this->file);\n $this->assertEquals($this->file, $this->getProperty($SerializedArray, 'file'));\n }", "private function setup_files() {\n $this->record_progress(\n \"Step 6: Preparing files for further analysis\");\n\n $path_new_input = $this->path_new_input;\n $path_spliceman = $this->path_spliceman;\n $path_RBPs_new = $this->path_RBPs_new;\n $path_errors = $this->path_errors;\n\n exec(\"perl\\\n /var/www/html/spliceman_beta/scripts/setup_spliceman_RBP_files.pl\\\n /var/www/html/spliceman_beta/genome_data/hg19.fa\\\n '$path_new_input'\\\n '$path_spliceman'\\\n '$path_RBPs_new'\\\n '$path_errors'\", \n $output, \n $return);\n\n if ($return) {\n $this->pipeline_error(\n \"Error in pipeline, please contact administrator\n and provide step 6\");\n }\n if (count($output) > 0) {\n $this->pipeline_error($output);\n }\n }", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "function hapusfile(){\n\t\t$previllage = 1;\n\t\tcheck_super_user($this->session->tipe_user,$previllage);\n\n\t \t$id = $this->uri->segment(3);\n\t\t//Action\t\t \n\t\t$itemfile = $this->tugas_m->get($id)->row();\n \t\tif ($itemfile->file != null) {\n \t\t\t$target_file = 'assets/dist/files/tugas/'.$itemfile->file;\n \t\t\tunlink($target_file);\n \t\t}\n \t\t$params['file'] = \"\";\n \t\t$this->db->where('id',$id);\n\t \t$this->db->update('tb_tugas',$params);\n\t \tredirect('tugas/edit/'.$id);\t \n\t}", "protected function preCommitSetup() :void\n {\n $url = \"https://raw.githubusercontent.com/EngagePHP/pre-commit/master/setup.sh\";\n $content = file_get_contents($url);\n $path = app_path('setup.sh');\n\n Storage::put($path, $content);\n\n chmod($path, 0751); //rwxr-x--x\n }", "public function __destruct() {\n\t\tif (file_exists($this->fileName) && (!$this->cache)) {\n\t\t\tunlink($this->fileName);\n\t\t}\n\t}", "public function createQAfile()\r\n {\r\n $originalFile = realpath(__DIR__ . '/../Resources/files/templates/QA-sample.txt');\r\n $newFile = $this->destination_dir.'/QA.txt';\r\n\r\n $this->createCopiedFile($originalFile, $newFile);\r\n }", "protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }", "function cleanTmpfile($tempfile) {\n\t\tif (file_exists($tempfile)) {\n\t\t\tunlink($tempfile);\n\t\t}\n\t}", "public function deleteUnusedFiles(){\n \n }", "public function __destruct() {\n if (file_exists($this->tempFile)) {\n unlink($this->tempFile);\n }\n }", "public function flushSource()\n {\n if (is_file($this->getStoragePath())) {\n @unlink($this->getStoragePath());\n }\n }", "public function fileNeedsProcessing() {}", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\t\t@unlink(dirname(__FILE__).'/resources/logofinal_resized.jpg');\n\t}", "public function prepareFile($file)\r\n {\r\n $this->file = $file;\r\n\r\n return !!$this->file;\r\n }", "protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}", "protected function closeFile() {}", "public function removeTempFiles()\n {\n parent::removeTempFiles();\n $this->removeDir($this->cacheDir(\"upgrades/driver/\"));\n }", "private function createTemporaryFile()\n {\n return $this->temp[] = tempnam(sys_get_temp_dir(), 'sqon-');\n }", "function _stageFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_stagePath, $this->_claimedFilename);\n\t}", "public function cleanTempFiles()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\tforeach ($manifestData as $row)\n\t\t{\n\t\t\tif (UpdateHelper::isManifestVersionInfoLine($row))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$rowData = explode(';', $row);\n\n\t\t\t// Delete any files we backed up.\n\t\t\t$backupFilePath = IOHelper::normalizePathSeparators(blx()->path->getAppPath().$rowData[0].'.bak');\n\n\t\t\tif (($file = IOHelper::getFile($backupFilePath)) !== false)\n\t\t\t{\n\t\t\t\tBlocks::log('Deleting backup file: '.$file->getRealPath(), \\CLogger::LEVEL_INFO);\n\t\t\t\t$file->delete();\n\t\t\t}\n\t\t}\n\n\t\t// Delete the temp patch folder\n\t\tIOHelper::deleteFolder($this->_unzipFolder);\n\n\t\t// Delete the downloaded patch file.\n\t\tIOHelper::deleteFile($this->_downloadFilePath);\n\t}", "protected function setUp(): void\n {\n /** @var File $file */\n parent::setUp();\n TestAssetStore::activate('UsedOnTableTest');\n $path = dirname(__DIR__) . '/Forms/fixtures/testfile.txt';\n $content = file_get_contents($path ?? '');\n $file = File::get()->find('Name', 'testfile.txt');\n $file->setFromString($content, $file->generateFilename());\n }", "function _rejectFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_rejectPath, $this->_claimedFilename);\n\t}", "public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }", "public function createFile(File $file): void;", "private function copyFileToTemp($file) \n {\n @mkdir(sys_get_temp_dir().'/moodle');\n $tempFile=@fopen(sys_get_temp_dir().'/moodle/'. $file->get_filename(),\"wb\"); \n if ($tempFile ) {\n fwrite($tempFile,$file->get_content());\n fclose($tempFile); \n } \n }", "private function deleteTempFile() {\n if ($this->datastreamInfo['content']['type'] == 'file' && $this->copied == TRUE) {\n unlink($this->datastreamInfo['content']['content']);\n }\n }", "function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "public function flushFile()\n {\n $this->em->flush();\n }", "protected function prepareDeleteComment(){\n $this->deleteThisComment();\n $this->justOneArticle();\n }", "protected function _closeFile() {}", "protected function _closeFile() {}", "public function moveToTmpDir()\n\t{\n\t\tif($this->source instanceof UploadedFile) {\n\t\t\t$this->source->move($this->getTmpDir()->getRootPath());\n\t\t} else if(is_string($this->source)) {\n\t\t\tcopy($this->params['path'], $this->getTmpDir()->getRootPath() . '/' . $this->params['name']);\n\t\t}\n\t}", "private function clean_buffer() {\n\t\t\t$buf = $this->config[\"buffer\"];\t\n\t\t\t$gal = $this->config[\"buffer\"] . \"/gallery/\";\n\t\t\t$user_id = $this->god_object->current_user[\"id\"];\n\n\t\t\tif (is_dir($buf)) {\n\t\t\t\t$content = scandir($buf);\t\t\t\t\t\t\t\n\t\t\t\tforeach ($content as $filename) {\n\t\t\t\t\t$path = \"{$buf}/{$filename}\";\n\n\t\t\t\t\tif ($filename != \".\" && $filename != \"..\" && strpos($filename, $user_id) === 0) {\n\t\t\t\t\t\tunlink($path);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// now cleaning gallery\n\t\t\t\tif (is_dir($gal)) {\n\t\t\t\t\t$content = scandir($gal . $filename);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($content as $filename) {\n\t\t\t\t\t\t$path = \"{$gal}/{$filename}\";\t\t\t\n\t\n\t\t\t\t\t\tif ($filename != \".\" && $filename != \"..\" && strpos($filename, $user_id) === 0) {\n\t\t\t\t\t\t\tunlink($path);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\n\t\t}", "public function onAfterSkippedWrite()\n {\n $this->updateChildFilesystem();\n }", "protected function tearDown()\n\t{\n\t\t$this->Compress_Gzip = null;\n\t\tif (file_exists($this->file)) unlink($this->file);\n\t\tparent::tearDown();\n\t}", "private function createNewTmpICal()\n\t{\n\n\t\t$config = Factory::getConfig();\n\t\t$path = $config->get('config.tmp_path') ? $config->get('config.tmp_path') : $config->get('tmp_path');\n\t\techo \"create temp CSV conversion file in \" . $path . \"<br/>\";\n\t\t$this->tmpFileName = tempnam($path, \"phpJE\");\n\t\t//$this->tmpFileName = tempnam(\"/tmp\", \"phpJE\");\n\t\t$this->tmpfile = fopen($this->tmpFileName, \"w\");\n\t\tfwrite($this->tmpfile, \"BEGIN:VCALENDAR\\n\");\n\t\tfwrite($this->tmpfile, \"VERSION:2.0\\n\");\n\t\tfwrite($this->tmpfile, \"PRODID:-//jEvents 2.0 for Joomla//EN\\n\");\n\t\tfwrite($this->tmpfile, \"CALSCALE:GREGORIAN\\n\");\n\t\tfwrite($this->tmpfile, \"METHOD:PUBLISH\\n\");\n\n\t}", "private function copyFromTemplateIfNeeded() {\n\t\t$templatePath = __DIR__ . '/../conf/config.template.php';\n\t\tif (!file_exists($this->filePath)) {\n\t\t\tcopy($templatePath, $this->filePath) or LegacyLogger::log('ERROR', 'StartUp', \"could not create config file: {$this->filePath}\");\n\t\t}\n\t}", "function __destruct() {\r\n\t\tunlink($this->uploadfile);\r\n\t}", "function fileNeedsProcessing() ;", "public function clean($file)\n {\n }", "protected function _setFile()\n\t{\n\t\t$this->_moveToImageDir();\n\n\t\tif (!$this->_validateMimeType()) {\n\t\t\tunlink($this->getFilePath()); // delete file\n\t\t\tthrow new Exception('Not Allowed MIME Type File ERROR!');\n\t\t}\n\n\t\t$this->_file = file_get_contents($this->getFilePath());\n\t}", "function _initTmp()\n {\n $this->_tmpfile = @tempnam($this->_tmpdir, 'mailfilter' . preg_replace('/\\\\\\/', '_', get_class($this)) . '.');\n $this->_tmpfh = @fopen($this->_tmpfile, \"w\");\n if( !$this->_tmpfh ) {\n $msg = $php_errormsg;\n return $this->_pear->raiseError(sprintf(_(\"Error: Could not open %s for writing: %s\"),\n $this->_tmpfile, $msg),\n OUT_LOG | EX_IOERR);\n }\n\n register_shutdown_function(array($this, '_cleanupTmp'));\n }", "protected function _before() {\n\t\tparent::_before ();\n\t\t$this->uFileSystem = new UFileSystem ();\n\t\t$this->testDir = $this->uFileSystem->cleanFilePathname ( \\ROOT . \\DS . \"tests-files/\" );\n\t\t$this->uFileSystem->xcopy ( $this->uFileSystem->cleanFilePathname ( \\ROOT . \\DS . \"files-tests/\" ), $this->testDir );\n\t}", "public function prepareImportContent();", "public function processImport()\n {\n $file = $this->_createFile();\n if ($file) {\n $this->_deleteFtpFiles();\n $this->_sendFile($file);\n if (!$this->_deleteFile($file)) {\n Mage::throwException(Mage::helper('find_feed')->__(\"FTP: Can't delete files\"));\n }\n }\n }", "function create_file($file_path, $content=''){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "function _prepare() {}", "public function __destruct()\n {\n if (file_exists($this->tempFilesFromFilename)) {\n unlink($this->tempFilesFromFilename);\n }\n }", "public function __destruct()\n\t{\n\t\t$this->delete_local_file();\n\t}", "public function preUpload()\n{ \n if (null !== $this->file) {\n // do whatever you want to generate a unique name\n $filename =$this->getName(); //sha1(uniqid(mt_rand(), true));\n $this->path = $filename.'.'.$this->file->guessExtension();\n }\n}", "public function prepareImport();", "protected function after_execute() {\n $this->add_related_files('block_file', 'intro', null);\n $this->add_related_files('block_file', 'file', null);\n }", "public function clearFileContent()\n {\n $empty = [];\n file_put_contents($this->file_name, json_encode($empty));\n }", "public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}", "public function repairFile($filename, $config = null, $encoding = null, $use_include_path = false) {}", "protected function postProcessCopyFromTemplate()\n {\n }", "private function createTempFile(){\n\n\t\t\ttry {\n\t\t \n\t\t\t // Undefined | Multiple Files | $_FILES Corruption Attack\n\t\t\t // If this request falls under any of them, treat it invalid.\n\t\t\t if (!isset($_FILES['file']['error']) ||\n\t\t\t is_array($_FILES['file']['error'])) {\n\t\t\t throw new RuntimeException('Invalid parameters.');\n\t\t\t }\n\n\t\t\t // Check $_FILES['upfile']['error'] value.\n\t\t\t switch ($_FILES['file']['error']) {\n\t\t\t case UPLOAD_ERR_OK:\n\t\t\t break;\n\t\t\t case UPLOAD_ERR_NO_FILE:\n\t\t\t throw new RuntimeException('No file sent.');\n\t\t\t case UPLOAD_ERR_INI_SIZE:\n\t\t\t case UPLOAD_ERR_FORM_SIZE:\n\t\t\t throw new RuntimeException('Exceeded filesize limit.');\n\t\t\t default:\n\t\t\t throw new RuntimeException('Unknown errors.');\n\t\t\t }\n\n\t\t\t // You should also check filesize here. \n\t\t\t if ($_FILES['file']['size'] > 1000000) {\n\t\t\t throw new RuntimeException('Exceeded filesize limit.');\n\t\t\t }\n\n\t\t\t // DO NOT TRUST $_FILES['upfile']['mime'] VALUE !!\n\t\t\t // Check MIME Type by yourself.\n\t\t\t $finfo = new finfo(FILEINFO_MIME_TYPE);\n\t\t\t echo $finfo->file($_FILES['file']['tmp_name']).\"<br><br>\";\n\n\t\t\t if (false === $ext = array_search(\n\t\t\t $finfo->file($_FILES['file']['tmp_name']),\n\t\t\t array(\n\t\t\t 'csv' => 'text/plain',\n\t\t\t ),\n\t\t\t true\n\t\t\t )) {\n\t\t\t throw new RuntimeException('Invalid file format.');\n\t\t\t }\n\n\t\t\t} catch (RuntimeException $e) {\n\n\t\t \techo $e->getMessage();\n\t\t\t}\n\t\t}", "protected function _writeFileHeader() {}", "function set_file_not_new( $fn ){\n //Prepare UPDATE statement to clear newfile flag\n $update = \"UPDATE files SET newfile = 0 WHERE filename = :filename\";\n\n $stmt = $this->pdo->prepare($update);\n\n $stmt->bindparam(':filename', $fn);\n\n $stmt->execute();\n\n return;\n }", "protected function removeFiles() {}", "public function tearDown()\n {\n parent::tearDown();\n\n //Deletes the file\n safe_unlink($this->file);\n }" ]
[ "0.80228716", "0.79526275", "0.65727234", "0.63429105", "0.6293853", "0.62936807", "0.6271724", "0.62229", "0.6119158", "0.6046558", "0.60042024", "0.5869776", "0.5838994", "0.5771447", "0.57157636", "0.56980306", "0.5682228", "0.5666794", "0.56273854", "0.56260127", "0.559526", "0.55809814", "0.5569291", "0.55559975", "0.55558133", "0.55534965", "0.5546324", "0.5545691", "0.55415237", "0.5538573", "0.55256176", "0.5515375", "0.5513037", "0.5499416", "0.5495297", "0.54579645", "0.5443802", "0.5423627", "0.54015195", "0.53995484", "0.53945947", "0.53852284", "0.5375361", "0.53739613", "0.5363771", "0.5363314", "0.53585947", "0.5351599", "0.53401804", "0.5328646", "0.53236943", "0.5319653", "0.53065604", "0.5301601", "0.5296108", "0.5293559", "0.52879405", "0.52841175", "0.5275887", "0.5275286", "0.52692246", "0.5264159", "0.5251623", "0.5250423", "0.52398133", "0.5229484", "0.5225577", "0.52196133", "0.52171916", "0.5211831", "0.5211831", "0.52107227", "0.5199458", "0.5198289", "0.51954055", "0.51938057", "0.51870143", "0.51866883", "0.51858854", "0.5183024", "0.5181916", "0.5180256", "0.5170519", "0.5151544", "0.5145766", "0.5140851", "0.51353645", "0.5131735", "0.51303035", "0.5129873", "0.51259124", "0.51229405", "0.51202655", "0.51187384", "0.51089144", "0.5103517", "0.5102233", "0.5102212", "0.5093483", "0.50912225", "0.5090884" ]
0.0
-1
Run the database seeds.
public function run() { $consejocomunales = [ 'CUADRA DE BOLIVAR', 'GTC', 'LIDERES DE QUINTA CRESPO', 'SUR 4', ]; foreach($consejocomunales as $consejocomunal) { $inputs[]=['nombre_consejo_comunal'=>$consejocomunal, 'created_at'=>now(), 'updated_at'=>now(), ]; } ConsejoComunal::insert($inputs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Adds parameters to the parameters list. Existing parameters will be preserved.
public function add(array $parameters);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function add_parameters($params = array())\n\t{\n\t\tforeach ($params as $param)\n\t\t{\n\t\t\t$this->add_parameter($param['name'], $param);\n\t\t}\n\t}", "public function addParams($parameters){\n\t\t\tif(is_array($parameters)){\n\t\t\t\tforeach ($parameters as $key=>$value) {\n\t\t\t\t\t$this->addParam($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function addParameters(array $parameters): ParametersInterface;", "public function addParams(): Params\n {\n $params = new Params();\n $this->batch[] = $params;\n\n return $params;\n }", "public function addParameters(array $params)\n\t{\n\t\t$this->parameters = Helpers::merge($params, $this->parameters);\n\t\treturn $this;\n\t}", "public function parameters( Array $parameters=array() ) {\n foreach ($parameters as $name=>$value) {\n $this->params[$name]= $value;\n }\n }", "function new_parameters() {\r\n\r\n }", "public function addParams(array $params)\n {\n foreach ($params as $key => $value) {\n $this->_params[$key] = $value;\n }\n }", "public function addQueryParameters($query_parameters)\n {\n if (!empty($query_parameters)) {\n $this->options['query'] += $query_parameters;\n }\n }", "public function setParameters ($parameters)\n {\n\n $this->parameters = array_merge($this->parameters, $parameters);\n\n }", "public static function add($parameters = array())\n {\n self::$config = array_merge(self::$config, $parameters);\n }", "function addParam($name, $value) {\n if (!isset($this->params[$name])) {\n $this->setParam($name, $value);\n }\n else {\n $oldParam = $this->getParam($name);\n if (!is_array($oldParam)) {\n $oldParam = array($oldParam);\n }\n array_push($oldParam, $value);\n $this->setParam($name, $oldParam);\n }\n }", "function addUrlParameters(array $parameters) {\n $this->CI = $this->CI ?: get_instance();\n $this->parameterSegment = $this->CI->config->item('parm_segment');\n $this->routerSegments = $segments = $this->CI->uri->router->segments;\n $firstKey = null;\n foreach($parameters as $key => $value) {\n $firstKey = $firstKey ?: $key;\n $segments[] = $key;\n $segments[] = $value;\n }\n $this->CI->uri->router->segments = $segments;\n if (!\\RightNow\\Utils\\Url::getParameter($firstKey)) {\n $this->CI->config->set_item('parm_segment', $this->parameterSegment - 1);\n }\n }", "function prepare_parameters($orig_params, $add_params) {\n if(!$orig_params || !is_array($orig_params)) {\n $orig_params = array();\n }\n\n if($add_params && is_array($add_params)) {\n foreach ($add_params as $key => &$val) {\n $orig_params[$key] = $val;\n }\n }\n\n return $orig_params;\n}", "public function addQueryParameters($parameters)\n {\n $this->query = array_merge($this->query, $parameters);\n\n return $this;\n }", "public function addParameter(mixed $value): ParametersInterface;", "public function AddParam(Param $param){\r\n\t\t$this->params[] = $param;\r\n\t}", "public function addParams($data) {\n\t\tif (!is_array($data)) {\n\t\t\tthrow new \\InvalidArgumentException(\"Array required, got: \" . gettype($data));\n\t\t}\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->params[$key] = (string)$value;\n\t\t}\n\t}", "public function parameters(array $params)\n {\n // Merge the new parameters in\n $this->_parameters = $params + $this->_parameters;\n\n return $this;\n }", "public function parameters(array $params)\n\t{\n\t\t$this->parameters = $params + $this->parameters;\n\n\t\treturn $this;\n\t}", "function addParam($par)\n\t{\n\t\tif(is_object($par) && is_a($par, 'jmap_xmlrpcval'))\n\t\t{\n\t\t\t$this->params[]=$par;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function AddParams($params = array()){\n\t\t\n\t\tif ($params && is_array($params)){\n\t\t\tforeach ($params as $k => $v){\n\t\t\t\tif (property_exists($this, '_'.$k)){\n\t\t\t\t\n\t\t\t\t\t$prop = '_'.$k;\n\t\t\t\t\t$this->$prop = $v;\n\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function setParameters($parameters);", "public function addQueryParams($params) {}", "public function pushParameters(array $parameters): self\n {\n foreach ($parameters as $parameter) {\n $this->pushParameter($parameter);\n }\n\n return $this;\n }", "public function set_parameters($value)\n\t{\n\t\t$this->parameters = array_merge($this->parameters, $value);\n\t}", "function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}", "public function setParameters($parameters) {\n $this->params = $parameters;\n }", "public function addParameterByName(string $name, mixed $value): ParametersInterface;", "public function addParam($name,$value)\n\t\t{\n\t\t\t$this->param[$name] = $value;\n\t\t}", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }", "function setParameters(array $parameters) {\n foreach ($parameters as $key => $value) {\n $this->setParameter($key, $value);\n }\n }", "public static function add_new_card_parameters() {\n return new external_function_parameters(\n array(\n 'courseid' => new external_value(PARAM_INT, 'course id int', VALUE_DEFAULT, null),\n 'activityid' => new external_value(PARAM_INT, 'activity id int', VALUE_DEFAULT, null),\n 'moduletype' => new external_value(PARAM_RAW, 'moduletype text', VALUE_DEFAULT, null),\n 'selectgroupid' => new external_value(PARAM_RAW, 'selectgroupid text', VALUE_DEFAULT, null),\n )\n );\n }", "public function cloneParameterList(): void;", "function _addRequiredParameters(array $parameters)\n {\n $parameters['AWSAccessKeyId'] = $this->_awsAccessKeyId;\n $parameters['Timestamp'] = $this->_getFormattedTimestamp();\n $parameters['Version'] = self::SERVICE_VERSION;\n $parameters['SignatureVersion'] = $this->_config['SignatureVersion'];\n if ($parameters['SignatureVersion'] > 1) {\n $parameters['SignatureMethod'] = $this->_config['SignatureMethod'];\n }\n $parameters['Signature'] = $this->_signParameters($parameters, $this->_awsSecretAccessKey);\n\n return $parameters;\n }", "public function addParameter(string $name, $value): self;", "public function setParametersByRef (&$parameters)\n {\n\n foreach ($parameters as $key => &$value)\n {\n\n $this->parameters[$key] =& $value;\n\n }\n\n }", "public function add($data)\n {\n foreach ($data as $k => $v) {\n $this->params[$k] = $v;\n }\n return $this;\n }", "public function setParameters($parameters) {\n $this->parameters = $parameters;\n }", "protected function inject_custom_parameters()\n\t{\n\t\tforeach ($this->custom_parameters as $key => $value)\n\t\t{\n\t\t\t$this->container->setParameter($key, $value);\n\t\t}\n\t}", "public function setParameters(mixed ...$parameters) : void\n {\n $this->parameters = $parameters;\n }", "public function addItems($params){\r\n\t \r\n\t foreach($params as $key=>$values)\r\n\t if(!$this->_isDublicatedData($values))\r\n\t $this->addItem($values);\r\n\t \r\n\t return $this;\r\n\t}", "public function setParameters(array $parameters): void;", "public function addFilterParams($name)\n {\n if ($this->getRequestParameter($name))\n {\n foreach ($this->params as &$params)\n {\n $params[$name] = $this->getRequestParameter($name);\n }\n }\n \n // set an array for building a link to this filter (we don't want it to already have the filter in there)\n $this->params[$name] = $this->params['pagination'];\n unset($this->params[$name][$name]);\n }", "public function add_parameter( $param_id, $type, $heading = NULL, $note = NULL )\n {\n $util_class_name = lib::get_class_name( 'util' );\n\n // add timezone info to the note if the parameter is a time or datetime\n if( 'time' == $type || 'datetime' == $type )\n {\n // build time time zone help text\n $date_obj = $util_class_name::get_datetime_object();\n $time_note = sprintf( 'Time is in %s\\'s time zone (%s)',\n lib::create( 'business\\session' )->get_site()->name,\n $date_obj->format( 'T' ) );\n $note = is_null( $note ) ? $time_note : $time_note.'<br>'.$note;\n }\n\n $this->parameters[$param_id] = array( 'type' => $type );\n if( !is_null( $heading ) ) $this->parameters[$param_id]['heading'] = $heading;\n if( !is_null( $note ) ) $this->parameters[$param_id]['note'] = $note;\n }", "public function modifyActionParameters(array $parameters);", "public function addParam($key, $value)\n {\n $this->_params[$key] = $value;\n }", "public function SetParameters($parameters)\n {\n $this->parameters = $parameters;\n }", "function storeParameters()\n {\n }", "public function setParams($params) {\n\t\t$this->params = array();\n\t\t$this->addParams($params);\n\t}", "protected function appendParameters(&$contents, Collection $parameters)\n {\n $this->appendSection($contents, 'Parameters');\n\n $parameters->each(function ($parameter) use (&$contents) {\n $example = $parameter->example && is_array($parameter->example)\n ? json_encode($parameter->example)\n : $parameter->example\n ;\n\n $type = $this->resolveParameterType($parameter);\n $contents .= $this->line();\n $contents .= $this->tab();\n $contents .= $this->getParameterContent($parameter);\n\n if (isset($parameter->default)) {\n $this->appendSection($contents, sprintf('Default: %s', $parameter->default), 2, 1);\n }\n\n if (isset($parameter->members)) {\n $this->appendSection($contents, 'Members', 2, 1);\n foreach ($parameter->members as $member) {\n $this->appendSection($contents, sprintf('`%s` - %s', $member->identifier, $member->description), 3, 1);\n }\n }\n });\n }", "function setParamaters($valuetoadd=null) {\n if (empty($valuetoadd)) {\n $this->preparedvalues = array();\n return null;\n } else \n return array_push($this->preparedvalues, $valuetoadd); \n\t}", "public function setParameters($parameters){\n\t\tself::$_parameters[get_class($this)] = $parameters;\n\t}", "public function setParameters(/*Vector<IParameterData>*/ $value) /*: this*/ {\n $this->parameters = $value;\n return $this;\n }", "function addParameter($name, $value) {\n\t\t$this->link->addParameter($name, $value);\n\t}", "public function setParameters($params) {\n\t\t$defaultParams = $this->params;\n\t\t$allParams = array_merge($defaultParams, $params);\n\n\t\t$this->validateParameters($allParams);\n\n\t\t// Save parameters as they were\n\t\t$this->params = $allParams;\n\n\t\t// Update request URLs from the new parameters\n\t\t$this->urlRaw = $this->build();\n\t\t$this->url = $this->build(true);\n\t}", "public function add()\n {\n for ($i = 0 ; $i < func_num_args(); $i++) {\n $this->addSingle(func_get_arg($i));\n }\n }", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "function add($parameters, $action) {\n $place = count($this->map);\n $this->map[$place] = array();\n $this->map[$place]['params'] = new ParametersExpectation($parameters);\n $this->map[$place]['content'] = $action;\n }", "public final function addParameter($arg1, $arg2=null)\n {\n $this->setParameter($arg1, $arg2, false);\n }", "public function mergeIntoParameters(array $parameters = array())\n {\n return $parameters + array(\n $this->getSoapParameterKey() => $this->getData(),\n );\n }", "public function setAdditionalParams(array $params = []): self\n\t{\n\t\t$this->additionalParams = $params;\n\n\t\treturn $this;\n\t}", "public function add(...$items);", "protected function addParameters(ControllerInterface $controller, Request $request)\n {\n $regex = $this->ut->compile($controller->uri(), $controller->conditions());\n $params = $this->ut->parameters($regex, $request->getPathInfo());\n $request->request->add($params);\n }", "public function setParameters(array $parameters)\n {\n $this->clearCachedValueIf($this->params != $parameters);\n $this->params = $parameters;\n }", "public function setParams($params);", "public function setParams($params);", "public function addParameter($key, $mandatory = false, $list = '', $default = '', $description = '')\n\t{\n\t\tif(!isset($key) || $key == '') {\n\t\t\ttrigger_error('Please specify a parameter name', E_USER_ERROR);\n\t\t\treturn FALSE;\n\t\t}\n\t\tif($mandatory != true && $mandatory != false) {\n\t\t\ttrigger_error('mandatory setting must either be true or false', E_USER_ERROR);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$this->parameters[$key] = array('mandatory' => $mandatory, 'list' => $list, 'default' => $default, 'description' => $description);\n\t\treturn TRUE;\n\t}", "function addExtraParameter($name) {\n\t\t$this->addParameter($name, Request::getParameter($name));\n\t}", "public function stdWrap_addParams($content = '', $conf = [])\n {\n return $this->addParams($content, $conf['addParams.']);\n }", "private function _setParams($params)\n {\n $this->_params = array();\n foreach ($params as $paramKey => $paramValue) {\n $this->_params[$paramKey] = $paramValue;\n }\n }", "public function addParameter(string $parameterName, $parameterValue): void\n {\n $this->parameters[$parameterName] = $parameterValue;\n }", "public function params(array $parameters): self\n {\n foreach ($parameters as $name => $value) {\n $this->param($name, $value);\n }\n\n return $this;\n }", "private function specifyParameters(): void\n {\n // We will loop through all of the arguments and options for the command and\n // set them all on the base command instance. This specifies what can get\n // passed into these commands as \"parameters\" to control the execution.\n foreach ($this->getArguments() as $arguments) {\n $this->addArgument(...$arguments);\n }\n\n foreach ($this->getOptions() as $options) {\n $this->addOption(...$options);\n }\n }", "public function appendQueryParameters(iterable $parameters): self\n {\n return $this->appendQuery(Query::fromParameters($parameters)->value());\n }", "function params( $array ) {\n\t\t$this->params_list = $array;\n\t\t}", "public function add(array $params) {\n $this->_list[$params['option_id']][$params['store_id']] = $params;\n }", "final protected function _setParameters(array $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$this->setParameter($key, $value);\n\t\t}\n\t}", "public function setParameters(array $parameters)\n {\n $this->parameters = $parameters;\n }", "public function addBaseParams()\n {\n $oRequest = $this->getPayPalRequest();\n $oPayPalConfig = $this->getPayPalConfig();\n\n $oRequest->setParameter(\"CALLBACKVERSION\", \"84.0\");\n $oRequest->setParameter(\"LOCALECODE\", $this->getLang()->translateString(\"OEPAYPAL_LOCALE\"));\n // enabled guest buy (Buyer does not need to create a PayPal account to check out)\n $oRequest->setParameter(\"SOLUTIONTYPE\", ($oPayPalConfig->isGuestBuyEnabled() ? \"Sole\" : \"Mark\"));\n $oRequest->setParameter(\"BRANDNAME\", $oPayPalConfig->getBrandName());\n $oRequest->setParameter(\"CARTBORDERCOLOR\", $oPayPalConfig->getBorderColor());\n\n $oRequest->setParameter(\"RETURNURL\", $this->getReturnUrl());\n $oRequest->setParameter(\"CANCELURL\", $this->getCancelUrl());\n\n if ($sLogoImage = $oPayPalConfig->getLogoUrl()) {\n $oRequest->setParameter(\"LOGOIMG\", $sLogoImage);\n }\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_PAYMENTACTION\", $this->getTransactionMode());\n }", "public function initParams()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->params[$key] = array();\n }\n }", "public function setAllParameters($allParameters){\n\t\tself::$_allParameters[get_class($this)] = $allParameters;\n\t}", "function params(array $params) {\n\t\t$this->_params = $params;\n\t}", "public function setParameter($params)\r\n\t{\r\n\t\tif (is_array($params))\r\n\t\t\t$this->params = array_merge($this->defaultParams(), $params);\r\n\t\telse\r\n\t\t\t$this->params = $this->defaultParams();\r\n\t}", "protected function addEssentialParameters($request, array $parameters = [])\n {\n //add extra params\n $parameters['request'] = $request; // what type of request we are trying to do over at Erply ( ex. 'getClientGroups' )\n $parameters['clientCode'] = $this->clientCode; // language string ( ex. 'eng' )\n $parameters['version'] = '1.0';\n\n // if the request is NOT the one to verify a user, wee need a session key in our params\n if($request != \"verifyUser\") $parameters['sessionKey'] = $this->getSessionKey();\n\n return $parameters;\n }", "public function finish_setting_parameters()\n {\n $this->set_variable( 'parameters', $this->parameters );\n }", "private function setParams()\n\t\t{\n\t\t\t/**\n\t\t\t* Remove do $this->_separetor os dois primeiros valores\n\t\t\t* referentes ao controller e action, deixando os demais valores\n\t\t\t* que serão usados para formarem os parametros, indices e valores\n\t\t\t*/\n\t\t\tunset($this->_separetor[1], $this->_separetor[2]);\n\t\t\t\n\t\t\t/**\n\t\t\t* Caso o ultimo item do $this->_separetor seja vazio\n\t\t\t* o mesmo é removido\n\t\t\t*/\n\t\t\tif ( end($this->_separetor) == null ) {\n\t\t\t\tarray_pop($this->_separetor);\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t* Se a $this->_separetor estivar vazia,\n\t\t\t* então os parametros serão definidos como vazios\n\t\t\t*/\n\t\t\tif ( !empty($this->_separetor) ) {\n\t\t\t\t/**\n\t\t\t\t* Percorre o array $this->_separetor, verificando os indices\n\t\t\t\t* se for impar, então seu valor será o indice do parametro.\n\t\t\t\t* Se for par, seu valor será o valor do paremetro\n\t\t\t\t*/\n\t\t\t\tforeach ($this->_separetor as $key => $value) {\n\t\t\t\t\tif ($key % 2 == 0) {\n\t\t\t\t\t\t$param_value[] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$param_indice[] = $value;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$param_value = array();\n\t\t\t\t$param_indice = array();\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t* Verifica se os indices e valores dos parametros\n\t\t\t* não são vazios e possuem a mesma quantidade\n\t\t\t* Então vaz um \"array_combine\" para juntar os dois arrays\n\t\t\t* formando um indice->valor para o parametro\n\t\t\t*/\n\t\t\tif ( !empty($param_indice) \n\t\t\t\t&& !empty($param_value)\n\t\t\t\t&& count($param_indice)\n\t\t\t\t== count($param_value)\n\t\t\t) {\n\t\t\t\t$this->_params = array_combine($param_indice, $param_value);\n\t\t\t} else {\n\t\t\t\t$this->_params = array();\n\t\t\t}\n\t\t}", "protected function addArguments(array $newArguments){\n foreach ($newArguments as $newArgument) {\n $this->add($newArgument);\n }\n }", "public function addBasketItemParams()\n {\n $oBasket = $this->getBasket();\n $oLang = $this->getLang();\n $oRequest = $this->getPayPalRequest();\n\n $iPos = 0;\n foreach ($oBasket->getContents() as $oBasketItem) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", getStr()->html_entity_decode($oBasketItem->getTitle()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasketItem->getUnitPrice()->getPrice()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", (int) $oBasketItem->getAmount());\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_ITEMURL{$iPos}\", $oBasketItem->getLink());\n\n $oBasketProduct = $oBasketItem->getArticle();\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NUMBER{$iPos}\", $oBasketProduct->oxarticles__oxartnum->value);\n\n $iPos++;\n }\n\n //adding payment costs as product\n if ($oBasket->getPayPalPaymentCosts() > 0) {\n $sPaymentTitle = $oLang->translateString(\"OEPAYPAL_SURCHARGE\") . \" \" . $oLang->translateString(\"OEPAYPAL_TYPE_OF_PAYMENT\");\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $sPaymentTitle);\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalPaymentCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding wrapping as product\n if ($oBasket->getPayPalWrappingCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GIFTWRAPPER\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalWrappingCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding greeting card as product\n if ($oBasket->getPayPalGiftCardCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_GREETING_CARD\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalGiftCardCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n\n $iPos++;\n }\n\n //adding trusted shops protection as product\n if ($oBasket->getPayPalTsProtectionCosts() > 0) {\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_NAME{$iPos}\", $oLang->translateString(\"OEPAYPAL_TRUSTED_SHOP_PROTECTION\"));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_AMT{$iPos}\", $this->_formatFloat($oBasket->getPayPalTsProtectionCosts()));\n $oRequest->setParameter(\"L_PAYMENTREQUEST_0_QTY{$iPos}\", 1);\n }\n }", "public function appendQueryParams($params) {\n $new_query = $this->getQuery();\n \n if (is_array($params))\n {\n $new_query .= http_build_query($params); \n }\n else\n {\n $new_query .= self::QUERY_PARAM_DELIMITER.$params;\n }\n \n $this->setQuery($new_query);\n }", "public function addParam($name, $value){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "function setParams($params) {\n $this->params = $params;\n }", "public function addParam (string $key, $value)\n {\n if (!$this->paramExists($key))\n $this->params[$key] = $value;\n\n $this->save();\n\n return $this;\n }", "public function getParameters()\n {\n return array();\n }", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "public function setParams($params) {\n $this->params = $params;\n }", "public function add($name, $value = null)\n {\n $noName = false;\n if (null === $name) {\n $name = Parameter::guessParameterNameByValue($value);\n $noName = true;\n }\n\n if (isset($this->parameters[strtoupper($name)])) {\n $this->parameters[strtoupper($name)]->addValue($value);\n } else {\n $param = new Parameter($this->root, $name, $value);\n $param->noName = $noName;\n $this->parameters[$param->name] = $param;\n }\n }", "protected function populateParams()\n\t{\n\n\t\tparent::populateParams();\n\t\t//$acl = ZefaniabibleHelper::getAcl();\n\t\t$mdl_acl = new ZefaniabibleHelper;\n\t\t$acl = $mdl_acl->getAcl();\n\t\tif (!isset($this->_data))\n\t\t\treturn;\n\n\t\t// Convert the parameter fields into objects.\n\t\tforeach ($this->_data as &$item)\n\t\t{\n\n\t\t\tif ($acl->get('core.edit.state')\n\t\t\t\t|| (bool)$item->publish)\n\t\t\t\t$item->params->set('access-view', true);\n\n\t\t\tif ($acl->get('core.edit'))\n\t\t\t\t$item->params->set('access-edit', true);\n\n\t\t\tif ($acl->get('core.delete'))\n\t\t\t\t$item->params->set('access-delete', true);\n\n\n\t\t}\n\n\t}" ]
[ "0.72710747", "0.7168612", "0.6997212", "0.6882149", "0.6831347", "0.6584377", "0.6551827", "0.6526356", "0.6503619", "0.64299524", "0.6426557", "0.6244276", "0.6224035", "0.61692095", "0.6123231", "0.61003435", "0.6056361", "0.60295343", "0.60172564", "0.60032135", "0.5989905", "0.59834635", "0.5966581", "0.5936386", "0.59352386", "0.5932931", "0.59217435", "0.59082705", "0.5902612", "0.58805877", "0.5874599", "0.5827312", "0.5824548", "0.58171064", "0.58130234", "0.58112836", "0.57906705", "0.57865024", "0.5785092", "0.57821333", "0.5753254", "0.57481784", "0.574666", "0.5732961", "0.57318133", "0.5727327", "0.57202256", "0.5719729", "0.56959844", "0.5687591", "0.5672636", "0.56590855", "0.56506073", "0.56403106", "0.563426", "0.5622436", "0.561569", "0.5602711", "0.5602711", "0.56014454", "0.55812013", "0.55700064", "0.5565925", "0.5561125", "0.5551408", "0.55384976", "0.55280435", "0.55280435", "0.55104506", "0.55091304", "0.549113", "0.54905784", "0.5471556", "0.5463171", "0.5462287", "0.54568136", "0.5436683", "0.5414272", "0.5405874", "0.5388668", "0.5383459", "0.53733134", "0.53724784", "0.5353524", "0.5353442", "0.5350204", "0.5349682", "0.5345798", "0.5332753", "0.5331383", "0.53308403", "0.5330447", "0.5321893", "0.53214663", "0.5310403", "0.5306458", "0.5306227", "0.53038573", "0.5291654", "0.5290842" ]
0.69284534
3
Gets all parameters. Alias of all().
public function getAll();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all()\r\n {\r\n return $this->parameters;\r\n }", "public function all()\n {\n return $this->params;\n }", "public function getAllParam()\n {\n return isset($this->params) ? $this->params : null;\n }", "public function getParameters()\n {\n return $this->parameters->all();\n }", "public function all($params = array());", "public function all($params)\n {\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParameters() {}", "public function getParameters()\n {\n return array();\n }", "public function getParams() {}", "public function getAllParameters()\n\t{\n\t\t// Collect parameters used in template\n\t\t$params = [];\n\t\tforeach ($this->configurator->tags as $tag)\n\t\t{\n\t\t\tif (isset($tag->template))\n\t\t\t{\n\t\t\t\tforeach ($tag->template->getParameters() as $paramName)\n\t\t\t\t{\n\t\t\t\t\t$params[$paramName] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Merge defined parameters and those collected from templates. Defined parameters take\n\t\t// precedence\n\t\t$params = iterator_to_array($this->parameters) + $params;\n\n\t\t// Sort parameters by name for consistency\n\t\tksort($params);\n\n\t\treturn $params;\n\t}", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function getParameters(): array;", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "public function getDefinedParameters();", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}", "public function getAllParams():array\n {\n $params = $this->getParams();\n $params = array_add($params,'MerchantId',$this->getEchargeObject()->getMerchantId());\n return $params;\n }", "function getParameters(): array;", "public function get_parameters()\n\t{\n\t\treturn $this->set_params;\n\t}", "public function getParams(): array;", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters() : array\n {\n return $this->parameters;\n }", "public static function all();", "public static function all();", "public static function all();", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function getParameters(): array {\n\t\t\treturn $this->parameters;\n\t\t}", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "abstract public function getParameters();", "public function all(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "public function getParametersList(){\n return $this->_get(2);\n }", "public function getParameters() {\n return $this->parameters;\n }", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();", "public function all();" ]
[ "0.8583619", "0.85735244", "0.8019177", "0.77445775", "0.76646143", "0.72774684", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7212084", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7052244", "0.7046455", "0.7018568", "0.7000317", "0.69866425", "0.6967027", "0.6959843", "0.69573253", "0.6954299", "0.69274807", "0.6923678", "0.6918721", "0.68912345", "0.6865595", "0.6859376", "0.6838243", "0.6838243", "0.6827197", "0.68256", "0.68256", "0.68256", "0.68256", "0.6816853", "0.68124276", "0.68124276", "0.68124276", "0.6798289", "0.67888457", "0.67888457", "0.67888457", "0.67888457", "0.6778135", "0.6770492", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.67535067", "0.6749162", "0.6738611", "0.67335147", "0.67335147", "0.67311764", "0.67220324", "0.6718055", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926", "0.6712926" ]
0.0
-1
Returns true if a parameter name is defined.
public function has($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function has_parameter( $name ) {\n\t\treturn ! empty( $this->parameters[ $name ] );\n\t}", "public function hasParameter($name)\n {\n return array_key_exists($name, $this->parameters);\n }", "public function hasParameter(string $name): bool\n {\n return isset($this->parameters[$name]);\n }", "public function hasParameter($name);", "public function hasParameter($name);", "public function hasParameter($name)\n {\n return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);\n }", "final public function hasParameter($name)\n {\n return isset($this->parameters[$name]);\n }", "public function hasParameter($name)\n {\n return array_key_exists($name, $this->config);\n }", "public function hasParamValue(string $name): bool;", "public function hasParam($name)\n {\n return (isset($this->params[$name]));\n }", "public function hasParam($name);", "public function hasParam($name)\n {\n return isset($this->params[$name]);\n }", "public function hasParameter ($name)\n {\n\n return isset($this->parameters[$name]);\n\n }", "public function hasParameter($name)\n {\n if ($this->hasParameters()) {\n return array_key_exists($name, $this->parameters());\n }\n return false;\n }", "public function hasNamedParameter($name)\n {\n return isset($this->namedParameters[strtolower($name)]);\n }", "public function hasParameter($name)\n {\n if ($this->hasParameters()) {\n return array_key_exists($name, $this->getParameters());\n }\n\n return false;\n }", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function hasRequestParameter($name)\n {\n return $this->request_parameter_holder->has($name);\n }", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "public function has($name)\r\n {\r\n return array_key_exists($name, $this->parameters);\r\n }", "public function has(String $name)\n {\n return isset($this->parameters[$name]);\n }", "public function has(string $name): bool\n {\n foreach ($this as $parameter) {\n if ($parameter->getName() === $name) {\n return true;\n }\n }\n\n return false;\n }", "public function __isset(string $name): bool\n {\n return isset($this->parameters[$name]);\n }", "public function hasParameter($name, $ns = null)\r\n {\r\n return $this->parameterHolder->has($name, $ns);\r\n }", "public function hasParameters()\n {\n return preg_match('/\\{/', $this->pattern) === 1;\n }", "public function paramExists (string $key)\n {\n if (array_key_exists($key, $this->getParams()))\n return true;\n\n return false;\n }", "public function __isset($name)\n {\n return array_key_exists($name, $this->params);\n }", "public function hasParameters()\n {\n return isset($this->parameters);\n }", "public function __isset($name)\n {\n return $this->hasParam($name);\n }", "public function has($name)\n {\n return array_key_exists($name, $this->params);\n }", "public function hasParameter($parameterName)\n {\n return isset($this->parameters[$parameterName]);\n }", "public function hasParameter($param)\n {\n return array_key_exists($param, $this->params);\n }", "public function hasParam($name, $namespace = self::NAMESPACE_DEFAULT)\n {\n return isset($this->params[$namespace][$name]);\n }", "public function hasParameters()\n {\n return !empty($this->params);\n }", "public function hasParameters()\n {\n return count($this->parameters) > 0;\n }", "public function parameterExists($key);", "public function hasParameters()\n {\n return isset($this->parameters) && count($this->parameters) > 0;\n }", "public function has_parameters() {\r\n\t\treturn (sizeof($this->parameters) > 0);\r\n\t}", "public function hasParameter(string $id): bool\n {\n return $this->exists($id, self::DEFINITION_PARAMETER);\n }", "public function parameterExist($parameterName) {\n $result = array_key_exists($parameterName, $this->params);\n return $result;\n }", "public function has_param($key)\n {\n }", "public function hasArgument($name): bool;", "public function hasParameter($index)\n {\n return (\n isset($this->parameters[$index])\n && $this->parameters[$index] != ''\n );\n }", "function isParam($name) {\r\n return ( getParam($name) != false );\r\n}", "public function hasParameter(string $id): bool\n {\n return isset($this->getParameters()[$id]);\n }", "public function isValidParam ($key)\n {\n if (in_array(strtoupper($key), $this->_validParamNames)) {\n return true;\n }\n return false;\n }", "public function hasArgument($name)\n {\n return $this->input->hasArgument($name);\n }", "final public static function isDefinedName($name)\n {\n self::initOptions();\n\n return isset(self::$options[$name]);\n }", "public function hasBodyParam($name)\n {\n if (isset($this->bodyParams[$name])) {\n return true;\n }\n return false;\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParameters() {\n $count = count($this->getParameters());\n \n return ($count > 0) ? $count : FALSE;\n }", "public function hasParameterValue($parameterName)\n {\n return $this->hasParameter($parameterName) && !$this->getParameter($parameterName)->isRequired();\n }", "public function has($name)\n {\n if (is_string($name) === false) {\n throw new Exception('Invalid parameter type.');\n }\n $annotations = $this->_annotations;\n if (is_array($annotations)) {\n foreach ($annotations as $annotation) {\n if ($name == $annotation->geName()) {\n return true;\n }\n }\n }\n return false;\n\n }", "public function hasArg($name)\n {\n return isset($this->args[$name]);\n }", "public function has(string $parameterName)\n {\n return isset($this->parameters[$parameterName]);\n }", "public function hasParam($param)\n {\n return isset($this->params[$param]);\n }", "public function __isset($name)\n {\n return array_key_exists($name, $this->userParams);\n }", "public function hasParameters(){\n return $this->_has(2);\n }", "private function hasParam(string $parameter): bool\n {\n return in_array($parameter, $this->queryParameters);\n }", "public function has($name)\n {\n return $this->argument->defined($name);\n }", "public function hasParam($index): bool\n {\n return isset($this->params[$index]);\n }", "public function __isset($name)\n {\n return isset($this->_params['args'][$name]);\n }", "public function __isset($name)\n {\n return isset($this->_params['args'][$name]);\n }", "public function hasArgument($name);", "public function hasArgument($name);", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "public function hasParams(){\n return $this->_has(8);\n }", "public function hasArgument(string|int $name): bool\n {\n $arguments = \\is_int($name) ? array_values($this->arguments) : $this->arguments;\n\n return isset($arguments[$name]);\n }", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "public function hasRequiredParameters()\n {\n foreach ($this->parameters as $parameter) {\n if ($parameter->isRequired()) {\n return true;\n }\n }\n\n return false;\n }", "public function isOpenParameter()\n\t{\n\t\treturn $this->_value == '...';\n\t}", "public function hasArg(string $name) : bool {\n $added = false;\n\n foreach ($this->getArguments() as $argObj) {\n $added = $added || $argObj->getName() == $name;\n }\n\n return $added;\n }", "public function hasName()\n {\n return $this->get(self::NAME) !== null;\n }", "public function areNamesParamsIdentical(): bool;", "public function isdef($_name) {\n\t\treturn array_key_exists($_name,$this->virtual);\n\t}", "public function hasKeyIDParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_KID);\n }", "public function isMethodParameter() {}", "public function hasName(): bool\n {\n return $this->nameAttr !== NULL;\n }", "public function isValidParameter($key)\n {\n if (empty($key)) return false;\n\n $validParameters = $this->getValidParameters();\n\n return empty($validParameters) || in_array($key, $validParameters);\n }", "public function hasOptionalParameters()\n {\n foreach ($this->parameters as $parameter) {\n if (!$parameter->isRequired()) {\n return true;\n }\n }\n\n return false;\n }", "public function hasKeyValueParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_K);\n }", "private function isNamedParameterable(string $statement): bool\n {\n return ! preg_match('/^alter+ +table/', strtolower(trim($statement))) and ! preg_match(\n '/^create+ +table/',\n strtolower(trim($statement))\n );\n }", "public function hasSwitchParam(): bool\n {\n return $this->request && $this->request->query->has($this->switchParam);\n }", "public function has($key): bool\n {\n return array_key_exists($key, $this->params);\n }", "public function optionExists($name)\n {\n if ( !$name || !is_string($name) ) {\n throw new ScriptException(\"Parameter name is missing or invalid in call to HttpRequest::param()\");\n }\n\n return $this->options->exists($name);\n }", "private function _requestHasParam(string $key, array $request)\n {\n return array_key_exists($key, $request);\n }", "public function hasName()\n {\n return isset($this->name);\n }", "function has($name = '')\n {\n }", "public function hasFirstPrimeFactorParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_P);\n }", "public function IsParametersSet()\n {\n $parameters = $this->GetParameters();\n \n $isSet = !is_null($parameters);\n \n return $isSet;\n }", "public static function isSpecified($name)\n {\n \\assert(null !== $name);\n \\assert(\\is_string($name));\n return (\\array_key_exists($name, self::getSpecifications()));\n }", "function isTheseParametersAvailable($params){\n\t\t\n\t\t//traversing through all the parameters \n\t\tforeach($params as $param){\n\t\t\t//if the paramter is not available\n\t\t\tif(!isset($_POST[$param])){\n\t\t\t\t//return false \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t//return true if every param is available \n\t\treturn true; \n\t}", "public function hasName()\n {\n return $this->name !== null;\n }", "public function hasDynamicParameter(string $parameter): bool\n {\n $this->buildDynamicParameters();\n\n return $this->dynamicParameters->offsetExists($parameter);\n }", "public function hasArg($argName) {\n return isset($this->getArgs()[trim($argName)]);\n }", "public function valid(): bool\n {\n return isset($this->parameters[$this->position]);\n }", "public function hasParameter($parameters) {\n\t\ttry {\n\t\t\t$value = $this->getParameter($parameters);\n\t\t} catch (\\Exception $e) {\n\t\t\t$value = null;\n\t\t}\n\t\treturn isset($value);\n\t}" ]
[ "0.8393713", "0.8341317", "0.8306979", "0.82981473", "0.82981473", "0.8247657", "0.82252705", "0.8212532", "0.8203109", "0.818559", "0.81779355", "0.8163702", "0.8161107", "0.8145657", "0.8122167", "0.80448806", "0.7980535", "0.79222465", "0.7892111", "0.7815151", "0.77349365", "0.76977533", "0.7696184", "0.76755184", "0.7527481", "0.750419", "0.7463552", "0.74292666", "0.7424444", "0.7406585", "0.7333413", "0.730826", "0.7307971", "0.729781", "0.72699755", "0.72549987", "0.72351986", "0.72065693", "0.71883124", "0.71867514", "0.7174318", "0.7171701", "0.7150022", "0.71098113", "0.7089451", "0.7069466", "0.7030506", "0.7009703", "0.6998199", "0.6961152", "0.6961152", "0.6961152", "0.6961152", "0.6961152", "0.6960104", "0.69577545", "0.6940506", "0.6928438", "0.687283", "0.6869109", "0.6868297", "0.68582416", "0.6853947", "0.6852674", "0.6848961", "0.6847559", "0.6847559", "0.68450284", "0.68450284", "0.6788516", "0.6762696", "0.67129654", "0.6697004", "0.66746974", "0.6661796", "0.6649698", "0.66345394", "0.65838933", "0.6546313", "0.6545724", "0.6542891", "0.65405166", "0.65170866", "0.64906263", "0.6484342", "0.64694834", "0.6463609", "0.64532197", "0.64459926", "0.6428141", "0.64279854", "0.64269626", "0.6421478", "0.6411151", "0.64030117", "0.6401258", "0.6386486", "0.63676715", "0.6358626", "0.6356188", "0.63541245" ]
0.0
-1
get contractors for category
function display($tmpl) { $cat = JRequest::getVar('cat'); $method = JRequest::getVar('method'); if($method == 'choosencat') { echo $this->getContractorsForCategory($cat); die(); } // get contractors for all categories $categories = $this->getAllCategories($cat); foreach ($categories as $categorie) { $categoriesContractors[$categorie->id] = $this->getContractorsForCategory($categorie->id); $categorieName[$categorie->id] = $categorie->catname; } $category_contractors = array_combine($categorieName, $categoriesContractors); arsort($category_contractors); $category_contractors = json_encode($category_contractors); echo $category_contractors; die(); parent::display($tmpl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContractors()\n {\n return $this->hasMany(User::className(), ['id' => 'contractor_id'])->viaTable('favorite_contractor', ['customer_id' => 'id']);\n }", "function getConveyancingCompanies(){\n \n $conveyancingCompanies = array();\n \n $conveyancingLeadTypeCatIds = unserialize(CONVEYANCING_LEAD_TYPE_CATEGORY_IDS);\n foreach($conveyancingLeadTypeCatIds as $id){\n \n $leadTypeCat = new Models_LeadTypeCategory($id);\n $companies = $leadTypeCat->getCompanies();\n \n foreach($companies as $company){\n $conveyancingCompanies[$company[\"id\"]] = trim($company[\"companyName\"]);\n }\n }\n \n natcasesort($conveyancingCompanies);\n \n return $conveyancingCompanies;\n}", "public function getContracts()\n {\n return $this->hasMany(Contracts::className(), ['company_id' => 'id']);\n }", "public function index()\n {\n $categories = Category::all();\n $contractors = Contractor::all();\n \n return view('links.contractor.index')->withContractors($contractors)->withCategories($categories);\n }", "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "public function getAllWithCategory();", "public function getFavoriteContractors()\n {\n return $this->hasMany(FavoriteContractor::className(), ['contractor_id' => 'id']);\n }", "public function findCategories();", "public static function getAvailableContractors(): array\n {\n $contractorsQuery = ContractorOccupation::find()->select('DISTINCT(contractor_id)');\n\n return self::find()\n ->select('*')\n ->addSelect([\n 'COUNT(task.contractor_id) AS doneTaskCount',\n 'COUNT(review.task_id) AS reviewCount',\n 'AVG(review.rating) AS rating'\n ])\n ->rightJoin(['occupation' => $contractorsQuery], 'user.id = occupation.contractor_id')\n ->leftJoin('task', 'task.contractor_id = user.id')\n ->leftJoin('review', 'task.id = review.task_id')\n\n ->andWhere(['task.state_id' => Task::STATE_DONE])\n ->andWhere(['user.hide_profile' => false])\n ->groupBy('user.id')\n ->orderBy('user.datetime_created ASC')\n ->all();\n }", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function getCompany();", "public function getAuthorcompany() {}", "public function getCategories();", "public function getCategories();", "public function ContractsGetAll($filter)\n {\n $query = Contracts::with('Customers')->whereRaw(\"1 = 1\");\n $sSearchInput = isset($filter['searchInput']) ? trim($filter['searchInput']) : '';\n $sSortCol = isset($filter['sSortCol']) ? $filter['sSortCol'] : 'code';\n $sSortDir = isset($filter['sSortDir']) ? $filter['sSortDir'] : 'desc';\n\n $limit = isset($filter['limit']) ? $filter['limit'] : config('const.LIMIT_PER_PAGE');\n if ($sSearchInput != '') {\n $query->where('content', 'LIKE', '%' . $sSearchInput . '%');\n $query->orWhere('code', 'LIKE', '%' . $sSearchInput . '%');\n $query->orWhere('value', 'LIKE', '%' . $sSearchInput . '%');\n }\n\n if ($sSortCol) {\n $query->orderBy($sSortCol, $sSortDir);\n }\n\n $rResult = $query->paginate($limit)->toArray();\n $arrData = $rResult['data'];\n foreach ($arrData as $key => $value) {\n $signdate = date('d/m/Y', strtotime($value['signdate']));\n $arrData[$key]['signdate'] = $signdate;\n }\n $rResult['data'] = $arrData;\n return $rResult;\n }", "function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function getByCategory()\n {\n return $this->by_category;\n }", "function GetCompetitors()\n\t{\n\t\t$result = $this->sendRequest(\"GetCompetitors\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCompanyWithUsers();", "public function getCompany() {}", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "public function getCategory()\n {\n }", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }", "public function getCustomers()\n {\n return $this->hasMany(User::className(), ['id' => 'customer_id'])->viaTable('favorite_contractor', ['contractor_id' => 'id']);\n }", "public function getSalesCenterAndCommodity(Request $request) {\n $client = Client::find($request->client_id);\n if (!empty($client)) {\n /* check user access level */\n if(Auth::check() && Auth::user()->hasAccessLevels('salescenter')) {\n $salesCenters = getAllSalesCenter();\n } else {\n $salesCenters = $client->salesCenters()->orderBy('name')->get();\n }\n $commodity = $client->commodity()->orderBy('name')->get();\n\n return response()->json([\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n } else {\n $salesCenters = getAllSalesCenter();\n $commodity = Commodity::orderBy('name')->get();\n return response()->json([\n\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n }\n }", "public function listContract()\n {\n return view('admin.basic.customer.list-contract', [\n 'data' => Contract::distinct('user_id')->get(['user_id', 'admin_id', 'phone', 'email']),\n 'pageTitle' => Lang::trans('label.Customer contract')\n ]);\n }", "protected function getCommodities() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.category_id')));\n\t\t$query->select('CONCAT('.$db->quoteName('a.name').', \" (\",'.$db->quoteName('a.denomination').', \")\") name');\n\t\t$query->from($db->quoteName('#__gtpihps_commodities', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t$query->where($db->quoteName('a.short_name') . ' IS NOT NULL');\n\t\t$query->order($db->quoteName('a.id'));\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->category_id][$item->id] = $item->name;\n\t\t}\n\n\t\treturn $data;\n\t}", "function getCategories(){\r\n\t\trequire_once(\"AffiliateUserGroupPeer.php\");\r\n \trequire_once(\"AffiliateGroupCategoryPeer.php\");\r\n \t$sql = \"SELECT \".AffiliateCategoryPeer::TABLE_NAME.\".* FROM \".AffiliateUserGroupPeer::TABLE_NAME .\" ,\".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::TABLE_NAME .\", \".AffiliateCategoryPeer::TABLE_NAME .\r\n\t\t\t\t\t\t\" where \".AffiliateUserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\r\n\t\t\t\t\t\tAffiliateUserGroupPeer::GROUPID .\" = \".AffiliateGroupCategoryPeer::GROUPID .\" and \".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::CATEGORYID .\" = \".AffiliateCategoryPeer::ID .\" and \".\r\n\t\t\t\t\t\tAffiliateCategoryPeer::ACTIVE .\" = 1\";\r\n \t\r\n \t$con = Propel::getConnection(AffiliateUserPeer::DATABASE_NAME);\r\n $stmt = $con->createStatement();\r\n $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); \r\n return BaseCategoryPeer::populateObjects($rs);\r\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCategory(): string;", "public function findAllCategories(): iterable;", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "public function getCommodities() {\n\t\t$db\t\t= $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->select($db->quoteName(array('a.id', 'a.category_id', 'a.source_id', 'a.name', 'a.denomination')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_commodities', 'a'));\n\t\t$query->order($db->quoteName('a.id') . ' asc');\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t//echo nl2br(str_replace('#__','pihps_',$query));\n\t\t$db->setQuery($query);\n\t\t$data = $db->loadObjectList('id');\n\n\t\tforeach ($data as &$item) {\n\t\t\t$item->name = trim($item->name);\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "function getContractRelList(){\n $sql = \"SELECT * FROM user_contract ORDER by id DESC\";\n return getAll($sql);\n}", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'company_category', 'company_id', 'category_id');\n }", "function getVendorsByCategory(Request $request)\n {\n $ids = $request->all();\n //return $idString = implode(',', $ids);\n // return VendorCategory::whereIn('id', $ids)\n // ->with('vendors')\n // ->get();\n // return Vendor::whereIn('category_id', $ids)\n // ->get();\n\n $Vendor = DB::table('vendors as vend')\n ->join('vendor_approvals as vap','vend.id','=','vap.vendor_id')\n ->where('vap.vendor_status','1')\n ->whereIn('vend.category_id', $ids)\n ->select('vend.id','vend.name_of_firm','vap.vendor_status')\n ->get();\n return $Vendor;\n \n }", "public function getRewardCategories()\r\n {\r\n return Controllers\\RewardCategories::getInstance();\r\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public function getInvitationByCategory($category) {\n\t\tglobal $db;\n\n\t\t$invitations = $db->query(\"\n\t\t\tSELECT A.*, B.Name \n\t\t\tFROM invites A\n\t\t\tJOIN person B\n\t\t\tON A.PersonID = B.id\n\t\t\tWHERE A.Category1 LIKE '$category' \n\t\t\tOR A.Category2 LIKE '$category' \n\t\t\tOR A.Category3 LIKE '$category'\n\t\t\tLIMIT 10\");\n\t\treturn $invitations;\n\t}", "public function company()\n {\n return $this->business();\n }", "public function listAll()\n {\n return $this->contractor->all()->pluck('name', 'id')->all();\n }", "public function filteredByCategory(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->where('category_id', $request->category)\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }", "public function index()\n {\n $resource = CommonCategory::with('restaurants')->paginate();\n return new CommonCategoryCollection($resource);\n }", "private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function subcontractors() {\n return $this->hasMany(SubContractor::class);\n }", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }", "public function getServerCategories($filter=\"\"){\n $category = new Category;\n return $category->get();\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function getContractorOccupations()\n {\n return $this->hasMany(ContractorOccupation::className(), ['contractor_id' => 'id']);\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function getCategoriesForListView(): Collection;", "public function getAllForCustonObj() {\n $query = $this->db->query(\"SELECT * FROM $this->table ORDER BY shortname;\");\n $this->allcpny = $query->custom_result_object('entity\\Company');\n // print \"<pre>\";\n // print_r($this->cpny);\n // print \"</pre>\";\n // exit();\n return $this->allcpny;\n }", "public function getAllCategories();", "function commodityAction() {\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t $conn = Doctrine_Manager::connection(); \n \t$session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t// debugMessage($this->_getAllParams());\n \t\n \t$feed = '';\n \t$hasall = true;\n \t$issearch = false;\n \t$iscount = false;\n \t$ispaged = false;\n \t$where_query = \" \";\n \t$type_query = \" AND cp.pricecategoryid = '2' \";\n \t$group_query = \" GROUP BY c.id \";\n \t$limit_query = \"\";\n \t$select_query = \" c.id, c.name as `Commodity`, cat.name as Category, c.description as Description, \n \t\tu.`name` as `Unit`\";\n \t\n \tif(isArrayKeyAnEmptyString('filter', $formvalues)){\n \t\techo \"NO_FILTER_SPECIFIED\";\n \t\texit();\n \t}\n \t\n \t$iscategory = false;\n \t# fetch commodities filtered by categoryid\n \tif($formvalues['filter'] == 'categoryid'){\n \t\t$catid = '';\n \t\tif(isEmptyString($this->_getParam('catid'))){\n \t\t\techo \"CATEGORY_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($this->_getParam('catid'))){\n \t\t\techo \"CATEGORY_INVALID\";\n\t \t\texit();\n \t\t} \n \t\tif(!isEmptyString($this->_getParam('catid'))){\n \t\t\t$category = new CommodityCategory();\n\t \t\t$category->populate($formvalues['catid']);\n\t \t\t// debugMessage($category->toArray());\n\t \t\tif(isEmptyString($category->getID())){\n\t \t\t\techo \"CATEGORY_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$catid = $formvalues['catid'];\n\t \t\t$iscategory = true;\n \t\t\t$hasall = false;\n \t\t\t$where_query .= \" AND c.categoryid = '\".$catid.\"' \";\n \t\t\t}\n \t\tif(isEmptyString($catid)){\n\t \t\techo \"CATEGORY_NULL\";\n\t\t \texit();\n\t \t}\n \t}\n \t# fetch commodities filtered by category name\n \t\tif($formvalues['filter'] == 'category'){\n \t\t$catid = '';\n \t\tif(isEmptyString($this->_getParam('catname'))){\n \t\t\techo \"CATEGORY_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(is_numeric($this->_getParam('catname'))){\n \t\t\techo \"CATEGORY_INVALID\";\n\t \t\texit();\n \t\t} \n \t\tif(!isEmptyString($this->_getParam('catname'))){\n \t\t\t$category = new CommodityCategory();\n\t \t\t$catid = $category->findByName($formvalues['catname']);\n\t \t\tif(isEmptyString($catid)){\n\t \t\t\techo \"CATEGORY_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$iscategory = true;\n \t\t\t$hasall = false;\n \t\t\t$where_query .= \" AND c.categoryid = '\".$catid.\"' \";\n \t\t\t}\n\t \t\tif(isEmptyString($catid)){\n\t \t\techo \"CATEGORY_NULL\";\n\t\t \texit();\n\t \t}\n \t}\n \t\t\n \t# searching for particular commodity\n \tif($formvalues['filter'] == 'search'){\n \t\t// check that search parameters have been specified\n \t\tif(isEmptyString($this->_getParam('comid')) && isEmptyString($this->_getParam('comname'))){\n \t\t\techo \"NULL_SEARCH_PARAMETER\";\n\t \t\texit();\n \t\t}\n \t\t$com = new Commodity();\n \t\t// commodityid specified\n \t\tif(!isEmptyString($this->_getParam('comid'))){\n\t \t\t$com->populate($formvalues['comid']);\n\t \t\t// debugMessage($com->toArray());\n\t \t\tif(isEmptyString($com->getID()) || !is_numeric($formvalues['comid'])){\n\t \t\t\techo \"COMMODITY_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$comid = $com->getID();\n\t \t\t$where_query .= \" AND c.id = '\".$comid.\"' \";\n \t\t}\n \t\t/*if(!isEmptyString($this->_getParam('comname')) ){\n\t \t\t// debugMessage($com->toArray());\n\t \t\tif(isEmptyString($this->_getParam('comname'))){\n\t \t\t\techo \"CATEGORY_NULL\";\n\t\t \t\texit();\n\t \t\t}\n\t \t\t$where_query .= \" AND c.name LIKE '%\".$this->_getParam('comname').\"%' \";\n \t\t}*/\n \t\t// commodty name specified\n \t\tif(!isEmptyString($this->_getParam('comname'))){\n \t\t\t$searchstring = $formvalues['comname'];\n \t\t\t$islist = false;\n\t \t\tif(strpos($searchstring, ',') !== false) {\n\t\t\t\t\t$islist = true;\n\t\t\t\t}\n\t\t\t\tif(!$islist){\n\t \t\t\t$comid = $com->findByName($searchstring);\n\t \t\t\t$comid_count = count($comid);\n\t \t\t\tif($comid_count == 0){\n\t\t \t\t\techo \"COMMODITY_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\tif($comid_count == 1){\n\t\t \t\t\t$where_query .= \" AND c.id = '\".$comid[0]['id'].\"' \";\n\t\t \t\t}\n\t \t\t\tif($comid_count > 1){\n\t \t\t\t\t$ids_array = array();\n\t \t\t\t\tforeach ($comid as $value){\n\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t \t\t\t\t}\n\t \t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t \t\t\t\t// debugMessage($ids_list);\n\t\t \t\t\t$where_query .= \" AND c.id IN('\".$ids_list.\"') \";\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\tif($islist){\n\t\t\t\t\t$bundled = false;\n\t\t\t\t\t$searchstring = trim($searchstring);\n\t\t\t\t\t$seach_array = explode(',', $searchstring);\n\t\t\t\t\t// debugMessage($seach_array);\n\t\t\t\t\tif(is_array($seach_array)){\n\t\t\t\t\t\t$ids_array = array();\n\t\t\t\t\t\tforeach ($seach_array as $string){\n\t\t\t\t\t\t\t$com = new Commodity();\n\t\t\t\t\t\t\t$comid = $com->findByName($string);\n\t \t\t\t\t\t$comid_count = count($comid);\n\t\t\t\t\t\t\tif($comid_count > 0){\n\t\t\t \t\t\t\tforeach ($comid as $value){\n\t\t\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(count($ids_array) > 0){\n\t\t\t\t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t\t\t \t\t\t// debugMessage($ids_list);\n\t\t\t\t \t\t$where_query .= \" AND c.id IN('\".$ids_list.\"') \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n \t}\n \t\n \t// when fetching total results\n \tif(!isEmptyString($this->_getParam('fetch')) && $this->_getParam('fetch') == 'total'){\n \t\t$select_query = \" count(c.id) as records \";\n \t\t$group_query = \"\";\n \t\t$iscount = true;\n \t}\n \t// debugMessage($select_query);\n \t// exit();\n \t// when fetching limited results via pagination \n \tif(!isEmptyString($this->_getParam('paged')) && $this->_getParam('paged') == 'Y'){\n \t\t$ispaged = true;\n \t\t$hasall = false;\n \t\t$start = $this->_getParam('start');\n \t\t$limit = $this->_getParam('limit');\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_START_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_START\";\n\t \t\texit();\n \t\t}\n \t\tif(isEmptyString($start)){\n \t\t\techo \"RANGE_LIMIT_NULL\";\n\t \t\texit();\n \t\t}\n \t\tif(!is_numeric($limit)){\n \t\t\techo \"INVALID_RANGE_LIMIT\";\n\t \t\texit();\n \t\t}\n \t\t$limit_query = \" limit \".$start.\",\".$limit.\" \";\n \t}\n \t\n \t// if searching fuel\n \tif(!isEmptyString($this->_getParam('pricetype')) && $this->_getParam('pricetype') == 'fuel'){\n \t\t$type_query = \" AND cp.pricecategoryid = '4' \";\n \t}\n \t// action query\n \t\n \t$com_query = \"SELECT \".$select_query.\" FROM commodity c \n \tINNER JOIN commoditycategory cat ON c.categoryid = cat.id \n \tLEFT JOIN commodity p ON c.parentid = p.id LEFT JOIN \n \tcommoditypricecategory as cp ON (c.id = cp.commodityid) \n \tLEFT JOIN commodityunit as u ON(c.unitid = u.id) \n \tWHERE c.name <> '' \".$type_query.$where_query.\" \n \t\".$group_query.\" ORDER BY c.name ASC \".$limit_query;\n \t// debugMessage($com_query);\n \t\n \t$result = $conn->fetchAll($com_query);\n \t$comcount = count($result);\n \t// debugMessage($result); // exit();\n \t\n \tif($comcount == 0){\n \t\techo \"RESULT_NULL\";\n \t\texit();\n \t} else {\n \t\tif($iscount){\n \t\t\t$feed .= '<item>';\n\t \t\t$feed .= '<total>'.$result[0]['records'].'</total>';\n\t\t\t $feed .= '</item>';\n \t\t}\n \t\tif(!$iscount){\n\t \t\tforeach ($result as $line){\n\t \t\t\t$com = new Commodity();\n\t \t\t\t$com->populate($line['id']);\n\t \t\t\t$prices = $com->getCurrentAveragePrice();\n\t \t\t\t// debugMessage($prices);\n\t\t\t \t$feed .= '<item>';\n\t\t \t\t$feed .= '<id>'.$line['id'].'</id>';\n\t\t \t\t$feed .= '<name>'.$line['Commodity'].'</name>';\n\t\t\t \t$feed .= '<cat>'.$line['Category'].'</cat>';\n\t\t\t \t$feed .= '<unit>'.$line['Unit'].'</unit>';\n\t\t\t \t$feed .= '<avg_wholesaleprice>'.$prices['wp'].'</avg_wholesaleprice>';\n\t\t\t \t$feed .= '<avg_retailprice>'.$prices['rp'].'</avg_retailprice>';\n\t\t\t \t$feed .= '<pricedate>'.$prices['datecollected'].'</pricedate>';\n\t\t\t\t $feed .= '</item>';\n\t\t \t}\n \t\t}\n \t}\n \t\n \t# output the xml returned\n \tif(isEmptyString($feed)){\n \t\techo \"EXCEPTION_ERROR\";\n \t\texit();\n \t} else {\n \t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t}\n }", "public function getCategoryVouchers(Request $request){\n $language = ($request->header(\"X-Language\")) ?? 'en';\n\n $category = Category::find($request->category_id);\n if( !$category ){\n return $this->errorResponse(trans('messages.category.notfound'),null,404);\n }\n \n $city = City::find($request->city_id);\n\n if( !$city ){\n return $this->errorResponse(trans('messages.city.notfound'),null,404);\n }\n // it is a client ask to search with city only or city and region\n if( !$request->region_id ){\n $city = City::where('id',$request->city_id)->first();\n $stores = $city->stores()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang( $language, $stores, false);\n $stores = $stores->map(function ($item) use($language) {\n $vouchers = $item->vouchers;\n $vouchers = $this->toLang( $language, $vouchers, false);\n return $item;\n\n });\n return $this->dataResponse($stores,null,200);\n\n }\n\n $region = Region::where('id',$request->region_id)->where('city_id',$request->city_id)->first();\n if( !$region ){\n return $this->errorResponse(trans('messages.region.notfound'),null,404);\n }\n $branches = Branch::where('region_id',$request->region_id)->get();\n\n $storeResult = [];\n foreach( $branches as $key => $branch ){\n $stores = $branch->store()->where('category_id',$request->category_id)\n ->where('discount', '=' , '0')\n ->get();\n $stores = $this->toLang($language,$stores,false);\n foreach ($stores as $singleStore) {\n\n $vouchers = $singleStore->vouchers;\n $vouchers = $this->toLang($language,$vouchers,false);\n $storeResult[$key] = $singleStore;\n\n }\n }\n // To ensure that no repeated stores and return these only values in array\n $uiquedStores = array_values(array_unique($storeResult));\n \n return $this->dataResponse($uiquedStores,null,200);\n }", "public function getCategories(){\n return Category::get();\n }", "function get_categories_by_channel()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('channel_id'), array(\n\t\t\t'select' => array(),\n\t\t\t'where' => array(),\n\t\t\t'order_by' => 'cat_order',\n\t\t\t'sort' => 'asc',\n\t\t\t'limit' => FALSE,\n\t\t\t'offset' => 0\n\t\t));\n\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_channel_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_channel_categories($vars['channel_id'], $vars['select'], $vars['where'], $vars['order_by'], $vars['sort'], $vars['limit'], $vars['offset'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_channel_end', $data);\n\n\t\t$this->response($data);\n\t}", "function emic_cwrc_get_authorities($dataType, $query = \"\") {\n $mappings = array(\n 'Tag Place' => array('collection' => 'islandora:9247', 'type' => t('Place')),\n 'Tag Person' => array('collection' => 'islandora:9239', 'type' => t('Person')),\n 'Tag Event' => array('collection' => 'islandora:9242', 'type' => t('Event')),\n 'Tag Organization' => array('collection' => 'islandora:9236', 'type' => t('Organization')),\n );\n\n\n\n $authorities = cwrc_get_authorities_list($mappings[$dataType], $query);\n if ($authorities) {\n $json = json_encode($authorities);\n echo $json;\n }\n}", "public static function get_categories($filter) {\n\t\t$query = DB::table(self::$table.' AS t1')\n\t\t\t->leftjoin('tbl_user AS t2', 't1.user_id', '=', 't2.id')\n\t\t\t->select('t1.*', 't2.name AS user_name')\n\t\t\t->orderBy('t1.created_at', 'DESC');\n\t\tif (isset($filter) && !blank($filter)) {\n\t\t\t$query = self::conditions_for_category($filter, $query);\n\t\t}\n\n\t\t$categories = parent::paginate($filter, $query);\n\t\treturn $categories;\n\t}", "function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }", "public function company()\n {\n return $this->author()->company();\n }", "private function GetCategoriesByType($outlet_id,$type){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\t$where = array(\n\t\t\t\t'category_business_admin_id' => $this->session->userdata['logged_in']['business_admin_id'],\n\t\t\t\t'category_type' => $type,\n\t\t\t\t'category_is_active' => TRUE,\n\t\t\t\t'category_business_outlet_id'=> $outlet_id\n\t\t\t);\n\t\n\t\t\t$data = $this->BusinessAdminModel->MultiWhereSelect('mss_categories',$where);\n\t\t\tif($data['success'] == 'true'){\t\n\t\t\t\treturn $data['res_arr'];\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\t\t\n\t}", "public function allCompanies()\n {\n return Company::all();\n }", "public function getCategory()\n {\n \t$cat = Category::with('child')->get();\n return response()->json( [ 'cat' => $cat ] );\n }", "public function findCategoryBy(array $criteria);", "public static function contractables()\n {\n return Nova::authorizedResources(app('request'))->filter(function($resource) { \n return collect(class_implements($resource::newModel()))->contains(Contracts\\Contractable::class); \n })->values();\n }", "public function getCategory($name);", "public function get_customers_for_dropdown($company){\r\n\t\theader(\"Access-Control-Allow-Origin: \". base_url());\r\n\t\terror_log(\"get_customers_for_dropdown($company)\");\r\n\r\n\t\t$cid = intval($company);\r\n\t\tif($cid>0){\r\n\t\t\t$cs = $this->customer_model->get_companys_customers($cid);\r\n\t\t}\r\n\t\telse if($cid == 0){\r\n\t\t\t$cs = $this->customer_model->get_customers();\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo \"0\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = array();\r\n\t\tforeach($cs as $c){\r\n\t\t\t$id = $c[\"id\"];\r\n\t\t\t$name = $c[\"namn\"];\r\n\t\t\t$data[] = array($id => $name);\r\n\t\t}\r\n\t\terror_log(print_r($data, true));\r\n\t\techo json_encode($data);\r\n\t}", "private function __getCats() {\n\n\t\t$rootcatID = Mage::app()->getStore()->getRootCategoryId();\n\n\t\t$categories = Mage::getModel('catalog/category')\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t\t\t\t->addIsActiveFilter();\n $data = array();\n foreach ($categories as $attribute) {\n\t\t\t$data[] = array(\n\t\t\t\t'value' => $attribute->getId(),\n\t\t\t\t'label' => $attribute->getName()\n\t\t\t);\n }\n return $data;\n }", "public function getOccupations()\n {\n return $this->hasMany(TaskCategory::className(), ['id' => 'occupation_id'])->viaTable('contractor_occupation', ['contractor_id' => 'id']);\n }", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "function get_oers_list($DB, $oer_category_id){\n //OERs in Nantes caracterised by 'categoryid=916'\n //Returned modules organized by course\n $all_oers_resources=new stdClass();\n //Multiple choices desired\n $all_mdl_courses= $DB->get_records_list('course', 'category', $oer_category_id);\n foreach ($all_mdl_courses as $key => $value) {\n\n $courseid=$value->id;\n $course_oers= get_course_oers($value->id, $DB, $oer_category_id);\n\n if( count( (array)$course_oers->course_modules) != 0 ){\n $all_oers_resources->$courseid = get_course_oers($value->id, $DB, $oer_category_id);\n }\n\n\n }\n\n return $all_oers_resources;\n\n }", "public function getComplaintCat($UserType){\n \t$response = array();\n \t$where=\"MJ_CSC_NO is NULL AND CC_NO = 1\";\n \t// Select record\n\t\t$this->db->order_by('CC_NAME', 'ASC'); \t\t\t\n\t\t$this->db->select('CC_NO, CC_NAME');\n\t\t$this->db->join('MJ_USER_COMP_TYPE_AUTH M','M.MJ_CC_NO=C.CC_NO');\n\t\t$this->db->from('COMPLAINT_CATEGORY C');\n\t\t$this->db->where(['M.MJ_CC_USER_TYPE'=>$UserType]);\n\t\t$this->db->where($where);\n\t\t$q = $this->db->get();\n\t\t$CTList[0] = 'Select Complaint Type'; \t\n \tforeach($q->result() as $ComplaintType) \n \t$CTList[$ComplaintType->CC_NO] = $ComplaintType->CC_NAME; \n \treturn $CTList;\n \t}", "public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }", "function get_companies_linked_to_group_of_company() {\n\tglobal $post;\n\t/**\n\t * Check if there are companies linked to the post:\n\t */\n\tif (get_post_meta($post->ID, 'company_checkbox_meta', true)) {\n\t\t/**\n\t\t * Arguments for get posts:\n\t\t */\n\t\t$args = array(\n\t\t\t'orderby'\t\t =>\t'title',\n\t\t\t'order'\t\t\t =>\t'ASC',\n\t\t\t'post_type' => 'companies',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\t\t$companies = get_posts($args);\n\t\t$linked_companies_ids = get_post_meta($post->ID, 'company_checkbox_meta', true);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Go through all the posts:\n\t\t\t */\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t/**\n\t\t\t\t * Go through all the linked id's\n\t\t\t\t */\n\t\t\t\tforeach ($linked_companies_ids as $linked_company_id) {\n\t\t\t\t\t/**\n\t\t\t\t\t * if linked company id == company id, then generate company card.\n\t\t\t\t\t */\n\t\t\t\t\tif ($linked_company_id == $company->ID) {\n\t\t\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"item-card-title white-bg\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\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</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// do nothing.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\t/**\n\t * If there are no linked companies\n\t */\n\telse {\n\t\t// do nothing.\n\t}\n}", "public function getCategories(){\n $sql = \"SELECT DISTINCT cat.id, cat.name, cat.idnumber FROM {$this->table_prefix}course_categories cat\n INNER JOIN {$this->table_prefix}course c ON cat.id = c.category\";\n $result = $this->conn->query($sql);\n $categories;\n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n $categories[] = $row;\n }\n return array(\"erro\" => false, \"description\" => \"Categories found\", \"categories\" => $categories);\n }else{\n return array(\"erro\" => false, \"description\" => \"No categories with course found\", \"categories\" => $categories);\n }\n }", "public function getCategories() : array;", "public function cargarcategoria()\n {\n \treturn Cont_Categoria::whereRaw(\" jerarquia ~ '*{1}' \")\n \t\t\t\t\t\t\t->orderBy('jerarquia', 'asc')\n \t\t\t\t\t\t\t->get();\n \t;\t\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function cgetAction(Request $request) {\n $repository = $this->getDoctrine()->getRepository(Category::class);\n $categories = $repository->findAll();\n\n return $categories;\n }", "public function getAvailableTournamentsByCategory(Request $request)\n {\n $data = $this->service->getAvailableTournamentsByCategory($request['id']);\n return $data;\n }", "public function create()\n {\n $categories = ContractorCategory::get();\n return view(\"admin.contractors.create\", compact(\"categories\"));\n }", "public function getBorrowings();", "public function index()\n {\n //\n return Category::with('brands')->get();\n }", "protected function fetchCategory()\n {\n return $this->fetch([\n 'model' => Category::class,\n 'query' => function ($model) {\n return $model->orderBy('name', 'ASC');\n },\n ]);\n }", "public function getCategories()\n {\n return Category::all();\n }", "function get_internships_by_company($id) {\n return get_view_data_where('internships', $id);\n}", "public static function getCatergories()\n {\n $catergories = Catergory::all();\n return $catergories;\n }", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function getByCategory($category){\r\n $this->db->query(\"SELECT jobs.*, categories.name AS cname FROM jobs INNER JOIN categories ON jobs.category_id = categories.id WHERE jobs.category_id = $category ORDER BY post_date DESC\");\r\n\r\n $results = $this->db->resultSet();\r\n\r\n return $results;\r\n }", "public function index()\n {\n $data = $this->categoryService->getCate();\n return $data;\n }", "function get_contacts_by_category($employeeID) {\r\n $db = Database::getDB();\r\n $query = 'SELECT * FROM contact\r\n WHERE contact.employeeID = :employeeID\r\n ORDER BY contactID';\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':employeeID', $employeeID);\r\n $statement->execute();\r\n $contact = $statement->fetchAll();\r\n $statement->closeCursor();\r\n return $contact;\r\n}", "public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}" ]
[ "0.6516423", "0.60534227", "0.5959141", "0.5891746", "0.58585215", "0.57167983", "0.57167983", "0.57001567", "0.5670047", "0.56605744", "0.56597155", "0.56583565", "0.5618464", "0.5611199", "0.56075513", "0.56075513", "0.5588957", "0.5544424", "0.5530724", "0.5516832", "0.55033505", "0.5500492", "0.54837704", "0.5479459", "0.54351777", "0.54207456", "0.5406496", "0.53904825", "0.53779435", "0.5342989", "0.5328638", "0.5317378", "0.5302588", "0.530118", "0.5300672", "0.5292039", "0.52880615", "0.5285037", "0.5284387", "0.52836674", "0.52705914", "0.5250196", "0.52486885", "0.5247961", "0.524718", "0.5246034", "0.52456915", "0.52413565", "0.5207269", "0.520667", "0.52038044", "0.51940703", "0.5192067", "0.51799935", "0.51799935", "0.51695883", "0.5162461", "0.5158553", "0.51544356", "0.51527137", "0.51520085", "0.5147073", "0.51423764", "0.51313186", "0.51312315", "0.51277393", "0.51207334", "0.5120468", "0.5115763", "0.51153576", "0.5106159", "0.5105551", "0.51005864", "0.5095934", "0.50858474", "0.50763243", "0.50761473", "0.5071671", "0.5066762", "0.5064981", "0.506469", "0.50614893", "0.5057459", "0.505116", "0.5047888", "0.5047208", "0.504673", "0.50465745", "0.5044905", "0.5043853", "0.5039808", "0.50387114", "0.50303596", "0.5027225", "0.50264716", "0.502546", "0.50246286", "0.50244695", "0.5024172", "0.5022449" ]
0.50486904
84
calculate distance between two places
public function distance($lat1, $lng1, $lat2, $lng2, $miles = true) { $pi80 = M_PI / 180; $lat1 *= $pi80; $lng1 *= $pi80; $lat2 *= $pi80; $lng2 *= $pi80; $r = 6372.797; // mean radius of Earth in km $dlat = $lat2 - $lat1; $dlng = $lng2 - $lng1; $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2); $c = 2 * atan2(sqrt($a), sqrt(1 - $a)); $km = $r * $c; return ($miles ? ($km * 0.621371192) : $km); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateDistance($first, $second)\r\n{\r\n return abs($first - $second);\r\n}", "function distance($lat1,$lon1,$lat2,$lon2){\n $delta_lat = $lat2-$lat1;\n $delta_lon = $lon2-$lon1;\n return (($delta_lat * $delta_lat) + ($delta_lon * $delta_lon));\n}", "public function calculateDistanceBetween(string $address1, string $address2)\n {\n }", "function getDistance($coord1,$coord2) {\r\n\t$x=($coord1['x']-$coord2['x'])*($coord1['x']-$coord2['x']);\r\n\t$y=($coord1['y']-$coord2['y'])*($coord1['y']-$coord2['y']);\r\n\treturn sqrt($x+$y);\r\n}", "function distance($v1, $v2)\r\n{\r\n return sqrt(pow(($v1[0]-$v2[0]),2)+pow(($v1[1]-$v2[1]),2));//計算座標2點的距離\r\n}", "public function getDistance();", "function distance($lat1, $lon1, $lat2, $lon2)\n{\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n } else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist) * 60 * 1.853159616;\n return $dist;\n }\n}", "function distance_calculator($lat1 = 0, $lng1 = 0, $lat2 = 0, $lng2 = 0, $miles = FALSE) {\n\t$latDegr1 = $lat1 / 180 * pi();\n\t$lngDegr1 = $lng1 / 180 * pi();\n\t\t\n\t$latDegr2 = $lat2 / 180 * pi();\n\t$lngDegr2 = $lng2 / 180 * pi();\n\t\t\n\t$e = acos( sin( $latDegr1 ) * sin( $latDegr2 ) + cos( $latDegr1 ) * cos( $latDegr2 ) * cos( $lngDegr2 - $lngDegr1 ) );\n\tif( $miles ) return round( $e * 3963.191, 2);\n\telse return round( $e * 6378.137, 2 );\n}", "function distance($lat_1, $lon_1, $lat_2, $lon_2) {\n\n $radius_earth = 6371; // Радиус Земли\n\n $lat_1 = deg2rad($lat_1);\n $lon_1 = deg2rad($lon_1);\n $lat_2 = deg2rad($lat_2);\n $lon_2 = deg2rad($lon_2);\n\n $d = 2 * $radius_earth * asin(sqrt(sin(($lat_2 - $lat_1) / 2) ** 2 + cos($lat_1) * cos($lat_2) * sin(($lon_2 - $lon_1) / 2) ** 2));\n//\n return number_format($d, 2, '.', '');\n}", "function dist(float $lat1, float $lon1, float $lat2, float $lon2): float\n{\n $R = 6371e3; // earth radius, metres\n\n // convert degrees to radians\n $lat1 = ($lat1 / 180) * M_PI;\n $lat2 = ($lat2 / 180) * M_PI;\n $lon1 = ($lon1 / 180) * M_PI;\n $lon2 = ($lon2 / 180) * M_PI;\n // caclulate differences between latitude and longitude\n $dlat = $lat2 - $lat1;\n $dlon = $lon2 - $lon1;\n\n // Haversine distance formula\n $a = sin($dlat / 2) * sin($dlat / 2)\n + cos($lat1) * cos($lat2)\n * sin($dlon / 2) * sin($dlon / 2);\n\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n return $R * $c;\n}", "function distance($latlon1, $latlon2) {\n\t$angle = acos(sin(deg2rad($latlon1[0])) * sin(deg2rad($latlon2[0])) + cos(deg2rad($latlon1[0])) * cos(deg2rad($latlon2[0])) * cos(deg2rad($latlon1[1] - $latlon2[1])));\n\t$earthradius_km = 6372.8;\n\treturn $earthradius_km * $angle;\n}", "public function calculateDistance()\n {\n echo 'distance is 3km.',\"\\n\";\n }", "function distance($lat1, $lon1, $lat2, $lon2)\r\n {\r\n if ($lat1 == $lat2 && $lon1 == $lon2) return 0;\r\n $unit = 'M'; // miles please!\r\n $theta = $lon1 - $lon2;\r\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n $dist = acos($dist);\r\n $dist = rad2deg($dist);\r\n $miles = $dist * 60 * 1.1515;\r\n $unit = strtoupper($unit);\r\n\r\n if ($unit == \"K\") {\r\n return ($miles * 1.609344);\r\n } else if ($unit == \"N\") {\r\n return ($miles * 0.8684);\r\n } else {\r\n return $miles;\r\n }\r\n }", "function distanceCalculation($point1_lat, $point1_long, $point2_lat, $point2_long, $unit = 'km' ,$decimals = 2){\n\n $degrees = rad2deg(acos((sin(deg2rad($point1_lat))*sin(deg2rad($point2_lat))) + (cos(deg2rad($point1_lat))*cos(deg2rad($point2_lat))*cos(deg2rad($point1_long-$point2_long)))));\n\n switch($unit){\n \n case 'km':\n $distance = $degrees * 111.13384;\n break;\n\n case 'mi':\n $distance = $degrees * 69.05482;\n break;\n\n case 'nmi':\n $distance = $degrees * 59.97662;\n\n }\n\n //echo \"la distancia entre lat: \".$point1_lat.\" long: \".$point1_long. \" y lat2: \".$point2_lat.\" long: \".$point2_long.\"es de \". round($distance,$decimals) . \"\\n\";\n\n return round($distance, $decimals);\n\n\n}", "function getDistance($lat1, $lon1, $lat2, $lon2) {\n if(!$lat1 || !$lat2 || !$lon1 || !$lon2){\n return NULL;\n }\n\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n }\n else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n\n return ($miles * 1.609344);\n }\n }", "function calcDist($lat_A, $long_A, $lat_B, $long_B)\r\n{\r\n\r\n $distance = sin(deg2rad($lat_A))\r\n * sin(deg2rad($lat_B))\r\n + cos(deg2rad($lat_A))\r\n * cos(deg2rad($lat_B))\r\n * cos(deg2rad($long_A - $long_B));\r\n\r\n $distance = (rad2deg(acos($distance))) * 69.09;\r\n\r\n return $distance;\r\n}", "function distance($point1, $point2) {\n\t\t$lat1 = $point1[0];\n\t\t$long1 = $point1[1];\n\n\t\t$lat2 = $point2[0];\n\t\t$long2 = $point2[1];\n\n\t\t$deltaLat = $this -> toRadians($lat2 - $lat1);\n\t\t$deltaLon = $this -> toRadians($long2 - $long1);\n\n\t\t$a = sin($deltaLat / 2) * sin($deltaLat / 2) + cos($this -> toRadians($lat1)) * cos($this -> toRadians($lat2)) * sin($deltaLon / 2) * sin($deltaLon / 2);\n\n\t\t$c = 2 * asin(sqrt($a));\n\n\t\treturn $this -> EARTH_RADIUS * $c;\n\t}", "static public function distance($lat1, $lon1, $lat2, $lon2) {\n\t\t$rad1 = deg2rad($lat1);\n\t\t$rad2 = deg2rad($lat2);\n\t\t$dist = sin($rad1) * sin($rad2) + cos($rad1) * cos($rad2) * cos(deg2rad($lon1 - $lon2)); \n\t\t$dist = acos($dist); \n\t\t$dist = rad2deg($dist); \n\t\t$miles = $dist * 60 * 1.1515;\n\n\t\tif (is_nan($miles))\n\t\t\treturn 0;\n\t\n\t\treturn ($miles * 1.609344);\n\t}", "public function distance($other_loc) {\r\n if ($this->city == false || $other_loc->city == false) {\r\n return false;\r\n }\r\n $origin = ($this->address ? str_replace(' ', '+', $this->address) : '') . '+' . $this->city . '+' . $this->state;\r\n $destination = ($other_loc->address ? str_replace(' ', '+', $other_loc->address) : '') . '+' . $other_loc->city . '+' . $other_loc->state;\r\n $url = \"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=$origin&destinations=$destination&key={$GLOBALS['google_maps_key']}\";\r\n $curl_handle = curl_init();\r\n curl_setopt( $curl_handle, CURLOPT_URL, $url );\r\n curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );\r\n $distance_info = json_decode(curl_exec( $curl_handle ), true);\r\n curl_close( $curl_handle );\r\n if (!isset($distance_info['rows'][0]['elements'][0]['distance'])) {\r\n return false;\r\n }\r\n return [\r\n 'time' => $distance_info['rows'][0]['elements'][0]['duration'],\r\n 'length' => $distance_info['rows'][0]['elements'][0]['distance']\r\n ];\r\n }", "function compare_distance($a, $b) {\n return $a['distance'] - $b['distance'];\n }", "function calcDist( $lat, $long, $lat2, $long2){\n $lat_rad = floatval($lat) * pi() / 180;\n $long_rad = floatval($long) *pi() / 180;\n $lat_rad2 = $lat2 * pi() / 180;\n $long_rad2 = $long2 *pi() / 180;\n\n $distance = (ACOS(COS($lat_rad) * COS($long_rad) * COS($lat_rad2) * COS($long_rad2) + COS($lat_rad) * SIN($long_rad) * COS($lat_rad2) * SIN($long_rad2) + SIN($lat_rad) * SIN($lat_rad2)) * 6371) * 1.15;\n $distance = round($distance,2);\n return $distance;\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit)\n{\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return round(0, 2);\n } else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return round(($miles * 1.609344), 2);\n } else if ($unit == \"N\") {\n return round(($miles * 0.8684), 2);\n } else {\n return round($miles, 2);\n }\n }\n}", "function distance($lat1, $lon1, $lat2, $lon2, $unit = \"M\") {\n\n\t\t$theta = $lon1 - $lon2;\n\t\t$dist = acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)));\n\t\t$dist = rad2deg($dist);\n\t\t$dist = $dist * 60 * 1.1515;\n\t\t$unit = strtoupper($unit);\n\t\n\t\tif ($unit == \"K\") {\n\t\t\t$dist = $dist * 1.609344;\n\t\t} else if ($unit == \"N\") {\n\t\t\t$dist = $dist * 0.8684;\n\t\t}\n\t\treturn round($dist,1);\n\t}", "public function getWalkingDistance($lat1, $lng1, $lat2, $lng2){\n $start = \"\" . $lat1 . \",\" . $lng1;\n \n //Our end point / destination. Change this if you wish.\n $destination = \"\" . $lat2 . \",\" . $lng2;\n \n //The Google Directions API URL. Do not change this.\n $apiUrl = 'https://maps.googleapis.com/maps/api/directions/json';\n \n //Construct the URL that we will visit with cURL.\n $url = $apiUrl . '?key=AIzaSyBx7STG0PaXcrFVDiDqGsnr1AmMZcvf110&mode=walking' . '&origin=' . urlencode($start) . '&destination=' . urlencode($destination);\n \n //Initiate cURL.\n $curl = curl_init($url);\n \n //Tell cURL that we want to return the data.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n //Execute the request.\n $res = curl_exec($curl);\n \n //If something went wrong with the request.\n if(curl_errno($curl)){\n throw new Exception(curl_error($curl));\n }\n \n //Close the cURL handle.\n curl_close($curl);\n \n //Decode the JSON data we received.\n $json = json_decode(trim($res), true);\n \n\n //Automatically select the first route that Google gave us.\n $route = $json['routes'][0];\n \n //Loop through the \"legs\" in our route and add up the distances.\n $totalDistance = 0;\n $totlaDuration = 0;\n\n foreach($route['legs'] as $leg){\n $totalDistance += $leg['distance']['value'];\n $totlaDuration +=$leg['duration']['value'];\n }\n \n //Divide by 1000 to get the distance in KM.\n $totalDistance = $totalDistance / 1000;\n \n //Print out the result.\n return [\n \"distance\" => $totalDistance,\n \"duration\" => $totlaDuration,\n \"routes\" => $json['routes']\n ];\n }", "public function calculateDistance(Point $from, Point $to): float;", "function distance($lat1, $lng1, $lat2, $lng2, $miles = true)\n{\n\t$pi80 = M_PI / 180;\n\t$lat1 *= $pi80;\n\t$lng1 *= $pi80;\n\t$lat2 *= $pi80;\n\t$lng2 *= $pi80;\n\n\t$r = 6372.797; // mean radius of Earth in km\n\t$dlat = $lat2 - $lat1;\n\t$dlng = $lng2 - $lng1;\n\t$a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t$c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t$km = $r * $c;\n\n\treturn ($miles ? ($km * 0.621371192) : $km);\n}", "function get_distance_from_lat_long($lat1, $lon1, $lat2, $lon2) \n{\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $distance_in_miles = $dist * 60 * 1.1515;\n $distance_in_Km = $distance_in_miles * 1.609344;\n\n return $distance_in_miles;\n}", "function distanceBetweenTowPlaces($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo)\n{\n $long1 = deg2rad($longitudeFrom);\n $long2 = deg2rad($longitudeTo);\n $lat1 = deg2rad($latitudeFrom);\n $lat2 = deg2rad($latitudeTo);\n //Haversine Formula\n $dlong = $long2 - $long1;\n $dlati = $lat2 - $lat1;\n $val = pow(sin($dlati / 2), 2) + cos($lat1) * cos($lat2) * pow(sin($dlong / 2), 2);\n $res = 2 * asin(sqrt($val));\n $radius = 6367.756;\n return ($res * $radius);\n}", "public function getDistance(IPoint $point2): float;", "public static function distance ($x1, $y1, $x2, $y2)\n {\n return abs($x2 - $x1) + abs($y2 - $y1);\n }", "function Calculate($dblLat1, $dblLong1, $dblLat2, $dblLong2) {\n $EARTH_RADIUS_MILES = 3963;\n $dist = 0;\n //convert degrees to radians\n $dblLat1 = $dblLat1 * M_PI / 180;\n $dblLong1 = $dblLong1 * M_PI / 180;\n $dblLat2 = $dblLat2 * M_PI / 180;\n $dblLong2 = $dblLong2 * M_PI / 180;\n if ($dblLat1 != $dblLat2 || $dblLong1 != $dblLong2) {\n //the two points are not the same\n $dist = sin($dblLat1) * sin($dblLat2) + cos($dblLat1) * cos($dblLat2) * cos($dblLong2 - $dblLong1);\n $dist = $EARTH_RADIUS_MILES * (-1 * atan($dist / sqrt(1 - $dist * $dist)) + M_PI / 2);\n }\n return $dist;\n }", "private function distance($p0, $p1, $p2)\n\t{\n\t\tif ($p1[0] == $p2[0] && $p1[1] == $p2[1])\n\t\t{\n\t\t\t$out = sqrt(pow($p2[0] - $p0[0], 2) + pow($p2[1] - $p0[1], 2));\n\t\t} else\n\t\t{\n\t\t\t$u = (($p0[0] - $p1[0]) * ($p2[0] - $p1[0]) + ($p0[1] - $p1[1]) * ($p2[1] - $p1[1])) / (pow($p2[0] - $p1[0], 2) + pow($p2[1] - $p1[1], 2));\n\t\t\tif ($u <= 0)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p1[0], 2) + pow($p0[1] - $p1[1], 2));\n\t\t\t}\n\t\t\tif ($u >= 1)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p2[0], 2) + pow($p0[1] - $p2[1], 2));\n\t\t\t}\n\t\t\tif (0 < $u && $u < 1)\n\t\t\t{\n\t\t\t\t$out = sqrt(pow($p0[0] - $p1[0] - $u * ($p2[0] - $p1[0]), 2) + pow($p0[1] - $p1[1] - $u * ($p2[1] - $p1[1]), 2));\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public static function diffDistance($from, $to)\n\t{\n $distance = new Distance();\n $distance->setUnit('m');\n $distance->setFormula('haversine');\n return $dist = $distance->between($from['lat'],$from['long'], $to['lat'],$to['long']);\n\t}", "protected function calculateDistance($first, $second)\n {\n return \\levenshtein($first, $second);\n }", "function distance_slc($lat1, $lon1, $lat2, $lon2) {\n\t\t$earth_radius = 3960.00; # in miles\n\t\t$delta_lat = $lat2 - $lat1 ;\n\t\t$delta_lon = $lon2 - $lon1 ;\n\t\t$distance = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($delta_lon)) ;\n\t\t$distance = acos($distance);\n\t\t$distance = rad2deg($distance);\n\t\t$distance = $distance * 60 * 1.1515;\n\t\t$distance = round($distance, 4);\n\t\n\t\treturn $distance;\n\t}", "public function distance($lat1, $long1, $lat2, $long2, $unit ){\n\n if (($lat1 == $lat2) && ($long1 == $long2)) {\n \n return 0;\n }else{\n $theta = $long1 - $long2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + \n cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return round(($miles * 1.609344));\n }elseif ($unit == \"N\") {\n return round(($miles * 0.8684));\n }else{\n return $miles;\n }\n }\n }", "function DistanceBetweenLocation($location1, $location2){\n\t\t $dis = \"SELECT * FROM distance_info WHERE (location1 = '\".$location1.\"' AND location2 = '\".$location2.\"') OR (location1 = '\".$location2.\"' AND (location2 = '\".$location1.\"' )\";\n\t\tforeach($bdd -> query($dis) as $row){\n\t\t\t$distance = $row['distance'];\n\t\t\treturn $distance;\n\t\t}\n\t\t\n\t}", "public function getRoughPairDistance($lat1,$lon1,$lat2,$lon2){\n //It spits out a back-of-napkin distance between two points.\n //Precision is somewhat limited, but ok for our purpose. See disclaimer above. \n $latdistance = abs($lat1 - $lat2)/$this->latmile;\n $londistance = abs($lon1 - $lon2)/$this->lonmile;\n $distance = sqrt(pow($latdistance,2)+pow($londistance,2));\n return($distance);\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\r\n\r\n\t$theta = $lon1 - $lon2;\r\n\t$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n\t$dist = acos($dist);\r\n\t$dist = rad2deg($dist);\r\n\t$miles = $dist * 60 * 1.1515;\r\n\t$unit = strtoupper($unit);\r\n\r\n\tif ($unit == \"K\") {\r\n\t\treturn ($miles * 1.609344);\r\n\t} else if ($unit == \"N\") {\r\n\t\treturn ($miles * 0.8684);\r\n\t} else {\r\n\t\treturn $miles;\r\n\t}\r\n}", "function calculateDistance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n}", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function distanceCalculation($point1_lat, $point1_long, $point2_lat, $point2_long, $unit = 'km', $decimals = 2) {\n\t// Calculate the distance in degrees\n\t$degrees = rad2deg(acos((sin(deg2rad($point1_lat))*sin(deg2rad($point2_lat))) + (cos(deg2rad($point1_lat))*cos(deg2rad($point2_lat))*cos(deg2rad($point1_long-$point2_long)))));\n \n\t// Convert the distance in degrees to the chosen unit (kilometres, miles or nautical miles)\n\tswitch($unit) {\n\t\tcase 'km':\n\t\t\t$distance = $degrees * 111.13384; // 1 degree = 111.13384 km, based on the average diameter of the Earth (12,735 km)\n\t\t\tbreak;\n\t\tcase 'mi':\n\t\t\t$distance = $degrees * 69.05482; // 1 degree = 69.05482 miles, based on the average diameter of the Earth (7,913.1 miles)\n\t\t\tbreak;\n\t\tcase 'nmi':\n\t\t\t$distance = $degrees * 59.97662; // 1 degree = 59.97662 nautic miles, based on the average diameter of the Earth (6,876.3 nautical miles)\n\t}\n\treturn round($distance, $decimals);\n}", "protected function distance($a, $b)\n {\n list($lat1, $lon1) = $a;\n list($lat2, $lon2) = $b;\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n }", "public static function getDistanceBetweenPoints($latitude1, $longitude1, $latitude2, $longitude2, $unit = 'Mi') \n { \n $theta = $longitude1 - $longitude2; \n $distance = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta))); \n $distance = acos($distance); $distance = rad2deg($distance); $distance = $distance * 60 * 1.1515; \n switch($unit) \n { \n case 'Mi': \n break; \n case 'Km' : \n $distance = $distance * 1.609344; \n } \n return $distance; \n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n}", "function nodeDist($node1, $node2){\n $n1 = getNode($node1);\n $n2 = getNode($node2);\n return 3*distance($n1['lat'],$n1['lon'],$n2['lat'],$n2['lon']);\n}", "function getDistance2pts($coord1, $coord2){\n\t$r = 6366;\n\n\t$coord1[0] = deg2rad($coord1[0]);\n\t$coord1[1] = deg2rad($coord1[1]);\n\t$coord2[0] = deg2rad($coord2[0]);\n\t$coord2[1] = deg2rad($coord2[1]);\n\t\n\t$ds= acos(sin($coord1[0])*sin($coord2[0])+cos($coord1[0])*cos($coord2[0])*cos($coord1[1]-$coord2[1]));\n\t\n\t$dpr = $ds * $r;\n\t\n\treturn $dpr * 0.54;\t// return une distance en nm\t\n}", "private function distance($latA, $latB, $lngA, $lngB, $unit)\n\t{\n\t\t$theta = $lngA - $lngB;\n\t\t$dist = sin(deg2rad($latA)) * sin(deg2rad($latB)) + cos(deg2rad($latA)) * cos(deg2rad($latB)) * cos(deg2rad($theta));\n\t\t$dist = acos($dist);\n\t\t$dist = rad2deg($dist);\n\t\t$miles = $dist * 60 * 1.1515;\n\t\t$unit = strtoupper($unit);\n\n\n\n\t\t# We want to convert the result the unit we want to work with (K = KM)\n\t\t$result = 0;\n\t\tif ($unit == \"K\")\n\t\t{\n\t\t\t$result = ($miles * 1.609344);\n\t\t} \n\t\telse\n\t\t{\n\t\t\t$result = $miles;\n\t\t}\n\n\n\n\t\t# Finally we return our result\n\t\treturn $result;\n\t\t\n\n\t}", "function calculateDistance($aLon, $aLat, $bLon, $bLat, $unit = KILOMETERS)\n{\n $sinHalfDeltaLat = sin(deg2rad($bLat - $aLat) / 2.0);\n $sinHalfDeltaLon = sin(deg2rad($bLon - $aLon) / 2.0);\n $lonSqrd = $sinHalfDeltaLon * $sinHalfDeltaLon;\n $latSqrd = $sinHalfDeltaLat * $sinHalfDeltaLat;\n $angle = 2 * asin(\n sqrt($latSqrd + cos(deg2rad($aLat)) * cos(deg2rad($bLat)) * $lonSqrd)\n );\n return $unit * $angle;\n}", "public function testGetDistance()\n\t{\n\t\t$point1 = new Point(Point::WAYPOINT);\n\t\t$point1->latitude = 48.1573923225717;\n\t\t$point1->longitude = 17.0547121910204;\n\n\t\t$point2 = new Point(Point::WAYPOINT);\n\t\t$point2->latitude = 48.1644916381763;\n\t\t$point2->longitude = 17.0591753907502;\n\n\t\t$this->assertEqualsWithDelta(\n\t\t\t856.97,\n\t\t\tGeoHelper::getRawDistance($point1, $point2),\n\t\t\t1,\n \"Invalid distance between two points!\"\n\t\t);\n\t}", "public function compute_string_distance($string1, $string2)\n {\n }", "public function getDistanceBetweenTwoPoints($point1 , $point2){\n $earthRadius = 6371; // earth radius in km\n $point1Lat = $point1['latitude'];\n $point2Lat =$point2['latitude'];\n $deltaLat = deg2rad($point2Lat - $point1Lat);\n $point1Long =$point1['longitude'];\n $point2Long =$point2['longitude'];\n $deltaLong = deg2rad($point2Long - $point1Long);\n $a = sin($deltaLat/2) * sin($deltaLat/2) + cos(deg2rad($point1Lat)) * cos(deg2rad($point2Lat)) * sin($deltaLong/2) * sin($deltaLong/2);\n $c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\n $distance = $earthRadius * $c;\n return $distance; // in km\n }", "function Distance($lat1, $lon1, $lat2, $lon2, $unit) {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function distHaversine($coorA,$coorB)\n\t{\n\t\t\t$R = 6371;\n\t\t\n\t\t\t$coord_a = explode(\",\",$coorA);\n\t\t\t$coord_b = explode(\",\",$coorB);\n\t\t\t$dLat = ($coord_b[0] - $coord_a[0]) * M_PI / 180;\n\t\t\t$dLong = ($coord_b[1] - $coord_a[1]) * M_PI / 180;\n\t\t\t$a = sin($dLat/2) * sin($dLat/2) + cos((($coord_a[0])* M_PI / 180)) * cos((($coord_b[0])* M_PI / 180)) * sin($dLong/2) * sin($dLong/2);\n\t\t\t$c = 2 * atan2(sqrt($a), sqrt(1-$a));\n\t\t\t$d = $R * $c;\n\t\t $resp = (round($d, 2));\n\t\t\treturn $resp;\n\t\t\n # hasil akhir dalam satuan kilometer\n\t\t\n\t}", "public function distance($lat1, $lon1, $lat2, $lon2, $unit) {\n if (($lat1 == $lat2) && ($lon1 == $lon2)) {\n return 0;\n }\n else {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n } else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }\n }", "public static function getDistanceBetweenPlot($lat1, $lon1, $lat2, $lon2, $unit)\n {\n \t \n \t $units_params='';\n \t \n \t switch ($unit) {\n \t \tcase \"M\":\n \t \tcase \"Miles\":\n \t \t\t$units_params='imperial';\n \t \t\tbreak;\n \t \n \t \tdefault:\n \t \t\t$units_params='metric';\n \t \t\tbreak;\n \t }\n \t \n \t $method=getOptionA('google_distance_method');\n \t $use_curl=getOptionA('google_use_curl');\n \t \n \t $protocol = isset($_SERVER[\"https\"]) ? 'https' : 'http';\n \t $key=Yii::app()->functions->getOptionAdmin('google_geo_api_key');\n \t \n \t if ($method==\"driving\" || $method==\"transit\"){\n \t \t $url=\"https://maps.googleapis.com/maps/api/distancematrix/json\";\n \t \t $url.=\"?origins=\".urlencode(\"$lat1,$lon1\");\n \t \t $url.=\"&destinations=\".urlencode(\"$lat2,$lon2\");\n \t \t $url.=\"&mode=\".urlencode($method); \t \n \t \t $url.=\"&units=\".urlencode($units_params);\n \t \t if(!empty($key)){\n \t \t \t$url.=\"&key=\".urlencode($key);\n \t \t }\n \t \t \n \t \t if(isset($_GET['debug'])){\n \t \t dump($url);\n \t \t }\n \t \t \n \t \t if ($use_curl==2){\n \t \t \t$data = Yii::app()->functions->Curl($url);\n \t \t } else $data = @file_get_contents($url);\t\n \t \t $data = json_decode($data); \n \t \t //dump($data);\n \t \t if (is_object($data)){\n \t \t \tif ($data->status==\"OK\"){ \n \t \t \t\tif($data->rows[0]->elements[0]->status==\"ZERO_RESULTS\"){\n \t \t \t\t\treturn false;\n \t \t \t\t}\n \t \t \t\t$distance_value=$data->rows[0]->elements[0]->distance->text;\n \t \t \t\tif ($units_params==\"imperial\"){\n \t \t \t\t $distance_raw=str_replace(array(\" \",\"mi\",\"ft\"),\"\",$distance_value);\n \t \t \t\t if (preg_match(\"/ft/i\", $distance_value)) {\n \t \t \t\t \t self::$distance_type_result='ft';\n \t \t \t\t }\n \t \t \t\t} else {\n \t \t \t\t\t$distance_raw=str_replace(array(\" \",\"km\",\"m\",'mt'),\"\",$distance_value);\n \t \t \t\t\tif (preg_match(\"/m/i\", $distance_value)) {\n \t \t \t\t \t self::$distance_type_result='millimeter';\n \t \t \t\t }\n \t \t \t\t if (preg_match(\"/mt/i\", $distance_value)) {\n \t \t \t\t \t self::$distance_type_result='mt';\n \t \t \t\t }\n \t \t \t\t}\n \t \t \t\treturn $distance_raw;\n \t \t \t}\t\n \t \t }\n \t \t return false;\n \t }\n \t \n \t if (empty($lat1)){ return false; }\n \t if (empty($lon1)){ return false; }\n \t \n \t $theta = $lon1 - $lon2;\n\t\t $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n\t\t $dist = acos($dist);\n\t\t $dist = rad2deg($dist);\n\t\t $miles = $dist * 60 * 1.1515;\n\t\t $unit = strtoupper($unit);\n\t\t\n\t\t if ($unit == \"K\") {\n\t\t return ($miles * 1.609344);\n\t\t } else if ($unit == \"N\") {\n\t\t return ($miles * 0.8684);\n\t\t } else {\n\t\t return $miles;\n\t\t }\n }", "private function _calculatePointDistance($lat1, $lon1, $lat2, $lon2, $unit) {\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == \"K\") {\n return ($miles * 1.609344);\n }\n else if ($unit == \"M\") {\n return $this->_ceiling(($miles * 1.609344 * 1000), 50);\n }else if ($unit == \"N\") {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }", "function distance(\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000)\n{\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius;\n}", "function getDistance() {\n\t\treturn $this->dist2loc;\n\t}", "private static function getDistanceBetweenPointsNew(float $latitude1, float $longitude1, float $latitude2, float $longitude2, string $unit = 'miles') : float\n {\n $theta = floatval($longitude1) - floatval($longitude2);\n $distance = (sin(deg2rad(floatval($latitude1))) * sin(deg2rad(floatval($latitude2)))) + (cos(deg2rad(floatval($latitude1))) * cos(deg2rad(floatval($latitude2))) * cos(deg2rad($theta)));\n $distance = acos($distance);\n $distance = rad2deg($distance);\n $distance = $distance * 60 * 1.1515;\n\n if ($unit == 'kilometers') {\n $distance = $distance * 1.609344;\n }\n\n return round($distance, 2);\n }", "public static function getDistance(float $lat1, float $lon1, float $lat2, float $lon2) : float {\n\t\t// The same?\n\t\tif (($lat1 === $lat2) && ($lon1 === $lon2)) {\n\t\t\treturn 0.0;\n\t\t}\n\n\t\t$theta = $lon1 - $lon2;\n\t\t$distance = \\sin(\\deg2rad($lat1)) * \\sin(\\deg2rad($lat2)) + \\cos(\\deg2rad($lat1)) * \\cos(\\deg2rad($lat2)) * \\cos(\\deg2rad($theta));\n\t\t$distance = \\acos($distance);\n\t\treturn $distance * 60 * 1.1515;\n\t}", "private function calculate_distance() {\n // Only delivery stores a distance. For everything else, set as 0\n if ($this->type == 'delivery') {\n $geocode = file_get_contents('https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=' . $this->BuyerAccount->Address->latitude . ',' . $this->BuyerAccount->Address->longitude . '&destinations=' . $this->Seller->latitude . ',' . $this->Seller->longitude . '&key=' . GOOGLE_MAPS_KEY);\n $output = json_decode($geocode);\n $distance = explode(' ', $output->rows[0]->elements[0]->distance->text);\n \n $distance = round((($distance[1] == 'ft') ? $distance[0] / 5280 : $distance[0]), 4);\n } else {\n $distance = 0;\n }\n\n $this->update([\n 'distance' => $distance\n ]);\n\n $this->distance = $distance;\n }", "function mathGeoDistance( $lat1, $lng1, $lat2, $lng2, $miles = false )\n\t{\n\t $pi80 = M_PI / 180;\n\t $lat1 *= $pi80;\n\t $lng1 *= $pi80;\n\t $lat2 *= $pi80;\n\t $lng2 *= $pi80;\n\n\t $r = 6372.797; // mean radius of Earth in km\n\t $dlat = $lat2 - $lat1;\n\t $dlng = $lng2 - $lng1;\n\t $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t $km = $r * $c;\n\n\t return ($miles ? ($km * 0.621371192) : $km);\n\t}", "function postcode_dist($postcode1, $postcode2, $suburb1 = '', $suburb2 = '') {\n//Get lat and lon for postcode 1\n $extra = \"\";\n if ($suburb1 != '') {\n $extra = \" and suburb = '$suburb1'\";\n }\n $sqlquery = \"SELECT * FROM postcode_db WHERE lat <> 0 and lon <> 0 and postcode = '$postcode1'$extra\";\n $res = mysqli_query($sqlquery);\n $num = mysqli_num_rows($res);\n\n\n//Get lat and lon for postcode 2\n\n $extra = \"\";\n if ($suburb2 != '') {\n $extra = \" and suburb = '$suburb2'\";\n }\n $sqlquery = \"SELECT * FROM postcode_db WHERE lat <> 0 and lon <> 0 and postcode = '$postcode2'$extra\";\n $res1 = mysqli_query($sqlquery);\n $num1 = mysqli_num_rows($res1);\n\n if ($num != 0 && $num1 != 0) {\n//proceed\n $lat1 = mysql_result($res, 0, \"lat\");\n $lon1 = mysql_result($res, 0, \"lon\");\n $lat2 = mysql_result($res1, 0, \"lat\");\n $lon2 = mysql_result($res1, 0, \"lon\");\n $dist = calc_dist($lat1, $lon1, $lat2, $lon2);\n if (is_numeric($dist)) {\n return $dist;\n } else {\n return \"Unknown\";\n }\n } else {\n return \"Unknown\";\n }\n}", "protected function calculateDistance($lat1, $lng1, $lat2, $lng2){\n $theta = $lng1-$lng2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +\n cos(deg2rad($lat1)) * cos(deg2rad($lat2)) *\n cos(deg2rad($theta));\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n return $miles;\n }", "protected function calculateDistance($point_a, $point_b)\n {\n $distance = 0;\n for ($i = 0, $count = count($point_a); $i < $count; $i++) {\n $difference = $point_a[$i] - $point_b[$i];\n $distance += pow($difference, 2);\n }\n return $distance;\n }", "public function calculateDistance(Point $a, Point $b)\n\t{\n\t\t$R = 6371; // km\n\t\t$dLat = deg2rad(abs($b->getLatitude() - $a->getLatitude()));\n\t\t$dLon = deg2rad(abs($b->getLongitude() - $a->getLongitude()));\n\t\t$lat1 = deg2rad($a->getLatitude());\n\t\t$lat2 = deg2rad($b->getLatitude());\n\n\t\t$a = sin($dLat / 2) * sin($dLat / 2)\n\t\t\t+ sin($dLon / 2) * sin($dLon / 2) * cos($lat1) * cos($lat2);\n\t\t$c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\n\t\treturn $R * $c;\n\t}", "public static function geoDistance (Application\\Model\\Waypoint_Coordinate $c1, Application\\Model\\Waypoint_Coordinate $c2, $unit=\"s\")\n {\n $theta = $c1->lon->getAsRad() - $c2->lon->getAsRad();\n $dist = sin($c1->lat->getAsRad()) * sin($c2->lat->getAsRad()) +\n cos($c1->lat->getAsRad()) * cos($c2->lat->getAsRad()) *\n cos($theta);\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtolower($unit);\n switch($unit) {\n case \"k\":\n return ($miles * 1.609344);\n case \"m\":\n return ($miles * 1607.344);\n case \"f\":\n return ($miles * 5280);\n case \"y\":\n return ($miles * 5280/3);\n default:\n return $miles;\n }\n }", "public function getDistance($lat1, $lgn1, $lat2, $lgn2){\n $earth_radius = 6371;\n $alpha = $lat1 - $lat2;\n $beta = $lgn1 - $lgn2;\n $h = pow((sin(deg2rad($alpha/2))), 2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * pow(sin(deg2rad($beta/2)),2);\n $dist = 2*$earth_radius*sqrt($h);\n\n return $dist;\n }", "public function distance($lat1, $lon1, $accuracy1, $lat2, $lon2, $accuracy2)\n\t{\n\t\t$distance = 111.189576 * rad2deg(acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1 - $lon2))));\n\n\t\t// Decrease the distance by the accuracy in meters\n\t\t$distance -= ($accuracy1 + $accuracy2) * 0.001;\n\n\t\treturn ($distance > 0 ? $distance : 0);\n\t}", "public static function get_distance($mdl1, $mdl2) {\n $earth_radius = 3959.0;\n\n $lat_rad_1 = self::to_rads($mdl1->lat);\n $lat_rad_2 = self::to_rads($mdl2->lat);\n\n $long_rad_1 = self::to_rads($mdl1->long);\n $long_rad_2 = self::to_rads($mdl2->long);\n\n $lat_dif = $lat_rad_2 - $lat_rad_1;\n $long_dif = $long_rad_2 - $long_rad_1;\n\n $term_1 = sin($lat_dif / 2) * sin($lat_dif / 2);\n $term_2 = cos($lat_rad_1) * cos($lat_rad_2) * sin($long_dif / 2) * sin($long_dif / 2);\n $term_3 = 2 * atan2(sqrt($term_1 + $term_2), sqrt(1 - $term_1 - $term_2));\n\n return $term_3 * $earth_radius;\n\n }", "public function distance(array $point1, array $point2)\n {\n $dLat = $this->toRadian($point2['latitude'] - $point1['latitude']);\n $dLng = $this->toRadian($point2['longitude'] - $point1['longitude']);\n\n $lat1 = $this->toRadian($point1['latitude']);\n $lat2 = $this->toRadian($point2['latitude']);\n\n $a = sin($dLat / 2) * sin($dLat / 2) +\n sin($dLng / 2) * sin($dLng / 2) *\n cos($lat1) * cos($lat2);\n\n $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n $d = static::EARTH_RADIUS * $c;\n\n return (int)round($d, 0);\n }", "public function getDistanceBetween($origin, $destination)\n {\n $element = $this->compare($origin, $destination);\n return $element->distance / 1000;\n }", "public function getDistance($latitudeA, $longitudeA, $latitudeB, $longitudeB) {\n\t\t$EQUATORIAL_RADIUS_KM = 6378.137;\n\n\t\t$latA = $latitudeA / 180 * 3.14159265358979323;\n\t\t$lonA = $longitudeA / 180 * 3.14159265358979323;\n\t\t$latB = $latitudeB / 180 * 3.14159265358979323;\n\t\t$lonB = $longitudeB / 180 * 3.14159265358979323;\n\t\treturn acos(sin($latA) * sin($latB) + cos($latA) * cos($latB) * cos($lonB - $lonA)) * $EQUATORIAL_RADIUS_KM;\n\t}", "public static function distance($latA, $lonA, $latB, $lonB): string\n {\n $latA = is_numeric($latA) ? self::formatCoord((float)$latA) : $latA;\n $lonA = is_numeric($lonA) ? self::formatCoord((float)$lonA) : $lonA;\n $latB = is_numeric($latB) ? self::formatCoord((float)$latB) : $latB;\n $lonB = is_numeric($lonB) ? self::formatCoord((float)$lonB) : $lonB;\n\n return 'EARTH_DISTANCE( LL_TO_EARTH(' . $latA . ', ' . $lonA . '), LL_TO_EARTH(' . $latB . ', ' . $lonB . ') )';\n }", "public function testDistance()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEmpty($obj_query->getSorts());\n $this->assertEmpty($obj_query->getReturnExpressions());\n $obj_query2 = $obj_query->sortByDistance('where', [1.21, 3.14159]);\n $this->assertEquals([['distance(where, geopoint(1.21,3.14159))', \\Search\\Query::ASC]], $obj_query->getSorts());\n $this->assertEquals([['distance_from_where', 'distance(where, geopoint(1.21,3.14159))']], $obj_query->getReturnExpressions());\n $this->assertSame($obj_query, $obj_query2);\n }", "function miles_distance($lat1, $lng1, $lat2, $lng2, $miles = true){\n\t $pi80 = M_PI / 180;\n\t $lat1 *= $pi80;\n\t $lng1 *= $pi80;\n\t $lat2 *= $pi80;\n\t $lng2 *= $pi80;\n\t \n\t $r = 6372.797; // mean radius of Earth in km\n\t $dlat = $lat2 - $lat1;\n\t $dlng = $lng2 - $lng1;\n\t $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2);\n\t $c = 2 * atan2(sqrt($a), sqrt(1 - $a));\n\t $km = $r * $c;\n\t \n\t return ($miles ? ($km * 0.621371192) : $km);\n \t}", "public static function distance($lat1, $lng1, $lat2, $lng2, $unit = 'k') {\n $earth_radius = 6378137; // Terre = sphère de 6378km de rayon\n $rlo1 = deg2rad($lng1);\n $rla1 = deg2rad($lat1);\n $rlo2 = deg2rad($lng2);\n $rla2 = deg2rad($lat2);\n $dlo = ($rlo2 - $rlo1) / 2;\n $dla = ($rla2 - $rla1) / 2;\n $a = (sin($dla) * sin($dla)) + cos($rla1) * cos($rla2) * (sin($dlo) * sin($dlo));\n $d = 2 * atan2(sqrt($a), sqrt(1 - $a));\n //\n $meter = ($earth_radius * $d);\n if ($unit == 'k') {\n return $meter / 1000;\n }\n return $meter;\n }", "public function measureDistance($lat1, $long1, $lat2, $long2) {\n $earthRadius = 6371;\n\n $latDistance = deg2rad($lat2 - $lat1);\n $longDistance = deg2rad($long2 - $long1);\n\n $a = sin($latDistance/2) * sin($latDistance/2) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * sin($longDistance/2) * sin($longDistance/2);\n $c = 2 * asin(sqrt($a));\n $distance = $earthRadius * $c * 1000;\n\n return $distance;\n }", "public function getDistance(): Distance\n {\n return $this->distance;\n }", "private function calculateDistanceCommercial($lat1, $lon1, $lat2, $lon2, $unit=\"K\") {\r\n\r\n\t $theta = $lon1 - $lon2;\r\n\t $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));\r\n\t $dist = acos($dist);\r\n\t $dist = rad2deg($dist);\r\n\t $miles = $dist * 60 * 1.1515;\r\n\t $unit = strtoupper($unit);\r\n\r\n\t if ($unit == \"K\") {\r\n\t\treturn ($miles * 1.609344);\r\n\t } else if ($unit == \"N\") {\r\n\t\t return ($miles * 0.8684);\r\n\t\t} else {\r\n\t\t\treturn $miles;\r\n\t\t }\r\n\t}", "static public function distance($lat1, $lon1, $lat2, $lon2, $unit = 'K')\n {\n\n $theta = $lon1 - $lon2;\n $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(\n deg2rad($theta)\n );\n $dist = acos($dist);\n $dist = rad2deg($dist);\n $miles = $dist * 60 * 1.1515;\n $unit = strtoupper($unit);\n\n if ($unit == 'K') {\n return ($miles * 1.609344);\n } else {\n if ($unit == 'N') {\n return ($miles * 0.8684);\n } else {\n return $miles;\n }\n }\n }", "public static function geoDistanceGC(Application\\Model\\Waypoint_Coordinate $c1, Application\\Model\\Waypoint_Coordinate $c2) {\n // Perform the formula and return the value\n return acos(\n ( sin($c1->lat->getAsRad()) * sin($c2->lat->getAsRad()) ) +\n ( cos($c1->lat->getAsRad()) * cos($c2->lat->getAsRad()) * cos($c2->lon->getAsRad() - $c1->lon->getAsRad()) )\n ) * self::EARTH_R;\n }", "public function getDistance()\n {\n return $this->distance;\n }", "function distance( $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 6371000){\n // convert from degrees to radians\n $latFrom = deg2rad($latitudeFrom);\n $lonFrom = deg2rad($longitudeFrom);\n $latTo = deg2rad($latitudeTo);\n $lonTo = deg2rad($longitudeTo);\n\n $latDelta = $latTo - $latFrom;\n $lonDelta = $lonTo - $lonFrom;\n\n $angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) +\n cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));\n return $angle * $earthRadius / 1000;\n }", "public function getTotalDistance(){\n return $this->totalDistance;\n }", "public function GetDistance($origin=\"\",$destination=\"\"){\n\t\t\t$from = urlencode($origin);\n\t\t\t$to = urlencode($destination);\n\t\t\t$data = file_get_contents(\"https://maps.googleapis.com/maps/api/distancematrix/json?origins=$from&destinations=$to&language=en-EN&sensor=false&key=\".GOOGLEAPI);\n\t\t\t$data = json_decode($data,true);\n\n\t\t\tif($data['status']=='OK'){\n\t\t\t if($data['rows'][0]['elements'][0]['status']=='ZERO_RESULTS'){\n\t\t\t\t$value=0;\n\t\t\t }else{\n\t\t\t\t $value=$data['rows'][0]['elements'][0]['distance']['text']; \n\t\t\t }\n\t\t\t}\n\t\t\treturn $value; \n\n\t\t}", "function distance($dna1, $dna2) {\n\n if (strlen($dna1) != strlen($dna2)) {\n throw new InvalidArgumentException();\n }\n \n $diff = 0;\n\n for ($i = 0; $i < strlen($dna1); $i++) {\n if($dna1[$i] != $dna2[$i]){\n $diff++;\n }\n }\n \n return $diff;\n}", "public function getDistance() {\n\t\treturn $this->aDistances;\n\t}", "public static function geoDistanceRhumb(Application\\Model\\Waypoint_Coordinate $c1, Application\\Model\\Waypoint_Coordinate $c2) {\n // First of all if this a true East/West line there is a special case:\n if ($c1->lat->getAsRad() == $c2->lat->getAsRad() ) {\n $mid = cos($c1->lat->getAsRad() );\n } else {\n $delta = log( tan(($c2->lat->getAsRad() / 2) + (M_PI / 4))\n / tan(($c1->lat->getAsRad() / 2) + (M_PI / 4)) );\n $mid = ($c2->lat->getAsRad() - $c1->lat->getAsRad() ) / $delta;\n }\n\n // Calculate difference in longitudes, and if over 180, go the other\n // direction around the Earth as it will be a shorter distance:\n $dlon = abs($c2->lon->getAsRad() - $c1->lon->getAsRad() );\n $dlon = ($dlon > M_PI) ? (2 * M_PI - $dlon) : $dlon;\n $distance = sqrt( pow($c2->lat->getAsRad() - $c1->lat->getAsRad() ,2) +\n (pow($mid, 2) * pow($dlon, 2)) ) * self::EARTH_R;\n\n return $distance;\n }", "function sphere_distance($lat1, $lon1, $lat2, $lon2, $radius = 6378.135) {\r\n\t$rad = doubleval(M_PI/180.0);\r\n\t\r\n\t$lat1 = doubleval($lat1) * $rad;\r\n\t$lon1 = doubleval($lon1) * $rad;\r\n\t$lat2 = doubleval($lat2) * $rad;\r\n\t$lon2 = doubleval($lon2) * $rad;\r\n\t\r\n\t$theta = $lon2 - $lon1;\r\n\t$dist = acos(sin($lat1) * sin($lat2) +\r\n\t\tcos($lat1) * cos($lat2) *\r\n\t\tcos($theta));\r\n\tif($dist < 0) { \r\n\t\t$dist += M_PI; \r\n\t}\r\n\t// Default is Earth equatorial radius in kilometers\r\n\treturn $dist = $dist * $radius;\r\n}", "function caluculDistance($line,$nameStart,$nameEnd,$cat){\n\n\n if ( ! (($stationStart= getStationDB($nameStart,$line)) && ($stationEnd= getStationDB($nameEnd,$line)))) return \"stations do not exist\";\n //check direction\n\n if ($stationStart->getDist()< $stationEnd->getDist()) $keyword='ASC' ;\n else $keyword='DESC';\n\n\n $array =calculDistanceDB($stationStart,$stationEnd,$keyword,$cat);\n return $array;\n}", "public function getDistance() {\n\t\treturn $this->distance;\n\t}", "public static function lat_lon_distance($lat1, $lng1, $lat2, $lng2, $miles = true)\r\n {\n \t$pi = 3.1415926;\r\n \t$rad = doubleval($pi/180.0);\r\n \t$lon1 = doubleval($lng1)*$rad; \n \t$lat1 = doubleval($lat1)*$rad;\n \t\r\n \t$lon2 = doubleval($lng2)*$rad; \n \t$lat2 = doubleval($lat2)*$rad;\n \t\r\n \t$theta = $lon2 - $lon1;\r\n \t$dist = acos(sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($theta));\r\n \tif ($dist < 0) {\r\n \t\t$dist += $pi;\r\n \t}\r\n \t$dist = $dist * 6371.2;\r\n \treturn $dist;\r\n }", "function wyz_cmp_listings_near_me( $a, $b ) {\n\tif ( $a['distance'] == $b['distance'] ) return 0;\n\treturn $a['distance'] < $b['distance'] ? -1 : 1;\n}", "function vincentyGreatCircleDistance(\r\n $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo, $earthRadius = 3959 )\r\n{\r\n $latFrom = deg2rad($latitudeFrom);\r\n $lonFrom = deg2rad($longitudeFrom);\r\n $latTo = deg2rad($latitudeTo);\r\n $lonTo = deg2rad($longitudeTo);\r\n\r\n $lonDelta = $lonTo - $lonFrom;\r\n $a = pow(cos($latTo) * sin($lonDelta), 2) +\r\n pow(cos($latFrom) * sin($latTo) - sin($latFrom) * cos($latTo) * cos($lonDelta), 2);\r\n $b = sin($latFrom) * sin($latTo) + cos($latFrom) * cos($latTo) * cos($lonDelta);\r\n\r\n $angle = atan2(sqrt($a), $b);\r\n return $angle * $earthRadius;\r\n}", "public function getDistance($source, $destination)\n {\n return $this->distanceObj->getDistance($source, $destination);\n }", "public function searchCalculateDistanceAction(){\n\t\t$this->changeLanguage();\n\t\t$concept_1=$_POST['concept_1'];\n\t\t$concept_2=$_POST['concept_2'];\n\t\t$ontology=$_POST['ontology'];\n\t\t\n\t\t$concept_1=$this->getSemSimId($concept_1, $ontology);\n\t\t$concept_2=$this->getSemSimId($concept_2, $ontology);\n\t\t\n\t\tif (is_null($concept_1)&&is_null($concept_2)){\n\t\t\t$concept_1=$_POST['concept_1_full_id'];\n\t\t\t$concept_2=$_POST['concept_2_full_id'];\n\t\t\tif (!preg_match(\"(http.+)\", $concept_1)&&!preg_match(\"(http.+)\", $concept_2)){\n\t\t\t\tthrow new HttpException(403,\"Vous devez mettre un champ de type url!\");\n\t\t\t\t//go to the hell\n\t\t\t}\n\t\t\t$concept_1=$this->retreiveConceptId($concept_1);\n\t\t\t$concept_2=$this->retreiveConceptId($concept_2);\n\t\t}\n\t\t\n\t\t$results=$this->singleDistanceParam($concept_1, $concept_2);\n\t\t$constructGraph=new ConstructGraph($this->getDoctrine());\n\n\t\t$constructGraph->getListAncestorsConcepts($concept_1, $concept_2);\n\t\t\n\t\treturn $this->render('AcmeBiomedicalBundle:Default:semantic_distance.html.twig',\n\t\t\t\tarray('title'=>'Distance sémantique',\n\t\t\t\t\t'distances'=>$results,\n\t\t\t\t\t'concept_1'=>$_POST['concept_1'],\n\t\t\t\t\t'ontology'=>$ontology,\n\t\t\t\t\t'concept_2'=>$_POST['concept_2'],\n\t\t\t\t\t'graph'=>$constructGraph\t\t\n\t\t\t\t\t));\n\t}", "public function calculateDistanceBetweenTwoPoints($latitudeOne = '', $longitudeOne = '', $latitudeTwo = '', $longitudeTwo = '', $distanceUnit = '', $round = false, $decimalPoints = '')\n {\n if (empty($decimalPoints)) {\n $decimalPoints = '2';\n }\n if (empty($distanceUnit)) {\n $distanceUnit = 'KM';\n }\n $distanceUnit = strtolower($distanceUnit);\n $pointDifference = $longitudeOne - $longitudeTwo;\n $toSin = (sin(deg2rad($latitudeOne)) * sin(deg2rad($latitudeTwo))) + (cos(deg2rad($latitudeOne)) * cos(deg2rad($latitudeTwo)) * cos(deg2rad($pointDifference)));\n $toAcos = acos($toSin);\n $toRad2Deg = rad2deg($toAcos);\n $toMiles = $toRad2Deg * 60 * 1.1515;\n $toKilometers = $toMiles * 1.609344;\n return ($round == true ? round($toKilometers) : round($toKilometers, $decimalPoints));\n }" ]
[ "0.77610487", "0.76158", "0.7522438", "0.73643893", "0.7326963", "0.7248142", "0.71561724", "0.7099443", "0.706053", "0.70364004", "0.6989083", "0.69749033", "0.69577885", "0.694888", "0.69279116", "0.69217247", "0.6891768", "0.68254495", "0.6818011", "0.68116987", "0.67948353", "0.6791695", "0.6738642", "0.6733719", "0.6727574", "0.67218214", "0.66969675", "0.6664941", "0.665261", "0.6634511", "0.6631193", "0.6627332", "0.66121304", "0.6601561", "0.65741956", "0.65661484", "0.6564192", "0.65626", "0.65572655", "0.6556798", "0.6546558", "0.6530695", "0.65199286", "0.6513679", "0.650381", "0.6494383", "0.6485342", "0.6473345", "0.64478123", "0.64458716", "0.6417513", "0.6384804", "0.6380481", "0.6360744", "0.6342672", "0.6330438", "0.63262016", "0.63142586", "0.62934977", "0.62866735", "0.6284369", "0.6281663", "0.6274514", "0.6269903", "0.62662125", "0.624685", "0.6210412", "0.619254", "0.6181935", "0.61695504", "0.6129034", "0.6123039", "0.6116757", "0.61009467", "0.6095344", "0.6084794", "0.6076073", "0.60684115", "0.60635734", "0.6059577", "0.6059506", "0.60581964", "0.6054406", "0.6040445", "0.60403246", "0.6033807", "0.59451544", "0.593168", "0.5924439", "0.5914455", "0.59091383", "0.5875741", "0.585656", "0.5845658", "0.58405316", "0.5840131", "0.5816696", "0.58157796", "0.58128023", "0.58124316" ]
0.60588664
81
Returns whether the supplied value is a value type.
public static function isValueType($value) { if (is_scalar($value) || $value === null) { return true; } elseif (is_array($value)) { $isScalar = true; array_walk_recursive($value, function ($value) use (&$isScalar) { if ($isScalar && !(is_scalar($value) || $value === null)) { $isScalar = false; } }); return $isScalar; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValue()\n {\n return\n $this->type === 'string' ||\n $this->type === 'number' ||\n $this->type === 'null' ||\n $this->type === 'boolTrue' ||\n $this->type === 'boolFalse';\n }", "final public function isType(string $value):bool\n {\n return $this->type() === $value;\n }", "protected function isValueObject($value)\n {\n return is_object($value) && is_subclass_of($value, ValueObject::class);\n }", "function checkType ($value, $type) {\n\tswitch ($type) {\n\t\tcase STRING : $r = is_string ($value); break;\n\t\tcase BOOL : $r = is_bool ($value); break;\n\t\tcase NUMERIC : $r = is_int ($value); break;\n\t\tcase REAL : $r = (is_real ($value) or is_int ($value)); break;\n\t\tdefault : return new Error ('TYPE_NOT_RECOGNIZED'); \n\t}\n\t\n\tif ($r === true) {\n\t\treturn true;\n\t} else {\n\t\treturn new Error ('TYPE_MISMATCH_VALUE', $type, $value);\n\t}\n}", "public static function isType($type, $value) {\n if (null !== ($validator = static::getTypeValidator($type))) {\n return call_user_func($validator, $value);\n }\n return true;\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PropertyValueType || $value instanceof DataType\\TextType || $value instanceof DataType\\URLType;\n\t}", "public function canHandle(TypedValueInterface $value): bool;", "public function hasValueType() {\n return $this->_has(7);\n }", "public static function isValid($value, string $type): bool\n\t{\n\t\t$valid = false;\n\t\tif($type == 'mixed') {\n\t\t\t$valid = true;\n\t\t} else if(is_string($value) || $value instanceof DataTypes\\TypeString) {\n\t\t\tif($type == 'string') $valid = true;\n\t\t} else if(is_int($value) || $value instanceof DataTypes\\TypeInt) {\n\t\t\tif($type == 'int') $valid = true;\n\t\t} else if(is_float($value) || $value instanceof DataTypes\\TypeFloat) {\n\t\t\tif($type == 'float') $valid = true;\n\t\t} else if(is_array($value) || $value instanceof DataTypes\\TypeArray) {\n\t\t\tif($type == 'array') $valid = true;\n\t\t} else if(is_bool($value) || $value instanceof DataTypes\\TypeBool) {\n\t\t\tif($type == 'boolean') $valid = true;\n\t\t} else if(is_object($value)) {\n\t\t\tif($value instanceof $type) $valid = true;\n\t\t}\n\t\treturn $valid;\t\n\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\DataDownloadType;\n\t}", "public function eql(Value $value): bool\n\t{\n\t\treturn is_a($value, get_class());\n\t}", "public function validateParameterValue($value) {\n switch ($this->getType()) {\n case self::TYPE_TEXT:\n return is_string($value) || is_numeric($value) || is_bool($value);\n case self::TYPE_NUMERIC:\n return is_numeric($value);\n case self::TYPE_BOOLEAN:\n return is_bool($value) || $value === 0 || $value === 1;\n case self::TYPE_DATE:\n return date_create_from_format(\"Y-m-d\", $value) ? true : false;\n case self::TYPE_DATE_TIME:\n return date_create_from_format(\"Y-m-d H:i:s\", $value) ? true : false;\n }\n }", "public function containsValue(mixed $value): bool;", "public function isValueValid($value) {\n\t\treturn $value instanceof DataType\\TextType;\n\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PersonType;\n\t}", "protected function isValidValue($value)\r\n {\r\n return ($value instanceof Entity\\PluginValue);\r\n }", "private static function isBuiltinType($value)\n {\n return in_array($value, self::$BUILTIN_TYPES)\n || isset(self::$BUILTIN_TYPES[$value]);\n }", "public static function isPrimitive($value) {\n return is_bool($value) || is_int($value) || is_float($value) || is_string($value);\n }", "public static function is_allow_type($key, $value)\n {\n $classes = Information::get_class_of($key);\n $check = false;\n\n if (in_array(Information::array, $classes)) $check = ($check or is_array($value));\n if (in_array(Information::string, $classes)) $check = ($check or is_string($value));\n if (in_array(Information::int, $classes)) $check = ($check or is_numeric($value));\n if (in_array(Information::encrypt, $classes)) $check = ($check or is_string($value)); // maybe something else\n if (in_array(Information::unknown, $classes)) $check = false;\n return $check;\n }", "private static function _isValidValue($type, $value){\n $value = self::_sanitizeValue($type, $value);\n if ($value != null){\n $nativeType = self::_getNativeType($type);\n if ($nativeType == 'ascii'){\n if (isset(self::$_extendedTypes[$type]['validate'])){\n if (!preg_match(self::$_extendedTypes[$type]['validate'], $value)){\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }", "public static function typeMatches ($value, $type) {\n $types = array(\"string\", \"number\", \"array\", \"object\", \"date\", \"boolean\", \"null\");\n $phpType = gettype($value);\n //....?\n }", "private static function _isPropertyType($type, $value){\n $nativeType = self::_getNativeType($type);\n if ($nativeType != null){\n switch($nativeType){\n case 'boolean':\n if (is_bool($value)){\n return true;\n } else if (is_numeric($value) && ($value == 0 || $value == 1)){\n return true;\n } else if (is_string($value)){\n if ($value == 'true' || $value == 'false'){\n return true;\n } else if ($value == '1' || $value == '0'){\n return true;\n }\n }\n break;\n case 'integer':\n if (is_int($value)){\n return true;\n } else if (preg_match('/^[0-9]+$/', $value)){\n return true;\n }\n break;\n case 'double':\n if (is_float($value) || is_numeric($value)){\n return true;\n }\n break;\n case 'datetime':\n if (is_int($value) || strtotime($value)){\n return true;\n }\n break;\n case 'binary':\n if (is_binary($value)){\n return true;\n }\n break;\n case 'ascii':\n if (is_string($value)){\n return true;\n }\n break;\n case 'instance':\n $uuid = null;\n if (is_object($value) && isset($value->uuid) && is_mysql_uuid($value->uuid)){\n $uuid = $value->uuid;\n } else if (is_mysql_uuid($value)){\n $uuid = $value;\n }\n if ($uuid != null){\n $id = Mysql::query(\"SELECT MAX(id) FROM t_instance where uuid = '{$uuid}'\");\n if ($id && is_int($id)){\n return true;\n }\n }\n break;\n }\n }\n\n // all else failed\n return false;\n }", "public static function typeOfValue($value)\n {\n if (is_null($value)) {\n return self::TYPE_NULL;\n }\n if (is_int($value)) {\n return self::TYPE_INT;\n }\n if (is_bool($value)) {\n return self::TYPE_BOOL;\n }\n return self::TYPE_STR;\n }", "abstract public function checkValueType($arg_value);", "function o_isString($value) {\n\t\t\treturn Obj::singleton()->isString($value);\n\t\t}", "public static function hasValue(int|string $value): bool\n {\n $validValues = static::getValues();\n\n return in_array($value, $validValues, true);\n }", "function check( $value, $type='text' )\n {\n return Pgg_Validate::is( $value, $type );\n }", "protected function validateType($value)\n {\n }", "public function isValueString() {\n\t\treturn $this->isValueString;\n\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\VideoGame;\n\t}", "public function isObject()\n {\n return \\is_object($this->value);\n }", "public function is($value) {\n return ($this->code === $value || $this->value === $value);\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\InteractionCounter;\n\t}", "public static function isScalar($value)\n {\n return in_array(gettype($value), self::$native);\n }", "protected static function canBeCastToString($value) {\n if (is_object($value) && method_exists($value, \"__toString\")) {\n return true;\n }\n return is_scalar($value) || is_null($value);\n }", "protected function isValidValue($value)\n {\n return ($value instanceof ClassConstant);\n }", "function is($type);", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\PublicationEventType;\n\t}", "public static function is($value, $type_value, $strict = false)\r\n\t{\r\n\t\t// First, check that the type we're trying to check against is indeed a valid type\r\n\t\tif (!self::isValidValue($type_value, $strict)) {\r\n\t\t\treturn new \\InvalidArgumentException(\"Asking if [$value] is a [$type_value], while [$type_value] is not of current type [TODO]\");\r\n\t\t}\r\n\r\n\t\tif ($strict)\r\n\t\t{\treturn $value == $type_value;\r\n\t\t}\r\n\t\telse\r\n\t\t{\treturn strtolower($value) == strtolower($type_value);\r\n\t\t}\r\n\t}", "private function validate($value,$type) {\n\t\tswitch($type) {\n\t\t\tcase \"varchar\":\n\t\t\t\treturn self::is_alphanum($value);\n\t\t\t\tbreak;\n\t\t\tcase \"int\":\n\t\t\t\treturn self::is_num($value);\n\t\t\t\tbreak;\n\t\t\tcase \"binary\":\n\t\t\t\treturn self::is_binary($value);\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tcase \"signed\":\n\t\t\t\treturn self::is_signed($value);\n\t\t\t\tbreak;\n\t\t\tcase \"file\":\n\t\t\t\treturn true;\n\t\t\t\tbreak;\n\t\t\tcase \"alpha\":\n\t\t\t\treturn self::is_alpha($value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\t}", "final public function is($value):bool\n {\n return $this->getAttr($value) === true;\n }", "final public static function is($value):bool\n {\n return is_bool($value);\n }", "function isString ($value)\r\n{\r\n\treturn is_string ($value);\r\n}", "public function isString()\n {\n return \\is_string($this->value);\n }", "static function is( $value, $type='text' )\n {\n $method = 'is' . ucwords( $type );\n if( method_exists( 'Pgg_Validate', $method ) ) {\n return self::$method( $value );\n }\n return $value;\n }", "final public function is($value)\n {\n return $value instanceof AbstractEnum ? $this->_enumMatch($value) : $this->getValue() === $value;\n }", "public function isIntOrFloat($value)\n {\n return (is_int($value) || is_float($value));\n }", "protected function _introspectType($value)\n\t{\n\t\tswitch (true) {\n\t\t\tcase (is_bool($value)):\n\t\t\t\treturn 'boolean';\n\t\t\tcase (is_float($value) || preg_match('/^\\d+\\.\\d+$/', $value)):\n\t\t\t\treturn 'float';\n\t\t\tcase (is_int($value) || preg_match('/^\\d+$/', $value)):\n\t\t\t\treturn 'integer';\n\t\t\tcase (is_string($value) && strlen($value) <= $this->_columns['string']['length']):\n\t\t\t\treturn 'string';\n\t\t\tdefault:\n\t\t\t\treturn 'text';\n\t\t}\n\t}", "abstract public function isValid(mixed $value): bool;", "public function checkObject($value)\n {\n return $this->checkHasType($value, 'object');\n }", "public static function isValidValue($value) {\n return is_array($value);\n }", "protected static function getType($value) {\n\t\t\tif ($value === NULL) {\n\t\t\t\t$result = 'NULL';\n\t\t\t} elseif (is_array($value)) {\n\t\t\t\t$result = 'array';\n\t\t\t} elseif (is_scalar($value)) {\n\t\t\t\t$scalarType = gettype($value);\n\t\t\t\t$result = $scalarType;\n\t\t\t} else {\n\t\t\t\t$valueClassType = get_class($value);\n\t\t\t\t$result = $valueClassType;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\Comment;\n\t}", "abstract protected function isValidValue($value);", "public static function typeIdentifier($value): bool\n {\n static::regex(\n $value,\n '/^[0-9A-Za-z-_]+$/',\n 'Value \"%s\" does not match type identifier format requirement (must contain only of alphanumeric chars,'\n . ' dash or underscore)'\n );\n static::maxLength($value, self::MAX_TYPE_IDENTIFIER_LENGTH);\n\n return true;\n }", "private function check_object($value) : bool\n {\n if (!is_object($value) && !is_array($value))\n return false;\n\n return true;\n }", "protected function isValueNormalizationRequired(mixed $value): bool\n {\n return \\is_string($value);\n }", "static function validate ($type, $v)\n {\n if (is_null ($v) || $v === '')\n return true;\n\n switch ($type) {\n\n case type::binding:\n return is_string ($v);\n\n case type::any:\n case type::bool: // Any value can be typecast to boolean.\n return true;\n\n case type::data:\n return is_array ($v) || is_object ($v)\n || $v instanceof \\Traversable\n || (is_string ($v) && strpos ($v, '{') !== false);\n\n case type::id:\n return !!preg_match ('#^[\\w\\-]+$#', $v);\n\n case type::content:\n return $v instanceof Metadata || is_string ($v); // Note: content props can be specified in attribute syntax.\n\n case type::metadata:\n return $v instanceof Metadata;\n\n case type::collection:\n return is_array ($v);\n\n case type::number:\n return is_numeric ($v);\n\n case type::string:\n return is_scalar ($v) || (is_object ($v) && method_exists ($v, '__toString'));\n }\n return false;\n }", "public static function isValid(array $types, & $value)\n\t{\n\t\t$_value = $value;\n\t\t$_e = NULL;\n\n\t\tif (isset($types['mixed']) OR !$types) return true;\n\n\t\tforeach ($types as $type)\n\t\t{\n\t\t\tif ($type === 'null')\n\t\t\t{\n\t\t\t\tif ($value === NULL) return true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if ($type === 'id')\n\t\t\t{\n\t\t\t\tif ($value !== TRUE AND !empty($value) AND is_scalar($value) AND ctype_digit((string) $value))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (!in_array($type, array('string', 'float', 'int', 'bool', 'array', 'object', 'mixed', 'scalar')))\n\t\t\t{\n\t\t\t\tif ($value instanceof $type) return true;\n\t\t\t\telse if ($type === 'datetime' AND $value !== '' AND (is_string($value) OR is_int($value) OR is_float($value)))\n\t\t\t\t{\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$_value = static::createDateTime($value);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\t$_e = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($type === 'arrayobject' AND is_string($value) AND in_array(substr($value, 0, 1), array('O','C')) AND substr($value, 1, 18) === ':11:\"ArrayObject\":' AND ($tmp = @unserialize($value)) instanceof ArrayObject) // intentionally @\n\t\t\t\t{\n\t\t\t\t\t$_value = $tmp;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if ($type === 'mixed') return true;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (call_user_func(\"is_$type\", $value)) return true;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (in_array($type, array('float', 'int')) AND (is_numeric($value)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = $value;\n\t\t\t\t\t\tsettype($_value, $type);\n\t\t\t\t\t}\n\t\t\t\t\telse if (in_array($type, array('array', 'object')) AND (is_array($value) OR is_object($value)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = $value;\n\t\t\t\t\t\tsettype($_value, $type);\n\t\t\t\t\t}\n\t\t\t\t\telse if ($type === 'string' AND (is_int($value) OR is_float($value) OR (is_object($value) AND method_exists($value, '__toString'))))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = (string) $value;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($type === 'array' AND is_string($value) AND substr($value, 0, 2) === 'a:' AND is_array($tmp = @unserialize($value))) // intentionally @\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = $tmp;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($type === 'bool' AND in_array($value, array(0, 0.0, '0', 1, 1.0, '1'), true))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_value = (bool) $value;\n\t\t\t\t\t}\n\t\t\t\t\telse if (is_string($value) AND in_array($type, array('float', 'int')))\n\t\t\t\t\t{\n\t\t\t\t\t\t// todo anglickej zpusob zadavani dat 100,000.00 tady uplne zkolabuje\n\t\t\t\t\t\tif (!isset($intValue)) $intValue = str_replace(array(',', ' '), array('.', ''), $value);\n\t\t\t\t\t\tif (is_numeric($intValue))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_value = $intValue;\n\t\t\t\t\t\t\tsettype($_value, $type);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif ($_value === $value)\n\t\t{\n\t\t\tif ($_e)\n\t\t\t{\n\t\t\t\tthrow $_e;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$value = $_value;\n\t\t\treturn true;\n\t\t}\n\n\t}", "function isObject ($value)\r\n{\r\n\treturn is_object ($value);\r\n}", "private function GetType($value){\n\t\tswitch (true) {\n\t\t\tcase is_int($value):\n\t\t\t\t$type = PDO::PARAM_INT;\n\t\t\t\tbreak;\n\t\t\tcase is_bool($value):\n\t\t\t\t$type = PDO::PARAM_BOOL;\n\t\t\t\tbreak;\n\t\t\tcase is_null($value):\n\t\t\t\t$type = PDO::PARAM_NULL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = PDO::PARAM_STR;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $type;\n\t}", "public static function isScalar($value)\n {\n if (null === $value) {\n return true;\n\n }\n\n if (is_array($value)) {\n foreach($value as $sub_value) {\n if (! self::isScalar($sub_value)) {\n return false;\n }\n }\n return true;\n\n }\n\n return is_scalar($value);\n }", "public function hasValue($value)\n {\n return $this->_value == $value;\n }", "public static function isObject($val)\n {\n return is_object($val);\n }", "public function is($test_value) {\n\t\t$this_class = get_class($this);\n\t\tif ($test_value instanceof $this_class) {\n\t\t\treturn $test_value->getValue() === $this->value;\n\t\t}\n\t\t// Default to raw value comparison (this is not ideal, as the values\n\t\t// themselves are not type-hinted.\n\t\treturn $test_value === $this->value;\n\t}", "private function var_is_int($value) {\n\t\t// Returns TRUE if $value is an integer.\n\t\t// Returns FALSE otherwise.\n\t\t// This function will take any data type as input.\n \treturn ((string) $value) === ((string)(int) $value);\n\t}", "function o_isInt($value) {\n\t\t\treturn Obj::singleton()->isInt($value);\n\t\t}", "public function isType($type){\n \n // canary...\n if(!$this->hasType()){ return false; }//if\n \n return ($this->field_map['type'] === $type);\n \n }", "final public static function is(mixed $value):bool\n {\n return is_string($value) && Str::isStart('<?xml',$value);\n }", "public function isScalar(): bool\n {\n return $this->phpType === self::INTEGER\n || $this->phpType === self::FLOAT\n || $this->phpType === self::STRING\n || $this->phpType === self::BOOLEAN\n || $this->phpType === self::NULL;\n }", "protected function isValidValue($value): bool\n\t{\n\t\treturn is_numeric($value) === true;\n\t}", "public function validate($value) {\n\t\t$isValid = false;\n\n\t\tif (is_scalar($value)) {\n\t\t\t$isValid = ($this->isValidCommonNotation($value)\n\t\t\t\t|| $this->isValidDotNotation($value)\n\t\t\t\t|| $this->isValidScientificNotation($value));\n\t\t}\n\n\t\tif (!$isValid) {\n\t\t\t$this->error($this->messageInvalid, $this->stringify($value));\n\t\t}\n\n\t\treturn $isValid;\n\t}", "public function is_type($type)\n\t{\n\t\treturn $this->get('object_type') == $type;\n\t}", "public static function aString($value)\n {\n return (is_string($value))?:false;\n }", "function is_type_of(mixed $var, string ...$types): bool\n{\n $var_type = strtolower(get_debug_type($var));\n\n // Multiple at once.\n if ($types && str_contains($types[0], '|')) {\n $types = explode('|', $types[0]);\n\n // A little bit faster than foreach().\n if (in_array($var_type, $types, true)) {\n return true;\n }\n }\n\n foreach ($types as $type) {\n $type = strtolower($type);\n if (match ($type) {\n // Any/mixed.\n 'any', 'mixed' => 1,\n\n // Sugar stuff.\n 'list', 'number', 'image', 'stream', 'iterator', 'enum'\n => ('is_' . $type)($var),\n\n // Primitive & internal stuff.\n 'int', 'float', 'string', 'bool', 'array', 'object', 'null',\n 'numeric', 'scalar', 'resource', 'iterable', 'callable', 'countable',\n => ('is_' . $type)($var),\n\n // All others.\n default => ($var_type === $type) || ($var instanceof $type)\n }) {\n return true;\n }\n }\n return false;\n}", "public function containsValue($value): bool;", "public function isSetDataType()\n {\n return !is_null($this->_fields['DataType']['FieldValue']);\n }", "public static function getType($value)\n {\n $type = \\strtolower(\\gettype($value));\n if ($type == 'object') {\n if ($value instanceof \\Imperium\\JSON\\ArrayObject) {\n return 'array';\n } elseif ($value instanceof \\Imperium\\JSON\\Undefined) {\n return 'undefined';\n }\n } elseif ($type == 'array') {\n if (!empty($value) && (array_keys($value) !== range(0, count($value) - 1))) {\n return 'object';\n }\n } elseif ($type == 'integer' || $type == 'double') {\n return 'number';\n }\n return $type;\n }", "public function typesAreEqual($fieldName, $value)\n {\n if (!$this->has($fieldName)) {\n throw new \\InvalidArgumentException(sprintf('Can not find field %s declaration', $fieldName));\n }\n\n $field = $this->get($fieldName);\n\n if (gettype($value) === 'object') {\n if ($field->typeOf('object')) {\n return true;\n }\n return $field->typeOf(get_class($value));\n }\n return $field->typeOf(gettype($value));\n }", "public function containsValue($value) : bool;", "public function isScalar()\n {\n return \\is_scalar($this->value);\n }", "protected function _typecast($value) {\n\t\t$type = null;\t\t\n\n\t\tif (is_string($value)) {\n\t\t\t$type = 'string';\n\t\t}\n\t\tif (is_int($value)) {\n\t\t\t$type = 'int';\n\t\t}\n\t\tif (is_float($value)) {\n\t\t\t$type = 'double';\n\t\t}\n\t\tif (is_bool($value)) {\n\t\t\t$type = 'boolean';\n\t\t}\n\t\tif (is_array($value)) {\n\t\t\t$type = 'array';\n\t\t\t\n\t\t\t$valueKeys = array_keys($value);\n\t\t\tforeach($valueKeys as $vk) {\n\t\t\t\tif (!is_numeric($vk)) {\n\t\t\t\t\t$type = 'struct';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $type;\n\t}", "public function getIsValidValue($value)\r\n {\r\n return true;\r\n }", "public function is_type( $type ) {\n\t\tif ( 'variable' == $type || ( is_array( $type ) && in_array( 'variable', $type ) ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn parent::is_type( $type );\n\t\t}\n\t}", "public function run($value)\n {\n if ($value instanceof Date) {\n return true;\n }\n if (!is_string($value)) {\n return false;\n }\n if (preg_match(Date::ISO8601_REGEX, $value)) {\n return true;\n }\n\n return false;\n }", "static public function isEnumValue ($value) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:461: characters 3-31\n\t\treturn ($value instanceof HxEnum);\n\t}", "public static function getType($value): string\n\t{\n\t\tif(is_string($value)) {\n\t\t\treturn 'string';\n\t\t} else if(is_int($value)) {\n\t\t\treturn 'integer';\n\t\t} else if(is_float($value)) {\n\t\t\treturn 'float';\n\t\t} else if(is_array($value)) {\n\t\t\treturn 'array';\n\t\t} else if(is_bool($value)) {\n\t\t\treturn 'boolean';\n\t\t} else if(is_object($value)) {\n\t\t\treturn 'object';\n\t\t}\n\t\treturn 'different';\n\t}", "public static function getTypeFromValue($value)\n {\n switch (gettype($value)) {\n case 'boolean':\n return Type::getBool();\n\n case 'integer':\n return Type::getInt();\n\n case 'double':\n return Type::getFloat();\n\n case 'string':\n return Type::getString();\n\n case 'array':\n return Type::getArray();\n\n case 'NULL':\n return Type::getNull();\n\n default:\n return Type::getMixed();\n }\n }", "private function canBeString($value): bool\n {\n // https://stackoverflow.com/a/5496674\n return !is_array($value) && (\n (!is_object($value) && settype($value, 'string') !== false) ||\n (is_object($value) && method_exists($value, '__toString'))\n );\n }", "public function isType($type)\r\n\t{\r\n\t\treturn ($this->type == $type);\r\n\t}", "protected function _set_type(& $value, $type) {\n // \"integer\" (or, since PHP 4.2.0, \"int\")\n // \"float\" (only possible since PHP 4.2.0, for older versions use the deprecated variant \"double\")\n // \"string\"\n // \"array\"\n // \"object\"\n // \"null\" (since PHP 4.2.0)\n $type = isset($type) ? (trim(strtolower(@ (string) $type))) : null;\n\n if ($type === null) {\n return true;\n }\n\n switch ($type) {\n\n case 'bool':\n\n $type = 'boolean';\n break;\n\n case 'int':\n\n $type = 'integer';\n break;\n\n case 'double':\n\n $type = 'float';\n break;\n }\n\n return @ settype($value, $type);\n }", "function is_json($value)\n {\n return is_string($value) && is_array(json_decode($value, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false;\n }", "protected function checkValue($value)\n {\n return null !== $value && intval($value);\n }", "public function isValid($value)\n {\n $this->_setValue($value);\n\n // tolerate empty values\n if (!isset($value)) {\n return true;\n }\n\n // ensure that only string values are valid.\n if (is_numeric($value)) {\n $value = (string) $value;\n }\n if (!is_string($value)) {\n $this->_error(static::INVALID_TYPE);\n return false;\n }\n\n // validate permitted characters, but do not complain about unset values\n if (preg_match(\"/[^a-z0-9_\\- ]/i\", $value)) {\n $this->_error(self::ILLEGAL_CHARACTERS);\n return false;\n }\n\n return true;\n }", "public function test($value): bool\n {\n if (! $value instanceof \\Throwable) {\n throw new \\InvalidArgumentException('Given value is not an exception');\n }\n\n return $value instanceof $this->expectedType;\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_TOPIC,self::VALUE_AUTHOR,self::VALUE_SOURCE,self::VALUE_COLLECTIONCODE,self::VALUE_KEYWORDS,self::VALUE_AFFILIATION,self::VALUE_DATE));\n\t}", "public function cleanValue($value)\n {\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n if ($this->isLeveled()) {\n //special case...\n if ($value && !is_array($value)) {\n //fresh from user input... set it to array\n $value = geoLeveledField::getInstance()->getValueInfo($value);\n }\n if (!is_array($value) || !isset($value['id']) || !(int)$value['id']) {\n //invalid\n return false;\n }\n return $value;\n }\n if (is_array($value)) {\n return false;\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n if (!is_array($value) || (!isset($value['high']) || !isset($value['low']))) {\n return false;\n }\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n return $value;\n }", "public static function getTypeOrClass($value)\n {\n return is_object($value) ? get_class($value) : gettype($value);\n }", "private function filter_type( $value ) {\n\t\tif ( empty( $this->type ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tswitch ( $this->type->case() ) {\n\t\t\tcase Schema_Type::NUMBER:\n\t\t\t\treturn (int) $value;\n\n\t\t\tcase Schema_Type::BOOL:\n\t\t\t\treturn (bool) $value;\n\n\t\t\tcase Schema_Type::STRING:\n\t\t\t\treturn (string) $value;\n\n\t\t\tcase Schema_Type::ARRAY:\n\t\t\t\treturn (array) $value;\n\t\t}\n\n\t\treturn $value;\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_JPG,self::VALUE_GIF,self::VALUE_CUSTOMCODE));\n\t}" ]
[ "0.809748", "0.7780862", "0.73132294", "0.72554064", "0.71008927", "0.70079076", "0.69856507", "0.69838655", "0.68819124", "0.687105", "0.6859007", "0.6822661", "0.67740864", "0.67572004", "0.6708007", "0.66971725", "0.66896874", "0.668202", "0.6679527", "0.66275203", "0.6607475", "0.6595571", "0.65930647", "0.65808266", "0.65352345", "0.6519473", "0.6509269", "0.6465097", "0.646474", "0.64496416", "0.64458615", "0.6423806", "0.6410415", "0.64092875", "0.6386306", "0.6381681", "0.63407147", "0.63264984", "0.63143563", "0.62948024", "0.6276989", "0.62701005", "0.6266842", "0.62393606", "0.6230722", "0.6197583", "0.6151208", "0.6146021", "0.61444765", "0.613908", "0.6122814", "0.6115239", "0.6100404", "0.6099465", "0.6095977", "0.60948014", "0.6093772", "0.60928226", "0.6083532", "0.60707295", "0.60630274", "0.60599625", "0.6032282", "0.60291004", "0.60126024", "0.6008619", "0.6004181", "0.60032994", "0.5993314", "0.5992595", "0.59920347", "0.59895444", "0.5966954", "0.5961181", "0.59403336", "0.59354717", "0.5933702", "0.5931187", "0.59235877", "0.5915101", "0.59111845", "0.5908006", "0.5905568", "0.5898233", "0.58960956", "0.5881644", "0.5880078", "0.5877306", "0.58751667", "0.5874727", "0.5872027", "0.5856384", "0.58470345", "0.5843693", "0.58259195", "0.5824926", "0.58230966", "0.5820696", "0.5801794", "0.57989293" ]
0.77763796
2
Run the database seeds.
public function run() { User::create([ 'name' => 'igo', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Алхимик', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Ярус', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'AVZ', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'artel', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Phantom', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'liveparhomenko', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'Лёха', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'AndreWWW', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'MikhailChurikov', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); User::create([ 'name' => 'admin', 'email' => '[email protected]', 'password' =>'$2y$10$O25adCIHCa0XuRrzMTO1duohc7Uy58poAvoiEKu5F5KQ6VPf7hiNu', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
calculate the hash from a salt and a password
public function getPasswordHash($salt,$password) { return hash('whirlpool',$salt.$password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHash($plaintext, $salt = false);", "function getPasswordHash($password,$salt){\n\t\treturn hash('sha256',$salt.$password);\n}", "function getHash( $password, $salt = '' )\r\n{\r\n\treturn hash( 'sha256', $password . $salt );\r\n}", "public static function calculateHash($password, $salt = NULL)\n\t{\n\t\tif ($password === \\Nette\\Utils\\Strings::upper($password)) { // perhaps caps lock is on\n\t\t\t$password = \\Nette\\Utils\\Strings::lower($password);\n\t\t}\n\t\treturn crypt($password, $salt ?: '$2a$07$' . \\Nette\\Utils\\Strings::random(22));\n\t}", "public static function calculateHash($password, $salt = NULL)\r\n\t{\r\n\t\tif ($salt === NULL){\r\n $salt = '$2a$07$' . Nette\\Utils\\Strings::random(22);\r\n\t\t}\r\n\t\treturn crypt($password, $salt);\r\n\t}", "private function passwordHash($password, $salt){\n return md5($password.$salt);\n }", "function getHashedPass($password, $salt)\n{\n $saltedPass = $password . $salt;\n return hash('sha256', $saltedPass);\n}", "private function hashPw($salt, $password) {\n return md5($salt.$password);\n }", "public function calculateHash($password)\n\t{\n\t\treturn md5($password . str_repeat('*enter any random salt here*', 10));\n\t}", "function hashPassword($password, $salt) {\n\t$result = password_hash($password . $salt, PASSWORD_DEFAULT);\n\treturn $result;\n}", "function\nauth_hash($password, $salt = \"\")\n{\n // The password hash is crypt(\"password\", \"sha512-salt\")\n if ($salt == \"\")\n $salt = \"\\$6\\$\" . bin2hex(openssl_random_pseudo_bytes(8));\n\n return (crypt($password, $salt));\n}", "public static function generateHash($salt, $password) {\n $hash = crypt($password, $salt);\n return substr($hash, 29);\n }", "function _hashsaltpass($password)\n {\n $salted_hash = hash(\"sha512\", \"salted__#edsdfdwrsdse\". $password.\"salted__#ewr^&^$&e\");\n return $salted_hash;\n }", "function makeHash($password) {\r\n return crypt($password, makeSalt());\r\n}", "public function generateHash (string $password): string;", "public function hashPassword($password, $salt)\n {\n return md5($salt . $password);\n }", "public function hash($pwd, $salt = \"\") {\n return $this->generateHash($pwd, $salt, $this->sha1, $this->rounds);\n }", "public function hashPassword($password, $salt = '') {\n return md5($salt . $password);\n }", "function hashPassword($password) {\n $cost = 10;\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n return crypt($password, $salt);\n }", "public function checkhashSSHA($salt, $password)\r\n {\r\n \r\n $hash = base64_encode(sha1($password . $salt, true) . $salt);\r\n \r\n return $hash;\r\n }", "public function hashPass($pass, $salt){\n return crypt($pass, '$6$rounds=5000$'.$salt.'$');\n }", "public function saltPassword($salt, $password) {\n\n\t\t$salt = hex2bin ( $salt );\n\t\t\n\t\t$hashedPassword = hash ( 'sha256', $password );\n\t\t$hashedPassword = hex2bin ( $hashedPassword );\n\t\t\n\t\t$saltedPassword = hash ( 'sha256', $salt . $hashedPassword );\n\t\t$saltedPassword = strtolower ( $saltedPassword );\n\t\t\n\t\treturn $saltedPassword;\n\t\t\n\t\t$password = utf8_encode ( $password );\n\t\tvar_dump ( \"password: \" . $password );\n\t\tvar_dump ( \"salt: \" . $salt );\n\t\t\n\t\t$hashedPassword = hash ( 'sha256', $password );\n\t\t$hashedPassword = $password;\n\t\tvar_dump ( \"hashedPassword: \" . $hashedPassword );\n\t\t\n\t\t$hash = hash ( 'sha256', $salt . $hashedPassword );\n\t\tvar_dump ( \"hash: \" . $hash );\n\t\treturn $hash;\n\t\n\t}", "public function getHash($password, $salt = null)\n\t{\n\t\treturn $this->md5_hmac($password, $salt);\n\t}", "function checkhashSSHA($salt, $password) {\n\n $hash = base64_encode(sha1($password . $salt, true) . $salt);\n\n return $hash;\n}", "public function checkhashSSHA($salt, $password) {\n \n $hash = base64_encode(sha1($password . $salt, true) . $salt);\n \n return $hash;\n }", "public static function hash($password, $salt = null) {\n return crypt($password, $salt ?: static::salt());\n }", "public static function generateSaltedHashFromPassword($password) {\r\n return hash(self::HASH_ALGORITHM, $password.self::SALT);\r\n }", "function get_password_hash($password) {\n return crypt($password, \"$2a$07$\" . salt() . \"$\");\n}", "function gethashpass($password,$salt,$timestamp) {\n\t\t\t$ps = $password.$salt;\n\t\t\t$joinps = md5($ps);\n\t\t\t$timehash = md5($timestamp);\n\t\t\t$joinallstr = $joinps.$timehash;\n\t\t\t$hashpass = md5($joinallstr);\n\t\t\t$encodepass = substr(base64_encode($hashpass),0,32);\n\t\t\treturn $encodepass;\n\t\t}", "public static function make_hash($salt, $pass)\n {\n \t# Pass is plaintext atm...\n \treturn sha1($salt . $pass);\n }", "private function hashPassword($password, $salt)\n {\n $ret = $this->hasher->make($password, ['salt' => $salt]);\n\n return $ret;\n }", "public function PasswordHash($password, $isSalt = false) {\n\n if (strlen($password) > 72) {\n\n $password = substr($password, 0, 72);\n }\n\n $hashedPassword = \\FluitoPHP\\Filters\\Filters::GetInstance()->\n Run('FluitoPHP.Authentication.HashPassword', $password, $isSalt);\n\n if ($hashedPassword === $password) {\n\n $hashedPassword = password_hash($password, PASSWORD_BCRYPT);\n }\n\n return $hashedPassword;\n }", "private function create_hash($password, $salt) {\n $hash = '';\n for ($i = 0; $i < 20000; $i++) {\n $hash = hash('sha512', $hash . $salt . $password);\n }\n return $hash;\n }", "function getPasswordHash($password){\n\t\t$salt = $this->getPasswordSalt();\n\t\treturn $salt . ( hash('sha256', $salt . $password ) );\n\t}", "public static function hashPassword($password, $salt) {\r\n\t\treturn md5($salt . $password . $salt . self::$_saltAddon);\r\n\t}", "public function hash_password($password, $salt = FALSE)\n {\n \tif ($salt === FALSE)\n \t{\n \t\t// Create a salt seed, same length as the number of offsets in the pattern\n \t\t$salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->_config['salt_pattern']));\n \t}\n\n \t// Password hash that the salt will be inserted into\n \t$hash = $this->hash($salt.$password);\n\n \t// Change salt to an array\n \t$salt = str_split($salt, 1);\n\n \t// Returned password\n \t$password = '';\n\n \t// Used to calculate the length of splits\n \t$last_offset = 0;\n\n \tforeach ($this->_config['salt_pattern'] as $offset)\n \t{\n \t\t// Split a new part of the hash off\n \t\t$part = substr($hash, 0, $offset - $last_offset);\n\n \t\t// Cut the current part out of the hash\n \t\t$hash = substr($hash, $offset - $last_offset);\n\n \t\t// Add the part to the password, appending the salt character\n \t\t$password .= $part.array_shift($salt);\n\n \t\t// Set the last offset to the current offset\n \t\t$last_offset = $offset;\n \t}\n\n \t// Return the password, with the remaining hash appended\n \treturn $password.$hash;\n }", "public static function hashPassword($username,$password)\n {\n \t$options = [\n 'cost' => 11,\n 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n ];\n return password_hash($username.$password, PASSWORD_BCRYPT, $options);\n }", "public static function hash($pass, $salt) {\n return sha1($pass . $salt);\n }", "public function hash_password($password, $salt = FALSE)\n\t{\n\t\tif ($salt == FALSE)\n\t\t{\n\t\t\t// Create a salt string, same length as the number of offsets in the pattern\n\t\t\t$salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->config['salt_pattern']));\n\t\t}\n\n\t\t// Password hash that the salt will be inserted into\n\t\t$hash = $this->hash($salt.$password);\n\n\t\t// Change salt to an array\n\t\t$salt = str_split($salt, 1);\n\n\t\t// Returned password\n\t\t$password = '';\n\n\t\t// Used to calculate the length of splits\n\t\t$last_offset = 0;\n\n\t\tforeach($this->config['salt_pattern'] as $offset)\n\t\t{\n\t\t\t// Split a new part of the hash off\n\t\t\t$part = substr($hash, 0, $offset - $last_offset);\n\n\t\t\t// Cut the current part out of the hash\n\t\t\t$hash = substr($hash, $offset - $last_offset);\n\n\t\t\t// Add the part to the password, appending the salt character\n\t\t\t$password .= $part.array_shift($salt);\n\n\t\t\t// Set the last offset to the current offset\n\t\t\t$last_offset = $offset;\n\t\t}\n\n\t\t// Return the password, with the remaining hash appended\n\t\treturn $password.$hash;\n\t}", "public function GetPasswordHash ();", "function CreateHash($password){\n\t$salt = date('U'); //creates different password each time\n\t$pass = crypt($password, $salt);\n\treturn $pass;\n}", "function hash_password($password){\n\t// Hashing options\n\t$options = [\n 'cost' => 12,\t// Cost determines the work required to brute-force\n //'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n\t];\n\n\treturn password_hash($password, PASSWORD_BCRYPT, $options);\n}", "public function hash_password($password, $salt = false) {\n\n\t\t// Create a salt seed, same length as the number of offsets in the pattern\n\t\tif ($salt === false) {\n\t\t\t$salt = substr(hash($this->config['hash_method'], uniqid(null, true)), 0, count($this->config['salt_pattern']));\n\t\t}\n\n\t\t// Password hash that the salt will be inserted into\n\t\t$hash = hash($this->config['hash_method'], $salt . $password);\n\n\t\t// Change salt to an array\n\t\t$salt = str_split($salt, 1);\n\n\t\t// Returned password\n\t\t$password = '';\n\n\t\t// Used to calculate the length of splits\n\t\t$last_offset = 0;\n\n\t\tforeach ($this->config['salt_pattern'] as $offset) {\n\n\t\t\t// Split a new part of the hash off\n\t\t\t$part = substr($hash, 0, $offset - $last_offset);\n\n\t\t\t// Cut the current part out of the hash\n\t\t\t$hash = substr($hash, $offset - $last_offset);\n\n\t\t\t// Add the part to the password, appending the salt character\n\t\t\t$password .= $part . array_shift($salt);\n\n\t\t\t// Set the last offset to the current offset\n\t\t\t$last_offset = $offset;\n\n\t\t}\n\n\t\t// Return the password, with the remaining hash appended\n\t\treturn $password . $hash;\n\t}", "function pw_hash($password)\n{\n // A higher \"cost\" is more secure but consumes more processing power\n $cost = 10;\n\n // Create a random salt\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n\n // Prefix information about the hash so PHP knows how to verify it later.\n // \"$2a$\" Means we're using the Blowfish algorithm. The following two digits are the cost parameter.\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n\n // Hash the password with the salt\n $hashed = crypt($password, $salt);\n\n return $hashed;\n}", "function hashPass($pass, $salt){\n while(strlen($pass) > strlen($salt)){\n $salt = $salt.$salt;\n }\n while(strlen($salt) > strlen($pass)){\n $salt = substr($salt, 0, -1);\n }\n\n $hashable = saltPass($pass, $salt);\n\n //Hash the hashable string a couple of times\n $hashedData = $hashable;\n for($i = 0; $i < 10000; $i++){\n $hashedData = hash('sha512', $hashedData);\n }\n\n return $hashedData;\n}", "private function hash_password($password, $salt)\r\n\t{\r\n\t\t//truncate the user's salt and the defined salt from the config file\r\n\t\t$salt_to_use = $salt . SALT;\r\n\t\t//Hash it with the sha512 algorithm.\r\n\t\t$hashed_pass = hash_hmac('sha512', $password, $salt_to_use);\r\n\r\n\t\treturn $hashed_pass;\r\n\t}", "public function calculateHash($password)\n {\n return hash(self::ALGORITHM, $password);\n }", "public function hash_user_pass($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n\n//PASSWORD_DEFAULT is a default function in PHP it contains BCRYPT algo at backend PHP is using BCRYPT currently\n//as it is most secure password hashing algorithm using today the term DEFAULT means that if another hashing algorithm is introduced in\n//future it will automatically updated to the library ny PHP so the developer has no need to update in the code.\n $hashing = password_hash($password.$salt, PASSWORD_DEFAULT);\n $hash = array(\"salt\" => $salt, \"hashing\" => $hashing);\n\n return $hash;\n\n}", "public function hashPassword($password, $salt = FALSE) {\n\n $this->generateSalt();\n\n if ($salt === FALSE) {\n // Create a salt seed, same length as the number of offsets in the pattern\n $salt = substr($this->hash(uniqid(NULL, TRUE)), 0, count($this->salt_pattern));\n }\n\n // Password hash that the salt will be inserted into\n $hash = $this->hash($salt . $password);\n\n // Change salt to an array\n $salt = str_split($salt, 1);\n\n\n // Returned password\n $password = '';\n\n // Used to calculate the length of splits\n $last_offset = 0;\n\n foreach ($this->salt_pattern as $i => $offset) {\n // Split a new part of the hash off\n $part = substr($hash, 0, $offset - $last_offset);\n\n // Cut the current part out of the hash\n $hash = substr($hash, $offset - $last_offset);\n\n // Add the part to the password, appending the salt character\n $password .= $part . array_shift($salt);\n\n // Set the last offset to the current offset\n $last_offset = $offset;\n }\n // Return the password, with the remaining hash appended\n return $password . $hash;\n }", "public function getPasswordHashOfUser($username,$password){\r\n\t$options = array('cost'=>12, 'salt'=>md5(strtolower($username)));\r\n\treturn password_hash($password, PASSWORD_DEFAULT, $options);\r\n}", "function my_password_hash($password)\n{\n $salt = createSalt();\n $hash = md5($salt.$password);\n return array(\"hash\" => $hash, \"salt\" => $salt);\n}", "public static function makePassHash($password, $username, $salt='')\n\t\t{\n\n\t\t\tif($salt == '') {\n\t\t\t\t$salt = Util::makeSalt();\n\t\t\t}\n\t\t\t\n\t\t\t$hash = sha1($username.$password.$salt);\n\t\t\treturn $salt.\"|\".$hash;\n\t\t}", "public static function hash( $password, $salt=NULL )\n\t{\n\t\t//create random salt\n\t\tif( $salt === NULL )\n\t\t\t$salt = mcrypt_create_iv(4, MCRYPT_DEV_URANDOM);\n\n\t\t//return hash string\n\t\treturn \"{SSHA512}\" . base64_encode( hash( \"sha512\", $password . $salt, TRUE ) . $salt );\n\t}", "private function HashPassword(string $password)\n\t{\n\t\t/* Create a random salt */\n\t\t$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n\t\t\n\t\t/*\t\"$2a$\" means the Blowfish algorithm,\n\t\t *\tthe following two digits are the cost parameter.\n\t\t */\n\t\t$salt = sprintf(\"$2a$%02d$\", 10) . $salt;\n\t\t\n\t\treturn crypt($password, $salt);\n\t}", "function password_hash($password, $algo, array $options = array()) {\r\n if (!function_exists('crypt')) {\r\n trigger_error(\"Crypt must be loaded for password_hash to function\", E_USER_WARNING);\r\n return null;\r\n }\r\n if (is_null($password) || is_int($password)) {\r\n $password = (string) $password;\r\n }\r\n if (!is_string($password)) {\r\n trigger_error(\"password_hash(): Password must be a string\", E_USER_WARNING);\r\n return null;\r\n }\r\n if (!is_int($algo)) {\r\n trigger_error(\"password_hash() expects parameter 2 to be long, \" . gettype($algo) . \" given\", E_USER_WARNING);\r\n return null;\r\n }\r\n $resultLength = 0;\r\n switch ($algo) {\r\n case PASSWORD_BCRYPT:\r\n $cost = PASSWORD_BCRYPT_DEFAULT_COST;\r\n if (isset($options['cost'])) {\r\n $cost = $options['cost'];\r\n if ($cost < 4 || $cost > 31) {\r\n trigger_error(sprintf(\"password_hash(): Invalid bcrypt cost parameter specified: %d\", $cost), E_USER_WARNING);\r\n return null;\r\n }\r\n }\r\n// The length of salt to generate\r\n $raw_salt_len = 16;\r\n// The length required in the final serialization\r\n $required_salt_len = 22;\r\n $hash_format = sprintf(\"$2y$%02d$\", $cost);\r\n// The expected length of the final crypt() output\r\n $resultLength = 60;\r\n break;\r\n default:\r\n trigger_error(sprintf(\"password_hash(): Unknown password hashing algorithm: %s\", $algo), E_USER_WARNING);\r\n return null;\r\n }\r\n $salt_req_encoding = false;\r\n if (isset($options['salt'])) {\r\n switch (gettype($options['salt'])) {\r\n case 'NULL':\r\n case 'boolean':\r\n case 'integer':\r\n case 'double':\r\n case 'string':\r\n $salt = (string) $options['salt'];\r\n break;\r\n case 'object':\r\n if (method_exists($options['salt'], '__tostring')) {\r\n $salt = (string) $options['salt'];\r\n break;\r\n }\r\n case 'array':\r\n case 'resource':\r\n default:\r\n trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);\r\n return null;\r\n }\r\n if (_strlen($salt) < $required_salt_len) {\r\n trigger_error(sprintf(\"password_hash(): Provided salt is too short: %d expecting %d\", _strlen($salt), $required_salt_len), E_USER_WARNING);\r\n return null;\r\n } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {\r\n $salt_req_encoding = true;\r\n }\r\n } else {\r\n $buffer = '';\r\n $buffer_valid = false;\r\n if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\r\n $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\r\n if ($buffer) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\r\n $buffer = openssl_random_pseudo_bytes($raw_salt_len);\r\n if ($buffer) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid && @is_readable('/dev/urandom')) {\r\n $file = fopen('/dev/urandom', 'r');\r\n $read = _strlen($buffer);\r\n while ($read < $raw_salt_len) {\r\n $buffer .= fread($file, $raw_salt_len - $read);\r\n $read = _strlen($buffer);\r\n }\r\n fclose($file);\r\n if ($read >= $raw_salt_len) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid || _strlen($buffer) < $raw_salt_len) {\r\n $buffer_length = _strlen($buffer);\r\n for ($i = 0; $i < $raw_salt_len; $i++) {\r\n if ($i < $buffer_length) {\r\n $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\r\n } else {\r\n $buffer .= chr(mt_rand(0, 255));\r\n }\r\n }\r\n }\r\n $salt = $buffer;\r\n $salt_req_encoding = true;\r\n }\r\n if ($salt_req_encoding) {\r\n// encode string with the Base64 variant used by crypt\r\n $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n $base64_string = base64_encode($salt);\r\n $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\r\n }\r\n $salt = _substr($salt, 0, $required_salt_len);\r\n $hash = $hash_format . $salt;\r\n $ret = crypt($password, $hash);\r\n if (!is_string($ret) || _strlen($ret) != $resultLength) {\r\n return false;\r\n }\r\n return $ret;\r\n }", "function _hash_password($password)\n {\n //return altered pw\n\n }", "public static function hash($password, $salt, $iterationCount = Pbkdf2::HASH_ITERATIONS) {\n\t\t$hash\t= $password;\n\t\tfor ($i = 0; $i < $iterationCount; ++$i) {\n\t\t\t$hash\t= strtolower(hash('sha256', self::POMPOUS_SECRET . $hash . $salt));\n\t\t}\n\n\t\treturn $hash;\n\t}", "public function hash(string $password, string $salt = null) : string\n {\n $encodedSalt = $this->saltShaker->encode($salt);\n\n return crypt($password, $encodedSalt);\n }", "private function encryptPassword($password, $salt) {\n\t\treturn hash('sha256', strrev($GLOBALS[\"random1\"] . $password . $salt . 'PIZZAPHP'));\n\t}", "function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\n}", "protected function getSaltedHash($password, $salt = null) {\n StringValidator::validate($password, array(\n 'min_length' => self::MIN_LENGTH,\n 'max_length' => self::MAX_LENGTH\n ));\n \n if (is_null($salt)) {\n $salt = substr(Crypto::getRandom64HexString(), 0, self::SALT_LENGTH);\n } else {\n StringValidator::validate($salt, array(\n 'min_length' => self::SALT_LENGTH\n ));\n $salt = substr($salt, 0, self::SALT_LENGTH);\n }\n\n return $salt . hash(self::HASH_ALGORITHM, $salt . $password);\n }", "function HashPassword($input)\n{\n//Credits: http://crackstation.net/hashing-security.html\n//This is secure hashing the consist of strong hash algorithm sha 256 and using highly random salt\n$salt = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)); \n$hash = hash(\"sha256\", $salt . $input); \n$final = $salt . $hash; \nreturn $final;\n}", "function getPasswordHash($password)\r\n {\r\n return ( hash( 'whirlpool', $password ) );\r\n }", "public static function hash($password) {\n\n return crypt($password, self::$algo .\n self::$cost .\n '$' . self::uniqueSalt());\n }", "function deriveKeyFromUserPassword( string $password, string $salt ) : string\n{\n\t$outLength = SODIUM_CRYPTO_SIGN_SEEDBYTES;\n\t$seed = sodium_crypto_pwhash(\n\t\t$outLength,\n\t\t$password,\n\t\t$salt,\n\t\tSODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,\n\t\tSODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE\n\t);\n\n\treturn $seed;\n}", "public function hashPassword($password)\t{\n\t\treturn crypt($password, $this->generateSalt());\n\t}", "function generateHash($plainText, $salt = null) // used in confirm-password.php, class.newuser.php, class.user.php, user-login.php, user-update-account.php\r\n\r\n{\r\n\r\n\tif ($salt === null)\r\n\r\n\t{\r\n\r\n\t\t$salt = substr(md5(uniqid(rand(), true)), 0, 25);\r\n\r\n\t}\r\n\r\n\telse\r\n\r\n\t{\r\n\r\n\t\t$salt = substr($salt, 0, 25);\r\n\r\n\t}\r\n\r\n\t\r\n\r\n\treturn $salt . sha1($salt . $plainText);\r\n\r\n}", "function salt_and_encrypt($password) {\n\t$hash_format=\"$2y$10$\";\n\t$salt_length=22;\n\t$salt=generate_salt($salt_length);\n\t$format_and_salt=$hash_format.$salt;\n\t$hash=crypt($password,$format_and_salt);\t\n\treturn $hash;\n}", "public function hash($password, $username) {\n return crypt($password, $username);\n }", "public function hash_password($password)\n {\n return password_hash($password, PASSWORD_BCRYPT, array('cost' => 13));\n }", "public static function hash($password){\n\t\t\treturn password_hash($password, PASSWORD_DEFAULT, self::getCost());\n\t\t}", "public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}", "private function calcPasswdHash($login,$password){\n return hash(self::PASSWDHASH,self::AESKEY.$login.$password);\n }", "function getHash($username, $password) {\n return sha1(strtolower($username).$password);\n }", "private function hashPassword($password)\n {\n return password_hash($password, PASSWORD_BCRYPT);\n\t}", "function hashSSHA($password) {\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n}", "public static function hashPassword($password){\n $config = App_DI_Container::get('ConfigObject');\n $module = strtolower(CURRENT_MODULE);\n return sha1($config->{$module}->security->passwordsalt . $password);\n //return sha1($password);\n }", "private function Hasher($password) {\r\n return password_hash($password, PASSWORD_BCRYPT);\r\n }", "public function createHash($password){\r\n $options = [\r\n 'cost' => 10,\r\n ];\r\n $hash = password_hash($password, PASSWORD_DEFAULT, $options);\r\n return $hash;\r\n}", "function get_password_hash( $password )\r\n\t\t{\r\n\t\t\treturn hash_hmac( 'sha256', $password, 'c#haRl891', false );\r\n\t\t\t\r\n\t\t}", "private function newHash()\n {\n $salt = hash('sha256', uniqid(mt_rand(), true) . 't33nh4sh' . strtolower($this->email));\n\n // Prefix the password with the salt\n $hash = $salt . $this->password;\n \n // Hash the salted password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hash = hash('sha256', $hash);\n }\n \n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n \n return $hash;\n }", "private function hashPass($password) {\n\t\t// Hash that password\n $hashed_password = password_hash(\"$password\", PASSWORD_DEFAULT);\n return $hashed_password;\n }", "function generate_hash($password, $cost = 12)\n{\n /* To generate the salt, first generate enough random bytes. Because\n * base64 returns one character for each 6 bits, the we should generate\n * at least 22*6/8=16.5 bytes, so we generate 17. Then we get the first\n * 22 base64 characters\n */\n\n $salt = substr(base64_encode(openssl_random_pseudo_bytes(17)), 0, 22);\n\n /* As blowfish takes a salt with the alphabet ./A-Za-z0-9 we have to\n * replace any '+' in the base64 string with '.'. We don't have to do\n * anything about the '=', as this only occurs when the b64 string is\n * padded, which is always after the first 22 characters.\n */\n\n $salt = str_replace(\"+\", \".\", $salt);\n\n /* Next, create a string that will be passed to crypt, containing all\n * of the settings, separated by dollar signs\n */\n\n $param = '$' . implode('$', array(\n \"2y\", // select the most secure version of blowfish (>=PHP 5.3.7)\n str_pad($cost, 2, \"0\", STR_PAD_LEFT), // add the cost in two digits\n $salt, // add the salt\n ));\n\n // now do the actual hashing\n\n return crypt($password, $param);\n}", "public static function createHashPassword($originalPassword, $passwordSalt)\r\n {\r\n return md5(substr($passwordSalt,3,23).md5($originalPassword).md5(USER_PASSWORD_SALT));\r\n }", "function wp_hash_password( $password ) {\n\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\treturn password_hash( $password, PASSWORD_DEFAULT, [ 'cost' => $cost ] );\n\t}", "public function hashPassword($password)\n {\n return crypt($password, $this->blowfishSalt());\n }", "private function hashPassword($password)\n {\n $salt = md5(BaseConfig::PASSWORD_SALT);\n return sha1($salt . $password);\n }", "function hashSSHA($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }", "public function hashPassword($password)\n\t{\n\t\treturn crypt($password, $this->generateSalt());\n\t}", "function saltPassword($tempPassword)\n{\n\t$salt1 = \"qm\\$h*\";\n\t$salt2 = \"pg!@\";\n\t$token = hash('ripemd128', \"$salt1$tempPassword$salt2\");\n\treturn $token;\n}", "function getCryptHash($str)\n{\n $salt = '';\n if (CRYPT_BLOWFISH) {\n if (version_compare(PHP_VERSION, '5.3.7') >= 0) { // http://www.php.net/security/crypt_blowfish.php\n $algo_selector = '$2y$';\n } else {\n $algo_selector = '$2a$';\n }\n $workload_factor = '12$'; // (around 300ms on Core i7 machine)\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . $workload_factor . getRandomStr($res_arr, 22); // './0-9A-Za-z'\n \n } else if (CRYPT_MD5) {\n $algo_selector = '$1$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . getRandomStr($range, 12); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_SHA512) {\n $algo_selector = '$6$';\n $workload_factor = 'rounds=5000$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . $workload_factor . getRandomStr($range, 16); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_SHA256) {\n $algo_selector = '$5$';\n $workload_factor = 'rounds=5000$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . $workload_factor . getRandomStr($range, 16); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_EXT_DES) {\n $algo_selector = '_';\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . getRandomStr($res_arr, 8); // './0-9A-Za-z'.\n \n } else if (CRYPT_STD_DES) {\n $algo_selector = '';\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . getRandomStr($res_arr, 2); // './0-9A-Za-z'\n \n }\n return crypt($str, $salt);\n}", "public static function hash_pbkdf2($password, $salt){\n $algorithm = \"sha256\";\n $count = 1000;\n $key_length = 64;\n $raw_output = false;\n \n if(!in_array($algorithm, hash_algos(), true))\n trigger_error('PBKDF2 ERROR: Invalid hash algorithm.', E_USER_ERROR);\n if($count <= 0 || $key_length <= 0)\n trigger_error('PBKDF2 ERROR: Invalid parameters.', E_USER_ERROR);\n\n if (function_exists(\"hash_pbkdf2\")) {\n // The output length is in NIBBLES (4-bits) if $raw_output is false!\n if (!$raw_output) {\n $key_length = $key_length * 2;\n }\n return hash_pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output);\n }\n\n $hash_length = strlen(hash($algorithm, \"\", true));\n $block_count = ceil($key_length / $hash_length);\n\n $output = \"\";\n for($i = 1; $i <= $block_count; $i++) {\n // $i encoded as 4 bytes, big endian.\n $last = $salt . pack(\"N\", $i);\n // first iteration\n $last = $xorsum = hash_hmac($algorithm, $last, $password, true);\n // perform the other $count - 1 iterations\n for ($j = 1; $j < $count; $j++) {\n $xorsum ^= ($last = hash_hmac($algorithm, $last, $password, true));\n }\n $output .= $xorsum;\n }\n\n if($raw_output)\n return substr($output, 0, $key_length);\n else\n return bin2hex(substr($output, 0, $key_length));\n }", "public function hash($data, $salt)\n {\n return md5($data . '-' . $salt);\n }", "public function salt_password($password, $salt)\n {\n return md5(md5($salt) . $password);\n }", "public static function getHashFromPassword(string $password)\n {\n //@TODO implementing several algos\n return password_hash($password, self::$hashAlgo);\n }", "protected static function crypt_md5($password, $salt) {\n $salt = substr($salt, 0, 12);\n if (!isset($salt[11])) return false;\n\n $cost = substr($salt, 0, 3);\n if ($cost !== '$P$' && $cost !== '$H$') return false;\n\n $cost = strpos(self::$itoa64, $salt[3]);\n if ($cost < 7 || $cost > 30) return false;\n\n $cost = 1 << $cost;\n\n $hash = md5(substr($salt, 4, 8) . $password, true);\n do $hash = md5($hash . $password, true);\n while (--$cost);\n\n do {\n $v = ord($hash[$cost++]);\n $salt .= self::$itoa64[$v & 0x3F];\n if ($cost < 16) $v |= ord($hash[$cost]) << 8;\n $salt .= self::$itoa64[($v >> 6) & 0x3F];\n if ($cost++ >= 16) break;\n if ($cost < 16) $v |= ord($hash[$cost]) << 16;\n $salt .= self::$itoa64[($v >> 12) & 0x3F];\n if ($cost++ >= 16) break;\n $salt .= self::$itoa64[($v >> 18) & 0x3F];\n } while ($cost < 16);\n\n return $salt;\n }", "public function generateHash($input,$salt)\n {\n $hash_columns = [\n 'address_line_1',\n 'address_line_2',\n 'amount',\n 'api_key',\n 'city',\n 'country',\n 'currency',\n 'description',\n 'email',\n 'mode',\n 'name',\n 'order_id',\n 'phone',\n 'return_url',\n 'state',\n 'udf1',\n 'udf2',\n 'udf3',\n 'udf4',\n 'udf5',\n 'zip_code',\n ];\n\n /*Sort the array before hashing*/\n ksort($hash_columns);\n\n /*Create a | (pipe) separated string of all the $input values which are available in $hash_columns*/\n $hash_data = $salt;\n foreach ($hash_columns as $column) {\n if (isset($input[$column])) {\n if (strlen($input[$column]) > 0) {\n $hash_data .= '|' . $input[$column];\n }\n }\n }\n\n /* Convert the $hash_data to Upper Case and then use SHA512 to generate hash key */\n $hash = null;\n if (strlen($hash_data) > 0) {\n $hash = strtoupper(hash(\"sha512\", $hash_data));\n }\n\n return $hash;\n\n }", "function hash_password($username, $password) {\n\t\t//if there is no password, then the hash will be of the username\n\t\tif(!isset($password) || $password === '') {\n\t\t\treturn md5($username);\n\t\t}\n\t\t\n\t\t$hashed_user = md5($username);\n\t\t$hashed_pass = md5($password);\n\t\t$hash = \"\";\n\t\tfor ($i=0; $i < 32; ++$i) { \n\t\t\t$hash .= $hashed_user[$i] . $hashed_pass[$i];\n\t\t}\n\t\treturn md5($hash);\n\t}", "function cafet_generate_hashed_pwd(string $password): string\n {\n $salt = base64_encode(random_bytes(32));\n $algo = in_array(Config::hash_algo, hash_algos()) ? Config::hash_algo : 'sha256';\n \n return $algo . '.' . $salt . '.' . cafet_digest($algo, $salt, $password);\n }", "public static function make($string, $salt = ''){\n return hash('sha256', $string . $salt);\n }" ]
[ "0.8000154", "0.792624", "0.7875374", "0.77660835", "0.7694312", "0.7682023", "0.76436245", "0.76034766", "0.7601997", "0.75511366", "0.75480235", "0.74727935", "0.7361804", "0.73225516", "0.7320579", "0.7308873", "0.73048615", "0.73025006", "0.7281019", "0.7269301", "0.7264945", "0.72610646", "0.72545624", "0.72485447", "0.7213577", "0.721093", "0.72047645", "0.7203769", "0.7179174", "0.714874", "0.7127154", "0.71254855", "0.7112926", "0.7083956", "0.70834994", "0.70747733", "0.70575583", "0.7055848", "0.70420456", "0.70338875", "0.70316285", "0.70252156", "0.7019514", "0.6996464", "0.69696397", "0.6952215", "0.69179374", "0.6904846", "0.69030243", "0.68552554", "0.6852744", "0.6852249", "0.6836086", "0.68243814", "0.6814923", "0.681008", "0.68058175", "0.6803554", "0.6798653", "0.6795187", "0.6791427", "0.6784574", "0.67799616", "0.6775663", "0.6755127", "0.67357844", "0.6734581", "0.67126364", "0.6709708", "0.67015594", "0.6683017", "0.66814756", "0.6675952", "0.6667361", "0.66622764", "0.6649713", "0.6648189", "0.6621305", "0.6616047", "0.6610987", "0.6604081", "0.6594999", "0.6583771", "0.65826756", "0.6547249", "0.65454066", "0.6538832", "0.6538072", "0.65257275", "0.652503", "0.65179586", "0.6512427", "0.65112704", "0.65076685", "0.6505684", "0.6502666", "0.650209", "0.6477004", "0.64765245", "0.6455619" ]
0.77189004
4
compare a password to a hash
public function comparePassword($password,$hash) { $salt = substr( $hash, 0, 8 ); return $hash == getPasswordHash($salt,$password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function comparePasswordHash($pwd, $hash);", "public function verifyPassword (string $hash, string $password): bool;", "function comparePassword($password, $hash){\t\n\t\t$salt = substr($hash, 0, 8);\n\t\treturn $hash === $salt . ( hash('sha256', $salt . $password ));\n\t}", "function verifyHash($password, $hash) {\r\n return $hash == crypt($password, $hash);\r\n}", "public function verify($password, $hash);", "public function validateHash($password, $hash);", "function validate_pw($password, $hash){\n /* Regenerating the with an available hash as the options parameter should\n * produce the same hash if the same password is passed.\n */\n return crypt($password, $hash)==$hash;\n }", "function password_is_hash($password)\r\n{\r\n $nfo = password_get_info($password);\r\n return $nfo['algo'] != 0;\r\n}", "function password_verify($password, $hash) {\n return crypt($password,$hash) === $hash;\n }", "function password_verify($password, $hash) {\r\n if (!function_exists('crypt')) {\r\n trigger_error(\"Crypt must be loaded for password_verify to function\", E_USER_WARNING);\r\n return false;\r\n }\r\n $ret = crypt($password, $hash);\r\n if (!is_string($ret) || strlen($ret) != _strlen($hash) || _strlen($ret) <= 13) {\r\n return false;\r\n }\r\n $status = 0;\r\n for ($i = 0; $i < _strlen($ret); $i++) {\r\n $status |= (ord($ret[$i]) ^ ord($hash[$i]));\r\n }\r\n return $status === 0;\r\n }", "function checkPassword($password,$salt,$hash){\n\t\n\t$haschedpw = hash('sha256',$salt.$password);\n\t\n\tif (trim($haschedpw) == trim($hash)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "static function password_verify($password, $hash) {\n $ret = substr($hash, 0, 3);\n if (!isset($hash[12])) return false;\n\n if ('$P$' === $ret || '$H$' === $ret) {\n $ret = self::crypt_md5($password, $hash);\n } else {\n/**/ if (!function_exists('crypt')) {\n trigger_error(\"Crypt must be loaded for password_verify to function\", E_USER_WARNING);\n return false;\n/**/ }\n\n/**/ if (PASSWORD_DEFAULT && !$bcrypt_2y)\n if ('$' === $hash[3] && ('$2x' === $ret || '$2y' === $ret)) $hash[2] = 'a';\n\n $ret = crypt($password, $hash);\n }\n\n if (!is_string($ret) || strlen($ret) != strlen($hash) || strlen($ret) <= 13) {\n return false;\n }\n\n $status = 0;\n $i = strlen($ret);\n while ($i-- > 0) {\n $status |= (ord($ret[$i]) ^ ord($hash[$i]));\n }\n\n return $status === 0;\n }", "static function check($password, $hash) {\n if (starts_with($hash, '$2a$')) {\n $salt = substr($hash, 0, 19);\n }elseif (starts_with($hash, '$6$')) {\n $salt = substr($hash, 0, 19);\n }else{\n throw new Exception('Unknown hash type: '.$hash);\n }\n return crypt($password, $salt) === $hash;\n }", "function leonardo_check_password($password,$hash) {\n\treturn leonardo_check_hash($password, $hash);\n}", "function password_check($password, $existing_hash) {\n\t// existing hash contains format and salt at start\n $hash = crypt($password, $existing_hash);\n if ($hash === $existing_hash) {\n return true;\n } else {\n return false;\n }\n}", "function comparePassword($password, $hashedPassword) {\n return crypt($password, $hashedPassword) == $hashedPassword;\n}", "public function compareHash($password){\n if($this->password == $password){\n return true;\n }\n \n return false;\n }", "public function hash_check($user,$pass){\r\n //check if password matches hash \r\n $hash=array();\r\n $hash= checkLoginInfoTest($user);\r\n foreach ($hash as $hashItem):\r\n $hashGiven=(string)$hashItem['password'];\r\n endforeach;\r\n if (isset($hashGiven)){\r\n if (password_verify($pass,(string)$hashGiven))\r\n { \r\n return true;\r\n } \r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n \r\n \r\n}", "public static function compareHashAndString($password,$hash) {\n\t$prefix = substr($hash,0,16);\n\t$postfix = substr($hash,144,16);\n\t$hashedInput = $prefix.self::hash($prefix.$password.$postfix).$postfix;\n\treturn ($hashedInput == $hash);\n }", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "function phpbb_check_hash($password, $hash)\n{\n\t$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\tif (strlen($hash) == 34)\n\t{\n\t\treturn (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;\n\t}\n\n\treturn (md5($password) === $hash) ? true : false;\n}", "public function verify_hash_pass($password, $hash) {\n\n return password_verify ($password, $hash);\n}", "function password_check($password, $existing_hash) {\n\t # existing hash contains format and salt at start\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } \n\t else {\n\t return false;\n\t }\n\t}", "function leonardo_check_hash($password, $hash)\n{\n $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n if (strlen($hash) == 34)\n {\n return (_leonardo_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;\n }\n\n return (md5($password) === $hash) ? true : false;\n}", "function verify($password, $hashedPassword) {\n return crypt($password, $hashedPassword) == $hashedPassword;\n}", "function password_check($password, $existing_hash) {\n\t$hash = crypt($password, $existing_hash);\n\tif ($hash === $existing_hash) {\n\t return true;\n\t} else {\n\t return false;\n\t}\n }", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "function password_check($password, $existing_hash) {\n\t $hash = crypt($password, $existing_hash);\n\t if ($hash === $existing_hash) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t}", "function verifyHash(string $hash, string $string): bool\n{\n return ($hash == crypt($string, $hash));\n}", "function password_check($password, $existing_hash){\n\t\t$hash = crypt($password, $existing_hash);\n\t\tif($hash === $existing_hash){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function password_check($password, $existing_hash) {\n\t$hash = crypt($password, $existing_hash);\n\tif ($hash === $existing_hash) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function check($password, $hash) {\n\t\treturn Hash::compare($hash, crypt($password, $hash));\n\t}", "function password_check($submitted_password, $existing_hash) {\r\n\t\t$hash = crypt($submitted_password, $existing_hash);\r\n\t\tif ($hash === $existing_hash) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function passwd_verify(string $password, string $hash): bool\n{\n return password_verify($password, $hash);\n}", "public function isPassword($password);", "public static function authenticate($password,$hash) {\r\n\t\t$new_hash = md5($password);\r\n\t\treturn ($hash == $new_hash);\r\n\t}", "public static function compare($password, $hash){\n\t\t\treturn password_verify($password, $hash);\n\t\t}", "function compare_hashed_pass($clientPass, $dbPass){\n\t\n\t//Result is a boolean used to determin if the passwords match\n\t$result = 0;\n\n\n\t$config_options = getConfigOptions();\n\t$pepper = $config_options['pepper'];\n\n\t$hashedPass = password_hash($clientPass.$pepper, PASSWORD_DEFAULT, $config_options['peppercost'] );\n\n\techo \"<p>Clients pass: \" . $clientPass . \"</p>\";\n\techo \"<p>Clients hashed pass: \" . $hashedPass . \"</p>\";\n\techo \"<p>Servers pass: \" . $dbPass . \"</p>\";\n\n\n\t//Get pepper options\n\t// require_once 'api-config.php';\n\n\tif(password_verify($clientPass.$pepper, $dbPass)){\n\t\t//Passwords match\n\t\treturn $result = 1;\n\t} else{\n\t\t//Passwords don't match\n\t\treturn $result = 0;\n\t}\n\n\treturn $result;\n}", "public function matchPassword($password){\n if($this->password == hash('sha512', $password)){\n return true;\n }\n return false;\n }", "public static function isPasswordHash(string $hash) : bool\n {\n return preg_match(\"`\\\\$2y\\\\$10\\\\$`\", $hash) > 0;\n }", "function match_current_passwd($puuid, $given) {\n $sql = \"SELECT passwordtype, password FROM passwords WHERE puuid=$1\";\n $res = pg_query_params($sql, array($puuid));\n\n while($tuple = pg_fetch_assoc($res)) { \n if(hpcman_hash($tuple['passwordtype'], $given) == $tuple['password'])\n return true;\n }\n \n return false;\n}", "function getPasswordHash($password)\r\n {\r\n return ( hash( 'whirlpool', $password ) );\r\n }", "public function GetPasswordHash ();", "function wp_check_password($password, $hash, $user_id = '')\n {\n }", "function passwordMatch($id, $password) {\n \n $userdata = $this->getUserDataByUserId($id);\n \n // use pass word verify to decrypt the pass stored in the database and compare it eith the one user provided\n if(password_verify($password,$userdata['pwd'])) {\n return true;\n } else {\n return false;\n }\n \n \n }", "function verify($password, $hashedPassword) {\n // return crypt($password, $hashedPassword) == $hashedPassword;\n $verify = password_verify($password, $hashedPassword);\n return (int)$verify;\n }", "public function verify($password, $securePass);", "function check() {\r\n static $pass = NULL;\r\n if (is_null($pass)) {\r\n if (function_exists('crypt')) {\r\n $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG';\r\n $test = crypt(\"password\", $hash);\r\n $pass = $test == $hash;\r\n } else {\r\n $pass = false;\r\n }\r\n }\r\n return $pass;\r\n }", "function checkIfPasswordsMatch($password1, $password2) {\r\n return $password1 == $password2;\r\n}", "public static function check($password, $hash) {\n return static::compare(crypt($password, $hash), $hash);\n }", "function validate_password($hashed_password, $cleartext_password) {\n if (!is_string($hashed_password) || !is_string($cleartext_password))\n return false;\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n $salt_end = strrpos($hashed_password, \"$\");\n if ($salt_end === false) {\n // DES, first two charachers is salt.\n $salt = substr($hashed_password, 0, 2);\n } else {\n // Salt before $.\n $salt_end++;\n $salt = substr($hashed_password, 0, $salt_end);\n }\n return crypt($cleartext_password, $salt) == $hashed_password;\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n if (strlen($hashed_password) != 80)\n return false;\n $salt = substr($hashed_password, 0, 40);\n $hash = substr($hashed_password, 40);\n return $hash == sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n if (strlen($hashed_password) != 64)\n return false;\n $salt = substr($hashed_password, 0, 32);\n $hash = substr($hashed_password, 32);\n return $hash == sha1($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}", "function verifyPassword($password)\n {\n $this->getById();\n $date = $this->created_date;\n $date = strtotime($date);\n $year = date('Y', $date);\n $salt = 'ISM';\n $tempHash = $password . (string) $date . (string) $salt;\n for ($i = 0; $i < $year; $i++) $tempHash = md5($tempHash);\n return $tempHash === $this->password;\n }", "function _hash_password($password)\n {\n //return altered pw\n\n }", "function check_password($password)\n{\n return ($password == 'qwerty');\n}", "public function verify($password): bool;", "public function generateHash (string $password): string;", "function confirmUserPass($username,$password) {\n\t\tglobal $database;\n\t\t$query = \"SELECT password FROM \".TBL_USERS.\" WHERE username = ?\";\n\t\t$stmt = $database->prepare($query);\n\t\t$stmt->bind_param(\"s\", $username);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($hash);\n\t\t$stmt->fetch();\n\t\t$stmt->close();\n\t\tif($hash == null){\n\t\t\treturn 0;\n\t\t}\n\t\t$result = $this->comparePassword($password, $hash);\n\t\treturn $result;\n\t}", "public function isValidPassword($uid, $password);", "public static function verifyPassword($username,$password,$hash)\n {\n $result = false;\n \tif (password_verify($username.$password, $hash)) {\n $result = true; \n }\n return $result;\n }", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "function validate_password($plain, $encrypted) {\n if ($plain != \"\" && $encrypted != \"\") {\n// split apart the hash / salt\n $stack = explode(':', $encrypted);\n\n if (sizeof($stack) != 2) return false;\n\n if (md5($stack[1] . $plain) == $stack[0]) {\n return true;\n }\n }\n\n return false;\n }", "function passwordMatch($wachtwoord, $wachtwoordbevestiging) {\n\tif ($wachtwoord !== $wachtwoordbevestiging) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "public function checkPassword($password){\n\n/*\n* verify the password\n* if correct ,return true else return false\n* verify the password\n*/\n\n if (password_verify($password,$this->getHashedPassword())){\n return true;\n }else{\n return false;\n }\n\n }", "function hashME($username, $password) {\n\treturn bin2hex(hash(\"sha512\", $password . strtolower($username), true) ^ hash(\"whirlpool\", strtolower($username) . $password, true));\n}", "public function comparePassword() {\r\n if ($this->data[$this->name]['Password'] !== $this->data[$this->name]['RetypePass']) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function CheckPassword($plain, $salt, $password) {\n \tif($salt) {\n \t\treturn $password === md5($salt . $plain);\n \t} else {\n \t \treturn $password === md5($plain);\n \t}\n \t }", "function get_password_hash( $password )\r\n\t\t{\r\n\t\t\treturn hash_hmac( 'sha256', $password, 'c#haRl891', false );\r\n\t\t\t\r\n\t\t}", "public function verifyHashedPassword(string $hash, string $password) : bool {\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }", "function wp_check_password( $password, $hash, $user_id = '' ) {\n\t\t$check = password_verify( $password, $hash );\n\n\t\tif ( ! $check ) {\n\t\t\tif ( 0 === strpos( $hash, '$P$' ) || 0 === strpos( $hash, '$H$' ) ) { // If the hash is still portable hash or phpBB3 hash...\n\t\t\t\tglobal $wp_hasher;\n\n\t\t\t\tif ( empty( $wp_hasher ) ) {\n\t\t\t\t\trequire_once( ABSPATH . WPINC . '/class-phpass.php' );\n\n\t\t\t\t\t$wp_hasher = new PasswordHash( 8, true ); // WPCS: override ok.\n\t\t\t\t}\n\n\t\t\t\t$check = $wp_hasher->CheckPassword( $password, $hash );\n\t\t\t} elseif ( 0 !== strpos( $hash, '$' ) ) { // If the hash is still md5...\n\t\t\t\t$check = hash_equals( $hash, md5( $password ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( $check && $user_id ) { // Rehash using new hash.\n\t\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\t\tif ( password_needs_rehash( $hash, PASSWORD_DEFAULT, [ 'cost' => $cost ] ) ) {\n\t\t\t\t$hash = wp_set_password( $password, $user_id );\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'check_password', $check, $password, $hash, $user_id );\n\t}", "protected function hashPassword($password = false) {\n\t if (!function_exists('__hash')) {\n\t\t\t$this->load->helper('auth');\n\t\t}\n\t\tif ($password === false) {\n\t return false;\n\t }\n\t\treturn __hash($password,$this->config->item('password_crypt'));\n\t}", "public function hashPassword($p)\r\n {\r\n $r = sha1(Yii::$app->params['solt'].$p->password.$p->mail);\r\n return $r;\r\n }", "function verify_hash($hash) // Colorize: green\n { // Colorize: green\n return isset($hash) // Colorize: green\n && // Colorize: green\n is_string($hash) // Colorize: green\n && // Colorize: green\n preg_match(MD5_HASH_REGEXP, $hash); // Colorize: green\n }", "function comprobarContrasena($contrasena, $contrasenaBD) {\n $t_hasher = new PasswordHash(8, FALSE);\n return $t_hasher->CheckPassword($contrasena, $contrasenaBD);\n}", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public static function checkPassword($hash, $password) {\n $full_salt = substr($hash, 0, 29);\n $new_hash = crypt($password, $full_salt);\n return ($hash == $new_hash);\n }", "private static function _password($password, $hash)\n\t{\n\t\treturn md5(md5(md5($password)));\n\t}", "function confirmPassword($password, $confirmPassword){\n return $password == $confirmPassword;\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password)===$this->password;\n }", "function confirmPassword() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (\n\t\t\tSecurity::hash($this->model->data[$this->model->name][$fields['confirm_password']], null, true) \n\t\t\t== $this->model->data[$this->model->name][$fields['password']]\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkPassword($value);", "public function comparePassword($password)\n {\n return (new DefaultPasswordHasher)->check($password, $this->password);\n }", "public function check_password($password)\n {\n }", "function pwdMatch($password, $passwordRepeat){\n $result = true;\n if ($password !== $passwordRepeat){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "public static function verifyPassword($password, $hash)\n\t{\n\t\tself::checkBlowfish();\n\t\tif(!is_string($password) || $password==='')\n\t\t\treturn false;\n\n\t\tif (!$password || !preg_match('{^\\$2[axy]\\$(\\d\\d)\\$[\\./0-9A-Za-z]{22}}',$hash,$matches) ||\n\t\t\t$matches[1]<4 || $matches[1]>31)\n\t\t\treturn false;\n\n\t\t$test=crypt($password,$hash);\n\t\tif(!is_string($test) || strlen($test)<32)\n\t\t\treturn false;\n\n\t\treturn self::same($test, $hash);\n\t}", "public function MatchPasswords(string $password, string $hash): bool\n {\n return password_verify($this->codeword.$password, $hash);\n }", "public static function checkPassword($password, $hash) {\n\t\t$new_hash = self::formatPassword($password);\n\t\treturn ($hash == $new_hash);\n\t}", "public function checkPassword( $pass, $hash )\n {\n return password_verify( $pass, $hash );\n }", "function external_check_password($password, $hash, $user_id = '')\n{\n if (strlen($hash) <= 32) {\n $check = ( $hash == md5($password) );\n if ($check && $user_id) {\n // Rehash using new hash.\n external_set_password($password, $user_id);\n $hash = external_hash_password($password);\n }\n\n return apply_filters('check_password', $check, $password, $hash, $user_id);\n }\n\n // If the stored hash is longer than an MD5, presume the\n // new style phpass portable hash.\n $external_hasher = new PasswordHash(8, FALSE);\n\n $check = $external_hasher->CheckPassword($password, $hash);\n\n return apply_filters('check_password', $check, $password, $hash, $user_id);\n}", "public static function verifyHash(string $password, string $hash)\n\t{\n\t\tglobal $ff_config;\n\t\treturn password_verify(\n\t\t\tself::applyPepper($password),\n\t\t\t$hash\n\t\t);\n\t}", "private function calcPasswdHash($login,$password){\n return hash(self::PASSWDHASH,self::AESKEY.$login.$password);\n }", "function isPassCorrect($request){\n $name = $request[\"name\"];\n $pass = $request[\"pass\"];\n global $dbName, $dbPass;\n $mysqli = mysqli_connect(\"localhost\", $dbName, $dbPass, \"[Redacted]\") \n or die(mysql_error());\n $query = mysqli_query($mysqli, \"SELECT hash FROM Users WHERE name='$name' \");\n \n if (mysqli_num_rows($query) > 0) {\n if(password_verify($pass,mysqli_fetch_assoc($query)[\"hash\"])){\n return [True, \"$name\"];\n }else {\n return [False, \"Doesn't match\"];\n }\n } else {\n return [False, \"No user\"];\n }\n}", "public function passwordsMatch($pw1, $pw2) {\n if ($pw1 === $pw2)\n return true; \n else \n return false; \n }", "public function test_aprmd5_password()\n {\n $password = 'latik';\n $hash = '$apr1$ldcLQbqG$cJpEYvIA5jE7DpoTV7Pok1';\n\n $this->assertTrue(Hash::check($password, $hash));\n }", "private function checkHash( $hash )\n {\n // The first 64 characters of the hash is the salt\n $salt = substr($hash, 0, 64);\n \n // create a new hash by append the password to the salt string\n $hashToCheck = $salt . $this->password;\n \n // Hash the password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hashToCheck = hash('sha256', $hashToCheck);\n }\n \n $hashToCheck = $salt . $hashToCheck;\n \n // check the local hash with the database hash\n if( $hash == $hashToCheck )\n return true;\n \n // return false if no match\n return false;\n }", "function password_check($old_password)\n\t\t{\n\t\t\tif ($this->ion_auth->hash_password_db($this->data['user']->id, $old_password))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('password_check', 'Sorry, the password did not match');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "function pwdMatch($password, $pwdRepeat) {\n $result=true;\n if($password !== $pwdRepeat){\n $result =false;\n } else {\n $result = true;\n }\n return $result;\n}", "public function chkPassRecovery($hash='',$uid=''){\n\n $ret='';\n if($hash!='' && $uid!=''){//se chave e uid do usuario for informado\n \n //consulta na tabela de recuperacao de senha\n $sql = new Sql();\n $res = $sql->select('SELECT * FROM pwd_recovery WHERE\n id_usuario = :id_usuario AND\n hash_recovery = :hash_recovery AND\n DATE_ADD(dt_register, INTERVAL 1 HOUR) >= NOW()',array(\n ':id_usuario'=>$uid,\n ':hash_recovery'=>$hash));\n \n if(count($res)==0){//ativador nao valido\n $ret = false;\n }else{//caso valido retorna o HASH que sera utilizado para autorizar a nova senha\n $ret = $hash;\n }\n }\n \n return $ret;\n }", "public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}", "function valid_password($password1,$password2)\n{\n\t// if the comparison of the 2 strings (the passwords)\n\t// results in 0 difference\n\tif(strcmp($password1,$password2)==0)\n\t{\n\t\t// if the password has a length of at least 6 characters\n\t\tif(strlen($password1)>=6)\n\t\t{\n\t\t\t// then return true\n\t\t\treturn true;\n\t\t}\n\t\t// if length lower than 6\n\t\telse\n\t\t{\n\t\t\t// return false\n\t\t\treturn false;\n\t\t}\n\t}\n\t// if 2 passwords are different\n\telse\n\t{\n\t\t// return false\n\t\treturn false;\n\t}\n}", "static function password_check_user($userid, $password) {\n\t\t$result = lgi_mysql_query(\"SELECT `passwd_hash` FROM %t(users) WHERE `name`='%%'\", $userid);\n\t\tif (!($row=mysql_fetch_row($result))) return false;\n\t\t$hash = $row[0];\n\t\treturn hash_password($password, $hash) === $hash;\n\t}" ]
[ "0.84183806", "0.82081324", "0.80464685", "0.7897498", "0.7856224", "0.7845529", "0.78226334", "0.7798452", "0.7786626", "0.7763831", "0.7663868", "0.7581365", "0.75544554", "0.75210744", "0.75132596", "0.75064105", "0.7505626", "0.74768686", "0.74745095", "0.7450916", "0.7447651", "0.7444576", "0.7419455", "0.74191743", "0.74100995", "0.74094844", "0.7376032", "0.7376032", "0.7349497", "0.7336003", "0.73184615", "0.72758055", "0.7219046", "0.72082484", "0.71645266", "0.7096652", "0.7078146", "0.7070665", "0.7063388", "0.7061487", "0.7044408", "0.7027291", "0.70224744", "0.7009482", "0.7001176", "0.6999733", "0.6973641", "0.69719404", "0.69680333", "0.69515896", "0.6946431", "0.6934219", "0.69252753", "0.69107825", "0.69093513", "0.6895743", "0.68909776", "0.68844867", "0.68795145", "0.6866551", "0.68662316", "0.68527436", "0.68439794", "0.68337256", "0.68316823", "0.6826713", "0.6812261", "0.6806837", "0.679929", "0.6796383", "0.6788051", "0.67774606", "0.67765725", "0.677626", "0.676732", "0.67564905", "0.6753075", "0.67461693", "0.6745237", "0.674039", "0.67382103", "0.6731535", "0.672577", "0.6723905", "0.67235327", "0.6705861", "0.67037386", "0.67034626", "0.6698902", "0.66986084", "0.6698421", "0.66910076", "0.6689909", "0.6689237", "0.6686667", "0.6679228", "0.66763204", "0.6675588", "0.6673531", "0.66633934" ]
0.7343482
29
Relizo la preparacion de mi query utilizando PDO
public function createUser($correo) { $query = $this->connect()->prepare('SELECT * FROM users WHERE Correo = :correo'); $query->execute(['correo' => $correo]); //Guardo el obj PDO en cadenaValida $this->cadenaValida = $query->fetch(); //si el resultado retorna true no inserta, de lo contrario inserta if ($this->cadenaValida) { //El usuario ya existe, hay que retornar mensaje de lo que paso return $resultado = true; }else { //El correo buscado no existe, hay que insertar en tabla users //Obtenemos el ultimo valor de ID de usuario para agregar al nuevo $idTemp = $this->connect()->query('SELECT MAX(IDUsuario) FROM users'); $a = $idTemp->fetch(PDO::FETCH_BOTH); $this->idu = $a[0]; $this->idu = (int) $this->idu + 1; $this->nombre = $_POST['name']; $this->apellidoP = $_POST['ap']; $this->apellidoM = $_POST['am']; $this->correo = $_POST['correo']; $this->pass = md5($_POST['pass']); $this->rol = 1; $query = $this->connect()->prepare( 'INSERT INTO users VALUES( :idTemp, :nombre, :apellidoP, :apellidoM, :correo, :pass, :rol)' ); $query->execute([ 'idTemp' => $this->idu, 'nombre' => $this->nombre, 'apellidoP' => $this->apellidoP, 'apellidoM' => $this->apellidoM, 'correo' => $this->correo, 'pass' => $this->pass, 'rol' => $this->rol]); return $resultado = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function preExe(){\n\t\t$pre = $this->prepare($this->_query);\n\t\t$pre->execute();\n\t\treturn $pre->fetchAll();\n\t}", "public static function preparar($sql) {\n\t\treturn self::getConexao()->prepare($sql);\n\t}", "public function prepare_query()\n {\n }", "abstract public function prepareSelect();", "protected function prepareSelectStatement() {}", "function dbquery() {\n\t\t\t$db = &func_get_arg(0);\n\t\t\t$zapytanie = &func_get_arg(1);\n\t\t\t$polecenie = $db->prepare($zapytanie);\n\t\t\tif( func_num_args() == 2 ){\n\t\t\t\t$polecenie->execute();\n\t\t\t\treturn $polecenie;\n\t\t\t}\n\n for($i = 2 ; $i < func_num_args(); $i++) {\n $polecenie->bindParam($i-1, func_get_arg($i), PDO::PARAM_STR );\n }\n\n $polecenie->execute();\n return $polecenie;\n\t \t}", "public function prepQuery($params,$one=true)\n\t{\n\t\tif($this->tab) {\n\t\t\t$this->query = join(' ',$this->tab);\n\t\t\t$req = $this->pdo->prepare($this->query);\n\t\t\tif(is_array($params))\n\t\t\t{\n\t\t\t\tforeach($params as $k =>$v)\n\t\t\t\t{\n\t\t\t\t\t$req->bindParam($k,$v);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->params = $params;\n\t\t\t\t$req->bindParam(':id',$this->params);\n\t\t\t}\n\t\t\t\n\t\t\t$req->execute();\n\t\t\treturn $one?$req->fetch():$req->fetchAll();\n\t\t} \n\t\t\t\n\t}", "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "function SQLPreparerRequete($sql) {\n $BDD_host = \"localhost\";\n $BDD_user = \"root\";\n $BDD_password = \"\";\n $BDD_base = \"arcade\";\n\n try {\n $dbh = new PDO('mysql:host=' . $BDD_host . ';dbname=' . $BDD_base . ';charset=utf8', $BDD_user, $BDD_password);\n $dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $dbh->exec(\"SET CHARACTER SET utf8\");\n $return = $dbh->prepare($sql);\n } catch (Exception $e) {\n ob_end_clean();\n die('<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Arcade 2i</title><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/bootstrap.css\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/style.css\"/><script src=\"https://code.jquery.com/jquery-2.2.3.min.js\"></script><script src=\"assets/js/bootstrap.js\"></script></head><body><div class=\"container\"><div class=\"row\"><div class=\"alert alert-danger\">Erreur lors de l\\'execution de la page : ' . $e->getMessage() . '</div></div></div></body></html>');\n }\n return $return;\n}", "function find_all_secretaria($pdo) {\r\n $sql = \"select * FROM secretaria WHERE ativo = 0 order by id_secretaria\";\r\n $query = $pdo->prepare($sql);\r\n $query->execute();\r\n return $query;\r\n}", "function query($pdo,$query,$data=[]) {\n\t$query = $pdo->prepare($query);\n\t$query->execute($data);\n\treturn $query;\n}", "protected function prepareQuery($query) {}", "protected function prepquery($raw_query) {\n #var_dump($raw_query);\n $this->raw_query = $raw_query;\n\n $sqlraw = array();\n $iswhere = false;\n\n if (empty(self::$table)) {\n return $this->errors['errors'][] = \"No table selected\";\n }\n\n switch ($this->raw_query['dml']) {\n case \"SELECT\":\n $select = '';\n \n if (isset($this->raw_query['select'])) {\n $select .= \" \" . $this->raw_query['select'] . \" \";\n } else {\n $select .= ' * ';\n }\n \n $sqlraw['select'] = $select;\n\n break;\n\n case \"INSERT\":\n $insert = '';\n $insert .= \" (\" . implode(\", \", array_keys($this->raw_query['insert'])) . \")\";\n $insert .= \" VALUES \";\n $bindparams = array();\n for ($a = 0; $a < count($this->raw_query['insert']); $a++) {\n $bindparams[] = \"?\";\n }\n $insert .= \"(\" . implode(\", \", $bindparams) . \")\";\n $sqlraw['insert'] = $insert;\n break;\n\n case \"UPDATE\":\n $update = '';\n\n if (isset($this->raw_query['update'])) {\n if (is_array($this->raw_query['update'])) {\n $update .= \" SET \";\n foreach ($this->raw_query['update'] as $field => $value) {\n $update .= $field . \" = ?, \";\n }\n }\n }\n $sqlraw['update'] = rtrim($update, \", \");\n break;\n\n default:\n break;\n }\n\n if (isset($this->raw_query['join']) && !empty($this->raw_query['join'])) {\n $join = '';\n for ($a = 0; $a < count($this->raw_query['join']); $a++) {\n $type = $this->raw_query['join'][$a]['type'];\n $table = $this->raw_query['join'][$a]['table'];\n $one = $this->raw_query['join'][$a]['one'];\n $operator = $this->raw_query['join'][$a]['operator'];\n $two = $this->raw_query['join'][$a]['two'];\n\n $join .= \" \" . $type . \" JOIN \" . $table;\n $join .= \" ON \" . $one . \" \" . $operator . \" \" . $two;\n }\n $sqlraw['join'] = $join;\n }\n\n if (isset($this->raw_query['where']) && !empty($this->raw_query['where'])) {\n $where = '';\n for ($a = 0; $a < count($this->raw_query['where']); $a++) {\n $prefix = $a == 0 ? 'WHERE' : 'AND';\n $field = $this->raw_query['where'][$a]['field'];\n $operator = $this->raw_query['where'][$a]['operator'];\n $value = $this->raw_query['where'][$a]['value'];\n\n $where .= \" \" . $prefix . \" \" . $field . \" \" . $operator . \" ?\";\n }\n $sqlraw['where'] = $where;\n $iswhere = true;\n }\n\n if (isset($this->raw_query['wherein']) && !empty($this->raw_query['wherein'])) {\n $where = '';\n for ($a = 0; $a < count($this->raw_query['wherein']); $a++) {\n $prefix = $iswhere == true ? 'AND' : 'WHERE';\n $field = $this->raw_query['wherein'][$a]['field'];\n $value = $this->raw_query['wherein'][$a]['values'];\n $bindparams = array();\n for ($a = 0; $a < count($value); $a++) {\n $bindparams[] = \"?\";\n }\n\n $where .= \" \" . $prefix . \" \" . $field . \" IN (\" . implode(\", \", $bindparams) . \")\";\n }\n $sqlraw['where'] = $iswhere == true ? $sqlraw['where'] . $where : $where;\n $iswhere = true;\n }\n\n if (isset($this->raw_query['wherenull']) && !empty($this->raw_query['wherenull'])) {\n $where = '';\n for ($a = 0; $a < count($this->raw_query['wherenull']); $a++) {\n $prefix = $iswhere == true ? 'AND' : 'WHERE';\n $field = $this->raw_query['wherenull'][$a];\n $where .= \" \" . $prefix . \" \" . $field . \" IS NULL\";\n }\n\n $sqlraw['where'] = $iswhere == true ? $sqlraw['where'] . $where : $where;\n $iswhere = true;\n }\n\n if (isset($this->raw_query['wherenotnull']) && !empty($this->raw_query['wherenotnull'])) {\n $where = '';\n for ($a = 0; $a < count($this->raw_query['wherenotnull']); $a++) {\n $prefix = $iswhere == true ? 'AND' : 'WHERE';\n $field = $this->raw_query['wherenotnull'][$a];\n $where .= \" \" . $prefix . \" \" . $field . \" IS NOT NULL\";\n }\n\n $sqlraw['where'] = $iswhere == true ? $sqlraw['where'] . $where : $where;\n $iswhere = true;\n }\n\n if (isset($this->raw_query['groupby']) && !empty($this->raw_query['groupby'])) {\n $groupby = '';\n for ($a = 0; $a < count($this->raw_query['groupby']); $a++) {\n $prefix = $a == 0 ? 'GROUP BY' : ',';\n $field = $this->raw_query['groupby'][$a];\n\n $groupby .= \" \" . $prefix . \" \" . $field;\n }\n $sqlraw['groupby'] = $groupby;\n }\n\n if (isset($this->raw_query['orderby']) && !empty($this->raw_query['orderby'])) {\n $orderby = '';\n if (!helpers::is_arr_key_int($this->raw_query['orderby'])) {\n $a = 0;\n foreach ($this->raw_query['orderby'] as $field => $order) {\n $prefix = $a == 0 ? 'ORDER BY' : ',';\n $orderby .= \" \" . $prefix . \" \" . $field . \" \" . $order;\n $a++;\n }\n } else {\n for ($a = 0; $a < count($this->raw_query['orderby']); $a++) {\n $prefix = $a == 0 ? 'ORDER BY' : ',';\n $field = $this->raw_query['orderby'][$a]['field'];\n $order = $this->raw_query['orderby'][$a]['order'];\n\n $orderby .= \" \" . $prefix . \" \" . $field . \" \" . $order;\n }\n }\n $sqlraw['orderby'] = $orderby;\n }\n\n $this->sqlwrapper($sqlraw);\n return $this->execquery();\n }", "public function consultarDatos($consultaSQL){\n $conexionBD=$this->conectarBD();\n\n //2.Preparar la consulta que se va a realizar\n $consultaBuscarDatos= $conexionBD->prepare($consultaSQL);\n\n //3. Definir la forma en la que vmos a traer los datos\n // setFetchMode\n $consultaBuscarDatos->setFetchMode(PDO::FETCH_ASSOC);\n\n //4.Ejecutar la consulta\n $consultaBuscarDatos->execute();\n\n //5. Retornar los datos consultados\n return($consultaBuscarDatos->fetchAll());\n\n\n\n}", "public function select_all(string $query)\n{\n $this->strquery = $query;\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n $data = $result->fetchall(PDO::FETCH_ASSOC);\n return $data; \n}", "public function prepare($sql);", "private function prepare ($sql) {\n $this->query = $this->connection->prepare($sql);\n }", "public function prepareAndExecute (PDO $connection, string $query, array $params = []);", "public function query($sql) {\n try{\n $this->resultado = $this->conexao->prepare($sql);\n }catch(PDOException $e){\n $this->errors[] = 'error: function query<br/>'.$e->getMessage();\n }\n }", "public function select(string $query)\n{\n // guardamos lo que venga como parametros en la funcion select\n $this->strquery = $query;\n // preparamos el query\n $result = $this->conexion->prepare($this->strquery);\n $result->execute();\n // se utiliza fetch porque solo devuelve un resultado\n $data = $result->fetch(PDO::FETCH_ASSOC);\n return $data;\n}", "public function prepare($query)\n {\n }", "public function query()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n if (count($bindings) == 1 and is_array($bindings[0])){\n $bindings = $bindings[0];\n }\n\n try{\n $query = $this->connection()->prepare($sql);\n\n foreach ($bindings as $key => $value){\n $query->bindValue($key + 1 , _e($value));\n }\n $query->execute();\n\n return $query;\n }\n catch (PDOException $e){\n echo $sql;\n pre($this->bindings);\n die($e->getMessage());\n }\n\n }", "function all($table)\n{\n try {\n //connexion bd\n $cnx = connecter_db();\n //preparer une sql\n $rp = $cnx->prepare(\"select * from $table order by id desc \");\n //executer\n $rp->execute();\n $resultat = $rp->fetchAll(); //extraire tous\n return $resultat;\n } catch (PDOException $e) {\n echo \"Erreur dans all\" . $e->getMessage();\n }\n}", "function getPagos(){\n // 1. abrir la conexion\n //parametros\n //servidor: localhost\n //base de datos: db_deudas\n //usuario: root\n //contraseña: root (en xampp generalmente es vacía)\n $db = new PDO('mysql:host=localhost;'.'dbname=db_deudas;charset=utf8','root', '');\n\n //2. Ejecutar la consulta sql --> SELECT * FROM `pagos`;\n //subpasos --> PREPARE\n // --> EXECUTE\n\n $query = $db -> prepare('SELECT * FROM `pagos`');\n\n $query -> execute();\n\n //3. Obtener los datos de la consulta para procesarlos\n $pagos = $query -> fetchAll(PDO::FETCH_OBJ); //-->devuelve un arreglo con todos los datos de la tabla\n\n //4. Cerrar la conexion a la base de datos\n //con PDO no es necesario cerrarla\n\n return $pagos;\n}", "protected function prepareOrderByStatement() {}", "function prepare($pquery){\n if ( ! $this->initDB() ) return false; \n return $this->dbh->prepare($pquery);\n }", "private\tfunction\t_prepareFindQuery()\n\t\t{\n\t\t\tself::$_queries[$this->_class]['find']\t=\t'SELECT '.trim(str_replace('<alias>','a0',self::$_queries[$this->_class]['select']), ', ')\n\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rFROM \".'`'.$this->_table.'` `a0`'.self::$_queries[$this->_class]['from'];\n\t\t\tunset(self::$_queries[$this->_class]['select'], self::$_queries[$this->_class]['from']);\n\t\t\t\n\t\t\treturn\tself::$_queries[$this->_class]['find'];\n\t\t}", "public function preparar($consulta){\n $this->consulta= $consulta;\n $this->prep= $this->db->prepare($this->consulta);//la funcion prepare bueno prepara una consulta, es decir la lee para saber si en verdad es una consulta sql, y hara que el atributo prep de esta clase reciba un objeto por valor, asi ganando metodos, devolvera false si algo sale mal\n if(!$this->prep){\n trigger_error(\"Error al preparar la consulta\", E_USER_ERROR);\n }else{\n return true;\n }\n \n }", "function PreprocessSql($sql);", "function prepareQuery() {\n\t\t$q = \"SET \n\t\t\t\t\t`template` = '{$this->newIdt}',\n\t\t\t\t\t`description` = '{$this->description}',\n\t\t\t\t\t`PostsHeader` = '{$this->postsHeader}',\n\t\t\t\t\t`PostBody` = '{$this->postBody}',\n\t\t\t\t\t`PostsFooter` = '{$this->postsFooter}',\n\t\t\t\t\t`FormLogged` = '{$this->formLogged}',\n\t\t\t\t\t`Form` = '{$this->form}',\n\t\t\t\t\t`Navigation` = '{$this->navigation}',\n\t\t\t\t\t`Name` = '{$this->name}',\n\t\t\t\t\t`NameLin` = '{$this->nameLin}',\n\t\t\t\t\t`MemberName` = '{$this->memberName}',\n\t\t\t\t\t`Date` = '{$this->date}',\n\t\t\t\t\t`Time` = '{$this->time}',\n\t\t\t\t\t`NextPage` = '{$this->nextPage}',\n\t\t\t\t\t`PreviousPage` = '{$this->previousPage}',\n\t\t\t\t\t`FirstPage` = '{$this->firstPage}',\n\t\t\t\t\t`LastPage` = '{$this->lastPage}',\n\t\t\t\t\t`UrlsToLinks`\t=\t'\".($this->urlToLink ? 'yes' : 'no').\"',\n\t\t\t\t\t`EmoToImg` \t\t=\t'\".($this->emoToImg ? 'yes' : 'no').\"',\n\t\t\t\t\t`GravDefault`\t=\t'{$this->gravDefault}',\n\t\t\t\t\t`GravSize`\t\t=\t{$this->gravSize}\";\n\t\treturn $q;\n\n\t}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "function query($pdo, $query, $queryData) {\n\t\t\tif(isset($queryParams) && isset($queryData) || !(isset($queryParams) && isset($queryData))) {\n\t\t\t\ttry {\n\t\t\t\t\t$stmt = $pdo->prepare($query);\n\n\t\t\t\t\tforeach ($queryData as $key => &$value) {\n\t\t\t\t\t\t$stmt->bindParam($key, $value, PDO::PARAM_STR);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($stmt->execute()) {\n\t\t\t\t\t\treturn $stmt;\n\t\t\t\t\t}\n\t\t\t\t} catch(PDOException $e) {\n\t\t\t\t\t/*$status = 'fail';\n\t\t\t\t\t$message = 'Problemas durante a requisição';\n\t\t\t\t\t$details = 'Verifique se as informações escaneadas estão corretas e tente novamente';\n\n\t\t\t\t\t$this->jsonResponse($status, $message, $details);*/\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "function lista_perguntas_avaliacao($avaliacao_id){\n $SQLSelect = 'SELECT pergunta, pergunta.id as id, sentenca '\n . 'FROM pergunta '\n . 'INNER JOIN alternativa ON pergunta.id = alternativa.pergunta_id '\n . 'INNER JOIN correta on correta.pergunta_id = pergunta.id and correta.alternativa_id = alternativa.id '\n . 'WHERE atividade_id = ?';\n \n try{\n $conexao = conn_mysql();\n \n //prepara a execução da sentença\n $operacao = $conexao->prepare($SQLSelect);\t\n $operacao->execute(array($avaliacao_id));\n \n //captura TODOS os resultados obtidos\n $resultados = $operacao->fetchAll(PDO::FETCH_ASSOC);\n $conexao=null;\n \n return $resultados;\n }\n catch(PDOException $excep){\n echo \"Erro!: \" . $excep->getMessage() . \"\\n\";\n $conexao=null;\n die();\n }\n \n}", "public function prepareQuery($sql){\n \t//parse out the tokens\n \t$tokens = preg_split('/((?<!\\\\\\)[&?!])/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\n \t//maintain a count of the actual tokens for quick reference in execute\n \t$count = 0;\n \t\n \t$sqlStr = '';\n\t foreach ($tokens as $key => $val) {\n\t switch ($val) {\n\t case '?' :\n\t case '!' :\n\t case '&' :\t\n\t \t$count++;\n\t \t$sqlStr .= '?';\n\t \tbreak;\n\t \t\n\t default :\n\t \t//escape any special characters\n\t $tokens[$key] = preg_replace('/\\\\\\([&?!])/', \"\\\\1\", $val);\n\t $sqlStr .= $tokens[$key];\n\t break;\n\t } // switch\n\t } // foreach\n\n\t $this->preparedTokens[] = array('tokens' => $tokens, 'tokenCount' => $count, 'sqlString' => $sqlStr);\n\t end($this->preparedTokens);\n\t return key($this->preparedTokens);\t\n }", "function BDDselect($sql, $param){\n $bdd = BDDopen();\n $req = $bdd->prepare($sql);\n if($req->execute($param) === FALSE){\n echo 'Errore de la requette';\n print_r($param);\n }\n return $req;\n}", "public function _prepare() {\n if( !DBwrite::connected() ) {\n DBwrite::connect();\n }\n\n $query = $this->query;\n foreach( $this->key_value_map as $key => $value ) {\n $query = str_replace(\n '#'.$key, \n $this->sanitizeValue( $key, $value ),\n $query\n );\n }\n \n $this->real_query = $query;\n return $this->real_query;\n }", "function query( string $tableName, PDO $db ){\n try{\n // Consulta a realizar\n $query = \"SELECT * FROM \".$tableName; \n // Preparamos la consulta\n $stmt = $db->prepare($query);\n // Ejecutamos\n $stmt->execute();\n //return $stmt->fetchAll( PDO::FETCH_OBJ);\n return $stmt->fetchAll( PDO::FETCH_ASSOC);\n\n }\n catch( Exception $exception ){\n echo \"<br>\";\n echo \"Error inesperado al consultar: \". $exception->getMessage();\n }\n}", "function pdo_query($sql, $link=NULL, $params=NULL) {\r\n\r\n // separate params from $sql and $link \r\n $params = func_get_args();\r\n $sql = TRIM( array_shift($params) );\r\n $flags = array();\r\n $direct = false;\r\n \r\n\r\n // find pdo $link \r\n if (count($params)) {\r\n // $link can be the first element\r\n if (is_object(reset($params))) {\r\n $link = array_shift($params);\r\n }\r\n // or the last\r\n elseif (is_object(end($params))) {\r\n $link = array_pop($params);\r\n }\r\n }\r\n // or we use the default $pdo\r\n $link = pdo_handle($link);\r\n \r\n // is $params a list to pdo_query(), or just one array with :key=>value pairs?\r\n if (count($params)==1 && is_array($params[0])) {\r\n $params = array_shift($params);\r\n }\r\n\r\n\r\n // add PDO_MySQL driver flag / workaround for specific query types\r\n switch (strtoupper(substr($sql, 0, strspn(strtoupper($sql), \"SELECT,USE,CREATE\")))) {\r\n\r\n // ought to make ->rowCount() work\r\n case \"SELECT\":\r\n $flags[PDO::MYSQL_ATTR_FOUND_ROWS] = true;\r\n break;\r\n\r\n // temporarily disable prepared statement mode for unbindable directives\r\n case \"USE\":\r\n $direct = true;\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\r\n break;\r\n\r\n default:\r\n }\r\n\r\n\r\n // unparameterized query()\r\n if ($direct) {\r\n $stmt = $link->query($sql);\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n }\r\n // or prepare() and execute()\r\n else {\r\n if ($stmt = $link->prepare($sql, $flags)) { // no try-catch in _WARNING mode\r\n $stmt->execute($params);\r\n }\r\n }\r\n \r\n // result\r\n if (!$stmt and PDO_HELPFUL) {\r\n pdo_trigger_error(\"pdo_query() SQL query failed, see pdo_error()\", E_USER_WARNING);\r\n }\r\n elseif (PDO_SEEKABLE & !$direct) {\r\n return new PDOStatement_Seekable($stmt, $params);\r\n }\r\n else {\r\n return $stmt;\r\n }\r\n }", "function pdo_query($pdo, $query)\n{\n $result = $pdo->query($query);\n \n return $result;\n}", "function execute_requete($req){\r\n\tglobal $pdo;\r\n\t$pdostatement = $pdo->query($req);\r\n\treturn $pdostatement;\r\n}", "function runQueryWithParams ($q, $p) {\r\n $dbSettings = getDBsettings();\r\n $db = \"mysql:host=\" . $dbSettings['DBserver'] . \";dbname=\" . $dbSettings['DBname'] . \";port=\" . $dbSettings['DBport'];\r\n $pdo = new PDO($db, $dbSettings['DBuser'], $dbSettings['DBpass']);\r\n //prepare the SQL string\r\n $stmt = $pdo->prepare($q);\r\n //execute the SQL\r\n $stmt->execute(array($p));\r\n //close the conention\r\n $pdo = null;\r\n //return the result\r\n return $stmt;\r\n}", "function SQLExecuterRequete($sql, array $arg) {\n try {\n $sth = SQLPreparerRequete($sql);\n $sth->setFetchMode(PDO::FETCH_ASSOC);\n foreach ($arg as $key => &$val) {\n $sth->bindParam($key, $val);\n }\n if (!$sth->execute()) {\n throw new Exception(\"La requete SQL a echouee\", 500);\n }\n } catch (Exception $e) {\n ob_end_clean();\n die('<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Arcade 2i</title><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/bootstrap.css\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/style.css\"/><script src=\"https://code.jquery.com/jquery-2.2.3.min.js\"></script><script src=\"assets/js/bootstrap.js\"></script></head><body><div class=\"container\"><div class=\"row\"><div class=\"alert alert-danger\">Erreur lors de l\\'execution de la page : ' . $e->getMessage() . '</div></div></div></body></html>');\n }\n return $sth;\n}", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.id_ventas,v.sucursal,v.subtotal,v.numero_venta,p.nombres,p.telefono,p.id_paciente,v.tipo_pago,v.vendedor from ventas as v join pacientes as p where p.id_paciente=v.id_paciente and v.sucursal=? and v.id_usuario=? order by id_ventas DESC limit 1;\";\n\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $sucursal);\n $sql->bindValue(2, $id_usuario);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }", "public function consultar($sql)\n {\n\n $rt = null;\n try\n {\n $query = $this->pdo->prepare($sql);\n $query->execute();\n $rt = $query;\n \n } catch(PDOException $e) {\n \n error_log( $e->getMessage() ); \n \n }\n return $rt;\n }", "public function query($query){\r\n $args = func_get_args();\r\n array_shift($args); //first element is not an argument but the query itself, should removed\r\n\r\n $reponse = parent::prepare($query);\r\n $reponse->execute($args);\r\n return $reponse;\r\n\r\n }", "public function MovimientoCajasPorId()\n{\nself::SetNames();\n$sql = \" SELECT * from movimientoscajas INNER JOIN cajas ON movimientoscajas.codcaja = cajas.codcaja LEFT JOIN mediospagos ON movimientoscajas.mediopagomovimientocaja = mediospagos.codmediopago LEFT JOIN usuarios ON movimientoscajas.codigo = usuarios.codigo WHERE movimientoscajas.codmovimientocaja = ?\";\n$stmt = $this->dbh->prepare($sql);\n$stmt->execute( array(base64_decode($_GET[\"codmovimientocaja\"])) );\n$num = $stmt->rowCount();\nif($num==0)\n{\n\techo \"\";\n}\nelse\n{\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}\n}", "private function beginQuery() {\n $this->sql = 'SELECT sum(inv_total_cost) as total_cost,id,businessname,email,businesstelephone,'\n . 'IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0) as pfp_import,'\n . 'ROUND((sum(inv_total_cost) - IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0)), 2) as overdue '\n . 'FROM (SELECT t.* FROM agnt_booking_invoice t INNER JOIN (SELECT inv_total_cost,MAX(inv_invoice_id) AS latest,inv_booking_id FROM agnt_booking_invoice GROUP BY inv_booking_id) t1 ON t1.inv_booking_id=t.inv_booking_id AND t1.latest=t.inv_invoice_id) AS derived_booking_invoice '\n . 'LEFT JOIN agenti ON agenti.id=derived_booking_invoice.inv_agent_id WHERE agenti.status=\"active\" ';\n }", "private function prepareStatement()\n {\n $columns = '';\n $fields = '';\n foreach ($this->fields as $key => $f) {\n if ($key == 0) {\n $columns .= \"$f\";\n $fields .= \":$f\";\n continue;\n }\n\n $columns .= \", $f\";\n $fields .= \", :$f\";\n }\n\n $this->statement = $this->pdo->prepare(\n 'INSERT INTO `' . $this->table . '` (' . $columns . ') VALUES (' . $fields . ')'\n );\n }", "public function prepare();", "public function prepare();", "function fetch($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_array($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "function consultar_parametros($db){\n\t\t\t$query = \"SELECT P.id, P.empresa, P.razonsocial_fiscal, P.razonsocial_fantasia, P.clientes_regimen_de_iva_id,\n\t\t\t\t\t\t\tP.deposito_id, P.moneda_id, P.tipo_de_pago_id, P.decimales, P.fecha_inicio_actividades,\n\t\t\t\t\t\t\tP.logo, P.banner, P.logo_marca_de_agua, P.parametros_perfil_empresa, P.rec_desc_tipo_de_pago_por_item,\n\t\t\t\t\t\t\tP.domicilio_comercial, P.domicilio_localidad_comercial, P.telefono_comercial, P.email_comercial,\n\t\t\t\t\t\t\tPAD.slogan\n\t\t\t\t\t\tFROM parametros P\n\t\t\t\t\t\t\tLEFT OUTER JOIN parametros_adicional AS PAD ON (P.id = PAD.id)\n\t\t\t\t\t\tWHERE P.oculto = 0 \n\t\t\t\t\t\tORDER BY P.id DESC\n\t\t\t\t\t\tLIMIT 1 \";\n\t\t\t\n\t\t\t$resultpp = $this->LOGS_PARAM($db,$query);\n\t\t\t\n\t\t\treturn $resultpp;\n\t\t}", "private static function prepare($sql)\n {\n return self::$instancia->con->prepare($sql);\n }", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "function sql_query_dados_plano ( $c60_anousu=null, $campos=\"*\",$ordem=null,$dbwhere=\"\") {\n $sql = \"select \";\n if($campos != \"*\" ){\n $campos_sql = split(\"#\",$campos);\n $virgula = \"\";\n for($i=0;$i<sizeof($campos_sql);$i++){\n $sql .= $virgula.$campos_sql[$i];\n $virgula = \",\";\n }\n }else{\n $sql .= $campos;\n }\n $sql .= \" from conplanoorcamento \";\n $sql .= \" left join conplanoorcamentoanalitica on conplanoorcamento.c60_codcon = conplanoorcamentoanalitica.c61_codcon \";\n $sql .= \" and conplanoorcamento.c60_anousu = conplanoorcamentoanalitica.c61_anousu \";\n $sql .= \" left join conplanoorcamentoconta on conplanoorcamento.c60_codcon = conplanoorcamentoconta.c63_codcon \";\n $sql .= \" and conplanoorcamento.c60_anousu = conplanoorcamentoconta.c63_anousu \";\n $sql .= \" left join conplanoorcamentocontabancaria on conplanoorcamento.c60_codcon = conplanoorcamentocontabancaria.c56_codcon \";\n $sql .= \" and conplanoorcamento.c60_anousu = conplanoorcamentocontabancaria.c56_anousu \";\n $sql .= \" inner join conclass on conplanoorcamento.c60_codcla = conclass.c51_codcla \";\n $sql2 = \"\";\n if($dbwhere==\"\"){\n if($c60_anousu!=null ){\n $sql2 .= \" where conplanoorcamento.c60_anousu = $c60_anousu \";\n }\n }else if($dbwhere != \"\"){\n $sql2 = \" where $dbwhere\";\n }\n\n //$sql2 .= ($sql2!=\"\"?\" and \":\" where \") . \" c61_instit = \" . db_getsession(\"DB_instit\");\n $sql .= $sql2;\n if($ordem != null ){\n $sql .= \" order by \";\n $campos_sql = split(\"#\",$ordem);\n $virgula = \"\";\n for($i=0;$i<sizeof($campos_sql);$i++){\n $sql .= $virgula.$campos_sql[$i];\n $virgula = \",\";\n }\n }\n return $sql;\n }", "public function make_sql()\n\t{\n\t\ttry{\n\t\t\t$metot = $this->metot;\n\t\t\t$metot = strtolower($metot);\n\t\t\t\n\t\t\tif($metot == \"select\") /* Select için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif ((count($this->tables))== 1)\n\t\t\t\t{\n\t\t\t\t\tfor ($c=1;$c<=(count($this->tables[0])-1);$c++){\n\t\t\t\t\t$col .= $this->tables[0][$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr(\"$col\", 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'id, adsoyad' (length=12)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach ($this->tables AS $row){\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\tfor($c=1; $c<=(count($row)-1);$c++){\n\t\t\t\t\t\t\t$var = trim($row[$c]);\n\t\t\t\t\t\t\t$col .= \"{$table}.{$var}, \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'email.id, email.adsoyad, blog.id, blog.title' (length=44)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_null($this->join)){\n\t\t\t\t\tforeach($this->join AS $row) {$join .=\" $row \";}\n\t\t\t\t}\n\t\t\t\telse $join = \"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->order)) $order = $this->order;\n\t\t\t\telse $order =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->group)) $group = $this->group;\n\t\t\t\telse $group =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->limit)) $limit = $this->limit;\n\t\t\t\telse $limit =\"\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->sql = $this->metot.\" \". $col.\" FROM \".$table.\" \".$join.\" \".$where.\" \".$group.\" \".$order.\" \".$limit;\n\t\t\t\t/*var_dump($this->sql); string 'SELECT id, adsoyad FROM email WHERE email.id=35 ' (length=53)*/\n\t\t\t} /*if($metot == \"select\")*/\n\t\t\t\n\t\t\tif($metot == \"insert\") /* Insert için sql oluşturma*/\n\t\t\t{\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\n\t\t\t\t\t$sql[] = \"INSERT INTO {$table} ($col) VALUES ($colVal) \";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if($metot == \"insert\")*/\n\t\t\t\n\t\t\tif ($metot == \"update\") /* Update için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= $row[$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$sql[] = \"UPDATE {$table} SET {$col} {$where}\";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"update\")*/\n\t\t\t\n\t\t\tif ($metot == \"delete\") /* Delete için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\t$col = \"\";\n\t\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql[] = \"DELETE FROM {$table} WHERE ($col) = ($colVal) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"delete\")*/\n\t\t\t\n\t\t\t$this->run();\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\techo \"Error : \".$e->getMessage() .\"<br/>\".\"File : \".$e->getFile() . \"<br/>\".\"Line : \".$e->getLine() . \"<br/>\";\n\t\t}\n\t}", "public function traerDatos(Sql $sql);", "function run_query($sql,$op, $debug){\r\n\t\t\t\tinclude_once 'data_db.php';\r\n\t\t\t\t$db = new PDO('mysql:host='.$servidor.';dbname='.$bd, $usuario_db, $password_db\r\n\t\t\t\t\t\t\t\t, array(\r\n\t\t\t\t\t\t\t\t\t\t// PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION\r\n\t\t\t\t\t\t\t\t\t\t PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \\'UTF8\\''\r\n\t\t\t\t\t\t\t\t\t\t, PDO::ATTR_PERSISTENT => false //PDO::ATTR_PERSISTENT => true //al estar persistente genera daño\r\n\t\t\t\t\t\t\t\t\t\t//, PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"\r\n\t\t\t\t\t\t\t\t\t\t//, PDO::MYSQL_ATTR_INIT_COMMAND => \"SET SESSION collation_connection = 'utf8_unicode_ci'\"\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t );\r\n\t\t\t\t\r\n\t\t\t\tif($debug == 1){\r\n\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\tprint_r($sql);\r\n\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tswitch($op){\r\n\t\t\t\t\tcase 1: /*devuelve un JSON con datos o un JSON con error*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t$statement = $db->prepare($sql);\r\n\t\t\t\t\t\t\t$statement->execute();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\t$statement->debugDumpParams();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t\t\tprint_r($result);\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(count($result) >= 1){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\techo '{\"data\":'. json_encode($result) .'}' ;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$rw_error['error'] = 'error';\r\n\t\t\t\t\t\t\t\t$myArray[] = $rw_error;\r\n\t\t\t\t\t\t\t\techo '{\"data\":['. implode(',',$myArray) .']}' ;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$statement = null;\r\n\t\t\t\t\t\t\t$db = null;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(PDOException $e ){\r\n\t\t\t\t\t\t\techo \"Error: \".$e->getMessage();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 2: /*devuelve el array con datos o devuelve un error*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t$statement = $db->prepare($sql);\r\n\t\t\t\t\t\t\t$statement->execute();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\t$statement->debugDumpParams();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t\t\tprint_r($result);\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(count($result) >= 1){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$result_s = $result;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$rw_error['error'] = 'error';\r\n\t\t\t\t\t\t\t\t$myArray[] = $rw_error;\r\n\t\t\t\t\t\t\t\t$result_s = $myArray;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$statement = null;\r\n\t\t\t\t\t\t\t$db = null;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(PDOException $e ){\r\n\t\t\t\t\t\t\techo \"Error: \".$e->getMessage();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\treturn $result_s;\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase 3: /*devuelve la informacion y sin mensaje de error*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t$statement = $db->prepare($sql);\r\n\t\t\t\t\t\t\t$statement->execute();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\t$statement->debugDumpParams();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($debug == 1){\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t\t\tprint_r($result);\r\n\t\t\t\t\t\t\t\techo \"<pre>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(count($result) >= 1){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$result_s = $result;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$result_s = array();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$statement = null;\r\n\t\t\t\t\t\t\t$db = null;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}catch(PDOException $e ){\r\n\t\t\t\t\t\t\techo \"Error: \".$e->getMessage();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\treturn $result_s;\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}", "function createQuery() ;", "public function prepare ($sql) {\n $this->query = $this->conn->prepare($sql);\n return $this->query;\n }", "function makeQuery($c,$ps,$p) {\n try {\n\n $stmt = $c->query($ps);\n\n $r = fetchAll($stmt);\n\n return [\n \"result\"=>$r\n ];\n\n } catch(PDOException $e) {\n return [\n \"error\"=>\"Query Failed: \".$e->getMessage()\n ];\n }\n}", "private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }", "function trier(){\r\n \r\n $db = config::getConnexion();\r\n $sql=\"SElECT * From livreur ORDER BY nom\";\r\n\r\n try{\r\n $req=$db->prepare($sql);\r\n $req->execute();\r\n $livreur= $req->fetchALL(PDO::FETCH_OBJ);\r\n return $livreur;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "public function pquery_sql($query, array $phs = null);", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n $this->getTableName('users'));\n\n $this->conf['select-user-groups'] = sprintf('\n\t\t\tSELECT title as `group` FROM %s as groups\n\t\t\tLEFT JOIN %s as groupmap ON groups.id = groupmap.group_id\n\t\t\tLEFT JOIN %s as user ON groupmap.user_id = user.id\n\t\t\tWHERE user.username = :user OR user.id = :uid ',\n $this->getTableName('usergroups'),\n $this->getTableName('user_usergroup_map'),\n $this->getTableName('users'));\n\n $this->conf['select-groups'] = sprintf('\n\t\t\tSELECT title as `group`, id as gid FROM %s',\n $this->getTableName('usergroups'));\n }", "function multi_prepare($query)\n\t\t{\n\t\t\t//Attempt to start full operation here.\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t$db = $this->pdo;\n\t\t\t\t\n\t\t\t\t//We begin the trasanction and the prepared statement\n\t\t\t\t$db->beginTransaction();\n\t\t\t $sth = $db->prepare($query);\n\t\t\t\t$obj = [$db,$sth];\n\t\t\t\t\n\t\t\t\t//the return value on success is an array with two values containing objects;\n\t\t\t\t//The PDO obj[0]; Shall be used to commit the values to the already prepared statement \n\t\t\t\t//The Statement obj[1]: Shall be used to bind/execute the values to the prepared statement.\n\t\t\t\treturn $obj;\n\t\t\t }\n\t\t\t\n\t\t\t//At this point the query was executed correctly so we roll back everything.\n\t\t\tcatch (Exception $e) \n\t\t\t{\n\t\t\t\t$db->rollBack();\n\t\t\t\t$utility = new utility();\n\t\t\t\t//$utility->ajax(json_encode($db->errorInfo()));\n\t\t\t\t$utility->ajax($this->error_msg);\n\t\t\t\t$_SESSION[\"error\"] = $this->error_msg;//$db->errorInfo();\n\t\t\t\tif(isset($_SERVER[\"HTTP_REFERER\"]))\n\t\t\t\t{\n\t\t\t\t\theader(\"Location: \".$_SERVER[\"HTTP_REFERER\"].\"\");\n\t\t\t }\n\t\t\t else\n\t\t\t\t{\n\t\t\t\t\theader(\"Location: /\");\n }\n }\n\t\t}", "public function pQuery($sql, $data = array()){\n \t$stmt = $this->prepareQuery($sql);\n \treturn $this->executePreparedQuery($stmt, $data);\n }", "function selectQuery($query) \t{\n\t\tif($query != '')\t\t{\n\t $res = $this->execute($query);\n\t\t\treturn $this->fetchAll($res);\n\t\t}\n\t}", "public function exec($sql, $params = array()) {\n\n // check if params starts with \":\". Else add it\n foreach ($params as $key => $val) {\n if (substr($key, 0, 1) !== ':') {\n unset($params[$key]);\n $params[':' . $key] = $val;\n } else {\n break;\n }\n }\n\n $query = $this->host->prepare($sql); // there must'n have minus in field names\n $query->execute($params);\n if ($query->errorCode() > 0) {\n echo '<span style=\"background-color: red;\">Error in SQL:</span>';\n var_dump($query->errorInfo());\n var_dump(array('Last Query: ', array($sql)));\n var_dump(array('Last Query Params: ', $params));\n $this->worker->log->error('Error in SQL: ', $query->errorInfo());\n $this->worker->log->info('Last Query: ', array($sql));\n $this->worker->log->info('Last Query Params: ', $params);\n }\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n\n if ($this->utf8Decode) {\n foreach ($result as &$record) {\n foreach ($record as &$attr) {\n $attr = utf8_decode($attr);\n }\n }\n }\n\n return $result;\n }", "public function prepareQuery($query)\n {\n $query = (string)$query;\n try {\n //if not successful returns either false or PDOException depending on error handling method. We use PDOException\n //if successful returns PDOStatement\n $this->stmt = $this->PDO->prepare($query);\n } catch (PDOException $e) {\n MyErrorHandler::exceptionLogger($e, fileName);\n }\n }", "function Query($query)\n{\n global $Cn;\n try{\n $result =$Cn->query($query);\n $resultado = $result->fetchAll(PDO::FETCH_ASSOC);\n $result->closeCursor();\n return $resultado;\n }catch(Exception $e){\n die(\"Error en la LIN: \" . $e->getLine() . \", MSG: \" . $e->GetMessage());\n }\n}", "public function rechercherTous() {\n // select all query\n $sRequete = \"SELECT * FROM \" . $this->sNomTable .\"\n LEFT JOIN panier ON idPanier = iNoPanier\n LEFT JOIN produit ON idProduit = iNoProduit\n \";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($sRequete);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function extractdatalaporansshared($from, $to) {\n\t\t$db;\n\t\ttry {\n\t\t\t$db = connect_pdo();\n\t\t}\n\t\tcatch (PDOException $ex) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$string_prep_query = \"SELECT id, title, picture_url, description, `date`, caleg_id_API, latitude, longitude, party_id_API, user_id , coalesce(counter, 0) as sharecounter\n\t\t\t\tFROM report_tbl\n\t\t\t\tLEFT OUTER JOIN (\n\t\t\t\t\tSELECT report_id, count(*) as counter FROM shares_tbl GROUP BY report_id\n\t\t\t\t) tb2\n\t\t\t\tON report_tbl.id = tb2.report_id\n\t\t\t\torder by sharecounter desc\n\t\t\t\tlimit :from, :to;\";\n\t\t\n\t\t$prepared = $db->prepare($string_prep_query);\n\t\t$prepared->bindParam(\":from\", $from, PDO::PARAM_INT);\n $prepared->bindParam(\":to\", $to, PDO::PARAM_INT);\n\t\t$status = $prepared->execute();\n\t\t\n\t\t/*if($status)\n\t\t\tcetakDataPesanan($prepared->fetch());\n\t\t\n\t\t$db = null;\n\t\treturn $status;*/\n\t\t$ret = $prepared->fetchAll();\n\t\t$db = null;\n\t\treturn $ret;\n\t}", "function pdo_preparedStmt($pdo,$query,$parmList,$parmData){\n$sql = $pdo->prepare($query);\nfor ($i=0; $i < count($parmList); $i++) { \n $sql->bindParam($parmList[$i], $parmData[$i]);\n}\n\nreturn $sql->execute();\n}", "function getTodosProdutos($order='titulo ASC', $startwith=null, $simple=true)\n{\n global $conn;\n\n $order = !empty($order) ? $order : 'titulo ASC';\n $whr = null;\n $sql = \"SELECT\n pro_id,\n pro_titulo,\n pro_tipo,\n pro_valor\n FROM \".TP.\"_produto\n WHERE pro_status=1\n ORDER BY pro_{$order};\";\n $lst = array();\n if(!$qry = $conn->prepare($sql))\n echo divAlert($conn->error, 'error');\n\n else {\n\n $qry->execute();\n $qry->bind_result($id, $titulo, $tipo, $valor);\n\n if (!empty($startwith))\n $lst[0] = array('id'=>0, 'titulo'=>$startwith);\n\n $i=1;\n while ($qry->fetch()) {\n if (!$simple)\n $i = linkfySmart($titulo);\n\n $lst[$i]['id'] = $id;\n $lst[$i]['titulo'] = mb_strtoupper($titulo, 'utf8');\n $lst[$i]['tipo'] = $tipo;\n $lst[$i]['valor'] = 'R$ '.Moeda($valor);\n $lst[$i]['valor_decimal'] = $valor;\n\n if ($simple)\n $i++;\n }\n\n $qry->close();\n\n return $lst;\n }\n\n}", "function doQuery($pdo, $query, $parameters)\r\n{\r\n\t//this is really the only function of importance in this document. all the other functions are just to make the code look nice.\r\n\t$pdoQuery = $pdo->prepare($query);\r\n\tforeach ($parameters as $key=>$x) {\r\n\t\t$pdoQuery->bindParam($key+1, $x);\r\n\t}\r\n\t$pdoQuery->execute();\r\n\treturn $pdoQuery->fetch();\r\n}", "public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}", "public function prepare($sql, $params);", "public function prepare(/*# string */ $sql)/*# : bool */;", "function aggiungiIndirizzo($pratica,$indirizzo){\n $dbh=new PDO(DSN);\n $schema=\"pe\";\n $params = Array(\"via\",\"civico\",\"interno\");\n foreach($params as $key){\n $data[$key]=($indirizzo[$key])?($indirizzo[$key]):(null);\n }\n $data[\"pratica\"]=$pratica;\n utils::debug(utils::debugDir.\"aggiungiIndirizzo.debug\", $data);\n $result=Array();\n $sql=\"INSERT INTO $schema.indirizzi(pratica,civico,interno,via) VALUES(:pratica,:civico,:interno,:via);\";\n $stmt=$dbh->prepare($sql);\n \n if (!$stmt->execute($data)){\n $errors=$stmt->errorInfo();\n utils::debug(utils::debugDir.\"error-aggiungiIndirizzo.debug\", $errors);\n }\n else{\n $idindirizzo=$dbh->lastInsertId(\"pe.soggetti_id_seq\");\n }\n \n if ($errors){\n //$dbh->rollBack();\n $result=Array(\"success\"=>\"-1\",\"message\"=>$errors[2]);\n }\n else{\n $result = Array(\"success\"=>1,\"message\"=>\"OK\",\"indirizzo\"=>$idindirizzo);\n }\n return $result;\n}", "public function query($sql){\r\n $this->stmt = $this->dbh->prepare($sql);\r\n }", "function consultar_comprobante_por_status($status, $id_subdiario, $where, $sort, $limit) {\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo\n ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes\n ON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio\n ON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario\n ON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\n ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante) \n INNER JOIN prosic_moneda\n ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n\tWHERE prosic_comprobante.status_comprobante ='\" . $status . \"' AND prosic_subdiario.id_subdiario=\" . $id_subdiario . \" $where $short $limit\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function prepare( $sql ){\n $this->stmt = $this->pdo->prepare( $sql );\n }", "public function runQuery($sql){\n $stmt = $this->pdo->prepare($sql);\n return $stmt;\n }", "final public function prepare($statement = NULL, $offset = 0, $limit = 0, $prefix='') {\n\n //Sets the query to be executed;\n\n $cfg = Config::getParamSection('database');\n\n\n $this->offset = (int) $offset;\n $this->limit = (int) $limit;\n $this->prefix = (!isset($prefix) && !empty($prefix)) ? $prefix : $cfg['prefix'];\n $this->query = $this->replacePrefix($statement);\n\n //Get the Result Statement class;\n $options = array(\n \"dbo\" => $this,\n \"driver\" => $this->driver\n );\n\n $RESULT = \\Library\\Database\\Results::getInstance($options);\n\n //$this->resetRun();\n //Driver Statements, handle the execute\n return $RESULT;\n }", "function pre_query() { \r\n // Unset invalid date values before the query runs.\r\n if (!empty($this->view->args) && count($this->view->args) > $this->position) {\r\n $argument = $this->view->args[$this->position];\r\n $parts = $this->date_handler->arg_parts($argument);\r\n if (empty($parts[0]['date']) && empty($parts[0]['period'])) {\r\n unset($this->view->args[$this->position]); \r\n }\r\n }\r\n \r\n $this->get_query_fields();\r\n if (!empty($this->query_fields)) {\r\n foreach ($this->query_fields as $query_field) {\r\n $field = $query_field['field'];\r\n // Explicitly add this table using add_table so Views does not\r\n // remove it if it is a duplicate, since that will break the query.\r\n $this->query->add_table($field['table_name'], NULL, NULL, $field['table_name']);\r\n }\r\n }\r\n }", "public function selectByFilter($orderDataVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($orderDataVo)) $orderDataVo = new OrderDataVo();\n$sql = \"select * from `order_data` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($orderDataVo->orderDataId)){ //If isset Vo->element\n$fieldValue=$orderDataVo->orderDataId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order_data_id` $key :orderDataIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order_data_id` $key :orderDataIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderDataIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderDataIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order_data_id` = :orderDataIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `order_data_id` = :orderDataIdKey';\n}\n$params[]=array(':orderDataIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($orderDataVo->orderId)){ //If isset Vo->element\n$fieldValue=$orderDataVo->orderId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order_id` $key :orderIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order_id` $key :orderIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order_id` = :orderIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `order_id` = :orderIdKey';\n}\n$params[]=array(':orderIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($orderDataVo->data)){ //If isset Vo->element\n$fieldValue=$orderDataVo->data;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `data` $key :dataKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `data` $key :dataKey\";\n}\nif($type == 'str') {\n $params[] = array(':dataKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':dataKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `data` = :dataKey';\n$isFirst=false;\n}else{\n$condition.=' and `data` = :dataKey';\n}\n$params[]=array(':dataKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('OrderDataVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "function query_array($sql=null)\n{\nglobal $db,$debug;\n \ntry { \n if ($debug) \n $time_start = microtime(true); \n \n $stmt = $this->db['conn']->prepare($sql);\n $stmt->execute();\n \n if ($debug){\n $time = microtime(true)- $time_start; \n echo \"<HR>Executed SQL:<strong> $sql </strong> in <strong>$time</strong> s<HR>\";\n }\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC); //PDO::FETCH_NUM | PDO::FETCH_ASSOC\n return $results ;\n} catch (PDOException $e) {\n $this->fatal_error(\" Database Error!: <strong>\". $e->getMessage() .\"</strong> SQL: $sql <br /> Using DSN \".$this->db['dsn'].\"<br/>\");\n die(); die();\n}\n\n}", "function __construct(PDO &$p_connection, array $param = array())\n {\n $this->connection = $p_connection;\n if (!is_array($this->paramori)) {\n $this->paramori = $param;\n }\n if (!is_array($this->param)) {\n $this->param = $param;\n }\n /*\n * configuration de la connexion\n */\n $this->typeDatabase = $this->connection->getAttribute($p_connection::ATTR_DRIVER_NAME);\n\n $this->connection->setAttribute($p_connection::ATTR_DEFAULT_FETCH_MODE, $p_connection::FETCH_ASSOC);\n /*\n * Preparation des tableaux intermediaires a partir du tableau $colonnes\n */\n if (is_array($this->colonnes)) {\n $this->keys = array();\n $nbcle = 0;\n foreach ($this->colonnes as $key => $value) {\n /*\n * Preparation du tableau des cles\n */\n if ($value[\"key\"] == 1 || $value[\"cle\"] == 1) {\n $this->keys[] = $key;\n $nbcle++;\n $this->cle = $key;\n }\n /*\n * Affectation de l'attribut parent\n */\n if (strlen($value[\"parentAttrib\"]) > 0) {\n $this->parentAttrib = $key;\n }\n }\n\n /*\n * Analyse de la cle\n */\n if ($nbcle < 2) {\n $this->cleMultiple = 0;\n } else {\n $this->cleMultiple = 1;\n $this->cle = \"\";\n }\n }\n /*\n * Integration des parametres utilisateur\n */\n $this->setParam($param);\n /*\n * Integration du codage UTF8\n */\n\n if ($this->UTF8) {\n if ($this->typeDatabase == \"mysql\") {\n $this->connection->exec(\"set names 'utf8'\");\n } else {\n $this->connection->exec(\"SET CLIENT_ENCODING TO UTF8\");\n }\n }\n /*\n * Definition du mode de gestion des erreurs\n */\n if ($this->debug_mode > 0) {\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } else {\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);\n }\n /*\n * Ajout du identifier quote character\n */\n if ($this->typeDatabase == 'pgsql') {\n $this->quoteIdentifier = '\"';\n } elseif ($this->typeDatabase == 'mysql') {\n $this->quoteIdentifier = '`';\n }\n }", "function parse_query($query){\n $patern='/^SELECT\\s+\\w+\\s+FROM(\\s+(\\w+|\\w+\\.\\w+|\\.\\w+))?(\\s+WHERE\\s+((NOT\\s+)?)*((\\w+)|(\\w+\\.\\w+)|(\\.\\w+))(\\s+)*(=|>|<|CONTAINS)(\\s+)*((\\\"\\w+\\\")|(\\d+)))?(\\s+)?(\\s+LIMIT\\s+\\d+)?(\\s+)?$/';\n $constants = array('SELECT','FROM', 'LIMIT','WHERE','ROOT','NOT');\n\n if(! preg_match($patern, $query))\n {\n exit_program(\"Bad query, try to use -help or --help\\n\",code_error::error_query);\n }\n\n // SELECT\n\n preg_match('/SELECT\\s+(\\w+)\\s/', $query, $parsed['SELECT']);\n $parsed['SELECT']=$parsed['SELECT'][1];\n if((in_array($parsed['SELECT'], $constants)) | (is_numeric($parsed['SELECT'])))\n {\n exit_program(\"Bad query (SELECT), try to use -help or --help\\n\",code_error::error_query);\n }\n\n // FROM \n preg_match('/FROM(\\s*)(\\w+|\\w+\\.\\w+|\\.\\w+)?($|\\s+)/', $query, $parsed['FROM']);\n $parsed['FROM'] = preg_split(\"/\\./\",$parsed['FROM'][2]);\n if(preg_match('/FROM\\s+WHERE\\s+WHERE\\s+/', $query) | (is_numeric($parsed['FROM'])))\n {\n exit_program(\"Bad query (FROM), try to use -help or --help\\n\",code_error::error_query);\n }\n if((in_array($parsed['FROM'], $constants)) && ($parsed['FROM'] != \"ROOT\"))\n {\n if($parsed['FROM']==\"WHERE\")\n {\n $parsed['FROM']=\"\";\n }\n else\n {\n exit_program(\"Bad query (FROM), try to use -help or --help\\n\",code_error::error_query);\n }\n } \n\n // WHERE\n \n if(strpos($query,'WHERE'))\n {\n if(preg_match('/WHERE\\s+(((NOT\\s+)?)*((\\w+)|(\\w+\\.\\w+)|(\\.\\w+))(\\s+)*(=|>|<|CONTAINS)(\\s+)*((\\\"\\w+\\\")|(\\d+)))($|\\s)/', $query, $parsed['WHERE']) == 0)\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n $parsed['WHERE']=$parsed['WHERE'][1];\n // REMOVE NOT\n $parsed['WHERE']=str_replace(\"NOT \", \"\", $parsed['WHERE'], $not_clause);\n preg_match('/(\\w+|\\w+\\.\\w+|\\.\\w+)\\s*?(=|>|<|CONTAINS)\\s*?(\\\"\\w+\\\"|\\d+)/', $parsed['WHERE'],$clause);\n $parsed['WHERE']=array();\n // OPERATOR FOR WHERE\n $parsed['WHERE'][2]=$clause[2];\n // VALUE OF LITERAL\n if(substr($clause[3], 0,1) == '\"' && substr($clause[3], -1) == '\"')\n {\n $clause[3] = substr($clause[3], 1, -1);\n }\n else\n $clause[3] = (double)$clause[3];\n $parsed['WHERE'][3]=$clause[3];\n // VALUE OF ATTRIBUTTE\n $clause=preg_split(\"/[.]/\", $clause[1]);\n $parsed['WHERE'][0]=$clause[0];\n if(isset($clause[1]))\n {\n $parsed['WHERE'][1]=$clause[1];\n if(is_numeric($parsed['WHERE'][1][0]))\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n }\n else\n $parsed['WHERE'][1]=\"\";\n\n // NOT\n if(($not_clause%2)==0)\n {\n $parsed['WHERE'][4]=false;\n }\n else\n $parsed['WHERE'][4]=true;\n\n if(($parsed['WHERE'][2] == \"CONTAINS\")&&(gettype($parsed['WHERE'][3])!=\"string\"))\n {\n exit_program(\"Bad query (WHERE), try to use -help or --help\\n\",code_error::error_query);\n }\n }\n // LIMIT\n if(strpos($query,'LIMIT'))\n {\n preg_match('/LIMIT\\s(\\d+)(\\s+)?$/', $query, $parsed['LIMIT']);\n $parsed['LIMIT']=(int)$parsed['LIMIT'][1];\n }\n return $parsed;\n}", "function query($query){\r\n if($this->query = $this->connection->prepare($query)){\r\n $this->query->execute();\r\n //cek kalo error\r\n if ($this->query->errno){\r\n die(\"otak anda error: \". $this->query->error);\r\n }\r\n }else{\r\n die(\"Error execution: \". $this->query->error);\r\n }\r\n }", "public function selectByFilter($routerVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($routerVo)) $routerVo = new RouterVo();\n$sql = \"select * from `router` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($routerVo->routerId)){ //If isset Vo->element\n$fieldValue=$routerVo->routerId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `router_id` $key :routerIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `router_id` $key :routerIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':routerIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':routerIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `router_id` = :routerIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `router_id` = :routerIdKey';\n}\n$params[]=array(':routerIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->layoutId)){ //If isset Vo->element\n$fieldValue=$routerVo->layoutId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `layout_id` $key :layoutIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `layout_id` $key :layoutIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `layout_id` = :layoutIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `layout_id` = :layoutIdKey';\n}\n$params[]=array(':layoutIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->pkName)){ //If isset Vo->element\n$fieldValue=$routerVo->pkName;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `pk_name` $key :pkNameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `pk_name` $key :pkNameKey\";\n}\nif($type == 'str') {\n $params[] = array(':pkNameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':pkNameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `pk_name` = :pkNameKey';\n$isFirst=false;\n}else{\n$condition.=' and `pk_name` = :pkNameKey';\n}\n$params[]=array(':pkNameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->prefix)){ //If isset Vo->element\n$fieldValue=$routerVo->prefix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `prefix` $key :prefixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `prefix` $key :prefixKey\";\n}\nif($type == 'str') {\n $params[] = array(':prefixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':prefixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `prefix` = :prefixKey';\n$isFirst=false;\n}else{\n$condition.=' and `prefix` = :prefixKey';\n}\n$params[]=array(':prefixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->suffix)){ //If isset Vo->element\n$fieldValue=$routerVo->suffix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `suffix` $key :suffixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `suffix` $key :suffixKey\";\n}\nif($type == 'str') {\n $params[] = array(':suffixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':suffixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `suffix` = :suffixKey';\n$isFirst=false;\n}else{\n$condition.=' and `suffix` = :suffixKey';\n}\n$params[]=array(':suffixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->alias)){ //If isset Vo->element\n$fieldValue=$routerVo->alias;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias` $key :aliasKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias` $key :aliasKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias` = :aliasKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias` = :aliasKey';\n}\n$params[]=array(':aliasKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasBy)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasBy;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_by` $key :aliasByKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_by` $key :aliasByKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasByKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasByKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_by` = :aliasByKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_by` = :aliasByKey';\n}\n$params[]=array(':aliasByKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasList)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasList;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_list` $key :aliasListKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_list` $key :aliasListKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasListKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasListKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_list` = :aliasListKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_list` = :aliasListKey';\n}\n$params[]=array(':aliasListKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->callback)){ //If isset Vo->element\n$fieldValue=$routerVo->callback;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `callback` $key :callbackKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `callback` $key :callbackKey\";\n}\nif($type == 'str') {\n $params[] = array(':callbackKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':callbackKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `callback` = :callbackKey';\n$isFirst=false;\n}else{\n$condition.=' and `callback` = :callbackKey';\n}\n$params[]=array(':callbackKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('RouterVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "function pdo_query(PDO $pdo, $query_string, $query_inputs = null)\n {\n $query_inputs = is_array($query_inputs) ? $query_inputs : array_slice(func_get_args(), 2);\n $prep = $pdo->prepare($query_string);\n $prep->execute((array) $query_inputs);\n return $prep;\n }", "public function ejecutar_una_consulta($query){\n $response=self::ConnectDB()->prepare($query);\n $response->execute();\n return $response;\n }", "function requete_bdd($bdd, $req){\n\t\t\t\n\t\t\t$query = $bdd->prepare($req);\n\t\t\treturn $query;\n\t\t\t/* returned variable is an pdo object */\n\t\t}", "function parsingSql()\r\n\t{\r\n\t\tif ( preg_match(\"/{(.*?)}/\",$this->sql,$match) )\r\n\t\t{\r\n\t\t\t$this->valueToReplace = $match[0]; // {blabla}\r\n\t\t\t$this->fieldToSelect = $match[1]; // nama field yang akan di cek\r\n\t\t}else{\r\n\t\t\tdie(\"SQL query yg anda masukan harus mengandung {}\");\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}", "function startsql()\r\n{\r\n require \".inc/config.php\"; // import configuration\r\n $db = new PDO(\"$db_type:host=$db_host;dbname=$db_name\",$db_user,$db_pass); // initialize DB connection\r\n $db->query(\"SET NAMES 'utf8' COLLATE 'utf8_general_ci'\"); // set UTF8 as character set\r\n $db->query('SET CHARACTER SET utf8');\r\n return $db; // function returns the PDO class\r\n}" ]
[ "0.70094097", "0.68753254", "0.6814938", "0.6691309", "0.6668082", "0.6652417", "0.6521593", "0.64841115", "0.64768386", "0.6451954", "0.6439241", "0.64310646", "0.6323444", "0.6302723", "0.62936795", "0.6283903", "0.62721497", "0.62216", "0.62006897", "0.6152584", "0.6147673", "0.6136739", "0.613108", "0.6121298", "0.61190474", "0.6117596", "0.61053056", "0.609958", "0.60980904", "0.60975295", "0.60907197", "0.60812616", "0.6077878", "0.6064476", "0.60525036", "0.604615", "0.6021233", "0.60162795", "0.60160357", "0.6011987", "0.601047", "0.5998052", "0.598342", "0.59759295", "0.5974054", "0.5971371", "0.5970528", "0.59642434", "0.59525585", "0.5946233", "0.5946233", "0.594508", "0.5941919", "0.59403986", "0.5938754", "0.5932298", "0.5929047", "0.59289294", "0.5918189", "0.591081", "0.5900842", "0.5884457", "0.5877991", "0.5873764", "0.58682835", "0.58664674", "0.5861185", "0.58610076", "0.58509105", "0.5844554", "0.58431274", "0.5834947", "0.5834255", "0.58318967", "0.58287627", "0.58262336", "0.5822947", "0.5805411", "0.58043426", "0.5798315", "0.5788274", "0.578507", "0.5785008", "0.5784471", "0.5780828", "0.5776938", "0.5772385", "0.57607985", "0.57600284", "0.5746338", "0.5746326", "0.574306", "0.57428837", "0.5740465", "0.5736939", "0.5736461", "0.57360744", "0.57326794", "0.57281524", "0.57256234", "0.57236946" ]
0.0
-1
Custom hooks (like excerpt length etc) Programatically create pages
function create_custom_pages() { $custom_pages = array( 'issues' => 'Issues', 'weeklies' => 'Weeklies', 'artists' => 'Artists', 'contributors' => 'Contributors', 'incubator' => 'Incubator', 'about' => 'About', 'shop' => 'Shop', 'contribute' => 'How to Contribute', 'contact' => 'Contact Us', 'faq' => 'FAQ', 'definitions' => 'Definitions', 'terms-and-conditions' => 'Terms & Conditions', 'bag' => 'Bag', ); foreach($custom_pages as $page_name => $page_title) { $page = get_page_by_path($page_name); if( empty($page) ) { wp_insert_post( array( 'post_type' => 'page', 'post_title' => $page_title, 'post_name' => $page_name, 'post_status' => 'publish' )); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prePageContent();", "function createPage();", "abstract protected function view_generatePageContent();", "static public function createPages() {\n\t\treturn false;\n\t}", "function create_custom_pages() {\n $custom_pages = array(\n 'home' => 'Home',\n );\n foreach($custom_pages as $page_name => $page_title) {\n $page = get_page_by_path($page_name);\n if( empty($page) ) {\n wp_insert_post( array(\n 'post_type' => 'page',\n 'post_title' => $page_title,\n 'post_name' => $page_name,\n 'post_status' => 'publish'\n ));\n }\n }\n\n // Set static Homepage\n $home = get_page_by_path('home');\n update_option( 'page_on_front', $home->ID );\n update_option( 'show_on_front', 'page' );\n}", "protected function setupPage() {}", "public function add_page_excerpts() {\n add_post_type_support( 'page', 'excerpt' );\n }", "function add_excerpts_to_pages() {\n\t\tadd_post_type_support('page', 'excerpt');\n\t}", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "function total_add_excerpts_to_pages() {\n add_post_type_support('page', 'excerpt');\n}", "function tsk_add_excerpts_to_pages() {\n\t\tadd_post_type_support( 'page', 'excerpt' );\n\t}", "function newPage($title,$pageslug='',$sbar=true) {\r\n\tglobal $WebPagesList;\r\n\tif( $pageslug=='' ) {\r\n\t\t$pageslug = $title;\r\n\t\t$pageslug = strtolower( $pageslug );\r\n\t\t$pageslug = str_replace( array(',',\"'\",'?','/','*','(',')','@','!','&','='),'',$pageslug );\r\n\t\t$pageslug = str_replace( array(' '),'-', $pageslug );\r\n\t}\r\n\treturn array( 'title'=>$title, 'inSidebar'=>$sbar, 'order'=>(count($WebPagesList)+1), 'pageslug'=>$pageslug );\r\n}", "public function generatePage_postProcessing() {}", "public function run()\n {\n $pages = [\n [\n 'id' => 1,\n 'title' => 'About Minecrafter',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 2,\n 'title' => 'Privacy policy',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 3,\n 'title' => 'General Terms',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 4,\n 'title' => 'Store Terms',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 5,\n 'title' => 'Reports',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 6,\n 'title' => 'Rules',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n [\n 'id' => 7,\n 'title' => 'Youtuber Apply',\n 'page_text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque condimentum, enim nec molestie viverra, lacus nisl accumsan enim, at porta eros odio at dui. Integer quis sem pellentesque, consectetur arcu eget, rutrum dolor. Praesent mauris felis, fringilla sit amet hendrerit vel, finibus at sapien. Suspendisse ut feugiat nunc, at dictum turpis. Nam eget tortor sit amet risus iaculis ultrices ac sed elit. Nunc vestibulum fringilla est non tincidunt. Cras sed mauris nec libero aliquet blandit et ut ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Morbi pretium augue tellus, at faucibus urna eleifend sed. Nullam faucibus justo quam, non porta elit eleifend vitae.'\n ],\n ];\n\n ContentPage::insert($pages);\n }", "function eventon_create_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0 ) {\n\tglobal $wpdb;\n\n\t$option_value = get_option( $option );\n\n\tif ( $option_value > 0 && get_post( $option_value ) )\n\t\treturn;\n\n\t$page_found = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM \" . $wpdb->posts . \" WHERE post_name = %s LIMIT 1;\", $slug ) );\n\tif ( $page_found ) {\n\t\tif ( ! $option_value )\n\t\t\tupdate_option( $option, $page_found );\n\t\treturn;\n\t}\n\n\t$page_data = array(\n 'post_status' \t\t=> 'publish',\n 'post_type' \t\t=> 'page',\n 'post_author' \t\t=> 1,\n 'post_name' \t\t=> $slug,\n 'post_title' \t\t=> $page_title,\n 'post_content' \t\t=> $page_content,\n 'post_parent' \t\t=> $post_parent,\n 'comment_status' \t=> 'closed'\n );\n $page_id = wp_insert_post( $page_data );\n\n update_option( $option, $page_id );\n}", "function page_generatePage($page_id=0,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language,$previewMode;\n\n\t## prepare the multiclient support\n\t$client_id = $Auth->auth[\"client_id\"];\t\n\n\t## get the page info- and the homepage if we don't have a page\n\t$pageInfo = frontend_getPageInfo($page_id,$client_id);\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\n\t## try to fetch the cached scaffold page\n\t$cached_scaffold = pagecache_getCacheFile($page_id);\n\n\t## check if we have a scaffold\n\tif($cached_scaffold === false) {\n\t\t## we need to create a new scaffold file\n\t\t$cached_scaffold = page_generateScaffold($pageInfo,$offset,$extravars);\n\t}\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\tif($dbConnection->next_record()) {\n\t\t$filename = $dbConnection->Record[\"basename\"];\n\t\t$xmlFile = $filename.\".xml\";\n\t\t$filename = $filename.\".tpl\";\n\t} else {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getCacheElements();\t\n\t$objects = $wt->getCacheObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\t\n\t$counter = 0;\n\t$num_elements = count($elements);\n\t\n\twhile($counter < $num_elements) {\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\t\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'IMAGE': \n\t\t\tcase 'LINKLIST': \n\t\t\tcase 'BOX':\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\teval(\"\\$element = output_\".$target.\"(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,$page_id);\");\t\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t\n\t\t\t\teval(\"\\$element = output_\".$target.\"('',\\$elements[\\$counter],$menu_id,$page_id);\");\n\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t$varvals = array();\n\t\t\t\t\n\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t} else {\n\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,\\$page_id);\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t##var_dump(eval();\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record,\\$elements[\\$counter],\\$layout_template,\\$menu_id,\\$page_id);\");\n\t\t\t\t\t}\t\n\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\n\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## finally strip all empty tags\n\t$cached_scaffold = preg_replace('/{[^ \\t\\r\\n}]+}/', \"\", $cached_scaffold); \n\n\t## this is it- so we will flush the template here\t\t\n\treturn $cached_scaffold;\n}", "public function createContentAndCopyLivePage() {}", "public function generatePage_preProcessing() {}", "function create_pages() {\r\n\r\n $wpc_pages = $this->pre_set_pages();\r\n\r\n $wpc_client_page = get_page_by_title( 'Portal' );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => 'Portal',\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => '[wpc_redirect_on_login_hub]',\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed'\r\n );\r\n $parent_page_id = wp_insert_post( $args );\r\n }\r\n\r\n $settings = get_option( 'wpc_settings' );\r\n\r\n foreach( $wpc_pages as $wpc_page ) {\r\n\r\n $wpc_client_page = get_page_by_title( $wpc_page['name'] );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => $wpc_page['name'],\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => $wpc_page['content'],\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed',\r\n 'post_parent' => $parent_page_id,\r\n );\r\n $page_id = wp_insert_post( $args );\r\n\r\n $settings['pages'][$wpc_page['id']] = $page_id;\r\n }\r\n\r\n\r\n }\r\n\r\n update_option( 'wpc_settings', $settings );\r\n\r\n }", "function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function tbx_add_excerpts_to_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function tc_generates_featured_pages() {\r\n $default = array(\r\n 'dropdown' => array(\r\n 'one' => __( 'Home featured page one' , 'customizr' ),\r\n 'two' => __( 'Home featured page two' , 'customizr' ),\r\n 'three' => __( 'Home featured page three' , 'customizr' )\r\n ),\r\n 'text' => array(\r\n 'one' => __( 'Featured text one (200 car. max)' , 'customizr' ),\r\n 'two' => __( 'Featured text two (200 car. max)' , 'customizr' ),\r\n 'three' => __( 'Featured text three (200 car. max)' , 'customizr' )\r\n )\r\n );\r\n\r\n //declares some loop's vars and the settings array\r\n $priority = 70;\r\n $incr = 0;\r\n $fp_setting_control = array();\r\n\r\n //gets the featured pages id from init\r\n $fp_ids = apply_filters( 'tc_featured_pages_ids' , TC_init::$instance -> fp_ids);\r\n\r\n //dropdown field generator\r\n foreach ( $fp_ids as $id ) {\r\n $priority = $priority + $incr;\r\n $fp_setting_control['tc_theme_options[tc_featured_page_'. $id.']'] = array(\r\n 'label' => isset($default['dropdown'][$id]) ? $default['dropdown'][$id] : sprintf( __('Custom featured page %1$s' , 'customizr' ) , $id ),\r\n 'section' => 'tc_frontpage_settings' ,\r\n 'type' => 'dropdown-pages' ,\r\n 'priority' => $priority\r\n );\r\n $incr += 10;\r\n }\r\n\r\n //text field generator\r\n $incr = 10;\r\n foreach ( $fp_ids as $id ) {\r\n $priority = $priority + $incr;\r\n $fp_setting_control['tc_theme_options[tc_featured_text_' . $id . ']'] = array(\r\n 'sanitize_callback' => array( $this , 'tc_sanitize_textarea' ),\r\n 'transport' => 'postMessage',\r\n 'control' => 'TC_controls' ,\r\n 'label' => isset($default['text'][$id]) ? $default['text'][$id] : sprintf( __('Featured text %1$s (200 car. max)' , 'customizr' ) , $id ),\r\n 'section' => 'tc_frontpage_settings' ,\r\n 'type' => 'textarea' ,\r\n 'notice' => __( 'You need to select a page first. Leave this field empty if you want to use the page excerpt.' , 'customizr' ),\r\n 'priority' => $priority,\r\n );\r\n $incr += 10;\r\n }\r\n\r\n return $fp_setting_control;\r\n }", "function user_add_excerpts_to_pages() {\n add_post_type_support( 'page', 'excerpt' );\n}", "function createSamplePage(){\n\tif(the_slug_exists('custom-page')==false)\n\t{\n\t\tglobal $user_ID;\n\t $new_post = array(\n 'post_title' => 'Custom Page',\n 'post_content' => 'Sample content here',\n 'post_status' => 'publish',\n 'post_date' => date('Y-m-d H:i:s'),\n 'post_author' => $user_ID,\n 'post_type' => 'page',\n );\n $post_id = wp_insert_post($new_post);\n\t}\n}", "function my_add_excerpts_to_pages()\n{\n add_post_type_support('page', 'excerpt');\n}", "function orderPageConstruct(){\n $hook=new hooks();\n $hook->orderPage(true);\n}", "public function generate() {\n\t\t$data = [\n\t\t\t'@type' => $this->determine_page_type(),\n\t\t\t'@id' => $this->context->canonical . WPSEO_Schema_IDs::WEBPAGE_HASH,\n\t\t\t'url' => $this->context->canonical,\n\t\t\t'name' => $this->context->title,\n\t\t\t'isPartOf' => [\n\t\t\t\t'@id' => $this->context->site_url . WPSEO_Schema_IDs::WEBSITE_HASH,\n\t\t\t],\n\t\t];\n\n\t\t$data = WPSEO_Schema_Utils::add_piece_language( $data );\n\n\t\tif ( is_front_page() ) {\n\t\t\tif ( $this->context->site_represents_reference ) {\n\t\t\t\t$data['about'] = $this->context->site_represents_reference;\n\t\t\t}\n\t\t}\n\n\t\tif ( is_singular() ) {\n\t\t\t$this->add_image( $data );\n\n\t\t\t$post = get_post( $this->context->id );\n\t\t\t$data['datePublished'] = $this->date->format( $post->post_date_gmt );\n\t\t\t$data['dateModified'] = $this->date->format( $post->post_modified_gmt );\n\n\t\t\tif ( get_post_type( $post ) === 'post' ) {\n\t\t\t\t$data = $this->add_author( $data, $post );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->context->description ) ) {\n\t\t\t$data['description'] = strip_tags( $this->context->description, '<h1><h2><h3><h4><h5><h6><br><ol><ul><li><a><p><b><strong><i><em>' );\n\t\t}\n\n\t\tif ( $this->add_breadcrumbs() ) {\n\t\t\t$data['breadcrumb'] = [\n\t\t\t\t'@id' => $this->context->canonical . WPSEO_Schema_IDs::BREADCRUMB_HASH,\n\t\t\t];\n\t\t}\n\n\t\t$data = $this->add_potential_action( $data );\n\n\t\treturn $data;\n\t}", "public function indexTypo3PageContent() {}", "function acadp_insert_custom_pages() {\n\n\t// Vars\n\t$page_settings = get_option( 'acadp_page_settings', array() );\n\n\t$page_definitions = array(\n\t\t'listings' => array(\n\t\t\t'title' => __( 'Listings', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_listings]'\n\t\t),\n\t\t'locations' => array(\n\t\t\t'title' => __( 'Listing Locations', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_locations]'\n\t\t),\n\t\t'location' => array(\n\t\t\t'title' => __( 'Listing Location', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_location]'\n\t\t),\n\t\t'categories' => array(\n\t\t\t'title' => __( 'Listing Categories', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_categories]'\n\t\t),\n\t\t'category' => array(\n\t\t\t'title' => __( 'Listing Category', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_category]'\n\t\t),\n\t\t'search' => array(\n\t\t\t'title' => __( 'Search Listings', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_search]'\n\t\t),\n\t\t'user_listings' => array(\n\t\t\t'title' => __( 'User Listings', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_user_listings]'\n\t\t),\n\t\t'user_dashboard' => array(\n\t\t\t'title' => __( 'User Dashboard', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_user_dashboard]'\n\t\t),\n\t\t'listing_form' => array(\n\t\t\t'title' => __( 'Listing Form', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_listing_form]'\n\t\t),\n\t\t'manage_listings' => array(\n\t\t\t'title' => __( 'Manage Listings', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_manage_listings]'\n\t\t),\n\t\t'favourite_listings' => array(\n\t\t\t'title' => __( 'Favourite Listings', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_favourite_listings]'\n\t\t),\n\t\t'checkout' => array(\n\t\t\t'title' => __( 'Checkout', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_checkout]'\n\t\t),\n\t\t'payment_receipt' => array(\n\t\t\t'title' => __( 'Payment Receipt', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_payment_receipt]'\n\t\t),\n\t\t'payment_failure' => array(\n\t\t\t'title' => __( 'Transaction Failed', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_payment_errors]'.__( 'Your transaction failed, please try again or contact site support.', 'advanced-classifieds-and-directory-pro' ).'[/acadp_payment_errors]'\n\t\t),\n\t\t'payment_history' => array(\n\t\t\t'title' => __( 'Payment History', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_payment_history]'\n\t\t),\n\t\t'login_form' => array(\n\t\t\t'title' => __( 'Login', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_login]'\n\t\t),\n\t\t'register_form' => array(\n\t\t\t'title' => __( 'Register', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_register]'\n\t\t),\n\t\t'user_account' => array(\n\t\t\t'title' => __( 'Account', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_user_account]'\n\t\t),\n\t\t'forgot_password' => array(\n\t\t\t'title' => __( 'Forgot Password', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_forgot_password]'\n\t\t),\n\t\t'password_reset' => array(\n\t\t\t'title' => __( 'Password Reset', 'advanced-classifieds-and-directory-pro' ),\n\t\t\t'content' => '[acadp_password_reset]'\n\t\t)\n\t);\n\n\t// ...\n\t$pages = array();\n\n\tforeach( $page_definitions as $slug => $page ) {\n\n\t\t$id = 0;\n\n\t\tif( array_key_exists( $slug, $page_settings ) ) {\n\t\t\t$id = (int) $page_settings[ $slug ];\n\t\t}\n\n\t\tif( ! $id ) {\n\t\t\t$id = wp_insert_post(\n\t\t\t\tarray(\n\t\t\t\t\t'post_title' => $page['title'],\n\t\t\t\t\t'post_content' => $page['content'],\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'post_author' => 1,\n\t\t\t\t\t'post_type' => 'page',\n\t\t\t\t\t'comment_status' => 'closed'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$pages[ $slug ] = $id;\n\n\t}\n\n\treturn $pages;\n\n}", "function app_data_pages($slug) {\n\tglobal $Slim;\n\t$pages = array('home', 'sample');\n\tif ( ! in_array($slug, $pages) ) {\n\t\treturn NULL;\n\t}\n\n\t$content = '';\n\tswitch($slug) {\n\t\tcase 'home':\n $content = <<<HTML\n\n<h1>Home</h1>\n\n<h2>Welcome to Abstract CMS</h2>\n\n<p>Sed ultricies nunc vel posuere euismod. Aenean in sapien adipiscing, scelerisque mauris vel, \ndapibus nisl. Suspendisse venenatis dolor ipsum, vel lobortis dolor commodo ac. Nam ullamcorper \nadipiscing felis, vitae consequat magna sagittis non. Aenean nunc elit, interdum quis dignissim \ndignissim, aliquet nec leo. Quisque fermentum tempor volutpat. Ut ut arcu vel nunc porta \nvehicula.</p>\n\nHTML;\n\t\t\tbreak;\n\t\tcase 'sample':\n $content = <<<HTML\n\n<h1>Sample Page</h1>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas tincidunt tristique fringilla. \nDuis malesuada, neque vel cursus placerat, augue risus tristique lacus, id tincidunt orci eros in erat. \nDonec adipiscing tincidunt gravida. Suspendisse erat ante, feugiat ac malesuada quis, aliquam eget felis. \nDonec viverra metus enim, ac ultricies justo ultrices vitae. Maecenas adipiscing pharetra augue in \nvolutpat. Morbi tortor lorem, dictum nec sollicitudin eu, venenatis sed massa. Aenean ac ultricies \nmetus. Morbi tristique felis tortor. Pellentesque habitant morbi tristique senectus et netus et \nmalesuada fames ac turpis egestas. In ac elit sed purus fringilla rhoncus. Nam aliquam euismod \nultrices. Morbi condimentum vulputate ipsum, nec elementum nisi sodales id. Aliquam ac euismod \nturpis, vitae porta nibh.</p>\n\n<p>Sed ultricies nunc vel posuere euismod. Aenean in sapien adipiscing, scelerisque mauris vel, \ndapibus nisl. Suspendisse venenatis dolor ipsum, vel lobortis dolor commodo ac. Nam ullamcorper \nadipiscing felis, vitae consequat magna sagittis non. Aenean nunc elit, interdum quis dignissim \ndignissim, aliquet nec leo. Quisque fermentum tempor volutpat. Ut ut arcu vel nunc porta \nvehicula.</p>\n\nHTML;\n\t\t\tbreak;\n\t}\n\n\treturn array(\n\t 'data' => array(),\n 'blocks' => array(),\n 'scripts' => array(),\n 'template' => $content\n );\n}", "public function initPage() {}", "public function initPage() {}", "function wpcodex_add_excerpt_support_for_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function eventon_create_pages() {\n\n\t// Events Main page\n eventon_create_page( esc_sql( _x( 'events', 'page_slug', 'eventon' ) ), 'eventon_events_page_id', __( 'Events', 'eventon' ), '' );\n\n}", "public function create()\n {\n //for the PAGE on which to create\n }", "public function page_init() {\n }", "function callback_pages(array $args)\n {\n }", "function atwork_process_page(&$variables, $hooks){\n //dpm($variables);\n\n // get rid of titles\n if (arg(0) == 'blogs'\n || arg(0) == 'news'\n || arg(0) == 'ecards'\n || arg(0) == 'polls'\n || arg(0) == 'videos'\n || (arg(0) == 'classifieds' && arg(1) == 'list')\n || (arg(0) == 'wiki' && arg(1) == 'items')\n || (arg(0) == 'node' && arg(1) == 77)\n || (arg(0) == 'node' && arg(1) == 115)\n ) {\n $variables['title'] = '';\n }\n // do wikis here\n if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'discussion') {\n $variables['title'] = t('Discussion');\n }\n if ((arg(0) == 'wiki' && arg(1) == 'items')) {\n $variables['breadcrumb'] = '<h2 class=\"breadcrumb\">' . l(t('Wikilumbia'), 'wiki') . '</h2>';\n }\n\n // revisions\n if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'revisions' && is_numeric(arg(3)) && arg(4) == 'view' && isset($variables['page']['content']['system_main']['nodes'][arg(1)])) {\n $node = $variables['page']['content']['system_main']['nodes'][arg(1)]['#node'];\n $variables['breadcrumb'] = '<h2 class=\"breadcrumb\">' . l($node->title, 'node/' . $node->nid) . ' &raquo; ' . l(t('Revisions'), 'node/' . $node->nid . '/revisions') . '</h2>';\n $variables['title'] = t('Revision !num', array('!num' => $node->vid));\n }\n\n if (arg(0) == 'forum') {\n if (!arg(1)) {\n $variables['breadcrumb'] = '<h2 class=\"breadcrumb\">' . l(t('Discussion Forum'), 'forum') . '</h2>';\n }\n else {\n $term = taxonomy_term_load(arg(1));\n if ($term) {\n $variables['breadcrumb'] = '<h2 class=\"breadcrumb\">' . l(t('Discussion Forum'), 'forum') . ' &raquo; ' . l($term->name, 'forum/' . arg(1)) . '</h2>';\n }\n }\n $variables['title'] = '';\n }\n\n // get rid of breadcrumbs\n if (arg(0) == 'search'\n || (arg(0) == 'node' && arg(1) == 5548)\n || (arg(0) == 'employees')\n || (arg(0) == 'groups' && !arg(1))\n ) {\n $variables['breadcrumb'] = '';\n }\n\n if (arg(0) == 'node' && arg(1) == 'add' && !arg(2)) {\n $variables['breadcrumb'] = l(t('@Work'), '<front>');\n $variables['title'] = t('Create Content');\n drupal_set_title(t('Create Content'));\n }\n\n if (arg(0) == 'user' && is_numeric(arg(1)) && arg(2)) {\n $account = user_load(arg(1));\n $variables['breadcrumb'] = '<h2 class=\"breadcrumb\">' . l(_atwork_display_name($account), 'user/' . $account->uid) . '</h2>';\n switch (arg(2)) {\n case 'subscriptions':\n $variables['title'] = t('Subscription Settings');\n break;\n case 'myresults':\n $variables['title'] = t('Quiz Results');\n break;\n case 'edit':\n $variables['title'] = t('Build Your Profile');\n break;\n case 'activity':\n $variables['title'] = t('News Feed');\n break;\n }\n }\n\n\n // disable tabs on hom page\n if (drupal_is_front_page()) {\n $variables['tabs'] = array();\n $variables['title'] = '';\n }\n\n if (!$variables['title']) {\n $variables['classes_array'][] = 'no-title';\n }\n\n if (request_path() == 'classifieds') {\n $variables['classes_array'][] = 'classified-homepage';\n }\n\n $variables['classes'] = implode(' ', $variables['classes_array']);\n}", "public function pagesOnly() {}", "abstract protected function createPages($count = 10): array;", "function thumbwhere_contentcollection_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollection');\n return $controller->addPage();\n}", "public function createMetasPages($meta)\n\t {\n\t \tif ( isset($_GET['post']) || isset($_POST['post_ID']) )\n\t\t \t$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];\n\t\t else\n\t\t \t$post_id = null;\n\n\t\t $nameMetaBox = '';\n\t\t $titleMetaBox = '';\n\t\t $noInputs = '';\n\t\t $noEditors = '';\n\t\t $imgFeatured = '';\n\t\t $videoFeatured = '';\n\t\t $documentFeatured = '';\n\t\t $gallery = '';\n\n\t\t if (isset($meta['_title_meta_box'])) {\n\t\t \t$titleMetaBox = $meta['_title_meta_box'];\n\t\t }\n\n\t\t if (isset($meta['_no_inputs'])) {\n\t\t \t$noInputs = $meta['_no_inputs'];\n\t\t }\n\t\t \t\n\t\t if (isset($meta['_no_editors'])) {\n\t\t \t$noEditors = $meta['_no_editors'];\n\t\t }\n\n\t\t if (isset($meta['_name_meta_box'])) {\n\t\t \t$nameMetaBox = $meta['_name_meta_box']; \t\n\t\t }\n\n\t\t if ( isset($meta['_img_featured']) && $meta['_img_featured'] == 'yes' ) {\n\t\t \t$imgFeatured = $meta['_img_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_video_featured']) && $meta['_video_featured'] == 'yes' ) {\n\t\t \t$videoFeatured = $meta['_video_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_document_featured']) && $meta['_document_featured'] == 'yes' ) {\n\t\t \t$documentFeatured = $meta['_document_featured']; \t\n\t\t }\n\n\t\t if ( isset($meta['_gallery']) && $meta['_gallery'] == 'yes' ) {\n\t\t \t$gallery = $meta['_gallery']; \t\n\t\t }\n\n\t\t foreach ($meta['_pages'] as $key => $value) {\n\t\t \t$createMeta = false;\n\t\t \tif ($post_id == $value) {\n\t\t \t\t$createMeta = true;\n\t\t \t} else if( $value == 'all' ) {\n\t\t \t\t$createMeta = true;\n\t\t \t}\n\n\t\t \tif ($createMeta) {\n\t\t \t\tself::addMetaBox($nameMetaBox, $titleMetaBox, 'page' , $noInputs, $noEditors, $imgFeatured, $videoFeatured, $documentFeatured, $gallery);\n\t\t \t}\n\t\t }\n\t }", "function createPages() {\n\n $pages = \"Store Location,Store Trading Hours,Payment Options,Shipping & Delivery,Return / Refund Policy,Our Brands,Bike Hire,Bike Servicing,Mobile Mechanic Service,Bicycle Size Guide,Component Fitting,Corporate Sales,Our Team,Contact Us,Our Quality Promise,Privacy Statement,Disclaimer,Blog / Articles\";\n $pages = explode(',', $pages);\n\n foreach ($pages as $page) {\n $data = [\n 'page' => [\n 'title' => $page,\n 'body_html' => \"<h2>\".$page.\"</h2>\",\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . '/pages.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n\n return new JsonResponse(['status' => 'finish']);\n }", "function page_add_page($pagerec) {\n return page_edit_page($pagerec, 0, null, null);\n}", "public function onPagesInitialized()\n {\n // Don't proceed if we are in the admin plugin\n if ($this->isAdmin()) {\n $this->active = false;\n return;\n }\n // Do not act upon empty POST payload or any POST not for this plugin\n $post = $_POST;\n if (!$post || ! isset($post['ce_data_post']) ) {\n return;\n }\n // Preemtively handle review edits ajax call\n if ($post['action'] == 'ceReviewEdits') {\n $output = $this->grav['twig']->processTemplate(\n 'partials/data-manager/content-edit/item.html.twig',\n [ 'itemData' => CompiledYamlFile::instance(DATA_DIR . $this->edits_loc . DS . $post['file'])->content() ]\n );\n } else {\n $pages = $this->grav['pages'];\n $page = $pages->dispatch($post['page'] , true);\n if ($post['language'] && $post['language'] != 'Default' ) {\n $fn = preg_match('/^(.+)\\..+?\\.md$/', $page->name(), $matches);\n if ($fn) {\n $fileP = $page->path() . DS . $matches[1] . '.' . $post['language'] . '.md';\n $route = $page->route();\n $page = new Page();\n $page->init(new \\SplFileInfo($fileP), $post['language'] . '.md');\n }\n }\n switch ($post['action']) {\n case 'ceTransferContent': // Transfer the md for the page\n $hd = $page->header();\n $menuExists = property_exists($hd,'menu') && $hd->menu !== null;\n $output = [ 'data' => $page->rawMarkdown(), 'menu' => $page->menu(), 'menuexists' => $menuExists ];\n break;\n case 'ceSaveContent': // Save markdown content\n $output = $this->saveContent($post, $page);\n break;\n case 'cePreviewContent': // Preview a route\n $r = ( $post['language'] == 'Default' ? '' : $post['language'] ) . $post['page'] ;\n $this->grav->redirect($r);\n break;\n case 'ceFileUpload': // Handle a file (or image) upload\n $output = $this->saveFile($post, $page);\n break;\n case 'ceFileDelete': // Deleting a file or images\n $output = $this->deleteFile($post, $page);\n break;\n default:\n return;\n }\n }\n $this->setHeaders();\n echo json_encode($output);\n exit;\n }", "public function run()\n {\n \tStaticPage::truncate();\n\t\tStaticPage::create([\n\t\t\t'page_name' => 'About Us',\n\t\t\t'status' => '1'\n\t\t]);\t\n \t\n StaticPage::create([\n 'page_name' => 'T&C',\n 'status' => '1'\n ]);\n }", "function createPages($pathToFolder, $pathToXML){\n $handle = fopen($pathToXML, 'r');\n $data = file_get_contents($pathToXML);\n $data = str_replace(' ', '', $data);\n $data = str_replace('<', '[', $data);\n $data = str_replace('>', ']', $data);\n file_put_contents($pathToXML, $data);\n $i=0;\n if ($handle)\n {\n //initializing all the variables needed to create the page and to keep in memory the strings of the old and new titles.\n $title;\n $oldTitle;\n $belongsTo=\"\";\n $contains=\"\";\n $content=\"\";\n $currentType=\"\";\n $titleLang=\"\";\n $fileOrga;\n while (!feof($handle)){\n $buffer = fgets($handle);\n \n if(!isset($fileOrga)){\n $temp = $this->checkFileOrganisation($buffer);\n if($temp!='continue'){\n $fileOrga=$temp;\n }\n }\n\n if(isset($fileOrga)){\n if($fileOrga==\"rdfWNames\"){ \n $currentType = $this->checktype($buffer);\n if($currentType=='title'){\n if(!isset($title))$title=$this->get_string_between($buffer, '#', '\"');\n if($title!=$this->get_string_between($buffer, '#', '\"')){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\"; \n $title=$this->get_string_between($buffer, '#', '\"');\n }\n }\n\n if($currentType=='content'){\n $content=$content.\" contient \".$this->get_string_between($buffer, ']', '[/');\n }\n\n if($currentType=='belongsTo'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from \".$_SESSION['url'].str_replace(' ', '', $this->get_string_between($buffer, '#', '\"'));\n }\n else{\n $belongsTo=$belongsTo.\" is a subclass from \".$this->get_string_between($buffer, '#', '\"');\n }\n }\n }\n \n if($fileOrga==\"rdfWONames\"){\n $currentType = $this->checktype($buffer);\n if(!$currentType!='continue'){\n if($currentType=='eoc'){\n $pageArray = array(0=>$title, 1=>$content, 2=>$belongsTo); \n $this->createPage($pathToFolder, $pageArray);\n $content=\"\";\n $belongsTo=\"\";\n $title=\"\"; \n $titleLang=\"\";\n }\n if($currentType=='title'){\n if($titleLang==\"en\" || $titleLang==\"\"){\n if(strpos($buffer, '\"fr\"')){\n $titleLang=\"fr\";\n }else{\n $titleLang==\"en\";\n }\n $title=$this->get_string_between($buffer, ']', '[/');\n }\n }\n if($currentType=='content' && !strpos(str_replace(\":\", \"\", $buffer), \"rdfresource\")){\n $content=$content.$this->get_string_between($buffer, ']', '[/').\"\\n\";\n }\n\n if($currentType=='belongsTo'){\n $belongsToTitle=$this->checkIfSubclassIsInFile($pathToXML, $this->get_string_between($buffer, '=\"', '\"/'));\n if($belongsToTitle!='fail'){\n if($_SESSION['viki']===\"true\"){\n $belongsTo=$belongsTo.\" is a subclass from\".$_SESSION['url'].str_replace(' ', '', $belongsToTitle);\n }\n else\n $belongsTo=$belongsTo.\" is a subclass from \".$belongsToTitle.\"\\n\";\n }\n if($belongsToTitle==\"fail\"){\n $tmp = $this->get_string_between($buffer, '=\"', '\"/');\n $belongsTo=$belongsTo.\" is a subclass from \".$tmp.\"\\n\";\n }\n }\n }\n }\n }\n }\n fclose($handle);\n } \n }", "function createContent($page)\n{\n\tswitch ($page) \n\t{ \n\t\tcase \"Bio-Home\":\n\t\t\treturn createBioHomeContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New\":\n\t\t\treturn createBioNewContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Organism\":\n\t\t\treturn createBioNewOrgContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Tank\":\n\t\t\treturn createBioNewTankContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Plate\":\n\t\t\treturn createBioNewPlateContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Bacteria\":\n\t\t\treturn createBioNewBacteriaContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Colony\":\n\t\t\treturn createBioNewColonyContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Sequence\":\n\t\t\treturn createBioNewSequenceContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Edit\":\n\t\t\treturn createBioEditContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Blast\":\n\t\t\treturn createBioBlastContent();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn createErrorContent();\n\t\t\tbreak;\n\t}\n\t\n\n}", "abstract protected function render_page_content(): void;", "function owa_insertPageTags() {\r\n\t\r\n\t// Don't log if the page request is a preview - Wordpress 2.x or greater\r\n\tif (function_exists('is_preview')) {\r\n\t\tif (is_preview()) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\t$owa = owa_getInstance();\r\n\t\r\n\t$page_properties = $owa->getAllEventProperties($owa->pageview_event);\r\n\t$cmds = '';\r\n\tif ( $page_properties ) {\r\n\t\t$page_properties_json = json_encode( $page_properties );\r\n\t\t$cmds .= \"owa_cmds.push( ['setPageProperties', $page_properties_json] );\";\r\n\t}\r\n\t\r\n\t//$wgOut->addInlineScript( $cmds );\r\n\t\r\n\t$options = array( 'cmds' => $cmds );\r\n\t\r\n\t\r\n\t$owa->placeHelperPageTags(true, $options);\t\r\n}", "function pre_set_pages() {\r\n $wpc_pages = array(\r\n array(\r\n 'title' => __( 'Login Page', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'name' => 'Login Page',\r\n 'desc' => __( 'Page content: [wpc_client_loginf]', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'id' => 'login_page_id',\r\n 'old_id' => 'login',\r\n 'shortcode' => true,\r\n 'content' => '[wpc_client_loginf]',\r\n ),\r\n array(\r\n 'title' => __( 'HUB Page', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'name' => 'HUB Page',\r\n 'desc' => __( 'Page content: [wpc_client_hub_page]', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'id' => 'hub_page_id',\r\n 'old_id' => 'hub',\r\n 'shortcode' => true,\r\n 'content' => '[wpc_client_hub_page]',\r\n ),\r\n array(\r\n 'title' => __( 'Portal Page', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'name' => 'Portal Page',\r\n 'desc' => __( 'Page content: [wpc_client_portal_page]', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'id' => 'portal_page_id',\r\n 'old_id' => '',\r\n 'shortcode' => true,\r\n 'content' => '[wpc_client_portal_page]',\r\n ),\r\n array(\r\n 'title' => __( 'Error', WPC_CLIENT_TEXT_DOMAIN ),\r\n 'name' => 'Error',\r\n 'desc' => __( \"Page content: You haven't permission for this page.\", WPC_CLIENT_TEXT_DOMAIN ),\r\n 'id' => 'error_page_id',\r\n 'old_id' => '',\r\n 'shortcode' => false,\r\n 'content' => \"You haven't permission for this page.\",\r\n )\r\n );\r\n\r\n return $wpc_pages;\r\n }", "function add_excerpt_support_for_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function add_excerpt_support_for_pages() {\n\tadd_post_type_support( 'page', 'excerpt' );\n}", "function mxpress_link_pages() {\r\n global $mx_state, $wp_query, $more, $post;\r\n $defaults = array(\r\n 'before' => '<p>' . __('Pages:'), 'after' => '</p>',\r\n 'link_before' => '', 'link_after' => '',\r\n 'next_or_number' => 'number', 'nextpagelink' => __('Next page'),\r\n 'previouspagelink' => __('Previous page'), 'pagelink' => '%',\r\n 'echo' => 1\r\n );\r\n\r\n $r = wp_parse_args($args, $defaults);\r\n $r = apply_filters('wp_link_pages_args', $r);\r\n extract($r, EXTR_SKIP);\r\n//var_dump($wp_query);\r\n $page = ($wp_query->query_vars['page']) ? $wp_query->query_vars['page'] : 1;\r\n $numpages = $mx_state['num_pages'];\r\n\r\n global $post;\r\n $post_id = $post->ID;\r\n $content_saved = get_post_meta($post_id, '_mxpress_content', true);\r\n if ($content_saved != '') {\r\n $content_ar = unserialize($content_saved);\r\n $numpages = count($content_ar);\r\n $multipage = true;\r\n }\r\n\r\n\t$output = '';\r\n\t\r\n\tif ($numpages > 1)\r\n\t{\t\t\r\n\t\tif ($multipage) {\r\n\t\t\tif ('number' == $next_or_number) {\r\n\t\t\t\t$output .= $before;\r\n\t\t\t\tfor ($i = 1; $i < ($numpages + 1); $i = $i + 1) {\r\n\t\t\t\t\t$j = str_replace('%', $i, $pagelink);\r\n\t\t\t\t\t$output .= ' ';\r\n\t\t\t\t\tif (($i != $page) || ((!$more) && ($page == 1))) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= $link_before . $j . $link_after;\r\n\t\t\t\t\tif (($i != $page) || ((!$more) && ($page == 1)))\r\n\t\t\t\t\t\t$output .= '</a>';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= $after;\r\n\t\t\t} else {\r\n\t\t\t\tif ($more) {\r\n\t\t\t\t\t$output .= $before;\r\n\t\t\t\t\t$i = $page - 1;\r\n\t\t\t\t\tif ($i && $more) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t\t$output .= $link_before . $previouspagelink . $link_after . '</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i = $page + 1;\r\n\t\t\t\t\tif ($i <= $numpages && $more) {\r\n\t\t\t\t\t\t$output .= _wp_link_page($i);\r\n\t\t\t\t\t\t$output .= $link_before . $nextpagelink . $link_after . '</a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$output .= $after;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($echo)\r\n\t\t\techo $output;\r\n\t}\r\n\r\n return $output;\r\n}", "public function getPageHandler();", "function jr_news_add_pages() {\r\n add_options_page('News', 'News', 'administrator', 'news', 'news_options_page');\r\n}", "public function buildContent($pages)\n {\n $parsedown = new \\Parsedown();\n $return = '';\n foreach ($pages as $route => $page) {\n ob_start();\n $title = $page['title'];\n $slug = $page['slug'];\n $content = $page['content'];\n $content = $parsedown->text($content);\n $index = 0;\n $styleIndex = 0;\n $styles = array();\n $config = $this->config;\n if (isset($page['header']->fullpage)) {\n $config = array_merge($config, $page['header']->fullpage);\n }\n $breaks = explode(\"<hr />\", $content);\n\n if (isset($page['horizontal'])) {\n $type = 'slide';\n echo \"<div \n data-name='$title' \n data-anchor='$slug' \n class='section'\n >\";\n } else {\n $type = 'section';\n }\n foreach ($breaks as $break) {\n if ($index == 0) {\n $id = $page['slug'];\n } else {\n $id = $index;\n }\n if ($config['shortcodes']) {\n $shortcodes = $this->interpretShortcodes($break);\n $break = $shortcodes['content'];\n $shortcodeStyles = $shortcodes['styles'];\n }\n if (!empty($shortcodeStyles)) {\n $shortcodeStyles = $this->applyStyles($page['styles'][$styleIndex]);\n echo \"<div \n data-name='$title' \n data-anchor='$id' \n class='$type' \n style='$shortcodeStyles'\n >\";\n } else {\n if (isset($page['styles']) && isset($page['styles'][$styleIndex])) {\n $styles = $this->applyStyles($page['styles'][$styleIndex]);\n echo \"<div \n data-name='$title' \n data-anchor='$id' \n class='$type' \n style='$styles'\n >\";\n } else {\n echo \"<div \n data-name='$title' \n data-anchor='$id' \n class='$type'\n >\";\n }\n }\n echo $break;\n if (isset($page['inject_footer'])) {\n echo $page['inject_footer'];\n }\n echo \"</div>\";\n if (isset($page['styles']) && count($page['styles']) == $styleIndex+1) {\n $styleIndex = 0;\n } else {\n $styleIndex++;\n }\n $index++;\n }\n if (isset($page['horizontal'])) {\n echo \"</div>\";\n }\n $return .= ob_get_contents();\n ob_end_clean();\n if (isset($page['children'])) {\n $return .= $this->buildContent($page['children']);\n }\n }\n return $return;\n }", "public function run()\n {\n Page::create([\n 'title' => 'Front Page',\n 'content' => '\n <p>Platanus is an established hotel in Barrio Barretto that offers leisure and recreation\n within the hustle of Barretto, Olongapo City. Only 10 minutes away from the bars and\n restaurants that offer a broad selection of diverse cuisines from all over the world. </p>\n\n <p>The hotel ensures guests comfort and gives them the quality service. With 9 spacious air-conditioned rooms,\n among the amenities offered are complimentary Wi-Fi access, non-smoking rooms, cable TV, air-conditioned rooms,\n private bathroom with hot and cold water, some rooms have access to a balcony.</p>\n\n <p>Take a breather in the hotel\\'s incredible facilities like an outdoor swimming pool, fitness center, massage, and garden area where you can sit back and laze.</p>\n <p>Hotel Platanus is an excellent choice for quality accommodation in Barretto for daily and long term stay.</p>',\n ]);\n\n Page::create([\n 'title' => 'Side Description',\n 'content' => '<p>Set in Clark, 32 km from Mount Pinatubo, Platanus Hotel features an outdoor swimming pool.\n Featuring a restaurant, the property also has a garden. The property offers a 24-hour front desk. </p>',\n ]);\n }", "public function page_content() {\n\t\t$tab = empty( $_REQUEST['tab'] ) ? 'new' : wp_strip_all_tags( wp_unslash( $_REQUEST['tab'] ) ); // Input var okay.\n\t\t$paged = ! empty( $_REQUEST['paged'] ) ? (int) $_REQUEST['paged'] : 1; // Input var okay.\n\n\t\t$tab = esc_attr( $tab );\n\t\t$paged = esc_attr( $paged );\n\n\t\t$filters = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'filters' );\n\t\t$defaults = _appthemes_get_addons_mp_page_args( $this->args['page_slug'], 'defaults' );\n\n\t\t$args = array(\n\t\t\t'tab' => $tab,\n\t\t\t'page' => $paged,\n\t\t\t'filters' => $filters,\n\t\t\t'defaults' => $defaults,\n\t\t);\n\n\t\t$table = $this->create_list_table( $this->args['page_slug'], $this->args['parent'], $args );\n\n\t\t// Outputs the tabs, filters and search bar.\n\t\t$table->views();\n\n\t\t/**\n\t\t * Fires on the Add-ons browser tab after the top navigation bar.\n\t\t *\n\t\t * The dynamic part of the hook name refers to the tab slug (i.e. new or popular)\n\t\t *\n\t\t * @param APP_Addons_List_Table $table The content generator instance.\n\t\t */\n\t\tdo_action( \"appthemes_addons_mp_{$tab}\", $table );\n\t}", "function thumbwhere_host_add_page() {\n $controller = entity_ui_controller('thumbwhere_host');\n return $controller->addPage();\n}", "function tpl_page($help = '', $title = '')\n{\n tpl_language();\n tpl_header($help, $title);\n tpl_footer();\n}", "public function getPages() {}", "public function preStartPageHook() {}", "public function preStartPageHook() {}", "protected function generatePagesSitemap() {\n\t\tt3lib_div::requireOnce(t3lib_extMgm::extPath('dd_googlesitemap', 'class.tx_ddgooglesitemap_pages.php'));\n\t\t$generator = t3lib_div::makeInstance('tx_ddgooglesitemap_pages');\n\t\t/* @var $generator tx_ddgooglesitemap_pages */\n\t\t$generator->main();\n\t}", "function shoutbox_pages() {\n\t\tglobal $lang;\n\t\t$pages[] = array(\n\t\t\t'func' => 'posts',\n\t\t\t'title' => $lang['shoutbox']['page posts']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'clean',\n\t\t\t'title' => $lang['shoutbox']['clean shoutbox']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'settings',\n\t\t\t'title' => $lang['shoutbox']['page settings']\n\t\t);\n\t\t$pages[] = array(\n\t\t\t'func' => 'check_updates',\n\t\t\t'title' => $lang['shoutbox']['updates']\n\t\t);\n\t\treturn $pages;\n\t}", "public function run()\n {\n $title = [\n 'en' => 'Welcome to example page',\n 'es' => 'Bienvenidos a la página de ejemplo',\n 'ca' => 'Benvinguts a la página d\\'exemple'\n ];\n\n $slug = [\n 'en' => 'example-page',\n 'es' => 'pagina-ejemplo',\n 'ca' => 'exemple-de-pagina'\n ];\n\n $content = [\n 'ca' => '<h2>Benvinguts</h2><p>Aquesta es una p&aacute;gina d&#39;exemple per a %%_former_company_name_%%. Vost&eacute; pot contactar-nos per email a %%_former_company_email_%% o per correu convencional a:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_2_%%<br />\n %%_former_company_country_%%</p>',\n\n 'en' => '<h2>Welcome</h2><p>This is a simple example page for %%_former_company_name_%%. You can contact us at %%_former_company_email_%% or by post email at this address:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_1_%%<br />\n %%_former_company_country_%%</p>',\n\n\n 'es' => '<h2>Bienvenidos</h2><p>Esta es una p&aacute;gina de ejemplo para %%_former_company_name_%%. Usted puede contactar con nosotros via email en %%_former_company_email_%% o por correo convencional en:</p><p>%%_former_company_adress_1_%%<br />%%_former_company_adress_2_%%<br />\n %%_former_company_country_%%</p>'\n ];\n\n $page = Page::create([\n 'template' => 'main_layout',\n 'name' => 'example page',\n 'title' => $title['en'],\n 'slug' => $slug['en'],\n 'content' => $content['en']\n ]);\n \n $page->setTranslations('title', $title);\n $page->setTranslations('slug', $slug);\n $page->setTranslations('content', $content);\n\n $page->save();\n }", "public function addPage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\n\t\t// Validation of $_POST. URL, title and template must exist and != false.\n\t\tif ($url && ($Page = $this->Automad->getPage($url))) {\n\t\n\t\t\t$subpage = Request::post('subpage');\n\n\t\t\tif (is_array($subpage) && !empty($subpage['title'])) {\n\t\t\n\t\t\t\t// Check if the current page's directory is writable.\n\t\t\t\tif (is_writable(dirname($this->getPageFilePath($Page)))) {\n\t\n\t\t\t\t\tCore\\Debug::log($Page->url, 'page');\n\t\t\t\t\tCore\\Debug::log($subpage, 'new subpage');\n\t\n\t\t\t\t\t// The new page's properties.\n\t\t\t\t\t$title = $subpage['title'];\n\t\t\t\t\t$themeTemplate = $this->getTemplateNameFromArray($subpage, 'theme_template');\n\t\t\t\t\t$theme = dirname($themeTemplate);\n\t\t\t\t\t$template = basename($themeTemplate);\n\t\t\t\t\t\n\t\t\t\t\t// Save new subpage below the current page's path.\t\t\n\t\t\t\t\t$subdir = Core\\Str::sanitize($title, true, AM_DIRNAME_MAX_LEN);\n\t\t\t\t\t\n\t\t\t\t\t// If $subdir is an empty string after sanitizing, set it to 'untitled'.\n\t\t\t\t\tif (!$subdir) {\n\t\t\t\t\t\t$subdir = 'untitled';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add trailing slash.\n\t\t\t\t\t$subdir .= '/';\n\t\t\t\t\t\n\t\t\t\t\t// Build path.\n\t\t\t\t\t$newPagePath = $Page->path . $subdir;\n\t\t\t\t\t$suffix = FileSystem::uniquePathSuffix($newPagePath);\n\t\t\t\t\t$newPagePath = FileSystem::appendSuffixToPath($newPagePath, $suffix); \n\t\t\t\t\t\n\t\t\t\t\t// Data. Also directly append possibly existing suffix to title here.\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\tAM_KEY_TITLE => $title . ucwords(str_replace('-', ' ', $suffix)),\n\t\t\t\t\t\tAM_KEY_PRIVATE => (!empty($subpage['private']))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ($theme != '.') {\n\t\t\t\t\t\t$data[AM_KEY_THEME] = $theme;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set date.\n\t\t\t\t\t$data[AM_KEY_DATE] = date('Y-m-d H:i:s');\n\t\t\t\t\t\n\t\t\t\t\t// Build the file name and save the txt file. \n\t\t\t\t\t$file = FileSystem::fullPagePath($newPagePath) . str_replace('.php', '', $template) . '.' . AM_FILE_EXT_DATA;\n\t\t\t\t\tFileSystem::writeData($data, $file);\n\t\t\t\t\t\n\t\t\t\t\t$output['redirect'] = $this->contextUrlByPath($newPagePath);\n\t\t\t\t\t\n\t\t\t\t\t$this->clearCache();\n\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname($this->getPageFilePath($Page)) . '</p>';\n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t} else {\n\t\n\t\t\t\t$output['error'] = Text::get('error_page_title');\n\t\n\t\t\t}\t\n\t\n\t\t} else {\n\t\n\t\t\t$output['error'] = Text::get('error_no_destination');\n\t\n\t\t}\t\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "private static function _createIndexPages()\n {\n // For each system and its templates create its glossary index page.\n // For each system create its index page and then for each of its templates.\n foreach (self::$_docsInfo as $systemName => $docsInfo) {\n // Create the glossary index for this system.\n self::_createGlossaryIndexPage($docsInfo['glossary'], $systemName);\n\n // Create the index page for this system which has its description and\n // link to its screens.\n self::_createSystemIndexPage($docsInfo, $systemName);\n foreach ($docsInfo['template'] as $templateName => $tplDocsInfo) {\n // Create the glossary index for this template.\n self::_createGlossaryIndexPage($tplDocsInfo['glossary'], $systemName, $templateName);\n\n // Create the index page for the template which shows main article of\n // the template on top and rest of the articles of the template and\n // the mode.\n self::_createTemplateIndexPage($tplDocsInfo['article'], $docsInfo['article'], $systemName, $templateName);\n }\n }//end foreach\n\n }", "protected function regeneratePageTitle() {}", "function page_generateScaffold($pageInfo,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language;\n\t\t\t\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t$output = '';\n\t\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\n\t$menu_text \t\t= isset($pageInfo[\"text\"]) ? $pageInfo[\"text\"] : '';\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\t$page_type\t\t= $pageInfo[\"type\"];\t\n\t$modified\t\t= $pageInfo[\"modified\"];\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\n\tif($page_type == 'folder') {\n\t\t## we need to output the folder by calling\n\t\t## the folder output functions\n\t\tfolder_outputFolder($page_id);\n\t\texit();\t\n\t}\n\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\t$dbConnection->next_record();\n\t$filename = $dbConnection->Record[\"basename\"];\n\t$xmlFile = $filename.\".xml\";\n\t$filename = $filename.\".tpl\";\n\n\tif ($filename == \".tpl\") {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\t\t\t\n\t## prepare the template file\n\t$layout_template = new Template(HTML_DIR);\n\t$layout_template->set_templatefile(array(\"pager\"=>$filename,\"head\" => $filename,\"body\" => $filename,\"foot\" => $filename)); \n\t\n\t## here we set the global vars- the user can set them within the templates:\n\t$layout_template->set_var(\"matrix:TITLE\",$menu_text);\n\t$layout_template->set_var(\"matrix:PAGEID\",$page_id);\n\t$layout_template->set_var(\"matrix:TARGETPAGE\",getTargetURL($page_id));\n\t$layout_template->set_var(\"matrix:MODDATE\",utility_prepareDate(strtotime($modified),DEFAULT_DATE));\n\t\n\t## finally set the others values passed to the script\n\t$layout_template->set_vars($extravars);\n\n\t##$output .= $layout_template->fill_block(\"head\");\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getNormalElements();\t\n\t$objects = $wt->getNormalObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\n\t$counter =0;\n\t$num_elements = count($elements);\n\twhile($counter < $num_elements) {\n\t\t## store the output\n\t\t$storage = ' ';\t\n\t\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\n\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'BOX':\n\t\t\tcase 'LINKLIST':\n\t\t\tcase 'IMAGE': {\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t$function = \"output_\".$target;\n\t\t\t\t\t$element = $function($page_record[$element_name],$elements[$counter],$menu_id,$page_id);\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t$function = \"output_\".$target;\n\t\t\t\t$element = $function('',$elements[$counter],$menu_id,$page_id);\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t} else {\n\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\tcase 'LISTVIEW': {\n\t\t\t\t$element = \"\";\n\t\t\t\t\n\t\t\t\t$element = output_listview($page_record,$elements[$counter],$layout_template,$menu_id,$page_id); \n\t\t\t\t$layout_template->set_var($element_name,$element);\t\n\t\t\t\tbreak;\t\n\t\t\t}\t\n\t\t\n\t\t\tcase 'SEARCH': {\n\t\t\t\t## now it's time to check the previous data entered:\n\t\t\t\t$layout_template->set_var($element_name.'.action',\"content.php?name=\".$elements[$counter]['PAGE']);\n\t\t\t\t$layout_template->set_var($element_name.'.name',\"query\");\n\t\t\t\t\n\t\t\t\t## prepare the hidden fields\n\t\t\t\t$hidden ='<input type=\"hidden\" name=\"PAGE\" value=\"'.$elements[$counter]['PAGE'].'\">';\n\t\t\t\t$hidden .='<input type=\"hidden\" name=\"LIMIT\" value=\"'.$elements[$counter]['LIMIT'].'\">';\n\t\t\t\t\n\t\t\t\t$layout_template->set_var($element_name.'.hidden',$hidden);\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\tcase 'SEARCHRESULTS': {\n\t\t\t\t## if we hit a searchresult tag, does means we should display\n\t\t\t\t## the results for the current search- we need to check\n\t\t\t\t## if we have a $query.\n\t\t\t\t$query = \"\";\n\t\t\t\tif($_POST[\"query\"]!=\"\" && isset($_POST[\"query\"])) {\n\t\t\t\t\t## we have a query so let's perform the search\n\t\t\t\t\t## we need to process the umlauts\n\t\t\t\t\t$query = convert_general($_POST[\"query\"]);\n\t\t\t\t\t$results = search($query);\n\t\t\t\t}\n\t\t\t\t$db = new DB_Sql();\n\t\t\t\t\n\t\t\t\t$found_pages = array();\t\t\t## used to store the found pages\n\t\t\t\t$box_pages = array();\n\t\t\t\t## we've got the results, but they are in a raw format\n\t\t\t\tfor($i=0; $i < count($results); $i++) {\n\t\t\t\t\t## now loop through the results, and check the type\n\t\t\t\t\tif($results[$i]['type']=='page') {\n\t\t\t\t\t\t## this means everything is fine, we need to check if this page\n\t\t\t\t\t\t## is currently visible (+current version)\n\t\t\t\t\t\t\n\t\t\t\t\t\t## at least we check if it is visible\n\t\t\t\t\t\t$pageInfo = structure_getStructureID($results[$i]['page_id']);\n\t\t\t\t\t\tif (!checkFlag($pageInfo[\"flags\"],PAGE_INVISIBLE) && checkFlag($pageInfo[\"flags\"],PAGE_ACTIVE)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t## first we check if the content element that was found belongs to the latest version of the page\n\t\t\t\t\t\t\t$s_query = \"SELECT content_id FROM \".PAGE_CONTENT.\" WHERE identifier='\".$results[$i]['identifier'].\"' AND page_id='\".$results[$i]['page_id'].\"' AND client_id='$client_id' LIMIT 1\";\n\t\t\t\t\t\t\t$result = $db->query($s_query);\t\n\t\t\t\t\t\t\tif($db->next_record()) {\n\t\t\t\t\t\t\t\tif($db->Record['content_id'] == $results[$i]['content_id']) {\n\t\t\t\t\t\t\t\t\t## this means we can savely output the result\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t## first check if the page_id id is aleady within the found pages\n\t\t\t\t\t\t\t\t\tif(!in_array($results[$i]['page_id'],$found_pages)) {\n\t\t\t\t\t\t\t\t\t\t$found_pages[] = $results[$i]['page_id'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t## if it is a container, we need to check if it is active and if the page it belongs to\n\t\t\t\t\t\t## is current and active\n\t\t\t\t\t\t\n\t\t\t\t\t\t## using this query we get: the page id that hosts the content element. We don't know if the content element of the active version of this page\n\t\t\t\t\t\t## contains the search parameter but we know it has at somepoint- leave it for now\n\t\t\t\t\t\t$s_query = \"SELECT page_id FROM \".DB_PREFIX.\"box_item AS A INNER JOIN \".DB_PREFIX.\"box AS B ON A.box_id=B.box_id WHERE target='\".$results[$i]['page_id'].\"' AND A.client_id='$client_id' ORDER BY B.modified DESC\";\n\t\t\t\t\t\t$result = $db->query($s_query);\n\t\t\t\t\t\twhile($db->next_record()) {\n\t\t\t\t\t\t\t## check if the page is active\n\t\t\t\t\t\t\t$pageInfo = structure_getStructureID($db->Record['page_id']);\n\t\t\t\t\t\t\tif (!checkFlag($pageInfo[\"flags\"],PAGE_INVISIBLE) && checkFlag($pageInfo[\"flags\"],PAGE_ACTIVE)) {\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## first check if the page_id id is aleady within the found pages\n\t\t\t\t\t\t\t\tif(!in_array($db->Record['page_id'],$found_pages)) {\n\t\t\t\t\t\t\t\t\t$found_pages[] = $db->Record['page_id'];\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## set the found page id to the returned page id- otherwise we only have the box\n\t\t\t\t\t\t\t\t$box_pages[] =\t$results[$i]['page_id']; \n\t\t\t\t\t\t\t\t$results[$i]['page_id'] = $db->Record['page_id'];\t\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t## now that we have the results, we will set them in the template\n\t\t\t\t$basename = $elements[$counter]['TEMPLATE'];\n\t\t\t\t$filename = $basename.'.tpl';\n\t\t\t\t$xmlFile = $basename.'.xml';\t\n\t\t\t\t\n\t\t\t\t$xmlStructure = new xmlparser(HTML_DIR.$xmlFile);\n\t\t\t\t$xmlStructure->parse();\n\t\t\t\t## parse the template file\n\t\t\t\t$objects \t\t= $xmlStructure->getObjects();\n\t\t\t\t$xmlStructure \t= $xmlStructure->getElements();\t\n\t\t\t\t\t\t\n\t\t\t\t$searchresult_template = new Template(HTML_DIR);\n\t\t\t\t$searchresult_template->set_templatefile(array(\"body\" => $filename)); \n\n\t\t\t\t$displayed_pages = array();\n\t\t\t\t$results_counter = 1;\n\t\t\t\tfor($i=0;$i<count($results); $i++) {\n\t\t\t\t\tif(!in_array($results[$i][\"page_id\"],$displayed_pages)) {\n\t\t\t\t\t\tif(in_array($results[$i][\"page_id\"],$found_pages)) {\n\t\t\t\t\t\t\t$displayed_pages[] = $results[$i][\"page_id\"];\n\t\t\t\t\t\t\t$page_data = array();\n\t\t\t\t\t\t\t## get the page \n\t\t\t\t\t\t\t$page_data = page_getPage($results[$i][\"page_id\"],$objects);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t## output the page\n\t\t\t\t\t\t\t$search_results_counter =0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t## reset the template\n\t\t\t\t\t\t\t$searchresult_template->varkeys = array(); \n\t\t\t\t\t\t\t$searchresult_template->varvals = array(); \t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($search_results_counter < count($xmlStructure)-1) {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t## okay first we try to find out what type we have\n\t\t\t\t\t\t\t\t## we wrap this up in a switch statemnt- this way we can\n\t\t\t\t\t\t\t\t## extend it more easily\n\t\t\t\t\t\t\t\t$s_element_type = $xmlStructure[$search_results_counter]['TYPE'];\n\t\t\t\t\t\t\t\t$s_element_name = $xmlStructure[$search_results_counter]['NAME'];\n\n\t\t\t\t\t\t\t\tswitch($s_element_type) {\n\t\t\t\t\t\t\t\t\tcase 'TEXT':\n\t\t\t\t\t\t\t\t\tcase 'COPYTEXT':\n\t\t\t\t\t\t\t\t\tcase 'DATE': \n\t\t\t\t\t\t\t\t\tcase 'LINK' :\n\t\t\t\t\t\t\t\t\tcase 'FILE':\n\t\t\t\t\t\t\t\t\t//case 'BOX':\n\t\t\t\t\t\t\t\t\tcase 'LINKLIST':\n\t\t\t\t\t\t\t\t\tcase 'IMAGE': {\n\t\t\t\t\t\t\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t\t\t\t\t\t\t## and the output the results to the template\n\t\t\t\t\t\t\t\t\t\t$s_target = strtolower($s_element_type); \n\t\t\t\t\t\t\t\t\t\tif(isset($page_data[$s_element_name])) {\n\t\t\t\t\t\t\t\t\t\t\teval(\"\\$s_element = output_\".$s_target.\"(\\$page_data[\\$s_element_name],\\$xmlStructure[\\$search_results_counter],0);\");\t\n\t\t\t\t\t\t\t\t\t\t\tif(is_array($s_element)) {\n\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_vars($s_element);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_var($s_element_name,$s_element);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\tcase 'BOX': {\n\t\t\t\t\t\t\t\t\t\tif($page_data[$s_element_name]['length'] > 0) {\n\t\t\t\t\t\t\t\t\t\t\tfor($bb=0;$bb<$page_data[$s_element_name][\"length\"]; $bb++) {\n\t\t\t\t\t\t\t\t\t\t\t\t$b_target_page = $page_data[$s_element_name][$bb]['target'];\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t## now check if the target_page was wihtin the search_result\n\t\t\t\t\t\t\t\t\t\t\t\tif(in_array($b_target_page,$box_pages)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t## okay we need to get this page then\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t## get the text elements for the page\n\t\t\t\t\t\t\t\t\t\t\t\t\t$b_data = array();\n\t\t\t\t\t\t\t\t\t\t\t\t\ttext_getData($b_target_page,$b_data);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach($b_data as $b_current_data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t## prepare the text element\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$b_current_data['text'] = '<p>'.strip_tags($b_current_data['text']).'</p>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$b_current_data['text']= str_colapse($b_current_data['text'],280,\"center\",'...');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$searchresult_template->set_var($b_current_data['identifier'],$b_current_data['text']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$search_results_counter++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t## finally we ouptut the link\n\t\t\t\t\t\t$page_id = $results[$i][\"page_id\"];\n\t\t\t\t\t\t$targetURL = getTargetURL($page_id);\t\n\t\t\t\t\t\t$searchresult_template->set_var('matrix:TARGETPAGE',$targetURL);\n\t\t\t\t\t\t$searchresult_template->set_var('matrix:RESULTINDEX',$results_counter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$results_counter++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$searchresult_output.=$searchresult_template->fill_block(\"body\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t## finally set the general vars\n\t\t\t\t$layout_template->set_var(\"SEARCHRESULT.query\",$query);\n\t\t\t\t$layout_template->set_var(\"SEARCHRESULT.hits\",count($found_pages));\n\t\t\t\t## finally output the whole thing\t\t\t\t\n\t\t\t\t\n\t\t\t\t$layout_template->set_var($element_name,$searchresult_output);\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tcase 'DIVIDER': {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\t$function = $target.\"_output\";\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\t$element = $function($page_record[$element_name],$elements[$counter],$menu_id,$page_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$element = $function($page_record,$elements[$counter],$layout_template,$menu_id,$page_id);\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$layout_template->set_vars($element);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$layout_template->set_var($element_name,$element);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## this is it- so we will flush the template here\t\t\n\t$output .= $layout_template->fill_block(\"body\");\n\t##$output .= $layout_template->fill_block(\"foot\");\n\t##$output = $layout_template->finish($output);\n\tpagecache_createCacheFile($page_id,$output);\n\treturn $output;\n}", "public function page() {\n\t\t$key = md5( __CLASS__ . $this->post->ID );\n\t\tif ( false == ( $page = wp_cache_get( $key ) ) ) {\n\t\t\t$page[] = $this->post_content();\n\t\t\tif ( $this->coming_soon || $this->cf || true === $this->free ) {\n\n\t\t\t}else{\n\t\t\t\t$page[] = $this->feature_section();\n\t\t\t}\n\t\t\t\n\t\t\t$page[] = $this->testimonials_section();\n\t\t\tif ( false === $this->free ) {\n\t\t\t\t$page[] = $this->price_table();\n\t\t\t}\n\n\t\t\t$page[] = $this->contact_section();\n\t\t\tif ( ! $this->coming_soon ) {\n\t\t\t\t$page[] = $this->docs();\n\t\t\t}\n\t\t\t$page = implode( '', $page );\n\t\t\twp_cache_set( $key, $page, '', 399 );\n\t\t}\n\n\t\treturn $page;\n\n\t}", "function create_custom_page_templates() {\n $pages = array(\n array(\n 'page' => get_page_by_title('Home'),\n 'template' => 'page-home.php'\n ),\n // array(\n // 'page' => get_page_by_title('About'),\n // 'template' => 'page-about.php'\n // ),\n );\n\n foreach ($pages as $page) {\n if ($page) {\n update_post_meta( $page['page']->ID, '_wp_page_template', $page['template'] );\n\n if ($page['template'] === 'page-home.php') {\n update_option( 'page_on_front', $page['page']->ID );\n update_option( 'show_on_front', 'page' );\n }\n }\n }\n}", "public function init() {\n\t\tadd_action( 'init', array( $this, 'new_page' ) );\n\t}", "function add_object_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '')\n {\n }", "function civicrm_wp_content_test_basepage_handler($wp) {\n\n add_filter('the_content', 'civicrm_wp_content_test_basepage_render');\n\n // error_log(' TEST ');\n $excerpt = wp_trim_excerpt();\n // error_log(' XC '.substr($excerpt,0,15).' ');\n\n}", "function kstHelpWordpressBlogPosts_multiplePagePostsPages() {\n ?>\n <p>\n For long posts that you would like to break up into smaller chunks for readability\n your theme uses the &lt;--nextpage--&gt; tag.\n </p>\n <p>\n When the post is being read it will look for &lt;--nextpage--&gt;\n and create a pager box (e.g. Pages: [1] [2] [3]) for as many &lt;--nextpage--&gt;\n tags as you included in your post.\n </p>\n <p>\n <strong>How to use the \"nextpage\" tag:</strong>\n </p>\n <p>\n In \"Visual\" mode:<br />\n <em>This cannot be done in \"visual\" mode. You will need to go into \"html\" mode for this which makes you a real pro.</em>\n <p>\n In \"html\" mode:<br />\n Place the cursor <em>after</em> the content that is the first \"page\" of your post.\n Type &lt;--nextpage--&gt; on it's own line. Repeat for each \"page\" of your post.\n <em>Note that you do not need to put &lt;--nextpage--&gt; at the end of the last \"page\" (end of post).</em>\n </p>\n <?php\n}", "public function options_page_init(){\n\t\t\tadd_options_page(__('Breaking News options', 'text-domain'), __('Breaking News', 'text-domain'), 'manage_options', 'breakingnews', [ $this, 'options_page_content']);\n\t\t}", "public function createPageAndCopyLiveParentPage() {}", "public function canCreateNewPages() {}", "function thumbwhere_contentcollectionitem_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollectionitem');\n return $controller->addPage();\n}", "protected function getPage() {}", "protected function getPage() {}", "public function run()\n {\n StaticPage::create([\n \"label\" => StaticPageLabels::TERMS,\n 'en' => ['title' => 'Terms & Conditions', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'الشروط والأحكام', \"content\" => \"محتوى صفحة الشروط هنا بالظبط.\"],\n ]);\n\n StaticPage::create([\n \"label\" => StaticPageLabels::PRIVACY,\n 'en' => ['title' => 'Privacy Policy', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'سياسة الخصوصية', \"content\" => \"محتوى صفحة الخصوصية هنا بالظبط.\"],\n ]);\n\n }", "function custom_plugin_create_page() {\n\n $page = array();\n $page['post_type'] = 'page';\n $page['post_title'] = 'Custom Plugin Page';\n $page['post_content'] = 'custom plugin page';\n $page['post_status'] = 'publish';\n $page['post_slug'] = 'custom-plugin-page';\n\n wp_insert_post( $page );\n}", "function tutorials($location='blog',$title=\"introduction\",$page=\"1\")\n{\n // only capture the correct template and location name\n // need to abstract\n $this->_common($location,$title,$page,self::portal.'_view');\n}", "function transfer_pages() {\n\tglobal $post;\n\t$args = [\n\t\t'post_type' => 'page',\n\t\t'posts_per_page' => -1,\n\t\t'post_status' => 'any',\n\t\t'meta_key' => '_cfct_build_data_backup',\n\t\t'meta_compare' => 'NOT EXISTS',\n\t];\n\n\t$posts = get_posts($args);\n\n\tvar_dump(count($posts));\n\n\t$i = 0;\n\tforeach ($posts as $post) {\n\t\tsetup_postdata($post);\n\t\tvar_dump($post->post_title);\n\t\ttransform_meta_to_elementor();\n\t\t$i++;\n\t\tif($i > 30)\n\t\t\tbreak;\n\t}\n\n\twp_reset_postdata();\n}", "function createPages() {\n\t// drop pages table (for development only)\n\tDB::exec(\"DROP TABLE IF EXISTS pages\");\n\n\t// `name` should be unique and cannot be null\n\t// `route` must be unique but can be null (e. g. when a page shouldn't be accessible via an URL)\n\t// `layout` is a foreign key that references ANOTHER row in the pages table,\n\t// \tif the referenced row is deleted the value will be set to NULL\n\tDB::exec(\"CREATE TABLE pages (\n\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\tname VARCHAR(50) NOT NULL UNIQUE,\n\t\troute VARCHAR(50) NULL UNIQUE,\n\t\tcontent TEXT NULL\n\t)\");\n\n\toutput(RESULT_INFO, \"Pages setup successfully completed\");\n\treturn 1;\n}", "public function createContentAndCopyDraftPage() {}", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "public function createNestedPagesAndCopyLiveParentPage() {}", "function add_links_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }", "function SetupMultiPages() {\r\n\t\t$pages = new cSubPages();\r\n\t\t$pages->Add(0);\r\n\t\t$pages->Add(1);\r\n\t\t$pages->Add(2);\r\n\t\t$pages->Add(3);\r\n\t\t$pages->Add(4);\r\n\t\t$pages->Add(5);\r\n\t\t$pages->Add(6);\r\n\t\t$this->MultiPages = $pages;\r\n\t}", "public function getPages();", "function handbuilt_preprocess_page(&$variables, $hook) {\n\t\t\n\t// Reset\n\tunset($variables['title_prefix']);\n\tunset($variables['title_suffix']);\n\t\n\t// Flag for main content only without secondary content\n\tif (empty($variables['page']['content-secondary'])) {\n\t \t$variables['classes_array'][] = 'no-secondary-content';\n\t}\n\tif (drupal_is_front_page()) {\n\t\t$variables['title'] = 'Recent essays';\n\t}\n\telse if (arg(0) == 'search') {\n\t\t$variables['title_suffix'] = arg(2);\n\t}\n\telse if (arg(0) == 'taxonomy' && arg(1) == 'term') {\n\t\t$variables['title_prefix'] = 'Tag';\n\t}\n // Move tabs into main content region\n // Not needed because we are using Blockify module\n // if (!empty($variables['tabs'])) {\n // array_unshift($variables['page']['content-primary'], $variables['tabs']);\n // unset($variables['tabs']);\n // }\n}", "public function onRun()\n {\n $this->page['tagPage'] = $this->property('tagPage');\n $this->page['tagPageSlug'] = $this->paramName('tagPageSlug');\n $this->page['tagsPage'] = $this->property('tagsPage');\n $this->page['tagsPageSlug'] = $this->paramName('tagsPageSlug');\n }", "protected function initPageRenderer() {}", "protected function initPageRenderer() {}", "public function setPages() {\n $this->pages = array(\n array(\n 'page_title' => 'Open Badge',\n 'menu_title' => 'Open Badge',\n 'capability' => 'manage_options',\n 'menu_slug' => self::SLUG_PLUGIN,\n 'callback' => array(DashboardTemp::class, 'main'),\n 'icon_url' => 'dashicons-awards',\n 'position' => '110'\n )\n );\n }" ]
[ "0.69990826", "0.6873259", "0.6805698", "0.67635626", "0.67450964", "0.66911846", "0.66292787", "0.6522234", "0.65204996", "0.6502909", "0.6502162", "0.6467448", "0.6464114", "0.64301103", "0.6421911", "0.6421154", "0.63817465", "0.6369027", "0.635663", "0.6353419", "0.6332413", "0.6332337", "0.63225675", "0.63159305", "0.62933564", "0.62891746", "0.62731344", "0.6243872", "0.62249637", "0.61992186", "0.61899567", "0.61641234", "0.61641234", "0.6153537", "0.61475384", "0.61371267", "0.6132981", "0.61211544", "0.61199486", "0.6114125", "0.6047745", "0.6034318", "0.60140467", "0.6013369", "0.6012949", "0.5992352", "0.5991301", "0.59877014", "0.59808964", "0.5978049", "0.59678775", "0.5966286", "0.5960349", "0.5960349", "0.5933367", "0.5926023", "0.59207946", "0.5919501", "0.59150255", "0.59139967", "0.5912695", "0.59099966", "0.59055406", "0.59005505", "0.59005505", "0.58936656", "0.5889715", "0.5889018", "0.5887451", "0.5886464", "0.5872257", "0.58662623", "0.5864085", "0.58581525", "0.58532226", "0.584984", "0.58497405", "0.58484876", "0.58362925", "0.5835678", "0.5834822", "0.5828804", "0.5825994", "0.58256686", "0.5820791", "0.58177984", "0.5812082", "0.58105797", "0.58091044", "0.5804535", "0.58035713", "0.5803067", "0.5796665", "0.579666", "0.579628", "0.5791812", "0.57907593", "0.5790198", "0.5789143", "0.57837033" ]
0.715312
0
Lists all feuilleDePresence entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $feuilleDePresences = $em->getRepository('TimSoftGeneralBundle:FeuilleDePresence')->findAll(); return $this->render('feuilledepresence/index.html.twig', array( 'feuilleDePresences' => $feuilleDePresences, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllDecoupage() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatDecoupage != ' . TypeEtat::SUPPRIME);\n // ->orderBy('e.typeDecoupage', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function getAllActifDecoupage() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatDecoupage = ' . TypeEtat::ACTIF);\n // ->orderBy('e.typeDecoupage', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function liste() {\n // Charger la vue liste compteur\n $this->loadView('liste', 'content');\n // Lire les compteurs à partir de la bd et formater\n //$reglements = $this->em->selectAll('reglement');\n //$reglements = $this->em->getRefined($reglements);\n $liste = $this->em->selectAll('facture');\n $html = '';\n foreach ($liste as $key => $entity) {\n $state = 'impayée';\n if ($entity->getPaye()) {\n $state = 'payée';\n }\n $consommation = $this->em->selectById('consommation', $entity->getId());\n $compteur = $this->em->selectById('compteur', $consommation->getIdCompteur());\n $html .= '<tr>';\n $html .= '<td>' . $entity->getId() . '</td>';\n $html .= '<td><a href=\"reglements/facture/' . $entity->getNumero() . '\">' . $entity->getNumero() . '</a></td>';\n $html .= '<td>' . $compteur->getNumero() . '</td>';\n $html .= '<td>' . $consommation->getQuantiteChiffre() . ' litres</td>';\n $html .= '<td>' . $entity->getMontant() . ' FCFA</td>';\n $html .= '<td>' . $state . '</td>';\n $html .= '</tr>';\n }\n // Ajouter les compteurs à la vue\n $this->loadHtml($html, 'list');\n }", "public function index()\n {\n\n return $this->facilitie->all();\n\n }", "public function unidades()\n {\n return $this->em->createQuery('\n SELECT\n e.id, e.codigo, e.nome, e.mensagemImpressao\n FROM\n Novosga\\Model\\Unidade e\n WHERE\n e.status = 1\n ORDER BY\n e.nome ASC\n ')->getResult();\n }", "function listaEstablecimientos() {\n\t\t$establecimiento = new Establecimiento();\n\t\treturn $establecimiento->listar();\n\t}", "public function listAllEfectiva()\n {\n $query = $this->em->createQuery(\n 'SELECT r\n FROM App\\Entities\\Razon r\n WHERE r.id < 7\n order by r.id');\n\n try {\n return $query->getResult();\n }\n catch(\\Doctrine\\ORM\\NoResultException $e) {\n return NULL;\n }\n }", "public function findAllParticipants() {\n\n\t\t$stmt = $this->db->query(\"SELECT * FROM participaciones, usuarios WHERE usuarios.email = participaciones.email\");\n\t\t$participantes_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t$participantes = array();\n\n\t\tforeach ($participantes_db as $participante) {\n\n\t\t\tarray_push($participantes, new Participante($participante[\"idEncuesta\"], $participante[\"email\"]));\n\t\t}\n\n\t\treturn $participantes;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $feuils = $em->getRepository('WorldCupRussiaBundle:Feuil')->findAll();\n\n return $this->render('feuil/index.html.twig', array(\n 'feuils' => $feuils,\n ));\n }", "public function EEList() {\n return $this->sendRequest('domain/list');\n }", "public function getAllClasse() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatClasse != ' . TypeEtat::SUPPRIME);\n // ->orderBy('e.typeClasse', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function getFacultets()\n {\n return $this->hasMany(SpravFacultet::className(), ['institut_id' => 'id']);\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function indexAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n $communautes = $em->getRepository('AppBundle:Communaute')->findAllValidFalse();\n\n return $this->render('validationCommunautes/index.html.twig', array(\n 'communautes' => $communautes,\n ));\n\n }", "public function getAll(){\n\t\t$tabDemandes = [];\n\t\t$q = $this->pdo->query(\"SELECT * FROM demande\");\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$tabDemandes[] = new Demande($donnee);\n\t\t}\n\t\treturn $tabDemandes;\n\t}", "public function findAll() {\r\r\n\r\r\n $result = array();\r\r\n $query = \"SELECT * FROM participant WHERE date_deletion_participant IS NULL\";\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute();\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }", "public function actionIndex()\n {\n $searchModel = new PresenceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function GetAllPaiementsMode() {\n if ($this->get_request_method() != \"GET\") {\n $this->response('', 406);\n }\n\n $sql = $this->db->prepare(\"SELECT * FROM modePaiement\");\n $sql->execute();\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n }", "public static function findAll()\n {\n $PDO = singleton::getInsance();\n $resulatBDD = $PDO->query(\"SELECT * FROM Memebre\")->fetchAll();\n\n $resultat = [];\n foreach ($resulatBDD as $ligne)\n {\n $membre = new self(\n $ligne[\"Prenom\"],\n $ligne[\"Nom\"],\n $ligne[\"Mail\"],\n $ligne[\"Role\"]);\n $membre->id = $ligne[\"ID_membre\"];\n\n array_push($resultat, $membre);\n }\n return $resultat;\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BackOfficebackBundle:Extraitnaissances')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return Filmes::all();\n }", "public function allAnnonce(){\n $annonces=$this->repAnnonce->findBy(['disponibilite' =>'1']);\n return $annonces;\n }", "public function listeEpciAction(){\n $this->denyAccessUnlessGranted('ROLE_ADMIN', 'Vous n\\'avez pas accès à cette page' );\n $em = $this->getDoctrine()->getManager();\n\n $listeEpci = $em->getRepository('LSIMarketBundle:Epci')->findAllEpci();\n //dump($listeEpci);\n\n return $this->render('@LSIMarket/admin/gestion_epci/liste_epci.html.twig', array('listeepci' => $listeEpci));\n }", "private function collectAllKnownMembers()\n {\n return $this->getDoctrine()->getRepository(Board::class)->findAllKnownMembers($this->getUser());\n }", "public function index()\n {\n return Departamento::all();\n }", "public function loadAllVilles()\n {\n /** vous pouvez écrire les requêtes pour les différents managers de DB, ou bien vous focaliser sur celui de votre choix */\n if (DB_MANAGER == PDO) // version PDO\n {\n $req = $this->getDatabase()->prepare(\"SELECT * FROM villes_france \");\n $req->execute();\n $villes = $req->fetchAll(PDO::FETCH_ASSOC);\n $req->closeCursor();\n } else if (DB_MANAGER == MEDOO) // version MEDOO\n {\n $villes = $this->getDatabase()->select(\"villes_france\", \"*\");\n }\n\n // on a récupéré tous les utilisateurs, on les ajoute au manager de villes\n foreach ($villes as $ville) {\n $new_ville = new Ville(\n $ville['id'],\n $ville['departement'],\n $ville['nom'],\n $ville['code_postal'],\n $ville['canton'],\n $ville['population'],\n $ville['densite'],\n $ville['surface']\n );\n $this->addVille($new_ville);\n }\n }", "public function demandeListeTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Demande\");//type array\n\t}", "function listerTout() {\r\n echo \"Liste des impayes disponibles dans la base : <br/>\";\r\n $listeImpayes = Impaye::findAll();\r\n foreach ($listeImpayes as $value) {\r\n $value->afficher();\r\n }\r\n}", "public function fournisseurs()\n {\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n\n $repository = $this->getDoctrine()\n ->getRepository(Fournisseur::class);\n\n $fournisseurs = $repository->findBy([],['nom' => 'ASC']);\n\n return $this->render('front/fournisseurs.html.twig', [\n 'fournisseurs' => $fournisseurs]);\n }", "private function getListMapVille()\r\n {\r\n $repo = $this->getDoctrine()->getRepository(MapVille::class);\r\n return $repo->findAll();\r\n }", "function retrieve_users_fftt()\n\t{\n\t\tglobal $gCms;\n\t\t$adherents = new adherents();\n\t\t$ping = cms_utils::get_module('Ping');\n\t\t$saison = $ping->GetPreference ('saison_en_cours');\n\t\t$ping_ops = new ping_admin_ops();\n\t\t$db = cmsms()->GetDb();\n\t\t$now = trim($db->DBTimeStamp(time()), \"'\");\n\t\t$aujourdhui = date('Y-m-d');\n\t\t$club_number = $adherents->GetPreference('club_number');\n\t\t//echo $club_number;\n\t\t\n\t\t\n\t\t\t$page = \"xml_liste_joueur\";\n\t\t\t$service = new Servicen();\n\t\t\t//paramètres nécessaires \n\t\t\t\n\t\t\t$var = \"club=\".$club_number;\n\t\t\t$lien = $service->GetLink($page,$var);\n\t\t\t//echo $lien;\n\t\t\t$xml = simplexml_load_string($lien, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t\n\t\t\t\n\t\t\tif($xml === FALSE)\n\t\t\t{\n\t\t\t\t$array = 0;\n\t\t\t\t$lignes = 0;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array = json_decode(json_encode((array)$xml), TRUE);\n\t\t\t\t$lignes = count($array['joueur']);\n\t\t\t}\n\t\t\t//echo \"le nb de lignes est : \".$lignes;\n\t\t\tif($lignes == 0)\n\t\t\t{\n\t\t\t\t$message = \"Pas de lignes à récupérer !\";\n\t\t\t\t//$this->SetMessage(\"$message\");\n\t\t\t\t//$this->RedirectToAdminTab('joueurs');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//on supprime tt\n\t\t\t\t$query = \"TRUNCATE TABLE \".cms_db_prefix().\"module_ping_joueurs\";\n\t\t\t\t$dbresult = $db->Execute($query);\n\t\t\t\tif($dbresult)\n\t\t\t\t{\n\t\t\t\t\t$i =0;//compteur pour les nouvelles inclusions\n\t\t\t\t\t$a = 0;//compteur pour les mises à jour\n\t\t\t\t\t$joueurs_ops = new ping_admin_ops();\n\t\t\t\t\tforeach($xml as $tab)\n\t\t\t\t\t{\n\t\t\t\t\t\t$licence = (isset($tab->licence)?\"$tab->licence\":\"\");\n\t\t\t\t\t\t$nom = (isset($tab->nom)?\"$tab->nom\":\"\");\n\t\t\t\t\t\t$prenom = (isset($tab->prenom)?\"$tab->prenom\":\"\");\n\t\t\t\t\t\t$club = (isset($tab->club)?\"$tab->club\":\"\");\n\t\t\t\t\t\t$nclub = (isset($tab->nclub)?\"$tab->nclub\":\"\");\n\t\t\t\t\t\t$clast = (isset($tab->clast)?\"$tab->clast\":\"\");\n\t\t\t\t\t\t$actif = 1;\n\n\t\t\t\t\t\t$insert = $joueurs_ops->add_joueur($actif, $licence, $nom, $prenom, $club, $nclub, $clast);\n\t\t\t\t\t\t$player_exists = $joueurs_ops->player_exists($licence);\n\t\t\t\t\t//\tvar_dump($player_exists);\n\t\t\t\t\t\tif($insert === TRUE && $player_exists === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$query = \"INSERT INTO \".cms_db_prefix().\"module_ping_recup_parties (saison, datemaj, licence, sit_mens, fftt, maj_fftt, spid, maj_spid) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t\t\t\t\t\t$dbresult = $db->Execute($query, array($saison,$aujourdhui,$licence,'Janvier 2000', '0', '1970-01-01', '0', '1970-01-01'));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}//$a++;\n\t\t\t\t\t \t\n\n\t\t\t\t\t}// fin du foreach\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//on redirige sur l'onglet joueurs\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private function listarTodosParticipante(){\n print_r($this->participantePDO->findAll());\n }", "public function listDemarcaciones()\n {\n $list_demarcaciones = \\common\\models\\autenticacion\\Demarcaciones::find()->all();\n\n return $list_demarcaciones;\n }", "public function getAllPersonne() {\n $qb = $this ->createQueryBuilder('p')\n ->select('p')\n ->orderBy('p.nom');\n return $qb->getQuery()->getResult();\n }", "public function listEst() {\n // $user = \\App\\User::find($id);\n //$estabelecimentos = \\App\\Estabelecimento::whereIn(\"modalidade_id\", $categorias)->get();\n //$estabelecimentos = \\App\\Estabelecimento::whereIn(\"iser_id\", $usuarios)->get();\n $admin = \\App\\Admin::where('user_id', Auth::user()->id)->get();\n\n $lista = \\App\\Estabelecimento::\n where('status', 'Pendente')->get();\n \n $estabelecimentos = array();\n foreach($lista as $estabelecimento) {\n if($estabelecimento->endereco->cidade == $admin[0]->cidade->nome) {\n $estabelecimentos[] = $estabelecimento;\n }\n }\n // return dd($estabelecimentos);\n return view(\"estabelecimento.pending\")->with(['estabelecimentos' => $estabelecimentos]);\n }", "public function allAction()\n {\n $repository = $this->getDoctrine()->getRepository('GfctBundle:Profesores');\n // find *all* pro\n $pro = $repository->findAll();\n return $this->render('GfctBundle:Profesores:all.html.twig',array(\"profesores\"=>$pro));\n }", "function SHOWALL(){\r\n\r\n $stmt = $this->db->prepare(\"SELECT * FROM edificio\");\r\n $stmt->execute();\r\n $edificios_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $alledificios = array(); //array para almacenar los datos de todos los edificios\r\n\r\n //Recorremos todos las filas de edificios devueltas por la sentencia sql\r\n foreach ($edificios_db as $edificio){\r\n //Introducimos uno a uno los edificios recuperados de la BD\r\n array_push($alledificios,\r\n new EDIFICIO_Model(\r\n $edificio['edificio_id'],$edificio['nombre_edif'],$edificio['direccion_edif']\r\n ,$edificio['telef_edif'],$edificio['num_plantas'],$edificio['agrup_edificio']\r\n )\r\n );\r\n }\r\n return $alledificios;\r\n }", "public function findAll()\n {\n return $this->findBy(array(), array('fechaPublicacion' => 'DESC'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $etablissements = $em->getRepository('AppBundle:Etablissements')->findAllWithCountry();\n\n return $this->render('etablissements/index.html.twig', array(\n 'etablissements' => $etablissements,\n ));\n }", "public function index()\n {\n return Departments::all();\n }", "public static function findAllEmpls(){\n try {\n\t\t\t$liste = new Liste();\n\t\t\t$requete = \"SELECT * FROM user where type_user='emp'\";\n\t\t\t$cnx = Database::getInstance();\n\t\t\t$res = $cnx->query($requete);\n\t\t foreach($res as $row) {\n\t\t\t\t$u = new User();\n\t\t\t\t$u->loadFromRecord($row);\n\t\t\t\t$liste->add($u);\n\t\t }\n\t\t $cnx = null;\n\t\t\treturn $liste;\n\t\t} catch (PDOException $e) {\n\t\t print \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t return $liste;\n\t\t}\t\n }", "protected function getFFPlayers()\n\t{\n\t\t$result = \\Kofradia\\DB::get()->prepare(\"\n\t\t\tSELECT DISTINCT f2.ffm_up_id\n\t\t\tFROM ff_members f1\n\t\t\t\tJOIN ff ON ff_id = f1.ffm_ff_id AND ff_is_crew = 0\n\t\t\t\tJOIN ff_members f2 ON f1.ffm_ff_id = f2.ffm_ff_id AND f2.ffm_status = 1 AND f2.ffm_up_id != f1.ffm_up_id\n\t\t\tWHERE f1.ffm_up_id = ? AND f1.ffm_status = 1\");\n\t\t$result->execute(array($this->ut->up->id));\n\t\t$up_ids = array();\n\t\twhile ($row = $result->fetch())\n\t\t{\n\t\t\t$up_ids[] = $row['ffm_up_id'];\n\t\t}\n\t\t\n\t\treturn $up_ids;\n\t}", "function listeEpreuvesClasse(){\n $tableClasses=new Zoraux_Modeles_Classe();\n $id=$_GET['id'];\n $classe=$tableClasses->get($id);\n $this->vue->classe=$classe;\n $epreuves=$this->where('classe_id=?',array($id));\n $this->vue->epreuves=$epreuves;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $etat_civils = $em->getRepository('MairieMairieBundle:Etat_civil')->findAll();\n\n return $this->render('etat_civil/index.html.twig', array(\n 'etat_civils' => $etat_civils,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $participants = $em->getRepository('AppBundle:Participant')->findAll();\n\n return $this->render('participant/liste.html.twig', array(\n 'participants' => $participants,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('GestionFraisBundle:Visiteur')->findAll();\n\n return $this->render('GestionFraisBundle:Visiteur:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "function get_entradas_boni_list($offset, $per_page, $ubicacion)\n\t{\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct(e.pr_facturas_id), e.id as id1, e.fecha, sum(costo_total) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatus from entradas as e left join cproveedores as pr on pr.id=e.cproveedores_id left join pr_facturas as prf on prf.id=e.pr_facturas_id left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id left join estatus_general as eg on eg.id=e.estatus_general_id where e.espacios_fisicos_id=$ubicacion and e.estatus_general_id=1 and ctipo_entrada=9 group by e.id, e.fecha, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id order by e.fecha desc limit $per_page offset $offset\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SuperAdminBundle:Departamento')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getListeVisiteurs(){\n\t\t$req = \"select * from visiteur order by VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetchAll();\n\t\treturn $ligne;\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager(\"ms_haberes_web\");\n\n $entities = $em->getRepository('LiquidacionesCuposAnualesBundle:Liquidaciones')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function listar()\n {\n return $this->request('GET', 'unidadesmedida');\n }", "static public function MdlListarPersonaNoInscrita(){\n $Lista = ModeloConductor::MdlListarPersonaNoInscrita();\n return $Lista;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $froFacTransferencias = $em->getRepository('JHWEBFinancieroBundle:FroFacTransferencia')->findAll();\n\n return $this->render('frofactransferencia/index.html.twig', array(\n 'froFacTransferencias' => $froFacTransferencias,\n ));\n }", "function spiplistes_listes_auteurs_elligibles ($id_liste, $statut_liste = '', $faire = '') {\n\t$nb_auteurs = 0;\n\t$auteurs_array = array();\n\tif($lister_moderateurs = ($faire == 'moderer')) {\n\t\t// recupere la liste des moderateurs\n\t\t$ids_already = spiplistes_mod_listes_get_id_auteur($id_liste);\n\t\t$ids_already = (isset($ids_already[$id_liste]) ? $ids_already[$id_liste] : array());\n\t\t$sql_where[] = 'statut='.sql_quote('0minirezo');\n\t}\n\telse {\n\t\t// recupere la liste des abonnes\n\t\t$ids_already = spiplistes_listes_liste_abo_ids($id_liste);\n\t\t// prepare la liste des non-abonnes elligibles\n\t\t$sql_where = array(\"email <> ''\"); // email obligatoire !\n\t\t// si liste privee, ne prend que l'equipe de redacs\n\t\tif($statut_liste == _SPIPLISTES_LIST_PRIVATE) {\n\t\t\t$sql_where[] = \"(statut=\".sql_quote('0minirezo').\" OR statut=\".sql_quote('1comite').\")\";\n\t\t}\n\t}\n\t$sql_from = array(\"spip_auteurs\");\n\t// demande la liste des elligibles\n\t$sql_result = sql_select(\"nom,id_auteur,statut\", $sql_from, $sql_where, '', array('statut','nom'));\n\tif(sql_count($sql_result)) {\n\t\twhile($row = sql_fetch($sql_result)) {\n\t\t\t// ne pas prendre ceux deja abonnes\n\t\t\tif(in_array($row['id_auteur'], $ids_already)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(!isset($auteurs_array[$row['statut']])) {\n\t\t\t\t$auteurs_array[$row['statut']] = array();\n\t\t\t}\n\t\t\t$auteurs_array[$row['statut']][$row['id_auteur']] = $row['nom'];\n\t\t\t$nb_auteurs++;\n\t\t}\n\t}\n\treturn(array($auteurs_array, $nb_auteurs));\n}", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public static function getList()\n {\n return CHtml::listData(Departamentos::model()->findAll(),'id_departamento', 'descripcion');\n }", "public static function all(){\n \t\ttry{\n $index = 0;\n $con = new Database;\n $query = $con->prepare('SELECT unnest(enum_range(null::membership_type))');\n $query->execute();\n $con->close();\n \n $results = $query->fetchAll(PDO::FETCH_OBJ);\n \n $memberships = array();\n\n if(!empty($results)){\n foreach($results as $result){\n $temp = new Membership;\n $temp->setAttributes($index, $result->unnest);\n $index = $index+1;\n array_push($memberships, $temp);\n }\n }\n\n return $memberships;\n \t\t}\n catch(PDOException $e){\n \t echo $e->getMessage();\n \t }\n }", "public static function drafts()\n {\n return self::where('published', '=', false)->get();\n }", "public function getList(){\n\t\t$listeDepartements = array();\n\t\t$req = $this->db->prepare('SELECT dep_num,dep_nom,vil_num FROM departement ORDER BY dep_nom');\n\t\t$req->execute();\n\n\t\twhile ($departement = $req->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$listeDepartements[]= new Departement($departement);\n\t\t}\n\n\t\treturn $listeDepartements;\n\t\t$req -> closeCursor();\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HaccoDeeeBundle:DevisSetup')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getAllFranchises(){\n $query = \"SELECT * FROM franchises ORDER BY name\";\n $result = $this->connection->query($query);\n $result = $result->fetchAll(PDO::FETCH_ASSOC);\n $franchises = [];\n foreach($result as $data){\n $franchises[] = new Franchise($data);\n }\n return $franchises;\n }", "public function index()\n {\n //\n $data = Presence::where('tanggal', date('Y-m-d'))->where('user_id', Auth::user()->id)->first();\n $datas = Presence::paginate(10);\n return view('presence.index', compact('data', 'datas'));\n }", "public function deposite(){\n return view('admin.deposite_list');\n\n // echo \"<pre>\";\n // print_r($users);\n }", "public function liste()\n {\n return $this->createQueryBuilder('a')\n ->orderBy('a.pseudonyme', 'ASC')\n ;\n }", "public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM Offre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }", "static function listHiddenExhibit(){\n\t\t$res = requete_sql(\"SELECT id FROM exhibit WHERE visible = FALSE ORDER BY creation_date ASC\");\n\t\t$res = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\t$list = array();\n\t\tforeach ($res as $exhibit) {\n\t\t\t$exhibit = new Exhibit($exhibit['id']);\n\t\t\tarray_push($list, $exhibit);\n\t\t}\n\t\treturn $list;\n\t}", "public function formationsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $id= $this->getUser()->getProfil();\n $formations = $em->getRepository('ExiaCoreBundle:Formation')->findByProfil($id);\n return $this->render('ExiaCoreBundle:Core:liste-formation.html.twig', array('formations' => $formations));\n }", "public function getEstudiantes()\n {\n return EstudianteDao::getEstudiantes();\n }", "public function getLesFraisForfait(){\r\n\t\t$req = \"select af_fraisforfait.id as idfrais, libelle, montant from af_fraisforfait order by af_fraisforfait.id\";\r\n\t\t$rs = $this->db->query($req);\r\n\t\t$lesLignes = $rs->result_array();\r\n\t\treturn $lesLignes;\r\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $deces = $em->getRepository('MairieMairieBundle:Deces')->findAll();\n\n return $this->render('deces/index.html.twig', array(\n 'deces' => $deces,\n ));\n }", "public function getList()\r\n {\r\n // Le résultat sera un tableau d'instances de Sponsor.\r\n\r\n\t$entrainements = array();\r\n\r\n $q = $this->_db->query(\"SELECT id, jour, heure_debut as heureDebut, heure_fin as heureFin, lieu FROM entrainement\");\r\n //$q->execute();\r\n\r\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\r\n {\r\n $entrainements[] = new BoEntrainement($donnees);\r\n }\r\n\r\n return $entrainements;\r\n }", "public function etatListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Etat\");//type array\n\t}", "public function possederListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Posseder\");//type array\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4CampeonatoBundle:Partido')->findAll();\n //$e_h_p = $em->getRepository('Area4CampeonatoBundle:Equipo_has_Partido')->findAll();\n\n return array('entities' => $entities);\n }", "function get_depar_all()\n {\n $results = array();\n\n $list_user_all = array();\n //Define request\n $req = \"SELECT * FROM departement\";\n\n //request\n $query = $this->db->query($req);\n\n //If the query succeed\n if($query !== FALSE)\n {\n foreach ($query->result() as $row)\n {\n $depar = new Depar_model;\n $depar->define_depar($row->dp_name);\n array_push($results, $depar);\n } \n }\n else\n {\n $results = FALSE;\n }\n\n\n /* Libération du jeu de résultats */\n \n\n return $results;\n }", "public function vacantes()\n {\n return $this->hasMany('App\\BolsaEmpleo\\Vacante', 'puesto_id', 'id');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fraturas = $em->getRepository('AppBundle:Fratura')->findAll();\n\n return $this->render('fratura/index.html.twig', array(\n 'fraturas' => $fraturas,\n ));\n }", "public function getAllActifClasse() {\n $qb = $this->createQueryBuilder('e')\n ->where('e.etatClasse = ' . TypeEtat::ACTIF);\n // ->orderBy('e.typeClasse', 'ASC');\n return $qb->getQuery()->getResult();\n }", "public function ListValidatePlayer()\n {\n $users = User::where([\n ['isEnabled', 0],\n ['isDelete', 0]\n ])\n ->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('PruebasBundle:Paciente')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function GetAllUnite() {\n if ($this->get_request_method() != \"GET\") {\n $this->response('', 406);\n }\n\n $sql = $this->db->prepare(\"SELECT * FROM unite\");\n $sql->execute();\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n }", "public function index()\n {\n //\n return DetalleProporcionPaciente::all();\n }", "public function get_all_eleves()\n {\n\n $requete = \"SELECT id, nom, prenom, date_naissance, moyenne, appreciation FROM eleve\";\n $eleves = $this->Db_connect->prepare($requete);\n $eleves->setFetchMode(PDO::FETCH_CLASS, Eleve::class);\n $eleves->execute();\n $eleves = $eleves->fetchAll();\n\n\n return $eleves;\n }", "public function findList()\n {\n return $this->liste()\n ->getQuery()->getResult()\n ;\n }", "public function getTousLesVisiteurs()\n {\n return Visiteur::all();\n }", "public function listVisuels()\n {\n $result = DB::table('panneauxes')\n ->join('clients', 'clients.code', '=', 'panneauxes.idclient')\n ->join('campagnes', 'campagnes.code', '=', 'panneauxes.idcampagne')\n ->join('coms', 'coms.id', '=', 'panneauxes.idcommune')\n ->join('regies', 'regies.code', '=', 'panneauxes.idregie')\n ->select(\n 'panneauxes.idPanneaux as id',\n 'panneauxes.emplacement as emplacement',\n 'panneauxes.partdevoix as partdevoix',\n 'panneauxes.latittude as latitude',\n 'panneauxes.longitude',\n 'panneauxes.image',\n 'clients.Raison_Soc as client',\n 'campagnes.libelle as campagne',\n 'coms.name as commune',\n 'regies.Raison_Soc as regie'\n )\n ->get();\n return $result;\n }", "public function getListDemandesEnvoyees($idUser){\n\t\t$tabDemandesEnvoyees = array();\n\t\t$q = $this->pdo->prepare('SELECT * FROM demande WHERE idUtilisateur = :idUtilisateur');\n\t\t$q->bindValue(':idUtilisateur', $idUser, PDO::PARAM_INT);\n\t\t$q->execute();\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$tabDemandesEnvoyees[] = new Demande($donnee);\n\t\t}\n\t\treturn $tabDemandesEnvoyees;\n\t}", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "public function index() : Collection\n {\n $educationalActivityAttendances = EducationalActivityAttendance::all();\n\n if ($educationalActivityAttendances->isEmpty() === true) {\n throw new NotFoundHttpException();\n }\n\n return $educationalActivityAttendances;\n }", "public function getListeDemandeHospitalisation() {\r\n\t\t$db = $this->tableGateway->getAdapter ();\r\n\t\t\r\n\t\t$aColumns = array (\r\n\t\t\t\t'Nom',\r\n\t\t\t\t'Prenom',\r\n\t\t\t\t'Datenaissance',\r\n\t\t\t\t'Sexe',\r\n\t\t\t\t'Datedemandehospi',\r\n\t\t\t\t'Prenom&NomMedecin',\r\n\t\t\t\t'id' \r\n\t\t);\r\n\t\t\r\n\t\t/* Indexed column (used for fast and accurate table cardinality) */\r\n\t\t$sIndexColumn = \"id\";\r\n\t\t\r\n\t\t/*\r\n\t\t * Paging\r\n\t\t */\r\n\t\t$sLimit = array ();\r\n\t\tif (isset ( $_GET ['iDisplayStart'] ) && $_GET ['iDisplayLength'] != '-1') {\r\n\t\t\t$sLimit [0] = $_GET ['iDisplayLength'];\r\n\t\t\t$sLimit [1] = $_GET ['iDisplayStart'];\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Ordering\r\n\t\t */\r\n\t\tif (isset ( $_GET ['iSortCol_0'] )) {\r\n\t\t\t$sOrder = array ();\r\n\t\t\t$j = 0;\r\n\t\t\tfor($i = 0; $i < intval ( $_GET ['iSortingCols'] ); $i ++) {\r\n\t\t\t\tif ($_GET ['bSortable_' . intval ( $_GET ['iSortCol_' . $i] )] == \"true\") {\r\n\t\t\t\t\t$sOrder [$j ++] = $aColumns [intval ( $_GET ['iSortCol_' . $i] )] . \"\n\t\t\t\t\t\t\t\t \t\" . $_GET ['sSortDir_' . $i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * SQL queries\r\n\t\t */\r\n\t\t$sql = new Sql ( $db );\r\n\t\t$sQuery = $sql->select ()->from ( array (\r\n\t\t\t\t'pat' => 'patient' \r\n\t\t) )->columns ( array (\r\n\t\t\t\t'Nom' => 'nom',\r\n\t\t\t\t'Prenom' => 'prenom',\r\n\t\t\t\t'Datenaissance' => 'date_naissance',\r\n\t\t\t\t'Sexe' => 'sexe',\r\n\t\t\t\t'Adresse' => 'adresse',\r\n\t\t\t\t'id' => 'id_personne' \r\n\t\t) )->join ( array (\r\n\t\t\t\t'cons' => 'consultation' \r\n\t\t), 'cons.pat_id_personne = pat.id_personne', array (\r\n\t\t\t\t'Datedemandehospi' => 'date',\r\n\t\t\t\t'Idcons' => 'id_cons' \r\n\t\t) )->join ( array (\r\n\t\t\t\t'dh' => 'demande_hospitalisation2' \r\n\t\t), 'dh.id_cons = cons.id_cons', array (\r\n\t\t\t\t'*' \r\n\t\t) )->join ( array (\r\n\t\t\t\t'med' => 'medecin' \r\n\t\t), 'med.id_personne = cons.id_personne', array (\r\n\t\t\t\t'NomMedecin' => 'nom',\r\n\t\t\t\t'PrenomMedecin' => 'prenom' \r\n\t\t) )->where ( array (\r\n\t\t\t\t'dh.valider_demande_hospi' => 0 \r\n\t\t) );\r\n\t\t\r\n\t\t/* Data set length after filtering */\r\n\t\t$stat = $sql->prepareStatementForSqlObject ( $sQuery );\r\n\t\t$rResultFt = $stat->execute ();\r\n\t\t$iFilteredTotal = count ( $rResultFt );\r\n\t\t\r\n\t\t$rResult = $rResultFt;\r\n\t\t\r\n\t\t$output = array (\r\n\t\t\t\t// \"sEcho\" => intval($_GET['sEcho']),\r\n\t\t\t\t// \"iTotalRecords\" => $iTotal,\r\n\t\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\r\n\t\t\t\t\"aaData\" => array () \r\n\t\t);\r\n\t\t\r\n\t\t/*\r\n\t\t * $Control pour convertir la date en fran�ais\r\n\t\t */\r\n\t\t$Control = new DateHelper ();\r\n\t\t\r\n\t\t/*\r\n\t\t * ADRESSE URL RELATIF\r\n\t\t */\r\n\t\t$baseUrl = $_SERVER ['REQUEST_URI'];\r\n\t\t$tabURI = explode ( 'public', $baseUrl );\r\n\t\t\r\n\t\t/*\r\n\t\t * Pr�parer la liste\r\n\t\t */\r\n\t\tforeach ( $rResult as $aRow ) {\r\n\t\t\t$row = array ();\r\n\t\t\tfor($i = 0; $i < count ( $aColumns ); $i ++) {\r\n\t\t\t\tif ($aColumns [$i] != ' ') {\r\n\t\t\t\t\t/* General output */\r\n\t\t\t\t\tif ($aColumns [$i] == 'Nom') {\r\n\t\t\t\t\t\t$row [] = \"<khass id='nomMaj'>\" . $aRow [$aColumns [$i]] . \"</khass>\";\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse if ($aColumns [$i] == 'Datenaissance') {\r\n\t\t\t\t\t\t$row [] = $Control->convertDate ( $aRow [$aColumns [$i]] );\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse if ($aColumns [$i] == 'Adresse') {\r\n\t\t\t\t\t\t$row [] = $this->adresseText ( $aRow [$aColumns [$i]] );\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse if ($aColumns [$i] == 'id') {\r\n\t\t\t\t\t\t$html = \"<infoBulleVue><a href='javascript:affichervue(\" . $aRow [$aColumns [$i]] . \")'>\";\r\n\t\t\t\t\t\t$html .= \"<img style='display: inline; margin-right: 15%;' src='\" . $tabURI [0] . \"public/images_icons/voir.png' title='détails'></a></infoBulleVue>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"<infoBulleVue><a href='javascript:hospitaliser(\" . $aRow [$aColumns [$i]] . \")'>\";\r\n\t\t\t\t\t\t$html .= \"<img style='display: inline; margin-right: 5%;' src='\" . $tabURI [0] . \"public/images_icons/details.png' title='Hospitaliser'></a></infoBulleVue>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"<input id='\" . $aRow [$aColumns [$i]] . \"' type='hidden' value='\" . $aRow ['Idcons'] . \"'>\";\r\n\t\t\t\t\t\t$html .= \"<input id='\" . $aRow [$aColumns [$i]] . \"dh' type='hidden' value='\" . $aRow ['id_demande_hospi'] . \"'>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$row [] = $html;\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse if ($aColumns [$i] == 'Prenom&NomMedecin') {\r\n\t\t\t\t\t\t$row [] = $aRow ['PrenomMedecin'] . \" \" . $aRow ['NomMedecin'];\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse if ($aColumns [$i] == 'Datedemandehospi') {\r\n\t\t\t\t\t\t$row [] = $Control->convertDateTime ( $aRow ['Datedemandehospi'] );\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$row [] = $aRow [$aColumns [$i]];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output ['aaData'] [] = $row;\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}", "public function index()\n\t{\n\t\treturn $this->vacationRepository->all();\n\t}", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('EventFormBundle:PeriodoDeInscricao')->findAll();\n\n return $this->render('EventFormBundle:PeriodoDeInscricao:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function Lista_Ciudades()//FUNCION PARA LLAMAR LA LISTA DE DEPARTAMENTOS\n {\n \n include('conexion.php');\n \n\n $Consulta_Ciudad = \"SELECT * FROM p_ciudad ORDER BY ciud_nombre\";\n\t\t\t $Resultado_Consulta_Ciudad = $conexion->prepare($Consulta_Ciudad);\n $Resultado_Consulta_Ciudad->execute();\n\t\t\t\t\t while ($f = $Resultado_Consulta_Ciudad->fetch())\t\n {\n\t\t\t\t\t\t echo '<option value=\"'.$f[ciud_codigo].'\">'.$f[ciud_nombre].'</option>';\n }\n \n }", "function obtener_facultades (){\n \n //$nombre_usuario=toba::usuario()->get_nombre();\n //$sql=\"SELECT t_s.sigla FROM sede t_s, administrador t_a WHERE t_a.nombre_usuario=$nombre_usuario AND t_s.id_sede=t_a.id_sede\";\n //$sql=\"SELECT t_ua.sigla, t_ua.descripcion FROM unidad_academica t_ua, sede t_s JOIN administrador t_a ON (t_a.nombre_usuario=$nombre_usuario) JOIN (t_a.id_sede=t_s.id_sede) WHERE t_s.sigla=t_ua.id_sede\";\n $sql=\"SELECT sigla, descripcion FROM unidad_academica WHERE sigla <> 'RECT'\";\n return toba::db('gestion_aulas')->consultar($sql);\n \n }", "public function memberList($eid = 1) {\n $config = $this->config('simple_conreg.settings.'.$eid);\n $countryOptions = SimpleConregOptions::memberCountries($eid, $config);\n $types = SimpleConregOptions::badgeTypes($eid, $config);\n $digits = $config->get('member_no_digits');\n\n switch(isset($_GET['sort']) ? $_GET['sort'] : '') {\n case 'desc':\n $direction = 'DESC';\n break;\n default:\n $direction = 'ASC';\n break;\n }\n switch(isset($_GET['order']) ? $_GET['order'] : '') {\n case 'Name':\n $order = 'name';\n break;\n case 'Country':\n $order = 'country';\n break;\n case 'Type':\n $order = 'badge_type';\n break;\n default:\n $order = 'member_no';\n break;\n }\n\n $content = array();\n\n //$content['#markup'] = $this->t('Unpaid Members');\n\n $content['message'] = array(\n '#cache' => ['tags' => ['simple-conreg-member-list'], '#max-age' => 600],\n '#markup' => $this->t('Members\\' public details are listed below.'),\n );\n\n $rows = [];\n $headers = [\n 'member_no' => ['data' => t('Member No'), 'field' => 'm.member_no', 'sort' => 'asc'],\n 'member_name' => ['data' => t('Name'), 'field' => 'name'],\n 'badge_type' => ['data' => t('Type'), 'field' => 'm.badge_type', 'class' => [RESPONSIVE_PRIORITY_LOW]],\n 'member_country' => ['data' => t('Country'), 'field' => 'm.country', 'class' => [RESPONSIVE_PRIORITY_MEDIUM]],\n ];\n $total = 0;\n\n foreach ($entries = SimpleConregStorage::adminPublicListLoad($eid) as $entry) {\n // Sanitize each entry.\n $badge_type = trim($entry['badge_type']);\n $member_no = sprintf(\"%0\".$digits.\"d\", $entry['member_no']);\n $member = ['member_no' => $badge_type . $member_no];\n switch ($entry['display']) {\n case 'F':\n $fullname = trim(trim($entry['first_name']) . ' ' . trim($entry['last_name']));\n if ($fullname != trim($entry['badge_name']))\n $fullname .= ' (' . trim($entry['badge_name']) . ')';\n $member['name'] = $fullname;\n break;\n case 'B':\n $member['name'] = trim($entry['badge_name']);\n break;\n case 'N':\n $member['name'] = t('Name withheld');\n break;\n }\n $member['badge_type'] = trim(isset($types[$badge_type]) ? $types[$badge_type] : $badge_type);\n $member['country'] = trim(isset($countryOptions[$entry['country']]) ? $countryOptions[$entry['country']] : $entry['country']);\n\n // Set key to field to be sorted by.\n if ($order == 'member_no')\n $key = $member_no;\n else\n $key = $member[$order] . $member_no; // Append member number to ensure uniqueness.\n if (!empty($entry['display']) && $entry['display'] != 'N' && !empty($entry['country'])) {\n $rows[$key] = $member;\n }\n $total++;\n }\n\n // Sort array by key.\n if ($direction == 'DESC')\n krsort($rows);\n else\n ksort($rows);\n\n $content['table'] = array(\n '#type' => 'table',\n '#header' => $headers,\n //'#footer' => array(t(\"Total\")),\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n\n $content['summary_heading'] = [\n '#markup' => $this->t('Country Breakdown'),\n '#prefix' => '<h2>',\n '#suffix' => '</h2>',\n ];\n\n $rows = array();\n $headers = array(\n t('Country'),\n t('Number of members'),\n );\n $total = 0;\n foreach ($entries = SimpleConregStorage::adminMemberCountrySummaryLoad($eid) as $entry) {\n if (!empty($entry['country'])) {\n // Sanitize each entry.\n $entry['country'] = trim($countryOptions[$entry['country']]);\n $rows[] = $entry;\n $total += $entry['num'];\n }\n }\n //Add a row for the total.\n $rows[] = array(t(\"Total\"), $total);\n $content['summary'] = array(\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n // Don't cache this page.\n //$content['#cache']['max-age'] = 0;\n\n return $content;\n }", "public function getAllAvailable()\n {\n try{\n $stmt = $this->connection->prepare(\n \"SELECT id, partenza, destinazione, durata, data_di_partenza, creato_al, contributo, v.foto, v.numero_posti\n FROM viaggio \n JOIN veicolo v on v.targa = viaggio.id_veicolo and v.id_autista = viaggio.id_autista\n WHERE stato = 'Not Completed'\n AND data_di_partenza > NOW()\n ORDER BY data_di_partenza;\");\n $stmt->execute();\n HTTP_Response::SendWithBody(HTTP_Response::MSG_OK, $stmt->fetchAll(), HTTP_Response::OK);\n }\n catch (PDOException $exception){\n HTTP_Response::SendWithBody(HTTP_Response::MSG_INTERNAL_SERVER_ERROR, $exception, HTTP_Response::INTERNAL_SERVER_ERROR);\n }\n }", "function get_entradas_boni_gral_list($offset, $per_page, $ubicacion)\n\t{\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct(e.pr_facturas_id), e.id as id1, e.fecha, sum(costo_total) as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatus from entradas as e left join cproveedores as pr on pr.id=e.cproveedores_id left join pr_facturas as prf on prf.id=e.pr_facturas_id left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id left join estatus_general as eg on eg.id=e.estatus_general_id where e.estatus_general_id=1 and ctipo_entrada=9 group by e.id, e.fecha, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id order by e.fecha desc limit $per_page offset $offset\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Vluchten')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }" ]
[ "0.56037074", "0.54625285", "0.54452515", "0.5405205", "0.5361675", "0.5359551", "0.53568226", "0.53077036", "0.5300708", "0.5292877", "0.5229869", "0.5183213", "0.5173436", "0.5171986", "0.5168669", "0.5156404", "0.5139592", "0.51228356", "0.5120314", "0.5114125", "0.509708", "0.5095857", "0.50849074", "0.5082629", "0.5077765", "0.5076238", "0.50762343", "0.5050977", "0.50226927", "0.50039726", "0.49942303", "0.498642", "0.49794543", "0.49712583", "0.4951384", "0.49369887", "0.49361828", "0.49327806", "0.49319547", "0.4930443", "0.49217358", "0.49189097", "0.4914698", "0.4911685", "0.49071556", "0.48972672", "0.487023", "0.48606703", "0.4860288", "0.48601285", "0.4859644", "0.48519352", "0.48290503", "0.4821743", "0.48159796", "0.48125875", "0.48120302", "0.48095593", "0.48067516", "0.48045784", "0.4802016", "0.47993147", "0.47983393", "0.4796967", "0.47913074", "0.47879115", "0.47851586", "0.4784707", "0.47828105", "0.4780782", "0.47800657", "0.477931", "0.4778412", "0.4774874", "0.47713026", "0.47691494", "0.47628278", "0.47623312", "0.47489274", "0.47480282", "0.47434106", "0.4739883", "0.47364613", "0.47272578", "0.47243622", "0.47233135", "0.47232184", "0.47060695", "0.4704749", "0.47024822", "0.468882", "0.46878394", "0.46844012", "0.46810797", "0.46795782", "0.46779025", "0.46709287", "0.4663838", "0.46634537", "0.46616954" ]
0.6995217
0
Run the database seeds.
public function run() { DB::table('news')->insert([ [ 'name'=>"BẢN TIN CU ĐƠ SỐ 35", 'short_description'=>"", 'full_description'=>'full', 'cover_image'=>"https://vnptproject.blob.core.windows.net/imagecontainer/newproject_1_original-348x209.png", 'is_highlight'=>true, 'created_at' => Carbon::now()->format('d-m-y H:i:s'), 'updated_at' => Carbon::now()->format('d-m-y H:i:s') ], [ 'name'=>"BẢN TIN CU ĐƠ SỐ 36", 'short_description'=>"", 'full_description'=>'full', 'cover_image'=>"https://vnptproject.blob.core.windows.net/imagecontainer/cu36_19_original-2-348x209.png", 'is_highlight'=>true, 'created_at' => Carbon::now()->format('d-m-y H:i:s'), 'updated_at' => Carbon::now()->format('d-m-y H:i:s') ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Get most used categories.
public function getMostUsed(int $count, int $minUsage): Collection;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTopCategories($limit=10) {\n\t\tglobal $db;\n\t\t$categories = $db->query(\"SELECT category, used FROM categories ORDER BY used DESC LIMIT $limit\");\n\t\treturn $categories;\n\t}", "public function getUsedCategoryIds()\n {\n return $this->_usedCategories;\n }", "public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }", "public static function getTopCategories() {\n global $lC_Database, $lC_Language;\n \n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_link_target, c.categories_custom_url, c.categories_mode from :table_categories c, :table_categories_description cd where c.parent_id = 0 and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 and c.categories_visibility_nav = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n while ( $Qcategories->next() ) {\n $topCategories[] = array('id' => $Qcategories->value('categories_id'),\n 'name' => $Qcategories->value('categories_name'),\n 'link_target' => $Qcategories->value('categories_link_target'),\n 'custom_url' => $Qcategories->value('categories_custom_url'),\n 'mode' => $Qcategories->value('categories_mode'));\n }\n \n return $topCategories; \n }", "public function getCategorias() {\n $categorias=$this->db->query('SELECT * FROM categorias ORDER BY id DESC;');\n return $categorias;\n }", "private function getPopularCategories()\n {\n $query = Queries::$getPopularCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getMostPopularCourses()\n {\n $result = $this\n ->_model\n ->orderBy('view_counter', 'desc')\n ->get();\n\n return $result;\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "public function generatePopularSubcategories()\n {\n\n $categoryId = $this->id;\n\n $subcategories = Subcategory::\n whereHas('categories', function ($query) use ($categoryId) {\n $query->where('categories.id', $categoryId);\n })\n ->whereHas('evercisegroups', function($query){})\n ->take(15)\n ->get()\n ->sortByDesc(function ($subcats) {\n return $subcats->evercisegroups->count();\n });\n\n $output = [];\n foreach ($subcategories as $subcat) {\n $output[] = [\n 'name' => $subcat->name,\n 'classes' => $subcat->evercisegroups->count(),\n ];\n }\n\n\n return $output;\n }", "public function get_categories() {\n\t\treturn $this->terms('category');\n\t}", "function getCategories() {\n\t\treturn $this->enumerateBySymbolic(CATEGORY_SYMBOLIC, 0, 0);\n\t}", "public function getCategories();", "public function getCategories();", "public function getCountCategory()\n {\n return $this->category_model->countAll();\n }", "function getCategoriesCount(){\n return $this->query(\"SELECT GROUP_CONCAT(category) FROM docs WHERE visible=1\");\n }", "private static function _getSelectCategories()\n {\n $categories = Blog::category()->orderBy('name')->all();\n $sortedCategories = array();\n\n foreach($categories as $c)\n $sortedCategories[$c->id] = $c->name;\n\n return $sortedCategories;\n }", "public function getCategoryLimitedSortedTree()\n {\n $page = $this->request->getParam('p') ?: 1;\n $beginPageValue = ($page * $this->getLimitPerPage()) - $this->getLimitPerPage();\n $categories = $this->getCategoriesTree();\n $categories = array_splice($categories, $beginPageValue, $this->getLimitPerPage());\n\n return $categories;\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "function getCategoryCount() {\n\t\treturn count($this->domit_rss_categories);\n\t}", "function getCategoryCount() {\n\t\treturn count($this->domit_rss_categories);\n\t}", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }", "public function getAvailableInCategories()\n {\n return $this->_getResource()->getAvailableInCategories($this);\n }", "public static function categories() {\n\t\t// can take a long time\n\t\tset_time_limit(0);\n\n\t\t// select all uncategorized monuments\n\t\t$monuments = ORM::factory('monument')->where('id_category','is',null)->or_where('id_category','=',12)->find_all();\n\t\t$i = 0;\n\t\tforeach($monuments as $monument) {\n\n\t\t\t$category = $monument->extractCategory();\n\n\t\t\t// save the extracted category to the database\n\t\t\t$monument->id_category = $category;\n\t\t\t$monument->category_extracted = 1;\n\t\t\tif($category > 0) {\n\t\t\t\t$i++;\n\t\t\t\t$monument->save();\n\t\t\t}\n\t\t}\n\n\t\treturn $i;\n\t}", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }", "public function categories()\n {\n $categories = Category::all();\n $supermarket_categories = [];\n\n foreach($categories as $category) {\n if($category->products->where('supermarket_id', $this->id)->count()) {\n $supermarket_categories[] = $category;\n } \n }\n \n return collect($supermarket_categories);\n }", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }", "public function findCountCategories()\n {\n $query = self::getDb()->prepare(\"\n\t\t\tSELECT COUNT(id)\n\t\t\tFROM {$this->repository}\n\t\t\");\n $query->execute();\n $count = $query->fetch();\n return $count[0];\n }", "public function getCategorias(){\n\t\t$sql = \"SELECT * FROM tipo_producto ORDER BY nombre_tipo_prod\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function get_categories()\n\t{\n\t\treturn $this->_categories;\n\t}", "public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "static function get_all_available_categories()\n {\n //moduli primari\n $modules_root = new Dir(DS.ModuleUtils::get_modules_path());\n\n $all_folders = $modules_root->listFolders();\n\n $result = array();\n\n foreach ($all_folders as $cat)\n {\n if ($cat->isDir())\n {\n $result[] = $cat->getName();\n }\n }\n\n //aggiungo la categoria framework se non è presente.\n if (!ArrayUtils::has_value($result, ModuleUtils::FRAMEWORK_CATEGORY_NAME))\n $result[] = ModuleUtils::FRAMEWORK_CATEGORY_NAME;\n //ok\n\n return $result;\n }", "protected function totalCategories() {\n\n return $this->taxonomy->count();\n }", "public function getCategories() {\n return $this->categories;\n }", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "public function getMostUsed(int $count, int $minUsage): Collection\n {\n return $this->getQuery()\n ->join('hrefs', 'hrefs.category_id', '=', 'categories.id')\n ->where('hrefs.visible', true)\n ->groupBy('categories.id', 'categories.title')\n ->having(\\DB::raw('COUNT( hrefs.id )'), '>=', $minUsage)\n ->orderBy('usages', 'desc')\n ->limit($count)\n ->get([\n 'categories.id',\n 'categories.title',\n \\DB::raw('COUNT(`hrefs`.`id`) AS `usages`')\n ]);\n }", "public function get_site_categories( $no_uncategorized = true ) {\n\t\t$popular_category_names = wp_cache_get( 'amt_get_all_categories', 'category' );\n\t\tif ( ! $popular_category_names ) {\n\t\t\t$popular_category_names = get_terms(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'fields' => 'names',\n\t\t\t\t\t'get' => 'all',\n\t\t\t\t\t'number' => 20, // limit to 20 to avoid killer queries.\n\t\t\t\t\t'orderby' => 'count',\n\t\t\t\t)\n\t\t\t);\n\t\t\twp_cache_add( 'amt_get_all_categories', $popular_category_names, 'category', 'WEEK_IN_SECONDS' );\n\t\t}\n\n\t\tif ( empty( $popular_category_names ) && ! is_array( $popular_category_names ) ) {\n\t\t\t$categories_as_string = '';\n\t\t} else {\n\t\t\tif ( $no_uncategorized ) {\n\t\t\t\t$uncategorized_position = array_search( 'Uncategorized', $popular_category_names, true );\n\t\t\t\tif ( false !== $uncategorized_position ) {\n\t\t\t\t\tunset( $popular_category_names[ $uncategorized_position ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$categories_as_string = implode( ', ', $popular_category_names );\n\t\t}\n\n\t\t/**\n\t\t * Filter the categories as derived by this function.\n\t\t *\n\t\t * @param string $categories_as_string The derived category list. Comma-separated list.\n\t\t * @param array $popular_category_names The array of found category names.\n\t\t */\n\t\treturn apply_filters( 'amt_get_all_the_categories', $categories_as_string, $popular_category_names );\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "function getCategories($limit=0) {\n\t$limit = intval($limit);\n\tif($limit != 0) { $limit = \"LIMIT $limit\"; }\n\telse { $limit = \"\"; }\n\t$query = \"SELECT c.*,IFNULL(l.count,0) AS count FROM categories AS c LEFT JOIN (\n\t\t\tSELECT category, COUNT(*) AS count FROM links GROUP BY category\n\t\t ) AS l ON l.category=c.name WHERE c.name != 'main' AND count > 0 ORDER BY count DESC $limit\";\n\treturn(dbResultArray($query));\n}", "function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}", "public function get_categories() {\n\t\treturn array( 'general' );\n\t}", "public function getCategories(){\n return Category::get();\n }", "function getCatsselected()\r\n\t{\r\n\t\tif(!isset($this->_item->categories)||!is_array($this->_item->categories)) {\r\n\t\t\t$query = 'SELECT DISTINCT catid FROM #__flexicontent_cats_item_relations WHERE itemid = ' . (int)$this->_id;\r\n\t\t\t$this->_db->setQuery($query);\r\n\t\t\t$used = $this->_db->loadResultArray();\r\n\t\t\treturn $used;\r\n\t\t}\r\n\t\treturn $this->_item->categories;\r\n\t}", "public function get_categories()\n\t{\n\t\treturn array('general');\n\t}", "public function get_category_count()\n {\n $result=$this->db->count_all($this->table_name);\n return $result;\n }", "public function countCath()\n\t{\n \t\treturn $this->findAll('kategoria')->count('*');\n\t}", "protected function _getCategoriesForStore()\n {\n if (!$this->_categoriesForStore) {\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $rootCategory = Mage::getModel('catalog/category')->load($rootCategoryId);\n $rootResource = $rootCategory->getResource();\n $this->_categoriesForStore = implode(',', $rootResource->getChildren($rootCategory));\n }\n return $this->_categoriesForStore;\n }", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function getCategoryCount()\n {\n return count(get_the_category($this->id));\n }", "public function getAllCategories();", "public function getSuggestions()\n {\n $ttl = 60; // seconds\n\n $categories = Cache::remember('customer_suggestions', $ttl, function () {\n return Category::inRandomOrder()\n ->orderBy('name')\n ->take(5)\n ->get()\n ->sortBy(function ($model) {\n return $model->name;\n })\n ->values()\n ->each(function ($category) {\n $category->load(['films' => function ($query) {\n $query->inRandomOrder()->take(10);\n }]);\n });\n });\n\n return new CategoryCollection($categories);\n }", "public static function getCategories()\n {\n $app = App::getInstance();\n\n $manager = BaseManager::build('FelixOnline\\Core\\Category', 'category');\n\n try {\n $values = $manager->filter('hidden = 0')\n ->filter('deleted = 0')\n ->filter('id > 0')\n ->order('order', 'ASC')\n ->values();\n\n return $values;\n } catch (\\Exception $e) {\n return array();\n }\n }", "public function get_categories()\n {\n return ['super-cat'];\n }", "public function getCategories() {\n\t\t$db = new SelectionDB;\n\n\t\t$categories = $db->getCategories();\n\n\t\t# Get each value, convert to string and push it into categories property\n\t\tfor($i=0; $i<count($categories); $i++) {\n\t\t\t// convert to string\n\t\t\t$category = implode($categories[$i]);\n\t\t\t\n\t\t\t// push into categories property\n\t\t\tarray_push($this->categories, $category);\n\t\t}\n\n\t\t// Removing duplicate values from an array\n\t\t$result = array_unique($this->categories);\n\n\t\treturn $result;\n\t}", "public function allCategories()\n {\n return Category::all();\n }", "public function getCategories()\n\t{\n\t\treturn $this->categories;\n\t}", "public function getCategories()\n {\n return Category::all();\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function topCategory(){\n $category = Category::select('title')\n ->join('category_meals', 'categories.id', 'category_meals.category_id')\n ->selectRaw('COUNT(category_id) AS count')\n ->groupby('title')\n ->orderBy('count', 'desc')\n ->take(5)\n ->get();\n return response()->json([\n 'data' => $category,\n ]);\n }", "private function categories()\n\t{\n\t\t$categories = ORM::factory('forum_cat')->find_all();\n\t\tif(0 == $categories->count())\n\t\t\treturn FALSE;\n\t\t\t\n\t\treturn $categories;\n\t}", "public function getPopularSubcategories()\n {\n\n //return $this->popular_subcategories;\n\n if ($this->popular_subcategories)\n {\n $subcats = Subcategory::whereIn('id', explode(',', $this->popular_subcategories))->get();\n\n $output = [];\n foreach ($subcats as $subcat) {\n $output[] = [\n 'name' => $subcat->name,\n ];\n }\n\n return $output;\n }\n else\n {\n return [];\n }\n }", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function getStrategys()\n {\n return [\n\n ];\n }", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function get_categories() {\n return array ( 'general' );\n }", "public function get_Categorias() {\n $this->db->order_by(\"orden\", \"ASC\");\n $query = $this->db->get( $this->table );\n \n $result = $query->result_array();\n \n return $result;\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function get_tipo_cat()\n { \n \n \n $this->db->select(\"distinct(cve_tipo_categoria), nom_tipo_cat\");\n\n $this->db->order_by('nom_tipo_cat','asc');\n $query = $this->db->get('ccategoria');\n \n $data_cat=0;\n $data_cat = array();\n foreach ($query->result_array() as $row)\n {\n \n $data_cat[$row['cve_tipo_categoria']] = $row['nom_tipo_cat']; \n }\n $query->free_result();\n\n return $data_cat; \n\n }", "public static function getActiveCategories(){}", "public function NumeroCategorias(){\n $numero_categorias = Categorie::count();\n return $numero_categorias;\n }", "public function getNewTicketCategories()\n\t{\n\t\tif ($this->isAdmin()){\n\t\t\t$categories = Category::orderBy('name');\n\t\t}else{\n\t\t\t$categories = Category::where('create_level', '1')->orderBy('name')->get();\n\n\t\t\tif ($this->isAgent() and $this->currentLevel() == 2){\n\t\t\t\t$create_level_2 = $this->categories()->where('create_level', '2')->get();\n\n\t\t\t\t$categories = $categories->merge($create_level_2)->sortBy('name');\n\n\t\t\t}\n\t\t}\n\n\t\tif (LaravelVersion::min('5.3.0')) {\n return $categories->pluck('name', 'id');\n } else {\n return $categories->lists('name', 'id');\n }\n\t}", "public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }", "public function getCategorie()\n {\n return $this->categorie;\n }", "public function getCategories() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtsms_categories', 'a'));\n\n\t\t$query->where($db->quoteName('a.published').' = 1');\n\n\t\t$query->group($db->quoteName('a.id'));\n\t\t$query->order($db->quoteName('a.name'));\n\n\t\t$db->setQuery($query);\n\n\t\t\n\t\t$categories = array();\n\t\t$categories[0]\t= JText::_('COM_GTSMS_UNCATEGORIZED');\n\n\t\tforeach ($db->loadObjectList('id') as $k => $item) {\n\t\t\t$categories[$k] = $item->name;\n\t\t}\n\n\t\treturn $categories;\n\t}", "public function getCategory();", "public function getCategory();", "public function findCategories();" ]
[ "0.7166379", "0.6749168", "0.6592025", "0.6474236", "0.6453217", "0.6434446", "0.6423125", "0.6409292", "0.63249904", "0.63217443", "0.62262", "0.6223241", "0.61820984", "0.6173459", "0.6173459", "0.6163641", "0.61551267", "0.6147352", "0.6142744", "0.6142379", "0.61331403", "0.61331403", "0.6121309", "0.61120796", "0.60978955", "0.60967386", "0.6089437", "0.6071855", "0.6031092", "0.6021334", "0.5992707", "0.598302", "0.597997", "0.5960306", "0.5950596", "0.59498936", "0.5949034", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.5939467", "0.59301203", "0.5917473", "0.5895382", "0.5894366", "0.5891107", "0.58839864", "0.587317", "0.587317", "0.587317", "0.58717024", "0.5868927", "0.5868317", "0.5864648", "0.5860468", "0.5859085", "0.5856682", "0.5855195", "0.5853825", "0.5850184", "0.58483565", "0.58483565", "0.5847396", "0.58421093", "0.58378816", "0.5830253", "0.58106554", "0.5805846", "0.5803095", "0.5799818", "0.5788981", "0.5786255", "0.57724077", "0.57669723", "0.5766612", "0.5762671", "0.57581973", "0.5745836", "0.5745836", "0.57399106", "0.5738866", "0.5727602", "0.57214165", "0.57151806", "0.5715147", "0.5707242", "0.57009035", "0.56987107", "0.56947637", "0.56943846", "0.56938976", "0.5693373", "0.5693373", "0.5692646" ]
0.5812668
72
///////////////////////////////////////////////////////////////////////// ////// DONNEES ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
Function donneefournisseurs() { echo "copie des données de la table fournisseurs"; $req="INSERT INTO `".Valorisation::$anneenouvelle."`.`fournisseurs` SELECT * FROM `".Valorisation::$anneeancienne."`.`fournisseurs`"; Valorisation::$bddnew->query($req); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _NDL()\r\n\t{\r\n\r\n\t}", "public function nadar()\n {\n }", "public function getDod();", "public function getD() {}", "public function getDNIS();", "public function get_nonces()\n {\n }", "public function masodik()\n {\n }", "public function refresh_nonces()\n {\n }", "function DWT() { \n }", "private function __() {\n }", "public function oops () {\n }", "public function test_dotorg_communication()\n {\n }", "function d() {\n return;\n }", "final private function __construct(){\r\r\n\t}", "public function getDni()\n\t{\n\t\treturn $this->dni;\n\t}", "public function getDn();", "public function monarch()\n {\n }", "public function getDni() {\n\t\treturn $this->dni;\n\t}", "private function __construct()\t{}", "public function getDni()\n {\n return $this->_dni;\n }", "public function ogs()\r\n {\r\n }", "static function est_a_jour(array &$donnees)\r\n {\r\n return true;\r\n }", "static function est_a_jour(array &$donnees)\r\n {\r\n return true;\r\n }", "final private function __construct() {}", "final private function __construct() {}", "public function serch()\n {\n }", "public function attaquerAdversaire() {\n\n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function getDni()\n {\n return $this->dni;\n }", "public function testPingTreeCreatePingTree()\n {\n }", "public function dig()\r\n\t{\r\n\t\techo \"Dug a hole \";\r\n\t}", "function ddns4generate($inf, $phyinf, $ddnsp)\n{\n\t$stsp = XNODE_getpathbytarget(\"/runtime\", \"inf\", \"uid\", $inf, 0);\n\n\t/* Get the network info. */\n\t$addrtype\t= query($stsp.\"/inet/addrtype\");\n\tif ($addrtype == \"ipv4\")\t$ipaddr = query($stsp.\"/inet/ipv4/ipaddr\");\n\telse\t\t\t\t\t\t$ipaddr = query($stsp.\"/inet/ppp4/local\");\n\n\t/* Get the DDNS service index*/\n\tanchor($ddnsp);\n\t$provider\t= query(\"provider\");\n\t$username\t= get(\"s\", \"username\");\n\t$password\t= get(\"s\", \"password\");\n\t$hostname\t= get(\"s\", \"hostname\");\n\t$interval\t= get(\"s\", \"interval\");\n\tif ($provider == \"IOBB\")\n\t{\n\t\t$model\t\t= query(\"/runtime/device/modelname\");\n\t\t$hostname\t= $hostname.\".iobb.net\";\n\t\tif($interval==\"\")\t$interval\t= 14400; /* 10 days */\n\t\t$useragent\t= iobb_user_agent($model);\n\t}\n\telse\n\t{\n\t\t$vendor\t\t= query(\"/runtime/device/vendor\");\n\t\t$model\t\t= query(\"/runtime/device/modelname\");\n\t\tif($interval==\"\")\t$interval\t= 21600; /* 15 days */\n\t\t$useragent\t= '\"'.$vendor.' '.$model.'\"';\n\t}\n\n\tset($stsp.\"/ddns4/valid\",\t\t\"1\");\n\tset($stsp.\"/ddns4/provider\",\t$provider);\n\t$cmd = \"susockc /var/run/ddnsd.susock DUMP \".$provider;\n\tsetattr($stsp.\"/ddns4/uptime\",\t\"get\", $cmd.\" | scut -p uptime:\");\n\tsetattr($stsp.\"/ddns4/ipaddr\",\t\"get\", $cmd.\" | scut -p ipaddr:\");\n\tsetattr($stsp.\"/ddns4/status\",\t\"get\", $cmd.\" | scut -p state:\");\n\tsetattr($stsp.\"/ddns4/result\",\t\"get\", $cmd.\" | scut -p result:\");\n\n\t$set = 'SET '.$provider.' \"'.$ipaddr.'\" \"'.$username.'\" \"'.$password.'\" \"'.$hostname.'\" '.$interval;\n\t/* start the application */\n\tfwrite(\"a\",$_GLOBALS[\"START\"],\n\t\t'event DDNS4.'.$inf.'.UPDATE add \"susockc /var/run/ddnsd.susock UPDATE '.$provider.'\"\\n'.\n\t\t'susockc /var/run/ddnsd.susock USERAGENT '.$useragent.'\\n'.\n\t\t'susockc /var/run/ddnsd.susock '.$set.'\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/valid 1\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/provider '.$provider.'\\n'.\n\t\t'exit 0\\n');\n\n\tfwrite(\"a\", $_GLOBALS[\"STOP\"],\n\t\t'event DDNS4.'.$inf.'.UPDATE add true\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/valid 0\\n'.\n\t\t'xmldbc -s '.$stsp.'/ddns4/provider \"\"\\n'.\n\t\t'susockc /var/run/ddnsd.susock DEL '.$provider.'\\n'.\n\t\t'exit 0\\n');\n}", "function ListNodos(){\n\t\t$clase=$this->nmclass;\n\t\t$nodosnum=count($this->nodos[$clase]);\n\t\techo(\"Lista de Nodos: <br>\");\n\t\tforeach ($this->nodos[$clase] as $key=>$value) {\n\t\t echo(\"Clave: $key; Valor: $value<br />\\n\");\n\t\t}\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function getDW() {}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct () {}", "public function elso()\n {\n }", "final private function __construct()\n\t{\n\t}", "public function testPingTreeGetTargets()\n {\n }", "public function testDSTIdInstantiatePost()\n {\n }", "public function testPingTreeGetReferences()\n {\n }", "private function __construct()\n\t{\n\t\t\n\t}", "public function direct ()\n {\n // TODO Auto-generated 'direct' method\n }", "private function j() {\n }", "final function __construct() { \n\t}", "private function __construct( )\n {\n\t}", "public function afmelden()\n {\n return true;\n }", "private function _i() {\n }", "private function __construct()\r\n {}", "public function testPingTreeDeleteTarget()\n {\n }", "abstract public function _get_connected();", "public function testPingTreeUpdateTargets()\n {\n }", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.6770926", "0.63583595", "0.5771632", "0.5640144", "0.5603915", "0.539892", "0.5302617", "0.5300238", "0.5267297", "0.5229034", "0.5204969", "0.51400983", "0.5136169", "0.51331395", "0.5116453", "0.5105415", "0.50690305", "0.50632244", "0.5057986", "0.50569594", "0.501162", "0.5007001", "0.5007001", "0.49764243", "0.49764243", "0.497616", "0.49665645", "0.49662018", "0.49662018", "0.49662018", "0.4961826", "0.49565303", "0.49496976", "0.4948053", "0.49391463", "0.49338782", "0.4919577", "0.49181283", "0.49168128", "0.49120176", "0.49057683", "0.489195", "0.48914215", "0.489074", "0.4886705", "0.48836178", "0.4883598", "0.4876823", "0.48742095", "0.48569772", "0.48562917", "0.4850334", "0.48474932", "0.48469046", "0.48349926", "0.48347872", "0.48331252", "0.48322096", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134", "0.48321134" ]
0.0
-1
/ Get all plugins
private function plugins(){ $all_plugins = explode(',', json_decode(file_get_contents($this->pluginsJson))->all->names); debug($all_plugins); die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_plugins() {\n\t\treturn get_plugins();\n\t}", "function getPlugins();", "public function getPlugins()\n {\n $this->getPlugin('base');\n }", "public function get_all()\n {\n $plugins = $this->get_plugins();\n\n $pluginControllers = array();\n\n foreach($plugins as $plugin){\n foreach($plugin as $controller => $actions){\n $pluginControllers[$controller] = $plugin[$controller];\n }\n }\n\n return array_merge($this->get(), $pluginControllers);\n }", "public static function getPlugins() {\r\n\t\treturn self::getModulesForUser(Config::$sis_plugin_folder);\r\n\t}", "function getPlugins() {\n return $this->plugins;\n }", "function getPlugins() {\n\n return $this->plugins;\n\n }", "public static function getPlugins()\n\t{\n\t\treturn $plugins = glob(__DIR__.'/../../content/plugins/*/index.php');\n\t}", "function subsite_manager_get_plugins() {\n\n // grab plugins\n $options = array(\n 'type' => 'object',\n 'subtype' => 'plugin',\n 'limit' => false\n );\n\n $old_ia = elgg_set_ignore_access(true);\n $plugins = elgg_get_entities($options);\n elgg_set_ignore_access($old_ia);\n\n return $plugins;\n }", "static final function getPlugins()\n {\n self::initPlugins();\n return self::$plugins;\n }", "public function getPlugins()\n {\n return $this->getService('plugins');\n }", "public function getPlugins()\n {\n return $this->plugins;\n }", "public function getPlugins()\n {\n return $this->plugins;\n }", "protected function get_installed_plugins()\n {\n }", "public function getPlugins()\n\t{\n\t\treturn $this->plugins;\n\t}", "public static function plugins() {\n\t\t\treturn self::$plugins;\n\t\t}", "public function getPlugins() {\n if (is_null($this->_plugins)) {\n $this->_plugins = $this->_scanPlugins();\n }\n return $this->_plugins;\n }", "public function listPlugin()\n\t{\n\t\t\n\t}", "protected function get_plugins() {\n\t\tif ( ! $this->plugins ) {\n\t\t\t$this->plugins = array_keys( get_plugins() );\n\t\t}\n\n\t\treturn $this->plugins;\n\t}", "public function get_plugins()\n {\n $pluginDirs = App::objects('plugin', null, false);\n $plugins = array();\n\n foreach ($pluginDirs as $pluginDir){\n\n $pluginClasses = App::objects('controller', APP.'Plugin'. DS .$pluginDir. DS .'Controller', false);\n\n App::import('Controller', $pluginDir.'.'.$pluginDir.'App');\n $parentActions = get_class_methods($pluginDir.'AppController');\n\n foreach($pluginClasses as $plugin) {\n\n if (strpos($plugin,'App') === false) {\n\n $plugin = str_ireplace('Controller', '', $plugin);\n App::import('Controller', $pluginDir.'.'.$plugin);\n $actions = get_class_methods($plugin.'Controller');\n\n foreach($actions as $k => $v) {\n if ($v{0} == '_') {\n unset($actions[$k]);\n }\n }\n\n $plugins[$pluginDir][$plugin] = array_diff($actions, $parentActions);\n }\n }\n }\n\n return $plugins;\n }", "function getPlugins() {\n\n\tglobal $di;\n\n\t$pluginsPath = path_content('plugins');\n\t$plugins = [];\n\t$envs = ['Admin', 'Cms'];\n\n\tforeach($envs as $env) {\n\t\t$list = scandir($pluginsPath.'\\\\'.$env);\n\n\t\tif(!empty($list)) {\n\t\t\tunset($list[0]);\n\t\t\tunset($list[1]);\n\n\t\t\tforeach($list as $namePlugin) {\n\n\t\t\t\t$namespace = '\\\\Plugin\\\\' . $env . '\\\\' . $namePlugin . '\\\\Plugin';\n\t\t\t\tif(class_exists($namespace)) {\n\t\t\t\t\t$plugin = new $namespace($di);\n\t\t\t\t\t$plugins[$namePlugin] = $plugin->details();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn $plugins;\n}", "function getEnabledPlugins();", "public function get_meta_plugins() {\n\t\tSingleton::get_instance( 'Plugin', $this )->get_remote_plugin_meta();\n\t}", "public function getRegisteredPlugins()\n {\n return $this->registeredPlugins;\n }", "public function getPlugins()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('plugins');\n }", "public function getPlugins()\n {\n return $this->getProperty()->plugins;\n }", "public static function getPluginList () {\n\t\treturn self::$pInfo[1];\n\t\t$glob = glob(TH_ROOT.TH_PLUGINS.'*/plugin.php');\n\t\tforeach($glob as $plugin) {\n\t\t\t// $plugin is a full path, we don't want that.\n\t\t\t$plugin = explode(TH_ROOT.TH_PLUGINS, $plugin, 2);\n\t\t\t$plugin = explode('/plugin.php', $plugin[1]);\n\t\t\t$r[] = $plugin[0];\n\t\t}\n\t\treturn $r;\n\t}", "public function getPlugins() {\n if ( is_null($this->_plugins) ) {\n $this->_plugins = array();\n $plugins = $this->_app->config->getConfig('plugins');\n foreach( $plugins as $name => $conf ) {\n $this->_plugins[ $name ] = new Plugin(\n $this->_app, \n !empty($conf['enabled']) ? $conf['enabled'] : false,\n !empty($conf['options']) ? $conf['options'] : array()\n );\n }\n }\n return $this->_plugins;\n }", "public static function getPlugins()\n {\n if (static::$plugins instanceof Closure) {\n return (static::$plugins)();\n }\n\n return static::$plugins;\n }", "public function obtenerPlugins(){\n if ($this->getSelectedLicense() > empresa::LICENSE_FREE) {\n return plugin::getAll();\n }\n\n return false;\n //return $this->obtenerObjetosRelacionados( TABLE_EMPRESA .\"_plugin\", \"plugin\");\n }", "public function getInstalledPlugins()\n {\n $pluginModel = Plugin::model(); \n $records = $pluginModel->findAll();\n \n $plugins = array();\n\n foreach ($records as $record) {\n // Only add plugins we can find\n if ($this->loadPlugin($record->name) !== false) {\n $plugins[$record->id] = $record;\n }\n }\n return $plugins;\n }", "static public function all_subplugins() {\n $plugins = [];\n $pluginnames = self::all_subplugin_names();\n foreach ($pluginnames as $contextname) {\n $plugins[] = self::factory($contextname);\n }\n return $plugins;\n }", "function loadPlugins() {\n // @todo make this more efficient\n $plugin_dirs = $this->listDir(MWG_BASE . '/plugins/');\n foreach($plugin_dirs as $ptypes) {\n $this->loadPluginGroup($ptypes);\n } \n }", "public function getAvailablePlugins()\n\t{\n\t\t$this->loadAvailablePlugins();\n\t\treturn self::$_plugins;\n\t}", "public function getPluginInstances()\n {\n return Collection::make($this->pluginDirectories())->map(function ($path) {\n $name = $this->files->basename($path);\n $class = $this->qualifyNamespace($name);\n \n if(! class_exists($class)) {\n return null;\n }\n\n $plugin = new $class(app());\n\n if($plugin instanceof Plugin) {\n return $plugin;\n } \n\n return null;\n })->filter();\n }", "public function getRequiredPlugins() {}", "function wp_get_mu_plugins()\n {\n }", "private function pageGetPlugins() {\n\t\techo \"<reply action=\\\"ok\\\">\\n\";\r\n\t\t\r\n\t\t//To get the status of all plugins, they must all be started first.\n\t\t//As a safety measure, check that it's not running at boot.\n\t\t$this->framework->startAllPlugins ( false );\r\n\t\t\r\n\t\t//Print each plugin\n\t\tforeach ( $this->data as $plugin ) {\r\n\t\t\t$plugin_object = $this->framework->getPlugin ( ( string ) $plugin ['name'] );\r\n\t\t\t$status = \"\";\r\n\t\t\tif (isset ( $plugin_object )) {\r\n\t\t\t\t$status = $plugin_object->getStatus ();\r\n\t\t\t} else if (( string ) $plugin ['enabled'] == \"true\") {\r\n\t\t\t\tthrow new Exception('The module '.$plugin['name'].' could not be retrieved');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<plugin status=\\\"{$status}\\\" \";\r\n\t\t\t//also print all other attributes the plugin has.\n\t\t\tforeach ( $plugin->attributes () as $name => $value ) {\r\n\t\t\t\techo \" $name = \\\"$value\\\"\";\r\n\t\t\t}\r\n\t\t\techo \"/>\\n\"; //Closing tag of plugin\n\t\t}\r\n\t\techo \"</reply>\";\r\n\t}", "protected function getPlugins()\n {\n delete_site_transient('update_plugins');\n wp_update_plugins();\n\n $data = get_site_transient('update_plugins');\n $plugins = get_plugins();\n foreach ($plugins as $pluginKey => &$plugin) {\n $plugin['Status'] = is_plugin_active($pluginKey) ? 'active' : 'inactive';\n\n $plugin['Slug'] = null;\n if (isset($data->response[$pluginKey]->slug)) {\n $plugin['Slug'] = $data->response[$pluginKey]->slug;\n } elseif (isset($data->no_update[$pluginKey]->slug)) {\n $plugin['Slug'] = $data->no_update[$pluginKey]->slug;\n }\n }\n return $plugins;\n }", "function get_mu_plugins()\n {\n }", "function get_plugins_list()\n\t{\n\t\t$dir = @opendir(MYBB_ROOT.\"inc/plugins/\");\n\t\tif($dir)\n\t\t{\n\t\t\twhile($file = readdir($dir))\n\t\t\t{\n\t\t\t\t$ext = get_extension($file);\n\t\t\t\tif($ext == \"php\")\n\t\t\t\t{\n\t\t\t\t\t$plugins_list[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@sort($plugins_list);\n\t\t}\n\t\t@closedir($dir);\n\n\t\treturn $plugins_list;\n\t}", "public function discoverPlugins() {\n foreach($this->fs->roots(false) as $root) {\n $this->findAvailablePlugins($root);\n }\n }", "public function getPlugins()\n {\n if ($this->plugins instanceof \\Doctrine\\ORM\\PersistentCollection) {\n return $this->plugins->getValues();\n }\n else {\n return $this->plugins;\n }\n }", "private function get_user_installed_plugins() {\n // All plugins - \"external/installed by user\".\n $allplugins = array();\n\n $pluginman = \\core_plugin_manager::instance();\n $plugininfos = $pluginman->get_plugins();\n\n foreach ($plugininfos as $key => $modtype) {\n foreach ($modtype as $key => $plug) {\n if (!$plug->is_standard() && !$plug->is_subplugin()) {\n // Each plugin data, // can be different structuer in case of wordpress product.\n $allplugins[] = array(\n 'name' => $plug->displayname,\n 'versiondisk' => $plug->versiondisk,\n 'versiondb' => $plug->versiondb,\n 'versiondisk' => $plug->versiondisk,\n 'release' => $plug->release\n );\n }\n }\n }\n\n return $allplugins;\n }", "public function getPluginManager();", "abstract protected function get_plugin_components();", "private static function plugins()\n {\n $files = ['Plugins'];\n $folder = static::$root.'Plugins'.'/';\n\n self::call($files, $folder);\n\n $files = ['AutoloadFileNotFoundException', 'InfoStructureException'];\n $folder = static::$root.'Plugins/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function get_plugins(){\n\t\t\t\n\t\t\t$this->load->dbutil(); \n\n\t\t\tif($this->dbutil->database_exists('wpadmin_localhost')){\n\n\t\t\t\t# Get the credentials from the database to populate the database below.\n\t\t \t$this->load->model('download_model');\t\n\n\t\t\t\t$query = $this\n\t\t\t\t\t\t\t->download_model\n\t\t\t\t\t\t\t->get_site_credentials();\n\n\t\t\t\t$host = $query[0]->admin_host;\n\t\t\t\t$user = $query[0]->admin_user;\n\t\t\t\t$pass = $query[0]->admin_password;\t\t\t\t\n\n\t\t\t\t$config['hostname'] = \"localhost\";\n\t\t\t $config['username'] = $user;\n\t\t\t $config['password'] = $pass;\n\t\t\t $config['database'] = \"wordpress_default_plugins\";\n\t\t\t $config['dbdriver'] = \"mysql\";\n\t\t\t $config['dbprefix'] = \"\";\n\t\t\t $config['pconnect'] = FALSE;\n\t\t\t $config['db_debug'] = TRUE;\n\t\t\t $config['cache_on'] = FALSE;\n\t\t\t $config['cachedir'] = \"\";\n\t\t\t $config['char_set'] = \"utf8\";\n\t\t\t $config['dbcollat'] = \"utf8_general_ci\";\n\n\t\t\t \t$db2 = $this->load->database($config,TRUE);\n\n\t\t\t\t$query = $db2->get('default_plugins');\n\n\t\t\t\t$query = $query->result();\t\n\n\t\t\t\treturn $query; \t\t\t\n\n\t\t\t}\telse {\n\t\t\t\tredirect('admin');\n\t\t\t}\n\n\n\t\t}", "private static function search()\r\n\t{\r\n\t\t$dir = 'plugins';\r\n\t\t// search for plugin modules in the plugins directory\t\t \r\n\t\t$modules = model_Utils_ModuleHelper::searchDirectoryForModules($dir);\r\n\t\tforeach ($modules as $module)\r\n\t\t{\r\n\t\t\t// save found module paths to the db so we can auto-load them in the future\r\n\t\t\tmodel_Utils_ModuleHelper::saveModule($module);\r\n\t\t\t// add matching paths to Kohana's module paths\t\t\r\n\t\t\tmodel_Utils_ModuleHelper::addModulePath($module);\r\n\t\t}\r\n\t\treturn Model_Admin_EventsAdmin::searchForListeners($dir,'Interface_iPCPPlugin');\t\r\n\t}", "public function getInstalledPlugins()\n {\n $installed = array();\n foreach ($this->environment->getRegistry()->packageInfo(null, null, null) as $channel => $packages)\n {\n foreach ($packages as $package)\n {\n $installed[] = $this->environment->getRegistry()->getPackage(isset($package['package']) ? $package['package'] : $package['name'], $channel);\n }\n }\n\n return $installed;\n }", "public function list_plugins($plugin = null) {\n\t\tApp::uses('CroogoPlugin','Extensions.Lib');\n\t\t$all = $this->params['all'];\n\t\t$plugins = $plugin == null ? App::objects('plugins') : array($plugin);\n\t\t$loaded = CakePlugin::loaded();\n\t\t$CroogoPlugin = new CroogoPlugin();\n\t\t$this->out(__('Plugins:'), 2);\n\t\t$this->out(__('%-20s%-50s%s', __('Plugin'), __('Author'), __('Status')));\n\t\t$this->out(str_repeat('-', 80));\n\t\tforeach ($plugins as $plugin) {\n\t\t\t$status = '<info>inactive</info>';\n\t\t\tif ($active = in_array($plugin, $loaded)) {\n\t\t\t\t$status = '<success>active</success>';\n\t\t\t}\n\t\t\tif (!$active && !$all) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data = $CroogoPlugin->getPluginData($plugin);\n\t\t\t$author = isset($data['author']) ? $data['author'] : '';\n\t\t\t$this->out(__('%-20s%-50s%s', $plugin, $author, $status));\n\t\t}\n\t}", "function listPlugins( ) {\n\t\t$list = array();\n\n\t\t$pathname = $GLOBALS['mosConfig_absolute_path'].'/administrator/components/com_joomap/plugins/';\n\t\tif ( is_dir($pathname) ) {\n\t\t\t$dir_handle = opendir($pathname);\n\t\t\tif( $dir_handle ) {\n\t\t\t\twhile (($filename = readdir($dir_handle)) !== false) {\n\t\t\t\t\tif( substr( $filename, -11 ) == '.plugin.php' ) {\n\t\t\t\t\t\t$list[] = $filename;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dir_handle);\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "protected function get_installed_plugins() {\n\t\t$plugins = array();\n\n\t\t$plugin_info = get_site_transient( 'update_plugins' );\n\t\tif ( isset( $plugin_info->no_update ) ) {\n\t\t\tforeach ( $plugin_info->no_update as $plugin ) {\n\t\t\t\t$plugin->upgrade = false;\n\t\t\t\t$plugins[ $plugin->slug ] = $plugin;\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $plugin_info->response ) ) {\n\t\t\tforeach ( $plugin_info->response as $plugin ) {\n\t\t\t\t$plugin->upgrade = true;\n\t\t\t\t$plugins[ $plugin->slug ] = $plugin;\n\t\t\t}\n\t\t}\n\n\t\treturn $plugins;\n\t}", "public function get_plugins( $refresh = false ) {\n\t\t$args = array(\n\t\t\t'tab' => esc_attr( $this->browser_args['default_tab'] ),\n\t\t\t'page' => 1,\n\t\t);\n\t\t$args = array_merge( $args, $this->browser_args );\n\n\t\t$list = new BC_Framework_Plugin_Browser_List( $this->page_slug, null, $args );\n\n\t\treturn $list->items;\n\t}", "public function getPluginArray()\n {\n if( $this->getService()->isRest() )\n return $this->getProperty()->plugins;\n return NULL;\n }", "public function get_unfiltered_plugin_list() {\n\t\t$this->override_active = false;\n\t\t$all_plugins = get_option( 'active_plugins' );\n\t\t$this->override_active = true;\n\n\t\treturn $all_plugins;\n\t}", "protected function getInstalledPlugins()\n\t{\n\t\tif(!class_exists('Zend_Registry'))\n\t\t{\n\t\t\tthrow new Exception(\"Not possible to list installed plugins (case LogStats module)\");\n\t\t}\n\t\tif(!is_null(Zend_Registry::get('config')->PluginsInstalled->PluginsInstalled))\n\t\t{\n\t\t\treturn Zend_Registry::get('config')->PluginsInstalled->PluginsInstalled->toArray();\n\t\t}\n\t\telseif(is_array(Zend_Registry::get('config')->PluginsInstalled))\n\t\t{\n\t\t\treturn Zend_Registry::get('config')->PluginsInstalled;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Zend_Registry::get('config')->PluginsInstalled->toArray();\n\t\t}\n\t}", "function wpc_installed_plugins(): array\n {\n $plugins = get_plugins();\n\n $plugin_slugs = [];\n\n foreach ( $plugins as $key => $plugin ) {\n $slug = explode( '/', $key );\n\n $plugin_slugs[] = '\"wpackagist-plugin/' . $slug[0] . '\": \"*\",';\n // Add the slug to the array\n }\n\n return $plugin_slugs;\n }", "public function plugins(){\r\n\t\t//first check for permission\r\n\t\tif($this->users->is_logedin() && $this->users->has_permission('administrator_admin_panel')\t){\r\n\t\t\treturn $this->module_plugins();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//access denied\r\n\t\t\treturn $this->module_no_permission();\r\n\t\t}\r\n\t\t\r\n\t}", "public function get_shared_plugins() {\n\t\treturn get_plugins( self::SHARED_PLUGINS_RELATIVE_PATH );\n\t}", "public function initAllPlugins()\n {\n $this->collAllPlugins = new ObjectCollection();\n $this->collAllPluginsPartial = true;\n\n $this->collAllPlugins->setModel('\\Plugins');\n }", "function get_plugins($plugin_folder = '')\n {\n }", "public static function getStudiorumPlugins()\n\t\t{\n\n\t\t\tif( !function_exists( 'get_plugins' ) ){\n\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t\t}\n\n\t\t\t// Returns a list of all available plugins\n\t\t\t$allPlugins = get_plugins();\n\n\t\t\tif( !$allPlugins || !is_array( $allPlugins ) || empty( $allPlugins ) ){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$output = array();\n\n\t\t\tforeach( $allPlugins as $pathAndSlug => $pluginData )\n\t\t\t{\n\t\t\t\n\t\t\t\t$splitPathAndSlug = explode( '/', $pathAndSlug );\n\n\t\t\t\t// Search for 'studiorum' in the folder name\n\t\t\t\t$folderName = strtolower( $splitPathAndSlug[0] );\n\n\t\t\t\t$searchFor = 'studiorum';\n\n\t\t\t\t$pos = strpos( $folderName, $searchFor );\n\n\t\t\t\tif( $pos === false ){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$output[$folderName] = $pluginData;\n\n\t\t\t}\n\n\t\t\treturn $output;\n\n\t\t}", "public function search_plugins() {\n\n\t\trequire_once( ABSPATH . \"wp-admin\" . '/includes/plugin-install.php' );\n\n $request = array(\n 'per_page' => 24,\n 'search' => $_POST['search'],\n 'fields' => $this->get_api_fields()\n );\n\n $results = plugins_api( 'query_plugins', $request );\n\t\t$data = array();\n\t\t$plugins = array();\n\n foreach( $results->plugins as $plugin ) {\n\t\t\t$plugins[] = $this->prepare_data( $plugin );\n\t\t}\n\t\t\n\t\t$data['info'] = $results->info;\n\t\t$data['plugins'] = $plugins;\n\n echo json_encode($data);\n\n die();\n }", "public static function getPlugins()\n {\n\n $plugins = array();\n\n $pluginsdir = opendir('modules/Scribite/plugins/TinyMCE/vendor/tiny_mce/plugins');\n while (false !== ($f = readdir($pluginsdir))) {\n if ($f != '.' && $f != '..' && $f != 'CVS' && $f != '_template' && !preg_match('/[.]/', $f)) {\n $plugins[] = array(\n 'text' => $f,\n 'value' => $f\n );\n }\n }\n closedir($pluginsdir);\n asort($plugins);\n\n return $plugins;\n }", "public function getPlugins($enabledOnly = true)\n\t{\n\t\tif ($enabledOnly)\n\t\t{\n\t\t\treturn $this->_enabledPlugins;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!isset($this->_allPlugins))\n\t\t\t{\n\t\t\t\t$this->_allPlugins = array();\n\n\t\t\t\t// Find all of the plugins in the plugins folder\n\t\t\t\t$pluginsPath = craft()->path->getPluginsPath();\n\t\t\t\t$pluginFolderContents = IOHelper::getFolderContents($pluginsPath, false);\n\n\t\t\t\tif ($pluginFolderContents)\n\t\t\t\t{\n\t\t\t\t\tforeach ($pluginFolderContents as $pluginFolderContent)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Make sure it's actually a folder.\n\t\t\t\t\t\tif (IOHelper::folderExists($pluginFolderContent))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$pluginFolderContent = IOHelper::normalizePathSeparators($pluginFolderContent);\n\t\t\t\t\t\t\t$pluginFolderName = mb_strtolower(IOHelper::getFolderName($pluginFolderContent, false));\n\t\t\t\t\t\t\t$pluginFilePath = IOHelper::getFolderContents($pluginFolderContent, false, \".*Plugin\\.php\");\n\n\t\t\t\t\t\t\tif (is_array($pluginFilePath) && count($pluginFilePath) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pluginFileName = IOHelper::getFileName($pluginFilePath[0], false);\n\n\t\t\t\t\t\t\t\t// Chop off the \"Plugin\" suffix\n\t\t\t\t\t\t\t\t$handle = mb_substr($pluginFileName, 0, mb_strlen($pluginFileName) - 6);\n\t\t\t\t\t\t\t\t$lcHandle = mb_strtolower($handle);\n\n\t\t\t\t\t\t\t\t// Validate that the lowercase plugin class handle is the same as the folder name\n\t\t\t\t\t\t\t\t// and that we haven't already loaded a plugin with the same handle but different casing\n\t\t\t\t\t\t\t\tif ($lcHandle === $pluginFolderName && !isset($this->_allPlugins[$lcHandle]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$plugin = $this->getPlugin($handle, false);\n\n\t\t\t\t\t\t\t\t\tif ($plugin)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$this->_allPlugins[$lcHandle] = $plugin;\n\t\t\t\t\t\t\t\t\t\t$names[] = $plugin->getName();\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\n\t\t\t\t\tif (!empty($names))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Sort plugins by name\n\t\t\t\t\t\t$this->_sortPlugins($names, $this->_allPlugins);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this->_allPlugins;\n\t\t}\n\t}", "protected function get_installed_plugin_slugs()\n {\n }", "static function getPlugins( $folder='Tienda' )\r\n\t{\r\n\t\t$database = JFactory::getDBO();\r\n\t\t\r\n\t\t$order_query = \" ORDER BY ordering ASC \";\r\n\t\t$folder = strtolower( $folder );\r\n\t\t\r\n if(version_compare(JVERSION,'1.6.0','ge')) {\r\n\t // Joomla! 1.6+ code here\r\n\t $query = \"\r\n\t\t\tSELECT \r\n\t\t\t\t* \r\n\t\t\tFROM \r\n\t\t\t\t#__extensions \r\n\t\t\tWHERE enabled = '1'\r\n\t\t\tAND \r\n\t\t\t\tLOWER(`folder`) = '{$folder}'\r\n\t\t\r\n\t\t\";\r\n\t } else {\r\n\t // Joomla! 1.5 code here\r\n\t $query = \"\r\n\t\t\tSELECT \r\n\t\t\t\t* \r\n\t\t\tFROM \r\n\t\t\t\t#__plugins \r\n\t\t\tWHERE published = '1'\r\n\t\t\tAND \r\n\t\t\t\tLOWER(`folder`) = '{$folder}'\r\n\t\t\t{$order_query}\r\n\t\t\";\r\n\t\t}\t\t\r\n\r\n\t\t$database->setQuery( $query );\r\n\t\t$data = $database->loadObjectList();\r\n\t\treturn $data;\r\n\t}", "function wpcom_vip_get_loaded_plugins() {\n\tglobal $vip_loaded_plugins;\n\n\tif ( ! isset( $vip_loaded_plugins ) )\n\t\t$vip_loaded_plugins = array();\n\n\treturn $vip_loaded_plugins;\n}", "private function get_wpforms_plugins() {\n\n\t\tif ( ! empty( $this->plugins ) ) {\n\t\t\treturn $this->plugins;\n\t\t}\n\n\t\t$plugins = get_option( 'active_plugins', [] );\n\n\t\tforeach ( $plugins as $key => $plugin_file ) {\n\t\t\t$slug = dirname( $plugin_file );\n\n\t\t\tif ( ! $this->is_wpforms_plugin( $slug ) ) {\n\t\t\t\tunset( $plugins[ $key ] );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$plugins[ $key ] = $slug;\n\t\t}\n\n\t\t$this->plugins = $plugins;\n\n\t\treturn $this->plugins;\n\t}", "public function index()\n {\n return Plugin::where(['is_deleted' => 0])->get();\n }", "public function getAllPluginsPath()\n {\n if ($this->_allPluginsPath === null) {\n $this->_allPluginsPath = array_map(function ($path) {\n return rtrim($path, '/\\\\').DIRECTORY_SEPARATOR;\n }, $this->_pluginsDirPath);\n\n foreach ($this->getAllModulesPath() as $name => $path) {\n $p = $path.'plugins'.DIRECTORY_SEPARATOR;\n if (file_exists($p) &&\n is_dir($p) &&\n !in_array($p, $this->_allPluginsPath)) {\n $this->_allPluginsPath[] = $p;\n }\n }\n\n $bundled = realpath(__DIR__.'/../../jelix-legacy/plugins/').DIRECTORY_SEPARATOR;\n if (file_exists($bundled) && !in_array($p, $this->_allPluginsPath)) {\n array_unshift($this->_allPluginsPath, $bundled);\n }\n }\n\n return $this->_allPluginsPath;\n }", "public function getLoadedPlugins()\n\t{\n\t\treturn $this->loadedPlugins;\n\t}", "public function get_plugins( $plugin_folder = '' ) {\n\t\treturn $this->tgmpa->get_plugins( $plugin_folder );\n\t}", "private function get_active_plugins() {\n\t\t$plugins = get_plugins();\n\t\t$active = get_option( 'active_plugins' );\n\t\t$active_list = array();\n\t\tforeach ( $active as $slug ):\n\t\t\tif ( isset( $plugins[ $slug ] ) ) {\n\t\t\t\t$active_list[] = $plugins[ $slug ];\n\t\t\t}\n\t\tendforeach;\n\n\t\treturn $active_list;\n\t}", "function load_plugins() {\n\tglobal $root;\n\t$plugins = get_option('active_plugins');\n\n\tif (! $plugins) {\n\t\t$plugins = array();\n\t}\n\tforeach ($plugins as $key => $path) {\n\t\tif (file_exists($root.$path)) {\n\t\t\trequire $root.$path;\n\t\t}\n\t}\n}", "function getAllUsedServices()\n {\n $ret = array();\n foreach ($this->plugins as $name => $obj) {\n if ($obj->is_account) {\n if (isset($obj->DisplayName)) {\n $ret[$name] = $obj->DisplayName;\n } else {\n $ret[$name] = $name;\n }\n }\n }\n return $ret;\n }", "public function getActivePluginsList()\n\t{\n\t\techo \"Active plugins:\\n\";\n\t\tforeach (get_plugins() as $plugin_name => $plugin_details)\n\t\t{\n\t\t\tif (is_plugin_active($plugin_name) === true)\n\t\t\t{\n\t\t\t\tforeach ($plugin_details as $details_key => $details_value)\n\t\t\t\t{\n\t\t\t\t\tif (in_array($details_key, array('Name', 'Version', 'PluginURI')))\n\t\t\t\t\t{\n\t\t\t\t\t\techo $details_key . \" : \" . $details_value . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo \"Path : \" . $plugin_name . \"\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function plugins()\n {\n $plugins = Plugin::with('functions.categories', 'categories')->get();\n #$plugins_tmp = clone $plugins;\n\n #inject \"Plugins\" from Collection category\n foreach($plugins as $plugin) {\n #return $plugin;\n if($plugin->is_collection) {\n\n foreach($plugin->functions as $func) {\n #$p = clone $plugin;\n\n # TODO refactor ugly code, check why new Plugin() triggers extra db queries.\n $arr = array();\n $arr['functions'] = array();\n $arr['categories'] = array();\n $p = json_decode(json_encode($arr));\n\n $p->name = $func->name;\n $p->categories_id = $func->categories_id;\n $p->categories['name'] = '';#$func->categories['name'];\n $p->description = $func['description'];\n $p->type = $plugin['type'];\n $p->identifier = $plugin['identifier'];\n $p->namespace = $plugin['namespace'];\n $p->gpusupport = $plugin['gpusupport'];\n $p->vs_included = $plugin['vs_included'];\n $p->version_published = $plugin->version_published;\n $p->shortalias = $plugin['shortalias'];\n $p->url_github = $plugin['url_github'];\n $p->url_doom9 = $plugin['url_doom9'];\n $p->url_website = $plugin['url_website'];\n $p->url_avswiki = $plugin['url_avswiki'];\n\n if($p->name == $func->name) { # the new *fake* plugin needs only its own plugin-function\n $p->functions[] = $func;\n }\n $p->releases = $plugin['releases'];\n $p->dependencies = $plugin['dependencies'];\n #print_r($p); die;\n $plugins[] = $p;\n\n } #return $plugins_tmp; die;\n }\n\n }\n #echo \"<pre>\";print_r($plugins); die;\n #return $plugins;\n\t\treturn view('plugins.plugins', compact('plugins'));\n }", "static private function loadPlugins() {\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"plugin-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"plugin-folder\"] . \"/\" .$entry;\n }\n }\n closedir($handle);\n }\n }", "public static function getAll(){\n\t\treturn self::$components;\n\t}", "private function get_useful_plugins() {\n\t\t$available = get_transient( $this->plugins_cache_key );\n\t\t$hash = get_transient( $this->plugins_cache_hash_key );\n\t\t$current_hash = substr( md5( wp_json_encode( $this->useful_plugins ) ), 0, 5 );\n\n\n\t\tif ( $available !== false && $hash === $current_hash ) {\n\t\t\t$available = json_decode( $available, true );\n\n\t\t\tforeach ( $available as $slug => $args ) {\n\t\t\t\t$available[ $slug ]['cta'] = $this->plugin_helper->get_plugin_state( $slug );\n\t\t\t\t$available[ $slug ]['path'] = $this->plugin_helper->get_plugin_path( $slug );\n\t\t\t\t$available[ $slug ]['activate'] = $this->plugin_helper->get_plugin_action_link( $slug );\n\t\t\t\t$available[ $slug ]['deactivate'] = $this->plugin_helper->get_plugin_action_link( $slug, 'deactivate' );\n\t\t\t}\n\n\t\t\treturn $available;\n\t\t}\n\n\t\t$data = [];\n\t\tforeach ( $this->useful_plugins as $slug ) {\n\t\t\t$current_plugin = $this->plugin_helper->get_plugin_details( $slug );\n\t\t\tif ( $current_plugin instanceof \\WP_Error ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$data[ $slug ] = [\n\t\t\t\t'banner' => $current_plugin->banners['low'],\n\t\t\t\t'name' => html_entity_decode( $current_plugin->name ),\n\t\t\t\t'description' => html_entity_decode( $current_plugin->short_description ),\n\t\t\t\t'version' => $current_plugin->version,\n\t\t\t\t'author' => html_entity_decode( wp_strip_all_tags( $current_plugin->author ) ),\n\t\t\t\t'cta' => $this->plugin_helper->get_plugin_state( $slug ),\n\t\t\t\t'path' => $this->plugin_helper->get_plugin_path( $slug ),\n\t\t\t\t'activate' => $this->plugin_helper->get_plugin_action_link( $slug ),\n\t\t\t\t'deactivate' => $this->plugin_helper->get_plugin_action_link( $slug, 'deactivate' ),\n\t\t\t];\n\t\t}\n\n\t\tset_transient( $this->plugins_cache_hash_key, $current_hash );\n\t\tset_transient( $this->plugins_cache_key, wp_json_encode( $data ) );\n\n\t\treturn $data;\n\t}", "static public function enumerate_plugins() {\n $dir = dirname(__FILE__).'/dimension';\n\n $listoffiles = scandir($dir);\n foreach ($listoffiles as $index => $entry) {\n if ($entry == '.' || $entry == '..' || substr($entry, -4) != '.php' || $entry == 'dimension_interface.php') {\n unset($listoffiles[$index]);\n }\n }\n\n return $listoffiles;\n }", "public function get_plugins_data() {\n return $this->plugins_data;\n }", "private function loadPlugins()\n\t{\n\t\t$plugins = plugin_installed_list();\n\t\t$plugins = collect($plugins)->map(function ($item, $key) {\n\t\t\tif (is_object($item)) {\n\t\t\t\t$item = Arr::fromObject($item);\n\t\t\t}\n\t\t\tif (isset($item['item_id']) && !empty($item['item_id'])) {\n\t\t\t\t$item['installed'] = plugin_check_purchase_code($item);\n\t\t\t}\n\t\t\t\n\t\t\treturn $item;\n\t\t})->toArray();\n\t\t\n\t\tConfig::set('plugins', $plugins);\n\t\tConfig::set('plugins.installed', collect($plugins)->whereStrict('installed', true)->toArray());\n\t}", "function loadPlugins() {\n\t\t$pathname = $GLOBALS['mosConfig_absolute_path'].'/administrator/components/com_joomap/plugins/';\n\t\t$plugins = JoomapPlugins::listPlugins();\n\t\tforeach( $plugins as $plugin ) {\n\t\t\tinclude_once( $pathname.$plugin );\n\t\t}\n\t}", "public static function get_all() {\n global $CFG;\n // Get directory listing (excluding simpletest, CVS, etc)\n $list = get_list_of_plugins('feature', '',\n $CFG->dirroot . '/mod/forumng');\n\n // Create array and put one of each object in it\n $results = array();\n foreach ($list as $name) {\n $results[] = self::get_new($name);\n }\n\n // Sort features into order and return\n usort($results, array('forum_feature', 'compare'));\n return $results;\n }", "public static function parseInstalledPlugins() {\r\n\t\t$obj = new QPluginConfigParser(QPluginInstaller::getMasterConfigFilePath());\t\t\r\n\t\treturn $obj->parseConfig();\r\n\t}", "public function loadPlugins()\n\t{\n\t\tif (!$this->_pluginsLoaded && !$this->_loadingPlugins)\n\t\t{\n\t\t\tif (craft()->isInstalled())\n\t\t\t{\n\t\t\t\t// Prevent this function from getting called twice.\n\t\t\t\t$this->_loadingPlugins = true;\n\n\t\t\t\t// Find all of the enabled plugins\n\t\t\t\t// TODO: swap the SELECT statements after next breakpoint\n\t\t\t\t$rows = craft()->db->createCommand()\n\t\t\t\t\t//->select('id, class, version, schemaVersion, settings, installDate')\n\t\t\t\t\t->select('*')\n\t\t\t\t\t->from('plugins')\n\t\t\t\t\t->where('enabled=1')\n\t\t\t\t\t->queryAll();\n\n\t\t\t\t$names = array();\n\n\t\t\t\tforeach ($rows as $row)\n\t\t\t\t{\n\t\t\t\t\t$plugin = $this->_getPlugin($row['class']);\n\n\t\t\t\t\tif ($plugin)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_autoloadPluginClasses($plugin);\n\n\t\t\t\t\t\t// Clean it up a bit\n\t\t\t\t\t\t$row['settings'] = JsonHelper::decode($row['settings']);\n\t\t\t\t\t\t$row['installDate'] = DateTime::createFromString($row['installDate']);\n\n\t\t\t\t\t\t$this->_enabledPluginInfo[$row['class']] = $row;\n\n\t\t\t\t\t\t$lcPluginHandle = mb_strtolower($plugin->getClassHandle());\n\t\t\t\t\t\t$this->_plugins[$lcPluginHandle] = $plugin;\n\t\t\t\t\t\t$this->_enabledPlugins[$lcPluginHandle] = $plugin;\n\t\t\t\t\t\t$names[] = $plugin->getName();\n\n\t\t\t\t\t\t$plugin->setSettings($row['settings']);\n\n\t\t\t\t\t\t$plugin->isInstalled = true;\n\t\t\t\t\t\t$plugin->isEnabled = true;\n\n\t\t\t\t\t\t// If we're not updating, check if the plugin's version number changed, but not its schema version.\n\t\t\t\t\t\tif (!craft()->isInMaintenanceMode() && $this->hasPluginVersionNumberChanged($plugin) && !$this->doesPluginRequireDatabaseUpdate($plugin))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Update our record of the plugin's version number\n\t\t\t\t\t\t\tcraft()->db->createCommand()->update(\n\t\t\t\t\t\t\t\t'plugins',\n\t\t\t\t\t\t\t\tarray('version' => $plugin->getVersion()),\n\t\t\t\t\t\t\t\t'id = :id',\n\t\t\t\t\t\t\t\tarray(':id' => $row['id'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Sort plugins by name\n\t\t\t\t$this->_sortPlugins($names, $this->_enabledPlugins);\n\n\t\t\t\t// Now that all of the components have been imported, initialize all the plugins\n\t\t\t\tforeach ($this->_enabledPlugins as $plugin)\n\t\t\t\t{\n\t\t\t\t\t$plugin->init();\n\t\t\t\t}\n\n\t\t\t\t$this->_loadingPlugins = false;\n\t\t\t}\n\n\t\t\t$this->_pluginsLoaded = true;\n\n\t\t\t// Fire an 'onLoadPlugins' event\n\t\t\t$this->onLoadPlugins(new Event($this));\n\t\t}\n\t}", "function get_all_plugin_names(array $types) {\n $pluginman = core_plugin_manager::instance();\n $returnarray = array();\n foreach ($types as $type) {\n // Get all plugins of a given type.\n $pluginarray = $pluginman->get_plugins_of_type($type);\n // Plugins will be returned as objects so get the name of each and push it into a new array.\n foreach ($pluginarray as $plugin) {\n array_push($returnarray, $plugin->name);\n }\n }\n return $returnarray;\n}", "private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }", "private function getUserInstalledPlugins()\n {\n $query = $this->container->get('dbal_connection')->createQueryBuilder();\n $query->select(['plugin.name', 'plugin.label', 'plugin.version'])\n ->from('s_core_plugins', 'plugin')\n ->where('plugin.name NOT IN (:names)')\n ->andWhere('plugin.source != :source')\n ->setParameter(':source', 'Default')\n ->setParameter(':names', ['PluginManager', 'StoreApi'], Connection::PARAM_STR_ARRAY);\n\n /** @var \\PDOStatement $statement */\n $statement = $query->execute();\n\n return $statement->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public static function get_all() {\n global $CFG;\n // Get directory listing (excluding simpletest, CVS, etc)\n $list = core_component::get_plugin_list('forumngtype');\n\n $results = array();\n foreach ($list as $name => $location) {\n $results[] = self::get_new(str_replace('forumngtype_', '', $name));\n }\n return $results;\n }", "public function readAll()\r\n {\r\n $plugins_dir = $this->basePath.\"/extern/openInviter/plugins\";\r\n $array_file=array();\r\n \r\n $temp=glob(\"{$plugins_dir}/*.php\");\r\n foreach ($temp as $file) {\r\n// echo 'File: '.$file.' - Check: '.str_replace(\"{$plugins_dir}/\",'',$file).\"\\n\";\r\n\r\n if (($file!=\".\") AND ($file!=\"..\") AND (!isset($this->ignoredFiles[str_replace(\"{$plugins_dir}/\",'',$file)]))) {\r\n $array_file[$file]=$file;\r\n }\r\n }\r\n\r\n return $array_file;\r\n }", "public function getPlugin();", "public function getPlugin();", "function loadPlugins() {\n\n\t\t// load and parse the plugins file\n\t\tif ($plugins = $this->xml_parser->parseXml('plugins.xml')) {\n\t\t\tif (!empty($plugins['XASECO2_PLUGINS']['PLUGIN'])) {\n\t\t\t\t// take each plugin tag\n\t\t\t\tforeach ($plugins['XASECO2_PLUGINS']['PLUGIN'] as $plugin) {\n\t\t\t\t\t// log plugin message\n\t\t\t\t\t$this->console_text('[XAseco2] Load plugin [' . $plugin . ']');\n\t\t\t\t\t// include the plugin\n\t\t\t\t\trequire_once('plugins/' . $plugin);\n\t\t\t\t\t$this->plugins[] = $plugin;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\ttrigger_error('Could not read/parse plugins list plugins.xml !', E_USER_ERROR);\n\t\t}\n\t}", "public function getPluginManager()\n {\n if (! $this->plugins) {\n $this->setPluginManager(new PluginManager(new ServiceManager));\n }\n return $this->plugins;\n }", "function wp_get_active_and_valid_plugins()\n {\n }", "public function init() {\n $this->getBootstrap()->bootstrap('logger'); // make sure that logger exists\n $options = $this->getOptions();\n /** @var $logger Zend_Log */\n $logger = Zend_Registry::get('logger')->ensureStream('system');\n\n $plugins = array();\n\n if (empty($options)) {\n $logger->log(\"DbPlugins not found\", Zend_Log::DEBUG);\n } else {\n foreach($options as $alias => $className) {\n $message = \"Load \\\"$alias\\\" from \\\"$className\\\"... \";\n if (class_exists($className)) {\n $logger->log($message . \"done\", Zend_Log::DEBUG);\n $plugins[$alias] = $className;\n } else {\n $logger->log($message . \"failed\", Zend_Log::ERR);\n }\n\n }\n }\n Zend_Registry::set(self::REGISTRY_ALIAS, $plugins);\n return $plugins;\n }" ]
[ "0.8409967", "0.8120879", "0.7948986", "0.79063874", "0.7899298", "0.78108704", "0.77326596", "0.7716178", "0.7707845", "0.7696413", "0.76845837", "0.76785946", "0.76785946", "0.7652743", "0.76153463", "0.75304776", "0.7460938", "0.7436911", "0.74078614", "0.7407826", "0.74022967", "0.7394515", "0.72860414", "0.72771096", "0.72229403", "0.7217864", "0.72027147", "0.7182341", "0.71730614", "0.7168528", "0.71568704", "0.7121769", "0.7104418", "0.70955515", "0.70915383", "0.7065973", "0.7062497", "0.70284885", "0.70235294", "0.7008748", "0.69761837", "0.69667715", "0.6942417", "0.69366866", "0.69130576", "0.6881412", "0.68599004", "0.6834966", "0.6831238", "0.68288624", "0.68261784", "0.68191427", "0.68185085", "0.6802615", "0.6796203", "0.6783469", "0.67827904", "0.67698663", "0.67693406", "0.6764362", "0.67574817", "0.6757296", "0.67152196", "0.6704754", "0.67028826", "0.6702645", "0.6678974", "0.6669898", "0.6666869", "0.6642743", "0.6629438", "0.66150236", "0.65996903", "0.6592621", "0.6587496", "0.6586014", "0.65850747", "0.6582981", "0.65796417", "0.65607744", "0.6557706", "0.65387756", "0.6528554", "0.65276796", "0.6526863", "0.65035725", "0.6503183", "0.65012777", "0.648651", "0.6474382", "0.6467085", "0.64612263", "0.6437443", "0.6435169", "0.64170444", "0.64170444", "0.64156455", "0.6412319", "0.6386475", "0.638175" ]
0.7445229
17
/ Get all Themes
private function themes() { $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes; return $all_plugins; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_themes()\n {\n }", "public function getAllThemes();", "public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }", "public function all()\r\n {\r\n return $this->themes;\r\n }", "public function themes()\n {\n return R::findAll('theme', 'order by name');\n }", "public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}", "function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}", "function get_theme_mods()\n {\n }", "public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }", "function okcdesign_theme() {\n $themes = array();\n theme_plugins_invoke(__FUNCTION__, $themes);\n return $themes;\n}", "function get_site_allowed_themes()\n {\n }", "public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }", "function get_allowed_themes()\n {\n }", "function website_themes() {\n\n\t$websites = get_website_data();\n\n\t$themes = array();\n\n\tforeach ( $websites as $site ) {\n\t\t$themes[] = $site[ 'theme' ];\n\t}\n\n\treturn array_unique( $themes );\n\n}", "public function get_meta_themes() {\n\t\tSingleton::get_instance( 'Theme', $this )->get_remote_theme_meta();\n\t}", "public function getTheme();", "function thrive_dashboard_get_all_themes()\n{\n $themes = thrive_dashboard_get_thrive_products('theme');\n $current_theme = wp_get_theme();\n\n foreach ($themes as $key => $theme) {\n\n if ($current_theme->name == $theme->name) {\n unset($themes[$key]);\n continue;\n }\n\n $local_theme = wp_get_theme($theme->tag);\n if ($local_theme->exists()) {\n $theme->installed = true;\n } else {\n $theme->installed = false;\n }\n }\n\n return $themes;\n}", "public function getThemes()\n {\n return $this->themes;\n }", "public function get_themes_list()\n {\n $baseUrl = 'http://prismjs.com/index.html?theme=';\n\n return [\n 1 => ['name' => 'Default', 'url' => $baseUrl . 'prism', 'file' => 'prism'],\n 2 => ['name' => 'Coy', 'url' => $baseUrl . 'prism-coy', 'file' => 'prism-coy'],\n 3 => ['name' => 'Dark', 'url' => $baseUrl . 'prism-dark', 'file' => 'prism-dark'],\n 4 => ['name' => 'Okaidia', 'url' => $baseUrl . 'prism-okaidia', 'file' => 'prism-okaidia'],\n 5 => ['name' => 'Tomorrow', 'url' => $baseUrl . 'prism-tomorrow', 'file' => 'prism-tomorrow'],\n 6 => ['name' => 'Twilight', 'url' => $baseUrl . 'prism-twilight', 'file' => 'prism-twilight'],\n ];\n }", "public static function all(): array\n {\n $it = new DirectoryIterator(plugins_path('/summer/login/skins'));\n $it->rewind();\n $result = [];\n foreach ($it as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $theme = static::load($fileinfo->getFilename());\n $result[] = $theme;\n }\n return $result;\n }", "public static function getThemes() {\r\n\t\t$themes = array();\r\n\r\n\t\t// Special files to ignore\r\n\t\t$ignore = array('admin.css');\r\n\r\n\t\t// Get themes corresponding to .css files.\r\n\t\t$dir = dirname(__FILE__) . '/css';\r\n\t\tif ($handle = opendir($dir)) {\r\n\t\t while (false !== ($entry = readdir($handle))) {\r\n\t\t\t if (in_array($entry, $ignore)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t $file = $dir . '/' . $entry;\r\n\t\t\t if (!is_file($file)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t // Beautify name\r\n\t\t\t $name = substr($entry, 0, -4); // Remove \".css\"\r\n\t\t\t $name = str_replace('--', ', ', $name);\r\n\t\t\t $name = str_replace('-', ' ', $name);\r\n\t\t\t\t$name = ucwords($name);\r\n\r\n\t\t\t // Add theme\r\n\t $themes[$entry] = $name;\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t}\r\n\r\n\t\t$themes['none'] = 'None';\r\n\r\n\t\t// Sort alphabetically\r\n\t\tasort($themes);\r\n\r\n\t\treturn $themes;\r\n\t}", "public function getAvailableThemes()\n\t{\n\t\t$this->loadAvailableThemes();\n\t\treturn self::$_themes;\n\t}", "public function get_lightbox_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_lightbox_themes();\n\n }", "public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }", "function getThemes() {\n\n\t$themesPath = '../../content/themes';\n\n\t$list = scandir($themesPath);\n\t$baseUrl = \\Raindrop\\Core\\Config\\Config::item('baseUrl');\n\t$themes = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $dir) {\n\t\t\t$pathThemeDir = $themesPath . '/' . $dir;\n\t\t\t$pathConfig = $pathThemeDir . '/theme.json';\n\t\t\t$pathScreen = $baseUrl . '/content/themes/' . $dir . '/screen.jpg';\n\n\t\t\tif(is_dir($pathThemeDir) and is_file($pathConfig)) {\n\t\t\t\t$config = file_get_contents($pathConfig);\n\t\t\t\t$info = json_decode($config);\n\n\t\t\t\t$info->screen = $pathScreen;\n\t\t\t\t$info->dirTheme = $dir;\n\n\t\t\t\t$themes[] = $info;\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $themes;\n}", "public static function getAllThemes()\n {\n $themes = [];\n\n foreach (scandir(self::$themeRoot) as $dir) {\n if (self::isTheme($dir)){\n $themeConfig = self::$themeRoot . $dir . '/theme.json';\n $json = file_get_contents($themeConfig);\n $decoded = json_decode($json, true);\n\n $themes[] = $decoded['name'];\n }\n\n }\n\n return $themes;\n }", "function find_all_themes($full_details = false)\n{\n if ($GLOBALS['IN_MINIKERNEL_VERSION']) {\n return $full_details ? array('default' => array()) : array('default' => do_lang('DEFAULT'));\n }\n\n require_code('files');\n\n $themes = array();\n $_dir = @opendir(get_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n if (get_custom_file_base() != get_file_base()) {\n $_dir = @opendir(get_custom_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_custom_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_custom_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n }\n if (!array_key_exists('default', $themes)) {\n $details = better_parse_ini_file(get_file_base() . '/themes/default/theme.ini');\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes['default'] = $full_details ? $details : $details['title'];\n }\n\n // Sort\n if ($full_details) {\n sort_maps_by($themes, 'title');\n } else {\n natsort($themes);\n }\n\n // Default theme should go first\n if (isset($themes['default'])) {\n $temp = $themes['default'];\n $temp_2 = $themes;\n $themes = array('default' => $temp) + $temp_2;\n }\n\n // Admin theme should go last\n if (isset($themes['admin'])) {\n $temp = $themes['admin'];\n unset($themes['admin']);\n $themes['admin'] = $temp;\n }\n\n return $themes;\n}", "function display_themes()\n {\n }", "public function get_gallery_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_gallery_themes();\n\n }", "private function getThemes() {\n $path = sprintf('%s/../../%s/%s/', __DIR__, PUBLIC_PATH, THEME_PATH);\n\n $themes = scandir($path);\n\n $output = [];\n foreach($themes as $theme) {\n // Check if the theme has an info.php file a && file_exists($path.$theme.'/icon.png)nd a thumbnail\n if(file_exists($path.$theme.'/info.php') && file_exists($path.$theme.'/icon.png')) {\n // Store the theme information\n require($path.$theme.'/info.php');\n $output[$theme]['name'] = $name;\n $output[$theme]['author'] = $author;\n $output[$theme]['url'] = $url;\n $output[$theme]['version'] = $version;\n $output[$theme]['path'] = $theme;\n }\n }\n\n return $output;\n }", "function getThemes(){\n\t$result = array();\n\t\n\t$handle = @opendir(ROOT_PATH . 'themes');\n\t\n\twhile (false !== ($f = readdir($handle))){\n\t\tif ($f != \".\" && $f != \"..\" && $f != \"CVS\" && $f != \"index.html\" && !preg_match(\"`[.]`\", $f)){\n\t\t\tif( is_file(ROOT_PATH . 'themes' . DS . $f . DS . 'layout.tpl') ){\n\t\t\t\t$result[] = $f;\n\t\t\t}\n }\n\t}\n closedir($handle);\n\n return $result;\n}", "public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }", "function scs_get_themes()\n\t {\n\t \tglobal $scs_themes;\n\t\t$scs_themes = array();\n\t\t\n\t \t$dir = dirname(__FILE__).'/'.SCS_THEMES_DIR.'/';\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\" && !is_file($file) && file_exists($dir.$file.'/index.php') ) {\n\t\t\t\t\t$scs_themes[] = ucfirst($file);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t }", "function get_themes()\n\t{\n\t\t$handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']);\n\t\t$themelist = array();\n\t\twhile ($file = readdir($handle))\n\t\t{\n\t\t\tif (is_dir($this->e107->e107_dirs['THEMES_DIRECTORY'].$file) && $file !='_blank')\n\t\t\t{\n\t\t\t\tif(is_readable(\"./{$this->e107->e107_dirs['THEMES_DIRECTORY']}{$file}/theme.xml\"))\n\t\t\t\t{\n\t\t\t\t\t$themelist[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $themelist;\n\t}", "function wp_get_active_and_valid_themes()\n {\n }", "public function get_available_themes() {\n\t\treturn apply_filters( 'crocoblock-wizard/install-theme/available-themes', array(\n\t\t\t'kava' => array(\n\t\t\t\t'source' => 'crocoblock',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/kava.png',\n\t\t\t),\n\t\t\t'blocksy' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/blocksy.png',\n\t\t\t),\n\t\t\t'oceanwp' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/ocean.png',\n\t\t\t),\n\t\t\t'astra' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/astra.png',\n\t\t\t),\n\t\t\t'generatepress' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/generatepress.png',\n\t\t\t),\n\t\t\t'hello-elementor' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/hello.png',\n\t\t\t),\n\t\t) );\n\t}", "function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}", "public static function getThemes()\n {\n $themes = array();\n $themesdir = opendir('modules/Scribite/plugins/TinyMCE/vendor/tiny_mce/themes');\n while (false !== ($f = readdir($themesdir))) {\n if ($f != '.' && $f != '..' && $f != 'CVS' && !preg_match('/[.]/', $f)) {\n $themes[] = array(\n 'text' => $f,\n 'value' => $f\n );\n }\n }\n\n closedir($themesdir);\n // sort array\n asort($themes);\n\n return $themes;\n }", "public function get_themes() {\n\t\t$recaptcha_themes = array(\n\t\t\t'light' => _x( 'Light', 'recaptcha theme', 'theme-my-login' ),\n\t\t\t'dark' => _x( 'Dark', 'recaptcha theme', 'theme-my-login' )\n\t\t);\n\t\treturn apply_filters( 'theme_my_login_recaptcha_themes', $recaptcha_themes );\n\t}", "function ac_skin_get_theme_skin_items(){\n $settings = &drupal_static(__FUNCTION__, null);\n if (!isset($settings)) {\n\tacquia_include('theme');\n\t$settings = acquia_theme_discovery('skin', variable_get('ACQUIA_BASE_THEME'), 'skin_info');\n }\n return $settings;\n}", "public function getList()\r\n {\r\n $themes = [];\r\n\r\n $q = $this->_db->query('SELECT id, title, description, thumbnail FROM theme');\r\n\r\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\r\n {\r\n $themes[] = new themeClass($donnees);\r\n }\r\n\r\n return $themes;\r\n }", "public function get_themes()\n\t{\n\t\t// load the helper file\n\t\t$this->load->helper('file');\n\n\t\t// get the list of 'folders' which\n\t\t// just means we're getting a potential\n\t\t// list of new themes that's been installed\n\t\t// since we last looked at themes\n\t\t$folders = get_dir_file_info(APPPATH . 'themes/');\n\n\t\t// foreach of those folders, we're loading the class\n\t\t// from the theme_details.php file, then we pass it\n\t\t// off to the save_theme() function to deal with \n\t\t// duplicates and insert newly added themes.\n\t\tforeach ($folders as &$folder)\n\t\t{\n\t\t\t// spawn that theme class...\n\t\t\t$details = $this->spawn_class($folder['relative_path'], $folder['name']);\n\n\t\t\t// if spawn_class was a success\n\t\t\t// we'll see if it needs saving\n\t\t\tif ($details)\n\t\t\t{\n\t\t\t\t// because this pwnd me for 30 minutes\n\t\t\t\t$details->path = $folder['name'];\n\t\t\t\n\t\t\t\t// save it...\n\t\t\t\t$this->save_theme($details);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// now that we've updated everything, let's\n\t\t// give the end user something to look at.\n\t\treturn $this->db->get($this->_table['templates'])->result();\n\t}", "function opanda_sr_get_theme_styles(){\n require_once OPANDA_SR_PLUGIN_DIR. '/includes/style-manager.class.php'; \n \n $themeId = isset( $_POST['onp_theme_id'] ) ? $_POST['onp_theme_id'] : null;\n \n if( !$themeId ) {\n json_encode( array('error' => '[Error] The theme id [onp_theme_id] is not specified.') );\n exit;\n }\n \n $styles = OnpSL_StyleManager::getStylesTitles( $themeId );\n\n echo json_encode( $styles );\n exit;\n}", "public static function get_themes() {\n\t\t$themes = get_transient( self::THEMES_TRANSIENT );\n\t\tif ( false === $themes ) {\n\t\t\t$theme_data = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search?category=themes' );\n\t\t\t$themes = array();\n\n\t\t\tif ( ! is_wp_error( $theme_data ) ) {\n\t\t\t\t$theme_data = json_decode( $theme_data['body'] );\n\t\t\t\t$woo_themes = property_exists( $theme_data, 'products' ) ? $theme_data->products : array();\n\t\t\t\t$sorted_themes = self::sort_woocommerce_themes( $woo_themes );\n\n\t\t\t\tforeach ( $sorted_themes as $theme ) {\n\t\t\t\t\t$slug = sanitize_title_with_dashes( $theme->slug );\n\t\t\t\t\t$themes[ $slug ] = (array) $theme;\n\t\t\t\t\t$themes[ $slug ]['is_installed'] = false;\n\t\t\t\t\t$themes[ $slug ]['has_woocommerce_support'] = true;\n\t\t\t\t\t$themes[ $slug ]['slug'] = $slug;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$installed_themes = wp_get_themes();\n\t\t\t$active_theme = get_option( 'stylesheet' );\n\n\t\t\tforeach ( $installed_themes as $slug => $theme ) {\n\t\t\t\t$theme_data = self::get_theme_data( $theme );\n\t\t\t\t$installed_themes = wp_get_themes();\n\t\t\t\t$themes[ $slug ] = $theme_data;\n\t\t\t}\n\n\t\t\t// Add the WooCommerce support tag for default themes that don't explicitly declare support.\n\t\t\tif ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) {\n\t\t\t\t$themes[ $active_theme ]['has_woocommerce_support'] = true;\n\t\t\t}\n\n\t\t\t$themes = array( $active_theme => $themes[ $active_theme ] ) + $themes;\n\n\t\t\tset_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );\n\t\t}\n\n\t\t$themes = apply_filters( 'woocommerce_admin_onboarding_themes', $themes );\n\t\treturn array_values( $themes );\n\t}", "function get_broken_themes()\n {\n }", "public function getThemes() {\n if ($this->themes !== null) {\n return $this->themes;\n }\n\n $this->themes = parent::getThemes();\n\n $themes = $this->config->get('theme');\n if (!is_array($themes)) {\n return $this->themes;\n }\n\n foreach ($themes as $name => $theme) {\n if (isset($theme['name'])) {\n $displayName = $theme['name'];\n } else {\n $displayName = $name;\n }\n\n if (isset($theme['engine'])) {\n if (is_array($theme['engine'])) {\n $engines = $theme['engine'];\n } else {\n $engines = array($theme['engine']);\n }\n } else {\n $engines = array();\n }\n\n if (isset($theme['region'])) {\n $regions = $theme['region'];\n } else {\n $regions = array();\n }\n\n if (isset($theme['parent'])) {\n $parent = $theme['parent'];\n } else {\n $parent = null;\n }\n\n $this->themes[$name] = new GenericTheme($name, $displayName, $engines, $regions, $parent);\n }\n\n return $this->themes;\n }", "public static function getAllAdminThemes()\n {\n /**\n * Create an array of themes, with the directory paths\n * theme.ini files and images paths if they are present\n */\n $themes = array();\n $iterator = new VersionedDirectoryIterator(ADMIN_THEME_DIR);\n $themeDirs = $iterator->getValid();\n foreach ($themeDirs as $themeName) {\n $theme = self::getTheme($themeName);\n $theme->path = ADMIN_THEME_DIR . '/' . $themeName;\n $theme->setImage(self::THEME_IMAGE_FILE_NAME);\n $theme->setIni(self::THEME_INI_FILE_NAME);\n $theme->setConfig(self::THEME_CONFIG_FILE_NAME);\n $themes[$themeName] = $theme;\n }\n ksort($themes);\n return $themes;\n }", "function return_back_std_themes_settings() {\r\n\r\n\t$get_all_themes = wp_get_themes();\r\n\r\n\t$root_plugin_path = get_theme_root();\r\n\t$root_plugin_path = str_replace( 'plugins/yoga-poses/templates/', '', $root_plugin_path );\r\n\t$root_plugin_path .= 'themes/';\r\n\r\n\tregister_theme_directory( $root_plugin_path );\r\n\r\n\t// activate first theme in list\r\n\tforeach ( $get_all_themes as $key => $one_theme ) {\r\n\t\tswitch_theme( $key );\r\n\t\tbreak;\r\n\t}\r\n\r\n\treturn $root_plugin_path;\r\n}", "private function getStylesheets() {\n $themes = [];\n $stylesheet_options = [];\n $theme_handler = Drupal::service('theme_handler');\n\n foreach ($theme_handler->listInfo() as $name => $theme) {\n $themes = $theme_handler->listInfo();\n $names = $themes[$name]->info['name'];\n $path = DRUPAL_ROOT . '/' . $theme\n ->getPath();\n $stylesheete = $path . '/css/' . $name . '.' . 'ckeditor.css';\n $default_stylesheet = drupal_get_path('module', 'ckeditor_stylesheetparser') . '/js/plugins/stylesheetparser/samples/assets/sample.css';\n\n if (file_exists($stylesheete)) {\n $stylesheet_options = [$stylesheete => $names];\n } elseif (!file_exists($stylesheete)) {\n $stylesheet_options = [$default_stylesheet => $names];\n }\n return $stylesheet_options ;\n }\n }", "function _wprp_get_themes() {\n\n\trequire_once( ABSPATH . '/wp-admin/includes/theme.php' );\n\n\t_wpr_add_non_extend_theme_support_filter();\n\n\t// Get all themes\n\tif ( function_exists( 'wp_get_themes' ) )\n\t\t$themes = wp_get_themes();\n\telse\n\t\t$themes = get_themes();\n\n\t// Get the active theme\n\t$active = get_option( 'current_theme' );\n\n\t// Delete the transient so wp_update_themes can get fresh data\n\tif ( function_exists( 'get_site_transient' ) )\n\t\tdelete_site_transient( 'update_themes' );\n\n\telse\n\t\tdelete_transient( 'update_themes' );\n\n\t// Force a theme update check\n\twp_update_themes();\n\n\t// Different versions of wp store the updates in different places\n\t// TODO can we depreciate\n\tif ( function_exists( 'get_site_transient' ) && $transient = get_site_transient( 'update_themes' ) )\n\t\t$current = $transient;\n\n\telseif ( $transient = get_transient( 'update_themes' ) )\n\t\t$current = $transient;\n\n\telse\n\t\t$current = get_option( 'update_themes' );\n\n\tforeach ( (array) $themes as $key => $theme ) {\n\n\t\t// WordPress 3.4+\n\t\tif ( is_object( $theme ) && is_a( $theme, 'WP_Theme' ) ) {\n\n\t\t\t$new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null;\n\n\t\t\t$theme_array = array(\n\t\t\t\t'Name' => $theme->get( 'Name' ),\n\t\t\t\t'active' => $active == $theme->get( 'Name' ),\n\t\t\t\t'Template' => $theme->get_template(),\n\t\t\t\t'Stylesheet' => $theme->get_stylesheet(),\n\t\t\t\t'Screenshot' => $theme->get_screenshot(),\n\t\t\t\t'AuthorURI' => $theme->get( 'AuthorURI' ),\n\t\t\t\t'Author' => $theme->get( 'Author' ),\n\t\t\t\t'latest_version' => $new_version ? $new_version : $theme->get( 'Version' ),\n\t\t\t\t'Version' => $theme->get( 'Version' ),\n\t\t\t\t'ThemeURI' => $theme->get( 'ThemeURI' )\n\t\t\t);\n\n\t\t\t$themes[$key] = $theme_array;\n\n\t\t} else {\n\n\t\t\t$new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null;\n\n\t\t\tif ( $active == $theme['Name'] )\n\t\t\t\t$themes[$key]['active'] = true;\n\n\t\t\telse\n\t\t\t\t$themes[$key]['active'] = false;\n\n\t\t\tif ( $new_version ) {\n\n\t\t\t\t$themes[$key]['latest_version'] = $new_version;\n\t\t\t\t$themes[$key]['latest_package'] = $current->response[$theme['Template']]['package'];\n\n\t\t\t} else {\n\n\t\t\t\t$themes[$key]['latest_version'] = $theme['Version'];\n\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $themes;\n}", "function wp_using_themes()\n {\n }", "function pnUserGetTheme()\r\n{\r\n // Order of theme priority:\r\n // - page-specific\r\n // - user\r\n // - system\r\n // - PostNuke\r\n\r\n // Page-specific theme\r\n $pagetheme = pnVarCleanFromInput('theme');\r\n if (!empty($pagetheme)) {\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($pagetheme))) {\r\n return $pagetheme;\r\n }\r\n }\r\n\r\n if (pnUserLoggedIn()) {\r\n $usertheme = pnUserGetVar('theme');\r\n// modification mouzaia .71\r\n if (!empty($usertheme)) {\r\n\t\t\tif (@opendir(WHERE_IS_PERSO.\"themes/\".pnVarPrepForOS($usertheme)))\r\n\t\t\t { return $usertheme; }\t\t\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($usertheme))) \r\n\t\t\t\t{ return $usertheme; }\r\n }\r\n }\r\n\r\n $systemtheme = pnConfigGetVar('Default_Theme');\r\n if (!empty($systemtheme)) {\r\n if (@opendir(WHERE_IS_PERSO.\"themes/\" . pnVarPrepForOS($systemtheme))) {\r\n return $systemtheme;\r\n }\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($systemtheme))) {\r\n return $systemtheme;\r\n }\r\n }\r\n\r\n// \twhy is this hard coded ??????\r\n// $defaulttheme = 'PostNuke';\r\n $defaulttheme = pnConfigGetVar('Default_Theme');\r\n if (@opendir(WHERE_IS_PERSO.\"themes/\" . pnVarPrepForOS($defaulttheme))) {\r\n return $defaulttheme;\r\n }\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($defaulttheme))) {\r\n return $defaulttheme;\r\n }\r\n return false;\r\n}", "public static function GetDefaultThemeInformation()\n\t{\n\t\treturn array(\n\t\t\t'name' => 'light-grey',\n\t\t\t'parameters' => array(\n\t\t\t\t'variables' => array(),\n\t\t\t\t'imports' => array(\n\t\t\t\t\t'css-variables' => '../css/css-variables.scss',\n\t\t\t\t),\n\t\t\t\t'stylesheets' => array(\n\t\t\t\t\t'jqueryui' => '../css/ui-lightness/jqueryui.scss',\n\t\t\t\t\t'main' => '../css/light-grey.scss',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function get_mobile_themes()\r\n\t {\r\n\t\tif(!function_exists('get_themes'))\r\n\t\t\treturn null;\r\n\r\n\t\treturn $wp_themes = get_themes();\r\n\r\n\t\t/*foreach($wp_themes as $name=>$theme) {\r\n\t\t\t$stylish_dir = $wp_themes[$name]['Stylesheet Dir'];\r\n\r\n\t\t\tif(is_file($stylish_dir.'/style.css')) {\r\n\t\t\t\t$theme_data = get_theme_data($stylish_dir.'/style.css');\r\n\t\t\t\t$tags = $theme_data['Tags'];\r\n\r\n\t\t\t\tforeach($tags as $tag) {\r\n\t\t\t\t\tif(eregi('Mobile Theme', $tag) || eregi('WPtap', $tag)) {\r\n\t\t\t\t\t\t$wptap_mobile_themes[$name] = $theme;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $wptap_mobile_themes;*/\r\n\t }", "public function get_theme_info(){\n\t\treturn (array)$this->theme_info;\n\t}", "public function all(array $params = array())\n {\n $request = new Request('GET', '/admin/themes.json');\n return $this->getEdge($request, $params, Theme::class);\n }", "function get_theme_updates()\n {\n }", "function get_theme_data() {\n\t$theme_file = __CHV_PATH_THEME__.'style.css';\n\t$theme_data = implode('', file($theme_file));\n\t$theme_data = str_replace ('\\r', '\\n',$theme_data );\n\t\n\tif (preg_match('|Theme Name:(.*)$|mi', $theme_data, $theme_name))\n\t\t$name = clean_header_comment($theme_name[1]);\n\n\tif (preg_match('|Theme URL:(.*)$|mi', $theme_data, $theme_url))\n\t\t$url = clean_header_comment($theme_url[1]);\n\t\t\n\tif (preg_match('|Version:(.*)$|mi', $theme_data, $theme_version))\n\t\t$version = clean_header_comment($theme_version[1]);\n\t\n\tif (preg_match('|Author:(.*)$|mi', $theme_data, $theme_author))\n\t\t$author = clean_header_comment($theme_author[1]);\n\t\n\tif (preg_match('|@Chevereto:(.*)$|mi', $theme_data, $theme_chevereto))\n\t\t$chevereto = clean_header_comment($theme_chevereto[1]);\n\t\t\n\treturn array(\n\t\t'Name' => $name,\n\t\t'URL' => $url,\n\t\t'Version' => $version,\n\t\t'Author' => $author,\n\t\t'Chevereto' => $chevereto\n\t);\n}", "function init__themes()\n{\n global $THEME_IMAGES_CACHE, $CDN_CONSISTENCY_CHECK, $RECORD_THEME_IMAGES_CACHE, $RECORDED_THEME_IMAGES, $THEME_IMAGES_SMART_CACHE_LOAD;\n $THEME_IMAGES_CACHE = array();\n $CDN_CONSISTENCY_CHECK = array();\n $RECORD_THEME_IMAGES_CACHE = false;\n $RECORDED_THEME_IMAGES = array();\n $THEME_IMAGES_SMART_CACHE_LOAD = 0;\n}", "function themes( $args ){\n \n // select toolbox\n if( $args['tool'] == null ){\n $tool = 'display';\n } else {\n $tool = $args['tool'];\n }\n \n // page title\n $this->view->add('page_title','Manage Garage Themes');\n \n // use our fancy tool box\n if( $func = $this->themes_toolbox($tool,$this) ) {\n \n // check fro success, default to no\n $success = false;\n \n // choose tool and execute\n $success = $func($this);\n }\n \n // get the list of themes\n $theme_dirs = glob('themes/*', GLOB_ONLYDIR);\n \n // create theme list\n $theme_list = array();\n \n $theme_list[] = array( 'name' => 'Default', 'path' => 'views' );\n \n // build list\n foreach( $theme_dirs as $theme ){\n $theme_list[] = array(\n 'name' => $theme,\n 'path' => $theme\n );\n }\n \n // add to list\n $this->view->add('theme_list',$theme_list);\n \n // get current theme from settings\n $current_theme = $this->app->settings('theme')->get('theme');\n \n // add to view\n $this->view->add('current_theme',$current_theme);\n \n // add self link\n $this->view->add('self_link',\n $this->app->form_path('admin/themes')\n );\n \n }", "public static function scan()\n {\n if (!FS_ACCESS && Config::get('available_themes')) {\n return Config::get('available_themes');\n }\n $dir = \"themes/\";\n $scanned = scandir($dir);\n $_packages = [];\n foreach ($scanned as $folder) {\n if ($folder[0] != '.') {\n $json = $dir.$folder.'/package.json';\n if (file_exists($json)) {\n $data = json_decode(file_get_contents($json));\n if (!FS_ACCESS && isset($data->mainsite) && $data->mainsite===true) {\n continue;\n }\n @$data->title = @$data->title?? @$data->name;\n $data->package = $folder;\n $data->url = @$data->homepage?? (@$data->url?? '');\n $_packages[$folder] = $data;\n }\n }\n }\n return $_packages;\n }", "function latto_get_info($theme_name) {\n $info = drupal_static(__FUNCTION__, array());\n if (empty($info)) {\n $lt = list_themes();\n foreach ($lt as $key => $value) {\n if ($theme_name == $key) {\n $info = $lt[$theme_name]->info;\n }\n }\n }\n\n return $info;\n}", "public static function getInstalledThemesNames()\n\t\t{\n\t\t\treturn self::$installedThemesNames;\n\t\t}", "public static function getThemesRoot()\n {\n return self::$themeRoot;\n }", "function wpcom_vip_themes_root() {\n\treturn WP_CONTENT_DIR . '/themes';\n}", "public static function getThemesForSelect()\n {\n if (!self::$_initialized) {\n self::init();\n }\n\n $results = [];\n foreach (self::$_themes as $theme) {\n $results[$theme->id()] = $theme->name();\n }\n\n return $results;\n }", "function ac_skin_discover_theme_fonts($font = NULL){\n $settings = &drupal_static(__FUNCTION__, null);\n if (!isset($settings)) {\n\tacquia_include('theme');\n\t$settings = acquia_theme_discovery('font', variable_get('ACQUIA_BASE_THEME'), 'font_info');\n }\n if (isset($settings[$font])) {\n\treturn $settings[$font];\n }\n\n return $settings;\n}", "private function activeThemes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->active_theme;\n debug($all_plugins);\n die;\n }", "public function getStylesheets()\n {\n return array('/cpCmsPlugin/css/widget.css' => 'all');\n }", "protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename('.css'), $file->getPathname());\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_THEMES_NAME, $this->getThemes());\n }\n }", "function wysiwyg_tinymce_themes($editor, $profile) {\n /*\n $themes = array();\n $dir = $editor['library path'] . '/themes/';\n if (is_dir($dir) && $dh = opendir($dir)) {\n while (($file = readdir($dh)) !== FALSE) {\n if (!in_array($file, array('.', '..', 'CVS', '.svn')) && is_dir($dir . $file)) {\n $themes[$file] = $file;\n }\n }\n closedir($dh);\n asort($themes);\n }\n return $themes;\n */\n return array('advanced', 'simple');\n}", "public function getTheme ()\r\n\t{\r\n\t\treturn Tg_Site::getTheme($this->themeId);\r\n\t}", "public static function getMyTheme()\n {\n $paramArray = (\\Config\\Site::getAllParams());\n return ($paramArray['hash'])?'Flexi':'';\n }", "public function getTheme()\n {\n return _THEME_NAME_;\n }", "public function getDesignTheme();", "function wp_get_theme($stylesheet = '', $theme_root = '')\n {\n }", "public static function get_core_default_theme()\n {\n }", "function get_theme ()\r\n {\r\n return $_SESSION[\"theme\"];\r\n }", "public static function load_themes()\n\t{\n\t\t$config = Kohana::$config->load('site');\n\n\t\t//set admin theme based on path info\n\t\t$path = ltrim(Request::detect_uri(), '/');\n\t\tTheme::$is_admin = ( $path == \"admin\" || !strncmp($path, \"admin/\", 6) );\n\n\t\tif (Theme::$is_admin)\n\t\t{\n\t\t\t// Load the admin theme\n\t\t\tTheme::$admin_theme_name = $config->get('admin_theme', Theme::$admin_theme_name);\n\t\t\tTheme::$active = Theme::$admin_theme_name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Load the site theme\n\t\t\tTheme::$site_theme_name = $config->get('theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t//Set mobile theme, if enabled and mobile request\n\t\tif(Request::is_mobile() AND $config->get('mobile_theme', FALSE))\n\t\t{\n\t\t\t// Load the mobile theme\n\t\t\tTheme::$site_theme_name = $config->get('mobile_theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t// Admins can override the site theme, temporarily. This lets us preview themes.\n\t\tif (User::is_admin() AND isset($_GET['theme']) AND $override = $_GET['theme'])\n\t\t{\n\t\t\tif (file_exists(THEMEPATH.$override))\n\t\t\t{\n\t\t\t\tTheme::$site_theme_name = $override;\n\t\t\t\tTheme::$admin_theme_name = $override;\n\t\t\t\tTheme::$active \t\t = $override;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tKohana::$log->add(LOG::ERROR, 'Missing override site theme: :theme', array(':theme' => $override));\n\t\t\t}\n\t\t}\n\n\t\t//Finally set the active theme\n\t\tTheme::set_theme();\n\t}", "function wp_get_global_stylesheet($types = array())\n {\n }", "public function getThemeLayouts();", "static function bad_themes_results() {\n\n\t\t$return = array();\n\t\t$request = remote_get_json( 'https://varnish-http-purge.objects-us-east-1.dream.io/themes.json' );\n\n\t\tif( is_wp_error( $request ) ) {\n\t\t\treturn $return; // Bail early\n\t\t}\n\n\t\t$body = wp_remote_retrieve_body( $request );\n\t\t$themes = json_decode( $body );\n\n\t\tif( empty( $themes ) ) {\n\t\t\treturn $return; // Bail early\n\t\t}\n\n\t\t// Check all the themes. If one of the questionable ones are active, warn\n\t\tforeach ( $themes as $theme => $info ) {\n\t\t\t$my_theme = wp_get_theme( $theme );\n\t\t\t$message = 'Active Theme ' . ucfirst( $theme ) . ': ' . $info->message;\n\t\t\t$warning = $info->type;\n\t\t\tif ( $my_theme->exists() ) {\n\t\t\t\t$return[ 'theme' ] = array( 'icon' => $warning, 'message' => $message );\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "static public function getThemeResourceTypes();", "public function getTheme()\n {\n $this->appinfo['theme_vendor'] = DEF_VENDOR;\n $this->appinfo['theme_directory'] = DEF_THEME;\n $this->appinfo['theme_path'] = DIR_APP.DIRECTORY_SEPARATOR.$this->appinfo['theme_vendor'].DIRECTORY_SEPARATOR.DIR_THEMES.DIRECTORY_SEPARATOR.$this->appinfo['theme_directory'];\n $this->appinfo['theme_webpath'] = DIR_APP.'/'.$this->appinfo['theme_vendor'].'/'.DIR_THEMES.'/'.$this->appinfo['theme_directory'];\n }", "public static function get_theme_options() {\n\t\t\treturn get_option( 'ELMT_theme_options' );\n\t\t}", "function client_portal_get_theme_colors_gutenberg() {\n\n\t// Grab our ACF theme colors.\n\t$colors = client_portal_get_theme_colors();\n\n\tif ( ! $colors ) {\n\t\treturn array();\n\t}\n\n\tforeach ( $colors as $key => $color ) {\n\t\t$gutenberg_colors[] = array(\n\t\t\t'name' => esc_html( $key ),\n\t\t\t'slug' => sanitize_title( $key ),\n\t\t\t'color' => esc_attr( $color ),\n\t\t);\n\t}\n\n\treturn $gutenberg_colors;\n}", "public static function loadThemes()\n {\n $themesFolder = new Folder(ROOT . DS . 'themes');\n $themes = $themesFolder->read()[0];\n $loader = require ROOT . DS . 'vendor' . DS . 'autoload.php';\n foreach ($themes as $theme) {\n $loader->addPsr4('WasabiTheme\\\\' . $theme . '\\\\', [$themesFolder->path . DS . $theme . DS . 'src']);\n Plugin::load('WasabiTheme/' . $theme, [\n 'path' => $themesFolder->path . DS . $theme . DS,\n 'bootstrap' => true,\n 'routes' => false\n ]);\n }\n }", "public static function get_theme_options() {\n\t\t\treturn get_option( 'theme_options' );\n\t\t}", "public function getThemeList($package = null)\r\n {\r\n $result = array();\r\n\r\n if (is_null($package)){\r\n foreach ($this->getPackageList() as $package){\r\n $result[$package] = $this->getThemeList($package);\r\n }\r\n } else {\r\n $directory = Mage::getBaseDir('design') . DS . 'frontend' . DS . $package;\r\n $result = $this->_listDirectories($directory);\r\n }\r\n\r\n return $result;\r\n }", "static public function getThemeResourceTypes()\n\t\t{\n\t\t\treturn array('css');\n\t\t}", "function list_theme_updates()\n {\n }", "public function getThemeName() {}", "private function getAdminThemeComponets()\n { \n $variables = \"\";\n\n foreach($this->adminComponets as $com => $c){\n $variables.=(\"theme.\".$com.\"='\".URL::to($c).\"';\");\n }\n\n return $variables;\n }", "function cpotheme_metadata_themelist_optional($key = null)\n{\n $cpotheme_data = array();\n $page_list = get_posts('post_type=cpo_theme&posts_per_page=-1&orderby=title&order=asc');\n $cpotheme_data['all'] = \"(Sin Tema)\";\n foreach ($page_list as $current_page) {\n $cpotheme_data[ $current_page->ID ] = $current_page->post_title;\n }\n\n return ($key == null) ? $cpotheme_data : $cpotheme_data[ $key ];\n}", "function getStyles () {\n return array(\"template.css\");\n }", "function get_registered_theme_features()\n {\n }", "function GetThemeInfo ($filename) { \n $dataBack = array();\n if ($filename != '') {\n $default_headers = array(\n 'label' => 'label',\n 'file' => 'file',\n 'columns' => 'columns'\n );\n \n $dataBack = get_file_data($filename,$default_headers,'');\n $dataBack['file'] = preg_replace('/.css$/','',$dataBack['file']); \n }\n \n return $dataBack;\n }", "function wp_ajax_query_themes()\n {\n }", "public static function getTheme()\n {\n $className = static::getCalledClass();\n while (!StringHandler::endsWith($className, \"App\")) {\n $className = get_parent_class($className);\n if ($className === false) {\n $className = \"\";\n break;\n }\n if (strpos($className, \"\\\\\") !== 0) {\n $className = \"\\\\\" . $className;\n }\n }\n $theme = Kernel::getService('em')\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')\n ->findOneBy(['className' => $className]);\n return $theme;\n }", "function current_theme_info()\n {\n }" ]
[ "0.7894927", "0.7696822", "0.75600994", "0.74947655", "0.7331566", "0.7307173", "0.7278911", "0.7194517", "0.71852803", "0.71593225", "0.71535057", "0.7132874", "0.7093899", "0.7053806", "0.7040051", "0.6996329", "0.69565624", "0.69317776", "0.6909936", "0.690989", "0.6870045", "0.68569505", "0.68541425", "0.683112", "0.67856795", "0.6782163", "0.67627764", "0.6757083", "0.6755752", "0.6720674", "0.67201453", "0.6672013", "0.6658776", "0.6618667", "0.66098475", "0.65856504", "0.65330887", "0.653296", "0.65145147", "0.6496639", "0.64807105", "0.6405541", "0.6404815", "0.6400073", "0.6400004", "0.6389065", "0.63638127", "0.6348429", "0.6345859", "0.6336155", "0.6335353", "0.6314038", "0.6311666", "0.6294407", "0.6279428", "0.62727976", "0.62563175", "0.61877906", "0.61704314", "0.6168305", "0.6163616", "0.61318684", "0.6115924", "0.61091244", "0.6097889", "0.6092052", "0.6088898", "0.6078884", "0.6078241", "0.6072638", "0.6055007", "0.6053954", "0.60474426", "0.60415614", "0.6033288", "0.60043377", "0.59905875", "0.59854907", "0.59820485", "0.59754264", "0.5974655", "0.5968284", "0.5961532", "0.59609586", "0.5951775", "0.5949535", "0.5947912", "0.5927017", "0.5921312", "0.59179246", "0.58946246", "0.58832544", "0.58818406", "0.587327", "0.5871043", "0.5864834", "0.5861577", "0.5858344", "0.58561885", "0.5846292" ]
0.7094426
12
/ Get Active Themes
private function activeThemes() { $all_plugins = json_decode(file_get_contents($this->pluginsJson))->active_theme; debug($all_plugins); die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_get_active_and_valid_themes()\n {\n }", "function current_theme()\n {\n return current_theme();\n }", "function get_themes()\n {\n }", "public function getTheme();", "public function getAvailableThemes()\n\t{\n\t\t$this->loadAvailableThemes();\n\t\treturn self::$_themes;\n\t}", "public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }", "public function activeTheme()\n {\n return $this->enabled()\n ->filter(function (Extension $e) {\n return $e->providesTheme() &&\n $e->isActiveTheme();\n })\n ->first();\n }", "public function getCurrentTheme() {\n\t\t\t//No usamos el getTodayAdvertisements, así nos ahorramos la hidratacion de cosas innecesarias\n\t\t\treturn ThemeQuery::create()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->filterByCurrent()\n\t\t\t\t->findOne();\n\t\t}", "function get_current_theme()\n {\n }", "public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}", "public function getThemes()\n {\n return $this->themes;\n }", "function get_allowed_themes()\n {\n }", "protected function _getCurrentTheme()\n {\n return $this->_coreRegistry->registry('current_theme');\n }", "function okcdesign_theme() {\n $themes = array();\n theme_plugins_invoke(__FUNCTION__, $themes);\n return $themes;\n}", "function get_site_allowed_themes()\n {\n }", "public function active()\n {\n return $this->get($this->theme);\n }", "public function all()\r\n {\r\n return $this->themes;\r\n }", "public function getAllThemes();", "public function getCurrentTheme()\n {\n return $theme = $this->config->theming->theme;\n }", "function ac_skin_get_theme_skin_items(){\n $settings = &drupal_static(__FUNCTION__, null);\n if (!isset($settings)) {\n\tacquia_include('theme');\n\t$settings = acquia_theme_discovery('skin', variable_get('ACQUIA_BASE_THEME'), 'skin_info');\n }\n return $settings;\n}", "function getCurrnetTheme(){\n\n\t\t\t$theme = Cache::read('currentTheme');\n\n\t\t\tif ($theme == false) {\n\t\t\t\t$theme = $this->find(\n\t\t\t\t\t'first',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t'Theme.active' => 1\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tCache::write('currentTheme', $theme, 'core');\n\n\t\t\treturn $theme;\n\t\t}", "public function getCurrentTheme()\n {\n $status = $this->runWpCliCommand('theme', 'status');\n $status = preg_replace(\"/\\033\\[[^m]*m/\", '', $status); // remove formatting\n\n preg_match_all(\"/^[^A-Z]*([A-Z]+)[^a-z]+([a-z\\-]+).*$/m\", $status, $matches);\n\n foreach ($matches[1] as $lineNumber => $status) {\n if (Strings::contains($status, 'A')) {\n return $matches[2][$lineNumber];\n }\n }\n\n return null; // this should never happen, there is always some activate theme\n }", "function get_theme ()\r\n {\r\n return $_SESSION[\"theme\"];\r\n }", "public function current_theme() {\r\n\t $dataArr = array(\r\n 'theme_status' => 1\r\n );\r\n $themeDetails = $this->CI->DatabaseModel->access_database('ts_themes','select','',$dataArr);\r\n if( !empty($themeDetails) ) {\r\n return $themeDetails[0]['theme_name'];\r\n }\r\n else {\r\n return 'default';\r\n }\r\n\t}", "public static function getMyTheme()\n {\n $paramArray = (\\Config\\Site::getAllParams());\n return ($paramArray['hash'])?'Flexi':'';\n }", "public function getSelectedTheme()\n {\n $selectedTheme = OW::getConfig()->getValue('base', 'selectedTheme');\n\n if ( empty($this->themeObjects[$selectedTheme]) )\n {\n $this->themeObjects[$selectedTheme] = $this->themeService->getThemeObjectByKey(OW::getConfig()->getValue('base', 'selectedTheme'));\n }\n\n return $this->themeObjects[$selectedTheme];\n }", "public function get_lightbox_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_lightbox_themes();\n\n }", "function get_theme_mods()\n {\n }", "function thrive_dashboard_get_all_themes()\n{\n $themes = thrive_dashboard_get_thrive_products('theme');\n $current_theme = wp_get_theme();\n\n foreach ($themes as $key => $theme) {\n\n if ($current_theme->name == $theme->name) {\n unset($themes[$key]);\n continue;\n }\n\n $local_theme = wp_get_theme($theme->tag);\n if ($local_theme->exists()) {\n $theme->installed = true;\n } else {\n $theme->installed = false;\n }\n }\n\n return $themes;\n}", "function current_theme_info()\n {\n }", "public function themes()\n {\n return R::findAll('theme', 'order by name');\n }", "function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}", "public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }", "public function getTheme ()\r\n\t{\r\n\t\treturn Tg_Site::getTheme($this->themeId);\r\n\t}", "function _wprp_get_themes() {\n\n\trequire_once( ABSPATH . '/wp-admin/includes/theme.php' );\n\n\t_wpr_add_non_extend_theme_support_filter();\n\n\t// Get all themes\n\tif ( function_exists( 'wp_get_themes' ) )\n\t\t$themes = wp_get_themes();\n\telse\n\t\t$themes = get_themes();\n\n\t// Get the active theme\n\t$active = get_option( 'current_theme' );\n\n\t// Delete the transient so wp_update_themes can get fresh data\n\tif ( function_exists( 'get_site_transient' ) )\n\t\tdelete_site_transient( 'update_themes' );\n\n\telse\n\t\tdelete_transient( 'update_themes' );\n\n\t// Force a theme update check\n\twp_update_themes();\n\n\t// Different versions of wp store the updates in different places\n\t// TODO can we depreciate\n\tif ( function_exists( 'get_site_transient' ) && $transient = get_site_transient( 'update_themes' ) )\n\t\t$current = $transient;\n\n\telseif ( $transient = get_transient( 'update_themes' ) )\n\t\t$current = $transient;\n\n\telse\n\t\t$current = get_option( 'update_themes' );\n\n\tforeach ( (array) $themes as $key => $theme ) {\n\n\t\t// WordPress 3.4+\n\t\tif ( is_object( $theme ) && is_a( $theme, 'WP_Theme' ) ) {\n\n\t\t\t$new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null;\n\n\t\t\t$theme_array = array(\n\t\t\t\t'Name' => $theme->get( 'Name' ),\n\t\t\t\t'active' => $active == $theme->get( 'Name' ),\n\t\t\t\t'Template' => $theme->get_template(),\n\t\t\t\t'Stylesheet' => $theme->get_stylesheet(),\n\t\t\t\t'Screenshot' => $theme->get_screenshot(),\n\t\t\t\t'AuthorURI' => $theme->get( 'AuthorURI' ),\n\t\t\t\t'Author' => $theme->get( 'Author' ),\n\t\t\t\t'latest_version' => $new_version ? $new_version : $theme->get( 'Version' ),\n\t\t\t\t'Version' => $theme->get( 'Version' ),\n\t\t\t\t'ThemeURI' => $theme->get( 'ThemeURI' )\n\t\t\t);\n\n\t\t\t$themes[$key] = $theme_array;\n\n\t\t} else {\n\n\t\t\t$new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null;\n\n\t\t\tif ( $active == $theme['Name'] )\n\t\t\t\t$themes[$key]['active'] = true;\n\n\t\t\telse\n\t\t\t\t$themes[$key]['active'] = false;\n\n\t\t\tif ( $new_version ) {\n\n\t\t\t\t$themes[$key]['latest_version'] = $new_version;\n\t\t\t\t$themes[$key]['latest_package'] = $current->response[$theme['Template']]['package'];\n\n\t\t\t} else {\n\n\t\t\t\t$themes[$key]['latest_version'] = $theme['Version'];\n\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $themes;\n}", "public function getActiveThemeByName($theme_name);", "public static function getTheme()\n {\n $className = static::getCalledClass();\n while (!StringHandler::endsWith($className, \"App\")) {\n $className = get_parent_class($className);\n if ($className === false) {\n $className = \"\";\n break;\n }\n if (strpos($className, \"\\\\\") !== 0) {\n $className = \"\\\\\" . $className;\n }\n }\n $theme = Kernel::getService('em')\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')\n ->findOneBy(['className' => $className]);\n return $theme;\n }", "public function getTheme () {\n $admin = Yii::app()->settings;\n \n if ($admin->enforceDefaultTheme && $admin->defaultTheme !== null) {\n $theme = $this->getDefaultTheme ();\n if ($theme) return $theme;\n } \n \n return $this->theme;\n }", "private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }", "public function get_theme_info(){\n\t\treturn (array)$this->theme_info;\n\t}", "function display_themes()\n {\n }", "function return_back_std_themes_settings() {\r\n\r\n\t$get_all_themes = wp_get_themes();\r\n\r\n\t$root_plugin_path = get_theme_root();\r\n\t$root_plugin_path = str_replace( 'plugins/yoga-poses/templates/', '', $root_plugin_path );\r\n\t$root_plugin_path .= 'themes/';\r\n\r\n\tregister_theme_directory( $root_plugin_path );\r\n\r\n\t// activate first theme in list\r\n\tforeach ( $get_all_themes as $key => $one_theme ) {\r\n\t\tswitch_theme( $key );\r\n\t\tbreak;\r\n\t}\r\n\r\n\treturn $root_plugin_path;\r\n}", "function website_themes() {\n\n\t$websites = get_website_data();\n\n\t$themes = array();\n\n\tforeach ( $websites as $site ) {\n\t\t$themes[] = $site[ 'theme' ];\n\t}\n\n\treturn array_unique( $themes );\n\n}", "public function getCurrentSiteTheme()\n {\n $siteInfo = $this->getCurrentSiteInfo();\n\n return $siteInfo['theme'];\n }", "public function getTheme()\n {\n return _THEME_NAME_;\n }", "public function get_gallery_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_gallery_themes();\n\n }", "function pnUserGetTheme()\r\n{\r\n // Order of theme priority:\r\n // - page-specific\r\n // - user\r\n // - system\r\n // - PostNuke\r\n\r\n // Page-specific theme\r\n $pagetheme = pnVarCleanFromInput('theme');\r\n if (!empty($pagetheme)) {\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($pagetheme))) {\r\n return $pagetheme;\r\n }\r\n }\r\n\r\n if (pnUserLoggedIn()) {\r\n $usertheme = pnUserGetVar('theme');\r\n// modification mouzaia .71\r\n if (!empty($usertheme)) {\r\n\t\t\tif (@opendir(WHERE_IS_PERSO.\"themes/\".pnVarPrepForOS($usertheme)))\r\n\t\t\t { return $usertheme; }\t\t\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($usertheme))) \r\n\t\t\t\t{ return $usertheme; }\r\n }\r\n }\r\n\r\n $systemtheme = pnConfigGetVar('Default_Theme');\r\n if (!empty($systemtheme)) {\r\n if (@opendir(WHERE_IS_PERSO.\"themes/\" . pnVarPrepForOS($systemtheme))) {\r\n return $systemtheme;\r\n }\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($systemtheme))) {\r\n return $systemtheme;\r\n }\r\n }\r\n\r\n// \twhy is this hard coded ??????\r\n// $defaulttheme = 'PostNuke';\r\n $defaulttheme = pnConfigGetVar('Default_Theme');\r\n if (@opendir(WHERE_IS_PERSO.\"themes/\" . pnVarPrepForOS($defaulttheme))) {\r\n return $defaulttheme;\r\n }\r\n if (@opendir(\"themes/\" . pnVarPrepForOS($defaulttheme))) {\r\n return $defaulttheme;\r\n }\r\n return false;\r\n}", "public function getDesignTheme();", "public function get_theme() {\n return $this->_theme;\n }", "public function get_meta_themes() {\n\t\tSingleton::get_instance( 'Theme', $this )->get_remote_theme_meta();\n\t}", "public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }", "public function is_theme_active()\n {\n }", "public static function getThemesRoot()\n {\n return self::$themeRoot;\n }", "public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }", "public function get_available_themes() {\n\t\treturn apply_filters( 'crocoblock-wizard/install-theme/available-themes', array(\n\t\t\t'kava' => array(\n\t\t\t\t'source' => 'crocoblock',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/kava.png',\n\t\t\t),\n\t\t\t'blocksy' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/blocksy.png',\n\t\t\t),\n\t\t\t'oceanwp' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/ocean.png',\n\t\t\t),\n\t\t\t'astra' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/astra.png',\n\t\t\t),\n\t\t\t'generatepress' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/generatepress.png',\n\t\t\t),\n\t\t\t'hello-elementor' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/hello.png',\n\t\t\t),\n\t\t) );\n\t}", "public static function getTheme ()\n {\n $config = Zend_Registry::get('config');\n\n return $config->app->theme;\n }", "public function get_theme_name(){\n\t\treturn $this->current_theme;\n\t}", "public function getTheme()\n\t{\n\t\treturn $this->theme;\n\t}", "public function getThemeName() {}", "public function getTheme()\n {\n return $this->theme;\n }", "public function getTheme()\n {\n return $this->theme;\n }", "public function getTheme()\n {\n return $this->theme;\n }", "public function getCurrentThemeData() {\n\t\t\t$themes = wp_get_themes();\n\n\t\t\treturn empty( $themes[ basename( get_template_directory() ) ] ) ? false : $themes[ basename( get_template_directory() ) ];\n\t\t}", "protected function getTheme()\n {\n return !empty($_GET['theme']) ? $_GET['theme'] : 'basic';\n }", "function get_at_colors() {\n $scheme = theme_get_setting('color_schemes');\n if (!$scheme) {\n $scheme = 'colors-default.css';\n }\n if (isset($_COOKIE[\"atcolors\"])) {\n $scheme = $_COOKIE[\"atcolors\"];\n }\n return $scheme;\n}", "function scs_get_themes()\n\t {\n\t \tglobal $scs_themes;\n\t\t$scs_themes = array();\n\t\t\n\t \t$dir = dirname(__FILE__).'/'.SCS_THEMES_DIR.'/';\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\" && !is_file($file) && file_exists($dir.$file.'/index.php') ) {\n\t\t\t\t\t$scs_themes[] = ucfirst($file);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t }", "function latto_get_info($theme_name) {\n $info = drupal_static(__FUNCTION__, array());\n if (empty($info)) {\n $lt = list_themes();\n foreach ($lt as $key => $value) {\n if ($theme_name == $key) {\n $info = $lt[$theme_name]->info;\n }\n }\n }\n\n return $info;\n}", "private function get_active_plugins() {\n\t\t$plugins = get_plugins();\n\t\t$active = get_option( 'active_plugins' );\n\t\t$active_list = array();\n\t\tforeach ( $active as $slug ):\n\t\t\tif ( isset( $plugins[ $slug ] ) ) {\n\t\t\t\t$active_list[] = $plugins[ $slug ];\n\t\t\t}\n\t\tendforeach;\n\n\t\treturn $active_list;\n\t}", "public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }", "function shGetFrontEndActiveLanguages()\n{\n\tstatic $shLangs = null;\n\n\tif (is_null($shLangs))\n\t{\n\t\t$shLangs = array();\n\t\tjimport('joomla.language.helper');\n\t\t$languages = JLanguageHelper::getLanguages();\n\t\tif (!empty($languages))\n\t\t{\n\t\t\tforeach ($languages as $i => &$language)\n\t\t\t{\n\t\t\t\t// Do not display language without frontend UI\n\t\t\t\tif (!JLanguage::exists($language->lang_code))\n\t\t\t\t{\n\t\t\t\t\tunset($languages[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($languages as $language)\n\t\t\t{\n\t\t\t\t$shLang = new StdClass();\n\t\t\t\t$shLang->iso = $language->sef;\n\t\t\t\tif (empty($shLang->iso))\n\t\t\t\t{\n\t\t\t\t\t$shLang->iso = substr($language->lang_code, 0, 2);\n\t\t\t\t}\n\t\t\t\t$shLang->code = $language->lang_code;\n\t\t\t\t$shLangs[] = $shLang;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $shLangs;\n\n}", "function wp_get_active_and_valid_plugins()\n {\n }", "function get_theme_name(){\n\tglobal $theme;\n\treturn $theme->get_theme_name();\n}", "function rovadex() {\n\treturn Rovadex_Theme::get_instance();\n}", "function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}", "public static function getActiveSkin(): self\n {\n if (self::$activeSkinCache !== false) {\n return self::$activeSkinCache;\n }\n\n $skin = static::load(static::getActiveSkinCode());\n\n\n return self::$activeSkinCache = $skin;\n }", "public function get_themes_list()\n {\n $baseUrl = 'http://prismjs.com/index.html?theme=';\n\n return [\n 1 => ['name' => 'Default', 'url' => $baseUrl . 'prism', 'file' => 'prism'],\n 2 => ['name' => 'Coy', 'url' => $baseUrl . 'prism-coy', 'file' => 'prism-coy'],\n 3 => ['name' => 'Dark', 'url' => $baseUrl . 'prism-dark', 'file' => 'prism-dark'],\n 4 => ['name' => 'Okaidia', 'url' => $baseUrl . 'prism-okaidia', 'file' => 'prism-okaidia'],\n 5 => ['name' => 'Tomorrow', 'url' => $baseUrl . 'prism-tomorrow', 'file' => 'prism-tomorrow'],\n 6 => ['name' => 'Twilight', 'url' => $baseUrl . 'prism-twilight', 'file' => 'prism-twilight'],\n ];\n }", "function blank_theme_get_theme_instance() {\n\treturn Blank_Theme\\Inc\\Blank_Theme::get_instance();\n}", "public static function get_core_default_theme()\n {\n }", "function give_get_current_setting_tab() {\n\t// Get current setting page.\n\t$current_setting_page = give_get_current_setting_page();\n\n\t/**\n\t * Filter the default tab for current setting page.\n\t *\n\t * @since 1.8\n\t *\n\t * @param string\n\t */\n\t$default_current_tab = apply_filters( \"give_default_setting_tab_{$current_setting_page}\", 'general' );\n\n\t// Get current tab.\n\t$current_tab = empty( $_GET['tab'] ) ? $default_current_tab : urldecode( $_GET['tab'] );\n\n\t// Output.\n\treturn $current_tab;\n}", "function mapti() {\n return MyArcadeThemeIntegration::instance();\n}", "public static function getInstalledThemesNames()\n\t\t{\n\t\t\treturn self::$installedThemesNames;\n\t\t}", "function getThemesSelect( $iThemeSelect ){\n global $config;\n\n $content = null;\n foreach( $config['themes'] as $iTheme => $aData ){\n $content .= '<option value=\"'.$iTheme.'\"'.( ( $iTheme == $iThemeSelect ) ? ' selected=\"selected\"' : null ).'>'.$aData[3].'</option>';\n } // end foreach\n return $content;\n}", "public function get_themes() {\n\t\t$recaptcha_themes = array(\n\t\t\t'light' => _x( 'Light', 'recaptcha theme', 'theme-my-login' ),\n\t\t\t'dark' => _x( 'Dark', 'recaptcha theme', 'theme-my-login' )\n\t\t);\n\t\treturn apply_filters( 'theme_my_login_recaptcha_themes', $recaptcha_themes );\n\t}", "protected function getTheme()\n\t{\n\t\treturn strtolower($this->argument('name'));\n\t}", "function &my_theme() \n{\n return MY_Theme::get_instance();\n}", "public function getActive() {\n\t\tif ($this->_active === null) {\n\t\t\tif ($menu = $this->app->system->application->getMenu('site') and $menu instanceof JMenu) {\n\t\t\t\t$this->_active = $menu->getActive();\n\t\t\t}\n\t\t}\n\t\treturn $this->_active;\n\t}", "function wpmu_get_blog_allowedthemes($blog_id = 0)\n {\n }", "function get_theme_updates()\n {\n }", "public static function getThemes() {\r\n\t\t$themes = array();\r\n\r\n\t\t// Special files to ignore\r\n\t\t$ignore = array('admin.css');\r\n\r\n\t\t// Get themes corresponding to .css files.\r\n\t\t$dir = dirname(__FILE__) . '/css';\r\n\t\tif ($handle = opendir($dir)) {\r\n\t\t while (false !== ($entry = readdir($handle))) {\r\n\t\t\t if (in_array($entry, $ignore)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t $file = $dir . '/' . $entry;\r\n\t\t\t if (!is_file($file)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t // Beautify name\r\n\t\t\t $name = substr($entry, 0, -4); // Remove \".css\"\r\n\t\t\t $name = str_replace('--', ', ', $name);\r\n\t\t\t $name = str_replace('-', ' ', $name);\r\n\t\t\t\t$name = ucwords($name);\r\n\r\n\t\t\t // Add theme\r\n\t $themes[$entry] = $name;\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t}\r\n\r\n\t\t$themes['none'] = 'None';\r\n\r\n\t\t// Sort alphabetically\r\n\t\tasort($themes);\r\n\r\n\t\treturn $themes;\r\n\t}", "public function getTheme() {\n $templateFacade = $this->dependencyInjector->get('ride\\\\library\\\\template\\\\TemplateFacade');\n\n return $templateFacade->getDefaultTheme();\n }", "public function getThemeName(){\n\t\treturn $info->name;\n\t}", "function ts_get_main_menu_style()\r\n{\r\n\t$control_panel = ot_get_option('control_panel');\r\n\tif (ts_check_if_use_control_panel_cookies() && isset($_COOKIE['theme_main_menu_style']) && !empty($_COOKIE['theme_main_menu_style']) && ($control_panel == 'enabled_admin' && current_user_can('manage_options') || $control_panel == 'enabled_all')) {\r\n\t\treturn $_COOKIE['theme_main_menu_style'];\r\n\t}\r\n\telse if (isset($_GET['switch_main_menu_style']) && !empty($_GET['switch_main_menu_style'])) {\r\n\t\treturn $_GET['switch_main_menu_style'];\r\n\t}\r\n\t\r\n\t//get main menu style for specified page\r\n\t$main_menu_style = '';\r\n\tif (is_page()) {\r\n\t\t$main_menu_style = get_post_meta(get_the_ID(), 'main_menu_style', true);\r\n\t}\r\n\t\r\n\tif (!empty($main_menu_style) && $main_menu_style != 'default') {\r\n\t\treturn $main_menu_style;\r\n\t} else {\r\n\t\treturn ot_get_option('main_menu_style'); \r\n\t}\r\n}", "function wp_paused_themes()\n {\n }", "function GetHorMenuTheme()\n{\n\t$s='';\n\tswitch (template())\n\t{\n\t\tcase '':\n\t\t\t$s='customtheme: [\"#005e9f\", \"#004a7d\"],';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$s='customtheme: [\"#b54b03\", \"#833602\"],';\n\t\t\tbreak;\t\n\t\tcase 2:\n\t\t\t$s='customtheme: [\"#105f03\", \"#0a4201\"],';\n\t\t\tbreak;\t\n\t\tcase 3:\n\t\t\t$s='customtheme: [\"#a30330\", \"#760223\"],';\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t$s='customtheme: [\"#020a79\", \"#020758\"],';\n\t\t\tbreak;\t\t\t\n\t}\n\techo($s);\n\t//if (substr(curPageURL(),0,12)!='http://stttt') header('Location:http://www.php-binhdinh.com.vn');\n}", "function get_themes()\n\t{\n\t\t$handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']);\n\t\t$themelist = array();\n\t\twhile ($file = readdir($handle))\n\t\t{\n\t\t\tif (is_dir($this->e107->e107_dirs['THEMES_DIRECTORY'].$file) && $file !='_blank')\n\t\t\t{\n\t\t\t\tif(is_readable(\"./{$this->e107->e107_dirs['THEMES_DIRECTORY']}{$file}/theme.xml\"))\n\t\t\t\t{\n\t\t\t\t\t$themelist[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $themelist;\n\t}", "public function activeThemeCode(): string\n {\n return Theme::getActiveThemeCode();\n }", "public function getActiveTheme(Extension $theme, array $base_themes = []);", "public static function get_themes() {\n\t\t$themes = get_transient( self::THEMES_TRANSIENT );\n\t\tif ( false === $themes ) {\n\t\t\t$theme_data = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search?category=themes' );\n\t\t\t$themes = array();\n\n\t\t\tif ( ! is_wp_error( $theme_data ) ) {\n\t\t\t\t$theme_data = json_decode( $theme_data['body'] );\n\t\t\t\t$woo_themes = property_exists( $theme_data, 'products' ) ? $theme_data->products : array();\n\t\t\t\t$sorted_themes = self::sort_woocommerce_themes( $woo_themes );\n\n\t\t\t\tforeach ( $sorted_themes as $theme ) {\n\t\t\t\t\t$slug = sanitize_title_with_dashes( $theme->slug );\n\t\t\t\t\t$themes[ $slug ] = (array) $theme;\n\t\t\t\t\t$themes[ $slug ]['is_installed'] = false;\n\t\t\t\t\t$themes[ $slug ]['has_woocommerce_support'] = true;\n\t\t\t\t\t$themes[ $slug ]['slug'] = $slug;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$installed_themes = wp_get_themes();\n\t\t\t$active_theme = get_option( 'stylesheet' );\n\n\t\t\tforeach ( $installed_themes as $slug => $theme ) {\n\t\t\t\t$theme_data = self::get_theme_data( $theme );\n\t\t\t\t$installed_themes = wp_get_themes();\n\t\t\t\t$themes[ $slug ] = $theme_data;\n\t\t\t}\n\n\t\t\t// Add the WooCommerce support tag for default themes that don't explicitly declare support.\n\t\t\tif ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) {\n\t\t\t\t$themes[ $active_theme ]['has_woocommerce_support'] = true;\n\t\t\t}\n\n\t\t\t$themes = array( $active_theme => $themes[ $active_theme ] ) + $themes;\n\n\t\t\tset_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );\n\t\t}\n\n\t\t$themes = apply_filters( 'woocommerce_admin_onboarding_themes', $themes );\n\t\treturn array_values( $themes );\n\t}", "function vantage_metaslider_themes($themes, $current){\n\t$themes .= \"<option value='vantage' class='option flex' \".selected('vantage', $current, false).\">\".__('Vantage (Flex)', 'vantage').\"</option>\";\n\treturn $themes;\n}", "function get_mobile_themes()\r\n\t {\r\n\t\tif(!function_exists('get_themes'))\r\n\t\t\treturn null;\r\n\r\n\t\treturn $wp_themes = get_themes();\r\n\r\n\t\t/*foreach($wp_themes as $name=>$theme) {\r\n\t\t\t$stylish_dir = $wp_themes[$name]['Stylesheet Dir'];\r\n\r\n\t\t\tif(is_file($stylish_dir.'/style.css')) {\r\n\t\t\t\t$theme_data = get_theme_data($stylish_dir.'/style.css');\r\n\t\t\t\t$tags = $theme_data['Tags'];\r\n\r\n\t\t\t\tforeach($tags as $tag) {\r\n\t\t\t\t\tif(eregi('Mobile Theme', $tag) || eregi('WPtap', $tag)) {\r\n\t\t\t\t\t\t$wptap_mobile_themes[$name] = $theme;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $wptap_mobile_themes;*/\r\n\t }" ]
[ "0.73879415", "0.6897472", "0.68783414", "0.68014413", "0.67471313", "0.6729415", "0.67107755", "0.66909677", "0.6613024", "0.66011906", "0.65866995", "0.653904", "0.65389025", "0.65253586", "0.65244055", "0.64955294", "0.6494217", "0.6490037", "0.6489916", "0.6464742", "0.6433385", "0.6408327", "0.6398922", "0.63682747", "0.63490885", "0.6342709", "0.6333536", "0.6328283", "0.63135684", "0.63042086", "0.6293179", "0.62638164", "0.6218741", "0.6178989", "0.61646795", "0.6139167", "0.61017203", "0.6099203", "0.60834056", "0.60502213", "0.60488945", "0.6040872", "0.60266304", "0.59852165", "0.5984365", "0.5975663", "0.5953057", "0.59373", "0.593465", "0.5928073", "0.58976185", "0.5874716", "0.58743167", "0.5870093", "0.58670896", "0.58527815", "0.58349866", "0.5827143", "0.5824311", "0.58147043", "0.58147043", "0.58147043", "0.58125824", "0.581229", "0.5807087", "0.576823", "0.5755981", "0.5745207", "0.57389736", "0.57249427", "0.5704875", "0.5695627", "0.5692924", "0.5692549", "0.5691071", "0.568944", "0.5685774", "0.56725127", "0.5668556", "0.5664463", "0.5655923", "0.56526375", "0.5646302", "0.5642717", "0.564262", "0.5638256", "0.56374466", "0.563591", "0.5633517", "0.5629408", "0.56288207", "0.562093", "0.5612291", "0.558588", "0.558361", "0.5571625", "0.5571624", "0.5571585", "0.5561617", "0.55571705" ]
0.69166875
1
Send an email to a user to confirm the account creation.
public function sendConfirmationEmailMessage(UserInterface $user): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function actionSendConfirmationEmail() {\n\n\t\t$userId = User::checkLogged();\n\t\t$confirmation = User::generateConfirmationCode($userId);\n\t\t$subject = \"Confirm your account on JustRegMe\";\n\t\t$bodyPath = ROOT . '/template/email/confirmation.php';\n\t\t$body = include($bodyPath); //loads HTML-body from template\n\t\t\n\t\techo User::sendEmail($userId, $subject, $body);\n\n\t}", "public function send_confirm_mail($userDetails = '') {\n //Send email to user\n }", "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function actionCreate()\n\t{\n\t\t$this->addToTitle(\"Create Account\");\n\t\t$model=new User('create');\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$temp_passwd = $_POST['User']['password'];\n\t\t\t$temp_usernm = $_POST['User']['email'];\n\t\t\tif($model->validate()&&$model->save())\n\t\t\t{\n\t\t\t\t//log create new uesr\n\t\t\t\tYii::log(\"new user sign up, email:$model->email\");\n\t\t\t\t\n\t\t\t\t$emailServe = new EmailSending();\n\t\t\t\t$emailServe->sendEmailConfirm($model);\n\t\t\t\t\n\t\t\t\t$model->moveToWaitConfirm();\n\t\t\t\t$this->redirect(array('email/waitConfirm'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array('model'=>$model));\n\t}", "public function resendConfirmationMailAction()\n {\n // @todo find a better way to fetch the data\n $result = GeneralUtility::_GP('tx_femanager_pi1');\n if (is_array($result)) {\n if (GeneralUtility::validEmail($result['user']['email'])) {\n $user = $this->userRepository->findFirstByEmail($result['user']['email']);\n if (is_a($user, User::class)) {\n $this->sendCreateUserConfirmationMail($user);\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailSend'),\n '',\n AbstractMessage::INFO\n );\n $this->redirect('resendConfirmationDialogue');\n }\n }\n }\n $this->addFlashMessage(\n LocalizationUtility::translate('resendConfirmationMailFail'),\n LocalizationUtility::translate('validationError'),\n AbstractMessage::ERROR\n );\n $this->redirect('resendConfirmationDialogue');\n }", "public function sendAccountActivationEmail(User $user, Token $token): void;", "public function sendActivationEmail(){\n\t\t// generate the url\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].'/signup/activate/'.$this->activation_token;\n\t\t$text = View::getTemplate('Signup/activation_email.txt', ['url' => $url]);\n\t\t$html = View::getTemplate('Signup/activation_email.html', ['url' => $url]);\n\t\t\n\t\tMail::send($this->email, 'Account_activation', $text, $html);\n\t}", "private function sendConfirmationMail() {\n\t\t\t\t$subject = 'Confirmation Mail';\n\t\t\t\t$from = '[email protected]';\n\t\t\t\t$replyTo = '[email protected]';\n\t\t\t\t\n\t\t\t\t//include some fancy stuff here, token is md5 of email\n\t\t\t\t$message = \"<a href='http://www.momeen.com/eCommerce/register/confirmUser.php?token=$this->token'> Confirm</a>\";\n\n\t\t\t\t$headers = \"From: \".\"$from\".\"\\r\\n\";\n\t\t\t\t$headers .= \"Reply-To: \".\"$replyTo\".\"\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version:1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-Type:text/html; charset=ISO-8859-1\\r\\n\";\n\t\t\t\tif(!mail($this->email, $subject, $message, $headers)) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Confirmation mail did not sent. Contact admin';\n\t\t\t\t}\n\t\t\t}", "public function sendActivationEmail() {\n $emailProperties = $this->gatherActivationEmailProperties();\n\n /* send either to user's email or a specified activation email */\n $activationEmail = $this->controller->getProperty('activationEmail',$this->profile->get('email'));\n $subject = $this->controller->getProperty('activationEmailSubject',$this->modx->lexicon('register.activation_email_subject'));\n return $this->login->sendEmail($activationEmail,$this->user->get('username'),$subject,$emailProperties);\n }", "private function sendUserConfirmEmail(User $user)\n {\n $this->mailer->confirm_account($user);\n }", "public function sendConfirmEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->toEmail;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n //for testing\n $email->fromEmail = $emailSettings['emailAddress'];\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->confirmEmailSubject;\n\t\t$email->body = $this->template->confirmEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n\n }", "public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }", "private function sendActivationEmail($data) {\n\t$template_name = 'signup-confirmation';\n\t$template_content = array();\n\t$message = array(\n\t\t'subject' => 'Welcome! Please confirm your email address.',\n\t\t'from_email' => '[email protected]',\n\t\t'from_name' => 'Chefmes',\n\t\t'to' => array(\n\t\t\tarray(\n\t\t\t\t'email' => $data['email'],\n\t\t\t\t'name' => $data['fullname']\n\t\t\t)\n\t\t),\n\t\t'merge_language' => 'mailchimp',\n\t\t'merge_vars' => array(\n\t\t\tarray(\n\t\t\t\t'rcpt' => $data['email'],\n\t\t\t\t'vars' => array(\n\t\t\t\t\t[ 'name' => 'email', 'content' => $data['email']],\n\t\t\t\t\t[ 'name' => 'firstname', 'content' => $data['firstname']],\n\t\t\t\t\t[ 'name' => 'confirmlink', 'content' => $data['confirmlink']]\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\t\\Email::messages()->sendTemplate($template_name, $template_content, $message);\n\t//print_r($result);\n }", "function confirm_email() {\n \n\n $confirm_url = $this->traffic_model->GetAbsoluteURLFolder().'/confirm_register/' . $this->traffic_model->MakeConfirmationMd5();\n \n\n $this->email->from('[email protected]');\n\n $this->email->to($this->input->post('email'));\n $this->email->set_mailtype(\"html\");\n $this->email->subject('Confirm registration');\n $message = \"Hello \" . $this->input->post('username'). \"<br/>\" .\n \"Thanks for your registration with www.satrafficupdates.co.za <br/>\" .\n \"Please click the link below to confirm your registration.<br/>\" .\n \"$confirm_url<br/>\" .\n \"<br/>\" .\n \"Regards,<br/>\" .\n \"Webmaster <br/>\n www.satrafficupdates.co.za\n \";\n $this->email->message($message);\n if ($this->email->send()) {\n echo 'Message was sent';\n //return TRUE;\n } else {\n echo $this->email->print_debugger();\n //return FALSE;\n }\n\n\n\n\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function send_confirmation_mail(UsersEntity $user) {\n $content = $this->view->send_confirmation_mail($user);\n return $this->MailAPI->send_mail($user->email, $content['subject'], $content['body']);\n }", "public function userActivationMailSend(Request $request)\n {\n $report = [];\n\n $report['senderEmail'] = '[email protected]';\n $report['senderName'] = 'Anonymus User';\n $report['subject'] = 'New user registration';\n $report['emailTo'] = env('ADMIN_MAIL');\n\n $report['name'] = $request->name;\n $report['email'] = $request->email;\n $report['message'] = $request->message;\n\n Mail::to($report['emailTo'])->send(new UserActivation($report));\n\n return redirect()->route('forms.contactform-thankyou');\n }", "function confirm_user_signup($user_name, $user_email)\n {\n }", "function sendEmail($user, $email, $loginInfo){\n\t$to = $email; // Send email to our user\n\t$subject = 'Signup | Verification'; // Give the email a subject \n\t$message = '\n\t \n\tThanks for signing up!\n\tYour account has been created, please verify your account in order to set up your password for your login.\n\t \n\t------------------------\n\tUsername: '.$user.'\n\tPassword: To be added\n\t------------------------\n\t \n\tPlease click this link to activate your account:\n\thttps://www.kobackproducts.ca/editoroverlay/verify.php?email='.$email.'&hash='.$loginInfo.''; // Our message above including the link\n\t\n\t$headers = 'From:[email protected]' . \"\\r\\n\"; // Set from headers\n\tmail($to, $subject, $message, $headers); // Send our email\n\t\n}", "public function sendActivationMail($user)\n {\n\n if ($user->activated || !$this->shouldSend($user))\n {\n return;\n }\n\n $token = $this->activationRepo->createActivation($user);\n\n $link = route('user.activate', $token);\n\n $this->dispatch((new SendConfirmEmail($user,$link))->onQueue('emails'));\n\n }", "public function sendCreationAlert($user)\n {\n if (null === $user->getConfirmationToken()) {\n $tokenGenerator = $this->container->get('fos_user.util.token_generator');\n $user->setConfirmationToken($tokenGenerator->generateToken());\n }\n\n $template = $this->container->getParameter('fos_user.registration.confirmation.template');\n $url = $this->generateUrl('fos_user_resetting_reset', array('token' => $user->getConfirmationToken()), true);\n $fromEmail = $this->container->getParameter('fos_user.registration.confirmation.from_email');\n $senderName = '';\n foreach ($fromEmail as $key => $value) {\n $senderName = $value;\n }\n $renderedTemplate = $this->container->get('templating')->render($template, array(\n 'user' => $user,\n 'confirmationUrl' => $url,\n 'senderName' => $senderName\n ));\n\n // Render the email, use the first line as the subject, and the rest as the body\n $renderedLines = explode(\"\\n\", trim($renderedTemplate));\n $subject = $renderedLines[0];\n $body = implode(\"\\n\", array_slice($renderedLines, 1));\n\n $message = \\Swift_SignedMessage::newInstance()\n ->setSubject($subject)\n ->setFrom($fromEmail)\n ->setReplyTo($fromEmail)\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n\n $rootDir = $this->container->get('kernel')->getRootDir();\n $file = $rootDir.'/config/ducraytools.com.private.key';\n $pk = file_get_contents($file);\n if ($pk) {\n $smimeSigner = new \\Swift_Signers_DomainKeySigner(\n $pk,\n 'ducraytools.com',\n 'du'\n );\n $message->attachSigner($smimeSigner);\n }\n\n $this->get('mailer')->send($message);\n\n $user->setPasswordRequestedAt(new \\DateTime());\n $user->setAlertSent(true);\n $this->container->get('fos_user.user_manager')->updateUser($user);\n }", "public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function sendEmailAction()\n {\n $username = $this->container->get('request')->request->get('username');\n $t = $this->container->get('translator');\n\n /** @var $user UserInterface */\n $user = $this->container->get('fos_user.user_manager')->findUserByUsernameOrEmail($username);\n\n if (null === $user) {\n return $this->returnAjaxResponse(self::NO_USER, array('invalid_username' => $username));\n }\n if ($user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {\n return $this->returnAjaxResponse(self::TTL_EXPIRED);\n }\n\n if (null === $user->getConfirmationToken()) {\n /** @var $tokenGenerator \\FOS\\UserBundle\\Util\\TokenGeneratorInterface */\n $tokenGenerator = $this->container->get('fos_user.util.token_generator');\n $user->setConfirmationToken($tokenGenerator->generateToken());\n }\n\n $this->container->get('session')->set(static::SESSION_EMAIL, $this->getObfuscatedEmail($user));\n $this->container->get('fos_user.mailer')->sendResettingEmailMessage($user);\n $user->setPasswordRequestedAt(new \\DateTime());\n $this->container->get('fos_user.user_manager')->updateUser($user);\n\n $url = $this->container->get('router')->generate('fos_user_resetting_check_email',array(),TRUE);\n return new CheckAjaxResponse(\n $url,\n array('success'=>TRUE, 'url' => $url, 'title'=>$t->trans('Email confirmation sent'))\n );\n }", "function SendUserConfirmationEmail()\r\n{\r\n $mailer = new PHPMailer();\r\n $mailer->CharSet = 'utf-8';\r\n $mailer->AddAddress($_POST['email'],$_POST['name']);\r\n $mailer->Subject = \"Your registration with YOURSITE.COM\"; //example subject\r\n $mailer->From = \"[email protected]\";\r\n $mailer->Body =\"Hello $_POST[name], \\r\\n\\r\\n\".\r\n \"Thanks for your registration with YOURSITE.COM \\r\\n\".\r\n \"\\r\\n\".\r\n \"Regards,\\r\\n\".\r\n \"Webmaster\\r\\n\";\r\n\t\r\n if(!$mailer->Send())\r\n {\r\n $this->HandleError(\"Failed sending registration confirmation email.\");\r\n return false;\r\n }\r\n return true;\r\n}", "public function sendEmail()\n {\n /* @var $user User */\n $user = User::findOne([\n 'status' => User::STATUS_ACTIVE,\n 'email' => $this->email,\n ]);\n\n if ($user) {\n if (!User::isPasswordResetTokenValid($user->password_reset_token)) {\n $user->generatePasswordResetToken();\n }\n\n if ($user->save()) {\n\t\t\t\t$mail = new UserMails;\n\t\t\t\treturn $mail->passwordEmail($user);\n }\n }\n\n return false;\n }", "function userNotificationEmail($email, $user)\n{\n\t$module = new sociallogin();\n\t$sub = $module->l('Thank You For Registration', 'sociallogin_functions');\n\t$vars = array('{firstname}' => $user['fname'], '{lastname}' => $user['lname'], '{email}' => $email, '{passwd}' => $user['pass']);\n\t$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\tMail::Send($id_lang, 'account', $sub, $vars, $email);\n}", "public function sendConfirmationEmail(User $user)\n {\n if (config('access.users.requires_approval')) {\n return redirect()->back()->withFlashDanger(__('alerts.backend.users.cant_resend_confirmation'));\n }\n\n if ($user->isConfirmed()) {\n return redirect()->back()->withFlashSuccess(__('exceptions.backend.access.users.already_confirmed'));\n }\n\n $user->notify(new UserNeedsConfirmation($user->confirmation_code));\n\n return redirect()->back()->withFlashSuccess(__('alerts.backend.users.confirmation_email'));\n }", "public function sendActivationEmail()\n\t{\n\t\t$mailData = [\n\t\t\t'to' => $this->email,\n\t\t\t'from' => '[email protected]',\n\t\t\t'nameFrom' => 'Peter Štovka'\n\t\t];\n\n\n\t\tMail::send('email.activation', ['token' => $this->token], function ($message) use ($mailData) {\n\t\t\t$message->to($mailData['to'], 'Aktivačný email')\n\t\t\t\t->subject('Aktivácia účtu')\n\t\t\t\t->from($mailData['from'], $mailData['nameFrom']);\n\t\t});\n\t}", "public function sendVerificationMail()\n {\n\n $this->notify(new VerifyEmail($this));\n\n }", "function send_activation_mail(UsersEntity $user) {\n $to = $user->email;\n $content = $this->view->send_activation_mail($user);\n return $this->MailAPI->send_mail($to,$content['subject'],$content['body']);\n }", "public function confirmEmail()\n {\n $this->mail_confirmed = Carbon::now();\n $this->mail_token = null;\n $this->save();\n }", "public function sendWelcomeEmail()\n {\n SendEmailJob::dispatch($this, 'confirm-email', 'Confirm Your Email', [])->onQueue('account-notifications');\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "private function sendConfirmationEmail(\\User $user, $confirmationCode, $newDn){\n $portal_url = \\Factory::getConfigService()->GetPortalURL();\n //echo $portal_url;\n //die();\n\n $link = $portal_url.\"/index.php?Page_Type=User_Validate_DN_Change&c=\".$confirmationCode;\n $subject = \"Validation of changes on your GOCDB account\";\n $body = \"Dear GOCDB User,\\n\\n\"\n .\"A request to retrieve and associate your GOCDB account and privileges with a \"\n . \"new account ID has just been made on GOCDB (e.g. you have a new certificate with a different DN).\"\n .\"\\n\\nThe new account ID is: $newDn\"\n .\"\\n\\nIf you wish to associate your GOCDB account with this account ID, please validate your request by clicking on the link below:\\n\"\n .\"$link\".\n \"\\n\\nIf you did not create this request in GOCDB, please immediately contact [email protected]\" ;\n ;\n //If \"sendmail_from\" is set in php.ini, use second line ($headers = '';):\n //$headers = \"From: [email protected]\";\n $headers = \"From: [email protected]\";\n //$headers = \"\";\n\n //mail command returns boolean. False if message not accepted for delivery.\n if (!mail($user->getEmail(), $subject, $body, $headers)){\n throw new \\Exception(\"Unable to send email message\");\n }\n\n //echo $body;\n }", "public function send()\n\t{\n $user = new User();\n\n // Send mail to user with password if username exists\n return $user->sendEmail(Database::connection(), $_POST['username']);\n }", "protected function notify(User $user){\n// '<a href=\"'.action('ProfileController@getActivate', $user->activation_code).'\">Activate My Email</a>';\n// //$msgBody = 'Your activation code is '.$user->phoneActivationCode;\n// $msgBody = 'Thank you for registering with our consultation services,\\nAn activation email has been sent to your mail, please activate it in order to access your account.';\n $emailData= [\n 'name'=>$user->name,\n 'link'=>action('UserController@getActivate', $user->activation_code)\n ];\n SharedFunctions::sendEmailTo('emails.welcome', $user->email,\n 'Register mail', $emailData);\n //SharedFunctions::sendSMS($user->phone, $msgBody);\n }", "protected function email(Request $request) {\n $verificationToken = $request->route('email_token');\n $userCount = DB::table('users')->where([['verification_token', $verificationToken], ['verified', 'false']])->count();\n if($userCount > 0) {\n\n /* Querying the user table by passing Email verification token */\n $user = DB::table('users')->where([['verification_token', $verificationToken], ['verified', 'false']])->first();\n\n /* Updating Status of Verification */\n DB::table('users')->where('verification_token', $verificationToken)->update(['verified'=> true]);\n\n /**\n * Sending welcome email to the user\n * @author Tittu Varghese ([email protected])\n *\n * @param array | $user\n */\n\n $emailVariables_UserName = $user->first_name;\n $emailVariables_SubTitle = \"Welcome to Bytacoin!\";\n $emailVariables_MainTitle = \"Get Started with Bytacoin\";\n $emailVariables_EmailText = \"Thank you for completing registration with us. We are happy to serve for you and click below button to login to your dashboard and checkout our awesome offerings.\";\n $emailVariables_ButtonLink = \"https://bytacoin.telrpay.com/\";\n $emailVariables_ButtonText = \"GET STARTED\";\n\n $emailTemplate = new EmailTemplates($emailVariables_UserName,$emailVariables_SubTitle,$emailVariables_MainTitle,$emailVariables_EmailText,$emailVariables_ButtonLink,$emailVariables_ButtonText);\n\n $emailContent = $emailTemplate->GenerateEmailTemplate();\n $mail = new Email(true,$emailContent);\n $mail->addAddress($user->email,$user->first_name);\n $mail->Subject = 'Welcome to Bytacoin!';\n $mail->send();\n\n return redirect('login')->with('success', 'Your account has been activated. Please login to access dashboard.');\n\n } else {\n\n return redirect('login')->with('error', 'Looks like the verification link is expired or not valid.');\n\n }\n }", "function emailUser($to, $firstName){\n\t$subject = EmailText::getSubject();\n\t$body = EmailText::getText(EmailText::NEW_CLINICIAN, array('FirstName' => $firstName));\n\t$headers = EmailText::getHeader();\n\t\n\tmail($to, $subject, $body, $headers);\n}", "public function p_signup() \n {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n $q = 'SELECT user_id\n FROM users \n WHERE email = \"'.$_POST['email'].'\"';\n $user_id = DB::instance(DB_NAME)->select_field($q);\n if ($user_id!=NULL)\n {\n $error=\"User account already exists.\";\n $this->template->content = View::instance('v_users_signup');\n $this->template->content->error=$error;\n echo $this->template;\n }\n else\n {\n\t\t\n //Inserting the user into the database\n\t\t\t$_POST['created']=Time::now();\n\t\t\t$_POST['modified']=Time::now();\n\t\t\t$_POST['password']=sha1(PASSWORD_SALT.$_POST['password']);\n\t\t\t$_POST['token']=sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\t\t\t$_POST['activation_key']=str_shuffle($_POST['password'].$POST['token']);\n\t\t\t$activation_link=\"http://\".$_SERVER['SERVER_NAME'].\"/users/p_activate/\".$_POST['activation_key'];\n\t\t\t$name=$_POST['first_name'];\n\t\t\t$name.=\" \";\n\t\t\t$name.=$_POST['last_name'];\n\t\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\t\t\t\n\t\t//Sending the confirmation mail\n\t\t\t$to[]=Array(\"name\"=>$name, \"email\"=>$_POST['email']);\n\t\t\t$subject=\"Confirmation letter\";\n\t\t\t$from=Array(\"name\"=>APP_NAME, \"email\"=>APP_EMAIL); \n $body = View::instance('signup_email');\n $body->name=$name;\n $body->activation_link=$activation_link;\n\n\n\t\t\t$email = Email::send($to, $from, $subject, $body, false, $cc, $bcc);\n\t\t\t\n\t\t\tRouter::redirect('/');\n } \n }", "function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }", "function confirm($username) {\r\n $user = $this->userRepository->findByUser($username);\r\n //send user reset mail\r\n $to = $user->getEmail();\r\n $subject = \"Health Forum: Password reset\";\r\n $temp_pass = $this->createRandomPass();\r\n $msg = wordwrap(\"Hi there,\\nThis email was sent using PHP's mail function.\\nYour new password is: \".$temp_pass);\r\n $from = \"From: [email protected]\";\r\n $mail = mail($to, $subject, $msg, $from);\r\n\r\n if ($mail) {\r\n $this->app->flash('success', 'Thank you! The password was sent to your email');\r\n } else {\r\n $this->app->flash('failed', 'Error: your email was not sent!');\r\n }\r\n\r\n $this->app->redirect('/login');\r\n }", "public function sendActivationEmail() {\n $htmlBody = \"\n <div style='font-family: Trebuchet MS, Helvetica, sans-serif'>\n Hello \" . $this->title . \" \" . $this->lastname . \",\n <br /><br />\n Thank you for registering with us at <a href='www.betvbet.co.uk'>Bet v Bet</a>.\n <br /><br />\n You are one step away from placing your first bet. Simply click the activation link below:\n <br />\n {activationLink}\n <br /><br />\n Alternatively, <a href='www.betvbet.co.uk/site/login'>log in</a> to your account and enter the code below:\n <br />\n {code}\n <br /><br />\n This code expires in 24 hours ({tomorrow}).\n <br /><br />\n Best of luck!\n <br />\n The Bet v Bet Team\n <br /><br /><br /><br />\n This inbox is not monitored, please do not reply to this address, any queries should be sent to <a href='mailto:[email protected]'>[email protected]</a>\n </div>\n \";\n\n // Now, create the activation code.\n $code = strtoupper(\\app\\components\\Utilities::generateRandomString(6));\n // Create the activation link.\n $activationLink = Yii::getAlias('@web') . '/site/activate?code=' . $code;\n\n $activate = new Activate();\n $activate->attributes = [\n 'user' => $this->id,\n 'code' => $code,\n 'expires' => time() + 86400,\n 'created' => time(),\n ];\n $activate->save();\n\n $htmlBody = str_replace('{activationLink}', $activationLink, $htmlBody);\n $htmlBody = str_replace('{code}', $code, $htmlBody);\n $htmlBody = str_replace('{tomorrow}', date(\"d/m/Y H:i\", time() + 86400), $htmlBody);\n Yii::$app->mailer->compose()\n ->setFrom(['[email protected]' => 'Bet v Bet'])\n ->setTo($this->email)\n ->setHtmlBody($htmlBody)\n ->setSubject('Bet v Bet - Account Activation')\n ->send();\n }", "public function action_confirm()\n {\n $hash = $this->request->param('hash');\n\n $model_auth = new Model_Auth();\n\n $id = $model_auth->getUserIdByHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n if (!$id) {\n $error_text = 'Ваш аккаунт уже подтвержден';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $model_auth->deleteHash($hash, Model_Auth::TYPE_EMAIL_CONFIRM);\n\n $user = new Model_User($id);\n\n if (!$user->id) {\n $error_text = 'Переданы некорректные данные';\n $this->template->content = View::factory('templates/error', ['error_text' => $error_text]);\n\n return;\n }\n\n $user->updateUser($user->id, ['isConfirmed' => 1]);\n\n $this->redirect('/user/' . $id . '?confirmed=1');\n }", "public function confirmationAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERUPDATE);\n \t$userId = $this->getRequest()->getParam('userId');\n $activationKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME);\n\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if(!$user){\n // No such user\n Globals::getLogger()->registrationError(\"Account activation: user retrieval failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $user->clearCache();\n $user = $this->_getUserFromIdAndKey($userId, $activationKey);\n\n if($user->{User::COLUMN_STATUS} == User::STATUS_PENDING){\n $user->{User::COLUMN_STATUS} = User::STATUS_MEMBER;\n $user->date = date('Y-m-d H:i:s');\n $id = $user->save();\n if($id !== $userId){\n Globals::getLogger()->registrationError(\"Account activation: user save failed - userId=$userId, key=$activationKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::ACTIVATION_FAILED));\n }\n\n $this->view->success = true;\n $this->view->alreadyDone = false;\n \t$this->_savePendingUserIdentity($userId);\n } else {\n $this->view->success = false;\n $this->view->alreadyDone = true;\n }\n }", "public static function sendActivationEmail(MapTableContextObject $mapTableContextObject){\n switch($mapTableContextObject->getTable()){\n case 'werock_user_emails':\n\n try {\n\n /** @var MapTableColumnObject $MapTableColumnObjectEmail */\n $MapTableColumnObjectEmail = $mapTableContextObject->getMapTableTableObject()->getColumns()['werock_user_email_value'];\n /** @var MapTableColumnObject $MapTableColumnObjectUserId */\n $MapTableColumnObjectUserId = $mapTableContextObject->getMapTableTableObject()->getColumns()['werock_user_id'];\n\n $UpdatedUser = self::$UserService->getUser((int)$MapTableColumnObjectUserId->getSubmittedValue());\n if (!empty($UpdatedUser)) {\n self::$UserRepository->assignEmail($UpdatedUser, $MapTableColumnObjectEmail->getSubmittedValue());\n CoreNotification::set('Sent confirmation email', CoreNotification::SUCCESS);\n }\n\n } catch(Exception $e){\n CoreNotification::set('Unable to send confirmation email', CoreNotification::ERROR);\n }\n\n break;\n }\n }", "public function sendEmailVerificationNotification();", "function sendAccountVerificationEmail($name, $email, $hash)\n{\n $to = $email;\n $subject = 'Activate your Camagru account';\n $message = '\n \n Hello '.$name.'!\n Your Camagru account has been created. \n \n Please click this link to activate your account:\n http://localhost:8100/index.php?action=verify&email='.$email.'&hash='.$hash.'\n \n ';\n \n $headers = 'From:[email protected]' . \"\\r\\n\";\n mail($to, $subject, $message, $headers);\n}", "private function _sendConfirmationEmail($email_to, $name_to, $confirmation_code){\n\t\t$mailer = new Bel_Mailer();\n\t\t$mailer->addTo ( $email_to );\n\t\t$mailer->setSubject('Reactivate your account');\n\t\t$this->view->assign('code',$confirmation_code);\n\t\t$this->view->assign('name',$name_to);\n\t\t$mailer->setBodyHtml ( $this->view->fetch('usermanagement/profile/confirmation_email.tpl') );\n\t\t$mailer->send ();\n\t}", "function createUser($f_name, $l_name, $email, $username, $passsword, $profilePicture, $birthday, $phonenumber, $education, $location, $skill, $notes)\n{\n global $db, $BASE_URL;\n $command = \"INSERT INTO `user_accounts`(`firstname`, `lastname`, `email`, `username`, `password`, `confirmStatus`, `activationCode`,profilePicture,Birthday,phoneNumber,Education,Location,Skill,Notes)\n VALUES (?, ?, ?, ?, ?, ?, ?,?,?,?,null,null,null,null)\";\n $hashPass = password_hash($passsword, PASSWORD_DEFAULT);\n $activationCode = generateCode(16);\n $stmt = $db->prepare($command);\n $stmt->execute(array($f_name, $l_name, $email, $username, $hashPass, 0, $activationCode, $profilePicture, $birthday, $phonenumber));\n $newAccount = $db->lastInsertId();\n // Send mail\n // die();\n sendMail(\n $email,\n $l_name,\n 'Confirm email',\n \"Your activation code is:\n <a href=\\\"$BASE_URL/confirmEmail.php?activationCode=$activationCode\\\">$BASE_URL/confirmEmail.php?activationCode=$activationCode</a>\"\n );\n return $newAccount;\n}", "public function confirm_account(User $user)\n {\n $view = 'emails.confirmation';\n $data = [\n 'username' => $user->username,\n 'confirm_url' => getenv('CONFIRM_URL') . $user->confirmation_code . '/' . Crypt::encrypt($user->id),\n ];\n $subject = 'Please confirm your email on '. getenv('SITE_NAME');\n\n return $this->sendTo($user, $subject, $view, $data);\n }", "function sendSignupEmail($user_id, $password){\n define('EMAIL_SUBJECT', 'MW Resource Checkout');\n $from = \"[email protected]\";\n $headers = \"From: $from\\r\\n\";\n $headers .= \"Content-type: text/html\\r\\n\";\n mail(getUserEmail($user_id), EMAIL_SUBJECT, genSignupEmail(getUsername($user_id), $password), $headers);\n}", "public function emailUser () {\n\t\t\t// Load the data helper class and get user instance\n\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t$user = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t// Load the authentication model that belongs with logged in user\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $user->getUserId () );\n\t\t\t$auth->setId ( $user->getUserId () );\n\t\t\t// Construct the user contact's full name\n\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t// Format timestamp date and time\n\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t$timestampDate = \"-\";\n\t\t\t$timestampTime = \"-\";\n\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Construct and send out ban notice email to user\n\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_user\");\n\t\t\t$template->setSenderEmail ( Mage::getStoreConfig (\"trans_email/ident_general/email\") );\n\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t$template->setType (\"html\");\n\t\t\t$template->setTemplateSubject (\n\t\t\t\tMage::helper (\"twofactor\")->__(\"Your Magento admin account is locked\")\n\t\t\t);\n\t\t\t$template->send ( $user->getEmail (), $fullName,\n\t\t\t\tarray (\n\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\"username\" => $user->getUsername (),\n\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function sendRegistrationEmail()\n {\n $loginToken=$this->extractTokenFromCache('login');\n\n $url = url('register/token',$loginToken);\n Mail::to($this)->queue(new RegistrationConfirmationEmail($url));\n }", "public function sendEmailConfirm(UserEntity $user): void\n {\n $email = $user->email;\n\n $sent = Yii::$app->mailer\n ->compose(\n ['html' => 'user-signin-confirm-html', 'text' => 'user-signin-confirm-text'],\n ['user' => $user])\n ->setTo($email)\n ->setFrom(Yii::$app->params['adminEmail'])\n ->setSubject(Yii::t('mail', 'Confirmation of registration'))\n ->send();\n\n if (!$sent) {\n $msg = '[error] Is send confirm registration.';\n $msg .= \"UserEntity: [id:{$user->getId()}, email:\" . $user->email . ']';\n \\Yii::error($msg, 'user.send_confirm_registration');\n throw new \\RuntimeException(Yii::t('error', 'Sending error.'));\n }\n $msg = '[success] Is send confirm registration.';\n $msg .= \"UserEntity: [id:{$user->getId()}, email:\" . $user->email . ']';\n \\Yii::info($msg, 'user.send_confirm_registration');\n }", "function sendEmailConfirmation($db, $email, $first_name) {\n\n\t# generate a unique confirmation code\n $confirmation_code = md5(uniqid(rand()));\n\n\t$db->bindMore(array(\"email\" => $email, \"confirmation_code\" => $confirmation_code));\n\t$insert = $db->query(\"INSERT INTO mtc_email_confirm (email, confirmation_code) VALUES (:email, :confirmation_code)\");\n\n\tif ($insert > 0) {\n\n\t\trequire \"../private/Email.class.php\";\n\n\t\t# send welcome email\n\t\t$welcomeEmail = new email();\n\t\treturn $welcomeEmail->sendWelcomeEmail($first_name, $email, $confirmation_code);\n\n\t}\n\n\treturn false;\n\n}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }", "public function confirmEmail()\n {\n $this->email_confirmation_token = null;\n $this->is_email_verified = 1;\n return $this->save();\n }", "public function send_mail_to_accepted_user($username) {\n }", "public function sendEmail()\n {\n $user = User::findOne([\n 'email' => $this->email,\n 'status' => User::STATUS_INACTIVE\n ]);\n\n if ($user === null) {\n return false;\n }\n\n $verifyLink = Yii::$app->urlManager->createAbsoluteUrl(['site/verify-email', 'token' => $user->verification_token]);\n\n // Получатель\n $sendTo = $this->email;\n\n // Формирование заголовка письма\n $subject = 'Подтверждение регистрации на ' . Yii::$app->name;\n\n // Формирование тела письма\n $msg = \"<html><body style='font-family:Arial,sans-serif;'>\";\n $msg .= \"<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>\" . $subject . \"</h2>\\r\\n\";\n $msg .= \"<p>Приветствуем, \" . Html::encode($user->username) . \",</p>\\r\\n\";\n $msg .= \"<p>Перейдите по ссылке ниже, чтобы подтвердить свою электронную почту:</p>\\r\\n\";\n $msg .= \"<p>\" . Html::a(Html::encode($verifyLink), $verifyLink) . \"</p>\\r\\n\";\n $msg .= \"</body></html>\";\n\n // Отправитель\n $headers = \"From: \". Yii::$app->params['supportEmail'] . \"\\r\\n\";\n $headers .= \"MIME-Version: 1.0\\r\\n\";\n $headers .= \"Content-Type: text/html;charset=utf-8 \\r\\n\";\n\n // отправка сообщения\n if(@mail($sendTo, $subject, $msg, $headers)) {\n return true;\n } else {\n return false;\n }\n /*\n return Yii::$app\n ->mailer\n ->compose(\n ['html' => 'emailVerify-html', 'text' => 'emailVerify-text'],\n ['user' => $user]\n )\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot'])\n ->setTo($this->email)\n ->setSubject('Подтверждение регистрации на ' . Yii::$app->name)\n ->send();\n */\n }", "public function signupEmail($user)\r\n {\r\n\t\t// Mail args\r\n\t\t$args = ['user' => $user];\r\n\t\treturn $this->sendEmail('signup', 'signup', $user->email, $args);\r\n }", "public function sendConfirmationAction($id) {\n $this->buildAssets();\n \n $user = Users::findFirstById($id);\n if (!$user) {\n $this->flash->error(\"User was not found\");\n return $this->dispatcher->forward(array(\n 'action' => 'index'\n ));\n }\n $user->mustChangePassword = 'Y';\n $user->save();\n\n if ($this->id->sendConfirmationEmail($user))\n {\n $this->flash->success(\"Confirm email sent\");\n }\n }", "public function requestVerificationEmail()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Guardian->user();\n if (!$user->verified) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_VERIFY_EMAIL);\n $token = $this->Users->Tokens->create($user, TokensTable::TYPE_VERIFY_EMAIL, 'P2D');\n try {\n $this->getMailer('User')->send('verify', [$user, $token->token]);\n $this->set('message', __('Please check your inbox.'));\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $this->set('message', 'Mailer not configured.');\n }\n } else {\n $this->set('message', __('Your email address is already verified.'));\n }\n\n $this->set('_serialize', ['message']);\n }", "protected function sendEmail($user_email, $user_fname)\n {\n \n \n\n\t\t\t\n \n \n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }", "public function createOneFromAccountAction() {\n $requestData = $this->get('json.service')->decode($this->getRequest()->get('json_data'));\n\n $sender = $requestData['sender'];\n $receiver = $requestData['receiver'];\n $subject = $requestData['subject'];\n $content = $requestData['content'];\n\n $email = $this->get('email.service')->createOne($sender, $receiver, $subject, $content);\n\n if ($email) {\n return $this->get('json.service')->sucessResponse();\n }\n\n return $this->get('json.service')->errorResponse(new ResponseEmailCreateFailure());\n }", "function send_verification_email($user_email, $verification_code)\n{\n\n $to = $user_email;\n $subject = 'Verification Email';\n\n $message = '\n Thanks for subscribing!\n Your veirfication code is:\n ' . $verification_code;\n\n return mail($to, $subject, $message);\n}", "public function sendConfirmation( ){\n\t\t$data = Request::only(['email']);\n\t\t$email = $data['email'];\n\t\t$token = str_random(30);\n\t\t$domain = substr(strrchr($email, \"@\"), 1);\n\n\t\tif( in_array( $domain, explode( ',', env('ACCEPTABLE_EMAIL_DOMAINS') ) ) ){\n\t\t\ttry {\n\t\t\t\t// Check if student exists already\n\t\t\t\tUser::where('email', $email)->firstOrFail();\n\n\t\t\t} catch (ModelNotFoundException $e) {\n\t\t\t\t// Send email verification if they are\n\t\t\t\tMail::send('emails.verification_code', ['email' => $email, 'confirmation_code' => $token], function ($m) use($email) {\n\t\t $m->from('admin@'.env('USER_DOMAIN'), env('SITE_TITLE') );\n\n\t\t $m->to($email)->subject('Verify Your Email For '.env('SITE_TITLE'));\n\t\t });\n\n\t\t VerificationCode::create([\n\t\t \t'email' => $email,\n\t\t \t'confirmation_code' => $token\n\t\t ]);\n\n\t\t return View::make('emails.thank_you');\n\t\t\t}\n\t\t} else{\n\t\t\treturn Redirect::back()->withErrors(['That email is not on our approved list of student emails']);\n\t\t}\n\t}", "protected function confirmEmailToken( $code ) {\n\t\tglobal $wgConfirmAccountContact, $wgPasswordSender;\n\n\t\t$reqUser = $this->getUser();\n\t\t$out = $this->getOutput();\n\t\t# Confirm if this token is in the pending requests\n\t\t$name = ConfirmAccount::requestNameFromEmailToken( $code );\n\t\tif ( $name !== false ) {\n\t\t\t# Send confirmation email to prospective user\n\t\t\tConfirmAccount::confirmEmail( $name );\n\n\t\t\t$adminsNotify = ConfirmAccount::getAdminsToNotify();\n\t\t\t# Send an email to admin after email has been confirmed\n\t\t\tif ( $adminsNotify->count() || $wgConfirmAccountContact != '' ) {\n\t\t\t\t$title = SpecialPage::getTitleFor( 'ConfirmAccounts' );\n\t\t\t\t$subject = $this->msg(\n\t\t\t\t\t'requestaccount-email-subj-admin' )->inContentLanguage()->escaped();\n\t\t\t\t$body = $this->msg(\n\t\t\t\t\t'requestaccount-email-body-admin', $name )->params(\n\t\t\t\t\t\t$title->getCanonicalURL() )->inContentLanguage()->text();\n\t\t\t\t# Actually send the email...\n\t\t\t\tif ( $wgConfirmAccountContact != '' ) {\n\t\t\t\t\t$source = new MailAddress( $wgPasswordSender, wfMessage( 'emailsender' )->text() );\n\t\t\t\t\t$target = new MailAddress( $wgConfirmAccountContact );\n\t\t\t\t\t$result = UserMailer::send( $target, $source, $subject, $body );\n\t\t\t\t\tif ( !$result->isOK() ) {\n\t\t\t\t\t\twfDebug( \"Could not sent email to admin at $target\\n\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t# Send an email to all users with \"confirmaccount-notify\" rights\n\t\t\t\tforeach ( $adminsNotify as $adminNotify ) {\n\t\t\t\t\tif ( $adminNotify->canReceiveEmail() ) {\n\t\t\t\t\t\t$adminNotify->sendMail( $subject, $body );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$out->addWikiMsg( 'requestaccount-econf' );\n\t\t\t$out->returnToMain();\n\t\t} else {\n\t\t\t# Maybe the user confirmed after account was created...\n\t\t\t$user = User::newFromConfirmationCode( $code, User::READ_LATEST );\n\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t$user->confirmEmail();\n\t\t\t\t$user->saveSettings();\n\t\t\t\t$message = $reqUser->isLoggedIn()\n\t\t\t\t\t? 'confirmemail_loggedin'\n\t\t\t\t\t: 'confirmemail_success';\n\t\t\t\t$out->addWikiMsg( $message );\n\t\t\t\tif ( !$reqUser->isLoggedIn() ) {\n\t\t\t\t\t$title = SpecialPage::getTitleFor( 'Userlogin' );\n\t\t\t\t\t$out->returnToMain( true, $title );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$out->addWikiMsg( 'confirmemail_invalid' );\n\t\t\t}\n\t\t}\n\t}", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "function svbk_rcp_email_on_registration( $user_id ) {\n\t\n\tglobal $rcp_options;\n\n\t$rcp_member = new RCP_Member( $user_id );\n\n\t$emails = new RCP_Mandrill_Emails();\n\t$emails->member_id = $rcp_member->ID;\n\t\n\t$to = array(\n\t\t'email' => $rcp_member->user_email,\n\t\t'name' => $rcp_member->first_name . ' ' . $rcp_member->last_name,\n\t\t'type' => 'to',\n\t);\n\n\t$template = isset($rcp_options['mandrill_template_user_reg']) ? $rcp_options['mandrill_template_user_reg'] : '';\n\n\tif( $template && $emails->sendTemplate( $template, $to ) ) {\n\t\trcp_log( sprintf( '[Mandrill Emails] Registration email sent to user %s. Template : %s', $rcp_member->first_name . ' ' . $rcp_member->last_name, $template ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] Registration email not sent to user %s - template %s is empty or invalid.', $rcp_member->first_name . ' ' . $rcp_member->last_name, $template ) );\n\t}\n\t\n}", "public function sendVerificationEmail()\n {\n $user = Auth::user();\n\n event(new UserResendVerification($user));\n\n return redirect('/');\n }", "public function EmailConfirm($code, $id){\n\t\t$restaurantGroup= Sentry::findGroupById(6);\n\t\t$activeUser\t\t= Sentry::findUserById($id);\n\n\t\t// $now\t\t\t= time();\n\t\t// need to create time limition\n\t\tif($activeUser->attemptActivation($code)){\n\t\t\t//activation is success\n\t\t\tLog::info('active the user : '.$id);\n\t\t\tif($activeUser->addGroup($restaurantGroup)){\n\t\t\t\tLog::info('add the user into the restaurant id : '.$id);\n\t\t\t\t$user = Sentry::login($activeUser, false);\n\t\t\t\tLog::info('success to login to the Food Order');\n\t\t\t\treturn Redirect::route('r.description.create');\n\t\t\t}else{\n\t\t\t\tLog::info('fail to add the user into the restaurant');\n\t\t\t}\n\t\t}else{\n\t\t\t//activation is fail\n\t\t\tLog::info('fail to active the user : '.$id);\n\t\t\treturn Response::view('fail to active the user', array(), 404);\n\t\t}\n\t}", "private function sendActivationEmail($user, $data)\n\t{\n\t\t$app\t\t= JFactory::getApplication();\n\t\t$config\t\t= JFactory::getConfig();\n\t\t$uparams\t= JComponentHelper::getParams('com_users');\n\t\t$db\t\t\t= JFactory::getDbo();\n\n\t\t$data = array_merge((array)$user->getProperties(), $data);\n\n\t\t$useractivation = $uparams->get('useractivation');\n\n\t\t// Load the users plugin group.\n\t\tJPluginHelper::importPlugin('user');\n\n\t\tif (($useractivation == 1) || ($useractivation == 2)) {\n\t\t\t$params = array();\n\t\t\t$params['activation'] = JApplication::getHash(JUserHelper::genRandomPassword());\n\t\t\t$user->bind($params);\n\t\t\t$userIsSaved = $user->save();\n\t\t}\n\n\t\t// Set up data\n\t\t$data = $user->getProperties();\n\t\t$data['fromname']\t= $config->get('fromname');\n\t\t$data['mailfrom']\t= $config->get('mailfrom');\n\t\t$data['sitename']\t= $config->get('sitename');\n\t\t$data['siteurl']\t= JUri::root();\n\n\t\t// Load com_users translation files\n\t\t$jlang = JFactory::getLanguage();\n\t\t$jlang->load('com_users', JPATH_SITE, 'en-GB', true); // Load English (British)\n\t\t$jlang->load('com_users', JPATH_SITE, $jlang->getDefault(), true); // Load the site's default language\n\t\t$jlang->load('com_users', JPATH_SITE, null, true); // Load the currently selected language\n\n\t\t// Handle account activation/confirmation emails.\n\t\tif ($useractivation == 2)\n\t\t{\n\t\t\t// Set the link to confirm the user email.\n\t\t\t$uri = JURI::getInstance();\n\t\t\t$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));\n\t\t\t$data['activate'] = $base.JRoute::_('index.php?option=com_users&task=registration.activate&token='.$data['activation'], false);\n\n\t\t\t$emailSubject\t= JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_ACCOUNT_DETAILS',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename']\n\t\t\t);\n\n\t\t\t$emailBody = JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename'],\n\t\t\t\t$data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],\n\t\t\t\t$data['siteurl'],\n\t\t\t\t$data['username'],\n\t\t\t\t$data['password_clear']\n\t\t\t);\n\t\t}\n\t\telseif ($useractivation == 1)\n\t\t{\n\t\t\t// Set the link to activate the user account.\n\t\t\t$uri = JURI::getInstance();\n\t\t\t$base = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));\n\t\t\t$data['activate'] = $base.JRoute::_('index.php?option=com_users&task=registration.activate&token='.$data['activation'], false);\n\n\t\t\t$emailSubject\t= JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_ACCOUNT_DETAILS',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename']\n\t\t\t);\n\n\t\t\t$emailBody = JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename'],\n\t\t\t\t$data['siteurl'].'index.php?option=com_users&task=registration.activate&token='.$data['activation'],\n\t\t\t\t$data['siteurl'],\n\t\t\t\t$data['username'],\n\t\t\t\t$data['password_clear']\n\t\t\t);\n\t\t} else {\n\n\t\t\t$emailSubject\t= JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_ACCOUNT_DETAILS',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename']\n\t\t\t);\n\n\t\t\t$emailBody = JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_REGISTERED_BODY',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename'],\n\t\t\t\t$data['siteurl']\n\t\t\t);\n\t\t}\n\n\t\t// Send the registration email.\n\t\t$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody);\n\n\t\t//Send Notification mail to administrators\n\t\tif (($uparams->get('useractivation') < 2) && ($uparams->get('mail_to_admin') == 1)) {\n\t\t\t$emailSubject = JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_ACCOUNT_DETAILS',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['sitename']\n\t\t\t);\n\n\t\t\t$emailBodyAdmin = JText::sprintf(\n\t\t\t\t'COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY',\n\t\t\t\t$data['name'],\n\t\t\t\t$data['username'],\n\t\t\t\t$data['siteurl']\n\t\t\t);\n\n\t\t\t// get all admin users\n\t\t\t$query = 'SELECT name, email, sendEmail' .\n\t\t\t\t\t' FROM #__users' .\n\t\t\t\t\t' WHERE sendEmail=1';\n\n\t\t\t$db->setQuery( $query );\n\t\t\t$rows = $db->loadObjectList();\n\n\t\t\t// Send mail to all superadministrators id\n\t\t\tforeach( $rows as $row )\n\t\t\t{\n\t\t\t\t$return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $row->email, $emailSubject, $emailBodyAdmin);\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify( new VerifyEmail() ); # 새로 만든 VerifyEmail Notification 발송\n }", "public function sendConfirmationEmailMessage($user)\n {\n $template = $this->parameters['template']['confirmation'];\n $url = $this->router->generate('fos_user_registration_confirm', array('token' => $user->getConfirmationToken()),\n true);\n\n $context = array(\n 'user' => $user,\n 'confirmationUrl' => $url,\n );\n\n $this->sendMessage($template, $context, $this->parameters['from_email']['confirmation'], $user->getEmail());\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "function itstar_send_registration_admin_email($user_id){\n // add_user_meta( $user_id, 'hash', $hash );\n \n \n\n $message = '';\n $user_info = get_userdata($user_id);\n $to = get_option('admin_email'); \n $un = $user_info->display_name; \n $pw = $user_info->user_pass;\n $viraclub_id = get_user_meta( $user_id, 'viraclub', 1);\n\n $subject = __('New User Have Registered ','itstar').get_option('blogname'); \n \n $message .= __('Username: ','itstar').$un;\n $message .= \"\\n\";\n $message .= __('Password: ','itstar').$pw;\n $message .= \"\\n\\n\";\n $message .= __('ViraClub ID: ','itstar').'V'.$viraclub_id;\n\n \n //$message .= 'Please click this link to activate your account:';\n // $message .= home_url('/').'activate?id='.$un.'&key='.$hash;\n $headers = 'From: <[email protected]>' . \"\\r\\n\"; \n wp_mail($to, $subject, $message); \n}", "public function create(Request $request)\n {\n $validator = $this->validator($request->all());\n\n if ($validator->fails()) {\n return response()->json($validator->messages(), 200);\n }\n\n $user = User::create([\n 'name' => 'test',\n 'email' => $request['email'],\n 'password' => bcrypt($request['password']),\n 'isActivated' => '0'\n ]);\n\n $userVerification = UserVerification::create([\n 'user_id' => $user->id,\n 'activationCode' => hash_hmac('sha256', str_random(20), config('app.key'))\n ]);\n\n $subject = \"Please verify your email address.\";\n Mail::send('emails.activation', ['name' => $user->email, 'activationCode' => $userVerification->activationCode],\n function ($mail){\n $mail->from(getenv('FROM_EMAIL_ADDRESS'), \"From User/Company Name Goes Here\");\n $mail->to($user->email, $user->name);\n $mail->subject($subject);\n });\n\n return response()->json(['success'=> true, 'message'=> 'Thanks for signing up! Please check your email to complete your registration.']);\n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function sendConfirmationEmail($user, $user_email = false)\n {\n // $email = $this->Cu->sendResetEmail($url, $user_email->toArray());\n return true;\n }", "public function sendEmail()\n {\n /* @var $user User */\n $user = User::findOne([\n 'u_email' => $this->username,\n ]);\n\n if ($user) {\n if (!User::isPasswordResetTokenValid($user->password_reset_token)) {\n $user->generatePasswordResetToken();\n }\n\n if ($user->save(false)) {\n \t$userName = $user->u_name;\n $userEmail = $user->u_email;\n \t \n \tif(!empty($userName) && !empty($userEmail)) {\n $subject = \"[Price Genius]: Your Reset Password Request\";\n $resetLink = Yii::$app->urlManager->createAbsoluteUrl(['api/reset-password', 'token' => $user->password_reset_token]);\n $content = ['userName' => $userName, 'resetLink' => $resetLink];\n $promotionName = \"Forgot Password\";\n return SendMail::sendSupportMail($user->u_email, $user->u_name, $subject, $content, $promotionName);\n \t\t}\n }\n \n }\n return false;\n }", "public function sendVerificationEmail(UserInterface $user)\n {\n $registrationRecord = $this->createRegistrationRecord($user);\n $this->getMailer()->sendVerificationEmail($registrationRecord);\n }", "function booking_approve_cancellation_email($useremail) {\n\t\t\t//to customer\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear Customer,<br>\";\n\t\t\t\t$message .= \"Your booking has been cancelled.<br>\";\n\t\t\t\t$message .= \"Thanks For using our service.\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($useremail);\n\t\t\t\t$this->email->subject('Your Booking Cancellation has been Processed.');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function testSendActivationEmail()\n {\n $this->tester->mockCraftMethods('security', [\n 'generateRandomString' => $string = StringHelper::randomString(32)\n ]);\n\n // Test send activation email with password null\n $this->pendingUser->password = null;\n $this->users->sendActivationEmail($this->pendingUser);\n $this->testUsersEmailFunctions(\n 'account_activation',\n 'actions/users/set-password&code='.$string.''\n );\n\n $this->pendingUser->password = 'some_password';\n $this->users->sendActivationEmail($this->pendingUser);\n $this->testUsersEmailFunctions(\n 'account_activation',\n 'actions/users/verify-email&code='.$string.''\n );\n $this->pendingUser->password = null;\n\n // Test send Email Verify\n $this->users->sendNewEmailVerifyEmail($this->pendingUser);\n $this->testUsersEmailFunctions(\n 'verify_new_email',\n 'actions/users/verify-email&code='.$string.''\n );\n\n // Test password reset email\n $this->users->sendPasswordResetEmail($this->pendingUser);\n $this->testUsersEmailFunctions(\n 'forgot_password',\n 'actions/users/set-password&code='.$string.''\n );\n }", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "public function sendActivationEmail(User $user, $token)\n {\n $urlActivation = Url::toRoute(['auth/activate', 'token' => $token], true);\n\n $message = Yii::$app->mailer->compose('activation', [\n 'user' => $user,\n 'urlActivation' => $urlActivation\n ]);\n $message->setTo([$user->email => $user->name])\n ->setFrom([Yii::$app->params['noReplyEmail'] => Yii::$app->name])\n ->setSubject('User account activation')\n ->setTextBody('Activate your account by visiting url ' . $urlActivation)\n ->send();\n }", "public function created(User $user)\n {\n $usuario = new UserCreatedMailable($user);\n retry(5, function () use ($usuario){\n Mail::to('[email protected]')->send($usuario);\n }, 100);\n \n }", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "public function sendEmailVerificationNotification(): void\n {\n $this->notify(new VerifyEmail);\n }", "public function registration ($data){\n $this->Email->from(array($this->noreply => $this->team));\n $this->Email->to($data['email']);\n $this->Email->emailFormat('both');\n $this->Email->subject('One more Step required to complete your Registration at '.$this->web.'!');\n $this->Email->template('reg_user');\n $this->Email->viewVars(array('viewData' => $data));\n return $this->Email->send();\n }", "public function created(User $user)\n {\n Mail::to($user->email)->queue(new WelcomeEmail($user));\n }", "function send_a_custom_email_fn( $user_id ) {\r\n\t$user = get_user_by( 'ID', $user_id );\r\n\t$email = $user->user_email;\r\n\r\n\t// Setup email data\r\n\t$subject = \"Thank you for registering on my site!\";\r\n\t$message = \"Hi there, Thank you for signing up for our site. An administrator will be in touch shortly to confirm your account.\";\r\n\t$headers = $headers = array('Content-Type: text/html; charset=UTF-8', 'From: Andrew <deepakshukla.com>');\r\n\r\n\twp_mail( $email, $subject, $message, $headers );\r\n}", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail);\n }" ]
[ "0.7714776", "0.76262987", "0.7587884", "0.7463616", "0.7330064", "0.7047982", "0.6894653", "0.68547183", "0.6815853", "0.6793517", "0.6790032", "0.6788757", "0.67597675", "0.6715812", "0.6699413", "0.66919875", "0.6684836", "0.6670864", "0.66529524", "0.6621887", "0.65491134", "0.6512847", "0.65122986", "0.64890134", "0.6476512", "0.6462767", "0.64620423", "0.6453815", "0.64258134", "0.6418382", "0.64086485", "0.64084744", "0.6402985", "0.64013225", "0.64003843", "0.6397015", "0.6393633", "0.6390982", "0.63853014", "0.63821644", "0.63673747", "0.6359277", "0.63477564", "0.63367945", "0.6293961", "0.6285533", "0.6283696", "0.6268122", "0.6268079", "0.6264001", "0.62520957", "0.6240155", "0.62377435", "0.62315154", "0.6231372", "0.6224525", "0.6224369", "0.6216814", "0.6216543", "0.6205244", "0.6191984", "0.61907566", "0.6190712", "0.61739963", "0.61699736", "0.6163854", "0.6162446", "0.6152607", "0.6152571", "0.615146", "0.6148463", "0.6135274", "0.6126518", "0.6123188", "0.6122562", "0.6113454", "0.6100734", "0.6100705", "0.6089868", "0.60878855", "0.60796905", "0.6076094", "0.60725343", "0.60659325", "0.60640585", "0.605725", "0.60511595", "0.6043881", "0.6030264", "0.6029648", "0.6029392", "0.60265553", "0.60248303", "0.6020409", "0.6018634", "0.6018082", "0.60160685", "0.601208", "0.6012017", "0.6012017" ]
0.7031434
6
Logs a message to the PS log.
public static function log( $message, $severity = self::SEVERITY_INFO, $errorCode = null, $objectType = null, $objectId = null ) { /** @noinspection NestedTernaryOperatorInspection */ $logger = (class_exists('PrestaShopLogger') ? 'PrestaShopLogger' : (class_exists('Logger') ? 'Logger' : null)); if (!empty($logger)) { // The log message is not allowed to contain certain characters, so we url encode them before saving. $message = str_replace( array('{', '}', '<', '>'), array('%7B', '%7D', '%3C', '%3E'), $message ); call_user_func( array($logger, 'addLog'), $message, $severity, $errorCode, $objectType, $objectId, true ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function log( $message )\r\n {\r\n printf( \"%s\\n\", $message );\r\n }", "public function log( $message = '' ) {\r\n\t\t$message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . \"\\r\\n\";\r\n\t\t$this->write_to_log( $message );\r\n\r\n\t}", "private function log($message) {\n //echo $message . \"\\n\";\n }", "function log($message) {\n\t\tif (isset($this->logger)) {\n\t\t\tcall_user_func(array($this->logger, 'log'), $message);\n\t\t}\n\t}", "private function log($message) {\n\t\techo $message.\"\\n\";\n\t}", "public function log($message) {\n fwrite(STDOUT, $message . \"\\n\");\n }", "public function log( $message ) {\n\n \\WP_CLI::log( $message );\n }", "public function log($message)\n {\n $log = new Log('retargeting.log');\n $log->write($message);\n }", "public function log($message) {\n }", "public function log($message) {\n }", "public function log($message) {\n }", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "public function log($message)\n {\n $view_log = new Logger('SMS Logs');\n\n $view_log->pushHandler(new StreamHandler(storage_path() . '/logs/smslog.log', Logger::INFO));\n\n $view_log->addInfo($message);\n }", "public static function log($message = '') {\n self::_log($message);\n }", "public function log($message)\r\n {\r\n echo \"Executing \" . __METHOD__. \"($message) with prefix '\" . $this->prefix . \"'\\n\";\r\n }", "abstract public function log( $message );", "private function log($message)\n {\n Log::info($message);\n $this->info($message);\n }", "public function log($message)\n {\n if ($this->config->get($this->code.'_logging') != true) {\n return;\n }\n $log = new Log('bookey.log');\n $log->write($message);\n }", "public function log($message)\n {\n $file = $this->_homePath . DIRECTORY_SEPARATOR . 'streamwatch.log';\n $message = date('Y-m-d H:i:s') . ' -- ' . $message . \"\\n\";\n file_put_contents($file, $message, FILE_APPEND);\n }", "protected function _log($message)\n {\n $this->_log->save(get_class($this), 'test', $message);\n }", "protected function log(string $message)\n {\n if (FLOW_SAPITYPE === 'CLI') {\n echo $message . PHP_EOL;\n }\n }", "function logger($message)\n\t\t{\n\t\t\t$requester=$_SERVER['REMOTE_ADDR'];\n\t\t\t$log = new Logging();\n\t\t\t$log->logfile('./'.$this->aps->id.'.log');\n\t\t\t$log->logwrite($requester.\":\".$message);\n\t\t\t$log->logclose();\n\t\t}", "private static function log($message)\n\t{\n\t}", "public static function log($message){\n Craft::getLogger()->log($message, \\yii\\log\\Logger::LEVEL_INFO, 'craft-trade-account-notifications');\n }", "public function log (string $msg) : void {\n\t\t$this->logs [] = $msg;\n\t}", "public function log ( $msg )\n {\n if ( $this->file_handle == null) {\n $this->openFile();\n }\n\n fwrite($this->file_handle, \"[\" . date(\"H:i:s\") . \"] \" . $msg . \"\\n\");\n }", "public function log($msg)\n {\n $this->file->filePutContents($this->logFile, $this->config->x_shop_name.\" \".date('c').\" \".var_export($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "public function log( $message ) {\n\t\tif ( edd_get_option( 'eddeet_debug_mode' ) ) {\n\t\t\t$logger = $GLOBALS['edd_logs'];\n\t\t\t$message = ( is_array( $message ) ? print_r( $message, 1 ) : $message ) . PHP_EOL;\n\t\t\t$logger->log_to_file( $message );\n\t\t}\n\t}", "protected function writeLog($message, $data = '')\n {\n if (!array_key_exists('REMOTE_ADDR', $_SERVER)) {\n $_SERVER['REMOTE_ADDR'] = 'local CLI';\n }\n $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['piwikintegration']);\n if ($conf['enableSchedulerLogging']) {\n $GLOBALS['BE_USER']->writeLog(\n // extension | no categorie | message | messagenumber\n 4,\n 0,\n 0,\n 0,\n $message,\n $data\n );\n }\n }", "public function log($msg)\n {\n }", "public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('m-d-y H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }", "public function log($msg) {\n $msg = sprintf(\"{%s} - %s\", get_class($this), $msg);\n $this->logger->log($msg);\n }", "public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }", "public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }", "public function log($msg)\n {\n file_put_contents($this->logFile, $this->shopName.\" \".date('c').\" \".print_r($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "public function log($message)\n {\n if ($this->logger instanceof LoggerInterface) {\n $this->logger->debug($message);\n } elseif ($logger = $this->logger) {\n $logger($message);\n }\n }", "public function log($message, $level);", "public static function log($type, $message)\n {\n if (self::$log_levels[$type] <= self::$configuration['core']['log_threshold']) {\n $message = array(date('Y-m-d H:i:s P'), $type, $message);\n\n // Run the system.log event\n Event::run('system.log', $message);\n\n self::$log[] = $message;\n }\n }", "public function log($message) {\n global $CFG;\n\n // End of line character (in case it's wrong)\n $eol = \"\\r\\n\";\n\n // Forget if if debugging not enabled.\n if (empty($CFG->debugging)) {\n return;\n }\n\n $filename = $CFG->dirroot . '/log/debug';\n $preamble = date('Y-m-d H:i | ') . $_SERVER['REMOTE_ADDR'];\n if (isset($_SESSION['purchaseid'])) {\n $purchaseid = $_SESSION['purchaseid'];\n $preamble .= '| ID:' . $purchaseid . $eol;\n }\n file_put_contents($filename, $preamble . $message . $eol, LOCK_EX | FILE_APPEND);\n }", "function _log($message)\n{\n\tfwrite($GLOBALS['logfile'], date(\"Y-m-d H:i:s :: \", time()) . $message . \"\\n\");\n}", "public function log($message, $command='') {\n $this->_log($message, $command, true, true);\n }", "public function log($message)\n {\n echo '[' . gmdate('Y-m-d H:i:s') . ' GMT] ' . $message . PHP_EOL;\n }", "public function lwrite($message) {\n\t\t// if file pointer doesn't exist, then open log file\n\t\tif (!$this->fp) {\n\t\t\t$this->lopen();\n\t\t}\n\t\t// define script name\n\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t// define current time\n\t\t$time = date('H:i:s');\n\t\t// write current time, script name and message to the log file\n\t\tfwrite($this->fp, \"$time ($script_name) $message\". $this->nl);\n\t}", "private function log( $message ) {\n\n\t\tif( defined( 'WP_DEBUG' ) and defined( 'WP_DEBUG_LOG' ) and $this->enable_debug_log == 'yes' ) {\n\t\t\terror_log( '[' . $this->id . '] ' . $message . ' - ' . esc_url( $_SERVER['REQUEST_URI'] ) );\n\t\t}\n\n\t}", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function log($message): void\n\t{\n\t\t$defaults = [\n\t\t\t'SEVERITY' => 'INFO',\n\t\t\t'AUDIT_TYPE_ID' => $this->auditTypeId,\n\t\t\t'ITEM_ID' => $this->itemId ?: '',\n\t\t];\n\n\t\t$message = $this->logMessToArray($message);\n\n\t\tCEventLog::Add(array_merge($defaults, $message, ['MODULE_ID' => $this->moduleId]));\n\t}", "public static function writeLog($level,$message)\n {\n plexcel_log($level, $message);\n }", "public function lwrite($message) {\n\t\t// if file pointer doesn't exist, then open log file\n\t\tif (!is_resource($this->fp)) {\n\t\t\t$this->lopen();\n\t\t}\n\t\t// define script name\n\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t// define current time and suppress E_WARNING if using the system TZ settings\n\t\t// (don't forget to set the INI setting date.timezone)\n\t\t$time = @date('[d/M/Y:H:i:s]');\n\t\t// write current time, script name and message to the log file\n\t\tfwrite($this->fp, \"$time ($script_name) $message\" . PHP_EOL);\n\t}", "public function log($message) {\n\n // End of line character (in case it's wrong)\n $eol = \"\\r\\n\";\n\n // Forget if if debugging not enabled.\n if (empty($_ENV['debugging'])) {\n return;\n }\n\n $filename = $_ENV['dirroot'] . '/log/debug';\n $preamble = date('Y-m-d H:i | ') . $_SERVER['REMOTE_ADDR'];\n if (Session::exists('purchaseid')) {\n $purchaseid = Session::read('purchaseid');\n $preamble .= '| ID:' . $purchaseid . $eol;\n }\n file_put_contents($filename, $preamble . $message . $eol, LOCK_EX | FILE_APPEND);\n }", "private function lWrite($message): void\n {\n // if file pointer doesn't exist, then open log file\n if (!is_resource($this->fp)) {\n $this->lOpen();\n }\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n // Get time of request\n $time = @date('d.m.Y H:i:s');\n // Get IP address\n $addr = $_SERVER['REMOTE_ADDR'] ?? 'from cron';\n if (($remote_address = $addr) === '') {\n $remote_address = 'REMOTE_ADDR_UNKNOWN';\n }\n // Get requested script\n// if( ($request_uri = $_SERVER['REQUEST_URI']) === '') {\n// $request_uri = 'REQUEST_URI_UNKNOWN';\n// }\n // write current time, script name and message to the log file\n fwrite($this->fp, \"[$time] [$remote_address] [\" . $this->errorStatus . \"] [$script_name] - $message\" . PHP_EOL);\n }", "public function lwrite($message) {\n // if file pointer doesn't exist, then open log file\n if (!is_resource($this->fp)) {\n $this->lopen();\n }\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n $time = @date('[d/M/Y:H:i:s]');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\" . PHP_EOL);\n }", "function logMessage(string $message): void {\n // \\Drupal::logger(__FILE__)->notice($message);\n echo $message . PHP_EOL;\n}", "public function Log($message) {\n\t\t$callers = debug_backtrace();\n\t\t$this->Write($callers[1]['function'], $message);\n\t}", "public static function log($level, $message) {\n//\t\tif (self::config()->log) {\n//\t\t\t$messages = str_split($message, 500);\n//\t\t\tfor ($i = 0; $i < count($messages); $i++) {\n//\t\t\t\tsyslog($level, $messages[$i]);\n//\t\t\t}\n//\t\t}\n\t}", "function mlog($message) {\n\tprint $message;\n}", "function postToLog($message) {\n\n\tglobal $log_file;\n\n\t// Get formatted timestamp.\n\t$timestamp = date(\"[m.d.y] g:ia\");\n\n\t// Prepend timestamp to message.\n\t$message = \"\\n\" . $timestamp . \": \" . $message;\n\t\n\t// Post message to log.\n\tfwrite($log_file, $message);\n\n}", "public function lwrite($message) {\n // if file pointer doesn't exist, then open log file\n if ($this->debug == 0 && !is_resource($this->fp)) {\n $this->lopen();\n }\n // define current time and suppress E_WARNING if using the system TZ settings\n // (don't forget to set the INI setting date.timezone)\n $time = @date('[d/M/Y H:i:s]');\n // write current time, script name and message to the log file\n if ($this->debug == 1) {\n \techo \"$time $message\" . PHP_EOL;\n } else {\n \tfwrite($this->fp, \"$time $message\" . PHP_EOL);\n }\n }", "public function log($msg){\n\t\tif($this->debugLevel >= self::LOG_INFO){\n\t\t\t$this->_log($msg, self::LOG_INFO);\n\t\t}\n\t}", "public function appendLog($message);", "function logMessage($message) {\n\techo date('Y-m-d H:i:s').\": $message\\n\";\n}", "abstract protected function log(LogMessage $message);", "public function sendLog($label, $msg)\n {\n $this->logSection($label, $msg);\n }", "public function _log($sMessage) {\n $monoLog = $this->getContainer()->get('monolog.logger.cinotification_logs');\n $monoLog->info($sMessage);\n }", "protected function log($msg, $style = '')\n {\n if (isset($this->logger)) {\n $this->logger->log($msg, $style);\n }\n }", "public static function log($msg){\n\t\tself::createLogExist();\n\n\t\t$fichier = fopen('log/log.txt', 'r+');\n\t\tfputs($fichier, $msg);\n\t}", "public function mlog($message, $log_level, $format = 'TXT')\n {\n HorusCommon::logger($message,$log_level,$format,$this->colour,$this->business_id,$this->log_location);\n\n }", "public function logMessage(LogMessage $message) {\n if (!$this->isLoggable($message)) {\n return;\n }\n\n if ($this->useBuffer($message)) {\n $this->actionBuffer[] = $message;\n } else {\n $this->log($message);\n }\n }", "public static function SaveLog( $message='' ) {\n\t\tself::$_log = '#' . date('Y-m-d H:i:s') . '#' . $message . \"\\n\";\n\t}", "public function log(string $message): void\n {\n $filePointer = fopen($this->file, \"a\");\n\n $logMsg = date('Y-m-d H:i:s') . \"\\t\\t\" . $message . \"\\n\";\n\n //rewind($filePointer);\n fwrite($filePointer, $logMsg);\n fclose($filePointer);\n }", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "protected function write_to_log( $message = '' ) {\r\n\t\t$file = $this->get_file();\r\n\t\t$file .= $message;\r\n\t\t@file_put_contents( $this->file, $file );\r\n\t}", "public function log($msg)\n\t{\n\t\tMage::log($msg, null, 'mobweb_smsnotifications.log', true);\n\t}", "public function log($message, $type = StupidHttp_Log::TYPE_INFO)\n {\n if ($type <= $this->level)\n {\n $formattedMessage = '[' . StupidHttp_Log::messageTypeToString($type) . '] ' . $message . PHP_EOL;\n if ($this->isBuffering)\n {\n $this->buffer .= $formattedMessage;\n }\n else\n {\n echo $formattedMessage;\n }\n }\n }", "private function Log($msg) {\n// error_log( '[LOG] '.$msg);\n\t}", "protected function log($data) {\n $time = date('Y-m-d h:i:s a', time());\n $line = $time.\" \".$data.PHP_EOL;\n echo $line;\n file_put_contents($this->_directories[\"communication.log\"], $line,FILE_APPEND);\n }", "public function log($message, $data=null) {\n\t\tif(is_array($data) || is_object($data)) {\n\t\t\t$message.=\" \".print_r($data, true);\n\t\t}\n\n\t\tif($this->do_write) {\n\t\t\t$timestamp = date(\"M d H:i:s\");\n\t\t\t$output = \"$timestamp [{$_SERVER['PHP_SELF']}] $message\\n\";\n\t\t\t@fwrite($this->fh, $output);\n\t\t\treturn $output;\n\t\t}\n\t}", "function Log($msg)\n {\n if( !CCDebug::IsEnabled() )\n return;\n $f = fopen('cc-log.txt', 'a+' );\n $ip = CCUtil::IsHTTP() ? $_SERVER['REMOTE_ADDR'] : 'cmdline';\n $msg = '[' . $ip . ' - ' . date(\"Y-m-d h:i a\") . '] ' . $msg . \"\\n\";\n fwrite($f,$msg,strlen($msg));\n fclose($f);\n }", "public function sysLog($message, $severity = 0) {\n\t\t$this->getLocker()->_log($message, $severity);\n\t}", "public function WriteLog($msg)\n {\n $this->parent_logger_instance->WriteLog($msg);\n }", "public function logtoscreen($message, $command='') {\n $this->_log($message, $command, false, true);\n }", "function LogMsg ($msg) {\n\t$now = new DateTime();\n\t$now = $now->format('Y/m/d H:i:s');\n\tfile_put_contents (\n\t\t'log/log.txt',\n\t\t$now.' '.$_SERVER['REMOTE_ADDR'].' '.$msg.\"\\r\\n\",\n\t\tLOCK_EX|FILE_APPEND\n\t);\n}", "public function log($msg)\n {\n ToolsAbstract::log($msg, 'product-sync-biz.log');\n }", "public function log($message, $critical = false)\n {\n echo $message; //just echo it out! Yee haw! (I would suggest taking this function out once\n //your bridge is fully tested, and just let the backend handle logging...\n }", "public function log( $level = 'notice', $message = '' ) {\n\n\t\t\tif ( empty( $message ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( function_exists( 'wc_get_logger' ) ) {\n\t\t\t\t$logger = wc_get_logger();\n\t\t\t\t$context = array( 'source' => 'woocommerce-smart-coupons' );\n\t\t\t\t$logger->log( $level, $message, $context );\n\t\t\t} else {\n\t\t\t\tinclude_once plugin_dir_path( WC_PLUGIN_FILE ) . 'includes/class-wc-logger.php';\n\t\t\t\t$logger = new WC_Logger();\n\t\t\t\t$logger->add( 'woocommerce-smart-coupons', $message );\n\t\t\t}\n\n\t\t}", "public function write( $message ) {\n\n\t\t// Check if enabled\n\t\tif ( $this->is_enabled() ) {\n\n\t\t\t// Logger object\n\t\t\t$wc_logger = new WC_Logger();\n\n\t\t\t// Add to logger\n\t\t\t$wc_logger->add( 'xero', $message );\n\t\t}\n\n\t}", "protected function log(string $level, $message): void\n {\n if (!is_string($message)) {\n $message = print_r($message, true);\n }\n\n $text = '[' . date($this->timeFormat, time()) . '][' . strtoupper($level) .\n '] - [' . request()->ip() . '] --> ' . $message . PHP_EOL;\n\n $this->save($text);\n }", "function _logMessage($msg) {\n\t\tif ($msg[strlen($msg) - 1] != \"\\n\") {\n\t\t\t$msg .= \"\\n\";\n\t\t}\n\n\t\tif ($this->debug) debug($msg);\n\n\t\t$this->resultsSummary .= $msg;\n\n\t\tif ($this->useLog) {\n\t\t\t$logfile = $this->writeDir . \"cron.log\";\n\t\t\t$file = fopen($logfile, \"a\");\n\t\t\tfputs($file, date(\"r\", time()) . \" \" . $msg);\n\t\t\tfclose($file);\n\t\t}\n\t}", "public static function write($message)\n {\n $name = date('d-m-Y') . '.log';\n $logDir = ROOT . \"Logs/\";\n\n //Creates logs dir\n if (!file_exists($logDir)) {\n mkdir($logDir, 0655, true);\n }\n //Creates lof file\n if (!file_exists($name)) {\n touch($logDir . $name);\n }\n\n file_put_contents(\n $logDir . $name,\n '[' . date('d-m-Y H:i:s') .'] ' . $message . \"\\n\",\n FILE_APPEND\n );\n }", "public static function Log($type,$message,$level)\n \t{\n Log::Write($type,$message,$level);\n \t}", "public function log($message, $level = null)\n {\n if (empty($this->_filename)) {\n Mage::log(\n 'The Paymentsense log is not initialised. The Magento system log (this log) will be used instead.',\n Zend_Log::ERR,\n '',\n true\n );\n $message = 'Paymentsense: ' . $message;\n }\n\n Mage::log($message, $level, $this->_filename, true);\n }", "private function log_it($msg) {\n $this->log_msg_queue .= date('m/d/y H:i:s : ', time()) . $msg . PHP_EOL;\n }", "public function write($message);", "protected static function _log($level, &$message)\n {\n if ($level < 0)\n return;\n\n if ($level <= static::$level) {\n $message = sprintf(\"[%s %s %s] %s: %s\",\n static::$name,\n date('c'),\n static::$reqid,\n static::level_to_string($level),\n $message\n );\n static::$messages[] = $message;\n if (static::$syslog) {\n syslog($level, $message);\n }\n if (!is_null(static::$fd)) {\n fwrite(static::$fd, $message . \"\\n\");\n }\n }\n }", "public function log( $message ) {\n\t\t$this->output( date( 'H:i:s' ) . ' ' . $message . \"\\n\", 'pruneChanges::log' );\n\t\t$this->cleanupChanneled();\n\t}", "public function log($process, $message){\n $OldFile = $this->base_url.'logs/oxd-php-server-'.date(\"Y-m-d\") .'.log';\n $person = \"\\n\".date('l jS \\of F Y h:i:s A').\"\\n\".$process.$message.\"\\n\";\n file_put_contents($OldFile, $person, FILE_APPEND | LOCK_EX);\n }", "public function writeMessage($message);", "private function log($message, $type = 'info'){\r\n if($this->flow_woocommerce_version_check())\r\n {\r\n $logger = wc_get_logger();\r\n $logger->{$type}($message, array('source' => 'flow_flow'));\r\n }\r\n else{\r\n $logger = new WC_Logger('flow_flow');\r\n $logger->add('flow_flow', $message);\r\n }\r\n \r\n }", "protected function log( $msg, $level = 0 ) {\n\t\t\tif ( !$this->get_option( 'log' ) )\n\t\t\t\treturn;\n\t\t\t$msg = date( 'H:i:s' ) . \": $msg\";\n\t\t\t$msg .= \"\\n\";\n\t\t\t$log = $this->plugin_dir . '/log.txt';\n\t\t\t$fh = fopen( $log, 'a' );\n\t\t\tif ( !$fh ) {\n\t\t\t\ttrigger_error( sprintf(\n\t\t\t\t\t__( \"Logfile %s is not writable..\", 'better-related' ),\n\t\t\t\t\t$log\n\t\t\t\t) );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !$this->get_option( 'log' ) )\n\t\t\t\treturn;\n\t\t\t$loglevel = $this->get_option( 'loglevel' );\n\t\t\tif ( $loglevel != 'all' && $loglevel != $level && $level != 'global' )\n\t\t\t\treturn;\n\t\t\tfwrite( $fh, $msg );\n\t\t\tfclose( $fh );\n\t\t}", "public function log($data)\n\t{\n\t\t$logItem = array(\n\t\t\t'data' => $data,\n\t\t\t'type' => self::LOG\n\t\t);\n\t\tself::addToConsoleAndIncrement($logItem);\n\t}", "public static function log($message)\n {\n if (isset($_COOKIE['debug']) && $_COOKIE['debug'] == 'file') {\n // Debug to debug.txt\n $msg = \"[\" . date('Y-m-d H:i:s') . \"] http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . \"\\r\\n\";\n $msg .= \"\" . $message . \"\\r\\n\";\n $file = ROOT_DIR . '/debug.txt';\n file_put_contents($file, $msg, FILE_APPEND);\n }\n }", "public function log($text)\n {\n }" ]
[ "0.7137101", "0.7074992", "0.69795454", "0.6975054", "0.6971381", "0.6966576", "0.6917005", "0.68997073", "0.68764615", "0.68764615", "0.68764615", "0.6697476", "0.66813713", "0.6677159", "0.66760796", "0.6674131", "0.6671204", "0.66402125", "0.6561707", "0.65574557", "0.65022403", "0.64876586", "0.64800596", "0.6479919", "0.6468111", "0.6456573", "0.6451399", "0.64372134", "0.6425914", "0.6409593", "0.6399334", "0.63893837", "0.6389035", "0.6389035", "0.63735396", "0.6369645", "0.63669777", "0.63655275", "0.6361072", "0.63535744", "0.63498276", "0.6344059", "0.62838554", "0.6281032", "0.62565106", "0.6255365", "0.6210182", "0.6178105", "0.61775035", "0.61731035", "0.61668396", "0.6151758", "0.61471105", "0.6140377", "0.61192316", "0.6118175", "0.6094095", "0.60884166", "0.60811996", "0.60618377", "0.60487795", "0.6043709", "0.60401094", "0.6038316", "0.60370934", "0.60349923", "0.60328865", "0.603234", "0.60298795", "0.6027474", "0.60273665", "0.6003044", "0.5996416", "0.59861255", "0.5972681", "0.5968071", "0.5964439", "0.5963536", "0.59546125", "0.5940607", "0.59304273", "0.5922101", "0.59199595", "0.590212", "0.58998585", "0.58889705", "0.5884907", "0.58798945", "0.58744407", "0.5871264", "0.58654934", "0.585089", "0.5827864", "0.5820916", "0.58126235", "0.58077496", "0.58069223", "0.58009803", "0.57973784", "0.5791521", "0.57897365" ]
0.0
-1
Logs an error message to log. If an exception is passed, the the exception code and message code are used too.
public static function error(Exception $e, $message = '') { $message = !empty($message) ? $message . ": " . $e->getMessage() : $e->getMessage(); NostoHelperLogger::log($message, self::SEVERITY_ERROR, $e->getCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logError($message, Exception $exception = null)\n\t{\n\t\tif ($exception) {\n\t\t\t$line = $exception->getLine();\n\t\t\t$file = $exception->getFile();\n\t\t}\n\t\telse {\n\t\t\t$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\t$line = $backtrace[0]['line'];\n\t\t\t$file = $backtrace[0]['file'];\n\t\t}\n\t\t$logItem = array(\n\t\t\t'data' => $message,\n\t\t\t'type' => self::ERROR,\n\t\t\t'file' => $file,\n\t\t\t'line' => $line \n\t\t);\n\t\tself::addToConsoleAndIncrement($logItem);\n\t}", "public static function error($message, array $context = [])\n {\n if (static::$app->has('logException')) {\n static::$app->logException->error($message, (array)$context);\n } else {\n static::$app->log->error($message, (array)$context);\n }\n }", "public function logError($message) {\n $this->log($message, 'error');\n }", "public function logError($message)\n\t{\n\t\t$this->log($message, self::ERROR);\n\t}", "public function logError($message)\n\t\t{\n\t\t\t$this->logMessage(\"ERROR\", $message);\n\t\t}", "public function logError($message)\n\t{\n\t\t$this->logMessage(\"ERROR\", $message);\n\t}", "function logError($message) {\n\tlogMessage(\" ERROR\", $message);\n}", "function log_error($num, $str, $file, $line, $context = null)\n{\n log_exception(new ErrorException($str, 0, $num, $file, $line));\n}", "public static function log($message, $code = 1) {\n\t\t$e = new BaseException($message, $code);\n\t\t$e->saveLog();\n\t}", "public function error($message, array $context = array()) {\n $this->logger->error($this->interpolate($message, $context));\n }", "protected function logError($message)\n {\n $this->logger->error($message);\n }", "public function logError($message, array $context = array()) { return $this->_logger->error($message,$context); }", "public function logError($message, array $context = array())\r\n {\r\n if ($this->logger) {\r\n $this->logger->error($message, $context);\r\n }\r\n }", "public function error($message, array $context = []) {\n\t\t$this->log(Util::ERROR, $message, $context);\n\t}", "protected function error($message, array $context = array())\n {\n if (null !== $this->logger) {\n $this->logger->error($message, $context);\n }\n }", "public function error($message, array $context = [])\n {\n $this->writeLog(__FUNCTION__, $message, $context);\n }", "public function error(string $message, array $context = []){\n if($this->logger !== null){\n $this->logger->error($message, $context);\n }\n\n if($this->messagePanel !== null){\n $this->messagePanel->addMessage($message, LogLevel::ERROR);\n }\n }", "public function error($message)\n {\n if ($this->_logLevel>=1) {\n self::log($message, Zend_Log::ERR);\n }\n }", "public function logException($exception)\n {\n $message = $exception->getMessage();\n\n #--------------------------------------------------------------------\n # if this was an error caused by PHPCap, then include information\n # about the original PHPCap error.\n #--------------------------------------------------------------------\n if ($exception->getCode() === EtlException::PHPCAP_ERROR) {\n $previousException = $exception->getPrevious();\n if (isset($previousException)) {\n $message .= ' - Caused by PHPCap exception: '.$previousException->getMessage();\n }\n }\n\n list($loggedToProject, $projectError) = $this->logToProject($message);\n\n #--------------------------------------------------\n # Add the stack trace for file logging and e-mail\n #--------------------------------------------------\n $message .= PHP_EOL.$exception->getTraceAsString();\n\n list($loggedToFile, $fileError) = $this->logToFile($message);\n $loggedToEmail = $this->logToEmail($message);\n\n if ($loggedToFile === false && $loggedToProject === false && $loggedToEmail === false) {\n $logged = error_log($message, 0);\n }\n }", "public static function error($log_text, $throw = true) {\n\t\tif(self::$log_current_level < 3) {\n\t\t\tself::$log_current_level = 3;\n\t\t}\n\t\tif(DEBUG) {\n\t\t\techo \"<pre style='text-align: left;'>\";\n\t\t\techo $log_text;\n\t\t\techo \"</pre>\";\n\t\t}\n\t\tself::$log[] = self::buildLogLine(\"error\", debug_backtrace(), $log_text);\n\n\t\t// If this is an unrecoverable error, we need to stop execution.\n\t\tif($throw) {\n\t\t\tthrow new Exception(\"A fatal error occured. A report has been filed with the administrator.\");\n\t\t}\n\t}", "public function error($message, array $context = [])\n {\n $this->log('ERROR', $message, $context);\n }", "public function error($message) {\n\t\t\t$this->log('error', $message);\n\t\t}", "public function error($message, array $context = [])\n {\n $this->log('error', $message, $context);\n }", "function log_error( $msg ){\n self::system_log( $msg, 'ERROR' );\n }", "public function err($message)\r\n {\r\n $this->log($message, SF_LOG_ERR);\r\n }", "public function error($message, $method = 'no context given', array $logData = [], $justLog = false);", "private function logException()\n {\n switch ($this->classShortName) {\n case 'IndexException':\n case 'CreateException':\n case 'ReadException':\n case 'UpdateException':\n case 'DeleteException':\n Log::error($this->message);\n Log::error(print_r($this->getExceptionData(), true));\n break;\n default:\n Log::error($this->message);\n }\n }", "public static function error($message, array $context = array())\r\n {\r\n self::log(Level::ERROR, $message, $context);\r\n }", "protected function logException(\\Exception $exception, $message)\n {\n if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {\n $this->logger->critical($message, array('exception' => $exception));\n } else {\n $this->logger->error($message, array('exception' => $exception));\n }\n }", "public static function logException($exception)\n {\n if ($exception instanceof ErrorException) {\n self::logError($exception->getSeverity(), $exception->getMessage(), $exception->getFile(), $exception->getLine());\n } else {\n $logger = self::factory();\n $logger->log(get_class($exception), $exception->getMessage(), [], $exception->getFile(), $exception->getLine());\n }\n }", "protected function logError($message, $context = [])\n {\n $this->dibsCheckoutContext->getLogger()->addError($this->getLogPrefix() . $message, $context);\n }", "public static function err() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_ERR, $args);\n\t}", "protected function logException($exception, $extraMessage = '') \n\t{\n\t\tlog_message('error', '[ERROR] {exception}', ['exception' => $exception]);\n\t\t\n\t\tif ($extraMessage)\n\t\t\tlog_message('EXTRA MESSAGE: ' . $extraMessage);\n\t}", "public static function error($message, $context = array()){\n\t\treturn \\Monolog\\Logger::error($message, $context);\n\t}", "public function error($message, array $context = []) : void\n {\n $this->log(__FUNCTION__, $message, $context);\n }", "public function err($message)\n {\n $this->log($message, self::ERR);\n }", "public function error($message): void\n\t{\n\t\t$message = $this->logMessToArray($message);\n\t\t$this->log(array_merge(['SEVERITY' => 'ERROR'], $message));\n\t}", "public static function logError($msg, $exc = null) {\n if ($exc != null) {\n LogFileService::logFile('logFile.log', $msg.' : '.$exc->getMessage());\n } else {\n LogFileService::logFile('logFile.log', $msg);\n }\n }", "public function error($message, array $context = array())\n {\n self::log(LogLevel::ERROR, $message, $context);\n }", "public function error($message, array $context = [])\n {\n $this->log(AuditLevels::ERROR, $message, $context);\n }", "public function error($message, array $context = array())\n {\n $this->log(LogLevel::ERROR, $message, $context);\n }", "public function error($message, array $context = array())\n {\n $this->log(LogLevel::ERROR, $message, $context);\n }", "public function logError(Exception $e)\n {\n NostoHelperLogger::error($e);\n }", "public function error($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "public function setLogError( $message ) {\n WC_Midtrans_Logger::log( $message, 'midtrans-error', $this->id, current_time( 'timestamp' ) );\n }", "public function logException(string $log_level, \\Exception $exception);", "public function error($msg){\n\t\tif($this->debugLevel >= self::LOG_ERROR){\n\t\t\t$this->_log($msg, self::LOG_ERROR);\n\t\t}\n\t}", "public function error( $message )\n {\n $file = 'error-'.date('Ymd').'.log';\n $this->write( $file, $message );\n }", "private static function log(Exception $e)\r\n {\r\n $userAgent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : '';\r\n $referrer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : '';\r\n $request = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : '';\r\n\r\n $message = vsprintf(\"\\n[%s] [%s %s] %s\\n\\nREFERRER: %s\\n\\nREQUEST: %s\\n\\n%s\", array(\r\n @gmdate('D M d H:i:s Y'),\r\n $_SERVER['REMOTE_ADDR'],\r\n $userAgent,\r\n $e->getMessage(),\r\n $referrer,\r\n $request,\r\n $e->getTraceAsString(),\r\n ));\r\n\r\n return @error_log($message, 3, SLIRConfig::$pathToErrorLog);\r\n }", "private function logException(\\Exception $exception): void\n {\n Log::error($exception->getMessage() . PHP_EOL . $exception->getTraceAsString());\n }", "public function logException($event)\n {\n $exception = $event->getResult()->exception;\n if ($exception) {\n $sm = $event->getApplication()->getServiceManager();\n $service = $sm->get('Logger');\n $service->err($exception);\n }\n }", "public function error($message, array $context = array())\n {\n $this->saveLogMessage(LogLevel::ERROR, $message, $context);\n }", "public static function error(string $message, array $context = [], string $channel = self::DEFAULT_CHANNEL): void\n {\n self::log(LogLevel::ERROR, $message, $context, $channel);\n }", "public function log_error($error_message, $error_type = 'general', $file = null, $line = null)\n {\n return $this->call_method(\"log/error\",\n array('error_message' => $error_message,\n 'error_type' => $error_type,\n 'file' => $file,\n 'line' => $line,\n )\n );\n }", "public function error($message, array $context = []){\n\t\treturn $this->log($message, MonologLogger::ERROR, $context);\n\t}", "public function logError() {}", "public function logException($exception, array $context = []) {\n\t\t$exception = [\n\t\t\t'Exception' => \\get_class($exception),\n\t\t\t'Message' => $exception->getMessage(),\n\t\t\t'Code' => $exception->getCode(),\n\t\t\t'Trace' => $exception->getTraceAsString(),\n\t\t\t'File' => $exception->getFile(),\n\t\t\t'Line' => $exception->getLine(),\n\t\t];\n\t\t$exception['Trace'] = \\preg_replace('!(login|checkPassword|updatePrivateKeyPassword)\\(.*\\)!', '$1(*** username and password replaced ***)', $exception['Trace']);\n\t\t$msg = isset($context['message']) ? $context['message'] : 'Exception';\n\t\t$msg .= ': ' . \\json_encode($exception);\n\t\t$this->error($msg, $context);\n\t}", "abstract public function logException(string $log_level, \\Exception $exception);", "public function error($message, array $context = [])\n {\n return $this->writeLog(__FUNCTION__, $message, $context);\n }", "protected function log_error($message)\n {\n $this->log['error'][] = $message;\n }", "function logError(){\r\n\r\n\t\t$message = $_SERVER[\"REQUEST_URI\"].\"\\n\";\r\n\t\t$message .= $this->number;\r\n\r\n\t\tif($this->title)\r\n\t\t\t$message.=\": \".$this->title;\r\n\r\n\t\tif($this->details)\r\n\t\t\t$message.=\"\\n\\n\".$this->details;\r\n\r\n\t\t$log = new phpbmsLog($message,\"ERROR\");\r\n\r\n\t}", "private function logError(Request $request, ClientException $exception)\n {\n $this->logger()->error(\\Spiral\\interpolate(static::LOG_FORMAT, [\n 'scheme' => $request->getUri()->getScheme(),\n 'host' => $request->getUri()->getHost(),\n 'path' => $request->getUri()->getPath(),\n 'code' => $exception->getCode(),\n 'message' => $exception->getMessage() ?: '-not specified-',\n 'remote' => $this->findIp($request)\n ]));\n }", "public function error($string)\r\n {\r\n $this->getLogger()->log($string, self::ERROR);\r\n }", "public static function logError($message){\n $datestamp = date('Y-m-d');\n $timestamp = date('h:i:s');\n // sets default error log directory, if not specified.\n if(!self::$errorLogPath){\n self::$errorLogPath = getcwd() . self::$DEFAULT_LOCAL_ERROR_FOLDER;\n }\n // if the error folder path does not exist, create it; nesting allowed.\n if(!file_exists(self::$errorLogPath)){\n mkdir(self::$errorLogPath,0777,true);\n }\n $fullFilePath = self::$errorLogPath . $datestamp . \".txt\";\n if(self::$WRITE_TO_SCREEN){\n print \"$datestamp : $timestamp : $message <br/>\";\n // write message to a txt file named after today's date. Automatically creates a new one if necessarry.\n } else{\n $fp = fopen($fullFilePath,\"a\");\n fwrite($fp,$message . \"\\n\");\n fclose($fp);\n }\n }", "function log_exception(Throwable $e) // for php => 7.0\n{\n $message = \"Line {$e->getLine()} in \" . basename($e->getFile()) . \", {$e->getMessage()} (\" . get_class($e) . \")\";\n append_message($message);\n exit();\n}", "protected function LogError( $message, $args ) {\n\t\t$this->Log( 0001, $message, $args );\n\t}", "public static function error($message)\n\t{\n\t\tstatic::write('Error', $message);\n\t}", "protected function manageError( string $message )\n {\n $this->logger->error($message);\n throw new \\Exception($message);\n }", "public function error($message, array $context = array())\n {\n $this->log(PsrLogLevel::ERROR, $message, $context);\n }", "function error ($message, $class = NULL, $function = NULL, $file = NULL,\n $line = NULL)\n {\n\n $message =& new Message(array('m' => $message,\n 'c' => $class,\n 'F' => $function,\n 'f' => $file,\n 'l' => $line,\n 'N' => 'ERROR',\n 'p' => LEVEL_ERROR));\n\n $this->log($message);\n\n }", "public function error()\n {\n $this->appendLog(\n 'error',\n \\func_get_args(),\n $this->internal->getErrorCaller()\n );\n }", "public function logException($exception)\n {\n $this->getLogger()->logException($exception);\n }", "public function logerrorAction()\r\n {\r\n $this->_helper->viewRenderer->setNoRender();\r\n $this->_helper->layout->disableLayout();\r\n \r\n $tipo = $this->_getParam('tipo');\r\n $origen = $this->_getParam('origen');\r\n $error = $this->_getParam('error');\r\n \r\n \r\n echo $error;\r\n \r\n $log = new Application_Plugin_LogError();\r\n $log->setLog($tipo, 3, array( 'type' => \"Application error\", 'exception' => $error, 'controller'=>null, 'action'=>null, 'parametros'=>$origen, 'referer'=>((isset($_SERVER['HTTP_REFERER']))?$_SERVER['HTTP_REFERER']:NULL),'user_id'=>((isset($this->view->user->ID))?$this->view->user->ID:NULL), 'username'=>((isset($this->view->user->username))?$this->view->user->username:NULL)));\r\n \r\n }", "public function logException(Throwable $exception): void\n {\n $message = 'Uncaught exception #' . $exception->getCode() . ': ' . $exception->getMessage();\n $this->error($message, ['exception' => $exception]);\n }", "protected function logException(Exception $ex) { $this->_traiat_errorLogger->logException($ex, TRUE); }", "public function logException($e = NULL) {\n if (empty($e)) {\n $e = new Exception('Dummy exception');\n }\n $this->logManager->log($e, 'Exception');\n }", "public function error($message, array $context = array())\n {\n if ($this->activated) {\n $this->log(LogLevel::ERROR, $message, $context);\n }\n }", "protected function log_error( string $message ) {\n\n\t\tif ( class_exists( 'WP_CLI' ) ) {\n\t\t\t\\WP_CLI::error( $message );\n\t\t}\n\n\t}", "function logException ($ex) {\n\t\techo \"Should log: \".$ex->getMessage();\n\t}", "public static function error($message, array $context = array()): string\n {\n /** @noinspection PhpVoidFunctionResultUsedInspection */\n return static::getLogger()->error($message, $context);\n }", "public function shootExeception(Throwable $exception, string $messageLog = null)\n {\n if ($messageLog) {\n $this->log_format($messageLog);\n }\n\n throw $exception;\n }", "function handleException( $exception ) {\n echo \"Sorry, a problem occurred. Please try later.\";\n error_log( $exception->getMessage() );\n}", "public function logException(\\Exception $e)\n {\n error_log(\n sprintf(\n \"PHP Fatal error: %s in %s on line %s\\n%s\\n\",\n $e->getMessage(),\n $e->getFile(),\n $e->getLine(),\n $e->getTraceAsString()\n ),\n 3,\n $this->rootDir.'/../var/logs/prod-'.date('Y-m-d').'.log'\n );\n }", "public static function write_error_to_log($message, $type='General', $echo=false, $stack_trace=false){\r\n\t\tif ($stack_trace){\r\n\t\t\t$message = $message.\"\\nStack trace: \".helperFunctions::stack_trace(false, false, true);\r\n\t\t}\r\n\t\tif ($echo){\r\n\t\t\techo helperFunctions::text_for_web($message).'<br>';\r\n\t\t}\r\n\t\trequire_once(\"CIOLog.php\");\r\n\t\t$log_obj = new CIOLog(\"./log/\",$type,\"monthly\");\r\n\t\t$log_obj->write_log(str_replace(\"\\r\", \"\", $message));\r\n\t}", "public function error($message, $parameters = array()){\n\t\t$this->log($message, $parameters, Customweb_Subscription_Model_Log::LEVEL_ERROR);\n\t}", "public function failed()\n {\n $msg = self::class;\n $msg .= ' - Código: '.$this->$code;\n\n app('LogExtract')->error($msg);\n }", "public static function error($value)\n {\n self::$logs .= '[' . date('Y-m-d H:i:s', time()) . '] Error ' . $value . \"\\n\";\n }", "public function errorsLog($message = '', $file = '', $line = '')\n {\n error_log(\"[\" . date('Y-m-d h:i:s') . \"] text of error: {$message} | File: {$file} | String: {$line}\\n============ next ->\\n\", 3, TEMP_DIR . 'errors.log');\n }", "public function log($level, $message, array $context = array()) {\n throw new Exception('Please call specific logging message');\n }", "protected function logException($e)\n {\n if ($e instanceof ApiException) {\n $message = $e->getMessage();\n $this->getLogger()->error(\"Api Error: \" . $message);\n $respBody = $e->getResponseBody();\n\n if ($respBody) {\n $detail = json_encode($respBody);\n $this->getLogger()->error($detail);\n }\n }\n }", "abstract protected function logException(\\Exception $ex);", "function logError($msg, $errorD){\n\terror_log(print_r($msg . \"\\n\", TRUE), 3, $errorD);\n}", "protected function logException( \\Exception $e )\n\t{\n\t\t$logger = $this->context->getLogger();\n\n\t\t$logger->log( $e->getMessage(), \\Aimeos\\MW\\Logger\\Base::WARN, 'client/html' );\n\t\t$logger->log( $e->getTraceAsString(), \\Aimeos\\MW\\Logger\\Base::WARN, 'client/html' );\n\t}", "protected function reportError($message, $code)\n {\n $this->logError($message);\n throw new \\Exception($message, $code);\n }", "public static function error($message, $context);", "public function error($msg, $obj=null) {\n if ($this->logLevel <= Logger::ERROR) {\n $this->log(Logger::ERROR, $msg, $obj);\n }\n }", "public function log($type, $message)\n {\n if($this->checkType($type) === false)\n {\n throw new Exception(\"The given type $type is not referenced.\");\n }\n \n $this->display($this->colors[$this->types[$type]], $message);\n }", "public static function error($inMessage) {\n\t\tself::getInstance()->log($inMessage, systemLogLevel::ERROR);\n\t}", "public function error($message, array $context = array())\n {\n $this->info($message, $context);\n }", "public function logException(\\Exception $exception, array $additionalData = array()) {\n\t\t$backTrace = $exception->getTrace();\n\t\t$className = isset($backTrace[0]['class']) ? $backTrace[0]['class'] : '?';\n\t\t$methodName = isset($backTrace[0]['function']) ? $backTrace[0]['function'] : '?';\n\n\t\t$message = 'Uncaught exception : ' . get_class($exception) . '. ';\n\n\t\t$message .= $this->getExceptionLogMessage($exception);\n\n\t\t$additionalData['backtrace'] = \\TYPO3\\Flow\\Error\\Debugger::getBacktraceCode($backTrace, FALSE, TRUE);\n\n\t\t$explodedClassName = explode('\\\\', $className);\n\t\t$packageKey = (isset($explodedClassName[1])) ? $explodedClassName[1] : NULL;\n\n\t\t$prefix = '';\n\n\t\twhile ($exception->getPrevious() !== NULL) {\n\t\t\t$exception = $exception->getPrevious();\n\t\t\t$prefix .= '-';\n\n\t\t\t$additionalData[$prefix.'exception'] = $this->getExceptionLogMessage($exception);\n\t\t}\n\n\t\t$severity = (\n\t\t\t\t$exception instanceof \\TYPO3\\Flow\\Mvc\\Exception\\NoSuchActionException ||\n\t\t\t\t$exception instanceof \\TYPO3\\Flow\\Mvc\\Controller\\Exception\\InvalidControllerException\n\t\t) ? LOG_INFO : LOG_CRIT;\n\n\t\t$this->log($message, $severity, $additionalData, $packageKey, $className, $methodName);\n\t}" ]
[ "0.7176895", "0.69835794", "0.6921736", "0.691461", "0.68682444", "0.6863521", "0.6767112", "0.6719678", "0.67013776", "0.6685093", "0.66702217", "0.66169006", "0.6555061", "0.6535085", "0.652702", "0.64594734", "0.6454001", "0.6433207", "0.64202905", "0.63605684", "0.6355115", "0.6344546", "0.63438183", "0.6338134", "0.63334125", "0.6331147", "0.6328679", "0.6316913", "0.6312213", "0.62855965", "0.62852", "0.6279987", "0.62779975", "0.62741596", "0.62675494", "0.62480193", "0.6244241", "0.6238092", "0.62367195", "0.6220973", "0.6210659", "0.6210659", "0.6187945", "0.6157683", "0.6150638", "0.6145266", "0.61247104", "0.6121947", "0.6117167", "0.61120445", "0.61084276", "0.6105852", "0.61033344", "0.610216", "0.6100005", "0.60950696", "0.6041406", "0.6037141", "0.60102487", "0.60095674", "0.60003644", "0.59959245", "0.5991553", "0.5988896", "0.5982821", "0.596262", "0.59459907", "0.5944677", "0.59442043", "0.5939748", "0.5938483", "0.5898223", "0.5897068", "0.5895351", "0.5878916", "0.5872874", "0.5867848", "0.5864532", "0.58642805", "0.58419126", "0.5836977", "0.58110005", "0.58095706", "0.58049446", "0.57629853", "0.57446903", "0.5743622", "0.57379407", "0.5732061", "0.57227594", "0.57216597", "0.57116914", "0.57112896", "0.5711096", "0.5703595", "0.56871885", "0.56563395", "0.5656233", "0.56557477", "0.5652809" ]
0.6681177
10
Logs info message into the PS log
public static function info($message) { NostoHelperLogger::log($message, self::SEVERITY_INFO); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log_info( $msg ){\n self::system_log( $msg, 'INFO' );\n }", "public function info()\n {\n $this->appendLog('info', \\func_get_args());\n }", "public function info($msg) {\n $this->writeLine($msg, 'info');\n }", "public function info($message)\r\n {\r\n $this->log($message, SF_LOG_INFO);\r\n }", "function logInfo (string $msg): void {\n\tlogString('('.$_SERVER['REMOTE_ADDR'].') ('.date('Y-m-d H:i:s').') [Info] '.$msg);\n}", "public function logInfo($message)\n\t{\n\t\t$this->log($message, self::INFO);\n\t}", "public function info($msg) {\n\t\tif ( $this->level <= self::INFO && !empty($msg) ) {\n\t\t\t$this->writeLog(\"INFO: \".$msg);\n\t\t}\n\t}", "public function logInfo($message)\n\t\t{\n\t\t\t$this->logMessage(\"INFO\", $message);\n\t\t}", "public function logInfo($message)\n\t{\n\t\t$this->logMessage(\"INFO\", $message);\n\t}", "public function info($message) {\n\t\t\t$this->log('info', $message);\n\t\t}", "function logInfo($message) {\n\tlogMessage(\" INFO\", $message);\n}", "public function info($message)\n {\n $this->log($message, self::INFO);\n }", "public static function info() {\n\t\t# Get arguments to this function:\n\t\t$args = func_get_args();\n\n\t\t# Add message to log:\n\t\treturn self::add(LOG_INFO, $args);\n\t}", "public function info($message): void\n\t{\n\t\t$this->log($message);\n\t}", "public function info($message): void\n {\n $this->log(__FUNCTION__, $message);\n }", "protected function log_info( string $message ) {\n\n\t\tif ( class_exists( 'WP_CLI' ) ) {\n\t\t\t\\WP_CLI::line( $message );\n\t\t}\n\n\t}", "public static function info($message)\n\t{\n\t\tstatic::write('Info', $message);\n\t}", "public function log($info)\n {\n $writer = new \\Zend\\Log\\Writer\\Stream(BP . $this->logFilePath);\n $logger = new \\Zend\\Log\\Logger();\n $logger->addWriter($writer);\n $logger->info($info);\n }", "public function info($message) {}", "function loggerInformation($msgInfo) {\n\t$logger = new Logger('./log');\n $logger->log('Information', 'infos', $msgInfo, Logger::GRAN_MONTH);\n}", "function loginfo($level, $tag, $info){\t$this->tracemsg($level, \"$tag($info)\");\n}", "public static function info($message)\n {\n static::_log(self::INFO, $message);\n }", "public static function info($inMessage) {\n\t\tself::getInstance()->log($inMessage, systemLogLevel::INFO);\n\t}", "public function info($message) {\n if (!$this->logging_enabled) {\n return;\n }\n \n $this->logger->info($message);\n }", "public function info($message)\n {\n if ($this->_logLevel>=3) {\n self::log($message, Zend_Log::INFO);\n }\n }", "public static function info($string)\n\t{\n\t\tif(defined(\"LOG_STDOUT\"))\n\t\t{\n\t\t\techo \"INFO: \" . $string . \"\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\t// mail(\"[email protected]\", \"Log Info\", $string);\n\t}", "public function info($message, $method = 'no method given', array $logData = [], $justLog = false);", "public function info($message)\n {\n $this->message($message, 'info');\n }", "public function info($msg, $category='application'){\n\t\t$this->log($msg, 6, $category);\n\t}", "protected function logInfo($message)\n {\n $this->dibsCheckoutContext->getLogger()->addInfo($this->getLogPrefix() . $message);\n }", "public static function LogMessage($info)\n {\n if (self::$_enabled === FALSE) {\n return;\n }\n\n if (self::$_logFile === NULL) {\n throw new Exception(\"Log file has not been set\");\n }\n $time = date('Y-m-d H:i:s');\n $type = gettype($info);\n switch ($type) {\n case 'boolean':\n $info = var_export($info, TRUE);\n \n case 'double':\n case 'integer':\n case 'string':\n $info = trim($info);\n break;\n\n case 'array':\n case 'object':\n $info = print_r($info, TRUE);\n break;\n\n default:\n throw new Exception(\"Not sure how to handle this type of variable: \".gettype($info));\n }\n error_log($time.\" \".str_replace(\"\\n\", \"\\n\\t\", $info).\"\\n\", 3, self::$_logFile);\n }", "function logInfo($level, $message) {\n\tlogMessage(\"INFO\", \"This is an info message.\") . PHP_EOL;\n}", "public function info($string)\r\n {\r\n $this->getLogger()->log($string, self::INFO);\r\n }", "public function info($message) {\n\t\techo \"{$message}\\n\";\n\t}", "public function info($msg, $obj=null) {\n if ($this->logLevel <= Logger::INFO) {\n $this->log(Logger::INFO, $msg, $obj);\n }\n }", "public function info($message, $parameters = array()){\n\t\t$this->log($message, $parameters, Customweb_Subscription_Model_Log::LEVEL_INFO);\n\t}", "public function info($message)\n {\n }", "private function printInfo(string $msg): void\n\t{\n\t\t$this->msgSection->writeln('<info>Info:</info> ' . $msg);\n\t}", "public static function info($message = '') {\n self::writeLine($message, SELF::CLI_COLOR_DEFAULT, self::CLI_TYPE_INFO);\n }", "function info($message);", "public function logInfo($message, array $context = array()) { return $this->_logger->info($message,$context); }", "public function info($message = null, $newlines = 1, $level = Shell::NORMAL) {\n\t\t$this->out('<info>' . $message . '</info>', $newlines, $level);\n\t}", "protected function LogInfo( $message, $args ) {\n\t\t$this->Log( 0003, $message, $args );\n\t}", "function info ($message, $class = NULL, $function = NULL, $file = NULL,\n $line = NULL)\n {\n\n $message =& new Message(array('m' => $message,\n 'c' => $class,\n 'F' => $function,\n 'f' => $file,\n 'l' => $line,\n 'N' => 'INFO',\n 'p' => LEVEL_INFO));\n\n $this->log($message);\n\n }", "private function log($message)\n {\n Log::info($message);\n $this->info($message);\n }", "public function info($message, array $context = []) : void\n {\n $this->log(__FUNCTION__, $message, $context);\n }", "public function logInfos($msg)\n {\n if ((bool)$this->plugin->confHelper->getPaymentGlobal()[SettingsField::PAYMENT_GLOBAL_LOGS_INFOS]) {\n if (is_array($msg)) {\n $this->logger->info(\n print_r($this->filterDebugData($msg), true),\n array(self::SOURCE_PLUGIN => $this->plugin->id . '-' . self::INFO)\n );\n } else {\n $this->logger->info($msg, array(self::SOURCE_PLUGIN => $this->plugin->id . '-' . self::INFO));\n }\n }\n }", "public function info(string $message, array $context = []){\n if($this->logger !== null){\n $this->logger->info($message, $context);\n }\n\n if($this->messagePanel !== null){\n $this->messagePanel->addMessage($message, LogLevel::INFO);\n }\n }", "protected function info(string $message)\n {\n if (FLOW_SAPITYPE === 'CLI') {\n echo \"\\033[0;36m\" . $message . \"\\033[0m\" . PHP_EOL;\n }\n }", "public function info(string $message)\n {\n $this->message('info', $message);\n }", "public function info($msg, $methodName = null) {\r\n if (!empty($methodName)) {\r\n $msg = \"$methodName - $msg\";\r\n }\r\n $this->log(LOG_INFO, $msg);\r\n }", "public function info($message, array $context = [])\n {\n $this->writeLog(__FUNCTION__, $message, $context);\n }", "public function info( $message )\n {\n $this->write( $this->success_file, $message );\n }", "public function write_log($operation, $info_to_log){}", "public function info($message, array $context = array())\n {\n file_put_contents($this->filename, 'INFO: '. json_encode($context) . ' - ' . $message . \"\\r\\n\", FILE_APPEND);\n }", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "public function info($message)\n {\n $flash = $this->flashtype['info'];\n $flash['message'] = $message;\n $this->add($flash);\n }", "public static function info($log_text) {\n\t\tif(\\Config::LOG_DEBUG) {\n\t\t\tif(self::$log_current_level < 1) {\n\t\t\t\tself::$log_current_level = 1;\n\t\t\t}\n\n\t\t\tself::$log[] = self::buildLogLine(\"info\", debug_backtrace(), $log_text);\n\t\t}\n\t}", "public function logInfo($message, array $context = array())\r\n {\r\n if ($this->logger) {\r\n $this->logger->info($message, $context);\r\n }\r\n }", "public function info($message, $trance = null)\n {\n $this->write('info', $message, $trance);\n }", "public static function info($text = null)\n {\n self::message($text, 'info');\n }", "public function info($message, array $context = [])\n {\n $this->log('info', $message, $context);\n }", "public static function info($message, array $context = array())\r\n {\r\n self::log(Level::INFO, $message, $context);\r\n }", "protected function log($data) {\n $time = date('Y-m-d h:i:s a', time());\n $line = $time.\" \".$data.PHP_EOL;\n echo $line;\n file_put_contents($this->_directories[\"communication.log\"], $line,FILE_APPEND);\n }", "public function log($msg){\n\t\tif($this->debugLevel >= self::LOG_INFO){\n\t\t\t$this->_log($msg, self::LOG_INFO);\n\t\t}\n\t}", "public static function info($message, array $context = [])\n {\n if (static::$app->debug) {\n static::$app->log->info($message, $context);\n }\n }", "public function addInfoLog($data)\n {\n if(is_array($data) || is_object($data)){\n $this->addInfo(json_encode($data));\n }else{\n $this->addInfo($data);\n }\n }", "function sf_info($data, $force = false, $block_header_on_echo = false)\n {\n IOFunctions::out(\n LogLevel::INFO,\n $data,\n $force,\n $block_header_on_echo\n );\n }", "public function log($info, $file =\"\", $line = \"\")\n {\n if($this->loggingEnabled)\n {\n try \n {\n $dirpath = $this->logDir.\"/\".date(\"M_Y\");\n $filepath = $dirpath.\"/\".date(\"d_M_Y\").\".log\";\n $header = \"[\".date(\"H:i\");// .\"]: \";\n $header = $file == \"\" && $line == \"\" ? $header.\"]: \" : $header.\" in $file at $line]: \";\n if(!is_dir($dirpath))\n mkdir($dirpath);\n $fh = fopen($filepath,\"a\");\t\n fwrite($fh,$header.$info.\"\\n\");\n }\n catch(exception $ex) {} //check perms\n }\n }", "public function info($message, array $context = [])\n {\n $this->log('INFO', $message, $context);\n }", "private function log($message) {\n //echo $message . \"\\n\";\n }", "public function info($string)\n {\n $this->celcatWebAPI->logs[] = ['string' => $string, 'type' => 'info'];\n }", "public static function log($message){\n Craft::getLogger()->log($message, \\yii\\log\\Logger::LEVEL_INFO, 'craft-trade-account-notifications');\n }", "public function info($message, array $context = array())\n {\n if ($this->activated) {\n $this->log(LogLevel::INFO, $message, $context);\n }\n }", "public function info(string $message, array $data = [])\n {\n $this->monolog->info($message, $data);\n }", "private function log($message) {\n\t\techo $message.\"\\n\";\n\t}", "protected function log()\n {\n\n $this->worker\n ->setInstance($this->instance);\n // If instance can be called\n if($this->worker->ping()) {\n $infos = $this->worker->getInfos();\n $createdAt = new \\DateTime();\n\n $log = $this->logManager->createNew();\n $log->setMemory($infos['Memory']['used_memory']);\n $log->setCpu($infos['CPU']['used_cpu_sys']);\n $log->setNbClients(sizeof($this->worker->getClients()));\n $log->setCreatedAt($createdAt);\n // Add log\n $this->instance->addLog($log);\n }\n }", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "public function info($message, $title = null, $options = []) {\n $this->add('info', $message, $title, $options);\n }", "function logger($message)\n\t\t{\n\t\t\t$requester=$_SERVER['REMOTE_ADDR'];\n\t\t\t$log = new Logging();\n\t\t\t$log->logfile('./'.$this->aps->id.'.log');\n\t\t\t$log->logwrite($requester.\":\".$message);\n\t\t\t$log->logclose();\n\t\t}", "public function info($message, array $context = array())\n {\n $this->log(PsrLogLevel::INFO, $message, $context);\n }", "function Log($msg)\n {\n if( !CCDebug::IsEnabled() )\n return;\n $f = fopen('cc-log.txt', 'a+' );\n $ip = CCUtil::IsHTTP() ? $_SERVER['REMOTE_ADDR'] : 'cmdline';\n $msg = '[' . $ip . ' - ' . date(\"Y-m-d h:i a\") . '] ' . $msg . \"\\n\";\n fwrite($f,$msg,strlen($msg));\n fclose($f);\n }", "function osc_add_flash_info_message($msg, $section = 'pubMessages') {\n Session::newInstance()->_setMessage($section, $msg, 'info');\n }", "private function log(string $text): void\n {\n $this->logger->info($text);\n }", "function info($message, array $context = array());", "public function info($message, array $context = array())\n {\n $this->log(LogLevel::INFO, $message, $context);\n }", "public function info($message, array $context = array())\n {\n $this->log(LogLevel::INFO, $message, $context);\n }", "public static function info($message, $context = array()){\n\t\treturn \\Monolog\\Logger::info($message, $context);\n\t}", "public function info($message, $extra = array())\n {\n $this->logger->info($message, $extra);\n }", "public function info($message, array $context = array())\n {\n $this->saveLogMessage(LogLevel::INFO, $message, $context);\n }", "protected function info($message, array $context = array())\n {\n if (null !== $this->logger) {\n $this->logger->info($message, $context);\n }\n }", "private function log($message, $type = 'info'){\r\n if($this->flow_woocommerce_version_check())\r\n {\r\n $logger = wc_get_logger();\r\n $logger->{$type}($message, array('source' => 'flow_flow'));\r\n }\r\n else{\r\n $logger = new WC_Logger('flow_flow');\r\n $logger->add('flow_flow', $message);\r\n }\r\n \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function info($message, array $context = array())\n {\n // TODO: Implement info() method.\n self::log(LogLevel::INFO, $message, $context);\n }", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "public function log($msg)\n {\n file_put_contents($this->logFile, $this->shopName.\" \".date('c').\" \".print_r($msg, true).\"\\n\", FILE_APPEND | LOCK_EX);\n }", "public static function info($message, $context);", "private function log(OutputInterface $output, string $message, string $serial = null, string $platform = null, string $username = null, array $kolideDevices = null) : void {\n $output->writeln(json_encode(array_filter([\n 'component' => 'device-health-checker',\n 'system' => 'nais-device',\n 'message' => $message,\n 'serial' => $serial,\n 'platform' => $platform,\n 'username' => $username,\n 'level' => 'info',\n 'timestamp' => time(),\n 'kolideDevices' => $kolideDevices\n ])));\n }" ]
[ "0.751274", "0.7453588", "0.7355964", "0.72713053", "0.72338414", "0.7213764", "0.7199855", "0.718971", "0.71627915", "0.7160561", "0.7115237", "0.71037114", "0.7090272", "0.7086304", "0.69740087", "0.6960835", "0.6937615", "0.6912593", "0.6863803", "0.6839215", "0.6828405", "0.6804475", "0.67611504", "0.6746851", "0.67265755", "0.6722288", "0.6698122", "0.66966796", "0.6651641", "0.6626398", "0.6617661", "0.6615123", "0.661286", "0.66075003", "0.6600495", "0.6583376", "0.6582072", "0.65406275", "0.6514428", "0.6481744", "0.64773864", "0.6406465", "0.6402645", "0.6367614", "0.6364919", "0.63642675", "0.6355492", "0.6315882", "0.63027805", "0.6280354", "0.6275932", "0.6262491", "0.6251136", "0.6229409", "0.6216415", "0.6212424", "0.61913925", "0.61841166", "0.6167758", "0.6155226", "0.6152346", "0.6138357", "0.61225605", "0.6098747", "0.60959435", "0.6095172", "0.60828435", "0.6079081", "0.60784566", "0.6077759", "0.607765", "0.60708207", "0.60468733", "0.60432214", "0.60370004", "0.60296994", "0.6020171", "0.6008433", "0.59896797", "0.5982161", "0.59804565", "0.5975516", "0.59684837", "0.59634584", "0.5956112", "0.5955697", "0.5955697", "0.59385663", "0.59378797", "0.5930985", "0.5929987", "0.59156764", "0.5914465", "0.5914465", "0.5914465", "0.59048575", "0.5898067", "0.5895678", "0.58810276", "0.58785516" ]
0.68148553
21
Run the database seeds.
public function run() { User::firstOrCreate([ 'name' => 'linty', 'password' => encrypt('lty01234'), 'phone' => '17605961742' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Create a Canvas user
public function createUser($rootAccountID){ $this->path = "accounts/$rootAccountID/users"; return $this->post(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "function create(){\n\t\t\t//getting default circle\n\t\t\t$def_circle = $this->circle_model->get_Circle(\"cursos\");\n\t\t\t$id = new MongoID($def_circle['_id']);\n\t\t\t\n\t\t\t$document = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'acl' => array(\n\t\t\t\t//asignamos el circulo cursos por default\n\t\t\t\t0 => array('circle' => $id)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t$this->user_model->add_User($document);\n\t\t}", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }", "public function createUser(array $config = []);", "public function newuser($use_settings = array()) {\n\t\t$data = $this->create_api_user($use_settings);\n\t\techo json_encode($data);\n\t\tdie();\n\t}", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "private function init_user() {\n global $USER, $DB;\n\n $userdata = new stdClass;\n $userdata->username = 'user';\n $userid = user_create_user($userdata);\n $USER = $DB->get_record('user', array('id' => $userid));\n context_user::instance($USER->id);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "function create_current_user($user) {\n return create_element(\"div\", true, [ \"contents\" => [\n $user[\"firstname\"].\" \".$user[\"lastname\"].\" \",\n\n create_element(\"a\", true, [\n \"href\" => \"http://$_SERVER[HTTP_HOST]/dz2/logout.php\",\n \"contents\" => \"Logout\"\n ])\n ]]);\n}", "public function create(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUcrDataByToken(UserController::getUcrRequestTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "protected function createUser ()\n {\n /* Method of the UserFactory class */\n $this->_objUser = UserFactory::createUser(ucfirst($_SESSION[\"userType\"])); \n $this->_objUser->setFirstName($_SESSION[\"emailID\"]);\n }", "public function creer_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_create_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userCreate ( $userdata );\n\t}", "public function create_user($user, $password, $security_question1, $security_answer1, $security_question2, $security_answer2, $security_question3, $security_answer3);", "public function createAction()\n {\n echo (new View('userCreate'))->render();\n }", "public function create_user($data)\r\n {\r\n $user = new Users;\r\n $user->attributes = $data;\r\n if( array_key_exists('passwd', $data) ) $user->passwd = md5( $data['passwd'] );\r\n $user->save();\r\n return $user;\r\n }", "public function create()\n {\n return view('backends.user.create');\n }", "public function newUserAction()\n {\n $user = (new UserModel())->createUser();\n echo (new View('userCreated'))\n ->addData('user', $user)\n ->render();\n }", "public static function create($user){\n\t\tApp::get('database')->add('users',$user);\n\t}", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function createOwner();", "public function create_londontec_users(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/adduser';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Create Londontec New users',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "public function create(UserInterface $user);", "public function createUserFromSocialite($user);", "public function createEnterpriseUser($input);", "public function create($type, $data, $userId);", "public function actionCreate()\n {\n $model = new BackendUser();\n\n $post = Yii::$app->request->post();\n if($post){\n $post['BackendUser']['password'] = md5($post['BackendUser']['password']);\n }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['/user/']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createUserFromRemote() {\n\t\treturn false;\n\t}", "public function createUser()\n {\n return User::factory()->create();\n }", "public function creating(User $user)\n {\n\n }", "public function creating(User $user): void\n {\n \n }", "public function run()\n {\n $user = User::create([\n 'first_name' => 'Влад',\n 'last_name' => 'Кабанцов',\n 'screen_name' => 'id31357193',\n 'photo' => 'https://pp.userapi.com/c630018/v630018193/4c9e0/7gwa9D-ObGw.jpg?ava=1',\n 'vk_id' => 31357193,\n 'referral_reference' => 'e3RwS2eeyYU7177jhXcS2wxIegSTl7HGrrDmd3e468iB1FpsNL$2y$10$FkE9KnqkSwZNwssD0T4mZuZBjESTUfiCIb18iaEYMnslQC4M6zmoO',\n ]);\n\n $user->token()->create([\n 'access_token' => '6544c4432276db0d7943b31e63b5b8ebb30a0dd297aef498d25e9c1cb073e6ff5924dd6e8095e1824734d',\n 'expires_in' => 86399\n ]);\n }", "protected function createUserDataScript() {\n\t\t$cdata_user = '\n\t\t\t//<![CDATA[\n\t\t\t var cursorImageUrl = \"'.$this->image_cursor_path.'\";\n\t\t\t var clickImageUrl = \"'.$this->image_click_path.'\";\n\t\t\t var recordingData = {\n\t\t\t \tvp_height: '.$this->viewPortHeight.',\n\t\t\t\tvp_width: '.$this->viewPortWidth.',\n\t\t\t\thovered: '.$this->hovered.',\n\t\t\t\tclicked: '.$this->clicked.',\n\t\t\t\tlost_focus: '.$this->lostFocus.',\n\t\t\t\tscrolls: '.$this->scrolls.',\n\t\t\t\tviewports: '.$this->viewports.'\n\t\t\t\t};\n\t\t\t window.parent.resizeFrame(recordingData.vp_height,recordingData.vp_width);\n\t\t\t//]]>\n\t\t\t';\n\t\t// create user data script\n\t\t$this->js_user_data = $this->doc->createInlineScript($cdata_user);\n\t}", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "function ggouv_twitter_api_create_user($twitter) {\n\t// check new registration allowed\n\tif (!twitter_api_allow_new_users_with_twitter()) {\n\t\tregister_error(elgg_echo('registerdisabled'));\n\t\tforward();\n\t}\n\n\t// Elgg-ify Twitter credentials\n\t$username = $twitter->screen_name;\n\twhile (get_user_by_username($username)) {\n\t\t// @todo I guess we just hope this is good enough\n\t\t$username = $twitter->screen_name . '_' . rand(1000, 9999);\n\t}\n\n\t$password = generate_random_cleartext_password();\n\t$name = $twitter->name;\n\n\t$user = new ElggUser();\n\t$user->username = $username;\n\t$user->name = $username;\n\t$user->realname = $name;\n\t$user->twitter = $twitter->screen_name;\n\t$user->access_id = ACCESS_PUBLIC;\n\t$user->salt = generate_random_cleartext_password();\n\t$user->password = generate_user_password($user, $password);\n\t$user->owner_guid = 0;\n\t$user->container_guid = 0;\n\n\tif (!$user->save()) {\n\t\tregister_error(elgg_echo('registerbad'));\n\t\tforward();\n\t}\n\n\treturn $user;\n}", "public function run()\n {\n \\User::factory(10)->create();\n }", "function create_user($username, $password, $email)\n {\n }", "public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }", "public function create()\n {\n \t $this->pass_data['page_heading'] = \"Add User\";\n return view('backend.user.create', $this->pass_data);\n }", "public function create()\n {\n if ( Gate::denies('criar-user')){\n abort(403, 'Não tem Permissão para criar um utilizador');\n }\n return view('users.create');\n }", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function run()\n {\n $this->createDefaultUser();\n }", "public function register_with_tyk() {\n\t\ttry {\n\t\t\t$tyk = new Tyk_API();\n\t\t\t$user_id = $tyk->post('/portal/developers', array(\n\t\t\t\t'email' => $this->user->user_email,\n\t\t\t\t));\n\t\t\t$this->set_tyk_id($user_id);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\ttrigger_error(sprintf('Could not register user for API: %s', $e->getMessage()), E_USER_WARNING);\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$this->layout->content = View::make('user.create');\n\t}", "public function create(User $user)\n {\n }", "public function create(User $user)\n {\n\n }", "public function create()\n {\n return view(\"backend.user.create\");\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }" ]
[ "0.6220045", "0.6132002", "0.6132002", "0.6132002", "0.6132002", "0.61210227", "0.6109533", "0.6069237", "0.60299736", "0.600273", "0.5921305", "0.5881576", "0.58581567", "0.5804896", "0.5784626", "0.5758847", "0.5758847", "0.572616", "0.57174647", "0.5648136", "0.56193054", "0.5586046", "0.55808836", "0.5579116", "0.5570622", "0.55428314", "0.5519046", "0.55115443", "0.55031866", "0.5499723", "0.54905415", "0.5473739", "0.54729515", "0.5464768", "0.54283416", "0.5427057", "0.5422669", "0.5415395", "0.5388544", "0.5376791", "0.5371342", "0.5356619", "0.5341999", "0.5341666", "0.53312373", "0.5329692", "0.5325525", "0.5325525", "0.53140986", "0.53085524", "0.53067005", "0.53050464", "0.530075", "0.52994937", "0.529763", "0.5292477", "0.5288821", "0.5284996", "0.5278338", "0.5275909", "0.52749234", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775", "0.52743775" ]
0.0
-1
Get a Canvas user
public function getUser($userID){ $this->path = "users/$userID"; return $this->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "function getUser() {\n return user_load($this->uid);\n }", "public function getUser(){\r\n\t\treturn $this->facebook_obj->getUser();\r\n\t}", "public function getUser()\n {\n return $this->getContext()->getUser();\n }", "public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }", "public function getUser() {\n\t\treturn $this->api->getUserById($this->getUserId());\n\t}", "public static function getUser()\n {\n return self::getInstance()->_getUser();\n }", "protected function _user() {\n return $this->_adapter_user->user();\n }", "private function getUser()\n {\n return $this->user->getUser();\n }", "public function user()\n {\n return $this->context-> getUser();\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}", "function user(?string $adapterName = null)\n\t\t{\n\t\t\treturn gatekeeper($adapterName)->getUser();\n\t\t}", "public function getUser() {\n\t\t$urlUser = \"{$this->apiHost}/me.json\";\n\t\treturn $this->runCurl ( $urlUser );\n\t}", "public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn User::newFromName( $this->params['user'], false );\n\t}", "public function user()\n\t{\n\t\tif (is_null($this->user) and $this->session->has(static::$key))\n\t\t{\n\t\t\t$this->user = call_user_func(Config::get('auth.by_id'), $this->session->get(static::$key));\n\t\t}\n\n\t\treturn $this->user;\n\t}", "public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}", "public function getUser( ) {\n\t\treturn $this->user;\n\t}", "public function getUser( ) {\n\t\treturn $this->user;\n\t}", "private function getUser() {\n\t\t$account = $this->authenticationManager->getSecurityContext()->getAccount();\n\t\t$user = $account->getParty();\n\t\treturn $user;\n\t}", "public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }", "public function get_user() {\n\t\treturn $this->user;\n\t}", "public function getUser()\n {\n $this->getParam('user');\n }", "public function getUser()\n\t{\n\t\tif(isset($this->user))\n\t\t{\n\t\t\treturn $this->user;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->user = ColoCrossing_Object_Factory::createObject($this, null, $content['user'], 'user');\n\t}", "protected function getUser()\n {\n return $this->user;\n }", "public function getUser() {\n\n if (isset($this->user)) {\n return $this->user;\n }\n\n return NULL;\n }", "public final function getUser()\n {\n return $this->user;\n }", "function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}", "public function getUser()\r\n {\r\n return $this->user;\r\n }", "public function getUser()\n {\n return $this->accessToken->getUser();\n }", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public static function getUser() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::getUser();\t\t\n\t}", "public function getUser(): string {\n return $this->context->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->controller->getUser();\n }", "protected function getUserByContext() {}", "protected function getUser()\n\t{\n\t\t$fbUser = $this->getFBUser();\n\t\tif (is_null($fbUser)) {\n\t\t\t$vkUser = $this->getVKUser();\n\t\t\tif (is_null($vkUser)) {\n\t\t\t\t$this->getResponseFormatForInvalidUserId();\n\t\t\t}\n\t\t\treturn $vkUser;\n\t\t}\n\t\treturn $fbUser;\n\t}", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function getUser()\n {\n return $this->_user;\n }", "public function getUser()\n {\n if ($this->user === null) {\n // if we have not already determined this and cached the result.\n $this->user = $this->getUserFromAvailableData();\n }\n\n return $this->user;\n }", "public function getUser()\n {\n return $this->_user;\n }", "public function getUser() {\r\n return $this->user;\r\n }", "function getUser() \n {\n\t\t\treturn $this->user;\n\t\t}", "public function getUserData()\r\n \t{\r\n \t\tif ($this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn $this->_client->api('/me');\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "public function getUser()\n {\n if(!$this->user)\n $this->user = User::getActive();\n\n return $this->user;\n }", "public function fetchUser() {\n return $this->QueryAPI(\"current_user\");\n }", "abstract protected function getUser();", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser() {\n\t\treturn $this->Session->read('UserAuth');\n\t}", "public function getUser(){\r\n $urlUser = \"{$this->apiHost}/api/v1/me\";\r\n // return $urlUser;\r\n return self::runCurl($urlUser);\r\n }", "protected function getUser()\n {\n return $this->loadUser(array(\n 'user_name' => $this->context['admin'],\n ));\n }", "public function getUser() {}", "protected function getUser()\n {\n return $this->user_provider->getHydratedUser();\n }", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser() {\n\t\t\treturn null;\n\t\t}" ]
[ "0.7117057", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7043195", "0.7003708", "0.69072056", "0.68454635", "0.68388367", "0.68295234", "0.6817361", "0.68118834", "0.6749152", "0.6740439", "0.67043126", "0.67043126", "0.67043126", "0.67043126", "0.66936237", "0.66921717", "0.6689279", "0.6651133", "0.6621814", "0.6621814", "0.66138923", "0.6610004", "0.66075146", "0.660546", "0.660546", "0.6604116", "0.6603766", "0.65915847", "0.6588887", "0.6578407", "0.65764487", "0.65686804", "0.6564225", "0.65526116", "0.6551965", "0.65469015", "0.65398645", "0.6537677", "0.6537495", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535877", "0.6535442", "0.6531558", "0.65231144", "0.6520824", "0.65135485", "0.651096", "0.6505726", "0.64991957", "0.64935666", "0.64923364", "0.64870316", "0.6482793", "0.64735126", "0.64733315", "0.64733315", "0.64733315", "0.64733315", "0.64725643", "0.64725643", "0.64725643", "0.6465516", "0.6459496", "0.64575243", "0.6456731", "0.644148", "0.6431591", "0.64271086", "0.6419654" ]
0.0
-1
Edit a Canvas user
public function editUser($userID){ $this->path = "users/$userID"; return $this->put(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_edit($user_info)\n {\n }", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "public function edit(WxUser $wxUser)\n {\n //\n }", "public function modify_user($user);", "function get_user_to_edit($user_id)\n {\n }", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function edit($user_id)\n\t{\n\t\t//\n\t}", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "public function editUser(UserEditForm $form, User $user);", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function edit(Quiz_user $quiz_user)\n {\n //\n }", "public function edit(User $user)\n {\n \n }", "public function edit(user $user)\n {\n //\n }", "public function edit(user $user)\n {\n //\n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "public function edit(User $user)\n {\n }", "function render_edit($user)\n {\n }", "public function edit_self(ProfileUser $editted_profile) {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE `users` SET program = '$editted_profile->program' AND level = '$editted_profile->level' AND commuter = '$editted_profile->commuter' AND bio = '$editted_profile->bio' WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t}\r\n\t}", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function testUpdateUser()\n {\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(User $user)\n {\n //\n }", "public function edit(UserSecurity $userSecurity)\n {\n //\n }", "public function edit()\n\t{\n\t\t// Initialize variables.\n\t\t$app\t= &JFactory::getApplication();\n\t\t$cid\t= JRequest::getVar('cid', array(), '', 'array');\n\n\t\t// Get the id of the user to edit.\n\t\t$userId = (int) (count($cid) ? $cid[0] : JRequest::getInt('user_id'));\n\n\t\t// Set the id for the user to edit in the session.\n\t\t$app->setUserState('com_users.edit.user.id', $userId);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "public function edit(Server_User $server_User)\n {\n //\n }", "public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }", "public function edit(KensingtonUser $kensingtonUser)\n {\n //\n }", "public function edit()\n\t{\n\t\t$user = $this->User->findById($this->Auth->user('id'));\n\n\t\tif ($this->request->is('post') || $this->request->is('put')) {\n\t\t // we set the id because we are not creating a user, just updating it.\n\t\t $this->User->id = $user['User']['id'];\n\t\t // we also set the current avatar, because if there is a new one,\n\t\t // we have to delete the existing one before. (cf Model/User);\n\t\t $this->User->avatar = $user['User']['avatar'];\n\n\t\t if ($this->User->save($this->request->data)) {\n\t\t return $this->redirect(array('action' => 'profile', 'username' => $user['User']['username']));\n\t\t }\n\t\t}\n\n\t\tif ( ! $this->request->data) {\n\t\t\t// will fill the form in the view (for GET requests)\n\t\t\t$this->request->data = $user;\n\t\t}\n\n\t\t$this->set('user', $user); // view vars\n\t}", "public function edit(Bot_Users $bot_Users)\n {\n //\n }", "public function edit(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($username)\n {\n //\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "function user_action_user_edit_own($env, $vars) {\n user_action_user_edit($env, $vars);\n}", "public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}", "function change_user_info( $user, $key, $config )\n {\n //Unimplemented\n }", "public function userEdit($userInfo){\n\t\t\t$getSQL = \"SELECT * FROM users WHERE userid='{$userInfo['userID']}'\";\n\t\t\t$queryDB = $this->db->query($getSQL);\n\t\t\t$userData = $queryDB->result();\n\n\t\t\t$userData = (array) $userData[0];\n\n\t\t\t$this->db->where('userID', $userInfo['userID']);\n\t\t\t$this->db->update('users', $userInfo);\n\n\t\t\treturn true;\n\t\t}", "public function edit(EndUser $endUser)\n {\n //\n }", "function user_can_edit_user($user_id, $other_user)\n {\n }", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "public function update($user)\n {\n }", "public function actionEditUserProfile()\n {\n $userID = $_GET['userid'];\n $data = $this->model->getUserProfile($userID);\n $this->view = new ViewIndex(\"EditUserProfile\", $data);\n $this->view->render();\n //$this->view->generate('viewEditProfile.php', 'viewTemplate.php', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit($user_id)\n\t{\n\t\t$stmt = self::$_connection->prepare(\"UPDATE user_profile SET first_name = :first_name, last_name = :last_name, email=:email, country = :country, city = :city, street_address = :street_address, postal_code = :postal_code WHERE user_id = :user_id\");\n\t\t$stmt->execute(['first_name'=>$this->first_name, 'last_name'=>$this->last_name, 'email'=>$this->email, 'country'=>$this->country, 'city'=>$this->city, 'street_address'=>$this->street_address, 'postal_code'=>$this->postal_code, 'user_id'=>$user_id]);\n\t}", "public function profile($userid = null){\r\n if (!$this->user)\r\n url::redirect(\"/user/register\");\r\n \r\n if(!$userid)\r\n $userid = $this->user->id;\r\n\t\t\r\n // filter sql control symbols\r\n $userid = str_replace( array('?', '#', '%', \"'\"),'',$userid );\r\n\t\t\r\n $user = null;\r\n $allow_edit = false;\r\n\r\n // відкриває вікно редагування персональних даних після активації\r\n $editPersonal = false;\r\n\t\t\r\n if( ($this->logged_in && $this->user->id == $userid ) ){\r\n $user = $this->user;\r\n if($user->last_login == 0){\r\n $editPersonal = true;\r\n $user->last_login = time();\r\n $user->save();\r\n }\r\n $allow_edit = true;\r\n\r\n // провірка на синхронізацію мікроблогінгу з твітером\r\n /*\r\n if(isset($_SESSION['oauth_token']) && isset($_SESSION['oauth_token_secret']) && isset($_REQUEST['oauth_verifier'])){\r\n $consumer_key = Kohana::config('user.TWITTER_KEY');\r\n $consumer_secret = Kohana::config('user.TWITTER_SECRET');\r\n \r\n include Kohana::find_file('vendor','TwitterOAuth');\r\n $connection = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\r\n $token_credentials = $connection->getAccessToken($_REQUEST['oauth_verifier']);\r\n $user->twitter_token = $token_credentials['oauth_token'];\r\n $user->twitter_secret = $token_credentials['oauth_token_secret'];\r\n $user->twitter_last_sync = $user->twitter_last_sync != 0 ? $user->twitter_last_sync : 0;\r\n $user->save();\r\n }\r\n */\r\n \r\n } else {\r\n $user = ORM::factory('user', $userid);\r\n }\r\n\t\t\r\n // user not found, show 404\r\n if(empty($user->id)){\r\n Kohana::show_404();\r\n exit;\r\n }\r\n \r\n javascript::add(array('comments','jquery.jcarousel.pack','friendship', 'swfobject', 'jquery.uploadify.v2.1.4'));\r\n stylesheet::add(array('jcarousel/jquery.jcarousel','jcarousel/skin', 'uploadify'));\r\n\t\t\r\n\r\n //javascript::add('messages');\r\n \r\n //$messagesCount = ORM::factory('message')->where('user_id', $user->id)->count_all();\r\n //$lastMessage = ORM::factory('message')->where('user_id', $user->id)->orderby('date', 'DESC')->limit(1)->find();\r\n \t$statistic=Statistic_Controller::getInstance();\r\n \t$view = new View('userpage');\r\n $view->standart=$statistic->getStats('standart');\r\n $view->site=$statistic->getStats('site');\r\n $view->filter=$statistic->getStats('filter');\r\n $view->user_profile = $user;\r\n $view->lang = Kohana::lang('user');\r\n $view->allowedit = $allow_edit;\r\n $view->editPersonal = $editPersonal;\r\n \r\n $view->logged_in_user = $this->user;\r\n //$view->ads_count = ORM::factory('ads')->where('user_id', $user->id)->count_all();\r\n\r\n //$view->user_stat = MOJOUser::user_statistic($user->id);\r\n //$view->friends = MOJOUser::get_friends($user->id);\r\n\r\n /*\r\n $view->was_events_count = ORM::factory('event')\r\n\t\t\t\t\t\t\t->join('events_users','events_users.event_id','events.id')\r\n\t\t\t\t\t\t\t->where(array('events_users.user_id'=>$user->id,\r\n\t\t\t\t\t\t\t\t\t\t 'events.start_date <' => time(),\r\n\t\t\t\t\t\t\t\t\t\t 'events.status'=>1 ))\r\n\t\t\t\t\t\t\t->orderby(array('events.start_date'=>'desc'))\r\n\t\t\t\t\t\t\t->count_all();\r\n\t\t\t\t\t\t\t\r\n $view->will_events_count = ORM::factory('event')\r\n\t\t\t\t\t\t\t->join('events_users','events_users.event_id','events.id')\r\n\t\t\t\t\t\t\t->where(array('events_users.user_id'=>$user->id,\r\n\t\t\t\t\t\t\t\t\t\t 'events.start_date >' => time(),\r\n\t\t\t\t\t\t\t\t\t\t 'events.status'=>1))\r\n\t\t\t\t\t\t\t->orderby(array('events.start_date'=>'asc'))\r\n\t\t\t\t\t\t\t->count_all();\r\n\t\t\r\n $view->was_events = ORM::factory('event')\r\n\t\t\t\t\t\t\t->join('events_users','events_users.event_id','events.id')\r\n\t\t\t\t\t\t\t->where(array('events_users.user_id'=>$user->id,\r\n\t\t\t\t\t\t\t\t\t\t 'events.start_date <' => time(),\r\n\t\t\t\t\t\t\t\t\t\t 'events.status'=>1 ))\r\n\t\t\t\t\t\t\t->orderby(array('events.start_date'=>'desc'))\r\n\t\t\t\t\t\t\t->find_all(4); \r\n\t\t\t\t\t\t\t\r\n $view->will_events = ORM::factory('event')\r\n\t\t\t\t\t\t\t->join('events_users','events_users.event_id','events.id')\r\n\t\t\t\t\t\t\t->where(array('events_users.user_id'=>$user->id,\r\n\t\t\t\t\t\t\t\t\t\t 'events.start_date >' => time(),\r\n\t\t\t\t\t\t\t\t\t\t 'events.status'=>1))\r\n\t\t\t\t\t\t\t->orderby(array('events.start_date'=>'asc'))\r\n\t\t\t\t\t\t\t->find_all(4);\r\n $view->random_pictures = ORM::factory('picture')\r\n\t\t\t\t\t\t\t\t\t->select('pictures.*, events.name as event_name, events.city_custom, events.location_custom, locations.city as loc_city, locations.name as loc_name')\r\n\t\t\t\t\t\t\t\t\t->join('events', 'events.id', 'pictures.event_id','INNER')\r\n\t\t\t\t\t\t\t\t\t->join('locations', 'events.location_id', 'locations.id','LEFT')\r\n\t\t\t\t\t\t\t\t\t->join('presences', 'presences.picture_id', 'pictures.id','INNER')\r\n\t\t\t\t\t\t\t\t\t->where(array('pictures.deleted'=>0, 'presences.user_id'=>$user->id))\r\n\t\t\t\t\t\t\t\t\t->find_all(40);\r\n\t\t\t\t\t\t\t\t\t\r\n */\r\n $view->set_global('hide_flow', true);\r\n $view->allow_edit = $allow_edit;\r\n $view->active = 1;\r\n $view->render(true);\r\n\t}", "public function edituser($context, $local)\r\n {\r\n\r\n $id = $context->getpar('id','');\r\n $user = $context->load('users', $id) ;\r\n\r\n if( !$user ){\r\n $local->addval( 'state', 'User does not exist');\r\n $local->addval( 'statecode', 0);\r\n return 'editstaff.twig';\r\n }\r\n\r\n $firstname = $user->firstname;\r\n $lastname = $user->lastname;\r\n $email = $user->email;\r\n $accesslevel = $user->accesslevel;\r\n\r\n //Return the information about the user which will be handled\r\n $local->addval( 'user' , $user );\r\n return 'editstaff.twig';\r\n }", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "public function edit(User $User)\n {\n //\n }", "public function edit(User $User)\n {\n //\n }", "public function edit()\n {\n return view(config('const.template.user.edit'), ['user' => User::find($this->guard()->id())]);\n }", "public function editAccountAction()\n {\n //Current customer Data.\n $cst = $this->model->getByUserName($_SESSION['userName']);\n if (empty($_POST) === false) {\n //User want to Update his Data.\n if (isset($_POST['update'])) {\n $message = \"\";\n $currentUserName = $cst->getuserName();\n //Check if customer`s new User Name or \n //new Email exists in Data Base.\n if ($currentUserName != $_POST['userName'])\n $message = $this->checkIfExists($_POST['userName'], \"\");\n if (!$message)\n if ($cst->getemail() != $_POST['email'])\n $message = $this->checkIfExists(\"\", $_POST['email']);\n if ($message != \"\")\n $this->regMassage($message);\n //Upadating Customer`s Data.\n else {\n $cst = $this->customerCreate();\n $this->update($cst, $currentUserName);\n $_SESSION['userName'] = $_POST['userName'];\n }\n }\n }\n\n $vars['update'] = \"\";\n $vars['customer'] = $cst;\n $this->view->render('edit profile', $vars);\n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n \n $user = UserModel::load()->get($userId);\n\n return View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => $user,\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}" ]
[ "0.67884976", "0.67442274", "0.6586803", "0.6499426", "0.64862084", "0.64685345", "0.63772064", "0.6372386", "0.6348944", "0.63408554", "0.6330902", "0.6273171", "0.62031937", "0.6182024", "0.617777", "0.617777", "0.6177105", "0.61632895", "0.6146389", "0.6140922", "0.6129031", "0.61189973", "0.6116542", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.610539", "0.6087103", "0.60818666", "0.60656106", "0.60427386", "0.603105", "0.60278064", "0.60228825", "0.6019095", "0.6018611", "0.6016234", "0.6014811", "0.6010386", "0.6001352", "0.59930295", "0.5976889", "0.59758526", "0.59681875", "0.5956602", "0.59437966", "0.5930824", "0.5928276", "0.5923646", "0.5901894", "0.59017974", "0.58728045", "0.5852108", "0.58509576", "0.58406407", "0.58359855", "0.58359855", "0.58321244", "0.5807326", "0.5797356", "0.5794825" ]
0.61461693
19
Delete a Canvas user
public function users($rootAccountID){ $this->path = "accounts/$rootAccountID/users"; return $this->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUser()\n {\n $this->delete();\n }", "public function delete_user($user);", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }", "public function delete($user){\n }", "public function deleteUser($userId);", "public function delete($user)\n {\n\n }", "protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }", "public function userDeleted();", "public function destroy($id)\n {\n // delete user\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function destroy()\n {\n $userId = Helper::getIdFromUrl('user');\n \n if ((Helper::checkUrlIdAgainstLoginId($userId)) !== 'super-admin') {\n Usermodel::load()->destroy($userId);\n } else { \n View::render('errors/403.view', [\n 'message' => 'You cannot delete yourself!',\n ]);\n }\n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "function delete_user()\n {\n\n //return true if successful\n }", "public function userDeleted()\n\t{\n\t\tself::authenticate();\n\n\t\t$userId = FormUtil::getPassedValue('user', null, 'GETPOST');\n\t\tif(!is_string($userId)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$user = $this->entityManager->getRepository('Owncloud_Entity_DeleteUser')->findOneBy(array('uname' => $userId));\n\t\tif(!($user instanceof Owncloud_Entity_DeleteUser)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\t\t$this->entityManager->remove($user);\n\t\t$this->entityManager->flush();\n\n\t\treturn self::ret(true);\n\t}", "function system_delete_user($uid)\n{\n}", "public function user_delete($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_delete', $data);\n\t}", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }", "public function delete(User $user)\n {\n //\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "function wpmu_delete_user($id)\n {\n }", "public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}", "public function destroy($user_id)\n\t{\n\t\t//\n\t}", "public function deleteAction() {\n $uid = $this->getInput('uid');\n $info = Admin_Service_User::getUser($uid);\n if ($info && $info['groupid'] == 0) $this->output(-1, '此用户无法删除');\n if ($uid < 1) $this->output(-1, '参数错误');\n $result = Admin_Service_User::deleteUser($uid);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }", "public function destroy(User $user)\n {\n\n }", "public function destroy(User $user)\n {\n \n }", "public function delete(User $user, Flashcard $flashcard)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }", "public function delUser($user_id) {\n $db = $this->dbConnect();\n $req = $db->prepare('DELETE FROM `p5_users` WHERE USER_ID = ?');\n $req->execute(array($user_id));\n $req->closeCursor();\n }", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function destroy(user $user)\n {\n //\n }", "public function destroy(User $user)\n {\n }", "public function destroy(User $user)\n {\n }", "public function destroy(User $user) {\n //\n }", "public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }", "public function deleteIdentity ()\n\t{\n\t\tif ($this->session->has('user')) {\n\n\t\t\t$this->session->remove('user');\n\t\t}\n\n\t}", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "function cvs_delete_user($cvs_user, $cvs_project) {\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields=$all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n\tunset($all_cvs_users[$cvs_user]);\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Deleted user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user does not exist\");\r\n } \r\n}", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }" ]
[ "0.7609813", "0.7547494", "0.7321743", "0.7228073", "0.70617616", "0.7056891", "0.7006814", "0.6987686", "0.69737715", "0.69434935", "0.69185024", "0.6877465", "0.6824094", "0.6811669", "0.6794841", "0.6788763", "0.67706233", "0.6760897", "0.6755995", "0.6755664", "0.6745841", "0.6745841", "0.6745841", "0.67293316", "0.670665", "0.67012817", "0.66714424", "0.6671051", "0.66611385", "0.6659403", "0.6654532", "0.66351783", "0.6629615", "0.6616334", "0.6612953", "0.66057956", "0.66012454", "0.65984803", "0.65959793", "0.65864044", "0.6577818", "0.6577818", "0.65758675", "0.6568139", "0.6565579", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65652704", "0.65589297", "0.6557888", "0.6557888", "0.6557888", "0.6557888" ]
0.0
-1
Relacion uno a muchos
public function inventario() { return $this->hasMany('App\Inventario'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function personas(){\n\n return $this->morphedByMany(Persona::class, 'cargoable'); //relacion muchos a muchos \"una persona tiene muchos cargos y un cargo tiene muchas personas\"\n }", "public function acessarRelatorios(){\n\n }", "protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }", "private function telaPerfilGerente()\r\n {\r\n //Carregando as lojas do banco de dados\r\n $repositorio = $this->getDoctrine()->getRepository('DCPBundle:Quebra');\r\n\r\n $sql = $repositorio->createQueryBuilder('l')\r\n ->select('l.id')\r\n ->groupby('l.id')\r\n ->getquery();\r\n\r\n $resultado = $sql->getResult();\r\n\r\n $loja = array();\r\n $contLoja = 0;\r\n foreach($resultado as $data)\r\n {\r\n if (!in_array($data, $loja))\r\n {\r\n $loja[$contLoja] = $data[\"id\"];\r\n $contLoja++;\r\n }\r\n }\r\n \r\n return $loja;\r\n }", "function RellenarDesarrolloReunion()\r\n {\r\n $i = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->AddPage();\r\n\r\n if ($i == 1)\r\n {\r\n $i++;\r\n $this->Imprimir('DESARROLLO DE LA REUNIÓN', 10, 12, 18);\r\n }\r\n\r\n $this->RellenarDescripcionDelEvento($evento);\r\n\r\n $this->RellenarFotosDelEvento($evento);\r\n\r\n $this->RellenarRazonesDelEvento($evento);\r\n\r\n $varios = Doctrine_Core::getTable('SAF_VARIO')->findByIdEvento($evento->getID());\r\n\r\n $this->RellenarBitacoraDelEvento($varios);\r\n\r\n $this->RellenarAccionesYRecomendacionesDelEvento($varios);\r\n\r\n $this->RellenarCompromisosDelEvento($varios);\r\n }\r\n }\r\n }", "function getRelaciones() {\n //arreglo relacion de tablas\n //---------------------------->DEPARTAMENTO(OPERADOR)\n $relacion_tablas['departamento']['ope_id']['tabla'] = 'operador';\n $relacion_tablas['departamento']['ope_id']['campo'] = 'ope_id';\n $relacion_tablas['departamento']['ope_id']['remplazo'] = 'ope_nombre';\n //---------------------------->DEPARTAMENTO(OPERADOR)\n //---------------------------->DEPARTAMENTO(REGION)\n $relacion_tablas['departamento']['der_id']['tabla'] = 'departamento_region';\n $relacion_tablas['departamento']['der_id']['campo'] = 'der_id';\n $relacion_tablas['departamento']['der_id']['remplazo'] = 'der_nombre';\n //---------------------------->DEPARTAMENTO(REGION)\n //---------------------------->MUNICIPIO(DEPARTAMENTO)\n $relacion_tablas['municipio']['dep_id']['tabla'] = 'departamento';\n $relacion_tablas['municipio']['dep_id']['campo'] = 'dep_id';\n $relacion_tablas['municipio']['dep_id']['remplazo'] = 'dep_nombre';\n //---------------------------->MUNICIPIO(DEPARTAMENTO)\n //---------------------------->CIUDAD\n $relacion_tablas['ciudad']['Id_Pais']['tabla'] = 'pais';\n $relacion_tablas['ciudad']['Id_Pais']['campo'] = 'Id_Pais';\n $relacion_tablas['ciudad']['Id_Pais']['remplazo'] = 'Nombre_Pais';\n //---------------------------->CIUDAD\n //---------------------------->CUENTAS\n $relacion_tablas['cuentas_financiero']['cft_id']['tabla'] = 'cuentas_financiero_tipo';\n $relacion_tablas['cuentas_financiero']['cft_id']['campo'] = 'cft_id';\n $relacion_tablas['cuentas_financiero']['cft_id']['remplazo'] = 'cft_nombre';\n //---------------------------->CUENTAS\n //---------------------------->CUENTAS UT\n $relacion_tablas['cuentas_financiero_ut']['cft_id']['tabla'] = 'cuentas_financiero_tipo';\n $relacion_tablas['cuentas_financiero_ut']['cft_id']['campo'] = 'cft_id';\n $relacion_tablas['cuentas_financiero_ut']['cft_id']['remplazo'] = 'cft_nombre';\n //---------------------------->CUENTAS UT\n //---------------------------->MOVIMIENTOS\n $relacion_tablas['extracto_movimiento']['mov_tipo_id']['tabla'] = 'extractos_movimiento_tipo';\n $relacion_tablas['extracto_movimiento']['mov_tipo_id']['campo'] = 'mov_tipo_id';\n $relacion_tablas['extracto_movimiento']['mov_tipo_id']['remplazo'] = 'mov_tipo_desc';\n //---------------------------->MOVIMIENTOS\n //---------------------------->CENTROS POBLADOS\n $relacion_tablas['centropoblado']['mun_id']['tabla'] = 'municipio';\n $relacion_tablas['centropoblado']['mun_id']['campo'] = 'mun_id';\n $relacion_tablas['centropoblado']['mun_id']['remplazo'] = 'mun_nombre';\n //---------------------------->CENTROS POBLADOS\n //---------------------------->TIPO HALLAZGO\n $relacion_tablas['tipohallazgo']['idAreaHallazgo']['tabla'] = 'areashallazgospendientes';\n $relacion_tablas['tipohallazgo']['idAreaHallazgo']['campo'] = 'idAreaHallazgo';\n $relacion_tablas['tipohallazgo']['idAreaHallazgo']['remplazo'] = 'descripcion';\n //---------------------------->TIPO HALLAZGO\n\n return $relacion_tablas;\n }", "protected function entidades(){\n\t\tfor($i=1; $i < 6;$i++) $niveis[$i] = \"nivel de busca {$i}\";\n\t\t$this->visualizacao->nivel = VComponente::montar(VComponente::caixaCombinacao, 'nivel', isset($_POST['nivel']) ? $_POST['nivel'] : 1 ,null,$niveis);\n\t\t$this->visualizacao->filtro = isset($_POST['filtro']) ? $_POST['filtro'] : null;\n\t\t$this->visualizacao->listagens = false;\n\t\tif(!$this->visualizacao->filtro) return;\n\t\t$d = dir(\".\");\n\t\t$negocios = new colecao();\n\t\t$controles = new colecao();\n\t\twhile (false !== ($arquivo = $d->read())) {\n\t\t\tif( is_dir($arquivo) && ($arquivo{0} !== '.') ){\n\t\t\t\tif(is_file($arquivo.'/classes/N'.ucfirst($arquivo).'.php')){\n\t\t\t\t\t$negocio = 'N'.ucfirst($arquivo);\n\t\t\t\t\t$obNegocio = new $negocio();\n\t\t\t\t\tif( $obNegocio instanceof negocioPadrao ) {\n\t\t\t\t\t\t$ordem[$arquivo] = array(\n\t\t\t\t\t\t\t'nome'=>$obNegocio->pegarInter()->pegarNome(),\n\t\t\t\t\t\t\t'caminho'=>$arquivo.'/classes/N'.ucfirst($arquivo).'.php'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$negocios->$arquivo = $obNegocio;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\tasort($ordem);\n\t\t$this->visualizacao->ordem = $ordem;\n\t\t$listagens = array();\n\t\tforeach($ordem as $idx => $arquivo){\n\t\t\t$obNegocio = $negocios->pegar($idx);\n\t\t\t$nome['controle'] = definicaoEntidade::controle($obNegocio, 'verPesquisa');\n\t\t\tif($this->exibirListagem($arquivo)){\n\t\t\t\t$colecao = $obNegocio->pesquisaGeral($this->pegarFiltro(),$this->pegarPagina(),isset($_POST['nivel']) ? $_POST['nivel'] : 1);\n\t\t\t\tcall_user_func_array(\"{$nome['controle']}::montarListagem\", array($this->visualizacao,$colecao,$this->pegarPagina(),$nome['controle']));\n\t\t\t\t$this->visualizacao->listagem->passarControle($nome['controle']);\n\t\t\t\tif($colecao->contarItens()){\n\t\t\t\t\t$listagens[$idx]['listagem'] = $this->visualizacao->listagem;\n\t\t\t\t\t$listagens[$idx]['ocorrencias'] = $colecao->contarItens();\n\t\t\t\t\t$listagens[$idx]['nome'] = $arquivo['nome'];\n\t\t\t\t\t$listagens[$idx]['controlePesquisa'] = $nome['controle'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($this->visualizacao->listagem);\n\t\t$this->visualizacao->listagens = $listagens;\n\t}", "public function obtenerViajesplusAbonados();", "function getRelaciones() {\r\n //arreglo relacion de tablas\r\n //---------------------------->DEPARTAMENTO(OPERADOR)\r\n //---------------------------->TEMA(TIPO)\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['tabla']='documento_tipo';\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['campo']='dti_id';\r\n\t\t$relacion_tablas['documento_tema']['dti_id']['remplazo']='dti_nombre';\r\n\t\t//---------------------------->TEMA(TIPO)\r\n\r\n\t\t//---------------------------->SUBTEMA(TEMA)\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['tabla']='documento_tema';\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['campo']='dot_id';\r\n\t\t$relacion_tablas['documento_subtema']['dot_id']['remplazo']='dot_nombre';\r\n //---------------------------->SUBTEMA(TEMA)\r\n\r\n //---------------------------->DOCUMENTO(OPERADOR)\r\n $relacion_tablas['documento_actor']['ope_id']['tabla']='operador';\r\n\t\t$relacion_tablas['documento_actor']['ope_id']['campo']='ope_id';\r\n\t\t$relacion_tablas['documento_actor']['ope_id']['remplazo']='ope_nombre';\r\n //---------------------------->DOCUMENTO(TIPO DE ACTOR)\r\n $relacion_tablas['documento_actor']['dta_id']['tabla']='documento_tipo_actor';\r\n\t\t$relacion_tablas['documento_actor']['dta_id']['campo']='dta_id';\r\n\t\t$relacion_tablas['documento_actor']['dta_id']['remplazo']='dta_nombre';\r\n //----------------------------<DOCUMENTO\r\n\r\n\t\t//---------------------------->DEPARTAMENTO(OPERADOR)\r\n\t\t$relacion_tablas['departamento']['ope_id']['tabla']='operador';\r\n\t\t$relacion_tablas['departamento']['ope_id']['campo']='ope_id';\r\n\t\t$relacion_tablas['departamento']['ope_id']['remplazo']='ope_nombre';\r\n\t\t//---------------------------->DEPARTAMENTO(OPERADOR)\r\n\r\n\t\t//---------------------------->DEPARTAMENTO(REGION)\r\n\t\t$relacion_tablas['departamento']['dpr_id']['tabla']='departamento_region';\r\n\t\t$relacion_tablas['departamento']['dpr_id']['campo']='dpr_id';\r\n\t\t$relacion_tablas['departamento']['dpr_id']['remplazo']='dpr_nombre';\r\n //---------------------------->DEPARTAMENTO(REGION)\r\n\r\n\t\t//---------------------------->MUNICIPIO(DEPARTAMENTO)\r\n\t\t$relacion_tablas['municipio']['dep_id']['tabla']='departamento';\r\n\t\t$relacion_tablas['municipio']['dep_id']['campo']='dep_id';\r\n\t\t$relacion_tablas['municipio']['dep_id']['remplazo']='dep_nombre';\r\n //---------------------------->MUNICIPIO(DEPARTAMENTO)\r\n\r\n return $relacion_tablas;\r\n }", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "function grafico_1_3( $desde, $hasta, $ua ){\n\t// aclarar al cliente que debe setear campos bien definidos y NO PERMITIR AMBIGUEDADES\n\t\n\t$query = \"select actor.nombre, actor.apellido, actor.id_partido, actor.id_campo, count(noticiasactor.id_actor) as cantidad from noticiascliente \"\n\t\t. \"inner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \"\n\t\t. \"inner join noticias on noticiasactor.id_noticia = noticias.id \"\n\t\t. \"inner join actor on noticiasactor.id_actor = actor.id \"\n\t\t. \"where \"\n\t\t\t. \"noticiascliente.id_cliente = \" . $ua . \" and \"\n\t\t\t. \"noticiascliente.elim = 0 and \"\n\t\t\t. \"noticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \"\n\t\t\t// SOLO QUIENES TIENEN 3 Y 4 COMO CAMPO\n\t\t\t// . \" and ( actor.id_campo like '%3%' or actor.id_campo like '%4%' ) \"\n\t\t. \"group by noticiasactor.id_actor order by cantidad desc\";\n\t//echo $query;\n\t$main = R::getAll($query);\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\n\t//var_dump($main);\n\t$tabla = [];\n\t// unidad de analisis, actor, partido, cantidad de menciones\n\t$i = -1;\n\t$partidos = [];\n\t\n\t$children_partidos = [];\n\t$i_actor = 0;\n\tforeach($main as $k=>$v){\n\t\t// obtengo el/los partidos\n\t\t$partidos_array = json_decode( $v['id_partido'], true);\n\t\tif( ! is_array($partidos_array) ) continue;\n\t\t\n\t\tforeach($partidos_array as $p){\n\t\t\t$partido_nombre = R::findOne('attr_partido','id LIKE ?',[$p])['nombre'];\n\t\t\t$tabla[ ++$i ] = [\n\t\t\t\t'ua' => $ua_nombre,\n\t\t\t\t'actor' => $v['nombre'] . ' ' . $v['apellido'],\n\t\t\t\t'partido' => $partido_nombre,\n\t\t\t\t'cantidad' => $v['cantidad']\n\t\t\t\t];\n\t\t\t\t// agrego el partido y el grafico\n\t\t\t\tif(! in_array($partido_nombre,$partidos)){\n\t\t\t\t\t$partidos[] = $partido_nombre;\n\t\t\t\t\t$x = new StdClass(); // objeto vacio\n\t\t\t\t\t$x->name = $partido_nombre;\n\t\t\t\t\t$x->rank = 0;\n\t\t\t\t\t$x->weight = count($partidos); //'Yellow'; cargar desde JS\n\t\t\t\t\t$x->id = 1;\n\t\t\t\t\t$x->children = [];\n\t\t\t\t\t$children_partidos[] = $x;\n\t\t\t\t}\n\t\t\t\t// obtengo el indice del partido y lo inserto\n\t\t\t\t$index = array_search($partido_nombre,$partidos);\n\t\t\t\t$t = new StdClass(); // objeto vacio\n\t\t\t\t$t->name = $v['nombre'] . ' ' . $v['apellido'] . \" (\" . $v['cantidad'] . \")\";\n\t\t\t\t$t->rank = $v['cantidad'];\n\t\t\t\t$t->weight = $i_actor; //'Yellow'; cargar desde JS\n\t\t\t\t$t->id = 1;\n\t\t\t\t$t->children = [];\n\t\t\t\t// lo agrego al padre correspondiente\n\t\t\t\t$children_partidos[ $index ]->children[] = $t;\n\t\t\t\t$children_partidos[ $index ]->rank += 1;\n\t\t\t}\n\t\t\t++$i_actor;\n\t}\n\t// grafico\n\t/*$oficialismo = new StdClass(); // objeto vacio\n\t$oficialismo->name = 'Oficialismo';\n\t$oficialismo->rank = 0;\n\t$oficialismo->weight = 'Yellow';\n\t$oficialismo->id = 1;\n\t$oficialismo->children = [];*/\n\t\n\t// creo los objetos partidos\n\t\n\t/*foreach($partidos as $p){\n\t\t$x = new StdClass(); // objeto vacio\n\t\t$x->name = $p;\n\t\t$x->rank = 0;\n\t\t$x->weight = 0; //'Yellow'; cargar desde JS\n\t\t$x->id = 1;\n\t\t$x->children = [];\n\t}*/\n\t\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Partidos';\n\t$objeto->rank = 0;\n\t$objeto->weight = 'Gray';\n\t$objeto->id = 1;\n\t$objeto->children = $children_partidos;\n\t\n\t\n\t/*foreach($tabla as $v){\n\t\t$sub = new StdClass(); // objeto vacio\n\t\t$sub->name = $v['actor'] . ' (' . $v['cantidad'] . ')';\n\t\t$sub->rank = $v['cantidad'];\n\t\t// $sub->weight = 0;\n\t\t$sub->cantidad = $v['cantidad'];\n\t\t$sub->id = 1;\n\t\t$sub->children = [ ];\n\t\tif($v['campo'] == 'oposicion'){\n\t\t\t$i_op += 1;\n\t\t\t$sub->weight = 'Blue';\n\t\t\t$oposicion->children[] = $sub;\n\t\t}\n\t\telse{ \n\t\t\t$i_of += 1;\n\t\t\t$sub->weight = 'White';\n\t\t\t$oficialismo->children[] = $sub;\n\t\t}\n\t}*/\n\t\n\t\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto\n\t\t// ,'temas' => $temas\n\t\t];\n}", "public function buildRelations()\n\t{\n\t\t$this->addRelation('AmistadRelatedById_usuario', 'Amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'AmistadsRelatedById_usuario');\n\t\t$this->addRelation('AmistadRelatedByid_usuarioamigo', 'Amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuarioamigo', ), null, null, 'AmistadsRelatedByid_usuarioamigo');\n\t\t$this->addRelation('Calificacion', 'Calificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Calificacions');\n\t\t$this->addRelation('Comentario', 'Comentario', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Comentarios');\n\t\t$this->addRelation('LibroRelatedByUsuario_ult_acc', 'Libro', RelationMap::ONE_TO_MANY, array('id' => 'usuario_ult_acc', ), null, null, 'LibrosRelatedByUsuario_ult_acc');\n\t\t$this->addRelation('LibroRelatedById_usuario', 'Libro', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'LibrosRelatedById_usuario');\n\t\t$this->addRelation('Usuario_intereses', 'Usuario_intereses', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Usuario_interesess');\n\t\t$this->addRelation('Lista', 'Lista', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Listas');\n\t\t$this->addRelation('Libro_colaborador', 'Libro_colaborador', RelationMap::ONE_TO_MANY, array('id' => 'idusuario', ), null, null, 'Libro_colaboradors');\n\t\t$this->addRelation('Libro_version', 'Libro_version', RelationMap::ONE_TO_MANY, array('id' => 'idusuario', ), null, null, 'Libro_versions');\n\t\t$this->addRelation('MensajeRelatedById_usuario_destinatario', 'Mensaje', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_destinatario', ), null, null, 'MensajesRelatedById_usuario_destinatario');\n\t\t$this->addRelation('MensajeRelatedById_usuario_remitente', 'Mensaje', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_remitente', ), null, null, 'MensajesRelatedById_usuario_remitente');\n\t\t$this->addRelation('NotificacionRelatedById_emisor', 'Notificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_emisor', ), null, null, 'NotificacionsRelatedById_emisor');\n\t\t$this->addRelation('NotificacionRelatedById_receptor', 'Notificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_receptor', ), null, null, 'NotificacionsRelatedById_receptor');\n\t\t$this->addRelation('Solicitud_amistadRelatedById_usuario_solicitado', 'Solicitud_amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitado', ), null, null, 'Solicitud_amistadsRelatedById_usuario_solicitado');\n\t\t$this->addRelation('Solicitud_amistadRelatedById_usuario_solicitante', 'Solicitud_amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitante', ), null, null, 'Solicitud_amistadsRelatedById_usuario_solicitante');\n\t\t$this->addRelation('Solicitud', 'Solicitud', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitante', ), null, null, 'Solicituds');\n\t\t$this->addRelation('Postulantes', 'Postulantes', RelationMap::ONE_TO_MANY, array('id' => 'id_postulante', ), null, null, 'Postulantess');\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('Genero', 'Genero', RelationMap::MANY_TO_ONE, array('id_genero' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tematica', 'Tematica', RelationMap::MANY_TO_ONE, array('id_tematica' => 'id', ), null, 'CASCADE');\n $this->addRelation('Autor', 'Autor', RelationMap::MANY_TO_ONE, array('id_autor' => 'id', ), null, 'CASCADE');\n $this->addRelation('Materia', 'Materia', RelationMap::MANY_TO_ONE, array('id_materia' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tipopublicacion', 'Tipopublicacion', RelationMap::MANY_TO_ONE, array('id_tipopublicacion' => 'id', ), null, 'CASCADE');\n\t}", "public function actividadesPorSegmento()\n {\n //\n }", "public function buildRelations()\n {\n $this->addRelation('Contrarecibo', 'Contrarecibo', RelationMap::MANY_TO_ONE, array('idcontrarecibo' => 'idcontrarecibo', ), 'CASCADE', 'CASCADE');\n }", "function recreer_jointures_mots($id_mot_annonce, $id_mot_ferme, $mots_preced, $mots_base) {\n\tforeach($mots_base as $m) {\n\t\t$id_nouv = ($m==\"annonce\")?$id_mot_annonce:$id_mot_ferme;\n\t\tif($mots_preced[$m]!=0) {\n\t\t\t# recup jointure mot - articles\n\t\t\t$qa = sql_select(\"id_article\",\"spip_mots_articles\",\"id_mot=\"._q($mots_preced[$m]));\n\t\t\twhile ($ra = sql_fetch($qa)) {\n\t\t\t\t$id_art = $ra['id_article'];\n\t\t\t\t@sql_insertq(\"spip_mots_articles\",array('id_mot'=> $id_nouv, 'id_article'=> $id_art) );\n\t\t\t}\n\n\t\t\t# recup jointure mot - posts\n\t\t\t$qf = sql_select(\"id_forum\",\"spip_mots_forum\",\"id_mot=\"._q($mots_preced[$m]));\n\t\t\twhile ($rf=sql_fetch($qf)) {\n\t\t\t\t$id_post = $rf['id_forum'];\n\t\t\t\t\t@sql_insertq(\"spip_mots_forum\",array( 'id_mot'=>$id_nouv, 'id_forum'=>$id_post) );\n\t\t\t}\n\t\t}\n\t}\n}", "public function buildRelations()\n\t{\n $this->addRelation('Aviso', 'Aviso', RelationMap::MANY_TO_ONE, array('aviso_id' => 'id', ), 'RESTRICT', null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), 'RESTRICT', null);\n\t}", "public function buildRelations()\n {\n $this->addRelation('Moneda', 'Moneda', RelationMap::MANY_TO_ONE, array('moneda_id' => 'id', ), null, null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, array('usuario_id' => 'id', ), null, null);\n $this->addRelation('Negocio', 'Negocio', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'Negocios');\n $this->addRelation('DireccionRequerimiento', 'DireccionRequerimiento', RelationMap::ONE_TO_MANY, array('id' => 'requerimiento_id', ), null, null, 'DireccionRequerimientos');\n }", "public function traerModulos()\n {\n $modeloPermisos = new \\App\\Models\\ModeloPermisos();\n $permisos = $modeloPermisos->traerDePerfil($_SESSION[\"id_perfil\"], $_SESSION[\"id_cliente\"]);\n\n // Modulos a lo que tiene acceso el usuario\n $modeloModulos = new \\App\\Models\\ModeloModulos();\n $i = 0;\n $modulos = []; // Modulos en general al que tiene acceso\n $hijos = []; // SubModulos de '$modulos' al que tiene acceso\n foreach ($permisos as $permiso)\n {\n // Obtenemos un modulo padre\n $modulosHijos = $modeloModulos->traerHijos($permiso[\"id_modulo\"], $permiso[\"id_cliente\"]);\n $j = 0;\n // Obtenemos los hijos del modulo padre\n foreach ($modulosHijos as $nhijos)\n {\n // Guardamos hijos\n $hijos[$j++] = [\"modulo\" => $nhijos[\"modulo\"], \"url\" => $nhijos[\"url\"]];\n }\n // Guardamos padres\n $modulos[$i++] = [\"modulo\" => $permiso[\"modulo\"], \"hijos\" => $hijos];\n $j = 0;\n $hijos = [];\n }\n // Limpiar aquellos modulos sin hijos\n $nmodulos = []; // Datos para el menu\n $i = 0;\n foreach ($modulos as $modulo)\n {\n if (empty($modulo[\"hijos\"]))\n continue;\n $nmodulos[$i++] = [\"modulo\" => $modulo[\"modulo\"], \"hijos\" => $modulo[\"hijos\"]];\n }\n\n return $nmodulos;\n }", "public function corregir_boletas_por_sector($sectores = 0, $mes = 0, $anio = 0)\n\t{\n\t\t// if($sectores == 0 )\n\t\t// \t$sectores = $this->input->post('select_tablet');\n\t\t// if($mes == 0 )\n\t\t// \t$mes = $this->input->post('mes');\n\t\t// if($anio == 0 )\n\t\t// \t$anio = $this->input->post('anio');\n\t\t// if($sectores === 0 )\n\t\t// \t{\n\t\t// \t\techo \"Error\";die();\n\t\t// \t}\n\t\t// elseif($sectores == \"A\")\n\t\t// \t$sectores = [ \"A\", \"Jardines del Sur\", \"Aberanstain\", \"Medina\", \"Salas\", \"Santa Barbara\" , \"V Elisa\"];\n\t\t// else $sectores = [ \"B\", \"C\", \"David\", \"ASENTAMIENTO OLMOS\", \"Zaldivar\" ];\n\t\t$todas_las_variables = $this->Nuevo_model->get_data(\"configuracion\");\n\t\t$mediciones_desde_query = $this->Nuevo_model->get_sectores_query_corregir($sectores, $mes, $anio );\n\t\t//var_dump($mediciones_desde_query);die();\n\t\tif($mediciones_desde_query != false)\n\t\t{\n\t\t\t$indice_actual = 0;\n\t\t\tforeach ($mediciones_desde_query as $key ) {\n\t\t\t\tif( ($key->Factura_MedicionAnterior == 0) && ($key->Factura_MedicionActual == 1) ) // bandera de tablet\n\t\t\t\t\tcontinue;\n\t\t\t\tif( ( floatval($key->Factura_PagoMonto) != floatval(0)) && ($key->Factura_PagoContado != NULL) && ($key->Factura_PagoContado != NULL) ) //si esta pagada no se re calcula\n\t\t\t\t\tcontinue;\n\t\t\t\tif( ($key->Conexion_Categoria == 1) || ($key->Conexion_Categoria == \"Familiar\") || ($key->Conexion_Categoria ==\"Familiar \") )\n\t\t\t\t{\n\t\t\t\t\t$precio_metros = $todas_las_variables[3]->Configuracion_Valor;\n\t\t\t\t\t$metros_basicos = $todas_las_variables[5]->Configuracion_Valor;\n\t\t\t\t\t$precio_bsico = $todas_las_variables[4]->Configuracion_Valor;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$precio_metros = $todas_las_variables[6]->Configuracion_Valor;\n\t\t\t\t\t$metros_basicos = $todas_las_variables[8]->Configuracion_Valor;\n\t\t\t\t\t$precio_bsico = $todas_las_variables[7]->Configuracion_Valor;\n\t\t\t\t}\n\t\t\t\t$anterior = $key->Factura_MedicionAnterior;\n\t\t\t\t$actual = $key->Factura_MedicionActual;\n\t\t\t\t$inputExcedente = intval($actual) - intval($anterior) - intval($metros_basicos);\n\t\t\t\tif($inputExcedente < 0 )\n\t\t\t\t\t$inputExcedente = 0;\n\t\t\t\t$importe_medicion = 0;\n\t\t\t\tif($inputExcedente == 0)\n\t\t\t\t\t$importe_medicion = 0;\n\t\t\t\telse $importe_medicion = floatval($precio_metros) * floatval($inputExcedente);\n\t\t\t\t//calculo el subtotal y total\n\t\t\t\t$sub_total = floatval($key->Factura_TarifaSocial) \n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_Deuda)\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_ExcedentePrecio )\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_CuotaSocial )\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_Riego )\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_PM_Cuota_Precio)\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_PPC_Precio)\n\t\t\t\t\t\t\t\t\t\t+ floatval($key->Factura_Multa);\n\t\t\t\t$total = $sub_total;\n\t\t\t\t$bonificacion = 0;\n\t\t\t\tif($key->Conexion_Deuda == 0)\n\t\t\t\t\t\t//$bonificacion_pago_puntual = (floatval ($excedente) + floatval($tarifa_basica)) * floatval (5) / floatval(100) ;//con bonificacion\n\t\t\t\t\t\t$bonificacion = (floatval ($inputExcedente) + floatval($key->Factura_TarifaSocial)) * floatval (5) / floatval(100) ;//con bonificacion\n\t\t\t\t$total =\tfloatval($total)\n\t\t\t\t\t\t\t\t\t\t- floatval($key->Factura_Acuenta)\n\t\t\t\t\t\t\t\t\t\t- floatval($bonificacion);\n\t\t\t\t//vtos\n\t\t\t\t$vto_2_precio = floatval($total) + floatval($total) * floatval($todas_las_variables[18]->Configuracion_Valor);\n\t\t\t\t$vto_1_precio = $total;\n\t\t\t\t$indice_actual++;\n\t\t\t\t$datos_factura_nueva = array(\n\t\t\t\t\t'Factura_SubTotal' => floatval($sub_total),\n\t\t\t\t\t'Factura_Total' => floatval($total),\n\t\t\t\t\t'Factura_Vencimiento1_Precio' => floatval($vto_1_precio),\n\t\t\t\t\t'Factura_Vencimiento2_Precio' => floatval($vto_2_precio),\n\t\t\t\t\t'Factura_ExcedentePrecio' => floatval($importe_medicion),\n\t\t\t\t\t'Factura_Excedentem3' => $inputExcedente\n\t\t\t\t\t );\n\t\t\t\t$resultado[$indice_actual] = $this->Nuevo_model->update_data_tres_campos($datos_factura_nueva, $key->Conexion_Id, \"facturacion_nueva\",\"Factura_Conexion_Id\", \"Factura_Mes\", $mes, \"Factura_Año\", $anio);\n\t\t\t\tvar_dump($datos_factura_nueva,$key->Conexion_Id);\n\t\t\t}\n\t\t\tvar_dump($datos_factura_nueva);\n\t\t}\n\t\telse\n\t\t\tvar_dump(\"Error. no hay medciones para las variables\");\t\n\t}", "function grafico_1( $desde, $hasta, $ua ){\n\t$query = \"select nested.id_cliente, noticiasactor.id_actor, nested.tema from \"\n\t. \"( select procesados.* from ( select noticiascliente.* from noticiascliente inner join proceso on noticiascliente.id_noticia = proceso.id_noticia where noticiascliente.id_cliente = \" . $ua . \" ) procesados \"\n\t. \"inner join noticia on noticia.id = procesados.id_noticia where noticia.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59') nested \"\n\t. \"inner join noticiasactor on nested.id_noticia = noticiasactor.id_noticia order by id_actor asc \";\n\t$main = R::getAll($query);\n\t// obtengo el nombre de la unidad de analisis\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\t// obtengo los nombres de todos los actores, para cruzar\n\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[4]) ;\n\t//var_dump($actores_nombres['nombre'] . \" \" . $actores_nombres['apellido']);\n\n\t$tabla = [];\n\t$temas = [];\n\t$i = -1;\n\t// reemplazo actores por nombres y temas\n\tforeach($main as $k=>$v){\n\t\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[ $v['id_actor'] ]);\n\t\t$main[$k]['id_cliente'] = $ua_nombre;\n\t\t// $main[$k]['id_actor'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$main[$k]['id_actor'] = $v['id_actor'];\n\t\t$main[$k]['nombre'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$id_tema = get_string_between($main[$k]['tema'],\"frm_tema_\",\"\\\"\");\n\t\t$tema = R::findOne(\"attr_temas\",\"id LIKE ?\",[$id_tema])['nombre'];\n\t\tif( is_null( $tema ) ) $tema = 'TEMA NO ASIGNADO';\n\t\t$main[$k]['tema'] = $tema;\n\t\t\n\t\t// if(array_search( [ $main[$k]['id_actor'],$tema], $tabla ) ) echo \"repetido\";\n\t\t// chequeo si ya existe alguno con este actor y tema, si es asi, sumo uno\n\t\t// TODO - FIXME : deberia ser mas eficiente, busqueda por dos valores\n\t\t$iter = true;\n\t\tforeach($tabla as $ka=>$va){\n\t\t\t// if($va['actor'] == $main[$k]['id_actor'] && $va['tema'] == $tema){\n\t\t\tif($va['actor'] == $main[$k]['nombre'] && $va['tema'] == $tema){\n\t\t\t\t$tabla[$ka]['cantidad'] += 1;\n\t\t\t\t$iter = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($iter){\n\t\t\t$tabla[ ++$i ] = [ \n\t\t\t\t'unidad_analisis' => $ua_nombre,\n\t\t\t\t'actor' => $main[$k]['nombre'],\n\t\t\t\t'id_actor' => $main[$k]['id_actor'],\n\t\t\t\t'tema' => $tema,\n\t\t\t\t'cantidad' => 1\n\t\t\t\t];\n\t\t\t}\n\t\t// agrego los temas que van apareciendo en la tabla temas\n\t\t// UTIL para poder hacer el CRC32 por la cantidad de colores\n\t\tif(!in_array($tema,$temas)) $temas[] = $tema;\n\t}\n\t// la agrupacion de repetidos es por aca, por que repite y cuenta temas de igual id\n\n\t// en el grafico, los hijos, son arreglos de objetos, hago una conversion tabla -> objeto\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Actores';\n\t$objeto->rank = 0;\n\t$objeto->weight = 1;\n\t$objeto->id = 1;\n\t$objeto->children = [];\n\tforeach($tabla as $k=>$v){\n\t\t// me fijo si el actor existe, ineficiente pero por ahora\n\t\t$NoExiste = true;\n\t\tforeach($objeto->children as $ka=>$va){\n\t\t\t// si existe actor, le inserto el tema\n\t\t\tif($va->name == $v['actor']){\n\t\t\t\t$in = new StdClass();\n\t\t\t\t// $in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$in->name = \"\";\n\t\t\t\t$in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t\t$in->id = $k;\n\t\t\t\t$in->children = [];\n\t\t\t\t$objeto->children[$ka]->children[] = $in;\n\t\t\t\t$objeto->children[$ka]->cantidad_temas = count($objeto->children[$ka]->children);\t\n\t\t\t\t$objeto->children[$ka]->rank = count($objeto->children[$ka]->children);\n\t\t\t\t$NoExiste = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($NoExiste){\n\t\t\t$in = new StdClass();\n\t\t\t$in->name = $v['actor'];\n\t\t\t$in->rank = 1;\n\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t$in->id = $k;\n\t\t\t//$in->id = $v['id_actor'];\n\t\t\t$in->id_actor = $v['id_actor'];\n\t\t\t\t$t_in = new StdClass();\n\t\t\t\t// $t_in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$t_in-> name = \"\";\n\t\t\t\t$t_in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$t_in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$t_in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$t_in->weight = 0; // lo asigna JS\n\t\t\t\t$t_in->id = $k;\n\t\t\t\t$t_in->children = [];\n\t\t\t$in->children = [ $t_in ];\n\t\t\t$objeto->children[] = $in;\n\t\t}\n\t}\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto,\n\t\t'temas' => $temas\n\t\t];\n}", "function grafico_1_2( $desde, $hasta, $ua ){\n\t// aclarar al cliente que debe setear campos bien definidos y NO PERMITIR AMBIGUEDADES\n\t\n\t$query = \"select actor.nombre, actor.apellido, actor.id_campo, count(noticiasactor.id_actor) as cantidad from noticiascliente \"\n\t\t. \"inner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \"\n\t\t. \"inner join noticias on noticiasactor.id_noticia = noticias.id \"\n\t\t. \"inner join actor on noticiasactor.id_actor = actor.id \"\n\t\t. \"where \"\n\t\t\t. \"noticiascliente.id_cliente = \" . $ua . \" and \"\n\t\t\t. \"noticiascliente.elim = 0 and \"\n\t\t\t. \"noticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \"\n\t\t\t// SOLO QUIENES TIENEN 3 Y 4 COMO CAMPO\n\t\t\t. \" and ( actor.id_campo like '%3%' or actor.id_campo like '%4%' ) \"\n\t\t. \"group by noticiasactor.id_actor order by cantidad desc\";\n\t$main = R::getAll($query);\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\n\t// var_dump($main);\n\t$tabla = [];\n\t// unidad de analisis, campo, actor, cantidad de menciones\n\t$i = -1;\n\tforeach($main as $k=>$v){\n\t\t// por ahora solo considero los dos posibles campos\n\t\t$tabla[ ++$i ] = [\n\t\t\t'ua' => $ua_nombre,\n\t\t\t'campo' => ( strpos( $v['id_campo'], '3' ) !== false ) ? 'oposicion' : 'oficialismo',\n\t\t\t'actor' => $v['apellido'] . ' ' . $v['nombre'],\n\t\t\t'cantidad' => $v['cantidad']\n\t\t\t];\n\t}\n\t// var_dump($tabla);\n\t\n\t// grafico\n\t$oficialismo = new StdClass(); // objeto vacio\n\t$oficialismo->name = 'Oficialismo';\n\t$oficialismo->rank = 0;\n\t$oficialismo->weight = 'Yellow';\n\t$oficialismo->id = 1;\n\t$oficialismo->children = [];\n\t\n\t$oposicion = new StdClass(); // objeto vacio\n\t$oposicion->name = 'Oposicion';\n\t$oposicion->rank = 0;\n\t$oposicion->weight = 'LightBlue';\n\t$oposicion->id = 1;\n\t$oposicion->children = [];\n\t\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Campos';\n\t$objeto->rank = 0;\n\t$objeto->weight = 'Gray';\n\t$objeto->id = 1;\n\t$objeto->children = [ $oficialismo, $oposicion ];\n\t\n\t$i_of = 0;\n\t$i_op = 0;\n\t\n\tforeach($tabla as $v){\n\t\t$sub = new StdClass(); // objeto vacio\n\t\t$sub->name = $v['actor'] . ' (' . $v['cantidad'] . ')';\n\t\t$sub->rank = $v['cantidad'];\n\t\t// $sub->weight = 0;\n\t\t$sub->cantidad = $v['cantidad'];\n\t\t$sub->id = 1;\n\t\t$sub->children = [ ];\n\t\tif($v['campo'] == 'oposicion'){\n\t\t\t$i_op += 1;\n\t\t\t$sub->weight = 'Blue';\n\t\t\t$oposicion->children[] = $sub;\n\t\t}\n\t\telse{ \n\t\t\t$i_of += 1;\n\t\t\t$sub->weight = 'White';\n\t\t\t$oficialismo->children[] = $sub;\n\t\t}\n\t}\n\t\n\t$oposicion->rank = $i_op;\n\t$oficialismo->rank = $i_of;\n\t\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto\n\t\t// ,'temas' => $temas\n\t\t];\n\t\n}", "public function buildRelations()\n\t{\n\t\t$this->addRelation('Cargo', 'Cargo', RelationMap::MANY_TO_ONE, array('cargo_id' => 'id', ), null, null);\n\t\t$this->addRelation('Departamento', 'Departamento', RelationMap::MANY_TO_ONE, array('departamento_id' => 'id', ), null, null);\n\t\t$this->addRelation('Endereco', 'Endereco', RelationMap::MANY_TO_ONE, array('endereco_id' => 'id', ), null, null);\n\t\t$this->addRelation('Perfil', 'Perfil', RelationMap::MANY_TO_ONE, array('perfil_id' => 'id', ), null, null);\n\t\t$this->addRelation('Auditoria', 'Auditoria', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Auditorias');\n\t\t$this->addRelation('AvaliacaoRespostaForum', 'AvaliacaoRespostaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'AvaliacaoRespostaForums');\n\t\t$this->addRelation('ColetaPesquisa', 'ColetaPesquisa', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'ColetaPesquisas');\n\t\t$this->addRelation('ComentarioNoticia', 'ComentarioNoticia', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'ComentarioNoticias');\n\t\t$this->addRelation('CurtidaForum', 'CurtidaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'CurtidaForums');\n\t\t$this->addRelation('Noticia', 'Noticia', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Noticias');\n\t\t$this->addRelation('Pesquisa', 'Pesquisa', RelationMap::ONE_TO_MANY, array('id' => 'criador_id', ), null, null, 'Pesquisas');\n\t\t$this->addRelation('PesquisaHabilitada', 'PesquisaHabilitada', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'PesquisaHabilitadas');\n\t\t$this->addRelation('Premio', 'Premio', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'Premios');\n\t\t$this->addRelation('RespostaForum', 'RespostaForum', RelationMap::ONE_TO_MANY, array('id' => 'usuario_id', ), null, null, 'RespostaForums');\n\t\t$this->addRelation('SolicitacaoResgateRelatedByAprovadorId', 'SolicitacaoResgate', RelationMap::ONE_TO_MANY, array('id' => 'aprovador_id', ), null, null, 'SolicitacaoResgatesRelatedByAprovadorId');\n\t\t$this->addRelation('SolicitacaoResgateRelatedBySolicitanteId', 'SolicitacaoResgate', RelationMap::ONE_TO_MANY, array('id' => 'solicitante_id', ), null, null, 'SolicitacaoResgatesRelatedBySolicitanteId');\n\t}", "function getTitulos() {\n //arreglo para remplazar los titulos de las columnas \n $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\n $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\n\n $titulos_campos['der_id'] = COD_DEPARTAMENTO_REGION;\n $titulos_campos['der_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\n\n $titulos_campos['mun_id'] = COD_MUNICIPIO;\n $titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\n $titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\n\n $titulos_campos['ope_id'] = OPERADOR;\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\n $titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\n $titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\n\n $titulos_campos['Id_Ciudad'] = TITULO_CIUDAD;\n $titulos_campos['Id_Pais'] = NOMBRE_PAIS;\n $titulos_campos['Nombre_Ciudad'] = NOMBRE_CIUDAD;\n\n $titulos_campos['Nombre_Pais'] = NOMBRE_PAIS;\n\n $titulos_campos['Id_Familia'] = TITULO_FAMILIAS;\n $titulos_campos['Descripcion_Familia'] = DESCRIPCION_FAMILIA;\n\n $titulos_campos['Id_Moneda'] = TITULO_MONEDA;\n $titulos_campos['Descripcion_Moneda'] = DESCRIPCION_MONEDA;\n\n $titulos_campos['cfi_numero'] = CUENTA_NUMERO;\n $titulos_campos['cfi_nombre'] = CUENTA_NOMBRE;\n\n $titulos_campos['cft_id'] = CUENTA_TIPO;\n $titulos_campos['cft_nombre'] = CUENTA_TIPO;\n\n $titulos_campos['mov_descripcion'] = MOVIMIENTO_DESCRIPCION;\n $titulos_campos['mov_tipo'] = MOVIMIENTO_TIPO;\n\n $titulos_campos['idCentroPoblado'] = TITULO_CENTRO_POBLADO;\n $titulos_campos['codigoDane'] = CODIGO_DANE_CENTRO_POBLADO;\n $titulos_campos['nombre'] = NOMBRE_CENTRO_POBLADO;\n $titulos_campos['mun_id'] = MUNICIPIO_CENTRO_POBLADO;\n\n $titulos_campos['enc_tipo_nombre'] = TIPO_INSTRUMENTO;\n $titulos_campos['enc_tipo_desc'] = DESCRIPCION_ACTIVIDAD;\n\n $titulos_campos['Descripcion_Tipo'] = \"Plan\";\n \n $titulos_campos['descripcionTipoHallazgo'] = DESCRIPCION_TIPO_HALLAZGO;\n $titulos_campos['descripcion'] = AREA_TIPO_HALLAZGO;\n\n return $titulos_campos;\n }", "public function buildRelations()\n\t{\n $this->addRelation('CuadreCaja', 'CuadreCaja', RelationMap::MANY_TO_ONE, array('id_cuadre_caja' => 'id_cuadre_caja', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdPersona', 'Persona', RelationMap::MANY_TO_ONE, array('id_persona' => 'id_persona', ), 'RESTRICT', null);\n $this->addRelation('PersonaRelatedByIdAutoriza', 'Persona', RelationMap::MANY_TO_ONE, array('id_autoriza' => 'id_persona', ), 'RESTRICT', null);\n\t}", "function generarOrden($arreglo){\n $nomEstadoItemOK = $this->datos->traerIdEstadoItemOK();\n $idEstadoEnUso = $this->datos->traerIdEstadoUso();\n $idEstadoOfertado = $this->datos->traerIdEstadoOferProd();\n $idEstadoOfertaEco = $this->datos->traerIdEstadoOferOK();\n \n //ACTUALIZO ESTADO ITEM OFERTA OK\n $this->datos->actualizaEstadoItemOK($arreglo[\"idOfe\"],$nomEstadoItemOK->nomEstado);\n \n //ACTUALIZO ESTADO OFERTA\n $this->datos->actualizaEstadoOfertaCom($arreglo[\"idOfe\"],$idEstadoOfertaEco->idEstadoOfOk);\n $ofertaEconomica = $this->datos->datosOfertaEconomica($arreglo[\"idOfe\"]);\n \n $idDetProductoOfertado = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n /* \n $idDetProductoEnUso = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n //ACTUALIZO ESTADO PRODUCTO\n foreach ($idDetProductoEnUso as $key => $valueProdOrden) {\n \n $this->datos->actualizaCantidadDetProd($valueProdOrden[\"idDetalle\"],$idEstadoEnUso->idEnUso);\n }\n \n $idDetProducto = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoEnUso->idEnUso);*/\n \n //INSERTO ENCABEZADO \n $idOrdenCompra = $this->datos->insertarOrdenCompra($ofertaEconomica,$arreglo[\"idOfe\"]);\n \n //INSERTO DETALLE\n foreach ($idDetProductoOfertado as $key => $valueDetOfe) {\n \n $this->datos->insertarOrdenDes($valueDetOfe[\"idDetalle\"],$idOrdenCompra);\n \n }\n \n $this->mostrarOfertaEconomica($arreglo);\n \n }", "public function buildRelations()\n {\n $this->addRelation('UnitUsaha', 'DataDikdas\\\\Model\\\\UnitUsaha', RelationMap::MANY_TO_ONE, array('unit_usaha_id' => 'unit_usaha_id', ), 'RESTRICT', 'RESTRICT');\n $this->addRelation('Mou', 'DataDikdas\\\\Model\\\\Mou', RelationMap::MANY_TO_ONE, array('mou_id' => 'mou_id', ), 'RESTRICT', 'RESTRICT');\n $this->addRelation('SumberDana', 'DataDikdas\\\\Model\\\\SumberDana', RelationMap::MANY_TO_ONE, array('sumber_dana_id' => 'sumber_dana_id', ), 'RESTRICT', 'RESTRICT');\n }", "public function aviones(){\n\t\t//la relacion es de 1 a muchos: 1 fabricante tiene muchos aviones\n\t\treturn $this->hasMany('App\\Avion');\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('Organisatie', 'Organisatie', RelationMap::MANY_TO_ONE, array('organisatie_id' => 'id', ), null, null);\n $this->addRelation('Contact', 'Contact', RelationMap::ONE_TO_MANY, array('id' => 'persoon_id', ), null, null);\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('Tbformacao', 'Tbformacao', RelationMap::MANY_TO_ONE, array('id_formacao' => 'id_formacao', ), null, null);\n $this->addRelation('Tbcurso', 'Tbcurso', RelationMap::MANY_TO_ONE, array('cod_curso' => 'cod_curso', ), null, null);\n $this->addRelation('Tbturno', 'Tbturno', RelationMap::MANY_TO_ONE, array('id_turno' => 'id_turno', ), null, null);\n $this->addRelation('Tbcampus', 'Tbcampus', RelationMap::MANY_TO_ONE, array('id_campus' => 'id_campus', ), null, null);\n $this->addRelation('Tbsetor', 'Tbsetor', RelationMap::MANY_TO_ONE, array('id_setor' => 'id_setor', ), null, null);\n $this->addRelation('Tbalunomatricula', 'Tbalunomatricula', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbalunobackup', 'Tbalunobackup', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbfilacalouros', 'Tbfilacalouros', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbvagas', 'Tbvagas', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbloadaluno', 'Tbloadaluno', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbaluno', 'Tbaluno', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbcurriculodisciplinas', 'Tbcurriculodisciplinas', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbdisciplinarequisitos', 'Tbdisciplinarequisitos', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbdisciplinacorequisitos', 'Tbdisciplinacorequisitos', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbcoordenadorcurso', 'Tbcoordenadorcurso', RelationMap::ONE_TO_MANY, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n\t}", "public function obtenerViajesplus();", "public function listaDelitos(){\n\t $ofen=0;\n\t $indi=0;\n\t $arreglo = array();\n\n if (count($this->getOfeindis())>0){\n $ldelitos= Load::model('ofeindis')->find(\"ordenes_id = \".$this->id,\"order: indiciados_id,ofendidos_id,delitos_id\");\n }\n\n foreach ($ldelitos as $key) { // aqui se escoge a los imputados y victimas que no se repiten\n if($key->ofendidos_id !=$ofen || $key->indiciados_id !=$indi){\n array_push($arreglo,array('idel'=>$key->id,'ofendido'=>$key->getOfendidos(), 'indiciado'=>$key->getIndiciados()));\n }\n $ofen=$key->ofendidos_id;\n $indi=$key->indiciados_id;\n }\n\n for ($i=0; $i <count($arreglo) ; $i++) { // aqui voy metiendo un arreglo de delitos para cada uno\n $delitos=array();\n foreach ($ldelitos as $key) {\n if($key->ofendidos_id==$arreglo[$i]['ofendido']->id && $key->indiciados_id==$arreglo[$i]['indiciado']->id ){\n array_push($delitos,array('delito'=>$key->getDelitos(),'iddeli'=>$key->id,'principal'=>$key->esprincipal)); \n }\n } \n $arreglo[$i]['delitos']=$delitos; \n }\n return $arreglo;\n\n\t\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('SftOrganismo', 'SftOrganismo', RelationMap::ONE_TO_MANY, array('id' => 'id_pais', ), 'SET NULL', 'CASCADE');\n $this->addRelation('SftPersona', 'SftPersona', RelationMap::ONE_TO_MANY, array('id' => 'id_paisdocidentificacion', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('GenPaisI18n', 'GenPaisI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', 'CASCADE');\n\t}", "public function buildRelations()\n\t{\n $this->addRelation('Tbnecesespecial', 'Tbnecesespecial', RelationMap::MANY_TO_ONE, array('id_neces_especial' => 'id_neces_especial', ), null, null);\n $this->addRelation('Tbcidade', 'Tbcidade', RelationMap::MANY_TO_ONE, array('naturalidade' => 'id_cidade', ), null, null);\n $this->addRelation('Tbpais', 'Tbpais', RelationMap::MANY_TO_ONE, array('nacionalidade' => 'id_pais', ), null, null);\n $this->addRelation('TblogradouroRelatedByCep', 'Tblogradouro', RelationMap::MANY_TO_ONE, array('cep' => 'cep', ), null, null);\n $this->addRelation('Tbcursoversao', 'Tbcursoversao', RelationMap::MANY_TO_ONE, array('id_versao_curso' => 'id_versao_curso', ), null, null);\n $this->addRelation('Tbtipoingresso', 'Tbtipoingresso', RelationMap::MANY_TO_ONE, array('id_tipo_ingresso' => 'id_tipo_ingresso', ), null, null);\n $this->addRelation('Tbalunosituacao', 'Tbalunosituacao', RelationMap::MANY_TO_ONE, array('id_situacao' => 'id_situacao', ), null, null);\n $this->addRelation('TbinstexternaRelatedByIdDestino', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_destino' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedById2grau', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_2grau' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedById3grau', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_3grau' => 'id_inst_externa', ), null, null);\n $this->addRelation('TbinstexternaRelatedByIdTrabalho', 'Tbinstexterna', RelationMap::MANY_TO_ONE, array('id_trabalho' => 'id_inst_externa', ), null, null);\n $this->addRelation('TblogradouroRelatedByCepTrabalho', 'Tblogradouro', RelationMap::MANY_TO_ONE, array('cep_trabalho' => 'cep', ), null, null);\n $this->addRelation('Tbpolos', 'Tbpolos', RelationMap::MANY_TO_ONE, array('id_polo' => 'id_polo', ), null, null);\n $this->addRelation('Tbalunoracacor', 'Tbalunoracacor', RelationMap::MANY_TO_ONE, array('id_raca' => 'id_raca', ), null, null);\n $this->addRelation('Tbpendencia', 'Tbpendencia', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunodiploma', 'Tbalunodiploma', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunosenha', 'Tbalunosenha', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbalunosolicitacao', 'Tbalunosolicitacao', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbbanca', 'Tbbanca', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbfila', 'Tbfila', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('Tbhistorico', 'Tbhistorico', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n $this->addRelation('TbturmaAluno', 'TbturmaAluno', RelationMap::ONE_TO_MANY, array('matricula' => 'matricula', ), null, null);\n\t}", "function get_ubicacion()\n {\n $usuario = consultas::get_pf();\n $dep = consultas::get_dep_habilitada();\n if($usuario == 'acor_mesa')\n {\n if($dep['id_dep'] == 3)\n { //-- 3:Mesa de EyS --//\n $datos['motivo'] = 'and m1.id_motivo = 10'; //-- 10: Salida de Mesa de EyS --//\n $datos['ubicacion'] = 'DPTO. MESA DE EyS';\n $datos['ubi'] = 5;\n $datos['id_motivo'] = '10';\n }\n }elseif($usuario == 'acor_carga')\n {\n if($dep['id_dep'] == 1)\n { //-- 1:Gestion de deudas --//\n $datos['motivo'] = 'and m1.id_motivo = 11'; //-- 10: Salida de Gestion de deudas --//\n $datos['ubicacion'] = 'DIR. GESTION DE DEUDAS';\n $datos['ubi'] = 6;\n $datos['id_motivo'] = '11';\n }\n elseif($dep['id_dep'] == 2)\n { //-- 2:Procuracion y legales --//\n $datos['motivo'] = 'and m1.id_motivo = 12'; //-- 10: Salida de Procuracion y legales --//\n $datos['ubicacion'] = 'DIR. PROCURACION Y LEGALES';\n $datos['ubi'] = 7;\n $datos['id_motivo'] = '12';\n }\n }\n return $datos;\n }", "public function contAlumNormal($anio)\n { \n //$gradosMatTercerCiclo=[];$gradosVespertino=[];$gradosCompleto=[];\n //para contar alumnas en periodo normal\n //hay q filtrar por turnos Matutino,Vespertino y Completo\n $match=['anios_id'=>$anio,'turnos_id'=>1];\n $gradosMatutino=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n //$countMat=count($gradosMatutino);\n $arreglo_grados_inscritos_matutino=[];\n for($i=0;$i<count($gradosMatutino);$i++){\n $gradoId=$gradosMatutino[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosMatutino[$i]['grado'].$gradosMatutino[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosMatutino[$i]['categoria'],\n \"capacidad\"=>$gradosMatutino[$i]['capacidad'],\n \"turno\"=>\"matutino\",\n ];\n array_push($arreglo_grados_inscritos_matutino,$aux);\n }\n\n \n $match=['anios_id'=>$anio,'turnos_id'=>2];\n $gradosVespertino=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n $arreglo_grados_inscritos_vespertino=[];\n for($i=0;$i<count($gradosVespertino);$i++){\n $gradoId=$gradosVespertino[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosVespertino[$i]['grado'].$gradosVespertino[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosVespertino[$i]['categoria'],\n \"capacidad\"=>$gradosVespertino[$i]['capacidad'],\n \"turno\"=>\"Vespertino\", \n ];\n array_push($arreglo_grados_inscritos_vespertino,$aux);\n }\n\n //$countVesp=count($gradosVespertino);\n $match=['anios_id'=>$anio,'turnos_id'=>3];\n $gradosCompleto=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n\n $arreglo_grados_inscritos_completo=[];\n for($i=0;$i<count($gradosCompleto);$i++){\n $gradoId=$gradosCompleto[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosCompleto[$i]['grado'].$gradosCompleto[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosCompleto[$i]['categoria'],\n \"capacidad\"=>$gradosCompleto[$i]['capacidad'],\n \"turno\"=>\"completo\",\n ];\n array_push($arreglo_grados_inscritos_completo,$aux);\n }\n\n //$countComp=count($gradosCompleto);\n //dd($gradosCompleto);\n $arreglo_de_grados=[\"gradosMatutino\"=>$arreglo_grados_inscritos_matutino,\n \"gradosVespertino\"=>$arreglo_grados_inscritos_vespertino,\n \"gradosCompleto\"=>$arreglo_grados_inscritos_completo,\n \n ];\n //dd($arreglo_de_grados);\n //dd($arreglo_grados_inscritos_matutino);\n return $arreglo_de_grados;\n //$match=[''=>];\n //$nomMat=matricula::\n\n }", "public function gera_linhas_somatorios()\n\t{\n\t\tif(count($this->somatorios) > 0)\n\t\t{\n\t\t\techo \"<tr class=totalizadores>\";\n\t\t\tfor($i=0; $i < count($this->nome_colunas); $i++)\n\t\t\t{\n\t\t\t\t$alinhamento = $this->nome_colunas[$i][alinhamento];\n\n\t\t\t\tfor($b=0; $b < count($this->somatorios); $b++)\n\t\t\t\t{\n\t\t\t\t\tif($this->nome_colunas[$i][nome_coluna] == $this->somatorios[$b][nome_coluna])\n\t\t\t\t\t{\n\t\t\t\t\t\t$valor = $this->somatorios[$b][total];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// \tVERIFICO SE E PARA IMPRIMIR O VALOR\n\t\t\t\tif($this->nome_colunas[$i][somatorio] == 's')\n\t\t\t\t{\n\t\t\t\t\t//\t ESCOLHO O TIPO DE DADO\n\t\t\t\t\tswitch($this->nome_colunas[$i][tipo])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'moeda':\n\t\t\t\t\t\t\t$valor = Util::exibe_valor_moeda($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t$valor = Util::data_certa($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$valor = $valor;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"\n\t\t\t\t\t\t \t<td align=$alinhamento>\n\t\t\t\t\t\t\t\t\" . $valor . \"\n\t\t\t\t\t\t \t</td>\n\t\t\t\t\t\t \";\n\t\t\t\t\t$valor = '';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<td align=$alinhamento></td>\";\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\techo '</tr>';\n\t\t}\n\t}", "public function buildRelations()\n {\n $this->addRelation('GsHandelsproducten', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsHandelsproducten', RelationMap::MANY_TO_ONE, array('handelsproduktkode' => 'handelsproduktkode', ), null, null);\n $this->addRelation('GsGeneriekeNamen', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsGeneriekeNamen', RelationMap::MANY_TO_ONE, array('generiekenaamkode' => 'generiekenaamkode', ), null, null);\n $this->addRelation('EenheidHoeveelheidOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('eenh_hvh_werkzstof_thesaurus_1' => 'thesaurusnummer', 'eenhhoeveelheid_werkzame_stof_kode' => 'thesaurus_itemnummer', ), null, null);\n $this->addRelation('StamtoedieningswegOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('stamtoedieningsweg_thesaurus_58' => 'thesaurusnummer', 'stamtoedieningsweg_code' => 'thesaurus_itemnummer', ), null, null);\n }", "public function agresores () \n {\n // \"agresor_denuncia\" pero se llama denuncia_agresor por lo que se debe indicar el nombre de la tabla pivot\n return $this->belongsToMany(Agresor::class, 'denuncia_agresor')->whereNull('denuncia_agresor.deleted_at')->withPivot('tblparentesco_id'); \n // withPivot -> agregar la colunma adicional de la tabla pivot en una relacion muchos a muchos.\n }", "function RellenarMinuta()\r\n {\r\n $this->AddPage();\r\n\r\n $this->RellenarTitulo();\r\n\r\n $this->RellenarAsistentes();\r\n\r\n $this->RellenarStatusCompromisosYAsistencias();\r\n\r\n $this->RellenarIndice();\r\n\r\n $this->RellenarDesarrolloReunion();\r\n }", "function GetPeliculasPorGenero($generoNombre){\n $genero = $this->db->prepare(\"SELECT * FROM genero WHERE nombre=?\");//todo de genero del nombre que quiero\n $genero->execute(array($generoNombre));//le asignamos ese nombre\n $arrGenero = $genero->fetchAll(PDO::FETCH_OBJ);//lo pedimos a la base de datos\n //print_r($id_generos[0]->id_genero);//lo imprimimos para ver que tal\n \n $sentencia = $this->db->prepare(\"SELECT * FROM peliculas WHERE id_genero=?\");//todo de pelicuas de un id_genero que quiero\n $sentencia->execute(array($arrGenero[0]->id_genero));//lo ejecuto y le paso el id que busco\n // print_r($sentencia->fetchAll(PDO::FETCH_OBJ));\n return $sentencia->fetchAll(PDO::FETCH_OBJ); \n }", "public function obtenerLayoutParcial($id){\n $layout_parcial = LayoutParcial::find($id);\n\n $detalles = array();\n foreach($layout_parcial->detalles as $detalle){\n $linea = new \\stdClass();\n $maquina= Maquina::find($detalle->id_maquina);\n $linea->nro_admin = ['correcto' => true, 'valor' => $maquina->nro_admin , 'valor_antiguo' => ''] ;\n $linea->nro_isla = ['correcto' => true, 'valor' => $maquina->isla->nro_isla, 'valor_antiguo' => ''] ;\n $linea->marca = ['correcto' => true, 'valor' => $maquina->marca, 'valor_antiguo' => ''] ;\n if($maquina->id_tipo_maquina != null){\n $linea->tipo = ['correcto' => true, 'valor' => $maquina->tipoMaquina->descripcion, 'valor_antiguo' => ''] ;\n }else{\n $linea->tipo = ['correcto' => true, 'valor' => '-', 'valor_antiguo' => ''] ;\n }\n $linea->juego = ['correcto' => true, 'valor' => $maquina->juego_activo->nombre_juego, 'valor_antiguo' => ''] ;\n \n\n if($maquina->id_pack!=null){\n $pack=PackJuego::find($maquina->id_pack);\n $linea->tiene_pack_bandera=true;\n $juegos_pack_habilitados=array();\n foreach($maquina->juegos as $j){\n if($j->pivot->habilitado!=0){\n array_push( $juegos_pack_habilitados,$j);\n }\n }\n $linea->juegos_pack=$juegos_pack_habilitados;\n }else{\n $linea->tiene_pack_bandera=false;\n }\n \n $linea->nro_serie = ['correcto' => true, 'valor' => $maquina->nro_serie, 'valor_antiguo' => ''] ;\n $linea->id_maquina = $maquina->id_maquina;\n $progresivo = ProgresivoController::getInstancia()->obtenerProgresivoPorIdMaquina($maquina->id_maquina);\n\n if($progresivo['progresivo'] != null){\n $niveles = [];\n $linea->progresivo = new \\stdClass();\n $linea->progresivo->individual =['correcto' => true, 'valor' => $progresivo['progresivo']->individual, 'valor_antiguo' => ''] ;\n $linea->progresivo->nombre_progresivo =['correcto' => true, 'valor' => $progresivo['progresivo']->nombre_progresivo, 'valor_antiguo' => ''] ;\n $linea->progresivo->maximo = ['correcto' => true, 'valor' => $progresivo['progresivo']->maximo, 'valor_antiguo' => ''] ;\n $linea->progresivo->porc_recuperacion = ['correcto' => true, 'valor' => $progresivo['progresivo']->porc_recuperacion, 'valor_antiguo' => ''] ;\n $linea->progresivo->id_progresivo = $progresivo['progresivo']->id_progresivo;\n\n foreach ($progresivo['niveles'] as $nivel) {\n $nuevo_nivel = new \\stdClass();\n $base = $nivel['pivot_base'] != null ? $nivel['pivot_base'] : $nivel['nivel']->base;\n $nuevo_nivel->nombre_nivel = ['correcto' => true, 'valor' => $nivel['nivel']->nombre_nivel, 'valor_antiguo' => ''] ;\n $nuevo_nivel->nro_nivel = ['correcto' => true, 'valor' => $nivel['nivel']->nro_nivel, 'valor_antiguo' => ''] ;\n $nuevo_nivel->id_nivel = $nivel['nivel']->id_nivel_progresivo;\n $nuevo_nivel->base = ['correcto' => true, 'valor' => $base, 'valor_antiguo' => ''] ;\n $nuevo_nivel->porc_visible = ['correcto' => true, 'valor' => $nivel['nivel']->porc_visible, 'valor_antiguo' => ''] ;\n $nuevo_nivel->porc_oculto =['correcto' => true, 'valor' => $nivel['nivel']->porc_oculto , 'valor_antiguo' => ''] ;\n $niveles [] = $nuevo_nivel;\n }\n $linea->niveles = $niveles;\n }else{\n $linea->niveles = null;\n $linea->progresivo= null;\n }\n $detalles[] = $linea;\n }\n\n return ['layout_parcial' => $layout_parcial,\n 'casino' => $layout_parcial->sector->casino->nombre,\n 'id_casino' => $layout_parcial->sector->casino->id_casino,\n 'sector' => $layout_parcial->sector->descripcion,\n 'detalles' => $detalles,\n 'usuario_cargador' => $layout_parcial->usuario_cargador,\n 'usuario_fiscalizador' => $layout_parcial->usuario_fiscalizador,\n ];\n }", "public function AnularOrdenDePago(OrdenDePago $op)\n {\n \t$detalleDePago\t=\t$op->GetDetalleDePago();\n \t\n \tforeach ($detalleDePago as $d)\n \t{\n \t\t$PagoTipoId\t=\t$d->PagoTipoId;\n \t\t\n \t\t// si es un tipo de pago: Cheque propio (id = 1)\n \t\tif($PagoTipoId == 1)\n \t\t{\n \t\t\t$Cheque\t\t= Doctrine::getTable('Cheque')->FindOneById($d->ChequeId);\n \t\t\tif(!is_object($Cheque))\n \t\t\t\tthrow new Exception('No existe el cheque para anular');\n \t\t\t \n \t\t\t$Cheque->Estado\t=\t'Anulado';\n \t\t\t$Cheque->FechaAnulacion\t=\tdate('Y-m-d');\n \t\t\t$Cheque->save();\n \t\t}\n \t\t// si pago con cheque tercero en cartera, cambiar estado\n \t\tif($PagoTipoId == 4)\n \t\t{\n \t\t\t$Cheque\t\t= Doctrine::getTable('Cheque')->FindOneById($d->ChequeId);\n \t\t\tif(!is_object($Cheque))\n \t\t\t\tthrow new Exception('No existe el cheque para anular');\n \t\t\t \n \t\t\t$Cheque->Estado\t=\t'En cartera';\n \t\t\t$Cheque->save();\n \t\t}\n \t\t\n \t\t// si pague con retencion, la creo nuevamente al anular\n \t\tif(($PagoTipoId == 6)||($PagoTipoId ==7)||($PagoTipoId == 8)\n \t\t\t\t||($PagoTipoId == 9)||($PagoTipoId == 10)||($PagoTipoId == 11))\n \t\t{\n \t\t\t\n \t\t\t$detalle\t\t= Doctrine::getTable('CobranzaDetalle')->FindOneById($d->RetencionUtilizadaId);\n \t\t\tif(!is_object($detalle))\n \t\t\t\tthrow new Exception('No existe la retencion');\n \t\t\t// se marca la retencion utilizada\n \t\t\t$detalle->RetencionUtilizada\t=\t'NO';\n \t\t\t$detalle->save();\n \t\t}\n \t\t\n \t\t// si es efectivo, incrementar saldo en efectivo\n \t\tif($PagoTipoId == 2)\n \t\t{\n \t\t\t$Configuracion = Doctrine::GetTable ( 'Configuracion' )->FindOneByNombre('SaldoEfectivo');\n \t\t\t$Configuracion->Valor +=\t$d->Importe;\n \t\t\t$Configuracion->save();\n \t\t\t\n \t\t\t$data['Detalle'] = 'OP #' . $op->Id . ' anulada';\n \t\t\t$data['Importe']\t=\t$d->Importe;\n \t\t\t$data['Saldo']\t=\t$Configuracion->Valor;\n \t\t\t$data['Debe']\t=\t$data['Importe'];\n \t\t\t\n \t\t\t$g = new Classes_GestionEconomicaManager();\n \t\t\t$g->AddHistorialEfectivo($data);\n \t\t}\n \t\t\n \t\t// si es un tipo de pago: transferencia (id = 13),\n \t\t// - actualizar saldo de la cuenta de banco asociada\n \t\tif($PagoTipoId == 13)\n \t\t{\n \t\t\tlist($banco, $cuenta)\t=\texplode('-', $d->Detalle);\n \t\t\t\n \t\t\tif(isset($cuenta) && is_numeric($cuenta))\n \t\t\t{\n \t\t\n \t\t\t\t$banco\t\t= Doctrine::getTable('Banco')->FindOneByNumeroDeCuenta($cuenta);\n \t\t\t\tif(!is_object($banco))\n \t\t\t\t\tthrow new Exception('El banco ingresado no existe');\n \t\t\n \t\t\t\t$ctacte\t\t=\tnew Classes_CuentaCorrienteManager();\n \t\t\t\t$data['Debe']\t=\t$d->Importe;\n \t\t\t\t$data['Saldo']\t=\t$banco->SaldoCuenta;\n \t\t\t\t$data['BancoId']\t=\t$banco->Id;\n \t\t\t\t$data['Detalle']\t=\t'Tranferencia bancaria de OP '.$op->Numero. ' anulada';\n \t\t\t\t$ctacte->AddConceptoBancoCuentaCorriente($data);\n \t\t\t}\n \t\t}\n \t\t\n \t}\n }", "public function get_cartera($division, $grupo, $tipo, $anio, $periodo, $mes, $pensum, $nivel = '', $grado = '', $seccion = ''){\n $sql= \"SELECT *,\";\n ///---cargos----//\n if($mes == 1 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-01-01' AND '$anio-01-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 1\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_enero,\";\n }\n if($mes == 2 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-02-01' AND '$anio-02-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 2\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_febrero,\";\n }\n if($mes == 3 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-03-01' AND '$anio-03-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 3\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_marzo,\";\n }\n if($mes == 4 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-04-01' AND '$anio-04-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 4\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_abril,\";\n }\n if($mes == 5 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-05-01' AND '$anio-05-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 5\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_mayo,\";\n }\n if($mes == 6 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-06-01' AND '$anio-06-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 6\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_junio,\";\n }\n if($mes == 7 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-07-01' AND '$anio-07-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 7\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_julio,\";\n }\n if($mes == 8 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-08-01' AND '$anio-08-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 8\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_agosto,\";\n }\n if($mes == 9 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-09-01' AND '$anio-09-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 9\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_septiembre,\";\n }\n if($mes == 10 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-10-01' AND '$anio-10-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 10\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_octubre,\";\n }\n if($mes == 11 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-11-01' AND '$anio-11-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 11\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_noviembre,\";\n }\n if($mes == 12 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_monto) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-12-01' AND '$anio-12-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 12\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as cargos_diciembre,\";\n }\n ///---descuentos---///\n if($mes == 1 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-01-01' AND '$anio-01-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 1\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_enero,\";\n }\n if($mes == 2 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-02-01' AND '$anio-02-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 2\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_febrero,\";\n }\n if($mes == 3 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-03-01' AND '$anio-03-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 3\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_marzo,\";\n }\n if($mes == 4 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-04-01' AND '$anio-04-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 4\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_abril,\";\n }\n if($mes == 5 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-05-01' AND '$anio-05-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 5\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_mayo,\";\n }\n if($mes == 6 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-06-01' AND '$anio-06-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 6\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_junio,\";\n }\n if($mes == 7 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-07-01' AND '$anio-07-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 7\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_julio,\";\n }\n if($mes == 8 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-08-01' AND '$anio-08-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 8\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_agosto,\";\n }\n if($mes == 9 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-09-01' AND '$anio-09-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 9\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_septiembre,\";\n }\n if($mes == 10 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-10-01' AND '$anio-10-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 10\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_octubre,\";\n }\n if($mes == 11 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-11-01' AND '$anio-11-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 11\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_noviembre,\";\n }\n if($mes == 12 || $mes == 13) {\n $sql.= \" (SELECT SUM(bol_descuento) FROM boletas_boleta_cobro WHERE bol_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND bol_fecha_pago BETWEEN '$anio-12-01' AND '$anio-12-31'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND bol_periodo_fiscal = $periodo AND MONTH(bol_fecha_pago) = 12\";\n }\n if(strlen($tipo)>0) {\n $sql.= \" AND bol_tipo = '$tipo'\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as descuentos_diciembre,\";\n }\n ///---pagos---///\n if($mes == 1 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-01-01 00:00:00' AND '$anio-01-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 1\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_enero,\";\n }\n if($mes == 2 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-02-01 00:00:00' AND '$anio-02-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 2\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_febrero,\";\n }\n if($mes == 3 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-03-01 00:00:00' AND '$anio-03-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 3\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_marzo,\";\n }\n if($mes == 4 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-04-01 00:00:00' AND '$anio-04-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 4\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_abril,\";\n }\n if($mes == 5 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-05-01 00:00:00' AND '$anio-05-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 5\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_mayo,\";\n }\n if($mes == 6 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-06-01 00:00:00' AND '$anio-06-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 6\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_junio,\";\n }\n if($mes == 7 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-07-01 00:00:00' AND '$anio-07-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 7\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_julio,\";\n }\n if($mes == 8 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-08-01 00:00:00' AND '$anio-08-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 8\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_agosto,\";\n }\n if($mes == 9 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-09-01 00:00:00' AND '$anio-09-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 9\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_septiembre,\";\n }\n if($mes == 10 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-10-01 00:00:00' AND '$anio-10-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 10\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_octubre,\";\n }\n if($mes == 11 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-11-01 00:00:00' AND '$anio-11-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 11\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_noviembre,\";\n }\n if($mes == 12 || $mes == 13) {\n $sql.= \" (SELECT SUM(pag_efectivo)+SUM(pag_cheques_propios)+SUM(pag_otros_bancos)+SUM(pag_online) FROM boletas_pago_boleta,boletas_boleta_cobro\";\n $sql.= \" WHERE bol_codigo = pag_programado AND pag_alumno = alu_cui\";\n if(strlen($anio)>0) {\n $sql.= \" AND pag_fechor BETWEEN '$anio-12-01 00:00:00' AND '$anio-12-31 23:59:00'\";\n }\n if(strlen($periodo)>0) {\n $sql.= \" AND pag_periodo_fiscal = $periodo AND MONTH(pag_fechor) = 12\";\n }\n $sql.= \" AND bol_division = $division AND bol_grupo = $grupo AND bol_situacion = 1) as pagos_diciembre,\";\n }\n //--\n $sql = substr($sql, 0, -1); //limpia la ultima coma de los subquerys\n //--\n $sql.= \" FROM academ_grado, academ_secciones, academ_seccion_alumno, app_alumnos\";\n $sql.= \" WHERE sec_pensum = gra_pensum\";\n $sql.= \" AND sec_nivel = gra_nivel\";\n $sql.= \" AND sec_grado = gra_codigo\";\n $sql.= \" AND seca_pensum = sec_pensum\";\n $sql.= \" AND seca_nivel = sec_nivel\";\n $sql.= \" AND seca_grado = sec_grado\";\n $sql.= \" AND seca_seccion = sec_codigo\";\n $sql.= \" AND seca_alumno = alu_cui\";\n $sql.= \" AND alu_situacion != 2\";\n if(strlen($pensum)>0) {\n $sql.= \" AND seca_pensum = $pensum\";\n }\n if(strlen($nivel)>0) {\n $sql.= \" AND seca_nivel = $nivel\";\n }\n if(strlen($grado)>0) {\n $sql.= \" AND seca_grado = $grado\";\n }\n if(strlen($seccion)>0) {\n $sql.= \" AND seca_seccion = $seccion\";\n }\n $sql.= \" ORDER BY seca_nivel ASC, seca_grado ASC, sec_codigo ASC, alu_apellido ASC, alu_nombre ASC\";\n\n $result = $this->exec_query($sql);\n //echo $sql.\"<br><br>\";\n return $result;\n }", "function geraClassesMapeamento(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloMAP.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n # Recupera o nome da tabela e gera o nome da classe\n $nomeTabela = ucfirst((string)$aTabela['NOME']);\n $nomeTabelaOriginal = (string)$aTabela['NOME'];\n\n $nomeClasse = ucfirst($this->getCamelMode($nomeTabela));\n $objetoClasse = \"\\$o$nomeClasse\";\n # Varre a estrutura dos campos da tabela em questao\n $objToReg = $regToObj = $objToRegInsert = array();\n\n foreach($aTabela as $oCampo){\n # Processa nome original da tabela estrangeira\n $nomeFKClasse\t= ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n $objetoFKClasse = $nomeFKClasse;\n\n # Testando nova implementacao - Tirar caso ocorrer erro\n if($nomeFKClasse == $nomeClasse)\n $objetoFKClasse = ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", (string)$oCampo->NOME));\n\n //$nomeCampo = $this->getCamelMode((string)$oCampo->NOME); Alteracao SUDAM\n $nomeCampo = (string)$oCampo->NOME;\n\n # Monta parametros a serem substituidos posteriormente\n if($oCampo->FKTABELA == ''){\n $objToReg[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n }\n $regToObj[] = \"\\t\\t$objetoClasse\".\"->$nomeCampo = \\$reg['$nomeTabelaOriginal\".\"_\".(string)$oCampo->NOME.\"'];\";\n \n }\n else{\n $objToReg[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n }\n $x \t\t= $this->retornaArvore((string)$oCampo->FKTABELA);\n $regToObj[] = \"\\n$x\\t\\t$objetoClasse\".\"->o$objetoFKClasse = \\$o$objetoFKClasse;\";\n }\n }\n\n # Monta demais valores a serem substituidos\n $objToReg = join($objToReg,\"\\n\");\n $objToRegInsert = join($objToRegInsert,\"\\n\");\n $regToObj = join($regToObj,\"\\n\");\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJETO_CLASSE%%', $objetoClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG%%', $objToReg, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG_INSERT%%', $objToRegInsert,$copiaModelo);\n $copiaModelo = str_replace('%%REG_TO_OBJ%%', $regToObj, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/map\";\n\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.$nomeClasse\".\"MAP.php\",\"w\");\n fputs($fp,$copiaModelo);\n fclose($fp);\n }\n return true;\t\n }", "function listarRelacionProceso(){\n $this->objParam->defecto('ordenacion','id_relacion_proceso_pago');\n $this->objParam->defecto('dir_ordenacion','asc');\n\n\n if($this->objParam->getParametro('tipoReporte')=='excel_grid' || $this->objParam->getParametro('tipoReporte')=='pdf_grid'){\n $this->objReporte = new Reporte($this->objParam,$this);\n $this->res = $this->objReporte->generarReporteListado('MODObligacionPago','listarRelacionProceso');\n } else{\n $this->objFunc=$this->create('MODObligacionPago');\n\n $this->res=$this->objFunc->listarRelacionProceso($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "private function GererRestos() {\r\n if (isset($_GET['limiteBasse'])) {\r\n $limiteBasse = $_GET['limiteBasse'];\r\n } else {\r\n $limiteBasse = $_GET['limiteBasse'] = 0;\r\n }\r\n // -- Determine la pagination de l'affichage des restaurants\r\n $this->pagination = 50;\r\n $this->RestosCount = $this->CNX->countRestos();\r\n if ($this->action != \"Accueil\") {\r\n $this->afficherRestos = $this->CNX->showRestos(null, $limiteBasse, $this->pagination);\r\n $this->action = \"GererRestos\";\r\n } else {\r\n $this->afficherRestos = $this->CNX->showRestosAccueil(null, $limiteBasse, $this->pagination);\r\n }\r\n }", "public function getDirectriz()\n {\n $dir = false;\n if (self::getCod() === '110000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '120000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '210000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '220000') $dir='Ciencias Experimentales';\n if (self::getCod() === '230000') $dir='Ciencias Experimentales';\n if (self::getCod() === '240000') $dir='Ciencias de la Salud';\n if (self::getCod() === '250000') $dir='Ciencias Experimentales';\n if (self::getCod() === '310000') $dir='Ciencias Experimentales';\n if (self::getCod() === '320000') $dir='Ciencias de la Salud';\n if (self::getCod() === '330000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '510000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '520000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '530000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '540000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '550000') $dir='Humanidades';\n if (self::getCod() === '560000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '570000') $dir='Humanidades';\n if (self::getCod() === '580000') $dir='Humanidades';\n if (self::getCod() === '590000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '610000') $dir='Ciencias de la Salud';\n if (self::getCod() === '620000') $dir='Humanidades';\n if (self::getCod() === '630000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '710000') $dir='Humanidades';\n if (self::getCod() === '720000') $dir='Humanidades';\n return $dir;\n }", "public function buildRelations()\n {\n $this->addRelation('Pregunta', '\\\\Pregunta', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':preg_t_pregunta',\n 1 => ':tpre_tipo',\n ),\n), null, 'CASCADE', 'Preguntas', false);\n }", "function getTitulos() {\r\n //arreglo para remplazar los titulos de las columnas\r\n $titulos_campos['ivg_id'] = INVENTARIO_GRUPO;\r\n $tirulos_campos['ivg_nombre'] = INVENTARIO_GRUPO;\r\n\r\n $titulos_campos['ine_id'] = INVENTARIO_EQUIPO;\r\n $titulos_campos['ine_nombre'] = INVENTARIO_NOMBRE_EQUIPO;\r\n $titulos_campos['ine_reposicion'] = INVENTARIO_EQUIPO_REPOSICION;\r\n\r\n $titulos_campos['ies_id'] = INVENTARIO_ESTADO;\r\n $titulos_campos['ies_nombre'] = INVENTARIO_NOMBRE_ESTADO;\r\n\r\n $titulos_campos['inm_id'] = INVENTARIO_MARCA;\r\n $titulos_campos['inm_nombre'] = INVENTARIO_MARCA;\r\n\r\n $tirulos_campos['obc_id'] = OBLIGACION_CLAUSULA;\r\n $tirulos_campos['obc_nombre'] = OBLIGACION_CLAUSULA;\r\n\r\n $tirulos_campos['oco_id'] = OBLIGACION_COMPONENTE;\r\n $tirulos_campos['oco_nombre'] = OBLIGACION_COMPONENTE;\r\n\r\n $titulos_campos['dti_id'] = DOCUMENTO_TIPO;\r\n\t $titulos_campos['dti_nombre'] = DOCUMENTO_TIPO;\r\n \t\t$titulos_campos['dti_estado'] = DOCUMENTO_ESTADO_CONTROL;\r\n \t\t$titulos_campos['dti_responsable'] = DOCUMENTO_RESPONSABLE_CONTROL;\r\n\r\n \t\t$titulos_campos['dot_id'] = DOCUMENTO_TEMA;\r\n \t\t$titulos_campos['dot_nombre'] = DOCUMENTO_TEMA;\r\n\r\n \t\t$titulos_campos['dos_id'] = DOCUMENTO_SUBTEMA;\r\n \t\t$titulos_campos['dos_nombre'] = DOCUMENTO_SUBTEMA;\r\n\r\n \t\t$titulos_campos['doa_id'] = DOCUMENTO_RESPONSABLE;\r\n \t\t$titulos_campos['doa_nombre'] = DOCUMENTO_RESPONSABLE;\r\n \t\t$titulos_campos['doa_sigla'] = DOCUMENTO_SIGLA;\r\n\r\n \t\t$titulos_campos['tib_nombre'] = DOCUMENTO_BUSQUEDA;\r\n\r\n \t\t$titulos_campos['doe_nombre'] = DOCUMENTO_ESTADOS;\r\n \t\t$titulos_campos['der_nombre'] = DOCUMENTO_ESTADO_RESPUESTA;\r\n \t\t$titulos_campos['see_nombre'] = SEGUIMIENTO_ESTADOS;\r\n \t\t$titulos_campos['ces_nombre'] = COMPROMISO_ESTADOS;\r\n\r\n \t\t$titulos_campos['dta_id'] = DOCUMENTO_TIPO_ACTOR;\r\n \t\t$titulos_campos['dta_nombre'] = DOCUMENTO_TIPO_ACTOR;\r\n\r\n \t\t$titulos_campos['rpr_nombre'] = PROBABILIDAD;\r\n \t\t$titulos_campos['rpr_valor'] = PROBABILIDAD_VALOR;\r\n\r\n \t\t$titulos_campos['rca_nombre'] = CATEGORIA;\r\n \t\t$titulos_campos['rca_minimo'] = CATEGORIA_MINIMO;\r\n \t\t$titulos_campos['rca_maximo'] = CATEGORIA_MAXIMO;\r\n\r\n \t\t$titulos_campos['rim_nombre'] = IMPACTO;\r\n \t\t$titulos_campos['rim_valor'] = IMPACTO_VALOR;\r\n\r\n \t\t$titulos_campos['rer_id'] = COD_ROL;\r\n \t\t$titulos_campos['rer_nombre'] = COD_ROL;\r\n\r\n\t $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\r\n\t $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\r\n\r\n\t $titulos_campos['dpr_id'] = COD_DEPARTAMENTO_REGION;\r\n\t $titulos_campos['dpr_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\r\n\r\n \t\t$titulos_campos['mun_id'] = COD_MUNICIPIO;\r\n \t\t$titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\r\n \t\t$titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\r\n\r\n $titulos_campos['tia_nombre'] = TIPO_ACTOR;\r\n\r\n $titulos_campos['ope_id'] = OPERADOR;\r\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\r\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\r\n \t\t$titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\r\n \t\t$titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\r\n\r\n return $titulos_campos;\r\n }", "function listar_originales_limit_para_generador($inicial,$cantidad,$id_tipo_simbolo) {\n\t\t\t\n\t\tif ($id_tipo_simbolo==99) { $sql_tipo=''; } \n\t\telse { $sql_tipo='AND imagenes.id_tipo_imagen='.$id_tipo_simbolo.''; }\n\t\t\t\n\t\t$query = \"SELECT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabras.*\n\t\tFROM palabra_imagen, imagenes, palabras\n\t\tWHERE imagenes.estado=1\n\t\tAND palabras.id_palabra=palabra_imagen.id_palabra\n\t\t$sql_tipo\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\tORDER BY palabra_imagen.id_imagen asc\n\t\tLIMIT $inicial,$cantidad\";\n\t\t\n\t\t//$query = \"SELECT palabra_imagen.*, imagenes.*, palabras.*\n//\t\tFROM palabra_imagen, imagenes, palabras\n//\t\tWHERE imagenes.estado=1\n//\t\tAND palabra_imagen.id_palabra=8762\n//\t\tAND palabras.id_palabra=palabra_imagen.id_palabra\n//\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function listar_originales_idioma_limit($registrado,$inicial,$cantidad,$id_tipo,$letra,$filtrado,$orden,$id_subtema,$id_idioma,$tipo_pictograma,$txt_locate,$sql) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND imagenes.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($id_tipo==99) { $sql_tipo=''; } \n\t\telse { $sql_tipo='AND palabras.id_tipo_palabra='.$id_tipo.''; }\n\t\t\n\t\tif (isset($sql) && $sql !='') { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\t\t'.$sql; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t} else {\n\t\t\t\n\t\t\tif ($id_subtema==99999) { \n\t\t\t\t$sql_subtema=''; \n\t\t\t\t$subtema_tabla='';\n\t\t\t\t$subtema_tabla_from='';\n\t\t\t} \n\t\t\telse { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\tAND palabra_subtema.id_subtema='.$id_subtema.''; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($letra==\"\") { $sql_letra=''; } \n\t\telse { \n\t\t\n\t\t\tswitch ($txt_locate) { \n\t\t\t\n\t\t\t\tcase 1:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 2:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 3:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion='$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t\t\n\t\tif ($filtrado==1) { $sql_filtrado='imagenes.ultima_modificacion'; } \n\t\telseif ($filtrado==2) { $sql_filtrado='palabras.palabra'; }\n\t\t\n\t\t$query = \"SELECT DISTINCT imagenes.id_imagen,imagenes.imagen,\n\t\timagenes.fecha_creacion,imagenes.ultima_modificacion,\n\t\tpalabras.id_palabra,palabras.id_tipo_palabra,\n\t\ttraducciones_\".$id_idioma.\".traduccion,traducciones_\".$id_idioma.\".explicacion,\n\t\ttraducciones_\".$id_idioma.\".id_traduccion,traducciones_\".$id_idioma.\".id_idioma \n\t\t$subtema_tabla\n\t\tFROM palabra_imagen, imagenes, palabras, traducciones_\".$id_idioma.\" $subtema_tabla_from\n\t\tWHERE imagenes.estado=1\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabra_imagen.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabras.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".traduccion IS NOT NULL\n\t\t$sql_letra\n\t\t$sql_tipo\n\t\t$sql_subtema\t\n\t\tAND imagenes.id_tipo_imagen=$tipo_pictograma\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\t$mostrar_registradas\n\t\tORDER BY $sql_filtrado $orden \n\t\tLIMIT $inicial,$cantidad\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function getApartados(){\n\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraApartados\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM apartados \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM apartados LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "function buscar_originales_idioma_por_subtema($id_subtema,$id_idioma,$tipo_pictograma) {\n\t\n\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\tAND palabra_subtema.id_subtema='.$id_subtema.''; \n\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t$subtema_tabla_from=', palabra_subtema';\t\n\t\t\n\t\t$query = \"SELECT DISTINCT palabra_imagen.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabras.*, traducciones_\".$id_idioma.\".* $subtema_tabla\n\t\tFROM palabra_imagen, imagenes, palabras, traducciones_\".$id_idioma.\" $subtema_tabla_from\n\t\tWHERE imagenes.estado=1\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabra_imagen.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabras.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".traduccion IS NOT NULL\n\t\t$sql_subtema\t\n\t\tAND imagenes.id_tipo_imagen=$tipo_pictograma\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t\t\n\t}", "function grabar_horario($datos){\n\t\t$registro[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t$registro[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t$registro[HORAINICIO]=$datos[HORAINICIO];\n\t\t$registro[HORAFINAL]=$datos[HORAFINAL];\n\t\t$registro[DOMINGO]=($datos[DOMINGO]=='on')?1:0;\n\t\t$registro[LUNES]=($datos[LUNES])?1:0;\n\t\t$registro[MARTES]=($datos[MARTES])?1:0;\n\t\t$registro[MIERCOLES]=($datos[MIERCOLES])?1:0;\n\t\t$registro[JUEVES]=($datos[JUEVES])?1:0;\n\t\t$registro[VIERNES]=($datos[VIERNES])?1:0;\n\t\t$registro[SABADO]=($datos[SABADO])?1:0;\n\n\n\t\tif ($this->exist('catalogo_proveedor_horario',IDPROVEEDOR,\" WHERE IDPROVEEDOR = '$registro[IDPROVEEDOR]'\"))\n\t\t{\n\t\t\t$this->update('catalogo_proveedor_horario',$registro,\" WHERE IDPROVEEDOR = '$registro[IDPROVEEDOR]'\");\n\t\t}\n\t\telse {\n\t\t\t$this->insert_reg('catalogo_proveedor_horario',$registro);\n\n\t\t}\n\t}", "public function listar_productosMayorMenor($ordenar_producto, $p_id_seccion) {\n \n try {\n if($ordenar_producto == 1)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion;\n \";\n }\n if($ordenar_producto == 2)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio desc;\n \";\n }\n if($ordenar_producto == 3)\n {\n $sql = \"\n select \n distinct p.id_producto, \n p.descripcion,\n p.stock_actual,\n v.precio,\n i.cantidad\n from \n al_producto p inner join precio_venta_producto v\n on\n p.id_producto = v.id_producto left join al_inventario i\n on\n p.id_producto = i.id_producto inner join al_seccion s\n on\n p.id_seccion = s.id_seccion \n where\n p.id_seccion = $p_id_seccion\n order by\n v.precio asc \n \";\n }\n\n \n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function getDestinosCh(){\n \n $destinos = array();\n \n $em = $this->getDoctrine()->getEntityManager();\n\n $result = $em->getRepository('uesperaBundle:Destino')->findAll();\n \n foreach ($result as $dest){\n $destinos[ $dest->getNomdestino() ] = $dest->getNomdestino();\n }\n \n return $destinos;\n \n }", "public function buildRelations()\n {\n $this->addRelation('Banco', 'Banco', RelationMap::MANY_TO_ONE, array('idbanco' => 'idbanco', ), 'CASCADE', 'CASCADE');\n }", "public function obtenerArticulosPorTipo(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | obtenerArticulosPorTipo()\");\n $rsp = $this->Materias->listar('TODOS');\n if($rsp['status']){\n $materiasPrimas = json_decode($rsp['data']);\n $data['status'] = $rsp['status'];\n $data['data'] = selectBusquedaAvanzada(false, false, $materiasPrimas->articulos->articulo, 'arti_id', 'barcode',array('descripcion','um'));\n echo json_encode($data);\n }else{\n $rsp['msj'] = \"Fallo el servicio que obtiene los articulos tipo materia prima.\";\n json_encode($rsp);\n }\n }", "function leer_horario($idproveedor){\n\t\t$sql=\"SELECT * FROM catalogo_proveedor_horario WHERE IDPROVEEDOR = '$idproveedor'\";\n\t\t//\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg = $result->fetch_object())\n\t\t{\n\t\t\t$this->horario = array(\n\t\t\t'HORAINICIO'=>$reg->HORAINICIO,\n\t\t\t'HORAFINAL'=>$reg->HORAFINAL,\n\t\t\t'DOMINGO'=>$reg->DOMINGO,\n\t\t\t'LUNES'=>$reg->LUNES,\n\t\t\t'MARTES'=>$reg->MARTES,\n\t\t\t'MIERCOLES'=>$reg->MIERCOLES,\n\t\t\t'JUEVES'=>$reg->JUEVES,\n\t\t\t'VIERNES'=>$reg->VIERNES,\n\t\t\t'SABADO'=>$reg->SABADO,\n\t\t\t);\n\t\t}\n\t\treturn;\n\t}", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }", "public function actionEquiposabonadosparticipanteespera(){\n $this->layout = '/main2';\n $equipos=Equipo::findAll(['deshabilitado'=>0]);\n $equiposAbonadosConParticipanteEspera=[];\n $cuposRequeridos=0;\n $personasOcupandoCupoDefinitivo=0;\n $equiposAbonadosIncompletos=[];\n $equiposCuatroPersonas=$equipos=Equipo::findAll(['deshabilitado'=>0,'cantidadPersonas'=>4]);\n $equiposCuatroAbonadosIncompletos=[];\n\n\n foreach ($equipos as $equipo ){\n if($equipo->pagoInscripcion()){\n if($equipo->cuposOcupados()!=$equipo->cantidadPersonas){\n $equiposAbonadosIncompletos[]=$equipo;\n }\n\n $personasEquipo=$equipo->personasEnElEquipo();\n foreach ($personasEquipo as $persona){\n if($persona->estoyEnEspera()){\n $cuposRequeridos=$cuposRequeridos+1;\n $equiposAbonadosConParticipanteEspera[]=$equipo;\n }else{\n $personasOcupandoCupoDefinitivo=$personasOcupandoCupoDefinitivo+1;\n }\n }\n }\n }\n foreach ($equiposCuatroPersonas as $equipoCuatro){\n if($equipoCuatro->pagoInscripcion()){\n if($equipoCuatro->cuposOcupados()!=$equipoCuatro->cantidadPersonas){\n $equiposCuatroAbonadosIncompletos[]=$equipoCuatro;\n }\n }\n\n }\n\n\n return $this->render('equiposabonadosespera',['equiposAbonadosConParticipanteEspera'=>$equiposAbonadosConParticipanteEspera,'cuposRequeridos'=>$cuposRequeridos,'personasOcupandoCupoDefinitivo'=>$personasOcupandoCupoDefinitivo,'equiposAbonadosIncompletos'=>$equiposAbonadosIncompletos,'equiposCuatroAbonadosIncompletos'=>$equiposCuatroAbonadosIncompletos]);\n\n\n }", "public function buildRelations()\n {\n $this->addRelation('RombonganBelajar', 'DataDikdas\\\\Model\\\\RombonganBelajar', RelationMap::MANY_TO_ONE, array('rombongan_belajar_id' => 'rombongan_belajar_id', ), 'RESTRICT', 'RESTRICT');\n $this->addRelation('EkstraKurikuler', 'DataDikdas\\\\Model\\\\EkstraKurikuler', RelationMap::MANY_TO_ONE, array('id_ekskul' => 'id_ekskul', ), 'RESTRICT', 'RESTRICT');\n }", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function buildRelations()\n\t{\n $this->addRelation('Provincie', 'Provincie', RelationMap::MANY_TO_ONE, array('provincie_id' => 'id', ), null, null);\n $this->addRelation('OrganisatieType', 'OrganisatieType', RelationMap::MANY_TO_ONE, array('type_id' => 'id', ), null, null);\n $this->addRelation('Persoon', 'Persoon', RelationMap::ONE_TO_MANY, array('id' => 'organisatie_id', ), null, null);\n $this->addRelation('Contact', 'Contact', RelationMap::ONE_TO_MANY, array('id' => 'organisatie_id', ), null, null);\n $this->addRelation('Vervolgactie', 'Vervolgactie', RelationMap::ONE_TO_MANY, array('id' => 'organisatie_id', ), null, null);\n $this->addRelation('Kans', 'Kans', RelationMap::ONE_TO_MANY, array('id' => 'organisatie_id', ), null, null);\n\t}", "public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }", "public function buscar($objeto){\r\n\t}", "public function agendamentos()\n {\n //hasMany para fazer o relacionamento um para muitos\n return $this->hasMany(Agendamento::class);\n }", "public function run()\n {\n $directores = [\n [\n 'id' => '1',\n 'nombre_cargo' => 'DR. RICARDO OCTAVIO A. MOTA PALOMINO',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '1',\n ],\n [\n 'id' => '2',\n 'nombre_cargo' => 'ING. LUIS IGNACIO ESPINO MÁRQUEZ',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '2',\n ],\n [\n 'id' => '3',\n 'nombre_cargo' => 'M. EN C. DANTE REAL MIRANDA',\n 'cargo' => 'DIRECTOR DE LA', \n 'id_unidad_academica' => '3',\n ],\n [\n 'id' => '4',\n 'nombre_cargo' => 'DR. MIGUEL TUFIÑO VELÁZQUEZ',\n 'cargo' => 'DIRECTOR DE LA', \n 'id_unidad_academica' => '4',\n ],\n [\n 'id' => '5',\n 'nombre_cargo' => 'ING. ARTURO DIANICIO ARAUZO',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '5',\n ],\n [\n 'id' => '6',\n 'nombre_cargo' => 'ING. JUAN MANUEL VELÁZQUEZ PETO',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '6',\n ],\n [\n 'id' => '7',\n 'nombre_cargo' => 'M. EN C. RICARDO CORTÉZ OLIVERA',\n 'cargo' => 'DIRECTOR INTERINO DE LA',\n 'id_unidad_academica' => '7',\n ],\n [\n 'id' => '8',\n 'nombre_cargo' => 'ING. ADELAIDO ILDELFONSO MATIAS DOMINGEZ',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '8',\n ],\n [\n 'id' => '9',\n 'nombre_cargo' => 'M. EN E. RICARDO RIVERA RODRÍGUEZ',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '9',\n ],\n [\n 'id' => '10',\n 'nombre_cargo' => 'ING. FRANCISCO JAVIER ESCAMILLA LÓPEZ',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '10',\n ],\n [\n 'id' => '11',\n 'nombre_cargo' => 'C.P. MANELIC MAGANDA DE LOS SANTOS',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '11',\n ],\n [\n 'id' => '12',\n 'nombre_cargo' => 'M. EN C. FILIBERTO CIPRIANO MARÍN',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '12',\n ],\n [\n 'id' => '13',\n 'nombre_cargo' => 'LIC. MARÍA GUADALUPE VARGAS JACOBO',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '13',\n ],\n [\n 'id' => '14',\n 'nombre_cargo' => 'DRA. SILVIA GALICIA VILLANUEVA',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '14',\n ],\n [\n 'id' => '15',\n 'nombre_cargo' => 'DR. MARIO ALBERTO RODRÍGUEZ CASAS',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '15',\n ],\n [\n 'id' => '16',\n 'nombre_cargo' => 'DR. ELEAZAR LARA PADILLA',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '16',\n ],\n [\n 'id' => '17',\n 'nombre_cargo' => 'M. EN C. LORENA GARCÍA MORALES',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '17',\n ],\n [\n 'id' => '18',\n 'nombre_cargo' => 'M. EN C. GUADALUPE GONZÁLEZ DÍAZ',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '18',\n ],\n [\n 'id' => '19',\n 'nombre_cargo' => 'LIC. JAIME ARTURO MENESES GALVÁN',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '19',\n ],\n [\n 'id' => '20',\n 'nombre_cargo' => 'M. EN C. CARLOS QUIROZ TÉLLEZ',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '20',\n ],\n [\n 'id' => '21',\n 'nombre_cargo' => 'DRA. MARÍA GUADALUPE RAMÍREZ SOTELO',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '21',\n ],\n [\n 'id' => '22',\n 'nombre_cargo' => 'LIC. ANDRÉS ORTIGOZA CAMPOS',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '22',\n ],\n [\n 'id' => '23',\n 'nombre_cargo' => 'M. EN C. RAMÓN HERRERA ÁVILA',\n 'cargo' => 'DIRECTOR INTERINO DE LA',\n 'id_unidad_academica' => '23',\n ],\n [\n 'id' => '24',\n 'nombre_cargo' => 'D. EN C. ÁNGEL MILIAR GARCÍA',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '24',\n ],\n [\n 'id' => '25',\n 'nombre_cargo' => 'DRA. ANGÉLICA BEATRIZ RAYA RANGEL',\n 'cargo' => 'DIRECTORA DE LA',\n 'id_unidad_academica' => '25',\n ],\n [\n 'id' => '26',\n 'nombre_cargo' => 'M. EN C. JUAN ALBERTO ALVARADO OLIVARES',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '26',\n ],\n [\n 'id' => '27',\n 'nombre_cargo' => 'DR. ADOLFO ESCAMILLA ESQUIVEL',\n 'cargo' => 'DIRECTOR DE LA',\n 'id_unidad_academica' => '27',\n ],\n [\n 'id' => '28',\n 'nombre_cargo' => 'C. P. HUGO FRANCISCO BRAVO MALPICO',\n 'cargo' => 'DIRECTOR GENERAL DEL ',\n 'id_unidad_academica' => '28',\n ],\n [\n 'id' => '29',\n 'nombre_cargo' => 'Ing. TONATIUH AGUILETA MONDRAGÓN',\n 'cargo' => 'COORDINADOR DEL',\n 'id_unidad_academica' => '29',\n ],\n [\n 'id' => '30',\n 'nombre_cargo' => 'Lic. JOSÉ LUIS GALINDO ALMARAZ',\n 'cargo' => 'DIRECTOR TÉCNICO DEL',\n 'id_unidad_academica' => '31',\n ],\n [\n 'id' => '31',\n 'nombre_cargo' => 'Ing. ANA HERNÁNDEZ MAYÉN',\n 'cargo' => 'DIRECTORA DEL',\n 'id_unidad_academica' => '32',\n ],\n [\n 'id' => '32',\n 'nombre_cargo' => 'M. en C. MIGUEL ÁNGEL BAÑUELOS DOSAMANTE',\n 'cargo' => 'RECTOR DEL',\n 'id_unidad_academica' => '33',\n ],\n [\n 'id' => '33',\n 'nombre_cargo' => 'C. P. ARTURO SOLIS TORRES',\n 'cargo' => 'RECTOR DE LA',\n 'id_unidad_academica' => '34',\n ],\n ];\n\n foreach($directores as $director)\n {\n Director::create($director);\n }\n }", "function listar_originales_idioma($registrado,$id_tipo,$letra,$filtrado,$orden,$id_subtema,$id_idioma,$tipo_pictograma,$txt_locate,$sql) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND imagenes.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($id_tipo==99) { $sql_tipo=''; } \n\t\telse { $sql_tipo='AND palabras.id_tipo_palabra='.$id_tipo.''; }\n\t\t\t\n\t\tif (isset($sql) && $sql !='') { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\t\t'.$sql; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t} else {\n\t\t\t\n\t\t\tif ($id_subtema==99999) { \n\t\t\t\t$sql_subtema=''; \n\t\t\t\t$subtema_tabla='';\n\t\t\t\t$subtema_tabla_from='';\n\t\t\t} \n\t\t\telse { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\tAND palabra_subtema.id_subtema='.$id_subtema.''; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($letra==\"\") { $sql_letra=''; } \n\t\telse { \n\t\t\n\t\t\tswitch ($txt_locate) { \n\t\t\t\n\t\t\t\tcase 1:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 2:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 3:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion='$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t}\t\n\t\t\n\t\tif ($filtrado==1) { $sql_filtrado='imagenes.ultima_modificacion'; } \n\t\telseif ($filtrado==2) { $sql_filtrado='palabras.palabra'; }\n\t\t\n\t\t$query = \"SELECT COUNT(*)\n\t\tFROM palabra_imagen, imagenes, palabras, traducciones_\".$id_idioma.\" $subtema_tabla_from\n\t\tWHERE imagenes.estado=1\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabra_imagen.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabras.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".traduccion IS NOT NULL\n\t\t$sql_letra\n\t\t$sql_tipo\n\t\t$sql_subtema\t\n\t\tAND imagenes.id_tipo_imagen=$tipo_pictograma\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\t$mostrar_registradas\n\t\tORDER BY $sql_filtrado $orden\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\treturn $row[0];\n\t\t\n\t}", "function listarObligacionPagoSol()\n {\n $this->objParam->defecto('ordenacion', 'id_obligacion_pago');\n $this->objParam->defecto('dir_ordenacion', 'asc');\n\n $this->objParam->addParametro('id_funcionario_usu', $_SESSION[\"ss_id_funcionario\"]);\n\n\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoUnico') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion = ''pago_unico''\");\n }\n\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoSol') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion in (''pago_directo'',''rrhh'')\");\n }\n\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoAdq') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion = ''adquisiciones''\");\n }\n\n if ($this->objParam->getParametro('id_obligacion_pago') != '') {\n $this->objParam->addFiltro(\"obpg.id_obligacion_pago = \" . $this->objParam->getParametro('id_obligacion_pago'));\n }\n\n if ($this->objParam->getParametro('filtro_campo') != '') {\n $this->objParam->addFiltro($this->objParam->getParametro('filtro_campo') . \" = \" . $this->objParam->getParametro('filtro_valor'));\n }\n if ($this->objParam->getParametro('id_gestion') != '') {\n $this->objParam->addFiltro(\"obpg.id_gestion = \" . $this->objParam->getParametro('id_gestion') . \" \");\n\n }\n\n //(may)para internacionales SP, SPD, SPI\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoS') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion in (''sp'')\");\n }\n if ($this->objParam->getParametro('tipo_interfaz') == 'solicitudObligacionPagoUnico') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion in (''spd'')\");\n }\n\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoInterS') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion in (''spi'')\");\n }\n\n //03/12/2020 (may) para pagos POC\n if ($this->objParam->getParametro('tipo_interfaz') == 'obligacionPagoPOC') {\n $this->objParam->addFiltro(\"obpg.tipo_obligacion in (''pago_poc'')\");\n }\n\n //filtro breydi.vasquez 07/01/2020 \n $this->objParam->getParametro('tramite_sin_presupuesto_centro_c') != '' && $this->objParam->addFiltro(\"obpg.presupuesto_aprobado = ''sin_presupuesto_cc'' \");\n //\n \n if($this->objParam->getParametro('tipoReporte')=='excel_grid' || $this->objParam->getParametro('tipoReporte')=='pdf_grid'){\n $this->objReporte = new Reporte($this->objParam,$this);\n $this->res = $this->objReporte->generarReporteListado('MODObligacionPago','listarObligacionPagoSol');\n } else{\n $this->objFunc=$this->create('MODObligacionPago');\n \n $this->res=$this->objFunc->listarObligacionPagoSol($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function preparatoriasBYInstitucionTiposAlojamientos_get(){\n $id=$this->get('id');\n $id2=$this->get('id2');\n if (count($this->get())>2) {\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"Demasiados datos enviados\",\n \"validations\" =>array(\n \"id\"=>\"Envia Id (get) para obtener un especifico articulo o vacio para obtener todos los articulos\"\n ),\n \"data\"=>null\n );\n }else{\n if ($id) {\n $data = $this->DAO->selectEntity('Vw_tipoAlojamiento',array('idInstitucion'=>$id),false);\n }\n else{\n $data = $this->DAO->selectEntity('Vw_tipoAlojamiento',null,false);\n }\n if ($data) {\n $response = array(\n \"status\" => \"success\",\n \"status_code\" => 201,\n \"message\" => \"Articulo Cargado correctamente\",\n \"validations\" =>null,\n \"data\"=>$data\n );\n }else{\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"No se recibio datos\",\n \"validations\" =>null,\n \"data\"=>null\n );\n }\n }\n $this->response($response,200);\n }", "function setCobrar($tarjeta1,$tarjeta2,$tarjeta3,$tarjeta4,$tarjeta5,$partida){\n\t$tarjetas=array(0=>$tarjeta1,1=>$tarjeta2,2=>$tarjeta3,3=>$tarjeta4,4=>$tarjeta5);\n\t$tarjeta_cambio;\n\t$veces_entre_foreach=0;\n\t$cantidad=0;\n\t\t\t//pregunta si el usuario saco tarjeta en la ronda, si no saco no puede cambiar ninguna de las que ya tiene(por esto ese if)\n\tif($partida->turno_usuario->getSaqueTarjeta() == 1){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tforeach($tarjetas as $tarjeta){\n\t\t\t\tif($tarjeta == 1){\n\t\t\t\t\tif($partida->turno_usuario->getTarjeta($veces_entre_foreach)!=NULL ){\n\t\t\t\t\t\t\t//solamente puede tomar una tarjeta, porque es cobrar, si hay mas de una seleccionadada cantidad de hace mas de 1 y el cambio no se realiza\n\t\t\t\t\t\tif($cantidad < 1){\n\t\t\t\t\t\t\t\t//digo que la tarjeta que esta en la posicion $avanzar_arreglo del usuario fue seleccionada\n\t\t\t\t\t\t\t$tarjeta_cambio=$partida->turno_usuario->getTarjeta($veces_entre_foreach);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cantidad++;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\t$veces_entre_foreach++;\n\t\t\t}//foreach($tarjetas as $tarjeta){\n\t\t\t\n\t\t\t\t//si se selecciono una y solo una tarjeta\n\t\t\tif($cantidad == 1){\n\t\t\t\t\t//compruebo si la tarjeta esta en estado de ser cambiada\n\t\t\t\tif($tarjeta_cambio->getEstado() == 0 ){\n\t\t\t\t\t\t\n\t\t\t\t\t$id_pais=$tarjeta_cambio->getIdPais();\n\t\t\t\t\t\t//recorro todos los paises \n\t\t\t\t\tforeach($partida->paises as $pais){\t\n\t\t\t\t\t\t\t//compruebo si id del usuario en turno es igual al del propietario del pais que selecciona el foreach Y aparte compruebo que \n\t\t\t\t\t\t\t//el pais al que hace referencia la tarjeta sea el seleccionado por el foreach\n\t\t\t\t\t\tif($id_pais == $pais->getId() && $partida->turno_usuario->getId() == $pais->getPropietario()->getId() )\t{\n\t\t\t\t\t\t\t\t//cambio el estado de la tarjeta\n\t\t\t\t\t\t\t$tarjeta_cambio->setEstado(1);\n\t\t\t\t\t\t\t\t//le entrego al pais al que hace referencia 2 fichas\n\t\t\t\t\t\t\t$pais->setFichas(2);\n\t\t\t\t\t\t\t\t//reseteo el saco tarjeta, para que en la misma ronda no pueda cobrar dos tarjetas\n\t\t\t\t\t\t\t$partida->turno_usuario->setSaqueTarjetaReset();\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//if($cantidad == 1){\n\t\t\t\n\t}//if($partida->turno_usuario->getSaqueTarjeta() == 1){\t\n}", "function Denuncias_tomadas($org_cod_organizacion)\n {\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia INNER JOIN denuncias_organizacion ON denuncia.de_cod_denuncia=denuncias_organizacion.de_cod_denuncia INNER JOIN organizacion ON denuncias_organizacion.org_cod_organizacion=organizacion.org_cod_organizacion WHERE organizacion.org_cod_organizacion=? AND denuncia.de_estado='tomado'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute(array($org_cod_organizacion));\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n}", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "public function getDados()\n {\n $aLinhas = array();\n\n /**\n * montamos as datas, e processamos o balancete de verificação\n */\n $oDaoPeriodo = db_utils::getDao(\"periodo\");\n $sSqlDadosPeriodo = $oDaoPeriodo->sql_query_file($this->iCodigoPeriodo);\n $rsPeriodo = db_query($sSqlDadosPeriodo);\n $oDadosPerido = db_utils::fieldsMemory($rsPeriodo, 0);\n $sDataInicial = \"{$this->iAnoUsu}-01-01\";\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oDadosPerido->o114_mesfinal, $this->iAnoUsu);\n $sDataFinal = \"{$this->iAnoUsu}-{$oDadosPerido->o114_mesfinal}-{$iUltimoDiaMes}\";\n $sWherePlano = \" c61_instit in ({$this->getInstituicoes()}) \";\n /**\n * processa o balancete de verificação\n */\n $rsPlano = db_planocontassaldo_matriz($this->iAnoUsu,\n $sDataInicial,\n $sDataFinal,\n false,\n $sWherePlano,\n '',\n 'true',\n 'true');\n\n $iTotalLinhasPlano = pg_num_rows($rsPlano);\n /**\n * percorremos a slinhas cadastradas no relatorio, e adicionamos os valores cadastrados manualmente.\n */\n $aLinhasRelatorio = $this->oRelatorioLegal->getLinhasCompleto();\n for ($iLinha = 1; $iLinha <= count($aLinhasRelatorio); $iLinha++) {\n\n $aLinhasRelatorio[$iLinha]->setPeriodo($this->iCodigoPeriodo);\n $aColunasRelatorio = $aLinhasRelatorio[$iLinha]->getCols($this->iCodigoPeriodo);\n $aColunaslinha = array();\n $oLinha = new stdClass();\n $oLinha->totalizar = $aLinhasRelatorio[$iLinha]->isTotalizador();\n $oLinha->descricao = $aLinhasRelatorio[$iLinha]->getDescricaoLinha();\n $oLinha->colunas = $aColunasRelatorio;\n $oLinha->nivellinha = $aLinhasRelatorio[$iLinha]->getNivel();\n foreach ($aColunasRelatorio as $oColuna) {\n\n $oLinha->{$oColuna->o115_nomecoluna} = 0;\n if ( !$aLinhasRelatorio[$iLinha]->isTotalizador() ) {\n $oColuna->o116_formula = '';\n }\n }\n\n if (!$aLinhasRelatorio[$iLinha]->isTotalizador()) {\n\n $aValoresColunasLinhas = $aLinhasRelatorio[$iLinha]->getValoresColunas(null, null, $this->getInstituicoes(),\n $this->iAnoUsu);\n\n $aParametros = $aLinhasRelatorio[$iLinha]->getParametros($this->iAnoUsu, $this->getInstituicoes());\n foreach($aValoresColunasLinhas as $oValor) {\n foreach ($oValor->colunas as $oColuna) {\n $oLinha->{$oColuna->o115_nomecoluna} += $oColuna->o117_valor;\n }\n }\n\n /**\n * verificamos se a a conta cadastrada existe no balancete, e somamos o valor encontrado na linha\n */\n for ($i = 0; $i < $iTotalLinhasPlano; $i++) {\n\n $oResultado = db_utils::fieldsMemory($rsPlano, $i);\n\n\n $oParametro = $aParametros;\n\n foreach ($oParametro->contas as $oConta) {\n\n $oVerificacao = $aLinhasRelatorio[$iLinha]->match($oConta, $oParametro->orcamento, $oResultado, 3);\n\n if ($oVerificacao->match) {\n\n $this->buscarInscricaoEBaixa($oResultado, $iLinha, $sDataInicial, $sDataFinal);\n\n if ( $oVerificacao->exclusao ) {\n\n $oResultado->saldo_anterior *= -1;\n $oResultado->saldo_anterior_debito *= -1;\n $oResultado->saldo_anterior_credito *= -1;\n $oResultado->saldo_final *= -1;\n }\n\n $oLinha->sd_ex_ant += $oResultado->saldo_anterior;\n $oLinha->inscricao += $oResultado->saldo_anterior_credito;\n $oLinha->baixa += $oResultado->saldo_anterior_debito;\n $oLinha->sd_ex_seg += $oResultado->saldo_final;\n }\n }\n }\n }\n $aLinhas[$iLinha] = $oLinha;\n }\n\n unset($aLinhasRelatorio);\n\n /**\n * calcula os totalizadores do relatório, aplicando as formulas.\n */\n foreach ($aLinhas as $oLinha) {\n\n if ($oLinha->totalizar) {\n\n foreach ($oLinha->colunas as $iColuna => $oColuna) {\n\n if (trim($oColuna->o116_formula) != \"\") {\n\n $sFormulaOriginal = ($oColuna->o116_formula);\n $sFormula = $this->oRelatorioLegal->parseFormula('aLinhas', $sFormulaOriginal, $iColuna, $aLinhas);\n $evaluate = \"\\$oLinha->{$oColuna->o115_nomecoluna} = {$sFormula};\";\n ob_start();\n eval($evaluate);\n $sRetorno = ob_get_contents();\n ob_clean();\n if (strpos(strtolower($sRetorno), \"parse error\") > 0 || strpos(strtolower($sRetorno), \"undefined\" > 0)) {\n $sMsg = \"Linha {$iLinha} com erro no cadastro da formula<br>{$oColuna->o116_formula}\";\n throw new Exception($sMsg);\n\n }\n }\n }\n }\n }\n\n return $aLinhas;\n }", "function cuentabancos(){\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,c.description,c.manual_code\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=2 \n\t\t\tand c.`main_father`=conf.CuentaBancos and p.idtipopoliza!=3 and m.TipoMovto not like '%M.E%'\n\t\t\tand m.IdPoliza=p.id and p.activo=1 and m.Activo=1 group by m.Cuenta\n\t\t\t\");\n\t\t\treturn $sql;\n\t\t}", "public function structuresAutomatiques() {\n\t\t\t$this->Structurereferente = ClassRegistry::init( 'Structurereferente' );\n\n\t\t\t$results = $this->Structurereferente->find(\n\t\t\t\t'all',\n\t\t\t\tarray(\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'Structurereferente.typeorient_id',\n\t\t\t\t\t\t'( \"Structurereferente\".\"typeorient_id\" || \\'_\\' || \"Structurereferente\".\"id\" ) AS \"Structurereferente__id\"',\n\t\t\t\t\t\t'Canton.canton'\n\t\t\t\t\t),\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Structurereferente.typeorient_id' => Configure::read( 'Nonoriente66.notisemploi.typeorientId' )\n\t\t\t\t\t),\n\t\t\t\t\t'joins' => array(\n\t\t\t\t\t\t$this->Structurereferente->join( 'StructurereferenteZonegeographique' ),\n\t\t\t\t\t\t$this->Structurereferente->StructurereferenteZonegeographique->join( 'Zonegeographique' ),\n\t\t\t\t\t\t$this->Structurereferente->StructurereferenteZonegeographique->Zonegeographique->join( 'Canton' )\n\t\t\t\t\t),\n\t\t\t\t\t'contain' => false\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn Set::combine( $results, '{n}.Structurereferente.typeorient_id', '{n}.Structurereferente.id', '{n}.Canton.canton' );\n\t\t}", "function depurar_horarios ($horarios, $aula){\n $horarios_disponibles=array();\n $indice=0;\n $longitud=count($horarios);\n $indice_horario=0;\n //guarda un horario disponible con el formato (hora_inicio, hora_fin, aula)\n $horario=array();\n $hora_fin=\"\";\n while($indice_horario < $longitud){\n if($horarios[$indice_horario][1]){\n \n $hora_inicio=$horarios[$indice_horario][0];\n $horario['hora_inicio']=$hora_inicio;\n\n //aca no hay que acumular el retorno\n $indice_horario = $this->obtener_horario($indice_horario, $horarios, &$hora_fin);\n $horario['hora_fin']=$hora_fin;\n $horario['aula']=$aula['aula'];\n $horario['id_aula']=$aula['id_aula'];\n $horarios_disponibles[$indice]=$horario;\n //los eltos se agregan al final del arreglo\n $this->s__horarios_disponibles[]=$horario;\n $indice += 1;\n }\n else{\n $indice_horario += 1;\n }\n }\n return $horarios_disponibles;\n }", "function obtener_horarios_disponibles ($aulas, $horarios_ocupados){\n //$horarios_disponibles=array();\n foreach ($aulas as $clave=>$aula){\n //obtenemos los horarios ocupados para un aula especifica\n //$horarios_ocupados_por_aula=$this->obtener_horarios_ocupados_por_aula($aula, $horarios_ocupados);\n //print_r(gettype($horarios_ocupados_por_aula));\n //$aula no es necesario, quitar mas adelante\n \n //obtenemos todos los horarios ocupados y disponibles\n $horarios=$this->calcular_espacios_disponibles($aula, $horarios_ocupados);\n \n $horarios_depurados=$this->depurar_horarios($horarios, $aula);\n \n //$horarios_disponibles[]=$horarios_depurados;\n }\n \n //return $horarios_disponibles;\n }", "function cargar_formulario($datos_necesarios){\n if(isset($datos_necesarios['acta'])){\n $ar = array();\n \n $ar[0]['votos'] = $datos_necesarios['acta']['total_votos_blancos'];\n $ar[0]['id_nro_lista'] = -1;\n $ar[0]['nombre'] = \"VOTOS EN BLANCO\";\n \n $ar[1]['votos'] = $datos_necesarios['acta']['total_votos_nulos'];\n $ar[1]['id_nro_lista'] = -2;\n $ar[1]['nombre'] = \"VOTOS NULOS\";\n \n $ar[2]['votos'] = $datos_necesarios['acta']['total_votos_recurridos'];\n $ar[2]['id_nro_lista'] = -3;\n $ar[2]['nombre'] = \"VOTOS RECURRIDOS\";\n\n //obtener los votos cargados, asociados a este acta\n $votos = $this->dep('datos')->tabla($datos_necesarios['tabla_voto'])->get_listado_votos($datos_necesarios['acta']['id_acta']);\n \n if(sizeof($votos) > 0){//existen votos cargados\n $ar = array_merge($votos, $ar);\n \n }\n else{//no existen votos cargados\n $listas = $this->dep('datos')->tabla($datos_necesarios['tabla_listas'])->get_listas_a_votar($datos_necesarios['acta']['id_acta']);\n \n if(sizeof($listas)>0)//Existen listas\n $ar = array_merge($listas, $ar); \n \n }\n \n return $ar;\n }\n }", "public function test_medio_boleto_trasbordo_plus(){\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $colectivo2 = new Colectivo( 'mixta', '102', 421 );\n $medio_boleto->recargar( 50.0 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() );\n\t\t\n $medio_boleto->gastarPlus();\n $medio_boleto->gastarPlus();\n $tiempo->avanzar( 300 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo2 , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoViaje()*2 );\n }", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "public function unidadReceptoraReal($correspondencia_id) {\n \n // BUSCAR UNIDADES DE RECEPTORES ESTABLECIDOS\n $unidades_receptoras = array();\n $unidad_recibe_id = '';\n $receptores_establecidos = Doctrine::getTable('Correspondencia_Receptor')->findByCorrespondenciaIdAndEstablecido($correspondencia_id, 'S');\n foreach ($receptores_establecidos as $receptor_establecido) {\n $unidades_receptoras[] = $receptor_establecido->getUnidadId();\n if($receptor_establecido->getFuncionarioId() == $this->getUser()->getAttribute('funcionario_id')){\n // SI EL FUNCIONARIO LOGUEADO ES ESTABLECIDO COMO RECEPTOR SE SELECCIONA LA UNIDAD POR LA CUAL RECIBE\n $unidad_recibe_id = $receptor_establecido->getUnidadId();\n }\n }\n \n if($unidad_recibe_id==''){\n // EN CASO DE NO ENCONTRAR LA UNIDAD, BUSCAR SI LE FUE ASIGANADA LA CORRESPONDENCIA COMO UNA TAREA\n $receptor_asignado = Doctrine::getTable('Correspondencia_Receptor')->findOneByCorrespondenciaIdAndFuncionarioIdAndEstablecido($correspondencia_id, $this->getUser()->getAttribute('funcionario_id'), 'A');\n\n if($receptor_asignado){\n $unidad_recibe_id = $receptor_asignado->getUnidadId();\n }\n }\n \n if($unidad_recibe_id==''){\n // BUSCAR LAS UNIDADES A LA QUE PERTENECE EL FUNCIONARIO CON PERMISO DE LEER\n $unidades_receptoras = array_unique($unidades_receptoras);\n \n $funcionario_unidades_leer = Doctrine::getTable('Correspondencia_FuncionarioUnidad')->funcionarioAutorizado($this->getUser()->getAttribute('funcionario_id'),'leer');\n\n foreach($funcionario_unidades_leer as $unidad_leer) {\n if(array_search($unidad_leer->getAutorizadaUnidadId(), $unidades_receptoras)>=0){\n $unidad_recibe_id = $unidad_leer->getAutorizadaUnidadId();\n }\n }\n }\n \n return $unidad_recibe_id;\n }", "public function geraClasseControle(){\n # Abre o template da classe Controle e armazena conteudo do modelo\t\t\n $modelo = Util::getConteudoTemplate('class.Modelo.Controle.tpl');\n\n # Abre o template dos metodos de cadastros e armazena conteudo do modelo\n $modeloCAD = Util::getConteudoTemplate('metodoCadastra.tpl');\n $modeloExclui = Util::getConteudoTemplate('metodoExclui.tpl');\n $modeloSelecionar = Util::getConteudoTemplate('metodoSeleciona.tpl');\n $modeloGetAll = Util::getConteudoTemplate('metodoGetAll.tpl'); \n $modeloConsultar = Util::getConteudoTemplate('metodoConsulta.tpl');\n $modeloAlterar = Util::getConteudoTemplate('metodoAltera.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n $aRequire = $aCadastro = $aExclui = $aSelecionar = $aGetAll = $aAlterar = $aConsultar = array();\n $copiaModelo = $modelo;\n //print_r($aBanco);exit;\n foreach($aBanco as $aTabela){\n $aPKDoc = $aPK = array(); \n foreach($aTabela as $oCampo){\n if((string)$oCampo->CHAVE == '1'){\n $aPKDoc[] = \"\\t * @param integer \\$\".(string)$oCampo->NOME;\n $aPK[] = \"\\$\".(string)$oCampo->NOME;\n }\n }\n\n # Montar a Lista de DOC do metodo selecionar\n $listaPKDoc = join(\"\\n\", $aPKDoc);\n $listaPK = join(\",\", $aPK);\n\n # Recupera o nome da tabela e gera os valores a serem gerados\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n $copiaModeloCAD = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloCAD);\n $copiaModeloExclui = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloExclui);\n $copiaModeloSelecionar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloSelecionar);\n $copiaModeloGetAll = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloGetAll);\n $copiaModeloAlterar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloAlterar);\n $copiaModeloConsultar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloConsultar);\n\n $montaObjeto = $this->retornaObjetosMontados($aTabela['NOME']);\n $montaObjetoBD = $this->retornaObjetosBDMontados($aTabela['NOME']);\n\n $copiaModeloCAD = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloCAD);\n $copiaModeloCAD = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloCAD);\n $copiaModeloExclui = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloExclui);\n $copiaModeloSelecionar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%DOC_LISTA_PK%%', $listaPKDoc, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%LISTA_PK%%', \t$listaPK, $copiaModeloSelecionar);\n $copiaModeloGetAll = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloGetAll);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloAlterar);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloAlterar);\n $copiaModeloConsultar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloConsultar);\n\n $aRequire[] = \"require_once(dirname(__FILE__).'/bd/class.$nomeClasse\".\"BD.php');\";\n $aCadastro[] = $copiaModeloCAD;\n $aExclui[] = $copiaModeloExclui;\n $aSelecionar[] = $copiaModeloSelecionar;\n $aGetAll[] = $copiaModeloGetAll;\n $aAlterar[] = $copiaModeloAlterar;\n $aConsultar[] = $copiaModeloConsultar;\n }\n\n # Monta demais valores a serem substituidos\n $listaRequire = join(\"\\n\", $aRequire);\n $listaCadastro = join(\"\\n\\n\", $aCadastro);\n $listaExclui = join(\"\\n\\n\", $aExclui);\n $listaSelecionar = join(\"\\n\\n\", $aSelecionar);\n $listaGetAll = join(\"\\n\\n\", $aGetAll);\n $listaAlterar = join(\"\\n\\n\", $aAlterar);\n //print \"<pre>\"; print_r($aAlterar); print \"</pre>\"; \n //print \"<pre>\"; print_r($aConsultar); print \"</pre>\"; \n $listaConsultar = join(\"\\n\\n\", $aConsultar);\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%LISTA_REQUIRE%%',\t\t $listaRequire, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CADASTRA%%',\t $listaCadastro, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_EXCLUI%%',\t $listaExclui, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_SELECIONAR%%',\t $listaSelecionar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CARREGAR_COLECAO%%', $listaGetAll, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_ALTERA%%',\t $listaAlterar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CONSULTA%%',\t $listaConsultar, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.Controle.php\",\"w\");\n fputs($fp,$copiaModelo);\n\n # ============ Adicionando Classes de core/Config =========\n $modeloConfig = Util::getConteudoTemplate(\"Modelo.Config.\".$aBanco['SGBD'].\".tpl\");\n $modeloConfig = str_replace('%%DATABASE%%', $this->projeto, $modeloConfig);\n \n $fpConfig = fopen(\"$dir/core/config.ini\",\"w\"); \t\n fputs($fpConfig, $modeloConfig); \n fclose($fpConfig);\n\n copy(dirname(__FILE__).\"/core/class.Seguranca.php\", \"$dir/class.Seguranca.php\");\n copy(dirname(__FILE__).\"/class.Util.php\",\t \"$dir/core/class.Util.php\");\n copy(dirname(__FILE__).\"/class.Conexao.php\", \"$dir/core/class.Conexao.php\");\n \n return true;\n }", "function getDatosDeGrupoSolidario(){}", "public function catalogos() \n\t{\n\t}", "public function definition()\n {\n $user = rand(1, 503);\n $user2 = rand(1, 503);\n if($user==$user2){\n $user2 = rand(1, 503);\n $user = rand(1, 503);\n }\n $bucle = 0;\n $distinto = Follower::where('seguidor', $user)->where('seguido', $user2)->find(1);\n while($bucle==0){\n if($distinto==null){\n return [\n 'seguidor'=>$user,\n 'seguido'=>$user2\n ];\n }else{\n $user = rand(1, 503);\n $user2 = rand(1, 503);\n if($user==$user2){\n $user2 = rand(1, 503);\n $user = rand(1, 503);\n }\n $distinto = Follower::where('seguidor', $user)->where('seguido', $user2)->find(1);\n }\n }\n }", "public function recursiva($table,$id,$tipo,$sexo)\n { \n $temp = array();\n switch ($table) {\n case 'continente':\n $breadCrum = \"Continente\";\n $temp = Continente::all();\n $table = 'pais';\n # code...\n break;\n case 'pais':\n $breadCrum = \"País\";\n $temp = Pais::where('continente',$id)->get();\n $table = 'ciudad';\n break;\n case 'ciudad':\n $breadCrum = \"Ciudad\";\n $temp = Ciudad::where('pais',$id)->get();\n $table = 'genero';\n $sexo = \"m\";\n\n break;\n case 'genero':\n $breadCrum = \"Género\";\n $temp = Genero::all();\n $table = 'tipo_estudio';\n $sexo = \"f\";\n break;\n case 'tipo_estudio':\n $breadCrum = \"Tipo de estudio\";\n\n $temp = TipoEstudio::all();\n $table = 'procedencia';\n break;\n case 'procedencia':\n $breadCrum = \"Procedencia\";\n\n $temp = Procedencia::all();\n $table = 'fin';\n break;\n\n }\n $arrayFinal = [];\n // $temp = Pais::all();\n\n foreach ($temp as $key => $valor) {\n $padre = $valor->id;\n switch ($table) {\n case 'tipo_estudio':\n $children = $valor->postulanteR->where(\"ciudad\",$id)->count();\n $nombre = $valor->nombre;\n $padre = $id;\n $sexo = $valor->id;\n break;\n case 'procedencia':\n $children = $valor->postulanteR->where(\"ciudad\",$id)->where(\"sexo\",$sexo)->count();\n //dd($valor->postulanteR->where(\"ciudad\",1)->where(\"sexo\",$sexo));\n $tipo = $valor->id;\n $nombre = $valor->nombre;\n $sexo = $sexo;\n $padre = $id;\n break;\n case 'fisn':\n\n break;\n default:\n # code...\n $children = $valor->children;\n $nombre = $valor->nombre;\n break;\n }\n\n if($children){\n $arrayFinal[] = array(\n 'name'=> $nombre,\n 'breadCrum'=> $breadCrum,\n 'size'=> $children,\n 'children' => $this->recursiva($table,$padre,$tipo,$sexo)\n ); \n \n }\n \n }\n return $arrayFinal;\n }", "function horarios()\n {\n $this->view2->__construct($this->dataView,$this->dataTable);\n $this->view2->show();\n }", "public function changeToOrdine()\n {\n\n //crea la tabella degli ordini verso i fornitori\n //Rielabora\n $preventivatore = $this->getPreventivatore();\n $result = $preventivatore->elabora();\n $imponibile = $result['prezzo_cliente_senza_iva'];\n $iva = $result['prezzo_cliente_con_iva'] - $result['prezzo_cliente_senza_iva'];\n $importo_trasportatore = $result['costo_trazione'];\n $importo_depositario = $result['deposito'];\n $importo_traslocatore_partenza = $result['costo_scarico_totale'] ;\n $importo_traslocatore_destinazione = $result['costo_salita_piano_totale'] + $result['costo_montaggio_totale'] + $result['costo_scarico_ricarico_hub_totale'];\n\n $totali = array();\n $totali[$this->id_trasportatore] = 0;\n $totali[$this->id_depositario] = 0;\n $totali[$this->id_traslocatore_destinazione] = 0;\n $totali[$this->id_traslocatore_partenza] = 0;\n\n $totaliMC = array();\n $totaliMC[$this->id_trasportatore] = 0;\n $totaliMC[$this->id_depositario] = 0;\n $totaliMC[$this->id_traslocatore_destinazione] = 0;\n $totaliMC[$this->id_traslocatore_partenza] = 0;\n\n\n $totali[$this->id_trasportatore] = $totali[$this->id_trasportatore] + $importo_trasportatore;\n $totali[$this->id_depositario] = $totali[$this->id_depositario] + $importo_depositario;\n $totali[$this->id_traslocatore_partenza] = $totali[$this->id_traslocatore_partenza] + $importo_traslocatore_partenza;\n $totali[$this->id_traslocatore_destinazione] = $totali[$this->id_traslocatore_destinazione] + $importo_traslocatore_destinazione;\n\n\n $mc = $preventivatore->getMC();\n\n $totaliMC[$this->id_trasportatore] = $totaliMC[$this->id_trasportatore] + $mc;\n $totaliMC[$this->id_depositario] = $totaliMC[$this->id_depositario] + $mc;\n $totaliMC[$this->id_traslocatore_destinazione] = $totaliMC[$this->id_traslocatore_destinazione] + $mc;\n $totaliMC[$this->id_traslocatore_partenza] = $totaliMC[$this->id_traslocatore_partenza] + $mc;\n\n $imponibile = round($totali[$this->id_trasportatore]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_trasportatore] - $imponibile,2);\n\n $ordine_trasportatore = new OrdineFornitore($this->id_preventivo, $this->id_trasportatore, $totali[$this->id_trasportatore], $imponibile, $iva, $totaliMC[$this->id_trasportatore], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASPORTO);\n $ordine_trasportatore->save();\n\n $imponibile = round($totali[$this->id_traslocatore_partenza]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_partenza] - $imponibile,2);\n\n $ordine_traslocatore_partenza = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_partenza, $totali[$this->id_traslocatore_partenza], $imponibile, $iva, $totaliMC[$this->id_traslocatore_destinazione], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_PARTENZA);\n $ordine_traslocatore_partenza->save();\n\n $imponibile = round($totali[$this->id_traslocatore_destinazione]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_traslocatore_destinazione] - $imponibile,2);\n $ordine_traslocatore_destinazione = new OrdineFornitore($this->id_preventivo, $this->id_traslocatore_destinazione, $totali[$this->id_traslocatore_destinazione], $imponibile, $iva, $totaliMC[$this->id_traslocatore_partenza], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_TRASLOCO_DESTINAZIONE);\n $ordine_traslocatore_destinazione->save();\n\n if ($this->giorni_deposito>10) {\n $imponibile = round($totali[$this->id_depositario]/(1+ Parametri::getIVA()),2);\n $iva = round($totali[$this->id_depositario] - $imponibile,2);\n\n $ordine_depositario = new OrdineFornitore($this->id_preventivo, $this->id_depositario, $totali[$this->id_depositario], $imponibile, $iva, $totaliMC[$this->id_depositario], date('Y-m-d'), OrdineFornitore::TIPO_SERVIZIO_DEPOSITO);\n $ordine_depositario->save();\n }\n\n\n\n $data_ordine = date('Y-m-d');\n $con = DBUtils::getConnection();\n $sql =\"UPDATE preventivi SET tipo=\".OrdineBusiness::TIPO_ORDINE.\" , data='\".$data_ordine.\"' ,\n importo_commessa_trasportatore ='\".$totali[$this->id_trasportatore].\"',\n importo_commessa_traslocatore_partenza ='\".$totali[$this->id_traslocatore_partenza].\"',\n importo_commessa_traslocatore_destinazione ='\".$totali[$this->id_traslocatore_destinazione].\"',\n importo_commessa_depositario ='\".$totali[$this->id_depositario].\"',\n imponibile ='\".$imponibile.\"',\n iva ='\".$iva.\"'\n WHERE id_preventivo=\".$this->id_preventivo;\n\n $res = mysql_query($sql);\n //echo \"\\nSQL: \".$sql;\n DBUtils::closeConnection($con);\n\n return new OrdineCliente($this->id_preventivo);\n }", "public function AnularCobranza(Cobranza $co)\n {\n \t$detalleDePago\t=\t$co->GetDetalleDePago();\n \t \n \tforeach ($detalleDePago as $d)\n \t{\n \t\t$PagoTipoId\t=\t$d->PagoTipoId;\n \n \t\t// si pago con cheque tercero en cartera, cambiar estado\n \t\tif($PagoTipoId == 4)\n \t\t{\n \t\t\t$Cheque\t\t= Doctrine::getTable('Cheque')->FindOneById($d->ChequeId);\n \t\t\tif(!is_object($Cheque))\n \t\t\t\tthrow new Exception('No existe el cheque para anular');\n \n \t\t\t$Cheque->Estado\t=\t'Anulado';\n \t\t\t$Cheque->save();\n \t\t}\n \n \t\t// si pague con retencion, al anular cobranza, no queda mas para utilizar\n \t\tif(($PagoTipoId == 6)||($PagoTipoId ==7)||($PagoTipoId == 8)\n \t\t\t\t||($PagoTipoId == 9)||($PagoTipoId == 10)||($PagoTipoId == 11))\n \t\t{\n \t\t\t \n \t\t\t// no hacer nada porque no son mas mostradas por tener fecha de anulacion\n \t\t}\n \n \t\t// si es efectivo, decrementar saldo en efectivo\n \t\tif($PagoTipoId == 2)\n \t\t{\n \t\t\t$Configuracion = Doctrine::GetTable ( 'Configuracion' )->FindOneByNombre('SaldoEfectivo');\n \t\t\t$Configuracion->Valor -=\t$d->Importe;\n \t\t\t$Configuracion->save();\n \n \t\t\t$data['Detalle'] = 'CO #' . $co->Id . ' anulada';\n \t\t\t$data['Importe']\t=\t$co->Importe;\n \t\t\t$data['Saldo']\t=\t$Configuracion->Valor;\n \t\t\t$data['Haber']\t=\t$data['Importe'];\n \n \t\t\t$g = new Classes_GestionEconomicaManager();\n \t\t\t$g->AddHistorialEfectivo($data);\n \t\t}\n\n \t\t// si es un tipo de pago: transferencia (id = 13),\n \t\t// - actualizar saldo de la cuenta de banco asociada\n \t\tif($PagoTipoId == 13)\n \t\t{\n \t\t\tlist($banco, $cuenta)\t=\texplode('-', $d->Detalle);\n \t\t\t\n \t\t\tif(isset($cuenta) && is_numeric($cuenta))\n \t\t\t{\n \t\t\t\t$banco\t\t= Doctrine::getTable('Banco')->FindOneByNumeroDeCuenta($cuenta);\n \t\t\t\tif(!is_object($banco))\n \t\t\t\t\tthrow new Exception('El banco ingresado no existe');\n \n \t\t\t\t$ctacte\t\t=\tnew Classes_CuentaCorrienteManager();\n \t\t\t\t$data['Haber']\t=\t$d->Importe;\n \t\t\t\t$data['Saldo']\t=\t$banco->SaldoCuenta;\n \t\t\t\t$data['BancoId']\t=\t$banco->Id;\n \t\t\t\t$data['Detalle']\t=\t'Tranferencia bancaria de CO '.$co->Numero. ' anulada';\n \t\t\t\t$ctacte->AddConceptoBancoCuentaCorriente($data);\n \t\t\t}\n \t\t}\n \n \t}\n }", "public function comentarios()\n {\n return $this->morphMany(Comentario::class, 'comentarioable');\n }", "private function setDados() {\n $Cover = $this->dados['post_capa']; //Esse indice não pode ser limpo pelo trim nem o array_map\n $Content = $this->dados['post_conteudo']; //Esse indice não pode ser limpo pelo trim nem o array_map\n unset($this->dados['post_capa'], $this->dados['post_conteudo']); //Como os itens anteriores ja foram guardados em váriáveis então podemos dar unset neles, assim podemos pegar eles após limpesa dos dados\n\n $this->dados = array_map('strip_tags', $this->dados); //Realizando a limpesa dos dados de entrada com metoto strip_tags, assim evitando entrada de códigos maliciosos\n $this->dados = array_map('trim', $this->dados); //Realizando a limpesa dos dados de entrada com metoto trim, assim evitando entrada de códigos maliciosos\n\n $this->dados['post_nome'] = Check::Name($this->dados['post_titulo']); //Adicionando ao atributo Dados no indice post_name com checagem pelo metodo statico Check::Name\n $this->dados['post_data'] = Check::Data($this->dados['post_data']); //Adicionando ao atributo Dados no indice post_date com checagem pelo metodo statico Check::Data\n \n\n $this->dados['post_capa'] = $Cover; //Adicionando ao atributo Dados no indice post_capa o conteudo da variável $Cover\n $this->dados['post_conteudo'] = $Content; //Adicionando ao atributo Dados no indice post_content o conteudo da váriável $Content\n $this->dados['post_categoria_pai'] = $this->getCatParent(); //Adicionando ao atributo Dados no indice post_categoria_pai o conteudo do metodo getCatParent\n }", "public function estadisticasPersonas()\n {\n $em = $this->getDoctrine()->getManager();\n\n $nacionalidades = $em->getRepository('SICBundle:AdminNacionalidad')->findAll();\n $stat_nacionalidad_jgf = array();\n $stat_nacionalidad_p = array();\n foreach ($nacionalidades as $nacionalidad) {\n array_push(\n $stat_nacionalidad_jgf, array(\n 'nacionalidad' => $nacionalidad->getNacionalidad(),\n 'quienes' => $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('nacionalidad' => $nacionalidad->getId()))\n )\n );\n array_push(\n $stat_nacionalidad_p, array(\n 'nacionalidad' => $nacionalidad->getNacionalidad(),\n 'quienes' => $em->getRepository('SICBundle:Persona')->findBy(array('nacionalidad' => $nacionalidad->getId()))\n )\n );\n }\n\n $resp_cerradas = $em->getRepository('SICBundle:AdminRespCerrada')->findAll();\n $stat_cne_jgf = array();\n $stat_cne_p = array();\n foreach ($resp_cerradas as $resp) {\n array_push($stat_cne_jgf, array('resp' => $resp->getRespuesta(),'quienes' => $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('cne' => $resp->getId()))));\n array_push($stat_cne_p, array('resp' => $resp->getRespuesta(),'quienes' => $em->getRepository('SICBundle:Persona')->findBy(array('cne' => $resp->getId()))));\n }\n \n $stat_empleado_jgf = array();\n foreach ($resp_cerradas as $resp) {\n array_push($stat_empleado_jgf, array('resp' => $resp->getRespuesta(),'quienes'=> $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('trabajaActualmente' => $resp->getId()))));\n }\n\n $instruccion = $em->getRepository('SICBundle:AdminNivelInstruccion')->findAll();\n $stat_instruccion_jgf = array();\n $stat_instruccion_p = array();\n foreach ($instruccion as $elemento) {\n \t$whos = $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('nivelInstruccion' => $elemento->getId()));\n\t\t\tif (sizeof($whos)>0) { array_push($stat_instruccion_jgf, array('nivel' => $elemento->getNombre(),'quienes'=> $whos)); }\n $whos = $em->getRepository('SICBundle:Persona')->findBy(array('gradoInstruccion' => $elemento->getId()));\n\t\t\tif (sizeof($whos)>0) { array_push($stat_instruccion_p, array('nivel' => $elemento->getNombre(),'quienes'=> $whos)); }\n }\n\n $profesiones = $em->getRepository('SICBundle:AdminProfesion')->findAll();\n $stat_profesiones_jgf = array();\n $stat_profesiones_p = array();\n foreach ($profesiones as $elemento) {\n \t$whos = $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('profesion' => $elemento->getId()));\n \tif (sizeof($whos)) { array_push($stat_profesiones_jgf, array('profesion' => $elemento->getNombre(),'quienes'=> $whos)); }\n \t$whos = $em->getRepository('SICBundle:Persona')->findBy(array('profesion' => $elemento->getId()));\n \tif (sizeof($whos)) { array_push($stat_profesiones_p, array('profesion' => $elemento->getNombre(),'quienes'=> $whos)); }\n \n }\n\n $discapacidades = $em->getRepository('SICBundle:AdminIncapacidades')->findAll();\n $stat_discapacidades_jgf = array();\n $stat_discapacidades_p = array();\n foreach ($discapacidades as $elemento) {\n $whos = $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('incapacitadoTipo' => $elemento->getId()));\n if(sizeof($whos) > 0){ array_push($stat_discapacidades_jgf, array('discapacidad' => $elemento->getIncapacidad(),'quienes'=> $whos)); }\n $whos = $em->getRepository('SICBundle:Persona')->findBy(array('incapacitadoTipo' => $elemento->getId()));\n if(sizeof($whos) > 0){ array_push($stat_discapacidades_p, array('discapacidad' => $elemento->getIncapacidad(),'quienes'=> $whos)); }\n \n }\n\n $pensionados = $em->getRepository('SICBundle:AdminPensionadoInstitucion')->findAll();\n $stat_pensionados_jgf = array();\n $stat_pensionados_p = array();\n foreach ($pensionados as $elemento) {\n array_push($stat_pensionados_jgf, array('pensionados' => $elemento->getNombre(),'quienes'=> $em->getRepository('SICBundle:JefeGrupoFamiliar')->findBy(array('pensionadoInstitucion' => $elemento->getId()))));\n array_push($stat_pensionados_p, array('pensionados' => $elemento->getNombre(),'quienes'=> $em->getRepository('SICBundle:Persona')->findBy(array('pensionadoInstitucion' => $elemento->getId()))));\n }\n\n return array(\n 'stat_nacionalidad_jgf' => $stat_nacionalidad_jgf,\n 'stat_nacionalidad_p' => $stat_nacionalidad_p,\n\n 'stat_cne_jgf' => $stat_cne_jgf,\n 'stat_cne_p' => $stat_cne_p,\n\n 'stat_instruccion_jgf' => $stat_instruccion_jgf,\n 'stat_instruccion_p' => $stat_instruccion_p,\n\n 'stat_profesiones_jgf' => $stat_profesiones_jgf,\n 'stat_profesiones_p' => $stat_profesiones_p,\n\n 'stat_empleado_jgf' => $stat_empleado_jgf,\n\n 'stat_discapacidades_jgf' => $stat_discapacidades_jgf,\n 'stat_discapacidades_p' => $stat_discapacidades_p,\n\n 'stat_pensionados_jgf' => $stat_pensionados_jgf,\n 'stat_pensionados_p' => $stat_pensionados_p,\n );\n }", "private function iniciarRecolectarData()\r\n\t\t{\r\n\t\t\tself::findPagoDetalleActividadEconomica();\r\n\t\t\tself::findPagoDetalleInmuebleUrbano();\r\n\t\t\tself::findPagoDetalleVehiculo();\r\n\t\t\tself::findPagoDetalleAseo();\r\n\t\t\tself::findPagoDetallePropaganda();\r\n\t\t\tself::findPagoDetalleEspectaculo();\r\n\t\t\tself::findPagoDetalleApuesta();\r\n\t\t\tself::findPagoDetalleVario();\r\n\t\t\tself::findPagoDetalleMontoNegativo();\r\n\t\t\tself::ajustarDataReporte();\r\n\t\t}", "function GetPeliculasConGenero(){\n //$sentencia = $this->db->prepare(\"SELECT * FROM peliculas INNER JOIN genero ON peliculas.titulo = genero.nombre\");\n $sentenciasad = $this->db->prepare(\"SELECT peliculas.titulo, genero.nombre FROM peliculas INNER JOIN genero ON peliculas.id_genero = genero.id_genero\");\n $sentencias->executing();\n //print_r( $sentencia->fetchAll(PDO::FETCH_OBJ));// vemos que este cargado y con que \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }", "public function buildRelations()\n {\n $this->addRelation('GsArtikelen', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsArtikelen', RelationMap::MANY_TO_ONE, array('zinummer' => 'zinummer', ), null, null);\n $this->addRelation('GsArtikelEigenschappen', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsArtikelEigenschappen', RelationMap::MANY_TO_ONE, array('zinummer' => 'zindex_nummer', ), null, null);\n $this->addRelation('RzvVerstrekkingOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('thesaurus_rzv_verstrekking' => 'thesaurusnummer', 'rzvverstrekking' => 'thesaurus_itemnummer', ), null, null);\n $this->addRelation('RzvHulpmiddelenOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('thesaurus_rzv_hulpmiddelen' => 'thesaurusnummer', 'hulpmiddelen_zorg' => 'thesaurus_itemnummer', ), null, null);\n $this->addRelation('RzvVoorwaardenOmschrijving', 'PharmaIntelligence\\\\GstandaardBundle\\\\Model\\\\GsThesauriTotaal', RelationMap::MANY_TO_ONE, array('rzv_thesaurus_120' => 'thesaurusnummer', 'rzvvoorwaarden_bijlage_2' => 'thesaurus_itemnummer', ), null, null);\n }", "function obtiene_bebidas_menu($valor=1){\n /**\n * guardamos la consulta en $sql obtiene todos las tuplas de la tabla\n * ejecutamos la consulta en php obtenemos una tabla con los resultados\n * en el for convertimos a cada tupla en un objeto y añadimos al array $objetos uno a uno\n * retornamos un array con todas las tuplas como objetos\n */\n try {\n $sql=\"SELECT * FROM \".Bebidas::TABLA[0].\" WHERE tipo = 'zumo' and estado = $valor or tipo = 'refresco_con_gas' and estado = $valor or tipo = 'refresco_sin_gas' and estado = $valor\";\n $resultado=$this->conexion->query($sql);\n $objetos=array();\n\n while ($fila=$resultado->fetch_object()){\n $objetos[]=$fila;\n //echo 'fila = '. var_dump($fila);\n }\n\n /*\n for($x=0;$x<$resultado->field_count;$x++){\n $objetos[$x]=$resultado[$x]->fetch_object();\n }*/\n return $objetos;\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n \n }", "private function classementGeneral($rep)\n {\n \n $stockagePoints = array();\n foreach($rep->findAll() as $value)\n {\n $stockagePoints[] = $value->getPoints();\n }\n \n rsort($stockagePoints) ; /* on trie par ordre croissant pour obtenir le classement dans le bon ordre */\n \n $stockUser = array();\n foreach($stockagePoints as $key =>$value){\n foreach($rep->findAll() as $key2 => $value2){\n if($value2->getPoints() == $value || $key == $key2){\n if($value2->getPoints() == $value){ /* enleve doublons */ \n if(!in_array( $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value2->getId()),$stockUser)){\n $stockUser[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value2->getId());\n }\n }\n }\n }\n }\n \n $stockUserTmp = array();\n foreach($stockUser as $value){\n $userInformations = array();\n $userInformations['id'] = $value->getId();\n $userInformations['points'] = $value->getPoints();\n $userInformations['averageTime'] = $value->getAverageTime();\n $stockUserTmp[] = $userInformations ;\n }\n \n $stockUserFinal = array();\n foreach($stockUserTmp as $key =>$value){\n foreach($stockUserTmp as $key2 => $value2){\n if($value['points'] == $value2['points'] && $key == ($key2+1)){ /* si points egaux */\n if($value['averageTime'] < $value2['averageTime']){ /* on teste quel utilisateur a réalisé le meilleur temps */\n $stockUserFinal[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value['id']);\n $stockUserFinal[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value2['id']);\n }\n elseif($value['averageTime'] > $value2['averageTime']){\n $stockUserFinal[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value2['id']);\n $stockUserFinal[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value['id']);\n }\n \n }\n elseif($value['points'] != $value2['points'] && $key+1 == $key2){ /* si points sont differents pas besoins de tester le temps mi par user*/\n if(!in_array($this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value['id']),$stockUserFinal)){\n $stockUserFinal[] = $this->getDoctrine()->getEntityManager()->getRepository('MetinetFacebookBundle:User')->findOneById($value['id']);\n }\n }\n }\n }\n \n $stockUserFinal[] = end($stockUser);\n \n return $stockUserFinal ;\n \n }" ]
[ "0.5963053", "0.58973885", "0.570623", "0.56653345", "0.5629364", "0.5617675", "0.55253947", "0.54818696", "0.5471189", "0.54684395", "0.5464083", "0.5448724", "0.5448074", "0.5403418", "0.5395045", "0.53760886", "0.53733665", "0.5372526", "0.5366703", "0.53649825", "0.53648305", "0.5362921", "0.53624725", "0.5356806", "0.5356587", "0.53546524", "0.53405505", "0.5317219", "0.5273477", "0.52698475", "0.5261532", "0.5251753", "0.5249526", "0.52385676", "0.52382624", "0.5235678", "0.5231358", "0.5220545", "0.52073497", "0.51952267", "0.51938576", "0.51899576", "0.5188132", "0.5183913", "0.5180526", "0.51784515", "0.51782197", "0.51756114", "0.517133", "0.51663285", "0.5153943", "0.51538396", "0.5153191", "0.514973", "0.5145153", "0.5143904", "0.51389", "0.5138744", "0.5132672", "0.5126166", "0.51232356", "0.5122051", "0.5121358", "0.51200885", "0.51193106", "0.5119109", "0.51170194", "0.5114606", "0.5111093", "0.5110638", "0.5107148", "0.51015717", "0.50991195", "0.509839", "0.50909007", "0.50873095", "0.50861156", "0.5085575", "0.50832593", "0.50805825", "0.5079081", "0.5075752", "0.5074727", "0.50732005", "0.5070596", "0.5067812", "0.5066938", "0.50662756", "0.5063146", "0.5062544", "0.50623745", "0.506087", "0.5059021", "0.5058827", "0.50571007", "0.50560176", "0.5054669", "0.50527585", "0.5049766", "0.5043055", "0.5032196" ]
0.0
-1
Get the size in bytes of a folder
function foldersize($path) { $size = 0; if ($handle = @opendir($path)) { while (($file = readdir($handle)) !== false) { if (is_file($path . "/" . $file)) { $size += filesize($path . "/" . $file); } if (is_dir($path . "/" . $file)) { if ($file != "." && $file != "..") { $size += foldersize($path . "/" . $file); } } } } return $size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirectorySize(DirectoryInterface $directory): int;", "public function action_folder_size()\n {\n $RCMAIL = rcmail::get_instance();\n $STORAGE = $RCMAIL->get_storage();\n $OUTPUT = $RCMAIL->output;\n\n // sanitize: _folders\n $folders = rcube_utils::get_input_value('_folders', rcube_utils::INPUT_POST) ?: '__ALL__';\n if (\\is_string($folders)) {\n $folders = $folders === '__ALL__' ? $STORAGE->list_folders() : [$folders];\n }\n\n // sanitize: _humanize\n $humanize = \\filter_var(\n rcube_utils::get_input_value('_humanize', rcube_utils::INPUT_POST),\n \\FILTER_VALIDATE_BOOLEAN\n );\n $humanize = isset($humanize) ? $humanize : true;\n\n $sizes = $this->get_folder_size($folders, $humanize);\n\n $OUTPUT->command('plugin.callback_folder_size', $sizes);\n $OUTPUT->send();\n }", "function folder_size (string $dir) :int\n {\n $size = 0;\n foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {\n $size += is_file($each) ? filesize($each) : $this->folder_size($each);\n }\n return $size;\n }", "function dir_size($path)\r\n{\r\n\r\n // use a normalize_path function here\r\n // to make sure $path contains an\r\n // ending slash\r\n // (-> http://codedump.jonasjohn.de/snippets/normalize_path.htm)\r\n\r\n // to display a good lucking size you can use a readable_filesize\r\n // function, get it here:\r\n // (-> http://codedump.jonasjohn.de/snippets/readable_filesize.htm)\r\n\r\n $size = 0;\r\n\r\n $dir = opendir($path);\r\n if (!$dir){return 0;}\r\n\r\n while (($file = readdir($dir)) !== false) {\r\n\r\n if ($file[0] == '.'){ continue; }\r\n\r\n if (is_dir($path.$file)){\r\n // recursive:\r\n $size += dir_size($path.$file.DIRECTORY_SEPARATOR);\r\n }\r\n else {\r\n $size += filesize($path.$file);\r\n }\r\n }\r\n\r\n closedir($dir);\r\n return $size;\r\n}", "function folder_size($dir_name)\n{\n $size = 0;\n if ($dir_handle = opendir($dir_name)) {\n while (($entry = readdir($dir_handle)) !== false) {\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n if (is_dir($dir_name.'/'.$entry)) {\n $size += folder_size($dir_name.'/'.$entry);\n } else {\n $size += filesize($dir_name.'/'.$entry);\n }\n }\n\n closedir($dir_handle);\n }\n\n return $size;\n}", "public function getSize() {\n\t\treturn filesize($this->getPath());\n\t}", "function get_dirsize($directory, $max_execution_time = \\null)\n {\n }", "public function getSize($path);", "function getWinDirSize($path) {\n $obj = new COM ( 'scripting.filesystemobject' );\n if ( is_object ( $obj ) )\n {\n $ref = $obj->getfolder ( $path );\n $dir_size = $ref->size;\n $obj = null;\n return $dir_size;\n }\n }", "public function size()\n {\n $size = 0;\n $list_dirs = array($this->_dirname);\n $i = 0;\n while(isset($list_dirs[$i]))\n {\n \t$d = $list_dirs[$i];\n \t$list = array_diff(scandir($d), array('..', '.'));\n \tforeach ($list as $f)\n \t{\n \t\tif (is_dir($d.$f))\n \t\t{\n \t\t\t$list_dirs[] = $d.$f.'/';\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$size += filesize($d.$f);\n \t\t}\n \t}\n \t$i++;\n }\n return $size;\n }", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "function foldersize($path) {\n\t$total_size = 0;\n\t$files = scandir($path);\n\t$cleanPath = rtrim($path, '/') . '/';\n\tforeach($files as $t) {\n\t\tif ($t<>\".\" && $t<>\"..\") {\n\t\t\t$currentFile = $cleanPath . $t;\n\t\t\tif (is_dir($currentFile)) {\n\t\t\t\t$size = foldersize($currentFile);\n\t\t\t\t$total_size += $size;\n\t\t\t} else {\n\t\t\t\t$size = filesize($currentFile);\n\t\t\t\t$total_size += $size;\n\t\t\t}\n\t\t}\n\t}\n\treturn $total_size;\n}", "function get_dir_size($dir) {\r\n\t$dir_size = exec(\"du -ksh \".$dir);\r\n\t$dir_size = split(\"\\t\",$dir_size);\r\n\treturn $dir_size[0];\r\n}", "function folderSize($dir){\n$count_size = 0;\n$count = 0;\n$dir_array = scandir($dir);\n foreach($dir_array as $key=>$filename){\n if($filename!=\"..\" && $filename!=\".\"){\n if(is_dir($dir.\"/\".$filename)){\n $new_foldersize = foldersize($dir.\"/\".$filename);\n $count_size = $count_size+ $new_foldersize;\n }else if(is_file($dir.\"/\".$filename)){\n $count_size = $count_size + filesize($dir.\"/\".$filename);\n $count++;\n }\n }\n }\nreturn $count_size;\n}", "function get_total_folder_size($path, $can_see_invisible = false)\n{\n $table_itemproperty = Database::get_course_table(TABLE_ITEM_PROPERTY);\n $table_document = Database::get_course_table(TABLE_DOCUMENT);\n $tool_document = TOOL_DOCUMENT;\n\n $course_id = api_get_course_int_id();\n $session_id = api_get_session_id();\n $session_condition = api_get_session_condition(\n $session_id,\n true,\n true,\n 'props.session_id'\n );\n\n $visibility_rule = ' props.visibility ' . ($can_see_invisible ? '<> 2' : '= 1');\n\n $sql = \"SELECT SUM(table1.size) FROM (\n SELECT props.ref, size\n FROM $table_itemproperty AS props, $table_document AS docs\n WHERE\n docs.c_id \t= $course_id AND\n docs.id \t= props.ref AND\n docs.path LIKE '$path/%' AND\n props.c_id \t= $course_id AND\n props.tool \t= '$tool_document' AND\n $visibility_rule\n $session_condition\n GROUP BY ref\n ) as table1\";\n\n $result = Database::query($sql);\n if ($result && Database::num_rows($result) != 0) {\n $row = Database::fetch_row($result);\n\n return $row[0] == null ? 0 : $row[0];\n } else {\n return 0;\n }\n}", "function get_dir_size()\n\t{\n\t\t//-----------------------------------------\n\t\t// Make sure the uploads path is correct\n\t\t//-----------------------------------------\n\t\t\n\t\t$uploads_size = 0;\n\t\t\n\t\tif ($dh = @opendir( $this->ipsclass->vars['upload_dir'] ))\n\t\t{\n\t\t\twhile ( false !== ( $file = @readdir( $dh ) ) )\n\t\t\t{\n\t\t\t\tif ( ! preg_match( \"/^..?$|^index/i\", $file ) )\n\t\t\t\t{\n\t\t\t\t\tif( is_dir( $this->ipsclass->vars['upload_dir'] . \"/\" . $file ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $sub_dh = @opendir( $this->ipsclass->vars['upload_dir'] . \"/\" . $file ))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile ( false !== ( $sub_file = @readdir( $sub_dh ) ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ( ! preg_match( \"/^..?$|^index/i\", $sub_file ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$uploads_size += @filesize( $this->ipsclass->vars['upload_dir'] . \"/\" . $file . \"/\" . $sub_file );\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$uploads_size += @filesize( $this->ipsclass->vars['upload_dir'] . \"/\" . $file );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t@closedir( $dh );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// This piece of code from Jesse's ([email protected]) contribution\n\t\t// to the PHP manual @ php.net posted without license\n\t\t//-----------------------------------------\n\t\t\n\t\tif ($uploads_size >= 1048576)\n\t\t{\n\t\t\t$uploads_size = round($uploads_size / 1048576 * 100 ) / 100 . \" мб\";\n\t\t}\n\t\telse if ($uploads_size >= 1024)\n\t\t{\n\t\t\t$uploads_size = round($uploads_size / 1024 * 100 ) / 100 . \" кб\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uploads_size = $uploads_size . \" байт\";\n\t\t}\n\t\t\n\t\t$this->print_nocache_headers();\n\t\t@header( \"Content-type: text/plain;charset={$this->ipsclass->vars['gb_char_set']}\" );\n\t\tprint $uploads_size;\n\t\texit();\n\t}", "function getDirectorySize($path) { \n $totalsize = 0; \n $totalcount = 0; \n $dircount = 0; \n if ($handle = opendir ($path)) \n { \n while (false !== ($file = readdir($handle))) \n { \n $nextpath = $path . '/' . $file; \n if ($file != '.' && $file != '..' && !is_link ($nextpath)) \n { \n if (is_dir ($nextpath)) \n { \n $dircount++; \n $result = getDirectorySize($nextpath); \n $totalsize += $result['size']; \n $totalcount += $result['count']; \n $dircount += $result['dircount']; \n } \n elseif (is_file ($nextpath)) \n { \n $totalsize += filesize ($nextpath); \n $totalcount++; \n } \n } \n } \n } \n closedir ($handle); \n $total['size'] = $totalsize; \n $total['count'] = $totalcount; \n $total['dircount'] = $dircount; \n return $total; \n}", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "function getDirectorySize($path)\n{\n $totalsize = 0;\n $totalcount = 0;\r\n $dircount = 0;\n if($handle = opendir($path))\n {\n while (false !== ($file = readdir($handle)))\n {\n $nextpath = $path . '/' . $file;\n if($file != '.' && $file != '..' && !is_link ($nextpath))\n {\n if(is_dir($nextpath))\n {\n $dircount++;\n $result = getDirectorySize($nextpath);\n $totalsize += $result['size'];\n $totalcount += $result['count'];\n $dircount += $result['dircount'];\n }\n else if(is_file ($nextpath))\n {\n $totalsize += filesize ($nextpath);\n $totalcount++;\n }\n }\n }\n }\n closedir($handle);\n $total['size'] = $totalsize;\n $total['count'] = $totalcount;\n $total['dircount'] = $dircount;\n return $total;\n}", "public static function getSize($path) {\n \n }", "function dirSize($directory)\n{\n $size = 0;\n $files = glob($directory . '*');\n foreach ($files as $path) {\n if (is_file($path)) {\n $size += filesize($path);\n }\n }\n return $size;\n}", "function dir_size($dir) { \n $totalsize = 0; \n if ($dirstream = @opendir($dir)) { \n while (false !== ($filename = readdir($dirstream))) { \n if ($filename != '.' && $filename != '..') { \n if (is_file($dir.'/'.$filename)) { \n $totalsize += sprintf(\"%u\", filesize($dir.'/'.$filename)); \n } \n if (is_dir($dir.'/'.$filename)) { \n $totalsize += dir_size($dir.'/'.$filename); \n } \n } \n } \n closedir($dirstream); \n } \n return $totalsize; \n}", "public function folder_size($folder) {\n\n $mailbox_idnr = $this->get_mail_box_id($folder);\n\n $query = \" SELECT SUM(dbmail_physmessage.messagesize) as folder_size \"\n . \" FROM dbmail_messages \"\n . \" INNER JOIN dbmail_physmessage on dbmail_messages.physmessage_id = dbmail_physmessage.id \"\n . \" WHERE dbmail_messages.mailbox_idnr = {$this->dbmail->escape($mailbox_idnr)} \"\n . \" AND dbmail_messages.deleted_flag = 0 \";\n\n $res = $this->dbmail->query($query);\n $row = $this->dbmail->fetch_assoc($res);\n\n return (is_array($row) && array_key_exists('folder_size', $row) ? $row['folder_size'] : 0);\n }", "function getNixDirSize($path) {\n $io = popen('/usr/bin/du -ks '.$path, 'r');\n $output = fgets ( $io, 4096);\n $result = preg_split('/\\s/', $output);\n $size = $result[0]*1024;\n pclose($io);\n return $size;\n }", "public function getSize($path)\n {\n }", "public function getRootTotalSize() {\n $path = rtrim($this->path_to_files, '/') . '/';\n $result = $this->getDirSummary($path);\n return $result['size'];\n }", "public function size() {\n\t\treturn filesize($this->_path);\n\t}", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "public function get_size($dir_file){\n\t\n\tif(!file_exists($dir_file) or !is_dir($dir_file)) exit('the error file or dir');\n\t\n\tif(is_file($dir_file)) return filesize($dir_file);\n\t\n\t$handle=opendir($dir_file);\n\t\n\t$size=0;\n\t\n\twhile(false!==($file=readdir($handle))){\n\t\t\n\t\t\tif($file==\".\" or $file==\"..\") continue;\n\t\t\t\n\t\t\t$file=$dir_file.\"/\".$file;\n\t\t\t\n\t\t\tif(is_dir($file)){\n\t\t\t\t\n\t\t\t\t$size+=$this->get_size($file);\n\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$size+=filesize($file);\n\t\t\t\n\t\t\t}\n\n\t}\n\t\n\tclosedir($handle);\n\t\n\treturn $size;\n\n}", "public function getSize()\n {\n return $this->fileStructure->size;\n }", "public function getLength()\n {\n return filesize($this->fullPath);\n }", "public static function size($_path)\r\n {\r\n return filesize($_path);\r\n }", "public function getSize()\n {\n return $this->getStat('size');\n }", "function dirsizeof($dir) {\r\n global $taille_disque, $ch_texte, $base_dir; \r\n $cluster = 6144;\r\n\t$taille_dir = 512;\r\n\t$myDir = opendir($dir);\r\n\t$entryName = readdir($myDir);\r\n\twhile( \"-\".$entryName != \"-\" ) {\r\n\t\tif (!is_dir(\"$dir/$entryName\")) {\r\n\t\t\t$size += max(filesize(\"$dir/$entryName\"), $cluster);\r\n\t\t}\r\n\t\telse if (is_dir(\"$dir/$entryName\") AND !(ereg(\"^(\\.\\.?|CVS)$\",$entryName))) {\r\n\t\t\t$size += dirsizeof(\"$dir/$entryName\") + $taille_dir;\r\n\t\t}\r\n\t\t$entryName = @readdir($myDir);\r\n\t}\r\n\t$nom_dir = substr($dir, strlen($base_dir)+1);\r\n\tif ($dir == $base_dir) {\r\n\t $taille_disque = taille_en_octets($size);\r\n\t $ch_texte .= ligne_texte_valeur(_T('tabbord:total'), taille_en_octets($size), \"entete\");\r\n\t}\r\n\telse if (!ereg(\"\\/\",$nom_dir)) \r\n\t $ch_texte .= ligne_texte_valeur($nom_dir, taille_en_octets($size), \"stotal\") . ligne_vide();\r\n\telse $ch_texte .= ligne_texte_valeur($nom_dir, taille_en_octets($size), \"liste\");\r\n\t@closedir($myDir);\r\n\treturn ($size);\r\n}", "public function getSize()\r\n {\r\n return filesize($this->filename);\r\n }", "function fm_get_size($path, $rawbytes = 0) {\r\n\tif (!is_dir($path)) {\r\n\t\treturn fm_readable_filesize(@filesize($path));\r\n\t}\r\n\t$dir = opendir($path);\r\n\t$size = 0;\r\n\twhile ($file = readdir($dir)) {\r\n\t\tif (is_dir($path.\"/\".$file) && $file != \".\" && $file != \"..\") {\r\n\t\t\t$size += fm_get_size($path.\"/\".$file, 1);\r\n\t\t} else {\r\n\t\t\t$size += @filesize($path.\"/\".$file);\r\n\t\t}\r\n\t}\r\n\tif ($rawbytes == 1) {\r\n\t\treturn $size;\r\n\t}\r\n\tif ($size == 0) {\r\n\t\treturn \"0 Bytes\";\r\n\t} else {\r\n\t\treturn fm_readable_filesize($size);\r\n\t}\r\n}", "public function getSize(){\n $path = $this->aParams['path'] . $this->aParams['name'];\n if(\n is_null($this->aParams['size']) &&\n mb_strlen($this->aParams['path']) &&\n mb_strlen($this->aParams['name']) &&\n file_exists($path)\n\n ){\n $this->aParams['size'] = filesize($path);\n }\n return\n $this->aParams['size'] !== FALSE && $this->aParams['size'] !== null\n ? sprintf('%u', $this->aParams['size'])\n : NULL;\n }", "function getDestinationSize()\n {\n return filesize($this->destinationFilePath);;\n }", "public function getSize()\n {\n return $this->fstat()[\"size\"];\n }", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function totalSize() {\r\n \r\n return disk_total_space($this->directoryRoot->fullName());\r\n }", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "function size($directory, $format=FALSE)\n\t{\n\t\t$size = 0;\n\n\t\t// if the path has a slash at the end we remove it here\n\t\tif(substr($directory,-1) == '/')\n\t\t{\n\t\t\t$directory = substr($directory,0,-1);\n\t\t}\n\n\t\t// if the path is not valid or is not a directory ...\n\t\tif(!file_exists($directory) || !is_dir($directory) || !is_readable($directory))\n\t\t{\n\t\t\t// ... we return -1 and exit the function\n\t\t\treturn -1;\n\t\t}\n\t\t// we open the directory\n\t\tif($handle = opendir($directory))\n\t\t{\n\t\t\t// and scan through the items inside\n\t\t\twhile(($file = readdir($handle)) !== false)\n\t\t\t{\n\t\t\t\t// we build the new path\n\t\t\t\t$path = $directory.'/'.$file;\n\n\t\t\t\t// if the filepointer is not the current directory\n\t\t\t\t// or the parent directory\n\t\t\t\tif($file != '.' && $file != '..')\n\t\t\t\t{\n\t\t\t\t\t// if the new path is a file\n\t\t\t\t\tif(is_file($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t// we add the filesize to the total size\n\t\t\t\t\t\t$size += filesize($path);\n\n\t\t\t\t\t// if the new path is a directory\n\t\t\t\t\t}elseif(is_dir($path))\n\t\t\t\t\t{\n\t\t\t\t\t\t// we call this function with the new path\n\t\t\t\t\t\t$handlesize = recursive_directory_size($path);\n\n\t\t\t\t\t\t// if the function returns more than zero\n\t\t\t\t\t\tif($handlesize >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// we add the result to the total size\n\t\t\t\t\t\t\t$size += $handlesize;\n\n\t\t\t\t\t\t// else we return -1 and exit the function\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close the directory\n\t\t\tclosedir($handle);\n\t\t}\n\t\t// if the format is set to human readable\n\t\tif($format == TRUE)\n\t\t{\n\t\t\t// if the total size is bigger than 1 MB\n\t\t\tif($size / 1048576 > 1)\n\t\t\t{\n\t\t\t\treturn round($size / 1048576, 1).' MB';\n\n\t\t\t// if the total size is bigger than 1 KB\n\t\t\t}elseif($size / 1024 > 1)\n\t\t\t{\n\t\t\t\treturn round($size / 1024, 1).' KB';\n\n\t\t\t// else return the filesize in bytes\n\t\t\t}else{\n\t\t\t\treturn round($size, 1).' bytes';\n\t\t\t}\n\t\t}else{\n\t\t\t// return the total filesize in bytes\n\t\t\treturn $size;\n\t\t}\n\t}", "public function get_file_size()\n\t{\n if (!$this->file_size) {\n if ($this->local_file) {\n $this->file_size = filesize($this->local_file);\n } else {\n $object = upload_aws2::$client->listObjects(array(\n 'Bucket' => $this->bucket,\n 'Prefix' => $this->location\n ));\n $this->file_size = $object['Contents'][0]['Size'];\n }\n }\n return $this->file_size;\n\t}", "function size($path)\t{\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn filesize($file);\n\t\t}\n\t}", "public function filesize()\n {\n $size =\n round(\n (filesize('/var/www/html/web'.$this->getSrc()) / 1000),\n 2\n );\n\n // Clear cache\n clearstatcache();\n // Return result\n return $size . ' Kb';\n }", "public function getSize(): int\n {\n return $this->filesystem->getSize(\n $this->resource->getPath()\n );\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function getSize()\n {\n return $this->file['size'];\n }", "public function filesize()\n\t{\n\t\treturn (int)$this->_parent->{$this->_name.'_file_size'};\n\t}", "public function getTotalSize(): int;", "public function get_dir_size($directory) {\n $r = 0;\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file) {\n $r += @$file->getSize();\n }\n return $r > 0 ? $r / (1024*1024) : 0;\n }", "private function Size($path)\r\n {\r\n $bytes = sprintf('%u', filesize($path));\r\n\r\n if ($bytes > 0)\r\n {\r\n $unit = intval(log($bytes, 1024));\r\n $units = array('B', 'KB', 'MB', 'GB');\r\n\r\n if (array_key_exists($unit, $units) === true)\r\n {\r\n return sprintf('%d %s', $bytes / pow(1024, $unit), $units[$unit]);\r\n }\r\n }\r\n\r\n return $bytes;\r\n }", "function count_bytes_all_files() {\n $result = $this->pdo->query('SELECT SUM(size) FROM files');\n return $this->convert_file_size($result->fetchColumn());\n }", "public function totalSize()\n {\n return cm_human_filesize($this->getItems()->sum('filesize'));\n }", "public function getTotalSize();", "function GetDirSize($d, &$aFiles) {\n if (!file_exists($d)) return 0;\n $dh = opendir($d);\n $size = 0;\n while(($f = readdir($dh))!==false) {\n if ($f != \".\" && $f != \"..\") {\n $path = $d . \"/\" . $f;\n if(is_dir($path)) $size += dirsize($path, $aFiles);\n elseif(is_file($path)) {\n $fs = filesize($path);\n $size += $fs;\n $aFiles[] = array($path, filectime($path), $fs);\n }\n }\n }\n closedir($dh);\n return $size;\n}", "public function getFileSize() {\n\t\treturn filesize($this->filename);\n\t}", "public function getSize()\n {\n return $this->file->getSize();\n }", "public function downloadsize() {\n return $this->info['size_download'];\n }", "public function getSize($path)\n {\n if($object = $this->getMetadata($path)){\n $object['size'] = $object['content-length'];\n }\n\n return $object;\n }", "public function getSize($path)\n\t{\n\t\treturn $this->getMetadata($path);\n\t}", "public function getFileSize() {\n return $this->size;\n }", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function size(string $path): Promise;", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function getSize() {\n\t\t\treturn $this->getStats( 'bytes' );\n\t\t}", "public function getSize($path)\n {\n return $this->getMetadata($path);\n }", "public function getSize($path)\n {\n return $this->getMetadata($path);\n }", "public static function size($path)\r\n {\r\n $path = Akt_Filesystem_Path::clean($path);\r\n\r\n if (!is_file($path)) {\r\n throw new Exception(\"File '{$path}' not found\");\r\n }\r\n\r\n $filesize = @filesize($path);\r\n\r\n if ($filesize === false) {\r\n throw new Exception(\"Couldn't get file size\");\r\n }\r\n\r\n return sprintf(\"%u\", $filesize);\r\n }", "function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}", "function dir_size($dir, $skip_files_starting_with_dot = true) {\n $totalsize = 0;\n \n if($dirstream = @opendir($dir)) {\n while(false !== ($filename = readdir($dirstream))) {\n $path = with_slash($dir) . $filename;\n\n if (is_link($path)) continue;\n\n if ($skip_files_starting_with_dot) {\n if(($filename != '.') && ($filename != '..') && ($filename[0]!='.')) {\n if (is_file($path)) $totalsize += filesize($path);\n if (is_dir($path)) $totalsize += dir_size($path, $skip_files_starting_with_dot);\n } // if\n } else {\n if(($filename != '.') && ($filename != '..')) {\n if (is_file($path)) $totalsize += filesize($path);\n if (is_dir($path)) $totalsize += dir_size($path, $skip_files_starting_with_dot);\n } // if\n }\n } // while\n } // if\n \n closedir($dirstream);\n return $totalsize;\n }", "function getSize()\n {\n $this->loadStats();\n return $this->stat['size'];\n }", "public function getSize()\n\t{\n\t\treturn filesize($this->tmp_name);\n\t}", "public function size(string $path): int\n {\n return filesize($path);\n }", "public function getSize()\n {\n return $this->archiveSize;\n }", "public function getSizeInBytes()\n {\n return $this->_sizeInBytes;\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize() : int\n {\n return $this->size;\n }", "public function getSize()\n {\n return (int) $this->size;\n }", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}" ]
[ "0.81327164", "0.78180146", "0.78136855", "0.77301645", "0.7615019", "0.759118", "0.75860786", "0.7568007", "0.75582004", "0.75261784", "0.7513453", "0.74526995", "0.7446074", "0.74409175", "0.7376623", "0.73459893", "0.7344722", "0.733578", "0.73332244", "0.73124164", "0.72810394", "0.7272165", "0.7265494", "0.7255588", "0.72546494", "0.7244258", "0.72313815", "0.7201116", "0.7194409", "0.7153331", "0.7149322", "0.7137998", "0.7103051", "0.7083781", "0.7069322", "0.70505935", "0.7042183", "0.70188504", "0.7011294", "0.6994614", "0.6977199", "0.6957587", "0.6957587", "0.6950066", "0.6948663", "0.69263136", "0.6921061", "0.69202375", "0.6914894", "0.6914894", "0.69135183", "0.69040453", "0.6897364", "0.68741155", "0.685993", "0.68499684", "0.6847678", "0.68438715", "0.6842955", "0.6828116", "0.6816732", "0.6809866", "0.67829275", "0.67788285", "0.6772081", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.6742709", "0.67376256", "0.67122895", "0.6706609", "0.6694801", "0.6694801", "0.6683886", "0.66819257", "0.6681032", "0.66747546", "0.66658646", "0.6657014", "0.6654919", "0.66543853", "0.6630387", "0.6630387", "0.6624438", "0.6624438", "0.6624438", "0.66190934", "0.66183853", "0.66128594", "0.66128594", "0.66128594", "0.66128594", "0.66128004", "0.66127765" ]
0.74519545
12
This function returns the file size of a specified $file.
function format_bytes($size, $precision = 0) { $sizes = array( 'YB', 'ZB', 'EB', 'PB', 'TB', 'GB', 'MB', 'KB', 'B' ); $total = count($sizes); while ($total-- && $size > 1024) $size /= 1024; return sprintf('%.' . $precision . 'f', $size) . $sizes[$total]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSize($file);", "public function size( $file ) {\n\t\treturn ftp_size( $this->link, $file );\n\t}", "static function size($file){\r\n\t\t$file = new File\\Instance($file);\r\n\t\treturn $file->Size();\r\n\t}", "private function find_filesize($file){\n\n if(substr(PHP_OS, 0, 3) == \"WIN\"){\n\n exec('for %I in (\"'.$file.'\") do @echo %~zI', $output);\n $return = $output[0];\n\n }else{\n\n $return = filesize($file);\n\n // SOURCE :: https://www.php.net/manual/en/function.filesize.php\n // AUTHOR :: https://www.php.net/manual/en/function.filesize.php#121437\n //$fsobj = new COM(\"Scripting.FileSystemObject\");\n //$f = $fsobj->GetFile($file);\n //$return = $f->Size;\n\n }\n\n return $return;\n\n }", "function size($file) {\r\n\t\t$file = $this->_constructPath($file);\r\n\t\t$res = @ftp_size($this->_handle, $file);\r\n\t\tif ( $res == -1 ) {\r\n\t\t\tthrow new ftpSizeException($file);\r\n\t\t} else {\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t}", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "function getFileSize($file)\n{\n return (float)shell_exec('du -sk \"' . $file . '\" | awk \\'{print$1}\\'') * 1024;\n}", "public function getFileSize() {\n\t\treturn filesize($this->filename);\n\t}", "public static function filesize($file) {\n\t\tif(self::has_file($file)) {\n\t\t\t\n\t\t\t// Get Filesize\n\t\t\t$size = filesize($file);\n\t\t\t$sizes = array(\" Bytes\", \" KB\", \" MB\", \" GB\", \" TB\", \" PB\", \" EB\", \" ZB\", \" YB\");\n\n\t\t\t// Calculate\n\t if ($size == 0) {\n\t\t\t\treturn('n/a');\n\t\t\t} else {\n\t \treturn (round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]);\n\t\t\t}\t\n\t\t} else {\n\t\t\tdie(\"Disk:: File '\".$file.\"' not found!\");\n\t\t}\n\t}", "public function get_file_size()\n\t{\n if (!$this->file_size) {\n if ($this->local_file) {\n $this->file_size = filesize($this->local_file);\n } else {\n $object = upload_aws2::$client->listObjects(array(\n 'Bucket' => $this->bucket,\n 'Prefix' => $this->location\n ));\n $this->file_size = $object['Contents'][0]['Size'];\n }\n }\n return $this->file_size;\n\t}", "function my_filesize($file) {\n\t\t$kb = 1024; // Kilobyte\n\t\t$mb = 1024 * $kb; // Megabyte\n\t\t$gb = 1024 * $mb; // Gigabyte\n\t\t$tb = 1024 * $gb; // Terabyte\n\t\t// Get the file size in bytes.\n\t\t$size = filesize($file);\n\t\t/* If it's less than a kb we just return the size, otherwise we keep going until\n\t\tthe size is in the appropriate measurement range. */\n\t\tif($size < $kb) return $size.\" B\";\n\t\telse if($size < $mb) return round($size/$kb,2).\" KB\";\n\t\telse if($size < $gb) return round($size/$mb,2).\" MB\";\n\t\telse if($size < $tb) return round($size/$gb,2).\" GB\";\n\t\telse return round($size/$tb,2).\" TB\";\n\t}", "public function getSize()\r\n {\r\n return filesize($this->filename);\r\n }", "public static function getFileSize(string $path) : int\n {\n return (new File($path))->getFileSize();\n }", "public function getFileSize(): int\n {\n $fileSize = 0;\n\n foreach ($this->getProcessedAndNewFiles() as $file) {\n $fileSize += (int) $file->getFileSize();\n }\n\n return $fileSize;\n }", "public function getSize()\n {\n return $this->file->getSize();\n }", "public function get_file_size_mb($file) {\n\t\t$fs = filesize($file);\n\t\t$fs = number_format($fs / 1048576, 2);\n\t\treturn $fs;\n\t}", "public function get_size($dir_file){\n\t\n\tif(!file_exists($dir_file) or !is_dir($dir_file)) exit('the error file or dir');\n\t\n\tif(is_file($dir_file)) return filesize($dir_file);\n\t\n\t$handle=opendir($dir_file);\n\t\n\t$size=0;\n\t\n\twhile(false!==($file=readdir($handle))){\n\t\t\n\t\t\tif($file==\".\" or $file==\"..\") continue;\n\t\t\t\n\t\t\t$file=$dir_file.\"/\".$file;\n\t\t\t\n\t\t\tif(is_dir($file)){\n\t\t\t\t\n\t\t\t\t$size+=$this->get_size($file);\n\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$size+=filesize($file);\n\t\t\t\n\t\t\t}\n\n\t}\n\t\n\tclosedir($handle);\n\t\n\treturn $size;\n\n}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public static function size($path)\n\t{\n\t\treturn filesize($path);\n\t}", "public function getSize()\n {\n return $this->file['size'];\n }", "public static function size($path)\r\n {\r\n $path = Akt_Filesystem_Path::clean($path);\r\n\r\n if (!is_file($path)) {\r\n throw new Exception(\"File '{$path}' not found\");\r\n }\r\n\r\n $filesize = @filesize($path);\r\n\r\n if ($filesize === false) {\r\n throw new Exception(\"Couldn't get file size\");\r\n }\r\n\r\n return sprintf(\"%u\", $filesize);\r\n }", "function c_filesize($filename) {\r\n\r\n $serach_name=e_file_exists($filename);\r\n return filesize($serach_name);\r\n}", "public function getFilesize()\n {\n return $this->filesize;\n }", "public function getSize()\n {\n return filesize($this->file) ?: null;\n }", "protected function get_file_size($file_path, $clear_stat_cache = false)\n {\n if ($clear_stat_cache) {\n if (version_compare(PHP_VERSION, '5.3.0') >= 0) {\n clearstatcache(true, $file_path);\n } else {\n clearstatcache();\n }\n }\n return $this->fix_integer_overflow(filesize($file_path));\n }", "public function getFile_size() {\n return $this->_file_size ? (int) $this->_file_size : null;\n }", "public function getFileSize() {\r\n\t\t$byteBlock = 1<<14;\r\n\t\t$eof = $byteBlock;\r\n\t\t\r\n\t\t// the correction is for zip files that are too small\r\n\t\t// to get in the first while loop\r\n\t\t$correction = 1;\r\n\t\twhile ($this->seek($eof) == 0) {\r\n\t\t\t$eof += $byteBlock;\r\n\t\t\t$correction = 0;\r\n\t\t}\r\n\t\t\r\n\t\twhile ($byteBlock > 1) {\r\n\t\t\t$byteBlock >>= 1;\r\n\t\t\t$eof += $byteBlock * ($this->seek($eof) ? -1 : 1);\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->seek($eof) == -1) $eof -= 1;\r\n\t\t\r\n\t\t$this->rewind();\r\n\t\treturn $eof - $correction;\r\n\t}", "function size($path)\t{\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn filesize($file);\n\t\t}\n\t}", "public function getSize() {\n\t\treturn filesize($this->getPath());\n\t}", "public static function fromFile($filename)\n {\n return filesize($filename);\n }", "public function size(string $path): int\n {\n return filesize($path);\n }", "private function fileSize($fileName)\n {\n $bytes = filesize($this->currentPath . $fileName);\n $size = ['bytes','kB','MB','GB','TB','PB','EB','ZB','YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.2f\", $bytes / pow(1024, $factor)) . \" \" . @$size[$factor];\n }", "public function size() {\n\t\treturn filesize($this->_path);\n\t}", "function get_file_size($filename) {\n\t$domain = $_SERVER['HTTP_HOST'];\n\t$script = $_SERVER['SCRIPT_NAME'];\n\t$currentfile = basename($script);\n\t$fullurl = \"http://$domain\".str_replace($currentfile, '', $script).$filename;\n\t\n\t// Context for file_get_contents HEAD request\n\t$context = stream_context_create(array('http'=>array('method'=>'HEAD')));\n\t\n\t// file_get_contents HEAD request\n\t$request = file_get_contents($fullurl, false, $context);\n\t\n\t// Go through each response header and search for Content-Length\n\tforeach($http_response_header as $hrh) {\n\t\tif(strpos($hrh, 'Content-Length') !== false) {\n\t\t\t$size = str_replace('Content-Length:', '', $hrh);\n\t\t\t$size = trim($size);\n\t\t}\n\t}\n\treturn $size;\n}", "public function getSize()\n\t{\n\t\treturn filesize($this->tmp_name);\n\t}", "function my_filesize($file) {\r\n if(!is_file(\"./\".$file)) return(\"\");\r\n // Setup some common file size measurements.\r\n $kb = 1024; // Kilobyte\r\n $mb = 1024 * $kb; // Megabyte\r\n $gb = 1024 * $mb; // Gigabyte\r\n $tb = 1024 * $gb; // Terabyte\r\n // Get the file size in bytes.\r\n $size = filesize($file);\r\n /* If it's less than a kb we just return the size, otherwise we keep\r\ngoing until\r\n the size is in the appropriate measurement range. */\r\n if($size < $kb) {\r\n return $size.\" Octets\";\r\n }\r\n else if($size < $mb) {\r\n return number_format($size/$kb,2,\",\",\"\").\" Ko\";\r\n }\r\n else if($size < $gb) {\r\n return number_format($size/$mb,2,\",\",\"\").\" Mo\";\r\n }\r\n else if($size < $tb) {\r\n return number_format($size/$gb,2,\",\",\"\").\" Go\";\r\n }\r\n else {\r\n return number_format($size/$tb,2,\",\",\"\").\" To\";\r\n }\r\n}", "public function getFileLengthAction($file)\n {\n \trequire_once('GetId3/getid3/getid3.php');\n\n \t// Initialize getID3 engine\n \t$getID3 = new getID3;\n\n \t// Analyze file and store returned data in $ThisFileInfo\n \t$ThisFileInfo = $getID3->analyze($file);\n\n if (isset($ThisFileInfo['playtime_seconds']))\n {\n return $ThisFileInfo['playtime_seconds'];\n }\n\n return null;\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function fileSize($path)\n {\n return $this->disk->size($path);\n }", "public function fileSize(string $path): int\n {\n return filesize($this->_sftpGetPath($path));\n }", "function fileSize($filePath) { \n\t\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t\t$size = Storage::size($filePath);\n\t \tfor ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; \n\n\t \treturn round($size, 2).$units[$i]; \n\t}", "public function filesize()\n {\n $size =\n round(\n (filesize('/var/www/html/web'.$this->getSrc()) / 1000),\n 2\n );\n\n // Clear cache\n clearstatcache();\n // Return result\n return $size . ' Kb';\n }", "public static function p7zOriginalSize($file)\n {\n return (int)trim(shell_exec(\"7z l $file | tail -n1 | awk '{print $3}'\"));\n }", "private function getFileCount()\n {\n $this->seek($this->offset + 4);\n\n return $this->readLong();\n }", "public function getSize()\n {\n return $this->fileStructure->size;\n }", "public function size($file)\n {\n if (null !== $this->filenameFilter) {\n $file = $this->filenameFilter->filter($file);\n }\n\n try {\n $response = $this->amazonS3->get_object_headers($this->getBucket(), $file);\n } catch (\\S3_Exception $e) {\n throw new \\RuntimeException('Exception thrown by \\AmazonS3: ' . $e->getMessage(), null, $e);\n }\n\n if (!$response->isOk()) {\n return false;\n }\n\n $header = array_change_key_case($response->header, CASE_LOWER);\n\n if (!isset($header['content-length'])) {\n return false;\n }\n\n return (integer) $header['content-length'];\n }", "public function size($file) {\n if ($this->getActive()) {\n // get the size of $file\n $buff = ftp_size($this->_connection, $file);\n if ($buff != -1) {\n return $buff;\n } else {\n return false;\n }\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "public function filesize()\n\t{\n\t\treturn (int)$this->_parent->{$this->_name.'_file_size'};\n\t}", "public function getFileSize($url)\n\t{\n\t\treturn -1;\n\t}", "public function getFileSize()\n {\n return $this->fileSize;\n }", "public function getFileSize()\n {\n return $this->fileSize;\n }", "function ppom_get_filesize_in_kb( $file_name ) {\n\t\t\n\t$base_dir = ppom_get_dir_path();\n\t$file_path = $base_dir . 'confirmed/' . $file_name;\n\t\n\tif (file_exists($file_path)) {\n\t\t$size = filesize ( $file_path );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}elseif(file_exists( $base_dir . '/' . $file_name ) ){\n\t\t$size = filesize ( $base_dir . '/' . $file_name );\n\t\treturn round ( $size / 1024, 2 ) . ' KB';\n\t}\n\t\n}", "public function fileSize($file, $convert = true)\n\t{\n\t\tif (is_file($file))\n\t\t{\n\t\t\t$fileSize = filesize($file);\n\n\t\t\tif ($convert)\n\t\t\t\treturn $this->convertFileSize($fileSize);\n\t\t\telse\n\t\t\t\treturn $fileSize;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($convert)\n\t\t\t\treturn '0.00 KB';\n\t\t\telse\n\t\t\t\treturn 0;\n\t\t}\n\t}", "public function getSize(): int\n {\n return $this->filesystem->getSize(\n $this->resource->getPath()\n );\n }", "public function getSize()\n {\n $size = null;\n\n if ($this->stream) {\n $stats = fstat($this->stream);\n $size = $stats['size'];\n }\n\n return $size;\n }", "public function getSize()\n {\n return $this->fileInfo['size'];\n }", "public function getLength()\n {\n return filesize($this->fullPath);\n }", "protected function getResourceLength(): int\n {\n if (null === $this->fileName) {\n return parent::getResourceLength();\n }\n\n if (substr($this->fileName, 0, 16) === 'compress.zlib://') {\n return filesize(substr($this->fileName, 16));\n } elseif (substr($this->fileName, 0, 17) === 'compress.bzip2://') {\n return filesize(substr($this->fileName, 17));\n }\n\n return parent::getResourceLength();\n }", "public function getSize($path);", "public function getSize() : int\n {\n if (null === $this->size) {\n if (!file_exists($this)) {\n throw new Exception(sprintf('target file \\'%s\\' doesn\\'t exist', $this->getFilename()));\n }\n $this->size = filesize($this);\n }\n return $this->size;\n }", "protected function filesize($filename)\n {\n $filesize = \\filesize($filename);\n\n if (false === $filesize) {\n throw new RuntimeException(\\sprintf('Could not read file \\'%s\\' size.', $filename));\n }\n\n return $filesize;\n }", "public static function size($_path)\r\n {\r\n return filesize($_path);\r\n }", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "public function getSize(){\n $path = $this->aParams['path'] . $this->aParams['name'];\n if(\n is_null($this->aParams['size']) &&\n mb_strlen($this->aParams['path']) &&\n mb_strlen($this->aParams['name']) &&\n file_exists($path)\n\n ){\n $this->aParams['size'] = filesize($path);\n }\n return\n $this->aParams['size'] !== FALSE && $this->aParams['size'] !== null\n ? sprintf('%u', $this->aParams['size'])\n : NULL;\n }", "public function getSize()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filesize($this->_path);\n\t}", "public static function niceFilesize($file){\n\t\t$size = filesize($file);\n\t\t$ext = 'Bytes';\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'KB';\n\t\t}\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'MB';\n\t\t}\n\t\tif($size > 1024){\n\t\t\t$size = $size/1024;\n\t\t\t$ext = 'GB';\n\t\t}\n\t\treturn number_format($size, 2, '.', ' ').' '.$ext;\n\t}", "public function getSize() {\n return $_FILES['uploadfile']['size'];\n }", "public function att_get_filesize($input)\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n return $_FILES[$input]['size'];\n }\n else\n {\n return (int) $_SERVER['CONTENT_LENGTH'];\n }\n }", "function filesize($filedata) {\r\n\t\treturn file_exists($filedata['tmp_name']) ? filesize($filedata['tmp_name']) : false;\r\n\t}", "public static function getFileSize($filepath){\n\t if(!file_exists($filepath) || filesize($filepath) == 0) {\n return '0 Mo';\n }\n $bytes = filesize($filepath);\n $s = array('o', 'Ko', 'Mo', 'Go');\n $e = floor(log($bytes)/log(1024));\n return sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));\n }", "public function getSize()\n {\n return $this->fstat()[\"size\"];\n }", "public function getFileSize() {\n return $this->size;\n }", "public function getSize() {\n\t\t$stat = fstat($this->handle);\n\t\treturn isset($stat['size']) ? $stat['size'] : false;\n\t}", "public function filesize($reset = false) {\n\t\tif($reset) {} // @todo\n\t\t$filesize = (int) @filesize($this->filename());\n\t\treturn $filesize;\n\t}", "function count_bytes_all_files() {\n $result = $this->pdo->query('SELECT SUM(size) FROM files');\n return $this->convert_file_size($result->fetchColumn());\n }", "public function size($key) {\n\t\t$result = 0;\n\t\t$proxyStatus = \\OC_FileProxy::$enabled;\n\t\t\\OC_FileProxy::$enabled = false;\n\t\tif ($this->hasKey($key)) {\n\t\t\t$storage = $this->getStorage();\n\t\t\t$result = $storage->filesize($key);\n\t\t}\n\t\t\\OC_FileProxy::$enabled = $proxyStatus;\n\t\treturn $result;\n\t}", "function tdc_get_filesize($filenode){\n $file_path = tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n $full_path = TDC_DOC_ROOT . $file_path . \"/\" .$file_name;\n $size = filesize($full_path);\n return human_filesize($size);\n}", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "public function getFileCount(){\n\t\treturn $this->intFileCount;\n\t}", "public static function getSize($path) {\n \n }", "public function getAssetFileSize(){\n \n // Remote file\n if ($this->isAssetFilePathUrl()) {\n if (\n // Retrieve headers\n ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))\n // Assert return is OK\n && strstr($aHeaders[0], '200') !== false\n // Retrieve content length\n && !empty($aHeaders['Content-Length']) && $iAssetFileSize = $aHeaders['Content-Length']\n ) {\n return $iAssetFileSize;\n }\n $oCurlHandle = curl_init($sAssetFilePath);\n curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);\n curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true); \n if (curl_exec($oCurlHandle) === false) {\n return null;\n }\n return curl_getinfo($oCurlHandle, CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? : null;\n }\n \n // Local file\n \\Zend\\Stdlib\\ErrorHandler::start();\n $iAssetFileSize = filesize($this->getAssetFilePath());\n \\Zend\\Stdlib\\ErrorHandler::stop(true);\n return $iAssetFileSize ? : null;\n \n }", "public function getFilesize($url)\n\t{\n\t\t$result = -1;\n\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, true);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n\t\tif (defined('AKEEBA_CACERT_PEM'))\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO, AKEEBA_CACERT_PEM);\n\t\t}\n\n\t\t$data = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\tif ($data)\n\t\t{\n\t\t\t$content_length = \"unknown\";\n\t\t\t$status = \"unknown\";\n\n\t\t\tif (preg_match(\"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches))\n\t\t\t{\n\t\t\t\t$status = (int) $matches[1];\n\t\t\t}\n\n\t\t\tif (preg_match(\"/Content-Length: (\\d+)/\", $data, $matches))\n\t\t\t{\n\t\t\t\t$content_length = (int) $matches[1];\n\t\t\t}\n\n\t\t\tif ($status == 200 || ($status > 300 && $status <= 308))\n\t\t\t{\n\t\t\t\t$result = $content_length;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function getSizeOfRemoteFile($url)\r\n\t{\r\n\t\t$headers = @get_headers($url, 1);\r\n\t\tif ($headers !== false && is_array($headers) && isset($headers['Content-Length'])) {\r\n\t\t\treturn $headers['Content-Length'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function gttn_tpps_file_len($fid) {\n $file = file_load($fid);\n $location = drupal_realpath($file->uri);\n $extension = gttn_tpps_get_path_extension($location);\n $count = 0;\n $options = array(\n 'count' => &$count,\n );\n if ($extension == 'vcf') {\n $options['skip_prefix'] = '#';\n }\n gttn_tpps_file_iterator($fid, 'gttn_tpps_file_len_helper', $options);\n return $count;\n}", "protected function _getFileSize($sFilename) {\n $iBytes = filesize($sFilename);\n return $this->_formatHumanFileSize($iBytes);\n }", "public function image_size()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n $image_size = getimagesize($this->local_file);\n $this->mime = $image_size['mime'];\n return $image_size;\n\t}", "public function getSize($path)\n {\n }", "function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}", "function pretty_filesize($dir,$file)\n{\n\t$size = filesize($dir.$file);\n\n\tif($size<1024)\n\t{\n\t\t$size = $size.\" Bytes\";\n\t}\n\telse if(($size<1048576)&&($size>1023))\n\t{\n\t\t$size=round($size/1024, 1).\" KB\";\n\t}\n\telse if(($size<1073741824)&&($size>1048575))\n\t{\n\t\t$size=round($size/1048576, 1).\" MB\";\n\t}\n\telse\n\t{\n\t\t$size=round($size/1073741824, 1).\" GB\";\n\t}\n\n\treturn $size;\n}", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "private function Size($path)\r\n {\r\n $bytes = sprintf('%u', filesize($path));\r\n\r\n if ($bytes > 0)\r\n {\r\n $unit = intval(log($bytes, 1024));\r\n $units = array('B', 'KB', 'MB', 'GB');\r\n\r\n if (array_key_exists($unit, $units) === true)\r\n {\r\n return sprintf('%d %s', $bytes / pow(1024, $unit), $units[$unit]);\r\n }\r\n }\r\n\r\n return $bytes;\r\n }", "function fm_get_size($path, $rawbytes = 0) {\r\n\tif (!is_dir($path)) {\r\n\t\treturn fm_readable_filesize(@filesize($path));\r\n\t}\r\n\t$dir = opendir($path);\r\n\t$size = 0;\r\n\twhile ($file = readdir($dir)) {\r\n\t\tif (is_dir($path.\"/\".$file) && $file != \".\" && $file != \"..\") {\r\n\t\t\t$size += fm_get_size($path.\"/\".$file, 1);\r\n\t\t} else {\r\n\t\t\t$size += @filesize($path.\"/\".$file);\r\n\t\t}\r\n\t}\r\n\tif ($rawbytes == 1) {\r\n\t\treturn $size;\r\n\t}\r\n\tif ($size == 0) {\r\n\t\treturn \"0 Bytes\";\r\n\t} else {\r\n\t\treturn fm_readable_filesize($size);\r\n\t}\r\n}", "function template_fsize($params,&$smarty)\n {\n extract($params);\n return fsize($id);\n }", "function wp_filesize($path)\n {\n }", "function check_size($file)\n {\n $ret = false;\n if (!$this->_file_init($file)) return true;\n if ($this->_init_header())\n {\n\t$buf = fread($this->fd, 24);\n\t$tmp = unpack('H32id/Vlen/H8unused', $buf);\n\tif ($tmp['id'] == '3626b2758e66cf11a6d900aa0062ce6c')\n\t {\n\t $stat = fstat($this->fd);\n\t $ret = ($stat['size'] == ($this->head['len'] + $tmp['len']));\n\t }\n }\n $this->_file_deinit();\n return $ret;\n }", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function getFileSize()\n {\n if (array_key_exists(\"fileSize\", $this->_propDict)) {\n return $this->_propDict[\"fileSize\"];\n } else {\n return null;\n }\n }" ]
[ "0.8640546", "0.829745", "0.82683253", "0.81077874", "0.77867633", "0.7741171", "0.77403975", "0.7739844", "0.7739844", "0.7739844", "0.76412", "0.7636729", "0.7455675", "0.7391385", "0.7368362", "0.7366099", "0.7252452", "0.7227844", "0.72021365", "0.7200149", "0.7191493", "0.7142715", "0.7142715", "0.71361387", "0.71336555", "0.711792", "0.711286", "0.7101386", "0.7071984", "0.70605695", "0.7055367", "0.69868267", "0.6985221", "0.6963349", "0.6945924", "0.69147015", "0.69131696", "0.6910212", "0.690959", "0.6898005", "0.6882551", "0.68748873", "0.68748873", "0.68664557", "0.6866378", "0.68506265", "0.68498576", "0.68265355", "0.681817", "0.68130255", "0.67939085", "0.67577296", "0.6735454", "0.67226833", "0.67226833", "0.6722275", "0.67122597", "0.6701733", "0.66960543", "0.6695747", "0.6683971", "0.66721106", "0.6663292", "0.66628546", "0.66614413", "0.6658084", "0.66485345", "0.66431224", "0.6635136", "0.6617373", "0.659316", "0.6577952", "0.6542667", "0.6525369", "0.6498526", "0.6451611", "0.6446503", "0.6426788", "0.6423007", "0.6422962", "0.64157", "0.6372395", "0.63393915", "0.6329844", "0.6324354", "0.6309789", "0.62910223", "0.62888956", "0.6274482", "0.62655777", "0.626077", "0.62507534", "0.62451917", "0.624309", "0.62405354", "0.62352437", "0.6232275", "0.6229493", "0.62282676", "0.61998606", "0.6198961" ]
0.0
-1
This function returns the mime type of $file.
function get_file_type($file) { global $image_types, $movie_types; $pos = strrpos($file, "."); if ($pos === false) { return "Unknown File"; } $ext = rtrim(substr($file, $pos + 1), "~"); if (in_array($ext, $image_types)) { $type = "Image File"; } elseif (in_array($ext, $movie_types)) { $type = "Video File"; } elseif (in_array($ext, $archive_types)) { $type = "Compressed Archive"; } elseif (in_array($ext, $document_types)) { $type = "Type Document"; } elseif (in_array($ext, $font_types)) { $type = "Type Font"; } else { $type = "File"; } return (strtoupper($ext) . " " . $type); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getFileMimeType($file)\n {\n return mime_content_type($file);\n }", "private static function getMIMEType(&$file) {\n\t\t$type = Util_Mime::get_mime_type($file);\n\t\treturn $type;\n\t}", "public static function getMimeType( $file ) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mimetype;\n }", "function getMimeType($file) {\n\t\tif (!function_exists('mime_content_type')) {\n\t\t\t$f = escapeshellarg($file);\n\t\t\tif ($mimeType = trim( `file -b --mime $f` )) {\n\t\t\t\t// The --mime parameter will return more information than necessary\n\t\t\t\t// i.e. \"text/plain; charset=us-ascii\" vs. \"text/plain\"\n\t\t\t\t$mimeParts = explode('; ', $mimeType);\n\t\t\t\treturn $mimeParts[0];\n\t\t\t}\n\t\t}\n\t\treturn mime_content_type($file);\n\t}", "function getFileMimetype($file_path)\n {\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }", "public static function getMimeType($file) {\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n if (isset(self::$extToMime[$ext])) {\n return self::$extToMime[$ext];\n } else {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($file);\n }\n }", "public function type() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$type = null;\n\n\t\t\t// We can't use the file command on windows\n\t\t\tif (!defined('PHP_WINDOWS_VERSION_MAJOR')) {\n\t\t\t\t$type = shell_exec(sprintf(\"file -b --mime %s\", escapeshellarg($file->path())));\n\n\t\t\t\tif ($type && strpos($type, ';') !== false) {\n\t\t\t\t\t$type = strstr($type, ';', true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback because of fileinfo bug: https://bugs.php.net/bug.php?id=53035\n\t\t\tif (!$type) {\n\t\t\t\t$info = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t$type = finfo_file($info, $file->path());\n\t\t\t\tfinfo_close($info);\n\t\t\t}\n\n\t\t\t// Check the mimetype against the extension or $_FILES type\n\t\t\t// If they are different, use the upload type since fileinfo returns invalid mimetypes\n\t\t\t// This could be problematic in the future, but unknown better alternative\n\t\t\t$extType = $file->data('type') ?: MimeType::getTypeFromExt($file->ext());\n\n\t\t\tif ($type !== $extType) {\n\t\t\t\t$type = $extType;\n\t\t\t}\n\n\t\t\treturn $type;\n\t\t});\n\t}", "public function mime() : string {\n return $this->file->type;\n }", "public function getMimeType()\n {\n return $this->file['type'];\n }", "private function getType(UploadedFile $file)\n {\n $mime = $file->getMimeType();\n\n return $mime ? explode('/', $mime)[0] : 'n/a';\n }", "private static function __getMIMEType(&$file)\n\t{\n\t\tstatic $exts = array(\n\t\t\t'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif',\n\t\t\t'png' => 'image/png', 'ico' => 'image/x-icon', 'pdf' => 'application/pdf',\n\t\t\t'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'svg' => 'image/svg+xml',\n\t\t\t'svgz' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', \n\t\t\t'zip' => 'application/zip', 'gz' => 'application/x-gzip',\n\t\t\t'tar' => 'application/x-tar', 'bz' => 'application/x-bzip',\n\t\t\t'bz2' => 'application/x-bzip2', 'rar' => 'application/x-rar-compressed',\n\t\t\t'exe' => 'application/x-msdownload', 'msi' => 'application/x-msdownload',\n\t\t\t'cab' => 'application/vnd.ms-cab-compressed', 'txt' => 'text/plain',\n\t\t\t'asc' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html',\n\t\t\t'css' => 'text/css', 'js' => 'text/javascript',\n\t\t\t'xml' => 'text/xml', 'xsl' => 'application/xsl+xml',\n\t\t\t'ogg' => 'application/ogg', 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav',\n\t\t\t'avi' => 'video/x-msvideo', 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg',\n\t\t\t'mov' => 'video/quicktime', 'flv' => 'video/x-flv', 'php' => 'text/x-php'\n\t\t);\n\n\t\t$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\t\tif (isset($exts[$ext])) return $exts[$ext];\n\n\t\t// Use fileinfo if available\n\t\tif (extension_loaded('fileinfo') && isset($_ENV['MAGIC']) &&\n\t\t($finfo = finfo_open(FILEINFO_MIME, $_ENV['MAGIC'])) !== false)\n\t\t{\n\t\t\tif (($type = finfo_file($finfo, $file)) !== false)\n\t\t\t{\n\t\t\t\t// Remove the charset and grab the last content-type\n\t\t\t\t$type = explode(' ', str_replace('; charset=', ';charset=', $type));\n\t\t\t\t$type = array_pop($type);\n\t\t\t\t$type = explode(';', $type);\n\t\t\t\t$type = trim(array_shift($type));\n\t\t\t}\n\t\t\tfinfo_close($finfo);\n\t\t\tif ($type !== false && strlen($type) > 0) return $type;\n\t\t}\n\n\t\treturn 'application/octet-stream';\n\t}", "public function getMimeType()\n {\n if (!class_exists('finfo', false)) return $this->type;\n $info = new \\finfo(FILEINFO_MIME);\n return $info->file($this->tmp);\n }", "public function getMimeType()\n\t{\n\t\treturn mime_content_type($this->tmp_name);\n\t}", "public static function getMimeType($file) {\n\t\t$extension = strtolower(substr(strrchr($file, '.'), 1));\n\t\t\n\t\t$mimes = load_config('mimes', array());\n\t\t\n\t\tif (array_key_exists($extension, $mimes)) {\n\t\t\tif (is_array($mimes[$extension])) {\n\t\t\t\t// Multiple mime types, just give the first one\n\t\t\t\treturn current($mimes[$extension]);\n\t\t\t} else {\n\t\t\t\treturn $mimes[$extension];\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function guessMimeType($file)\n {\n $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\n return array_key_exists($extension, self::$types)?self::$types[$extension]:self::DEFAULT_MIME_TYPE;\n }", "protected function getType($file)\n {\n if (ends_with($file, '.css')) {\n return 'text/css';\n }\n\n if (ends_with($file, '.js')) {\n return 'application/javascript';\n }\n\n if (ends_with($file, '.png')) {\n return 'image/png';\n }\n\n if (ends_with($file, '.jpg') || ends_with($file, '.jpeg')) {\n return 'image/jpeg';\n }\n\n return 'text/plain';\n }", "public function GetMimeType() {\n\n if ($this->IsValid() && $this->MimeType === null) {\n if (function_exists('mime_content_type')) {\n $this->MimeType= mime_content_type($this->TmpName);\n } elseif (function_exists('finfo_open')) {\n $fInfo= finfo_open(FILEINFO_MIME);\n $this->MimeType= finfo_file($fInfo, $this->TmpName);\n finfo_close($fInfo);\n }\n }\n return $this->MimeType;\n }", "public static function get_mime_type($filename)\n {\n // If the finfo module is compiled into PHP, use it.\n $path = BASE_PATH . DIRECTORY_SEPARATOR . $filename;\n if (class_exists('finfo') && file_exists($path)) {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($path);\n }\n\n // Fallback to use the list from the HTTP.yml configuration and rely on the file extension\n // to get the file mime-type\n $ext = strtolower(File::get_file_extension($filename));\n // Get the mime-types\n $mimeTypes = HTTP::config()->uninherited('MimeTypes');\n\n // The mime type doesn't exist\n if (!isset($mimeTypes[$ext])) {\n return 'application/unknown';\n }\n\n return $mimeTypes[$ext];\n }", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "public function getType()\n {\n return MimeType::detectByFilename($this->fullPath);\n }", "public function detectFromFile( $file )\n {\n $mimeType = static::getMimeTypeFromCustomList( $file );\n if ( ! $mimeType ) {\n $mimeType = ( new \\finfo( FILEINFO_MIME_TYPE ) )->file( $file );\n\n }\n return $mimeType;\n }", "public function fileMimeType($path)\n {\n $type = $this->findType(strtolower(pathinfo($path, PATHINFO_EXTENSION)));\n if (!empty($type)) {\n return $type;\n }\n\n return 'unknown/type';\n }", "public function getMimeType()\n {\n return CFileHelper::getMimeType($this->file->getTempName());\n }", "public function getMimetype();", "public static function fileMimeType($filename)\r\n {\r\n $extension = FileUtility::getFileExtension($filename);\r\n\r\n foreach (file('lib/mime.types') as $line)\r\n {\r\n $line = str_replace(' ', \"\\t\", $line);\r\n if (strpos($line, \"\\t\" . $extension) !== false)\r\n {\r\n $array = explode(\"\\t\", $line);\r\n return $array[0];\r\n }\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "function mimeType($path) {\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn Mime_Type::guessType($file);\n\t\t}\n\t}", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function getMediaType($fileMimeType);", "protected static function detectMimeType($file) {\n\t\t$mimetype = ElggFile::detectMimeType($file['tmp_name'], $file['type']);\n\n\t\t// Hack for Microsoft zipped formats\n\t\t$info = pathinfo($file['name']);\n\t\t$office_formats = array('docx', 'xlsx', 'pptx');\n\t\tif ($mimetype == \"application/zip\" && in_array($info['extension'], $office_formats)) {\n\t\t\tswitch ($info['extension']) {\n\t\t\t\tcase 'docx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'xlsx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pptx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.presentationml.presentation\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Check for bad ppt detection\n\t\tif ($mimetype == \"application/vnd.ms-office\" && $info['extension'] == \"ppt\") {\n\t\t\t$mimetype = \"application/vnd.ms-powerpoint\";\n\t\t}\n\n\t\treturn $mimetype;\n\t}", "public function fileTypeToMimeType($file_name)\n {\n // Get the file type, example 'file.htm' = 'htm'\n if (strpos($file_name, '.') === false) {\n $file_type = $file_name;\n } else {\n $file_type = strtolower(pathinfo($file_name, PATHINFO_EXTENSION));\n }\n\n // Return mime-type based on file extension\n switch ($file_type) {\n // Text Files\n case 'htm':\n case 'html':\n return 'text/html';\n case 'txt':\n return 'text/plain';\n case 'md':\n case 'markdown':\n return 'text/markdown';\n case 'csv':\n case 'css':\n case 'jsx':\n return 'text/' . $file_type;\n // Images\n case 'png':\n case 'gif':\n case 'webp':\n return 'image/' . $file_type;\n case 'jpg':\n case 'jpeg':\n return 'image/jpg';\n case 'svg':\n return 'image/svg+xml';\n case 'ico':\n return 'image/x-icon';\n // Web\n case 'js':\n return 'application/javascript';\n case 'woff':\n return 'application/font-woff';\n case 'json':\n case 'xml':\n case 'pdf':\n case 'graphql':\n return 'application/' . $file_type;\n // Video\n case 'mp4':\n case 'webm':\n return 'video/' . $file_type;\n case 'ogv':\n return 'video/ogg';\n case 'flv':\n return 'video/x-flv';\n // Audio\n case 'mp3':\n case 'weba':\n case 'ogg':\n return 'audio/' . $file_type;\n case 'm4a':\n case 'aac':\n return 'audio/aac';\n // All others\n default:\n return 'application/octet-stream';\n }\n }", "private function get_mime( $file_type ) {\n\t\t$path = FUSION_LIBRARY_URL . '/assets/fonts/icomoon/icomoon.' . $file_type;\n\t\tif ( file_exists( $path ) && function_exists( 'mime_content_type' ) ) {\n\t\t\treturn mime_content_type( $path );\n\t\t}\n\t\treturn 'font/' . $file_type;\n\n\t}", "public static function fromFile($file) {\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\InvalidArgumentException(\"File '\" . $file . \"' not found.\");\n\t\t}\n\n\t\t$info = @getimagesize($file); // @ - files smaller than 12 bytes causes read error\n\t\tif (isset($info['mime'])) {\n\t\t\treturn $info['mime'];\n\n\t\t} elseif (extension_loaded('fileinfo')) {\n\t\t\t$type = preg_replace('#[\\s;].*\\z#', '', finfo_file(finfo_open(FILEINFO_MIME), $file));\n\n\t\t} elseif (function_exists('mime_content_type')) {\n\t\t\t$type = mime_content_type($file);\n\t\t}\n\n\t\treturn isset($type) && preg_match('#^\\S+/\\S+\\z#', $type)\n\t\t\t? $type : 'application/octet-stream';\n\t}", "public static function getContentType($file_name)\n {\n $file_extension = strtolower(substr(strrchr($file_name, '.'), 1));\n switch($file_extension) {\n case \"gif\": return \"image/gif\";\n case \"png\": return \"image/png\";\n case \"jpeg\":\n case \"jpg\": return \"image/jpg\";\n case \"css\": return \"text/css\";\n case \"js\": return \"application/javascript\";\n case \"pdf\": return \"application/pdf\";\n default:\n }\n return false;\n }", "private function _getUploadedFileMimeType($file_data) {\n if(function_exists('mime_content_type')) {\n $mime_type = mime_content_type($file_data['tmp_name']);\n return $mime_type;\n }\n\n if(function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mime_type = finfo_file($finfo, $file_data['tmp_name']);\n finfo_close($finfo);\n return $mime_type;\n }\n\n return null;\n }", "private function get_mime_type($filepath) {\n if (!file_exists($filepath) || !is_readable($filepath))\n return false;\n\n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filepath);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';'))\n list($mimeType, ) = explode(';', $mimeType);\n return $mimeType;\n }\n\n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filepath);\n }\n\n // Trying exec\n if (function_exists('system')) {\n $mimeType = system(\"file -i -b $filepath\");\n if (!empty($mimeType))\n return $mimeType;\n }\n\n // Trying to get mimetype from images\n $imageData = @getimagesize($filepath);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n\n return false;\n }", "public function fileMimeType($path)\n {\n return $this->mime_type->getMimeType(File::extension($this->uploadPath($path)));\n }", "public static function mimeType($_path)\r\n {\r\n return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $_path);\r\n }", "public function getMediaTypeForFile($file) {\n return $this->getMediaType($this->mimeSniffer->getMediaTypeForFile($file));\n }", "protected function readMimeType()\n {\n $ext = pathinfo($this->filename, PATHINFO_EXTENSION);\n $this->mimeType = PMF_Attachment_MimeType::guessByExt($ext);\n\n return $this->mimeType;\n }", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "public function getMimeType(){\n return (new \\finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);\n }", "private function getMimeType($file)\n {\n $info = pathinfo($file);\n $ext = strtolower($info['extension']);\n $filename = $info['filename'];\n\n return [\n 'type' => UploadProjectFiles::MIME_TYPES[$ext],\n 'ext' => $ext,\n 'filename' => $filename,\n ];\n }", "public function getMimeType()\n {\n return Formats::getFormatMimeType($this->format);\n }", "private function _getMime($fileName)\n {\n /* Using the unix comand 'file' to get mime type. PHP has a built in\n * function for this, mime_content_type(), but it is\n * depreciated. Instead you are supposed to use a PECL extension\n * 'Fileinfo'. However, that is a bit inconvinient ... */\n $safeFileName = escapeshellarg($fileName);\n return trim(exec(\"file -i -b $safeFileName\"));\n }", "public function mime()\n {\n if (!$this->exists()) {\n return false;\n }\n if (class_exists('finfo')) {\n $finfo = new finfo(FILEINFO_MIME);\n $type = $finfo->file($this->pwd());\n if (!$type) {\n return false;\n }\n list($type) = explode(';', $type);\n\n return $type;\n }\n if (function_exists('mime_content_type')) {\n return mime_content_type($this->pwd());\n }\n\n return false;\n }", "function getMimeType($filename)\n{\n\t$mimeType = '';\n\n\t// Check only existing readable files\n\tif (!file_exists($filename) || !is_readable($filename))\n\t{\n\t\treturn '';\n\t}\n\n\t// Try finfo, this is the preferred way\n\tif (function_exists('finfo_open'))\n\t{\n\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t$mimeType = finfo_file($finfo, $filename);\n\t\tfinfo_close($finfo);\n\t}\n\t// No finfo? What? lets try the old mime_content_type\n\telseif (function_exists('mime_content_type'))\n\t{\n\t\t$mimeType = mime_content_type($filename);\n\t}\n\t// Try using an exec call\n\telseif (function_exists('exec'))\n\t{\n\t\t$mimeType = @exec(\"/usr/bin/file -i -b $filename\");\n\t}\n\n\t// Still nothing? We should at least be able to get images correct\n\tif (empty($mimeType))\n\t{\n\t\t$imageData = elk_getimagesize($filename, 'none');\n\t\tif (!empty($imageData['mime']))\n\t\t{\n\t\t\t$mimeType = $imageData['mime'];\n\t\t}\n\t}\n\n\t// Account for long responses like text/plain; charset=us-ascii\n\tif (!empty($mimeType) && strpos($mimeType, ';'))\n\t{\n\t\tlist($mimeType,) = explode(';', $mimeType);\n\t}\n\n\treturn $mimeType;\n}", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "public function getMimeType()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return $this->mime;\r\n }", "public function getMimeType()\r\n {\r\n if (array_key_exists($this->getExtension(), $this->fileTypes)) {\r\n return $this->fileTypes[$this->getExtension()]['type'];\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "public function getMimeType()\n {\n return $this->mime_type;\n }", "public function getMimeType()\n {\n return $this->mime_type;\n }", "public function getMimeType()\n {\n return $this->mime_type;\n }", "static function guessMimeType($file_name) {\r\n $ext = pathinfo($file_name, PATHINFO_EXTENSION);\r\n $map = require(dirname(__FILE__) . \"/mime.types.php\");\r\n\r\n return isset($map[$ext]) ? $map[$ext] : 'application/octet-stream';\r\n }", "static function get_mime_type($file) {\n $mime_types = array(\n \"pdf\" => \"application/pdf\"\n , \"exe\" => \"application/octet-stream\"\n , \"zip\" => \"application/zip\"\n // ,\"docx\"=>\"application/msword\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"doc\" => \"application/msword\"\n , \"rtf\" => \"text/rtf\"\n , \"txt\" => \"text/plain\"\n , \"xls\" => \"application/vnd.ms-excel\"\n , \"ppt\" => \"application/vnd.ms-powerpoint\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"gif\" => \"image/gif\"\n , \"png\" => \"image/png\"\n , \"jpeg\" => \"image/jpg\"\n , \"jpg\" => \"image/jpg\"\n , \"mp3\" => \"audio/mpeg\"\n , \"wav\" => \"audio/x-wav\"\n , \"mpeg\" => \"video/mpeg\"\n , \"mpg\" => \"video/mpeg\"\n , \"mpe\" => \"video/mpeg\"\n , \"mov\" => \"video/quicktime\"\n , \"avi\" => \"video/x-msvideo\"\n , \"3gp\" => \"video/3gpp\"\n , \"css\" => \"text/css\"\n , \"jsc\" => \"application/javascript\"\n , \"js\" => \"application/javascript\"\n , \"php\" => \"text/html\"\n , \"htm\" => \"text/html\"\n , \"html\" => \"text/html\"\n , \"xlsx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n , \"xltx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\"\n , \"potx\" => \"application/vnd.openxmlformats-officedocument.presentationml.template\"\n , \"ppsx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"sldx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slide\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"dotx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.template\"\n , \"xlam\" => \"application/vnd.ms-excel.addin.macroEnabled.12\"\n , \"xlsb\" => \"application/vnd.ms-excel.sheet.binary.macroEnabled.12\"\n );\n $extention = explode('.', $file);\n $extension = end($extention);\n $extension = strtolower($extension);\n return $mime_types[$extension];\n }", "private function get_mime_type(string $file_path) {\n //MIME Types\n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-unic',\n 'flv' => 'video/x-flv',\n\n //Images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n //Archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n //Audio/Video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n //Adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n //MS Office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'docx' => 'application/msword',\n 'xlsx' => 'application/vnd.ms-excel',\n 'pptx' => 'application/vnd.ms-powerpoint',\n\n //Open Office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\n $ext_array = explode('.', $file_path);\n $extension = strtolower(end($ext_array));\n if(isset($mime_types[$extension])) {\n return $mime_types[$extension];\n } else {\n return mime_content_type($file_path);\n }\n }", "function mimetype($filedata) {\r\n\t\t$filepath = $filedata['tmp_name'];\r\n\t\t// Check only existing files\r\n\t\tif (!file_exists($filepath) || !is_readable($filepath)) return false;\r\n\r\n\t\t// Trying to run file from the filesystem\r\n\t\tif (function_exists('exec')) {\r\n\t\t\t$mimeType = exec(\"/usr/bin/file -i -b $filepath\");\r\n\t\t\tif (!empty($mimeType)) return $mimeType;\r\n\t\t}\r\n\r\n\t\t// Trying to get mimetype from images\r\n\t\t$imageData = @getimagesize($filepath);\r\n\t\tif (!empty($imageData['mime'])) {\r\n\t\t\treturn $imageData['mime'];\r\n\t\t}\r\n\r\n\t\t// Reverting to guessing the mimetype from a known list\r\n\t\t // Thanks to MilesJ Uploader plugin : http://milesj.me/resources/logs/uploader-plugin\r\n\t\tstatic $mimeTypes = array(\r\n\t\t\t// Images\r\n\t\t\t'bmp'\t=> 'image/bmp',\r\n\t\t\t'gif'\t=> 'image/gif',\r\n\t\t\t'jpe'\t=> 'image/jpeg',\r\n\t\t\t'jpg'\t=> 'image/jpeg',\r\n\t\t\t'jpeg'\t=> 'image/jpeg',\r\n\t\t\t'pjpeg'\t=> 'image/pjpeg',\r\n\t\t\t'svg'\t=> 'image/svg+xml',\r\n\t\t\t'svgz'\t=> 'image/svg+xml',\r\n\t\t\t'tif'\t=> 'image/tiff',\r\n\t\t\t'tiff'\t=> 'image/tiff',\r\n\t\t\t'ico'\t=> 'image/vnd.microsoft.icon',\r\n\t\t\t'png'\t=> 'image/png',\r\n\t\t\t'xpng'\t=> 'image/x-png',\r\n\t\t\t// Text\r\n\t\t\t'txt' \t=> 'text/plain',\r\n\t\t\t'asc' \t=> 'text/plain',\r\n\t\t\t'css' \t=> 'text/css',\r\n\t\t\t'csv'\t=> 'text/csv',\r\n\t\t\t'htm' \t=> 'text/html',\r\n\t\t\t'html' \t=> 'text/html',\r\n\t\t\t'stm' \t=> 'text/html',\r\n\t\t\t'rtf' \t=> 'text/rtf',\r\n\t\t\t'rtx' \t=> 'text/richtext',\r\n\t\t\t'sgm' \t=> 'text/sgml',\r\n\t\t\t'sgml' \t=> 'text/sgml',\r\n\t\t\t'tsv' \t=> 'text/tab-separated-values',\r\n\t\t\t'tpl' \t=> 'text/template',\r\n\t\t\t'xml' \t=> 'text/xml',\r\n\t\t\t'js'\t=> 'text/javascript',\r\n\t\t\t'xhtml'\t=> 'application/xhtml+xml',\r\n\t\t\t'xht'\t=> 'application/xhtml+xml',\r\n\t\t\t'json'\t=> 'application/json',\r\n\t\t\t// Archive\r\n\t\t\t'gz'\t=> 'application/x-gzip',\r\n\t\t\t'gtar'\t=> 'application/x-gtar',\r\n\t\t\t'z'\t\t=> 'application/x-compress',\r\n\t\t\t'tgz'\t=> 'application/x-compressed',\r\n\t\t\t'zip'\t=> 'application/zip',\r\n\t\t\t'rar'\t=> 'application/x-rar-compressed',\r\n\t\t\t'rev'\t=> 'application/x-rar-compressed',\r\n\t\t\t'tar'\t=> 'application/x-tar',\r\n\t\t\t// Audio\r\n\t\t\t'aif' \t=> 'audio/x-aiff',\r\n\t\t\t'aifc' \t=> 'audio/x-aiff',\r\n\t\t\t'aiff' \t=> 'audio/x-aiff',\r\n\t\t\t'au' \t=> 'audio/basic',\r\n\t\t\t'kar' \t=> 'audio/midi',\r\n\t\t\t'mid' \t=> 'audio/midi',\r\n\t\t\t'midi' \t=> 'audio/midi',\r\n\t\t\t'mp2' \t=> 'audio/mpeg',\r\n\t\t\t'mp3' \t=> 'audio/mpeg',\r\n\t\t\t'mpga' \t=> 'audio/mpeg',\r\n\t\t\t'ra' \t=> 'audio/x-realaudio',\r\n\t\t\t'ram' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rm' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rpm' \t=> 'audio/x-pn-realaudio-plugin',\r\n\t\t\t'snd' \t=> 'audio/basic',\r\n\t\t\t'tsi' \t=> 'audio/TSP-audio',\r\n\t\t\t'wav' \t=> 'audio/x-wav',\r\n\t\t\t'wma'\t=> 'audio/x-ms-wma',\r\n\t\t\t// Video\r\n\t\t\t'flv' \t=> 'video/x-flv',\r\n\t\t\t'fli' \t=> 'video/x-fli',\r\n\t\t\t'avi' \t=> 'video/x-msvideo',\r\n\t\t\t'qt' \t=> 'video/quicktime',\r\n\t\t\t'mov' \t=> 'video/quicktime',\r\n\t\t\t'movie' => 'video/x-sgi-movie',\r\n\t\t\t'mp2' \t=> 'video/mpeg',\r\n\t\t\t'mpa' \t=> 'video/mpeg',\r\n\t\t\t'mpv2' \t=> 'video/mpeg',\r\n\t\t\t'mpe' \t=> 'video/mpeg',\r\n\t\t\t'mpeg' \t=> 'video/mpeg',\r\n\t\t\t'mpg' \t=> 'video/mpeg',\r\n\t\t\t'mp4'\t=> 'video/mp4',\r\n\t\t\t'viv' \t=> 'video/vnd.vivo',\r\n\t\t\t'vivo' \t=> 'video/vnd.vivo',\r\n\t\t\t'wmv'\t=> 'video/x-ms-wmv',\r\n\t\t\t// Applications\r\n\t\t\t'js'\t=> 'application/x-javascript',\r\n\t\t\t'xlc' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xll' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlm' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xls' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlw' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'doc'\t=> 'application/msword',\r\n\t\t\t'dot'\t=> 'application/msword',\r\n\t\t\t'pdf' \t=> 'application/pdf',\r\n\t\t\t'psd' \t=> 'image/vnd.adobe.photoshop',\r\n\t\t\t'ai' \t=> 'application/postscript',\r\n\t\t\t'eps' \t=> 'application/postscript',\r\n\t\t\t'ps' \t=> 'application/postscript'\r\n\t\t);\r\n\t\t$ext = $this->ext($filedata);\r\n\t\treturn array_key_exists($ext, $mimeTypes) ? $mimeTypes[$ext] : false;\r\n\t}", "public static function detect($file)\n {\n if ($file instanceof File) {\n $file = $file->getPath();\n }\n if (file_exists($file) && is_file($file)) {\n return mime_content_type($file);\n }\n\n return false;\n }", "public static function mimeType($path)\n\t{\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);\n\t}", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "public function getImageType($file) {\n\t\t$info = getimagesize($file);\n\t\tswitch ($info['mime']) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$type = 'jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$type = 'png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$type = 'gif';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->errorMessage = sprintf('Image file \"%s\" has an unknown or unsupported image file type (%s)', $file, $info['mime']);\n\t\t\t\t$type = null;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $type;\n\t}", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "function getMimeType() ;", "public function getMime(): string\n {\n return $this->applicableFormat[$this->contentType];\n }", "public function detectMimeType()\n {\n static::checkFileinfoExtension();\n\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n\n return (($this->isWrapped() || $this->isTemp()) ?\n $finfo->buffer($this->getRaw())\n : $finfo->file($this->getPathname())\n );\n }", "function get_mime_type($file, $real_filename = null, $use_native_functions = true) {\n if (function_exists('mime_content_type') && $use_native_functions) {\n $mime_type = trim(mime_content_type($file));\n if (!$mime_type) {\n return 'application/octet-stream';\n } // if\n $mime_type = explode(';', $mime_type);\n return $mime_type[0];\n } else if (function_exists('finfo_open') && function_exists('finfo_file') && $use_native_functions) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mime_type;\n } else {\n if ($real_filename) {\n $file = $real_filename;\n } // if\n \n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n \n $extension = strtolower(get_file_extension($file));\n if (array_key_exists($extension, $mime_types)) {\n return $mime_types[$extension];\n } else {\n return 'application/octet-stream';\n } // if\n } // if\n }", "public function getMimeType()\n {\n $header = $this->getMimeTypes();\n $contentType = $header[0];\n return $contentType;\n }", "public function getMIMEType()\n {\n return $this->mimetype;\n }", "function getImageTypeByFile($file)\n {\n if (is_file($file))\n {\n // file exists\n\n // get image type\n $info = getimagesize($file);\n $type = null; // set to null per default for unsupported types\n if ($info[2] == 1) $type = 'gif';\n if ($info[2] == 2) $type = 'jpg';\n if ($info[2] == 3) $type = 'png';\n\n // getimagesize cannot read type\n // fallback to getting type by file extension\n if ($type===null) $type = strtolower(substr($file,-3));\n\n return $type;\n }\n else\n {\n $this->error[] = 'InstantImage: file does not exist ('.$file.')';\n return false;\n }\n }", "public function mimeType(): string\n {\n return $this->mimeType ??= FileSystem::mimeType($this->path);\n }", "public function mime($filePath);", "public function getMimeType() : string\n {\n $mimeType = $this->mimeType;\n if ($this->shouldBeCompressed()) {\n $mimeType = $this->compression->getMimeType();\n }\n return $mimeType;\n }", "public static function getMimeTypeOfMedia($filename)\n {\n $mimeType = wp_get_image_mime($filename);\n if ($mimeType !== false) {\n return $mimeType;\n }\n\n // Try mime_content_type\n if (function_exists('mime_content_type')) {\n $mimeType = mime_content_type($filename);\n if ($mimeType !== false) {\n return $mimeType;\n }\n }\n\n // Try wordpress method, which simply uses the file extension and a map\n $mimeType = wp_check_filetype($filePath)['type'];\n if ($mimeType !== false) {\n return $mimeType;\n }\n\n // Don't say we didn't try!\n return 'unknown';\n }", "function get_mime($file) {\n\t// Since in php 5.3 this is a mess...\n\t/*if(function_exists('finfo_open')) {\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file); \n\t} else {\n\t\tif(function_exists('mime_content_type')) {\n\t\t\treturn mime_content_type($file);\n\t\t} else {\n\t\t\treturn \"application/force-download\";\n\t\t}\n\t}*/\n\t$mimetypes = array(\n\t\t\"php\"\t=> \"application/x-php\",\n\t\t\"js\"\t=> \"application/x-javascript\",\n\t\t\n\t\t\"css\"\t=> \"text/css\",\n\t\t\"html\"\t=> \"text/html\",\n\t\t\"htm\"\t=> \"text/html\",\n\t\t\"txt\"\t=> \"text/plain\",\n\t\t\"xml\"\t=> \"text/xml\",\n\t\t\n\t\t\"bmp\"\t=> \"image/bmp\",\n\t\t\"gif\"\t=> \"image/gif\",\n\t\t\"jpg\"\t=> \"image/jpeg\",\n\t\t\"png\"\t=> \"image/png\",\n\t\t\"tiff\"\t=> \"image/tiff\",\n\t\t\"tif\"\t=> \"image/tif\",\n\t);\n\t$file_mime = $mimetypes[pathinfo($file, PATHINFO_EXTENSION)];\n\tif(check_value($file_mime)) {\n\t\treturn $file_mime;\n\t} else {\n\t\treturn \"application/force-download\";\n\t}\n}", "public function getMime(): string\n {\n return $this->getType();\n }", "public function get_mime_type( $path ) {\n\t\tset_time_limit( 0 );\n\n\t\treturn mime_content_type( $path );\n\t}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "static function getMimeType($filename) {\n\t\tglobal $global_mimetypes;\n\t\tif(!$global_mimetypes) self::loadMimeTypes();\n\t\t$ext = strtolower(substr($filename,strrpos($filename,'.')+1));\n\t\tif(isset($global_mimetypes[$ext])) return $global_mimetypes[$ext];\n\t}", "function getmimetype($path){\n\t$extension = getextension($path);\n $filetype = getfiletype($path);\n if ($filetype != null){\n return $_ENV['MIME_TYPES'][$filetype][$extension];\n } else {\n return 'text/plain';\n }\n}", "public function getMimeType(): string\n {\n return $this->filesystem->mimeType(\n $this->resource->getPath()\n ) ?: 'application/octet-stream';\n }", "function getMimeType($file) {\n\t\t$len = strlen($file);\n\t\t$ext = substr($file,strrpos($file,\".\")+1,$len);\n\t\t$extArray['pdf'] = array(\textension \t=> \t'pdf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Adobe PDF File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/pdf');\n\t\t$extArray['zip'] = array(\textension \t=> \t'zip',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ZIP-File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/zip');\n\t\t$extArray['xls'] = array(\textension \t=> \t'xls',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['xlt'] = array(\textension \t=> \t'xlt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['doc'] = array(\textension \t=> \t'doc',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['dot'] = array(\textension \t=> \t'dot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['jpg'] = array(\textension \t=> \t'jpg',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'JPEG Picture File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/jpg');\n\t\t$extArray['vsd'] = array(\textension \t=> \t'vsd',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Visio File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['ppt'] = array(\textension \t=> \t'ppt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['pot'] = array(\textension \t=> \t'pot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint Template File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['tif'] = array(\textension \t=> \t'tif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Tagged Image File - TIF',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/tiff');\n\t\t$extArray['eps'] = array(\textension \t=> \t'eps',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Encasulated Postscript - EPS',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/postscript');\n\t\t$extArray['txt'] = array(\textension \t=> \t'txt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Plaintext',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'text/pain');\n\t\t$extArray['swf'] = array(\textension \t=> \t'swf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ShockWave Flash',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-shockwave-flash');\n\t\t$extArray['gif'] = array(\textension \t=> \t'gif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Compuserve Graphics Interchange Format',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/gif');\n\t\t$extArray['png'] = array(\textension \t=> \t'png',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Portable Network Graphics',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/png');\n\t\t$extArray['flv'] = array(\textension \t=> \t'flv',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Flash Video',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'video/mp4');\n\t\t$extArray['mp3'] = array(\textension \t=> \t'mp3',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'MPEG-1 Audio Layer 3',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'audio/mpeg');\n\t\t$extArray['unknown'] = array(\textension \t=> \t'unknown',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Unknown Filetype',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\tif (array_key_exists($ext,$extArray)) {\n\t\t\treturn $extArray[$ext];\n\t\t} else {\n\t\t\treturn $extArray['unknown'];\n\t\t}\n\t}", "public function MimeType();", "function getMimeType ()\n\t{\n\t\treturn $this->mainType.'/'.$this->subType;\n\t}", "function get_mime_type($path)\n{\n\t$file = trim(basename($path));\n\t//get extension\n\tif($pos=strpos($file, '.')) {\n\t\t$ext = trim(substr($file,$pos),'.');\n\t} else {\n\t\t//either no '.'' or at pos 0, no extention\n\t\treturn false;\n\t}\n\t//check system mime file for ours\n\t$mime = false;\n\tif($sys_mime = fopen('/etc/mime.types','r')) {\n\t\twhile(!$mime && ($line=fgets($sys_mime)) !== false) {\n\t\t\t$line = trim($line);\n\t\t\tif($line && $line[0]!=='#') {\n\t\t\t\t$parts = preg_split('/\\s+/', $line);\n\t\t\t\tif(count($parts) !== 1) {\n\t\t\t\t\tforeach ($parts as $extension) {\n\t\t\t\t\t\tif($extension === $ext) {\n\t\t\t\t\t\t\t$mime = $parts[0];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($sys_mime);\n\t}\n\treturn $mime;\n}", "public function getMimeType() {\n return explode('/', $this->contentType)[0];\n }", "public function getContentType()\n {\n return $this->mediaFile->getContentType();\n }", "abstract public function getMimeType();", "protected function getTypeFromFile(UploadedFile $file)\n\t{\n\t\t$mimeType = $file->getMimeType();\n\n\t\tforeach($this->mimeTypeMapping as $regex => $directory) {\n\t\t\tif (preg_match(\"#{$regex}#\", $mimeType)) {\n\t\t\t\treturn $directory;\n\t\t\t}\n\t\t}\n\n\t\treturn 'misc';\n\t}", "protected function getMimeContentType($filename)\r\n {\r\n $mime_types = array(\r\n\r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n\r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n\r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n\r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n\r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n\r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n\r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n\r\n $ext = strtolower(array_pop(explode('.',$filename)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n } elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimeType = finfo_file($finfo, $filename);\r\n finfo_close($finfo);\r\n return $mimeType;\r\n } else {\r\n return 'application/octet-stream';\r\n }\r\n }", "public static function getMimeTypeForFile(string $filename): string\n\t{\n\t\t// In case the path is a Bitly, strip any query string before getting extension\n\t\t$qpos = strpos($filename, '?');\n\t\tif (false !== $qpos) {\n\t\t\t$filename = substr($filename, 0, $qpos);\n\t\t}\n\n\t\treturn self::getMimeTypeFromExtension(self::mb_pathinfo($filename, PATHINFO_EXTENSION)) ?? 'application/octet-stream';\n\t}", "public function getFileType()\n {\n return $this->fileType;\n }", "protected static function _get_mime_type( $resource ) {\r\n $type = function_exists( 'mime_content_type' ) && file_exists($resource) ? \r\n mime_content_type( $resource ) :\r\n 'text/plain';\r\n if( preg_match( '/\\.js(\\?|$)/', $resource ) ) {\r\n $type = 'text/javascript';\r\n } else if( preg_match( '/\\.css(\\?|$)/', $resource ) ) {\r\n $type = 'text/css';\r\n }\r\n\r\n// if( $type == 'text/plain' ) {\r\n// error_log( \"PLAIN: $resource\" );\r\n// }\r\n return $type; \r\n }" ]
[ "0.8893712", "0.87844676", "0.8408267", "0.84001315", "0.8391973", "0.83830625", "0.8251235", "0.8107121", "0.8101801", "0.79573673", "0.7950392", "0.79051036", "0.7858282", "0.7853119", "0.78213763", "0.78085536", "0.7801808", "0.7767957", "0.77612567", "0.77541023", "0.77442425", "0.7734207", "0.7719829", "0.77167624", "0.771212", "0.769571", "0.7667432", "0.7632322", "0.76188946", "0.75925624", "0.7592476", "0.7581527", "0.75786793", "0.75693417", "0.75674844", "0.7567067", "0.7559455", "0.75475776", "0.75453913", "0.7529335", "0.75160146", "0.7503696", "0.75027", "0.74867284", "0.7475305", "0.74549806", "0.74546283", "0.7446109", "0.7437208", "0.74254227", "0.74254227", "0.74254227", "0.7418499", "0.7404573", "0.74005085", "0.7395164", "0.7384873", "0.7384082", "0.7360586", "0.7346487", "0.7340942", "0.7337346", "0.73357403", "0.73357403", "0.73357403", "0.73357403", "0.73357403", "0.73297113", "0.732932", "0.73266757", "0.7319937", "0.7312585", "0.730873", "0.7297006", "0.72943044", "0.72831476", "0.72731036", "0.7272789", "0.726145", "0.7245083", "0.723093", "0.7197636", "0.7197636", "0.7197636", "0.7197636", "0.7196329", "0.71952116", "0.7189116", "0.7184381", "0.71799767", "0.71608067", "0.71578604", "0.7147531", "0.714505", "0.7140683", "0.71316814", "0.7127584", "0.71182394", "0.71169376", "0.7109862" ]
0.7822663
14
Get rewrites in code pool
public function getCodePoolClassRewrite() { $cache = Mage::app()->loadCache(self::CACHE_KEY_CODE_POOL); if ($this->useCache() && $cache) { $classCodePoolRewrite = unserialize($cache); } else { $classCodePoolRewrite = array(); $usedClasses = $this->_getUsedClassMethods(); foreach ($usedClasses as $class => $methods) { $refl = new ReflectionClass($class); $filename = $refl->getFileName(); $pathByName = str_replace('_', DS, $class) . '.php'; if ((strpos($filename, 'local' . DS . $pathByName) !== false) || (strpos($filename, 'community'. DS . $pathByName) !== false)) { $classCodePoolRewrite[] = $class; } } if ($this->useCache()) { Mage::app()->saveCache(serialize($classCodePoolRewrite), self::CACHE_KEY_CODE_POOL, array(self::CACHE_TYPE)); } } return $classCodePoolRewrite; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_rewrites()\n {\n }", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t\t\n\t\t// If we want to turn the rewrite engine on, add the statement\n\t\tif($this->includeTurnOnEngine){\n\t\t\t$this->appendTurnOnEngine();\n\t\t}\n\t\t\n\t\t// Are there actually URLs to rewrite?\n\t\tif(!empty($this->urls)){\n\t\t\t\n\t\t\t// Loop through the URLs\n\t\t\tforeach($this->urls as $source => $destination){\n\t\t\t\t\n\t\t\t\t// Check for query strings, as RewriteRule will ignore them\n\t\t\t\t$queryStringPos = strpos($source, '?');\n\t\t\t\t\n\t\t\t\t// URL has a query string\n\t\t\t\tif($queryStringPos !== FALSE){\n\t\t\t\t\t\n\t\t\t\t\t// Grab the query string\n\t\t\t\t\t$queryString = substr($source, $queryStringPos + 1);\n\t\t\t\t\t\n\t\t\t\t\t// If there wasn't just a lone ? in the URL\n\t\t\t\t\tif($queryString != ''){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add a RewriteCond for this query string\n\t\t\t\t\t\t$this->buildRewriteCondition('QUERY_STRING', $queryString);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// RewriteRule matches on the request URI without query strings, so remove the query string\n\t\t\t\t\t$source = substr($source, 0, $queryStringPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add a RewriteRule for this source / destination\n\t\t\t\t$this->buildRewriteRule($source, $destination);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we are adding the check for mod_rewrite.c add the closing tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckEnd();\n\t\t}\n\t\t\n\t\t// Return our rewrites\n\t\treturn $this->rewrites;\n\t}", "public function action_init_register_rewrites() {\n add_rewrite_endpoint( 'ics', EP_PERMALINK );\n }", "function rest_api_register_rewrites()\n {\n }", "public function getRewritten()\n {\n return $this->rewritten;\n }", "function wpbp_add_rewrites($content) {\n global $wp_rewrite;\n $llama_new_non_wp_rules = array(\n \t// icons for home screen and bookmarks\n\t 'assets/icons/(.*)' => THEME_PATH . '/assets/icons/$1',\n \t'favicon.ico' => 'assets/icons/favicon.ico',\n \t'apple-touch(.*).png' => 'assets/icons/apple-touch$1.png',\n\n \t// other rules\n\t 'assets/wpbp-assets/(.*)' => THEME_PATH . '/assets/wpbp-assets/$1',\n '(.*)\\.[\\d]+\\.(css|js)$'\t=> '$1.$2 [L]',\n '(.*)\\.[\\d]+\\.(js)$' => '/$1.$2 [QSA,L]',\n '(.*)\\.[\\d]+\\.(css)$' => '$1.$2 [L]'\n );\n $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $llama_new_non_wp_rules);\n return $content;\n}", "function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}", "function dump_rewrite_rules_to_file()\n{\n $images_url = \\DB::connection('mysql')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $videos_url = \\DB::connection('mysqlVideo')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $content = $images_url\n ->merge($videos_url)\n ->pipe(function ($collection) {\n return implode(\"\\n\", $collection->toArray());\n });\n\n file_put_contents(public_path('nginx.conf'), $content);\n devops_reload_nginx();\n return true;\n}", "function iis7_save_url_rewrite_rules()\n {\n }", "function got_url_rewrite()\n {\n }", "function cu_rewrite_activation() {\n\tcu_rewrite_add_rewrites();\n\tflush_rewrite_rules();\n}", "function roots_flush_rewrites() {\n\nif(of_get_option('flush_htaccess', false) == 1 || get_transient(\"was_flushed\") === false) {\n\t\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->flush_rules();\n\t\n\t\tset_transient(\"was_flushed\", true, 60 * 60 * 24 * 7 );\n\t}\n}", "function eman_add_rewrites( $content )\n\t{\n\t\tglobal $wp_rewrite;\n\t\t$new_non_wp_rules = array(\n\t\t\t'assets/(.*)' => THEME_PATH . '/assets/$1',\n\t\t\t'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'\n\t\t);\n\t\t$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);\n\t\treturn $content;\n\t}", "function wpbp_flush_rewrites()\n {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n }", "public function rewrite();", "function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}", "function save_mod_rewrite_rules()\n {\n }", "private function _show_generated_cache_rewrite_rules()\n\t{\n\n\t\t/* $output = '<strong>' */\n\t\t/* \t. __('Please update the cache directory config file <code>%s</code> ' */\n\t\t/* \t. 'manually using auto-generated contents as shown below. ' */\n\t\t/* \t. 'It is highly recommended that you paste the contents ' */\n\t\t/* \t. 'at the top of the server config file. ' */\n\t\t/* \t. 'If config file does not exist, you must first create it.', $this->domain) */\n\t\t/* \t. '</strong>'; */\n\n\t\t/* $output = sprintf($output, $this->rewriter->get_cache_config_file()); */\n\n\t\t/* $output .= '<br /><br />'; */\n\t\t/* $output .= '<textarea class=\"code\" rows=\"8\" cols=\"90\" readonly=\"readonly\">' */\n\t\t/* \t. $rules . '</textarea>'; */\n\n\t\t/* return $output; */\n\t}", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "public function mod_rewrite_rules()\n {\n }", "function rad_rewrite_flush(){\n\trad_setup_products(); //the function above that set up the CPT\n\tflush_rewrite_rules(); //re-builds the .htaccess rules\n}", "public function page_rewrite_rules()\n {\n }", "function nesia_flush_rewriterules () {\r\r\n\tflush_rewrite_rules();\r\r\n}", "public static function compiledRoutes()\n {\n return self::$compiled_routes;\n }", "public function getAppRoutes(){\n $cache=Yii::$app->cache;\n $key = [__METHOD__, Yii::$app->getUniqueId()];\n if(($result = $cache->get($key)) === false){\n $result=$this->getRouteRecrusive('frontend');\n $cache->set($key, $result, \"3600\", new TagDependency([\n 'tags' => self::CACHE_TAG,\n ]));\n }\n return $result;\n }", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "public function wp_rewrite_rules()\n {\n }", "public function rewriteEndpoints()\n {\n $this->addEndpoints();\n flush_rewrite_rules();\n }", "function wpgrade_gets_active() {\r\n flush_rewrite_rules();\r\n}", "function can_rewrite(){ return array_val_is($_SERVER,'WDF_FEATURES_REWRITE','on') || array_val_is($_SERVER,'REDIRECT_WDF_FEATURES_REWRITE','on'); }", "protected function _getUrlRewrite()\n {\n if (!$this->hasData('url_rewrite')) {\n $this->setUrlRewrite($this->_rewriteFactory->create());\n }\n return $this->getUrlRewrite();\n }", "function generateRewriteRules($config)\n {\n // generate mod-rewrite htaccess rules\n $rewrite = array($this->beginMarker);\n if( $config->htaccess_no_indexes ) {\n $rewrite[] = \"\\n# Don't allow directory browsing (for images / thumbs / etc)\";\n $rewrite[] = \"Options -Indexes\\n\\n\";\n }\n if( !$config->hotlink_thumbnails || !$config->hotlink_images || $config->rewrite_old_urls \n \t\t|| $config->monitor_thumbnail_bandwidth || $config->monitor_image_bandwidth \n || $config->rewrite_urls) {\n $rewrite[] = \"<ifModule mod_rewrite.c>\";\n $rewrite[] = \"Options +FollowSymLinks\";\n \t$rewrite[] = \"RewriteEngine On\";\n if( $config->rewrite_old_urls ) {\n $rewrite[] = $this->rewriteOldURLs();\n }\n $rewrite[] = $this->getImageBandwidthRules($config);\n $rewrite[] = $this->getImageHotlinkRules($config);\n $rewrite[] = $this->getThumbnailHotlinkRules($config);\n $rewrite[] = $this->getThumbnailBandwidthRules($config);\n $rewrite[] = $this->getURLRewriteRules($config);\n $rewrite[] = \"</ifModule>\";\n }\n $rewrite[] = $this->endMarker.\"\\n\\n\";\n return join(\"\\n\", $rewrite);\n }", "public function getXmlClassRewrites()\n {\n $cache = Mage::app()->loadCache(self::CACHE_KEY_XML);\n if ($this->useCache() && $cache) {\n $result = unserialize($cache);\n } else {\n $classRewrites = array();\n $modules = $this->_getAllModules();\n\n foreach ($modules as $modName => $module) {\n if ($this->_skipValidation($modName, $module)) {\n continue;\n }\n $result = $this->_getRewritesInModule($modName);\n if (!empty($result)) {\n $classRewrites[] = $result;\n }\n }\n $result = $this->_getClassMethodRewrites($classRewrites);\n if ($this->useCache()) {\n Mage::app()->saveCache(serialize($result), self::CACHE_KEY_XML,\n array(self::CACHE_TYPE));\n }\n }\n return $result;\n }", "function got_mod_rewrite()\n {\n }", "function fs_rewrite_flush() {\r\n\tflush_rewrite_rules();\r\n}", "public function rewrite_rules($wp_rewrite) {\r\n $rules = array();\r\n if (SQ_Classes_Tools::getOption('sq_use') == 1) {\r\n\r\n //For Favicon\r\n if (SQ_Classes_Tools::getOption('sq_auto_favicon') == 1) {\r\n $rules['favicon\\.ico$'] = 'index.php?sq_get=favicon';\r\n $rules['favicon\\.icon$'] = 'index.php?sq_get=favicon';\r\n $rules['touch-icon\\.png$'] = 'index.php?sq_get=touchicon';\r\n foreach ($this->model->appleSizes as $size) {\r\n $size = (int)$size;\r\n $rules['touch-icon' . $size . '\\.png$'] = 'index.php?sq_get=touchicon&sq_size=' . $size;\r\n }\r\n }\r\n\r\n if (SQ_Classes_Tools::getOption('sq_auto_feed') == 1) {\r\n $rules['sqfeedcss$'] = 'index.php?sq_get=feedcss';\r\n }\r\n }\r\n return array_merge($rules, $wp_rewrite);\r\n }", "abstract protected function getPatternsAndCallbacks(): array;", "protected function getPostCompileVisitors()\n {\n $postCompileVisitors = array(\n new ILess_Visitor_JoinSelector()\n );\n\n if ($this->env->hasExtends) {\n $postCompileVisitors[] = new ILess_Visitor_ProcessExtend();\n }\n\n $postCompileVisitors[] = new ILess_Visitor_ToCSS($this->getEnvironment());\n\n // FIXME: allow plugins to hook here\n return $postCompileVisitors;\n }", "function rewrite_xmlsitemap_d4seo( $rewrites ) {\n\n\t\t$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$'] = 'index.php?xmlsitemap=1&xmlurl=$matches[2]';\n\t\t#$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml\\.gz$'] = 'index.php?xmlsitemap=1params=$matches[2];zip=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html$' => 'index.php?xmlsitemap=1params=$matches[2];html=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html.gz$' => 'index.php?xmlsitemap=1params=$matches[2];html=true;zip=true';\n\t\treturn $rewrites;\n\n\t}", "private function getReplacements()\n {\n return [\n '/* {{ host }} */' => $this->getBackendHost(),\n '/* {{ port }} */' => $this->getBackendPort(),\n '/* {{ ips }} */' => $this->getTransformedAccessList(),\n '/* {{ design_exceptions_code }} */' => $this->getRegexForDesignExceptions(),\n // http headers get transformed by php `X-Forwarded-Proto: https`\n // becomes $SERVER['HTTP_X_FORWARDED_PROTO'] = 'https'\n // Apache and Nginx drop all headers with underlines by default.\n '/* {{ ssl_offloaded_header }} */' => str_replace('_', '-', $this->getSslOffloadedHeader()),\n '/* {{ grace_period }} */' => $this->getGracePeriod(),\n ];\n }", "public function add_rewrite_rules()\n {\n }", "function flush_rewrite_rules($hard = \\true)\n {\n }", "public function add_rewrite_rules()\n {\n }", "public function getAssetUrlBaseRemap();", "public function rewriteRules()\n {\n add_rewrite_rule('janrain/(.*?)/?$', 'index.php?janrain=$matches[1]', 'top');\n add_rewrite_tag('%janrain%', '([^&]+)');\n }", "public function getAppRoutes()\n\t{\n\t\t$key = __METHOD__;\n\t\t$cache = Configs::instance()->cache;\n\t\tif ($cache === null || ($result = $cache->get($key)) === false) {\n\t\t\t$result = [];\n\t\t\t$this->getRouteRecrusive(Yii::$app, $result);\n\t\t\tif ($cache !== null) {\n\t\t\t\t$cache->set($key, $result, Configs::instance()->cacheDuration, new TagDependency([\n\t\t\t\t\t'tags' => self::CACHE_TAG\n\t\t\t\t]));\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function refresh_rewrite_rules() {\n\tflush_rewrite_rules();\n\tdo_action( 'rri_flush_rules' );\n}", "function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}", "function preflightCache() {\n\t\t$moduleDir = (isset($this->bean->module_dir) && !empty($this->bean->module_dir)) ? $this->bean->module_dir : \"General\";\n\t\t$this->rulesCache = sugar_cached(\"routing/{$moduleDir}\");\n\n\t\tif(!file_exists($this->rulesCache)) {\n\t\t\tmkdir_recursive($this->rulesCache);\n\t\t}\n\t}", "function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}", "public function flush_rewrites() {\n\t\t$flush_rewrites = get_option( 'ccf_flush_rewrites' );\n\n\t\tif ( ! empty( $flush_rewrites ) ) {\n\t\t\tflush_rewrite_rules();\n\n\t\t\tdelete_option( 'ccf_flush_rewrites' );\n\t\t}\n\t}", "public function _retrieve()\n {\n $this->log($this->getRequest()->getParams());\n $classInfoNodeList = Mage::getConfig()->getNode()->xpath(\n '//global//rewrite/..'\n );\n $outItems = array();\n\n foreach ($classInfoNodeList as $classInfoNode) {\n $rewrite = $classInfoNode->xpath('rewrite');\n if (is_array($rewrite) && sizeof($rewrite) > 0) {\n $keys = array_keys($rewrite[0]->asArray());\n $classSuffix = $keys[0];\n $rewriteClass = (string)$classInfoNode->rewrite->$classSuffix;\n $className = $classInfoNode->class . '_' . uc_words(\n $classSuffix,\n '_'\n );\n $outItem = array(\n 'original' => $className,\n 'rewriter' => $rewriteClass\n );\n $outItems[] = $outItem;\n }\n }\n $this->log($outItems);\n return $outItems;\n }", "private function buildCache(): array\n {\n $dispatchData = $this->routeCollector->getData();\n\n file_put_contents($this->cacheFile, '<?php return ' . var_export($dispatchData, true) . ';');\n\n return $dispatchData;\n }", "public function getReplaces(): array {\n return [];\n }", "public function get_patterns()\n {\n }", "function _url_rewrite_params($zone_name, $vars, $force_index_php = false)\n{\n global $URL_REMAPPINGS;\n if ($URL_REMAPPINGS === null) {\n require_code('url_remappings');\n $URL_REMAPPINGS = get_remappings(get_option('url_scheme'));\n foreach ($URL_REMAPPINGS as $i => $_remapping) {\n $URL_REMAPPINGS[$i][3] = count($_remapping[0]);\n }\n }\n\n static $url_scheme = null;\n if ($url_scheme === null) {\n $url_scheme = get_option('url_scheme');\n }\n\n // Find mapping\n foreach ($URL_REMAPPINGS as $_remapping) {\n list($remapping, $target, $require_full_coverage, $last_key_num) = $_remapping;\n $good = true;\n\n $loop_cnt = 0;\n foreach ($remapping as $key => $val) {\n $loop_cnt++;\n $last = ($loop_cnt == $last_key_num);\n\n if ((isset($vars[$key])) && (is_integer($vars[$key]))) {\n $vars[$key] = strval($vars[$key]);\n }\n\n if (!(((isset($vars[$key])) || (($val === null) && ($key === 'type') && ((isset($vars['id'])) || (array_key_exists('id', $vars))))) && (($key !== 'page') || ($vars[$key] != '') || ($val === '')) && ((!isset($vars[$key]) && !array_key_exists($key, $vars)/*NB this is just so the next clause does not error, we have other checks for non-existence*/) || ($vars[$key] != '') || (!$last)) && (($val === null) || ($vars[$key] === $val)))) {\n $good = false;\n break;\n }\n }\n\n if ($require_full_coverage) {\n foreach ($_GET as $key => $val) {\n if (!is_string($val)) {\n continue;\n }\n\n if ((substr($key, 0, 5) === 'keep_') && (!skippable_keep($key, $val))) {\n $good = false;\n }\n }\n foreach ($vars as $key => $val) {\n if ((!array_key_exists($key, $remapping)) && ($val !== null) && (($key !== 'page') || ($vars[$key] != ''))) {\n $good = false;\n }\n }\n }\n if ($good) {\n // We've found one, now let's sort out the target\n $makeup = $target;\n if ($GLOBALS['DEV_MODE']) {\n foreach ($vars as $key => $val) {\n if (is_integer($val)) {\n $vars[$key] = strval($val);\n }\n }\n }\n\n $extra_vars = array();\n foreach ($remapping as $key => $_) {\n if (!isset($vars[$key])) {\n continue;\n }\n\n $val = $vars[$key];\n unset($vars[$key]);\n\n switch ($key) {\n case 'page':\n $key = 'PAGE';\n break;\n case 'type':\n $key = 'TYPE';\n break;\n case 'id':\n $key = 'ID';\n break;\n default:\n $key = strtoupper($key);\n break;\n }\n $makeup = str_replace($key, cms_raw_url_encode($val, true), $makeup);\n }\n if (!$require_full_coverage) {\n $extra_vars += $vars;\n }\n $makeup = str_replace('TYPE', 'browse', $makeup);\n if ($makeup === '') {\n switch ($url_scheme) {\n case 'HTM':\n $makeup .= get_zone_default_page($zone_name) . '.htm';\n break;\n\n case 'SIMPLE':\n $makeup .= get_zone_default_page($zone_name);\n break;\n }\n }\n if (($extra_vars !== array()) || ($force_index_php)) {\n $first = true;\n $_makeup = '';\n foreach ($extra_vars as $key => $val) { // Add these in explicitly\n if ($val === null) {\n continue;\n }\n if (is_integer($key)) {\n $key = strval($key);\n }\n if ($val === SELF_REDIRECT) {\n $val = get_self_url(true, true);\n }\n $_makeup .= ($first ? '?' : '&') . $key . '=' . cms_url_encode($val, true);\n $first = false;\n }\n if ($_makeup !== '') {\n $makeup .= $_makeup;\n }\n }\n\n return $makeup;\n }\n }\n\n return null;\n}", "private function getPattern(){\n $pattern = strstr( substr($this->_requestUri,1) , '/', true) ;\n if( isset( $this->_config['pattern'] [$pattern] )){\n $this->_activePatern = $this->_config['pattern'][$pattern];\n\n $this->_cacheFolder = $pattern;\n\n $this->_requestUri = str_replace(\"/$pattern/\", \"/\", $this->_requestUri);\n }\n }", "function router_use_rewriting()\n{\n return framework_config('pretty_urls', false, true);\n}", "function cc_rewrite_request_uri_notify() {\n\n\tglobal $cc_orginal_request_uri;\n\n\tif ( isset($_GET['roflcopter']) ) {\n\t\techo \"<!-- CC Permalink Mapper was here: $cc_orginal_request_uri -> {$_SERVER['REQUEST_URI']} -->\\n\";\n\t}\n\n\treturn true;\n\n}", "protected function useRrs() {\n return $this->config->getReducedRedundancyPaths()->match($this->getLocalPath());\n }", "private function flush_rewrite_rules() {\n\n\t\tglobal $updraftplus_addons_migrator;\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) switch_to_blog($updraftplus_addons_migrator->new_blogid);\n\n\t\t$filter_these = array('permalink_structure', 'rewrite_rules', 'page_on_front');\n\t\t\n\t\tforeach ($filter_these as $opt) {\n\t\t\tadd_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->init();\n\t\t// Don't do this: it will cause rules created by plugins that weren't active at the start of the restore run to be lost\n\t\t// flush_rewrite_rules(true);\n\n\t\tif (function_exists('save_mod_rewrite_rules')) save_mod_rewrite_rules();\n\t\tif (function_exists('iis7_save_url_rewrite_rules')) iis7_save_url_rewrite_rules();\n\n\t\tforeach ($filter_these as $opt) {\n\t\t\tremove_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) restore_current_blog();\n\n\t}", "public function rebuild()\n {\n // Don't bother if there's no cache file in config\n if (empty($this->cacheFile)) {\n throw new \\Exception(\n 'Cannot rebuild route cache because no file is provided in config.'\n );\n }\n // Get all published routes\n $routes = $this->pageModel->getPublishedRoutes();\n\n // Smash them into a pipe-separated string\n $pipedRoutes = implode('|', $routes);\n\n // Write to the cache file\n file_put_contents($this->cacheFile, $pipedRoutes);\n }", "static function register_args(): array { return ['rewrite' => false]; }", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "public function getCompiled()\n {\n if ($this->compiled === null) {\n $regexp = \"/^\";\n\n // Method(s)\n $methodIdx = 0;\n foreach($this->methods as $method) {\n $regexp .= \"(?:\" . strtoupper($method) . \")\";\n if (($methodIdx + 1) < count($this->methods)) {\n $regexp .= \"|\";\n }\n $methodIdx++;\n }\n\n // Separator\n $regexp .= \"~\";\n\n // Url\n $regexp .= str_replace('/', '\\/', $this->match);\n\n $regexp .= \"$/\";\n\n $this->compiled = $regexp;\n }\n return $this->compiled;\n }", "public function compile() {\n\t\t\n\t\t$path = $this -> _front ->getApp() ->getConfig() ->controller ->module ->path;\n\t\t$path .= $this -> _front ->getApp() ->getConfig() ->subdomain ? $this -> _front ->getApp() ->getConfig() ->subdomain . DIRECTORY_SEPARATOR : '';\n\t\t$path .= \\FMW\\Utilities\\File\\Util::rslash( $this -> _front ->getRouter() ->getModule() ) . 'cache';\n\t\t\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'js'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$js = '';\n\t\t\t\n\t\t\tforeach ($this->_javascriptCache as $value) {\n\t\t\t\t$js .= file_get_contents( $value );\n\t\t\t}\n\t\t\t\n\t\t\t$js = \\FMW\\Utilities\\Minify\\JSMin::minify($js);\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $js, $this->_cachetime );\n\t\t\t\n\t\t}\n\n\t\t$fcache = new FileCache(array(\n\t\t\t\t'path' \t=> $path,\n\t\t\t\t'ext' \t=> 'css'\n\t\t\t)\n\t\t);\n\t\t\n\t\tunset($js);\n\t\t\n\t\tif ( $fcache->contains( $this -> _front ->getRouter() ->getController() ) === false ) {\n\t\t\t\n\t\t\t$css = \\FMW\\Utilities\\Minify\\CSSMin::minify( $this->_cssCache, $this->_front->getApp()->getConfig() );\n\t\t\t\n\t\t\t$fcache->save( $this -> _front ->getRouter() ->getController(), $css, $this->_cachetime );\n\t\t\t\t\n\t\t}\n\t\t\n\t\tunset($css);\n\t}", "function templatesrecache()\n\t{\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$justdone = intval( $this->ipsclass->input['justdone'] );\n\t\t$justdone = $justdone ? $justdone : 1;\n\t\t\n\t\t$s = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'skin_sets',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 'set_skin_set_id > '.$justdone,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'set_skin_set_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( 0, 1 ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t )\t\t );\n\t\t\n\t\tif ( $s['set_skin_set_id'] )\n\t\t{\n\t\t\t$this->ipsclass->cache_func->_rebuild_all_caches( array( $s['set_skin_set_id'] ) );\n\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}&amp;justdone={$s['set_skin_set_id']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />Rebuilt the '{$s['set_name']}' skin cache...\" );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->input['step']++;\n\t\t\t\t\t\t\n\t\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />No more skins to rebuild...\" );\n\t\t}\n\t}", "private function buildRewriteFlags(){\n\t\tswitch($this->http301){\n\t\t\tcase false:\n\t\t\t\t$response = 'R';\n\t\t\t\tbreak;\n\t\t\tcase true:\n\t\t\tdefault:\n\t\t\t\t$response = 'R=301';\n\t\t}\n\t\treturn '[' . $response . ',L,NC]';\n\t}", "function humcore_add_rewrite_rule() {\n\n\tadd_rewrite_rule(\n\t\t'(deposits/item)/([^/]+)(/(review))?/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_command=$matches[4]',\n\t\t'top'\n\t);\n\n\tadd_rewrite_rule(\n\t\t'(deposits/download)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n\t// Rewrite for deposits/objects handled as ngix proxy pass.\n\n\tadd_rewrite_rule(\n\t\t'(deposits/view)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n add_rewrite_rule(\n '(deposits/list)/?$',\n 'index.php?pagename=$matches[1]',\n 'top'\n );\n\n}", "public function add_rewrite_tags() {\n\t\tadd_rewrite_tag( '%' . $this->user_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->user_comments_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_rates_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_to_rate_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_talks_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->cpage_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->action_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->search_rid . '%', '([^/]+)' );\n\t}", "function c5_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "public function recreateMaps()\n {\n $maps = $this->getRedirectsMapsByType();\n\n $this->recreateMapFile($maps, static::STATUS_CODE_301_MOVED_PERMANENTLY);\n $this->recreateMapFile($maps, static::STATUS_CODE_302_FOUND);\n\n // apache doesn't need reload\n if ($this->serverType === 'nginx') {\n $this->reloadNginxConfigs();\n }\n }", "function init__urls()\n{\n global $HTTPS_PAGES_CACHE;\n $HTTPS_PAGES_CACHE = null;\n\n global $CAN_TRY_URL_SCHEMES_CACHE;\n $CAN_TRY_URL_SCHEMES_CACHE = null;\n\n global $HAS_KEEP_IN_URL_CACHE;\n $HAS_KEEP_IN_URL_CACHE = null;\n\n global $URL_REMAPPINGS;\n $URL_REMAPPINGS = null;\n\n global $CONTENT_OBS;\n $CONTENT_OBS = null;\n\n global $SMART_CACHE, $LOADED_MONIKERS_CACHE;\n if ($SMART_CACHE !== null) {\n $test = $SMART_CACHE->get('NEEDED_MONIKERS');\n if ($test === null) {\n $LOADED_MONIKERS_CACHE = array();\n } else {\n foreach ($test as $c => $_) {\n list($url_parts, $zone, $effective_id) = unserialize($c);\n\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$url_parts['page']][$effective_id] = true;\n }\n }\n }\n\n global $SELF_URL_CACHED;\n $SELF_URL_CACHED = null;\n\n global $HAS_NO_KEEP_CONTEXT, $NO_KEEP_CONTEXT_STACK;\n $HAS_NO_KEEP_CONTEXT = false;\n $NO_KEEP_CONTEXT_STACK = array();\n\n if (!defined('SELF_REDIRECT')) {\n define('SELF_REDIRECT', '!--:)defUNLIKELY');\n }\n}", "function drush_restapi_rebuild() {\n\n $resources = restapi_get_resources(TRUE);\n menu_rebuild();\n\n drush_log(dt('!count resources have been rebuilt and cached.', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function cacheFile()\n\t{\n\t\t$data[] = \"<?php\";\n\t\t$data[] = \"defined('LUNA_SYSTEM') or die('Hacking attempt!');\\n\";\n\n\t\t$routes = Route::orderBy('type')->orderBy('controller')->get()->toArray();\n\n\t\tif (!empty($routes)) {\n\t\t\tforeach ($routes as $route) {\n\t\t\t\t$call_back = isset($route['action']) ? $route['controller'] . \":\" . $route['action'] : $route['controller'];\n\t\t\t\tif (!isset($route['method'])) {\n\t\t\t\t\t$data[] = '$app->get(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t} else {\n\t\t\t\t\t$methods = explode(',', preg_replace('/\\s+/', '', $route['method']));\n\t\t\t\t\tforeach ($methods as $method) {\n\t\t\t\t\t\t$data[] = '$app->' . strtolower($method) . '(\"' . $route['route'] . '\", \"' . $call_back . '\");';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$output = implode(\"\\n\", $data);\n\n\t\twrite_file(LUNA_CACHEPATH . \"/data/routes.php\", $output);\n\t}", "protected function reloadNginxConfigs()\n {\n $reloadCommand = $this->config && !empty($this->config['redirectsReloadCommand']) ? $this->config['redirectsReloadCommand'] : null;\n\n if ($reloadCommand) {\n exec($reloadCommand, $output, $returned);\n }\n\n // TODO: any error-handling (like checking the output and/or the returned value)?\n }", "public function reloadCaches() {}", "function get_RewriteBase() {\n\t\t$RewriteBase = str_replace(\"/admin/index.php\",\"\",$_SERVER[\"PHP_SELF\"]);\n\t\t\n\t\treturn $RewriteBase;\n\t}", "public static function assetsMinification()\n {\n $config = \\Phalcon\\DI::getDefault()->getShared('config');\n\n foreach (array('Css', 'Js') as $asset) {\n $get = 'get' . $asset;\n $filter = '\\Phalcon\\Assets\\Filters\\\\' . $asset . 'min';\n\n foreach (\\Phalcon\\DI::getDefault()->getShared('assets')->$get() as $resource) {\n $min = new $filter();\n $resource->setSourcePath(ROOT_PATH . '/public/' . $resource->getPath());\n $resource->setTargetUri('min/' . $resource->getPath());\n\n if ($config->app->env != 'production') {\n if (!is_dir(dirname(ROOT_PATH . '/public/min/' . $resource->getPath()))) {\n $old = umask(0);\n mkdir(dirname(ROOT_PATH . '/public/min/' . $resource->getPath()), 0777, true);\n umask($old);\n }\n\n if ($config->app->env == 'development' || !file_exists(ROOT_PATH . '/public/min/' . $resource->getPath())) {\n file_put_contents(ROOT_PATH . '/public/min/' . $resource->getPath(), $min->filter($resource->getContent()));\n } elseif (md5($min->filter($resource->getContent())) != md5_file(ROOT_PATH . '/public/min/' . $resource->getPath())) {\n file_put_contents(ROOT_PATH . '/public/min/' . $resource->getPath(), $min->filter($resource->getContent()));\n }\n }\n }\n }\n }", "private function _mapRequest()\n {\n $request = $this->app()->request();\n $request_uri = $request->requestURI();\n $script_name = $request->scriptName();\n $rewritten_query_string = \"\";\n\n // If there is no request uri (ie: we are on the command line) we do\n // not rewrite\n if (empty($request_uri)) {\n return;\n }\n\n // Get path to script\n $path = substr($script_name, 0, (strrpos($script_name, '/')+1));\n\n // Remove path from request uri.\n // This gives us the slug plus any query params\n if ($path != \"/\") {\n $params = str_replace($path, \"\", $request_uri);\n } else {\n // If app is in web root we simply remove preceding slash\n $params = substr($request_uri, 1);\n }\n\n $array = explode(\"?\", $params);\n $slug = $array[0];\n if (isset($array[1])) {\n $query_string = $array[1];\n } else {\n $query_string = \"\";\n }\n\n if ($request->method() == \"POST\" && $request->param(\"slug\")) {\n $slug = $request->param(\"slug\");\n }\n\n if (empty($slug) || $slug == \"index.php\") {\n $slug = \"home\";\n }\n\n // Remove trailing slash from slug if present\n if ($slug[(strlen($slug)-1)] == \"/\") {\n $slug = substr($slug, 0, (strlen($slug)-1));\n }\n\n $request->param(\"slug\", $slug);\n\n // Do not build tree if API call\n if (preg_match(\"/^api\\/([a-zA-Z0-9_]*)/\", $slug, $matches)) {\n $request->controllerName(\"api\");\n $request->action($matches[1]);\n return;\n }\n\n $id_obj = $this->_mapper->getIdObject();\n if (!$this->app()->session()->isAuth() || $this->app()->user()->id() > 2) {\n $id_obj->where(\"c.status\", \"=\", 1);\n }\n if ($slug != \"admin/content\") {\n $id_obj->where(\"c.type <> 'PostContent'\", \"OR\", \"c.slug = '\".$slug.\"'\");\n }\n $id_obj->orderby(\"c.pub_date\", \"DESC\");\n\n $collection = $this->_mapper->find($id_obj);\n $this->_buildTree(iterator_to_array($collection));\n\n // If script name doesn't appear in the request URI we need to rewrite\n if (strpos($request_uri, $script_name) === false\n && $request_uri != $path\n && $request_uri != $path.\"index.php\"\n ) {\n $controller = $request->controllerName();\n if ($controller != \"content\") {\n $array = explode(\"/\", $slug);\n $request->controllerName($array[0]);\n $rewritten_query_string = \"controller=\".$array[0];\n if (isset($array[1])) {\n $request->action($array[1]);\n $rewritten_query_string .= \"&action=\".$array[1];\n }\n }\n }\n\n if (!empty($_SERVER['QUERY_STRING'])) {\n $rewritten_query_string .= \"&\".$_SERVER['QUERY_STRING'];\n }\n\n $_SERVER['QUERY_STRING'] = $rewritten_query_string;\n\n // Update request uri\n $_SERVER['REQUEST_URI'] = $path.\"index.php?\";\n $_SERVER['REQUEST_URI'] .= $_SERVER['QUERY_STRING'];\n }", "static public function add_rewrite_rules(){\n\t global $wp,$wp_rewrite; \n\t $wp->add_query_var( 'profile' );\n\n\t foreach( AT_Route::fronted() as $key=>$params ){\n\t\t\t$wp_rewrite->add_rule('^' .$key, 'index.php?profile=true', 'top');\n\t\t\tforeach ( $params['regular_expressions'] as $key => $expression ) {\n\t\t\t\t$wp_rewrite->add_rule('^' .$key . $expression, 'index.php?profile=true', 'top');\n\t\t\t}\n\n\t }\n\n\t $wp_rewrite->flush_rules();\n\t}", "function registerHooks(): void\n{\n\tregister_activation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_deactivation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_uninstall_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n}", "public function actionRebuildCache()\n {\n foreach (Yii::app()->Modules as $id => $params)\n $this->actionDb2php(array('module' => $id));\n\n }", "function set_failover_mode($new_mode)\n{\n global $FILE_BASE, $SITE_INFO;\n\n $path = $FILE_BASE . '/_config.php';\n $config_contents = file_get_contents($path);\n $orig_config_contents = $config_contents;\n $config_contents = preg_replace('#^(\\$SITE_INFO\\[\\'failover_mode\\'\\]\\s*=\\s*\\')[^\\']+(\\';)#m', '$1' . addslashes($new_mode) . '$2', $config_contents);\n\n if ($orig_config_contents == $config_contents) { // No change needed\n return;\n }\n\n file_put_contents($path, $config_contents);\n\n $SITE_INFO['failover_mode'] = $new_mode;\n\n if ((!empty($SITE_INFO['failover_apache_rewritemap_file'])) && (is_file($FILE_BASE . '/data_custom/failover_rewritemap.txt'))) {\n $htaccess_contents = file_get_contents($FILE_BASE . '/.htaccess');\n\n $htaccess_contents = preg_replace('#^RewriteMap.*\\n+#s', '', $htaccess_contents);\n\n $new_code = '#FAILOVER STARTS' . \"\\n\";\n if ($new_mode == 'auto_on' || $new_mode == 'on') {\n $new_code .= 'RewriteEngine on' . \"\\n\";\n $new_code .= 'RewriteRule ^((caches|themes|uploads|data|data_custom)/.*) \\$1 [L]' . \"\\n\";\n\n if ($SITE_INFO['failover_apache_rewritemap_file'] == '-') {\n $new_code .= 'RewriteCond %{QUERY_STRING} !keep_failover [NC]' . \"\\n\";\n $new_code .= 'RewriteRule ^(.*) sources/static_cache.php [L,QSA]' . \"\\n\";\n } else {\n // The set of browsers\n $browsers = array(\n // Implication by technology claims\n 'WML',\n 'WAP',\n 'Wap',\n 'MIDP', // Mobile Information Device Profile\n\n // Generics\n 'Mobile',\n 'Smartphone',\n 'WebTV',\n\n // Well known/important browsers/brands\n 'Mobile Safari', // Usually Android\n 'Android',\n 'iPhone',\n 'iPod',\n 'Opera Mobi',\n 'Opera Mini',\n 'BlackBerry',\n 'Windows Phone',\n 'nook browser', // Barnes and Noble\n );\n $regexp = '(' . str_replace(' ', '\\ ', implode('|', $browsers)) . ')';\n\n //$new_code .= 'RewriteMap failover_mode txt:' . $FILE_BASE . '/data_custom/failover_rewritemap.txt' . \"\\n\"; Has to be defined in main Apache config\n $new_code .= 'RewriteCond %{QUERY_STRING} !keep_failover [NC]' . \"\\n\";\n $new_code .= 'RewriteRule ^(.*) ${failover_mode:\\$1} [L,QSA]' . \"\\n\";\n //$new_code .= 'RewriteMap failover_mode__mobile txt:' . $FILE_BASE . '/data_custom/failover_rewritemap__mobile.txt' . \"\\n\";\n $new_code .= 'RewriteCond %{QUERY_STRING} !keep_failover [NC]' . \"\\n\";\n $new_code .= 'RewriteCond %{HTTP_USER_AGENT} ' . $regexp . \"\\n\";\n $new_code .= 'RewriteRule ^(.*) ${failover_mode__mobile:\\$1} [L,QSA]' . \"\\n\";\n }\n }\n $new_code .= '#FAILOVER ENDS' . \"\\n\\n\";\n\n $htaccess_contents = preg_replace('/#FAILOVER STARTS.*#FAILOVER ENDS\\n+/s', $new_code, $htaccess_contents);\n\n file_put_contents($FILE_BASE . '/.htaccess', $htaccess_contents);\n }\n}", "function wst_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "public function plxMinifyCacheList(){\n\t\tfunction real($i,$a){$a=explode(' ',$a);return $a[$i];}# found url & more in last comment in cached source\n\t\t$cache_size = 0;\n\t\t$filesCache = array();\n\t\tif (extension_loaded('glob')){\n\t\t\t$cached = glob(PLX_CACHE.\"*.php\");\n\t\t\tforeach ($cached as $file){\n\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t}\n\t\t\tunset($cached);\n\t\t}\n\t\telse{\n\t\t\tif($cached = opendir(PLX_CACHE)){\n\t\t\t\twhile(($file = readdir($cached))!== false){\n\t\t\t\t\tif( $file == '.' || $file == '..' )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(strtolower(strrchr($file,'.')==\".php\")){\n\t\t\t\t\t\t$cache_size += filesize(PLX_CACHE.$file);\n\t\t\t\t\t\t$filesCache [$this->get_time($file)] = array((basename($file)), $this->get_info($file), $this->get_info($file,'url'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($cached);\n\t\t\t}\n\t\t}\n\t\tkrsort($filesCache);\n\t\t$expire = ($this->getParam(\"freeze\")?0:time() - $this->getParam(\"delay\"));\n\t\techo '<img id=\"mc_mode\" class=\"icon_pmc\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/'.($this->getParam(\"freeze\")?'':'un').'lock.png\" title=\"Mode : '.($this->getParam(\"freeze\")?'Frozen':'Normal').'\" alt=\"Freeze Mode\" />&nbsp;';\n\t\techo $this->getLang('L_CACHE_LIST').' ('.count($filesCache).') : '.date('Y-m-d H:i:s').' - '.$this->getLang('L_TOT').' : '.$this->size_readable($cache_size, $decimals = 2).'<hr /><pre id=\"CacheList\" class=\"brush_bash\">';\n\t\tforeach($filesCache as $ts => $name)#findicons.com free\n\t\t\techo '<a class=\"hide\" title=\"'.L_DELETE.' '.$name[0].'\" href=\"javascript:clean(\\''.$name[0].'\\');\"><img class=\"icon_pmc del_file\" src=\"'.PLX_PLUGINS.'plxMinifyCache/img/del.png\" title=\"'.L_DELETE.'\" alt=\"del\" /></a><b style=\"color:'.($ts < $expire?'red\" title=\"expired\">':'green\">').' <a title=\"'.$name[0].PHP_EOL.$name[2].'\" target=\"_blank\" style=\"color:unset;\" href=\"'.PLX_ROOT.'cache/'.$name[0].'\">'.date('Y-m-d H:i:s',$ts).'<i class=\"mc-sml-hide\"> : '.$name[0].'</i></a></b> : <a title=\"'.real(2,$name[2]).PHP_EOL.real(1,$name[2]).'\" target=\"_blank\" href=\"'.PLX_ROOT.real(1,$name[2]).'\">'.$name[1].'</a><br />';\n\t\techo '<br /></pre>';\n\t}", "private function getRoutesToReplace()\n {\n return [\n 'contactus_page' => 'web_contactus',\n 'promotion_homepage' => 'deal_homepage',\n 'web_terms' => '/' . $this->container->getParameter('alias_terms_url_divisor'),\n 'web_privacy' => '/' . $this->container->getParameter('alias_privacy_url_divisor'),\n 'web_sitemap' => '/' . $this->container->getParameter('alias_sitemap_url_divisor')\n ];\n }", "function collect() {\n $dispatcher = $this->di['dispatcher'];\n\t\t$router = $this->di['router'];\n\t\t$route = $router->getMatchedRoute();\n\t\tif ( !$route) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$uri = $route->getPattern();\n\t\t$paths = $route->getPaths();\n\t\t$result['uri'] = $uri ?: '-';\n\t\t$result['paths'] = $this->formatVar( $paths);\n\t\tif ( $params = $router->getParams()) {\n\t\t\t$result['params'] = $this->formatVar($params);\n\t\t}\n\t\t$result['HttpMethods'] = $route->getHttpMethods();\n\t\t$result['RouteName'] = $route->getName();\n\t\t$result['hostname'] = $route->getHostname();\n\t\tif ( $this->di->has('app') && ($app=$this->di['app']) instanceof Micro ) {\n\t\t\tif ( ($handler=$app->getActiveHandler()) instanceof \\Closure || is_string($handler) ) {\n\t\t\t\t$reflector = new \\ReflectionFunction($handler);\n\t\t\t}elseif(is_array($handler)){\n\t\t\t\t$reflector = new \\ReflectionMethod($handler[0], $handler[1]);\n\t\t\t}\n\t\t}else{\n\t\t\t$result['Moudle']=$router->getModuleName();\n\t\t\t$result['Controller'] = $dispatcher->getActiveController() != null ? get_class( $controller_instance = $dispatcher->getActiveController()) : $controller_instance =\"\";\n\t\t\t$result['Action'] = $dispatcher->getActiveMethod();\n\t\t\t$reflector = new \\ReflectionMethod($controller_instance, $result['Action']);\n\t\t}\n\n\t\tif (isset($reflector)) {\n\t\t\t$start = $reflector->getStartLine()-1;\n\t\t\t$stop = $reflector->getEndLine();\n\t\t\t$filename = substr($reflector->getFileName(),mb_strlen(realpath(dirname($_SERVER['DOCUMENT_ROOT']))));\n\t\t\t$code = array_slice( file($reflector->getFileName()),$start, $stop-$start );\n\t\t\t$result['file'] = $filename . ':' . $reflector->getStartLine() . '-' . $reflector->getEndLine() . \" [CODE]: \\n\". implode(\"\",$code);\n\t\t}\n\n\t\treturn array_filter($result);\n\t}", "function cmshowcase_flush_rules(){\n flush_rewrite_rules();\n }", "protected function getRuntimeCache() {}", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "protected function register_rewrite_rules() {\n\t\tif ( ! empty( $this->rules ) ) {\n\t\t\tforeach ( $this->rules as $value ) {\n\t\t\t\tadd_rewrite_rule( $value['regex'], $value['replace'], $value['type'] );\n\t\t\t}\n\t\t}\n\t}", "protected function getResourcePath()\n {\n return preg_replace('/\\?.*$/', '?kizilare_debug=1&res=', $_SERVER['REQUEST_URI']);\n }", "public static function add_rewrite_rule()\n {\n }", "function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}", "public static function addModRewriteConfig()\n {\n try {\n $apache_modules = \\WP_CLI_CONFIG::get('apache_modules');\n } catch (\\Exception $e) {\n $apache_modules = array();\n }\n if ( ! in_array(\"mod_rewrite\", $apache_modules)) {\n $apache_modules[] = \"mod_rewrite\";\n $wp_cli_config = new \\WP_CLI_CONFIG('global');\n $current_config = $wp_cli_config->load_config_file();\n $current_config['apache_modules'] = $apache_modules;\n $wp_cli_config->save_config_file($current_config);\n sleep(2);\n }\n }", "function al3_flush_rewrite_rules_events() {\n\tflush_rewrite_rules();\n}", "function modify_rewrites() {\n\tadd_rewrite_rule( '^search/?$', 'index.php?s=', 'top' );\n\tadd_rewrite_rule( '^search/page/?([0-9]{1,})/?$', 'index.php?s=&paged=$matches[1]', 'top' );\n}", "abstract function cache_output();" ]
[ "0.6464985", "0.62512195", "0.6050162", "0.58340245", "0.57476276", "0.56199217", "0.5580024", "0.5564949", "0.55278873", "0.5521026", "0.54510957", "0.5406657", "0.54015404", "0.5366553", "0.5360821", "0.53552175", "0.5318952", "0.53100926", "0.529334", "0.5262394", "0.5256088", "0.52494234", "0.52391684", "0.5213958", "0.51900584", "0.51515853", "0.5125853", "0.5120892", "0.512044", "0.50685114", "0.5064047", "0.50411826", "0.5031829", "0.5001522", "0.4987025", "0.4971239", "0.49571216", "0.4954078", "0.49525237", "0.4906514", "0.49010888", "0.49008015", "0.4899925", "0.48759365", "0.48695987", "0.4864314", "0.4863281", "0.48594287", "0.48265976", "0.4823171", "0.48027927", "0.47969937", "0.47964606", "0.47926366", "0.47900414", "0.47872448", "0.47779217", "0.47732025", "0.47164905", "0.4697216", "0.46943033", "0.46881923", "0.46795267", "0.4677413", "0.4677413", "0.46748582", "0.4674549", "0.4673851", "0.46715266", "0.4662271", "0.46607146", "0.4659744", "0.4655294", "0.46516922", "0.46480936", "0.4646552", "0.46376446", "0.4623241", "0.46172795", "0.46105406", "0.4602463", "0.4599191", "0.45983654", "0.45973045", "0.45928", "0.4585728", "0.45728624", "0.45699802", "0.4567807", "0.45627922", "0.45626518", "0.45547447", "0.45494646", "0.454898", "0.4537752", "0.45377058", "0.45369563", "0.45354542", "0.45312512", "0.4529316" ]
0.58238393
4
Get rewrites in xml
public function getXmlClassRewrites() { $cache = Mage::app()->loadCache(self::CACHE_KEY_XML); if ($this->useCache() && $cache) { $result = unserialize($cache); } else { $classRewrites = array(); $modules = $this->_getAllModules(); foreach ($modules as $modName => $module) { if ($this->_skipValidation($modName, $module)) { continue; } $result = $this->_getRewritesInModule($modName); if (!empty($result)) { $classRewrites[] = $result; } } $result = $this->_getClassMethodRewrites($classRewrites); if ($this->useCache()) { Mage::app()->saveCache(serialize($result), self::CACHE_KEY_XML, array(self::CACHE_TYPE)); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rewrite_xmlsitemap_d4seo( $rewrites ) {\n\n\t\t$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$'] = 'index.php?xmlsitemap=1&xmlurl=$matches[2]';\n\t\t#$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml\\.gz$'] = 'index.php?xmlsitemap=1params=$matches[2];zip=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html$' => 'index.php?xmlsitemap=1params=$matches[2];html=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html.gz$' => 'index.php?xmlsitemap=1params=$matches[2];html=true;zip=true';\n\t\treturn $rewrites;\n\n\t}", "public function register_rewrites()\n {\n }", "public function action_init_register_rewrites() {\n add_rewrite_endpoint( 'ics', EP_PERMALINK );\n }", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t\t\n\t\t// If we want to turn the rewrite engine on, add the statement\n\t\tif($this->includeTurnOnEngine){\n\t\t\t$this->appendTurnOnEngine();\n\t\t}\n\t\t\n\t\t// Are there actually URLs to rewrite?\n\t\tif(!empty($this->urls)){\n\t\t\t\n\t\t\t// Loop through the URLs\n\t\t\tforeach($this->urls as $source => $destination){\n\t\t\t\t\n\t\t\t\t// Check for query strings, as RewriteRule will ignore them\n\t\t\t\t$queryStringPos = strpos($source, '?');\n\t\t\t\t\n\t\t\t\t// URL has a query string\n\t\t\t\tif($queryStringPos !== FALSE){\n\t\t\t\t\t\n\t\t\t\t\t// Grab the query string\n\t\t\t\t\t$queryString = substr($source, $queryStringPos + 1);\n\t\t\t\t\t\n\t\t\t\t\t// If there wasn't just a lone ? in the URL\n\t\t\t\t\tif($queryString != ''){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add a RewriteCond for this query string\n\t\t\t\t\t\t$this->buildRewriteCondition('QUERY_STRING', $queryString);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// RewriteRule matches on the request URI without query strings, so remove the query string\n\t\t\t\t\t$source = substr($source, 0, $queryStringPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add a RewriteRule for this source / destination\n\t\t\t\t$this->buildRewriteRule($source, $destination);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we are adding the check for mod_rewrite.c add the closing tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckEnd();\n\t\t}\n\t\t\n\t\t// Return our rewrites\n\t\treturn $this->rewrites;\n\t}", "function eman_add_rewrites( $content )\n\t{\n\t\tglobal $wp_rewrite;\n\t\t$new_non_wp_rules = array(\n\t\t\t'assets/(.*)' => THEME_PATH . '/assets/$1',\n\t\t\t'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'\n\t\t);\n\t\t$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);\n\t\treturn $content;\n\t}", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "function rewrite_rules_xmlsitemap_d4seo() {\n\t\tadd_rewrite_rule('sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$', 'index.php?xmlsitemap=1&xmlurl=$matches[2]', 'top');\n\t\tadd_rewrite_tag('%xmlurl%', '([^&]+)');\n\t}", "function rest_api_register_rewrites()\n {\n }", "public function rewriteXML()\n\t{\n if( $this->isDynamic() )\n derr('unsupported');\n\n\t\tif( $this->owner->owner->version >= 60 )\n\t\t\tDH::Hosts_to_xmlDom($this->membersRoot, $this->members, 'member', false);\n\t\telse\n\t\t\tDH::Hosts_to_xmlDom($this->xmlroot, $this->members, 'member', false);\n\n\t}", "function humcore_add_rewrite_tag() {\n\n\tadd_rewrite_tag( '%deposits_item%', '([^/]*)' );\n\tadd_rewrite_tag( '%deposits_datastream%', '([^/]*)' );\n\tadd_rewrite_tag( '%deposits_filename%', '([^/]*)' );\n\tadd_rewrite_tag( '%deposits_command%', '([^/]*)' );\n\tadd_rewrite_tag( '%facets%', '([^&]*)' );\n\n}", "public function rewrite();", "protected function register_rewrite_tags() {\n\t\tif ( ! empty( $this->tags ) ) {\n\t\t\tforeach ( $this->tags as $param => $value ) {\n\t\t\t\tadd_rewrite_tag( $param, $value );\n\t\t\t}\n\t\t}\n\t}", "private function genSitemapXML() {\n $url_same = array();\n $sitemap_xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n <!-- created by CSZ CMS Sitemap Generator www.cszcms.com -->'.\"\\n\";\n $sitemap_xml.= '<url>\n\t<loc>'.base_url().'</loc>\n\t<changefreq>always</changefreq>\n </url>'.\"\\n\";\n if($this->lang !== FALSE){ /* Language */\n foreach ($this->lang as $row) {\n $url = $this->Csz_model->base_link().'/lang/'.$row['lang_iso'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->menu_other !== FALSE){ /* Navigation */\n foreach ($this->menu_other as $row) {\n $chkotherlink = strpos($row['other_link'], BASE_URL);\n if($row['pages_id'] && $row['pages_id'] != NULL && $row['pages_id'] != 0){\n $pages = $this->Csz_model->getValue('page_url', 'pages', \"active = '1' AND pages_id = '\".$row['pages_id'].\"'\", '', 1, 'page_url', 'ASC'); \n if($row['drop_page_menu_id'] != 0 && $row['drop_page_menu_id'] != NULL){\n $main = $this->Csz_model->getValue('menu_name', 'page_menu', \"active = '1' AND page_menu_id = '\".$row['drop_page_menu_id'].\"'\", '', 1, 'menu_name', 'ASC'); \n $url = $this->Csz_model->base_link().'/'.$this->Csz_model->rw_link($main->menu_name).'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }else{\n $url = $this->Csz_model->base_link().'/'.$pages->page_url;\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }else if($row['other_link'] && $row['other_link'] != NULL && $chkotherlink !== FALSE){ \n if(!in_array($row['other_link'], $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$row['other_link'].'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $row['other_link'];\n }\n }else if($row['plugin_menu'] && $row['plugin_menu'] != NULL){\n $url = $this->Csz_model->base_link().'/plugin/'.$row['plugin_menu'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n if($this->pages_content !== FALSE){ /* Pages Content without navigation */\n foreach ($this->pages_content as $row) {\n $url = $this->Csz_model->base_link().'/'.$row['page_url'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n if($this->plugin !== FALSE){ /* Plugin with sitemap config */\n foreach ($this->plugin as $row) {\n $plugin_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_viewtable');\n if(!empty($plugin_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_condition'), '', 0, $plugin_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/view/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n if($row['plugin_config_filename'] == 'article'){\n $urlamp = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/amp/'.$rs[$plugin_db.'_id'].'/'.$rs['url_rewrite'];\n if(!in_array($urlamp, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$urlamp.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $urlamp;\n }\n }\n }\n }\n }\n $plugin_cat_db = $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sitemap_cattable');\n if(!empty($plugin_cat_db)){\n $plugindata = $this->Csz_model->getValueArray('*', $plugin_cat_db, $this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_sqlextra_catcondition'), '', 0, $plugin_cat_db.'_id', 'DESC');\n if($plugindata !== FALSE){\n foreach ($plugindata as $rs) {\n $url = $this->Csz_model->base_link().'/plugin/'.$this->Csz_model->getPluginConfig($row['plugin_config_filename'], 'plugin_urlrewrite').'/category/'.$rs['url_rewrite'];\n if(!in_array($url, $url_same)){\n $sitemap_xml.= '<url>\n <loc>'.$url.'</loc>\n <changefreq>always</changefreq>\n </url>'.\"\\n\";\n $url_same[] = $url;\n }\n }\n }\n }\n } \n }\n $sitemap_xml.= '</urlset>'.\"\\n\";\n if($sitemap_xml){\n /* Gen sitemap.xml */\n $file_path = FCPATH.\"sitemap.xml\";\n $fopen = fopen($file_path, 'wb') or die(\"can't open file\");\n fwrite($fopen, $sitemap_xml);\n fclose($fopen);\n /* Gen sitemap.xml.gz */\n $gzdata = @gzencode($sitemap_xml, 9);\n if($gzdata !== FALSE){\n $fopen1 = fopen(FCPATH.\"sitemap.xml.gz\", 'wb') or die(\"can't open file\");\n fwrite($fopen1, $gzdata);\n fclose($fopen1);\n }\n\t}\n }", "public function getRewritten()\n {\n return $this->rewritten;\n }", "public function add_rewrite_tags() {\n\t\tadd_rewrite_tag( '%' . $this->user_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->user_comments_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_rates_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_to_rate_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->user_talks_rid . '%', '([1]{1,})' );\n\t\tadd_rewrite_tag( '%' . $this->cpage_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->action_rid . '%', '([^/]+)' );\n\t\tadd_rewrite_tag( '%' . $this->search_rid . '%', '([^/]+)' );\n\t}", "public function modifyXML() {\n\t\t$str = \"<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'\\n\" .\n\t\t\t\t\"xmlns:apps='http://schemas.google.com/apps/2006'>\\n\";\n\t\tforeach($this -> changes as $name => $value) {\n\t\t\t$str .= \"<apps:property name=\\\"\" . ProvisioningApi::escapeXML_Attr($name) . \"\\\" value=\\\"\".ProvisioningApi::escapeXML_Attr($value).\"\\\"/>\\n\";\n\t\t}\n\t\treturn $str . \"</atom:entry>\\n\";\n\t}", "function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}", "function wpbp_add_rewrites($content) {\n global $wp_rewrite;\n $llama_new_non_wp_rules = array(\n \t// icons for home screen and bookmarks\n\t 'assets/icons/(.*)' => THEME_PATH . '/assets/icons/$1',\n \t'favicon.ico' => 'assets/icons/favicon.ico',\n \t'apple-touch(.*).png' => 'assets/icons/apple-touch$1.png',\n\n \t// other rules\n\t 'assets/wpbp-assets/(.*)' => THEME_PATH . '/assets/wpbp-assets/$1',\n '(.*)\\.[\\d]+\\.(css|js)$'\t=> '$1.$2 [L]',\n '(.*)\\.[\\d]+\\.(js)$' => '/$1.$2 [QSA,L]',\n '(.*)\\.[\\d]+\\.(css)$' => '$1.$2 [L]'\n );\n $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $llama_new_non_wp_rules);\n return $content;\n}", "private function _show_generated_cache_rewrite_rules()\n\t{\n\n\t\t/* $output = '<strong>' */\n\t\t/* \t. __('Please update the cache directory config file <code>%s</code> ' */\n\t\t/* \t. 'manually using auto-generated contents as shown below. ' */\n\t\t/* \t. 'It is highly recommended that you paste the contents ' */\n\t\t/* \t. 'at the top of the server config file. ' */\n\t\t/* \t. 'If config file does not exist, you must first create it.', $this->domain) */\n\t\t/* \t. '</strong>'; */\n\n\t\t/* $output = sprintf($output, $this->rewriter->get_cache_config_file()); */\n\n\t\t/* $output .= '<br /><br />'; */\n\t\t/* $output .= '<textarea class=\"code\" rows=\"8\" cols=\"90\" readonly=\"readonly\">' */\n\t\t/* \t. $rules . '</textarea>'; */\n\n\t\t/* return $output; */\n\t}", "public function rewriteRules()\n {\n add_rewrite_rule('janrain/(.*?)/?$', 'index.php?janrain=$matches[1]', 'top');\n add_rewrite_tag('%janrain%', '([^&]+)');\n }", "public function _retrieve()\n {\n $this->log($this->getRequest()->getParams());\n $classInfoNodeList = Mage::getConfig()->getNode()->xpath(\n '//global//rewrite/..'\n );\n $outItems = array();\n\n foreach ($classInfoNodeList as $classInfoNode) {\n $rewrite = $classInfoNode->xpath('rewrite');\n if (is_array($rewrite) && sizeof($rewrite) > 0) {\n $keys = array_keys($rewrite[0]->asArray());\n $classSuffix = $keys[0];\n $rewriteClass = (string)$classInfoNode->rewrite->$classSuffix;\n $className = $classInfoNode->class . '_' . uc_words(\n $classSuffix,\n '_'\n );\n $outItem = array(\n 'original' => $className,\n 'rewriter' => $rewriteClass\n );\n $outItems[] = $outItem;\n }\n }\n $this->log($outItems);\n return $outItems;\n }", "function humcore_add_rewrite_rule() {\n\n\tadd_rewrite_rule(\n\t\t'(deposits/item)/([^/]+)(/(review))?/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_command=$matches[4]',\n\t\t'top'\n\t);\n\n\tadd_rewrite_rule(\n\t\t'(deposits/download)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n\t// Rewrite for deposits/objects handled as ngix proxy pass.\n\n\tadd_rewrite_rule(\n\t\t'(deposits/view)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n add_rewrite_rule(\n '(deposits/list)/?$',\n 'index.php?pagename=$matches[1]',\n 'top'\n );\n\n}", "function createBasepathXML() {\n\t\n $file_modified_time = date('Y-m-d',mktime());\n\t\n\t$xml = \"<url>\";\n $xml .= \" <loc>\".SITE_PATH.\"</loc>\";\n $xml .= \" <lastmod>$file_modified_time</lastmod>\";\n $xml .= \" <changefreq>monthly</changefreq>\";\n $xml .= \" <priority>1.0</priority>\";\n\t$xml .= \"</url>\";\n\t\n\treturn $xml;\n\t\n }", "function nesia_flush_rewriterules () {\r\r\n\tflush_rewrite_rules();\r\r\n}", "public function rewriteEndpoint (){\n add_rewrite_endpoint( 'agreementArchiveId', EP_ALL );\n add_rewrite_endpoint( 'searchAgreementArchive', EP_ALL );\n\n flush_rewrite_rules();\n }", "function save_mod_rewrite_rules()\n {\n }", "function wpbp_flush_rewrites()\n {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n }", "function iis7_save_url_rewrite_rules()\n {\n }", "public function rewriteEndpoints()\n {\n $this->addEndpoints();\n flush_rewrite_rules();\n }", "function refresh_rewrite_rules() {\n\tflush_rewrite_rules();\n\tdo_action( 'rri_flush_rules' );\n}", "function dump_rewrite_rules_to_file()\n{\n $images_url = \\DB::connection('mysql')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $videos_url = \\DB::connection('mysqlVideo')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $content = $images_url\n ->merge($videos_url)\n ->pipe(function ($collection) {\n return implode(\"\\n\", $collection->toArray());\n });\n\n file_put_contents(public_path('nginx.conf'), $content);\n devops_reload_nginx();\n return true;\n}", "private static function xml_route(){\n\t\t\n\t\t$xml_routes=new Parser();\n\t\t$xml_routes->load_from_file('routes.xml');\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$routes=$xml_routes->getElementsByAttributeValue('method', Request::get_request_type());\n\t\t\n\t\t$str_routes=\"\";\n\t\t$found_route=null;\n\t\tforeach ($routes as $item){\n\t\t\t\n\t\t\tif($item->nodeType==XML_ELEMENT_NODE){\n\t\t\t\tforeach($item->childNodes as $attr){\n\t\t\t\t\t\n\t\t \tif($attr->nodeType==XML_ELEMENT_NODE){\n\t\t \n\t\t \t\tif($attr->tagName==\"request\"){\n\t\t \t\t\tif($item->getAttribute('method')==$_SERVER['REQUEST_METHOD']){\n\t\t \t\t\t\t$match_route=$item->cloneNode(true);\n\t\t \t\t\t\t//print \"{$match_route->getElementsByTagName('request')->item(0)->nodeValue}\\n\";\n\t\t \t\t\t\t\n\t\t \t\t\t\t$controller=$match_route->getElementsByTagName('controller')->item(0)->nodeValue;\n\t\t \t\t\t\t$action=$match_route->getElementsByTagName('action')->item(0)->nodeValue;\n\t\t \t\t\t\t\n\t\t \t\t\t\t$match=str_ireplace('/','\\\\/',$match_route->getElementsByTagName('request')->item(0)->nodeValue);\n\t\t \t\t\t\t//$match.=\"(\\\\/(.*))?\";\n\t\t \t\t\t\t$match='/^'.$match.'$/';\n\t\t \t\t\t\t$replace=\"/$controller/$action\";\n\t\t \t\t\t\tif($match_route->getAttribute('args')==true){\n\t\t \t\t\t\t\t$number_args=($match_route->getAttribute('argsnum')!==null)?$match_route->getAttribute('argsnum'):1;\n\t\t \t\t\t\t\tfor($i=1;$i<=$number_args;$i++)\n\t\t \t\t\t\t\t$replace.=\"/$\".$i;\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(preg_match($match, $request)){\n\t\t \t\t\t\t\t$request=preg_replace($match,$replace,$request);\n\t\t \t\t\t\t\t$found_route=$item->cloneNode(true);\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t//print \"Found\\n\";\n\t\t \t\t\t\t\tbreak;\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t\t\t}\n\t\t }\n\t\t if($found_route!==null){\n\t\t \tbreak;\n\t\t }\n\t\t}\n\t\t\n\t\treturn $request;\n\t}", "function admin_generate(){\n\t\t$fp = fopen('files/sitemap.xml', 'w+');\n\n\t$start_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/</loc>\n \t\t<changefreq>daily</changefreq>\n \t\t<priority>1</priority>\n\t</url>';\n\n\t\tfwrite($fp, $start_string);\n\n\t\t// projdu vsechny produkty\n\t\tApp::import('Model', 'Product');\n\t\t$this->Sitemap->Product = new Product;\n\t\t\n\t\t$this->Sitemap->Product->recursive = -1;\n\t\t$products = $this->Sitemap->Product->find('all', array('fields' => array('Product.url', 'Product.modified')));\n\n\t\tforeach ( $products as $product ){\n\t\t\t// pripnout k sitemape\n\t\t\t$mod = explode(' ', $product['Product']['modified']);\n\t\t\t$mod = $mod[0];\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $product['Product']['url'] . '</loc>\n \t\t<lastmod>' . $mod . '</lastmod>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.9</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny kategorie\n\t\tApp::import('Model', 'Category');\n\t\t$this->Sitemap->Category = new Category;\n\t\t\n\t\t$this->Sitemap->Category->recursive = -1;\n\t\t$categories = $this->Sitemap->Category->find('all', array('fields' => array('Category.id', 'Category.url')));\n\n\t\t$skip = array(0 => '5', '25', '26', '53');\n\t\tforeach ( $categories as $category ){\n\t\t\tif ( in_array($category['Category']['id'], $skip) ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = date('Y-m-d');\n\n\t\t\t// pripnout k sitemape\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $category['Category']['url'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>'; \n\n\t\t\tfwrite($fp, $string);\n\t\t\t\n\t\t}\n\t\t\n\t\t// projdu vsechny vyrobce\n\t\tApp::import('Model', 'Manufacturer');\n\t\t$this->Sitemap->Manufacturer = new Manufacturer;\n\t\t\n\t\t$this->Sitemap->Manufacturer->recursive = -1;\n\t\t$manufacturers = $this->Sitemap->Manufacturer->find('all', array('fields' => array('Manufacturer.id', 'Manufacturer.name')));\n\t\t\n\t\tforeach ( $manufacturers as $manufacturer ){\n\t\t\t// pripnout k sitemape\n\t\t\t// vytvorim si url z name a id\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . strip_diacritic($manufacturer['Manufacturer']['name']) . '-v' . $manufacturer['Manufacturer']['id'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.8</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t// projdu vsechny obsahove stranky\n\t\tApp::import('Model', 'Content');\n\t\t$this->Sitemap->Content = new Content;\n\t\t\n\t\t$this->Sitemap->Content->recursive = -1;\n\t\t$contents = $this->Sitemap->Content->find('all', array('fields' => array('Content.path')));\n\t\t\n\t\tforeach ( $contents as $content ){\n\t\t\t// pripnout k sitemape\n\t\t\tif ( $content['Content']['path'] == 'index' ){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = '\n\t<url>\n \t\t<loc>http://www.' . CUST_ROOT . '/' . $content['Content']['path'] . '</loc>\n \t\t<changefreq>weekly</changefreq>\n \t\t<priority>0.7</priority>\n\t</url>';\n\t\t\tfwrite($fp, $string);\n\t\t}\n\t\t\n\t\t$end_string = '\n</urlset>';\n\t\tfwrite($fp, $end_string);\n\t\tfclose($fp);\n\t\t// uzavrit soubor\n\t\tdie('here');\n\t}", "function _fly_transform($new_source) {\n $tempFilename = tempnam(\"/tmp\", \"MODS_xml_initial_\");\n $data = str_replace(\n array('{|', '|}', '}', '{'), \n array('?', '?', '>', '<'), '{{|xml version=\"1.0\" |}}\n{xsl:stylesheet version=\"1.0\"\n xmlns:mods=\"http://www.loc.gov/mods/v3\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"}\n {xsl:template match=\"/ | @* | node()\"}\n {xsl:copy}\n {xsl:apply-templates select=\"@* | node()\" /}\n {/xsl:copy}\n {/xsl:template}\n {xsl:template match=\"/mods:mods/mods:relatedItem[@type=\\'host\\']/mods:titleInfo\"}{mods:titleInfo}{mods:title}' . $new_source . '{/mods:title}{/mods:titleInfo}{/xsl:template}\n{/xsl:stylesheet}');\n\n file_put_contents($tempFilename, $data);\n return $tempFilename;\n}", "function cu_rewrite_activation() {\n\tcu_rewrite_add_rewrites();\n\tflush_rewrite_rules();\n}", "public function wp_rewrite_rules()\n {\n }", "function roots_flush_rewrites() {\n\nif(of_get_option('flush_htaccess', false) == 1 || get_transient(\"was_flushed\") === false) {\n\t\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->flush_rules();\n\t\n\t\tset_transient(\"was_flushed\", true, 60 * 60 * 24 * 7 );\n\t}\n}", "public function page_rewrite_rules()\n {\n }", "function rad_rewrite_flush(){\n\trad_setup_products(); //the function above that set up the CPT\n\tflush_rewrite_rules(); //re-builds the .htaccess rules\n}", "public function add_rewrite_rules()\n {\n }", "public function add_rewrite_rules()\n {\n }", "function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}", "public function getSitemapXml()\n {\n $this->addLine('<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">');\n\n $this->generateLinks();\n $this->generateCollections();\n\n $this->addLine('</urlset>');\n\n $output = implode('', $this->lines);\n\n return $output;\n }", "private function _preprocessDocument()\n {\n $xml = $this->getDocument();\n $xml = preg_replace('/<w:bookmarkStart w:id=\"[0-9]\" w:name=\"([0-9 A-Z _]*)\"/',\n self::$_templateSymbol . '${1}' . self::$_templateSymbol, $xml);\n return $xml;\n }", "public function generateSassRulesXml() {\r\n if (GEAR_DEV) {\r\n require_once 'classes/FrontStyle.php';\r\n $fs = FrontStyle::getInstance();\r\n $fs->mapRulesFromDir(_PS_THEME_DIR_.'sass/', GEAR_SASS_RULES);\r\n }\r\n }", "function wpfc_sermon_podcast_feed_rewrite($wp_rewrite) {\n\t$feed_rules = array(\n\t\t'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),\n\t\t'(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)\n\t);\n\t$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;\n}", "public function getXml() {}", "public function build_xml_map() {\n $this->_create_map();\n header(\"content-type: text/xml\");\n echo $this->result;\n }", "public function mod_rewrite_rules()\n {\n }", "public function getDocStructure()\n {\n\n $xml_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n $xml_string .= '</urlset>';\n\n return $xml_string;\n\n }", "function ex_theme_terlet() {\n \tflush_rewrite_rules();\n }", "function modify_rewrites() {\n\tadd_rewrite_rule( '^search/?$', 'index.php?s=', 'top' );\n\tadd_rewrite_rule( '^search/page/?([0-9]{1,})/?$', 'index.php?s=&paged=$matches[1]', 'top' );\n}", "function got_url_rewrite()\n {\n }", "private function generateXml()\n {\n\n $args = array(\n\n 'posts_per_page' => -1,\n 'numberposts' => -1,\n 'orderby' => 'post_type',\n 'order' => 'DESC',\n 'post_type' => apply_filters('fpcms_sitemap_post_types', array('post', 'page'))\n\n );\n\n if ($results = get_posts($args)) {\n\n $sitemap = new \\SimpleXMLElement($this->getDocStructure());\n\n foreach ($results as $result) {\n\n $url = $sitemap->addChild('url');\n $url->addChild('loc', get_permalink($result->ID));\n\n if (has_post_thumbnail($result->ID)) {\n\n if ($image = wp_get_attachment_image_src(get_post_thumbnail_id($result->ID))) {\n $url->addChild('image:image', $image[0]);\n }\n\n }\n\n $url->addChild('lastmod', mysql2date('Y-m-d', $result->post_date_gmt));\n\n if ($result->post_type == 'page') {\n\n //Pages should display higher than posts for the same keyword\n $url->addChild('priority', apply_filters('fpcms_sitemap_page_priority', '0.7'));\n\n } else {\n\n $url->addChild('priority', apply_filters('fpcms_sitemap_post_priority', '0.4'));\n\n }\n\n }\n\n return $sitemap->asXML();\n\n }\n\n }", "public function generateXmlFiles()\n\t{\n\t\t// Sitemaps\n\t\t$this->generateSitemap();\n\n\t\t// HOOK: add custom jobs\n\t\tif (isset($GLOBALS['TL_HOOKS']['generateXmlFiles']) && is_array($GLOBALS['TL_HOOKS']['generateXmlFiles']))\n\t\t{\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['generateXmlFiles'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$this->{$callback[0]}->{$callback[1]}();\n\t\t\t}\n\t\t}\n\n\t\t// Also empty the page cache so there are no links to deleted files\n\t\t$this->purgePageCache();\n\n\t\t// Add a log entry\n\t\t$this->log('Regenerated the XML files', __METHOD__, TL_CRON);\n\t}", "function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "public function add_rewrite_rules() {\n add_rewrite_tag('%salesforce-login%', '([^&]+)');\n add_rewrite_rule('salesforce-login/?$', 'index.php?salesforce-login=salesforce-login', 'top');\n\n add_rewrite_tag('%salesforce-callback%', '([^&]+)');\n add_rewrite_rule('salesforce-callback/?$', 'index.php?salesforce-callback=salesforce-callback', 'top');\n }", "function generateRewriteRules($config)\n {\n // generate mod-rewrite htaccess rules\n $rewrite = array($this->beginMarker);\n if( $config->htaccess_no_indexes ) {\n $rewrite[] = \"\\n# Don't allow directory browsing (for images / thumbs / etc)\";\n $rewrite[] = \"Options -Indexes\\n\\n\";\n }\n if( !$config->hotlink_thumbnails || !$config->hotlink_images || $config->rewrite_old_urls \n \t\t|| $config->monitor_thumbnail_bandwidth || $config->monitor_image_bandwidth \n || $config->rewrite_urls) {\n $rewrite[] = \"<ifModule mod_rewrite.c>\";\n $rewrite[] = \"Options +FollowSymLinks\";\n \t$rewrite[] = \"RewriteEngine On\";\n if( $config->rewrite_old_urls ) {\n $rewrite[] = $this->rewriteOldURLs();\n }\n $rewrite[] = $this->getImageBandwidthRules($config);\n $rewrite[] = $this->getImageHotlinkRules($config);\n $rewrite[] = $this->getThumbnailHotlinkRules($config);\n $rewrite[] = $this->getThumbnailBandwidthRules($config);\n $rewrite[] = $this->getURLRewriteRules($config);\n $rewrite[] = \"</ifModule>\";\n }\n $rewrite[] = $this->endMarker.\"\\n\\n\";\n return join(\"\\n\", $rewrite);\n }", "public function on_cap_xsl_get_xmlfiles ()\n {\n return $this->xmlfiles;\n }", "protected function buildRoutes()\n {\n $routes = array();\n \n foreach (glob($this->dir.'*.xml') as $file) {\n $xml = simplexml_load_file($file);\n \n $attr = $xml -> attributes();\n $actionsNS = isset($attr['namespace']) ? $attr['namespace'].'\\\\' : '';\n $module = isset($attr['module']) ? $attr['module'].'/' : '';\n \n foreach ($xml->children() as $tag) {\n $id = (string) $tag['id'];\n $method = (string) $tag['method'];\n $pattern = (string) $tag -> url;\n $action = (string) $tag -> action;\n \n $params = [];\n \n if (isset($tag -> params)) {\n foreach ($tag -> params -> children() as $param) {\n $arr = (array) $param -> attributes();\n $arr = $arr['@attributes'];\n \n if (isset($arr['required'])) {\n $arr['required'] = $arr['required'] == 'true' ? true : false;\n }\n \n $params[$arr['name']] = $arr;\n }\n }\n \n if (isset($routes[$module.$id])) {\n throw new \\RuntimeException('Duplicated Route ID: '.$module.$id.' in '.$file.'!');\n }\n \n $routes[$module.$id] = new PatternRoute(\n $this->getActionClass($action, $actionsNS, $id),\n strtoupper($method),\n $pattern,\n $params\n );\n }\n }\n \n return $routes;\n }", "protected function register_rewrite_rules() {\n\t\tif ( ! empty( $this->rules ) ) {\n\t\t\tforeach ( $this->rules as $value ) {\n\t\t\t\tadd_rewrite_rule( $value['regex'], $value['replace'], $value['type'] );\n\t\t\t}\n\t\t}\n\t}", "function wpgrade_gets_active() {\r\n flush_rewrite_rules();\r\n}", "function fs_rewrite_flush() {\r\n\tflush_rewrite_rules();\r\n}", "function cc_rewrite_request_uri_notify() {\n\n\tglobal $cc_orginal_request_uri;\n\n\tif ( isset($_GET['roflcopter']) ) {\n\t\techo \"<!-- CC Permalink Mapper was here: $cc_orginal_request_uri -> {$_SERVER['REQUEST_URI']} -->\\n\";\n\t}\n\n\treturn true;\n\n}", "public function getRedirectData()\n {\n return ['strRqXML' => Helper::array2xml(['MERCHANTXML' => $this->data])];\n }", "function xml_management($files, $prepinace, &$xml, $k, $n){\n foreach ($files as $file){\n $functions = file_content($file); // z kazdeho suboru odstranime nepotrebne informacie a rozparsujeme pre nasu potrebu\n if ($functions != NULL){ //ak v tom subore nejaka definicia/deklaracia funkcie bola: \n $array_nodupl = array();\n for($i = 0; $i < count($functions[0]); $i++){ //pre vsetky funkcie\n $functions[3][$i] = preg_replace('/[\\.\\.\\.]/','',$functions[3][$i],-1,$count); //zistovanie premenneho poctu argumentov\n if ($count){\n $var_args = \"yes\";\n } \t \t\n else{\n $var_args = \"no\";\n }\n \n if($prepinace[\"no-inline\"]){ //nezahrnutie funkcii s modifikatorom inline\n if(preg_match('/inline/u',$functions[1][$i]))\n\t continue; \n } \n \n \n if ($prepinace[\"removeWhitespaces\"]) //odstranenie prebytocnych bielych znakov uprostred navratoveho typu\n {\n $patterns = array(\"/\\s+/\", \"/\\s+\\*/\", \"/\\*\\s+/\");\n $replacements = array(\" \", \"*\", \"*\");\n $functions[1][$i] = preg_replace($patterns, $replacements, $functions[1][$i]);\n }\n \n /*\n V pripade udania parametru noDuplicates si vytvorime pomocne pole array_nodupl, \n do ktoreho postupne pridavame len funkcie, ktore tam este nie su obsiahnute.\n */\n if($prepinace[\"noDuplicates\"]){ \n if(!in_array($functions[2][$i], $array_nodupl)){\n array_push($array_dupl, $functions[2][$i]);\n }\n else{\n continue;\n }\n }\n \n $functions[1][$i] = trim($functions[1][$i]); //odstranenie prebytocnych bielych znakov\n \n /*volanie funkcie, ktora do premennej xml prida potrebny text na tlac xml suboru*/\n\t xml_inside_function($file, $functions[1][$i], $functions[2][$i],$functions[3][$i], $var_args, $xml, $prepinace, $k, $n); \n \n } \n }\n \n }\n\n}", "public function get_rewrite_rules() {\n\t\treturn array(\n\t\t\t'archives/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/category/(.+?)/?$' => 'index.php?category_name=$matches[1]',\n\t\t\t'archives/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/?$' => 'index.php?tag=$matches[1]',\n\t\t\t'archives/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?post_format=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/type/([^/]+)/?$' => 'index.php?post_format=$matches[1]',\n\t\t\t'archives/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/author/([^/]+)/?$' => 'index.php?author_name=$matches[1]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/?$' => 'index.php?year=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)/trackback/?$' => 'index.php?p=$matches[1]&tb=1',\n\t\t\t'archives/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/page/?([0-9]{1,})/?$' => 'index.php?p=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/([0-9]+)/comment-page-([0-9]{1,})/?$' => 'index.php?p=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)(/[0-9]+)?/?$' => 'index.php?p=$matches[1]&page=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]'\n\t\t);\n\t}", "private function getRegEspressions()\r\n {\r\n \t//Si no se han cargado las expresesiones regulares se cargan\r\n \t\tstatic $expressions;\r\n \t\tif (!$expressions)\r\n \t\t\t$expressions = ZendExt_FastResponse::getXML('expresiones');\r\n \t\t\t//$expressions = simplexml_load_file('Aspect/xml/expressions.xml');\r\n \t\treturn $expressions;\r\n }", "function modify_xml($tempPages = '', $piecemakerId, $tempTransitions = ''){\n\t\n\t\t$old_xml = $this->get_xml($piecemakerId);\n\t\n\t\tif($tempTransitions == '')\n\t\t\t$tempTransitions = $this->xml_to_table($piecemakerId, 'transitions');\n\t\t\t\n\t\tif($tempPages == '')\n\t\t\t$tempPages = $this->xml_to_table($piecemakerId, 'pages');\n\t\t\n\t\t$xml = $this->create_xml($old_xml->Settings->attributes()->ImageWidth, $old_xml->Settings->attributes()->ImageHeight, $old_xml->Settings->attributes()->LoaderColor, $old_xml->Settings->attributes()->InnerSideColor, $old_xml->Settings->attributes()->Autoplay, $old_xml->Settings->attributes()->FieldOfView, $old_xml->Settings->attributes()->SideShadowAlpha, $old_xml->Settings->attributes()->DropShadowAlpha, $old_xml->Settings->attributes()->DropShadowDistance, $old_xml->Settings->attributes()->DropShadowScale, $old_xml->Settings->attributes()->DropShadowBlurX, $old_xml->Settings->attributes()->DropShadowBlurY, $old_xml->Settings->attributes()->MenuDistanceX, $old_xml->Settings->attributes()->MenuDistanceY, $old_xml->Settings->attributes()->MenuColor1, $old_xml->Settings->attributes()->MenuColor2, $old_xml->Settings->attributes()->MenuColor3, $old_xml->Settings->attributes()->ControlSize, $old_xml->Settings->attributes()->ControlDistance , $old_xml->Settings->attributes()->ControlColor1, $old_xml->Settings->attributes()->ControlColor2, $old_xml->Settings->attributes()->ControlAlpha, $old_xml->Settings->attributes()->ControlAlphaOver, $old_xml->Settings->attributes()->ControlsX, $old_xml->Settings->attributes()->ControlsY, $old_xml->Settings->attributes()->ControlsAlign, $old_xml->Settings->attributes()->TooltipHeight, $old_xml->Settings->attributes()->TooltipColor, $old_xml->Settings->attributes()->TooltipTextY, $old_xml->Settings->attributes()->TooltipTextStyle, $old_xml->Settings->attributes()->TooltipTextColor, $old_xml->Settings->attributes()->TooltipMarginLeft, $old_xml->Settings->attributes()->TooltipMarginRight, $old_xml->Settings->attributes()->TooltipTextSharpness, $old_xml->Settings->attributes()->TooltipTextThickness, $old_xml->Settings->attributes()->InfoWidth, $old_xml->Settings->attributes()->InfoBackground, $old_xml->Settings->attributes()->InfoBackgroundAlpha, $old_xml->Settings->attributes()->InfoMargin, $old_xml->Settings->attributes()->InfoSharpness, $old_xml->Settings->attributes()->InfoThickness, $tempPages['allPages'], $tempTransitions['transition']);\n\n $xml_file = $this->plugin_path.$this->books_dir.\"/\".$piecemakerId.\".xml\";\n $config_file = fopen($xml_file, \"w+\");\n fwrite($config_file, $xml);\n fclose($config_file);\n\t}", "private function buildRewriteFlags(){\n\t\tswitch($this->http301){\n\t\t\tcase false:\n\t\t\t\t$response = 'R';\n\t\t\t\tbreak;\n\t\t\tcase true:\n\t\t\tdefault:\n\t\t\t\t$response = 'R=301';\n\t\t}\n\t\treturn '[' . $response . ',L,NC]';\n\t}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "protected function documentRelationsXml() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t. '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\t\t. '<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>'\n\t\t. '<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>'\n\t\t. '<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>'\n\t\t. '</Relationships>'\n\t\t\t;\n\t}", "public function sitemapAction() {\n\t\t\n\t\t$urls = array(\n\t\t\t'/',\n\t\t\t'/contact',\n\t\t\t'/map'\n\t\t);\n\t\t\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region', array('id'))\n\t\t\t->order('name');\n\t\t$regions = $regionDb->fetchAll($select);\n\t\tforeach ($regions as $region) {\n\t\t\t$urls[] = $this->view->url(array(), 'search').'?region='.urlencode($region['id']);\n\t\t}\n\t\t\n\t\t// generate XML\n\t\t\n\t\t$xml = new DOMDocument('1.0', 'utf-8');\n\t\t\n\t\t$urlset = $xml->createElement('urlset');\n\t\t$urlset->setAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');\n\t\t$xml->appendChild($urlset);\n\t\t\n\t\tforeach ($urls as $url) {\n\t\t\t$loc = $xml->createElement('loc', 'http://'.$_SERVER['HTTP_HOST'].$url);\n\t\t\t$url = $xml->createElement('url');\n\t\t\t$url->appendChild($loc);\n\t\t\t$urlset->appendChild($url);\n\t\t}\n\t\t\n\t\t$this->getResponse()->setHeader('Content-Type', 'text/xml');\n\t\t$this->getResponse()->setBody($xml->saveXML(null, LIBXML_NOEMPTYTAG));\n\t\t$this->getResponse()->sendResponse();\n\t\tdie;\n\t\t/*\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\n xmlns:image=\"http://www.sitemaps.org/schemas/sitemap-image/1.1\"\n xmlns:video=\"http://www.sitemaps.org/schemas/sitemap-video/1.1\">\n <url> \n <loc>http://www.example.com/foo.html</loc> \n <image:image>\n <image:loc>http://example.com/image.jpg</image:loc> \n </image:image>\n <video:video> \n <video:content_loc>http://www.example.com/video123.flv</video:content_loc>\n <video:thumbnail_loc>http://www.example.com/thumbs/123.jpg</video:thumbnail_loc>\n <video:player_loc allow_embed=\"yes\" autoplay=\"ap=1\">http://www.example.com/videoplayer.swf?video=123</video:player_loc>\n <video:title>Grilling steaks for summer</video:title> \n <video:description>Get perfectly done steaks every time</video:description>\n </video:video>\n </url>\n</urlset>\n\t\t */\n\t}", "function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}", "protected function renderAsXML() {}", "function update_remarks_xml($langdata_path, $updated_remarks)\n{\n\t# updated_remarks[measure_id] = {[range]=>[interpretation]}\n\tglobal $VERSION;\n\t$new_version = $VERSION;\n\t$file_name = $langdata_path.\"remarks.xml\";\n\t$dest_file_name = $langdata_path.\"remarks.xml\";\n\t$xml_doc = new DOMDocument();\n\t$xml_doc->load($file_name);\n\t$xpath = new DOMXpath($xml_doc);\n\t$root_node = $xml_doc->getElementsByTagName(\"measures\");\n\t$root_node->item(0)->setAttribute(\"version\", $new_version);\n\tforeach($updated_remarks as $key=>$value)\n\t{\n\t\t$measure_id = $key;\n\t\t$remarks_map = $value;\n\t\t$measure = Measure::getById($measure_id);\n\t\t# Remove old measure node\n\t\t$old_measure_node = $xpath->query(\"//measures/measure[@id='\".$measure_id.\"']\");\n\t\t$old_measure_node = $root_node->item(0)->removeChild($old_measure_node->item(0));\n\t\t# Create new measure node based on supplied values\n\t\t$new_measure_node = $xml_doc->createElement(\"measure\");\n\t\t$new_measure_node->setAttribute(\"id\", $measure_id);\n\t\t$new_measure_node->setAttribute(\"descr\", $measure->name);\n\t\tforeach($remarks_map as $key2=>$value2)\n\t\t{\n\t\t\t$range = $key2;\n\t\t\t$remark = $value2;\n\t\t\t$new_range_node = $xml_doc->createElement(\"range\");\n\t\t\t$new_key_node = $xml_doc->createElement(\"key\", $range);\n\t\t\t$new_value_node = $xml_doc->createElement(\"value\", $remark);\n\t\t\t$new_range_node->appendChild($new_key_node);\n\t\t\t$new_range_node->appendChild($new_value_node);\n\t\t\t$new_measure_node->appendChild($new_range_node);\n\t\t}\n\t\t# Append updated measure node to XML root node\n\t\t$root_node->item(0)->appendChild($new_measure_node);\n\t}\n\t# Save changes back into XML file\n\t$xml_doc->formatOutput = true;\n\t$xml_doc->preserveWhiteSpace = true;\n\t$xml_doc->save($dest_file_name);\n}", "protected function workbookRelationsXml() {\n\n\t\t// Xml\n\t\t$sXml = '<?xml version=\"1.0\"?>'\n\t\t\t. '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">'\n\t\t\t. '%s' // workbook sheets\n\t\t\t. '<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>'\n\t\t\t. '</Relationships>'\n\t\t;\n\n\t\t$sSheets = '';\n\t\t$sSheetTemplate = '<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/%s.xml\"/>';\n\t\t$iId = 1;\n\t\t// iterate dom sheets\n\t\tforeach($this->aSheets as $oSheet) {\n\t\t\t/** @var Sheet $oSheet */\n\n\t\t\t// add filename by sheet identifier\n\t\t\t$sSheets .= sprintf($sSheetTemplate, $iId, $oSheet->getIdentifier());\n\n\t\t\t// increase id\n\t\t\t$iId ++;\n\t\t}\n\n\t\t// add Shared Strings\n\t\tif (!empty($this->aSharedStrings)) {\n\t\t\t$sSheets .= sprintf('<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\" Target=\"sharedStrings.xml\"/>', $iId+2);\n\t\t}\n\n\t\t// return generated XML\n\t\treturn sprintf($sXml, $sSheets, $iId);\n\t}", "function url($type) {\n return $this->urlPattern.$type.'.xml';\n }", "function _getXmlCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.xml', _XE_PATH_, $module_srl);\n }", "private function flush_rewrite_rules() {\n\n\t\tglobal $updraftplus_addons_migrator;\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) switch_to_blog($updraftplus_addons_migrator->new_blogid);\n\n\t\t$filter_these = array('permalink_structure', 'rewrite_rules', 'page_on_front');\n\t\t\n\t\tforeach ($filter_these as $opt) {\n\t\t\tadd_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->init();\n\t\t// Don't do this: it will cause rules created by plugins that weren't active at the start of the restore run to be lost\n\t\t// flush_rewrite_rules(true);\n\n\t\tif (function_exists('save_mod_rewrite_rules')) save_mod_rewrite_rules();\n\t\tif (function_exists('iis7_save_url_rewrite_rules')) iis7_save_url_rewrite_rules();\n\n\t\tforeach ($filter_these as $opt) {\n\t\t\tremove_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) restore_current_blog();\n\n\t}", "protected function xmlListenersMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/listener', 'listeners')\n ->loop(true)\n ->attribute('class')\n ->attribute('service')\n ->addChildren(\n Path::factory('param', 'params')\n ->attribute('name')\n ->filter(array($this, 'propertizeString'))\n ->value('value')\n ->loop(true)\n )\n );\n \n return $map;\n }", "public function getRDFXML()\n {\n return XSLTProcessor::process(\n 'record-rdf-mods.xsl', trim($this->marcRecord->toXML())\n );\n }", "function wst_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "public function __toString(){\n return\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" .\n '<urlset xmlns=\"' . self::SITEMAP_SCHEMA . '\">' . \"\\n\" .\n implode($this->urls) .\n '</urlset>' . \"\\n\";\n\n }", "protected function register_rewrite_endpoints() {\n\t\tif ( ! empty( $this->endpoints ) ) {\n\t\t\tforeach ( $this->endpoints as $slug => $arr ) {\n\t\t\t\tadd_rewrite_endpoint( $slug, $arr['type'] );\n\t\t\t}\n\t\t}\n\t}", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "function generer_urls_canoniques(){\n\tinclude_spip('balise/url_');\n\n\tif (count($GLOBALS['contexte'])==0){\n\t\t$objet = 'sommaire';\n\t} elseif (isset($GLOBALS['contexte']['id_article'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_article'];\n\t\t$objet = 'article';\n\t} elseif (isset($GLOBALS['contexte']['id_rubrique'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_rubrique'];\n\t\t$objet = 'rubrique';\n\t}\n\n\tswitch ($objet) {\n\t\tcase 'sommaire':\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . '\" />';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . generer_url_entite($id_objet, $objet) . '\" />';\n\t\t\tbreak;\n\t}\n\n\treturn $flux;\n}", "function theme_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "protected function _getUrlRewrite()\n {\n if (!$this->hasData('url_rewrite')) {\n $this->setUrlRewrite($this->_rewriteFactory->create());\n }\n return $this->getUrlRewrite();\n }", "function al3_flush_rewrite_rules_events() {\n\tflush_rewrite_rules();\n}", "function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}", "static public function add_rewrite_rules(){\n\t global $wp,$wp_rewrite; \n\t $wp->add_query_var( 'profile' );\n\n\t foreach( AT_Route::fronted() as $key=>$params ){\n\t\t\t$wp_rewrite->add_rule('^' .$key, 'index.php?profile=true', 'top');\n\t\t\tforeach ( $params['regular_expressions'] as $key => $expression ) {\n\t\t\t\t$wp_rewrite->add_rule('^' .$key . $expression, 'index.php?profile=true', 'top');\n\t\t\t}\n\n\t }\n\n\t $wp_rewrite->flush_rules();\n\t}", "public function recreateMaps()\n {\n $maps = $this->getRedirectsMapsByType();\n\n $this->recreateMapFile($maps, static::STATUS_CODE_301_MOVED_PERMANENTLY);\n $this->recreateMapFile($maps, static::STATUS_CODE_302_FOUND);\n\n // apache doesn't need reload\n if ($this->serverType === 'nginx') {\n $this->reloadNginxConfigs();\n }\n }", "abstract public function getDataprotXML();", "function xmllist() {\n\t\tglobal $mysql;\n\t\t$result[$this->class_name()] = $mysql->select(\"SELECT * FROM \".$this->class_name, true);\n\t\t$output = XML::get($result);\n\t\treturn xml($output);\n\t}", "function rewrite_rules($wp_rewrite) {\n $new_rules = array(\n 'hcard_url/(.+)' => 'index.php?hcard_url=' . $wp_rewrite->preg_index(1)\n );\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n }", "function ind_post_rewrite_rules($rules) {\n\tglobal $wp_rewrite;\n \n\t// add rewrite tokens\n\t$keytag = '%chapter%';\n\t$wp_rewrite->add_rewrite_tag($keytag, '([0-9]+)', 'chapter=');\n\n\t// rules for 'posts'\n\t$post_structure = $wp_rewrite->permalink_structure . \"/chapter/$keytag\";\n\t$post_structure = str_replace('//', '/', $post_structure);\n\t$post_rewrite = $wp_rewrite->generate_rewrite_rules($post_structure, EP_PERMALINK);\n\n\t$rules = array_merge($post_rewrite,$rules);\n\t \n\treturn $rules;\n}", "private function appendTurnOnEngine(){\n\t\t$string = 'RewriteEngine on';\n\t\t$this->appendLineToRewrites($string);\n\t}" ]
[ "0.65069914", "0.61066896", "0.5948208", "0.58654475", "0.5709655", "0.5663136", "0.56454134", "0.5626864", "0.5600636", "0.55312604", "0.54668826", "0.53480047", "0.5325653", "0.53003687", "0.5230206", "0.5213253", "0.5200744", "0.5194122", "0.5142629", "0.5106581", "0.5103024", "0.5099835", "0.5099541", "0.50869256", "0.50837034", "0.5040802", "0.5004934", "0.50047404", "0.50026727", "0.50017226", "0.49905202", "0.49756575", "0.4972457", "0.49691314", "0.49689206", "0.494952", "0.49488768", "0.4945351", "0.49265605", "0.49219713", "0.49218217", "0.49199024", "0.4894796", "0.48878396", "0.48801497", "0.48636967", "0.4849734", "0.48463216", "0.48310733", "0.48222366", "0.4817798", "0.48017663", "0.4778824", "0.4745987", "0.47345892", "0.4726469", "0.47261205", "0.4725521", "0.4715947", "0.47116244", "0.47069645", "0.46982372", "0.46928677", "0.46882847", "0.46773374", "0.46724287", "0.46666422", "0.46243566", "0.4618311", "0.46096814", "0.45991144", "0.4596938", "0.4596938", "0.45791668", "0.45751137", "0.45710102", "0.45574543", "0.45458156", "0.45441338", "0.45412403", "0.4540657", "0.45386147", "0.45346755", "0.45266986", "0.45190406", "0.45141727", "0.4505538", "0.4499477", "0.44944772", "0.44922143", "0.4490422", "0.4489548", "0.44843894", "0.448254", "0.44793117", "0.44791046", "0.44634676", "0.44599903", "0.44505554", "0.44470215" ]
0.6116348
1
Get class methods rewrites
protected function _getClassMethodRewrites($classRewrites) { $usedClasses = $this->_getUsedClassMethods(); foreach ($classRewrites as $position => &$usedClass) { foreach ($usedClass as $class => &$rewrites) { if (isset($rewrites['class'])) { $refl = new ReflectionClass($rewrites['class']); foreach ($usedClasses[$class] as $method) { $classOwner = $refl->getMethod($method)->class; if (($class != $classOwner) && !in_array($method, $rewrites['methods'])) { array_push($rewrites['methods'], $method); } } } } } return $classRewrites; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMethods($class);", "function get_class_methods() {\n\t\t$args = func_get_args();\n\t\t$result=call_user_func_array(\"get_class_methods\", $args);\n\t\tif (is_array($result))\n\t\t\tforeach ($result as $key=>$value) {\n\t\t\t\t$result[$key]=strtolower($value);\n\t\t\t}\n\t\treturn $result;\n\t}", "protected function getFuncToMethod() {\r\n\t\t$class = $this->class;\r\n\t\t\r\n\t\tif (!isset(self::$classCache[$class])) {\r\n\t\t\t$reflClass = new \\ReflectionClass($class);\r\n\t\t\t$methods = [];\r\n\t\t\t\r\n\t\t\t/* @var $reflMethod \\ReflectionMethod */\r\n\t\t\tforeach ($reflClass->getMethods() as $reflMethod) {\r\n\t\t\t\t$methodName = $reflMethod->name;\r\n\t\t\t\t$functionName = strtolower(preg_replace('/[A-Z]/', '_$0', $methodName));\r\n\t\t\t\t\r\n\t\t\t\tif (!$reflMethod->isStatic() && ($reflMethod->isPublic() || $reflMethod->isProtected()) && strpos($methodName, '__') !== 0) {\r\n\t\t\t\t\t$methods[$functionName] = $methodName;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself::$classCache[$class] = $methods;\r\n\t\t}\t\r\n\t\t\r\n\t\treturn self::$classCache[$class];\r\n\t}", "public function getMethods();", "public function getMethods();", "public function getMethods();", "public function getMethods(): array;", "public function getMethods(): array;", "public function __getMethods() {\n\t\t\t$methods = array_unique(array_merge(parent::__getMethods(), $this->methods));\n\t\t\treturn $methods;\n\t\t}", "function setLoggerMethods($srcClassName, $destClassName, $methods) {\n // This will allow us to invoke __call().\n foreach ($methods as $method => $data) {\n debugMsg(\"Removing $srcClassName::$method()\");\n if ($data['isStatic'] != true) {\n runkit_method_remove($srcClassName, $method);\n }\n }\n\n // Clone the constructor from LogHelper to class with original name,\n // while preserving arguments\n injectLogHelper($srcClassName, $methods);\n\n}", "public function getInjectMethods() {}", "private function getMethodClassMap()\n {\n return [\n 'account_channels' => \\XRPHP\\Api\\Anon\\Account\\AccountChannelsMethod::class,\n 'account_currencies' => \\XRPHP\\Api\\Anon\\Account\\AccountCurrenciesMethod::class,\n 'account_info' => \\XRPHP\\Api\\Anon\\Account\\AccountInfoMethod::class,\n 'account_lines' => \\XRPHP\\Api\\Anon\\Account\\AccountLinesMethod::class,\n 'account_objects' => \\XRPHP\\Api\\Anon\\Account\\AccountObjectsMethod::class,\n 'account_offers' => \\XRPHP\\Api\\Anon\\Account\\AccountOffersMethod::class,\n 'account_tx' => \\XRPHP\\Api\\Anon\\Account\\AccountTxMethod::class,\n 'gateway_balances' => \\XRPHP\\Api\\Anon\\Account\\GatewayBalancesMethod::class,\n 'noripple_check' => \\XRPHP\\Api\\Anon\\Account\\NorippleCheckMethod::class,\n 'ledger' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerMethod::class,\n 'ledger_closed' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerClosedMethod::class,\n 'ledger_current' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerCurrentMethod::class,\n 'ledger_data' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerDataMethod::class,\n 'ledger_entry' => \\XRPHP\\Api\\Anon\\Ledger\\LedgerEntryMethod::class,\n 'sign' => \\XRPHP\\Api\\Anon\\Transaction\\SignMethod::class,\n 'sign_for' => \\XRPHP\\Api\\Anon\\Transaction\\SignForMethod::class,\n 'submit' => \\XRPHP\\Api\\Anon\\Transaction\\SubmitMethod::class,\n 'submit_multisigned' => \\XRPHP\\Api\\Anon\\Transaction\\SubmitMultisignedMethod::class,\n 'transaction_entry' => \\XRPHP\\Api\\Anon\\Transaction\\TransactionEntryMethod::class,\n 'tx' => \\XRPHP\\Api\\Anon\\Transaction\\TxMethod::class,\n 'book_offers' => \\XRPHP\\Api\\Anon\\PathOrderBook\\BookOffersMethod::class,\n 'ripple_path_find' => \\XRPHP\\Api\\Anon\\PathOrderBook\\RipplePathFindMethod::class,\n 'channel_authorize' => \\XRPHP\\Api\\Anon\\PaymentChannel\\ChannelAuthorizeMethod::class,\n 'channel_verify' => \\XRPHP\\Api\\Anon\\PaymentChannel\\ChannelVerifyMethod::class,\n 'fee' => \\XRPHP\\Api\\Anon\\ServerInfo\\FeeMethod::class,\n 'server_info' => \\XRPHP\\Api\\Anon\\ServerInfo\\ServerInfoMethod::class,\n 'server_state' => \\XRPHP\\Api\\Anon\\ServerInfo\\ServerStateMethod::class,\n 'ping' => \\XRPHP\\Api\\Anon\\Utility\\PingMethod::class,\n 'random' => \\XRPHP\\Api\\Anon\\Utility\\RandomMethod::class\n ];\n }", "public function getCodePoolClassRewrite()\n {\n $cache = Mage::app()->loadCache(self::CACHE_KEY_CODE_POOL);\n if ($this->useCache() && $cache) {\n $classCodePoolRewrite = unserialize($cache);\n } else {\n $classCodePoolRewrite = array();\n $usedClasses = $this->_getUsedClassMethods();\n foreach ($usedClasses as $class => $methods) {\n $refl = new ReflectionClass($class);\n $filename = $refl->getFileName();\n $pathByName = str_replace('_', DS, $class) . '.php';\n if ((strpos($filename, 'local' . DS . $pathByName) !== false) ||\n (strpos($filename, 'community'. DS . $pathByName) !== false))\n {\n $classCodePoolRewrite[] = $class;\n }\n }\n if ($this->useCache()) {\n Mage::app()->saveCache(serialize($classCodePoolRewrite), self::CACHE_KEY_CODE_POOL,\n array(self::CACHE_TYPE));\n }\n }\n return $classCodePoolRewrite;\n }", "public function methods();", "public function action_methods()\n\t{\n\t\t$this->runTest('gcc', 100000, 'get_called_class every time');\n\t\t$this->runTest('gcc_cached', 100000, 'caching get_called_class');\n\t}", "abstract protected function getMethodPattern(): string;", "public function getActiveMethods();", "public function getDynamicMethods()\n {\n return [];\n }", "public function writeClassMethods($class)\n {\n $text = array();\n \n $list = array(\n 'public' => array(),\n 'protected' => array(),\n 'private' => array(),\n );\n \n foreach ($this->api[$class]['methods'] as $name => $info) {\n \n $summ = trim($info['summ']);\n if (! $summ) {\n $summ = '-?-';\n }\n $list[$info['access']][] = \"[[$class::$name() | `$name()`]]\\n: $summ\\n\";\n }\n \n foreach ($list as $access => $methods) {\n \n $text[] = $this->_title2(ucfirst($access));\n \n if ($methods) {\n $text = array_merge($text, $methods);\n } else {\n $text[] = 'None.';\n $text[] = '';\n }\n \n $text[] = '';\n }\n \n $this->_write(\"class\", \"$class/Methods\", $text);\n }", "protected function getMethodsMap()\n {\n return [\n 'add' => 'addItemTo',\n 'set' => 'setProperty',\n 'unset' => 'unsetProperty'\n ];\n }", "public function get_method();", "public function getXmlClassRewrites()\n {\n $cache = Mage::app()->loadCache(self::CACHE_KEY_XML);\n if ($this->useCache() && $cache) {\n $result = unserialize($cache);\n } else {\n $classRewrites = array();\n $modules = $this->_getAllModules();\n\n foreach ($modules as $modName => $module) {\n if ($this->_skipValidation($modName, $module)) {\n continue;\n }\n $result = $this->_getRewritesInModule($modName);\n if (!empty($result)) {\n $classRewrites[] = $result;\n }\n }\n $result = $this->_getClassMethodRewrites($classRewrites);\n if ($this->useCache()) {\n Mage::app()->saveCache(serialize($result), self::CACHE_KEY_XML,\n array(self::CACHE_TYPE));\n }\n }\n return $result;\n }", "function classkit_method_rename($classname, $methodname, $newname)\n{\n}", "public function GetMethod ();", "public function compileMethods() {\n\t\t$methods = array();\n\t\t$from = array('{:name:}', '{:contents:}');\n\t\tforeach ($this->_file->blocks() as $name => $value) {\n\t\t\t$methods[] = str_replace($from, compact('name', 'value'), $this->_templates['method']);\n\t\t}\n\t\treturn implode($methods, PHP_EOL);\n\t}", "public function getClassMethods($className) {\n\n\t\tif (!isset($this->classMethodCache[$className])) {\n\n\t\t\t$info = array();\n\n\t\t\t$rClass = new ReflectionClass($className);\n\n\t\t\t$currentClass = $rClass;\n\t\t\t$currentClassName = $currentClass->getName();\n\t\t\t$currentMethods = get_class_methods($currentClass->getName());\n\t\t\t$parentClass = $currentClass->getParentClass();\n\n\t\t\t$level = 1;\n\t\t\twhile ($parentClass && $level < 6) {\n\n\t\t\t\t$parentClassName = $parentClass->getName();\n\n\t\t\t\tif (!in_array($currentClassName, array('Mage_Core_Block_Abstract', 'Mage_Core_Block_Template'))) {\n\t\t\t\t\t$parentMethods = get_class_methods($parentClassName);\n\t\t\t\t\t$tmp = array_diff($currentMethods, $parentMethods);\n\t\t\t\t\t$info[$currentClassName] = array();\n\n\t\t\t\t\t// render methods to \"methodName($paramter1, $parameter2, ...)\"\n\t\t\t\t\tforeach ($tmp as $methodName) {\n\n\t\t\t\t\t\t$parameters = array();\n\t\t\t\t\t\tforeach ($currentClass->getMethod($methodName)->getParameters() as $parameter) { /* @var $parameter ReflectionParameter */\n\t\t\t\t\t\t\t$parameters[] = '$'. $parameter->getName();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($parameters) > 3) {\n\t\t\t\t\t\t\t$parameters = array_slice($parameters, 0, 2);\n\t\t\t\t\t\t\t$parameters[] = '...';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$info[$currentClassName][] = $methodName . '(' . implode(', ', $parameters) . ')';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$info[$currentClassName] = array('(skipping)');\n\t\t\t\t\t$parentMethods = array();\n\t\t\t\t}\n\n\t\t\t\t$level++;\n\n\t\t\t\t$currentClass = $parentClass;\n\t\t\t\t$currentClassName = $currentClass->getName();\n\t\t\t\t$currentMethods = $parentMethods;\n\t\t\t\t$parentClass = $currentClass->getParentClass();\n\t\t\t}\n\n\t\t\t$this->classMethodCache[$className] = $info;\n\t\t}\n\n\t\treturn $this->classMethodCache[$className];\n\t}", "public function methods()\r\n {\r\n static $s_methods = array();\r\n if ( isset( $s_methods[$this->class->name] ) )\r\n {\r\n return $s_methods[$this->class->name];\r\n }\r\n $methods = $this->class->getMethods();\r\n \r\n usort( $methods, array( $this, '_method_sort' ) );\r\n \r\n $tmpArr = array();\r\n #当implements一些接口后,会导致出现重复的方法\n $out_methods = array();\r\n foreach ( $methods as $key => $method )\r\n {\r\n if ( isset( $tmpArr[$this->class->name][$method->name] ) ) continue;\r\n $tmpArr[$this->class->name][$method->name] = true;\r\n $out_methods[] = new Docs_Method( $this->class->name, $method->name );\r\n }\r\n $s_methods[$this->class->name] = $out_methods;\r\n return $out_methods;\r\n }", "public function getClassRoutes() {\r\n\t\t$routes = array();\r\n\t\tforeach (get_declared_classes() as $class) {\r\n\t\t\t$reflector = new \\ReflectionClass($class);\r\n\t\t\tif (!$reflector->isUserDefined()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t$docblock = $reflector->getDocComment();\r\n\t\t\t$classAnnotations = $this->parseAnnotations($docblock);\r\n\r\n\t\t\tforeach ($reflector->getMethods() as $method) {\r\n\t\t\t\t$docblock = $method->getDocComment();\r\n\t\t\t\t$methodName = $method->getName();\r\n\r\n\t\t\t\t$annotations = $this->parseAnnotations($docblock);\r\n\t\t\t\tif (!array_key_exists('route', $annotations)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Merge class + method annotations\r\n\t\t\t\t$route = $classAnnotations['route'] . $annotations['route'];\r\n\t\t\t\t$annotations = array_merge($classAnnotations, $annotations);\r\n\t\t\t\t$annotations['route'] = $route;\r\n\r\n\t\t\t\t$route = $this->compileRoute($annotations['route']);\r\n\t\t\t\t$function = array($class, $methodName);\r\n\t\t\t\t$routes[] = array($route, $function, $annotations);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $routes;\r\n\t}", "public function getMethod() {}", "public function getMethod() {}", "public function getMethod() {}", "public function getMethod() {}", "public static function getDocumentMagicMethods() {}", "public function getMethods() {\n if (null === $this->_methods) {\n $this->_methods = array(\n 'log' => function($object, &$log, $entry) {\n return $log->write($entry);\n }\n );\n }\n return $this->_methods;\n }", "public function get_method()\n {\n }", "public function getHookedMethods(){\n \n return $this->methods;\n \n }", "protected function getMethods()\n {\n return (new ReflectionClass(get_class($this)))->getMethods();\n }", "function sourceArray($srcClassName) {\n // Returns an array which contains method source and args.\n\n $ref = new ReflectionClass($srcClassName);\n\n $refMethods = $ref->getMethods();\n // Possible replacement: get_class_methods()?\n\n $objectArray = array();\n foreach ($refMethods as $refMethod) {\n $method = $refMethod->name;\n\n // Get a string of a method's source, in a single line.\n // XXX: Y u no cache file\n $filename = $refMethod->getFileName();\n if (!empty($filename)) {\n $source = getSource($srcClassName, $method, $filename);\n } else {\n // We presume that if no filename is found, the method is\n // built-in and we are unconcerned with it\n debugMsg(\"Skipping builtin method $method\");\n continue;\n }\n \n // Check to determine whether the method being inspected is static\n $isStatic = $refMethod->isStatic();\n\n // Get a comma-seperated string of parameters, wrap them in\n // a method definition. Note that all your methods\n // just became public.\n $params = prepareParametersString($refMethod, false); \n $paramsDefault = prepareParametersString($refMethod); \n if ($isStatic) {\n // unconfirmed as of yet\n $methodHeader = \"public static function $method({$paramsDefault})\";\n } else {\n $methodHeader = \"public function $method({$paramsDefault})\";\n }\n\n // Return the two components mentioned above, indexed by method name\n // XXX: Only send one of the params vars, processing on other end\n $objectArray[$method] = array(\"params\" => $params, \"paramsDefault\" => $paramsDefault, 'methodHeader' => $methodHeader, 'src' => $source, 'isStatic' => $isStatic);\n }\n return $objectArray;\n}", "public function getRoutes() {\r\n\t\treturn array_merge($this->getFunctionRoutes(), $this->getClassRoutes());\r\n\t}", "protected function instanceMethods()\n\t{\n\t\treturn collect($this->stack)->reverse()\n\t\t\t->map(fn($call) => $this->instanceMethodAst(...$call))\n\t\t\t->toArray();\n\t}", "function populate_method_info() {\n\n $method_info = array();\n\n // get functions\n $all_functions = get_defined_functions();\n $internal_functions = $all_functions[\"internal\"];\n\n foreach ($internal_functions as $function) {\n // populate new method record\n $function_record = array();\n $function_record[CLASS_NAME] = \"Function\";\n $function_record[METHOD_NAME] = $function;\n $function_record[IS_TESTED] = \"no\";\n $function_record[TESTS] = \"\";\n $function_record[IS_DUPLICATE] = false;\n\n // record the extension that the function belongs to\n $reflectionFunction = new ReflectionFunction($function);\n $extension = $reflectionFunction->getExtension();\n if ($extension != null) {\n $function_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $function_record[EXTENSION_NAME] = \"\";\n }\n // insert new method record into info array\n $method_info[] = $function_record;\n }\n\n // get methods\n $all_classes = get_declared_classes();\n foreach ($all_classes as $class) {\n $reflectionClass = new ReflectionClass($class);\n $methods = $reflectionClass->getMethods();\n foreach ($methods as $method) {\n // populate new method record\n $new_method_record = array();\n $new_method_record[CLASS_NAME] = $reflectionClass->getName();\n $new_method_record[METHOD_NAME] = $method->getName();\n $new_method_record[IS_TESTED] = \"no\";\n $new_method_record[TESTS] = \"\";\n\n $extension = $reflectionClass->getExtension();\n if ($extension != null) {\n $new_method_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $new_method_record[EXTENSION_NAME] = \"\";\n }\n\n // check for duplicate method names\n $new_method_record[IS_DUPLICATE] = false;\n foreach ($method_info as &$current_record) {\n if (strcmp($current_record[METHOD_NAME], $new_method_record[METHOD_NAME]) == 0) {\n $new_method_record[IS_DUPLICATE] = true;\n $current_record[IS_DUPLICATE] = true;\n }\n }\n // insert new method record into info array\n $method_info[] = $new_method_record;\n }\n }\n\n return $method_info;\n}", "function getMethodsHead()\n {\n\n }", "function runkit_method_rename($classname, $methodname, $newname)\n{\n}", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "private function getFilterMethods($prefix)\n {\n $listMethods = get_class_methods($this);\n $return = [];\n $strlenPrefix = strlen($prefix);\n foreach ($listMethods as $method) {\n if (substr($method, 0, $strlenPrefix) === $prefix) {\n $return[substr($method, $strlenPrefix)] =\n strtolower(substr($method, $strlenPrefix, 1)) . substr($method, ($strlenPrefix + 1));\n }\n }\n return $return;\n }", "protected function _getMethods()\n {\n $reflect = new ReflectionClass($this);\n $list = array();\n $methods = $reflect->getMethods();\n foreach ($methods as $method) {\n $name = $method->getName();\n if (substr($name, 0, 5) == 'bench') {\n $list[] = $name;\n }\n }\n return $list;\n }", "private function getRuleToMethodMapping() {\n return array(\n 'compare_vowels' => \"applyCompareVowels\",\n 'arrr_bacon' => \"applyArrrBacon\",\n \"bacon_arrr\" => \"applyBaconArrr\",\n \"pattern\" => \"applyPattern\",\n \"match_making\" => \"applyMatchMaking\"\n );\n }", "public static function getMethodBase($methodName) {\r\n \r\n BaseController::PARTIAL;\r\n BaseController::ACTION;\r\n}", "public function rewrite();", "public function getMethodNameInclusionPatterns()\n {\n return $this->methodNameInclusionPatterns;\n }", "public function getMethod()\n {\n }", "public function pointcutLogMethods()\n {\n return new AspectPHP_Pointcut_RegExp('.*::log');\n }", "public function getMethod() :string;", "function reflect() {\n $return = array();\n $class = new \\ReflectionClass($this->testingClass);\n $return []= $class;\n\n if (func_num_args() > 0) {\n $args = func_get_args();\n\n foreach ($args as $name) {\n if (Text::beginsWith($name, 'method:')) {\n $property = $class->getMethod(Text::getSubstringAfter($name, 'method:'));\n }\n else {\n $property = $class->getProperty($name);\n }\n $property->setAccessible(true);\n $return []= $property;\n }\n }\n if (count($return) === 1) {\n return $class;\n }\n return $return;\n }", "public function getMethods() {\n $list = array();\n $functions = $this->get('function');\n if (null != $functions) {\n foreach ($functions as $function) {\n $name = $function->getName();\n if ('__construct' != $name && $this->getName() != $name) {\n if ($function->accept()) {\n $list[] = $function;\n }\n }\n }\n }\n return $list;\n }", "private function getOriginalClassNameMethodNode(): ClassMethod\n {\n // Add getOriginalClassName method\n return new ClassMethod('getOriginalClassName', [\n 'flags' => Node\\Stmt\\Class_::MODIFIER_PUBLIC,\n 'returnType' => 'string',\n 'stmts' => [\n new Node\\Stmt\\Return_(new Node\\Scalar\\String_($this->getOriginalClassName()))\n ],\n ]);\n }", "protected static function find_external_methods($class)\n\t{\n\t\tglobal $core;\n\n\t\tif (isset(self::$class_methods[$class]))\n\t\t{\n\t\t\treturn self::$class_methods[$class];\n\t\t}\n\n\t\tif (self::$methods === null)\n\t\t{\n\t\t\tself::$methods = $core->configs['methods'];\n\t\t}\n\n\t\t$methods = self::$methods;\n\t\t$methods_by_class = array();\n\n\t\t$classes = array($class => $class) + class_parents($class);\n\n\t\tforeach ($classes as $c)\n\t\t{\n\t\t\tif (empty($methods[$c]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$methods_by_class += $methods[$c];\n\t\t}\n\n\t\tself::$class_methods[$class] = $methods_by_class;\n\n\t\treturn $methods_by_class;\n\t}", "private function getAlreadyProposedMethods($contextClass)\n {\n return self::$proposedMethods[$contextClass] ?? array();\n }", "private function getMutatorMethod($class, $property)\n {\n $ucProperty = ucfirst($property);\n\n foreach (self::$mutatorPrefixes as $prefix) {\n try {\n $reflectionMethod = new \\ReflectionMethod($class, $prefix.$ucProperty);\n if ($reflectionMethod->isStatic()) {\n continue;\n }\n\n // Parameter can be optional to allow things like: method(array $foo = null)\n if ($reflectionMethod->getNumberOfParameters() >= 1) {\n return array($reflectionMethod, $prefix);\n }\n } catch (\\ReflectionException $e) {\n // Try the next prefix if the method doesn't exist\n }\n }\n }", "public function getMethods(): array\n {\n return $this->methods;\n }", "public function getMethods(): array\n {\n return $this->methods;\n }", "public function __invoke(string $class, string $method): array\n {\n try {\n $this->classes[$class] = $this->classes[$class] ?? new ReflectionClass($class);\n if (!isset($this->cache[$class][$method])) {\n $this->cache[$class][$method] = DefaultResponse::add(\n $this->getReflect($this->classes[$class], $method)\n );\n }\n } catch (Exception $e) {\n $this->cache[$class][$method] = DefaultResponse::add([\n 'summary' => 'unretrievable definition',\n 'description' => \"$class::$method could not be reflected on.\\n$e\",\n ]);\n }\n return $this->cache[$class][$method];\n }", "public function getMethodsDescription(): static\n {\n foreach ($this->attributes as $class => $methods) {\n $reflectionMethod = new ReflectionClass($class);\n foreach ($reflectionMethod->getMethods() as $method) {\n $attributes = $this->getAttributesDescription($method);\n if (count($attributes) > 0) {\n $this->attributes[$class]['methods'][$method->getName()] = $attributes;\n }\n }\n }\n\n return $this;\n }", "public function getMethods()\r\n\t{\r\n\t\treturn $this->methods;\r\n\t}", "public function getMethodDescriptors(): array;", "public function getMethods()\n {\n return $this->methods;\n }", "public function getMethods()\n {\n return $this->methods;\n }", "public function getMethods()\n {\n return $this->methods;\n }", "public function getMethods()\n {\n return $this->methods;\n }", "public function getMethods(): array\n {\n $methods = $this->file1->getMethods();\n $toMergeMethods = $this->file2->getMethods();\n\n foreach ($toMergeMethods as $name => $toMergeMethod) {\n $methods[$name] = isset($methods[$name]) ? $methods[$name]->merge($toMergeMethod) : $toMergeMethod;\n }\n\n return $methods;\n }", "public function getMethod()\n {\n return 'concatenate';\n }", "public function getMethod() : string;", "public function getMethods()\n {\n // it returns all methods from all parent objects, and I only want\n // this to return the methods from this object only.\n return array(\n 'shouldBeCalled',\n 'getMIMEType',\n 'getTitle',\n 'getSize',\n 'getDescription',\n 'getLastModified',\n 'getCreated',\n 'hasChildren',\n 'getDirectories',\n 'getFiles',\n 'rename',\n 'delete',\n 'getAllChildren',\n 'move',\n 'newDirectory'\n );\n }", "function runkit_method_redefine($classname, $methodname, $args, $code, $flags = RUNKIT_ACC_PUBLIC)\n{\n}", "function getApiMethod()\n {\n }", "public function _retrieve()\n {\n $this->log($this->getRequest()->getParams());\n $classInfoNodeList = Mage::getConfig()->getNode()->xpath(\n '//global//rewrite/..'\n );\n $outItems = array();\n\n foreach ($classInfoNodeList as $classInfoNode) {\n $rewrite = $classInfoNode->xpath('rewrite');\n if (is_array($rewrite) && sizeof($rewrite) > 0) {\n $keys = array_keys($rewrite[0]->asArray());\n $classSuffix = $keys[0];\n $rewriteClass = (string)$classInfoNode->rewrite->$classSuffix;\n $className = $classInfoNode->class . '_' . uc_words(\n $classSuffix,\n '_'\n );\n $outItem = array(\n 'original' => $className,\n 'rewriter' => $rewriteClass\n );\n $outItems[] = $outItem;\n }\n }\n $this->log($outItems);\n return $outItems;\n }", "protected static function __getTypeHintAbleMethods()\n {\n return [];\n }", "public static function get_all_methods( $class, $options = null ) {\n\t\tif( null === $options ) {\n\t\t\t$options = ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_PRIVATE | ReflectionMethod::IS_ABSTRACT | ReflectionMethod::IS_FINAL;\n\t\t}\n\t\t$result = array();\n\t\t$reflection = new ReflectionClass( $class );\n\t\t$methods = $reflection->getMethods( $options );\n\n\t\tif ( is_array( $methods ) ) {\n\t\t\tforeach ($methods as $obj) {\n\t\t\t\tarray_push( $result, $obj->name );\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getMethod(): string {}", "public function transformClassName() {\n\t\t$that = $this;\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use (&$that) {\n\t\t\treturn $matches['modifiers'] . $that->convertClassName($that->getClassNamespace() . '\\\\' . $matches['className']) . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}", "function updateMethod($classname, $file, $sNo, ReflectionMethod $method, DOMDocument $doc, DOMXPath $xpath)\n {\n $methodName = $method->getName();\n $compelArgs = $method->getNumberOfRequiredParameters();\n $totalArgs = $method->getNumberOfParameters();\n\n preg_match_all('/^([A-Z][a-z]{2,5})[A-Z]/', $classname, $matches);\n if (isset($matches[1][0])) {\n $prefix = strtolower($matches[1][0]);\n } else {\n $prefix = strtolower(substr($classname, 0, 3));\n echo 'Could not determine prefix for class \"' . $classname . '\". Using \"' . $prefix . \"\\\"\\n\";\n }\n\n $daClass = strtolower($classname);\n if ($methodName == \"__construct\") {\n //constructor\n $ismethod = false;\n $daID = $prefix . '.' . $daClass . '.constructor';\n } else if (substr($methodName, 0, 3) == \"new\") {\n //constructor\n $ismethod = false;\n $daID = $prefix . '.' . $daClass . '.constructor.' . $methodName;\n } else if (substr($methodName, 0, 2) == '__') {\n return;\n } else {\n //normal method\n $ismethod = true;\n $daID = $prefix . '.' . $daClass . '.method.' . $methodName;\n }\n\n\n if ($ismethod) {\n $path = '/classentry/methods/method[@id=\"' . $daID . '\"]';\n } else {\n $path = '/classentry/constructors/constructor[@id=\"' . $daID . '\"]';\n }\n $functionNodes =\n $xpath->query($path);\n\n\n if ($functionNodes->length == 0) {\n /* Method not present, Add it */\n if ($ismethod) {\n $xmlMethod = $doc->createElement('method', \"\\n\");\n } else {\n $xmlMethod = $doc->createElement('constructor', \"\\n\");\n }\n $xmlMethod->setAttribute('id', $daID);\n\n $xmlSynopsis = $doc->createElement('funcsynopsis', \"\\n\");\n $xmlPrototype = $doc->createElement('funcprototype', \"\\n\");\n $xmlFuncdef = $doc->createElement('funcdef', $ismethod ? 'void ' : '');\n if ($methodName == '__construct') {\n $xmlFunction = $doc->createElement('function', $classname);\n } else if ($ismethod) {\n $xmlFunction = $doc->createElement('function', $methodName);\n } else {\n //alternative constructors need Classname::new_* as funcname\n $xmlFunction = $doc->createElement('function', $classname . '::' . $methodName);\n }\n\n $xmlFuncdef->appendChild($xmlFunction);\n $xmlParamDefs = array();\n\n if ($totalArgs > 0) {\n /* Function has arguments */\n foreach ($method->getParameters() as $param) {\n $xmlParamDefs[] = $this->createParameterDefinition($param, $doc);\n }\n } else {\n /* Function has NO arguments */\n $xmlParamDefs[] = $doc->createElement('paramdef', 'void');\n }\n\n /* Appending child nodes in order */\n $xmlPrototype->appendChild($doc->createTextNode(' '));\n $xmlPrototype->appendChild($xmlFuncdef);\n $xmlPrototype->appendChild($doc->createTextNode(\"\\n\"));\n\n foreach ($xmlParamDefs as $xmlParamdef) {\n $xmlPrototype->appendChild($doc->createTextNode(' '));\n $xmlPrototype->appendChild($xmlParamdef);\n $xmlPrototype->appendChild($doc->createTextNode(\"\\n\"));\n }\n $xmlPrototype->appendChild($doc->createTextNode(\" \"));\n\n $xmlSynopsis->appendChild($doc->createTextNode(' '));\n $xmlSynopsis->appendChild($xmlPrototype);\n $xmlSynopsis->appendChild($doc->createTextNode(\"\\n \"));\n\n /* Add nodes for shortdesc and desc */\n $xmlShortDesc = $doc->createElement('shortdesc', \"\\n \\n \");\n $xmlDesc = $doc->createElement('desc', \"\\n \");\n\n $xmlMethod->appendChild($doc->createTextNode(\" \"));\n $xmlMethod->appendChild($xmlSynopsis);\n $xmlMethod->appendChild($doc->createTextNode(\"\\n\"));\n\n $xmlMethod->appendChild($doc->createTextNode(\" \"));\n $xmlMethod->appendChild($xmlShortDesc);\n $xmlMethod->appendChild($doc->createTextNode(\"\\n\"));\n\n $xmlMethod->appendChild($doc->createTextNode(\" \"));\n $xmlMethod->appendChild($xmlDesc);\n $xmlMethod->appendChild($doc->createTextNode(\"\\n\"));\n\n // Add a static identifier if the method is static.\n if ($method->isStatic()) {\n $this->addStatic($doc, $xmlDesc);\n }\n\n $xmlMethod->appendChild($doc->createTextNode(' '));\n\n if ($ismethod) {\n echo \"M \";\n $topLevels = $doc->getElementsByTagName('methods');\n\n // If there is no methods section, create one.\n if ($topLevels->length == 0) {\n $methods = $doc->createElement('methods');\n $classentry = $doc->getElementsByTagName('classentry')->item(0);\n $classentry->appendChild($doc->createTextNode(\"\\n\\n \"));\n $classentry->appendChild($methods);\n $classentry->appendChild($doc->createTextNode(\"\\n\"));\n $methods->appendChild($doc->createTextNode(\"\\n\"));\n $topLevels = $doc->getElementsByTagName('methods');\n }\n } else {\n echo \"C \";\n $topLevels = $doc->getElementsByTagName('constructors');\n\n // If there is no constructor section, create one.\n if ($topLevels->length == 0) {\n $constructors = $doc->createElement('constructors');\n $classentry = $doc->getElementsByTagName('classentry')->item(0);\n $classentry->appendChild($doc->createTextNode(\"\\n\\n \"));\n $classentry->appendChild($constructors);\n $classentry->appendChild($doc->createTextNode(\"\\n\"));\n $constructors->appendChild($doc->createTextNode(\"\\n\"));\n $topLevels = $doc->getElementsByTagName('constructors');\n }\n }\n $topLevel = $topLevels->item(0);\n echo \"Updating \" . $daID . \"\\n\";\n $topLevel->appendChild($doc->createTextNode(' '));\n $topLevel->appendChild($xmlMethod);\n $topLevel->appendChild($doc->createTextNode(\"\\n\\n\"));\n\n ++$this->methodCount;\n } else {\n /**\n * Method exists\n */\n // Grab the element.\n $xmlMethod = $functionNodes->item(0);\n $xmlDesc = $xmlMethod->getElementsByTagName('desc')->item(0);\n\n $this->checkExistingMethodParams($doc, $xpath, $method, $path);\n\n // Add a static entity if needed.\n //only if not a constructor\n if ($ismethod && $method->isStatic()) {\n if ($this->addStatic($doc, $xmlDesc)) {\n ++$this->methodCount;\n }\n }\n }\n }", "public function getMethods() {\n return $this->methods;\n }", "function rest_api_register_rewrites()\n {\n }", "function getTestableMethods($className) {\n\t\t$classMethods = get_class_methods($className);\n\t\t$parentMethods = get_class_methods(get_parent_class($className));\n\t\t$thisMethods = array_diff($classMethods, $parentMethods);\n\t\t$out = array();\n\t\tforeach ($thisMethods as $method) {\n\t\t\tif (substr($method, 0, 1) != '_' && $method != strtolower($className)) {\n\t\t\t\t$out[] = $method;\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "function getMethod()\r\n {\r\n }", "public function getSettersFromClass($class){\n \t\t$class = new $class;\n \t\treturn $class->getSetters();\n }", "public function _remap($method)\n {\n //echo \"Params: \";\n PC::_remap(func_get_args());\n $params = array_slice(func_get_args(), 1);\n if(!is_array($params))\n {\n $val = $params;\n $params = array($val);\n }\n \n\n if(method_exists($this, $method)){\n if(!$this->initialized)\n $this->_initialize();\n return call_user_func_array(array($this, $method), $params); \n }\n \n\n $string[0] = $method;\n for($i = 0; $i < count($params); $i++)\n {\n array_push($string, $params[$i]);\n }\n if ((strrpos($method, '.html') === strlen($method) - 5) && method_exists($this, \"seo\"))\n {\n if(!$this->initialized)\n $this->_initialize();\n return call_user_func_array(array($this, \"seo\"), $string);\n }\n\n if(method_exists($this, \"query\"))\n {\n if(!$this->initialized)\n $this->_initialize();\n return call_user_func_array(array($this, \"query\"), $string);\n }\n\n if(method_exists($this, \"index\"))\n {\n if(!$this->initialized)\n $this->_initialize();\n return call_user_func_array(array($this, \"index\"), $string);\n }\n \n\n return \"__404__\";\n }", "public static function get_all_static_methods( $class )\n\t{\n\t\treturn self::get_all_methods( $class, ReflectionMethod::IS_STATIC );\n\t}", "abstract protected function setMethod();", "static function getmethods() {\n $a_methods = call_user_func(array('PluginFusioninventoryStaticmisc', 'task_methods'));\n $a_modules = PluginFusioninventoryModule::getAll();\n foreach ($a_modules as $data) {\n if (is_callable(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods'))) {\n $a_methods = array_merge($a_methods, \n call_user_func(array('Plugin'.ucfirst($data['directory']).'Staticmisc', 'task_methods')));\n }\n }\n return $a_methods;\n }", "abstract protected function mixins(ClassReflection $classReflection, string $methodName): array;", "protected function _emitClassMethods($class, $methods) { if (isset($methods) && is_array($methods)) { // YES\n // TODO: Move to the Flag to Configuration File\n $config_sortMethods = true; // Sort Class or Interface Methods?\n if ($config_sortMethods) {\n ksort($methods);\n }\n\n foreach ($methods as $name => $method) {\n // Process Class Metho\n $this->_emitClassMethod($class, $name, $method);\n }\n }\n }", "public function getMethod(): string;", "public function getMethod(): string;" ]
[ "0.69250196", "0.63380474", "0.6235909", "0.6173006", "0.6173006", "0.6173006", "0.61434335", "0.61434335", "0.6127227", "0.6101479", "0.6073301", "0.60529125", "0.6030636", "0.6026626", "0.6008329", "0.5978192", "0.59676653", "0.59536165", "0.594808", "0.59224343", "0.59206384", "0.5907996", "0.5864071", "0.5847716", "0.583237", "0.58012104", "0.57907224", "0.5750987", "0.57454234", "0.57454234", "0.57454234", "0.57454234", "0.57342273", "0.5724382", "0.5712547", "0.5709269", "0.57018685", "0.56972283", "0.5653525", "0.56427944", "0.5559715", "0.5554173", "0.55285966", "0.5524323", "0.5524323", "0.5524323", "0.5524323", "0.5524323", "0.5524323", "0.5524323", "0.55198026", "0.551278", "0.5501159", "0.5495783", "0.54670656", "0.5451096", "0.5450609", "0.5449983", "0.5445787", "0.54337806", "0.5429345", "0.54256797", "0.54101175", "0.54053503", "0.5399652", "0.5378411", "0.5378411", "0.5375076", "0.5374036", "0.537057", "0.5364971", "0.5364908", "0.5364908", "0.5364908", "0.5364908", "0.53626037", "0.5361287", "0.5359393", "0.535389", "0.53535014", "0.53527707", "0.5352669", "0.53245", "0.5313588", "0.5307044", "0.5299525", "0.5293391", "0.5293213", "0.5289738", "0.52804697", "0.52790046", "0.5278266", "0.5277659", "0.5255937", "0.52500504", "0.5249482", "0.52479315", "0.5230293", "0.5229246", "0.5229246" ]
0.6561905
1
Get rewrites in separate module
protected function _getRewritesInModule($modName) { $classes = array(); $moduleConfig = $this->_getModuleConfig($modName); $usedClasses = $this->_getUsedClassMethods(); foreach ($usedClasses as $class => $methods) { $parts = explode('_', $class); $groupId = $this->_getGroupId($parts); $classId = $this->_getClassId($parts); if (!$groupId || ! $classId) { continue; } $typeNode = $moduleConfig->getNode()->global->{self::CONFLICT_TYPE . 's'}->$groupId; if (!$typeNode) { continue; }; $rewrites = $typeNode->rewrite; if ($rewrites && $rewrites->$classId) { $classes[$class] = array('class' => (string) $rewrites->$classId, 'methods' => array()); } } return $classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_rewrites()\n {\n }", "function rest_api_register_rewrites()\n {\n }", "private function buildRewrites(){\n\t\t\n\t\t// If we want to add IfModule checks, add the opening tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckStart();\n\t\t}\n\t\t\t\n\t\t// If we want to turn the rewrite engine on, add the statement\n\t\tif($this->includeTurnOnEngine){\n\t\t\t$this->appendTurnOnEngine();\n\t\t}\n\t\t\n\t\t// Are there actually URLs to rewrite?\n\t\tif(!empty($this->urls)){\n\t\t\t\n\t\t\t// Loop through the URLs\n\t\t\tforeach($this->urls as $source => $destination){\n\t\t\t\t\n\t\t\t\t// Check for query strings, as RewriteRule will ignore them\n\t\t\t\t$queryStringPos = strpos($source, '?');\n\t\t\t\t\n\t\t\t\t// URL has a query string\n\t\t\t\tif($queryStringPos !== FALSE){\n\t\t\t\t\t\n\t\t\t\t\t// Grab the query string\n\t\t\t\t\t$queryString = substr($source, $queryStringPos + 1);\n\t\t\t\t\t\n\t\t\t\t\t// If there wasn't just a lone ? in the URL\n\t\t\t\t\tif($queryString != ''){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add a RewriteCond for this query string\n\t\t\t\t\t\t$this->buildRewriteCondition('QUERY_STRING', $queryString);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// RewriteRule matches on the request URI without query strings, so remove the query string\n\t\t\t\t\t$source = substr($source, 0, $queryStringPos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Add a RewriteRule for this source / destination\n\t\t\t\t$this->buildRewriteRule($source, $destination);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we are adding the check for mod_rewrite.c add the closing tag\n\t\tif($this->includeIfModuleCheck){\n\t\t\t$this->appendIfModuleCheckEnd();\n\t\t}\n\t\t\n\t\t// Return our rewrites\n\t\treturn $this->rewrites;\n\t}", "public function action_init_register_rewrites() {\n add_rewrite_endpoint( 'ics', EP_PERMALINK );\n }", "function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}", "public function mod_rewrite_rules()\n {\n }", "function eman_add_rewrites( $content )\n\t{\n\t\tglobal $wp_rewrite;\n\t\t$new_non_wp_rules = array(\n\t\t\t'assets/(.*)' => THEME_PATH . '/assets/$1',\n\t\t\t'plugins/(.*)' => RELATIVE_PLUGIN_PATH . '/$1'\n\t\t);\n\t\t$wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $new_non_wp_rules);\n\t\treturn $content;\n\t}", "function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}", "function got_url_rewrite()\n {\n }", "function got_mod_rewrite()\n {\n }", "function wpbp_add_rewrites($content) {\n global $wp_rewrite;\n $llama_new_non_wp_rules = array(\n \t// icons for home screen and bookmarks\n\t 'assets/icons/(.*)' => THEME_PATH . '/assets/icons/$1',\n \t'favicon.ico' => 'assets/icons/favicon.ico',\n \t'apple-touch(.*).png' => 'assets/icons/apple-touch$1.png',\n\n \t// other rules\n\t 'assets/wpbp-assets/(.*)' => THEME_PATH . '/assets/wpbp-assets/$1',\n '(.*)\\.[\\d]+\\.(css|js)$'\t=> '$1.$2 [L]',\n '(.*)\\.[\\d]+\\.(js)$' => '/$1.$2 [QSA,L]',\n '(.*)\\.[\\d]+\\.(css)$' => '$1.$2 [L]'\n );\n $wp_rewrite->non_wp_rules = array_merge($wp_rewrite->non_wp_rules, $llama_new_non_wp_rules);\n return $content;\n}", "function router_use_rewriting()\n{\n return framework_config('pretty_urls', false, true);\n}", "function save_mod_rewrite_rules()\n {\n }", "public function add_rewrite_rules()\n {\n }", "public function add_rewrite_rules()\n {\n }", "function cu_rewrite_activation() {\n\tcu_rewrite_add_rewrites();\n\tflush_rewrite_rules();\n}", "function can_rewrite(){ return array_val_is($_SERVER,'WDF_FEATURES_REWRITE','on') || array_val_is($_SERVER,'REDIRECT_WDF_FEATURES_REWRITE','on'); }", "public function rewrite();", "public function getRewritten()\n {\n return $this->rewritten;\n }", "public static function addModRewriteConfig()\n {\n try {\n $apache_modules = \\WP_CLI_CONFIG::get('apache_modules');\n } catch (\\Exception $e) {\n $apache_modules = array();\n }\n if ( ! in_array(\"mod_rewrite\", $apache_modules)) {\n $apache_modules[] = \"mod_rewrite\";\n $wp_cli_config = new \\WP_CLI_CONFIG('global');\n $current_config = $wp_cli_config->load_config_file();\n $current_config['apache_modules'] = $apache_modules;\n $wp_cli_config->save_config_file($current_config);\n sleep(2);\n }\n }", "function iis7_save_url_rewrite_rules()\n {\n }", "public function page_rewrite_rules()\n {\n }", "function modify_rewrites() {\n\tadd_rewrite_rule( '^search/?$', 'index.php?s=', 'top' );\n\tadd_rewrite_rule( '^search/page/?([0-9]{1,})/?$', 'index.php?s=&paged=$matches[1]', 'top' );\n}", "function wpbp_flush_rewrites()\n {\n global $wp_rewrite;\n $wp_rewrite->flush_rules();\n }", "function roots_flush_rewrites() {\n\nif(of_get_option('flush_htaccess', false) == 1 || get_transient(\"was_flushed\") === false) {\n\t\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->flush_rules();\n\t\n\t\tset_transient(\"was_flushed\", true, 60 * 60 * 24 * 7 );\n\t}\n}", "public static function add_rewrite_rule()\n {\n }", "public function rewriteEndpoints()\n {\n $this->addEndpoints();\n flush_rewrite_rules();\n }", "public function wp_rewrite_rules()\n {\n }", "function htaccess_rewrite(){\n\n global $SETTINGS;\n\n require_once HOME . '_inc/function/defaults.php';\n\n\t$Plugins = Plugins::getInstance( );\n\n\t/**\n\t * if the apache_get_modules function is\n\t * available, make sure that the apache\n\t * rewrite module is loaded\n\t */\n\tif( function_exists( 'apache_get_modules' ) ){\n\t\t$modules=apache_get_modules();\n\n\t\tif(!in_array('mod_rewrite',$modules))\n\t\t\terror(\n\t\t\t\t'The apache module mod_rewrite must be installed. Please visit <a href=\"http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html\">'\n\t\t\t\t. 'Apache Module mod_rewrite</a> for more details.'\n\t\t\t\t,'Apache Error'\n\t\t\t);\n\t}\n\n\t/**\n\t * build up array of rewrite rules and filter\n\t * through the plugin filter\n\t */\n $rules = defaults_htaccess_rules( SITE_URL );\n \n\t$rules = $Plugins->filter( 'general', 'filter_htaccess', $rules );\n\n $htaccess = defaults_htaccess_content( $rules );\n\n\t/**\n\t * write htaccess file or throw error\n\t */\n\tfile_put_contents( HOME . '.htaccess', $htaccess ) \n\t\tor error(\n\t\t\t'You must grant <i>0777</i> write access to the <i>' . HOME . \n\t\t\t'</i> directory for <a href=\"http://furasta.org\">Furasta.Org</a> to function correctly.' .\n\t\t\t'Please do so then reload this page to save the settings.'\n\t\t\t,'Runtime Error'\n\t\t);\n\n\tif( $SETTINGS[ 'index' ] == 0 ){\n $robots = defaults_robots_content( 0, SITE_URL );\n\n\t\t$robots = $Plugins->filter( 'general', 'filter_robots', $robots );\n\t}\n else{\n $robots = defaults_robots_content( 1, SITE_URL );\n $file=HOME.'sitemap.xml';\n if(file_exists($file))\n unlink($file);\n\n\t}\n\n\t/**\n\t * write robots.txt or throw error\n\t */\n\tfile_put_contents( HOME. 'robots.txt', $robots );\n\n\treturn true;\n}", "function rad_rewrite_flush(){\n\trad_setup_products(); //the function above that set up the CPT\n\tflush_rewrite_rules(); //re-builds the .htaccess rules\n}", "function dump_rewrite_rules_to_file()\n{\n $images_url = \\DB::connection('mysql')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $videos_url = \\DB::connection('mysqlVideo')->table('url_rewrites')\n ->select(['from_url', 'to_url', 'type'])\n ->get()\n ->map(function ($row) {\n return \"rewrite \\\"^{$row->from_url}$\\\" {$row->to_url} redirect;\";\n });\n\n $content = $images_url\n ->merge($videos_url)\n ->pipe(function ($collection) {\n return implode(\"\\n\", $collection->toArray());\n });\n\n file_put_contents(public_path('nginx.conf'), $content);\n devops_reload_nginx();\n return true;\n}", "function humcore_add_rewrite_rule() {\n\n\tadd_rewrite_rule(\n\t\t'(deposits/item)/([^/]+)(/(review))?/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_command=$matches[4]',\n\t\t'top'\n\t);\n\n\tadd_rewrite_rule(\n\t\t'(deposits/download)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n\t// Rewrite for deposits/objects handled as ngix proxy pass.\n\n\tadd_rewrite_rule(\n\t\t'(deposits/view)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n add_rewrite_rule(\n '(deposits/list)/?$',\n 'index.php?pagename=$matches[1]',\n 'top'\n );\n\n}", "function nesia_flush_rewriterules () {\r\r\n\tflush_rewrite_rules();\r\r\n}", "public function rewriteRules()\n {\n add_rewrite_rule('janrain/(.*?)/?$', 'index.php?janrain=$matches[1]', 'top');\n add_rewrite_tag('%janrain%', '([^&]+)');\n }", "function rewrite_xmlsitemap_d4seo( $rewrites ) {\n\n\t\t$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml$'] = 'index.php?xmlsitemap=1&xmlurl=$matches[2]';\n\t\t#$rewrites['sitemap(-+([a-zA-Z0-9_-]+))?\\.xml\\.gz$'] = 'index.php?xmlsitemap=1params=$matches[2];zip=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html$' => 'index.php?xmlsitemap=1params=$matches[2];html=true';\n\t\t#$rewrites[] = 'sitemap(-+([a-zA-Z0-9_-]+))?\\.html.gz$' => 'index.php?xmlsitemap=1params=$matches[2];html=true;zip=true';\n\t\treturn $rewrites;\n\n\t}", "function mrl_mod_rewrite( $rules ) {\r\n $options = get_option('MyReadingLibraryOptions');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([0-9]+)/?$', 'index.php?my_reading_library_id=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . 'page/([^/]+)/?$', 'index.php?my_reading_library_page=$matches[1]', 'top'); \r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . 'reader/([^/]+)/?$', 'index.php?my_reading_library_reader=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([^/]+)/([^/]+)/?$', 'index.php?my_reading_library_author=$matches[1]&my_reading_library_title=$matches[2]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '([^/]+)/?$', 'index.php?my_reading_library_author=$matches[1]', 'top');\r\n add_rewrite_rule(preg_quote($options['permalinkBase']) . '?$', 'index.php?my_reading_library_library=1', 'top');\r\n}", "protected function _getUrlRewrite()\n {\n if (!$this->hasData('url_rewrite')) {\n $this->setUrlRewrite($this->_rewriteFactory->create());\n }\n return $this->getUrlRewrite();\n }", "public static function generateHtAccess()\n {\n\n // open template file for reading and store the content to variable\n $fp_template = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/htaccess.template', 'r');\n $template = fread($fp_template, filesize($_SERVER[\"DOCUMENT_ROOT\"] . \"/htaccess.template\"));\n fclose($fp_template);\n\n $app_rewrites = \"\";\n // get all the registered applications\n $app_repo = new ApplicationRepository();\n $app_listings = $app_repo->getAll();\n\n $app_domain_repo = new DomainWhitelistRepository();\n foreach ($app_listings as $app) {\n\n $app_rewrites .= \" # app = $app->name\" . \"\\n\";\n // if application have any whitelisting\n $app_whitelists = $app_domain_repo->getByApplicationId($app->id);\n if ($app_whitelists != null) {\n $isOr = sizeof($app_whitelists) > 0 ? \"[OR]\" : \"\";\n $cnt = 0;\n foreach ($app_whitelists as $listing) {\n\n // dont add [OR] in last condition\n if ($cnt == sizeof($app_whitelists) - 1) $isOr = \"\";\n\n if (!empty($listing->domain)) {\n\n $app_rewrites .= \" RewriteCond %{HTTP_HOST} =$listing->domain $isOr\" . \"\\n\";\n\n } else if (!empty($listing->ip_address)) {\n\n $escaped_ip = str_replace(\".\", \"\\.\", $listing->ip_address);\n $app_rewrites .= \" RewriteCond %{REMOTE_ADDR} =^$escaped_ip$ $isOr\" . \"\\n\";\n\n }\n\n $cnt++;\n }\n }\n\n $app_rewrites .= \" RewriteRule api/$app->app_api_slug/(.*)$ api/generic/api.php [QSA,NC,L]\" . \"\\n\\r\";\n\n }\n\n $template = str_replace(\"{app_rewrites}\", $app_rewrites, $template);\n\n // write the final template to .htaccess file and close it.\n $fp = fopen($_SERVER[\"DOCUMENT_ROOT\"] . '/.htaccess', 'w+');\n if ($fp) {\n fwrite($fp, $template);\n fclose($fp);\n }\n }", "function cu_rewrite_add_rewrites() {\n\tadd_rewrite_tag( '%cpage%', '[^/]' );\n\tadd_rewrite_rule(\n\t\t'^users/?$',\n\t\t'index.php?cpage=custom_page_url',\n\t\t'top'\n\t);\n}", "public function hookModuleRoutes($params)\n {\n $base_route = Configuration::get('EVERPSBLOG_ROUTE') ? Configuration::get('EVERPSBLOG_ROUTE') : 'blog';\n\n return array(\n 'module-everpsblog-blog' => array(\n 'controller' => 'blog',\n 'rule' => $base_route,\n 'keywords' => [\n ],\n 'params' => array(\n 'fc' => 'module',\n 'module' => 'everpsblog',\n 'controller' => 'blog',\n )\n ),\n 'module-everpsblog-category' => array(\n 'controller' => 'category',\n 'rule' => $base_route.'/category{/:id_ever_category}-{:link_rewrite}',\n 'keywords' => array(\n 'id_ever_category' => array('regexp' => '[0-9]+', 'param' => 'id_ever_category'),\n 'link_rewrite' => ['regexp' => '[_a-zA-Z0-9-\\pL]*'],\n ),\n 'params' => array(\n 'fc' => 'module',\n 'module' => 'everpsblog',\n )\n ),\n 'module-everpsblog-post' => array(\n 'controller' => 'post',\n 'rule' => $base_route.'/post{/:id_ever_post}-{:link_rewrite}',\n 'keywords' => array(\n 'id_ever_post' => array('regexp' => '[0-9]+', 'param' => 'id_ever_post'),\n 'link_rewrite' => array('regexp' => '[_a-zA-Z0-9-\\pL]*'),\n ),\n 'params' => array(\n 'fc' => 'module',\n 'module' => 'everpsblog',\n )\n ),\n 'module-everpsblog-tag' => array(\n 'controller' => 'tag',\n 'rule' => $base_route.'/tag{/:id_ever_tag}-{:link_rewrite}',\n 'keywords' => array(\n 'id_ever_tag' => array('regexp' => '[0-9]+', 'param' => 'id_ever_tag'),\n 'link_rewrite' => array('regexp' => '[_a-zA-Z0-9-\\pL]*'),\n ),\n 'params' => array(\n 'fc' => 'module',\n 'module' => 'everpsblog',\n )\n ),\n 'module-everpsblog-author' => array(\n 'controller' => 'author',\n 'rule' => $base_route.'/author{/:id_ever_author}-{:link_rewrite}',\n 'keywords' => array(\n 'id_ever_author' => array('regexp' => '[0-9]+', 'param' => 'id_ever_author'),\n 'link_rewrite' => array('regexp' => '[_a-zA-Z0-9-\\pL]*'),\n ),\n 'params' => array(\n 'fc' => 'module',\n 'module' => 'everpsblog',\n )\n )\n );\n }", "public function setAllowedRewrites($rewrites, $merge = false)\n {\n return $this->_setConfigArrayValue('allowed_rewrites', $rewrites, $merge);\n }", "function refresh_rewrite_rules() {\n\tflush_rewrite_rules();\n\tdo_action( 'rri_flush_rules' );\n}", "protected function register_rewrite_rules() {\n\t\tif ( ! empty( $this->rules ) ) {\n\t\t\tforeach ( $this->rules as $value ) {\n\t\t\t\tadd_rewrite_rule( $value['regex'], $value['replace'], $value['type'] );\n\t\t\t}\n\t\t}\n\t}", "static function register_args(): array { return ['rewrite' => false]; }", "function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}", "function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}", "function custom_rewrite_rule() {\n\n}", "public function using_mod_rewrite_permalinks()\n {\n }", "function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}", "function fs_rewrite_flush() {\r\n\tflush_rewrite_rules();\r\n}", "protected function _isUrlRewriteEnabled()\n {\n return Mage::getStoreConfigFlag('web/seo/use_rewrites');\n }", "static public function add_rewrite_rules(){\n\t global $wp,$wp_rewrite; \n\t $wp->add_query_var( 'profile' );\n\n\t foreach( AT_Route::fronted() as $key=>$params ){\n\t\t\t$wp_rewrite->add_rule('^' .$key, 'index.php?profile=true', 'top');\n\t\t\tforeach ( $params['regular_expressions'] as $key => $expression ) {\n\t\t\t\t$wp_rewrite->add_rule('^' .$key . $expression, 'index.php?profile=true', 'top');\n\t\t\t}\n\n\t }\n\n\t $wp_rewrite->flush_rules();\n\t}", "function generateRewriteRules($config)\n {\n // generate mod-rewrite htaccess rules\n $rewrite = array($this->beginMarker);\n if( $config->htaccess_no_indexes ) {\n $rewrite[] = \"\\n# Don't allow directory browsing (for images / thumbs / etc)\";\n $rewrite[] = \"Options -Indexes\\n\\n\";\n }\n if( !$config->hotlink_thumbnails || !$config->hotlink_images || $config->rewrite_old_urls \n \t\t|| $config->monitor_thumbnail_bandwidth || $config->monitor_image_bandwidth \n || $config->rewrite_urls) {\n $rewrite[] = \"<ifModule mod_rewrite.c>\";\n $rewrite[] = \"Options +FollowSymLinks\";\n \t$rewrite[] = \"RewriteEngine On\";\n if( $config->rewrite_old_urls ) {\n $rewrite[] = $this->rewriteOldURLs();\n }\n $rewrite[] = $this->getImageBandwidthRules($config);\n $rewrite[] = $this->getImageHotlinkRules($config);\n $rewrite[] = $this->getThumbnailHotlinkRules($config);\n $rewrite[] = $this->getThumbnailBandwidthRules($config);\n $rewrite[] = $this->getURLRewriteRules($config);\n $rewrite[] = \"</ifModule>\";\n }\n $rewrite[] = $this->endMarker.\"\\n\\n\";\n return join(\"\\n\", $rewrite);\n }", "function flush_rewrite_rules($hard = \\true)\n {\n }", "private function _load_rewriter_class()\n\t{\n\t\trequire_once dirname(__FILE__) . '/rewriter/rewriter.php';\n\t\trequire_once dirname(__FILE__) . '/rewriter/nginx.php';\n\t\trequire_once dirname(__FILE__) . '/rewriter/apache.php';\n\n\t\t// @since 1.3.2 we initiate both rewriter classes to support special\n\t\t// setups such as nginx is used as a reverse proxy for apache\n\t\t$this->rewriter_apache = new BWP_Minify_Rewriter_Apache($this);\n\t\t$this->rewriter_nginx = new BWP_Minify_Rewriter_Nginx($this);\n\n\t\t// assume apache if not nginx\n\t\t$this->rewriter = self::is_nginx() ? $this->rewriter_nginx : $this->rewriter_apache;\n\t}", "public function add_rewrite_rules() {\n add_rewrite_tag('%salesforce-login%', '([^&]+)');\n add_rewrite_rule('salesforce-login/?$', 'index.php?salesforce-login=salesforce-login', 'top');\n\n add_rewrite_tag('%salesforce-callback%', '([^&]+)');\n add_rewrite_rule('salesforce-callback/?$', 'index.php?salesforce-callback=salesforce-callback', 'top');\n }", "function wpgrade_gets_active() {\r\n flush_rewrite_rules();\r\n}", "public function registerRules()\n {\n\n $routes = $this->getRoutes();\n if (!empty($routes)) {\n add_rewrite_tag('%' . $this->routeVariable . '%', '(.+)');\n foreach ($routes as $name => $route) {\n /** @var Route $route */\n $regex = $this->generateRouteRegex($route);\n $path = $route->getPath();\n\n $qs = $this->routeVariable . '=' . $name;\n if (strpos($path, '{') !== false) {\n preg_match_all('/{(.*?)}/', $path, $wildCardsMatchs);\n $wildCards = $wildCardsMatchs[1];\n if (!empty($wildCards)) {\n $cpt = 1;\n foreach ($wildCards as $wildCard) {\n $qs .= '&' . $wildCard . '=$matches[' . $cpt . ']';\n $cpt++;\n }\n }\n }\n $callable = $route->getCallable();\n if (is_callable($callable) || is_array($callable)) {\n $newRewriteRule = 'index.php?' . $qs;\n } else {\n $newRewriteRule = $callable;\n if (strpos($newRewriteRule, $this->routeVariable . '=' . $name) === false) {\n $newRewriteRule .= '&' . $this->routeVariable . '=' . $name;\n }\n }\n\n add_rewrite_rule($regex, $newRewriteRule, 'top');\n }\n }\n\n return $this;\n }", "protected function register_rewrite_endpoints() {\n\t\tif ( ! empty( $this->endpoints ) ) {\n\t\t\tforeach ( $this->endpoints as $slug => $arr ) {\n\t\t\t\tadd_rewrite_endpoint( $slug, $arr['type'] );\n\t\t\t}\n\t\t}\n\t}", "public function load_rewrites(WP_Rewrite $wp_rewrite)\n {\n // Don't add rewrite rules if archive page of MEC is disabled\n if(!$this->main->get_archive_status()) return;\n \n if(!$wp_rewrite instanceof WP_Rewrite)\n {\n global $wp_rewrite;\n }\n \n // MEC main slug\n $slug = $this->main->get_main_slug();\n \n // MEC main post type name\n $PT = $this->main->get_main_post_type();\n \n $rules = array(\n '(?:'.$slug.')/(\\d{4}-\\d{2})/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month&MecDate=$matches[1]',\n '(?:'.$slug.')/(?:monthly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month',\n '(?:'.$slug.')/(?:weekly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=week',\n '(?:'.$slug.')/(?:daily)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=day',\n '(?:'.$slug.')/(?:map)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=map',\n '(?:'.$slug.')/(?:list)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=list',\n '(?:'.$slug.')/(?:grid)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=grid',\n '(?:'.$slug.')/?$'=>'index.php?post_type='.$PT.'&MecDisplay=default',\n '(?:'.$slug.')/(feed|rdf|rss|rss2|atom)/?$'=>'index.php?post_type='.$PT.'&feed=$matches[1]',\n );\n\n $wp_rewrite->rules = $rules + $wp_rewrite->rules;\n }", "function get_RewriteBase() {\n\t\t$RewriteBase = str_replace(\"/admin/index.php\",\"\",$_SERVER[\"PHP_SELF\"]);\n\t\t\n\t\treturn $RewriteBase;\n\t}", "function rewrite_rules($wp_rewrite) {\n $new_rules = array(\n 'hcard_url/(.+)' => 'index.php?hcard_url=' . $wp_rewrite->preg_index(1)\n );\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n }", "public function loadRewriteRules() : void {\n // get user rewrite rules, use regular and escaped versions of them\n $this->rewrite_rules =\n RewriteRules::generate(\n $this->site_url,\n $this->destination_url\n );\n\n if ( ! $this->rewrite_rules ) {\n $err = 'No URL rewrite rules defined';\n WsLog::l( $err );\n throw new WP2StaticException( $err );\n }\n }", "public function add_rewrite_rules() {\n\t\t$priority = 'top';\n\t\t$root_rule = '/([^/]+)/?$';\n\n\t\t$page_slug = wct_paged_slug();\n\t\t$paged_rule = '/([^/]+)/' . $page_slug . '/?([0-9]{1,})/?$';\n\t\t$embed_rule = '/([^/]+)/embed/?$';\n\n\t\t// User Comments\n\t\t$user_comments_rule = '/([^/]+)/' . $this->user_comments_slug . '/?$';\n\t\t$user_comments_paged_rule = '/([^/]+)/' . $this->user_comments_slug . '/' . $this->cpage_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User Rates\n\t\t$user_rates_rule = '/([^/]+)/' . $this->user_rates_slug . '/?$';\n\t\t$user_rates_paged_rule = '/([^/]+)/' . $this->user_rates_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User to rate\n\t\t$user_to_rate_rule = '/([^/]+)/' . $this->user_to_rate_slug . '/?$';\n\t\t$user_to_rate_paged_rule = '/([^/]+)/' . $this->user_to_rate_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User talks\n\t\t$user_talks_rule = '/([^/]+)/' . $this->user_talks_slug . '/?$';\n\t\t$user_talks_paged_rule = '/([^/]+)/' . $this->user_talks_slug . '/' . $page_slug . '/?([0-9]{1,})/?$';\n\n\t\t// User rules\n\t\tadd_rewrite_rule( $this->user_slug . $user_comments_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_comments_rid . '=1&' . $this->cpage_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_comments_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_comments_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_rates_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_rates_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_rates_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_rates_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_to_rate_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_to_rate_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_to_rate_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_to_rate_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_talks_paged_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_talks_rid . '=1&' . $this->page_rid . '=$matches[2]', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $user_talks_rule, 'index.php?' . $this->user_rid . '=$matches[1]&' . $this->user_talks_rid . '=1', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $embed_rule, 'index.php?' . $this->user_rid . '=$matches[1]&embed=true', $priority );\n\t\tadd_rewrite_rule( $this->user_slug . $root_rule, 'index.php?' . $this->user_rid . '=$matches[1]', $priority );\n\n\t\t// Action rules (only add a new talk right now)\n\t\tadd_rewrite_rule( $this->action_slug . $root_rule, 'index.php?' . $this->action_rid . '=$matches[1]', $priority );\n\t}", "function jfb_add_rewrites($wp_rewrite)\r\r\n{\r\r\n $autologin = explode(get_bloginfo('url'), plugins_url(dirname(plugin_basename(__FILE__))));\r\r\n $autologin = trim($autologin[1] . \"/_autologin.php\", \"/\") . '?p=$1';\r\r\n $wp_rewrite->non_wp_rules = $wp_rewrite->non_wp_rules + array('autologin[/]?([0-9]*)$' => $autologin);\r\r\n}", "private function flush_rewrite_rules() {\n\n\t\tglobal $updraftplus_addons_migrator;\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) switch_to_blog($updraftplus_addons_migrator->new_blogid);\n\n\t\t$filter_these = array('permalink_structure', 'rewrite_rules', 'page_on_front');\n\t\t\n\t\tforeach ($filter_these as $opt) {\n\t\t\tadd_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tglobal $wp_rewrite;\n\t\t$wp_rewrite->init();\n\t\t// Don't do this: it will cause rules created by plugins that weren't active at the start of the restore run to be lost\n\t\t// flush_rewrite_rules(true);\n\n\t\tif (function_exists('save_mod_rewrite_rules')) save_mod_rewrite_rules();\n\t\tif (function_exists('iis7_save_url_rewrite_rules')) iis7_save_url_rewrite_rules();\n\n\t\tforeach ($filter_these as $opt) {\n\t\t\tremove_filter('pre_option_'.$opt, array($this, 'option_filter_'.$opt));\n\t\t}\n\n\t\tif (!empty($updraftplus_addons_migrator->new_blogid)) restore_current_blog();\n\n\t}", "public function flush_rewrites() {\n\t\t$flush_rewrites = get_option( 'ccf_flush_rewrites' );\n\n\t\tif ( ! empty( $flush_rewrites ) ) {\n\t\t\tflush_rewrite_rules();\n\n\t\t\tdelete_option( 'ccf_flush_rewrites' );\n\t\t}\n\t}", "public function requestUriProvider() {\n return array(\n array(array( // apache and lighttpd\n 'server' => array(\n 'REQUEST_URI' => '/module/controller/action',\n ),\n )),\n array(array( // iis\n 'server' => array(\n 'HTTP_X_REWRITE_URL' => '/module/controller/action',\n ),\n )),\n );\n }", "public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }", "function wst_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "function add_rewrite_rules() {\n\n\tadd_rewrite_tag( '%image%', '([^/]*)');\n\n\tadd_rewrite_rule('^gallery/([^/]*)/([^/]*)/?$', 'index.php?gallery=$matches[1]&image=$matches[2]', 'top');\n}", "public function getXmlClassRewrites()\n {\n $cache = Mage::app()->loadCache(self::CACHE_KEY_XML);\n if ($this->useCache() && $cache) {\n $result = unserialize($cache);\n } else {\n $classRewrites = array();\n $modules = $this->_getAllModules();\n\n foreach ($modules as $modName => $module) {\n if ($this->_skipValidation($modName, $module)) {\n continue;\n }\n $result = $this->_getRewritesInModule($modName);\n if (!empty($result)) {\n $classRewrites[] = $result;\n }\n }\n $result = $this->_getClassMethodRewrites($classRewrites);\n if ($this->useCache()) {\n Mage::app()->saveCache(serialize($result), self::CACHE_KEY_XML,\n array(self::CACHE_TYPE));\n }\n }\n return $result;\n }", "public static function ParseModRewrite() {\n\t\t// parse mod_rewrite uri\n\t\tif (isset($_SERVER['REDIRECT_STATUS'])) {\n\t\t\t$data = $_SERVER['REQUEST_URI'];\n\t\t\t// parse ? query string\n\t\t\tif (\\mb_strpos($data, '?') !== FALSE) {\n\t\t\t\tlist($data, $query) = \\explode('?', $data, 2);\n\t\t\t\tif (!empty($query)) {\n\t\t\t\t\t//$arr = explode('&', $query);\n\t\t\t\t\t//echo 'query: ?'.$query.'<br />';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// parse url path\n\t\t\t$data = \\array_values(\\psm\\utils::array_remove_empty(\\explode('/', $data)));\n\t\t\t// needs to be even\n\t\t\tif ((\\count($data) % 2) != 0)\n\t\t\t\t$data[] = '';\n\t\t\t// merge values into GET\n\t\t\tfor ($i=0; $i<\\count($data); $i++) {\n\t\t\t\t$_GET[$data[$i]] = $data[++$i];\n\t\t\t}\n\t\t}\n\t}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "function odin_flush_rewrite() {\n\tflush_rewrite_rules();\n}", "public function rewriteEndpoint (){\n add_rewrite_endpoint( 'agreementArchiveId', EP_ALL );\n add_rewrite_endpoint( 'searchAgreementArchive', EP_ALL );\n\n flush_rewrite_rules();\n }", "function registerHooks(): void\n{\n\tregister_activation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_deactivation_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n\tregister_uninstall_hook( __FILE__, __NAMESPACE__ . '\\\\flushRewriteRules' );\n}", "private function _add_rewrite_rules($suppress = true)\n\t{\n\t\t$result = $this->rewriter->add_rewrite_rules($suppress);\n\n\t\t// failed to add rewrite rules, and required rewrite rules are not\n\t\t// there yet, and errors are suppressed\n\t\tif ($suppress && $result !== true && $result !== 'written')\n\t\t{\n\t\t\t// turn off friendly minify url feature and set a nag to notify\n\t\t\t// owner in next refresh\n\t\t\t$options = get_option(BWP_MINIFY_OPTION_ADVANCED);\n\n\t\t\t$options['enable_fly_min'] = '';\n\t\t\t$options['enable_fly_min_nag'] = 'yes';\n\n\t\t\tupdate_option(BWP_MINIFY_OPTION_ADVANCED, $options);\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\n }", "function kalabera_flush_rewrite_rules() {\n flush_rewrite_rules();\n}", "private function _toggle_rewrite_rules(&$options)\n\t{\n\t\t// do not suppress error\n\t\t$this->rewriter->no_suppress();\n\n\t\t// try to add required rewrite rules to wp's main .htaccess file\n\t\t$result = $this->rewriter->add_wp_rewrite_rules();\n\n\t\t// could not write rewrite rules to wp's main .htaccess file\n\t\tif (true !== $result && 'written' !== $result)\n\t\t{\n\t\t\t$config_file = $this->rewriter->get_wp_config_file();\n\t\t\t$error = $this->_get_rewrite_rules_error($result, $config_file);\n\n\t\t\t$this->add_error($error);\n\t\t\t/* $form['container']['h1'][] = $this->_show_generated_wp_rewrite_rules(); */\n\t\t}\n\n\t\t// asumming apache, need to add rules to cache directory too\n\t\tif (false == self::is_nginx())\n\t\t{\n\t\t\t$result = $this->rewriter->add_cache_rewrite_rules();\n\t\t\t$config_file = $this->rewriter->get_cache_config_file();\n\n\t\t\tif (true !== $result && 'written' !== $result)\n\t\t\t{\n\t\t\t\t// get appropriate error messages and show it to admin\n\t\t\t\t$error = $this->_get_rewrite_rules_error($result, $config_file);\n\t\t\t\t$this->add_error($error);\n\n\t\t\t\t// in any case rewrite rules were NOT successfully written,\n\t\t\t\t// except for when rewrite rules are already found,\n\t\t\t\t// turn off this setting to prevent site from breaking,\n\t\t\t\t// and show the auto-generated rules to admin\n\t\t\t\t$options['enable_fly_min'] = '';\n\t\t\t\tupdate_option(BWP_MINIFY_OPTION_ADVANCED, $options);\n\n\t\t\t\t$this->add_notice(\n\t\t\t\t\t'<strong>' . __('Notice') . ':</strong> '\n\t\t\t\t\t. __('Friendly minify url feature has been turned off '\n\t\t\t\t\t. 'automatically to prevent your site from breaking. ', $this->domain)\n\t\t\t\t);\n\n\t\t\t\t/* $form['container']['h1'][] = $this->_show_generated_cache_rewrite_rules(); */\n\t\t\t}\n\t\t\telse if (true === $result)\n\t\t\t{\n\t\t\t\t// successfully enable friendly minify url feature,\n\t\t\t\t// flush all cached files and auto-detect groups\n\t\t\t\t$this->_flush_cache();\n\t\t\t\t$this->detector->auto_detect();\n\t\t\t}\n\t\t}\n\t}", "public function createHtaccessFile() {\n $oModule = oxNew(Module::class);\n $oConfig = $this->getConfig();\n // get modules path\n $sModulesDir = $oConfig->getModulesDir();\n // get cache path\n $sCacheDir = $oConfig->getConfigParam('sCompileDir');\n // check if the default .htaccess file is in config folder\n if(file_exists($sModulesDir.$oModule->getModulePath('suaboclearcache').'/Config/.htaccess.tmp')) {\n // copy .htaccess to cache folder\n copy($sModulesDir . $oModule->getModulePath('suaboclearcache') . '/Config/.htaccess.tmp', $sCacheDir . '/.htaccess');\n }\n }", "private function appendTurnOnEngine(){\n\t\t$string = 'RewriteEngine on';\n\t\t$this->appendLineToRewrites($string);\n\t}", "function al3_flush_rewrite_rules_events() {\n\tflush_rewrite_rules();\n}", "function _generate_auto_routes()\n {\n $module_routes = array();\n $module_routes[0] = array();\n $module_routes[1] = array();\n $module_routes[2] = array();\n $module_routes[3] = array();\n\n $dir = APPPATH . 'controllers' . '/';\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle)))\n {\n if(is_file($dir . $file) && substr($file, -4) == '.php'){\n $file = str_replace('.php', '', $file);\n $file = strtolower($file);\n $module_routes[0][$file . '(/.*)?'] = $file . '/index$1';\n } elseif(is_dir($dir2 = $dir . $file . DS) && !preg_match('/[^a-z0-9\\/\\\\\\_\\-]/i', $dir2)) {\n if ($handle2 = opendir($dir2)) {\n while (false !== ($file2 = readdir($handle2))) {\n if(!preg_match('/[^a-z0-9]/i', $file2)){\n $module_routes[3][$file2 . '(/.*)?'] = strtolower($file) . '/' . strtolower($file2) . '/' . strtolower($file2) . '/index$1';\n }\n if(is_file($dir2 . $file2) && substr($file2, -4) == '.php'){\n $file2 = str_replace('.php', '', $file2);\n $file = strtolower($file);\n $file2 = strtolower($file2);\n $module_routes[1][$file . '/' . $file2 . '(/.*)?'] = $file . '/' . $file2 . '/index$1';\n } elseif(is_dir($dir3 = $dir2 . $file2 . DS) && !preg_match('/[^a-z0-9\\/\\\\\\_\\-]/i', $dir3)) {\n if ($handle3 = opendir($dir3)) {\n while (false !== ($file3 = readdir($handle3))) {\n if(is_file($dir3 . $file3) && substr($file3, -4) == '.php'){\n $file3 = str_replace('.php', '', $file3);\n $key = '';\n $val = $file . '/';\n if ($this->routes['front_controllers_folder'] != $file) {\n $key .= $file . '/';\n //$val = '';\n }\n\n if ($file2 == $file3) {\n $key .= $file3;\n }\n else\n {\n $key .= $file2 . '/' . $file3;\n }\n\n $val .= $file2 . '/' . $file3;\n\n $key = strtolower($key);\n $val = strtolower($val);\n\n $module_routes[2][$key . '(/.*)?'] = $val . '/index$1';\n }\n }\n closedir($handle3);\n }\n }\n }\n closedir($handle2);\n }\n }\n }\n }\n closedir($handle);\n\n $module_routes = array_merge($module_routes[3], $module_routes[2], $module_routes[1], $module_routes[0], $this->routes);\n krsort($module_routes);\n\n return $module_routes;\n }", "private function checkHealth(){\n\n if(strpos($_SERVER['SERVER_SOFTWARE'], 'Apache')===FALSE)\n $this->apache = false;\n\n if(function_exists('apache_get_modules')){\n $mods = apache_get_modules();\n if(!in_array('mod_rewrite', $mods))\n $this->rewrite = false;\n }\n\n if(!$this->apache || !$this->rewrite){\n showMessage(__('URL rewriting requires an Apache Server and mod_rewrite enabled!','dtransport'), RMMSG_WARN);\n return false;\n }\n\n if(!preg_match(\"/RewriteEngine\\s{1,}On/\", $this->content))\n $this->content .= \"\\nRewriteEngine On\\n\";\n\n $base = parse_url(XOOPS_URL.'/');\n $this->base = isset($base['path']) ? rtrim($base['path'], '/').'/' : '/';\n $rb = \"RewriteBase \".$this->base.\"\\n\";\n\n if(strpos($this->content, $rb)===false){\n if(preg_match(\"/RewriteBase/\", $this->content))\n preg_replace(\"/RewriteBase\\s{1,}(.*)\\n\",$rb, $this->content);\n else\n $this->content .= $rb.\"\\n\";\n }\n\n if(!preg_match(\"/RewriteCond\\s{1,}\\%\\{REQUEST_URI\\}\\s{1,}\\!\\/\\[A\\-Z\\]\\+\\-/\", $this->content))\n $this->content .= \"RewriteCond %{REQUEST_URI} !/[A-Z]+-\\n\";\n\n if(!preg_match(\"/RewriteCond\\s{1,}\\%\\{REQUEST_FILENAME\\}\\s{1,}\\!\\-f/\", $this->content))\n $this->content .= \"RewriteCond %{REQUEST_FILENAME} !-f\\n\";\n\n if(!preg_match(\"/RewriteCond\\s{1,}\\%\\{REQUEST_FILENAME\\}\\s{1,}\\!\\-d/\", $this->content))\n $this->content .= \"RewriteCond %{REQUEST_FILENAME} !-d\\n\";\n\n\n\n }", "public function getModuleRoutes()\n {\n return isset($this->config['module']['routes']) ? $this->config['modules']['routes'] : [];\n }", "public function getRewriteMode(): bool\n {\n return $this->rewriteMode;\n }", "public function fixRewrite()\n {\n if (!defined('REWRITED')) {\n preg_match(\"#^([^\\.]*)\\.#\", $_SERVER['HTTP_HOST'], $match);\n if ($_SERVER['HTTP_HOST'] != $GLOBALS['domain_info']['host']\n && $_GET['page'] && $_GET['page'] != $match[1]\n ) {\n $_GET['rlVareables'] = $_GET['page'] . ($_GET['rlVareables'] ? '/' . $_GET['rlVareables'] : '');\n\n $_GET['page'] = $match[1];\n $_GET['wildcard'] = '';\n } elseif ($_SERVER['HTTP_HOST'] != $GLOBALS['domain_info']['host']\n && (!isset($_GET['page']) || $_GET['listing_id'])\n ) {\n $_GET['page'] = $match[1];\n $_GET['wildcard'] = '';\n }\n\n define('REWRITED', true);\n }\n }", "protected function preReRouting()\n {\n\n }", "protected function _getUrlRewrite()\n {\n if (!$this->_urlRewrite) {\n $this->_urlRewrite = $this->_objectManager->create(\\Magento\\UrlRewrite\\Model\\UrlRewrite::class);\n $urlRewriteId = (int)$this->getRequest()->getParam('id', 0);\n if ($urlRewriteId) {\n $this->_urlRewrite->load($urlRewriteId);\n }\n }\n return $this->_urlRewrite;\n }", "private function appendIfModuleCheckStart(){\n\t\t$string = '<IfModule mod_rewrite.c>';\n\t\t$this->appendLineToRewrites($string);\n\t}", "function prefix_url_rewrite_get($bits, $rbits) {\n $tests = Array($bits[1]);\n if ( isset($bits[2]) ) {\n $tests[] = \"{$bits[1]}/{$bits[2]}\";\n }\n $rmaps = Array('pressemelding', 'pressemeldinger', 'vi-mener', 'nytt-og-nyttig');\n\n if ( $tpl = prefix_url_rewrite_test($tests) ) {\n if ( in_array($rbits[1], $rmaps) ) {\n return $tpl;\n }\n }\n\n return false;\n}", "public function defineUrlRules(): array\n {\n return array_filter(array_merge(\n $this->moduleUrlRules(),\n $this->defineChildUrlRules()\n ));\n }", "public function rewrite_rules($wp_rewrite) {\r\n $rules = array();\r\n if (SQ_Classes_Tools::getOption('sq_use') == 1) {\r\n\r\n //For Favicon\r\n if (SQ_Classes_Tools::getOption('sq_auto_favicon') == 1) {\r\n $rules['favicon\\.ico$'] = 'index.php?sq_get=favicon';\r\n $rules['favicon\\.icon$'] = 'index.php?sq_get=favicon';\r\n $rules['touch-icon\\.png$'] = 'index.php?sq_get=touchicon';\r\n foreach ($this->model->appleSizes as $size) {\r\n $size = (int)$size;\r\n $rules['touch-icon' . $size . '\\.png$'] = 'index.php?sq_get=touchicon&sq_size=' . $size;\r\n }\r\n }\r\n\r\n if (SQ_Classes_Tools::getOption('sq_auto_feed') == 1) {\r\n $rules['sqfeedcss$'] = 'index.php?sq_get=feedcss';\r\n }\r\n }\r\n return array_merge($rules, $wp_rewrite);\r\n }", "private function _mapRequest()\n {\n $request = $this->app()->request();\n $request_uri = $request->requestURI();\n $script_name = $request->scriptName();\n $rewritten_query_string = \"\";\n\n // If there is no request uri (ie: we are on the command line) we do\n // not rewrite\n if (empty($request_uri)) {\n return;\n }\n\n // Get path to script\n $path = substr($script_name, 0, (strrpos($script_name, '/')+1));\n\n // Remove path from request uri.\n // This gives us the slug plus any query params\n if ($path != \"/\") {\n $params = str_replace($path, \"\", $request_uri);\n } else {\n // If app is in web root we simply remove preceding slash\n $params = substr($request_uri, 1);\n }\n\n $array = explode(\"?\", $params);\n $slug = $array[0];\n if (isset($array[1])) {\n $query_string = $array[1];\n } else {\n $query_string = \"\";\n }\n\n if ($request->method() == \"POST\" && $request->param(\"slug\")) {\n $slug = $request->param(\"slug\");\n }\n\n if (empty($slug) || $slug == \"index.php\") {\n $slug = \"home\";\n }\n\n // Remove trailing slash from slug if present\n if ($slug[(strlen($slug)-1)] == \"/\") {\n $slug = substr($slug, 0, (strlen($slug)-1));\n }\n\n $request->param(\"slug\", $slug);\n\n // Do not build tree if API call\n if (preg_match(\"/^api\\/([a-zA-Z0-9_]*)/\", $slug, $matches)) {\n $request->controllerName(\"api\");\n $request->action($matches[1]);\n return;\n }\n\n $id_obj = $this->_mapper->getIdObject();\n if (!$this->app()->session()->isAuth() || $this->app()->user()->id() > 2) {\n $id_obj->where(\"c.status\", \"=\", 1);\n }\n if ($slug != \"admin/content\") {\n $id_obj->where(\"c.type <> 'PostContent'\", \"OR\", \"c.slug = '\".$slug.\"'\");\n }\n $id_obj->orderby(\"c.pub_date\", \"DESC\");\n\n $collection = $this->_mapper->find($id_obj);\n $this->_buildTree(iterator_to_array($collection));\n\n // If script name doesn't appear in the request URI we need to rewrite\n if (strpos($request_uri, $script_name) === false\n && $request_uri != $path\n && $request_uri != $path.\"index.php\"\n ) {\n $controller = $request->controllerName();\n if ($controller != \"content\") {\n $array = explode(\"/\", $slug);\n $request->controllerName($array[0]);\n $rewritten_query_string = \"controller=\".$array[0];\n if (isset($array[1])) {\n $request->action($array[1]);\n $rewritten_query_string .= \"&action=\".$array[1];\n }\n }\n }\n\n if (!empty($_SERVER['QUERY_STRING'])) {\n $rewritten_query_string .= \"&\".$_SERVER['QUERY_STRING'];\n }\n\n $_SERVER['QUERY_STRING'] = $rewritten_query_string;\n\n // Update request uri\n $_SERVER['REQUEST_URI'] = $path.\"index.php?\";\n $_SERVER['REQUEST_URI'] .= $_SERVER['QUERY_STRING'];\n }", "public function getAppRoutes(){\n $cache=Yii::$app->cache;\n $key = [__METHOD__, Yii::$app->getUniqueId()];\n if(($result = $cache->get($key)) === false){\n $result=$this->getRouteRecrusive('frontend');\n $cache->set($key, $result, \"3600\", new TagDependency([\n 'tags' => self::CACHE_TAG,\n ]));\n }\n return $result;\n }", "function theme_flush_rewrite_rules() {\n\tflush_rewrite_rules();\n}", "function sunrail_api_activation() {\n global $wp_rewrite;\n add_filter('rewrite_rules_array', 'sunrail_api_rewrites');\n $wp_rewrite->flush_rules();\n}", "public function get_rewrite_rules() {\n\t\treturn array(\n\t\t\t'archives/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?category_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/category/(.+?)/page/?([0-9]{1,})/?$' => 'index.php?category_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/category/(.+?)/?$' => 'index.php?category_name=$matches[1]',\n\t\t\t'archives/tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?tag=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?tag=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/tag/([^/]+)/?$' => 'index.php?tag=$matches[1]',\n\t\t\t'archives/type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?post_format=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/type/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?post_format=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/type/([^/]+)/?$' => 'index.php?post_format=$matches[1]',\n\t\t\t'archives/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?author_name=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/author/([^/]+)/page/?([0-9]{1,})/?$' => 'index.php?author_name=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/author/([^/]+)/?$' => 'index.php?author_name=$matches[1]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]',\n\t\t\t'archives/date/([0-9]{4})/([0-9]{1,2})/?$' => 'index.php?year=$matches[1]&monthnum=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?year=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/page/?([0-9]{1,})/?$' => 'index.php?year=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/date/([0-9]{4})/?$' => 'index.php?year=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)/trackback/?$' => 'index.php?p=$matches[1]&tb=1',\n\t\t\t'archives/([0-9]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?p=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/([0-9]+)/page/?([0-9]{1,})/?$' => 'index.php?p=$matches[1]&paged=$matches[2]',\n\t\t\t'archives/([0-9]+)/comment-page-([0-9]{1,})/?$' => 'index.php?p=$matches[1]&cpage=$matches[2]',\n\t\t\t'archives/([0-9]+)(/[0-9]+)?/?$' => 'index.php?p=$matches[1]&page=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/?$' => 'index.php?attachment=$matches[1]',\n\t\t\t'archives/[0-9]+/([^/]+)/trackback/?$' => 'index.php?attachment=$matches[1]&tb=1',\n\t\t\t'archives/[0-9]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$' => 'index.php?attachment=$matches[1]&feed=$matches[2]',\n\t\t\t'archives/[0-9]+/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?attachment=$matches[1]&cpage=$matches[2]'\n\t\t);\n\t}", "function dvs_add_rewrite_rules( $wp_rewrite )\n{\n $new_rules = array(\n 'my-prefix/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),\n );\n\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n}" ]
[ "0.7558917", "0.7188281", "0.700113", "0.6868676", "0.65299636", "0.62868536", "0.6252848", "0.6243035", "0.62160486", "0.621164", "0.6110809", "0.607921", "0.6039175", "0.59781426", "0.5977478", "0.5950538", "0.58845514", "0.5881483", "0.58016205", "0.57591516", "0.5744839", "0.57001567", "0.5653923", "0.5649169", "0.56452435", "0.56222004", "0.561997", "0.561831", "0.56162477", "0.5611305", "0.5549616", "0.55486834", "0.55421054", "0.554168", "0.55332816", "0.5493348", "0.5420376", "0.5409049", "0.53996843", "0.5387584", "0.53650326", "0.53513193", "0.5331579", "0.5321207", "0.5313037", "0.5298624", "0.5280259", "0.5275724", "0.52584016", "0.5252953", "0.52408385", "0.52292925", "0.5215718", "0.5185403", "0.5183487", "0.517501", "0.5171462", "0.51592445", "0.51573473", "0.5152002", "0.51481843", "0.5134098", "0.5132796", "0.5132446", "0.5114738", "0.50940067", "0.5061801", "0.5045645", "0.5045048", "0.5024804", "0.5021551", "0.50189555", "0.50189126", "0.50159484", "0.50159484", "0.50109136", "0.5003656", "0.50007904", "0.4982492", "0.49804428", "0.49642605", "0.49527097", "0.494286", "0.49343672", "0.49332255", "0.49229547", "0.49103877", "0.4903427", "0.4893769", "0.4887123", "0.48847207", "0.48779118", "0.48750922", "0.48706105", "0.48690736", "0.48665553", "0.48650765", "0.48586944", "0.48563424", "0.48539847", "0.4836851" ]
0.0
-1
/ GETTERS AND SETTERS Returns $birthDay.
public function getBirthDay() { if($this->birthDay == null) return ""; else return $this->birthDay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthday()\n {\n return $this->birthday;\n }", "public function getBirthdayDate()\n {\n return $this->birthdayDate;\n }", "public function getBirthDate()\n\t{\n\t\treturn $this->getIfSetDate('birthDate');\n\t}", "public function getBirthDate()\n\t{\n\t\treturn $this->birthDate;\n\t}", "function getDayOfBirth() {\n global $USER;\n\t$dayOfBirth = date(\"d\", $USER['dob']);\n\treturn $dayOfBirth;\n}", "public function getBirthDate()\n {\n return $this->birth_date;\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthDate()\n {\n return $this->birthDate;\n }", "public function getBirthdate()\r\n {\r\n return $this->birthdate;\r\n }", "public function getBirthday() : string\r\n\t{\r\n\t\treturn $this->birthday;\r\n\t}", "public function getBirthdate()\n\t{\n\t\treturn $this->birthdate;\n\t}", "public function getDateofBirth() {\n return $this->dateOfBirth;\n }", "public function getBirthDate()\n {\n if ($this->birthDate) {\n return $this->birthDate;\n }\n\n $centuryCode = substr($this->personal_code, 0, 1);\n if ($centuryCode < 3) {\n $century = 19;\n } elseif ($centuryCode < 5) {\n $century = 20;\n } else {\n $century = 21;\n }\n\n $this->birthDate = new \\DateTime(($century - 1) . substr($this->personal_code, 1, 6));\n\n return $this->birthDate;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function getDateOfBirth()\n {\n return $this->dateOfBirth;\n }", "public function setBirthday($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->birthday !== $v) {\n $this->birthday = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_BIRTHDAY] = true;\n }\n\n return $this;\n }", "public function getBirth()\n {\n return $this->birth;\n }", "public function getBirthdate()\n {\n return $this->birthdate;\n }", "public function getBirthdate(): DateTime\n {\n return $this->birthdate;\n }", "public function getUserBirthday()\n {\n $result = $this->getUserAttribute(static::ATTRIBUTE_BIRTHDAY);\n\n if (!empty($result)) {\n return date('d.m.Y', strtotime($result));\n }\n\n return $result;\n }", "function setDayOfBirth( $sDayOfBirth_ ) {\n\t\t\tif (\n\t\t\t\t! is_string( $sDayOfBirth_ )\n\t\t\t\t|| FALSE == ( $iDayOfBirthUnix = strtotime( $sDayOfBirth_ ) )\n\t\t\t) {\n\t\t\t\tthrow new Exception( 'Address.DayOfBirth.Invalid', 'invalid day of birth: ' . $sDayOfBirth_ );\n\t\t\t}\n\t\t\treturn parent::setDayOfBirth( strftime( '%m/%d/%Y', $iDayOfBirthUnix ) );\n\t\t}", "public function setBirthday($birthday)\n {\n $this->birthday = $birthday;\n\n return $this;\n }", "public function setBirthday($birthday)\n {\n $this->birthday = $birthday;\n\n return $this;\n }", "public function getDateOfBirth() {\n\t\treturn empty( $this->container['dates_of_birth'] ) ? null : $this->container['dates_of_birth'][0];\n\t}", "public function setBirthday($birthday)\n {\n $this->birthday = $birthday;\n }", "public function setBirthday($birthday): self\n {\n $this->birthday = $birthday;\n\n return $this;\n }", "public function getUserDateOfBirth () {\n\t\treturn ($this->userDateOfBirth);\n\t}", "public function getBirthDate()\n {\n return $this->getProfile() ? $this->getProfile()->getBirthDate() : null;\n }", "private function calculateBirthDateAndGender()\n {\n $year = $this->subject->getBirthDate()->format('y');\n $month = $this->months[$this->subject->getBirthDate()->format('n')];\n $day = $this->subject->getBirthDate()->format('d');\n if (strtoupper($this->subject->getGender()) == self::CHR_WOMEN) {\n $day += 40;\n }\n\n return $year . $month . $day;\n }", "public function getBirthDate() : Datetime\n {\n if (is_null($this->birthDate)) {\n $year = $this->getBirthCentury() + substr($this->code, 1, 2);\n $month = substr($this->code, 3, 2);\n $day = substr($this->code, 5, 2);\n\n $this->birthDate = new Datetime($year.'-'.$month.'-'.$day);\n }\n\n return $this->birthDate;\n }", "public function setDateOfBirth()\n {\n $dateOfBirth = request('dob_year') . '-' . request('dob_month') . '-' . request('dob_day');\n\n $this->date_of_birth = $dateOfBirth;\n $this->save();\n }", "public function getCbirthday()\n {\n return $this->cbirthday;\n }", "function born() {\n if (empty($this->birthday)) {\n if ($this->page[\"Name\"] == \"\") $this->openpage (\"Name\",\"person\");\n if (preg_match(\"/Date of Birth:<\\/h5>\\s*<a href=\\\"\\/OnThisDay\\?day\\=(\\d{1,2})&month\\=(.*?)\\\">.*?<a href\\=\\\"\\/BornInYear\\?(\\d{4}).*?href\\=\\\"\\/BornWhere\\?.*?\\\">(.*?)<\\/a>/ms\",$this->page[\"Name\"],$match))\n $this->birthday = array(\"day\"=>$match[1],\"month\"=>$match[2],\"year\"=>$match[3],\"place\"=>$match[4]);\n }\n return $this->birthday;\n }", "public function testCanGetBirthDay() : void\n {\n $this->assertSame('10', $this->personalCodeObj->getBirthDay());\n\n $formatsAndExpectedValues = [\n 'D' => 'Sat', // A textual representation of a day, three letters\n 'j' => 10, // Day of the month without leading zeros\n 'l' => 'Saturday', // A full textual representation of the day of the week\n 'N' => 6, // ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0)\n 'S' => 'th', // English ordinal suffix for the day of the month, 2 characters\n 'w' => 6, // Numeric representation of the day of the week\n 'z' => 40, // The day of the year (starting from 0)\n ];\n\n foreach ($formatsAndExpectedValues as $format => $expectedValue) {\n $this->assertEquals($expectedValue, $this->personalCodeObj->getBirthDay($format));\n }\n }", "public function setDateOfBirth($value)\n {\n $this->_date_of_birth = $value;\n }", "public function get_birth_date()\n\t{\n\t\t$date = DateTime::createFromFormat(LocalizedDate::STORED_DATE_FORMAT, $this->get_attribute('birth_date'));\n\t\treturn new LocalizedDate($date, null, IntlDateFormatter::SHORT, IntlDateFormatter::NONE);\n\t}", "protected function getDateOfBirthAttribute()\n {\n if (isset($this->attributes['date_of_birth'])) {\n $value = $this->attributes['date_of_birth'] ?? null;\n } else {\n $value = null;\n }\n\n if ($value !== null) {\n return date('d.m.Y', strtotime($value));\n } else {\n return null;\n }\n }", "public function getDob()\n {\n return $this->dob;\n }", "public function getShowBirthdate()\n\t{\n\t\treturn $this->show_birthdate;\n\t}", "public function getDob()\n {\n return $this->dob;\n }", "public function getDob()\n {\n return $this->dob;\n }", "public function setBirthday($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->birthday !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->birthday !== null && $tmpDt = new DateTime($this->birthday)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->birthday = ($dt ? $dt->format('Y-m-d H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = UserPeer::BIRTHDAY;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function getBornDate() {\n\t\treturn $this->born_date;\n\t}", "public function setBirthday($value)\n {\n if ($value) {\n $value = new DateTime($value, new DateTimeZone('UTC'));\n } else {\n $value = null;\n }\n\n return $this->setParameter('birthday', $value);\n }", "public function getBirthNation()\n {\n return $this->birthNation;\n }", "public function saveBirthDate()\n {\n $this->updateValue(\n 'birth_date',\n $this->birthDate,\n 'Customer birth date updated successfully.'\n );\n\n $this->birthDateUpdate = false;\n $this->birthDateFormatted = $this->customer->birth_date_formatted;\n }", "public function setBirthday(Carbon $birthday)\n {\n $this->birthday = $birthday->format('Y-m-d');\n\n return $this;\n }", "public function birthday(bool $age = false)\n {\n // If age is requested calculate it\n if ($age) {\n // Create dates\n $birthday = date_create($this->birthday);\n $now = date_create(date('Y-m-d'));\n\n // Get the difference\n $diff = date_diff($birthday, $now);\n\n // Return the difference in years\n return (int) $diff->format('%Y');\n }\n\n // Otherwise just return the birthday value\n return $this->birthday;\n }", "protected function setBirthday(string $birthday)\r\n\t{\r\n\t\t$this->birthday = $birthday;\r\n\t}", "public function setBirthdayAttribute($birthday){\n $this->attributes['birthday'] = Carbon::parse($birthday);\n }", "public function getInternationalBirthDate()\n {\n return $this->internationalBirthDate;\n }", "public function getBirthday($format = 'Y-m-d H:i:s')\n\t{\n\t\tif ($this->birthday === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthday === '0000-00-00 00:00:00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthday);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthday, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function setDateOfBirth($dateOfBirth) {\n $this->dateOfBirth = $dateOfBirth;\n }", "public function getBirthdayDate():?string\n {\n return $this->birthday_date ? (new \\DateTime($this->birthday_date))->format('d/m/Y') : null;\n }", "public function getDatesOfBirth() {\n\t\treturn empty( $this->container['dates_of_birth'] ) ? null : $this->container['dates_of_birth'];\n\t}", "public function getBirthdayPlace()\n {\n return $this->birthdayPlace;\n }", "public function setBirthDate($birthDate)\n\t{\n\t\tif ( $birthDate instanceof DateTime) {\n\t\t\t$this->birthDate = $birthDate;\n\t\t} else {\n\t\t\t// attempt to create a DateTime value using the string\n\t\t\ttry {\n\t\t\t\t$dateValue = new DateTime($birthDate);\n\t\t\t\t$this->birthDate = $dateValue;\n\t\t\t} catch(Exeption $e) {\n\t\t\t\t// stub\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function setBirthdayDate($birthdayDate)\n {\n $this->birthdayDate = $birthdayDate;\n\n return $this;\n }", "public function setDateOfBirth($dateOfBirth)\n {\n $this->dateOfBirth = $dateOfBirth;\n\n return $this;\n }", "public function setDateOfBirth($dateOfBirth)\n {\n $this->dateOfBirth = $dateOfBirth;\n\n return $this;\n }", "public function age(){\n return $this->dob->age;\n }", "public function getBirthday($format = 'd.m.Y.')\n {\n return date($format, $this->getBirthdayTimeStamp());\n }", "public function getAge()\n\t{\n\t\t$date_birthday = $this->getAnswer('birthday');\n\t\t$date_birthday = convert_date_to_age($date_birthday);\n\t\treturn $date_birthday;\n\n\t}", "public function testSetAndGetBirthDate()\r\n {\r\n $testObj = $this->_createMockModel();\r\n $baseObj = $this->_createMockModel();\r\n\r\n // Set the Birth Date\r\n $testObj->setBirthDate('1981-01-26T11:22:33-03:30');\r\n\r\n // Assert that a change occurred in the test object\r\n $this->assertNotEquals($testObj, $baseObj);\r\n\r\n // Assert that Birth Date field was updated\r\n $this->assertEquals('1981-01-26T11:22:33-03:30', $testObj->getBirthDate());\r\n\r\n // Assert that no other return values were affected\r\n $this->_assertModelsSameExcept($testObj, $baseObj, 'BirthDate');\r\n }", "protected function setBirth($birth)\n {\n $this->birth = $birth;\n\n return $this;\n }", "public function setBirthDate($birthDate)\n {\n $this->birthDate = $birthDate;\n\n return $this;\n }", "public function setBirthdayDate(?string $birthday_date)\n {\n if ($birthday_date) {\n $this->birthday_date = $birthday_date->format(self::DATE_FORMAT);\n }\n\n return $this;\n }", "public function setCbirthday($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cbirthday !== $v) {\n $this->cbirthday = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_CBIRTHDAY] = true;\n }\n\n return $this;\n }", "public function setBirthDate($birth_date)\n {\n $this->birth_date = $birth_date;\n return $this;\n }", "public function setBirthDate($birthDate)\n\t{\n\t\tif ($birthDate instanceof \\DateTime) {\n\t\t\t$birthDate = $birthDate->format('Y-m-d');\n\t\t}\n\n\t\t$this->data->birthDate = $birthDate;\n\n\t\treturn $this;\n\t}", "public function getBirthdate(): \\DateTimeInterface|null;", "public function hasBirthday(){\n return $this->_has(7);\n }", "public function hasBirthday(){\n return $this->_has(8);\n }", "public function setDob($dob)\n {\n $this->dob = $dob;\n\n return $this;\n }", "public function hasBirthday(){\n return $this->_has(5);\n }", "function age_to_birthdate($age)\n{\n $age_int = intval(trim((string)$age));\n $now = new \\DateTime();\n $bday = $now->sub(new \\DateInterval(\"P\" . $age_int . \"Y6M\"));\n return $bday->format(\\DateTime::ATOM);\n}", "public function setDateOfBirth( $date_of_birth ) {\n\t\t$this->container['dates_of_birth'] = isset( $date_of_birth ) ? array( $date_of_birth ) : null;\n\n\t\treturn $this;\n\t}", "public function setUserDateOfBirth ($newUserDateOfBirth = null) {\n\t\t// base case: if the date is null, ask user to enter date of birth\n\t\tif($newUserDateOfBirth === null) {\n\t\t\tthrow (new \\OutOfBoundsException(\"You must enter your date of birth\"));\n\t\t}\n\n\t\t$newUserDateOfBirth = self::validateDate($newUserDateOfBirth);\n\t\t$drinkDate = new \\DateTime();\n\t\t$drinkDate = $drinkDate->sub(new \\DateInterval('P21Y'));\n\t\tif($drinkDate < $newUserDateOfBirth) {\n\t\t\tthrow (new \\OutOfRangeException(\"You are too young.\"));\n\t\t}\n\t\t// store the userDateOfBirth date\n\t\t$this->userDateOfBirth = $newUserDateOfBirth;\n\n\t}", "public function setBirthday(string $birthday): ContactDetail\n {\n $this->birthday = Helpers::formatDate($birthday);\n return $this;\n }", "private function getAge()\n {\n return $this->getAge($this->dob);\n }", "public function setDateOfBirth(\\DateTime $dateOfBirth)\n {\n $this->dateOfBirth = $dateOfBirth;\n return $this;\n }", "public function setBirthDate(\\DateTime $birthDate)\n {\n $this->birthDate = $birthDate;\n return $this;\n }", "public function setBirthdate($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->birthdate !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->birthdate !== null && $tmpDt = new DateTime($this->birthdate)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->birthdate = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = UserPeer::BIRTHDATE;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "function getYearOfBirth() {\n global $USER;\n\t$yearOfBirth = date(\"Y\", $USER['dob']);\n\treturn $yearOfBirth;\n}", "protected function _getDob()\n {\n $dob = '';\n \n // First check if form birthday is set else get the birthday of the customer, otherwise error\n if ( isset( $this->_additionalFields['dob'] ) || isset( $this->_additionalFields['dob_year'] ) )\n {\n // Logics if javascript worked\n if ( array_key_exists( 'dob', $this->_additionalFields ) )\n {\n $dobTimestamp = strtotime( $this->_additionalFields['dob'], time() );\n $dob = date( 'Y-m-d\\TH:i:s', $dobTimestamp );\n }\n // Logics if javascript for date has not worked\n elseif ( \n array_key_exists( 'dob_year', $this->_additionalFields )\n && array_key_exists( 'dob_month', $this->_additionalFields )\n && array_key_exists( 'dob_day', $this->_additionalFields )\n )\n {\n $dobdate = $this->_additionalFields['dob_year'] . '-' . $this->_additionalFields['dob_month'] . '-' . \n $this->_additionalFields['dob_day'];\n $dobTimestamp = strtotime($dobdate, time());\n $dob = date('Y-m-d\\TH:i:s', $dobTimestamp);\n }\n }\n // No birthday sent through form fields, look if a birthday was sent using Magento default fields\n elseif( $this->_order->getCustomerDob() )\n {\n $dobdate = $this->_order->getCustomerDob();\n $dobTimestamp = strtotime( $dobdate, time() );\n $dob = date('Y-m-d\\TH:i:s', $dobTimestamp);\n }\n // If the variable $dob is not filled, then there was a problem with getting the correct date of birth\n // Because sending an empty value will cause SOAP error, do Mage Exception instead\n if ($dob == '')\n {\n // Cancel the order to prevent pending orders\n $this->_order->cancel()->save();\n // Restore the quote to keep cart information\n $this->restoreQuote();\n // Sent back error\n Mage::throwException($this->_helper->__('The date of birth is missing invalid. Please check your date or birth or contact our customer service.'));\n }\n \n return $dob;\n }", "public function getDefaultBirthdate(): \\DateTimeInterface|null;", "public function setDoby( $doby ) {\n\t\t$this->container['doby'] = $doby;\n\n\t\treturn $this;\n\t}", "public function getSubscriberDob()\n {\n $dob = parent::getSubscriberDob();\n return $dob;\n }", "public function getBirthPlace()\n {\n return $this->birthPlace;\n }", "public function getBirthdate($format = 'Y-m-d')\n\t{\n\t\tif ($this->birthdate === null) {\n\t\t\treturn null;\n\t\t}\n\n\n\t\tif ($this->birthdate === '0000-00-00') {\n\t\t\t// while technically this is not a default value of NULL,\n\t\t\t// this seems to be closest in meaning.\n\t\t\treturn null;\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t$dt = new DateTime($this->birthdate);\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException(\"Internally stored date/time/timestamp value could not be converted to DateTime: \" . var_export($this->birthdate, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ($format === null) {\n\t\t\t// Because propel.useDateTimeClass is TRUE, we return a DateTime object.\n\t\t\treturn $dt;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $dt->format('U'));\n\t\t} else {\n\t\t\treturn $dt->format($format);\n\t\t}\n\t}", "public function setBirthdate($birthdate)\n\t{\n\t\t$this->birthdate = $birthdate;\n\t}", "public function setBirthdate($birthdate)\r\n {\r\n $this->birthdate = $birthdate;\r\n\r\n return $this;\r\n }", "public function getAgeAttribute() {\n return Carbon::createFromDate($this->attributes['DOB'])->age;\n }", "public function setDatesOfBirth( $dates_of_birth ) {\n\t\t$this->container['dates_of_birth'] = $dates_of_birth;\n\n\t\treturn $this;\n\t}", "public function getBirthday($format = 'Y-m-d')\n {\n $value = $this->getParameter('birthday');\n\n return $value ? $value->format($format) : null;\n }" ]
[ "0.7846542", "0.7846542", "0.7846542", "0.7846542", "0.7846542", "0.76321125", "0.7424361", "0.735215", "0.73105216", "0.73060745", "0.7303557", "0.7257546", "0.7235914", "0.7231029", "0.72281873", "0.72106755", "0.7199915", "0.7189529", "0.71636885", "0.71636885", "0.71397644", "0.71382505", "0.71247804", "0.71131927", "0.70908237", "0.6996714", "0.689841", "0.689841", "0.6889405", "0.6885532", "0.68283314", "0.6816706", "0.6806248", "0.67308444", "0.6727949", "0.6719319", "0.6640074", "0.65876746", "0.6584613", "0.6540961", "0.65208095", "0.6511014", "0.6491359", "0.64297354", "0.63819575", "0.63819575", "0.63722634", "0.637203", "0.63713706", "0.6364754", "0.6364627", "0.63563746", "0.63418466", "0.63375545", "0.63231313", "0.6314329", "0.6303563", "0.6297159", "0.62729114", "0.6262461", "0.6245164", "0.6237677", "0.6227182", "0.6226308", "0.6226308", "0.6223329", "0.62134045", "0.6213376", "0.61713165", "0.6152422", "0.6129936", "0.6125864", "0.6117428", "0.61099553", "0.608761", "0.6064324", "0.6036679", "0.6001271", "0.5997441", "0.59842384", "0.5961531", "0.59581417", "0.59570915", "0.59516335", "0.59496963", "0.5943021", "0.5909945", "0.59007895", "0.5889543", "0.58838606", "0.5882948", "0.5872274", "0.5865019", "0.5839026", "0.58340317", "0.5828174", "0.58107376", "0.58064914", "0.5802458", "0.57971805" ]
0.76944584
5
Get all item of table router by $routerVo object filter use paging
public function selectByFilter($routerVo, $orderBy=array(), $startRecord=0, $recordSize=0){ try { if (empty($routerVo)) $routerVo = new RouterVo(); $sql = "select * from `router` "; $condition = ''; $params = array(); $isFirst = true; if (!is_null($routerVo->routerId)){ //If isset Vo->element $fieldValue=$routerVo->routerId; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `router_id` $key :routerIdKey"; $isFirst = false; } else { $condition .= " and `router_id` $key :routerIdKey"; } if($type == 'str') { $params[] = array(':routerIdKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':routerIdKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `router_id` = :routerIdKey'; $isFirst=false; }else{ $condition.=' and `router_id` = :routerIdKey'; } $params[]=array(':routerIdKey', $fieldValue, PDO::PARAM_INT); }} if (!is_null($routerVo->layoutId)){ //If isset Vo->element $fieldValue=$routerVo->layoutId; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `layout_id` $key :layoutIdKey"; $isFirst = false; } else { $condition .= " and `layout_id` $key :layoutIdKey"; } if($type == 'str') { $params[] = array(':layoutIdKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':layoutIdKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `layout_id` = :layoutIdKey'; $isFirst=false; }else{ $condition.=' and `layout_id` = :layoutIdKey'; } $params[]=array(':layoutIdKey', $fieldValue, PDO::PARAM_INT); }} if (!is_null($routerVo->pkName)){ //If isset Vo->element $fieldValue=$routerVo->pkName; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `pk_name` $key :pkNameKey"; $isFirst = false; } else { $condition .= " and `pk_name` $key :pkNameKey"; } if($type == 'str') { $params[] = array(':pkNameKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':pkNameKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `pk_name` = :pkNameKey'; $isFirst=false; }else{ $condition.=' and `pk_name` = :pkNameKey'; } $params[]=array(':pkNameKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->prefix)){ //If isset Vo->element $fieldValue=$routerVo->prefix; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `prefix` $key :prefixKey"; $isFirst = false; } else { $condition .= " and `prefix` $key :prefixKey"; } if($type == 'str') { $params[] = array(':prefixKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':prefixKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `prefix` = :prefixKey'; $isFirst=false; }else{ $condition.=' and `prefix` = :prefixKey'; } $params[]=array(':prefixKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->suffix)){ //If isset Vo->element $fieldValue=$routerVo->suffix; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `suffix` $key :suffixKey"; $isFirst = false; } else { $condition .= " and `suffix` $key :suffixKey"; } if($type == 'str') { $params[] = array(':suffixKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':suffixKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `suffix` = :suffixKey'; $isFirst=false; }else{ $condition.=' and `suffix` = :suffixKey'; } $params[]=array(':suffixKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->alias)){ //If isset Vo->element $fieldValue=$routerVo->alias; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias` $key :aliasKey"; $isFirst = false; } else { $condition .= " and `alias` $key :aliasKey"; } if($type == 'str') { $params[] = array(':aliasKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias` = :aliasKey'; $isFirst=false; }else{ $condition.=' and `alias` = :aliasKey'; } $params[]=array(':aliasKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->aliasBy)){ //If isset Vo->element $fieldValue=$routerVo->aliasBy; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias_by` $key :aliasByKey"; $isFirst = false; } else { $condition .= " and `alias_by` $key :aliasByKey"; } if($type == 'str') { $params[] = array(':aliasByKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasByKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias_by` = :aliasByKey'; $isFirst=false; }else{ $condition.=' and `alias_by` = :aliasByKey'; } $params[]=array(':aliasByKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->aliasList)){ //If isset Vo->element $fieldValue=$routerVo->aliasList; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `alias_list` $key :aliasListKey"; $isFirst = false; } else { $condition .= " and `alias_list` $key :aliasListKey"; } if($type == 'str') { $params[] = array(':aliasListKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':aliasListKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `alias_list` = :aliasListKey'; $isFirst=false; }else{ $condition.=' and `alias_list` = :aliasListKey'; } $params[]=array(':aliasListKey', $fieldValue, PDO::PARAM_STR); }} if (!is_null($routerVo->callback)){ //If isset Vo->element $fieldValue=$routerVo->callback; if(is_array($fieldValue)){ //if is array $key = $fieldValue[0]; $value = $fieldValue[1]; $type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str'; if ($isFirst) { $condition .= " `callback` $key :callbackKey"; $isFirst = false; } else { $condition .= " and `callback` $key :callbackKey"; } if($type == 'str') { $params[] = array(':callbackKey', $value, PDO::PARAM_STR); } else{ $params[] = array(':callbackKey', $value, PDO::PARAM_INT); }} else{ //is not array if ($isFirst){ $condition.=' `callback` = :callbackKey'; $isFirst=false; }else{ $condition.=' and `callback` = :callbackKey'; } $params[]=array(':callbackKey', $fieldValue, PDO::PARAM_STR); }} if (!empty($condition)){ $sql.=' where '. $condition; } //order by <field> asc/desc if(count($orderBy) != 0){ $orderBySql = 'ORDER BY '; foreach ($orderBy as $k => $v){ $orderBySql .= "`$k` $v, "; } $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2); $sql.= " ".trim($orderBySql)." "; } if($recordSize != 0) { $sql = $sql.' limit '.$startRecord.','.$recordSize; } //debug LogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } if ($stmt->execute()) { $row= $stmt->fetchAll(PDO::FETCH_NAMED); return PersistentHelper::mapResult('RouterVo', $row); } } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToPaginator();", "protected function getAll(){\n return $this->orderBy('id','desc')->paginate(10);\n }", "public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }", "public function index()\n {\n return SOA_OVL::latest()->paginate(0);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "private function getAll($params, $filtro) {\n if (isset($params[\"current\"])) {\n $this->current_page_number = $params[\"current\"];\n } else {\n $this->current_page_number = 1;\n }\n\n // Obtendo quantos dados seram exibidos por pagina\n if (isset($params[\"rowCount\"])) {\n $this->records_per_page = $params[\"rowCount\"];\n } else {\n $this->records_per_page = 10;\n }\n $this->start_from = ($this->current_page_number - 1) * $this->records_per_page;\n\n if (!empty($params[\"searchPhrase\"])) {\n $this->query .= \" WHERE (nome LIKE '%\" . $params[\"searchPhrase\"] . \"%' )\";\n }\n\n if (!empty($filtro)) {\n $this->query .= $filtro;\n }\n \n // Alterando consulta para ordenacao da coluna clicada\n $order_by = '';\n if (isset($params[\"sort\"]) && is_array($params[\"sort\"])) {\n foreach ($params[\"sort\"] as $key => $value) {\n $order_by .= \" $key $value, \";\n }\n } else {\n $this->query .= ' ORDER BY id Asc ';\n }\n\n if ($order_by != '') {\n $this->query .= ' ORDER BY ' . substr($order_by, 0, -2);\n }\n \n // Obtendo o numero total de funcionarios sem o filtro de limit\n $query1 = $this->query;\n // Limitando numero de registros obtidos no sql\n if ($this->records_per_page != -1) {\n $this->query .= \" LIMIT \" . $this->records_per_page . \" OFFSET \" . $this->start_from;\n }\n\n /** Obtendo dados com a consulta resultante ******\n */\n $result = pg_query($this->con, $this->query) or die(\"erro ao obter os dados do funcionário\");\n while ($row = pg_fetch_row($result)) {\n $this->data[] = array(\n \"id\" => $row[0],\n \"nome\" => $row[1],\n \"cpf\" => $row[2],\n \"rg\" => $row[3]\n );\n }\n\n $result1 = pg_query($this->con, $query1) or die(\"erro ao obter os dados do funcionário\");\n $total_records = pg_num_rows($result1);\n\n $output = array(\n \"current\" => intval($this->current_page_number),\n \"rowCount\" => $this->records_per_page,\n \"total\" => intval($total_records),\n \"rows\" => $this->data\n );\n\n return $output;\n }", "public function index()\n {\n return VehicleType::latest()->paginate(7);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "public function paging(){\n\t\t$sql = \"SELECT * FROM berita\";\n\t\t$query = $this->db->query($sql) or die ($this->db->error);\n\t\treturn $query;\n\t}", "public function index()\n {\n //$lim = 5;\n /*\n $vars = [\n \"customers\" => CustomerResource::collection(Customer::all()),\n \"transactions\" => TransactionResource::collection(Transaction::paginate(5)),\n \"search\" => \"\"\n ];\n return $vars;\n */\n $transactions = Transaction::orderBy('updated_at', 'desc')->paginate(5);\n $t = TransactionResource::collection($transactions);\n return $t; \n }", "public function tLists(){\n\n $raw = $this->RxData;\n $head = C('PREURL');\n $ret = ['total' => 0, 'page_start' => 0, 'page_n' => 0, 'data' => []];\n\n $page = $raw['page_start']?$raw['page_start']:1;\n $num = $raw['page_limit']? $raw['page_limit']:10;\n $limit = $num*($page-1).','.$num;\n\n//判断角色\n $roles_arr = [\n ROLE_BIN_TEA,\n ROLE_BIN_TEA+ROLE_BIN_STU,\n ROLE_BIN_TEA+ROLE_BIN_NOR,\n ROLE_BIN_TEA+ROLE_BIN_NOR+ROLE_BIN_STU\n ];\n if(!in_array($this->out['admin'],$roles_arr)){\n $ret['status'] = E_STATUS;\n $ret['errstr'] = '';\n goto END;\n }\n\n $where['a.uid'] = $this->out['uid'];\n\n if($raw['level_id'])\n $where['a.level_id']= $raw['level_id'];\n\n if(isset($raw['title']))\n $where['a.title']= ['like','%'.$raw['title'].'%'];\n// 状态:\n// 0全部,1待审核,\n//2审核通过,3审核拒绝,\n//4待批阅;5批阅完成;6、已取消\n if($raw['status']){\n switch($raw['status']){\n case 1:\n $where['a.check']= LINE;\n break;\n case 2:\n $where['a.check'] = PASS;\n $where['a.submit']= 1;\n break;\n case 3:\n $where['a.check']= REJECT;\n break;\n case 4:\n $where['a.check'] = PASS;\n $where['a.submit'] = 1;\n break;\n case 5:\n $where['a.judging']= 0;\n $where['a.check'] = PASS;\n $where['a.submit'] = 1;\n break;\n case 6:\n $where['a.submit'] = 2;\n $where['a.check'] = PASS;\n break;\n default:\n break;\n }\n }\n\n\n if($raw['time_start'] && $raw['time_end']){\n $where['a.atime'] = [\n ['egt',$raw['time_start']],\n ['lt',$raw['time_end']]\n ];\n }elseif($raw['time_start'] ) {\n $where['a.atime'] = ['egt', $raw['time_start']];\n }elseif($raw['time_end'] ){\n $where['a.atime'] = ['lt',$raw['time_end']];\n }\n $where['b.table'] = THWK;\n\n $column = '\n a.id,a.submit,reply_n,a.hwk_id,a.title,a.receive_n,a.judging,a.check status,a.suid,\n c.name as level,a.atime,b.data\n ';\n\n $res = $this->model->selectHomeworkForT(\n $column,\n $where,\n $limit,\n 'a.atime desc'\n );\n\n if(!$res)\n goto END;\n $total = $this->model->selectHomeworkForT('count(*) total',$where);\n\n $chk_sub = false;\n//逾期\n $pids = [];\n foreach ($res as $v) {\n $pids[] = $v['id'];\n }\n $reply_info = $this->model->selectReply(\n '',\n [\n 'pid' => ['in',$pids],\n 'top_id' => 0,\n 'judge' => HWK_L_UNCOT\n ]\n );\n $t = time();\n foreach($reply_info as $v1){\n if($t>($v1['atime']+C(\"EXPIRE_SUB\")) && $t<($v1['atime']+C(\"EXPIRE_HWK\"))){\n $chk_sub = true;\n continue;\n }\n }\n\n $ret['expire'] = $chk_sub?HWK_EXPIRE:HWK_OK;\n $fin = [];\n foreach ($res as $k=>&$re) {\n //学员数量\n $stu_n = explode(',',$re['suid']);\n array_shift($stu_n);\n array_pop($stu_n);\n $re['student_n'] = count($stu_n);\n\n if($re['data']){\n foreach(unserialize($re['data']) as $k=>$v){\n $re[$k] = $v;\n }\n }\n if($re['status'] == PASS){\n //已取消\n if($re['submit'] == HWK_UNSUMMIT ){\n $re['status'] = HWK_T_CANCEL;\n $fin[] = $re;\n continue;\n }\n if($re['receive_n'] > 0){\n $re['status'] = HWK_T_UNCOT;\n }\n }else{\n $re['submit'] = HWK_UNSUMMIT;\n }\n\n\n if($raw['status'] == HWK_T_UNCOT){\n if($re['reply_n'] == count($stu_n) && $re['judging'] == 0){\n continue;\n }\n }elseif($raw['status'] == HWK_T_COT){\n if($re['reply_n'] != count($stu_n) ||$re['receive_n'] != count($stu_n) || $re['judging'] != 0){\n continue;\n }\n }\n //批阅完成\n if($re['reply_n'] == count($stu_n) && $re['judging'] == 0)\n $re['status'] = HWK_T_COT;\n\n if($raw['status'])\n $re['status'] = $raw['status'];\n unset($re['data']);\n\n $fin[] = $re;\n }\n $ret['total'] = $total[0]['total'];\n $ret['page_n'] = count($fin);\n $ret['page_start'] = $page;\n $ret['data'] = $fin;\n\nEND:\n $this->retReturn($ret);\n\n }", "function pagination(){}", "public function getPaginated();", "public function lists(){\n\n $raw = $this->RxData;\n $head = C('PREURL');\n $ret = ['total' => 0, 'page_start' => 0, 'page_n' => 0, 'data' => []];\n\n $page = $raw['page_start']?$raw['page_start']:1;\n $num = $raw['page_limit']? $raw['page_limit']:10;\n $limit = $num*($page-1).','.$num;\n\n\n if(!$this->out['teacher_uid'])\n goto END;\n $time = time();\n\n $where['a.check']= PASS;\n $where['a.submit']= 1;\n\n $where['a.uid'] = $this->out['teacher_uid'];\n $where['a.suid'] = ['like','%,'.$this->out['uid'].',%'];\n\n\n if($raw['level_id'])\n $where['a.level_id']= $raw['level_id'];\n if(isset($raw['title']))\n $where['a.title']= ['like','%'.$raw['title'].'%'];\n\n if($raw['status_all'])\n $where['a.atime']= ['lt',$time];\n\n $raw['status'] = $raw['status_all']?$raw['status_all']:$raw['status_mine'];\n\n if(isset($raw['status'])){\n switch($raw['status']){\n case 1:\n $where['b.status']= HWK_DID;\n break;\n case 2:\n $where['b.status']= HWK_UNDO;\n break;\n case 3:\n $where['b.status']= HWK_UNCOT;\n break;\n case 4:\n $where['b.uid']= ['eq',$this->out['uid']];\n break;\n case 5:\n// $where['b.uid']= ['neq',$this->out['uid']];\n break;\n case 6:\n// $where['b.uid']= ['neq',$this->out['uid']];\n break;\n default:\n break;\n }\n }\n\n if($raw['time_start'] && $raw['time_end']){\n $where['a.atime'] = [\n ['egt',$raw['time_start']],\n ['lt',$raw['time_end']]\n ];\n }elseif($raw['time_start'] ) {\n $where['a.atime'] = ['egt', $raw['time_start']];\n }elseif($raw['time_end'] ){\n $where['a.atime'] = ['lt',$raw['time_end']];\n }\n\n $column = 'a.id,a.hwk_id,a.title,b.status as stu_status,c.name as level,a.mtime as atime';\n\n $order = 'a.mtime desc,id desc';\n\n\n if(isset($raw['status_mine'])){\n $join = 'RIGHT JOIN';\n $where['b.uid']= $this->out['uid'];\n\n $total = $this->model->selectHomeworkByRec('count(*) total',$where,'','');\n $res = $this->model->selectHomeworkByRec(\n $column,\n $where,\n $limit,\n $order\n\n );\n }else {\n //默认为作业池\n if ($raw['status_all'] == 5) {\n $total = $this->model->selectHomeworkForAll('count(*) total', $where, '', '',$this->out['uid']);\n $res = $this->model->selectHomeworkForAll(\n $column,\n $where,\n $limit,\n $order,$this->out['uid']\n );\n } elseif ($raw['status_all'] == 4) {\n $total = $this->model->selectHomeworkForAll('count(*) total', $where, '', '',$this->out['uid']);\n $res = $this->model->selectHomeworkForAll(\n $column,\n $where,\n $limit,\n $order,$this->out['uid']\n );\n } else {\n $total = $this->model->selectHomeworkForAll('count(*) total', $where, '', '',$this->out['uid']);\n $res = $this->model->selectHomeworkForAll(\n $column,\n $where,\n $limit,\n $order,$this->out['uid']\n );\n }\n }\n\n if(!$res)\n goto END;\n\n $result = [] ;\n $chk_sub = false;\n foreach($res as $k=>&$v){\n\n\n if($v['level_id'] > $this->out['level_id']){\n unset($res[$k]);\n continue;\n }\n $v['etime'] = $v['atime'] + C('EXPIRE_HWK');\n if($raw['status_all'] == 5){\n if($v['stu_status']){\n continue;\n }\n }\n $v['status'] = $v['stu_status']?$v['stu_status']:HWK_REV;\n if(isset($raw['status_all']) && $v['stu_status']){\n $v['status'] = HWK_NOT_REV;\n }\n//过期\n if(!$v['stu_status'] && time() > ($v['atime']+C('EXPIRE_HWK')))\n $v['status'] = HWK_EXIPRE;\n//逾期\n if($v['stu_status'] == HWK_UNDO && (time()>($v['atime']+C('EXPIRE_SUB'))))\n $chk_sub = true;\n\n $result[] = $v;\n }\n\n $ret['total'] = $total[0]['total'];\n $ret['page_n'] = count($result);\n $ret['page_start'] = $page;\n $ret['data'] = $result;\n $ret['expire'] = $chk_sub?HWK_EXPIRE:HWK_OK;\n\n //已完成列表 不提示\n if($raw['status'] == 1 )\n $ret['expire'] = HWK_OK;\n\n\nEND:\n\n $this->retReturn($ret);\n\n }", "public function getList($argPageno, $argSlot = null, $argOrderIn = null, $orderBy = null, $argSearchValue = null)\n {\n\n $argOrderIn = !empty($argOrderIn) ? $argOrderIn : 'created_at';\n $orderBy = !empty($orderBy) ? $orderBy : 'desc';\n $argSlot = empty($argSlot) ? 1 : $argSlot;\n // $argRecordsPerPage = empty($argRecordsPerPage) ? 10 : $argRecordsPerPage;\n\n //here\n $varTotalRecordsPerPage = 5;\n $varTotalNoOfPages = 5;\n $varCheckDataInSlot = 0;\n $varRecordsForNext = $varTotalNoOfPages * $varTotalRecordsPerPage * $argSlot;\n $varSlotStarting = ($argSlot - 1) * ($varTotalRecordsPerPage * $varTotalNoOfPages);\n //here\n $varTotalRecords = ($argPageno * $varTotalRecordsPerPage) / $argPageno;\n $varStartingRecords = ($argPageno - 1) * $varTotalRecords;\n // $varUserId = Session::get('admin')['id'];;\n\n $arrRecords = ItemClass::skip($varStartingRecords)->take($varTotalRecords)->where('class_name', 'LIKE', '%' . $argSearchValue . '%')->where('is_deleted', '!=', '1')->orderBy($argOrderIn, $orderBy)->get();\n $varCheckDataInSlot = ItemClass::skip($varSlotStarting)->take(($varTotalNoOfPages * $varTotalRecordsPerPage))->orderBy($argOrderIn, $orderBy)->get()->count();\n\n $varTotal = ItemClass::count();\n $varPaginationCount = ceil($varCheckDataInSlot / $varTotalRecords);\n\n $varView = view('admin.itemclass.table')->with([\n 'arrRecords' => $arrRecords, 'varTotal' => $varTotal, 'varPaginationCount' => $varPaginationCount, 'argSlot' => $argSlot, 'argPageno' => $argPageno, 'argSearchValue' => $argSearchValue, 'varTotalNoOfPages' => $varTotalNoOfPages, 'varRecordsForNext' => $varRecordsForNext, 'argOrderIn' => $argOrderIn, 'orderBy' => $orderBy,\n ])->render();\n return response()->json(['html' => $varView]);\n }", "public function index()\n {\n return VehicleRate::latest()->paginate(7);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "public function modelRead($recordPerPage){\n // lay bien page truyen tu url\n $page = isset($_GET[\"page\"])&&$_GET[\"page\"]>0 ? $_GET[\"page\"]-1 : 0;\n // lay tu ban ghi nao \n $from = $page * $recordPerPage;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory order by id desc limit $from, $recordPerPage\");\n // tra ve nhieu ban ghi\n return $query->fetchAll();\n }", "function getAllPaginated($page=1,$perPage=-1) { \r\n if ($perPage == -1)\r\n $perPage = \tNewsletterSchedulePeer::getRowsPerPage();\r\n if (empty($page))\r\n $page = 1;\r\n //require_once(\"propel/util/PropelPager.php\");\r\n $cond = new Criteria(); \r\n $pager = new PropelPager($cond,\"NewsletterSchedulePeer\", \"doSelect\",$page,$perPage);\r\n return $pager;\r\n }", "public function getPaginationDataSource();", "public function all($param)\n {\n $result = $this->model->newQuery();\n return $result->paginate($param);\n }", "public function paginate()\n {\n }", "public function index()\n {\n //\n return ProductoResource::collection(Producto::paginate(15));\n }", "public function index()\n {\n return $this->proponente->paginate($this->limit);\n }", "public function index()\n {\n \n //$etudiants = Etudiant::paginate(1);\n $etudiants = Etudiant::All();\n return EtudiantResource::collection($etudiants); \n\n }", "public function index(): LengthAwarePaginator;", "public function index()\n {\n return Bien::paginate(3);\n }", "public function getPageItems()\n {\n }", "public function index()\n {\n \n /* return *///$sort \n\n \n $articles = Article::query();\n\n /* foreach($sort as $sortcol)\n {\n $sortdir = starts_with($sortcol, '-') ? 'desc' : 'asc';\n\n $sortCol = ltrim($sortcol, '-');\n\n $articles->orderBy($sortCol, $sortdir);\n } */\n\n if(request()->has('filterBy'))\n {\n list($criteria, $value) = explode(':', request()->filterBy);\n\n $articles->where($criteria, $value);\n }\n\n return ArticleResource::collection($articles->paginate(15));\n }", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "function getAllPaginated($page=1,$perPage=-1) { \r\n if ($perPage == -1)\r\n $perPage = \tNewsletterUserPeer::getRowsPerPage();\r\n if (empty($page))\r\n $page = 1;\r\n //require_once(\"propel/util/PropelPager.php\");\r\n $cond = new Criteria(); \r\n $pager = new PropelPager($cond,\"NewsletterUserPeer\", \"doSelect\",$page,$perPage);\r\n return $pager;\r\n }", "public function GetRecentNewsPaginate() {\n if(isset($_GET['pagPage'])){\n try {\n $paginationPage = $_GET['pagPage'];\n $model = new News(Database::instance());\n $paginationData = $model->GetRecentPostsPagination($paginationPage);\n\n $this->json($paginationData);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"GetRecentNewsPaginate()25\", $ex->getMessage());\n\n }\n } else {\n //u slucaju da nema parametar kroz url dobija vrdnost 0 i ispisuje prvih 5 recent news na home page\n try {\n $paginationPage = 0;\n $model = new News(Database::instance());\n $paginationData = $model->GetRecentPostsPagination($paginationPage);\n\n $this->json($paginationData);\n } catch (\\PDOException $ex) {\n $this->errorLog(\"GetRecentNewsPaginate()37\", $ex->getMessage());\n }\n\n }\n\n }", "function newskomentar_searchdata_all_bypage( $tbl_newskomentar, $cari, $offset, $dataperPage ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar WHERE \n\t\t\tjudul LIKE '$cari' OR\n\t\t\tpesan LIKE '$cari' \n\t\t\t\tORDER BY id ASC LIMIT $offset, $dataperPage\n\t\t\"); \n \t\treturn $sql;\n}", "public function index()\n {\n //\n $transmissions = VehicleTransmission::with('vehicles')->orderBy('name')->paginate(100);\n return compact('transmissions');\n }", "public function index()\n {\n return tahunAjaran::latest()->paginate(5);\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "protected function itemPaging()\n {\n $controller_class_namespace = $this->controller_namespace;\n $controller = new $controller_class_namespace();\n $controller->getModelRegistry(\n $this->get('model_type', 'datasource'),\n $this->get('model_name', '', 'runtime_data'),\n 1\n );\n\n $controller->set('get_customfields', 0);\n $controller->set('use_special_joins', 0);\n $controller->set('process_events', 0);\n $controller->set('get_item_children', 0);\n\n $controller->select(\n 'a'\n . '.'\n . $controller->get('primary_key', 'id')\n );\n\n $controller->select(\n 'a'\n . '.'\n . $controller->get('name_key', 'title')\n );\n\n $controller->where(\n 'a'\n . '.' . $controller->get('primary_key', 'id')\n . ' = '\n . (int)$this->runtime_data->catalog->source_id\n );\n\n//@todo ordering\n $item = $this->runQuery();\n\n $model_registry_name = ucfirst(strtolower($this->get('model_name', '', 'runtime_data')))\n . ucfirst(strtolower($this->get('model_type', 'datasource')));\n\n if ($item === false || count($item) === 0) {\n return $this;\n }\n }", "public function getAllPaginated($params)\n {\n $perPage = isset($params['per_page']) ? $params['per_page'] : self::PER_PAGE;\n $query = $this->model->whereNotNull('id');\n\n $this->attachFilters($params, $query);\n\n return $query->paginate($perPage);\n }", "private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}", "public function getPaginate(){ }", "public function index()\n {\n return koperasi::with('get_user','get_user_pinjam')->latest()->paginate(5);\n }", "public function searchListeReformerAllAmort($params)\n {\n \n \t$query = Bien::find()->where(['statutbien'=>['reformer','reformertransf']]);\n \t$dataProvider = new ActiveDataProvider([\n \n \t\t\t'query' => $query,\n \t\t\t'pagination' => [\n \t\t\t'pageSize' => 20,\n \t\t\t],\n \t\t\t]);\n \n \t$this->load($params);\n \n \tif (!($this->load($params) && $this->validate())) {\n \t\t// uncomment the following line if you do not want to return any records when validation fails\n \t\t// $query->where('0=1');\n \t\t \n \t\treturn $dataProvider;\n \t}\n \n \t$query->andFilterWhere([\n \t\t\t'codebien' => $this->codebien,\n \t\t\t'codesousfamille' => $this->codesousfamille,\n \t\t\t'numfacture' => $this->numfacture,\n \t\t\t'numcmd' => $this->numcmd,\n \t\t\t'prixachat' => $this->prixachat,\n \t\t\t'tauxamort' => $this->tauxamort,\n \t\t\t'dureevie' => $this->dureevie,\n \t\t\t'poids' => $this->poids,\n \t\t\t'garantie' => $this->garantie,\n \t\t\t]);\n \n \t$query->andFilterWhere(['like', 'typebien', $this->typebien])\n \t->andFilterWhere(['like', 'designationbien', $this->designationbien])\n \t->andFilterWhere(['like', 'dateacquisition', $this->dateacquisition])\n \t->andFilterWhere(['like', 'statutbien', $this->statutbien])\n \t->andFilterWhere(['like', 'etatbien', $this->etatbien])\n \t->andFilterWhere(['like', 'typeamort', $this->typeamort])\n \t->andFilterWhere(['like', 'commentaire', $this->commentaire])\n \t->andFilterWhere(['like', 'datedebugarantie', $this->datedebugarantie])\n \t->andFilterWhere(['like', 'dateenr', $this->dateenr]);\n \t//->andFilterWhere(['LIKE', 'designationbureau', $this->bureau.designationbureau]);\n \n \treturn $dataProvider;\n }", "public function paginatedSearch($params) {\n // get items page\n $search_params = [];\n $qb = $this->db->createQueryBuilder();\n $qb->select('contacto_id', 'obra_id', 'cargo', 'intervencion');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n $search = '%'.$params['search_fields']['search'].'%';\n for ($i = 0; $i < 4; $i++) {\n $search_params[] = $search;\n }\n }\n $qb->orderBy($params['sort_field'], $params['sort_dir']);\n $qb->setFirstResult($params['page_size'] * ($params['page'] - 1));\n $qb->setMaxResults($params['page_size']);\n\n $items = [];\n $items = $this->db->fetchAll($qb->getSql(), $search_params); \n\n\n // get total count\n $qb = $this->db->createQueryBuilder();\n $qb->select('count(*) AS total');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n }\n $total = [['total' => 0]];\n $total = $this->db->fetchAll($qb->getSql(), $search_params);\n \n\n // return result\n return [\n 'total' => $total[0]['total'], \n 'items' => $items\n ];\n }", "public function index()\n {\n return ModePayementResource::collection(ModePayement::orderBy('libelle')->paginate(6));\n }", "public function do_paging()\n {\n }", "abstract public function preparePagination();", "public function index()\n {\n return InventoryRelease::with('inventory')->paginate(10);\n }", "public function index()\n {\n return EtudiantCollection::collection(Etudiant::paginate(20)); \n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function index()\n {\n\n return Property::paginate(15);\n }", "public function index()\n {\n $sort = FacadesRequest::get('sort');\n $dir = FacadesRequest::get('direction');\n\n if ($sort == '')\n $sort = 'created_at';\n\n $search = FacadesRequest::get('q');\n if ($search != '') {\n $pages = Page::where('name', 'LIKE', '%' . $search . '%')\n ->orWhere('description', 'LIKE', '%' . $search . '%')\n ->orderBy($sort, $dir)->paginate(10);\n }\n else {\n $pages = Page::orderBy($sort, $dir)->paginate(10);\n }\n\n\n return PageResource::collection($pages);\n }", "public function showAllPaginateActionGet() : object\n {\n $title = \"Show, paginate movies\";\n\n $this->app->db->connect();\n\n //Number of hits, check input\n $hits = $this->checkForNumberOfHits();\n\n // Get max number of pages\n $sql = \"SELECT COUNT(id) AS max FROM movie;\";\n $max = $this->app->db->executeFetchAll($sql);\n $max = ceil($max[0]->max / $hits);\n\n // Get current page, check input\n $page = $this->checkForPage($hits, $max);\n $offset = $hits * ($page - 1);\n\n // Incoming matches valid value sets\n $orderBy = $this->checkOrderByValue();\n $order = $this->checkOrderValue();\n\n $sql = \"SELECT * FROM movie ORDER BY $orderBy $order LIMIT $hits OFFSET $offset;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all-paginate\", [\n \"res\" => $res,\n \"max\" => $max,\n ]);\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function index()\n {\n return $this->paginate();\n }", "public function paginar_get(){\n\n $this->load->helper('paginacion');\n\n $pagina = $cliente_id = $this->uri->segment(3); // parametro #3\n $por_pagina = $cliente_id = $this->uri->segment(4); // parametro #4\n\n $campos = array('id','nombre','telefono1'); // campos de la tabla\n\n $respuesta = paginar_todo( 'clientes', $pagina, $por_pagina, $campos ); // helper\n $this->response( $respuesta ); // imprime el resultado de lo que se obtuvo\n }", "function getDetailAllRoute($common_id1,$DbConnection)\n{\n $query=\"select * FROM route USE INDEX(route_uaid_status) WHERE user_account_id='$common_id1' and status='1'\";\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$route_id=$row->route_id; \n $route_name=$row->route_name;*/ \t\t\t\t\t\t\t\t \n $data[]=array('route_id'=>$row->route_id,'route_name'=>$row->route_name);\n }\n return $data;\n}", "public function Pages($params = array())\n\t{\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_key = 'collect.model.pages.' . serialize($params);\n\t\t\t$ret = $this->cache->get($cache_key);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`u`.`collect_model_id`) AS `COUNT`',\n 'from' => array('{{collect_model}}', 'u')\n );\n\t\tif(isset($params['collect_model_status']) && !empty($params['collect_model_status'])) {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`=:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = $params['collect_model_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`>:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = 0;\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`u`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_name']) && !empty($params['collect_model_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':collect_model_name'\n );\n\t\t\t$sql_params[':collect_model_name'] = $params['collect_model_name'];\n\t\t}\n\t\t//\n\t\t//\n\t\tif(isset($params['searchKey']) && $params['searchKey']) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = $params['searchKey'];\n\t\t}\n\t\t\n //$command = $this->db->createCommand();\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`u`.`collect_model_rank` ASC',\n\t\t\t\t\t'`u`.`collect_model_id` DESC',\n\t\t\t\t);\n\t\t}\n \n $builds['select'] = '`u`.`collect_model_id`, `u`.`collect_model_name`, `u`.`collect_model_identify`, `u`.`collect_model_rank`, `u`.`collect_model_lasttime`, `u`.`collect_model_dateline`, `u`.`content_model_id`, `c`.`content_model_name`';\n $builds['leftJoin'] = array(\n '{{content_model}}', 'c', '`c`.`content_model_id`=`u`.`content_model_id`'\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_cache_time = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($_cache_key, json_encode($ret), $cache_cache_time);\n\t\t\tunset($cache_cache_time, $cache_key);\n\t\t}\n\t\treturn $ret;\n\t}", "public function all(): Paginator\n {\n return $this->model->paginate();\n }", "public function fetchAll()\n {\n return Accessory::paginate(25);\n }", "public function index()\n {\n //根据id查询,角色名查询,描述查询\n return $this->response()->paginator($this->repository->paginate(),new CommonTransformer());\n }", "public function index()\n {\n return Press::sorted()->paginate(6);\n }", "public function index()\n {\n return new PlancomptasResource(Plancompta::paginate());\n }", "function get_all_car_detail($params = array())\n {\n try{\n $this->db->order_by('car_id', 'desc');\n if(isset($params) && !empty($params)){\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('car_detail')->result_array();\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in get_all_car_detail function - ' . $ex);\n } \n }", "public function index()\n {\n sleep(1);\n return Beacon::paginate();\n }", "public function actionIndex2()\r\n\t{\r\n\t\t// calling line :\r\n\t\t/*\r\n\t\thttp://www.k-m.ru/app2/index.php?r=backend/index&Table=Assortment&_dc=1401196798272&page=1&start=0&limit=20&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=5&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=56&filter[1][field]=size&filter[1][data][type]=list&filter[1][data][value]=medium,large\r\n\t\t*/\r\n// filter[0][operator]=OR&filter[0][field]=title&filter[0][data][type]=string&filter[0][data][value]=ela\r\n\t\t$ModelName = $_GET['Table'];\t\t\r\n\t/*\tif (!class_exists($ModelName, false)) \r\n\t\t\treturn json_encode(array('success'=> false , 'msg'=> Yii::t('general', 'There is no such class in the system')));*/\r\n\t\t\t\r\n\t\t$table_name = 'tarex_' . strtolower($ModelName);\r\n\t\t// collect request parameters\r\n\t\t$offset = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;\r\n\t\t$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 50;\r\n\t\t$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';\r\n\t\t$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';\r\n\t\t$filters = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;\r\n\t\t\r\n\t\t// GridFilters sends filters as an Array if not json encoded\r\n\t\tif (is_array($filters)) {\r\n\t\t\t$encoded = false;\r\n\t\t} else {\r\n\t\t\t$encoded = true;\r\n\t\t\t$filters = json_decode($filters);\r\n\t\t}\r\n\t\t\r\n\t\t$where = ' 0 = 0 ';\r\n\t\t$qs = '';\r\n\r\n\t\t// loop through filters sent by client\r\n\t\tif (is_array($filters)) {\r\n\t\t\tfor ($i=0;$i<count($filters);$i++){\r\n\t\t\t\t$filter = $filters[$i];\r\n\r\n\t\t\t\t// assign filter data (location depends if encoded or not)\r\n\t\t\t\tif ($encoded) {\r\n\t\t\t\t\t$field = $filter->field;\r\n\t\t\t\t\t$value = $filter->value;\r\n\t\t\t\t\t$compare = isset($filter->comparison) ? $filter->comparison : null;\r\n\t\t\t\t\t$filterType = $filter->type;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$field = $filter['field'];\r\n\t\t\t\t\t$value = $filter['data']['value'];\r\n\t\t\t\t\t$compare = isset($filter['data']['comparison']) ? $filter['data']['comparison'] : null;\r\n\t\t\t\t\t$filterType = $filter['data']['type'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch($filterType){\r\n\t\t\t\t\tcase 'string' : $qs .= \" AND \".$field.\" LIKE '%\".$value.\"%' \"; Break;\r\n\t\t\t\t\tcase 'list' :\r\n\t\t\t\t\t\tif (strstr($value,',')){\r\n\t\t\t\t\t\t\t$fi = explode(',',$value);\r\n\t\t\t\t\t\t\tfor ($q=0;$q<count($fi);$q++){\r\n\t\t\t\t\t\t\t\t$fi[$q] = \"'\".$fi[$q].\"'\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$value = implode(',',$fi);\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" IN (\".$value.\")\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'boolean' : $qs .= \" AND \".$field.\" = \".($value); Break;\r\n\t\t\t\t\tcase 'numeric' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > \".$value; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'date' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$where .= $qs;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM {$table_name} WHERE \" . $where;\r\n\t\t/// \"SELECT COUNT(id) FROM demo WHERE \".$where\r\n\t\t$sql = \"SELECT COUNT(*) FROM {$table_name} WHERE \" . $where;\r\n\t\theader('Content-type:text/html; charset=utf-8');\r\n\t\techo '$sql=', $sql, '<br>';\r\n\t\t$data_count = Yii::app()->db->createCommand($sql)->queryScalar();\r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria);\r\n\t\techo '$sql count = ' , $data_count, '<br>';\r\n\t\t\r\n\t\t// добавление сортировки и ограничений на вывод\r\n\t\tif ($sort != \"\") {\r\n\t\t\t$query .= \" ORDER BY \".$sort.\" \".$dir;\r\n\t\t}\t\t\r\n\t\t//$query .= \" LIMIT \".$offset.\",\".$limit;\r\n\t\t\r\n\t\t//echo 'запрос с сортировкой и ограничением на вывод: $query = ', $query, '<br><br>'; // показ окончательного запроса\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$criteria = new CDbCriteria;\t \r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria); \r\n\t\t\r\n\t\t//$criteria->addCondition( $filter['']) \r\n\t\t//$criteria->select = array('id', 'oem', 'article', 'title', 'make');\r\n\t\t\r\n\t\t// добавляем параметры постраничного вывода\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria->limit = $_GET['limit'] ? $_GET['limit'] : 20; //echo \"Limit = \", $_GET['limit'];\r\n\t\t$criteria->offset = $_GET['start'] ? $_GET['start'] : 0; \r\n\t\t*/\r\n\t\t\r\n\t\t//echo '$criteria = '; print_r($criteria->toArray()); echo '<br/>';\r\n\t\t//$data = CActiveRecord::model($ModelName)->findAll($criteria); \r\n\t\t$data = CActiveRecord::model($ModelName)->findAllBySql($query); \r\n\t\t\r\n\t//\tprint_r($data);\r\n\t\t\r\n\t\t//$table_name='yiiapp_'.$Table; \r\n\r\n\t\t//$variable = 'MainMenu'; \r\n\t\t//$TestData = $variable::model()->findAll(); // since 5.3\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria=new CDbCriteria(array(\r\n\t\t'select'=>'t.*,count(j.*)',\r\n\t\t'join'=>'left join CountTbl j on condition',\r\n\t\t'order'=>'count(j.*)',\r\n\t\t))\r\n\r\n\t\t$criteria->condition='id=:id AND login=:login';\r\n\t\t$criteria->params=array(':id'=>5, ':login' => 'test'); // задаем параметры\r\n*/\r\n\t\t$new = array();\r\n\t foreach($data as $r) \r\n\t\t{\t\t \r\n\t\t\t/*$res['id']=$r['id'];\t\r\n\t\t\t$res['title']=$r['title'];\t\r\n\t\t\t$res['oem']=$r['oem'];\t\t\t\t\r\n\t\t\t$res['article']=$r['title'];\t\r\n\t\t\t$res['make']=$r['make'];\t*/\r\n\t\t\tforeach($r as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$res[$key] = $value;\r\n\t\t\t}\r\n\t\t\t$new[] = $res;\r\n\t\t} \r\n\t\t $result = array(\r\n\t\t\t'success'=>true,\r\n\t\t\t'data' => $new,\r\n\t\t\t'count' => $data_count //sizeof($new)\r\n\t\t );\r\n\t\t//echo 'TestData '.$TestData;\r\n\t\tprint_r(json_encode($result)); \r\n\t\t\r\n\t\t\r\n\t}", "public function index()\n {\n return AtributoValorResource::collection(AtributoValor::paginate(25));\n }", "public function paginate($params)\n {\n $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created_at';\n $order = isset($params['order']) ? $params['order'] : 'desc';\n $page_length = isset($params['page_length']) ? $params['page_length'] : config('config.page_length');\n $name = isset($params['name']) ? $params['name'] : '';\n\n return $this->contractor->filterByName($name)->orderBy($sort_by, $order)->paginate($page_length);\n }", "public function index()\n {\n return Product::orderBy('id','desc')->paginate(15);\n }", "public function index(Request $r)\n {\n // $search = $r->get('search');\n // return new TransactionCollection(Transaction::whereHas('details')->with(['details' => function($query) use ($id){\n // $query->with('product' => function($query) use ($id){\n // $query->where('product.id',$id);\n // });\n // }])->where('id','LIKE',\"%$search%\")->orderBy('id','desc')->paginate(10));\n }", "public static function pageTbhotelCliente($inicio, $pag, $rgtro)\n {\n $str=\"\";\n $str = \"select * from \".self::$tablename;\n if (trim($inicio) <> \"\")\n {\n // ojo cambiar las xxx por campo de busqueda \n $str.= \" Where xxxxx like '%$inicio%'\";\n $str.= \"\t or xxxxx like '%$inicio%'\";\n } \n $str .= \" order by xxxxx desc limit \" . $pag . \",\" . $rgtro;\n $cnx = dbcon();\n $rr = mysqli_query($cnx, $str);\n $array1 = array();\n $cn = 0;\n while ($rx = mysqli_fetch_array($rr))\n { \n $array1[$cn] = new tbhotelClienteData();\n $array1[$cn]->cons = $cn;\n $array1[$cn]->idnitHotel = $rx['idnitHotel'];\n $array1[$cn]->nitHotel = $rx['nitHotel'];\n $array1[$cn]->idCiudad = $rx['idCiudad'];\n $array1[$cn]->nomHotel = $rx['nomHotel'];\n $array1[$cn]->dirHotel = $rx['dirHotel'];\n $array1[$cn]->telHotel1 = $rx['telHotel1'];\n $array1[$cn]->telHotel2 = $rx['telHotel2'];\n $array1[$cn]->correoHotel = $rx['correoHotel'];\n $array1[$cn]->tipoHotel = $rx['tipoHotel'];\n $array1[$cn]->Administrador = $rx['Administrador'];\n $array1[$cn]->idRedes = $rx['idRedes'];\n $array1[$cn]->aforo = $rx['aforo'];\n $array1[$cn]->tipoHabitaciones = $rx['tipoHabitaciones'];\n $array1[$cn]->status = $rx['status'];\n $cn++;\n } // fin del Ciclo\n return $array1;\n }", "abstract public function getPaginate($premiereEntree, $messageTotal, $where);", "public function getPaginas($OficialiaDto, $param, $estado) {\n $inicia = false;\n $orden = \" \";\n $campos = \" a.cveAdscripcion, a.desAdscripcion, o.cveOficialia, o.desOficilia, o.cveDistrito, d.desDistrito, o.cveMunicipio, m.desMunicipio, e.cveEstado, e.desEstado \";\n $orden .= \" o inner join tbladscripciones a on a.cveAdscripcion = o.cveAdscripcion \";\n $orden .= \" left join tblmunicipios m on m.cveMunicipio = o.cveMunicipio \";\n $orden .= \" left join tbldistritos d on d.cveDistrito = o.cveDistrito \";\n $orden .= \" left join tblestados e on e.cveEstado = d.cveEstado AND e.cveEstado = m.cveMunicipio \";\n $orden .= \" where a.activo = 'S' \";\n $orden .= \" AND o.activo = 'S' \";\n if ($estado != \"\")\n $orden .= \" AND e.cveEstado = \" . $estado . \" \";\n if ($OficialiaDto->getCveMunicipio() != \"\")\n $orden .= \" AND o.cveMunicipio = \" . $OficialiaDto->getCveMunicipio() . \" \";\n if ($OficialiaDto->getCveDistrito() != \"\")\n $orden .= \" AND o.cveDistrito = \" . $OficialiaDto->getCveDistrito() . \" \";\n if ($OficialiaDto->getDesOficilia() != \"\")\n $orden .= \" AND o.desOficilia like '%\" . $OficialiaDto->getDesOficilia() . \"%' \";\n $OficialiaDao = new OficialiaDAO();\n $param[\"paginacion\"] = false;\n $oficialia = new OficialiaDTO();\n $numTot = $OficialiaDao->selectOficialia($oficialia, $orden, null, null, \" count(o.cveOficialia) as totalCount \");\n $Pages = (int) $numTot[0]['totalCount'] / $param[\"cantxPag\"];\n $restoPages = $numTot[0]['totalCount'] % $param[\"cantxPag\"];\n $totPages = $Pages + (($restoPages > 0) ? 1 : 0);\n\n $json = \"\";\n $json .= '{\"type\":\"OK\",';\n $json .= '\"totalCount\":\"' . $numTot[0]['totalCount'] . '\",';\n $json .= '\"data\":[';\n $x = 1;\n\n if ($totPages >= 1) {\n for ($index = 1; $index <= $totPages; $index++) {\n\n $json .= \"{\";\n $json .= '\"pagina\":' . json_encode(utf8_encode($index)) . \"\";\n $json .= \"}\";\n $x++;\n if ($x <= ($totPages )) {\n $json .= \",\";\n }\n }\n $json .= \"],\";\n $json .= '\"pagina\":{\"total\":\"\"},';\n $json .= '\"total\":\"' . ($index - 1) . '\"';\n $json .= \"}\";\n } else {\n $json .= \"]}\";\n }\n return $json;\n }", "public function search($params)\n {\n $seoTransTab = SeoT::tableName();\n $seoTab = Seo::tableName();\n $pgTab = Pages::tableName();\n $pgTransTab = PagesT::tableName();\n\n\n $query = Pages::find();\n $query->select($pgTab . '.*,'\n . $pgTransTab . '.*,'\n . $seoTab . '.url,'\n );\n $query->joinWith(['pagesT']);\n $query->join('LEFT JOIN', [$seoTab], $seoTab . '.url=concat(\"' . Helper::str()->replaceTagsWithDatatValues($this->actionUrl, $this) . '\",' . $pgTab . '.id)');\n $query->join('LEFT JOIN', [$seoTransTab], $seoTransTab . '.seo_id=' . $seoTab . '.id');\n $query->groupBy([$pgTab . '.id']);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 20\n ]\n ]);\n\n $dataProvider->sort->attributes['title'] = [\n 'asc' => [$pgTransTab . '.title' => SORT_ASC],\n 'desc' => [$pgTransTab . '.title' => SORT_DESC],\n ];\n $dataProvider->sort->attributes['h1'] = [\n 'asc' => [$seoTransTab . '.h1' => SORT_ASC],\n 'desc' => [$seoTransTab . '.h1' => SORT_DESC],\n ];\n $dataProvider->sort->attributes['alias'] = [\n 'asc' => [$seoTransTab . '.alias' => SORT_ASC],\n 'desc' => [$seoTransTab . '.alias' => SORT_DESC],\n ];\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n $pgTab . '.status' => $this->status,\n ]);\n $query->andFilterWhere([\n 'and',\n ['like', $seoTransTab . '.alias', $this->alias],\n ['like', $pgTransTab . '.title', $this->title],\n ['like', $seoTransTab . '.h1', $this->h1,]\n ]);\n\n return $dataProvider;\n }", "public function index()\n {\n return Application::latest()->paginate(10);\n }", "public function readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "public function index()\n {\n return Movie::paginate();\n }", "public function index()\n {\n //return $phone;\n return PhonesCollection::collection(Phones::paginate(5));\n }", "public function index()\n {\n return CompanyResource::collection(Company::orderBy('id','desc')->paginate(10));\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n return Customer::paginate( 50 );\n }", "public function getAll()\n {\n return Admin::paginate($this->pagination);\n }", "public function getAll()\n {\n return $this->banque->paginate(10);\n }", "public function index()\n {\n return Container::paginate();\n }", "public function index()\n {\n //\n return \\App\\Article::orderBy('created_at','desc')->paginate(25);\n }", "public function index()\n {\n return Material::oldest()->paginate(5);\n }", "public function index()\n {\n $this->data['model'] = MailTracking::orderBy('Mtr_CreatedOn', 'desc')->paginate(10);\n\n return parent::index();\n }", "public function paginate($orderBy = 'nome', $perPage = 10);", "public function getAllRoute()\n {\n return $this->hasMany('Api\\Model\\IntraHyperRoute', 'fk_buyer_seller_post_id', 'id')->where('lkp_service_id', '=', _HYPERLOCAL_);\n }", "public function getPerPage();", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function indexForFilter(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $query = $this->{$this->main_model}->find();\n $this->CommonQuery->build_common_query($query,$user,[]); \n $q_r = $query->all();\n $items = array();\n foreach($q_r as $i){\n array_push($items,array(\n 'id' => $i->id, \n 'text' => $i->name\n ));\n } \n\n $this->set(array(\n 'items' => $items,\n 'success' => true,\n '_serialize' => array('items','success')\n ));\n }", "public function index()\n {\n //\n $tab=\"in\";\n if (isset($_GET[\"tab\"])){\n $tab=$_GET[\"tab\"];\n }\n\n switch ($tab){\n case \"all\": return $this->search_paginate(Act::where(function ($q){\n $user=$this->user();\n $q->where('sellerTin',$user->tin)\n ->orWhere('buyerTin', $user->tin);\n }));\n\n case \"out\": return $this->search_paginate(Act::where(\"sellerTin\", $this->user()->tin)\n ->whereNotIn(\"status\", [self::DOC_STATUS_SAVED])\n );\n case \"saved\": return $this->search_paginate(Act::where(\"sellerTin\", $this->user()->tin)\n ->where(\"status\", self::DOC_STATUS_SAVED)\n );\n case \"in\":\n default: return $this->search_paginate(Act::where(\"buyerTin\", $this->user()->tin)\n );\n }\n }", "public function index()\n {\n //\n return OrderResource::collection(Order::paginate());\n }", "public function index()\n {\n return ProdutoResource::collection(Produto::paginate(25));\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function findAllWithPagination(): LengthAwarePaginator;", "public function findAllWithPagination(): LengthAwarePaginator;", "public function Allplanlist($model);", "public function index()\n {\n return Order::paginate(5);\n }", "public function index()\n {\n return ProductResource::collection(Product::paginate(15));\n }", "public function index()\n {\n return User::latest()->paginate(10) ;\n }" ]
[ "0.62928766", "0.61293566", "0.6113925", "0.5961577", "0.58780205", "0.585621", "0.5854648", "0.583071", "0.5822278", "0.5796941", "0.5704442", "0.56956583", "0.5688021", "0.56871855", "0.5667924", "0.5659477", "0.56510365", "0.56237423", "0.5610147", "0.56031924", "0.559643", "0.55893", "0.55850387", "0.55801785", "0.55737066", "0.5551169", "0.554238", "0.5531445", "0.55306774", "0.5519049", "0.5515773", "0.5515719", "0.55110323", "0.5509496", "0.5472848", "0.5472688", "0.54666865", "0.5460541", "0.54589844", "0.54539937", "0.544678", "0.54450566", "0.5423575", "0.5423086", "0.54167974", "0.53977066", "0.5393487", "0.53919977", "0.5389372", "0.5389026", "0.53854024", "0.5384237", "0.5384219", "0.53731805", "0.5359204", "0.5358888", "0.5355067", "0.53530073", "0.5351375", "0.5347896", "0.5340485", "0.53328276", "0.533228", "0.5330631", "0.5327627", "0.5327604", "0.5327229", "0.5323407", "0.53161144", "0.53104365", "0.53039527", "0.53008777", "0.529942", "0.52950007", "0.52885264", "0.5287116", "0.5286726", "0.5286018", "0.5283744", "0.5275143", "0.52734053", "0.5273397", "0.52723795", "0.5272361", "0.527013", "0.526911", "0.5266575", "0.5264701", "0.5264701", "0.52645904", "0.5264353", "0.5255621", "0.52464664", "0.52459526", "0.52454454", "0.52454454", "0.5245291", "0.524456", "0.5240914", "0.52297485" ]
0.6447709
0
Get value a field by PrimaryKey (routerId) Example getValueByPrimaryKey('routerName', 1) Get value of filed routerName in table router where routerId = 1
public function getValueByPrimaryKey($fieldName, $primaryValue){ //debug LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue); $routerVo = $this->selectByPrimaryKey($primaryValue); if($routerVo){ return $routerVo->$fieldName; } else{ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$orderDataVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($orderDataVo){\n\t\t\treturn $orderDataVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "protected function _getPrimaryKeyValue(){\n $primaryKey = $this->_getPrimaryKey();\n return $this->{$primaryKey};\n }", "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$customerDetailVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($customerDetailVo){\n\t\t\treturn $customerDetailVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$customerVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($customerVo){\n\t\t\treturn $customerVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public function getKeyValue() {\n $primaryKey = $this->getKeyName();\n return $this->$primaryKey;\n }", "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$sliderImageVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($sliderImageVo){\n\t\t\treturn $sliderImageVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public function get($primaryKeyValue)\n\t{\n\t\t// Get only one record using the primary key\n\t\treturn $this->getOne(array($this->getPrimaryKeyField(), '=', $primaryKeyValue));\n\t}", "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "public function find($primaryValue);", "abstract function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "function getValue( $colValueName, $tblName, $whereColumn, $passingId) { // selected column name, table name, for where condition, passing id for where\n\t\n\tglobal $dbc;\n $sql_get = \"SELECT $colValueName FROM $tblName WHERE $whereColumn='\".$passingId.\"'\";\n\t\n\t$getValue = $dbc;\n\t$getValue->query($sql_get);\n\t$getValue->next_record();\n\n\t$rowValue = $getValue->rowdata();\n\t$theValue = $rowValue[$colValueName];\n\n\treturn $theValue;\n\n}", "function getFieldValue($value_id)\r\n\t{\r\n\t\t$q = \"SELECT \".$this->fieldToSelect.\" FROM `\".$this->tableName.\"` WHERE \".$this->tableId.\"='\".$value_id.\"'\";\r\n\t\t$this->db->Execute($q);\r\n\r\n\t\tif($this->db->Affected_rows() > 0)\r\n\t\t{\r\n\t\t\t$field_value = $this->db->GetOne($q);\r\n\t\t\treturn $field_value;\r\n\t\t}else{\r\n\t\t\tdie('<strong>Nama Field yang ada di dalam tanda {} tidak ada di table '.$this->tableName.',<br> sql : '.$this->sql.'</strong>');\r\n\t\t}\r\n\t\treturn '';\r\n\t}", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "function findById($db, $table, $primaryKey, $value, $options = '') {\n\t$query = 'SELECT * FROM ' . $table . ' WHERE ' . $primaryKey . '= :value ' . ' ' . $options ;\n\n\t$parameters = [\n\t\t'value' => $value\n\t];\n\n\t$result = runQuery($db, $query, $parameters);\n\n\treturn $result;\n}", "function getValue(int $field);", "public function getValue($value_id) {\n return $this->getValueDao()->searchById($value_id, $this->id)->getRow();\n }", "function getByField ( $field,$value){\n\t\t $result=$this->fetchRow(\"$field= '$value' \"); //order by id?\n\t\t if($result==null)\n\t\t\t return;\n\t\t if(is_array($result))\n\t\t\t return $result[0];\n\t\t return $result;\n\t}", "function getByID($table,$field,$value);", "public function get() {\r\n $this->checkGateway();\r\n\r\n $id = func_get_args();\r\n\r\n // Create the SQL Query\r\n $sql = \"SELECT * FROM {$this->name} WHERE \";\r\n foreach ((array) $this->primary as $key => $primary) {\r\n\r\n // More primary keys than parameters\r\n if (! isset($id[$key])) {\r\n throw new DatabaseGatewayException(\"The 'get' method requires every primary keys as parameters to be given in the same order\");\r\n }\r\n\r\n // Query parameter\r\n $sql .= $primary . \" = :$primary AND \";\r\n\r\n // Safe query\r\n $this->db->bind($primary, $id[$key]);\r\n }\r\n $sql = trim($sql, \" AND \");\r\n\r\n // Result\r\n return $this->db->row($sql);\r\n }", "function getFieldValueById($table_name=NULL,$condition=NULL,$return_field=\"id\"){\r\n\t\tif(!isset($condition)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where($condition);\r\n\t\t$recordSet = $this->db->get($table_name);\r\n\t\t$data=$recordSet->result() ;\r\n\t\t\r\n\t\tif(count($data)>0){\r\n\t\t\treturn $data[0]->$return_field;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function retrieveFieldValue(Field $field, $model);", "public function get($primaryKeyValue = 0)\n\t{\n\t\t// Create new row object\n\t\tif(!$primaryKeyValue) {\n\t\t\t$row = new $this->rowClass();\n\t\t\treturn $row;\n\t\t\n\t\t// Find record by primary key\n\t\t} else {\n\t\t\treturn $this->first(array($this->getPrimaryKeyField() => $primaryKeyValue));\n\t\t}\n\t}", "public function getByKey($value){\n $adapter = $this->createAdapter();\n $sql = $this -> getSelectStatement().\"where\".$this->getKeyName().\"=?\";\n return $adapter -> query($sql, $value);\n $adapter = null;\n\n }", "public function fetch($primaryKey);", "public function getPrimaryKey($value = FALSE) {\n\t\t$pK = self::$primaryKey[$this->table];\n\t\tif ($value)\t\n\t\t\treturn $this->$pK;\n\t\treturn $pK;\n\t}", "public function _get($model,$key){\n return $model->_table[$this->short_name][$key];\n }", "public function getValueByField($fieldName, $where){\n\t\t$routerVo = new RouterVo();\n\t\t$whereLog = [];\n\t\tforeach ($where as $k => $v){\n\t\t\t$routerVo->{$k} = $v;\n\t\t\t$whereLog[] = \"$k -> $v\"; \n\t\t}\n\t\t\n\t\t//debug\n LogUtil::sql('(getValueByField) ... where = ' . '(' .join(', ', $whereLog). ')');\n \n\t\t$routerVos = $this->selectByFilter($routerVo);\n \n\t\tif($routerVos){\n\t\t\t$routerVo = $routerVos[0];\n\t\t\treturn $routerVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public function fetchField();", "function getFieldValue($field);", "function get_val($id, $field){\n if($id){\n $q = sql_query(\"SELECT `$field` FROM `entities` WHERE `ID` = '$id'\");\n $r = mysqli_fetch_row($q);\n mysqli_free_result($q);\n return $r[0];\n }\n else{\n return \"\";\n }\n}", "protected function actionGetByPrimaryKey($primaryKey)\n {\n return $this->_static_block->getByPrimaryKey($primaryKey);\n }", "function getValue($k) {\n\tglobal $mysqli;\n\t$stmt = $mysqli->prepare(\"select value from keyValue where keyName=?\");\n\tif (!$stmt) {\n\t\terror_log(\"Error on getValue \" . $mysqli->error);\n\t\treturn null;\n\t}\n\n\t$stmt->bind_param(\"s\",$k);\n\t$stmt->execute();\n\t$stmt->bind_result($value);\n\t$stmt->fetch();\n\treturn $value;\n}", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n if ($rs->EOF) {\n return null;\n }\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "function getTblResVal($result, $tablename, $pk, $id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from $tablename where $pk='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs[$result];\n\t}\n\n\t$crud->disconnect();\n}", "public function getField($pk = null)\n\t{\n\t\treturn parent::getRecord($pk);\n\t}", "public function findByPk($primary)\n {\n $stmt = $this->Adapter->prepare(\"SELECT * FROM $this->table WHERE $this->primaryName=:id\");\n $stmt->execute(['id' => $primary]);\n return $stmt->fetch($this->pdoFetch);\n }", "public function getPrimaryKey(phpDataMapper_Model_Row $row)\n\t{\n\t\t$pkField = $this->getPrimaryKeyField();\n\t\treturn $row->$pkField;\n\t}", "function getValue_lk( $colValueName, $tblName, $whereColumn, $passingId) { // selected column name, table name, for where condition, passing id for where\n\t\n\tglobal $dbc1;\n $sql_get = \"SELECT $colValueName FROM $tblName WHERE $whereColumn='\".$passingId.\"'\";\n\t\n\t$getValue = $dbc1;\n\t$getValue->query($sql_get);\n\t$getValue->next_record();\n\n\t$rowValue = $getValue->rowdata();\n\t$theValue = $rowValue[$colValueName];\n\n\treturn $theValue;\n\n}", "function getValue($table_name, $key_column_name, $key_value, $column_name)\n {\n\n }", "public function getValueId()\n {\n return $this->valueId;\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "function getValueSiso( $colValueName, $tblName, $whereColumn, $passingId) { // selected column name, table name, for where condition, passing id for where\n\t\n\tglobal $dbs;\n $sql_get = \"SELECT $colValueName FROM $tblName WHERE $whereColumn='\".$passingId.\"'\";\n\t\n\t$getValue = $dbs;\n\t$getValue->query($sql_get);\n\t$getValue->next_record();\n\n\t$rowValue = $getValue->rowdata();\n\t$theValue = $rowValue[$colValueName];\n\n\treturn $theValue;\n\n}", "public function returnDetailFindByPK($id);", "public function getPrimaryKeyField()\n\t{\n\t\treturn $this->primaryKey;\n\t}", "public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}", "public function getValue($key);", "public function getValue($key);", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function findByPrimaryKey($key) {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "public function getPrimaryKeyField(OrmTable $table){\n foreach($table->getFields() as $field){\n if($field->getPrimary()){\n return $field;\n }\n }\n return null;\n }", "function find($table, $value, $pk = null)\n {\n if(is_null($pk)){\n $pk = \"id\";\n }\n $this->query(\"SELECT * FROM $table WHERE $pk = '$value'\");\n return oci_fetch_array($this->result);\n }", "public function getValueIdentifier(): string;", "static function retrieveByName($value) {\n\t\treturn static::retrieveByColumn('name', $value);\n\t}", "public static function find_by_id($id){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"SELECT * FROM \".$table.\" WHERE \".$keyColumn.\" = \".$id;\n $res = mysqli_query(static::$conn,$sql);\n $row = mysqli_fetch_object($res,get_called_class());\n return $row;\n }", "public static function find(string $idvalue)\n\t\t{\n\t\t\t$pk = self::get('id') ;\n\t\t\t$tb = self::get('tabla') ;\n\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb \n\t\t\t\t\t \t WHERE $pk='$idvalue' ;\") \n\t\t\t\t\t->getObject(get_called_class()) ;\n\t\t}", "public function getFieldValue(Field $field, $model);", "protected function _getPrimaryKey(){\n $def = $this->_getDef();\n foreach($def as $column){\n if($column['primary'] === true){\n return $column['field_name'];\n }\n }\n \n return false;\n }", "public function getBy($key, $value);", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "public function primaryKey()\n {\n return $this->data[static::$primaryKey] ?? null;\n }", "public function getValue( O_Dao_ActiveRecord $obj, $fieldValue, $fieldExists )\r\n\t{\r\n\t\treturn $this->getRelation( $obj->id );\r\n\t}", "public function getFieldValueById($postFieldId)\n {\n\t $table = self::tablePrefix().'cms_post_field';\n\t $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tWHERE id = :pfid\n\t\t\t\t \";\n\t $cmd = self::getDb()->createCommand($strSql);\n\t $cmd->bindValue(\":pfid\",$postFieldId,\\PDO::PARAM_STR);\n\t return $cmd->queryOne();\n }", "function get_by_id($id)\n {\n $db2 = $this->load->database('database_kedua', TRUE);\n\n $db2->where($this->id, $id);\n return $db2->get($this->table)->row();\n }", "public function getKeyValue() {}", "function get_by_id($id)\n {\n $this->db2->where($this->id, $id);\n return $this->db2->get($this->table)->row();\n }", "public abstract function FetchField();", "public function getPkValue(){\n $pk = static::getPk();\n return (int) $this->$pk;\n }", "function findProperty($id);", "function clients_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM clients WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function findByPrimaryKey($key)\n {\n $requete = self::$SELECT . \" WHERE id=\" . $key;\n $rs = $this->conn->query($requete);\n\n return $this->mapSqlToObject(mysqli_fetch_array($rs));\n }", "function get_value($field, $table, $where)\n{\n # load ci instance\n $CI = & get_instance();\n $CI->load->database();\n\n $val = '';\n $sql = \"SELECT \" . $field . \" FROM \" . $table . \" WHERE \" . $where;\n $query = $CI->db->query($sql);\n foreach ($query->result_array() as $r) {\n $val = $r[$field];\n }\n return $val;\n}", "function GetRecordByPk($pvalue)\n {\n $pkey = $this->primarykey;\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n //cache su file---->\n if ( $this->usecachefile == 1 )\n {\n $cacheindex = $pvalue;\n if ( !file_exists(\"$path/\" . $databasename . \"/cache\") )\n mkdir(\"$path/\" . $databasename . \"/cache\");\n $cachefile = \"$path/\" . $databasename . \"/cache/\" . $tablename . \".\" . urlencode($pvalue) . \".cache\";\n if ( file_exists($cachefile) )\n {\n $ret = file_get_contents($cachefile);\n $ret = @unserialize($ret);\n //dprint_r(\"[$cachefile]\");\n //dprint_r ($ret);\n if ( $ret !== false )\n return $ret;\n }\n }\n //cache su file----<\n\n\n $old = $this->GetFileRecord($pkey,$pvalue);\n $values = readDatabase($old,$this->xmlfieldname);\n //dprint_r($old);\n $ret = null;\n $found = false;\n if ( !is_array($values) )\n return null;\n foreach ( $values as $value )\n {\n if ( $value[$pkey] == ($pvalue) )\n {\n $found = true;\n $ret = $value;\n break;\n }\n }\n //riempo i campi che mancano\n if ( $found )\n foreach ( $this->fields as $field )\n {\n if ( !isset($ret[$field->name]) )\n $ret[$field->name] = isset($field->defaultvalue) ? $field->defaultvalue : null;\n }\n //dprint_r($ret);\n\n\n //cache su file---->\n if ( $this->usecachefile == 1 )\n {\n $cachestring = serialize($ret);\n $fp = fopen($cachefile,\"wb\");\n fwrite($fp,$cachestring);\n fclose($fp);\n }\n //cache su file----<\n\n\n return $ret;\n }", "public function testPrimaryKeyField()\n {\n $field = $this->table->getField($this->table->getPrimaryKeys()[0]);\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Integer',\n $field);\n $this->assertEquals('primaryKeyID', $field->getName());\n }", "function _getTablepkeyValue($virtuemart_order_id) {\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$q = 'SELECT ' . $this->_tablepkey . ' FROM `' . $this->_tablename . '` '\r\n\t\t. 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;\r\n\t\t$db->setQuery($q);\r\n\r\n\t\tif (!($pkey = $db->loadResult())) {\r\n\t\t\tJError::raiseWarning(500, $db->getErrorMsg());\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\treturn $pkey;\r\n\t}", "public function getValue($field) {\n if (array_key_exists($field, $this->data)) {\n return $this->data[$field];\n } else {\n die(\"Campo no encontrado\");\n }\n}", "public static function find($primary_key)\n {\n return static::select()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fetchOne();\n }", "public function Get($id){\n $connection = DatabaseMySQL::Connect();\n $query = \"SELECT \".$this->fields().\" FROM \".$this->tableName().\" WHERE 1 = 1 AND \".$this->pks($id);\n if ($result = DatabaseMySQL::Query($query,$connection)) {\n return DatabaseMySQL::ReadObject($result, $this->className());\n }\n }", "function lookup($prj_id, $field, $value)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->lookup($field, $value);\n }", "public function getValueFromKey($givenKey)\n {\n $value = $this->database->get($givenKey); \n return $value; \n }", "public static function getPk(){\n return static::$_primaryKey;\n }", "function fieldvalue($field=\"menu_id\",$id=\"\",$condition=\"\",$order=\"\")\n\t{\n\t\t$rs=$this->fetchrecordset($id, $condition, $order);\n\t\t$ret=0;\n\t\twhile($rw=mysql_fetch_assoc($rs))\n\t\t{\n\t\t\t$ret=$rw[$field];\n\t\t}\n\t\treturn $ret;\n\t}", "protected abstract function getPrimaryKeyName();", "function get_field($field, $where_field, $where_value, $debug = FALSE)\r\n {\r\n \t\r\n \t$this->db->select($field)->from($this->table)->where($where_field, $where_value);\r\n \t$query_db = $this->db->get();\r\n \t\r\n \tif($debug)\r\n \t{\r\n \t\tprint_a('Arguments~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($field);\r\n \t\tprint_a($where_field);\r\n \t\tprint_a($where_value);\r\n \t\t\r\n \t\tprint_a('SQL returned handle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($query_db);\r\n \t\t\r\n \t\tprint_a('DB data~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($query_db->row_array());\r\n \t}\r\n \telse\r\n \t{\r\n \t\tif($query_db->num_rows)\r\n \t\t{\r\n \t\t\t$results = $query_db->row_array(); \r\n \t\t\treturn $results[$field];\r\n \t\t\t\r\n \t\t}\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n }", "function getFieldByPhotoID($columnName, $photoID)\n{\n //photo_data db\n //photo_data, video_data are tables\n $hn = 'db710109142.db.1and1.com';\n $db = 'db710109142';\n $un = 'dbo710109142';\n $pw = '1Lovecandy!';\n $conn = new mysqli($hn, $un, $pw, $db);\n if ($conn->connect_error) die($conn->connect_error);\n $query = \"SELECT * FROM photo_data WHERE photo_id='$photoID';\";\n $result = $conn->query($query);\n $conn->close();\n if ($result === '') {\n return null;\n } else {\n $ret = $result->fetch_assoc()[$columnName];\n return $ret;\n }\n}", "function kval_sqlite_get_item($key)\n{\n $sql = 'SELECT * FROM kv WHERE kv_key = ?';\n $return = kval_sqlite_query($sql, $key)->fetch();\n if (!$return) {\n return null;\n }\n return array(\n 'item' => unserialize($return['kv_value']),\n 'ts' => (int) $return['kv_ts'],\n );\n}", "public function getPrimary(){\n return $this->primaryKey;\n }", "function readResourceElement($table, $fields, $element_key, $key_value){\n // Load the appropriate helpers\n $ci =& get_instance(); $ci->load->helper('database');\n return database_query(\n \"SELECT \".$fields.\" FROM \".$table.\" WHERE \".$element_key.\"=?\",\n \"s\", [$key_value]\n );\n}", "function getvalfield($con,$table,$field,$where)\n{\n\t//$sql = \"select $field from $table where $where\";\n\t//echo $sql; echo \"<br>\";\n\t//$getvalue = mysqli_query($con,$sql);\n\t//$getval = mysqli_fetch_row($getvalue);\n\n\t//return $getval[0];\n\t$stmt = $con->prepare(\"SELECT $field FROM $table WHERE $where\"); \n\t$stmt->execute(); \n\t$row = $stmt->fetch(); \n\tif(empty($row)){\n\t\treturn 0;\n\t}else{\n\t\treturn $row[0];\n\t}\n\t\n}", "static function retrieveByPK($id) {\n\t\treturn static::retrieveByPKs($id);\n\t}", "public function getFieldValue($name)\n\t\t{\n\t\t\treturn $this->row[$name];\n\t\t}", "function get_by_id($id)\r\n {\r\n $this->db->where($this->id, $id);\r\n return $this->db->get($this->table)->row();\r\n }", "public function findBy($field, $value)\n {\n return $this->model->where($field, $value)->firstOrFail();\n }", "function getSpecificValue($con, $table, $column1, $column2, $value1)\n{\n $result = mysqli_query($con, \"SELECT $column2 \"\n . \"FROM $table \"\n . \"WHERE $column1='$value1'\");\n $valueArray = mysqli_fetch_array($result);\n\n return $valueArray[0];\n}" ]
[ "0.6869985", "0.6859942", "0.66671616", "0.66411173", "0.6569145", "0.64739686", "0.64556205", "0.629257", "0.624263", "0.6237822", "0.6176706", "0.6176706", "0.6176706", "0.61532664", "0.61532664", "0.6141538", "0.61303204", "0.6111565", "0.60566956", "0.6048704", "0.6034055", "0.59692824", "0.5950391", "0.594307", "0.592643", "0.58790636", "0.5825922", "0.5804784", "0.5794954", "0.57936484", "0.5791904", "0.5776563", "0.5774396", "0.57439065", "0.57351696", "0.5709164", "0.56823504", "0.5670023", "0.5666726", "0.5664116", "0.56565046", "0.5610609", "0.5606194", "0.5602584", "0.5591771", "0.5590889", "0.55801475", "0.55750424", "0.5574819", "0.5566765", "0.5564173", "0.55556", "0.55556", "0.55475944", "0.55475944", "0.55475944", "0.5544502", "0.5529198", "0.55188406", "0.55129534", "0.55092156", "0.5491006", "0.54894954", "0.54834837", "0.54806", "0.54579043", "0.5454647", "0.5450053", "0.5447628", "0.54452527", "0.54449064", "0.5443335", "0.54408956", "0.5436523", "0.5433785", "0.5428676", "0.54237527", "0.5419133", "0.54189485", "0.5410326", "0.54041433", "0.54030436", "0.53993607", "0.5393808", "0.53799194", "0.53663343", "0.53624904", "0.535634", "0.53330266", "0.5320723", "0.5313095", "0.53104144", "0.53039056", "0.52969515", "0.5293755", "0.52907425", "0.5290371", "0.52880144", "0.5287887", "0.5284719" ]
0.7555657
0
Get value a field by field list input where Example getValueByField('routerName', array('routerId' => 1)) Get value of filed routerName in table router where routerId = 1
public function getValueByField($fieldName, $where){ $routerVo = new RouterVo(); $whereLog = []; foreach ($where as $k => $v){ $routerVo->{$k} = $v; $whereLog[] = "$k -> $v"; } //debug LogUtil::sql('(getValueByField) ... where = ' . '(' .join(', ', $whereLog). ')'); $routerVos = $this->selectByFilter($routerVo); if($routerVos){ $routerVo = $routerVos[0]; return $routerVo->$fieldName; } else{ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFieldValue($field);", "function getByField ( $field,$value){\n\t\t $result=$this->fetchRow(\"$field= '$value' \"); //order by id?\n\t\t if($result==null)\n\t\t\t return;\n\t\t if(is_array($result))\n\t\t\t return $result[0];\n\t\t return $result;\n\t}", "public function getValue($field) {\n if (array_key_exists($field, $this->data)) {\n return $this->data[$field];\n } else {\n die(\"Campo no encontrado\");\n }\n}", "function getValue(int $field);", "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "public function fetchField();", "public function retrieveFieldValue(Field $field, $model);", "function find_field_value($field, $value, $separator = null){\n\t\tif($separator){\n\t\t\t$results = $this -> model -> find_arrayfield_value($field, $value, $separator);\n\t\t\treturn $results;\n\t\t}\n\t\t$results = $this -> model -> find_field_value($field, $value);\n\t\treturn $results;\n\t}", "public function getFieldValue(Field $field, $model);", "public function getField($field_name);", "public function get($field);", "public function get($field);", "public function getField();", "public function getField();", "public function getField();", "function _get_by($field, $value = array())\r\n\t{\r\n\t\tif (isset($value[0]))\r\n\t\t{\r\n\t\t\t$this->where($field, $value[0]);\r\n\t\t}\r\n\r\n\t\treturn $this->get();\r\n\t}", "function fieldvalue($field=\"menu_id\",$id=\"\",$condition=\"\",$order=\"\")\n\t{\n\t\t$rs=$this->fetchrecordset($id, $condition, $order);\n\t\t$ret=0;\n\t\twhile($rw=mysql_fetch_assoc($rs))\n\t\t{\n\t\t\t$ret=$rw[$field];\n\t\t}\n\t\treturn $ret;\n\t}", "public function getFieldValue(/*string*/ $fieldName);", "public function getByField($field, $value)\n {\n }", "public function getByField($field, $value)\n {\n }", "public abstract function FetchField();", "public function getFieldValue($table, $fields=\"\", $condition=\"\") //$condition is array \n\t{\n\t\tif($fields != \"\")\n\t\t{\n\t\t\t$this->db->select($fields);\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs = $this->db->get_where($table,$condition);\n\t\t}\n\t\t$result = $rs->row_array();\n\t\treturn $result[$fields];\n\n\t}", "public function findBy($field, $value);", "public function getLookupField() {}", "public function fieldValues()\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"https://crm.zoho.com/crm/private/xml/Leads/getSearchRecordsByPDC?authtoken=\". config('app.ZOHO_KEY') .\"&scope=crmapi\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, '50');\n\n $content = curl_exec($ch);\n return $content;\n curl_close($ch);\n }", "function get_field($name)\r\n {\r\n if ($name)\r\n {\r\n $tempArray = fetch_to_array(database::query(\"SELECT * FROM system WHERE name='$name'\"),\"\");\r\n if (is_array($tempArray)) return(current($tempArray));\r\n }\r\n else return (false);\r\n }", "function getfield($field){\n\n\t\treturn($this->record[$field]);\n\t}", "function get_field($field, $where_field, $where_value, $debug = FALSE)\r\n {\r\n \t\r\n \t$this->db->select($field)->from($this->table)->where($where_field, $where_value);\r\n \t$query_db = $this->db->get();\r\n \t\r\n \tif($debug)\r\n \t{\r\n \t\tprint_a('Arguments~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($field);\r\n \t\tprint_a($where_field);\r\n \t\tprint_a($where_value);\r\n \t\t\r\n \t\tprint_a('SQL returned handle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($query_db);\r\n \t\t\r\n \t\tprint_a('DB data~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');\r\n \t\tprint_a($query_db->row_array());\r\n \t}\r\n \telse\r\n \t{\r\n \t\tif($query_db->num_rows)\r\n \t\t{\r\n \t\t\t$results = $query_db->row_array(); \r\n \t\t\treturn $results[$field];\r\n \t\t\t\r\n \t\t}\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n }", "private function _getValue( $arr, $field = 1 ) {\n\t\t$data\t= explode( ':', $arr );\n\t\treturn $data[$field];\n\t}", "function get_val($id, $field){\n if($id){\n $q = sql_query(\"SELECT `$field` FROM `entities` WHERE `ID` = '$id'\");\n $r = mysqli_fetch_row($q);\n mysqli_free_result($q);\n return $r[0];\n }\n else{\n return \"\";\n }\n}", "function getvaluebyid($fieldid,$fieldname,$thetable,$theid){\r\n\t$result=\"tradapat\";\r\n\tif($fieldid !==\"\" && $fieldname !==\"\" && $thetable !==\"\" && $theid !==\"\"){\r\n\t\t$qryget=\"select distinct \".$fieldname.\" from \".$thetable.\" where \".$fieldid.\"='\".$theid.\"';\";\r\n\t\t//$qryget=\"select nama from kota where id='\".$theid.\"';\";\r\n\t\t$runitget=mysql_query($qryget);\r\n\t\t$barisget=mysql_fetch_row($runitget);\r\n\t\tif ($barisget){\r\n\t\t\tlist($r1)=$barisget;\r\n\t\t\t$result=$r1;\t\t\t\r\n\t\t\t//$result=\"adakota\";\r\n\t\t}\r\n\t}\r\n\treturn $result;\r\n}", "function getFieldValue($value_id)\r\n\t{\r\n\t\t$q = \"SELECT \".$this->fieldToSelect.\" FROM `\".$this->tableName.\"` WHERE \".$this->tableId.\"='\".$value_id.\"'\";\r\n\t\t$this->db->Execute($q);\r\n\r\n\t\tif($this->db->Affected_rows() > 0)\r\n\t\t{\r\n\t\t\t$field_value = $this->db->GetOne($q);\r\n\t\t\treturn $field_value;\r\n\t\t}else{\r\n\t\t\tdie('<strong>Nama Field yang ada di dalam tanda {} tidak ada di table '.$this->tableName.',<br> sql : '.$this->sql.'</strong>');\r\n\t\t}\r\n\t\treturn '';\r\n\t}", "function news_get_field( $p_news_id, $p_field_name ) {\r\n\t\t$row = news_get_row( $p_news_id );\r\n\t\treturn ( $row[$p_field_name] );\r\n\t}", "public function GetIn($field,$id)\r\n {\r\n $query = mysql_query(\"SELECT * FROM info WHERE id_info = '$id' \");\r\n $row = mysql_fetch_array($query);\r\n if($field == $field)\r\n return $row[$field];\r\n }", "function getField($campo)\n{\n\treturn $this->res2[$campo];\n}", "function getvalue($field, $table, $condition = \"\") {\n\n $q = mysqli_query(\"select $field from $table $condition\") or die(mysql_error());\n $row = mysqli_fetch_array($q);\n return $row[$field];\n}", "public function getField($fieldName) {}", "private function getOptionValue($form_field_list, $field_name, $option_value){\r\n \t\t\r\n \t\tforeach ($form_field_list as $form_row){\r\n \t\t\t\r\n \t\t\tif ($form_row['name'] == $field_name){\r\n \t\t\t\t\r\n \t\t\t\t$options = explode('::', $form_row['options']);\r\n \t\t\t\tarray_unshift($options, 0);\r\n \t\t\t\tunset($options[0]);\r\n \t\t\t\t\r\n \t\t\t\tif (@$options[$option_value])\r\n \t\t\t\t\treturn $options[$option_value];\r\n \t\t\t}\r\n \t\t\t\r\n \t\t} // foreach ($form_field_list as $form_row){\r\n \t\t\r\n \t}", "function getField($id, $table, $field){\n\t$q = mysql_query(\"SELECT `$field` FROM `$table` WHERE `id`='$id'\");\n\t$qd = mysql_fetch_assoc($q);\n\treturn stripslashes($qd[$field]);\n}", "function GetField($arr, $field)\n{\n $result = array();\n for ($i = 0; $i < count($arr); $i ++)\n array_push($result, $arr[$i][$field]);\n return $result;\n}", "function getvalue($field, $table, $condition)\n{\ninclude_once 'config.php';\n\t$q = mysql_query(\"select $field from $table $condition\") or die(mysql_error());\n\t$row = mysql_fetch_assoc($q);\n\treturn $row[$field];\n}", "function getFields();", "public function get_field($table, $fields, $where, $parameters = null) {\n\t\t\n\t\t$sql = 'SELECT ' . $fields . ' FROM ' . $table . ' WHERE ' . $where;\n\t\t\n\t\t$data = $this->query($sql, $parameters)->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\treturn isset($data[0]) ? $data[0] : false;\n\t\t\n\t}", "function get_user_by($field, $value)\n {\n }", "public function get($value, $field='', $field_type='') {\r\n\t \tglobal $wpdb;\r\n\t \t\r\n\t \tif ($field=='')\r\n\t \t\t$field = 'id';\r\n\t \t\t\r\n\t \tif ($field_type=='') // %d\r\n\t \t\t$result = $wpdb->get_row( $wpdb->prepare( \"SELECT * from `$this->table` WHERE `$field` = %d\", $value ) );\r\n\t \telse // %s\r\n\t \t\t$result = $wpdb->get_row( $wpdb->prepare( \"SELECT * from `$this->table` WHERE `$field` = %s\", $value ) );\r\n\t \t\r\n\t \tif ($result==NULL)\r\n\t \t\treturn NULL;\r\n\r\n\t \t// Parse returned fields to strip slashes\r\n\t \t$result = (array) $result;\r\n\t \t$parsed_result = WPPostsRateKeys_Validator::parse_array_output($result);\r\n\t \t$parsed_result = (object) $parsed_result;\r\n\t \t// End: Parse returned fields to strip slashes\r\n\t \t\t\r\n\t \treturn $parsed_result;\r\n\t }", "public function fetchByField($field_name, $field_value) {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t\t->where('t1.'.$field_name.' = :val')\n\t\t\t->setParameter(':val', $field_value)\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "function getField($field){\n\t\t$query = \"SELECT `$field` FROM `mkombo_university`.`staff` WHERE `username`='\".$_SESSION['username'].\"'\";\n\t\tif($query_run = @mysql_query($query)){\n\t\t\tif($query_result = @mysql_result($query_run,0, $field)){\n\t\t\t\treturn $query_result;\n\t\t\t}\n\t\t}\t\t\n\t}", "function GetMultifield($value)\r\n\t{\r\n\t\t$ValsArr = explode(\"|::|\", $value);\r\n\t\t$RetArr = array();\r\n\t\tforeach($ValsArr as $field)\r\n\t\t{\r\n\t\t\tif($field!=\"\")\r\n\t\t\t{\r\n\t\t\t\t$DataField = explode(\"|++|\", $field);\r\n\t\t\t\t$FTitle = $DataField[0]; // field title\r\n\t\t\t\t$FTtype = $DataField[1]; // field type\r\n\t\t\t\t$FValue = $DataField[2]; // field value\r\n\t\t\t\t$FinalVal = $this->GetTrueValue($FValue, $FTtype);\r\n\t\t\t\t$RetArr[''.$FTitle.''] = $FinalVal;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $RetArr;\r\n\t}", "abstract protected function filterFieldvalue();", "function getFieldValueById($table_name=NULL,$condition=NULL,$return_field=\"id\"){\r\n\t\tif(!isset($condition)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where($condition);\r\n\t\t$recordSet = $this->db->get($table_name);\r\n\t\t$data=$recordSet->result() ;\r\n\t\t\r\n\t\tif(count($data)>0){\r\n\t\t\treturn $data[0]->$return_field;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function getFieldValue($fieldSlug, $locale = null);", "public function get_field_value($field)\n\t{\n\t\t//$field = strtoupper($field);\t\t\n\t\tif ($this->is_bound($field))\n\t\t{\n\t\t\treturn $this->get_bound_value($field);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_fields[$field];\n\t\t}\n\t}", "public static function get_data_by($field, $value)\n {\n }", "function getRHUL_LDAP_FieldValue($aField) {\n\n\n if ( is_user_logged_in() ) {\n\n global $wpdb;\n $wp_user = strtoupper(wp_get_current_user()->user_login); // Get currently logged-in Wordpress user\n\n $sql = \"SELECT meta_value FROM cswp_usermeta WHERE meta_key = '\" . $aField . \"' AND user_id = \"\n . \"(SELECT user_id FROM cswp_usermeta WHERE meta_key = 'adi_samaccountname' AND meta_value = '\" . $wp_user . \"');\";\n\n $results = $wpdb->get_results($sql);\n\n\t\treturn $results[0]->meta_value;\n\n } else {\n return \"\"; // Return empty string if field/value not found\n }\n}", "public function getValueByPrimaryKey($fieldName, $primaryValue){\n\t //debug\n LogUtil::sql('(getValueByPrimaryKey) ... primaryValue = ' . $primaryValue);\n\t\t\n\t\t$routerVo = $this->selectByPrimaryKey($primaryValue);\n\t\tif($routerVo){\n\t\t\treturn $routerVo->$fieldName;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "function getvalfield($con,$table,$field,$where)\n{\n\t//$sql = \"select $field from $table where $where\";\n\t//echo $sql; echo \"<br>\";\n\t//$getvalue = mysqli_query($con,$sql);\n\t//$getval = mysqli_fetch_row($getvalue);\n\n\t//return $getval[0];\n\t$stmt = $con->prepare(\"SELECT $field FROM $table WHERE $where\"); \n\t$stmt->execute(); \n\t$row = $stmt->fetch(); \n\tif(empty($row)){\n\t\treturn 0;\n\t}else{\n\t\treturn $row[0];\n\t}\n\t\n}", "public function getField(string $key);", "public function testByFieldValue()\n\t{\n\t\t$container = $this->containerFactory();\n\t\t//Create one entry for unknown user\n\t\t$this->createEntryWithEmail( rand(). 'email.com' );\n\n\t\t//Create two entries for a known user.\n\t\t$email = '[email protected]';\n\t\t$userId = $this->factory()->user->create(\n\t\t\t[ 'user_email' => $email ]\n\t\t);\n\t\twp_set_current_user( $userId );\n\t\t$this->createEntryWithEmail( $email );\n\t\t$this->createEntryWithEmail( $email );\n\n\t\t$results = $container->selectByFieldValue(\n\t\t\t$this->getEmailFieldSlug(),\n\t\t\t$email\n\t\t);\n\t\t$this->assertSame(2, count($results));\n\t\t$this->assertSame( $email,$results[0]['values'][1]->value );\n\t\t$this->assertSame( $email,$results[1]['values'][1]->value );\n\n\t}", "public function fetchFields();", "function getuserInfo($field,$table,$uniquefield,$uniquefieldvalue){\n \t$query=\"SELECT $field FROM $table WHERE $uniquefield='\".$uniquefieldvalue.\"'\";\n \tif ($query_run=mysqli_query($GLOBALS['link'],$query)) {\n \t\tif ($query_result=mysqli_fetch_row($query_run)) {\n \t\t\treturn $query_result[0];\n \t\t}\n \t}\n }", "function getFieldAndValues($params) {\n global $conn;\n\n if (!is_array($params))\n exit('Parâmetro inválido!');\n\n $id = $params['id'];\n $mod = $params['modulo'];\n $pre = $params['pre'];\n $ref = isset($params['ref']) ? $params['ref'] : 'id';\n\n if (empty($id) || empty($mod) || empty($pre))\n exit('Dados inválidos');\n\n\n /*\n *pega lista de colunas\n */\n $sql= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n $fields = array();\n if(!$qry = $conn->query($sql))\n echo $conn->error();\n\n else {\n\n while($fld = $qry->fetch_field())\n array_push($fields, str_replace($pre.'_', null, $fld->name));\n\n $qry->close();\n }\n\n /*\n *pega valores dessas colunas\n */\n $sqlv= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n if(!$qryv = $conn->query($sqlv))\n echo $conn->error();\n\n else {\n $valores = $qryv->fetch_array(MYSQLI_ASSOC);\n $qryv->close();\n }\n\n $res = null;\n foreach ($fields as $i=>$col)\n $res .= \"{$col} = \".$valores[$pre.'_'.$col].\";\\n\";\n\n\n return $res.\"\\n\";\n}", "function get_field($id=false, $field=false) {\n\t\tif(!$id && !$field) return false;\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT wposts.$field FROM $wpdb->posts wposts WHERE wposts.ID=$id\";\n\t\t$results = $this->query($query);\n\t\tif(isset($results[0])) return $results[0]->$field;\n\t}", "function fetch_field($tbl_name, $flds, $where_condition)\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::fetch_field() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$qry = \"select \" . $flds . \" from \" . $tbl_name . \" where 1 = 1 and \" . $where_condition;\n\n\t\t\n\n\t\t$res = $this->execute_sql($qry);\n\n\t\t\n\n\t\t$data = mysql_fetch_array($res[0]);\n\n\t\t\n\n\t\t//$ret_val = $data->$flds;\n\n\t\t$ret_val = $data[0];\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::fetch_field() - Return Value : ', $ret_val);\n\n\n\n\t\treturn $ret_val;\n\n\t\n\n\t}", "function getByID($table,$field,$value);", "function f($field) {\n\t\treturn($this->fetchfield($field));\n\t}", "function get($field)\r\n {\r\n $userID = session::get(\"user\");\r\n \r\n if ($userID)\r\n {\r\n $tempArray = fetch_to_array(database::query(\"SELECT * FROM user,`group` WHERE user.group=group.ID and user.ID='$userID'\"),\"\");\r\n if (is_array($tempArray)) $tempArray = current($tempArray);\r\n\r\n return($tempArray[$field]);\r\n }\r\n else return(FALSE);\r\n }", "function getfield($field){\n\t\t$query = \"SELECT * FROM `users` WHERE Id=\". $_SESSION['user_id'];\t\t\n\n\t\tif ($query_run=mysql_query($query)){\n\t\t\tif($query_result=mysql_result($query_run, 0, $field)){\n\t\t\t\treturn $query_result;\n\t\t\t}\n\t\t}else{\n\t\t\treturn 'Wrong field or query not executed right';\n\t\t}\n\t}", "public function getField($name) { return $this->fields[$name]; }", "public function getListFields();", "public function get($field) {\r\n\t\treturn $this -> fields[$field];\r\n\t}", "public function findByField($field, $value = null)\n {\n $table = $this->getDbTable();\n $select = $table->select();\n $result = array();\n\n if (is_array($field)) {\n // Check if $field is an associative array\n if (isset($field[0]) && is_array($value)) {\n // If field and value are arrays, match them up\n foreach ($field as $column) {\n if (isset($value[$column])) {\n $select->where(\"{$column} = ?\", $value[$column]);\n } else {\n $select->where(\"{$column} = ?\", array_shift($value));\n }\n }\n } else {\n // field is an associative array, use the values from the field\n foreach ($field as $column => $value) {\n $select->where(\"{$column} = ?\", $value);\n }\n }\n } else {\n $select->where(\"{$field} = ?\", $value);\n }\n\n $rows = $table->fetchAll($select);\n foreach ($rows as $row) {\n $model = $this->loadModel($row, null);\n $result[] = $model;\n }\n\n return $result;\n }", "public function getField($slug);", "function getField($field,$table,$chkfield,$id=0)\n\t{\n\t\t$ret=0;\n\t\tif($field)\n\t\t{\n\t\t\tif($table)\n\t\t\t{\n\t\t\t\t$where=$this->WhereClause($chkfield,$id);\n // $t_field=$this->sqlFormatField($field);\n\t\t\t\tif(strlen($where))\n\t\t\t\t{\n\t\t\t\t\t$sql=\"select $field from $table where $where\";\n\t\t\t\t\t$qt=$this->query($sql);\n\t\t\t\t\tif($qt)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($temp_arr=$this->getRow(MYSQL_ASSOC))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ret=$temp_arr[$field];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function get_field( $field, $query = null ){\r\n\t\tif( $row = $this->get_row( $query ) and isset( $row[$field] ) )\r\n\t\t\treturn $row[$field];\r\n\r\n\t}", "function get_value($field, $table, $where)\n{\n # load ci instance\n $CI = & get_instance();\n $CI->load->database();\n\n $val = '';\n $sql = \"SELECT \" . $field . \" FROM \" . $table . \" WHERE \" . $where;\n $query = $CI->db->query($sql);\n foreach ($query->result_array() as $r) {\n $val = $r[$field];\n }\n return $val;\n}", "function getuserfield($field){\n \t$query=\"SELECT $field FROM users WHERE userID=\".$_SESSION['RCMS_user_id'];\n \tif ($query_run=mysqli_query($GLOBALS['link'],$query)) {\n \t\tif ($query_result=mysqli_fetch_row($query_run)) {\n \t\t\treturn $query_result[0];\n \t\t}\n \t}\n }", "function get_row_data($table,$field_name,$id)\r\n\t{\t\r\n\t\t$sql_query=\"SELECT * FROM $table WHERE `id`='\".$id.\"'\";\r\n\t\t$res_query=hb_mysql_query($sql_query);\r\n\t\t$rows_query=hb_mysql_fetch_array($res_query);\r\n\t\t\r\n\t\t$get_field_name=$rows_query[$field_name];\r\n\t\t\r\n\t\treturn $get_field_name;\r\n\t}", "public function findBy($field, $value, $operator = '=');", "function field() {\n\t/* Note: This function depends on special PHP functions, which cannot be used outside of a function definition. The behavior of the functions is somewhat inconsistent with the behavior of normal functions.\n\t */\n\t$numargs = func_num_args(); // function cannot be used directly as a function parameter\n\t \n\tif ($numargs > 1) {\n\n\t\t/**\n\t\t * Field Assign\n\t\t *\n\t\t */\n\t\t\t \n\t\t$arg_list = func_get_args();\n\t\t \n\t\t$field_name = $arg_list[0];\n\t\t$field_value = $arg_list[1];\n\t\t\t \n\t\t/* I suppose this would work too\n\t\t $field_name = func_get_arg(0);\n\t\t $field_value = func_get_arg(1);\n\t\t*/\n\t\t\n\t\t// debug\t\n\t\t//print \"Assigning value \" \t. $field_value .\" to \". $field_name .\" field<br>\";\n\t\n\t\t$this->fields[$field_name]['value'] = $field_value;\n\t\t \n\t} else {\n\t\n\t/**\n\t * Field Retrieve\n\t *\n\t */\n\t\t\t\n\t$arg_list = func_get_args();\n\n\t$field_name = $arg_list[0];\n\t\t \n\t/* I suppose this would work too\n\t $field_name = func_get_arg(0);\n\t */\n\t \n\treturn $this->value( $field_name );\n\t }\n\t}", "public function findBy($value, $field = 'id')\n {\n return call_user_func_array([$this->modelClass, 'where'], [$field, $value])->first();\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFieldValue($name)\n\t\t{\n\t\t\treturn $this->row[$name];\n\t\t}", "function getRoleField($field){\n\t\t$query = \"SELECT `lec_no` FROM `mkombo_university`.`staff` WHERE `username`='\".$_SESSION['username'].\"'\";\n\t\t$query_run = mysql_query($query);\n\t\t$query_result = mysql_result($query_run,0,'lec_no');\n\t\t\n\t\t$qr = \"SELECT `$field` FROM `mkombo_university`.`lecturer_role` WHERE `lec_no`='\".$query_result.\"'\";\n\t\tif($run = mysql_query($qr)){\n\t\t\tif($result = mysql_result($run,0, $field)){\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "function db_get_field($query)\n{\n\t$args = func_get_args();\n\n\tif ($_result = call_user_func_array('db_query', $args)) {\n\t\n\t\t$result = driver_db_fetch_row($_result);\n\n\t\tdriver_db_free_result($_result);\n\n\t}\n\n\treturn (isset($result) && is_array($result)) ? $result[0] : NULL;\n}", "function lookup($prj_id, $field, $value)\n {\n $backend =& self::_getBackend($prj_id);\n return $backend->lookup($field, $value);\n }", "abstract protected function fetchFields($listId);", "public function getFieldValues()\n {\n if($this->isNewRecord){\n return []; //TODO: LOAD DEFAULT FIELDS OF TYPE\n }\n\n //pull meta values from DB\n $table = self::tablePrefix().'cms_post_field';\n $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\t\t\t\t\tWHERE post_id = :pid\n\t\t\t\t \";\n $cmd = self::getDb()->createCommand($strSql);\n $cmd->bindValue(\":pid\",$this->id,\\PDO::PARAM_STR);\n $arrResults = $cmd->queryAll();\n\n return ArrayHelper::index($arrResults, 'id', 'field_id');\n }", "abstract public function getFieldsSearchable();", "public function getValue($a_field_name)\r\n\t{\r\n\t \tif(array_key_exists($a_field_name,$this->mapping_rules))\r\n\t \t{\r\n\t \t\treturn $this->mapping_rules[$a_field_name]['value'];\r\n\t \t}\r\n\t \treturn '';\r\n\t}", "function getSelectFieldsValues($field_data) {\n \n $model = $this->getModel('comment_answers');\n \n $results = $model->getDataForView($field_data);\n \n foreach($results as $list) {\n $result = null;\n if($field_data == 'post_id') {\n $result_list[] = $list->post_id;\n }\n if($field_data == 'created_date') {\n $result_list[] = $list->created_date;\n }\n if($field_data == 'creator') {\n $result_list[] = $list->creator;\n }\n if($field_data == 'comment_id') {\n $result_list[] = $list->comment_id;\n }\n \n if($field_data == 'published') {\n $result_list[]= $list->published;\n }\n }\n \n //results are all the data from the selected column in the result_list array\n return $result_list;\n }", "function getFieldValue($fieldName){\n\n\t\tif( isset($this->record[$fieldName]) ) return $this->record[$fieldName];\n\t\telse return false;\n\n\t}", "private function get_field_value($value) {\r\n\t if ($value instanceof LazyDBExpressionType) {\r\n\t return $value->getExpression();\r\n\t } else if (is_array ( $value )) {\r\n\t\t\treturn \"'\" . $this->add_slashes( serialize($value) ) . \"'\";\r\n\t\t} else {\r\n\t\t\treturn \"'\" . $this->add_slashes ( $value ) . \"'\";\r\n\t\t}\r\n\t}", "static function findField($collection, $field, $query = array(), $options = array()) {\r\n\t\t$options['fields'] = array($field => 1);\r\n\t\t$result = self::find($collection, $query, $options);\r\n\t\t$array = array();\r\n\t\tforeach ($result as $val) {\r\n\t\t\t$array[] = $val[$field];\r\n\t\t}\r\n\t\treturn $array;\r\n\t}", "public function getField(): string;" ]
[ "0.70037067", "0.6478295", "0.63547355", "0.63513243", "0.63162625", "0.63161474", "0.6311093", "0.6275998", "0.6268827", "0.6263299", "0.62076646", "0.6177865", "0.6177865", "0.6147156", "0.6147156", "0.6147156", "0.6076869", "0.60434717", "0.6013732", "0.60094845", "0.60094845", "0.5972601", "0.5952056", "0.59205955", "0.5915808", "0.58940667", "0.586884", "0.5810918", "0.5806083", "0.5805041", "0.5760704", "0.57500917", "0.57450944", "0.57286483", "0.57152116", "0.5706405", "0.56973815", "0.56838274", "0.5678305", "0.56691253", "0.56666064", "0.5663954", "0.5644806", "0.56430316", "0.5642011", "0.5637016", "0.56315905", "0.56268144", "0.5617336", "0.5612948", "0.55973536", "0.5596681", "0.55750537", "0.5547443", "0.55473346", "0.55407906", "0.5538539", "0.55350935", "0.55313927", "0.55301887", "0.5522402", "0.5522106", "0.5520144", "0.5514087", "0.5511349", "0.5504915", "0.55046606", "0.5499463", "0.5499329", "0.5489552", "0.5477925", "0.54777086", "0.5472277", "0.54650617", "0.54602236", "0.54511565", "0.5446916", "0.5443584", "0.5437171", "0.5432768", "0.541829", "0.5402691", "0.5402691", "0.5402691", "0.5402691", "0.5402691", "0.5402691", "0.54008436", "0.5398505", "0.53983194", "0.539668", "0.53883487", "0.5378042", "0.5374264", "0.53728336", "0.5358818", "0.5357828", "0.5354699", "0.53539747", "0.5353139" ]
0.6048082
17
deleteByPrimaryKey from table router
public function deleteByPrimaryKey($routerId){ try { $sql = "DELETE FROM `router` where `router_id` = :routerId"; $params = array(); $params[] = array(':routerId', $routerId, PDO::PARAM_INT); //debug LogUtil::sql('(deleteByPrimaryKey) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } $stmt->execute(); return true; } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "public function delete($primaryKey = 'id')\n\t{\n\t\t$table = $this->getGateway()->getPrimaryTable();\n\t\t\n\t\t$id \t= $this->id; \n\t\t$where \t= $table->getAdapter()->quoteInto($primaryKey. ' = ?', $id);\n\t\t\n\t\tif ($table->delete($where)) {\n\t\t\t//clean object data\n\t\t\t$this->_data = array();\n\t\t\treturn true; \n\t\t}else {\n\t\t\treturn false; \n\t\t}\n\t}", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function delete($key)\n {\n $this->getTable()->wherePrimary($key)->delete();\n }", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function delete($primaryKey = NULL)\n\t{\n\t\tif (is_null($primaryKey))\n\t\t{\n\t\t\t$primaryKey = $this->getPrimaryKey();\n\t\t}\n\t\t$this->id = $primaryKey;\n\n\t\tCore_Event::notify($this->_modelName . '.onBeforeRedeclaredDelete', $this, array($primaryKey));\n\n\t\t$this->deleteFile();\n\t\t$this->deleteSmallFile();\n\n\t\treturn parent::delete($primaryKey);\n\t}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete($primaryKey = NULL)\r\n\t{\r\n\t\tif (is_null($primaryKey))\r\n\t\t{\r\n\t\t\t$primaryKey = $this->getPrimaryKey();\r\n\t\t}\r\n\t\t$this->id = $primaryKey;\r\n\t\t// first of all, undelete for restoring dependencies\r\n\t\t$this->undelete();\r\n\t\t// delete references objects\r\n\t\t$aValues = $this->getValues();\r\n\t\tforeach ($aValues as $oValue) {\r\n\t\t\t$oValue->delete($oValue->id);\r\n\t\t}\r\n\t\tparent::delete($primaryKey);\r\n\t\treturn $this;\r\n\t}", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getTipoId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'tipoId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getTipoId())\n );\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "public function deleteByPrimaryKeys(stubObject $entity);", "function delete($primary){\n $this->primary=$primary;\n //\n //create the delete\n $update= new delete($this, $primary);\n //\n //Execute the the insert\n $update->query($this->entity->get_parent());\n }", "public abstract function delete();", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n throw new Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()\n ->getDbTable()\n ->delete('id = ' .\n $this->getMapper()\n ->getDbTable()\n ->getAdapter()\n ->quote($this->getId()));\n }", "public function delete($primaryKey, $shardByValue=FALSE) {\n\t\t\tif($this->shardBy && $shardByValue===FALSE)\n\t\t\t\tthrow new SERIA_Exception('Unable to delete this row, since you have not specified the \"'.$this->shardBy.'\" column as parameter two.');\n\t\t\t$sql = 'DELETE FROM '.$this->table.' WHERE `'.$this->primaryKey.'`=:sdbdatakey';\n\t\t\t$res = SERIA_Base::db()->exec($sql, array('sdbdatakey' => $primaryKey));\n\t\t\t$this->_cacheClean();\n\t\t\treturn $res;\n\t\t}", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "public function deleteByPk($primaryKey) {\n $query = $this->db->getQuery(true);\n\n $conditions = array($this->quoteName($this->primaryKeyColumn) . ' = ' . (is_numeric($primaryKey) ? $primaryKey : $this->quote($primaryKey)));\n\n $query->delete($this->quoteName($this->tableName));\n $query->where($conditions);\n\n $this->db->setQuery($query);\n\n return $this->db->execute();\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function delete($table, $id)\n{\n connect()->query(\"DELETE FROM users WHERE id='$id'\");\n}", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}", "function lr_delete($pid) {\n list($ns, $pidn) = explode(':', $pid);\n list($rec, $sort) = explode('.', $pidn);\n $db = lr_connect( );\n $table = lr_make_table($db, $ns);\n $sql = \"DELETE FROM ?n WHERE rec=?i, sort=?i\";\n $db->query($sql, $table, $rec, $sort);\n}", "public function deleteByFilter($routerVo){\n\t\ttry {\n\t\t\t$sql = 'DELETE FROM `router`';\n\t\t\t$isDel = false;\n\t\t\t$condition = array();\n\t\t\t$params = array();\n\t\t\tif (!is_null($routerVo->routerId)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`router_id` = :routerId';\n\t\t\t\t$params[] = array(':routerId', $routerVo->routerId, PDO::PARAM_INT);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->layoutId)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`layout_id` = :layoutId';\n\t\t\t\t$params[] = array(':layoutId', $routerVo->layoutId, PDO::PARAM_INT);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->pkName)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`pk_name` = :pkName';\n\t\t\t\t$params[] = array(':pkName', $routerVo->pkName, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->prefix)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`prefix` = :prefix';\n\t\t\t\t$params[] = array(':prefix', $routerVo->prefix, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->suffix)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`suffix` = :suffix';\n\t\t\t\t$params[] = array(':suffix', $routerVo->suffix, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->alias)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`alias` = :alias';\n\t\t\t\t$params[] = array(':alias', $routerVo->alias, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->aliasBy)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`alias_by` = :aliasBy';\n\t\t\t\t$params[] = array(':aliasBy', $routerVo->aliasBy, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->aliasList)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`alias_list` = :aliasList';\n\t\t\t\t$params[] = array(':aliasList', $routerVo->aliasList, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif (!is_null($routerVo->callback)){\n\t\t\t\t$isDel = true;\n\t\t\t\t$condition[] = '`callback` = :callback';\n\t\t\t\t$params[] = array(':callback', $routerVo->callback, PDO::PARAM_STR);\n\t\t\t}\n\t\t\tif(!$isDel){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sql .= ' WHERE ' . join(' and ', $condition);\n\t\t\t}\n\t\t\n\t\t\t//debug\n\t\t\tLogUtil::sql('(deleteByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\t\t\n\t\t\t$stmt = $this->conn->prepare($sql);\n\t\t\tforeach ($params as $param){\n\t\t\t\t$stmt->bindParam($param[0], $param[1], $param[2]);\n\t\t\t}\n\t\t\t$stmt->execute();\n\t\t\treturn true;\n\t\t}\n\t\tcatch (PDOException $e) {\n\t\t\tthrow $e;\n\t\t}\n\t\treturn null;\n\t}", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n $this->_logger->log('The value for Id cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'id = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getId())\n );\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n $this->_logger->log('The value for Id cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'id = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getId())\n );\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function delete()\n\t{\n\t \tif (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))\n\t \t\tdie(Tools::displayError());\n\n\t\t$this->clearCache();\n\n\t\t/* Database deletion */\n\t\t$result = Db::getInstance()->Execute('DELETE FROM `'.pSQL($this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t\n\t\treturn $result;\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }", "public function delete(): void;", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function delete() {\n // Fail due to double delete\n assert(!$this->hasBeenDeleted);\n\n // Initialize delete record cache, if nonextant\n if (!isset(self::$deleteRecordPreparedStatementCache)) {\n self::$deleteRecordPreparedStatementCache = array();\n }\n \n // Initiate implicit tx, if nonextant explicit tx \n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail due to invalid database connection\n assert(isset(self::$databaseHandle));\n\n // Delete this record and all child records \n $table_name = static::getFullyQualifiedTableName();\n \n try {\n // Fetch prepared statement from cache, if present. Otherwise, create it.\n if (isset(self::$deleteRecordPreparedStatementCache[$table_name])) {\n // Fetch delete query from cache\n $delete_record_stmt = self::$deleteRecordPreparedStatementCache[$table_name];\n } else {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $delete_query = \"DELETE FROM {$fully_qualified_table_name} \"\n . $this->genPrimaryKeyWhereClause();\n\n $delete_record_stmt = self::$databaseHandle->prepare($delete_query);\n self::$deleteRecordPreparedStatementCache[$table_name] = $delete_record_stmt;\n }\n \n // Delete children, schedule assets for deletion\n $this->deleteChildren();\n self::$assetDeletors = array_merge(self::$assetDeletors, $this->getAssets());\n\n // Bind record's 'id' to delete-query\n $this->bindId($delete_record_stmt);\n\n // Remove record\n $delete_record_stmt->execute();\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit transaction\n if ($is_implicit_tx) {\n self::endTx();\n }\n\n // Indicate object's deletion\n $this->hasBeenDeleted = true;\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "protected function deleteRegistry ($modelName, $primaryKey)\n\t{\n\t\treturn parent::execute(\"DELETE FROM {$modelName} WHERE {$primaryKey[0]} = {$primaryKey[1]}\");\n\t}", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "abstract public function deleteById($id);", "public function delete($primaryKey = NULL)\n\t{\n\t\tif (is_null($primaryKey))\n\t\t{\n\t\t\t$primaryKey = $this->getPrimaryKey();\n\t\t}\n\n\t\t$this->id = $primaryKey;\n\n\t\tCore_Event::notify($this->_modelName . '.onBeforeRedeclaredDelete', $this, array($primaryKey));\n\n\t\t$document_id = Shop_Controller::getDocumentId($this->id, $this->getEntityType());\n\n\t\tCore::moduleIsActive('chartaccount')\n\t\t\t&& Chartaccount_Entry_Controller::deleteEntriesByDocumentId($document_id);\n\n\t\t$aShop_Document_Relations = Core_Entity::factory('Shop_Document_Relation')->getAllByDocument_id($document_id);\n\t\tforeach ($aShop_Document_Relations as $oShop_Document_Relation)\n\t\t{\n\t\t\t$oShop_Document_Relation->delete();\n\t\t}\n\n\t\treturn parent::delete($primaryKey);\n\t}", "public function delete(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n return $wpdb->delete($table_name,[$this->getPk()=>$this->getPkValue()]);\n }", "public function DELETE() {\n #\n }", "public abstract function delete($id);", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public abstract function delete(int $id): void;", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function delete()\n {\n return $this->connection->delete($this->grammar->compileDelete($this));\n }", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}", "public function destroy($primaryKey)\n {\n $invenMasuk = InvenMasuk::find($primaryKey);\n\n if (is_null($invenMasuk)) {\n return Response::json(\"not found\",404);\n }\n\n $invenMasuk->isDelete = 1;\n $success=$invenMasuk->save();\n\n if (!$success) {\n return Response::json(\"error deleting\",500);\n }\n return Response::json(\"success\",200);\n\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "function hook_path_delete($path) {\n db_delete('mytable')\n ->condition('pid', $path['pid'])\n ->execute();\n}", "public function deleteRowByPrimaryKey()\n {\n if ($this->getMensajeId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'mensajeId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getMensajeId())\n );\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `tours` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "function delete($rid)\n {\n }", "public function destroy($id)\n {\n //delete specific record\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getCuboId() === null) {\n $this->_logger->log('The value for CuboId cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'cuboId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getCuboId())\n );\n }", "public function delete($primary=NULL)\n {\n $primaryName = $this->primaryName;\n $primary = ($primary) ? $primary : $this->$primaryName;\n $stmt = $this->Adapter->prepare(\"DELETE FROM $this->table WHERE $this->primaryName=:id\");\n return $stmt->execute(['id' => $primary]);\n }", "function delete () {\n\t\t$stm = DB::$pdo->prepare(\"delete from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t}", "public Function deleteAction($table, $key)\r\n\t{\r\n\t\t$bdd = singleton::getInstance();\r\n\t\ttry{\r\n\t\t\t/*TODO : prepare the request for one row delete */\r\n\r\n\t\t\t if ($key == null) {\r\n \tprint( \"id non correspondante! \\n\");\r\n \texit;\r\n }\r\n\r\n\t\t\telse {\r\n\t\t\t\tif($key == intval($key)){\r\n\t\t\t\tprint \"appel deleteAction avec $table, $key \\n\";\r\n\t\t\t\t$sql = \"delete from $table where id = $key\";\r\n \tprint( \"sql: $sql \\n\");\r\n \t$stmt = $bdd ->prepare($sql);\r\n \t$stmt -> execute();\r\n \tprint \"suppression réussie\";\r\n \t$tab = $stmt-> fetchAll(PDO::FETCH_ASSOC);\r\n \tprint json_encode( $tab);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (PDOException $e) {\r\n \t\techo $e->getMessage();\r\n \texit;\r\n\t\t}\r\n\r\n\t}", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "public function deleteById($id);", "protected function delete() {\n\t}" ]
[ "0.6783657", "0.67601335", "0.6634717", "0.65407693", "0.6536913", "0.64822155", "0.63653404", "0.63531494", "0.6335252", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.63145304", "0.6307581", "0.6307581", "0.63071716", "0.6304886", "0.62749606", "0.6255157", "0.6251055", "0.6251055", "0.6226517", "0.62094617", "0.62031406", "0.6184301", "0.61738855", "0.6166496", "0.6162083", "0.61513954", "0.6126035", "0.6116364", "0.61070323", "0.61051816", "0.6099795", "0.60856926", "0.60546213", "0.60545075", "0.60501343", "0.6049452", "0.60353637", "0.60353637", "0.6014756", "0.60130274", "0.6002366", "0.59892994", "0.59883606", "0.59847397", "0.59843075", "0.59825534", "0.5982433", "0.59778666", "0.59759283", "0.59749794", "0.59731877", "0.59671986", "0.59652686", "0.5958874", "0.59529287", "0.5938956", "0.59346133", "0.5934501", "0.5933873", "0.5933873", "0.5933873", "0.5933873", "0.593292", "0.5931281", "0.5930455", "0.5929564", "0.5929456", "0.5926314", "0.591818", "0.59173876", "0.591634", "0.5911778", "0.5909874", "0.5905645", "0.59056437", "0.5903816", "0.59026253", "0.5896034", "0.58899796", "0.5881825", "0.5881825", "0.5881825", "0.5881825", "0.5881825", "0.5881825", "0.58804244" ]
0.702577
0
deleteByFilter from table router
public function deleteByFilter($routerVo){ try { $sql = 'DELETE FROM `router`'; $isDel = false; $condition = array(); $params = array(); if (!is_null($routerVo->routerId)){ $isDel = true; $condition[] = '`router_id` = :routerId'; $params[] = array(':routerId', $routerVo->routerId, PDO::PARAM_INT); } if (!is_null($routerVo->layoutId)){ $isDel = true; $condition[] = '`layout_id` = :layoutId'; $params[] = array(':layoutId', $routerVo->layoutId, PDO::PARAM_INT); } if (!is_null($routerVo->pkName)){ $isDel = true; $condition[] = '`pk_name` = :pkName'; $params[] = array(':pkName', $routerVo->pkName, PDO::PARAM_STR); } if (!is_null($routerVo->prefix)){ $isDel = true; $condition[] = '`prefix` = :prefix'; $params[] = array(':prefix', $routerVo->prefix, PDO::PARAM_STR); } if (!is_null($routerVo->suffix)){ $isDel = true; $condition[] = '`suffix` = :suffix'; $params[] = array(':suffix', $routerVo->suffix, PDO::PARAM_STR); } if (!is_null($routerVo->alias)){ $isDel = true; $condition[] = '`alias` = :alias'; $params[] = array(':alias', $routerVo->alias, PDO::PARAM_STR); } if (!is_null($routerVo->aliasBy)){ $isDel = true; $condition[] = '`alias_by` = :aliasBy'; $params[] = array(':aliasBy', $routerVo->aliasBy, PDO::PARAM_STR); } if (!is_null($routerVo->aliasList)){ $isDel = true; $condition[] = '`alias_list` = :aliasList'; $params[] = array(':aliasList', $routerVo->aliasList, PDO::PARAM_STR); } if (!is_null($routerVo->callback)){ $isDel = true; $condition[] = '`callback` = :callback'; $params[] = array(':callback', $routerVo->callback, PDO::PARAM_STR); } if(!$isDel){ return null; } else{ $sql .= ' WHERE ' . join(' and ', $condition); } //debug LogUtil::sql('(deleteByFilter) '. DataBaseHelper::renderQuery($sql, $params)); $stmt = $this->conn->prepare($sql); foreach ($params as $param){ $stmt->bindParam($param[0], $param[1], $param[2]); } $stmt->execute(); return true; } catch (PDOException $e) { throw $e; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteFilter($id) {\n return parent::delete($id);\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete($where);", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function delete($table);", "public function undeleteAction(){\n\t}", "public function deleteAction() {\n \n }", "public function delete (){\n\n $table = new simple_table_ops();\n $table->set_id_column('timetable_id');\n $table->set_table_name('timetables');\n $table->delete();\n\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_GET['timetable_period_id']}\");\n }", "public function delete($table, array $where);", "public function delete( $table, $where='', $orderBy='', $limit=array(), $shutdown=false );", "public function index_delete(){\n\t\t\n\t\t}", "public function delete($table, array $where = null);", "public function delete(array $filter){\n if (empty($filter))\n return false;\n\n $this->query = \"\";\n $this->args = [];\n\n $this->deleteFrom($this->class::sqlTableName());\n $this->where($filter);\n\n if (count($this->args) <= 0)\n throw new appException(\"You likely don't want to delete the entire table\");\n\n $this->prepareQuery($this->query);\n $this->bindParams($this->args);\n return $this->execAndCloseQuery();\n }", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function eliminarAction()\n {\n $id = (int) $this->getRequest()->getParam(\"id\",0);\n //passo page per quedarnos a la pàgina d'on venim\n $page = (int) $this->getRequest()->getParam(\"page\",0);\n //passo d'on bé per redireccionar després\n $controller = $this->getRequest()->getparam(\"c\",0);\n \n $this->_galeriaDoctrineDao->eliminar($id);\n \n if($controller ==='index'){\n \n $this->_redirect('/admin/index/index/a/2');\n }else{\n $this->_redirect('/admin/galeria/listado/page/'.$page.'/a/1');\n }\n }", "function delete($table, array $conditions);", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function permanentDelete($table,$id,$pageId=''){\n\t\t DB::table($table)\n ->where('id',$id)\n ->delete();\n\t return Redirect::back()->with('message', 'Data Deleted Permanently !!');\n\t}", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function deleteAction() {\n $post_data = $request = $this->getRequest()->getPost();\n\n $mapper = new Application_Model_DistractionMapper();\n $anzDeletedRows = $mapper->delete($post_data['id']);\n\n $this->view->success = ($anzDeletedRows > 0);\n }", "function delete() {\n \tif($this->active_filter->isNew()) {\n \t $this->httpError(HTTP_ERR_NOT_FOUND);\n \t} // if\n \t\n \tif(!$this->active_filter->canEdit($this->logged_user)) {\n \t $this->httpError(HTTP_ERR_FORBIDDEN);\n \t} // if\n \t\n \tif($this->request->isSubmitted()) {\n \t $delete = $this->active_filter->delete();\n \t if($delete && !is_error($delete)) {\n \t flash_success(\"Filter ':name' has been deleted\", array('name' => $this->active_filter->getName()));\n \t } else {\n \t flash_error(\"Failed to delete ':name' filter\", array('name' => $this->active_filter->getName()));\n \t } // if\n \t $this->redirectTo('assignments');\n \t} // if\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "public function deleteAction()\n {\n \n }", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "public function delete($where){\n return parent::delete($this->table,$where);\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public Function deleteAction($table, $key)\r\n\t{\r\n\t\t$bdd = singleton::getInstance();\r\n\t\ttry{\r\n\t\t\t/*TODO : prepare the request for one row delete */\r\n\r\n\t\t\t if ($key == null) {\r\n \tprint( \"id non correspondante! \\n\");\r\n \texit;\r\n }\r\n\r\n\t\t\telse {\r\n\t\t\t\tif($key == intval($key)){\r\n\t\t\t\tprint \"appel deleteAction avec $table, $key \\n\";\r\n\t\t\t\t$sql = \"delete from $table where id = $key\";\r\n \tprint( \"sql: $sql \\n\");\r\n \t$stmt = $bdd ->prepare($sql);\r\n \t$stmt -> execute();\r\n \tprint \"suppression réussie\";\r\n \t$tab = $stmt-> fetchAll(PDO::FETCH_ASSOC);\r\n \tprint json_encode( $tab);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (PDOException $e) {\r\n \t\techo $e->getMessage();\r\n \texit;\r\n\t\t}\r\n\r\n\t}", "function delete($table, $id)\n{\n connect()->query(\"DELETE FROM users WHERE id='$id'\");\n}", "protected function _deleteByFilter($_filter, Tinebase_Controller_Record_Interface $_controller, $_filterModel)\n {\n $filter = $this->_decodeFilter($_filter, $_filterModel, TRUE);\n \n // extend execution time to 30 minutes\n $this->_longRunningRequest(1800);\n\n $_controller->deleteByFilter($filter);\n return array(\n 'status' => 'success'\n );\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function queryDelete($table, $where) : int;", "public function deleteRecords(IFilterable $filter) {\n return $this->_dataHandler->delete($this->_table, $filter->resultFilter());\n }", "public abstract function delete($model, $useTransaction);", "public function delete(){\n //Préparation de la requête\n $sql = \"DELETE FROM atelier WHERE idAtelier = ?\";\n $requete = $this->connectBdd->prepare($sql);\n\n //Execution de la requete\n $requete->execute([$this->getIdAtelier()]);\n\n //Fermeture de la requete\n $requete->closeCursor();// requête delete \n }", "function prepare_remove($id = '', $filter = []){\n $where_sql = $this->create_where($id, $filter);\n $ret_val = \"DELETE FROM {$this->table_name} $where_sql;\";\n return $ret_val;\n }", "public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}", "function DELETEquery($table, $where) {\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->DELETEquery_preProcessAction($table, $where, $this);\n\t\t}\n\t\treturn parent::DELETEquery($table, $where);\n\t}", "public function deleteAction($id)\n{\n $em=$this->getDoctrine()->getManager();\n $Articles_especes=$em->getRepository(Articles_especes::class)->find($id);\n //the remove() method notifies Doctrine that you'd like to remove the given object from the database\n $em->remove($Articles_especes);\n //The flush() method execute the DELETE query.\n $em->flush();\n //redirect our function to the read page to show our table\n return $this->redirectToRoute('articles_afficher');\n\n}", "public function delete(array $where);", "public function deleteBy($criteria, $params = false)\n {\n $query = $this->model->query();\n\n /*== FILTER ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;\n\n if (isset($filter->field))//Where field\n $field = $filter->field;\n }\n\n /*== REQUEST ==*/\n $model = $query->where($field ?? 'id', $criteria)->first();\n $model ? $model->delete() : false;\n }", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "public function removeAction()\n {\n if ( $this->_hasParam('razaoSocialTomador') == false )\n {\n $this->_redirect('clientes/list');\n }\n \t\t$modelo = new Application_Model_Clientes();\n $razaoSocialTomador = $this->_getParam('razaoSocialTomador');\n $modelo->removeByRazaoSocial($razaoSocialTomador);\n\n// $cnte = $modelo->removeByRazaoSocial($razaoSocialTomador);\n\t\t$this->_redirect('clientes/list');\n // action body\n }", "public function DELETE() {\n #\n }", "public function delete($where,$table){\n $this->db->where($where);\n $this->db->delete($table);\n }", "public function delete(){\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function delete($table_name, $where = array())\r\n {\r\n }", "public function delete($table, $conditions, $bind = []);", "public function deleteRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->delete();\n if ($result) echo 'Data Deleted';\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function delete() {\n\n }", "function Eliminar(){\n\t \n\t $this->Model->Eliminar($_GET['id']);\n\t\t\n\t }", "public function deleteAction()\n {\n }", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "public function delete($model);", "protected function deleteAction()\n {\n }", "public function deleteAction()\n {\n $this->deleteParameters = $this->deleteParameters + $this->_deleteExtraParameters;\n\n parent::deleteAction();\n }", "public function delete() {\r\n }", "function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}", "public function delete($idPersonas);", "function index_delete() {\n\t\t$id = $this->delete('id');\n\t\t$this->db->where('id', $id);\n\t\t$delete = $this->db->delete('driver_detail');\n\t\tif ($delete) {\n\t\t\t$this->response(array('status' => 'success'), 201);\n\t\t} else {\n\t\t\t$this->response(array('status' => 'fail', 502));\n\t\t}\n\t}", "public function deleteBy(array $params)\n {\n return $this ->model ->where($params) ->delete();\n }", "function deleteRecord($table,$where) \t{\n\t\t$query = \"DELETE FROM \".$this->tablePrefix .$table.' WHERE '.$where ;\n $res = $this->execute($query);\n\n\t}", "abstract public function deleteRecord($tableName, $where);", "public function deleteAction() {\n\t\t$id = filter_var($this->_request->getParam('id'), FILTER_SANITIZE_NUMBER_INT);\n if ($id){\n return Models_Mapper_Tax::getInstance()->delete($id);\n }\n\t}", "function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }", "public function delete()\n {\n \n }", "public function delete($id){\r\n }", "public function delete()\n {\n \n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "public function DeleteTO(TourOperator $tour_operator){\n $q= $this->db->prepare('DELETE FROM tour_operators WHERE id= :id');\n $q->bindValue(':id', $tour_operator->getId());\n $q->execute();\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }" ]
[ "0.66183454", "0.64114004", "0.64114004", "0.63414955", "0.629065", "0.6254012", "0.6234619", "0.61928946", "0.61919034", "0.61629164", "0.6129641", "0.611936", "0.6107998", "0.61020076", "0.60969555", "0.6046416", "0.6043646", "0.60369265", "0.6016262", "0.5983248", "0.5979364", "0.59616935", "0.5955384", "0.59415436", "0.59414107", "0.59414107", "0.5940693", "0.59389627", "0.59330755", "0.5923706", "0.59116226", "0.5909241", "0.59019387", "0.5900469", "0.58995384", "0.589699", "0.58923525", "0.5889062", "0.58878505", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.5887652", "0.58834887", "0.5879551", "0.58690596", "0.58685756", "0.5861373", "0.5844377", "0.5837343", "0.5832528", "0.58251095", "0.5823452", "0.58212864", "0.58212864", "0.5805952", "0.5803565", "0.58025587", "0.579727", "0.5791111", "0.578948", "0.5788504", "0.57845455", "0.5783927", "0.5772434", "0.57691973", "0.5768747", "0.5766381", "0.5759466", "0.5755419", "0.5746238", "0.57415205", "0.5732356", "0.5731957", "0.57290226", "0.57148814", "0.5711928", "0.57094467", "0.570645", "0.5701991", "0.57007414", "0.5699837", "0.5696454", "0.5692983", "0.56923264", "0.5691854", "0.5689543", "0.5686222", "0.5686148" ]
0.6757574
0
insert cash received detials to the cash_paid_to_suppliers
public function addCashPaid(Request $request){ try { $validator = Validator::make($request->all(), [ 'invoiceNum'=> 'required', 'date'=> 'required', 'cashPaid'=> 'required' ]); if($validator->fails()){ return response()->json(['success'=>false,'error'=>$validator->errors(),'code'=>401]); } $input = $request->all(); $user = cash_paid_to_supplier::create($input); return response()->json(['success'=>true,'error'=>$validator->errors(),'code'=>200,'data'=>$user], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cashTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost, $mrid)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //59 Prompt Given Discounts\n if (!empty($data['discount'])) :\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //7501 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n\n\n //customer payment ledger\n $generals_data = array(\n 'form_id' => '7',\n 'customer_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'mainInvoiceId' => $generals_id,\n 'voucher_no' => $this->input->post('voucherid'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'credit' => $this->input->post('netTotal'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'created_at' => $this->timestamp\n );\n $generalPaymentId = $this->Common_model->insert_data('generals', $generals_data);\n //1301 Cash in Hand head debit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '54',\n 'debit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //58 Account Receivable head credit\n $singleLedger = array(\n 'generals_id' => $generalPaymentId,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'credit' => $this->input->post('netTotal'),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //client vendor ledger\n $customerLedger1 = array(\n 'ledger_type' => 1,\n 'trans_type' => 'Sales Payment',\n 'history_id' => $generalPaymentId,\n 'trans_type' => $this->input->post('voucherid'),\n 'client_vendor_id' => $this->input->post('customer_id'),\n 'dist_id' => $this->dist_id,\n 'updated_by' => $this->admin_id,\n 'amount' => $this->input->post('netTotal'),\n 'cr' => $this->input->post('netTotal'),\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate')))\n );\n $this->db->insert('client_vendor_ledger', $customerLedger1);\n //money Receite General\n $moneyReceit = array(\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'invoiceID' => json_encode($this->input->post('voucherid')),\n 'totalPayment' => $this->input->post('netTotal'),\n 'receitID' => $mrid,\n 'mainInvoiceId' => $generals_id,\n 'dist_id' => $this->dist_id,\n 'customerid' => $this->input->post('customer_id'),\n 'narration' => $this->input->post('narration'),\n 'updated_by' => $this->admin_id,\n 'paymentType' => 1\n );\n $this->db->insert('moneyreceit', $moneyReceit);\n }", "function creditTransactionInsert($generals_id, $data, $totalProductCost, $otherProductCost, $newCylinderProductCost)\n {\n //58 account receiable head debit\n\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '58',\n 'debit' => $this->input->post('netTotal'), //sales - discount= grand + vat =newNettotal\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n\n\n //59 Prompt Given Discounts\n if (!empty($data['discount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '59',\n 'debit' => $data['discount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //49 Sales head credit\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '49',\n 'credit' => array_sum($this->input->post('price')),\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n //60 Sales tax/vat head credit\n if (!empty($data['vatAmount'])):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '60',\n 'credit' => $data['vatAmount'],\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //62 Cost of Goods-Retail head debit\n if (!empty($totalProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '62',\n 'debit' => $totalProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //52 account Inventory head credit\n if (!empty($otherProductCost)):\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '52',\n 'credit' => $otherProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n endif;\n //cylinder product stock.\n if (!empty($newCylinderProductCost)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '173',\n 'credit' => $newCylinderProductCost,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n //loader account head credit\n //transportation account head credit\n //loader and transportation account receiaveable head debit against credit\n\n $loaderAmount = $this->input->post('loaderAmount');\n $transportationAmount = $this->input->post('transportationAmount');\n if (!empty($loaderAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '391',\n 'credit' => $loaderAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n if (!empty($transportationAmount)) {\n $singleLedger = array(\n 'generals_id' => $generals_id,\n 'date' => date('Y-m-d', strtotime($this->input->post('saleDate'))),\n 'form_id' => '5',\n 'dist_id' => $this->dist_id,\n 'account' => '392',\n 'credit' => $transportationAmount,\n 'updated_by' => $this->admin_id,\n );\n $this->db->insert('generalledger', $singleLedger);\n }\n }", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function appr_paid($paid_id) {\n\n\t\t$sql = $this->query(\"SELECT * FROM `app_order` WHERE `id` = '$paid_id'\");\n\n\twhile($fetch = mysql_fetch_array($sql)) {\n\n\n\t\t\t\t$pro_id \t\t\t= $fetch['pro_id'];\n\t\t\t \t$pro_count \t\t\t= $fetch['count'];\n\t\t\t\t$pro_name \t\t\t= $fetch['name'];\n\t\t\t\t$pro_email \t\t\t= $fetch['email'];\n\t\t\t\t$pro_address \t\t= $fetch['address'];\n\t\t\t\t$pro_mobile \t\t= $fetch['mobile'];\n\t\t\t\t$pro_total \t\t\t= $fetch['total'];\n}\n\t\t\t$transfer_data_part_2_array = array($pro_id,$pro_count,$pro_name,$pro_email,$pro_address,$pro_mobile,$pro_total);\n\t\t\t\n\t\t\t\n\t\t\t$this->transfer_data_part_2($transfer_data_part_2_array);\n\n\t\t\t//After Sending them in a function via array........... The next programme delete the Item by using `id`\n\n\t\t\t$this->query(\"DELETE FROM `my_cart`.`app_order` WHERE `app_order`.`id` = '$paid_id'\");\n\n// Add into Main Balance............STARTS\n\t\t\t$balance_sql = $this->query(\"SELECT `total` FROM `balance`\");\n\t\t\t\n\t\t\t$balance_sql_fetch = mysql_fetch_array($balance_sql);\n\t\t\t$main_balance = $balance_sql_fetch['total'];\n\t\t\t$add_total = $main_balance + (int)$pro_total;\n\n\t\t\t$this->query(\"UPDATE `my_cart`.`balance` SET `total` = '$add_total' WHERE `id` = '1'\");\n\n// Add into Main Balance............ENDS\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. STARTS\n\n\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. ENDS\n\t}", "public function assigncredits(Varien_Event_Observer $observer)\n{\n $customer = $observer->getCustomer();\n$arr = array();\n$arr1 = array();\n //Mage::log($customer->getEmail());\n //Mage::log($customer->getId().\"customer id\");\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); //current data\n$collection = Mage::getModel('kartparadigm_storecredit/sendcreditstofriend')->getCollection()->addFieldToFilter('receiver_email',$customer->getEmail())->addFieldToFilter('status',0); //retriving values from sendcreditstofriend\n//Mage::log(count($collection));\n$arr = array();\nif(count($collection) > 0){\nforeach($collection as $col){\n//Mage::log($col['s_id'].\"sender id\");\nif($col['status'] == 0){\n\n$arr1['c_id'] = $customer->getId();\n $arr1['website1'] = \"Main Website\";\n $arr1['action_credits'] = $col['credits'];\n $arr1['total_credits'] = $col['credits'];\n $arr1['action'] = \"Updated\";\n $arr1['state'] = 0;\n $arr1['store_view'] = Mage::app()->getStore()->getName();\n $arr1['action_date'] = $nowdate;\n $arr1['custom_msg'] = \"Send By : \" . $col['sname'].\" Message( \".$col['message'].\" )\";\n $arr1['customer_notification_status'] = 'No';\n\n$arr['status'] = 1;\n\n$id = $col['receiver_id'];\n\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr1);\n\n$table2 = Mage::getModel('kartparadigm_storecredit/sendcreditstofriend')->load($id)->addData($arr);\n\n/*-------------------------------------------------------------------------------------*/\ntry{\n\n$table1->save();\n$table2->setId($id)->save();\n//$this->_redirect('*/*/');\n\n}catch(Exception $e){\nMage::log($e);\n}\n\n\n\n}//end if\n}//end foreach \n}//end if\n}", "public function debitOrder(Varien_Event_Observer $observer)\n{ \n\n try {\n $arr = array(); \n$id = Mage::getModel(\"sales/order\")->getCollection()->getLastItem()->getIncrementId();\n\n$order = Mage::getModel('sales/order')->loadByIncrementId($id);\n$_grand = $order->getGrandTotal();\n$custname = $order->getCustomerName();\n//echo \"<br> cumstomer id :\".$order->getCustomerId();\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n$amt =Mage::getSingleton('checkout/session')->getDiscount();\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n$balance = Mage::getSingleton('core/session')->getBalance();\n$arr['c_id'] = $order->getCustomerId();\n$arr['action_credits'] = - $amt;\n$arr['total_credits'] = $balance;\n$arr['store_view'] = Mage::app()->getStore()->getName();\n$arr['state'] = 1;\n$arr['order_id'] = $id;\n$arr['action'] = \"Used\";\n$arr['custom_msg'] = \"By User:Using For Order \" . $arr['order_id'];\n$arr['customer_notification_status'] = 'Notified';\n$arr['action_date'] = $nowdate;\n$arr['website1'] = \"Main Website\";\n \n if($amt > 0) {\n $credits = Mage::getModel('kartparadigm_storecredit/creditinfo');\n\n $model = Mage::getModel('kartparadigm_storecredit/creditinfo')->setData($arr);\n\ntry{\n\n $model->save();\n}\ncatch(Exception $e)\n {\n\n echo $e->getMessage();\n }\n\n $successMessage = Mage::helper('kartparadigm_storecredit')->__('Credits Inserted Successfully');\n Mage::getSingleton('core/session')->addSuccess($successMessage);\n\n \n \n }else{\n //throw new Exception(\"Insufficient Data provided\");\n }\n\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirectUrl($this->_getRefererUrl());\n } \n\nMage::getSingleton('checkout/session')->unsCredits();\n Mage::getSingleton('core/session')->unsBalance();\n Mage::getSingleton('core/session')->unsCredits();\nMage::getSingleton('adminhtml/session')->unsValue();\nMage::getSingleton('checkout/session')->unsDiscount();\n \n}", "public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }", "protected function updateCash()\n\t{\n\t\tforeach($this->amount as $line => $amount)\n\t\t{\n\t\t\tif(isset($this->maxFare[$line]) && $this->maxFare[$line])\n\t\t\t{\n\t\t\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t\t\t$mcoCashNew = $mcoCash->createRow();\n\t\t\t\t$mcoCashNew->mco_id = $this->mcoId;\n\t\t\t\t$mcoCashNew->line = $line;\n\t\t\t\t$mcoCashNew->type = 'DNH';\n\t\t\t\t$mcoCashNew->amount = ($amount - $this->amountCash[$line]);\n\t\t\t\t$mcoCashNew->value = $this->maxFare[$line];\n\t\t\t\t$mcoCashNew->diff = 0;\n\t\t\t\t$mcoCashNew->save();\n\t\t\t}\n\t\t}\t\n\t}", "public function purchase_complete()\n {\n $purchase = $this->MPurchase_master->get_by_purchase_no($this->input->post('purchase_no'));\n $purchase_no = trim($this->input->post('purchase_no'));\n $this->MPurchase_master->update($purchase[0]['id']);\n\n /** Check if previous journal exist then Remove journal details else make new journal master */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $journal_no = $journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($journal_no);\n }\n else\n {\n $journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_purchase($journal_no, $purchase_no);\n }\n\n $settings = $this->MSettings->get_by_company_id($this->session->userdata('user_company'));\n\n /** Determine Credit or Cash Purchase and make journal */\n $total_purchase = $this->MPurchase_details->get_total_price($purchase_no);\n $total_paid = $this->input->post('paid_amount');\n $dues = (float)$total_purchase - (float)$total_paid;\n if ($dues == 0)\n {\n $this->MAc_journal_details->create_by_inventory($journal_no, $settings['ac_cash'], NULL, $total_purchase);\n $this->MAc_journal_details->create_by_inventory($journal_no, $settings['ac_inventory'], $total_purchase);\n }\n else\n {\n $supplier = $this->MSuppliers->get_by_id($this->input->post('supplier_id'));\n $this->MAc_journal_details->create_by_inventory($journal_no, $supplier['ac_id'], NULL, $dues);\n if ((float)$total_paid != 0)\n {\n $this->MAc_journal_details->create_by_inventory($journal_no, $settings['ac_cash'], NULL, $total_paid);\n }\n $this->MAc_journal_details->create_by_inventory($journal_no, $settings['ac_inventory'], $total_purchase);\n }\n\n /** Auto Payment Receipt if partial or full cash paid */\n if ((float)$total_paid != 0)\n {\n $payment = $this->MAc_payment_receipts->get_latest();\n if (count($payment) > 0)\n {\n $payment_no = (int)$payment['payment_no'] + 1;\n }\n else\n {\n $payment_no = 1001;\n }\n $this->MAc_payment_receipts->create_by_purchase($payment_no, $total_paid, $purchase_no);\n }\n\n echo 'inventory/purchase-list';\n }", "function add_payment_pr($data){\n\t\tif($this->check_money($data['Clientpayment']['amount'])){\n\t\t\t\t$this->do_pr_invoice($data);\n\t\t}\n\t}", "public function insert_receive_order($received_order_info,$order_id)\r\n\t{\r\n\t\tif($received_order_info['order_receive_date'] != '')\r\n\t\t{\r\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\r\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\r\n\t\t}\r\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\r\n\t\t$quantities = array();\r\n\t\t$quantity = 0;\r\n\t\t//$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 0 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\r\n\t\t// \torder_sup_send\r\n$this->db->query(\"UPDATE oc_po_order SET order_sup_send = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 0 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\r\n\r\n\t\t//if pre selected supplier\r\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\r\n\t\t{\r\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\r\n\t\t\t{\r\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\r\n\t\t\t{\r\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$prices = array_values($prices);\r\n\t\t\t$received_quantities = array_values($received_quantities);\r\n\t\t\t\r\n\t\t\tfor($i =0; $i<count($prices); $i++)\r\n\t\t\t{\r\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\r\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\r\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\r\n\t\t\t\r\n\t\t\tif(count($query->rows) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\r\n\t\t\t{\r\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\r\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\r\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\r\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\r\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\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\tunset($received_order_info['received_quantities'][$k]);\r\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\r\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\r\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\r\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\r\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$quantities[$j] = $quantity;\r\n\t\t\t\t$quantity = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$bool = false;\r\n\t\tfor($i=0; $i<count($quantities); $i++)\r\n\t\t{\r\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT product_id FROM oc_po_product WHERE id = \" . $received_order_info['received_product_ids'][$i]);\r\n\t\t\t$product_ids[$i] = $query->row;\r\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET received_products = \" . $quantities[$i] . \" WHERE id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\r\n\t\t}\r\n\t\tfor($i=0; $i<count($product_ids); $i++)\r\n\t\t{\r\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product WHERE product_id = \" . $product_ids[$i]['product_id']);\r\n\t\t\t$quantity = $query->row['quantity'] + $quantities[$i];\r\n\t\t\t$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\r\n\t\t\tif($query && $query1)\r\n\t\t\t\t$bool = true;\r\n\t\t}\r\n\t\tif($bool)\r\n\t\t\treturn true;\r\n\t}", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "function makeReceipt($money, $source_id, $destin_id, $payment_type, $pdo){\n\t\t\n\t\t/**********NOTIFY SYSTEM***********/\n\t\t//Notify shipment service\n\t\tif($payment_type==0) {\n\t\t\t//Send notification that shipping fee has been payed and process tracking number\n\t\t\t\n\t\t}\n\t\t//Notify advertising\n\t\telseif($payment_type==1) {\n\t\t\t//Send notification of the payment completed start advertising product\n\t\t\t\n\t\t}\n\t\t//Notify auction entrance\n\t\telseif($payment_type==2 || $payment_type==4) {\n\t\t\t//Send notification that entrance payment has been made and user can start bidding\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t/**********GENERATE RECEIPT(INSERT INTO DATABASE TABLE)**********/\n\t\tif($payment_type==0) {\n\t\t\t//fetch information from database tables\n\t\t\t //fetch buyer name from customer table\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$source_id]);\n\t\t\t\t$buyer = $stmt->fetchAll();\n\t\t\t //fecth item name, price, quantity and seller's user_id\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT item_name, price, quantity, user_id from items where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$item = $stmt->fetchAll();\n\t\t\t //from above seller user_id fetch seller_name\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$item[0][\"user_id\"]]);\n\t\t\t\t$seller = $stmt->fetchAll();\n\t\t\t //fetch shipment fee, tracking number and arrival date from shpping\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT shipping_price, tracking_number, arrival_date from shipping where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$ship = $stmt->fetchAll();\n\t\t\t//insert values into database table of buyer_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO buyer_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\tseller_name, seller_address, user_id, buyer_name, buyer_address, \n\t\t\t\t\t\t\t\t\tshipment_arrival, tracking_number, shipment_fee, total_price) \n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address', \n\t\t\t\t\t\t\t\t\t:tracking_number, :shipment_fee, :total_price)\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$source_id,\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\",\"tracking_number\"=>$ship[0][\"tracking_number\"],\n\t\t\t\t\t\t\t\t\"shipment_fee\"=>$ship[0][\"shipping_price\"],\"total_price\"=>$money]);\n\t\t\t//insert values into database table of seller_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO seller_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\ttime_of_purchase, seller_name, seller_address, user_id, buyer_name, buyer_address)\n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,null,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address')\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$item[0][\"user_id\"],\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\"]);\n\t\t}\n\t\t\n\t\t\n\t}", "public function insert_receive_order($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receive-stock-\".date('Y-m-d').\".log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t$this->db->query(\"UPDATE oc_stock_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t$log->write(\"update order info done\");\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\t\t\t$log->write('in if');\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_stock_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_stock_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_stock_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$log->write('in else');\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_stock_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_stock_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_stock_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_stock_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT product_id FROM oc_stock_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_stock_product SET received_products = \" . $quantities[$i] . \" WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$this->user->getStoreId().\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$this->user->getStoreId().\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\n\t\t\t$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$this->user->getStoreId().\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$this->user->getStoreId().\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\ttry{\n $this->load->library('trans');\n $trans=new trans($this->registry);\n $trans->addproducttrans($this->user->getStoreId(),$product_ids[$i]['product_id'],$quantity,$order_id,'CR','STOCK REC');\n } catch (Exception $ex) {\n $log->write($ex->getMessage());\n }\n \n\t\t\t$log->write(\"no product\");\n\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$this->user->getStoreId().\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$this->user->getStoreId().\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\t\n\t\t\tif($query && $query1 && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$this->user->getStoreId().\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$this->user->getStoreId().\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\t\t\tif($query && $query1 && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\t\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t//$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t//$log->write($sql);\n\t\t\t\t//$this->db->query($sql); \n\t\t\t\t try{ \n $this->load->library('trans');\n $trans=new trans($this->registry);\n $trans->addstoretrans($totalamount,$this->user->getStoreId(),$this->user->getId(),'CR',$order_id,'SR',$totalamount); \n \n } catch (Exception $e){\n $log->write($e->getMessage());\n }\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "private function sellTrasactionAddsMoney(){\n\n }", "public function insert_receive_order($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET received_products = \" . $quantities[$i] . \" WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "public function storePurchaseInLedger($p)\n {\n \n $p_account = AccountTransition::create([\n 'sub_account_id' => $this->purchase_account,\n 'transition_date' => $p->invoice_date,\n 'purchase_id' => $p->id,\n 'supplier_id' => $p->supplier_id,\n 'vochur_no' => $p->invoice_no,\n 'description' => '',\n 'is_cashbook' => 0,\n 'status' => 'purchase',\n 'debit' => (int)$p->pay_amount+ (int)$p->balance_amount,\n 'created_by' => Auth::user()->id,\n 'updated_by' => Auth::user()->id,\n ]);\n if ($p->payment_type == 'cash' || ($p->payment_type == 'credit' && $p->pay_amount != 0)) {\n $p_type = $p_account->replicate()->fill([\n 'sub_account_id' => $p->payment_type == 'cash' ? $this->cash_purchase : $this->purchase_advance,\n // 'credit' => $p->payment_type == 'cash' ? $p->pay_amount:(int)$p->pay_amount+ (int)$p->balance_amount,\n 'credit' => $p->pay_amount,\n 'status' => 'purchase',\n 'debit' => null,\n ]);\n $p_type->save();\n }\n }", "public function pay_credit() {\r\n //var_dump($_POST);\r\n $agent_id = $this->input->post('hddn_agent_id');\r\n $amount = (float)$this->input->post('txt_amount_paid');\r\n $cheque_no = $this->input->post('txt_cheque_no');\r\n \r\n //retrieve purchases\r\n $fields = array(\r\n 'id AS purchase_id','total_paid',\r\n 'ROUND((total_amount-(total_amount*discount/100))-total_paid,2)AS purchase_credit'\r\n );\r\n $criteria = \"agent_id = '{$agent_id}' AND purchase_status = 'completed' AND ROUND(total_amount-(total_amount*discount/100),2) > total_paid\";\r\n $order_by = \"id ASC\";\r\n $purchases = $this->purchase_model->get_purchases($fields,$criteria,'','',$order_by);\r\n //var_dump($purchases);\r\n \r\n //prepare data sets\r\n $data_set_agent = array(\r\n 'credit_amount' => (float)$this->input->post('hddn_credit_amount') - $amount\r\n );\r\n $data_set_financial = array(\r\n 'trans_category' => 'credit',\r\n 'description' => \"Pay credit : \" . $this->input->post('hddn_agent_name'),\r\n 'amount' => $amount,\r\n 'creditor_debtor_id' => $agent_id,\r\n 'income' => FALSE,\r\n 'date_made' => get_cur_date_time(),\r\n 'user_made' => $this->session->userdata('user_id'),\r\n );\r\n if($cheque_no !='') {\r\n $data_set_financial['cheque_no'] = $cheque_no;\r\n $data_set_financial['trans_status'] = 'pending';\r\n }\r\n $data_set_purchases = array();\r\n $data_set_payments = array();\r\n //process purchases\r\n $i = 0;\r\n while($i < count($purchases) && $amount > 0.00) {\r\n $purchase_credit = $purchases[$i]['purchase_credit'];\r\n $amount_paid = 0.00;\r\n if($purchase_credit > $amount) {\r\n $amount_paid = $amount;\r\n $amount = 0.00;\r\n } else {\r\n $amount_paid = $purchase_credit;\r\n $amount -= $amount_paid;\r\n }\r\n array_push($data_set_purchases,array(\r\n 'id' => $purchases[$i]['purchase_id'],\r\n 'total_paid' => $purchases[$i]['total_paid'] + $amount_paid\r\n ));\r\n array_push($data_set_payments,array(\r\n 'trans_id' => null,\r\n 'sales_purchase_id' => $purchases[$i]['purchase_id'],\r\n 'amount' => $amount_paid\r\n ));\r\n $i++;\r\n }//while\r\n //var_dump($data_set_agent);var_dump($data_set_financial);\r\n //var_dump($data_set_purchases);var_dump($data_set_payments);\r\n \r\n $this->db->trans_start();\r\n //insert financial\r\n $trans_id = $this->financial_model->add_transaction($data_set_financial);\r\n \r\n //insert trans id in to payments\r\n for($i = 0; $i < count($data_set_payments); $i++) {\r\n $data_set_payments[$i]['trans_id'] = $trans_id ;\r\n }\r\n //insert payments\r\n $this->payment_model->add_payments($data_set_payments);\r\n \r\n //update purchases\r\n $criteria = 'id';\r\n $this->purchase_model->update_purchases($data_set_purchases,$criteria);\r\n \r\n //update agent\r\n $criteria = array('id' => $agent_id);\r\n $this->agent_model->update_agent($data_set_agent,$criteria);\r\n \r\n $this->db->trans_complete();\r\n \r\n $query_status = $this->db->trans_status();\r\n if($query_status) {\r\n\r\n //insert system log entry\r\n $description = \"Pay credit:\" . $this->input->post('hddn_agent_name');\r\n $this->application->write_log('financial', $description);\r\n \r\n //prepare notifications\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'success',\r\n 'notification_description' => \"The credit is added successfully.\"\r\n );\r\n\r\n } else {\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'error',\r\n 'notification_description' => 'Error terminated adding the credit.'\r\n );\r\n }\r\n $this->session->set_flashdata($notification);\r\n redirect('financial/creditors_debtors');\r\n \r\n }", "private function addPaymentToDatabase()\n {\n $this->setReceiptKey();\n \n $this->createDonorEntry();\n $this->createDonationEntry();\n $this->createDonationContentEntry();\n $this->createDonorAddressEntry();\n $this->addDonationToFundraisersTotalRaise();\n \n $this->redirect('donations');\n }", "public function insert_receive_order_mo($received_order_info,$order_id)\n\t{\n\t\t\n\t$log=new Log(\"receiveorder.log\");\n\n\t\t$log->write($received_order_info);\n\t\tif($received_order_info['order_receive_date'] != '')\n\t\t{\n\t\t\t$received_order_info['order_receive_date'] = strtotime($received_order_info['order_receive_date']);\n\t\t\t$received_order_info['order_receive_date'] = date('Y-m-d',$received_order_info['order_receive_date']);\n\t\t}\n\t\t$inner_loop_limit = count($received_order_info['received_quantities']);\n\t\t$quantities = array();\n\t\t$quantity = 0;\n\t\t//$this->db->query(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\n\t\t//$log->write(\"UPDATE oc_po_order SET receive_date = '\" .$received_order_info['order_receive_date'].\"', receive_bit = \" . 1 . \", pending_bit = \" . 0 . \" WHERE id = \" . $order_id);\t\t\n\t\t//if pre selected supplier\n\t\tif(count($received_order_info['received_quantities']) != count($received_order_info['suppliers_ids']))\n\t\t{\n\t\t\n\n\t\t\tfor($i =0; $i<count($received_order_info['prices']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['prices'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$prices[$i] = $received_order_info['prices'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$log->write($received_order_info['received_quantities']);\n\t\t\tfor($i =0; $i<count($received_order_info['received_quantities']); $i++)\n\t\t\t{\n\t\t\t\tif($received_order_info['received_quantities'][$i] != \"next product\")\n\t\t\t\t{\n\t\t\t\t\t$received_quantities[$i] = $received_order_info['received_quantities'][$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$prices = array_values($prices);\n\t\t\t$received_quantities = array_values($received_quantities);\n\t\t\n\t\t\t$log->write($prices);\t\t\n\t\t\t$log->write(\"after price\");\n\t\t\t$log->write($received_quantities);\t\t\n\n\n\t\t\tfor($i =0; $i<count($received_quantities); $i++)\n\t\t\t{\n\t\t\t$log->write(\"in for loop\");\n\n\t\t\t\t$log->write(\"UPDATE oc_po_receive_details SET price =\" .$prices[$i]. \", quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$this->db->query(\"UPDATE oc_po_receive_details SET quantity = \".$received_quantities[$i].\" WHERE product_id =\".$received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t\t\t$query = $this->db->query(\"SELECT quantity FROM oc_po_receive_details WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id =\" . $order_id);\n\t\t\t\t$quantities[$i] = $query->row['quantity'];\n\t\t\t$log->write(\"quantity\");\t\n\t\t\t$log->write($quantities[$i]);\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT * FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t\t\t$log->write(\"update order info done select \".$query);\n\t\t\tif(count($query->rows) > 0)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM oc_po_receive_details WHERE order_id=\".$order_id);\n\t\t\t}\n\t\t\n\t\t\tfor($j = 0; $j<count($received_order_info['received_product_ids']); $j++)\n\t\t\t{\n\t\t\t\tfor($k = 0; $k<$inner_loop_limit; $k++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($received_order_info['received_quantities'][$k] != 'next product')\n\t\t\t\t\t{\n\t\t\t\t\t\t//\"INSERT INTO oc_po_receive_details (quantity,price,product_id,supplier_id,order_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['prices'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\")\"\n\t\t\t\t\t\t$this->db->query(\"INSERT INTO oc_po_receive_details (quantity,product_id,supplier_id,order_id,store_id) VALUES(\".$received_order_info['received_quantities'][$k].\",\".$received_order_info['received_product_ids'][$j].\",\".$received_order_info['suppliers_ids'][$k].\",\".$order_id.\",\".$query->rows[$j][\"store_id\"].\")\");\n\t\t\t\t\t\t$quantity = $quantity + $received_order_info['received_quantities'][$k];\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($received_order_info['received_quantities'][$k]);\n\t\t\t\t\t\tunset($received_order_info['suppliers_ids'][$k]);\n\t\t\t\t\t\tunset($received_order_info['prices'][$k]);\n\t\t\t\t\t\t$received_order_info['received_quantities'] = array_values($received_order_info['received_quantities']);\n\t\t\t\t\t\t$received_order_info['suppliers_ids'] = array_values($received_order_info['suppliers_ids']);\n\t\t\t\t\t\t$received_order_info['prices'] = array_values($received_order_info['prices']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$quantities[$j] = $quantity;\n\t\t\t\t$quantity = 0;\n\t\t\t}\n\t\t}\n\t\t$bool = false;\n\t\tfor($i=0; $i<count($quantities); $i++)\n\t\t{\n\t\t\t$query = $this->db->query(\"SELECT DISTINCT( product_id), store_id FROM oc_po_product WHERE product_id = \" . $received_order_info['received_product_ids'][$i]);\n\t\t\t$product_ids[$i] = $query->row;\n\t\t\t$query1 = $this->db->query(\"UPDATE oc_po_product SET item_status = 3 WHERE product_id = \" . $received_order_info['received_product_ids'][$i] . \" AND order_id = \" . $order_id);\n\t\t}\n\t\t\t$totalamount=0;\n\t\tfor($i=0; $i<count($product_ids); $i++)\n\t\t{\n\t\t\t\n\t\t\t$log->write(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query = $this->db->query(\"SELECT quantity FROM \".DB_PREFIX.\"product_to_store WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$quantity = $quantities[$i];//$query->row['quantity'] ;''+\n\t\t\t//$log->write(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t//$query1 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product SET quantity = quantity + \" . $quantity . \" WHERE product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$query2 = $this->db->query(\"UPDATE \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" WHERE store_id=\".$product_ids[$i]['store_id'].\" AND product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t$log->write(\"no product\");\n\t\t\t\t$log->write($query2);\n\t\t\tif($query2->num_rows==0)\n\t\t\t{\t\n\t\t\t\t$log->write(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t$this->db->query(\"insert into \".DB_PREFIX.\"product_to_store SET quantity = quantity + \" . $quantity . \" , store_id=\".$product_ids[$i]['store_id'].\" ,product_id = \" . $product_ids[$i]['product_id']);\n\n\t\t\t}\n\t\t\tif($query && $query2)\n\t\t\t\t{\n\t\t\t\t\t$log->write(\"before credit change in \");\n\t\t\t\t\t$log->write(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t//upadte current credit\n\t\t\t\t\t\t//get product details\n\t\t\t\t\t$queryprd = $this->db->query(\"SELECT * FROM \".DB_PREFIX.\"product_to_store p2s left join \".DB_PREFIX.\"product p on p.product_id =p2s.product_id WHERE store_id=\".$product_ids[$i]['store_id'].\" AND p2s.product_id = \" . $product_ids[$i]['product_id']);\n\t\t\t\t\t$log->write($queryprd);\n\t\t\t\t\t$tax=round($this->tax->getTax($queryprd->row['price'], $queryprd->row['tax_class_id']));\n\t\t\t\t\t$totalamount=$totalamount+($quantity*$queryprd->row['price'])+($quantity*$tax);\n\t\t\t\t\t$log->write($totalamount);\n\n\t\t\t\t}\n\n\t\t\tif($query && $query2)\n\t\t\t\t$bool = true;\n\t\t}\n\t\tif($bool)\n\t\t\t{\n\t\t\t\t//update credit price\n\t\t\t\t$log->write(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\n\t\t\t\t$this->db->query(\"UPDATE \".DB_PREFIX.\"store SET currentcredit = currentcredit + \" . $totalamount . \" WHERE store_id=\".$this->user->getStoreId());\t\n\t\t\t\t//insert store transaction\n\t\t\t\t$sql=\"insert into oc_store_trans set `store_id`='\".$this->user->getStoreId().\"',`amount`='\".$totalamount.\"',`transaction_type`='1',`cr_db`='CR',`user_id`='\".$this->session->data['user_id'].\"' \";\n\t\t\t\t$log->write($sql);\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\tif($bool)\n\t\t\treturn true;\n\t}", "function add_money() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$user_id = $_REQUEST['recharge_user_id'];\n\t\t$user_amount = $_REQUEST['recharge_amount'];\n\t\t$transaction_id = $_REQUEST['transection_id'];\n\t\t$final_amount = $coupon_amount + $user_amount;\n\t\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type = 1;\n\t\t// credit\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_category = 1;\n\t\t// 1-Add moeny, 2-Recharge\n\t\t$w_category = 6;\n\t\t$w_desc = \"Amount Recieved when add money \" . $user_amount . \" with get amount \" . $coupon_amount;\n\t\t$wt_desc = \"Add Money\";\n\t\tif (!empty($user_id) && !empty($user_amount) && !empty($transaction_id)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet = $wallet_amount + $final_amount;\n\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif (!empty($add_money)) {\n\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif ($add_money) {\n\t\t\t\t\t\t$records_coupon = $this -> conn -> get_table_row_byidvalue('offer_coupon', 'coupon_id', $coupon_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$coupon_count = $records_coupon['0']['coupon_limit'];\n\t\t\t\t\t\tif($coupon_count>0){\n\t\t\t\t\t\t\t$data_coupon['coupon_limit'] = $coupon_count - 1;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('offer_coupon', 'coupon_id', $coupon_id, $data_coupon);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$transaction_ids = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' . $transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Add amount successfully\", \"transaction_id\" => $transaction_id, 'add_amount' => $user_amount, 'wallet_amount' => $user_wallet, 'transaction_date' => $current_date);\n\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $user_id, 'recharge_amount' => $user_amount, 'transection_id' => $transection_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function store(Request $request)\n {\n //dd($request->all());\n $this->validate($request,[\n\n 'supplier_id'=>'required',\n 'payment_type'=>'required',\n 'total'=>'required',\n 'payment'=>'required'\n \n ]);\n \n $receivingItems = RecevingTemp::all();\n // dd($receivingItems);\n if(empty($receivingItems->toArray())) {\n notify()->error(\"Please Add some Items to create purchase!\",\"Error\");\n return back();\n }\n \n $receiving = new Receving;\n $receiving->supplier_id = $request->supplier_id;\n $receiving->user_id = Auth::user()->id;\n $receiving->payment_type = $request->payment_type;\n $payment = $receiving->payment = $request->payment;\n $total = $receiving->total = $request->total;\n $dues = $receiving->dues = $total - $payment;\n $receiving->comments = $request->comments;\n\n if ($dues > 0) {\n $receiving->status = 0;\n } else {\n $receiving->status = 1;\n }\n $receiving->save();\n \n $supplier = Supplier::findOrFail($receiving->supplier_id);\n $supplier->prev_balance = $supplier->prev_balance + $dues;\n $supplier->update();\n if ($request->payment > 0) {\n $payment = new RecevingPayment;\n $paid = $payment->payment = $request->payment;\n $payment->dues = $total - $paid;\n $payment->payment_type = $request->payment;\n $payment->comments = $request->comments;\n $payment->receiving_id = $receiving->id;\n $payment->user_id = Auth::user()->id;\n $payment->save();\n }\n \n $receivingItemsData=[];\n foreach ($receivingItems as $value) {\n $receivingItemsData = new RecevingItem;\n $receivingItemsData->receiving_id = $receiving->id;\n $receivingItemsData->product_id = $value->product_id;\n $receivingItemsData->cost_price = $value->cost_price;\n $receivingItemsData->quantity = $value->quantity;\n $receivingItemsData->total_cost = $value->total_cost;\n $receivingItemsData->save();\n //process inventory\n $products = Product::find($value->product_id);\n if ($products->type == 1) {\n $inventories = new Inventory;\n $inventories->product_id = $value->product_id;\n $inventories->user_id = Auth::user()->id;\n $inventories->in_out_qty = -($value->quantity);\n $inventories->remarks = 'PURCHASE' . $receiving->id;\n $inventories->save();\n //process product quantity\n $products->quantity = $products->quantity - $value->quantity;\n $products->save();\n } \n }\n \n //delete all data on SaleTemp model\n RecevingTemp::truncate();\n $itemsreceiving = RecevingItem::where('receiving_id', $receivingItemsData->receiving_id)->get();\n notify()->success(\"You have successfully added Purchases!\",\"Success\");\n return view('receiving.complete')\n ->with('receiving', $receiving)\n ->with('receivingItemsData', $receivingItemsData)\n ->with('receivingItems', $itemsreceiving);\n }", "protected function addDonationToFundraisersTotalRaise()\n {\n $this->fundraiser_profile->addDonation( $this->data['amount'] );\n $this->fundraiser_profile->update();\n }", "public function additionCredit()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `credit`(`idmcr`, `pricecr`, `crdate`, `pricetcr`, `paymentcr`, `crpayment`, `bankdate`, `checkno`, `bankname`)\n VALUES ('$this->idmcr' ,'$this->pricecr' ,'$this->crdate' ,'$this->pricetcr' ,'$this->paymentcr' ,'$this->crpayment'\n ,'$this->bankdate' ,'$this->checkno' ,'$this->bankname')\");\n $result = $sql->execute();\n $idcr = $dbh->lastInsertId();\n return array ($result,$idcr);\n }", "function addVoucher($dr_accounts, $cr_accounts, $auto_voucher,$details=false,$refAccount=null,$narration=null,$on_date=null){\n $drsum=0;\n $crsum=0;\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($dr_accounts[$key]);\n continue;\n }\n $drsum += $val['Amount'];\n }\n \n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) {\n unset($cr_accounts[$key]);\n continue;\n }\n $crsum += $val['Amount'];\n }\n \n\n if($crsum != $drsum OR $crsum == 0) throw $this->exception (\"Debit Amount is not equal to Credit Amount or its Zero\");\n if(count($dr_accounts) > 1 AND count($cr_accounts) > 1) throw $this->exception(\"Many To Many voucher is not supported here, make two entries insted\");\n // throw $this->exception(\" $crsum :: $drsum \");\n\n if($auto_voucher === true){\n $cur_pos=$this->add('Model_Pos');\n $cur_pos->getCurrent();\n $auto_voucher = $cur_pos->getNextVoucherNumber($this->voucher_type);\n }\n \n if($narration===null) $narration = $this->default_narration;\n \n $details_fk=null;\n $has_details=(is_array($details)? true: false);\n \n $ve=$this->add('Model_VoucherEntry');\n \n // throw $this->exception(print_r($dr_accounts));\n\n foreach($dr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n \n $ve['ledger_id']=$key;\n $ve['AmountDR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"DR\";\n $ve['entry_count_in_side'] = count($dr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->save();\n if($details_fk === null) $details_fk=$ve->id;\n $ve->unload();\n }\n foreach($cr_accounts as $key=>$val){\n if($val['Amount']==\"\" or $val['Amount']== null or $val['Amount']==0) continue;\n $ve['ledger_id']=$key;\n $ve['AmountCR']=$val['Amount'];\n $ve['VoucherNo']=$auto_voucher;\n $ve['Narration']=$narration;\n $ve['VoucherType']=$this->voucher_type;\n $ve['RefAccount']=(isset($val['RefAccount'])? $val['RefAccount']: $refAccount);\n // $ve['Rate']=(isset($val['Rate'])? $val['Rate']: \"\");\n // $ve['Qty']=(isset($val['Qty'])? $val['Qty']: \"\");\n $ve['has_details']=$has_details;\n $ve['entry_side']=\"CR\";\n $ve['entry_count_in_side'] = count($cr_accounts);\n if($on_date != null ) $ve['created_at']=$on_date;\n $ve->saveAndUnload();\n }\n if($has_details){\n $vd=$this->add('Model_VoucherDetails');\n foreach($details as $detail){\n $vd['voucher_id']=$details_fk;\n $vd['item_id']=$detail['item_id'];\n $vd['Rate']=$detail['Rate'];\n $vd['Qty']=$detail['Qty'];\n $vd['Amount']=$detail['Amount'];\n $vd->saveAndUnload();\n }\n }\n\n return $auto_voucher;\n \n }", "public function add($data){\r\n if (isset($data['id'])) {\r\n $this->db->where('id', $data['id']);\r\n\t\t\t$this->db->where('school_id', $this->school_id);\r\n $this->db->update('fees_discounts', $data);\r\n } else {\r\n $data['session_id'] = $this->current_session;\r\n\t\t\t$data['school_id'] = $this->school_id;\r\n $this->db->insert('fees_discounts', $data);\r\n return $this->db->insert_id();\r\n }\r\n }", "public function add_suppliers() {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n if ($this->input->post('service_type') == 'customer') {\n $support_email = '';\n $support_no = '';\n $service_level = '';\n $response = '';\n $start_date = '';\n $end_date = '';\n }\n if ($this->input->post('service_type') == 'supplier') {\n $support_email = $this->input->post('support_email');\n $support_no = $this->input->post('support_number');\n $service_level = '';\n $response = '';\n $start_date = '';\n $end_date = '';\n }\n if ($this->input->post('service_type') == 'service') {\n $support_email = $this->input->post('support_email');\n $support_no = $this->input->post('support_number');\n $service_level = $this->input->post('service_level');\n $response = $this->input->post('response');\n if ($this->input->post('contract_start')) {\n $start_date = $this->input->post('contract_start');\n } else {\n $start_date = '';\n }\n if ($this->input->post('contract_end')) {\n $end_date = $this->input->post('contract_end');\n } else {\n $end_date = '';\n }\n }\n\n $supplierdata = array(\n 'supplier_name' => $this->input->post('supplier_name'),\n 'type' => $this->input->post('service_type'),\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'ref_no' => $this->input->post('ref_code'),\n 'support_email' => $support_email,\n 'support_number' => $support_no,\n 'service_level' => $service_level,\n 'response' => $response,\n 'contract_startdate' => $start_date,\n 'contract_enddate' => $end_date,\n 'contract_name' => $this->input->post('contract_name'),\n 'supplier_title' => $this->input->post('contract_title'),\n 'contract_no' => $this->input->post('contract_number'),\n 'contract_email' => $this->input->post('contract_email'),\n 'supplier_address' => $this->input->post('address'),\n 'supplier_city' => $this->input->post('city'),\n 'supplier_state' => $this->input->post('state'),\n 'supplier_postcode' => $this->input->post('postcode'),\n 'active' => 1,\n 'archive' => 1);\n\n $this->db->insert('suppliers', $supplierdata);\n $id = $this->db->insert_id();\n if ($id) {\n return $id;\n } else {\n return FALSE;\n }\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function store(Request $request)\n {\n $validaters = Validator::make($request->all(), [\n 'qty.*' => 'numeric',\n 'discount.*' => 'numeric',\n\n ]);\n if($validaters->fails()){\n return back();\n// ->withErrors($validaters)\n// ->withInput();\n // return redirect('order/create')->withErrors($validator);\n }\n $gr = Goods_return::create(['total'=>'0','rdate'=>Carbon::now(),'party_id'=>$request->input('pid')]);\n // return $so;\n //return $gr;\n $item =$request->input('item');\n $quantity =$request->input('qty');\n $disc =$request->input('discount');\n $i =0;\n $total = 0;\n $j=0;\n $pt = Party::find($request->input('pid'));\n\n foreach($disc as $it ) { $disc[$j] = 1 - ($disc[$j]/100) ; $j++; }\n //return $disc;\n foreach ($item as $it ){\n $stock = Stock::find($it);\n $rate = $stock->rate;\n //updating Quantity in stock\n $stock->quantity = $stock->quantity + $quantity[$i];\n $stock->save();\n // getting total for order\n $total=$total + $rate*$quantity[$i]*$disc[$i];\n // making relation\n $gr->stock()->attach($it, ['quantity' => $quantity[$i],'discount' => ((1-$disc[$i])*100)]);\n $i++;\n }\n $pt->balance = $pt->balance - $total;\n $pt->save();\n $gr->total = $total;\n $gr->save();\n return redirect('/return');\n\n\n\n\n }", "public function addDonation($amount, $card){\r\n $stmt = $this->DB->prepare(\"INSERT INTO transactions VALUES(NULL, 'DONATION', NULL,NULL,NULL,:card,now(),'PROCESSED');\");\r\n $stmt->bindParam(\"card\",$card);\r\n $stmt->execute();\r\n }", "public function addReceipt(array $data)\n {\n foreach ($data['against'] as $userId) {\n if (auth()->user()->id == $userId) {\n continue;\n }\n \n \t$receipt \t\t\t\t= new Receipt;\n\n \t$receipt->name \t = $data['name'];\n \t$receipt->description\t= $data['description'];\n \t$receipt->value \t = $data['value'] / (count($data['against']));\n \t$receipt->issuer_id \t= auth()->user()->id;\n $receipt->user_id \t = $userId;\n \t$receipt->household_id \t= $this->id;\n\n \t$receipt->save();\n }\n }", "public function _create($refid, $invoice, $charges=array(), $payments=array())\n {\n\n return false;\n\n\n if($res = $this->is_billtrac_exists($invoice->InvoiceNumber_EMD))\n {\n //already created\n $this->error(\"billtrac ticket # $res already exists for EMD invoice # \" . $invoice->InvoiceNumber_EMD);\n\n //update so\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::table($this->keytable)->where('emd_invoice_number',$invoice->InvoiceNumber_EMD)->update(array( 'todo'=>'done','ext_key'=>$res));\n }\n\n return false;\n }\n\n /**\n * inserting\n * - summary\n * - carrier\n * - emdId\n * - type\n * - claim\n * - location\n * - mail date\n * - bill amount\n * - ptrac id\n */\n\n\n try{\n\n\n $time = $changetime = time() * 1000000;\n\n DB::connection('billtrac')->getPdo()->beginTransaction();\n\n //create base ticket\n $invoice->Invoice_Comment = trim($invoice->Invoice_Comment);\n\n if(empty($invoice->Invoice_Comment))\n {\n $type = 'new';\n }\n else\n {\n $type = addslashes($invoice->Invoice_Comment);\n }\n\n $dos_first=false;\n $dos = array();\n\n if($cpts = DB::connection('emds')->table('VIEW_API_InvoiceCPT')->where('Invoice_ID', $invoice->Invoice_ID)->get())\n {\n foreach($cpts as $line)\n {\n if(!$dos_first)\n {\n $dos_first = $line->sdos;\n }\n $dos[$line->sdos] = 1;\n }\n $dos = 'DOS: ' . implode(', ', array_keys($dos));\n\n }\n\n $data = array(\n 'type'=>$type,\n 'time'=>$time,\n 'changetime'=>$changetime,\n 'priority'=>'normal',\n 'status'=>'new',\n 'summary'=>addslashes($invoice->PatientName),\n 'reporter'=>'emdimport',\n 'description'=>$dos,\n 'owner'=> $this->assign_ownerbyalpha(strtolower(substr($invoice->PatientName,0,1)))\n );\n\n if($owner = $this->assign_ownerbyinsurance(strtolower($invoice->InsuranceCompName)))\n {\n $data['owner'] = $owner;\n }\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n\n $id = DB::connection('billtrac')->getPdo()->lastInsertId();\n\n $this->info(\"created ticket number $id\");\n\n $emdimage = false;\n\n $respmt = DB::connection('emds')->select(\"select * from VIEW_API_PaymentIndex where Invoice_ID = '\" . $invoice->Invoice_ID . \"'AND (CheckImage <> '0000000000' or EOBImage <> '0000000000')\");\n\n foreach($respmt as $r)\n {\n $emdimage = true;\n }\n\n $importMap = array(\n 'billdate'=>$invoice->InvoiceCreatedAt,\n 'emdstatus'=>$invoice->InvoiceStatus_Code,\n 'maildate'=>$invoice->InvoiceCreatedAt,\n 'dosdate'=>$dos_first,\n 'billamount'=>number_format($invoice->InvoiceTotal,2),\n 'duedate'=>date_create_from_format('m-d-Y', $invoice->InvoiceCreatedAt)->modify('+17 day')->format('m-d-Y'),\n 'paidamount'=>number_format($invoice->PaymentTotal,2),\n 'location'=>$this->translateLocation($invoice->Organization_Name),\n 'carrier'=>addslashes($invoice->InsuranceCompName),\n 'claimnumber'=>$invoice->Case_ClaimNumber,\n 'step'=>'new',\n 'emdinvoicenumber'=>$invoice->InvoiceNumber_EMD,\n 'ptracnumber'=>'EMD:'.$invoice->InvoiceNumber_EMD\n );\n\n if($emdimage)\n {\n $importMap['emdimage'] = 1;\n }\n\n foreach($importMap as $key=>$value)\n {\n $data = array(\n 'ticket'=>$id,\n 'name'=>$key,\n 'value'=>$value\n );\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n DB::connection('billtrac')->table('ticket_custom')->insert( $data );\n }\n else\n {\n $this->info(\"dry insert: \\n\" . print_r($data, true));\n }\n }\n\n DB::connection('billtrac')->getPdo()->commit();\n\n if( \\Config::get('app.emdtobilltrac.db_write'))\n {\n return DB::table($this->keytable)->where('id',$refid)->update(array( 'todo'=>'done', 'ext_key'=>$id));\n }\n else\n {\n return false;\n }\n\n }catch (Exception $e)\n {\n DB::connection('billtrac')->getPdo()->rollBack();\n throw new Exception($e->getMessage());\n }\n }", "function pnh_process_add_credit()\r\n\t{\r\n\t\t$output = array();\r\n\t\t$user=$this->auth(PNH_ADD_CREDIT);\r\n\t\t$fid_list=$this->input->post(\"fid\");\r\n\t\t$new_credit_list=$this->input->post(\"new_credit\");\r\n\t\t$new_credit_reason=$this->input->post(\"new_credit_reason\");\r\n\t\t\r\n\t\t$total_fids = count($fid_list);\r\n\t\t$affected = 0;\r\n\t\tif($total_fids)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tforeach($fid_list as $fid)\r\n\t\t\t{\r\n\t\t\t\t$f=$this->db->query(\"select credit_limit from pnh_m_franchise_info where franchise_id=?\",$fid)->row_array();\r\n\t\t\t\t$inp=array($fid,$new_credit_list[$fid],$new_credit_list[$fid]+$f['credit_limit'],$new_credit_reason[$fid],$user['userid'],$user['userid'],time());\r\n\t\t\t\t$this->db->query(\"insert into pnh_t_credit_info(franchise_id,credit_added,new_credit_limit,reason,credit_given_by,created_by,created_on) values(?,?,?,?,?,?,?)\",$inp);\r\n\t\t\t\t$this->db->query(\"update pnh_m_franchise_info set credit_limit=? where franchise_id=?\",array($new_credit_list[$fid]+$f['credit_limit'],$fid));\r\n\t\t\t\t$affected += $this->db->affected_rows();\r\n\t\t\t}\r\n\t\t}\r\n\t\techo 1;\r\n\t\tdie();\r\n\t}", "public function createChallan($data_order,$order_challan_shipping){\n\t \tif(sizeof($data_order) > 0){\n\t\t // get the challan number\n\t\t\t$firmRow = $this->getFirmRow($order_challan_shipping['firm_id'], 'current_challan');\n\t\t\t$challan_number = $firmRow[0]['firm_code'].'/'.$firmRow[0]['current_year'].'/DC/'.$firmRow[0]['current_challan'];\n\t\t\t// get the Invoiice number\n\t\t\t$firmInvoiceRow = $this->getFirmRow($order_challan_shipping['firm_id'], 'current_invoice');\n\t\t\t$invoice_number = $firmInvoiceRow[0]['firm_code'].'/'.$firmInvoiceRow[0]['current_year'].'/IN/'.$firmInvoiceRow[0]['current_invoice'];\n\t\t\t// update the order id field in firm table\t\t\t\n\t\t\t$data_firm['current_challan'] = $firmRow[0]['current_challan'];\n\t\t\t$data_firm['current_invoice'] = $firmInvoiceRow[0]['current_invoice'];\n\t\t\t$this->db->where(\"firm_id\", $order_challan_shipping['firm_id']);\n\t\t\t$this->db->update(\"company_firms\", $data_firm); \n\t\t \t// add notification\n\t\t\t\t$notificationArray = array();\n\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t$notificationArray['uid'] = $this->session->userdata('userid');\n\t\t\t\t$notificationArray['message_text'] = 'Take follow up of order # '.$challan_number.' For ';\n\t\t\t\t$notificationArray['added_on'] = $today;\n\t\t\t\t$notificationArray['reminder_date'] = date('Y-m-d',strtotime($today.\"+ 8 days\"));\n\t\t\t\t$notificationArray['read_flag'] = 'Pending';\n\t\t\t\t$this->add_notification($notificationArray);\n\t\t\t\t$ntf_id = $this->db->insert_id();\n\t\t\t\n\t\t\t\t \n\t\t\tforeach($data_order as $orderData){\n\t\t\t // echo '<pre>'; print_r($orderData['insert_stock']);\n\t\t\t // insert into order_challan table\n\t\t\t\tforeach($orderData['order_challan'] as $order_challan){\n\t\t\t\t\t$order_challan['challan_no'] = $challan_number; \n\t\t\t\t\t$order_challan['invoice_no'] = $invoice_number; \n\t\t\t\t\t$order_challan['invoice_date'] = $today; \n\t\t\t\t\t$order_challan['invoice_by'] = $this->session->userdata('userid'); \n\t\t\t\t\t$order_challan['notification_id'] = $ntf_id ;\n\t\t\t\t\t$this->db->insert(\"order_challan\", $order_challan); \n\t\t \t\t\t//return $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t// update the dispatch quantity for the order\n\t\t\t\t$this->db->set('dispatch_qty', 'dispatch_qty+'.$orderData['insert_stock']['outw_qty'], FALSE);\n\t\t\t\t$this->db->where(\"order_id\", $orderData['insert_stock']['order_id']); \n\t\t\t\t$this->db->where(\"order_pid\", $orderData['insert_stock']['pid']); \n\t\t\t\t$this->db->where(\"id\", $orderData['insert_stock']['id']); \n\t\t\t\t$this->db->update(\"client_order_prodcts\"); \n\t\t\t\t$this->db->limit(1);\n\t\t\t\t\n\t\t\t\t// insert into product_stock table\t\n\t\t\t\tunset($orderData['insert_stock']['id']); // because in table id is primary key\t\t\t\n\t\t\t\t$orderData['insert_stock']['challan_no'] = $challan_number; \n\t\t\t\t$orderData['insert_stock']['invoice_no'] = $invoice_number; \n\t\t\t\t$this->db->insert(\"product_stock\", $orderData['insert_stock']); \n\t\t\t\t//return $this->db->insert_id();\n\t\t\t\n\t\t\t// check for order status\n\t\t\t//$orderStatus = mysql_query('SELECT (order_qty - `dispatch_qty` ) AS balQty FROM `client_order_prodcts` WHERE `order_id`=\"'.$orderNum.'\" HAVING balQty > 0');\n\t\t\t$this->db->select('sum( `order_qty` ) - sum( `dispatch_qty` ) AS balQty');\n\t\t\t$this->db->from('client_order_prodcts');\n\t\t\t$this->db->where(\"order_id\",$orderData['insert_stock']['order_id']);\t\n\t\t\t$this->db->having(\"balQty > \",'0'); \t\n\t\t\t$query_pending_prods = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_pending_prods->num_rows() == 0){\n\t\t\t\t$order_status['order_status'] = 'Completed';\n\t\t\t\t$this->db->where(\"order_id\", $orderData['insert_stock']['order_id']);\n\t\t\t\t$this->db->update(\"client_orders\", $order_status);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// update shipping address and logistic remark\n\t\t$update_order_remark['challan_no'] = $challan_number; \n\t\t$update_order_remark['shipping_address'] = $order_challan_shipping['shipping_address']; \n\t\t$update_order_remark['logistic_remark'] = $order_challan_shipping['logistic_remark']; \n\t\t$this->db->insert(\"order_challan_shipping\", $update_order_remark);\n\t\t\t\n\t\t\t\n\t\treturn $challan_number;\n\t\t\n\t\t}else{ // EO sizeof($data_order)\n\t\t return 'False';\n\t\t}\n\t\t\n\t }", "function charge_deposit($acc_number,$sum)\n\t{\n\t $this->db->query(\"UPDATE pamm_summaries SET deposit = deposit+$sum WHERE acc_number=$acc_number\");\n\t}", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "private function setDepositFromData()\n {\n if ($this->dataHasDeposit()) {\n $this->collection->items[$this->cart_hash]->deposit = $this->data['deposit'];\n $this->collection->deposit += $this->data['deposit'];\n }\n }", "public function store(Request $request){\n $request->validate([\n 'customer_id' => 'required|numeric',\n 'name' => 'required',\n 'collected_by' => 'required',\n 'posted_by' => 'nullable',\n 'amount' => 'string',\n 'request_type' => 'string',\n 'savings_type' => 'required',\n 'collected_on' => 'required',\n 'description' => '',\n ]);\n\n $is_registered_customer = Customer::where('customer_id', '=', $request->customer_id)->first();\n\n //get his last contribution and see if it is null, a debit or a credit\n $last_contribution = Contribution::where('customer_id', $request->customer_id)->latest('id')->first();\n if($last_contribution == null){\n // It means he is a first timer\n if($request->request_type === 'credit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n $amount = (int)$request->amount;\n $available_balance = $amount - ($amount * 0.033);\n $gain = $amount * 0.033;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $amount,\n 'balance' => $available_balance,\n 'gain' => $gain,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Account credited successfully']);\n }elseif($request->savings_type === 'loan'){\n return back()->with(['status' => 'You have no loan to payback']);\n }else{\n return back()->with(['error' => 'This request is not understood']);\n }\n }elseif($request->request_type === 'debit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n if($last_contribution->balance >= $request->amount){\n $remaining_balance = $last_contribution->balance - (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $remaining_balance,\n 'gain' => 0,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Savings debit successful']);\n\n }else{\n return back()->with(['error' => 'Available balance is less than them amount you want to withdraw']);\n\n }\n }elseif($request->savings_type === 'loan'){\n $loan = (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => 0,\n 'gain' => 0,\n 'loan' => $loan,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success'=> 'Loan debit successful']);\n\n }else{\n //bad request\n return back()->with(['error'=> 'Request not understood']);\n }\n }else{\n //Something is wrong with the request\n return back()->with(['error'=> 'There is an error with this request']);\n }\n\n }else{\n /*\n * When he is no long a first timer\n */\n if($request->request_type === 'credit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n $amount = (int)$request->amount;\n $available_balance = (int)$last_contribution->balance + ($amount - ($amount * 0.033));\n $gain = $amount * 0.033;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $amount,\n 'balance' => $available_balance,\n 'gain' => $gain,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Account credited successfully']);\n\n }elseif($request->savings_type === 'loan'){\n if((int)$last_contribution->loan > 0 and (int)$request->amount <= (int)$last_contribution->loan){\n $loan_balance = $last_contribution->loan - $request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $last_contribution->balance,\n 'gain' => 0,\n 'loan' => $loan_balance,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Loan credited successfully']);\n\n }else{\n return back()->with('error', 'The amount you want to pay back is bigger than the loan');\n\n }\n\n }else{\n //bad request\n return back()->with('error', 'This request is not understood');\n }\n }elseif($request->request_type === 'debit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n if($last_contribution->balance >= $request->amount){\n $remaining_balance = $last_contribution->balance - (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $remaining_balance,\n 'gain' => 0,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Savings debit successful']);\n\n }else{\n return back()->with('error', 'Available balance is less than them amount you want to withdraw');\n }\n }elseif($request->savings_type === 'loan'){\n $loan = (int)$last_contribution->loan + (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $last_contribution->balance,\n 'gain' => 0,\n 'loan' => $loan,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Loan debit successful']);\n\n }else{\n //bad request\n return back()->with('error', 'This request is not understood');\n }\n }else{\n return back()->with('error', 'This request is not understood');\n }\n }\n\n\n\n }", "public function adddiscountAction() {\n $request = $this->getRequest();\n\n if ( $request->isPost() ){\n $post = $request->getPost();\n\n $discountCodeId = $post['discountId'];\n\n if(!is_null($discountCodeId)) {\n\n //create discount object\n try {\n $rabatt = new Yourdelivery_Model_Rabatt_Code(null, $discountCodeId);\n\n $count = 0;\n foreach ($this->company->getEmployees() as $employeer) {\n $t = $employeer;\n\n //create customer object\n try {\n //$customer = new Yourdelivery_Model_Customer(1123);\n\n //add discount to the customer\n if (!$employeer->setDiscount($rabatt)) {\n $this->error(__b(\"Discount code could not associated to customer \") . $customer->getPrename() . ' ' . $customer->getName() . '(#' . $customer->getId());\n }\n\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n $this->error(__b(\"Customer %s %s (#%s) is non-existant\", $customer->getPrename(), $customer->getName(), $customer->getId()));\n }\n \n $count++;\n }\n\n if ($count == 0) {\n $this->success(__b(\"Company doesn't have employees. Discount code could not be associated to anyone\"));\n }\n else {\n $this->success(__b(\"Discount code %s was successfully associated to %s employees\", $rabatt->getName(), $count));\n $this->logger->adminInfo(sprintf(\"Discount code %s (#%d) was assigned to %d employeers of company #%d\",\n $rabatt->getName(), $rabatt->getId(), $count, $this->company->getId()));\n }\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n $this->error(__b(\"This discount code is non-existant\"));\n }\n\n }\n }\n\n return $this->_redirect('/administration_company_edit/assoc/companyid/' . $this->company->getId());\n }", "public function add($receipt){\n\tDatabase::add('SOLD_ITEMS', array($receipt, $this->id,$this->quantity,$this->total));\n\tSales_Item::update($this->id,'SELL',$this->quantity);\n}", "public function additionInvoices()\n {\n\t\t\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `invoice` (`bill`, `idate`, `price`, `discount`, `expenses`, `totalc`, `percent`, `totalm`, `payment`, `note`, `orderid`, `credit`, `creditid`)\n\t\t\t\t\tVALUES('$this->bill', '$this->idate', '$this->price', ' $this->discount', '$this->expenses', '$this->totalc', '$this->percent', '$this->totalm', '$this->payment', '$this->note',\n\t\t\t\t\t'$this->orderid', '$this->credit', '$this->creditd')\");\n $result = $sql->execute();\n $idp = $dbh->lastInsertId();\n return array ($result,$idp);\n }", "public function cashOnDelivery($data){\n $title = $this->fm->validation($data['title']);\n $description = $this->fm->validation($data['description']);\n $instructions = $this->fm->validation($data['instructions']);\n\n $title = mysqli_real_escape_string( $this->db->link, $data['title']);\n $description = mysqli_real_escape_string( $this->db->link, $data['description']);\n $instructions = mysqli_real_escape_string( $this->db->link, $data['instructions']);\n \n if (empty($title || $description || $instructions )) {\n $msg = \"<span class='error'>Size field must not be empty !</span>\";\n return $msg;\n } else {\n $query = \"UPDATE tbl_payment\n SET \n title = '$title',\n description = '$description',\n instructions = '$instructions' \n WHERE id = '3'\"; \n $updated_row = $this->db->update($query);\n\n if ($updated_row) {\n $msg = \"<span class='success'>Cash on delivery info updated.</span>\";\n return $msg;\n } else {\n $msg = \"<span class='error'>Cash on delivery payment info Not Updated !</span>\";\n return $msg;\n } \n }\n }", "public function storecredit() {\n $this->autoLayout = false;\n $this->autoRender = false;\n $status = $_POST['status'];\n if (isset($_POST['cod']) && !empty($_POST['cod']))\n $cod = $_POST['cod'];\n else\n $cod = '';\n\n $this->loadModel('User');\n $this->loadModel('Orders');\n\n global $loguser;\n global $setngs;\n $userid = $loguser[0]['User']['id'];\n\n if (isset($status) && !empty($status)) {\n $userDetails = $this->User->findById($userid);\n $shareData = json_decode($userDetails['User']['share_status'], true);\n $creditPoints = $userDetails['User']['credit_points'];\n $shareNewData = array();\n $orderDetails = $this->Orders->findByorderid($status);\n if (!empty($orderDetails))\n $deiveryType = $orderDetails['Orders']['deliverytype'];\n else\n $deiveryType = '';\n foreach ($shareData as $shareKey => $shareVal) {\n\n if (array_key_exists($status, $shareVal)) {\n\n $shareVal[$status] = '1';\n if ($cod == '') {\n\n if ($shareVal['amount'] != '0') {\n $this->request->data['User']['id'] = $userid;\n $this->request->data['User']['credit_points'] = $creditPoints + $shareVal['amount'];\n $this->User->save($this->request->data['User']);\n } else {\n $shareNewData[] = $shareVal;\n }\n } else {\n\n $shareNewData[] = $shareVal;\n }\n } else {\n\n\n $shareNewData[] = $shareVal;\n }\n } \n $this->request->data['User']['id'] = $userid;\n $this->request->data['User']['share_status'] = json_encode($shareNewData);\n $this->User->save($this->request->data['User']);\n }\n }", "function add_money(){\n\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t$user_id=$_REQUEST['recharge_user_id'];\n\t\t$user_amount=$_REQUEST['recharge_amount'];\n\t\t$final_amount=$coupon_amount+$user_amount;\n\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type=1; // credit\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t$wt_category=1; // 1-Add moeny, 2-Recharge\n\t\t$w_category=6; // Amount Recieved when coupon code apply\n\t\t//$card_no=$_REQUEST['card_number'];\n\t\t//$cvv_no=$_REQUEST['cvv_no'];\n\t\t$w_desc=\"Amount Recieved when add money \".$user_amount .\" with get amount \".$coupon_amount;\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t//$transaction_id =$_POST['recharge_transaction_id']; // if wt_category=1 then payment gateway transaction id and 2 for recharge id;\n\t\t$wt_desc=\"Add Money\"; // description of transaction like as add moeny, recharge;\n\t\tif(!empty($user_id) && !empty($user_amount) && !empty($transaction_id)){\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet=$wallet_amount + $final_amount;\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif(!empty($add_money)){\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif($add_money){\n\t\t\t\t\t\t$transaction_ids= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' .$transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t $data['wallet_amount']=$user_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user','user_id',$user_id, $data);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Add amount successfully\", \"transaction_id\" =>$transaction_id,'add_amount'=>$user_amount,'wallet_amount'=>$user_wallet,'transaction_date'=>$current_date,'card_no'=>$card_no);\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$user_id,'recharge_amount'=>$user_amount,'card_number'=>$card_no,'cvv_no'=>$cvv_no);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function createSampleChallan($data_order,$order_challan_shipping){\n\t \tif(sizeof($data_order) > 0){\n\t\t // get the challan number\n\t\t\t$firmRow = $this->getFirmRow($order_challan_shipping['firm_id'], 'sample_challan');\n\t\t\t$challan_number = $firmRow[0]['firm_code'].'/'.$firmRow[0]['current_year'].'/SMP/'.$firmRow[0]['sample_challan'];\n\t\t\t\n\t\t\t// update the order id field in firm table\t\t\t\n\t\t\t$data_firm['sample_challan'] = $firmRow[0]['sample_challan'];\n\t\t\t$this->db->where(\"firm_id\", $order_challan_shipping['firm_id']);\n\t\t\t$this->db->update(\"company_firms\", $data_firm); \n\t\t\t\n\t\t\t// add notification\n\t\t\t$notificationArray = array();\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$notificationArray['uid'] = $this->session->userdata('userid');\n\t\t\t$notificationArray['message_text'] = 'Check the sample result with client for sample order # '.$challan_number;\n\t\t\t$notificationArray['added_on'] = $today;\n\t\t\t$notificationArray['reminder_date'] = date('Y-m-d',strtotime($today.\"+ 8 days\"));\n\t\t\t$notificationArray['read_flag'] = 'Pending';\n\t\t \t$this->add_notification($notificationArray);\n\t\t\t$ntf_id = $this->db->insert_id(); \t\n\t\t\t \n\t\t\tforeach($data_order as $orderData){\n\t\t\t // echo '<pre>'; print_r($orderData['insert_stock']);\n\t\t\t // insert into order_challan table\n\t\t\t\tforeach($orderData['order_challan'] as $order_challan){\n\t\t\t\t\t$order_challan['challan_no'] = $challan_number; \n\t\t\t\t\t$order_challan['notification_id'] = $ntf_id ;\n\t\t\t\t\t$this->db->insert(\"order_challan\", $order_challan); \n\t\t \t\t\t//return $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t// update the dispatch quantity for the order\n\t\t\t\t$this->db->set('dispatch_qty', 'dispatch_qty+'.$orderData['insert_stock']['outw_qty'], FALSE);\n\t\t\t\t$this->db->where(\"order_id\", $orderData['insert_stock']['order_id']); \n\t\t\t\t$this->db->where(\"order_pid\", $orderData['insert_stock']['pid']); \n\t\t\t\t$this->db->where(\"id\", $orderData['insert_stock']['id']); \n\t\t\t\t$this->db->update(\"client_order_prodcts\"); \n\t\t\t\t$this->db->limit(1);\n\t\t\t\t\n\t\t\t\t// insert into product_stock table\t\n\t\t\t\tunset($orderData['insert_stock']['id']); // because in table id is primary key\t\t\t\n\t\t\t\t$orderData['insert_stock']['challan_no'] = $challan_number; \n\t\t\t\t\n\t\t\t\t$this->db->insert(\"product_stock\", $orderData['insert_stock']); \n\t\t\t\t//return $this->db->insert_id();\n\t\t\t}\t\n\t\t\t\t\n\t\t\t// check for order status\n\t\t\t//$orderStatus = mysql_query('SELECT (order_qty - `dispatch_qty` ) AS balQty FROM `client_order_prodcts` WHERE `order_id`=\"'.$orderNum.'\" HAVING balQty > 0');\n\t\t\t$this->db->select('sum( `order_qty` ) - sum( `dispatch_qty` ) AS balQty');\n\t\t\t$this->db->from('client_order_prodcts');\n\t\t\t$this->db->where(\"order_id\",$orderData['insert_stock']['order_id']);\t\n\t\t\t$this->db->having(\"balQty > \",'0'); \t\n\t\t\t$query_pending_prods = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_pending_prods->num_rows() == 0){\n\t\t\t\t$order_status['order_status'] = 'Completed';\n\t\t\t\t$this->db->where(\"order_id\", $orderData['insert_stock']['order_id']);\n\t\t\t\t$this->db->update(\"client_orders\", $order_status);\n\t\t\t}\n\t\t\t\n\t\t\t// update shipping address and logistic remark\n\t\t\t$update_order_remark['challan_no'] = $challan_number; \n\t\t\t$update_order_remark['shipping_address'] = $order_challan_shipping['shipping_address']; \n\t\t\t$update_order_remark['logistic_remark'] = $order_challan_shipping['logistic_remark']; \n\t\t\t$this->db->insert(\"order_challan_shipping\", $update_order_remark); \n\t\t\t\n\t\t\treturn $challan_number;\n\t\t\t\n\t\t}\n\t }", "function addInvoice() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO invoices (customer_id, amount_due, invoice_due_date, service_id, service_name, fully_paid)\n VALUES (?, ?, ?, ?, ?, ?);\");\n $stmt->bind_param(\"ssssss\", $custId, $amountDue, $invoiceDate, $serviceId, $serviceName, $paid);\n\n\n $custId = validateInput('invoiceCustId', 'post');\n $invoiceDate = validateInput('invoiceDate', 'post');\n list($serviceId, $serviceName) = explode(\":\", validateInput('service', 'post')); // 'service id : service name'\n $paid = validateInput('fullyPaid', 'post'); // 1 === 'no' : 2 === yes'\n $amountDue = '';\n\n // Get the price of the service\n $sql = \"SELECT price FROM services WHERE id = $serviceId\";\n $result = mysqli_query($GLOBALS['con'], $sql);\n if ($result) {\n $amountDue = mysqli_fetch_assoc($result); \n $amountDue = $amountDue['price'];\n }\n\n $stmt->execute();\n $stmt->close(); \n }", "protected function saveNewDeposits($lastRefID = null)\n {\n // Setup PhealNG and make a call to the Corporation's WalletJournal endpoint to grab some entries.\n Config::get('phealng');\n $pheal = new Pheal(Config::get('phealng.keyID'), Config::get('phealng.vCode'));\n $query = $pheal->corpScope->WalletJournal(array(\n 'fromID' => $lastRefID\n ));\n\n // Allow mass assignment so we can add records to our secure Deposit model.\n Eloquent::unguard();\n // Create an empty array to store RefIDs (so that we can find the lowest one later).\n $refIDs = array();\n\n foreach ($query->entries as $entry)\n {\n // Store all refIDs, even those that aren't related Player Donations.\n array_push($refIDs, $entry->refID);\n // Only check Player Donations.\n if ($entry->refTypeID == 10)\n {\n // If the Character doesn't already exist in our storage, let's add it.\n $character = Character::firstOrNew(array('id' => $entry->ownerID1, 'name' => $entry->ownerName1));\n if (empty($character['original']))\n {\n $this->newCharacters++;\n }\n\n // If the refID exists in storage, ignore that entry. Otherwise, save it.\n $deposit = Deposit::firstOrNew(array('ref_id' => $entry->refID));\n if (empty($deposit['original']))\n {\n $deposit->depositor_id = $entry->ownerID1;\n $deposit->amount = $entry->amount;\n $deposit->reason = trim($entry->reason);\n $deposit->sent_at = $entry->date;\n // Now that we know if the Deposit is new or not, we can se the Character's updated balance.\n $character->balance = $character->balance + $entry->amount;\n if ($character->save() && $deposit->save())\n {\n $this->newDeposits++;\n $this->iskAdded += $entry->amount;\n }\n }\n else if (!empty($deposit['original'])) $this->existingDeposits++;\n }\n else $this->nonDeposits++;\n }\n\n // Recurse through the function, using a new starting point each time. When the API stops returning entries min\n // will throw an ErrorException. Instead of returning the Exception, we return a report and save it to the log.\n try {\n $this->saveNewDeposits(min($refIDs));\n }\n catch (Exception $e) {\n $output = \"Unrelated entries ignored: \" . $this->nonDeposits . \"\\n\";\n $output .= \"Existing Deposits ignored: \" . $this->existingDeposits . \"\\n\";\n $output .= \"New Deposits saved: \" . $this->newDeposits . \"\\n\";\n $output .= \"New (inactive) Characters added: \" . $this->newCharacters . \"\\n\";\n $output .= \"Total deposited since last fetch: \" . $this->iskAdded . \" isk\\n\";\n Log::info($output);\n echo $output;\n }\n }", "function CreateDeposit() {\r\n $conn = conn();\r\n\r\n $sql = \"INSERT INTO `deposit`(`CompanyId`, `DepositAmount`, `PreviousBalance`, `CurrentBalance`, `Comments`, `RecEntered`, `RecEnteredBy`) VALUES \"\r\n . \"('$this->CompanyId','$this->DepositAmount','$this->PreviousBalance','$this->CurrentBalance','$this->Comments',NOW(), '$this->ReEnteredBy')\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "public function insert_voucher_details(){\r\n\t\t\r\n\t\t$tblVoucherHead_data = array(\r\n\t\t\t\t//'intVoucherReferenceID' => 'Primary key Auto generate',\r\n\t\t\t\t'strVoucherReferenceNo' => '',\r\n\t\t\t\t'strVoucherHeadPrefix' => '',\r\n\t\t\t\t'dtVoucerHeadDate' => '',\r\n\t\t\t\t'strVoucherHeadAccountID' => '',\r\n\t\t\t\t'strVoucherHeadAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherHeadBankName' => '',\r\n\t\t\t\t'strVoucherHeadBankDrawnBranch' => '',\r\n\t\t\t\t'tintVoucherHeadBankChequeType' => '',\r\n\t\t\t\t'strVoucherHeadBankChequeNumber' => '',\r\n\t\t\t\t'dtVoucherHeadBankChequeDate' => '',\r\n\t\t\t\t'strVoucherHeadNarration' => '',\r\n\t\t\t\t'intObjectID' => '',\r\n\t\t\t\t'strDatabaseName' => '',\r\n\t\t\t\t'intBranchID' => '',\r\n\t\t\t\t'strAction' => '',\r\n\t\t\t\t'strImportStatus' => '',\r\n\t\t\t\t'strMerchantID' => '',\r\n\r\n\t\t\t);\r\n\r\n\t\t$tblVoucherDetail_data = array(\r\n\t\t\t\t'intVoucherReferenceID' => '',\r\n\t\t\t\t'intVoucherReferenceDetailID' => '',\r\n\t\t\t\t'tintVoucherDetailEntryfor' => '',\r\n\t\t\t\t'intVoucherNewReferenceID' => '',\r\n\t\t\t\t'strVoucherDetailAccountID' => '',\r\n\t\t\t\t'strVoucherDetailAgainstAccountID' => '',\r\n\t\t\t\t'strVoucherDetailNarration' => '',\r\n\t\t\t\t'decVoucherDetailTotalAmt' => '',\r\n\t\t\t\t'strVoucherDetailTotalAmtType' => '',\r\n\t\t\t\t'decVoucherDetailTDSon' => '',\r\n\t\t\t);\r\n\t}", "public function insert_discount_DB($fecha,$ref,$pro_code,$pro_id,$pro_from,$pro_to,$pro_type,$pro_qty,$min_days,$max_days,$bookfrom,$bookto, $discounted, $id_adm,$update, $new){\n $query=\"INSERT INTO `\".DB_PREFIX.\"discount` ( `id`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`fecha`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`reference`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_code`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_id`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_from`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_to`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_type`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`pro_qty`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`min_days`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`max_days`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tobookfrom`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`tobookto`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`discounted`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`id_adm`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`updated`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t`new`)\n \t\t\t\t\tVALUES ( NULL ,'\".$this->link->myesc($fecha).\"',\n\t\t\t\t\t'\".$this->link->myesc($ref).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_code).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_id).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_from).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_to).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_type).\"',\n\t\t\t\t\t'\".$this->link->myesc($pro_qty).\"',\n\t\t\t\t\t'\".$this->link->myesc($min_days).\"',\n\t\t\t\t\t'\".$this->link->myesc($max_days).\"',\n\t\t\t\t\t'\".$this->link->myesc($bookfrom).\"',\n\t\t\t\t\t'\".$this->link->myesc($bookto).\"',\n\t\t\t\t\t'\".$this->link->myesc($discounted).\"',\n\t\t\t\t\t'\".$this->link->myesc($id_adm).\"',\n\t\t\t\t\t'\".$this->link->myesc($update).\"',\n\t\t\t\t\t'\".$this->link->myesc($new).\"')\";\n\n $result = $this->link->execute($query);\n return $result;\n\t}", "public function payFacture() {\n $facture = $this->em->selectById('facture', $this->post->payFacture);\n $facture->setPaye(1);\n $facture->setDatePaiement($this->date);\n $this->em->update($facture);\n // Remettre le compteur en marche si coupé\n $conso = $this->em->selectById('consommation', $facture->getId()); \n $compteur = $this->em->selectById('compteur', $conso->getIdCompteur()); \n if($compteur->getIdEtatCompteur()!=1){\n $compteur->setIdEtatCompteur(1);\n $this->em->update($compteur);\n }\n $this->liste();\n $this->handleStatus('Paiement effectué avec succès.');\n }", "public static function saveDisposal($data){\r\n\r\n // Create some constants for the sql inserts\r\n $user = Auth::getUser();\r\n // Save order Header\r\n $reqStrore = $user->storeNumber;\r\n $userID = $user->id;\r\n\r\n\r\n\r\n\r\n $sql = \"INSERT INTO disposal_head (\r\n reqStore,\r\n userRequesting,\r\n policeName,\r\n policeReportDate,\r\n policeReportNum,\r\n nerReportBy,\r\n nerReportDate,\r\n mfgReportBy,\r\n mfgReportDate,\r\n disposalComments)\r\n Values (\r\n :reqStore,\r\n :userRequesting,\r\n :policeName,\r\n :policeReportDate,\r\n :policeReportNum,\r\n :nerReportBy,\r\n :nerReportDate,\r\n :mfgReportBy,\r\n :mfgReportDate,\r\n :disposalComments)\";\r\n \r\n $db = static::getDB();\r\n\r\n $stmt = $db->prepare($sql);\r\n\r\n $stmt->bindValue(':reqStore', $reqStrore);\r\n $stmt->bindValue(':userRequesting', $userID);\r\n $stmt->bindValue(':policeName', $data['policeDepartment']);\r\n $stmt->bindValue(':policeReportDate', $data['policeDate']);\r\n $stmt->bindValue(':policeReportNum', $data['reportNum']);\r\n $stmt->bindValue(':nerReportBy', $data['nerReportBy']);\r\n $stmt->bindValue(':nerReportDate', $data['nerDate']);\r\n $stmt->bindValue(':mfgReportBy', $data['mfgReportBy']);\r\n $stmt->bindValue(':mfgReportDate', $data['mfgDate']);\r\n $stmt->bindValue(':disposalComments', $data['disposal_comments']);\r\n\r\n $stmt->execute();\r\n\r\n // Get id of last insert\r\n $insertId = $db->lastinsertId();\r\n // get total number of parts for the order\r\n\r\n $partCount = count($data['catNum']);\r\n\r\n // save each item on the request to table\r\n for ($i = 0; $i<$partCount; $i++){\r\n $itemData = array(\r\n 'cat_num' => $data['catNum'][$i],\r\n 'itm_num' => $data['itmNum'][$i],\r\n 'ser_num' => $data['serialNum'][$i],\r\n 'mfg' => $data['mfg'][$i],\r\n 'qty' => $data['quantity'][$i],\r\n 'disp_code'=>$data['disposalCode'][$i],\r\n 'orderID' => $insertId\r\n );\r\n static::saveParts($itemData);\r\n }\r\n }", "function addfee()\n {\n global $db;\n $requete = $db->prepare('INSERT INTO fees (date,nature,amount,site_id) values(?,?,?,?)');\n $requete->execute(array(\n $this->date,\n $this->nature,\n $this->amount,\n $this->site_id\n ));\n }", "public static function AddDebtorToDocument($id_conceptos, $ci_per, $des_per, $des_per1)\n {\n $query = \"INSERT INTO sol.con_deudor(id_con, ci_per, des_per, des_per1) \" .\n \"VALUES('\" . $id_conceptos . \"','\" . $ci_per . \"','\" . $des_per . \"','\" . $des_per1 . \"')\";\n $data = collect(DB::select(DB::raw($query)));\n }", "public function populateMcoData(){\n\t\t$mcoDiffs = new Application_Model_DbTable_McoData();\n\t\t$editAccredit = $mcoDiffs->fetchAll($mcoDiffs->select()->where('mco = 9'));\n\t\tforeach ($editAccredit as $edit) {\n\t\t\t$edit['id'] = $edit->id;\n\t\t\t$edit['amount_passenger'] = $edit->end_roulette - $edit->start_roulette;\n\t\t\t$edit->save();\n\t\t}\n\t}", "public function contract($id = ''){\n\t\t\n\t\tif ($this->input->post('paiement')) {\n\t\t\t\n\t\t\t$medals = $this->input->post('medals_id');\n\t\t\t$method = $this->input->post('method');\n\t\t\t$date = $this->input->post('date_paid');\n\t\t\t\n\t\t\t$this->db->where('number', $medals);\n\t\t\t$this->db->set('date_paid', $date);\n\t\t\t$this->db->set('method', $method);\n\t\t\t$this->db->update('tblcontracts');\n\t\t\t//print_r($this->input->post());\n\t\t\t\n\t\t\t$this->db->where('id', 2);\n\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\n\t\t\t$data['clientid'] = $this->input->post('clientid');\n\t\t\t$data['date'] = $date;\n\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t$data['currency'] = \"2\";\n\t\t\t$data['clientnote'] = \"\";\n\t\t\t$data['adminnote'] = \"\";\n\t\t\t$data['terms'] = \"\";\n\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t$data['discount_total'] = \"0\";\n\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t$data['discount_type'] = \"\";\n\t\t\t$data['recurring'] = \"18\";\n\t\t\t$data['number'] = $medals;\n\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t$data['status'] = 2;\n\t\t\t\n\t\t\t$data['newitems'] = Array ( 'item' => Array ( '2' => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\n\t\t\t$items = $data['newitems'];\n\t\t\t\n\t\t\tunset($data['newitems']);\n\t\t\t\n\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t$invoice_id = $insert_id;\n\t\t\tif ($insert_id) {\n\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n $this->db->delete('tblnotused');\n\t\t\t\t\n\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t\n\t\t\t\t\t//$invoice = $this->invoices_model->get($invoice_id);\n\t\t\t\t\t//$invoice_number = format_invoice_number($invoice->number);\n\t\t\t\t\t//$pdf = invoice_pdf($invoice);\n\t\t\t //\n\t\t\t\t\t//$pdf->Output($invoice_number . '.pdf');\n\t\t\t\t\t\n\t\t\t\t\tredirect(admin_url('contracts/recherche?number='.$medals.'&openinvoice=1&invoice_id='.$invoice_id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif ($this->input->post('search_client')) {\n\t\t\t$this->db->like('phonenumber', $this->input->post('search_client'));\n\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\tif ($client) {\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t$client = array('no_found'=>'no_found');\n\t\t\t\t$data = json_encode((array)$client);\n\t\t\t\techo $data;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif(!has_permission('manageContracts')){\n\t\t\taccess_denied('manageContracts');\n\t\t}\n\n\t\tif($this->input->post()){\n\t\t\t$this->load->helper('perfex_upload');\n\t\t\t\n\t\t\tif($id == ''){\n\t\t\t\t\n\t\t\t\tif (!empty($this->input->post('userid'))) {\n\t\t\t\t\t$cliendid = $this->input->post('userid');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t} else {\n\t\t\t\t\t$phone = $this->input->post('phonenumber');\n\t\t\t\t\n\t\t\t\t\t$this->db->where('phonenumber', $phone);\n\t\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//print_r($client);\n\t\t\t\t\n\t\t\t\tif (empty($client)) {\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name']);\n\t\t\t\t\tunset($_POST['race']);\n\t\t\t\t\tunset($_POST['color']);\n\t\t\t\t\tunset($_POST['remarque']);\n\t\t\t\t\tunset($_POST['number']);\n\t\t\t\t\tunset($_POST['datecreated']);\n\t\t\t\t\tunset($_POST['userid']);\n\t\t\t\t\tunset($_POST['attachment']);\n\t\t\t\t\tunset($_POST['sexe']);\n\t\t\t\t\tunset($_POST['method']);\n\t\t\t\t\tunset($_POST['rfid']);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$user_id = $this->clients_model->add($_POST);\n\t\t\t\t\t$_POST['client'] = $user_id;\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['client'] = $client->userid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$medals = $this->input->post('number');\n\t\t\t\t$method = $this->input->post('method');\n\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\n\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t$this->db->set('date_paid', $date);\n\t\t\t\t$this->db->set('method', $method);\n\t\t\t\t$this->db->update('tblcontracts');\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\t\n\t\t\t\t$this->load->model('invoice_items_model');\n\t\t\t\t$items = $this->invoice_items_model->get();\n\t\t\t\t\n\t\t\t\t//print_r($items);\n\t\t\t\t\n\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t$villes = explode(',',$item['description']);\n\t\t\t\t\tif ($villes[0] == 'Médaille') {\n\t\t\t\t\t\t$ville = $villes[1];\n\t\t\t\t\t\tif ($client->city == $ville) {\n\t\t\t\t\t\t\t$item_id = $item['itemid'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($item_id) {\n\t\t\t\t\t$item_select = $item_id;\n\t\t\t\t} else {\n\t\t\t\t\t$item_select = 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tunset($item);\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $item_select);\n\t\t\t\t$item = $this->db->get('tblinvoiceitemslist')->row();\n\t\t\t\t\n\t\t\t\t$data['clientid'] = $_POST['client'];\n\t\t\t\t$data['date'] = $date;\n\t\t\t\t$data['duedate'] = date('Y-m-d', strtotime(\"+30 days\"));\n\t\t\t\t$data['currency'] = \"2\";\n\t\t\t\t$data['clientnote'] = \"\";\n\t\t\t\t$data['adminnote'] = \"\";\n\t\t\t\t$data['terms'] = \"\";\n\t\t\t\t$data['discount_percent'] = \"0\";\n\t\t\t\t$data['discount_total'] = \"0\";\n\t\t\t\t$data['adjustment'] = \"0.00\";\n\t\t\t\t$data['subtotal'] = $item->rate;\n\t\t\t\t$data['total'] = $data['subtotal'];\n\t\t\t\t$data['allowed_payment_modes'] = 'a:6:{i:0;s:1:\"1\";i:1;s:1:\"2\";i:2;s:1:\"3\";i:3;s:1:\"4\";i:4;s:6:\"paypal\";i:5;s:6:\"stripe\";}';\n\t\t\t\t$data['discount_type'] = \"\";\n\t\t\t\t$data['recurring'] = \"18\";\n\t\t\t\t$data['number'] = $medals;\n\t\t\t\t$data['hash'] = md5(rand() . microtime());\n\t\t\t\t$data['status'] = 2;\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 2 ) ) ) );\n\t\t\t\t} else if ($_POST['animal_name3']) {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 3 ) ) ) );\n\t\t\t\t} else {\n\t\t\t\t\t$data['newitems'] = Array ( 'item' => Array ( $item_select => Array ( 'quantity' => Array ( 0 => 1 ) ) ) );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$items = $data['newitems'];\n\t\t\t\t\n\t\t\t\tunset($data['newitems']);\n\t\t\t\t\n\t\t\t\t$this->db->insert('tblinvoices', $data);\n\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\tif ($insert_id) {\n\t\t\t\t\t$this->db->where('name', 'next_invoice_number');\n\t\t\t\t\t$this->db->set('value', 'value+1', FALSE);\n\t\t\t\t\t$this->db->update('tbloptions');\n\t\t\t\t\tif (count($items) > 0) {\n\t\t\t\t\t\tforeach ($items['item'] as $itemid => $quantity) {\n\t\t\t\t\t\t\t$this->db->insert('tblinvoiceitems', array(\n\t\t\t\t\t\t\t\t'invoiceid' => $insert_id,\n\t\t\t\t\t\t\t\t'itemid' => $itemid,\n\t\t\t\t\t\t\t\t'qty' => $quantity['quantity'][0]\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where('number', $medals);\n\t\t\t\t\t$this->db->delete('tblnotused');\n\t\t\t\t\t\n\t\t\t\t\t$data_payment['invoiceid'] = $insert_id;\n\t\t\t\t\t$data_payment['amount'] = $data['subtotal'];\n\t\t\t\t\t$data_payment['paymentmode'] = 1;\n\t\t\t\t\t$data_payment['date'] = $date;\n\t\t\t\t\t$data_payment['daterecorded'] = $date;\n\t\t\t\t\t$data_payment['addedfrom'] = 1;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('tblinvoicepaymentrecords', $data_payment);\n\t\t\t\t\t$insert_id = $this->db->insert_id();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$POST_data = $_POST;\n\t\t\t\t\n\t\t\t\t//print_r($this->input->post());\n\t\t\t\tunset($POST_data['firstname']);\n\t\t\t\tunset($POST_data['lastname']);\n\t\t\t\tunset($POST_data['email']);\n\t\t\t\tunset($POST_data['phonenumber']);\n\t\t\t\tunset($POST_data['phone_other']);\n\t\t\t\tunset($POST_data['no_civique']);\n\t\t\t\tunset($POST_data['address']);\n\t\t\t\tunset($POST_data['app']);\n\t\t\t\tunset($POST_data['city']);\n\t\t\t\tunset($POST_data['state']);\n\t\t\t\tunset($POST_data['zip']);\n\t\t\t\tunset($POST_data['password']);\n\t\t\t\tunset($POST_data['userid']);\n\n\t\t\t\t\n\t\t\t\tif ($_POST['animal_name2']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['animal_name'] = $_POST['animal_name2'];\n\t\t\t\t\t$POST_data2['race'] = $_POST['race2'];\n\t\t\t\t\t$POST_data2['color'] = $_POST['color2'];\n\t\t\t\t\t$POST_data2['remarque'] = $_POST['remarque2'];\n\t\t\t\t\t$POST_data2['number'] = $_POST['number2'];\n\t\t\t\t\t$POST_data2['attachment'] = $_POST['attachment2'];\n\t\t\t\t\t$POST_data2['sexe'] = $_POST['sexe2'];\n\t\t\t\t\t$POST_data2['method'] = $_POST['method2'];\n\t\t\t\t\t$POST_data2['rfid'] = $_POST['rfid2'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\t\tunset($_POST['race2']);\n\t\t\t\t\tunset($_POST['color2']);\n\t\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\t\tunset($_POST['number2']);\n\t\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\t\tunset($_POST['method2']);\n\t\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data2['date_paid'] = $date;\n\t\t\t\t\t$POST_data2['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data2);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tunset($POST_data['animal_name2']);\n\t\t\t\t\tunset($POST_data['race2']);\n\t\t\t\t\tunset($POST_data['color2']);\n\t\t\t\t\tunset($POST_data['remarque2']);\n\t\t\t\t\tunset($POST_data['number2']);\n\t\t\t\t\tunset($POST_data['attachment2']);\n\t\t\t\t\tunset($POST_data['sexe2']);\n\t\t\t\t\tunset($POST_data['method2']);\n\t\t\t\t\tunset($POST_data['rfid2']);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($_POST['animal_name3']) {\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['animal_name'] = $_POST['animal_name3'];\n\t\t\t\t\t$POST_data3['race'] = $_POST['race3'];\n\t\t\t\t\t$POST_data3['color'] = $_POST['color3'];\n\t\t\t\t\t$POST_data3['remarque'] = $_POST['remarque3'];\n\t\t\t\t\t$POST_data3['number'] = $_POST['number3'];\n\t\t\t\t\t$POST_data3['attachment'] = $_POST['attachment3'];\n\t\t\t\t\t$POST_data3['sexe'] = $_POST['sexe3'];\n\t\t\t\t\t$POST_data3['method'] = $_POST['method3'];\n\t\t\t\t\t$POST_data3['rfid'] = $_POST['rfid3'];\n\t\t\t\t\t\n\t\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\t\tunset($_POST['race3']);\n\t\t\t\t\tunset($_POST['color3']);\n\t\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\t\tunset($_POST['number3']);\n\t\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\t\tunset($_POST['method3']);\n\t\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\t\n\t\t\t\t\t$POST_data3['date_paid'] = $date;\n\t\t\t\t\t$POST_data3['method'] = $method;\n\t\t\t\t\t\n\t\t\t\t\t$id = $this->contracts_model->add($POST_data3);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tunset($POST_data['animal_name3']);\n\t\t\t\t\tunset($POST_data['race3']);\n\t\t\t\t\tunset($POST_data['color3']);\n\t\t\t\t\tunset($POST_data['remarque3']);\n\t\t\t\t\tunset($POST_data['number3']);\n\t\t\t\t\tunset($POST_data['attachment3']);\n\t\t\t\t\tunset($POST_data['sexe3']);\n\t\t\t\t\tunset($POST_data['method3']);\n\t\t\t\t\tunset($POST_data['rfid3']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$POST_data['date_paid'] = $date;\n\t\t\t\t$POST_data['method'] = $method;\n\t\t\t\t\n\t\t\t\t$id = $this->contracts_model->add($POST_data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($id){\n\t\t\t\t\thandle_contract_attachment($id);\n\t\t\t\t\tset_alert('success', _l('added_successfuly',_l('contract')));\n\t\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//echo 'sa';\n\t\t\t\tunset($_POST['firstname']);\n\t\t\t\tunset($_POST['lastname']);\n\t\t\t\tunset($_POST['email']);\n\t\t\t\tunset($_POST['phonenumber']);\n\t\t\t\tunset($_POST['phone_other']);\n\t\t\t\tunset($_POST['no_civique']);\n\t\t\t\tunset($_POST['address']);\n\t\t\t\tunset($_POST['app']);\n\t\t\t\tunset($_POST['city']);\n\t\t\t\tunset($_POST['state']);\n\t\t\t\tunset($_POST['zip']);\n\t\t\t\tunset($_POST['password']);\n\t\t\t\tunset($_POST['userid']);\n\t\t\t\tunset($_POST['animal_name2']);\n\t\t\t\tunset($_POST['race2']);\n\t\t\t\tunset($_POST['color2']);\n\t\t\t\tunset($_POST['remarque2']);\n\t\t\t\tunset($_POST['number2']);\n\t\t\t\tunset($_POST['attachment2']);\n\t\t\t\tunset($_POST['sexe2']);\n\t\t\t\tunset($_POST['method2']);\n\t\t\t\tunset($_POST['rfid2']);\n\t\t\t\tunset($_POST['animal_name3']);\n\t\t\t\tunset($_POST['race3']);\n\t\t\t\tunset($_POST['color3']);\n\t\t\t\tunset($_POST['remarque3']);\n\t\t\t\tunset($_POST['number3']);\n\t\t\t\tunset($_POST['attachment3']);\n\t\t\t\tunset($_POST['sexe3']);\n\t\t\t\tunset($_POST['method3']);\n\t\t\t\tunset($_POST['rfid3']);\n\t\t\t\t\n\t\t\t\t$contract_id = $_POST['edit'];\n\t\t\t\tunset($_POST['edit']);\n\t\t\t\t\n\t\t\t\t//print_r($_POST);\n\t\t\t\t\n\t\t\t\t$this->db->where('userid', $cliendid);\n\t\t\t\t$client = $this->db->get(CLIENTS_TABLE)->row();\n\t\t\t\t\n\t\t\t\t$_POST['number'];\n\t\t\t\t\n\t\t\t\t$success = $this->contracts_model->update($_POST, $contract_id);\n\n\t\t\t\tif($success){\n\t\t\t\t\tset_alert('success', _l('updated_successfuly',_l('contract')));\n\t\t\t\t} else {\n\t\t\t\t\tset_alert('warning', 'Numéro déjà utilisé');\n\t\t\t\t}\n\n\t\t\t\tredirect(admin_url('contracts/contract/'.$id));\n\t\t\t}\n\t\t}\n\n\t\tif($id == ''){\n\t\t\t$title = 'Ajouter nouvelle médaille';\n\t\t} else {\n\t\t\t$data['attachment'] = $this->contracts_model->get_contract_attachment($id);\n\t\t\t$data['contract'] = $this->contracts_model->get($id);\n\t\t\t$this->load->model('payment_modes_model');\n\t\t\t$data['payment_modes'] = $this->payment_modes_model->get();\n\t\t\t$client_id = $data['contract']->client;\n\t\t\t$data['client'] = $this->clients_model->get($client_id);\n\t\t\tif(!$data['contract']){\n\t\t\t\tblank_page(_l('contract_not_found'));\n\t\t\t}\n\t\t\t$title = _l('edit',_l('contract_lowercase'));\n\t\t}\n\t\t\n\t\t$this->load->model('payment_modes_model');\n $data['payment_modes'] = $this->payment_modes_model->get();\n\n\t\t$data['types'] = $this->contracts_model->get_contract_types();\n\t\t$this->load->model('clients_model');\n\t\t$data['clients'] = $this->clients_model->get();\n\t\t$data['title'] = $title;\n\t\t$this->load->view('admin/contracts/contract',$data);\n\t}", "function grabar_prov_serv_cost($datos)\n\t{\n\t\t$this->borrar_prov_serv_cost($datos[IDPROVEEDOR],$datos[IDSERVICIO]);\n\t\t$reg_prov_serv_cost[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t$reg_prov_serv_cost[IDSERVICIO]=$datos[IDSERVICIO];\n\t\t$reg_prov_serv_cost[IDUSUARIOMOD]=$datos[IDUSUARIOMOD];\n\t\t$reg_prov_serv_cost[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t//\t\tvar_dump($reg_prov_serv_cost);\n\t\t$this->insert_update(\"$this->catalogo.catalogo_proveedor_servicio\",$reg_prov_serv_cost);\n\n\n\t\t$reg_prov_serv_obser[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t$reg_prov_serv_obser[IDSERVICIO]=$datos[IDSERVICIO];\n\t\t$reg_prov_serv_obser[IDUSUARIOMOD]=$datos[IDUSUARIOMOD];\n\t\t$reg_prov_serv_obser[OBSERVACIONES]=$datos[OBSERVACIONES];\n\t\t$this->insert_update(\"$this->catalogo.catalogo_proveedor_servicio_observacion\",$reg_prov_serv_obser);\n\n\t\tunset($reg_prov_serv_cost[OBSERVACIONES]);\n\n\t\tfor($i=0;$i<=50;$i++ )\n\t\t{\n\t\t\tif ($datos[MONTOLOCAL][$i]!='')\n\t\t\t{\n\t\t\t\t$reg_prov_serv_cost[IDCOSTO]=$datos[IDCOSTO][$i];\n\t\t\t\t$reg_prov_serv_cost[UNIDAD]=$datos[UNIDAD][$i];\n\t\t\t\t$reg_prov_serv_cost[IDMEDIDA] = $datos[IDMEDIDA][$i];\n\t\t\t\t$reg_prov_serv_cost[MONTOLOCAL]=$datos[MONTOLOCAL][$i];\n\t\t\t\t$reg_prov_serv_cost[MONTOINTERMEDIO]=$datos[MONTOINTERMEDIO][$i];\n\t\t\t\t$reg_prov_serv_cost[MONTOFORANEO]=$datos[MONTOFORANEO][$i];\n\t\t\t\t$reg_prov_serv_cost[PLUSNOCTURNO]=$datos[PLUSNOCTURNO][$i];\n\t\t\t\t$reg_prov_serv_cost[PLUSFESTIVO]=$datos[PLUSFESTIVO][$i];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_servicio_costo_negociado\",$reg_prov_serv_cost);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public function addReqMoney(){\n if(isset($_POST))\n {\n extract($_POST);\n $check = $this->db->query(\"select * from doctor_wallet_prices where doctor_id='\".$doctor_id.\"'\")->row();\n if(count($check)>0)\n {\n $data['amount'] = $amount+$check->amount;\n $this->Generic_model->updateData(\"doctor_wallet_prices\", $data, array('doctor_wallet_id'=>$check->doctor_wallet_id));\n // make status as amount added.\n $para['req_status'] = 1;\n $this->Generic_model->updateData(\"wallet_amount_requests\",$para,array('wallet_amount_request_id'=>$req_id));\n // Transaction History\n $data1['transaction_amount'] = $amount;\n $data1['transaction_type'] = \"Credit\";\n $data1['doctor_id'] = $doctor_id;\n $data1['created_by'] = $this->session->userdata('user_id');\n $data1['created_date_time'] = date(\"Y-m-d H:i:s\");\n $this->Generic_model->insertData(\"eo_wallet_history\",$data1);\n $this->session->set_flashdata('msg','Amount Added.');\n redirect('Wallet/walletRequests');\n }\n else\n {\n $data['amount'] = $amount;\n $data['doctor_id'] = $doctor_id;\n $data['created_by'] = $this->session->userdata('user_id'); \n $data['created_date_time'] = date(\"Y-m-d H:i:s\");\n $this->Generic_model->insertData(\"doctor_wallet_prices\", $data);\n // make status as amount added.\n $para['req_status'] = 1;\n $this->Generic_model->updateData(\"wallet_amount_requests\",$para,array('wallet_amount_request_id'=>$req_id));\n // Transaction History\n $data1['transaction_amount'] = $amount;\n $data1['transaction_type'] = \"Credit\";\n $data1['doctor_id'] = $doctor_id;\n $data1['created_by'] = $this->session->userdata('user_id');\n $data1['created_date_time'] = date(\"Y-m-d H:i:s\");\n $this->Generic_model->insertData(\"eo_wallet_history\",$data1);\n $this->session->set_flashdata('msg','Amount Added.');\n redirect('Wallet/walletRequests');\n }\n }\n else\n {\n $this->session->set_flash_data('msg','Access Denied');\n redirect('Wallet/walletRequests');\n }\n }", "public function free_add()\n\t\t{\n\t\t\t// $data['master_libur'] = $this->general->getData($data);\n\t\t\t// echo $data->judul;\n\t\t\t$this->general->load('absent/free/add');\n\t\t}", "function cc_bill($cc_info, $member, $amount, \n $currency, $product_description, \n $charge_type, $invoice, $payment){\n global $config;\n $log = array();\n //////////////////////// cc_bill /////////////////////////\n\n srand(time());\n if ($charge_type == CC_CHARGE_TYPE_TEST) \n $amount = \"1.00\";\n $vars = array(\n \"type\" => 'sale',\n \"username\" => $this->config['login'],\n \"password\" => $this->config['pass'],\n \"orderid\" => $payment['payment_id'],\n \"amount\" => $amount,\n \"orderdescription\" => $product_description\n );\n if($charge_type == CC_CHARGE_TYPE_RECURRING){\n $vars['customer_vault_id'] = $member['data']['inspirepay_customer_vault_id'];\n }else{\n $vars +=array(\n \"ccnumber\" => $cc_info['cc_number'],\n \"ccexp\" => $cc_info['cc-expire'],\n \"email\" => $member['email'],\n \"firstname\" => $cc_info['cc_name_f'],\n \"lastname\" => $cc_info['cc_name_l'],\n \"address1\" => $cc_info['cc_street'],\n \"city\" => $cc_info['cc_city'],\n \"state\" => $cc_info['cc_state'],\n \"zip\" => $cc_info['cc_zip'],\n \"country\" => $cc_info['cc_country'],\n \"ipaddress\" => $member['remote_addr'] ? $member['remote_addr'] : $_SERVER['REMOTE_ADDR'],\n \"phone\" => $cc_info['cc_phone']\n );\n if ($cc_info['cc_code'])\n $vars['cvv'] = $cc_info['cc_code'];\n }\n \n // prepare log record\n $vars_l = $vars; \n if($vars['ccnumber'])\n $vars_l['ccnumber'] = $cc_info['cc'];\n if ($vars['cvv'])\n $vars_l['cvv'] = preg_replace('/./', '*', $vars['cvv']);\n $log[] = $vars_l;\n /////\n $res = $this->run_transaction($vars);\n $log[] = $res;\n\n if ($res['response'] == '1'){ \n if ($charge_type == CC_CHARGE_TYPE_TEST)\n $this->void_transaction($res['transactionid'], $log);\n return array(CC_RESULT_SUCCESS, \"\", $res['transactionid'], $log);\n } elseif ($res['response'] == '2') {\n return array(CC_RESULT_DECLINE_PERM, $res['responsetext'], \"\", $log);\n } else {\n return array(CC_RESULT_INTERNAL_ERROR, $res['responsetext'], \"\", $log);\n }\n }", "function UPDSAR()\n{\n $aropen_rows = db::fetchRows($sql, 'DTSDATA.AROPEN'); /* #251 */\n if ($aropen\n ) {\n if ($billpay->BPPAY_ < $billpay->BPNET_\n && $billpay->BPRTN_ === 0\n && $billpay->BPOIN_ > 0\n ) {\n $aropen->AROPPD += $billpay->BPPAY_; /* #258 */\n $aropen->ARONPD += $billpay->BPPAY_; /* #259 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #260 */\n $aropen->update(); /* #261 update record */\n $receipts->CRCID = $aropen->AROCID; /* #263 */\n $receipts->CRPER = $PERIOD; /* #264 */\n $receipts->CRCUST = $aropen->AROCUS; /* #265 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #266 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #267 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #268 */\n $receipts->CRINV_ = $aropen->AROINV; /* #269 */\n $receipts->CRTYPE = '1'; /* #270 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #271 */\n $receipts->CRGLDP = ''; /* #272 */\n $receipts->CRGLAC = ''; /* #273 */\n $receipts->CRDESC = ''; /* #274 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #275 */\n $receipts->CRDUS = 0; /* #276 */\n $receipts->CRSTCM = ''; /* #277 */\n $receipts->CRSTGL = ''; /* #278 */\n $receipts->CRSTS = ''; /* #279 */\n $receipts->CRDST = ''; /* #280 */\n $receipts->insert(); /* #281 insert record */\n $customer_rows = db::fetchRows($sql, 'DTSDATA.MFCUST'); /* #283 */\n $customer->CULRDT = $billpay->BPPDAT; /* #284 */\n $customer->CUREC->update(); /* #285 update record */\n } /* #286 end if */\n } /* #288 end if */\n}", "public function save_donation_data()\n\t{\n\t\t$id = $this->input->post(\"id\");\n\t\t$info = $this->input->post(\"info\");\n\t\t$query = \"insert into donations(doner_id , donation_date , details)\n\t\tvalues(? , CURDATE() , ?)\";\n\t\t$this->db->query($query , array($id , $info));\n\t\techo 'Data has been saved';\n\t}", "public function addLedger($etc = array(), $data = array()) {\r\n $this->db->insert('ksr_ledger', $data);\r\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function AddTransactionWithDraw($data){\n \t$this->_name='cs_withdraw';\r\n \t$session_user=new Zend_Session_Namespace('auth');\n \t$user_id = $session_user->user_id;\r\n \tif(empty($data['withdraw_dollar'])){\r\n \t\t$w_dollar = 0;\r\n \t}else{\r\n \t\t$w_dollar =$data['withdraw_dollar'] ;\r\n \t\t$rs_dollar = $this->getMoneyInAccountBySender($data['sender'],1);\r\n \t\t$this->updateOldDeposit($w_dollar,$rs_dollar);\r\n \t}\r\n \tif(empty($data['withdraw_bath'])){\r\n \t\t$w_bath = 0;\r\n \t}else{\r\n \t\t$w_bath =$data['withdraw_bath'];\r\n \t\t$rs_bath = $this->getMoneyInAccountBySender($data['sender'],2);\r\n \t\t$this->updateOldDeposit($w_bath,$rs_bath);\r\n \t}\r\n \tif(empty($data['withdraw_riel'])){\r\n \t\t$w_riel = 0;\r\n \t}else{\r\n \t\t$w_riel = $data['withdraw_riel'];\r\n \t\t$rs_riel = $this->getMoneyInAccountBySender($data['sender'],3);\r\n \t\t$this->updateOldDeposit($w_riel,$rs_riel);\r\n \t}\r\n \t$this->_name='cs_withdraw';\r\n \t$data = array(\r\n \t\t\t'sender_id'=>$data['sender'],\r\n \t\t\t'invoice'=>$data['invoice_no'],\r\n \t\t\t'wd_amountdollar'=>$w_dollar,\r\n \t\t\t'wd_amountbath'=>$w_bath,\r\n \t\t\t'wd_amountriel'=>$w_riel,\r\n \t\t\t'user_id'=>$user_id,\r\n \t\t\t'create_date'=>$data['send_date'],\r\n \t);\r\n \t$id = $this->insert($data);\n \t\n \t$process = 0;\r\n \t$amount = 0;\r\n \t$dbc = new Application_Model_DbTable_DbCapital();\r\n \tfor($i=1; $i<4; $i++){//for add capital detail and update current capital by staff\r\n \t\tif(!empty($w_dollar) AND $i==1){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 1;\r\n \t\t\t$amount = $w_dollar;\r\n \t\t}elseif(!empty($w_bath) AND $i==2){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 2;\r\n \t\t\t$amount = $w_bath;\r\n \t\t}elseif(!empty($w_riel) AND $i==3){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 3;\r\n \t\t\t$amount = $w_riel;\r\n \t\t}\r\n \t\tif($process==1){//with draw tran_type = 7\r\n \t\t\t$_arr = array(\r\n \t\t\t\t\t'tran_id' \t=>$id,\r\n \t\t\t\t\t'tran_type' =>7,\r\n \t\t\t\t\t'curr_type'\t=>$curr_type,\r\n \t\t\t\t\t'amount'\t=>-$amount,//cos withdraw money to customer\r\n \t\t\t\t\t'user_id'\t=>$user_id\r\n \t\t\t);\r\n \t\r\n \t\t\t$dbc->addMoneyToCapitalDetail($_arr);\r\n \t\t\t \r\n \t\t\t$rs = $dbc->DetechCapitalExist($user_id, $curr_type,null);\r\n \t\t\tif(!empty($rs)){//update old user\r\n \t\t\t\t$arr = array(\r\n \t\t\t\t\t\t'amount'=>$rs['amount']-$amount\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->updateCurrentBalanceById($rs['id'],$arr);\r\n \t\t\t}else{\r\n \t\t\t\t$date = date(\"Y-m-d H:i:s\");\r\n \t\t\t\t$arr =array(\r\n \t\t\t\t\t\t'amount'=>-$amount,\r\n \t\t\t\t\t\t'currencyType'=>$curr_type,\r\n \t\t\t\t\t\t'userid'=>$user_id,\r\n \t\t\t\t\t\t'statusDate'=>$date\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->AddCurrentBalanceById($arr);\r\n \t\t\t}\r\n \t\r\n \t\t}\r\n \t\t \r\n \t\t$process = 0;\r\n \t}\n }", "public function salesOrderCreditmemoSaveAfter_backup($observer) {\n if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse'))\n return;\n if (Mage::registry('INVENTORY_CORE_ORDER_CREDITMEMO'))\n return;\n Mage::register('INVENTORY_CORE_ORDER_CREDITMEMO', true);\n try {\n $warehouse = Mage::getModel('inventoryplus/warehouse')->getCollection()->getFirstItem();\n $warehouseId = $warehouse->getId();\n $creditmemo = $observer->getCreditmemo();\n $order = $creditmemo->getOrder();\n $supplierReturn = array();\n $transactionData = array();\n\n $parents = array();\n\n \n foreach ($creditmemo->getAllItems() as $item) {\n $orderItemId = $item->getOrderItemId();\n $orderItem = Mage::getModel('sales/order_item')->load($orderItemId);\n if (in_array($orderItem->getProductType(), array('configurable', 'bundle', 'grouped'))) {\n $parents[$orderItemId]['qtyRefund'] = $item->getQty();\n $parents[$orderItemId]['qtyRefunded'] = $orderItem->getQtyRefunded();\n $parents[$orderItemId]['qtyShipped'] = $orderItem->getQtyShipped();\n continue;\n }\n if ($orderItem->getParentItemId()) {\n $qtyRefund = $item->getQty();\n $qtyShipped = $orderItem->getQtyShipped();\n $creditmemoParentItem = Mage::getModel('sales/order_creditmemo_item')->getCollection()\n ->addFieldToFilter('parent_id', $item->getParentId())\n ->addFieldToFilter('order_item_id', $orderItem->getParentItemId())\n ->getFirstItem();\n if ($parents && $parents[$orderItem->getParentItemId()]['qtyRefund']) {\n $qtyRefund = max($qtyRefund, $parents[$orderItem->getParentItemId()]['qtyRefund']);\n }\n if ($qtyShipped == 0 && $parents && $parents[$orderItem->getParentItemId()]['qtyShipped']) {\n $qtyShipped = $parents[$orderItem->getParentItemId()]['qtyShipped'];\n }\n $qtyOrdered = $orderItem->getQtyOrdered();\n $qtyRefunded = $orderItem->getQtyRefunded();\n $qtyRefunded = max($qtyRefunded, $parents[$orderItem->getParentItemId()]['qtyRefunded']);\n } else {\n $qtyRefund = $item->getQty();\n $qtyShipped = $orderItem->getQtyShipped();\n $qtyOrdered = $orderItem->getQtyOrdered();\n $qtyRefunded = $orderItem->getQtyRefunded();\n }\n //if return to stock\n /*\n * total qty will be updated if (qtyShipped + qtyRefunded + qtyRefund) > qtyOrdered and will be returned = (qtyShipped + qtyRefunded + qtyRefund) > qtyOrdered\n * available qty will be returned = qtyRefund\n */\n $qtyReturnAvailableQty = 0;\n $qtyReturnTotalQty = 0;\n if ($item->getBackToStock()) {\n $qtyReturnAvailableQty = $qtyRefund;\n $qtyChecked = $qtyShipped + $qtyRefunded + $qtyRefund - $qtyOrdered;\n if ($qtyChecked > 0)\n $qtyReturnTotalQty = $qtyChecked;\n }else {\n //if not return to stock\n /*\n * total qty will be updated = qtyShipped - min[(qtyShipped + qtyRefunded + qtyRefund),qtyOrdered]\n * available qty not change\n */\n $totalShipAndRefund = $qtyShipped + $qtyRefunded + $qtyRefund;\n $qtyReturnTotalQty = min($totalShipAndRefund, $qtyOrdered);\n }\n $warehouseProduct = Mage::getModel('inventoryplus/warehouse_product')\n ->getCollection()\n ->addFieldToFilter('product_id', $item->getProductId())\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->getFirstItem();\n if ($warehouseProduct->getId()) {\n $warehouseProduct->setData('total_qty', $warehouseProduct->getTotalQty() + $qtyReturnTotalQty)\n ->setData('available_qty', $warehouseProduct->getAvailableQty() + $qtyReturnAvailableQty)\n ->save();\n }\n\n $warehouseShipment = Mage::getModel('inventoryplus/warehouse_shipment')\n ->getCollection()\n ->addFieldToFilter('item_id', $orderItemId)\n ->addFieldToFilter('product_id', $item->getProductId())\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->getFirstItem();\n if ($warehouseShipment->getId()) {\n $warehouseShipment->setData('qty_refunded', $warehouseShipment->getQtyRefunded() + $qtyRefund)\n ->save();\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'inventory_management.log');\n }\n }", "public function postProcess() {\n if ($this->_action & CRM_Core_Action::DELETE) {\n CRM_CiviDiscount_BAO_Item::del($this->_id);\n CRM_Core_Session::setStatus(ts('Selected Discount has been deleted.'));\n return;\n }\n\n if ($this->_action & CRM_Core_Action::COPY) {\n $params = $this->exportValues();\n $newCode = CRM_CiviDiscount_Utils::randomString('abcdefghjklmnpqrstwxyz23456789', 8);\n CRM_CiviDiscount_BAO_Item::copy($this->_cloneID, $params, $newCode);\n CRM_Core_Session::setStatus(ts('Selected Discount has been duplicated.'));\n return;\n }\n\n $params = $this->exportValues();\n\n if ($this->_action & CRM_Core_Action::UPDATE) {\n $params['id'] = $this->_id;\n }\n $params['multi_valued'] = $this->_multiValued;\n\n if(in_array(0, $params['events']) && count($params['events']) > 1) {\n CRM_Core_Session::setStatus(ts('You selected `any event` and specific events, specific events have been unset'));\n $params['events'] = array(0);\n }\n\n $params['filters'] = $this->getFiltersFromParams($params);\n $item = CRM_CiviDiscount_BAO_Item::add($params);\n\n CRM_Core_Session::setStatus(ts('The discount \\'%1\\' has been saved.',\n array(1 => $item->description ? $item->description : $item->code)));\n }", "public function store (Request $request){\n $supplier_id = DB::table('supplier')\n ->where('supplier_name', $request->supplier_name)\n ->get();\n foreach ($supplier_id as $id) {\n $current_supplier = $id->supplier_id;\n }\n $data = array();\n $data['supplier_id'] = $current_supplier;\n $data['code'] = $request->supplier_code;\n $data['purchase_date'] = $request->purchase_date;\n $data['purchase_no'] = $request->purchase_no;\n $lastId = DB::table('purchases')->insertGetId(['purchase_date'=>$request->purchase_date,'supplier_id'=>$current_supplier,'purchase_no'=>$request->purchase_no]);\n \n $itemsid = $request->id;\n $itemscode = $request->code;\n $quantities = $request->quantity;\n $units = $request->unit;\n\n foreach($itemsid as $index => $id){\n $result = DB::table('items')\n ->where('item_id',$id)\n ->first();\n }\n\n $baseUnit = array();\n foreach($units as $index => $unit_id ){\n if( $unit_id == $result->unit_id){\n $baseUnit[$index] = $quantities[$index];\n }\n else{\n $baseUnit[$index] = $quantities[$index]/$result->to_unit;\n \n }\n }\n\n $numbers = count( $quantities);\n if($lastId){\n if($numbers>0){\n for($i=0; $i<$numbers; $i++){\n $purchasesData = array(\n array('id' => $lastId,\n 'item_id' => $itemsid[$i],\n 'code'=>$itemscode[$i],\n 'quantity' => $quantities[$i],\n 'unit' => $units[$i])\n );\n DB::table('purchases_item')->insert( $purchasesData );\n }\n }\n }\n Session::put('success','purchase added succefully');\n return Redirect::to('/add-purchase');\n }", "private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}", "function receivedMoney( $ketObj ) {\n$smdy =\"\";\nif (isset($_POST['start_date']) && $_POST['start_date']!=\"\") {\n\t$smdy =date(\"m/d/Y\",strtotime(\"\".str_replace(\"/\",\"-\",$_POST['start_date']).\"\"));\n\t/*echo \"<hr/>\";\n\techo $smdy;\n\techo \"<hr/>\";*/\n}\n$ketech['fin_rec_cus_id'] = $_POST['fid'];\n$ketech['fin_rec_person_id'] = $_POST['deal_person'];\n$ketech['fin_rec_amount'] = $_POST['fin_rec_amount'];\n$ketech['rema'] = $_POST['rema'];\n$ketech['fin_rec_date'] =\t$smdy;\n$ketech['fin_del_mob']\t= $_POST['fin_del_mob'];\nif (isset($_POST['fin_rec_id']) && $_POST['fin_rec_id']>0) {\n\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"nar_fin_rec\",$ketech, \"WHERE fin_rec_id=\".$_POST['fin_rec_id'] );\n\n}else {\n\t$allSet = $ketObj->runquery( \"INSERT\", \"\", \"nar_fin_rec\", $ketech );\n}\n$qstring =\"\";\n\t\t\tif (isset($_REQUEST['searchbyorder']) && $_REQUEST['searchbyorder']!=\"\") {\n\t\t\t\t$qstring .= '&searchbyorder='.$_REQUEST['searchbyorder'].'';\n\t\t\t}\n\t\t\tif (isset($_REQUEST['vid']) && $_REQUEST['vid']!=\"\") {\n\t\t\t\t$qstring .= '&vid='.$_REQUEST['vid'].'';\n\t\t\t}\nif (isset($_REQUEST['ss_date']) && $_REQUEST['ss_date']!=\"\" && isset( $_REQUEST['es_date'] ) && $_REQUEST['es_date']!=\"\") {\n\t$qstring .= \"&ss_date=\".$_REQUEST['ss_date'].\"&es_date=\".$_REQUEST['es_date'].\"\";\n}\nheader(\"Location: index.php?view=\".$_POST['controller'].\"&file=\".$_POST['file'].\"\".$qstring.\"\");\n}", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "public function add($sAccount, $sVendor, $sCategory, $sDate, $iDebit, $iFixed, $sAmount, $sNotes)\n {\n \n //global $m_pSession;\n\n $sEnteredOn = date(\"Y-m-d H:i:s\");\n \n $bNewVendor = false;\n $bNewAccount = false;\n $bNewCategory = false;\n\n //Clean Account, Vendor and Category fields. Trim account and vender. Clean up Category and sub categories within the delemiter.\n $sVendor = trim($sVendor);\n $sAccount = trim($sAccount);\n $sCategory = $this->cleanCategory($sCategory);\n\n //Dealing with empty strings sent to add\n if(strlen($sVendor)!=0)\n $iVendorId = $this->pDatabase->selectValue(\"vendors/get_id_by_name\", $this->iUserId, $sVendor);\n else\n $iVendorId = 'NULL';\n \n if(strlen($sAccount)!=0)\n $iAccountId = $this->pDatabase->selectValue(\"accounts/get_id_by_name\", $this->iUserId, $sAccount);\n else\n $iAccountId = 'NULL';\n \n //Get category id form the database.\n if(strlen($sCategory)!=0)\n $iCategoryId = $this->pDatabase->selectValue(\"categories/get_id_by_name\", $this->iUserId, $sCategory);\n else\n $iCategoryId = 'NULL';\n \n //In case that any values are empty that shouldn't be empty\n if(($iVendorId=='NULL') && (strlen($sVendor)!=0)){ \n $this->addNew(\"vendors\",$sVendor); $bNewVendor=true;\n }\n if(($iCategoryId=='NULL') && (strlen($sCategory)!=0)){ \n $this->addNew(\"categories\",$sCategory); $bNewCategory=true;\n }\n if(($iAccountId=='NULL') && (strlen($sAccount)!=0)){ \n $this->addNew(\"accounts\",$sAccount); $bNewAccount=true;\n }\n \n \n \n //Add the transaction to the databse.\n $sTransactionId = $this->pDatabase->insert(\"transactions/add\", \"transactions\", $this->iUserId, $iVendorId, $iAccountId, $iCategoryId, $sDate, $iDebit, $iFixed, $sAmount, $sNotes, $sEnteredOn);\n\n //If error adding the transaction then clean up and report error.\n if ($sTransactionId == null)\n {\n //If vendor, account or category was created then delete them.\n if ($bNewVendor) $this->pDatabase->delete(\"vendors/delete\", $this->iUserId, $iVendorId);\n if ($bNewAccount) $this->pDatabase->delete(\"accounts/delete\", $this->iUserId, $iAccountId);\n if ($bNewCategory) $this->pDatabase->delete(\"categories/delete\", $this->iUserId, $iCategoryId);\n \n return XML::serialize(true, \"addTransaction\", \"type\",\"ERROR\",\"id\", \"-1\");\n }\n\n //If transaction is within visible period then add it to the list add it to the sorted list.\n\n\n return XML::serialize(true, \"addTransaction\", \"type\",\"OK\", \"id\",$sTransactionId);\n }", "public function insertSalesOrderData($productArray,$total,$extraCharge,$tax,$grandTotal,$remark,$entryDate,$companyId,\t $ClientId,$jfId,$totalDiscounttype,$totalDiscount,$totalCgstPercentage,$totalSgstPercentage,$totalIgstPercentage,$documentArrayData,$headerData,$poNumber,$paymentMode,$invoiceNumber,$bankName,$checkNumber)\n\t{\n\t\t$mytime = Carbon\\Carbon::now();\n\t\t//database selection\n\t\t$database = \"\";\n\t\t$constantDatabase = new ConstantClass();\n\t\t$databaseName = $constantDatabase->constantDatabase();\n\t\t//get exception message\n\t\t$exception = new ExceptionMessage();\n\t\t$exceptionArray = $exception->messageArrays();\n\t\t//insert bill data\n\t\tDB::beginTransaction();\n\t\t$raw = DB::connection($databaseName)->statement(\"insert into sales_bill(\n\t\tproduct_array,\n\t\tinvoice_number,\n\t\ttotal,\n\t\ttotal_discounttype,\n\t\ttotal_discount,\n\t\ttotal_cgst_percentage,\n\t\ttotal_sgst_percentage,\n\t\ttotal_igst_percentage,\n\t\textra_charge,\n\t\ttax,\n\t\tgrand_total,\n\t\tremark,\n\t\tentry_date,\n\t\tcompany_id,\n\t\tclient_id,\n\t\tpo_number,\n\t\tpayment_mode,\n\t\tbank_name,\n\t\tcheck_number,\n\t\tis_salesorder,\n\t\tjf_id,\n\t\tcreated_at) \n\t\tvalues('\".$productArray.\"','\".$invoiceNumber.\"','\".$total.\"','\".$totalDiscounttype.\"','\".$totalDiscount.\"','\".$totalCgstPercentage.\"','\".$totalSgstPercentage.\"','\".$totalIgstPercentage.\"','\".$extraCharge.\"','\".$tax.\"','\".$grandTotal.\"','\".$remark.\"','\".$entryDate.\"','\".$companyId.\"','\".$ClientId.\"',\n\t\t'\".$poNumber.\"','\".$paymentMode.\"','\".$bankName.\"','\".$checkNumber.\"','ok','\".$jfId.\"','\".$mytime.\"')\");\n\t\tDB::commit();\n\t\t//update invoice-number\n\t\t$billModel = new BillModel();\n\t\t$invoiceResult = $billModel->updateInvoiceNumber($companyId);\n\t\tif(strcmp($invoiceResult,$exceptionArray['200'])!=0)\n\t\t{\n\t\t\treturn $invoiceResult;\n\t\t}\n\t\t//get sale-id\n\t\tDB::beginTransaction();\n\t\t$saleId = DB::connection($databaseName)->select(\"SELECT \n\t\tmax(sale_id) as sale_id,\n\t\tproduct_array,\n\t\tpayment_mode,\n\t\tbank_name,\n\t\tinvoice_number,\n\t\tjob_card_number,\n\t\tcheck_number,\n\t\ttotal,\n\t\ttotal_discounttype,\n\t\ttotal_discount,\n\t\ttotal_cgst_percentage,\n\t\ttotal_sgst_percentage,\n\t\ttotal_igst_percentage,\n\t\textra_charge,\n\t\ttax,\n\t\tgrand_total,\n\t\tadvance,\n\t\tbalance,\n\t\tpo_number,\n\t\tremark,\n\t\tentry_date,\n\t\tsales_type,\n\t\tclient_id,\n\t\tcompany_id,\n\t\tjf_id,\n\t\tcreated_at,\n\t\tupdated_at\n\t\tFROM sales_bill where deleted_at='0000-00-00 00:00:00'\");\n\t\tDB::commit();\n\t\t$documentCount = count($documentArrayData);\n\t\tif($documentCount!=0)\n\t\t{\n\t\t\t//insert document data\n\t\t\tfor($documentArray=0;$documentArray<$documentCount;$documentArray++)\n\t\t\t{\n\t\t\t\tDB::beginTransaction();\n\t\t\t\t$raw = DB::connection($databaseName)->statement(\"insert into sales_bill_doc_dtl(\n\t\t\t\tsale_id,\n\t\t\t\tdocument_name,\n\t\t\t\tdocument_format,\n\t\t\t\tdocument_size,\n\t\t\t\tcreated_at)\n\t\t\t\tvalues('\".$saleId[0]->sale_id.\"','\".$documentArrayData[$documentArray][0].\"','\".$documentArrayData[$documentArray][2].\"','\".$documentArrayData[$documentArray][1].\"','\".$mytime.\"')\");\n\t\t\t\tDB::commit();\n\t\t\t}\n\t\t}\n\t\treturn $saleId;\n\t}", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "public function opdDueCollectInfo(Request $request)\n {\n $this->validate($request, [\n 'invoice' => 'required',\n 'total_due' => 'required',\n 'due_payment' => 'required',\n 'confirm_due_payment' => 'required',\n 'rebate' => 'required',\n 'tr_date' => 'required',\n ]);\n $invoice = trim($request->invoice);\n $due_payment = trim($request->due_payment);\n $confirm_due_payment = trim($request->confirm_due_payment);\n $rebate = trim($request->rebate);\n $confirm_bank_balance = trim($request->confirm_bank_balance);\n $remarks = trim($request->remarks);\n $tr_date = trim($request->tr_date);\n $trDate = date('Y-m-d',strtotime($tr_date)) ;\n $bill_tr_info = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->get();\n $total_payable = 0 ;\n $total_payment = 0 ;\n $total_discount = 0 ;\n $total_rebate = 0 ;\n foreach ($bill_tr_info as $bill_tr_info_value) {\n $total_payable = $total_payable + $bill_tr_info_value->total_payable ;\n $total_payment = $total_payment + $bill_tr_info_value->total_payment ;\n $total_discount = $total_discount + $bill_tr_info_value->total_discount ;\n $total_rebate = $total_rebate + $bill_tr_info_value->total_rebate ; \n }\n $all_discount_rebate = $total_discount + $total_rebate ;\n $net_payable_is = $total_payable - $all_discount_rebate ;\n $total_due = $net_payable_is - $total_payment ;\n if($trDate > $this->rcdate){\n Session::put('failed','Sorry ! Enter Invalid Date. Please Enter Valid Date And Try Again ');\n return Redirect::to('opdBillDueCollect');\n exit();\n }\n if($due_payment != $confirm_due_payment){\n Session::put('failed','Sorry ! Due Collect Amount And Confirm Due Collect Amount Did Not Match');\n return Redirect::to('opdBillDueCollect');\n exit();\n }\n // total amount sum\n $total_collect_amount_cal = $due_payment + $rebate ;\n if($total_due < $total_collect_amount_cal){\n Session::put('failed','Sorry ! Collect Amount + Rebate Amount Will Not Be Big Than Total Due Amount');\n return Redirect::to('opdBillDueCollect');\n exit();\n }\n // get bill info\n $bill_info = DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->first();\n $bill_date = $bill_info->bill_date ; \n $main_invoice_cashbbook_id = $bill_info->cashbook_id ;\n $main_opd_bill_id = $bill_info->id ;\n $opd_status = $bill_info->opd_status ;\n\n if($trDate < $bill_date){\n Session::put('failed','Sorry ! This Bill Create '.$bill_date.' So Due Collect Date Not Small Than It');\n return Redirect::to('opdBillDueCollect');\n exit();\n }\n if($rebate > 0){\n $purpose = \"OPD Due Collection With Rebate\" ;\n }else{\n $purpose = \"OPD Due Collection\";\n }\n // get opd status\n\n if($opd_status == '2'){\n $data_cashbook = array();\n $data_cashbook['overall_branch_id'] = $this->branch_id ;\n $data_cashbook['branch_id'] = $this->branch_id ;\n $data_cashbook['admin_id'] = $this->loged_id ;\n $data_cashbook['admin_type'] = 3 ;\n $data_cashbook['earn'] = $due_payment + $rebate ;\n $data_cashbook['cost'] = $rebate ;\n $data_cashbook['profit_cost'] = $rebate ;\n $data_cashbook['status'] = 11 ;\n $data_cashbook['tr_status'] = 1 ;\n $data_cashbook['purpose'] = $purpose;\n $data_cashbook['added_id'] = $this->loged_id;\n $data_cashbook['created_time'] = $this->current_time;\n $data_cashbook['created_at'] = $trDate;\n $data_cashbook['on_created_at'] = $this->rcdate;\n DB::table('cashbook')->insert($data_cashbook);\n #---------------------------------- END INSERT INTO CASHBOOK --------------------#\n #--------------------- GET LAST CASH BOOK ID -----------------------------------#\n $last_cashbook_id_query = DB::table('cashbook')->orderBy('id','desc')->limit(1)->first();\n $last_cashbook_id = $last_cashbook_id_query->id ;\n } \n #-------------------- GET LAST CASH BOOK ID --------------------------------------#\n\n if($opd_status == '2'){\n $cashbook_last_id = $last_cashbook_id ;\n }else{\n $cashbook_last_id = '0' ;\n }\n // get last tr id\n $last_tr_query = DB::table('opd_bill_transaction')->where('branch_id',$this->branch_id)->where('invoice_number',$invoice)->orderBy('invoice_tr_id','desc')->limit(1)->first();\n $last_tr_id = $last_tr_query->invoice_tr_id + 1 ;\n $branch_invoice_year_number = $last_tr_query->year_invoice_number ;\n $branch_daily_invoice_number = $last_tr_query->daily_invoice_number ;\n // insert pathology bill due collect\n $data_pathology_bill_tr_insert = array();\n $data_pathology_bill_tr_insert['cashbook_id'] = $cashbook_last_id ;\n $data_pathology_bill_tr_insert['opd_bill_id'] = $main_opd_bill_id ;\n $data_pathology_bill_tr_insert['branch_id'] = $this->branch_id ;\n $data_pathology_bill_tr_insert['invoice_number'] = $invoice;\n $data_pathology_bill_tr_insert['year_invoice_number'] = $branch_invoice_year_number;\n $data_pathology_bill_tr_insert['daily_invoice_number'] = $branch_daily_invoice_number;\n $data_pathology_bill_tr_insert['invoice_tr_id'] = $last_tr_id ;\n $data_pathology_bill_tr_insert['total_payment'] = $due_payment ;\n $data_pathology_bill_tr_insert['total_rebate'] = $rebate ;\n $data_pathology_bill_tr_insert['status'] = 1 ;\n $data_pathology_bill_tr_insert['added_id'] = $this->loged_id;\n $data_pathology_bill_tr_insert['tr_date'] = $trDate ;\n $data_pathology_bill_tr_insert['created_time'] = $this->current_time ;\n $data_pathology_bill_tr_insert['created_at'] = $this->rcdate;\n DB::table('opd_bill_transaction')->insert($data_pathology_bill_tr_insert);\n // insert into pettycash\n if($opd_status == '2'){\n $pettycash_amount = DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->limit(1)->first();\n $current_pettycash_amt = $pettycash_amount->pettycash_amount ;\n $now_pettycash_amt = $current_pettycash_amt + $due_payment ;\n // update pettycash amount\n $data_update_pettycash = array();\n $data_update_pettycash['pettycash_amount'] = $now_pettycash_amt; \n DB::table('pettycash')->where('branch_id',$this->branch_id)->where('type',3)->update($data_update_pettycash);\n }\n // update due status of main invoice\n if($total_collect_amount_cal < $total_due){\n $due_status_is = '2' ;\n }else{\n $due_status_is = '1' ;\n }\n $data_invoice_update = array();\n $data_invoice_update['due_status'] = $due_status_is ;\n DB::table('opd_bill')->where('branch_id',$this->branch_id)->where('invoice',$invoice)->update($data_invoice_update);\n return Redirect::to('printA4OpdBill/'.$invoice.'/'.$main_opd_bill_id);\n }", "function AfterAdd(&$values,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$bill_date=$values['bill_date'];\n$amount_bill=$values['amount'];\n$bill_no=$values['bill_no'];\n$item=$values['item'];\n$ProgramID = $values['ProgramID'];\n$BatchID = $values['BatchID'];\n\n//get related student according to intake , branch, and program\n$sql_student = \"select StudentID from student_info where DipID='$ProgramID' AND BatchID='$BatchID' AND Status='Active'\";\n$q_student = db_query($sql_student,$conn);\n\n//insert all program billing item to related student program bill\nwhile($row_student=db_fetch_array($q_student))\n{ \n$studentID=$row_student['StudentID'];\n$sql_insert=\"INSERT INTO student_billing (proid,date,amount,amount_balance,bill_no,item,studentID,status)\nVALUES ('$proid','$bill_date','$amount_bill','$amount_bill','$bill_no','$item','$studentID','Pending')\";\ndb_exec($sql_insert,$conn);\t\n}\n\n\n;\t\t\n}", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "protected function _afterAdd(KControllerContext $context)\n {\n $order = $context->result;\n\n // Salesreceipt data\n $salesreceipt = array(\n 'DocNumber' => $order->id,\n 'TxnDate' => date('Y-m-d'),\n 'CustomerRef' => $order->_account_customer_ref,\n 'CustomerMemo' => 'Thank you for your business and have a great day!',\n );\n\n if ($order->payment_method == ComRewardlabsModelEntityOrder::PAYMENT_METHOD_COD)\n {\n // COD payment\n $salesreceipt['DepartmentRef'] = $this->_department_ref; // Angono EC Valle store\n $salesreceipt['DepositToAccountRef'] = $this->_cod_payments_account; // COD payment processor account\n $salesreceipt['transaction_type'] = 'online'; // Customer ordered thru website\n }\n elseif ($order->payment_method == ComRewardlabsModelEntityOrder::PAYMENT_METHOD_DRAGONPAY)\n {\n // Online payment\n $salesreceipt['DepartmentRef'] = $this->_department_ref; // Angono EC Valle store\n $salesreceipt['DepositToAccountRef'] = $this->_online_payments_account; // Online payment processor account\n $salesreceipt['transaction_type'] = 'online'; // Customer ordered thru website\n }\n else\n {\n // Cash (in-store) purchase\n // $user = $this->getObject('user');\n // $employee = $this->getObject('com://site/rewardlabs.model.employeeaccounts')->user_id($user->getId())->fetch();\n \n $salesreceipt['DepartmentRef'] = $this->_department_ref; //$employee->DepartmentRef; // Store branch\n $salesreceipt['DepositToAccountRef'] = $this->_undeposited_account_ref; // Undeposited Funds Account\n $salesreceipt['transaction_type'] = 'offline'; // Order placed via onsite POS\n }\n\n // Shipping address\n $salesreceipt['ShipAddr'] = array(\n 'Line1' => $order->address,\n 'Line2' => $order->city,\n 'Line3' => $order->country\n );\n\n // Line items\n $lines = array();\n\n foreach ($order->getOrderItems() as $orderItem)\n {\n $lines[] = array(\n 'Description' => $orderItem->item_name,\n 'Amount' => ($orderItem->item_price * $orderItem->quantity),\n 'Qty' => $orderItem->quantity,\n 'ItemRef' => $orderItem->ItemRef,\n );\n }\n\n $shipping_cost = $order->shipping_cost;\n\n // Shipping charge line item\n if ($order->shipping_method && $shipping_cost)\n {\n // Delivery charge\n $lines[] = array(\n 'Description' => 'Shipping',\n 'Amount' => $shipping_cost,\n 'Qty' => $orderItem->quantity,\n 'ItemRef' => $this->_shipping_account,\n );\n }\n\n $salesreceipt['lines'] = $lines;\n\n $id = $this->getObject('com://admin/qbsync.service.salesreceipt')->create($salesreceipt);\n $order->SalesReceiptRef = $id;\n $order->save();\n }", "public function storledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date){\n //initialize $balance variable\n \n //checking if dueamount not = 0 to store supplier ledger\n $this->assetledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date);\n $this->liabilityledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date);\n $this->capitalledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date);\n $this->incomeledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date);\n $this->expensledger($account_id,$account_type2,$acc_type,$debit,$credit,$transection,$ref_id,$date);\n \n }", "function storeallpayment(){\n // $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n // $from = \"[email protected]\";\n // $to = \"[email protected]\";\n // // $to = \"[email protected]\";\n // $subject = 'Price Inquiry';\n // $message = $body;\n // $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n\n // mail($to,$subject,$message,$headers);\n\t$piece= implode(\",,,,\",$_SESSION['sale']);\n\t\t$products= implode(\",,,,\",$_SESSION['productDetail']['addtocart']);\n\t\t$userId = $_SESSION['userId'];\n\t\t// print_r($userId);die;\n\t\t$last_id = $this->db->query(\"SELECT ID FROM dbo.order_detail ORDER BY ID DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY\")->row();\n\t\t// print_r();die;\n\t\t$new_id = $last_id->ID +1;\n\t\tif(empty($userId) || $userId == 0){\n\t\t\t$userId = 0;\n\t\t\t$_SESSION['userId'] = 0;\n\t\t}\n\n\t$newstring = substr($_SESSION['payment']['cardnumber'], -4);\n\t$data = array(\n\t\t// \"ID\" =>$new_id,\n\t\t'guest_userid'=>$new_id,\n\t\t\"order_date\"=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\"ListID\"=>$products,\n\t\t\t\t\t\"UserId\"=>$userId,\n\t\t\t\t\t\"piece\"=>$piece,\n\t\t\t\t\t\"shippingfirstname\"=>$_SESSION['shipping']['firstname'],\n\t\t\t\t\t\"shippinglastname\"=>$_SESSION['shipping']['lastname'],\n\t\t\t\t\t\"shippingcompanyname\"=>$_SESSION['shipping']['companyname'],\n\t\t\t\t\t\"shippingareacode\"=>$_SESSION['shipping']['areacode'],\n\t\t\t\t\t\"shippingprimaryphone\"=>$_SESSION['shipping']['primaryphone'],\n\t\t\t\t\t\"shippingstreetadress\"=>$_SESSION['shipping']['streetadress'],\n\t\t\t\t\t\"shippingstate\"=>$_SESSION['shipping']['state'],\n\t\t\t\t\t\"shippingcity\"=>$_SESSION['shipping']['city'],\n\t\t\t\t\t\"shippingzipcode\"=>$_SESSION['shipping']['zipcode'],\n\t\t\t\t\t\"shippinghome\"=>$_SESSION['shipping']['home'],\n\t\t\t\t\t\"transactionId\"=>$_SESSION['shipping']['transactionId'],\n\t\t\t\t\t\"billingfirstname\"=>$_SESSION['payment']['firstname'],\n\t\t\t\t\t\"billinglastnames\"=>$_SESSION['payment']['lastnames'],\n\t\t\t\t\t\"billingareacodes\"=>$_SESSION['payment']['areacodes'],\n\t\t\t\t\t\"billingprimaryphone\"=>$_SESSION['payment']['primaryphone'],\n\t\t\t\t\t\"billingemail\"=>$_SESSION['payment']['email'],\n\t\t\t\t\t\"billingcompanys\"=>$_SESSION['payment']['companys'],\n\t\t\t\t\t\"billingstreetadd\"=>$_SESSION['payment']['streetadd'],\n\t\t\t\t\t\"billingsuite\"=>$_SESSION['payment']['suite'],\n\t\t\t\t\t\"billingstates\"=>$_SESSION['payment']['states'],\n\t\t\t\t\t\"billingcity\"=>$_SESSION['payment']['city'],\n\t\t\t\t\t\"billingzipcode\"=>$_SESSION['payment']['zipcode'],\n\t\t\t\t\t\"billingallpayment\"=>$_SESSION['payment']['allpayment'],\n\t\t\t\t\t\"paymenttype\"=>$_SESSION['payment']['paymenttype'],\n\t\t\t\t\t\"cardtype\"=>$_SESSION['payment']['cardtype'],\n\t\t\t\t\t\"cardholder\"=>$_SESSION['payment']['cardholder'],\n\t\t\t\t\t\"cardnumber\"=>$newstring,\n\t\t\t\t\t\"cardcvv\"=>$_SESSION['payment']['cardcvv'],\n\t\t\t\t\t\"cardmonth\"=>$_SESSION['payment']['cardmonth'],\n\t\t\t\t\t\"cardyear\"=>$_SESSION['payment']['cardyear'],\n\t\t\t\t\t\"allshipcharge\"=>$_SESSION['payment']['allshipcharge'],\n\t\t\t\t\t\"allmainpayment\"=>$_SESSION['payment']['allmainpayment'],\n\t\t\t);\n\t\tif(isset($_SESSION['shipping']['buisness'])){\n\t\t\t$data['buisness'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$data['buisness'] = 0;\n\t\t}\n\n\t\t$this->db->insert(\"dbo.order_detail\",$data);\n\t\t$_SESSION['insert_id'] = $this->db->insert_id();\n\t\t\t $order = $this->orderall();\n\n\t$body = \"<p>Thank you for placing your order with Global Fitness!</p>\n <p style=''>This email is to confirm your recent order.</p>\n <p> Date \".date('m/d/Y').\"</p>\n <p> Order Number : \".$order[0]->ID.\" </p>\n \";\n\n if($_SESSION['shipping']['home']!=2)\n {\n\t $body.=\"<p><b>Shipping address</b></p>\n\t\t <p>\".$_SESSION['shipping']['firstname'].\" \".$_SESSION['shipping']['lastname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['areacode'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['shipping']['companyname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['state'].\", \".$_SESSION['shipping']['city'].\" \".$_SESSION['shipping']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n }\n\n $body.=\"<p><b>Billing address</b></p>\n \t\t\t <p>\".$_SESSION['payment']['firstname'].\" \".$_SESSION['payment']['lastnames'].\"</p>\n \t\t\t <p>\".$_SESSION['payment']['areacodes'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['payment']['companys'].\"</p>\n\t\t <p>\".$_SESSION['payment']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['payment']['states'].\", \".$_SESSION['payment']['city'].\" \".$_SESSION['payment']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n\n\n\n\n\n for($i=0; $i<$_SESSION['productDetail']['count'];$i++){\n\t $product = $this->Site_model->productdetail($_SESSION['productDetail']['addtocart'][$i]);\n\t\tforeach($product as $live){\n\t\t\t$thisPrice = preg_replace('/[^A-Za-z0-9\\-(.)]/', '', $live->Price);\n\n\t\t\t $body.=\"<p style=''>\".$_SESSION['sale'][$i].\"x \".$live->ProductName.\" for $\".$thisPrice.\" each</p>\";\n\t\t}\n }\n\n\n\n\t$body.=\"<p style=''>Subtotal : $\".$_SESSION['payment']['allmainpayment'].\" USD</p>\n\n <p style=''>Shipping : $\".$_SESSION['payment']['allshipcharge'].\" USD</p>\";\n\n if($_SESSION['shipping']['home']==\"0\"){\n\t\t\t$body.=\"<p style=''>$300 USD White Glove Delivery</p>\";\n\t\t}\n\n $body.=\"<p style=''>Total : $\".$_SESSION['payment']['allpayment'].\" USD</p>\n <p> Please allow 1 - 2 business days to process through our warehouse. Please note that most U.S. orders ship within 3-7 business days from receipt unless contacted by our staff otherwise. </p><p><a href='\".base_url('site/orderall?orderID=').base64_encode($_SESSION['insert_id']).\"'>View Your Order Here.</a></p>\" ;\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n if (isset($_SESSION['email'])) {\n \t# code...\n \t$to = $_SESSION['email'];\n }else{\n \t$to = $_SESSION['payment']['email'];\n }\n // $cc =\"[email protected]\";\n $subject = 'Global Fitness Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n //$headers .= 'Bcc: '.$cc.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"[email protected]\";\n $to = \"[email protected]\";\n //$to =\"[email protected]\";\n $subject = 'Online Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\t\tunset($_SESSION['productDetail']);\n\t\tunset($_SESSION['sale']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t}", "public function getUnImportedLedgerData(){\n\n\t\t// GET SUPPLIER DATA\n\t\t$pendingSupplier = $this->getSupplierData(); \n\t\t// GET PENDING CUSTOMER DATA\n\t\t$pendingCustomer = $this->getCustomerData();\n\n\t\t$pendingData = array_merge($pendingSupplier, $pendingCustomer);\t\t\n\n\t\treturn $pendingData;\n\t}", "function credit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t$type = \"CREDIT\";\n\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='CREDIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)!=0) {\n\t\treturn; // there already is a credit for this txn_id\n\t}\n\n// check to make sure that there is a debit for this transaction\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)>0) {\n\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error());\n\t}\n\n\n}", "function payCheq($connection,$cheq_ref){\r\n\r\n //pay cheque\r\n $sql = \"SELECT accno ,debit,cheqto,cheq_amount FROM _transactionshistory WHERE check_ref=:cheq_ref AND cheqpaid=0 \";\r\n $stmt = $connection->prepare($sql);\r\n $stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n $row = $stmt->fetch();\r\n // echo $row['debit'];\r\n if($row['cheq_amount']>0){\r\n //deduct drawer amount debited + charges and update balance\r\n try {\r\n\r\n $connection->beginTransaction();\r\n //balance before debit and charges\r\n $balance = Services::getforAccountsBalance($connection,$row['accno']);\r\n $payee_sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $charges = Services::charges($row['cheq_amount']);\r\n $stmt = $connection->prepare($payee_sql);\r\n $stmt->execute(array(':balance'=>$balance-$row['cheq_amount']-$charges,':account'=>$row['accno']));\r\n\r\n //get account to pay to\r\n $payee_balSQL = \"SELECT balance FROM _accounts WHERE accno=:payee_acc\";\r\n $statement_p = $connection->prepare($payee_balSQL);\r\n\r\n $statement_p->execute(array(':payee_acc'=>$row['cheqto']));\r\n $payee_bal = $statement_p->fetch();\r\n\r\n //update payee account balance\r\n $update_accounts = \"UPDATE _accounts SET balance=:bala WHERE accno=:acc\";\r\n $up_stmt = $connection->prepare($update_accounts);\r\n $new_bal = $payee_bal['balance']+$row['cheq_amount'];\r\n $up_stmt->execute(array(':bala'=>$new_bal,':acc'=>$row['cheqto']));\r\n\r\n //record the transaction history\r\n $history_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:cancelled,:balance)\";\r\n $history_stmt = $connection->prepare($history_sql);\r\n $history_stmt->execute(array(':accno'=>$row['cheqto'],':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$row['cheq_amount'],\r\n ':check_ref'=>$cheq_ref,':cancelled'=>1,':balance'=>$new_bal));\r\n\r\n //record drawer transaction details for drawer\r\n $history_sql2 = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,charges,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:charges,:cancelled,:balance)\";\r\n $history_stmt2 = $connection->prepare($history_sql2);\r\n $history_stmt2->execute(array(':accno'=>$row['accno'],':date'=>date(\"Y/m/d\"),':debit'=>$row['cheq_amount'],':credit'=>0,\r\n ':check_ref'=>$cheq_ref,':charges'=>$charges,':cancelled'=>1,':balance'=>$balance-$row['cheq_amount']-$charges));\r\n\r\n\r\n //mark cheque as paid\r\n $t_sql = \"UPDATE _transactionshistory SET cheqpaid=1 WHERE check_ref=:cheq_ref\";\r\n $t_stmt = $connection->prepare($t_sql);\r\n $t_stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n // if($payee_sql->rowCount()<1 && $up_stmt->rowCount()<1 && $history_stmt->rowCount()<1 && $up_stmt->rowCount()<1){\r\n // $connection->rollBack();\r\n // return false;\r\n // }\r\n $connection->commit();\r\n\r\n return true;\r\n\r\n } catch (Exception $e) {\r\n $connection->rollBack();\r\n //echo \"Failed: \" . $e->getMessage();\r\n return false;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function InsertPedidoDetalle( $id_orden , $id_sucursal , $productos ,$nota_interna ,$estado_pedido ){\n date_default_timezone_set('America/El_Salvador');\n $date = date(\"Y-m-d H:m:s\");\n\n $total = 0;\n $shipping = 0;\n $subtotal = 0;\n $contadorTabla =1;\n $precio_minimo=0;\n\n foreach ($productos as $value) {\n \n foreach ($value as $demo) {\n\n $nodo = $this->nodoByProducto( $id_sucursal , $demo->id_producto );\n\n if($demo->ck =='true'){\n \n if($demo->precio_minimo !=0){\n $total = $demo->precio_minimo * $demo->cnt;\n //$subtotal += $demo->precio_minimo * $demo->cnt;\n }else{\n $total = $demo->numerico1 * $demo->cnt;\n //$subtotal += $demo->numerico1 * $demo->cnt;\n }\n \n $precio_minimo = $demo->precio_minimo;\n }else{\n //$subtotal += $demo->numerico1 * $demo->cnt;\n $total = $demo->numerico1 * $demo->cnt;\n $precio_minimo = 0;\n } \n $original = $demo->numerico1 ;//* $demo->cnt;\n\n $data = array(\n 'id_pedido' => $id_orden, \n 'id_producto' => $demo->id_producto,\n 'id_nodo' => $nodo[0]->nodoID, \n 'producto_elaborado'=> 0,\n 'precio_grabado' => $total,\n 'precio_original' => $original,\n 'cantidad' => $demo->cnt,\n 'llevar' => 0,\n 'pedido_estado' => $estado_pedido,\n 'nota_interna' => $nota_interna,\n 'estado' => 2,\n ); \n $this->db->insert(self::sys_pedido_detalle,$data); \n } \n }\n return 1; \n \n }", "public function store(Request $request)\n {\n $debts = new Debts();\n $debts->id_user=auth()->user()->id;\n $debts->creditCardOne=$request->input('creditCardOne');\n $debts->creditCardTwo=$request->input('creditCardTwo');\n $debts->creditCardThree=$request->input('creditCardThree');\n $debts->creditCardFour=$request->input('creditCardFour');\n $debts->loanOne=$request->input('loanOne');\n $debts->loanTwo=$request->input('loanTwo');\n $debts->loanThree=$request->input('loanThree');\n $debts->loanFour=$request->input('loanFour');\n $debts->other=$request->input('other');\n $debts->total=array_sum($request->all());\n $debts->save();\n\n return redirect('entertainment/create');\n\n }", "function Sell() {\n\t\t//Send cusName, ID, single price, quantity and current date\n\t\t//Generate a recipte number\n\t\tdate_default_timezone_set('Australia/Melbourne');\n\t\t$date = date('y/m/d', time());\n\t\t$customerName = $_POST['custName'];\n\t\t\n\t\trequire_once(\"settings.php\");\n\t\t$conn = @mysqli_connect($host, $user, $pwd, $dbname);\n\t\t\n\t\t$query = \"INSERT INTO receipts (customerName, orderDate) VALUES\n\t\t('$customerName', '$date');\";\n\t\t\n\t\tmysqli_query($conn, $query);\n\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t\n\t\t$query = \"SELECT receiptID FROM receipts\n\t\tORDER BY receiptID DESC LIMIT 1;\";\n\t\t\n\t\t$output = mysqli_query($conn, $query);\n\t\t$receiptID = mysqli_fetch_assoc($output)['receiptID'];\n\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t\n\t\tfor ($i = 0; $i < $_POST['txtLength'] + 0; $i++) {\n\t\t\t//echo \"<p>\", $i, \"</p>\";\n\t\t\t$id = $_POST[\"id_\" . $i];\n\t\t\t$quantity = $_POST['quantity_' . $i];\n\t\t\t$price = $_POST['price_' . $i];\n\t\t\t\n\t\t\t$query = \"INSERT INTO purchases (receiptID, itemID, quantity, price) VALUES\n\t\t\t($receiptID, $id, $quantity, $price);\";\n\t\t\t\n\t\t\tmysqli_query($conn, $query);\n\t\t\t\n\t\t\t//echo \"<p>\", $query, \"</p>\";\n\t\t}\n\t\t//Commit changes\n\t\tmysqli_query($conn, 'COMMIT;');\n\t\t\n\t\t//echo \"<p>Finish commit</p>\";\n\t}", "public function action_done()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n post_param_integer('confirm'); // Make sure POSTed\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), array('id' => $id, 'c_enabled' => 1), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $row = $rows[0];\n\n $cost = $row['c_cost'];\n\n $c_title = get_translated_text($row['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n // Check points\n $points_left = available_points(get_member());\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n if ($row['c_one_per_member'] == 1) {\n // Test to see if it's been bought\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('sales', 'id', array('purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details2' => strval($row['id']), 'memberid' => get_member()));\n if (!is_null($test)) {\n warn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n }\n }\n\n require_code('points2');\n charge_member(get_member(), $cost, $c_title);\n $sale_id = $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details' => $c_title, 'details2' => strval($row['id'])), true);\n\n require_code('notifications');\n $subject = do_lang('MAIL_REQUEST_CUSTOM', comcode_escape($c_title), null, null, get_site_default_lang());\n $username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $message_raw = do_notification_lang('MAIL_REQUEST_CUSTOM_BODY', comcode_escape($c_title), $username, null, get_site_default_lang());\n dispatch_notification('pointstore_request_custom', 'custom' . strval($id) . '_' . strval($sale_id), $subject, $message_raw, null, null, 3, true, false, null, null, '', '', '', '', null, true);\n\n $member = get_member();\n\n // Email member\n require_code('mail');\n $subject_line = get_translated_text($row['c_mail_subject']);\n if ($subject_line != '') {\n $message_raw = get_translated_text($row['c_mail_body']);\n $email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($member);\n $to_name = $GLOBALS['FORUM_DRIVER']->get_username($member, true);\n mail_wrap($subject_line, $message_raw, array($email), $to_name, '', '', 3, null, false, null, true);\n }\n\n // Show message\n $url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n return redirect_screen($title, $url, do_lang_tempcode('ORDER_GENERAL_DONE'));\n }", "private function transfer_data_part_2($transfer_data_part_2_array){\n\n\t\t$this->query(\"INSERT INTO `sold_products` SET `pro_id` = '$transfer_data_part_2_array[0]' , `count` = '$transfer_data_part_2_array[1]' , `name` = '$transfer_data_part_2_array[2]' , `email` = '$transfer_data_part_2_array[3]' , `address` = '$transfer_data_part_2_array[4]' , `mobile` = '$transfer_data_part_2_array[5]' , `total` = '$transfer_data_part_2_array[6]'\");\n\n\t}", "public function add_sales() {\r\n //var_dump($_POST); \r\n $is_retail = $this->input->post('hddn_is_retail');\r\n $total_amount = $this->input->post('txt_total_amount');\r\n $discount = $this->input->post('txt_discount');\r\n $net_amount = $total_amount - ($total_amount * $discount / 100);\r\n $data_set_skus = array();\r\n $data_set_books = array();\r\n $data_set_sales_books = array();\r\n $data_set_sales = array(\r\n 'total_amount' => $total_amount,\r\n 'discount' => $discount,\r\n 'total_paid' => $net_amount, //will change later if whole sale\r\n 'date_sold' => get_cur_date(),\r\n 'user_sold' => $this->session->userdata('user_id')\r\n );\r\n if(!$is_retail) {\r\n $data_set_sales['dealer_id'] = $this->input->post('lst_dealer_id');\r\n $data_set_sales['total_paid']= 0.00;\r\n }\r\n \r\n foreach($_POST as $key => $val) {\r\n if((boolean)preg_match(\"/hddn_sales_sku_/\", $key)) { //book is selected\r\n //set variables\r\n $book_id = $val;\r\n \r\n //add entries to arrays\r\n array_push($data_set_skus,$book_id);\r\n array_push($data_set_books,array(\r\n 'sku' => $book_id,\r\n 'last_sold' => get_cur_date(),\r\n 'cur_stock' => $this->input->post(\"hddn_quantity_sold_{$book_id}\") //the exisitng stock will be added\r\n ));\r\n array_push($data_set_sales_books,array(\r\n 'sales_id' => NULL, //will be set after adding the sales\r\n 'sales_sku' => $book_id,\r\n 'discount' => $this->input->post(\"hddn_discount_{$book_id}\"),\r\n 'list_price' => $this->input->post(\"hddn_list_price_{$book_id}\"),\r\n 'quantity_sold' => $this->input->post(\"hddn_quantity_sold_{$book_id}\")\r\n ));\r\n\r\n }//if\r\n }//for\r\n //var_dump($data_set_sales);\r\n //var_dump($data_set_sales_books);\r\n //var_dump($data_set_books);\r\n \r\n $this->db->trans_start();\r\n\r\n //get current stocks\r\n $fields = array('sku','cur_stock');\r\n $criteria_in = array('sku',$data_set_skus);\r\n $books = $this->book_model->get_books($fields,'','','','','','','','',$criteria_in);\r\n $books = $this->application->array_set_index($books,'sku');\r\n //var_dump($books);\r\n\r\n //update current stock\r\n for($i = 0; $i < count($data_set_books); $i++) {\r\n $data_set_books[$i]['cur_stock'] = $books[$data_set_books[$i]['sku']]['cur_stock'] - $data_set_books[$i]['cur_stock'];\r\n }\r\n //var_dump($data_set_books);\r\n \r\n //insert sales\r\n $sales_id = $this->sales_model->add_sale($data_set_sales);\r\n\r\n //insert sales id in to sales books\r\n for($i = 0; $i < count($data_set_sales_books); $i++) {\r\n $data_set_sales_books[$i]['sales_id'] = $sales_id ;\r\n }\r\n\r\n //insert sales books\r\n $this->sales_book_model->add_sales_books($data_set_sales_books);\r\n\r\n //update books/stock\r\n $criteria = 'sku';\r\n $this->book_model->update_books($data_set_books,$criteria);\r\n\r\n if($is_retail) {\r\n //insert financial\r\n $data_set_financial = array(\r\n 'trans_category' => 'sales',\r\n 'description' => \"Add retail sales: {$sales_id}\",\r\n 'amount' => $net_amount,\r\n 'date_made' => get_cur_date_time(),\r\n 'user_made' => $this->session->userdata('user_id')\r\n );\r\n $this->financial_model->add_transaction($data_set_financial);\r\n } else { //wholesale\r\n //update dealers debit\r\n $fields = array('debit_amount');\r\n $criteria = array('id' => $this->input->post('lst_dealer_id'));\r\n $dealer = $this->dealer_model->get_dealer($fields,$criteria);\r\n $data_set_dealer = array(\r\n 'debit_amount' => $dealer['debit_amount'] + $net_amount\r\n );\r\n $this->dealer_model->update_dealer($data_set_dealer,$criteria);\r\n }\r\n \r\n $this->db->trans_complete();\r\n\r\n $query_status = $this->db->trans_status();\r\n if($query_status) {\r\n\r\n //insert system log entry\r\n $description = \"Add sales: {$sales_id}.\";\r\n $this->application->write_log('sales', $description);\r\n \r\n //prepare notifications\r\n $url = site_url('reports/sales_invoice/'. $sales_id);\r\n if($is_retail) {\r\n $url .= '/1/' . $this->input->post('txt_payment');\r\n } else {\r\n $url .= '/0';\r\n }\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'success',\r\n 'notification_description' => \"The new sales is added successfully.&nbsp;&nbsp;<a href='{$url}' target='_blank' ><button type='button' class='btn btn-success btn-xs'>Print Sales Invoice</button></a>\"\r\n );\r\n\r\n } else {\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'error',\r\n 'notification_description' => 'Error terminated adding the new sales.'\r\n );\r\n }\r\n $this->session->set_flashdata($notification);\r\n redirect('sales');\r\n\r\n }", "public function postAddPartnerDiscount(Request $request){\n $partner_id = $request->partner_id;\n $description = $request->description;\n $value = $request->value;\n $lifetime = date_create_from_format('d/m/Y',$request->lifetime);\n if (intval($value) == 0){\n Session::flash('error', 'Значение должно быть целым числом');\n return redirect()->back(); \n }\n try {\n DB::table('ETKPLUS_PARTNER_DISCOUNTS')\n ->insert([\n 'partner_id' => $partner_id,\n 'value' => $value,\n 'description' => $description,\n 'lifetime' => $lifetime\n ]);\n Session::flash('success','Скидка успешно добавлена');\n return redirect()->back();\n\n } catch (Exception $e) {\n Session::flash('error',$e);\n return redirect()->back(); \n }\n }", "function UPDCAR()\n{\n $aropen_rows = db::fetchRows($sql, 'DTSDATA.AROPEN'); /* #539 */\n if ($aropen\n ) {\n if ($billpay->BPOIN_ < 0\n ) {\n $aropen->AROPPD += $billpay->BPPAY_; /* #544 */\n $aropen->ARONPD += $billpay->BPPAY_; /* #545 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #546 */\n $aropen->update(); /* #547 update record */\n $receipts->CRCID = $aropen->AROCID; /* #549 */\n $receipts->CRPER = $PERIOD; /* #550 */\n $receipts->CRCUST = $aropen->AROCUS; /* #551 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #552 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #553 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #554 */\n $receipts->CRINV_ = $aropen->AROINV; /* #555 */\n $receipts->CRTYPE = '1'; /* #556 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #557 */\n $receipts->CRGLDP = ''; /* #558 */\n $receipts->CRGLAC = ''; /* #559 */\n $receipts->CRDESC = ''; /* #560 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #561 */\n $receipts->CRDUS = 0; /* #562 */\n $receipts->CRSTCM = ''; /* #563 */\n $receipts->CRSTGL = ''; /* #564 */\n $receipts->CRSTS = ''; /* #565 */\n $receipts->CRDST = ''; /* #566 */\n $receipts->insert(); /* #567 insert record */\n } /* #568 end if */\n if ($billpay->BPOIN_ === 0\n && $billpay->BPPAY_ < 0\n && $billpay->BPPRV_ > 0\n ) {\n $billpay->BPPAY_ *= -1; /* #573 */\n $aropen->AROAMT += $billpay->BPPAY_; /* #574 */\n $aropen->ARONAM += $billpay->BPPAY_; /* #575 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #576 */\n $aropen->update(); /* #577 update record */\n $billpay->BPPAY_ *= -1; /* #579 */\n $receipts->CRCID = $aropen->AROCID; /* #580 */\n $receipts->CRPER = $PERIOD; /* #581 */\n $receipts->CRCUST = $aropen->AROCUS; /* #582 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #583 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #584 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #585 */\n $receipts->CRINV_ = $aropen->AROINV; /* #586 */\n $receipts->CRTYPE = '1'; /* #587 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #588 */\n $receipts->CRGLDP = ''; /* #589 */\n $receipts->CRGLAC = ''; /* #590 */\n $receipts->CRDESC = ''; /* #591 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #592 */\n $receipts->CRDUS = 0; /* #593 */\n $receipts->CRSTCM = ''; /* #594 */\n $receipts->CRSTGL = ''; /* #595 */\n $receipts->CRSTS = ''; /* #596 */\n $receipts->CRDST = ''; /* #597 */\n $receipts->insert(); /* #598 insert record */\n } /* #599 end if */\n if ($billpay->BPOIN_ === 0\n && $billpay->BPPAY_ > 0\n && $billpay->BPPRV_ < 0\n ) {\n $billpay->BPPAY_ *= -1; /* #604 */\n $aropen->AROAMT += $billpay->BPPAY_; /* #605 */\n $aropen->ARONAM += $billpay->BPPAY_; /* #606 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #607 */\n $aropen->update(); /* #608 update record */\n $billpay->BPPAY_ *= -1; /* #610 */\n $receipts->CRCID = $aropen->AROCID; /* #611 */\n $receipts->CRPER = $PERIOD; /* #612 */\n $receipts->CRCUST = $aropen->AROCUS; /* #613 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #614 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #615 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #616 */\n $receipts->CRINV_ = $aropen->AROINV; /* #617 */\n $receipts->CRTYPE = '1'; /* #618 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #619 */\n $receipts->CRGLDP = ''; /* #620 */\n $receipts->CRGLAC = ''; /* #621 */\n $receipts->CRDESC = ''; /* #622 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #623 */\n $receipts->CRDUS = 0; /* #624 */\n $receipts->CRSTCM = ''; /* #625 */\n $receipts->CRSTGL = ''; /* #626 */\n $receipts->CRSTS = ''; /* #627 */\n $receipts->CRDST = ''; /* #628 */\n $receipts->insert(); /* #629 insert record */\n } /* #630 end if */\n if ($billpay->BPOIN_ > 0\n ) {\n $aropen->AROPPD += $billpay->BPPAY_; /* #633 */\n $aropen->ARONPD += $billpay->BPPAY_; /* #634 */\n $aropen->AROPDT = $billpay->BPPDAT; /* #635 */\n $aropen->update(); /* #636 update record */\n $receipts->CRCID = $aropen->AROCID; /* #638 */\n $receipts->CRPER = $PERIOD; /* #639 */\n $receipts->CRCUST = $aropen->AROCUS; /* #640 */\n $receipts->CRSLMN = $aropen->AROSLM; /* #641 */\n $receipts->CRDTPD = $billpay->BPPDAT; /* #642 */\n $receipts->CRDTIN = $aropen->AROIDT; /* #643 */\n $receipts->CRINV_ = $aropen->AROINV; /* #644 */\n $receipts->CRTYPE = '1'; /* #645 */\n $receipts->CRCHCK = $billpay->BPCONF; /* #646 */\n $receipts->CRGLDP = ''; /* #647 */\n $receipts->CRGLAC = ''; /* #648 */\n $receipts->CRDESC = ''; /* #649 */\n $receipts->CRPPD = $billpay->BPPAY_; /* #650 */\n $receipts->CRDUS = 0; /* #651 */\n $receipts->CRSTCM = ''; /* #652 */\n $receipts->CRSTGL = ''; /* #653 */\n $receipts->CRSTS = ''; /* #654 */\n $receipts->CRDST = ''; /* #655 */\n $receipts->insert(); /* #656 insert record */\n } /* #657 end if */\n } /* #659 end if */\n}", "public function store(Request $request)\n {\n $user_id = $request->user_id;\n $status = $request->status;\n\n $new_expense = [];\n $new_expense['account_id'] = $request->account_id_source;\n $new_expense['paid_at'] = $request->paid_at;\n $new_expense['amount'] = $request->amount;\n $new_expense['description'] = $request->description;\n $new_expense['category_id'] = $request->category_id;\n $new_expense['reference'] = $request->reference;\n $new_expense['user_id'] = $user_id;\n $new_expense['status'] = $status;\n // $new_expense['supplier_id'] = $request->supplier_id;\n $new_expense['payment_method'] = $request->payment_method;\n $request_expense = new Request($new_expense);\n\n $new_revenue = [];\n $new_revenue['account_id'] = $request->account_id_destination;\n $new_revenue['paid_at'] = $request->paid_at;;\n $new_revenue['amount'] = $request->amount;\n $new_revenue['description'] = $request->description;\n $new_revenue['category_id'] = $request->category_id;\n $new_revenue['reference'] = $request->reference;\n $new_revenue['same_bank'] = 1;\n $new_revenue['user_id'] = $user_id;\n $new_revenue['status'] = $status;\n // $new_revenue['customer_id'] = $request->customer_id;\n $new_revenue['payment_method'] = $request->payment_method;\n $request_revenue = new Request($new_revenue);\n\n // var_dump($request_expense->all());\n // echo '<br><br>';\n // var_dump($request_revenue->all());\n\n // dd($nuevo->all());\n\n\n $transfer = $this->saveTransfer($request_revenue, $request_expense);\n\n\n if ($transfer[0] < 0) {\n Session::flash('message', $transfer[1]);\n Session::flash('alert-class', 'alert-error');\n return Redirect::back()->withInput();\n }\n\n Session::flash('message', trans('transfers.save_ok'));\n\n return redirect('banks/transfers');\n }", "public function store(Request $request)\n {\n // dd($request);\n $this->validate($request, [\n 'item.*' => 'required|string',\n 'item_description.*' => 'nullable|string',\n \n \n ]);\n \n \n $item = $request->item;\n $desc = $request->description;\n $priority = $request->priorities;\n $budgetid = $request->budget;\n $username = auth()->user()->name;\n $Amount = $request->Amount;\n $i=0;\n $tot = 0;\n\n foreach ($priority as $pr){\n $tot = $tot + $pr ;\n } \n // dd($item);\n try{\n foreach ($item as $it) {\n $itemAmount = ($priority[$i]/$tot)*$Amount;\n $BudgetDetails = [\n 'budget_id' => $budgetid,\n 'item' => $it,\n 'itemAmount'=>$itemAmount,\n 'item_description' => $desc[$i],\n 'priority' => $priority[$i],\n ];\n BudgetDet::create($BudgetDetails);\n $i++;\n }\n \n $BudgetInfo = [\n 'budget_id' => $budgetid,\n 'username' => $username,\n 'Amount'=>$Amount,\n ];\n\n Budget::insert($BudgetInfo);\n\n return back()->with('success', \"Budget Generated!\");\n }\n catch(\\Exception $e){\n // dd($e);\n $error_mssg = $e->getMessage(); \n dd($error_mssg); \n return back()->with('error', \"Something went wrong... unable to setup budget plan\");\n }\n }", "public function insertdata() {\n require(sett::classes.\"addto_webinvoice.php\");\n $add_to_db=new add_to_db;\n //add to ispcp\n $ispcpid=$add_to_db->ispcp($GLOBALS[\"data\"],$GLOBALS[\"DB1\"]);\n \n if($ispcpid!==false) {\n //variable\n $idval=$this->generate_id();\n //secret\n $key=$this->generate_secret();\n \n //add to local db\n $addtodb=$add_to_db->web_invoice($ispcpid,$idval,$key,$GLOBALS[\"data\"],$GLOBALS[\"DB0\"]);\n \n if($addtodb) {\n //get admin mail\n $email=$this->get_admin_mail();\n //start the send mail engine\n require(sett::classes.\"send_mail.php\");\n $send_mail=new send_mail;\n //send mail to buyer\n $mail0=$send_mail->buyer($ispcpid,$idval,$email,$key,$GLOBALS[\"l\"],$GLOBALS[\"data\"],$GLOBALS[\"server\"]);\n //send mail to reseller\n $mail1=$send_mail->reseller($ispcpid,$idval,$email,$GLOBALS[\"data\"],$GLOBALS[\"server\"]);\n //check and redirect\n if($mail0===true && $mail1===true) {\n unset($_SESSION[\"cart\"]);\n unset($GLOBALS[\"data\"]);\n unset($_SESSION[\"ca\"]);\n Header(\"Location:index.php?m=info&ok=1&msg=success\"); die;\n } else {\n Header(\"Location:index.php?m=info&ok=0&msg=mail\"); die;\n }\n } else {\n Header(\"Location:index.php?m=info&ok=0&msg=db\"); die;\n }\n } else {\n Header(\"Location:index.php?m=info&ok=0&msg=isp\"); die;\n }\n}", "function add_donation($donation,$tip,$token)\r\n {\r\n WEBPAGE::$dbh->query(sprintf(\"insert into tblLoansMasterSponsors (id,master_id,donation,tip,datetime,token) values ('null',%s,'%s','%s','%s','%s')\",\r\n $this->data['id'], $donation, $tip, gmdate(\"Y-m-d H:i:s\", time()), $token));\r\n $rised = current(current(WEBPAGE::$dbh->getAll(sprintf(\"select sum(donation) from tblLoansMasterSponsors where master_id = %s\",$this->data['id']))));\r\n if ($rised > $this->data['amount'])\r\n {\r\n WEBPAGE::$dbh->query(sprintf(\"delete from tblLoansMasterSponsors where token = '%s'\", $token));\r\n return false;\r\n }\r\n return true;\r\n }", "public function imprimirRegistrosDeDistribuidores() {\n $distribuidores = $this->db\n ->select('di_id,di_usuario,di_direita,di_esquerda')\n ->where('cb_data_hora >=', '2014-02-22')\n ->join('conta_bonus', 'cb_distribuidor=di_id')\n ->group_by('di_id')\n ->get('distribuidores')->result();\n\n $dataInicio = '2014-02-26';\n $dataFinal = '2014-04-08';\n\n $dias = $this->getArrayDias($dataInicio, $dataFinal);\n\n echo \"<table width='800px' cellpadding='5' border='1' cellspacing='0'>\";\n\n foreach ($distribuidores as $distribuidor) {\n echo \"<tr>\";\n echo \"<td colspan='4' style='color:blue'><br><br><b>\" . $distribuidor->di_usuario . \"</b></td>\";\n echo \"</tr>\";\n foreach ($dias as $dia) {\n $plPaga = $this->plFoiPaga($dia, $distribuidor->di_id);\n\n if ($plPaga) {\n foreach($plPaga as $k=> $plP){\n echo \"<tr>\";\n echo \"<td>\" . $this->dataPersonalizada($dia) . \"</td>\";\n echo \"<td>\" . $plP->cb_id . \"</td>\";\n echo \"<td>\" . $plP->cb_descricao . \"</td>\";\n echo \"<td>\" . $plP->cb_credito . \"</td>\";\n echo \"<td>p-\" . count($k+1) . \"</td>\";\n echo \"</tr>\";\n }\n } else {\n //new bonus_pl_nova($distribuidor, $dia);\n echo \"<tr>\";\n echo \"<td>\" . $this->dataPersonalizada($dia) . \"</td>\";\n echo \"<td>--</td>\";\n echo \"<td>--</td>\";\n echo \"<td>-,--</td>\";\n echo \"<td>-</td>\";\n echo \"</tr>\";\n }\n }\n }\n\n echo \"</table>\";\n }", "public function store(Request $request)\n {\n //dd($request->all());\n $this->validate($request,[\n\n 'customer_id'=>'required',\n 'payment_type'=>'required',\n 'subtotal'=>'required',\n 'payment'=>'required'\n ]);\n\n $saleItems = SaleTemp::all();\n //dd($saleItems);\n if(empty($saleItems->toArray())) {\n notify()->error(\"Please Add some Items to create sale!\",\"Error\");\n return back();\n }\n\n $sales = new Sale;\n $sales->customer_id = $request->customer_id;\n $sales->user_id = Auth::user()->id;\n $sales->payment_type = $request->payment_type;\n $discount = $request->discount;\n $discount_percent = $request->discount_percent;\n $subtotal = $request->subtotal;\n $sales->uuid = $this->realUniqId();\n \n\n $total_discount = $discount + ($discount_percent * $subtotal)/100;\n $sales->discount = $total_discount;\n $tax = $sales->tax = ($subtotal*0)/100;\n $total = $sales->grand_total = $subtotal + $tax - $total_discount;\n //insert payment data in the payment table\n $payment = $sales->payment = $request->payment;\n $dues= $sales->dues = $total - $payment;\n if ($dues > 0) {\n $sales->status = 0;\n } else {\n $sales->status = 1;\n }\n $sales->save();\n\n $customer = Customers::findOrFail($sales->customer_id);\n $customer->prev_balance = $customer->prev_balance + $sales->dues;\n $customer->update();\n if ($request->payment > 0) {\n $payment = new SalePayment;\n $paid = $payment->payment = $request->payment;\n $payment->dues = $total - $paid;\n $payment->payment_type = $request->payment;\n $payment->comments = $request->comments;\n $payment->sale_id = $sales->id;\n $payment->user_id = Auth::user()->id;\n $payment->save();\n }\n \n foreach ($saleItems as $value) {\n $saleItemsData = new SaleItem;\n $saleItemsData->sale_id = $sales->id;\n $saleItemsData->uuid = $sales->uuid;\n $saleItemsData->product_id = $value->product_id;\n $saleItemsData->cost_price = $value->cost_price;\n $saleItemsData->selling_price = $value->selling_price;\n $saleItemsData->quantity = $value->quantity;\n $saleItemsData->total_cost = $value->total_cost;\n $saleItemsData->total_selling = $value->total_selling;\n $saleItemsData->save(); \n //process inventory\n $products = Product::find($value->product_id);\n if ($products->type == 1) {\n $inventories = new Inventory;\n $inventories->product_id = $value->product_id;\n $inventories->user_id = Auth::user()->id;\n $inventories->in_out_qty = -($value->quantity);\n $inventories->remarks = 'SALE' . $sales->id;\n $inventories->save();\n //process product quantity\n $products->quantity = $products->quantity - $value->quantity;\n $products->save();\n } \n }\n\n //delete all data on SaleTemp model\n SaleTemp::truncate();\n $itemssale = SaleItem::where('sale_id', $saleItemsData->sale_id)->get();\n // notify()->success(\"You have successfully added sales!\",\"Success\");\n return view('sales.complete')\n ->with('sales', $sales)\n ->with('saleItemsData', $saleItemsData)\n ->with('saleItems', $itemssale);\n }", "public function add_exp_admin_payment_manual(){\n\t\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rental_booking_details= $this->review_model->get_unpaid_exp_commission_tracking($this->input->post('hostEmail'),$this->input->post('bookid'));\t\n\t\t\t$payableAmount = 0;\t\t\t\n\t\t\t$admin_currencyCode=$this->session->userdata('fc_session_admin_currencyCode');\n\t\t\t\n\t\t\tif(count($rental_booking_details) != 0)\n\t\t\t{ \n\t\t\t\tforeach($rental_booking_details as $rentals)\n\t\t\t\t{\n\t\t\t\t\t$currencyPerUnitSeller=$rentals['currencyPerUnitSeller'];\n\n\t\t\t\t\tif($rentals['currencycode']!=$admin_currencyCode){\n\t\t\t\t\t\tif(!empty($currencyPerUnitSeller))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$rentals['cancel_amount']=currency_conversion($rentals['currencycode'],$admin_currencyCode,$rentals['paid_cancel_amount'],$rentals['currency_cron_id']);//customised_currency_conversion($currencyPerUnitSeller,$rentals['paid_cancel_amount']);\n\t\t\t\t\t\t\t$cancel_amount_toGuest = $rentals['cancel_amount'];\n\t\t\t\t\t\t\t$re_payable=$cancel_amount_toGuest;\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$re_payable=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cancel_amount_toGuest = $rentals['paid_cancel_amount'];\n\t\t\t\t\t\t$re_payable=$cancel_amount_toGuest;\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$payableAmount = $re_payable;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t$dataArr = array(\n\t\t\t\t'customer_email'\t=>\t$this->input->post('balance_due'),\n\t\t\t\t'transaction_id'\t=>\t$this->input->post('transaction_id'),\n\t\t\t\t'amount'\t\t\t=> $payableAmount,\n\t\t\t\t'status'\t\t\t=> 2,\n\t\t\t\t'pay_status' \t\t=> 'paid'\n\t\t\t);\n\t\t\n\t\t\t$this->db->insert(CANCEL_PAYMENT_PAID,$dataArr);\n\t\t\t$this->db->update(EXP_COMMISSION_TRACKING, array('paid_canel_status'=>'1'), array('booking_no'=>$this->input->post('bookid')));\n\t\t\tredirect('admin/dispute/cancel_experience_booking_payment');\n\t\t}\n\t}" ]
[ "0.6507451", "0.62765795", "0.6050457", "0.5994779", "0.5991201", "0.58895457", "0.58572316", "0.5715127", "0.5711125", "0.5693986", "0.56718284", "0.56526047", "0.5636504", "0.560346", "0.55790955", "0.5576819", "0.5558392", "0.55525553", "0.5527979", "0.55150396", "0.54843223", "0.54813504", "0.54637176", "0.5445276", "0.5412246", "0.5387091", "0.5378874", "0.5377376", "0.536316", "0.53572273", "0.5357072", "0.53517866", "0.5335586", "0.5328934", "0.5321061", "0.5320205", "0.5317702", "0.5316597", "0.529219", "0.5287312", "0.52827054", "0.5272156", "0.52673066", "0.5265874", "0.5265728", "0.52656865", "0.5261803", "0.5257044", "0.5237906", "0.522489", "0.5217049", "0.5213525", "0.5209189", "0.5208991", "0.51918024", "0.5188974", "0.51831394", "0.5180578", "0.51701164", "0.51586556", "0.51547945", "0.5152471", "0.5129644", "0.51273227", "0.51090413", "0.5098841", "0.50985503", "0.5091286", "0.5088176", "0.5081656", "0.50793576", "0.5078932", "0.5077887", "0.5077083", "0.5072312", "0.50687087", "0.50584924", "0.50531673", "0.50528586", "0.5052816", "0.5052733", "0.5051957", "0.5047665", "0.5046721", "0.5045691", "0.5045491", "0.504113", "0.5038369", "0.50366354", "0.5034588", "0.5033369", "0.5028736", "0.50144976", "0.50143117", "0.5012481", "0.5002656", "0.4999073", "0.49977052", "0.49976045", "0.49966523" ]
0.5006355
95
CASH PAID API FOR CASH FLOW SUMMARY get all cash paid to suppliers details
public function getAllCashPaidInvoiceDetails(){ try { $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function getCreditRequests()\n {\n $search['q'] = request('q');\n\n $partner = auth()->user()->companies->first();\n\n $creditRequests = CreditRequest::search($search['q'])->with('quotation.user','user','credits')->paginate(10);\n\n return $creditRequests;\n /*$creditRequestsPublic = CreditRequest::search($search['q'])->where('public',1)->with('quotation.user','user','shippings')->get()->all();\n \n $creditRequestsPrivate = CreditRequest::search($search['q'])->where('public', 0)->whereHas('suppliers', function($q) use($partner){\n $q->where('shipping_request_supplier.supplier_id', $partner->id);\n })->get()->all();\n\n $creditRequests = array_collapse([$creditRequestsPublic, $creditRequestsPrivate]);\n\n // dd($creditRequests);\n \n \n $paginator = paginate($creditRequests, 10);\n \n return $paginator; */\n \n \n\n \n \n }", "public function getProviderCreditDetails($requestParameters = array());", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "public function getProductionCredits()\n {\n return $this->getFieldArray('508');\n }", "function ppt_resources_get_planned_delivered($data)\n{\n $year = date('Y');\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $user = user_load($uid);\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n } else {\n $countries = get_user_countries($user);\n }\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries, FALSE);\n }\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = $data['products'];\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid, FALSE, FALSE);\n } else {\n $products = get_target_products_for_accounts($accounts);\n }\n }\n\n $nodes = get_planned_orders_for_acconuts_per_year($year, $accounts);\n\n // Initialze empty months.\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n $final_arr = [];\n if (isset($nodes)) {\n // Consider a product exists with mutiple accounts.\n foreach ($nodes as $nid => $item) {\n $node = node_load($nid);\n $planned_product_tid = $node->field_planned_product[\"und\"][0][\"target_id\"];\n if (in_array($planned_product_tid, $products)) {\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n // Get node values for product (planned and delivered).\n if (isset($node->field_planned_period[\"und\"])) {\n $node_date = $node->field_planned_period[\"und\"][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity[\"und\"])) {\n $planned_quantity = $node->field_planned_quantity[\"und\"][0][\"value\"];\n }\n if (isset($node->field_planned_actual_period[\"und\"])) {\n $node_date = $node->field_planned_actual_period[\"und\"][0]['value'];\n $delivery_month = date(\"F\", strtotime($node_date));\n }\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity[\"und\"])) {\n $delivered_quantity = $node->field_planned_delivered_quantity[\"und\"][0][\"value\"];\n }\n // If product already exists, update its values for node months.\n if (isset($final_arr[$planned_product_name])) {\n if (isset($final_arr[$planned_product_name][\"Planned\"][$planned_month])) {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] = [(int) $planned_quantity];\n }\n if (isset($final_arr[$planned_product_name][\"Actual\"][$delivery_month])) {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr[$planned_product_name] = [\"Actual\" => [], \"Planned\" => []];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr[$planned_product_name][\"Actual\"][$month] = [0];\n $final_arr[$planned_product_name][\"Planned\"][$month] = [0];\n }\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n $final_arr[$planned_product_name][\"Planned\"][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n }\n // [product => [actual => [months], target => [months]]]\n return $final_arr;\n}", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "public function getCharges();", "public function get_suppliers_list()\n\t {\n\t \t$userId=$this->checklogin();\n\t \t$query=$this->ApiModel->get_suppliers_list($userId);\n\t \techo json_encode($query);\n\t }", "public function getCredits();", "public function getPraposalDeatils($param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $loanType = $param1;\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n $sales = MasterData::sales();\n $cities = MasterData::cities();\n $states = MasterData::states();\n $choosenSales = null;\n $userType = MasterData::userType();\n $industryTypes = MasterData::industryTypes(false);\n $businessVintage = MasterData::businessVintage();\n $degreeType = MasterData::degreeTypes();\n $choosenUserType = null;\n $loanApplicationId = null;\n $chosenproductType = null;\n $existingCompanyDeails = null;\n $existingCompanyDeailsCount = 0;\n $maxCompanyDetails = Config::get('constants.CONST_MAX_COMPANY_DETAIL');\n $newCompanyDeailsNum = $maxCompanyDetails - $existingCompanyDeailsCount;\n $salesAreaDetailId = null;\n $salesAreaDetails = null;\n $loansStatus = null;\n $loan = null;\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n $setDisable = null;\n $status = null;\n $user = null;\n $userProfile = null;\n $isRemoveMandatory = MasterData::removeMandatory();\n $promoterBackground = MasterData::degreeTypes();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n // $removeMandatory = $this->getMandatory($user);\n // dd($removeMandatory,$setDisable);\n $validLoanHelper = new validLoanUrlhelper();\n $setDisable = $this->getIsDisabled($user);\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'background');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n if (isset($loan)) {\n $salesAreaDetailId = $loan->id;\n }\n if (isset($salesAreaDetailId)) {\n $salesAreaDetails = SalesAreaDetails::where('loan_id', '=', $salesAreaDetailId)->first();\n }\n $user = User::find($loan->user_id);\n $userProfile = $user->userProfile();\n $model = $loan->getBusinessOperationalDetails()->get()->first();\n }\n\n \n $user = Auth::user();\n\n if (isset($user)) {\n $userID = $user->id;\n $userEmail = $user->email;\n $userProfile = $user->userProfile();\n $isSME = $user->isSME();\n }\n if (isset($userID)) {\n $mobileAppEmail = DB::table('mobile_app_data')->where('Email', $userEmail)\n ->where('status', 0)\n ->first();\n }\n if (isset($mobileAppEmail)) {\n $businessType = $mobileAppEmail->BusinessType;\n $mobileAppDataID = $mobileAppEmail->id;\n $mobileKeyProduct = $mobileAppEmail->KeyProduct;\n $mobileFirmRegNo = $mobileAppEmail->FirmRegNo;\n }\n $deletedQuestionsLoan = $this->getDeletedQuestionLoan($loan, $loanType, $amount);\n $deletedQuestionHelper = new DeletedQuestionsHelper($deletedQuestionsLoan);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n\n\n $existingPromoterKycDetails = PromoterKycDetails::where('loan_id', '=', $loanId)->get();\n\n }\n $userPr = UserProfile::where('user_id', '=', $userID);\n\n //echo $lastAuditedTurnover=$userPr->latest_turnover;\n // $userProfileFirm = UserProfile::with('user')->find($userID);\n //dd($loan->user_id);\n if (isset($loan->user_id)) {\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n\n\n\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n } else {\n $userProfileFirm = UserProfile::with('user')->find($userID);\n }\n @$praposalDetails=PraposalDetails::where('loan_id', '=', $loanId)->first();\n\n //dd($praposalDetails);\n //$praposalDetails->promoterBackground;\n\n $lastAuditedTurnover=$userProfileFirm->latest_turnover;\n $setDisable='';\n\n $formaction = 'Loans\\LoansController@postPraposal';\n $subViewType = 'loans._praposal';\n return view('loans.praposalCreditEdit', compact(\n 'formaction',\n 'subViewType',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'companySharePledged',\n 'bscNscCode',\n 'loan',\n 'salesAreaDetails',\n 'praposalDetails',\n 'comYourSalestype',\n 'othr_eduprofdegree',\n 'degreeType',\n 'comAnnualValueExport',\n 'loanId',\n 'loanApplicationId',\n 'sales',\n 'choosenSales',\n 'userType',\n 'pramoterDetails',\n 'choosenUserType', \n 'setDisable',\n 'deletedQuestionHelper',\n 'validLoanHelper',\n 'existingPromoterKycDetails',\n 'removeMandatory',\n 'businessVintage',\n 'promoterBackground',\n 'lastAuditedTurnover',\n 'userProfile',\n 'businessType',\n 'mobileAppDataID',\n 'userProfileFirm',\n 'mobileKeyProduct',\n 'mobileFirmRegNo',\n 'loanUserProfile',\n 'isSME',\n 'model'\n ));\n }", "public function getPraposalChecklist( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n $loan = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n }\n $loanType = null;\n \n $user = null;\n $userProfile = null;\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n\n\n }\n\n\n $states = MasterData::states();\n $choosenSales = null;\n $userType = MasterData::userType();\n $industryTypes = MasterData::industryTypes(false);\n $businessVintage = MasterData::businessVintage();\n $choosenUserType = null;\n $loanApplicationId = null;\n $chosenproductType = null;\n $existingCompanyDeails = null;\n $existingCompanyDeailsCount = 0;\n $maxCompanyDetails = Config::get('constants.CONST_MAX_COMPANY_DETAIL');\n $newCompanyDeailsNum = $maxCompanyDetails - $existingCompanyDeailsCount;\n\n $loansStatus = null;\n $loan = null;\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n $setDisable = null;\n $status = null;\n $user = null;\n $userProfile = null;\n $isRemoveMandatory = MasterData::removeMandatory();\n $entityTypes = MasterData::entityTypes();\n $chosenEntity = null;\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n // $removeMandatory = $this->getMandatory($user);\n // dd($removeMandatory,$setDisable);\n $validLoanHelper = new validLoanUrlhelper();\n $setDisable = $this->getIsDisabled($user);\n\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._checklist';\n $formaction = 'Loans\\LoansController@postPraposalChecklist';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n //PraposalChecklist\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n\n\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n\n $setDisable = '';\n $isRemoveMandatory = MasterData::removeMandatory();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'background');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n @$praposalChecklist=PraposalChecklists::where('loan_id', '=', $loanId)->first();\n @$promoterDetails=PromoterDetails::where('loan_id', '=', $loanId)->first();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'praposalChecklist',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'promoterDetails',\n 'formaction',\n 'removeMandatory ',\n 'bl_year',\n 'businessVintage',\n 'setDisable',\n 'ratioBreachesDescrip',\n 'financialGroups',\n 'groupType',\n 'com_business_type',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'validLoanHelper',\n 'userProfileFirm',\n 'refreanceCheckDescription',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'typeofEntity'\n ));\n }", "public function pay_credit() {\r\n //var_dump($_POST);\r\n $agent_id = $this->input->post('hddn_agent_id');\r\n $amount = (float)$this->input->post('txt_amount_paid');\r\n $cheque_no = $this->input->post('txt_cheque_no');\r\n \r\n //retrieve purchases\r\n $fields = array(\r\n 'id AS purchase_id','total_paid',\r\n 'ROUND((total_amount-(total_amount*discount/100))-total_paid,2)AS purchase_credit'\r\n );\r\n $criteria = \"agent_id = '{$agent_id}' AND purchase_status = 'completed' AND ROUND(total_amount-(total_amount*discount/100),2) > total_paid\";\r\n $order_by = \"id ASC\";\r\n $purchases = $this->purchase_model->get_purchases($fields,$criteria,'','',$order_by);\r\n //var_dump($purchases);\r\n \r\n //prepare data sets\r\n $data_set_agent = array(\r\n 'credit_amount' => (float)$this->input->post('hddn_credit_amount') - $amount\r\n );\r\n $data_set_financial = array(\r\n 'trans_category' => 'credit',\r\n 'description' => \"Pay credit : \" . $this->input->post('hddn_agent_name'),\r\n 'amount' => $amount,\r\n 'creditor_debtor_id' => $agent_id,\r\n 'income' => FALSE,\r\n 'date_made' => get_cur_date_time(),\r\n 'user_made' => $this->session->userdata('user_id'),\r\n );\r\n if($cheque_no !='') {\r\n $data_set_financial['cheque_no'] = $cheque_no;\r\n $data_set_financial['trans_status'] = 'pending';\r\n }\r\n $data_set_purchases = array();\r\n $data_set_payments = array();\r\n //process purchases\r\n $i = 0;\r\n while($i < count($purchases) && $amount > 0.00) {\r\n $purchase_credit = $purchases[$i]['purchase_credit'];\r\n $amount_paid = 0.00;\r\n if($purchase_credit > $amount) {\r\n $amount_paid = $amount;\r\n $amount = 0.00;\r\n } else {\r\n $amount_paid = $purchase_credit;\r\n $amount -= $amount_paid;\r\n }\r\n array_push($data_set_purchases,array(\r\n 'id' => $purchases[$i]['purchase_id'],\r\n 'total_paid' => $purchases[$i]['total_paid'] + $amount_paid\r\n ));\r\n array_push($data_set_payments,array(\r\n 'trans_id' => null,\r\n 'sales_purchase_id' => $purchases[$i]['purchase_id'],\r\n 'amount' => $amount_paid\r\n ));\r\n $i++;\r\n }//while\r\n //var_dump($data_set_agent);var_dump($data_set_financial);\r\n //var_dump($data_set_purchases);var_dump($data_set_payments);\r\n \r\n $this->db->trans_start();\r\n //insert financial\r\n $trans_id = $this->financial_model->add_transaction($data_set_financial);\r\n \r\n //insert trans id in to payments\r\n for($i = 0; $i < count($data_set_payments); $i++) {\r\n $data_set_payments[$i]['trans_id'] = $trans_id ;\r\n }\r\n //insert payments\r\n $this->payment_model->add_payments($data_set_payments);\r\n \r\n //update purchases\r\n $criteria = 'id';\r\n $this->purchase_model->update_purchases($data_set_purchases,$criteria);\r\n \r\n //update agent\r\n $criteria = array('id' => $agent_id);\r\n $this->agent_model->update_agent($data_set_agent,$criteria);\r\n \r\n $this->db->trans_complete();\r\n \r\n $query_status = $this->db->trans_status();\r\n if($query_status) {\r\n\r\n //insert system log entry\r\n $description = \"Pay credit:\" . $this->input->post('hddn_agent_name');\r\n $this->application->write_log('financial', $description);\r\n \r\n //prepare notifications\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'success',\r\n 'notification_description' => \"The credit is added successfully.\"\r\n );\r\n\r\n } else {\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'error',\r\n 'notification_description' => 'Error terminated adding the credit.'\r\n );\r\n }\r\n $this->session->set_flashdata($notification);\r\n redirect('financial/creditors_debtors');\r\n \r\n }", "public function get_credit($key = 0)\n {\n }", "public function payMultipleSuppliers($attributes);", "public function viewSupplies() {\n\t\t//SQL\n\t\t$servername = \"localhost\";\n\t\t$username = \"root\";\n\t\t$password = \"\";\n\t\t$dbname = \"a2Database\";\n\n\t\t// Create connection\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t\t// Check connection\n\t\tif ($conn->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t\t} \n\n\t\t$sql = \"SELECT * FROM supplies\";\n\t\t$result = $conn->query($sql);\n\n\t\tif ($result->num_rows > 0) {\n\t\t\t// output data of each row\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\techo \"<br>code: \" . $row[\"code\"]. \"<br> name: \" . $row[\"name\"]. \"<br> description: \" . $row[\"description\"] . \"<br> receiving_cost: \" . $row[\"receiving_cost\"] . \"<br> receiving_unit: \" . $row[\"receiving_unit\"] . \"<br> stocking_unit: \" . $row[\"stocking_unit\"] . \"<br> quantity: \" . $row[\"quantity\"] .\"<br>\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0 results\";\n\t\t}\n\t\t$conn->close();\n\t\t//SQL//\n\t}", "function get_contact_supplier_info($acc_s_id) {\n\t# Dim some Vars\n\t\tglobal $_DBCFG, $db_coin;\n\t\t$_cinfo = array(\"s_id\" => 0, \"s_name_first\" => '', \"s_name_last\" => '', \"s_company\" => '', \"s_email\" => '');\n\n\t# Set Query for select and execute\n\t\t$query\t = 'SELECT s_id, s_name_first, s_name_last, s_company, s_email FROM '.$_DBCFG['suppliers'];\n\t\t$query\t.= ' WHERE s_id='.$acc_s_id.' ORDER BY s_company ASC, s_name_last ASC, s_name_first ASC';\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\tIF ($db_coin->db_query_numrows($result)) {\n\t\t\twhile(list($s_id, $s_name_first, $s_name_last, $s_company, $s_email) = $db_coin->db_fetch_row($result)) {\n\t\t\t\t$_cinfo['s_id']\t\t= $s_id;\n\t\t\t\t$_cinfo['s_name_first']\t= $s_name_first;\n\t\t\t\t$_cinfo['s_name_last']\t= $s_name_last;\n\t\t\t\t$_cinfo['s_company']\t= $s_company;\n\t\t\t\t$_cinfo['s_email']\t\t= $s_email;\n\t\t\t}\n\t\t}\n\t\treturn $_cinfo;\n}", "public function getSuppliers($suppliers_id);", "public function paid()\n {\n $expenses = Expense::where(\"status\", 'verified')->orderBy('created_at', 'DESC')->get();\n $expenses->map(function ($expense) {\n return $expense->payment_account;\n });\n return response()->json($expenses);\n }", "public function getPLNPrepaidPricelist()\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n $priceArr = [];\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == 'PLN') {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + 2000;\n $last3DigitsCheck = substr($addedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $addedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $addedPrice + $check;\n }\n if ($check == 500) {\n $price = $addedPrice;\n }\n if ($check < 0) {\n $price = $addedPrice + (500 + $check);\n }\n\n if ($row['brand'] == 'PLN') {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = null; //placeholder\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Token PLN')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', 3);\n }", "public function getData()\n {\n $this->validate('amount', 'card', 'transactionId');\n $this->getCard()->validate();\n\n $data = array(\n 'apiOperation' => 'PAY',\n 'sourceOfFunds' => array(\n 'type' => 'CARD',\n 'provided' => array(\n 'card' => array(\n 'number' => $this->getCard()->getNumber(),\n 'expiry' => array(\n 'month' => $this->getCard()->getExpiryDate('m'),\n 'year' => $this->getCard()->getExpiryDate('y'),\n ),\n 'securityCode' => $this->getCard()->getCVV(),\n ),\n ),\n ),\n 'transaction' => array(\n 'amount' => $this->getAmount(),\n 'currency' => $this->getCurrency(),\n 'reference' => $this->getTransactionId(),\n ),\n 'order' => array(\n 'reference' => $this->getTransactionId(),\n ),\n 'customer' => array(\n 'ipAddress' => $_SERVER['REMOTE_ADDR'],\n ),\n );\n\n return $data;\n }", "function getTransactions() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"https://hackathon-be.mybluemix.net/customer/304fd2e19f1c14fe3345cca788e4e83d/amexprofitability\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "public function index()\n {\n // return config('app.cash_in_hand');\n return Purchase::with('user', 'vendor')->get();\n }", "function ppt_resources_target_delivered_report($data)\n{\n global $user;\n $current_uid = $user->uid;\n // Varriables\n $date = [];\n if (isset($data['year'])) {\n $date = get_year_dates($data['year']);\n } else {\n $date = get_year_dates();\n }\n if (!isset($data['reps']) && !isset($data['accounts']) && !isset($data['therapeutic'])) {\n if (!isset($data['year'])) {\n $date = get_year_dates();\n } else {\n $date = get_year_dates($data['year']);\n }\n $user_products = get_products_for_current_user($current_uid);\n $user_accounts = get_accounts_for_current_user($current_uid);\n return get_target_delivered_report($current_uid, $user_accounts, $user_products, $date);\n }\n if (is_comm_lead($user)) {\n if (isset($data['team']) && !isset($data['reps'])) {\n if (is_array($data['team'])) {\n $data['team'] = $data['team'][0];\n }\n $data['reps'] = array_keys(ppt_resources_get_team_reps($data));\n }\n }\n if (!$data['reps']) {\n return \"please enter reps\";\n } elseif (!$data['accounts']) {\n return \"please enter accounts\";\n } elseif (!$data['therapeutic']) {\n return \"please enter thermatic area\";\n } else {\n if (!is_array($data['accounts'])) {\n $data['accounts'] = [$data['accounts']];\n }\n if (!is_array($data['therapeutic'])) {\n $data['therapeutic'] = [$data['therapeutic']];\n }\n $account_info = node_load_multiple($data['accounts']);\n $account_products_ids = [];\n foreach ($account_info as $info) {\n $account_products_array = $info->field_products['und'];\n foreach ($account_products_array as $product) {\n $account_products_ids[] = $product['target_id'];\n }\n }\n $thermatic_area_products_ids = get_thermatic_area_products_ids($data[\"therapeutic\"]);\n if (isset($account_products_ids)) {\n foreach ($account_products_ids as $product_id) {\n if (isset($thermatic_area_products_ids)) {\n if (in_array($product_id, $thermatic_area_products_ids)) {\n $data['products'][] = $product_id;\n }\n } else {\n $data['products'] = [];\n }\n }\n } else {\n $data['products'] = [];\n }\n if (isset($data['products']) && !empty($data['products'])) {\n return get_target_delivered_report($data['reps'], $data['accounts'], $data['products'], $date);\n } else {\n return \"there is no product match for that account with therapeutic area\";\n }\n }\n}", "public function getTodayCashPaidInvoiceDetails(){\n\n $myDate = Carbon::now();\n $todayDate = $myDate->toDateString(); \n\n try {\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->where('cash_paid_to_suppliers.date','=',$todayDate)\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->where('cash_paid_to_suppliers.date','=',$todayDate)->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "function get_consumer_details() {\n\t\t$consumer_no = $_REQUEST['consumer_no'];\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\tif (!empty($consumer_no) && !empty($biller_id)) {\n\t\t\t$biller_in_id = 'biller_user.biller_customer_id_no';\n\t\t\t$records_consumer = $this -> conn -> join_two_table_where_two_field('biller_user', 'biller_details', 'biller_id', 'biller_id', $biller_in_id, $consumer_no, 'biller_user.biller_id', $biller_id);\n\n\t\t\tif (!empty($records_consumer)) {\n\t\t\t\t$biller_id = $records_consumer[0]['biller_id'];\n\t\t\t\t$biller_company = $records_consumer[0]['biller_company_name'];\n\t\t\t\t$biller_company_logo = biller_company_logo . $records_consumer[0]['biller_company_logo'];\n\t\t\t\t$biller_user_name = $records_consumer[0]['biller_user_name'];\n\t\t\t\t$biller_customer_id = $records_consumer[0]['biller_customer_id_no'];\n\t\t\t\t$bill_amount = $records_consumer[0]['bill_amount'];\n\t\t\t\t$bill_due_date = $records_consumer[0]['bill_due_date'];\n\t\t\t\t$biller_user_email = $records_consumer[0]['biller_user_email'];\n\t\t\t\t$biller_user_contact_no = $records_consumer[0]['biller_user_contact_no'];\n\t\t\t\t$bill_pay_status = $records_consumer[0]['bill_pay_status'];\n\t\t\t\t$bill_invoice_no = $records_consumer[0]['bill_invoice_no'];\n\t\t\t\t$current_date = date(\"Y-m-d\");\n\t\t\t\tif ($bill_due_date >= $current_date) {\n\t\t\t\t\tif ($bill_pay_status == '1') {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill already paid\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => 'true', \"biller_id\" => $biller_id, 'biller_company' => $biller_company, 'biller_logo' => $biller_company_logo, 'consumer_name' => $biller_user_name, 'consumer_id' => $biller_customer_id, 'bill_amount' => $bill_amount, 'due_date' => $bill_due_date, 'consumer_email' => $biller_user_email, 'consumer_contact_no' => $biller_user_contact_no, 'bill_pay_status' => $bill_pay_status, 'bill_invoice_no' => $bill_invoice_no);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill Paid date is expired\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Bill Found from this consumer no\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'consumer_no' => $consumer_no, 'biller_id' => $biller_id);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "public function getCustomOptionsOfProduct(Varien_Event_Observer $observer)\n{\n $invoice = $observer->getEvent()->getInvoice();\n$invoidData = $invoice->getData();\n//Mage::log($invoidData);\n$orderId = $invoidData['order_id'];\n$cid = $invoidData['customer_id'];\n$order1 = Mage::getModel('sales/order')->load($orderId);\n $Incrementid = $order1->getIncrementId();\n//Mage::log( $Incrementid.\"Order Id\"); \n\n// Assign Field To Inset Into CreditInfo Table\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); // Current TimeStamp\n\n$arr['c_id'] = $cid;//Customer Id\n$arr['store_view'] = Mage::app()->getStore()->getName(); //Storeview\n$arr['state'] = 1; //State Of Transaction\n$arr['order_id'] = $Incrementid; //OrderId\n$arr['action'] = \"Crdits\"; //Action\n$arr['customer_notification_status'] = 'Notified'; //Email Sending Status\n$arr['action_date'] = $nowdate; //Current TimeStamp\n$arr['website1'] = \"Main Website\"; //Website\n\nforeach ($invoice->getAllItems() as $item) {\n\n//Mage::log($item->getQty().\"Item Quntity\");\n\n$orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n$data = $orderItem->getData();\n$arr['action_credits'] = $data[0]['credits'] * $item->getQty();\n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$cid)->addFieldToFilter('website1','Main Website')->getLastItem();\n\n$totalcredits = $collection->getTotalCredits();\n$arr['total_credits'] = $arr['action_credits'] + $totalcredits;\n$arr['custom_msg'] = \"By User:For Purchage The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n$arr['item_id'] = $item->getOrderItemId();\n$table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n$table1->setData($arr);\ntry{\n if($arr['action_credits'] > 0)\n $table1->save();\n\n}catch(Exception $e){\n Mage::log($e);\n }\n\n}//end Foreach\n\n\n\n}", "public function get_all_supplier(){\n\n $connection= Yii::$app->db;\n $connection->open();\n $sql =\" CALL `store_get_supplier`(:PARAM_ITEM_CAT_CODE,:PARAM_Supplier_Code)\";\n $command = $connection->createCommand($sql); \n\n $command->bindValue(':PARAM_ITEM_CAT_CODE', 0);\n $command->bindValue(':PARAM_Supplier_Code', 0);\n\n $result=$command->queryAll();\n $connection->close();\n \n return $result; \n\t}", "function getPreferenceValues(){\n\n\t$checkoutPreferenceDataItems = new CheckoutPreferenceDataItems(); \n\t$checkoutPreferenceDataItems->setItemsId(isset($_GET['item_id'])&&trim($_GET['item_id'])!=\"\"?$_GET['item_id']:\"\");\n\t$checkoutPreferenceDataItems->setTitle(isset($_GET['item_title'])&&trim($_GET['item_title'])!=\"\"?$_GET['item_title']:\"\");\n\t$checkoutPreferenceDataItems->setDescription(isset($_GET['item_description'])&&trim($_GET['item_description'])!=\"\"?$_GET['item_description']:\"\");\n\t$checkoutPreferenceDataItems->setQuantity(isset($_GET['item_quantity'])&&trim($_GET['item_quantity'])!=\"\"?(int)$_GET['item_quantity']:\"\");\n\t$checkoutPreferenceDataItems->setUnitPrice(isset($_GET['item_unit_price'])&&trim($_GET['item_unit_price'])!=\"\"?(float)$_GET['item_unit_price']:\"\");\n\t$checkoutPreferenceDataItems->setCurrencyId( isset($_GET['item_currency_id'])&&trim($_GET['item_currency_id'])!=\"\"?$_GET['item_currency_id']:\"\");\n\t$checkoutPreferenceDataItems->setPictureUrl(isset($_GET['item_picture_url'])&&trim($_GET['item_picture_url'])!=\"\"?$_GET['item_picture_url']:\"\");\n\n\t$checkoutPreferenceDataPayer = new CheckoutPreferenceDataPayer(); \n\t$checkoutPreferenceDataPayer->setName(isset($_GET['payer_name'])&&trim($_GET['payer_name'])!=\"\"?$_GET['payer_name']:\"\");\n\t$checkoutPreferenceDataPayer->setSurname(isset($_GET['payer_surname'])&&trim($_GET['payer_surname'])!=\"\"?$_GET['payer_surname']:\"\");\n\t$checkoutPreferenceDataPayer->setEmail(isset($_GET['payer_email'])&&trim($_GET['payer_email'])!=\"\"?$_GET['payer_email']:\"\");\n\n\t$checkoutPreferenceDataBackUrls = new CheckoutPreferenceDataBackUrls(); \n\t$checkoutPreferenceDataBackUrls->setSuccessUrl(isset($_GET['back_urls_success'])&&trim($_GET['back_urls_success'])!=\"\"?$_GET['back_urls_success']:\"\");\n\t$checkoutPreferenceDataBackUrls->setPendingUrl(isset($_GET['back_urls_pending'])&&trim($_GET['back_urls_pending'])!=\"\"?$_GET['back_urls_pending']:\"\");\n\n\n\t$checkoutPreferenceDataPaymentMethods = new CheckoutPreferenceDataPaymentMethods(); \n\t\n\t$paymentMethods=explode(\",\",$_GET['payment_methods_exc_payment_methods']);\t\n\tfor($q=0; $q<sizeof($paymentMethods); $q++)\n\t{\n\t$checkoutPreferenceDataExcludedPaymentMethods = new CheckoutPreferenceDataExcludedPaymentMethods(); \n\t$checkoutPreferenceDataExcludedPaymentMethods->setExcludedPaymentMethodsId($paymentMethods[$q]);\n\t$checkoutPreferenceDataPaymentMethods->setExcludedPaymentMethods($checkoutPreferenceDataExcludedPaymentMethods);\n\tunset($checkoutPreferenceDataExcludedPaymentMethods);//free instance\n\t}\n\n\t$paymentTypes=explode(\",\",$_GET['payment_methods_exc_payment_types']);\n\tfor($w=0; $w<sizeof($paymentTypes); $w++)\n\t{\n\t$checkoutPreferenceDataExcludedPaymentTypes = new CheckoutPreferenceDataExcludedPaymentTypes(); \n\t$checkoutPreferenceDataExcludedPaymentTypes->setExcludedPaymentTypesId($paymentTypes[$w]);\n\t$checkoutPreferenceDataPaymentMethods->setExcludedPaymentTypes($checkoutPreferenceDataExcludedPaymentTypes);\t\n\tunset($checkoutPreferenceDataPaymentTypes);//free instance\n\t}\n\t$checkoutPreferenceDataPaymentMethods->setInstallments(isset($_GET['payment_methods_installments'])&&trim($_GET['payment_methods_installments'])!=\"\"?(int)$_GET['payment_methods_installments']:null);\n\n\t$checkoutPreferenceData = new CheckoutPreferenceData(); \n\t$checkoutPreferenceData->setExternalReference(isset($_GET['external_reference'])&&trim($_GET['external_reference'])!=\"\"?$_GET['external_reference']:\"\");\n\t$checkoutPreferenceData->setExpires(isset($_GET['expires'])&&trim($_GET['expires'])!=\"\"?$_GET['expires']:false); \n\t$checkoutPreferenceData->setItems($checkoutPreferenceDataItems);\n\t$checkoutPreferenceData->setPayer($checkoutPreferenceDataPayer);\t\n\t$checkoutPreferenceData->setBackUrls($checkoutPreferenceDataBackUrls);\n\t$checkoutPreferenceData->setPaymentMethods($checkoutPreferenceDataPaymentMethods);\n\t\t\t\n\treturn $checkoutPreferenceData;\n}", "public function purchasedBooks()\n { \n return $this->orders();\n }", "public function getDemand($id) {\n //$id -> idptmaster\n\n $data = array();\n //array(Yii::t('application', 'Propertytax'), 0, 0, 0, 4, 5, 8, 5),\n\n\n $criteria = new CDbCriteria(array(\n 'with' => array(\n 'idptmaster0' => array(\n 'condition' => 'idptmaster0.idptmaster =:idptmaster',\n 'params' => array(':idptmaster' => $id)\n ),\n ),\n 'condition' => 'idccfyear = :idccfyear',\n 'params' => array(':idccfyear' => Yii::app()->session['ccfyear']->idccfyear),\n ));\n\n\n $pttransaction = Pttransaction::model()->find($criteria);\n $status = 'Success';\n $message = '';\n $demandnumber = '';\n $demandinname = '';\n $demandamount = '0';\n $oldfddemandreceipts = array();\n $oldamountpaid = 0;\n\n// $propertytaxpaid = 0;\n// $minsamekittaxpaid = 0;\n//,propertytax,servicetax,minsamekittax,samekittax,waterpttax,educess,subcess1,subcess2,pttaxdiscount,pttaxsurcharge,\n//paid=0;$propertytaxpaid=0;$servicetaxpaid=0;$minsamekittaxpaid=0;$samekittaxpaid=0;$waterpttaxpaid=0;$educesspaid=0;$subcess1paid=0;$subcess2paid=0;$pttaxdiscountpaid=0;$pttaxsurchargepaid=0;$\n\n $propertytaxpaid = 0;\n $servicetaxpaid = 0;\n $minsamekittaxpaid = 0;\n $samekittaxpaid = 0;\n $waterpttaxpaid = 0;\n $educesspaid = 0;\n $subcess1paid = 0;\n $subcess2paid = 0;\n $pttaxdiscountpaid = 0;\n $pttaxsurchargepaid = 0;\n $amountpaid = 0;\n $discountpaid = 0;\n\n\n if (isset($pttransaction)) {\n\n $criteria = new CDbCriteria(array(\n 'condition' => 'demandnumber = :demandnumber',\n 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n ));\n $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n foreach ($fddemandreceipts as $fddemandreceipt) {\n $oldamountpaid += $fddemandreceipt->amountpaid;\n $oldfddemandreceipts[] = $fddemandreceipt;\n\n if (isset($fddemandreceipt->details)) {\n $jsonss = json_decode($fddemandreceipt->details, true);\n $array = array();\n foreach ($jsonss as $jsons) {\n $array[$jsons['name']] = $jsons['value'];\n }\n $propertytaxpaid += $array[\"details-inputgrid[0][amount]\"] + $array[\"details-inputgrid[0][discount]\"];\n $minsamekittaxpaid += $array[\"details-inputgrid[1][amount]\"] + $array[\"details-inputgrid[1][discount]\"];\n\n $samekittaxpaid += $array[\"details-inputgrid[2][amount]\"] + $array[\"details-inputgrid[2][discount]\"];\n $educesspaid += $array[\"details-inputgrid[3][amount]\"] + $array[\"details-inputgrid[3][discount]\"];\n\n $subcess1paid += $array[\"details-inputgrid[4][amount]\"] + $array[\"details-inputgrid[4][discount]\"];\n $subcess2paid += $array[\"details-inputgrid[5][amount]\"] + $array[\"details-inputgrid[5][discount]\"];\n \n $pttaxdiscountpaid += $array[\"details-inputgrid[6][amount]\"] + $array[\"details-inputgrid[6][discount]\"];\n $pttaxsurchargepaid += $array[\"details-inputgrid[7][amount]\"] + $array[\"details-inputgrid[7][discount]\"];\n $servicetaxpaid += $array[\"details-inputgrid[8][amount]\"] + $array[\"details-inputgrid[8][discount]\"];\n $waterpttaxpaid += $array[\"details-inputgrid[9][amount]\"] + $array[\"details-inputgrid[9][discount]\"];\n \n \n \n \n// for ($i = 0; $i < 10; $i++) {\n// $id = \"details-inputgrid[\" . $i . \"][amount]\";\n// $propertytaxpaid += $array[\"details-inputgrid[\" . $i . \"][amount]\"] + $array[\"details-inputgrid[\" . $i . \"][discount]\"];\n// }\n }\n }\n\n $data[] = array(\n Yii::t('application', 'Propertytax'),\n $pttransaction->oldpropertytax,\n $pttransaction->propertytax,\n $pttransaction->oldpropertytax + $pttransaction->propertytax,\n $propertytaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Minsamekittax'),\n $pttransaction->oldminsamekittax,\n $pttransaction->minsamekittax,\n $pttransaction->oldminsamekittax + $pttransaction->minsamekittax,\n $minsamekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Samekittax'),\n $pttransaction->oldsamekittax,\n $pttransaction->samekittax,\n $pttransaction->oldsamekittax + $pttransaction->samekittax,\n $samekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Educess'),\n $pttransaction->oldeducess,\n $pttransaction->educess,\n $pttransaction->oldeducess + $pttransaction->educess,\n $educesspaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess1'),\n $pttransaction->oldsubcess1,\n $pttransaction->subcess1,\n $pttransaction->oldsubcess1 + $pttransaction->subcess1,\n $subcess1paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess2'),\n $pttransaction->oldsubcess2,\n $pttransaction->subcess2,\n $pttransaction->oldsubcess2 + $pttransaction->subcess2,\n $subcess2paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxdiscount'),\n $pttransaction->oldpttaxdiscount,\n $pttransaction->pttaxdiscount,\n $pttransaction->oldpttaxdiscount + $pttransaction->pttaxdiscount,\n $pttaxdiscountpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxsurcharge'),\n $pttransaction->oldpttaxsurcharge,\n $pttransaction->pttaxsurcharge,\n $pttransaction->oldpttaxsurcharge + $pttransaction->pttaxsurcharge,\n $pttaxsurchargepaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Servicetax'),\n $pttransaction->oldservicetax,\n $pttransaction->servicetax,\n $pttransaction->oldservicetax + $pttransaction->servicetax,\n $servicetaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Waterpttax'),\n $pttransaction->oldwaterpttax,\n $pttransaction->waterpttax,\n $pttransaction->oldwaterpttax + $pttransaction->waterpttax,\n $waterpttaxpaid,\n 0,\n 0,\n 0,\n );\n\n\n\n\n// $status = 'Success';\n// \n// $criteria = new CDbCriteria(array(\n// 'condition' => 'demandnumber = :demandnumber',\n// 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n// ));\n// $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n// foreach($fddemandreceipts as $fddemandreceipt){\n// $oldamountpaid += $fddemandreceipt->amountpaid;\n// $oldfddemandreceipts[] = $fddemandreceipt;\n// }\n// \n// $grand_propertytax = \n// ($pttransaction->oldpropertytax+$pttransaction->oldservicetax+$pttransaction->oldminsamekittax+$pttransaction->oldsamekittax+$pttransaction->oldwaterpttax+$pttransaction->oldeducess+$pttransaction->oldsubcess1+$pttransaction->oldsubcess2-$pttransaction->oldpttaxdiscount+$pttransaction->oldpttaxsurcharge);\n// + \n// ($pttransaction->propertytax+$pttransaction->servicetax+$pttransaction->minsamekittax+$pttransaction->samekittax+$pttransaction->waterpttax+$pttransaction->educess+$pttransaction->subcess1+$pttransaction->subcess2)\n// ;\n }\n return $data;\n }", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "public function get_edit_suppliers_data()\n\t {\n\t \t$id=file_get_contents(\"php://input\");\n\t \t$data=$this->ApiModel->get_edit_suppliers_data($id);\n\t \techo json_encode($data);\n\n\t }", "function cp_do_view_supplier_bills($adata) {\n\t# Get security vars\n\t\t$_SEC \t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $db_coin, $_LANG, $_nl, $_sp;\n\n\t# Set Query parameters for select.\n\t\t$query\t = 'SELECT *';\n\t\t$_from\t.= ' FROM '.$_DBCFG['bills'].', '.$_DBCFG['suppliers'];\n\t\t$_where\t.= ' WHERE '.$_DBCFG['bills'].'.bill_s_id='.$_DBCFG['suppliers'].'.s_id';\n\t\t$_where\t.= ' AND '.$_DBCFG['bills'].'.bill_s_id='.$adata['s_id'];\n\t\t$_order\t.= ' ORDER BY '.$_DBCFG['bills'].'.bill_ts DESC';\n\n\t\tIF (!$_CCFG['IPL_SUPPLIERS'] > 0) {$_CCFG['IPL_SUPPLIERS'] = 5;}\n\t\t$_limit .= ' LIMIT 0, '.$_CCFG['IPL_SUPPLIERS'];\n\n\t# Get count of rows total:\n\t\t$query_ttl = 'SELECT COUNT(*)';\n\t\t$query_ttl .= $_from;\n\t\t$query_ttl .= $_where;\n\t\t$result_ttl\t= $db_coin->db_query_execute($query_ttl);\n\t\twhile(list($cnt) = $db_coin->db_fetch_row($result_ttl)) {$numrows_ttl = $cnt;}\n\n\t# Do select listing records and return check\n\t\t$query\t.= $_from.$_where.$_order.$_limit;\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\t$numrows\t= $db_coin->db_query_numrows($result);\n\n\t# Build form output\n\t#\t$_out .= '<br>'.$_nl;\n\t\t$_out .= '<div align=\"center\">'.$_nl;\n\t\t$_out .= '<table width=\"100%\" border=\"0\" bordercolor=\"'.$_TCFG['_TAG_TABLE_BRDR_COLOR'].'\" bgcolor=\"'.$_TCFG['_TAG_TRTD_BKGRND_COLOR'].'\" cellpadding=\"0\" cellspacing=\"1\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_TITLE\"><td class=\"TP3MED_NC\" colspan=\"8\">'.$_nl;\n\n\t\t$_out .= '<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_IT_TITLE_TXT\">'.$_nl.'<td class=\"TP0MED_NL\">'.$_nl;\n\t\t$_out .= '<b>'.$_LANG['_ADMIN']['Bills'];\n\t\t$_out .= ' ('.$numrows.$_sp.$_LANG['_ADMIN']['of'].$_sp.$numrows_ttl.$_sp.$_LANG['_ADMIN']['total_entries'].')</b><br>'.$_nl;\n\t\t$_out .= '</td>'.$_nl.'<td class=\"TP0MED_NR\">'.$_nl;\n\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\tIF ($numrows_ttl > $_CCFG['IPL_SUPPLIERS']) {\n\t\t\t\t$_out .= do_nav_link('mod.php?mod=bills&mode=view&bill_s_id='.$adata['s_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t}\n\t\t\t$_out .= do_nav_link('mod.php?mod=cc&mode=search&sw=bills', $_TCFG['_S_IMG_SEARCH_S'],$_TCFG['_S_IMG_SEARCH_S_MO'],'','');\n\t\t} ELSE {\n\t\t\t$_out .= $_sp;\n\t\t}\n\t\t$_out .= '</td>'.$_nl.'</tr>'.$_nl.'</table>'.$_nl;\n\n\t\t$_out .= '</td></tr>'.$_nl;\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Id'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Status'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Date_Issued'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BC\">'.$_LANG['_ADMIN']['l_Date_Due'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BR\">'.$_LANG['_ADMIN']['l_Amount'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BR\">'.$_LANG['_ADMIN']['l_Balance'].'</td>'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BL\">'.$_LANG['_CCFG']['Actions'].'</td>'.$_nl;\n\t\t$_out .= '</tr>'.$_nl;\n\n\t# Process query results\n\t\tIF ($numrows) {\n\t\t\twhile ($row = $db_coin->db_fetch_array($result)) {\n\n\t\t\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.$row['bill_id'].'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.htmlspecialchars($row['bill_status']).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.dt_make_datetime($row['bill_ts'], $_CCFG['_PKG_DATE_FORMAT_SHORT_DT']).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NC\">'.dt_make_datetime($row['bill_ts_due'], $_CCFG['_PKG_DATE_FORMAT_SHORT_DT']).'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NR\">'.do_currency_format($row['bill_total_cost'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']).$_sp.$_sp.'</td>'.$_nl;\n\n\t\t\t# Show current bill balance\n\t\t\t\t$idata = do_get_bill_supplier_balance($adata['s_id'], $row['bill_id']);\n\t\t\t\t$_out .= '<td class=\"TP3SML_NR\">'.do_currency_format($idata['net_balance'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']).$_sp.'</td>'.$_nl;\n\t\t\t\t$_out .= '<td class=\"TP3SML_NL\"><nobr>'.$_nl;\n\t\t\t\tIF ($_CCFG['_IS_PRINT'] != 1) {\n\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=bills&mode=view&bill_id='.$row['bill_id'], $_TCFG['_S_IMG_VIEW_S'],$_TCFG['_S_IMG_VIEW_S_MO'],'','');\n\t\t\t\t\t$_out .= do_nav_link('mod_print.php?mod=bills&mode=view&bill_id='.$row['bill_id'], $_TCFG['_S_IMG_PRINT_S'],$_TCFG['_S_IMG_PRINT_S_MO'],'_new','');\n\t\t\t\t\tIF ($_PERMS['AP16'] == 1 || $_PERMS['AP08'] == 1) {\n\t\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=bills&mode=edit&bill_id='.$row['bill_id'], $_TCFG['_S_IMG_EDIT_S'],$_TCFG['_S_IMG_EDIT_S_MO'],'','');\n\t\t\t\t\t\t$_out .= do_nav_link('mod.php?mod=bills&mode=delete&stage=1&bill_id='.$row['bill_id'].'&invc_ts='.$row['invc_ts'].'&invc_status='.$row['invc_status'], $_TCFG['_S_IMG_DEL_S'],$_TCFG['_S_IMG_DEL_S_MO'],'','');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$_out .= '</nobr></td>'.$_nl;\n\t\t\t\t$_out .= '</tr>'.$_nl;\n\t\t\t}\n\t\t}\n\n\t# Show totals footer row\n\t\t$idata = do_get_bill_supplier_balance($adata['s_id'], 0);\n\t\t$_out .= '<tr class=\"BLK_DEF_ENTRY\">'.$_nl;\n\t\t$_out .= '<td class=\"TP3SML_BR\" colspan=\"4\">'.$_nl;\n\t\t$_out .= $_LANG['_SUPPLIERS']['l_Amount'].$_nl;\n\t\t$_out .= '</td><td class=\"TP3SML_BR\">'.$_nl;\n\t\t$_out .= do_currency_format($idata['total_cost'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']).$_sp.$_nl;\n\t\t$_out .= '</td><td class=\"TP3SML_BR\">'.$_nl;\n\t\t$_out .= do_currency_format($idata['net_balance'],1,0,$_CCFG['CURRENCY_DISPLAY_DIGITS_AMOUNT']).$_sp.$_nl;\n\t\t$_out .= '</td><td class=\"TP3SML_BL\">'.$_nl;\n\t\t$_out .= $_sp.$_nl;\n\t\t$_out .= '</td></tr>'.$_nl;\n\n\t\t$_out .= '</table>'.$_nl;\n\t\t$_out .= '</div>'.$_nl;\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return results\n\t\treturn $_out;\n}", "public function getCurrencies();", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receipt_date,\\'dd/mm/yyyy\\') AS \"Receipt Date\" \n\t\tFROM '.receipt_table .' re \n\t\tJOIN '.relationships_table.' r ON r.relationship_id=re.supplier_id \n\t\tWHERE re.receipt_id = '.$this->receipt_id;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptCommercial, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "public function getData() : array\n {\n $this->validate('amount', 'card');\n $card = $this->getCard();\n\n $data = [\n static::TIMESTAMP => gmdate('YmdHis'),\n static::MERCHANT_ID => $this->getMerchantId(),\n static::ACCOUNT => $this->getAccount(),\n static::ORDER_ID => $this->getTransactionId(),\n static::AMOUNT => (int)round($this->getAmount() * 100),\n static::CURRENCY => $this->getCurrency(),\n static::MERCHANT_RESPONSE_URL => $this->getReturnUrl(),\n static::AUTO_SETTLE_FLAG => true,\n static::HPP_VERSION => 2,\n static::HPP_CUSTOMER_EMAIL => $card->getEmail(),\n static::HPP_CUSTOMER_PHONENUMBER_MOBILE => $this->formattedPhoneNumber($card),\n static::HPP_BILLING_STREET1 => $card->getBillingAddress1(),\n static::HPP_BILLING_STREET2 => $card->getBillingAddress2(),\n static::HPP_BILLING_STREET3 => '',\n static::HPP_BILLING_CITY => $card->getBillingCity(),\n static::HPP_BILLING_STATE => $card->getBillingState(),\n static::HPP_BILLING_POSTALCODE => $card->getBillingPostcode(),\n static::HPP_BILLING_COUNTRY => $this->getCountry(\n $card->getBillingCountry(),\n 'numeric'\n ),\n static::HPP_SHIPPING_STREET1 => $card->getShippingAddress1(),\n static::HPP_SHIPPING_STREET2 => $card->getShippingAddress2(),\n static::HPP_SHIPPING_STREET3 => '',\n static::HPP_SHIPPING_CITY => $card->getShippingCity(),\n static::HPP_SHIPPING_STATE => $card->getShippingState(),\n static::HPP_SHIPPING_POSTALCODE => $card->getShippingPostcode(),\n static::HPP_SHIPPING_COUNTRY => $this->getCountry(\n $card->getShippingCountry(),\n 'numeric'\n ),\n static::HPP_ADDRESS_MATCH_INDICATOR => false,\n static::HPP_CHALLENGE_REQUEST_INDICATOR => 'NO_PREFERENCE',\n ];\n\n $data['SHA1HASH'] = $this->createSignature($data, 'sha1');\n\n return $data;\n }", "public function getCredit()\n {\n $url = str_replace(\"[:action]\", \"credits\", self::ImgUrAPI_DEFAULT_URL);\n $result = self::excuteHTTPSRequest($url, null, null);\n return isset($result['data']) && $result['data'] == true && $result['success'] ? $result['data'] : null;\n }", "public function getBilling();", "public function actionPending_revenue() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('pending_revenue')) {\n return $this->redirect(['site/index']);\n }\n\n $dataService = $this->quickbook_instance();\n $courses_from_qb = $dataService->Query(\"SELECT * FROM Item\");\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $user = Yii::$app->user->identity;\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n $data = Yii::$app->request->post();\n\n $filter_data = array();\n $by_team_arr = array();\n $month_year_arr = array();\n $all_invoice_of_customer = array();\n $allInvoices = array();\n $allPayments = array();\n\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n\n if ($data) {\n\n if ($user_role == 33) {\n $this->pending_revenue_manager_filter();\n } else {\n $first_date_of_current_month = date(\"Y-m-01\"); /* Default Start Date for filter. Current month First date */\n $last_date_of_current_month = date(\"Y-m-t\"); /* Default End Date for filter. Current month Last date */\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $user_id = $data['sales_user_id'];\n } else {\n $user_id = $user->id;\n }\n\n if ($user_role == 7) {\n $filters = [];\n } else if ($user_role == 6) {\n $filters = ['sales_user_id' => $data['sales_user_id']];\n } else if ($user_role == 1) {\n $filters = [];\n } else {\n $filters = ['sales_user_id' => $user_id];\n }\n\n $team_ids = array();\n if (isset($data['email']) && $data['email'] != '') {\n $filter_data['email'] = $data['email'];\n }\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n\n $new_date = explode('_', $data['bymonth']);\n $fyear = $new_date['1'];\n $fmonth = $new_date['0'];\n\n if ($fmonth <= 9 && strlen($fmonth) == 1) {\n $fmonth = \"0\" . $fmonth;\n }\n $first_date_of_current_month = date(\"$fyear-$fmonth-01\");\n $last_date_of_current_month = $lastday = date('Y-m-t', strtotime($first_date_of_current_month));\n } else if ($data['by_date_month'] == 'd') {\n $first_date_of_current_month = date(\"Y-m-d\", strtotime($data['sdate']));\n $last_date_of_current_month = date(\"Y-m-d\", strtotime($data['edate']));\n }\n\n $timestamp_of_first_date_of_month = strtotime($first_date_of_current_month);\n $timestamp_of_last_date_of_month = strtotime($last_date_of_current_month);\n\n $allInvoices = array();\n $qb_cust_id_arr = array();\n\n if ($user_role == 7) {\n \n } else if ($user_role == 6) {\n \n } else if ($user_role != 1) {\n $filter_data['sales_user_id'] = $user->id;\n }\n if (isset($data['by_date_month'])) {\n\n if ($user_role == 7) { /* If current user is not super admin */\n\n if (isset($data['byTeam']) && !empty($data['byTeam'])) {\n $by_team_arr['byTeam'] = $data['byTeam'];\n $byteam = $data['byTeam'];\n if (isset($data['sales_user_id']) && !empty($data['sales_user_id'])) {\n if (count($data['sales_user_id']) == 1 && empty($data['sales_user_id'][0])) {\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = $byteam \")->queryAll();\n $sales_head_str = \"\";\n if (!empty($team_model_val)) {\n foreach ($team_model_val as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str .= $byteam;\n $sales_head_str = rtrim($sales_head_str, \",\");\n\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n $sales_user_id_arr = $data['sales_user_id'];\n if (empty($data['sales_user_id'][0])) {\n $sales_user_id_arr[] = $data['byTeam'];\n }\n\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['in', 'sales_user_id', $sales_user_id_arr])->all();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n if (!empty($data['byTeam'])) {\n $team = $data['byTeam'];\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id = $team\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n }\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else {\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) )\")->queryAll();\n\n $combined_arr = array_merge($qb_id_from_us, $team_model_val);\n\n $qb_cust_id_str = \"\";\n\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $total_invoices = $dataService->Query(\"SELECT count(*) FROM Invoice\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $total_payments = $dataService->Query(\"SELECT count(*) FROM Payment\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n }\n } else if ($user_role == 6) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $data['sales_user_id']])->all();\n $by_team_arr['sales_user_id'] = $data['sales_user_id'];\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else if ($user_role != 1) { /* If current user is not super admin */\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice WHERE CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment WHERE CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else { /* If current user is super admin */\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n } else {\n if ($user_role == 7) { /* If current user is not super admin */\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT * FROM assist_participant WHERE sales_user_id IN (SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n } else {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n }\n }\n\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n if ($data['sdate'] != \"\" && $data['by_date_month'] == 'd') {\n $query = DvRegistration::find()\n ->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } elseif ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $query = DvRegistration::find()->where($filters)\n ->orderBy(['assist_participant.id' => SORT_DESC])\n ->andWhere($filter_data)\n ->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n\n $query->andWhere(['>', 'qb_customer_id', 0]);\n $query->groupBy(['email']);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 20]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n if ($data['bymonth'] != '' && $data['by_date_month'] == 'm') {\n $filter_data['bymonth'] = $data['bymonth'];\n }\n if ($data['by_date_month'] != '') {\n $filter_data['by_date_month'] = $data['by_date_month'];\n }\n\n if ($data['sdate'] != '' && $data['by_date_month'] == 'd') {\n $filter_data['sdate'] = $data['sdate'];\n $filter_data['edate'] = $data['edate'];\n }\n\n if ($data['email'] != \"\") {\n $filter_data['email'] = $data['email'];\n }\n\n if (isset($data['sales_user_id']) && $data['sales_user_id'] != \"\") {\n $filter_data['sales_user_id'] = $data['sales_user_id'];\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n\n $invoice_number = \"\";\n $total_of_all_currencys = array();\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n /* echo \"<pre>\";\n print_r($models);\n die; */\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'pagination' => $pagination,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'count' => $offset,\n 'total_count' => $count,\n 'filter_data' => $filter_data,\n 'by_team_arr' => $by_team_arr,\n 'allInvoices' => $allInvoices,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month,\n 'courses_from_qb' => $courses_from_qb\n ]);\n }\n } else {\n $usermeta_result = DvUserMeta::find()->where(['uid' => $user->id, 'meta_key' => 'role'])->one();\n $user_role = $usermeta_result->meta_value;\n if ($user_role == 1) {\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment MAXRESULTS $total_payments\");\n $qb_cust_id_arr = array();\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n $query = DvRegistration::find()->where(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 6) {\n $sales_heads = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users INNER JOIN assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.status = 1 AND assist_users.department = 1 AND assist_user_meta.meta_key = 'team' AND assist_user_meta.meta_value=$user->id\")->queryAll();\n $sales_heads_str = \"\";\n if (!empty($sales_heads)) {\n foreach ($sales_heads as $m_sales_head) {\n $sales_heads_str .= $m_sales_head['id'] . \",\";\n }\n }\n $sales_heads_str .= $user->id;\n $sales_heads_str = rtrim($sales_heads_str, \",\");\n\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_heads_str )\")->queryAll();\n\n $qb_cust_id_str = \"\";\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else if ($user_role == 7) {\n\n $team_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' \")->queryAll();\n\n $executive_model_val = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value IN(SELECT assist_user_meta.uid FROM assist_users join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' ) \")->queryAll();\n $team_model_val[]['uid'] = $user->id;\n $combined_sales_head_arr = array_merge($team_model_val, $executive_model_val);\n\n $sales_head_str = \"\";\n if (!empty($combined_sales_head_arr)) {\n foreach ($combined_sales_head_arr as $m_sales_head) {\n $sales_head_str .= $m_sales_head['uid'] . \",\";\n }\n }\n $sales_head_str = rtrim($sales_head_str, \",\");\n $qb_id_from_us = Yii::$app->db->createCommand(\"SELECT qb_customer_id FROM assist_participant WHERE sales_user_id IN ($sales_head_str)\")->queryAll();\n\n $combined_arr = $qb_id_from_us;\n\n $qb_cust_id_str = \"\";\n if (!empty($combined_arr)) {\n foreach ($combined_arr as $qb_ids) {\n if (!empty($qb_ids['qb_customer_id'])) {\n $qb_cust_id_str .= \"'\" . $qb_ids['qb_customer_id'] . \"',\";\n $qb_cust_id_arr[] = $qb_ids['qb_customer_id'];\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n /* echo \"<pre>\";\n print_r($all_invoice_of_customer);\n die; */\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n } else {\n $qb_id_from_us = DvRegistration::find()->select('qb_customer_id')->Where(['sales_user_id' => $user->id])->all();\n $qb_cust_id_str = \"\";\n\n if (!empty($qb_id_from_us)) {\n foreach ($qb_id_from_us as $qb_ids) {\n if (!empty($qb_ids->qb_customer_id)) {\n $qb_cust_id_str .= \"'\" . $qb_ids->qb_customer_id . \"',\";\n $qb_cust_id_arr[] = $qb_ids->qb_customer_id;\n }\n }\n $qb_cust_id_str = rtrim($qb_cust_id_str, \",\");\n $allInvoices = $dataService->Query(\"SELECT * FROM Invoice where CustomerRef IN($qb_cust_id_str) ORDER BY Id ASC MAXRESULTS $total_invoices\");\n $allPayments = $dataService->Query(\"SELECT * FROM Payment where CustomerRef IN($qb_cust_id_str) MAXRESULTS $total_payments\");\n }\n $qb_cust_id_arr = array();\n\n if (!empty($allInvoices)) {\n $all_invoice_of_customer = $allInvoices;\n foreach ($allInvoices as $key => $val) {\n $timestamp_due_date = strtotime($val->DueDate);\n $month_year_arr[date('m', $timestamp_due_date) . \"_\" . date('Y', $timestamp_due_date)] = date('M', $timestamp_due_date) . \" \" . date('Y', $timestamp_due_date);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n if ($val->Balance > 0) {\n $qb_cust_id_arr[] = $val->CustomerRef;\n }\n } else {\n unset($allInvoices[$key]);\n }\n }\n }\n\n $month_year_arr = array_unique($month_year_arr);\n\n $query = DvRegistration::find()->where(['sales_user_id' => $user->id])->andWhere(['!=', 'qb_customer_id', ''])->andWhere(['IN', 'qb_customer_id', $qb_cust_id_arr]);\n }\n $query->groupBy(['email']);\n $query->orderBy(['id' => SORT_DESC]);\n $total_model = $query->all();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n // echo \"in\"; die;\n // Start Get Total of different currency \n $invoice_number = \"\";\n $total_of_all_currencys = array();\n\n $invoice_balance = 0;\n\n foreach ($total_model as $value) {\n $total_invoice_amt = 0;\n $cnt_invoice = 0;\n if (!empty($all_invoice_of_customer)) {\n foreach ($all_invoice_of_customer as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $timestamp_due_date = strtotime($invoice->DueDate);\n if ($timestamp_due_date >= $timestamp_of_first_date_of_month && $timestamp_due_date <= $timestamp_of_last_date_of_month) {\n $total_invoice_amt += $invoice->TotalAmt;\n $invoice_number .= $invoice->DocNumber . \", \";\n }\n }\n }\n }\n\n\n $invoice_number = rtrim($invoice_number, \", \");\n if (!empty($allInvoices)) {\n foreach ($allInvoices as $invoice) {\n if ($value->qb_customer_id == $invoice->CustomerRef) {\n $currency_ref = $invoice->CurrencyRef;\n $invoice_balance += $invoice->Balance;\n\n if (array_key_exists($currency_ref, $total_of_all_currencys)) {\n $total_of_all_currencys[$currency_ref] = $total_of_all_currencys[$currency_ref] + $invoice->Balance;\n } else {\n $total_of_all_currencys[$currency_ref] = $invoice->Balance;\n }\n }\n } // End for (allInvoices)\n } // End if (allInvoices)\n } // End main for loop\n\n\n return $this->render('pending_revenue', [\n 'model' => $models,\n 'total_of_all_currencys' => $total_of_all_currencys,\n 'pagination' => $pagination,\n 'count' => $offset,\n 'total_count' => $count,\n 'allInvoices' => $allInvoices,\n 'courses_from_qb' => $courses_from_qb,\n 'all_invoice_of_customer' => $all_invoice_of_customer,\n 'allPayments' => $allPayments,\n 'month_year_arr' => $month_year_arr,\n 'last_date_of_current_month' => $last_date_of_current_month,\n 'first_date_of_current_month' => $first_date_of_current_month\n ]);\n }\n }", "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "public function index()\n {\n $supplier=Supplier::where('status',1)->get();\n return view('purchase.supplier_payment',compact('supplier'));\n }", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public static function getExport($purchases) {\n $lines = array();\n\n // create each line\n foreach ($purchases as $p) {\n\n // Purchase status must be 'OK'\n if ($p->status != 'OK') {\n continue;\n }\n\n $l = array();\n\n // Record type\n $l[] = $p->bookedby ? 'P' : 'O';\n\n // Tour ref\n $l[] = Admin::clean($p->code);\n\n // Bkg ref\n $l[] = Admin::clean($p->bookingref);\n\n // Surname\n $l[] = Admin::clean($p->surname, 20);\n\n // Title\n $l[] = Admin::clean($p->title, 12);\n\n // First names\n $l[] = Admin::clean($p->firstname, 20);\n\n // Address line 1\n $l[] = Admin::clean($p->address1, 25);\n\n // Address line 2\n $l[] = Admin::clean($p->address2, 25);\n\n // Address line 3\n $l[] = Admin::clean($p->city, 25);\n\n // Address line 4\n $l[] = Admin::clean($p->county, 25);\n\n // Post code\n $l[] = Admin::clean($p->postcode, 8);\n\n // Phone No\n $l[] = Admin::clean($p->phone, 15);\n\n // Email\n $l[] = Admin::clean($p->email, 50);\n\n // Start\n $l[] = Admin::clean($p->joining);\n\n // Destination\n $l[] = Admin::clean($p->destination);\n\n // Class\n $l[] = Admin::clean($p->class, 1);\n\n // Adults\n $l[] = Admin::clean($p->adults);\n\n // Children\n $l[] = Admin::clean($p->children);\n\n // OAP (not used)\n $l[] = '0';\n\n // Family (not used)\n $l[] = '0';\n\n // Meal A\n $l[] = Admin::clean($p->meala);\n\n // Meal B\n $l[] = Admin::clean($p->mealb);\n\n // Meal C\n $l[] = Admin::clean($p->mealc);\n\n // Meal D\n $l[] = Admin::clean($p->meald);\n\n // Comment - add booker on the front\n // Remove 1/2 spurious characters from comment\n $comment = strlen($p->comment) < 3 ? '' : $p->comment;\n if ($p->bookedby) {\n $bookedby = Admin::getInitials($p->bookedby) . ' ';\n } else {\n $bookedby = '';\n }\n $l[] = Admin::clean($bookedby . $comment, 39);\n\n // Payment\n $l[] = Admin::clean(intval($p->payment * 100));\n\n // Booking Date\n $fdate = substr($p->date, 0, 4) . substr($p->date, 5, 2) . substr($p->date, 8, 2);\n $l[] = Admin::clean($fdate);\n\n // Seat supplement\n $l[] = $p->seatsupplement ? 'Y' : 'N';\n\n // Card Payment\n $l[] = 'Y';\n\n // Action required\n $l[] = 'N';\n\n // make tab separated line\n $line = implode(\"\\t\", $l);\n $lines[] = $line;\n }\n\n // combine lines\n return implode(\"\\n\", $lines);\n }", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "function getPromoList()\n {\n return array(array('reason'=>'test_discount','amount'=>3.5));\n }", "private function getCompanyCredits ()\n {\n $content = Utils::getContent($this->_strUrl . \"companycredits\");\n\n // get the uls order\n $order = [];\n foreach ($content->find(\"#company_credits_content h4\") as $title) {\n $order[] = $title->attr(\"id\");\n }\n\n $ulList = $content->find(\"#company_credits_content ul\");\n\n // get the uls order\n foreach ($order as $pos => $type)\n {\n foreach ($ulList[$pos]->find(\"li\") as $company)\n {\n $a = $company->find(\"a\")[0];\n\n preg_match(\"/\\/company\\/co([0-9]+)\\?/\", $a->attr(\"href\"), $matches);\n\n if (isset($matches[1]) && !empty($matches[1]))\n {\n $basicData = [\n \"id\" => $matches[1],\n \"name\" => $a->text(),\n ];\n\n if ($type == \"distributors\")\n {\n // Hispano Foxfilms S.A.E. (2009) (Spain) (theatrical) => (2009) (Spain) (theatrical)\n $remainingText = str_replace($basicData[\"name\"], \"\", $company->text());\n\n preg_match(\"/\\(([0-9]{4})-?\\) \\(([A-Za-z0-9_.]+)\\) \\((?:theatrical|TV)\\)/\", $remainingText, $matches);\n\n if (!empty($matches)) {\n $basicData[\"year\"] = (int)$matches[1];\n $basicData[\"country\"] = $matches[2];\n $this->{$type}[] = $basicData;\n }\n } else {\n $this->{$type}[] = $basicData;\n }\n }\n }\n }\n }", "public function prescriptionsDataSummary()\n {\n $prescriptions = Prescription::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n $prescriptionBills = $prescriptions->whereIn('status', [Prescriptions::PENDING_PRESCRIPTION, Prescriptions::CONFIRMED_PRESCRIPTION])->count();\n $internalPrescriptions = $prescriptions->where('status', Prescriptions::NEW_PRESCRIPTION)->count();\n $paidPrescriptions = $prescriptions->where('status', Prescriptions::PAID_PRESCRIPTION)->count();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'total_prescriptions' => $prescriptions->count(),\n 'prescription_bills' => $prescriptionBills,\n 'internal_prescriptions' => $internalPrescriptions,\n 'paid_prescriptions' => $paidPrescriptions\n ]);\n }", "public function pay_bill_get(){\r\n if (!$this->pronet_model->pay_bill(1, '882332411098', '4999999999999999', '4521','12','2022')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function fetchCostData()\n {\n $finance_pid = $this->getSystemSetting('em-finance-pid');\n\n if (!isset($finance_pid))\n throw new \\Exception('Error: no finance Project ID has been passed');\n\n $custom_field = $this->fetchCustomField();\n\n $fields = array(\n 'module_name',\n 'stanford_module',\n 'module_description',\n 'actual_monthly_cost',\n 'maintenance_fee',\n $custom_field ?? ''\n );\n $params = array('project_id' => $finance_pid, 'return_format' => 'json', 'fields' => $fields, 'events' => 'modules_arm_1', 'filterLogic' => '[actual_monthly_cost] != 0');\n $result = json_decode(\\REDCap::getData($params), true);\n\n if ($result && array_key_exists($custom_field, $result[0]))\n return $this->transformMap($result); //Fetch task record\n else\n throw new \\Exception(\"No field by the name of $custom_field found\");\n }", "public function first(): ?\\SengentoBV\\CdiscountMarketplaceSdk\\Structs\\CdiscountSupplyOrderReport\n {\n return parent::first();\n }", "public function test_success_get_complete_pos_daily_cash_resume()\n {\n $response = $this->resumePosDailyCashService->getCompleteResumePosDailyCash();\n\n $this->assertArrayHasKey('opening_timestamp', $response);\n $this->assertArrayHasKey('opening_user', $response);\n $this->assertArrayHasKey('ingress_total', $response);\n $this->assertArrayHasKey('egress_total', $response);\n $this->assertArrayHasKey('estimated_cash_total', $response);\n $this->assertArrayHasKey('ingress_total_detail', $response);\n $this->assertArrayHasKey('initial_amount_cash', $response['ingress_total_detail']);\n $this->assertArrayHasKey('ingress_cash_movement_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_debit_card_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_credit_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_check_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_customer_credit_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('employee_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_debit_card_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_credit_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_check_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_employee_credit_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('egress_total_detail', $response);\n $this->assertArrayHasKey('egress_cash_movement_total', $response['egress_total_detail']);\n\n // Check sum totals\n $this->assertEquals($response['ingress_total'], (\n $response['ingress_total_detail']['initial_amount_cash'] + \n $response['ingress_total_detail']['ingress_cash_movement_total'] + \n $response['ingress_total_detail']['customer_sales_total'] + \n $response['ingress_total_detail']['employee_sales_total']\n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['customer_sales_total'], (\n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_check_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_customer_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['employee_sales_total'], (\n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_check_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_employee_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['egress_total'], (\n $response['egress_total_detail']['egress_cash_movement_total'] \n\n ));\n }", "public function json()\n\t{\n\t\t$order_data = array();\n\t\t/*\n\t\t\t\"rows\" => array(\n\t\t\t\t\"id\",\n\t\t\t\t\"item\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t\t\"amount\", \"price\",\n\t\t\t),\n\t\t\t\"items\" => array(\"id\", \"name\", \"amount\", \"price\", \"total\"),\n\t\t\t\t\"purveyances\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"company\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"company_section\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"weekdays\", \"time_from\", \"time_to\", \"days\"\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"purchaser\" => array(\n\t\t\t\t\"id\", \"name\",\n\t\t\t\t\"customers\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t*/\n\t\t\n\t\t$purchaser = obj($this->prop(\"purchaser\"));\n\t\tif (true || !$purchaser->is_saved())\n\t\t{\n\t\t\t// FIXME: Only temporarily!\n\t\t\t$__purchaser_id = users::is_logged_in() ? user::get_current_person() : null;\n\t\t\t$purchaser = obj($__purchaser_id, array(), crm_person_obj::CLID);\n\t\t}\n\t\t$order_data[\"purchaser\"] = array(\n\t\t\t\"id\" => $purchaser->id(),\n\t\t\t\"name\" => $purchaser->name(),\n\t\t\t\"customers\" => array(),\n\t\t);\n\t\tif ($purchaser->is_a(crm_person_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->company()->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t\t$order_data[\"purchaser\"][\"company\"] = $purchaser->company()->id();\n\t\t\t\n\t\t}\n\t\telseif ($purchaser->is_a(crm_company_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t}\n\t\t$customer_count = isset($customers) ? $customers->count() : 0;\n\t\tif ($customer_count > 0)\n\t\t{\n\t\t\tforeach ($customers->names() as $customer_id => $customer_name)\n\t\t\t{\n\t\t\t\t$order_data[\"purchaser\"][\"customers\"][$customer_id] = array(\n\t\t\t\t\t\"id\" => $customer_id,\n\t\t\t\t\t\"name\" => $customer_name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$order_data[\"rows\"] = array();\n\t\t$order_data[\"items\"] = array();\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$item_data = array(\n\t\t\t\t\"id\" => $row->prop(\"prod\"),\n\t\t\t\t\"name\" => $row->prop(\"prod_name\"),\n\t\t\t);\n\t\t\t$order_data[\"rows\"][$row->id()] = array(\n\t\t\t\t\"id\" => $row->id(),\n\t\t\t\t\"item\" => $item_data,\n\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\"buyer_rep\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"purveyance_company_section\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"planned_date\" => $row->prop(\"planned_date\"),\n\t\t\t\t\"planned_time\" => $row->prop(\"planned_time\"),\n\t\t\t);\n\n\t\t\tif (!isset($order_data[\"items\"][$item_data[\"id\"]]))\n\t\t\t{\n\t\t\t\t$item = obj($item_data[\"id\"]);\n\t\t\t\t$purveyance_data = array();\n\t\t\t\t$purveyances = $item->get_purveyances();\n\t\t\t\tif ($purveyances->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$purveyance = $purveyances->begin();\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] = array(\"company\" => array());\n\t\t\t\t\t\tif (is_oid($company_id = $purveyance->prop(\"company\")))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$company = obj($company_id, array(), crm_company_obj::CLID);\n\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"] = array(\n\t\t\t\t\t\t\t\t\"id\" => $company->id(),\n\t\t\t\t\t\t\t\t\"name\" => $company->get_title(),\n\t\t\t\t\t\t\t\t\"address\" => $company->get_address_string(),\n\t\t\t\t\t\t\t\t\"section\" => array(),\n\t\t\t\t\t\t\t\t\"sections\" => array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (is_oid($section_id = $purveyance->prop(\"company_section\")))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$section = obj($section_id, array(), crm_section_obj::CLID);\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"section\"] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section->id(),\n\t\t\t\t\t\t\t\t\t\"name\" => $section->name(),\n//\t\t\t\t\t\t\t\t\t\"address\" => $section->get_address_string(),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($company->get_sections()->names() as $section_id => $section_name)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"sections\"][] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section_id,\n\t\t\t\t\t\t\t\t\t\"name\" => $section_name,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] += array(\n\t\t\t\t\t\t\t\"weekdays\" => $purveyance->prop(\"weekdays\"),\n\t\t\t\t\t\t\t\"time_from\" => $purveyance->prop(\"time_from\"),\n\t\t\t\t\t\t\t\"time_to\" => $purveyance->prop(\"time_to\"),\n\t\t\t\t\t\t\t\"days\" => $purveyance->prop(\"days\")\n\t\t\t\t\t\t);\n\t\t\t\t\t} while ($purveyance = $purveyances->next());\n\t\t\t\t}\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]] = $item_data + array(\n\t\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\t\"total\" => $row->prop(\"price\") * $row->prop(\"items\"),\n\t\t\t\t\t\"purveyances\" => $purveyance_data,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"amount\"] += $row->prop(\"items\");\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"total\"] += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t\t}\n\t\t}\n\n\t\t$json = new json();\n\t\treturn $json->encode($order_data, aw_global_get(\"charset\"));\n\t}", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function action_done()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n post_param_integer('confirm'); // Make sure POSTed\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), array('id' => $id, 'c_enabled' => 1), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $row = $rows[0];\n\n $cost = $row['c_cost'];\n\n $c_title = get_translated_text($row['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n // Check points\n $points_left = available_points(get_member());\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n if ($row['c_one_per_member'] == 1) {\n // Test to see if it's been bought\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('sales', 'id', array('purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details2' => strval($row['id']), 'memberid' => get_member()));\n if (!is_null($test)) {\n warn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n }\n }\n\n require_code('points2');\n charge_member(get_member(), $cost, $c_title);\n $sale_id = $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details' => $c_title, 'details2' => strval($row['id'])), true);\n\n require_code('notifications');\n $subject = do_lang('MAIL_REQUEST_CUSTOM', comcode_escape($c_title), null, null, get_site_default_lang());\n $username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $message_raw = do_notification_lang('MAIL_REQUEST_CUSTOM_BODY', comcode_escape($c_title), $username, null, get_site_default_lang());\n dispatch_notification('pointstore_request_custom', 'custom' . strval($id) . '_' . strval($sale_id), $subject, $message_raw, null, null, 3, true, false, null, null, '', '', '', '', null, true);\n\n $member = get_member();\n\n // Email member\n require_code('mail');\n $subject_line = get_translated_text($row['c_mail_subject']);\n if ($subject_line != '') {\n $message_raw = get_translated_text($row['c_mail_body']);\n $email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($member);\n $to_name = $GLOBALS['FORUM_DRIVER']->get_username($member, true);\n mail_wrap($subject_line, $message_raw, array($email), $to_name, '', '', 3, null, false, null, true);\n }\n\n // Show message\n $url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n return redirect_screen($title, $url, do_lang_tempcode('ORDER_GENERAL_DONE'));\n }", "public function action()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('c_title', 'c_cost', 'c_one_per_member'), array('id' => $id, 'c_enabled' => 1));\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $c_title = get_translated_text($rows[0]['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n $cost = $rows[0]['c_cost'];\n $next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class, 'sub_id' => $id), '_SELF');\n $points_left = available_points(get_member());\n\n // Check points\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n return do_template('POINTSTORE_CUSTOM_ITEM_SCREEN', array('_GUID' => 'bc57d8775b5471935b08f85082ba34ec', 'TITLE' => $title, 'ONE_PER_MEMBER' => ($rows[0]['c_one_per_member'] == 1), 'COST' => integer_format($cost), 'REMAINING' => integer_format($points_left - $cost), 'NEXT_URL' => $next_url));\n }", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "function getDataByID($strDataID)\n{\n global $db;\n $tbl = new cGaConsumablePurchase();\n $dataEdit = $tbl->findAll(\"id = $strDataID\", \"\", \"\", null, 1, \"id\");\n $arrTemp = getEmployeeInfoByID($db, $dataEdit[$strDataID]['id_employee'], \"employee_id\");\n $arrResult['dataIdItem'] = $dataEdit[$strDataID]['id_item'];\n $arrResult['dataRequestDate'] = $dataEdit[$strDataID]['request_date'];\n $arrResult['dataItemAmount'] = $dataEdit[$strDataID]['item_amount'];\n $arrResult['dataRemark'] = $dataEdit[$strDataID]['remark'];\n $arrResult['dataConsPurchaseNo'] = $dataEdit[$strDataID]['consumable_purchase_no'];\n $arrResult['dataConsReqNo'] = $dataEdit[$strDataID]['id_consumable_request'];\n //foreach($arrTripCost[$dataDonation ['trip_type']\n return $arrResult;\n}", "public function testPaymentSecupayCreditcardsGetById()\n {\n if (isset(self::$creditCardTransactionId) && !empty(self::$creditCardTransactionId)) {\n try {\n $response = $this->api->paymentSecupayCreditcardsGetById(self::$creditCardTransactionId);\n } catch (ApiException $e) {\n print_r($e->getResponseBody());\n throw $e;\n }\n\n $this->assertInstanceOf(SecupayTransactionProductModel::class, $response);\n $this->assertEquals('payment.secupaycreditcards', $response->getObject());\n $this->assertEquals(self::$creditCardTransactionId, $response->getId());\n $this->assertNotEmpty($response->getTransId());\n $this->assertNotEmpty($response->getStatus());\n $this->assertEquals(self::$amount, $response->getAmount());\n $this->assertEquals(self::$currency, $response->getCurrency());\n $this->assertEmpty($response->getPurpose());\n $this->assertEquals(self::$orderId, $response->getOrderId());\n\n for ($i = 0; $i < 3; ++$i) {\n $this->assertEquals(self::$basket[$i], $response->getBasket()[$i]);\n $this->assertEquals(self::$basket[$i]->getItemType(), $response->getBasket()[$i]->getItemType());\n $this->assertEquals(self::$basket[$i]->getArticleNumber(), $response->getBasket()[$i]->getArticleNumber());\n $this->assertEquals(self::$basket[$i]->getQuantity(), $response->getBasket()[$i]->getQuantity());\n $this->assertEquals(self::$basket[$i]->getName(), $response->getBasket()[$i]->getName());\n $this->assertEquals(self::$basket[$i]->getModel(), $response->getBasket()[$i]->getModel());\n $this->assertEquals(self::$basket[$i]->getEan(), $response->getBasket()[$i]->getEan());\n $this->assertEquals(self::$basket[$i]->getTax(), $response->getBasket()[$i]->getTax());\n $this->assertEquals(self::$basket[$i]->getTotal(), $response->getBasket()[$i]->getTotal());\n $this->assertEquals(self::$basket[$i]->getPrice(), $response->getBasket()[$i]->getPrice());\n $this->assertEquals(self::$basket[$i]->getApikey(), $response->getBasket()[$i]->getApikey());\n $this->assertEquals(self::$basket[$i]->getTransactionHash(), $response->getBasket()[$i]->getTransactionHash());\n $this->assertEquals(self::$basket[$i]->getContractId(), $response->getBasket()[$i]->getContractId());\n }\n\n $this->assertEquals(1, $response->getTransactionStatus());\n $this->assertEquals(self::$accrual, $response->getAccrual());\n $this->assertEquals('sale', $response->getPaymentAction());\n $this->assertNotEmpty($response->getCustomer());\n $this->assertInstanceOf(PaymentCustomersProductModel::class, $response->getCustomer());\n $this->assertEquals('payment.customers', $response->getCustomer()->getObject());\n $this->assertEquals(self::$customerId, $response->getCustomer()->getId());\n $this->assertNotEmpty($response->getCustomer()->getCreated());\n $this->assertNotEmpty($response->getRedirectUrl());\n $this->assertNotEmpty($response->getRedirectUrl()->getIframeUrl());\n $this->assertNotEmpty($response->getRedirectUrl()->getUrlSuccess());\n $this->assertNotEmpty($response->getRedirectUrl()->getUrlFailure());\n }\n }", "public function getCourier_deliveries_list()\n {\n $sql = \"SELECT a.id, a.order_inv, a.c_driver, a.r_address, a.created, a.r_hour, a.status_courier, a.act_status, s.mod_style, s.color FROM consolidate a, styles s WHERE a.status_courier=s.mod_style AND a.c_driver = '\".$this->username.\"' AND a.act_status=1 ORDER BY a.id ASC\";\n $row = self::$db->fetch_all($sql);\n \n return ($row) ? $row : 0;\n }", "public function index()\n {\n $data = $this->Produit->get_by_client(auth()->user()->id);\n return $this->sendResponse($data, 'Produit list');\n }", "public function getDiscounts(): array;", "public function providerDiscountPurchases()\r\n\t{\r\n\t\t$appleProduct = $this->getAppleProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$lightProduct = $this->getLightProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\t\t$starshipProduct = $this->getStarshipProduct(self::PRODUCT_WITH_DISCOUNT_PRICE);\r\n\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\t7.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 7.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t5 * self::PRODUCT_LIGHT_PRICE + 8.0 * self::PRODUCT_APPLE_DISCOUNT_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($lightProduct, 5),\r\n\t\t\t\t\tnew ProductToPurchase($appleProduct, 8.0),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\t4 * self::PRODUCT_STARSHIP_PRICE,\r\n\t\t\t\tarray(\r\n\t\t\t\t\tnew ProductToPurchase($starshipProduct, 6)\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function getPrepaidPhoneCreditPricelist($operator_id, $type_id)\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n // switch operators\n $operator = 'TELKOMSEL';\n switch ($operator_id) {\n case 2:\n $operator = 'INDOSAT';\n break;\n case 3:\n $operator = 'XL';\n break;\n case 4:\n $operator = 'AXIS';\n break;\n case 5:\n $operator = 'TRI';\n break;\n case 6:\n $operator = 'SMART';\n break;\n }\n\n // switch type\n $type = 'Pulsa';\n if ($type_id == 2) {\n $type = 'Data';\n }\n\n // empty array to be filled with selected operator pricelist data\n $priceArr = [];\n $priceCallArr = []; //Placeholder Paket Telepon & SMS\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == $type) {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n\n if ($type_id == 2) {\n // Get Paket Telepon & SMS\n if ($row['category'] == 'Paket SMS & Telpon') {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceCallArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n }\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = collect($priceCallArr)->sortBy('price')->toArray();\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Isi Pulsa/Data')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', $type_id);\n }", "function GetCurrencies()\n\t{\n\t\t$result = $this->sendRequest(\"GetCurrencies\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function index()\n\t{\n\n return $this->currentUser()\n ->returnPurchase()\n\t\t\t->with('purchase', 'product', 'supplier')\n ->orderBy('created_at', 'DESC')\n ->get()\n ->toArray();\n\t\n\t}", "function bill_service_provider() {\n\t\t$biller_category = $_REQUEST['biller_category'];\n\t\tif (!empty($biller_category)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('biller_details', 'biller_category_id', $biller_category);\n\n\t\t\tif ($records) {\n\t\t\t\tforeach ($records as $v) {\n\n\t\t\t\t\t$biller_id = $v['biller_id'];\n\t\t\t\t\t$biller_name = $v['biller_name'];\n\t\t\t\t\t$biller_contact_no = $v['biller_contact_no'];\n\t\t\t\t\t$biller_email = $v['biller_email'];\n\t\t\t\t\t$biller_company_name = $v['biller_company_name'];\n\t\t\t\t\t$biller_company_logo = biller_company_logo . $v['biller_company_logo'];\n\n\t\t\t\t\t$post1[] = array('biller_id' => $biller_id, \"biller_name\" => $biller_name, 'biller_contact_no' => $biller_contact_no, \"biller_email\" => $biller_email, 'biller_company_name' => $biller_company_name, 'company' => (string)$biller_company_name, \"biller_company_logo\" => $biller_company_logo, 'biller_category_id' => $biller_category);\n\t\t\t\t}\n\t\t\t\t$post = array('status' => \"true\", \"service_provider\" => $post1);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Service Provider Found\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'biller_category_id' => $biller_category);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function whmcs_apply_credit($params = array()) {\n\t\t$params['action'] = 'ApplyCredit';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function getAllCustomers() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => 'https://hackathon-be.mybluemix.net/customers',\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\techo \"<pre>\";\n\tprint_r($resp_decode);\n\techo \"</pre>\";\n}", "protected function get_request(){\n\t\treturn \"value_cashflows\";\n\t}", "public function listPurchase() {\n $companyId = $this->Session->read('CompanyLoggedIn.Company.id');\n $limit = 10;\n $valor_total = 0;\n $update = true;\n\n // array com dados obrigatorios para busca\n $arrayBusca = array(\n 'Checkout.company_id' => $companyId,\n 'Checkout.total_value > ' => 0,\n 'NOT' => array(\n 'Checkout.payment_state_id' => array(\n '14'\n )\n )\n );\n\n // verifica se esta sendo feita uma busca\n if (!empty($this->request->data ['busca'])) {\n if ($this->request->data ['calendario-inicio'] != 'Data Inicial' && $this->request->data ['calendario-fim'] != 'Data Final') {\n $dataInicio = $this->Utility->formataData($this->request->data ['calendario-inicio']);\n $dataFinal = $this->Utility->formataData($this->request->data ['calendario-fim']);\n $arrayData = array(\n 'Checkout.date >= ' => $dataInicio,\n 'Checkout.date <= ' => $dataFinal\n );\n $arrayBusca = array_merge($arrayData, $arrayBusca);\n }\n if ($this->request->data ['produto'] != 'Produto') {\n $arrayProduto = array(\n 'Offer.title LIKE' => \"%{$this->request->data['produto']}%\"\n );\n $arrayBusca = array_merge($arrayProduto, $arrayBusca);\n }\n if ($this->request->data ['comprador'] != 'Comprador') {\n $arrayComprador = array(\n 'User.name LIKE' => \"%{$this->request->data['comprador']}%\"\n );\n $arrayBusca = array_merge($arrayComprador, $arrayBusca);\n }\n }\n\n $paramsCount = array(\n 'Checkout' => array(\n 'fields' => array(\n 'SUM(Checkout.total_value) as valor_total'\n ),\n 'conditions' => $arrayBusca\n ),\n 'Offer' => array(),\n 'User' => array(),\n 'PaymentState' => array()\n );\n\n $contador = $this->Utility->urlRequestToGetData('payments', 'count', $paramsCount);\n $valor_total = $this->Utility->urlRequestToGetData('payments', 'first', $paramsCount);\n if (is_array($valor_total))\n $valor_total = $valor_total [0] ['valor_total'];\n\n // verifica se esta fazendo uma requisicao ajax para mais pedidos\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 5;\n if ($limit > $contador) {\n $limit = $contador;\n\n // nao chama mais atualizacao\n $update = false;\n }\n }\n\n // verifica se esta fazendo uma requisicao ajax para atualizar publicacao de comentarios\n if (!empty($this->request->data ['id_comentario'])) {\n\n $arrayParams = array(\n 'OffersComment' => array(\n 'id' => $this->request->data ['id_comentario'],\n 'status' => $this->request->data ['status']\n )\n );\n $updateStatus = $this->Utility->urlRequestToSaveData('offers', $arrayParams);\n exit();\n }\n\n $params = array(\n 'Checkout' => array(\n 'conditions' => $arrayBusca,\n 'limit' => $limit,\n 'order' => array(\n 'Checkout.id' => 'DESC'\n )\n ),\n 'Offer' => array(),\n 'User' => array(),\n 'PaymentState' => array()\n );\n\n $checkouts = $this->Utility->urlRequestToGetData('payments', 'all', $params);\n if (is_array($checkouts)) {\n foreach ($checkouts as $checkout) {\n\n // verificando se pedido ja foi comentado por comprador\n $idOffer = $checkout ['Checkout'] ['offer_id'];\n $idUser = $checkout ['Checkout'] ['user_id'];\n $params = array(\n 'OffersComment' => array(\n 'conditions' => array(\n 'OffersComment.offer_id' => $idOffer,\n 'OffersComment.user_id' => $idUser\n )\n )\n );\n $comentario = $this->Utility->urlRequestToGetData('offers', 'first', $params);\n if (!$comentario == true) {\n $checkout ['Checkout'] ['comment'] = false;\n } else {\n $checkout ['Checkout'] ['comment'] = $comentario ['OffersComment'];\n }\n\n $checks [] = $checkout;\n }\n } else {\n $checks = \"NENHUM REGISTRO ENCONTRADO\";\n }\n\n $this->set(compact('checks', 'limit', 'valor_total', 'contador', 'update'));\n if (!empty($render))\n $this->render('Elements/ajax_compras');\n }", "public function getListCpr()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_certify_receipt t, \n (SELECT @rownum := 0) r ORDER BY id_cpr ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function getPrices()\n {\n }", "function get_tax($merchant_id,$access_token)\r\n{\r\n$curl=curl_init('https://apisandbox.dev.clover.com/v3/merchants/'.$merchant_id.'/tax_rates');\r\n\r\ncurl_setopt($curl, CURLOPT_HTTPHEADER, array(\r\n \r\n \"Authorization:Bearer \".$access_token,\r\n 'Content-Type: application/json',\r\n)\r\n); \r\n\r\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n$auth = curl_exec($curl);\r\n$info = curl_getinfo($curl);\r\n$tax_result=json_decode($auth);\r\nreturn $tax_result;\r\n}", "public function getCashBacks()\n {\n try {\n return $this\n ->cash\n ->where('account_id', auth()->user()->account_id)\n ->orderBy('created_at', 'desc')// get last requests first\n ->orderBy('is_approved', 'asc')// then order them by approved asc 0 -> 1 as not paid first\n ->get();\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return new Collection();\n }\n }", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function getPurchasesById($listadoP, $listadoCC)\n {\n $sql = \"SELECT * FROM CreditCards c JOIN Purchases p ON c.id_creditcard = p.id_creditcard\";\n\n try \n {\n $this->connection = Connection::getInstance();\n $resultSet = $this->connection->execute($sql);\n } \n catch(Exception $ex) \n {\n throw $ex;\n }\n\n if(!empty($resultSet))\n {\n return $this->mapear($resultSet);\n }\n else\n {\n return false;\n }\n\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function fetchPurchaseData()\n\t{\n\t\t$result = array('data' => array());\n\n\t\t$data = $this->model_purchase->getPurchaseData();\n\n\t\tforeach ($data as $key => $value) {\n\n\t\t\t$count_total_item = $this->model_purchase->countPurchaseItem($value['purchase_no']);\n\t\t\t// echo $count_total_item;\n\t\t\t// $date = date('Y-m-d', $value['invoice_date']);\n\t\t\t// $time = date('h:i a', $value['date_time']);\n\t\t\t$party_data = $this->model_party->getPartyData($value['party_id']);\n\n\t\t\t// $date_time = $date;\n\n\t\t\tif ($party_data['address'] == NULL) {\n\t\t\t\t$party_data['address'] = \"\";\n\t\t\t}\n\t\t\tif ($party_data['party_name'] == NULL) {\n\t\t\t\t$party_data['party_name'] = \"\";\n\t\t\t}\n\t\t\t// button\n\t\t\t$buttons = '';\n\n\n\t\t\tif (in_array('viewOrder', $this->permission)) {\n\t\t\t\t$buttons .= '<a style=\"font-size: 25px;\" target=\"__blank\" href=\"' . base_url('purchase/printDiv/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-print\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('updateOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <a style=\"font-size: 25px;\" href=\"' . base_url('purchase/update/' . $value['s_no'] . '/' . $value['purchase_no'] . '') . '\" class=\"btn btn-default\"><i class=\"fa fa-pencil\"></i></a>';\n\t\t\t}\n\n\t\t\tif (in_array('deleteOrder', $this->permission)) {\n\t\t\t\t$buttons .= ' <button style=\"font-size: 25px;\" type=\"button\" class=\"btn btn-default\" onclick=\"removeFunc(' . $value['s_no'] . ', ' . $value['purchase_no'] . ')\" data-toggle=\"modal\" data-target=\"#removeModal\"><i class=\"fa fa-trash\"></i></button>';\n\t\t\t}\n\n\t\t\t// if($value['is_payment_received'] == 1) {\n\t\t\t// \t$paid_status = '<span class=\"label label-success\">Paid</span>';\t\n\t\t\t// }\n\t\t\t// else {\n\t\t\t// \t$paid_status = '<span class=\"label label-warning\">Not Paid</span>';\n\t\t\t// }\n\n\n\n\t\t\t$result['data'][$key] = array(\n\t\t\t\t$value['purchase_no'],\n\t\t\t\t$party_data['party_name'],\n\t\t\t\t$value['purchase_date'],\n\t\t\t\t$count_total_item,\n\t\t\t\t// $value['total_amount'],\n\t\t\t\t// $value['mode_of_payment'],\n\t\t\t\t$buttons\n\t\t\t);\n\t\t} // /foreach\n\n\t\techo json_encode($result);\n\t}", "public function getListOfContracts($id_1c) {\n\n return $this->client->GetListOfContracts(array(\n 'IDSuppliers' => (string) $id_1c));\n }", "function getProfitStanceLedgerBasedExchangeAndWalletListForUser($liuAccountID, $viewType, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t// for each exchange - get all assets associated with that exchange\n\t\t// get current balance for each asset for that exchange\n\t\t\n\t\t$responseObject\t\t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['retrievedExchangeList']\t\t\t\t\t\t\t= false;\n\t\t$responseObject['numberOfConnectedExchangesOrWallets']\t\t\t\t= 0;\n\t\t$responseObject['fiatCurrencyID']\t\t\t\t\t\t\t\t\t= 2;\t// later, this value will be set by the user as the portfolio currency\n\t\t\n\t\t$totalPortfolioValueArray\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t$totalPortfolioValueArray['retrievedPortfolioValue']\t\t\t\t= false;\n\t\t$totalPortfolioValueArray['totalPortfolioValue']\t\t\t\t\t= 0;\n\t\t$totalPortfolioValueArray['asOfDate']\t\t\t\t\t\t\t\t= \"\";\n\t\t\n\t\t$numberOfConnectedExchangesOrWallets\t\t\t\t\t\t\t\t= 0;\n\t\t$totalPortfolioValue\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getDataForUserSQL\t\t\t\t\t\t\t\t\t\t\t\t= \"SELECT DISTINCT\n\tProfitStanceLedgerEntries.FK_TransactionSourceID,\n\tTransactionSources.transactionSourceLabel,\n\tTransactionSources.FK_DataSourceType,\n\tDataSourceType.typeName\nFROM\n\tProfitStanceLedgerEntries\n\tINNER JOIN TransactionSources ON ProfitStanceLedgerEntries.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\tINNER JOIN DataSourceType ON TransactionSources.FK_DataSourceType = DataSourceType.dataSourceType AND DataSourceType.languageCode = 'EN'\nWHERE\n\tProfitStanceLedgerEntries.FK_AccountID = :accountID\";\n\t\n\t\t\tif (strcasecmp($viewType, \"exchanges\") == 0)\n\t\t\t{\n\t\t\t\t$getDataForUserSQL\t\t\t\t\t\t\t\t\t\t\t= \"SELECT DISTINCT\n\tProfitStanceLedgerEntries.FK_TransactionSourceID,\n\tTransactionSources.transactionSourceLabel,\n\tTransactionSources.FK_DataSourceType,\n\tDataSourceType.typeName\nFROM\n\tProfitStanceLedgerEntries\n\tINNER JOIN TransactionSources ON ProfitStanceLedgerEntries.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\tINNER JOIN DataSourceType ON TransactionSources.FK_DataSourceType = DataSourceType.dataSourceType AND DataSourceType.languageCode = 'EN'\nWHERE\n\tProfitStanceLedgerEntries.FK_AccountID = :accountID AND\n\tTransactionSources.FK_DataSourceType = 2\";\t\n\t\t\t}\n\t\t\telse if (strcasecmp($viewType, \"wallets\") == 0)\n\t\t\t{\n\t\t\t\t$getDataForUserSQL\t\t\t\t\t\t\t\t\t\t\t= \"SELECT DISTINCT\n\tProfitStanceLedgerEntries.FK_TransactionSourceID,\n\tTransactionSources.transactionSourceLabel,\n\tTransactionSources.FK_DataSourceType,\n\tDataSourceType.typeName\nFROM\n\tProfitStanceLedgerEntries\n\tINNER JOIN TransactionSources ON ProfitStanceLedgerEntries.FK_TransactionSourceID = TransactionSources.transactionSourceID AND TransactionSources.languageCode = 'EN'\n\tINNER JOIN DataSourceType ON TransactionSources.FK_DataSourceType = DataSourceType.dataSourceType AND DataSourceType.languageCode = 'EN'\nWHERE\n\tProfitStanceLedgerEntries.FK_AccountID = :accountID AND\n\tTransactionSources.FK_DataSourceType = 1\";\t\n\t\t\t}\n\t\t\t\n\t\t\t$getDataForUser\t\t\t\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare($getDataForUserSQL);\n\n\t\t\t$getDataForUser -> bindValue(':accountID', $liuAccountID);\n\t\t\t\t\t\t\n\t\t\tif ($getDataForUser -> execute() && $getDataForUser -> rowCount() > 0)\n\t\t\t{\t\n\t\t\t\t$responseObject['retrievedExchangeList']\t\t\t\t\t= true;\n\t\t\t\t\n\t\t\t\twhile ($row = $getDataForUser -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$numberOfConnectedExchangesOrWallets++;\n\t\t\t\t\t\n\t\t\t\t\t$exchangeArray\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\t\t\n\t\t\t\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionSourceID;\n\t\t\t\t\n\t\t\t\t\t// here 2019-03-01\n\t\t\t\t\t$lastDataImportDateObject\t\t\t\t\t\t\t\t= getLastDataImportDateForUserAccountAndExchange($liuAccountID, $transactionSourceID, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\tif ($lastDataImportDateObject['retrievedLastDataImportDateExchange'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$lastDataImportDate\t\t\t\t\t\t\t\t\t= $lastDataImportDateObject['completeImportDate'];\n\t\t\t\t\t\t$formattedLastDataImportDate\t\t\t\t\t\t= $lastDataImportDateObject['formattedCompleteImportDate'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!empty($lastDataImportDate))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$exchangeArray['lastImportDate']\t\t\t\t= $lastDataImportDate;\n\t\t\t\t\t\t\t$exchangeArray['formattedLastImportDate']\t\t= $formattedLastDataImportDate;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not retrieve last import date for $transactionSourceID\", $GLOBALS['generalSystemPerformance']);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// getProfitStanceLedgerBasedBalanceForUserAccountAndExchange\n\t\t\t\t\t\n\t\t\t\t\t$assetArrayWithBalances\t\t\t\t\t\t\t\t\t= getProfitStanceLedgerBasedBalanceForUserAccountAndExchangeWithoutGrouping($liuAccountID, $transactionSourceID, $globalCurrentDate, $sid, $dbh);\n\t\n\t\t\t\t\tif ($assetArrayWithBalances['retrievedCurrencyListWithBalanceForSource'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$totalPortfolioValueArray['retrievedPortfolioValue']= true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$balanceDate\t\t\t\t\t\t\t\t\t\t= $assetArrayWithBalances['balanceDate'];\n\t\t\t\t\t\t$totalPortfolioValueArray['asOfDate']\t\t\t\t= $balanceDate;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$exchangeArray['accountName']\t\t\t\t\t\t= $row -> transactionSourceLabel;\n\t\t\t\t\t\t$exchangeArray['accountType']\t\t\t\t\t\t= $row -> typeName;\n\t\t\t\t\t\n\t\t\t\t\t\t$exchangeArray['totalAmountInUSD']\t\t\t\t\t= $assetArrayWithBalances['totalPortfolioValue'];\n\t\t\t\t\t\n\t\t\t\t\t\t$exchangeArray['currencies']\t\t\t\t\t\t= $assetArrayWithBalances;\n\t\t\t\t\t\n\t\t\t\t\t\t$responseObject['exchanges'][]\t\t\t\t\t\t= $exchangeArray;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$totalPortfolioValue\t\t\t\t\t\t\t\t= $totalPortfolioValue + $assetArrayWithBalances['totalPortfolioValue'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"No balance date found for liuAccountID $liuAccountID transactionSourceID $transactionSourceID\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$responseObject['numberOfConnectedExchangesOrWallets']\t\t= $numberOfConnectedExchangesOrWallets;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$responseObject['resultMessage']\t\t\t\t\t\t\t= \"Unable to retrieve a source list for user $liuAccountID\";\n\t\t\t}\n\t\t}\n\t catch (PDOException $e) \n\t {\n\t \terrorLog($e -> getMessage());\n\t \t\n\t \t$responseObject['resultMessage']\t\t\t\t\t\t\t\t= \"Error: Unable to retrieve a source list for user $liuAccountID due to a database error: \".$e -> getMessage();\n\t\n\t\t\tdie();\n\t\t}\n\t\t\n\t\t$totalPortfolioValueArray['totalPortfolioValue']\t\t\t\t\t= $totalPortfolioValue;\n\t\t$responseObject['totalPortfolioValueArray']\t\t\t\t\t\t\t= $totalPortfolioValueArray;\n\t\t\n\t\terrorLog(json_encode($responseObject), $GLOBALS['debugCoreFunctionality']);\n\t\t\n\t\treturn $responseObject;\n\t}", "public function doctorChannelingsSummary()\n {\n $schedules = Auth::user()->doctor->schedules;\n $appointmentsCount = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->where('date', now()->toDateString())\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()->count();\n $paymentsPending = \"Rs.\" . number_format($schedules->sum('balance'), 2);\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'total_shedules_count' => $schedules->count(),\n 'today_appointments_count' => $appointmentsCount,\n 'payments_pending' => $paymentsPending,\n ]);\n }", "public function supply(): Collection\n {\n return $this->get('api/blocks/getSupply');\n }", "function index_get()\n {\n $key = $this->get('id');\n if (!$key) {\n $this->response($this->supplies->all(), 200);\n } else {\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }\n }", "public function getData()\n {\n if (empty($this->getFeeType())) {\n $this->setFeeType('CNY');\n }\n\n $this->validate(\n 'mch_id',\n 'api_key',\n 'body',\n 'out_trade_no',\n 'total_fee',\n 'notify_url',\n 'trade_type',\n 'spbill_create_ip',\n 'device_info',\n 'auth_code'\n );\n\n $data = array(\n 'appid' => $this->getAppId(),//*\n 'mch_id' => $this->getMchId(),\n 'sub_appid' => $this->getSubAppId(),\n 'sub_mch_id' => $this->getSubMchId(),\n 'device_info' => $this->getDeviceInfo(),//*\n 'body' => $this->getBody(),//*\n 'attach' => $this->getAttach(),\n 'out_trade_no' => $this->getOutTradeNo(),//*\n 'fee_type' => $this->getFeeType(),\n 'total_fee' => $this->getTotalFee(),//*\n 'spbill_create_ip' => $this->getSpbillCreateIp(),//*\n 'notify_url' => $this->getNotifyUrl(), //*\n 'trade_type' => $this->getTradeType(), //*\n 'limit_pay' => $this->getLimitPay(),\n 'promotion_tag' => $this->getPromotionTag(),\n 'nonce_str' => md5(uniqid()),//*\n 'auth_code' => $this->getAuthCode()\n );\n\n $data = array_filter($data);\n\n $data['sign'] = Helper::sign($data, $this->getApiKey());\n\n return $data;\n }", "public function getCourier_list_booking_delivered()\n {\n\t\t $sql = \"SELECT a.id, a.order_inv, a.r_name, a.c_driver, a.r_address, a.r_dest, a.r_city, a.r_curren, a.r_costtotal, a.r_description, a.total_insurance, a.total_tax, a.payment_status, a.pay_mode, a.created, a.r_hour, a.status_courier, a.act_status, a.con_status, s.mod_style, s.color FROM add_courier a, styles s WHERE a.status_courier=s.mod_style AND a.username = '\".$this->username.\"' AND a.status_courier='Delivered' ORDER BY a.id ASC\";\n $row = self::$db->fetch_all($sql);\n \n return ($row) ? $row : 0;\n }", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "function info()\n\t{\n\t\t$class=str_replace('hook_pointstore_','',strtolower(get_class($this)));\n\n\t\t$items=array();\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*'),array('c_enabled'=>1));\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\tif ($row['c_one_per_member']==1)\n\t\t\t{\n\t\t\t\t// Test to see if it's been bought\n\t\t\t\t$test=$GLOBALS['SITE_DB']->query_value_null_ok('sales','id',array('purchasetype'=>'PURCHASE_CUSTOM_PRODUCT','details2'=>strval($rows[0]['id']),'memberid'=>get_member()));\n\t\t\t\tif (!is_null($test)) continue;\n\t\t\t}\n\n\t\t\t$next_url=build_url(array('page'=>'_SELF','type'=>'action','id'=>$class,'sub_id'=>$row['id']),'_SELF');\n\t\t\t$items[]=do_template('POINTSTORE_'.strtoupper($class),array('NEXT_URL'=>$next_url,'TITLE'=>get_translated_text($row['c_title']),'DESCRIPTION'=>get_translated_tempcode($row['c_description'])));\n\t\t}\n\t\treturn $items;\n\t}", "function spgateway_credit_MetaData() {\n return array(\n 'DisplayName' => 'spgateway - 信用卡',\n 'APIVersion' => '1.1', // Use API Version 1.1\n 'DisableLocalCredtCardInput' => false,\n 'TokenisedStorage' => false,\n );\n}", "public function index()\n {\n return SupplyCollection::collection(Supply::paginate(10));\n }", "function get_store_card()\n {\n\t\tif(Url::get('code') and $row = DB::select('product','name_1 = \\''.Url::get('code').'\\' or name_2 = \\''.Url::get('code').'\\''))\n {\n $this->map['have_item'] = true;\n\t\t\t$this->map['code'] = $row['id'];\n\t\t\t$this->map['name'] = $row['name_'.Portal::language()];\n\t\t\t$old_cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t\t(\n\t\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t\t)\n\t\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date <\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t';\n $wh_remain_date = DB::fetch_all('select * from wh_remain_date where warehouse_id='.Url::iget('warehouse_id').' and portal_id = \\''.PORTAL_ID.'\\'');\n $new_cond = '';\n foreach($wh_remain_date as $key=>$value)\n {\n if($value['end_date'] != '' and Date_Time::to_time(Url::get('date_from'))< Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')) and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n if($value['end_date']=='' and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n }\t\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice_detail.id,\n wh_invoice_detail.product_id,\n wh_invoice_detail.num,\n wh_invoice.type,\n\t\t\t\t\twh_invoice_detail.to_warehouse_id,\n wh_invoice_detail.warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice_detail\n\t\t\t\t\tINNER JOIN wh_invoice ON wh_invoice.id= wh_invoice_detail.invoice_id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$old_cond.' \n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\t$old_items = array();\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$product_id = $value['product_id'];\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n {\n\t\t\t\t\tif(isset($old_items[$product_id]['import_number']))\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] += $value['num'];\n else\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] = $value['num'];\n }\n else\n if($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n \t\t\t\t\tif(isset($old_items[$product_id]['export_number']))\n \t\t\t\t\t\t$old_items[$product_id]['export_number'] += $value['num'];\n else\n {\n $old_items[$product_id]['export_number'] = $value['num'];\n }\n \t\t\t\t}\n\t\t\t}\n $sql = '\n\t\t\tSELECT\n\t\t\t\twh_start_term_remain.id,\n wh_start_term_remain.warehouse_id,\n\t\t\t\twh_start_term_remain.product_id,\n CASE \n WHEN wh_start_term_remain.quantity >0 THEN wh_start_term_remain.quantity\n ELSE 0 \n END as quantity\n\t\t\tFROM\n\t\t\t\twh_start_term_remain\n\t\t\tWHERE\t\n\t\t\t\twh_start_term_remain.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_start_term_remain.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t';\n\t\t\tif($product = DB::fetch($sql))\n {\n $this->map['start_remain'] = $product['quantity'];\t\n }\t\n else\n {\n $this->map['start_remain'] = 0;\n }\n if($new_cond!='')\n {\n $sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_remain_date_detail.id,\n wh_remain_date_detail.warehouse_id,\n\t\t\t\t\twh_remain_date_detail.product_id,\n wh_remain_date_detail.quantity\n\t\t\t\tFROM\n\t\t\t\t\twh_remain_date_detail\n\t\t\t\tWHERE\t\n\t\t\t\t\twh_remain_date_detail.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_remain_date_detail.portal_id = \\''.PORTAL_ID.'\\'\n '.$new_cond.'\n \t\t\t';\n if(User::id()=='developer06')\n {\n //System::debug($sql);\n }\n \t\t\tif($product = DB::fetch($sql))\n \t\t\t\t$this->map['start_remain'] += $product['quantity'];\t\n }\n if(User::id()=='developer06')\n {\n //System::debug($this->map['start_remain']);\n }\n\t\t\t$cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t(\n\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t)\n\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date >=\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t\t'.(Url::get('date_to')?' AND wh_invoice.create_date <=\\''.Date_Time::to_orc_date(Url::get('date_to')).'\\'':'').'\n\t\t\t';\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice.*,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'IMPORT\\',wh_invoice.bill_number,\\'\\') AS import_invoice_code,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'EXPORT\\',wh_invoice.bill_number,\\'\\') AS export_invoice_code,\n\t\t\t\t\twh_invoice_detail.num,wh_invoice_detail.warehouse_id,wh_invoice_detail.to_warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice\n\t\t\t\t\tINNER JOIN wh_invoice_detail ON wh_invoice_detail.invoice_id = wh_invoice.id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$cond.'\n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\tif(isset($old_items[$row['id']]))\n {\n\t\t\t\tif(isset($old_items[$row['id']]['import_number']))\n\t\t\t\t\t$this->map['start_remain'] += round($old_items[$row['id']]['import_number'],2);\n\t\t\t\tif(isset($old_items[$row['id']]['export_number']))\n\t\t\t\t\t$this->map['start_remain'] -= round($old_items[$row['id']]['export_number'],2);\t\t\t\n\t\t\t}\n\t\t\t$remain = $this->map['start_remain'];\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$items[$key]['create_date'] = Date_Time::convert_orc_date_to_date($value['create_date'],'/');\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n\t\t\t\t\t$items[$key]['import_number'] = $value['num'];\n else\n\t\t\t\t\t$items[$key]['import_number'] = 0;\n\t\t\t\tif($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n $items[$key]['export_number'] = $value['num']; \n }\n else\n\t\t\t\t\t$items[$key]['export_number'] = 0;\n\t\t\t\t$this->map['end_remain'] += round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n\t\t\t\t$remain = round($remain,2) + round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n if(User::id()=='developer06')\n {\n //echo $remain.'</br>';\n }\n\t\t\t\t$items[$key]['remain'] = $remain;\n\t\t\t\t$this->map['import_total'] += $items[$key]['import_number'];\n\t\t\t\t$this->map['export_total'] += $items[$key]['export_number'];\n if($items[$key]['export_number'] < 1)\n {\n $items[$key]['export_number'] = '0'.$items[$key]['export_number'];\n }\n\t\t\t}\n\t\t\t$this->map['end_remain'] += $this->map['start_remain'];\n\t\t\treturn $items;\n\t\t}\n\t}", "public function pdf_purchase_list() {\n $this->db->select('a.*,b.supplier_name');\n $this->db->from('product_purchase a');\n $this->db->join('supplier_information b', 'b.supplier_id = a.supplier_id');\n $this->db->order_by('a.purchase_date', 'desc');\n $query = $this->db->get();\n\n $last_query = $this->db->last_query();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function corporateMyBookingsAction() {\n $commonCode = $this->commonCode();\n $countItem = $commonCode['countItem'];\n $pg_start_page = 0;\n $page = 1;\n $pg_limit_records = $commonCode['pg_limit_records'];\n $count = $commonCode['count'];\n $class=$commonCode['class'];\n $pagination= '';\n $modules = $commonCode['modules'];\n $accountId = $commonCode['accountId'];\n $userId = $commonCode['userId'];\n $parameters['accountId'] = $accountId;\n $parameters['userId'] = $userId;\n $status = $commonCode['status'];\n $this->data['preferredAccountCurrency'] = $commonCode['preferredAccountCurrency'];\n $this->data['hotelModuleId'] = $commonCode['hotelModuleId'];\n $this->data['flightModuleId'] = $commonCode['flightModuleId'];\n $this->data['dealModuleId'] = $commonCode['dealModuleId'];\n $this->data['approvedStatus'] = $commonCode['approvedStatus'];\n $this->data['accountId'] = $commonCode['accountId'];\n $this->data['modules'] = $modules;\n $params = array(\n 'accountId' => $accountId,\n 'userId' => $userId,\n 'status' => $status,\n 'start' => $pg_start_page,\n 'limit' => $pg_limit_records\n );\n $userObj = $this->get('UserServices')->getUserDetails(array('id' => $userId));\n if($userObj[0]['cu_cmsUserGroupId'] == $this->container->getParameter('ROLE_SYSTEM')){\n $this->data['role'] = $this->container->getParameter('ROLE_SYSTEM');\n }\n $allApprovalFlowList = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n\n $params['count']= 1;\n $countApprovalFlowList = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n if($countApprovalFlowList){\n $countItem = $countApprovalFlowList;\n $pagination = $this->getRelatedDiscoverPagination($countItem, $pg_limit_records, $page,$count ,$class );\n } \n $this->data['pagination'] = $pagination;\n $this->data['allApprovalFlowList'] = $allApprovalFlowList;\n \n return $this->render('@Corporate/corporate/corporate-my-bookings.twig', $this->data);\n }", "public function getCurrencies ()\n\t{\n\t\treturn $this->call ('public/getcurrencies');\n\t}", "public function actionPayList()\n {\n $searchModel = new ThAccountInfoSearch();\n\t\t$queryParams = Yii::$app->request->queryParams;\n\t\t$queryParams['ThAccountInfoSearch']['company_id'] = $this->company_id;\n\t\t$queryParams['ThAccountInfoSearch']['status'] = ThAccountInfoSearch::getAccountStatus()['APPROVED'];\n\n\t\t$dataProvider = $searchModel->search($queryParams);\n\t\t\n\t\treturn $this->render('pay-list', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function ex_points(){\r\n $maps['is_on_sale'] = 1;\r\n $maps['type'] = 0;\r\n $info = D('goods')->where($maps)->select();\r\n // var_dump($info);die;\r\n $mapps['is_forbid'] = 0;\r\n $r = D('store')->where($mapps)->select();\r\n $this->assign('r',$r);\r\n $this->assign('info',$info);\r\n $this->display();\r\n }", "public function item($index): ?\\SengentoBV\\CdiscountMarketplaceSdk\\Structs\\CdiscountSupplyOrderReport\n {\n return parent::item($index);\n }", "public function getPraposalCompanyBackground($param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n\n $loanType = $param1;\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $sales = MasterData::sales();\n $cities = MasterData::cities();\n $states = MasterData::states();\n $choosenSales = null;\n $userType = MasterData::userType();\n $industryTypes = MasterData::industryTypes(false);\n $businessVintage = MasterData::businessVintage();\n $choosenUserType = null;\n $loanApplicationId = null;\n $chosenproductType = null;\n $existingCompanyDeails = null;\n $existingCompanyDeailsCount = 0;\n $maxCompanyDetails = Config::get('constants.CONST_MAX_COMPANY_DETAIL');\n $newCompanyDeailsNum = $maxCompanyDetails - $existingCompanyDeailsCount;\n $salesAreaDetailId = null;\n $salesAreaDetails = null;\n $loansStatus = null;\n $loan = null;\n $isReadOnly = Config::get('constants.CONST_IS_READ_ONLY');\n $setDisable = null;\n $status = null;\n $user = null;\n $userProfile = null;\n $isRemoveMandatory = MasterData::removeMandatory();\n $entityTypes = MasterData::entityTypes();\n $chosenEntity = null;\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n // $removeMandatory = $this->getMandatory($user);\n // dd($removeMandatory,$setDisable);\n $validLoanHelper = new validLoanUrlhelper();\n $setDisable = $this->getIsDisabled($user);\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'background');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $user = User::find($loan->user_id);\n $userProfile = $user->userProfile();\n $model = $loan->getBusinessOperationalDetails()->get()->first();\n }\n\n if (isset($loan)) {\n $loanApplicationId = $loan->loan_application_id;\n if (!isset($endUseList)) {\n $endUseList = $loan->end_use;\n }\n if (!isset($loanType)) {\n $loanType = $loan->type;\n }\n if (!isset($amount)) {\n $amount = $loan->loan_amount;\n }\n if (!isset($loanTenure)) {\n $loanTenure = $loan->loan_tenure;\n }\n }\n\n $user = Auth::user();\n\n if (isset($user)) {\n echo $userID = $user->id;\n $userEmail = $user->email;\n $userProfile = $user->userProfile();\n $isSME = $user->isSME();\n }\n if (isset($userID)) {\n $mobileAppEmail = DB::table('mobile_app_data')->where('Email', $userEmail)\n ->where('status', 0)\n ->first();\n $mobileAppData = DB::table('user_profiles')->where('user_id', $userID)->first();\n// $mobileAppFirm_Name = $mobileAppData->name_of_firm;\n // $mobileEntityType = $mobileAppData->owner_entity_type;\n }\n\n\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n $existingPromoterKycDetails = PromoterKycDetails::where('loan_id', '=', $loanId)->get();\n\n $praposalBackground = PraposalBackground::where('loan_id', '=', $loanId)->first();\n }\n /* $praposalLoan = PraposalBackground::find($loanId);\n if(isset($praposalLoan)){\n $praposalBackground = PraposalBackground::where('loan_id', '=', $loanId)->first();\n }else{\n $praposalBackground[]='';\n }*/\n $userPr = UserProfile::where('user_id', '=', $userID);\n\n // $userProfileFirm = UserProfile::with('user')->find($userID);\n //dd($loan->user_id);\n if (isset($loan->user_id)) {\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n } else {\n $userProfileFirm = UserProfile::with('user')->find($userID);\n }\n $setDisable='';\n\n $formaction = 'Loans\\LoansController@postPraposalCompanyBackground';\n $subViewType = 'loans._praposal_company_background';\n return view('loans.praposalCreditEdit', compact(\n 'formaction',\n 'subViewType',\n 'endUseList',\n 'loanType',\n 'amount',\n 'praposedAmount',\n 'finalAmount',\n 'loanTenure',\n 'existingTenor' , \n 'praposedTenor' , \n 'totalTenor' , 'existingInterestRate' , 'praposedInterestRate' ,\n 'totalInterestRate',\n 'praposalSourceOthers',\n 'loan',\n 'salesAreaDetails',\n 'comYourSalestype',\n 'comAnnualValueExport',\n 'loanId',\n 'mobileAppFirm_Name',\n 'loanApplicationId',\n 'sales',\n 'entityTypes',\n 'choosenSales',\n 'userType',\n 'choosenUserType',\n 'maxCompanyDetails',\n 'existingPromoterKycDetails',\n 'mobileEntityType',\n 'existingCompanyDeails',\n 'existingCompanyDeailsCount',\n 'newCompanyDeailsNum',\n 'industryTypes',\n 'praposalBackground',\n 'setDisable',\n 'mobileAppData',\n 'com_industry_segment',\n 'deletedQuestionHelper',\n 'cities',\n 'states',\n 'existingLoan',\n 'validLoanHelper',\n 'removeMandatory',\n 'businessVintage',\n 'userProfile',\n 'businessType',\n 'mobileAppDataID',\n 'userProfileFirm',\n 'mobileKeyProduct',\n 'mobileFirmRegNo',\n 'loanUserProfile',\n 'isSME',\n 'model'\n ));\n }", "public function actionCashier($id){\n $package = PosFilter::findPermission();\n if($package->id==\"Error\"){\n // ถ้าไม่มี ให้สร้าง Free Package POS.\n $model = new \\common\\models\\PackageControl();\n $model->name = 'POS';\n $model->type = 'sale';\n $model->comp_id = Yii::$app->session->get('Rules')['comp_id'];\n\n if($model->save()){\n Yii::$app->session->set('Machine',$id);\n return json_encode([\n 'status' => 200,\n 'message' => 'done',\n 'value' => [\n 'id' => $id,\n 'comp' => Yii::$app->session->get('Rules')['comp_id']\n ]\n ]);\n }else {\n return json_encode([\n 'status' => 500,\n 'message' => Yii::t('common','No package available'),\n 'value' => [\n 'id' => $id,\n 'comp' => Yii::$app->session->get('Rules')['comp_id']\n ]\n ]);\n }\n \n }else {\n Yii::$app->session->set('Machine',$id);\n return json_encode([\n 'status' => 200,\n 'message' => 'done',\n 'value' => [\n 'id' => $id\n ]\n ]);\n }\n }" ]
[ "0.62205446", "0.59038824", "0.56042993", "0.5544532", "0.54817045", "0.54378057", "0.5429713", "0.54189414", "0.5408269", "0.53670806", "0.53650874", "0.5330118", "0.532987", "0.5326008", "0.5321207", "0.52843046", "0.52711475", "0.5268201", "0.5266923", "0.5228007", "0.5222188", "0.5221343", "0.5209592", "0.5206963", "0.51897484", "0.51857185", "0.51843405", "0.5180599", "0.51755285", "0.51747245", "0.51621056", "0.51564676", "0.5150679", "0.51501274", "0.51391065", "0.5132434", "0.512655", "0.5124941", "0.51137227", "0.510594", "0.5085205", "0.50739855", "0.5068482", "0.5064194", "0.5058635", "0.50516945", "0.5046685", "0.50398713", "0.5039303", "0.5038108", "0.5033797", "0.5033647", "0.5032524", "0.5031325", "0.50165564", "0.501568", "0.500904", "0.5006389", "0.5006014", "0.5005706", "0.5003882", "0.50034523", "0.5001334", "0.49997172", "0.49992827", "0.4996652", "0.49903783", "0.49851558", "0.49843058", "0.4972216", "0.49696514", "0.4966448", "0.4965973", "0.49656278", "0.49643666", "0.49640638", "0.49616575", "0.49562654", "0.4952808", "0.4952336", "0.49502403", "0.4947676", "0.49454132", "0.49431887", "0.4942743", "0.49407104", "0.49371186", "0.49366635", "0.4934458", "0.49331954", "0.49311033", "0.49308035", "0.4930276", "0.49274853", "0.49246368", "0.49213535", "0.49208266", "0.49184257", "0.49155888", "0.49088037" ]
0.5837146
2
get today cash paid to suppliers details
public function getTodayCashPaidInvoiceDetails(){ $myDate = Carbon::now(); $todayDate = $myDate->toDateString(); try { $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->where('cash_paid_to_suppliers.date','=',$todayDate) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->where('cash_paid_to_suppliers.date','=',$todayDate)->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDollarsCreditedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsCreditedOn($today);\n }", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receipt_date,\\'dd/mm/yyyy\\') AS \"Receipt Date\" \n\t\tFROM '.receipt_table .' re \n\t\tJOIN '.relationships_table.' r ON r.relationship_id=re.supplier_id \n\t\tWHERE re.receipt_id = '.$this->receipt_id;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptCommercial, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "public function getDollarsDebitedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsDebitedOn($today);\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public function getTotalPaid();", "function get_customer_details($customer_id, $to=null)\n{\n\n\tif ($to == null)\n\t\t$todate = date(\"Y-m-d\");\n\telse\n\t\t$todate = date2sql($to);\n\t$past1 = get_company_pref('past_due_days');\n\t$past2 = 2 * $past1;\n\t// removed - debtor_trans.alloc from all summations\n\n $value = \"decode(\".TB_PREF.\"debtor_trans.type, 11, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type, 12, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type,2,\t-1, 1))) * \n\t\t\t\t\".\n \"\t(\".TB_PREF.\"debtor_trans.ov_amount + \".TB_PREF.\"debtor_trans.ov_gst + \"\n\t\t\t\t.TB_PREF.\"debtor_trans.ov_freight + \".TB_PREF.\"debtor_trans.ov_freight_tax + \"\n\t\t\t\t\t.TB_PREF.\"debtor_trans.ov_discount)\n\t\t\t \";\n\t$due = \"decode(\".TB_PREF.\"debtor_trans.type,10,\".TB_PREF.\"debtor_trans.due_date,\".TB_PREF.\"debtor_trans.tran_date)\";\n $sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"payment_terms.terms,\n\t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description,\n\t\t\n\t\tSum(\".$value.\") AS balance,\n\t\t\n\t\tSum(decode(sign(to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due),-1, 0, $value)) AS due,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past1),-1, $value, 0)) AS overdue1,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past2),-1, 0, $value)) AS overdue2 \n\t\tFROM \".TB_PREF.\"debtors_master,\n\t\t\t \".TB_PREF.\"payment_terms,\n\t\t\t \".TB_PREF.\"credit_status,\n\t\t\t \".TB_PREF.\"debtor_trans\n\n\t\tWHERE\n\t\t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n\t\t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id).\"\n\t\t\t AND \".TB_PREF.\"debtor_trans.tran_date <= to_date('$todate', 'yyyy-mm-dd hh24:mi:ss')\n\t\t\t AND \".TB_PREF.\"debtor_trans.type <> 13\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".TB_PREF.\"debtor_trans.debtor_no\n\n\t\tGROUP BY\n\t\t\t \".TB_PREF.\"debtors_master.name,\n\t\t\t \".TB_PREF.\"payment_terms.terms,\n\t\t\t \".TB_PREF.\"payment_terms.days_before_due,\n\t\t\t \".TB_PREF.\"payment_terms.day_in_following_month,\n\t\t\t \".TB_PREF.\"debtors_master.credit_limit,\n\t\t\t \".TB_PREF.\"credit_status.dissallow_invoices,\n\t\t\t \".TB_PREF.\"debtors_master.curr_code, \t\t\n\t\t\t \".TB_PREF.\"credit_status.reason_description\";\n\t\t\t \n\t\t\t \n $result = db_query($sql,\"The customer details could not be retrieved\");\n\n if (db_num_rows($result) == 0)\n {\n\n \t/*Because there is no balance - so just retrieve the header information about the customer - the choice is do one query to get the balance and transactions for those customers who have a balance and two queries for those who don't have a balance OR always do two queries - I opted for the former */\n\n \t$nil_balance = true;\n\n \t$sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"debtors_master.debtor_no, \".TB_PREF.\"payment_terms.terms,\n \t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description\n \t\tFROM \".TB_PREF.\"debtors_master,\n \t\t \".TB_PREF.\"payment_terms,\n \t\t \".TB_PREF.\"credit_status\n\n \t\tWHERE\n \t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n \t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n \t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id);\n\n \t$result = db_query($sql,\"The customer details could not be retrieved\");\n\n }\n else\n {\n \t$nil_balance = false;\n }\n\n $customer_record = db_fetch($result);\n\n if ($nil_balance == true)\n {\n\t\techo \"nill ba = true\";\n \t$customer_record[\"balance\"] = 0;\n \t$customer_record[\"due\"] = 0;\n \t$customer_record[\"overdue1\"] = 0;\n \t$customer_record[\"overdue2\"] = 0;\n }\n return $customer_record;\n\n\n}", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function getFeeInfo()\n {\n return $this->trading([\n 'command' => 'returnFeeInfo',\n ]);\n }", "public function getAllCashPaidInvoiceDetails(){\n\n try {\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "function kv_supplier_trans()\n{\n $today = Today();\n $today = date2sql($today);\n $sql = \"SELECT trans.trans_no, trans.reference, trans.tran_date, trans.due_date, s.supplier_id, \n s.supp_name, s.curr_code,\n (trans.ov_amount + trans.ov_gst + trans.ov_discount) AS total, \n (trans.ov_amount + trans.ov_gst + trans.ov_discount - trans.alloc) AS remainder,\n DATEDIFF('$today', trans.due_date) AS days \n FROM \" . TB_PREF . \"supp_trans as trans, \" . TB_PREF . \"suppliers as s \n WHERE s.supplier_id = trans.supplier_id\n AND trans.type = \" . ST_SUPPINVOICE . \" AND (ABS(trans.ov_amount + trans.ov_gst + \n trans.ov_discount) - trans.alloc) > \" . FLOAT_COMP_DELTA . \"\n AND DATEDIFF('$today', trans.due_date) > 0 ORDER BY days DESC\";\n $result = db_query($sql);\n //$th = array(\"#\", trans(\"Ref.\"), trans(\"Date\"), trans(\"Due Date\"), trans(\"Supplier\"), trans(\"Currency\"), trans(\"Total\"), trans(\"Remainder\"), trans(\"Days\"));\n //start_table(TABLESTYLE);\n //table_header($th);\n echo '<table class=\"table table-hover\">\n <thead class=\"text-warning\">\n <tr><th>Ref</th> \n <th>Due Date</th>\n <th>Supplier</th>\n <th>Currency</th>\n <th>Total</th>\n <th>Days</th>\n </tr></thead>';\n $k = 0; //row colour counter\n while ($myrow = db_fetch($result)) {\n alt_table_row_color($k);\n //label_cell(get_trans_view_str(ST_SUPPINVOICE, $myrow[\"trans_no\"]));\n label_cell($myrow['reference']);\n //label_cell(sql2date($myrow['tran_date']));\n label_cell(sql2date($myrow['due_date']));\n $name = $myrow[\"supplier_id\"] . \" \" . $myrow[\"supp_name\"];\n label_cell($name);\n label_cell($myrow['curr_code']);\n amount_cell($myrow['total']);\n //amount_cell($myrow['remainder']);\n label_cell($myrow['days'], \"align='right'\");\n end_row();\n }\n end_table(1);\n}", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function getTodaybuy()\n {\n return $this->get(self::_TODAYBUY);\n }", "function get_consumer_details() {\n\t\t$consumer_no = $_REQUEST['consumer_no'];\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\tif (!empty($consumer_no) && !empty($biller_id)) {\n\t\t\t$biller_in_id = 'biller_user.biller_customer_id_no';\n\t\t\t$records_consumer = $this -> conn -> join_two_table_where_two_field('biller_user', 'biller_details', 'biller_id', 'biller_id', $biller_in_id, $consumer_no, 'biller_user.biller_id', $biller_id);\n\n\t\t\tif (!empty($records_consumer)) {\n\t\t\t\t$biller_id = $records_consumer[0]['biller_id'];\n\t\t\t\t$biller_company = $records_consumer[0]['biller_company_name'];\n\t\t\t\t$biller_company_logo = biller_company_logo . $records_consumer[0]['biller_company_logo'];\n\t\t\t\t$biller_user_name = $records_consumer[0]['biller_user_name'];\n\t\t\t\t$biller_customer_id = $records_consumer[0]['biller_customer_id_no'];\n\t\t\t\t$bill_amount = $records_consumer[0]['bill_amount'];\n\t\t\t\t$bill_due_date = $records_consumer[0]['bill_due_date'];\n\t\t\t\t$biller_user_email = $records_consumer[0]['biller_user_email'];\n\t\t\t\t$biller_user_contact_no = $records_consumer[0]['biller_user_contact_no'];\n\t\t\t\t$bill_pay_status = $records_consumer[0]['bill_pay_status'];\n\t\t\t\t$bill_invoice_no = $records_consumer[0]['bill_invoice_no'];\n\t\t\t\t$current_date = date(\"Y-m-d\");\n\t\t\t\tif ($bill_due_date >= $current_date) {\n\t\t\t\t\tif ($bill_pay_status == '1') {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill already paid\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => 'true', \"biller_id\" => $biller_id, 'biller_company' => $biller_company, 'biller_logo' => $biller_company_logo, 'consumer_name' => $biller_user_name, 'consumer_id' => $biller_customer_id, 'bill_amount' => $bill_amount, 'due_date' => $bill_due_date, 'consumer_email' => $biller_user_email, 'consumer_contact_no' => $biller_user_contact_no, 'bill_pay_status' => $bill_pay_status, 'bill_invoice_no' => $bill_invoice_no);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill Paid date is expired\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Bill Found from this consumer no\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'consumer_no' => $consumer_no, 'biller_id' => $biller_id);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "function get_credit_available() {\n cache_randys_credit_values();\n $woo_cust_id = get_current_user_id();\n return get_transient( '_randys_credit_available_' . $woo_cust_id );\n}", "public function product_wise_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function product_wise_report()\n\t{\n\t\t$today = date('m-d-Y');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function getCharges();", "public function getPaymorrowPrintData()\n {\n return $this->getEshopDataProvider()->printPmData();\n }", "function getDeliveryCharges($product_id = null, $seller_id = null, $condition_id = null) {\n\t\tif(empty($product_id) && is_null($seller_id) ){\n\t\t}\n\t\tApp::import('Model','ProductSeller');\n\t\t$this->ProductSeller = & new ProductSeller();\n\t\t$prodSellerInfo = $this->ProductSeller->find('first', array('conditions'=>array('ProductSeller.product_id'=>$product_id ,'ProductSeller.seller_id'=>$seller_id , 'ProductSeller.condition_id'=>$condition_id ),'fields'=>array('ProductSeller.standard_delivery_price')));\n\t\t//pr($prodSellerInfo);\n\t\tif(is_array($prodSellerInfo)){\n\t\t\treturn $prodSellerInfo['ProductSeller']['standard_delivery_price'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}", "public function getPaymentDate();", "function retrieveFunds() {\n return -58.98;\n }", "public function getMonthlyFee();", "function get_contact_supplier_info($acc_s_id) {\n\t# Dim some Vars\n\t\tglobal $_DBCFG, $db_coin;\n\t\t$_cinfo = array(\"s_id\" => 0, \"s_name_first\" => '', \"s_name_last\" => '', \"s_company\" => '', \"s_email\" => '');\n\n\t# Set Query for select and execute\n\t\t$query\t = 'SELECT s_id, s_name_first, s_name_last, s_company, s_email FROM '.$_DBCFG['suppliers'];\n\t\t$query\t.= ' WHERE s_id='.$acc_s_id.' ORDER BY s_company ASC, s_name_last ASC, s_name_first ASC';\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\tIF ($db_coin->db_query_numrows($result)) {\n\t\t\twhile(list($s_id, $s_name_first, $s_name_last, $s_company, $s_email) = $db_coin->db_fetch_row($result)) {\n\t\t\t\t$_cinfo['s_id']\t\t= $s_id;\n\t\t\t\t$_cinfo['s_name_first']\t= $s_name_first;\n\t\t\t\t$_cinfo['s_name_last']\t= $s_name_last;\n\t\t\t\t$_cinfo['s_company']\t= $s_company;\n\t\t\t\t$_cinfo['s_email']\t\t= $s_email;\n\t\t\t}\n\t\t}\n\t\treturn $_cinfo;\n}", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "function retrieveFunds() {\n return -110.98;\n }", "public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }", "public function getOtherCharges() { \n \n $result = 0;\n $purchaseIds = !empty($_GET['purchaseIds']) ? $_GET['purchaseIds'] : '';\n $purchaseData = DB::select('SELECT * FROM purchase_master WHERE is_deleted_status = \"N\" AND id = '.$purchaseIds.'');\n if (!empty($purchaseData)) {\n $otherCharges = !empty($purchaseData[0]->other_charges) ? $purchaseData[0]->other_charges : '0.00'; \n echo $otherCharges;\n }\n\n }", "public function stock_report_supplier_bydate($product_id,$supplier_id,$date,$perpage,$page){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date <=' ,$date);\n\t\t\t$this->db->where('a.supplier_id',$supplier_id);\t\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_franchise_payment_details($fr_id)\r\n\t{\r\n\t\t$data = array();\r\n\t\t$data['ordered_tilldate'] = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\tfrom king_transactions a \r\n\t\tjoin king_orders b on a.transid = b.transid \r\n\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\twhere a.franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t\r\n\t\t$data['shipped_tilldate'] = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed =1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 \r\n\t\t\t\t\t\t\t\t \",$fr_id)->row()->amt;\r\n\t\t$data['cancelled_tilldate'] = $data['ordered_tilldate']-$data['shipped_tilldate'];\r\n\t\t\r\n\t\t$data['paid_tilldate'] = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t$data['uncleared_payment'] = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where status = 0 and franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t\r\n\t\t$data['pending_payment'] = $data['shipped_tilldate']-$data['paid_tilldate'];\r\n\t\treturn $data;\r\n\t}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "public function getTotalDue();", "public function getPrices()\n {\n }", "public function getBilling();", "public function customers_pending_to_pay(){\n\n\t$fecha1=Input::get('date1');\n\t$fechaActual=date(\"Y-m-d\");\n\tif($fecha1 ==\"\"){\n\t\t$valoresObtenidos=DetailCredit::where('date_payments','<=',$fechaActual)\n\t\t->WhereNull('payment_real_date')->orderBy('id_factura', 'asc')->get();\n\t\treturn view('report.report_pending_to_pay')\n\t\t->with('fecha1', $fechaActual)\n\t\t->with('valoresObtenidos', $valoresObtenidos);\n\t}else{\n\t\t$nuevaFecha1 = explode('/', $fecha1);\n\t\t$diaFecha1=$nuevaFecha1[0];\n\t\t$mesFecha1=$nuevaFecha1[1];\n\t\t$anioFecha1=$nuevaFecha1[2];\n\t\t$rFecha1=$anioFecha1.'-'.$mesFecha1.'-'.$diaFecha1;\n\n\t\t$valoresObtenidos=DetailCredit::where('date_payments','<=',$rFecha1)\n\t\t->WhereNull('payment_real_date')->orderBy('id_factura', 'asc')->get();\n\t\treturn view('report.report_pending_to_pay')\n\t\t->with('fecha1', $rFecha1)\n\t\t->with('valoresObtenidos', $valoresObtenidos);\n\t}\n}", "public function getStock();", "public function pdf_purchase_list() {\n $this->db->select('a.*,b.supplier_name');\n $this->db->from('product_purchase a');\n $this->db->join('supplier_information b', 'b.supplier_id = a.supplier_id');\n $this->db->order_by('a.purchase_date', 'desc');\n $query = $this->db->get();\n\n $last_query = $this->db->last_query();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function getShippingInvoiced();", "public function getCourier_list_booking_delivered()\n {\n\t\t $sql = \"SELECT a.id, a.order_inv, a.r_name, a.c_driver, a.r_address, a.r_dest, a.r_city, a.r_curren, a.r_costtotal, a.r_description, a.total_insurance, a.total_tax, a.payment_status, a.pay_mode, a.created, a.r_hour, a.status_courier, a.act_status, a.con_status, s.mod_style, s.color FROM add_courier a, styles s WHERE a.status_courier=s.mod_style AND a.username = '\".$this->username.\"' AND a.status_courier='Delivered' ORDER BY a.id ASC\";\n $row = self::$db->fetch_all($sql);\n \n return ($row) ? $row : 0;\n }", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function paid()\n {\n $expenses = Expense::where(\"status\", 'verified')->orderBy('created_at', 'DESC')->get();\n $expenses->map(function ($expense) {\n return $expense->payment_account;\n });\n return response()->json($expenses);\n }", "public function getDollarsCreditedOn(Carbon $date)\n {\n return $this\n ->transactions()\n ->whereBetween('post_date', [\n $date->copy()->startOfDay(),\n $date->copy()->endOfDay()\n ])\n ->sum('credit') / 100;\n }", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }", "function get_courier_fee($summary, $user, $method = '')\n{\n global $config, $lang, $db_prefix, $current_user_info, $module_config;\n $tmp = array();\n\n // if shipper defined, return shipping cost for defined shipper; else return all alternative shippers & cost\n $w = ceil($summary['order_weight']);\n\n if ($method) {\n if ($x = strpos($method, '.')) {\n $mod = substr($method, 0, $x);\n } else {\n $mod = $method;\n }\n $row_mod = sql_qquery(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_enabled = '1' AND mod_type = 'shipping' AND mod_id='$mod' LIMIT 1\");\n if (!file_exists('./module/'.$mod.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Shipping module '.$method.' not found.'));\n }\n require('./module/'.$mod.'/window.php');\n return $ship_info;\n } else {\n $res_mod = sql_query(\"SELECT * FROM \".$db_prefix.\"module WHERE mod_enabled = '1' AND mod_type = 'shipping'\");\n while ($row_mod = sql_fetch_array($res_mod)) {\n $method = $row_mod['mod_id'];\n $ship_info = array();\n if (!file_exists('./module/'.$method.'/window.php')) {\n msg_die(sprintf($lang['msg']['internal_error'], 'Shipping module '.$method.' not found.'));\n }\n require('./module/'.$method.'/window.php');\n if (!empty($ship_info)) {\n if (!empty($ship_info[0])) {\n foreach ($ship_info as $k => $v) {\n $tmp[$v['method']] = $v;\n }\n } else {\n $tmp[$method] = $ship_info;\n }\n }\n }\n return $tmp;\n }\n}", "public function getCareer();", "public function getquickReturnReport()\n\t{\n\t\tdate_default_timezone_set(config::$timezone);\n\t\t$today = date(\"Y-m-d\");\n\t\t$parameterr = array();\n\t\t$parameter['title'] = 'Today\\'s Return Date Orders';\n $parameter['orders'] = Order::where('to','=', $today)\n \t\t\t\t\t\t\t\t->get();\n\n\t\t$pdf = PDF::loadView('reports.order.getAllOrders',$parameter)\n\t\t\t\t\t->setPaper('a4')\n\t\t\t\t\t->setOrientation(config::$ORDER_REPORT_ORIENTATION)\n\t\t\t\t\t->setWarnings(false);\n\n\t\treturn $pdf->stream('Report On Today\\'s Return Date Orders.pdf');\n\t\t\n\t}", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "public function obtenerBeneficiados(){\n \n //obtener datos de service\n return IncorporacionService::beneficiados();\n\n }", "public function getWarrantyDate()\n {\n return $this->warrantyDate;\n }", "public function freightpaidby() {\n\t\treturn self::FREIGHTPAIDBY_DESCRIPTIONS[$this->freightpaidby];\n\t}", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function getCurrentPaid($registrationNo,$paymentFor,$via) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\nif($via == \"cashUnpaid\") {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT sum(amountPaid) as amountPaid FROM patientPayment WHERE registrationNo = '$registrationNo' and paymentFor = '$paymentFor' \");\n}else {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT sum($via) as amountPaid FROM patientCharges WHERE registrationNo = '$registrationNo' and title = '$paymentFor' \");\n}\n\n\nwhile($row = mysqli_fetch_array($result))\n {\n\nreturn $row['amountPaid'];\n\n }\n\n}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }", "function dosql_fee(){\n global $conn;\n $paid=$_SESSION['pay_not'];\n if($paid=='All'){\n $sql4=\"SELECT * FROM owner_fee\";\n $result4=mysqli_query($conn,$sql4);\n\n\n\n return $result4;\n \n }else if($paid=='N'){\n $sql5=\"SELECT * FROM owner_fee where paid='N' \";\n $result5=mysqli_query($conn,$sql5);\n return $result5;\n }else if($paid='Y'){\n $sql6=\"SELECT * FROM owner_fee where paid='Y' \";\n $result6=mysqli_query($conn,$sql6);\n return $result6;\n }\n }", "function get_payment_details($app_id) {\r\n\t\t$sql = \"SELECT x.administration_fee, x.doctor_fee, JUMLAH_HARGA_OBAT_BY_APP(z.appointment_number) as med_fee, x.proc_fee, (x.lab_fee + (x.paramita_fee * 1.35)) as lab_fee, x.amc_package_fee, z.appointment_date,\r\n\t\t\t\ty.salutation, CONCAT(y.first_name, ' ' ,y.middle_name, ' ', y.last_name) as full_name, y.nickname\r\n\t\t\t\tFROM tb_billing as x, tb_patient as y, tb_appointment as z\r\n\t\t\t\tWHERE y.mr_no = z.mr_no\t\t\t\t\r\n\t\t\t\tAND z.appointment_number = x.id_appointment\r\n\t\t\t\tAND x.id_appointment = ?\t\t\t\t\r\n\t\t\t\tLIMIT 1\";\r\n\t\t$query = $this->db->query($sql, $app_id);\r\n\t\t/*$sql = \"SELECT SUM(harga)\r\n\t\t\t\tFROM tb_paramita_check_request\r\n\t\t\t\tWHERE id_app =?\";\r\n\t\t$query = $this->db->query($sql,$app_id);*/\r\n\t\tif($query->num_rows() > 0)\r\n\t\t\treturn $query->row();\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "public function purchasedBooks()\n { \n return $this->orders();\n }", "public function getCurrencies();", "public function getDiscountInvoiced();", "public function pay_credit() {\r\n //var_dump($_POST);\r\n $agent_id = $this->input->post('hddn_agent_id');\r\n $amount = (float)$this->input->post('txt_amount_paid');\r\n $cheque_no = $this->input->post('txt_cheque_no');\r\n \r\n //retrieve purchases\r\n $fields = array(\r\n 'id AS purchase_id','total_paid',\r\n 'ROUND((total_amount-(total_amount*discount/100))-total_paid,2)AS purchase_credit'\r\n );\r\n $criteria = \"agent_id = '{$agent_id}' AND purchase_status = 'completed' AND ROUND(total_amount-(total_amount*discount/100),2) > total_paid\";\r\n $order_by = \"id ASC\";\r\n $purchases = $this->purchase_model->get_purchases($fields,$criteria,'','',$order_by);\r\n //var_dump($purchases);\r\n \r\n //prepare data sets\r\n $data_set_agent = array(\r\n 'credit_amount' => (float)$this->input->post('hddn_credit_amount') - $amount\r\n );\r\n $data_set_financial = array(\r\n 'trans_category' => 'credit',\r\n 'description' => \"Pay credit : \" . $this->input->post('hddn_agent_name'),\r\n 'amount' => $amount,\r\n 'creditor_debtor_id' => $agent_id,\r\n 'income' => FALSE,\r\n 'date_made' => get_cur_date_time(),\r\n 'user_made' => $this->session->userdata('user_id'),\r\n );\r\n if($cheque_no !='') {\r\n $data_set_financial['cheque_no'] = $cheque_no;\r\n $data_set_financial['trans_status'] = 'pending';\r\n }\r\n $data_set_purchases = array();\r\n $data_set_payments = array();\r\n //process purchases\r\n $i = 0;\r\n while($i < count($purchases) && $amount > 0.00) {\r\n $purchase_credit = $purchases[$i]['purchase_credit'];\r\n $amount_paid = 0.00;\r\n if($purchase_credit > $amount) {\r\n $amount_paid = $amount;\r\n $amount = 0.00;\r\n } else {\r\n $amount_paid = $purchase_credit;\r\n $amount -= $amount_paid;\r\n }\r\n array_push($data_set_purchases,array(\r\n 'id' => $purchases[$i]['purchase_id'],\r\n 'total_paid' => $purchases[$i]['total_paid'] + $amount_paid\r\n ));\r\n array_push($data_set_payments,array(\r\n 'trans_id' => null,\r\n 'sales_purchase_id' => $purchases[$i]['purchase_id'],\r\n 'amount' => $amount_paid\r\n ));\r\n $i++;\r\n }//while\r\n //var_dump($data_set_agent);var_dump($data_set_financial);\r\n //var_dump($data_set_purchases);var_dump($data_set_payments);\r\n \r\n $this->db->trans_start();\r\n //insert financial\r\n $trans_id = $this->financial_model->add_transaction($data_set_financial);\r\n \r\n //insert trans id in to payments\r\n for($i = 0; $i < count($data_set_payments); $i++) {\r\n $data_set_payments[$i]['trans_id'] = $trans_id ;\r\n }\r\n //insert payments\r\n $this->payment_model->add_payments($data_set_payments);\r\n \r\n //update purchases\r\n $criteria = 'id';\r\n $this->purchase_model->update_purchases($data_set_purchases,$criteria);\r\n \r\n //update agent\r\n $criteria = array('id' => $agent_id);\r\n $this->agent_model->update_agent($data_set_agent,$criteria);\r\n \r\n $this->db->trans_complete();\r\n \r\n $query_status = $this->db->trans_status();\r\n if($query_status) {\r\n\r\n //insert system log entry\r\n $description = \"Pay credit:\" . $this->input->post('hddn_agent_name');\r\n $this->application->write_log('financial', $description);\r\n \r\n //prepare notifications\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'success',\r\n 'notification_description' => \"The credit is added successfully.\"\r\n );\r\n\r\n } else {\r\n $notification = array(\r\n 'is_notification'\t\t=> TRUE,\r\n 'notification_type'\t\t=> 'error',\r\n 'notification_description' => 'Error terminated adding the credit.'\r\n );\r\n }\r\n $this->session->set_flashdata($notification);\r\n redirect('financial/creditors_debtors');\r\n \r\n }", "function get_all($date) {\n $money = 0;\n foreach ($this->list as $this_item) {\n $money += $this_item->get_amount($date);\n }\n return $money;\n }", "function getGuardCharge($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$scheduledays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\t//Set payment dates if they are not set\n\t\tif(trim($startdate) == \"\"){\n\t\t\t$datearray = getRowAsArray(\"SELECT lastpaymentdate, dateofemployment FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\t\tif($datearray['lastpaymentdate'] != \"\"){\n\t\t\t\t$startdate = $datearray['lastpaymentdate'];\n\t\t\t} else {\n\t\t\t\t$startdate = $datearray['dateofemployment'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Give it the current date if it has not been set yet\n\t\tif(trim($enddate) == \"\"){\n\t\t\t$enddate = date(\"d-M-Y\");\n\t\t}\n\t\t\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif(!in_array($assgnarr[1],$statusarr) && $assgnarr[0] == $guardid && $assgnarr[1] != \"\"){\n\t\t\t\t\t$scheduledays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Return the amount to be paid to the guard for regular work done\n\t$guard = getRowAsArray(\"SELECT rate FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\n\treturn $scheduledays*$guard['rate'];\n}", "public function getcosstotalcourier()\n {\n\t\t $courbudget = 0;\n\t\t$sql = \"SELECT r_costtotal,total_insurance,total_tax FROM \" . self::cTable . \" WHERE act_status = '1' AND con_status= '0' AND payment_status='0' AND username='\" . $this->username . \"'\";\n\t\t$row = self::$db->fetch_all($sql);\n \n foreach ($row as $budget){\n\t\t\treturn $courbudget+= $budget->r_costtotal;\t\n\t\t\t} \n }", "function getPurchasePrice($id, $supplier_id = null) {\n \n $result = $this->Product->getShortDet($id);\n\n $this->loadModel('Productsupplier');\n $this->Productsupplier->recursive = -1;\n $condition['product_id'] = $id;\n $condition['status'] = 'yes';\n if($supplier_id) {\n $condition['supplier_id'] = $supplier_id;\n }\n $supplierPrice = $this->Productsupplier->find('first', array('conditions' => $condition, 'fields' => array('price')));\n if($supplierPrice && $supplierPrice['Productsupplier']['price']) {\n $result['price'] = $supplierPrice['Productsupplier']['price'];\n }\n \n echo json_encode($result);\n exit;\n }", "function get_todaysbookingsamount($custID = '', $shiptoID = '', $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\n\t\t$q = (new QueryBuilder())->table('bookingd');\n\t\t$q->field('SUM(netamount)');\n\t\t$q->where('bookdate', date('Ymd'));\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesperson1', DplusWire::wire('user')->salespersonid);\n\t\t}\n\n\t\tif (!empty($custID)) {\n\t\t\t$q->where('custid', $custID);\n\t\t\tif (!empty($shiptoID)) {\n\t\t\t\t$q->where('shiptoid', $shiptoID);\n\t\t\t}\n\t\t}\n\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "function curCash(){\n\tglobal $driver;\n\t$sql_settings\t\t=\t\"SELECT systeminitcash FROM settings\"; //Retrieve system initial cash\n\t$sql_transactions\t=\t\"SELECT c_balance FROM transactions ORDER BY id DESC LIMIT 1\";\n\tif($cash\t=\t $driver->perform_request($sql_transactions)):\n\t\tif($driver->numRows($cash)>0):\n\t\t\t$row = $driver->load_data($cash,MYSQL_ASSOC);\n\t\t\t$cashamount\t=\t($row['c_balance']>0)?($row['c_balance']):0;//Current cash balance\n\t\telse:\n\t\t\tif($cash \t=\t$driver->perform_request($sql_settings)):\n\t\t\t\t$row\t= \t$driver->load_data($cash,MYSQL_ASSOC);\n\t\t\t\t$cashamount = ($row['systeminitcash']>0)?($row['systeminitcash']):0;//System Initial Cash\n\t\t\telse:\n\t\t\t\tdie('<p class=\"error\">ERROR Retrieving Initial Cash <br/>'.mysql_error().'</p>');\n\t\t\tendif;\n\t\tendif;\n\telse:\n\t\tdie('<p class=\"error\">ERROR Retrieving Cash balance<br/>'.mysql_error().'</p>');\n\tendif;\n\treturn $cashamount;\n}", "function get_store_card()\n {\n\t\tif(Url::get('code') and $row = DB::select('product','name_1 = \\''.Url::get('code').'\\' or name_2 = \\''.Url::get('code').'\\''))\n {\n $this->map['have_item'] = true;\n\t\t\t$this->map['code'] = $row['id'];\n\t\t\t$this->map['name'] = $row['name_'.Portal::language()];\n\t\t\t$old_cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t\t(\n\t\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t\t)\n\t\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date <\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t';\n $wh_remain_date = DB::fetch_all('select * from wh_remain_date where warehouse_id='.Url::iget('warehouse_id').' and portal_id = \\''.PORTAL_ID.'\\'');\n $new_cond = '';\n foreach($wh_remain_date as $key=>$value)\n {\n if($value['end_date'] != '' and Date_Time::to_time(Url::get('date_from'))< Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')) and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n if($value['end_date']=='' and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n }\t\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice_detail.id,\n wh_invoice_detail.product_id,\n wh_invoice_detail.num,\n wh_invoice.type,\n\t\t\t\t\twh_invoice_detail.to_warehouse_id,\n wh_invoice_detail.warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice_detail\n\t\t\t\t\tINNER JOIN wh_invoice ON wh_invoice.id= wh_invoice_detail.invoice_id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$old_cond.' \n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\t$old_items = array();\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$product_id = $value['product_id'];\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n {\n\t\t\t\t\tif(isset($old_items[$product_id]['import_number']))\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] += $value['num'];\n else\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] = $value['num'];\n }\n else\n if($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n \t\t\t\t\tif(isset($old_items[$product_id]['export_number']))\n \t\t\t\t\t\t$old_items[$product_id]['export_number'] += $value['num'];\n else\n {\n $old_items[$product_id]['export_number'] = $value['num'];\n }\n \t\t\t\t}\n\t\t\t}\n $sql = '\n\t\t\tSELECT\n\t\t\t\twh_start_term_remain.id,\n wh_start_term_remain.warehouse_id,\n\t\t\t\twh_start_term_remain.product_id,\n CASE \n WHEN wh_start_term_remain.quantity >0 THEN wh_start_term_remain.quantity\n ELSE 0 \n END as quantity\n\t\t\tFROM\n\t\t\t\twh_start_term_remain\n\t\t\tWHERE\t\n\t\t\t\twh_start_term_remain.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_start_term_remain.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t';\n\t\t\tif($product = DB::fetch($sql))\n {\n $this->map['start_remain'] = $product['quantity'];\t\n }\t\n else\n {\n $this->map['start_remain'] = 0;\n }\n if($new_cond!='')\n {\n $sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_remain_date_detail.id,\n wh_remain_date_detail.warehouse_id,\n\t\t\t\t\twh_remain_date_detail.product_id,\n wh_remain_date_detail.quantity\n\t\t\t\tFROM\n\t\t\t\t\twh_remain_date_detail\n\t\t\t\tWHERE\t\n\t\t\t\t\twh_remain_date_detail.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_remain_date_detail.portal_id = \\''.PORTAL_ID.'\\'\n '.$new_cond.'\n \t\t\t';\n if(User::id()=='developer06')\n {\n //System::debug($sql);\n }\n \t\t\tif($product = DB::fetch($sql))\n \t\t\t\t$this->map['start_remain'] += $product['quantity'];\t\n }\n if(User::id()=='developer06')\n {\n //System::debug($this->map['start_remain']);\n }\n\t\t\t$cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t(\n\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t)\n\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date >=\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t\t'.(Url::get('date_to')?' AND wh_invoice.create_date <=\\''.Date_Time::to_orc_date(Url::get('date_to')).'\\'':'').'\n\t\t\t';\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice.*,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'IMPORT\\',wh_invoice.bill_number,\\'\\') AS import_invoice_code,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'EXPORT\\',wh_invoice.bill_number,\\'\\') AS export_invoice_code,\n\t\t\t\t\twh_invoice_detail.num,wh_invoice_detail.warehouse_id,wh_invoice_detail.to_warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice\n\t\t\t\t\tINNER JOIN wh_invoice_detail ON wh_invoice_detail.invoice_id = wh_invoice.id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$cond.'\n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\tif(isset($old_items[$row['id']]))\n {\n\t\t\t\tif(isset($old_items[$row['id']]['import_number']))\n\t\t\t\t\t$this->map['start_remain'] += round($old_items[$row['id']]['import_number'],2);\n\t\t\t\tif(isset($old_items[$row['id']]['export_number']))\n\t\t\t\t\t$this->map['start_remain'] -= round($old_items[$row['id']]['export_number'],2);\t\t\t\n\t\t\t}\n\t\t\t$remain = $this->map['start_remain'];\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$items[$key]['create_date'] = Date_Time::convert_orc_date_to_date($value['create_date'],'/');\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n\t\t\t\t\t$items[$key]['import_number'] = $value['num'];\n else\n\t\t\t\t\t$items[$key]['import_number'] = 0;\n\t\t\t\tif($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n $items[$key]['export_number'] = $value['num']; \n }\n else\n\t\t\t\t\t$items[$key]['export_number'] = 0;\n\t\t\t\t$this->map['end_remain'] += round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n\t\t\t\t$remain = round($remain,2) + round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n if(User::id()=='developer06')\n {\n //echo $remain.'</br>';\n }\n\t\t\t\t$items[$key]['remain'] = $remain;\n\t\t\t\t$this->map['import_total'] += $items[$key]['import_number'];\n\t\t\t\t$this->map['export_total'] += $items[$key]['export_number'];\n if($items[$key]['export_number'] < 1)\n {\n $items[$key]['export_number'] = '0'.$items[$key]['export_number'];\n }\n\t\t\t}\n\t\t\t$this->map['end_remain'] += $this->map['start_remain'];\n\t\t\treturn $items;\n\t\t}\n\t}", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "function ppt_resources_get_planned_delivered($data)\n{\n $year = date('Y');\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $user = user_load($uid);\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n } else {\n $countries = get_user_countries($user);\n }\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries, FALSE);\n }\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = $data['products'];\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid, FALSE, FALSE);\n } else {\n $products = get_target_products_for_accounts($accounts);\n }\n }\n\n $nodes = get_planned_orders_for_acconuts_per_year($year, $accounts);\n\n // Initialze empty months.\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n $final_arr = [];\n if (isset($nodes)) {\n // Consider a product exists with mutiple accounts.\n foreach ($nodes as $nid => $item) {\n $node = node_load($nid);\n $planned_product_tid = $node->field_planned_product[\"und\"][0][\"target_id\"];\n if (in_array($planned_product_tid, $products)) {\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n // Get node values for product (planned and delivered).\n if (isset($node->field_planned_period[\"und\"])) {\n $node_date = $node->field_planned_period[\"und\"][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity[\"und\"])) {\n $planned_quantity = $node->field_planned_quantity[\"und\"][0][\"value\"];\n }\n if (isset($node->field_planned_actual_period[\"und\"])) {\n $node_date = $node->field_planned_actual_period[\"und\"][0]['value'];\n $delivery_month = date(\"F\", strtotime($node_date));\n }\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity[\"und\"])) {\n $delivered_quantity = $node->field_planned_delivered_quantity[\"und\"][0][\"value\"];\n }\n // If product already exists, update its values for node months.\n if (isset($final_arr[$planned_product_name])) {\n if (isset($final_arr[$planned_product_name][\"Planned\"][$planned_month])) {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] = [(int) $planned_quantity];\n }\n if (isset($final_arr[$planned_product_name][\"Actual\"][$delivery_month])) {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr[$planned_product_name] = [\"Actual\" => [], \"Planned\" => []];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr[$planned_product_name][\"Actual\"][$month] = [0];\n $final_arr[$planned_product_name][\"Planned\"][$month] = [0];\n }\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n $final_arr[$planned_product_name][\"Planned\"][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n }\n // [product => [actual => [months], target => [months]]]\n return $final_arr;\n}", "public function getProfitMonth(){\n\t\tglobal $db;\n\t\t$date_now = date('Y-m').'-01';\n\t\t$last_month = date('Y-m', strtotime('-1 month')).'-01';\n\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report WHERE date_init BETWEEN '$last_month' AND '$date_now' \");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "function ppt_resources_target_delivered_report($data)\n{\n global $user;\n $current_uid = $user->uid;\n // Varriables\n $date = [];\n if (isset($data['year'])) {\n $date = get_year_dates($data['year']);\n } else {\n $date = get_year_dates();\n }\n if (!isset($data['reps']) && !isset($data['accounts']) && !isset($data['therapeutic'])) {\n if (!isset($data['year'])) {\n $date = get_year_dates();\n } else {\n $date = get_year_dates($data['year']);\n }\n $user_products = get_products_for_current_user($current_uid);\n $user_accounts = get_accounts_for_current_user($current_uid);\n return get_target_delivered_report($current_uid, $user_accounts, $user_products, $date);\n }\n if (is_comm_lead($user)) {\n if (isset($data['team']) && !isset($data['reps'])) {\n if (is_array($data['team'])) {\n $data['team'] = $data['team'][0];\n }\n $data['reps'] = array_keys(ppt_resources_get_team_reps($data));\n }\n }\n if (!$data['reps']) {\n return \"please enter reps\";\n } elseif (!$data['accounts']) {\n return \"please enter accounts\";\n } elseif (!$data['therapeutic']) {\n return \"please enter thermatic area\";\n } else {\n if (!is_array($data['accounts'])) {\n $data['accounts'] = [$data['accounts']];\n }\n if (!is_array($data['therapeutic'])) {\n $data['therapeutic'] = [$data['therapeutic']];\n }\n $account_info = node_load_multiple($data['accounts']);\n $account_products_ids = [];\n foreach ($account_info as $info) {\n $account_products_array = $info->field_products['und'];\n foreach ($account_products_array as $product) {\n $account_products_ids[] = $product['target_id'];\n }\n }\n $thermatic_area_products_ids = get_thermatic_area_products_ids($data[\"therapeutic\"]);\n if (isset($account_products_ids)) {\n foreach ($account_products_ids as $product_id) {\n if (isset($thermatic_area_products_ids)) {\n if (in_array($product_id, $thermatic_area_products_ids)) {\n $data['products'][] = $product_id;\n }\n } else {\n $data['products'] = [];\n }\n }\n } else {\n $data['products'] = [];\n }\n if (isset($data['products']) && !empty($data['products'])) {\n return get_target_delivered_report($data['reps'], $data['accounts'], $data['products'], $date);\n } else {\n return \"there is no product match for that account with therapeutic area\";\n }\n }\n}", "function quantizer_expenses_management_report($cost_center = null, $management = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerExpenses($cost_center, $management, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\t\t\t\r\n\t\t\t/*echo \"<pre>\";\r\n\t\t\tprint_r($resultado);\r\n\t\t\techo \"</pre>\";*/\r\n\t\t\t\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "public function getProfit(){\n\t\tglobal $db;\n\t\t$sql = $db->prepare(\"SELECT SUM(price) FROM project01_report;\");\n\t\t$sql->execute();\n\t\tif ($sql->rowCount()>0) {\n\t\t\t$profit = $sql->fetch();\n\t\t\treturn $profit;\n\t\t}\n\t}", "public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }", "public function releaseRefPointsOnEveryShoping()\n {\n \t//More you pay less you release.\n \t//Get the points for other shops.\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function accountreceiptandpayment()\n {\n date_default_timezone_set(\"asia/dhaka\");\n $current = date(\"m/d/Y\");\n $creadit_amount = AccountTransectionDetails::where('date', $current)->where('is_active', 1)->where('cr_amount', NULL)->OrderBy('id', 'DESC')->get();\n $caamount = AccountTransectionDetails::where('date', '<', $current)->where('is_active', 1)->where('cr_amount', NULL)->sum('dr_amount');\n $creadit_amount = $creadit_amount->groupby('account_head_details');\n $creadit_amount = $creadit_amount->all();\n $davit_amount = AccountTransectionDetails::where('date', $current)->where('is_active', 1)->where('dr_amount', NULL)->OrderBy('id', 'DESC')->get();\n $dvamount = AccountTransectionDetails::where('date', '<', $current)->where('is_active', 1)->where('dr_amount', NULL)->sum('cr_amount');\n $davit_amount = $davit_amount->groupby('account_head_details');\n $davit_amount = $davit_amount->all();\n return view('accounts.reports.accountreceiptandpayment', compact('caamount', 'creadit_amount', 'davit_amount', 'dvamount'));\n }", "public function upcomingDebit()\n {\n $where = \"(SELECT DATEDIFF(so.`due_date`, '$this->curDate') AS days) < 14 AND so.`status_paid` = 0 AND so.active = 1\";\n $so = $this->db\n ->from('sales_order so')\n ->join('customer c', 'c.id_customer = so.id_customer')\n ->where($where)\n ->order_by('so.id_sales_order asc')\n ->get()\n ->result();\n\n return $so;\n }", "public function getfilingfee()\n\t{\n\t\t$filingId = $_SESSION['filingId'];\n\t\t$form_type = $_SESSION['formtype'];\n\t\t$result = $this->productpaymentDAO->getfilingfee($filingId, $form_type);\n\t\treturn $result;\n\t}", "function fetch_customer_data($connect)\n{\t\n\t$totalprice=0;\n $query = \"SELECT * FROM PAYMENT5\";\n \n //oci_parse ( resource $connect , string $sql_text ) \n //oci_fetch ( resource $statement ) : bool\n\t$statement = $connect->prepare($query);\n\t$statement->execute();\n\t$result = $statement->fetchAll();\n\t$output = '\n \n <div class=\"invoice-box\">\n <table cellpadding=\"0\" cellspacing=\"0\">\n <tr class=\"top\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td class=\"title\">\n <img src=\"logo.png\" style=\"width:70%; max-width:70px;\">\n </td>\n \n <td>\n Invoice #: 123<br>\n Created: January 1, 2015<br>\n Due: February 1, 2015\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"information\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td>\n Sparksuite, Inc.<br>\n 12345 Sunny Road<br>\n Sunnyville, CA 12345\n </td>\n \n <td>\n Acme Corp.<br>\n John Doe<br>\n [email protected]\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Payment Method\n </td>\n \n <td>\n Check #\n </td>\n </tr>\n \n <tr class=\"details\">\n <td>\n Check\n </td>\n \n <td>\n 1000\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Item\n </td>\n \n <td>\n Price\n </td>\n </tr>\n \n \n \n\n\t';\n\tforeach($result as $row)\n\t{\n\t\t$output .= '\n\n\n\t\t<tr class=\"item\">\n <td>\n '.$row[\"PNAME\"].'\n\n </td>\n <td>\n '.$row[\"PQTY\"].'\n\n </td>\n \n <td>\n '.$row[\"TOTAL\"].'\n </td>\n </tr>\n\t\t\t\n\t\t';\n\n\n\t\t$totalprice=$totalprice+$row[\"TOTAL\"];\n\t}\n\n\t$output .= '\n <tr class=\"total\">\n <td></td>\n \n <td>\n Total: '.$totalprice.'\n </td>\n </tr>\n\t\n\t';\n\n\t$output .= '\n\n\t\t</table>\n\t</div>\n\t';\n\treturn $output;\n\n\n}", "function estcalcpaperinfo($quoteid) {\n global $conn, $lang,$userid,$active_company;\n $recordSet=&$conn->Execute('select estprpricestockusagestock.numberout,estprpricestockusagestock.numberup,estprpricestockusagestock.cuts,estquotestdsize.width,estquotestdsize.length,estquotesubstock.inchesperm from estquote,estprprice,estprpricestockusage,estprpricestockusagestock,estquotesubstock,estquotestdsize where estquotestdsize.id=estprprice.estquotestdsizeid and estquote.id='.sqlprep($quoteid).' and estprprice.id=estquote.prpriceid and estprpricestockusage.prpriceid=estprprice.id and estprpricestockusagestock.stockusageid=estprpricestockusage.id and estquotesubstock.id=estprpricestockusagestock.substockid');\n if ($recordSet&&!$recordSet->EOF) {\n $numberout=$recordSet->fields[0];\n $numberup=$recordSet->fields[1];\n $cuts=$recordSet->fields[2];\n $width=$recordSet->fields[3];\n $length=$recordSet->fields[4];\n $height=$recordSet->fields[5];\n };\n if ($numberup==0) $numberup=1;\n $recordSet=&$conn->Execute('select max(estquotesubstock.parts), sum(estquotestdsize.length) from estquote,estprprice,estprpricestockusage,estprpricestockusagestock,estquotesubstock,estquotestdsize where estquotestdsize.id=estprprice.estquotestdsizeid and estquote.id='.sqlprep($quoteid).' and estprprice.id=estquote.prpriceid and estprpricestockusage.prpriceid=estprprice.id and estprpricestockusagestock.stockusageid=estprpricestockusage.id and estquotesubstock.id=estprpricestockusagestock.substockid');\n if ($recordSet&&!$recordSet->EOF) {\n $parts=$recordSet->fields[0];\n $totlength=$recordSet->fields[1];\n };\n $stuff=array(\"parts\" => $parts, \"numberout\" => $numberout, \"numberup\" => $numberup, \"cuts\" => $cuts, \"width\" => $width, \"length\" => $length, \"height\" => $height, \"totlength\" => $totlength);\n return $stuff;\n }", "public function getSalesFromCOD()\n {\n $salesFromCOD = Order::whereNotIn('status', ['cancelled', 'refunded'])->where('payment_type', 'cod')\n // ->when(auth()->user()->hasRole('vendor'), function ($query) {\n // $query->where('vendor_id', auth()->user()->vendor->id);\n // })\n ->sum('total_price');\n return $salesFromCOD;\n }", "public function getTotalInvoiced();", "function payDay(){\n\t\t$totalStaffCost = 0;\n\t\t// get all memeber's weekly salary and add them together\n\t\tforeach($this->urlms->getLab_index(0)->getStaffMembers() as $member){\n\t\t\t$totalStaffCost += $member->getWeeklySalary();\n\t\t}\n\t\tdate_default_timezone_set('America/New_York');\n\t\t$date = date('m/d/Y', time());\n\t\t$this->addTransaction(\"Staff Funding\", \"PAYDAY\", $totalStaffCost, \"expense\", $date);\n\t\treturn $totalStaffCost;\n\t}", "public function getDemand($id) {\n //$id -> idptmaster\n\n $data = array();\n //array(Yii::t('application', 'Propertytax'), 0, 0, 0, 4, 5, 8, 5),\n\n\n $criteria = new CDbCriteria(array(\n 'with' => array(\n 'idptmaster0' => array(\n 'condition' => 'idptmaster0.idptmaster =:idptmaster',\n 'params' => array(':idptmaster' => $id)\n ),\n ),\n 'condition' => 'idccfyear = :idccfyear',\n 'params' => array(':idccfyear' => Yii::app()->session['ccfyear']->idccfyear),\n ));\n\n\n $pttransaction = Pttransaction::model()->find($criteria);\n $status = 'Success';\n $message = '';\n $demandnumber = '';\n $demandinname = '';\n $demandamount = '0';\n $oldfddemandreceipts = array();\n $oldamountpaid = 0;\n\n// $propertytaxpaid = 0;\n// $minsamekittaxpaid = 0;\n//,propertytax,servicetax,minsamekittax,samekittax,waterpttax,educess,subcess1,subcess2,pttaxdiscount,pttaxsurcharge,\n//paid=0;$propertytaxpaid=0;$servicetaxpaid=0;$minsamekittaxpaid=0;$samekittaxpaid=0;$waterpttaxpaid=0;$educesspaid=0;$subcess1paid=0;$subcess2paid=0;$pttaxdiscountpaid=0;$pttaxsurchargepaid=0;$\n\n $propertytaxpaid = 0;\n $servicetaxpaid = 0;\n $minsamekittaxpaid = 0;\n $samekittaxpaid = 0;\n $waterpttaxpaid = 0;\n $educesspaid = 0;\n $subcess1paid = 0;\n $subcess2paid = 0;\n $pttaxdiscountpaid = 0;\n $pttaxsurchargepaid = 0;\n $amountpaid = 0;\n $discountpaid = 0;\n\n\n if (isset($pttransaction)) {\n\n $criteria = new CDbCriteria(array(\n 'condition' => 'demandnumber = :demandnumber',\n 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n ));\n $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n foreach ($fddemandreceipts as $fddemandreceipt) {\n $oldamountpaid += $fddemandreceipt->amountpaid;\n $oldfddemandreceipts[] = $fddemandreceipt;\n\n if (isset($fddemandreceipt->details)) {\n $jsonss = json_decode($fddemandreceipt->details, true);\n $array = array();\n foreach ($jsonss as $jsons) {\n $array[$jsons['name']] = $jsons['value'];\n }\n $propertytaxpaid += $array[\"details-inputgrid[0][amount]\"] + $array[\"details-inputgrid[0][discount]\"];\n $minsamekittaxpaid += $array[\"details-inputgrid[1][amount]\"] + $array[\"details-inputgrid[1][discount]\"];\n\n $samekittaxpaid += $array[\"details-inputgrid[2][amount]\"] + $array[\"details-inputgrid[2][discount]\"];\n $educesspaid += $array[\"details-inputgrid[3][amount]\"] + $array[\"details-inputgrid[3][discount]\"];\n\n $subcess1paid += $array[\"details-inputgrid[4][amount]\"] + $array[\"details-inputgrid[4][discount]\"];\n $subcess2paid += $array[\"details-inputgrid[5][amount]\"] + $array[\"details-inputgrid[5][discount]\"];\n \n $pttaxdiscountpaid += $array[\"details-inputgrid[6][amount]\"] + $array[\"details-inputgrid[6][discount]\"];\n $pttaxsurchargepaid += $array[\"details-inputgrid[7][amount]\"] + $array[\"details-inputgrid[7][discount]\"];\n $servicetaxpaid += $array[\"details-inputgrid[8][amount]\"] + $array[\"details-inputgrid[8][discount]\"];\n $waterpttaxpaid += $array[\"details-inputgrid[9][amount]\"] + $array[\"details-inputgrid[9][discount]\"];\n \n \n \n \n// for ($i = 0; $i < 10; $i++) {\n// $id = \"details-inputgrid[\" . $i . \"][amount]\";\n// $propertytaxpaid += $array[\"details-inputgrid[\" . $i . \"][amount]\"] + $array[\"details-inputgrid[\" . $i . \"][discount]\"];\n// }\n }\n }\n\n $data[] = array(\n Yii::t('application', 'Propertytax'),\n $pttransaction->oldpropertytax,\n $pttransaction->propertytax,\n $pttransaction->oldpropertytax + $pttransaction->propertytax,\n $propertytaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Minsamekittax'),\n $pttransaction->oldminsamekittax,\n $pttransaction->minsamekittax,\n $pttransaction->oldminsamekittax + $pttransaction->minsamekittax,\n $minsamekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Samekittax'),\n $pttransaction->oldsamekittax,\n $pttransaction->samekittax,\n $pttransaction->oldsamekittax + $pttransaction->samekittax,\n $samekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Educess'),\n $pttransaction->oldeducess,\n $pttransaction->educess,\n $pttransaction->oldeducess + $pttransaction->educess,\n $educesspaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess1'),\n $pttransaction->oldsubcess1,\n $pttransaction->subcess1,\n $pttransaction->oldsubcess1 + $pttransaction->subcess1,\n $subcess1paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess2'),\n $pttransaction->oldsubcess2,\n $pttransaction->subcess2,\n $pttransaction->oldsubcess2 + $pttransaction->subcess2,\n $subcess2paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxdiscount'),\n $pttransaction->oldpttaxdiscount,\n $pttransaction->pttaxdiscount,\n $pttransaction->oldpttaxdiscount + $pttransaction->pttaxdiscount,\n $pttaxdiscountpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxsurcharge'),\n $pttransaction->oldpttaxsurcharge,\n $pttransaction->pttaxsurcharge,\n $pttransaction->oldpttaxsurcharge + $pttransaction->pttaxsurcharge,\n $pttaxsurchargepaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Servicetax'),\n $pttransaction->oldservicetax,\n $pttransaction->servicetax,\n $pttransaction->oldservicetax + $pttransaction->servicetax,\n $servicetaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Waterpttax'),\n $pttransaction->oldwaterpttax,\n $pttransaction->waterpttax,\n $pttransaction->oldwaterpttax + $pttransaction->waterpttax,\n $waterpttaxpaid,\n 0,\n 0,\n 0,\n );\n\n\n\n\n// $status = 'Success';\n// \n// $criteria = new CDbCriteria(array(\n// 'condition' => 'demandnumber = :demandnumber',\n// 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n// ));\n// $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n// foreach($fddemandreceipts as $fddemandreceipt){\n// $oldamountpaid += $fddemandreceipt->amountpaid;\n// $oldfddemandreceipts[] = $fddemandreceipt;\n// }\n// \n// $grand_propertytax = \n// ($pttransaction->oldpropertytax+$pttransaction->oldservicetax+$pttransaction->oldminsamekittax+$pttransaction->oldsamekittax+$pttransaction->oldwaterpttax+$pttransaction->oldeducess+$pttransaction->oldsubcess1+$pttransaction->oldsubcess2-$pttransaction->oldpttaxdiscount+$pttransaction->oldpttaxsurcharge);\n// + \n// ($pttransaction->propertytax+$pttransaction->servicetax+$pttransaction->minsamekittax+$pttransaction->samekittax+$pttransaction->waterpttax+$pttransaction->educess+$pttransaction->subcess1+$pttransaction->subcess2)\n// ;\n }\n return $data;\n }", "public function getQuoteData()\n {\n $quote= Mage::getSingleton('checkout/session')->getQuote();\n $data = array();\n if ($quote) {\n $data['checkoutId'] = $quote->getId();\n $data['currency'] = $quote->getQuoteCurrencyCode();\n $data['total'] = Mage::helper('affirm/util')->formatCents($quote->getGrandTotal());\n }\n return $data;\n\n }", "public function index()\n\t{\n\t\t$currencyController = new CurrencyController();\n\t\t$data = array(\n\t\t\t'pageTitle' => 'Spending',\n\t\t\t'secondaryCurrencyMoney' => $currencyController->convert(\\Auth::user()->currentMoney, \\Auth::user()->mainCurrency, \\Auth::user()->secondaryCurrency)\n\t\t);\n\t\t$spendings = \\DB::table('pengeluaran')->where('idUser', \\Auth::user()->id)->get();\n\t\t$nextPayment = array();\n\t\t// $nextPayment = array();\n\t\tforeach ($spendings as $spending) {\n\t\t\t$date = Carbon::parse($spending->nextPayment);\n\t\t\t\t\t\n\t\t\tif ($spending->frequency == \"monthly\") {\n\t\t\t\twhile($date->isPast()){\n\t\t\t\t\t$date->addMonth();\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($spending->frequency = \"daily\"){\n\t\t\t\twhile($date->isPast()){\n\t\t\t\t\t$date->addDay();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nextPayment[$spending->id] = $date->toFormattedDateString();\n\t\t}\n\t\treturn \\View::make('spending.spending')->with('data',$data)->with('spendings', $spendings)->with('nextPayment',$nextPayment);\n\t}", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "public function todaysSalesTotal()\n {\n \n //get todays Date\n $fromDate = Mage::helper('magemobapp')->getTodaysDate();\n \n $storeId = Mage::getModel('magemobapp/storeinfo')->getStoreId();\n \n $collection = Mage::getResourceModel('sales/order_collection')->addAttributeToFilter('created_at', array(\n 'from' => $fromDate\n ));\n \n if ($storeId != 0) {\n $collection->addAttributeToFilter('store_id', $storeId); //fill store\n }\n //$collection;\n \n $collection->addAttributeToSelect('base_grand_total')->addAttributeToSelect('base_total_refunded')->addAttributeToSelect('base_total_paid');\n\n \n $data = $collection->getData();\n $total = 0;\n foreach ($data as $eachData) {\n if (isset($eachData['status']) && $eachData['status'] == 'complete') {\n if ($eachData['base_total_refunded'] == '') {\n $total += (float) $eachData['base_total_paid'];\n } else {\n $total += (float) $eachData['base_total_paid'] - (float) $eachData['base_total_refunded'];\n }\n } else {\n $total += (float) $eachData['base_grand_total'];\n }\n }\n return Mage::helper('core')->currency($total, true, false);\n }", "public function mycollectedCash(Request $request)\n {\n \n\n $currentdtaetime=date(\"Y-m-d H:i:s\", strtotime(\"+30 minutes\"));\n \n $noofinitorder = Ordercollection::select()->whereDate('finalorderdeliverydt',date(\"Y-m-d\"))->where('sossoid',$request->user()->id)\n ->where('okupdate','1')->where('paidamount','!=','0')->get();\n if(count($noofinitorder) > 0){\n return response()->json($noofinitorder, 200);\n }else{\n return response()->json([\n 'response' => 'error',\n 'message' => 'Problem in data'\n ], 400); \n }\n \n \n }", "public function calculate() {\n $price = $this->calculateFirstPayment($user);\n\n $currency = $price->currency;\n\n if ($user == Constants::USER_CLIENT) {\n $credit = ClientTransaction::getCreditBalance(Yii::app()->user->id);\n } else {\n $credit = new Price(0, $currency); //carer can't have credit\n }\n\n $paidCredit = new Price(0, $currency);\n $paidCash = new Price(0, $currency);\n $remainingCreditBalance = new Price(0, $currency);\n\n if ($credit->amount > 0) {\n\n if ($credit->amount >= $price->amount) {\n\n $paidCredit = $price;\n $remainingCreditBalance = $credit->substract($price);\n } else {\n\n $paidCash = $price->substract($credit);\n $paidCredit = $credit;\n }\n } else {\n $paidCash = $price;\n }\n\n return array('toPay' => $price, 'paidCash' => $paidCash, 'paidCredit' => $paidCredit, 'remainingCreditBalance' => $remainingCreditBalance);\n }", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "private function getQuotes()\n {\n $requestString = $this->carrierCache->serialize($this->shipperRequest);\n $resultSet = $this->carrierCache->getCachedQuotes($requestString, $this->getCarrierCode());\n $timeout = $this->restHelper->getWebserviceTimeout();\n if (!$resultSet) {\n $initVal = microtime(true);\n $resultSet = $this->shipperWSClientFactory->create()->sendAndReceive(\n $this->shipperRequest,\n $this->restHelper->getRateGatewayUrl(),\n $timeout\n );\n $elapsed = microtime(true) - $initVal;\n $this->shipperLogger->postDebug('Shipperhq_Shipper', 'Short lapse', $elapsed);\n\n if (!$resultSet['result']) {\n $backupRates = $this->backupCarrier->getBackupCarrierRates(\n $this->rawRequest,\n $this->getConfigData(\"backup_carrier\")\n );\n if ($backupRates) {\n return $backupRates;\n }\n }\n $this->carrierCache->setCachedQuotes($requestString, $resultSet, $this->getCarrierCode());\n }\n $this->shipperLogger->postInfo('Shipperhq_Shipper', 'Rate request and result', $resultSet['debug']);\n return $this->parseShipperResponse($resultSet['result']);\n }", "public function searchCashPaidBetweenTimePeriod(request $request){\n\n try {\n $validator = Validator::make($request->all(), [\n 'from'=> 'required',\n 'to'=> 'required',\n ]);\n\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to])\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to])->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "public function supplierdata($supplier_id)\n {\n $supplierdata = $this->Dbmodel->get_supplier_data($supplier_id); \n return $supplierdata;\n }", "public function getinvoice($id) \n\n {\n $customer = array();\n $data = PurchaseOrder::find($id);\n $SupplierDetail = DB::table('zenrolle_purcahse')->join('zenrolle_suppliers','zenrolle_purcahse.supplier','=','zenrolle_suppliers.id')\n ->select('zenrolle_suppliers.id','zenrolle_suppliers.name','zenrolle_suppliers.address','zenrolle_suppliers.city','zenrolle_suppliers.country','zenrolle_suppliers.phone','zenrolle_suppliers.email','zenrolle_purcahse.invoice_no','zenrolle_purcahse.reference_no','zenrolle_purcahse.order_date','zenrolle_purcahse.due_date','zenrolle_purcahse.payment_made','zenrolle_purcahse.invoice_note')\n ->where('zenrolle_purcahse.id',$id)->get();\n $invoice = PurchaseItem::where('pid',$id)->get();\n \n $customer['invoice'] = $invoice;\n $payment_method = DB::table('zenrolle_paymentmethod')->select('id','payment_type')\n ->get();\n $data->due_balance = $data->total - $data->payment_made;\n return view('purchasing.purchase_order.create',compact('invoice','data',\n 'SupplierDetail','payment_method')); \n }" ]
[ "0.63667494", "0.6291061", "0.6058577", "0.5928474", "0.59229475", "0.5888509", "0.5872082", "0.58637476", "0.5796674", "0.5796052", "0.5745656", "0.57418054", "0.57401776", "0.57177097", "0.55616957", "0.55249333", "0.5523045", "0.550979", "0.55005294", "0.5458427", "0.5429169", "0.5421365", "0.5418311", "0.5417738", "0.5406963", "0.539826", "0.53972197", "0.539394", "0.53837466", "0.537461", "0.5371309", "0.53624856", "0.5357628", "0.5356359", "0.5345399", "0.5345026", "0.53416646", "0.53393275", "0.53381723", "0.5331717", "0.5330887", "0.5330726", "0.53022164", "0.5287229", "0.5287088", "0.52829415", "0.5278896", "0.5274175", "0.5269449", "0.526923", "0.52687764", "0.52609205", "0.52606744", "0.52590054", "0.5258334", "0.5251414", "0.5250476", "0.52457654", "0.5242081", "0.52397877", "0.5235775", "0.52288103", "0.5225259", "0.5222093", "0.521393", "0.5210985", "0.52107644", "0.5206598", "0.5198992", "0.51975167", "0.51944476", "0.5193912", "0.51853025", "0.51813966", "0.51751006", "0.5172341", "0.51701856", "0.5167406", "0.5166557", "0.51643384", "0.51627433", "0.5156329", "0.51561594", "0.5154628", "0.51515305", "0.5149971", "0.5148584", "0.51477623", "0.51453424", "0.5145229", "0.5144351", "0.51412934", "0.514002", "0.51374835", "0.5136352", "0.5135628", "0.51268655", "0.5118756", "0.5117965", "0.5116378" ]
0.61347896
2
get all cash paid to suppliers details between two dates
public function searchCashPaidBetweenTimePeriod(request $request){ try { $validator = Validator::make($request->all(), [ 'from'=> 'required', 'to'=> 'required', ]); $invoiceDetials = array(); $invoiceDetials = DB::table('purchase_invoices') ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum') ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id') ->select( 'cash_paid_to_suppliers.invoiceNum', 'supplier_details.supplierName', 'cash_paid_to_suppliers.date', 'cash_paid_to_suppliers.cashPaid' ) ->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to]) ->get(); $cashPaid = DB::table('cash_paid_to_suppliers')->whereBetween('cash_paid_to_suppliers.date', [$request->from, $request->to])->sum('cashPaid'); return response()->json([ 'success'=>true, 'error'=>null, 'code'=>200, 'total'=>count($invoiceDetials), 'cumCashPaid'=>$cashPaid, 'data'=>$invoiceDetials ], 200); } catch (Exception $e) { return response()->json([ 'success'=>false, 'error'=>($e->getMessage()), 'code'=>500 ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function getTodayCashPaidInvoiceDetails(){\n\n $myDate = Carbon::now();\n $todayDate = $myDate->toDateString(); \n\n try {\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->where('cash_paid_to_suppliers.date','=',$todayDate)\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->where('cash_paid_to_suppliers.date','=',$todayDate)->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "public function getAllCashPaidInvoiceDetails(){\n\n try {\n $invoiceDetials = array();\n $invoiceDetials = DB::table('purchase_invoices')\n ->join('cash_paid_to_suppliers', 'purchase_invoices.invoiceNum', '=', 'cash_paid_to_suppliers.invoiceNum')\n ->join('supplier_details', 'purchase_invoices.supplierId', '=', 'supplier_details.id')\n ->select(\n 'cash_paid_to_suppliers.invoiceNum',\n 'supplier_details.supplierName', \n 'cash_paid_to_suppliers.date', \n 'cash_paid_to_suppliers.cashPaid'\n )\n ->get();\n\n $cashPaid = DB::table('cash_paid_to_suppliers')->sum('cashPaid'); \n\n return response()->json([\n 'success'=>true,\n 'error'=>null,\n 'code'=>200,\n 'total'=>count($invoiceDetials),\n 'cumCashPaid'=>$cashPaid,\n 'data'=>$invoiceDetials\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'success'=>false,\n 'error'=>($e->getMessage()),\n 'code'=>500\n ], 500);\n }\n }", "function getReceiptCommercial()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = 'SELECT re.receipt_ref AS \"Receipt Ref\", r.relationship_name AS \"Supplier\", to_char(receipt_date,\\'dd/mm/yyyy\\') AS \"Receipt Date\" \n\t\tFROM '.receipt_table .' re \n\t\tJOIN '.relationships_table.' r ON r.relationship_id=re.supplier_id \n\t\tWHERE re.receipt_id = '.$this->receipt_id;\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptCommercial, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}", "function get_list_by_feeelement($sy_id_from,$sy_id_to,$date_from,$date_to) {\n\t\t$cmd =\n\t\t\t\"SELECT $this->tblname.student_id,first_name,middle_name,last_name,date,orno,$this->tblname.feeelement_id,payment\" .\n\t\t\t\" FROM $this->tblname,tblstudentinfo\" .\n\t\t\t\" WHERE (sy_id BETWEEN $sy_id_from AND $sy_id_to)\" .\n\t\t\t($date_from>0 ? \" AND date>='$date_from'\" : \"\") .\n\t\t\t($date_to>0 ? \" AND date<='$date_to'\" : \"\") .\n\t\t\t\" AND $this->tblname.student_id=tblstudentinfo.student_id\" .\n\t\t\t\" ORDER BY date,orno,$this->tblname.student_id\";\n\t\treturn $this->query( $cmd );\n\t}", "private function queryDepositsAndWithdrawals() {\r\n return $this->queryAPI( 'returnDepositsWithdrawals', //\r\n [\r\n 'start' => time() - 14 * 24 * 3600,\r\n 'end' => time() + 3600\r\n ]\r\n );\r\n\r\n }", "public function stock_report_supplier_bydate($product_id,$supplier_id,$date,$perpage,$page){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as 'totalPrhcsCtn',\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else\n\t\t{\n\t\t\t$this->db->where('a.status',1);\n\t\t\t$this->db->where('e.purchase_date <=' ,$date);\n\t\t\t$this->db->where('a.supplier_id',$supplier_id);\t\n\t\t}\n\t\t$this->db->limit($perpage,$page);\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function show_buy_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`product_id`) as product_id, GROUP_CONCAT(`type`) as type,GROUP_CONCAT(`weight`) as weight, GROUP_CONCAT(`instock`) as instock ,GROUP_CONCAT(`paid`) as paid,GROUP_CONCAT(`due`) as due, GROUP_CONCAT(`price`) as price,SUM(`price`) as tp FROM `purchase` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "public function consolidatedLoanDeductionByDate($from,$to){\n $from = new Carbon($from);\n $from = $from->toDateString();\n $destDate = new Carbon($to);\n $to = $destDate->toDateString();\n\n return $collection = Userconsolidatedloan::\n where('date_entry','>=',$from)\n ->where('date_entry','<=',$to)\n ->orderBy('user_id', 'asc')\n ->get();\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "function getGuardCharge($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$scheduledays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\t//Set payment dates if they are not set\n\t\tif(trim($startdate) == \"\"){\n\t\t\t$datearray = getRowAsArray(\"SELECT lastpaymentdate, dateofemployment FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\t\tif($datearray['lastpaymentdate'] != \"\"){\n\t\t\t\t$startdate = $datearray['lastpaymentdate'];\n\t\t\t} else {\n\t\t\t\t$startdate = $datearray['dateofemployment'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Give it the current date if it has not been set yet\n\t\tif(trim($enddate) == \"\"){\n\t\t\t$enddate = date(\"d-M-Y\");\n\t\t}\n\t\t\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif(!in_array($assgnarr[1],$statusarr) && $assgnarr[0] == $guardid && $assgnarr[1] != \"\"){\n\t\t\t\t\t$scheduledays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Return the amount to be paid to the guard for regular work done\n\t$guard = getRowAsArray(\"SELECT rate FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\n\treturn $scheduledays*$guard['rate'];\n}", "public function tax_report_product_wise($from_date,$to_date){\n\n\t\t$today = date(\"m-d-Y\");\n\t\t$this->db->select(\"\n\t\t\ta.amount,\n\t\t\ta.date,\n\t\t\ta.invoice_id,\n\t\t\tb.product_name,\n\t\t\tc.tax_name\n\t\t\t\");\n\t\t$this->db->from('tax_collection_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id','left');\n\t\t$this->db->join('tax c','c.tax_id = a.tax_id');\n\n\t\tif (empty($from_date)) {\n\t\t\t$this->db->where('a.date',$today);\n\t\t}else{\n\t\t\t$this->db->where('a.date >=', $from_date);\n\t\t\t$this->db->where('a.date <=', $to_date);\n\t\t}\n\t\t$this->db->order_by('a.date','asc');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function get_customer_details($customer_id, $to=null)\n{\n\n\tif ($to == null)\n\t\t$todate = date(\"Y-m-d\");\n\telse\n\t\t$todate = date2sql($to);\n\t$past1 = get_company_pref('past_due_days');\n\t$past2 = 2 * $past1;\n\t// removed - debtor_trans.alloc from all summations\n\n $value = \"decode(\".TB_PREF.\"debtor_trans.type, 11, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type, 12, -1, \n\t\t\t\tdecode(\".TB_PREF.\"debtor_trans.type,2,\t-1, 1))) * \n\t\t\t\t\".\n \"\t(\".TB_PREF.\"debtor_trans.ov_amount + \".TB_PREF.\"debtor_trans.ov_gst + \"\n\t\t\t\t.TB_PREF.\"debtor_trans.ov_freight + \".TB_PREF.\"debtor_trans.ov_freight_tax + \"\n\t\t\t\t\t.TB_PREF.\"debtor_trans.ov_discount)\n\t\t\t \";\n\t$due = \"decode(\".TB_PREF.\"debtor_trans.type,10,\".TB_PREF.\"debtor_trans.due_date,\".TB_PREF.\"debtor_trans.tran_date)\";\n $sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"payment_terms.terms,\n\t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description,\n\t\t\n\t\tSum(\".$value.\") AS balance,\n\t\t\n\t\tSum(decode(sign(to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due),-1, 0, $value)) AS due,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past1),-1, $value, 0)) AS overdue1,\n\t\t\n\t\tSum(decode(sign((to_date('$todate', 'yyyy-mm-dd hh24:mi:ss') - $due)-$past2),-1, 0, $value)) AS overdue2 \n\t\tFROM \".TB_PREF.\"debtors_master,\n\t\t\t \".TB_PREF.\"payment_terms,\n\t\t\t \".TB_PREF.\"credit_status,\n\t\t\t \".TB_PREF.\"debtor_trans\n\n\t\tWHERE\n\t\t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n\t\t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id).\"\n\t\t\t AND \".TB_PREF.\"debtor_trans.tran_date <= to_date('$todate', 'yyyy-mm-dd hh24:mi:ss')\n\t\t\t AND \".TB_PREF.\"debtor_trans.type <> 13\n\t\t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".TB_PREF.\"debtor_trans.debtor_no\n\n\t\tGROUP BY\n\t\t\t \".TB_PREF.\"debtors_master.name,\n\t\t\t \".TB_PREF.\"payment_terms.terms,\n\t\t\t \".TB_PREF.\"payment_terms.days_before_due,\n\t\t\t \".TB_PREF.\"payment_terms.day_in_following_month,\n\t\t\t \".TB_PREF.\"debtors_master.credit_limit,\n\t\t\t \".TB_PREF.\"credit_status.dissallow_invoices,\n\t\t\t \".TB_PREF.\"debtors_master.curr_code, \t\t\n\t\t\t \".TB_PREF.\"credit_status.reason_description\";\n\t\t\t \n\t\t\t \n $result = db_query($sql,\"The customer details could not be retrieved\");\n\n if (db_num_rows($result) == 0)\n {\n\n \t/*Because there is no balance - so just retrieve the header information about the customer - the choice is do one query to get the balance and transactions for those customers who have a balance and two queries for those who don't have a balance OR always do two queries - I opted for the former */\n\n \t$nil_balance = true;\n\n \t$sql = \"SELECT \".TB_PREF.\"debtors_master.name, \".TB_PREF.\"debtors_master.curr_code, \".TB_PREF.\"debtors_master.debtor_no, \".TB_PREF.\"payment_terms.terms,\n \t\t\".TB_PREF.\"debtors_master.credit_limit, \".TB_PREF.\"credit_status.dissallow_invoices, \".TB_PREF.\"credit_status.reason_description\n \t\tFROM \".TB_PREF.\"debtors_master,\n \t\t \".TB_PREF.\"payment_terms,\n \t\t \".TB_PREF.\"credit_status\n\n \t\tWHERE\n \t\t \".TB_PREF.\"debtors_master.payment_terms = \".TB_PREF.\"payment_terms.terms_indicator\n \t\t AND \".TB_PREF.\"debtors_master.credit_status = \".TB_PREF.\"credit_status.id\n \t\t AND \".TB_PREF.\"debtors_master.debtor_no = \".db_escape($customer_id);\n\n \t$result = db_query($sql,\"The customer details could not be retrieved\");\n\n }\n else\n {\n \t$nil_balance = false;\n }\n\n $customer_record = db_fetch($result);\n\n if ($nil_balance == true)\n {\n\t\techo \"nill ba = true\";\n \t$customer_record[\"balance\"] = 0;\n \t$customer_record[\"due\"] = 0;\n \t$customer_record[\"overdue1\"] = 0;\n \t$customer_record[\"overdue2\"] = 0;\n }\n return $customer_record;\n\n\n}", "public function tax_report_invoice_wise($from_date,$to_date){\n\n\t\t$today = date(\"m-d-Y\");\n\t\t$this->db->select(\"\n\t\t\ta.tax_amount,\n\t\t\ta.date,\n\t\t\ta.invoice_id,\n\t\t\tc.tax_name\n\t\t\t\");\n\t\t$this->db->from('tax_collection_summary a');\n\t\t$this->db->join('tax c','c.tax_id = a.tax_id');\n\n\t\tif (empty($from_date)) {\n\t\t\t$this->db->where('a.date',$today);\n\t\t}else{\n\t\t\t$this->db->where('a.date >=', $from_date);\n\t\t\t$this->db->where('a.date <=', $to_date);\n\t\t}\n\t\t$this->db->order_by('a.date','asc');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function Get_Date_List($info, $first_date, $rules, $total_dates = 1, $num_service_charges = null, $start_date = null)\n{\n\t$calc = new ECash_DueDateCalculator($info, $first_date, $rules, $num_service_charges);\n\treturn $calc->getDateList($total_dates, $start_date);\n}", "public function stock_report_product_bydate($product_id,$supplier_id,$from_date,$to_date,$per_page,$page){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\t\t$this->db->limit($per_page,$page);\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_list_of_date_orno($sy_id_from,$sy_id_to,$date_from,$date_to,$collector_id=0) {\n\t\t$cmd = \"SELECT date,orno,$this->tblname.student_id,first_name,middle_name,last_name,sum(payment) AS payment,$this->tblname.user_id,fullname\"\n\t\t\t. \" FROM $this->tblname,tblstudentinfo,tblauth\"\n\t\t\t. \" WHERE (sy_id BETWEEN $sy_id_from AND $sy_id_to)\"\n\t\t\t. \" AND $this->tblname.student_id=tblstudentinfo.student_id\"\n\t\t\t. \" AND $this->tblname.user_id=tblauth.user_id\"\n\t\t\t. ($date_from>0 ? \" AND date>='$date_from'\" : \"\")\n\t\t\t. ($date_to>0 ? \" AND date<='$date_to'\" : \"\")\n\t\t\t. ($collector_id>0 ? \" AND $this->tblname.user_id=$collector_id\" : \"\")\n\t\t\t. \" GROUP BY date,orno,$this->tblname.student_id\"\n\t\t\t. \" ORDER BY date,orno,$this->tblname.student_id\";\n\t\treturn $this->query( $cmd );\n\t}", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function getCreditRequests()\n {\n $search['q'] = request('q');\n\n $partner = auth()->user()->companies->first();\n\n $creditRequests = CreditRequest::search($search['q'])->with('quotation.user','user','credits')->paginate(10);\n\n return $creditRequests;\n /*$creditRequestsPublic = CreditRequest::search($search['q'])->where('public',1)->with('quotation.user','user','shippings')->get()->all();\n \n $creditRequestsPrivate = CreditRequest::search($search['q'])->where('public', 0)->whereHas('suppliers', function($q) use($partner){\n $q->where('shipping_request_supplier.supplier_id', $partner->id);\n })->get()->all();\n\n $creditRequests = array_collapse([$creditRequestsPublic, $creditRequestsPrivate]);\n\n // dd($creditRequests);\n \n \n $paginator = paginate($creditRequests, 10);\n \n return $paginator; */\n \n \n\n \n \n }", "protected function dataSource()\n {\n $range = $this->sibling(\"PaymentDateRange\")->value();\n\n //Apply to query\n return AutoMaker::table(\"payments\")\n ->join(\"customers\",\"customers.customerNumber\",\"=\",\"payments.customerNumber\")\n ->whereBetween(\"paymentDate\",$range)\n ->select(\"customerName\",\"paymentDate\",\"checkNumber\",\"amount\");\n }", "public function product_wise_report()\n\t{\n\t\t$today = date('m-d-Y');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function customers_pending_to_pay(){\n\n\t$fecha1=Input::get('date1');\n\t$fechaActual=date(\"Y-m-d\");\n\tif($fecha1 ==\"\"){\n\t\t$valoresObtenidos=DetailCredit::where('date_payments','<=',$fechaActual)\n\t\t->WhereNull('payment_real_date')->orderBy('id_factura', 'asc')->get();\n\t\treturn view('report.report_pending_to_pay')\n\t\t->with('fecha1', $fechaActual)\n\t\t->with('valoresObtenidos', $valoresObtenidos);\n\t}else{\n\t\t$nuevaFecha1 = explode('/', $fecha1);\n\t\t$diaFecha1=$nuevaFecha1[0];\n\t\t$mesFecha1=$nuevaFecha1[1];\n\t\t$anioFecha1=$nuevaFecha1[2];\n\t\t$rFecha1=$anioFecha1.'-'.$mesFecha1.'-'.$diaFecha1;\n\n\t\t$valoresObtenidos=DetailCredit::where('date_payments','<=',$rFecha1)\n\t\t->WhereNull('payment_real_date')->orderBy('id_factura', 'asc')->get();\n\t\treturn view('report.report_pending_to_pay')\n\t\t->with('fecha1', $rFecha1)\n\t\t->with('valoresObtenidos', $valoresObtenidos);\n\t}\n}", "public function product_wise_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function get_payment_list_of( $sy_id,$student_id,$date_to=0 ) {\n\t\t$cmd =\n\t\t\t\"SELECT sum(payment) AS payment,feeelement_id FROM $this->tblname\" .\n\t\t\t\" WHERE sy_id=$sy_id\" .\n\t\t\t\" AND student_id=$student_id\" .\n\t\t\t($date_to!=0 ? \" AND date<='$date_to'\" : \"\") .\n\t\t\t\" GROUP BY feeelement_id\";\n\t\treturn $this->query($cmd);\n\t}", "function kv_supplier_trans()\n{\n $today = Today();\n $today = date2sql($today);\n $sql = \"SELECT trans.trans_no, trans.reference, trans.tran_date, trans.due_date, s.supplier_id, \n s.supp_name, s.curr_code,\n (trans.ov_amount + trans.ov_gst + trans.ov_discount) AS total, \n (trans.ov_amount + trans.ov_gst + trans.ov_discount - trans.alloc) AS remainder,\n DATEDIFF('$today', trans.due_date) AS days \n FROM \" . TB_PREF . \"supp_trans as trans, \" . TB_PREF . \"suppliers as s \n WHERE s.supplier_id = trans.supplier_id\n AND trans.type = \" . ST_SUPPINVOICE . \" AND (ABS(trans.ov_amount + trans.ov_gst + \n trans.ov_discount) - trans.alloc) > \" . FLOAT_COMP_DELTA . \"\n AND DATEDIFF('$today', trans.due_date) > 0 ORDER BY days DESC\";\n $result = db_query($sql);\n //$th = array(\"#\", trans(\"Ref.\"), trans(\"Date\"), trans(\"Due Date\"), trans(\"Supplier\"), trans(\"Currency\"), trans(\"Total\"), trans(\"Remainder\"), trans(\"Days\"));\n //start_table(TABLESTYLE);\n //table_header($th);\n echo '<table class=\"table table-hover\">\n <thead class=\"text-warning\">\n <tr><th>Ref</th> \n <th>Due Date</th>\n <th>Supplier</th>\n <th>Currency</th>\n <th>Total</th>\n <th>Days</th>\n </tr></thead>';\n $k = 0; //row colour counter\n while ($myrow = db_fetch($result)) {\n alt_table_row_color($k);\n //label_cell(get_trans_view_str(ST_SUPPINVOICE, $myrow[\"trans_no\"]));\n label_cell($myrow['reference']);\n //label_cell(sql2date($myrow['tran_date']));\n label_cell(sql2date($myrow['due_date']));\n $name = $myrow[\"supplier_id\"] . \" \" . $myrow[\"supp_name\"];\n label_cell($name);\n label_cell($myrow['curr_code']);\n amount_cell($myrow['total']);\n //amount_cell($myrow['remainder']);\n label_cell($myrow['days'], \"align='right'\");\n end_row();\n }\n end_table(1);\n}", "public function report($from_date, $to_date)\n {\n $from_date = Format::timestamp2datetime($from_date);\n $to_date = Format::timestamp2datetime($to_date);\n\n // container to hold rows/document from data store\n $rows = $this->db->select()->from($this->getTableName())\n ->where('paycom_time_datetime BETWEEN ? AND ?', [$from_date, $to_date])\n ->query()->fetchAll();\n\n // assume, here we have $rows variable that is populated with transactions from data store\n // normalize data for response\n $result = [];\n foreach ($rows as $row) {\n $result[] = [\n 'id' => $row['paycom_transaction_id'], // paycom transaction id\n 'time' => 1 * $row['paycom_time'], // paycom transaction timestamp as is\n 'amount' => 1 * $row['amount'],\n 'account' => [\n 'order_id' => $row['order_id'], // account parameters to identify client/order/service\n // ... additional parameters may be listed here, which are belongs to the account\n ],\n 'create_time' => Format::datetime2timestamp($row['create_time']),\n 'perform_time' => Format::datetime2timestamp($row['perform_time']),\n 'cancel_time' => Format::datetime2timestamp($row['cancel_time']),\n 'transaction' => $row['id'],\n 'state' => 1 * $row['state'],\n 'reason' => isset($row['reason']) ? 1 * $row['reason'] : null,\n 'receivers' => $row['receivers']\n ];\n }\n\n return $result;\n }", "public function getDoctorCashBacks()\n {\n try {\n return $this\n ->cash\n ->join('doctor_income', 'doctor_income.request_id', 'cash_back.id')\n ->where('doctor_income.account_id', auth()->user()->account_id)\n ->select(\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%b')) as month_name\"),\n DB::raw('SUM(doctor_income.income) as doctor_income'),\n DB::raw('SUM(cash_back.seena_cash) as seena_income'),\n DB::raw('SUM(cash_back.patient_cash) as patient_income'),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%m')) as month\"),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%Y')) as year\")\n )\n ->groupBy('month', 'year')\n ->orderBy('year', 'desc')\n ->orderBy('month', 'desc')\n ->get();\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return new Collection();\n }\n }", "public function getCashReceipt($txn_ref){\n\n $remits = Remittance::where('transaction_reference',$txn_ref)->first();\n $data =[];\n\n if($remits ){\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n $year = substr($remits->month, 0,4);\n $month = substr($remits->month, 5,2);\n $BS = Revenue::select('revenues.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','revenues.invoice','revenues.amount','revenues.created_at as date')\n ->join('users','users.userable_id','revenues.agent_id')\n ->join('services','services.id','revenues.service_id')\n ->join('revenue_points','revenue_points.id','revenues.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('revenues.created_at', '=', $year)\n ->whereMonth('revenues.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n //->where([[DB::raw('date(revenues.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]] )\n ->get();\n\n\n $QP = QuickPrintInvoice::select('quick_print_invoices.id','users.name as agentName','services.name as serviceName','revenue_points.name as revPtName',\n 'lgas.name as lgaName','quick_print_invoices.invoice','quick_print_invoices.amount','quick_print_invoices.created_at as date')\n ->join('users','users.userable_id','quick_print_invoices.agent_id')\n ->join('services','services.id','quick_print_invoices.service_id')\n ->join('revenue_points','revenue_points.id','quick_print_invoices.revenue_point_id')\n ->join('lgas','lgas.id','revenue_points.lga_id')\n ->whereYear('quick_print_invoices.created_at', '=', $year)\n ->whereMonth('quick_print_invoices.created_at', '=', $month)\n ->where('users.role_id',env('AGENT'))\n\n // ->where([[DB::raw('date(quick_print_invoices.created_at)'),DB::raw('date(\"' . $remits->month . '\")')],['users.role_id',env('AGENT')]])\n\n ->get();\n\n\n\n $invoiceIds = json_decode($remits->invoice_id,true);\n\n if(!empty($invoiceIds)){\n extract($invoiceIds);\n\n $i=0;\n foreach($BS as $bs){\n\n foreach ($b as $id){\n if($bs['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $bs['agentName'];\n $data[$i]['serviceName'] = $bs['serviceName'];\n $data[$i]['lgaName'] = $bs['lgaName'];\n $data[$i]['revPtName'] = $bs['revPtName'];\n $data[$i]['amount'] = $bs['amount'];\n $data[$i]['invoice'] = $bs['invoice'];\n $data[$i]['date'] = $bs['date'];\n $i++;\n }\n }\n }\n\n foreach($QP as $qp){\n\n foreach ($q as $id){\n if($qp['id'] == $id )\n {\n $data[$i]['sn'] = $i+1;\n $data[$i]['collectorName'] = $qp['agentName'];\n $data[$i]['serviceName'] = $qp['serviceName'];\n $data[$i]['lgaName'] = $qp['lgaName'];\n $data[$i]['revPtName'] = $qp['revPtName'];\n $data[$i]['amount'] = $qp['amount'];\n $data[$i]['invoice'] = $qp['invoice'];\n $data[$i]['date'] = $qp['date'];\n $i++;\n }\n }\n }\n\n }\n\n\n\n }\n\n\n\n\n return response()->json(['status' => 'success',\n 'data' => $data\n ]);\n\n }", "public function upcomingCredit()\n {\n $where = \"(SELECT DATEDIFF(po.`due_date`, '$this->curDate') AS days) < 14 AND po.`status_paid` = 0\";\n $po = $this->db\n ->from('purchase_order po')\n ->join('principal p', 'p.id_principal = po.id_principal')\n ->where($where)\n ->order_by('po.id_purchase_order asc')\n ->get()\n ->result();\n return $po;\n }", "public function show_other_expense_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`purpose`) as purpose, GROUP_CONCAT(`amount`) as amount, SUM(`amount`) as rowtotal FROM `expense` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "function daylist_get() {\n $condition = \"\";\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $store = $this->get('store');\n $total_cost = 0.00;\n\n if ($status != \"\") {\n if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.delivery_accept='1' \"; // and delivery_recieved='1'\n }else if ($status == \"Rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n }else{\n $condition .= \" and o.status='$status'\"; \n }\n \n };\n \n\n if ($store != \"\")\n $condition .= \" and o.orderedby='$store'\";\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n } else if ($fromdate == \"\" && $todate == \"\") {\n\n $fromdate = date(\"Y-m-d\");\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n }\n // echo \"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\";\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\");\n //echo $this->db->last_query();\n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows();\n foreach ($result_set->result_array() as $row) {\n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $total_cost = $total_cost + $row['order_value'];\n $result[\"records\"][] = $row;\n }\n $result[\"total_cost\"] = \"Rs \" . $total_cost . \" /-\";\n\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }", "public function getCharges();", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "function get_franchise_payment_details($fr_id)\r\n\t{\r\n\t\t$data = array();\r\n\t\t$data['ordered_tilldate'] = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\tfrom king_transactions a \r\n\t\tjoin king_orders b on a.transid = b.transid \r\n\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\twhere a.franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t\r\n\t\t$data['shipped_tilldate'] = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed =1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 \r\n\t\t\t\t\t\t\t\t \",$fr_id)->row()->amt;\r\n\t\t$data['cancelled_tilldate'] = $data['ordered_tilldate']-$data['shipped_tilldate'];\r\n\t\t\r\n\t\t$data['paid_tilldate'] = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t$data['uncleared_payment'] = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where status = 0 and franchise_id = ? \",$fr_id)->row()->amt;\r\n\t\t\r\n\t\t$data['pending_payment'] = $data['shipped_tilldate']-$data['paid_tilldate'];\r\n\t\treturn $data;\r\n\t}", "public function generate_report($from_date,$to_date,$type)\n\t{\n\t\t$this->db->where('col_date >=', date(\"Y-m-d\", strtotime($from_date)));\n\t\t$this->db->where('col_date <=', date(\"Y-m-d\", strtotime($to_date)));\n\t\t$this->db->where('type', $type);\n\t\t$query=$this->db->get('td_fee_collection');\n\t\treturn $query->result();\n\t}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function getListOfPurchasesByDate($start_date, $end_date, $limit = self::DEFAULT_LIMIT)\n {\n\n // build find() filter\n if ($end_date) {\n $filter = [\n '$and' => [\n ['date' => ['$gte' => $start_date]],\n ['date' => ['$lte' => $end_date]]\n ]\n ];\n } else {\n $filter = [\n 'date' => ['$gte' => $start_date],\n ];\n }\n\n // build find() options\n $options = [\n 'limit' => $limit,\n 'sort' => ['date' => 1],\n 'projection' => ['customer.name' => 1, 'product.title' => 1, 'amount' => 1, 'date' => 1]\n ];\n\n // perform find\n $result = [];\n try {\n $cursor = $this->find($this->purchases, $filter, $options);\n foreach ($cursor as $document) {\n //$result[] = var_export($document, TRUE);\n $result[] = [$document->customer->name,\n $document->product->title,\n sprintf('%.2f', $document->amount),\n $document->date];\n }\n } catch (Throwable $e) {\n error_log(__METHOD__ . ':' . $e->getMessage());\n $result[] = 'ERROR: unable to find purchases for these dates: ' . $start_date . ' to ' . $end_date;\n }\n return $result;\n }", "function getOrderBetweenDates($date1, $date2)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderBetweenDates($date1, $date2);\n }", "public function purchase_list_date_to_date($start, $end) {\n $this->db->select('a.*,b.supplier_name');\n $this->db->from('product_purchase a');\n $this->db->join('supplier_information b', 'b.supplier_id = a.supplier_id');\n $this->db->order_by('a.purchase_date', 'desc');\n $this->db->where('a.purchase_date >=', $start);\n $this->db->where('a.purchase_date <=', $end);\n $query = $this->db->get();\n\n $last_query = $this->db->last_query();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function show_sales_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`product_id`) as product_id, GROUP_CONCAT(`type`) as type,GROUP_CONCAT(`weight`) as weight, GROUP_CONCAT(`amount`) as amoun, GROUP_CONCAT(`price`) as price,SUM(`price`) as tp FROM `sales` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "public function pdf_purchase_list() {\n $this->db->select('a.*,b.supplier_name');\n $this->db->from('product_purchase a');\n $this->db->join('supplier_information b', 'b.supplier_id = a.supplier_id');\n $this->db->order_by('a.purchase_date', 'desc');\n $query = $this->db->get();\n\n $last_query = $this->db->last_query();\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return false;\n }", "public function retrieve_dateWise_profit_report_count($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "function get_SalesDatewise(){\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear') ; \n\n // $WorkYear = '2019-20';\n\n $sql=\"\";$f=\"\";$t=\"\";\n $dt=date(\"d-m-yy\");\n $current_month = date(\"m\");\n $current_year = date(\"yy\");\n $w=explode(\"-\",$WorkYear);\n $WY = '20'.$w[1];\n\n if((int)$WY > (int)$current_year)\n {\n $f = date(\"$current_year-$current_month-01\", strtotime($dt));\n $t = date(\"$current_year-$current_month-t\", strtotime($dt));\n }\n else{\n $f = date(\"$WY-03-01\", strtotime($dt));\n $t = date(\"$WY-03-t\", strtotime($dt));\n }\n\n $sql = \"\n select\n sm.BillNo,\n DATE_FORMAT(sm.BillDate,'%d-%m-%Y') as BillDate,\n pm.PartyName as PartyName,\n sm.PartyCode,\n sm.Area as AreaName,\n ac.ACTitle as BrokerName,\n sm.BrokerID,\n sm.BillAmt,\n sd.Qty,\n sd.NetWt,\n sd.Rate,\n sm.EWayBillNo,\n pm.PartyGSTNo as GSTNo\n from\n SaleMast sm, SaleDetails sd, ACMaster ac, PartyMaster pm\n where sm.CoID=sd.CoID \n AND sm.WorkYear=sd.WorkYear \n AND sm.BillNo=sd.BillNo\n\n AND sd.CoID=ac.CoID \n AND sm.WorkYear=ac.WorkYear \n AND sm.BrokerID=ac.ACCode\n\n AND sm.CoID=pm.CoID \n AND sm.WorkYear=pm.WorkYear \n AND sm.PartyCode=pm.PartyCode \n \n and sm.BillDate BETWEEN '$f' AND '$t'\n AND sm.CoID ='$CoID'\n AND sm.WorkYear = '$WorkYear'\n order by sm.BillDate desc\n \";\n $query = $this->db->query($sql)->result_array();\n\n \n if(empty($query))\n {\n $sql = \" \n select\n sm.BillNo,\n DATE_FORMAT(sm.BillDate,'%d-%m-%Y') as BillDate,\n pm.PartyName as PartyName,\n sm.PartyCode,\n sm.Area as AreaName,\n ac.ACTitle as BrokerName,\n sm.BrokerID,\n sm.BillAmt,\n sd.Qty,\n sd.NetWt,\n sd.Rate,\n sm.EWayBillNo,\n pm.PartyGSTNo as GSTNo\n from\n SaleMast sm, SaleDetails sd, ACMaster ac, PartyMaster pm\n where sm.CoID=sd.CoID \n AND sm.WorkYear=sd.WorkYear \n AND sm.BillNo=sd.BillNo\n\n AND sm.CoID=ac.CoID \n AND sm.WorkYear=ac.WorkYear \n AND sm.BrokerID=ac.ACCode\n\n AND sm.CoID=pm.CoID \n AND sm.WorkYear=pm.WorkYear \n AND sm.PartyCode=pm.PartyCode \n \n AND sm.CoID ='$CoID'\n AND sm.WorkYear = '$WorkYear' limit 1\n \n \";\n $query = $this->db->query($sql);\n $ea=array(\"empty\");\n\n foreach ($query->list_fields() as $field)\n {\n array_push($ea, $field);\n }\n \n return array($ea,$f,$t);\n }\n return array($query,$f,$t);\n }", "function quantizer_expenses_management_report($cost_center = null, $management = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerExpenses($cost_center, $management, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\t\t\t\r\n\t\t\t/*echo \"<pre>\";\r\n\t\t\tprint_r($resultado);\r\n\t\t\techo \"</pre>\";*/\r\n\t\t\t\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "function getOrderBetweenDates($date1, $date2)\n {\n $database = new Database();\n\n $conn = $database->getConnection();\n\n $stmt = $conn->prepare(\"SELECT * FROM mfqgkhncw3r34ada.orders INNER JOIN mfqgkhncw3r34ada.order_details ON mfqgkhncw3r34ada.orders.ID=mfqgkhncw3r34ada.order_details.orders_ID WHERE DATE BETWEEN '$date1' AND '$date2' ORDER BY mfqgkhncw3r34ada.orders.TOTAL_PRICE DESC\");\n\n $stmt->execute();\n\n $result = $stmt->get_result();\n\n if (!$result) {\n echo \"assume there is an error in SQL statement\";\n exit;\n }\n\n if ($result->num_rows == 0) {\n return null;\n } else {\n\n $order_array = array();\n\n while ($user = $result->fetch_assoc()) {\n array_push($order_array, $user);\n }\n return $order_array;\n }\n }", "public function getPurchasesByCinema($cinema, $dateStart, $dateEnd){\n try{\n $dateEnd=$dateEnd.\" 23:59:59\"; \n\n $query=\"SELECT SUM(P.total - (P.discount * P.total / 100))/COUNT(T.idTicket) as Total, COUNT(T.idTicket) as Tickets \n FROM \".$this->tableName.\" P \n JOIN \".$this->ticketTable.\" T \n ON T.idPurchase=P.idPurchase\n JOIN moviefunction MD \n ON MD.idMovieFunction=T.idMovieFunction \n JOIN room R \n ON R.idRoom=MD.idRoom \n JOIN cinema C \n ON C.idCinema=R.idCinema \n WHERE C.idCinema = :idCinema AND (P.purchaseDate >= :dateStart AND P.purchaseDate <= :dateEnd) \n GROUP BY P.idPurchase \n ORDER BY P.idPurchase;\";\n\n $parameters[\"idCinema\"]=$cinema->getIdCinema();\n $parameters[\"dateStart\"]=$dateStart;\n $parameters[\"dateEnd\"]=$dateEnd;\n\n $this->connection = Connection::GetInstance();\n\n $resultSet=$this->connection->Execute($query, $parameters);\n\n $purchase[\"Total\"]=0;\n $purchase[\"Tickets\"]=0;\n foreach($resultSet as $row){\n $purchase[\"Total\"]+=$row[\"Total\"];\n $purchase[\"Tickets\"]+=$row[\"Tickets\"];\n }\n\n\n\n return $purchase;\n\n }catch(Exception $ex){\n throw $ex;\n }\n }", "public function weekly_deposits()\n\t{\n\t\t// $date->format('Y-m-d'); \n\n\t\t// $date = strtotime(\"-6 day\");\n\t\t // date(\"Y-m-d\", $date);\n\t\t \n\t\t$today = date(\"Y-m-d\");\n\t\t$newDate = date(\"Y-m-d\",strtotime($today.\"-6 day\"));\n\t\t\n\t\t//`date_transaction` BETWEEN '$newDate' AND '$today'\n\t\t//OR\n\t\t//`date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK)\t\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT * FROM `statement` WHERE `credit` <> 0 AND `date_transaction` > DATE_SUB(NOW(), INTERVAL 1 WEEK) ORDER BY `date_transaction` DESC\");\n\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t\t\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\n\t}", "public function GetExpertTransactions(){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\tif(isset($_GET) && !empty($_GET)){\n\t\t\t\t$where=array(\n\t\t\t\t\t'from_date'\t=>$_GET['from_date'],\n\t\t\t\t\t'to_date'\t\t=> $_GET['to_date']\n\t\t\t\t);\n\t\t\t\t\t$data=$this->CashierModel->GetExpertTransactions($where);\n\t\t\t\t\t$this->ReturnJsonArray(true,false,$data['res_arr']);\n die;\n\t\t\t}else{\n\t\t\t\t$this->ReturnJsonArray(false,true,\"Wrong Method!\");\n\t\t\t\tdie;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\n\t}", "public function getBookingsByDate(Request $request)\n {\n $booking_obj = new Booking();\n return $booking_obj->getFutureBookingsByServiceAndDate($request->sv_id, $request->start, $request->end);\n }", "public function cusreports()\n {\n //\n \t\n\t\t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t\t$rintrest = Input::get('return_intrest');\n\t\t$infound = Input::get('intrests_found');\n\t\t\n\t\tif($rintrest==1){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\nelseif($rintrest==2){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\nelse{\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\t\t\t\t\n\t if($intrests->count())\n\t {\n\t \t $timerange=\"本时间段\";\n\t \t$filename=$intrests->first()->id . time();\n\t \\Excel::create($filename, function($excel) use ($intrests,$timerange) {\n $excel->sheet('New sheet', function($sheet) use ($intrests,$timerange) {\n $sheet->loadView('cusreports')\n\t\t\t ->withTimerange($timerange) \n ->withIntrests($intrests) ;\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段无分红明细');\n\t }\n\t \n\t \n }", "public function dataProviderBonus() {\n return [\n [2018, 11, '2018-11-15'],\n [2018, 12, '2018-12-19'],\n ];\n\n }", "public function getSuppliers($suppliers_id);", "public static function get($dateFrom = false) {\n\t\t\t// Collection stage\n\t\t\t$collectionStageDays = 60;\n\t\t\t\t\n\t\t\t// Generate dates\n\t\t\tif (!$dateFrom) $dateFrom = Carbon::today()->subDays($collectionStageDays);\n\t\t\t$dateTo = $dateFrom->copy()->addDays(1);\n\t\t\t\n\t\t\t// Getting promises\n\t\t\t$deals = Deal::whereHas('promises', function($query) use ($dateFrom, $dateTo) {\n\t\t\t\t$query->where('date', '>=', $dateFrom)->where('date', '<', $dateTo);\n\t\t\t})->with(['person.connections'])->get();\n\t\t\treturn $deals;\n\t\t}", "function get_datatables_invoice()\n {\n $this->company_db = $this->load->database('company_db', TRUE);\n $offset = ($_REQUEST['datatable']['pagination']['page'] - 1)*$_REQUEST['datatable']['pagination']['perpage'];\n $this->_get_datatables_query_invoice();\n if($_REQUEST['datatable']['pagination']['perpage'] != -1)\n $this->company_db->limit($_REQUEST['datatable']['pagination']['perpage'], $offset);\n $query = $this->company_db->get();\n /*$this->_get_datatables_query();\n $query2 = $this->company_db->get();*/\n /* echo \"<pre>\";\n var_dump($query);exit;\n echo \"</pre>\";*/\n\n $this->session->set_userdata('last_pickup_report_query',$this->company_db->last_query());\n\n\n if($query->num_rows() > 0)\n {\n foreach ($query->result() as $row)\n {\n //var_dump($row);exit;\n //$balance = $row->balance;\n\n //var_dump($balance);exit;\n\n\n\n // $now = strtotime(str_replace('/', '-', $_REQUEST['datatable']['pickup_date'])); // or your date as well\n\n $row->invoice_number = \"<span class='invoice'>$row->invoice_number</span>\n <span></span>\";\n $row->name = \"<div style='display:none' class='customer'>$row->customer_id</div><span>$row->name</span>\";\n\n $row->nameShipto = \"<div style='display:none' class='nameShipto'>$row->ShiptoId</div><span>$row->nameShipto</span>\";\n\n $row->total_packages = \"<span class='total_packages'>$row->total_packages</span><span></span>\";\n\n $row->balance = \"<span class='balance'>$row->balance</span><span></span>\";\n\n $row->invoice_date = \"<span class='invoice_date'>$row->invoice_date</span><span></span>\n \";\n // var_dump($row);exit;\n\n /*$your_date = strtotime($row->pickup_date);\n $datediff = $now - $your_date;\n\n $days = round($datediff / (60 * 60 * 24));\n if($days > 2)\n $row->pickup_date = \"<label class='text-danger'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else if($days > 1)\n $row->pickup_date = \"<label class='text-warning'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else\n $row->pickup_date = date(\"m/d/Y\", strtotime($row->pickup_date));*/\n\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id'>\n <span></span></label>\n \";\n /*if($row->status != \"Done\"){\n } else {\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id' checked>\n <span></span></label>\";\n }*/\n\n $row->chk_print = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'>\n <input type='checkbox' class = 'chk_print' name='chk_print[]' data-id ='$row->id' checked>\n <span></span>\n </label>\";\n\n /* if($row->driver_id != '0'){\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id' checked>\n <span></span></label>\";\n\n }else{\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id'>\n <span></span></label>\n \";\n }*/\n\n\n }\n\n return $query->result();\n }\n else\n {\n return false;\n }\n }", "public function getRecords($range,$data)\n {\n if(($range%6)!=0){\n if($range==1)\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->get();\n else\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->where('created_at','>=',Carbon::now()->subdays($range))->get();\n }\n else{\n $sales = ToiletUsageInfo::where('status','1')->where('owner_id',Auth::user()->id)->where(\"created_at\",\">=\", Carbon::now()->subMonths($range))->get();\n }\n $total=0;\n foreach($sales as $sale) {\n $total+=$sale->toilet['price'];\n }\n \n $data.='\n <thead>\n <tr class=\"thead-light\">\n <th>Transact Id</th>\n <th>Toilet name</th>\n <th>User email</th>\n <th title=\"Total revenue is KD'.$total.'\" width=10%>\n Paid | <b style=\"color:#28a745;\">KD'.$total.'</b>\n </th>\n <th>Used on</th>\n </tr>\n </thead>\n <tbody>';\n if( count($sales) == 0 )\n $data.='<tr><td colspan=\"5\"><center><h2>No Reports found</h2></center></td></tr>';\n else{\n foreach($sales as $sale) {\n if($sale->toilet['price']==0)\n $sale->toilet['price']='<b style=\"color:#28a745;\">Free</b>';\n else $sale->toilet['price']='KD'.$sale->toilet['price'];\n $data.='<tr>\n <td>'.$sale->transaction_id.'</td>\n <td title=\"id='.$sale->toilet_id.'\">\n '.$sale->toilet['toilet_name'].'\n </td>\n <td title=\"id-'.$sale->user['id'].'\">\n '.$sale->user['email'].'\n </td>\n <td><b>'.$sale->toilet['price'].'</b></td>\n <td>'.$sale->created_at->format('d/m/Y').' at '.$sale->created_at->format('g:i A').'</td>\n </tr>';\n }\n }\n $data.='</tbody>\n </table>';\n\n return $data;\n }", "function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}", "function get_details_on_date_range($sdate,$edate) {\n $query = \"\n SELECT\n tbl_tender_basic_details.tender_id,\n tbl_tender_basic_details.mgo_file_ref,\n tbl_tender_basic_details.dos_file_ref,\n tbl_tender_basic_details.vote_id,\n tbl_vote_master.vote_head,\n tbl_vote_master.vote_name,\n tbl_tender_basic_details.item_id,\n tbl_items_list.item_code,\n tbl_items_list.item_name,\n tbl_tender_basic_details.quantity,\n tbl_tender_basic_details.unit_type_id,\n tbl_unit_types.unit_name,\n tbl_tender_basic_details.tndr_open_date,\n tbl_doc_ho_from_dos.ho_date,\n tbl_date_of_doc_ho.date_of_doc_ho,\n tbl_tec_due_date.tec_due_date,\n tbl_received_tec.received_tec_date,\n tbl_forward_tec.forward_tec_date,\n tbl_recommandation_due_date.recomma_due_date,\n tbl_received_recommendation.rece_rec_date,\n tbl_forward_to_tender_bd.fwd_tb_date,\n tbl_tender_board_approval.tb_approval_date,\n tbl_suppliers.supplier_ref,\n tbl_suppliers.supplier_name,\n tbl_approved_supplier.appd_sup_remarks,\n tbl_delivery_date.delivery_date,\n tbl_delivery_date.delivery_remarks\n FROM\n tbl_tender_basic_details\n Inner Join tbl_vote_master ON tbl_vote_master.vote_id = tbl_tender_basic_details.vote_id\n Inner Join tbl_items_list ON tbl_items_list.item_id = tbl_tender_basic_details.item_id\n Inner Join tbl_unit_types ON tbl_unit_types.unit_id = tbl_tender_basic_details.unit_type_id\n Inner Join tbl_doc_ho_from_dos ON tbl_doc_ho_from_dos.ho_mgo_file_ref = tbl_tender_basic_details.mgo_file_ref\n Inner Join tbl_date_of_doc_ho ON tbl_date_of_doc_ho.date_of_doc_ho_mgo_ref = tbl_doc_ho_from_dos.ho_mgo_file_ref\n Inner Join tbl_tec_due_date ON tbl_tec_due_date.tec_due_mgo_ref = tbl_date_of_doc_ho.date_of_doc_ho_mgo_ref\n Inner Join tbl_received_tec ON tbl_received_tec.received_tec_mgo_ref = tbl_tec_due_date.tec_due_mgo_ref\n Inner Join tbl_forward_tec ON tbl_forward_tec.forward_tec_mgo_ref = tbl_received_tec.received_tec_mgo_ref\n Inner Join tbl_recommandation_due_date ON tbl_recommandation_due_date.recomma_date_mgo_ref = tbl_forward_tec.forward_tec_mgo_ref\n Inner Join tbl_received_recommendation ON tbl_received_recommendation.rece_rec_mgo_ref = tbl_recommandation_due_date.recomma_date_mgo_ref\n Inner Join tbl_forward_to_tender_bd ON tbl_forward_to_tender_bd.fwd_tb_mgo_ref = tbl_received_recommendation.rece_rec_mgo_ref\n Inner Join tbl_tender_board_approval ON tbl_tender_board_approval.tb_approval_mgo_ref = tbl_forward_to_tender_bd.fwd_tb_mgo_ref\n Inner Join tbl_approved_supplier ON tbl_approved_supplier.appd_mgo_file_ref = tbl_tender_board_approval.tb_approval_mgo_ref\n Inner Join tbl_delivery_date ON tbl_delivery_date.delivery_date_mgo_ref = tbl_approved_supplier.appd_mgo_file_ref\n Inner Join tbl_suppliers ON tbl_suppliers.supplier_id = tbl_approved_supplier.appd_sup_id\n WHERE delivery_date BETWEEN '$sdate' AND '$edate'\n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public function returnSubtotalPassenger($start_date,$end_date){\n\t\t$mcoCash = new Application_Model_DbTable_Mco();\n\t\t$select = $mcoCash->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_cash\"), array('subtotal_passenger' => new Zend_Db_Expr('SUM(amount)')))\n\t\t\t\t\t\t->joinInner(array('m' => 'mco'), 'm.id=mc.mco_id')\n\t\t\t\t\t\t->where('date_operation >= ?', Application_Model_General::dateToUs($start_date))\n\t\t\t\t\t\t->where('date_operation <= ?', Application_Model_General::dateToUs($end_date));\n\treturn $mcoCash->fetchRow($select);\n\t}", "public function daily_report($txtFromDate,$txtToDate,$ddlYear)\n\t{\n\t\t$this->db->where('td_fee_collection.col_date>=', $txtFromDate);\n\t\t$this->db->where('td_fee_collection.col_date<=', $txtToDate);\n\t\t$this->db->where('td_fee_collection.year', $ddlYear);\n\t\t// $this->db->group_by('td_fee_collection.stud_id');\n\t\t// $this->db->select('td_fee_collection.* , td_fee_subfunds.fee_head_id as feehead_id');\n\t\t// $this->db->from('td_fee_collection');\n\t\t// $this->db->join('td_fee_subfunds', 'td_fee_subfunds.fee_id = td_fee_collection.fee_id', 'INNER');\n\t\t// $this->db->limit(3);\n\t\t$query=$this->db->get('td_fee_collection');\n\t\treturn $query->result();\n\t}", "public function getRecoveries($date)\n\t{\n\t\t$args = array();\n\t\t$query = $this->application_query_builder->getRecoveriesQuery(\n\t\t\t$date, \n\t\t\t$this->config->getCompany(), \n\t\t\t$args\n\t\t);\n\t\t\n\t\t$rs = $this->queryPrepared($query, $args);\n\t\t\n\t\t$this->data_builder->attachObserver(\n\t\t\tnew Delegate_1(array($this, 'setApplicationBalance'))\n\t\t);\n\t\t$this->data_builder->attachObserver(\n\t\t\tnew Delegate_1(array($this, 'setRecoveryAmount'))\n\t\t);\n\t\t\n\t\treturn $this->data_builder->getApplicationData($rs);\n\t}", "function get_consumer_details() {\n\t\t$consumer_no = $_REQUEST['consumer_no'];\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\tif (!empty($consumer_no) && !empty($biller_id)) {\n\t\t\t$biller_in_id = 'biller_user.biller_customer_id_no';\n\t\t\t$records_consumer = $this -> conn -> join_two_table_where_two_field('biller_user', 'biller_details', 'biller_id', 'biller_id', $biller_in_id, $consumer_no, 'biller_user.biller_id', $biller_id);\n\n\t\t\tif (!empty($records_consumer)) {\n\t\t\t\t$biller_id = $records_consumer[0]['biller_id'];\n\t\t\t\t$biller_company = $records_consumer[0]['biller_company_name'];\n\t\t\t\t$biller_company_logo = biller_company_logo . $records_consumer[0]['biller_company_logo'];\n\t\t\t\t$biller_user_name = $records_consumer[0]['biller_user_name'];\n\t\t\t\t$biller_customer_id = $records_consumer[0]['biller_customer_id_no'];\n\t\t\t\t$bill_amount = $records_consumer[0]['bill_amount'];\n\t\t\t\t$bill_due_date = $records_consumer[0]['bill_due_date'];\n\t\t\t\t$biller_user_email = $records_consumer[0]['biller_user_email'];\n\t\t\t\t$biller_user_contact_no = $records_consumer[0]['biller_user_contact_no'];\n\t\t\t\t$bill_pay_status = $records_consumer[0]['bill_pay_status'];\n\t\t\t\t$bill_invoice_no = $records_consumer[0]['bill_invoice_no'];\n\t\t\t\t$current_date = date(\"Y-m-d\");\n\t\t\t\tif ($bill_due_date >= $current_date) {\n\t\t\t\t\tif ($bill_pay_status == '1') {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill already paid\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => 'true', \"biller_id\" => $biller_id, 'biller_company' => $biller_company, 'biller_logo' => $biller_company_logo, 'consumer_name' => $biller_user_name, 'consumer_id' => $biller_customer_id, 'bill_amount' => $bill_amount, 'due_date' => $bill_due_date, 'consumer_email' => $biller_user_email, 'consumer_contact_no' => $biller_user_contact_no, 'bill_pay_status' => $bill_pay_status, 'bill_invoice_no' => $bill_invoice_no);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Bill Paid date is expired\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Bill Found from this consumer no\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'consumer_no' => $consumer_no, 'biller_id' => $biller_id);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "public function show_salary_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`name`) as name ,GROUP_CONCAT(`status`) as status, GROUP_CONCAT(`amount`) as amount, SUM(`amount`) as rowtotal FROM `salary_paid` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "public function getDollarsCreditedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsCreditedOn($today);\n }", "public function CreditAndDebitReports(Carbon $start_date, Carbon $end_date)\n {\n $view = view('profitstars::transaction-reporting.credit-and-debit-reports', [\n 'beginDate'=>$start_date,\n 'endDate'=>$end_date,\n ]);\n $xml = $this->call($view);\n if (!$xml) {\n $this->ResponseMessage = $this->faultstring;\n return null;\n }\n $batches = collect();\n if ($xml->CreditandDebitReportsResult[0]->children('diffgr', true)[0]->children()) {\n foreach ($xml->CreditandDebitReportsResult[0]->children('diffgr', true)[0]->children()[0]->Table as $table) {\n $response = new CreditAndDebitReportsResponse;\n $response->batchStatus = (string)$table->BatchStatus;\n $response->effectiveDate = Carbon::parse($table->EffectiveDate);\n $response->batchID = (string)$table->BatchID;\n $response->description = (string)$table->Description;\n $response->amount = (string)$table->Amount;\n $batches->push($response);\n }\n }\n return $batches;\n }", "function get_store_card()\n {\n\t\tif(Url::get('code') and $row = DB::select('product','name_1 = \\''.Url::get('code').'\\' or name_2 = \\''.Url::get('code').'\\''))\n {\n $this->map['have_item'] = true;\n\t\t\t$this->map['code'] = $row['id'];\n\t\t\t$this->map['name'] = $row['name_'.Portal::language()];\n\t\t\t$old_cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t\t(\n\t\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t\t)\n\t\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date <\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t';\n $wh_remain_date = DB::fetch_all('select * from wh_remain_date where warehouse_id='.Url::iget('warehouse_id').' and portal_id = \\''.PORTAL_ID.'\\'');\n $new_cond = '';\n foreach($wh_remain_date as $key=>$value)\n {\n if($value['end_date'] != '' and Date_Time::to_time(Url::get('date_from'))< Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')) and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n if($value['end_date']=='' and Date_Time::to_time(Url::get('date_from'))>= Date_Time::to_time(Date_Time::convert_orc_date_to_date($value['term_date'],'/')))\n {\n $old_cond.= ' AND wh_invoice.create_date >=\\''.$value['term_date'].'\\'';\n $new_cond.= ' AND wh_remain_date_detail.term_date =\\''.$value['term_date'].'\\'';\n }\n }\t\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice_detail.id,\n wh_invoice_detail.product_id,\n wh_invoice_detail.num,\n wh_invoice.type,\n\t\t\t\t\twh_invoice_detail.to_warehouse_id,\n wh_invoice_detail.warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice_detail\n\t\t\t\t\tINNER JOIN wh_invoice ON wh_invoice.id= wh_invoice_detail.invoice_id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$old_cond.' \n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\t$old_items = array();\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$product_id = $value['product_id'];\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n {\n\t\t\t\t\tif(isset($old_items[$product_id]['import_number']))\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] += $value['num'];\n else\n\t\t\t\t\t\t$old_items[$product_id]['import_number'] = $value['num'];\n }\n else\n if($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n \t\t\t\t\tif(isset($old_items[$product_id]['export_number']))\n \t\t\t\t\t\t$old_items[$product_id]['export_number'] += $value['num'];\n else\n {\n $old_items[$product_id]['export_number'] = $value['num'];\n }\n \t\t\t\t}\n\t\t\t}\n $sql = '\n\t\t\tSELECT\n\t\t\t\twh_start_term_remain.id,\n wh_start_term_remain.warehouse_id,\n\t\t\t\twh_start_term_remain.product_id,\n CASE \n WHEN wh_start_term_remain.quantity >0 THEN wh_start_term_remain.quantity\n ELSE 0 \n END as quantity\n\t\t\tFROM\n\t\t\t\twh_start_term_remain\n\t\t\tWHERE\t\n\t\t\t\twh_start_term_remain.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_start_term_remain.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t';\n\t\t\tif($product = DB::fetch($sql))\n {\n $this->map['start_remain'] = $product['quantity'];\t\n }\t\n else\n {\n $this->map['start_remain'] = 0;\n }\n if($new_cond!='')\n {\n $sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_remain_date_detail.id,\n wh_remain_date_detail.warehouse_id,\n\t\t\t\t\twh_remain_date_detail.product_id,\n wh_remain_date_detail.quantity\n\t\t\t\tFROM\n\t\t\t\t\twh_remain_date_detail\n\t\t\t\tWHERE\t\n\t\t\t\t\twh_remain_date_detail.product_id = \\''.$row['id'].'\\' AND warehouse_id='.Url::iget('warehouse_id').'\n and wh_remain_date_detail.portal_id = \\''.PORTAL_ID.'\\'\n '.$new_cond.'\n \t\t\t';\n if(User::id()=='developer06')\n {\n //System::debug($sql);\n }\n \t\t\tif($product = DB::fetch($sql))\n \t\t\t\t$this->map['start_remain'] += $product['quantity'];\t\n }\n if(User::id()=='developer06')\n {\n //System::debug($this->map['start_remain']);\n }\n\t\t\t$cond = 'wh_invoice_detail.product_id = \\''.$row['id'].'\\' AND\n\t\t\t\t(\n\t\t\t\t(wh_invoice.type=\\'IMPORT\\' AND wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').') OR \n\t\t\t\t(wh_invoice.type=\\'EXPORT\\' AND (wh_invoice_detail.warehouse_id='.Url::iget('warehouse_id').'))\n\t\t\t\t)\n\t\t\t\t'.(Url::get('date_from')?' AND wh_invoice.create_date >=\\''.Date_Time::to_orc_date(Url::get('date_from')).'\\'':'').'\n\t\t\t\t'.(Url::get('date_to')?' AND wh_invoice.create_date <=\\''.Date_Time::to_orc_date(Url::get('date_to')).'\\'':'').'\n\t\t\t';\n\t\t\t$sql = '\n\t\t\t\tSELECT\n\t\t\t\t\twh_invoice.*,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'IMPORT\\',wh_invoice.bill_number,\\'\\') AS import_invoice_code,\n\t\t\t\t\tDECODE(wh_invoice.type,\\'EXPORT\\',wh_invoice.bill_number,\\'\\') AS export_invoice_code,\n\t\t\t\t\twh_invoice_detail.num,wh_invoice_detail.warehouse_id,wh_invoice_detail.to_warehouse_id\n\t\t\t\tFROM\n\t\t\t\t\twh_invoice\n\t\t\t\t\tINNER JOIN wh_invoice_detail ON wh_invoice_detail.invoice_id = wh_invoice.id\n\t\t\t\tWHERE\n\t\t\t\t\t'.$cond.'\n and wh_invoice.portal_id = \\''.PORTAL_ID.'\\'\n\t\t\t\tORDER BY\n\t\t\t\t\twh_invoice.id,wh_invoice.create_date,wh_invoice.time\n\t\t\t';\n\t\t\t$items = DB::fetch_all($sql);\n\t\t\tif(isset($old_items[$row['id']]))\n {\n\t\t\t\tif(isset($old_items[$row['id']]['import_number']))\n\t\t\t\t\t$this->map['start_remain'] += round($old_items[$row['id']]['import_number'],2);\n\t\t\t\tif(isset($old_items[$row['id']]['export_number']))\n\t\t\t\t\t$this->map['start_remain'] -= round($old_items[$row['id']]['export_number'],2);\t\t\t\n\t\t\t}\n\t\t\t$remain = $this->map['start_remain'];\n\t\t\tforeach($items as $key=>$value)\n {\n\t\t\t\t$items[$key]['create_date'] = Date_Time::convert_orc_date_to_date($value['create_date'],'/');\n\t\t\t\tif($value['type']=='IMPORT' or $value['to_warehouse_id'] == Url::get('warehouse_id'))\n\t\t\t\t\t$items[$key]['import_number'] = $value['num'];\n else\n\t\t\t\t\t$items[$key]['import_number'] = 0;\n\t\t\t\tif($value['type']=='EXPORT' and $value['to_warehouse_id'] != Url::get('warehouse_id'))\n {\n $items[$key]['export_number'] = $value['num']; \n }\n else\n\t\t\t\t\t$items[$key]['export_number'] = 0;\n\t\t\t\t$this->map['end_remain'] += round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n\t\t\t\t$remain = round($remain,2) + round($items[$key]['import_number'],2) - round($items[$key]['export_number'],2);\n if(User::id()=='developer06')\n {\n //echo $remain.'</br>';\n }\n\t\t\t\t$items[$key]['remain'] = $remain;\n\t\t\t\t$this->map['import_total'] += $items[$key]['import_number'];\n\t\t\t\t$this->map['export_total'] += $items[$key]['export_number'];\n if($items[$key]['export_number'] < 1)\n {\n $items[$key]['export_number'] = '0'.$items[$key]['export_number'];\n }\n\t\t\t}\n\t\t\t$this->map['end_remain'] += $this->map['start_remain'];\n\t\t\treturn $items;\n\t\t}\n\t}", "public function cashVoucherList(Request $request)\n {\n $totalDebitAmount = 0;\n $totalCreditAmount = 0;\n $accountId = !empty($request->get('cash_voucher_account_id')) ? $request->get('cash_voucher_account_id') : 0;\n $transactionType = !empty($request->get('transaction_type')) ? $request->get('transaction_type') : 0;\n $fromDate = !empty($request->get('cash_voucher_from_date')) ? $request->get('cash_voucher_from_date') : '';\n $toDate = !empty($request->get('cash_voucher_to_date')) ? $request->get('cash_voucher_to_date') : '';\n\n $accounts = Account::where('type', 'personal')->where('status', '1')->get();\n\n $query = Voucher::where('status', 1)->where('voucher_type', 'Cash');\n\n if(!empty($accountId) && $accountId != 0) {\n /*$query = $query->whereHas('transaction', function ($q) use($accountId) {\n $q->whereHas('creditAccount', function ($qry) use($accountId) {\n $qry->where('id', $accountId);\n })->orWhereHas('debitAccount', function ($qry) use($accountId) {\n $qry->where('id', $accountId);\n });\n });*/\n $query = $query->whereHas('transaction', function ($q) use($accountId) {\n $q->where('credit_account_id', $accountId)->orWhere('debit_account_id', $accountId);\n });\n }\n\n if(!empty($transactionType) && $transactionType != 0) {\n $query = $query->where('transaction_type', $transactionType);\n }\n\n if(!empty($fromDate)) {\n $searchFromDate = new DateTime($fromDate);\n $searchFromDate = $searchFromDate->format('Y-m-d H:i');\n $query = $query->where('date_time', '>=', $searchFromDate);\n }\n\n if(!empty($toDate)) {\n $searchToDate = new DateTime($toDate.\" 23:59\");\n $searchToDate = $searchToDate->format('Y-m-d H:i');\n $query = $query->where('date_time', '<=', $searchToDate);\n }\n\n $totalDebitQuery = clone $query;\n $totalDebitAmount = $totalDebitQuery->where('transaction_type', 1)->sum('amount');\n\n $totalCreditQuery = clone $query;\n $totalCreditAmount = $totalCreditQuery->where('transaction_type', 2)->sum('amount');\n\n $cashVouchers = $query->with(['transaction.debitAccount.accountDetail', 'transaction.creditAccount.accountDetail'])->orderBy('id','desc')->paginate(15);\n \n return view('voucher.list',[\n 'accounts' => $accounts,\n 'cashVouchers' => $cashVouchers,\n 'accountId' => $accountId,\n 'transactionType' => $transactionType,\n 'fromDate' => $fromDate,\n 'toDate' => $toDate,\n 'creditVouchers' => [],\n 'machineVouchers' => [],\n 'totalDebitAmount' => $totalDebitAmount,\n 'totalCreditAmount' => $totalCreditAmount\n ]);\n }", "public function getDollarsCreditedOn(Carbon $date)\n {\n return $this\n ->transactions()\n ->whereBetween('post_date', [\n $date->copy()->startOfDay(),\n $date->copy()->endOfDay()\n ])\n ->sum('credit') / 100;\n }", "function ppt_resources_get_planned_delivered($data)\n{\n $year = date('Y');\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $user = user_load($uid);\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n } else {\n $countries = get_user_countries($user);\n }\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries, FALSE);\n }\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = $data['products'];\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid, FALSE, FALSE);\n } else {\n $products = get_target_products_for_accounts($accounts);\n }\n }\n\n $nodes = get_planned_orders_for_acconuts_per_year($year, $accounts);\n\n // Initialze empty months.\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n $final_arr = [];\n if (isset($nodes)) {\n // Consider a product exists with mutiple accounts.\n foreach ($nodes as $nid => $item) {\n $node = node_load($nid);\n $planned_product_tid = $node->field_planned_product[\"und\"][0][\"target_id\"];\n if (in_array($planned_product_tid, $products)) {\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n // Get node values for product (planned and delivered).\n if (isset($node->field_planned_period[\"und\"])) {\n $node_date = $node->field_planned_period[\"und\"][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity[\"und\"])) {\n $planned_quantity = $node->field_planned_quantity[\"und\"][0][\"value\"];\n }\n if (isset($node->field_planned_actual_period[\"und\"])) {\n $node_date = $node->field_planned_actual_period[\"und\"][0]['value'];\n $delivery_month = date(\"F\", strtotime($node_date));\n }\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity[\"und\"])) {\n $delivered_quantity = $node->field_planned_delivered_quantity[\"und\"][0][\"value\"];\n }\n // If product already exists, update its values for node months.\n if (isset($final_arr[$planned_product_name])) {\n if (isset($final_arr[$planned_product_name][\"Planned\"][$planned_month])) {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] = [(int) $planned_quantity];\n }\n if (isset($final_arr[$planned_product_name][\"Actual\"][$delivery_month])) {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr[$planned_product_name] = [\"Actual\" => [], \"Planned\" => []];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr[$planned_product_name][\"Actual\"][$month] = [0];\n $final_arr[$planned_product_name][\"Planned\"][$month] = [0];\n }\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n $final_arr[$planned_product_name][\"Planned\"][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n }\n // [product => [actual => [months], target => [months]]]\n return $final_arr;\n}", "public function expenseReportDate(Request $request){\n if($request->pdf=='pdf_download'){\n echo \"<h1>Coming soon</h1>\";\n }else{\n $start=$request->start;\n $end=$request->end;\n $company=Company::first();\n $data=ExpenseAmount::whereBetween('expense_date',[$start,$end])->with('ExpenseCategorys','Warehouses','users')->get();\n return view('report.expense.expense_date_wise',compact('start','end','company','data'));\n }\n \n \n }", "function get_all($date) {\n $money = 0;\n foreach ($this->list as $this_item) {\n $money += $this_item->get_amount($date);\n }\n return $money;\n }", "public function retrieve_product_search_sales_report( $start_date,$end_date )\n\t{\n\t\t$dateRange = \"c.date BETWEEN '$start_date%' AND '$end_date%'\";\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->order_by('c.date','desc');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t\t\n\t\t//$this->db->group_by('b.product_model');\n\t}", "public function period_broker_get(Request $request)\n {\n $fromdate = $request['fromdate'];\n $todate = $request['todate'];\n\n $employees = User::where('role', 3)->get();\n foreach ($employees as $emp) {\n $drivers = Driver::select('id')->whereRaw(\"find_in_set($emp->id,employee_id)\")->get();\n if (count($drivers) != 0) {\n foreach ($drivers as $driver) {\n $driver_arr[$emp->id][] = $driver->id;\n }\n\n if ($fromdate != \"\") {\n\n $total_detail = Detail::whereBetween('put_date', [$fromdate, $todate . \" 23:59:59\"])->whereIn('driver_id', $driver_arr[$emp->id])->get()->count();\n $total_revenue = Detail::whereBetween('put_date', [$fromdate, $todate . \" 23:59:59\"])->whereIn('driver_id', $driver_arr[$emp->id])->sum('revenue');\n $total_miles = Detail::whereBetween('put_date', [$fromdate, $todate . \" 23:59:59\"])->whereIn('driver_id', $driver_arr[$emp->id])->sum('mile');\n $total_dhmiles = Detail::whereBetween('put_date', [$fromdate, $todate . \" 23:59:59\"])->whereIn('driver_id', $driver_arr[$emp->id])->sum('dho');\n // $driver_count=count( $driver_arr[$emp->id]);\n } else {\n $total_detail = Detail::whereIn('driver_id', $driver_arr[$emp->id])->get()->count();\n $total_revenue = Detail::whereIn('driver_id', $driver_arr[$emp->id])->sum('revenue');\n $total_miles = Detail::whereIn('driver_id', $driver_arr[$emp->id])->sum('mile');\n $total_dhmiles = Detail::whereIn('driver_id', $driver_arr[$emp->id])->sum('dho');\n // $driver_count=count( $driver_arr[$emp->id]);\n }\n\n\n $employee = User::find($emp->id);\n $detail_array[] = array(\n 'employee_name' => $employee->firstname . \" \" . $employee->lastname,\n 'driver_array' => $driver_arr[$emp->id],\n 'detail_num' => ($total_detail != null) ? number_format($total_detail, 2, '.', ',') : 0,\n 'total_revenue' => ($total_revenue != null) ? number_format($total_revenue, 2, '.', ',') : 0,\n 'avg_dhrpm' => (($total_miles + $total_dhmiles) != 0) ? number_format($total_revenue / ($total_miles + $total_dhmiles), 2, '.', ',') : 0,\n 'total_miles' => ($total_miles != null) ? number_format(($total_miles + $total_dhmiles), 2, '.', ',') : 0,\n 'avg_revenue' => ($total_detail != 0) ? number_format($total_revenue / $total_detail, 2, '.', ',') : 0\n );\n }\n }\n $total_detail_broker = $detail_array;\n $result['status'] = \"ok\";\n $result['detail_info_broker'] = $total_detail_broker;\n return response()->json($result, 200);\n }", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function get_details(){\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear') ;\n\n $fromYear=\"\";$toYear=\"\";\n $current_month = date(\"m\");\n $current_year = date(\"Y\");\n $yearArray = explode(\"-\",$WorkYear);\n $year = explode(\"-\",$yearArray[0]);\n $WY = substr($year[0], 0, 2).$yearArray[1];\n\n if((int)$WY > (int)$current_year)\n {\n $fromYear = date(\"$current_year-$current_month-01\");\n $toYear = date(\"$current_year-$current_month-t\");\n }\n else{\n $fromYear = date(\"$WY-03-01\");\n $toYear = date(\"$WY-03-t\");\n }\n\n $sql = \"\n select BillNo, BillDate, GodownID, SaleMast.PartyCode CPName, \n PartyMaster.PartyName PartyTitle, \n BrokerID, Broker.ACTitle BrokerTitle, \n BillAmt\n \n from SaleMast, PartyMaster, ACMaster Broker\n \n where SaleMast.PartyCode = PartyMaster.PartyCode\n and SaleMast.CoID = PartyMaster.CoID \n and SaleMast.WorkYear = PartyMaster.WorkYear \n \n and SaleMast.BrokerId = Broker.ACCode\n and SaleMast.CoID = Broker.CoID\n and SaleMast.WorkYear = Broker.WorkYear\n\n and SaleMast.CoID = '$CoID'\n and SaleMast.WorkYear = '$WorkYear'\n and BillDate BETWEEN '$fromYear' AND '$toYear'\n order by BillDate DESC, CAST(BillNo AS Integer) DESC \n\n \";\n // $query = $this->db->query($sql);\n // $result = $query->result();\n // return $result;\n $result = $this->db->query($sql)->result_array();\n\n if(empty($result)){\n $emptyArray=array(\"empty\"); \n return array($emptyArray,$fromYear,$toYear);\n }\n\n return array($result,$fromYear,$toYear);\n }", "public function stock_report_product_bydate_count($product_id,$supplier_id,$from_date,$to_date){\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as 'totalPurchaseQnty',\n\t\t\t\te.purchase_date as date\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($supplier_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}else{\n\t\t\t$this->db->where(\n\t\t\t\tarray(\n\t\t\t\t\t'a.status'=>1,\n\t\t\t\t\t'a.supplier_id'\t=>\t$supplier_id,\n\t\t\t\t\t'a.product_id'\t=>\t$product_id\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t$this->db->where('e.purchase_date >=', $from_date);\n\t\t\t$this->db->where('e.purchase_date <=', $to_date);\n\t\t}\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function f_get_dateWise_billPay_record($startDt, $endDt)\n {\n\n // $sql = $this->db->query(\" SELECT a.trans_dt, a.order_no, c.order_dt, b.district_name,\n // a.sdo_memo, a.bill_no, d.del_dt, a.part, a.amount \n // FROM td_dm_bill_payment a, md_district b, td_dm_work_order c, td_dm_delivery d\n // WHERE a.dist_cd = b.district_code AND a.order_no = c.order_no AND a.dist_cd = c.dist_cd\n // AND a.order_no = d.order_no AND a.dist_cd = d.dist_cd AND a.sdo_memo = d.sdo_memo\n // AND a.bill_no = d.bill_no \n // AND a.trans_dt >= '$startDt' AND a.trans_dt <= '$endDt' \");\n\n $sql = $this->db->query(\" SELECT a.mr_no, a.memo_no, a.cr_dt, a.tot_credited, a.commission, a.less, a.tot_payable, b.vendor_name \n FROM td_dm_paymentdtls a, md_sw_vendor b \n WHERE a.vendor = b.sl_no \n AND a.cr_dt >= '$startDt' AND a.cr_dt <= '$endDt' ORDER BY a.cr_dt \");\n\n return $sql->result();\n\n }", "public function prevalenceRates()\n\t{\n\t\t$from = Input::get('start');\n\t\t$to = Input::get('end');\n\t\t$today = date('Y-m-d');\n\t\t$year = date('Y');\n\t\t$testTypeID = Input::get('test_type');\n\n\t\t//\tApply filters if any\n\t\tif(Input::has('filter')){\n\n\t\t\tif(!$to) $to=$today;\n\n\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($today)||strtotime($to)>strtotime($today)){\n\t\t\t\tSession::flash('message', trans('messages.check-date-range'));\n\t\t\t}\n\n\t\t\t$months = json_decode(self::getMonths($from, $to));\n\t\t\t$data = TestType::getPrevalenceCounts($from, $to, $testTypeID);\n\t\t\t$chart = self::getPrevalenceRatesChart($testTypeID);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get all tests for the current year\n\t\t\t$test = Test::where('time_created', 'LIKE', date('Y').'%');\n\t\t\t$periodStart = $test->min('time_created'); //Get the minimum date\n\t\t\t$periodEnd = $test->max('time_created'); //Get the maximum date\n\t\t\t$data = TestType::getPrevalenceCounts($periodStart, $periodEnd);\n\t\t\t$chart = self::getPrevalenceRatesChart();\n\t\t}\n\n\t\treturn View::make('reports.prevalence.index')\n\t\t\t\t\t\t->with('data', $data)\n\t\t\t\t\t\t->with('chart', $chart)\n\t\t\t\t\t\t->withInput(Input::all());\n\t}", "public function getPurchasesByPurchaser($conn, $purchaserId, $startDate, $endDate) {\r\n\t\tif(isset($startDate)) {\r\n\t\t\t$newStartDate = $startDate.' 00:00:00';\r\n\t\t} else {\r\n\t\t\t$newStartDate = '0000-00-00 00:00:00';\r\n\t\t}\r\n\r\n\t\t// Check endDate; if null/empty assign '9999-12-31 23:59:59'\r\n\t\tif(isset($endDate)) {\r\n\t\t\t$newEndDate = $endDate.' 23:59:59';\r\n\t\t} else {\r\n\t\t\t$newEndDate = '9999-12-31 23:59:59';\r\n\t\t}\r\n\r\n\t\t// Prepare SQL\r\n\t\t$sql = '\r\n\t\t\tSELECT DATE(a.purchase_timestamp) AS date, b.name\r\n\t\t\tFROM purchases a\r\n\t\t\tLEFT JOIN products b\r\n\t\t\tON a.product_id = b.id\r\n\t\t\tWHERE a.purchaser_id = :purchaserId\r\n\t\t\tAND a.purchase_timestamp >= :startDate\r\n\t\t\tAND a.purchase_timestamp <= :endDate\r\n\t\t\tORDER BY date DESC\r\n\t\t';\r\n\t\t\r\n\t\ttry {\r\n\r\n\t\t\t// execute query\r\n\t\t\t$stmt = $conn->prepare($sql);\r\n\t\t\t$stmt->execute(array(\r\n\t\t\t\t'purchaserId' => $purchaserId,\r\n\t\t\t\t'startDate' => $newStartDate,\r\n\t\t\t\t'endDate' => $newEndDate\r\n\t\t\t));\r\n\r\n\t\t\t// format fetched data\r\n\t\t\t$data = $stmt->fetchAll();\r\n\t\t\t$result = $this->processFetchedData($data);\r\n\r\n\t\t\t// return result\r\n\t\t\treturn $result;\r\n\r\n\t\t} catch (Exception $e) {\r\n\t\t\t\r\n\t\t\t// return error message\r\n\t\t\treturn array(\r\n\t\t\t\t'status' => 'NG',\r\n\t\t\t\t'message' => $e->getMessage()\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public function get_csv($from_date, $to_date, $skus=array())\r\n\t{\r\n\r\n\t\t$result = $this->rpt_prod_performance_service->get_header() . \"\\n\";\r\n\t\t$arr = $this->rpt_prod_performance_service->get_data($from_date, $to_date, $skus);\r\n\t\t\r\n\t\tforeach ($arr as $row)\r\n\t\t{\r\n\t\t\t$num_of_fields = count($row);\r\n\t\t\t$orig_num_of_fields = $num_of_fields;\r\n\t\t\t\r\n\t\t\tforeach ($row as $field)\r\n\t\t\t{\r\n\t\t\t\t$num_of_fields--;\r\n\t\t\t\t\r\n\t\t\t\t$result .= '\"'.$field.'\"';\r\n\t\t\t\t\t\r\n\t\t\t\tif ($num_of_fields > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$result .= ',';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$result .= \"\\n\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function getBonuses($dateStart, $dateEnd);", "public function getBlockdateBook($productid, $date, $to = NULL) {\n $_productid = $productid;\n /**\n * Initalise the '$datesRange'\n */\n $datesRange = array ();\n /**\n * Dealstatus array with\n * 'processing'\n * 'complete'\n */\n $dealstatus = array (\n 'processing',\n 'complete'\n );\n /**\n * Check Whether the date is set\n */\n if ($this->getRequest ()->getParam ( 'date' )) {\n /**\n * DateSplit Value.\n */\n $dateSplit = explode ( \"__\", $this->getRequest ()->getParam ( 'date' ) );\n $x = array (\n $dateSplit [0]\n );\n $year = array (\n $dateSplit [1]\n );\n } else {\n $x = $date;\n $year = $to;\n }\n /**\n * Get the colletion value for 'airhotels_hostorder'\n * 'fromdate'\n * 'todate'\n */\n $range = $this->objectManager->get ( 'Apptha\\Airhotels\\Model\\Hostorder' )->getCollection ()->addFieldToSelect ( array (\n 'fromdate',\n 'todate'\n ) )\n ->addFieldtoFilter ( 'order_status', $dealstatus )\n ->addFieldtoFilter ( 'entity_id', $_productid );\n $rangeCount = $range->getsize ();\n if ($rangeCount > 0) {\n foreach ( $range as $rangeVal ) {\n /**\n * Get Collection value for 'airhotels/product'\n */\n $dateArr = $this->getDaysBlock ( $rangeVal ['fromdate'], $rangeVal ['todate'] );\n /**\n * Itearting the Loop Value.\n */\n foreach ( $dateArr as $dateArrVal ) {\n /**\n * Get Data Array Value.\n */\n $getDateArr = explode ( '-', $dateArrVal );\n if ($getDateArr [0] == $year [0] && $getDateArr [1] == $x [0]) {\n $datesRange [] = $getDateArr [2];\n }\n }\n }\n }\n return $datesRange;\n }", "public function store(Request $request)\n {\n $start=$request->start;\n $end=$request->end;\n $count=Purchase::where('supplier_id',$request->supplier_id)->whereBetween('purchase_date',[$start,$end])->where('total_due','>',0)->count();\n if($count==0){\n session()->flash(\"error\",\"No payment due found\");\n return redirect(route('payment-supplier.index'));\n }\n $data=Purchase::where('supplier_id',$request->supplier_id)->whereBetween('purchase_date',[$start,$end])->with('user','suppliers')->where('total_due','>',0)->get();\n return view('purchase.supplier_payment_info',compact('data'));\n }", "public function bonusDateProvider() \n {\n return [\n [3, 2017, '2017-03-15', 'Check expected date matches given date for mar 2017'],\n [1, null, '2018-01-15', 'Check expected date matches given date for jan 2018'],\n [4, 2018, '2018-04-18', 'Check expected date matches given date for april 2018'],\n [9, null, '2018-09-19', 'Check expected date matches given date for sept 2018'],\n [12, null, '2018-12-19', 'Check expected date matches given date for dec 2018'],\n [6, 2019, '2019-06-19', 'Check expected date matches given date for jun 2019'],\n [7, 2019, '2019-07-15', 'Check expected date matches given date for jul 2019'],\n ];\n }", "function get_customerbookings($custID, $shipID, $filter = false, $filterable = false, $interval = '', $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('bookingc');\n\t\t$q->where('custid', $custID);\n\n\t\tif (!empty($shipID)) {\n\t\t\t$q->where('shiptoid', $shipID);\n\t\t}\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesrep', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\t$q->generate_filters($filter, $filterable);\n\n\t\tswitch ($interval) {\n\t\t\tcase 'month':\n\t\t\t\t$q->field($q->expr(\"CAST(CONCAT(YEAR(bookdate), LPAD(MONTH(bookdate), 2, '0'), '01') AS UNSIGNED) as bookdate\"));\n\t\t\t\t$q->field('SUM(amount) as amount');\n\t\t\t\t$q->group('YEAR(bookdate), MONTH(bookdate)');\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\t$q->field('bookingc.*');\n\t\t\t\t$q->field('SUM(amount) as amount');\n\t\t\t\t$q->group('bookdate');\n\t\t\t\tbreak;\n\t\t}\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "function reports($biz_id,$table,$date,$sum) {\n\t\n\t\t$results = [];\n\t\t$resultsDB = \\DB::table($table)->where('biz_id', $biz_id);\n\n\t\tif(isset($_GET['client_id']) AND $_GET['client_id'] != 'all' AND $table != 'clients') {\n\t\t\t$resultsDB->where('client_id', $_GET['client_id']);\n\t\t}\n\t\t\n\t\tif(isset($_GET['currency'])) {\n\t\t\t$resultsDB->where('currency', $_GET['currency']);\n\t\t}\n\n\t\t$month = clone $resultsDB;\n\t\t$lastmonth = clone $resultsDB;\n\t\t$lastmonth2 = clone $resultsDB;\n\t\t$lastyear = clone $resultsDB;\n\t\t$year = clone $resultsDB;\n\t\t$dates_filtered = clone $resultsDB;\n\n\t\tif(!empty($_GET['date_from'])) {\n\t\t\t$dates_filtered->whereDate($date, '>', $_GET['date_from']);\n\t\t}\n\t\tif(!empty($_GET['date_to'])) {\n\t\t\t$dates_filtered->whereDate($date, '<', $_GET['date_to']);\n\t\t}\n\t\t$results['results'] = $dates_filtered->count();\n\t\t$results['results_sum'] = $dates_filtered->sum($sum);\n\n\t\t$month = $month->whereMonth($date, \\Carbon::now()->format('m'));\n\t\t$lastmonth = $lastmonth->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth()->format('m'));\n\t\t$lastmonth2 = $lastmonth2->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth(2)->format('m'));\n\t\t$year = $year->whereYear($date, \\Carbon::now()->format('Y'));\n\t\t$lastyear = $lastyear->whereYear($date, \\Carbon::now()->subYear()->format('Y'));\n\n\t\t$results['month'] = $month->count();\n\t\t$results['month_sum'] = $month->sum($sum);\n\t\t$results['lastmonth'] = $lastmonth->count();\n\t\t$results['lastmonth_sum'] = $lastmonth->sum($sum);\n\t\t$results['lastmonth2'] = $lastmonth2->count();\n\t\t$results['lastmonth2_sum'] = $lastmonth2->sum($sum);\n\t\t$results['year'] = $year->count();\n\t\t$results['year_sum'] = $year->sum($sum);\n\t\t$results['lastyear'] = $lastyear->count();\n\t\t$results['lastyear_sum'] = $lastyear->sum($sum);\n\t\t$results['total'] = $resultsDB->count();\n\t\t$results['total_sum'] = $resultsDB->sum($sum);\n\t\t\n \treturn $results;\n\t}", "public function getAll() {\n\t\t$search = $this->Supplier()->search()\n\t\t\t->setTable($this->_table)\n\t\t\t->setColumns(array(Supplier::SUPPLIER_ID, Supplier::SUPPLIER_NAME, Supplier::SUPPLIER_ADDRESS, Supplier::SUPPLIER_TEL_NO))\n\t\t\t->sortBySupplierCreated('ASC');\n\t\treturn $search->getRows();\n\t}", "function get_summary_by_feeelement($sy_id_from,$sy_id_to,$date_from,$date_to,$collector_id=0) {\n\t\t$cmd =\n\t\t\t\"SELECT $this->tblname.feeelement_id,feecategory_id,title,sum(payment) AS payment\" .\n\t\t\t\" FROM $this->tblname,tblfeeelement\" .\n\t\t\t\" WHERE (sy_id BETWEEN $sy_id_from AND $sy_id_to)\" .\n\t\t\t\" AND $this->tblname.feeelement_id=tblfeeelement.feeelement_id\" .\n\t\t\t($date_from>0 ? \" AND date>='$date_from'\" : \"\") .\n\t\t\t($date_to>0 ? \" AND date<='$date_to'\" : \"\") .\n\t\t\t($collector_id>0 ? \" AND user_id=$collector_id\" : \"\") .\n\t\t\t\" GROUP BY feeelement_id\";\n\t\treturn $this->query( $cmd );\n\t}", "public function supplierForAproject(){\n\n // LEFT JOIN new_customer nc on sd.customer_id = nc.id\n\n // LEFT join all_suppliers ass on sd.supplier_id = ass.id');\n\n\n\n $data = \\DB::table('supplier_details') \n ->join('new_customer', 'supplier_details.customer_id', '=', 'new_customer.id')\n ->join('all_suppliers','supplier_details.supplier_id','=','all_suppliers.id')\n ->join('new_job','supplier_details.customer_id','=','new_job.customer_id')\n //->orderBy('customer_payment.id', 'desc')\n ->select('all_suppliers.*','supplier_details.from_date','supplier_details.to_date','new_customer.id as customer_id','new_customer.company_name','new_customer.contact_name','new_job.project_name')\n ->paginate(300); \n\n // dd($data); \n\n\n //$data = collect($data);\n\n\n return view('project_supplier_related',['data'=>$data]); \n\n\n\n }", "public function receivedByDate($fromdate, $todate) {\n $query = $this->getEntityManager()\n ->createQuery('\n SELECT\n m.dano, m.partno, m.batchno, m.indate,\n s.rackno, s.heatcode, s.diecode, s.inqty\n FROM\n CIRBundle:SumitomoSub s\n JOIN\n s.main m\n WHERE\n m.indate >= :fromdate and m.indate <= :todate\n ')->setParameter('fromdate', $fromdate)\n ->setParameter('todate', $todate);\n\n try {\n return $query->getResult();\n } catch(\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function getDemand($id) {\n //$id -> idptmaster\n\n $data = array();\n //array(Yii::t('application', 'Propertytax'), 0, 0, 0, 4, 5, 8, 5),\n\n\n $criteria = new CDbCriteria(array(\n 'with' => array(\n 'idptmaster0' => array(\n 'condition' => 'idptmaster0.idptmaster =:idptmaster',\n 'params' => array(':idptmaster' => $id)\n ),\n ),\n 'condition' => 'idccfyear = :idccfyear',\n 'params' => array(':idccfyear' => Yii::app()->session['ccfyear']->idccfyear),\n ));\n\n\n $pttransaction = Pttransaction::model()->find($criteria);\n $status = 'Success';\n $message = '';\n $demandnumber = '';\n $demandinname = '';\n $demandamount = '0';\n $oldfddemandreceipts = array();\n $oldamountpaid = 0;\n\n// $propertytaxpaid = 0;\n// $minsamekittaxpaid = 0;\n//,propertytax,servicetax,minsamekittax,samekittax,waterpttax,educess,subcess1,subcess2,pttaxdiscount,pttaxsurcharge,\n//paid=0;$propertytaxpaid=0;$servicetaxpaid=0;$minsamekittaxpaid=0;$samekittaxpaid=0;$waterpttaxpaid=0;$educesspaid=0;$subcess1paid=0;$subcess2paid=0;$pttaxdiscountpaid=0;$pttaxsurchargepaid=0;$\n\n $propertytaxpaid = 0;\n $servicetaxpaid = 0;\n $minsamekittaxpaid = 0;\n $samekittaxpaid = 0;\n $waterpttaxpaid = 0;\n $educesspaid = 0;\n $subcess1paid = 0;\n $subcess2paid = 0;\n $pttaxdiscountpaid = 0;\n $pttaxsurchargepaid = 0;\n $amountpaid = 0;\n $discountpaid = 0;\n\n\n if (isset($pttransaction)) {\n\n $criteria = new CDbCriteria(array(\n 'condition' => 'demandnumber = :demandnumber',\n 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n ));\n $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n foreach ($fddemandreceipts as $fddemandreceipt) {\n $oldamountpaid += $fddemandreceipt->amountpaid;\n $oldfddemandreceipts[] = $fddemandreceipt;\n\n if (isset($fddemandreceipt->details)) {\n $jsonss = json_decode($fddemandreceipt->details, true);\n $array = array();\n foreach ($jsonss as $jsons) {\n $array[$jsons['name']] = $jsons['value'];\n }\n $propertytaxpaid += $array[\"details-inputgrid[0][amount]\"] + $array[\"details-inputgrid[0][discount]\"];\n $minsamekittaxpaid += $array[\"details-inputgrid[1][amount]\"] + $array[\"details-inputgrid[1][discount]\"];\n\n $samekittaxpaid += $array[\"details-inputgrid[2][amount]\"] + $array[\"details-inputgrid[2][discount]\"];\n $educesspaid += $array[\"details-inputgrid[3][amount]\"] + $array[\"details-inputgrid[3][discount]\"];\n\n $subcess1paid += $array[\"details-inputgrid[4][amount]\"] + $array[\"details-inputgrid[4][discount]\"];\n $subcess2paid += $array[\"details-inputgrid[5][amount]\"] + $array[\"details-inputgrid[5][discount]\"];\n \n $pttaxdiscountpaid += $array[\"details-inputgrid[6][amount]\"] + $array[\"details-inputgrid[6][discount]\"];\n $pttaxsurchargepaid += $array[\"details-inputgrid[7][amount]\"] + $array[\"details-inputgrid[7][discount]\"];\n $servicetaxpaid += $array[\"details-inputgrid[8][amount]\"] + $array[\"details-inputgrid[8][discount]\"];\n $waterpttaxpaid += $array[\"details-inputgrid[9][amount]\"] + $array[\"details-inputgrid[9][discount]\"];\n \n \n \n \n// for ($i = 0; $i < 10; $i++) {\n// $id = \"details-inputgrid[\" . $i . \"][amount]\";\n// $propertytaxpaid += $array[\"details-inputgrid[\" . $i . \"][amount]\"] + $array[\"details-inputgrid[\" . $i . \"][discount]\"];\n// }\n }\n }\n\n $data[] = array(\n Yii::t('application', 'Propertytax'),\n $pttransaction->oldpropertytax,\n $pttransaction->propertytax,\n $pttransaction->oldpropertytax + $pttransaction->propertytax,\n $propertytaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Minsamekittax'),\n $pttransaction->oldminsamekittax,\n $pttransaction->minsamekittax,\n $pttransaction->oldminsamekittax + $pttransaction->minsamekittax,\n $minsamekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Samekittax'),\n $pttransaction->oldsamekittax,\n $pttransaction->samekittax,\n $pttransaction->oldsamekittax + $pttransaction->samekittax,\n $samekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Educess'),\n $pttransaction->oldeducess,\n $pttransaction->educess,\n $pttransaction->oldeducess + $pttransaction->educess,\n $educesspaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess1'),\n $pttransaction->oldsubcess1,\n $pttransaction->subcess1,\n $pttransaction->oldsubcess1 + $pttransaction->subcess1,\n $subcess1paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess2'),\n $pttransaction->oldsubcess2,\n $pttransaction->subcess2,\n $pttransaction->oldsubcess2 + $pttransaction->subcess2,\n $subcess2paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxdiscount'),\n $pttransaction->oldpttaxdiscount,\n $pttransaction->pttaxdiscount,\n $pttransaction->oldpttaxdiscount + $pttransaction->pttaxdiscount,\n $pttaxdiscountpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxsurcharge'),\n $pttransaction->oldpttaxsurcharge,\n $pttransaction->pttaxsurcharge,\n $pttransaction->oldpttaxsurcharge + $pttransaction->pttaxsurcharge,\n $pttaxsurchargepaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Servicetax'),\n $pttransaction->oldservicetax,\n $pttransaction->servicetax,\n $pttransaction->oldservicetax + $pttransaction->servicetax,\n $servicetaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Waterpttax'),\n $pttransaction->oldwaterpttax,\n $pttransaction->waterpttax,\n $pttransaction->oldwaterpttax + $pttransaction->waterpttax,\n $waterpttaxpaid,\n 0,\n 0,\n 0,\n );\n\n\n\n\n// $status = 'Success';\n// \n// $criteria = new CDbCriteria(array(\n// 'condition' => 'demandnumber = :demandnumber',\n// 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n// ));\n// $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n// foreach($fddemandreceipts as $fddemandreceipt){\n// $oldamountpaid += $fddemandreceipt->amountpaid;\n// $oldfddemandreceipts[] = $fddemandreceipt;\n// }\n// \n// $grand_propertytax = \n// ($pttransaction->oldpropertytax+$pttransaction->oldservicetax+$pttransaction->oldminsamekittax+$pttransaction->oldsamekittax+$pttransaction->oldwaterpttax+$pttransaction->oldeducess+$pttransaction->oldsubcess1+$pttransaction->oldsubcess2-$pttransaction->oldpttaxdiscount+$pttransaction->oldpttaxsurcharge);\n// + \n// ($pttransaction->propertytax+$pttransaction->servicetax+$pttransaction->minsamekittax+$pttransaction->samekittax+$pttransaction->waterpttax+$pttransaction->educess+$pttransaction->subcess1+$pttransaction->subcess2)\n// ;\n }\n return $data;\n }", "public function retrieve_product_search_sales_report( $start_date,$end_date )\n\t{\n\t\t$dateRange = \"c.date BETWEEN '$start_date%' AND '$end_date%'\";\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t\t\n\t\t//$this->db->group_by('b.product_model');\n\t}", "public function GetByDate($initialDate, $endDate);", "public function test_get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to)\n {\n /** @var \\CI_DB_result $query */\n $sql = sprintf(<<<EOF\nSELECT order_detail.id\nFROM order_detail JOIN\n order_settlement ON order_detail.id = order_settlement.order_detail_id JOIN\n contract_order ON contract_order.id = order_detail.contract_order_id JOIN\n contract ON contract.id = contract_order.contract_id\nWHERE contract.`disable` = %3\\$d AND\n contract_order.`disable` = %3\\$d AND\n order_detail.`disable` = %3\\$d AND\n order_settlement.`disable` = %3\\$d AND\n contract.contract_status_id <> %5\\$d AND\n contract_order.order_type_code %1\\$s AND\n order_settlement.settlement_type_id %2\\$s AND\n order_detail.authorize_status = %4\\$d\nEOF\n , $this->transformInEqual($codes)\n , $this->transformInEqual($carriers)\n , self::STATUS_ENABLE\n , Sbps::AUTHORIZE_STATUS_BEFORE_CHECK_CREDIT_LIMIT\n , $this->getContractStatus());\n\n $sql .= $this->transformDate('order_settlement.settlement_plan_date', ['from' => $from, 'to' => $to]);\n $query = $this->CI->db->query($sql);\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to);\n $actual = $query->row_array();\n $query->free_result();\n\n $this->assertInstanceOf('CI_DB_result', $query);\n $this->assertEquals($collection, $actual);\n }", "public function getDollarsDebitedToday()\n {\n $today = Carbon::now();\n return $this->getDollarsDebitedOn($today);\n }", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function get_data() {\n\n\t\t$data = array();\n\t\t$i = 0;\n\t\t// Payment query.\n\t\t$payments = give_get_payments( $this->get_donation_argument() );\n\n\t\tif ( $payments ) {\n\n\t\t\tforeach ( $payments as $payment ) {\n\n\t\t\t\t$columns = $this->csv_cols();\n\t\t\t\t$payment = new Give_Payment( $payment->ID );\n\t\t\t\t$payment_meta = $payment->payment_meta;\n\t\t\t\t$address = $payment->address;\n\n\t\t\t\t// Set columns.\n\t\t\t\tif ( ! empty( $columns['donation_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_id'] = $payment->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['seq_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['seq_id'] = Give()->seq_donation_number->get_serial_code( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['title_prefix'] ) ) {\n\t\t\t\t\t$data[ $i ]['title_prefix'] = ! empty( $payment->title_prefix ) ? $payment->title_prefix : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['first_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['first_name'] = isset( $payment->first_name ) ? $payment->first_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['last_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['last_name'] = isset( $payment->last_name ) ? $payment->last_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['email'] ) ) {\n\t\t\t\t\t$data[ $i ]['email'] = $payment->email;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['company'] ) ) {\n\t\t\t\t\t$data[ $i ]['company'] = empty( $payment_meta['_give_donation_company'] ) ? '' : str_replace( \"\\'\", \"'\", $payment_meta['_give_donation_company'] );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['address_line1'] ) ) {\n\t\t\t\t\t$data[ $i ]['address_line1'] = isset( $address['line1'] ) ? $address['line1'] : '';\n\t\t\t\t\t$data[ $i ]['address_line2'] = isset( $address['line2'] ) ? $address['line2'] : '';\n\t\t\t\t\t$data[ $i ]['address_city'] = isset( $address['city'] ) ? $address['city'] : '';\n\t\t\t\t\t$data[ $i ]['address_state'] = isset( $address['state'] ) ? $address['state'] : '';\n\t\t\t\t\t$data[ $i ]['address_zip'] = isset( $address['zip'] ) ? $address['zip'] : '';\n\t\t\t\t\t$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['comment'] ) ) {\n\t\t\t\t\t$comment = give_get_donor_donation_comment( $payment->ID, $payment->donor_id );\n\t\t\t\t\t$data[ $i ]['comment'] = ! empty( $comment ) ? $comment->comment_content : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_total'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_total'] = give_format_amount( give_donation_amount( $payment->ID ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_code'] ) ) {\n\t\t\t\t\t$data[ $i ]['currency_code'] = empty( $payment_meta['_give_payment_currency'] ) ? give_get_currency() : $payment_meta['_give_payment_currency'];\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_symbol'] ) ) {\n\t\t\t\t\t$currency_code = $data[ $i ]['currency_code'];\n\t\t\t\t\t$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_status'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_status'] = give_get_payment_status( $payment, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_gateway'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_gateway'] = $payment->gateway;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_mode'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_mode'] = $payment->mode;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_id'] = $payment->form_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_title'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_title'] = get_the_title( $payment->form_id );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_level_id'] = $payment->price_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_title'] ) ) {\n\t\t\t\t\t$var_prices = give_has_variable_prices( $payment->form_id );\n\t\t\t\t\tif ( empty( $var_prices ) ) {\n\t\t\t\t\t\t$data[ $i ]['form_level_title'] = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 'custom' === $payment->price_id ) {\n\t\t\t\t\t\t\t$custom_amount_text = give_get_meta( $payment->form_id, '_give_custom_amount_text', true );\n\n\t\t\t\t\t\t\tif ( empty( $custom_amount_text ) ) {\n\t\t\t\t\t\t\t\t$custom_amount_text = esc_html__( 'Custom', 'give' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = $custom_amount_text;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_date'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_date'] = date( give_date_format(), $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_time'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_time'] = date_i18n( 'H', $payment_date ) . ':' . date( 'i', $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['userid'] ) ) {\n\t\t\t\t\t$data[ $i ]['userid'] = $payment->user_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donorid'] ) ) {\n\t\t\t\t\t$data[ $i ]['donorid'] = $payment->customer_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donor_ip'] ) ) {\n\t\t\t\t\t$data[ $i ]['donor_ip'] = give_get_payment_user_ip( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_private'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t\t'compare' => '!=',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t) );\n\n\t\t\t\t\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$data[ $i ]['donation_note_private'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_to_donor'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t) );\n\n\t\t\t\t\t$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\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$data[ $i ]['donation_note_to_donor'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\t// Add custom field data.\n\t\t\t\t// First we remove the standard included keys from above.\n\t\t\t\t$remove_keys = array(\n\t\t\t\t\t'donation_id',\n\t\t\t\t\t'seq_id',\n\t\t\t\t\t'first_name',\n\t\t\t\t\t'last_name',\n\t\t\t\t\t'email',\n\t\t\t\t\t'address_line1',\n\t\t\t\t\t'address_line2',\n\t\t\t\t\t'address_city',\n\t\t\t\t\t'address_state',\n\t\t\t\t\t'address_zip',\n\t\t\t\t\t'address_country',\n\t\t\t\t\t'donation_total',\n\t\t\t\t\t'payment_gateway',\n\t\t\t\t\t'payment_mode',\n\t\t\t\t\t'form_id',\n\t\t\t\t\t'form_title',\n\t\t\t\t\t'form_level_id',\n\t\t\t\t\t'form_level_title',\n\t\t\t\t\t'donation_date',\n\t\t\t\t\t'donation_time',\n\t\t\t\t\t'userid',\n\t\t\t\t\t'donorid',\n\t\t\t\t\t'donor_ip',\n\t\t\t\t);\n\n\t\t\t\t// Removing above keys...\n\t\t\t\tforeach ( $remove_keys as $key ) {\n\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t}\n\n\t\t\t\t// Now loop through remaining meta fields.\n\t\t\t\tforeach ( $columns as $col ) {\n\t\t\t\t\t$field_data = get_post_meta( $payment->ID, $col, true );\n\t\t\t\t\t$data[ $i ][ $col ] = $field_data;\n\t\t\t\t\tunset( $columns[ $col ] );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filter to modify Donation CSV data when exporting donation\n\t\t\t\t *\n\t\t\t\t * @since 2.1\n\t\t\t\t *\n\t\t\t\t * @param array Donation data\n\t\t\t\t * @param Give_Payment $payment Instance of Give_Payment\n\t\t\t\t * @param array $columns Donation data $columns that are not being merge\n\t\t\t\t * @param Give_Export_Donations_CSV $this Instance of Give_Export_Donations_CSV\n\t\t\t\t *\n\t\t\t\t * @return array Donation data\n\t\t\t\t */\n\t\t\t\t$data[ $i ] = apply_filters( 'give_export_donation_data', $data[ $i ], $payment, $columns, $this );\n\n\t\t\t\t$new_data = array();\n\t\t\t\t$old_data = $data[ $i ];\n\n\t\t\t\t// sorting the columns bas on row\n\t\t\t\tforeach ( $this->csv_cols() as $key => $value ) {\n\t\t\t\t\tif ( array_key_exists( $key, $old_data ) ) {\n\t\t\t\t\t\t$new_data[ $key ] = $old_data[ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$data[ $i ] = $new_data;\n\n\t\t\t\t// Increment iterator.\n\t\t\t\t$i ++;\n\n\t\t\t}\n\n\t\t\t$data = apply_filters( 'give_export_get_data', $data );\n\t\t\t$data = apply_filters( \"give_export_get_data_{$this->export_type}\", $data );\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t\treturn array();\n\n\t}" ]
[ "0.6335459", "0.63336664", "0.60727787", "0.60360956", "0.6009968", "0.5867105", "0.58590573", "0.5818302", "0.5808124", "0.5747659", "0.57419354", "0.57367045", "0.57094973", "0.57031465", "0.56721336", "0.56671757", "0.56591326", "0.5657962", "0.56493896", "0.5646065", "0.561405", "0.5592176", "0.5554354", "0.5544728", "0.5540358", "0.5540017", "0.55162644", "0.5510223", "0.5474524", "0.54636836", "0.54633147", "0.54611963", "0.5460953", "0.545782", "0.54566723", "0.54543144", "0.5450688", "0.5418496", "0.5416793", "0.5410085", "0.5409085", "0.54009175", "0.53923076", "0.5367162", "0.53630966", "0.5361464", "0.5356148", "0.53546953", "0.53490466", "0.5346874", "0.53331435", "0.5327086", "0.5326141", "0.53213066", "0.53139067", "0.5307218", "0.53046453", "0.5300376", "0.52995515", "0.52940714", "0.52859104", "0.52839714", "0.5283958", "0.5282402", "0.5276545", "0.5266554", "0.52640694", "0.52586687", "0.5253886", "0.5246322", "0.5246156", "0.52371186", "0.523661", "0.52357584", "0.5232879", "0.5223996", "0.5215737", "0.5215682", "0.5211432", "0.5209319", "0.52087426", "0.52084297", "0.5194142", "0.5191735", "0.5187579", "0.51849246", "0.5184646", "0.51782084", "0.5169309", "0.5163797", "0.51633906", "0.5153997", "0.5153055", "0.51525885", "0.51501894", "0.5149492", "0.5145715", "0.5136662", "0.513159", "0.51304525" ]
0.61444044
2
print options descriptions to stdout
function printOptions() { $lines = $this->outputOptions(); echo join( "\n" , $lines ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "public function describe_debug_options() {\n echo '<p>The following options control logging of the plugin actions for debugging purposes.</p>';\n }", "public function show_options( array $opts ) : void {\t\n\t\t$i = -1;\n\t\twhile( ($i++) < sizeof( $opts ) - 1 ){\n\t\t\tif( $i == 1 )\n\t\t\t\techo \"<br><br>\";\n\t\t\tforeach( $opts[ $i ] as $optn => $optv ){\n\t\t\t\techo \"<span style='position: absolute;'>\".$optn.\" -> \".$optv.\"</span><br>\";\n\t\t\t}\n\t\t}\n\t}", "public function actionMyOptions()\n {\n echo \"option1 - $this->option1\\n\\roption2 - $this->option2\\n\\rcolor - $this->color\\n\\r\";\n }", "public function main()\n {\n $this->out($this->OptionParser->help());\n }", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "function showHelp()\n{\n global $cli;\n\n $cli->writeln(sprintf(_(\"Usage: %s [OPTIONS]...\"), basename(__FILE__)));\n $cli->writeln();\n $cli->writeln(_(\"Mandatory arguments to long options are mandatory for short options too.\"));\n $cli->writeln();\n $cli->writeln(_(\"-h, --help Show this help\"));\n $cli->writeln(_(\"-u, --username[=username] Horde login username\"));\n $cli->writeln(_(\"-p, --password[=password] Horde login password\"));\n $cli->writeln(_(\"-t, --type[=type] Export format\"));\n $cli->writeln(_(\"-r, --rpc[=http://example.com/horde/rpc.php] Remote url\"));\n $cli->writeln();\n}", "public function help()\n {\n echo PHP_EOL;\n $output = new Output;\n $output->write('Available Commands', [\n 'color' => 'red',\n 'bold' => true,\n 'underline' => true,\n ]);\n echo PHP_EOL;\n\n $maxlen = 0;\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n if ($len > $maxlen) {\n $maxlen = $len;\n }\n\n }\n\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n $output->write(' ')\n ->write($key, ['color' => 'yellow'])\n ->write(str_repeat(' ', $maxlen - $len))\n ->write(' - ')\n ->write($description);\n\n echo PHP_EOL;\n }\n\n echo PHP_EOL;\n\n }", "public function options() {}", "private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }", "public function test_cli_help() {\n $this->resetAfterTest();\n $this->setAdminUser();\n $clihelper = $this->construct_helper([\"--help\"]);\n ob_start();\n $clihelper->print_help();\n $output = ob_get_contents();\n ob_end_clean();\n\n // Basically a test that everything can be parsed and displayed without errors. Check that some options are present.\n $this->assertEquals(1, preg_match('/--delimiter_name=VALUE/', $output));\n $this->assertEquals(1, preg_match('/--uutype=VALUE/', $output));\n $this->assertEquals(1, preg_match('/--auth=VALUE/', $output));\n }", "function bb_print_mystique_option( $option ) {\r\n\techo bb_get_mystique_option( $option );\r\n}", "function help()\n {\n return\n \"\\n -------------------------------------------------------------------------\\n\".\n \" ---- ~ BidVest Data : Assessment Commands ~ -------\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" All comamnds begin with '\\e[1m\\033[92mphp run.php\\033[0m'\\e[0m\\n\".\n \" Then append of the folling options: \\n\".\n \" -------------------------------------------------------------------------\\n\".\n \"\\n\\n\".\n \" 1. \\e[1m --action=\\033[34madd \\033[0m \\e[0m : \\e[3mThis allows you to add a record.\\e[0m \\n\\n\".\n \" 2. \\e[1m --action=\\033[33medit \\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mEdit a student record.\\e[0m \\n\\n\".\n \" (leave filed blank to keep previous value)\\n\\n\".\n \" 3. \\e[1m --action=\\033[91mdelete\\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mDelete a student record (remove file only).\\e[0m \\n\\n\".\n \" 4. \\e[1m --action=\\033[36msearch \\033[0m \\e[0m : \\e[3mSearch for a student record. \\e[0m \\n\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" Where \\e[1m<valid_id>\\e[0m must be an 8-digit number.\\n\\n\".\n \" -------------------------------------------------------------------------\\n\";\n }", "function print_option($value){\n\t\tstatic $i=0;\n\t\tswitch ( $value['type'] ) {\n\t\t\tcase 'open':\n\t\t\t\t$this->print_subnavigation($value, $i);\n\t\t\t\tbreak;\n\t\t\tcase 'subtitle':\n\t\t\t\t$this->print_subtitle($value, $i);\n\t\t\t\tbreak;\n\t\t\tcase 'close':\n\t\t\t\t$this->print_close();\n\t\t\t\tbreak;\n\t\t\tcase 'block':\n\t\t\t\t$this->print_block($value);\n\t\t\t\tbreak;\n\t\t\tcase 'blockclose':\n\t\t\t\t$this->print_blockclose();\n\t\t\t\tbreak;\n\t\t\tcase 'div':\n\t\t\t\t$this->print_div($value);\n\t\t\t\tbreak;\n\t\t\tcase 'title':\n\t\t\t\t$i++;\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\t$this->print_text_field($value);\n\t\t\t\tbreak;\t\n\t\t\tcase 'textarea':\n\t\t\t\t$this->print_textarea($value);\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\t$this->print_select($value);\n\t\t\t\tbreak;\n\t\t\tcase 'multicheck':\n\t\t\t\t$this->print_multicheck($value);\n\t\t\t\tbreak;\n\t\t\tcase 'color':\n\t\t\t\t$this->print_color($value);\n\t\t\t\tbreak;\n\t\t\tcase 'upload':\n\t\t\t\t$this->print_upload($value);\n\t\t\t\tbreak;\n\t\t\tcase 'checkbox':\n\t\t\t\t$this->print_checkbox($value);\n\t\t\t\tbreak;\n\t\t\tcase 'custom':\n\t\t\t\t$this->print_custom($value);\n\t\t\t\tbreak;\n\t\t\tcase 'pattern':\n\t\t\t\t$this->print_stylebox($value, 'pattern');\n\t\t\t\tbreak;\n\t\t\tcase 'stylecolor':\n\t\t\t\t$this->print_stylebox($value, 'color');\n\t\t\t\tbreak;\n\t\t\tcase 'documentation':\n\t\t\t\t$this->print_text($value);\t\n\t\t\t\tbreak;\n\t\t}\n\t}", "function print_help($err_code = 0)\n{\n\tprintf(\"\n\tHelp:\\n\n\t--help - this help will be printed\n\t--input=FILE_NAME - input xml file (if not provided stdin is used)\n\t--output=FILE_NAME - output file\n\t--header='HEADER' - this header will be written to the beginning of the output file\n\t--etc=N - max number of columns generated from same named sub elements\n\t-a - columns from attributes in imputed xml will not be generated\n\t-b - if element will have more sub elements of same name, only one will be generated\n\t - cannot be combined with --etc option\\n\\n\");\n\texit($err_code);\n}", "abstract function options();", "function startOutput(GetOpt $_options)\n {\n echo \"Ausgabe in Konsole erfolgt...\\n\";\n }", "public function describe_server_options() {\n echo '<p>The following options control access to the endpoint for clearing the cache.</p>';\n }", "public function option_description_string() {\n return '';\n }", "public function printHelp();", "function addOptions(GetOpt $_options)\n {\n $_options->addOptions(array(\n array(null, \"cmd\", GetOpt::NO_ARGUMENT, \"ConsoleOutput - Wenn die Ausgabe per CMD Fenster oder Terminal erfolgt.\\n\")\n ));\n }", "protected abstract function describeCommand(\\RectorPrefix20210607\\Symfony\\Component\\Console\\Command\\Command $command, array $options = []);", "public function optionsAction()\n\t{\n\t\treturn '';\n\t}", "private function printListOfCommands()\n {\n /**\n * @var Padding\n */\n $padding = $this->cli->padding(50)->char(' ');\n $padding->label(' <bold><blue>show dbs:</blue></bold>')->result('show database names');\n $padding->label(' <bold><blue>show collection:</blue></bold>')->result('show collections in current database');\n $padding->label(' <bold><blue>use:</blue></bold>')->result('set current database');\n }", "public function describe_client_options() {\n echo '<p>The following options configure what URL to access when a post is published in this blog.</p>';\n }", "protected function get_options()\n\t{}", "public function display_option_debug() {\n $debug = (bool) $this->options['debug'];\n $this->display_checkbox_field('debug', $debug);\n }", "function dump(array $options = array()) {\n\n }", "private function renderOptions(): string\n {\n $str = '';\n if ($this->defaultText !== false) {\n $option = new OptionElement();\n $option->text = $this->defaultText;\n $option->value = $this->defaultValue;\n $str .= $option->render();\n }\n foreach ($this->arrOption as $option) {\n $this->setAutoOptionTitle($option);\n $str .= $option->render();\n }\n\n return $str;\n }", "function printHelp(){\n\t\techo \"Executes SQL-like SELECT query on XML file.\\n\";\n\t\techo \"Arguments:\\n\";\n\t\techo \" --help - prints this message\\n\";\n\t\techo \" --input=<file> - specifies input XML file\\n\";\n\t\techo \" --output=<file> - specifies output file\\n\";\n\t\techo \" --query='query' - query to be perfomed, cannot be used with --qf\\n\";\n\t\techo \" --qf=<file> - specifies file containing query, cannot be used with --query\\n\";\n\t\techo \" -n - XML header is not generated in the output\\n\";\n\t\techo ' --root=\"string\" - specifies name of the root element in the output'.\"\\n\";\n\t}", "public function options($opts)\n {\n }", "public function cli_help() {}", "public function printCommandList(): void\n {\n $commandList = $this->getCommandList();\n $this->writeData('Available commands:');\n array_map(function ($command) {\n $this->writeData('-------------------------');\n $this->writeData('-name: '.$command->getName());\n $this->writeData('-description: '.$command->getDescription());\n $this->writeData('-------------------------');\n }, $commandList);\n }", "function dblions_general_options() {\n\techo 'Edit general features';\n}", "public function getOptions() {\n\t\tif ($this->row->options != '') {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t}\n\t\tif ($this->row->intoptions != '') {\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$options_map = array_combine($intoptions, $options);\n\t\t}\n\t\tif ($options) {\n\t\t\t$msg = \"Predefined Options:\\n\";\n\t\t\tif ($intoptions) {\n\t\t\t\tforeach ($options_map as $key => $label) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$key}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$label}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($options as $char) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$char}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$char}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "public function optionsSummary(&$categories, &$options) {\n }", "public function displayHelp()\n {\n $sHelp = \"\nUsage:\n$this->sViewName [options]\n\n$this->sTempalteDesc\n\nOptions:\\n\";\n\n $iMaxLength = 2;\n\n foreach ($this->hOptionList as $hOption)\n {\n if (isset($hOption['long']))\n {\n $iTemp = strlen($hOption['long']);\n\n if ($iTemp > $iMaxLength)\n {\n $iMaxLength = $iTemp;\n }\n }\n }\n\n foreach ($this->hOptionList as $hOption)\n {\n $bShort = isset($hOption['short']);\n $bLong = isset($hOption['long']);\n\n if (!$bShort && !$bLong)\n {\n continue;\n }\n\n if ($bShort && $bLong)\n {\n $sOpt = '-' . $hOption['short'] . ', --' . $hOption['long'];\n }\n elseif ($bShort && !$bLong)\n {\n $sOpt = '-' . $hOption['short'] . \"\\t\";\n }\n elseif (!$bShort && $bLong)\n {\n $sOpt = ' --' . $hOption['long'];\n }\n\n $sOpt = str_pad($sOpt, $iMaxLength + 7);\n $sHelp .= \"\\t$sOpt\\t\\t{$hOption['desc']}\\n\\n\";\n }\n\n die($sHelp . \"\\n\");\n }", "public function help()\n\t{\n\t\t$this\n\t\t\t->output\n\t\t\t->addOverview(\n\t\t\t\t'Store shared configuration variables used by the command line tool.\n\t\t\t\tThese will, for example, be used to fill in docblock stubs when\n\t\t\t\tusing the scaffolding command.'\n\t\t\t)\n\t\t\t->addTasks($this)\n\t\t\t->addArgument(\n\t\t\t\t'--{keyName}',\n\t\t\t\t'Sets the variable keyName to the given value.',\n\t\t\t\t'Example: --name=\"John Doe\"'\n\t\t\t);\n\t}", "function defineDescription() {\n return 'List all available commands with a short description';\n }", "public function display_option_generator() {\n\n\t\t$desc = __( 'If our plugin\\'s shortcode generator causes any unwanted clutter or doesn\\'t fully jive with your WordPress setup, you can disable it here.', 'theme-blvd-shortcodes' );\n\t\t$this->display_yes_no( 'themeblvd_shortcode_generator', $desc, 'yes' );\n\n\t}", "protected function help()\n\t{\n\t\t$this->out('Getsocialdata ' . self::VERSION);\n\t\t$this->out();\n\t\t$this->out('Usage: php -f bin/getdata.php -- [switches]');\n\t\t$this->out();\n\t\t$this->out('Switches: -h | --help Prints this usage information.');\n\t\t$this->out();\n\t\t$this->out();\n\t}", "private function displayHelpMessage() {\n $message = \"ClassDumper help:\\n\n -h : displays this help message\\n\n -f (directory 1 directory 2 ... directory n) : \n parses those directories\\n\n -t (xml / yaml) : selects type of serialization\\n\n (no args) : parses working directory in YAML format\\n\";\n\n echo $message;\n die('ShrubRoots ClassDumper v0.991');\n }", "public static function getOptions($options)\n {\n $options_cmdline = '';\n \n foreach ($options as $option => $value) {\n $options_cmdline .= ApiPrintOption::parseOption($option, $value);\n }\n \n return $options_cmdline;\n }", "abstract protected function options(): array;", "function _echo( $option_key ) {\n\t\tbf_echo_option( $option_key, $this->option_panel_id );\n\t}", "function print_help()\n{\n\techo \"skript lze spustit s nasledujicimi parametry:\n\\\t--format=filename \\tparametr urcujici formatovaci soubor, volitelny\n\\\t--input=filename \\tparametr urcujici vstupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vstup ocekavan na stdin\n\\\t--output=filename \\tparametr urcujici vystupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vystup na stdout\n\\\t--br \\t\\t\\tpridani <br /> na konec kazdeho radku, volitelny\\n\";\n\texit (0);\n}", "public function help_brief(&$details) {\n\t\t$details[self::CMD_SQLDUMP] = 'Dumps the current database to the console.';\n\t}", "protected function getOptions()\n {\n return [\n ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\tarray('dry-run', null, InputOption::VALUE_NONE, 'Displays the new cron without making any changes.', null),\n\t\t);\n\t}", "function paramDump() {\n $spec = Terminus::getRunner()->getConfigurator()->getSpec();\n $this->output()->outputDump($spec);\n }", "#[CLI\\Command(name: 'improved:options', aliases: ['c'])]\n #[CLI\\Argument(name: 'a1', description: 'an arg')]\n #[CLI\\Argument(name: 'a2', description: 'another arg')]\n #[CLI\\Option(name: 'o1', description: 'an option')]\n #[CLI\\Option(name: 'o2', description: 'another option')]\n #[CLI\\Usage(name: 'a b --o1=x --o2=y', description: 'Print some example values')]\n public function improvedOptions($a1, $a2, $o1 = 'one', $o2 = 'two')\n {\n return \"args are $a1 and $a2, and options are \" . var_export($o1, true) . ' and ' . var_export($o2, true);\n }", "public function help()\n\t\t{\n\t\t\t//On défini les commandes dispo\n\t\t\t$commands = array(\n\t\t\t\t'generateObjectFromTable' => array(\n\t\t\t\t\t'description' => 'Cette commande permet de générer un objet correspondant à la table fournie en argument.',\n\t\t\t\t\t'requireds' => array(\n\t\t\t\t\t\t'-t' => 'Nom de la table pour laquelle on veux générer un objet',\n\t\t\t\t\t),\n\t\t\t\t\t'optionals' => array(),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$message = \"Vous êtes ici dans l'aide de la console.\\n\";\n\t\t\t$message .= \"Voici la liste des commandes disponibles : \\n\";\n\n\t\t\t//On écrit les texte pour la liste des commandes dispos\n\t\t\tforeach ($commands as $name => $value)\n\t\t\t{\n\t\t\t\t$requireds = isset($value['requireds']) ? $value['requireds'] : array();\n\t\t\t\t$optionals = isset($value['optionals']) ? $value['optionals'] : array();\n\n\t\t\t\t$message .= '\t' . $name . ' : ' . $value['description'] . \"\\n\";\n\t\t\t\t$message .= \"\t\tArguments obligatoires : \\n\";\n\t\t\t\tif (!count($requireds))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($requireds as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$message .= \"\t\tArguments optionels : \\n\";\n\t\t\t\t\n\t\t\t\tif (!count($optionals))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($optionals as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo $message;\n\t\t}", "protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}", "function tidy_getopt(tidy $object, $option) {}", "public function display() {\r\n\r\n\t\t$this->echoOptionHeader();\r\n\r\n\t\tif ( ! empty( $this->options ) ) {\r\n\t\t\tforeach ( $this->options as $option ) {\r\n\r\n\t\t\t\t// Display the name of the option.\r\n\t\t\t\t$name = $option->getName();\r\n\t\t\t\tif ( ! empty( $name ) && ! $option->getHidden() ) {\r\n\t\t\t\t\techo '<span class=\"tf-group-name\">' . esc_html( $name ) . '</span> ';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Disable wrapper printing.\r\n\t\t\t\t$option->echo_wrapper = false;\r\n\r\n\t\t\t\t// Display the option field.\r\n\t\t\t\techo '<span class=\"tf-group-option\">';\r\n\t\t\t\t$option->display();\r\n\t\t\t\techo '</span>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->echoOptionFooter();\r\n\t}", "protected function configure()\n {\n $this\n ->setDescription('Print all indices of an app-id')\n ->addOption(\n 'app-id',\n 'a',\n InputOption::VALUE_OPTIONAL\n );\n }", "public function options(array $options);", "public function run()\n {\n// Options are settings\n\n if ($this->command) $this->command->info('Creating Option Settings');\n\n\n $options_array = array(\n [\n 'key' => 'Landing Title',\n 'default' => \"What is trending in Kenya.\",\n 'value_type' =>Option::TYPE_STR\n ],\n [\n 'key' => 'Landing Description',\n 'default' => \"Getting all the news that are trending in Kenya.\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Contact Title',\n 'default' => \"Talk to us.\",\n 'value_type' =>Option::TYPE_STR\n ],\n [\n 'key' => 'Contact Description',\n 'default' => \"Find our contact information and contact form.\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Footer Title',\n 'default' => \"Welcome to Inatrend Kenya\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Footer Description',\n 'default' => \"\n <p>\n <small>We are here to get you the latest that is trending in Kenya.</small>\n </p>\n <div class=\\\"social-list\\\">\n <a class=\\\"social-list-item\\\" href=\\\"http://twitter.com\\\">\n <span class=\\\"icon icon-twitter\\\"></span>\n </a>\n <a class=\\\"social-list-item\\\" href=\\\"http://facebook.com\\\">\n <span class=\\\"icon icon-facebook\\\"></span>\n </a>\n <a class=\\\"social-list-item\\\" href=\\\"http://linkedin.com\\\">\n <span class=\\\"icon icon-linkedin\\\"></span>\n </a>\n </div>\n \",\n 'value_type' =>Option::TYPE_LON\n ],\n\n [\n 'key' => 'Latest Post Count',\n 'default' => 4,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Trending Post Count',\n 'default' => 4,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Trending Days Limit',\n 'default' => 30,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Limit Latest Post Per Category',\n 'default' => 6,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Primary Color',\n 'default' => '#56c8f3',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Primary Text Color',\n 'default' => '#111111',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Color',\n 'default' => '#0D325B',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Text Color',\n 'default' => '#EEEEEE',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Primary Button Color',\n 'default' => '#029ACF',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Button Color',\n 'default' => '#0D325B',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Danger Button Color',\n 'default' => '#ff0000',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Maximum Rating',\n 'default' => 10,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Default Font Size',\n 'default' => 16,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n );\n\n foreach ($options_array as $option) {\n Option::create([\n 'key' => $option['key'],\n 'default' => $option['default'],\n 'value_type' =>$option['value_type']\n ]);\n }\n }", "function printSortOptions ($url) {\n print \"<p align='center'><b>Sort by:</b> \";\n foreach ($this->sort_opts as $s) {\n if ($s != $this->sort_opts[0]) {\n\t// print a separator between terms\n\tprint \" | \";\n }\n if ($s == $this->sort) {\n\tprint \"&nbsp;\" . $this->pretty_sort_opts[$s] . \"&nbsp;\";\n } else {\n\tprint \"&nbsp;<a href='$url?sort=$s'>\" . \n\t $this->pretty_sort_opts[$s] . \"</a>&nbsp;\";\n }\n }\n print \"</p>\";\n }", "function show_excerpts() {\n\treturn 'excerpts';\n}", "private function usage()\n {\n echo \"Usage: php dcrt.php [-l en|de] [-s] <command> [path]\\n\\n\";\n echo \"Commands:\\n\";\n echo \" status\\tDisplay a list of all conflicted files (read-only)\\n\";\n echo \" resolve\\tStart the automatic conflict resolving process (be careful!)\\n\\n\";\n echo \"Arguments:\\n\";\n echo \" -l en|de\\tSets the language of the conflicted files. Currently\\n\\t\\t'de' and 'en' are supported. Default is: de \\n\";\n echo \" -s \\t\\tShortens the output for an 80 characters wide terminal.\";\n exit;\n }", "function wpbs_echo_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayout.php';\n }", "private function PrintHelp(){\n\t\t\techo \"Script parser.php\\n\";\n echo \"Launch: php7.4 parse.php <file.src >out.xml\\n\";\n\t\t\techo \"Only supported argument is --help\\n\";\n exit;\n\t\t}", "protected function getOptions()\n {\n return array(\n array('show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'),\n );\n }", "public function get_options()\n {\n }", "public function testHelp(){\n $message = null;\n\n $go = new Getopt(null, function($msg)use(&$message){ $message = $msg;}, function(){});\n //test default\n $testOpt = array(\n 'arg'=>'test1',\n\n\n 'help'=>'this is a test parameter',\n 'promptMsg'=>'please enter'\n );\n $_SERVER['argv'] = array(\n 'script_name.php',\n '-h'\n );\n\n\n $go->setOption($testOpt);\n\n $expect = \"Usage: php script_name.php\\nOptions:\\n\\t--test1\\tthis is a test parameter\";\n\n $this->assertEquals($expect, trim($go->getHelpMessage()));\n\n $go->parse();\n\n $this->assertEquals($expect, trim($message));\n\n\n\n }", "public function getHelp() {\n $help = parent::getHelp();\n $global_options = $this->getGlobalOptions();\n if (!empty($global_options)) {\n $help .= PHP_EOL . 'Global options:';\n foreach ($global_options as $name => $value) {\n $help .= PHP_EOL . ' [' . $name . '=' . $value . ']';\n }\n }\n return $help;\n }", "function print_help(){\necho \"Napoveda pre skript na analyzu funkcii v hlavickovych suboroch jazyka C. \\n\";\necho \"Skript je mozne spustit s nasledovnymi parametrami: \\n\";\necho \"--help: zobrazi napovedu \\n\";\necho \"--input=NIECO: kde nieco reprezentuje subor alebo adresar\\n\";\necho \"--output=subor: kde subor je vystupny subor pre zapis. Implicitne stdout\\n\";\necho \"--pretty-xml=k: odsadi vystup o k medzier, implicitne o 4\\n\";\necho \"--no-inline: preskakuje funkcie so specifikatorom inline\\n\";\necho \"--max-par=n: nevypise funkcie s n a viac parametrami\\n\";\necho \"--no-duplicates: v pripade definicie aj deklaracie funkcie vypise funkciu len jedenkrat\\n\";\necho \"--no-whitespaces: odstrani prebytocne biele znaky vo funkciach\"; \nexit (0); \n}", "public function getInfoOptions()\n {\n $options = array();\n foreach ($this->_getopt->options as $name => $info) {\n \n $key = null;\n \n if ($info['short']) {\n $key .= \"-\" . $info['short'];\n }\n \n if ($key && $info['long']) {\n $key .= \" | --\" . $info['long'];\n } else {\n $key .= \"--\" . $info['long'];\n }\n \n $options[$key] = $info['descr'];\n }\n \n ksort($options);\n return $options;\n }", "function showHelp()\n{\n $help = <<<EOD\n\nbulk_convert - Command-line tool to convert fonts data for the tc-lib-pdf-font library.\n\nUsage:\n bulk_convert.php [ options ]\n\nOptions:\n\n -o, --outpath\n Output path for generated font files (must be writeable by the\n web server). Leave empty for default font folder.\n\n -h, --help\n Display this help and exit.\n\nEOD;\n fwrite(STDOUT, $help);\n exit(0);\n}", "protected abstract function describeInputOption(\\RectorPrefix20210607\\Symfony\\Component\\Console\\Input\\InputOption $option, array $options = []);", "public function usageHelp()\n {\n return <<<USAGE\nUsage:\n php -f export.php [--attr1 val1 --attr2 val2] [--images|--skus]\n --skus Export sku,name csv (could be used in Import to delete products)\n --images Export images\nThe script export sku,name (if --sku) or images (if --media) for products with attr1 = val1 AND attr2 = val2; If you want to use LIKE condition, put % in val\n\nExample\n To get a list with images:\n php exportskus.php --name 'My%' --images | sort -u \n To get a csv with sku,name:\n php exportskus.php --name 'My%' --skus > skutodelete.csv\n\n\nUSAGE;\n }", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "public function showGeneralHelp(Context $context)\n {\n $sortedSwitches = $context->phixDefinedSwitches->getSwitchesInDisplayOrder();\n\n $so = $context->stdout;\n\n $so->output($context->highlightStyle, \"phix \" . $context->version);\n $so->outputLine($context->urlStyle, ' http://gradwell.github.com');\n $so->outputLine(null, 'Copyright (c) 2010 Gradwell dot com Ltd. Released under the BSD license');\n $so->outputBlankLine();\n $this->showPhixSwitchSummary($context, $sortedSwitches);\n $this->showPhixSwitchDetails($context, $sortedSwitches);\n $this->showCommandsList($context);\n }", "public function getDesciption();", "function help(){\n\techo \"Usage : \\t(use --verbose for more infos)\\n\";\n\techo \"--build............................: Configure apache\\n\";\n\techo \"--apache-user --verbose............: Set Apache account in memory\\n\";\n\techo \"--sitename 'webservername'.........: Build vhost for webservername\\n\";\n\techo \"--remove-host 'webservername'......: Remove vhost for webservername\\n\";\n\techo \"--install-groupware 'webservername': Install the predefined groupware\\n\";\n\techo \"--httpd............................: Rebuild main configuration and modules\\n\";\n\techo \"--perms............................: Check files and folders permissions\\n\";\n\techo \"--failed-start.....................: Verify why Apache daemon did not want to run\\n\";\n\techo \"--resolv...........................: Verify if hostnames are in DNS\\n\";\n\techo \"--drupal...........................: Install drupal site for [servername]\\n\";\n\techo \"--drupal-infos.....................: Populate drupal informations in Artica database for [servername]\\n\";\n\techo \"--drupal-uadd......................: Create new drupal [user] for [servername]\\n\";\n\techo \"--drupal-udel......................: Delete [user] for [servername]\\n\";\n\techo \"--drupal-uact......................: Activate [user] 1/0 for [servername]\\n\";\n\techo \"--drupal-upriv.....................: set privileges [user] administrator|user|anonym for [servername]\\n\";\n\techo \"--drupal-cron......................: execute necessary cron for all drupal websites\\n\";\n\techo \"--drupal-modules...................: dump drupal modules for [servername]\\n\";\n\techo \"--drupal-modules-install...........: install pre-defined modules [servername]\\n\";\n\techo \"--drupal-schedules.................: Run artica orders on the servers\\n\";\n\techo \"--listwebs.........................: List websites currently sets\\n\";\n}", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('format', '%isd% %mobile%');\n }", "abstract public function getOptions();", "public function options($opts)\n {\n $opts->add('v|verbose', 'verbose message');\n $opts->add('path:', 'required option with a value.');\n $opts->add('path?', 'optional option with a value');\n $opts->add('path+', 'multiple value option.');\n }", "public function usageHelp()\n {\n return <<<USAGE\nUsage: php factfinder.php -- [options]\n\n --exportAll Export products for every store\n --exportStore <storeId> Export Product CSV for store\n --exportStorePrice <storeId> Export Price CSV for store\n --exportStoreStock <storeId> Export Stock CSV for store\n --exportAllTypesForStore <storeId> Export Stock, Price and Products for store\n --exportAllTypesForAllStores Export Stock, Price and Products for all stores\n --exportCmsForStore <storeId> Export CMS Sites for store\n exportall Export Product CSV for all stores\n help Show this help message\n\n <storeId> Id of the store you want to export\n\nUSAGE;\n }", "public static function print_editor_option_markup($robot_info, $ability_info){\n // Require the function file\n $this_option_markup = '';\n require(MMRPG_CONFIG_ROOTDIR.'data/classes/ability_editor-option-markup.php');\n // Return the generated option markup\n return $this_option_markup;\n }", "public function displayHelp()\n\t{\n\t\t$obj = MpmCommandLineWriter::getInstance();\n\t\t$obj->addText('./migrate.php latest [--force]');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('This command is used to migrate up to the most recent version. No arguments are required.');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('If the --force option is provided, then the script will automatically skip over any migrations which cause errors and continue migrating forward.');\n\t\t$obj->addText(' ');\n\t\t$obj->addText('Valid Examples:');\n\t\t$obj->addText('./migrate.php latest', 4);\n\t\t$obj->addText('./migrate.php latest --force', 4);\n\t\t$obj->write();\n\t}", "public function ovpnDisplayConfigSet()\n {\n foreach ($this as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }", "function spizer_usage()\n{\n if (! isset($argv)) $argv = $_SERVER['argv'];\n \n echo <<<USAGE\nSpizer - the flexible web spider, v. 0.1\nUsage: {$argv[0]} [options] <Start URL>\n\nWhere [options] can be:\n --delay | -d <seconds> Number of seconds to delay between requests\n --log | -l <log file> Send messages to file instead of to stdout\n --savecookies | -s Save and resend cookies throughout session\n --help | -h Show this help message\n\n\nUSAGE;\n}", "public function render_screen_options()\n {\n }", "function getOptions() ;", "public function getPrintOptions() {\r\n\t\treturn $this->options->getPrint();\r\n\t}", "function display_help ($version = 0) {\n\tprint \"Cacti ISP Billing Script, Copyright 2006-2009 - The Cacti Group\\nVersion: \" . $version . \"\\n\";\n\tprint \"usage: -config=[file] -track=[file] [-check] [-build=[file] [-filter=[id]]] [-process] [-list] \\n\";\n\tprint \" [-email=[email]] [-email_no_html] [-html_no_csv] [-start_date=[date]] \\n\";\n print \" [-current_time=[date]] [-tech] [-d] [--debug] [-h] [--help] [-v] [--version]\\n\\n\";\n\tprint \"-config=[file] - Billing configuration file\\n\";\n\tprint \"-track=[file] - Date tracking file\\n\";\n\tprint \"-track_no_write - Do not update the date tracking file\\n\";\n\tprint \"-track_clear_cache - Clear threshold tracking cache from track file\\n\";\n\tprint \"-check - Check billing configuration file\\n\";\n\tprint \"-build=[file] - Build example configuration file from system, supplying filename is \\n\";\n\tprint \" optional, default example.xml\\n\";\n\tprint \"-filter=[id] - Only used by the build command to limit configuration build to the supplied\\n\";\n\tprint \" graph ids, comma delimited\\n\";\n\tprint \"-info - Display information on the billing configuration file\\n\";\n\tprint \"-list - Display list of graphs and titles that are billable\\n\";\n\tprint \"-email=[email] - Override configuration email addresses, all customer reports will be\\n\";\n\tprint \" emailed to the supplied email\\n\";\n\tprint \"-email_no_html - Only used when email override enabled, globally set no html emails \\n\";\n\tprint \"-email_no_csv - Only used when email override enabled, globally set no csv attachments\\n\";\n\tprint \"-start_date=[date] - Used to override track date and start date for testing and reruns\\n\";\n\tprint \"-current_time=[date] - Used to override current time for testing and reruns\\n\";\n\tprint \"-tech - Writes out technical support file\\n\";\n\tprint \"-d --debug - Display verbose output during execution\\n\";\n\tprint \"-v --version - Display this help message\\n\";\n\tprint \"-h --help - Display this help message\\n\\n\";\n}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t\n\t\t];\n\t}", "protected function configure()\n {\n $this->setDescription('Scan for legacy error middleware or error middleware invocation.');\n $this->setHelp(self::HELP);\n $this->addOption('dir', 'd', InputOption::VALUE_REQUIRED, self::HELP_OPT_DIR);\n }", "public function showOptions()\n {\n\treturn $this->getConfigData('checkout/delivery_options');\n }", "public function getOptions();" ]
[ "0.7849274", "0.7490152", "0.7015235", "0.68278784", "0.6696799", "0.65354073", "0.65354073", "0.65354073", "0.65354073", "0.65354073", "0.653008", "0.6460849", "0.64299494", "0.63143253", "0.62900513", "0.62900424", "0.6269769", "0.62693894", "0.62645644", "0.62310714", "0.62074685", "0.6186081", "0.616315", "0.6137998", "0.61282325", "0.61192155", "0.6116775", "0.6115399", "0.6080876", "0.6042517", "0.6018324", "0.6008672", "0.60071665", "0.59716374", "0.5971064", "0.5967315", "0.59414315", "0.59385765", "0.5938267", "0.59291446", "0.5919744", "0.59159523", "0.5907054", "0.5880906", "0.5877797", "0.58707845", "0.5869413", "0.5867447", "0.58581537", "0.58537656", "0.5848472", "0.5839721", "0.5835841", "0.5825202", "0.5823752", "0.58197695", "0.5817816", "0.57889116", "0.57776284", "0.5776522", "0.57685024", "0.5756636", "0.5755187", "0.57521135", "0.5749991", "0.57436997", "0.57424694", "0.5737623", "0.5735056", "0.57331336", "0.5724329", "0.5721111", "0.5712915", "0.57071567", "0.57057244", "0.5694931", "0.5669432", "0.5668266", "0.5668266", "0.5666973", "0.56605643", "0.5654586", "0.5653501", "0.56434757", "0.5643053", "0.56402904", "0.5636542", "0.5634312", "0.56177104", "0.56152785", "0.56089354", "0.5602984", "0.56025", "0.56011164", "0.5599421", "0.5595483", "0.5569958", "0.5569557", "0.5566433", "0.55601937" ]
0.81963897
0
A basic unit test example.
public function testExample() { $this->assertTrue(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicTest()\n {\n\n }", "public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testGetPatrimonio()\n {\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testGetChamado()\n {\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }", "public function testSomething()\n {\n }", "public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }", "public function testBasicTest()\r\n {\r\n $this->assertTrue(true);\r\n }", "public function test() {\n\n\t}", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testGetExpedicao()\n {\n }", "public function testBasicTest()\n {\n dd('here');\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }", "public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n // $roomController = new RoomController();\n $request = $this->call('GET', '/room/123');\n $this->assertEquals(200, $request->status());\n }" ]
[ "0.80752075", "0.7854537", "0.780656", "0.7760198", "0.7665438", "0.7644897", "0.76254654", "0.7589822", "0.75457186", "0.75257766", "0.75108504", "0.7400794", "0.7393162", "0.7393162", "0.7393162", "0.7393162", "0.7326179", "0.73256296", "0.72956586", "0.72758234", "0.72630125", "0.72496897", "0.7220798", "0.7215937", "0.7196073", "0.71823233", "0.71787", "0.7162814", "0.7153517", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7143564", "0.7133477", "0.7127466", "0.71243346", "0.7115046", "0.7101194" ]
0.7423434
55
bring to lower case
function clean_my_words($words) { return strtolower($words); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function downcase(){\n\t\treturn $this->_copy(Translate::Lower($this->toString(),$this->getEncoding()));\n\t}", "function isLower(){ return $this->length()>0 && $this->toString()===$this->downcase()->toString(); }", "function upcase(){\n\t\treturn $this->_copy(Translate::Upper($this->toString(),$this->getEncoding()));\n\t}", "function uncapitalize(){\n\t\t$first = $this->substr(0,1)->downcase();\n\t\treturn $first->append($this->substr(1));\n\t}", "function lower($text) {\n\t$text = mb_strtolower($text, 'UTF-8');\n\treturn $text;\n}", "function correctCase($name)\n{\n // aAa | AAA | aaA ---> aaa\n $nameLowecase = strtolower($name);\n // aaa --> Aaa\n $uppercaseName = ucfirst($nameLowecase);\n return $uppercaseName;\n}", "public function lowercase()\n {\n return $this->getNameInstance()->lowercase();\n }", "public function toLower()\n {\n $lowerCase = [];\n foreach ($this->split() as $key => $value) {\n $lowerCase[] = strtolower($value);\n }\n\n return $lowerCase;\n }", "function properCase($propername) {\n //if (ctype_upper($propername)) {\n $propername = ucwords(strtolower($propername));\n //}\n return $propername;\n }", "function FixCaseLower ( $bFixCaseLower=null )\n{\n if ( isset($bFixCaseLower) ) {\n $this->_FixCaseLower = $bFixCaseLower;\n return true;\n } else {\n return $this->_FixCaseLower;\n }\n}", "public function requireMixedCase()\n {\n $this->mixedCase = true;\n }", "private static function _casenormalize(&$val)\n {\n $val = strtolower($val);\n }", "function lower_case($value)\n {\n return Str::lower($value);\n }", "function atk_strtolower($str)\n{\n\treturn atkString::strtolower($str);\n}", "public static function snakeCase($str) {}", "public function requireMixedCase() {\n\t$this->_mixedCase = true; // reset the $_mixedCase property of the current instance to true\n }", "public function isLowerCase()\n {\n if ($this->matchesPattern('^[[:lower:]]*$')) {\n return true;\n } else {\n return false;\n }\n }", "static function lower(string $s): string {\n return mb_strtolower($s, 'UTF-8');\n }", "function uv_first_capital($string){\n //Patron para reconocer y no modificar numeros romanos\n $pattern = '/\\b(?![LXIVCDM]+\\b)([A-Z_-ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ]+)\\b/';\n $output = preg_replace_callback($pattern, function($matches) {\n return mb_strtolower($matches[0], 'UTF-8');\n }, $string);\n $output = ucfirst($output);\n return $output;\n }", "public function isLowerCase() {\n return $this->equals($this->toLowerCase());\n }", "public static function lower($value){\n return mb_strtolower($value, 'UTF-8');\n }", "public function testLower()\n {\n $this->assertEquals(Str::lower('foo'), 'foo');\n }", "function url_to_lowercase() {\n\t$url = $_SERVER['REQUEST_URI'];\n\n\tif ( preg_match( '/[\\.]/', $url ) ) :\n\t\treturn;\n\tendif;\n\n\tif ( preg_match( '/[A-Z]/', $url ) ) :\n\t\t$lc_url = strtolower( $url );\n\t\theader( \"Location: \" . $lc_url );\n\t\texit(0);\n\tendif;\n}", "function studly_case($str){\n\t\treturn Str::studly($str);\n\t}", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "function is_lower($car ) {\nreturn ($car >= 'a' && $car <= 'z');\n}", "public static function pearCase($str) {}", "public static function lowerFirst(string $input): string\n {\n return lcfirst($input);\n }", "function mb_convert_case($sourcestring, $mode, $encoding) {}", "public static function lower($s)\n\t{\n\t\treturn mb_strtolower($s, 'UTF-8');\n\t}", "public function swapCase()\n {\n $stringy = static::create($this->str, $this->encoding);\n $encoding = $stringy->encoding;\n\n $stringy->str = preg_replace_callback(\n '/[\\S]/u',\n function($match) use ($encoding) {\n $marchToUpper = UTF8::strtoupper($match[0], $encoding);\n\n if ($match[0] == $marchToUpper) {\n return UTF8::strtolower($match[0], $encoding);\n } else {\n return $marchToUpper;\n }\n },\n $stringy->str\n );\n\n return $stringy;\n }", "public function toLower(): self\n {\n if ($this->cache['i' . self::LOWER_CASE] ?? false) {\n return clone $this;\n }\n return new static($this->getMappedCodes(self::LOWER_CASE));\n }", "public function hasLowerCase()\n {\n return $this->matchesPattern('.*[[:lower:]]');\n }", "protected function getLowerNameReplacement(): string\n {\n return strtolower($this->getName());\n }", "public static function lowerCamelCase($name)\n {\n return lcfirst(self::upperCamelCase($name));\n }", "public function toLowerCase()\n {\n $str = UTF8::strtolower($this->str, $this->encoding);\n\n return static::create($str, $this->encoding);\n }", "public static function toLowerCase(string $subject): string\n {\n return strtolower($subject);\n }", "public function remove_all_caps()\n {\n }", "static public function lowerCamel($string) {\n $output = self::upperCamel($string);\n if (function_exists('lcfirst')) {\n return lcfirst($output);\n } else {\n $output[0] = strtolower($output[0]);\n return $output;\n }\n\t}", "function the_champ_first_letter_uppercase($word){\r\n\treturn ucfirst($word);\r\n}", "public static function slw($data)\n {\n return strtolower($data);\n }", "public static function studlyCase($str) {}", "function convertNamingFromUnderlineToCamelCase($text,$firstLetterLowerCase=true) {\n\t\t\tpreg_match_all('/(^[a-zA-Z])|(_[a-zA-Z])/', $text, $matches, PREG_PATTERN_ORDER);\n\t\n\t\t\tfor ($i = 0; $i < count($matches[0]); $i++) {\n\t\t\t\t\t$original=$matches[0][$i];\n\t\t\t\t\t$originals[]=$original;\n\t\t\t\t\tif ($i==0 and $firstLetterLowerCase)\n\t\t\t\t\t\t\t$replacement=str_replace('_','',$matches[0][$i]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$replacement=strtoupper(str_replace('_','',$matches[0][$i]));\n\t\t\t\t\t$replacements[]=$replacement;\n\t\t\t}\n\t\n\t\t\treturn str_replace($originals,$replacements,$text);\n\t}", "function toJadenCase($string) \r\n\t{\r\n\t return ucwords($string);\r\n\t //ucwords string function — Uppercase the first character of each word in a string\r\n\t}", "function camel_case_with_initial_capital($s) {\n return camel_case($s, true);\n }", "protected static function __toLowercase(string $str): string {\n\t\treturn strtolower($str);\n\t}", "function lower( $str ) {\r\nreturn preg_match( \"/[a-z]/\", $str );\r\n}", "function ModifMiniNombreUser( $nameUser ){\r\n return strtolower($nameUser);\r\n}", "function fmtCase($text) {\n\t\tglobal $assoc_case;\n\n\t\tif ($assoc_case == \"lower\") $newtext\t= strtolower($text);\n\t\telse if ($assoc_case == \"upper\") $newtext\t= strtoupper($text);\n\t\treturn $newtext;\n\n\t}", "public function underscoredToLowerCamelCaseDataProvider() {}", "function strtoproper($someString) {\n return ucwords(strtolower($someString));\n}", "function title_case($value)\n {\n return Str::title($value);\n }", "public function lower()\n {\n $this->text = strtolower($this->text);\n\n return $this;\n }", "public static function toLower(string $input): string\n {\n return strtolower($input);\n }", "public function testStringCanBeConvertedToTitleCase()\n {\n $this->assertEquals('Taylor', Str::title('taylor'));\n $this->assertEquals('Άχιστη', Str::title('άχιστη'));\n }", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "public function makeLowerCaseName($name)\r\n\t{\r\n\t\t$pos = array();\r\n\t\tfor ($i = 0; $i < strlen($name); $i++)\r\n\t\t{\r\n\t\t\tif ($i > 0 && ctype_upper($name[$i]))\r\n\t\t\t{\r\n\t\t\t\t$pos[] = $i; \r\n\t\t\t}\r\n\t\t}\r\n\t\tforeach ($pos as $index => $p)\r\n\t\t{\r\n\t\t\t$p += $index;\r\n\t\t\t$name = substr($name, 0, $p) . '_' . substr($name, $p);\r\n\t\t}\r\n\t\treturn strtolower($name);\r\n\t}", "function low($str) {\n\t\treturn strtolower($str);\n\t}", "function twig_lower_filter(Twig_Environment $env, $string)\n {\n if (null !== ($charset = $env->getCharset())) {\n return mb_strtolower($string, $charset);\n }\n return strtolower($string);\n }", "function title_case($value)\n {\n return Str::title($value);\n }", "public static function standardize( $name ) {\n\t\treturn self::firstUpper( self::lower( $name )) ;\n\t}", "public static function lower($value)\n {\n return mb_strtolower($value, 'UTF-8');\n }", "public function getLowerName(): string\n {\n return strtolower($this->packageName);\n }", "function lowercase($letter1)\n {\n for ($i = 0; $i < strlen($letter1); $i++) {\n\t if (ord($letter1[$i]) >= ord('A') &&\n ord($letter1[$i]) <= ord('Z')) {\n return false;\n }\n }\n return true;\n }", "public function toLowerCase()\n {\n $this->provider->toLowerCase();\n \n return $this;\n }", "function camel_case($value)\n {\n return lcfirst(pascal_case($value));\n }", "function sanifyText($text) {\n // todo whitespace stripping removes commas \"ostuh,otuh\" and concats the words\n // fix this issue.\n return strtolower($text);\n}", "public function lower($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function titleCase($string) {\r\n // Remove no_parse content.\r\n $string_array = preg_split(\"/(<no_parse>|<\\/no_parse>)+/i\",$string);\r\n $newString = '';\r\n for ($k=0; $k<count($string_array); $k=$k+2) {\r\n $string = $string_array[$k];\r\n // If the entire string is upper case, don't perform any title case on it.\r\n if ($string != strtoupper($string)) {\r\n // TITLE CASE RULES:\r\n // 1.) Uppercase the first char in every word.\r\n $new = preg_replace(\"/(^|\\s|\\'|'|\\\"|-){1}([a-z]){1}/ie\",\"''.stripslashes('\\\\1').''.stripslashes(strtoupper('\\\\2')).''\", $string);\r\n // 2.) Lower case words exempt from title case.\r\n // Lowercase all articles, coordinate conjunctions (\"and\", \"or\", \"nor\"), and prepositions regardless of length, when they are other than the first or last word.\r\n // Lowercase the \"to\" in an infinitive.\" - this rule is of course approximated since it is context sensitive.\r\n $matches = array();\r\n // Perform recursive matching on the following words.\r\n preg_match_all(\"/(\\sof|\\sa|\\san|\\sthe|\\sbut|\\sor|\\snot|\\syet|\\sat|\\son|\\sin|\\sover|\\sabove|\\sunder|\\sbelow|\\sbehind|\\snext\\sto|\\sbeside|\\sby|\\samoung|\\sbetween|\\sby|\\still|\\ssince|\\sdurring|\\sfor|\\sthroughout|\\sto|\\sand){2}/i\",$new ,$matches);\r\n for ($i=0; $i<count($matches); $i++) {\r\n for ($j=0; $j<count($matches[$i]); $j++) {\r\n $new = preg_replace(\"/(\".$matches[$i][$j].\"\\s)/ise\",\"''.strtolower('\\\\1').''\",$new);\r\n }\r\n }\r\n // 3.) Do not allow upper case apostrophes.\r\n $new = preg_replace(\"/(\\w'S)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\w'\\w)/ie\",\"''.strtolower('\\\\1').''\",$new);\r\n $new = preg_replace(\"/(\\W)(of|a|an|the|but|or|not|yet|at|on|in|over|above|under|below|behind|next to| beside|by|amoung|between|by|till|since|durring|for|throughout|to|and)(\\W)/ise\",\"'\\\\1'.strtolower('\\\\2').'\\\\3'\",$new);\r\n // 4.) Capitalize first letter in the string always.\r\n $new = preg_replace(\"/(^[a-z]){1}/ie\",\"''.strtoupper('\\\\1').''\", $new);\r\n // 5.) Replace special cases.\r\n // You will add to this as you find case specific problems.\r\n $new = preg_replace(\"/\\sin-/i\",\" In-\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(ph){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1pH\\\\3'\",$new);\r\n $new = preg_replace(\"/^ph(\\s|$)/i\",\"pH \",$new);\r\n $new = preg_replace(\"/(\\s)ph($)/i\",\" pH\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(&){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1and\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(groundwater){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/e\",\"'\\\\1Ground Water\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\W|^){1}(cross){1}(\\s){1}(connection){1}(\\W|$){1}/ie\",\"'\\\\1\\\\2-\\\\4\\\\5'\",$new); // Always hyphenate cross-connections.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(vs\\.){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1Vs.\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-off){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Off\\\\3'\",$new);\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(on-site){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*){1}/ie\",\"'\\\\1On-Site\\\\3'\",$new);\r\n // Special cases like Class A Fires.\r\n $new = preg_replace(\"/(\\s|\\\"|\\'){1}(class\\s){1}(\\w){1}(\\s|,|\\.|\\\"|\\'|:|!|\\?|\\*|$){1}/ie\",\"'\\\\1\\\\2'.strtoupper('\\\\3').'\\\\4'\",$new);\r\n $new = stripslashes($new);\r\n $string_array[$k] = $new;\r\n }\r\n }\r\n for ($k=0; $k<count($string_array); $k++) {\r\n $newString .= $string_array[$k];\r\n }\r\n return($newString);\r\n }", "public function usesCaseSensitiveIdentifiers() {}", "public function lowercase()\n {\n return new Name(strtolower($this->name));\n }", "public function toLower() : Manipulator\n {\n return new static(mb_strtolower($this->string));\n }", "public function toLowerCase() {\n $rawString = mb_strtolower($this->rawString, $this->charset);\n\n return new static($rawString, $this->charset);\n }", "public function getTitleCase($value) {\n\t\t$value = str_replace('_', ' ', $value);\n\t\t$value = ucwords($value);\n\t\t$value = str_replace(' ', '', $value);\n\t\treturn $value;\n\t}", "public function toAlternateCase(){\n $alternative = str_split(strtolower($this->string),1);\n for($i=0;$i<sizeof($alternative);$i++){\n if(($i+1)%2==0){\n $alternative[$i]=strtoupper($alternative[$i]);\n } \n }\n return $alternative = implode(\"\",$alternative);\n }", "public static function fix_case($word) {\n # Fix case for words split by periods (J.P.)\n if (strpos($word, '.') !== false) {\n $word = self::safe_ucfirst(\".\", $word);;\n }\n # Fix case for words split by hyphens (Kimura-Fay)\n if (strpos($word, '-') !== false) {\n $word = self::safe_ucfirst(\"-\", $word);\n }\n # Special case for single letters\n if (strlen($word) == 1) {\n $word = strtoupper($word);\n }\n # Special case for 2-letter words\n if (strlen($word) == 2) {\n # Both letters vowels (uppercase both)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # Both letters consonants (uppercase both)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # First letter is vowel, second letter consonant (uppercase first)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = ucfirst(strtolower($word));\n }\n # First letter consonant, second letter vowel or \"y\" (uppercase first)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && (in_array(strtolower($word{1}), self::$dict['vowels']) || strtolower($word{1}) == 'y')) {\n $word = ucfirst(strtolower($word));\n }\n }\n # Fix case for words which aren't initials, but are all upercase or lowercase\n if ( (strlen($word) >= 3) && (ctype_upper($word) || ctype_lower($word)) ) {\n $word = ucfirst(strtolower($word));\n }\n return $word;\n }", "function lcfirst( $str ) {\r\n $str[0] = strtolower($str[0]);\r\n return (string)$str;\r\n }", "static public function camelToLower($camel)\n {\n // split up the string into an array according to the uppercase characters\n $array = preg_split('/([A-Z][^A-Z]*)/', $camel, (-1), PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n $array = array_map('strtolower', $array);\n // create our string\n $lower = '';\n foreach ($array as $part)\n {\n $lower .= $part . '_';\n }\n $lower = substr($lower, 0, strlen($lower) - 1);\n return $lower;\n }", "function lcfirst($str) {\n return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));\n }", "function makeTitleCase($input_title)\n {\n $input_array_of_words = explode(\" \", strtolower($input_title));\n $output_titlecased = array();\n $designated = array(\"a\", \"as\", \"an\", \"by\", \"of\", \"on\", \"to\", \"the\", \"or\", \"in\", \"from\", \"is\");\n foreach ($input_array_of_words as $word) {\n //if any of the words in designated array appear, lowercase them\n if (in_array($word, $designated)) {\n array_push($output_titlecased, lcfirst($word));\n //otherwise, uppercase\n } else {\n array_push($output_titlecased, ucfirst($word));\n }\n\n\n }\n\n//overrides the first if statement, making every first word capitalized no matter what\n $output_titlecased[0] = ucfirst($output_titlecased[0]);\n\n return implode(\" \", $output_titlecased);\n }", "function ucfirst_sentence($str){\r\n\treturn preg_replace('/\\b(\\w)/e', 'strtoupper(\"$1\")', strtolower($str));\r\n}", "function sentance_case($string){\n\t\t\n\t\t//Make standard sentance case\n\t\t$string = ucwords(strtolower($string));\n\t\t$string = trim($string);\n\t\t\n\t\t//Dates\n\t\t//TODO: find and make uppercase PM, AM\n\n\t\t//Random Words\n\t\t$string = str_replace(\"Dj\", \"DJ\", $string);\n\t\t$string = str_replace(\"(dj)\", \"(DJ)\", $string);\t\t\n\t\t$string = str_replace(\"Http\", \"http\", $string);\n\t\t\t\t\n\t\treturn $string;\n\t}", "public function snakeCase($val)\n\t{\n\t\treturn snake_case($val);\n\t}", "public function set_to_lower_case()\n {\n if (empty($this->params['named']['field']))\n {\n echo 'You must enter a field to work with. recipe-manager/ingredients/set_to_lower_case/field:ingredient';\n exit();\n }\n\n if (strpos($this->params['named']['field'], '.'))\n {\n $fields = explode('.', $this->params['named']['field']);\n }\n else\n {\n $fields[] = $this->params['named']['field'];\n }\n\n var_dump($fields);\n\n $params = array(\n //'conditions' => array('Model.field' => $thisValue), //array of conditions\n //'recursive' => 1, //int\n //'fields' => array($this->modelClass . '.' . $field), //array of field names\n //'order' => array('Model.created', 'Model.field3 DESC'), //string or array defining order\n //'group' => array('Model.field'), //fields to GROUP BY\n //'limit' => n, //int\n //'page' => n, //int\n //'offset' => n, //int\n //'callbacks' => true //other possible values are false, 'before', 'after'\n );\n\n $result = $this->{$this->modelClass}->find('all', $params);\n\n foreach ($result as &$item)\n {\n var_dump(count($fields));\n if (count($fields) == 1)\n {\n var_dump('Single Item');\n var_dump($item[$this->modelClass][$fields[0]]);\n $item[$this->modelClass][$fields[0]] = strtolower($item[$this->modelClass][$fields[0]]);\n var_dump($item[$this->modelClass][$fields[0]]);\n }\n else if (count($fields) == 2)\n {\n var_dump('Nested Item');\n foreach ($item[$this->modelClass][$fields[0]] as &$array)\n {\n var_dump($array[$fields[1]]);\n $array[$fields[1]] = strtolower($array[$fields[1]]);\n var_dump($array[$fields[1]]);\n }\n }\n var_dump($item);\n\n if (!$this->{$this->modelClass}->save($item))\n {\n exit('Error');\n }\n }\n exit('Done');\n }", "public static function lower(?string $value): string\n {\n return mb_strtolower($value ?? '', 'UTF-8');\n }", "public static function toLower($str)\n {\n return strtolower($str);\n }", "protected function _normalize($value)\n {\n return strtolower($value);\n }", "public function lowercase(string $string): string\n {\n return mb_convert_case($string, MB_CASE_LOWER, 'UTF-8');\n }", "function str_camelcase($str, $capital_first_char = false)\n{\n $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $str)));\n return $capital_first_char ? $str : lcfirst($str);\n}", "public function toLowerCase() {\n\t\t\tif ($this->info->type == 'string') {\n\t\t\t\t$value = strtolower($this->value);\n\t\t\t\treturn static::factory($this->name, $value);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function getUcaseName() {\n return ucfirst($this->name);\n }", "static public function lc_( $name )\r\n {\r\n $name = lcfirst($name);\r\n $len = strlen($name);\r\n \r\n for( $i = 1; $i < $len; ++$i )\r\n {\r\n $ord = ord($name[$i]);\r\n if( $ord >= 65 && $ord <= 90 ) {\r\n $name = str_replace( $name[$i], '_'.lcfirst($name[$i]), $name );\r\n }\r\n }\r\n return $name;\r\n }", "function true_uppercase($string) {\n\treturn str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($string))));\n}", "static function isLower($str) {\n return ctype_lower($str);\n }", "function studly_case($value)\n {\n return Str::studly($value);\n }", "function studly_case($value)\n\t{\n\t\treturn Illuminate\\Support\\Str::studly($value);\n\t}", "public function lowerCaseFirst()\n {\n $first = UTF8::substr($this->str, 0, 1, $this->encoding);\n $rest = UTF8::substr(\n $this->str, 1, $this->length() - 1,\n $this->encoding\n );\n\n $str = UTF8::strtolower($first, $this->encoding) . $rest;\n\n return static::create($str, $this->encoding);\n }", "function lcfirst( $str ) {\n\t\t$str[0] = strtolower($str[0]);\n\t\treturn (string)$str;\n\t}", "function detect_any_lowercase($string){\r\n\treturn strtoupper($string) != $string;\r\n}", "public function lowercaseTags() {\n if ( empty( $this->cleanedXML ) ) {\n trigger_error( \"Output has not yet been cleaned\", E_USER_NOTICE );\n }\n\n $this->cleanedXML = preg_replace( \"<(\\/?)([^<>\\s]+)>/Ue\", \"'<'.'\\\\1'.lc('\\\\2').'>'\", $this->cleanedXML );\n $this->cleanedXML = preg_replace( \"<(\\/?)([^<>\\s]+)(\\s?[^<>]+)>/Ue\", \"'<'.'\\\\1'.lc('\\\\2').'\\\\3'.'>'\", $this->cleanedXML );\n\n return $this->cleanedXML;\n }" ]
[ "0.7638794", "0.7618862", "0.75051636", "0.73810834", "0.7244064", "0.7230835", "0.72223747", "0.71899253", "0.7079704", "0.70572776", "0.70481956", "0.70464975", "0.7028005", "0.6996523", "0.697005", "0.6951566", "0.69503766", "0.69244695", "0.6905487", "0.6888436", "0.6863449", "0.6862864", "0.68416226", "0.68401676", "0.683412", "0.6833309", "0.68242484", "0.6817382", "0.68101525", "0.67965823", "0.679578", "0.67921317", "0.67823696", "0.6773334", "0.67652273", "0.67487425", "0.674572", "0.6730611", "0.6726348", "0.67204", "0.66844225", "0.66674346", "0.6665624", "0.6663671", "0.6663535", "0.66591734", "0.6653771", "0.6646246", "0.6634425", "0.6619601", "0.660963", "0.66081196", "0.6601921", "0.659324", "0.658132", "0.65811926", "0.65744334", "0.65610504", "0.65568924", "0.6555603", "0.6547606", "0.6531366", "0.65313476", "0.65090495", "0.65056086", "0.6504743", "0.6502217", "0.64981747", "0.6489003", "0.648051", "0.64672166", "0.6465143", "0.64626205", "0.64613426", "0.64429224", "0.6441272", "0.6440228", "0.64326096", "0.6428748", "0.64285517", "0.6420597", "0.64194506", "0.6417551", "0.6416321", "0.6413175", "0.64121896", "0.6409253", "0.640186", "0.6398759", "0.6391929", "0.63911295", "0.63875574", "0.63826495", "0.6382409", "0.63810337", "0.63649845", "0.6363896", "0.63546365", "0.6353532", "0.63473874" ]
0.6456404
74
Calculate estimated work time.
public static function calculateEstimatedWorkTime(int $id, float $estimatedWorkTime = 0): float { $progressInHours = 0; foreach (static::getChildren($id) as $child) { $estimatedWorkTime += static::calculateEstimatedWorkTime($child['id']); } static::calculateProgressOfMilestones($id, $estimatedWorkTime, $progressInHours); return $estimatedWorkTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWorkEstimated()\n {\n return $this->work_estimated;\n }", "public function getWorkedTime() {\n if (!isset($this->workedTime)) {\n $start = new DateTime($this->start);\n $end = new DateTime($this->end);\n $break = new DateTime($this->break);\n\n $work = $start->diff($end)->format(\"%H:%i:%S\");\n $work = new DateTime($work);\n\n //for what ever reason we need to add the break to the work\n $work->add($break->diff(new DateTime(\"00:00:00\")));\n\n $this->workedTime = $work->format(\"H:i:s\");\n }\n\n return $this->workedTime;\n }", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }", "public function getExecutionTime()\n {\n return $this->took;\n }", "public function getWorktimeDifference() {\n // Get work time in millis\n $workedTime = new DateTime($this->getWorkedTime());\n $workedTime = $workedTime->getTimestamp();\n\n // Get exp work time in millis\n $exp = new DateTime($this->getExp());\n $exp = $exp->getTimestamp();\n\n // substract actual worked time from extected tme\n // $diff are seconds\n $diff = -($exp - $workedTime);\n\n // check if the difference is negative\n if ($diff < 0) {\n // if so, set the flag to \"-\"\n $flag = \"-\";\n }\n $diff = abs($diff);\n\n // work out hours and minutes\n $minutes = ($diff / (60)) % 60;\n $hours = ($diff / (60 * 60)) % 24;\n\n // prepare values for return\n $hours = $hours <= 9 \n ? $hours < 0 \n ? str_split($hours)[0] . \"0\" . str_split($hours)[1] \n : \"0$hours\" \n : $hours;\n\n $minutes = $minutes <= 9 \n ? \"0$minutes\" \n : $minutes;\n\n // return the hours (with sign), minutes an total seconds\n // hours / minutes for rendering in views\n // total seconds (with sign) for further calculation\n return [\n $hours,\n $minutes,\n $diff,\n \"print\" => \"$flag$hours:$minutes\",\n \"flag\" => $flag\n ];\n }", "public function getElapsedTime();", "function getEstimatedTime() {\n\t\t$i = $this->_query->join('synd_issue','i');\n\t\t$estimate = clone $this->_query;\n\t\t$logged = clone $this->_query;\n\n\t\t$estimate->where(\"$i.info_estimate IS NOT NULL\");\n\t\t$estimate->column($this->_grouping->getResolveByKey($this, $estimate), 'PK');\n\t\t$estimate->column(\"COUNT(DISTINCT $i.node_id)\", 'ISSUES');\n\t\t$estimate->column(\"SUM($i.info_estimate)*60\", 'TIME_ESTIMATE');\n\t\t$estimate->groupBy($this->_grouping->getResolveByKey($this, $estimate));\n\t\t\n\t\t$t = $logged->join('synd_issue_task', 't');\n\t\t$logged->where(\"$i.node_id = $t.parent_node_id\");\n\t\t$logged->where(\"$i.info_estimate IS NOT NULL\");\n\t\t$logged->column($this->_grouping->getResolveByKey($this, $logged), 'PK');\n\t\t$logged->column(\"SUM($t.info_duration)*60\", 'TIME_LOGGED');\n\t\t$logged->groupBy($this->_grouping->getResolveByKey($this, $logged));\n\n\t\t$sql = $estimate->toString();\n\t\t$rows = $this->_db->getAll($sql);\n\t\t\n\t\t$sql2 = $logged->toString();\n\t\t$time = $this->_db->getAssoc($sql2);\n\n\t\t$result = array();\n\t\tforeach ($rows as $row) {\n\t\t\t$result[$row['PK']] = $row;\n\t\t\t$result[$row['PK']]['TIME_LOGGED'] = isset($time[$row['PK']]) ? $time[$row['PK']] : null;\n\t\t}\n\t\t\t\n\t\treturn $this->_grouping->filter($result);\n\t}", "public function getTskWorkTime()\n {\n return $this->tsk_work_time;\n }", "public function execTime()\n {\n $packet = $this->getPacket();\n\n if(empty($packet['started'])) return 0;\n\n if (!isset($packet['finished']) || $packet['finished'] === 0) {\n throw new \\Exception('The job has not yet ran');\n }\n\n return $packet['finished'] - $packet['started'];\n }", "function computeFinalTime ()\n{\n\tglobal $startD, $stopD, $endD;\n\t\n\t$endD = $stopD[0] - $startD[0];\n\t$_SESSION['finishTime'] = $endD;\n}", "public function runtime()\n {\n return sprintf('%.5f', ($this->endTime-$this->startTime));\n }", "public function getExecutionTime() {}", "public function getTotalWork() {\n $hours_worked = 0;\n \n foreach($this->Work() as $work) {\n if($work->Hours)\n $hours_worked += $work->Hours;\n }\n \n return $hours_worked;\n }", "public function estimate(){\n\t\t$speed = $this->speed();\n\t\tif($speed === 0 || $this->elapsed() === 0)\n\t\t\treturn 0;\n\n\t\treturn round($this->total / $speed);\n\t}", "public function getExecutionTime()/*# : float */;", "public function getMaxWorkingTime(): float\n {\n return $this->usableTime * $this->capacity;\n }", "protected function getFinalTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->startTime;\n \n return $result;\n }", "public function get_exec_time()\n\t\t{\n\t\t\treturn $this->stop_time - $this->start_time;\n\t\t}", "public static function getTimeToRun();", "protected function getFinalTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->startTime;\n\n return $result;\n }", "protected function getElapsedTimeInMs()\n {\n return (microtime(true) - $this->start) * 1000;\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['commands'] as $command) {\n $time += $command['executionMS'];\n }\n\n return $time;\n }", "public function getExecutionTime() {\n return round((microtime(true) - $this->execution_start) * 1000, 0);\n }", "protected function getStepTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->latsStepTime;\n $this->latsStepTime = $currentTime;\n\n return $result;\n }", "public function getSpentTime() {\n\t\treturn $this->spentTime;\n\t}", "public function getTotalTime()\n {\n return 0; //@todo\n }", "protected function getExecTime()\n {\n return \\microtime(true) - $this->beginTime;\n }", "public function getRunningTime()\n\t{\n\t\treturn $this->microtime_float() - $this->start_time;\n\t}", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }", "public function runtime ()\n {\n return time() - $this->_start_time;\n }", "public function getExecTime(): float\n\t{\n\t\tif ( null === $this->start_time ) {\n\t\t\t$this->start_time = microtime( true );\n\t\t\treturn 0;\n\t\t}\n\t\treturn microtime( true ) - $this->start_time;\n\t}", "public function getRun()\n {\n return array_sum($this->_totalTime);\n }", "protected function getStepTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->latsStepTime;\n \n $this->latsStepTime = $currentTime;\n \n return $result;\n }", "protected function calculateExecutionTime(): array\n\t{\n\t\t$totalTime = microtime(true) - $this->application->getStartTime();\n\n\t\t$executionTime = ['total' => $totalTime, 'details' => []];\n\n\t\t$otherTime = 0;\n\n\t\tforeach($this->timers as $timer)\n\t\t{\n\t\t\t$otherTime += $timer instanceof Closure ? $timer() : $timer;\n\t\t}\n\n\t\t$detailedTime = $totalTime - $otherTime;\n\n\t\t$executionTime['details']['PHP'] = ['time' => $detailedTime, 'pct' => ($detailedTime / $totalTime * 100)];\n\n\t\tforeach($this->timers as $timer => $time)\n\t\t{\n\t\t\tif($time instanceof Closure)\n\t\t\t{\n\t\t\t\t$time = $time();\n\t\t\t}\n\n\t\t\t$executionTime['details'][$timer] = ['time' => $time, 'pct' => ($time / $totalTime * 100)];\n\t\t}\n\n\t\treturn $executionTime;\n\t}", "public function getTimeSpent()\n {\n return $this->timeSpent;\n }", "public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }", "protected static function _timeFromCakeToStopwatch(): float\n {\n return self::$_startupTime - TIME_START;\n }", "function get_execution_time() {\n\treturn microtime(true) - __CHV_TIME_EXECUTION_STARTS__;\n}", "public function setWorkEstimated($var)\n {\n GPBUtil::checkInt64($var);\n $this->work_estimated = $var;\n\n return $this;\n }", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public function getElapsed() {\n if ($this->hasStarted() && $this->hasStopped()) {\n return number_format($this->stoppedAt - $this->startedAt, 7);\n }\n throw new StopwatchException('Cannot get elapsed time, insufficient data');\n }", "public function getAccumulatedExecutionTime()\n {\n if ($this->accumulatedExecutionTime) {\n return $this->accumulatedExecutionTime;\n }\n return $this->getExecutionTime();\n\n }", "public function calculate_time(){\n\t\t\n\t\t$time_zone = new DateTimeZone('Asia/Colombo');\n\t\t\n\t\t$current_time = new DateTime(\"now\",$time_zone);\n\t\t$temp = $current_time->format(\"Y/m/28 06:00:00\");\n\n\t\t$end_time = new DateTime($temp,$time_zone);\n\t\n//\t\techo date_format($current_time,\"Y/m/d H:i:s\").\"<br>\";\n//\t\techo date_format($end_time,\"Y/m/d H:i:s\").\"<br>\";\n\n\t\t$file = 'timer.txt';\n\t\t\n\t\tif($end_time<$current_time){\n\n\t\t\tif($this->run_once_check($file)){\n\t\t\t\t//run the program\n\t\t\t}\n\t\t}\n\t\telseif(file_exists($file)){\n\t\t\t$this->delete_file($file);\n\t\t}\n\n\t}", "private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }", "public function calculateTime()\n {\n echo 'it takes 1h to get there.',\"\\n\";\n\n self::$traitStaticMember = 'changes conflict member\\'s initial value';\n }", "public function getTimePassed(): float\n {\n if ($this->started) {\n return microtime(true) - $this->start_time;\n } else {\n return $this->stop_time - $this->start_time;\n }\n }", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function getTurnaroundTime()\n\t{\n\t\t$startTime = new DateTime($this->specimen->time_accepted);\n\t\t$endTime = new DateTime($this->time_verified);\n\t\t$interval = $startTime->diff($endTime);\n\n\t\t$turnaroundTime = ($interval->days * 24 * 3600) + ($interval->h * 3600) + ($interval->i * 60) + ($interval->s);\n\n\t\t\n\t\treturn $turnaroundTime;\n\t}", "public function getTotalExecutionTime()\n {\n return $this->totalExecutionTime;\n }", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "public function getEstimatedTimeOfEnd(): ?int\n {\n $speed = $this->getSpeed();\n $remain = $this->getRemain();\n if (0 === $remain) {\n return time();\n }\n $minimumSpeed = self::MINIMUM_SPEED;\n if (abs($speed) < $minimumSpeed) {\n return null;\n }\n return $this->current + intval($remain / $speed);\n }", "public function getProcessingTime(): float\n {\n if (!$this->startedAt) {\n return 0;\n }\n\n $now = $this->clock->now()->getMillisTimestamp();\n $startAt = $this->startedAt->getMillisTimestamp();\n\n return ($now - $startAt) * 1000;\n }", "public function totalTimer() {\n return \"It took \" . $this->getTime() . \" seconds to run \" . $this->getName() . \" <br>\";\n }", "public function time() {\n return $this->info['total_time'];\n }", "protected function startTime()\n {\n return microtime(true);\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "public function getElapsedTime() {\n\t\treturn self::$elapsedTime;\n\t}", "function get_execution_time() {\n static $microtime_start = null;\n if($microtime_start === null)\n {\n $microtime_start = microtime(true);\n return 0.0;\n }\n return microtime(true) - $microtime_start;\n}", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "function etime($time_start){\n $time_end = microtime(true);\n $execution_time = ($time_end - $time_start);\n\n return number_format((float) $execution_time, 1);\n}", "public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }", "public function getTiming()\n {\n return $this->timing;\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "public function getTimeinforce()\n {\n return $this->timeinforce;\n }", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "public function get_timingAdvance(): int\n {\n return $this->_tad;\n }", "public function get_timingAdvance(): int\n {\n return $this->_tad;\n }", "public function getExecutionTime()\n {\n return $this->executionTime;\n }", "public function get_starttime()\n {\n }", "function process($name, $start, $end){\n $time = $end - $start;\n echo \"Task: \" . $name . \"\\t\\t Time: \" . $time . \"\\n\";\n}", "public function getWaitTime()\n\t{\n\t\t$createTime = new DateTime($this->time_created);\n\t\t$startTime = new DateTime($this->time_started);\n\t\t$interval = $createTime->diff($startTime);\n\n\t\t$waitTime = ($interval->days * 24 * 3600) + ($interval->h * 3600) + ($interval->i * 60) + ($interval->s);\n\t\treturn $waitTime;\n\t}", "public function get_total_time() {\n\t\t\treturn $this->total_time;\n\t\t}", "public function getRelativeTime() : float\n {\n return ($this->timeStamp - static::$startTime);\n \n }", "function get_working_plan($wr_plan){\r\n return get_times($wr_plan['start'],$wr_plan['ends']);\r\n }", "function time_taken($tally=0, $precision=5) {\n static $start = 0; // first call\n static $notch = 0; // tally calls\n static $time = 0; // set to time of each call (after setting $duration)\n $now = microtime(1);\n if (! $start) { // init, basically\n $time = $notch = $start = $now;\n return \"Starting at $start.\\n\";\n }\n $duration = $now - $time;\n $time = $now;\n $out = \"That took \".round($duration, $precision).\" seconds.\";\n if ($tally) { // time passed since last tally\n $since_start = $now - $start;\n $since_last_notch = $now - $notch;\n $notch = $now;\n $out .= \"<br>\\n\". round($since_start, $precision) .' seconds since start'.($since_start!=$since_last_notch ? ' ('.round($since_last_notch, $precision) .' since last sum).':'.');\n }\n return $out.\"\\n\";\n}", "public function getInvocationTiming()\n {\n return $this->invocation_timing;\n }", "public function getRawTime(): float\n {\n return $this->endTime - $this->startTime;\n }", "public function calculateSleepTime(): float\n {\n $holdTimeMS = $this->backoffFactor * 2 * $this->attempts;\n if ($holdTimeMS >= $this->backoffMax) {\n $holdTimeMS = $this->backoffMax;\n }\n\n return $holdTimeMS * 1000;\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function get_time_worked($name)\n\t\t{\n\t\t\t$result = $this->query(\"SELECT time FROM $this->table WHERE name = '$name' ORDER BY time, aid\");\n\t\t\t$times = Array();\n\t\t\t$time = 0;\n\n\t\t\twhile($r = mysqli_fetch_array($result))\n\t\t\t\t$times[] = $r['time'];\n\n\t\t\tif(!$times) return NULL;\n\n\t\t\t$size = sizeof($times) % 2 == 0 ? sizeof($times) : sizeof($times) - 1;\n\n\t\t\tfor($i = 0; $i < $size; $i += 2)\n\t\t\t\t$time += $this->time_delta($times[$i], $times[$i + 1]);\n\n\t\t\treturn $time;\n\t\t}", "public function getSavedTotalDuration() {\n\t\tif ( ! $this->filesystem->exists( '.executionTime' ) ) {\n\t\t\treturn 0.00;\n\t\t}\n\n\t\treturn file_get_contents( '.executionTime' );\n\t}", "public function calculate()\n {\n\n $yesterday = Carbon::now()->subDay();\n $seven_days_ago = $yesterday->copy()->subDay(7);\n $twenty_eight_days_ago = $yesterday->copy()->subDay(28);\n\n $this->seven_day_food = $this->site->foodExpenses($seven_days_ago->toDateString(), $yesterday->toDateString())\n / $this->site->foodSales($seven_days_ago->toDateString(), $yesterday->toDateString());\n $this->twenty_eight_day_food = $this->site->foodExpenses($twenty_eight_days_ago->toDateString(), $yesterday->toDateString())\n / $this->site->foodSales($twenty_eight_days_ago->toDateString(), $yesterday->toDateString());\n // etc...\n\n\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['views'] as $view) {\n $time += (float) $view['time'];\n }\n\n return $time;\n }", "public function getRunTime()\n {\n if(empty($this->_start_time) === true)\n {\n throw new \\LogicException('Unable to read runtime as command has not yet been executed.');\n }\n if(empty($this->_end_time) === false)\n {\n $end = $this->_end_time;\n }\n else\n {\n $end = time()+microtime();\n }\n \n return $end - $this->_start_time;\n }", "function elapsedSeconds() {\n if (null === $this->startMicrotime) {\n throw new InvalidArgumentException(\"Start time was not marked\");\n }\n if (null === $this->endMicrotime) {\n // Not stopped so return time from start to now\n return microtime(true) - $this->startMicrotime;\n }\n // Stopped so show total elapsed time between start and stop\n return $this->endMicrotime - $this->startMicrotime;\n }", "public function getTotalTime(){\n return $this->totalTime;\n }", "function elapsed_time($start_time, $finish_time){\n\treturn sc_strtotime($finish_time) - sc_strtotime($start_time);\n}", "public function getTotalRawTime()\n {\n return floatval(\n round($this->start->diffInMinutes($this->end) / 60, 5)\n );\n }", "public function getAnswerTime();", "public static function getExecutionTime() {\n\t\treturn (microtime(true) - $_SERVER[\"REQUEST_TIME\"]);\n\t}", "public function completedTime() {\n return intval($this['completed']);\n }", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "private function getRealFinishedTimestamp()\n {\n return RealCharger :: transactionInfo( $this -> charger_transaction_id ) -> transStop / 1000;\n }", "abstract public function getForecastTime();", "function GetExecutionTime($start) \r\n{\r\n\t//return sprintf('%1.6f', (microtime(true) - $start)) . ' sec';\r\n\treturn (microtime(true) - $start) . ' sec';\r\n}", "public function getTotalTimeAttribute()\n {\n return floatval($this->calculateTime());\n }" ]
[ "0.69083", "0.68906415", "0.68692595", "0.6798016", "0.6682655", "0.65193385", "0.64568835", "0.6439987", "0.6342504", "0.6326465", "0.62884706", "0.62709713", "0.6232144", "0.6189705", "0.61846775", "0.6144584", "0.61179185", "0.6063779", "0.60584486", "0.6020902", "0.59859425", "0.5965444", "0.5964643", "0.59529805", "0.59429544", "0.5936589", "0.59340507", "0.59221315", "0.59194976", "0.5913474", "0.58972687", "0.58628315", "0.5862327", "0.5861226", "0.5848504", "0.5847258", "0.58153784", "0.5771311", "0.57582027", "0.5725685", "0.57189196", "0.5714853", "0.5710072", "0.56982285", "0.5697649", "0.56949383", "0.5694787", "0.5672213", "0.5651355", "0.5615784", "0.559264", "0.55873054", "0.5567639", "0.55668753", "0.55510443", "0.5543712", "0.552255", "0.5520909", "0.5517841", "0.5515306", "0.5514051", "0.55006427", "0.54661554", "0.54627925", "0.545257", "0.54488856", "0.54333484", "0.541685", "0.54158777", "0.5376376", "0.5376376", "0.5373277", "0.53697526", "0.53667486", "0.5365699", "0.5360681", "0.53469336", "0.53445566", "0.5334984", "0.5331835", "0.53285396", "0.53284013", "0.5327548", "0.5324845", "0.5324614", "0.5306395", "0.529468", "0.52794546", "0.52774096", "0.52773696", "0.5277146", "0.5267103", "0.52653325", "0.5262748", "0.52489144", "0.5243123", "0.5242224", "0.5238662", "0.5235483", "0.520341" ]
0.6244584
12
Get children by parent ID.
protected static function getChildren(int $id): array { return (new \App\Db\Query()) ->select(['id' => 'vtiger_project.projectid', 'vtiger_project.progress']) ->from('vtiger_project') ->innerJoin('vtiger_crmentity', 'vtiger_project.projectid = vtiger_crmentity.crmid') ->where(['vtiger_crmentity.deleted' => [0, 2]]) ->andWhere(['vtiger_project.parentid' => $id])->all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function children($id);", "public function getChildren($id){\n return $this->getTable()->where($this->treeParentRow,$id);\n }", "public function getChildren($idParent) {\r\n\t\t$entities = $this->find('all', array(\r\n\t\t\t'conditions' => array(\r\n\t\t\t\t'Entity.parent_id' => $idParent,\r\n\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t),\r\n\t\t\t'order' => array('Entity.order' => 'ASC') \r\n\t\t\t)\r\n\t\t);\r\n\t\treturn $entities ;\r\n\t}", "public function findChildren($id_parent){\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.parent', $queryBuilder->createNamedParameter($id_parent))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.sys_language_uid', $queryBuilder->createNamedParameter($GLOBALS['TSFE']->sys_language_uid, \\PDO::PARAM_INT))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.deleted', $queryBuilder->createNamedParameter(0))\n )\n ->andWhere(\n $queryBuilder->expr()->eq('sys_category.hidden', $queryBuilder->createNamedParameter(0))\n )\n ->execute();\n $list_cat=[];\n while ($row = $statement->fetch()) {\n\n $list= array(\n 'uid' => $row['uid'],\n 'title' => $row['title'],\n 'parent' => $row['parent'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n );\n array_push($list_cat, $list);\n }\n\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_category');\n $statement = $queryBuilder\n ->select('sys_category.*')\n ->from('sys_category')\n \n ->where(\n $queryBuilder->expr()->eq('sys_category.uid', $queryBuilder->createNamedParameter($id_parent))\n )\n \n ->execute();\n while ($row = $statement->fetch()) {\n $list=array(\n 'uid' =>$row['uid'],\n 'title' =>$row['title'],\n 'icon' => $row['icon'],\n 'icong' => $row['icong'],\n 'children' => $list_cat);\n }\n return $list;\n }", "private function queryForChildrenOf($parentID)\n {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(Utility::dataTable);\n $queryResults = $queryBuilder->select('*')\n ->from(Utility::dataTable)\n ->where($queryBuilder->expr()->eq('parent', $queryBuilder->quote($parentID)))\n ->orderBy('notation', 'ASC')\n ->execute();\n\n return $queryResults;\n }", "function children($parent_id): ?array {\n $list = @$this->children[$parent_id];\n return $list ? array_keys($list) : [];\n }", "public static function getChildrenByParent($parent_id)\n {\n $query = CategoriesLevelOne::find()->select('id')->where([\"parent_category\"=>$parent_id])->all();\n foreach($query as $value)\n {\n $array[]=$value->id;\n }\n\n return $array;\n }", "function getChilds($id = NULL);", "function getDirectChildren($id) {\n\t\t\t$this->query(\"SELECT * FROM usecase WHERE parent={$id};\");\n\t\t\t$rs = $this->resultSet();\n\t\t\t$array = array();\n\t\t\tforeach($rs as $uc)\n\t\t\t\t$array[] = $uc;\n\t\t\treturn $array;\n\t\t}", "protected function getChildren($id)\n {\n return MenuLink::where('parent_id', '=', $id)->with('menu')->get();\n }", "public function myChildren()\n {\n return File::get()->filter(\"ParentID\", $this->ID);\n }", "public function children()\n {\n return $this->hasMany(self::class, 'parent_id', 'id');\n }", "public function findChildren()\n {\n return self::where('code_parrent',$this->id)->get();\n }", "public function getListByParentId($parent_id = 0) {\n return $this->where(['parent_id' => $parent_id])->select();\n }", "public function element_get_childs($id) {\n global $db;\n $child_nodes = $db->fetch_table(\"SELECT ID_KAT, KAT_TABLE FROM `\".$this->table.\"`\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$id.\" ORDER BY ORDER_FIELD\");\n $childs = array();\n foreach ($child_nodes as $index => $data) {\n $childs[] = $this->element_read($data[\"ID_KAT\"]);\n }\n return $childs;\n }", "public function element_get_childs_cached($id) {\n $childs = array();\n foreach ($this->cache_nodes as $id_kat => $data) {\n if ($data[\"PARENT\"] == $id) {\n $childs[] = $data;\n }\n }\n return $childs;\n }", "public function &getChildren($id)\n {\n return $this->elts[$id]['children'];\n }", "function get_child_pages($id = NULL) {\n\n\tif ( empty($id) ) {\n\t\t$id = get_the_ID();\n\t}\n\n\treturn new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t'post_parent'\t\t=> $id,\n\t\t\t'posts_per_page'\t=> -1\n\t\t)\n\t);\n\n}", "public function getChildren($parentID)\n {\n $tmp = [];\n foreach($this->categoryList as $key => $item){\n if($item->parentID == $parentID) {\n $tmp[] = $item;\n }\n }\n\n return $tmp;\n }", "public function childrens()\n {\n return $this->hasMany(self::class, 'parent_id');\n }", "public function getChildrenQuery();", "private function getChildrenIds(){\n if ($this->myChildrenType===null) $this->myChildrenIds = null;\n else $this->myChildrenIds = $this->_db->getChildrenIds($this->myId);\n }", "public function getParents($idParent = null){\r\n\t\tif ($idParent){\r\n\t\t\t$entities = $this->find('all', array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Entity.id' => $idParent,\r\n\t\t\t\t\t'Entity.parent_id' => 1,\r\n\t\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$entities = $this->find('all', array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Entity.parent_id' => 1,\r\n\t\t\t\t\t'Entity.active' => 1\r\n\t\t\t\t\t),\r\n\t\t\t\t'order' => array('Entity.order' => 'ASC') \r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $entities;\r\n\t}", "function _wswwpx_page_get_child_ids ( $parent = 0 ) {\n\tglobal $wpdb;\n\tif ( $parent > 0 ) {\n\t\t// Get the ID of the parent.\n\n\t\t$results = $wpdb->get_results(\"\n\t \t\t\t\t\t\t\tSELECT ID\n\t \t\t\t\t\t\t\t\t FROM $wpdb->posts\n\t \t\t\t\t\t\t\t\t WHERE post_parent = $parent\", ARRAY_N );\n \t\tif ($results) {\n\t\t\tforeach ($results AS $r) {\n\t\t\t \tforeach ($r AS $v) {\n\t\t\t \t\t$result[] = $v;\n\t\t\t \t}\n\t\t\t }\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t} else {\n\t\t// ... or set a zero result.\n\t\t$pages = get_pages();\n\t\tforeach ($pages AS $page) {\n\t\t\t$result[]=$page->ID;\n\t\t}\n//\t\t$result = 0;\n\t}\n\t//\n\treturn $result;\n}", "public function get_children();", "public function getChildrenForParent( $parent )\n {\n $children = array();\n\n foreach($this->table as $row)\n {\n if( $row['parent_id'] === $parent->getId() )\n {\n $children[] = new MeshTestObject($row['child_id']);\n }\n }\n\n return $children;\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id')->orderBy('name', 'asc');\n }", "function searchChildren($parentIds, $params) {\n $where = \" i.parent_id in (\".implode(',', $parentIds).\")\";\n return $this->_searchWithCurrentVersion($where, '', '', array(), $params);\n }", "public function getById($parentId);", "function getPageChildren($parentId)\n{\n return $GLOBALS['conn']->query(\"SELECT * FROM `subjects` WHERE parent='$parentId'\");\n}", "public function children(){\n return $this->hasMany(self::class, 'parent_id');\n }", "private function templateDivChildren($parent_id)\n\t{\n\t\t$stmt = $this->stmtTemplate();\n\t\t$stmt->bindValue(':site_id', $this->site_id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':template_id', $this->template_id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':parent_id', $parent_id, PDO::PARAM_INT);\n\t\t$stmt->execute();\n\n\t\t$result = $stmt->fetchAll();\n\n\t\t$children = array();\n\n\t\tif(count($result) > 0) {\n\t\t\tforeach($result as $row) {\n\t\t\t\t$div = array('id'=>$row['id'],\n\t\t\t\t\t'sizes'=>array('width'=>$row['width'],\n\t\t\t\t\t\t'height'=>$row['height'],\n\t\t\t\t\t\t'design_height'=>$row['design_height'],\n\t\t\t\t\t\t'fixed'=>$row['fixed']));\n\n\t\t\t\t$div['children'] = $this->templateDivChildren($row['id']);\n\n\t\t\t\t$children[] = $div;\n\t\t\t}\n\t\t}\n\n\t\treturn $children;\n\t}", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function getChildren()\n {\n return $this\n ->hasMany(MenuItem::class, ['menuId' => 'id'])\n ->andWhere(['is', 'parentId', null])\n ->orderBy(['order' => SORT_ASC]);\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id');\n }", "private function getChildrens($id){\n $query = \"\n SELECT\n `id`\n FROM\n `structure`\n WHERE\n `pid` = \".$id.\"\n \";\n $result = mysql_query($query);\n\n\n $array = array();\n\n while($row = mysql_fetch_assoc($result)){\n array_push($array, array(\n 'node' => $row,\n 'childrens' => $this->getChildrens($row['id'])\n )\n );\n }\n\n return $array;\n }", "public function get_child_ids($parent = 0)\n\t{\n\t\t// First we get all the categories and store it.\n\t\tif (empty($this->_all_cats))\n\t\t{\n\t\t\t$this->_ci->db->select('cat_id,cat_parent')\n\t\t\t\t\t\t->from('categories')\n\t\t\t\t\t\t->where('cat_display', 'yes');\n\t\t\t$query = $this->_ci->db->get();\n\n\t\t\tif ($query->num_rows() == 0) \n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t} \n\n\t\t\t$this->_all_cats = $query->result_array();\n\t\t}\n\t\t\n\t\tforeach ($this->_all_cats as $row)\n\t\t{\n\t\t\t// This assigns all the fields to the array.\n\t\t\tforeach ($row AS $key => $val)\n\t\t\t{\n\t\t\t\t$arr[$key] = $val;\n\t\t\t}\n\t\t\t\n\t\t\t$menu_array[$row['cat_id']] = $arr;\n\t\t}\n\t\t\n\t\tunset($arr);\n\t\t\n\t\tforeach($menu_array as $key => $val)\n\t\t{\n\t\t\t// Now add any children.\n\t\t\tif ($parent == $val['cat_parent'] OR $parent == $val['cat_id'])\n\t\t\t{\n\t\t\t\t$depth = 0;\n\t\t\t\tif ( ! in_array($val['cat_id'], $this->_cat_ids, TRUE)) \n\t\t\t\t{\n\t\t\t\t\t$this->_cat_ids = array_merge(array($val['cat_id']),$this->_cat_ids);\n\t\t\t\t\t$this->_child_subtree($key, $menu_array, $depth);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function getListFromParent($parentId, $order = \"\")\n {\n if ($parentId > 0 && !empty($this->parentAttrib)) {\n $sql = \"select * from \" . $this->table;\n /*\n * Preparation du where\n */\n if (strlen(preg_replace(\"#[^A-Z]+#\", \"\", $this->parentAttrib)) > 0) {\n $cle = $this->quoteIdentifier . $this->parentAttrib . $this->quoteIdentifier;\n } else {\n $cle = $this->parentAttrib;\n }\n $sql .= \" where \" . $cle . \" = :parentId\";\n $data[\"parentId\"] = $parentId;\n if (strlen($order) > 0) {\n $sql .= \" order by :order\";\n $data[\"order\"] = $order;\n }\n return $this->getListeParamAsPrepared($sql, $data);\n } else {\n return null;\n }\n }", "public function findChildNodes($parentId)\n {\n return $this->findNodes($parentId);\n }", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "public function getChildrenByParent($parent, $offline=false) {\n\t\t\tglobal $db;\n\t\t\t$query = \"SELECT guid, title FROM pages WHERE parent = '$parent' \";\n\t\t\tif (!$offline) $query.=\"AND offline=0\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\treturn $db->get_results($query);\n\t\t}", "public function children()\n {\n return $this->hasMany(Post::class, 'parent_id');\n }", "public function children()\n {\n return $this->hasMany(Category::class, 'parent_id', 'id');\n }", "public function readChildAction()\r\n {\r\n $filterJson = $this->params()->fromQuery('filter');\r\n if (isset($filterJson)) {\r\n $filters = Json::decode($filterJson, Json::TYPE_ARRAY);\r\n } else {\r\n $filters = null;\r\n }\r\n $sortJson = $this->params()->fromQuery('sort');\r\n if (isset($sortJson)) {\r\n $sort = Json::decode($sortJson, Json::TYPE_ARRAY);\r\n } else {\r\n $sort = null;\r\n }\r\n $parentId = $this->params()->fromQuery('node', 'root');\r\n $mongoFilters = $this->_buildFilter($filters);\r\n $dataValues = $this->_dataService->readChild($parentId, $mongoFilters, $sort, false);\r\n $response = array();\r\n $response['children'] = array_values($dataValues);\r\n $response['total'] = count($response['children']);\r\n $response['success'] = TRUE;\r\n $response['message'] = 'OK';\r\n return $this->_returnJson($response);\r\n }", "private function getChildrens($parentId, $roleId){\r\n\t\t$module = new Table_Modules();\r\n\t\t$acl = new Table_Acl();\r\n\t\t$childrens = $module -> selectModules( $where = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"parent_id\" => array( \"=\" => $parentId ), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"display_order\" => array (\">\" => 0)\r\n\t\t\t\t\t\t\t\t\t\t\t\t \t), $order = \"display_order\"\r\n\t\t\t\t\t\t\t\t\t\t\t);\t\t\r\n\t\t$json = '['; $i=0; // json start\r\n\t\tforeach($childrens as $child){ // browse the childrens one by one\r\n\t\t\tif($acl->hasAccess($roleId, $child->id, \"read\")){ //$acl->hasAccess($roleId, $child->id, \"read\")\r\n\t\t\t\t$i++;\r\n\t\t\t\t// generating json\r\n\t\t\t\t//if this is not the first row, add a comma\r\n\t\t\t\t$json .= ( $i>1 )?\",\":\"\";\t\r\n\t\t\t\t$json .= '{\"title\": \"'.$child->{'name_'.$_SESSION['lang']['selected']}.'\", \"key\": \"'.$child->id.'\" , \"form\": \"'.$child->form_name.'\"';\r\n\t\t\t\t//count the number of childrens for this child\r\n\t\t\t\t$hasChilds = $module->selectModules($where = array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"parent_id\" => array(\"=\" => $child->id)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\t\t\r\n\t\t\t\t//if there are any childrens, make a recoursive call\r\n\t\t\t\tif( $hasChilds->count() ){\r\n\t\t\t\t\t$json .= ', \"isFolder\": true, ';\r\n\t\t\t\t\t$json .= '\"children\":'. $this->getChildrens($child->id, $roleId);\r\n\t\t\t\t}\r\n\t\t\t\t$json .= '}';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$json .= ']'; // json end\r\n\t\t\r\n\t\treturn $json;\r\n\t}", "function get_children($id)\n\t{\n\t\trequire_lang('catalogues');\n\t\trequire_code('catalogues');\n\t\trequire_code('catalogues2');\n\n\t\t$child=1;\n\n\t\t// If the node is not a root node then get the name of the node\n\t\t$name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>intval($id)));\n\n\t\t$pagelinks=get_catalogue_entries_tree($name,NULL,NULL,NULL,NULL,NULL,false);\n\n\t\tif(count($pagelinks)>0)\n\t\t{\n\t\t\tfor($i=0;$i<count($pagelinks);$i++)\n\t\t\t{\n\t\t\t\tif($pagelinks[$i]['id']==$id)\n\t\t\t\t{\n\t\t\t\t\t$child=$pagelinks[$i]['child_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $child;\n\t}", "public function GetChildren($data,$id,$level=1){\n $children=array();\n foreach($data as $item){\n if($item->parent_id==$id){\n $item->larevel=$level;\n $children[]=$item;\n $children=array_merge($children,$this->GetChildren($data,$item->id,$level+1));\n\n }\n\n }\n return $children;\n }", "private static function getParentChildren():array\n {\n $parentChildren = [];\n $categories = self::select('*')->get()->toArray();\n\n foreach ($categories as $id){\n $children = [];\n foreach ($categories as $row){\n if ($id['id'] == $row['parent_id']){\n $children[] = $row['id'];\n }\n }\n $parentChildren[$id['id']] = $children;\n }\n\n return $parentChildren;\n\n }", "private function get_children($parent, $level = 0) {\r\n \t\t$pages = ORM::factory('page')->where('parent_id', $parent)->orderby('display_order','asc')->find_all();\r\n\r\n \t\t// display each child\r\n \t\tforeach ($pages as $page) {\r\n \t\t// indent and display the title of this child\r\n \t\t$this->page_array[] = array($page,$level);\r\n \t\t$this->get_children($page->id, $level+1); \r\n \t\t}\r\n\t}", "public function getChildLocations($parent_id = 0) {\r\n\r\n $query = \"SELECT jn_location_id, jn_location_name, ? AS jn_parent_id FROM jn_locations WHERE jn_parent_id = ? ORDER BY jn_location_name\";\r\n\r\n if ($this->db instanceof \\sql_db) {\r\n if ($stmt = $this->db->prepare($query)) {\r\n $stmt->bind_param(\"ii\", $parent_id, $parent_id);\r\n\r\n $stmt->execute();\r\n\r\n $stmt->bind_result($jn_location_id, $jn_location_name);\r\n\r\n $return = array();\r\n\r\n while ($stmt->fetch()) {\r\n $row = array();\r\n\r\n $row['jn_location_name'] = $jn_location_name;\r\n $row['jn_parent_id'] = $parent_id;\r\n $row['jn_location_id'] = $jn_location_id;\r\n\r\n $return[] = $row;\r\n }\r\n\r\n return $return;\r\n } else {\r\n throw new Exception($this->db->error . \"\\n\\n\" . $query);\r\n }\r\n } else {\r\n return $this->db->fetchAll($query, array($parent_id, $parent_id));\r\n }\r\n }", "function getParentIDs( $id = false, $ids = false )\n\t{\n\t\tif ( !$id )\n\t\t\treturn false;\n\t\t\t\n\t\tif ( $parent_id = $this -> getOne('Parent_ID', \"`ID` = '{$id}'\", 'categories') )\n\t\t{\n\t\t\t$ids[] = $parent_id;\n\t\t\treturn $this -> getParentIDs($parent_id, $ids);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $ids;\n\t\t}\n\t}", "public function children()\n {\n return $this->hasMany('App\\Models\\Category', 'parent_id', 'id');\n }", "public function getChilds();", "public function getChildNodesById()\n {\n if (! $this->_allChildrenKnown) {\n $this->loadChildNodes();\n }\n return $this->_childNodesById;\n }", "public function children()\n {\n return $this->hasMany(Chart::class, 'parent_id', 'id');\n }", "public function get_child($child_id)\n {\n }", "function children_of_parent_page($parent_title){\n $my_wp_query = new WP_Query();\n $all_wp_pages = $my_wp_query->query(array('post_type' => 'page', 'order' => 'ASC', 'orderby' => 'menu_order', 'posts_per_page' => -1));\n $parent_page = get_page_by_title($parent_title);\n $page_children = get_page_children($parent_page->ID, $all_wp_pages);\n return $page_children; //outputs an array of child page objects\n}", "function GetObjectList($parent) {\r\n $ids = IPS_GetChildrenIDs($parent);\r\n foreach($ids as $id)\r\n {\r\n $ids = array_merge($ids, GetObjectList($id));\r\n }\r\n return $ids;\r\n}", "public function findChild(array $comments, $parent_id)\n {\n $selected_comments = array();\n \n Foreach ($comments as $comment)\n {\n if ($parent_id == $comment->getParent())\n { \n $selected_comments[] = $comment;\n } \n }\n return $selected_comments;\n \n }", "public function childs() {\n return $this->hasMany(Worker::class,'parent_id','id') ;\n }", "public function childs(){\n return $this->hasMany('App\\Item', 'parent_id');\n }", "function children($options = null) {\n\t\t\n\t\t$defaults = array(\n\t\t\t'sort' => 'prio',\n\t\t\t'sortDirection' => 'desc',\n\t\t\t'limitStart' => 0,\n\t\t\t'limitCount' => null,\n\t\t\t'includeUnpublished' => false,\n\t\t\t'tagsMustInclude' => null, // comma seperated?\n\t\t\t'tagsMustNotInclude' => null\n\t\t);\n\t\t\n\t\t$options = polarbear_extend($defaults, $options);\n\t\tif ($options['limitCount'] === null) {\n\t\t\t// To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter.\n\t\t\t$limitCount = 2147483647;\n\t\t} else {\n\t\t\t$limitCount = $options['limitCount'];\n\t\t}\n\n\t\t// done with options, check cache\n\t\t$optionsQuery = http_build_query($options);\n\t\tif (isset($this->childrenCache[$optionsQuery])) {\n\t\t\treturn $this->childrenCache[$optionsQuery];\n\t\t}\n\n\t\t// not in cache, go on and query\n\t\t$sql = \"SELECT id FROM \" . POLARBEAR_DB_PREFIX . \"_articles \";\n\t\t$sql .= \"WHERE (parentID = '$this->id' AND status <> 'deleted' AND status <> 'revision' ) \";\n\t\t\n\t\tif ($options[\"includeUnpublished\"]) {\n\t\t\t// include unpublished articles\n\t\t} else {\n\t\t\t// don't include unpublished, remove'em\n\t\t\t$sql .= \" AND status = 'published' AND datePublish < now() AND (dateUnpublish > now() OR dateUnpublish IS NULL) \";\n\t\t}\n\t\t\n\t\t// tags\n\t\tif ($options[\"tagsMustInclude\"]) {\n\t\t\t$tagsMustInclude = explode(\",\", $options[\"tagsMustInclude\"]);\n\t\t\t$strTagArticleIds = \"\";\n\t\t\tforeach($tagsMustInclude as $oneTagID) {\n\t\t\t\t$oneTag = polarbear_tag::getInstance($oneTagID);\n\t\t\t\t// fetch articles for this tag\n\t\t\t\t$tagArticles = $oneTag->articles();\n\t\t\t\tforeach ($tagArticles as $oneA) {\n\t\t\t\t\t$strTagArticleIds .= $oneA->getId() . \",\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$strTagArticleIds = preg_replace(\"/,$/\", \"\", $strTagArticleIds);\n\t\t\tif (!empty($strTagArticleIds)) {\n\t\t\t\t$strTagArticleIds = \" AND id IN ($strTagArticleIds) \";\n\t\t\t}\n\t\t\t$sql .= $strTagArticleIds;\n\t\t}\n\t\t\n\t\t$sql .= \"ORDER BY $options[sort] $options[sortDirection] \";\n\t\t$sql .= \"LIMIT $options[limitStart], $limitCount\";\n\t\t// children = all articles that have current article as parentID\n\t\tglobal $polarbear_db;\n\t\t$childrenArr = array();\n\t\tif ($r = $polarbear_db->get_results($sql)) {\n\n\t\t\t$preloader = pb_query_preloader::getInstance();\n\t\t\t$strArticleIDs = \"\";\n\t\t\tforeach ($r as $row) {\t\t\n\t\t\t\t// in med hittade id:n i preloadern\n\t\t\t\t$strArticleIDs .= \",\".$row->id;\n\t\t\t}\n\t\t\t$preloader->addArticle($strArticleIDs);\n\t\t\t$preloader->update();\n\n\t\t\tforeach ($r as $row) {\t\t\n\t\t\t\t$childrenArr[] = PolarBear_Article::getInstance($row->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tpb_pqp_log_speed(\"article children()\");\n\t\t\n\t\t$this->childrenCache[$optionsQuery] = $childrenArr;\n\t\treturn $this->childrenCache[$optionsQuery];\n\t}", "public function actionImmediateChilds($id) {\n $user = CylTables::model()->findAllByAttributes(['parent_item' => $id]);\n\n $childs=array();\n if($user) {\n foreach ($user as $val){\n $Html = [\n 'name' => $val->table_name\n ];\n array_push($childs,$val);\n }\n }\n return $childs;\n }", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "function get_child_pages_by_parent_title($pageId,$limit)\n{\n // needed to use $post\n global $post;\n // used to store the result\n $pages = array();\n\n // What to select\n $args = array(\n 'post_type' => 'page',\n 'post_parent' => $pageId,\n 'posts_per_page' => $limit\n );\n $the_query = new WP_Query( $args );\n\n while ( $the_query->have_posts() ) {\n $the_query->the_post();\n $pages[] = $post;\n }\n wp_reset_postdata();\n return $pages;\n}", "function & getChilds() {\r\n // Load the data\r\n if (empty ($this->_childs)) {\r\n $database = $this->_db;\r\n /* retrieve values */\r\n $query = 'SELECT * FROM #__custom_properties_values' . ' WHERE parent_id = ' . $this->_id . ' ORDER BY ordering ';\r\n\r\n $database->setQuery($query);\r\n $this->_childs = $database->loadObjectList();\r\n }\r\n return $this->_childs;\r\n }", "function tagsSelectedChildren($parentID) {\n\t\t$arr = array();\n\t\t$arrTags = $this->tags();\n\t\tforeach ($arrTags as $oneTag) {\n\t\t\tif ($oneTag->parentID==$parentID) {\n\t\t\t\t$arr[] = $oneTag;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}", "public function findAllByParent($parent)\n {\n }", "public static function getChildJobs($id) {\n $criteria = new CDbCriteria();\n $criteria->condition = 't.id = :id or t.id in (select project_job_id from project_job_parents where parent_id = :id)';\n $criteria->params = array(':id' => $id);\n return PRMProjectJob::model()->findAll($criteria);\n }", "public function get_inner_pages($parent_id){\n\n\t\t\t\t$selectissue=\"SELECT * FROM `pages` WHERE `page_parent_id`='$parent_id'\";\n\t\t\t\t$issueresult = mysqli_query($this->db,$selectissue) or die(mysqli_connect_errno().\"Data cannot inserted\");\n \t\treturn $issueresult;\n\t\t}", "public function retrieveParents($id, QBankCachePolicy $cachePolicy = null) {\n\t\t$folderParent = array();\n\t\tforeach ($this->get('v1/folders/' . $id . '/parents', [], $cachePolicy) as $item ) {\n\t\t\t$folderParent[] = new FolderParent($item);\n\t\t}\n\n\t\treturn $folderParent;\n\t}", "function getChildrenForCat($catId) {\r\n $sql = \"SELECT * FROM categories WHERE parent_id = '{$catId}'\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function children() {\n\t\treturn $this->hasMany(Forum::getSectionClass(), \"parent_id\")->orderBy(\"weight\", \"desc\");\n\t}", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function children()\n {\n return $this->hasMany(File::class, 'folder_id', 'id');\n }", "public function getByParentId($parentId, $language = false, $noTranslation = false, $limit = false){\n if(empty($parentId)){\n return array();\n }\n return $this->getAll($language,$noTranslation,$limit,$parentId);\n }", "static function get_childCareerGoals($parent) {\r\n global $db;\r\n \r\n $parent = $db->escape_string($parent);\r\n \r\n $query = \"SELECT CareerGoal_id, Name FROM `careergoal` WHERE Parent = ?\";\r\n \r\n $statement = $db->prepare($query);\r\n\t\t\r\n\t\tif ($statement == FALSE) {\r\n\t\t\tdisplay_db_error($db->error);\r\n\t\t}\r\n \r\n $statement->bind_param(\"s\", $parent);\r\n \r\n $statement->execute();\r\n \r\n $result = $statement->get_result();\r\n \r\n if ($result == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $careerGoals = array();\r\n \r\n while ($row = $result->fetch_assoc()) {\r\n $careerGoals[] = array($row['CareerGoal_id'], $row['Name']);\r\n }\r\n \r\n $statement->close();\r\n \r\n return $careerGoals;\r\n }", "public function getChildren($categoryID, $type=''){\n\t\t$this -> db -> select('*');\n\t\t$where = array(\n\t\t\t'fid' => intval($cateogryID),\n\t\t\t'type' => $type,\n\t\t\t);\n\t\t$this -> db -> where($categoryID);\n\t\t$this -> db -> order_by('sort');\n\t\treturn $this -> db -> get($this -> tableName) -> result_array();\n\t}", "public function getChildProducts(Product $parent);", "public function ChildFolders()\n {\n return Folder::get()->filter('ParentID', $this->ID);\n }", "public function getChild()\n {\n return $this->hasMany(Pages::className(), ['parent_id' => 'id']);\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "public function children()\n {\n return $this->hasMany('App\\Model\\Products\\Category', 'parent_id');\n }", "public function children()\n {\n return $this->hasMany('App\\Models\\Child');\n }", "private function child_by_name(?int $parent_id, string $name, bool $throw=true): ?array {\n $t = $this->replica->state->tree;\n foreach($t->children($parent_id) as $child_id) {\n $node = $t->find($child_id);\n if($node && $node->meta->name == $name) {\n return [$child_id, $node];\n }\n }\n if($throw) {\n throw new Exception(\"Not found: $name\");\n }\n return null;\n }", "function forum_get_child_posts_fast($parent, $forum_id) {\n global $CFG;\n \n $query = \"\n SELECT \n p.id, \n p.subject, \n p.discussion, \n p.message, \n p.created, \n {$forum_id} AS forum,\n p.userid,\n d.groupid,\n u.firstname, \n u.lastname\n FROM \n {$CFG->prefix}forum_discussions d\n JOIN \n {$CFG->prefix}forum_posts p \n ON \n p.discussion = d.id\n JOIN \n {$CFG->prefix}user u \n ON \n p.userid = u.id\n WHERE \n p.parent = '{$parent}'\n ORDER BY \n p.created ASC\n \";\n return get_records_sql($query);\n}", "protected function getChildren()\n\t{\n\t\t$listing = $this->modelListing->getListing($this->size, $this->offset);\n\t\treturn $listing;\n\t}", "public function descendants($id);", "private function parents() {\n return array_map(array($this, 'page_info_from_id'), $this->parent_ids());\n }", "public function getChildrenConditions(int $parentId): iterable\n {\n return $this->model->getChildrenConditions($parentId);\n }", "public function GetParents($id, $data)\n {\n $tree = [];\n while ($id != 0) {\n foreach ($data as $v) {\n if ($v->id == $id) {\n $tree[] = $v;\n $id = $v->parent_id;\n break;\n }\n\n }\n }\n return $tree;\n }", "public function getParents() {}", "public function childrenOf(int $roleId): Collection;", "function &sql_fetch_children( $inQueryString, $rootNode, $idField = \"id\", $parentField = \"parent\") {\n\tsql_connect();\n\tglobal $defaultdb;\n\t$return = $defaultdb->fetch_children($inQueryString,$rootNode,$idField,$parentField);\n\treturn $return;\n}", "public function getByParentMemberId($parentMemberId){\r\n\t\treturn $this->_backend->getMultipleByProperty($parentMemberId, 'parent_member_id');\r\n\t}", "public static function getChildIds($node_id = 0)\n {\n return self::findOne($node_id)->children()->column();\n }", "function listChildrenPosts($id) {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT post_id, post_type, post_date, user_id, post_rating, post_text FROM Posts INNER JOIN ChildrenPosts ON ChildrenPosts.child_post_id = Posts.post_id WHERE father_post_id='\".mysqli_real_escape_string($conn,$id). \"' ORDER BY Posts.post_rating DESC\";\n\n\tif($id == \"null\") {\n\t\t$dbQuery = \"SELECT post_id, post_type, post_date, user_id, post_rating, post_text FROM Posts INNER JOIN ChildrenPosts ON ChildrenPosts.child_post_id = Posts.post_id WHERE father_post_id is null ORDER BY Posts.post_rating DESC\";\n\t}\n\t$result = $conn->query($dbQuery);\n\n\t// filling up the listing array\n\t$listing = array();\n\t$i = 0;\n\t$row = $result->fetch_array();\n while($row) {\n \t$listing[$i] = $row;\n \t$i++;\n \t$row = $result->fetch_array();\n }\n\n //closing the connection\n $conn->close();\n\n return $listing;\n}", "function & get_children($id, $add_sql = array())\r\n\t{\r\n\t\tif (!($parent = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\tif (!$parent || $parent['l'] == ($parent['r'] - 1))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t} \r\n\r\n\t\t$sql = sprintf('SELECT %s %s FROM %s %s\r\n WHERE %s.root_id=%s AND %s.level=%s+1 AND %s.l BETWEEN %s AND %s %s\r\n ORDER BY %s.%s ASC',\r\n\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(), \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $parent['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $parent['level'],\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $parent['l'], $parent['r'],\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this->_secondary_sort);\r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn $node_set;\r\n\t}" ]
[ "0.7717559", "0.74496675", "0.74465317", "0.7242641", "0.7186008", "0.7104887", "0.7023389", "0.7001036", "0.689334", "0.68109775", "0.68098044", "0.6789401", "0.6751281", "0.67488575", "0.6703984", "0.6650695", "0.6639337", "0.6637062", "0.66153586", "0.6595408", "0.65929997", "0.65739757", "0.65729755", "0.6568245", "0.6553368", "0.6545722", "0.653595", "0.6535022", "0.6496791", "0.6472158", "0.6402401", "0.63881105", "0.6374891", "0.636455", "0.6351568", "0.6351568", "0.63119286", "0.63105404", "0.63091207", "0.627237", "0.62663895", "0.62634003", "0.62591016", "0.6256595", "0.6249412", "0.6219524", "0.61967796", "0.61918443", "0.6188796", "0.6171997", "0.6165986", "0.61607665", "0.6146627", "0.6142155", "0.6127946", "0.6118499", "0.6082315", "0.6069823", "0.6069245", "0.6060164", "0.60550857", "0.60525274", "0.6049425", "0.6044227", "0.6034022", "0.6025891", "0.60219467", "0.6019213", "0.60187346", "0.60076326", "0.59944785", "0.59911823", "0.59797835", "0.5979088", "0.5975309", "0.5963035", "0.5959031", "0.5957373", "0.5956706", "0.5950448", "0.5940957", "0.5931145", "0.5926147", "0.5921109", "0.59134215", "0.5909672", "0.5909468", "0.5905752", "0.5901787", "0.5891193", "0.5885964", "0.5881188", "0.58779913", "0.58756214", "0.58685297", "0.586492", "0.586437", "0.585995", "0.58574325", "0.58522063" ]
0.67333883
14
Calculate the progress of milestones.
protected static function calculateProgressOfMilestones(int $id, float &$estimatedWorkTime, float &$progressInHours) { $dataReader = (new \App\Db\Query()) ->select([ 'id' => 'vtiger_projectmilestone.projectmilestoneid', 'projectmilestonename' => 'vtiger_projectmilestone.projectmilestonename', 'projectmilestone_progress' => 'vtiger_projectmilestone.projectmilestone_progress', ]) ->from('vtiger_projectmilestone') ->innerJoin('vtiger_crmentity', 'vtiger_projectmilestone.projectmilestoneid = vtiger_crmentity.crmid') ->where(['vtiger_crmentity.deleted' => [0, 2]]) ->andWhere(['vtiger_projectmilestone.projectid' => $id]) ->andWhere(['or', ['vtiger_projectmilestone.parentid' => 0], ['vtiger_projectmilestone.parentid' => null]]) ->createCommand()->query(); while ($row = $dataReader->read()) { $milestoneEstimatedWorkTime = ProjectMilestone_Module_Model::calculateEstimatedWorkTime($row['id']); $estimatedWorkTime += $milestoneEstimatedWorkTime; $progressInHours += ($milestoneEstimatedWorkTime * (float) $row['projectmilestone_progress']) / 100; } $dataReader->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMilestones()\n\t{\n\t\tif ($this->milestones == null) {\n\t\t\t$this->milestones = $this->getProjects(false, 1);\n\t\t}\n\n\t\treturn $this->milestones;\n\t}", "public function moduleProgress() {\n\n\t\t// Gather database data\n\t\t$sections = Section::all();\n\t\t$secProg = SectionProgress::where('user_id', $this->id)->get();\n\n\t\t// init array with correct number of sections\n\t\t// progress array is an array of arrays:\n\t\t// [{Total Number of sections in Mod1, # sections completed in Mod1},\n\t\t// {Total number of sections in Mod2, # sections completed in Mod2, ... }]\n\t\t$progArray = array();\n\t\tforeach($sections as $section) {\n\n\t\t\t// check if module already exists, if not add it\n\t\t\tif (!array_key_exists($section->module_id,$progArray)) {\n\t\t\t\t$progArray[$section->module_id] = array(0, 0, 0);\n\t\t\t}\n\n\t\t\t// increment section count\n\t\t\t$progArray[$section->module_id][0]++;\n\t\t}\n\n\t\t// add section values to array\n\t\tforeach($secProg as $prog) {\n\n\t\t\t// get module progress belongs to\n\t\t\t$parent_module = 0;\n\t\t\tforeach($sections as $section) {\n\t\t\t\tif ($section->id == $prog->section_id) {\n\t\t\t\t\t$parent_module = $section->module_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// increment the counter representing a completed section\n\t\t\tif ($prog->status > 0) {\n\t\t\t\t$progArray[$parent_module][1] += $prog->correct;\n\t\t\t\t$progArray[$parent_module][2]++;\n\t\t\t}\n\t\t}\n\n\t\t// iterate through progress array, calculate % complete\n\t\t$modulePercent = array();\n\t\t$modulePercent[0] = ''; // null first value, so indexing for mod progress starts at 1\n\t\tforeach($progArray as $mod) {\n\t\t\t$modulePercent[] = array(($mod[1]) / ($mod[0]), ($mod[2]) / ($mod[0]));\n\t\t}\n\n\t\treturn $modulePercent;\n\t}", "public function projectProgress($projectId)\n {\n $taskQuery = new Query();\n $taskQuery->select('id')\n ->from('tomtask')\n ->where('tomtask.project_id=:projectId', array(':projectId' => $projectId));\n\n $taskIds = $taskQuery->all();\n foreach ($taskIds as $taskId) {\n $this->taskPercentage(intval($taskId[\"id\"]));\n }\n $allTasks = $taskQuery->count();\n\n $completedTasks = new Query();\n $completedTasks->select('completed')\n ->from('tomtask')\n ->where('tomtask.project_id=:projectId AND tomtask.completed=1', array(':projectId' => $projectId));\n $countCompletedTasks = $completedTasks->count();\n\n $percentage = floor(($countCompletedTasks / $allTasks) * 100);\n $this->updateProjectProgress($projectId, $percentage);\n $duration = $this->getDuration($projectId);\n\n $percentageDurationPerProjectId = array($percentage, $duration);\n\n return $percentageDurationPerProjectId;\n }", "public function getProgress();", "function getGameProgression()\n {\n // With the mini game number we divide the game in 3 thirds (0-33,\n // 33-66, 66-100%), and looking at the player discs we can further\n // divide each third: each disc on an agentarea counts as a 1/9th\n // solved case; each disc on a locslot as a 1/3rd solve case. We\n // average that over the player count, and thus get the in-minigame\n // progress.\n $base = (self::getGameStateValue(\"minigame\") - 1) * (100 / $this->constants['MINIGAMES']);\n $base = max(0, $base);\n $discs_on_agentarea = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'agentarea_%'));\n $discs_on_locslot = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'locslot_%'));\n $perc_cases_solved = 0;\n $perc_cases_solved += $discs_on_agentarea * (1/9);\n $perc_cases_solved += $discs_on_locslot * (1/3);\n $minigame_progress = $perc_cases_solved / self::getPlayersNumber();\n $progress = $base + ($minigame_progress * 33);\n return floor($progress);\n }", "public function progress()\n {\n return $this->totalsportevents > 0 ? round(($this->processedsportevents() / $this->totalsportevents) * 100) : 0;\n }", "public function test_it_can_tell_us_how_many_milestones_are_completed()\n {\n $milestones = factory(ProjectMilestone::class, 2)->create([\n 'project_id' => $this->project->id,\n 'user_id' => $this->user->id\n ]);\n // and completed milestones\n $completedMilestones = factory(ProjectMilestone::class, 2)->create([\n 'project_id' => $this->project->id,\n 'user_id' => $this->user->id,\n 'completed_at' => now()\n ]);\n\n // The project should be able to tell us how many completed milestones there are\n\n $this->assertSame($this->project->completed_milestones, 2);\n }", "public function getProgress()\n\t{\n\t\treturn 0;\n\t}", "function getProgress() ;", "protected function getProgressAttribute()\n {\n $startdate = Carbon::parse($this->listed_at);\n $enddate = Carbon::parse($this->expired_at);\n $now = Carbon::now();\n\n if($now >= $enddate) {\n return 100;\n }\n\n return number_format(($startdate->diffInDays($now) / $startdate->diffInDays($enddate)) * 100, 0);\n }", "private function computeProgressPercent($progress)\n {\n $needsADay = $this->requiredMoney / 20; // ~number of working days\n\n return $progress / $needsADay;\n }", "function Product_get_milestones($product_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.get_milestones', array(new xmlrpcval($product_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getContainedMilestones()\n\t{\n\t\tif ($this->containedMilestones == null) {\n\t\t\t$this->containedMilestones = $this->getProjects(true, 1);\n\t\t}\n\n\t\treturn $this->containedMilestones;\n\t}", "private function _get_milestones( $project ) {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$milestones = [];\n\t\t$page_index = 1;\n\t\t$total = 0;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( 'projects/' . $project['id'] . \"/milestones?per_page=50&page=$page_index&sort=asc\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$milestones = array_merge( $milestones, $response_arr );\n\n\t\t\t$page_index ++;\n\t\t\t$total += count( $response_arr );\n\n\t\t} while ( count( $response_arr ) > 0 );\n\n\t\treturn $milestones;\n\n\t}", "public function milestones()\n {\n return $this->hasMany(ProjectMilestone::class);\n }", "function get_status_progression( $id_parcours) {\n\n\tglobal $wpdb;\n\n\t$completed = 0;\n\n\t$episodes = get_field('episodes' , $id_parcours);\n\n\t$episodes_number = count($episodes);\n\t// init the array to be returned\n\t$progress_ar = [];\n\n\t$id_user = get_current_user_id();\n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\t$achieved = $rowcount;\n\t\n\tif($achieved == $episodes_number) {\n\t\t$completed = 1;\n\t}\n\n\n\t$percent = round(($achieved * 100) / $episodes_number);\n\n\t$progress_ar['completed'] = $completed;\n\t$progress_ar['percent'] = $percent;\n\t$progress_ar['achieved'] = $achieved;\n\t$progress_ar['episodes_number'] = $episodes_number;\n\n\treturn $progress_ar;\n}", "public function progress(): int\n {\n return $this->pluck('progress');\n }", "function milestone($stepID) {\r\n GLOBAL $mysqlID;\r\n\t\r\n$stg=$_SESSION[\"stage\"];\r\n$thismlstn=$_SESSION[\"milestone\"];\r\n\t\r\n\r\n \r\n $allMilestones1=array(//pre\r\n1=>array(\"Body guy\",'011',\"Personal Health Profile\",'012'),\r\n2=>array(\"Are you dependent\",121,\"People and Places\",231),\r\n3=>array(\"Why think about quitting\",131,\"What are your worries?\",'132'),\r\n4=>array(\"Why think about quitting\",131,\"Some small steps\",142),\r\n5=>array(\"Friends and family\",151,\"Relaxation tips\",152),\r\n6=>array(\"positive thinking\",161),\r\n7=>array(\"Barriers\",171),\r\n8=>array(),\r\n9=>array());\r\n \r\n \r\n $allMilestones2=array(//con\r\n \t1=>array(\"Body guy\",'011',\"Personal Health Profile\",'012'),\r\n\t2=>array(\"Are you dependent\",221,\"What are your worries\",'023'),\r\n 3=>array(\"People and Places\",231),\r\n 4=>array(\"Why think about quitting\",241,\"Some small steps\",142),\r\n 5=>array(\"Friends and family\",251,\"Relaxation tips\",152),\r\n 6=>array(\"What gets in way\",261,\"What are your worries\",262),\r\n 7=>array(\"Barriers tracking\",271),\r\n 8=>array(\"what's good, what's bad\",281),\r\n 9=>array()\r\n );\r\n \r\n \r\n $allMilestones3=array(//prep\r\n \t1=>array(\"Body guy\",'011',\"Personal Health Profile\",'012',\"Pharmaco DA\",313,\"Addiction info\",314),\r\n\t2=>array(\"Kicking old habits\",324,\"When, where, why?\",325),\r\n 3=>array(\"Small steps\",331,\"Cutting out cravings\",332,\"What are your worries\",333),\r\n 4=>array(\"Update goals\",341,\"Avoid triggers\",342),\r\n 5=>array(\"Quitting game plan\",351,\"Why think about quitting\",352),\r\n 6=>array(),\r\n 7=>array(),\r\n 8=>array(),\r\n 9=>array()\r\n );\r\n\r\n \r\n\t\r\n\t\r\n\t$doRun=false;\r\n\t\r\n\tif(in_array($stepID, ${allMilestones.$stg}[$thismlstn])){\r\n\t\t$doRun=true;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\tif($doRun){\r\n\t\r\n\t $mstnContent=array();\r\n\t \t \r\n\t $mstnContent= $_SESSION[\"mstnContent\"];\r\n\t\r\n\t \r\n\t \r\n\tif(!in_array($stepID, $mstnContent)){ \r\n\t \r\n\t $sqla=\"UPDATE PFHMilestones SET steps=CONCAT(steps, ', ', '$stepID') WHERE userID={$_SESSION[\"userID\"]} AND stageID={$_SESSION[\"stageID\"]} AND id={$_SESSION[\"milestoneID\"]}\"; \r\n\t \r\n\t \r\n\t $result=mysql_query($sqla, $mysqlID);\r\n\t \r\n\t $sqlb=\"SELECT steps FROM PFHMilestones WHERE userID={$_SESSION[\"userID\"]} AND stageID={$_SESSION[\"stageID\"]} AND id={$_SESSION[\"milestoneID\"]}\";\r\n\t \r\n\t $result=mysql_query($sqlb, $mysqlID);\r\n\t \r\n\t $stepz=mysql_fetch_row($result);\r\n\t \r\n\t $_SESSION[\"mstnContent\"]=explode(\", \", $stepz[0]);\r\n\t \r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t }\r\n\t\t\t \r\n}", "protected function calculateProgress($currentStepIndex)\n {\n $this->progress = floor(($currentStepIndex + 1) / $this->flow->countSteps() * 100);\n }", "public function mainRunnerProgress($evt){\n $data = $evt->data;\n if (key_exists('progress', $data)){\n $this->updateProgress(floor($data['progress']));\n }\n if (key_exists('message', $data)){\n $this->setMessage($data['message']);\n }\n\n// $progress = round($data['progress'], 2);\n// echo \"Progress {$progress}%: {$data['message']}\\r\\n<br>\\r\\n\";\n $this->save();\n }", "public function milestones()\n {\n return $this->hasMany(Milestones::class, 'project_milestone_id');\n }", "public function testDestiny2GetPublicMilestones()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function milestones()\n {\n return new Milestones($this->getClient());\n }", "public function updateParentProjectTaskPercentage()\n\t{\n\n\t\tif (empty($this->parent_task_id))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!empty($this->project_id))\n\t\t{\n //determine parent task\n $parentProjectTask = $this->getProjectTaskParent();\n\n //get task children\n if ($parentProjectTask)\n {\n $subProjectTasks = $parentProjectTask->getAllSubProjectTasks();\n $tasks = array();\n foreach($subProjectTasks as &$task)\n {\n array_push($tasks, $task->toArray());\n }\n $parentProjectTask->percent_complete = $this->_calculateCompletePercent($tasks);\n unset($tasks);\n $parentProjectTask->save(isset($GLOBALS['check_notify']) ? $GLOBALS['check_notify'] : '');\n }\n\t\t}\n\t}", "function getGoalPercent(){\n $goal = $GLOBALS['GOAL_STEPS'];\n $cursteps = getCurrentSteps();\n $percent = ( $cursteps[0]['steps'] / $goal ) * 100;\n return round($percent);\n}", "public function updateStatistic()\n {\n /**\n * @var array Array of tasks for current project\n */\n $list = array();\n /**\n * @var array Key-value array of project_task_id => parent_task_id\n */\n $tree = array();\n /**\n * @var array Array with nodes which have childrens\n */\n $nodes = array();\n /**\n * @var array Array with IDs of list which have been changed\n */\n $changed = array();\n\n $db = DBManagerFactory::getInstance();\n $this->disable_row_level_security = true;\n $query = $this->create_new_list_query('', \"project_id = {$db->quoted($this->project_id)}\");\n $this->disable_row_level_security = false;\n $res = $db->query($query);\n while($row = $db->fetchByAssoc($res))\n {\n array_push($list, $row);\n }\n // fill in $tree\n foreach($list as $k => &$v)\n {\n if(isset($v['project_task_id']) && $v['project_task_id'] != '')\n {\n $tree[$v['project_task_id']] = $v['parent_task_id'];\n if(isset($v['parent_task_id']) && $v['parent_task_id'])\n {\n if(!isset($nodes[$v['parent_task_id']]))\n {\n $nodes[$v['parent_task_id']] = 1;\n }\n }\n }\n }\n unset($v);\n // fill in $nodes array\n foreach($nodes as $k => &$v)\n {\n $run = true;\n $i = $k;\n while($run)\n {\n if(isset($tree[$i]) && $tree[$i]!= '')\n {\n $i = $tree[$i];\n $v++;\n }\n else\n {\n $run = false;\n }\n }\n }\n arsort($nodes);\n unset($v);\n // calculating of percentages and comparing calculated value with database one\n foreach($nodes as $k => &$v)\n {\n $currRow = null;\n $currChildren = array();\n $run = true;\n $tmp = array();\n $i = $k;\n while($run)\n {\n foreach($list as $id => &$taskRow)\n {\n if($taskRow['project_task_id'] == $i && $currRow === null)\n {\n $currRow = $id;\n }\n if($taskRow['parent_task_id'] == $i)\n {\n if(!in_array($taskRow['project_task_id'], array_keys($nodes)))\n {\n array_push($currChildren, $taskRow);\n }\n else\n {\n array_push($tmp, $taskRow['project_task_id']);\n }\n }\n }\n unset($taskRow);\n if(count($tmp) == 0)\n {\n $run = false;\n }\n else\n {\n $i = array_shift($tmp);\n }\n }\n $subres = $this->_calculateCompletePercent($currChildren);\n if($subres != $list[$currRow]['percent_complete'])\n {\n $list[$currRow]['percent_complete'] = $subres;\n array_push($changed, $currRow);\n }\n }\n unset($v);\n // updating data in database for changed tasks\n foreach($changed as $k => &$v)\n {\n $task = BeanFactory::newBean('ProjectTask');\n $task->populateFromRow($list[$v]);\n $task->skipParentUpdate();\n $task->save(false);\n }\n }", "function getGameProgression()\n { \n // Start or end of game\n $current_state = $this->gamestate->state();\n switch($current_state['name']) {\n case 'gameSetup':\n case 'turn0':\n return 0;\n case 'whoBegins':\n return 1;\n case 'justBeforeGameEnd':\n case 'gameEnd':\n return 100;\n }\n // For other states (all included in player action)\n $players = self::loadPlayersBasicInfos();\n \n // The total progression is a mix of:\n // -the progression of the decreasing number of cards in deck (end of game by score)\n // -the progression of each player in terms of the achievements they get\n \n // Progression in cards\n // Hypothesis: a card of age 9 is drawn three times quicker than a card of age 1. Cards of age 10 are worth six times a card of age 1 because if there are none left it is the end of the game\n $weight = 0;\n $total_weight = 0;\n \n $number_of_cards_in_decks = self::countCardsInLocation(0, 'deck', true);\n for($age=1; $age<=10; $age++) {\n $n = $number_of_cards_in_decks[$age];\n switch($age) {\n case 1:\n $n_max = 14 - 2 * count($players); // number of cards in the deck at the beginning: 14 (15 minus one taken for achievement) minus the cards dealt to the players at the beginning\n $w = 1; // weight for cards of age 1: 1\n break;\n case 10:\n $n++; // one more \"virtual\" card because the game is not over where the tenth age 10 card is drawn (but quite...)\n $n_max = 11; // number of cards in the deck at the beginning: 10, +1 one more \"virtual\" card because the game is not over when the last is drawn\n $w = 6; // weight for cards of age 10: 6\n break;\n default:\n $n_max = 9; // number of cards in the deck at the beginning: 9 (10 minus one taken for achievement)\n $w = ($age-1) / 4 + 1; // weight between 1.25 (for age 2) and 3 (for age 9)\n break;\n };\n $weight += ($n_max - $n) * $w; // What is really important are the cards already drawn\n $total_weight += $n_max * $w;\n }\n $progression_in_cards = $weight/$total_weight;\n \n // Progression of players\n // This is the ratio between the number of achievements the player have got so far and the number of achievements needed to win the game\n $progression_of_players = array();\n $n_max = self::getGameStateValue('number_of_achievements_needed_to_win');\n foreach($players as $player_id=>$player) {\n $n = self::getPlayerNumberOfAchievements($player_id);\n $progression_of_players[] = $n/$n_max;\n }\n \n // If any of the above progression was 100%, the game would be over. So, 100% is a kind of \"absorbing\" element. So,the method is to multiply the complements of the progression.\n // A complement is defined as 100% - progression\n $complement = 1 - $progression_in_cards;\n foreach($progression_of_players as $progression) {\n $complement *= 1 - $progression;\n }\n $final_progression = 1 - $complement;\n \n // Convert the final result in percentage\n $percentage = intval(100 * $final_progression);\n $percentage = min(max(1, $percentage), 99); // Set that progression between 1% and 99%\n return $percentage;\n }", "public function hasMilestones()\n\t{\n\t\tif ($this->hasMilestones === null) {\n\t\t\t$children = $this->getMilestones();\n\t\t\t$this->hasMilestones = count($children) > 0;\n\t\t}\n\t\t\n\t\treturn $this->hasMilestones;\n\t}", "public static function calculateProjectStatusByUnits($projectID) {\n $countUnits = ArmyDB::countUnitsInProject($projectID);\n\n if ($countUnits == 0) {\n return \"0.0\";\n }\n\n $units = ArmyDB::retrieveUnitsFromProject($projectID);\n $statusPts = 0;\n\n foreach ($units as $unit) {\n $statusPts += ArmyDB::convertStatusToDecimal($unit['status']);\n }\n\n if ($statusPts == 0) {\n return \"0.0\";\n }\n return round($statusPts / ($statusPts * $countUnits) * 100, 1);\n\n }", "function longtermmilestone(){\n global $names, $rows, $lastRow, $amount, $amountSpentOrg, $tax;\n $totalCurrentPrice = $totalOriginalPrice = 0;\n for ($col=1; $col<14; $col++) {\n $newprice = $rows[$lastRow][$col]*$amount[$col];\n $oldPrice = $rows[0][$col]*$amount[$col];\n $totalCurrentPrice += $newprice;\n $totalOriginalPrice += $oldPrice;\n }\n if ($totalCurrentPrice*$tax > 10*$amountSpentOrg) {\n $msg= \"Total investment rose since the beginning (Org x\".round(($totalCurrentPrice*$tax/$totalOriginalPrice),2).\" at a price of \".round($totalCurrentPrice*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Milestone hit! :)\", $msg);\n } else if ($totalCurrentPrice*$tax > 5*$amountSpentOrg) {\n $msg=\"Total investment rose since the beginning (Org x\".round(($totalCurrentPrice*$tax/$totalOriginalPrice),2).\" at a price of \".round($totalCurrentPrice*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Milestone hit! :)\", $msg);\n } else if ($totalCurrentPrice*$tax > 2*$amountSpentOrg) {\n $msg=\"Total investment rose since the beginning (Org x\".round(($totalCurrentPrice*$tax/$totalOriginalPrice),2).\" at a price of \".round($totalCurrentPrice*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Milestone hit! :)\", $msg);\n }\n}", "public function getStepProgression()\n {\n return $this->stepProgression;\n }", "private function _calculateCompletePercent(&$subProjectTasks)\n {\n $totalHours = 0;\n $cumulativeDone = 0;\n //update cumulative calculation - mimics gantt calculation\n foreach ($subProjectTasks as $key => &$value)\n {\n if ($value['duration'] == \"\")\n {\n $value['duration'] = 0;\n }\n\n if ($value['percent_complete'] == \"\")\n {\n $value['percent_complete'] = 0;\n }\n\n if ($value['duration_unit'] == \"Hours\")\n {\n $totalHours += $value['duration'];\n $cumulativeDone += $value['duration'] * ($value['percent_complete'] / 100);\n }\n else\n {\n $totalHours += ($value['duration'] * 8);\n $cumulativeDone += ($value['duration'] * 8) * ($value['percent_complete'] / 100);\n }\n }\n\n $cumulativePercentage = 0;\n if ($totalHours != 0)\n {\n $cumulativePercentage = round(($cumulativeDone/$totalHours) * 100);\n }\n return $cumulativePercentage;\n }", "public function getProgressPoints() : int {\n\t\treturn $this->progressPoints;\n\t}", "function calculate_student_progress($completed_hours, $total_hours, $pace) {\n\n\t// Get the default progress percentage:\n\t$progress = $completed_hours/$total_hours;\n\t// echo number_format($progress, 2);\n\n\tif ($_POST['pace'] == 16) {\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($progress, 2) * 100;\n\t} else {\n\t\t// Get adjusted progress for this pace:\n\t\t$adjusted_progress = $progress / 1.5;\n\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($adjusted_progress, 2) * 100;\n\t\t}\n}", "private function _create_milestones( $project, $repo_name ) {\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Creating Milestone(s) for %s', $repo_name ) . PHP_EOL );\n\n\t\t$milestone_map = [];\n\n\t\t$github = new Github();\n\t\t$milestones = $this->_get_milestones( $project );\n\n\t\tforeach ( $milestones as $milestone ) {\n\n\t\t\t$milestone_map[] = $github->create_milestone( $milestone, $this->github_organisation, $repo_name );\n\n\t\t}\n\n\t\t$this->_write_log( PHP_EOL . sprintf( 'Total %1$s Milestone(s) created for %2$s', count( $milestones ), $repo_name ) . PHP_EOL );\n\n\t\treturn $milestone_map;\n\n\t}", "public function setMilestones(){\n\n //Unset all the milestones that already exist\n foreach($this->milestones as $milestone){\n foreach($this->all_milestones as $aM){\n if($aM->Id == $milestone->Id) {\n array_push($this->thisMilestones, $this->rowMilestone($milestone, $aM));\n unset($this->all_milestones[(int)$aM->Id]);\n break;\n }\n }\n }\n }", "public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }", "public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }", "public function test_course_progress_percentage_with_just_activities() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Check we have received valid data.\n // Note - only 4 out of the 5 activities support completion, and the user has completed 2 of those.\n $this->assertEquals('50', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }", "public function progressTask()\n\t{\n\t\t// get request vars\n\t\t$id = Request::getInt('id', 0);\n\n\t\t// create import model object\n\t\t$import = Import::oneOrFail($id);\n\n\t\t// get the lastest run\n\t\t$run = $import->runs()\n\t\t\t->whereEquals('import_id', $import->get('id'))\n\t\t\t->ordered()\n\t\t\t->row();\n\n\t\t// build array of data to return\n\t\t$data = array(\n\t\t\t'processed' => $run->get('processed', 0),\n\t\t\t'total' => $run->get('count', 0)\n\t\t);\n\n\t\t// return progress update\n\t\techo json_encode($data);\n\t\texit();\n\t}", "protected function countProgressForToday()\n {\n $from = new \\DateTime();\n $from = $from->setTime(0, 0, 0);\n $to = new \\DateTime();\n $to = $to->setTime(23, 59, 59);\n\n $progress = $this->entityManager->getRepository('AppBundle:Progress')->sumForDate($from, $to);\n\n return $progress[0][1];\n\n }", "function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}", "public static function updateProgress(int $id, float $estimatedWorkTime = 0, float $progressInHours = 0, ?int $callerId = null): array\n\t{\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($id);\n\t\tforeach (static::getChildren($id) as $child) {\n\t\t\tif ($callerId !== $child['id']) {\n\t\t\t\t$childEstimatedWorkTime = static::calculateEstimatedWorkTime($child['id']);\n\t\t\t\t$estimatedWorkTime += $childEstimatedWorkTime;\n\t\t\t\t$progressInHours += ($childEstimatedWorkTime * $child['progress'] / 100);\n\t\t\t}\n\t\t}\n\t\tstatic::calculateProgressOfMilestones($id, $estimatedWorkTime, $progressInHours);\n\t\t$projectProgress = $estimatedWorkTime ? round((100 * $progressInHours) / $estimatedWorkTime) : 0;\n\t\t$recordModel->set('progress', $projectProgress);\n\t\t$recordModel->set('estimated_work_time', $estimatedWorkTime);\n\t\t$recordModel->save();\n\t\tif (!$recordModel->isEmpty('parentid') && $recordModel->get('parentid') !== $callerId) {\n\t\t\tstatic::updateProgress(\n\t\t\t\t$recordModel->get('parentid'),\n\t\t\t\t$estimatedWorkTime,\n\t\t\t\t$progressInHours,\n\t\t\t\t$id\n\t\t\t);\n\t\t}\n\t\treturn [\n\t\t\t'estimatedWorkTime' => $estimatedWorkTime,\n\t\t\t'projectProgress' => $projectProgress\n\t\t];\n\t}", "public function getProgress()\n {\n return $this->progress;\n }", "function calculateProgBar($current_amt, $goal_level)\n{\n @$current_level = (($current_amt / $goal_level) * 100);\n\n // Here we need to round that percentage to display it before converting it to pixels (margin-bottom)\n $exact_level = round($current_level);\n\n /*\n Now we keep the marker down one close to the goal for exact level (% display)\n and to keep the goal from showing it's prematurely met when it's not.\n We also fix the bottom so if the level is 0 or close to it it displays as 1 so we see visible progress\n */\n if ($current_level < 100 && $exact_level == 100) {\n $exact_level = 99;\n } else if ($current_level > 0 && $exact_level == 0) {\n $exact_level = 1;\n }\n\n /*\n Now if we're in that 95-99.99% zone, we need to force the marker down (force it down a bit) so as to\n not obscure the goal text with its background\n */\n if ($current_level > 95 && $current_level < 100) {\n $current_level = 95;\n } else {\n $current_level = round($current_level);\n }\n\n // Here we keep the bottom end stable for negatives and whatever\n $divisible = ($current_level % 5);\n if ($divisible != 0) {\n $current_level -= $divisible;\n }\n // And then prevent overflow when the goal is exceeded\n if ($current_level > 100) {\n $current_level = 100;\n }\n\n // Now we covert that percentage into bottom margin (300px high so 1% = 3px)\n $margin_level = round($current_level * 3);\n return $margin_level;\n}", "public function loadLevelProgress() {\n\t\tswitch(true){\n\t\t\tcase ($this->data['level_pts'] >= 5000):\n\t\t\t\t$progress = $this->data['level_pts'] % 1000;\n\t\t\t\t$progress = floor($progress / 10);\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 1000):\n\t\t\t\t$progress = $this->data['level_pts'] % 500;\n\t\t\t\t$progress = floor($progress / 5);\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 600):\n\t\t\t\t$progress = $this->data['level_pts'] % 600;\n\t\t\t\t$progress = floor($progress / 4);\n\t\t\t\tbreak;\n\t\t\tcase ($this->data['level_pts'] >= 300):\n\t\t\t\t$progress = $this->data['level_pts'] % 300;\n\t\t\t\t$progress = floor($progress / 3);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$progress = floor($this->data['level_pts'] / 3);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $progress;\n\t}", "function show_answers_progress($real_taskcount, $taskcount, $pid, $colspan = -1){\n\t\n\tif($colspan == -1){\n\t\t$colspan = \"\";\n\t}else{\n\t\t$colspan = \" colspan = '$colspan'\";\n\t}\n\t\n\t//taskcount formatting\n\t$delta_tc = $taskcount - $real_taskcount;\n\t$const = 60;\n\tif($delta_tc >= 0 || $taskcount == 0){\n\t\t$width = $const;\n\t}else{\n\t\t$width = $const * $taskcount / $real_taskcount;\n\t\t$sec_width = $const * abs($delta_tc) / $real_taskcount;\n\t}\n\t\n\techo \"<td$colspan>\n\t\t<meter id='bar$pid' min='0' max='100' low='25' high='75' optimum='100' value='\";\n\tif($taskcount == 0){\n\t\techo \"0\";\n\t}else{\n\t\techo $real_taskcount / $taskcount * 100;\n\t}\n\techo \"' style='width:\".$width.\"%;'></meter>\";\n\tif($delta_tc < 0 && $taskcount != 0){\n\t\techo \"<meter min='0' max='100' low='0' high='0' optimum='0' value='100' style='width:\".$sec_width.\"%;'></meter>\";\n\t}\n\techo \"<label for='bar$pid'> $real_taskcount/$taskcount</label>\";\n\techo \"</td>\";\n}", "function computeProgress($docno, $_ACT_FROM_UM, $_ACT_FROM_READER, $_ACT_FROM_OLDREADER){\n \n $confidence = 0.0;\n $totalhits = 0;\n $coverage = 0.0;\n $clicks = 0;\n $annotations = 0;\n $distinct = 0;\n $npages = 1;\n \n if (isset($_ACT_FROM_UM[$docno])) {\n $totalhits += intval($_ACT_FROM_UM[$docno][\"hits\"]);\n $npages = intval($_ACT_FROM_UM[$docno][\"npages\"]);\n $distinct = 1;\n }\n if (isset($_ACT_FROM_READER[$docno])) {\n $totalhits += $_ACT_FROM_READER[$docno][\"pageloads\"];\n $distinct = $_ACT_FROM_READER[$docno][\"distinctpages\"];\n $npages = $_ACT_FROM_READER[$docno][\"npages\"];\n $clicks = $_ACT_FROM_READER[$docno][\"clicks\"];\n $annotations = $_ACT_FROM_READER[$docno][\"annotations\"];\n \n }\n \n if (isset($_ACT_FROM_OLDREADER[$docno])) {\n $npages = $_ACT_FROM_OLDREADER[$docno][\"npages\"];\n $clicks += $_ACT_FROM_OLDREADER[$docno][\"clicks\"];\n $annotations += $_ACT_FROM_OLDREADER[$docno][\"annotations\"]; \n } \n \n $coverage = 1.0 * $distinct / $npages;//modified by jbarriapineda in 11-28\n \n $loadrate = $totalhits / $npages;\n $actionrate = ($clicks + $annotations) / $npages;\n \n $loadconf = 0.0;\n $actionconf = 0.0;\n \n if ($loadrate > 0) $loadconf = 0.1;\n if ($loadrate > 0.5) $loadconf = 0.25;\n if ($loadrate > 1) $loadconf = 0.5;\n if ($loadrate > 2) $loadconf = 1;\n\n if ($actionrate > 0) $actionconf = 0.1;\n if ($actionrate > 0.5) $actionconf = 0.25;\n if ($actionrate > 1) $actionconf = 0.5;\n if ($actionrate > 2) $actionconf = 1;\n \n $confidence = ($loadconf + $actionconf) / 2;\n if ($coverage>1.0) $coverage = 1.0;\n $coverage=$coverage-0.25;//added by jbarraipineda in 11-28\n if($coverage<0.0) $coverage=0.0;//added by jbarraipineda in 11-28\n return array($coverage,$confidence);\n\n}", "public function dequigetProgressByArea()\n {\n\n\n \n\n\n\n }", "public function progress() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n $data['current'] = str_replace('overview', 'play', $this->user->get_next_step());\n $this->load->view('account/progress', $data);\n }", "public static function calculateProjectStatusByPts($projectID) {\n $countPts = ArmyDB::countPointsInProject($projectID);\n\n $units = ArmyDB::retrieveUnitsFromProject($projectID);\n $statusPts = 0;\n\n foreach ($units as $unit) {\n $statusPts += $unit['pts'] * (ArmyDB::convertStatusToDecimal($unit['status']) / 10);\n }\n\n if ($units == 0) {\n return \"0.0%\";\n }\n else {\n return round($statusPts/$countPts * 100,1);\n }\n }", "protected function getProgressHelper() {}", "public function progressing($unit, $data_progress) {\n\t\t$this->db->where('cc_unit', $unit)\n\t\t\t\t ->update('cc_program_overall', $data_progress);\n\t}", "private function getProgressForDQCombinations()\n {\n /* Get basic progress statistics (no multiple assessments considered yet) */\n // different DQCombinations\n $total_assessments = $this->dq_repo->findTotalAssessments();\n // number of different DQCombinations\n $total_assessments = (float)$total_assessments[0]['total_assessments'];\n // DQCombinations with at least 1 assessment\n $finished_assessments = $this->dq_repo->findFinishedAssessments();\n // number of DQCombinations with at least 1 assessment\n $finished_assessments = (float)$finished_assessments[0]['finished_assessments'];\n // calculate proportion\n $total_assessments > 0\n ? $assessment_prop = round(($finished_assessments / $total_assessments) * 100, 1)\n : $assessment_prop = 0;\n\n return array('total' => $total_assessments, 'finished' => $finished_assessments, 'proportion' => $assessment_prop);\n }", "function tripal_job_set_progress($job_id,$percentage){\n\n if(preg_match(\"/^(\\d+|100)$/\",$percentage)){\n $record = new stdClass();\n $record->job_id = $job_id; \n $record->progress = $percentage;\n\t if(drupal_write_record('tripal_jobs',$record,'job_id')){\n\t return 1;\n\t }\n }\n return 0;\n}", "public function calculate_coupon_background_progress() {\n\t\t\t$progress = array();\n\n\t\t\t$start_time = get_site_option( 'start_time_woo_sc', false );\n\t\t\t$current_time = get_site_option( 'current_time_woo_sc', false );\n\t\t\t$all_tasks_count = get_site_option( 'all_tasks_count_woo_sc', false );\n\t\t\t$remaining_tasks_count = get_site_option( 'remaining_tasks_count_woo_sc', false );\n\n\t\t\t$percent_completion = floatval( 0 );\n\t\t\tif ( false !== $all_tasks_count && false !== $remaining_tasks_count ) {\n\t\t\t\t$percent_completion = ( ( intval( $all_tasks_count ) - intval( $remaining_tasks_count ) ) * 100 ) / intval( $all_tasks_count );\n\t\t\t\t$progress['percent_completion'] = floatval( $percent_completion );\n\t\t\t}\n\n\t\t\tif ( $percent_completion > 0 && false !== $start_time && false !== $current_time ) {\n\t\t\t\t$time_taken_in_seconds = $current_time - $start_time;\n\t\t\t\t$time_remaining_in_seconds = ( $time_taken_in_seconds / $percent_completion ) * ( 100 - $percent_completion );\n\t\t\t\t$progress['remaining_seconds'] = ceil( $time_remaining_in_seconds );\n\t\t\t}\n\n\t\t\treturn $progress;\n\t\t}", "public function progress_order($order_id, $current_progress, $set_progress = 0, array $changes = array())\n {\n $current_order = $this->get($order_id);\n\n if ($current_order == FALSE OR (isset($current_order['progress']) AND $current_order['progress'] !== $current_progress))\n return FALSE;\n\n if ($current_progress == '2' && in_array($set_progress, array('3', '4'))) {\n $update['progress'] = ($set_progress == '3') ? '3' : '4';\n } else if ($current_progress == '3' AND $set_progress == '6') {\n $update['progress'] = '6';\n } else if ($current_progress == '4' AND in_array($set_progress, array('5', '6')) == TRUE) {\n $update['progress'] = ($set_progress == '5') ? '5' : '6';\n } else if ($current_progress == '5' AND in_array($set_progress, array('6', '7')) == TRUE) {\n $update['progress'] = ($set_progress == '6') ? '6' : '7';\n } else {\n $update['progress'] = ($current_progress + 1);\n }\n $update['time'] = time();\n\n $this->db->where('id', $order_id);\n if ($this->db->update('orders', $update) == TRUE) {\n if ($update['progress'] == '7') {\n $this->increase_users_order_count(array($current_order['buyer']['id'], $current_order['vendor']['id']));\n $this->load->model('review_auth_model');\n $this->review_auth_model->issue_tokens_for_order($order_id);\n }\n\n $this->update_order($order_id, $changes);\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function get_percentage_complete() {\n\t\t$args = $this->get_donation_argument( array( 'number' => - 1, 'output' => '' ) );\n\t\tif ( isset( $args['page'] ) ) {\n\t\t\tunset( $args['page'] );\n\t\t}\n\t\t$query = give_get_payments( $args );\n\t\t$total = count( $query );\n\t\t$percentage = 100;\n\t\tif ( $total > 0 ) {\n\t\t\t$percentage = ( ( 30 * $this->step ) / $total ) * 100;\n\t\t}\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}", "public static function get_progress_returns() {\n return new external_single_structure([\n 'courseid' => new external_value(PARAM_INT, 'Course Id'),\n 'userid' => new external_value(PARAM_INT, 'User Id'),\n 'progress' => new external_value(PARAM_INT, 'Progress')\n ]);\n }", "public function setProgress($p)\r\n {\r\n // 0.0 <= $p <= 1.0\r\n $this->progress = intval( $p * 100 );\r\n }", "public function getItemProgress() : int\n {\n return $this->itemProgress;\n }", "public function taskPercentage($taskId)\n {\n $taskPercentage = 0;\n $reportQuery = new Query();\n $reportQuery->select('COUNT(*) as count, SUM(percent_done) as sum')\n ->from('tomreport')\n ->where('tomreport.task_id=:taskId', array(':taskId' => $taskId));\n\n $reportPercentages = $reportQuery->all();\n\n $sumReports = $reportPercentages[0]['sum'];\n $allReports = $reportPercentages[0]['count'];\n if ($sumReports == null) {\n $sumReports = 100; // if task exists but has no reports\n $allReports = 1;\n }\n if ($allReports != null && $allReports != 0) {\n $taskPercentage = $sumReports / $allReports;\n }\n\n if ($taskPercentage == 100) {\n $this->updateTaskStatus($taskId, 1);\n }\n }", "public function updateProjectProgress($projectId, $projectProgress)\n {\n $project = Tomproject::find()->where(['id' => $projectId])->one();\n if ($project->progress_bar < $projectProgress) {\n $project->progress_bar = $projectProgress;\n $project->save();\n }\n }", "public function RemainToGoal() {\n\t\t\n\t\tif (!empty($this->activities)) {\n\t\t\t\n\t\t\t$goal = intval($this->activities['goals']['steps']);\n\t\t\t$steps = intval($this->Steps());\n\t\t\t\n\t\t\tif ($goal > $steps) {\n\t\t\t\t\n\t\t\t\treturn $goal - $steps;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public function getStageProgress()\n {\n return $this->get(self::_STAGE_PROGRESS);\n }", "function calculatenumpages($boardtype, $numposts) {\n\tif ($boardtype==1) {\n\t\treturn (floor($numposts/KU_THREADSTXT));\n\t} elseif ($boardtype==3) {\n\t\treturn (floor($numposts/30));\n\t}\n\n\treturn (floor($numposts/KU_THREADS));\n}", "function _fourD_analysis_calculate_project_prerequisite_weight( $nid, $uid=0, $project=false ) {\n\n //$goals = _fourD_analysis_get_goals();\n if( !$project ) {\n $project = fourD_analysis_project_entry_get($nid, $uid);\n }\n \n if( !$project ){\n return 0.0;\n }\n \n $weight = 0;\n if( isset($project['project_prereq']) ){\n foreach( $project['project_prereq'] as $pid=>$pre){\n $weight += $pre['rating'];\n //fourD_analysis_debug('calculate_project_prerequisite_weight; pid: '. $pid.'; Weight: '.$pre['rating'].'; Cumlative: '.$weight );\n }\n }\n \n return $weight;\n \n}", "public function getMontoEjecutado()\n {\n $montoEjecutado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getRecursoEjecutado())!=0)\n {\n foreach($actividad->getRecursoEjecutado() as $ejecutado)\n {\n $moneda = $ejecutado->getMoneda();\n $montoEjecutado+=($ejecutado->getMonto()*$moneda->getPrecioBs());\n }\n }\n } \n }\n }\n return $montoEjecutado;\n }", "private function computeProgress($progressSeconds)\n {\n $priceForSecond = $this->hourCost/60/60;\n\n return $priceForSecond * $progressSeconds;\n }", "public function getPercentageProgress($jenis)\n\t{\n\t\t$unitkerja=$this->unitkerja;\n\t\t$kegiatan=$this->kegiatan;\n\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_kegiatan WHERE unit_kerja=$unitkerja AND kegiatan=$kegiatan AND jenis=$jenis\";\n\t\t$total=Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t\n\t\t$percentage=($this->target==0) ? 100 : $total/$this->target*100;\n\t\treturn floor($percentage);\n\t}", "public function getStepsCountAttribute()\n {\n $result = MultipleRoomsStepStatus::find($this->attributes['multiple_room_id']);\n\n return 5 - (@$result->basics + @$result->description + @$result->location + @$result->photos + @$result->pricing + @$result->calendar);\n }", "public function update($progress) {\n if ($this->isResolved) {\n throw new \\LogicException(\n \"Cannot update resolved promise\"\n );\n }\n\n $baseArgs = func_get_args();\n foreach ($this->watchers as $watcher) {\n $args = $baseArgs;\n $args[] = $watcher[1];\n \\call_user_func_array($watcher[0], $args);\n }\n }", "public function getTotalPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getTotalSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getTotalSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }", "public function getMontoPlanificado()\n {\n $montoPlanificado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n $moneda=$actividad->getMoneda();\n $montoPlanificado+=($actividad->getMonto()*$moneda->getPrecioBs());\n }\n }\n return $montoPlanificado;\n }", "public function progress() {\n\t\treturn $this->hasMany('SectionProgress');\n\t}", "function progress_percentage($events, $attempts) {\n $attemptcount = 0;\n foreach ($events as $event) {\n if(array_key_exists($event['type'].$event['id'], $attempts)) {\n if ($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n } else {\n }\n }\n $progressvalue = $attemptcount == 0 ? 0 : $attemptcount / count($events);\n return (int)round($progressvalue * 100);\n}", "public function testShiftTasksAll() {\n\t\t$milestone1_pre = $this->Milestone->findById(1);\n\t\t$milestone3_pre = $this->Milestone->findById(3);\n\n\t\t$this->assertEqual($milestone1_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_pre['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->Milestone->shiftTasks(1, 3, true, array('callbacks' => false));\n\n\t\t$milestone1_post = $this->Milestone->findById(1);\n\t\t$milestone3_post = $this->Milestone->findById(3);\n\t\t$this->assertEqual($milestone1_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '0', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '0', 'points' => '0'),\n\t\t));\n\t\t$this->assertEqual($milestone3_post['Tasks'], array(\n\t\t\t'open' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'in progress' => array('numTasks' => '2', 'points' => '0'),\n\t\t\t'resolved' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'closed' => array('numTasks' => '1', 'points' => '0'),\n\t\t\t'dropped' => array('numTasks' => '1', 'points' => '0'),\n\t\t));\n\t}", "public function getVisualProgress() {\n return GetVisualProgress($this->testInfo->getRootDirectory(), $this->run, $this->cached ? 1 : 0,\n null, null, $this->getStartOffset());\n }", "public function get_progress_percentage( WP_User $user ): int {\n\t\t// TODO: Memoize, tests, hook.\n\n\t\t// TODO: Implement it.\n\t\treturn 0;\n\t}", "public function progresso()\n {\n $progressos = $this->partidas()->temporada($this)->orderBy('id')->pluck('evento');\n\n return Calculador::progresso($progressos);\n }", "function show_migrate_multisite_files_progress( $current, $total ) {\n echo \"<span style='position: absolute;z-index:$current;background:#F1F1F1;'>Parsing Blog \" . $current . ' - ' . round($current / $total * 100) . \"% Complete</span>\";\n echo(str_repeat(' ', 256));\n if (@ob_get_contents()) {\n @ob_end_flush();\n }\n flush();\n}", "public function getPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }", "public function percentageParticipation()\n {\n $expectedPartipant = $this->getExpectedParticipants();\n if (count($expectedPartipant) == 0) {\n return 0;\n }\n $actualParticipant = $this->users()\n ->where('users.role_id', Role::findBySlug('PART')->id)\n ->orWhere('users.role_id', Role::findBySlug('GEST')->id)\n ->get()->unique();\n return round((count($actualParticipant) / count($expectedPartipant)) * 100);\n }", "public function getAchievementsPercentage() {\n return $this->getAchievementsDone() / sizeof($this->achievements);\n }", "public function updateDailyProgress(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n $this->user->daily_objective = $this->user->dailyQuestions()->count();\n $this->user->save();\n $this->user->updateDailyProgress();\n $expectedDailyProgress = 1;\n\n /** @var Question_user $artificiallyAnsweredQuestion */\n $artificiallyAnsweredQuestion = $this->user->dailyQuestions()->first();\n $artificiallyAnsweredQuestion = Question_user::query()->where('question_id', $artificiallyAnsweredQuestion->id)->first();\n $artificiallyAnsweredQuestion->next_question_at = Carbon::now()->addDay();\n $artificiallyAnsweredQuestion->save();\n\n\n $this->user->updateDailyProgress();\n $this->assertEquals($this->user->daily_progress, $expectedDailyProgress);\n }", "public function test_course_progress_percentage_with_activities_and_course() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Now, mark the course as completed.\n $ccompletion = new completion_completion(array('course' => $course->id, 'userid' => $user->id));\n $ccompletion->mark_complete();\n\n // Check we have received valid data.\n // The course completion takes priority, so should return 100.\n $this->assertEquals('100', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }", "public function listMilestones($repository, array $options = [])\n {\n return $this->request()->get('repos/' . $repository . '/milestones', $options);\n }", "public function form_footer_progress_status_percentage_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-percentage\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s - Percentage of fields completed. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%s%% completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\">100</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}", "protected function preformExpectedDuration()\n\t{\n\t\t$message = '';\n\t\t$avgStepDuration = $predictedStepCount = $predictedTimeDuration = 0;\n\t\t$avgRowsPerStep = self::ROWS_PER_PAGE;\n\t\tif ($this->stepCount > 0 && $this->timeStart > 0)\n\t\t{\n\t\t\t$avgStepDuration = round((time() - $this->timeStart) / $this->stepCount);\n\t\t\tif ($this->processedItems > 0)\n\t\t\t{\n\t\t\t\t$avgRowsPerStep = round($this->processedItems / $this->stepCount);\n\t\t\t}\n\t\t}\n\t\tif ($this->totalItems > 0)\n\t\t{\n\t\t\t$predictedStepCount = round(($this->totalItems - $this->processedItems) / $avgRowsPerStep);\n\t\t\tif ($this->useCloud === true)\n\t\t\t{\n\t\t\t\t$predictedStepCount *= 2;\n\t\t\t}\n\t\t}\n\t\tif ($avgStepDuration > 0 && $predictedStepCount > 0)\n\t\t{\n\t\t\t$predictedTimeDuration = $avgStepDuration * $predictedStepCount * 1.1;\n\t\t}\n\t\tif ($predictedTimeDuration > 0)\n\t\t{\n\t\t\t$predictedTimeDurationHours = floor($predictedTimeDuration / 3600);\n\t\t\tif ($predictedTimeDurationHours > 0)\n\t\t\t{\n\t\t\t\t$predictedTimeDurationMinutes = ceil(($predictedTimeDuration - $predictedTimeDurationHours * 3600) / 60);\n\t\t\t\t$message =\n\t\t\t\t\tLoc::getMessage('MAIN_EXPORT_EXPECTED_DURATION').' '.\n\t\t\t\t\tLoc::getMessage('MAIN_EXPORT_EXPECTED_DURATION_HOURS', array(\n\t\t\t\t\t\t'#HOURS#' => $predictedTimeDurationHours,\n\t\t\t\t\t\t'#MINUTES#' => $predictedTimeDurationMinutes,\n\t\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$predictedTimeDurationMinutes = round($predictedTimeDuration / 60);\n\t\t\t\t$message =\n\t\t\t\t\tLoc::getMessage('MAIN_EXPORT_EXPECTED_DURATION').' '.\n\t\t\t\t\tLoc::getMessage('MAIN_EXPORT_EXPECTED_DURATION_MINUTES', array(\n\t\t\t\t\t\t'#MINUTES#' => ($predictedTimeDurationMinutes < 1 ? \"&lt;&nbsp;1\" : $predictedTimeDurationMinutes),\n\t\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\treturn $message;\n\t}", "public function progressFinish() {}", "public function progressAction(){\n $groupID = $this->_request->getParam('g');\n \n $group_DB = new Application_Model_DbTable_Group();\n $groupName = $group_DB->getName($groupID);\n $this->view->group_name = $groupName;\n \n $plans_DB = new Application_Model_DbTable_Planing();\n if (!isset($_SESSION['Default']['field'])) {\n $this->view->field_error = true;\n } else {\n $plans = $plans_DB->getByGroup ($groupID, $_SESSION['Default']['field']);\n $this->view->plans = $plans;\n\n $this->view->groupID = $groupID;\n }\n }", "private function updateAchievementProgress($userAchievementModel, $newAchievementProgress, $offset) {\n // Looping through the array\n foreach ($userAchievementModel as $achievement) {\n // Updating the achievementProgress\n $achievement->setAchievementProgress($newAchievementProgress[$offset]);\n $offset++;\n }\n\n return $userAchievementModel;\n }", "protected function updateProjectProgress(Request $request)\n {\n // 1. Find the Service Request ID from the UUID\n $serviceRequest = \\App\\Models\\ServiceRequest::where('uuid', $request['service_request_uuid'])->firstOrFail();\n // 2. Find the Substatus selected \n $substatus = \\App\\Models\\SubStatus::where('uuid', $request['sub_status_uuid'])->firstOrFail();\n\n if ($substatus->phase === 9) {\n return $this->handleCompletedDiagnosis($request, $serviceRequest, $substatus);\n }\n\n // Check if Completed diagnosis, then transfer to Isaac Controller\n if ($request['intiate_rfq'] == 'yes') {\n $this->handleRFQ($request, $serviceRequest);\n }\n\n if ($request['intiate_trf'] == 'yes') {\n $this->handleToolsRequest($request, $serviceRequest);\n }\n\n\n $request->whenFilled('accept_materials', function () use ($request, $serviceRequest) {\n\n $this->handleMaterialsAcceptance($request, $serviceRequest);\n });\n\n return $this->updateDatabase($request->user(), $serviceRequest, $substatus);\n }", "public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }", "protected function calculateChange()\n {\n $difference = (int) $this->value['value'] - (int) $this->previous;\n\n // Prevent division by zero\n if ($difference !== 0) {\n $this->change = round(($difference / $this->value['value']) * 100, 2);\n } else {\n $this->change = 0;\n }\n\n if($this->previous && (int) $this->previous > 0){\n $this->changeLabel = abs($this->change) . '% ' . ($this->change > 0? 'Increase' : 'Decrease');\n }else{\n $this->changeLabel = 'No Prior Data';\n }\n }", "public function run()\n {\n //\n DB::table('tasks')->insert([\n [\n 'id' => 1, 'text' => 'Project #1', 'start_date' => '2017-04-01 00:00:00',\n 'duration' => 5, 'progress' => 0.8, 'parent' => 0\n ],\n [\n 'id' => 2, 'text' => 'Task #1', 'start_date' => '2017-04-06 00:00:00',\n 'duration' => 4, 'progress' => 0.5, 'parent' => 1\n ],\n [\n 'id' => 3, 'text' => 'Task #2', 'start_date' => '2017-04-05 00:00:00',\n 'duration' => 6, 'progress' => 0.7, 'parent' => 1\n ],\n [\n 'id' => 4, 'text' => 'Task #3', 'start_date' => '2017-04-07 00:00:00',\n 'duration' => 2, 'progress' => 0, 'parent' => 1\n ],\n [\n 'id' => 5, 'text' => 'Task #1.1', 'start_date' => '2017-04-05 00:00:00',\n 'duration' => 5, 'progress' => 0.34, 'parent' => 2\n ],\n [\n 'id' => 6, 'text' => 'Task #1.2', 'start_date' => '2017-04-11 00:00:00',\n 'duration' => 4, 'progress' => 0.5, 'parent' => 2\n ],\n [\n 'id' => 7, 'text' => 'Task #2.1', 'start_date' => '2017-04-07 00:00:00',\n 'duration' => 5, 'progress' => 0.2, 'parent' => 3\n ],\n [\n 'id' => 8, 'text' => 'Task #2.2', 'start_date' => '2017-04-06 00:00:00',\n 'duration' => 4, 'progress' => 0.9, 'parent' => 3\n ]\n ]);\n }", "public function getPercentCompleted()\n {\n return $this->percent_completed;\n }", "public function getTotalProgress($tahun=NULL)\n\t{\n\t\tif($tahun==NULL)\n\t\t{\n\t\t\t$tahun=date('Y');\n\t\t}\n\t\t$sqlk=\"SELECT SUM(target) FROM participant p, kegiatan k \n\t\t\t\tWHERE p.kegiatan=k.id AND YEAR(k.end_date)=$tahun\";\n\n\t\t$total_target=Yii::app()->db->createCommand($sqlk)->queryScalar();\n\n\t\t$sqlr=\"SELECT SUM(jumlah) FROM value_kegiatan p, kegiatan k \n\t\t\t\tWHERE p.kegiatan=k.id AND YEAR(k.end_date)=$tahun AND jenis=1\";\n\n\t\t$total_real=Yii::app()->db->createCommand($sqlr)->queryScalar();\n\n\t\treturn $total_target==0 ? 0 : floor($total_real/$total_target*100);\n\t}", "public function form_footer_progress_status_proportion_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %1$s - Number of fields completed, %2$s - Number of fields in total. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%1$s of %2$s completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\"></span>',\n\t\t\t\t'<span class=\"completed-of\"></span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion-completed\" style=\"display: none\">\n\t\t\t<?php \\esc_html_e( 'Form completed', 'wpforms-conversational-forms' ); ?>\n\t\t</div>\n\t\t<?php\n\t}", "public function test_it_can_expose_the_percentage_of_time_remaining()\n {\n $timelog = factory(TimeLog::class)->create([\n 'number_of_seconds' => 3600,\n 'user_id' => $this->user->id,\n 'project_id' => $this->project->id\n ]);\n // The project should be able to tell us what percentage of the overall time is remaining (90%)\n $percentage = (100 - $this->project->percentage_taken);\n $this->assertSame($this->project->percentage_remaining, $percentage);\n }" ]
[ "0.5764011", "0.57565916", "0.55694425", "0.5561926", "0.5517932", "0.54719764", "0.54611886", "0.5359197", "0.5357128", "0.53413886", "0.53340393", "0.5311622", "0.5305437", "0.5276466", "0.519984", "0.5177781", "0.5160432", "0.511939", "0.51152295", "0.50356656", "0.5014305", "0.50095767", "0.49994928", "0.49943358", "0.4979777", "0.49734288", "0.49660864", "0.49555007", "0.4950804", "0.4937575", "0.49304384", "0.49176404", "0.49172556", "0.49119586", "0.49040288", "0.48401144", "0.48382464", "0.48382464", "0.48164067", "0.4813386", "0.48107556", "0.48056236", "0.47998247", "0.479235", "0.47876778", "0.47772437", "0.47421518", "0.4730991", "0.47139376", "0.46924046", "0.46811453", "0.46750563", "0.4667622", "0.4663821", "0.46512327", "0.46454963", "0.45826274", "0.457805", "0.45508787", "0.4530978", "0.45293587", "0.45229053", "0.4519035", "0.44905582", "0.44864422", "0.4483718", "0.44821864", "0.44810265", "0.44810173", "0.44785863", "0.44703376", "0.44668975", "0.44619244", "0.44604793", "0.4457693", "0.4454747", "0.44446325", "0.4438945", "0.4437672", "0.44375253", "0.44333765", "0.44298515", "0.4424591", "0.4421792", "0.4417927", "0.44161224", "0.4407469", "0.44071043", "0.44053775", "0.4403118", "0.43977278", "0.4391575", "0.4390005", "0.43889728", "0.4387666", "0.4387489", "0.4384641", "0.43833715", "0.4374404", "0.43704394" ]
0.6367428
0
Update progress in project.
public static function updateProgress(int $id, float $estimatedWorkTime = 0, float $progressInHours = 0, ?int $callerId = null): array { $recordModel = Vtiger_Record_Model::getInstanceById($id); foreach (static::getChildren($id) as $child) { if ($callerId !== $child['id']) { $childEstimatedWorkTime = static::calculateEstimatedWorkTime($child['id']); $estimatedWorkTime += $childEstimatedWorkTime; $progressInHours += ($childEstimatedWorkTime * $child['progress'] / 100); } } static::calculateProgressOfMilestones($id, $estimatedWorkTime, $progressInHours); $projectProgress = $estimatedWorkTime ? round((100 * $progressInHours) / $estimatedWorkTime) : 0; $recordModel->set('progress', $projectProgress); $recordModel->set('estimated_work_time', $estimatedWorkTime); $recordModel->save(); if (!$recordModel->isEmpty('parentid') && $recordModel->get('parentid') !== $callerId) { static::updateProgress( $recordModel->get('parentid'), $estimatedWorkTime, $progressInHours, $id ); } return [ 'estimatedWorkTime' => $estimatedWorkTime, 'projectProgress' => $projectProgress ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateProjectProgress($projectId, $projectProgress)\n {\n $project = Tomproject::find()->where(['id' => $projectId])->one();\n if ($project->progress_bar < $projectProgress) {\n $project->progress_bar = $projectProgress;\n $project->save();\n }\n }", "public function updated(Project $project)\n {\n $this->createActivity($project,'project_updated');\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "function pm_update_complete($project, $version_control) {\n drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version'])));\n drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']]);\n $version_control->post_update($project);\n}", "public function inProgress()\n {\n $this->setStatus(self::STATUS_IN_PROGRESS);\n }", "abstract public function update(Project $project);", "public function progressTask()\n\t{\n\t\t// get request vars\n\t\t$id = Request::getInt('id', 0);\n\n\t\t// create import model object\n\t\t$import = Import::oneOrFail($id);\n\n\t\t// get the lastest run\n\t\t$run = $import->runs()\n\t\t\t->whereEquals('import_id', $import->get('id'))\n\t\t\t->ordered()\n\t\t\t->row();\n\n\t\t// build array of data to return\n\t\t$data = array(\n\t\t\t'processed' => $run->get('processed', 0),\n\t\t\t'total' => $run->get('count', 0)\n\t\t);\n\n\t\t// return progress update\n\t\techo json_encode($data);\n\t\texit();\n\t}", "public function updating()\n {\n # code...\n }", "public function updateStatus(int $projectId);", "public function updated(Project $project)\n {\n $changes =$this->getChanges($project);\n $project->recordActivity('updated',$changes);\n }", "public function update()\n {\n if (!isset($_GET['id']) || !isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n Project::update($_GET['id'], $_POST['name'], $_POST['creator']);\n\n $project = Project::find($_GET['id']);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "public function projectTaskStatusUpdate(){\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$parent_id = $post['pid'];\r\n\t\t$task_id = $post['tid'];\r\n\t\t$status_id = $post['stat'];\r\n\t\t$completed_time = gmdate('Y-m-d H:i:s');\r\n\r\n\t\t//$task = new Task();\r\n\t\t$data = array('status_id' => $status_id, 'completed_date'=>$completed_time);\r\n\t\t$this->db->where(\"parent_id\", $parent_id);\r\n\t\t$this->db->where(\"task_id\", $task_id);\r\n\t\t$this->db->update(\"sc_tasks\", $data);\r\n\r\n\t}", "protected function updateProjectProgress(Request $request)\n {\n // 1. Find the Service Request ID from the UUID\n $serviceRequest = \\App\\Models\\ServiceRequest::where('uuid', $request['service_request_uuid'])->firstOrFail();\n // 2. Find the Substatus selected \n $substatus = \\App\\Models\\SubStatus::where('uuid', $request['sub_status_uuid'])->firstOrFail();\n\n if ($substatus->phase === 9) {\n return $this->handleCompletedDiagnosis($request, $serviceRequest, $substatus);\n }\n\n // Check if Completed diagnosis, then transfer to Isaac Controller\n if ($request['intiate_rfq'] == 'yes') {\n $this->handleRFQ($request, $serviceRequest);\n }\n\n if ($request['intiate_trf'] == 'yes') {\n $this->handleToolsRequest($request, $serviceRequest);\n }\n\n\n $request->whenFilled('accept_materials', function () use ($request, $serviceRequest) {\n\n $this->handleMaterialsAcceptance($request, $serviceRequest);\n });\n\n return $this->updateDatabase($request->user(), $serviceRequest, $substatus);\n }", "public function updateParentProjectTaskPercentage()\n\t{\n\n\t\tif (empty($this->parent_task_id))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (!empty($this->project_id))\n\t\t{\n //determine parent task\n $parentProjectTask = $this->getProjectTaskParent();\n\n //get task children\n if ($parentProjectTask)\n {\n $subProjectTasks = $parentProjectTask->getAllSubProjectTasks();\n $tasks = array();\n foreach($subProjectTasks as &$task)\n {\n array_push($tasks, $task->toArray());\n }\n $parentProjectTask->percent_complete = $this->_calculateCompletePercent($tasks);\n unset($tasks);\n $parentProjectTask->save(isset($GLOBALS['check_notify']) ? $GLOBALS['check_notify'] : '');\n }\n\t\t}\n\t}", "public function update(Update $request,Progress $progress)\n {\n $progress->fill($request->all());\n\n if ($progress->save()) {\n \n session()->flash('app_message', 'Progress successfully updated');\n return redirect()->route('progress.index');\n } else {\n session()->flash('app_error', 'Something is wrong while updating Progress');\n }\n return redirect()->back();\n }", "public function update_status();", "public function progress() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n $data['current'] = str_replace('overview', 'play', $this->user->get_next_step());\n $this->load->view('account/progress', $data);\n }", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "public function updateFromProgram() {\n\t\t$prg = $this->getTrainingProgramme();\n\t\t$id = $this->getId();\n\t\t\n\t\t$prg->applyToSubTreeNodes(function($node) use ($id) {\n\t\t\t$progress = $node->getProgressForAssignment($id);\n\t\t\treturn $progress->updateFromProgramNode($prg);\n\t\t});\n\t}", "public function update($progress) {\n if ($this->isResolved) {\n throw new \\LogicException(\n \"Cannot update resolved promise\"\n );\n }\n\n $baseArgs = func_get_args();\n foreach ($this->watchers as $watcher) {\n $args = $baseArgs;\n $args[] = $watcher[1];\n \\call_user_func_array($watcher[0], $args);\n }\n }", "public function updateDailyProgress(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n QuestionUserHelper::createScheduledQuestionForUser($this->user);\n $this->user->daily_objective = $this->user->dailyQuestions()->count();\n $this->user->save();\n $this->user->updateDailyProgress();\n $expectedDailyProgress = 1;\n\n /** @var Question_user $artificiallyAnsweredQuestion */\n $artificiallyAnsweredQuestion = $this->user->dailyQuestions()->first();\n $artificiallyAnsweredQuestion = Question_user::query()->where('question_id', $artificiallyAnsweredQuestion->id)->first();\n $artificiallyAnsweredQuestion->next_question_at = Carbon::now()->addDay();\n $artificiallyAnsweredQuestion->save();\n\n\n $this->user->updateDailyProgress();\n $this->assertEquals($this->user->daily_progress, $expectedDailyProgress);\n }", "protected function _updateProjectsProgress(&$aProjects)\n {\n foreach ($aProjects as $aProject) {\n // Only recalculate for projects that are marked as dirty\n if ($aProject['DIRTY']) {\n $oProject = oxNew('\\Eurotext\\Translationmanager\\Model\\Project');\n $oProject->load($aProject['OXID']);\n $oProject->updateExportProgress();\n }\n }\n\n return;\n }", "public function progressing($unit, $data_progress) {\n\t\t$this->db->where('cc_unit', $unit)\n\t\t\t\t ->update('cc_program_overall', $data_progress);\n\t}", "public function update() {\r\n }", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function update() {\r\n\r\n\t}", "function updates($details_obj,$project){\n\t\t$project->all_versions = $details_obj->project->all_versions;\n\t\t$project->testVersion = $details_obj->project->testVersion;\n\t\t$project->pomPath = $details_obj->project->pomPath;\n\t\tif ($project->pomPath==\"\"){\n\t\t\t$str_tmp_pom_path = \"\";\n\t\t}else{\n\t\t\t$str_tmp_pom_path = \"\\\\\".$project->pomPath;\n\t\t}\n\t\t$project->full_pomPath = $project->userProjectRoot.\"\\\\\".$project->gitName.$str_tmp_pom_path;\n\t\t$project->issue_tracker_product_name = $details_obj->project->issue_tracker_product_name;\n\t\t$project->issue_tracker_url = $details_obj->project->issue_tracker_url;\n\t\t$project->issue_tracker = $details_obj->project->issue_tracker;\n\t\t$project->path_online = $project->runingRoot.\"\\\\path.txt\";\n\t\t$project = update_project_list($project,\"start_offline\",true);\n\t\tupdate_project_details($project);\n\t\treturn $project;\t\t\n\t}", "function update() {\n\n\t\t\t}", "public function updateProjectCounterCache() {\n\t\t$list = $this->Project->find('list');\n\t\t$projects = array_keys($list);\n\n\t\t$this->out('<warning>Updating ' . count($projects) . ' operation counts...</warning>', 0);\n\t\tif (!count($projects)) {\n\t\t\t$this->out('nothing to do.');\n\t\t\treturn;\n\t\t}\n\t\tif ($this->params['dry-run']) {\n\t\t\t$this->out('dry-run.. skipping.');\n\t\t\treturn;\n\t\t}\n\t\tforeach ($projects as $projectId) {\n\t\t\t$count = $this->Project->Operation->find('count', array('conditions' => array('Operation.project_id' => $projectId)));\n\t\t\t$project = array(\n\t\t\t\t'Project' => array(\n\t\t\t\t\t'id' => $projectId,\n\t\t\t\t\t'operation_count' => $count,\n\t\t\t\t\t'modified' => false,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (!$this->Project->save($project)) {\n\t\t\t\t$this->out('<error>Error saving count.</error>');\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->out('.', 0);\n\t\t\t}\n\t\t\tunset($project);\n\t\t}\n\t\t$this->out('done.');\n\t}", "public function updateIndex() {\n\t\t$projectsConfig = $this->api->getJSONConfig();\n\n\t\tforeach ( $projectsConfig as $project => $config ) {\n\t\t\t$projectsConfig[$project]['Updated'] = $this->api->getBotLastEditDate( $config['Report'] );\n\t\t}\n\n\t\t// Generate and return wikitext.\n\t\t$output = $this->twig->render( 'index.wikitext.twig', [\n\t\t\t'projects' => $projectsConfig,\n\t\t\t'configPage' => $this->api->getWikiConfig()['config'],\n\t\t] );\n\n\t\t$this->api->setText(\n\t\t\t$this->api->getWikiConfig()['index'],\n\t\t\t$output,\n\t\t\t$this->i18n->msg( 'edit-summary' )\n\t\t);\n\t}", "public function executeChangeStatusProjectForm()\n {\n $this->statusProjectList = StatusProjectPeer::getStatusProjectList();\n }", "public function update()\r\n {\r\n \r\n }", "public function update() {\n \n }", "public function update()\n {\n }", "public function update()\r\n {\r\n //\r\n }", "public function postCompleteProject(Request $request){\n $project=Project::where('id',$request['project_id'])->first();\n $project->project_status=2;\n $project->update();\n return redirect()->back();\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function update()\n {\n if ($this->getState()->getStatus() == View\\StateInterface::STATUS_IDLE) {\n try {\n $currentVersionId = $this->getChangelog()->getVersion();\n } catch (ChangelogTableNotExistsException $e) {\n return;\n }\n $lastVersionId = (int) $this->getState()->getVersionId();\n $action = $this->actionFactory->get($this->getActionClass());\n\n try {\n $this->getState()->setStatus(View\\StateInterface::STATUS_WORKING)->save();\n\n $versionBatchSize = self::$maxVersionQueryBatch;\n $batchSize = isset($this->changelogBatchSize[$this->getChangelog()->getViewId()])\n ? $this->changelogBatchSize[$this->getChangelog()->getViewId()]\n : self::DEFAULT_BATCH_SIZE;\n\n for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) {\n // Don't go past the current version for atomicy.\n $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize);\n $ids = $this->getChangelog()->getList($vsFrom, $versionTo);\n\n // We run the actual indexer in batches.\n // Chunked AFTER loading to avoid duplicates in separate chunks.\n $chunks = array_chunk($ids, $batchSize);\n foreach ($chunks as $ids) {\n $action->execute($ids);\n }\n }\n\n $this->getState()->loadByView($this->getId());\n $statusToRestore = $this->getState()->getStatus() == View\\StateInterface::STATUS_SUSPENDED\n ? View\\StateInterface::STATUS_SUSPENDED\n : View\\StateInterface::STATUS_IDLE;\n $this->getState()->setVersionId($currentVersionId)->setStatus($statusToRestore)->save();\n } catch (\\Exception $exception) {\n $this->getState()->loadByView($this->getId());\n $statusToRestore = $this->getState()->getStatus() == View\\StateInterface::STATUS_SUSPENDED\n ? View\\StateInterface::STATUS_SUSPENDED\n : View\\StateInterface::STATUS_IDLE;\n $this->getState()->setStatus($statusToRestore)->save();\n throw $exception;\n }\n }\n }", "public function updateStatusStart()\n {\n $this->resetStatuses();\n $this->pubDirectory->touch($this->getRelativeFilePath(self::IMPORT_STATUS_BUSY));\n }", "public function update(Request $request)\n {\n $user = \\Auth::user();\n $project = Project::find($request->session()->get('project_id'));\n $spk = Spk::find($request->id);\n $start_date = date_create($spk->start_date);\n $end_date = date_create($spk->finish_date);\n $interval = date_diff($start_date,$end_date);\n $hari = ( 30 * $interval->m ) + $interval->d;\n $minggu = ceil($hari / 7);\n $termin = $spk->termyn ; \n $termin_ke = \"\";\n $termin_id = \"\";\n foreach ($termin as $key => $value) {\n if ( $value->status == \"1\"){\n $termin_id = $value->id;\n $termin_ke = $value->termin;\n }\n }\n return view('progress::progress',compact(\"user\",\"project\",\"spk\",\"minggu\",\"termin_id\",\"termin_ke\"));\n }", "public function update();", "public function update();", "public function update();", "public function update();", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public static function update(){\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function update_progress_now($id_p){\n $this->db2->select('max(progress) as now_progress');\n $this->db2->from('progress_pekerjaan');\n $this->db2->where('pekerjaan',$id_p);\n $q = $this->db2->get()->row();\n $now = $q->now_progress;\n\n\n if ($now) {\n $now = $now;\n } else {\n $now = 9;\n }\n $this->db2->set('progress_now',$now);\n $this->db2->where('id', $id_p);\n $this->db2->update('pekerjaan');\n }", "private function showProgress()\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n $this->transformProgressList($allQuestions);\n\n $this->console->info( ' ************ Your progress is ************');\n\n foreach ($this->progress as $option) {\n $validate = $option['is_true'] ? __('True') : __('False');\n $this->console->info( ' Question: ' . $option['question']);\n if(null !== $option['is_true'])\n $this->console->info( ' Answer: ' . $option['answer'] . '('.$validate .')');\n $this->console->info( ' ');\n }\n $this->console->info( ' *******************************************');\n }", "protected function update() {}", "public function update(UpdateTaskProgressRequest $request, Task $task)\n {\n $task->updateProgress($request);\n return redirect(route('myTasks.index'));\n }", "function do_stuff($projectid, $description, $upload_dir)\n{\n global $uploads_dir, $projects_dir, $projects_url, $pguser;\n $res = mysql_query(\"\n SELECT state\n FROM projects\n WHERE projectid='$projectid'\n \") or die(mysql_error());\n list($old_state) = mysql_fetch_row($res);\n $new_state = 'F1.proj_unavail';\n if ($old_state != $new_state)\n {\n $mdate = time();\n $query = \"\n UPDATE projects SET state = '$new_state',\n modifieddate = '$mdate'\n WHERE projectid = '$projectid';\";\n $res = mysql_query($query) or die(mysql_error());\n log_project_event( $projectid, $pguser, 'transition', $old_state,\n $new_state, 'QC project finished P3');\n }\n\n $project_info_file = \"$uploads_dir/QCprojects/$upload_dir/project.info\";\n $new_info_file = \"$projects_dir/$projectid/project_info.txt\";\n if (copy($project_info_file, $new_info_file)) {\n echo \"\\n copied $project_info_file to $new_info_file\";\n }\n else {\n die(\"Couldn't copy $project_info_file to $new_info_file\");\n }\n\n echo \"\\n updating project comments\";\n $add_text = \"\\n<p>$description</p>\";\n $add_text .= \"\\n<p>Information about the source of the pages in this project is now available in <a href='$projects_url/$projectid/project_info.txt'>project_info.txt</a>. The first few lines give information about how the pages were selected. After that, there is one line per page, giving the png number in this project, the source project, and the png in the source project.</p>\";\n $add_text = addslashes($add_text);\n $query = \"UPDATE projects SET comments = CONCAT(comments, '$add_text') \n WHERE projectid = '$projectid' \";\n $res = mysql_query($query) or die(mysql_error());\n\n}", "public function progressFinish() {}", "public function mainRunnerProgress($evt){\n $data = $evt->data;\n if (key_exists('progress', $data)){\n $this->updateProgress(floor($data['progress']));\n }\n if (key_exists('message', $data)){\n $this->setMessage($data['message']);\n }\n\n// $progress = round($data['progress'], 2);\n// echo \"Progress {$progress}%: {$data['message']}\\r\\n<br>\\r\\n\";\n $this->save();\n }", "function updateProgress($id, $student, $course, $grade, $aim, $comment, $dates){\n\n\t\t$this->connection->query(\"UPDATE progress SET prog_course='$course', prog_grade='$grade', prog_aim='$aim', prog_comment='$comment', prog_date='$dates' WHERE id='$id' AND prog_student='$student'\",true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Student progress data Successfully updated\";\n\t\t}else{\n\t\t\treturn \"Failed to update Student progress data!\";\t\t\n\t\t}\t\n\n\t}", "function getProgress() ;", "public function setProgressNow(int $value)\n {\n $this->update(['progress_now' => $value]);\n }", "public function projectProgress($projectId)\n {\n $taskQuery = new Query();\n $taskQuery->select('id')\n ->from('tomtask')\n ->where('tomtask.project_id=:projectId', array(':projectId' => $projectId));\n\n $taskIds = $taskQuery->all();\n foreach ($taskIds as $taskId) {\n $this->taskPercentage(intval($taskId[\"id\"]));\n }\n $allTasks = $taskQuery->count();\n\n $completedTasks = new Query();\n $completedTasks->select('completed')\n ->from('tomtask')\n ->where('tomtask.project_id=:projectId AND tomtask.completed=1', array(':projectId' => $projectId));\n $countCompletedTasks = $completedTasks->count();\n\n $percentage = floor(($countCompletedTasks / $allTasks) * 100);\n $this->updateProjectProgress($projectId, $percentage);\n $duration = $this->getDuration($projectId);\n\n $percentageDurationPerProjectId = array($percentage, $duration);\n\n return $percentageDurationPerProjectId;\n }", "public function update()\n {\n # code...\n }", "public function update() {\n\t\treturn;\n\t}", "public function update() {\n parent::update();\n }", "public static function update(){\r\n }", "public function update () {\n\n }", "protected function UpdateProgress($action, $done=0, $total=0)\n\t{\n\t\tstatic $lastPercent;\n\t\tif($total > 0) {\n\t\t\t$percent = ceil($done/$total*100);\n\t\t}\n\t\telse {\n\t\t\t$percent = 100;\n\t\t}\n\t\t// We only show an updated progress bar if the rounded percentage has actually chanegd\n\t\tif($percent == $lastPercent) {\n\t\t\treturn;\n\t\t}\n\n\t\t$lastPercent = $percent;\n\t\t$action = sprintf($action, $done, $total);\n\t\techo \"<script type='text/javascript'>\\n\";\n\t\techo sprintf(\"self.parent.UpdateProgress('%s', '%s');\", str_replace(array(\"\\n\", \"\\r\", \"'\"), array(\" \", \"\", \"\\\\'\"), $action), $percent);\n\t\techo \"</script>\";\n\t\tflush();\n\t}", "public function getProgress();", "public function update()\n\t{\n\n\t}", "function show_migrate_multisite_files_progress( $current, $total ) {\n echo \"<span style='position: absolute;z-index:$current;background:#F1F1F1;'>Parsing Blog \" . $current . ' - ' . round($current / $total * 100) . \"% Complete</span>\";\n echo(str_repeat(' ', 256));\n if (@ob_get_contents()) {\n @ob_end_flush();\n }\n flush();\n}", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "function upgradeProjectSummaries() {\n try {\n $projects_table = TABLE_PREFIX . 'projects';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating project summaries @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, overview FROM $projects_table\");\n if($rows) {\n foreach($rows as $row) {\n if($row['overview']) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('Project', ?, ?)\", $row['id'], $row['overview']);\n DB::execute(\"UPDATE $projects_table SET overview = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['overview']));\n } // if\n } // foreach\n } // if\n\n DB::commit('Project summaries updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update project summaries @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "function drush_pm_updatestatus() {\n // We don't provide for other options here, so we supply an explicit path.\n drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');\n\n // Get specific requests.\n $requests = pm_parse_arguments(func_get_args(), FALSE);\n\n // Get installed extensions and projects.\n $extensions = drush_get_extensions();\n $projects = drush_get_projects($extensions);\n\n // Parse out project name and version.\n $requests = pm_parse_project_version($requests, $projects);\n\n $update_info = _pm_get_update_info($projects);\n\n foreach ($extensions as $name => $extension) {\n // Add an item to $update_info for each enabled extension which was obtained\n // from cvs or git and its project is unknown (because of cvs_deploy or\n // git_deploy is not enabled).\n if (!isset($extension->info['project'])) {\n if ((isset($extension->vcs)) && ($extension->status)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $extension->label,\n 'existing_version' => 'Unknown',\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED,\n 'status_msg' => dt('Project was not packaged by drupal.org but obtained from !vcs. You need to enable !vcs_deploy module', array('!vcs' => $extension->vcs)),\n );\n // The user may have requested to update a project matching this\n // extension. If it was by coincidence or error we don't mind as we've\n // already added an item to $update_info. Just clean up $requests.\n if (isset($requests[$name])) {\n unset($requests[$name]);\n }\n }\n }\n // Additionally if the extension name is distinct to the project name and\n // the user asked to update the extension, fix the request.\n elseif ((isset($requests[$name])) && ($extension->name != $extension->info['project'])) {\n $requests[$extension->info['project']] = $requests[$name];\n unset($requests[$name]);\n }\n }\n // If specific project updates were requested then remove releases for all\n // others.\n $requested = func_get_args();\n if (!empty($requested)) {\n foreach ($update_info as $name => $project) {\n if (!isset($requests[$name])) {\n unset($update_info[$name]);\n }\n }\n }\n // Add an item to $update_info for each request not present in $update_info.\n foreach ($requests as $name => $request) {\n if (!isset($update_info[$name])) {\n // Disabled projects.\n if ((isset($projects[$name])) && ($projects[$name]['status'] == 0)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $projects[$name]['label'],\n 'existing_version' => $projects[$name]['version'],\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE,\n );\n unset($requests[$name]);\n }\n // At this point we are unable to find matching installed project.\n // It does not exist at all or it is misspelled,...\n else {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $name,\n 'existing_version' => 'Unknown',\n 'status'=> DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND,\n );\n }\n }\n }\n\n // If specific versions were requested, match the requested release.\n foreach ($requests as $name => $request) {\n if (!empty($request['version'])) {\n $release = pm_get_release($request, $update_info[$name]);\n if (!$release) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_VERSION_NOT_FOUND;\n }\n else if ($release['version'] == $update_info[$name]['existing_version']) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_CURRENT;\n }\n else {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_UPDATE;\n }\n // Set the candidate version to the requested release.\n $update_info[$name]['candidate_version'] = $release['version'];\n }\n }\n // Process locks specified on the command line.\n $locked_list = drush_pm_update_lock($update_info, drush_get_option_list('lock'), drush_get_option_list('unlock'), drush_get_option('lock-message'));\n\n // Build project updatable messages, set candidate version and mark\n // 'updatable' in the project.\n foreach ($update_info as $key => $project) {\n switch($project['status']) {\n case DRUSH_PM_REQUESTED_UPDATE:\n $status = dt('Specified version available');\n $project['updateable'] = TRUE;\n break;\n case DRUSH_PM_REQUESTED_CURRENT:\n $status = dt('Specified version already installed');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED:\n $status = $project['status_msg'];\n break;\n case DRUSH_PM_REQUESTED_VERSION_NOT_FOUND:\n $status = dt('Specified version not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND:\n $status = dt('Specified project not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE:\n $status = dt('Project has no enabled extensions and can\\'t be updated');\n break;\n default:\n // This can set $project['updateable'] and $project['candidate_version']\n $status = pm_update_filter($project);\n break;\n }\n\n if (isset($project['locked'])) {\n $status = $project['locked'] . \" ($status)\";\n }\n // Persist candidate_version in $update_info (plural).\n if (empty($project['candidate_version'])) {\n $update_info[$key]['candidate_version'] = $project['existing_version']; // Default to no change\n }\n else {\n $update_info[$key]['candidate_version'] = $project['candidate_version'];\n }\n $update_info[$key]['status_msg'] = $status;\n if (isset($project['updateable'])) {\n $update_info[$key]['updateable'] = $project['updateable'];\n }\n }\n\n // Only list projects that have updates available. Use pm-list if you want more info.\n $updateable = pm_project_filter($update_info, drush_get_option('security-only'));\n return $updateable;\n}", "private function progress(): void\n {\n if ($this->generator && $this->generator->valid() && !$this->saved) {\n $this->entries[] = [$this->generator->key(), $this->generator->current()];\n $this->saved = true;\n }\n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function massStatusAction()\n {\n $curriculumdocIds = $this->getRequest()->getParam('curriculumdoc');\n if (!is_array($curriculumdocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Please select curriculum docs.')\n );\n } else {\n try {\n foreach ($curriculumdocIds as $curriculumdocId) {\n $curriculumdoc = Mage::getSingleton('bs_curriculumdoc/curriculumdoc')->load($curriculumdocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d curriculum docs were successfully updated.', count($curriculumdocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was an error updating curriculum docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function progressAction(){\n $groupID = $this->_request->getParam('g');\n \n $group_DB = new Application_Model_DbTable_Group();\n $groupName = $group_DB->getName($groupID);\n $this->view->group_name = $groupName;\n \n $plans_DB = new Application_Model_DbTable_Planing();\n if (!isset($_SESSION['Default']['field'])) {\n $this->view->field_error = true;\n } else {\n $plans = $plans_DB->getByGroup ($groupID, $_SESSION['Default']['field']);\n $this->view->plans = $plans;\n\n $this->view->groupID = $groupID;\n }\n }", "public function progressAction()\n {\n if (!$this->getRequest()->isXmlHttpRequest()) {\n throw new Zend_Controller_Request_Exception('Not an AJAX request detected');\n }\n\n $uploadId = $this->getRequest()->getParam('id');\n\n // this is the function that actually reads the status of uploading\n $data = uploadprogress_get_info($uploadId);\n\n $bytesTotal = $bytesUploaded = 0;\n\n if (null !== $data) {\n $bytesTotal = $data['bytes_total'];\n $bytesUploaded = $data['bytes_uploaded'];\n }\n\n $adapter = new Zend_ProgressBar_Adapter_JsPull();\n $progressBar = new Zend_ProgressBar($adapter, 0, $bytesTotal, 'uploadProgress');\n\n if ($bytesTotal === $bytesUploaded) {\n $progressBar->finish();\n } else {\n $progressBar->update($bytesUploaded);\n }\n }", "public function updating(Project $project)\n {\n if(!$project){\n return back()->withInput()->with('errors', 'Error Updating the Project');\n }\n\n }", "public function run()\n {\n $status = new ProjectStatus();\n $status->alias = 'new';\n $status->name = 'NEW';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'pending';\n $status->name = 'PENDING';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'failed';\n $status->name = 'FAILED';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'done';\n $status->name = 'DONE';\n $status->save();\n }", "protected function updateProgress(): JsonResponse\n {\n $user = Auth::user();\n if ($user) {\n if ($user->last_daily_updated_at === null || !now()->isSameDay($user->last_daily_updated_at)) {\n $user->last_daily_updated_at = now();\n $user->daily_objective = $user->dailyQuestions()->count();\n $user->daily_progress = 0;\n $user->save();\n }\n\n return response()->json([\n 'userProgress' => $user->dailyProgress(),\n 'userMentalProgress' => $user->dailyMentalQuestions()->count(),\n 'statistics' => $user->statistics,\n ]);\n }\n }", "public function executeStatusProject()\n {\n $this->statusProjectList = StatusProjectPeer::getStatusProjectListCounted(); \n if($this->getRequest()->getParameter('status')){\n $this->status_select = $this->getRequest()->getParameter('status');\n }else{\n $this->status_select = $this->getUser()->getAttribute('status','all','project/list'); \n }\n\n //add nb total project\n $total_nb_project = 0;\n foreach($this->statusProjectList as $status)\n {\n $total_nb_project += $status['nb'];\n }\n $this->total_nb_project = $total_nb_project;\n \n //add nb active project\n $c = new Criteria();\n $c->addJoin(StatusProjectPeer::ID, ProjectPeer::STATUS_PROJECT_ID);\n $c->add(StatusProjectPeer::POSITION, 200, Criteria::LESS_THAN);\n MagentaAccessRestrictions::applyFilterSecurityProject($c); \n $this->active_nb_project = ProjectPeer::doCount($c);\n \n }", "public function testUpdateTask()\n {\n }", "public function updateStatus(array $jobs);", "public function update(): void\n {\n }", "public function massStatusAction()\n {\n $coursedocIds = $this->getRequest()->getParam('coursedoc');\n if (!is_array($coursedocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Please select course docs.')\n );\n } else {\n try {\n foreach ($coursedocIds as $coursedocId) {\n $coursedoc = Mage::getSingleton('bs_coursedoc/coursedoc')->load($coursedocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d course docs were successfully updated.', count($coursedocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was an error updating course docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "protected function performUpdate() {}", "public function updateStatistic()\n {\n /**\n * @var array Array of tasks for current project\n */\n $list = array();\n /**\n * @var array Key-value array of project_task_id => parent_task_id\n */\n $tree = array();\n /**\n * @var array Array with nodes which have childrens\n */\n $nodes = array();\n /**\n * @var array Array with IDs of list which have been changed\n */\n $changed = array();\n\n $db = DBManagerFactory::getInstance();\n $this->disable_row_level_security = true;\n $query = $this->create_new_list_query('', \"project_id = {$db->quoted($this->project_id)}\");\n $this->disable_row_level_security = false;\n $res = $db->query($query);\n while($row = $db->fetchByAssoc($res))\n {\n array_push($list, $row);\n }\n // fill in $tree\n foreach($list as $k => &$v)\n {\n if(isset($v['project_task_id']) && $v['project_task_id'] != '')\n {\n $tree[$v['project_task_id']] = $v['parent_task_id'];\n if(isset($v['parent_task_id']) && $v['parent_task_id'])\n {\n if(!isset($nodes[$v['parent_task_id']]))\n {\n $nodes[$v['parent_task_id']] = 1;\n }\n }\n }\n }\n unset($v);\n // fill in $nodes array\n foreach($nodes as $k => &$v)\n {\n $run = true;\n $i = $k;\n while($run)\n {\n if(isset($tree[$i]) && $tree[$i]!= '')\n {\n $i = $tree[$i];\n $v++;\n }\n else\n {\n $run = false;\n }\n }\n }\n arsort($nodes);\n unset($v);\n // calculating of percentages and comparing calculated value with database one\n foreach($nodes as $k => &$v)\n {\n $currRow = null;\n $currChildren = array();\n $run = true;\n $tmp = array();\n $i = $k;\n while($run)\n {\n foreach($list as $id => &$taskRow)\n {\n if($taskRow['project_task_id'] == $i && $currRow === null)\n {\n $currRow = $id;\n }\n if($taskRow['parent_task_id'] == $i)\n {\n if(!in_array($taskRow['project_task_id'], array_keys($nodes)))\n {\n array_push($currChildren, $taskRow);\n }\n else\n {\n array_push($tmp, $taskRow['project_task_id']);\n }\n }\n }\n unset($taskRow);\n if(count($tmp) == 0)\n {\n $run = false;\n }\n else\n {\n $i = array_shift($tmp);\n }\n }\n $subres = $this->_calculateCompletePercent($currChildren);\n if($subres != $list[$currRow]['percent_complete'])\n {\n $list[$currRow]['percent_complete'] = $subres;\n array_push($changed, $currRow);\n }\n }\n unset($v);\n // updating data in database for changed tasks\n foreach($changed as $k => &$v)\n {\n $task = BeanFactory::newBean('ProjectTask');\n $task->populateFromRow($list[$v]);\n $task->skipParentUpdate();\n $task->save(false);\n }\n }", "public function updateStatusFinish()\n {\n $this->resetStatuses();\n }", "public function update() {\n\t\t$data = Server::get_instance(CONF_ENGINE_SERVER_URL)->\n\t\t\tget_science_project_data($this->uid, $this->sc_id);\n\t\tif (!$data)\n\t\t\treturn false;\n\n\t\t$this->init_from_data($data);\n\t}" ]
[ "0.6974844", "0.6939961", "0.64752346", "0.64355856", "0.64136857", "0.63809067", "0.6366779", "0.6332696", "0.63171774", "0.62686294", "0.6258832", "0.6210513", "0.6194052", "0.6184844", "0.61649466", "0.61467254", "0.61283517", "0.6116889", "0.6100441", "0.6031681", "0.59951496", "0.5967885", "0.594445", "0.5941924", "0.59281963", "0.59278667", "0.59277934", "0.59180194", "0.59095216", "0.5900999", "0.5889863", "0.58674735", "0.58668876", "0.5847463", "0.5847151", "0.5841534", "0.5820017", "0.5820017", "0.5816752", "0.58144194", "0.5814121", "0.57956624", "0.57956624", "0.57956624", "0.57956624", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.5789578", "0.57835174", "0.5782498", "0.5782498", "0.578232", "0.5770275", "0.5766393", "0.57662547", "0.5765419", "0.5764278", "0.575919", "0.57548755", "0.5738435", "0.5734898", "0.5734043", "0.57243425", "0.57225615", "0.5715876", "0.5714062", "0.5701943", "0.5694137", "0.5689396", "0.56796503", "0.5669009", "0.5660019", "0.5659631", "0.5657736", "0.5657593", "0.5636041", "0.5636041", "0.5635963", "0.563174", "0.5628001", "0.5620827", "0.5620163", "0.5619164", "0.56055665", "0.55971956", "0.5592391", "0.5587531", "0.5578251", "0.55697787", "0.5556349", "0.5552417", "0.5546404" ]
0.0
-1
$code = str_replace('', '%20', $code);
public function getProductByCode($code) { //echo $code; $product = $this->Product->getProductByCode($code); $json = json_encode($product); $this->set(compact('json')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_code(&$code)\n\n{\n\n $code .= \"\\n\";\n\n \n\n // code not allowed to contain our special characters\n\n return ($code = strtr($code, array(\"\\x00\" => '', \"\\x01\" => '')));\n\n}", "function raw_u($string=\"\"){\r\n //\"?\"前部分语句 空格 = %20\r\n return rawurlencode($string);\r\n}", "function fixPercent($var)\n\t{\n\t\t$var = str_replace(\"%20\",\" \",$var);\n\t\treturn $var;\n\t\t\n\t}", "function encode_code39_ext($code) {\n\n $encode = array(\n chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', \n chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', \n chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K', \n chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', \n chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', \n chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', \n chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', \n chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', \n chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', \n chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', \n chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', \n chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', \n chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', \n chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', \n chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', \n chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', \n chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', \n chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', \n chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', \n chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', \n chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', \n chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', \n chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', \n chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', \n chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', \n chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', \n chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', \n chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', \n chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', \n chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', \n chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', \n chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');\n\n $code_ext = '';\n for ($i = 0 ; $i<strlen($code); $i++) {\n if (ord($code[$i]) > 127)\n $this->Error('Invalid character: '.$code[$i]);\n $code_ext .= $encode[$code[$i]];\n }\n return $code_ext;\n}", "function urlsafe_encode($input)\n\t{\n\t\treturn str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));\n\t}", "function rawurlencode_spaces( $url ) {\n\t\treturn str_replace( ' ', rawurlencode( ' ' ), $url );\n\t}", "function fixUrl($str){\n return urlencode($str);\n}", "function encode_code39_ext($code) {\n\n\t $encode = array(\n\t chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',\n\t chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',\n\t chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => 'ŁK',\n\t chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',\n\t chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',\n\t chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',\n\t chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',\n\t chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',\n\t chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',\n\t chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',\n\t chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',\n\t chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',\n\t chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',\n\t chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',\n\t chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',\n\t chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',\n\t chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',\n\t chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',\n\t chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',\n\t chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',\n\t chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',\n\t chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',\n\t chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',\n\t chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',\n\t chr(96) => '%W', chr(97) => 'A', chr(98) => 'B', chr(99) => 'C',\n\t chr(100) => 'D', chr(101) => 'E', chr(102) => 'F', chr(103) => 'G',\n\t chr(104) => 'H', chr(105) => 'I', chr(106) => 'J', chr(107) => 'K',\n\t chr(108) => 'L', chr(109) => 'M', chr(110) => 'N', chr(111) => 'O',\n\t chr(112) => 'P', chr(113) => 'Q', chr(114) => 'R', chr(115) => 'S',\n\t chr(116) => 'T', chr(117) => 'U', chr(118) => 'V', chr(119) => 'W',\n\t chr(120) => 'X', chr(121) => 'Y', chr(122) => 'Z', chr(123) => '%P',\n\t chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');\n\n\t $code_ext = '';\n\t for ($i = 0 ; $i<strlen($code); $i++) {\n\t if (ord($code{$i}) > 127)\n\t $this->Error('Invalid character: '.$code{$i});\n\t $code_ext .= $encode[$code{$i}];\n\t }\n\t return $code_ext;\n\t}", "function decode($string){ \n $nopermitidos = array(\"'\",'\\\\','<','>',\"\\\"\",\"%\");\n $string = str_replace(\" \",\"\",$string);\n $string = str_replace($nopermitidos, \"\", $string);\n return $string;\n}", "function cleanVal ($val)\n{\n return encodeURI($val);\n}", "function insert_affiliate_code($code, $article_str)\n{\n\treturn str_replace(\"=CODE=\", \"/r/\".$code, $article_str);\n}", "function linkencode1($str)\n{\n\t// for php < 4.1.0\n\t$str=ereg_replace(\" \",\"%20\",$str);\n\t$str=ereg_replace(\"&\",\"%26\",$str);\n\t$str=ereg_replace(\"\\+\",\"%2b\",$str);\n\t$str=ereg_replace(\"ü\",\"%fc\",$str);\n\t$str=ereg_replace(\"Ü\",\"%dc\",$str);\n\n\treturn $str;\n}", "function encodeWebSafeString($string)\n {\n return str_replace(['+', '/'], ['-', '_'], $string);\n }", "function clean_encode_message($yourmessage)\n{\n\n require_once('class.UBBCodeN.php');\n $myUBB = new UBBCodeN();\n\n $yourmessage = $myUBB->encode($yourmessage);\n\n // $yourmessage = str_replace('\"','&#34;', $yourmessage);\n $yourmessage = entify_nonprinting_chars($yourmessage);\n\n return $yourmessage;\n}", "public static function encode($url) {\t\t\t\n\t\t\t$reserved = array(\n\t\t\t\t\t\":\" => '!%3A!ui',\n\t\t\t\t\t\"/\" => '!%2F!ui',\n\t\t\t\t\t\"?\" => '!%3F!ui',\n\t\t\t\t\t\"#\" => '!%23!ui',\n\t\t\t\t\t\"[\" => '!%5B!ui',\n\t\t\t\t\t\"]\" => '!%5D!ui',\n\t\t\t\t\t\"@\" => '!%40!ui',\n\t\t\t\t\t\"!\" => '!%21!ui',\n\t\t\t\t\t\"$\" => '!%24!ui',\n\t\t\t\t\t\"&\" => '!%26!ui',\n\t\t\t\t\t\"'\" => '!%27!ui',\n\t\t\t\t\t\"(\" => '!%28!ui',\n\t\t\t\t\t\")\" => '!%29!ui',\n\t\t\t\t\t\"*\" => '!%2A!ui',\n\t\t\t\t\t\"+\" => '!%2B!ui',\n\t\t\t\t\t\",\" => '!%2C!ui',\n\t\t\t\t\t\";\" => '!%3B!ui',\n\t\t\t\t\t\"=\" => '!%3D!ui',\n\t\t\t\t\t\"%\" => '!%25!ui',\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$url = rawurlencode(utf8_encode($url));\n\t\t\t$url = preg_replace(array_values($reserved), array_keys($reserved), $url);\n\t\t\t\t\n\t\t\treturn $url;\n\t\t}", "function cms_rawurlrecode($url, $force = false, $tolerate_errors = false)\n{\n if ((cms_mb_strlen($url) > 255) || ($force)) {\n require_code('urls_simplifier');\n $url = _cms_rawurlrecode($url, $tolerate_errors);\n }\n\n return $url;\n}", "function remove_non_coding_prot($seq) {\r\n // change the sequence to upper case\r\n $seq=strtoupper($seq);\r\n // remove non-coding characters([^ARNDCEQGHILKMFPSTWYVX\\*])\r\n $seq = preg_replace (\"([^ARNDCEQGHILKMFPSTWYVX\\*])\", \"\", $seq);\r\n return $seq;\r\n}", "function cleanUrl($text) {\r\n $text = strtolower($text);\r\n $code_entities_match = array('&quot;', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '{', '}', '|', ':', '\"', '<', '>', '?', '[', ']', '', ';', \"'\", ',', '.', '_', '/', '*', '+', '~', '`', '=', ' ', '---', '--', '--', '�');\r\n $code_entities_replace = array('', '-', '-', '', '', '', '-', '-', '', '', '', '', '', '', '', '-', '', '', '', '', '', '', '', '', '', '-', '', '-', '-', '', '', '', '', '', '-', '-', '-', '-');\r\n $text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n return $text;\r\n}", "function url_encode($text)\n {\n return rtrim(strtr(base64_encode($text), '+/', '-_'), '=');\n }", "function convertheader($value){\r\n\t$aux = \"\";\r\n\tfor($i = 0; $i < strlen($value); $i++){\r\n\t\t$char = substr($value, $i, 1);\r\n\t\tswitch($char){\r\n\t\t\tcase \"&\": $aux .= \"%26\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%\": $aux .= \"%25\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"'\": $aux .= \"%27\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '\"': $aux .= \"%22\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault : $aux .= $char;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn $aux;\r\n}", "function decodeUrlSafe(String $data)\n\t{\n\n\t\t$data = strtr(\n\t\t\t$data,\n\t\t\t'-_~',\n\t\t\t'+/='\n\t\t);\n\n\t\treturn decode($data);\n\n\t}", "function noAscii($string) {\n $string = str_replace(\"+\", \" \", $string);\n $string = str_replace(\"%21\", \"!\", $string);\n $string = str_replace(\"%22\", '\"', $string);\n $string = str_replace(\"%23\", \"#\", $string);\n $string = str_replace(\"%24\", \"$\", $string);\n $string = str_replace(\"%25\", \"%\", $string);\n $string = str_replace(\"%26\", \"&\", $string);\n $string = str_replace(\"%27\", \"'\", $string);\n $string = str_replace(\"%28\", \"(\", $string);\n $string = str_replace(\"%29\", \")\", $string);\n $string = str_replace(\"%2A\", \"*\", $string);\n $string = str_replace(\"%2B\", \"+\", $string);\n $string = str_replace(\"%2C\", \",\", $string);\n $string = str_replace(\"%2D\", \"-\", $string);\n $string = str_replace(\"%2E\", \".\", $string);\n $string = str_replace(\"%2F\", \"/\", $string);\n $string = str_replace(\"%3A\", \":\", $string);\n $string = str_replace(\"%3B\", \";\", $string);\n $string = str_replace(\"%3C\", \"<\", $string);\n $string = str_replace(\"%3D\", \"=\", $string);\n $string = str_replace(\"%3E\", \">\", $string);\n $string = str_replace(\"%3F\", \"?\", $string);\n $string = str_replace(\"%40\", \"@\", $string);\n $string = str_replace(\"%5B\", \"[\", $string);\n $string = str_replace(\"%5C\", \"\\\\\", $string);\n $string = str_replace(\"%5D\", \"]\", $string);\n $string = str_replace(\"%5E\", \"^\", $string);\n $string = str_replace(\"%5F\", \"_\", $string);\n $string = str_replace(\"%60\", \"`\", $string);\n $string = str_replace(\"%7B\", \"{\", $string);\n $string = str_replace(\"%7C\", \"|\", $string);\n $string = str_replace(\"%7D\", \"}\", $string);\n $string = str_replace(\"%7E\", \"~\", $string);\n $string = str_replace(\"%7F\", \"\", $string);\n return $string;\n}", "public static function rawurlencode($value) {\n return strtr(rawurlencode($value), array('%7E' => '~', '+' => ' '));\n }", "function mr_url($string) { \n\t$find = Array(\"Á\",\"Č\",\"Ď\",\"É\",\"Ě\",\"Í\",\"Ň\",\"Ó\",\"Ř\",\"Š\",\"Ť\",\"Ú\",\"Ů\",\"Ý\",\"Ž\", \"á\", \"č\", \"ď\", \"é\", \"ě\", \"í\", \"ľ\", \"ň\", \"ó\", \"ř\", \"š\", \"ť\", \"ú\", \"ů\", \"ý\", \"ž\", \"_\", \" - \", \" \", \".\", \"ü\", \"ä\", \"ö\"); \n\t$replace = Array(\"a\",\"c\",\"d\",\"e\",\"e\",\"i\",\"n\",\"o\",\"r\",\"s\",\"t\",\"u\",\"u\",\"y\",\"z\", \"a\", \"c\", \"d\", \"e\", \"e\", \"i\", \"l\", \"n\", \"o\", \"r\", \"s\", \"t\", \"u\", \"u\", \"y\", \"z\", \"\", \"-\", \"-\", \"-\", \"u\", \"a\", \"o\"); \n\t$string = preg_replace(\"~%[0-9ABCDEF]{2}~\", \"\", urlencode(str_replace($find, $replace, mb_strtolower($string)))); \n\treturn $string; \n}", "function clean_url($url) {\n\n global $globals;\n\n //Remove the AEF Session Code - Also there in parse_br function\n $url = preg_replace('/(\\?|&amp;|;|&)(as=[\\w]{32})(&amp;|;|&|$)?/is', '$1$3', $url);\n\n return $url;\n}", "protected function _urlencode($value) {\n return rawurlencode($value);\n //Amazon suggests doing this, but it seems to break things rather than fix them:\n //return str_replace('%7E', '~', rawurlencode($value));\n }", "function raw_u($string=\"\") {\n\t\treturn rawurlencode($string);\n\t}", "function clean_url($text)\n\t\t{\n\t\t\t$text=strtolower($text);\n\t\t\t$code_entities_match = array(' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','\"','<','>','?','[',']','\\\\',';',\"'\",',','.','/','*','+','~','`','=');\n\t\t\t$code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');\n\t\t\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\n\t\t\treturn $text;\n\t\t}", "function encodeUrlSafe(String $data)\n\t{\n\n\t\t$encoded = encode($data);\n\n\t\treturn strtr(\n\t\t\t$encoded,\n\t\t\t'+/=',\n\t\t\t'-_~'\n\t\t);\n\n\t}", "function sanitize_urlencode($value)\n{\n return filter_var($value, FILTER_SANITIZE_ENCODED);\n}", "function replace_curl($string){\n $string = str_replace(\"~\", \"'\", $string);\n return $string;\n}", "function kc_encode_path($path) {\n return str_replace('%2F', '/', rawurlencode($path));\n}", "function urlsafeB64Encode(string $input)\n\t{\n\t\treturn str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));\n\t}", "private function encodeUrl($url)\n {\n \treturn $url;\n \t#return rawurlencode($url);\n }", "function urlencode_1738_plus($url) {\n\t$uri = '';\n\n\t# nom de domaine accentué ?\n\tif (preg_match(',^https?://[^/]*,u', $url, $r)) {\n\t\t\n\t}\n\n\t$l = strlen($url);\n\tfor ($i=0; $i < $l; $i++) {\n\t\t$u = ord($a = $url[$i]);\n\t\tif ($u <= 0x20 OR $u >= 0x7F OR in_array($a, array(\"'\",'\"')))\n\t\t\t$a = rawurlencode($a);\n\t\t// le % depend : s'il est suivi d'un code hex, ou pas\n\t\tif ($a == '%'\n\t\tAND !preg_match('/^[0-9a-f][0-9a-f]$/i', $url[$i+1].$url[$i+2]))\n\t\t\t$a = rawurlencode($a);\n\t\t$uri .= $a;\n\t}\n\treturn quote_amp($uri);\n}", "public static function lowerUrlencode($str)\n {\n return preg_replace_callback('/%[0-9A-F]{2}/',\n function (array $matches) {\n\t\t\t\treturn strtolower($matches[0]);\n }, urlencode($str));\n }", "function decodeWebSafeString($string)\n {\n return str_replace(['-', '_'], ['+', '/'], $string);\n }", "function urlsafe_decode($input)\n\t{\n\t\t$remainder = strlen($input) % 4;\n\t\tif ($remainder) {\n\t\t\t$padlen = 4 - $remainder;\n\t\t\t$input .= str_repeat('=', $padlen);\n\t\t}\n\t\treturn base64_decode(strtr($input, '-_', '+/'));\n\t}", "function urlencode_album($album) {\n\treturn preg_replace(\"/%2F/\", \"/\", urlencode($album));\n}", "function strip_File($FileName) {\n\t//$arrItems = array(\" \", \"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"(\",\")\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$arrItems = array(\"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$FileName = str_replace($arrItems, \"_\", $FileName);\n\t$FileName = urldecode($FileName);\n\t$FileName = str_replace(\"%\", \"_\", $FileName);\n\treturn $FileName;\n}", "function url_encode($component) {\n $base_encoded = urlencode($component);\n $replacement = [\n '%3A' => ':',\n '%2C' => ',',\n '+' => '%20',\n ];\n return strtr($base_encoded, $replacement);\n}", "function _strencode($str) {\n\t\treturn str_replace( \"'\", \"''\", $str );\n\t}", "function trimData($data) {\n $data = trim($data);\n $data = urlencode($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function safeURL ($text) {\n\t//WARNING: this does not sanitise against HTML, it’s assumed text is passed through `safeHTML` before output\n\treturn str_replace ('%2F', '/', rawurlencode ($text));\n}", "function url_encode($data, $pad = null) {\ninclude 'setting.php';\nif($sn==''){\n\t$snx ='QWERTYUIOPASDFGHJKL';\n}else{\n\t$snx = $sn;\n}\n $data = str_replace(array('+', '/'), array('-', '_'), base64_encode($data));\n if (!$pad) {\n $data = rtrim($data, '=');\n }\n return $data.$snx;\n}", "function encode($input)\n{\n\tif(STRIPSLASHES)\n\t\t$input = stripslashes($input);\n\n\treturn urlencode(htmlspecialchars($input));\n}", "function prepare_code($text) {\n $replace = array( '\\\"' => '&#34;','\"' => '&#34;', '<' => '&lt;', '>' => '&gt;', \"\\'\" => '&#39;', \"'\" => '&#39;' );\n return str_replace(array_keys($replace), array_values($replace),$text);\n}", "public function decodeUriSafe( string $value ): string;", "function cleanStringUrl($cadena){\n\t\t$cadena = strtolower($cadena);\n\t\t$cadena = trim($cadena);\n\t\t$cadena = strtr($cadena,\n\t\t\t\t\t\t\t\t\"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ\",\n\t\t\t\t\t\t\t\t\"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn\");\n\t\t$cadena = strtr($cadena,\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"abcdefghijklmnopqrstuvwxyz\");\n\t\t$cadena = preg_replace('#([^.a-z0-9]+)#i', '-', $cadena);\n\t\t$cadena = preg_replace('#-{2,}#','-',$cadena);\n \t$cadena = preg_replace('#-$#','',$cadena);\n \t\t$cadena = preg_replace('#^-#','',$cadena);\n\t\treturn $cadena;\n\t}", "function base64_url_encode($input)\n{\nreturn strtr(base64_encode($input), '+/=', '-_,');\n}", "function base64_url_decode($input)\n{\nreturn base64_decode(strtr($input, '-_,', '+/='));\n}", "private function decodeUrl($url)\n {\n \treturn $url;\n \t#return str_replace(array('&amp;', '&#38;'), '&', rawurldecode($url));\n }", "function urlFormat($str) {\n // strip all the evil white spaces\n $str = preg_replace('/\\s*/', '', $str);\n // lowercase the string\n $str = strtolower($str);\n // encode the url to help fight the bad guys.. and maybe you..\n $str = urlencode($str);\n return $str;\n}", "private function urlencode($text) {\n\t\treturn urlencode(str_replace('/', '%2f', $text));\n\t}", "function remove_invisible_characters($str, $url_encoded = TRUE) {\n $non_displayables = array();\n\n // every control character except newline (dec 10)\n // carriage return (dec 13), and horizontal tab (dec 09)\n\n if ($url_encoded) {\n $non_displayables[] = '/%0[0-8bcef]/'; // url encoded 00-08, 11, 12, 14, 15\n $non_displayables[] = '/%1[0-9a-f]/'; // url encoded 16-31\n }\n\n $non_displayables[] = '/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]+/S'; // 00-08, 11, 12, 14-31, 127\n\n do {\n $str = preg_replace($non_displayables, '', $str, -1, $count);\n }\n while ($count);\n\n return $str;\n}", "function modificar_url($url) {\n $find = array(' ');\n $repl = array('-');\n $url = str_replace ($find, $repl, $url);\n\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace ($find, $repl, utf8_encode($url));\n\n $find = array('0', '1', '2', '3', '4', '5','6', '7', '8', '9');\n $repl = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');\n $url = str_replace ($find, $repl, utf8_encode($url));\n //utf8_decode();\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace ($find, '-', $url);\n\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '_', '');\n $url = preg_replace ($find, $repl, $url);\n $url= strtolower($url);\n //ucwords($url);\n\n return $url;\n }", "function modificar_url($url) {\n\t\t$find = array(' ');\n\t\t$repl = array('-');\n\t\t$url = str_replace ($find, $repl, $url);\n\t\t$find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n\t\t$repl = array('a', 'e', 'i', 'o', 'u', 'n');\n\t\t$url = str_replace ($find, $repl, utf8_encode($url));\n\t\t//utf8_decode();\n\t\t// Añaadimos los guiones\n\t\t$find = array(' ', '&', '\\r\\n', '\\n', '+');\n\t\t$url = str_replace ($find, '-', $url);\n\t\t\n\t\t// Eliminamos y Reemplazamos demás caracteres especiales\n\t\t$find = array('/[^A-Za-z0-9\\-<>\\_]/', '/[\\-]+/', '/<[^>]*>/');\n\t\t$repl = array('', '_', '');\n\t\t$url = preg_replace ($find, $repl, $url);\n\t\tucwords($url);\n\t\n\treturn $url;\n\t}", "protected function decode($key)\n {\n // matches %20, %7F, ... but not %21, %22, ...\n // (=the encoded versions for those encoded in encode)\n $regex = '/%(?!2[1246789]|3[0-9]|3[B-F]|[4-6][0-9A-F]|5[0-9A-E])[0-9A-Z]{2}/i';\n return preg_replace_callback($regex, function ($match) {\n return rawurldecode($match[0]);\n }, $key);\n }", "function urlsafe_b64encode($string) {\n $data = base64_encode($string);\n $data = str_replace(array('+','/','='),array('-','_','.'),$data);\n return $data;\n}", "function oauth_urlencode($uri) {}", "function clean_urls($text) {\r\n\t$text = strip_tags(lowercase($text));\r\n\t$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%',\r\n '^','&','*','(',')','+','{','}','|',':','\"',\r\n '<','>','?','[',']','\\\\',';',\"'\",',','/',\r\n '*','+','~','`','=','.');\r\n\t$code_entities_replace = array('','-','-','','','','','','','','','','','',\r\n '','','','','','','','','','','','','');\r\n\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n\t$text = urlencode($text);\r\n\t$text = str_replace('--','-',$text);\r\n\t$text = rtrim($text, \"-\");\r\n\treturn $text;\r\n}", "function url_decode($text)\n {\n return base64_decode(str_pad(strtr($text, '-_', '+/'), strlen($text) % 4, '=', STR_PAD_RIGHT));\n }", "protected static function urlencode_rfc3986($value)\n {\n\tif (is_array($value)) {\n\t return array_map(array(__CLASS__, 'urlencode_rfc3986'), $value);\n\t} else {\n\t $search = array('+', ' ', '%7E', '%');\n\t $replace = array('%20', '%20', '~', '%25');\n\n\t return str_replace($search, $replace, urlencode($value));\n\t}\n }", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "function StringInputCleaner($data) {\n\t//remove space bfore and after\n\t$data = trim($data);\n\t//remove slashes\n\t$data = stripslashes($data);\n\t$data = (filter_var($data, FILTER_SANITIZE_STRING));\n\t$data = utf8_encode($data);\n\treturn $data;\n}", "function format_string_for_url($string) {\n\t\t$string = str_replace(\n\t\t\tarray('&', \"'\", ' ', '/'),\n\t\t\tarray('and', '', '_', '_'),\n\t\t\t$string\n\t\t);\n\t\t$string = strtolower(iconv(\"UTF-8\", \"ASCII//TRANSLIT\", $string));\n\t\treturn $string;\n\t}", "function u($string=\"\"){\n return urlencode($string);\n }", "function encodeBase64UrlSafe($value)\n{\n return str_replace(array('+', '/'), array('-', '_'),\n base64_encode($value));\n}", "function encodeBase64UrlSafe($value) {\n return str_replace(array('+', '/'), array('-', '_'),\n base64_encode($value));\n}", "function _filterurl($url) {\n return str_replace(\n array('<','>','(',')','#'),\n array('&lt;','&gt;','&#40;','&#41;','&#35;'),\n $url\n );\n }", "function htmlRemoveSpecialCharacters($input){\n\t\tfor($i=0; $i<strlen($input); $i++){\n\n\t\t\t$value = ord($input[$i]);\n\t\t\tif($value >= 48 && $value <= 57);\n\t\t\telseif ($value >= 65 && $value <= 90) ;\n\t\t\telseif ($value >= 97 && $value <= 122) ;\n\t\t\telseif ($value == 32) ;\n\t\t\telse{\n\t\t\t\t$input = substr($input, 0, $i) . '\\\\' . substr($input, $i);\n\t\t\t}\n\t\t}\n\t\techo $input;\n\t\treturn $input;\n\t}", "protected function fixUrl($url, $encode){\n if(strpos($url, \"http\") !== 0){\n $url = \"http://\".$url;\n }\n\n if($encode){\n // Google does not support an encoded url\n }\n\n return $url;\n }", "function uniencode($s)\n{\n $r = \"\";\n for ($i=0;$i<strlen($s);$i++) $r.= \"&#\".ord(substr($s,$i,1)).\";\";\n return $r;\n}", "function obfuscate_email($email) {\n\t$out = \"\";\n\t$len = strlen($email);\n\n\tfor($i = 0; $i < $len; $i++)\n\t\t$out .= \"&#\" . ord($email[$i]) . \";\";\n\n\treturn $out;\n}", "function sanitizeData_percent($var)\n\t{\n\t\t$var = trim($var); // gets rid of white space\n\t\t$var = stripslashes($var); // no slashes protecting stuff\n\t\t$var = htmlentities($var); // no html :-(\n\t\t$var = strip_tags($var); // no tags\n\t\t$var = str_replace(\" \",\"%20\",$var);\n\t\treturn $var; //returns clean data\n\t}", "function atkurlencode($string, $pref=true)\n{\n\t$string = rawurlencode($string);\n\tfor ($i=8;$i>=1;$i--)\n\t{\n\t\t$string = str_replace(\"_\".$i,\"_\".($i+1),$string);\n\t}\n\treturn ($pref?\"__\":\"\").str_replace(\"%\",\"_1\",$string);\n}", "public function getCode(): string\n {\n return \"\\x00\";\n }", "function url_amigable($url)\n {\n $url = strtolower($url);\n //Rememplazamos caracteres especiales latinos\n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace($find, $repl, $url);\n // Añaadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace($find, '-', $url);\n // Eliminamos y Reemplazamos demás caracteres especiales\n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '-', '');\n $url = preg_replace($find, $repl, $url);\n\n return $url;\n }", "function u($string = '')\n{\n return urlencode($string);\n}", "function cleanTitleString($string)\n{\n $count = count($string);\n\n for ($i=0; $i < $count; ++$i)\n {\n if ($string[$i] == '\\'')\n $string[$i] = '%';\n }\n\n return $string;\n}", "function link_do_better($link)\n{\n\t$link = preg_replace('#([\\w\\d]+=[\\w\\d]{32})#',null,$link);\n\tprint_r($link);\n\treturn $link;\n}", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "private function encode_Base64UrlSafe( $value ) {\n\t\t\treturn str_replace( array( '+', '/' ), array( '-', '_' ), base64_encode( $value ) );\n\t\t}", "function wikiurl( $s ) {\n\treturn str_replace( '%2F', '/', rawurlencode( $s ) );\n}", "function base64_url_decode($input) {\n return base64_decode(strtr($input, '-_', '+/'));\n}", "public static function normalizarUrl($url){\n\t\t$originales = 'ÀÁÈÉÌÍÑÒÓÙÚÜàáèéìíñòóùúü&.,¿?!¡-';\n\t $modificadas = 'aaeeiinoouuuaaeeiinoouuuy_______';\n\t $cadena = utf8_decode($url);\n\t $cadena = strtr($cadena, utf8_decode($originales), $modificadas);\n\t $cadena = strtolower($cadena);\n\t $cadena = str_replace(' ', '_', $cadena);\n\t $cadena = str_replace('__', '_', $cadena);\n\t $cadena = str_replace('___', '_', $cadena);\n\t return utf8_encode(Yii::app()->Herramientas->clearSpecial($cadena));\n\t}", "function _encode($string) {\n\t\tif (preg_match('/(\\/|&)/', $string)) {\n\t\t\t$string = urlencode($string);\n\t\t}\n\n\t\treturn urlencode($string);\n\t}", "function clean_str( $text )\n\t{ // tomreyn says: I'm afraid this function is more likely to cause to trouble than to fix stuff (you have mysql escaping and html escaping elsewhere where it makes more sense, but strip off < and > here already, but then you don't filter non-visible bytes here)\n\t\t//$text=strtolower($text);\n\t\t//$code_entities_match = array('!','@','#','$','%','^','&','*','(',')','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",',','/','*','+','~','`','=');\n\t\t//$code_entities_replace = array('','','','','','','','','','','','','','','','','','','','','');\n\t\t$code_entities_match = array('$','%','^','&','_','+','{','}','|','\"','<','>','?','[',']','\\\\',';',\"'\",'/','+','~','`','=');\n\t\t$code_entities_replace = array('','','','','','','','','','','','','');\n \n\t\t$text = str_replace( $code_entities_match, $code_entities_replace, $text );\n\t\treturn $text;\n\t}", "function clean_variable($variable) {\n\t$variable = base64_decode($variable);\n\t$packing_length = 5;\n\n\t$variable = substr($variable, $packing_length);\n\t$variable = substr($variable, 0, -1 * $packing_length);\n\n\treturn mysql_escape_mimic(trim($variable));\n}", "function phpTrafficA_cleanText($text) {\n$text = str_replace(\"&\", \"&amp;\", $text);\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function u($string=\"\") {\n\t\treturn urlencode($string);\n\t}", "function encodeAddress($address)\n{\n\t$part = explode(chr(10), $address);\n\t$result = array();\n\tfor($i = 0; $i < count($part); $i++)\n\t{\n\t\t$part[$i] = trim(str_replace(' ', ' ', $part[$i]));\n\t\tif($part[$i] != '') $result[] = $part[$i];\n\t}\n\treturn implode(chr(10), $result);\n}", "function clean_postcode ($postcode) {\n\n\t\t$postcode = str_replace(' ','',$postcode);\n\t\t$postcode = strtoupper($postcode);\n\t\t$postcode = trim($postcode);\n\t\t$postcode = preg_replace('/(\\d[A-Z]{2})/', ' $1', $postcode);\n\t\n\t\treturn $postcode;\n\n\t}", "function prepare_field($field)\n{\n return trim(preg_replace(\"/[<>&=%:'“]/i\", \"\", $field));\n}", "function replacespecialcharsurl($str){\n\t\t$str=trim($str);\n\t\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t\t$str=ereg_replace(\"-\",\"\",$str);\n\t\t$str=ereg_replace('\"',\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"#\",\"\",$str);\n\t\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t\t$str=ereg_replace(\",\",\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"&\",\"\",$str);\n\t\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t\t$str=ereg_replace(\":\",\"\",$str);\n\t\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t\t$str=ereg_replace(\" \",\" \",$str);\n\t\t$str=ereg_replace(\" \",\"-\",$str);\n\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=strtolower($str);\n\t\treturn $str;\n}", "function replace_ampersand($str) \n\t{\n\t\n\t\treturn str_replace(\"&\", \"%26\", $str);\n\t\n\t}", "function url_encode($string){\n return urlencode(utf8_encode($string));\n }", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "function string_url( $p_string ) \r\n{\r\n\t$p_string = rawurlencode( $p_string );\r\n\r\n\treturn $p_string;\r\n}", "function decodevariable($varin) {\n $varout=urldecode($varin);\n return $varout;\n}", "function phpTrafficA_cleanTextNoAmp($text) {\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}" ]
[ "0.6890622", "0.6532879", "0.6411644", "0.62913877", "0.6246051", "0.6210987", "0.61858726", "0.6167378", "0.6143396", "0.61240834", "0.6114848", "0.60663474", "0.60246855", "0.60122496", "0.6011403", "0.5982957", "0.5974583", "0.5935859", "0.5897044", "0.58821154", "0.5864951", "0.58487225", "0.58293927", "0.5827283", "0.5791218", "0.5779406", "0.5772088", "0.5770851", "0.57654315", "0.57484114", "0.57457304", "0.57290083", "0.5715862", "0.5715828", "0.5714216", "0.5710908", "0.57093424", "0.56779456", "0.56666976", "0.5666019", "0.5661795", "0.56592", "0.56546617", "0.56482", "0.5638278", "0.5601318", "0.56006795", "0.5583794", "0.5536499", "0.55265254", "0.551896", "0.5516242", "0.5514615", "0.5510936", "0.5490727", "0.5490696", "0.548791", "0.5485898", "0.5477763", "0.54691696", "0.5461617", "0.5448169", "0.54419583", "0.54240614", "0.54240614", "0.5422464", "0.54208094", "0.5413069", "0.54110956", "0.5411014", "0.5410869", "0.5394456", "0.53879976", "0.5378871", "0.5370287", "0.53688765", "0.535249", "0.5349761", "0.53367615", "0.532646", "0.5316489", "0.53142864", "0.5305288", "0.53043073", "0.52956873", "0.5290159", "0.5289203", "0.5288415", "0.52840483", "0.52803975", "0.5278118", "0.5277059", "0.5272787", "0.5271589", "0.52694386", "0.5267657", "0.525308", "0.52522576", "0.5250859", "0.5250209", "0.52495074" ]
0.0
-1
Display a listing of the resource.
public function index() { $videos = $this->video->orderBy('id', 'desc')->paginate(10); $data = ['videos' => $videos, 'title' => $this->title]; return view('admin.videos.index')->with($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $data = ['title' => $this->title, 'subtitle' => 'Adicionar notícia']; return view('admin.videos.form')->with($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(VideoFormRequest $request) { $dataForm = $request->all(); if(valid_file($request)) { $upload = upload_file($request, 'videos'); if($upload){ $dataForm['file'] = $upload; } } $video = $this->video->create($dataForm)->id; if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $video = $this->video->findOrFail($id); $data = ['video' => $video, 'title' => $this->title, 'subtitle' => 'Editar notícias']; return view('admin.videos.form')->with($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(VideoUpdateRequest $request, $id) { $video = $this->video->findOrFail($id); $dataForm = $request->all(); if(valid_file($request)) { $upload = upload_file($request, 'videos'); if($upload){ $dataForm['file'] = $upload; } } $updated = $video->update($dataForm); if(!$updated) return redirect('/admin/videos')->with('fail', 'Falha ao editar o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo editado com sucesso!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $deleted = $this->video->destroy($id); if(!$deleted) return redirect('/admin/videos')->with('fail', 'Falha ao excluir o vídeo!'); return redirect('/admin/videos')->with('success', 'Vídeo excluído com sucesso!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Plugin Name: email Description: A plugin that includes custom code snippets Version: 1.0.0 Author: ofek gabay
function sv_unrequire_wc_phone_field( $fields ) { $fields['billing_email']['required'] = false; return $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function email() {\n\t\trequire( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/email.php' );\n\t}", "function svbk_mandrill_emails_init() {\n\tload_plugin_textdomain( 'svbk-mandrill-emails', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );\n}", "function get_entry_points()\n\t{\n\t\treturn array_merge(array('misc'=>'WELCOME_EMAILS'),parent::get_entry_points());\n\t}", "function opanda_show_mymail_html() {\r\n \r\n if ( !defined('MYMAIL_VERSION') ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The MyMail plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "function ofa_secure_mail_shortcode($atts) {\n extract(shortcode_atts(array(\"email\" => '', \"text\" => ''), $atts));\n return ofa_secure_mail($email, $text);\n}", "function the_author_email()\n {\n }", "function getEmailSubject() { return 'JS BUILDER'; }", "function maplesyrupweb_email_filter($args)\n{\n\n // call the email template function\n\t$template = maplesyrupweb_email_template();\n\n //replace \"[message]\" in line 70 with the message coming into the function and the template\n $args['message'] = str_replace(\"[message]\",$args['message'],$template);\n \n\n\tadd_filter('wp_mail_content_type','maplesyrupweb_content_filter');\n\n\treturn $args;\n}", "function mailfetch_optpage_register_block() {\n include_once (SM_PATH . 'plugins/mail_fetch/functions.php');\n mailfetch_optpage_register_block_function();\n}", "function wpcodex_hide_email_shortcode( $atts , $content = null ) {\n\tif ( ! is_email( $content ) ) {\n\t\treturn;\n\t}\n\n\treturn '<a href=\"mailto:' . antispambot( $content ) . '\">' . antispambot( $content ) . '</a>';\n}", "function sample_admin_notice__success() {\n ?>\n <div class=\"notice notice-success is-dismissible\">\n <p><?php _e( 'RAR Example Plugin Installed!', 'sample-text-domain' ); ?></p>\n </div>\n <?php\n}", "function tev_email_encode( $atts, $email ){\r\n\t$atts = extract( shortcode_atts( array('email'=>$email),$atts ));\r\n\t\r\n\tif(function_exists('antispambot')){\r\n\t\treturn '<a href=\"'.antispambot(\"mailto:\".$email).'\">'.antispambot($email).'</a>';\r\n\t\t}\r\n}", "function my_custom_recipient( $email ) {\n\n\treturn '[email protected]';\n}", "public function pluginDetails()\n {\n return [\n 'name' => 'Newsletter',\n 'description' => 'Newsletter contact',\n 'author' => 'Cifq',\n 'icon' => 'icon-leaf'\n ];\n }", "function i18n_plugin_test() {\n\treturn __( 'This is a dummy plugin', 'internationalized-plugin' );\n}", "function _webform_help_email($section) {\r\n switch ($section) {\r\n case 'admin/settings/webform#email_description':\r\n return t(\"A textfield that automatically fills in a logged-in user's e-mail.\");\r\n }\r\n}", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "protected function sayHello()\n {\n // Plugin functionality\n }", "function echotheme_add_shortcode_tinymce_plugin($plugin_array) {\n\tglobal $echotheme;\n\t$plugin_array['echothemeShortcodes'] = get_bloginfo('template_url') . '/js/editor_plugin.js';\n\treturn $plugin_array;\n}", "function send_wp_mail_from($email)\n {\n return \"[email protected]\";\n }", "function mme_success_notice(){\n\t$msg = \"Email Id saved successfully\";\n\t?>\n\t <div class=\"updated\" style=\"margin:5px 2px 2px\">\n <p><?php _e( $msg, 'my-text-domain' ); ?></p>\n </div>\n\t<?\n\n}", "function initlab_section_mailman_token_callback($args) {\n ?>\n <p><?php _e('Please input the correct settings so the [initlab_mailman_token] shortcode can operate properly.', 'initlab-addons'); ?></p>\n <?php\n}", "function rlip_send_log_email($plugin, $recipient, $archive_name) {\n global $CFG;\n\n $admin = get_admin();\n\n //obtain email contents\n $plugindisplay = get_string('pluginname', $plugin);\n $subject = get_string('notificationemailsubject', 'block_rlip', $plugindisplay);\n $message = get_string('notificationemailmessage', 'block_rlip', $plugindisplay);\n\n //send the email\n email_to_user($recipient, $admin, $subject, $message, '', $archive_name, $archive_name);\n}", "function get_send_invoice_mail_content(){\n $mail_content = get_field('manual_invoice_to_member_mail', 'option');\n return apply_filters( 'replace_paces_site_url', $mail_content['content'] );\n}", "function contactform_plugin(){\n\n $content = '';\n $content .= '<h3>Contact us! </h3>';\n\n $content .= '<form method=\"post\" action=\"http://localhost:10008/thank-you/\" />';\n\n $content .= '<label for=\"your_name\">Name</label>';\n $content .= '<input type=\"text\" name=\"your_name\" class=\"form-control\" placeholder=\"Enter your name\" />';\n \n $content .= '<label for=\"your_email\">Email</label>';\n $content .= '<input type=\"email\" name=\"your_email\" class=\"form-control\" placeholder=\"Enter your emailadress\" />';\n\n \n $content .= '<label for=\"your_message\">Message</label>';\n $content .= '<textarea name=\"your_message\" class=\"form-control\" placeholder=\"Enter your message\"></textarea>';\n\n $content .= '<br /> <input class=\"btn btn-primary\" name=\"form_submit\" type=\"submit\" value=\"Submit\" />';\n\n // closing the form\n $content .= '</form>';\n\n \n return $content;\n \n}", "public function pluginDetails()\n {\n return [\n 'name' => 'Contact',\n 'description' => 'Messages from the frontend contact form.',\n 'author' => 'Be Easy',\n 'icon' => 'icon-envelope-o'\n ];\n }", "function filter_mce_plugin( $plugins ) {\n\t\t$plugins['thundercodes'] = get_template_directory_uri() . '/functions/thundercodes/thundercodes_plugin.js?dir='.urlencode(get_template_directory_uri());\n\t\treturn $plugins;\n\t}", "function appthemes_add_contentwarning_quicktag() {\n if (wp_script_is('quicktags')){\n ?>\n <script type=\"text/javascript\">\n QTags.addButton( 'trigger_warning', 'trigger_warning', '[trigger_warning = 'none']', '', 'tw', 'Content Warning', 201 );\n QTags.addButton( 'content_warning', 'content_warning', '[content_warning = 'none']', '', 'cw', 'Content Warning', 201 );\n </script>\n <?php\n }\n}", "function create_newsletter_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-create-newsletter.php\" );\r\n }", "function sw_velocityconveyor_safe_email( $atts, $content ) {\n\nreturn '<a href=\"mailto:' . antispambot( $content ) . '\">' . antispambot( $content ) . '</a>';\n}", "function blm_hide_email_shortcode( $atts , $content = null ) {\n\tif ( ! is_email( $content ) ) {\n\t\treturn;\n\t}\n\n\treturn '<a href=\"mailto:' . antispambot( $content ) . '\">' . antispambot( $content ) . '</a>';\n}", "function use_codepress()\n {\n }", "public function ga_email_callback()\n {\n printf(\n '<input type=\"email\" id=\"ga_email\" name=\"bpp_setting_options[ga_email]\" value=\"%s\" />',\n isset( $this->options['ga_email'] ) ? esc_attr( $this->options['ga_email']) : ''\n );\n }", "function wiki_email_moderation_message()\n{\n\treturn <<<EOT\nA new revision has been posted for title: {title}\n\nURL to View Revision: {path:view_revision}\nURL to Open Revision: {path:open_revision}\nView Topic: {path:view_article}\n\nRevision Content:\n\n{content}\n\nEOT;\n}", "function dt_sc_email($attrs, $content = null) {\n\t\textract ( shortcode_atts ( array (\n\t\t\t\t'title' => '',\n\t\t\t\t'description' =>'',\n\t\t\t\t'icon' => '',\n\t\t\t\t'emailid' => ''\n\t\t), $attrs ) );\n\n\t\t$out = '<div class=\"dt-sc-contact-info\">';\n\t\t$out .= \"<i class='fa {$icon}'></i>\";\n\t\t$out .= \"<span>{$title}</span>\";\n\t\t$out .= ( !empty($emailid) ) ? \"<a href='mailto:$emailid'>{$emailid}</a>\" : \"\";\n\t\t$out .= \"<span class='details'>{$description}</span>\";\n\t\t$out .= '</div>';\n\t\treturn $out;\n\t }", "function gsCustomPageExtensions() {\r\n /* Load Langauge Files */\r\n $langDir = dirname(plugin_basename(__FILE__)) . '/lang';\r\n load_plugin_textdomain('custom-page-extensions', false, $langDir, $langDir);\r\n\r\n /* Set the plugin name to use the selected language. */\r\n $this->pluginName = __('Custom Page Extensions', 'custom-page-extensions');\r\n\r\n global $wp_rewrite;\r\n\r\n /* Plugin paths */\r\n $this->pluginPath = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));\r\n $this->pluginURL = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));\r\n\r\n // Get the extension.\r\n $this->load_settings();\r\n\r\n /* Add Options Pages and Links */\r\n add_action('admin_menu', array(&$this, 'admin_menu'));\r\n add_action('admin_init', array(&$this, 'admin_init'));\r\n add_action('update_option_' . $this->optionsName, array(&$this, 'update_option'), 10);\r\n add_action('wp_loaded', array(&$this, 'flush_rules'));\r\n\r\n add_filter('plugin_action_links', array(&$this, \"plugin_action_links\"), 10, 2);\r\n add_filter('user_trailingslashit', array(&$this, 'no_page_slash'), 66, 2);\r\n }", "function ganesh_contact_add_meta_box(){\r\n\tadd_meta_box('contact_email', 'User Email', 'ganesh_contact_email_callback', 'ganesh-contact', 'normal', 'high');\t\r\n}", "function aidtransparency_print_sidebar_contact( $email = null)\r\n{\r\n $contact = null;\r\n if(filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n $contact = $email;\r\n }else{\r\n $contact = sweetapple_get_theme_option('contact_email');\r\n }\r\n if($contact == null){\r\n return \"\";\r\n }else{\r\n ?>\r\n <aside id=\"sidebar_contact_email\" class=\"widget widget_contact_email\">\r\n <h3 class=\"widget-title\"><?php _e('Media Contact'); ?></h3>\r\n <div class=\"textcontact\">\r\n <p>Media Contact<br />\r\n <a href=\"mailto:<?php echo $contact; ?>\"><?php echo $contact; ?></a>\r\n </p>\r\n </div>\r\n </aside>\r\n\r\n <?php\r\n }\r\n}", "function opnada_show_mailpoet_html() {\r\n\r\n if ( !defined('WYSIJA') ) {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><strong><?php _e('The MailPoet plugin is not found on your website. Emails will not be saved.', 'opanda') ?></strong></p>\r\n </div>\r\n </div>\r\n <?php\r\n } else {\r\n ?>\r\n <div class=\"form-group\">\r\n <label class=\"col-sm-2 control-label\"></label>\r\n <div class=\"control-group controls col-sm-10\">\r\n <p><?php _e('You can set a list where the subscribers should be added in the settings of a particular locker.', 'opanda') ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n }\r\n}", "function get_the_author_email()\n {\n }", "function mpc_shortcode(){\n ob_start();\n deliver_mail();\n mpc_html_form_code();\n}", "public function andmoraho_vendor_email_metabox_callback($post)\n {\n require_once plugin_dir_path(__FILE__) . 'templates/email.tpl.php';\n }", "function add_rich_plugins( $plugin_array )\n\t{\n\t\t$plugin_array['nymbleShortcodes'] = NYMBLE_TINYMCE_URI . '/plugin.js';\n\t\treturn $plugin_array;\n\t}", "function register_block_core_post_author()\n {\n }", "function wc_show_author() {\n global $post;\n echo \"This plugin was made by William Cayetano\";\n\n}", "function phorum_mod_bbcode_google_editor_tool_plugin()\n{\n $PHORUM = $GLOBALS['PHORUM'];\n if (empty($PHORUM[\"mod_bbcode_google\"][\"enable_editor_tool\"])) return;\n $lang = $PHORUM['DATA']['LANG']['bbcode_google'];\n\n editor_tools_register_tool(\n 'google', // Tool id\n $lang['ToolButton'], // Tool description\n './mods/bbcode_google/icon.gif', // Tool button icon\n 'bbcode_google_editor_tool()' // Javascript action on button click\n );\n\n # This was a test to see if the Editor Tools help button could\n # be extended. A real help file would have to be written for this,\n # if neccessary. For now, I'll just disable this feature.\n #editor_tools_register_help(\n # 'How to supply google links',\n # 'http://www.google.com/'\n #);\n}", "function add_tinyMCE_plugin( $plugin_array ) {\n\n\t \t$plugin_array['better_blockquote'] = plugins_url( 'blockquotes.js', __FILE__ );\n\t \treturn $plugin_array;\n\n\t}", "function postfixadmin_optpage_register_block() {\n global $optpage_blocks;\n global $AllowVacation;\n global $AllowChangePass;\n\n // if ( !soupNazi() ) {\n\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n $optpage_blocks[] = array(\n 'name' => _(\"Forwarding\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_forward.php',\n 'desc' => _(\"Here you can create and edit E-Mail forwards.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n if ($AllowVacation) {\n $optpage_blocks[] = array(\n 'name' => _(\"Auto Response\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_vacation.php',\n 'desc' => _(\"Set an OUT OF OFFICE message or auto responder for your mail.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n }\n bindtextdomain('postfixadmin', SM_PATH . 'plugins/postfixadmin/locale');\n textdomain('postfixadmin');\n if ($AllowChangePass) {\n $optpage_blocks[] = array(\n 'name' => _(\"Change Password\"),\n 'url' => '../plugins/postfixadmin/postfixadmin_changepass.php',\n 'desc' => _(\"Change your mailbox password.\"),\n 'js' => false\n );\n bindtextdomain('squirrelmail', SM_PATH . 'locale');\n textdomain('squirrelmail');\n }\n}", "public function add_welcome_email() {\n $post_exists = post_exists( '[{{{site.name}}}] Welcome!' );\n \n if ( $post_exists != 0 && get_post_status( $post_exists ) == 'publish' )\n return;\n \n // Create post object\n $my_post = array(\n 'post_title' => __( '[{{{site.name}}}] Welcome!', 'buddypress-welcome-email' ),\n 'post_content' => __( 'Welcome to [{{{site.name}}}]!', 'buddypress-welcome-email' ), // HTML email content.\n 'post_excerpt' => __( 'Welcome to [{{{site.name}}}]!', 'buddypress-welcome-email' ), // Plain text email content.\n 'post_status' => 'publish',\n 'post_type' => bp_get_email_post_type() // this is the post type for emails\n );\n \n // Insert the email post into the database\n $post_id = wp_insert_post( $my_post );\n \n if ( $post_id ) {\n // add our email to the taxonomy term 'activation_completed'\n // Email is a custom post type, therefore use wp_set_object_terms\n \n $tt_ids = wp_set_object_terms( $post_id, 'activation_completed', bp_get_email_tax_type() );\n foreach ( $tt_ids as $tt_id ) {\n $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() );\n wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array(\n 'description' => 'Recipient has successfully activated an account.',\n ) );\n }\n }\n }", "function plugin_page() {\n\n echo '<div class=\"wrap\">';\n echo '<h2>'.esc_html__( 'WC Sales Notification Settings','wc-sales-notification-pro' ).'</h2>';\n $this->save_message();\n $this->settings_api->show_navigation();\n $this->settings_api->show_forms();\n echo '</div>';\n\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Reminder',\n 'description' => 'Remind for new posts and comments',\n 'author' => 'mnv',\n 'icon' => 'icon-bell'\n ];\n }", "function wp_add_privacy_policy_content($plugin_name, $policy_text)\n {\n }", "function spreadshop_imprint()\n{\ninclude(plugin_dir_path(__FILE__).'/imprint.php');\nadd_filter('wp_head', 'sources');\n}", "function getName() {\r\n\t\treturn 'markupplugin';\r\n\t}", "function wp_site_admin_email_change_notification($old_email, $new_email, $option_name)\n {\n }", "function cc_plugin($title, $excerpt, $url, $blog_name, $tb_url, $pic, $profile_link)\r\n{\r\n //Standard Trackback\r\n $title = urlencode(stripslashes($title));\r\n $excerpt = urlencode(stripslashes($excerpt));\r\n $url = urlencode($url);\r\n $blog_name = urlencode(stripslashes($blog_name));\r\n\r\n //Create a new comment using the trackback variables.\r\n}", "function misc()\n\t{\n\t\tif (!cron_installed()) attach_message(do_lang_tempcode('CRON_NEEDED_TO_WORK',escape_html(brand_base_url().'/docs'.strval(ocp_version()).'/pg/tut_configuration')),'warn');\n\n\t\trequire_code('templates_donext');\n\t\treturn do_next_manager(get_page_title('WELCOME_EMAILS'),comcode_lang_string('DOC_WELCOME_EMAILS'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t/*\t type\t\t\t\t\t\t\t page\t params\t\t\t\t\t\t\t\t\t\t\t\t\t zone\t */\n\t\t\t\t\t\tarray('add_one',array('_SELF',array('type'=>'ad'),'_SELF'),do_lang('ADD_WELCOME_EMAIL')),\n\t\t\t\t\t\tarray('edit_one',array('_SELF',array('type'=>'ed'),'_SELF'),do_lang('EDIT_WELCOME_EMAIL')),\n\t\t\t\t\t),\n\t\t\t\t\tdo_lang('WELCOME_EMAILS')\n\t\t);\n\t}", "public function plugin_settings_description() {\n\t\t\n\t\t$description = '<p>';\n\t\t$description .= sprintf(\n\t\t\tesc_html__( 'iContact makes it easy to send email newsletters to your customers, manage your subscriber lists, and track campaign performance. Use Gravity Forms to collect customer information and automatically add it to your iContact list. If you don\\'t have an iContact account, you can %1$s sign up for one here.%2$s', 'gravityformsicontact' ),\n\t\t\t'<a href=\"http://www.icontact.com/\" target=\"_blank\">', '</a>'\n\t\t);\n\t\t$description .= '</p>';\n\t\t\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\t\n\t\t\t$description .= '<p>';\n\t\t\t$description .= esc_html__( 'Gravity Forms iContact Add-On requires your Application ID, API username and API password. To obtain an application ID, follow the steps below:', 'gravityformsicontact' );\n\t\t\t$description .= '</p>';\n\t\t\t\n\t\t\t$description .= '<ol>';\n\t\t\t$description .= '<li>' . sprintf(\n\t\t\t\tesc_html__( 'Visit iContact\\'s %1$s application registration page.%2$s', 'gravityformsicontact' ),\n\t\t\t\t'<a href=\"https://app.icontact.com/icp/core/registerapp/\" target=\"_blank\">', '</a>'\n\t\t\t) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Set an application name and description for your application.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Choose to show information for API 2.0.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Copy the provided API-AppId into the Application ID setting field below.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Click \"Enable this AppId for your account\".', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Create a password for your application and click save.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '<li>' . esc_html__( 'Enter your API password, along with your iContact account username, into the settings fields below.', 'gravityformsicontact' ) . '</li>';\n\t\t\t$description .= '</ol>';\n\t\t\t\n\t\t}\n\t\t\t\t\n\t\treturn $description;\n\t\t\n\t}", "function add_shortcode() {\n\t\tadd_shortcode( 'contact-form', array( 'Grunion_Contact_Form', 'parse' ) );\n\t\tadd_shortcode( 'contact-field', array( 'Grunion_Contact_Form', 'parse_contact_field' ) );\n\t}", "function wp_crm_contextual_help($data) {\r\n\r\n $data['WP-Invoice Integration'][] = __('<h3>WP-Invoice</h3>', WPI);\r\n $data['WP-Invoice Integration'][] = __('<p>Advanced option <b>WP-Invoice custom field</b> may be used for adding custom user data fields for payments forms.</p>', WPI);\r\n $data['WP-Invoice Integration'][] = __('<p>Works for Authorize.net payment method only for now.</p>', WPI);\r\n $data['WP-Invoice Integration'][] = __('<h3>WP-Invoice Notifications</h3>', WPI);\r\n $data['WP-Invoice Integration'][] = __('<p>For your notifications on any of this Trigger actions &mdash; <i>WPI: Invoice Paid (Client Receipt)</i>, <i>WPI: Invoice Paid (Notify Administrator)</i>, <i>WPI: Invoice Paid (Notify Creator)</i> &mdash; you can use this shortcodes:</p>', WPI);\r\n $data['WP-Invoice Integration'][] = \"\r\n <p>\r\n <b>[user_email]</b>,\r\n <b>[user_name]</b>,\r\n <b>[user_id]</b>,\r\n <b>[invoice_id]</b>,\r\n <b>[invoice_title]</b>,\r\n <b>[permalink]</b>,\r\n <b>[total]</b>,\r\n <b>[default_currency_code]</b>,\r\n <b>[total_payments]</b>,\r\n <b>[creator_name]</b>,\r\n <b>[creator_email]</b>,\r\n <b>[creator_id]</b>,\r\n <b>[site]</b>,\r\n <b>[business_name]</b>,\r\n <b>[from]</b>,\r\n <b>[admin_name]</b>,\r\n <b>[admin_email]</b>,\r\n <b>[admin_id]</b>.\r\n </p>\r\n \";\r\n\r\n return $data;\r\n }", "function wonster_mce_plugin( $array ) {\r\n\t$array['wonster_mce'] = PLUGIN_MCE_URI .'js/plugin.js';\r\n\treturn $array;\r\n}", "function plugin_version_itilcategorygroups() {\n return array('name' => __('ItilCategory Groups', 'itilcategorygroups'),\n 'version' => '0.90+1.0.3',\n 'author' => \"<a href='http://www.teclib.com'>TECLIB'</a>\",\n 'homepage' => 'http://www.teclib.com');\n}", "function onExtra($name)\r\n\t{\r\n\t\t$output = null;\r\n\t\tif($name==\"header\" && $this->yellow->getRequestHandler()==\"edit\")\r\n\t\t{\r\n\t\t\t$imageLocation = $this->yellow->config->get(\"serverBase\").$this->yellow->config->get(\"imageLocation\");\r\n\t\t\t$pluginLocation = $this->yellow->config->get(\"serverBase\").$this->yellow->config->get(\"pluginLocation\");\r\n\t\t\t$jqueryCdn = $this->yellow->config->get(\"jqueryCdn\");\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$jqueryCdn}\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$pluginLocation}inline-attachment.js\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$pluginLocation}jquery.inline-attachment.js\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\">\\n\";\r\n\t\t\t$output .= \"\\$(function() {\\$('textarea').inlineattachment({uploadUrl: '{$imageLocation}upload_attachment.php'});});\";\r\n\t\t\t$output .= \"</script>\\n\";\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "function wpcr_twitter_extended_callback() {\n?>\n\t<div>\n\t<br /><br />\n\t<p><b>Publish Settings</b></p><br />\n\tSettings for the Twitter Publish plugin.<br />\n\t<?php wpcr_twitter_publish_auto_callback(); ?>\n\t</div>\n\n<?php\n}", "function getPostHookString(){\n\t\t$NL=\"\\r\\n\";\n\t\t$s_style = 'font-size:'.$this->_emailFontSize.'; font-family:'.$this->_emailFontFamily.';';\n\t\t\n\t\t$s_footHTML_raw = $this->_emailFootHtml;\n\t\t$s_footHTML\t= str_replace(\n\t\t\tarray('{{fromEmailAddress}}','{{subject}}'),\n\t\t\tarray(htmlspecialchars($this->_emailFromAddress),htmlspecialchars($this->_emailSubject)),\n\t\t\t$s_footHTML_raw\n\t\t);\n\n\t\t$s_ret='<div style=\"'.$s_style.'\">'.$NL.$this->_emailHeadHtml.$NL\n\t\t.$this->getFormTableContent().$NL\n\t\t.$s_footHTML.$NL\n\t\t.'</div>';\n\t\t\n\t\treturn $s_ret;\n\t}", "function add_shortcode_for_our_plugin ($attr , $content = null ){\n\t\textract(shortcode_atts(array(\n\t\t\t'post_type'=>'post',\n\t\t\t'posts_per_page'=>2,\n\t\t\t\n\t\t\t\n\t\t\n\t\t), $attr,'our_shortcode' ));\n\t\n\t$query = new WP_Query(array(\n\t\t'post_type'=>$post_type,\n\t\t'posts_per_page'=>$posts_per_page,\n\t\n\t));\n\t\n\tif($query->have_posts()):\n\t\t$output = '<div class=\"recent_posts\"><ul>';\n\t\t$i=0;\n\t\twhile($query->have_posts()){\n\t\t\t\n\t\t\t$query->the_post();\n\t\t\tif($i == 0):\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\" style=\"color:red;\" >'.get_the_title().'</a></li>';\n\t\t\telse:\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\">'.get_the_title().'</a></li>';\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t$i++; }\n\t\twp_reset_postdata();\n\t$output .= '</ul></div>';\n\treturn $output;\n\telse:\n\t return 'no post found';\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n}", "public function admin_email_design() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Email Design', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\t$design = new VisualFormBuilder_Pro_Designer();\n\t\t$design->design_options();\n?>\n\t</div>\n<?php\n\t}", "function create_user_email_metabox(){\n\tadd_meta_box(\n\t\t\t'our_first_meta',\n\t\t\t'About Aubhor',\n\t\t\t'create_user_email_metabox_callback',\n\t\t\t'student',\n\t\t\t'side',\n\t\t\t'high'\n\t\t\t\n\t\n\t);\n\t\n}", "function poemhd_plugin() {\n\t$chosen = Poemhd_plugin_get_lyric();\n\t$lang = '';\n\tif ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) {\n\t\t$lang = ' lang=\"en\"';\n\t}\n\n\tprintf(\n\t\t'<p id=\"dolly\"><span class=\"screen-reader-text\">%s </span><span dir=\"ltr\"%s>%s</span></p>',\n\t\t__( 'Quote from Hello Dolly song, by Jerry Herman:' ),\n\t\t$lang,\n\t\t$chosen\n\t);\n}", "function fl_add_shortcode_tinymce_plugin($plugin_array) {\n $plugin_array['flshortcodes'] = PMC_DIR .'assets/js/shortcode_plugin.js';\n return $plugin_array;\n}", "function cmk_custom_dashboard_widget() {\n echo '<p>Contacto: <strong>858 958 383</strong>. <a href=\"mailto:[email protected]\" target=\"_blank\">Correo</a> | <a href=\"https://www.closemarketing.es/ayuda/\" target=\"_blank\">Tutoriales y ayuda</a> | <a href=\"https://www.facebook.com/closemarketing\" target=\"_blank\">Facebook</a></p>';\n }", "function wp_staticize_emoji_for_email($mail)\n {\n }", "function Main_CyberPanel_Emails()\n{\n\n add_submenu_page(\"cyberpanel\", \"Configure Emails\",\n \"Email Templates\", \"manage_options\", \"wpcp-emails\"\n , \"cyberpanel_main_emails_html\"\n );\n\n}", "function handleShortcode($atts = [], $content = null, $tag = '') {\n\n if (is_admin()){\n return;\n }\n \n $vueRootUrl = plugin_dir_url( __FILE__ ) . 'dist';\n $vueFileRoot = plugin_dir_path( __FILE__) . 'dist';\n\n $jsCore = ['bootstrap.min.js', 'jquery-3.3.1.min.js', 'popper.min.js'];\n\n // Find the build files\n $jsMatches = glob(plugin_dir_path( __FILE__) . 'dist/js/*.*.js');\n $cssMatches = glob(plugin_dir_path( __FILE__) . 'dist/css/*.*.css');\n\n // Bring in core dependencies first\n\n $isLocal = true;\n\n if ($isLocal){\n\n //wp_deregister_script('jquery');\n\n //wp_register_script('actiontracker_vuecore_jquery', $vueRootUrl . '/js/jquery-3.3.1.min.js', false, null, true);\n\n wp_register_script('actiontracker_vuecore_popper', $vueRootUrl . '/js/popper.min.js', false, null, true);\n wp_register_script('actiontracker_vuecore_bootstrap4', $vueRootUrl . '/js/bootstrap.min.js', false, null, true);\n \n foreach ($jsMatches as $i => $jsItem) {\n if (!in_array(basename($jsItem), $jsCore)){\n $url = $vueRootUrl . '/js/' . basename($jsItem);\n $name = \"actiontracker_vuejs_\".$i;\n if (!wp_script_is($name, 'enqueued')){\n //print_r('BUILD JS: ' . $jsItem . '<br/>');\n wp_register_script($name, $url);\n wp_enqueue_script($name); \n }\n }\n }\n \n foreach ($cssMatches as $i => $cssItem) { \n $url = $vueRootUrl . '/css/' . basename($cssItem);\n $name = \"actiontracker_vuecss_\".$i;\n if (!wp_script_is($name, 'enqueued')){\n //print_r('CSS JS: ' . $i . '<br/>');\n wp_register_style($name, $url);\n wp_enqueue_style($name); \n }\n \n }\n\n }\n else {\n\n wp_register_script('actiontracker_vuecore_popper', 'http://app.actiontracker.org/js/popper.min.js', false, null, true);\n wp_register_script('actiontracker_vuecore_bootstrap4', 'http://app.actiontracker.org/js/bootstrap.min.js', false, null, true);\n \n //wp_enqueue_script('actiontracker_vuecore_jquery');\n wp_enqueue_script('actiontracker_vuecore_popper');\n wp_enqueue_script('actiontracker_vuecore_bootstrap4');\n \n }\n\n\n \n \n\n /*\n\n */\n \n // Handle short code params\n\n if (array_key_exists('view', $atts)) {\n $str = \"<div class='actionTrackerVuePlugin' view='\".$atts['view'].\"'>You need Javascript for this feature, sorry.</div>\"; \n }\n else {\n $str = \"<div class='actionTrackerVuePlugin' view='all'>You need Javascript for this feature, sorry.</div>\"; \n }\n\n return $str;\n }", "function bp_course_wp_mail($to,$subject,$message,$args=''){\n if(!count($to))\n return;\n \n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $settings = get_option('lms_settings');\n if(isset($settings['email_settings']) && is_array($settings['email_settings'])){\n if(isset($settings['email_settings']['from_name'])){\n $name = $settings['email_settings']['from_name'];\n }else{\n $name =get_bloginfo('name');\n }\n if(isset($settings['email_settings']['from_email'])){\n $email = $settings['email_settings']['from_email'];\n }else{\n $email = get_option('admin_email');\n }\n if(isset($settings['email_settings']['charset'])){\n $charset = $settings['email_settings']['charset'];\n }else{\n $charset = 'utf8'; \n }\n }\n $headers .= \"From: $name<$email>\". \"\\r\\n\";\n $headers .= \"Content-type: text/html; charset=$charset\" . \"\\r\\n\";\n \n $message = bp_course_process_mail($to,$subject,$message,$args); \n $message = apply_filters('wplms_email_templates',$message,$to,$subject,$message,$args);\n wp_mail($to,$subject,$message,$headers);\n}", "static function add_show_emails(): void {\r\n\t\tself::add_acf_field(self::show_emails, [\r\n\t\t\t'label' => 'Show emails on current masthead page?',\r\n\t\t\t'type' => 'true_false',\r\n\t\t\t'instructions' => 'Public emails may be helpful for readers,'\r\n\t\t\t\t.' but increase the risk of exposure to spam.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'message' => '',\r\n\t\t\t'default_value' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t]);\r\n\t}", "function wpb_demo_shortcode() { \n \n // Things that you want to do. \n\n \n $message = 'Hello world!'; \n ob_start();\n \n // Output needs to be return\n if ( is_user_logged_in() )include(plugin_dir_path(__FILE__).'polarchart.php');\n $out = ob_get_clean();\n return $out;\n \n}", "function __construct() {\r\n\t\t$this->name = __( 'Send Email', 'groupemail' );\r\n\t\t$this->slug = 'email';\r\n\r\n\t\t//$this->create_step_position = 21;\r\n\t\t//$this->nav_item_position = 35;\r\n\t\t$this->enable_nav_item = $this->bp_group_email_get_capabilities();\r\n\t}", "function hook_hostmeout_sms_clientHeadBlock($vars) {\n $headoutput = '<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css\">';\n return $headoutput;\n \n}", "function register_block_core_post_author_name()\n {\n }", "function hmbkp_plugin_row( $plugins ) {\n\n\tif ( isset( $plugins[HMBKP_PLUGIN_SLUG . '/plugin.php'] ) )\n\t\t$plugins[HMBKP_PLUGIN_SLUG . '/plugin.php']['Description'] = str_replace( 'Once activated you\\'ll find me under <strong>Tools &rarr; Backups</strong>', 'Find me under <strong><a href=\"' . admin_url( 'tools.php?page=' . HMBKP_PLUGIN_SLUG ) . '\">Tools &rarr; Backups</a></strong>', $plugins[HMBKP_PLUGIN_SLUG . '/plugin.php']['Description'] );\n\n\treturn $plugins;\n\n}", "function newsletters_subscribe_page() {\r\n require_once( $plugin_dir . \"email-newsletter-files/page-subscribe.php\" );\r\n }", "function phorum_mod_bbcode_google_javascript_register($data)\n{\n $data[] = array(\n \"module\" => \"bbcode_google\",\n \"source\" => \"file(mods/bbcode_google/bbcode_google.js)\"\n );\n return $data;\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function custom_admin_footer() {\n\techo 'Website design by <a href=\"http://rustygeorge.com/#contact\">Rusty George Creative</a> &copy; '.date(\"Y\").'. For site support please <a href=\"http://rustygeorge.com/#contact\">contact us</a>.';\n}", "function mme_addemail($email) {\n\t$option_name = \"custom_emails\";\n\tif ( get_option( $option_name ) !== false ) {\n\n \t// The option already exists, so we just update it.\n \tupdate_option( $option_name, $email );\n\t} else {\n\n\t // The option hasn't been added yet. We'll add it with $autoload set to 'no'.\n\t $deprecated = null;\n\t $autoload = 'no';\n\t add_option( $option_name, $email, $deprecated, $autoload );\n\t}\n}", "function new_user_email_admin_notice()\n {\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Blog Attachment Extension',\n 'description' => 'Adds file attachment features to the RainLab Blog module.',\n 'author' => 'Kune Keiseiie',\n 'icon' => 'icon-file',\n ];\n }", "function mmf_activation_message() {\n\t\tif (get_option('mmf_show_admin_authorize') == true) {\n\t\t\t?>\n\t\t\t\t<div class=\"updated\">\n\t\t\t\t\t<p>The MapMyFitness plugin is now activated, but you must visit the settings page to authorize your account and enter an API key.</p>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\tupdate_option('mmf_show_admin_authorize', false);\n\t\t}\n\t\t?>\n\t\t<script>\n\t\t\twindow.mmf_plugin_url = '<?php echo trim(plugins_url(\" \", __FILE__)); ?>';\n\t\t\twindow.wp_site_url = '<?php echo trim(site_url()); ?>';\n\t\t</script>\n\t\t<?php\n\t}", "function wpbm_plugin_text_domain(){\n load_plugin_textdomain( 'wp-blog-manager', false, basename( dirname( __FILE__ ) ) . '/languages/' );\n }", "public function plugin_page() {\n\t\tinclude 'admin-approval.php';\n\t}", "function install_plugin_information()\n {\n }", "function writeTemplate($pluginname, $strings) {\n echo '<?php\n\n /**\n * YourLanguage file for plugin '.$pluginname.'\n *\n * @package frog\n * @subpackage plugin.'.$pluginname.'.translations\n *\n * @author Your Name <[email protected]>\n * @version Frog x.y.z\n */\n\n return array(\n ';\n\n $strings = removeDoubles($strings);\n sort($strings);\n\n foreach ($strings as $string) {\n echo \"\\t'\".$string.\"' => '',\\n\";\n } \n\n echo \" );\\n\\n\\n\\n\\n\\n\";\n}", "function local_course_completion_status_before_footer() {\n //echo \"Hello!\";\n //\\core\\notification::add('Success!',\\core\\output\\notification::NOTIFY_SUCCESS);\n}", "function add_ind_script($plugins) {\n\t$dir_name = '/wp-content/plugins/indizar';\n\t$url=get_bloginfo('wpurl');\n\t$pluginURL = $url.$dir_name.'/tinymce/editor_plugin.js?ver='.INDIZAR_HEADER_V;\n\t$plugins['Indizar'] = $pluginURL;\n\treturn $plugins;\n}", "function wp_get_plugin_file_editable_extensions($plugin)\n {\n }", "function emailforsurveyCourse($guid, $id, $email, $name, $form, $mentor) {\n\n global $wpdb;\n\n $slug = PAGE_SLUG;\n $btn_url = site_url() . '/' . $slug . '?survey=' . $id . '&guid=' . $guid;\n $btn_url = \"http://www.google.com\";\n\n $date = date(\"Y-m-d H:i:s\");\n $site_name = TR_SITE_NAME;\n $admin_email = get_option('admin_email');\n $headers = 'From: ' . $admin_email . \"\\r\\n\" .\n 'Reply-To: ' . $admin_email . \"\\r\\n\" .\n 'MIME-Version: 1.0' . \"\\r\\n\" .\n 'Content-type: text/html; charset=utf-8' . '\\r\\n' .\n 'X-Mailer: PHP/' . phpversion();\n\n $template = tt_get_template(\"survey_send_course\");\n $subj = $template->subject;\n $subj = str_replace(\"{{course_name}}\", $mentor, $subj);\n $msg = $template->content;\n $msg = str_replace(array('{{username}}', '{{course_name}}', '{{url}}', '{{site_name}}'), array($name, $mentor, $btn_url, $site_name), $msg);\n custom_mail($email, $subj, $msg, EMAIL_TYPE, \"\");\n}", "public function embed_scripts() {}", "function activate_sitewide_plugin()\n {\n }", "public function callback_email( $args ) {\n $this->callback_text( $args );\n }", "static function add_email(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::email, [\r\n\t\t\t'label' => 'Email',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => '(Optional)',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'placeholder' => '[email protected]'\r\n\t\t]);\r\n\t}" ]
[ "0.671602", "0.63443494", "0.6056569", "0.6018305", "0.5967194", "0.59329575", "0.593226", "0.59307045", "0.59172344", "0.5898389", "0.58303136", "0.58228725", "0.58195823", "0.57880956", "0.57465345", "0.57047236", "0.5685005", "0.56809986", "0.5654249", "0.5652745", "0.5637629", "0.5636827", "0.5631423", "0.5624931", "0.5611614", "0.55951047", "0.5590186", "0.5582948", "0.5581303", "0.5577708", "0.5575947", "0.5559363", "0.55568326", "0.55552644", "0.55501324", "0.55485797", "0.55461407", "0.55443084", "0.55353093", "0.5516651", "0.550838", "0.5498495", "0.5495701", "0.5494627", "0.54893804", "0.54777455", "0.5475685", "0.54650366", "0.5462402", "0.5460192", "0.54553795", "0.545368", "0.5452553", "0.5451762", "0.5445219", "0.54384", "0.5433483", "0.5431866", "0.5422903", "0.54228735", "0.54114574", "0.5405394", "0.5402869", "0.54011035", "0.53914243", "0.5383024", "0.53828967", "0.53819", "0.5381349", "0.5377846", "0.53760105", "0.53754795", "0.5368351", "0.53634596", "0.5361206", "0.53570235", "0.53558874", "0.535353", "0.53500587", "0.53464925", "0.5346263", "0.5329217", "0.53267616", "0.532465", "0.532465", "0.5324114", "0.53224075", "0.53204924", "0.5318836", "0.5314729", "0.5312723", "0.53123134", "0.5304673", "0.5303482", "0.5301495", "0.5299861", "0.5296556", "0.5291375", "0.52873504", "0.5281287", "0.5281037" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->insert([ [ 'email' => '[email protected]', 'nick' => 'Tuti', 'password' => bcrypt('tuti') ], [ 'email' => '[email protected]', 'nick' => 'Admin', 'password' => bcrypt('admin'), ] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Stubbed out instead of making a DB call
public static function find($id) { return new static($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setUpAndReturnDatabaseStub() {}", "protected function setUpDatabaseConnectionMock() {}", "private function setUpDatabaseMockForDeterminePageId() {}", "public function getFromDB() {}", "protected function getStub()\n {\n //\n }", "protected function getStub()\n {\n }", "public function testImproperApiMethod()\n {\n $this->testedDao->fetchImproperDataName();\n }", "public function testFetchObject()\n {\n $this->todo('stub');\n }", "public function test_executeQuery()\n\t{\n\t}", "public function testFetch()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with(\\PDO::FETCH_ASSOC)->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetch')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetch());\n }", "protected function getStub()\n {\n return;\n }", "public function testGetQueryResult()\n {\n }", "public function test_get_row() {\n }", "public function testORM()\r\n {\r\n\r\n }", "public function mockConnection()\n\t{\n\t\treturn $this->getMockBuilder('Illuminate\\Database\\Connection')\n\t\t\t\t\t->disableOriginalConstructor()\n\t\t\t\t\t->setMethods(array('beginTransaction', 'commit', 'rollback'))\n\t\t\t\t\t->getMock();\n\t}", "public function testRawQuery()\n {\n $this->mockPdo->shouldReceive('query')->once()->with('SQL STRING')->andReturn($this->mockPdoStatement);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals($this->mockPdoStatement, $connection->rawQuery('SQL STRING'));\n }", "public function testMockOrm(){\n $ormMock = $this->createMock(ORM::class);\n $expectedReturn = [1,2,3,4,5];\n\n $ormMock->method(\"getAllUserIds\")\n ->willReturn($expectedReturn);\n\n $this->assertEquals($expectedReturn, $ormMock->getAllUserIds());\n }", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function testFetchAll()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with(\\PDO::FETCH_ASSOC)->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetchAll')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetchAll());\n }", "protected function getDatabase() {}", "public function testHandleQuery()\n {\n $query = Qry::create([]);\n\n $mockResult = m::mock();\n $mockResult->shouldReceive('serialize')->once()->andReturn('foo');\n\n $this->repoMap['Submission']->shouldReceive('fetchList')\n ->with($query, m::type('integer'))\n ->andReturn([$mockResult]);\n\n $this->repoMap['Submission']->shouldReceive('fetchCount')\n ->with($query)\n ->andReturn(2);\n\n $result = $this->sut->handleQuery($query);\n $this->assertEquals($result['count'], 2);\n $this->assertEquals($result['result'], ['foo']);\n }", "protected function getStub(){\n\t\tthrow new BadMethodCallException(\"Create your own getStub method to declare fields\");\n\t}", "function test_select_one($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_one($sql);\n return $result;\n}", "public function testFetch()\n {\n $this->todo('stub');\n }", "public function testFetch()\n {\n $this->todo('stub');\n }", "public function testFetchWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetch')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetch('parameters', 'value'));\n }", "protected function initDatabaseRecord() {}", "public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }", "public function testRunASqlQuery2(){\r\n $sql = \"Select * from 123;\";//No table named 123\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(false,$success);\r\n }", "public function testSchemaNoDB() {\n\t\t$model = $this->getMock('Article', array('getDataSource'));\n\t\t$model->useTable = false;\n\t\t$model->expects($this->never())->method('getDataSource');\n\t\t$this->assertEmpty($model->schema());\n\t}", "public function testQuarantineFindOne()\n {\n\n }", "function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }", "protected function setUpTestDatabase() {}", "function query() {\n // Do nothing: fake field.\n }", "public function testGetDB(): void\n {\n $this->assertIsObject($this->stack::getPDO());\n }", "protected static function afterGetFromDB(&$row){}", "protected function mockDb( array $dbResult ) {\n\t\t$dbResult += [\n\t\t\t'insert' => '',\n\t\t\t'select' => '',\n\t\t\t'selectRow' => '',\n\t\t\t'delete' => ''\n\t\t];\n\n\t\t$db = $this->createMock( IDatabase::class );\n\t\t$db->method( 'insert' )\n\t\t\t->willReturn( $dbResult['insert'] );\n\t\t$db->method( 'select' )\n\t\t\t->willReturn( $dbResult['select'] );\n\t\t$db->method( 'delete' )\n\t\t\t->willReturn( $dbResult['delete'] );\n\t\t$db->method( 'selectRow' )\n\t\t\t->willReturn( $dbResult['selectRow'] );\n\t\t$db->method( 'onTransactionCommitOrIdle' )\n\t\t\t->will( new EchoExecuteFirstArgumentStub );\n\n\t\treturn $db;\n\t}", "public function testCanRetrieveUsingRawSql()\n {\n\n $aOrderContents = $this->db->newQuery()\n ->findRaw('select ordercontents.*, products.* from ordercontents inner join products on products.pid = ordercontents.pid where masterOrderId = ? order by uid asc',\n 'uid', array('1'))\n ->extractInto('Test_OrderContent')\n ->extractInto('Test_Product')\n ->go();\n\n $orderContent = $aOrderContents[0]['Test_OrderContent'];\n $product = $aOrderContents[0]['Test_Product'];\n $raw = $aOrderContents[0]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => 1,\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n\n $orderContent = $aOrderContents[1]['Test_OrderContent'];\n $product = $aOrderContents[1]['Test_Product'];\n $raw = $aOrderContents[1]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => '4',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n }", "function test_select_items($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_items($sql);\n return $result;\n}", "public function testUserWithIdReturnsPopulatedUser()\n {\n $id = 'abc123def4';\n $this->mockData['id'] = $id;\n $expectedQuery = \"SELECT id, first_name, last_name, email, github_handle, irc_nick, \";\n $expectedQuery .= \"twitter_handle, mentor_available, apprentice_available, \";\n $expectedQuery .= \"timezone FROM user WHERE id = :id\";\n $teachingQuery = 'SELECT id_tag FROM teaching_skills WHERE id_user = :id';\n $learningQuery = 'SELECT id_tag FROM learning_skills WHERE id_user = :id';\n\n $this->db->expects($this->at(0))\n ->method('prepare')\n ->with($expectedQuery)\n ->will($this->returnValue($this->statement));\n\n $this->db->expects($this->at(1))\n ->method('prepare')\n ->with($teachingQuery)\n ->will($this->returnValue($this->statement));\n\n $this->db->expects($this->at(2))\n ->method('prepare')\n ->with($learningQuery)\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->exactly(3))\n ->method('execute')\n ->with(array('id' => $id))\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->at(1))\n ->method('fetch')\n ->will($this->returnValue($this->mockData));\n\n $this->statement->expects($this->at(2))\n ->method('fetch')\n ->will($this->returnValue(array('id_tag' => 'skill')));\n\n $this->statement->expects($this->at(3))\n ->method('fetch')\n ->will($this->returnValue(array('id_tag' => 'skill')));\n \n\n $userService = new UserService($this->db);\n $returnedUser = $userService->retrieve($id);\n $this->assertEquals(\n $this->mockData['id'],\n $returnedUser->id,\n 'ID was not the same'\n );\n $this->assertEquals(\n $this->mockData['first_name'],\n $returnedUser->firstName,\n 'First name was not the same'\n ); \n $this->assertEquals(\n array('skill'),\n $returnedUser->teachingSkills,\n 'Skills not assigned to user'\n );\n }", "public function testRunASqlQuery(){\r\n $sql = \"Select * from orders;\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(true,$success);\r\n }", "protected function setUp()\n\t{\n\t\t$this->db = $this->mockConnection();\n\n\t\t// create stub for Abstract Repository\n\t\t$this->stub = $this\t->getMockBuilder('NPlavsic\\LRepository\\AbstractRepository')\n\t\t\t\t\t\t\t->setConstructorArgs(array($this->db))\n\t\t\t\t\t\t\t->getMockForAbstractClass();\n\n\t\t\n\t}", "public function testFetchNew()\n {\n $this->skip('abstract method');\n }", "public function testGet()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:', 'prefix' => 'pre_']);\n $database->statement('CREATE TABLE pre_items(id INTEGER PRIMARY KEY ASC, name TEXT, value NUMERIC)');\n $database->insert(\n 'INSERT INTO pre_items (name, value) VALUES (?, ?), (?, ?), (?, ?), (?, ?)',\n ['Banana', 123, 'Apple', -10, 'Pen', null, 'Bottle', 0]\n );\n\n // Default processor\n $superQuery = new QueryProxy($database->table('items'));\n $superQuery->whereNotNull('value')->orderBy('id', 'desc');\n $this->assertEquals([\n ['id' => 4, 'name' => 'Bottle', 'value' => 0],\n ['id' => 2, 'name' => 'Apple', 'value' => -10],\n ['id' => 1, 'name' => 'Banana', 'value' => 123]\n ], $superQuery->get());\n\n // Custom processor\n $superQuery = new class ($database->table('items')) extends QueryProxy {\n protected function processFetchedRow(array $row)\n {\n return implode('|', $row);\n }\n };\n $superQuery->whereNotNull('value')->orderBy('id', 'desc');\n $this->assertEquals(['4|Bottle|0', '2|Apple|-10', '1|Banana|123'], $superQuery->get());\n\n // Error handling\n $query = new Query($database);\n $superQuery = new QueryProxy($query);\n $this->assertException(IncorrectQueryException::class, function () use ($superQuery) {\n $superQuery->get();\n });\n }", "public function __construct()\n {\n $pdoDouble = \\Mockery::mock('PDO');\n parent::__construct($pdoDouble);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function testFetchAllWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetchAll')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetchAll('parameters', 'value'));\n }", "public function testFetchAll()\n {\n $originalData = array(\n 1 => array('id' => 1, 'username' => 'root', 'password' => 'password'),\n 2 => array('id' => 2, 'username' => 'user1', 'password' => 'password2'),\n 3 => array('id' => 3, 'username' => 'user2', 'password' => 'password3'),\n );\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchAll'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnCallback(function($arg1) use ($originalData) {\n $sql = 'SELECT\n *\nFROM\n `users`\nORDER BY\n id ASC';\n\n if($arg1 == $sql) {\n return $originalData;\n } else {\n array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n\n $result = $storage->fetchAll('users');\n\n $this->assertEquals(3, count($result));\n foreach($result as $row) {\n $this->assertEquals($originalData[$row['id']]['id'], $row['id']);\n $this->assertEquals($originalData[$row['id']]['username'], $row['username']);\n $this->assertEquals($originalData[$row['id']]['password'], $row['password']);\n }\n }", "protected function mockDb( array $dbResult ) {\n\t\t$dbResult += [\n\t\t\t'insert' => '',\n\t\t\t'insertId' => '',\n\t\t\t'select' => '',\n\t\t\t'delete' => ''\n\t\t];\n\t\t$db = $this->createMock( IDatabase::class );\n\t\t$db->method( 'insert' )\n\t\t\t->willReturn( $dbResult['insert'] );\n\t\t$db->method( 'insertId' )\n\t\t\t->willReturn( $dbResult['insertId'] );\n\t\t$db->method( 'select' )\n\t\t\t->willReturn( $dbResult['select'] );\n\t\t$db->method( 'delete' )\n\t\t\t->willReturn( $dbResult['delete'] );\n\n\t\treturn $db;\n\t}", "function augmentDatabase() {\r\n\t}", "public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbEraser = new stubDatabaseEraser($databaseQueryBuilderProvider);\n }", "public function loadFromDB()\n {\n }", "public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbFinder = new stubDatabaseFinder($databaseQueryBuilderProvider);\n }", "public function testAbstractClassInternalMethod()\n {\n $this->assertTrue(\n $this->newAnonymousClassFromModel->connectDb()\n );\n }", "protected function setUp()\n {\n $this->object = new Sql();\n }", "public function _query()\n {\n }", "private function populateDummyTable() {}", "public function ormObject();", "function test_query($urabe, $body)\n{\n $sql = $body->update_sql;\n return $urabe->query($sql);\n}", "public function testModEagerFetch()\n {\n $this->todo('stub');\n }", "function so_sql()\n\t{\n\t\tthrow new egw_exception_assertion_failed('use __construct()!');\n\t}", "public function testFetchEmpty()\n {\n $this->skip('abstract method');\n }", "public function testSelectWithNoParameters()\n {\n $this->db->select(\"test\");\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "function test_get_table_definition($urabe, $body)\n{\n $result = $urabe->get_table_definition($body->table_name);\n $result->message = \"Urabe test get table definition\";\n return $result;\n}", "public function testFetchAllBy()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchAll'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n username = :username\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('username' => 'root')) {\n return array($data);\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->fetchAllBy(array('username' => 'root'), 'users');\n\n $this->assertEquals(1, count($result));\n $this->assertEquals($data['id'], $result[0]['id']);\n $this->assertEquals($data['username'], $result[0]['username']);\n $this->assertEquals($data['password'], $result[0]['password']);\n }", "public function testConnection();", "public function test_getLegacyLowstockContactById() {\n\n }", "public function testQuarantineFindById()\n {\n\n }", "public function setUp() {\n ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n }", "function test_insert($urabe, $body)\n{\n $insert_params = $body->insert_params;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert($table_name, $insert_params);\n}", "public function testCatalogSaveCustomColumn()\n {\n\n }", "function __construct(){\n $this->Connection=Connector::GetConnection();\n if($this->TestStructure){\n $this->TestTableStructure();\n }\n }", "public function testGetReplenishmentById()\n {\n }", "public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }", "public function test_prepare_item() {}", "#[@test]\n public function unbufferedReadOneResult() {\n $this->createTable();\n $db= $this->db();\n\n $q= $db->open('select * from unittest');\n $this->assertEquals(array('pk' => 1, 'username' => 'kiesel'), $q->next());\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "public function testTableMethod() {\n\t\t$table = new Table(['table' => 'users']);\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = new UsersTable;\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = $this->getMockBuilder('Table')\n\t\t\t\t->setMethods(['find'])\n\t\t\t\t->setMockClassName('SpecialThingsTable')\n\t\t\t\t->getMock();\n\t\t$this->assertEquals('special_things', $table->table());\n\n\t\t$table = new Table(['alias' => 'LoveBoats']);\n\t\t$this->assertEquals('love_boats', $table->table());\n\n\t\t$table->table('other');\n\t\t$this->assertEquals('other', $table->table());\n\t}", "public function testIfQueryWorks()\n {\n $this->database->query(\"SELECT * FROM users\");\n\n $data = $this->database->resultSet();\n\n $this->assertIsArray($data);\n }", "abstract protected function doGetAdapter();", "public function testConnection()\n {\n }", "public function __invoke() { $db = new \\PDO('mysql:host=127.0.0.1;dbname=todo','root', 'password');\n $db->setAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_ASSOC);\n // this makes PDO give error messages if it has issues trying to update the db, otherwise it would fail silently\n $db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n return $db;\n }", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/Model.stub';\n }", "abstract public function prepare(): self;", "public function test_getDuplicateLegacyLowstockContactById() {\n\n }", "public function testWithMethodGivenQueryBuilderInstanceWhenNotPaginated()\n {\n $expected = ['foo'];\n $stub = new Grid($this->getContainer(), []);\n\n $model = m::mock('\\Illuminate\\Database\\Query\\Builder');\n $arrayable = m::mock('\\Illuminate\\Contracts\\Support\\Arrayable');\n\n $model->shouldReceive('get')->once()->andReturn($arrayable);\n $arrayable->shouldReceive('toArray')->once()->andReturn($expected);\n\n $stub->with($model);\n $stub->paginate(null);\n\n $this->assertEquals($expected, $stub->data());\n }", "private static function test_db( $params_array ) {\n $table_name = ( isset( $params_array[ 'prefix' ] ) ? $params_array[ 'prefix' ] : '' ) . self::DUMMY_TABLE_NAME;\n $dummy_data = str_repeat ( 'Z' , 256 );\n $str_data = sprintf( '(\"%s\")', $dummy_data );\n for ( $i = 1; $i < 63; $i++) {\n $str_data .= sprintf( ',(\"%s\")', $dummy_data );\n }\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"CREATE TABLE if not exists $table_name (dummydata text NOT NULL DEFAULT '')\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"insert into $table_name (dummydata) values \" . $str_data . \";\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"select * from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"update $table_name set dummydata = '\" . __CLASS__ . \"';\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"delete from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"DROP TABLE if exists $table_name;\" );\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->database = \\oxDb::getDb();\n }", "#[@test]\n public function unbufferedReadNoResults() {\n $this->createTable();\n $db= $this->db();\n\n $db->open('select * from unittest');\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "public function testGetApropriateConnectionBase(): void\n {\n // setup\n $this->setConnection('default-db-connection');\n $obj = new TraitClientBase(new PdoCrudMock());\n $obj::setConnection(null);\n\n // test body\n $connection = $obj->getApropriateConnection();\n\n // assertions\n $this->assertInstanceOf(PdoCrudMock::class, $connection);\n }", "public function testCatalogGetCatalogColumns()\n {\n\n }", "private function mockClass( $return ): \\PHPUnit\\Framework\\MockObject\\MockObject\n {\n $mock = $this->createMock('\\db\\Connect');\n $mock->expects($this->exactly( 2 ))\n ->method('single')\n ->will($this->returnValue( $return[0] ));\n $mock->expects($this->once())\n ->method('bind_multiple');\n $mock->expects($this->once())\n ->method('query')\n ->will($this->returnValue( $return[1] ));\n\n return $mock;\n }", "public function dbInstance();", "protected function setUp() {\n\t\t$this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');\n\t\t$this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');\n\t\t$this->_rowset = $this->_getCleanMock('Zend_Db_Table_Rowset_Abstract');\n\t\t$this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));\n\n\t\t$this->object = new GTW_Model_User_Mapper($this->_tableGateway);\n\t}", "public function testExecuteSuccessfully() {\n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"call\"))\n ->getMock();\n \n $stub->queryString = \"SELECT * FROM test\";\n \n $mockLogger = $this->getMockBuilder(\"\\Logger\")\n ->disableOriginalConstructor()\n ->getMock();\n \n $property = new \\ReflectionProperty($stub, \"logger\");\n $property->setAccessible(true);\n $property->setValue($stub, $mockLogger);\n \n $response = new \\TExecuteStatementResp(array(\"operationHandle\" => \"fake\"));\n\n $stub->expects($this->once())\n ->method(\"call\")\n ->will($this->returnValue($response));\n \n $this->assertTrue($stub->execute());\n \n $property = new \\ReflectionProperty($stub, \"operationHandle\");\n $property->setAccessible(true);\n $this->assertEquals(\"fake\", $property->getValue($stub));\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "public function testSelect()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $select = $connection->select();\n\n $this->assertInstanceOf(Query\\Select::class, $select);\n $this->assertEquals($connection, $select->connection);\n }", "protected function stub(): string\n {\n return 'seeder.php.stub';\n }", "public function testSetNativeModel()\n {\n $this->todo('stub');\n }", "public function testGetListRawWithTable()\n {\n $GLOBALS['dbi']->expects($this->once())\n ->method('fetchResult')\n ->with(\n \"SELECT * FROM `pma_central_columns` \"\n . \"WHERE db_name = 'phpmyadmin' AND col_name \"\n . \"NOT IN ('id','col1','col2');\",\n null, null, DatabaseInterface::CONNECT_CONTROL\n )\n ->will(\n $this->returnValue($this->columnData)\n );\n $this->assertEquals(\n json_encode($this->modifiedColumnData),\n $this->centralColumns->getListRaw(\n 'phpmyadmin',\n 'table1'\n )\n );\n\n }" ]
[ "0.77180743", "0.6970749", "0.6400718", "0.61044645", "0.61017376", "0.6099842", "0.60459334", "0.60313255", "0.60307956", "0.58866453", "0.58591336", "0.5822337", "0.5746937", "0.5733085", "0.5730609", "0.5715901", "0.5693191", "0.5693184", "0.567435", "0.566929", "0.56682134", "0.5668126", "0.56611645", "0.56592065", "0.56592065", "0.5656204", "0.56559074", "0.5655643", "0.561634", "0.56006664", "0.5596535", "0.55954367", "0.55896693", "0.55873823", "0.55763894", "0.55486465", "0.5546396", "0.5541955", "0.5526999", "0.5503842", "0.5487218", "0.54757446", "0.54696304", "0.5466476", "0.5462064", "0.5455725", "0.5448005", "0.54469335", "0.54450476", "0.54428643", "0.5442767", "0.5440194", "0.5424774", "0.54052925", "0.5379203", "0.5356264", "0.53403777", "0.5328608", "0.5323882", "0.5321387", "0.53175414", "0.53137445", "0.5305241", "0.5298376", "0.5278259", "0.52758634", "0.5275263", "0.52646947", "0.5252987", "0.52513695", "0.52437013", "0.5231563", "0.52303606", "0.5229224", "0.52290475", "0.5221729", "0.5219971", "0.5218984", "0.5214876", "0.5213487", "0.5212906", "0.5212542", "0.5212122", "0.5211328", "0.5209978", "0.52064514", "0.5205824", "0.51947314", "0.5193612", "0.5185588", "0.5181343", "0.518037", "0.51797664", "0.5175484", "0.5175198", "0.51731133", "0.51718783", "0.5171811", "0.51715654", "0.5171389", "0.51702297" ]
0.0
-1
Stubbed out instead of making a DB call
public function __construct($id) { $this->id = $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setUpAndReturnDatabaseStub() {}", "protected function setUpDatabaseConnectionMock() {}", "private function setUpDatabaseMockForDeterminePageId() {}", "public function getFromDB() {}", "protected function getStub()\n {\n //\n }", "protected function getStub()\n {\n }", "public function testImproperApiMethod()\n {\n $this->testedDao->fetchImproperDataName();\n }", "public function testFetchObject()\n {\n $this->todo('stub');\n }", "public function test_executeQuery()\n\t{\n\t}", "public function testFetch()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with(\\PDO::FETCH_ASSOC)->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetch')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetch());\n }", "protected function getStub()\n {\n return;\n }", "public function testGetQueryResult()\n {\n }", "public function test_get_row() {\n }", "public function testORM()\r\n {\r\n\r\n }", "public function mockConnection()\n\t{\n\t\treturn $this->getMockBuilder('Illuminate\\Database\\Connection')\n\t\t\t\t\t->disableOriginalConstructor()\n\t\t\t\t\t->setMethods(array('beginTransaction', 'commit', 'rollback'))\n\t\t\t\t\t->getMock();\n\t}", "public function testRawQuery()\n {\n $this->mockPdo->shouldReceive('query')->once()->with('SQL STRING')->andReturn($this->mockPdoStatement);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals($this->mockPdoStatement, $connection->rawQuery('SQL STRING'));\n }", "public function testMockOrm(){\n $ormMock = $this->createMock(ORM::class);\n $expectedReturn = [1,2,3,4,5];\n\n $ormMock->method(\"getAllUserIds\")\n ->willReturn($expectedReturn);\n\n $this->assertEquals($expectedReturn, $ormMock->getAllUserIds());\n }", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function testFetchAll()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with(\\PDO::FETCH_ASSOC)->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetchAll')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetchAll());\n }", "protected function getDatabase() {}", "public function testHandleQuery()\n {\n $query = Qry::create([]);\n\n $mockResult = m::mock();\n $mockResult->shouldReceive('serialize')->once()->andReturn('foo');\n\n $this->repoMap['Submission']->shouldReceive('fetchList')\n ->with($query, m::type('integer'))\n ->andReturn([$mockResult]);\n\n $this->repoMap['Submission']->shouldReceive('fetchCount')\n ->with($query)\n ->andReturn(2);\n\n $result = $this->sut->handleQuery($query);\n $this->assertEquals($result['count'], 2);\n $this->assertEquals($result['result'], ['foo']);\n }", "protected function getStub(){\n\t\tthrow new BadMethodCallException(\"Create your own getStub method to declare fields\");\n\t}", "function test_select_one($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_one($sql);\n return $result;\n}", "public function testFetch()\n {\n $this->todo('stub');\n }", "public function testFetch()\n {\n $this->todo('stub');\n }", "public function testFetchWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetch')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetch('parameters', 'value'));\n }", "protected function initDatabaseRecord() {}", "public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }", "public function testRunASqlQuery2(){\r\n $sql = \"Select * from 123;\";//No table named 123\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(false,$success);\r\n }", "public function testSchemaNoDB() {\n\t\t$model = $this->getMock('Article', array('getDataSource'));\n\t\t$model->useTable = false;\n\t\t$model->expects($this->never())->method('getDataSource');\n\t\t$this->assertEmpty($model->schema());\n\t}", "public function testQuarantineFindOne()\n {\n\n }", "function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "public function testQueryFetchDefault() {\n $records = [];\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] = :age', [':age' => 25]);\n $this->assertInstanceOf(StatementInterface::class, $result);\n foreach ($result as $record) {\n $records[] = $record;\n $this->assertIsObject($record);\n $this->assertSame('John', $record->name);\n }\n\n $this->assertCount(1, $records, 'There is only one record.');\n }", "protected function setUpTestDatabase() {}", "function query() {\n // Do nothing: fake field.\n }", "public function testGetDB(): void\n {\n $this->assertIsObject($this->stack::getPDO());\n }", "protected static function afterGetFromDB(&$row){}", "protected function mockDb( array $dbResult ) {\n\t\t$dbResult += [\n\t\t\t'insert' => '',\n\t\t\t'select' => '',\n\t\t\t'selectRow' => '',\n\t\t\t'delete' => ''\n\t\t];\n\n\t\t$db = $this->createMock( IDatabase::class );\n\t\t$db->method( 'insert' )\n\t\t\t->willReturn( $dbResult['insert'] );\n\t\t$db->method( 'select' )\n\t\t\t->willReturn( $dbResult['select'] );\n\t\t$db->method( 'delete' )\n\t\t\t->willReturn( $dbResult['delete'] );\n\t\t$db->method( 'selectRow' )\n\t\t\t->willReturn( $dbResult['selectRow'] );\n\t\t$db->method( 'onTransactionCommitOrIdle' )\n\t\t\t->will( new EchoExecuteFirstArgumentStub );\n\n\t\treturn $db;\n\t}", "public function testCanRetrieveUsingRawSql()\n {\n\n $aOrderContents = $this->db->newQuery()\n ->findRaw('select ordercontents.*, products.* from ordercontents inner join products on products.pid = ordercontents.pid where masterOrderId = ? order by uid asc',\n 'uid', array('1'))\n ->extractInto('Test_OrderContent')\n ->extractInto('Test_Product')\n ->go();\n\n $orderContent = $aOrderContents[0]['Test_OrderContent'];\n $product = $aOrderContents[0]['Test_Product'];\n $raw = $aOrderContents[0]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '1',\n 'masterOrderId' => '1',\n 'pid' => '1',\n 'quantity' => '5',\n 'cost' => '8.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => 1,\n 'productName' => 'Gentoo LAMP Server',\n 'productSummary' => 'A Linux/Apache/MySQL/PHP Stack for server environments',\n 'productUrl' => 'http://lamp.gentoo.org/server/',\n 'productCode' => 'AA001',\n 'productCost' => '15.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n\n $orderContent = $aOrderContents[1]['Test_OrderContent'];\n $product = $aOrderContents[1]['Test_Product'];\n $raw = $aOrderContents[1]['__raw'];\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $raw\n );\n\n $this->assertEquals\n (\n array\n (\n 'uid' => '2',\n 'masterOrderId' => '1',\n 'pid' => '4',\n 'quantity' => '20',\n 'cost' => '50.99',\n ),\n $orderContent->getData()\n );\n\n $this->assertEquals\n (\n array\n (\n 'pid' => '4',\n 'productName' => 'Gentoo/ALT',\n 'productSummary' => 'Gentoo package management on non-Linux kernels',\n 'productUrl' => 'http://alt.gentoo.org/',\n 'productCode' => 'AA004',\n 'productCost' => '3.99',\n 'isActive' => '1',\n ),\n $product->getData()\n );\n }", "function test_select_items($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_items($sql);\n return $result;\n}", "public function testUserWithIdReturnsPopulatedUser()\n {\n $id = 'abc123def4';\n $this->mockData['id'] = $id;\n $expectedQuery = \"SELECT id, first_name, last_name, email, github_handle, irc_nick, \";\n $expectedQuery .= \"twitter_handle, mentor_available, apprentice_available, \";\n $expectedQuery .= \"timezone FROM user WHERE id = :id\";\n $teachingQuery = 'SELECT id_tag FROM teaching_skills WHERE id_user = :id';\n $learningQuery = 'SELECT id_tag FROM learning_skills WHERE id_user = :id';\n\n $this->db->expects($this->at(0))\n ->method('prepare')\n ->with($expectedQuery)\n ->will($this->returnValue($this->statement));\n\n $this->db->expects($this->at(1))\n ->method('prepare')\n ->with($teachingQuery)\n ->will($this->returnValue($this->statement));\n\n $this->db->expects($this->at(2))\n ->method('prepare')\n ->with($learningQuery)\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->exactly(3))\n ->method('execute')\n ->with(array('id' => $id))\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->at(1))\n ->method('fetch')\n ->will($this->returnValue($this->mockData));\n\n $this->statement->expects($this->at(2))\n ->method('fetch')\n ->will($this->returnValue(array('id_tag' => 'skill')));\n\n $this->statement->expects($this->at(3))\n ->method('fetch')\n ->will($this->returnValue(array('id_tag' => 'skill')));\n \n\n $userService = new UserService($this->db);\n $returnedUser = $userService->retrieve($id);\n $this->assertEquals(\n $this->mockData['id'],\n $returnedUser->id,\n 'ID was not the same'\n );\n $this->assertEquals(\n $this->mockData['first_name'],\n $returnedUser->firstName,\n 'First name was not the same'\n ); \n $this->assertEquals(\n array('skill'),\n $returnedUser->teachingSkills,\n 'Skills not assigned to user'\n );\n }", "public function testRunASqlQuery(){\r\n $sql = \"Select * from orders;\";\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $success = $db->runASqlQuery($sql);\r\n $this->assertEquals(true,$success);\r\n }", "protected function setUp()\n\t{\n\t\t$this->db = $this->mockConnection();\n\n\t\t// create stub for Abstract Repository\n\t\t$this->stub = $this\t->getMockBuilder('NPlavsic\\LRepository\\AbstractRepository')\n\t\t\t\t\t\t\t->setConstructorArgs(array($this->db))\n\t\t\t\t\t\t\t->getMockForAbstractClass();\n\n\t\t\n\t}", "public function testFetchNew()\n {\n $this->skip('abstract method');\n }", "public function testGet()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:', 'prefix' => 'pre_']);\n $database->statement('CREATE TABLE pre_items(id INTEGER PRIMARY KEY ASC, name TEXT, value NUMERIC)');\n $database->insert(\n 'INSERT INTO pre_items (name, value) VALUES (?, ?), (?, ?), (?, ?), (?, ?)',\n ['Banana', 123, 'Apple', -10, 'Pen', null, 'Bottle', 0]\n );\n\n // Default processor\n $superQuery = new QueryProxy($database->table('items'));\n $superQuery->whereNotNull('value')->orderBy('id', 'desc');\n $this->assertEquals([\n ['id' => 4, 'name' => 'Bottle', 'value' => 0],\n ['id' => 2, 'name' => 'Apple', 'value' => -10],\n ['id' => 1, 'name' => 'Banana', 'value' => 123]\n ], $superQuery->get());\n\n // Custom processor\n $superQuery = new class ($database->table('items')) extends QueryProxy {\n protected function processFetchedRow(array $row)\n {\n return implode('|', $row);\n }\n };\n $superQuery->whereNotNull('value')->orderBy('id', 'desc');\n $this->assertEquals(['4|Bottle|0', '2|Apple|-10', '1|Banana|123'], $superQuery->get());\n\n // Error handling\n $query = new Query($database);\n $superQuery = new QueryProxy($query);\n $this->assertException(IncorrectQueryException::class, function () use ($superQuery) {\n $superQuery->get();\n });\n }", "public function __construct()\n {\n $pdoDouble = \\Mockery::mock('PDO');\n parent::__construct($pdoDouble);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function testFetchAllWithParameters()\n {\n $this->mockPdoStatement->shouldReceive('execute')->once()->withNoArgs();\n $this->mockPdoStatement->shouldReceive('setFetchMode')->once()->with('parameters', 'value')->andReturnSelf();\n $this->mockPdoStatement->shouldReceive('fetchAll')->once()->withNoArgs()->andReturn('fetched');\n $this->mockPdo->shouldReceive('prepare')->once()->with('SQL')->andReturn($this->mockPdoStatement);\n\n\n $query = (new Select($this->mockConnection));\n $query->query('SQL', []);\n $this->assertEquals('fetched', $query->fetchAll('parameters', 'value'));\n }", "public function testFetchAll()\n {\n $originalData = array(\n 1 => array('id' => 1, 'username' => 'root', 'password' => 'password'),\n 2 => array('id' => 2, 'username' => 'user1', 'password' => 'password2'),\n 3 => array('id' => 3, 'username' => 'user2', 'password' => 'password3'),\n );\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchAll'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnCallback(function($arg1) use ($originalData) {\n $sql = 'SELECT\n *\nFROM\n `users`\nORDER BY\n id ASC';\n\n if($arg1 == $sql) {\n return $originalData;\n } else {\n array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n\n $result = $storage->fetchAll('users');\n\n $this->assertEquals(3, count($result));\n foreach($result as $row) {\n $this->assertEquals($originalData[$row['id']]['id'], $row['id']);\n $this->assertEquals($originalData[$row['id']]['username'], $row['username']);\n $this->assertEquals($originalData[$row['id']]['password'], $row['password']);\n }\n }", "protected function mockDb( array $dbResult ) {\n\t\t$dbResult += [\n\t\t\t'insert' => '',\n\t\t\t'insertId' => '',\n\t\t\t'select' => '',\n\t\t\t'delete' => ''\n\t\t];\n\t\t$db = $this->createMock( IDatabase::class );\n\t\t$db->method( 'insert' )\n\t\t\t->willReturn( $dbResult['insert'] );\n\t\t$db->method( 'insertId' )\n\t\t\t->willReturn( $dbResult['insertId'] );\n\t\t$db->method( 'select' )\n\t\t\t->willReturn( $dbResult['select'] );\n\t\t$db->method( 'delete' )\n\t\t\t->willReturn( $dbResult['delete'] );\n\n\t\treturn $db;\n\t}", "function augmentDatabase() {\r\n\t}", "public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbEraser = new stubDatabaseEraser($databaseQueryBuilderProvider);\n }", "public function loadFromDB()\n {\n }", "public function setUp()\n {\n $this->mockConnection = $this->getMock('stubDatabaseConnection');\n $this->mockConnection->expects($this->any())->method('getDatabase')->will($this->returnValue('mock'));\n $this->mockQueryBuilder = new TeststubDatabaseQueryBuilder();\n $databaseQueryBuilderProvider = $this->getMock('stubDatabaseQueryBuilderProvider', array(), array(), '', false);\n $databaseQueryBuilderProvider->expects($this->any())\n ->method('create')\n ->will($this->returnValue($this->mockQueryBuilder));\n $this->dbFinder = new stubDatabaseFinder($databaseQueryBuilderProvider);\n }", "public function testAbstractClassInternalMethod()\n {\n $this->assertTrue(\n $this->newAnonymousClassFromModel->connectDb()\n );\n }", "protected function setUp()\n {\n $this->object = new Sql();\n }", "public function _query()\n {\n }", "private function populateDummyTable() {}", "public function ormObject();", "function test_query($urabe, $body)\n{\n $sql = $body->update_sql;\n return $urabe->query($sql);\n}", "public function testModEagerFetch()\n {\n $this->todo('stub');\n }", "function so_sql()\n\t{\n\t\tthrow new egw_exception_assertion_failed('use __construct()!');\n\t}", "public function testFetchEmpty()\n {\n $this->skip('abstract method');\n }", "public function testSelectWithNoParameters()\n {\n $this->db->select(\"test\");\n $this->assertEquals(\"SELECT * FROM test\", (string) $this->db);\n }", "function test_get_table_definition($urabe, $body)\n{\n $result = $urabe->get_table_definition($body->table_name);\n $result->message = \"Urabe test get table definition\";\n return $result;\n}", "public function testFetchAllBy()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchAll'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n username = :username\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('username' => 'root')) {\n return array($data);\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->fetchAllBy(array('username' => 'root'), 'users');\n\n $this->assertEquals(1, count($result));\n $this->assertEquals($data['id'], $result[0]['id']);\n $this->assertEquals($data['username'], $result[0]['username']);\n $this->assertEquals($data['password'], $result[0]['password']);\n }", "public function testConnection();", "public function test_getLegacyLowstockContactById() {\n\n }", "public function testQuarantineFindById()\n {\n\n }", "public function setUp() {\n ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n }", "function test_insert($urabe, $body)\n{\n $insert_params = $body->insert_params;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert($table_name, $insert_params);\n}", "public function testCatalogSaveCustomColumn()\n {\n\n }", "function __construct(){\n $this->Connection=Connector::GetConnection();\n if($this->TestStructure){\n $this->TestTableStructure();\n }\n }", "public function testGetReplenishmentById()\n {\n }", "public function testFindByIdIsSuccess()\n {\n $tblGateMock = $this->getMockBuilder(TableGateway::class)\n ->setConstructorArgs(array($this->getDbal()))\n ->setMethodsExcept(['findById', 'setTable'])\n ->getMock();\n $tblGateMock->setTable('Person');\n\n //exercise SUT\n $row = $tblGateMock->findById($this->person['id']);\n\n //assert return value\n $this->assertTrue(is_array($row), 'result not array');\n $this->assertNotEmpty($row, 'result set is empty');\n\n foreach(array_keys($this->person) as $key) {\n $this->assertArrayHasKey($key, $row[0]);\n $this->assertEquals($this->person[$key], $row[0][$key]);\n }\n }", "public function test_prepare_item() {}", "#[@test]\n public function unbufferedReadOneResult() {\n $this->createTable();\n $db= $this->db();\n\n $q= $db->open('select * from unittest');\n $this->assertEquals(array('pk' => 1, 'username' => 'kiesel'), $q->next());\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "public function testTableMethod() {\n\t\t$table = new Table(['table' => 'users']);\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = new UsersTable;\n\t\t$this->assertEquals('users', $table->table());\n\n\t\t$table = $this->getMockBuilder('Table')\n\t\t\t\t->setMethods(['find'])\n\t\t\t\t->setMockClassName('SpecialThingsTable')\n\t\t\t\t->getMock();\n\t\t$this->assertEquals('special_things', $table->table());\n\n\t\t$table = new Table(['alias' => 'LoveBoats']);\n\t\t$this->assertEquals('love_boats', $table->table());\n\n\t\t$table->table('other');\n\t\t$this->assertEquals('other', $table->table());\n\t}", "public function testIfQueryWorks()\n {\n $this->database->query(\"SELECT * FROM users\");\n\n $data = $this->database->resultSet();\n\n $this->assertIsArray($data);\n }", "abstract protected function doGetAdapter();", "public function testConnection()\n {\n }", "public function __invoke() { $db = new \\PDO('mysql:host=127.0.0.1;dbname=todo','root', 'password');\n $db->setAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_ASSOC);\n // this makes PDO give error messages if it has issues trying to update the db, otherwise it would fail silently\n $db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n return $db;\n }", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/Model.stub';\n }", "abstract public function prepare(): self;", "public function test_getDuplicateLegacyLowstockContactById() {\n\n }", "public function testWithMethodGivenQueryBuilderInstanceWhenNotPaginated()\n {\n $expected = ['foo'];\n $stub = new Grid($this->getContainer(), []);\n\n $model = m::mock('\\Illuminate\\Database\\Query\\Builder');\n $arrayable = m::mock('\\Illuminate\\Contracts\\Support\\Arrayable');\n\n $model->shouldReceive('get')->once()->andReturn($arrayable);\n $arrayable->shouldReceive('toArray')->once()->andReturn($expected);\n\n $stub->with($model);\n $stub->paginate(null);\n\n $this->assertEquals($expected, $stub->data());\n }", "private static function test_db( $params_array ) {\n $table_name = ( isset( $params_array[ 'prefix' ] ) ? $params_array[ 'prefix' ] : '' ) . self::DUMMY_TABLE_NAME;\n $dummy_data = str_repeat ( 'Z' , 256 );\n $str_data = sprintf( '(\"%s\")', $dummy_data );\n for ( $i = 1; $i < 63; $i++) {\n $str_data .= sprintf( ',(\"%s\")', $dummy_data );\n }\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"CREATE TABLE if not exists $table_name (dummydata text NOT NULL DEFAULT '')\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"insert into $table_name (dummydata) values \" . $str_data . \";\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"select * from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"update $table_name set dummydata = '\" . __CLASS__ . \"';\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"delete from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"DROP TABLE if exists $table_name;\" );\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->database = \\oxDb::getDb();\n }", "#[@test]\n public function unbufferedReadNoResults() {\n $this->createTable();\n $db= $this->db();\n\n $db->open('select * from unittest');\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "public function testGetApropriateConnectionBase(): void\n {\n // setup\n $this->setConnection('default-db-connection');\n $obj = new TraitClientBase(new PdoCrudMock());\n $obj::setConnection(null);\n\n // test body\n $connection = $obj->getApropriateConnection();\n\n // assertions\n $this->assertInstanceOf(PdoCrudMock::class, $connection);\n }", "public function testCatalogGetCatalogColumns()\n {\n\n }", "private function mockClass( $return ): \\PHPUnit\\Framework\\MockObject\\MockObject\n {\n $mock = $this->createMock('\\db\\Connect');\n $mock->expects($this->exactly( 2 ))\n ->method('single')\n ->will($this->returnValue( $return[0] ));\n $mock->expects($this->once())\n ->method('bind_multiple');\n $mock->expects($this->once())\n ->method('query')\n ->will($this->returnValue( $return[1] ));\n\n return $mock;\n }", "public function dbInstance();", "protected function setUp() {\n\t\t$this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');\n\t\t$this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');\n\t\t$this->_rowset = $this->_getCleanMock('Zend_Db_Table_Rowset_Abstract');\n\t\t$this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));\n\n\t\t$this->object = new GTW_Model_User_Mapper($this->_tableGateway);\n\t}", "public function testExecuteSuccessfully() {\n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"call\"))\n ->getMock();\n \n $stub->queryString = \"SELECT * FROM test\";\n \n $mockLogger = $this->getMockBuilder(\"\\Logger\")\n ->disableOriginalConstructor()\n ->getMock();\n \n $property = new \\ReflectionProperty($stub, \"logger\");\n $property->setAccessible(true);\n $property->setValue($stub, $mockLogger);\n \n $response = new \\TExecuteStatementResp(array(\"operationHandle\" => \"fake\"));\n\n $stub->expects($this->once())\n ->method(\"call\")\n ->will($this->returnValue($response));\n \n $this->assertTrue($stub->execute());\n \n $property = new \\ReflectionProperty($stub, \"operationHandle\");\n $property->setAccessible(true);\n $this->assertEquals(\"fake\", $property->getValue($stub));\n }", "public function testFetchArray()\n {\n $this->todo('stub');\n }", "public function testSelect()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $select = $connection->select();\n\n $this->assertInstanceOf(Query\\Select::class, $select);\n $this->assertEquals($connection, $select->connection);\n }", "protected function stub(): string\n {\n return 'seeder.php.stub';\n }", "public function testSetNativeModel()\n {\n $this->todo('stub');\n }", "public function testGetListRawWithTable()\n {\n $GLOBALS['dbi']->expects($this->once())\n ->method('fetchResult')\n ->with(\n \"SELECT * FROM `pma_central_columns` \"\n . \"WHERE db_name = 'phpmyadmin' AND col_name \"\n . \"NOT IN ('id','col1','col2');\",\n null, null, DatabaseInterface::CONNECT_CONTROL\n )\n ->will(\n $this->returnValue($this->columnData)\n );\n $this->assertEquals(\n json_encode($this->modifiedColumnData),\n $this->centralColumns->getListRaw(\n 'phpmyadmin',\n 'table1'\n )\n );\n\n }" ]
[ "0.77180743", "0.6970749", "0.6400718", "0.61044645", "0.61017376", "0.6099842", "0.60459334", "0.60313255", "0.60307956", "0.58866453", "0.58591336", "0.5822337", "0.5746937", "0.5733085", "0.5730609", "0.5715901", "0.5693191", "0.5693184", "0.567435", "0.566929", "0.56682134", "0.5668126", "0.56611645", "0.56592065", "0.56592065", "0.5656204", "0.56559074", "0.5655643", "0.561634", "0.56006664", "0.5596535", "0.55954367", "0.55896693", "0.55873823", "0.55763894", "0.55486465", "0.5546396", "0.5541955", "0.5526999", "0.5503842", "0.5487218", "0.54757446", "0.54696304", "0.5466476", "0.5462064", "0.5455725", "0.5448005", "0.54469335", "0.54450476", "0.54428643", "0.5442767", "0.5440194", "0.5424774", "0.54052925", "0.5379203", "0.5356264", "0.53403777", "0.5328608", "0.5323882", "0.5321387", "0.53175414", "0.53137445", "0.5305241", "0.5298376", "0.5278259", "0.52758634", "0.5275263", "0.52646947", "0.5252987", "0.52513695", "0.52437013", "0.5231563", "0.52303606", "0.5229224", "0.52290475", "0.5221729", "0.5219971", "0.5218984", "0.5214876", "0.5213487", "0.5212906", "0.5212542", "0.5212122", "0.5211328", "0.5209978", "0.52064514", "0.5205824", "0.51947314", "0.5193612", "0.5185588", "0.5181343", "0.518037", "0.51797664", "0.5175484", "0.5175198", "0.51731133", "0.51718783", "0.5171811", "0.51715654", "0.5171389", "0.51702297" ]
0.0
-1
Instantiate a new instance.
public function __construct(Query $query) { $this->query = $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newInstance();", "public function newInstance();", "public function newInstance(): object;", "public static abstract function createInstance();", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function new()\n\t{\n\t\t//\n\t}", "public function new()\n\t{\n\t\t//\n\t}", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function newInstance()\n {\n return new self();\n }", "public static function createInstance()\n {\n return new self();\n }", "public static function create() {\n\t\treturn new self();\n\t}", "static function create(): self;", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public abstract function createInstance($parameters);", "public static function create() {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "public static function new(){\n self::$instance = new self();\n return self::$instance;\n }", "public function regularNew() {}", "public function create(){\r\n\treturn new $this->class();\r\n }", "public static function init()\n {\n return new self();\n }", "function createInstance(ClassDefinition $classDefinition);", "public function instance();", "public static function make() {\n return new self();\n }", "public static function inst()\n {\n return new static();\n }", "public static function new()\n {\n return new static();\n }", "abstract public function instance();", "public static function factory()\n {\n return new self;\n }", "function _construct(){ }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "public function construct()\n\t\t{\n\t\t}", "static public function create()\n {\n return new static();\n }", "public function construct() {\n\n }", "public static function instance() {\n\t\treturn new self;\n\t}", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\tFactory::getLog()->debug(__CLASS__ . \" :: New instance\");\n\t}", "function new_instance($class)\n {\n }", "public static function newInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function createInstance()\n {\n return new static();\n }", "public function make() {}", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "function __constructor(){}", "public function create(){}", "public static function create(): self\n {\n return new static();\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.82330155", "0.82330155", "0.7947312", "0.7813835", "0.7781056", "0.76204854", "0.76204854", "0.76204854", "0.7602299", "0.7602299", "0.7488867", "0.7482665", "0.7367584", "0.7348924", "0.7266192", "0.7265874", "0.72329414", "0.72329414", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.72031885", "0.71738917", "0.71710503", "0.71538645", "0.7117218", "0.7117218", "0.7105626", "0.7089329", "0.70799387", "0.70786923", "0.70338875", "0.7020115", "0.69937265", "0.69869876", "0.69835055", "0.6981757", "0.69519436", "0.69515884", "0.6945136", "0.69386125", "0.69331485", "0.6925969", "0.69258076", "0.69100547", "0.6904078", "0.688624", "0.68738997", "0.68555933", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68460923", "0.68446857", "0.6830762", "0.68254423", "0.68224245", "0.68114954", "0.6806241", "0.6806241", "0.6806241", "0.6806241", "0.67968994", "0.6789411", "0.67748374", "0.67700493", "0.6715495", "0.6715495", "0.6715495", "0.6715495", "0.6715495", "0.6715495" ]
0.0
-1
Find query with given id or throw an error.
public function findOrFail($id) { $query = $this->query->find($id); if (! $query) { throw ValidationException::withMessages(['message' => trans('query.could_not_find')]); } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function find($id);", "public function findOrThrowException($id);", "public function findOrThrowException($id);", "public static function find($id);", "public static function findById($id)\n {\n }", "public static function findById($id);", "public static function findById($id)\n\t{\n\t\n\t}", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function find(int $id) ;", "public function find($id){\n $this->debugBacktrace();\n $this->queryType = \"find\";\n $this->findParam = $id;\n return $this;\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find(int $id)\n {\n }", "public function find( $id );", "public function find($id)\n\t{\n\t\t// TODO: Implement find() method.\n\t}", "function findById($id)\n {\n }", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function find($id = null) {\n $argument = $id?? $this->request->fetch('id')?? null;\n return $this->model->find($argument);\n }", "public function findById ($id);", "public function findOrFail($id);", "function find($id);", "public function findById($id)\n {\n }", "public function findById($id)\n {\n }", "public function findById($id)\n {\n }", "public function findById($id)\n {\n }", "function findById($id);", "public function find($id){\n return parent::find($this->table, $id);\n }", "static function find($id) {\n return self::findBy(\"id\", $id);\n }", "public function findOneBy($id)\n {\n // TODO: Implement findOneBy() method.\n }", "public function findById( $id ) {\n \n // Prepara a query\n $this->db->select( '*' )\n ->from( $this->table() )\n ->where( [ 'id' => $id ] );\n\n // Executa a query\n $query = $this->db->get();\n\n // Verifica se existem resultados\n if ( $query->num_rows() > 0 ) {\n return $query->result_array()[0];\n } else return null;\n }", "public static function find($id)\n {\n Model::getMethod();\n\n }", "public function findById ( $id )\n\t{\n\t\treturn $this->abstractFindById(self::RETURNTYPE,$id);\n\t}", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public static function findById($id)\n {\n return static::findOne(['id' => $id]);\n }", "public function findById($id)\n {\n return $this->baseQuery()->where('id', $id)->first();\n }", "public function findById(int $id);", "public function findById(int $id);", "public static function find($id)\n {\n $table = self::getTable();\n $connection = new DataBaseConnection();\n $parameters = ['id' => $id];\n return $connection->first($table, $parameters);\n }", "public function findByID($id, $fail = true)\n {\n if ($fail) {\n return $this->newQuery()->findOrFail($id);\n }\n\n return $this->newQuery()->find($id);\n }", "public static function find($id = null)\n {\n return self::doSearch($id);\n }", "static public function find($id) {\n return static::getMapper()->find($id);\n }", "public function find($id){\n return $this->db->find($this->table,$id);\n }", "public function find($id = null)\n {\n \n\n return parent::find($id);\n }", "public function find(int $id)\n {\n return $this->makeQuery()->where(\"id = $id\")->fetchOrException();\n }", "public function returnFindByPK($id);", "public function find($id)\n {\n return parent::find($id);\n }", "public function find($id)\n {\n return parent::find($id);\n }", "public function find($id)\n {\n return parent::find($id);\n }", "public static function find($id) {\n\t\treturn self::find_by('id', $id);\n\t}", "public function find($id) {\n $data = $this->db->fetchAssoc(\"SELECT * FROM $this->table WHERE id = ?\", [ $id ]);\n return $data ? $this->build($data) : FALSE;\n }", "public function findById($id)\n {\n\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($id)\n {\n return $this->hooq->find($id);\n }", "public function findEntity($id);", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}" ]
[ "0.7463708", "0.746342", "0.746342", "0.7410756", "0.7404514", "0.7344994", "0.7315719", "0.7276912", "0.7276912", "0.7276912", "0.72376156", "0.7157132", "0.71555614", "0.71425545", "0.71425545", "0.71425545", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.7140687", "0.71041447", "0.7099914", "0.70547473", "0.7048603", "0.7020731", "0.6982128", "0.69688094", "0.69287115", "0.6923374", "0.6915102", "0.6915102", "0.6915102", "0.6915102", "0.6895354", "0.6893292", "0.68803114", "0.68138134", "0.6812898", "0.6769928", "0.676764", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764469", "0.6764299", "0.6731644", "0.67261696", "0.67237437", "0.67237437", "0.67105615", "0.6706596", "0.67061675", "0.67044497", "0.6700741", "0.6697496", "0.66892046", "0.66871357", "0.6672791", "0.6672791", "0.6672791", "0.66593885", "0.66570055", "0.66463125", "0.66414773", "0.664069", "0.6609286", "0.66005516" ]
0.69178104
48
Paginate all queries using given params.
public function paginate($params) { $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created_at'; $order = isset($params['order']) ? $params['order'] : 'desc'; $page_length = isset($params['page_length']) ? $params['page_length'] : config('config.page_length'); $first_name = isset($params['first_name']) ? $params['first_name'] : null; $last_name = isset($params['last_name']) ? $params['last_name'] : null; $email = isset($params['email']) ? $params['email'] : null; $phone = isset($params['phone']) ? $params['phone'] : null; $keyword = isset($params['keyword']) ? $params['keyword'] : null; $start_date = isset($params['start_date']) ? $params['start_date'] : null; $end_date = isset($params['end_date']) ? $params['end_date'] : null; $status = isset($params['status']) ? $params['status'] : null; $query = $this->query->filterByFirstName($first_name)->filterByLastName($last_name)->filterByEmail($email)->filterByPhone($phone)->filterByStatus($status)->filterBySubjectOrBody($keyword)->dateBetween([ 'start_date' => $start_date, 'end_date' => $end_date ]); return $query->orderBy($sort_by, $order)->paginate($page_length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->getData($params)->paginate($page_length);\n\t}", "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->getData($params)->paginate($page_length);\n\t}", "public function getAllPaginated($params)\n {\n $perPage = isset($params['per_page']) ? $params['per_page'] : self::PER_PAGE;\n $query = $this->model->whereNotNull('id');\n\n $this->attachFilters($params, $query);\n\n return $query->paginate($perPage);\n }", "public function paginate($limit, array $params = null);", "public function fetchAllPaginated($sql, $params = array(), $itemsPerPage, $isFirstPage);", "public function query($params)\n {\n if(is_string($params)) {\n $params_tmp = $params;\n $params = array('command' => $params,);\n }\n\n $methodData = &$GLOBALS[$this->def_method];\n /* 获取传递的page num参数 */\n if(!isset($params['pageNum'])) {\n /* 获取get中的p参数 */\n if(isset($methodData[$this->defPageNumKey]))\n $params['pageNum'] = $methodData[$this->defPageNumKey];\n /* 没有则获取默认值 */\n if(!isset($params['pageNum']))\n $params['pageNum'] = $this->pageNum;\n }\n\n /* 获取传递的page size参数 */\n if(!isset($params['pageSize'])) {\n /* 获取cookie中的默认page size */\n if(isset(Yii::app()->request->cookies['defps'])) {\n $params['pageSize'] = Yii::app()->request->cookies['defps']->value;\n }\n /* 没值则获取get参数 */\n if(!isset($params['pageSize']) && isset($methodData[$this->defPageSizeKey]))\n $params['pageSize'] = $methodData[$this->defPageSizeKey];\n /* 都没值,则获取默认值 */\n if(!isset($params['pageSize']))\n $params['pageSize'] = $this->pageSize;\n }\n\n // 如果有限定分页条目重新设定分页\n if ($this->_isFixedPageSize) {\n $params['pageSize'] = $this->pageSize;\n }\n\n $this->pageNum = abs((int)$params['pageNum']);\n if($this->pageNum < 1) $this->pageNum = 1;\n $this->pageSize = abs((int)$params['pageSize']);\n if($this->pageSize < self::MIN_pageSize || $this->pageSize > self::MAX_pageSize) $this->pageSize = 1;\n\n $records = array(); $recordCount = null;\n $offset = ($this->pageNum-1) * $this->pageSize;\n /* query by sql */\n if($params['command']) {\n if(is_string($params['command'])) {\n $params['command'] .= \" LIMIT {$offset},\".$this->pageSize;\n $params['command'] = Yii::app()->db->createCommand($params['command']);\n }\n if(!isset($params['countCommand']))\n $params['countCommand'] = 'SELECT FOUND_ROWS()';\n if(is_string($params['countCommand']))\n $params['countCommand'] = Yii::app()->db->createCommand($params['countCommand']);\n $records = $params['command']->query()->readAll();\n $recordCount = $params['countCommand']->queryScalar();\n // 异常当pageNum大于总页的情况处理\n if ($recordCount && empty($records) && is_string($params_tmp)) {\n $this->pageNum = ceil($recordCount/$this->pageSize);\n $offset = ($this->pageNum-1) * $this->pageSize;\n $params['command'] = $params_tmp;\n $params['command'] .= \" LIMIT {$offset},\".$this->pageSize;\n $params['command'] = Yii::app()->db->createCommand($params['command']);\n $records = $params['command']->query()->readAll();\n }\n }else{\n $model = $params['model'];\n $criteria = $params['criteria'];\n $criteria->offset = ($this->pageNum-1) * $this->pageSize;\n $criteria->limit = $this->pageSize;\n $records = $model->findAll($criteria);\n\n $criteria->limit = $criteria->offset = -1;\n $recordCount = $model->count($criteria);\n }\n\n $this->recordCount = $recordCount;\n $this->pageCount = ceil($recordCount/$this->pageSize);\n\n return $records;\n }", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "public function paginate($params)\n {\n $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created_at';\n $order = isset($params['order']) ? $params['order'] : 'desc';\n $page_length = isset($params['page_length']) ? $params['page_length'] : config('config.page_length');\n $name = isset($params['name']) ? $params['name'] : '';\n\n return $this->contractor->filterByName($name)->orderBy($sort_by, $order)->paginate($page_length);\n }", "abstract public function preparePagination();", "public function paginatedSearch($params) {\n // get items page\n $search_params = [];\n $qb = $this->db->createQueryBuilder();\n $qb->select('contacto_id', 'obra_id', 'cargo', 'intervencion');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n $search = '%'.$params['search_fields']['search'].'%';\n for ($i = 0; $i < 4; $i++) {\n $search_params[] = $search;\n }\n }\n $qb->orderBy($params['sort_field'], $params['sort_dir']);\n $qb->setFirstResult($params['page_size'] * ($params['page'] - 1));\n $qb->setMaxResults($params['page_size']);\n\n $items = [];\n $items = $this->db->fetchAll($qb->getSql(), $search_params); \n\n\n // get total count\n $qb = $this->db->createQueryBuilder();\n $qb->select('count(*) AS total');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n }\n $total = [['total' => 0]];\n $total = $this->db->fetchAll($qb->getSql(), $search_params);\n \n\n // return result\n return [\n 'total' => $total[0]['total'], \n 'items' => $items\n ];\n }", "public function paginateLatestQueries($page = 1, $perPage = 15);", "public function paginate($params = [])\n {\n return (new Paginator($this->album))->with('artist')->orderBy('release_date')->paginate($params);\n }", "public function paginate($perPage = null, $wheres = [], $orders = []);", "public function paginate()\n {\n }", "public function paginate(Request $request);", "function pagination(){}", "public function getPaginated( array $params )\n {\n if ($this->isSortable($params))\n {\n return $this->model->with(['author'])\n ->orderBy($params['sortBy'], $params['direction'])\n ->paginate();\n }\n\n if ($this->isFilterable($params))\n {\n return $this->model->with(['author'])\n ->where(function($query) use ($params){\n foreach ($params['where'] as $where)\n {\n $query->where($where['column'], $where['is']);\n }\n })\n ->orderBy('published_at', 'desc')\n ->paginate();\n }\n\n return $this->model->with(['author'])\n ->orderBy('published_at', 'desc')\n ->paginate();\n }", "private function getAll($params, $filtro) {\n if (isset($params[\"current\"])) {\n $this->current_page_number = $params[\"current\"];\n } else {\n $this->current_page_number = 1;\n }\n\n // Obtendo quantos dados seram exibidos por pagina\n if (isset($params[\"rowCount\"])) {\n $this->records_per_page = $params[\"rowCount\"];\n } else {\n $this->records_per_page = 10;\n }\n $this->start_from = ($this->current_page_number - 1) * $this->records_per_page;\n\n if (!empty($params[\"searchPhrase\"])) {\n $this->query .= \" WHERE (nome LIKE '%\" . $params[\"searchPhrase\"] . \"%' )\";\n }\n\n if (!empty($filtro)) {\n $this->query .= $filtro;\n }\n \n // Alterando consulta para ordenacao da coluna clicada\n $order_by = '';\n if (isset($params[\"sort\"]) && is_array($params[\"sort\"])) {\n foreach ($params[\"sort\"] as $key => $value) {\n $order_by .= \" $key $value, \";\n }\n } else {\n $this->query .= ' ORDER BY id Asc ';\n }\n\n if ($order_by != '') {\n $this->query .= ' ORDER BY ' . substr($order_by, 0, -2);\n }\n \n // Obtendo o numero total de funcionarios sem o filtro de limit\n $query1 = $this->query;\n // Limitando numero de registros obtidos no sql\n if ($this->records_per_page != -1) {\n $this->query .= \" LIMIT \" . $this->records_per_page . \" OFFSET \" . $this->start_from;\n }\n\n /** Obtendo dados com a consulta resultante ******\n */\n $result = pg_query($this->con, $this->query) or die(\"erro ao obter os dados do funcionário\");\n while ($row = pg_fetch_row($result)) {\n $this->data[] = array(\n \"id\" => $row[0],\n \"nome\" => $row[1],\n \"cpf\" => $row[2],\n \"rg\" => $row[3]\n );\n }\n\n $result1 = pg_query($this->con, $query1) or die(\"erro ao obter os dados do funcionário\");\n $total_records = pg_num_rows($result1);\n\n $output = array(\n \"current\" => intval($this->current_page_number),\n \"rowCount\" => $this->records_per_page,\n \"total\" => intval($total_records),\n \"rows\" => $this->data\n );\n\n return $output;\n }", "protected function buildPagination() {}", "protected function buildPagination() {}", "function paginate() {\n\t\t$all_rs = $this->db->query($this->sql );\n\t\t$this->total_rows = $all_rs->num_rows;\n\t\t\n\t\t//Return FALSE if no rows found\n\t\tif ($this->total_rows == 0) {\n\t\t\tif ($this->debug)\n\t\t\t\techo \"Query returned zero rows.\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//Max number of pages\n\t\t$this->max_pages = ceil($this->total_rows / $this->rows_per_page );\n\t\tif ($this->links_per_page > $this->max_pages) {\n\t\t\t$this->links_per_page = $this->max_pages;\n\t\t}\n\t\t\n\t\t//Check the page value just in case someone is trying to input an aribitrary value\n\t\tif ($this->page > $this->max_pages || $this->page <= 0) {\n\t\t\t$this->page = 1;\n\t\t}\n\t\t\n\t\t//Calculate Offset\n\t\t$this->offset = $this->rows_per_page * ($this->page - 1);\n\t\t\n\t\t//Fetch the required result set\n\t\t$rs = $this->db->query($this->sql . \" LIMIT {$this->offset}, {$this->rows_per_page}\" );\n\t\t$this->data = $rs->rows;\n\t}", "function getPagedStatement($sql,$page,$items_per_page);", "public function do_paging()\n {\n }", "public function paginate($limit = null, $columns = ['*'], $method = \"paginate\");", "protected function paginateQuery(&$query) {\n $start = 0;\n $limit = 30;\n if(Input::has('offset')) {\n $start = intval(Input::get('offset'));\n }\n if(Input::has('limit')) {\n $limit = intval(Input::get('limit'));\n }\n $query->skip($start)->take($limit);\n }", "public function findAllWithPagination() {\n\n $this->checkOptionsAndEnableCors();\n\n $page = $this->input->get('page');\n $limit = $this->input->get('limit');\n $sortParam = $this->input->get('sort');\n if(isset($sortParam)){\n $sort = json_decode($sortParam);\n } else {\n $sort = null;\n }\n\n if(isset($page) && isset($limit)){\n $users = $this->repository->findAllWithPagination($page - 1, $limit, $sort);\n $count = $this->repository->count();\n echo json_encode([ \"data\" => $users, \"count\" => $count ]);\n } else {\n $this->handleError('Missing page and limit parameter');\n }\n }", "public function pagination( $params = array() )\n\t{\n\t\t$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n\t\t$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n\n\n\t\t$limit = $params['limit'];\n\t\t$page = ( $params['page'] <= 0 ) ? 1 : $params['page'];\n\n\t\t$total_pages = ceil( $params['total'] / $limit );\n\n\t\t$start_page = ( ( $page - 5 ) < 1 ) ? 1 : $page - 5;\n\t\t$end_page = ( ( $start_page + 10 ) > $total_pages ) ? $total_pages : $start_page + 10;\n\n\t\t$next_page = ( $page < $total_pages ) ? $page + 1 : $total_pages;\n\t\t$back_page = ( $page > 1 ) ? $page - 1 : $start_page;\n\n\t\t$current_page = $start_page;\n\n\t\t$get_params = isset( $params['getParams'] ) ? $params['getParams'] : null;\n\n\t\tif ( defined( 'TWITTER_BOOTSTRAP' ) ) {\n\t\t\t$output = '<div class=\"pagination pagination-centered\"><ul>';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'>&laquo;</a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'>&lt;</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&laquo;</a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&lt;</a></li>\";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a></li>\";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<li class='active'><a href='#'>$current_page</a></li>\";\n\t\t\t\t}\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'>&gt;</a></li>\";\n\t\t\t\t$output .= \"<li class=''><a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'>&raquo;</a></li>\";\n\t\t\t} else {\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&gt;</a></li>\";\n\t\t\t\t$output .= \"<li class='disabled'><a href='#'>&raquo;</a></li>\";\n\t\t\t}\n\n\t\t\t$output .= '</ul></div>';\n\t\t} else {\n\t\t\t$output = '<div id=\"pagination\">';\n\n\t\t\tif ( $page > 1 ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => 1 ), null, TRUE ) . \"$get_params' title='Primeiro'><img width='14' src='\" . INCLUDE_PATH . \"/img/first.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $back_page ), null, TRUE ) . \"$get_params' title='Anterior'><img width='16' src='\" . INCLUDE_PATH . \"/img/previous.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\twhile ( $current_page <= $end_page ) {\n\t\t\t\tif ( $current_page != $page ) {\n\t\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $current_page ), null, TRUE ) . \"$get_params'>$current_page</a>\" . \" \";\n\t\t\t\t} else {\n\t\t\t\t\t$output .= \"<strong>[\" . $page . \"]</strong> \";\n\t\t\t\t}\n\n\t\t\t\t$current_page++;\n\t\t\t}\n\n\t\t\tif ( $page != $total_pages ) {\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $next_page ), null, TRUE ) . \"$get_params' title='Próximo'><img width='16' src='\" . INCLUDE_PATH . \"/img/next.png'/></a>\" . \" \";\n\t\t\t\t$output .= \"<a href='\" . $this->view->url( array( 'controller' => $controller, 'action' => $action, 'page' => $total_pages ), null, TRUE ) . \"$get_params' title='Último'><img width='14' src='\" . INCLUDE_PATH . \"/img/last.png'/></a>\" . \" \";\n\t\t\t}\n\n\t\t\t$output .= '</div>';\n\t\t}\n\n\t\treturn $output;\n\t}", "public function paginate($orderBy = 'nome', $perPage = 10);", "public function paginate($page = 1, $limit = 10, $all = false)\n {\n }", "public function smartPaginate()\n {\n $limit = (int) request()->input(\n config('awemapl-repository.smart_paginate.request_parameter'), \n config('awemapl-repository.smart_paginate.default_limit')\n );\n\n if ($limit === 0) $limit = config('awemapl-repository.smart_paginate.default_limit');\n\n $maxLimit = config('awemapl-repository.smart_paginate.max_limit');\n\n $limit = ($limit <= $maxLimit) ? $limit : $maxLimit;\n\n return $this->paginate($limit);\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM (SELECT ROWNUM MY_ROWNUM, MY_TABLE.*\n FROM (SELECT TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max}\n ) WHERE MY_ROWNUM > {$min}\n \";\n \n $sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n \n $result['count'] = $this->_db->fetchOne($sql);\n $rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n \n if (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n $result['rows'][] = $row;\n }\n }\n return $result;\n }", "private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}", "public function paginate($limit = null, $columns = ['*']);", "public function getPaginate ($p_rowsPerPage, $p_currentPage);", "public function all($param)\n {\n $result = $this->model->newQuery();\n return $result->paginate($param);\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM (SELECT ROWNUM MY_ROWNUM, MY_TABLE.*\n FROM (SELECT TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max}\n ) WHERE MY_ROWNUM > {$min}\n \";\t\n\t\t\n $sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n $result['count'] = $this->_db->fetchOne($sql);\n\n $rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n\t\t\n\t\tif (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n $result['rows'][] = $row;\n }\n }\n\n return $result;\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM ( SELECT MY_TABLE.*\n FROM (\n SELECT ROWNUM MY_ROWNUM, TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max} \n ) WHERE MY_ROWNUM > {$min}\n \";\n \n\t\t$sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n $result['count'] = $this->_db->fetchOne($sql);\n\t\t\n\t\t$rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n\t\t\n\t\tif (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n\t\t\t\t$result['rows'][] = $row;\n }\n }\n\n return $result;\n }", "function get_all_pagina_web($params = array())\r\n {\r\n $limit_condition = \"\";\r\n if(isset($params) && !empty($params))\r\n $limit_condition = \" LIMIT \" . $params['offset'] . \",\" . $params['limit'];\r\n \r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n *\r\n\r\n FROM\r\n pagina_web p, idioma i, estado_pagina e, empresa em\r\n\r\n WHERE\r\n p.idioma_id = i.idioma_id\r\n and p.estadopag_id = e.estadopag_id\r\n and p.empresa_id = em.empresa_id\r\n\r\n ORDER BY `pagina_id` DESC\r\n\r\n \" . $limit_condition . \"\r\n \")->result_array();\r\n\r\n return $pagina_web;\r\n }", "public function Pages($params = array()) {\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheKey = md5('collect.fields.pages.' . serialize($params));\n\t\t\t$ret = $this->cache->get($cacheKey);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`mf`.`collect_fields_id`) AS `COUNT`',\n 'from' => array('{{collect_model_fields}}', 'mf')\n );\n\t\tif(isset($params['collect_fields_status']) && !empty($params['collect_fields_status'])) {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`=:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = $params['collect_fields_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`mf`.`collect_fields_status`>:collect_fields_status');\n\t\t\t$sql_params[':collect_fields_status'] = 0;\n\t\t}\n\t\t\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_id']) && !empty($params['collect_fields_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`mf`.`collect_fields_id`=:collect_fields_id');\n\t\t\t$sql_params[':collect_fields_id'] = $params['collect_fields_id'];\n\t\t}\n\t\t\n\t\tif(isset($params['collect_fields_name']) && !empty($params['collect_fields_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':collect_fields_name'\n );\n\t\t\t$sql_params[':collect_fields_name'] = \"{$params['collect_fields_name']}\";\n\t\t}\n\t\t\n\t\tif(isset($params['searchKey']) && !empty($params['searchKey'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`mf`.`collect_fields_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = \"%{$params['searchKey']}%\";\n\t\t}\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`mf`.`collect_fields_rank` ASC',\n\t\t\t\t\t'`mf`.`collect_fields_id` DESC',\n\t\t\t\t);\n\t\t}\n\t\t\n $builds['select'] = '`mf`.`collect_fields_id`, `mf`.`collect_fields_name`,`mf`.`collect_fields_system`, `mf`.`collect_fields_belong`, `mf`.`collect_fields_identify`, `mf`.`collect_fields_rank`, `mf`.`collect_fields_lasttime`, `mf`.`collect_fields_type`, `cf`.`content_model_field_name`';\n $builds['leftJoin'] = array(\n '{{content_model_fields}}', 'cf', '`cf`.`content_model_field_id`=`mf`.`content_model_field_id`',\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t\n\t\tforeach($ret[\"rows\"] as $_k=>$_v){\n\t\t\t$ret[\"rows\"][$_k]['collect_fields_type'] = self::getFieldTypes($_v['collect_fields_type']);\n\t\t}\n\t\t\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cacheTime = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($cacheKey, json_encode($ret), $cacheTime);\n\t\t\tunset($cacheTime, $cacheKey);\n\t\t}\n\t\treturn $ret;\n\t}", "function paginator($params, $count) {\n $limit = $params->getLimit();\n if ($count > $limit && $count!=0){\n $page = $params->getPage(); \n $controllerName = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName()); \n $pagination = ($page != 1)?'<span><a href=\"\"onclick=\"Grid.page('.($page-1).'); return false\"><<</a></span>':''; \n if ($page > 10){ \n $pagination .= '<a href=\"\" onclick=\"Grid.page(1); return false;\">1</a>';\n $pagination .= '<span>...</span>';\n }\n $pageSpliter = ($page - 5 >= 1 ? $page - 4 : 1);\n for ($i = $pageSpliter; ($count + $limit) / ($i*$limit) > 1 && $i < $pageSpliter + 10; $i++) {\n $pagination .= '<a href=\"\" onclick=\"Grid.page('.$i.'); return false;\" class=\"'. ($page == $i ? \"active\":\"\") .'\">'.$i.'</a>';\n } \n $lastPage = floor(($count + $limit -1) / $limit);\n if ($page < $lastPage - 10){\n $pagination .= '<span>...</span>'; \n $pagination .= '<a href=\"\" onclick=\"Grid.page('. $lastPage .'); return false;\">'.$lastPage .'</a>';\n }\n $pagination .= ($page < ($count/$limit))?'<span><a href=\"\"onclick=\"Grid.page('.($page+1).'); return false\">>></a></span>':''; \n echo '<div class=\"pagination\">'; \n echo $pagination; \n echo '</div>';\n } \n }", "public function paginate(int $perPage = 15);", "public function queryAll($params=array())\n\t{\n\t\t$this->_query['calc_found_rows'] = \"SQL_CALC_FOUND_ROWS\"; //TODO: IS MYSQL ONLY\n\t\treturn $this->queryInternal('fetchAll',$this->_fetchMode, $params);\n\t}", "public function paginate($perPage = null, $columns = ['*']);", "public function allWithPagination($filter = null, $columns = array(\"*\"), $perPageItem = null, $relations = null)\n {\n }", "public function paginate( $perPage, array $columns = ['*'] );", "public function setQuery($request, $pageLimit, $pageNumber);", "public function findAllWithPagination(): LengthAwarePaginator;", "public function findAllWithPagination(): LengthAwarePaginator;", "public function getPaginated();", "public function paginate()\n {\n return $this->configurationRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "public function paginateQuery($query, $key='page', $max=5, $range=2, $url='', $delim='&page=$1', $display=array('first'=>'|&lt;&lt;', 'prev'=>'&lt;', 'next'=>'&gt;', 'last'=>'&gt;&gt;|')) {\n // initialisation\n $paginatedQuery = array();\n if(!isset($_GET[$key])) {\n $_GET[$key] = 1; // so if GET isn't set, it still shows the first page's results\n }\n \n // gets total pages and results\n $paginatedQuery['totalnum'] = count($query);\n $paginatedQuery['pages'] = ceil($paginatedQuery['totalnum']/$max);\n $paginatedQuery['results'] = array_slice($query, ($max*($_GET[$key]-1)), $max, true);\n $paginatedQuery['resultsnum'] = count($paginatedQuery['results']); \n \n // formats paginated links\n // current\n $current = $_GET[$key];\n \n // first\n $first = 1;\n \n // prev\n if ($current==1) $prev = 1; \n else $prev = $current-1;\n \n // next\n if ($paginatedQuery['totalnum']==1) $next = 1; \n else $next = $current+1;\n \n // last\n $last = $paginatedQuery['pages'];\n \n // display \n $paginatedQuery['links'] = ''; // initialisation\n \n // first, prev\n if($current!=$first) $paginatedQuery['links'] = '<a class=\"first\" href=\"'.$url.str_replace('$1', $first, $delim).'\">'.$display['first'].'</a>'.\"\\n\".'<a class=\"prev\" href=\"'.$url.str_replace('$1', $prev, $delim).'\">'.$display['prev'].'</a>'.\"\\n\";\n \n // numbers\n for ($i = ($current - $range); $i < ($current + $range + 1); $i++) {\n if ($i > 0 && $i <= $paginatedQuery['pages']) {\n // current\n if ($i==$current) {\n $paginatedQuery['links'] .= '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n }\n // link\n else {\n $paginatedQuery['links'] .= '<a class=\"page\" href=\"'.$url.str_replace('$1', $i, $delim).'\">'.$i.'</a>'.\"\\n\";\n }\n }\n }\n \n // next, last\n if($current!=$last) $paginatedQuery['links'] .= '<a class=\"next\" href=\"'.$url.str_replace('$1', $next, $delim).'\">'.$display['next'].'</a>'.\"\\n\".'<a class=\"last\" href=\"'.$url.str_replace('$1', $last, $delim).'\">'.$display['last'].'</a>';\n \n // return array\n return $paginatedQuery;\n }", "public function paginate()\n {\n return $this->operator->paginate($this->page, $this->limit);\n }", "public function paginate(array $params = [], int $page, int $perPAge)\n {\n $params['page'] = $page;\n $params['per_page'] = $perPAge;\n\n $responseData = [\n 'data' => [],\n 'total' => 0,\n ];\n\n try {\n $response = $this->api->httpClient->get(\n $this->api->uri,\n [\n 'query' => array_merge($this->api->getDefaultQueryParams(), $params),\n ]\n );\n } catch (GuzzleException $exception) {\n $this->handleException($exception);\n\n return $responseData;\n }\n\n $responseData['data'] = $this->getResponseContents($response);\n $responseData['total'] = (int)$response->getHeaders()['X-Paginator-Items'][0] ?? 0;\n\n return $responseData;\n }", "public function Pages($params = array())\n\t{\n\t\t//设置默认参数\n\t\t$_defaults_params = array(\n\t\t\t'allow_cache' => true,\n\t\t\t'page' => isset($_GET['page']) ? intval($_GET['page']) : 1,\n\t\t\t'pagesize' => 10,\n\t\t);\n\t\t$params = array_merge($_defaults_params, $params);\n\t\t\n\t\t//有开启缓存功能,则从缓存中取数据, 如果有数据,则直接返回结果\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_key = 'collect.model.pages.' . serialize($params);\n\t\t\t$ret = $this->cache->get($cache_key);\n\t\t\t\n\t\t\tif($ret && is_array($ret)) {\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n \n\t\t//添加条件\n\t\t$builds = array(\n 'select' => 'COUNT(`u`.`collect_model_id`) AS `COUNT`',\n 'from' => array('{{collect_model}}', 'u')\n );\n\t\tif(isset($params['collect_model_status']) && !empty($params['collect_model_status'])) {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`=:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = $params['collect_model_status'];\n\t\t} else {\n\t\t\t$builds['where'] = array('AND', '`collect_model_status`>:collect_model_status');\n\t\t\t$sql_params[':collect_model_status'] = 0;\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_id']) && !empty($params['collect_model_id'])) {\n\t\t\t$builds['where'][] = array('AND', '`u`.`collect_model_id`=:collect_model_id');\n\t\t\t$sql_params[':collect_model_id'] = $params['collect_model_id'];\n\t\t}\n\t\t//\n\t\tif(isset($params['collect_model_name']) && !empty($params['collect_model_name'])) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':collect_model_name'\n );\n\t\t\t$sql_params[':collect_model_name'] = $params['collect_model_name'];\n\t\t}\n\t\t//\n\t\t//\n\t\tif(isset($params['searchKey']) && $params['searchKey']) {\n\t\t\t$builds['where'][] = array(\n 'LIKE',\n '`u`.`collect_model_name`',\n ':searchKey'\n );\n\t\t\t$sql_params[':searchKey'] = $params['searchKey'];\n\t\t}\n\t\t\n //$command = $this->db->createCommand();\n $sql = $this->buildQuery($builds);\n\t\t\n\t\t//统计数量\n $count = $this->db->queryScalar($sql, $sql_params);\n\t\t\n\t\t//分页处理\n\t\t$pages = new CPagination($count);\n\t\t\n\t\t//设置分页大小\n\t\t$pages->pageSize = $params['pagesize'];\n\t\t\n\t\tif(isset($params['orderby']) && $params['orderby']) {\n\t\t\t$builds['order'] = $params['orderby'];\n\t\t} else {\n $builds['order'] = array(\n\t\t\t\t\t'`u`.`collect_model_rank` ASC',\n\t\t\t\t\t'`u`.`collect_model_id` DESC',\n\t\t\t\t);\n\t\t}\n \n $builds['select'] = '`u`.`collect_model_id`, `u`.`collect_model_name`, `u`.`collect_model_identify`, `u`.`collect_model_rank`, `u`.`collect_model_lasttime`, `u`.`collect_model_dateline`, `u`.`content_model_id`, `c`.`content_model_name`';\n $builds['leftJoin'] = array(\n '{{content_model}}', 'c', '`c`.`content_model_id`=`u`.`content_model_id`'\n );\n $pages->applyLimit($builds);\n $sql = $this->buildQuery($builds);\n\t\t$ret['pages'] = $pages;\n\t\t$ret['rows'] = $this->db->queryAll($sql, $sql_params);\n\t\t//有开启缓存,则把结果添加到缓存中\n\t\tif($params['allow_cache'] && isset($this->cache)) {\n\t\t\t$cache_cache_time = Setting::inst()->getSettingValue('COLLECT_MODEL_PAGES_CACHE_TIME');\n\t\t\t$this->cache->set($_cache_key, json_encode($ret), $cache_cache_time);\n\t\t\tunset($cache_cache_time, $cache_key);\n\t\t}\n\t\treturn $ret;\n\t}", "public function paginate($no = 10, $columns = ['*']);", "public function testPage()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->page(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(225, $elasticQuery['from']);\n $this->assertSame(25, $elasticQuery['size']);\n\n $this->assertSame($query, $query->page(20, 50));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(950, $elasticQuery['from']);\n $this->assertSame(50, $elasticQuery['size']);\n\n $query->limit(15);\n $this->assertSame($query, $query->page(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(285, $elasticQuery['from']);\n $this->assertSame(15, $elasticQuery['size']);\n }", "public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }", "function getAllPaginated($page=1,$perPage=-1) { \r\n if ($perPage == -1)\r\n $perPage = \tNewsletterSchedulePeer::getRowsPerPage();\r\n if (empty($page))\r\n $page = 1;\r\n //require_once(\"propel/util/PropelPager.php\");\r\n $cond = new Criteria(); \r\n $pager = new PropelPager($cond,\"NewsletterSchedulePeer\", \"doSelect\",$page,$perPage);\r\n return $pager;\r\n }", "public function paginateAllWithCategory($postsPerPage);", "public function fetchAll($params = array())\n {\n $criteria = $params->get('query', []);\n $orderBy = $params->get('order_by', []);\n \n $adapter = $this->getRepository()->getPaginatorAdapter($criteria, $orderBy);\n return new $this->collectionClass($adapter);\n }", "public function paginateAllWithCategoryAndTags($postsPerPage);", "public function paginate($option = []){\n\t\t$option = array_replace_recursive($this->defaultQuery,$option);\n\t\t$dOption = Config::get('paginator');\n\t\t$option = array_replace_recursive($dOption,$option);\n\t\tif(!$option['page']){\n\t\t\t$option['page'] = 1;\n\t\t}\n\t\t$option['skip'] = $option['limit']*($option['page']-1);\n\t\t$option['count'] = $this->count($option['query']);\n\t\t$result = $this->find($option);\n\t\t$paginator = new Paginator($result);\n\t\tunset($option['query']);\n\t\tunset($option['skip']);\n\t\t$paginator->setOption($option);\n\n\t\treturn $paginator;\n\t}", "protected function paginate_results($query, Request $request = null){\n\n \t$page = 1;\n \t$number_per_page = env(\"NUMBER_PER_PAGE_API_RESPONSE\");\n\n \tif( $request && $request->has('page') ){\n \t\t$page = $request->input('page');\n \t}\n\n \tif( $request && $request->has('pagination.page') ){\n \t\t$page = $request->pagination['page'];\n \t}\n\n \tif( $request && $request->has('pagination.number_per_page') ){\n \t\t$number_per_page = $request->pagination['number_per_page'];\n \t} \n\n \tif( $number_per_page == \"0\" || $number_per_page === 0 || !$number_per_page ){\n \t\t$number_per_page = $query->count();\n \t}\n\n \treturn $query->paginate($number_per_page, ['*'], 'page', $page);\n \t\n }", "abstract function query($queryString, $page = 1);", "function getAllPaginated($page=1,$perPage=-1) {\r\n\t\tif ($perPage == -1)\r\n\t\t\t$perPage = \tCommon::getRowsPerPage();\r\n\t\tif (empty($page))\r\n\t\t\t$page = 1;\r\n\t\t$cond = new Criteria();\r\n\t\t$pager = new PropelPager($cond,\"SurveyAnswerPeer\", \"doSelect\",$page,$perPage);\r\n\t\treturn $pager;\r\n\t }", "public function findPaginate(array $data): array\n {\n }", "public function queryIterator($sql,$params=array());", "public static function fetch_all($params) {}", "public static function obtenerPaginate()\n {\n $rs = self::builder();\n return $rs->paginate(self::$paginate) ?? [];\n }", "public function all($limit, $offset);", "public static function doPager($params=NULL, $selectPage=0, $itemsPerPage=20) {\n\t\t$count = (int) self::doCount($params);\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$conn->select(self::TABLE_NAME);\n\t\tparent::doSelectParameters($conn, $params, self::PRIMARY_KEY);\n\t\treturn DbModel::doPager($conn, new ProjectsListingsModel(), $itemsPerPage, $selectPage, $count, $params);\n\t}", "public function pagination($query,$offset,$limit) {\n $afterPrepare = $this->db->prepare($query);\n $afterPrepare->bindParam(\":offset\", $offset, PDO::PARAM_INT);\n $afterPrepare->bindParam(\":page_limit\", $limit, PDO::PARAM_INT);\n $afterPrepare->execute();\n return $afterPrepare->fetchAll(PDO::FETCH_ASSOC);\n }", "function getAllPaginated($page=1,$perPage=-1) { \r\n if ($perPage == -1)\r\n $perPage = \tNewsletterUserPeer::getRowsPerPage();\r\n if (empty($page))\r\n $page = 1;\r\n //require_once(\"propel/util/PropelPager.php\");\r\n $cond = new Criteria(); \r\n $pager = new PropelPager($cond,\"NewsletterUserPeer\", \"doSelect\",$page,$perPage);\r\n return $pager;\r\n }", "protected function applyListPagination(QueryBuilder $qb, Page $page, Params $params)\n {\n $qb->setFirstResult($page->getOffset())\n ->setMaxResults($page->getLimit());\n }", "public function addLimit($_params , $_query)\n {\n \n $_query->setMaxResults($_params['length'])\n ->setFirstResult($_params['offset']);\n\n return $_query;\n }", "public function getPaginatedList($offset, $limit, $criteria = array());", "abstract public function getAllByParams($params);", "function getPagingInfo($sql,$input_arguments=null);", "public function get_paginate(Request $request)\n {\n }", "function paging_1($sql,$vary=\"record\",$width=\"575\",$course)\n{\n\n global $limit,$offset,$currenttotal,$showed,$last,$align,$CFG;\n if(!empty ($_REQUEST['offset']))\n $offset=$_REQUEST['offset'];\n else $offset=0;\n $showed=$offset+$limit;\n $last=$offset-$limit;\n $result=get_records_sql($sql);\n\n $currenttotal=count($result);\n $pages=$currenttotal%$limit;\n if($pages==0)\n\t$pages=$currenttotal/$limit;\n else\n {\n\t$pages=$currenttotal/$limit;\n\t$pages=(int)$pages+1;\n }\n for($i=1;$i<=$pages;$i++)\n {\n\t$pageoff=($i-1)*$limit;\n\tif($showed==($i*$limit))\n\tbreak;\n }\n\t\t\t\n if($currenttotal>1)$vary.=\"s\";\n if($currenttotal>0)\n\techo @$display;\n if($CFG->dbtype==\"mysql\")\n {\n $sql.=\" Limit \".$offset.\",$limit \";\n }\n else if($CFG->dbtype==\"mssql_n\" )\n {\n $uplimit=$offset+$limit;\n $sql.=\" WHERE Row between \".($offset+1).\" and \".$uplimit;\n\n }\n\n return $sql;\n\n}", "function get_page_params($count) {\n\n\tglobal $ROWS_PER_PAGE;\n\t\n\tif ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10;\n\n\t$page_arr=array();\n\n\t$firstpage = 1;\n\t$lastpage = intval($count / $ROWS_PER_PAGE);\n\t$page=(int)get_arg($_GET,\"page\");\n\n\n\tif ( $page == \"\" || $page < $firstpage ) { $page = 1; }\t// no page no\n\tif ( $page > $lastpage ) {$page = $lastpage+1;}\t\t\t// page greater than last page\n\t//echo \"<pre>first=$firstpage last=$lastpage current=$page</pre>\";\n\n\tif ($count % $ROWS_PER_PAGE != 0) {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE) + 1;\n\t} else {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE);\n\t}\n\t$startrec = $ROWS_PER_PAGE * ($page - 1);\n\t$reccount = min($ROWS_PER_PAGE * $page, $count);\n\n\t$currpage = ($startrec/$ROWS_PER_PAGE) + 1;\n\n\n\tif($lastpage==0) {\n\t\t$lastpage=null;\n\t} else {\n\t\t$lastpage=$lastpage+1;\n\t}\n\n\tif($startrec == 0) {\n\t\t$prevpage=null;\n\t\t$firstpage=null;\n\t\tif($count == 0) {$startrec=0;}\n\t} else {\n\t\t$prevpage=$currpage-1;\n\t}\n\t\n\tif($reccount < $count) {\n\t\t$nextpage=$currpage+1;\n\t} else {\n\t\t$nextpage=null;\n\t\t$lastpage=null;\n\t}\n\n\t$appstr=\"&page=\"; \n\n\t// Link to PREVIOUS page (and FIRST)\n\tif($prevpage == null) {\n\t\t$prev_href=\"#\";\n\t\t$first_href=\"#\";\n\t\t$prev_disabled=\"disabled\";\n\t} else {\n\t\t$prev_disabled=\"\";\n\t\t$prev_href=$appstr.$prevpage; \n\t\t$first_href=$appstr.$firstpage; \n\t}\n\n\t// Link to NEXT page\n\tif($nextpage == null) {\n\t\t$next_href = \"#\";\n\t\t$last_href = \"#\";\n\t\t$next_disabled=\"disabled\";\n\t} else {\n\t\t$next_disabled=\"\";\n\t\t$next_href=$appstr.$nextpage; \n\t\t$last_href=$appstr.$lastpage; \n\t}\n\n\tif ( $lastpage == null ) $lastpage=$currpage;\n\n\t$page_arr['page_start_row']=$startrec;\n\t$page_arr['page_row_count']=$reccount;\n\n\t$page_arr['page']=$page;\n\t$page_arr['no_of_pages']=$pagecount;\n\n\t$page_arr['curr_page']=$currpage;\n\t$page_arr['last_page']=$lastpage;\n\n\t$page_arr['prev_disabled']=$prev_disabled;\n\t$page_arr['next_disabled']=$next_disabled;\n\n\t$page_arr['first_href']=$first_href;\n\t$page_arr['prev_href']=$prev_href;\n\t$page_arr['next_href']=$next_href;\n\t$page_arr['last_href']=$last_href;\n\n\t//LOG_MSG('INFO',\"Page Array=\".print_r($page_arr,true));\n\treturn $page_arr;\n}", "public function pagedQuery(QueryParams $params): PagedData\n {\n if ($this->isNativeMode()) {\n $count = $this->count($params);\n $data = iterator_to_array($this->nativePageQuery($params));\n } else {\n $pager = $this->getPager($params);\n $count = count($pager);\n $data = iterator_to_array($pager, false);\n }\n\n return new PagedData($data, $count);\n }", "public function paginate($items = 5)\n\t{\n\t\treturn $this->model->paginate($items);\n\t}", "public function all($params = array());", "function register_block_core_query_pagination()\n {\n }", "public function GetByPaginated($offset, $limit);", "protected function tagPager($params)\n {\n if (is_null($this->_pager_conditions)) {\n TIP::error('no active browse action');\n return null;\n }\n\n @list($quanto, $query_template) = explode(',', $params, 2);\n $quanto = (int) $quanto;\n $pager = $quanto > 0;\n\n if (empty($this->_pager_conditions)) {\n } elseif (is_array($this->_pager_conditions)) {\n $conditions = array();\n foreach ($this->_pager_conditions as $id => $value) {\n $conditions[] = $this->getData()->addFilter('', $id, $value);\n }\n $filter = 'WHERE (' . implode(' AND ', $conditions) . ')';\n } elseif (empty($this->search_field)) {\n $filter = $this->_pager_conditions;\n } else {\n is_string($this->search_field) && $this->search_field = explode(',', $this->search_field);\n $this->_search_tokens = explode(' ', $this->_pager_conditions);\n $pattern = '%' . implode('%', $this->_search_tokens) . '%';\n $conditions = array();\n foreach ($this->search_field as $id) {\n $conditions[] = $this->getData()->addFilter('', $id, $pattern, 'LIKE');\n }\n $filter = 'WHERE (' . implode(' OR ', $conditions) . ')';\n }\n\n if (isset($filter)) {\n $filter .= ' ' . $query_template;\n } else {\n $filter = $query_template;\n }\n\n $filter .= $this->getData()->order($this->default_order);\n\n if ($pager) {\n $offset = TIP::getGet('pg_offset', 'int');\n $offset > 0 || $offset = 0;\n $filter .= $this->getData()->limit($quanto+1, $offset);\n } else {\n $offset = 0;\n }\n\n if (is_null($view = $this->startDataView($filter))) {\n TIP::notifyError('select');\n $this->_search_tokens = null;\n return null;\n }\n\n ob_start();\n if (!$view->isValid()) {\n $this->tryRun(array($main_id, $this->pager_empty_template));\n } else {\n $main_id = TIP_Application::getGlobal('id');\n $partial = $pager && $view->nRows() == $quanto+1;\n if ($partial) {\n // Remove the trailing row from the view\n $rows =& $view->getProperty('rows');\n array_splice($rows, $quanto);\n }\n\n if ($pager) {\n if ($offset > 0) {\n $this->keys['PREV'] = TIP::modifyActionUri(\n null, null, null,\n array('pg_offset' => $offset-$quanto > 0 ? $offset-$quanto : 0)\n );\n }\n if ($partial) {\n $this->keys['NEXT'] = TIP::modifyActionUri(\n null, null, null,\n array('pg_offset' => $offset+$quanto)\n );\n }\n $pager = $partial || $offset > 0;\n }\n\n // Pager rendering BEFORE the rows\n $pager && $this->tryRun(array($main_id, $this->pager_pre_template));\n\n // Rows rendering\n $empty = true;\n $path = array($this->id, $this->pager_template);\n foreach ($view as $row) {\n $this->run($path);\n $empty = false;\n }\n\n // Empty result set\n $empty && $this->tryRun(array($main_id, $this->pager_empty_template));\n\n // Pager rendering AFTER the rows\n $pager && $this->tryRun(array($main_id, $this->pager_post_template));\n }\n\n $this->endView();\n $this->_search_tokens = null;\n return ob_get_clean();\n }", "protected function paginate()\n {\n if ($this->currentItem == $this->pagerfanta->getMaxPerPage() and $this->pagerfanta->hasNextPage()) {\n $this->pagerfanta->setCurrentPage($this->pagerfanta->getNextPage());\n $this->loadData();\n }\n }", "function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}", "function paging($tablename, $fieldlist, $where = '', $orderby = '', $groupby = '', $records=15, $pages=9)\n\t{\n\t\t$converter = new encryption();\n\t\t$dbfunctions = new dbfunctions();\n\t\tif($pages%2==0)\n\t\t\t$pages++;\n\t\t/*\n\t\tThe pages should be odd not even\n\t\t*/\n\t\t$sql = $dbfunctions->GenerateSelectQuery($tablename, $fieldlist, $where, $orderby, $groupby);\n\t\t$dbfunctions->SimpleSelectQuery($sql);\n\t\t$total = $dbfunctions->getNumRows();\n\t\t$page_no = (int) isset($_GET[\"page_no\"])?$converter->decode($_GET[\"page_no\"]):1;\n\t\t/*\n\t\tChecking the current page\n\t\tIf there is no current page then the default is 1\n\t\t*/\n\t\t$limit = ($page_no-1)*$records;\n\t\t$sql = $dbfunctions->GenerateSelectQuery($tablename, $fieldlist, $where, $orderby, $groupby, \" limit $limit,$records\");\n\t\t/*\n\t\tThe starting limit of the query\n\t\t*/\n\t\t$first=1;\n\t\t$previous=$page_no>1?$page_no-1:1;\n\t\t$next=$page_no+1;\n\t\t$last=ceil($total/$records);\n\t\tif($next>$last)\n\t\t\t$next=$last;\n\t\t/*\n\t\tThe first, previous, next and last page numbers have been calculated\n\t\t*/\n\t\t$start=$page_no;\n\t\t$end=$start+$pages-1;\n\t\tif($end>$last)\n\t\t\t$end=$last;\n\t\t/*\n\t\tThe starting and ending page numbers for the paging\n\t\t*/\n\t\tif(($end-$start+1)<$pages)\n\t\t{\n\t\t\t$start-=$pages-($end-$start+1);\n\t\t\tif($start<1)\n\t\t\t\t$start=1;\n\t\t}\n\t\tif(($end-$start+1)==$pages)\n\t\t{\n\t\t\t$start=$page_no-floor($pages/2);\n\t\t\t$end=$page_no+floor($pages/2);\n\t\t\twhile($start<$first)\n\t\t\t{\n\t\t\t\t$start++;\n\t\t\t\t$end++;\n\t\t\t}\n\t\t\twhile($end>$last)\n\t\t\t{\n\t\t\t\t$start--;\n\t\t\t\t$end--;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\tThe above two IF statements are kinda optional\n\t\tThese IF statements bring the current page in center\n\t\t*/\n\t\t$this->sql=$sql;\n\t\t$this->records=$records;\n\t\t$this->pages=$pages;\n\t\t$this->page_no=$page_no;\n\t\t$this->total=$total;\n\t\t$this->limit=$limit;\n\t\t$this->first=$first;\n\t\t$this->previous=$previous;\n\t\t$this->next=$next;\n\t\t$this->last=$last;\n\t\t$this->start=$start;\n\t\t$this->end=$end;\n\t}", "function getPagingParameters()\n {\n }", "public function all($params)\n {\n }", "public static function pagination()\n {\n $limit = (int) self::set(\"limit\");\n $offset = (int) self::set(\"offset\");\n\n $limit = Validator::intType()->notEmpty()->positive()->validate($limit)? $limit: false;\n $offset = Validator::intType()->notEmpty()->positive()->validate($offset)? $offset: 0;\n\n $pagination = \"\";\n $pagination .= $limit? \" LIMIT {$limit}\": null;\n $pagination .= ($limit && $offset)? \" OFFSET {$offset}\": null;\n\n return (object) [\n \"limit\" => $limit,\n \"offset\" => $offset,\n \"query\" => $pagination\n ];\n }", "function spilit_result($page,$results_per_page,$base_query,$query_param){\r\n\ttry{\r\n\t\tglobal $conn;\r\n\t\t$start = ($page-1) * $results_per_page;\r\n\t\t$sql_quary = $base_query.\" LIMIT \".$start.\", \".$results_per_page;\r\n\t\t$sql = $conn->prepare($sql_quary);\r\n\r\n\t\tif(count($query_param)>0){\r\n\t\t\tforeach($query_param as $key => &$val){\r\n\t \t\t$sql->bindparam($key, $val);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sql->execute();\r\n\t\t$numRows = $sql->fetchAll();\r\n\r\n\t\t$sql = $conn->prepare($base_query);\r\n\t\tif(count($query_param)>0){\r\n\t\t\tforeach($query_param as $key => &$val){\r\n\t \t\t$sql->bindparam($key, $val);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t$sql->execute();\r\n\t\t$num_results = count($sql->fetchAll());\r\n\t\t$total_pages = ceil($num_results/$results_per_page);\r\n\r\n\t\treturn array($numRows,$total_pages);\r\n\t}\r\n\tcatch(Exception $e){\r\n\t\t//header(\"Location:index.php\");\r\n\t}\r\n}", "public function search($params)\n {\n $maxPerPage = isset($params['limit']) && in_array($params['limit'], [12, 24, 36]) ? $params['limit'] : 12; // Products per page\n $currentPage = isset($params['p']) ? $params['p'] : 1;\n\n // Build search query\n $boolQuery = new \\Elastica\\Query\\BoolQuery();\n $this->applyQuery($boolQuery, $params);\n $this->applyCategory($boolQuery, $params);\n $this->applyStatus($boolQuery);\n $this->applyPrice($boolQuery, $params);\n $this->applyAttributes($boolQuery, $params);\n $this->applyUser($boolQuery, $params);\n\n $query = new \\Elastica\\Query($boolQuery);\n $this->applyLocation($query, $params);\n $this->applySortAndOrder($query, $params);\n\n $results = $this->finder->findPaginated($query);\n $results->setMaxPerPage($maxPerPage);\n $results->setCurrentPage($currentPage);\n\n return $results;\n }", "public static function index($params = array())\n {\n $connection = self::getConnection();\n\n $limit = isset($params['Limit']) ? \" LIMIT $params[Limit] \" : '';\n $offset = isset($params['Offset']) ? \" OFFSET $params[Offset] \" : '';\n $order = isset($params['SortField']) && isset($params['SortOrder']) ?\n \" ORDER BY $params[SortField] $params[SortOrder] \" : '';\n\n $query = \"SELECT * FROM \".self::TABLE_NAME.$order.$limit.$offset;\n\n $statement = $connection->prepare($query);\n\n $success = $statement->execute();\n\n if ($success) {\n return $statement->fetchAll();\n }\n\n return false;\n }", "public function searchPaged($query, array $inApps = [], $page = 1, $size = 30);", "public function queryAllPaginated(int $start, int $end)\n {\n $offsetPlaceholder = \":startResult\";\n $limitPlaceholder = \":endResult\";\n $statement = sprintf(\"SELECT %s, %s, %s, %s, %s FROM %s WHERE deleted = 0 LIMIT %s OFFSET %s\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[2], static::FIELDS[3], static::FIELDS[4], static::TABLE,\n $limitPlaceholder, $offsetPlaceholder);\n $req = $this->db->prepare($statement);\n\n $req->bindValue($offsetPlaceholder, ($start - 1), PDO::PARAM_INT);\n $req->bindValue($limitPlaceholder, ($end - $start + 1), PDO::PARAM_INT);\n\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "public function paginate($perPage = 15, $columns = ['*']) {\n }", "public function paginate($builder, array $attributes = [])\n {\n $limit = request('limit', 10);\n $offset = request('offset', 0);\n $currentPage = ($offset / $limit) + 1;\n $keyword = request('keyword');\n\n Paginator::currentPageResolver(function () use ($currentPage) {\n return $currentPage;\n });\n\n $builder = $this->filter($builder, $keyword, $attributes);\n\n\n return $builder->paginate($limit);\n }" ]
[ "0.7607716", "0.7607716", "0.75328", "0.7376875", "0.7256248", "0.7111465", "0.70188504", "0.6985799", "0.6945684", "0.6871767", "0.68443006", "0.6799342", "0.67953503", "0.6780006", "0.67693454", "0.66703606", "0.6651802", "0.66419655", "0.6583402", "0.6583402", "0.6557721", "0.6554031", "0.6553382", "0.6507253", "0.6471592", "0.6423669", "0.6421741", "0.6408494", "0.6373495", "0.6353424", "0.63454795", "0.6324135", "0.63226056", "0.63118637", "0.6294635", "0.6237088", "0.6228464", "0.6207565", "0.619956", "0.6194837", "0.61892843", "0.618298", "0.6181353", "0.61805934", "0.6179111", "0.61631674", "0.6158122", "0.6158122", "0.61580956", "0.6151925", "0.6146722", "0.61382383", "0.61333734", "0.6116936", "0.6040063", "0.60272795", "0.600847", "0.59944236", "0.5990002", "0.59873825", "0.5987221", "0.597945", "0.5970988", "0.5968702", "0.5959076", "0.595781", "0.5956226", "0.5948006", "0.5940839", "0.59407973", "0.5934243", "0.5924603", "0.5923084", "0.591156", "0.5911337", "0.5907236", "0.5887032", "0.58856493", "0.58832663", "0.58761185", "0.58757645", "0.58742034", "0.5871222", "0.5866331", "0.5842647", "0.58304846", "0.5825609", "0.5823953", "0.58071357", "0.5803539", "0.5801538", "0.57960546", "0.57955956", "0.57905686", "0.578925", "0.5773973", "0.5772852", "0.5767945", "0.57675594", "0.57607085" ]
0.70028245
7
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('doc_id',$this->doc_id); $criteria->compare('doc_url',$this->doc_url,true); $criteria->compare('doc_name',$this->doc_name,true); $criteria->compare('doc_scribd_id',$this->doc_scribd_id,true); $criteria->compare('doc_description',$this->doc_description,true); $criteria->compare('doc_title',$this->doc_title,true); $criteria->compare('doc_status',$this->doc_status,true); $criteria->compare('doc_author',$this->doc_author,true); $criteria->compare('doc_type',$this->doc_type); $criteria->compare('doc_path',$this->doc_path,true); $criteria->compare('subject_dept',$this->subject_dept); $criteria->compare('subject_type',$this->subject_type); $criteria->compare('subject_faculty',$this->subject_faculty); $criteria->compare('doc_author_name',$this->doc_author_name,true); $criteria->compare('doc_publisher',$this->doc_publisher,true); $criteria->compare('subject_general_faculty_id',$this->subject_general_faculty_id); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('model_id',$this->model_id,true);\n $criteria->compare('color',$this->color,true);\n $criteria->compare('is_in_pare',$this->is_in_pare);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('generator_id',$this->generator_id,true);\n\t\t$criteria->compare('serial_number',$this->serial_number,true);\n\t\t$criteria->compare('model_number',$this->model_number,true);\n\t\t$criteria->compare('manufacturer_name',$this->manufacturer_name,true);\n\t\t$criteria->compare('manufacture_date',$this->manufacture_date,true);\n\t\t$criteria->compare('supplier_name',$this->supplier_name,true);\n\t\t$criteria->compare('date_of_purchase',$this->date_of_purchase,true);\n\t\t$criteria->compare('date_of_first_use',$this->date_of_first_use,true);\n\t\t$criteria->compare('kva_capacity',$this->kva_capacity);\n\t\t$criteria->compare('current_run_hours',$this->current_run_hours);\n\t\t$criteria->compare('last_serviced_date',$this->last_serviced_date,true);\n\t\t$criteria->compare('engine_make',$this->engine_make,true);\n\t\t$criteria->compare('engine_model',$this->engine_model,true);\n\t\t$criteria->compare('fuel_tank_capacity',$this->fuel_tank_capacity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('idmodel',$this->idmodel);\n\t\t$criteria->compare('usuario_anterior',$this->usuario_anterior);\n\t\t$criteria->compare('usuario_nuevo',$this->usuario_nuevo);\n\t\t$criteria->compare('estado_anterior',$this->estado_anterior,true);\n\t\t$criteria->compare('estado_nuevo',$this->estado_nuevo,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('car',$this->car,true);\n\t\t$criteria->compare('source_id',$this->source_id,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('client_type_id',$this->client_type_id,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('other',$this->other,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t// $criteria->compare('text',$this->text,true);\n\t\t// $criteria->compare('record',$this->record,true);\n\t\t$criteria->compare('user',$this->user,true);\n\t\t$criteria->compare('createdBy',$this->createdBy,true);\n\t\t$criteria->compare('viewed',$this->viewed);\n\t\t$criteria->compare('createDate',$this->createDate,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('comparison',$this->comparison,true);\n\t\t// $criteria->compare('value',$this->value,true);\n\t\t$criteria->compare('modelType',$this->modelType,true);\n\t\t$criteria->compare('modelId',$this->modelId,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('Currency_ID',$this->Currency_ID);\n\t\t$criteria->compare('CurrencyNo',$this->CurrencyNo,true);\n\t\t$criteria->compare('ExchangeVND',$this->ExchangeVND,true);\n\t\t$criteria->compare('AppliedDate',$this->AppliedDate,true);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('firm',$this->firm,true);\n\t\t$criteria->compare('change_date',$this->change_date,true);\n\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('availability',$this->availability,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('bonus',$this->bonus,true);\n\t\t$criteria->compare('shipping_cost',$this->shipping_cost,true);\n\t\t$criteria->compare('product_page',$this->product_page,true);\n\t\t$criteria->compare('sourse_page',$this->sourse_page,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('column_id',$this->column_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('condition',$this->condition,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('industry',$this->industry,true);\n\t\t$criteria->compare('industry_sub',$this->industry_sub,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('province',$this->province,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact_name',$this->contact_name,true);\n\t\t$criteria->compare('contact_tel',$this->contact_tel,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('source',$this->source,true);\n $criteria->compare('status',$this->status);\n\t\t$criteria->compare('update_time',$this->update_time);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('notes',$this->notes);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('university',$this->university,true);\n\t\t$criteria->compare('major',$this->major,true);\n\t\t$criteria->compare('gpa',$this->gpa,true);\n\t\t$criteria->compare('appl_term',$this->appl_term);\n\t\t$criteria->compare('toefl',$this->toefl);\n\t\t$criteria->compare('gre',$this->gre);\n\t\t$criteria->compare('appl_major',$this->appl_major,true);\n\t\t$criteria->compare('appl_degree',$this->appl_degree,true);\n\t\t$criteria->compare('appl_country',$this->appl_country,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('goods_code',$this->goods_code,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('brand_id',$this->brand_id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('size',$this->size,true);\n\t\t$criteria->compare('material',$this->material,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('purchase_price',$this->purchase_price,true);\n\t\t$criteria->compare('selling_price',$this->selling_price,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ContractsDetailID',$this->ContractsDetailID,true);\n\t\t$criteria->compare('ContractID',$this->ContractID,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\t\t$criteria->compare('CustomerID',$this->CustomerID,true);\n\t\t$criteria->compare('Share',$this->Share);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria = $this->criteriaSearch();\r\n\t\t$criteria->limit = 10;\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('organizationName',$this->organizationName,true);\n\t\t$criteria->compare('contactNo',$this->contactNo,true);\n\t\t$criteria->compare('partnerType',$this->partnerType);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('emailId',$this->emailId,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('firstName',$this->firstName,true);\n\t\t$criteria->compare('lastName',$this->lastName,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_ID,$this->{Globals::FLD_NAME_ACTIVITY_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_TASK_ID,$this->{Globals::FLD_NAME_TASK_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_BY_USER_ID,$this->{Globals::FLD_NAME_BY_USER_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_TYPE,$this->{Globals::FLD_NAME_ACTIVITY_TYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_SUBTYPE,$this->{Globals::FLD_NAME_ACTIVITY_SUBTYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_COMMENTS,$this->{Globals::FLD_NAME_COMMENTS},true);\n\t\t$criteria->compare(Globals::FLD_NAME_CREATED_AT,$this->{Globals::FLD_NAME_CREATED_AT},true);\n\t\t$criteria->compare(Globals::FLD_NAME_SOURCE_APP,$this->{Globals::FLD_NAME_SOURCE_APP},true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('manufacturers_image',$this->manufacturers_image,true);\n\t\t$criteria->compare('date_added',$this->date_added);\n\t\t$criteria->compare('last_modified',$this->last_modified);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_clicked',$this->url_clicked);\n\t\t$criteria->compare('date_last_click',$this->date_last_click);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('date',$this->date);\n\t\t$criteria->compare('del',$this->del);\n\t\t$criteria->compare('action_id',$this->action_id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('catalog',$this->catalog,true);\n\t\t$criteria->compare('is_new',$this->is_new);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('case',$this->case);\n\t\t$criteria->compare('basis_doc',$this->basis_doc);\n\t\t$criteria->compare('calc_group',$this->calc_group);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('competition',$this->competition);\n\t\t$criteria->compare('partner',$this->partner);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('website',$this->website,true);\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('data_attributes_fields',$this->data_attributes_fields,true);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('skill_id',$this->skill_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('account_id',$this->account_id);\n\t\t$criteria->compare('field_name',$this->field_name);\n\t\t$criteria->compare('content',$this->content);\n\t\t$criteria->compare('old_data',$this->old_data,true);\n\t\t$criteria->compare('new_data',$this->new_data,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_updated',$this->date_updated,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('company_id',$this->company_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('validator',$this->validator,true);\n\t\t$criteria->compare('position',$this->position);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n $criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('display_name',$this->display_name,true);\n $criteria->compare('actionPrice',$this->actionPrice);\n\t\t$criteria->compare('translit',$this->translit,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('display_description',$this->display_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('editing',$this->editing);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('BrandID', $this->BrandID);\n $criteria->compare('BrandName', $this->BrandName, true);\n $criteria->compare('Pinyin', $this->Pinyin, true);\n $criteria->compare('Remarks', $this->Remarks, true);\n $criteria->compare('OrganID', $this->OrganID);\n $criteria->compare('UserID', $this->UserID);\n $criteria->compare('CreateTime', $this->CreateTime);\n $criteria->compare('UpdateTime', $this->UpdateTime);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('componente_id',$this->componente_id);\n\t\t$criteria->compare('tipo_dato',$this->tipo_dato,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('cruce_automatico',$this->cruce_automatico,true);\n\t\t$criteria->compare('sw_obligatorio',$this->sw_obligatorio,true);\n\t\t$criteria->compare('orden',$this->orden);\n\t\t$criteria->compare('sw_puntaje',$this->sw_puntaje,true);\n\t\t$criteria->compare('sw_estado',$this->sw_estado,true);\n\t\t$criteria->compare('todos_obligatorios',$this->todos_obligatorios,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('real_name',$this->real_name,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('zip_code',$this->zip_code,true);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('district_id',$this->district_id);\n\t\t$criteria->compare('district_address',$this->district_address,true);\n\t\t$criteria->compare('street_address',$this->street_address,true);\n\t\t$criteria->compare('is_default',$this->is_default);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_time',$this->update_time);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('EMCE_ID',$this->EMCE_ID);\n\t\t$criteria->compare('MOOR_ID',$this->MOOR_ID);\n\t\t$criteria->compare('EVCR_ID',$this->EVCR_ID);\n\t\t$criteria->compare('EVES_ID',$this->EVES_ID);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('customerName',$this->customerName,true);\n\t\t$criteria->compare('agencyHead',$this->agencyHead,true);\n\t\t$criteria->compare('region_id',$this->region_id);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('municipalityCity_id',$this->municipalityCity_id);\n\t\t$criteria->compare('barangay_id',$this->barangay_id);\n\t\t$criteria->compare('houseNumber',$this->houseNumber,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('nature_id',$this->nature_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->name,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('state',$this->address,true);\n\t\t$criteria->compare('country',$this->address,true);\n\t\t$criteria->compare('contact_number',$this->contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('is_deleted',$this->is_deleted);\n\t\t$criteria->compare('deleted_by',$this->deleted_by,true);\n\t\t$criteria->compare('created_at',$this->created_at,true);\n\t\t$criteria->compare('updated_at',$this->updated_at,true);\n\t\tif(YII::app()->user->getState(\"role\") == \"admin\") {\n\t\t\t$criteria->condition = 'is_deleted = 0';\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('professional_status_id',$this->professional_status);\n\t\t$criteria->compare('birthday',$this->birthday);\n\t\t$criteria->compare('location',$this->location);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\r\n\t{\r\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\r\n\r\r\n\t\t$criteria=new CDbCriteria;\r\r\n\r\r\n\t\t$criteria->compare('id',$this->id);\r\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\r\n\t\t$criteria->compare('adds',$this->adds);\r\r\n\t\t$criteria->compare('edits',$this->edits);\r\r\n\t\t$criteria->compare('deletes',$this->deletes);\r\r\n\t\t$criteria->compare('view',$this->view);\r\r\n\t\t$criteria->compare('lists',$this->lists);\r\r\n\t\t$criteria->compare('searches',$this->searches);\r\r\n\t\t$criteria->compare('prints',$this->prints);\r\r\n\r\r\n\t\treturn new CActiveDataProvider($this, array(\r\r\n\t\t\t'criteria'=>$criteria,\r\r\n\t\t));\r\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('applyId',$this->applyId);\n\t\t$criteria->compare('stuId',$this->stuId);\n\t\t$criteria->compare('stuName',$this->stuName,true);\n\t\t$criteria->compare('specification',$this->specification,true);\n\t\t$criteria->compare('assetName',$this->assetName,true);\n\t\t$criteria->compare('applyTime',$this->applyTime,true);\n\t\t$criteria->compare('loanTime',$this->loanTime,true);\n\t\t$criteria->compare('returnTime',$this->returnTime,true);\n\t\t$criteria->compare('RFID',$this->RFID,true);\n\t\t$criteria->compare('stuTelNum',$this->stuTelNum,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('itemcode', $this->itemcode, true);\n $criteria->compare('product_id', $this->product_id, true);\n $criteria->compare('delete_flag', $this->delete_flag);\n $criteria->compare('status', $this->status);\n $criteria->compare('expire', $this->expire, true);\n $criteria->compare('date_input', $this->date_input, true);\n $criteria->compare('d_update', $this->d_update, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('verid',$this->verid);\n\t\t$criteria->compare('appversion',$this->appversion,true);\n\t\t$criteria->compare('appfeatures',$this->appfeatures,true);\n\t\t$criteria->compare('createtime',$this->createtime,true);\n\t\t$criteria->compare('baseNum',$this->baseNum);\n\t\t$criteria->compare('slave1Num',$this->slave1Num);\n\t\t$criteria->compare('packagename',$this->packagename,true);\n\t\t$criteria->compare('ostype',$this->ostype);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('client_id',$this->client_id,true);\n\t\t$criteria->compare('extension',$this->extension,true);\n\t\t$criteria->compare('rel_type',$this->rel_type,true);\n\t\t$criteria->compare('rel_id',$this->rel_id,true);\n\t\t$criteria->compare('meta_key',$this->meta_key,true);\n\t\t$criteria->compare('meta_value',$this->meta_value,true);\n\t\t$criteria->compare('date_entry',$this->date_entry,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('column_id',$this->column_id,true);\n\t\t$criteria->compare('research_title',$this->research_title,true);\n\t\t$criteria->compare('research_url',$this->research_url,true);\n\t\t$criteria->compare('column_type',$this->column_type);\n\t\t$criteria->compare('filiale_id',$this->filiale_id,true);\n\t\t$criteria->compare('area_name',$this->area_name,true);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('trigger_config',$this->trigger_config);\n\t\t$criteria->compare('status',$this->status);\n $criteria->compare('terminal_type',$this->terminal_type);\n\t\t$criteria->compare('start_time',$this->start_time,true);\n\t\t$criteria->compare('end_time',$this->end_time,true);\n\t\t$criteria->compare('explain',$this->explain,true);\n\t\t$criteria->compare('_delete',$this->_delete);\n\t\t$criteria->compare('_create_time',$this->_create_time,true);\n\t\t$criteria->compare('_update_time',$this->_update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('birthday',$this->birthday,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('is_get_news',$this->is_get_news);\n\t\t$criteria->compare('user_id',$this->user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('order_id',$this->order_id);\n\t\t$criteria->compare('device_id',$this->device_id,true);\n\t\t$criteria->compare('money',$this->money,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('add_time',$this->add_time);\n\t\t$criteria->compare('recharge_type',$this->recharge_type);\n\t\t$criteria->compare('channel',$this->channel,true);\n\t\t$criteria->compare('version_name',$this->version_name,true);\n\t\t$criteria->compare('pay_channel',$this->pay_channel);\n\t\t$criteria->compare('chanel_bid',$this->chanel_bid);\n\t\t$criteria->compare('chanel_sid',$this->chanel_sid);\n\t\t$criteria->compare('versionid',$this->versionid);\n\t\t$criteria->compare('chanel_web',$this->chanel_web);\n\t\t$criteria->compare('dem_num',$this->dem_num);\n\t\t$criteria->compare('last_watching',$this->last_watching,true);\n\t\t$criteria->compare('pay_type',$this->pay_type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n\r\n $criteria->compare('id', $this->id);\r\n $criteria->compare('country_id', $this->country_id);\r\n $criteria->compare('user_id', $this->user_id);\r\n $criteria->compare('vat', $this->vat);\r\n $criteria->compare('manager_coef', $this->manager_coef);\r\n $criteria->compare('curator_coef', $this->curator_coef);\r\n $criteria->compare('admin_coef', $this->admin_coef);\r\n $criteria->compare('status', $this->status);\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n ));\r\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('purchase_price',$this->purchase_price);\n\t\t$criteria->compare('sell_price',$this->sell_price);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('measurement',$this->measurement,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\t\t$criteria->compare('date_out',$this->date_out,true);\n\t\t$criteria->compare('date_in',$this->date_in,true);\n\t\t$criteria->compare('firma_id',$this->firma_id,true);\n\t\t$criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('instock',$this->instock);\n\t\t$criteria->compare('user_id',$this->user_id);\n $criteria->compare('warning_amount',$this->warning_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fname',$this->fname,true);\n\t\t$criteria->compare('mname',$this->mname,true);\n\t\t$criteria->compare('lname',$this->lname,true);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('date_of_birth',$this->date_of_birth,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('landline',$this->landline,true);\n\t\t$criteria->compare('em_contact_name',$this->em_contact_name,true);\n\t\t$criteria->compare('em_contact_relation',$this->em_contact_relation,true);\n\t\t$criteria->compare('em_contact_number',$this->em_contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('created_date',$this->created_date,true);\n\n return new CActiveDataProvider( $this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState( 'pageSize', Yii::app()->params[ 'defaultPageSize' ] ),\n ),\n ) );\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('COMPETITOR_ID',$this->COMPETITOR_ID);\n\t\t$criteria->compare('WSDC_NO',$this->WSDC_NO);\n\t\t$criteria->compare('FIRST_NAME',$this->FIRST_NAME,true);\n\t\t$criteria->compare('LAST_NAME',$this->LAST_NAME,true);\n\t\t$criteria->compare('COMPETITOR_LEVEL',$this->COMPETITOR_LEVEL);\n\t\t$criteria->compare('REMOVED',$this->REMOVED);\n\t\t$criteria->compare('ADDRESS',$this->ADDRESS,true);\n\t\t$criteria->compare('CITY',$this->CITY,true);\n\t\t$criteria->compare('STATE',$this->STATE,true);\n\t\t$criteria->compare('POSTCODE',$this->POSTCODE);\n\t\t$criteria->compare('COUNTRY',$this->COUNTRY,true);\n\t\t$criteria->compare('PHONE',$this->PHONE,true);\n\t\t$criteria->compare('MOBILE',$this->MOBILE,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('LEADER',$this->LEADER);\n\t\t$criteria->compare('REGISTERED',$this->REGISTERED);\n\t\t$criteria->compare('BIB_STATUS',$this->BIB_STATUS);\n\t\t$criteria->compare('BIB_NUMBER',$this->BIB_NUMBER);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sys_name',$this->sys_name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('CustomerId',$this->CustomerId,true);\n\t\t$criteria->compare('AddressId',$this->AddressId,true);\n\t\t$criteria->compare('CustomerStatusId',$this->CustomerStatusId,true);\n\t\t$criteria->compare('DateMasterId',$this->DateMasterId,true);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('CustomerPhoto',$this->CustomerPhoto,true);\n\t\t$criteria->compare('CustomerCode',$this->CustomerCode);\n\t\t$criteria->compare('Telephone',$this->Telephone,true);\n\t\t$criteria->compare('Mobile',$this->Mobile,true);\n\t\t$criteria->compare('EmailId',$this->EmailId,true);\n\t\t$criteria->compare('Status',$this->Status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('company_id', $this->company_id);\n\t\t$criteria->compare('productId', $this->productId);\n\t\t$criteria->compare('upTo', $this->upTo);\n\t\t$criteria->compare('fixPrice', $this->fixPrice);\n\t\t$criteria->compare('isActive', $this->isActive);\n\t\t$criteria->order = 'company_id';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$parameters = array('limit'=>ceil(Profile::getResultsPerPage()));\n\t\t$criteria->scopes = array('findAll'=>array($parameters));\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('itemId',$this->itemId);\n\t\t$criteria->compare('changedBy',$this->changedBy,true);\n\t\t$criteria->compare('recordName',$this->recordName,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\t\t$criteria->compare('oldValue',$this->oldValue,true);\n\t\t$criteria->compare('newValue',$this->newValue,true);\n\t\t$criteria->compare('diff',$this->diff,true);\n\t\t$criteria->compare('timestamp',$this->timestamp);\n\n\t\treturn new SmartActiveDataProvider(get_class($this), array(\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'timestamp DESC',\n\t\t\t),\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>Profile::getResultsPerPage(),\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('locality',$this->locality,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\n\t\t$criteria->compare('mem_type',$this->mem_type);\r\n\t\t$criteria->compare('business_type',$this->business_type);\r\n\t\t$criteria->compare('product_name',$this->product_name,true);\r\n\t\t$criteria->compare('panit',$this->panit,true);\r\n\t\t$criteria->compare('sex',$this->sex);\r\n\t\t$criteria->compare('tname',$this->tname);\r\n\t\t$criteria->compare('ftname',$this->ftname,true);\r\n\t\t$criteria->compare('ltname',$this->ltname,true);\r\n\t\t$criteria->compare('etname',$this->etname);\r\n\t\t$criteria->compare('fename',$this->fename,true);\r\n\t\t$criteria->compare('lename',$this->lename,true);\r\n\t\t$criteria->compare('birth',$this->birth,true);\r\n\t\t$criteria->compare('email',$this->email,true);\r\n\t\t$criteria->compare('facebook',$this->facebook,true);\r\n\t\t$criteria->compare('twitter',$this->twitter,true);\r\n\t\t$criteria->compare('address',$this->address,true);\r\n\t\t$criteria->compare('province',$this->province);\r\n\t\t$criteria->compare('prefecture',$this->prefecture);\r\n\t\t$criteria->compare('district',$this->district);\r\n\t\t$criteria->compare('postcode',$this->postcode,true);\r\n\t\t$criteria->compare('tel',$this->tel,true);\r\n\t\t$criteria->compare('mobile',$this->mobile,true);\r\n\t\t$criteria->compare('fax',$this->fax,true);\r\n\t\t$criteria->compare('high_education',$this->high_education);\r\n\t\t$criteria->compare('career',$this->career);\r\n\t\t$criteria->compare('skill_com',$this->skill_com);\r\n\t\t$criteria->compare('receive_news',$this->receive_news,true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('table_id',$this->table_id);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cou_id',$this->cou_id);\n\t\t$criteria->compare('thm_id',$this->thm_id);\n\t\t$criteria->compare('cou_nom',$this->cou_nom,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idempleo',$this->idempleo);\n\t\t$criteria->compare('administrativo',$this->administrativo,true);\n\t\t$criteria->compare('comercial',$this->comercial,true);\n\t\t$criteria->compare('artes',$this->artes,true);\n\t\t$criteria->compare('informatica',$this->informatica,true);\n\t\t$criteria->compare('salud',$this->salud,true);\n\t\t$criteria->compare('marketing',$this->marketing,true);\n\t\t$criteria->compare('servicio_domestico',$this->servicio_domestico,true);\n\t\t$criteria->compare('construccion',$this->construccion,true);\n\t\t$criteria->compare('agricultura',$this->agricultura,true);\n\t\t$criteria->compare('ganaderia',$this->ganaderia,true);\n\t\t$criteria->compare('telecomunicaciones',$this->telecomunicaciones,true);\n\t\t$criteria->compare('atencion_cliente',$this->atencion_cliente,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID_VALOR',$this->ID_VALOR);\n\t\t$criteria->compare('ID_UBICACION',$this->ID_UBICACION);\n\t\t$criteria->compare('ID_VISITA',$this->ID_VISITA);\n\t\t$criteria->compare('VALOR',$this->VALOR);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t\n\t\t$criteria->compare('id_aspecto',$this->id_aspecto,true);\n\t\t$criteria->compare('tbl_Programa_id_programa',$this->tbl_Programa_id_programa,true);\n\t\t$criteria->compare('tbl_Factor_id_factor',$this->tbl_Factor_id_factor);\n\t\t$criteria->compare('tbl_caracteristica_id_caracteristica',$this->tbl_caracteristica_id_caracteristica,true);\n\t\t$criteria->compare('num_aspecto',$this->num_aspecto,true);\n\t\t$criteria->compare('aspecto',$this->aspecto,true);\n\t\t$criteria->compare('instrumento',$this->instrumento,true);\n\t\t$criteria->compare('fuente',$this->fuente,true);\n\t\t$criteria->compare('documento',$this->documento,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('Observaciones',$this->Observaciones,true);\n\t\t$criteria->compare('cumple',$this->cumple,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('website_url',$this->website_url,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('user_name',$this->user_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('created_datetime',$this->created_datetime,true);\n\t\t$criteria->compare('icon_src',$this->icon_src,true);\n\t\t$criteria->compare('show_r18',$this->show_r18);\n\t\t$criteria->compare('show_bl',$this->show_bl);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('creationDate',$this->creationDate,true);\n\t\t$criteria->compare('year',$this->year);\n\t\t$criteria->compare('term',$this->term,true);\n\t\t$criteria->compare('activated',$this->activated);\n\t\t$criteria->compare('startingDate',$this->startingDate,true);\n\t\t$criteria->compare('activation_userId',$this->activation_userId);\n\t\t$criteria->compare('parent_catalogId',$this->parent_catalogId);\n $criteria->compare('isProspective', $this->isProspective);\n $criteria->compare('creatorId', $this->creatorId);\n $criteria->compare('isProposed', $this->isProposed);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('location',$this->location);\n\t\t$criteria->compare('theripiest',$this->theripiest);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('dob',$this->dob,true);\n\t\t$criteria->compare('inurancecompany',$this->inurancecompany,true);\n\t\t$criteria->compare('injurydate',$this->injurydate,true);\n\t\t$criteria->compare('therapy_start_date',$this->therapy_start_date,true);\n\t\t$criteria->compare('ASIA',$this->ASIA,true);\n\t\t$criteria->compare('injury',$this->injury,true);\n\t\t$criteria->compare('medication',$this->medication,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search () {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('formId', $this->formId, true);\n\t\t$criteria->compare('data', $this->data, true);\n\t\t$criteria->compare('ctime', $this->ctime);\n\t\t$criteria->compare('mtime', $this->mtime);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('imputetype_id',$this->imputetype_id);\n\t\t$criteria->compare('project_id',$this->project_id);\n\n\t\treturn new ActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('category_id',$this->category_id);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('price_z',$this->price_z);\n\t\t$criteria->compare('price_s',$this->price_s);\n\t\t$criteria->compare('price_m',$this->price_m);\n\t\t$criteria->compare('dependence',$this->dependence,true);\n\t\t$criteria->compare('barcode',$this->barcode,true);\n\t\t$criteria->compare('unit',$this->unit,true);\n\t\t$criteria->compare('minimal_amount',$this->minimal_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 100),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('image',$this->image,true);\n\t\t$criteria->compare('manager',$this->manager);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('realname',$this->realname,true);\n\t\t$criteria->compare('identity',$this->identity,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('bussiness_license',$this->bussiness_license,true);\n\t\t$criteria->compare('bankcode',$this->bankcode,true);\n\t\t$criteria->compare('banktype',$this->banktype,true);\n\t\t$criteria->compare('is_open',$this->is_open,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('images_str',$this->images_str,true);\n\t\t$criteria->compare('gmt_created',$this->gmt_created,true);\n\t\t$criteria->compare('gmt_modified',$this->gmt_modified,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email_admin',$this->email_admin,true);\n\t\t$criteria->compare('password_api',$this->password_api,true);\n\t\t$criteria->compare('url_result_api',$this->url_result_api,true);\n\t\t$criteria->compare('id_currency_2',$this->id_currency_2);\n\t\t$criteria->compare('id_currency_1',$this->id_currency_1,true);\n\t\t$criteria->compare('is_test_mode',$this->is_test_mode);\n\t\t$criteria->compare('is_commission_shop',$this->is_commission_shop);\n\t\t$criteria->compare('commission',$this->commission);\n\t\t$criteria->compare('is_enable',$this->is_enable);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('mod_date',$this->mod_date,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('userID',$this->userID,true);\n\t\t$criteria->compare('mtID',$this->mtID,true);\n\t\t$criteria->compare('fxType',$this->fxType);\n\t\t$criteria->compare('leverage',$this->leverage);\n\t\t$criteria->compare('amount',$this->amount,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('surname',$this->surname,true);\n\t\t$criteria->compare('comany_name',$this->comany_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('is_admin',$this->is_admin);\n\t\t$criteria->compare('paid_period_start',$this->paid_period_start,true);\n\t\t$criteria->compare('ftp_pass',$this->ftp_pass,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('price',$this->price,true);\n\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('breed',$this->breed,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_birthday',$this->date_birthday,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('tattoo',$this->tattoo,true);\n\t\t$criteria->compare('sire',$this->sire,true);\n\t\t$criteria->compare('dame',$this->dame,true);\n\t\t$criteria->compare('owner_type',$this->owner_type,true);\n\t\t$criteria->compare('honors',$this->honors,true);\n\t\t$criteria->compare('photo_preview',$this->photo_preview,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('pet_status',$this->pet_status,true);\n\t\t$criteria->compare('about',$this->about,true);\n\t\t$criteria->compare('uid',$this->uid);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('veterinary',$this->veterinary,true);\n\t\t$criteria->compare('vaccinations',$this->vaccinations,true);\n\t\t$criteria->compare('show_class',$this->show_class,true);\n\t\t$criteria->compare('certificate',$this->certificate,true);\n $criteria->compare('neutered_spayed',$this->certificate,true);\n \n\n $criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('city',$this->city,true);\n\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('HISTORY',$this->HISTORY,true);\n\t\t$criteria->compare('WELCOME_MESSAGE',$this->WELCOME_MESSAGE,true);\n\t\t$criteria->compare('LOCATION',$this->LOCATION,true);\n\t\t$criteria->compare('PHONES',$this->PHONES,true);\n\t\t$criteria->compare('FAX',$this->FAX,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('MISSION',$this->MISSION,true);\n\t\t$criteria->compare('VISION',$this->VISION,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('orgName',$this->orgName,true);\n\t\t$criteria->compare('noEmp',$this->noEmp);\n\t\t$criteria->compare('phone',$this->phone);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('addr1',$this->addr1,true);\n\t\t$criteria->compare('addr2',$this->addr2,true);\n\t\t$criteria->compare('state',$this->state,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('orgType',$this->orgType,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('fax',$this->fax);\n\t\t$criteria->compare('orgId',$this->orgId,true);\n\t\t$criteria->compare('validity',$this->validity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('sortorder',$this->sortorder,true);\n\t\t$criteria->compare('fullname',$this->fullname,true);\n\t\t$criteria->compare('shortname',$this->shortname,true);\n\t\t$criteria->compare('idnumber',$this->idnumber,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('summaryformat',$this->summaryformat);\n\t\t$criteria->compare('format',$this->format,true);\n\t\t$criteria->compare('showgrades',$this->showgrades);\n\t\t$criteria->compare('sectioncache',$this->sectioncache,true);\n\t\t$criteria->compare('modinfo',$this->modinfo,true);\n\t\t$criteria->compare('newsitems',$this->newsitems);\n\t\t$criteria->compare('startdate',$this->startdate,true);\n\t\t$criteria->compare('marker',$this->marker,true);\n\t\t$criteria->compare('maxbytes',$this->maxbytes,true);\n\t\t$criteria->compare('legacyfiles',$this->legacyfiles);\n\t\t$criteria->compare('showreports',$this->showreports);\n\t\t$criteria->compare('visible',$this->visible);\n\t\t$criteria->compare('visibleold',$this->visibleold);\n\t\t$criteria->compare('groupmode',$this->groupmode);\n\t\t$criteria->compare('groupmodeforce',$this->groupmodeforce);\n\t\t$criteria->compare('defaultgroupingid',$this->defaultgroupingid,true);\n\t\t$criteria->compare('lang',$this->lang,true);\n\t\t$criteria->compare('theme',$this->theme,true);\n\t\t$criteria->compare('timecreated',$this->timecreated,true);\n\t\t$criteria->compare('timemodified',$this->timemodified,true);\n\t\t$criteria->compare('requested',$this->requested);\n\t\t$criteria->compare('enablecompletion',$this->enablecompletion);\n\t\t$criteria->compare('completionnotify',$this->completionnotify);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('zipcode',$this->zipcode,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('role',$this->role,true);\n\t\t$criteria->compare('active',$this->active);\n\t\t$criteria->compare('camaras',$this->camaras);\n\t\t$criteria->compare('freidoras',$this->freidoras);\n\t\t$criteria->compare('cebos',$this->cebos);\n\t\t$criteria->compare('trampas',$this->trampas);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cod_venda',$this->cod_venda,true);\n\t\t$criteria->compare('filial_cod_filial',$this->filial_cod_filial,true);\n\t\t$criteria->compare('funcionario_cod_funcionario',$this->funcionario_cod_funcionario,true);\n\t\t$criteria->compare('cliente_cod_cliente',$this->cliente_cod_cliente,true);\n\t\t$criteria->compare('data_2',$this->data_2,true);\n\t\t$criteria->compare('valor_total',$this->valor_total);\n\t\t$criteria->compare('forma_pagamento',$this->forma_pagamento,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('attribute',$this->attribute,true);\n\t\t$criteria->compare('displayName',$this->displayName,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('value_type',$this->value_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->buscar,'OR');\n\t\t$criteria->compare('fecha',$this->buscar,true,'OR');\n\t\t$criteria->compare('fechaUpdate',$this->buscar,true,'OR');\n\t\t$criteria->compare('idProfesional',$this->buscar,'OR');\n\t\t$criteria->compare('importe',$this->buscar,'OR');\n\t\t$criteria->compare('idObraSocial',$this->buscar,'OR');\n\t\t$criteria->compare('estado',$this->buscar,true,'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codop',$this->codop,true);\n\t\t$criteria->compare('codcatval',$this->codcatval,true);\n\t\t$criteria->compare('cuentadebe',$this->cuentadebe,true);\n\t\t$criteria->compare('cuentahaber',$this->cuentahaber,true);\n\t\t$criteria->compare('desop',$this->desop,true);\n\t\t$criteria->compare('descat',$this->descat,true);\n\t\t$criteria->compare('debe',$this->debe,true);\n\t\t$criteria->compare('haber',$this->haber,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pagesize'=>100),\n\t\t));\n\t}" ]
[ "0.7212205", "0.7136089", "0.709311", "0.7093049", "0.69849986", "0.6960436", "0.69469506", "0.6941555", "0.6933617", "0.69236004", "0.69113576", "0.6902701", "0.68982255", "0.6897759", "0.689175", "0.6882377", "0.68796957", "0.68736434", "0.68490034", "0.6848714", "0.6835229", "0.68259984", "0.68151385", "0.6806617", "0.6802905", "0.6796781", "0.6796036", "0.6795527", "0.67953396", "0.6793158", "0.6790047", "0.6784959", "0.67847145", "0.6783755", "0.6780888", "0.67800415", "0.67783886", "0.67768997", "0.6776394", "0.6775681", "0.67751485", "0.67751485", "0.67751485", "0.67751485", "0.67751485", "0.67751485", "0.67751485", "0.67751485", "0.677278", "0.6767932", "0.67664635", "0.6765984", "0.6762367", "0.67619914", "0.6760664", "0.67597944", "0.67596245", "0.6758387", "0.67532355", "0.6752342", "0.67521584", "0.6747126", "0.67471176", "0.67454255", "0.6745137", "0.67446893", "0.6743991", "0.6743839", "0.6743677", "0.67432225", "0.6742161", "0.6740563", "0.6740203", "0.6739166", "0.673633", "0.6736143", "0.67341983", "0.67315125", "0.6731108", "0.6724689", "0.67227924", "0.6722133", "0.67217237", "0.67123115", "0.67118555", "0.6710423", "0.6708466", "0.6706158", "0.6705272", "0.67051977", "0.6703849", "0.670215", "0.67003655", "0.6698004", "0.6696211", "0.6695235", "0.66949475", "0.6693419", "0.66930205", "0.6692732", "0.66911924" ]
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.7574381", "0.7529001", "0.72717786", "0.7270387", "0.7262305", "0.7214525", "0.7213965", "0.71321", "0.7129096", "0.7129096", "0.710298", "0.710298", "0.71026886", "0.7074855", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005" ]
0.0
-1
Gets the private 'App\Repository\FirstNameRepository' shared autowired service.
public static function do($container, $lazyLoad = true) { include_once \dirname(__DIR__, 4).'/vendor/doctrine/persistence/lib/Doctrine/Persistence/ObjectRepository.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/collections/lib/Doctrine/Common/Collections/Selectable.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepositoryInterface.php'; include_once \dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/Repository/ServiceEntityRepository.php'; include_once \dirname(__DIR__, 4).'/src/Repository/FirstNameRepository.php'; return $container->privates['App\\Repository\\FirstNameRepository'] = new \App\Repository\FirstNameRepository(($container->services['doctrine'] ?? $container->getDoctrineService())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRepository()\n {\n return $this->repository;\n }", "protected function getRepositoryClassName()\n {\n return get_class($this);\n }", "public function getRepositoryFactory()\n {\n return $this->repositoryFactory;\n }", "protected function getRepository() {\n if(empty($this->repository)) {\n try {\n $pdo = new PDO(PDO_DSN, DB_USER, DB_PASS);\n $this->repository = new UserRepository($pdo);\n } catch (PDOException $e) {\n $this->errorMessages[] = 'Connection failed: ' . $e->getMessage();\n }\n }\n\n return $this->repository;\n }", "public function getRepository();", "protected function getRepository() {}", "protected function getRepositoryClassName() {}", "public static function get(): AbstractRepository {\n return new static();\n }", "public function repository()\n {\n return Repository::i();\n }", "public function getRepository()\n {\n return $this->manager->getRepository($this->class);\n }", "public function baseRepository() {\n $userRepository = $this->getDoctrine()\n ->getManager()\n ->getRepository('Application\\UserBundle\\Entity\\User');\n return $userRepository;\n }", "public function homeRepo() {\n return $this->app->bind('App\\Repositories\\Home\\HomeRepositoryInterface', 'App\\Repositories\\Home\\HomeRepository');\n }", "public function getRepository(string $className): IRepository;", "protected function getAnnotations_ReaderService()\n {\n $this->services['annotations.reader'] = $instance = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\n\n $a = new \\Doctrine\\Common\\Annotations\\AnnotationRegistry();\n $a->registerUniqueLoader('class_exists');\n\n $instance->addGlobalIgnoredName('required', $a);\n\n return $instance;\n }", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public function getRepository()\n {\n return $this->repository;\n }", "public abstract function getRepository();", "abstract protected function getRepositoryName();", "public function getRepository(){\n return $this->repository;\n }", "abstract protected function getRepository();", "public static function getRepository()\n {\n if (is_null(static::$repository)) {\n static::$repository = static::buildRepository();\n }\n\n return static::$repository;\n }", "abstract public function getRepository();", "abstract public function getRepository();", "public function getRepository()\n {\n return $this->getEntityManager()->getRepository($this->getEntityClassName());\n }", "public function getAccountRepository()\n {\n if (!$this->accountRepository) {\n $this->setAccountRepository($this->getEntityManager()->getRepository('Account\\Entity\\Account'));\n }\n return $this->accountRepository;\n }", "protected function getAnnotations_ReaderService()\n {\n return $this->services['annotations.reader'] = new \\Doctrine\\Common\\Annotations\\AnnotationReader();\n }", "public function getRepository($className);", "public function getRepository(): SourceRepo\n {\n return $this->repository;\n }", "protected function repository($name)\n {\n parent::repository($name);\n\n return $this->repository;\n }", "private function getUserService()\n\t{\n\t\treturn $this->userService = new UsersService();\n\t}", "protected function getRepository()\n {\n return $this->entityManager->getRepository($this->getEntityClass());\n }", "protected function getFosUser_UserProvider_UsernameService()\n {\n return $this->services['fos_user.user_provider.username'] = new \\FOS\\UserBundle\\Security\\UserProvider($this->get('fos_user.user_manager'));\n }", "protected function getAnnotationReaderService()\n {\n return $this->services['annotation_reader'] = new \\Doctrine\\Common\\Annotations\\CachedReader(${($_ = isset($this->services['annotations.reader']) ? $this->services['annotations.reader'] : $this->getAnnotations_ReaderService()) && false ?: '_'}, new \\Symfony\\Component\\Cache\\DoctrineProvider(\\Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter::create((__DIR__.'/annotations.php'), ${($_ = isset($this->services['cache.annotations']) ? $this->services['cache.annotations'] : $this->getCache_AnnotationsService()) && false ?: '_'})), false);\n }", "public function getFirstName() {}", "public function getFirstName() {}", "protected function getAnnotationReaderService()\n {\n return $this->services['annotation_reader'] = new \\Doctrine\\Common\\Annotations\\CachedReader(${($_ = isset($this->services['annotations.reader']) ? $this->services['annotations.reader'] : $this->getAnnotations_ReaderService()) && false ?: '_'}, ${($_ = isset($this->services['annotations.cache']) ? $this->services['annotations.cache'] : $this->load('getAnnotations_CacheService.php')) && false ?: '_'}, true);\n }", "public function getRepository() : RepositoryInterface {\n\n if(null === $this->repository) {\n\n $quizModuleService = new ModuleService(new Meta(), new View());\n $this->repository = new Repository($this->getConfig(), $quizModuleService);\n }\n\n return $this->repository;\n }", "public function getRepository(): EntityRepository;", "protected function getRepository()\n {\n return \\DMK\\Mkpostman\\Factory::getSubscriberRepository();\n }", "public function getRepositoryName()\n {\n return $this->repositoryName;\n }", "public function getFirstName();", "public function getRepository(): ObjectRepository\n {\n return $this->repository;\n }", "public function getRepository() /*: string*/ {\n if ($this->repository === null) {\n throw new \\Exception(\"Repository is not initialized\");\n }\n return $this->repository;\n }", "public function getUserService()\n {\n return $this->userService;\n }", "protected function getEntityRepository()\n {\n return 'KGCSharedBundle:Client';\n }", "public function getDaoRepository()\n {\n return app()->make('App\\Dao\\\\' . $this->getModelName());\n }", "public function getRepo()\n {\n return $this->repo;\n }", "public static function getRepositoryClassName()\n {\n return 'GamificationsRewardRepository';\n }", "private function registerFactoryInRepository(): FactoryInterface\n {\n if (!empty($this->statedClassName)) {\n $this->factoryRepository[$this->statedClassName] = $this;\n }\n\n return $this;\n }", "protected function getRepository($repositoryName = null)\n {\n $guesser = new ClassGuesser($this);\n\n // try to find automatically the repository name\n if (!$repositoryName) {\n $repositoryName = $guesser->getClass(array('Manager', 'Controller'));\n $repositoryName = sprintf('%s%s:%s', $guesser->getNamespace(), $guesser->getBundle(), $repositoryName);\n\n // get bundle and repository in camel case\n $repositoryName = Container::camelize($repositoryName);\n }\n return $this->getEntityManager()->getRepository($repositoryName);\n }", "protected function getVictoireBusinessEntity_AnnotationDriverService()\n {\n return $this->services['victoire_business_entity.annotation_driver'] = new \\Victoire\\Bundle\\BusinessEntityBundle\\Annotation\\AnnotationDriver($this->get('annotation_reader'), $this->get('event_dispatcher'), $this->get('victoire_widget.widget_helper'), array(0 => ($this->targetDirs[3].'/app/../src'), 1 => ($this->targetDirs[3].'/app/../vendor/victoire'), 2 => ($this->targetDirs[3].'/app/../vendor/friendsofvictoire')), $this->get('logger'));\n }", "protected function getLocalRepository()\n {\n if (!$this->localRepo){\n $this->localRepo = new InstalledFilesystemRepository(\n new JsonFile(\n $this->composer->getConfig()->get(\"vendor-dir\") . \"/composer/installed_extra.json\"\n )\n );\n }\n\n return $this->localRepo;\n }", "protected function registerRepository()\n {\n $this->app->singleton(CachingRepository::class, function (Container $app) {\n $repo = new GitHubRepository(\n GuzzleFactory::make(),\n $app->config->get('emoji.token')\n );\n\n $cache = $app->cache->store($app->config->get('emoji.connection'));\n $key = $app->config->get('emoji.key', 'emoji');\n $life = (int) $app->config->get('emoji.life', 10080);\n\n return new CachingRepository($repo, $cache, $key, $life);\n });\n\n $this->app->alias(CachingRepository::class, RepositoryInterface::class);\n }", "public function getRepository($repositoryName = null) {\r\n\t if($repositoryName === null) {\r\n\t $repositoryName = $this->getAnnotation('entity');\r\n\t }\r\n\t return $this->getEntityManager()->getRepository($repositoryName);\r\n\t}", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function getRepository(EntityManagerInterface $entityManager, $entityName);", "public function getRepositoryName()\n {\n return 'Manager\\Entity\\Document';\n }", "public function repository()\n {\n return GenreRepositoryInterface::class;\n }", "protected function getRepository($repositoryName=\"\")\n {\n if(empty($repositoryName)) {\n $repositoryName = $this->repositoryName;\n }\n return $this->_em->getRepository($repositoryName);\n }", "protected function getRepository($entityName)\n {\n return $this->getEntityManager()->getRepository($entityName);\n }", "protected function getSubjectRepository(): SubjectRepository\n {\n if ($this->subjectRepository === null) {\n $this->subjectRepository = GeneralUtility::makeInstance(SubjectRepository::class);\n }\n\n return $this->subjectRepository;\n }", "protected function getMemberRepo()\n {\n if ($this->_membersRepo === null || !$this->_membersRepo) {\n $this->_membersRepo = $this->getEntityRepository(Member::class);\n }\n\n return $this->_membersRepo;\n }", "public function getFirstName()\n {\n\t\t$res = $this->getEntity()->getFirstName();\n\t\tif($res === null)\n\t\t{\n\t\t\tSDIS62_Model_DAO_Abstract::getInstance($this::$type_objet)->create($this);\n\t\t\treturn $this->getEntity()->getFirstName();\n\t\t}\n return $res;\n }", "public function getFirstName() { return $this->firstName; }", "public function getHonoreeFirstName();", "protected function getConsentRepository(): ConsentRepository\n {\n if ($this->consentRepository === null) {\n $this->consentRepository = GeneralUtility::makeInstance(ConsentRepository::class);\n }\n\n return $this->consentRepository;\n }", "public function getFirstName(): string;", "public function getFirstName()\n {\n return parent::getFirstName();\n }", "public function provides()\n\t{\n\t\treturn [UserRepository::class];\n\t}", "public function getQualifiedDomainRepositoryClassName()\n {\n if (!$this->aggregateRoot) {\n return '';\n }\n\n return $this->extension->getNamespaceName() . '\\\\Domain\\\\Repository\\\\' . $this->getName() . 'Repository';\n }", "function getFirstName()\r\n\t{\r\n\t\treturn $this->FirstName;\r\n\t}", "public function getDefaultRepositoryClassName(): ?string\n {\n return $this->defaultRepositoryClassName;\n }", "public function repository(): RepositoryContract;", "public function getService()\n {\n if (!$this->service) {\n /** @var \\OAuth\\ServiceFactory $serviceFactory */\n $serviceFactory = $this->app->make('oauth/factory/service');\n $this->service = $this->factory->createService($serviceFactory);\n }\n\n return $this->service;\n }", "function getFirstName() {\n return $this->first_name;\n }", "protected function getContainerRepository()\n {\n return $this->containerRepository;\n }", "function getFirstName(){\n\t\treturn $this->firstName;\n\t}", "public function getFirstName()\n {\n return $this->get('FirstName');\n }", "protected function getRepository()\n {\n return $this->tokens;\n }", "protected function getRepository()\n {\n return $this->tokens;\n }", "public function getEntityRepository()\n {\n return $this->entityRepository;\n }", "public function getFirstName(){\n \n return $this->first_name;\n \n }", "protected function _getUserService() {\n \tif(null === $this->userService) {\n \t\t$sm = $this->getServiceLocator();\n \t\t$this->userService = ServicesUtil::getUserUtil($sm);\n \t}\n \treturn $this->userService;\n }", "public function getRepository($entityName)\n {\n if (!class_exists($entityName)) {\n throw new \\RuntimeException(sprintf('Given entity %s does not exist', $entityName));\n }\n\n if (null === $repository = $this->getRepositoryClassName($entityName)) {\n $repository = 'Al\\Component\\QuickBase\\Model\\Repository';\n }\n\n return new $repository($this);\n }", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "public function getDomainRepositoryClassName()\n {\n if (!$this->aggregateRoot) {\n return '';\n } else {\n return $this->getName() . 'Repository';\n }\n }", "public function getLoginService()\r\n\t{\r\n\t\treturn $this->loginService = new LoginService();\r\n\t}", "protected function getGiftCardRepository() {\n if (is_null($this->_gcRepository)) {\n $this->_gcRepository = $this->objectManager->create('\\Magento\\GiftCardAccount\\Model\\Giftcardaccount');\n }\n\n return $this->_gcRepository;\n }", "protected function registerRepository()\n\t{\n\t\t$this->app->bind('confide.repository', function ($app) {\n\t\t\treturn new EloquentRepository($app);\n\t\t});\n\t}", "public function __construct(DefaultService $repository) {\n $this->repository = $repository;\n }", "public function getFirstName()\n {\n return $this->first_name ?? $this->nickname ?? $this->name;\n }", "public function repository(): CrudRepository\n {\n return new ResourceRepository();\n }", "public function getFirstName(): string\n {\n return $this->firstName;\n }", "public function getFirstName(): string\n {\n return $this->firstName;\n }", "public function getFirstName(): string\n {\n return $this->firstName;\n }" ]
[ "0.56136507", "0.55899537", "0.5563185", "0.55624044", "0.55539024", "0.5547275", "0.55410933", "0.54890364", "0.5483894", "0.5456893", "0.5454754", "0.54434025", "0.5443245", "0.54352236", "0.5429165", "0.54054886", "0.54054886", "0.54054886", "0.54054886", "0.54054886", "0.54054886", "0.54003865", "0.53900725", "0.53889537", "0.5374082", "0.5343535", "0.5338123", "0.5338123", "0.5297831", "0.5295074", "0.52881974", "0.5277799", "0.52769375", "0.52753574", "0.5267868", "0.52631503", "0.5260966", "0.52394134", "0.52357095", "0.52357095", "0.52308464", "0.52299595", "0.52223694", "0.52174973", "0.5196724", "0.5162772", "0.5142897", "0.5139132", "0.51015985", "0.50849205", "0.50762737", "0.50709605", "0.5070384", "0.5053366", "0.504947", "0.50177544", "0.49951854", "0.4986283", "0.4982458", "0.49607968", "0.49457344", "0.49422523", "0.49409452", "0.49396762", "0.4939291", "0.49352142", "0.49262995", "0.4926269", "0.49210387", "0.4911338", "0.4901766", "0.4884864", "0.4879276", "0.4871575", "0.486555", "0.48604298", "0.48602802", "0.48602086", "0.48554975", "0.48473516", "0.48284876", "0.4825867", "0.48244202", "0.48188415", "0.48188415", "0.4806581", "0.4805337", "0.48017538", "0.48009342", "0.47939363", "0.4789699", "0.47845268", "0.47798085", "0.47706595", "0.47679383", "0.4767893", "0.47659934", "0.475843", "0.475843", "0.475843" ]
0.55900276
1
This SHOULD be used always to receive any kind of value from _GET _POST _REQUEST if it will be used on SQL staments.
function check_single_incomming_var($var, $request = FALSE, $url_decode = FALSE) { if ((is_string($var) || is_numeric($var)) && !is_array($var)) { if (($request == TRUE) && isset($_REQUEST[$var])) { $value = $_REQUEST[$var]; } elseif ($request == FALSE) { $value = $var; } else { $value = NULL; } if ($value === '') { return NULL; } elseif (($value === 0)) { return 0; } elseif (($value === '0')) { return '0'; } else { // $value = htmlspecialchars($value); } if ($url_decode) { $value = urldecode($value); } if (\json_decode($value) === NULL) { // $search = ['\\', "\0", "\n", "\r", "'", '"', "\x1a"]; // $replace = ['\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z']; // $value = str_replace($search, $replace, $value); // $value = @mysql_real_escape_string($value); } return $value; } else { return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValue($fieldName) {\r\n $value = '';\r\n if (isset($_REQUEST[$fieldName])) { \r\n $value = $_REQUEST[$fieldName];\r\n }\r\n return $value;\r\n }", "function usingRequest()\r\n{ echo \"<br>\";\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\r\n {\r\n // collect value of input field\r\n $name = htmlspecialchars($_REQUEST['fname']);\r\n if (empty($name)) \r\n {\r\n throw new Exception(\"Accept only integer values!!!\"); \r\n } \r\n else \r\n {\r\n echo $name.\"<br>\";\r\n }\r\n\r\n }\r\n}", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}", "function receive() {\n // Input type 1.\n if ($this->method == 'POST' && isset($_POST[$this->id . '-form_id']) && $_POST[$this->id . '-form_id'] == $this->id) {\n $this->request['raw_input'] = $_POST;\n }\n // Input types 2 and 3.\n else {\n $this->request['raw_input'] = $_GET;\n }\n }", "protected function getPostValues() {}", "function get_post($conn, $var){\n\t\treturn $conn->real_escape_string($_POST[$var]);\n\t}", "function LT_request($variable, $default) {\n\tglobal $LT_SQL;\n\tif (array_key_exists($variable, $_REQUEST))\n\t\treturn $LT_SQL->real_escape_string($_REQUEST[$variable]);\n\telse\n\t\treturn $LT_SQL->real_escape_string($default);\n}", "function getParam($name, $check_numerical=false)\n{\n $p = $_GET[$name];\n if ($p == \"\") {\n $p = $_POST[$name];\n }\n //coming in per POST?\n $p= filterSQL($p);\n return $p;\n}", "function get_post($con, $var)\n{\n return $con->real_escape_string($_POST[$var]);\n}", "function setQueryParameter($value)\r\n {\r\n if(preg_match('[\\S]', $_POST[$value]) || $_POST[$value] != \"\")\r\n return filter_var($_POST[$value], FILTER_SANITIZE_STRING);\r\n else\r\n return \"%\";\r\n }", "abstract public function get_posted_value();", "function get_parameter($param) {\n\tif (isset($_POST[$param])) {\t\t//if name/pw are valid parameters\n\t\treturn mysql_real_escape_string($_POST[$param]);\t\t//return those\n\t} else { \t\t\t\t\t\t//if nothing posted\n\t\theader(\"HTTP/1.1 400 Invalid Request\");\n\t\tdie(\"HTTP/1.1 400 Invalid Request - you forgot to pass the proper parameters\");\n\t}\n}", "function atkGetPostVar($key=\"\")\n{\n\tif(empty($key) || $key==\"\")\n\t{\n\t\treturn $_REQUEST;\n\t}\n\telse\n\t{\n\t\tif (array_key_exists($key,$_REQUEST) && $_REQUEST[$key]!=\"\") return $_REQUEST[$key];\n\t\treturn \"\";\n\t}\n}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "function iformReq( $var, &$myConn )\n{\n /**\n * $redirect stores page to redirect user to upon failure\n * These variables are declared in the page, just before the form fields are tested.\n *\n * @global string $redirect\n */\n global $redirect ;\n\n if ( empty( $var ) )\n { myRedirect( $redirect ) ; }\n else\n { return idbIn( $var, $myConn ) ; }\n}", "public function getSubmittedValue() {\n return isset($_REQUEST[$this->name]) ? $_REQUEST[$this->name] : FALSE;\n }", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "function get_param($param_name)\n{\n $param_value = \"\";\n if(isset($_POST[$param_name]))\n $param_value = $_POST[$param_name];\n else if(isset($_GET[$param_name]))\n $param_value = $_GET[$param_name];\n\n return $param_value;\n}", "function handlePOSTRequest() {\n if (array_key_exists('submitProjectionRequest', $_POST)) {\n handleProjectionRequest();\n }\n }", "public function getValueFromRequest() {\n\t\tglobal $wgRequest;\n\t\t$this->aActiveValues = $wgRequest->getArray( $this->getParamKey(), array() );\n\t}", "protected abstract function fetchSubmitValue();", "private function inputs(){\n\t\tswitch($_SERVER['REQUEST_METHOD']){ // Make switch case so we can add additional \n\t\t\tcase \"GET\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"GET\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"POST\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"PUT\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"DELETE\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->response('Forbidden',403);\n\t\t\t\tbreak;\n\t\t}\n\t}", "function getVars() {\r\n return !empty($_POST) ? $_POST : (!empty($_GET) ? $_GET : NULL);\r\n }", "function rest_sanitize_request_arg($value, $request, $param)\n {\n }", "public static function GetFormValues(){\n self::$KeyValue = isset($_REQUEST[\"KeyValue\"]) ? $_REQUEST[\"KeyValue\"] : \"\"; \n \n if (self::$KeyValue == \"\"){\n\t self::$KeyValue = \"new zealand\"; \n\t }\n\t \n\t \n\t self::$KeyValue = urlencode(self::$KeyValue);\n\t \n\t self::$MapLattitude = isset($_REQUEST[\"MapLattitude\"]) ? $_REQUEST[\"MapLattitude\"] : \"\"; \n\t self::$MapLongtitude= isset($_REQUEST[\"MapLongtitude\"]) ? $_REQUEST[\"MapLongtitude\"] : \"\"; \n\t \n }", "function PostVar($name, $default_value = false) {\r\n if (!isset($_POST)) {\r\n return false;\r\n }\r\n if (isset($_POST[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_POST[$name]);\r\n }\r\n return $_POST[$name];\r\n }\r\n return $default_value;\r\n}", "protected function getPostParam($clave)\n\t{\n\t\tif(isset($_POST[$clave])):\n\t\t\treturn $_POST[$clave];\n\t\tendif;\n\t}", "function get_post($var)\n{\n return mysql_real_escape_string($_POST[$var]);\n}", "function get_post_var($var)\r\n{\r\n if (isset($_POST[$var]) AND !empty($_POST[$var])) {\r\n $val = $_POST[$var];\r\n return sanitizeAny($val);\r\n } else {\r\n return null;\r\n }\r\n}", "function checkTextFormValuesGet($session){\r\n\t\tif (!empty($_GET[$session]) && is_string($_GET[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_GET[$session])) {\r\n\t\t\t$return = $_GET[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function getPostParam($name,$def=null) {\n\treturn htmlentities(isset($_POST[$name]) ? $_POST[$name] : $def,ENT_QUOTES);\n\t\t\n}", "function getPostValue ( $name ) {\n\tglobal $HTTP_POST_VARS;\n\n\tif ( isset ( $_POST ) && is_array ( $_POST ) && ! empty ( $_POST[$name] ) ) {\n\t\t$HTTP_POST_VARS[$name] = $_POST[$name];\n\t\treturn $_POST[$name];\n\t} else if ( ! isset ( $HTTP_POST_VARS ) ) {\n\t\treturn null;\n\t} else if ( ! isset ( $HTTP_POST_VARS[$name] ) ) {\n\t\treturn null;\n\t}\n\treturn ( $HTTP_POST_VARS[$name] );\n}", "function safePostGetVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n elseif (isset($_GET[$varName]))\n return $_GET[$varName];\n else\n return $default;\n}", "function checkrequest($name)\n {\n\t if($this->is_post()||$this->updatemode==true){\n\t\t return $_REQUEST[$name];\n/*\t\t if(isset($_REQUEST[$name])) {\n\t\t\t return $_REQUEST[$name];\n\t\t }\n\t\t elseif($_REQUEST[$name]==\"\") {\n\t\t return \"\";\n\t\t}*/\n }\n\telse\n\t return \"\";\n }", "function safePostVar($varName, $default=null)\n{\n if (isset($_POST[$varName]))\n return $_POST[$varName];\n else\n return $default;\n}", "function _pog($v) {\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : (isset($_GET[$v]) ? bwm_clean($_GET[$v]) : NULL);\r\n}", "function getParameters(){\n // Parse incoming query and variables\n return (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) \n ? json_decode( file_get_contents('php://input'), true) \n : $_REQUEST;\n\n}", "function input_request(string $key): ?string\n{\n return \\array_key_exists($key, $_REQUEST) ?\n \\wp_unslash($_REQUEST[$key]) : null;\n}", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }", "function posted_value($name) {\n if(isset($_POST[$name])) {\n return htmlspecialchars($_POST[$name]);\n }\n}", "function getSafePost($model, $column, &$value) {\n $value = (isset($_POST['data'][$model][$column]))\n ? htmlentities($_POST['data'][$model][$column])\n : $value;\n\n return (isset($_POST['data'][$model][$column]));\n }", "private function getPostData()\n {\n $postData = $this->request->getPostValue();\n\n /** Magento may adds the SID session parameter, depending on the store configuration.\n * We don't need or want to use this parameter, so remove it from the retrieved post data. */\n unset($postData['SID']);\n\n //Set original postdata before setting it to case lower.\n $this->originalPostData = $postData;\n\n //Create post data array, change key values to lower case.\n $postDataLowerCase = array_change_key_case($postData, CASE_LOWER);\n $this->postData = $postDataLowerCase;\n }", "private function postget ( $key ) {\n if ( isset( $_POST[ $key ] ) ) {\n return filter_input( INPUT_POST, $key );\n } elseif ( isset( $_GET[ $key ] ) ) {\n return filter_input( INPUT_GET, $key );\n } else {\n return NULL;\n }\n }", "function _postn($v) {\r\n $r = isset($_POST[$v]) ? bwm_clean($_POST[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "function get_param($name) {\n \n if (isset($_REQUEST[$name])) return $_REQUEST[$name];\n else return \"\";\n}", "function GET($key)\n {\n if (isset($_GET[$key]))\n $value = $_GET[$key];\n elseif (isset($GLOBALS['HTTP_GET_VARS'][$key]))\n $value = $GLOBALS['HTTP_GET_VARS'][$key];\n elseif (isset($_POST[$key]))\n $value = $_POST[$key];\n elseif (isset($GLOBALS['HTTP_POST_VARS'][$key]))\n $value = $GLOBALS['HTTP_POST_VARS'][$key];\n else\n return \"\";\n if (get_magic_quotes_gpc())\n return stripslashes($value);\n return $value;\n }", "private static function getValue($name)\n\t{\n\t\treturn $_POST[$name] ?? null;\n\t}", "function get_form_field_value($field, $default_value = null) {\n if (!empty($_REQUEST[$field])) {\n return $_REQUEST[$field];\n } else {\n return $default_value;\n }\n}", "function request($key){\n if (array_key_exists($key, $_REQUEST)){\n return $_REQUEST[$key];\n }\n return null;\n}", "private function setSQLcondition($input) {\n\t\tif (is_int($input)) {\n\t\t\t$this->setIntCondition($input);\n\t\t\treturn;\n \t\t} else if (!is_array($input)) {\n \t\t\tthrow new tx_newspaper_IllegalUsageException(\n\t\t\t\t'Argument to generate a page type must be either an integer UID or the _GET array.\n\t\t\t\t In fact it is:\n\t\t\t\t' . print_r($input, 1)\n\t\t\t);\n \t\t}\n \t\t\n\t\t$this->setConditionFromGET($input);\n\t}", "public static function post($variable='*'){\n \n self::load();\n \n if($variable!='*'){\n return self::$request->request->get($variable); \n }\n else{\n return self::$request->request->all();\n }\n }", "function getparam($name) {\n if (isset($_POST[$name])) {\n return $_POST[$name];\n } else {\n return \"\";\n }\n}", "static function get($key) {\n if(!isset($_REQUEST[$key])) return null;\n else return $_REQUEST[$key];\n }", "public function parse_query_vars()\n {\n }", "private function getRequestUserName() {\n\t\t//RETURN REQUEST VARIABLE: USERNAME\n if(!empty($_POST[self::$userName])){\n\t\t\treturn $_POST[self::$userName];\n\t\t}\n else{\n return \"\";\n }\n\t}", "public function getRequestData();", "function post($name, $default = false, $filter = false){\n if (isset($_POST[$name])) {\n if ($filter) {\n switch ($filter) {\n case 'int':\n return is_numeric($_POST[$name]) ? $_POST[$name] : $default;\n break;\n }\n } else {\n return $_POST[$name];\n }\n } else {\n return $default;\n }\n}", "function sede_origen()\n{\n echo \"<input type='hidden' name='sede_origen' value='{$_REQUEST['sede_origen']}'>\";\n}", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n }\n\n disconnectFromDB();\n }\n }", "function GetDropDownValue(&$sv, $parm) {\n\t\tif (ewrpt_IsHttpPost())\n\t\t\treturn FALSE; // Skip post back\n\t\tif (isset($_GET[\"sv_$parm\"])) {\n\t\t\t$sv = ewrpt_StripSlashes($_GET[\"sv_$parm\"]);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function GetDropDownValue(&$sv, $parm) {\n\t\tif (ewrpt_IsHttpPost())\n\t\t\treturn FALSE; // Skip post back\n\t\tif (isset($_GET[\"sv_$parm\"])) {\n\t\t\t$sv = ewrpt_StripSlashes($_GET[\"sv_$parm\"]);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "function post_string($string_name) {\n\t$string = $_POST[$string_name];\n\tsettype($string, \"string\");\n\treturn $string;\n}", "function safetycheck( $vars, $responsetype )\n{\n//08.26.2015 ghh - first we figure out if we're dealing with get or\n//post because we can work directly with get but need to convert post\n//from json object\nif ( $responsetype == 'get' )\n\t{\n\tforeach ( $vars as $v )\n\t\t$temp[] = addslashes( $v );\n\t\n\treturn $temp;\n\t}\nelse\n\t{\n\treturn $vars;\n\t}\n}", "protected function mapRequest() {\n foreach($_REQUEST as $key => $value) {\n $this->data[$key] = $value;\n }\n }", "function get_param($param_name)\n{\n if($_POST[$param_name])\n\t\treturn $_POST[$param_name];\n\telse\n\t\treturn $_GET[$param_name];\n}", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "function getUserFromForm()\n {\n $string= \"default\";\n\n if (isset($_POST['Parametro']))\n $string=$_POST['Parametro'];\n\n return $string;\n }", "public function getSubmittedValue();", "public function getSubmittedValue();", "function validateInput($val, $type) {\n if ($type === 'post') {\n $validInput = mysqli_real_escape_string($GLOBALS['con'], trim($_POST[$val]));\n } else {\n $validInput = mysqli_real_escape_string($GLOBALS['con'], trim($_GET[$val]));\n }\n if (empty($validInput)) {\n return false;\n } else {\n return $validInput;\n }\n }", "function GetPost ($var, $default='') {\n\treturn GetRequest($_POST, $var, $default);\n\t/*\n\tif (isset($_POST[$var]))\n\t\t$val = $_POST[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "public static function prepare_value($value, $request, $args)\n {\n }", "function getPost($key) {\n\t$value = '';\n\tif (isset($_POST[$key])) {\n\t\t$value = $_POST[$key];\n\t}\n\t// return $value;\n\t//Phan 2: Ham xu ly ky tu dac biet\n\treturn removeSpecialCharacter($value);\n}", "function postValue($name, $defaultValue = NULL) {\r\n\r\n $value = $defaultValue;\r\n if (isset($_POST[$name])) {\r\n $value = $_POST[$name];\r\n }\r\n\r\n return $value;\r\n\r\n }", "function getPostData($str){\n $data = $_POST[$str] ?? '';\n return htmlentities($data);\n}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "function is_post_request()\n{\n return $_SERVER['REQUEST_METHOD'] == 'POST';\n}", "static function get_http_post_val($post_variable) {\n if (isset($_POST[$post_variable])) {\n return $_POST[$post_variable];\n } else {\n return '';\n }\n }", "function postInput($string)\n\t{\n\t\treturn inset($_post[$string]) ? $_post[$string] : '';\n\t}", "public function save_param()\n\t{\n\t\t$post = \\lib\\utility::post();\n\t\t$get = \\lib\\utility::get(null, 'raw');\n\n\t\t$param = [];\n\n\t\tif(is_array($post) && is_array($get))\n\t\t{\n\t\t\t$param = array_merge($get, $post);\n\t\t}\n\n\t\tif(!is_array($param))\n\t\t{\n\t\t\t$param = [];\n\t\t}\n\n\t\t$save_param = [];\n\n\t\tforeach ($param as $key => $value)\n\t\t{\n\t\t\tif(preg_match(\"/^param(\\-|\\_)(.*)$/\", $key, $split))\n\t\t\t{\n\t\t\t\tif(isset($split[2]))\n\t\t\t\t{\n\t\t\t\t\t$save_param[$split[2]] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($save_param))\n\t\t{\n\t\t\t$_SESSION['param'] = $save_param;\n\t\t}\n\t}", "static function getInput($name, $value = false, $allow_get = true) {\n if (isset($_POST[$name])) {\n $output = $_POST[$name];\n if (!is_array($output)) {\n $output = htmlspecialchars($output);\n }\n return $output;\n }\n if ($allow_get) {\n if (isset($_GET[$name])) {\n $output = $_GET[$name];\n if (!is_array($output)) {\n $output = Dbase::con()->real_escape_string($output);\n $output = htmlspecialchars($output);\n }\n return $output;\n }\n }\n return $value;\n }", "private function getUserInput()\n {\n // BotDetect built-in Ajax Captcha validation\n $input = $this->getUrlParameter('i');\n\n if (is_null($input)) {\n // jQuery validation support, the input key may be just about anything,\n // so we have to loop through fields and take the first unrecognized one\n $recognized = array('get', 'c', 't', 'd');\n foreach ($_GET as $key => $value) {\n if (!in_array($key, $recognized)) {\n $input = $value;\n break;\n }\n }\n }\n\n return $input;\n }", "function _post($v) { // clean Post - returns a useable $_POST variable or NULL if and only if it is not set\r\n return isset($_POST[$v]) ? bwm_clean($_POST[$v]) : NULL;\r\n}", "function processPostVars()\n {\n $this->id = $_POST['id'];\n $this->login = trimStrip($_POST['login']);\n $this->surname = trimStrip($_POST['surname']);\n $this->firstname = trimStrip($_POST['firstname']);\n $this->hash = trimStrip($_POST['hash']);\n $this->yearno = (integer)trimStrip($_POST['yearno']);\n $this->groupno = (integer)trimStrip($_POST['groupno']);\n $this->email = trimStrip($_POST['email']);\n $this->calendaryear = intval($_POST['calendaryear']);\n $this->coeff = (float)$_POST['coeff'];\n }", "function getPost( $name ) #version 1\n{\n if ( isset($_POST[$name]) ) \n {\n return htmlspecialchars($_POST[$name]);\n }\n return \"\";\n}", "function either_param_string($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, $default);\n if ($ret === null) {\n return null;\n }\n\n if ($ret === $default) {\n if ($default === null) {\n return null;\n }\n\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret, true);\n\n return $ret;\n}", "public function get_query_arg( $name ) {\n\t\tglobal $taxnow, $typenow;\n\t\t$value = '';\n\t\t$url_args = wp_parse_args( wp_parse_url( wp_get_referer(), PHP_URL_QUERY ) );\n\t\t// Get the value of an arbitrary post argument.\n\t\t// @todo We are suppressing the need for a nonce check, which means this whole thing likely needs a rewrite.\n\t\t$post_arg_val = ! empty( $_POST[ $name ] ) ? sanitize_text_field( wp_unslash( $_POST[ $name ] ) ) : null; // @codingStandardsIgnoreLine\n\n\t\tswitch ( true ) {\n\t\t\tcase ( ! empty( get_query_var( $name ) ) ):\n\t\t\t\t$value = get_query_var( $name );\n\t\t\t\tbreak;\n\t\t\t// If the query arg isn't set. Check POST and GET requests.\n\t\t\tcase ( ! empty( $post_arg_val ) ):\n\t\t\t\t// Verify nonce here.\n\t\t\t\t$value = $post_arg_val;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $_GET[ $name ] ) ):\n\t\t\t\t$value = sanitize_text_field( wp_unslash( $_GET[ $name ] ) );\n\t\t\t\tbreak;\n\t\t\tcase ( 'post_type' === $name && ! empty( $typenow ) ):\n\t\t\t\t$value = $typenow;\n\t\t\t\tbreak;\n\t\t\tcase ( 'taxonomy' === $name && ! empty( $taxnow ) ):\n\t\t\t\t$value = $taxnow;\n\t\t\t\tbreak;\n\t\t\tcase ( ! empty( $url_args[ $name ] ) ):\n\t\t\t\t$value = $url_args[ $name ];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}", "function getDataFromRequest( &$data ) {\n\n\t\t$requestVar = KRequest::getInt($this->propertyName, NULL);\n\n\t\tif (empty($requestVar)) {\n\t\t\t$data->{$this->propertyName} = NULL;\n\t\t}\n\t\telse {\n\t\t\t$data->{$this->propertyName} = $requestVar;\n\t\t}\n\n\t}", "function fix_request(){\n\t$var=array();\n\tforeach($_GET as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_GET[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\tforeach($_POST as $k=>$v){\n//\t\tif(!is_array($v)){\n//\t\t\tforeach($filtros as $filtro){\n//\t\t\t\t$v=str_replace(trim($filtro),'',$v);\n//\t\t\t}\n//\t\t\t$_POST[$k]=$v;\n\t\t\t$var[$k]=$v;\n//\t\t}\n\t}\n\t$_REQUEST=$var;\n}", "protected function parseRequestInput()\n {\n $requestInput = null;\n\n if (in_array($this->getMethod(), [self::METHOD_DELETE, self::METHOD_PUT, self::METHOD_POST], true))\n {\n if (empty($_REQUEST) && isset($_SERVER['CONTENT_TYPE'], $_SERVER['CONTENT_LENGTH']) && (int)$_SERVER['CONTENT_LENGTH'])\n {\n $input = file_get_contents('php://input');\n\n switch ($_SERVER['CONTENT_TYPE'])\n {\n case 'application/json':\n {\n $requestInput = json_decode($input, true, 512, JSON_THROW_ON_ERROR);\n break;\n }\n case 'multipart/form-data':\n case 'application/x-www-form-urlencoded':\n {\n parse_str($input, $requestInput);\n break;\n }\n default: $requestInput = $input;\n }\n }\n }\n return $requestInput;\n }", "function _getn($v) {\r\n $r = isset($_GET[$v]) ? bwm_clean($_GET[$v]) : '';\r\n return $r == '' ? NULL : $r;\r\n}", "function set_query_var($query_var, $value)\n {\n }", "function post($input=''){\n $input = htmlspecialchars($_POST[$input]);\n $input = addslashes($input);\n return $input;\n }", "public static function getPostValue($name)\n {\n if (isset($_GET[$name])) return $_GET[$name];\n else if(isset($_POST[$name])) return $_POST[$name];\n else return '';\n }", "function post($param, $default = null) {\n static $rawPost;\n if (!empty($_POST[$param]))\n return is_array($_POST[$param]) ? $_POST[$param] : trim($_POST[$param]);\n if (!$rawPost) parse_str(file_get_contents('php://input'), $rawPost);\n if (!empty($rawPost[$param])) {\n return $rawPost[$param];\n }\n return $default;\n}", "function req($key) {\r\n\treturn val(Request::$data, $key);\r\n}" ]
[ "0.62607914", "0.6141487", "0.5925994", "0.59006715", "0.58506", "0.5821578", "0.5811759", "0.5756871", "0.57425547", "0.5740756", "0.57388294", "0.5688158", "0.5685656", "0.56782216", "0.5655908", "0.5631245", "0.5623955", "0.5621073", "0.5616557", "0.5591623", "0.5589732", "0.5584999", "0.5584642", "0.5574862", "0.55525386", "0.5543206", "0.55262977", "0.5525666", "0.5507961", "0.55064726", "0.54950017", "0.54878604", "0.5483026", "0.54808545", "0.54796624", "0.5460938", "0.5460906", "0.5450075", "0.5430339", "0.5426974", "0.5419908", "0.54179394", "0.54177886", "0.5416442", "0.54039276", "0.53911567", "0.538942", "0.53800154", "0.53778434", "0.53578967", "0.5355992", "0.5355688", "0.5336411", "0.5335729", "0.5327678", "0.53225946", "0.53214353", "0.53123975", "0.5296314", "0.5286107", "0.5274659", "0.5274325", "0.5274325", "0.5270374", "0.526517", "0.52640736", "0.526229", "0.5260963", "0.5257203", "0.52507687", "0.52428925", "0.52347517", "0.52347517", "0.522965", "0.52292436", "0.52253073", "0.5219856", "0.5204924", "0.52048105", "0.51973844", "0.5189882", "0.5176309", "0.51748234", "0.51726913", "0.515993", "0.5157573", "0.51540273", "0.5151102", "0.51483387", "0.51393884", "0.51377463", "0.5137212", "0.51317626", "0.5123703", "0.51178217", "0.5115911", "0.5114607", "0.51058495", "0.5103681", "0.5100086" ]
0.5383954
47
Prevents SQL injection from any ARRAY, at the same time serialize the var into save_name. This uses check_single_incomming_var() on each array item. Is recursive.
function check_all_incomming_vars($request_array, $save_name = null) { //checks all the incomming vars // V0.8 forces the use of an non empty array // if (empty($request_array)) { // $request_array = $_REQUEST; // } else { if (!is_array($request_array)) { die(__FUNCTION__ . " need an array to work"); } // } $form = array(); foreach ($request_array as $index => $value) { if (!is_array($value)) { $form[$index] = \k1lib\forms\check_single_incomming_var($value); } else { $form[$index] = check_all_incomming_vars($value); } } if (!empty($save_name)) { \k1lib\common\serialize_var($form, $save_name); } return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitizeArray(&$array)\n{\n $excludeListForSanitization = array('query');\n// $excludeListForSanitization = array();\n\n foreach ($array as $k => $v) {\n\n // split to key and value\n list($key, $val) = preg_split(\"/=/\", $v, 2);\n if (!isset($val)) {\n continue;\n }\n\n // when magic quotes is on, need to use stripslashes,\n // and then addslashes\n if (PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n // note that we must use addslashes here because this function is called before the db connection is made\n // and sql_real_escape_string needs a db connection\n $val = addslashes($val);\n\n // if $key is included in exclude list, skip this param\n if (!in_array($key, $excludeListForSanitization)) {\n\n // check value\n if (strpos($val, '\\\\')) {\n list($val, $tmp) = explode('\\\\', $val);\n }\n\n // remove control code etc.\n $val = strtr($val, \"\\0\\r\\n<>'\\\"\", \" \");\n\n // check key\n if (preg_match('/\\\"/i', $key)) {\n unset($array[$k]);\n continue;\n }\n\n // set sanitized info\n $array[$k] = sprintf(\"%s=%s\", $key, $val);\n }\n }\n}", "public function safeit (&$var)\r\n\t{\r\n\t\t// check connect\r\n\t\tif (! $this->connection) $this->connect();\r\n\t\t\r\n\t\tif (is_array($var)) {\r\n\t\t\tforeach ($var as $key => $value) $this->safeit ($var[$key]);\r\n\t\t\treturn $var;\r\n\t\t}\r\n\t\t\r\n\t\t$var = mysqli_real_escape_string ($this->connection, $var);\t\t\r\n\t}", "function sanitize($input) {\n if (is_array($input)) {\n foreach($input as $var=>$val) {\n $output[$var] = sanitize($val);\n }\n }else{\n if (get_magic_quotes_gpc()) {\n $input = stripslashes($input);\n }\n $input = cleanInput($input);\n $output = mysql_real_escape_string($input);\n }\n return $output;\n}", "function qwe_clean($array){\r\n\r\n\t\t\t\t\t\t\t\t\t\treturn array_map('mysql_real_escape_string', $array) ;\r\n\t\t\t\t\t\t\t\t\t}", "function escape_array($array) {\n global $our_db;\n\n $new_array = array();\n foreach ($array as $item) {\n $new_array[] = $our_db->real_escape_string($item);\n }\n return $new_array;\n}", "function array_sanitize (&$item) {\n\t\tif (is_string ($item)) {\n\t\t\t$item = htmlentities (mysqli_real_escape_string ($GLOBALS['con'], $item),ENT_NOQUOTES,\"utf-8\");\n\t\t}\n\t}", "private function sanitizeInput(array $inputArray){\n $counter = 0;\n $filteredInput = [];\n foreach ($inputArray as $key => $value) {\n $filteredInput[$key] = mysqli_real_escape_string($this->db, $value);\n }\n return $filteredInput;\n }", "function clean($array){\n\n\t\treturn array_map('mysql_real_escape_string', $array);\n\n\t}", "function sanitizeAny($input = '')\r\n{\r\n if (!is_array($input) || !count($input)) {\r\n return sanitizeValue($input);\r\n } else {\r\n return sanitizeArray($input);\r\n }\r\n}", "function sanitize_arr_string_xss(array $data): array\n{\n foreach ($data as $k => $v) {\n $data[$k] = filter_var($v, FILTER_SANITIZE_STRING);\n }\n return $data;\n}", "function twe_db_prepare_input($string) {\n if (is_string($string)) {\n return trim(stripslashes($string));\n } elseif (is_array($string)) {\n reset($string);\n while (list($key, $value) = each($string)) {\n $string[$key] = twe_db_prepare_input($value);\n }\n return $string;\n } else {\n return $string;\n }\n }", "function cleanseInput(&$data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as &$subItem)\r\n {\r\n $subItem = cleanseInput($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n $data = trim($data, \"';#\");\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n }\r\n \r\n return $data;\r\n}", "public function sanitize(){\r\n\t\t$post = array();\r\n\t\tforeach($_POST as $key => $val){\r\n\t\t\tif(!get_magic_quotes_gpc()){\r\n\t\t\t\t$post[$key] = mysql_real_escape_string($val);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $post;\r\n\t}", "function sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function clean_input($input){\n\n\t$clean;\t//clean version of variable\n\n\tif (is_string($input)){\n\t\t$clean = mysql_real_escape_string(stripslashes(ltrim(rtrim($input))));\n\t}\n\telse if (is_numeric($input)){\n\t\t$clean = mysql_real_escape_string(stripslashes(ltrim(rtrim($input))));\n\t}\n\telse if (is_bool($input)){\n\t\t$clean = ($input) ? true : false;\n\t}\n\telse if (is_array($input)){\n\t\tforeach ($input as $k=>$i){\n\t\t\t$clean[$k] = clean_input($i);\n\t\t}\n\t}\n\t\n\treturn $clean;\n\t\n}", "function addSlashesToArray($thearray){\r\n\r\n\tif(get_magic_quotes_runtime() || get_magic_quotes_gpc()){\r\n\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string(stripslashes($value));\r\n\r\n\t} else\r\n\t\tforeach ($thearray as $key=>$value)\r\n\t\t\tif(is_array($value))\r\n\t\t\t\t$thearray[$key]= addSlashesToArray($value);\r\n\t\t\telse\r\n\t\t\t\t$thearray[$key] = mysql_real_escape_string($value);\r\n\r\n\treturn $thearray;\r\n\r\n}", "function preventSQLInjection($code, $mysqli, $array,$getId=false){\n $stmt = $mysqli->prepare($code); \n $types = str_repeat('s', count($array)); \n $stmt->bind_param($types, ...$array); \n $stmt->execute();\n if($getId==true)\n return $mysqli->insert_id;\n}", "protected function clean_saved_value() {\n\t\tif ( $this->saved_value !== '' ) {\n\t\t\tif ( ! is_array( $this->saved_value ) && ! is_object( $this->saved_value ) ) {\n\t\t\t\tFrmAppHelper::unserialize_or_decode( $this->saved_value );\n\t\t\t}\n\n\t\t\tif ( is_array( $this->saved_value ) && empty( $this->saved_value ) ) {\n\t\t\t\t$this->saved_value = '';\n\t\t\t}\n\t\t}\n\t}", "function sanitize($input) {\n if (is_array($input)) {\n foreach($input as $var=>$val) {\n $output[$var] = sanitize($val);\n }\n }\n else {\n $input = trim($input);\n if (get_magic_quotes_gpc()) {\n $input = stripslashes($input);\n }\n $output = strip_tags($input);\n }\n return $output;\n}", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "private function preventSQLInjection($string) {\n foreach ($string as $key => $value) {\n //Escapes special characters in a string for use in an SQL statement\n $value = mysql_real_escape_string($value);\n }\n return $string;\n }", "public static function sanitize($data){\n\t\t\t$db = new Database;\n\t\t\tif (gettype($data) === 'array') {\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\t$data = trim($data);\t\t\t\t\n\t\t\t\t$data = stripcslashes($data);\n\t\t\t\t$data = mysqli_real_escape_string($db->link, $data);\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t}", "function array_sanitize(&$item){\n $item = htmlentities(strip_tags(mysql_real_escape_string($item)));\n }", "function setGoodArrayAndGoodMysql ($array){\n $connect = $GLOBALS['connect'];\n $kode = $GLOBALS['kode'];\n $array = array_values ($array);\n $array = array_values ($array[0]);\n \n foreach ($array as $val)\n $data[] = mysqli_real_escape_string ( $connect , htmlspecialchars ( htmlentities ( strip_tags (trim ( $val ) ) ) ) );\n \n array_push ($data,$kode);\n return $data;\n}", "function unfck($v) {\n return is_array($v) ? array_map('unfck', $v) : addslashes($v);\n}", "function safeSQL($source, &$connection) {\n\t\t// clean all elements in this array\n\t\tif (is_array($source)) {\n\t\t\tforeach($source as $key => $value)\n\t\t\t\t// filter element for SQL injection\n\t\t\t\tif (is_string($value)) $source[$key] = $this->quoteSmart($this->decode($value), $connection);\n\t\t\treturn $source;\n\t\t// clean this string\n\t\t} else if (is_string($source)) {\n\t\t\t// filter source for SQL injection\n\t\t\tif (is_string($source)) return $this->quoteSmart($this->decode($source), $connection);\n\t\t// return parameter as given\n\t\t} else return $source;\t\n\t}", "function sanitize($input) {\n\t\t$cleaning = $input;\n\t\t\n\t\tswitch ($cleaning) {\n\t\t\tcase trim($cleaning) == \"\":\n\t\t\t\t$clean = false;\n\t\t\t\tbreak;\n\t\t\tcase is_array($cleaning):\n\t\t\t\tforeach($cleaning as $key => $value) {\n\t\t\t\t\t$cleaning[] = sanitize($value);\n\t\t\t\t}\n\t\t\t\t$clean = implode(\",\", $cleaning);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(get_magic_quotes_gpc()) {\n\t\t\t\t\t$cleaning = stripslashes($cleaning);\n\t\t\t\t}\n\t\t\t\t$cleaning = strip_tags($cleaning);\n\t\t\t\t$clean = trim($cleaning);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $clean;\n\t}", "static function clean_input($dirty)\n\t{\n\t\t//$input = get_magic_quotes_gpc() ? $dirty : addslashes($dirty);\n\n\t\tif( !is_array($dirty) )\n\t\t{\n\t\t\t$dirty = strtr( $dirty, array('<script>'=>'', '</script>'=>'') );\n\t\t\t$dirty = trim( strip_tags( htmlspecialchars($dirty, ENT_QUOTES), '' ) );\n\t\t}else if( is_array($dirty) )\n\t\t{\n\t\t\tforeach($dirty as $k=>$v)\n\t\t\t{\n\t\t\t\tif( is_array($v) )\n\t\t\t\t{\n\t\t\t\t\tforeach($v as $k2=>$v2)\n\t\t\t\t\t{\n\t\t\t\t\t\tif( is_array($v2) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($v2 as $k3=>$v3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v3 = strtr( $v3, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t\t\t\t$dirty[ $k ][ $k2 ][ $k3 ] = trim( strip_tags( htmlspecialchars($v3, ENT_QUOTES), '' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$v2 = strtr( $v2, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t\t\t$dirty[ $k ][ $k2 ] = trim( strip_tags( htmlspecialchars($v2, ENT_QUOTES), '' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$v = strtr( $v, array('<script>'=>'', '</script>'=>'') );\n\t\t\t\t\t$dirty[ $k ] = trim( strip_tags( htmlspecialchars($v, ENT_QUOTES), '' ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn $dirty;\n\t}", "function sanitizeArray( $arr ) {\n if (is_array($arr)) {\n foreach($arr as $key => &$data) {\n if (is_array($data)) {\n $data = sanitizeArray($data);\n } else {\n try {\n $json = json_decode( $data , true);\n if (is_array($json)) {\n $data = sanitizeArray( $json );\n continue;\n }\n } catch(Exception $e) {\n $data = sanitize($data);\n }\n }\n }\n }\n return $arr;\n}", "public function safe_array()\n\t{\n\t\t// Load choices\n\t\t$choices = func_get_args();\n\t\t$choices = empty($choices) ? NULL : array_combine($choices, $choices);\n\n\t\t// Get field names\n\t\t$fields = $this->field_names();\n\n\t\t$safe = array();\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\tif ($choices === NULL OR isset($choices[$field]))\n\t\t\t{\n\t\t\t\tif (isset($this[$field]))\n\t\t\t\t{\n\t\t\t\t\t$value = $this[$field];\n\n\t\t\t\t\tif (is_object($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Convert the value back into an array\n\t\t\t\t\t\t$value = $value->getArrayCopy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Even if the field is not in this array, it must be set\n\t\t\t\t\t$value = NULL;\n\t\t\t\t}\n\n\t\t\t\t// Add the field to the array\n\t\t\t\t$safe[$field] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $safe;\n\t}", "private function mysqlRealEscapeArray(array $input) {\r\n\t\t$output = array();\r\n\t\tforeach($input as $name => $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\t$output[mysql_real_escape_string($name)] = $this->mysqlRealEscapeArray($value);\r\n\t\t\t} else {\r\n\t\t\t\t$output[mysql_real_escape_string($name)] = mysql_real_escape_string($value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "function escape($data){\n\t\tif(is_array($data)){\n\t\t\tforeach((array) $data as $k => $v){\n\t\t\t\tif (is_array($v))\n\t\t\t\t\t$data[$k] = $this->escape($v);\n\t\t\t\telse\n\t\t\t\t\t$data[$k] = mysql_escape_string($v);\n\t\t\t}\n\t\t} else {\n\t\t\t$data = mysql_escape_string($data);\n\t\t}\n\n\t\treturn $data;\n\t}", "public function sanitize_save($input)\r\n {\r\n $new_input = array();\r\n if (isset($input['id_number'])) {\r\n $new_input['id_number'] = absint($input['id_number']);\r\n }\r\n\r\n if (isset($input['title'])) {\r\n $new_input['title'] = sanitize_text_field($input['title']);\r\n }\r\n\r\n if (isset($input['theme_field_slug'])) {\r\n $new_input['theme_field_slug'] = sanitize_text_field($input['theme_field_slug']);\r\n }\r\n\r\n return $new_input;\r\n }", "function db_array_to_insert_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' )$arr = toutf( $arr );\n\t$keys = array();\n\t$values = array();\n\tforeach ( $arr as $k => $v ) {\n\t\t$k = ( $k );\n\t\t$v = ( $v );\n\t\t$keys[] = '`' . $k . '`';\n is_array( $v ) || is_object( $v ) and $v=tojson($v);\n\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t$values[] = $v;\n\t}\n\t$keystr = implode( ',', $keys );\n\t$valstr = implode( ',', $values );\n\t$sqladd = \"($keystr) VALUES ($valstr)\";\n\treturn $sqladd;\n}", "public function array_sanitize($array){\n\n\t\t\treturn htmlentities(mysql_real_escape_string($array));\n\n\t\t}", "function safe($fieldname)\n{\n global $db;\n $temp=$_GET[$fieldname];\n $temp=trim($temp);\n $temp=mysqli_real_escape_string($db,$temp);\n echo \"<br>$fieldname is: $temp<br>\";\n \n}", "function cleanSerial($var=array(), $recurs=FALSE) {\r\n\tif ($recurs) {\r\n\t\tforeach ((array)$var as $k=>$v) {\r\n\t\t\tif (is_array($v)) $var[$k] = cleanSerial($v, 1);\r\n\t\t\telse $var[$k] = base64_encode($v);\r\n\t\t}\r\n\t\treturn $var;\r\n\t}\r\n\telse return serialize(cleanSerial($var, 1));\r\n}", "public static function sanitize_array ($data = array()) {\r\n\t\tif (!is_array($data) || !count($data)) {\r\n\t\t\treturn array();\r\n\t\t}\r\n\t\tforeach ($data as $k => $v) {\r\n\t\t\tif (!is_array($v) && !is_object($v)) {\r\n\t\t\t\t$data[$k] = sanitize_text_field($v);//htmlspecialchars(trim($v));\r\n\t\t\t}\r\n\t\t\tif (is_array($v)) {\r\n\t\t\t\t$data[$k] = self::sanitize_array($v);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function sanitizeArray($data = array())\r\n{\r\n foreach ($data as $k => $v) {\r\n if (!is_array($v) && !is_object($v)) { // deep enough to only be values? sanitize them now.\r\n $data[$k] = sanitizeValue($v);\r\n }\r\n if (is_array($v)) { // go deeper\r\n $data[$k] = sanitizeArray($v);\r\n }\r\n }\r\n return $data;\r\n}", "function antiinjection($data){\n\t$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));\n \treturn $filter_sql;\n}", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\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}", "function sanitize($dataArray)\n\t{\n\t\t$this->data[\"username\"] = filter_var($dataArray[\"username\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"password\"] = filter_var($dataArray[\"password\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"description\"] = filter_var($dataArray[\"description\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"quote\"] = filter_var($dataArray[\"quote\"], FILTER_SANITIZE_STRING);\n\t\t\n\t\t/* if(isset($this->data[\"user_level\"]))\n\t\t{\n\t\t\t$this->data[\"user_level\"] = filter_var($dataArray[\"user_level\"], FILTER_SANITIZE_STRING);\n\t\t} */\n\t\treturn $dataArray;\n\t}", "public static function mongo_sanitize(&$data) {\n foreach ($data as $key => $item) {\n is_array($item) && !empty($item) && $data[$key] = self::mongo_sanitize($item);\n if (is_array($data) && preg_match('/^\\$/', $key)) {\n unset($data[$key]);\n }\n }\n return $data;\n }", "public function sanitize($param)\n {\n $data = [];\n if(is_string($param) || is_numeric($param) )\n {\n return $aparam = $this->db->real_escape_string(trim($param));\n }\n elseif(is_array($param))\n {\n foreach ($param as $key => $value) \n {\n $data[$key] = $this->db->real_escape_string(trim($value));\n }\n return $data;\n } \n else \n {\n return $param;\n }\n }", "function widgetopts_sanitize_array( &$array ) {\n foreach ($array as &$value) {\n if( !is_array($value) ) {\n\t\t\t// sanitize if value is not an array\n $value = sanitize_text_field( $value );\n\t\t}else{\n\t\t\t// go inside this function again\n widgetopts_sanitize_array($value);\n\t\t}\n }\n\n return $array;\n}", "function db_insert($table, $data = array()){\n global $conn;\n $field = \"\";\n $value = \"\";\n foreach($data as $key => $var){\n $field .= $key.',';\n $value .= \"'\". mysqli_escape_string($conn, $var).\"'\".\",\";\n }\n $sql = 'INSERT INTO `'.$table.'` ('.trim($field,',').') VALUES('. trim($value, ',').')';\n return mysqli_query($conn, $sql);\n}", "function danger_var($variable)\n{\n\tif (get_magic_quotes_gpc())\n\t{\n\t\treturn $variable;\n\t}\n\n // array\n\tif (is_array($variable))\n\t{\n\t\tforeach($variable as $var)\n\t\t{\n\t\t\t$var = addslashes($var);\n\t\t}\n\t}\n\n\t// variable\n\telse\n\t{\n\t\t$variable = addslashes($variable);\n\t}\n\n\treturn $variable;\n}", "function strip_magic_quotes($data) {\n foreach($data as $k=>$v) {\n $data[$k] = is_array($v) ? strip_magic_quotes($v) : stripslashes($v);\n }\n return $data;\n}", "private function cleanInputs($data){\n\t\t$clean_input = array();\n\t\tif(is_array($data)){\n\t\t\tforeach($data as $k => $v){\n\t\t\t\t$clean_input[$k] = $this->cleanInputs($v);\n\t\t\t}\n\t\t}else{\n\t\t\tif(get_magic_quotes_gpc()){ \n\t\t\t// Returns 0 if magic_quotes_gpc is off, \n\t\t\t// 1 otherwise. Always returns FALSE as of PHP 5.4\n\t\t\t\t$data = trim(stripslashes($data));\n\t\t\t}\n\t\t\t$data = strip_tags($data);\n\t\t\t$clean_input = trim($data);\n\t\t}\n\t\treturn $clean_input;\n\t}", "function add_magic_quotes($input_array)\n {\n }", "function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}", "function val_input($data){\n $data = trim($data);\n $data = str_replace(\"'\", \"\", $data);\n $data = str_replace(\"select\", \"\", $data);\n $data = str_replace(\"SELECT\", \"\", $data);\n $data = str_replace(\"Select\", \"\", $data);\n $data = str_replace(\"drop\", \"\", $data);\n $data = str_replace(\"Drop\", \"\", $data);\n $data = str_replace(\"DROP\", \"\", $data);\n $data = str_replace(\"delete\", \"\", $data);\n $data = str_replace(\"DELETE\", \"\", $data);\n $data = str_replace(\"Delete\", \"\", $data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function _cleanData( $str, $dbc = '' )\r\n\t\t{\r\n\t\t\tif( !empty( $dbc ) ) \r\n\t\t\t{\r\n\t\t\t\tglobal $dbc;\r\n\t\t\t\treturn is_array($str) ? array_map('_cleanData', $str) : str_replace('\\\\', '\\\\\\\\', strip_tags(trim(htmlspecialchars((get_magic_quotes_gpc() ? stripslashes(mysqli_real_escape_string($str)) : $str), ENT_QUOTES))));\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn is_array($str) ? array_map('_cleanData', $str) : str_replace('\\\\', '\\\\\\\\', strip_tags(trim(htmlspecialchars((get_magic_quotes_gpc() ? stripslashes($str) : $str), ENT_QUOTES))));\r\n\t\t\t\t\r\n\t\t}", "private function SecureData($data, $types){\n\t\tif(is_array($data)){\n\t\t\t$i = 0;\n\t\t\tforeach($data as $key=>$val){\n\t\t\t\tif(!is_array($data[$key])){\n\t\t\t\t\t$this->CleanData($data[$key], $types[$i]);\n\t\t\t\t\t$data[$key] = mysqli_real_escape_string( $this->databaseLink,$data[$key]);\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$this->CleanData($data, $types);\n\t\t\t$data = mysqli_real_escape_string($this->databaseLink,$data);\n\t\t}\n\t\treturn $data;\n\t}", "private function sanitizeInput(array &$input)\n {\n foreach ($input as $key => &$value) {\n if (is_array($value)) {\n $value = $this->sanitizeInput($value);\n } elseif ($value === null) {\n $value = '';\n } else {\n $value = str_replace('<script>', '&lt;script&gt;', $value);\n }\n }\n\n return $input;\n }", "function sanitizeArray( &$data, $whatToKeep )\n{\n $data = array_intersect_key( $data, $whatToKeep ); \n \n foreach ($data as $key => $value) {\n\n $data[$key] = sanitizeOne( $data[$key] , $whatToKeep[$key] );\n\n }\n}", "protected function _sanitize_globals()\n {\n // Is $_GET data allowed? If not we'll set the $_GET to an empty array\n if ($this->_allow_get_array === FALSE)\n {\n $_GET = array();\n }\n elseif (is_array($_GET) && count($_GET) > 0)\n {\n foreach ($_GET as $key => $val)\n {\n $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_POST Data\n if (is_array($_POST) && count($_POST) > 0)\n {\n foreach ($_POST as $key => $val)\n {\n $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n // Clean $_COOKIE Data\n if (is_array($_COOKIE) && count($_COOKIE) > 0)\n {\n // Also get rid of specially treated cookies that might be set by a server\n // or silly application, that are of no use to a CI application anyway\n // but that when present will trip our 'Disallowed Key Characters' alarm\n // http://www.ietf.org/rfc/rfc2109.txt\n // note that the key names below are single quoted strings, and are not PHP variables\n unset(\n $_COOKIE['$Version'],\n $_COOKIE['$Path'],\n $_COOKIE['$Domain']\n );\n\n foreach ($_COOKIE as $key => $val)\n {\n if (($cookie_key = $this->_clean_input_keys($key)) !== FALSE)\n {\n $_COOKIE[$cookie_key] = $this->_clean_input_data($val);\n }\n else\n {\n unset($_COOKIE[$key]);\n }\n }\n }\n\n // Sanitize PHP_SELF\n $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);\n\n // CSRF Protection check\n if ($this->_enable_csrf === TRUE && ! is_cli())\n {\n $this->security->csrf_verify();\n }\n }", "private function prepareQueryArray($input){\n global $Core;\n if(empty($input) || !is_array($input)){\n throw new Exception ($Core->language->error_input_must_be_a_non_empty_array);\n }\n $allowedFields = $this->getTableFields();\n $temp = array();\n\n $parentFunction = debug_backtrace()[1]['function'];\n if((stristr($parentFunction,'add') || $parentFunction == 'insert')){\n $requiredBuffer = $this->requiredFields;\n }\n else{\n $requiredBuffer = array();\n if(stristr($parentFunction,'translate')){\n $allowedFields = $this->translationFields;\n }\n }\n\n foreach ($input as $k => $v){\n if($k === 'added' && !$this->allowFieldAdded){\n throw new Exception ($Core->language->field_added_is_not_allowed);\n }\n if($k === 'id'){\n throw new Exception ($Core->language->field_id_is_not_allowed);\n }\n\n if(!isset($allowedFields[$k]) && !in_array($k,$allowedFields)){\n throw new Exception (get_class($this).\": The field $k does not exist in table {$this->tableName}!\");\n }\n\n if(!is_array($v)){\n $v = trim($v);\n }\n\n if(!empty($v) || ((is_numeric($v) && intval($v) === 0))){\n if(!empty($requiredBuffer) && ($key = array_search($k, $requiredBuffer)) !== false) {\n unset($requiredBuffer[$key]);\n }\n $fieldType = $this->tableFields[$k]['type'];\n if(stristr($fieldType,'int') || stristr($fieldType,'double')){\n if(!is_numeric($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_numeric_value);\n }\n $temp[$k] = $v;\n }\n else if($fieldType == 'date'){\n $t = explode('-',$v);\n if(count($t) < 3 || !checkdate($t[1],$t[2],$t[0])){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_date_with_format);\n }\n $temp[$k] = $v;\n unset($t);\n }\n else{\n if(in_array($k,$this->explodeFields)){\n if(is_object($v)){\n $v = (array)$v;\n }\n else if(!is_array($v)){\n $v = array($v);\n }\n\n if($k == 'languages'){\n $tt = array();\n foreach($v as $lang){\n if(empty($lang)){\n throw new Exception ($Core->language->error_language_cannot_be_empty);\n }\n $langMap = $Core->language->getLanguageMap(false);\n\n if(!isset($langMap[$lang])){\n throw new Exception ($Core->language->error_undefined_or_inactive_language);\n }\n if(!is_numeric($lang)){\n $lang = $langMap[$lang]['id'];\n }\n $tt[] = $lang;\n }\n $v = '|'.implode('|',$tt).'|';\n }\n else{\n $tt = '';\n foreach($v as $t){\n if(!empty($t)){\n $tt .= str_replace($this->explodeDelimiter,'_',$t).$this->explodeDelimiter;\n }\n }\n $v = substr($tt,0,-1);\n unset($tt,$t);\n }\n }\n else if(is_array($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_alphanumeric_string);\n }\n\n $temp[$k] = $Core->db->real_escape_string($v);\n }\n }\n else{\n if(stristr($parentFunction,'update') && isset($this->requiredFields[$k])){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_not_be_empty);\n }\n else $temp[$k] = '';\n }\n }\n\n if(!empty($requiredBuffer)){\n $temp = array();\n foreach($requiredBuffer as $r){\n $r = str_ireplace('_id','',$r);\n $temp[] = $Core->language->$r;\n }\n\n throw new Exception($Core->language->error_required_fields_missing.\": \".implode(', ',$temp));\n }\n\n return $temp;\n }", "function mf_sanitize($input){\n\t\tif(get_magic_quotes_gpc() && !empty($input)){\n\t\t\t $input = is_array($input) ?\n\t array_map('mf_stripslashes_deep', $input) :\n\t stripslashes(trim($input));\n\t\t}\n\t\t\n\t\treturn $input;\n\t}", "function save_boxes($temp_boxes,$userid = \"\")\r\n{\r\n\t$boxes = array();\r\n\t$userid = $GLOBALS['userid'];\r\n\r\n\tfor($i = 0; $i < count($temp_boxes); $i++)\r\n\t{\r\n\t\t$boxes[$i] = array();\r\n\t\tforeach($temp_boxes[$i] as $boxid)\r\n\t\t\tarray_push($boxes[$i],$boxid);\r\n\t}\r\n\r\n\tmysql_query(\"UPDATE USER_LIST SET USER_FRONTPAGE = '\" . serialize($boxes) . \"' WHERE USER_ID='$userid'\");\r\n}", "function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map('cleanInputs', $value) : stripslashes($value);\r\n return $value;\r\n}", "function fix_POST_slashes() {\n\tglobal $fixed_POST_slashes;\n\tif (!$fixed_POST_slashes and get_magic_quotes_gpc()) {\n\t\t$fixed_POST_slashes = true;\n\t\tforeach ($_POST as $key => $val) {\n\t\t\tif (gettype($val) == \"array\") {\n\t\t\t\tforeach ($val as $i => $j) {\n\t\t\t\t\t$val[$i] = stripslashes($j);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_POST[$key] = stripslashes($val);\n\t\t\t}\n\t\t}\n\t}\n}", "function save_settings_array( $array_name, &$array2store){\n $index = $array_name.\"[0]\"; //is_settings_array works with a full array key like MYVPN[1]\n if( $this->is_settings_array($index) !== true ){\n return false;\n }\n\n \n // ensure SettingsArray of [0] always exists\n if( $array2store === '' ){\n $array2store = \"$index=''\";\n }\n\n $this->remove_array($array_name);\n $this->append_settings($array2store);\n\n //clear to force a reload\n unset($_SESSION['settings.conf']);\n }", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "function check_single_incomming_var($var, $request = FALSE, $url_decode = FALSE) {\n if ((is_string($var) || is_numeric($var)) && !is_array($var)) {\n if (($request == TRUE) && isset($_REQUEST[$var])) {\n $value = $_REQUEST[$var];\n } elseif ($request == FALSE) {\n $value = $var;\n } else {\n $value = NULL;\n }\n if ($value === '') {\n return NULL;\n } elseif (($value === 0)) {\n return 0;\n } elseif (($value === '0')) {\n return '0';\n } else {\n// $value = htmlspecialchars($value);\n }\n if ($url_decode) {\n $value = urldecode($value);\n }\n if (\\json_decode($value) === NULL) {\n// $search = ['\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"];\n// $replace = ['\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'];\n// $value = str_replace($search, $replace, $value);\n// $value = @mysql_real_escape_string($value);\n }\n return $value;\n } else {\n return NULL;\n }\n}", "function wpsl_sanitize_multi_array( &$item, $key ) {\n $item = sanitize_text_field( $item );\n}", "private static function doFixArray(array &$array){\n if( get_magic_quotes_gpc() == 1 ){\n foreach($array as $key => $value){\n if( is_array($value) )\n $array[$key] = self::doFixArray($value);\n else\n $array[$key] = stripslashes($value);\n }\n }\n }", "function clean_input( $dirty_data ){\n\t//use the DB connection already established\n\tglobal $db;\n\t//clean the data and 'return' it so we can continue working with it\n\treturn mysqli_real_escape_string($db, strip_tags( $dirty_data ));\n}", "function fix_input_quotes() {\n if(get_magic_quotes_gpc()) {\n array_stripslashes($_GET);\n array_stripslashes($_POST);\n array_stripslashes($_COOKIE);\n } // if\n }", "function fix_slashes($arr='')\n\t{\n\t\tif (is_null($arr) || $arr == '') return null;\n\t\tif (!get_magic_quotes_gpc()) return $arr;\n\t\treturn is_array($arr) ? array_map('fix_slashes', $arr) : stripslashes($arr);\n\t}", "function fixSQLInjection($value){\n $newstring=$value;\n //echo \"value=\".$value.\"<br/>\";\n $latestPos=0;\n $counter=0;\n if (strpos($value,',')!==false) throw new Exception (\"PASS. Comma is unavaiable as a character. PGSQL doesn\\'t like it :( \");\n //echo \"position of ': \";var_dump(strpos($value,'\\'')); echo \"<br/>\";\n while(($positionOfXrenb=strpos($value,'\\'',$latestPos))!==false){\n //echo \"GG\";\n $newstring = substr($newstring,0,$positionOfXrenb+$counter);\n $newstring.='\\'';\n $newstring.=substr($value,$positionOfXrenb,strlen($value)-$positionOfXrenb);\n //var_dump ($newstring);\n //echo \"<br/>\";\n $latestPos=$positionOfXrenb;\n $value[$positionOfXrenb]='X';\n $counter++;\n \n }\n //var_dump ($newstring);\n return $newstring;\n}", "function bind( $array, $ignore = '' )\n {\n if (key_exists( 'field-name', $array ) && is_array( $array['field-name'] )) {\n \t$array['field-name'] = implode( ',', $array['field-name'] );\n }\n \n return parent::bind( $array, $ignore );\n }", "public static function fixArrays(){\n if( self::$postGetFixed ) return;\n if( count($_POST) > 0 )\n self::doFixArray($_POST);\n if( count($_GET) > 0 )\n self::doFixArray($_GET);\n self::$postGetFixed = true;\n }", "public static function sanitize($item) {\n if (!is_array($item)) {\n // undoing 'magic_quotes_gpc = On' directive\n if (get_magic_quotes_gpc()) $item = stripcslashes($item);\n $item = str_replace(\"<\", \"&lt;\", $item);\n $item = str_replace(\">\", \"&gt;\", $item);\n $item = str_replace(\"\\\"\", \"&quot;\", $item);\n $item = str_replace(\"'\", \"&#039;\", $item);\n $item = mysql_real_escape_string($item);\n }\n return $item;\n }", "function dbEscape($dados){\n \t\t$conn = dbConnect();\n \t\tif(!is_array($dados)){\n \t\t\t$dados = mysqli_real_escape_string($conn, $dados);\t\t\t//\tInsere contra-barras nas strings\n \t\t}else{\n \t\t\t$array = $dados;\n \t\t\tforeach ($array as $keys => $values) {\n \t\t\t\t$keys \t= mysqli_real_escape_string($conn, $keys);\t\t//\tLimpa as chaves\n \t\t\t\t$values\t= mysqli_real_escape_string($conn, $values);\t//\tLimpa os valores\n \t\t\t\t$dados[$keys] = $values;\t\t\t\t\t\t\t\t//\tConstrói novamente o array\n \t\t\t}\n \t\t}\n \t\tdbClose($conn);\n \t\treturn $dados;\n \t}", "public function quoteSmart($values)\n\t{\n\t\tif(is_array($values))\n\t\t{\n\t\t\t$tmp = [];\n\t\t\tforeach($values as $key=>$str)\n\t\t\t{\n\t\t\t\t$tmp[$key] = \"'\".addslashes($str).\"'\";\n\t\t\t}\t\t\n\t\t\t$values = $tmp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$values = \"'\".addslashes($values).\"'\";\n\t\t}\n\t\t\n\t\treturn $values;\n\t}", "function dbEscapeArray($array) {\n\treturn(array_map(\"dbEscape\",$array));\n}", "function array_to_insert_clause($a_vars) {\n\tif (count($a_vars) == 0)\n\t\t\treturn \"\";\n\t$a_keys = array();\n\tforeach($a_vars as $k=>$v)\n\t\t\t$a_keys[] = $k;\n\treturn \"(`\".implode(\"`,`\",$a_keys).\"`) VALUES ('[\".implode(\"]','[\",$a_keys).\"]')\";\n}", "function array_to_set_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_set = array();\n\t$a_values = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_set[] = $k;\n\t\t\t$a_values[] = $v;\n\t}\n\t$s_set = \"(`\".implode(\"`,`\", $a_set).\"`) VALUES ('\".implode(\"','\",$a_values).\"')\";\n\treturn $s_set;\n}", "function sanitize_input($input) {\n $input = mysql_real_escape_string($input);\n return $input;\n}", "function sanitizeData_lite($var)\n\t{\n\t\t$var = trim($var); // gets rid of white space\n\t\t$var = stripslashes($var); // no slashes protecting stuff\n\t\treturn $var; //returns clean data\n\t}", "protected function _escapeArray($arr)\r\n {\r\n array_walk($arr, function(&$item, $key) {\r\n $item = pg_escape_string($item);\r\n });\r\n\r\n return $arr;\r\n }", "function Sanitizer($data) {\r\n $data = trim($data);\r\n // it'll strip the slashes in the field \r\n $data = stripcslashes($data);\r\n // for special characters in html like < / >\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n{}\r\n\r\nif($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n $name = Sanitizer($_POST['name']);\r\n $email = Sanitizer($_POST['email']);\r\n $message = Sanitizer($_POST['message']);\r\n $subject = Sanitizer($_POST['subject']);\r\n \r\n}\r\n$wholeCheckedInputs = vsprintf(\"these are the inputs from the from\", array($name, $email, $subject, $message));\r\nprint_r($wholeCheckedInputs);\r\n/**\r\n * we can use Php filters like filter_var() / filter_input() <- for a single argument\r\n * or we can even check out multiple arguments using filter_input_array()\r\n */\r\n\r\n}", "function sanitize($data){\r\n $conn = db ();\r\n return mysqli_real_escape_string($conn, $data);\r\n}", "private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }", "function lalita_sanitize_variants( $input ) {\n\tif ( is_array( $input ) ) {\n\t\t$input = implode( ',', $input );\n\t}\n\treturn sanitize_text_field( $input );\n}", "function _cleanQuery( $str )\r\n\t\t{\r\n\t\treturn is_array($str) ? array_map('_cleanQuery', $str) : str_replace('\\\\', '\\\\\\\\', htmlspecialchars((get_magic_quotes_gpc() ? stripslashes($str) : $str), ENT_QUOTES));\r\n\t\t\r\n\t\t}", "function array_to_where_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_where = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_where[] = \"`$k`='$v'\";\n\t}\n\t$s_where = implode(' AND ', $a_where);\n\treturn $s_where;\n}", "function rest_sanitize_array($maybe_array)\n {\n }", "function mysql_escape_mimic($inp)\n {\n if(is_array($inp))\n return array_map(__METHOD__, $inp);\n if(!empty($inp) && is_string($inp)) {\n return str_replace(array('\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"), array('\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'), $inp);\n }\n return $inp;\n }", "protected function insertArrayVariable()\n {\n $name = 'arrayVariable' . rand(5, 5);\n $insertArrayVariableJavaScript = <<<JS\n var variableScript = document.createElement('script');\n var variableTextNode = document.createTextNode('var $name = [];');\n\n variableScript.appendChild(variableTextNode);\n document.body.appendChild(variableScript);\nJS;\n $this->getSession()->executeScript($insertArrayVariableJavaScript);\n\n $assertVariableExistJavaScript = <<<JS\n return typeof $name != 'undefined';\nJS;\n $this->assertByJavaScript(\n $assertVariableExistJavaScript,\n 'The variable named \"' . $name . ' was NOT successfully defined.'\n );\n\n return $name;\n }", "function db_quote_many($array) {\n $to_return = array();\n foreach($array as $value) {\n $to_return[] = db_quote($value);\n }\n return $to_return;\n}", "public function SecureData($data) {\n\t\tif (is_array ( $data )) {\n\t\t\tforeach ( $data as $key => $val ) {\n\t\t\t\tif (! is_array ( $data [$key] )) {\n\t\t\t\t\t$data [$key] = mysqli_real_escape_string ( $this->databaseLink, $data [$key] );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$data = mysqli_real_escape_string ( $this->databaseLink, $data );\n\t\t}\n\t\treturn $data;\n\t}", "function sanitizeMySql($conn, $var) {\n $var = $conn->real_escape_string($var);\n $var = sanitizeString($var);\n return $var;\n}", "function clean_for_db_reinsert($value) {\n//$value = str_replace(\"'\", \"''\", $value);\n$value = addslashes($value);\n$value = str_replace(\"\\'\", \"''\", $value);\n\treturn $value;\n\n}", "function stripslashes_array($data) {\r\n if (is_array($data)){\r\n foreach ($data as $key => $value){\r\n $data[$key] = stripslashes_array($value);\r\n }\r\n return $data;\r\n } else {\r\n return stripslashes($data);\r\n }\r\n }", "abstract protected function prepareVars(array $data);", "function re_post_form($var, $ignore=array('submit'))\r\n{\r\n $input_hiddens = '';\r\n\r\n foreach($var as $k=>$v)\r\n {\r\n $k = format_str($k);\r\n if(in_array($k, $ignore)!=false) continue;\r\n\r\n if(is_array($v))\r\n {\r\n foreach($v as $k2=>$v2){\r\n $input_hiddens .= \"<input type='hidden' name='{$k}[{$k2}]' value='{$v2}' />\\r\\n\";\r\n }\r\n }\r\n else{\r\n $input_hiddens .= \"<input type='hidden' name='{$k}' value='{$v}' />\\r\\n\";\r\n }\r\n }\r\n\r\n return $input_hiddens;\r\n}", "function mysql_escape_mimic($inp) {\r\n if(is_array($inp))\r\n return array_map(__METHOD__, $inp);\r\n if(!empty($inp) && is_string($inp)) {\r\n return str_replace(array('\\\\', \"\\0\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\"), array('\\\\\\\\', '\\\\0', '\\\\n', '\\\\r', \"\\\\'\", '\\\\\"', '\\\\Z'), $inp);\r\n }\r\n return $inp;\r\n }", "private function fixExplodeFields($input){\n foreach($this->explodeFields as $field){\n if(empty($input[$field]))\n $input[$field] = array();\n else{\n if(substr($input[$field],0,1) == $this->explodeDelimiter){\n $input[$field] = substr($input[$field],1,-1);\n }\n $fld = explode($this->explodeDelimiter,$input[$field]);\n $f = array();\n foreach($fld as $k => $v){\n $f[$k] = trim($v);\n }\n $input[$field] = $f;\n unset($f,$fld,$k,$v);\n }\n }\n return $input;\n }" ]
[ "0.63248557", "0.597724", "0.5937407", "0.56931216", "0.5691686", "0.5639601", "0.56013626", "0.5469584", "0.5468918", "0.54580635", "0.54506594", "0.54496884", "0.5412455", "0.5401266", "0.53577787", "0.5340551", "0.5321999", "0.5320253", "0.524443", "0.5211405", "0.520682", "0.51965284", "0.518639", "0.5169232", "0.5163602", "0.51571834", "0.51519597", "0.5131336", "0.51152843", "0.51003647", "0.509258", "0.5073966", "0.50455284", "0.502231", "0.5018863", "0.5015694", "0.50117165", "0.50036013", "0.49862117", "0.4986014", "0.49807754", "0.49715596", "0.49676728", "0.49661377", "0.4964577", "0.49597892", "0.49474216", "0.49230587", "0.49110368", "0.48996735", "0.48956317", "0.48941186", "0.48906752", "0.48894346", "0.4884789", "0.488082", "0.48804265", "0.48718977", "0.4871406", "0.48679847", "0.48674032", "0.48592192", "0.48514342", "0.4842681", "0.4838599", "0.48377967", "0.4834834", "0.48315543", "0.48266542", "0.4819206", "0.48118657", "0.4810582", "0.48076752", "0.48017964", "0.4795112", "0.47918037", "0.47827837", "0.47823623", "0.4781588", "0.4775909", "0.47671255", "0.47641203", "0.47572756", "0.47562838", "0.47485876", "0.47451884", "0.4737673", "0.47372395", "0.47343493", "0.47298563", "0.47216818", "0.47213864", "0.47173706", "0.47149748", "0.47135994", "0.46980345", "0.46964872", "0.46880403", "0.46861565", "0.46791366" ]
0.6002798
1
Get a single value from a serialized var if is an array, this one do not echo erros only return FALSE is there is not stored
function get_form_field_from_serialized($form_name, $field_name, $default = "", $compare = "--FALSE--") { if (!is_string($form_name) || empty($form_name)) { die(__FUNCTION__ . " form_name should be an non empty string"); } if (empty($field_name)) { die(__FUNCTION__ . " field_name should be an non empty string"); } $field_value = ""; //FORM EXISTS if (isset($_SESSION['serialized_vars'][$form_name])) { // FIELD EXISTS if (isset($_SESSION['serialized_vars'][$form_name][$field_name])) { $field_value = $_SESSION['serialized_vars'][$form_name][$field_name]; if ($compare !== "--FALSE--") { if ($field_value === $compare) { return TRUE; } else { return FALSE; } } } else { if ($compare !== "--FALSE--") { if ($default === $compare) { return TRUE; } else { return FALSE; } } else { $field_value = $default; } } } else { $field_value = FALSE; // die(__FUNCTION__ . " serialized var '$form_name' do not exist! "); } return $field_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function value_get(){\n\t\t\n\t\tif ( is_serialized( $this->value ) ) {\n\t\t\t$this->value = unserialize( $this->value );\n\t\t} elseif ( is_string( $this->value ) && 0 === strpos( $this->value, '{' ) && is_object( $_value = json_decode( $this->value ) ) ) {\n\t\t\t$this->value = (array) $_value;\n\t\t}\n\n\t\treturn $this->value;\n\t\t\n\t}", "function is_serialized( $value, &$result = null ){\n\tif( !is_string( $value ) ){\n\t\treturn false;\n\t}\n\n\t// Serialized false, return true. unserialize() returns false on an\n\t// invalid string or it could return false if the string is serialized\n\t// false, eliminate that possibility.\n\tif( $value === 'b:0;')\n\t{\n\t\t$result = false;\n\t\treturn true;\n\t}\n\n\t$length\t= strlen( $value );\n\t$end\t= '';\n\n\tswitch ( $value[0])\t{\n\t\tcase 's':\n\t\t\tif( $value[$length - 2] !== '\"'){\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'b':\n\t\tcase 'i':\n\t\tcase 'd':\n\t\t\t// This looks odd but it is quicker than isset()ing\n\t\t\t$end .= ';';\n\t\tcase 'a':\n\t\tcase 'O':\n\t\t\t$end .= '}';\n\n\t\t\tif( $value[1] !== ':'){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tswitch ( $value[2]){\n\t\t\t\tcase 0:\n\t\t\t\tcase 1:\n\t\t\t\tcase 2:\n\t\t\t\tcase 3:\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\tcase 7:\n\t\t\t\tcase 8:\n\t\t\t\tcase 9:\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'N':\n\t\t\t$end .= ';';\n\n\t\t\tif( $value[$length - 1] !== $end[0]){\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\n\tif(( $result = @unserialize( $value ) ) === false )\t{\n\t\t$result = null;\n\t\treturn false;\n\t}\n\treturn true;\n}", "function is_serialized($value, &$result = null)\n{\n\tif (!is_string($value))\n\t{\n\t\treturn false;\n\t}\n\t// Serialized false, return true. unserialize() returns false on an\n\t// invalid string or it could return false if the string is serialized\n\t// false, eliminate that possibility.\n\tif ($value === 'b:0;')\n\t{\n\t\t$result = false;\n\t\treturn true;\n\t}\n\t$length\t= strlen($value);\n\t$end\t= '';\n\tswitch ($value[0])\n\t{\n\t\tcase 's':\n\t\t\tif ($value[$length - 2] !== '\"')\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'b':\n\t\tcase 'i':\n\t\tcase 'd':\n\t\t\t// This looks odd but it is quicker than isset()ing\n\t\t\t$end .= ';';\n\t\tcase 'a':\n\t\tcase 'O':\n\t\t\t$end .= '}';\n\t\t\tif ($value[1] !== ':')\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tswitch ($value[2])\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\tcase 1:\n\t\t\t\tcase 2:\n\t\t\t\tcase 3:\n\t\t\t\tcase 4:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\tcase 7:\n\t\t\t\tcase 8:\n\t\t\t\tcase 9:\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\tcase 'N':\n\t\t\t$end .= ';';\n\t\t\tif ($value[$length - 1] !== $end[0])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n\tif (($result = @unserialize($value)) === false)\n\t{\n\t\t$result = null;\n\t\treturn false;\n\t}\n\treturn true;\n}", "function is_serialized_string($data)\n {\n }", "function isArrayVal()\n {\n return $this->_arrayVal;\n }", "protected function check_for_array_or_object($value)\n {\n if (is_array($value) || is_object($value))\n {\n $value = serialize($value);\n }\n\n return $value;\n }", "private function process_array($value) {\n return is_array($value);\n }", "function get ($key) {\n //if (preg_match('/^arr_/', $key)) return unserialize($this->redis->get($key));\n $value = $this->redis->get($key);\n if (($result = @unserialize($value)) === false) return $value;\n return $result;\n }", "public static function isSerializedVar($val)\n {\n\t\tif (!is_string($val)) return false;\n else return (strrpos($val, \"__\", 2) !== false && strrpos($val, \"__\", -2) !== false) ? true : false;\n }", "protected function is_single($data){\n foreach ($data as $value){\n if (is_array($value)){\n return false;\n }\n return true;\n }\n }", "public function isMultivalue();", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "function getFieldValue($arrData, $key=\"s\") {\n if(is_array($arrData) && array_key_exists($key, $arrData)) {\n echo $arrData[$key];\n }\n else {\n echo '';\n }\n}", "private function isSerialized($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n return true;\n } else {\n return false;\n }\n }", "function getArrayValue($array, $key)\n\t{\n\t\tif (isset($array[$key])) {\n\t\t\treturn trim(stripslashes($array[$key]));\n\t\t}\n\t\treturn false;\n\t}", "function loadFormValue($my_array){\n\t\t$name = $this->getName();\n\t\tif(isset($my_array[$name])){\n\t\t\t$val = $my_array[$name];\n\t\t\tif(get_magic_quotes_gpc()){\n\t\t\t\t$val = stripslashes($val);\n\t\t\t}\n\t\t\t$this->setValue($val);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function is_serialized_string($data) {\n\t\tif (!is_string($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = trim($data);\n\t\tif (strlen($data) < 4) {\n\t\t\treturn false;\n\t\t} elseif (':' !== $data[1]) {\n\t\t\treturn false;\n\t\t} elseif (';' !== substr($data, -1)) {\n\t\t\treturn false;\n\t\t} elseif ($data[0] !== 's') {\n\t\t\treturn false;\n\t\t} elseif ('\"' !== substr($data, -2, 1)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function scalar() {\n if($this->result_array) {\n $keys = array_keys($this->result_array[0]);\n return $this->result_array[0][$keys[0]];\n }\n return false;\n }", "public function isSerialized()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n if (\n $this->str === 'b:0;'\n ||\n @unserialize($this->str) !== false\n ) {\n return true;\n } else {\n return false;\n }\n }", "function _safe_unserialize($str)\n{\n\tif(strlen($str) > MAX_SERIALIZED_INPUT_LENGTH)\n\t{\n\t\tthrow new Exception('safe_unserialize: input exceeds ' . MAX_SERIALIZED_INPUT_LENGTH);\n\t}\n\n\tif(empty($str) || !is_string($str))\n\t{\n\t\treturn false;\n\t}\n\n\t$stack = array();\n\t$expected = array();\n\n\t/*\n\t * states:\n\t * 0 - initial state, expecting a single value or array\n\t * 1 - terminal state\n\t * 2 - in array, expecting end of array or a key\n\t * 3 - in array, expecting value or another array\n\t */\n\t$state = 0;\n\twhile($state != 1)\n\t{\n\t\t$type = isset($str[0]) ? $str[0] : '';\n\n\t\tif($type == '}')\n\t\t{\n\t\t\t$str = substr($str, 1);\n\t\t}\n\t\telse if($type == 'N' && $str[1] == ';')\n\t\t{\n\t\t\t$value = null;\n\t\t\t$str = substr($str, 2);\n\t\t}\n\t\telse if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches))\n\t\t{\n\t\t\t$value = $matches[1] == '1' ? true : false;\n\t\t\t$str = substr($str, 4);\n\t\t}\n\t\telse if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches))\n\t\t{\n\t\t\t$value = (int)$matches[1];\n\t\t\t$str = $matches[2];\n\t\t}\n\t\telse if($type == 'd' && preg_match('/^d:(-?[0-9]+\\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches))\n\t\t{\n\t\t\t$value = (float)$matches[1];\n\t\t\t$str = $matches[3];\n\t\t}\n\t\telse if($type == 's' && preg_match('/^s:([0-9]+):\"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '\";')\n\t\t{\n\t\t\t$value = substr($matches[2], 0, (int)$matches[1]);\n\t\t\t$str = substr($matches[2], (int)$matches[1] + 2);\n\t\t}\n\t\telse if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches) && $matches[1] < MAX_SERIALIZED_ARRAY_LENGTH)\n\t\t{\n\t\t\t$expectedLength = (int)$matches[1];\n\t\t\t$str = $matches[2];\n\t\t}\n\t\telse if($type == 'O')\n\t\t{\n\t\t\tthrow new Exception('safe_unserialize: objects not supported');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('safe_unserialize: unknown/malformed type: '.$type);\n\t\t}\n\n\t\tswitch($state)\n\t\t{\n\t\t\tcase 3: // in array, expecting value or another array\n\t\t\t\tif($type == 'a')\n\t\t\t\t{\n\t\t\t\t\tif(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array nesting exceeds ' . MAX_SERIALIZED_ARRAY_DEPTH);\n\t\t\t\t\t}\n\n\t\t\t\t\t$stack[] = &$list;\n\t\t\t\t\t$list[$key] = array();\n\t\t\t\t\t$list = &$list[$key];\n\t\t\t\t\t$expected[] = $expectedLength;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type != '}')\n\t\t\t\t{\n\t\t\t\t\t$list[$key] = $value;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: missing array value');\n\n\t\t\tcase 2: // in array, expecting end of array or a key\n\t\t\t\tif($type == '}')\n\t\t\t\t{\n\t\t\t\t\tif(count($list) < end($expected))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size less than expected ' . $expected[0]);\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($list);\n\t\t\t\t\t$list = &$stack[count($stack)-1];\n\t\t\t\t\tarray_pop($stack);\n\n\t\t\t\t\t// go to terminal state if we're at the end of the root array\n\t\t\t\t\tarray_pop($expected);\n\t\t\t\t\tif(count($expected) == 0) {\n\t\t\t\t\t\t$state = 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type == 'i' || $type == 's')\n\t\t\t\t{\n\t\t\t\t\tif(count($list) >= MAX_SERIALIZED_ARRAY_LENGTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size exceeds ' . MAX_SERIALIZED_ARRAY_LENGTH);\n\t\t\t\t\t}\n\t\t\t\t\tif(count($list) >= end($expected))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array size exceeds expected length');\n\t\t\t\t\t}\n\n\t\t\t\t\t$key = $value;\n\t\t\t\t\t$state = 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: illegal array index type');\n\n\t\t\tcase 0: // expecting array or value\n\t\t\t\tif($type == 'a')\n\t\t\t\t{\n\t\t\t\t\tif(count($stack) >= MAX_SERIALIZED_ARRAY_DEPTH)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('safe_unserialize: array nesting exceeds ' . MAX_SERIALIZED_ARRAY_DEPTH);\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = array();\n\t\t\t\t\t$list = &$data;\n\t\t\t\t\t$expected[] = $expectedLength;\n\t\t\t\t\t$state = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif($type != '}')\n\t\t\t\t{\n\t\t\t\t\t$data = $value;\n\t\t\t\t\t$state = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception('safe_unserialize: not in array');\n\t\t}\n\t}\n\n\tif(!empty($str))\n\t{\n\t\tthrow new Exception('safe_unserialize: trailing data in input');\n\t}\n\treturn $data;\n}", "public static function unserialize( $value=null )\n {\n if( is_string( $value ) )\n {\n if( $array = @json_decode( $value, true ) )\n {\n return $array;\n }\n if( $object = @unserialize( $value ) )\n {\n return $object;\n }\n if( is_numeric( $value ) )\n {\n return 0 + $value;\n }\n if( $value === \"[]\" || $value === \"{}\" )\n {\n return array();\n }\n switch( strtolower( trim( $value ) ) )\n {\n case \"null\" : return null;\n case \"true\" : return true;\n case \"false\" : return false;\n }\n }\n return $value;\n }", "public function get_payload() {\n\t\tif ( ! empty( $this->data->payload ) )\n\t\t\treturn json_decode( $this->data->payload );\n\t\telse\n\t\t\treturn false;\n\t}", "public function get($key) \n\t{\n\t\t$contents = $this->instance()->get($key);\n\t\tif ($contents !== false) {\n\t\t\treturn unserialize($contents);\n\t\t}\n\t\treturn false;\n\t}", "private function unserialize($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n // Unserialization passed, return unserialized data\n return $data;\n } else {\n // Data was not serialized, return raw data\n return $value;\n }\n }", "function singleRecord()\n {\n $this->Record = mysql_fetch_array( $this->Query_ID );\n $stat = is_array( $this->Record );\n return $stat;\n }", "function singleRecord() {\r\n $this->Record = mysql_fetch_assoc( $this->Query_ID );\r\n $stat = is_array( $this->Record );\r\n return $stat;\r\n }", "public function valid()\n\t{\n\t\t$key = key($this->var);\n\t\t$var = ($key !== NULL && $key !== FALSE);\n\t\techo \"valid: $var\\n\";\n\t\treturn $var;\t\n\t}", "public function get($key) {\n\t\tif (isset($this->getArray[$key])) {\n\t\t\treturn $this->getArray[$key];\n\t\t}\n\n\t\treturn false;\n\t}", "function check_value($input) { \n\t\tif (is_array($input)) {\n\t\t\t$retval=$this->flatten($input);\n\t\t} else {\n\t\t\t$retval=$input;\n\t\t\t$this->output[]=$retval;\n\t\t}\n\t}", "public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}", "function acf_is_array($array)\n{\n}", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "public function isSuccessful()\r\n {\r\n return is_array($this->data);\r\n }", "public static function getArrayValue($array, $key)\n\t{\n\t\tif (isset($array[$key])) {\n\t\t\treturn trim(stripslashes($array[$key]));\n\t\t}\n\t\treturn false;\n\t}", "public static function isSerializedArray($data)\n {\n return $data === null || (is_string($data) && preg_match('/^a:[0-9]+:{.*;}$/s', $data));\n }", "function readDataFieldValue()\r\n {\r\n $result=false;\r\n if ($this->hasValidDataField())\r\n {\r\n $fname=$this->DataField;\r\n $value=$this->_datasource->Dataset->fieldget($fname);\r\n $result=$value;\r\n }\r\n return($result);\r\n }", "function is_serial($string) {\n return (@unserialize($string) !== false);\n}", "public function isArray()\n {\n return \\is_array($this->value);\n }", "function decode_var($var) {\n\tif(is_array($var)){\n\t\treturn $var;\n\t}\n\n\tif ($var == '') {\n\t\treturn false;\n\t}\n\n\n\n\t$var = base64_decode($var);\n\n\ttry {\n\t\t$var = @json_decode($var, 1);\n\t}\n\tcatch (Exception $exc) {\n\t\treturn false;\n\t}\n\n\n\n\t//$var = unserialize($var);\n\treturn $var;\n}", "public function getValue($raw = FALSE)\n\t{\n\t\treturn is_scalar($this->value) && ($raw || isset($this->items[$this->value])) ? $this->value : NULL;\n\t}", "public function read($key){\n\t\tif(array_key_exists($key, $this->data))\n\t\t\treturn $this->data[$key];\n\t\treturn false;\n\t}", "public function isEncodedArrayFieldValue($value)\n {\n if (!is_array($value)) {\n return false;\n }\n unset($value['__empty']);\n foreach ($value as $row) {\n if (!is_array($row) || !array_key_exists('predefined_values_donation', $row)) {\n return false;\n }\n }\n return true;\n }", "public function getValue($name) {\n $result = '';\n $where = array();\n $where[self::field_name] = $name;\n $config = array();\n if (!$this->sqlSelectRecord($where, $config)) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->getError()));\n return false;\n }\n if (sizeof($config) < 1) {\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $this->lang->translate('There is no record for the configuration of <b>{{ name }}</b>!', array(\n 'name',\n $name))));\n return false;\n }\n $config = $config[0];\n switch ($config[self::field_type]) :\n case self::type_array :\n $result = explode(\",\", $config[self::field_value]);\n break;\n case self::type_boolean :\n $result = (bool) $config[self::field_value];\n break;\n case self::type_email :\n case self::type_path :\n case self::type_string :\n case self::type_url :\n $result = (string) utf8_decode($config[self::field_value]);\n break;\n case self::type_float :\n $result = (float) $config[self::field_value];\n break;\n case self::type_integer :\n $result = (integer) $config[self::field_value];\n break;\n case self::type_list :\n $result = str_replace(\",\", \"\\n\", $config[self::field_value]);\n break;\n default :\n echo $config[self::field_value];\n $result = utf8_decode($config[self::field_value]);\n break;\n endswitch\n ;\n return $result;\n }", "function getValue($app, $key)\n {\n $name = $app . \"-\" . $key;\n if ( $this->isEntitySet($name) )\n {\n $this->fDebug->add(get_class($this) . \"::getValue(): Returning values for $name\", 4);\n $out = $this->$name;\n // Check to make sure we're actually something that is serialized\n if ( strstr($out, '{') )\n {\n $temp = unserialize($out);\n if ( is_array($temp) ) return $temp;\n }\n return $out;\n }\n return false;\n }", "public function loaded()\n {\n return is_array($this->data);\n }", "function is_serialized( $data ) {\n if ( !is_string( $data ) )\n return false;\n $data = trim( $data );\n if ( 'N;' == $data )\n return true;\n if ( !preg_match( '/^([adObis]):/', $data, $badions ) )\n return false;\n switch ( $badions[1] ) {\n case 'a' :\n case 'O' :\n case 's' :\n if ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\n return true;\n break;\n }\n return false;\n }", "public function data($key){\n if (isset($this->data[$key])) return $this->data[$key];\n else return false;\n }", "public function getIsMultiValued(): ?bool {\n $val = $this->getBackingStore()->get('isMultiValued');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'isMultiValued'\");\n }", "function getValue($value) {\n\treturn (!empty($value)) ? sanitize($value) : false;\n}", "function single() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "function is_serialized($data) {\n if (!is_string($data))\n return false;\n $data = trim($data);\n if ('N;' == $data)\n return true;\n if (!preg_match('/^([adObis]):/', $data, $badions))\n return false;\n switch ($badions[1]) {\n case 'a' :\n case 'O' :\n case 's' :\n if (preg_match(\"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data))\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if (preg_match(\"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data))\n return true;\n break;\n }\n return false;\n }", "public static function getValue($key, $array)\n {\n $keys = explode('.', $key);\n switch (count($keys)):\n case '1':\n return !empty($array[\"$keys[0]\"]) ? $array[\"$keys[0]\"] : FALSE;\n break;\n case '2':\n return !empty($array[\"$keys[0]\"][\"$keys[1]\"]) ? $array[\"$keys[0]\"][\"$keys[1]\"] : FALSE;\n break;\n case '3':\n return !empty($array[\"$keys[0]\"][\"$keys[1]\"][\"$keys[2]\"]) ? $array[\"$keys[0]\"][\"$keys[1]\"][\"$keys[2]\"] : FALSE;\n break;\n case '4':\n return !empty($array[\"$keys[0]\"][\"$keys[1]\"][\"$keys[2]\"][\"$keys[3]\"]) ? $array[\"$keys[0]\"][\"$keys[1]\"][\"$keys[2]\"][\"$keys[3]\"] : FALSE;\n break;\n endswitch;\n }", "function array_safe_value($array, $key, $default = null, $case_insensitive = false, $type = false) {\n\tif($case_insensitive == true) {\n\t\tforeach($array as $the_key => $value) {\n\t\t\tif(strtolower($key) == strtolower($the_key)) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif(is_array($array) == false || array_key_exists($key, $array) == false) {\n\t\treturn $default;\n\t}\n\t\n\tif($array[$key] == 'true') {\n\t\treturn true;\n\t} else if($array[$key] == 'false') {\n\t\treturn false;\n\t}\n\t\n\treturn $array[$key];\n}", "function is_serialized($data, $strict = \\true)\n {\n }", "protected function validateArray($value){\n\t\treturn is_array($value);\n\t}", "function stmpOkay($array){\n return $array['stmp_check'];\n }", "function safe_value_isset( $data , $key ){\n \n if( isset($data[$key])){\n return $data[$key];\n }\n else {\n return \"\";\n } \n}", "function string_value($value) {\r\n\t\t// objects should have a to_string a value to compare to\r\n\t\tif (is_object($value)) {\r\n\t\t\tif (method_exists($value, 'to_string')) {\r\n\t\t\t\t$value = $value->to_string();\r\n\t\t\t} else {\r\n\t\t\t\ttrigger_error(\"Cannot convert $value to string\", E_USER_WARNING);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t\t\r\n\r\n\t\t// arrays simply return true\r\n\t\tif (is_array($value)) {\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $value;\r\n\t}", "function getValueByPath($arr,$path) {\n\t\t$r=$arr;\n\t\tif (!is_array($path)) return false;\n\t\tforeach ($path as $key) {\n\t\t\tif (isset($r[$key]))\n\t\t\t\t$r=$r[$key];\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $r;\n\t}", "function value($resource){\n if ($resource){\n if (is_object($resource) || is_array($resource) || is_resource($resource)){\n return $resource;\n } else {\n $cast = strval($resource);\n if ($cast != '' && $cast != 'null'){\n return $cast;\n }\n }\n }\n return false;\n}", "protected function _checkValueDetail($arr)\n\t{\n\t\tglobal $varsRequest;\n\t\tglobal $classEscape;\n\n\t\t$flag = 0;\n\t\t$array = $arr['varsDetail'];\n\t\tforeach ($array as $key => $value) {\n\t\t\t$idTarget = $classEscape->toLower(array('str' => $value['id']));\n\t\t\t$arrayOption = $value['arrayOption'];\n\t\t\tforeach ($arrayOption as $keyOption => $valueOption) {\n\t\t\t\tif ($valueOption['value'] == $arr['varsFlag'][$idTarget]) {\n\t\t\t\t\t$flag = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$flag) {\n\t\t\t\tif ($arr['flagOutput']) {\n\t\t\t\t\t$this->_send404Output();\n\t\t\t\t} else {\n\t\t\t\t\t$this->_sendOld();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$flag = 0;\n\t\t}\n\t}", "function areSet($submit, $arr) {\n if(empty($submit)) return false;\n $json = json_encode($submit);\n foreach ($arr as $variable) {\n if (strpos($json, $variable)==-1) return false;\n }\n return true;\n}", "public function hasNodeArrayValue(): bool\n {\n return $this->nodeValueHasArray;\n }", "private function clean_mms_data()\n {\n // Set result default value to FALSE\n $_result = FALSE;\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n foreach ($this->_mms_data as $_key => $_value) {\n if (isset($_value['payload'])) {\n $_clean_str = $this->remove_escaped_chars($_value['payload']);\n if ($_clean_str && is_string($_clean_str)) {\n $this->_mms_data[$_key]['payload'] = $_clean_str;\n }\n \n // Check if the escaped backslash character has been removed from the payload value string\n $_result = preg_match_all('@\\\\\\\"|\\\\\\/@', $this->_mms_data[$_key]['payload']) ? FALSE : TRUE;\n }\n }\n }\n \n return $_result;\n }", "public function cleanValue($value)\n {\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n if ($this->isLeveled()) {\n //special case...\n if ($value && !is_array($value)) {\n //fresh from user input... set it to array\n $value = geoLeveledField::getInstance()->getValueInfo($value);\n }\n if (!is_array($value) || !isset($value['id']) || !(int)$value['id']) {\n //invalid\n return false;\n }\n return $value;\n }\n if (is_array($value)) {\n return false;\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n if (!is_array($value) || (!isset($value['high']) || !isset($value['low']))) {\n return false;\n }\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n return $value;\n }", "public function getInternalValueAttribute()\n {\n $value = $this->data->get($this->localKey);\n if (!$this->is_serialized) {\n return $value;\n }\n \n return (@unserialize($value) ?: []);\n }", "public function getFirstItemValue()\n {\n $slab = $this->getFirstSlab();\n\n if (empty($slab)) {\n return false;\n }\n\n return $this->getFirstItemValueInSlab($slab);\n }", "public static function getArrayItem (array $data, $key)\n\t{\n\t\treturn !empty ($data[$key]) ? $data[$key] : false;\n\t}", "function rest_is_array($maybe_array)\n {\n }", "public function getIsArray() {\n return strpos($this->getType(), \"[\");\n }", "function isValid($array){\n return $array['format_valid'];\n }", "protected function unserializeError()\n {\n if (!$error = call_user_func($this->errorGetter)) {\n return false;\n }\n\n if ($error['file'] != __FILE__) {\n return false;\n }\n\n if (strpos($error['message'], 'unserialize(') !== 0) {\n return false;\n }\n\n return $error['message'];\n }", "public static function read($name)\n {\n $settingsObj = self::getInstance();\n $value = ArrayUtils::getValue($settingsObj->data, $name);\n return is_null($value) ? false : $value;\n }", "function fetch () {\r\n $error = each ( $this->errors );\r\n if ( $error ) {\r\n return $error['value'];\r\n } else {\r\n reset($this->errors);\r\n return false;\r\n }\r\n }", "public function check_meta_is_array($value, $request, $param)\n {\n }", "private function is_param_array($param){\n\t\tif(!is_array($param)){\n\t\t\t$this->text(\"Invalid parameter, cannot reply with appropriate message\");\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function select() {\n\t\t$raw = shmop_read($this -> id, 0, $this -> size);\n\t\tif ($this -> raw === false) {\n\t\t\t$this -> val = unserialize($raw);\n\n\t\t} else {\n\t\t\t$i = strpos($raw, \"\\0\");\n\t\t\tif ($i === false) {\n\t\t\t\t$this -> val = $raw;\n\t\t\t}\n\t\t\t$this -> val = substr($raw, 0, $i);\n\n\t\t}\n\n\t\treturn $this -> val;\n\n\t}", "function array_val_json(array $array, $key, $default = array()) { \n\t// get the value out of the array if it exists\n\tif( $value = array_val($array, $key) ){\n\t\t$arr = json_decode($value, 1);\n\t\t// if it didnt fail, return it\n\t\tif( $arr !== false ){\n\t\t\t// json decode succeded, return the result\n\t\t\treturn $arr;\n\t\t}\n\t}\n\t// return the default\n\treturn $default; \n}", "protected function unserializeValue($value)\n\t{\n\t\tif ($value[0] == '{' || $value[0] == '[') {\n\t\t\treturn (array)json_decode($value, true);\n\t\t} elseif (in_array(substr($value, 0, 2), ['O:', 'a:'])) {\n\t\t\treturn (array)unserialize($value);\n\t\t} elseif (is_numeric($value)) {\n\t\t\treturn (array)$value;\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}", "function is_settings_array( $array_name ){\n $settings = $this->get_settings();\n\n // array name may be passed as 'foo' or 'foo[99]'\n if( strpos($array_name, '[') === false ){\n $config_value = $array_name;\n }else{\n $config_value = substr($array_name, 0, strpos($array_name, '[') ); //this is the value of $key without [n]. this is used for the array name when writing it back\n }\n\n //check if $config_value[0] is in settings\n if( array_key_exists($config_value.'[0]', $settings) === true || $config_value === 'MYVPN' ){\n return true;\n }else{\n return false;\n }\n}", "private function _getValue( $arr, $field = 1 ) {\n\t\t$data\t= explode( ':', $arr );\n\t\treturn $data[$field];\n\t}", "function maybe_unserialize($data)\n {\n }", "public function getValue()\n {\n if ($this->isArrayField()) {\n return json_decode($this->value);\n }\n return $this->value;\n }", "public function value(): bool\n {\n if (($val = $this->raw()) === null) {\n return false;\n }\n\n return (new Boolean)->decode($val);\n }", "function safe_array_get_string($key, $array) {\n $value = safe_array_get($key, $array);\n if (is_null($value) || (strlen(trim($value)) == 0)) {\n return NULL;\n }\n return $value;\n}", "function singleRecord() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "function validateJson($data, $link){\n\n $row = mysqli_fetch_row(mysqli_query($link, \"SELECT JSON_VALID('$data')\"));\n if( !$row[0]) {\n return false; \n }\n else{\n $data_arr = json_decode($data,true);\n if(!$data_arr){\n return false; \n }\n else{ \n return $data_arr; \n } \n } \n \n}", "public function isValueString() {\n\t\treturn $this->isValueString;\n\t}", "public function serialize($value) : bool\n {\n }", "public function hasData(): bool {\n return is_array($this->data);\n }", "static function serialized( $data ) {\n\t\tif(empty($data)) return false;\n\t\tif ( !is_string( $data ) ) \n\t\t\treturn false; \n\t\t$data = trim( $data ); \n\t\tif ( 'N;' == $data ) \n\t\t\treturn true; \n\t\tif ( !preg_match( '/^([adObis]):/', $data, $badions ) ) \n\t\t\treturn false; \n\t\tswitch ( $badions[1] ) { \n\t\t\tcase 'a' : \n\t\t\tcase 'O' : \n\t\t\tcase 's' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t\tcase 'b' : \n\t\t\tcase 'i' : \n\t\t\tcase 'd' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t} \n\t\treturn false; \n\t}", "public function isScalar()\n {\n return \\is_scalar($this->value);\n }", "public function test_serialized_data() {\n\t\t$key = rand_str();\n\t\t$value = array(\n\t\t\t'foo' => true,\n\t\t\t'bar' => true,\n\t\t);\n\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\n\t\t$value = (object) $value;\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\t\t$this->assertTrue( WP_Temporary::delete_site( $key ) );\n\t}", "function error_parser($value ='')\n{\n return (!is_array(json_decode($value))) ? $value : json_decode($value);\n}", "function isArray ($value)\r\n{\r\n\treturn is_array ($value);\r\n}", "function good_query_value($sql, $debug=0)\n{\n $lst = good_query_list($sql, $debug);\n return is_array($lst)?$lst[0]:false;\n}", "public function unserialize($value)\n {\n $type = $this->getDataType();\n\n if ($type === 'json') {\n $value = json_decode($value, true);\n } elseif ($type === 'array') {\n $value = json_decode($value, true);\n } elseif ($type === 'list') {\n $value = explode(',', $value);\n } elseif ($type === 'boolean') {\n $value = (bool) $value;\n } elseif ($type === 'integer') {\n $value = (int) $value;\n } elseif ($type === 'float') {\n $value = (float) $value;\n }\n\n return $value;\n }", "function existenceChecker($value, $array_value, $array_value_to_deduced, $explode_option = 0, $delimeter = FALSE){\n\n $value_to_be_returned = \"\";\n\n $array = ($explode_option == 1) ? explode($delimeter, $array_value) : $array_value;\n\n\t if(in_array($value, $array)){\n\n $key = array_search($value, $array);\n\n $array_to_be_deduded = ($explode_option == 1) ? explode($delimeter, $array_value_to_deduced) : $array_value_to_deduced;\n\n $value_to_be_returned = $array_to_be_deduded[$key];\n\n }\n\n return $value_to_be_returned;\n\n }", "public static function isSerialized($str) {}", "public function getData()\n {\n if (isset($this->data)) {\n return $this->data;\n } else {\n return false;\n }\n }" ]
[ "0.61651754", "0.5997657", "0.5992752", "0.5936389", "0.5921317", "0.59181947", "0.5822902", "0.5775115", "0.576075", "0.5738339", "0.56807953", "0.5680771", "0.56492805", "0.5646076", "0.5639817", "0.56263596", "0.5619642", "0.55840766", "0.55831033", "0.55686903", "0.55322176", "0.5522997", "0.55219126", "0.55163574", "0.550759", "0.5496203", "0.54809964", "0.5462078", "0.5455635", "0.54447657", "0.5403726", "0.5385406", "0.53522277", "0.53447795", "0.5343625", "0.5333589", "0.53233355", "0.53223825", "0.53061503", "0.5304127", "0.5279199", "0.52773136", "0.527437", "0.5268484", "0.52666897", "0.5255544", "0.5251782", "0.5246259", "0.5243533", "0.5214322", "0.5210958", "0.5208376", "0.5207159", "0.5201179", "0.5200368", "0.5199168", "0.51974964", "0.5192277", "0.51919115", "0.5190972", "0.5176816", "0.51686925", "0.5160575", "0.51591235", "0.5154262", "0.515205", "0.5149627", "0.5149117", "0.5121808", "0.51173025", "0.51105917", "0.5107023", "0.5100669", "0.50940555", "0.50902873", "0.5088693", "0.5084775", "0.5067054", "0.50660515", "0.506367", "0.50622725", "0.50577474", "0.5050544", "0.5050023", "0.5048679", "0.5043399", "0.5021258", "0.5010759", "0.5005604", "0.49899277", "0.49685657", "0.49647027", "0.49627945", "0.49612522", "0.49598035", "0.4954429", "0.4952134", "0.49427933", "0.4942665", "0.49419478" ]
0.5138928
68
Checks with this function if a received value matchs with a item on a ENUM field on a table
function check_enum_value_type($received_value, $table_name, $table_field, \PDO $db) { $options = \k1lib\sql\get_db_table_enum_values($db, $table_name, $table_field); $options_fliped = array_flip($options); if (!isset($options_fliped[$received_value])) { $error_type = print_r($options_fliped, TRUE) . " value: '$received_value'"; // d($received_value, TRUE); } else { $error_type = FALSE; } return $error_type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testEnumField()\n {\n $field = $this->table->getField('yeahnay'); // An enum column\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Enumerated',\n $field);\n $enumValues = $field->getValues();\n $this->assertCount(2, $enumValues);\n $this->assertEquals('Yes', $enumValues[0]);\n $this->assertEquals('No', $enumValues[1]);\n }", "function _mysql_enum_values($tableName,$fieldName){\n\n\t\t#$result = @mysql_query(\"DESCRIBE $tableName\");\n\n\t\t foreach($this->fields as $row){\n\n\t\t\tereg('^([^ (]+)(\\((.+)\\))?([ ](.+))?$',$row['Type'],$fieldTypeSplit);\n\n\t\t\t//split type up into array\n\t\t\t$fieldType = $fieldTypeSplit[1];\n\t\t\t$fieldLen = $fieldTypeSplit[3];\n\n\t\t\tif ( ($fieldType=='enum' || $fieldType=='set') && ($row['Field']==$fieldName) ){\n\t\t\t\t$fieldOptions = split(\"','\",substr($fieldLen,1,-1));\n\t\t\t\treturn $fieldOptions;\n\t\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public function testEnumDataType()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'gender';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isEnum());\n $this->assertSame(\"enum('Unknown','M','F')\", $field->getDataType());\n $this->assertSame(array('Unknown','M','F'),\n array_keys($field->getEnumValues()));\n $this->assertSame('Unknown', $field->getDefault());\n $this->_assertWholelyLocal($field);\n $this->_assertMetaInfoValues($tableName, $whichField, $field);\n }", "function get_enum_values( $table, $field )\n{\n global $wpdb;\n $type = $wpdb->get_row(\"SHOW COLUMNS FROM {$table} WHERE Field = '{$field}'\" )->Type;\n preg_match(\"/^enum\\(\\'(.*)\\'\\)$/\", $type, $matches);\n $enum = explode(\"','\", $matches[1]);\n return $enum;\n}", "protected function isValueEnum(string $field, $value)\n {\n return in_array($value, static::getEnum($field));\n }", "public function enum($table = false, $field = false, $value = false, $mode = 'add', $pasive = false)\n {\n if (!$table || !$field || !$value) {\n return false;\n }\n\n $sql = \"SHOW COLUMNS FROM `\" . RL_DBPREFIX . $table . \"` LIKE '{$field}'\";\n $enum_row = $this->getRow($sql);\n preg_match('/([a-z]*)\\((.*)\\)/', $enum_row['Type'], $matches);\n\n if (!in_array(strtolower($matches[1]), array('enum', 'set'))) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field is not ENUM or SET type field');\n return false;\n }\n\n $enum_values = explode(',', $matches[2]);\n\n if ($mode == 'add') {\n if (false !== array_search(\"'{$value}'\", $enum_values)) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field already has <b>' . $value . '</b> value');\n return false;\n }\n\n array_push($enum_values, \"'{$value}'\");\n } elseif ($mode == 'remove') {\n $pos = array_search(\"'{$value}'\", $enum_values);\n\n if ($pos === false) {\n return false;\n }\n\n unset($enum_values[$pos]);\n\n if (empty($enum_values)) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field will not has any values after your remove');\n return false;\n }\n\n $enum_values = array_values($enum_values);\n }\n\n $sql = \"ALTER TABLE `\" . RL_DBPREFIX . $table . \"` CHANGE `{$field}` `{$field}` \" . strtoupper($matches[1]) . \"( \" . implode(',', $enum_values) . \" ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL\";\n if (strtolower($matches[1]) == 'enum') {\n $sql .= \" DEFAULT {$enum_values[0]}\";\n }\n\n $this->query($sql);\n\n return true;\n }", "public static function is_valid_enum($enum, $value){\n foreach ($enum as $key => $enum_value) {\n if ($enum_value == $value){\n return true;\n }\n }\n return false;\n }", "protected function isValidEnum(string $field, $value)\n {\n return $this->isValueEnum($field, $value) ||\n $this->isKeyedEnum($field, $value);\n }", "public function GetEnumValue(){\n\t\treturn db_enum_value($this->tables[0], $this->fields[0]);\n\t}", "function enumValues( $table, $field ){\n $enum = array();\n $type = $this->select( \"SHOW COLUMNS FROM {$table} WHERE Field = '{$field}'\")->row();\n preg_match('/^enum\\((.*)\\)$/', $type['Type'], $matches);\n foreach( explode(',', $matches[1]) as $value )\n {\n $enum[] = trim( $value, \"'\" );\n }\n return $enum;\n }", "function get_enum($db, $table, $column) {\n\t// get ENUM values as string to populate a dropdown select (not the what column has what enum assigned but the possible enums themself)\n\n\t//\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\t//WHERE TABLE_SCHEMA = 'maTest' AND TABLE_NAME = 'ma_Posts' AND COLUMN_NAME = 'PostRating'\";\n\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\tWHERE TABLE_SCHEMA = '{$db}' AND TABLE_NAME = '{$table}' AND COLUMN_NAME = '{$column}'\";\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#run the query\n\n\t#$result stores data object in memory\n\ttry {$result = $db->query($sql);} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\n\t#run query\n\t$results = $db->query($sql);\n\n\t#process query\n\t$results = $results->fetchAll(PDO::FETCH_ASSOC);\n\n\t#convert array to string\n\t$results = $results[0]['COLUMN_TYPE'];\n\n\t#prep string data\n\t$results = substr($results, 5, -1);\n\n\t#make $result inot an array of data again\n\t$enum = str_getcsv($results, ',', \"'\");\n\n\treturn $enum;\n}", "public function testIfWorks() : void\n {\n\n // Lvd.\n $dicts = [\n 'main' => [ 'one', 'two', 'three' ],\n 'pl:pl' => [ 'jeden', 'dwa', 'trzy' ],\n ];\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setValues(...$dicts['main']);\n $field->setDict('pl:pl', ...$dicts['pl:pl']);\n\n // Test.\n $this->assertEquals($dicts['main'], $field->getValues());\n $this->assertEquals($dicts['main'], $field->getMainDict());\n $this->assertEquals($dicts['pl:pl'], $field->getDict('pl:pl'));\n $this->assertEquals($dicts, $field->getDicts());\n $this->assertEquals($dicts['main'][0], $field->getDictValue('one'));\n $this->assertEquals($dicts['main'][0], $field->getDictValue('one', 'main'));\n $this->assertEquals($dicts['pl:pl'][0], $field->getDictValue('one', 'pl:pl'));\n $this->assertTrue($field->isValueValid(null));\n $this->assertTrue($field->isValueValid('one'));\n $this->assertFalse($field->isValueValid('jeden', false));\n $this->assertFalse($field->isValueValid('1', false));\n }", "public function enum_values( $table, $field ){\n $table = $this->prefixTable($table);\n $query = $this->db->query( \"SHOW COLUMNS FROM {$table} WHERE Field = '{$field}'\" );\n $dataresult = $query->result_array();\n\n\t\t$return = array();\n\t\tif( count($dataresult[0]) >0 ){\n\t\t\t$type = $dataresult[0]['Type'];\n\t\t preg_match(\"/^enum\\(\\'(.*)\\'\\)$/\", $type, $matches);\n\t\t $enum = explode(\"','\", $matches[1]);\n\t\t $return = $enum;\n\t\t}\n\n\t\treturn $return;\n\t}", "public function isEnumType()\n {\n return $this->getType() == PropelTypes::ENUM;\n }", "final public function is($value)\n {\n return $value instanceof AbstractEnum ? $this->_enumMatch($value) : $this->getValue() === $value;\n }", "function fixtures_check_entry( string $table ,\n string $field ,\n mixed $value ) : bool\n{\n // Check for the entry in the database\n $qrand = query(\" SELECT $table.$field AS 'u_value'\n FROM $table\n WHERE $table.$field LIKE '$value' \");\n\n // Return whether the entry already exists\n return mysqli_num_rows($qrand);\n}", "public function hasEnumFields()\n {\n foreach ($this->fields as $col) {\n if ($col->isEnumType()) {\n return true;\n }\n }\n\n return false;\n }", "public static function hasValue( $enumString, $value ) {\n\t\t$assocArray = Enum::getAssocArrayIndexedByValues( $enumString );\n\t\t$valueAsInteger = (int)$value;\n\t\treturn isset( $assocArray[$valueAsInteger] );\n\t}", "public function is_valid()\n\t{\n\t\t\n\t\t$field_value = trim($this->value);\n\t\t\n\t\tif($field_value == \"\")\n\t\t\treturn !$this->required;\n\t\t\n\t\tif(!in_array($field_value, $this->enum_array))\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n \t\n\t}", "private function filter_enum( $value ) {\n\t\tif ( empty( $this->enum ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( in_array( $value, $this->enum, true ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tthrow new InvalidArgumentException( '😡 Enum value ' . $value . ' does not exist in the schema.' );\n\t}", "public function forValueWithValues()\n {\n assert(\n TestEnumWithValues::forValue(10),\n isSameAs(TestEnumWithValues::$FOO)\n );\n }", "function getEnumValues($table,$column, &$default) \n{\n\t\n\t$retval = NULL;\n\t\n\tglobal $dbHandle;\n\n\t/********\n\t$dbHandle = new mysqlj(MYSQL_SERVER, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE)\n\t\t or die(\"Could not connect to server: MYSQL_SERVER : Database MYSQL_DATABASE \" . mysqlj_error($this->dbHandle));\n **************/\n\t$queryString = \"SHOW COLUMNS FROM `\" . $table . \"` LIKE '\" . $column . \"'\";\n\t$query=mysql_query($queryString);\n\t\n\tif(mysql_num_rows($query) > 0)\n\t{\n\t\t$row=mysql_fetch_assoc($query);\n\t\t$retval=explode(\"','\",preg_replace(\"/(enum|set)\\('(.+?)'\\)/\",\"\\\\2\",$row['Type']));\n\t\t$default = $row['Default'];\t// Default is passed by reference offset 4 of the row array is the default value\n\t\t\t\t\t\t\t\t\t\t\t\t // of the enumerated field\n\t}\t\n\t\n\tmysql_freeresult($query);\n\n\t\n\treturn $retval;\n\t\t\n}", "public abstract function matches($value);", "private function checkEnum(FilterField $filterFieldDefinition, $filter): bool\n {\n if (count($filter->enum) < 1) {\n // no enum criteria for this filter, comparison allowed; everything is fine\n return true;\n }\n\n $filterValue = $filterFieldDefinition->getValue();\n if (is_array($filterValue)) {\n // supplied filter has multiple values; check if all of them are allowed\n foreach ($filterValue as $value) {\n if (!in_array($value, $filter->enum)) {\n // exit on first invalid value\n return false;\n }\n }\n\n // arriving here, the loop above encountered valid values only\n return true;\n }\n\n // supplied filter has only one value; check if it's an allowed value\n return in_array($filterValue, $filter->enum);\n }", "protected function isKeyedEnum(string $field, $key)\n {\n return in_array($key, array_keys(static::getEnum($field)), true);\n }", "static public function isEnumValue ($value) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:461: characters 3-31\n\t\treturn ($value instanceof HxEnum);\n\t}", "function get_enum_values($table_name, $column_name) {\n\tglobal $cxn;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\t$enum_values = NULL;\n\t\n\ttry {\n\t\t$sqlString = \"\n\t\t\t\tSELECT COLUMN_TYPE\n\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS\n\t\t\t\tWHERE TABLE_NAME = '\" . $cxn->real_escape_string($table_name) . \"' AND\n\t\t\t\t\t\tCOLUMN_NAME = '\" . $cxn->real_escape_string($column_name) . \"'\n\t\t\t\t\t\t\t\t\";\n\t\t\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t/* Bind results to variables */\n\t\t$stmt->bind_result($row);\n\t\t$stmt->fetch();\n\t\t\n\t\t$enum_values = explode(\",\", str_replace(\"'\", \"\", substr($row, 5, (strlen($row)-6))));\n\t\tsort($enum_values);\n\t\t\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting enumeration list, table: \" . $table_name . \" column: \" . $column_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\t//\n\treturn array($errArr, $enum_values);\n}", "function db_enum($_table,$_field,$_type=\"select\",$_pick=null,$_isnull=null,$_style=NULL) {\n\t$_render = \"\";\n\t$_result = mysql_query(\"describe $_table $_field\");\n $_row = mysql_fetch_array($_result); \n $_value = $_row[\"Type\"];\n\tmysql_free_result($_result);\n preg_match_all(\"/'([^']+)'/\", $_value, $_matches, PREG_SET_ORDER); \n\t$_count = count($_matches);\n\t\t\n\tif ($_type == \"array\") {\t\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render[$_v[1]] = $_v[1];\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"checkbox\") {\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<input type=\"checkbox\" name=\"'.$_field.'[]\" value=\"'.$_v[1].'\" id=\"'.$_field.'_'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' checked'; }\t\t\n\t\t\t$_render .= ' /><label for=\"'.$_field.'_'.$_v[1].'\" class=\"checkbox\">'.$_v[1].'</label>\n\t\t\t'; \n\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"radio\") {\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<input type=\"radio\" name=\"'.$_field.'\" value=\"'.$_v[1].'\" id=\"'.$_field.'_'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' checked'; }\n\t\t\t$_render .= ' /><label for=\"'.$_field.'_'.$_v[1].'\" class=\"radio\">'.$_v[1].' </label>\n\t\t\t';\t\t\t\n\t\t\t}\n\t\t} \n\telseif ($_type == \"select\") {\n\t\t// insert a blank option (or allow blank option is no option is previously select)\n\t\tif ($_isnull && !isset($_pick)) {\n\t\t\t$_render .= '<option value=\"\"></option>\n\t\t\t';\n\t\t\t}\n\t\tforeach($_matches as $_v) {\t\n\t\t\t$_render .= '<option value=\"'.$_v[1].'\"';\n\t\t\tif ($_v[1] == $_pick) { $_render .= ' selected'; }\n\t\t\t$_render .= '>'.$_v[1].'</option>\n\t\t\t'; \n\t\t\t}\n\t\t$_render = '<select name=\"'.$_field.'\" '.$_style.'>'.$_render.'</select>\n\t\t';\n\t\t}\n\t\n\treturn $_render;\n\tunset($_table,$_where,$_query,$_result,$_row,$_v,$_value,$_matches,$_render,$_count,$_isnull);\n\t}", "public function devuelveENUM($table, $column)\r\n {\r\n $enum = $this->find_by_sql(\"SHOW COLUMNS FROM $table LIKE '$column'\");\r\n preg_match_all(\"/'([\\w ]*)'/\", $enum->Type, $values);\r\n $miarray = array(NULL=>'-- Seleccione --');\r\n foreach($values[1] as $indice=>$valor) {\r\n $miarray[$valor] = $valor;\r\n// return $this->values = \"Indice: \".$pepe.\" Valor: \".$pepa.\"<br>\";\r\n }\r\n return $this->values = $miarray;\r\n }", "public function testIfWrongValueThrows() : void\n {\n\n $this->expectException(FieldValueInproperException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n\n // Test.\n $this->assertFalse($field->isValueValid('four'));\n }", "protected function _enumMatch(AbstractEnum $enum)\n {\n return $this instanceof static && $this->getValue() === $enum->getValue();\n }", "private function enumsHaveValues() : bool\n {\n foreach ($this->enums as $enum) {\n if ($enum->value !== null) {\n return true;\n }\n }\n\n return false;\n }", "public function hasValue(string $field): bool;", "function CampoEnum($tabla,$campo,$Comentario,$valor=\"\"){\n\t\t$sql = \"DESCRIBE $tabla $campo\";\n\t\t$result = mysql_query($sql);\n\t\techo \"\\t<tr><td>$Comentario</td>\\n\";\n\t\twhile ($ligne = mysql_fetch_array($result)) {\n\t\t\textract($ligne, EXTR_PREFIX_ALL, \"IN\");\n\t\t\tif (substr($IN_Type,0,4)=='enum'){\n\t\t\t\t$liste = substr($IN_Type,5,strlen($IN_Type));\n\t\t\t\t$liste = substr($liste,0,(strlen($liste)-2));\n\t\t\t\t$enums = explode(',',$liste);\n\t\t\t\tif (sizeof($enums)>0){\n\t\t\t\t\t\n\t\t\t\t\techo \"\\t<td><select name='$campo' >\\n\";\n\t\t\t\t\tfor ($i=0; $i<sizeof($enums);$i++){\n\t\t\t\t\t\t$elem = trim(strtr($enums[$i],\"'\",\" \"));\n\t\t\t\t\t\tif(trim($elem)==trim($valor))$seleccionar=\"selected\";\n\t\t\t\t\t \telse $seleccionar=\"\";\n\t\t\t\t\t\techo \"\\t\\t<option $seleccionar value='\".$elem.\"'>\".$elem.\"</option>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\techo \"\\t</select>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"\\t</td></tr>\\n\";\n\t}", "public function containsValue($value);", "public static function getEnumValues($DSN, $table, $column){\n\t\t/*\n\t\tif(isset($GLOBALS[\"getEnumValues\"][$TableName][$column])){\n\t\t\treturn $GLOBALS[\"getEnumValues\"][$TableName][$column];\n\t\t}\n\t\t*/\n\t\t$query = 'SHOW COLUMNS FROM '.$table.' LIKE \"'.$column.'\" ';\n\t\t\n\t\t#$result=mysql_query($query);\n\t\t$result = $GLOBALS[\"DATA_API\"]->retrieve($DSN, $query, $args=array('returnArray' => true));\n\t\t/*\n\t\tif($GLOBALS[\"J_Debug\"]){\n\t\t\t(mysql_error())? debugTrace(\"getEnumValues\",$query.'<br>'.mysql_error()): debugTrace(\"getEnumValues\",$query);\n\t\t}\n\t\t*/\n\t\t#if(mysql_num_rows($result)>0){\n\t\tif(count($result)>0){\n\t\t\t#$row=mysql_fetch_row($result);\n\t\t\t#$getEnumValues=explode('\",\"',preg_replace(\"/(enum|set)\\('(.+?)'\\)/\",\"\\\\2\",$row[1]));\n\t\t\t#$getEnumValues = $row[1];\n\t\t\t$getEnumValues = $result[0]['Type'];\n\t\t\t#echo 'row[0]'.$row[0].'<br>row[1]'.$row[1].'<br>row[2]'.$row[2].'<br>';;\n\t\t\t#echo __METHOD__.'@'.__LINE__.'<b>$result<pre>'.var_export($result, true).'</pre></b>';\n\t\t}\n\n\t\t#$getEnumValues = ;\n\t\t$getEnumValues = explode(\"','\",preg_replace(\"/(enum|set)\\('(.+?)'\\)/\",\"\\\\2\",stripslashes($getEnumValues)));\n\t\t/**/\n\n\t\t#$GLOBALS[\"getEnumValues\"][$TableName][$column] = $getEnumValues;\n\t\treturn $getEnumValues;\n\t}", "public function check_availability($table, $columnname, $value) {\n $this->db->select($columnname);\n $this->db->from($table);\n $this->db->where($columnname, $value);\n $result = $this->db->get();\n\n if ($result->num_rows() > 0) {\n // var_dump($result);die;\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public static function are_valid_enums($enum_property_list, $params){\n foreach ($enum_property_list as $item){\n $property = $item[\"property\"];\n $enum = $item[\"enum\"];\n if(isset($params[$property])){\n if(!Media::is_valid_enum($enum, $params[$property])){\n $http_response = HttpFailCodes::http_response_fail()->valid_enums;\n $http_response->message = \"Must choose a valid value for \" . $property . \".\";\n APIService::response_fail($http_response);\n }\n }\n }\n return true;\n }", "public function getEnumValues($table, $column)\n {\n // and run it above and then we'll need to do a little more manipulation to extract our enum\n // values.\n\n $this->resetQuery();\n $results = $this->runQuery(\"SHOW COLUMNS FROM $table LIKE '$column'\");\n if($results === false) return false;\n\n // the first index of the $results is the structure of our enum column. it's in the form of\n // enum('a','b','c',...,'z'). we want to extract those values as an array and, to do that, we\n // can use some string replacements and an explode.\n\n $results = $results->fetch_row();\n $results = str_replace(\"'\", \"\", str_replace(\"enum(\", \"\", substr($results[1], 0, strlen($results[1])-1)));\n $results = explode(\",\", $results);\n sort($results);\n\n return $results;\n }", "public function isValidEnumValue($checkValue)\n {\n $reflector = new ReflectionClass(get_class($this));\n foreach ($reflector->getConstants() as $validValue)\n {\n if(is_string($checkValue) && is_string($validValue) \n && !strcasecmp($checkValue, $validValue)) {\n return true;\n }\n else if ($validValue == $checkValue) {\n return true;\n }\n } \n return false;\n }", "public static function IsDefined($enumType, $value) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n The type of value is an enumeration, but it is not an enumeration of type enumType.\r\n -or-\r\n The type of value is not an underlying type of enumType.\r\n * \r\n InvalidOperationException\r\n value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64, or String.\r\n */\r\n }", "final public function isEnum():bool\n {\n return $this->mode === 'enum';\n }", "public static function valueIsValid($_value)\r\n\t{\r\n\t\treturn in_array($_value,array(PayPalEnumUnitCodeType::VALUE_KG,PayPalEnumUnitCodeType::VALUE_LBS,PayPalEnumUnitCodeType::VALUE_OZ,PayPalEnumUnitCodeType::VALUE_CM,PayPalEnumUnitCodeType::VALUE_INCHES,PayPalEnumUnitCodeType::VALUE_FT,PayPalEnumUnitCodeType::VALUE_CUSTOMCODE));\r\n\t}", "public function validateEnum($data, $schema, $path)\n {\n if (!isset($schema->enum)) {\n return;\n }\n\n // if $data comes from an array than the action below has already been done in validateArray()\n $needle = (isset($schema->caseSensitive) && !$schema->caseSensitive) ? strtolower($data) : $data;\n $haystack = (isset($schema->caseSensitive) && !$schema->caseSensitive) ? array_map('strtolower', $schema->enum) : $schema->enum;\n\n if (!in_array($needle, $haystack)) {\n\n $this->addError(\n ValidateException::ERROR_USER_ENUM_NEEDLE_NOT_FOUND_IN_HAYSTACK,\n [$path, $data, $this->conjugationObject(count($schema->enum), 'this specific value', 'one of these values'), implode('\\', \\'', $schema->enum)]\n );\n }\n }", "public function match($value);", "public static function getEnumValues($table, $column) {\n $type = DB::select(DB::raw(\"SHOW COLUMNS FROM $table WHERE Field = '{$column}'\"))[0]->Type ;\n preg_match('/^enum\\((.*)\\)$/', $type, $matches);\n $enum = array();\n foreach( explode(',', $matches[1]) as $value )\n {\n $v = trim( $value, \"'\" );\n $enum = array_add($enum, $v, $v);\n }\n return $enum;\n }", "public function validateType(GDT_Form $form, GDT $field, $value)\n\t{\n\t if ($user = GDO_User::getByLogin($value))\n\t {\n\t if (!$user->isMember())\n\t {\n \t return $field->error('err_user_type', [t('enum_member')]);\n\t }\n\t }\n\t return true;\n\t}", "function exists_in_table($table, $field, $val)\n {\n $ret = '';\n $res = $this->db->get($table)->result_array();\n foreach ($res as $row) {\n if ($row[$field] == $val) {\n $ret = $row[$table . '_id'];\n }\n }\n if ($ret == '') {\n return false;\n } else {\n return $ret;\n }\n \n }", "public function getRule()\n {\n $field = $this->getField();\n\n if ($field instanceof EnumField) {\n return function ($name, $value) use ($field): bool {\n return $field->has($value);\n };\n }\n\n return 'exists:'.$this->getField()->getMeta()->getTableName().','.$this->getField()->getNative();\n }", "abstract protected function getSupportedEnumType() : string;", "function PMA_isTablefieldChar($field)\n{\n // If check to ensure types such as \"enum('one','two','char',..)\" or\n // \"enum('one','two','varchar',..)\" are not categorized as char.\n if (stripos($field['Type'], 'char') === 0\n || stripos($field['Type'], 'varchar') === 0\n ) {\n return stristr($field['Type'], 'char');\n } else {\n return false;\n }\n}", "function is_enum(mixed $var): bool\n{\n return is_object($var) && enum_exists($var::class, false);\n}", "public static function getEnumValues($table, $column) {\n $type = DB::select(DB::raw(\"SHOW COLUMNS FROM $table WHERE Field = '{$column}'\"))[0]->Type ;\n preg_match('/^enum\\((.*)\\)$/', $type, $matches);\n $enum = array();\n foreach( explode(',', $matches[1]) as $value ) {\n $v = trim( $value, \"'\" );\n $enum = array_add($enum, $v, $v);\n }\n return $enum;\n }", "public function isEnumCastable($key)\n {\n if (!\\array_key_exists($key, $this->casts ?? [])) {\n return false;\n }\n $castType = $this->casts[$key];\n if (null !== $this->getCastType($key)) {\n return false;\n }\n if (\\is_string($castType) && \\function_exists('enum_exists') && enum_exists($castType)) {\n return true;\n }\n\n return false;\n }", "public function checkForField( $field, $table );", "function _valid_match($field, $param = array())\r\n\t{\r\n\t\treturn in_array($this->{$field}, $param);\r\n\t}", "public static function valueIsValid($_value)\r\n\t{\r\n\t\treturn in_array($_value,array(EbayShoppingEnumTradingRoleCodeType::VALUE_BUYER,EbayShoppingEnumTradingRoleCodeType::VALUE_SELLER,EbayShoppingEnumTradingRoleCodeType::VALUE_CUSTOMCODE));\r\n\t}", "function _sf_dropdown_value_exists($post_id, $field_id) {\n\t\t\n\t\t///// GETS VALUES\n\t\tif($field = get_post($post_id)) {\n\t\t\t\n\t\t\t///// WE CAN GET VALUES\n\t\t\tif(get_post_meta($post_id, 'dropdown_values', true) != '') {\n\t\t\t\t\n\t\t\t\t$values = json_decode(htmlspecialchars_decode(get_post_meta($post_id, 'dropdown_values', true)));\n\t\t\t\t\n\t\t\t\t//// IF ITS AN OBJECT\n\t\t\t\tif(is_object($values)) {\n\t\t\t\t\t\n\t\t\t\t\tforeach($values as $val) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t///// IF VALUE EXISTS\n\t\t\t\t\t\tif($val->id == $field_id) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}", "abstract public function getIsValidValue($value);", "function match($field, $value);", "public static function getEnumValues($column) \n {\n // Create an instance of the model to be able to get the table name\n $instance = new static;\n\n // Pulls column string from DB\n $enumStr = DB::select(DB::raw('SHOW COLUMNS FROM '.$instance->getTable().' WHERE Field = \"'.$column.'\"'))[0]->Type;\n\n // Parse string\n preg_match_all(\"/'([^']+)'/\", $enumStr, $matches);\n\n // Return matches\n return isset($matches[1]) ? $matches[1] : [];\n }", "function exists_in_table($table, $field, $val)\n {\n $ret = '';\n $res = $this->db->get($table)->result_array();\n foreach ($res as $row) {\n if ($row[$field] == $val) {\n $ret = $row[$table . '_id'];\n }\n }\n if ($ret == '') {\n return false;\n } else {\n return $ret;\n }\n\n }", "function PMA_isTableFieldBinary($field)\n{\n // The type column.\n // Fix for bug #3152931 'ENUM and SET cannot have \"Binary\" option'\n // If check to ensure types such as \"enum('one','two','binary',..)\" or\n // \"enum('one','two','varbinary',..)\" are not categorized as binary.\n if (stripos($field['Type'], 'binary') === 0\n || stripos($field['Type'], 'varbinary') === 0\n ) {\n return stristr($field['Type'], 'binary');\n } else {\n return false;\n }\n\n}", "public function useEnumValues(): bool\n {\n return $this->useEnumValues;\n }", "function matchField($value, $params = array()) {\n\t\tif ($this->data[$this->name][$params['field1']] != $this->data[$this->name][$params['field2']]) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function is(UnitEnum|string|int $enumValue): bool\n {\n if ($enumValue instanceof UnitEnum) {\n return $this === $enumValue;\n }\n\n return $this === self::tryFrom($enumValue);\n }", "function is_exists_s_atribute_type_lookup($s_attribute_type, $value) {\n\t$query = \"SELECT 'x' FROM s_attribute_type_lookup WHERE s_attribute_type = '\" . $s_attribute_type . \"' AND value = '$value'\";\n\n\t$result = db_query($query);\n\tif ($result && db_num_rows($result) > 0) {\n\t\tdb_free_result($result);\n\t\treturn TRUE;\n\t}\n\n\t//else\n\treturn FALSE;\n}", "function dataVerification($fieldName=null,$value=null,$tableName){\r\n\t\tif($fieldName==\"\") return false;\r\n\t\tif($value==\"\") return false;\r\n\t\t\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array(\"$fieldName\"=>$value));\r\n\t\t$this->db->where(array('is_active'=>true));\r\n\t\t$recordSet = $this->db->get($tableName);\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n \t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "final public function is($enum): bool\n {\n return $enum instanceof static && $enum->value === $this->value;\n }", "abstract protected function isValidValue($value);", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_CONTACT,self::VALUE_REGISTERED,self::VALUE_CUSTOMCODE));\n\t}", "public static function getEnumValues($table, $column) {\n $type = DB::select(DB::raw(\"SHOW COLUMNS FROM $table WHERE Field = '$column'\"))[0]->Type;\n preg_match('/^enum\\((.*)\\)$/', $type, $matches);\n $enum = array();\n foreach (explode(',', $matches[1]) as $value) {\n $v = trim($value, \"'\");\n $enum = array_add($enum, $v, $v);\n }\n return $enum;\n }", "function query_Registro($table, $field, $val) {\n\t\t\t$sql_Select = \"SELECT * FROM \" .$table. \" WHERE \" . $field. \" = '\" .$val. \"'\";\n\t\t\t$res = $this->conn->query($sql_Select);\n\t\t\t$exist = mysqli_fetch_array($res);\n\t\t\treturn $exist;\n\t\t\t$this->conn->close();\n\t\t}", "function check_exits_idField($code,$field, $table, &$db)\n{\n\n\t$sql_check = \"SELECT * FROM \".$table.\" WHERE `\".$field.\"` = '\".$code.\"'\";\n\t$sql_check = $db->sql_query($sql_check) or die(mysql_error());\n\t$exits \t = $db->sql_fetchfield(0);\n\tif($exits)return true;\n\telse return false;\n}", "static public function Enum ( $var, $allowed ) { return in_array( $var, $allowed ) ? $var : false; }", "public function attributeEnumOptions($name)\r\n\t{\r\n preg_match('/\\((.*)\\)/',$this->tableSchema->columns[$name]->dbType,$matches);\r\n foreach(explode(',', $matches[1]) as $value)\r\n {\r\n $value=str_replace(\"'\",null,$value);\r\n $values[$value]=Yii::t('enumItem',$value);\r\n }\r\n\r\n return $values;\r\n\t}", "protected function hasEnumProperty(string $field)\n {\n $property = $this->getEnumProperty($field);\n\n return isset($this->$property) && is_array($this->$property);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_CREATED,self::VALUE_DROPPEDOFF,self::VALUE_INTRANSIT,self::VALUE_DELIVERED,self::VALUE_RETURNED,self::VALUE_CANCELED,self::VALUE_LABELPRINTED,self::VALUE_UNCONFIRMED,self::VALUE_UNKNOWN,self::VALUE_ERROR,self::VALUE_CUSTOMCODE));\n\t}", "public function equal(self $enum): bool\n {\n return $this->value() === $enum->value();\n }", "abstract protected function checkValue( &$value );", "public function matchDataType($value, $type) {\n $match = FALSE;\n\n // Type is an array, then a list of acceptable value must be checked.\n if (is_array($type)) {\n $options = $type;\n $type = 'options';\n }\n\n switch($type) {\n case 'int':\n // Single value, of type integer. Including 0.\n if (is_numeric($value) && $value >= 0) {\n // Paging starts at 0, include 0.\n $match = TRUE;\n }\n\n break;\n\n case 'text':\n // Single value, text value.\n if (is_string($value)) {\n $match = TRUE;\n\n if ($match && !empty($value)) {\n // See if text is longer than 15 chars.\n $match = FALSE;\n\n if (strlen($value) <= 150) {\n $match = TRUE;\n }\n }\n }\n\n break;\n\n case 'year':\n // Four digit year YYYY.\n if (preg_match('/^[0-9]{4}$/', $value)) {\n // ie: 1979, 2000\n $match = TRUE;\n }\n\n break;\n\n case 'boolean':\n // Boolean true or false only.\n if (id_bool($value)) {\n // TRUE or FALSE.\n $match = TRUE;\n }\n\n break;\n\n case 'hash-code':\n // Single value, alphanumeric value matching a pattern.\n if (preg_match('/^\\w{5}-{1}\\w{5}-{1}\\w{5}-{1}\\w{5}-{1}\\w{5}$/', $value)) {\n // ie: ZovDs-BCDB9-P5QSP-6DSDx-Myisv\n $match = TRUE;\n }\n\n break;\n\n case 'array-text':\n // Array of string, where each element is of type text.\n if (is_array($value)) {\n $match = TRUE;\n foreach($value as $i => $item) {\n if (is_array($item)) {\n foreach($item as $item_value) {\n // Use the text condition of this method.\n $is_valid = $this->matchDataType($item_value, 'text');\n if ($is_valid) {\n $match = FALSE;\n break 2;\n }\n }\n }\n }\n }\n\n break;\n\n case 'array-int':\n // Array of string, where each element is of type integer.\n if (is_array($value)) {\n $match = TRUE;\n foreach($value as $i => $item) {\n if (is_array($item)) {\n foreach($item as $item_value) {\n // Use the int condition of this method.\n $is_valid = $this->matchDataType($item_value, 'int');\n if ($is_valid) {\n $match = FALSE;\n break 2;\n }\n }\n }\n }\n }\n\n break;\n\n case 'asc/desc':\n // Sort order asc for ascending order and desc for descending order.\n if ($value == 'asc' || $value == 'desc') {\n $match = TRUE;\n }\n\n break;\n\n case 'options':\n // Value must be one of the enumerated values.\n if (in_array($value, $options)) {\n $match = TRUE;\n }\n\n break;\n\n case 'datetime':\n // Value must be a date and time YYYY-MM-DD 00:00\n if (preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})$/', $value, $x)) {\n $match = TRUE;\n }\n\n break;\n }\n\n return $match;\n }", "function ProcessEnumList($Name, $ValidValues, $List) //Check enum values and return as stringified list\n{\n\tif(is_string($List)) //Turn a string into an array with 1 item\n\t\t$List=Array($List);\n\tif(count(array_intersect($List, $ValidValues))==count($List)) //If all items are valid, return the stringified list\n\t\treturn implode(',', $List);\n\texit('Invalid values in \"'.$Name.'\" enum: '.implode(', ', $List));\n}", "private function conditional_hit_type($field, $value) {\n\n\t\tswitch ($field) {\n\n\t\t\tcase 't':\n\t\t\t\tif ($value == 'event') {\n\t\t\t\t\t$this->add_mandatory_parameter('ec');\n\t\t\t\t\t$this->add_mandatory_parameter('ea');\n\t\t\t\t}\n\t\t\t\tif ($value == 'screenview')\n\t\t\t\t\t$this->add_mandatory_parameter('sn');\n\t\t\t\tbreak;\n\n\t\t\tcase 'qt':\n\t\t\t\tif ($value > $this->_qt_max) {\n\t\t\t\t\techo \"qt is too high </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n//We assume that wci means wui in the spec\n\t\t\tcase 'wui':\n\t\t\t\t$userList = new UserList;\n\t\t\t\tif (!in_array($value, $userList->get_userlist())) {\n\t\t\t\t\techo \"User unknown </br>\\n\";\n\t\t\t\t\treturn False;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn True;\n\t}", "public function hasValue($name);", "public function match(mixed $value);", "function validation()\n{\n $getval = mysql_fetch_array(mysql_query(\"SELECT value FROM ibwf_settings WHERE name='vldtn'\"));\n if($getval[0]=='1')\n {\n return true;\n }else\n {\n return false;\n }\n}", "public function testValueIsCorrect()\n {\n $init = 'test';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }", "public function in($column,$val);", "public static function randomEnum(string $field)\n {\n if ($array = static::getEnum($field)) {\n return Arr::random($array);\n }\n\n return false;\n }", "abstract public function checkValueType($arg_value);", "abstract protected function validateValue($value);", "public function check_availability_with_id($table, $columnname, $value, $where, $id) {\n $this->db->select($columnname);\n $this->db->from($table);\n $this->db->where($columnname, $value);\n $this->db->where($where, $id);\n $result = $this->db->get();\n\n if ($result->num_rows() > 0) {\n // var_dump($result);die;\n return TRUE;\n } else {\n return FALSE;\n }\n }", "protected function enumCheck(array $specificationValue, mixed $jsonKey, mixed $jsonValue): void{\n if(!in_array($jsonValue, $specificationValue)){\n $this->errorMessage = \"Data provided in field `{$jsonKey}` is not within the allowed parameters.\";\n }\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_LISTINGDURATIONS,self::VALUE_BESTOFFERENABLED,self::VALUE_DUTCHBINENABLED,self::VALUE_SHIPPINGTERMSREQUIRED,self::VALUE_USERCONSENTREQUIRED,self::VALUE_HOMEPAGEFEATUREDENABLED,self::VALUE_ADFORMATENABLED,self::VALUE_DIGITALDELIVERYENABLED,self::VALUE_BESTOFFERCOUNTERENABLED,self::VALUE_BESTOFFERAUTODECLINEENABLED,self::VALUE_PROPACK,self::VALUE_BASICUPGRADEPACK,self::VALUE_VALUEPACK,self::VALUE_PROPACKPLUS,self::VALUE_LOCALMARKETSPECIALITYSUBSCRIPTION,self::VALUE_LOCALMARKETREGULARSUBSCRIPTION,self::VALUE_LOCALMARKETPREMIUMSUBSCRIPTION,self::VALUE_LOCALMARKETNONSUBSCRIPTION,self::VALUE_EXPRESSENABLED,self::VALUE_EXPRESSPICTURESREQUIRED,self::VALUE_EXPRESSCONDITIONREQUIRED,self::VALUE_SELLERCONTACTDETAILSENABLED,self::VALUE_CUSTOMCODE,self::VALUE_MINIMUMRESERVEPRICE,self::VALUE_TRANSACTIONCONFIRMATIONREQUESTENABLED,self::VALUE_STOREINVENTORYENABLED,self::VALUE_LOCALLISTINGDISTANCES,self::VALUE_SKYPEMETRANSACTIONALENABLED,self::VALUE_SKYPEMENONTRANSACTIONALENABLED,self::VALUE_CLASSIFIEDADPAYMENTMETHODENABLED,self::VALUE_CLASSIFIEDADSHIPPINGMETHODENABLED,self::VALUE_CLASSIFIEDADBESTOFFERENABLED,self::VALUE_CLASSIFIEDADCOUNTEROFFERENABLED,self::VALUE_CLASSIFIEDADAUTODECLINEENABLED,self::VALUE_CLASSIFIEDADCONTACTBYEMAILENABLED,self::VALUE_CLASSIFIEDADCONTACTBYPHONEENABLED,self::VALUE_SAFEPAYMENTREQUIRED,self::VALUE_MAXIMUMBESTOFFERSALLOWED,self::VALUE_CLASSIFIEDADMAXIMUMBESTOFFERSALLOWED,self::VALUE_CLASSIFIEDADCONTACTBYEMAILAVAILABLE,self::VALUE_CLASSIFIEDADPAYPERLEADENABLED,self::VALUE_ITEMSPECIFICSENABLED,self::VALUE_PAISAPAYFULLESCROWENABLED,self::VALUE_ISBNIDENTIFIERENABLED,self::VALUE_UPCIDENTIFIERENABLED,self::VALUE_EANIDENTIFIERENABLED,self::VALUE_BRANDMPNIDENTIFIERENABLED,self::VALUE_CLASSIFIEDADAUTOACCEPTENABLED,self::VALUE_BESTOFFERAUTOACCEPTENABLED,self::VALUE_CROSSBORDERTRADEENABLED,self::VALUE_PAYPALBUYERPROTECTIONENABLED,self::VALUE_BUYERGUARANTEEENABLED,self::VALUE_INESCROWWORKFLOWTIMELINE,self::VALUE_COMBINEDFIXEDPRICETREATMENT,self::VALUE_GALLERYFEATUREDDURATIONS,self::VALUE_PAYPALREQUIRED,self::VALUE_EBAYMOTORSPROADFORMATENABLED,self::VALUE_EBAYMOTORSPROCONTACTBYPHONEENABLED,self::VALUE_EBAYMOTORSPROCONTACTBYADDRESSENABLED,self::VALUE_EBAYMOTORSPROCOMPANYNAMEENABLED,self::VALUE_EBAYMOTORSPROCONTACTBYEMAILENABLED,self::VALUE_EBAYMOTORSPROBESTOFFERENABLED,self::VALUE_EBAYMOTORSPROAUTOACCEPTENABLED,self::VALUE_EBAYMOTORSPROAUTODECLINEENABLED,self::VALUE_EBAYMOTORSPROPAYMENTMETHODCHECKOUTENABLED,self::VALUE_EBAYMOTORSPROSHIPPINGMETHODENABLED,self::VALUE_EBAYMOTORSPROCOUNTEROFFERENABLED,self::VALUE_EBAYMOTORSPROSELLERCONTACTDETAILSENABLED,self::VALUE_LOCALMARKETADFORMATENABLED,self::VALUE_LOCALMARKETCONTACTBYPHONEENABLED,self::VALUE_LOCALMARKETCONTACTBYADDRESSENABLED,self::VALUE_LOCALMARKETCOMPANYNAMEENABLED,self::VALUE_LOCALMARKETCONTACTBYEMAILENABLED,self::VALUE_LOCALMARKETBESTOFFERENABLED,self::VALUE_LOCALMARKETAUTOACCEPTENABLED,self::VALUE_LOCALMARKETAUTODECLINEENABLED,self::VALUE_LOCALMARKETPAYMENTMETHODCHECKOUTENABLED,self::VALUE_LOCALMARKETSHIPPINGMETHODENABLED,self::VALUE_LOCALMARKETCOUNTEROFFERENABLED,self::VALUE_LOCALMARKETSELLERCONTACTDETAILSENABLED,self::VALUE_CLASSIFIEDADCONTACTBYADDRESSENABLED,self::VALUE_CLASSIFIEDADCOMPANYNAMEENABLED,self::VALUE_SPECIALITYSUBSCRIPTION,self::VALUE_REGULARSUBSCRIPTION,self::VALUE_PREMIUMSUBSCRIPTION,self::VALUE_NONSUBSCRIPTION,self::VALUE_INTANGIBLEENABLED,self::VALUE_PAYPALREQUIREDFORSTOREOWNER,self::VALUE_REVISEQUANTITYALLOWED,self::VALUE_REVISEPRICEALLOWED,self::VALUE_STOREOWNEREXTENDEDLISTINGDURATIONSENABLED,self::VALUE_STOREOWNEREXTENDEDLISTINGDURATIONS,self::VALUE_RETURNPOLICYENABLED,self::VALUE_HANDLINGTIMEENABLED,self::VALUE_PAYMENTMETHODS,self::VALUE_MAXFLATSHIPPINGCOST,self::VALUE_MAXFLATSHIPPINGCOSTCBTEXEMPT,self::VALUE_GROUP1MAXFLATSHIPPINGCOST,self::VALUE_GROUP2MAXFLATSHIPPINGCOST,self::VALUE_GROUP3MAXFLATSHIPPINGCOST,self::VALUE_VARIATIONSENABLED,self::VALUE_ATTRIBUTECONVERSIONENABLED,self::VALUE_FREEGALLERYPLUSENABLED,self::VALUE_FREEPICTUREPACKENABLED,self::VALUE_COMPATIBILITYENABLED,self::VALUE_MINCOMPATIBLEAPPLICATIONS,self::VALUE_MAXCOMPATIBLEAPPLICATIONS,self::VALUE_CONDITIONENABLED,self::VALUE_CONDITIONVALUES,self::VALUE_VALUECATEGORY,self::VALUE_PRODUCTCREATIONENABLED,self::VALUE_MAXGRANULARFITMENTCOUNT,self::VALUE_COMPATIBLEVEHICLETYPE,self::VALUE_PAYMENTOPTIONSGROUP,self::VALUE_SHIPPINGPROFILECATEGORYGROUP,self::VALUE_PAYMENTPROFILECATEGORYGROUP,self::VALUE_RETURNPOLICYPROFILECATEGORYGROUP,self::VALUE_VINSUPPORTED,self::VALUE_VRMSUPPORTED,self::VALUE_SELLERPROVIDEDTITLESUPPORTED,self::VALUE_DEPOSITSUPPORTED));\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NAME,self::VALUE_INTERIMENDINGDATE,self::VALUE_DATEPRELIMINARYDATALOADED,self::VALUE_EARNINGSPERIODINDICATOR,self::VALUE_QUARTERLYINDICATOR,self::VALUE_BASICEARNINGSINDICATOR,self::VALUE_TEMPLATEINDICATOR,self::VALUE_PRELIMINARYFULLCONTEXTINDICATOR,self::VALUE_PROJECTEDFISCALYEARENDDATE,self::VALUE_NUMBEROFMONTHSSINCELASTREPORTINGPERIOD,self::VALUE_OPERATINGREVENUE,self::VALUE_TOTALREVENUE,self::VALUE_ADJUSTMENTSTOREVENUE,self::VALUE_COSTOFSALES,self::VALUE_COSTOFSALESWITHDEPRECIATION,self::VALUE_GROSSMARGIN,self::VALUE_GROSSOPERATINGPROFIT,self::VALUE_RESEARCHANDDEVELOPMENTEXPENSES,self::VALUE_SELLINGGENERALANDADMINISTRATIVEEXPENSES,self::VALUE_ADVERTISINGEXPENSES,self::VALUE_OPERATINGINCOME,self::VALUE_OPERATINGINCOMEBEFOREDEPRECIATION,self::VALUE_DEPRECIATION,self::VALUE_DEPRECIATIONUNRECONCILED,self::VALUE_AMORTIZATION,self::VALUE_AMORTIZATIONOFINTANGIBLES,self::VALUE_OPERATINGINCOMEAFTERDEPRECIATION,self::VALUE_INTERESTINCOME,self::VALUE_EARNINGSFROMEQUITYINTEREST,self::VALUE_NETOTHERINCOME,self::VALUE_INCOMEACQUIREDINPROCESSRANDD,self::VALUE_INCOMERESTRUCTURINGANDMANDA,self::VALUE_OTHERSPECIALCHARGES,self::VALUE_SPECIALINCOMECHARGES,self::VALUE_TOTALINCOMEAVAILABLEFORINTERESTEXPENSE,self::VALUE_INTERESTEXPENSE,self::VALUE_PRETAXINCOME,self::VALUE_INCOMETAXES,self::VALUE_MINORITYINTEREST,self::VALUE_PREFERREDSECURITIESOFSUBSIDIARYTRUST,self::VALUE_INCOMEBEFOREINCOMETAXES,self::VALUE_NETINCOMEFROMCONTINUINGOPERATIONS,self::VALUE_NETINCOMEFROMDISCONTINUEDOPERATIONS,self::VALUE_NETINCOMEFROMTOTALOPERATIONS,self::VALUE_EXTRAORDINARYINCOMELOSSES,self::VALUE_INCOMEFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_INCOMEFROMTAXLOSSCARRYFORWARD,self::VALUE_OTHERGAINSANDLOSSES,self::VALUE_TOTALNETINCOME,self::VALUE_NORMALIZEDINCOME,self::VALUE_NETINCOMEAVAILABLEFORCOMMON,self::VALUE_PREFERREDDIVIDENDS,self::VALUE_EXCISETAXES,self::VALUE_BASICEPSFROMCONTINUINGOPERATIONS,self::VALUE_BASICEPSFROMDISCONTINUEDOPERATIONS,self::VALUE_BASICEPSFROMTOTALOPERATIONS,self::VALUE_BASICEPSFROMEXTRAORDINARYINCOME,self::VALUE_BASICEPSFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_BASICEPSFROMTAXLOSSCARRYFORWARDS,self::VALUE_BASICEPSFROMOTHERGAINSANDLOSSES,self::VALUE_BASICEPSTOTAL,self::VALUE_BASICNORMALIZEDNETINCOMESHARE,self::VALUE_DILUTEDEPSFROMCONTINUINGOPERATIONS,self::VALUE_DILUTEDEPSFROMDISCONTINUEDOPERATIONS,self::VALUE_DILUTEDEPSFROMTOTALOPERATIONS,self::VALUE_DILUTEDEPSFROMEXTRAORDINARYINCOME,self::VALUE_DILUTEDEPSFROMCUMMULATEDEFFECTOFACCOUNTINGCHANGES,self::VALUE_DILUTEDEPSFROMTAXLOSSCARRYFORWARD,self::VALUE_DILUTEDEPSFROMOTHERGAINSANDLOSSES,self::VALUE_DILUTEDEPSTOTAL,self::VALUE_DILUTEDNORMALIZEDNETINCOMESHARE,self::VALUE_DIVIDENDSPAIDPERSHARE,self::VALUE_REVENUESYEARTODATE,self::VALUE_INCOMEYEARTODATEFROMTOTALOPERATIONS,self::VALUE_DILUTEDEPSYEARTODATEFROMTOTALOPERATIONS,self::VALUE_DIVIDENDSPAIDPERSHAREYEARTODATE,self::VALUE_CASHANDEQUIVALENTS,self::VALUE_RESTRICTEDCASH,self::VALUE_MARKETABLESECURITIES,self::VALUE_ACCOUNTSRECEIVABLE,self::VALUE_LOANSRECEIVABLE,self::VALUE_OTHERRECEIVABLE,self::VALUE_RECEIVABLES,self::VALUE_RAWMATERIALS,self::VALUE_WORKINPROGRESS,self::VALUE_PURCHASEDCOMPONENTS,self::VALUE_FINISHEDGOODS,self::VALUE_OTHERINVENTORIES,self::VALUE_INVENTORIESADJUSTMENTSANDALLOWANCES,self::VALUE_INVENTORIES,self::VALUE_PREPAIDEXPENSES,self::VALUE_CURRENTDEFERREDINCOMETAXES,self::VALUE_OTHERCURRENTASSETS,self::VALUE_TOTALCURRENTASSETS,self::VALUE_LANDANDIMPROVEMENTS,self::VALUE_BUILDINGANDIMPROVEMENTS,self::VALUE_MACHINERYFURNITUREANDEQUIPMENT,self::VALUE_CONSTRUCTIONINPROGRESS,self::VALUE_OTHERFIXEDASSETS,self::VALUE_TOTALFIXEDASSETS,self::VALUE_GROSSFIXEDASSETS,self::VALUE_ACCUMULATEDDEPRECIATIONANDDEPLETION,self::VALUE_NETFIXEDASSETS,self::VALUE_INTANGIBLES,self::VALUE_COSTINEXCESS,self::VALUE_NONCURRENTDEFERREDINCOMETAXES,self::VALUE_OTHERNONCURRENTASSETS,self::VALUE_TOTALNONCURRENTASSETS,self::VALUE_TOTALASSETS,self::VALUE_INVENTORYVALUATIONMETHOD,self::VALUE_ACCOUNTSPAYABLE,self::VALUE_NOTESPAYABLE,self::VALUE_SHORTTERMDEBT,self::VALUE_ACCRUEDEXPENSES,self::VALUE_ACCRUEDLIABILITIES,self::VALUE_DEFERREDREVENUES,self::VALUE_CURRENTDEFERREDINCOMETAXLIABILITIES,self::VALUE_OTHERCURRENTLIABILITIES,self::VALUE_TOTALCURRENTLIABILITIES,self::VALUE_LONGTERMDEBT,self::VALUE_CAPITALLEASEOBLIGATIONS,self::VALUE_DEFERREDINCOMETAXLIABILITIES,self::VALUE_OTHERNONCURRENTLIABILITIES,self::VALUE_MINORITYINTERESTLIABILITIES,self::VALUE_PREFERREDSECURITIESOFSUBSIDIARYTRUSTLIABILITIES,self::VALUE_PREFERREDEQUITYOUTSIDESTOCKEQUITY,self::VALUE_TOTALNONCURRENTLIABILITIES,self::VALUE_TOTALLIABILITIES,self::VALUE_PREFERREDSTOCKEQUITY,self::VALUE_COMMONSTOCKEQUITY,self::VALUE_COMMONPAR,self::VALUE_ADDITIONALPAIDINCAPITAL,self::VALUE_CUMULATIVETRANSLATIONADJUSTMENT,self::VALUE_RETAINEDEARNINGS,self::VALUE_TREASURYSTOCK,self::VALUE_OTHEREQUITYADJUSTMENTS,self::VALUE_TOTALCAPITALIZATION,self::VALUE_TOTALEQUITY,self::VALUE_TOTALLIABILITIESANDSTOCKEQUITY,self::VALUE_CASHFLOW,self::VALUE_WORKINGCAPITAL,self::VALUE_FREECASHFLOW,self::VALUE_INVESTEDCAPITAL,self::VALUE_SHARESOUTSTANDINGCOMMONCLASSONLY,self::VALUE_PREFERREDSHARES,self::VALUE_TOTALORDINARYSHARES,self::VALUE_TOTALCOMMONSHARESOUTSTANDING,self::VALUE_TREASURYSHARES,self::VALUE_BASICWEIGHTEDSHARESOUTSTANDING,self::VALUE_DILUTEDWEIGHTEDSHARESOUTSTANDING,self::VALUE_NUMBEROFEMPLOYEES,self::VALUE_NUMBEROFPARTTIMEEMPLOYEES,self::VALUE_NETINCOMEORLOSS,self::VALUE_DEPRECIATIONEXPENSES,self::VALUE_AMORTIZATIONEXPENSES,self::VALUE_AMORTIZATIONOFINTANGIBLESEXPENSES,self::VALUE_DEFERREDINCOMETAXES,self::VALUE_OPERATINGGAINSORLOSSES,self::VALUE_EXTRAORDINARYGAINSORLOSSES,self::VALUE_INCREASEORDECREASEINRECEIVABLES,self::VALUE_INCREASEORDECREASEININVENTORIES,self::VALUE_INCREASEORDECREASEINPREPAIDEXPENSES,self::VALUE_INCREASEORDECREASEINOTHERCURRENTASSETS,self::VALUE_INCREASEORDECREASEINPAYABLES,self::VALUE_INCREASEORDECREASEINOTHERCURRENTLIABILITIES,self::VALUE_INCREASEORDECREASEINOTHERWORKINGCAPITAL,self::VALUE_OTHERNONCASHITEMS,self::VALUE_NETCASHFROMCONTINUINGOPERATIONS,self::VALUE_NETCASHFROMDISCONTINUEDOPERATIONS,self::VALUE_NETCASHFROMOPERATINGACTIVITIES,self::VALUE_SALEOFPROPERTYPLANTANDEQUIPMENT,self::VALUE_SALEOFLONGTERMINVESTMENTS,self::VALUE_SALEOFSHORTTERMINVESTMENTS,self::VALUE_PURCHASEOFPROPERTYPLANTANDEQUIPMENT,self::VALUE_ACQUISITIONS,self::VALUE_PURCHASEOFLONGTERMINVESTMENTS,self::VALUE_PURCHASEOFSHORTTERMINVESTMENTS,self::VALUE_OTHERINVESTINGCHANGESNET,self::VALUE_CASHFROMDISCONTINUEDINVESTINGACTIVITIES,self::VALUE_NETCASHFROMINVESTINGACTIVITIES,self::VALUE_ISSUANCEOFDEBT,self::VALUE_ISSUANCEOFCAPITALSTOCK,self::VALUE_REPAYMENTOFDEBT,self::VALUE_REPURCHASEOFCAPITALSTOCK,self::VALUE_PAYMENTOFCASHDIVIDENDS,self::VALUE_NETOTHERFINANCINGCHARGES,self::VALUE_CASHFROMDISCONTINUEDFINANCINGACTIVITIES,self::VALUE_NETCASHFROMFINANCINGACTIVITIES,self::VALUE_EFFECTOFEXCHANGERATECHANGES,self::VALUE_NETCHANGEINCASHANDCASHEQUIVALENTS,self::VALUE_CASHATBEGINNINGOFPERIOD,self::VALUE_CASHATENDOFPERIOD,self::VALUE_FOREIGNSALES,self::VALUE_DOMESTICSALES,self::VALUE_AUDITORSNAME,self::VALUE_AUDITORSREPORT,self::VALUE_CLOSEPERATIO,self::VALUE_HIGHPERATIO,self::VALUE_LOWPERATIO,self::VALUE_GROSSPROFITMARGIN,self::VALUE_PRETAXPROFITMARGIN,self::VALUE_POSTTAXPROFITMARGIN,self::VALUE_NETPROFITMARGIN,self::VALUE_INTERESTCOVERAGEFROMCONTINUINGOPERATIONS,self::VALUE_INTERESTASAPERCENTAGEOFINVESTEDCAPITAL,self::VALUE_EFFECTIVETAXRATE,self::VALUE_INCOMEPEREMPLOYEE,self::VALUE_NORMALIZEDCLOSEPERATIO,self::VALUE_NORMALIZEDHIGHPERATIO,self::VALUE_NORMALIZEDLOWPERATIO,self::VALUE_NORMALIZEDNETPROFITMARGIN,self::VALUE_NORMALIZEDRETURNONSTOCKEQUITY,self::VALUE_NORMALIZEDRETURNONASSETS,self::VALUE_NORMALIZEDRETURNONINVESTEDCAPITAL,self::VALUE_NORMALIZEDINCOMEPEREMPLOYEE,self::VALUE_QUICKRATIO,self::VALUE_CURRENTRATIO,self::VALUE_PAYOUTRATIO,self::VALUE_TOTALDEBTTOEQUITYRATIO,self::VALUE_LONGTERMDEBTTOTOTALCAPITAL,self::VALUE_LEVERAGERATIO,self::VALUE_ASSETTURNOVER,self::VALUE_CASHASAPERCENTAGEOFREVENUE,self::VALUE_RECEIVABLESASAPERCENTAGEOFREVENUE,self::VALUE_SGANDAEXPENSEASAPERCENTAGEOFREVENUE,self::VALUE_RANDDEXPENSEASAPERCENTAGEOFREVENUE,self::VALUE_REVENUEPERCASH,self::VALUE_REVENUEPERPLANT,self::VALUE_REVENUEPERCOMMONEQUITY,self::VALUE_REVENUEPERINVESTEDCAPITAL,self::VALUE_RECEIVABLETURNOVER,self::VALUE_INVENTORYTURNOVER,self::VALUE_RECEIVABLESPERDAYSALES,self::VALUE_SALESPERRECEIVABLES,self::VALUE_SALESPERINVENTORY,self::VALUE_REVENUETOASSETS,self::VALUE_NUMBEROFDAYSCOSTOFGOODSSOLDININVENTORY,self::VALUE_CURRENTASSETSPERSHARE,self::VALUE_TOTALASSETSPERSHARE,self::VALUE_INTANGIBLESASPERCENTAGEBOOKVALUE,self::VALUE_INVENTORYASPERCENTAGEREVENUE,self::VALUE_LONGTERMDEBTPERSHARE,self::VALUE_CURRENTLIABILITIESPERSHARE,self::VALUE_CASHPERSHARE,self::VALUE_LONGTERMDEBTTOEQUITYRATIO,self::VALUE_LONGTERMDEBTASAPERCENTAGEOFINVESTEDCAPITAL,self::VALUE_LONGTERMDEBTASAPERCENTAGEOFTOTALLIABILITIES,self::VALUE_TOTALLIABILITIESASAPERCENTAGEOFTOTALASSETS,self::VALUE_WORKINGCAPITALASAPERCENTAGEOFEQUITY,self::VALUE_REVENUEPERSHARE,self::VALUE_BOOKVALUEPERSHARE,self::VALUE_TANGIBLEBOOKVALUEPERSHARE,self::VALUE_PRICETOREVENUERATIO,self::VALUE_PRICETOEQUITYRATIO,self::VALUE_PRICETOTANGIBLEBOOKRATIO,self::VALUE_WORKINGCAPITALASPERCENTAGEOFPRICE,self::VALUE_WORKINGCAPITALPERSHARE,self::VALUE_CASHFLOWPERSHARE,self::VALUE_FREECASHFLOWPERSHARE,self::VALUE_RETURNONSTOCKEQUITY,self::VALUE_RETURNONINVESTEDCAPITAL,self::VALUE_RETURNONASSETS,self::VALUE_PRICECASHFLOWRATIO,self::VALUE_PRICEFREECASHFLOWRATIO,self::VALUE_SALESPEREMPLOYEE,self::VALUE_PERCENTAGESALESTOINDUSTRY,self::VALUE_PERCENTAGEEARNINGSTOINDUSTRY,self::VALUE_PERCENTAGEEPSTOINDUSTRY,self::VALUE_PERCENTAGEPRICETOINDUSTRY,self::VALUE_PERCENTAGEPETOINDUSTRY,self::VALUE_PERCENTAGEPRICEBOOKTOINDUSTRY,self::VALUE_PERCENTAGEPRICESALESTOINDUSTRY,self::VALUE_PERCENTAGEPRICECASHFLOWTOINDUSTRY,self::VALUE_PERCENTAGEPRICEFREECASHFLOWTOINDUSTRY,self::VALUE_PERCENTAGEDEBTEQUITYTOINDUSTRY,self::VALUE_PERCENTAGECURRENTRATIOTOINDUSTRY,self::VALUE_PERCENTAGEGROSSPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGEPRETAXPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGEPOSTTAXPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGENETPROFITMARGINTOINDUSTRY,self::VALUE_PERCENTAGERETURNONEQUITYTOINDUSTRY,self::VALUE_PERCENTAGELEVERAGERATIOTOINDUSTRY,self::VALUE_PERCENTAGEASSETTURNOVERTOINDUSTRY,self::VALUE_LASTANNUALREPORTDATE,self::VALUE_LASTQUARTERLYREPORTDATE,self::VALUE_NONE,self::VALUE_TRUEFLOAT));\n\t}", "function checkTypeForFilter($field, $value){\n\t\tif (get_magic_quotes_gpc()){\n\t\t\t$value = stripslashes($value);\n\t\t}\n\t\t\n\t\t$type=$this->types[$field];\n\t\t\n\t\tswitch ($type){\n\t\t\tcase \"date\":\n\t\t\t\t\n\t\t\t\t$value=date_ymd($value);\n\t\t\t\t$return=\" = '$value'\";\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\t$return=\"= $value\";\n\t\t\t\tbreak;\n\t\t\tcase \"progressbar\":\n\t\t\t\t$pje=$value/100;\n\t\t\t\treturn \"= $pje\";\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\tdefault:\n\t\t\t\t$return=\"LIKE \".db::checkRealEscapeString($value,true);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public static function valueIsValid($_value)\r\n\t{\r\n\t\treturn in_array($_value,array(PayPalEnumPaymentActionCodeType::VALUE_NONE,PayPalEnumPaymentActionCodeType::VALUE_AUTHORIZATION,PayPalEnumPaymentActionCodeType::VALUE_SALE,PayPalEnumPaymentActionCodeType::VALUE_ORDER));\r\n\t}", "function fieldInTable( $table, $field ) {\r\n\t \t$fieldFound = false;\r\n\t\t$fields = $this->getTableFields('', $table);\r\n\t\t$columns = mysql_num_fields($fields);\r\n\t\tfor($i = 0; $i < $columns; $i++){\r\n\t\t\tif(mysql_field_name($fields, $i) == $field){\r\n\t\t\t\t$fieldFound = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $fieldFound;\r\n\t}", "final public static function Label( $enumType, $enumValue )\n {\n $result = 'IllegalValue';\n\n if ( class_exists( $enumType, false ) )\n {\n $reflector = new ReflectionClass( $enumType );\n\n foreach( $reflector->getConstants() as $key => $val )\n {\n if ( $val == $enumValue )\n {\n $result = $key;\n break;\n }\n }\n }\n return $result;\n }", "public static function valueIsValid($_value)\r\n\t{\r\n\t\treturn in_array($_value,array(PayPalEnumBillingCodeType::VALUE_NONE,PayPalEnumBillingCodeType::VALUE_MERCHANTINITIATEDBILLING,PayPalEnumBillingCodeType::VALUE_RECURRINGPAYMENTS,PayPalEnumBillingCodeType::VALUE_MERCHANTINITIATEDBILLINGSINGLEAGREEMENT,PayPalEnumBillingCodeType::VALUE_CHANNELINITIATEDBILLING));\r\n\t}" ]
[ "0.7060546", "0.6680646", "0.65644604", "0.6361918", "0.6262062", "0.6207098", "0.6184239", "0.59848225", "0.5960027", "0.5918518", "0.5864401", "0.5653974", "0.5652215", "0.5639529", "0.5626257", "0.55962676", "0.5573999", "0.5549936", "0.5548334", "0.55311066", "0.55299455", "0.55192226", "0.55183464", "0.5514654", "0.5505929", "0.54956144", "0.54870015", "0.54800993", "0.54788727", "0.54580265", "0.54342365", "0.5426042", "0.5392682", "0.53921527", "0.53833264", "0.53752273", "0.53621054", "0.535546", "0.5312685", "0.5296966", "0.5283272", "0.52718663", "0.52619857", "0.52576387", "0.5256272", "0.5244392", "0.5234308", "0.5214493", "0.5212553", "0.52094644", "0.5205937", "0.5201521", "0.5196905", "0.5189326", "0.5182768", "0.51819026", "0.5181522", "0.5180775", "0.5179074", "0.51752394", "0.5171368", "0.5162468", "0.51565784", "0.514875", "0.5130762", "0.51283383", "0.5127286", "0.5119499", "0.5114107", "0.5107342", "0.5103976", "0.50902104", "0.50832415", "0.5081918", "0.5075954", "0.507197", "0.5071388", "0.5070422", "0.506444", "0.50608224", "0.50596136", "0.5052762", "0.5045763", "0.5038358", "0.50360376", "0.50293344", "0.5028068", "0.5026197", "0.5019857", "0.5010166", "0.5001366", "0.5001072", "0.49971434", "0.499111", "0.49848005", "0.498427", "0.49835944", "0.49817225", "0.49706703", "0.49681744" ]
0.77748305
0
File validations with DB Table Config directives
function form_file_upload_handle($file_data, $field_config, $table_name = null) { $file_max_size = $field_config['file-max-size'] + 0; $file_type = $field_config['file-type']; if (strstr($file_data['type'], $file_type) === FALSE) { return "The file type is {$file_data['type']} not {$file_type}"; } if ($file_data['size'] > $file_max_size) { return "Size is bigger than " . $file_max_size / 1024 . "k"; } /** * ALL ok? then place the file and let it go... let it goooo! (my daughter Allison fault! <3 ) */ if (file_uploads::place_upload_file($file_data['tmp_name'], $file_data['name'], $table_name)) { return TRUE; } else { return file_uploads::get_last_error(); } // $file_location = file_uploads::get_uploaded_file_path($file_data['name']); // $file_location_url = file_uploads::get_uploaded_file_url($file_data['name']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateDatabaseConfig(Database_Config $databaseConfig);", "public function isValidConfigFile($file);", "public function validateConfig()\n\t{\n\t\t$schemaContent = @file_get_contents(Config::$schemaFile);\n\t\tif($schemaContent === FALSE) {\n\t\t\t$this->errors['File not found'][] = [\n\t\t\t\t'property' => Config::$schemaFile,\n\t\t\t\t'message' => 'Schema file not found.'\n\t\t\t];\n\t\t\treturn;\n\t\t}\n\n\t\t$schema = Json::decode($schemaContent);\n\n\t\t$this->schemaValidator->check($this->config, $schema);\n\n\t\tif (!$this->schemaValidator->isValid()) {\n\t\t\t$this->errors['schema'] = $this->schemaValidator->getErrors();\n\t\t}\n\t}", "abstract protected function _getSchemaFile();", "public function canBuildFromSchemaFile() {\n\t}", "public function doDatabaseCheck()\n {\n $validator = new Validation\\Database();\n $validator->setPathResolver($this->config->app['path_resolver']);\n $validator->setConfig($this->config->app['config']);\n $validator->check();\n }", "function fileIsValid($fname, $schema, $db) {\n\tglobal $maxFileAgeInDays;\n\n\t// valid if exists\n\tif (!file_exists($fname)) {\n\t\techo \"INVALID_FILE_NOT_EXIST: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// valid if not too old\n\t$age = dayOld($fname);\n\tif ($age >= $maxFileAgeInDays) {\n\t\techo \"INVALID_FILE_TOO_OLD: $fname, $age day-old\\r\\n\";\n\t\treturn false;\n\t}\n\n\t// all else being equal, check for db\n\tif (isFileAlreadyImported($fname, $schema, $db)) {\n\t\techo \"INVALID_FILE_ALREADY_IMPORTED: $fname\\r\\n\";\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "abstract protected function validateFile() : object;", "protected function checkDataTablesRules() {\n $rules = [\n 'draw' => 'required|numeric|min:1',\n 'start' => 'required|numeric|min:0',\n 'length' => 'required|numeric|min:-1', //-1 means all records, > 1 the pagination records\n 'search.value' => 'present|nullable|string',\n 'search.regex' => 'present|string|in:true,false',\n 'order.*.column' => 'required|numeric|min:0',\n 'order.*.dir' => 'required|string|in:asc,desc',\n 'columns.*.data' => 'present|nullable|string',\n 'columns.*.name' => 'present|nullable|string',\n 'columns.*.searchable' => 'required|string|in:true,false',\n 'columns.*.orderable' => 'required|string|in:true,false',\n 'columns.*.search.value' => 'present|nullable|string',\n 'columns.*.search.regex' => 'required|string|in:true,false'\n ];\n request()->validate($rules);\n }", "public function validate($configData);", "public function checkDatabaseFile()\n {\n return file_exists($this->getDatabasePath());\n }", "protected static function loadSingleExtTablesFiles() {}", "public function rules()\n {\n return [\n 'file' => 'required',\n 'extension' => 'required|in:txt,csv,xlsx'\n ];\n }", "public function rules()\n {\n return [\n 'importedFile' => 'required',\n ];\n }", "static public function configureFileField() {}", "public function checkDatabaseStructure( );", "public function rules() {\r\n return array(\r\n array('csv_file,tipo_entidad', 'required'),\r\n array('csv_file', 'file', 'types' => 'csv'),\r\n );\r\n }", "protected function validateConfigFile(): void\n {\n switch ($this->filePath) {\n case !is_file($this->filePath):\n throw new DbConnectorException(\n 'Specified configuration file does not exist.',\n 1001\n );\n case !is_readable($this->filePath):\n throw new DbConnectorException(\n 'Config file is not readable by DbConnector.',\n 1002\n );\n }\n\n $jsonConfig = json_decode(file_get_contents($this->filePath) ?: '', false);\n $this->filePath = null;\n\n if (empty($jsonConfig->dbConnector) || !\\is_object($jsonConfig->dbConnector)) {\n throw new DbConnectorException(\n 'The config file is malformed. Please refer to documentation for schema information.',\n 1003\n );\n }\n\n $this->jsonObject = $jsonConfig->dbConnector;\n }", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}", "public abstract function validateConfig($config);", "protected function executeExtTablesAdditionalFile() {}", "private function validate() {\n\t\tif( empty($this->header) )\n\t\t\tthrow new Exception('ACH file header record is required.');\n\n\t\tif( empty($this->batches) )\n\t\t\tthrow new Exception('ACH file requires at least 1 batch record.');\n\n\t\tif( empty($this->control))\n\t\t\tthrow new Exception('ACH file control record is required.');\t\t\t\n\t}", "public function validate()\n {\n if (!$this->migrationsDatabaseName) {\n $message = 'Migrations Database Name must be configured in order to use AntiMattr migrations.';\n throw new ConfigurationValidationException($message);\n }\n if (!$this->migrationsNamespace) {\n $message = 'Migrations namespace must be configured in order to use AntiMattr migrations.';\n throw new ConfigurationValidationException($message);\n }\n if (!$this->migrationsDirectory) {\n $message = 'Migrations directory must be configured in order to use AntiMattr migrations.';\n throw new ConfigurationValidationException($message);\n }\n }", "function convertSQLRules($Path) {\n\t\t$file = fopen(\"rules.txt\",\"w\");\n\t\t//import\n\t\techo \"= Importing rules =\".PHP_EOL;\n\t\timportFromSQLFile($Path);\n\t\t//Clean up a little\n\t\t$query = \"ALTER TABLE datarules DROP empty\"; if (!mysql_query($query)) die(mysql_error());\n\t\t$query = \"UPDATE datarules SET Description = REPLACE(Description, '\\\"', '') WHERE Description LIKE '\\\"%'\"; if (!mysql_query($query)) die(mysql_error()); //remove (\")\n\t\t$query = \"UPDATE datarules SET Description = REPLACE(Description, 'when', 'where') WHERE Description LIKE '%when%'\"; if (!mysql_query($query)) die(mysql_error()); //change 'when' to 'where' \n\t\t$query = \"DELETE FROM datarules WHERE Description = ''\"; if(!mysql_query($query)) die(mysql_error());\n\t\t// TRANSFORM RULES INTO MYSQL QUERY\n\t\techo \"= Transforming rules =\".PHP_EOL;\n\t\trecreateTable(txn_data, rulesconv, \"No INT(255), RuleId VARCHAR(255), DateAdded VARCHAR(255), StatusResult VARCHAR(255), Expression VARCHAR(255), Glue VARCHAR(255)\");\n\t\t//Convert variables\n\t\t$statuses = array( \"deny\" => \"Deny\", \"challenge\" => \"Challenge\", \"allow\" => \"Accept\");\n\t\t$signs = array( \" like \" => \"LIKE\", \" = \" => \"=\", \" is not equal to \" => \"<>\");\n\t\t$signs_for_arr = array( \" is not like \" => \"NOT IN\");\n\t\t$glues = array(\" AND \", \" OR \");\n\t\t$vars = array(\n\t\t\t\"CUSTEMAIL\" => \"CustomerEmailAddress\",\n\t\t\t\"E-mail Domain\" => \"CustomerEmailAddress\",\n\t\t\t\"CUSTIP\" => \"CustIPID\",\n\t\t\t\"SHIPZIPCD\" => \"ShipZip\",\n\t\t\t\"SHIPCOUNTRY\" => \"ShippingCountry\",\n\t\t\t\"BILLCOUNTRY\" => \"BillingCountry\",\n\t\t\t\"Geolocation Country(IPID)\" => \"IPIDCountry\",\n\t\t\t\"Card Issuing Country(VIRTBIN)\" => \"BINCountry\"\n\t\t);\n\t\t//Retrieve rules\n\t\t$j=1;\n\t $ignored_description = array('%more than%', '%CARDNO%', '%Observe Only%', '%PRODCD%', '%Phone%', '%VIRTIPIDANONYMIZER%', '%USERDATA14%', '%AFRICA%', '%BILLZIPCD%', '%Geolocation Continent(IPID)%', '%AUTHRESP%', '%CUSTLASTNAME%', '%CUSTID%');\n\t\t$query = \"SELECT RuleId, DateAdded, Description FROM datarules WHERE \";\n\t\t$n_ignored = sizeof($ignored_description); \n\t\tfor($i=0;$i<$n_ignored;$i++) {\n\t\t\t$query = $query.\"Description NOT LIKE '\".$ignored_description[$i].\"'\";\n\t\t\tif($i<$n_ignored-1) {\n\t\t\t\t$query = $query.\" AND \";\n\t\t\t}\n\t\t}\n\t\t$result = mysql_query($query);\n\t while($row = mysql_fetch_assoc($result)) {\n\t \t$StatusResult = \"\";\n\t\t\t$Glue = \"\";\n\t\t\t$Expression_final = \"\";\n\t\t\t$Expressions = array();\n\t\t\t$rule = explode(\" if it equals \", str_replace(\" then abort rule processing\",\"\",$row['Description']));\n\n\t\t\tif($rule[1]) {\n\t \t\t// Special case: pattern \"Manually created by ReD - STATUS VAR if it equals VAL\"\n\t \t\t$Glue = \"\"; \n\t \t\t$var = \"\";\n\t\t\t\t$val = \"\";\n\t \t\t$status_var = explode(' ', $rule[0]); \n\t \t\t$var = array_pop($status_var); //get variable\n\t\t\t\t$StatusResult = $statuses[strtolower(array_pop($status_var))]; //get status\n\t\t\t\t$val = $rule[1]; //get value\n\t\t\t\t$Expressions = array($vars[$var].\" = '\".$val.\"'\");\n\n\t \t} else {\n\t \t\t// Case biasa, pakai where\n\t \t\t$Glue = \"\";\n\t \t\t$status_expressions = explode(\" where \", $rule[0]);\n\t \t\t$status_ = explode(' ', $status_expressions[0]);\n\t \t\t$StatusResult = $statuses[strtolower(array_pop($status_))]; //get status\n\t \t\t//breakdown according to conjunctions used in rule\n\t \t\t$expressions = array();\n\t \t\t$n_exp = 0;\n\t \t\tforeach($glues as $glue) {\n\t \t\t\tif(strpos($status_expressions[1], $glue) !==FALSE) {\n\t \t\t\t\t$expressions = explode($glue, $status_expressions[1]);\t\n\t \t\t\t\t$Glue = trim($glue);\n\t \t\t\t\t$n_exp = sizeof($expressions); \n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t}\n\t \t\tif($n_exp == 0) {\n\t \t\t\t$expressions = array($status_expressions[1]);\n\t \t\t\t$n_exp = 1;\n\t \t\t}\n\t \t\t//iterate all expressions\n\t\t\t\tfor($i=0;$i<$n_exp;$i++) {\n\t\t\t\t\t$Expression = \"\";\n\t\t\t\t\t$var = \"\";\n\t\t\t\t\t$val = \"\";\n\t\t\t\t\tif(strripos($expressions[$i], \"more than\") !== FALSE) {\n\t\t\t\t\t\t$expressions_ = substr($expressions[$i],10);\n\n\t\t\t\t\t\t//Special case: pattern \"more than\"\n\t\t\t\t\t\tif(strripos($expressions_, \"unique\") !== FALSE) {\n\t\t\t\t\t\t\t$var1 = \"\";\n\t\t\t\t\t\t\t$var2 = \"\";\n\t\t\t\t\t\t\t$var2_var1_range = preg_split(\"/ (per|in) /\", $expressions_);\n\t\t\t\t\t\t\t$var2 = $var2_var1_range[0]; \n\t\t\t\t\t\t\t$var2_ = explode(\" unique \", $var2);\n\t\t\t\t\t\t\t$val = $var2_[0];\n\t\t\t\t\t\t\t$var2 = $var2_[1];\n\t\t\t\t\t\t\t$var1 = $var2_var1_range[1];\n\t\t\t\t\t\t\t$range = $var2_var1_range[2];\n\t\t\t\t\t\t\t$Expression = $vars[$var1].\" MORE THAN \".$val.\" UNIQUE \".$vars[$var2].\" IN \".$range;\n\t\t\t\t\t\t} else if(strripos($expressions_, \"transaction\") !== FALSE) {\n\t\t\t\t\t\t\t$var_range = array_filter(preg_split(\"/ (per|in) /\", $expressions_));\n\t\t\t\t\t\t\t$val = $var_range[0];\n\t\t\t\t\t\t\t$var = $var_range[1];\n\t\t\t\t\t\t\t$range = $var_range[2];\n\t\t\t\t\t\t\t$Expression = $vars[$var].\" MORE THAN \".$val.\" IN \".$range;\n\t\t\t\t\t\t} else if(strripos($expressions_, \"in value\") !== FALSE) {\n\t\t\t\t\t\t\t$var_range = array_filter(preg_split(\"/ (in value per|in) /\", $expressions_));\n\t\t\t\t\t\t\t$val = $var_range[0];\n\t\t\t\t\t\t\t$var = $var_range[1];\n\t\t\t\t\t\t\t$range = $var_range[2];\n\t\t\t\t\t\t\t$Expression = $vars[$var].\" MORE THAN \".$val.\" IN \".$range;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if(strripos($expressions[$i], \" is not like \") !== FALSE) {\n\n\t\t\t\t\t\t//Special case: pattern \"is not like\"\n\t\t\t\t\t\t$var_val = explode(\" is not like \", $expressions[$i]);\n\t \t\t\t\t$var = $var_val[0];\n\t \t\t\t\t$val = $var_val[1];\n\t \t\t\t\t//into proper array format\n\t \t\t\t\t$val = str_replace(\" or\", \",\", $val);\n\t \t\t\t\t$vals = explode(\", \", $val);\n\t \t\t\t\tforeach ($vals as $key=>$val) {\n\t \t\t\t\t\t$val_ = substr($val, 4, -1);\n\t \t\t\t\t\t$vals[$key] = \"'\".$val_.\"'\";\n\t \t\t\t\t}\n\t \t\t\t\t$val = implode(\", \", $vals);\n\t \t\t\t\t$Expression = $vars[$var].\" \".$signs_for_arr[\" is not like \"].\" (\".$val.\")\";\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Case biasa: pattern \"VAR SIGN VAL\"\n\t\t\t\t\t\tforeach($signs as $key=>$sign) {\n\t\t\t \t\t\tif(strripos($expressions[$i], $key) !== FALSE) {\n\t\t\t \t\t\t\t$var_val = explode($key, $expressions[$i]);\n\t\t\t \t\t\t\t$var = $var_val[0];\n\t\t\t \t\t\t\t$val = $var_val[1];\n\t\t\t \t\t\t\tif(($vars[$var]==\"BillingCountry\")||($vars[$var]==\"ShippingCountry\")||($vars[$var]==\"IPIDCountry\")||($vars[$var]==\"BINCountry\")) {\n\t\t\t \t\t\t\t\t$val_ = explode(\"(\", $val);\n\t\t\t \t\t\t\t\t$val_ = explode(\")\", $val_[1]);\n\t\t\t \t\t\t\t\t$val = $val_[0];\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\tif($sign = \"LIKE\") {\n\t\t\t \t\t\t\t\t$val = '%'.$val.'%';\n\t\t\t \t\t\t\t}\n\t\t\t \t\t\t\t$Expression = $vars[$var].\" \".$sign.\" '$val'\";\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\t}\n\t\t\t \t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($Expressions, $Expression);\n\t\t\t\t}\n\t \t}\n\t \t$Expression_final = implode(\" ; \", $Expressions); //into one Expression!\n\t \tfwrite($file, $row['RuleId'].\" \".$row['Description'].PHP_EOL.$row['RuleId'].\" \".$StatusResult.\" \".$Expression_final.\" \".$Glue.PHP_EOL.PHP_EOL);\n\t \t$query_insert = \"INSERT INTO rulesconv (No, RuleId, DateAdded, StatusResult, Expression, Glue) VALUES ('\".$j.\"', '\".$row['RuleId'].\"', '\".$row['DateAdded'].\"', '\".$StatusResult.\"', '\".mysql_real_escape_string($Expression_final).\"', '\".$Glue.\"')\"; \n\t \tif (!mysql_query($query_insert)) die(mysql_error());\n\t \t$j++;\n\t }\n\t fclose($file);\n\t echo \"Done\".PHP_EOL;\n\t}", "public function generateRules($table)\r\n {\r\n $types = [];\r\n $lengths = [];\r\n $extensions = [];\r\n $email = [];\r\n $files = [];\r\n\r\n foreach ($table->columns as $column) {\r\n switch (true) {\r\n case $this->zcore->zUtilsService->checkName($column->name, 'Email'):\r\n $email[] = $column->name;\r\n\r\n }\r\n switch ($column->type) {\r\n case Schema::TYPE_SMALLINT:\r\n case Schema::TYPE_INTEGER:\r\n case Schema::TYPE_BIGINT:\r\n if ($column->name !== 'id')\r\n $types['integer'][] = $column->name;\r\n break;\r\n case Schema::TYPE_BOOLEAN:\r\n $types['boolean'][] = $column->name;\r\n break;\r\n case Schema::TYPE_FLOAT:\r\n case Schema::TYPE_DECIMAL:\r\n case Schema::TYPE_MONEY:\r\n $types['number'][] = $column->name;\r\n break;\r\n case Schema::TYPE_DATE:\r\n case Schema::TYPE_TIME:\r\n case Schema::TYPE_DATETIME:\r\n case Schema::TYPE_TIMESTAMP:\r\n case Schema::TYPE_JSON:\r\n case 'jsonb':\r\n $types['safe'][] = $column->name;\r\n break;\r\n default: // strings\r\n if ($column->size > 0) {\r\n $lengths[$column->size][] = $column->name;\r\n } else {\r\n $types['string'][] = $column->name;\r\n }\r\n }\r\n\r\n\r\n if ($column->autoIncrement) {\r\n continue;\r\n }\r\n if (!$column->allowNull && $column->defaultValue === null) {\r\n $types['required'][] = $column->name;\r\n }\r\n\r\n }\r\n\r\n $rules['index'] = [];\r\n\r\n foreach ($types as $type => $columns) {\r\n $rules['index'][] = \"[['\" . implode(\"', '\", $columns) . \"'], '$type']\";\r\n }\r\n\r\n foreach ($lengths as $length => $columns) {\r\n $rules['index'][] = \"[['\" . implode(\"', '\", $columns) . \"'], 'string', 'max' => $length]\";\r\n }\r\n\r\n foreach ($email as $k => $v) {\r\n $rules['index'][] = \"[['$v'], 'email']\";\r\n }\r\n\r\n foreach ($files as $k => $v) {\r\n $rules['index'][] = \"[['$v'], 'file', 'maxSize' => 1024*1024*100]\";\r\n }\r\n\r\n foreach ($extensions as $k => $v) {\r\n $rules['index'][] = \"[['$v'], 'file', 'extensions' => 'jpg,png,gif', 'maxSize' => 1024*1024*10]\";\r\n }\r\n\r\n // Unique indexes rules\r\n try {\r\n $db = $this->getDbConnection();\r\n $uniqueIndexes = $db->getSchema()->findUniqueIndexes($table);\r\n foreach ($uniqueIndexes as $uniqueColumns) {\r\n // Avoid validating auto incremental columns\r\n if (!$this->isColumnAutoIncremental($table, $uniqueColumns)) {\r\n $attributesCount = \\count($uniqueColumns);\r\n\r\n if ($attributesCount == 1) {\r\n $rules['index'][] = \"[['\" . $uniqueColumns[0] . \"'], 'unique']\";\r\n } elseif ($attributesCount > 1) {\r\n $labels = array_intersect_key($this->generateLabels($table), array_flip($uniqueColumns));\r\n $lastLabel = array_pop($labels);\r\n $columnsList = implode(\"', '\", $uniqueColumns);\r\n $rules['index'][] = \"[['\" . $columnsList . \"'], 'unique', 'targetAttribute' => ['\" . $columnsList . \"'], 'message' => 'The combination of \" . implode(', ', $labels) . \" and \" . $lastLabel . \" has already been taken.']\";\r\n }\r\n }\r\n }\r\n } catch (NotSupportedException $e) {\r\n // doesn't support unique indexes information...do nothing\r\n }\r\n\r\n return $rules['index'];\r\n }", "public function validateTableDataToFile($postArray,$editId) \n{\n\nreturn array();\n\n}", "function Dataface_ConfigTool_createConfigTable(){\n\t$self =& Dataface_ConfigTool::getInstance();\n\tif ( !Dataface_Table::tableExists($self->configTableName, false) ){\n\t\t$sql = \"CREATE TABLE `\".$self->configTableName.\"` (\n\t\t\t\t\tconfig_id int(11) NOT NULL auto_increment primary key,\n\t\t\t\t\t`file` varchar(255) NOT NULL,\n\t\t\t\t\t`section` varchar(128),\n\t\t\t\t\t`key` varchar(128) NOT NULL,\n\t\t\t\t\t`value` text NOT NULL,\n\t\t\t\t\t`lang` varchar(2),\n\t\t\t\t\t`username` varchar(32),\n\t\t\t\t\t`priority` int(5) default 5\n\t\t\t\t\t)\";\n\t\t$res = mysql_query($sql, df_db());\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error(df_db()), E_USER_ERROR);\n\t\t\texit;\n\t\t}\n\t}\n\n}", "function gttn_tpps_file_validate_columns(array &$form_state, array $required_groups, array $file_element) {\n $cols = $file_element['#value']['columns'];\n\n $parents = $file_element['#parents'];\n $new_end_columns = end($parents) . \"-columns\";\n $new_end_no_header = end($parents) . \"-no-header\";\n $new_end_empty = end($parents) . \"-empty\";\n $group_path = array_pop($parents) . \"-groups\";\n $values = &$form_state['values'];\n foreach ($parents as $item) {\n $values = &$values[$item];\n }\n // Initialize form column values in form state.\n $values[$new_end_columns] = array();\n // Hold onto the location of the columns in form state.\n $state_column_values = &$values[$new_end_columns];\n $values[$new_end_no_header] = isset($file_element['#value']['no-header']) ? $file_element['#value']['no-header'] : NULL;\n $values[$new_end_empty] = isset($file_element['#value']['empty']) ? $file_element['#value']['empty'] : NULL;\n\n $title_parts = explode(':', $file_element['#title']);\n $error_prompt = $title_parts[0];\n\n $groups = array();\n $required_groups_flat = array();\n foreach ($required_groups as $group => $combinations) {\n $groups[$group] = array();\n $required_groups_flat[$group] = array();\n foreach ($combinations as $name => $combination) {\n $required_groups_flat[$group] = array_merge($required_groups_flat[$group], $combination);\n }\n }\n\n // dpm($required_groups_flat);\n // dpm($cols);\n // dpm($state_column_values);\n foreach ($cols as $name => $type) {\n $state_column_values[$name] = $type;\n foreach ($required_groups_flat as $group => $types) {\n if (in_array($type, $types)) {\n if (!isset($groups[$group][$type])) {\n $groups[$group][$type] = array($name);\n }\n else {\n $groups[$group][$type][] = $name;\n }\n break;\n }\n }\n }\n // dpm($groups);\n foreach ($required_groups as $group => $combinations) {\n $group_valid = FALSE;\n $groups[$group]['#type'] = array();\n foreach ($combinations as $name => $combination) {\n $combination_valid = TRUE;\n foreach ($combination as $type) {\n if (!isset($groups[$group][$type])) {\n $combination_valid = FALSE;\n break;\n }\n }\n if ($combination_valid) {\n $groups[$group]['#type'][] = $name;\n $group_valid = TRUE;\n }\n }\n\n if (!$group_valid) {\n form_set_error($file_element['#name'] . \"[columns][$group\", \"$error_prompt: Please specify a column or columns that hold $group.\");\n }\n }\n\n foreach ($groups as $key => $group) {\n foreach ($group as $opt_num => $col_names) {\n if (count($col_names) == 1) {\n $groups[$key][$opt_num] = $col_names[0];\n }\n }\n }\n\n $values[$group_path] = $groups;\n\n return $groups;\n}", "private function validateImportFile($pathToImportFile)\n {\n $requiredColumns = [ 0,1,2 ];\n if (($fileHandle = fopen($pathToImportFile,\"r\")) !== FALSE)\n {\n $row = 0;\n while (($data = fgetcsv($fileHandle, 8096, \",\")) !== FALSE) {\n $row++;\n foreach ($requiredColumns as $colNumber) {\n if (trim($data[$colNumber]) == '') {\n throw new InvalidArgumentException(\"In the inventory import, column number \" . ($colNumber + 1) . \" is required, and it is empty on row $row.\");\n }\n }\n if ((count($data) % 2) !== 0)\n {\n throw new InvalidArgumentException(\"There is an odd number of columns on row \" . ($row+1) . \", which is not valid.\");\n }\n }\n }\n else\n {\n throw new InvalidArgumentException(\"Could not open import file.\");\n }\n\n return;\n }", "public function testInvalidConfig(): void\n {\n $result = $this->check->run('Books', [ 'icon_bad_values' => ['cube'], 'display_field_bad_values' => [\"title2\"] ]);\n $result = $this->check->getErrors();\n\n $this->assertTrue(is_array($result), \"getErrors() returned a non-array result\");\n $this->assertContains('[Books][config] parse : [/table/icon]: Matched a schema which it should not', $result);\n $this->assertContains('[Books][config] parse : [/table/display_field]: Matched a schema which it should not', $result);\n }", "protected function checkTable()\n\t{\n if (isset(Yii::$app->db->schema->db->tablePrefix))\n $this->table = Yii::$app->db->schema->db->tablePrefix.$this->table;\n \n\t\tif (Yii::$app->db->schema->getTableSchema($this->table, true) === null) {\n\t\t\tYii::$app->db->createCommand()\n ->createTable(\n $this->table,\n \t\t\t\tarray(\n \t\t\t\t\t'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY',\n \t\t\t\t\t'ip' => 'varchar(20) DEFAULT NULL',\n \t\t\t\t\t'time' => 'int(10) unsigned DEFAULT NULL',\n \t\t\t\t\t'rfc822' => 'varchar(50) DEFAULT NULL',\n \t\t\t\t\t'uri' => 'varchar(255) DEFAULT NULL',\n \t\t\t\t\t'get' => 'text',\n \t\t\t\t\t'post' => 'text',\n \t\t\t\t\t'cookies' => 'text',\n \t\t\t\t\t'session' => 'text',\n \t\t\t\t\t'method' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'scheme' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'protocol' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'port' => 'varchar(10) DEFAULT NULL',\n \t\t\t\t\t'browser' => 'text',\n \t\t\t\t\t'language' => 'text',\n \t\t\t\t),\n 'ENGINE=InnoDB DEFAULT CHARSET=utf8'\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_ip',\n $this->table,\n \t\t\t\t'ip',\n false\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_time',\n $this->table,\n \t\t\t\t'time',\n false\n )\n ->execute();\n\t\t\tYii::$app->db->createCommand()\n ->createIndex(\n 'idx_uri',\n $this->table,\n \t\t\t\t'uri',\n false\n )\n ->execute();\n\t\t}\n\t}", "public function rules() {\n\t\treturn [\n\t\t\t'description' => 'required',\n\t\t\t'fileName' => 'required',\n\t\t];\n\t}", "function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }", "public function rules()\n {\n return [\n 'file_description' => 'string',\n 'file_title' => 'string',\n 'file_orig_name' => 'required|string',\n 'cat_id' => 'required|numeric'\n ];\n }", "private function ensureFileValid(string $filePath): void\n {\n $blacklist = ['YES', 'NO', 'NULL', 'FALSE', 'ON', 'OFF', 'NONE', 'TRUE'];\n $errors = [];\n\n // Read the whole file at once\n // no sense streaming since we load the whole thing in production\n $file = file_get_contents($filePath);\n\n if (false === $file) {\n throw new InvalidFileException(sprintf('Unable to read file \"%s\" for checking', $filePath));\n }\n\n $file = explode(\"\\n\", $file);\n\n foreach ($file as $lineNumber => $line) {\n $realNumber = $lineNumber + 1;\n // Ignore comment lines.\n if ('' === trim($line) || ';' === $line[0]) {\n continue;\n }\n\n // Check that the line passes the necessary format.\n if (!preg_match('#^[A-Za-z][A-Za-z0-9_\\-\\.]*\\s*=\\s*\".*\"\\s*(;.*)?$#', $line)) {\n $errors[] = \"Line $realNumber does not match format regexp\";\n continue;\n }\n\n // Gets the count of unescaped quotes\n preg_match_all('/(?<!\\\\\\\\)\\\"/', $line, $matches);\n\n if (2 !== count($matches[0])) {\n $errors[] = \"Line $realNumber doesn't have exactly 2 unescaped quotes\";\n continue;\n }\n\n // Check that the key is not in the blacklist.\n $key = strtoupper(trim(substr($line, 0, strpos($line, '='))));\n\n if (in_array($key, $blacklist)) {\n $errors[] = \"Line $realNumber has blacklisted key\";\n }\n }\n if (false === @parse_ini_file($filePath)) {\n $errors[] = 'Cannot load file with parse_ini_file';\n }\n\n if (count($errors)) {\n throw new InvalidFileException(\"File $filePath has following errors:\\n\".implode(';', $errors));\n }\n }", "abstract protected function loadTableChecks(string $tableName): array;", "public function rules()\n {\n return [\n 'file' => 'required|file'\n ];\n }", "function inputSourceCTL($ctlfilename, $queryfilename, $dbh) {\n\n\tif (!file_exists($ctlfilename)) {\n\t\techo $ctlfilename . ' does not exist!\\r\\n';\n\t\treturn false;\n\t}\n\n\tif (!file_exists($queryfilename)) {\n\t\techo 'query ' . $queryfilename . ' does not exist!\\r\\n';\n\t\treturn false;\n\t}\n\n\t$stmt = null;\n\n\tif (!$dbh) {\n\t\techo \"Database not opened!\\r\\n\";\n\t\treturn false;\n\t} else {\n\t\t// build statement\n\t\ttry {\n\t\t\t$stmt = $dbh->prepare(file_get_contents($queryfilename));\n\t\t\techo \"Insert statement prepared.\\r\\n\";\t\n\t\t} catch (PDOException $e) {\n\t\t\techo \"Error preparing statement: \" . $e->getMessage() . \"\\r\\n\";\t\n\t\t\treturn false;\n\t\t}\n\t}\n\n\techo \"opening file: \" . $ctlfilename . \"\\r\\n\";\n\n\t$fp = fopen($ctlfilename, \"r\");\n\n\t// initial status\n\t$status = array(\n\t\t'STARTED' => false,\n\t\t'ROWCOUNT' => 0,\n\t\t'ERRORCOUNT' => 0,\n\t\t'LASTERROR' => '',\n\t\t'ATTEMPTED' => 0\n\t\t);\n\n\n\t// must skip until begin data\n\twhile ($row = fgetcsv($fp, 2048, \";\", '\"')) {\n\t\t// update start flag\n\t\tif (count($row) >= 1 && !$status['STARTED']) {\n\t\t\t// found the string BEGINDATA\n\t\t\tif ($row[0] == 'BEGINDATA') {\n\t\t\t\t$status['STARTED'] = true;\n\t\t\t\t$status['ROWCOUNT'] = 0;\n\t\t\t\t$status['ATTEMPTED'] = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t$maxLen = 80;\n\t\t// now, do something if we're started\n\t\tif ($status['STARTED'] && count($row) >= 12) {\n\t\t\t// insert into database\n\t\t\ttry {\n\t\t\t\t$res = $stmt->execute($row);\n\n\t\t\t\t// $poop = implode(' | ', $row);\n\t\t\t\techo \"\\r>inserted row(s)... {$status['ROWCOUNT']}\";\n\t\t\t\t// $poopTrimmed = substr($poop, 0, $maxLen) . '...';\n\n\t\t\t\t// echo \"[\" .$status['ROWCOUNT'] . \"]-> \" . $poopTrimmed . \"\\r\\n\";\n\t\t\t\t// increase rowcount (actual inserted row)\n\t\t\t\t$status['ROWCOUNT'] += $stmt->rowCount();\n\t\t\t\t$status['ATTEMPTED'] ++;\n\t\t\t} catch (PDOException $e) {\n\t\t\t\techo \"Error insert: \" . $e->getMessage() . \"\\r\\n\";\n\n\t\t\t\t$status['ERRORCOUNT']++;\n\t\t\t\t$status['LASTERROR'] = $e->getMessage();\n\t\t\t}\n\n\t\t\t// sleep every 100000 rows\n\t\t\t$sleepCounter = 100000;\n\t\t\t$sleepDurationMS = 1300;\n\n\t\t\tif ( $status['ROWCOUNT'] % $sleepCounter == 0 ) {\n\t\t\t\tsleep($sleepDurationMS/1000.0);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// echo \"IGNORING THIS LINE...\\r\\n\";\n\t\t}\n\t}\n\n\t// close the file handle\n\tfclose($fp);\n\n\t// log status\n\techo \"\\rINSERTED: {$status['ROWCOUNT']} rows of {$status['ATTEMPTED']}, ERROR: {$status['ERRORCOUNT']} \\r\\n\";\n\n\treturn $status['ROWCOUNT'];\n}", "public function rules()\n {\n return [\n 'name_file' => 'required|file|max:10000,mimes:csv'\n ];\n }", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "abstract public function modules__ddl__do_validate( &$input , &$m , &$ddl_config__validated = array() , &$faults = array() );", "public function rules()\r\n {\r\n return [\r\n 'document_type_id' => 'required',\r\n 'date_of_expiry' => 'required|date',\r\n 'title' => 'required',\r\n 'attachments' => 'required|mimes:'.config('config.allowed_upload_file')\r\n ];\r\n }", "public function rules(): array\n {\n return [\n 'importLanguage' => 'string|required',\n 'onlyMissing' => 'string',\n 'fileImport' => 'required|file',\n ];\n }", "function check_db() \n\t{\n global $wpdb;\n\n\t\tif($wpdb->get_var(\"SHOW TABLES LIKE '\".$this->table_name.\"'\") != $this->table_name) \n\t\t{\n $sql = \"CREATE TABLE \" . $this->table_name . \" (\n\t\t\t\t`id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n\t\t \t`name` TEXT NOT NULL,\n `date` BIGINT( 11 ) NOT NULL\n\t\t\t\t);\";\n\t\t $wpdb->query($sql);\n\t\t}\n\n if($wpdb->get_var(\"DESCRIBE \".$this->table_name.\" WHERE `Field` = 'date'\") != \"date\") // table for books\n\t\t{\n\t\t\t$sql = \"ALTER TABLE `\" . $this->table_name . \"` ADD `date` BIGINT( 11 ) NOT NULL DEFAULT '\".date(\"U\").\"';\";\n\t\t $wpdb->query($sql);\n\t\t}\n\n\t\tif($wpdb->get_var(\"SHOW TABLES LIKE '\".$this->table_img_name.\"'\") != $this->table_img_name) // table for files (images, swf, flv)\n\t\t{\n $sql = \"CREATE TABLE \" . $this->table_img_name . \" (\n\t\t \t\t `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n\t\t \t\t `name` TEXT NOT NULL,\n\t\t \t\t `filename` TEXT NOT NULL,\n\t\t \t\t `type` TEXT NOT NULL,\n `date` BIGINT( 11 ) NOT NULL\n\t\t \t\t );\";\n\n\t\t $wpdb->query($sql);\n\t\t}\n\n if($wpdb->get_var(\"DESCRIBE \".$this->table_img_name.\" WHERE `Field` = 'date'\") != \"date\") \n\t\t{\n $sql = \"ALTER TABLE `\" . $this->table_img_name . \"` ADD `date` BIGINT( 11 ) NOT NULL DEFAULT '\".date(\"U\").\"';\";\n\t\t $wpdb->query($sql);\n\t\t}\n }", "public function rules()\n {\n return [\n\n\n\n\n\n 'name' => 'required|string|max:100',\n 'fileable_id' => 'required',\n 'fileable_type' => 'required',\n 'description' => 'max:1000',\n 'file'=>'required|file|max:100000'\n\n\n\n ];\n }", "function configure_db() {\n //Old data is deleted before adding the new db structure\n $db = DB::getInstance();\n //$file = new File(CORE_INSTALLER_FILES_PATH.'/db/init.sql', 'r');\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/init.sql'))->error()) {\n return true;\n }\n return false;\n}", "public function validateTableName()\n {\n if (strpos($this->tableName, '*') !== false && substr_compare($this->tableName, '*', -1, 1)) {\n $this->addError('tableName', 'Asterisk is only allowed as the last character.');\n\n return;\n }\n $tables = $this->getTableNames();\n if (empty($tables)) {\n $this->addError('tableName', \"Table '{$this->tableName}' does not exist.\");\n } else {\n foreach ($tables as $table) {\n $class = $this->generateClassName($table);\n if ($this->isReservedKeyword($class)) {\n $this->addError('tableName', \"Table '$table' will generate a class which is a reserved PHP keyword.\");\n break;\n }\n }\n }\n }", "public function validate(ImportingFile $file, ImportOptions $options);", "function form_backend_validation()\r\n {\r\n // Need to make sure file contains meet results.\r\n //\r\n // What is a results file?\r\n //\r\n // - 1 A0 record\r\n // - 1 B1 record\r\n // - 1 B2 record (optional)\r\n // - 1 or more C1 records\r\n // - 1 or more C2 records\r\n // - 0 or more D0 records\r\n // - 0 or more D3 records\r\n // - 0 or more G0 records\r\n // - 0 or more E0 records\r\n // - 0 or more F0 records\r\n // - 0 or more G0 records\r\n // - 1 Z0 record\r\n //\r\n // A results file can contain results for more than\r\n // one team - so what to do if that happens?\r\n\r\n $legal_records = array(\"A0\" => 1, \"B1\" => 1, \"B2\" => 0,\r\n \"C1\" => 1, \"C2\" => 0, \"D0\" => 0, \"D3\" => 0, \"G0\" => 0,\r\n \"E0\" => 0, \"F0\" => 0, \"Z0\" => 1) ;\r\n \r\n $record_counts = array(\"A0\" => 0, \"B1\" => 0, \"B2\" => 0,\r\n \"C1\" => 0, \"C2\" => 0, \"D0\" => 0, \"D3\" => 0, \"G0\" => 0,\r\n \"E0\" => 0, \"F0\" => 0, \"Z0\" => 0) ;\r\n \r\n $z0_record = new SDIFZ0Record() ;\r\n\r\n $file = $this->get_element(\"SDIF Filename\") ; \r\n $fileInfo = $file->get_file_info() ; \r\n\r\n $lines = file($fileInfo['tmp_name']) ; \r\n\r\n // Scan the records to make sure there isn't something odd in the file\r\n\r\n $line_number = 1 ;\r\n\r\n foreach ($lines as $line)\r\n {\r\n if (trim($line) == \"\") continue ;\r\n\r\n $record_type = substr($line, 0, 2) ;\r\n\r\n if (!array_key_exists($record_type, $legal_records))\r\n {\r\n $this->add_error(\"SDIF Filename\", sprintf(\"Invalid record \\\"%s\\\" encountered in SDIF file on line %s.\", $record_type, $line_number)) ;\r\n return false ;\r\n }\r\n else\r\n {\r\n $record_counts[$record_type]++ ;\r\n }\r\n\r\n $line_number++ ;\r\n\r\n if ($record_type == \"Z0\")\r\n $z0_record->setSDIFRecord($line) ;\r\n }\r\n\r\n // Got this far, the file has the right records in it, do\r\n // the counts make sense?\r\n \r\n foreach ($record_counts as $record_type => $record_count)\r\n {\r\n if ($record_count < $legal_records[$record_type])\r\n {\r\n $this->add_error(\"SDIF Filename\", sprintf(\"Missing required \\\"%s\\\" record(s) in SDIF file.\", $record_type)) ;\r\n return false ;\r\n }\r\n }\r\n\r\n // Suppress Z0 checking?\r\n if ($this->get_element('Override Z0 Record Validation'))\r\n {\r\n return true ;\r\n }\r\n\r\n // Got this far, the file has the right records in it, do\r\n // the counts match what is reported in the Z0 record?\r\n\r\n $z0_record->ParseRecord() ;\r\n\r\n // Make sure this is a results file!\r\n if ($z0_record->getFileCode() != FT_SDIF_FTT_CODE_MEET_RESULTS_VALUE)\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('File Code (%02d) field in Z0 record does not match Results File Code(%02d).',\r\n $z0_record->getFileCode(), FT_SDIF_FTT_CODE_MEET_RESULTS_VALUE)) ;\r\n return false ;\r\n }\r\n \r\n // Make sure number of B records match Z0 record field\r\n if ($z0_record->getBRecordCount() != $record_counts['B1'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of B records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['B1'], $z0_record->getBRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of C records match Z0 record field\r\n if ($z0_record->getCRecordCount() != $record_counts['C1'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of C records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['C1'], $z0_record->getCRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of D records match Z0 record field\r\n if ($z0_record->getDRecordCount() != $record_counts['D0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of D records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['D0'], $z0_record->getDRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of E records match Z0 record field\r\n if ($z0_record->getERecordCount() != $record_counts['E0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of E records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['E0'], $z0_record->getERecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of F records match Z0 record field\r\n if ($z0_record->getFRecordCount() != $record_counts['F0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of F records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['F0'], $z0_record->getFRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of G records match Z0 record field\r\n if ($z0_record->getGRecordCount() != $record_counts['G0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of G records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['G0'], $z0_record->getGRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n unset($lines) ; \r\n\r\n\t return true ;\r\n }", "function validate_file_to_edit($file, $allowed_files = array())\n {\n }", "public function shouldValidate(ImportingFile $file, ImportOptions $options);", "public function check_files()\n {\n }", "protected function getConfigValidationRules()\n {\n return [\n 'name' => 'required|string',\n 'data_type' => Rule::in(ColumnsDefinitions::DATA_TYPES),\n 'extra' => 'nullable|array',\n 'index' => [\n 'nullable',\n 'string',\n Rule::in(ColumnsDefinitions::INDEXES)\n ],\n 'allow_null' => 'required|boolean',\n ];\n }", "public function rules()\n {\n return [\n // 'id' => ['sometimes', 'exists:resources,id'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'in:pdf,link,snippet'],\n 'file' => ['required_if:type,pdf', 'max:200000', 'mimes:pdf'],\n 'description' => ['required_if:type,snippet', 'string'],\n 'snippet' => ['required_if:type,snippet', 'string'],\n 'link' => ['required_if:type,link', 'url'],\n 'open_in_tab' => ['sometimes', 'boolean'],\n ];\n }", "public function rules()\n {\n return [\n 'trx_code' => 'required|exists:tb_transactions,detail_transaksi',\n 'bukti_tf' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:20348'\n ];\n }", "protected function checkInvalidSqlModes() {}", "function checkSavedFiles(){\n\t\t \n\t\t $tableFiles = new TabOut_TableFiles;\n\t\t $baseFileName = $this->tableID;\n\t\t $tableFiles->getAllFileSizes($baseFileName);\n\t\t $this->files = $tableFiles->savedFileSizes;\n\t\t $metadata = $this->metadata;\n\t\t $tableFields = $metadata[\"tableFields\"];\n\t\t unset($metadata[\"tableFields\"]);\n\t\t $metadata[\"files\"] = $this->files;\n\t\t $metadata[\"tableFields\"] = $tableFields; //just for sake of order! :)\n\t\t $this->metadata = $metadata;\n\t\t \n\t }", "function validate_file($file, $allowed_files = array())\n {\n }", "public function validate()\n {\n // query for validation information\n // set the validation flag\n // close database\n }", "protected function check($file)\n {\n }", "public function testValidateDocumentCsvValidation()\n {\n }", "public function check_import_match($table_name, $text_line) {\n $error = 0;\n $arr = explode(\",\",$text_line);\n $string_count = sizeof($arr);\n $cols = $this->data_driver->get_column_count($table_name);\n if ($cols != FALSE) {\n $col_count = sizeof($cols);\n }\n else\n {\n $error = \"Table name doesn't exist\";\n return $error;\n }\n if ($string_count == $col_count) {\n return $error;\n }\n else\n { \n $error = \"Column count does not match. Check selection or data format\";\n return $error;\n }\n }", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "public function rules()\n {\n return [\n \"file\" => 'required|mimes:csv,doc,docx,djvu,odp,ods,odt,pps,ppsx,ppt,pptx,pdf,ps,eps,rtf,txt,wks,wps,xls,xlsx,xps,\n aac,ac3,aiff,amr,ape,au,flac,m4a,mka,mp3,mpc,ogg,ra,wav,wma,\n bmp,exr,gif,ico,jp2,jpeg,pbm,pcx,pgm,png,ppm,psd,tiff,tga,\n 7z,zip,rar,jar,tar,tar,gz,cab|max:4096'\n\n ];\n }", "public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }", "public function prepareConfigSchema()\n {\n // Store Chapters\n $fromchapter = ['labels' => [],'id' => []];\n foreach ($this->container->db->getFormats() as $f) {\n array_push($fromchapter['labels'], $f->getName());\n array_push($fromchapter['id'], $f->getId());\n }\n\n // Store Issues\n $fromissue = ['labels' => [],'id' => []];\n foreach ($this->container->db->getIssues() as $i) {\n array_push($fromissue['labels'], $i->getName());\n array_push($fromissue['id'], $i->getId());\n }\n\n // Store Books\n $frombook = ['labels' => [],'id' => []];\n foreach ($this->container->db->getBooks() as $b) {\n array_push($frombook['labels'], $b->getName());\n array_push($frombook['id'], $b->getId());\n }\n\n // Store Templates\n $fromtemplate = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatenames() as $t) {\n array_push($fromtemplate['labels'], $t->getName());\n array_push($fromtemplate['id'], $t->getId());\n }\n\n // Store Templates\n $fromfield = ['labels' => [],'id' => []];\n foreach ($this->container->db->getTemplatefields() as $t) {\n array_push($fromfield['labels'], $t->getFieldname());\n array_push($fromfield['id'], $t->getId());\n }\n\n // Store Historytypes\n\n foreach (['books', 'issues', 'chapters', 'cloud', 'other', 'self', 'contributional', 'structural', 'fixed'] as $_ht) {\n $historytypes['id'][] = $_ht;\n $historytypes['labels'][] = $this->container->translations['field_historytype_'.$_ht];\n }\n\n // Todo\n $thisfields = [\n 'labels' => ['fielda', 'fieldb','fieldc'],\n 'id' => [1,2,3]\n ];\n\n $lengthinfluence = [\n 'title' => $this->container->translations['field_config'.'lengthinfluence'],\n 'options' => [\n 'collapsed' => true\n ],\n 'type' => 'array',\n 'propertyOrder' => 100,\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'row'],\n 'headerTemplate' => '{{ self.fieldname }}',\n 'properties' => [\n 'factor' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'lengthinfluence'.'factor'],\n ],\n 'fieldname' => [\n 'type' => 'string',\n 'uniqueItems' => true,\n 'enum' => [],//$fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'title' => [],//$this->container->translations['field_config'.'lengthinfluence'.'labels'],\n ]\n ]\n ]\n ]\n ];\n\n $schema = [\n 'title' => 'Field Configuration',\n 'type' => 'object',\n 'properties' => [\n 'imagesize' => [\n 'title' => $this->container->translations['field_config'.'imagesize'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => $this->container->translations['field_config'.'imagesize'.'row'],\n 'properties' => [\n 'width' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'width'],\n ],\n 'height' => [\n 'type' => 'integer',\n 'format' => 'number',\n 'title' => $this->container->translations['field_config'.'imagesize'.'height'],\n ]\n ]\n ]\n ],\n 'caption_variants' => [\n 'title' => $this->container->translations['field_config'.'imagecaptions'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 11,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'imagecaption'],\n ]\n ],\n 'history' => [\n 'title' => $this->container->translations['field_config'.'history'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'fullhistory' => [\n 'title' => $this->container->translations['field_config'.'fullhistory'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox',\n 'watch' => [\n 'hist' => 'history'\n ],\n 'hidden' => '!history'\n ],\n 'growing' => [\n 'title' => $this->container->translations['field_config'.'growing'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'maxlines' => [\n 'title' => $this->container->translations['field_config'.'maxlines'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'textlength' => [\n 'title' => $this->container->translations['field_config'.'textlength'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'lengthinfluence' => $lengthinfluence,\n 'rtfeditor' => [\n 'title' => $this->container->translations['field_config'.'rtfeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'markdowneditor' => [\n 'title' => $this->container->translations['field_config'.'markdowneditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'codeeditor' => [\n 'title' => $this->container->translations['field_config'.'codeeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'editorcolumns' => [\n 'title' => $this->container->translations['field_config'.'editorcolumns'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'object',\n 'format' => 'grid',\n 'title' => 'Line',\n 'properties' => [\n \"lines\" => [\n 'type' => 'integer',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'lines'],\n ],\n \"label\" => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'editorcolumns'.'label'],\n ]\n ]\n ]\n ],\n 'arrayeditor' => [\n 'title' => $this->container->translations['field_config'.'arrayeditor'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'columns' => [\n 'title' => $this->container->translations['field_config'.'columns'],\n 'type' => 'integer',\n 'propertyOrder' => 2\n ],\n 'colnames' => [\n 'title' => $this->container->translations['field_config'.'colnames'],\n 'options' => [\n 'collapsed' => true\n ],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'format' => 'text',\n 'title' => $this->container->translations['field_config'.'colnames'.'labels'],\n ]\n ],\n 'latitude' => [\n 'title' => $this->container->translations['field_config'.'latitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'longitude' => [\n 'title' => $this->container->translations['field_config'.'longitude'],\n 'type' => 'number',\n 'propertyOrder' => 0\n ],\n 'dateformat' => [\n 'title' => $this->container->translations['field_config'.'dateformat'],\n 'type' => 'string',\n 'propertyOrder' => 2,\n 'uniqueItems' => true,\n 'enum' => [\n 'd/m/Y H:i:s', 'd/m/Y H:i', 'd/m/Y', 'm/Y', 'Y'\n ],\n 'options' => [\n 'enum_titles' => [\n 'dd/mm/yyyy hh:mm:ss', 'dd/mm/yyyy hh:mm', 'dd/mm/yyyy', 'mm/yyyy', 'yyyy'\n ]\n ]\n ],\n 'integer' => [\n 'title' => $this->container->translations['field_config'.'integer'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'resolve_foreign' => [\n 'title' => $this->container->translations['field_config'.'resolve_foreign'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'multiple' => [\n 'title' => $this->container->translations['field_config'.'multiple'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n //cloud\n 'threeDee' => [\n 'title' => $this->container->translations['field_config'.'threeDee'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n 'history_command' => [\n 'title' => $this->container->translations['field_config'.'history_command'],\n 'format' => 'select',\n 'propertyOrder' => -1,\n 'uniqueItems' => true,\n 'type' => 'string',\n 'enum' => $historytypes['id'],\n 'options' => [\n 'enum_titles' => $historytypes['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //legends\n 'legends' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'legends'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string'\n ]\n ],\n //fixed\n 'fixedvalues' => [\n 'options' => [\n 'grid_columns' => 12,\n ],\n 'title' => $this->container->translations['field_config'.'fixedvalues'],\n 'propertyOrder' => 100,\n 'type' => 'array',\n 'format' => 'table',\n 'items' => [\n 'type' => 'string',\n 'title' => $this->container->translations['field_config'.'fixedvalues'.'row'],\n ]\n ],\n //issues, cloud, self, contributional\n 'restrict_to_open' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_open'],\n 'type' => 'boolean',\n 'propertyOrder' => 0,\n 'format' => 'checkbox'\n ],\n // not implemented so far\n 'restrict_to_book' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_book'],\n 'type' => 'boolean',\n 'propertyOrder' => 2,\n 'format' => 'checkbox'\n ],\n //issues, chapters\n 'frombook' => [\n 'title' => $this->container->translations['field_config'.'frombook'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 1,\n 'uniqueItems' => true,\n 'enum' => $frombook['id'],\n 'options' => [\n 'enum_titles' => $frombook['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other, self, contributional\n 'restrict_to_issue' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_issue'],\n 'type' => 'boolean',\n 'propertyOrder' => 4,\n 'format' => 'checkbox'\n ],\n //cloud, other, self, contributional\n 'fromissue' => [\n 'title' => $this->container->translations['field_config'.'fromissue'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 3,\n 'uniqueItems' => true,\n 'enum' => $fromissue['id'],\n 'options' => [\n 'enum_titles' => $fromissue['labels'],\n 'grid_columns' => 12,\n ]\n ],\n\n //contributional,\n 'restrict_to_chapter' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_chapter'],\n 'type' => 'boolean',\n 'propertyOrder' => 6,\n 'format' => 'checkbox'\n ],\n //contributional\n 'fromchapter' => [\n 'title' => $this->container->translations['field_config'.'fromchapter'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 5,\n 'uniqueItems' => true,\n 'enum' => $fromchapter['id'],\n 'options' => [\n 'enum_titles' => $fromchapter['labels'],\n 'grid_columns' => 12,\n ]\n ],\n // not implemented so far\n 'restrict_to_template' => [\n 'title' => $this->container->translations['field_config'.'restrict_to_template'],\n 'type' => 'boolean',\n 'propertyOrder' => 9,\n 'format' => 'checkbox'\n ],\n //contributional, structural\n 'fromtemplate' => [\n 'title' => $this->container->translations['field_config'.'fromtemplate'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 8,\n 'uniqueItems' => true,\n 'enum' => $fromtemplate['id'],\n 'options' => [\n 'enum_titles' => $fromtemplate['labels'],\n 'grid_columns' => 12,\n ]\n ],\n //cloud, other\n 'fromfield' => [\n 'title' => $this->container->translations['field_config'.'fromfield'],\n 'format' => 'select',\n 'type' => 'integer',\n 'propertyOrder' => 10,\n 'uniqueItems' => true,\n 'enum' => $fromfield['id'],\n 'options' => [\n 'enum_titles' => $fromfield['labels'],\n 'grid_columns' => 12,\n ]\n ],\n ],\n ];\n return json_encode($schema);\n }", "protected function configureValidations()\n {\n }", "public function rules()\n {\n return [\n 'file' => 'required|image|max:20000', //REQUIRED MONO AN TO DEFAULT EINAI EMPTY ETSI OSTE NA MI SKAEI ERROR STO PEOPLE\n 'filename' => '',\n ];\n }", "public function rules()\n {\n return array(\n array('file', 'file'),\n //array('file', 'file', 'types' => 'jpg, png, gif, jpeg', 'on'=>'create'),\n //array('file', 'file', 'allowEmpty' => true, 'types' => 'jpg, png, gif, jpeg', 'on' => 'update'),\n );\n }", "public function rules()\n {\n $rules = [\n 'file' => 'required|file',\n 'parentId' => 'nullable|integer|exists:file_entries,id',\n 'relativePath' => 'nullable|string|max:255',\n ];\n\n // validate by allowed extension setting\n if ($allowed = $this->settings->getJson('uploads.allowed_extensions')) {\n $rules['file'] .= '|mimes:' . implode(',', $allowed);\n }\n\n // validate by max file size setting\n if ($maxSize = (int) $this->settings->get('uploads.max_size')) {\n // size is stored in megabytes, laravel expects kilobytes\n $rules['file'] .= '|max:' . $maxSize * 1024;\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'source' => ['required', 'file', new AllowedExt(config('convert.allowed_extensions'))],\n 'options.tempo' => ['required', 'numeric', 'between:1,2'],\n 'options.pitch' => ['required', 'numeric', 'between:1,2'],\n 'options.volume' => ['required', 'numeric', 'between:0.1,2'],\n ];\n }", "function validate_import_file( $file, $allowed_files = '' ) {\n if ( false !== strpos( $file, '..' ))\n return 1;\n\n if ( false !== strpos( $file, './' ))\n return 1;\n\n if (!empty ( $allowed_files ) && (!in_array( $file, $allowed_files ) ) )\n return 3;\n/*\n if (':' == substr( $file, 1, 1 ))\n return 2;\n*/\n return 0;\n}", "public function checkConfig();", "public function isValid()\n {\n if (!file_exists($this->filename)) {\n $this->error = 'File does not exist';\n\n return false;\n }\n\n if (!is_readable($this->filename)) {\n $this->error = 'File is not readable';\n\n return false;\n }\n\n if (!$this->parseConfig()) {\n return false;\n }\n\n foreach ($this->connectionConfigRequired as $configKeyRequired) {\n if (!array_key_exists($configKeyRequired, $this->config->get('connection')) || is_null($this->config->get('connection.'.$configKeyRequired))) {\n $this->error = sprintf('Connection config key missing or null: %s', $configKeyRequired);\n }\n }\n\n $numberOfDatabases = count($this->get('databases', []));\n\n if ($numberOfDatabases === 0) {\n $this->error = 'No database configuration provided. Cannot continue.';\n\n return false;\n }\n\n if (!empty($this->error)) {\n return false;\n }\n\n return true;\n }", "public function loadWFData($table, $filename){\n //$filename = \"/Users/aprateek/Desktop/sms_cat_healthcare_speciality.csv\";\n error_log(\"Filenaem=\".$filename);\n $pd = array_map('str_getcsv', file($filename));\n $headers=array();\n foreach ($pd[0] as $head){\n $headers[]=trim($head);\n }\n if (count($headers) == 0){\n throw new Exception(\"The csv file has missing or malformed header\");\n }\n error_log(\"Head=\".SmsWfUtils::flatten($headers));\n \n try {\n $this->t_crtinsupd(\"DROP TABLE IF EXISTS \".$table.\";\");\n $create_stmt = \"CREATE TABLE IF NOT EXISTS \".$table.\" (\";\n foreach($headers as $head){\n $create_stmt .= self::esc($head).\" TEXT ,\";\n }\n $create_stmt = substr($create_stmt, 0, strlen($create_stmt) -1);\n $create_stmt .= \");\";\n error_log(\"create stmt=\".$create_stmt);\n $this->t_crtinsupd($create_stmt);\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while creating schema \".$e->getMessage());\n }\n \n try {\n foreach(array_splice($pd, 1) as $row){\n $insert_stmt=\"insert into \".$table.\" values (\";\n $data = array();\n for ($i=0; $i<count($pd[0]);$i++){\n $header = self::esc(trim($pd[0][$i]));\n $data[$header] = self::esc(trim($row[$i]));\n $insert_stmt .= \"'\".self::esc(trim($row[$i])).\"',\";\n }\n $insert_stmt = substr($insert_stmt, 0, strlen($insert_stmt) -1);\n $insert_stmt .= \");\";\n error_log(\"insert_stmt=\".$insert_stmt);\n $this->t_crtinsupd($insert_stmt);\n }\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while saving data \".$e->getMessage());\n }\n }", "public function rules()\n {\n return [\n 'logo' => ['required', 'file'],\n ];\n }", "public function rules()\n {\n return [\n 'preceding_number' => 'required',\n 'preceding_date' => 'required',\n 'preceding_time' => 'required',\n 'description' => 'required',\n// 'update_status' => 'required',\n// 'file.*' => 'required|mimes:pdf',\n ];\n }", "function patternentity_form_validate(&$form, &$form_state) {\n $validators = array('file_validate_extensions' => array('yaml xml'));\n //if (empty($form_state['value']['pattern_file'])) {\n // form_set_error('pattern_file', t('please choose a pattern file.'));\n //}\n //else {\n $file = file_save_upload('pattern_file', $validators);\n\n $file_exist = db_select('patternentity', 'pe')\n ->fields('pe', array('file_name'))\n ->condition('file_name', $file->filename, '=')\n ->execute()\n ->fetchAssoc();\n\n if ($file_exist) {\n form_set_error('pattern_file', t('pattern file already exists.'));\n }\n\n $form_state['storage']['file_obj'] = $file;\n $pattern = NULL;\n $file_extension = NULL;\n if ($file) {\n $file_extension = pathinfo($file->filename, PATHINFO_EXTENSION);\n\n // Choose appropriate function based on the file extension.\n // Can be FALSE, if no parser is found.\n $load_function = patterns_parser_get_parser_function($file_extension, PATTERNS_PARSER_LOAD);\n\n // Load and save pattern.\n if (!$load_function || !($pattern = $load_function($file->uri))) {\n form_set_error('pattern_file', t('parser pattern file failed.'));\n }\n\n if (!patterns_validate_pattern($pattern, $file_extension, PATTERNS_VALIDATE_SYNTAX)) {\n form_set_error('pattern_file', t('pattern file has wrong syntax.'));\n }\n }\n else {\n form_set_error('pattern_file', t('No file was uploaded.'));\n }\n \n if (isset($pattern['info']['title']) && !empty($pattern['info']['title'])) {\n $form_state['values']['title'] = $pattern['info']['title'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'title\\' field.'));\n }\n if (isset($pattern['info']['description']) && !empty($pattern['info']['description'])) {\n $form_state['values']['description'] = $pattern['info']['description'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'description\\' field.'));\n }\n if (isset($pattern['info']['category']) && !empty($pattern['info']['category'])) {\n $form_state['values']['category'] = $pattern['info']['category'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'category\\' field.'));\n }\n $form_state['values']['pattern'] = $pattern;\n if (isset($pattern['info']['author']) && !empty($pattern['info']['author'])) {\n $form_state['values']['author'] = $pattern['info']['author'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'author\\' field.'));\n }\n Global $user;\n $form_state['values']['uploader'] = $user->uid;\n $form_state['values']['file_name'] = $file->filename;\n $form_state['values']['file_format'] = $file_extension;\n //$form_state['values']['file_path'] = $file->uri;\n\n $dir = 'public://patternentity/';\n if (!file_prepare_directory($dir)) {\n form_set_error('pattern_file', t('public://patternentity doesn\\'t exist, or isn\\'t writable.'));\n }\n else {\n if ($file = file_move($file, $dir)) {\n $form_state['storage']['file_obj'] = $file;\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n $form_state['values']['file_path'] = $file->uri;\n }\n else {\n form_set_error('pattern_file', t('save to public dir failed'));\n }\n }\n //}\n}", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function rules()\n {\n return [\n 'name'=>'required|max:250',\n 'description'=>'max:1500',\n 'img'=>'max:1500|image',\n\t\t\t'file'=>'required|mimes:jpg,jpeg,png,pdf,doc,docx,pptx',\n ];\n }", "public function validate() {\n\t\t$errors = [];\n\t\t\n\t\t$requiredFiles = [\n\t\t\t\"{$this->dmDir}/config.json\",\n\t\t\t\"{$this->dmDir}/email-transport.json.template\",\n\t\t\t\"{$this->dmDir}/create-database.sql.template\",\n\t\t\t\"{$this->dmDir}/dbc.json.template\",\n\t\t];\n\t\t$missingFiles = [];\n\t\tforeach( $requiredFiles as $f ) {\n\t\t\tif( !file_exists($f) ) $missingFiles[] = $f;\n\t\t}\n\t\tif( $missingFiles ) {\n\t\t\t$errors[] = \"The following required files are missing:\\n- \".implode(\"\\n- \", $missingFiles);\n\t\t}\n\t\t\n\t\t$requiredConfigVars = [\n\t\t\t\"hostname-postfix\",\n\t\t\t\"deployment-root\",\n\t\t\t\"users\",\n\t\t\t\"users/postgres/username\",\n\t\t\t\"users/deployment-owner/username\",\n\t\t\t\"users/apache-manager/username\",\n\t\t\t\"sendgrid-password\",\n\t\t\t\"email-recipient-override\",\n\t\t];\n\t\t$missingConfigVars = [];\n\t\tforeach( $requiredConfigVars as $var ) {\n\t\t\tif( $this->getConfig($var,'__UNS') === '__UNS' ) {\n\t\t\t\t$missingConfigVars[] = $var;\n\t\t\t}\n\t\t}\n\t\tif( $missingConfigVars ) {\n\t\t\t$errors[] = \"The following required config entries are missing:\\n- \".implode(\"\\n- \",$missingConfigVars);\n\t\t}\n\t\t\n\t\tif( $errors ) {\n\t\t\tthrow new EarthIT_PhrebarDeploymentManager_EnvironmentException(implode(\"\\n\\n\", $errors));\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'file' => 'required|mimes:pdf|max:10240',\n 'description' => 'required|max:255',\n ];\n }", "public function rules()\n {\n return [\n [['file_id'], 'required'],\n [['file_id','ukuran'],'integer'],\n [['tgl_upload', 'tgl_proses'], 'safe'],\n [['namafile'], 'file','skipOnEmpty' => false, 'extensions' => 'xlsx', 'on' => 'create'],\n [['file_id'], 'unique'],\n ];\n }", "public function rules()\n {\n //dd(request()->all());\n return [\n \"file\"=>\"required|file|max:10240|mimes:jpeg,bmp,png,doc,docx,zip,xls,xlsx,pdf,mpga,mp4,mov,avi,wav,mpeg,mpeg4,dejaview\"\n ];\n }", "protected function loadExtLocalconfDatabaseAndExtTables() {}", "public function rules()\r\n {\r\n return array(\r\n array('csvFile', 'FileValidator', 'allowEmpty'=>false, 'types'=>'csv', 'maxSize'=>1024 * 1024 * 10),\r\n array('categoryId', 'numerical', 'integerOnly'=>true),\r\n array('delimiter', 'required'),\r\n array('skipFirstLine', 'boolean'),\r\n );\r\n }", "public function rules()\n {\n return [\n 'name' => [\n 'required',\n 'alpha_dash',\n 'max:50',\n Rule::unique('files')->where(function ($query) {\n $query->where('user_id', $this->user()->id);\n })\n ],\n 'description' => 'required|max:1000',\n 'file' => 'required|file|mimes:pdf|max:4000'\n ];\n }", "static function validate_db($name, $value)\n\t\t{\n\t\t\t$chomps = explode(\".\", $name);\n\t\t\t//we zoeken de db_meta\n\t\t\t$res = DBConnect::query(\"SELECT * FROM `sys_database_meta` WHERE `tablename`='\" . $chomps[0] . \"' AND `fieldname`='\" . $chomps[1] . \"'\", __FILE__, __LINE__);\n\t\t\tif($row = mysql_fetch_array($res))\n\t\t\t{\n\t\t\t\t$options = data_description::options_convert_to_array($row[\"datadesc\"], $row[\"data_options\"]);\n\t\t\t\treturn data_description::validate($value, $row[\"datadesc\"], $options, $name, $row[\"fieldlabel\"], $row[\"obligated\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn data_description::validate($value, 1, array(\"length\" => \"255\"), $name, $chomps[count($chomps)-1], 0);\n\t\t}", "private function getSchemaValidations(array $params) : void\n {\n // Logger.\n $this->logger->debugInit();\n \n // Validates number of parameters: 2 parameters expected (mode and schema name).\n $this->valNumberOfParams($params, 2);\n \n // Validates that mode is valid: input or output.\n $this->helper->valParamIsValid($params[0], 'schema_mode');\n \n // Validates that schema name is valid.\n $this->helper->valParamIsValid($params[1], 'schema_name');\n \n // Logger.\n $this->logger->debugEnd();\n \n }", "function onCheckSchema()\n {\n // Not sure we need a new data class for ContextIO. We should be able\n // to do everything with the existing Foreign_link and Foreign_user\n // table. Maybe.\n\n return true;\n }", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'alias' => 'required|max:255',\n 'description' => 'max:255',\n 'file' => 'mimes:doc,docx,dot,pdf,xlsx,xls,xlm,xla,xlc,xlt,xlw,xlam,xlsb,xlsm,xltm,csv|max:20480',\n 'link' => 'required_if:file,' . null . '|nullable|max:255|url',\n ];\n }", "public function rules()\n {\n // TODO\n $mimes = ['csv',\n 'xlsx',\n 'xls'\n ];\n\n return [\n 'file' => 'max:20000|mimes:csv,xls,xlsx|required'\n ];\n }", "public function valid_db_database()\n\t{\n\t\treturn $this->db_validation(1049, function() {\n\t\t\tee()->form_validation->set_message(\n\t\t\t\t'valid_db_database',\n\t\t\t\tlang('database_invalid_database')\n\t\t\t);\n\t\t});\n\t}", "public function validateSchema(): void\n {\n $schemaStructure = [\n 'connections' => [\n 'from' => [\n 'host', 'username', 'password'\n ],\n 'to' => [\n 'host', 'username', 'password'\n ]\n ]\n ];\n $this->handleSchemaRequirmentsChecks($schemaStructure);\n }", "protected function checkFileInternal(CheckContext $checkContext, Config $config)\n {\n $file = $checkContext->getFile();\n $lines = $file->getLines();\n\n $severityError = Violation::SEVERITY_ERROR;\n $severityWarning = Violation::SEVERITY_WARNING;\n $severityInfo = Violation::SEVERITY_INFO;\n\n if (count($lines) > 0) {\n $this->setLimit($severityError, $config->get('error_limit', $this->limits[$severityError]));\n $this->setLimit($severityWarning, $config->get('warning_limit', $this->limits[$severityWarning]));\n $this->setLimit($severityInfo, $config->get('info_limit', $this->limits[$severityInfo]));\n $this->setTabExpand($config->get('tab_expand', $this->tabExpand));\n\n foreach ($lines as $line => $data) {\n $lineLength = iconv_strlen(\n str_replace(\"\\t\", str_repeat(' ', $this->tabExpand), rtrim($data, \"\\r\\n\")),\n $file->getEncoding()\n );\n\n $severity = null;\n\n foreach (Violation::getSeverities() as $severity) {\n if (!isset($this->limits[$severity]) || $this->limits[$severity] === null) {\n continue;\n }\n\n if ($lineLength <= $this->limits[$severity]) {\n continue;\n }\n\n $this->addViolation(\n $file,\n $line,\n 0,\n sprintf('Line is too long. [%d/%d]', $lineLength, $this->limits[$severity]),\n $severity\n );\n }\n }\n }\n }", "function prepConfig() {\n\n global $db;\n global $lang;\n\n if($report = $db->query(\"CREATE DATABASE IF NOT EXISTS \".$lang[\"config_db_name\"].\"\")) {\n\n // Generate safety table\n if($report = $db->query(\"CREATE TABLE IF NOT EXISTS `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` ( `id` INT(6) NOT NULL AUTO_INCREMENT, `key` VARCHAR(100) NOT NULL, UNIQUE (`key`), `val` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;\")) {\n\n return \"Ready\";\n\n } else {\n\n return \"Failed to create table. Error: \".$db->error;\n\n }\n\n } else {\n\n return \"Failed to create database. Error: \".$db->error;\n\n }\n\n }", "function checkTablesIntegrity() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = $this->getTables();\n \n // Check the users table..\n if (!isset($tables[$this->prefix.\"users\"])) {\n return false; \n }\n \n \n \n // Check the taxonomy table..\n if (!isset($tables[$this->prefix.\"taxonomy\"])) {\n return false; \n }\n \n // Now, iterate over the contenttypes, and create the tables if they don't exist.\n foreach ($this->config['contenttypes'] as $key => $contenttype) {\n\n $tablename = $this->prefix . makeSlug($key);\n \n if (!isset($tables[$tablename])) {\n return false; \n }\n \n // Check if all the fields are present in the DB..\n foreach($contenttype['fields'] as $field => $values) {\n if (!isset($tables[$tablename][$field])) {\n return false;\n }\n }\n \n }\n\n \n return true; \n \n }", "public function pathToSQLFile();", "public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }" ]
[ "0.6250753", "0.62448406", "0.6236518", "0.58566236", "0.5837511", "0.5771383", "0.576261", "0.5757838", "0.5601796", "0.5567498", "0.5549463", "0.55373466", "0.5509063", "0.5500643", "0.54878914", "0.5486325", "0.548267", "0.54695153", "0.5462006", "0.54435194", "0.54195225", "0.54082054", "0.53992057", "0.536864", "0.5367384", "0.53296244", "0.5318638", "0.53149164", "0.5303778", "0.53033733", "0.53010064", "0.52876407", "0.5268149", "0.5266538", "0.5263471", "0.52538455", "0.5227604", "0.5227152", "0.52061516", "0.52051526", "0.5203657", "0.52022374", "0.5197267", "0.5184219", "0.51820546", "0.5160017", "0.5154152", "0.5151272", "0.51495916", "0.51492083", "0.5137659", "0.51300347", "0.5126958", "0.5121977", "0.51205564", "0.50994456", "0.5084014", "0.5081746", "0.50815696", "0.50788563", "0.5076733", "0.50747734", "0.5070951", "0.506759", "0.5029202", "0.5025709", "0.5020146", "0.50179857", "0.50110793", "0.5010615", "0.5009374", "0.5008221", "0.49975693", "0.49894544", "0.49838865", "0.49819118", "0.49812916", "0.49786565", "0.49747977", "0.4973817", "0.497337", "0.49710897", "0.49703693", "0.49689785", "0.49634993", "0.49631527", "0.49554837", "0.495528", "0.49506822", "0.4949567", "0.49465057", "0.49446765", "0.49438384", "0.4942339", "0.49393624", "0.4937984", "0.49347773", "0.4932872", "0.4932027", "0.4931067", "0.492612" ]
0.0
-1
Sets notification owner component
public function setOwner(NotificationManager $owner) { $this->owner = $owner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOwner(NotificationManager $owner);", "function set_owner($owner)\n {\n $this->set_default_property(self :: PROPERTY_OWNER, $owner);\n }", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "public function set_owner_id($owner)\n {\n $this->set_default_property(self::PROPERTY_OWNER_ID, $owner);\n }", "public function setOwner($owner)\n {\n parent::setOwner($owner);\n if ($owner) {\n Hacks::addCallbackMethodToInstance(\n $owner,\n 'get'.$this->contentField(),\n function () use ($owner) {\n return $owner->getContentField();\n }\n );\n }\n }", "public function setOwner(User $owner)\n {\n $this->owner = $owner;\n }", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function setOwner(\\SetaPDF_Core_Type_Owner $owner) {}", "public function attach ( $owner ) {\n\t\tparent::attach($owner);\n\t}", "function ownerClass()\n\t{\n\t\t$this->m_owner = array('pkowner_id'=>\"\", 'organization_name'=>\"\", 'owner_name'=>\"\", 'owner_address'=>\"\", 'owner_phone_bus'=>\"\", 'owner_phone_res'=>\"\", 'owner_fax'=>\"\", 'email'=>\"\", 'foip'=>\"\", 'owner_type'=>\"\"); \n\t}", "protected function handleOwner()\n {\n if ( !ezcBaseFeatures::hasFunction( 'posix_getpwuid' ) )\n {\n return;\n }\n\n $t =& $this->properties;\n\n if ( posix_geteuid() === 0 && isset( $t['userName'] ) && $t['userName'] !== '' )\n {\n if ( ( $userName = posix_getpwnam( $t['userName'] ) ) !== false )\n {\n $t['userId'] = $userName['uid'];\n }\n if ( ( $groupName = posix_getgrnam( $t['groupName'] ) ) !== false )\n {\n $t['groupId'] = $groupName['gid'];\n }\n }\n }", "public function attach( Component $owner ) {\n\t\t$this->owner = $owner;\n\t\t$owner->attachBehavior( self::getClassName(), $this );\n\t}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {\r\n return $this->owner;\r\n }", "public function getUOwner()\n {\n return null;\n }", "public function getUOwner()\n {\n return null;\n }", "function get_owner()\n {\n return $this->get_default_property(self :: PROPERTY_OWNER);\n }", "public function getOwner();", "public function getOwner();", "public function getOwner();", "private function setOwner($subject, $view)\r\n {\r\n $user = $this->contract->user;\r\n $this->messages[$user->id] = [\r\n $subject,\r\n $view,\r\n [\r\n 'user' => $user,\r\n ]\r\n ];\r\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->_owner;\n }", "public function setOwner($var)\n {\n GPBUtil::checkString($var, True);\n $this->owner = $var;\n\n return $this;\n }", "public function setOwnerId($owner_id)\n {\n $this->owner_id = $owner_id;\n }", "public function setOwnerId($owner_id)\n {\n $this->owner_id = $owner_id;\n }", "public function getOwner() {\n\t\treturn $this->owner;\n\t}", "public function setOwner($user_id)\r\n {\r\n $this->owner = $user_id;\r\n }", "public function __construct(CLICommand $owner) {\n $this->ownerCommand = $owner;\n }", "protected function set_owner_id($owner_id)\n {\n $this->owner_id = $owner_id;\n }", "public function setOwner($val)\n {\n $this->_propDict[\"owner\"] = $val;\n return $this;\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : '';\n }", "public function setOwner($value)\n {\n return $this->set(self::_OWNER, $value);\n }", "public function setOwnerNameId($username) {\n $this->_owner = $username;\n }", "function roomify_conversations_add_owner_user_reference_field() {\n field_info_cache_clear();\n\n // \"conversation_owner_user_ref\" field.\n if (field_read_field('conversation_owner_user_ref') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_owner_user_ref',\n 'type' => 'entityreference',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'target_type' => 'user',\n ),\n );\n field_create_field($field);\n }\n\n // \"conversation_owner_user_ref\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_owner_user_ref', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_owner_user_ref',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'Owner',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'entityreference_autocomplete',\n ),\n );\n field_create_instance($instance);\n }\n}", "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}", "function getOwner() \n {\n return $this->instance->getOwner();\n }", "public function setRowsOwnerView()\n {\n return 'files.rows.set_rows_owner';\n }", "public function getOwner(): string\n {\n return $this->owner;\n }", "public function setPhotoSender($photoSender ){\n $this->photoSender = $photoSender;\n }", "function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }", "public function get_owner_id()\n {\n return $this->get_default_property(self::PROPERTY_OWNER_ID);\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }", "protected function get_owner_id()\n {\n return $this->owner_id;\n }", "function setOwner($user) \n {\n return $this->instance->setOwner($user);\n }", "public function getOwner()\n {\n if (array_key_exists(\"owner\", $this->_propDict)) {\n return $this->_propDict[\"owner\"];\n } else {\n return null;\n }\n }", "function getOwner()\n\t{\n\t\treturn $this->m_owner;\t\t\t\t// return class attributes \n\t}", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "public function setOwner(ActiveRecord $owner): self\n {\n $this->globalParentNode = $owner->id;\n $this->companyIdentify = $owner->getAttribute('companyId');\n $db = $this->getDb();\n $nodes = $db->createCommand('SELECT id from ' . self::tableName() . ' where companyId=' . $this->companyIdentify)\n ->queryAll();\n $this->nodeIdList = array_column($nodes, 'id');\n\n return $this;\n }", "public function getOwner()\n {\n return $this->data['owner'];\n }", "public function getOwner() {\n return $this->ownerCommand;\n }", "public function getOwner() {\n\t\telgg_deprecated_notice(\"ElggExtender::getOwner deprecated for ElggExtender::getOwnerGUID\", 1.8);\n\t\treturn $this->getOwnerGUID();\n\t}", "public function getowner_id()\n {\n return $this->owner_id;\n }", "public function setOwner(HTML_QuickForm2_Node $owner)\r\n {\r\n if (!$owner instanceof HTML_QuickForm2_Container) {\r\n throw new HTML_QuickForm2_InvalidArgumentException(\r\n 'Each Rule can only validate Containers, '.\r\n get_class($owner) . ' given'\r\n );\r\n }\r\n parent::setOwner($owner);\r\n }", "public function setOwner($owner)\n {\n $this->owner = $owner;\n return $this;\n }", "public static function setNotificationBubble()\n {\n $on = self::checkNotificationsOn();\n\n if ($on == \"on\") {\n $con = $GLOBALS[\"con\"];\n $user = $_SESSION[\"staff_id\"];\n $sql = \"SELECT notification_counter from user where staff_id = $user\";\n $result = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($result)) {\n $count = $row['notification_counter'];\n if ($count != 0) {\n return \"<script>document.getElementById(\\\"notify-container\\\");</script>\" . $count;\n } else {\n return \"<script>document.getElementById(\\\"notify-container\\\").style.display = \\\"none\\\";</script>\";\n }\n }\n }\n }", "public function getOwnerIdentifier();", "function getOwner() {\n $user =& Element_Factory::makeElement( 'Bm_Users' );\n $user->get( $this->author );\n\n return $user->login;\n }", "public function owner()\n {\n return $this->morphTo('owner');\n }", "public function owner()\n {\n return $this->morphTo('owner');\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function getOwnerID() {\n\t\treturn $this->owner_id;\n\t}", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function setComentCreator($value)\n {\n $this->commentCreator=$value;\n }", "public function owner()\n {\n return $this->belongsTo(Jetstream::userModel(), 'user_id');\n }", "public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}", "protected function getOwnerName() {\n $owner_name = 'user';\n return $owner_name;\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'id_owner');\n }", "public function getOwner()\n {\n return $this->get(self::_OWNER);\n }", "public function getOwnerGUID() {\n\t\treturn $this->owner_guid;\n\t}", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id');\n }", "public function createOwner();", "public function getProductOwner()\n {\n return $this->productOwner;\n }", "public static function ownerOnly(){\n return TRUE;\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id', 'id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id', 'id');\n }", "public function getOwnerEntity() {\n\t\treturn get_entity($this->owner_guid);\n\t}", "public function setOwnerId($data)\n {\n $this->_OwnerId=$data;\n return $this;\n }", "public function getOwnerId()\n {\n return $this->_OwnerId;\n }", "public function setSimulationNotification(?SimulationNotification $value): void {\n $this->getBackingStore()->set('simulationNotification', $value);\n }", "protected function _getContactOwner()\n {\n return $this->params['name'];\n }", "public function setSender($sender);", "public function setOwner(string $input)\n {\n $this->owner = $input;\n return $this;\n }", "public function setOwner($value)\n {\n if (is_array($value)) {\n $value = new Carerix_Api_Rest_Entity_CRUser($value);\n }\n $this->owner = $value;\n return $this;\n }", "function readOwner() { return($this->owner); }", "public function setOwner($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Storage\\V2\\Owner::class);\n $this->owner = $var;\n\n return $this;\n }", "public function getOwnerId()\n {\n return $this->user_id;\n }", "function setNotify($notify) {\r\r\n\t\t$this->notify = $notify;\r\r\n\t}", "abstract protected function getAppOwner(): string;", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }" ]
[ "0.78671986", "0.68298733", "0.6621755", "0.6621755", "0.64518267", "0.6439909", "0.63252306", "0.5952486", "0.58814526", "0.58814526", "0.5719567", "0.5717477", "0.57099646", "0.56984365", "0.56136274", "0.56136274", "0.56136274", "0.56134266", "0.5607051", "0.55967706", "0.55967706", "0.55912375", "0.5562586", "0.5562586", "0.5562586", "0.5538281", "0.55346537", "0.55346537", "0.55346537", "0.551895", "0.55059755", "0.55005705", "0.55005705", "0.5494852", "0.54876363", "0.54837155", "0.5478472", "0.547281", "0.54569906", "0.54172117", "0.5414828", "0.5400512", "0.5396903", "0.5379356", "0.53522444", "0.5328306", "0.5327704", "0.5315851", "0.5301697", "0.5301361", "0.5263239", "0.5261737", "0.5255806", "0.5255686", "0.5199299", "0.5198748", "0.5181428", "0.5134164", "0.5132126", "0.5123764", "0.5121962", "0.5119689", "0.51108694", "0.5098122", "0.507675", "0.50612855", "0.5054575", "0.5054575", "0.5048803", "0.5048586", "0.5044447", "0.5044447", "0.5006704", "0.4999884", "0.49969208", "0.49932897", "0.4989562", "0.49856606", "0.49783355", "0.4968468", "0.4960051", "0.49547955", "0.49337488", "0.4931064", "0.4931064", "0.49310234", "0.4906994", "0.49006686", "0.4889239", "0.4880325", "0.48772457", "0.48722646", "0.48624343", "0.4853712", "0.4850913", "0.48466492", "0.4821108", "0.4810717", "0.4799425" ]
0.78097594
2