query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Registers the given queue in storage
public function register(QueueInterface $queue);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->errorIfClosed();\n\n $this->driver->createQueue($this->name);\n }", "public function addQueue($data) {\n $this->queue[] = $data;\n }", "function &add_queue($interface, &$queue, &$path, &$input_errors) {\n\t\treturn;\n\t}", "public function push($queue, $item)\n {\n }", "public function save(Data\\QueueInterface $queue);", "public function queue(QueueManagerInterface $queue);", "public function queue(string $queue): self\n {\n return $this->add('queue', '=', $queue);\n }", "protected function registerQueuedCommand(): void\n {\n $this->app->singleton('orchestra.commands.tenanti.queue', static function () {\n return new QueuedCommand();\n });\n }", "public function queue_enqueue(&$queue, $value) { \n // We are just adding a value to the end of the array, so can use the \n // [] PHP Shortcut for this. It's faster than using array_push \n $queue[] = $value; \n}", "function enqueue($entity, string $queue = QueueInterface::QUEUE_NORMAL, bool $forceEnqueue = false);", "public function locate(Queue $queue);", "public function store(QueueRequest $request)\n {\n $data = $request->all();\n if (Queue::create($data)){\n return redirect(route('admin.queue'))->with(['success'=>'添加成功,请更新配置']);\n }\n return back()->withErrors(['error'=>'添加失败']);\n }", "protected function registerConsumer(RdKafka\\Queue $queue, ConsumerInterface $consumer)\n {\n $config = $consumer->getTopicConfig();\n\n foreach ($consumer->getTopics() as $name => $partitions) {\n foreach ($partitions as $partition) {\n $topic = $this->kafka->newTopic($name, $config);\n\n $topic->consumeQueueStart(\n (int) $partition,\n $consumer->getOffset(),\n $queue\n );\n\n if (!isset($this->topics[$name])) {\n $this->topics[$name] = [];\n }\n\n if (!isset($this->topics[$name][$partition])) {\n $this->topics[$name][$partition] = [];\n }\n\n $this->topics[$name][$partition][] = new ArrayObject([\n 'topic' => $topic,\n 'consumer' => $consumer,\n 'running' => true\n ]);\n\n $this->running++;\n }\n }\n }", "public function enqueue();", "function operationQueuePush($toAdd) {\n file_put_contents($_SERVER['DOCUMENT_ROOT'] . \"/data/operation_queue.dat\", $toAdd . \"\\n\", FILE_APPEND | LOCK_EX);\n}", "protected function registerQueueTransactions()\n\t{\n\t\t$app = $this->app;\n\n\t\t$app['queue']->before(function (JobProcessing $event) use ( $app ) {\n\t\t\t$app['newrelic']->backgroundJob( true );\n\t\t\t$app['newrelic']->startTransaction( ini_get('newrelic.appname') );\n\t\t\tif ($app['config']->get( 'newrelic.auto_name_jobs' )) {\n\t\t\t\t$app['newrelic']->nameTransaction( $this->getJobName($event) );\n\t\t\t}\n\t\t});\n\n\t\t$app['queue']->after(function (JobProcessed $event) use ( $app ) {\n\t\t\t$app['newrelic']->endTransaction();\n\t\t});\n\t}", "public function fireQueue($queue, $event){ }", "public function push($queue, $partition, $job)\n {\n $partitionKey = $this->partitionKey($queue, $partition);\n $listKeyName = $this->queuePartitionsListKeyName($queue);\n\n $this->redis->rpush($partitionKey, $job);\n $this->redis->sadd($listKeyName, $partition);\n }", "abstract public function addCommandToQueue(array $parameters);", "public function enqueue() {}", "public function enqueue() {}", "public function enqueue() {}", "public function queue(?string $queue = null): bool;", "public function hasQueue(Queue $queue);", "public function __construct(Queue $queue)\n {\n $this->queue = $queue;\n }", "public function getMessageQueue( $resource, $queue );", "final public static function registerStorage(string $name):void\n {\n static::$param['storageClass'][$name] = static::class;\n }", "public function enqueue() {\n }", "public function __construct(\\blaze\\collections\\Queue $queue) {\n parent::__construct($queue);\n $this->queue = $queue;\n }", "public function get($queue)\n\t{\n\t\treturn new Queue($this->adapter, $this->container, $queue);\n\t}" ]
[ "0.67252326", "0.6458529", "0.6437159", "0.6427236", "0.6352527", "0.63434625", "0.6330891", "0.62882954", "0.6212286", "0.61856544", "0.6151884", "0.59550506", "0.5940885", "0.5807316", "0.57975125", "0.5792854", "0.578402", "0.57565665", "0.57439166", "0.57431346", "0.57431346", "0.57431346", "0.5721879", "0.5689757", "0.56449014", "0.5635743", "0.5604459", "0.56019413", "0.5590763", "0.5583328" ]
0.78119534
0
Is the given queue already registered?
public function isRegistered(QueueInterface $queue);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasQueue(Queue $queue);", "protected function queue_exists()\n\t{\n\t\treturn PGQ::queue_exists($this->log, $this->pg_src_con, $this->qname);\n\t}", "public function hasQueueingBus(): bool;", "function interface_has_queue($if) {\n\tglobal $config;\n\n\tif ($config['shaper']) {\n\t\tforeach ($config['shaper']['queue'] as $queue) {\n\t\t\tif ($queue['interface'] === $if) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}", "public function queue(?string $queue = null): bool;", "private function queueGraphExists()\n {\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug('Checking for queue graph existance: '.\n\t ($this->getQueueGraphExistsFlag()?\"skip\":\"proceed\"));\n\n\t// Queue graph existance has been checked already\n\tif( $this->getQueueGraphExistsFlag()) return true;\n\n // If there is at least one :Queue node in the db\n $query = 'MATCH (h:Head) MATCH (t:Tail) MATCH (c:Current)\nMATCH (p:Status{status:\"Pending\"})\nRETURN id(h) AS head, id(t) AS tail, id(c) AS current, id(p) AS pending LIMIT 1';\n $result = $this->neo4j_client->run($query, null);\n\n // We expect a single record or null\n foreach ( $result->getRecords() as $record)\n if( $record->value('head') != null &&\n\t $record->value('tail') != null &&\n\t $record->value('current') != null &&\n\t $record->value('pending') != null) {\n\t $this->setQueueGraphExistsFlag( true);\n\t return true;\n\t }\n\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug('Queue graph does NOT exist!');\n\n return false;\n }", "private function queueNodeExists( $qid)\n {\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug( \"Checking for queue node \".$qid.\" existance.\");\n\n\t// Check if queue node present\n\tif( !$this->queueGraphExists()) return false;\n\n $query = 'MATCH (q:Queue) WHERE id(q) = {qid}\nRETURN id(q) AS qid LIMIT 1';\n\n $params = [\"qid\" => intval( $qid)];\n $result = $this->neo4j_client->run($query, $params);\n\n foreach ($result->records() as $record)\n if( $record->value('qid') != null)\n return true;\n\n\tif( $_ENV['APP_DEBUG'])\n $this->logger->debug('Queue node does NOT exist');\n\n // Return\n return false;\n }", "public function __isset($name)\n {\n return isset($this->queues[$name]);\n }", "function IsQueue($queueid=0, $queuetype='')\n\t{\n\t\t$query = \"SELECT queueid FROM \" . SENDSTUDIO_TABLEPREFIX . \"queues WHERE queueid='\" . $this->Db->Quote($queueid) . \"' AND queuetype='\" . $this->Db->Quote($queuetype) . \"' LIMIT 1\";\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = $this->Db->Fetch($result);\n\t\tif (empty($row)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($row['queueid'] <= 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isQueued(): bool;", "public static function canRunJobFromQHostQueue()\n {\n return ( \n self::getConfig(\"can_run_job_from_host_queue\") === \"1\" \n );\n }", "final public function isQueued(): bool\n {\n return $this->getState() === self::STATE_QUEUED;\n }", "public function locate(Queue $queue);", "public function registered($shortcode)\n {\n return array_key_exists($shortcode, self::$shortcodes);\n }", "public function isRegistered(): bool;", "public function register(QueueInterface $queue);", "public function queue_exhausted($queue)\n {\n if ($queue->count() === 0) {\n return true;\n }\n $queue->reset();\n while($queue->valid()) {\n // if a non exhausted handle is found return false\n if (!$queue->current()[0]->is_exhausted()) {\n return false;\n }\n $queue->next();\n }\n return true;\n }", "public static function registered($name)\r\n {\r\n return array_key_exists($name, static::$registry);\r\n }", "public function issetQueues($index)\n {\n return isset($this->queues[$index]);\n }", "protected function is_queue_empty() {\n\t\tglobal $wpdb;\n\n\t\t$key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%';\n\n\t\t$count = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM {$wpdb->options}\n\t\t\tWHERE option_name LIKE %s\n\t\t\", $key ) );\n\n\t\treturn $count <= 0;\n\t}", "public function isQueued()\n {\n return $this->status === RefundStatus::STATUS_QUEUED;\n }", "function hasRegistration();", "public function isEnqueued($test)\n {\n return\n $test->state == Constants::STATE_QUEUED\n &&\n QueueModel::where('test_id', $test->id)->first();\n }", "public function isRegistered($objectName);", "protected function isQueuable() {\n return !empty($this->execResults['queue']) && $this->runSession->getRun()->cron_active;\n }", "public static function is_registered( $slug ) {\n\t\treturn \\WP_Block_Type_Registry::get_instance()->is_registered( $slug );\n\t}", "public static function hasPushed($job)\n {\n /** @var \\Illuminate\\Support\\Testing\\Fakes\\QueueFake $instance */\n return $instance->hasPushed($job);\n }", "public function get($queueParam)\n {\n return true;\n }", "public function is_registered( )\n\t{\n\n\t}", "public function hasMQ()\n {\n return ($this->mq instanceof MQF_MultiQueue) ? true : false;\n }" ]
[ "0.826342", "0.7555615", "0.750101", "0.7165995", "0.713587", "0.6802425", "0.67212445", "0.6570112", "0.644886", "0.6271037", "0.61751693", "0.6164719", "0.6050989", "0.6029789", "0.6016399", "0.59908026", "0.59868956", "0.5937433", "0.59179837", "0.5885524", "0.5880939", "0.5879471", "0.58614165", "0.5846534", "0.581158", "0.57841927", "0.57735276", "0.5770609", "0.57356644", "0.57210505" ]
0.8443392
0
Registers URL file handler for avatars
static function registerAvatarFileHandler() { vManager\Modules\System\FilesPresenter::$handers[] = function ($filename) { // Filtering exact match, for security reasons if(Nette\Utils\Strings::match($filename, '/^\/'.User::AVATAR_DIR.'\/[0-9]+\.(png|jpg|gif)$/')) { $filepath = FILES_DIR . $filename; if(file_exists($filepath)) return new vBuilder\Application\Responses\FileResponse($filepath); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function registerLogoFileHandler() {\n\t\tvManager\\Modules\\System\\FilesPresenter::$handers[] = function ($filename) {\n\t\t\t\t\t\t\n\t\t\tif(($matches = Nette\\Utils\\Strings::match($filename, '/^\\/logo\\.(png|jpg|gif|svg)$/i')) !== null) {\n\t\t\t\t$path = FILES_DIR . '/logo.' . $matches[1];\n\t\t\t\t\n\t\t\t\t$response = new vBuilder\\Application\\Responses\\FileResponse($path, null, strcasecmp($matches[1], 'svg') == 0 ? 'image/svg+xml' : null);\n\t\t\t\t$response->setContentDisposition('inline');\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t};\n\t}", "protected function registerFilesHandler()\n {\n $this->app->bind(FilesHandlerInterface::class, function($app, array $data = []){\n return new FilesHandler();\n });\n\n $this->app->alias(FilesHandlerInterface::class, 'handlers.file');\n }", "protected function handleAvatar() // image\r\n {\r\n $sizes = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\r\n $aPath = 'uploads/avatars/%d.jpg';\r\n $s = $this->_get['size'] ?: 'medium';\r\n\r\n if (!$this->_get['id'] || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->_get['id'][0], $matches) || !in_array($s, array_keys($sizes)))\r\n return;\r\n\r\n $this->contentType = 'image/'.$matches[2];\r\n\r\n $id = $matches[1];\r\n $dest = imageCreateTruecolor($sizes[$s], $sizes[$s]);\r\n\r\n if (file_exists(sprintf($aPath, $id)))\r\n {\r\n $offsetX = $offsetY = 0;\r\n\r\n switch ($s)\r\n {\r\n case 'tiny':\r\n $offsetX += $sizes['small'];\r\n case 'small':\r\n $offsetY += $sizes['medium'];\r\n case 'medium':\r\n $offsetX += $sizes['large'];\r\n }\r\n\r\n $src = imageCreateFromJpeg(printf($aPath, $id));\r\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $sizes[$s], $sizes[$s], 100);\r\n }\r\n\r\n if ($matches[2] == 'gif')\r\n imageGif($dest);\r\n else\r\n imageJpeg($dest);\r\n\r\n return;\r\n }", "function get_avatar() {}", "function hook_file_url_alter(&$uri) {\n global $user;\n\n // User 1 will always see the local file in this example.\n if ($user->uid == 1) {\n return;\n }\n\n $cdn1 = 'http://cdn1.example.com';\n $cdn2 = 'http://cdn2.example.com';\n $cdn_extensions = array('css', 'js', 'gif', 'jpg', 'jpeg', 'png');\n\n // Most CDNs don't support private file transfers without a lot of hassle,\n // so don't support this in the common case.\n $schemes = array('public');\n\n $scheme = file_uri_scheme($uri);\n\n // Only serve shipped files and public created files from the CDN.\n if (!$scheme || in_array($scheme, $schemes)) {\n // Shipped files.\n if (!$scheme) {\n $path = $uri;\n }\n // Public created files.\n else {\n $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme);\n $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($uri);\n }\n\n // Clean up Windows paths.\n $path = str_replace('\\\\', '/', $path);\n\n // Serve files with one of the CDN extensions from CDN 1, all others from\n // CDN 2.\n $pathinfo = pathinfo($path);\n if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) {\n $uri = $cdn1 . '/' . $path;\n }\n else {\n $uri = $cdn2 . '/' . $path;\n }\n }\n}", "public function getAvatarWithPath()\n {\n return '/avatars/'.$this->getAvatar();\n }", "public function addResource($handler, $prefix=null) {}", "protected function getUrlUploadHandler() {\r\n return $_SERVER['SCRIPT_NAME'] . '/paperclip/uploadHandler';\r\n }", "public function upload_avatar($source) {\n }", "function image_url($filename)\n{\n return asset('/uploads/avatars/'. $filename);\n}", "function profile_icon_handler($page) {\n\n\t\t\tglobal $CONFIG;\n\n\t\t\t// The username should be the file we're getting\n\t\t\tif (isset($page[0])) {\n\t\t\t\tset_input('username',$page[0]);\n\t\t\t}\n\t\t\tif (isset($page[1])) {\n\t\t\t\tset_input('size',$page[1]);\n\t\t\t}\n\t\t\t// Include the standard profile index\n\t\t\tinclude($CONFIG->pluginspath . \"profile/icon.php\");\n\n\t\t}", "public function registerMediaCollections(): void\n {\n $this->addMediaCollection('avatar')\n ->singleFile()\n ->acceptsMimeTypes(['image/jpg', 'image/jpeg', 'image/png', 'image/gif']);\n }", "function avatar_urls() {\n\t\tif ( ! $this->_avatars ) {\n\t\t\t$this->_avatars = new PWCCRM_UserAvatars( $this->_user_id );\n\t\t}\n\t\treturn $this->_avatars;\n\t}", "public function avatar(){\n\t\t$avatar = $this->User_model->getAvatar($this->_data['data']['iauth_user_id'])->avatar;\n\n\t\t$this->_data['avatar'] = $avatar;\n\t\t$this->loadViews('user/avatar');\n\t}", "public function uploadAvatar(Request $request)\n {\n // whats returned\n //\"SEAKA/PROFILE/xtF4eO7htlESuemnbObErsYQ8L5TSpfQu06PjBGu.png\"\n $validator = Validator::make($request->all(), ['avatar' => 'required']);\n if ($validator->fails()){\n return Response::sendJsonError($validator->errors(), ResponseMessage::INVALID_PARAMS, ResponseCode::HTTP_UNPROCESSABLE_ENTITY);\n }\n\n $user = $request->user();\n\n //Config::set('filesystems.disks.do_spaces.bucket', 'space-prac/seaka/profile');\n //Config::set('filesystems.disks.do_spaces.bucket', 'profile_pics');\n $user->addMedia($request->file('avatar'))->toMediaCollection('avatar');\n $avatars = $request->user()->getMedia('avatar');\n //$avatars[count($avatars) - 1]->getFullUrl();\n // TODO : save this url on the users data. create a new column and save it.\n //dd($response);\n\n return response()->sendJsonSuccess(['url' => $avatars[count($avatars) - 1]->getFullUrl()], sprintf(ResponseMessage::PICTURE_UPLOAD_SUCCESSFUL, 'Avatar'), ResponseCode::HTTP_OK);\n\n }", "public function regist(Request $request)\n {\n $User = Auth::user();\n $validatedData = $request->validate([\n 'avatar' => 'required|file|image',\n ]);\n\n $path = $request->file('avatar')->store('public/user');\n $cutpath = explode('/', $path);\n $filename = array_pop($cutpath);\n\n $UserAvatar = UserAvatar::create([\n 'user_id' => $User->id,\n 'protcol' => 0,\n 'filename' => $filename,\n ]);\n return redirect()->route('user_avatar');\n }", "function mod_user_avatar_apply_avatar_to_user($profile)\n{\n global $PHORUM;\n\n // Setup the default avatar image as a starting point.\n $url = $PHORUM['mod_user_avatar']['default_avatar'];\n $profile['MOD_USER_AVATAR'] = $url;\n\n // Check if we have an avatar for this user.\n if (empty($profile[\"mod_user_avatar\"][\"avatar\"]) ||\n $profile[\"mod_user_avatar\"][\"avatar\"] == -1) {\n return $profile;\n }\n\n // Add a Gravatar to the profile data.\n if ($profile[\"mod_user_avatar\"][\"avatar\"] == -2) {\n $profile[\"MOD_USER_AVATAR\"] =\n mod_user_avatar_get_gravatar_url($profile);\n return $profile;\n }\n\n // Add a standard avatar to the profile data.\n $file_id = $profile['mod_user_avatar'][\"avatar\"];\n $profile[\"MOD_USER_AVATAR\"] = phorum_get_url(\n PHORUM_FILE_URL,\n \"file=$file_id\"\n );\n\n return $profile;\n}", "protected function uploadAvatar()\n {\n if(! $this->file ) return;\n $name = $this->makeFileName();\n $this->user['avatar'] = '/' . $this->baseDir . $name;\n $this->file->move($this->baseDir, $name);\n $this->fitAvatar($this->user['avatar']);\n }", "public function registerImage($request);", "function avatars_entity_icon_url_handler($hook, $type, $return, $params) {\n\n\t$entity = elgg_extract('entity', $params);\n\t$size = elgg_extract('size', $params);\n\n\tif (!avatars_enabled($entity->getType(), $entity->getSubtype())) {\n\t\treturn;\n\t}\n\n\t$avatar = avatars_get_avatar($entity);\n\tif ($avatar) {\n\t\treturn $avatar->getIconURL($size);\n\t}\n}", "public function getAvatarUrlAttribute()\n {\n return asset(config('define.images_path_users') . $this->avatar);\n }", "public function store(StoreMemberAvatar $request) {\n if ($request->hasFile('link') && $request->file('link')->isValid()) {\n $avatar = $request->file('link');\n Auth::guard('web_member')->user()->avatar()->update([\n 'link' => $avatar->store('public/avatars')\n ]);\n return redirect('memberprofile')->with('success', 'Profile photo updated successfully.');\n } else {\n return redirect('memberavatar')->with('error', 'Error uploading file. Please try again.');\n }\n }", "function profile_usericon_hook($hook, $entity_type, $returnvalue, $params)\n\t\t{\n\t\t\tglobal $CONFIG;\n\n\t\t\tif ((!$returnvalue) && ($hook == 'entity:icon:url') && ($params['entity'] instanceof ElggUser))\n\t\t\t{\n\n\t\t\t\t$entity = $params['entity'];\n\t\t\t\t$type = $entity->type;\n\t\t\t\t$subtype = get_subtype_from_id($entity->subtype);\n\t\t\t\t$viewtype = $params['viewtype'];\n\t\t\t\t$size = $params['size'];\n\t\t\t\t$username = $entity->username;\n\t\t\t\t$network = $params['network'];\n\t\t\t\t\n\t\t\t\tif ($icontime = $entity->icontime) {\n\t\t\t\t\t$icontime = \"{$icontime}\";\n\t\t\t\t} else {\n\t\t\t\t\t$icontime = \"default\";\n\t\t\t\t}\n\n\t\t\t\tif ($entity->isBanned()) {\n\t\t\t\t\treturn elgg_view('icon/user/default/'.$size);\n\t\t\t\t}\n\n\t\t\t\t$filehandler = new ElggFile();\n\t\t\t\t$filehandler->owner_guid = $entity->getGUID();\n\n\t\t\t\tif($network == \"\"){\n\t\t\t\t\t$network = $_SESSION['user']->get_user_relationship($params['entity']);\n\t\t\t\t}\n\t\t\t\t//\tif($network == \"\")\n\t\t\t\t\t//\t$network = \"public\";\n\n\n\t\t\t\t$filehandler->setFilename(\"profile/\" . $username .$network. $size . \".jpg\");\n\n\t\t\t\tif ($filehandler->exists()) {\n\t\t\t\t\t//$url = $CONFIG->url . \"pg/icon/$username/$size/$icontime.jpg\";\n\t\t\t\t\treturn $CONFIG->wwwroot . 'mod/profile/icondirect.php?lastcache='.$icontime.'&username='.$entity->username.'&joindate=' . $entity->time_created . '&guid=' . $entity->guid . '&size='.$size. '&network='.$network;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function profile_handleAvatar() // image\n {\n $s = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\n $size = $this->get('size') ?: 'medium';\n\n if (!$this->get('id') || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->get('id'), $matches) || !in_array($size, array_keys($s)))\n return false;\n\n header('Content-Type: image/'.$matches[2]);\n\n $id = $matches[1];\n $dest = imageCreateTruecolor($s[$size], $s[$size]);\n\n if (file_exists('uploads/avatars/'.$id.'.jpg'))\n {\n $offsetX = $offsetY = 0;\n\n switch ($size)\n {\n case 'tiny':\n $offsetX += $s['small'];\n case 'small':\n $offsetY += $s['medium'];\n case 'medium':\n $offsetX += $s['large'];\n }\n\n $src = imageCreateFromJpeg('uploads/avatars/'.$id.'.jpg');\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $s[$size], $s[$size], 100);\n }\n\n if ($matches[2] == 'gif')\n imageGif($dest);\n else\n imageJpeg($dest);\n\n return true;\n }", "function getAvatarDirectoryUrl()\n {\n return $GLOBALS['DYNAMIC_CONTENT_URL'] . \"/blubbercontact\";\n }", "public function setAvatar($avatar)\n {\n $this->_avatar = $avatar;\n }", "public function url()\n\t{\n\t\treturn URL::site('media/image/avatars/default.png', NULL, FALSE);\n\t}", "private function registerFileLoader()\n {\n $this->loaders['file'] = new FileLoader();\n }", "public function setDefaultAvatar(User $user): void;", "private function createHtaccessFiles()\n {\n $dir = $this->getGalleryDir();\n $this->fileHandler->createFileProtection($dir, Image::OBJECT_TYPE);\n }" ]
[ "0.6019955", "0.598472", "0.57833666", "0.5708738", "0.55006826", "0.54567325", "0.54480267", "0.5445176", "0.5414377", "0.54070354", "0.53725004", "0.53620166", "0.5321693", "0.5312506", "0.53034854", "0.5253651", "0.52320933", "0.51980084", "0.51688063", "0.5158231", "0.5142642", "0.5120604", "0.5117107", "0.50284755", "0.5027715", "0.5023343", "0.50200367", "0.50191206", "0.5014618", "0.499091" ]
0.7831703
0
/ Format backup name for List
private function _getListColumnBackupName(array $backup) { $backupName = $backup['Name']; if ($backup['IsLocal']) { $backupName = "<a href='/admin/backup/restore/?type=local&dumpId=${backupName}'>${backupName}</a>"; } if ($backup['IsRemote'] && !$backup['IsPartialUpload']) { $bucket = pm_Settings::get('awsBucket'); $prefix = pm_Settings::get('awsSubFolder'); $awsUrl = "https://console.aws.amazon.com/s3/home?bucket=${bucket}&prefix=${prefix}"; $backupName = "<a target='_blank' href='${awsUrl}'>${backupName}</a>"; } return $backupName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function backup_title() {}", "protected function filename()\n\t{\n\t\treturn 'Admin-KategoriList-' . date('YmdHis');\n\t}", "function SetBookbagName($name)\n {\n //what about when it's a scheduled list?\n $date = date('U');\n\n $this->db_list_name = $name.\" ***\".$date;\n $this->list_name = $name;\n }", "public static function backupName($project, $location, $backup)\n {\n return self::getBackupNameTemplate()->render([\n 'project' => $project,\n 'location' => $location,\n 'backup' => $backup,\n ]);\n }", "public function backup_list()\n {\n $path = $this->path;\n $backups = [];\n\n $list_files = glob($path . '*.sql');\n\n if ($list_files) {\n $list = array_map('basename', $list_files);\n sort($list);\n foreach ($list as $id => $filename) {\n $columns = [];\n $columns['id'] = $id;\n $columns['name'] = basename($filename);\n $columns['size'] = filesize($path . $filename);\n\n $columns['create_time'] = date('Y-m-d H:i:s', filectime($path . $filename));\n $columns['modified_time'] = date('Y-m-d H:i:s', filemtime($path . $filename));\n\n $backups[] = $columns;\n }\n }\n\n $type = 'load';\n\n return view('backup.list',compact('backups','type'));\n }", "protected function filename()\n {\n return 'product_category_list_' . date('Y_m_d_H_i_s');\n }", "protected function filename()\n {\n return 'subscription_plans_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'AllLeaves_' . date('YmdHis');\n }", "public function getListTemplateName()\n\t{\n\t\treturn 'bookmarks_item_post';\n\t}", "protected function filename()\n {\n return 'Links_' . date('YmdHis');\n }", "public function getArchiveName()\n\t{\n\t\t$result = $this->setting->get(Setting::SETTING_EXPORT_ARCHIVE_NAME);\n\n\t\treturn is_string($result) ? $result : '';\n\t}", "public function get_name() {\n\t\treturn 'sermon_archive';\n\t}", "public function generateSortname() {\n $lSortname = $this->getLastname().$this->getFirstname().$this->getUsername();\n $lSortname = trim($lSortname);\n\n if (preg_match('/^[^a-zA-Z]/',$lSortname)) {\n $lSortname = '#'.$lSortname;\n }\n return $lSortname;\n }", "private function getFileName() {\n\n if (!$this->template->title_file) {\n return $this->list_id . \"_\" . $this->item_id;\n }\n\n $title = $this->replaceWithFieldsVals($this->template->title_file); \n $title = $this->replaceLatvian($title);\n\n return preg_replace(\"/[^a-zA-Z0-9.]/\", \"_\", $title);\n }", "public function backupList()\n {\n return $this->getService()->resourceList('Backup', $this->getUrl('backups'), $this);\n }", "protected function filename()\n {\n return 'Item_' . date('YmdHis');\n }", "public function modifyNameAsCopy()\n {\n $query = new Query();\n $query->select('name')->from(Script::tableName())->where(\"deleted_at IS NULL AND user_id = :user_id AND status_id != :creating\", [\":user_id\" => $this->user_id, \":creating\" => Publishable::STATUS_CREATING]);\n $data = $query->createCommand()->queryColumn();\n\n $pattern = \"/\" . Yii::t('script', ' \\(copy (\\d+)\\)') . \"/i\";\n\n $original_name = preg_replace($pattern, \"\", $this->name);\n\n $num = 0;\n\n while (in_array($this->name, $data)) {\n $num++;\n $this->name = $original_name . Yii::t('script', ' (copy {n})', ['n' => $num]);\n }\n }", "protected function filename()\n {\n return 'BookCategory_' . date('YmdHis');\n }", "public function backup_structure()\n\t{\n\t\t// TODO Implement Backup function\n\t\treturn '';\n\t}", "protected function createBackupFileName( Datasource $datasource, int $timestamp )\n {\n return $datasource->namedId .\n \"_\" . Module::BACKUP_VERSION .\n \"_\" . $datasource->migrationApplyTime .\n \"_\" . $timestamp .\n \".\" . Module::BACKUP_FILE_EXT;\n }", "function getDisplayName() {\n\t\treturn __('plugins.block.journalInfo.displayName');\n\t}", "public function getBasename() {\n\t\tglobal $wpdb;\n\t\treturn substr($this->name, strlen($wpdb->prefix));\n\t}", "protected function filename()\n {\n return 'Guardians_' . date('YmdHis');\n }", "private function get_storage_label() {\n\t\t\n\t\t$opts = $this->get_options();\n\t\t$label = isset($opts['instance_label']) ? $opts['instance_label'] : '';\n\n\t\t$description = $this->get_description();\n\n\t\tif (!empty($label)) {\n\t\t\t$prefix = (false !== strpos($label, $description)) ? $label : \"$description: $label\";\n\t\t} else {\n\t\t\t$prefix = $description;\n\t\t}\n\n\t\treturn $prefix;\n\t}", "protected function getName(): string\n {\n return str_replace('-', '_', implode('_', $this->pathName));\n }", "public static function backupName($project, $location, $backupPlan, $backup)\n {\n return self::getBackupNameTemplate()->render([\n 'project' => $project,\n 'location' => $location,\n 'backup_plan' => $backupPlan,\n 'backup' => $backup,\n ]);\n }", "public function getListingName($listingName) {\n $listingNameSub = substr ( $listingName, 0, 45 );\n if (strlen ( $listingName ) > 45) {\n $listingNameSub .= '...';\n }\n return $listingNameSub;\n }", "function getStoreName() \n {\n $opts = HTML_FlexyFramework::get()->Pman;\n $fn = preg_replace('/[^a-z0-9_\\.]+/i', '_', $this->filename);\n return implode( '/', array(\n $opts['storedir'], '_images_', date('Y/m', strtotime($this->created)), $this->id . '-'. $fn\n ));\n \n }", "protected function filename()\n {\n return 'workorderHistories';\n }", "private function _getListColumnLocal(array $backup) {\n\n $htdocs = pm_Context::getBaseUrl();\n $local = '';\n\n if ($backup['IsLocal']) {\n $local = \"<img src='{$htdocs}/icons/on.png' />\";\n }\n\n if ($backup['IsLocalInvalid']) {\n $tooltip = pm_Locale::lmsg('backupInvalid');\n $local = \"<img src='{$htdocs}/icons/warning.png' title='${tooltip}' />\";\n }\n\n return $local;\n }" ]
[ "0.6190971", "0.61391413", "0.6051913", "0.58671933", "0.58434236", "0.5742798", "0.57246095", "0.5710332", "0.56259155", "0.5590467", "0.5582481", "0.5560649", "0.5548437", "0.5540341", "0.55389565", "0.552423", "0.5516207", "0.5505214", "0.5497453", "0.5494176", "0.5493132", "0.54767346", "0.54757214", "0.5466287", "0.54376376", "0.5436862", "0.54277134", "0.54045546", "0.53968346", "0.5385403" ]
0.6936315
0
Gets the deviceFeatureType The type of device feature. Possible values are: manufacturer, model, osVersion, application or driver. Possible values are: manufacturer, model, osVersion, application, driver, unknownFutureValue.
public function getDeviceFeatureType() { if (array_key_exists("deviceFeatureType", $this->_propDict)) { if (is_a($this->_propDict["deviceFeatureType"], "\Beta\Microsoft\Graph\Model\UserExperienceAnalyticsAnomalyDeviceFeatureType") || is_null($this->_propDict["deviceFeatureType"])) { return $this->_propDict["deviceFeatureType"]; } else { $this->_propDict["deviceFeatureType"] = new UserExperienceAnalyticsAnomalyDeviceFeatureType($this->_propDict["deviceFeatureType"]); return $this->_propDict["deviceFeatureType"]; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDeviceFeatureType($val)\n {\n $this->_propDict[\"deviceFeatureType\"] = $val;\n return $this;\n }", "public function getDeviceType()\n {\n return $this->get(self::DEVICE_TYPE);\n }", "public function deviceType()\n {\n return $this->deviceType;\n }", "public function getDeviceType()\n {\n return $this->device_type;\n }", "public function getDeviceType() {\n\n\t\treturn $this -> deviceType;\n\n\t}", "public function getDeviceType()\n {\n $value = $this->get(self::DEVICETYPE);\n return $value === null ? (string)$value : $value;\n }", "public function getFamilyType()\n {\n if (!$this->hasFamilyType() && $this->getFamilyTypeId() > 0) {\n $this->setFamilyType(\n Mage::getModel('innobyte_emag_marketplace/category_familytype')\n ->load($this->getFamilyTypeId())\n );\n }\n return $this->getData('family_type');\n }", "public function getDeviceType(): ?DeviceType {\n $val = $this->getBackingStore()->get('deviceType');\n if (is_null($val) || $val instanceof DeviceType) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deviceType'\");\n }", "public function getFeature()\n {\n return self::FEATURE;\n }", "public function getAttributeTypeFactory()\n {\n return $this->attributeTypeFactory;\n }", "public function getDeviceMode(): ?DeviceManagementConfigurationDeviceMode {\n $val = $this->getBackingStore()->get('deviceMode');\n if (is_null($val) || $val instanceof DeviceManagementConfigurationDeviceMode) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deviceMode'\");\n }", "public function getSmartDeviceType() {\n\t\treturn (TRUE === $this->isUsb()) ? \"sat\" : \"\";\n\t}", "public function getFeature()\n {\n return $this->feature;\n }", "public function setDeviceType($value)\n {\n return $this->set(self::DEVICE_TYPE, $value);\n }", "public function setDeviceType($value)\n {\n return $this->set(self::DEVICETYPE, $value);\n }", "public function getColumnType()\n {\n return array_get($this->config, 'mode');\n }", "public function virtual_dev_property_device_type($p_value)\n {\n $l_arr = null;\n if ($p_value > 0)\n {\n switch ($p_value)\n {\n case C__VIRTUAL_DEVICE__STORAGE:\n $l_arr = [\n 'id' => C__VIRTUAL_DEVICE__STORAGE,\n 'title' => _L(\"LC__CATG__STORAGE\")\n ];\n break;\n\n case C__VIRTUAL_DEVICE__NETWORK:\n $l_arr = [\n 'id' => C__VIRTUAL_DEVICE__NETWORK,\n 'title' => _L(\"LC__CMDB__CATG__NETWORK\")\n ];\n break;\n\n case C__VIRTUAL_DEVICE__INTERFACE:\n $l_arr = [\n 'id' => C__VIRTUAL_DEVICE__INTERFACE,\n 'title' => _L(\"LC__CMDB__CATG__UNIVERSAL_INTERFACE\")\n ];\n break;\n\n default:\n $p_row[\"device_type\"] = \"Unknown\";\n $l_arr = [\n 'title' => \"Unknown\"\n ];\n }\n }\n\n return $l_arr;\n }", "public static function deviceType() {\n \n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n $devicesTypes = array(\n \"computer\" => array(\"msie 10\", \"msie 9\", \"msie 8\", \"windows.*firefox\", \"windows.*chrome\", \"x11.*chrome\", \"x11.*firefox\", \"macintosh.*chrome\", \"macintosh.*firefox\", \"opera\"),\n \"tablet\" => array(\"tablet\", \"android\", \"ipad\", \"tablet.*firefox\"),\n \"smartphone\" => array(\"mobile \", \"android.*mobile\", \"iphone\", \"ipod\", \"opera mobi\", \"opera mini\"),\n \"bot\" => array(\"googlebot\", \"mediapartners-google\", \"adsbot-google\", \"duckduckbot\", \"msnbot\", \"bingbot\", \"ask\", \"facebook\", \"yahoo\", \"addthis\")\n );\n \n foreach($devicesTypes as $deviceType => $devices) { \n foreach($devices as $device) {\n if(preg_match(\"/\" . $device . \"/i\", $userAgent)) {\n $deviceName = $deviceType;\n }\n }\n }\n \n return ucfirst($deviceName);\n }", "public function getDeviceManufacturer(): ?string {\n $val = $this->getBackingStore()->get('deviceManufacturer');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deviceManufacturer'\");\n }", "public function getFuelType()\n {\n return $this->fuelType;\n }", "public function getDataType()\n {\n return $this->getOption('dataType');\n }", "public function getFlightType()\n {\n return isset($this->FlightType) ? $this->FlightType : null;\n }", "public function getDeviceModel()\n {\n if (array_key_exists(\"deviceModel\", $this->_propDict)) {\n return $this->_propDict[\"deviceModel\"];\n } else {\n return null;\n }\n }", "public function getFieldFuelType()\n {\n return $this->fieldFuelType;\n }", "public function hasDeviceType()\n {\n return $this->get(self::DEVICETYPE) !== null;\n }", "public function getFeatures() {\n $features = new Application_Model_DbTable_Feature();\n $select = $features->select()->setIntegrityCheck(FALSE)->from('shop_feature');\n $select->where('selectable = \"1\" AND multiple = \"0\" AND (type = \"varchar\" OR type = \"color\")');\n $result = $features->fetchAll($select);\n if ($result) {\n return $result->toArray();\n }\n return FALSE;\n }", "public function getFeaturedProfilesStype()\n\t\t\t{\n\t\t\t\treturn SearchTypesEnums::AAFeatureProfile;\n\t\t\t}", "public function getDeviceModel(): ?string {\n $val = $this->getBackingStore()->get('deviceModel');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deviceModel'\");\n }", "public function getDeviceModel(): ?string {\n $val = $this->getBackingStore()->get('deviceModel');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deviceModel'\");\n }", "public static function getFeature($uniquename, $genus, $species, $type_id) {\n\n // Gets the organism_id.\n $organism_id = '';\n if ($genus && $species) {\n $mcl_organism = MCL_CHADO_ORGANISM::getOrganism($genus, $species);\n if ($mcl_organism) {\n $organism_id = $mcl_organism->getOrganismID();\n }\n else {\n return NULL;\n }\n }\n\n // Gets the feature.\n $args = array(\n 'uniquename' => $uniquename,\n 'type_id' => $type_id,\n );\n if ($organism_id) {\n $args['organism_id'] = $organism_id;\n }\n return MCL_CHADO_FEATURE::bykey($args);\n }" ]
[ "0.7092887", "0.62453264", "0.61726314", "0.6091399", "0.6087269", "0.59945303", "0.56146663", "0.56099623", "0.5532989", "0.5431528", "0.53908354", "0.5358547", "0.52267027", "0.52257055", "0.52098185", "0.51923186", "0.51393634", "0.513125", "0.51160187", "0.5086372", "0.5059624", "0.50319993", "0.5006277", "0.4991114", "0.49527517", "0.49218014", "0.49063128", "0.48840728", "0.48840728", "0.48573235" ]
0.7302988
0
Sets the deviceFeatureType The type of device feature. Possible values are: manufacturer, model, osVersion, application or driver. Possible values are: manufacturer, model, osVersion, application, driver, unknownFutureValue.
public function setDeviceFeatureType($val) { $this->_propDict["deviceFeatureType"] = $val; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDeviceType($value)\n {\n return $this->set(self::DEVICE_TYPE, $value);\n }", "public function setDeviceType($value)\n {\n return $this->set(self::DEVICETYPE, $value);\n }", "public function setDeviceType(?DeviceType $value): void {\n $this->getBackingStore()->set('deviceType', $value);\n }", "public function getDeviceFeatureType()\n {\n if (array_key_exists(\"deviceFeatureType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"deviceFeatureType\"], \"\\Beta\\Microsoft\\Graph\\Model\\UserExperienceAnalyticsAnomalyDeviceFeatureType\") || is_null($this->_propDict[\"deviceFeatureType\"])) {\n return $this->_propDict[\"deviceFeatureType\"];\n } else {\n $this->_propDict[\"deviceFeatureType\"] = new UserExperienceAnalyticsAnomalyDeviceFeatureType($this->_propDict[\"deviceFeatureType\"]);\n return $this->_propDict[\"deviceFeatureType\"];\n }\n }\n return null;\n }", "public function setDeviceType($var)\n {\n GPBUtil::checkEnum($var, \\Device_DeviceType::class);\n $this->device_type = $var;\n }", "public function setDeviceManufacturer(?string $value): void {\n $this->getBackingStore()->set('deviceManufacturer', $value);\n }", "public function setDeviceMode(?DeviceManagementConfigurationDeviceMode $value): void {\n $this->getBackingStore()->set('deviceMode', $value);\n }", "public function setFeature($fea)\n {\n $this->feature = $fea;\n }", "public function setDeviceModel(?string $value): void {\n $this->getBackingStore()->set('deviceModel', $value);\n }", "public function setDeviceModel(?string $value): void {\n $this->getBackingStore()->set('deviceModel', $value);\n }", "public function setSoftType($value)\n {\n return $this->set(self::SOFTTYPE, $value);\n }", "public function setFeatureUsage($feature, $value)\n {\n return $this->recordFeatureUsage($feature, $value, false);\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "protected function setTablet($value = true)\n {\n $this->_is_tablet = $value;\n }", "public function setDeviceType($deviceType) {\n\n\t\t$this -> deviceType = $deviceType;\n\n\t\treturn $this;\n\n\t}", "public function setDeviceName($value)\n {\n return $this->set(self::DEVICENAME, $value);\n }", "public function setDevice($value)\n {\n return $this->set(self::DEVICE, $value);\n }", "public function setAllowTestDevices($value)\n {\n $this->_allowTestDevices = $value;\n }", "public function setManufacturer(?string $value): void {\n $this->getBackingStore()->set('manufacturer', $value);\n }", "public function getDeviceType()\n {\n return $this->device_type;\n }", "public function setSupportedAttributeTypes(?array $value): void {\n $this->getBackingStore()->set('supportedAttributeTypes', $value);\n }", "public function setFt($ft)\n\t{\n\t\t$this->ft = $ft;\n\t}", "public function setDisplayDeviceName(?string $value): void {\n $this->getBackingStore()->set('displayDeviceName', $value);\n }", "public function getDeviceType() {\n\n\t\treturn $this -> deviceType;\n\n\t}", "public function setDataType(?string $dataType): void\n {\n $this->dataType = $dataType;\n }", "public function deviceType()\n {\n return $this->deviceType;\n }", "public function set_feature_flag( $feature, $flag_value ) {\n\n\t\t$this->feature_flags[ $feature ] = $flag_value;\n\n\t}", "public function testSetTypeFg() {\n\n $obj = new Affaires();\n\n $obj->setTypeFg(\"typeFg\");\n $this->assertEquals(\"typeFg\", $obj->getTypeFg());\n }", "public function setDataType($dataType)\n {\n $this->dataType = $dataType;\n }" ]
[ "0.599861", "0.5987758", "0.5892061", "0.5866786", "0.5497719", "0.5278032", "0.51182747", "0.5000354", "0.49896055", "0.49896055", "0.49286002", "0.4899996", "0.485882", "0.485882", "0.48519075", "0.4832242", "0.48103088", "0.47896165", "0.46687934", "0.46156496", "0.45897904", "0.45787933", "0.45142096", "0.45075795", "0.45057654", "0.44932556", "0.4485124", "0.44410792", "0.444057", "0.44199827" ]
0.8057098
0
Returns response data that should be serialized.
public function getResponseData() { return $this->responseData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponseSerialized()\r\n\t{\r\n\t\treturn serialize($this->getResponse());\r\n\t}", "public function getResponseData()\n {\n return $this->responseData;\n }", "abstract protected function getResponseData();", "public function getSerializedResponse()\n {\n $response = $this->getActiveResponse();\n\n try {\n //We can serialize also additional model data\n if ( $response instanceof Model || $response instanceof EloquentCollection ) {\n $response = new ActiveResponseSerializator($response);\n }\n\n return serialize($response);\n } catch (Exception $e){\n throw new Exception($e->getMessage().' - Passed data into discounts and order mutators active state may be only: string, numeric, array, boolean, Eloquent, EloquentCollection.');\n }\n }", "public function getResponseData()\n {\n return $this->response['data'];\n }", "public function jsonSerialize() {\n return $this->data;\n }", "function jsonSerialize()\n {\n return $this->data;\n }", "public function serialize()\n {\n return $this->data;\n }", "public function jsonSerialize()\n {\n return $this->data;\n }", "public function as_raw()\n {\n return $this->response_data;\n }", "public function serialize() :array\n {\n return (new ResponsePresenter($this))->format();\n }", "public function get_data() {\n\n\t\t$data = ! empty( $this->response_data->data ) && is_array( $this->response_data->data ) ? $this->response_data->data : array();\n\n\t\treturn is_object( $data[0] ) ? $data[0] : new \\stdClass();\n\t}", "function jsonSerialize()\r\n\t{\r\n\t\treturn $this->getDataToEncode();\r\n\t}", "public function getRawResponse();", "private function getData()\n {\n return $this->getResponse()['data'];\n }", "public function getRawResponse () {}", "public function responseData(): string\n {\n $response = [];\n\n foreach($this->response_keys as $key) {\n if(array_key_exists($key, $this->data)) {\n $response[$key] = $this->data[$key];\n }\n }\n\n return json_encode($response);\n }", "public function getResponse()\n {\n return [\n 'id' => $this->getId(),\n 'name' => $this->getName(),\n 'code' => $this->getCode()\n ];\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function toArray()\n {\n return $this->response;\n }", "public function processResponse(){\n return json_encode($this->getData());\n }", "public function toArray() {\n return $this->response;\n }", "public function jsonSerialize()\n {\n Response::jsonField('version', $this->getVersion());\n Response::jsonField('title', $this->getTitle());\n Response::jsonField('description', $this->getDescription());\n Response::jsonField('termsOfService', $this->getTermsOfService());\n Response::jsonField('contact', $this->getContact());\n Response::jsonField('license', $this->getLicense());\n\n return Response::jsonSerialize($this);\n }", "public function serialize()\n {\n $saved = array(\n 'data' => $this->data,\n 'fault' => $this->fault\n );\n return serialize($saved);\n }", "public function getResponse() {\n\t\treturn array('response'=>$this->_response);\n\t}", "public function toResponse(): ?array\r\n {\r\n $arr = [];\r\n $arr['id'] = $this->getId();\r\n $arr['value'] = $this->getValue();\r\n $arr['quiz_id'] = $this->getQuiz()->getId();\r\n \r\n return $arr;\r\n }", "function getRawResponse()\n {\n return $this->_response;\n }", "public function getResponseSerializer()\n {\n return $this->responseSerializer;\n }", "public function getData()\r\n {\r\n return $this->structure->response->data;\r\n }" ]
[ "0.75664276", "0.7119567", "0.7054514", "0.7024119", "0.70094067", "0.6936751", "0.69031817", "0.68937397", "0.68894625", "0.6833951", "0.68258756", "0.673929", "0.66072917", "0.6572719", "0.65249723", "0.65190166", "0.65151393", "0.65077484", "0.649616", "0.649616", "0.649616", "0.6494808", "0.6489946", "0.64856416", "0.64633286", "0.64583075", "0.64506865", "0.64454347", "0.6424959", "0.6423874" ]
0.72087985
1
Retrieve the project composer.json as a JsonFile.
private function getComposerJson() { $composerFile = ($this->composerFileFactory)(); return new JsonFile($composerFile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComposerJson()\n {\n $json = $this->getPath('composer.json');\n\n if (!file_exists($json)) {\n return null;\n }\n\n return json_decode(file_get_contents($json));\n }", "private function getJson()\n {\n return json_decode(file_get_contents($this->composerFile->getPathname()));\n }", "public function getComposerFile(): File\n {\n return new File(sprintf('%s/%s', $this->rootDir, self::PATH_COMPOSER_JSON));\n }", "public function getJsonPath(): string\n {\n $jsonPath = defined('CRAFT_COMPOSER_PATH') ? CRAFT_COMPOSER_PATH : Craft::getAlias('@root/composer.json');\n if (!is_file($jsonPath)) {\n throw new Exception('Could not locate your composer.json file.');\n }\n return $jsonPath;\n }", "public function getComposerPath()\n {\n return $this->getDirectory() . '/composer.json';\n }", "public function read($filename = 'composer.json')\n {\n return json_decode(File::get($this->path().'/'.$filename), true);\n }", "protected function getComposer()\n {\n if (!empty($this->composer)) {\n return $this->composer;\n }\n\n $path = getcwd() . '/' . $this->getDirectoryInput() . '/composer.json';\n\n if (!file_exists($path)) {\n throw new \\RuntimeException('');\n }\n\n $composer = json_decode(file_get_contents($path), true);\n return $this->composer = is_array($composer) ? $composer : [];\n }", "protected function updateComposerJson()\n {\n $composerJson = getenv('COMPOSER') ?: 'composer.json';\n\n $path = base_path($composerJson);\n\n //\n $config = json_decode(file_get_contents($path), true);\n\n if (is_array($config) && isset($config['autoload'])) {\n $namespace = $this->data['namespace'] .'\\\\';\n\n $config['autoload']['psr-4'][$namespace] = 'plugins/' . $this->data['name'] . \"/src/\";\n\n $output = json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . \"\\n\";\n\n file_put_contents($path, $output);\n }\n }", "public function jsonFile() {\n\n $content = file_get_contents(public_path('filejson.json'));\n return $content;\n }", "private function readVersion()\n {\n $composer = file_get_contents(self::$dir.'/composer.json');\n $composer_json = json_decode($composer);\n $version = $composer_json->version;\n\n return $version;\n }", "public function getComposerData()\n {\n $path = $this->getComposerPath();\n if (!file_exists($path)) {\n throw new Exception(\"No composer.json found in module \" . $this->getName());\n }\n return Config::loadFromFile($path);\n }", "public function readOriginal()\n {\n if (! File::exists($this->path().'/composer.json.original')) {\n return $this->read();\n }\n\n return $this->read('composer.json.original');\n }", "public static function get_dependency_info() {\n\t\t$folder = Director::baseFolder();\n\t\t$raw = file_get_contents($folder . '/composer.lock');\n\t\t$deps = json_decode($raw, true);\n\n\t\treturn $deps;\n\t}", "public function testComposerJsonExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.json');\n }", "public function writeMergedComposerJson() {\n\t\t$composerJson = $this->getMergedComposerJson();\n\t\t$composerJson = json_encode($composerJson);\n\t\tif ($composerJson) {\n\t\t\t$this->makeSureTempPathExists();\n\t\t\treturn file_put_contents($this->getTempPath() . 'composer.json', $composerJson);\n\t\t}\n\t\treturn FALSE;\n\t}", "public function getComposer()\n {\n return $this->composer = new Composer(\n json_decode($this->layoutJson, true),\n $this->getFormAttributes(),\n craft()->freeform_forms,\n craft()->freeform_submissions,\n craft()->freeform_mailer,\n craft()->freeform_files,\n craft()->freeform_mailingLists,\n craft()->freeform_crm,\n craft()->freeform_statuses,\n new CraftTranslator()\n );\n }", "private function composer() {\n $path = app_path() . '\\\\..\\\\composer.lock';\n\n if (!file_exists($path))\n return;\n\n // Parse composer.lock\n $content = @file_get_contents($path);\n $list = @json_decode($content);\n\n if (!$list)\n return;\n\n $list = object_get($list, 'packages', []);\n\n // Determe the parent of the composer modules, most likely this will\n // resolve to laravel/laravel.\n $parent = '';\n $parent_path = realpath(app_path() . '\\\\..\\\\composer.json');\n if (file_exists($parent_path)) {\n $parent_object = @json_decode(@file_get_contents($parent_path));\n\n if ($parent_object)\n $parent = object_get($parent_object, 'name', '');\n }\n\n // Store base package, which is laravel/laravel.\n $packages = [[\n 'n' => $parent,\n 'l' => $parent_path,\n 'v' => ''\n ]];\n\n // Add each composer module to the packages list,\n // but respect the parent relation.\n foreach ($list as $package) {\n $packages[] = [\n 'n' => $package->name,\n 'v' => $package->version,\n 'p' => $parent,\n 'l' => $parent_path\n ];\n }\n\n return $packages;\n }", "public function getMergedComposerJson($development = FALSE) {\n\t\tif (!$this->mergedComposerJson) {\n\t\t\t$composerJson = file_get_contents($this->getPathToResource() . 'Private/Templates/composer.json');\n\t\t\tif (!$composerJson) {\n\t\t\t\tthrow new \\UnexpectedValueException('Could not load the composer.json template file', 1355952845);\n\t\t\t}\n\t\t\t$composerJson = str_replace('%EXT_PATH%', $this->getExtensionPath(), $composerJson);\n\t\t\t$composerJson = str_replace('%RESOURCE_PATH%', $this->getPathToResource(), $composerJson);\n\t\t\t$composerJson = str_replace('%MINIMUM_STABILITY%', $this->minimumStability, $composerJson);\n\n\t\t\t$composerJson = json_decode($composerJson, TRUE);\n\n\t\t\t$this->pd($composerJson);\n\t\t\t$composerJson['require'] = $this->getMergedComposerRequirements();\n\t\t\t$composerJson['autoload'] = $this->getMergedComposerAutoload();\n\t\t\t$composerJson['repositories'] = $this->getMergedComposerData('repositories');\n\n\t\t\tif ($development || $this->developmentDependencies) {\n\t\t\t\t$composerJson['require-dev'] = $this->getMergedComposerDevelopmentRequirements();\n\t\t\t}\n\t\t\tif (!isset($composerJson['require-dev']) || !$composerJson['require-dev']) {\n\t\t\t\tunset($composerJson['require-dev']);\n\t\t\t}\n\n\t\t\t$this->pd($composerJson);\n\t\t\t$this->mergedComposerJson = $composerJson;\n\t\t}\n\n\t\treturn $this->mergedComposerJson;\n\t}", "function getJsonFile() {\n $file = Storage::get('public/db.json');\n return (array) json_decode($file);\n}", "protected function updatePackageJson()\n {\n copy(__DIR__ . '/stubs/config/package.json', base_path('package.json'));\n }", "function getManifest() {\n $assDir = get_template_directory_uri() . '/assets/dist/';\n $jsonString = file_get_contents($assDir . '/manifest.json');\n return json_decode($jsonString, true);\n}", "public static function read(string $path = 'composer.json'): Composer\n {\n return (new self($path))->require();\n }", "public function getComposerPath() {\n\t\treturn $this->getPathToResource() . '/Private/PHP/composer.phar';\n\t}", "public function getComposer() {\n return $this->composer;\n }", "function GetJsonFilePath(){\n\n\t\t\t$initialPath = \"Data\\cines.json\";\n\t\t\t\n\t\t\tif(file_exists($initialPath)){\n\t\t\t\t$jsonFilePath = $initialPath;\n\t\t\t}else{\n\t\t\t\t$jsonFilePath = ROOT.$initialPath;\n\t\t\t}\n\t\t\t\n\t\t\treturn $jsonFilePath;\n\t\t}", "private function restoreComposerJson(string $composerJsonFile): void\n {\n $this->filesystem->dumpFile($composerJsonFile, $this->originalComposerJsonFileContent);\n\n // re-run @todo composer update on root\n }", "function GetJsonFilePath(){\n\n\t\t\t$initialPath = \"Data\\\\funciones.json\";\n\t\t\t\n\t\t\tif(file_exists($initialPath)){\n\t\t\t\t$jsonFilePath = $initialPath;\n\t\t\t}else{\n\t\t\t\t$jsonFilePath = ROOT.$initialPath;\n\t\t\t}\n\t\t\t\n\t\t\treturn $jsonFilePath;\n\t\t}", "private static function getGlobalConfig(Composer $composer, $filename, $io = null)\n {\n $home = self::getComposerHome($composer);\n $file = new JsonFile($home.'/'.$filename.'.json');\n $config = array();\n\n if ($file->exists()) {\n $data = $file->read();\n\n if (isset($data['config']['foxy']) && \\is_array($data['config']['foxy'])) {\n $config = $data['config']['foxy'];\n\n if ($io instanceof IOInterface && $io->isDebug()) {\n $io->writeError('Loading Foxy config in file '.$file->getPath());\n }\n }\n }\n\n return $config;\n }", "public function getComposer()\n {\n return $this->composer;\n }", "private function readCacheFile() {\n $json_str = file_get_contents($this->filepath);\n return json_decode($json_str);\n }" ]
[ "0.83879966", "0.8123988", "0.77700144", "0.72120756", "0.7130299", "0.7118383", "0.70959115", "0.692959", "0.6676617", "0.6564988", "0.65282804", "0.64903283", "0.64336014", "0.6321143", "0.6081897", "0.60404015", "0.603728", "0.60205233", "0.5985769", "0.59766924", "0.5930497", "0.5906641", "0.5845315", "0.5825572", "0.5813823", "0.5790193", "0.5784543", "0.5777933", "0.57705605", "0.5768312" ]
0.8577972
0
make a user u with category c discoverable
function makeDiscoverable($u,$c){ global $db; $u=$db->escape($u); $c=$db->escape($c); $query1="SELECT * FROM karioke where name='{$u}' LIMIT 1"; if( $db->getRows($db->query($query1))==0 ){ $query2="INSERT INTO karioke(name,category,status,my_peerid,other_uname) VALUES('{$u}','{$c}','0','0','n')"; $db->query($query2); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function have_users_custom( $category = array() ) {\r\n return \\query\\main::have_users( $category );\r\n}", "function Categories_userapi_getusercategoryname ($args)\n{\n $uid = isset($args['uid']) && $args['uid'] ? $args['uid'] : pnUserGetVar('uid');\n $uname = pnUserGetVar('uname', $uid);\n $userCatName = \"$uname [$uid]\";\n\n return $userCatName;\n}", "function users_custom( $category = array() ) {\r\n return \\query\\main::while_users( $category );\r\n}", "public function find_user($search, $category) {\r\n\r\n\t\tglobal $database;\r\n\r\n\t\t// Adds things to the search with.\r\n\t\t$sql = \"SELECT * FROM users WHERE \";\r\n\r\n\t\t$search = $database->escape_string($search);\r\n\t\t$category = $database->escape_string($category);\r\n\r\n\t\tif ($category == 'all') {\r\n\t\t\t$sql .= \" first_name LIKE '%{$search}%' OR\";\r\n\t\t\t$sql .= \" middle_name LIKE '%{$search}%' OR\";\r\n\t\t\t$sql .= \" last_name LIKE '%{$search}%' OR\";\r\n\t\t\t$sql .= \" id LIKE '%{$search}%'\";\r\n\t\t}\r\n\r\n\t\t//Creator - name or parts of name\r\n\t\tif ($category == 'first_name') {\r\n\t\t\t$sql .= \" first_name LIKE '%{$search}%'\";\r\n\t\t}\r\n\t\t\r\n\t\t//Creator - name or parts of name\r\n\t\tif ($category == 'middle_name') {\r\n\t\t\t$sql .= \" middle_name LIKE '%{$search}%'\";\r\n\t\t}\r\n\r\n\t\t//Creator - name or parts of name\r\n\t\tif ($category == 'last_name') {\r\n\t\t\t$sql .= \" last_name LIKE '%{$search}%'\";\r\n\t\t}\r\n\r\n\t\t//Creator - name or parts of name\r\n\t\tif ($category == 'id') {\r\n\t\t\t$sql .= \" id LIKE '%{$search}%'\";\r\n\t\t}\r\n\r\n\t\treturn self::find_by_query($sql);\r\n\t}", "static function getUsersList($data)\n { global $USER,$DB;\n $category = $data;\n\n //user declates he is admin, so check it\n $is_admin = \\explode('%',$category);\n if(\\sizeof($is_admin) == 2){\n \n $admins = $DB->get_field_sql('SELECT value FROM {config} WHERE name = ?',array('siteadmins'));\n $admins = \\explode(',',$admins);\n if(!in_array($USER->id,$admins)){\n return false;\n }\n $obj = new User($USER->id);\n $obj->getAdminsUsers();\n }else{\n \n // user is not a admin and not trying to\n \n $post_array = \\explode('&',$category);\n $is_admin = \\explode('%',$category);\n $obj = new User($USER->id);\n $obj->getUserContextsAndRoles();\n $obj->getAllContexts();\n if(\\sizeof($post_array) == 2){\n $obj->getUserChildUsers($post_array[0]);\n \n \n \n }else {\n $obj->getUserChildUsers();\n }\n }\n $obj->childUsers = Processor::sortbyLastname($obj->childUsers);\n return $obj;\n }", "function urc_class_user() {\n\t$class_user_access = \"\";\n\t$space = \" \";\n\t$css_prefix = \"urc-\";\n\t$sp_pref = $space . $css_prefix; //Space and prefix\n\t$class_user = wp_get_current_user();\n\tif ( in_array( 'subscriber', (array) $class_user->roles )):\n\t\t$class_user_access .= $sp_pref . \"subscriber\";\n\tendif; \n\tif ( in_array( 'editor', (array) $class_user->roles )):\n\t\t$class_user_access .= $sp_pref . \"editor\";\n\tendif;\n\tif ( in_array( 'contributor', (array) $class_user->roles ) ):\n\t\t$class_user_access .= $sp_pref. \"contributor\";\n\tendif; \n\tif ( in_array( 'administrator', (array) $class_user->roles )):\n\t\t$class_user_access .= $sp_pref . \"administrator\";\n\tendif;\n\t\n\treturn $class_user_access;\n\t\n}", "function autor($uid, $class=\"\", $nick=\"\", $email=\"\", $cut=\"\",$add=\"\") {\n global $db;\n if(!dbc_index::issetIndex('user_'.intval($uid))) {\n $qry = db(\"SELECT * FROM \".$db['users'].\" WHERE id = '\".intval($uid).\"'\");\n if(_rows($qry)) {\n $get = _fetch($qry);\n dbc_index::setIndex('user_'.$get['id'], $get);\n } else {\n $nickname = (!empty($cut)) ? cut($nick, $cut) : $nick;\n return show(_user_link_noreg, array(\"nick\" => re($nickname), \"class\" => $class, \"email\" => eMailAddr($email)));\n }\n }\n\n $nickname = (!empty($cut)) ? cut(re(dbc_index::getIndexKey('user_'.intval($uid), 'nick')), $cut) : re(dbc_index::getIndexKey('user_'.intval($uid), 'nick'));\n return show(_user_link, array(\"id\" => $uid,\n \"country\" => flag(dbc_index::getIndexKey('user_'.intval($uid), 'country')),\n \"class\" => $class,\n \"get\" => $add,\n \"nick\" => $nickname));\n}", "function Categories_userapi_getusercategories ($args)\n{\n $args['returnCategory'] = 1;\n $userRootCat = Categories_userapi_getuserrootcat ($args);\n\n if (!$userRootCat) {\n return LogUtil::registerError(__f('Error! The user root node seems to point towards an invalid category: %s.', $userRoot));\n }\n\n $relative = (isset($args['relative']) ? $args['relative'] : false);\n return CategoryUtil::getCategoriesByParentID ($userRootCat['id'], '', $relative);\n}", "function casabienestar_preprocess_user_profile_category(&$variables) {\n $variables['title'] = check_plain($variables['element']['#title']);\n $variables['profile_items'] = $variables['element']['#children'];\n $variables['attributes'] = '';\n if (isset($variables['element']['#attributes'])) {\n $variables['attributes'] = drupal_attributes($variables['element']['#attributes']);\n }\n}", "public function user(){\n\n \treturn $this->belongsTo(User::class);\n\n \t// we can write here belongsTO(App\\Category) also instead of Category class.\n }", "public function forgetUser();", "public function forgetUser();", "public final function RechercherUtilisateurStrategie() {\n\n\t}", "public function user_category()\n {\n return $this->hasOne('App\\UserCategory', 'alias', 'user_category_alias');\n }", "public static function create_user_profile_category(): int {\n global $DB;\n // No nice API to do this, so direct DB calls it is.\n $data = new \\stdClass();\n $data->sortorder = $DB->count_records('user_info_category') + 1;\n $data->name = self::set_category_name(get_string('pluginname', 'tool_moodlenet'));\n $data->id = $DB->insert_record('user_info_category', $data, true);\n\n $createdcategory = $DB->get_record('user_info_category', array('id' => $data->id));\n \\core\\event\\user_info_category_created::create_from_category($createdcategory)->trigger();\n return $createdcategory->id;\n }", "public function category()\n {\n return $this->belongsTo('App\\User');\n }", "public function binCat()\n\t{\n\t\treturn $this->belongsTo('App\\User');\n\t}", "abstract public function getUser();", "private function addUserData()\n {\n \t$this->model = $this->model->leftJoin('users as u', 'c.user_id', '=', 'u.id')->addSelect('u.name as unm', 'u.id as uid');\n }", "abstract public function category();", "public function manipulateUser() {\n\t\tWCF::getUser()->__construct(null, null, $this->userObj);\n\t}", "function bbp_get_user_ids_from_nicenames($user_nicenames = array())\n{\n}", "function _publication_xml_load_user($value){\n if(is_array($value) && isset($value['uid'])){\n $value = $value['uid'];\n }\n $user = user_load($value);\n if(!$user){throw new Exception(t(\"No such user id %uid - it looks like a user referenced from your publication has been deleted from the site\", array(\n '%uid' => $value\n )));}\n $wrapper = entity_metadata_wrapper('user', $user);\n $given_names = explode(' ', $wrapper->field_user_given_names->value());\n $user->processed_full_name = implode(' ', array(\n $wrapper->field_user_title->value(),\n $wrapper->field_user_given_names->value(),\n $wrapper->field_user_family_name->value()\n ));\n $user->processed_first_name = array_shift($given_names);\n if(count($given_names)){\n $user->processed_middle_names = implode(' ', $given_names);\n }\n return $user;\n}", "abstract public function &user();", "public function getuser($user)\n {\n\n }", "public function suggest_user()\n {\n }", "public function forUser($user);", "public function user();", "public function user();", "public function user();" ]
[ "0.59627545", "0.59414667", "0.5930997", "0.5755939", "0.5688492", "0.55647117", "0.5534782", "0.54949707", "0.5430256", "0.54207075", "0.5393628", "0.5393628", "0.5384479", "0.5375167", "0.5363616", "0.53530717", "0.53374314", "0.53189135", "0.531018", "0.527148", "0.52629465", "0.5260551", "0.5213098", "0.5205758", "0.5201687", "0.5181554", "0.5161929", "0.51554775", "0.51554775", "0.51554775" ]
0.66549677
0
Set hospital status param: id, status (1/0) return bool
public function set_hospital_status ($hospital_id, $status) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changeStatus($id, $status)\n {\n if (!is_bool($status) && !is_null($status)) {\n if ($status != 'true' && $status != 'false' && $status != 'null') {\n return false;\n }\n }\n\n $petition = $this->getById($id);\n $petition->status = $status;\n\n return $petition->save();\n }", "public static function setStatus($id, $status){\n global $db, $database;\n return $db->query('Update '.$database['tbl_prefix'].'dev_users SET status = ? where id = ?', DBDriver::QUERY, array($status, $id));\n }", "public function status_record($id,$status){\n\t\t$sts = ($status == 1 ? 0 : 1);\n\t\t$set_data = array(\n\t\t\t\t\t\t'status' => $sts\n\t\t\t\t\t);\n\t\t$this->db->where('id',$id);\n\t\t$result = $this->db->update($this->table_name, $set_data); \n\t\treturn $result;\n\t}", "public function status ($id, $status)\n\t\t{\n\t\t\t$consulta=$this->_db->prepare(\n\t\t\t\t\"UPDATE tareas SET\n\t\t\t\tstatus=:status\n\t\t\t\tWHERE id=:id\"\n\t\t\t);\n\n\t\t\t$consulta->bindParam(\":id\",$id);\n\t\t\t$consulta->bindParam(\":status\",$status);\n\t\t\tif ($consulta->execute())\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "public function update($id,$status)\n {\n \n }", "public function setStatus($status);", "public function setStatus($status);", "private function setStatus($report_id, $status) {\n return $this->database\n ->update('sa11y')\n ->fields([\n 'status' => $status,\n ])\n ->condition('id', $report_id)\n ->execute();\n }", "function update_status($id) {\n\t}", "public function webadmin_change_status($id = NULL, $status = NULL) {\n// echo $id;\n// echo $status;\n// die;\n $this->loadModel('User');\n $iduser = $this->User->findById($id);\n if ($iduser['User']['status'] == '0') {\n $this->User->updateAll(array('User.status' => \"1\"), array('User.id' => $id));\n $this->Session->setFlash('Status Activated Successfully.', 'admin_success');\n } else {\n $this->User->updateAll(array('User.status' => \"0\"), array('User.id' => $id));\n $this->Session->setFlash('Status Deactivated Successfully.', 'admin_success');\n }\n return $this->redirect(array('controller' => 'student', 'action' => 'index', 'prefix' => 'webadmin'));\n }", "function admin_toggleStatus($id , $status){\r\n\t\t$this->{$this->modelClass}->id = $id;\r\n\t\t$this->{$this->modelClass}->saveField('active' , $status);\r\n\t\t$this->redirect($this->referer());\r\n\t}", "function atualizar_status($status, $id_pedido) {\n $logado = $this->session->userdata('logado');\n $tipoLogin = $this->session->userdata('tipo_login');\n\n if (($logado != 1) || ($tipoLogin != 'F')) {\n mostra_mensagem(\"Pedido não localizado.\");\n return true;\n }\n\n $dadosPedido = $this->Pedido_model->get_pedido($id_pedido);\n if (!$dadosPedido) {\n mostra_mensagem(\"Pedido não localizado.\");\n return true;\n }\n\n if (!in_array($status, array('A', 'P', 'E', 'S', 'C'))) {\n mostra_mensagem(\"Situação de pedido inválida.\");\n return true;\n }\n\n $params = array(\n 'statusAndamento' => $status\n );\n\n $this->Pedido_model->update_pedido($id_pedido, $params);\n\n redirect('pedido/status_pedido/' . $id_pedido);\n }", "function update_service_status($service_id,$status){\n $this->db->where(\"id\",$service_id);\n $this->db->update(\"services\",array(\"status\"=>$status));\n return true;\n }", "public function setStatus() {\n if (!($this->user->verify())) {\n include 'view/page/landing_page.php';\n } else {\n if (isset($_GET['id']) && isset($_GET['status'])) {\n $statusId = htmlspecialchars($_GET['id']);\n $status = intval($_GET['status']);\n\n if (Restaurant::updateNumber($statusId, 'approved', $status)) {\n $setStatusSuccess = True;\n } else {\n $setStatusSuccess = False;\n }\n }\n $restaurants = Restaurant::getAllRestaurants();\n include 'view/page/admin_restaurants.php';\n }\n }", "public function actionUpdateStatusSponsorship() {\n\t $status = $_POST[\"status\"];\n\t $id = $_POST[\"id\"]; \n\t\n\t\tif(Sponsorship::model()->updateByPk($id,array('status'=>$status)))\n\t\t\techo \"se ha cambiado con éxito\";\n\t\telse\n\t\t\techo \"existe un error vuelva a intentar\";\n\t}", "public function changeStatus($id, $status) {\n $this->db->where('ID', $id);\n\n return $this->db->update('employee', array('status' => $status));\n }", "public function updateManageEdeskById($id, $status)\n {\n self::where('id', $id)\n ->update(['is_active' => $status]);\n }", "public function set_status($status) {\n $status = (int) $status;\n mysql_query(\"update users set status='$status' where user_id='{$_SESSION['user']['user_id']}'\");\n return mysql_affected_rows();\n }", "public function a_statusUlasanSuper($status, $id)\n\t{\n\t\t$data = $this->where('id', $id)->first();\n\t\t$data->hapus = $status;\n\t\t$data->save();\n\t}", "public function updateStatus(bool $status, int $id): bool\n {\n $query = 'UPDATE ' . self::TABLE . ' SET `validation`=:validation WHERE `id`=:id';\n $statement = $this->pdo->prepare($query);\n $statement->bindValue('validation', $status, \\PDO::PARAM_BOOL);\n $statement->bindValue('id', $id, \\PDO::PARAM_INT);\n return $statement->execute();\n }", "public function status(int $id)\n {\n $user = $this->users->find_one($id);\n $data['id'] = $id;\n if ($user['status'] == 0)\n {\n $data['status'] = 1;\n }\n else\n {\n $data['status'] = 0;\n }\n $this->users->edit($data);\n $this->redirect('admin/users/index');\n }", "public function status($id, $status){\n \tif($status==1){\n \t\t$status =0;\n \t}else{\n \t\t$status = 1;\n \t}\n \tColor::find($id)->update(['status'=>$status]);\n \treturn back();\n }", "public function status($id)\n {\n $staffdepartment = Department::findOrFail($id);\n $status = $staffdepartment->status;\n if($status==0){\n $staffdepartment->status =1;\n $staffdepartment->save();\n }else{\n $staffdepartment->status =0;\n $staffdepartment->save(); \n }\n\n $notification=array(\n 'messege'=>' Department Status Changed Successfully.',\n 'alert-type'=>'success'\n );\n return redirect()->back()->with($notification);\n }", "public function patientStatusput($patient_id, $status_id)\r\n {\r\n $input = Request::all();\r\n $patient_status = PatientStatus::where('patient_id', $patient_id)\r\n ->where('status_id', $status_id)\r\n ->update(['status_id' => $input['status_id']]);\r\n if($patient_status){\r\n return response()->json(['msg' => 'Updated status']);\r\n }else{\r\n return response()->json(['msg' => 'Could not update record'], 405);\r\n }\r\n }", "public function toggleStatus($id, $status)\n {\n $status = $status == 'true' ;\n\n $resource = PaymentType::find($id);\n\n if(!$resource){\n return $this->notFound();\n }\n\n $resource->is_active = $status;\n $resource->save();\n\n $action = $status ? 'activated' : 'deactivated';\n\n return $this->success(\"$this->resourceName successfully {$action}\");\n }", "public function change_status_status()\n\t{\n\t\t$this->_check_user_logged_out();\n\n\t\t// check if user can edit\n\t\t$this->_check_user_can('edit');\n\n\t\t$id = $this->input->post('id');\n\t\t$status = new Item_Status_Model();\n\n\t\t// if not exists?\n\t\tif(! $status->find($id))\n\t\t{\n\t\t\texit(json(array('status' => false, 'msg' => 'Status is not exists or deleted')));\n\t\t}\n\n\t\t$status->active = $status->active ? 0 : 1;\n\t\t// change status success?\n\t\tif($status->save())\n\t\t{\n\t\t\texit(json(array('status' => true, 'msg' => 'Changed status successfully')));\n\t\t}\n\n\t\texit(json(array('status' => false, 'msg' => 'You can not change status at the moment. Please try again later.')));\n\t}", "function changeStatus($id) {\r\n \r\n $hazard_id = $this->uri->segment(3, 0);\r\n $data['hazard_id'] = $hazard_id;\r\n $data['page'] = $this->uri->segment(4, 0);\r\n\t $conditionArr\t = array('H.hazard_id' => $data['hazard_id']);\r\n $checkExist = $this->model_hazard->hazardExistsDB($conditionArr);\r\n if($checkExist) { \r\n $this->model_hazard->statusChangeHazardDB($hazard_id);\r\n $this->session->set_flashdata('message', array('title'=>'Hazard Status','content'=>'Status has been changed','type'=>'successmsgbox'));\r\n redirect(base_url().\"hazard/all/\".$data['page']);\r\n }\r\n\r\n }", "function setStatus($status) {\n\t\treturn $this->setData('status', $status);\t\n\t}", "public function setHealth($status)\n {\n if (is_integer($status))\n {\n if ($this->hostname)\n $this->logger->debug(\"Device {$this->mac}({$this->getHostname()} has changed health status from {$this->health} to $status\",2);\n else\n $this->logger->debug(\"Device {$this->mac} has changed health status from {$this->health} to $status\",2);\n $this->db_row['health']=$status;\n return true;\n }\n else\n {\n return false;\n }\n }", "public function alterarStatus()\n {\n \n if($this->id == \"\" || !is_numeric($this->id))\n return false;\n \n if($this->status == \"\" || !is_numeric($this->id))\n return false;\n \n // Pega as informações do contato em questão.\n $infos = $this->pegarInfo();\n \n if($infos[10] == 1)\n {\n $this->errorlog[] = \"Não é possível alterar o status de contatos já fechados.\";\n return false; // Verificamos se o contato está fechado.\n }\n \n if($infos[10] == 0 && $this->status == 2 )\n {\n $this->errorlog[] = \"Voce não pode pegar um contato aprovado e coloca-lo como aberto.\";\n return false; // Verificamos se o contato é atuante e o status está ordenando que ele seja aberto denovo.\n }\n \n if($this->status == 1)\n {\n if($_SESSION['id_usuario'] == $infos[2])\n $this->alterarNotificacao(4);\n else\n $this->alterarNotificacao(5);\n }\n \n try\n {\n $this->conn->prepareupdate($this->status, \"status\", \"contato\", $this->id, \"id\", \"INT\");\n $this->conn->executa();\n return true;\n }\n catch(PDOException $a)\n {\n $this->errorlog[] = \"Falha ao atualizar o status.\";\n return false;\n }\n }" ]
[ "0.6857208", "0.68292654", "0.6811315", "0.6775452", "0.6733215", "0.6722514", "0.6722514", "0.663648", "0.6624615", "0.66042686", "0.659716", "0.6581481", "0.657221", "0.6556851", "0.65342957", "0.65317184", "0.65234447", "0.6518822", "0.6507906", "0.6500017", "0.64790165", "0.64765555", "0.6474108", "0.64732194", "0.6463452", "0.6460507", "0.64599574", "0.6443371", "0.64303213", "0.64214605" ]
0.7897114
0
param: array of filters. Optional. filters: id, location, email, name, phone return: list of matching hospital
public function get_hospitals ($filters = array) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHospitalList(){\r\n\t\t\r\n\t}", "function contacts_list_filter($filters = array()) {\n $all_users = $this->ldap_get_contacts_partial_attributes();\n $filter_regex = !empty($filters['sSearch']) ? '/' . $filters['sSearch'] . '/i' : FALSE;\n\n $field_or = empty($filters['per_field_operator']);\n $filter_instrument = !empty($filters['instruments']);\n $filter_statusperson = !empty($filters['status_person']);\n $filter_statusorganization = !empty($filters['status_organization']);\n $filter_availability = !empty($filters['availability']);\n $filter_mailing_lists = !empty($filters['mailing_lists']);\n $available = FALSE;\n if($filter_availability) {\n $available = $filters['availability'] == 'TRUE';\n }\n $filtered_users = array();\n\n if($filter_instrument) {\n sort($filters['instruments']);\n }\n foreach($all_users as &$u) {\n $add = TRUE;\n if($filter_instrument) {\n if(is_array($u->instruments)) {\n sort($u->instruments);\n $intersect = array_intersect($u->instruments, $filters['instruments']);\n sort($intersect);\n if($field_or) {\n if(empty($intersect)) {\n $add = FALSE;\n }\n } else {\n if($intersect != $filters['instruments']) {\n $add = FALSE;\n }\n }\n } else {\n $add = FALSE;\n }\n }\n # Country - $field_or is always TRUE as we have one country per user\n if(!empty($filters['countries']) && (empty($u->country) || !in_array($u->country, $filters['countries']))) {\n $add = FALSE;\n }\n # Region - $field_or is always TRUE as we have one region per user\n if(!empty($filters['regions']) && (empty($u->region) || !in_array($u->region, $filters['regions']))) {\n $add = FALSE;\n }\n # Availability\n if($filter_availability && $u->availability != $available) {\n $add = FALSE;\n }\n\n # Mailing Lists\n if($filter_mailing_lists) {\n if(is_array($u->mailing_lists)) {\n sort($u->mailing_lists);\n $intersect = array_intersect($u->mailing_lists, $filters['mailing_lists']);\n sort($intersect);\n if($field_or) {\n if(empty($intersect)) {\n $add = FALSE;\n }\n } else {\n if($intersect != $filters['mailing_lists']) {\n $add = FALSE;\n }\n }\n } else {\n $add = FALSE;\n }\n }\n\n # Search string\n if($filter_regex && !preg_match($filter_regex, $u->full_text)) {\n $add = FALSE;\n }\n # Status person\n if($filter_statusperson) {\n if(is_array($u->statusperson)) {\n sort($u->statusperson);\n $intersect = array_intersect($u->statusperson, $filters['status_person']);\n sort($intersect);\n if($field_or) {\n if(empty($intersect)) {\n $add = FALSE;\n }\n } else {\n if($intersect != $filters['status_person']) {\n $add = FALSE;\n }\n }\n } else {\n $add = FALSE;\n }\n }\n # Status organization\n if($filter_statusorganization) {\n if(is_array($u->statusorganization)) {\n sort($u->statusorganization);\n $intersect = array_intersect($u->statusorganization, $filters['status_organization']);\n sort($intersect);\n if($field_or) {\n if(empty($intersect)) {\n $add = FALSE;\n }\n } else {\n if($intersect != $filters['status_organization']) {\n $add = FALSE;\n }\n }\n } else {\n $add = FALSE;\n }\n }\n # Assignment\n if($add) {\n $filtered_users[] = $u;\n }\n }\n return $filtered_users;\n }", "public function listHospital()\n {\n\n $isUserAdmin = auth()->user()->isAdmin;\n\n if ($isUserAdmin) {\n\n $hospitals = Hospital::all();\n\n return response()->json([\n \"status\" => 1,\n \"data\" => $hospitals\n ]);\n } else {\n\n return response()->json([\n \"status\" => 0,\n \"message\" => \"Only Admins are allowed to do this operation!\"\n ], 401);\n }\n }", "public function getFilters () {\n $filters = array(\n 'appointments' => array(),\n 'dx' => array(),\n 'doctors' => array(),\n\t\t\t'machines' => array(),\n\t\t\t'patients'\t\t => array(),\n 'appointmentStatuses' => array()\n );\n $databaseObj = new Database();\n\n try {\n\n // ***********************************\n // ARIA \n // ***********************************\n $sourceDBSer = 1;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"\n SELECT DISTINCT\n Doctor.ResourceSer,\n Doctor.LastName\n FROM\n variansystem.dbo.Doctor Doctor,\n variansystem.dbo.PatientDoctor PatientDoctor\n WHERE \n PatientDoctor.PrimaryFlag = 1\n AND PatientDoctor.OncologistFlag = 1\n AND Doctor.OncologistFlag = 1\n AND PatientDoctor.ResourceSer = Doctor.ResourceSer\n\n ORDER BY\n Doctor.LastName\n \";\n $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n $query->execute();\n \n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n $doctorArray = array(\n 'name' => $data[1],\n 'id' => $data[0],\n 'type' => 'Doctor',\n 'added' => 0\n );\n array_push($filters['doctors'], $doctorArray);\n }\n\n $sql = \"\n SELECT DISTINCT\n vr.ResourceSer,\n vr.ResourceName\n FROM \n variansystem.dbo.vv_ResourceName vr\n WHERE\n vr.ResourceName LIKE 'STX%'\n OR vr.ResourceName LIKE 'TB%'\n\n ORDER BY \n vr.ResourceName\n \";\n $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n $query->execute();\n \n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n $machineArray = array(\n 'name' => $data[1],\n 'id' => $data[0],\n 'type' => 'Machine',\n 'added' => 0\n );\n array_push($filters['machines'], $machineArray);\n }\n\n }\n\n // ***********************************\n // WaitRoomManagement \n // ***********************************\n $sourceDBSer = 2;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"SELECT 'DOCTOR_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $doctorArray = array(\n // 'name' => $data[0],\n // 'id' => $data[0],\n // 'type' => 'Doctor',\n // 'added' => 0\n // );\n // array_push($filters['doctors'], $doctorArray);\n // }\n\n $sql = \"SELECT 'MACHINE_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $machineArray = array(\n // 'name' => $data[0],\n // 'id' => $data[0],\n // 'type' => 'Machine',\n // 'added' => 0\n // );\n // array_push($filters['machines'], $machineArray);\n // }\n }\n\n // ***********************************\n // Mosaiq \n // ***********************************\n $sourceDBSer = 3;\n $source_db_link = $databaseObj->connectToSourceDatabase($sourceDBSer);\n if ($source_db_link) {\n\n $sql = \"SELECT 'DOCTOR_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $doctorArray = array(\n // 'name' => $data[1],\n // 'id' => $data[0],\n // 'type' => 'Doctor',\n // 'added' => 0\n // );\n // array_push($filters['doctors'], $doctorArray);\n // }\n\n $sql = \"SELECT 'MACHINE_QUERY_HERE'\";\n // $query = $source_db_link->prepare( $sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) );\n // $query->execute();\n // while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n // $machineArray = array(\n // 'name' => $data[1],\n // 'id' => $data[0],\n // 'type' => 'Machine',\n // 'added' => 0\n // );\n // array_push($filters['machines'], $machineArray);\n // }\n\t\t\t}\n\t\t\t\n\t\t\t// ***********************************\n // OpalDB \n // ***********************************\n\t\t\t$host_db_link = new PDO( OPAL_DB_DSN, OPAL_DB_USERNAME, OPAL_DB_PASSWORD );\n\t\t\t$host_db_link->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n\t\t\tif ($host_db_link) {\n\n\t\t\t\t// Patient Filters\n\t\t\t\t$sql = \"\n\t\t\t\t\tSELECT DISTINCT\n\t\t\t\t\t\tpt.PatientSerNum,\n\t\t\t\t\t\tpt.PatientId,\n\t\t\t\t\t\tpt.FirstName,\n\t\t\t\t\t\tpt.LastName\n\t\t\t\t\tFROM\n\t\t\t\t\t\tPatient pt\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tpt.PatientSerNum\n\t\t\t\t\";\n\n\t\t\t\t$query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\t\n\t\t\t\twhile ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\n\t\t\t\t\t$serial \t= $data[0];\n\t\t\t\t\t$patientId \t= $data[1];\n\t\t\t\t\t$firstName \t= $data[2];\n\t\t\t\t\t$lastName \t= $data[3];\n\t\t\t\t\t$patientName = \"$lastName, $firstName ($patientId)\";\n\t\t\t\t\t$patientArray = array(\n\t\t\t\t\t\t'name'\t=> $patientName,\n\t\t\t\t\t\t'id'\t=> $patientId,\n\t\t\t\t\t\t'type' \t=> 'Patient',\n\t\t\t\t\t\t'added'\t=> 0\n\t\t\t\t\t);\n\t\t\t\t\tarray_push($filters['patients'], $patientArray);\n\t\t\t\t}\n\n\t\t\t\t// Diagnosis Filters\n\t\t\t\t$sql = \"\n\t\t\t\t\tSELECT DISTINCT\n\t\t\t\t\t\tdt.Name_EN,\n dt.DiagnosisTranslationSerNum\n\t\t\t\t\tFROM\n\t\t\t\t\t\tDiagnosisTranslation dt\n WHERE\n dt.Name_EN != ''\n\t\t\t\t\";\n\t\t\t\t$query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\n\t\t\t\twhile ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t\t$dxArray = array(\n\t\t\t\t\t\t'name' => $data[0],\n\t\t\t\t\t\t'id' => $data[1],\n\t\t\t\t\t\t'type' => 'Diagnosis',\n\t\t\t\t\t\t'added' => 0\n\t\t\t\t\t);\n\n\t\t\t\t\tarray_push($filters['dx'], $dxArray);\n\t\t\t\t}\n\t\n\t\t\t\t// Appointment Filters\n $sql = \"\n SELECT DISTINCT\n\t\t\t\t\t\tAlias.AliasName_EN,\n\t\t\t\t\t\tAlias.AliasSerNum\n FROM \n\t\t\t\t\t\tAlias\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tAlias.AliasType = 'Appointment'\n ORDER BY\n Alias.AliasName_EN\n \";\n\n $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t\t$query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n \n $appointmentDetails = array(\n 'name' => $data[0],\n 'id' => $data[1],\n 'type' => 'Appointment',\n 'added' => 0\n );\n\t\t\t\t\tarray_push($filters['appointments'], $appointmentDetails);\n\t\t\t\t}\n\n // Appointment Status Filters\n $sql = \"\n SELECT DISTINCT\n sa.Name \n FROM\n StatusAlias sa\n \";\n $query = $host_db_link->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n $query->execute();\n\n while ($data = $query->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\n $statusDetails = array(\n 'name' => $data[0],\n 'id' => $data[0],\n 'type' => 'AppointmentStatus',\n 'added' => 0\n );\n array_push($filters['appointmentStatuses'], $statusDetails);\n }\n\n // Manually add checked in flag\n $statusDetails = array(\n 'name' => 'Checked In',\n 'id' => 1,\n 'type' => 'CheckedInFlag',\n 'added' => 0\n );\n array_push($filters['appointmentStatuses'], $statusDetails);\n\t\t\t}\n\n return $filters;\n\n } catch (PDOException $e) {\n\t\t\techo $e->getMessage();\n\t\t\treturn $filters;\n\t\t}\n }", "public function add_records_filter($params=array())\r\n {\r\n // \r\n // IMPORTANT: This method can be called multiple times per request for \r\n // adding multiple \"and\" filters, each of these \"and\" filters is \r\n // interpreted as \"or\" with the other filters.\r\n // For example:\r\n // \r\n // require_once dirname(__FILE__) . '/search.php';\r\n // require_once dirname(__FILE__) . '/data/fields.php';\r\n // $request = new PiplApi_SearchAPIRequest(array('api_key' => 'samplekey',\r\n // 'username' => 'eric123'));\r\n // $request->add_records_filter(array('domain' => 'linkedin',\r\n // 'has_fields' => array('PiplApi_Phone')));\r\n // $request->add_records_filter(array('has_fields' => array('PiplApi_Phone', 'PiplApi_Job')));\r\n // \r\n // The above request is only for records that are:\r\n // (from LinkedIn AND has a phone) OR (has a phone AND has a job).\r\n // Records that don't match this rule will not come back in the response.\r\n // \r\n // Please note that in case there are too many results for the query, \r\n // adding filters to the request can significantly improve the number of\r\n // useful results; when you define which records interest you, you'll\r\n // get records that would have otherwise be cut-off by the limit on the\r\n // number of records per query.\r\n // \r\n // Args:\r\n // \r\n // domain --string, for example \"linkedin.com\", you may also use \"linkedin\"\r\n // but note that it'll match \"linkedin.*\" and \"*.linkedin.*\" \r\n // (any sub-domain and any TLD).\r\n // category -- string, any one of the categories defined in\r\n // PiplAPI_Source::$categories.\r\n // sponsored_source -- bool, true means you want just the records that \r\n // come from a sponsored source and False means you \r\n // don't want these records.\r\n // has_fields -- An array of fields classes from fields.php,\r\n // records must have content in all these fields.\r\n // For example: array('PiplApi_Name', 'PiplApi_Phone') means you only want records \r\n // that has at least one name and at least one phone.\r\n // query_params_match -- true is the only possible value and it means you \r\n // want records that match all the params you passed \r\n // in the query.\r\n // query_person_match -- true is the only possible value and it means you\r\n // want records that are the same person you \r\n // queried by (only records with \r\n // query_person_match == 1.0, see the documentation \r\n // of record.query_person_match for more details).\r\n // \r\n // InvalidArgumentException is raised in any case of an invalid parameter.\r\n\r\n $filtering_params = self::_prepare_filtering_params($params);\r\n if (!empty($filtering_params))\r\n {\r\n $this->_filter_records_by[] = implode(' AND ', $filtering_params);\r\n }\r\n }", "function GetFilterList() {\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sFilterList = ew_Concat($sFilterList, $this->personID->AdvancedSearch->ToJSON(), \",\"); // Field personID\n\t\t$sFilterList = ew_Concat($sFilterList, $this->personName->AdvancedSearch->ToJSON(), \",\"); // Field personName\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastName->AdvancedSearch->ToJSON(), \",\"); // Field lastName\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nationalID->AdvancedSearch->ToJSON(), \",\"); // Field nationalID\n\t\t$sFilterList = ew_Concat($sFilterList, $this->mobilePhone->AdvancedSearch->ToJSON(), \",\"); // Field mobilePhone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nationalNumber->AdvancedSearch->ToJSON(), \",\"); // Field nationalNumber\n\t\t$sFilterList = ew_Concat($sFilterList, $this->passportNumber->AdvancedSearch->ToJSON(), \",\"); // Field passportNumber\n\t\t$sFilterList = ew_Concat($sFilterList, $this->fatherName->AdvancedSearch->ToJSON(), \",\"); // Field fatherName\n\t\t$sFilterList = ew_Concat($sFilterList, $this->gender->AdvancedSearch->ToJSON(), \",\"); // Field gender\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel1->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel2->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel2\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel3->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel3\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel4->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel4\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel5->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel5\n\t\t$sFilterList = ew_Concat($sFilterList, $this->locationLevel6->AdvancedSearch->ToJSON(), \",\"); // Field locationLevel6\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJSON(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->convoy->AdvancedSearch->ToJSON(), \",\"); // Field convoy\n\t\t$sFilterList = ew_Concat($sFilterList, $this->convoyManager->AdvancedSearch->ToJSON(), \",\"); // Field convoyManager\n\t\t$sFilterList = ew_Concat($sFilterList, $this->followersName->AdvancedSearch->ToJSON(), \",\"); // Field followersName\n\t\t$sFilterList = ew_Concat($sFilterList, $this->status->AdvancedSearch->ToJSON(), \",\"); // Field status\n\t\t$sFilterList = ew_Concat($sFilterList, $this->isolatedLocation->AdvancedSearch->ToJSON(), \",\"); // Field isolatedLocation\n\t\t$sFilterList = ew_Concat($sFilterList, $this->birthDate->AdvancedSearch->ToJSON(), \",\"); // Field birthDate\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ageRange->AdvancedSearch->ToJSON(), \",\"); // Field ageRange\n\t\t$sFilterList = ew_Concat($sFilterList, $this->dress1->AdvancedSearch->ToJSON(), \",\"); // Field dress1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->dress2->AdvancedSearch->ToJSON(), \",\"); // Field dress2\n\t\t$sFilterList = ew_Concat($sFilterList, $this->signTags->AdvancedSearch->ToJSON(), \",\"); // Field signTags\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJSON(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJSON(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->temporaryResidence->AdvancedSearch->ToJSON(), \",\"); // Field temporaryResidence\n\t\t$sFilterList = ew_Concat($sFilterList, $this->visitsCount->AdvancedSearch->ToJSON(), \",\"); // Field visitsCount\n\t\t$sFilterList = ew_Concat($sFilterList, $this->picture->AdvancedSearch->ToJSON(), \",\"); // Field picture\n\t\t$sFilterList = ew_Concat($sFilterList, $this->registrationUser->AdvancedSearch->ToJSON(), \",\"); // Field registrationUser\n\t\t$sFilterList = ew_Concat($sFilterList, $this->registrationDateTime->AdvancedSearch->ToJSON(), \",\"); // Field registrationDateTime\n\t\t$sFilterList = ew_Concat($sFilterList, $this->registrationStation->AdvancedSearch->ToJSON(), \",\"); // Field registrationStation\n\t\t$sFilterList = ew_Concat($sFilterList, $this->isolatedDateTime->AdvancedSearch->ToJSON(), \",\"); // Field isolatedDateTime\n\t\t$sFilterList = ew_Concat($sFilterList, $this->description->AdvancedSearch->ToJSON(), \",\"); // Field description\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\n\t\t// Return filter list in json\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "function hospitals(){\n\t$headers = array(\n\t\t'mhid',\n\t\t'state', // \"State\",\n\t\t'name', //\"Hospname\" ,\n\t\t'wait',\n\t\t'id', // \"Establishment ID\",\n\t\t'parent_id', //\"Parent Id\",\n\t\t'use_default_wait_time',\n\t\t'wait_state_avg',\n\t\t'unit', //\"Unit\",\n\t\t'medicare', //\"Medicare Prov Number\",\n\t\t'address_line_1', //\"Address Line 1\",\n\t\t'address_line_2', //\"Address Line 2\",\n\t\t'lat',\n\t\t'long',\n\t\t'aus',\n\t\t'full_address',\n\t\t'remoteness_area_code', // \"Remoteness area (code)\",\n\t\t'remoteness_area', //\"Remoteness area \",\n\t\t'num_beds', //\"Number of available beds\",\n\t\t'peer_group_code', //\"2012-13 Peer Group code\",\n\t\t'peer_group_name', //\"2012-13 Peer Group Name\",\n\t\t'admissions', //\"Admissions reported\",\n\t\t'emergency', //\"Emergency department\",\n\t\t'elective_surgery', // \"Elective surgery reported\",\n\t\t'outpatient', //\"Outpatient clinics\",\n\t\t'peer_group_code_2012', //\"2011-12 Peer Group code\",\n\t\t'peer_group_name_2012', //\"2011-12 Peer Group Name\"\n\t\t'category', //App category\n\t);\n\n\n\t// If co-ordinates are given\n\tif (isset($_GET['latlong'])){\n\t\tlist($lat, $long) = explode(',', $_GET['latlong']);\n\t}\n\telse {\n\t\t$hospList = explode(PHP_EOL, file_get_contents('data/hosp.csv'));\n\t\t$all = array();\n\t\tarray_shift($hospList);\n\t\tforeach ($hospList as $hosp){\n\t\t\t$cols = str_getcsv($hosp);\n\t\t\tif (sizeof($headers) == sizeof($cols)){\n\t\t\t\t$all[] = array_combine($headers, $cols);\n\t\t\t}\n\t\t}\n\n\n\t\techo json_encode($all);\n\t\texit;\n\t}\n}", "public function findPataients($data) {\n \n $this->PatientServiceTeams = TableRegistry::get('PatientServiceTeams');\n $this->HospitalsEmployees = TableRegistry::get('HospitalsEmployees');\n $this->PatientsBed = TableRegistry::get('PatientsBed');\n \n $serviceTeamCond = [];\n \n $conditions['AND']['Patients.status'] = 1;\n $conditions['AND']['Patients.discharge !='] = 1;\n \n if(!empty($data['hospital_id']) && $data['hospital_id'] > 0) {\n $conditions['AND']['Patients.hospital_id'] = $data['hospital_id'];\n }\n \n $empoyeepatientLists = [];\n if(!empty($data['employee_id'])) {\n $this->EmployeesPatients = TableRegistry::get('EmployeesPatients');\n $empoyeepatientLists = $this->EmployeesPatients->find('list', ['keyField' => 'id','valueField' =>'patient_id'])->where([ 'employee_id' => $data['employee_id'], 'is_deleted' => 0 ])->toArray(); \n if(!empty($empoyeepatientLists)) {\n $conditions['AND']['Patients.id NOT IN'] = array_values($empoyeepatientLists);\n }else{\n $hospitalEmployees = $this->HospitalsEmployees->find('list', ['keyField' => 'service_team_id','valueField' =>'service_team_id'])->where([ 'employee_id' => $data['employee_id']])->toArray(); \n if(!empty($hospitalEmployees)){\n $patientServiceTeams = $this->PatientServiceTeams->find('list', ['keyField' => 'id','valueField' =>'patient_id'])->where([ 'service_team_id IN' => array_values($hospitalEmployees)])->toArray(); \n if(!empty($patientServiceTeams)){\n $conditions['AND']['Patients.id NOT IN'] = array_values($patientServiceTeams);\n }\n }\n }\n }\n \n if(!empty($data['service_team_id']) && $data['service_team_id'] > 0) {\n $patientLists = $this->PatientServiceTeams->find('list', ['keyField' => 'id','valueField' =>'patient_id'])->where(['service_team_id' => $data['service_team_id']])->toArray();\n if(!empty($patientLists)) {\n $patientLists = array_values($patientLists);\n $mainArr = !empty($empoyeepatientLists) ? array_values(array_unique(array_merge($patientLists, $empoyeepatientLists))) : array_values($patientLists);\n $conditions['AND']['Patients.id NOT IN'] = $mainArr;\n }\n }\n \n if(!empty($data['search_param'])) {\n $search = $data['search_param'];\n if($data['type'] == 1) { \n $search = explode(' ', $search);\n \n $firstname = '';\n $lastname = '';\n \n if(!empty($search[0])) {\n $firstname = $search[0];\n }\n \n if(!empty($search[1])) {\n $lastname = $search[1];\n } else {\n $lastname = $firstname;\n }\n \n $conditions['OR']['Patients.firstname LIKE'] = '%'.$firstname.'%';\n $conditions['OR']['Patients.lastname LIKE'] = '%'.$lastname.'%';\n } elseif ($data['type'] == 2) {\n $roomBed = explode('-', $search);\n\n $this->HospitalBeds = TableRegistry::get('HospitalBeds');\n $hospitalBeds = $this->HospitalBeds->find('list', ['keyField' => 'id','valueField' =>'id'])->where([ 'HospitalBeds.room_number' => $roomBed[0],'HospitalBeds.bed_number' => $roomBed[1]])->toArray();\n \n if(!empty($hospitalBeds)){\n \n $patientsBed = $this->PatientsBed->find('list', ['keyField' => 'id','valueField' =>'patient_id'])->where([ 'PatientsBed.hospital_bed_id IN' => $hospitalBeds])->toArray();\n }\n\n if(!empty($patientsBed)) {\n $conditions['AND']['Patients.id IN'] = array_values($patientsBed);\n } else {\n $conditions['AND']['Patients.id'] = 0;\n }\n \n } elseif ($data['type'] == 3) {\n\n $this->Floors = TableRegistry::get('Floors');\n $floors = $this->Floors->find('list', ['keyField' => 'id','valueField' =>'id'])->where([ 'LOWER(Floors.name)' => strtolower($search)])->toArray();\n if(!empty($floors)){\n $this->HospitalBeds = TableRegistry::get('HospitalBeds');\n $hospitalBeds = $this->HospitalBeds->find('list', ['keyField' => 'id','valueField' =>'id'])->where([ 'HospitalBeds.floor_id IN' => $floors])->toArray();\n }\n if(!empty($hospitalBeds)){\n \n $patientsBed = $this->PatientsBed->find('list', ['keyField' => 'id','valueField' =>'patient_id'])->where([ 'PatientsBed.hospital_bed_id IN' => $hospitalBeds])->toArray();\n }\n if(!empty($patientsBed)) {\n $conditions['AND']['Patients.id IN'] = array_values($patientsBed);\n } else {\n $conditions['AND']['Patients.id'] = 0;\n }\n } elseif ($data['type'] == 4) {\n if(isset($search)){\n $conditions['AND']['ServiceTeams.name LIKE'] = '%'.strtolower($search).'%';\n }\n \n }\n }\n \n \n $result = $this->find('all')\n ->select([\n 'id',\n 'firstname',\n 'lastname',\n 'photo',\n 'mrn',\n 'room',\n 'bed',\n 'group_id',\n 'ServiceTeams.name',\n 'ServiceTeams.id'\n ])\n ->join(\n [\n 'PatientServiceTeams' => [\n 'table' => 'patient_service_teams',\n 'type' => 'LEFT',\n 'conditions' => 'PatientServiceTeams.patient_id = patients.id',\n ],\n 'ServiceTeams' => [\n 'table' => 'service_teams',\n 'type' => 'LEFT',\n 'conditions' => 'ServiceTeams.id = PatientServiceTeams.service_team_id',\n ]\n ]) \n ->where($conditions)\n ->toArray();\n \n $patients = [];\n if(!empty($result)) {\n $i = 0;\n foreach ($result as $key => $val) {\n \n $patients[$i]['id'] = $val->id;\n $patients[$i]['name'] = $val->full_name;\n $patients[$i]['photo'] = Configure::read('DEFAULT_PATIENT_IMAGE_URL');\n $patients[$i]['mrn'] = $val->mrn;\n $patients[$i]['group_id'] = $val->group_id;\n $bedData = $this->PatientsBed->getPatientsBed($val->id);\n $patients[$i]['floor'] = (!empty($bedData[\"floor_name\"])) ? $bedData[\"floor_name\"] : '';\n $patients[$i]['bed'] = (!empty($bedData[\"room_number\"]) && !empty($bedData[\"bed_number\"])) ? $bedData[\"room_number\"].'-'.$bedData[\"bed_number\"] : ( !empty($bedData[\"room_number\"]) ? $bedData[\"room_number\"] : (!empty($bedData[\"bed_number\"]) ? $bedData[\"bed_number\"] : ''));\n $patients[$i]['bed status'] = (!empty($bedData[\"status\"])) ? $bedData[\"status\"] : '';\n $patients[$i]['service_team_id'] = isset($val->ServiceTeams[\"id\"]) && !empty($val->ServiceTeams[\"id\"]) ? $val->ServiceTeams[\"id\"] : \"\";\n $patients[$i]['service_team'] = isset($val->ServiceTeams[\"name\"]) && !empty($val->ServiceTeams[\"name\"]) ? $val->ServiceTeams[\"name\"] : \"\";\n $i++;\n }\n }\n \n return $patients;\n }", "public function list(array $filters = []);", "public function search()\n\t{\n\t\t// $filters = Input::get('filters');\n\t\t// $filters = ['first_name'=>'aw', ];\n\t\t// $\n\t\t// isActive = 2\n\t\t// 0 = inactive\n\t\t// 1 = active \n\t\t// 2 = all\n\n\t\t// if(2)\n\t\t//dd($item);\n\n\t\t$countries = Country::leftJoin('states', 'states.country_id', '=', 'countries.id')\n\t\t\t\t\t\t->leftJoin('cities', 'cities.state_id', '=', 'states.id')\n\t\t\t\t\t\t->orWhere(function($query) use ($filters){\n\t\t\t\t\t\t\tforeach ($filters as $key => $value) {\n\t\t\t\t\t\t\t\t$query->where($key, 'LIKE', $value);\n\t\t\t\t\t\t\t}\n \t\t\t\t\t\t})\n\t\t\t\t\t\t ->take(30);\n\n\t}", "public function getAllHospitals() {\n $sql = \"SELECT * FROM hospital_tab\";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return FALSE;\n } else {\n return $result->result_array();\n }\n }", "abstract protected function filterEmployment($data);", "public function getAllHospitals() {\n $result = $this->Doctor_model->getAllHospitals();\n return $result;\n }", "function &search($params,$sql_filter=null)\n\t{\n\t\t$params_in = $params;\n\n\t\t$params['sql_filter'] = $sql_filter;\t// dont allow to set it via UI or xmlrpc\n\n\t\t// check if any resource wants to hook into\n\t\tforeach($this->resources as $data)\n\t\t{\n\t\t\tif (isset($data['search_filter']))\n\t\t\t{\n\t\t\t\t$params = ExecMethod($data['search_filter'],$params);\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($params['users']) || !$params['users'] ||\n\t\t\tcount($params['users']) == 1 && isset($params['users'][0]) && !$params['users'][0])\t// null or '' casted to an array\n\t\t{\n\t\t\t// for a search use all account you have read grants from\n\t\t\t$params['users'] = $params['query'] ? array_keys($this->grants) : $this->user;\n\t\t}\n\t\t// resolve users to add memberships for users and members for groups\n\t\t// for search, do NOT use freebusy rights, as it would allow to probe the content of event entries\n\t\t$users = $this->resolve_users($params['users'], $params['filter'] == 'no-enum-groups', $params['ignore_acl'], empty($params['query']));\n\n\t\t// supply so with private_grants, to not query them again from the database\n\t\tif (!empty($params['query']))\n\t\t{\n\t\t\t$params['private_grants'] = array();\n\t\t\tforeach($this->grants as $user => $rights)\n\t\t\t{\n\t\t\t\tif ($rights & EGW_ACL_PRIVATE) $params['private_grants'][] = $user;\n\t\t\t}\n\t\t}\n\n\t\t// replace (by so not understood filter 'no-enum-groups' with 'default' filter\n\t\tif ($params['filter'] == 'no-enum-groups')\n\t\t{\n\t\t\t$params['filter'] = 'default';\n\t\t}\n\t\t// if we have no grants from the given user(s), we directly return no events / an empty array,\n\t\t// as calling the so-layer without users would give the events of all users (!)\n\t\tif (!count($users))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (isset($params['start'])) $start = $this->date2ts($params['start']);\n\n\t\tif (isset($params['end']))\n\t\t{\n\t\t\t$end = $this->date2ts($params['end']);\n\t\t\t$this->check_move_horizont($end);\n\t\t}\n\t\t$daywise = !isset($params['daywise']) ? False : !!$params['daywise'];\n\t\t$params['enum_recuring'] = $enum_recuring = $daywise || !isset($params['enum_recuring']) || !!$params['enum_recuring'];\n\t\t$cat_id = isset($params['cat_id']) ? $params['cat_id'] : 0;\n\t\t$filter = isset($params['filter']) ? $params['filter'] : 'all';\n\t\t$offset = isset($params['offset']) && $params['offset'] !== false ? (int) $params['offset'] : false;\n\t\t// socal::search() returns rejected group-invitations, as only the user not also the group is rejected\n\t\t// as we cant remove them efficiantly in SQL, we kick them out here, but only if just one user is displayed\n\t\t$users_in = (array)$params_in['users'];\n\t\t$remove_rejected_by_user = !in_array($filter,array('all','rejected','everything')) &&\n\t\t\tcount($users_in) == 1 && $users_in[0] > 0 ? $users_in[0] : null;\n\t\t//error_log(__METHOD__.'('.array2string($params_in).\", $sql_filter) params[users]=\".array2string($params['users']).' --> remove_rejected_by_user='.array2string($remove_rejected_by_user));\n\n\t\tif ($this->debug && ($this->debug > 1 || $this->debug == 'search'))\n\t\t{\n\t\t\t$this->debug_message('calendar_bo::search(%1) start=%2, end=%3, daywise=%4, cat_id=%5, filter=%6, query=%7, offset=%8, num_rows=%9, order=%10, sql_filter=%11)',\n\t\t\t\tTrue,$params,$start,$end,$daywise,$cat_id,$filter,$params['query'],$offset,(int)$params['num_rows'],$params['order'],$params['sql_filter']);\n\t\t}\n\t\t// date2ts(,true) converts to server time, db2data converts again to user-time\n\t\t$events =& $this->so->search(isset($start) ? $this->date2ts($start,true) : null,isset($end) ? $this->date2ts($end,true) : null,\n\t\t\t$users,$cat_id,$filter,$offset,(int)$params['num_rows'],$params,$remove_rejected_by_user);\n\n\t\tif (isset($params['cols']))\n\t\t{\n\t\t\treturn $events;\n\t\t}\n\t\t$this->total = $this->so->total;\n\t\t$this->db2data($events,isset($params['date_format']) ? $params['date_format'] : 'ts');\n\n\t\t//echo \"<p align=right>remove_rejected_by_user=$remove_rejected_by_user, filter=$filter, params[users]=\".print_r($param['users']).\"</p>\\n\";\n\t\tforeach($events as $id => $event)\n\t\t{\n\t\t\tif ($params['enum_groups'] && $this->enum_groups($event))\n\t\t\t{\n\t\t\t\t$events[$id] = $event;\n\t\t\t}\n\t\t\t$matches = null;\n\t\t\tif (!(int)$event['id'] && preg_match('/^([a-z_]+)([0-9]+)$/',$event['id'],$matches))\n\t\t\t{\n\t\t\t\t$is_private = self::integration_get_private($matches[1],$matches[2],$event);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$is_private = !$this->check_perms(EGW_ACL_READ,$event);\n\t\t\t}\n\t\t\tif ($is_private || (!$event['public'] && $filter == 'hideprivate'))\n\t\t\t{\n\t\t\t\t$this->clear_private_infos($events[$id],$users);\n\t\t\t}\n\t\t}\n\n\t\tif ($daywise)\n\t\t{\n\t\t\tif ($this->debug && ($this->debug > 2 || $this->debug == 'search'))\n\t\t\t{\n\t\t\t\t$this->debug_message('socalendar::search daywise sorting from %1 to %2 of %3',False,$start,$end,$events);\n\t\t\t}\n\t\t\t// create empty entries for each day in the reported time\n\t\t\tfor($ts = $start; $ts <= $end; $ts += DAY_s) // good enough for array creation, but see while loop below.\n\t\t\t{\n\t\t\t\t$daysEvents[$this->date2string($ts)] = array();\n\t\t\t}\n\t\t\tforeach($events as $k => $event)\n\t\t\t{\n\t\t\t\t$e_start = max($this->date2ts($event['start']),$start);\n\t\t\t\t// $event['end']['raw']-1 to allow events to end on a full hour/day without the need to enter it as minute=59\n\t\t\t\t$e_end = min($this->date2ts($event['end'])-1,$end);\n\n\t\t\t\t// add event to each day in the reported time\n\t\t\t\t$ts = $e_start;\n\t\t\t\t// $ts += DAY_s in a 'for' loop does not work for daylight savings in week view\n\t\t\t\t// because the day is longer than DAY_s: Fullday events will be added twice.\n\t\t\t\t$ymd = null;\n\t\t\t\twhile ($ts <= $e_end)\n\t\t\t\t{\n\t\t\t\t\t$daysEvents[$ymd = $this->date2string($ts)][] =& $events[$k];\n\t\t\t\t\t$ts = strtotime(\"+1 day\",$ts);\n\t\t\t\t}\n\t\t\t\tif ($ymd != ($last = $this->date2string($e_end)))\n\t\t\t\t{\n\t\t\t\t\t$daysEvents[$last][] =& $events[$k];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$events =& $daysEvents;\n\t\t\tif ($this->debug && ($this->debug > 2 || $this->debug == 'search'))\n\t\t\t{\n\t\t\t\t$this->debug_message('socalendar::search daywise events=%1',False,$events);\n\t\t\t}\n\t\t}\n\t\tif ($this->debug && ($this->debug > 0 || $this->debug == 'search'))\n\t\t{\n\t\t\t$this->debug_message('calendar_bo::search(%1)=%2',True,$params,$events);\n\t\t}\n\t\t//error_log(__METHOD__.\"() returning \".count($events).\" entries, total=$this->total \".function_backtrace());\n\t\treturn $events;\n\t}", "public function getAll($filters = [])\n {\n }", "public function filterHospital($query_string){\n $sql = \"SELECT * FROM hospital_tab WHERE hosp_location LIKE '$query_string%' OR hosp_name LIKE '$query_string%' \";\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 500,\n 'status_message' => 'No data found.');\n } else {\n $response = array(\n 'status' => 200,\n 'status_message' => $result->result_array());\n }\n return $response;\n }", "public function search(Request $request){\n // $checkStr = trim($request->get('checkStr'));\n $fieldStr = trim($request->get('fieldStr'));\n $type = trim($request->get('type'));\n $fieldArr = json_decode($fieldStr, true);\n // dump($fieldArr, $type, ($type == 1) && empty($fieldArr));die;\n if (($type == 0) && empty($fieldArr)) {\n return redirect()->action('ContactController@data_search');\n }\n if (($type == 1) && empty($fieldArr)) {\n return redirect()->action('UserController@admin_search');\n }\n $handle = DB::table('contact');\n $handle2 = DB::table('organisation');\n $queryOrg = false;\n $queryCon = false;\n $queryall = false;\n foreach ($fieldArr as $key=>$val) {\n if (isset($val['key']) && !empty($val['key'])) {\n $condition = $val['condition'];\n $entry = $val['entry'];\n $noentry = $val['noentry'];\n \n $field = $val['key'];\n if (in_array($val['key'], \n ['orgType', 'organisation', 'schoollowerage', 'schoolhigherage', 'schoolURN'])) {\n if($val['key'] == 'organisation') {\n $field = 'name';\n }\n $this->setWhere($field, $entry, $noentry, $condition, $handle2);\n // dump($val['key']);\n $queryOrg = true;\n } elseif (in_array($val['key'], \n ['professionalInterest', 'country', 'region', 'notes'])) {\n $this->setWhere($field, $entry, $noentry, $condition, $handle);\n $this->setWhere($field, $entry, $noentry, $condition, $handle2);\n // dump($val['key']);\n $queryall = true;\n } else {\n $this->setWhere($field, $entry, $noentry, $condition, $handle);\n // dump($val['key']);\n $queryCon = true;\n }\n }\n }\n $results = $results2 = [];\n if ($queryall) {\n $results = $handle->paginate(10);\n $results2 = $handle2->paginate(10);\n } \n if ($queryOrg) {\n $results2 = $handle2->paginate(10);\n } \n if ($queryCon) {\n $results = $handle->paginate(10);\n }\n\n // dump($results, $results2,!empty($results),!empty($results2));die;\n if (!empty($results)) {\n return view('searchreturn',[\n 'fieldStr' => $fieldStr,\n 'fieldArr' => $fieldArr,\n 'results' => $results,\n 'name' =>$this->getUserName()\n ]);\n } \n\n if (!empty($results2)) {\n return view('searchreturn_org',[\n 'fieldStr' => $fieldStr,\n 'fieldArr' => $fieldArr,\n 'results2' => $results2,\n 'name' =>$this->getUserName()\n ]);\n } \n \n }", "public function findAllFilter( $filter = array()){\n //print_r($filter);\n\t\t$query = $this->createQuery();\n\t $constraints[] = $query->greaterThan('uid',0);\n\t\tIf ($filter['verlag'] != 'Verlag') $constraints[] = $query->equals('verlag', $filter['verlag']);\n\t\tIf ($filter['massstab'] != 'Maßstab')$constraints[] = $query->equals('massstab', $filter['massstab']);\n\t\tIf ($filter['typ'] != 'Typ')$constraints[] = $query->equals('typ', $filter['typ'] );\n If ($filter['kartenreihe'] != 'Kartenreihe')$constraints[] = $query->like('kartenreihe', $filter['kartenreihe'] );\n\t\t//$query->setOrderings(array( $route_sort_field => \\TYPO3\\CMS\\Extbase\\Persistence\\QueryInterface::ORDER_ASCENDING)); \n\t\t$result = $query->matching( $query->logicalAnd( $constraints ) )->execute();\n\t\treturn $result;\n\t}", "public function searchSupervisors($filters) {\n\t\tinclude_once('../views/supervisor.view.php');\n\t\t$supervisor = new Supervisor();\n\t\t$supervisorsArray = array();\n\n\t\t$supervisorsArray = $supervisor->getSupervisorsFromSearch($filters);\n\n\t\tSupervisorView::buildSupervisorSearchResults($supervisorsArray);\n\t}", "private function doctor_search()\n\t\t{\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$name = isset($this->_request['name'])? '%'.$this->_request['name'].'%':'';\n\t\t\t$phone_no = isset($this->_request['mobile_number']) ? '%'.$this->_request['mobile_number'].'%':'';\n\t\t\t$speacializaton = isset($this->_request['specializaton'])? '%'.$this->_request['specializaton'].'%':'';\n\t\t\t$pincode = isset($this->_request['pincode']) ? '%'.$this->_request['pincode'].'%' :'';\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$where = \" WHERE 1\";\n\t\t\t\t$where1 = \"\";\n\t\t\t\tif(isset($this->_request['name']) && $this->_request['name']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_name like '%\".$this->_request['name'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['mobile_number']) && $this->_request['mobile_number']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_phone_no like '%\".$this->_request['mobile_number'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['specializaton']) && $this->_request['specializaton']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.specializaton like '%\".$this->_request['specializaton'].\"%'\";\n\t\t\t\t}\n\t\t\t\tif(isset($this->_request['pincode']) && $this->_request['pincode']!='')\n\t\t\t\t{\n\t\t\t\t\t$where .=\" AND du.du_pincode like '%\".$this->_request['pincode'].\"%'\";\n\t\t\t\t}\n\t\t\t\t/*if(isset($this->_request['start_date_time']) && $this->_request['end_date_time']!='')\n\t\t\t\t{\n\t\t\t\t\t$fromdate = date('Y-m-d',strtotime($this->_request['from_date']));\n\t\t\t\t\t$todate = date('Y-m-d',strtotime($this->_request['to_date']));\n\t\t\t\t\t$where .=\" AND date_format(da.start_date,'%Y-%m-%d') >= '\".$fromdate.\"' AND date_format(da.end_date,'%Y-%m-%d') <= '\".$todate.\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$where1 .=\" AND date_format(da.start_date,'%Y-%m-%d') >= '\".date('Y-m-d').\"'\";\n\t\t\t\t}*/\n\t\t\t\t$query=\"SELECT du.du_id, du.du_name, du.du_phone_no, du.du_pic, du.du_city,du.du_district,\n\t\t\t\tdu.du_state, du.du_pincode, du.specializaton, du.qualification, du.du_address,\n\t\t\t\tda.start_date_time, da.doctor_visit_add, DISTINCT(da.doctor_visit_state_id),\n\t\t\t\tFROM table_doctor du\n\t\t\t\tLEFT JOIN doctor_availability da ON du.du_id = da.doc_id {$where1}\n\t\t\t\tLEFT JOIN m_city mc ON du.du_city = mc.cty_id\n\t\t\t\tLEFT JOIN m_state ms ON du.du_state = ms.st_id {$where}\";\n\t\t\t\t$stmt = $this->db->prepare($query);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t$error = array('status' => \"Sucess\", \"msg\" =>\"Availability Data\", \"data\" => $result);\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tcatch(Exception $ex)\n\t\t\t{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" =>$ex->getMessage());\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t}", "public function search() {\n $filterTemplate = array(\"idField\" => FILTER_VALIDATE_INT,\n \"entity\" => FILTER_SANITIZE_STRING);\n $rawData = $_GET;\n $filteredData = filter_var_array($rawData, $filterTemplate);\n if($filteredData['idField']) {\n $entityController = Controllers\\ControllerFactory::genController($filteredData['entity']);\n $targetEntity = $entityController->getSpecific($filteredData['idField']);\n if($filteredData['idField'] == $targetEntity->getId()) {\n ob_start();\n $this->view->show(\"{$filteredData['entity']}s/edit\".ucfirst($filteredData['entity']).\".php\", $targetEntity);\n $editForm = gzcompress(ob_get_clean());\n $_SESSION['editForm'] = $editForm;\n header(\"Location: index.php?action={$filteredData['entity']}/listAll\"); \n } else {\n //header(\"Location: index.php?notFound&entity={$filteredData['entity']}\");\n }\n }\n //header(\"Location: index.php?fillTheFields\");\n }", "public function all()\n {\n return $this->hospitalRepository->all();\n }", "public function createListsFilter();", "public function getAllFilters() {\n \n $filter_list = DB::table(config('db_table_names.filter_list'))\n ->get();\n\n if (count($filter_list)) {\n //Check if the any data was matched.\n return response()->json($filter_list); \n } \n else {\n //Log error in case of empty query (no match found)\n Log::error('Failed '.__METHOD__.'. No record found in filter_list table.');\n return response()->json(['Error' => config('globals.error_msg')]); \n \t\t}\n \t}", "protected function filter()\n {\n $lists = [\n 'listCompetitions',\n 'listCountries',\n 'listEvents',\n 'listEventTypes',\n 'listMarketTypes',\n 'listVenues',\n 'listMarketCatalogue'\n ];\n\n if (in_array($this->method, $lists) && empty($this->params[ 'filter' ])) {\n $this->params[ 'filter' ] = new \\stdClass;\n }\n }", "public function getConsultingList($filter='', $orderBy='',$limit = '') {\n \n $query = \"\tSELECT \n\t\t\t\t\t\t\tc.consultId, c.projectName, c.sponsorName, c.startDate,c.endDate, c.amountFunding, c.remarks, c.employeeId,\n e.employeeName, e.employeeCode\n\t\t\t\t\tFROM\tconsulting c, employee e\n\t\t\t\t\tWHERE\tc.employeeId = e.employeeId\n\t\t\t\t\t $filter\n ORDER BY $orderBy $limit \";\n \n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_actividad->AdvancedSearch->ToJson(), \",\"); // Field id_actividad\n\t\t$sFilterList = ew_Concat($sFilterList, $this->apellidopaterno->AdvancedSearch->ToJson(), \",\"); // Field apellidopaterno\n\t\t$sFilterList = ew_Concat($sFilterList, $this->apellidomaterno->AdvancedSearch->ToJson(), \",\"); // Field apellidomaterno\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre->AdvancedSearch->ToJson(), \",\"); // Field nombre\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nrodiscapacidad->AdvancedSearch->ToJson(), \",\"); // Field nrodiscapacidad\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ci->AdvancedSearch->ToJson(), \",\"); // Field ci\n\t\t$sFilterList = ew_Concat($sFilterList, $this->fecha_nacimiento->AdvancedSearch->ToJson(), \",\"); // Field fecha_nacimiento\n\t\t$sFilterList = ew_Concat($sFilterList, $this->sexo->AdvancedSearch->ToJson(), \",\"); // Field sexo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nivelestudio->AdvancedSearch->ToJson(), \",\"); // Field nivelestudio\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_discapacidad->AdvancedSearch->ToJson(), \",\"); // Field id_discapacidad\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_tipodiscapacidad->AdvancedSearch->ToJson(), \",\"); // Field id_tipodiscapacidad\n\t\t$sFilterList = ew_Concat($sFilterList, $this->resultado->AdvancedSearch->ToJson(), \",\"); // Field resultado\n\t\t$sFilterList = ew_Concat($sFilterList, $this->resultadotamizaje->AdvancedSearch->ToJson(), \",\"); // Field resultadotamizaje\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tapon->AdvancedSearch->ToJson(), \",\"); // Field tapon\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipo->AdvancedSearch->ToJson(), \",\"); // Field tipo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->repetirprueba->AdvancedSearch->ToJson(), \",\"); // Field repetirprueba\n\t\t$sFilterList = ew_Concat($sFilterList, $this->observaciones->AdvancedSearch->ToJson(), \",\"); // Field observaciones\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_apoderado->AdvancedSearch->ToJson(), \",\"); // Field id_apoderado\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_referencia->AdvancedSearch->ToJson(), \",\"); // Field id_referencia\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function searchAction()\n {\n // $searchForm = $this->createSearchForm();\n $em = $this->getDoctrine()->getManager();\n\n $user = $this->getUser();\n $maincompany = $user->getMaincompany();\n $agency = $user->getAgency();\n if ($agency->getType() == 'MASTER') {\n $entities = $em->getRepository('NvCargaBundle:WHrec')->findBy(array('status' => 'RECIBIDO', 'maincompany' => $maincompany));\n $agencies = $em->getRepository('NvCargaBundle:Agency')->findBy(array('maincompany' => $maincompany));\n } else {\n $entities = $em->getRepository('NvCargaBundle:WHrec')->findBy(array('status' => 'RECIBIDO', 'agency' => $agency));\n $agencies = null;\n }\n $status = array();\n $estados = $em->getRepository('NvCargaBundle:Stepstatus')->findByMaincompany($maincompany);\n foreach ($estados as $estado) {\n $status[] = $estado->getName();\n }\n return array(\n 'entities' => $entities,\n 'agencies'=>$agencies,\n 'status' => $status,\n );\n }", "public function filter($filter){\n switch ($filter) {\n case 'all':\n $questions = DB::table('questions')->select(\"id\")->get();;\n break;\n case 'assigned':\n $questions = DB::table('questions')->where('id_hide', '!=', null)->select(\"id\")->get();;\n break;\n case 'not-assigned':\n $questions = DB::table('questions')->where('id_hide', null)->select(\"id\")->get();;\n break;\n }\n return response()->json($questions);\n }", "public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n \n // clear session filters\n TSession::setValue('indiceList_filter_id', NULL);\n TSession::setValue('indiceList_filter_diario', NULL);\n TSession::setValue('indiceList_filter_segundosdiarios', NULL);\n TSession::setValue('indiceList_filter_horassemanal', NULL);\n TSession::setValue('indiceList_filter_valorhora', NULL);\n TSession::setValue('indiceList_filter_datavigencia', NULL);\n\n if (isset($data->id) AND ($data->id)) {\n $filter = new TFilter('id', '=', \"$data->id\"); // create the filter\n TSession::setValue('indiceList_filter_id', $filter); // stores the filter in the session\n }\n\n\n if (isset($data->diario) AND ($data->diario)) {\n $filter = new TFilter('diario', '=', \"$data->diario\"); // create the filter\n TSession::setValue('indiceList_filter_diario', $filter); // stores the filter in the session\n }\n\n\n if (isset($data->segundosdiarios) AND ($data->segundosdiarios)) {\n $filter = new TFilter('segundosdiarios', '=', \"$data->segundosdiarios\"); // create the filter\n TSession::setValue('indiceList_filter_segundosdiarios', $filter); // stores the filter in the session\n }\n\n\n if (isset($data->horassemanal) AND ($data->horassemanal)) {\n $filter = new TFilter('horassemanal', '=', \"$data->horassemanal\"); // create the filter\n TSession::setValue('indiceList_filter_horassemanal', $filter); // stores the filter in the session\n }\n\n\n if (isset($data->valorhora) AND ($data->valorhora)) {\n $filter = new TFilter('valorhora', '=', \"$data->valorhora\"); // create the filter\n TSession::setValue('indiceList_filter_valorhora', $filter); // stores the filter in the session\n }\n\n\n if (isset($data->datavigencia) AND ($data->datavigencia)) {\n $filter = new TFilter('datavigencia', '>=', \"$data->datavigencia\"); // create the filter\n TSession::setValue('indiceList_filter_datavigencia', $filter); // stores the filter in the session\n }\n\n \n // fill the form with data again\n $this->form->setData($data);\n \n // keep the search data in the session\n TSession::setValue('indice_filter_data', $data);\n \n $param=array();\n $param['offset'] =0;\n $param['first_page']=1;\n $this->onReload($param);\n }" ]
[ "0.6619494", "0.63778156", "0.61718845", "0.6074889", "0.6040616", "0.59953505", "0.5923135", "0.58830404", "0.5881307", "0.5861173", "0.58534276", "0.5774635", "0.57714486", "0.5688383", "0.5684549", "0.56791943", "0.56045973", "0.5564845", "0.55387235", "0.55216146", "0.54945254", "0.5492303", "0.5486505", "0.5467902", "0.54650855", "0.5456644", "0.54485226", "0.54321957", "0.54057974", "0.5383612" ]
0.779987
0
Test saving a valid group.
public function testSaveActionExistingGroup() { $groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE); $this->getRequest()->setParam('tax_class', self::TAX_CLASS_ID); $this->getRequest()->setParam('id', $groupId); $this->getRequest()->setParam('code', self::CUSTOMER_GROUP_CODE); $this->getRequest()->setMethod(HttpRequest::METHOD_POST); $this->dispatch('backend/customer/group/save'); $this->assertSessionMessages($this->isEmpty(), MessageInterface::TYPE_ERROR); $this->assertSessionMessages($this->logicalNot($this->isEmpty()), MessageInterface::TYPE_SUCCESS); $this->assertSessionMessages( $this->equalTo(['You saved the customer group.']), MessageInterface::TYPE_SUCCESS ); /** @var \Magento\Framework\Api\SimpleDataObjectConverter $simpleDataObjectConverter */ $simpleDataObjectConverter = Bootstrap::getObjectManager() ->get(\Magento\Framework\Api\SimpleDataObjectConverter::class); $customerGroupData = $simpleDataObjectConverter->toFlatArray( $this->groupRepository->getById($groupId), \Magento\Customer\Api\Data\GroupInterface::class ); ksort($customerGroupData); $this->assertEquals( [ 'code' => self::CUSTOMER_GROUP_CODE, 'id' => $groupId, 'tax_class_id' => self::TAX_CLASS_ID, 'tax_class_name' => self::TAX_CLASS_NAME, ], $customerGroupData ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSaveNoId()\n {\n try {\n $group = new P4_Group;\n $group->save();\n\n $this->fail('unexpected success');\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n $this->fail($e->getMessage());\n } catch (P4_Spec_Exception $e) {\n $this->assertSame(\n 'Cannot save. Group is empty.',\n $e->getMessage(),\n 'unexpected exception message'\n );\n } catch (Exception $e) {\n $this->fail(': unexpected exception ('. get_class($e) .') '. $e->getMessage());\n }\n }", "public function testSaveActionNonExistingGroupId()\n {\n $this->getRequest()->setParam('id', 10000);\n $this->getRequest()->setParam('tax_class', self::TAX_CLASS_ID);\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n\n $this->dispatch('backend/customer/group/save');\n\n $this->assertSessionMessages($this->isEmpty(), MessageInterface::TYPE_SUCCESS);\n $this->assertSessionMessages($this->logicalNot($this->isEmpty()), MessageInterface::TYPE_ERROR);\n $this->assertSessionMessages(\n $this->equalTo(['No such entity with id = 10000']),\n MessageInterface::TYPE_ERROR\n );\n $this->assertRedirect($this->stringStartsWith(self::BASE_CONTROLLER_URL . 'edit/'));\n $this->assertNull($this->session->getCustomerGroupData());\n }", "public function test_group_required()\n {\n $this->actingAsUser();\n\n /** @var \\App\\Student $student | typehinting */\n $student = factory(Student::class)->make(['group' => '']);\n\n $response = $this->post('/students',$student->toArray());\n $response->assertSessionHasErrors('group');\n\n //then it should be in the database\n $this->assertCount(0, Student::all() );\n }", "public function saveGroup() {\n\n $registry = Zend_Registry::getInstance();\n $em = $registry->entitymanager;\n $data = $this->getRequest()->getParams();\n if(isset($data['groupId']) && $data['groupId'] != \"\") \n {\n $groupObj = $em->find('TGroup',$data['groupId']);\n } else {\n $groupObj = new TGroup();\n }\n $groupObj->setName($data['groupname']);\n $groupObj->setKey($data['key']);\n $groupObj->setDescription($data['description']);\n $groupObj->setMutationDate(date('Y-m-d H:i:s'));\n $groupObj->setType($data['grouptype']);\n $groupObj->setYear($data['year']);\n $groupObj->setWSInstance($data['WebServiceID']);\n $groupObj->setClientID($data['GroupClientID']);\n $em->persist($groupObj);\n $em->flush();\n return true;\n }", "public function testSaveGroup()\n {\n $dataGroup = array(\n 'action' => \"add\",\n 'obj_type' => \"note\",\n 'field_name' => 'groups',\n 'name' => 'test save group',\n 'color' => 'blue',\n 'filter' => array('user_id' => -9)\n );\n\n // Set params in the request\n $req = $this->controller->getRequest();\n $req->setBody(json_encode($dataGroup));\n $retGroup = $this->controller->postSaveGroupAction();\n\n $this->assertTrue($retGroup['id'] > 0);\n $this->assertEquals($retGroup['name'], $dataGroup['name']);\n $this->assertEquals($retGroup['color'], $dataGroup['color']);\n $this->assertEquals($retGroup['filter_fields']['user_id'], $dataGroup['filter']['user_id']);\n\n // Setup the save group data with parent\n $dataWithParent = array(\n 'action' => \"add\",\n 'obj_type' => \"note\",\n 'field_name' => 'groups',\n 'parent_id' => $retGroup['id'],\n 'name' => 'test group with parent',\n 'color' => 'green',\n 'filter' => array('user_id' => -9)\n );\n\n // Set params in the request\n $req = $this->controller->getRequest();\n $req->setBody(json_encode($dataWithParent));\n $retWithParent = $this->controller->postSaveGroupAction();\n\n $this->assertTrue($retWithParent['id'] > 0);\n $this->assertEquals($retWithParent['name'], $dataWithParent['name']);\n $this->assertEquals($retWithParent['color'], $dataWithParent['color']);\n $this->assertEquals($retWithParent['parent_id'], $retGroup['id']);\n $this->assertEquals($retWithParent['filter_fields']['user_id'], $dataWithParent['filter']['user_id']);\n\n // Test the edit function of SaveGroup\n $dataEdit = array(\n 'action' => \"edit\",\n 'obj_type' => \"note\",\n 'field_name' => 'groups',\n 'id' => $retGroup['id'],\n 'name' => 'test edit group save',\n 'color' => 'green',\n 'filter' => array('user_id' => -9)\n );\n\n // Set params in the request\n $req = $this->controller->getRequest();\n $req->setBody(json_encode($dataEdit));\n $retEdit = $this->controller->postSaveGroupAction();\n\n $this->assertEquals($retEdit['id'], $retGroup['id']);\n $this->assertEquals($retEdit['name'], $dataEdit['name']);\n $this->assertEquals($retEdit['color'], $dataEdit['color']);\n $this->assertEquals($retEdit['filter_fields']['user_id'], $dataEdit['filter']['user_id']);\n\n // Set the added groups here to be deleted later in the tearDown\n $this->testGroups = array($retWithParent['id'], $retGroup['id']);\n }", "public function testSetNonValidGroupException() {\n $non_group = EntityTest::create([\n 'type' => Unicode::strtolower($this->randomMachineName()),\n 'name' => $this->randomString(),\n ]);\n\n $non_group->save();\n /** @var \\Drupal\\og\\OgMembershipInterface $membership */\n $membership = Og::createMembership($non_group, $this->user);\n $membership->save();\n }", "public function save()\n {\n $group = new Group();\n\n $group->name = $this->gName;\n $group->description = $this->gDescription;\n $group->position = $this->gPos;\n $group->plane = $this->gPlane;\n $group->parent = $this->gParent;\n if ($this->gParent == 0 || $this->gParent == null) {\n $group->parent = null;\n }\n if ($group->save()) {\n $object = new Object();\n $object->name = $this->gName;\n $object->description = $this->gDescription;\n $object->type = $this->gType;\n $object->group = $group->id;\n $this->gGroup = $group->id;\n $object->position = $this->gPos;\n $object->plane = $this->gPlane;\n if ($object->save()) {\n $this->status = self::STATUS_SUCCESS;\n return true;\n }\n $group->delete();\n $this->status = self::STATUS_ERROR;\n }\n return false;\n }", "public function testCreateNewGroup()\n {\n\t\t$group = new Group();\n\n $group->name = null;\n $this->assertFalse($group->validate(['name']));\n\n\t\t$group->name = 'GROEP1';\n $this->assertTrue($group->validate(['name'])); \n\n $group->members = null;\n $this->assertFalse($group->validate(['members']));\n\n\t\t$group->members = 'DEELNEMER1 DEELNEMER2';\n $this->assertTrue($group->validate(['members'])); \n\n $group->start_score = null;\n $this->assertFalse($group->validate(['start_score']));\n\n $group->start_score = 'toolooooongnaaaaaaameeee';\n $this->assertFalse($group->validate(['start_score']));\n\n $group->start_score = 2.2;\n $this->assertFalse($group->validate(['start_score']));\n\n $group->start_score = '0,0';\n $this->assertFalse($group->validate(['start_score']));\n\n\t\t$group->start_score = 3;\n $this->assertTrue($group->validate(['start_score'])); \n\n\t\t$group->save();\n\n\t\t$this->assertEquals(3, $group->start_score);\n\t\t$this->tester->seeInDatabase('group', array('name' => 'GROEP1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'members' => 'DEELNEMER1 DEELNEMER2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'start_score' => 3));\n\n }", "public function testSaveActionNewGroupWithExistingGroupCode()\n {\n $groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE);\n $originalCode = $this->groupRepository->getById($groupId)->getCode();\n\n $this->getRequest()->setParam('tax_class', self::TAX_CLASS_ID);\n $this->getRequest()->setParam('code', self::CUSTOMER_GROUP_CODE);\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n\n $this->dispatch('backend/customer/group/save');\n\n $this->assertSessionMessages($this->equalTo(['Customer Group already exists.']), MessageInterface::TYPE_ERROR);\n $this->assertSessionMessages($this->isEmpty(), MessageInterface::TYPE_SUCCESS);\n $this->assertEquals($originalCode, $this->groupRepository->getById($groupId)->getCode());\n $this->assertRedirect($this->stringStartsWith(self::BASE_CONTROLLER_URL . 'edit/'));\n $this->assertEquals(self::CUSTOMER_GROUP_CODE, $this->session->getCustomerGroupData()['customer_group_code']);\n $this->assertEquals(self::TAX_CLASS_ID, $this->session->getCustomerGroupData()['tax_class_id']);\n }", "public function testSaveAsOwner()\n {\n $user = new P4_User;\n $user->setId('owner-user')\n ->setFullName('Owner Of Group')\n ->setEmail('[email protected]')\n ->save();\n\n $group = new P4_Group;\n $group->setId('test-group')\n ->setUsers(array($user->getId()))\n ->setOwners(array($user->getId()))\n ->save();\n\n // connect as 'owner-user'.\n $connection = P4_Connection::factory(\n $this->p4->getPort(),\n $user->getId()\n );\n\n // save of group should fail w.out owner flag.\n try {\n $group = P4_Group::fetch('test-group', $connection);\n $group->save();\n $this->fail('unexpected success');\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n\n // now try to save the test-group w. owner flag.\n $group = P4_Group::fetch('test-group', $connection);\n $group->save(true);\n }", "function validate_group($group)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $group = Group_Factory::create($group);\n\n if (! $group->exists())\n return lang('flexshare_group_invalid');\n }", "public function testSaveActionNewGroupWithoutGroupCode()\n {\n $groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE);\n $originalCode = $this->groupRepository->getById($groupId)->getCode();\n\n $this->getRequest()->setParam('tax_class', self::TAX_CLASS_ID);\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n\n $this->dispatch('backend/customer/group/save');\n\n $this->assertSessionMessages(\n $this->equalTo([htmlspecialchars('\"code\" is required. Enter and try again.')]),\n MessageInterface::TYPE_ERROR\n );\n $this->assertSessionMessages($this->isEmpty(), MessageInterface::TYPE_SUCCESS);\n $this->assertEquals($originalCode, $this->groupRepository->getById($groupId)->getCode());\n $this->assertRedirect($this->stringStartsWith(self::BASE_CONTROLLER_URL . 'edit/'));\n $this->assertEquals('', $this->session->getCustomerGroupData()['customer_group_code']);\n $this->assertEquals(self::TAX_CLASS_ID, $this->session->getCustomerGroupData()['tax_class_id']);\n }", "public function save(Groupuser $groupuser): bool;", "public function testSaveActionForwardNewEditExistingGroup()\n {\n $groupId = $this->findGroupIdWithCode(self::CUSTOMER_GROUP_CODE);\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->getRequest()->setParam('id', $groupId);\n $this->dispatch('backend/customer/group/save');\n\n $responseBody = $this->getResponse()->getBody();\n $this->assertMatchesRegularExpression(\n '/<h1 class\\=\"page-title\">\\s*' . self::CUSTOMER_GROUP_CODE . '\\s*<\\/h1>/',\n $responseBody\n );\n }", "function doSave()\n {\n assignPostIfExists($num_groups, $this->rs, 'num_groups');\n $this->assign('num_groups', $num_groups);\n\n $res = $this->createStudentGroups($num_groups);\n if ($res == self::ERR_HAVEGRP)\n {\n $this->action = 'err_havegr';\n }\n }", "public function xtestUpdateGroup()\n {\n \n $update = [\n 'name' => 'test_group_' . self::UNIQUE_ID,\n 'attributes' => (Object)[\n 'phone' => ['+1-555-555-5555'],\n 'address' => ['123 Main St.'] \n ],\n ];\n \n $res = $this->clientApi->updateGroupById($update, \"8316bf07-be29-4f15-a937-471a61328c7f\");\n \n self::assertIsObject($res);\n self::assertInstanceOf(Group::class, $res);\n \n }", "public function testSaveExistingMembership() {\n $group = EntityTest::create([\n 'type' => Unicode::strtolower($this->randomMachineName()),\n 'name' => $this->randomString(),\n ]);\n\n $group->save();\n\n Og::groupTypeManager()->addGroup('entity_test', $group->bundle());\n\n /** @var \\Drupal\\og\\OgMembershipInterface $membership */\n $membership1 = Og::createMembership($group, $this->user);\n $membership1->save();\n\n $membership2 = Og::createMembership($group, $this->user);\n $membership2->save();\n }", "public function saveGroup(Groups $group){\n $data = array(\n 'group_title' => $group->group_title,\n 'group_seo_title' => $group->group_seo_title,\n\t\t\t'group_status' => $group->group_status,\n\t\t\t'group_discription' => $group->group_discription,\n\t\t\t'group_added_timestamp' => $group->group_added_timestamp,\n\t\t\t'group_added_ip_address' => $group->group_added_ip_address,\n\t\t\t'group_parent_group_id' => 0,\n\t\t\t'group_location' => $group->group_location,\n\t\t\t'group_city_id' => $group->group_city_id,\n\t\t\t'group_country_id' => $group->group_country_id,\n\t\t\t'y2m_group_location_lat' => $group->y2m_group_location_lat,\n\t\t\t'y2m_group_location_lng' => $group->y2m_group_location_lng,\n\t\t\t'group_web_address' => $group->group_web_address,\n\t\t\t'group_welcome_message_members' => $group->group_welcome_message_members,\n\t\t\t'group_photo_id' => $group->group_photo_id,\n\t\t\t'group_modified_timestamp' => $group->group_modified_timestamp,\n\t\t\t'group_modified_ip_address' => $group->group_modified_ip_address,\n\t\t\t'group_view_counter' => $group->group_view_counter,\t\t\n );\n $group_id = (int)$group->group_id;\n if ($group_id == 0) {\n $this->insert($data);\n\t\t\treturn $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n } else {\n if ($this->getGroup($group_id)) {\n $this->update($data, array('group_id' => $group_id));\n } else {\n throw new \\Exception('Form id does not exist');\n }\n }\n }", "function testGroupAdd()\r\n {\r\n // Instantiate IC controller\r\n $icController = new InfocenterController($this->ant, $this->user);\r\n $icController->debug = true;\r\n \r\n $params['name'] = \"UnitTest GroupName\";\r\n $params['color'] = \"eeeeee\";\r\n \r\n $gid = $icController->groupAdd($params);\r\n $this->assertTrue($gid > 0);\r\n \r\n // clear data\r\n $params['gid'] = $gid;\r\n $ret = $icController->groupDelete($params);\r\n $this->assertTrue($ret > 0);\r\n $this->assertEquals($gid, $ret);\r\n }", "public function testSave()\n\t{\n\t\tglobal $context;\n\n\t\t// Dummy data for setting permissions...\n\t\t$_POST = array(\n\t\t\t'my_dummy_permission1' => array(-1 => 'on', 0 => 'on', 2 => 'on'),\n\t\t\t'my_dummy_permission3' => array(2 => 'on'),\n\t\t);\n\t\t$this->permissionsForm->save();\n\t\tforeach ($_POST as $permission => $groupList)\n\t\t{\n\t\t\t$result[$permission] = $this->results;\n\t\t\tforeach ($groupList as $group => $value)\n\t\t\t{\n\t\t\t\t$result[$permission][$group]['status'] = $value;\n\t\t\t}\n\t\t}\n\t\t$this->doPrepare($result);\n\t}", "public function testSaveActionForwardNewCreateNewGroup()\n {\n $this->getRequest()->setMethod(HttpRequest::METHOD_POST);\n $this->dispatch('backend/customer/group/save');\n $responseBody = $this->getResponse()->getBody();\n $this->assertMatchesRegularExpression(\n '/<h1 class\\=\"page-title\">\\s*New Customer Group\\s*<\\/h1>/',\n $responseBody\n );\n }", "public function testGroup() {\n\t\t$this->assertNotEquals(null, $this->object->group());\n\t\t$this->assertEquals(null, $this->temp->group());\n\t}", "public function test_can_get_group_key(): void {\n\t\t$group = Settings_Group::create( 'key', 'label', 'slug' );\n\t\t$this->assertEquals( 'key', $group->get_group_key() );\n\t\t$this->assertNotEquals( 'TEST', $group->get_group_key() );\n\t}", "public function testGetGroup() {\n $membership = OgMembership::create();\n\n // When no group has been set yet, the method should return NULL.\n $this->assertNull($membership->getGroup());\n\n // Set a group.\n $membership->setGroup($this->group);\n\n // Now the group should be returned. Check both the entity type and ID.\n $this->assertEquals($this->group->getEntityTypeId(), $membership->getGroup()->getEntityTypeId());\n $this->assertEquals($this->group->id(), $membership->getGroup()->id());\n }", "public function beforeValidate()\n {\n if ($this->scenario == self::SCENARIO_EDIT) {\n $this->button = Yii::t('frontend_models_EditGroupModel','Edit');\n if (!($this->_oldAttributes = Group::findById($this->gGroup))) {\n $this->status = self::STATUS_ERROR;\n return false;\n }\n $this->_group = $this->_oldAttributes;\n $this->gPosName = $this->_group->position0->name;\n if (isset($this->_group->parent0)) {\n $this->gParentName = $this->_group->parent0->name;\n }\n if (isset($this->gParent)) {\n $parent = Group::findById($this->gParent);\n if ($parent) {\n $this->gParentName = $parent->name;\n } else {\n $this->gParentName = Yii::t('frontend_models_EditGroupModel','Error. Parent not exist.');\n }\n } else {\n $this->gParentName = Yii::t('frontend_models_EditGroupModel','Parent not set.');\n }\n if (isset($this->_group->object0->type0)) {\n $this->gTypeName = $this->_group->object0->type0->name;\n }\n } elseif ($this->scenario == self::SCENARIO_NEW) {\n $this->button = Yii::t('frontend_models_EditGroupModel','Save new');\n $position = Position::findById($this->gPos);\n if ($position) {\n $this->gPosName = $position->name;\n }\n $parent = Group::findById($this->gGroup);\n if ($parent) {\n $this->gParentName = $parent->name;\n } else {\n $this->gParentName = Yii::t('frontend_models_EditGroupModel','Parent not set.');\n }\n $type = Type::findById($this->gType);\n if ($type) {\n $this->gTypeName = $type->name;\n }\n }\n\n // Check if can manage after filling all necessary form fields.\n if (!\\Yii::$app->user->can('manageLan')) {\n $this->status = self::STATUS_NO_ACCESS;\n return false;\n }\n return true;\n }", "function cgm_store_group(){\n $result = GUMP::is_valid($_POST, array(\n\t'nombre' => 'required|min_len,3'\n ));\n\n if ($result!==true){\n cgm_display_errors($result);\n wp_redirect(get_admin_url().'network/admin.php?page=grupos_multisite&action=add');\n }\n else{\n global $wpdb;\n $error = false;\n $conn = new CGMGroupsModel($wpdb);\n $last_id = $conn->set_group($_POST['nombre']);\n\n if ($last_id==false) $error = true;\n\n foreach ($_POST['sites'] as $site){\n $result = $conn->set_group_in_site($last_id,$site);\n if ($result == false) {$error = true; break;}\n }\n\n if (!$error){\n queue_flash_message( 'Grupo creado correctamente', $class = 'update' );\n }\n else{\n queue_flash_message('Error al añadir el grupo :(', $class='error');\n }\n wp_redirect(get_admin_url().'network/admin.php?page=grupos_multisite&action=add');\n }\n}", "public function store()\r\n\t{\t\r\n\t\t$input = Input::except('_token');\r\n\r\n\t\tif ( ! $this->validator->with($input)->passes())\r\n\t\t{\r\n\t\t\treturn Redirect::back()->withErrors($this->validator->errors())->withInput($input);\r\n\t\t}\r\n\r\n\t\t$this->group->create($input);\r\n\r\n\t\treturn Redirect::back()->withSuccess( trans('group created successfully') );\r\n\t}", "public function saveSubGroup(Groups $group){\n $data = array(\n 'group_title' => $group->group_title,\n 'group_seo_title' => $group->group_seo_title,\n\t\t\t'group_status' => $group->group_status,\n\t\t\t'group_discription' => $group->group_discription,\n\t\t\t'group_added_timestamp' => $group->group_added_timestamp,\n\t\t\t'group_added_ip_address' => $group->group_added_ip_address,\n\t\t\t'group_parent_group_id' => $group->group_parent_group_id,\n\t\t\t'group_location' => $group->group_location,\n\t\t\t'group_photo_id' => $group->group_photo_id,\n\t\t\t'group_city_id' => $group->group_city_id,\n\t\t\t'group_country_id' => $group->group_country_id,\n\t\t\t'y2m_group_location_lat' => $group->y2m_group_location_lat,\n\t\t\t'y2m_group_location_lng' => $group->y2m_group_location_lng,\n\t\t\t'group_web_address' => $group->group_web_address,\n\t\t\t'group_welcome_message_members' => $group->group_welcome_message_members,\n\t\t\t'group_modified_timestamp' => $group->group_modified_timestamp,\n\t\t\t'group_modified_ip_address' => $group->group_modified_ip_address,\n\t\t\t'group_view_counter' => $group->group_view_counter,\t\t\n );\n $group_id = (int)$group->group_id;\n if ($group_id == 0) {\n $this->insert($data);\n\t\t\treturn $this->adapter->getDriver()->getConnection()->getLastGeneratedValue();\n } else {\n if ($this->getSubGroup($group_id)) {\n $this->update($data, array('group_id' => $group_id));\n } else {\n throw new \\Exception('Form id does not exist');\n }\n }\n }", "public function DoGroupSave($form) {\r\n $name = $form['name']['value'];\r\n $acronym = $form['acronym']['value'];\r\n $id = $form['id']['value'];\r\n $ret = $this->user->GroupSave($name, $acronym,$id);\r\n $this->AddMessage($ret, 'Saved group.', 'Failed saving profile.');\r\n $this->RedirectToController('profile');\r\n}", "public function testUserHasGroup()\n {\n $user = User::with('usergroups')->find(1);\n\n $grp1 = new Group();\n $grp1->id = 1;\n\n $grp2 = new Group();\n $grp2->id = 3;\n\n $grp3 = new Group();\n $grp3->id = 100;\n\n $this->assertTrue($user->hasGroup($grp1));\n $this->assertTrue($user->hasGroup($grp2));\n $this->assertFalse($user->hasGroup($grp3));\n }" ]
[ "0.7507239", "0.71727014", "0.7149587", "0.70306414", "0.6983984", "0.6942868", "0.69268394", "0.686317", "0.6848633", "0.68360335", "0.6799606", "0.67428637", "0.6714546", "0.6685954", "0.6534569", "0.650587", "0.650224", "0.64944625", "0.6489491", "0.64828014", "0.64667255", "0.6465254", "0.6420642", "0.62829715", "0.62698066", "0.6233522", "0.6208591", "0.619229", "0.6191898", "0.61905" ]
0.7422942
1
Find the group with a given code.
protected function findGroupIdWithCode($code) { /** @var \Magento\Framework\Api\SearchCriteriaBuilder $searchBuilder */ $searchBuilder = $this->_objectManager->create(\Magento\Framework\Api\SearchCriteriaBuilder::class); foreach ($this->groupRepository->getList($searchBuilder->create())->getItems() as $group) { if ($group->getCode() === $code) { return $group->getId(); } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGroupByCode($code)\n {\n $group = null;\n foreach ($this->getGroups() as $_group) {\n if ($_group->getCode() == $code) {\n $group = $_group;\n break;\n }\n }\n return $group;\n }", "public function findGroupedByCode($code)\n {\n }", "public function getByCode($code)\n {\n $em = $this->getEntityManager();\n \n $repo = $em->getRepository('User\\Model\\Group');\n\n $qb = $repo->createQueryBuilder('ug');\n \n $repo->restrictToCode($qb, $code);\n \n try {\n $group = $qb->getQuery()->getSingleResult();\n } catch (NoResultException $e) {\n throw new NotFoundException(\n sprintf('Code `%s` not found', $code), null, $e\n );\n }\n \n return $group;\n }", "public function getGroupByCode($code)\r\n {\r\n \treturn $this->fetchAll(array(\r\n \t\t'CODEGROUP = ?' => $code\r\n \t))->toArray();\r\n }", "public function getGroupIdByCode($code)\n {\n $group = $this->getGroupByCode($code);\n if ($group) {\n return $group->getId();\n } else {\n return null;\n }\n }", "protected function getCustomerGroupIdByCode($code)\n {\n $select = $this->_connection->select()\n ->from(\n $this->getTableFromModel($this->getDataCustomerGroupResourceModel()),\n 'customer_group_id'\n )\n ->where('customer_group_code = ?', $code);\n\n return $this->_connection->fetchOne($select);\n }", "abstract public function find($code);", "public function find($code){\n\t\treturn parent::find($code);\n\t}", "public function checkCode($query_group_id,$query_code){\n $sqlQuery = \"SELECT GROUP_ID,GROUP_CODE\n FROM\n \". $this->db_table .\"\n WHERE \n GROUP_ID = ?\";\n $stmt = $this->conn->prepare($sqlQuery);\n\n $stmt->bindParam(1, $query_group_id, PDO::PARAM_INT);\n $stmt->execute();\n\n $data_row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if($query_code == $data_row[\"GROUP_CODE\"]){\n return true;\n }else{\n return false;\n }\n\n }", "function findGroupByName($name) {\n global $TOKEN;\n global $ME;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"https://api.groupme.com/v3/groups?token=${TOKEN}&per_page=100\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $contents = curl_exec($ch);\n curl_close($ch);\n\n $groups = json_decode($contents, true)[\"response\"];\n foreach ($groups as $group) {\n foreach ($group[\"members\"] as $member) {\n if ($member[\"user_id\"] == $ME && $member[\"nickname\"] == $name) {\n return $group[\"group_id\"];\n }\n }\n }\n return false;\n }", "public function getByCode($code);", "public function getByCode($code);", "public static function findByCode($code)\n {\n return static::findOne(['code' => $code]);\n }", "function groups_db_m_get_group($groupid) {\n}", "public function getGroup() {\n if(!isset($this->group)) \n {\n $mapper = new Application_Model_GroupsMapper();\n $this->group = $mapper->findWherePriKeyEquals($this->groups_id);\n }\n return $this->group;\n }", "public function findByCode($code) {\n return $this->find(\n null,\n 'v1/ShopGroup/' . App::getInstance()\n ->getSetting('shopId') . '/Products/' . $code\n );\n }", "public static function getByCode($code)\n {\n return static::get()->filter('Code', $code)->first();\n }", "public function findByCode($code)\n {\n return $this->getRepository()\n ->findOneBy(array(\n 'code' => $code,\n ));\n }", "public function getByCode($code)\n\t{\n\t\t\n\t\t$select = $this->_db->select()\t\n\t\t\t\t\t\t->from(array('match' => 'match'))\t\t\n\t\t\t\t\t\t->joinLeft(array('usermentor' => 'user'), 'usermentor.user_code = match.mentor_code', array('concat(usermentor.user_name, \\' \\', usermentor.user_surname) as mentorname'))\n\t\t\t\t\t\t->joinLeft(array('usermentee' => 'user'), 'usermentee.user_code = match.mentee_code', array('concat(usermentee.user_name, \\' \\', usermentee.user_surname) as menteename'))\t\n\t\t\t\t\t\t->joinLeft('mentorship', 'mentorship.mentorship_code = match.mentorship_code and mentorship_deleted = 0 and mentorship_active = 1')\n\t\t\t\t\t\t->joinLeft('partner', 'partner.partner_code = usermentee.partner_code and partner_deleted = 0 and partner_active = 1')\n\t\t\t\t\t\t->where('match_active = 1 and match_deleted = 0')\n\t\t\t\t\t\t->where('match.match_code = ?', $code)\n\t\t\t\t\t\t->limit(1);\n \n\t $result = $this->_db->fetchRow($select);\n return ($result == false) ? false : $result = $result;\n\n\t}", "public static function byCode($code)\n {\n return static::whereCode($code)->firstOrFail();\n }", "function getGroup();", "public function getWithCode($code);", "public function getGroupIdByCodeOrId($codeOrId)\n {\n if ($this->isGroupIdExists($codeOrId)) {\n return $codeOrId;\n }\n return $this->getGroupIdByCode($codeOrId);\n }", "public function getByCode($code)\n {\n $class = $this->resolveClassName($code);\n return $this->get($class);\n }", "public function group() {\n return entity_load($this->group_type, $this->gid);\n }", "public function getGroup();", "public function getGroup();", "public function getGroup();", "public function findByCode($code)\n {\n return $this->model->where('code', $code)->first();\n }", "public function getChild($code);" ]
[ "0.79583734", "0.7952141", "0.7777912", "0.71016866", "0.68176854", "0.65226007", "0.6385515", "0.63172925", "0.6051384", "0.59923774", "0.59572375", "0.59572375", "0.595408", "0.5915161", "0.5895745", "0.58560777", "0.585545", "0.5813069", "0.57989454", "0.5785589", "0.5724279", "0.5715817", "0.57153827", "0.56697035", "0.5664613", "0.5664494", "0.5664494", "0.5664494", "0.56518686", "0.5632539" ]
0.7983512
0
Informations about this module
function modules_info() { global $lang; return array( 'name' => $lang['modules']['modules'], 'description' => $lang['modules']['modules_desc'], 'author' => 'Klocek', 'version' => '0.1', 'add2nav' => TRUE ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getinfoModule() {\n\n\t}", "public function info();", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "public function info()\n {\n }", "function info()\r\n {\r\n }", "public function info(){\n echo 'AUTHOR :' . self::APP_AUTHOR . PHP_EOL;\n }", "abstract public function info();", "protected function create_module_info()\n\t\t{\n\t\t\treturn new Core_ModuleInfo(\n\t\t\t\t\"ooLemonStandBox\",\n\t\t\t\t\"LemonStand Protobox companion module to help with development\",\n\t\t\t\t\"OpenOrchard\" );\n\t\t}" ]
[ "0.7847194", "0.7275549", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.721897", "0.7089287", "0.6958313", "0.69280654", "0.6812316" ]
0.72878236
1
Check current superuser password
protected function checkCurrentPassword() { $credentials = [ $this->superuser->getKeyName() => $this->superuser->getKey(), 'password' => $this->secret('Enter superuser CURRENT password: ') ]; return auth()->validate($credentials); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function CheckPassword(){\r\n\r\n\t\t\tif($this->data[$this->alias]['password'] == Security::hash($this->data[$this->alias]['pass'],null,true)){\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}", "public function checkPassword($password);", "public function checkCurrentPassword()\n\t{\n\t\t$dataPosted = $this->data[$this->name];\n\t\t$currUser = $this->find('first', array(\n\t\t\t\t'conditions' => array('id' => $dataPosted['id']),\n\t\t\t\t'fields' => array('user_pwd')\n\t\t\t)\n\t\t);\n\n\t\tif(!empty($currUser['User']['user_pwd'])) {\n\n\t\t\tif($currUser['User']['user_pwd'] == $dataPosted['current_password']) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function check_password($password)\n\t{\n\t\t\n\t}", "public function checkPassword()\n\t{\n\t\t$currentPassword = $this->currentPasswordInput;\n\t\t\n\t\t$user = static::findByID($_SESSION['user_id']);\n\t\t\n\t\tif ($user) {\n if (password_verify($currentPassword, $user->password)) {\n return true;\n }\n }\n\n return false;\n\t}", "function validate_password($password)\n {\n clearos_profile(__METHOD__, __LINE__);\n }", "protected function getUsePassword()\n\t{\n\t\treturn $this->theTable === 'fe_users' && isset($this->conf['create.']['evalValues.']['password']);\n\t}", "public function isSuperUser();", "protected function readIsPassword() { return $this->_ispassword; }", "function check_password($password)\n\t{\n\t\treturn ($password == $this->password);\n\t}", "function getPassword();", "public function getPassword()\n {\n return false;\n }", "public function hasPassword()\n {\n return is_string($this->get('password'));\n }", "function checkPassword($userinfo) {\n\t\t$user_auth = $this->params->get('user_auth');\n\n\t\t$user_auth = rtrim(trim($user_auth), ';');\n\t\tob_start();\n\t\t$check = eval($user_auth . ';');\n\t\t$error = ob_get_contents();\n\t\tob_end_clean();\n\t\tif ($check===false && strlen($error)) {\n\t\t\tdie($error);\n\t\t}\n\t\tif ($check === true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function authenthicate() {\n $data_auth_check_password = $this->checkPassword();\n if ($this->authAdmin() && $this->checkPassword()) {\n return TRUE;\n } else\n return false;\n }", "public function getUserPassword() {\n return($this->userPassword);\n }", "public function testIfAdminUserPasswordIsAdmin()\n {\n $mi = MembroInstituicao::where('login', 'admin')->first();\n\n $this->assertTrue(\n Hash::check('admin', $mi->senha),\n \"Admin account should have the password 'admin' by default.\"\n );\n }", "function check_password($password){\n\t\t$db_user = new db_query(\"SELECT use_password,use_security\n\t\t\t\t\t\t\t\t\t\t FROM users, user_group\n\t\t\t\t\t\t\t\t\t\t WHERE use_group = group_id AND use_active=1 AND use_login = '\" . $this->removequote($this->login_name) . \"'\");\n\t\tif ($row=mysql_fetch_array($db_user->result)){\n\t\t\t$password=md5($password . $row[\"use_security\"]);\n\t\t\tif($password==$row[\"use_password\"]) return 1;\n\t\t}\n\t\tunset($db_user);\n\t}", "public function validateCurrentPassword(){\n\t\t/*jika current password tidak sama dengan yang diinputkan maka*/\n\t\t$currentPassword = SBUser::model()->findByPk(Yii::app()->user->id);\n if(!$currentPassword->validatePassword($this->oldPassword,$currentPassword->password)){\n \t/*set error dengan message 'current password . . . .*/\n \t$this -> addError('oldPassword', 'Current Password is not match');\n }else{\n \t/*jika benar return TRUE*/\n \treturn TRUE;\n }\n }", "protected function getUsePasswordAgain()\n\t{\n\t\treturn $this->getUsePassword() && GeneralUtility::inList($this->conf['create.']['evalValues.']['password'], 'twice');\n\t}", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "function um_requesting_password_change() {\r\n\tif (um_is_core_page( 'account' ) && isset( $_POST['_um_account'] ) == 1)\r\n\t\treturn true;\r\n else if (isset( $_POST['_um_password_change'] ) && $_POST['_um_password_change'] == 1)\r\n\t\treturn true;\r\n\r\n\treturn false;\r\n}", "function recuperer_user_pass($user_email)\n\t {\n\t\t\treturn true;\n\t }", "public function hasPassword()\n {\n return (bool) $this->password;\n }", "public function getUserPassword(){\n\t\treturn $this->userPassword;\n\t}", "public function checkPassword()\n\t{\n\t\t$getData = $this->input->post();\n\t\t$result = $this->ieModel->getAll($getData['tableName'], $getData['columnName'], array('user_id' => $_SESSION['id'])); //password user\n\t\t$passwordcodedb = $result[0]->user_password;\n\t\t$returnData = password_verify($getData['password'], $passwordcodedb);\n\t\t$this->output->set_content_type('application/json')->set_output(json_encode($returnData));\n\t}" ]
[ "0.68493664", "0.66992575", "0.6666657", "0.6647046", "0.6599864", "0.6584641", "0.6565606", "0.6564691", "0.65604293", "0.655808", "0.65369904", "0.6514369", "0.6486759", "0.64771223", "0.63994545", "0.6355609", "0.63510376", "0.6340029", "0.63398755", "0.63254815", "0.63190305", "0.63190305", "0.63190305", "0.63190305", "0.63190305", "0.6310548", "0.6283341", "0.6273478", "0.62663597", "0.6245306" ]
0.7938913
0
/ Function to Update Tabs Background Images
public static function updateTabBckImage($appId, $imgId, $tabs, $bg_image_type) { if ($bg_image_type == 1) { $bgImage = 'background_image'; } else if ($bg_image_type == 2) { $bgImage = 'tablet_bg_img'; } else { $bgImage = 'iphone_bg_img'; } for ($i = 0; $i < count($tabs); $i++) { DB::table('tp_apps_tabs_entity') ->where('app_id', $appId) ->where('id', $tabs[$i]) ->update([$bgImage => $imgId]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addImageBackground(): void\n {\n $this->paramViews['imgaccueil'] = '';\n $dossier = 'fichiers/login';\n if (!is_dir($dossier)) {\n return;\n }\n\n $tabfichiers = glob(\"{$dossier}/*.*\");\n if (FALSE !== (bool) $tabfichiers && is_array($tabfichiers)) {\n $id = array_rand($tabfichiers, 1);\n $imgaccueil = $this->generateUrl('site.index') . $tabfichiers[$id];\n $this->paramViews['imgaccueil'] = $imgaccueil;\n }\n }", "public function background();", "function inkpro_set_background_image_mods( $inkpro_mods ) {\r\n\t$inkpro_mods['background_image'] = array(\r\n\t\t'id' => 'background_image',\r\n\t\t'title' => esc_html__( 'Background Image', 'inkpro' ),\r\n\t\t'options' => array()\r\n\t);\r\n\treturn $inkpro_mods;\r\n}", "public function setImageBackgroundColor ($background) {}", "function background(){\n\t\t$bg = imagecolorallocate($this->img,$this->img_bg_color[0],$this->img_bg_color[1],$this->img_bg_color[2]);\n\t\timagefill($this->img,0,0,$bg);\n\t}", "function add_menu_backround_selection() {\n for( $i = 0; $i < 4; $i++ ) {\n switch ( $i ) {\n case 0:\n $section = 'About us';\n break;\n case 1:\n $section = 'Developments';\n break;\n case 2:\n $section = 'Our services';\n break;\n case 3:\n $section = 'Contact us';\n break;\n }\n $page = add_theme_page( \"gj-backgrounds-\" . $i, \"Backgrounds - $section\", \"administrator\", \"gj-backgrounds-\" . $i, 'add_background_selection' );\n\n add_action( 'load-' . $page, 'enqueue_background_scripts' );\n }\n}", "function set_background($background)\r\n {\r\n $this->background = $background;\r\n }", "function global_tabs($onoff=\"\") {\n\n$IPBHTML = \"\";\n//--starthtml--//\n\n$IPBHTML .= <<<EOF\n<div class='{$onoff['dashboard']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/dashboard.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=dashboard'>HOME</a></div>\n<div class='{$onoff['content']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/system.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=content'>MANAGEMENT</a></div>\n<div class='{$onoff['lookandfeel']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/lookfeel.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=lookandfeel'>LOOK &amp; FEEL</a></div>\n<div class='{$onoff['tools']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/tools.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=tools'>TOOLS &amp; SETTINGS</a></div>\n<div class='{$onoff['components']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/components.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=components'>COMPONENTS</a></div>\n<div class='{$onoff['admin']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/admin.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=admin'>ADMIN</a></div>\n<div class='{$onoff['help']}'><img src='{$this->ipsclass->skin_acp_url}/images/tabs_main/help.png' style='vertical-align:middle' /> <a href='{$this->ipsclass->base_url}&section=help'>SUPPORT</a></div>\n\nEOF;\n\n//--endhtml--//\nreturn $IPBHTML;\n}", "public function setSections() {\n // Background Patterns Reader\n $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/';\n $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/';\n $sample_patterns = array();\n\n if ( is_dir( $sample_patterns_path ) ) :\n\n if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) :\n $sample_patterns = array();\n\n while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) {\n\n if ( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) {\n $name = explode( '.', $sample_patterns_file );\n $name = str_replace( '.' . end( $name ), '', $sample_patterns_file );\n $sample_patterns[] = array(\n 'alt' => $name,\n 'img' => $sample_patterns_url . $sample_patterns_file\n );\n }\n }\n endif;\n endif;\n\n ob_start();\n\n $ct = wp_get_theme();\n $this->theme = $ct;\n $item_name = $this->theme->get( 'Name' );\n $tags = $this->theme->Tags;\n $screenshot = $this->theme->get_screenshot();\n $class = $screenshot ? 'has-screenshot' : '';\n\n $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;', 'business-review' ), $this->theme->display( 'Name' ) );\n\n ?>\n <div id=\"current-theme\" class=\"<?php echo esc_attr( $class ); ?>\">\n <?php if ( $screenshot ) : ?>\n <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>\n <a href=\"<?php echo wp_customize_url(); ?>\" class=\"load-customize hide-if-no-customize\"\n title=\"<?php echo esc_attr( $customize_title ); ?>\">\n <img src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'business-review' ); ?>\"/>\n </a>\n <?php endif; ?>\n <img class=\"hide-if-customize\" src=\"<?php echo esc_url( $screenshot ); ?>\"\n alt=\"<?php esc_attr_e( 'Current theme preview', 'business-review' ); ?>\"/>\n <?php endif; ?>\n\n <h4><?php echo $this->theme->display( 'Name' ); ?></h4>\n\n <div>\n <ul class=\"theme-info\">\n <li><?php printf( __( 'By %s', 'business-review' ), $this->theme->display( 'Author' ) ); ?></li>\n <li><?php printf( __( 'Version %s', 'business-review' ), $this->theme->display( 'Version' ) ); ?></li>\n <li><?php echo '<strong>' . __( 'Tags', 'business-review' ) . ':</strong> '; ?><?php printf( $this->theme->display( 'Tags' ) ); ?></li>\n </ul>\n <p class=\"theme-description\"><?php echo $this->theme->display( 'Description' ); ?></p>\n <?php\n if ( $this->theme->parent() ) {\n printf( ' <p class=\"howto\">' . __( 'This <a href=\"%1$s\">child theme</a> requires its parent theme, %2$s.', 'business-review' ) . '</p>', __( 'http://codex.wordpress.org/Child_Themes', 'business-review' ), $this->theme->parent()->display( 'Name' ) );\n }\n ?>\n\n </div>\n </div>\n\n <?php\n $item_info = ob_get_contents();\n\n ob_end_clean();\n\n $sampleHTML = '';\n if ( file_exists( dirname( __FILE__ ) . '/info-html.html' ) ) {\n Redux_Functions::initWpFilesystem();\n\n global $wp_filesystem;\n\n $sampleHTML = $wp_filesystem->get_contents( dirname( __FILE__ ) . '/info-html.html' );\n }\n $this->sections[] = array(\n 'title' => __( 'Settings', 'business-review' ),\n 'icon' => 'el el-cogs',\n 'fields' => array(\n array(\n 'id' => 'locations',\n 'type' => 'multi_text',\n 'title' => __( 'Locations', 'business-review' ),\n 'desc' => __( 'Different locations where the business have branches.', 'business-review' )\n ),\n array(\n 'id' => 'rating_fields',\n 'type' => 'grid_input',\n 'title' => __( 'Review fields', 'business-review' ),\n 'subtitle' => __( 'List all the fields or rating criterias here.', 'business-review' ),\n 'desc' => __( 'Changing this setting may mess up your existing reviews.', 'business-review' ) ),\n array(\n 'id' => 'satisfaction_threshold',\n 'type' => 'text',\n 'title' => __( 'Satisfaction Threshold', 'business-review' ),\n 'subtitle' => __( 'Minimum average rating to consider a review is positive.', 'business-review' ),\n 'default' => '4'\n ),\n array(\n 'id' => 'review_page',\n 'type' => 'select',\n 'data' => 'pages',\n 'title' => __( 'Review Page', 'business-review' ),\n 'subtitle' => __( 'The page where you placed the [business_review] shortcode to display reviews.', 'business-review' ),\n 'default' => 0\n ),\n array(\n 'id' => 'number_of_reviews',\n 'type' => 'text',\n 'title' => __( 'Number of Reviews to Show', 'business-review'),\n 'default' => 30\n ),\n array(\n 'id' => 'review_columns',\n 'type' => 'text',\n 'title' => __( 'Review Columns', 'business-review' ),\n 'subtitle' => __( 'Number of columns to divide the reviews in.', 'business-review' ),\n 'default' => 2\n ),\n array(\n 'id' => 'show_gravatar',\n 'type' => 'switch',\n 'title' => __('Show Gravatar', 'business-review'),\n 'subtitle' => __('Display the global avatar of the user.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'verify_poor_rating',\n 'type' => 'switch',\n 'title' => __('Verify Negative Reviews', 'business-review'),\n 'subtitle' => __('Instead of directly publishing, keep reviews pending if it\\'s negative.', 'business-review'),\n 'default' => false,\n ),\n array(\n 'id' => 'restriction_scope',\n 'type' => 'select',\n 'title' => __('Review Restriction Scope', 'business-review'),\n 'subtitle' => __('Let user post only one review in the site or one review per location.', 'business-review'),\n 'options' => array( 'location' => __( 'One review per location', 'business-review' ), 'website' => __( 'Review only ones regardless of what location choosen', 'business-review' ) ),\n 'default' => 'location',\n ),\n array(\n 'id' => 'one_review_per_ip',\n 'type' => 'switch',\n 'title' => __('One Review Per IP', 'business-review'),\n 'subtitle' => __('Prevent multiple reviews from single IP.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'one_review_per_email',\n 'type' => 'switch',\n 'title' => __('One Review Per Email', 'business-review'),\n 'subtitle' => __('Prevent multiple reviews from same email.', 'business-review'),\n 'default' => true,\n ),\n array(\n 'id' => 'review_form',\n 'type' => 'editor',\n 'title' => __( 'Review Form', 'business-review' ),\n 'subtitle' => __( 'The form that will be used to review', 'business-review' ) ),\n array(\n 'id' => 'thank_you_message_positive',\n 'type' => 'editor',\n 'title' => __( 'Thank You Message for Positive Review', 'business-review' ),\n 'default' => __( 'Thank you for your feedback. Your feedback inspires us making the service better.', 'business-review' )\n ),\n array(\n 'id' => 'thank_you_message_negative',\n 'type' => 'editor',\n 'title' => __( 'Thank You Message for Negative Review', 'business-review' ),\n 'default' => __( 'We are sorry to see that you were not satisfied with our service. Before publishing this review, we will contact you trying to fix your issue if possible.', 'business-review' )\n ),\n array(\n 'id' => 'review_duplicate_error',\n 'type' => 'editor',\n 'title' => __( 'Already Reviewed Error Message', 'business-review' ),\n 'default' => __( 'We only accept one review per person to protect the integrity.', 'business-review' )\n ),\n array(\n 'id' => 'custom_css',\n 'type' => 'ace_editor',\n 'title' => __('Custom CSS Code', 'business-review'),\n 'subtitle' => __('Paste your CSS code here.', 'business-review'),\n 'mode' => 'css',\n 'theme' => 'monokai',\n 'default' => ''\n )\n\n )\n );\n\n $this->sections[] = array(\n 'type' => 'divide',\n );\n }", "function displayTabMenu($arrItems,$arrLinks,$arrImages,$currentItem)\r\n{\r\n\t/*echo \"eneterd\";*/\r\n\techo \"<div id=\\\"ddtabs2\\\" class=\\\"glowingtabs\\\"><ul>\";\r\n\t for($i=0;$i<count($arrItems);$i++)\r\n\t {\r\n\t\t$current=\"\";\r\n\t\tif($currentItem===$i)\r\n\t\t{\r\n\t\t\t$current=\"current\";\r\n\t\t}\r\n\t\tif(count($arrImages)>0 and $arrImages[$i]!=\"\")\r\n\t\t{\r\n\t\t\t$tabImage=\"<img src=\\\"$arrImages[$i]\\\" alt=\\\"\\\" width=\\\"48\\\" height=\\\"48\\\" style=\\\"margin-top:10px; margin-bottom:0px; border:none\\\" /><br>\";\r\n\t\t}\r\n\t \techo \"<li class=\\\"$current\\\" style=\\\"line-height:5px\\\"><a href=\\\"$arrLinks[$i]\\\"><span><center>\".$tabImage.$arrItems[$i].\"<br />&nbsp;</center></span></a></li>\";\r\n\t }\r\n echo \"</ul></div>\";\r\n}", "public function setImageBackgroundColor($background) {\n\t}", "function hji_home_widget_bg_image( $variables ) {\n\tglobal $hji_theme_options;\n\n if ( isset( $hji_theme_options['home_widget_parallax']['url'] ) && $hji_theme_options['home_widget_parallax']['url'] != '' ) :\n\n\t $background1 = $hji_theme_options['home_widget_parallax']['url'];\n\n $url = hji_process_relative_url( $background1 );\n\n\t $variables .= '$home_widget_parallax: \"'. $url .'\";';\n \n endif;\n\n\treturn $variables;\n}", "function add_background_selection() {\n $my_page = $_GET['page'];\n\n\n if ( isset($_POST[ 'add' ] ) ) {\n $nonce = $_POST[ \"gj_nonce_field\" ];\n\n if( wp_verify_nonce( $nonce, 'create' ) ) {\n $images = $_POST[ 'file' ];\n\n $images = array_filter($images);\n\n update_option( \"_$my_page\" , $images );\n }\n }\n\n $images = get_option( \"_$my_page\", array() );\n\n?>\n\n<h2>Page backgrounds</h2>\n<div class=\"wrap\">\n <form method=\"post\">\n <?php wp_nonce_field( \"create\", \"gj_nonce_field\" ) ?>\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_GET[ 'page' ] ?>\" />\n <input type=\"hidden\" name=\"add\" value=\"1\" />\n <div class=\"theme-browser rendered\">\n <div class=\"themes\">\n\n <?php\n for( $i = 0; $i < 5; $i++ ) :\n\n $bg = @$images[$i];\n if( ! empty( $bg ) ) {\n $src = wp_get_attachment_image_src( $bg, 'medium' );\n $src = $src[0];\n $bg = \"background-image: url('$src');\";\n }\n ?>\n <div class=\"theme add-new-theme add-new-background\" style=\"<?php echo $bg ?>background-size: cover\">\n <input type=\"hidden\" name=\"file[<?php echo $i ?>]\" value=\"<?php echo @$images[$i] ?>\" />\n <a class=\"choose-from-library-link\" id=\"file-<?php echo $i ?>\" href=\"#\"\n data-update-link=\"<?php echo esc_attr( $modal_update_href ); ?>\"\n data-choose=\"<?php esc_attr_e( 'Choose a Default Image' ); ?>\"\n data-update=\"<?php esc_attr_e( 'Use as backgound image' ); ?>\"><?php _e( '' ); ?>\n <div class=\"theme-screenshot\"><span></span>\n </div>\n <h3 class=\"theme-name\"><?php echo ( ! empty( $bg ) ) ? \"\" : \"Set background\" ?></h3>\n </a>\n <a class=\"remove-bg\" style=\"position: absolute; display: block; width: 100%; text-align: center; background: #fff; padding:5px 0\">Remove</a>\n </div>\n\n <?php endfor; ?>\n </div>\n </div>\n\n <div style=\"clear:both\">\n <?php submit_button() ?>\n </div>\n\n </form>\n</div>\n<?php\n}", "function astra_bg_control_migration() {\r\n\r\n\t$db_options = array(\r\n\t\t'footer-adv-bg-obj',\r\n\t\t'footer-bg-obj',\r\n\t\t'sidebar-bg-obj',\r\n\t);\r\n\r\n\t$theme_options = get_option( 'astra-settings', array() );\r\n\r\n\tforeach ( $db_options as $option_name ) {\r\n\r\n\t\tif ( ! ( isset( $theme_options[ $option_name ]['background-type'] ) && isset( $theme_options[ $option_name ]['background-media'] ) ) && isset( $theme_options[ $option_name ] ) ) {\r\n\r\n\t\t\tif ( ! empty( $theme_options[ $option_name ]['background-image'] ) ) {\r\n\t\t\t\t$theme_options[ $option_name ]['background-type'] = 'image';\r\n\t\t\t\t$theme_options[ $option_name ]['background-media'] = attachment_url_to_postid( $theme_options[ $option_name ]['background-image'] );\r\n\t\t\t} else {\r\n\t\t\t\t$theme_options[ $option_name ]['background-type'] = '';\r\n\t\t\t\t$theme_options[ $option_name ]['background-media'] = '';\r\n\t\t\t}\r\n\r\n\t\t\tupdate_option( 'astra-settings', $theme_options );\r\n\t\t}\r\n\t}\r\n}", "function set_disp_background($background)\r\n {\r\n $this->disp_background = $background;\r\n }", "private function images() {\n preg_match_all('/background:(.*?) url\\(([\\w\\'\\\"\\/\\.\\-]*)\\)(.*?);/', $this->css, $match);\n if (!empty($match[2])) {\n foreach ($match[2] as $key => $image) {\n $file = str_replace(['\"', '\\'', '../'], '', $match[2][$key]);\n $filetype = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n $file = file_get_contents($file);\n $encoded = str_replace($image, 'data:image/'.$filetype.';base64,'.base64_encode($file), $match[2][$key]);\n $this->css = str_replace($image, $encoded, $this->css);\n }\n }\n }", "function yasr_settings_tabs( $active_tab )\n{\n ?>\n\n <h2 class=\"nav-tab-wrapper yasr-no-underline\">\n\n <a href=\"?page=yasr_settings_page&tab=general_settings\"\n class=\"nav-tab <?php \n if ( $active_tab === 'general_settings' ) {\n echo 'nav-tab-active' ;\n }\n ?>\">\n <?php \n _e( \"General Settings\", 'yet-another-stars-rating' );\n ?>\n </a>\n\n <a href=\"?page=yasr_settings_page&tab=manage_multi\" class=\"nav-tab <?php \n if ( $active_tab === 'manage_multi' ) {\n echo 'nav-tab-active' ;\n }\n ?>\">\n <?php \n _e( \"Multi Sets\", 'yet-another-stars-rating' );\n ?>\n </a>\n\n <a href=\"?page=yasr_settings_page&tab=style_options\"\n class=\"nav-tab <?php \n if ( $active_tab === 'style_options' ) {\n echo 'nav-tab-active' ;\n }\n ?>\">\n <?php \n _e( \"Aspect & Styles\", 'yet-another-stars-rating' );\n ?>\n </a>\n\n\n <?php \n do_action( 'yasr_add_settings_tab', $active_tab );\n ?>\n\n </h2>\n\n <?php \n}", "public function loadDataFileBackground()\n {\n $this->wide_dimensionsFileBackground = [20, 500, 800, 1200, 1900, 3600];\n\n $this->filenamesFileBackground = [];\n foreach ($this->wide_dimensionsFileBackground as $wide)\n array_push($this->filenamesFileBackground, $this->getFileBackgroundAbsolutePath().'-'.$wide.'.jpg');\n }", "public function setBackgroundColor ($background) {}", "function kapablo_group_image_banner_background() {\n return kapablo_group_image_banner(TRUE);\n}", "public function getImageBackgroundColor () {}", "function wpsolr_admin_sub_tabs( $subtabs, $before = null ) {\r\n\t$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'solr_presentation';\r\n\r\n\tif ( isset ( $_GET['subtab'] ) ) {\r\n\r\n\t\t$current_subtab = $_GET['subtab'];\r\n\r\n\t} else {\r\n\t\t// No user selection: use the first subtab in the list\r\n\t\t$current_subtab = key( $subtabs );\r\n\t}\r\n\r\n\techo '<div id=\"icon-themes\" class=\"icon32\"><br></div>';\r\n\techo '<h2 class=\"nav-tab-wrapper wdm-vertical-tabs\">';\r\n\r\n\tif ( isset( $before ) ) {\r\n\t\techo \"$before<div style='clear: both;margin-bottom: 10px;'></div>\";\r\n\t}\r\n\r\n\tforeach ( $subtabs as $subtab => $name ) {\r\n\t\t$class = ( $subtab == $current_subtab ) ? ' nav-tab-active' : '';\r\n\r\n\t\tif ( false === strpos( $name, 'wpsolr_premium_class' ) ) {\r\n\t\t\techo \"<a class='nav-tab$class' href='admin.php?page=solr_settings&tab=$tab&subtab=$subtab'>$name</a>\";\r\n\t\t} else {\r\n\t\t\techo $name;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\techo '</h2>';\r\n\r\n\treturn $current_subtab;\r\n}", "function wst_set_up_child_theme(){\n\twst_add_new_image_sizes();\n}", "function wise_back_inline_styles() {\n $wise_main_back = get_theme_mod('wise_mainback');\n $wise_def_back = get_template_directory_uri() . '/img/background.jpg';\n if(get_theme_mod('wise_disable_back') == true) {\n $wise_body_back = 'none';\n } else {\n $wise_body_back = !empty($wise_main_back) ? $wise_main_back : $wise_def_back;\n }\n \n if( !empty($wise_body_back) && (get_theme_mod('wise_disable_back') == false) ) :\n $wise_back_inline_css = \"body {\n background-image: url({$wise_body_back});\n}\";\t\t\n wp_add_inline_style( 'wise-style', $wise_back_inline_css );\n endif;\n}", "function file_background($name, $data)\n{\n\tif (!$name) $name = 'background';\n\tif (strpos($name, '/') === false)\n\t\t$name\t= \"background/$name\";\n\t\n\t$ini\t= getCache('background', 'ini');\n\tif (!is_array($ini)) $ini\t= array();\n\t$file\t= $ini[$name];\n\tif (is_null($file))\n\t{\n\t\t$folder\t= images.\"/$name/background\";\n\t\t$files\t= getFiles($folder);\n\t\tlist(, $file)\t= each($files);\n\t\t$ini[$name]\t\t= $file?$file:'';\n\t\tsetCache('background', $ini, 'ini');\n\t}\n\t$bk\t= config::get('background:');\n\t$bk[$name] \t= $file;\n\tconfig::set('background:', $bk);\n\tif (!$file) return;\n\t\n\t$file\t= imagePath2local($file);\n\techo \"style=\\\"background-image: url($file); background-position: center top; background-repeat: repeat-x\\\"\";\n}", "static function active() {\n\t\t\n\t\tglobal $lumise;\n\t\t\n\t\t$comps = explode(',', $lumise->cfg->settings['components']);\n\t\t\n\t\tif (!in_array('backgrounds', $comps))\n\t\t\tarray_push($comps, 'backgrounds');\n\t\t\n\t\t$lumise->set_option('components', implode(',', $comps));\n\t\t\n\t\t$lumise->db->rawQuery(\"CREATE TABLE IF NOT EXISTS `\".$lumise->db->prefix.\"backgrounds` (\n\t\t\t`id` int(11) NOT NULL,\n\t\t\t`name` varchar(255) CHARACTER SET utf8 NOT NULL,\n\t\t\t`upload` text CHARACTER SET utf8,\n\t\t\t`thumbnail_url` text CHARACTER SET utf8,\n\t\t\t`price` float DEFAULT '0',\n\t\t\t`featured` int(1) DEFAULT NULL,\n\t\t\t`active` int(1) DEFAULT NULL,\n\t\t\t`order` int(1) DEFAULT NULL,\n\t\t\t`tags` varchar(255) CHARACTER SET utf8 NOT NULL,\n\t\t\t`use_count` int(11) DEFAULT NULL,\n\t\t\t`created` datetime DEFAULT NULL,\n\t\t\t`updated` datetime DEFAULT NULL\n\t\t\t) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;\");\n\t\t\n\t\t$lumise->db->rawQuery(\"ALTER TABLE `\".$lumise->db->prefix.\"backgrounds` ADD PRIMARY KEY (`id`);\");\n\t\t$lumise->db->rawQuery(\"ALTER TABLE `\".$lumise->db->prefix.\"backgrounds` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT;\");\n\t\t\n\t}", "function my_photos_tab () {\n\tadd_action( 'bp_template_title', 'my_photos_tab_title' );\n\tadd_action( 'bp_template_content', 'my_photos_tab_content' );\n\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n}", "public function getBackgroundImage () {\n\t$preValue = $this->preGetValue(\"backgroundImage\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->backgroundImage;\n\treturn $data;\n}", "private function pages_tab() {\n\t\t$this->pages_settings_appearance();\n\t}", "public function adminTabs($tabs, $default, $page){\n \n if ( isset ( $_GET['tab'] ) ) $current = $_GET['tab']; else $current = $default;\n \n echo '<div id=\"icon-themes\" class=\"icon32\"><br></div>';\n echo '<h2 class=\"nav-tab-wrapper\">';\n \n foreach( $tabs as $tab => $name ){\n $class = ( $tab == $current ) ? ' nav-tab-active' : '';\n echo \"<a class='nav-tab$class' href='?page=$page&tab=$tab'>$name</a>\";\n \n }\n \n echo '</h2>';\n }" ]
[ "0.6236163", "0.6070699", "0.6012831", "0.60111827", "0.5938029", "0.59234136", "0.57686543", "0.5699392", "0.56215143", "0.5611467", "0.5608057", "0.5598528", "0.559105", "0.55801445", "0.55148923", "0.5514664", "0.54779017", "0.5460229", "0.5427227", "0.54264975", "0.54004765", "0.5388448", "0.5377745", "0.5374467", "0.5364323", "0.53472286", "0.5307116", "0.52924913", "0.52536225", "0.5245433" ]
0.6409921
0
.ThirdV3.LocationType loc_type = 5;
public function getLocType() { return $this->loc_type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getXsiTypeName() {\n return \"Location\";\n }", "public function getLocationType()\n\t\t{\n\t\t return $this->locationType;\n\t\t}", "private function getLocation($type)\n {\n\t\t$base = 'https://devwebservices.purolator.com/EWS/V1/';\n return $base . $this->_locations[$type];\n }", "public function getLocation()\n {\n return $this->readOneof(3);\n }", "public function getLocation()\n {\n return $this->readOneof(3);\n }", "public function getLocationTypeEnum() {\n\t\t\treturn $this->locationTypeEnum;\n\t\t}", "public function getXsiTypeName() {\n return \"LocationTargetingStatus\";\n }", "function getLocationType($company_id){ \r\r\r\r\t App::import(\"Model\", \"Company\");\r\r\r\r\t $this->Company = & new Company();\r\r\r\r\t $conditions = \"Company.id = '\".$company_id.\"' \";\r\r\r\r\t $companydata = $this->Company->find(\"first\",array('conditions'=>$conditions));\r\r\r\r\t $locationtype = $companydata['Company']['location_type_id'];\r\r\r\r\t return ($locationtype=='0') ?'HQ':'Branch';\r\r\r\r }", "function my_types( $fields ) {\n $fields['google_map'] = __FILE__;\n return $fields;\n}", "function getLocation()\n {\n\n }", "public function setLocType($var)\n {\n GPBUtil::checkEnum($var, \\ThirdV3\\LocationType::class);\n $this->loc_type = $var;\n }", "function loc(){\n return $this->loc;\n }", "public function setLocation($location) {\r\n\t$this->location = $location;\r\n }", "function setLocation($name,array $point = array(),$url = ''){\r\n \r\n $location_map = array('name' => $name, 'point' => $point, 'url' => $url);\r\n return $this->setField('location',$location_map);\r\n \r\n }", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocationType($locationType)\n\t\t{\n\t\t\tif(array_search($locationType, $this->locationTypeEnum, $strict = TRUE)) {\n\t\t\t\t$this->locationType = $locationType;\n\t\t\t} else {\n\t\t\t\t$this->locationType = $this->locationTypeEnum[0];\n\t\t\t}\n\n\t\t return $this;\n\t\t}", "public function set_location($location)\n {\n $this->location = $location;\n }", "public function addLocation($location);", "public function addLocation($location);", "function tsml_get_location($location_id=false) {\n\tif (!$location = get_post($location_id)) return;\n\tif ($custom = get_post_meta($location->ID)) {\n\t\tforeach ($custom as $key=>$value) {\n\t\t\t$location->{$key} = htmlentities($value[0], ENT_QUOTES);\n\t\t}\n\t}\n\t$location->post_title\t= htmlentities($location->post_title, ENT_QUOTES);\n\t$location->notes \t\t= esc_html($location->post_content);\n\tif ($region = get_the_terms($location, 'tsml_region')) {\n\t\t$location->region_id = $region[0]->term_id;\n\t\t$location->region = $region[0]->name;\n\t}\n\n\t//directions link (obsolete 4/15/2018, keeping for compatibility)\n\t$location->directions = 'https://maps.google.com/?' . http_build_query(array(\n\t\t'daddr' => $location->latitude . ',' . $location->longitude,\n\t\t'saddr' => 'Current Location',\n\t\t'q' => $location->post_title,\n\t));\n\n\treturn $location;\n}", "public function testCreateInventoryLocation()\n {\n }", "function em_get_event_location_fields() {\n\treturn Events_Maker()->location_fields;\n}", "public function __construct($location)\n {\n $this->locations = $location;\n }", "public function getLocationObject($locationType, $location) {\n switch($locationType) {\n case 'city':\n $locationObj = $this->em->getRepository('AppBundle:City')->getByEn($location);\n break;\n case 'subregion':\n $locationObj = $this->em->getRepository('AppBundle:Subregion')->getByEn($location);\n break;\n case 'region':\n $locationObj = $this->em->getRepository('AppBundle:Region')->getByEn($location);\n break;\n case 'country':\n $locationObj = $this->em->getRepository('AppBundle:Country')->getByEn($location);\n break;\n default:\n $locationObj = NULL;\n break;\n }\n\n return $locationObj;\n }", "public function setLocation($location=null) {\n\t\tif($location == null) return;\n\t\tif(!($location instanceOf Intra_Object_Gis_Point)) {\n\t\t\t$location = Intra_Object_Gis::fromWKB($location);\n\t\t}\n\t\t$this->_set('c_location', $location);\n\t}", "public static function locationType()\n {\n try {\n return $queries = DB::table('lkp_location_types')->select('id', 'location_type_name')\n ->where('is_active', 1)\n ->get();\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n }", "function _publication_xml_process_map($value, $type = 'latitude'){\n if(isset($value[LANGUAGE_NONE][0])){\n $map = (array)($value[LANGUAGE_NONE][0]);\n }else{\n $map = (array)$value;\n }\n return $map[$type];\n}", "public static function getLocationType($fields = [], $get = 'getsingle'){\n try {\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n );\n foreach($fields as $field => $value){\n $params[$field] = $value;\n }\n\n $result = civicrm_api('LocationType', $get, $params);\n if(isset($result['is_error']) and 1 == $result['is_error']){\n die('Error, CRM_Utils_DgwUtils::getLocationType, API LocationType ' . $get . ' is_error, ' . $result['error_message']);\n return false;\n }\n return $result;\n\n } catch (CiviCRM_API3_Exception $ex) {\n throw new Exception('Error, CRM_Utils_DgwUtils::getLocationType, API LocationType ' . $get . ' catch, '.$ex->getMessage());\n return false;\n }\n\n return false;\n }", "public function getLocation();" ]
[ "0.62340623", "0.5933727", "0.59045243", "0.5740926", "0.5740926", "0.55894274", "0.5582287", "0.55219835", "0.54832244", "0.53960705", "0.53683406", "0.5318271", "0.5302344", "0.5273733", "0.51959556", "0.51959556", "0.5168943", "0.51420265", "0.51316637", "0.51316637", "0.5115012", "0.5098136", "0.5090799", "0.5078895", "0.5075271", "0.5043663", "0.50409573", "0.50336903", "0.5020753", "0.5017059" ]
0.6501819
0
destroy all machines on the remote, in case of emergency stop
public static function destroyAllHard() { $vms = DigitalOcean::droplet()->getAll(); foreach($vms as $vm) DigitalOcean::droplet()->delete($vm->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Machine $machine)\n {\n //\n }", "public function destroy_all();", "function stop()\n {\n $this->log(\"Cleaning up obsolete connections\");\n // Safer than processing in PHP:\n exec('/usr/bin/nmcli --pretty --fields UUID,TYPE con show | grep wifi | cut -c 1-36 | while read line; do nmcli con delete uuid $line; done');\n \n // Typically triggered by sigs\n $this->log(\"Closing down safely\");\n\n exit();\n }", "public function shutdown() {\n Log::debug(self::$TAG, \"shutting down the teamspeak connection manager\");\n try {\n // close all server connections\n foreach($this->ts3servers as $srv) {\n $srv[\"server\"]->request(\"quit\");\n }\n $this->ts3servers = [];\n }\n catch(\\Exception $e) {\n Log::error(self::$TAG, \"an exception occured while quitting the connection to server, reason: \" . $e->getMessage());\n }\n }", "public function emergencyShutdown(){\n }", "function shutdownAll(){\n \n foreach ($this->tasks as $task){\n\t$this->log( \"initiating shutdown of \".$task->name );\n\t$task->shutdown();\n }\n \n $this->shutdown();\n \n }", "public function shutdown();", "public function shutdown();", "public function shutdown();", "public function actionKillall()\n {\n\n foreach(Player::find()->where(['status'=>10])->all() as $pM)\n {\n printf(\"Logging out %d\\n\",$pM->id);\n OpenVPN::logout($pM->id);\n }\n }", "public function destroy() {\n try {\n $vm_client = $this->softlayer_client('SoftLayer_Virtual_Guest', $this->provider_server_identifier);\n $result = $vm_client->getBillingItem();\n\n $bill_client = $this->softlayer_client('SoftLayer_Billing_Item', $result->id);\n $bill_client->cancelService();\n\n drupal_set_message(t('SoftLayer server was destroyed.'));\n\n } catch(Exception $e) {\n form_set_error('provider', $e->getMessage());\n watchdog('aegir_cloud', 'CODE: ' . $e->getCode() . '|' . $e->getMessage());\n }\n }", "function destroy() {\r\n\r\n\t\t$actions = array_keys($this->actions);\r\n\t\tforeach($actions as $action) {\r\n\t\t\t$action->setActionServer(NULL);\r\n\t\t}\r\n\t\t$this->actions = array();\r\n\t\t$this->actionServer = NULL;\r\n\r\n\t}", "public function TearDown() {\n $forks = explode(PHP_EOL, exec('ps -C \\''.$this->command.'\\' -o pid='.$this->pid));\n foreach($forks as $fork) {\n if($fork != $this->pid) {\n //posix_kill($fork, SIGTERM);\n exec('kill '.$fork.' 2>&1 > /dev/null');\n }\n }\n }", "protected function stopStandalone() {\n\t\t\t\t$cmd = \"ps ax | grep \".escapeshellarg('SERVLET_LOCAL:'.$this->getConfig('servlet_port')).\" | grep -v grep\";\n $line = shell_exec($cmd);\n $pid = (int)$line;\n shell_exec('kill '.escapeshellarg($pid));\n\n // Wait till it's actually died\n sleep(5);\n }", "public function tearDown()\n {\n VCRCleaner::enable(array());\n\n $this->server->stop();\n }", "public function destroy($key = 'id')\n {\n $find = array('hostID' => $this->get('id'));\n self::getClass('NodeFailureManager')\n ->destroy($find);\n self::getClass('ImagingLogManager')\n ->destroy($find);\n self::getClass('SnapinTaskManager')\n ->destroy(\n array(\n 'jobID' => self::getSubObjectIDs(\n 'SnapinJob',\n $find,\n 'id'\n )\n )\n );\n self::getClass('SnapinJobManager')\n ->destroy($find);\n self::getClass('TaskManager')\n ->destroy($find);\n self::getClass('ScheduledTaskManager')\n ->destroy($find);\n self::getClass('HostAutoLogoutManager')\n ->destroy($find);\n self::getClass('HostScreenSettingManager')\n ->destroy($find);\n self::getClass('GroupAssociationManager')\n ->destroy($find);\n self::getClass('SnapinAssociationManager')\n ->destroy($find);\n self::getClass('PrinterAssociationManager')\n ->destroy($find);\n self::getClass('ModuleAssociationManager')\n ->destroy($find);\n self::getClass('GreenFogManager')\n ->destroy($find);\n self::getClass('InventoryManager')\n ->destroy($find);\n self::getClass('UserTrackingManager')\n ->destroy($find);\n self::getClass('MACAddressAssociationManager')\n ->destroy($find);\n self::getClass('PowerManagementManager')\n ->destroy($find);\n self::$HookManager\n ->processEvent(\n 'DESTROY_HOST',\n array(\n 'Host' => &$this\n )\n );\n return parent::destroy($key);\n }", "public function stopAllTestContainers()\n {\n $containerInfos = $this->docker->getContainerManager()->findAll([\n 'filters' => json_encode([\n 'label' => ['lfs-server', 'is-testing'],\n 'status' => ['created', 'restarting', 'running', 'paused', 'exited', 'dead'],\n ])\n ]);\n\n foreach ($containerInfos as $containerInfo) {\n if (in_array($containerInfo->getState(), ['running', 'restarting'])) {\n $this->stop($containerInfo->getId());\n }\n }\n }", "public function stop() \n {\n foreach ($this->clients as $client) \n {\n fclose($client);\n }\n\n $this->clients = array();\n\n fclose($this->master);\n }", "public function shutdown ()\n {\n\n $this->shutdownDesktop();\n\n }", "public static function terminateAll() {\n\t\tsession_destroy();\n\t}", "function shutdown() {\n\tglobal $sockets, $config, $logfile, $stack, $uptime;\n\t\n\tlogdata('Kill command received. Waiting 3 seconds to allow stack to clear gracefully...');\n\t\n\tif (is_object($stack))\n\t\t$stack->clear();\n\t\n\tsleep(3);\n\t\n\tif (is_array($sockets)) {\n\t\tforeach ($sockets as $id => $socket) {\n\t\t\tsenddata(\"QUIT :{$config['quitmsg']}\", $id);\n\t\t\t@fclose($socket);\n\t\t}\n\t}\n\t\n\t@fclose($logfile);\n\t\n\tlogdata(\"Uptime: \" . duration(time() - $uptime, 3) . \". Way to break that, loser.\");\n\tlogdata(\"Alas! Alack!\");\n\t\n//\tvar_dump($GLOBALS);\n}", "public function cleanupRemote()\n {\n if (isset($this->config->keepfor)) {\n $remotePath = './'.$this->dump_folder;\n\n $directories = $this->remoteAdapter->listContents($remotePath);\n\n $timestamp = date('YmdHi', (time() - (time() - strtotime($this->config->keepfor.' ago'))));\n\n foreach ($directories as $dir) {\n if ($dir['filename'] < $timestamp) {\n $this->remoteAdapter->deleteDir($dir['path']);\n }\n }\n }\n }", "public static function stop(){\n Worker::stopAll();\n }", "abstract function shutdown();", "public function shutdown()\n {\n //foreach close and free all connection\n foreach ($this->conn as $connection){\n //grpc to logic clear the cache\n $this->disconnect($connection->getFd());\n //close the connection\n $this->pop($connection->getKey(),$connection->getFd());\n $this->delConn($connection);\n $connection->close();\n }\n }", "public function killInstances(array $instances);", "public function shutdown_refresh() {\r\n\t\tif ( self::$_refresh_shutdown_flag && ! defined( 'WPMUDEV_REMOTE_SKIP_SYNC' ) ) {\r\n\t\t\tWPMUDEV_Dashboard::$site->refresh_local_projects( 'remote' );\r\n\t\t}\r\n\t}", "public function kill()\n {\n // Unset session vars\n foreach($_SESSION as $key => $var)\n { \n if(!in_array($key, self::$reserved))\n unset($_SESSION[$key]);\n }\n\n // Unset picara session vars\n unset($_SESSION['picara']['session_name']);\n unset($_SESSION['picara']['REMOTE_ADDR']);\n //session_unset(); // No need! Session is controlled using session variables!\n }", "protected function shutdown() {}", "public function shutdown ()\r\n\t{\r\n\t\t$this->send('shutdown', true);\r\n\t}" ]
[ "0.63639706", "0.63399845", "0.61815494", "0.60360765", "0.6035902", "0.59532326", "0.5931188", "0.5931188", "0.5931188", "0.592343", "0.59061205", "0.5899055", "0.58579355", "0.5850759", "0.58370316", "0.58132815", "0.58084923", "0.5803204", "0.5762402", "0.575319", "0.5718289", "0.56814086", "0.5659483", "0.56439114", "0.5628639", "0.5628156", "0.56224716", "0.5611998", "0.5600063", "0.55951864" ]
0.71301544
0
Saves the ApplicationSetting to the Database with the inputs from the Request
public function save() { return ApplicationSetting::put($this->key, $this->value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(Request $request)\n {\n $settingData = $request->except('_token');\n\n foreach ($settingData as $key => $value) {\n $settting = $this->setting->findByKey($key);\n $settting->value = $value;\n $settting->save();\n }\n\n return redirect()->back()\n ->with('success','Settings saved successfully!');\n }", "public function saveSettings(SettingRequest $request)\n {\n try {\n if (isset($request->company_name)) {\n AdminSetting::where(['slug' => 'company_name'])->update(['value' => $request->company_name]);\n }\n if (isset($request->lang)) {\n AdminSetting::where(['slug' => 'lang'])->update(['value' => $request->lang]);\n }\n if (isset($request->user_registration)) {\n AdminSetting::where(['slug' => 'user_registration'])->update(['value' => $request->user_registration]);\n }\n if (isset($request->app_title)) {\n AdminSetting::where(['slug' => 'app_title'])->update(['value' => $request->app_title]);\n }\n if (isset($request->primary_email)) {\n AdminSetting::where(['slug' => 'primary_email'])->update(['value' => $request->primary_email]);\n }\n if (isset($request->copyright_text)) {\n AdminSetting::where(['slug' => 'copyright_text'])->update(['value' => $request->copyright_text]);\n }\n if (isset($request->hints_coin)) {\n AdminSetting::updateOrCreate(['slug' => 'hints_coin'],['value' => $request->hints_coin]);\n }\n if (isset($request->admob_coin)) {\n AdminSetting::updateOrCreate(['slug' => 'admob_coin'],['value' => $request->admob_coin]);\n }\n if (isset($request->signup_coin)) {\n AdminSetting::updateOrCreate(['slug' => 'signup_coin'],['value' => $request->signup_coin]);\n }\n if (isset($request->privacy_policy)) {\n AdminSetting::updateOrCreate(['slug' => 'privacy_policy'],['value' => $request->privacy_policy]);\n }\n if (isset($request->login_text)) {\n AdminSetting::updateOrCreate(['slug' => 'login_text'],['value' => $request->login_text]);\n }\n if (isset($request->signup_text)) {\n AdminSetting::updateOrCreate(['slug' => 'signup_text'],['value' => $request->signup_text]);\n }\n if (isset($request->terms_conditions)) {\n AdminSetting::updateOrCreate(['slug' => 'terms_conditions'],['value' => $request->terms_conditions]);\n }\n if (isset($request->logo)) {\n// AdminSetting::updateOrCreate(['slug' => 'logo'], ['value' => uploadthumb($request->logo, path_image(), 'logo_', '', '', allsetting()['logo'])]);\n AdminSetting::updateOrCreate(['slug' => 'logo'], ['value' => fileUpload($request['logo'], path_image(), allsetting()['logo'])]);\n }\n if (isset($request->favicon)) {\n AdminSetting::updateOrCreate(['slug' => 'favicon'], ['value' => fileUpload($request['favicon'], path_image(), allsetting()['favicon'])]);\n }\n if (isset($request->login_logo)) {\n AdminSetting::updateOrCreate(['slug' => 'login_logo'], ['value' => fileUpload($request['login_logo'], path_image(), allsetting()['login_logo'])]);\n }\n\n return redirect()->back()->with(['success' => __('Updated Successfully')]);\n } catch (\\Exception $e) {\n// dd($e->getMessage());\n return redirect()->back()->with(['dismiss' => __('Something went wrong')]);\n }\n }", "public function store(Request $request)\n {\n if($request->has('settings') && is_array($request->settings)){\n $settings = $request->settings;\n $insert = [];\n foreach($settings as $key=>$value){\n if($value){\n array_push($insert,[\n 'key'=>$key,\n 'value'=>$value,\n ]);\n }\n }\n\n Settings::query()->delete();\n\n Settings::insert($insert);\n }\n session()->flash('saved',true);\n\n return redirect()->route('settings.index');\n }", "public function store(Request $request) {\n\t\t$this->validate($request, Setting::$rules);\n\n\t\t$inputs = $request->all();\n\t\tSetting::create($inputs);\n\t\treturn redirect()->route('admin.settings.index')->withFlashSuccess('Saved successfully');\n\t}", "public function store(Request $request)\n {\n\n $setting = new Setting;\n \n $path = \"pages/settings/\";\n\n $setting ->name = $request->input('name');\n $setting ->domain_url = $request->input('domain_url');\n $setting ->tag_url = $request->input('tag_url');\n $setting ->ad_type = $request->input('ad_type');\n $setting ->video_format = $request->input('video_format');\n $setting ->user_id = Auth()->user()->id;\n $setting ->code_id = Str::random(9);\n $setting ->code_url =$path.$setting->code_id.\".js\";\n\n $setting->save();\n \n return redirect(\"/settings/{$setting->id}\")->with(\"sucess\", \"data saved\");\n\n }", "public function store(Request $request)\n\t{\n\t\t$request->request->add(['uuid'=>Uuid::uuid()]);\n\t\t$systemSettings = SystemSettings::create($request->all());\n\t\t$systemSettings->update();\n\t\treturn redirect(\"/admin/systemsettings\");\n\t}", "public function save()\n\t{\n\t $this->saveSettings( $this->settings );\n\t}", "public function store(Request $request)\n {\n $record = Setting::create($request->all());\n return response(['data' => new SettingResource($record)], Response::HTTP_CREATED);\n }", "public function saveSetting()\n {\n $setting = new stdclass();\n $setting->submittion = $this->post->submittion; \n $this->loadModel('setting')->setItems('system.common.article', $setting);\n return !dao::isError();\n }", "public function store(Request $request) {\n\t\t$data = $request->all();\n\t\t\n\t\tforeach ($data as $key => $value) {\n\t\t\t\n\t\t\tSettings::where('setting_key', '=', $key)->update([ 'setting_value' => $value, 'updated_at' => date('Y-m-d H:i:s') ]);\n\t\t}\n\t\t\n\t\treturn redirect()->route('admin.setting.index')->withFlashSuccess(__('alerts.backend.settings.updated'));\n\t}", "public function store(Request $request)\n {\n $setting = Setting::where('key', $request->key)->first();\n $setting->value = $request->value;\n $setting->save();\n\n return redirect()->back();\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, Setting::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->setting->create($input);\n\n\t\t\treturn Redirect::route('settings.index');\n\t\t}\n\n\t\treturn Redirect::route('settings.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "private function save()\n\t{\n\t\tif ( isset( $_POST['submit'] ) )\n\t\t{\n\t\t\tif ( isset( $_POST['Config'] ) && is_array( $_POST['Config'] ) )\n\t\t\t{\n\t\t\t\tforeach ( $_POST['Config'] as $key => $value )\n\t\t\t\t{\n\t\t\t\t\tConfiguration::setValue( $key, $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->halt();\n\t\t}\n\t}", "public function store(Request $request)\n {\n // return $request->all();\n \t$setting = Setting::updateOrCreate(['id' => 1], $request->all());\n return redirect()->route('admin.setting.index');\n }", "public function store(Request $request)\n {\n \n $input = $request->input();\n $setting = Setting::all();\n if($setting){\n Setting::truncate();\n }\n \n foreach($input as $key => $value){\n if($key != '_token'){\n $setting = new Setting();\n $setting->name = $key;\n $setting->start_date = $value['start_date'];\n $setting->end_date = $value['end_date'];\n $setting->save();\n }\n }\n return redirect( route('settings.index'))->withSuccess('Setting added successfully!'); \n \n }", "public function store(Request $request)\n {\n $request = $request->merge(['user_id' => auth()->user()->id]);\n Setting::create($request->all());\n \n return redirect()->route('dashboard.settings.index')\n ->with('status','created successfully');\n }", "public function store(Request $request)\n {\n $shop = Auth::user();\n $setting = Setting::firstOrCreate(['shop_id' => $shop->id]);\n $input = $request->all();\n /* if ($request->has('rating')) {\n if ($request->rating === 'true') {\n $input['rating'] = 1;\n } else {\n $input['rating'] = 0;\n }\n } */\n $saved = $setting->update($input);\n return ['success' => $saved];\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n\t\t\t'key' => 'min:3|required',\n\t\t\t'secret' => 'min:3|required'\n\t\t]);\n $requestData = $request->all();\n $brand = Brand::where('user_id', Auth::user()->id)->first();\n $requestData['brand_id'] = $brand->id;\n\n ApiSetting::create($requestData);\n\n Session::flash('flash_message', 'api setting added!');\n\n return redirect('api_settings');\n }", "public function save(Request $request)\n {\n $settings = $request->except('_token');\n\n // Update All Settings\n foreach ($settings as $key => $value) {\n if ($key == 'gym_logo') {\n \\Utilities::uploadFile($request, '', $key, 'gym_logo', \\constPaths::GymLogo); // Upload File\n $value = $key.'.jpg'; // Image Name For DB\n }\n\n Setting::where('key', '=', $key)->update(['value' => $value]);\n }\n\n flash()->success('Setting was successfully updated');\n\n return redirect('settings/edit');\n }", "private function databaseSave()\n {\n if (! $this->post->validate(array(\n 'type' => 'required',\n 'username' => 'required',\n 'password' => 'required',\n 'database' => 'required',\n 'host' => 'required',\n 'port' => 'required|type:port'\n ))) {\n return;\n }\n \n $s_type = $this->post['type'];\n $this->setValue('SQL/prefix', $this->post['prefix']);\n $this->setValue('SQL/type', $s_type);\n $this->setValue('SQL/' . $s_type . '/username', $this->post['username']);\n $this->setValue('SQL/' . $s_type . '/password', $this->post['password']);\n $this->setValue('SQL/' . $s_type . '/database', $this->post['database']);\n $this->setValue('SQL/' . $s_type . '/host', $this->post['host']);\n $this->setValue('SQL/' . $s_type . '/port', $this->post['port']);\n \n $this->settings->save();\n }", "public function store(Request $request)\n {\n //\n $setting = $request->isMethod('put') ? Setting::findOrFail($request->id) : new Setting;\n\n $setting->uid = strtolower(str_random(11));\n $setting->id = $request->input('id');\n $setting->page_name = $request->input('page_name');\n $setting->meta_desc = $request->input('meta_desc');\n $setting->meta_key = $request->input('meta_key');\n $setting->main_image = $request->input('main_image');\n $setting->created_by = $request->isMethod('put') ? $setting->created_by : $request->input('user_id');\n $setting->updated_by = $request->isMethod('put') ? $request->input('user_id') : NULL;\n\n if($setting->save()) {\n return new SettingResource($setting);\n }\n }", "public function saveSettings()\n {\n $this->getStore()->save($this->data);\n }", "public function store(settingStoreRequest $request)\n {\n $data = $request->except('_token');\n\n\n $data['is_active'] =(isset($request['is_active'])) ? 1 : 0;\n $data['created_by'] = Auth::user()->id;\n\n if($this->setting->create($data)){\n\n\n return redirect()->to('/settings')->with('success','setting added successfully');\n }\n return redirect()->back()->with('errors','setting cannot added Successfully');\n }", "public function store(SettingRequest $request)\n {\n $data = $request->all();\n $setting = $this->setting->store($data, 'setting');\n if ($setting->id) {\n return redirect()->route('admin.setting_type.show', $setting->type_id)->with('message', '成功新增动态设置!');\n } else {\n return redirect()->back()->withInput($request->input())->with('fail', '数据库操作返回异常!');\n }\n }", "public function store(SettingsRequest $request)\n {\n if (isset($request->action)) {\n $action = $request->action;\n $this->$action($request);\n } else {\n Setting::create($request->all());\n Flash::success('Вы успешно создали параметры настройки.');\n }\n\n return redirect()->back();\n }", "public function save()\n {\n $game = game::find($this->game_id);\n $game->setting = serialize($this->settings());\n return $game->save();\n }", "public function settings_save() {\n\t\tcheck_admin_referer( 'fusion_builder_save_fb_settings', 'fusion_builder_save_fb_settings' );\n\n\t\tupdate_option( 'fusion_builder_settings', $_POST );\n\t\twp_safe_redirect( admin_url( 'admin.php?page=fusion-builder-settings' ) );\n\t\texit;\n\t}", "public function settings_save() {\n\t\tcheck_admin_referer( 'fusion_builder_save_fb_settings', 'fusion_builder_save_fb_settings' );\n\n\t\tupdate_option( 'fusion_builder_settings', $_POST );\n\t\twp_safe_redirect( admin_url( 'admin.php?page=fusion-builder-settings' ) );\n\t\texit;\n\t}", "public function set(Request $request)\n {\n\n $iBase_setting_id = $request->json('base_setting_id');\n $iParent_id = $request->json('parent_id');\n $sTitle = $request->json('title');\n $sDescription = $request->json('description');\n $bIs_active = $request->json('is_active') != null ? $request->json('is_active') : true;\n $bIs_trash = $request->json('is_trash') != null ? $request->json('is_trash') : false;\n\n\n $oBaseSetting = new BaseSetting();\n\n $oBaseSetting->base_setting_id = $iBase_setting_id;\n $oBaseSetting->parent_id = $iParent_id;\n $oBaseSetting->title = $sTitle;\n $oBaseSetting->description = $sDescription;\n $oBaseSetting->is_active = $bIs_active;\n $oBaseSetting->is_trash = $bIs_trash;\n\n\n $oBaseSetting->save();\n return response()->json($oBaseSetting, 200);\n\n }", "public function saveSettings() {\n //Get database handle\n $db = $this->getDbo();\n\n //Read Settings\n $settings = JRequest::getVar('settings');\n $settings['horizontalArticles'] = (sizeof(JRequest::getVar('horizontalArticles')) > 0 ? serialize(JRequest::getVar('horizontalArticles')) : \"\");\n $settings['verticalArticles'] = (sizeof(JRequest::getVar('verticalArticles')) > 0 ? serialize(JRequest::getVar('verticalArticles')) : \"\");\n \n $sql = \"DELETE FROM #__oss_share_settings\";\n $db->setQuery($sql);\n $db->query();\n\n //Insert new settings\n foreach ($settings as $k => $v) {\n $sql = \"INSERT INTO #__oss_share_settings ( setting, value )\" . \" VALUES ( \" . $db->Quote($k) . \", \" . $db->Quote($v) . \" );\";\n $db->setQuery($sql);\n $db->query();\n }\n $result['status'] = \"message\";\n $result['message'] = JText::_('COM_SOCIAL_SHARE_SETTING_SAVED');\n return $result;\n }" ]
[ "0.683817", "0.66653293", "0.6662955", "0.66597795", "0.6624709", "0.65927845", "0.65906584", "0.65632546", "0.65472776", "0.65413755", "0.65276784", "0.6513967", "0.65050155", "0.6486568", "0.64852756", "0.6453637", "0.6432428", "0.6420877", "0.64207095", "0.6408856", "0.638055", "0.6363888", "0.63563865", "0.6342259", "0.6341282", "0.6318837", "0.63160557", "0.63160557", "0.6302838", "0.62946534" ]
0.6937612
0
Gets the value of operatorType.
public function getOperatorType() { return $this->operatorType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOperatorType()\n {\n return $this->get(self::OPERATOR_TYPE);\n }", "public function getTypeOperation() {\n return $this->typeOperation;\n }", "public function getType()\n {\n $value = $this->get(self::TYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function getType()\n {\n return $this->getValueObject('type');\n }", "public function getType()\n\t{\n\t\treturn ($this->type);\n\t}", "public function getType_value()\n {\n return $this->type_value;\n }", "public function getTypeOperation()\n {\n return $this->typeOperation;\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getType()\n {\n return $this->get(self::TYPE);\n }", "public function getOperator() {\r\n\t\treturn $this->operator;\r\n\t}", "public function getOperator() {\n return $this->operator;\n }", "public function getOperator()\n\t{\n\t\treturn $this->operator;\n\t}", "public function getType()\n\t{\n\t\treturn $this->iType;\n\t}", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\n {\n return $this->operator;\n }", "public function getOperator()\r\n {\r\n return $this->operator;\r\n }", "public function getOperationType() \n {\n return $this->_fields['OperationType']['FieldValue'];\n }", "public function getType() {\r\n\r\n\t\treturn $this->type;\r\n\t}", "public function getType() {\n\n\t\treturn $this->type;\n\n\t}", "public function getType () {\r\n\t\treturn $this->type;\r\n\t}", "public function getType() {\n\t\t\n\t\treturn $this->_type;\n\t}", "public function getType() {\n\t\t\treturn $this->type;\n\t\t}", "public function getType() {\n\t\t\treturn $this->type;\n\t\t}", "public function getOperator(): string\n {\n return $this->operator;\n }", "public function getType() \n\t{\n\t\treturn self::TYPE;\n\t}", "public function getTypeOperation(): ?string {\n return $this->typeOperation;\n }", "protected function getType()\n\t{\n\t\treturn $this->type;\n\t}" ]
[ "0.8605048", "0.68800664", "0.68494993", "0.679559", "0.672467", "0.6697459", "0.6665975", "0.6658695", "0.6658695", "0.6658695", "0.6658695", "0.6658695", "0.6649055", "0.662099", "0.659673", "0.65941715", "0.6581764", "0.6581764", "0.6572011", "0.6518873", "0.65147036", "0.64952135", "0.64927", "0.6491854", "0.64825994", "0.64825994", "0.64819413", "0.6469704", "0.64663553", "0.6465742" ]
0.8266863
1
Gets the value of trafficArea.
public function getTrafficArea() { return $this->trafficArea; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n\t{\n\t\treturn $this->_area;\n\t}", "public function getAreaAttribute()\n {\n return data_get($this->manager, 'territory.account_territory_id');\n }", "public function getAreaNumber()\n {\n return $this->area_number;\n }", "public function getArea()\n {\n echo 111;\n return $this->width * $this->height;\n }", "public function getAreaNum()\n {\n return $this->area_num;\n }", "public function getArea():float ;", "public function getIntbwhsepharea()\n {\n return $this->intbwhsepharea;\n }", "public function getCodigoArea( ){\n\t\treturn $this->codigoArea;\n\t}", "public function area()\n {\n return $this->width * $this->height;\n }", "public function getAreaTotal() {\n return $this->nAreaTotal;\n }", "public function getArea(){\r\n\t\t\r\n\t}", "public function getArea()\n {\n return($this->width * $this->height);\n }", "public function getAreaOfInterest()\n {\n return $this->areaOfInterest;\n }", "public function area($value) {\n return $this->setProperty('area', $value);\n }", "public function getArea()\n {\n return pow($this->radius, 2) * pi();\n }", "public function getFreeArea()\n {\n return $this->free_area;\n }", "public function getIntbwhsefaxarea()\n {\n return $this->intbwhsefaxarea;\n }", "public function getArea(): int\n {\n return $this->model->height * $this->model->weight; // width\n }", "public function getAreaId()\n {\n return $this->area_id;\n }", "public function getArea(){\n $allAreas = $this->DaftAPI->areas(array(\n 'api_key' => $this->key,\n 'area_type' => \"area\"\n ));\n\n $areasArr = array();\n foreach($allAreas->areas as $area){\n if(in_array($area->name, $this->searchArr)){\n return intval($area->id);\n }\n }\n }", "public function getAreaType(): AreaType\n {\n return $this->areaType;\n }", "public function getAdministrativeArea()\n {\n return $this->administrativeArea;\n }", "final public function area(): float\n {\n return (float)pow($this->length, 2);\n }", "public function calcArea()\n {\n return $this -> width * $this -> height;\n }", "public function calculateArea();", "public function organicTraffic() {\n\t\treturn $this->get(Constants::OT);\n\t}", "public function getAdministrativeArea()\n {\n return $this->administrative_area;\n }" ]
[ "0.699579", "0.699579", "0.69702494", "0.68243176", "0.6620931", "0.637174", "0.6345949", "0.6337057", "0.62866807", "0.62548274", "0.62482786", "0.6189154", "0.6185192", "0.61661345", "0.6153153", "0.6032796", "0.5964568", "0.59558606", "0.5942301", "0.592275", "0.5916948", "0.58912325", "0.5863695", "0.5735219", "0.57261807", "0.5725948", "0.56408846", "0.56256413", "0.55444217", "0.55358386" ]
0.83183676
0
Gets the value of contactDetails.
public function getContactDetails() { return $this->contactDetails; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContactDetails() {\n $data = file_get_contents(\"database/contact.json\");\n $json = json_decode($data, true);\n\n return $json;\n }", "public function getContact() {\n return $this->contact;\n }", "public function getContact() {\n return $this->contact;\n }", "public function getContact() {\n return $this->contact;\n }", "public function getContact() {\n return $this->contact;\n }", "public function getContact()\n {\n return $this->contact;\n }", "public function getContact()\n {\n return $this->contact;\n }", "public function getContact()\n {\n return $this->Contact;\n }", "public function getSellerContactDetails()\n {\n return $this->sellerContactDetails;\n }", "public function contact()\n {\n return $this->contact;\n }", "public function getContactInformation();", "public function getContact()\n {\n return $this->sendAPIRequest('GET',\"/contacts/{$this->contact_uuid}\");\n }", "public function getContact(){\n return $this->getParameter('contact');\n }", "public function getContact(){\n return $this->getParameter('contact');\n }", "public function getContactPhone()\n {\n return (string)$this->contactPhone;\n }", "public function getContact_Number()\r\n\t{\r\n\t\treturn $this->Contact_Number;\r\n\t}", "private function get_details() {\n\t\t$client = \\Tigron\\Cp\\Client\\Soap::get('invoice_contact');\n\t\t$this->details = $client->get_by_id($this->id);\n\t}", "public function getExtendedSellerContactDetails()\n {\n return $this->extendedSellerContactDetails;\n }", "public function contactInfo()\n {\n return $this->hasOne('App\\ContactInfo');\n }", "public function getPhone()\n {\n return $this->contact_phone;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getContactPerson()\n {\n return $this->ContactPerson;\n }" ]
[ "0.72898847", "0.7081208", "0.7081208", "0.7081208", "0.70794773", "0.70780206", "0.70780206", "0.7054309", "0.699005", "0.68736416", "0.6609749", "0.6586242", "0.65051687", "0.65051687", "0.6453119", "0.64187336", "0.63613755", "0.63265485", "0.6298766", "0.6297409", "0.6265372", "0.6265372", "0.6265372", "0.6265372", "0.6265372", "0.6265372", "0.6265372", "0.6265372", "0.61996156", "0.6195338" ]
0.853343
0
User to leave group
public function Leave($groupeid, $userid) { if($this->users->LeaveGroup($groupeid, $userid)){ $this->AddMessage('success', "the User Leave the group"); $this->RedirectToController('edituser', $userid, null); }else { $this->AddMessage('notice', "the User did not Leave the group"); $this->RedirectToController('edituser', $userid, null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leaveGroup() {\n $group = $this->loadGroup();\n if(!$group) {\n return false;\n }\n\n $user =& JFactory::getUser();\n $db = & JFactory::getDBO();\n $group_id = $this->group_id;\n $group_id = $group->$group_id;\n\n $query = \"DELETE FROM \".$this->users_db.\" WHERE user_id = \".$user->id.\n \" and \".$this->group_id.\" = \".$group_id;\n if($db->Execute($query)) {\n $query = \"SELECT count(user_id) FROM \".$this->users_db.\" WHERE admin = 1 and \".\n $this->group_id.\" = \".$group_id;\n $db->setQuery($query);\n if(!$db->loadResult()) {\n $this->groupCleanUp($group);\n }\n return true;\n }\n\n JError::raiseWarning(500, JText::_('Unable to leave group...'));\n return false;\n }", "function groupextended_user_leave_event_listener($event, $object_type, $object) {\n global $CONFIG;\n $group = $object['group'];\n $user = $object['user'];\n if($user instanceof ElggUser){\n return true;\n }\n\n $user = $user->getGUID();\n if($group->isMember($user)){\n $acl = $group->group_acl;\n // I have to use this because the remove_user_from_access_collection function need that user_id must a user\n $collections = get_write_access_array();\n\n if ((array_key_exists($acl, $collections) || $collection->owner_guid == 0)) {\n delete_data(\"delete from {$CONFIG->dbprefix}access_collection_membership where access_collection_id = {$acl} and user_guid = {$user}\");\n }\n }\n return false;\n}", "function wine_user_leave_event_listener($event, $object_type, $object) {\n\n\t$wine = $object['group'];\n\t$user = $object['user'];\n\t$acl = $wine->group_acl;\n\n\tremove_user_from_access_collection($user->guid, $acl);\n\n\treturn true;\n}", "public function leave()\n {\n static::send('groups.leave', 'POST', ['roomId' => $this->getGroupId()]);\n if (!static::getSuccess()) {\n return false;\n }\n\n return $this->updateOutOfResponse(static::getResponse()->group);\n }", "function leave(){\n try{\n $postdata=$this->input->post();\n $user=$this->user;\n $group_user_id=$postdata[\"group_user_id\"];\n //validate the group user id submitted\n $group_user_data=MedicalGroupUsers::find_by_id($group_user_id);\n $response=array(\"status\"=>FALSE,\"message\"=>\"Something went wrong. Please try again later.\");\n if(!empty($group_user_data) && $group_user_data->admin==1 && $group_user_data->user_id==$user->id){\n $group_user_data->admin=0;\n $group_user_data->save();\n $response=array(\"status\"=>TRUE,\"message\"=>\"Success\");\n }\n echo json_encode($response);\n }\n catch(Exception $ex){\n echo json_encode(array(\"status\"=>FALSE,\"message\"=>\"Invalid Data submitted.\".$ex->getMessage()));\n }\n }", "public function leaveGroup($groupId){\n\n // auth guard\n if(!$this->session->has('user'))\n return redirect()->to('/login/index');\n\n $active_user = $this->session->get('user');\n $inGroupModel = new InGroupModel();\n $inGroup = $inGroupModel->where('idUser',$active_user['idUser'])->where('idGroup',$groupId)->first();\n\n if($inGroup==null){\n Error::show(\"Edit not allowed\");\n }\n\n $thisGroup = $inGroupModel->findByGroupId($groupId);\n\n $userId = $active_user['idUser'];\n\n $inGroup = $inGroupModel->where('idUser',$userId)->where('idGroup',$groupId)->findAll(1)[0];\n\n $admins = $inGroupModel->where('idGroup',$groupId)->where('type','1')->findAll();\n\n if(($inGroup['type']=='1') && (count($admins)==1)){\n foreach ($thisGroup as $memInGroup){\n if($memInGroup['idUser']!=$userId){\n $id = $inGroupModel->where('idUser',$memInGroup['idUser'])->where('idGroup',$groupId)->findAll(1)[0];\n $data = [\n 'idGroup'=>$groupId,\n 'idUser' => $memInGroup['idUser'],\n 'type'=>'1'\n ];\n $inGroupModel->update($id['idInGroup'],$data);\n break;\n }\n }\n }\n\n $inGroupModel->delete($inGroup['idInGroup']);\n\n\n if(count($thisGroup)==1) {\n $this->deleteGroup($groupId);\n }\n\n return redirect()->to('/group/index/'.'You are no longer member');\n }", "public function leaveGroup(int $group_id, int $user_id) {\r\n $this->verifySystemIsActive();\r\n $group = Group::getById($group_id);\r\n $user = User::getByUserID($user_id);\r\n $user->exitGroup($group);\r\n if ($group->getGroupMembersNum() == 0) {\r\n $group->delete();\r\n }\r\n }", "public function leaveGroup($id){\n return $this->securityDAO->leaveGroupDAO($id);\n }", "public function leave()\n\t{\n\t\tglobal $tpl, $ilUser;\n\n\t\t$room = ilChatroom::byObjectId( $this->gui->object->getId() );\n\n\t\t$chat_user = new ilChatroomUser( $ilUser, $room );\n\t\t$user_id = $chat_user->getUserId();\n\t\t$connector = $this->gui->getConnector();\n\n\t\tif( !$room )\n\t\t{\n\t\t\t$response = json_encode( array(\n\t\t\t\t 'success' => false,\n\t\t\t\t 'reason' => 'unkown room'\n\t\t\t\t ) );\n\t\t\t\t echo json_encode( $response );\n\t\t\t\t exit;\n\t\t}\n\t\telse if( !$room->isSubscribed( $chat_user->getUserId() ) )\n\t\t{\n\t\t\t$response = json_encode( array(\n\t\t\t\t 'success' => false,\n\t\t\t\t 'reason' => 'not subscribed'\n\t\t\t\t ) );\n\t\t\t\t echo json_encode( $response );\n\t\t\t\t exit;\n\t\t}\n\n\t\t$scope = $room->getRoomId();\n\t\t$params = array();\n\n\t\t$params['user'] = $chat_user->getUserId();\n\t\t$params['sub'] = $_REQUEST['sub'];\n\n\t\t$message = json_encode( array(\n\t\t\t'type' => 'private_room_left',\n\t\t\t'user' => $params['user'],\n\t\t\t'sub'\t=> $params['sub']\n\t\t));\n\n\t\t$connector->sendMessage( $room->getRoomId(), $message, array('public' => 1, 'sub' => $params['sub']) );\n\n\t\tif( $room->userIsInPrivateRoom( $params['sub'], $params['user'] ) )\n\t\t{\n\t\t\t//$params\t\t\t= array_merge( $params, array('message' => $message) );\n\t\t\t$query = http_build_query( $params );\n\t\t\t$connector = $this->gui->getConnector();\n\t\t\t$response = $connector->leavePrivateRoom( $scope, $query );\n\t\t\t$responseObject = json_decode( $response );\n/*\n\t\t\tif( $responseObject->success == true && $room->getSetting( 'enable_history' ) )\n\t\t\t{\n\t\t\t\t//$room->addHistoryEntry( $message, $recipient, $publicMessage );\n\t\t\t}\n*/\n\t\t\t$room->unsubscribeUserFromPrivateRoom( $params['sub'], $params['user'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = json_encode( array('success' => true, 'message' => 'was not in room') );\n\t\t}\n\n\t\techo $response;\n\t\texit;\n\t}", "function demote_user($group_id,$user_id)\n{\n $db = connectToDB();\n $res = $db->query(\"SELECT authorisers FROM groups WHERE group_id = $group_id\");\n if ($res->num_rows == 1)\n {\n $row = $res->fetch_array();\n $authorisers = $row['authorisers'];\n if (isGroupAdmin($authorisers))\n {\n //$db->query(\"DELETE FROM group_membership WHERE user_id=$user_id AND group_id=$group_id \");\n // dont delete, need to set it to deleting\n $db->query(\"UPDATE group_membership SET previous_state=0, state=97 WHERE user_id=$user_id AND group_id=$group_id \");\n\n\n audit_log(\"User with id $user_id was removed from group $group_id.\");\n add_user_notification($user_id, \"You have been removed from group $group_id.\",$GLOBALS['userid'] );\n\n my_meta_refresh(\"api.php?action=group_superadmin&action2=show&group_id=$group_id\", 0);\n } else {\n\t\techo \"You are not allowed to do that!\";\n\t}\n }\n}", "protected function cmd_leaveReviewTeam() {\n\t\t$reviewRecord = $this->db_getReviewRecord($this->piVars['extensionkey'], $this->piVars['version']);\n\t\tif ($reviewRecord === FALSE) return $this->renderSub_errorWrap($this->pi_getLL('error_reviewrecordnotfound','',1));\n\n\t\tif (!t3lib_div::inList($reviewRecord['reviewers'], $this->reviewer['username'])) return $this->renderSub_errorWrap($this->pi_getLL('error_cantleavenomember','',1));\n\n\t\t$reviewRecord['reviewers'] = t3lib_div::rmFromList($this->reviewer['username'], $reviewRecord['reviewers']);\n\t\t$this->db_addReviewNote($this->piVars['extensionkey'], $this->piVars['version'], $this->reviewer['username'].' leaves the review team.');\n\t\tif (strlen($reviewRecord['reviewers'])) {\n\t\t\t$this->db_updateReviewRecord($this->piVars['extensionkey'], $this->piVars['version'], array('reviewers' => $reviewRecord['reviewers']));\n\t\t} else {\n\t\t\t$this->db_deleteReviewRecord($this->piVars['extensionkey'], $this->piVars['version']);\n\t\t}\n\n\t\treturn '';\n\t}", "function group_user_removed_handler($eventdata){\n\t\tglobal $CFG;\n\t\t//check if this group is relevant\n\t\t$group = groups_get_group($eventdata->groupid);\n\t\t$courseid = $group->courseid;\n\t\t$context = get_context_instance(CONTEXT_COURSE, $courseid);\n\t\tif(record_exists('mumiemodule_students', 'groupid', $eventdata->groupid)){\n\t\t\tevent_logoutput(\"group_user_removed_handler called \\n\", $eventdata);\n\t\t\t //check if removed user might be tutor or not\n\t\t\t if(has_capability('mod/mumiemodule:tutorize', $context, $eventdata->userid)){\n\t\t\t \t//while MUMIE-DB is not changed we insert the Dummy-Tutor:\n\t\t\t \t$tutorial = new object();\n\t\t\t \t$tutorial->syncid = 'moodle-'.$CFG->prefix.'groups-'.$eventdata->groupid;\n\t\t\t\t$tutorial->name = $eventdata->name;\n\t\t\t\t$tutorial->description = $group->description;\n\t\t\t\t$tutorial->tutor = 'moodle-dummy_tutor';\n\t\t\t\t$tutorial->classid = 'moodle-'.$CFG->prefix.'course-'.$courseid;\n\t\t\t\tchange_tutorial_for_mumie($tutorial);\n\t\t\t } else if(has_capability('mod/mumiemodule:participate', $context, $eventdata->userid)){ //this is a student\n\t\t\t\t$userid = 'moodle-'.$CFG->prefix.'user-'.$eventdata->userid;\n\t\t\t\t$tutorialid = 'moodle-'.$CFG->prefix.'groups-'.$eventdata->groupid;\n\t\t\t\tremove_user_from_mumie_tutorial($userid, $tutorialid);\n\t\t\t\t//a user must be part in exactly one tutorial per course - so the user has to be removed from the modules of this course\n\t\t\t\t$mumiemodules = get_records('mumiemodule', 'course', $courseid);\n\t\t\t\tforeach($mumiemodules as $mumiemodule){\n\t\t\t\t\tmumiemodule_students_unsubscribe($eventdata->userid, $mumiemodule->id, $eventdata->groupid);\n\t\t\t\t}\n\t\t\t }\n\t\t}\n\t\treturn true;\n\t}", "public function endLeave() {\n \n }", "public function track_leave_bp_group( $group_id, $user_id, $reason = null ) {\n\t\t\tinclude_once('km.php');\n\t\t\t$user = get_user_by( 'id', $user_id );\n\t\t\t$properties = array( 'Left Group ID' => $group_id );\n\n\t\t\tKM::init( get_option( 'cc_kissmetrics_key' ) );\n\t\t\tKM::identify( $user->user_email );\n\t\t\tKM::record( 'Left group', $properties );\n\t\t}", "public function removeuserfromgroupAction() {\n if ($this->getRequest()->isPost()) {\n $userId = $_POST['userId'];\n $groupId = $_POST['groupId'];\n $group = $this->_helper->db->getTable('InciteGroup')->findGroupById($groupId);\n\n //prevent non group owners from changing people's privilege levels to banned or added\n if (isset($group) && ($_SESSION['Incite']['USER_DATA']['id'] == $userId || $_SESSION['Incite']['USER_DATA']['id'] == $group['creator_id'])) {\n $groupuser = $this->_helper->db->getTable(\"InciteGroupsUsers\")->findGroupUserByUserAndGroupIds($userId, $groupId);\n if (isset($groupuser)) {\n $groupuser->delete();\n }\n echo json_encode('true');\n }\n else {\n echo \"false\";\n } \n }\n }", "public function leave()\n {\n if ($user->hasPermission('impersonte.impersonator')) {\n session()->forget('session.impersonate.user');\n return $this->userLeftImpersonating(auth()->user()) ?: redirect()->route('users.index')->with('status', trans('autopulse::auth.impersonate_user_leave'));\n }\n return redirect()->route('home');\n }", "public function leave($userid = false) {\n $userid = $userid ?: $this->userid;\n DB::update('participants', [\n 'left' => time(),\n 'status' => 'LEFT',\n ], 'userid = %i AND threadid = %i', $userid, $this->threadid);\n }", "public function leave()\n {\n $this->user_model->check_permissions(\"certificate/leave\");\n \n $data['menu'] = $this->load_model->menu();\n $data['base_url'] = base_url();\n $data['userInfo'] = $this->userInfo;\n $branch=$this->user_model->getbranch();\n if($this->user_model->is_super())\n $data['branch'] = $this->db->select(\"name,id\")->from(\"branch\")->get()->result();\n else\n $data['branch'] = $this->db->select(\"name,id\")->from(\"branch\")->where(\"id\",$branch)->get()->result();\n \n\n $this->load->view('header',$data);\n $this->load->view('sidebar',$data);\n $this->load->view('certificate/add_leave_info',$data);\n \n }", "public function destroy($id)\n {\n $user = Auth::user();\n $group = DinnerGroup::findOrFail($id);\n\n if (!DinnerPermission::user($user)->canLeaveGroup($group)) {\n return Redirect::route('dashboard.dinner.groups.show', $group->id)\n ->with('danger', 'You cannot leave this group');\n }\n\n $removed = $group->removeMember($user);\n\n if ($removed === true) {\n return Redirect::route('dashboard.dinner.groups.show', $group->id)\n ->with('success', 'You have left this group');\n }else{\n return $removed;\n }\n }", "public function leave() {\n\t\t\n\t\n\t\t$data['employee'] = $this->leave->exeGetEmpToEdit($_SESSION['userId']);\t\n\t\t\t$this->mainCont = $this->load->view('pages/requests/leave', '', TRUE);\t\n\t\t\n\t}", "function leaveCourse(){\n\t\tif($this->teacherOK() && $this->csrfTokenOK()){\n\t\t\t$courseID=$this->f3->get('GET.courseID');\n\t\t\t$result = $this->db->exec('DELETE FROM `courseLeader` WHERE `courseLeader`.`userID` = ? AND `courseLeader`.`courseID` = ?', array($this->f3->get('SESSION.userID'), $courseID));\n\t\t\t// Delete courses without courseleader\n\t\t\tif($this->countCourseLeader($courseID) == 0){\n\t\t\t\t$this->db->exec('DELETE FROM `course` WHERE course.courseID=? AND course.courseID NOT IN (SELECT courseLeader.courseID FROM courseLeader)',$courseID);\n\t\t\t\t$this->f3->set('SESSION.warning',$this->f3->get('lang.courseDeleted'));\n\t\t\t}\n\t\t\t$this->f3->set('SESSION.info',$this->f3->get('lang.leftCourse'));\n\t\t}\n\t\t$this->f3->reroute('/');\n\t}", "public function track_removed_bp_group( $group_id, $user_id ) {\n\t\t\t// Use basic leave function to record activity\n\t\t\tself::track_leave_bp_group( $group_id, $user_id, 'removed' );\n\t\t}", "public function removeuserfromgroupAction()\n {\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n if(!$this->logged)\n {\n throw new Zend_Exception('Must be logged in');\n }\n $groupId = $this->_getParam('groupId');\n $userId = $this->_getParam('userId');\n if(!isset($groupId))\n {\n throw new Zend_Exception('Must pass a groupId parameter');\n }\n if(!isset($userId))\n {\n throw new Zend_Exception('Must pass a userId parameter');\n }\n\n $group = $this->Group->load($groupId);\n $user = $this->User->load($userId);\n if(!$user || !$group)\n {\n throw new Zend_Exception('Invalid parameter');\n }\n $community = $group->getCommunity();\n\n if(!$this->Community->policyCheck($community, $this->userSession->Dao, MIDAS_POLICY_WRITE))\n {\n throw new Zend_Exception('Must be moderator or admin to manage groups');\n }\n if(!$this->Community->policyCheck($community, $this->userSession->Dao, MIDAS_POLICY_ADMIN) &&\n $this->Community->policyCheck($community, $user, MIDAS_POLICY_ADMIN))\n {\n echo JsonComponent::encode(array(false, 'Only admins can remove users with admin privileges'));\n return;\n }\n $this->Group->removeUser($group, $user);\n echo JsonComponent::encode(array(true, 'Removed user '.$user->getFullName().' from group '.$group->getName()));\n }", "public function removeselectedgroupAction() {\n if ($this->getRequest()->isPost()) {\n $groupId = $_POST['groupId'];\n $group = getGroupInfoByGroupId($groupId);\n //prevent non group owners from changing people's privilege levels to banned or added\n if ($_SESSION['Incite']['USER_DATA']['id'] == $group['creator']['id']) {\n echo json_encode(removeGroup($groupId));\n }\n else {\n echo \"false\";\n }\n }\n }", "public function leave($user_id){\n\t\t\tglobal $wpdb;\n\t\t\t$delete = $wpdb->delete( \n\t\t\t\tKG_Config::getPublic('table_tasks_user_relations'),\n\t\t\t\tarray(\n\t\t\t\t\t'task_id' => $this->get_ID(),\n\t\t\t\t\t'user_id' => (int) $user_id,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'%d',\n\t\t\t\t\t'%d'\n\t\t\t\t) \n\t\t\t);\n\t\t\tif($delete){\n\t\t\t\tdo_action('kg_leave_from_task', $user_id, $this);\n\t\t\t}\n\t\t\treturn $delete;\n\t\t}", "public function onExpansionGroupRemoveUser(Group $group, $loginRemoved)\n {\n }", "public function leave() {\n global $db;\n\n $sql = \"UPDATE users SET game_id = 0, is_host = 0, is_display = 0 WHERE session_id = :session_id\";\n $result = $db->prepare($sql);\n $result->bindValue(\":session_id\", $this->sessionid);\n\n if ($result->execute() && $result->errorCode() == 0) {\n return true;\n }\n return false;\n }", "function _horde_removeUserFromGroup($name, $user)\n{\n if (!Auth::isAdmin()) {\n return PEAR::raiseError(_(\"You are not allowed to change groups.\"));\n }\n\n require_once 'Horde/Group.php';\n $groups = &Group::singleton();\n\n if (is_a($group = &$groups->getGroup($name), 'PEAR_Error')) {\n return $group;\n }\n\n if (is_a($result = $group->removeUser($user), 'PEAR_Error')) {\n return $result;\n }\n\n return true;\n}", "public function removeFromGroup($group) {\n \t$this->groupMemberOf->detach($group->id);\n }", "public function action_logout()\n {\n $usergroups = Groups::all();\n Sentry::logout();\n Cache::forget('coreuser'); // Erase User catch\n return View::make('oscore.login')->with('usergroups',$usergroups)->with('notificationermsg', '')->with('notificationsucmsg', '');\n }" ]
[ "0.7753589", "0.7385833", "0.7274629", "0.7270308", "0.7212122", "0.7194339", "0.67551965", "0.6743552", "0.6599748", "0.65797293", "0.64909494", "0.64298177", "0.6422329", "0.6417831", "0.63997483", "0.6385287", "0.6321754", "0.62819606", "0.62038904", "0.6187476", "0.6163612", "0.6153179", "0.61329764", "0.61077666", "0.60883695", "0.60855293", "0.6021447", "0.6019181", "0.59900165", "0.5953108" ]
0.7406661
1
end of getFeedbackDetails function Downloading Feedback list in csv file
public function downloadFeedbackCsvFile() { $csv_file = fopen('php://output', 'w'); header('Content-type: application/csv'); // it(ob_clean()) using downloade time remove empty row on excelsheet // ob_clean(); $gameFeedback = $this->Common_Model->fetchRecords('GAME_FEEDBACK', NULL, NULL, 'Feedback_id DESC', NULL); // print_r($gameFeedback); exit(); if (count($gameFeedback) > 0) { $header_row = array("User ID", "Name", "Email ID", "Mobile", "Rating", "Time", "Title", "Message"); fputcsv($csv_file, $header_row, ',', '"'); foreach ($gameFeedback as $gameFeedbackRow) { $Feedback_userData = json_decode($gameFeedbackRow->Feedback_userData); // setting data $userID = $gameFeedbackRow->Feedback_userid; $name = $Feedback_userData->fullName; $emailID = $Feedback_userData->Email; $mobileNo = $Feedback_userData->Mobile; $rating = $gameFeedbackRow->Feedback_rating; $feedbackTime = date('d-M-y, H:i',strtotime($gameFeedbackRow->Feedback_createdOn)); $title = $gameFeedbackRow->Feedback_title; $message = $gameFeedbackRow->Feedback_message; $rowData = array($userID, $name, $emailID, $mobileNo, $rating, $feedbackTime, $title, $message); fputcsv($csv_file, $rowData, ',', '"'); } } else { $noFeedbacks = array('No Feedbacks Available'); fputcsv($csv_file, $noFeedbacks, ',', '"'); } fclose($csv_file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function export_details(){\n $id_lang = (int)Context::getContext()->language->id;\n $start = 0;\n $limit = 100000;\n $order_by = 'id_product';\n $order_way = 'DESC';\n $id_category = false;\n $only_active = true;\n $context = null;\n\n $file = 'productdetails.csv';\n \n $f=fopen('uploads_products/'.$file, 'w');\n \n $all_products = Product::getProducts($id_lang, $start, $limit, $order_by, $order_way, $id_category,\n $only_active, $context);\n\n fwrite($f, \"Id_product;Nom;reference;description;descriptioncourte;caractéristique,caracatéristqiue_value,imageurl \\r\\n\");\n $data[0]=array(\"Id_product\",\"Nom\",\"reference\",\"description\",\"descriptioncourte\",\"caractéristique\",\"caracatéristqiue_value\",\"imageurl\");\n foreach($all_products as $product){\n \n $productObj = new Product((int)$product['id_product'] ,$id_lang , 1 );\n \n /** get all features*/\n\n $features = $productObj->getFeatures();\n \n foreach ($features as $feature){\n $feature_name = Feature::getFeature($id_lang, $feature[\"id_feature\"]);\n $featurevalues = FeatureValue::getFeatureValuesWithLang($id_lang,$feature[\"id_feature\"] , false); \n }\n \n /** get all images */\n $imgs = $productObj->getImages(Context::getContext()->language->id , null);\n $img = $productObj->getCover($product['id_product']);\n $link = new Link();\n //var_dump($productObj->name);die;\n $img_url = $link->getImageLink(isset($productObj->link_rewrite) ? $productObj->link_rewrite : $productObj->name , (int)$img['id_image']);\n \n $image_list = $img_url ;\n\n foreach($imgs as $image){\n $img_url2 = $link->getImageLink(isset($productObj->link_rewrite) ? $productObj->link_rewrite : $productObj->name, (int)$image['id_image']);\n if($img_url !== $img_url2 ){\n $image_list .=\",\".$img_url2 ;\n }\n }\n \n $id_produit = $productObj->id;\n $name = $productObj->name ;\n $reference = $productObj->reference ;\n $description_short = $productObj->description_short;\n $description = $productObj->description ; \n \n $feature_ch = '';\n foreach($featurevalues as $featurevalue){\n $feature_ch .='-'.$featurevalue[\"value\"].';';\n }\n \n $data[$productObj->id] = \n array($id_produit,$name,$reference,$description,$description_short,$feature_name[\"name\"],$feature_ch,$image_list);\n \n } \n \n $fp = fopen(dirname(__FILE__).'/uploads_products/'.$file, 'w');\n \n foreach ($data as $fields) {\n if(is_array($fields)){\n fputcsv($fp, $fields);\n }\n }\n fclose($fp);\n $filesize = filesize(dirname(__FILE__).'/uploads_products/'.$file);\n\n header('Content-Type: text/csv; charset=utf-8');\n header('Cache-Control: no-store, no-cache');\n header('Content-Disposition: attachment; filename=\"'.$file.'\"');\n header('Content-Length: '.$filesize);\n readfile(dirname(__FILE__).'/uploads_products/'.$file);\n }", "public function actionSurveyCsvDownload($survey_id)\n {\n $survey = $this->surveyService->findSurvey($survey_id);\n $survey_questions = $this->surveyService->surveyQuestionAndAnswerForCsv($survey);\n $total_answered_visitor = $this->surveyService->surveyVisitorCountForCsv($survey);\n\n $is_question_has_other = [];\n $visitor_answer_date = [];\n\n //making csv header\n $headers_question = [\"User number\", \"answerdate\"];\n for ($i = 1; $i <= count($survey_questions); $i++) {\n $headers_question[] = 'Q' . $i;\n foreach ($survey_questions[$i - 1]->survey_answers as $survey_answer) {\n if ($survey_answer->is_other == true) {\n $is_question_has_other[$survey_questions[$i - 1]->survey_question_id] = true;\n $headers_question[] = 'Q' . $i . '_FA';\n } else {\n $is_question_has_other[$survey_questions[$i - 1]->survey_question_id] = false;\n }\n }\n }\n $csv_header = CpsCSV::toLineFromArray($headers_question, 'header', []);\n\n //making csv body\n $csv_body = '';\n $answer_order = [];\n foreach ($survey_questions as $survey_question) {\n foreach ($survey_question->survey_answers as $key => $survey_answer) {\n $answer_order[$survey_question->survey_question_id][$survey_answer->survey_answer_id] = $key + 1;\n }\n }\n $survey_questions = $survey_questions->keyBy('survey_question_id')->toArray();\n\n if ($total_answered_visitor > 0) {\n //getting answered visitor data\n $column = ['community_user.user_number as visitorId',\n 'survey_visitors.created_at as answerDate',\n 'survey_visitor_question_answers.content as answerText',\n 'survey_visitor_question_answers.survey_question_id as surveyQuestionId',\n 'survey_visitor_question_answers.survey_answer_id as surveyAnswerId',\n 'survey_answers.is_other as isOther'];\n\n $survey_visitors = $this->surveyService->getSurveyInfo($survey_id, $column);\n\n //change array format\n foreach ($survey_visitors as $key => $values) {\n $visitor_answer_date[$key] = $values[0]['answerDate'];\n $array = [];\n foreach ($values as $value) {\n $array[$value['surveyQuestionId']][] = $value;\n }\n $survey_visitors[$key] = $array;\n }\n\n //making csv body data\n foreach ($survey_visitors as $visitor_id => $questions) {\n $line = [$visitor_id];\n array_push($line, format_datetime($visitor_answer_date[$visitor_id]));\n foreach ($survey_questions as $questions_id => $survey_question) {\n if (!empty($questions[$questions_id])) {\n if ($survey_question['data_type_id'] == 1 || $survey_question['data_type_id'] == 2) {\n //for textbox and textarea\n array_push($line, $questions[$questions_id][0]['answerText']);\n } else if ($survey_question['data_type_id'] == 3 || $survey_question['data_type_id'] == 4) {\n //for dropdown and radio\n $answer_id = $questions[$questions_id][0]['surveyAnswerId'];\n array_push($line, $answer_order[$questions_id][$answer_id]);\n if ($is_question_has_other[$questions_id]) {\n array_push($line, $questions[$questions_id][0]['answerText']);\n }\n } else {\n //for checkbox\n $checkbox_answer_id = [];\n $checkbox_other_answer = '';\n foreach ($questions[$questions_id] as $key => $checkbox_question) {\n $answer_id = $checkbox_question['surveyAnswerId'];\n array_push($checkbox_answer_id, $answer_order[$questions_id][$answer_id]);\n if ($is_question_has_other[$questions_id] && $checkbox_question['answerText'] != null) {\n $checkbox_other_answer = $checkbox_question['answerText'];\n }\n }\n asort($checkbox_answer_id);\n array_push($line, implode(',', $checkbox_answer_id));\n if ($is_question_has_other[$questions_id]) {\n array_push($line, $checkbox_other_answer);\n }\n }\n } else {\n array_push($line, '');\n if ($survey_question['data_type_id'] != 1 && $survey_question['data_type_id'] != 2) {\n if ($is_question_has_other[$questions_id]) {\n array_push($line, '');\n }\n }\n }\n }\n $csv_body .= CpsCSV::toLineFromArray($line, null, []);\n }\n }\n $csv_text = mb_convert_encoding($csv_header . $csv_body, 'SJIS-win', 'UTF-8');\n $filename = $survey->name . \".csv\";\n\n return CpsCSV::download($csv_text, $filename);\n }", "public static function getFeedbackList() {\n $client = self::getClient();\n $session = Session::get('session');\n $student = Session::get('contact');\n //$rootSession = $client->getRootSession();\n\n // Get feedback list\n /* $feddbacks = $client->getFullList(\n $session->root_session_id, \n 'Cases',\n array(), // Get all fields\n 'cases.student_id = \"'.$student->id.'\"',\n 'cases.date_entered ASC'\n ); */\n $relationshipsParams = array(\n 'session' => $session->root_session_id,\n 'module_name' => 'Contacts',\n 'module_id' => $student->id,\n 'link_field_name' => 'contacts_j_feedback_1', \n 'related_module_query' => 'j_feedback.type_feedback_list = \"Customer\" ' ,\n 'related_fields' => array(\n 'id', 'name', 'status', 'description', \n 'assigned_user_name', 'date_entered', 'slc_target', 'resolved_date' ,\n 'type_feedback_list','relate_feedback_list', 'feedback', 'receiver'\n ),\n 'related_module_link_name_to_fields_array' => array(),\n 'deleted'=> '0',\n 'order_by' => 'j_feedback.date_entered DESC',\n 'offset' => 0,\n 'limit' => 1000,\n );\n\n $result = $client->call(SugarMethod::GET_RELATIONSHIPS, $relationshipsParams);\n $feddbacks = $client->toSimpleObjectList($result->entry_list);\n\t\t\t\n\t\t\t //TEST API - Get Data By Entry Point - By Lap Nguyen\n $data_params = array(\n 'session' => $session->root_session_id,\n 'function' => 'getTeamList',\n 'param' => '',\n );\n $result = $client->call('entryPoint', $data_params);\n\n $data_params = array(\n 'session' => $session->root_session_id,\n 'function' => 'getSessionBooking',\n 'param' => array(\n 'student_id'=>'173fd695-524d-dc26-7a50-5710d3fbbeea',\n 'start' =>'2016-09-12',\n 'end' =>'2016-10-04',\n 'class_type'=>'',\n ),\n );\n $result = $client->call('entryPoint', $data_params);\n //END: Test API\n\n return $feddbacks; \n }", "public function export(){\n\n // Create filter from contacts selected\n if(App::request()->getParams('contacts')) {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n 'id' => array(\n '$in' => explode(',', App::request()->getParams('contacts'))\n )\n ));\n }\n else {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n ));\n }\n\n // Get contacts from db\n $listContacts = HContact::getListByExample($filter, 'id', array(), array('firstName' => DB::SORT_ASC));\n\n // Create temporary file\n $tempFileName = 'contacts_' . uniqid() . '.csv';\n $file = fopen( Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName, \"w\");\n\n $questions = HContactQuestion::getAll();\n $dataTitle = array(\n 'lastName', \n 'firstName', \n 'job', \n 'company',\n 'phoneNumber',\n 'cellNumber',\n 'personalNumber',\n 'email',\n 'address',\n 'city',\n 'postcode',\n 'country'\n );\n\n foreach ($questions as $key => $q) {\n if($q->type == 'file'){\n unset($questions[$key]);\n }\n else{\n $dataTitle[] = $q->name; \n } \n }\n\n // Write title in first line\n fputcsv($file, $dataTitle, ',');\n\n // For each contacts add data on one line\n foreach ($listContacts as $contact){\n $data = array(\n $contact->lastName, \n $contact->firstName, \n $contact->job, \n $contact->company,\n $contact->phoneNumber,\n $contact->cellNumber,\n $contact->personalNumber,\n $contact->email,\n $contact->address,\n $contact->city,\n $contact->postcode,\n $contact->country\n );\n\n foreach ($questions as $q) {\n $data[] = HContactValue::getValueByName($q->name, $contact->id);\n }\n\n fputcsv($file, $data, ',');\n }\n\n // Close file\n fclose($file);\n\n // Read data\n $data = file_get_contents(Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Remove remporaray file\n shell_exec('rm ' . Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Create response\n $response = App::response();\n $response->setContentType('text');\n $response->header('Content-Disposition', 'attachment; filename=\"contacts.csv\"');\n\n return $data;\n }", "public function downloadElementScores($assignment_id){\n //Gather all data of the gradings\n $assignment_name = $this->getAssignmentName($assignment_id);\n $gradings = Array();\n $questions = Array();\n $data = $this->getReviewingsOfSubmission($assignment_id);\n $staff_members = Array();\n foreach ($data as $index => $value) {\n $staff_id = $value['staff_id'];\n array_push($staff_members, $staff_id);\n $submission_id = $value['submission_id'];\n $student_id = $this->getStudentID($submission_id);\n $question_id = $value['question_id'];\n array_push($questions, $question_id);\n $question_value = $value['value'];\n $reviewerlist_id = $value['reviewerlist_id'];\n $gradings[$staff_id][$student_id][$question_id] = $question_value;\n }\n\n //Make questions array\n $questions = array_filter(array_unique($questions));\n sort($questions);\n $questions_name = Array();\n foreach ($questions as $index => $question_id) {\n $question_txt = $this->getQuestionTxt($question_id);\n array_push($questions_name, $question_txt);\n }\n\n //Create empty csv files with headers\n $files = Array();\n $headers = array_merge(Array('student_id', 'student_name'), $questions_name);\n foreach ($staff_members as $index => $staff_id) {\n $files[$staff_id] = join(\";\",$headers).\"\\n\";\n }\n\n //Fill csv files with data\n foreach ($gradings as $staff_id => $students) {\n foreach ($students as $student_id => $question_answer) {\n //Initialize variables\n $student_name = $this->getStudentName($student_id);\n $firstname = $student_name['firstname'];\n $prefix = $student_name['prefix'];\n $lastname = $student_name['lastname'];\n $student_name = $this->generateNameStr($firstname, $prefix, $lastname);\n\n //Create export row\n $export_row = Array();\n array_push($export_row, $student_id);\n array_push($export_row, $student_name);\n foreach (range(0,count($questions)-1) as $index) {\n array_push($export_row, '');\n }\n //Save every answer\n foreach ($question_answer as $question => $answer) {\n $index = array_search($question, $questions);\n $export_row[$index+2] = $answer;\n }\n $result = $files[$staff_id];\n $result = $result.join(';', $export_row).\"\\n\";\n $files[$staff_id] = $result;\n }\n }\n\n //Write csv files\n chdir(\"tmp\");\n $csv_files = Array();\n foreach ($files as $staff_id => $csv) {\n //Set variables\n $staff_name = $this->getStaffName($staff_id);\n $firstname = $staff_name['firstname'];\n $prefix = $staff_name['prefix'];\n $lastname = $staff_name['lastname'];\n $staff_name = $this->generateNameStr($firstname, $prefix, $lastname);\n\n //Write to csv file\n $filename = \"Beoordelingslijst_\".$assignment_name.\"_\".$staff_name.\"_\".date(\"d-m-Y_H:i:s\").'.csv';\n $tmp_file = fopen($filename, \"w\");\n fwrite($tmp_file, $csv);\n fclose($tmp_file);\n array_push($csv_files, $filename);\n }\n\n //Zip csv files and download\n $filename = \"Beoordelingslijst_\".$assignment_name.\"_\".date(\"d-m-Y_H:i:s\").'.zip';\n $zip = \\Comodojo\\Zip\\Zip::create($filename);\n $zip->add($csv_files);\n $zip->close();\n\n header(\"Content-Description: File Transfer\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Disposition: attachment; filename=$filename\");\n readfile($filename);\n unlink($filename);\n foreach ($csv_files as $index => $filename) {\n unlink($filename);\n }\n }", "public function export(){\n\t\t$feedbacks=Feedback::orderBy('created_at')->get();\n\t\t$feedbackArray[] = ['Date', 'Name','Email Address','Nature of feedback','Details'];\n\t\t// Convert each member of the returned collection into an array,\n \t// and append it to the Result array.\n \tforeach($feedbacks as $feedback){\n \t\t$resultArray=array();\n \t\t$resultArray[]=date_format($feedback->created_at,'d/m/y');\n \t\t$resultArray[]=ucfirst($feedback->first_name) .' '.ucfirst($feedback->last_name);\n \t\t$resultArray[]=$feedback->email; \n \t\tswitch($feedback->feedback_nature){\n\t case 1: $resultArray[]= 'Feature request';break;\n\t case 2: $resultArray[]= 'General feedback';break;\n\t case 3: $resultArray[]= 'Bug';break;\n }\n\n \t\t$resultArray[]=$feedback->details;\n \t\t$feedbackArray[]=$resultArray;\n\t\t}\n\t\t\n\t\t// Generate and return the spreadsheet\n\t\t Excel::create('GomoLearningFeedbackReport', function($excel) use ($feedbackArray) {\n\n\t\t // Set the spreadsheet title, creator, and description\n\t\t $excel->setTitle('Feedback Report');\n\t\t $excel->setCreator('Michel')->setCompany('Gomo Learning');\n\t\t $excel->setDescription('Customer Feedback File');\n\n\t\t // Build the spreadsheet, passing in the payments array\n\t\t $excel->sheet('sheet1', function($sheet) use ($feedbackArray) {\t\n\t\t \t$sheet->rows($feedbackArray);\t\t \t\n\t\t \t$sheet->setAutoSize(true);\t\t \t\t \n\t\t });\n\n\t\t })->download('xls');\n\t\t die;\n\t}", "public function createBorrowedItemsCSV(){\n\t$borrowedItems = Model::getInstance()->getBorrowedItemsForCSV();\n\t\n\t$fileName = $_SESSION['organisation']['database'].'/dwnld/borroweditems.csv';\n\t\n\t$fh = fopen($fileName,\"w\");\n\tfwrite($fh,pack(\"CCC\",0xef,0xbb,0xbf)); // ensures UTF-8 encoding\n\tfwrite($fh,mb_convert_encoding(\"Klasse;Name;Vorname;Titel;Barcode;Fälligkeitsdatum\\r\\n\",'UTF-8') );\n\tforeach($borrowedItems as $b) {\n\t$line = $b['form'] . ';' . $b['sn'] . ';' . $b['gn'] . ';' . $b['title'] . ';' . \n\t$b['barcode'] . ';' . $b['faellig'];\n\t$line .= \"\\r\\n\";\n\tfwrite($fh,mb_convert_encoding($line,'UTF-8') );\n\t}\n\t\n\t\n\tfclose($fh);\n\treturn $fileName;\n\t}", "public function get_campaigns_leads($ads) {\n\n //$campaigns = $this->CI->V2_master_campaign_model->get_active_campaigns_by_network_id_and_type($this->network_id, 'FB-LEAD');\n\n //var_dump($ads); exit;\n //adds the ad performance report into the database\n $this->CI->load->model('V2_fb_lead_model');\n $this->CI->load->model(\"V2_fb_form_model\");\n $current_form_id = null;\n $csv_data = [];\n foreach($ads as $ad){\n\n if($current_form_id != $ad['form_id']) {\n $form = $this->CI->V2_fb_form_model->get_by_id($ad['form_id']);\n $current_form_id = $form['id'];\n }\n\n //var_dump($form); exit;\n //$response = $this->facebookad->get_leads($form['form_network_id']);\n $response = $this->facebookad->get_leads_by_ad_id($ad['network_creative_id']);\n var_dump($response);\n// $leads = $this->CI->V2_fb_lead_model->get_leads_by_campaign_id($ad['id']);\n $leads = $this->CI->V2_fb_lead_model->get_leads_by_ad_id($ad['id']);\n $existing_leads =[];\n var_dump($leads);\n foreach ($leads as $lead) {\n $existing_leads[]=$lead['lead_network_id'];\n }\n //var_dump($existing_leads); exit;\n\n if($response['result']) {\n foreach ($response['result'] as $new_lead) {\n if (!in_array($new_lead['id'], $existing_leads)) {\n var_dump(777);\n $data_for_insert = array();\n foreach ($new_lead[\"field_data\"] as $option) { //var_dump($option); exit;\n $data_for_insert[$option['name']] = $option['values'][0];\n }\n\n $data_for_insert['lead_network_id'] = $new_lead['id'];\n $data_for_insert['created_time'] = $new_lead['created_time'];\n $data_for_insert['created_date'] = date(\"Y-m-d H:i:s\");\n $data_for_insert['campaign_id'] = $ad['campaign_id'];\n $data_for_insert['ad_id'] = $ad['id'];\n $data_for_insert['form_id'] = $form['form_network_id'];\n $data_for_insert['page_id'] = $form['page_id'];\n\n //if($data_for_insert['cost']) {\n $this->CI->V2_fb_lead_model->create($data_for_insert);\n //}\n\n if($form['export_type'] == 'email_address' && $form['email_type'] == 'immediately') {\n $data_for_insert['campaign_name'] = $ad['campaign_name'];\n $data_for_insert['io'] = $ad['io'];\n $csv_data[$form['email']][] = $data_for_insert;\n }\n }\n }\n }\n\n }\n\n if($csv_data) {\n $this->CI->load->library('Send_email');\n foreach ($csv_data as $key=>$value) {\n // create csv file\n $file_name = 'lead reporting between for '.date(\"Y-m-d H:i:s\").'.csv';\n $fp = fopen('v2/files/tmp/'.$file_name, 'w');\n fputcsv($fp, $value);\n fclose($fp);\n //$full_name = base_url().'v2/files/tmp/'.$file_name;\n $full_name = 'v2/files/tmp/'.$file_name;\n $this->CI->send_email->send_lead_reporting($key, $value['io'], $value['campaign_name'], 'NEW', $full_name);\n }\n }\n\n return true;\n }", "function downloadMgsCSV($idArr) {\n header(\"Content-type: application/octet-stream;charset=gbk\");\n header(\"Content-Disposition: attachment; filename=ceg_filtered.csv\");\n $tmp = getMgsInfo($idArr);\n $br = \"\\r\\n\";\n $t = \"\\t\";\n \n echo '\"Access_num\",\"koid\",\"cogid\",\"ec\",\"Description\",\"Category\"'.$br;\n foreach ($tmp as $row) {\n echo '\"' . $row['access_num'] . '\",\"' . $row['koid'] . '\",\"' . $row['cogid'] . '\",\"' . $row['ec'] . '\",\"' . $row['description'] . '\",\"' . $row['category'] . '\"' . $br;\n }\n}", "public function downloadFile(){\r\n $id = $_GET['id'];\r\n\r\n header(\"Content-disposition: filename=liste_inscription.csv\");\r\n header(\"Content-Type: text/csv; charset=UTF-8\");\r\n $entete = array(\"Nom\", \"Prenom\",\"Email\",\"Sexe\",\"DateNaissance\",\"DateInscription\",\"NumDossard\");\r\n $lignes = array();\r\n $ep = new EpreuveParticipation();\r\n $array = $ep->getInscriptionsByEpreuve($id);\r\n foreach ($array as $value) {\r\n $inscription = new inscription();\r\n $insc = $inscription::findById($value);\r\n $num = $ep::findById($id,$insc->id_inscription);\r\n $participant = new participant();\r\n $participant = $participant::findById($insc->id_participant);\r\n $lignes[] = array($participant->nom, $participant->prenom,$participant->email,$participant->sexe,\r\n $participant->date_naissance,$insc->date_inscription,$num->num_dossard);\r\n }\r\n\r\n $separateur = \";\";\r\n\r\n echo implode($separateur, $entete).\"\\r\\n\";\r\n\r\n foreach ($lignes as $ligne) {\r\n echo implode($separateur, $ligne).\"\\r\\n\";\r\n }\r\n }", "public function download($id,$start_date,$end_date){\n\n $dealership = Dealership::find($id);\n\n $formatted_start_date = Carbon::createFromFormat('Y-m-d',$start_date);\n $formatted_start_date = $formatted_start_date->format('d-m-Y');\n\n $formatted_end_date = Carbon::createFromFormat('Y-m-d',$end_date);\n $formatted_end_date = $formatted_end_date->format('d-m-Y');\n\n $start_date = Carbon::parse($start_date)->format('d-m-Y');\n $end_date = Carbon::parse($end_date)->format('d-m-Y');\n\n $filename = 'Rhino Events_' . $dealership->name . '_' . $formatted_start_date . ' - ' . $formatted_end_date . '.csv';\n\n $handle = fopen('csv/' . $filename, 'w+');\n\n fputs($handle, \"\\xEF\\xBB\\xBF\" ); // UTF-8 BOM \n\n $csv_headers = [''];\n $csv_second_row = [''];\n $csv_events = [''];\n\n $manufacturer_ids = [];\n $event_ids = [];\n\n foreach($dealership->manufacturers as $manufacturer) {\n\n $manufacturer_ids[] = $manufacturer->id;\n\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n $csv_headers[] = $manufacturer->name;\n\n $csv_second_row[] = 'Data Count';\n $csv_second_row[] = 'Appointments';\n $csv_second_row[] = 'Response Rate';\n $csv_second_row[] = 'New';\n $csv_second_row[] = 'Used';\n $csv_second_row[] = 'Demo';\n $csv_second_row[] = '0km';\n $csv_second_row[] = 'Coversion Rate';\n $csv_second_row[] = 'In Progress';\n\n foreach($dealership->events->where('start_date','<=',$end_date)->where('end_date','>=',$start_date) as $event) {\n\n $event_ids[] = $event->id;\n\n }\n\n }\n\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n $csv_headers[] = 'Total';\n\n $csv_second_row[] = 'Data Count';\n $csv_second_row[] = 'Appointments';\n $csv_second_row[] = 'Response Rate';\n $csv_second_row[] = 'New';\n $csv_second_row[] = 'Used';\n $csv_second_row[] = 'Demo';\n $csv_second_row[] = '0km';\n $csv_second_row[] = 'Coversion Rate';\n $csv_second_row[] = 'In Progress';\n\n fputcsv($handle,$csv_headers);\n fputcsv($handle,$csv_second_row);\n\n $total_event_data = ['Total'];\n\n $events = Event::whereIn('id',$event_ids)->get();\n\n foreach($dealership->manufacturers as $dealershipManufacturer) {\n\n ${$dealershipManufacturer->name . '_total_data_count'} = 0;\n ${$dealershipManufacturer->name . '_total_appointments'} = 0;\n ${$dealershipManufacturer->name . '_total_new'} = 0;\n ${$dealershipManufacturer->name . '_total_used'} = 0;\n ${$dealershipManufacturer->name . '_total_demo'} = 0;\n ${$dealershipManufacturer->name . '_total_zero_km'} = 0;\n ${$dealershipManufacturer->name . '_total_inprogress'} = 0;\n\n }\n\n foreach($events as $event) {\n\n $event_data = [$event->name];\n\n $total_data_count = 0;\n $total_appointments = 0;\n $total_new = 0;\n $total_used = 0;\n $total_demo = 0;\n $total_zero_km = 0;\n $total_inprogress = 0;\n\n foreach($dealership->manufacturers as $dealershipManufacturer) {\n\n $manufacturer_data_count = '';\n $manufacturer_appointments = '';\n $manufacturer_response_rate = '';\n $manufacturer_new = '';\n $manufacturer_used = '';\n $manufacturer_demo = '';\n $manufacturer_zero_km = '';\n $manufacturer_conversion_rate = '';\n $manufacturer_inprogress = '';\n \n foreach($event->manufacturers as $manufacturer) {\n\n if($manufacturer->id == $dealershipManufacturer->id) {\n\n $manufacturer_data_count = $manufacturer->pivot->data_count;\n $manufacturer_appointments = $manufacturer->pivot->appointments;\n $manufacturer_response_rate = number_format($manufacturer->pivot->appointments/$manufacturer->pivot->data_count * 100, 2, '.', ',');\n $manufacturer_new = $manufacturer->pivot->new;\n $manufacturer_used = $manufacturer->pivot->used;\n $manufacturer_demo = $manufacturer->pivot->demo;\n $manufacturer_zero_km = $manufacturer->pivot->zero_km;\n $manufacturer_conversion_rate = number_format(($manufacturer->pivot->new + $manufacturer->pivot->used + $manufacturer->pivot->demo + $manufacturer->pivot->zero_km)/$manufacturer->pivot->appointments * 100, 2, '.', ',');\n $manufacturer_inprogress = $manufacturer->pivot->inprogress;\n\n ${$dealershipManufacturer->name . '_total_data_count'} += $manufacturer->pivot->data_count;\n ${$dealershipManufacturer->name . '_total_appointments'} += $manufacturer->pivot->appointments;\n ${$dealershipManufacturer->name . '_total_new'} += $manufacturer->pivot->new;\n ${$dealershipManufacturer->name . '_total_used'} += $manufacturer->pivot->used;\n ${$dealershipManufacturer->name . '_total_demo'} += $manufacturer->pivot->demo;\n ${$dealershipManufacturer->name . '_total_zero_km'} += $manufacturer->pivot->zero_km;\n ${$dealershipManufacturer->name . '_total_inprogress'} += $manufacturer->pivot->inprogress;\n\n }\n\n }\n\n $event_data[] = $manufacturer_data_count;\n $event_data[] = $manufacturer_appointments;\n if($manufacturer_response_rate > 0) {\n $event_data[] = $manufacturer_response_rate . '%';\n }\n else {\n $event_data[] = '';\n }\n $event_data[] = $manufacturer_new;\n $event_data[] = $manufacturer_used;\n $event_data[] = $manufacturer_demo;\n $event_data[] = $manufacturer_zero_km;\n if($manufacturer_conversion_rate > 0) {\n $event_data[] = $manufacturer_conversion_rate . '%';\n }\n else {\n $event_data[] = '';\n }\n $event_data[] = $manufacturer_inprogress;\n\n if(is_numeric($manufacturer_data_count)) {\n $total_data_count += $manufacturer_data_count;\n }\n\n if(is_numeric($manufacturer_appointments)) {\n $total_appointments += $manufacturer_appointments;\n }\n\n if(is_numeric($manufacturer_new)) {\n $total_new += $manufacturer_new;\n }\n\n if(is_numeric($manufacturer_used)) {\n $total_used += $manufacturer_used;\n }\n\n if(is_numeric($manufacturer_demo)) {\n $total_demo += $manufacturer_demo;\n }\n\n if(is_numeric($manufacturer_zero_km)) {\n $total_zero_km += $manufacturer_zero_km;\n }\n\n if(is_numeric($manufacturer_inprogress)) {\n $total_inprogress += $manufacturer_inprogress;\n }\n\n }\n\n $event_data[] = $total_data_count;\n $event_data[] = $total_appointments;\n if($total_data_count > 0) {\n $event_data[] = number_format($total_appointments/$total_data_count * 100, 2, '.', ',') . '%';\n }\n else {\n $event_data[] = '';\n }\n $event_data[] = $total_new;\n $event_data[] = $total_used;\n $event_data[] = $total_demo;\n $event_data[] = $total_zero_km;\n if($total_appointments > 0) {\n $event_data[] = number_format(($total_new + $total_used + $total_demo + $total_zero_km)/$total_appointments * 100, 2, '.', ',') . '%';\n }\n else {\n $event_data[] = '';\n }\n $event_data[] = $total_inprogress;\n\n fputcsv($handle,$event_data);\n\n }\n\n $total_total_data_count = 0;\n $total_total_appointments = 0;\n $total_total_new = 0;\n $total_total_used = 0;\n $total_total_demo = 0;\n $total_total_zero_km = 0;\n $total_total_inprogress = 0;\n\n foreach($dealership->manufacturers as $dealershipManufacturer) {\n\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_data_count'};\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_appointments'};\n if(${$dealershipManufacturer->name . '_total_data_count'} > 0) {\n $total_event_data[] = number_format(${$dealershipManufacturer->name . '_total_appointments'}/${$dealershipManufacturer->name . '_total_data_count'} * 100, 2, '.', ',') . '%';\n }\n else {\n $total_event_data[] = '0%';\n }\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_new'};\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_used'};\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_demo'};\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_zero_km'};\n if(${$dealershipManufacturer->name . '_total_appointments'} > 0) {\n $total_event_data[] = number_format((${$dealershipManufacturer->name . '_total_new'} + ${$dealershipManufacturer->name . '_total_used'} + ${$dealershipManufacturer->name . '_total_demo'} + ${$dealershipManufacturer->name . '_total_zero_km'})/${$dealershipManufacturer->name . '_total_appointments'} * 100, 2, '.', ',') . '%';\n }\n else {\n $total_event_data[] = '0%';\n }\n $total_event_data[] = ${$dealershipManufacturer->name . '_total_inprogress'};\n\n $total_total_data_count += ${$dealershipManufacturer->name . '_total_data_count'};\n $total_total_appointments += ${$dealershipManufacturer->name . '_total_appointments'};\n $total_total_new += ${$dealershipManufacturer->name . '_total_new'};\n $total_total_used += ${$dealershipManufacturer->name . '_total_used'};\n $total_total_demo += ${$dealershipManufacturer->name . '_total_demo'};\n $total_total_zero_km += ${$dealershipManufacturer->name . '_total_zero_km'};\n $total_total_inprogress += ${$dealershipManufacturer->name . '_total_inprogress'};\n\n }\n\n $total_event_data[] = $total_total_data_count;\n $total_event_data[] = $total_total_appointments;\n if($total_total_data_count > 0) {\n $total_event_data[] = number_format($total_total_appointments/$total_total_data_count * 100, 2, '.', ',') . '%';\n }\n else {\n $total_event_data[] = '0%';\n }\n $total_event_data[] = $total_total_new;\n $total_event_data[] = $total_total_used;\n $total_event_data[] = $total_total_demo;\n $total_event_data[] = $total_total_zero_km;\n if($total_total_appointments > 0) {\n $total_event_data[] = number_format(($total_total_new + $total_total_used + $total_total_demo + $total_total_zero_km)/$total_total_appointments * 100, 2, '.', ',') . '%';\n }\n else {\n $total_event_data[] = '0%';\n }\n $total_event_data[] = $total_total_inprogress;\n\n fputcsv($handle,$total_event_data);\n\n fclose($handle);\n\n $headers = array(\n 'Content-Type' => 'text/csv; charset=UTF-8',\n 'Content-Encoding' => 'UTF-8'\n );\n\n return response()->download('csv/' . $filename, $filename, $headers);\n\n }", "public function feedbacks()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$this->left_menu\t=\t16;\r\n\t\t\t$this->data['breadcrumb'] = array(addslashes(t('Feedback Received'))=>'');\t\r\n\t\t\tob_start();\t\t\t\t\r\n\t\t\t//$id = $this->data['loggedin']['user_id'];\t\t\t \r\n\t\t\t$this->ajax_pagination_feedback_list();\r\n\t\t\t$contents = ob_get_contents();\r\n\t\t\tob_end_clean();\r\n\t\t\t\r\n\t\t\t$info = $this->mod_td->fetch_tradesman_details(decrypt($id));\r\n\t\t\t$this->data['profile_info'] = $info;\r\n\t\t\t$this->data['feedback_contents'] = $contents;\r\n\t\t\t\t\r\n\t\t\t$this->render();\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(Exeception $e)\r\n\t\t{\r\n\t\t\tshow_error($e->getMessage());\r\n\t\t}\r\n }", "public function savefile()\r\n {\r\n $id_epreuve = $_GET['id'];\r\n $handle = fopen($_FILES[\"results\"][\"tmp_name\"],\"r\");\r\n $ep = new epreuveparticipation();\r\n\r\n while ($data = fgetcsv($handle,1000,\",\",\"'\"))\r\n {\r\n foreach ($data as $value) {\r\n $explode = explode(';', $value);\r\n $id_inscription = $ep->getInscriptionFromDossad($id_epreuve,$explode[1]);\r\n $ep->action = \"update\";\r\n $ep->id_inscription = $id_inscription;\r\n $ep->id_epreuve = $id_epreuve;\r\n $ep->classement = $explode[0];\r\n $ep->num_dossard = $explode[1];\r\n $ep->score = $explode[2];\r\n $saved = $ep->save();\r\n }\r\n }\r\n if($saved)\r\n {\r\n $ov = new OrganisationView($ep);\r\n $ov->render('fileuploaded');\r\n }\r\n }", "public function ajax_bulk_upload_feedback() {\r\n // $maxFileSize = 1000000; // Set max upload file size [1MB]\r\n $maxFileSize = 2097152; // Set max upload file size [2MB]\r\n $validext = array('xls', 'xlsx', 'csv'); // Allowed Extensions\r\n $Upload_CSV_ID = time(); // ID as Current time\r\n\r\n // checking user is inserted any file or not\r\n if (isset($_FILES['upload_csv']['name']) && !empty($_FILES['upload_csv']['name'])) {\r\n\r\n $fileSize = filesize($_FILES['upload_csv']['tmp_name']); // uploaded file size\r\n // echo print_r($fileSize); exit();\r\n\r\n // checking inserted file size in not greater then declared ($maxFileSize) size \r\n if ($fileSize < $maxFileSize) {\r\n $explode_filename = explode(\".\", $_FILES['upload_csv']['name']); // uploaded file extension\r\n $ext = strtolower(end($explode_filename));\r\n // echo $ext.\"\\n\";\r\n\r\n // checking user is uploading valid file extension and size or not \r\n if (in_array($ext, $validext)) {\r\n try {\r\n $file = $_FILES['upload_csv']['tmp_name'];\r\n $handle = fopen($file, \"r\");\r\n $not_Inserted_Name = array(); // array of not imported data\r\n $c = 0; // count of all imported data\r\n $flag = true;\r\n\r\n // setting file data to read mode\r\n $fileStructure = fgetcsv($handle, 1000, \",\");\r\n if (!empty($fileStructure[0])) {\r\n\r\n while (($filesop = fgetcsv($handle, 1000, \",\")) !== false) {\r\n if ($flag) {\r\n $flag = false;\r\n continue;\r\n }\r\n\r\n // echo print_r($filesop); exit();\r\n\r\n if (!empty($filesop)) {\r\n // Setting User Data\r\n $userData = array(\r\n \"fullName\" => $filesop[1],\r\n \"Email\" => $filesop[2],\r\n \"ProfilePic\" => '',\r\n \"Mobile\" => $filesop[3]\r\n );\r\n $userDataJSON = json_encode($userData);\r\n\r\n // Setting to inserting new records\r\n $arrayRecord = array(\r\n 'Feedback_userid' => $filesop[0],\r\n 'Feedback_userData' => $userDataJSON,\r\n 'Feedback_rating' => $filesop[4],\r\n 'Feedback_title' => $filesop[5],\r\n 'Feedback_message' => $filesop[6],\r\n 'Feedback_createdOn' => date('Y-m-d H:i:s', time()),\r\n );\r\n\r\n // adding new Feedback Details\r\n $result = $this->Common_Model->insert(\"GAME_FEEDBACK\", $arrayRecord, '');\r\n $c++;\r\n }\r\n }\r\n\r\n // echo $c;\r\n if (!empty($not_Inserted_Name)) {\r\n // showing all Not imported Campus Name as msg\r\n $msg = \"</br><p class='text-danger'><br />Not imported Records:- \" . count($not_Inserted_Name) . \" <br /> Records Name:-<br />\" . implode(\" , \", $not_Inserted_Name) . \"</p>\";\r\n }\r\n else {\r\n $msg = \"\";\r\n }\r\n\r\n $result = array(\r\n //\"msg\" => \"Import successful. You have imported \".$c.\" Records.\".$msg,\r\n \"msg\" => \"You have imported \" . $c . \" Records.\" . $msg,\r\n \"status\" => 1\r\n );\r\n }\r\n else {\r\n $result = array(\r\n \"msg\" => \"Please select a file with given format to import\",\r\n \"status\" => 0\r\n );\r\n }\r\n }\r\n catch (Exception $e) {\r\n $result = array(\r\n \"msg\" => \"Error: \" . $e,\r\n \"status\" => 0\r\n );\r\n }\r\n }\r\n else {\r\n $result = array(\r\n \"msg\" => \"Please select a valid file with extension(xls, xlsx, csv) to import\",\r\n \"status\" => 0\r\n );\r\n }\r\n }\r\n else {\r\n $result = array(\r\n \"msg\" => \"File size is longer then 2 MB\",\r\n \"status\" => 0\r\n );\r\n }\r\n }\r\n else {\r\n $result = array(\r\n \"msg\" => \"Please select a file to import\",\r\n \"status\" => 0\r\n );\r\n }\r\n\r\n echo json_encode($result);\r\n }", "public function actionDownloadcsv()\n\t{\n\t\t$session = \\Yii::$app->session;\n\t\tif (\\Yii::$app->SessionCheck->isLogged () == true) \t\t// checking logged session\n\t\t{\n\t\t\t$result = array();\n\t\t\t$post_details = yii::$app->request->post();\n\t\t\t$transaction = \\Yii::$app->db->beginTransaction (); // begining the transaction\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\tif(!empty($post_details['form_id']))\n\t\t\t\t{\n\t\t\t\t\t$form_id = $post_details['form_id'];\n\t\t\t\t\t$model_companies = new TblAcaCompanies ();\n\t\t\t\t\t\n\t\t\t\t\t$check_file = TblAcaForms::find()->select('csv_file')->where(['id'=>$form_id])->One();\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($check_file))\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tif(empty($check_file->csv_file))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthrow new \\Exception ( 'Csv creation is in process. Please come back after some time');\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t}else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$result['success'] = 'Downloading...';\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\tthrow new \\Exception ( 'Invalid form selected');\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\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception ( 'No value posted');\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t} catch ( \\Exception $e ) { // any \\Exceptions catch throws error msg\n\t\t\t\t$msg = $e->getMessage ();\n\t\t\t\n\t\t\t\t$result['error'] = $msg;\n\t\t\t\t$transaction->rollback();\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn (json_encode($result));\n\t\t\t\n\t\t} else {\n\t\t\t\\Yii::$app->SessionCheck->adminlogout (); // Redirecting to home page if session destroyed\n\t\t\t\n\t\t\treturn $this->goHome ();\n\t\t}\n\t\t\n\t}", "public function get_csv()\n { \n $response_data = $this->getAPIResponse();\n $response = json_decode($response_data['data']);\n $records = $this->toArray($response);\n $split = $this->getSplittedUsers($records);\n $csv_html = '';\n $csv_html .= \"<br><span class='csv_users_headings'>Engineers CSV Data</span><br>\";\n $csv_html .= $this->makeHTMLCsv($response_data['engineers_fields'],$split['engineers']); \n $csv_html .= \"<br><span class='csv_users_headings'>Internal CSV Data</span><br>\";\n $csv_html .= $this->makeHTMLCsv($response_data['internal_fields'],$split['internal']); \n $csv_html .= \"<br><span class='csv_users_headings'>External CSV Data</span><br>\";\n $csv_html .= $this->makeHTMLCsv($response_data['external_fields'],$split['external']); \n echo $csv_html;\n }", "function booksDetailsCsv()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $school_id = $this->input->post('school_id');\n\n $students = $this->student_model->studentsListingByAttribute('School', $school_id);\n\n if ($students & !empty($students)) {\n $file = fopen(\"assets/students/students_data_sheet.csv\", \"w\");\n\n if ($file) {\n $header = array('SR. No.', 'Roll Number', 'NAME OF STUDENT', 'CLASS', 'SCI.', 'SB', 'MATH', 'MB', 'ENG', 'EB', 'GK', 'GB', 'COM.','CB', 'BIO.', 'BB');\n \n fputcsv($file, $header);\n\n $i = 1;\n foreach ($students as $student) {\n $line = array($i, $student->roll_number, $student->name, $student->class, 1, '', '', '', '', '', '', '', '','', '', '');\n fputcsv($file, $line);\n $i++;\n }\n echo '200';\n exit;\n } else {\n echo '400';\n exit;\n }\n }\n echo '400';\n exit;\n }\n }", "public function csv_conversions()\r\n\t{\r\n\t\t// Create data for CSV with headers\r\n\t\t$data = $this->csv_format('ID');\r\n\t\t$data .= $this->csv_format('User');\r\n\t\t$data .= $this->csv_format('Coinbase Code');\r\n\t\t$data .= $this->csv_format('BTC Out');\r\n\t\t$data .= $this->csv_format('USD In');\r\n\t\t$data .= $this->csv_format('Site Fee');\r\n\t\t$data .= $this->csv_format('Payout Date');\r\n\t\t$data .= $this->csv_format('Created');\r\n\t\t$data .= $this->_newline;\r\n\r\n\t\t// Get items\r\n\t\t$conversions = $this->stats_model->get_conversions();\r\n\r\n\t\tforeach ($conversions as $conversion)\r\n\t\t{\r\n\t\t\t$data .= $this->csv_format($conversion->conversion_id);\r\n\t\t\t$data .= $this->csv_format($conversion->display_name ? $conversion->display_name : 'User # ' . $conversion->user_id);\r\n\t\t\t$data .= $this->csv_format($conversion->cb_code);\r\n\t\t\t$data .= $this->csv_format('B' . $conversion->btc_out);\r\n\t\t\t$data .= $this->csv_format('$' . $conversion->usd_in);\r\n\t\t\t$data .= $this->csv_format('$' . $conversion->site_fee);\r\n\t\t\t$data .= $this->csv_format($conversion->payout_date ? date('Y-m-d H:i:s', $conversion->payout_date) : '');\r\n\t\t\t$data .= $this->csv_format(date('Y-m-d H:i:s', $conversion->created));\r\n\t\t\t$data .= $this->_newline;\r\n\t\t}\r\n\r\n\t\tforce_download('conversions-' . time() . '.csv', $data);\r\n\t}", "public function downloadCsvAction()\n {\n \t/**\n\t * @var \\DDD\\Service\\Booking\\BookingManagement $bookingManagementService\n \t * @var \\DDD\\Service\\Booking\\BookingTicket $bookingTicketService\n * @var GeoliteCountry $geoliteCountryService\n\t * @var BookingExportRow[]|\\ArrayObject $reservations\n\t */\n \t$bookingManagementService = $this->getServiceLocator()->get('service_booking_management');\n $bookingTicketService = $this->getServiceLocator()->get('service_booking_booking_ticket');\n $geoliteCountryService = $this->getServiceLocator()->get('service_geolite_country');\n\n \t// getting query parameters\n \t$queryParams = $this->params()->fromQuery();\n\n \t// get reservations data\n \t$reservations = $bookingManagementService->getReservationsToExport(null, null, $queryParams);\n $filteredArray = [];\n\n\t \t$currencyDao = $this->getServiceLocator()->get('dao_currency_currency');\n\n $currencyUtility = new Currency($currencyDao);\n\n \tforeach ($reservations as $reservation) {\n $isBlacklist = $reservation->isBlacklist();\n $isBlacklist = is_null($isBlacklist) ? 'No' : 'Yes';\n\n $sumAndBalanc = $bookingTicketService->getSumAndBalanc($reservation->getId());\n $filteredArray[] = [\n \"Reservation\" => $reservation->getReservationNumber(),\n \"Affiliate ID\" => $reservation->getAffiliateID(),\n \"Affiliate Name\" => $reservation->getPartnerName(),\n \"Affiliate Reference\" => $reservation->getPartnerRef(),\n \"Status\" => $reservation->getStatus(),\n \"Blacklist\" => $isBlacklist,\n \"Apartel\" => $reservation->getApartel(),\n \"Booking Date\" => date('Y-m-d', strtotime($reservation->getReservationDate())),\n \"Booking Time\" => date('H:i:s', strtotime($reservation->getReservationDate())),\n \"Apartment Id\" => $reservation->getApartmentIdAssigned(),\n \"Apartment Name\" => $reservation->getProductName(),\n \"Apartment Building\" => $reservation->getApartmentBuilding(),\n \"Apartment City\" => $reservation->getApartmentCity(),\n \"Guest\" => $reservation->getGuestFullName(),\n \"Country\" => $reservation->getCountry_name(),\n \"City\" => $reservation->getGuestCityName(),\n \"IP\" => $geoliteCountryService->composeIPAndCountryNameString($reservation->getIP()),\n \"Arrival Date\" => $reservation->getArrivalDate(),\n \"Departure Date\" => $reservation->getDepartureDate(),\n \"Nights\" => Helper::getDaysFromTwoDate($reservation->getArrivalDate(), $reservation->getDepartureDate()),\n \"PAX\" => $reservation->getPAX(),\n \"Rate\" => $reservation->getRateName(),\n \"Base Price (EUR)\" => $currencyUtility->convert(str_replace(',', '', $reservation->getPrice()), $reservation->getApartmentCurrencyCode(), 'EUR'),\n\n \"Base Currency\" => $reservation->getApartmentCurrencyCode(),\n \"Base Price\" => $reservation->getPrice(),\n\n \"Charges(Ginosi)\" => $sumAndBalanc['ginosiCollectChargesSummaryInApartmentCurrency'],\n \"Transactions(Ginosi)\" => $sumAndBalanc['ginosiCollectTransactionsSummaryInApartmentCurrency'],\n \"Balance\" => $reservation->getGuestBalance(),\n\n \"Charges(Partner)\" => $sumAndBalanc['partnerCollectChargesSummaryInApartmentCurrency'],\n \"Transactions(Partner)\" => $sumAndBalanc['partnerCollectTransactionsSummaryInApartmentCurrency'],\n \"Partner Balance\" => $reservation->getPartnerBalance(),\n\n \"No Collection\" => $reservation->getNo_collection(),\n\t\t\t \"Review Score\" => $reservation->getReviewScore(),\n\t\t\t \"Like\" => $reservation->getLike(),\n\t\t\t \"Dislike\" => $reservation->getDislike(),\n \t\t\t\"Actual Arrival Date\" => $reservation->getActualArrivalDate(),\n \t\t\t\"Actual Departure Date\" => $reservation->getActualDepartureDate(),\n \t\t];\n \t}\n\n \tif (count($filteredArray)) {\n \t\t$response = $this->getResponse();\n \t\t$headers = $response->getHeaders();\n\n \t\t$utilityCsvGenerator = new CsvGenerator();\n \t\t$filename = 'reservations_' . str_replace(' ', '_', date('Y-m-d')) . '.csv';\n $utilityCsvGenerator->setDownloadHeaders($headers, $filename);\n\n \t\t$csv = $utilityCsvGenerator->generateCsv($filteredArray);\n\n \t\t$response->setContent($csv);\n\n \t\treturn $response;\n \t} else {\n \t\tHelper::setFlashMessage(['notice' => 'The search results were empty, nothing to download.']);\n\n \t\t$url = $this->getRequest()->getHeader('Referer')->getUri();\n \t\t$this->redirect()->toUrl($url);\n \t}\n }", "function buildCsv() {\n\t\tglobal $LANG;\n\t\t$strFilepath = PATH_site . 'typo3temp/' . $this->arrModParameters['filename'];\n\t\tt3lib_div::unlink_tempfile($strFilepath);\n\t\tif ($this->fileHandle = fopen($strFilepath,'ab')) {\n\t\t\t$this->getSeparator();\n\t\t\t$this->getCodingFormat();\n\t\t\t$this->getBlankAnswersProcessing();\n\t\t\t$arrError['column'] = $this->writeCsvColumnNames();\n\t\t\t$arrError['result'] = $this->writeCsvResult();\n\t\t\t$arrError['close'] = fclose($this->fileHandle);\n\t\t\tt3lib_div::fixPermissions($strFilepath);\n\t\t\tif (!in_array(FALSE,$arrError)) {\n\t\t\t\theader('Pragma: public');\n\t\t\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\t\t\theader('Expires: 0');\n\t\t\t\theader('Content-Disposition: attachment; filename='.$this->arrModParameters['filename'].'');\n\t\t\t\theader('Content-type: x-application/octet-stream');\n\t\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t\t\theader('Content-length:'.filesize($strFilepath).'');\n\t\t\t\t$arrError['read'] = readfile($strFilepath);\n\t\t\t\tif ($arrError['read']) {\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$arrOutput[] = $LANG->getLL('error_fileopen');\n\t\t}\n\t\tforeach ($arrError as $strKey => $strValue) {\n\t\t\tif (!$strValue) {\n\t\t\t\t$this->arrError['error_file'.$strKey] = $LANG->getLL('error_file'.$strKey);\n\t\t\t}\n\t\t}\n\t}", "public function Customer_CSVAction()\n {\n Mage::log(\"Entry Knolseed_Engage_Adminhtml_EngageController::Customer_CSVAction()\",null,'knolseed.log'); \n\n ob_start();\n\n $customer_csv_time = Mage::getStoreConfig('engage_options/customer/cron_time');\n\n $path = Mage::getBaseDir(); # if you want to add new folder for csv files just add name of folder in dir with single quote.\n $customer_enable_flag = Mage::getStoreConfig('engage_options/customer/status');\n if($customer_enable_flag == 1){\n $customervalues = Mage::getModel('engage/customervalues')->toOptionArray();\n\n $new_cust_array = array();\n\n foreach ($customervalues AS $key => $value) {\n $new_cust_array[] = $value['value'];\n }\n\n $customervaluescount = count($new_cust_array);\n\n $fp = fopen($path.\"/Customer_Attributes_\".date(\"m-d-y-g-i-a\").\".csv\", 'x+') or die(Mage::log(\"file opening error!!\"));\n\n $headers = \"\";\n $headers = \" Customer Id ,\".implode(\",\", array_map('trim',$new_cust_array)).\"\\n\";\n fwrite($fp,$headers);\n $model = Mage::getModel('customer/customer'); //getting product model\n $collection = $model->getCollection(); //products collection\n $attribute_values = \"\";\n\n foreach ($collection as $customers) //loop for getting products\n { \n $customer = Mage::getModel('customer/customer')->load($customers->getId()); \n $attributes = $customer->getAttributes();\n \n $attribute_values .= '\"'.$customer->getId().'\",';\n \n foreach( $new_cust_array as $key => $vals )\n { \n $attributeValue = $customer->getData( $vals ) ;\n \n if( $vals == \"default_billing\" || $vals == \"default_shipping\" ) {\n \n $address = Mage::getModel('customer/address')->load($attributeValue);\n $htmlAddress = $address->format('html');\n $string = (string)$htmlAddress;\n $string = ereg_replace(\"[ \\t\\n\\r]+\", \"\", $string);\n $string= str_replace(array('<br/>', ',', '<br />'), ' ', $string);\n $attribute_values .='\"'.str_replace('\"','\\\"',$string).'\",';\n\n } else {\n\n $string = ereg_replace(\"[ \\t\\n\\r]+\", \"\", $attributeValue);\n\n $string=str_replace('\"','\\\"',$string);\n $attribute_values .= '\"'.str_replace(array('<br/>', ',', '<br />'), ' ', $string).'\",';\n }\n \n }\n $attribute_values .= \"\\n\";\n }\n \n fwrite($fp,$attribute_values);\n fclose($fp); \n\n $filepath = $path.\"/Customer_Attributes_\".date(\"m-d-y-g-i-a\").\".csv\";\n $this->getResponse ()\n ->setHttpResponseCode ( 200 )\n ->setHeader ( 'Pragma', 'public', true )\n ->setHeader ( 'Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true )\n ->setHeader ( 'Content-type', 'application/force-download' )\n ->setHeader ( 'Content-Length', filesize($filepath) )\n ->setHeader ('Content-Disposition', '' . '; filename=' . basename($filepath) );\n $this->getResponse ()->clearBody ();\n $this->getResponse ()->sendHeaders ();\n readfile ( $filepath );\n #unlink($filepath);\n }else{\n $url = Mage::helper(\"adminhtml\")->getUrl(\"adminhtml/system_config/edit/section/engage_options/\");\n header(\"Location: \".$url);\n ob_end_flush();\n } \n\n }", "function downloadOrdersSummaryCSV(){\n $export_from = date('d-m-Y'); //'25-01-2019'; \n $export_to = date('d-m-Y'); //'25-01-2019'; \n //date('d-m-Y');\n\n //$export_from = '2-07-2019'; \n //$export_to = '2-07-2019'; \n\n $VendorData = $this->Model->getVendorData();\n foreach ($VendorData as $VenData){ \n $vendor_id=$VenData['id'];\n\n $filename = 'Dailywale_Summary_'.date('d-m-Y').\"_\".$vendor_id.'.csv'; \n $usersData = $this->Model->getUserDetailsData($export_from, $export_to,$vendor_id);\n\n $countNumber=count($usersData);\n if($countNumber!=0){\n\n $file = fopen('php://output', 'w');\n $delimiter = \",\";\n $csv = \"Item Name,Quanity,Item Quantity Desc,Seller Name \\n\";\n foreach ($usersData as $line){ \n $csv .= $line['item_name'] . ',' . $line['total']. ',' . $line['item_quantity_desc']. ',' . $line['name']. ',' . \"\\n\";\n }\n fwrite($file, $csv); \n $path=$_SERVER[\"DOCUMENT_ROOT\"];\n file_put_contents($path.\"/dailywaleAdmin/download_csv/order_summary/\" . $filename, $csv);\n fclose($file);\n\n $this->sendOrderSummaryMail($vendor_id,$filename);\n }\n }\n\n }", "public function export_log_files(){\r\n\t\t// $rslt = array();\r\n\r\n\t\t$log_id = $_POST['log_id'];\r\n\t\t$act = $_POST['act'];\r\n\t\t$date = date(\"YmdHis\", strtotime($_POST['date']));\r\n\t\t$post_type = $_POST['post_type'];\r\n\t\t$post_id = $_POST['post_id'];\r\n\r\n\t\t$filename = $post_type.'-files-log-'.$date.'.csv';\r\n\r\n\t\t$upload_path = wp_upload_dir()['basedir'].'/';\r\n\t\t$full_path = $upload_path.$filename;\r\n\r\n\t\t$fp = fopen($full_path, 'w');\r\n\t\t$log_files = $this->MD_Model->get_log_files($log_id);\r\n\t\t$total = count($log_files);\r\n\t\tfputcsv($fp, array('Date', date(\"Y-m-d H:i:s\", strtotime($date))));\r\n\t\tif($post_type == 'market-data'){\r\n\t\t\t$expected_data = get_field('expected_data', $post_id);\r\n\t\t\t$expected = ($expected_data) ? $expected_data : 'N/A';\r\n\t\t\tfputcsv($fp, array('Expected Data', '=\"' . $expected . '\"'));\r\n\t\t}\r\n\t\t\r\n\t\tfputcsv($fp, array('Actual Data', '=\"' . $total . '\"'));\r\n\t\tfputcsv($fp, array('Activity', $act));\r\n\t\tfputcsv($fp, array('', ''));\r\n\t\tfputcsv($fp, array('Filename', 'Date Uploaded', 'Target Date', 'File size'));\r\n\r\n\t\tforeach ($log_files as $log_file) {\r\n\t\t\t$row = array($log_file['filename'], $log_file['date_uploaded'], $log_file['target_date'], convert_filesize($log_file['file_size']));\r\n\t\t \r\n\t\t fputcsv($fp, $row);\r\n\t\t}\r\n\r\n\t\tfclose($fp);\r\n\r\n\t\techo base64_encode($full_path);\r\n\t\twp_die();\r\n\t\t\r\n\t}", "public function lstFeedback(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\tfeedback_id,\r\n\t\t\t\t\tcustomer_id,\r\n\t\t\t\t\tfdb_name,\r\n\t\t\t\t\tfdb_email,\r\n\t\t\t\t\tfdb_subject,\r\n\t\t\t\t\tfdb_message_type,\r\n\t\t\t\t\tfdb_message_box,\r\n\t\t\t\t\tfdb_date,\r\n\t\t\t\t\tfdb_status\r\n\t\t\t\tFROM\r\n\t\t\t\t\trs_tbl_feedback\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\tif($this->isPropertySet(\"feedback_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND feedback_id=\" . $this->getProperty(\"feedback_id\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"fdb_message_type\", \"V\"))\r\n\t\t\t$Sql .= \" AND fdb_message_type=\" . $this->getProperty(\"fdb_message_type\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"fdb_status\", \"V\"))\r\n\t\t\t$Sql .= \" AND fdb_status=\" . $this->getProperty(\"fdb_status\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"GROUPBY\", \"V\"))\r\n\t\t\t$Sql .= \" GROUP BY \" . $this->getProperty(\"GROUPBY\");\r\n\t\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}", "public function lstFeedback(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\tfeedback_id,\r\n\t\t\t\t\tcustomer_id,\r\n\t\t\t\t\tfdb_name,\r\n\t\t\t\t\tfdb_email,\r\n\t\t\t\t\tfdb_subject,\r\n\t\t\t\t\tfdb_message_type,\r\n\t\t\t\t\tfdb_message_box,\r\n\t\t\t\t\tfdb_date,\r\n\t\t\t\t\tfdb_status\r\n\t\t\t\tFROM\r\n\t\t\t\t\trs_tbl_feedback\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\tif($this->isPropertySet(\"feedback_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND feedback_id=\" . $this->getProperty(\"feedback_id\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"fdb_message_type\", \"V\"))\r\n\t\t\t$Sql .= \" AND fdb_message_type=\" . $this->getProperty(\"fdb_message_type\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"fdb_status\", \"V\"))\r\n\t\t\t$Sql .= \" AND fdb_status=\" . $this->getProperty(\"fdb_status\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"GROUPBY\", \"V\"))\r\n\t\t\t$Sql .= \" GROUP BY \" . $this->getProperty(\"GROUPBY\");\r\n\t\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}", "public function actionGeneratecsv(){\n\t//\tini_set('memory_limit', '-1');\n\t\tini_set ( 'memory_limit', '1024M' );\n\t\tini_set ( 'max_execution_time', 3600 );\n\t\tini_set ( 'max_input_time', 3600 );\n\t\t/**\n\t\t\t * *************** initialising variables****************\n\t\t*/\n\t\t\n \t$name_of_employer_1 = '';\n \t$name_of_employer_2 = '';\n \t$street_address_1='';\n \t$street_address_2='';\n \t$city='';\n \t$state='';\n $ssnumber='';\n \t$zip_ext='';\n \t$phone_ext='';\n \t$employeezipext = '';\n \t$employeeemail = '';\n \t$miscsearch = '';\n\t\t$planstartmonth='';\n\t\t$employeeemail='';\n\t\t$employeezip='';\n\t\t$employeestate='';\n\t\t$employeecity='';\n\t\t$employeeaddress2='';\n\t\t$employeeaddress1='';\n\t\t$lastname='';\n\t\t$middlename='';\n\t\t$firstname='';\n\t\t$employeelastname='';\n\t\t$employeemiddlename='';\n\t\t$employeefirstname='';\n\t\t$ssn='';\n\t\t$ein='';\n\t\t$phone_ext='';\n\t\t$phone_number='';\n\t\t$zip_ext='';\n\t\t$zip_code='';\n\t\t$state='';\n\t\t$city='';\n\t\t$street_address_2='';\n\t\t$street_address_1='';\n\t\t$name_of_employer_2='';\n\t\t$name_of_employer_1='';\n \t\n\t\t\n \t$arrayPart1 = array();\n \t$arrOffercoverage =array();\n \t$arrEmployeeshare =array();\n \t$arrSafehabour =array();\n \t$arrCoveredindividual =array();\n\t\t$array = array();\n\t\n\t\ttry{\n\t\t/**\n\t\t\t * *************** getting approved forms****************\n\t\t*/\n \t$model_acaforms = TblAcaForms::find()->select('id,company_id')->where(['is_approved'=>1])->andWhere(['csv_file'=>NULL])->All();\t\n \t\n \n \tforeach($model_acaforms as $forms){ \n \t\t\n\t\t\t/**\n\t\t\t * *************** getting all the forms with this form id****************\n\t \t*/\n \t\t$model_1095c = TblAca1095::find()->where(['form_id'=>$forms->id])->all();\n\t\t \n\t\t\tif(!empty($model_1095c)){\n\t\t\t\t$company_id = $forms->company_id;\n\t\t\t\tforeach($model_1095c as $form){\n\t\t\t\t\t\n\t\t\t\t\t$serialised_data_1 = $form->serialise_data1;\n\t\t\t\t\t$serialised_data_2 = $form->serialise_data2;\n\t\t\t\t\t$serialised_data_3 = $form->serialise_data3;\n\t\t\t\t\t$serialised_data_xml = $form->xml_data;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//part 1\n\t\t\t\t\tif(!empty($serialised_data_1)){\n\t\t\t\t\t\t$unserialise_data_part1 = unserialize ( $serialised_data_1 );\n\t\t\t\t\t\t$part1 = json_decode ( $unserialise_data_part1 );\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$part1 = array();\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//part 2\n\t\t\t\t\tif(!empty($serialised_data_2)){\n\t\t\t\t\t\t$unserialise_data_part2 = unserialize ( $serialised_data_2 );\n\t\t\t\t\t\t$part2 = json_decode ( $unserialise_data_part2 );\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$part2 = array();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t//part 3\n\t\t\t\t\tif(!empty($serialised_data_3)){\n\t\t\t\t\t\t$unserialise_data_part3 = unserialize ( $serialised_data_3 );\n\t\t\t\t\t\t$part3 = json_decode ( $unserialise_data_part3 );\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$part3 = array();\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//part xml \n\t\t\t\t\tif(!empty($serialised_data_xml)){\n\t\t\t\t\t\t$unserialise_data_part_xml = unserialize ( $serialised_data_xml );\n\t\t\t\t\t\t$partxml = json_decode ( $unserialise_data_part_xml );\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$partxml = array();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($partxml))\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_part4 = (array)$partxml;\n\t\t\t\t\t}\n\t\t\t\t\t//getting employer_name\n\t\t\t\t\tif(!empty($part1->employer_name__I)){\n\t\t\t\t\t\t$name_of_employer_1 = $part1->employer_name__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting street_address\n\t\t\t\t\tif(!empty($partxml->street_address_1__9)){\n\t\t\t\t\t\t$street_address_1 = $partxml->street_address_1__9;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting street_address\n\t\t\t\t\tif(!empty($partxml->street_address_2__9)){\n\t\t\t\t\t\t$street_address_2 = $partxml->street_address_2__9;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employer_city_town\n\t\t\t\t\tif(!empty($part1->employer_city_town__I)){\n\t\t\t\t\t\t$city = $part1->employer_city_town__I;\n\t\t\t\t\t}\n\t\t\t\t\t//getting employer_state_province\n\t\t\t\t\tif(!empty($part1->employer_state_province__I)){\n\t\t\t\t\t\t$state = $part1->employer_state_province__I;\n\t\t\t\t\t}\n\t\t\t\t\t//getting employer_country_and_zip\n\t\t\t\t\tif(!empty($part1->employer_country_and_zip__I)){\n\t\t\t\t\t\t$zip_code = $part1->employer_country_and_zip__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employer_contact_telephone_number__I\n\t\t\t\t\tif(!empty($part1->employer_contact_telephone_number__I)){\n\t\t\t\t\t\t$phone_number = $part1->employer_contact_telephone_number__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting ein\n\t\t\t\t\tif(!empty($part1->employer_ein__I)){\n\t\t\t\t\t\t$ein = $part1->employer_ein__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting ssn\n\t\t\t\t\tif(!empty($part1->employee_ssn__I)){\n\t\t\t\t\t\t$ssnumber = $part1->employee_ssn__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting firstname\n\t\t\t\t\tif(!empty($partxml->first_name__1)){\n\t\t\t\t\t\t$employeefirstname = $partxml->first_name__1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting middle initial\n\t\t\t\t\tif(!empty($partxml->middle_name__1)){\n\t\t\t\t\t\t$employeemiddlename = $partxml->middle_name__1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting last name\n\t\t\t\t\tif(!empty($partxml->last_name__1)){\n\t\t\t\t\t\t$employeelastname = $partxml->last_name__1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employyee address\n\t\t\t\t\tif(!empty($partxml->street_address_1__3)){\n\t\t\t\t\t\t$employeeaddress1 = $partxml->street_address_1__3;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employyee address\n\t\t\t\t\tif(!empty($partxml->street_address_2__3)){\n\t\t\t\t\t\t$employeeaddress2 = $partxml->street_address_2__3;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employyee city\n\t\t\t\t\tif(!empty($part1->employee_city_or_town__I)){\n\t\t\t\t\t\t$employeecity = $part1->employee_city_or_town__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employyee state\n\t\t\t\t\tif(!empty($part1->employee_state_province__I)){\n\t\t\t\t\t\t$employeestate = $part1->employee_state_province__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//getting employyee zip\n\t\t\t\t\tif(!empty($part1->employee_country_and_zip_code__I)){\n\t\t\t\t\t\t$employeezip = $part1->employee_country_and_zip_code__I;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//getting employyee zip\n\t\t\t\t\t\tif(!empty($part2->plan_start_month__II)){\n\t\t\t\t\t\t\t$planstartmonth = $part2->plan_start_month__II;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//getting employee line14\n\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_all_12_months__II)){\n\t\t\t\t\t\t\t$month_all12month =$part2->offer_of_coverage_all_12_months__II;\n\t\t\t\t\t\t\t$arrOffercoverage['all_12_months_offer_of_coverage']=$month_all12month;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrOffercoverage['all_12_months_offer_of_coverage']='';\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_jan__II)){\n\t\t\t\t\t\t\t\t$month_jan =$part2->offer_of_coverage_jan__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['jan_offer_of_coverage']=$month_jan;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['jan_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_feb__II)){\n\t\t\t\t\t\t\t\t$month_feb =$part2->offer_of_coverage_feb__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['feb_offer_of_coverage']=$month_feb;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['feb_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_march__II)){\n\t\t\t\t\t\t\t\t$month_mar =$part2->offer_of_coverage_march__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['mar_offer_of_coverage']=$month_mar;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['mar_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_april__II)){\n\t\t\t\t\t\t\t\t$month_apr =$part2->offer_of_coverage_april__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['apr_offer_of_coverage']=$month_apr;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['apr_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_may__II)){\n\t\t\t\t\t\t\t\t$month_may =$part2->offer_of_coverage_may__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['may_offer_of_coverage']=$month_may;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['may_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_june__II)){\n\t\t\t\t\t\t\t\t$month_jun =$part2->offer_of_coverage_june__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['jun_offer_of_coverage']=$month_jun;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['jun_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_july__II)){\n\t\t\t\t\t\t\t\t$month_jul =$part2->offer_of_coverage_july__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['jul_offer_of_coverage']=$month_jul;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['jul_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_august__II)){\n\t\t\t\t\t\t\t\t$month_aug =$part2->offer_of_coverage_august__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['aug_offer_of_coverage']=$month_aug;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['aug_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->offer_of_coverage_september__II)){\n\t\t\t\t\t\t\t\t$month_sep =$part2->offer_of_coverage_september__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['sep_offer_of_coverage']=$month_sep;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['sep_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t if(!empty($part2->offer_of_coverage_october__II)){\n\t\t\t\t\t\t\t\t$month_oct =$part2->offer_of_coverage_october__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['oct_offer_of_coverage']=$month_oct;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['oct_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t if(!empty($part2->offer_of_coverage_november__II)){\n\t\t\t\t\t\t\t\t$month_nov =$part2->offer_of_coverage_november__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['nov_offer_of_coverage']=$month_nov;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['nov_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t if(!empty($part2->offer_of_coverage_december__II)){\n\t\t\t\t\t\t\t\t$month_dec =$part2->offer_of_coverage_december__II;\n\t\t\t\t\t\t\t\t$arrOffercoverage['dec_offer_of_coverage']=$month_dec;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrOffercoverage['dec_offer_of_coverage']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//getting employee line15\n\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_all_12_months__II)){\n\t\t\t\t\t\t\t$month_all12month15 =$part2->employee_required_contributions_all_12_months__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_all_12_months']=$month_all12month15;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_all_12_months']='';\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_jan__II)){\n\t\t\t\t\t\t\t\t$month_jan15 =$part2->employee_required_contributions_jan__II;\n\t\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jan']=$month_jan15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jan']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_feb__II)){\n\t\t\t\t\t\t\t$month_feb15 =$part2->employee_required_contributions_feb__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_feb']=$month_feb15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_feb']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_march__II)){\n\t\t\t\t\t\t\t$month_mar15 =$part2->employee_required_contributions_march__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_mar']=$month_mar15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_mar']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_april__II)){\n\t\t\t\t\t\t\t$month_apr15 =$part2->employee_required_contributions_april__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_apr']=$month_apr15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_apr']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_may__II)){\n\t\t\t\t\t\t\t$month_may15 =$part2->employee_required_contributions_may__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_may']=$month_may15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_may']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_june__II)){\n\t\t\t\t\t\t\t$month_jun15 =$part2->employee_required_contributions_june__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jun']=$month_jun15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jun']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_july__II)){\n\t\t\t\t\t\t\t$month_jul15 =$part2->employee_required_contributions_july__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jul']=$month_jul15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_jul']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_august__II)){\n\t\t\t\t\t\t\t$month_aug15 =$part2->employee_required_contributions_august__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_aug']=$month_aug15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_aug']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_september__II)){\n\t\t\t\t\t\t\t$month_sep15 =$part2->employee_required_contributions_september__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_sep']=$month_sep15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_sep']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_october__II)){\n\t\t\t\t\t\t\t$month_oct15 =$part2->employee_required_contributions_october__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_oct']=$month_oct15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_oct']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_november__II)){\n\t\t\t\t\t\t\t$month_nov15 =$part2->employee_required_contributions_november__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_nov']=$month_nov15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_nov']='';\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->employee_required_contributions_december__II)){\n\t\t\t\t\t\t\t$month_dec15 =$part2->employee_required_contributions_december__II;\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_dec']=$month_dec15;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrEmployeeshare['employee_share_for_dec']='';\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\t//getting employee line16\n\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_all_12_months__II)){\n\t\t\t\t\t\t\t$month_all12month16 =$part2->section_4980h_safe_harbor_all_12_months__II;\n\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_all_12_months']=$month_all12month16;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_all_12_months']='';\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_jan__II)){\n\t\t\t\t\t\t\t\t$month_jan16 =$part2->section_4980h_safe_harbor_jan__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jan']=$month_jan16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jan']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_feb__II)){\n\t\t\t\t\t\t\t\t$month_feb16 =$part2->section_4980h_safe_harbor_feb__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_feb']=$month_feb16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_feb']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_march__II)){\n\t\t\t\t\t\t\t\t$month_mar16 =$part2->section_4980h_safe_harbor_march__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_mar']=$month_mar16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_mar']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_april__II)){\n\t\t\t\t\t\t\t\t$month_apr16 =$part2->section_4980h_safe_harbor_april__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_apr']=$month_apr16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_apr']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_may__II)){\n\t\t\t\t\t\t\t\t$month_may16 =$part2->section_4980h_safe_harbor_may__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_may']=$month_may16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_may']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_june__II)){\n\t\t\t\t\t\t\t\t$month_jun16 =$part2->section_4980h_safe_harbor_june__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jun']=$month_jun16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jun']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_july__II)){\n\t\t\t\t\t\t\t\t$month_jul16 =$part2->section_4980h_safe_harbor_july__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jul']=$month_jul16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_jul']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_august__II)){\n\t\t\t\t\t\t\t\t$month_aug16 =$part2->section_4980h_safe_harbor_august__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_aug']=$month_aug16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_aug']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_september__II)){\n\t\t\t\t\t\t\t\t$month_sep16 =$part2->section_4980h_safe_harbor_september__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_sep']=$month_sep16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_sep']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_october__II)){\n\t\t\t\t\t\t\t\t$month_oct16 =$part2->section_4980h_safe_harbor_october__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_oct']=$month_oct16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_oct']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_november__II)){\n\t\t\t\t\t\t\t\t$month_nov16 =$part2->section_4980h_safe_harbor_november__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_nov']=$month_nov16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_nov']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!empty($part2->section_4980h_safe_harbor_december__II)){\n\t\t\t\t\t\t\t\t$month_dec16 =$part2->section_4980h_safe_harbor_december__II;\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_dec']=$month_dec16;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$arrSafehabour['safe_harbor_code_for_dec']='';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * *************** for part 3 from 17 to 34****************\n\t\t\t\t\t*/\n\t\t\t\t\t\tif(!empty($part3->employer_self_insured__III) && $part3->employer_self_insured__III == '1' ){\n\t\t\t\t\t\t\t$covered_individual =$part3->employer_self_insured__III;\n\t\t\t\t\t\t\t$covered_individual_text = 'true';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor($i=17,$j=1;$i<=34;$i++,$j++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$name_of_covered_individual = 'section_2__'.$i;\n\t\t\t\t\t\t\t\tif(!empty($new_part4[$name_of_covered_individual][0]->first_name)){\n\t\t\t\t\t\t\t\t\t$firstname = trim($new_part4[$name_of_covered_individual][0]->first_name);\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['first_name(a'.$j.')']=$firstname;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['first_name(a'.$j.')']='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($new_part4[$name_of_covered_individual][0]->last_name)){\n\t\t\t\t\t\t\t\t\t$lastname = trim($new_part4[$name_of_covered_individual][0]->last_name);\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['last_name(a'.$j.')']=$lastname;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['last_name(a'.$j.')']='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($new_part4[$name_of_covered_individual][0]->middle_name)){\n\t\t\t\t\t\t\t\t\t$middlename = trim($new_part4[$name_of_covered_individual][0]->middle_name);\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['middle_initial(a'.$j.')']=$middlename;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['middle_initial(a'.$j.')']='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($new_part4[$name_of_covered_individual][0]->suffix)){\n\t\t\t\t\t\t\t\t\t$suffix = trim($new_part4[$name_of_covered_individual][0]->suffix);\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['suffix(a'.$j.')']=$suffix;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['suffix(a'.$j.')']='';\n\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$ssn = 'name_'.$i.'_ssn__III';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($part3->$ssn)){\n\t\t\t\t\t\t\t\t\t$ssn = $part3->$ssn;\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['individual_ssn(b'.$j.')']=$ssn;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['individual_ssn(b'.$j.')']='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$dob = 'name_'.$i.'_dob__III';\n\t\t\t\t\t\t\t\tif(!empty($part3->$dob)){\n\t\t\t\t\t\t\t\t\t$dob = $part3->$dob;\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['dob(c'.$j.')']=$dob;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['dob(c'.$j.')']='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$months_coverage = 'name_'.$i.'_all_12_months__III';\n\t\t\t\t\t\t\t\t$months_jan = 'name_'.$i.'_jan__III';\n\t\t\t\t\t\t\t\t$months_feb = 'name_'.$i.'_feb__III';\n\t\t\t\t\t\t\t\t$months_mar = 'name_'.$i.'_march__III';\n\t\t\t\t\t\t\t\t$months_apr = 'name_'.$i.'_april__III';\n\t\t\t\t\t\t\t\t$months_may = 'name_'.$i.'_may__III';\n\t\t\t\t\t\t\t\t$months_jun = 'name_'.$i.'_june__III';\n\t\t\t\t\t\t\t\t$months_jul = 'name_'.$i.'_july__III';\n\t\t\t\t\t\t\t\t$months_aug = 'name_'.$i.'_august__III';\n\t\t\t\t\t\t\t\t$months_sep = 'name_'.$i.'_september__III';\n\t\t\t\t\t\t\t\t$months_oct = 'name_'.$i.'_october__III';\n\t\t\t\t\t\t\t\t$months_nov = 'name_'.$i.'_november__III';\n\t\t\t\t\t\t\t\t$months_dec = 'name_'.$i.'_december__III';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($part3->$months_coverage) && $part3->$months_coverage == '1'){\n\t\t\t\t\t\t\t\t\t$month_all12month =$part3->$months_coverage;\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['covered_12_months(d'.$j.')']=$month_all12month;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$arrCoveredindividual['covered_12_months(d'.$j.')']='';\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_jan)){\n\t\t\t\t\t\t\t\t\t\t$month_jan =$part3->$months_jan;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jan(e'.$j.')']=$month_jan;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jan(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_feb)){\n\t\t\t\t\t\t\t\t\t\t$month_feb =$part3->$months_feb;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['feb(e'.$j.')']=$month_feb;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['feb(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_mar)){\n\t\t\t\t\t\t\t\t\t\t$month_mar =$part3->$months_mar;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['mar(e'.$j.')']=$month_mar;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['mar(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_apr)){\n\t\t\t\t\t\t\t\t\t\t$month_apr =$part3->$months_apr;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['apr(e'.$j.')']=$month_apr;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['apr(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_may)){\n\t\t\t\t\t\t\t\t\t\t$month_may =$part3->$months_may;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['may(e'.$j.')']=$month_may;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['may(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_jun)){\n\t\t\t\t\t\t\t\t\t\t$month_jun =$part3->$months_jun;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jun(e'.$j.')']=$month_jun;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jun(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_jul)){\n\t\t\t\t\t\t\t\t\t\t$month_jul =$part3->$months_jul;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jul(e'.$j.')']=$month_jul;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['jul(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_aug)){\n\t\t\t\t\t\t\t\t\t\t$month_aug =$part3->$months_aug;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['aug(e'.$j.')']=$month_aug;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['aug(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_sep)){\n\t\t\t\t\t\t\t\t\t\t$month_sep =$part3->$months_sep;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['sep(e'.$j.')']=$month_sep;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_oct)){\n\t\t\t\t\t\t\t\t\t\t$month_oct =$part3->$months_oct;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['oct(e'.$j.')']=$month_oct;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['oct(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_nov)){\n\t\t\t\t\t\t\t\t\t\t$month_nov =$part3->$months_nov;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['nov(e'.$j.')']=$month_nov;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['nov(e'.$j.')']='';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!empty($part3->$months_dec)){\n\t\t\t\t\t\t\t\t\t\t$month_dec =$part3->$months_dec;\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['dec(e'.$j.')']=$month_dec;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$arrCoveredindividual['dec(e'.$j.')']='';\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\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}else{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$covered_individual_text = 'false';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tfor($j=1;$j<=17;$j++){\n\t\t\t\t\t\t\t$arrCoveredindividual['first_name(a'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['suffix(a'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['middle_initial(a'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['last_name(a'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['individual_ssn(b'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['dob(c'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['covered_12_months(d'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['jan(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['feb(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['mar(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['apr(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['may(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['jun(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['jul(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['aug(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['sep(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['oct(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['nov(e'.$j.')']='';\n\t\t\t\t\t\t\t$arrCoveredindividual['dec(e'.$j.')']='';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//unset ($arrCoveredindividual);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$array1 = array(\n\t\t\t\t\t\t\t'name_of_employer_1'=>$name_of_employer_1,\n\t\t\t\t\t\t\t'name_of_employer_2'=>$name_of_employer_2,\n\t\t\t\t\t\t\t'employer_address_1'=>$street_address_1,\n\t\t\t\t\t\t\t'employer_address_2'=>$street_address_2,\n\t\t\t\t\t\t\t'employer_city'=>$city,\n\t\t\t\t\t\t\t'employer_state'=>$state,\n\t\t\t\t\t\t\t'employer_zip'=>$zip_code,\n\t\t\t\t\t\t\t'employer_zip_ext'=>$zip_ext,\n\t\t\t\t\t\t\t'contact_phone'=>$phone_number,\n\t\t\t\t\t\t\t'contact_phone_ext'=>$phone_ext,\n\t\t\t\t\t\t\t'employer_identification_number'=>$ein,\n\t\t\t\t\t\t\t'employee_social_security_number'=>$ssnumber,\n\t\t\t\t\t\t\t'employee_first_name'=>$employeefirstname,\n\t\t\t\t\t\t\t'employee_middle_initial'=>$employeemiddlename,\n\t\t\t\t\t\t\t'employee_last_name'=>$employeelastname,\n\t\t\t\t\t\t\t'employee_address_1'=>$employeeaddress1,\n\t\t\t\t\t\t\t'employee_address_2'=>$employeeaddress2,\n\t\t\t\t\t\t\t'employee_city'=>$employeecity,\n\t\t\t\t\t\t\t'employee_state'=>$employeestate,\n\t\t\t\t\t\t\t'employee_zip'=>$employeezip,\n\t\t\t\t\t\t\t'employee_zip_ext'=>$employeezipext,\n\t\t\t\t\t\t\t'employee_email'=>$employeeemail,\n\t\t\t\t\t\t\t'misc_search'=>$miscsearch,\n\t\t\t\t\t\t\t'plan_start_month'=>$planstartmonth,\n\t\t\t\t\t\t\t'covered_individual_checkbox'=>$covered_individual_text,\n\t\t\t\t\t\t\t'foreign_state_number'=>'',\n\t\t\t\t\t\t\t'foreign_postal_code'=>'',\n\t\t\t\t\t\t\t'country_code'=>'',\n\t\t\t\t\t\t\t'foreign_address_indicator'=>''\n\t\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\t$array_all = array_merge($array1,$arrOffercoverage,$arrEmployeeshare,$arrSafehabour,$arrCoveredindividual);\n\t\t\t\t\t$array[] = $array_all;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n \t \n \t\t$exporter = new CsvGrid([\n \t\t\t\t'dataProvider' => new ArrayDataProvider([\n \t\t\t\t\t\t'allModels' =>$array,\n \t\t\t\t\t\t]),\n \t\t\t\t'columns' => [\n \t\t\t\t[\n \t\t\t\t'attribute' => 'name_of_employer_1',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'name_of_employer_2',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_address_1',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_address_2',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_city',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_state',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_zip',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_zip_ext',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'contact_phone',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'contact_phone_ext',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_identification_number',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_social_security_number',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_first_name',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_middle_initial',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_last_name',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_address_1',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_address_2',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_city',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_state',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_zip',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_zip_ext',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_email',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'misc_search',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'plan_start_month',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'all_12_months_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov_offer_of_coverage',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec_offer_of_coverage',\n \t\t\t\t],\n\t\t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_all_12_months',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_jan',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_feb',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_mar',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_apr',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_may',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_jun',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_jul',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_aug',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_sep',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_oct',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_nov',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employee_share_for_dec',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_all_12_months',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_jan',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_feb',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_mar',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_apr',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_may',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_jun',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_jul',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_aug',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_sep',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_oct',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_nov',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'safe_harbor_code_for_dec',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_individual_checkbox',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e1)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e2)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e3)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e4)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e5)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e6)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e7)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e8)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e9)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e10)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e11)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e12)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e13)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e14)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e15)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e16)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'individual_ssn(b17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dob(c17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'first_name(a17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'middle_initial(a17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'last_name(a17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'suffix(a17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'covered_12_months(d17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jan(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'feb(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'mar(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'apr(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'may(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jun(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'jul(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'aug(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'sep(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'oct(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'nov(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'dec(e17)',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'employer_foreign_address_indicator',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'foreign_state_number',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'foreign_postal_code',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'country_code',\n \t\t\t\t],\n \t\t\t\t[\n \t\t\t\t'attribute' => 'foreign_address_indicator',\n \t\t\t\t],\n \t\t\t\t\n \t\t\t\t],\n \t\t\t\t]);\n\t\t\t\tunset($array);\n\t\t\t\tunset($array1);\n\t\t\t\tunset($arrOffercoverage);\n\t\t\t\tunset($arrEmployeeshare);\n\t\t\t\tunset($arrSafehabour);\n\t\t\t\tunset($arrCoveredindividual);\n\t\t\t\t\n\t\t$name='file_'.$forms->id;\n\t\t\n \t$curl=$exporter->export()->saveAs(getcwd().'/files/formcsv/'.$name.'.csv');\n\t\n\t\t$result = \\Yii::$app->Sharefile->zipaDirectory ( getcwd () . '/files/formcsv', getcwd () . '/files/csv/csv_download.zip' );\n\t\t\t\n\t\t if($result){\n \t// calling insert function for blob\t\n\t\t\t$create_data_csv = $this->insertcsvdata($forms->id);\n\t\t\n\t\t\t\tif($create_data_csv)\t{\n\t\t\t\t\texec ( 'rm -R ' . getcwd () . '/files/formcsv/'.$name.'.csv' );\n\t\t\t\t\texec ( 'rm -R ' . getcwd () . '/files/csv/csv_download.zip' );\n\t\t\t\t}\t\n\t\t }\t\n \t}\n\t\t\n\t\t} catch ( \\Exception $e ) { // catching the exception\n\t\t\t\t\n\t\t\t$msg = $e->getMessage ().' at line no '.$e->getLine();\n\t\t\t\n\t\t\t$arrerror ['error_desc'] = $msg;\n\t\t\t$arrerror ['error_type'] = 6;\n\n\t\t\tif(!empty($company_id)){\n\t\t\t\t$arrerror ['company_id'] = $company_id;\n\t\t\t}\n\t\t\t\t\n\t\t\t// Below function saves exceptions if occurs\n\t\t\t$this->Saveerrors ( $arrerror );\n\t\t}\n\t}", "public function getCsvData()\n {\n $this->setList();\n if ($this->_list && is_object($this->_list)) {\n $items = $this->_list->getItems();\n if (count($items) > 0) {\n $name = \"reports_\".time().rand();\n $file = $this->_path . '/' . $name . '.csv';\n $this->_directory->create($this->_path);\n $stream = $this->_directory->openFile($file, 'w+');\n $stream->lock();\n $stream->writeCsv($this->_getCsvHeaders($items));\n\n foreach ($items as $payment) {\n $stream->writeCsv($payment->getData());\n }\n return [\n 'type' => 'filename',\n 'value' => $file,\n 'rm' => true // can delete file after use\n ];\n }\n }\n return false;\n }", "public function downloadTexts($assignment_id){\n //Get texts from database\n $assignment_name = $this->getAssignmentName($assignment_id);\n $texts = $this->getTexts($assignment_id);\n\n //Create empty csv files with headers\n $file = \"\";\n $header = Array('student_id', 'student_name', 'text');\n $file = $file.join(';', $header).\"\\n\";\n\n //Loop through all texts\n foreach ($texts as $text => $attributes) {\n $export_row = Array();\n\n //Push student_id\n array_push($export_row, $attributes['student_id']);\n\n //Set variables\n $student_name = $this->getStudentName($attributes['student_id']);\n $firstname = $student_name['firstname'];\n $prefix = $student_name['prefix'];\n $lastname = $student_name['lastname'];\n $student_name = $this->generateNameStr($firstname, $prefix, $lastname);\n\n //Push student name\n array_push($export_row, $student_name);\n\n //Push grade\n $individual_text = $attributes['text'];\n $individual_text = str_replace('\"',\"'\",$individual_text);\n $individual_text = '\"'.$individual_text.'\"';\n array_push($export_row, $individual_text);\n\n //Write to csv\n $file = $file.join(';', $export_row).\"\\n\";\n }\n\n //Download csv file\n $filename = $assignment_name.date(\"d-m-Y_H:i:s\").'.csv';\n header('Content-type: text/csv');\n header('Content-Disposition: attachment; filename='.$filename.'');\n echo $file;\n\n }", "public function exportCsvAction()\n {\n $fileName = 'info.csv';\n $content = $this->getLayout()->createBlock('bs_instructorinfo/adminhtml_info_grid')\n ->getCsv();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "public function downloadGradings($assignment_id){\n $assignment_name = $this->getAssignmentName($assignment_id);\n\n //Get reviews from database\n //Based on Python Program export_grades.py\n $data = $this->getReviews($assignment_id);\n $grades = Array();\n $students = Array();\n $beoordelaars = Array();\n\n //Save grades of students in $grades\n //Save names of students in $students\n foreach ($data as $key => $value) {\n $student_id = $value['student_id'];\n $beoordelaar = $value['staff_name'];\n $beoordelaar_id = $value['staff_id'];\n $beoordelaars[$beoordelaar_id] = $beoordelaar;\n $student_name = $value['student_name'];\n $grade = $value['grade'];\n\n if (array_key_exists($student_id, $grades) == False){\n $grades[$student_id] = Array($beoordelaar_id => $grade);\n }\n else {\n $grades[$student_id][$beoordelaar_id] = $grade;\n }\n if (array_key_exists($student_id, $students) == False){\n $students[$student_id] = $student_name;\n }\n }\n\n //Remove empty items\n $items_to_remove = Array();\n foreach($grades as $student_id => $grading) {\n $grading = array_filter($grading);\n if (empty($grading)) {\n array_push($items_to_remove, $student_id);\n }\n }\n foreach($items_to_remove as $index => $student_id) {\n unset($grades[$student_id]);\n }\n\n //Create a list of beoordelaars\n $beoordelaars = array_filter(array_unique($beoordelaars));\n $beoordelaars_id = Array();\n foreach ($beoordelaars as $staff_id => $staff_name) {\n array_push($beoordelaars_id, $staff_id);\n }\n\n //Prepare csv file\n $file = \"\";\n $header = array_merge(Array('student_id', 'student_name'),$beoordelaars);\n $file = $file.join(';', $header).\"\\n\";\n foreach ($grades as $student_id => $grading) {\n $export_row = Array();\n array_push($export_row, $student_id);\n array_push($export_row, $students[$student_id]);\n foreach (range(0,count($beoordelaars)-1) as $index) {\n array_push($export_row, '');\n }\n foreach ($grading as $beoordelaar => $grade) {\n $index = array_search($beoordelaar, $beoordelaars_id);\n $export_row[$index+2] = $grade;\n }\n $file = $file.join(';', $export_row).\"\\n\";\n }\n\n //Write to csv file\n $filename = $assignment_name.date(\"d-m-Y_H:i:s\").'.csv';\n header('Content-type: text/csv');\n header('Content-Disposition: attachment; filename='.$filename.'');\n echo $file;\n }" ]
[ "0.6261833", "0.6117138", "0.6104854", "0.60578126", "0.60192907", "0.60125273", "0.5919271", "0.589925", "0.58747697", "0.58746296", "0.5817269", "0.575103", "0.57442605", "0.574415", "0.57333475", "0.5731657", "0.5713616", "0.5709845", "0.5695316", "0.5680011", "0.5671638", "0.5659403", "0.56435454", "0.5642676", "0.5642676", "0.5632625", "0.5622821", "0.5618633", "0.5593722", "0.5590776" ]
0.7712815
0
Execute an SQL query with blob fields processing
public function execWithBlobProcessing( $sql, $blobs, $blobTypes = array() ) { $this->debugInfo($sql); set_error_handler("empty_error_handler"); if( version_compare(phpversion(),"4.2.0") >= 0 ) $ret = pg_query($this->conn, $sql); else $ret = pg_exec($this->conn, $sql); set_error_handler("runner_error_handler"); return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processRequest(&$db) {\n\n\t\t// verify that the blob data is from the existing and valid query\n\t\t$queryCode = v($_REQUEST['query']);\n\t\tif ( Session::get('select', 'query') == \"\" || md5(Session::get('select', 'query')) != $queryCode) {\n\t\t\techo view('invalid_request');\n\t\t\treturn;\n\t\t}\n\n\t\t$id = v($_REQUEST[\"id\"]);\n\t\t$name = v($_REQUEST[\"name\"]);\n\t\t$isEditable = isBlobEditable();\n\t\t$table = Session::get('select', 'unique_table'); // Session::get('select', 'table')\n\t\t$message = '';\n\n\t\tif ( v($_REQUEST['act']) == 'save' && $isEditable && count($_FILES) > 0 && isset($_FILES['blobdata']) ) {\n\t\t\t$result = saveBlobData($db, $table, $id, $name);\n\t\t\t$message = $result ? '<div class=\"message ui-state-default\">'.__('Blob data saved').'</div>'\n\t\t\t\t: '<div class=\"message ui-state-error\">'.__('Failed to save blob data').'</div>';\n\t\t\tunset($_REQUEST[\"blobtype\"]);\n\t\t}\n\n\t\tinclude(BASE_PATH . \"/config/blobs.php\");\n\t\t$bType = ( v($_REQUEST[\"blobtype\"]) && array_key_exists(v($_REQUEST[\"blobtype\"]), $blobTypes) ) ? v($_REQUEST[\"blobtype\"]) : \"txt\";\n\n\t\t// @todo: optimize. this should always fetch one row\n\t\t$blobOptions = '';\n\t\t$query = Session::get('select', 'query');\n\n\t\tif ($table == \"\")\n\t\t\t$applyLimit = true;\n\t\telse\n\t\t\t$applyLimit = strpos($query, \"limit \");\n\n\t\tif ($applyLimit == false)\n\t\t\t$query .= $db->getLimit( 1, $id );\n\n\t\tif (!$db->query($query) || $db->numRows() == 0) {\n\t\t\techo view('error_page');\n\t\t\treturn;\n\t\t}\n\n\t\t$row = ($applyLimit==false ? $db->fetchRow() : $db->fetchSpecificRow($id));\n\n\t\t// show as image etc ...\n\t\tif ($bType && v($_REQUEST[\"show\"]) && $blobTypes[$bType][2]) {\n\t\t\tob_end_clean();\n\t\t\tinclude_once(BASE_PATH . \"/lib/output.php\");\n\t\t\tOutput::buffer();\n\t\t\theader($blobTypes[$bType][2]);\n\t\t\tprint $row[$name];\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach($blobTypes as $k=>$v) {\n\t\t\tif ($bType == $k)\n\t\t\t\t$blobOptions .= \"<option value='$k' selected=\\\"selected\\\">$v[0]</option>\\n\";\n\t\t\telse\n\t\t\t\t$blobOptions .= \"<option value='$k'>$v[0]</option>\\n\";\n\t\t}\n\n\t\t// try to show the blob data as specified type\n\t\tif ($bType && $blobTypes[$bType] && v($blobTypes[$bType][3])) {\n\t\t\tif (strpos($blobTypes[$bType][3], \"#link#\") !== false)\n\t\t\t\t$blobData = str_replace(\"#link#\", \"?q=wrkfrm&type=viewblob&show=1&id=$id&name=$name&blobtype=$bType&query=\".urlencode($queryCode), $blobTypes[$bType][3]);\n\t\t\t//else if (strpos($blobTypes[$bType][3], \"#src#\") !== false)\n\t\t\t//\tprint str_replace(\"#src\", $row[$name], $blobTypes[$bType][3]);\n\t\t\telse\n\t\t\t\t$blobData = htmlspecialchars($row[$name]);\n\t\t} else if ($bType && $blobTypes[$bType] && v($blobTypes[$bType][4])) {\n\t\t\t$func = $blobTypes[$bType][4];\n\t\t\t$blobData = htmlspecialchars(print_r($func($row[$name]), 1));\n\t\t} else\n\t\t\t$blobData = htmlspecialchars($row[$name]);\n\n\t\t$toolbar = $isEditable ? view('viewblob_toolbar', array(\n\t\t\t'BLOBOPTIONS' => $blobOptions,\n\t\t)) : '<div class=\"message ui-state-default\">' . __('Blob data is not editable') . '</div>';\n\n\t\t$replace = array('ID' => $id,\n\t\t\t\t\t\t\t\t'NAME' => $name,\n\t\t\t\t\t\t\t\t'BLOBOPTIONS' => $blobOptions,\n\t\t\t\t\t\t\t\t'BLOBDATA' => $blobData,\n\t\t\t\t\t\t\t\t'TABLE' => $table == \"\" ? \"\" : htmlspecialchars($table),\n\t\t\t\t\t\t\t\t'QCODE' => md5(Session::get('select', 'query')), // this will help identify that the blob data belongs to this query\n\t\t\t\t\t\t\t\t'BLOB_TOOLBAR' => $toolbar,\n\t\t\t\t\t\t\t\t'MESSAGE' => $message\n\t\t\t\t\t\t\t);\n\t\techo view('viewblob', $replace);\n\t}", "function getblob($fieldname,$tablename=\"\",$keyname=\"\",$key=0) {\n\tglobal $blob_key;\n\tif (!$tablename) $tablename=$this->table;\n\tif (!$keyname) $keyname=$this->key;\n\tif ( $_FILES[$fieldname]) {\n\t $db = new $this->database_class;\n\t\t@list($width,$height,$type,$sizestr,$mimestr,$channels,$bits) = getimagesize ($_FILES[$fieldname]['tmp_name']);\n\t\tif (!$mimestr) {\n\t\t\tif ($type) $mimestr=image_type_to_mime_type($type);\n\t\t\telse $mimestr = $_FILES[$fieldname]['type'];\n\t\t}\n\t\t$name = $_FILES[$fieldname]['name'];\n\t\t$extension = image_type_to_extension($type);\n\t\tif ($db->type==\"pdo\")\n\t\t\t$data = file_get_contents($_FILES[$fieldname]['tmp_name']);\n\t\telse\n\t\t\t$data = $db->quote(file_get_contents($_FILES[$fieldname]['tmp_name']));\n\t\tif (!empty($key)) $sql = \"UPDATE\"; else $sql = \"INSERT INTO\";\n\t\t$sql .= \" image_data SET \";\n\t\t$sql .= \"tablename = '\".magicquote($tablename).\"',\";\n\t\t$sql .= \"fieldname = '\".magicquote($fieldname).\"',\";\n\t\tif (!empty($key)) $sql .= \"keyvalue = '\".magicquote($key).\"',\";\n\t\t$sql .= \"width = '$width',\";\n\t\t$sql .= \"height = '$height',\";\n\t\t$sql .= \"type = '$type',\";\n\t\t$sql .= \"sizestr = '\".magicquote($sizestr).\"',\";\n\t\t$sql .= \"mimestr = '\".magicquote($mimestr).\"',\";\n\t\t$sql .= \"channels = '$channels',\";\n\t\t$sql .= \"bits = '$bits',\";\n\t\t$sql .= \"name = '\".magicquote($name).\"',\";\n\t\t$sql .= \"extension = '\".magicquote($extension).\"',\";\n\t\t$sql .= \"image_time = '\".date(\"Y-m-d H:i:s\").\"'\";\n\t\tif (!empty($key)) $sql .= \"WHERE \".$db->qi($keyname).\"='$key'\";\n\t\t$db->query($sql);\n\t\t$db->query(\"SELECT LAST_INSERT_ID()\");\n\t\t$db->next_record();\n\t\t$blob_key = $db->f(0);\n\t}\n\t// Check if file will fit into sql blob\n\tif (($this->image_store == \"disk\") or ($_FILES[$fieldname]['size'] > $this->form_data->elements[$fieldname][\"ob\"]->sqlsize )) {\n\t\t// if not attempt to store locally on disk and store the filename in the blob instead.\n \t$tmpfname = \"image/\".$db->nextid(\"image\").$_FILES[$fieldname]['name'];\n\t\tif ($_ENV[\"SubFolder\"]) $tmpfname = $_ENV[\"SubFolder\"] . \"/\" . $tmpfname;\n \tif ( move_uploaded_file($_FILES[$fieldname]['tmp_name'],$_SERVER[\"DOCUMENT_ROOT\"].'/'.$tmpfname) ) {\n\t\t\t// if successfully saved return filename of stored image.\n \treturn $tmpfname;\n \t} else {\n\t\t\t// unable to store uploaded file\n if ($this->image_store == \"disk\") $msg = \"Save mode set to save on Disk not SQL\";\n else $msg = \"File too big for SQL datatype \";\n EventLog($msg, \"and unable to move file to $tmpfname. Uploaded File $name NOT saved.\", \"Error\");\n \treturn \"\";\n \t}\n\t} else {\n\t\treturn $data;\n\t}\n }", "public function executeQuery();", "public function executeQuery();", "function rawQuery($sql)\n\t{\n\t\t$this->logQuery->line($sql);\n\t\treturn $this->con->query($sql);\n\t}", "public function runSqlQuery($sqlQuery);", "public function query($sql, array $values) {\n //$stmt = $db->prepare(\"insert into images (id, contenttype, imagedata) values (?, ?, ?)\");\n $statement = $this->connection->prepare($sql);\n\n // bind parameters\n $i = 1; foreach ($values as &$value) {\n $statement->bindParam($i++, $value, $this->getType($value));\n }\n\n // execute\n $statement->execute();\n }", "private function _dbExecute($sql) {\n\t\tif($this->execute) {\n\t\t\t$result = $this->db->rawQuery($sql);\n\t\t}\n\t\tif($this->db->getLastErrno() === 0) {\n\t\t\techo $this->execute ? \"<i>..executed</i><br>\" : \"\";\n\t\t} else {\n\t\t\techo \"\\n<br><b style='color: #d00;'>a database error occured: {$this->db->getLastErrno()}</b><br><i style='background: #ffa; padding: 3px;'>{$this->db->getLastError()}</i><br>\";\n\t\t}\n\t}", "public abstract function field($sql);", "function executeSQLquery( )\n {\n }", "public function executeQuery($sql)\n {\n //here $sql is the query string\n\n $result = $this->connection->query($sql);\n $this->connection->close();\n }", "abstract function &executeQuery($query, $interrupt = true, $raw = true);", "public function execute($sql) {\r\n\t}", "public function execute($query);", "abstract public function sql();", "function execute($sql, $mode = ResultSet::FETCHMODE_NUM);", "function executeQuery($connection, $query) {\n\t $result = pg_query($connection, $query) or die(\"Error in query: $query.\" . pg_last_error($connection));\n\t $rows = pg_num_rows($result);\n\t if ($rows > 0) {\n\t for ($i=0; $i<$rows; $i++) {\n\t\t $row = pg_fetch_object($result, $i);\n\t\t $exResult[$i] = $row;\n\t }\n\t }\n\t return $exResult;\t\n\t}", "abstract public function preparedForDb();", "abstract public function runQuery();", "public abstract function query($sql);", "abstract public function fetchRaw($parameters);", "private function exec_query($sql) {\n\t\tif (DEBUG_MODE == 1) {\n\t\t\techo $sql.'<br />';\n\t\t}\n\n\t\t// Execute the query\n\t\t$results = $this->_db_link->query($sql);\n\n\t\t// Reset the class variables\n\t\t$this->reset();\n\n\t\t// Return the results\n\t\treturn $results;\n\t}", "public function raw($sql) {\n\t\ttry {\n\t\t\treturn $this->pdo->exec($sql);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new Exception\\DatabaseQuery(sprintf('%s (%s)', $e->getMessage(), $sql), $e->getCode(), $e);\n\t\t}\n\t}", "public function getBlobTypeDeclarationSQL(array $field)\n {\n throw DBALException::notSupported(__METHOD__);\n }", "abstract protected function _execute( $query );", "abstract protected function executeQuery($query);", "public function executedQuery();", "public function exec($sql, $params=array());", "abstract protected function prepared();", "abstract protected function execute_query($sql);" ]
[ "0.5777644", "0.5761751", "0.55755025", "0.55755025", "0.534774", "0.53118163", "0.52835894", "0.5197758", "0.51735294", "0.5169032", "0.51518583", "0.51498", "0.51050735", "0.51029605", "0.509705", "0.50946254", "0.5083291", "0.5066523", "0.50600564", "0.50567514", "0.50478494", "0.50445795", "0.5039254", "0.502306", "0.50014544", "0.49947092", "0.49924043", "0.49909535", "0.49870032", "0.4981621" ]
0.6764137
0
Get menu name by state
private function getMenuName ($state){ foreach ($this->menuArray as $menuName =>$menus){ foreach ($menus as $items) { foreach ($items as $key => $item){ if ($state == $key){ return $menuName; } } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMenuTitle();", "public function getMenuName() {\n $menu_name = '';\n // This is the only thing we have to find the menu name.\n $path = $this->requestStack->getCurrentRequest()->getPathInfo();\n $args = explode('/', $path);\n // Menu machine name and pathname usually differ by \"va-\" prefix.\n $menu_name = substr($args[1], 0, 3) === 'va-' ? $args[1] : 'va-' . $args[1];\n // Pittsburgh is a snowflake.\n if ($args[1] === 'pittsburgh-health-care') {\n $menu_name = $args[1];\n }\n return $menu_name;\n }", "public function getMenuName()\n {\n return $this->menuName;\n }", "function shell_get_menu_name( $location ){\r\n\tif ( has_nav_menu( $location ) ){\r\n\t\t$locations = get_nav_menu_locations();\r\n\t\tif( ! isset( $locations[$location] ) ) return false;\r\n\t\t$menu_obj = get_term( $locations[$location], 'nav_menu' );\r\n\t\treturn $menu_obj->name;\r\n\t}\r\n}", "function GetMenuNameFromID($menu_id)\r\n{\r\n\tglobal $db;\r\n\t$query = \"SELECT * FROM admin_menu\r\n\t\t\t\t\t\tWHERE active='Y'\r\n\t\t\t\t\t\tAND id='\".$menu_id.\"'\";\r\n\t$db->query($query);\r\n\t$db->next_record();\r\n\treturn $db->f('name');\r\n}", "function kvarteret_get_menu_name($location){\n if(!has_nav_menu($location)) \n \treturn false;\n\n $menus = get_nav_menu_locations();\n $menu_title = wp_get_nav_menu_object($menus[$location])->name;\n\n return $menu_title;\n}", "public function getStateName() {\n return $this->states[$this->state];\n }", "public function getMenuName() {\n return $this->menuName;\n }", "public function getMenuName()\n {\n $this->menu_name = $this->menu_name??str_ireplace('admin_panel/','',Request::capture()->path());\n\n return $this->menu_name;\n }", "function get_menu_name( $location ) {\n\t\n\t\tif( empty($location) )\n\t\t\treturn false;\n\t\t\n\t\t$locations = get_nav_menu_locations();\n\t\t\n\t\tif( !isset($locations[$location]) )\n\t\t\treturn false;\n\t\t\n\t\treturn get_term( $locations[$location], 'nav_menu' );\n\t}", "public function getName()\n {\n return $this['stateName'];\n }", "static function state_AcronimToName($state){\n switch ($state){\n case 'CON': return 'Confeccionada';break;\n case 'APR': return 'Aprobada';break;\n case 'REC': return 'Rechazada';break;\n default: return 'Estado de la Solicitud No Definido';break;\n }\n }", "public static function getStateName($state)\n {\n $locale = app()->getLocale();\n switch ($locale) {\n case Language::ARABIC:\n switch ($state) {\n case self::INACTIVE:\n return \"غير فعال\";\n break;\n case self::ACTIVE:\n return \"فعال\";\n break;\n }\n break;\n case Language::ENGLISH:\n switch ($state) {\n case self::INACTIVE:\n return \"Inactive\";\n break;\n case self::ACTIVE:\n return \"Active\";\n break;\n }\n break;\n }\n\n return \"\";\n }", "function getMenuSubTitle();", "function getstatename($stateid)\r\r\r\r\t\t{\r\r\r\r\t\r\r\r\r\t\t\t\r\r\r\r\t\t\tApp::import(\"Model\", \"State\");\r\r\r\r\t $this->State = & new State();\r\r\r\r\t\t $conditions = array(\"State.state_id\" => $stateid);\r\r\r\r\t\t\t $statename=$this->State->find('all', array('conditions' => $conditions));\r\r\r\r\t\t\t if($statename){\r\r\r\r\t\t\t \t$usstatename =$statename[0]['State']['state_name']; \r\r\r\r\t\t\t }else{\r\r\r\r\t\t\t \t$usstatename=\"\";\r\r\r\r\t\t\t }\t\r\r\r\r\r\r\r\r\t\t\t\r\r\r\r\t\t\t return $usstatename;\r\r\r\r\t\t\t \t\r\r\r\r\t\t}", "function getMenuText() {\n global $INFO;\n global $ID;\n global $conf;\n\n if(!$INFO['exists'])\n return $this->lang['menu'].' ('.$this->lang['pm_notexist'].')';\n elseif ( $ID == $conf['start'])\n return $this->lang['menu'].' ('.$this->lang['pm_notstart'].')';\n elseif ( !$INFO['writable'] )\n return $this->lang['menu'].' ('.$this->lang['pm_notwrite'].')';\n else\n return $this->lang['menu'];\n }", "function get_menu_name()\n\t\t\t {\n\t\t\t \t$this->db->select('id,menu_name');\n\t\t\t\t\n\t\t\t \t$parent= '0';\n\t\t\t\t\n\t\t\t \t$this->db->where('parent_id',$parent);\n\t\t\t \t\n\t\t\t\t$query = $this->db->get('oxm_menu');\n\t\t\t\t\n\t\t\t\tif($query->num_rows>0)\n\t\t\t\t{\n\t\t\t\t\treturn $query->result();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}", "public function getStateLabel()\n {\n \t$list = self::getStateList();\n $state = $this->getState();\n \n \treturn isset($list[$state])\n\t \t? $list[$state]\n\t \t: null;\n }", "function _getStateName($stateID,$type=1)\n\t{\n\t\t$strResult = null;\n\t\t$query\t= \"select stateName,description from \" . $this -> table .\"state where id='$stateID'\";\n\t\t$this -> dbcon -> execute_query($query);\n\t\t$arrTemp = $this -> dbcon -> fetch_records();\n\t\tif (is_array($arrTemp)) {\n\t\t\tif ($type == 1) {\n\t\t\t\t$strResult = $arrTemp[0]['stateName'];\n\t\t\t}elseif ($type == 2){\n\t\t\t\t$strResult = $arrTemp[0]['description'];\n\t\t\t}else{\n\t\t\t\t$strResult = $arrTemp[0];\n\t\t\t}\n\t\t}\n\t\treturn $strResult;\n\t}", "abstract function getMenuKey();", "function getMenu($name) {\t\t\n\t\tglobal $menu_list;\n\t\t\n\t\tif (isset($menu_list[$name]))\n\t\t\treturn $menu_list[$name];\n\t\t\t\n\t\treturn array();\t\t\n\t}", "function GetMenuName ($id)\r\n{\r\n\tglobal $db;\r\n\t$query = \"SELECT name FROM menus WHERE id = '\".$id.\"'\";\r\n\t$db->query($query);\r\n\t$db->next_record();\r\n\treturn $db->f('name');\r\n}", "public function getMenuName($pid, $id) {\n $pid = intval($pid);\n $id = intval($id);\n //Judge whether it is a parent\n if (!empty($pid)) {\n $result = $this->findOne([ 'id' => $pid]);\n } else {\n $result = $this->findOne([ 'id' => $id]);\n }\n return $result->name;\n }", "public function getName()\n {\n return 'wapi_menu';\n }", "function workflow_get_state($name) {\n $states = workflow_get_states();\n\n return $states[$name];\n}", "public function buildMenu($name);", "public function getName()\n {\n return \"tsCMS_menu_menutype\";\n }", "function getMenuTitle($area, $function, $userId, $blogId) {\n\tif ($area == \"member\") {\n\t if ($userId > 0) return \"Willkommen '\".getUserName($userId).\"'\";\n\t else return \"Willkommen im Memberbereich\";\n\t} else {\n\t if ($blogId > 0 && $function != \"login\") return \"Blog '\".getUserName($blogId).\"'\";\n\t else return \"Blog-Projekt M133\";\n\t}\n }", "public static function getModuleMenu() {\n $str = '';\n if (!empty(self::$menu['module'])){ \n $str.= static::parseModuleMenu(self::$menu['module'], 'module');\n }\n return $str;\n }", "public function buildMenu(): string;" ]
[ "0.719419", "0.7125391", "0.7069922", "0.70358884", "0.6916156", "0.68810576", "0.6874552", "0.6849312", "0.6637112", "0.6620276", "0.65186423", "0.64820874", "0.6457007", "0.6451529", "0.6431382", "0.64145684", "0.6410486", "0.63968825", "0.6349713", "0.6336909", "0.6273171", "0.6223376", "0.61721975", "0.61529964", "0.60801476", "0.6077959", "0.6061167", "0.60529757", "0.6049926", "0.60274357" ]
0.83446014
0
Callback for the euaidlockfields command.
function drush_euaid_devel_euaid_manipulate_fields() { $types = array(); $options = array( 'node' => 'Node', 'profile2' => 'Profile2', ); $entity_choice = drush_choice($options, dt('What entity type do you want to manipulate?')); if ($entity_choice == 'node') { $types = node_type_get_types(); } elseif ($entity_choice == 'profile2') { $types = profile2_get_types(); } $options = array( 'lock' => 'Lock fields', 'unlock' => 'Unlock fields', ); $choice = drush_choice($options, dt('What do you want to do?')); if ($choice == 'lock') { $lock = 1; $unlock = 0; } else { $lock = 0; $unlock = 1; } if (!empty($types)) { foreach ($types as $type_name => $type_object) { if (strpos($type_name, 'euaid_') !== FALSE) { $fields = field_info_instances($entity_choice, $type_name); foreach ($fields as $field_name => $field_info_array) { $field = field_read_field($field_name); if ($field['locked'] == $unlock) { // Means 0: unlock; 1: lock. $field['locked'] = $lock; field_update_field($field); } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bbp_admin_setting_callback_editlock()\n{\n}", "public function setLockedFields($fields)\r\n {\r\n $this->structure->response->lockedFields = $fields;\r\n }", "function bbp_user_login_fields()\n{\n}", "function bbp_edit_lock($default = 5)\n{\n}", "function accountswitcher_ufields()\n{\n\tglobal $eas;\n\t$eas->update_userfields_cache();\n}", "function bbp_get_edit_lock($default = 5)\n{\n}", "function new_fields_edit_model( $msg ){\r\n\t\tglobal $current_user;\r\n\t\t$current_user = wp_get_current_user();\r\n\t\tif( !current_user_can( 'manage_options', $current_user->ID ) ){\r\n\t\t\twp_die( __( 'You do not have permissions to activate this plugin, sorry, check with site administrator to resolve this issue please!', 'user-registration-aide' ) );\r\n\t\t}else{\r\n\t\t\t$field = new FIELDS_DATABASE();\r\n\t\t\t$options = get_option( 'csds_userRegAide_Options' );\r\n\t\t\t$delete_error = ( int ) 0;\r\n\t\t\t$msg = ( string ) '';\r\n\t\t\t$count = ( int ) 0;\r\n\t\t\t$field_id = ( int ) 0;\r\n\t\t\t$submit = ( int ) 0;\r\n\t\t\t$seperator = ( string ) '';\r\n\t\t\t$results1 = ( string ) '';\r\n\t\t\t$plugin = ( string ) '';\r\n\t\t\t$msg1 = ( string ) '';\r\n\t\t\t$upd_msg = ( string ) '<div id=\"message\" class=\"updated\"><p>';\r\n\t\t\t$err_msg = ( string ) '<div id=\"message\" class=\"error\"><p>';\r\n\t\t\t$end_msg = ( string ) '</p></div>';\r\n\t\t\t$view = ( string ) 'edit-new-fields';\r\n\t\t\tif( $options['csds_userRegAide_db_Version'] != \"1.5.2.0\" ){\r\n\t\t\t\tdo_action( 'update_options' ); // Line 259 user-registration-aide.php\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$registrationFields = get_option( 'csds_userRegAide_registrationFields' );\r\n\t\t\t$fieldKey = '';\r\n\t\t\t$fieldOrder = '';\r\n\t\t\t$options = get_option( 'csds_userRegAide_Options' );\r\n\t\t\t$delete = ( int ) 0;\r\n\t\t\t$nuaFields = array();\r\n\t\t\t$plugin = 'buddypress/bp-loader.php';\r\n\t\t\t// Handles the delete field form\r\n\t\t\tif ( isset( $_POST['delete_field'] ) ){\r\n\t\t\t\tif( wp_verify_nonce( $_POST['wp_nonce_csds-newFields'], 'csds-newFields' ) ){\t\r\n\t\t\t\t\t$results1 = '';\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Checking for field to delete if empty gives warning and exits\r\n\t\t\t\t\t$dfield = new FIELDS_DATABASE();\r\n\t\t\t\t\tif( !empty( $_POST['deleteNewFields'] ) ){\r\n\t\t\t\t\t\t$results1 = $_POST['deleteNewFields'];\r\n\t\t\t\t\t\t$delete_error = 0;\r\n\t\t\t\t\t\t$dfield = $field->get_field_by_meta_key( $results1 );\r\n\t\t\t\t\t\t$field_name = $dfield->field_name;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$delete_error = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( !empty( $results1 ) ){\r\n\t\t\t\t\t\t// getting BP field id\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( is_plugin_active( $plugin ) ){\r\n\t\t\t\t\t\t\t//exit( print_r( $dfield ) );\r\n\t\t\t\t\t\t\t$field_id = $dfield->bp_ID;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Delete field from usermeta must be done b4 deleting bp field otherwise it deletes field before deleting data from users\r\n\t\t\t\t\t\tdo_action( 'delete_usermeta_field', $results1 ); // Deletes field from user meta \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// deleting BP xprofile field\r\n\t\t\t\t\t\tif( is_plugin_active( $plugin ) ){\r\n\t\t\t\t\t\t\txprofile_delete_field( $field_id );\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( $delete_error == 0 ){\r\n\t\t\t\t\t\t\t$field->delete_fields( $dfield );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( !empty( $registrationFields ) ){\r\n\t\t\t\t\t\t\tif( array_key_exists( $results1, $registrationFields ) ){\r\n\t\t\t\t\t\t\t\tunset( $registrationFields[$results1] );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$regFields = $registrationFields;\r\n\t\t\t\t\t\tif( !empty( $regFields ) ){\r\n\t\t\t\t\t\t\tupdate_option( \"csds_userRegAide_registrationFields\", $regFields );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Report to the user that the data has been updated successfully or that an error has occurred\r\n\t\t\t\t\tif( $delete_error == 0 ){\r\n\t\t\t\t\t\t$msg = sprintf( __( ' %s Successfully Deleted!' , 'user-registration-aide' ), $field_name );\r\n\t\t\t\t\t\t$msg = $upd_msg.$msg.$end_msg;\r\n\t\t\t\t\t}elseif( $delete_error == 1 ){\r\n\t\t\t\t\t\t$msg = __( 'No field was selected for deletion, you must select a field to delete first!' , 'user-registration-aide' );\r\n\t\t\t\t\t\t$msg = $err_msg.$msg.$end_msg;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn $msg;\r\n\t\t\t// Handles the new fields order form\r\n\t\t\t}elseif( isset( $_POST['field_order'] ) ){\r\n\t\t\t\tif( wp_verify_nonce( $_POST['wp_nonce_csds-newFields'], 'csds-newFields' ) ){\t\r\n\t\t\t\t\t$key = '';\r\n\t\t\t\t\t$key1 = '';\r\n\t\t\t\t\t$key2 = '';\r\n\t\t\t\t\t$value = '';\r\n\t\t\t\t\t$value1 = '';\r\n\t\t\t\t\t$value2 = '';\r\n\t\t\t\t\t$results = '';\r\n\t\t\t\t\t$aa = '';\r\n\t\t\t\t\t$field_order_error = ( int ) 0;\r\n\t\t\t\t\t$ura_fields = $field->get_all_fields();\t\r\n\t\t\t\t\t$msg = ( string ) '';\r\n\t\t\t\t\t// Getting values from new field order select options\r\n\t\t\t\t\t$results = $_POST['csds_editFieldOrder'];\r\n\t\t\t\t\t$aa = ( int ) 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//foreach($csds_userRegAide_fieldOrder as $key => $value){\r\n\t\t\t\t\tforeach( $ura_fields as $object ){\r\n\t\t\t\t\t\t$meta_key = $object->meta_key;\r\n\t\t\t\t\t\tforeach( $results as $key1 => $value1 ){\r\n\t\t\t\t\t\t\tforeach( $results as $key2 => $value2 ){\r\n\t\t\t\t\t\t\t\tif( $key1 != $key2 && ( $value1 == $value2 ) ){\r\n\t\t\t\t\t\t\t\t\t$field_order_error = 1;\r\n\t\t\t\t\t\t\t\t\tbreak;\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\tif( $field_order_error != 1 ){\r\n\t\t\t\t\t\t\t\tif( $aa == $key1 ){\r\n\t\t\t\t\t\t\t\t\t$temp[$meta_key] = $value1;\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$temp[$meta_key]= $value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$aa++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t// Updating New Field Order\r\n\t\t\t\t\tif( $field_order_error != 1 ){\t// Checking for errors duplicate fields before updating\r\n\t\t\t\t\t\t$fieldOrder = $temp;\r\n\t\t\t\t\t\tasort( $fieldOrder );\r\n\t\t\t\t\t\tforeach( $fieldOrder as $key => $value ){\r\n\t\t\t\t\t\t\t$field->update_field_order( $key, $value );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$plugin = 'buddypress/bp-loader.php';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( is_plugin_active( $plugin ) ){\r\n\t\t\t\t\t\t\t$results = do_action( 'update_bp_field_order' );\r\n\t\t\t\t\t\t\tif( !is_wp_error( $results ) ){\r\n\t\t\t\t\t\t\t\t$msg = __( 'New Field Order Updated Successfully.', 'user-registration-aide' );\r\n\t\t\t\t\t\t\t\t$msg = $upd_msg.$msg.$end_msg;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$msg = $results;\r\n\t\t\t\t\t\t\t\t$msg = $err_msg.$msg.$end_msg;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$msg = __( 'New Field Order Updated Successfully.', 'user-registration-aide' );\r\n\t\t\t\t\t\t\t$msg = $upd_msg.$msg.$end_msg;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{ // Duplicate fields error display message\r\n\t\t\t\t\t\t$msg = __( '***Error Updating New Field Order, Two or More Fields Have the Same Order!***', 'user-registration-aide' );\r\n\t\t\t\t\t\t$msg = $err_msg.$msg.$end_msg;\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}elseif( isset( $_POST['edit_field_name'] ) ){\r\n\t\t\t\tif( wp_verify_nonce( $_POST['wp_nonce_csds-newFields'], 'csds-newFields' ) ){\t\r\n\t\t\t\t\t$results = array();\r\n\t\t\t\t\t$changed = ( int ) 0;\r\n\t\t\t\t\t$empty = ( int ) 0;\r\n\t\t\t\t\t$emptyFields = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// getting BP field id\r\n\t\t\t\t\t\r\n\t\t\t\t\t$msgs = array();\r\n\t\t\t\t\t$ura_fields = $field->get_all_fields();\t\r\n\t\t\t\t\t$new_name = array();\r\n\t\t\t\t\t// Checking for new field title changed if empty gives warning and exits\r\n\t\t\t\t\tforeach( $ura_fields as $object ){\r\n\t\t\t\t\t\t$post_key = $object->meta_key.'_title';\r\n\t\t\t\t\t\t$key = $object->meta_key;\r\n\t\t\t\t\t\t$name = $object->field_name;\r\n\t\t\t\t\t\tif( !empty( $_POST[$post_key] ) ){\r\n\t\t\t\t\t\t\tif( $_POST[$post_key] != $name ){\r\n\t\t\t\t\t\t\t\t$INFM = new INPUT_NEW_FIELDS_MODEL();\r\n\t\t\t\t\t\t\t\t$cnt = ( int ) 0;\r\n\t\t\t\t\t\t\t\t$cnt = $field->dup_field_names( $_POST[$post_key] );\r\n\t\t\t\t\t\t\t\tif( $cnt >= 1 ){\r\n\t\t\t\t\t\t\t\t\t$dup = ( string ) $_POST[$post_key];\r\n\t\t\t\t\t\t\t\t\t$msg = '<div id=\"message\" class=\"error\"><p>'. sprintf( __( '***Cannot add duplicate field names, %s is already included in the extra fields!***', 'user-registration-aide' ), $dup ) .'</p></div>';\r\n\t\t\t\t\t\t\t\t\treturn $msg;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$field_key = 'field_name';\r\n\t\t\t\t\t\t\t\t$meta_key = $key;\r\n\t\t\t\t\t\t\t\t$field_value = $_POST[$post_key];\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$field->update_fields( $meta_key, $field_key, $field_value );\r\n\t\t\t\t\t\t\t\t// updating bp field name\r\n\t\t\t\t\t\t\t\t$plugin = 'buddypress/bp-loader.php';\r\n\t\t\t\t\t\t\t\tif( is_plugin_active( $plugin ) ){\r\n\t\t\t\t\t\t\t\t\t$bpf = new URA_BP_FUNCTIONS();\r\n\t\t\t\t\t\t\t\t\t$results[$key] = $bpf->update_bp_fieldname_change( $key, $_POST[$post_key] );\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$results[$key] = $field_value;\r\n\t\t\t\t\t\t\t\t$new_name[$key] = $name;\r\n\t\t\t\t\t\t\t\t$changed ++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$error_results[$key] = $name;\r\n\t\t\t\t\t\t\t$empty ++;\r\n\t\t\t\t\t\t\t//$changed ++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i = ( int ) 0;\r\n\t\t\t\t\t$ii = ( int ) 0;\r\n\t\t\t\t\tif( $empty > 0 ){\r\n\t\t\t\t\t\t$i = count( $error_results );\r\n\t\t\t\t\t\t$msg = '<div id=\"message\" class=\"error\"><p>';\r\n\t\t\t\t\t\tforeach( $error_results as $keys => $values ){\r\n\t\t\t\t\t\t\t$ii++;\r\n\t\t\t\t\t\t\tif( !empty( $values ) ){\r\n\t\t\t\t\t\t\t\tif( $ii < $i ){\r\n\t\t\t\t\t\t\t\t\t$msg .= sprintf( __( ' %s Name Not Entered! & ' , 'user-registration-aide'), strtoupper( $keys ) ) ;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$msg .= sprintf( __( ' %s Name Not Entered!' , 'user-registration-aide'), strtoupper( $keys ) ) ;\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}\r\n\t\t\t\t\t\t$msg .= '</p></div>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Report to the user that the data has been updated successfully or that an error has occurred\r\n\t\t\t\t\tif( $changed >= 1 ){\r\n\t\t\t\t\t\t$i = count( $results );\r\n\t\t\t\t\t\t$msg = '<div id=\"message\" class=\"updated\"><p>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach( $results as $keys => $values ){\r\n\t\t\t\t\t\t\t$ii++;\t\t\r\n\t\t\t\t\t\t\tif( !empty( $values ) ){\r\n\t\t\t\t\t\t\t\tif( $ii < $i ){\r\n\t\t\t\t\t\t\t\t\t$msg .= sprintf( __( ' %1s Name Successfully changed to %2s! & ' , 'user-registration-aide'), $new_name[$keys], $values ) ;\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$msg .= sprintf( __(' %1s Name Successfully changed to %2s!' , 'user-registration-aide'), $new_name[$keys], $values );\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\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$msg .= '</p></div>';\r\n\t\t\t\t\t}elseif( $changed == 0 && $empty == 0){\r\n\t\t\t\t\t\t$msg = '<div id=\"message\" class=\"error\"><p>'. __( 'No field was changed!' , 'user-registration-aide' ) .'</p></div>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $msg;\r\n\t}", "function bbp_edit_user_form_fields()\n{\n}", "function editField()\r\n{\r\n\t$errorMessage = '';\r\n\t\r\n\t$fieldName = $_POST['fieldname'];\r\n\t$id = $_POST['id'];\r\n\t$userId = $_POST['userid'];\r\n\t$fieldId = $_POST['fieldid'];\r\n\t\r\n\t// first, make sure the fieldname are not empty\r\n\tif ($fieldName == '') {\r\n\t\t$errorMessage = 'You must enter the field name';\r\n\t} else {\r\n\t\t\t\r\n\t\t// check the database and see if the username and password combo do match\r\n\t\t$sql = \"SELECT id\r\n\t\t FROM field_options \r\n\t\t\t\tWHERE field_name = '$fieldName'\";\r\n\t\t$result = dbQuery($sql);\r\n\t\tif (dbNumRows($result) == 1) {\r\n\t\t\t$errorMessage = 'The field name is already existing';\r\n\t\t} else {\r\n\r\n\t\t\tif ($fieldId == 3 || $fieldId == 5 || $fieldId == 10 || $fieldId == 11 || $fieldId == 14 || $fieldId == 4 || $fieldId == 2){\r\n\t\t\t\t\t\t\r\n\t\t\t\t$sql = \"UPDATE field_options\r\n\t\t\t\t\t\tSET field_name = '$fieldName', modify_id = '$userId', modify_on = NOW() \r\n\t\t\t\t\t\tWHERE id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\t\r\n\t\t\t\t$field = strtolower($fieldName);\r\n\t\t\t\t$tableName = preg_replace('/\\s+/', '_', $field);\r\n\t\t\t\t$tableBalance = $tableName.'_bal';\r\n\t\t\t\r\n\t\t\t\t$sql = \"SELECT table_name, field_name\r\n\t\t \t\tFROM nick_name \r\n\t\t\t\t\t\tWHERE field_options_id = '$id'\";\r\n\t\t\t\t$result = dbQuery($sql);\r\n\t\t\t\t$row = dbFetchAssoc($result);\t\r\n\t\t\t\t$oldTableName = $row['table_name'];\r\n\t\t\t\t$oldTableBalance = $row['table_name'].'_bal';\r\n\t\t\t\t$oldFieldName = $row['field_name'];\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$sql = \"ALTER table monthly_payment CHANGE $oldTableName $tableName double NULL DEFAULT '0', CHANGE $oldTableBalance $tableBalance double NULL DEFAULT '0'\";\t\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"ALTER table deduction CHANGE $oldTableName $tableName double NULL DEFAULT '0'\";\t\r\n\t\t\t\t$result = dbQuery($sql) or die(mysql_error());\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"UPDATE nick_name\r\n\t\t\t\t\t\tSET field_name = '$fieldName', table_name = '$tableName' \r\n\t\t\t\t\t\tWHERE field_options_id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif ($fieldId == 2){\r\n\t\t\t\t\t$sql = \"ALTER table org_monthly_payment CHANGE $oldTableName $tableName double NULL DEFAULT '0', CHANGE $oldTableBalance $tableBalance double NULL DEFAULT '0'\";\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$result = dbQuery($sql) or die(mysql_error());\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t$errorMessage = 'Payment type was successfully updated';\r\n\t\t\t}/* else if ($fieldId == 6){\r\n\t\t\t\t$sql = \"UPDATE field_options\r\n\t\t\t\t\t\tSET field_name = '$fieldName', modify_id = '$userId', modify_on = NOW() \r\n\t\t\t\t\t\tWHERE id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"INSERT INTO field_options(id, field_id, field_name, created_id, created_on) \r\n\t\t\t\t\t\tVALUES ('', '$fieldId', '$fieldName', '$userId', now())\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t$fieldOptionsId = dbInsertId();\r\n\t\t\t\t\r\n\t\t\t\t$sql1 = \"SELECT trust_id, pl_no FROM security_users WHERE security_id = 4\";\r\n\t\t\t\t$result1 = dbQuery($sql1);\r\n\t\t\t\twhile($row1 = dbFetchAssoc($result1)) {\r\n\t\t\t\textract($row1);\t\r\n\t\t\t\t\r\n\t\t\t\t$sql2 = \"INSERT INTO monthly_payment(id, trust_id, pl_no, month_year, status, created_id, created_on) \r\n\t\t\t\t\t\tVALUES ('', '$trust_id', '$pl_no', '$fieldOptionsId', '0', '$userId', now())\";\r\n\t\t\t\t\t\tdbQuery($sql2);\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}*/ else {\r\n\t\t\t\t$sql = \"UPDATE field_options\r\n\t\t\t\t\t\tSET field_name = '$fieldName', modify_id = '$userId', modify_on = NOW() \r\n\t\t\t\t\t\tWHERE id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\t\r\n\t\t\t\t\t\t$errorMessage = 'Field was successfully updated';\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\t\t\r\n\t\t\t\r\n\t}\r\n\t\r\n\treturn $errorMessage;\r\n}", "public function addFieldsLocker()\n {\n\n if ('off' === Settings::getOption('fields-locker', \\Hyyan\\WPI\\Admin\\Features::getID(), 'on')) {\n return false;\n }\n\n $metas = static::getProductMetaToCopy();\n $selectors = apply_filters(HooksInterface::FIELDS_LOCKER_SELECTORS_FILTER, array(\n '.insert',\n in_array('_product_attributes', $metas) ? '#product_attributes :input' : rand(),\n ));\n\n $jsID = 'product-fields-locker';\n $code = sprintf(\n 'var disabled = %s;'\n . 'for (var i = 0; i < disabled.length; i++) {'\n . ' $('\n . ' %s + \",\"'\n . ' + \".\" + disabled[i] + \",\"'\n . ' + \"#\" +disabled[i] + \",\"'\n . ' + \"*[name^=\\'\"+disabled[i]+\"\\']\"'\n . ' )'\n . ' .off(\"click\")'\n . ' .on(\"click\", function (e) {e.preventDefault()})'\n . ' .css({'\n . ' opacity: .5,'\n . ' \\'pointer-events\\': \\'none\\','\n . ' cursor: \\'not-allowed\\''\n . ' }'\n . ' );'\n . '}'\n , json_encode($metas)\n , !empty($selectors) ?\n json_encode(implode(',', $selectors)) :\n array(rand())\n );\n\n Utilities::jsScriptWrapper($jsID, $code);\n }", "function procEditField($ar) {\n global $XLANG;\n $XLANG->getCodes();\n $p=new XParam($ar,array('batch'=>'0','options'=>NULL));\n $field=$p->get('field');\n $def=$this->desc[$field];\n // Pour chaque parametre, on verifie si une nouvelle valeur est spécifiée, sinon on garde l'ancienne\n $ftype=$p->get('ftype');\n if(!$ftype) $ftype=$def->get_ftype();\n $fcount=$p->get('fcount');\n if(!$fcount) $fcount=$def->get_fcount();\n $forder=$p->get('forder');\n if(!empty($forder)) {\n $forder = $this->_guessFieldOrder($forder);\n } else {\n $forder = $def->get_forder();\n }\n $compulsory=$p->get('compulsory');\n $compulsory_hid=$p->get('compulsory_HID');\n if(!$compulsory && $compulsory!==false && $compulsory_hid!=2) $compulsory=$def->get_compulsory();\n else $compulsory=($compulsory=='on'?1:0);\n $queryable=$p->get('queryable');\n $queryable_hid=$p->get('queryable_HID');\n if(!$queryable && $queryable!==false && $queryable_hid!=2) $queryable=$def->get_queryable();\n else $queryable=($queryable=='on'?1:0);\n $browsable=$p->get('browsable');\n $browsable_hid=$p->get('browsable_HID');\n if(!$browsable && $browsable!==false && $browsable_hid!=2) $browsable=$def->get_browsable();\n else $browsable=($browsable=='on'?1:0);\n $translatable=$p->get('translatable');\n $translatable_hid=$p->get('translatable_HID');\n if(!$translatable && $translatable!==false && $translatable_hid!=2) $translatable=$def->get_translatable();\n else $translatable=($translatable=='on'?1:0);\n $multivalued=$p->get('multivalued');\n $multivalued_hid=$p->get('multivalued_HID');\n if(!$multivalued && $multivalued!==false && $multivalued_hid!=2) $multivalued=$def->get_multivalued();\n else $multivalued=($multivalued=='on'?1:0);\n $published=$p->get('published');\n $published_hid=$p->get('published_HID');\n if(!$published && $published!==false && $published_hid!=2) $published=$def->get_published();\n else $published=($published=='on'?1:0);\n $label=$p->get('label');\n $target=$p->get('target');\n if(empty($target)) $target=$def->get_target();\n $batch=$p->get('batch');\n $options=$p->get('options');\n $error=false;\n\n // Remplissage des options non definit\n $def->_options->procDialog($def,$options);\n if(!$this->fieldDescIsCorrect($field,$ftype,$fcount,$forder,$compulsory,$queryable,$browsable,$translatable,$multivalued,$published,\n\t\t\t\t $target,$label)) {\n $message='Incorrect description ! Try again.<br/>';\n $error=true;\n }else{\n $this->sql_changeFieldDesc($field,$ftype,$fcount,$forder,$compulsory,$queryable,$browsable,$translatable,$multivalued,$published,\n\t\t\t\t $target,$label,$XLANG->codes,$options);\n $this->majOtherFieldOrder($field,$def->get_forder(),$forder);\n $this->sql_changeField($field,$ftype,$fcount);\n $this->changeDesc($field,$ftype,$fcount,$forder,$compulsory,$queryable,$browsable,$translatable,$multivalued,$published,$target,\n\t\t\t$label);\n $message.='Field '.$field.' modified.<br/>';\n }\n // Convertit les données présentes en base si necessaire\n $this->desc[$field]->convertValues($def->get_ftype());\n\n // Efface le cache\n XDbIni::clear('modules'.$this->base);\n // efface le cache des chronos\n XDbIni::clear('Chrono%'.$this->base.'%');\n return array('message'=>$message,'error'=>$error);\n }", "function _blockCampo($app,$id,$prefix,$logError)\n {\n $update=$app['dbs']['mysql_silex']->update($prefix.'user_form_type', array('block' =>1), array('id' => $id)); \n $logError->addLine('Admin Campos FB',\"{user_form_type}\",\"Campo Bloqueado \".$id, $_SESSION[\"uid\"]);\n return $update;\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }", "public function callback_savepass($field, $row)\n {\n }" ]
[ "0.60656714", "0.5660246", "0.5348168", "0.5318474", "0.53067577", "0.5261112", "0.5254308", "0.5175216", "0.5024364", "0.5006042", "0.49370283", "0.49361286", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043", "0.49202043" ]
0.64965254
0
/SystemPaths::getScriptPath(); print_r($_SERVER); die; $this>assertSame($this>dir, SystemPaths::getScriptPath());
public function testGetScriptPath() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testValidPath2() {\n $path = DATA_DIR.'templates';\n AbstractTemplate::setPath($path);\n $this->assertNotSame($path, AbstractTemplate::getPath());\n $this->assertSame(\"$path/\", AbstractTemplate::getPath());\n }", "public function testValidPath1() {\n $path = DATA_DIR.'templates/';\n AbstractTemplate::setPath($path);\n $this->assertSame($path, AbstractTemplate::getPath());\n }", "public function testGetNodeScriptsPath()\n\t{\n\t\t$path = Paths::getNodeScriptsPath();\n\t\t$this->assertDirectoryExists( $path );\n\n\t\t// Contains chromiumpath.js\n\t\t$this->assertFileExists( $path . DIRECTORY_SEPARATOR . 'chromiumpath.js' );\n\t}", "public function testDir()\n {\n $actual = Solar_Class::dir(get_class($this));\n $expect = dirname(__FILE__) . '/Class/';\n \n // to avoid include-vs-source difference, compare only the tails\n $len = strlen(get_class($this)) * -1 - 1;\n $actual = substr($actual, $len);\n $expect = substr($expect, $len);\n \n $this->assertSame($actual, $expect);\n }", "public function testGetBasePath()\n {\n $result = $this->getProtectedMethod($this->client, 'getBasePath', ['version']);\n\n $this->assertEquals(self::BASE_URI.self::VERSION.'/', $result);\n }", "public function testIfGettingDirPathWorks() : void\n {\n\n $path = new Path('config');\n\n $this->assertEquals('config', $path->getPath());\n $this->assertEquals('config/', $path->getPath(true));\n }", "function path_base ($path=''){ return realpath(__DIR__.\"/../\").DIRECTORY_SEPARATOR.$path; }", "public function unit_test_get_base_path_private_method( $path ) {\n\t\treturn $this->get_base_path( $path );\n\t}", "public function testBase()\n {\n $base = $this->app->request()->base;\n $this->assertEquals('/subdir', $base);\n }", "abstract public function getBasePath();", "public function testFindConfigFile2() {\n\t\tself::$defaultCfgFile =\n\t\t\tsys_get_temp_dir() . DIRECTORY_SEPARATOR . \".htscrivo\";\n\t\t// It's an hack, but then again this global was assigned the value of\n\t\t// the phpunit PHP script anyway.\n\t\t$_SERVER[\"SCRIPT_FILENAME\"] = self::$defaultCfgFile;\n\t\tcopy(\"test_config\", self::$defaultCfgFile);\n\t\t// This uses $_SERVER[\"SCRIPT_FILENAME\"]\n\t\t$cfg = new \\Scrivo\\Config();\n\t\t$this->assertNotNull($cfg);\n\t}", "public function getBasePath(): string;", "public function testUrlInPath(): void\n {\n $config = ['environment' => ['REQUEST_URI' => '/jump/http://cakephp.org']];\n $request = new ServerRequest($config);\n $this->assertSame('/jump/http://cakephp.org', $request->getRequestTarget());\n\n $config = ['environment' => [\n 'REQUEST_URI' => Configure::read('App.fullBaseUrl') . '/jump/http://cakephp.org',\n ]];\n $request = new ServerRequest($config);\n $this->assertSame('/jump/http://cakephp.org', $request->getRequestTarget());\n }", "public function testPath() {\n\t\t$this->assertEquals(APP_TEMP . 'io/file', $this->object->path());\n\t\t$this->assertEquals(APP_TEMP . 'io/temp', $this->temp->path());\n\t}", "public function testCanSetPath()\n {\n $reader= new GitHashReader(new Filesystem(), __DIR__ . '/stubs', 'git-mock');\n\n $this->assertSame(__DIR__ . '/stubs/git-mock', $reader->getPath());\n }", "function base_path()\n {\n return dirname(__DIR__);\n }", "public static function testConfig(){\n \n $l=\"\";\n \n if(\"http://\".$_SERVER[\"HTTP_HOST\"]==Site::$host){\n $l.=self::logLine(\"Site::\\$host and current domain match\",\"green\");\n }else{\n $l.=self::logLine(\"Site::host and current domain don't match\",\"orange\"); \n $l.=self::logLine(\"It's just a warning, maybe your project is multidomain and it will work\"); \n $l.=self::logLine(\"http://\".$_SERVER[\"HTTP_HOST\"].\" != \".Site::$host,\"grey\"); \n }\n \n if($_SERVER[\"SCRIPT_NAME\"]==Site::$root.\"/index.php\"){\n $l.=self::logLine(\"Site::\\$root and current folder match\",\"green\",true);\n }else{\n $l.=self::logLine(\"Site::\\$root and current folder don't match\",\"red\",true); \n $l.=self::logLine($_SERVER[\"SCRIPT_NAME\"].\" != \".Site::$root.\"/index.php\",\"grey\"); \n }\n var_dump($_SERVER);\n return $l;\n \n \n\n }", "public static function getTestDir()\n {\n return realpath(dirname(__DIR__)); \n }", "public function testTheSuperSakeFileIsInWebRoot()\n {\n $this->assertTrue(is_file(BASE_PATH.'/supersake'));\n }", "public function testDoesNotRebindBasePath()\n {\n $base = 'src';\n $this->container->add('path.base', $base);\n $this->bootstrapper->bootstrapPaths();\n\n $this->assertEquals($base, $this->container->get('path.base'));\n }", "function dirPath() {return (\"../../../../\"); }", "public function getPath(): string\n {\n return __DIR__;\n }", "public function environmentPath()\n {\n }", "public function it_can_get_default_path()\n {\n static::assertSame(\n realpath(static::getRootPath().'/stubs'),\n Stub::getBasePath()\n );\n\n static::assertSame(\n realpath(static::getFixturesPath().'/stubs'),\n CustomStub::getBasePath()\n );\n }", "public function __construct()\n\t{\n\t\t$site = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/'));\n\t\t\n\t\t// relative path\n if(!defined('SITEPATH_LOCAL')) define('SITEPATH_LOCAL', $site);\n\t\t// absolute path (eg for AJAXy stuff)\n\t\t$http = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https' : 'http';\n\t\t$path = $http . '://' . $_SERVER['SERVER_NAME'] . SITEPATH_LOCAL;\n\t\tif(!defined('SITEPATH_ABSOLUTE')) define('SITEPATH_ABSOLUTE', $path);\n\t}", "function GetSerevrPath()\n{\n return $_SERVER['DOCUMENT_ROOT']; // => G:/AppServ/www\n \n}", "public function testGetModulePathsAlreadySet()\n {\n $this->setMockResolverClass();\n $resolver = ModuleResolver::getInstance();\n $this->setMockResolverProperties($resolver, [\"example\" . DIRECTORY_SEPARATOR . \"paths\"]);\n $this->assertEquals([\"example\" . DIRECTORY_SEPARATOR . \"paths\"], $resolver->getModulesPath());\n }", "public function testRelativeUrl()\n {\n $url = 'login';\n $base = $this->app->request()->base;\n $this->assertEquals('/subdir/login', $this->getBaseUrl($base, $url));\n }", "public function testBaseOverride()\n {\n $url = 'login';\n if ($this->app->get('plumephp.base_url') !== null) {\n $base = $this->app->get('plumephp.base_url');\n } else {\n $base = $this->app->request()->base;\n }\n\n $this->assertEquals('/testdir/login', $this->getBaseUrl($base, $url));\n }", "public function testValidatePath(){\n $template = array(\n 'path' => Settings::MANDATORY | Settings::PATH,\n 'dir' => Settings::PATH,\n );\n $this->config->path = __FILE__;\n $this->config->dir = dirname(__FILE__);\n // test\n $this->assertTrue( $this->config->validate($template) );\n }" ]
[ "0.6634159", "0.6616636", "0.65857416", "0.647502", "0.6445061", "0.63872653", "0.63383985", "0.6299899", "0.62005943", "0.61680967", "0.6165286", "0.6122578", "0.61110437", "0.6096093", "0.6054087", "0.6037368", "0.59244937", "0.5910804", "0.5910672", "0.5873765", "0.5849775", "0.58350474", "0.58305794", "0.5827025", "0.5826735", "0.5816538", "0.5816255", "0.5815242", "0.5812285", "0.5811104" ]
0.74309516
0
/ Activate licenses for main plugin and all premium addons
protected function activate_licenses() { // listen for our activate button to be clicked if( isset( $_POST['pmxi_license_activate'] ) ) { // retrieve the license from the database $options = PMXI_Plugin::getInstance()->getOption(); foreach ($_POST['pmxi_license_activate'] as $class => $val) { if (!empty($options['licenses'][$class])){ $product_name = (method_exists($class, 'getEddName')) ? call_user_func(array($class, 'getEddName')) : false; if ( $product_name !== false ){ // data to send in our API request $api_params = array( 'edd_action'=> 'activate_license', 'license' => $options['licenses'][$class], 'item_name' => urlencode( $product_name ) // the name of our product in EDD ); // Call the custom API. $response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) ); // make sure the response came back okay if ( is_wp_error( $response ) ) continue; // decode the license data $license_data = json_decode( wp_remote_retrieve_body( $response ) ); // $license_data->license will be either "active" or "inactive" $options['statuses'][$class] = $license_data->license; PMXI_Plugin::getInstance()->updateOption($options); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ssp_plugin_updater_activate_license() {\n\tif ( 'valid' == get_transient( 'ssp_license_status' ) ) {\n\t\treturn;\n\t}\n\n\t// data to send in our API request\n\t$api_params = array( \n\t\t'edd_action' => 'activate_license', \n\t\t'license' => '33d741209efc16e45237d3840800f958', \n\t\t'item_name' => urlencode( 'Shoestrap Extras Pack' )\n\t);\n\t\t\n\t// Call the custom API.\n\t$response = wp_remote_get( add_query_arg( $api_params, 'http://shoestrap.org' ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t// make sure the response came back okay\n\tif ( is_wp_error( $response ) ) {\n\t\treturn false;\n\t}\n\n\t// decode the license data\n\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\tif ( 'valid' == $license_data->license ) {\n\t\t// If the license is valid, cache th response for 3 days\n\t\tset_transient( 'ssp_license_status', $license_data->license, 72 * 60 * 60 );\n\t} else {\n\t\t// If the license is NOT valid, cache the response for 3 hours.\n\t\tset_transient( 'ssp_license_status', $license_data->license, 3 * 60 * 60 );\n\t}\n}", "function kultalusikka_theme_activate_license() {\n\n\tif( isset( $_POST['kultalusikka_theme_license_activate'] ) ) { \n\t \tif( ! check_admin_referer( 'kultalusikka_license_nonce', 'kultalusikka_license_nonce' ) ) \t\n\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\tglobal $wp_version;\n\n\t\t$license = trim( hybrid_get_setting( 'kultalusikka_license_key' ) );\n\t\t\t\t\n\t\t$api_params = array( \n\t\t\t'edd_action' => 'activate_license', \n\t\t\t'license' => $license, \n\t\t\t'item_name' => urlencode( KULTALUSIKKA_SL_THEME_NAME ) \n\t\t);\n\t\t\n\t\t$response = wp_remote_get( add_query_arg( $api_params, KULTALUSIKKA_SL_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\n\t\t// $license_data->license will be either \"active\" or \"inactive\"\n\n\t\tupdate_option( 'kultalusikka_license_key_status', $license_data->license );\n\n\t}\n}", "public function oceanwp_activate_license() {\r\n\t \t\r\n\t \tif ( !isset( $_POST['oceanwp_options'] ) || !isset( $_POST['oceanwp_licensekey_activateall'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !isset( $_POST['oceanwp_options']['licenses'][ $this->item_shortname . '_license_key'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif ( strpos( $_POST['oceanwp_options']['licenses'][$this->item_shortname . '_license_key'], \"XXX\" ) !== FALSE && $this->license_key ) {\r\n \t$_POST['oceanwp_options']['licenses'][$this->item_shortname . '_license_key'] = $this->license_key;\r\n }\r\n\t\t\t\r\n\t\t\t$license = sanitize_text_field( wp_unslash( $_POST['oceanwp_options']['licenses'][ $this->item_shortname . '_license_key'] ) );\r\n\r\n\t\t\tif ( trim( $license ) == '' ) {\r\n\r\n\t\t\t\t//Remove license data and update it\r\n\t\t\t\t$this->oceanwp_delete_response( $this->item_shortname );\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Data to send to the API\r\n\t\t\t$api_params = array(\r\n\t\t\t\t'edd_action' => 'activate_license',\r\n\t\t\t\t'license' => $license,\r\n\t 'item_name' => isset( $this->item_name ) ? $this->item_name : false,\r\n\t\t\t\t'url' => home_url()\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t// Call the API\r\n\t\t\t$response = wp_remote_post(\r\n\t\t\t\t$this->api_url,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'timeout' => 15,\r\n\t\t\t\t\t'sslverify' => false,\r\n\t\t\t\t\t'body' => $api_params\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\t// Make sure there are no errors\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Tell WordPress to look for updates\r\n\t\t\tset_site_transient( 'update_plugins', null );\r\n\t\t\t\r\n\t\t\t// Decode license data\r\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\r\n\r\n\t\t\t$this->update_oceanwp_option($this->item_shortname . '_license_active', $license_data->license);\r\n\r\n\t\t\t//Check license response data exists and update\r\n\t\t\tif( !empty( $license_data ) ) {\r\n\t\t\t\t$this->oceanwp_update_response( $this->item_shortname, $license_data );\r\n\t\t\t}\r\n\r\n\t\t\tif( !(bool) $license_data->success ) {\r\n\t\t\t\tset_transient( 'edd_license_error', $license_data, 1000 );\r\n\t\t\t} else {\r\n\t\t\t\tdelete_transient( 'edd_license_error' );\r\n\t\t\t}\r\n\t }", "public function activate_license() {\n\t\tif ( isset( $_POST[ $this->slug . '_license_activate'], $_POST[ $this->key_name ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t\tif ( ! check_admin_referer( 'sliced_license_nonce', 'sliced_license_nonce_' . $this->slug ) ) {\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\t\t\t}\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => sanitize_text_field( $_POST[ $this->key_name ] ),\n\t\t\t\t'item_name' => urlencode( $this->name ), // the name of our product in EDD\n\t\t\t\t'url' => home_url(),\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( $this->store_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\t\t\t$licenses = get_option( 'sliced_licenses' );\n\t\t\t$licenses[ $this->key_name ] = trim( $api_params['license'] );\n\t\t\t$licenses[ $this->status_name ] = trim( $license_data->license );\n\n\t\t\tupdate_option( 'sliced_licenses', $licenses );\n\n\t\t\t$this->license_key = $licenses[ $this->key_name ];\n\t\t\t$this->license_status = $licenses[ $this->status_name ];\n\t\t\t//wp_redirect( admin_url( 'admin.php?page=sliced_licenses' ) );\n\t\t\t//exit;\n\t\t}\n\t}", "function licenseActivate() {\n if( isset( $_POST['edd_license_activate'] ) ) {\n\t\t\t\n // run a quick security check \n if( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) ) \n return; // get out if we didn't click the Activate button\n\n // retrieve the license from the database\n $license = trim( $_POST['sg90_license_key'] );\n\n // data to send in our API request\n $api_params = array( \n 'edd_action'=> 'activate_license', \n 'license' => $license, \n 'item_name' => urlencode( EDD_SAMPLE_ITEM_NAME )\n );\n \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SAMPLE_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false;\n\n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n \n // $license_data->license will be either \"active\" or \"inactive\"\n\n update_option( 'sg90_license_status', $license_data->license );\n update_option( 'sg90_license', $_POST['sg90_license_key'] );\n\n }\n }", "function activate_license() {\n\t\tglobal $wp_version;\n\t\t$ss_settings = get_option( 'shoestrap' );\n\n\t\t// Only continue if the status transient is not set to 'valid'.\n\t\tif ( get_transient( $this->field_name . '_status' ) == 'valid' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// data to send in our API request\n\t\t$api_params = array(\n\t\t\t'edd_action'=> 'activate_license',\n\t\t\t'license' \t=> $this->license,\n\t\t\t'item_name' => urlencode( $this->item_name )\n\t\t);\n\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get(\n\t\t\tadd_query_arg( $api_params, $this->remote_api_url ),\n\t\t\tarray( 'timeout' => 15, 'sslverify' => false )\n\t\t);\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t// Set the transient for 6 hours.\n\t\tset_transient( $this->field_name . '_status', $license_data->license, 6 * 60 * 60 );\n\t}", "function wcap_agile_edd_ac_activate_license() {\n if ( isset( $_POST['edd_agile_license_activate'] ) ) { \n // run a quick security check\n if ( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) )\n return; // get out if we didn't click the Activate button \n // retrieve the license from the database\n $license = trim( get_option( 'edd_sample_license_key_agile_woo' ) ); \n // data to send in our API request\n $api_params = array(\n 'edd_action'=> 'activate_license',\n 'license' => $license,\n 'item_name' => urlencode( EDD_SL_ITEM_NAME_AGILE_WOO ) // the name of our product in EDD\n ); \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SL_STORE_URL_AGILE_WOO ), array( 'timeout' => 15, 'sslverify' => false ) ); \n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false; \n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) ); \n // $license_data->license will be either \"active\" or \"inactive\" \n update_option( 'edd_sample_license_status_agile_woo', $license_data->license ); \n }\n }", "function tux_su_licenses_admin_create() {\n\n\tif ( ! current_user_can( 'administrator' ) || ! isset( $_POST['tux_su_nonce'], $_POST['tux_product_id'], $_POST['tux_user_id'] ) || ! wp_verify_nonce( $_POST['tux_su_nonce'], 'tux_create_edit_license' ) ) {\n\n\t\treturn;\n\n\t}\n\n\t$user_id = absint( $_POST['tux_user_id'] );\n\t$user = get_userdata( $user_id );\n\t$user_name = '';\n\n\tif ( false !== $user ) {\n\n\t\t$user_name = $user->user_login;\n\n\t}\n\n\tif ( isset( $_POST['tux_created_year'], $_POST['tux_created_month'], $_POST['tux_created_day'] ) ) {\n\n\t\t$year = absint( $_POST['tux_created_year'] );\n\t\t$month = absint( $_POST['tux_created_month'] );\n\t\t$day = absint( $_POST['tux_created_day'] );\n\n\t} else {\n\n\t\t$year = current_time( 'Y' );\n\t\t$month = current_time( 'm' );\n\t\t$day = current_time( 'd' );\n\n\t}\n\n\t$activations = array();\n\n\tif ( isset( $_POST['tux_id'] ) ) {\n\n\t\t$license = tux_su_get_db( array(\n\t\t\t'id' => $_POST['tux_id'],\n\t\t) );\n\n\t\t$license = reset( $license );\n\n\t\tif ( isset( $license['info'] ) ) {\n\n\t\t\t$license['info'] = maybe_unserialize( $license['info'] );\n\n\t\t}\n\n\t\tif ( isset( $license['info']['activations'] ) ) {\n\n\t\t\t$activations = $license['info']['activations'];\n\n\t\t}\n\t}\n\n\tif ( isset( $_POST['activation_delete'] ) ) {\n\n\t\tforeach ( $_POST['activation_delete'] as $activation_delete ) {\n\n\t\t\tunset( $activations[ $activation_delete ] );\n\n\t\t}\n\t}\n\n\t$tux_insert = tux_su_update_db( array(\n\t\t'id' => isset( $_POST['tux_id'] ) ? $_POST['tux_id'] : 0,\n\t\t'user_id' => $user_id,\n\t\t'product_id' => $_POST['tux_product_id'],\n\t\t'type' => 'license',\n\t\t'info' => array(\n\t\t\t'child_id' => ! empty( $_POST['tux_child_id'] ) ? absint( $_POST['tux_child_id'] ) : 0,\n\t\t\t'order_id' => isset( $_POST['tux_order_id'] ) ? absint( $_POST['tux_order_id'] ) : 0,\n\t\t\t'user_name' => wp_strip_all_tags( $user_name ),\n\t\t\t'activations' => $activations,\n\t\t),\n\t\t'created' => date( 'Y-m-d', strtotime( \"{$year}-{$month}-{$day}\" ) ),\n\t) );\n\n\t$sendback = admin_url( 'admin.php?page=tuxedo-su-licenses' );\n\n\tif ( false === $tux_insert ) {\n\n\t\t$sendback = add_query_arg( 'updated', 'error', $sendback );\n\n\t} else {\n\n\t\t$sendback = add_query_arg( 'updated', 'success', $sendback );\n\n\t}\n\n\twp_redirect( $sendback );\n\texit();\n\n}", "function register_licence_assets( $hook ) {\r\n\r\n\t\t//only execute on plugin settings page\r\n\t\tif ( $hook == $this->settings_page ) {\r\n\t\t\t//JS for AJAX Activation\r\n\t\t\twp_register_script( 'wordimpress_licencing_js', WQC_PLUGIN_URL . '/includes/license/assets/js/licence.js' );\r\n\t\t\twp_enqueue_script( 'wordimpress_licencing_js' );\r\n\r\n\t\t\t// in javascript, object properties are accessed as ajax_object.ajax_url, ajax_object.we_value\r\n\t\t\twp_localize_script( 'wordimpress_licencing_js', 'ajax_object',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'ajax_url' => admin_url( 'admin-ajax.php' )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\t//CSS\r\n\t\t\twp_register_style( 'wordimpress_licencing_css', WQC_PLUGIN_URL . '/includes/license/assets/css/licence.css' );\r\n\t\t\twp_enqueue_style( 'wordimpress_licencing_css' );\r\n\r\n\r\n\t\t\t/**\r\n\t\t\t * Check License Transient\r\n\t\t\t */\r\n\t\t\t//uncomment to test transient\r\n\t\t\t//delete_transient( $this->settings_page );\r\n\t\t\t//Check if license activated\r\n\t\t\t//get license options array\r\n\t\t\t$license_options = get_option( $this->licence_key_option );\r\n\r\n\t\t\tif ( $this->is_license_active() ) {\r\n\r\n\t\t\t\t//Check transient if valid still\r\n\t\t\t\t$transient = get_transient( $this->settings_page );\r\n\r\n\t\t\t\t//transient is present\r\n\t\t\t\tif ( $transient ) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} //verify license is active before triggering check with API\r\n\t\t\t\telseif ( isset( $license_options['license_status'] ) && $license_options['license_status'] == 'valid' ) {\r\n\t\t\t\t\t//No transient so check if license active\r\n\t\t\t\t\t$this->edd_check_license();\r\n\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public static function maybe_activate_license() {\n\t\tif ( ! isset( $_REQUEST['security'] ) ) {\n\t\t\tself::ajax_fail( 'Forget something?' ); }\n\n\t\t$nonce = $_REQUEST['security'];\n\t\tif ( ! wp_verify_nonce( $nonce, self::NONCE ) ) {\n\t\t\tself::ajax_fail( 'Not going to fall for it!' ); }\n\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\n\t\t\treturn; }\n\n\t\tif ( ! isset( $_REQUEST['license'] ) ) {\n\t\t\tself::ajax_fail( 'No license key submitted' );\n\t\t}\n\n\t\tupdate_option( self::LICENSE_KEY_OPTION, $_REQUEST['license'] );\n\t\tself::$license_key = $_REQUEST['license'];\n\n\t\t$activated = self::activate_license();\n\t\t$message = ( $activated ) ? __( 'Thank you for supporting the future of Sprout Clients and Sprout Apps.' , 'sprout-invoices' ) : __( 'License is not active.' , 'sprout-invoices' );\n\t\t$response = array(\n\t\t\t\t'activated' => $activated,\n\t\t\t\t'response' => $message,\n\t\t\t\t'error' => ! $activated,\n\t\t\t);\n\n\t\theader( 'Content-type: application/json' );\n\t\techo json_encode( $response );\n\t\texit();\n\t}", "function wcap_activate_license_key_agile_woo_callback() {\n \n $license = get_option( 'edd_sample_license_key_agile_woo' );\n $status = get_option( 'edd_sample_license_status_agile_woo' );\n ?>\n <form method=\"post\" action=\"options.php\">\n <?php if ( false !== $license ) { ?>\n <?php if( $status !== false && $status == 'valid' ) { ?>\n <span style=\"color:green;\"><?php _e( 'active' ); ?></span>\n <?php wp_nonce_field( 'edd_sample_nonce' , 'edd_sample_nonce' ); ?>\n <input type=\"submit\" class=\"button-secondary\" name=\"edd_agile_license_deactivate\" value=\"<?php _e( 'Deactivate License' ); ?>\"/>\n <?php } else {\n \n wp_nonce_field( 'edd_sample_nonce', 'edd_sample_nonce' ); ?>\n <input type=\"submit\" class=\"button-secondary\" name=\"edd_agile_license_activate\" value=\"Activate License\"/>\n <?php } ?>\n <?php } ?>\n \n \n </form>\n <?php \n }", "function process_license() {\n\t\tglobal $wp_version;\n\t\t$process = false;\n\t\t$action = 'activate_license';\n\t\t\n\t\tif ( $this->single_license ) {\n\t\t\t// This is an auto-activated license so keep processing it.\n\t\t\t// do not process if license is already valid.\n\t\t\tif ( get_option( $this->field_name . '_status' ) != 'valid' )\n\t\t\t\t$process = true;\n\n\t\t} else {\n\t\t\t// listen for our activate button to be clicked\n\t\t\tif ( isset( $_POST[$this->field_name . '_activate'] ) && check_admin_referer( $this->field_name . '_nonce', $this->field_name . '_nonce' ) )\n\t\t\t\t$process = true;\n\n\t\t\t// do not process if license is already valid.\n\t\t\tif ( get_option( $this->field_name . '_status' ) == 'valid' )\n\t\t\t\t$process = false;\n\n\t\t\t// If he just hit the de-activate button, keep procesing and set action to 'deactivate_license'.\n\t\t\tif ( isset( $_POST[$this->field_name . '_deactivate'] ) && check_admin_referer( $this->field_name . '_nonce', $this->field_name . '_nonce' ) ) {\n\t\t\t\t$process = true;\n\t\t\t\t$action = 'deactivate_license';\n\t\t\t}\n\t\t}\n\n\n\t\tif ( !$process )\n\t\t\treturn;\n\n\t\t// retrieve the license from the database\n\t\t$license = trim( get_option( $this->field_name . '_key' ) );\n\n\t\t// data to send in our API request\n\t\t$api_params = array(\n\t\t\t'edd_action'=> $action,\n\t\t\t'license' \t=> $license,\n\t\t\t'item_name' => urlencode( $this->item_name )\n\t\t);\n\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get(\n\t\t\tadd_query_arg( $api_params, $this->remote_api_url ),\n\t\t\tarray( 'timeout' => 15, 'sslverify' => false )\n\t\t);\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\tupdate_option( $this->field_name . '_status', $license_data->license );\n\t}", "public function hongo_license_activation_callback() {\n\t\t\t\n\t\t /* Check current user permission */\n\t\t if( ! current_user_can( 'manage_options' ) ) {\n\t\t wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'hongo' ) );\n\t\t }\n\n\t\t // For Get Multisite / Single site license activate or not\n\t\t $hongo_is_theme_license_active = hongo_is_theme_license_active();\n\n\t\t // Update license activation\n\t\t $license_message = '';\n\t\t\tif( ! $hongo_is_theme_license_active ) {\n\n\t\t\t\tif( isset( $_GET['token'] ) && isset( $_GET['response'] ) ) {\n\t\t\t\t $hongo_license_token = get_transient( 'hongo_license_token' );\n\t\t\t\t \tif( $_GET['token'] == $hongo_license_token ) {\n\t\t\t\t if( $_GET['response'] == 'true' && isset( $_GET['msg']) ) {\n\t\t\t\t \n\t\t\t\t update_site_option( 'hongo_theme_active', 'yes' );\n\t \t\t\t\tupdate_option( 'hongo_theme_active', 'yes' );\n\t\t\t\t }\n\t\t\t\t if( $_GET['response'] == 'false' && isset( $_GET['msg']) ) {\n\t\t\t\t \t$license_message .= '<div class=\"licence-activated-failed is-dismissible notice error notice-error\"><p>'.esc_attr( $_GET['msg'] ).'</p></div>';\n\t\t\t\t }\n\t\t\t\t if( $_GET['response'] == 'access_denied' && isset( $_GET['msg']) ) {\n\t\t\t\t \t$license_message .= '<div class=\"licence-activated-access-denied is-dismissible notice error notice-error\"><p>'.esc_attr( $_GET['msg'] ).'</p></div>';\n\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 // For Get Multisite / Single site license activate or not\n\t\t $hongo_is_theme_license_active = hongo_is_theme_license_active();\n\n\t\t /* Gets a WP_Theme object for a theme. */\n\t\t $hongo_theme_obj = wp_get_theme();\n\t\t $hongo_theme_name = $hongo_theme_obj->get( 'Name' );\t\t \n\t\t $hongo_theme_name = str_ireplace( array( 'child', ' child' ) , array( '', '' ), $hongo_theme_name );\n\n\t\t /* Demo site URL */\n\t\t $documnetaion_url = \"//hongo.themezaa.com/documentation/\";\n\n\t\t /* Support URL */\n\t\t $support_url = \"//www.themezaa.com/support/\";\n\n\t\t /* Video Tutorials URL */\n\t\t $video_tutorials_url = \"//hongo.themezaa.com/documentation/video-tutorials/\";\n\n\t\t echo '<div class=\"wrap theme-setup-wrap\">';\n\t\t \techo sprintf( '%s', $license_message );\n\t\t\t echo '<div class=\"theme-setup-content\">';\n\n\t \t\t\techo '<h1 class=\"display-none\"></h1>';\n\t \t\t\techo '<div class=\"hongo-header-license\">';\n\n\t \t\t\t\techo '<div class=\"hongo-head-left\">';\n\t \t\t\t\t\techo '<img src=\"' . esc_url( HONGO_THEME_IMAGES_URI . '/import/white-logo.png' ) . '\" alt=\"' . esc_attr( $hongo_theme_name ) . '\" />';\n\t\t\t echo '</div>';\n\t\t\t echo '<div class=\"hongo-head-right\">';\t\t\t \n\t\t\t echo '<span class=\"hongo-version\">' . sprintf( esc_html__( 'Version %s', 'hongo' ), HONGO_THEME_VERSION ) . '</span>';\n\t\t\t echo '<span class=\"link_sep\">|</span>';\n\t\t\t echo '<a target=\"_blank\" href=\"' . esc_url( $documnetaion_url ) . '\">' . esc_html__( 'Online Documentation', 'hongo' ) . '</a>';\n\t\t\t echo '<span class=\"link_sep\">|</span>';\n\t\t\t echo '<a target=\"_blank\" href=\"' . esc_url( $support_url ) . '\">' . esc_html__( 'Support Center', 'hongo' ) . '</a>';\n\t\t\t echo '</div>';\n\t\t\t echo '<div class=\"clear\"></div>';\n\t\t\t echo '</div>';\n\n\t\t\t echo '<div class=\"hongo-welcome-wrap\">';\n\t\t\t \techo '<div class=\"hongo-welcome-wrapper\">';\n\t\t\t \t\techo '<div class=\"welcome-title\">';\n\t\t\t \t\t\techo '<h2>' . sprintf( esc_html__( 'Welcome to %s', 'hongo' ), $hongo_theme_name ) . '</h2>';\n\t\t\t \t\techo '</div>';\n\t\t\t \t\techo '<div class=\"welcome-description\">';\n\t\t\t \t\tif( $hongo_is_theme_license_active ) {\n\t\t\t \t\t\techo '<p>' . sprintf( esc_html__( 'Awesome! Your %s WordPress theme license is already activated. Enjoy premium features of %s.', 'hongo' ), $hongo_theme_name, $hongo_theme_name ) . '</p>';\n\t\t\t\t \t} else {\n\t\t\t\t \t\techo '<p>' . sprintf( esc_html__( 'Please activate your %s theme license copy and enjoy premium features.', 'hongo' ), $hongo_theme_name ) . '</p>';\n\t\t\t\t \t}\n\t\t\t\t \techo '</div>';\n\t\t\t \techo '</div>';\n\t\t\t echo '</div>';\n\n\t\t\t echo '<div class=\"hongo-import-tab\">';\n\t\t \t\techo '<ul>';\n\n \t\t\t\t\t\t$steps = array( \n \t\t\t\t\t\t\t'1' => esc_html__( 'Theme License', 'hongo' ),\n \t\t\t\t\t\t\t'2' => esc_html__( 'Install Plugins', 'hongo' ),\n \t\t\t\t\t\t\t'3' => esc_html__( 'Import Demo', 'hongo' ),\n \t\t\t\t\t\t);\n \t\t\t\t\t\tif( hongo_is_woocommerce_activated() ) {\n\n \t\t\t\t\t\t\t$steps['4'] = esc_html__( 'WooCommerce', 'hongo' );\n \t\t\t\t\t\t}\n \t\t\t\t\t\t$step = isset( $_GET['step'] ) ? $_GET['step'] : '1';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach( $steps as $key => $value ) {\n\t\t\t\t\t\t\t\t$active_class = '';\n\t\t\t\t\t\t\t\tif ( $key == $step ) {\n\t\t\t\t\t\t\t\t\t$active_class = ' class=\"active\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$url = add_query_arg(\n\t \t\t\t\t\t\t\tarray(\n\t \t\t\t\t\t\t\t\t'page' => 'hongo-theme-setup',\n\t \t\t\t\t\t\t\t\t'step' => $key\n\t \t\t\t\t\t\t\t), admin_url( 'themes.php' )\n\t \t\t\t\t\t\t);\n\t\t\t\t\t\t\t\techo '<li><a href=\"'. esc_url( $url ) .'\"'.$active_class.'>'. $value .'</a></li>';\n\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\techo '</ul>';\n\t\t \t\techo '</div>';\n\n $step = isset( $_GET['step'] ) ? $_GET['step'] : '1';\n if( $step ) {\n\n \techo '<div class=\"hongo-import-tab-content\">';\n \t\tswitch( $step ) {\n\n \t\tcase '1' :\n \t\t\t\techo '<div class=\"hongo-license-box\">'; \t\t\t\t\t\n \t\t\t\t\t\techo '<div class=\"hongo-license-top-content\">';\n \t\t\t\t\t\techo '<div class=\"hongo-license-left-content\">';\n \t\t\t\t\t\t\techo '<div class=\"hongo-license-left-top-inner\">';\n\t \t\t\t\t\t\t\techo '<img src=\"' . esc_url( HONGO_THEME_IMAGES_URI . '/import/smile-icon.png' ) . '\" alt=\"' . esc_attr( $hongo_theme_name ) . '\" />';\n\t\t\t\t \t\t\t\techo '<div class=\"hongo-license-left-right-inner\">';\n\t\t\t\t \t\t\t\t\techo '<span>' . sprintf( esc_html__( 'Thanks for using %s theme', 'hongo' ), $hongo_theme_name ) . '</span>';\n\t\t\t\t\t \t\t\t\tif( $hongo_is_theme_license_active ) {\n\t\t\t\t\t\t\t\t\t\t \t\t\techo '<p>' . sprintf( esc_html__( 'Awesome! Your %s WordPress theme license is already activated. Enjoy premium features of %s.', 'hongo' ), $hongo_theme_name, $hongo_theme_name ) . '</p>';\n\t\t\t\t\t\t\t\t\t\t\t \t} else {\n\t\t\t\t\t\t\t\t\t\t\t \t\techo '<p>' . sprintf( esc_html__( 'Please activate your %s theme license copy and enjoy premium features.', 'hongo' ), $hongo_theme_name ) . '</p>';\n\t\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t \t\t\techo '</div>';\n\t\t\t\t \t\t\techo '</div>';\n\t\t\t\t \t\t\techo '<div class=\"hongo-license-left-bottom-inner\">';\n\t\t\t\t \t\t\t\tif( ! $hongo_is_theme_license_active ) {\n\t\t\t\t \t\t\t\t\techo '<a class=\"hongo-green-license-btn hongo-license\" href=\"javascript:void(0);\"><img src=\"' . esc_url( HONGO_THEME_IMAGES_URI . '/import/right-active-icon.png' ) . '\" alt=\"' . esc_attr( $hongo_theme_name ) . '\" />'.esc_html__( 'Activate HONGO theme license', 'hongo' ).'</a>';\t\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t\t\techo '<p>' . sprintf( esc_html__( 'Activate your %s theme license by clicking above button to unlock %s premium features like demo data import. Please note that you will need to login to your ThemeForest account from which you have purchased %s theme and allow the access to verify your theme purchase. ', 'hongo' ), $hongo_theme_name, $hongo_theme_name, $hongo_theme_name ) . '<a href=\"' . esc_url( $documnetaion_url ) . '\">'.esc_html__( 'For more details please check this article.', 'hongo' ).'</a></p>';\n\t\t\t\t \t\t\techo '</div>';\t\t\t \t\t\t\t\n\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '<div class=\"hongo-license-right-content\">';\n\t\t\t\t\t \techo '<h3>'. esc_html__( 'Premium Features', 'hongo' ) .'</h3>';\n\t\t\t\t\t \techo '<div class=\"hongo-license-support-content\">';\n\t\t\t\t \t\t\t\techo '<ul>';\n\t\t\t\t \t\t\t\t\t$license_content = array(\n\t\t\t \t\t\t\t\t\t\tesc_html__( 'Lifetime free updates', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( '6 months of support included', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( 'Premium plugins at no cost', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( 'Intuitive and powerful demo data import', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( 'Over 50 pre-built elements', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( '11 ready full store demos', 'hongo' ),\n\t\t\t \t\t\t\t\t\t\tesc_html__( 'Template library', 'hongo' ),\n\t\t\t \t\t\t\t\t\t);\n\t\t\t\t \t\t\t\t\tforeach( $license_content as $single_content ) {\n\t\t\t\t \t\t\t\t\t\techo '<li>';\n\t\t\t\t \t\t\t\t\t\t\techo '<img src=\"' . esc_url( HONGO_THEME_IMAGES_URI.'/import/right-icon.png' ) . '\" alt=\"#\" /><span>' . $single_content . '</span>';\n\t\t\t\t \t\t\t\t\t\techo '</li>';\n\t\t\t\t \t\t\t\t\t}\n\t\t\t\t \t\t\t\techo '</ul>';\n\t\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '<div class=\"hongo-license-bottom-content\">';\n\t\t\t\t\t \techo '<ul>';\n\t\t\t\t\t\t \techo '<li class=\"license-documentation\">';\n\t\t\t\t\t\t \t\techo '<a href=\"' . esc_url( $documnetaion_url ) . '\" target=\"_blank\"><img src=\"' . esc_url( HONGO_THEME_IMAGES_URI.'/import/online-documentation.png' ) . '\" alt=\"'.esc_attr__( 'Icon', 'hongo' ) .'\" /><span>'.esc_html__( 'Online Documentation', 'hongo' ) .'</span></a>';\n\t\t\t\t\t\t \techo '</li>';\n\t\t\t\t\t\t \techo '<li class=\"license-support\">';\n\t\t\t\t\t\t \t\techo '<a href=\"' . esc_url( $support_url ) . '\" target=\"_blank\"><img src=\"' . esc_url( HONGO_THEME_IMAGES_URI.'/import/support-center.png' ) . '\" alt=\"'.esc_attr__( 'Icon', 'hongo' ) .'\" /><span>'.esc_html__( 'Support Center', 'hongo' ) .'</span></a>';\n\t\t\t\t\t\t \techo '</li>';\n\t\t\t\t\t\t \techo '<li class=\"license-video\">';\n\t\t\t\t\t\t \t\techo '<a href=\"' . esc_url( $video_tutorials_url ) . '\" target=\"_blank\"><img src=\"' . esc_url( HONGO_THEME_IMAGES_URI.'/import/video-tutorials.png' ) . '\" alt=\"'.esc_attr__( 'Icon', 'hongo' ) .'\" /><span>'.esc_html__( 'Video Tutorials', 'hongo' ) .'</span></a>';\n\t\t\t\t\t\t \techo '</li>';\n\t\t\t\t\t\t echo '</ul>';\n\t\t\t\t\t echo '</div>';\n\t\t\t\t echo '</div>';\n\n \t\t\tbreak;\n\n \t\tcase '2' :\n \t\t\t\tif( ! hongo_is_hongo_addons_activated() || ! $hongo_is_theme_license_active ) {\n \t\t\t\t\t\n\t \t\t\t\techo '<div class=\"import-content-notices\">';\t\t\t\t \n\t\t\t\t\t echo '<div class=\"import-export-desc import-install-plugins\">';\n\t\t\t\t\t \techo '<h3><i class=\"fas fa-info-circle\"></i>' . __( 'Important Notice: ', 'hongo' ) . '<span>'.__( 'Theme license must be activated to install theme bundled premium plugins. Hongo Addons plugin must be activated to import demo data.', 'hongo' ).'</span></h3>';\n\t\t\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '</div>';\n\t\t\t\t\t }\n\n \t\t\tdo_action( 'hongo_theme_setup_plugins' );\n \t\t\tbreak;\n\n \t\tcase '3' :\n\n \t\t\t\tif( ! ( hongo_is_hongo_addons_activated() && $hongo_is_theme_license_active ) ) {\n\n\t\t\t\t\t\t\t\t $theme_setup_url = admin_url( 'themes.php' );\n\t\t\t\t\t\t\t\t $theme_license_url = add_query_arg( array( 'page' => 'hongo-theme-setup', 'step' => '1', ), $theme_setup_url );\n\t\t\t\t\t\t\t\t $plugin_setup_url = add_query_arg( array( 'page' => 'hongo-theme-setup', 'step' => '2', ), $theme_setup_url );\n\n \t\t\t\t\techo '<div class=\"import-content-notices\">';\n\t\t\t\t\t echo '<div class=\"import-export-desc import-install-plugins\">';\n\t\t\t\t\t \tif( ! $hongo_is_theme_license_active ) {\n\n\t\t\t\t\t \techo '<h3><i class=\"fas fa-info-circle\"></i>'.__( 'Important Notice: ', 'hongo' ).'<span>'. sprintf( esc_html__( 'Please %s your %s theme license and install %s plugin to enjoy premium features of import demo data.', 'hongo' ), '<a href=\"' . esc_url( $theme_license_url ) . '\">activate</a>', $hongo_theme_name, '<a href=\"' . esc_url( $plugin_setup_url ) . '\">Hongo Addons</a>' ).'</span></h3>';\n\n\t\t\t\t\t \t} else {\n\n\t\t\t\t\t \t\techo '<h3><i class=\"fas fa-info-circle\"></i>'.__( 'Important Notice: ', 'hongo' ).'<span>'. sprintf( esc_html__( 'Please install %s plugin to enjoy premium features of import demo data.', 'hongo' ), '<a href=\"' . esc_url( $plugin_setup_url ) . '\">Hongo Addons</a>' ).'</span></h3>';\n\t\t\t\t\t \t}\n\t\t\t\t\t echo '</div>';\n\t\t\t\t\t echo '</div>';\n\n \t\t\t\t} else {\n\n\t \t\t\tdo_action( 'hongo_demo_import_callback', $_GET['step'] );\n\t \t\t}\n \t\tbreak;\n\n \t\tcase '4' :\n\n \t\t\t\tif( hongo_is_woocommerce_activated() ) {\n\n\t\t\t\t\t\t\t\t\t $wc_setup_url = admin_url();\n\t\t\t\t\t\t\t\t\t $wc_setup_url = add_query_arg( array( 'page' => 'wc-setup' ), $wc_setup_url );\n\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"hongo-license-box hongo-wc-setup-box\">'; \t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"hongo-license-top-content\">';\n\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"hongo-license-full-content\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"hongo-license-full-top-inner\">';\n\n\t\t\t\t \t\t\t\t\techo '<p>' . esc_html__( 'Having a customizable eCommerce platform means that there are a lot of available settings to tweak. The Setup Wizard takes you through all necessary steps to set up your store and get it ready to start selling!', 'hongo' ) . '</p>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<p>' . esc_html__( 'You can use parts of the wizard, by completing and skipping steps as you like or can setup everything manually also.', 'hongo' ) . '</p>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<ul>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . esc_html__( 'Use the wizard', 'hongo' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . esc_html__( 'Select \\'Not right now\\' and set up everything manually', 'hongo' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . esc_html__( 'Use parts of the wizard, by completing and skipping steps as you like.', 'hongo' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</ul>';\n\n\t\t\t\t\t\t\t\t \t\t\techo '</div>';\n\t\t\t\t\t\t\t\t \t\techo '</div>';\n\t\t\t\t \t\t\techo '<div class=\"hongo-license-full-bottom-content\">';\n\t\t\t\t \t\t\t\t\n\t\t\t\t\t\t\t\t\t\t echo '<a class=\"hongo-button-gradient hongo-wc-setup-btn\" href=\"' . esc_url( $wc_setup_url ) . '\">' . __( 'Setup Wizard', 'hongo' ) . '</a>';\n\t\t\t\t\t\t\t \n\t\t\t\t \t\t\techo '</div>';\t\n\t\t\t\t\t\t\t\t \techo '</div>';\n\t\t\t\t\t\t\t\t echo '</div>';\n \t\t\t\t}\n\n \t\t\tbreak;\n\n \t}\n \techo '</div>';\n\n }\n\n\t\t echo '</div>';\n\t\t echo '</div>';\n\t\t}", "public static function activate_license( $data ){\n\n\t\t$license = ! empty( $data[ 'license' ] ) ? urldecode( $data[ 'license' ] ) : false;\n\t\t$license_id = \\EDD_Software_Licensing::instance()->get_license_by_key( $license );\n\t\t$payment_id = get_post_meta( $license_id, '_edd_sl_payment_id', true );\n\t\t$user_info = edd_get_payment_meta_user_info( $payment_id );\n\n\t\tself::save_license_meta( $data, $license_id, $user_info, $payment_id );\n\n\t\t$item_id = ! empty( $data[ 'item_id' ] ) ? absint( $data[ 'item_id' ] ) : false;\n\n\t\tif(1 ==3 && class_exists( 'EDD_ConvertKit' ) && isset( $data[ 'details' ][ 'vertical' ] ) && ( self::$trial || ingSL::$trial == $item_id ) ) {\n\t\t\tself::$trial = true;\n\t\t\t$vertical = $data[ 'details' ][ 'vertical' ];\n\t\t\tif( ! in_array( $vertical, ingSL_verticals() ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//$url = isset( $data[ 'url' ] ) ? urldecode( $data[ 'url' ] ) : '';\n\n\t\t\t$convert_kit = new \\EDD_ConvertKit();\n\t\t\t$convert_kit->subscribe_email( $user_info, $vertical, true );\n\t\t}\n\n\t}", "protected function deactivate_licenses(){\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST['pmxi_license_deactivate'] ) ) {\t\n\n\t\t\t// retrieve the license from the database\n\t\t\t$options = PMXI_Plugin::getInstance()->getOption();\t\n\n\t\t\tforeach ($_POST['pmxi_license_deactivate'] as $class => $val) {\t\t\n\n\t\t\t\tif (!empty($options['licenses'][$class])){\n\n\t\t\t\t\t$product_name = (method_exists($class, 'getEddName')) ? call_user_func(array($class, 'getEddName')) : false;\n\n\t\t\t\t\tif ( $product_name !== false ){\n\n\t\t\t\t\t\t// data to send in our API request\n\t\t\t\t\t\t$api_params = array( \n\t\t\t\t\t\t\t'edd_action'=> 'deactivate_license', \n\t\t\t\t\t\t\t'license' \t=> $options['licenses'][$class], \n\t\t\t\t\t\t\t'item_name' => urlencode( $product_name ) // the name of our product in EDD\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Call the custom API.\n\t\t\t\t\t\t$response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t\t\t\t\t// make sure the response came back okay\n\t\t\t\t\t\tif ( is_wp_error( $response ) )\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// decode the license data\n\t\t\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\t\t\t\tif( $license_data->license == 'deactivated' ){\n\n\t\t\t\t\t\t\t$options['statuses'][$class] = 'deactivated';\n\n\t\t\t\t\t\t\tPMXI_Plugin::getInstance()->updateOption($options);\t\n\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public function assignFreeLicenses()\n {\n //Se selecciona cualquier licencia activa del producto\n $licenses = License::select('*')\n ->where('licenses.state', 'Active')\n ->where('licenses.duration', -1)\n ->get();\n\n foreach ($licenses as $license) {\n //De acuerdo al producto se restablece el max_amount en la configiración del producto\n if($license->product->name == 'TrSoft/Copy Binary'){\n $product_setting = $this->getProductSetting($license->product_id);\n\n if(!$product_setting){\n $product_setting = new ProductSetting();\n $product_setting->amount = 1;//$license->max_amount;\n $product_setting->user_id = $this->id;\n $product_setting->product_id = $license->product_id;\n }\n\n $product_setting->max_amount = $license->max_amount;\n $product_setting->save();\n }\n\n $this->save();\n\n //Ultimos datos de comisión registrados\n $commission = $license->lastCommission();\n //Ultimos datos de precios registrados\n $price = $license->lastPrice();\n\n if($commission && $price && $price->price == 0){\n $user_license = new UserLicense();\n $user_license->user_id = $this->id;\n $user_license->commission_id = $commission->id;\n $user_license->license_price_id = $price->id;\n $user_license->state = 'Active';\n $user_license->activation_date = date('Y-m-d H:i:s');\n $user_license->save();\n }\n }\n }", "function tux_su_admin_styles_add_action_licenses() {\n\n\tadd_action( 'admin_print_styles', 'tux_su_admin_styles_licenses' );\n\n}", "function tux_su_licenses_admin_page() {\n\n\tif ( ! current_user_can( 'administrator' ) ) {\n\n\t\treturn;\n\n\t}\n\n\tif ( isset( $_GET['action'], $_GET['edit_id'] ) && 'edit' === $_GET['action'] ) {\n\n\t\t$license = tux_su_get_db( array(\n\t\t\t'id' => absint( $_GET['edit_id'] ),\n\t\t) );\n\n\t\t$license = reset( $license );\n\n\t\tif ( isset( $license['info'] ) ) {\n\n\t\t\t$license['info'] = maybe_unserialize( $license['info'] );\n\n\t\t}\n\n\t\t$license['info']['product_name'] = '';\n\n\t\tif ( isset( $license['product_id'] ) ) {\n\n\t\t\t$license_rule = tux_su_get_db( array(\n\t\t\t\t'product_id' => $license['product_id'],\n\t\t\t\t'type' => 'rule',\n\t\t\t) );\n\n\t\t\t$license_rule = reset( $license_rule );\n\n\t\t\tif ( isset( $license_rule['info'] ) ) {\n\n\t\t\t\t$license_rule['info'] = maybe_unserialize( $license_rule['info'] );\n\n\t\t\t\tif ( isset( $license_rule['info']['product_name'] ) ) {\n\n\t\t\t\t\t$license['info']['product_name'] = $license_rule['info']['product_name'];\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset( $license_rule );\n\n\t\t}\n\t} // End if().\n\n\t$list_table = new Tux_SU_Licenses_List();\n\t?>\n\t<div class=\"wrap\">\n\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t<h1 class=\"wp-heading-inline\">\n\t\t\t\t<?php esc_html_e( 'Edit License', 'tuxedo-software-updater' ); ?>\n\t\t\t</h1>\n\t\t<?php else : ?>\n\t\t\t<h1 class=\"wp-heading-inline\">\n\t\t\t\t<?php esc_html_e( 'Licenses', 'tuxedo-software-updater' ); ?>\n\t\t\t</h1>\n\t\t\t<a href=\"javascript:void(0);\" class=\"page-title-action\" onclick=\"jQuery('#licenses-add-new-container').slideToggle();\">\n\t\t\t\t<?php esc_html_e( 'Add New', 'tuxedo-software-updater' ); ?>\n\t\t\t</a>\n\t\t<?php endif; ?>\n\t\t<hr class=\"wp-header-end\">\n\n\t\t<?php\n\t\tif ( isset( $_GET['action'] ) && 'edit' === $_GET['action'] ) {\n\n\t\t\tif ( ! isset( $_GET['edit_id'] ) || empty( $license ) || $license === false ) {\n\n\t\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error editing license.', 'tuxedo-software-updater' ) . '</p></div>';\n\t\t\t\techo '</div>';\n\n\t\t\t\treturn;\n\n\t\t\t}\n\t\t}\n\n\t\tif ( isset( $_GET['updated'] ) && 'success' === $_GET['updated'] ) {\n\n\t\t\techo '<div class=\"notice notice-success is-dismissible\"><p>' . esc_html__( 'Successfully updated license.', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['updated'] ) && 'error' === $_GET['updated'] ) {\n\n\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error updating license.', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['deleted'] ) && 'success' === $_GET['deleted'] ) {\n\n\t\t\techo '<div class=\"notice notice-success is-dismissible\"><p>' . esc_html__( 'Successfully deleted license(s).', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\tif ( isset( $_GET['deleted'] ) && 'error' === $_GET['deleted'] ) {\n\n\t\t\techo '<div class=\"notice notice-error is-dismissible\"><p>' . esc_html__( 'Error deleting license(s).', 'tuxedo-software-updater' ) . '</p></div>';\n\n\t\t}\n\n\t\t$_SERVER['REQUEST_URI'] = remove_query_arg( array(\n\t\t\t'updated',\n\t\t\t'deleted',\n\t\t\t'_wpnonce',\n\t\t\t'_wp_http_referer',\n\t\t), $_SERVER['REQUEST_URI'] );\n\t\t?>\n\t\t<div id=\"poststuff\">\n\t\t\t<div id=\"licenses-add-new-container\" class=\"postbox-container\" <?php if ( ! isset( $license['id'] ) ) : ?>style=\"display:none;\"<?php endif; ?>>\n\t\t\t\t<div id=\"licenses-add-new\" class=\"postbox\">\n\t\t\t\t\t<h2>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t\t\t\t\t\t<?php echo esc_html( $license['id'] . ' - ' . $license['info']['product_name'] ); ?>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Add New License', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</h2>\n\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<form action=\"<?php echo esc_url( admin_url( 'admin.php?page=tuxedo-su-licenses' ) ); ?>\" method=\"post\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_user_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'User ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_user_id\" name=\"tux_user_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['user_id'] ) ) ? esc_attr( $license['user_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_product_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Product ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_product_id\" name=\"tux_product_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['product_id'] ) ) ? esc_attr( $license['product_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_child_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Child Product ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_child_id\" name=\"tux_child_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['info']['child_id'] ) ) ? esc_attr( $license['info']['child_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label for=\"tux_order_id\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Order ID:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_order_id\" name=\"tux_order_id\" style=\"width:300px;\" value=\"<?php echo ( isset( $license['info']['order_id'] ) ) ? esc_attr( $license['info']['order_id'] ) : ''; ?>\">\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tif ( isset( $license['created'] ) ) {\n\t\t\t\t\t\t\t\t\t$year = date( 'Y', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t\t$month = date( 'm', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t\t$day = date( 'd', strtotime( $license['created'] ) );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$year = current_time( 'Y' );\n\t\t\t\t\t\t\t\t\t$month = current_time( 'm' );\n\t\t\t\t\t\t\t\t\t$day = current_time( 'd' );\n\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<label>\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Created On:', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</label><br>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_year\" name=\"tux_created_year\" style=\"width:60px;\" value=\"<?php echo esc_attr( $year ); ?>\">\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_month\" name=\"tux_created_month\" style=\"width:35px;\" value=\"<?php echo esc_attr( $month ); ?>\">\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"tux_created_day\" name=\"tux_created_day\" style=\"width:35px;\" value=\"<?php echo esc_attr( $day ); ?>\"><br>\n\t\t\t\t\t\t\t\t<span class=\"description\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Year - Month - Day', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php if ( isset( $license['id'], $license['info']['activations'] ) && count( $license['info']['activations'] ) > 0 ) : ?>\n\t\t\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t\t\t<h2 style=\"padding-left:0;padding-right:0;\">\n\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Activations', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<table class=\"wp-list-table widefat striped\">\n\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th style=\"width:50px;\">\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Delete', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t<th style=\"width:45%;\">\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'ID', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t\t<th>\n\t\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'IP Address', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<?php foreach ( $license['info']['activations'] as $key => $activation ) : ?>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"width:50px;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<input name=\"activation_delete[]\" type=\"checkbox\" value=\"<?php echo esc_attr( $key ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t<td style=\"width:45%;\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $activation['id'] ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php echo esc_html( $activation['ip'] ); ?>\n\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<?php wp_nonce_field( 'tux_create_edit_license', 'tux_su_nonce' ); ?>\n\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t<?php if ( isset( $license['id'] ) ) : ?>\n\t\t\t\t\t\t\t\t\t<input type=\"hidden\" id=\"tux_id\" name=\"tux_id\" value=\"<?php echo esc_attr( $license['id'] ); ?>\">\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button button-primary button-large\" name=\"tux_create_license\" value=\"<?php esc_attr_e( 'Update License', 'tuxedo-software-updater' ); ?>\">\n\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t<a href=\"<?php echo esc_url( admin_url( 'admin.php?page=tuxedo-su-licenses' ) ); ?>\" class=\"button button-large\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Cancel', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button button-primary button-large\" name=\"tux_create_license\" value=\"<?php esc_attr_e( 'Create License', 'tuxedo-software-updater' ); ?>\">\n\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t<button class=\"button button-large\" onclick=\"jQuery('#licenses-add-new-container').slideToggle();\">\n\t\t\t\t\t\t\t\t\t\t<?php esc_html_e( 'Cancel', 'tuxedo-software-updater' ); ?>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<?php if ( ! isset( $_GET['action'] ) || 'edit' !== $_GET['action'] ) : ?>\n\t\t\t\t<form method=\"get\">\n\t\t\t\t\t<input type=\"hidden\" name=\"page\" value=\"tuxedo-su-licenses\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$list_table->prepare_items();\n\t\t\t\t\t$list_table->search_box( __( 'Search', 'tuxedo-software-updater' ), 'tux-su' );\n\t\t\t\t\t$list_table->display();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t<?php endif; ?>\n\t\t</div>\n\t</div>\n\t<?php\n\n}", "public function add_license_menu() {\n\t\t$theme_page = add_options_page( sprintf( __( '%s License', $this->text_domain ), $this->item_name ), sprintf( __( '%s License', $this->text_domain ), $this->item_name ), 'manage_options', $this->text_domain . '-license', array( $this, 'show_license_page' ) );\n\t}", "function cf_ga_init_license(){\n\n\t$plugin = array(\n\t\t'name'\t\t=>\t'Caldera Forms Google Analytics Tracking',\n\t\t'slug'\t\t=>\t'caldera-forms-google-analytics-tracking',\n\t\t'url'\t\t=>\t'https://calderaforms.com/',\n\t\t'version'\t=>\tCF_GA_VER,\n\t\t'key_store'\t=> 'cfga_license',\n\t\t'file'\t\t=> CF_GA_CORE\n\t);\n\n\tnew \\calderawp\\licensing_helper\\licensing( $plugin );\n\n}", "function edd_wordimpress_activate_license( $force_check = false ) {\r\n\r\n\t\t// listen for our activate button to be clicked\r\n\t\tif ( isset( $_POST['edd_license_activate'] ) || $force_check == true ) {\r\n\r\n\t\t\t//run a quick security check\r\n\t\t\tif ( ! check_admin_referer( 'edd_wordimpress_nonce', 'edd_wordimpress_nonce' ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t} // get out if we didn't click the Activate button\r\n\r\n\t\t\t// retrieve the license from the database\r\n\t\t\t$license = $this->get_license();\r\n\r\n\t\t\t// data to send in our API request\r\n\t\t\t$api_params = array(\r\n\t\t\t\t'edd_action' => 'activate_license',\r\n\t\t\t\t'license' => $license,\r\n\t\t\t\t'item_name' => urlencode( $this->item_name ) // the name of our product in EDD\r\n\t\t\t);\r\n\r\n\t\t\t// Call the WordImpress EDD API.\r\n\t\t\t$response = wp_remote_post( $this->store_url, array(\r\n\t\t\t\t'timeout' => 120,\r\n\t\t\t\t'sslverify' => false,\r\n\t\t\t\t'body' => $api_params\r\n\t\t\t) );\r\n\r\n\t\t\t// make sure the response came back okay\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// decode the license data\r\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\r\n\r\n\t\t\t// $license_data->license will be either \"active\" or \"inactive\"\r\n\t\t\tupdate_option( $this->licence_key_option,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'license_key' => $license,\r\n\t\t\t\t\t'license_item_name' => $license_data->item_name,\r\n\t\t\t\t\t'license_expiration' => $license_data->expires,\r\n\t\t\t\t\t'license_status' => $license_data->license,\r\n\t\t\t\t\t'license_limit' => $license_data->license_limit,\r\n\t\t\t\t\t'activations_left' => $license_data->activations_left,\r\n\t\t\t\t\t'license_name' => $license_data->customer_name,\r\n\t\t\t\t\t'license_email' => $license_data->customer_email,\r\n\t\t\t\t\t'license_payment_id' => $license_data->payment_id,\r\n\t\t\t\t\t'license_error' => isset( $license_data->error ) ? $license_data->error : '',\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t}\r\n\t}", "abstract protected function migrate_license_and_installs();", "public static function activate_license() {\n\t\t$license_data = self::api( 'activate_license' );\n\n\t\tif ( is_object( $license_data ) ) {\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif ( $license_data->license == 'valid' ) {\n\t\t\t\tupdate_option( self::LICENSE_STATUS, $license_data->license );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function deactivate_license() {\n\t\tif ( isset( $_POST[ $this->slug . '_license_deactivate'] ) ) {\n\n\t\t\t// run a quick security check\n\t\t\tif ( ! check_admin_referer( 'sliced_license_nonce', 'sliced_license_nonce_' . $this->slug ) ) {\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\t\t\t}\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'deactivate_license',\n\t\t\t\t'license' => $this->license_key,\n\t\t\t\t'item_name' => urlencode( $this->name ), // the name of our product in EDD\n\t\t\t\t'url' => home_url(),\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( $this->store_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t$licenses = get_option( 'sliced_licenses' );\n\t\t\t$licenses[ $this->status_name ] = trim( $license_data->license );\n\n\t\t\t$this->license_status = $licenses[ $this->status_name ];\n\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif ( $license_data->license == 'deactivated' ) {\n\t\t\t\tupdate_option( 'sliced_licenses', $licenses );\n\t\t\t\t//wp_redirect( admin_url( 'admin.php?page=sliced_licenses' ) );\n\t\t\t//exit;\n\t\t\t}\n\n\t\t}\n\t}", "public function render_licenses_menu() {\n\n $title = sprintf(__('%s License', $this->text_domain), $this->plugin_name);\n $settings_group_id = $this->plugin_id . '-license-settings-group';\n ?>\n <div class=\"wrap\">\n <form action='options.php' method='post'>\n\n <h2><?php echo $title; ?></h2>\n\n <?php\n settings_fields($settings_group_id);\n do_settings_sections($settings_group_id);\n submit_button();\n ?>\n\n </form>\n </div>\n <?php\n }", "function edd_wordimpress_deactivate_license( $plugin_deactivate = false ) {\r\n\r\n\t\t// listen for our activate button to be clicked\r\n\t\tif ( isset( $_POST['option_page'] ) && $_POST['option_page'] === $this->licence_key_setting && isset( $_POST['edd_license_deactivate'] ) || isset( $_POST['option_page'] ) && $_POST['option_page'] === $this->licence_key_setting && $plugin_deactivate === true ) {\r\n\r\n\t\t\t// run a quick security check\r\n\t\t\tif ( ! current_user_can( 'activate_plugins' ) && ! check_admin_referer( 'edd_wordimpress_nonce', 'edd_wordimpress_nonce' ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t} // get out if we didn't click the Activate button\r\n\r\n\t\t\t// retrieve the license from the database\r\n\t\t\t$license = $this->get_license();\r\n\r\n\t\t\t// data to send in our API request\r\n\t\t\t$api_params = array(\r\n\t\t\t\t'edd_action' => 'deactivate_license',\r\n\t\t\t\t'license' => $license,\r\n\t\t\t\t'item_name' => urlencode( $this->item_name ) // the name of our product in EDD\r\n\t\t\t);\r\n\r\n\t\t\t// Call the WordImpress EDD API.\r\n\t\t\t$response = wp_remote_post( $this->store_url, array(\r\n\t\t\t\t'timeout' => 120,\r\n\t\t\t\t'sslverify' => false,\r\n\t\t\t\t'body' => $api_params\r\n\t\t\t) );\r\n\r\n\t\t\t// make sure the response came back okay\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// decode the license data\r\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\r\n\r\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\r\n\t\t\tif ( $license_data->license == 'deactivated' || $license_data->license == 'failed' ) {\r\n\t\t\t\t// $license_data->license will be either \"active\" or \"inactive\"\r\n\t\t\t\tupdate_option( $this->licence_key_option,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'license_key' => isset( $license ) ? $license : '',\r\n\t\t\t\t\t\t'license_item_name' => isset( $license_data->item_name ) ? $license_data->item_name : '',\r\n\t\t\t\t\t\t'license_expiration' => isset( $license_data->expires ) ? $license_data->expires : '',\r\n\t\t\t\t\t\t'license_status' => isset( $license_data->license ) ? $license_data->license : '',\r\n\t\t\t\t\t\t'license_limit' => '',\r\n\t\t\t\t\t\t'activations_left' => '',\r\n\t\t\t\t\t\t'license_name' => isset( $license_data->customer_name ) ? $license_data->customer_name : '',\r\n\t\t\t\t\t\t'license_email' => isset( $license_data->customer_email ) ? $license_data->customer_email : '',\r\n\t\t\t\t\t\t'license_payment_id' => isset( $license_data->payment_id ) ? $license_data->payment_id : '',\r\n\t\t\t\t\t\t'license_error' => isset( $license_data->error ) ? $license_data->error : '',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "function licenseDeActivate() {\n if( isset( $_POST['edd_license_deactivate'] ) ) {\n\n // run a quick security check \n if( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) ) \n return; // get out if we didn't click the Activate button\n\n // retrieve the license from the database\n $license = trim( get_option( 'sg90_license' ) );\n \n\n // data to send in our API request\n $api_params = array( \n 'edd_action'=> 'deactivate_license', \n 'license' => $license, \n 'item_name' => urlencode( EDD_SAMPLE_ITEM_NAME ) // the name of our product in EDD\n );\n \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SAMPLE_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false;\n\n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n \n // $license_data->license will be either \"deactivated\" or \"failed\"\n if( $license_data->license == 'deactivated' )\n update_option( 'sg90_license', '' );\n update_option( 'sg90_license_status', 'invalid' );\n\n }\n }", "function wcap_agile_edd_ac_deactivate_license() { \n // listen for our activate button to be clicked\n if ( isset( $_POST['edd_agile_license_deactivate'] ) ) { \n // run a quick security check\n if ( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) )\n return; // get out if we didn't click the Activate button \n // retrieve the license from the database\n $license = trim( get_option( 'edd_sample_license_key_agile_woo' ) ); \n // data to send in our API request\n $api_params = array(\n 'edd_action'=> 'deactivate_license',\n 'license' => $license,\n 'item_name' => urlencode( EDD_SL_ITEM_NAME_AGILE_WOO ) // the name of our product in EDD\n ); \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SL_STORE_URL_AGILE_WOO ), array( 'timeout' => 15, 'sslverify' => false ) ); \n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false; \n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) ); \n // $license_data->license will be either \"deactivated\" or \"failed\"\n if ( $license_data->license == 'deactivated' )\n delete_option( 'edd_sample_license_status_agile_woo' );\n }\n }", "public function activate_client() {\n $data = get_plugin_data($this->plugin_file, $markup = false, $translate = false);\n\n $activation_data = $this->call_api(\n 'hello', array(\n 'v' => $data['Version'],\n 'h' => preg_replace('/^www\\./', '', $_SERVER['HTTP_HOST']),\n 'n' => $data['Name']\n )\n );\n add_option('zpm_plugin_id', $activation_data->plugin_id, '', 'yes');\n add_option('zpm_license', $activation_data->license_key, '', 'yes');\n }", "function kalervo_theme_deactivate_license() {\n\n\t// listen for our activate button to be clicked\n\tif( isset( $_POST['kalervo_theme_license_deactivate'] ) ) {\n\n\t\t// run a quick security check \n\t \tif( ! check_admin_referer( 'kalervo_nonce', 'kalervo_nonce' ) ) \t\n\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t// retrieve the license from the database\n\t\t$license = trim( get_option( 'kalervo_theme_license_key' ) );\n\t\t\t\n\n\t\t// data to send in our API request\n\t\t$api_params = array( \n\t\t\t'edd_action'=> 'deactivate_license', \n\t\t\t'license' \t=> $license, \n\t\t\t'item_name' => urlencode( KALERVO_SL_THEME_NAME ) // the name of our product in EDD\n\t\t);\n\t\t\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get( add_query_arg( $api_params, KALERVO_SL_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\n\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\tif( $license_data->license == 'deactivated' )\n\t\t\tdelete_option( 'kalervo_theme_license_key_status' );\n\n\t}\n}" ]
[ "0.72455657", "0.721833", "0.7163624", "0.7100447", "0.7065139", "0.69730777", "0.6947218", "0.6823633", "0.67480415", "0.6728273", "0.66867983", "0.66607577", "0.6590602", "0.65170634", "0.6462093", "0.64229643", "0.630216", "0.62650394", "0.6246618", "0.6241707", "0.6240799", "0.6221117", "0.622078", "0.62196785", "0.6187863", "0.6174634", "0.6135093", "0.61320615", "0.61155105", "0.61071193" ]
0.77349544
0
/ Deactivate licenses for main plugin and all premium addons
protected function deactivate_licenses(){ // listen for our activate button to be clicked if( isset( $_POST['pmxi_license_deactivate'] ) ) { // retrieve the license from the database $options = PMXI_Plugin::getInstance()->getOption(); foreach ($_POST['pmxi_license_deactivate'] as $class => $val) { if (!empty($options['licenses'][$class])){ $product_name = (method_exists($class, 'getEddName')) ? call_user_func(array($class, 'getEddName')) : false; if ( $product_name !== false ){ // data to send in our API request $api_params = array( 'edd_action'=> 'deactivate_license', 'license' => $options['licenses'][$class], 'item_name' => urlencode( $product_name ) // the name of our product in EDD ); // Call the custom API. $response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) ); // make sure the response came back okay if ( is_wp_error( $response ) ) continue; // decode the license data $license_data = json_decode( wp_remote_retrieve_body( $response ) ); // $license_data->license will be either "deactivated" or "failed" if( $license_data->license == 'deactivated' ){ $options['statuses'][$class] = 'deactivated'; PMXI_Plugin::getInstance()->updateOption($options); } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function oceanwp_deactivate_license() {\r\n\t \t\r\n\t \tif ( !isset( $_POST['oceanwp_options'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !isset( $_POST['oceanwp_options']['licenses'][ $this->item_shortname . '_license_key'] ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Run on deactivate button press\r\n\t\t\tif ( isset( $_POST[ 'oceanwp_'.$this->item_shortname.'_license_key_deactivate'] ) ) {\r\n\t\t\t\t\r\n\t\t\t\t// Data to send to the API\r\n\t\t\t\t$api_params = array(\r\n\t\t\t\t\t'edd_action' => 'deactivate_license',\r\n\t\t\t\t\t'license' => $this->license_key,\r\n\t\t\t\t\t'item_name' => urlencode( $this->item_name ),\r\n\t\t\t\t\t'url' => home_url()\r\n\t\t\t\t);\r\n\r\n\t\t\t\t// Call the API\r\n\t\t\t\t$response = wp_remote_post(\r\n\t\t\t\t\t$this->api_url,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'timeout' => 15,\r\n\t\t\t\t\t\t'sslverify' => false,\r\n\t\t\t\t\t\t'body' => $api_params\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\r\n\t\t\t\t// Make sure there are no errors\r\n\t\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Decode the license data\r\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\r\n\r\n\t\t\t\t$this->delete_oceanwp_option($this->item_shortname . '_license_active');\r\n\r\n\t\t\t\tif( ! (bool) $license_data->success ) {\r\n\t\t\t\t\tset_transient( 'edd_license_error', $license_data, 1000 );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdelete_transient( 'edd_license_error' );\r\n\r\n\t\t\t\t\t//Remove license data and update it\r\n\t\t\t\t\t$this->oceanwp_delete_response( $this->item_shortname );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t }", "function deactivate_license() {\n\t\tglobal $wp_version;\n\t\t$ss_settings = get_option( 'shoestrap' );\n\n\t\t// data to send in our API request\n\t\t$api_params = array(\n\t\t\t'edd_action'=> 'deactivate_license',\n\t\t\t'license' \t=> $this->license,\n\t\t\t'item_name' => urlencode( $this->item_name )\n\t\t);\n\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get(\n\t\t\tadd_query_arg( $api_params, $this->remote_api_url ),\n\t\t\tarray( 'timeout' => 15, 'sslverify' => false )\n\t\t);\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t// Set the transient for 6 hours.\n\t\tdelete_transient( $this->field_name . '_status' );\n\t}", "function licenseDeActivate() {\n if( isset( $_POST['edd_license_deactivate'] ) ) {\n\n // run a quick security check \n if( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) ) \n return; // get out if we didn't click the Activate button\n\n // retrieve the license from the database\n $license = trim( get_option( 'sg90_license' ) );\n \n\n // data to send in our API request\n $api_params = array( \n 'edd_action'=> 'deactivate_license', \n 'license' => $license, \n 'item_name' => urlencode( EDD_SAMPLE_ITEM_NAME ) // the name of our product in EDD\n );\n \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SAMPLE_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false;\n\n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n \n // $license_data->license will be either \"deactivated\" or \"failed\"\n if( $license_data->license == 'deactivated' )\n update_option( 'sg90_license', '' );\n update_option( 'sg90_license_status', 'invalid' );\n\n }\n }", "function kultalusikka_theme_deactivate_license() {\n\n\tif( isset( $_POST['kultalusikka_theme_license_deactivate'] ) ) { \n\t \tif( ! check_admin_referer( 'kultalusikka_license_nonce', 'kultalusikka_license_nonce' ) ) \t\n\t\t\treturn; // get out if we didn't click the Deactivate button\n\n\t\tglobal $wp_version;\n\n\t\t$license = trim( hybrid_get_setting( 'kultalusikka_license_key' ) );\n\t\t\t\t\n\t\t$api_params = array( \n\t\t\t'edd_action' => 'deactivate_license', \n\t\t\t'license' => $license, \n\t\t\t'item_name' => urlencode( KULTALUSIKKA_SL_THEME_NAME ) \n\t\t);\n\t\t\n\t\t$response = wp_remote_get( add_query_arg( $api_params, KULTALUSIKKA_SL_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\n\t\t/* $license_data->license will be either \"deactivated\" or \"failed\". */\n\t\tif( $license_data->license == 'deactivated' )\n\t\t\tdelete_option( 'kultalusikka_license_key_status' );\n\n\t}\n}", "function kalervo_theme_deactivate_license() {\n\n\t// listen for our activate button to be clicked\n\tif( isset( $_POST['kalervo_theme_license_deactivate'] ) ) {\n\n\t\t// run a quick security check \n\t \tif( ! check_admin_referer( 'kalervo_nonce', 'kalervo_nonce' ) ) \t\n\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t// retrieve the license from the database\n\t\t$license = trim( get_option( 'kalervo_theme_license_key' ) );\n\t\t\t\n\n\t\t// data to send in our API request\n\t\t$api_params = array( \n\t\t\t'edd_action'=> 'deactivate_license', \n\t\t\t'license' \t=> $license, \n\t\t\t'item_name' => urlencode( KALERVO_SL_THEME_NAME ) // the name of our product in EDD\n\t\t);\n\t\t\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get( add_query_arg( $api_params, KALERVO_SL_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\n\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\tif( $license_data->license == 'deactivated' )\n\t\t\tdelete_option( 'kalervo_theme_license_key_status' );\n\n\t}\n}", "function wcap_agile_edd_ac_deactivate_license() { \n // listen for our activate button to be clicked\n if ( isset( $_POST['edd_agile_license_deactivate'] ) ) { \n // run a quick security check\n if ( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) )\n return; // get out if we didn't click the Activate button \n // retrieve the license from the database\n $license = trim( get_option( 'edd_sample_license_key_agile_woo' ) ); \n // data to send in our API request\n $api_params = array(\n 'edd_action'=> 'deactivate_license',\n 'license' => $license,\n 'item_name' => urlencode( EDD_SL_ITEM_NAME_AGILE_WOO ) // the name of our product in EDD\n ); \n // Call the custom API.\n $response = wp_remote_get( add_query_arg( $api_params, EDD_SL_STORE_URL_AGILE_WOO ), array( 'timeout' => 15, 'sslverify' => false ) ); \n // make sure the response came back okay\n if ( is_wp_error( $response ) )\n return false; \n // decode the license data\n $license_data = json_decode( wp_remote_retrieve_body( $response ) ); \n // $license_data->license will be either \"deactivated\" or \"failed\"\n if ( $license_data->license == 'deactivated' )\n delete_option( 'edd_sample_license_status_agile_woo' );\n }\n }", "public function deactivate_license() {\n\t\tif ( isset( $_POST[ $this->slug . '_license_deactivate'] ) ) {\n\n\t\t\t// run a quick security check\n\t\t\tif ( ! check_admin_referer( 'sliced_license_nonce', 'sliced_license_nonce_' . $this->slug ) ) {\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\t\t\t}\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'deactivate_license',\n\t\t\t\t'license' => $this->license_key,\n\t\t\t\t'item_name' => urlencode( $this->name ), // the name of our product in EDD\n\t\t\t\t'url' => home_url(),\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( $this->store_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t$licenses = get_option( 'sliced_licenses' );\n\t\t\t$licenses[ $this->status_name ] = trim( $license_data->license );\n\n\t\t\t$this->license_status = $licenses[ $this->status_name ];\n\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif ( $license_data->license == 'deactivated' ) {\n\t\t\t\tupdate_option( 'sliced_licenses', $licenses );\n\t\t\t\t//wp_redirect( admin_url( 'admin.php?page=sliced_licenses' ) );\n\t\t\t//exit;\n\t\t\t}\n\n\t\t}\n\t}", "public function deactivate_client() {\n $data = get_plugin_data($this->plugin_file, $markup = false, $translate = false);\n $license = get_option('zpm_license');\n\n $activation_data = $this->call_api(\n 'bye', array(\n 'l' => $license,\n 'h' => preg_replace('/^www\\./', '', $_SERVER['HTTP_HOST']),\n 'n' => $data['Name']\n )\n );\n\n delete_option('zpm_plugin_id');\n delete_option('zpm_license');\n }", "function pewc_deactivate_license() {\n\n\tif( ! isset( $_POST['pewc_deactivate_license_key'] ) || ! isset( $_POST['pewc_license_key_nonce'] ) || ! wp_verify_nonce( $_POST['pewc_license_key_nonce'], 'pewc_license_key_nonce' ) ) {\n\t\treturn;\n\t}\n\n\t// retrieve the license from the database\n\t$license = trim( get_option( 'pewc_license_key' ) );\n\n\t// data to send in our API request\n\t$api_params = array(\n\t\t'edd_action' \t=> 'deactivate_license',\n\t\t'license' \t=> $license,\n\t\t'item_name' \t=> urlencode( PEWC_ITEM_NAME ), // the name of our product in EDD\n\t\t'item_id' \t\t=> PEWC_ITEM_ID,\n\t\t'url' \t=> home_url()\n\t);\n\n\t// Call the custom API.\n\t$response = wp_remote_post( PEWC_STORE_URL, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t// make sure the response came back okay\n\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$message = $response->get_error_message();\n\t\t} else {\n\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t}\n\n\t}\n\n\t// decode the license data\n\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\tif( $license_data->license == 'deactivated' ) {\n\t\tupdate_option( 'pewc_license_status', 'deactivated' );\n\t}\n\n}", "function edd_wordimpress_deactivate_license( $plugin_deactivate = false ) {\r\n\r\n\t\t// listen for our activate button to be clicked\r\n\t\tif ( isset( $_POST['option_page'] ) && $_POST['option_page'] === $this->licence_key_setting && isset( $_POST['edd_license_deactivate'] ) || isset( $_POST['option_page'] ) && $_POST['option_page'] === $this->licence_key_setting && $plugin_deactivate === true ) {\r\n\r\n\t\t\t// run a quick security check\r\n\t\t\tif ( ! current_user_can( 'activate_plugins' ) && ! check_admin_referer( 'edd_wordimpress_nonce', 'edd_wordimpress_nonce' ) ) {\r\n\t\t\t\treturn;\r\n\t\t\t} // get out if we didn't click the Activate button\r\n\r\n\t\t\t// retrieve the license from the database\r\n\t\t\t$license = $this->get_license();\r\n\r\n\t\t\t// data to send in our API request\r\n\t\t\t$api_params = array(\r\n\t\t\t\t'edd_action' => 'deactivate_license',\r\n\t\t\t\t'license' => $license,\r\n\t\t\t\t'item_name' => urlencode( $this->item_name ) // the name of our product in EDD\r\n\t\t\t);\r\n\r\n\t\t\t// Call the WordImpress EDD API.\r\n\t\t\t$response = wp_remote_post( $this->store_url, array(\r\n\t\t\t\t'timeout' => 120,\r\n\t\t\t\t'sslverify' => false,\r\n\t\t\t\t'body' => $api_params\r\n\t\t\t) );\r\n\r\n\t\t\t// make sure the response came back okay\r\n\t\t\tif ( is_wp_error( $response ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// decode the license data\r\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\r\n\r\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\r\n\t\t\tif ( $license_data->license == 'deactivated' || $license_data->license == 'failed' ) {\r\n\t\t\t\t// $license_data->license will be either \"active\" or \"inactive\"\r\n\t\t\t\tupdate_option( $this->licence_key_option,\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'license_key' => isset( $license ) ? $license : '',\r\n\t\t\t\t\t\t'license_item_name' => isset( $license_data->item_name ) ? $license_data->item_name : '',\r\n\t\t\t\t\t\t'license_expiration' => isset( $license_data->expires ) ? $license_data->expires : '',\r\n\t\t\t\t\t\t'license_status' => isset( $license_data->license ) ? $license_data->license : '',\r\n\t\t\t\t\t\t'license_limit' => '',\r\n\t\t\t\t\t\t'activations_left' => '',\r\n\t\t\t\t\t\t'license_name' => isset( $license_data->customer_name ) ? $license_data->customer_name : '',\r\n\t\t\t\t\t\t'license_email' => isset( $license_data->customer_email ) ? $license_data->customer_email : '',\r\n\t\t\t\t\t\t'license_payment_id' => isset( $license_data->payment_id ) ? $license_data->payment_id : '',\r\n\t\t\t\t\t\t'license_error' => isset( $license_data->error ) ? $license_data->error : '',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public\r\n\tfunction plugin_deactivated() {\r\n\t\t// This will run when the plugin is deactivated, use to delete the database\r\n\t\tif ( ! current_user_can( 'activate_plugins' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : '';\r\n\t\tcheck_admin_referer( \"deactivate-plugin_{$plugin}\" );\r\n\r\n\t\treturn $this->edd_wordimpress_deactivate_license( $plugin_deactivate = true );\r\n\t}", "public function removeLicenseDetails();", "function dexpro_plugin_deactivation() {\n}", "public function license_key_deactivation() {\n\n\t\t$wc_api_manager_key = new WC_Api_Manager_Key();\n\n\t\t$activation_status = get_option( 'wc_api_manager_activated' );\n\n\t\t$default_options = get_option( 'wc_api_manager' );\n\n\t\t$api_email = $default_options['activation_email'];\n\t\t$api_key = $default_options['api_key'];\n\n\t\t$args = array(\n\t\t\t'email' => $api_email,\n\t\t\t'licence_key' => $api_key,\n\t\t\t);\n\n\t\tif ( $activation_status == 'Activated' && $api_key != '' && $api_email != '' ) {\n\t\t\t$wc_api_manager_key->deactivate( $args ); // reset license key activation\n\t\t}\n\t}", "public function pxp_deactivate()\n\t{\n\t\t// Remove caps and roles.\n\t\t//$this->remove_roles_on_plugin_deactivation();\n\t}", "public function aj_disable_pro() {\n if ( is_plugin_active( 'async-javascript-pro/async-javascript-pro.php' ) ) {\n deactivate_plugins( array( 'async-javascript-pro/async-javascript-pro.php' ) );\n }\n }", "public function deactivate()\n {\n require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR . 'deactivate.php');\n PeepSoUninstall::plugin_deactivation();\n }", "public function deactivate( $main )\n {\n $this->main = $main;\n $license = $this->load_decrypt();\n if ( $license === false )\n return false;\n // Validate\n $response = Api::deactivate(\n Client::instance(),\n function() use( &$license ) {\n return new LicenseRequest( $license );\n },\n [&$this, 'encrypt_save']\n );\n if ( $response->error === true ) {\n $this->encrypt_save( null );\n // Force deactivation\n $response->error = false;\n $response->message = __( 'Deactivated.', 'wpmvc-addon-license-key' );\n }\n return $response;\n }", "function deactivate_alecaddd_plugin() {\n\tInc\\Base\\Deactivate::deactivate();\n}", "protected function activate_licenses() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST['pmxi_license_activate'] ) ) {\t\t\t\n\n\t\t\t// retrieve the license from the database\n\t\t\t$options = PMXI_Plugin::getInstance()->getOption();\n\t\t\t\n\t\t\tforeach ($_POST['pmxi_license_activate'] as $class => $val) {\t\t\t\t\t\t\t\n\n\t\t\t\tif (!empty($options['licenses'][$class])){\n\n\t\t\t\t\t$product_name = (method_exists($class, 'getEddName')) ? call_user_func(array($class, 'getEddName')) : false;\n\n\t\t\t\t\tif ( $product_name !== false ){\n\t\t\t\t\t\t// data to send in our API request\n\t\t\t\t\t\t$api_params = array( \n\t\t\t\t\t\t\t'edd_action'=> 'activate_license', \n\t\t\t\t\t\t\t'license' \t=> $options['licenses'][$class], \n\t\t\t\t\t\t\t'item_name' => urlencode( $product_name ) // the name of our product in EDD\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Call the custom API.\n\t\t\t\t\t\t$response = wp_remote_get( add_query_arg( $api_params, $options['info_api_url'] ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t\t\t\t\t\t// make sure the response came back okay\n\t\t\t\t\t\tif ( is_wp_error( $response ) )\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t// decode the license data\n\t\t\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\t\t\t\t\t\t\n\t\t\t\t\t\t// $license_data->license will be either \"active\" or \"inactive\"\n\n\t\t\t\t\t\t$options['statuses'][$class] = $license_data->license;\n\t\t\t\t\t\t\n\t\t\t\t\t\tPMXI_Plugin::getInstance()->updateOption($options);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\t\t\t\t\n\n\t\t}\n\t}", "function process_license() {\n\t\tglobal $wp_version;\n\t\t$process = false;\n\t\t$action = 'activate_license';\n\t\t\n\t\tif ( $this->single_license ) {\n\t\t\t// This is an auto-activated license so keep processing it.\n\t\t\t// do not process if license is already valid.\n\t\t\tif ( get_option( $this->field_name . '_status' ) != 'valid' )\n\t\t\t\t$process = true;\n\n\t\t} else {\n\t\t\t// listen for our activate button to be clicked\n\t\t\tif ( isset( $_POST[$this->field_name . '_activate'] ) && check_admin_referer( $this->field_name . '_nonce', $this->field_name . '_nonce' ) )\n\t\t\t\t$process = true;\n\n\t\t\t// do not process if license is already valid.\n\t\t\tif ( get_option( $this->field_name . '_status' ) == 'valid' )\n\t\t\t\t$process = false;\n\n\t\t\t// If he just hit the de-activate button, keep procesing and set action to 'deactivate_license'.\n\t\t\tif ( isset( $_POST[$this->field_name . '_deactivate'] ) && check_admin_referer( $this->field_name . '_nonce', $this->field_name . '_nonce' ) ) {\n\t\t\t\t$process = true;\n\t\t\t\t$action = 'deactivate_license';\n\t\t\t}\n\t\t}\n\n\n\t\tif ( !$process )\n\t\t\treturn;\n\n\t\t// retrieve the license from the database\n\t\t$license = trim( get_option( $this->field_name . '_key' ) );\n\n\t\t// data to send in our API request\n\t\t$api_params = array(\n\t\t\t'edd_action'=> $action,\n\t\t\t'license' \t=> $license,\n\t\t\t'item_name' => urlencode( $this->item_name )\n\t\t);\n\n\t\t// Call the custom API.\n\t\t$response = wp_remote_get(\n\t\t\tadd_query_arg( $api_params, $this->remote_api_url ),\n\t\t\tarray( 'timeout' => 15, 'sslverify' => false )\n\t\t);\n\n\t\t// make sure the response came back okay\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn false;\n\n\t\t// decode the license data\n\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\tupdate_option( $this->field_name . '_status', $license_data->license );\n\t}", "function wcap_activate_license_key_agile_woo_callback() {\n \n $license = get_option( 'edd_sample_license_key_agile_woo' );\n $status = get_option( 'edd_sample_license_status_agile_woo' );\n ?>\n <form method=\"post\" action=\"options.php\">\n <?php if ( false !== $license ) { ?>\n <?php if( $status !== false && $status == 'valid' ) { ?>\n <span style=\"color:green;\"><?php _e( 'active' ); ?></span>\n <?php wp_nonce_field( 'edd_sample_nonce' , 'edd_sample_nonce' ); ?>\n <input type=\"submit\" class=\"button-secondary\" name=\"edd_agile_license_deactivate\" value=\"<?php _e( 'Deactivate License' ); ?>\"/>\n <?php } else {\n \n wp_nonce_field( 'edd_sample_nonce', 'edd_sample_nonce' ); ?>\n <input type=\"submit\" class=\"button-secondary\" name=\"edd_agile_license_activate\" value=\"Activate License\"/>\n <?php } ?>\n <?php } ?>\n \n \n </form>\n <?php \n }", "function deactivate_wp_relevant_ads() {\n\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-relevant-ads-deactivator.php';\n\tWP_Relevant_Ads_Deactivator::deactivate();\n}", "function ssp_plugin_updater_activate_license() {\n\tif ( 'valid' == get_transient( 'ssp_license_status' ) ) {\n\t\treturn;\n\t}\n\n\t// data to send in our API request\n\t$api_params = array( \n\t\t'edd_action' => 'activate_license', \n\t\t'license' => '33d741209efc16e45237d3840800f958', \n\t\t'item_name' => urlencode( 'Shoestrap Extras Pack' )\n\t);\n\t\t\n\t// Call the custom API.\n\t$response = wp_remote_get( add_query_arg( $api_params, 'http://shoestrap.org' ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n\t// make sure the response came back okay\n\tif ( is_wp_error( $response ) ) {\n\t\treturn false;\n\t}\n\n\t// decode the license data\n\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\tif ( 'valid' == $license_data->license ) {\n\t\t// If the license is valid, cache th response for 3 days\n\t\tset_transient( 'ssp_license_status', $license_data->license, 72 * 60 * 60 );\n\t} else {\n\t\t// If the license is NOT valid, cache the response for 3 hours.\n\t\tset_transient( 'ssp_license_status', $license_data->license, 3 * 60 * 60 );\n\t}\n}", "public static function deactivate ()\n\t\t\t\t\t{\n\t\t\t\t\t\tdo_action (\"ws_widget__ad_codes_before_deactivation\", get_defined_vars ());\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\tif ($GLOBALS[\"WS_WIDGET__\"][\"ad_codes\"][\"o\"][\"run_deactivation_routines\"])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdelete_option (\"ws_widget__ad_codes_configured\");\n\t\t\t\t\t\t\t\tdelete_option (\"ws_widget__ad_codes_notices\");\n\t\t\t\t\t\t\t\tdelete_option (\"ws_widget__ad_codes_options\");\n\t\t\t\t\t\t\t\tdelete_option (\"widget_ws_widget__ad_codes\");\n\t\t\t\t\t\t\t\tdelete_option (\"ws_widget__ad_codes\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\tdo_action (\"ws_widget__ad_codes_after_deactivation\", get_defined_vars ());\n\t\t\t\t\t\t/**/\n\t\t\t\t\t\treturn; /* Return for uniformity. */\n\t\t\t\t\t}", "public function deactivation() {\n\t\tglobal $wpdb, $blog_id;\n\n\t\t$this->license_key_deactivation();\n\n\t\t// Remove options\n\t\tif ( is_multisite() ) {\n\n\t\t\tswitch_to_blog( $blog_id );\n\n\t\t\tforeach ( array(\n\t\t\t\t\t'wc_api_manager',\n\t\t\t\t\t'wc_api_manager_product_id',\n\t\t\t\t\t'wc_api_manager_instance',\n\t\t\t\t\t'wc_api_manager_deactivate_checkbox',\n\t\t\t\t\t'wc_api_manager_activated',\n\t\t\t\t\t'wc_plugin_api_manager_version',\n\t\t\t\t\t) as $option) {\n\n\t\t\t\t\tdelete_option( $option );\n\n\t\t\t\t\t}\n\n\t\t\trestore_current_blog();\n\n\t\t} else {\n\n\t\t\tforeach ( array(\n\t\t\t\t\t'wc_api_manager',\n\t\t\t\t\t'wc_api_manager_product_id',\n\t\t\t\t\t'wc_api_manager_instance',\n\t\t\t\t\t'wc_api_manager_deactivate_checkbox',\n\t\t\t\t\t'wc_api_manager_activated',\n\t\t\t\t\t'wc_plugin_api_manager_version',\n\t\t\t\t\t) as $option) {\n\n\t\t\t\t\tdelete_option( $option );\n\n\t\t\t\t\t}\n\n\t\t}\n\n\t}", "function deactivate(){\n\t\t\t$eventon_addons_opt = get_option('eventon_addons');\n\t\t\t\n\t\t\tif(is_array($eventon_addons_opt) && array_key_exists($this->slug, $eventon_addons_opt)){\n\t\t\t\tforeach($eventon_addons_opt as $addon_name=>$addon_ar){\n\t\t\t\t\t\n\t\t\t\t\tif($addon_name==$this->slug){\n\t\t\t\t\t\tunset($eventon_addons_opt[$addon_name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tupdate_option('eventon_addons',$eventon_addons_opt);\n\t\t}", "function deactivate_test_plugin() {\n\tInc\\Base\\Deactivate::deactivate();\n}", "function amc_plugin_deactivated() {\n\n\trequire_once AMC_PLUGIN_DIR . 'includes/class-amc-deactivator.php';\n\tAMC_Deactivator::deactivate();\n\n}", "function alm_paging_sanitize_license( $new ) {\n \t$old = get_option( 'alm_paging_license_key' );\n \tif( $old && $old != $new ) {\n \t\tdelete_option( 'alm_paging_license_status' ); // new license has been entered, so must reactivate\n \t}\n \treturn $new;\n }" ]
[ "0.7617927", "0.7616221", "0.75795007", "0.7542921", "0.74572307", "0.73909116", "0.73220474", "0.720792", "0.7154566", "0.70411605", "0.68228024", "0.66157216", "0.6475215", "0.64606106", "0.64242184", "0.63987184", "0.63776225", "0.6369243", "0.6325596", "0.6324823", "0.62894607", "0.62679434", "0.62591803", "0.6243538", "0.62328887", "0.6224982", "0.62193376", "0.62145823", "0.6199731", "0.6195464" ]
0.7689075
0
Adds the formfields to the form to provide the possible options for this multiple choice question
function build_option_form() { $renderer = $this->defaultRenderer(); if (! $this->isSubmitted()) { unset($_SESSION['select_number_of_options']); unset($_SESSION['select_skip_options']); unset($_SESSION['select_answer_type']); } if (! isset($_SESSION['select_number_of_options'])) { $_SESSION['select_number_of_options'] = 3; } if (! isset($_SESSION['select_skip_options'])) { $_SESSION['select_skip_options'] = array(); } if (! isset($_SESSION['select_answer_type'])) { $_SESSION['select_answer_type'] = 'radio'; } if (isset($_POST['add'])) { $_SESSION['select_number_of_options'] = $_SESSION['select_number_of_options'] + 1; } if (isset($_POST['remove'])) { $indexes = array_keys($_POST['remove']); $_SESSION['select_skip_options'][] = $indexes[0]; } if (isset($_POST['change_answer_type'])) { $_SESSION['select_answer_type'] = $_SESSION['select_answer_type'] == 'radio' ? 'checkbox' : 'radio'; } $object = $this->get_content_object(); if (! $this->isSubmitted() && $object->get_number_of_options() != 0) { $_SESSION['select_number_of_options'] = $object->get_number_of_options(); $_SESSION['select_answer_type'] = $object->get_answer_type(); } $number_of_options = intval($_SESSION['select_number_of_options']); if ($_SESSION['select_answer_type'] == 'radio') { $switch_label = Translation::get('SwitchToMultipleSelect'); } elseif ($_SESSION['select_answer_type'] == 'checkbox') { $switch_label = Translation::get('SwitchToSingleSelect'); } $this->addElement( 'hidden', 'select_answer_type', $_SESSION['select_answer_type'], array('id' => 'select_answer_type')); $this->addElement( 'hidden', 'select_number_of_options', $_SESSION['select_number_of_options'], array('id' => 'select_number_of_options')); $buttons = array(); // TODO adding fix for multiple select question $buttons[] = $this->createElement( 'style_button', 'change_answer_type', $switch_label, array('id' => 'change_answer_type'), null, 'retweet'); // Notice: The [] are added to this element name so we don't have to deal with the _x and _y suffixes added when // clicking an image button $buttons[] = $this->createElement( 'style_button', 'add[]', Translation::get('AddSelectOption'), array('id' => 'add_option'), null, 'plus'); $this->addGroup($buttons, 'question_buttons', null, '', false); $html_editor_options = array(); $html_editor_options['style'] = 'width: 100%; height: 65px;'; $html_editor_options['toolbar'] = 'RepositoryQuestion'; $table_header = array(); $table_header[] = '<table class="table table-striped table-bordered table-hover table-data">'; $table_header[] = '<thead>'; $table_header[] = '<tr>'; $table_header[] = '<th class="list"></th>'; $table_header[] = '<th style="width: 320px;">' . Translation::get('Options') . '</th>'; $table_header[] = '<th class="action"></th>'; $table_header[] = '</tr>'; $table_header[] = '</thead>'; $table_header[] = '<tbody>'; $this->addElement('html', implode(PHP_EOL, $table_header)); $visual_number = 0; for ($option_number = 0; $option_number < $number_of_options; $option_number ++) { if (! in_array($option_number, $_SESSION['select_skip_options'])) { $group = array(); $visual_number ++; $group[] = $this->createElement('static', null, null, $visual_number); $group[] = & $this->createElement( 'text', SelectOption::PROPERTY_VALUE . '[' . $option_number . ']', Translation::get('Answer'), array('style' => 'width: 300px;')); if ($number_of_options - count($_SESSION['select_skip_options']) > 2) { $group[] = & $this->createElement( 'image', 'remove[' . $option_number . ']', Theme::getInstance()->getCommonImagePath('Action/Delete'), array('class' => 'remove_option', 'id' => 'remove_' . $option_number)); } else { $group[] = & $this->createElement( 'static', null, null, '<img class="remove_option" src="' . Theme::getInstance()->getCommonImagePath('Action/DeleteNa') . '" />'); } $this->addGroup($group, SelectOption::PROPERTY_VALUE . '_' . $option_number, null, '', false); $renderer->setElementTemplate( '<tr id="option_' . $option_number . '" class="' . ($option_number % 2 == 0 ? 'row_even' : 'row_odd') . '">{element}</tr>', SelectOption::PROPERTY_VALUE . '_' . $option_number); $renderer->setGroupElementTemplate( '<td>{element}</td>', SelectOption::PROPERTY_VALUE . '_' . $option_number); } } $table_footer[] = '</tbody>'; $table_footer[] = '</table>'; $this->addElement('html', implode(PHP_EOL, $table_footer)); $this->addGroup($buttons, 'question_buttons', null, '', false); $renderer->setElementTemplate( '<div style="margin: 10px 0px 10px 0px;">{element}<div class="clear"></div></div>', 'question_buttons'); $renderer->setGroupElementTemplate( '<div style="float:left; text-align: center; margin-right: 10px;">{element}</div>', 'question_buttons'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initForm()\n {\n /**\n * this way you can show certain values to customers as selected\n */\n $this->fields_value['type_1'] = true;\n $this->fields_value['type_3'] = true;\n\n $this->fields_form = array(\n 'legend' => array(\n 'title' => $this->module->l('Article'),\n 'icon' => 'icon-info-sign',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->module->l('Name'),\n 'name' => 'name',\n 'lang' => true,\n 'required' => true,\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . '&nbsp;' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->module->l('Description'),\n 'name' => 'description',\n 'lang' => true,\n 'required' => true,\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . '&nbsp;' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n array(\n 'type' => 'checkbox',\n 'label' => $this->module->l('Type'),\n 'name' => 'type',\n 'values' => array(\n 'query' => Group::getGroups($this->context->language->id),\n 'id' => 'id_group',\n 'name' => 'name',\n ),\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . '&nbsp;' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n ),\n 'submit' => array(\n 'title' => $this->trans('Save', array(), 'Admin.Actions'),\n )\n );\n }", "public function init_form_fields(){\n\t$this->form_fields=[\n\t\t'enabled'=>[\n\t\t\t'title'=>__('Activar/Desactivar','oa-shipping-custom'),\n\t\t\t'type'=>'checkbox',\n\t\t\t'label'=>__('Activar método de entrega personalizado','oa-shipping-custom'),\n\t\t\t'default'=>'yes'\n\t\t],\n\t\t'title'=>[\n\t\t\t'title'=>__('Título','oa-shipping-custom'),\n\t\t\t'type'=>'text',\n\t\t\t'description'=>__('Método de entrega personalizado.','oa-shipping-custom'),\n\t\t\t'default'=>__('OA Custom Shipping','oa-shipping-custom'),\n\t\t]\n\t];\n}", "protected function form_fields() {\n\t\t$form_fields = array(\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'title',\n\t\t\t\t'desc' => __( 'Title:', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'text',\n\t\t\t\t'name' => 'count',\n\t\t\t\t'desc' => __( 'Number of ads to show:', APP_TD ),\n\t\t\t\t'extra' => array( 'size' => 3 ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_thumbnail',\n\t\t\t\t'desc' => __( 'Show ad thumbnail', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_date',\n\t\t\t\t'desc' => __( 'Show post date', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_category',\n\t\t\t\t'desc' => __( 'Show ad category', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_location',\n\t\t\t\t'desc' => __( 'Show ad location', APP_TD ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_price',\n\t\t\t\t'desc' => __( 'Show ad price', APP_TD ),\n\t\t\t),\n\t\t);\n\n\t\tif ( current_theme_supports( 'app-stats' ) ) {\n\t\t\t$form_fields[] = array(\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'name' => 'show_views',\n\t\t\t\t'desc' => __( 'Show ad views', APP_TD ),\n\t\t\t);\n\t\t}\n\n\t\treturn $form_fields;\n\t}", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'type',\n \t'name'=> 'type', \n \t'desc'=> 'Type', \n \t'val'=>\t'products', \n \t'type'=> 'select',\n \t'required' => 'required',\n 'option'\t=> [\n \t['value'=>'products', 'description'=>'Products'],\n \t['value'=>'expense', 'description'=>'Expense'],\n ]\n \t\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "public function init_form_fields(){\n $this->form_fields = array(\n 'enabled' => array(\n 'title' =>'Enable/Disable',\n 'type' => 'checkbox',\n 'label' => 'Enable Fosdick Integration',\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'description' => 'This controls the title which the user sees during checkout.',\n 'default' => 'Fosdick Integration',\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => 'Customer Message',\n 'description' => 'This controls the description which the user sees during checkout.',\n 'type' => 'textarea',\n 'default' => ''\n ),\n 'postURL' => array(\n 'title' => 'Fosdick Endpoint URL',\n 'description' => 'The URL that fosdick gave to send payments to',\n 'type' => 'text',\n 'default' => 'https://www.unitycart.com/ipmax/cart/ipost.asp'\n ),\n 'client_code' => array(\n 'title' => 'Client Code',\n 'type' => 'text',\n 'description' => 'Your Fosdick Account\\'s Client Code.',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'source_code' => array(\n 'title' => 'Source Code',\n 'type' => 'text',\n 'description' => 'This store\\'s Fosdick Source Code.',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'ad_code' => array(\n 'title' => 'Ad Code',\n 'type' => 'text',\n 'description' => 'The Ad Code.',\n 'default' => '',\n 'desc_tip' => true,\n ),\n 'test' => array(\n 'title' => 'Test Mode',\n 'type' => 'checkbox',\n 'label' => 'Enable Test Mode',\n 'default' => 'no'\n )\n );\n }", "protected function _prepareForm()\n {\n $helper = Mage::helper('oggetto_faq');\n $model = $this->getCurrentQuestionsModel();\n\n $form = new Varien_Data_Form([\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', [\n 'id' => $this->getRequest()->getParam('id')\n ]),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ]);\n\n $this->setForm($form);\n\n\n $fieldset = $form->addFieldset('edit_form', ['legend' => $helper->__('Questions Information')]);\n\n $fieldset->addField('name', 'label', [\n 'label' => $helper->__('User name'),\n 'name' => 'name',\n ]);\n $fieldset->addField('email', 'label', [\n 'label' => $helper->__('User email'),\n 'name' => 'email',\n ]);\n $fieldset->addField('question_text', 'editor', [\n 'label' => $helper->__('Question text'),\n 'name' => 'question_text',\n ]);\n $fieldset->addField('answer_text', 'editor', [\n 'label' => $helper->__('Answer text'),\n 'name' => 'answer_text',\n ]);\n $fieldset->addField('created_at', 'label', [\n 'label' => $helper->__('Created'),\n 'name' => 'created_at',\n ]);\n $fieldset->addField('with_feedback', 'label', [\n 'label' => $helper->__('With feedback'),\n 'name' => 'with_feedback',\n ]);\n $fieldset->addField('was_notified', 'label', [\n 'label' => $helper->__('Was notified to user'),\n 'name' => 'was_notified',\n ]);\n\n $form->setUseContainer(true);\n\n $form->setValues($model->getData());\n\n return parent::_prepareForm();\n }", "abstract protected function getOptionsFormFields(): array;", "function options_form(&$form, &$form_state) {\n // Build list of valid fields\n $options = array();\n $handlers = $this->display->handler->get_handlers('field');\n foreach ($handlers as $field => $handler) {\n if (empty($handler->options['exclude'])) {\n $options[$field] = $handler->label();\n }\n }\n\n $form['project'] = array(\n '#tree' => TRUE,\n '#type' => 'fieldset',\n '#title' => t('Project fields'),\n );\n foreach ($this->project_elements() as $element) {\n $form['project'][$element] = array(\n '#title' => $element,\n '#type' => 'select',\n '#options' => $options,\n '#default_value' => $this->options['project'][$element],\n );\n }\n\n $form['release'] = array(\n '#tree' => TRUE,\n '#type' => 'fieldset',\n '#title' => t('Release fields'),\n );\n foreach ($this->release_elements() as $element) {\n $form['release'][$element] = array(\n '#title' => $element,\n '#type' => 'select',\n '#options' => $options,\n '#default_value' => $this->options['release'][$element],\n );\n }\n }", "public function buildForm()\n {\n $this\n ->addCollection('recipient_country', 'Activity\\RecipientCountry', 'recipient_country')\n ->addAddMoreButton('add_recipient_country', 'recipient_country');\n }", "public function init_form_fields() {\n\t\t\t// Apply filters in case it's need to be extended\n\t\t\t$this->form_fields = apply_filters( 'wc_affidaty_form_fields', array(\n\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t'title' => __( 'Enable/Disable', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Enable Affidaty Payment', 'affidaty-woo' ),\n\t\t\t\t\t'default' => 'yes'\n\t\t\t\t),\n\n\t\t\t\t'test_mode' => array(\n\t\t\t\t\t'title' => __( 'Test Mode', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __( 'Enable Affidaty Test Mode', 'affidaty-woo' ),\n\t\t\t\t\t'default' => 'yes'\n\t\t\t\t),\n\n\t\t\t\t'application_id' => array(\n\t\t\t\t\t'title' => __( 'Application ID', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Application ID', 'affidaty-woo' ),\n\t\t\t\t\t'default' => ''\n\t\t\t\t),\n\n\t\t\t\t'secret_token' => array(\n\t\t\t\t\t'title' => __( 'Secret Token', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => __( 'Secret Token', 'affidaty-woo' ),\n\t\t\t\t\t'default' => ''\n\t\t\t\t),\n\n\t\t\t\t'title' => array(\n\t\t\t\t\t'title' => __( 'Title', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'description' => __( 'This controls the title for the payment method the customer sees during checkout.', 'affidaty-woo' ),\n\t\t\t\t\t'default' => __( 'Affidaty Payment', 'affidaty-woo' ),\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\n\t\t\t\t'description' => array(\n\t\t\t\t\t'title' => __( 'Description', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'Payment method description that the customer will see on your checkout.', 'affidaty-woo' ),\n\t\t\t\t\t'default' => __( 'Test mode, testing skeleton', 'affidaty-woo' ),\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\n\t\t\t\t'instructions' => array(\n\t\t\t\t\t'title' => __( 'Instructions', 'affidaty-woo' ),\n\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t'description' => __( 'Instructions that will be added to the thank you page and emails.', 'affidaty-woo' ),\n\t\t\t\t\t'default' => '',\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t\t),\n\t\t\t) );\n\t\t}", "public function define_fields() {\n\n\t\t$category_options = array();\n\t\t$category_lists = array();\n\t\t$categories = get_terms( 'give_forms_category', apply_filters( 'give_forms_category_dropdown', array() ) );\n\t\tif ( give_is_setting_enabled( give_get_option( 'categories' ) ) && ! is_wp_error( $categories ) ) {\n\t\t\tforeach ( $categories as $category ) {\n\t\t\t\t$category_options[ absint( $category->term_id ) ] = esc_html( $category->name );\n\t\t\t}\n\n\t\t\t$category_lists['type'] = 'listbox';\n\t\t\t$category_lists['name'] = 'cats';\n\t\t\t$category_lists['label'] = __( 'Select a Donation Form Category:', 'give' );\n\t\t\t$category_lists['tooltip'] = __( 'Select a Donation Form Category', 'give' );\n\t\t\t$category_lists['options'] = $category_options;\n\t\t}\n\n\t\t$tag_options = array();\n\t\t$tag_lists = array();\n\t\t$tags = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) );\n\t\tif ( give_is_setting_enabled( give_get_option( 'tags' ) ) && ! is_wp_error( $tags ) ) {\n\t\t\t$tags = get_terms( 'give_forms_tag', apply_filters( 'give_forms_tag_dropdown', array() ) );\n\t\t\tforeach ( $tags as $tag ) {\n\t\t\t\t$tag_options[ absint( $tag->term_id ) ] = esc_html( $tag->name );\n\t\t\t}\n\n\t\t\t$tag_lists['type'] = 'listbox';\n\t\t\t$tag_lists['name'] = 'tags';\n\t\t\t$tag_lists['label'] = __( 'Select a Donation Form Tag:', 'give' );\n\t\t\t$tag_lists['tooltip'] = __( 'Select a Donation Form Tag', 'give' );\n\t\t\t$tag_lists['options'] = $tag_options;\n\t\t}\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'type' => 'container',\n\t\t\t\t'html' => sprintf( '<p class=\"give-totals-shortcode-container-message\">%s</p>',\n\t\t\t\t\t__( 'This shortcode shows the total amount raised towards a custom goal for one or several forms regardless of whether they have goals enabled or not.', 'give' )\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'container',\n\t\t\t\t'html' => sprintf( '<p class=\"strong margin-top\">%s</p>', __( 'Shortcode Configuration', 'give' ) ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'ids',\n\t\t\t\t'label' => __( 'Donation Form IDs:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Enter the IDs separated by commas for the donation forms you would like to combine within the totals.', 'give' ),\n\t\t\t),\n\t\t\t$category_lists,\n\t\t\t$tag_lists,\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'total_goal',\n\t\t\t\t'label' => __( 'Total Goal:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Enter the total goal amount that you would like to display.', 'give' ),\n\t\t\t\t'required' => array(\n\t\t\t\t\t'alert' => esc_html__( 'Please enter a valid total goal amount.', 'give' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'message',\n\t\t\t\t'label' => __( 'Message:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Enter a message to display encouraging donors to support the goal.', 'give' ),\n\t\t\t\t'value' => apply_filters( 'give_totals_message', __( 'Hey! We\\'ve raised {total} of the {total_goal} we are trying to raise for this campaign!', 'give' ) ),\n\t\t\t\t'multiline' => true,\n\t\t\t\t'minWidth' => 300,\n\t\t\t\t'minHeight' => 60,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'link',\n\t\t\t\t'label' => __( 'Link:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Enter a link to the main campaign donation form.', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'link_text',\n\t\t\t\t'label' => __( 'Link Text:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Enter hyperlink text for the link to the main campaign donation form.', 'give' ),\n\t\t\t\t'value' => __( 'Donate!', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'progress_bar',\n\t\t\t\t'label' => __( 'Show Progress Bar:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Select whether you would like to show a goal progress bar.', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'true' => __( 'Show', 'give' ),\n\t\t\t\t\t'false' => __( 'Hide', 'give' ),\n\t\t\t\t),\n\t\t\t\t'value' => 'true',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'docs_link',\n\t\t\t\t'text' => esc_html__( 'Learn more about the Donation Totals Shortcode', 'give' ),\n\t\t\t\t'link' => 'http://docs.givewp.com/shortcode-donation-totals',\n\t\t\t),\n\t\t);\n\t}", "public function define_fields() {\n\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'type' => 'container',\n\t\t\t\t'html' => sprintf( '<p class=\"strong margin-top\">%s</p>', esc_html__( 'Optional settings', 'give' ) ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'ids',\n\t\t\t\t'label' => esc_attr__( 'Form IDs:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Enter a comma-separated list of form IDs. If empty, all published forms are displayed.', 'give' ),\n\t\t\t\t'placeholder' => esc_html__( 'All Forms', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'exclude',\n\t\t\t\t'label' => esc_attr__( 'Excluded Form IDs:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Enter a comma-separated list of form IDs to exclude those from the grid.', 'give' ),\n\t\t\t\t'placeholder' => esc_html__( 'Excluded Forms', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'orderby',\n\t\t\t\t'label' => esc_attr__( 'Order By:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Different parameter to set the order for the forms display in the form grid.', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'title' => esc_html__( 'Form Name', 'give' ),\n\t\t\t\t\t'amount_donated' => esc_html__( 'Amount Donated', 'give' ),\n\t\t\t\t\t'number_donations' => esc_html__( 'Number of Donations', 'give' ),\n\t\t\t\t\t'menu_order' => esc_html__( 'Menu Order', 'give' ),\n\t\t\t\t\t'post__in' => esc_html__( 'Provided Form IDs', 'give' ),\n\t\t\t\t\t'closest_to_goal' => esc_html__( 'Closest To Goal', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Date Created', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'order',\n\t\t\t\t'label' => esc_attr__( 'Order:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Display forms based on order.', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'ASC' => esc_html__( 'Ascending', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Descending', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'columns',\n\t\t\t\t'label' => esc_attr__( 'Columns:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Sets the number of forms per row.', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'1' => esc_html__( '1', 'give' ),\n\t\t\t\t\t'2' => esc_html__( '2', 'give' ),\n\t\t\t\t\t'3' => esc_html__( '3', 'give' ),\n\t\t\t\t\t'4' => esc_html__( '4', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Best Fit', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'show_goal',\n\t\t\t\t'label' => esc_attr__( 'Show Goal:', 'give' ),\n\t\t\t\t'tooltip' => __( 'Do you want to display the goal\\'s progress bar?', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'false' => esc_html__( 'Hide', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Show', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'show_excerpt',\n\t\t\t\t'label' => esc_attr__( 'Show Excerpt:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Do you want to display the excerpt?', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'false' => esc_html__( 'Hide', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Show', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'show_featured_image',\n\t\t\t\t'label' => esc_attr__( 'Show Featured Image:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Do you want to display the featured image?', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'false' => esc_html__( 'Hide', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Show', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'listbox',\n\t\t\t\t'name' => 'display_style',\n\t\t\t\t'label' => esc_attr__( 'Display Style:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Show form as modal window or redirect to a new page?', 'give' ),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'redirect' => esc_html__( 'Redirect', 'give' ),\n\t\t\t\t),\n\t\t\t\t'placeholder' => esc_html__( 'Modal', 'give' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'textbox',\n\t\t\t\t'name' => 'forms_per_page',\n\t\t\t\t'label' => esc_attr__( 'Forms Per Page:', 'give' ),\n\t\t\t\t'tooltip' => esc_attr__( 'Sets the number of forms to display per page.', 'give' ),\n\t\t\t\t'value' => 12,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'docs_link',\n\t\t\t\t'text' => esc_html__( 'Learn more about the Donation Form Grid Shortcode', 'give' ),\n\t\t\t\t'link' => 'http://docs.givewp.com/shortcode-form-grid',\n\t\t\t),\n\t\t);\n\t}", "public function formFields()\n {\n return $this\n ->field('question_belongsto_level_relationship', 3)\n ->field('question_belongsto_grade_relationship', 3)\n ->field('question_belongsto_subject_relationship', 3)\n ->field('type_question_id', 3)\n ->field('content', 12)\n ->get();\n }", "protected function _initFormFields() {\n if (count($this->form_fields)) {\n return $this->form_fields;\n }\n $yesno = array(\n 'yes' => $this->l('Yes'),\n 'no' => $this->l('No'),\n );\n $boxUnits = array(\n 'order' => $this->l('Per Order'),\n 'item' => $this->l('Per Package'),\n );\n $countryUnits = array(\n '0' => $this->l('All Allowed Countries'),\n '1' => $this->l('Specific Countries'),\n );\n\n $this->form_fields = array(\n 'title' => array(\n 'title' => $this->l('Title'),\n 'type' => 'multilang',\n 'description' => $this->l('This controls the title which the user sees during checkout.'),\n 'default' => $this->l('DPD Parcelshop'),\n 'css' => 'width: 300px;',\n ),\n 'handling_fee' => array(\n 'title' => $this->l('Price'),\n 'type' => 'text',\n 'description' => '',\n 'default' => '4.90',\n 'css' => 'width: 300px;',\n 'validate' => array('required_entry', 'validate_number'),\n ),\n 'tax' => array(\n 'title' => $this->l('Tax Id'),\n 'type' => 'select',\n 'description' => $this->l('Prices here are tax inclusive'),\n 'default' => '',\n 'css' => 'width: 300px;',\n 'validate' => array(),\n 'options' => $this->_getHelperModule()->getTaxes(),\n ),\n 'handling_fee_country' => array(\n 'title' => $this->l('Price per country'),\n 'type' => 'countryprice',\n 'description' => $this->l('If country is not listed here, but this method is available, then general handling fee is applied'),\n 'default' => 'a:3:{s:18:\"_1388439524852_852\";a:4:{s:10:\"country_id\";s:2:\"EE\";s:10:\"base_price\";s:4:\"4.90\";s:8:\"kg_price\";s:1:\"0\";s:18:\"free_shipping_from\";s:0:\"\";}s:17:\"_1388442604053_53\";a:4:{s:10:\"country_id\";s:2:\"LV\";s:10:\"base_price\";s:5:\"12.90\";s:8:\"kg_price\";s:1:\"0\";s:18:\"free_shipping_from\";s:0:\"\";}s:18:\"_1388709088932_932\";a:4:{s:10:\"country_id\";s:2:\"LT\";s:10:\"base_price\";s:5:\"13.90\";s:8:\"kg_price\";s:1:\"0\";s:18:\"free_shipping_from\";s:0:\"\";}}',\n 'css' => 'width: 300px;',\n 'validate' => array('validate_handling_fee_country'),\n ),\n 'shortname' => array(\n 'title' => $this->l('Show short office names'),\n 'type' => 'select',\n 'description' => $this->l('Yes: Shows only office name') . '<br/>' . $this->l('No: Shows office name and address'),\n 'default' => 'yes',\n 'css' => 'width: 300px;',\n 'options' => $yesno,\n ),\n 'sort_offices' => array(\n 'title' => $this->l('Sort offices by priority'),\n 'type' => 'select',\n 'description' => $this->l('Yes: Offices from bigger cities will be in front')\n . '<br/>' . $this->l('No: Offices are sorted alphabetically')\n ,\n 'default' => 'yes',\n 'css' => 'width: 300px;',\n 'options' => $yesno,\n ),\n 'checkitems' => array(\n 'title' => sprintf($this->l('Disable this carrier if product\\'s short description contains HTML comment %s'), '&lt;!-- no dpd_ee_module --&gt;'),\n 'type' => 'select',\n 'description' => '',\n 'default' => 'no',\n 'css' => 'width: 300px;',\n 'options' => $yesno,\n ),\n 'max_package_weight' => array(\n 'title' => $this->l('Maximum allowed package weight for this carrier'),\n 'type' => 'text',\n 'description' => '',\n 'default' => '20',\n 'css' => 'width: 300px;',\n ),\n 'handling_action' => array(\n 'title' => $this->l('Handling action'),\n 'type' => 'select',\n 'description' => $this->l('Per Order: Shipping cost equals Shipping price')\n . '<br/>' . $this->l('Per Package: Shipping cost equals Number of Items in cart multiplied by shipping price')\n ,\n 'default' => 'yes',\n 'css' => 'width: 300px;',\n 'options' => $boxUnits,\n ),\n 'free_groups' => array(\n 'title' => $this->l('Client groups who can get free shipping'),\n 'type' => 'multiselect',\n 'description' => $this->l('hold down CTRL / CMD button to select/deselect multiple'),\n 'default' => '',\n 'css' => 'width: 300px;',\n 'options' => $this->_getHelperModule()->getClientGroups(),\n ),\n 'enable_free_shipping' => array(\n 'title' => $this->l('Enable free shipping'),\n 'type' => 'select',\n 'description' => '',\n 'default' => 'no',\n 'css' => 'width: 300px;',\n 'options' => $yesno,\n ),\n 'free_shipping_from' => array(\n 'title' => $this->l('Free shipping subtotal'),\n 'type' => 'text',\n 'description' => '',\n 'default' => '',\n 'css' => 'width: 300px;',\n 'validate' => array('validate_number'),\n ),\n 'sallowspecific' => array(\n 'title' => $this->l('Ship to applicable countries'),\n 'type' => 'select',\n 'description' => '',\n 'default' => '1',\n 'css' => 'width: 300px;',\n 'options' => $countryUnits,\n ),\n 'specificcountry' => array(\n 'title' => $this->l('Ship to Specific countries'),\n 'type' => 'multiselect',\n 'description' => '',\n 'default' => 'EE,LV,LT',\n 'css' => 'width: 300px;',\n 'options' => $this->_getHelperModule()->getCountriesAsOptions(),\n ),\n 'dis_first' => array(\n 'title' => $this->l('Show customer one dropdown instead of two'),\n 'type' => 'select',\n 'description' => $this->l('If this setting is enabled, then customer will be displayed only with a list of stores you entered.')\n . '<br/>' . $this->l('If this setting is disabled, then customer has to pick country/city first and then customer will be displayed second select menu, which contains stores in the selected county/city.'),\n 'default' => 'yes',\n 'css' => 'width: 300px;',\n 'options' => $yesno,\n ),\n 'gr_width' => array(\n 'title' => $this->l('Width in pixels for city select menu'),\n 'type' => 'text',\n 'description' => $this->l('Use only when you feel that select menu is too wide.'),\n 'default' => '',\n 'css' => 'width: 300px;',\n ),\n 'of_width' => array(\n 'title' => $this->l('Width in pixels for office select menu'),\n 'type' => 'text',\n 'description' => $this->l('Use only when you feel that select menu is too wide.'),\n 'default' => '250',\n 'css' => 'width: 300px;',\n ),\n );\n\n\n if ($this->dataSendExecutor) {\n $this->form_fields = $this->addArrayAfterKey($this->form_fields, $this->dataSendExecutor->initFormFields(), 'free_shipping_from');\n }\n\n return $this->form_fields;\n }", "public function init_form_fields(){\n $this->form_fields = apply_filters('dynamo_payment_fields', array(\n 'enabled' => array(\n 'title' => __('Enable/Disable', 'dynamo pay'),\n 'type' => 'checkbox',\n 'label' => __('Enable or Disable Payment'),\n 'default' => 'no'\n ),\n 'title' => array(\n 'title' => __('Dynamo Payment Gateway', 'dynamo pay'),\n 'type' => 'text',\n 'description' => __('Add a title for the Dynamo Payment Gateway', 'dynamo pay'),\n 'desc_tip' => true,\n 'default' => __('Dynamo Payment Gateway', 'dynamo pay')\n ),\n 'description' => array(\n 'title' => __('Dynamo Payment Description', 'dynamo pay'),\n 'type' => 'textarea',\n 'description' => __('Enter a description for the dynamo payment gateway', 'dynamo pay'),\n 'desc_tip' => true\n )\n ));\n }", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title'\t\t=> __( 'Enable / Disable', 'monetico' ),\n\t\t\t\t'label'\t\t=> __( 'Enable this payment gateway', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'checkbox',\n\t\t\t\t'default'\t=> 'no',\n\t\t\t\t\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title'\t\t=> __( 'Title', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t'desc_tip'\t=> __( 'Payment title the customer will see during the checkout process.', 'monetico' ),\n\t\t\t\t'default'\t=> __( 'Pay Using Monetico', 'monetico' ),\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title'\t\t=> __( 'Description', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'textarea',\n\t\t\t\t'desc_tip'\t=> __( 'Payment description the customer will see during the checkout process.', 'monetico' ),\n\t\t\t\t'default'\t=> __( 'Pay securely using your credit card.', 'monetico' ),\n\t\t\t\t'css'\t\t=> 'max-width:350px;'\n\t\t\t),\n\t\t\t'environment' => array(\n\t\t\t\t'title'\t\t=> __( 'Test Mode', 'monetico' ),\n\t\t\t\t'label'\t\t=> __( 'Enable Test Mode', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'checkbox',\n\t\t\t\t'default'\t=> 'no',\n\t\t\t),\n\t\t\t'language' => array(\n\t\t\t\t'title' => __( 'Language', 'monetico' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'desc_tip' => __( 'Moneris supports only EN and FR', 'monetico' ),\n\t\t\t\t'default' => 'EN',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'EN' => __( 'English', 'monetico' ),\n\t\t\t\t\t'FR' => __( 'French', 'monetico' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'tpe' => array(\n\t\t\t\t'title'\t\t=> __( 'EPT Number', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t'desc_tip'\t=> __( 'Merchant’s virtual EPT number Example: 1234567.', 'monetico' ),\n\t\t\t),\n\t\t\t'societe' => array(\n\t\t\t\t'title'\t\t=> __( 'Societe', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'text',\n\t\t\t\t'desc_tip'\t=> __( 'Alphanumeric code to enable the merchant to use the same virtual EPT for different sites (separate configurations) relating to the same activity. The code is supplied by Monetico.', 'monetico' ),\n\t\t\t),\n\t\t\t'secret_key' => array(\n\t\t\t\t'title'\t\t=> __( 'Secret Key', 'monetico' ),\n\t\t\t\t'type'\t\t=> 'password',\n\t\t\t\t'desc_tip'\t=> __( 'Secret Key to generate the seal from the data to certify and the merchant’s security key in its operational form.', 'monetico' ),\n\t\t\t),\n\t\t\n\t\t\t\n\t\t);\t\t\n\t}", "function init_form_fields(){\r\n\t\t$this->form_fields = array(\r\n\t\t\t\t'enabled' => array(\r\n\t\t\t\t\t'title' => __('Включен?', 'woocommerce'),\r\n\t\t\t\t\t'type' => 'checkbox',\r\n\t\t\t\t\t'label' => __('Включен', 'woocommerce'),\r\n\t\t\t\t\t'default' => 'yes'\r\n\t\t\t\t),\r\n\t\t\t\t'title' => array(\r\n\t\t\t\t\t'title' => __('Название', 'woocommerce'),\r\n\t\t\t\t\t'type' => 'text', \r\n\t\t\t\t\t'description' => __( 'Это название, которое пользователь видит во время оплаты.', 'woocommerce' ), \r\n\t\t\t\t\t'default' => __('PAYLER', 'woocommerce')\r\n\t\t\t\t),\r\n\t\t\t\t'payler_key' => array(\r\n\t\t\t\t\t'title' => __('Платежный ключ', 'woocommerce'),\r\n\t\t\t\t\t'type' => 'text',\r\n\t\t\t\t\t'description' => __('Введите платежный ключ, выданный сотрудниками Payler', 'woocommerce'),\r\n\t\t\t\t\t'default' => ''\r\n\t\t\t\t),\r\n\t\t\t\t'testmode' => array(\r\n\t\t\t\t\t'title' => __('Тестовый режим?', 'woocommerce'),\r\n\t\t\t\t\t'type' => 'checkbox', \r\n\t\t\t\t\t'label' => __('Включен', 'woocommerce'),\r\n\t\t\t\t\t'description' => __('Использовать тестовый аккаунт. Внимание: платежные ключи для тестового и боевого аккаунта различаются!', 'woocommerce'),\r\n\t\t\t\t\t'default' => 'no'\r\n\t\t\t\t),\r\n\t\t\t\t'session_type' => array(\r\n\t\t\t\t\t'title' => __('Тип платежной сессии', 'woocommerce'),\r\n\t\t\t\t\t'type' => 'select', \r\n\t\t\t\t\t'label' => __('Тип платежной сессии', 'woocommerce'),\r\n\t\t\t\t\t'description' => __('При двухстадийной оплате денежные средства только блокируются на карте, после чего менеджер через Личный кабинет Payler должен подтвердить платеж', 'woocommerce'),\r\n\t\t\t\t\t'options' => array(\r\n\t\t\t\t\t\t'OneStep' => 'Одностадийная оплата',\r\n\t\t\t\t\t\t'TwoStep' => 'Двухстадийная оплата'\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'default' => 'Одностадийная оплата'\r\n\t\t\t\t),\r\n\t\t\t\t'description' => array(\r\n\t\t\t\t\t'title' => __( 'Описание', 'woocommerce' ),\r\n\t\t\t\t\t'type' => 'textarea',\r\n\t\t\t\t\t'description' => __( 'Описанием метода оплаты, которое клиент будет видеть на сайте', 'woocommerce' ),\r\n\t\t\t\t\t'default' => 'Оплата с помощью Payler.'\r\n\t\t\t\t),\r\n\t\t\t\t'instructions' => array(\r\n\t\t\t\t\t'title' => __( 'Инструкции', 'woocommerce' ),\r\n\t\t\t\t\t'type' => 'textarea',\r\n\t\t\t\t\t'description' => __( 'Дополнительная информация, которую пользователь увидит после успешной оплаты.', 'woocommerce' ),\r\n\t\t\t\t\t'default' => ''\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "function addMissingFields() {\n // Track deletions\n foreach ($this->getAnswers() as $answer)\n $answer->deleted = true;\n\n foreach ($this->getForm()->getDynamicFields() as $field) {\n $found = false;\n foreach ($this->getAnswers() as $answer) {\n if ($answer->get('field_id') == $field->get('id')) {\n $answer->deleted = false; $found = true; break;\n }\n }\n if (!$found && ($field = $field->getImpl($field))\n && !$field->isPresentationOnly()) {\n $a = DynamicFormEntryAnswer::create(\n array('field_id'=>$field->get('id'), 'entry_id'=>$this->id));\n $a->field = $field;\n $a->entry = $this;\n $a->deleted = false;\n // Add to list of answers\n $this->_values[] = $a;\n $this->_fields[$field->get('id')] = $field;\n $this->_form = null;\n\n // Omit fields without data\n // For user entries, the name and email fields should not be\n // saved with the rest of the data\n if ($this->object_type == 'U'\n && in_array($field->get('name'), array('name','email')))\n continue;\n\n if ($this->object_type == 'O'\n && in_array($field->get('name'), array('name')))\n continue;\n\n if (!$field->hasData())\n continue;\n\n $a->save();\n }\n }\n\n // Sort the form the way it is declared to be sorted\n if ($this->_fields) {\n uasort($this->_fields,\n function($a, $b) {\n return $a->get('sort') - $b->get('sort');\n });\n }\n }", "protected function defineFormFields()\n {\n $this->formFields = array();\n\n foreach ($this->sections as $section => $label) {\n $this->formFields[$section] = array(\n self::SECTION_PARAM_WIDGET => $this->defineSectionWidget($section, [self::SCHEMA_LABEL => $label]),\n self::SECTION_PARAM_FIELDS => $this->getFormFieldsForSection($section),\n );\n }\n }", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'dokan' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'dokan' ),\n 'default' => 'yes',\n ),\n\n 'subject' => array(\n 'title' => __( 'Subject', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{blogname}</code>' ),\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __( 'Email heading', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{product_title}</code>' ),\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'dokan' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'dokan' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "public function init_form_fields() {\n\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'flw-payments' ),\n 'label' => __( 'Enable Rave Payment Gateway', 'flw-payments' ),\n 'type' => 'checkbox',\n 'description' => __( 'Enable Rave Payment Gateway as a payment option on the checkout page', 'flw-payments' ),\n 'default' => 'no',\n 'desc_tip' => true\n ),\n 'public_key' => array(\n 'title' => __( 'Pay Button Public Key', 'flw-payments' ),\n 'type' => 'text',\n 'description' => __( 'Required! Enter your Pay Button public key here', 'flw-payments' ),\n 'default' => ''\n ),\n 'modal_title' => array(\n 'title' => __( 'Modal Title', 'flw-payments' ),\n 'type' => 'text',\n 'description' => __( 'Optional - The title of the payment modal (default: FLW PAY)', 'flw-payments' ),\n 'default' => ''\n ),\n 'modal_description' => array(\n 'title' => __( 'Modal Description', 'flw-payments' ),\n 'type' => 'text',\n 'description' => __( 'Optional - The description of the payment modal (default: FLW PAY MODAL)', 'flw-payments' ),\n 'default' => ''\n ),\n\n );\n\n }", "public function init_form_fields() {\n\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'woovoucher' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable this email notification', 'woovoucher' ),\n\t\t\t\t'default' => 'yes',\n\t\t\t),\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Subject', 'woovoucher' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => '<p class=\"description\">'.\n\t\t\t\t\t\t\t\t\t__( 'This is the subject line for the gift notification email. Available template tags for subject fields are :', 'woovoucher' ).\n\t\t\t\t\t\t\t\t\t'<br /><code>{first_name}</code> - '.__( 'displays the first name of customer', 'woovoucher' ).\n\t\t\t\t\t\t\t\t\t'<br /><code>{last_name}</code> - '.__( 'displays the last name of customer', 'woovoucher' ).\n\t\t\t\t\t\t\t\t\t'<br /><code>{recipient_name}</code> - '.__( 'displays the recipient name', 'woovoucher' ).'</p>',\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', 'woovoucher' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading:', 'woovoucher' ) . '<code> '. $this->heading . '</code>.',\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email type', 'woovoucher' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', 'woovoucher' ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'plain' => __( 'Plain text', 'woovoucher' ),\n\t\t\t\t\t'html' => __( 'HTML', 'woovoucher' ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "public function item_custom_fields_to_form() {\n // 1. special management for fields equipped with \"free\" checkbox\n // nothing to do: they don't exist in this plugin\n\n // 2. special management for composite fields\n // nothing to do: they don't exist in this plugin\n\n // 3. special management for defaultvalue\n // nothing to do: defaultvalue doesn't need any further care\n\n // 4. special management for autofill contents\n $referencearray = array(''); // <-- take care, the first element is already on board\n for ($i = 1; $i <= SURVEYFIELD_AUTOFILL_CONTENTELEMENT_COUNT; $i++) {\n $referencearray[] = constant('SURVEYFIELD_AUTOFILL_CONTENTELEMENT'.sprintf('%02d', $i));\n }\n\n $items = array();\n for ($i = 1; $i < 6; $i++) {\n $index = sprintf('%02d', $i);\n $fieldname = 'element'.$index.'_select';\n if (in_array($this->{'element'.$index}, $referencearray)) {\n $this->{$fieldname} = $this->{'element'.$index};\n } else {\n $constantname = 'SURVEYFIELD_AUTOFILL_CONTENTELEMENT'.SURVEYFIELD_AUTOFILL_CONTENTELEMENT_COUNT;\n $this->{$fieldname} = constant($constantname);\n $fieldname = 'element'.$index.'_text';\n $this->{$fieldname} = $this->{'element'.$index};\n }\n }\n }", "public function init_form_fields() {\n\n\t\t// Set our new array of fields.\n\t\t$settings_args = array(\n\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Email Subject', 'woo-better-reviews' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t// translators: %s: list of placeholders\n\t\t\t\t'description' => sprintf( __( 'Available placeholders: %s', 'woo-better-reviews' ), '<code>' . implode( '</code>, <code>', array_keys( $this->placeholders ) ) . '</code>' ),\n\t\t\t\t'placeholder' => $this->get_default_subject(),\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', 'woo-better-reviews' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t// translators: %s: list of placeholders\n\t\t\t\t'description' => sprintf( __( 'Available placeholders: %s', 'woo-better-reviews' ), '<code>' . implode( '</code>, <code>', array_keys( $this->placeholders ) ) . '</code>' ),\n\t\t\t\t'placeholder' => $this->get_default_heading(),\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email Type', 'woo-better-reviews' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', 'woo-better-reviews' ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type wc-enhanced-select',\n\t\t\t\t'options' => $this->get_email_type_options(),\n\t\t\t\t'desc_tip' => true,\n\t\t\t),\n\t\t);\n\n\t\t// Now set the actual fields with a filter.\n\t\t$this->form_fields = apply_filters( Core\\HOOK_PREFIX . 'reminder_email_admin_settings', $settings_args );\n\t}", "public function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => 'Enable/Disable',\n 'type' => 'checkbox',\n 'label' => 'Enable this email notification',\n 'default' => 'yes'\n ),\n 'recipient' => array(\n 'title' => 'Recipient(s)',\n 'type' => 'text',\n 'description' => sprintf( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', esc_attr( get_option( 'admin_email' ) ) ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'subject' => array(\n 'title' => 'Subject',\n 'type' => 'text',\n 'description' => sprintf( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', $this->subject ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'heading' => array(\n 'title' => 'Email Heading',\n 'type' => 'text',\n 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.' ), $this->heading ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'email_type' => array(\n 'title' => 'Email type',\n 'type' => 'select',\n 'description' => 'Choose which format of email to send.',\n 'default' => 'html',\n 'class' => 'email_type',\n 'options' => array(\n 'plain' => 'Plain text',\n 'html' => 'HTML', 'woocommerce',\n 'multipart' => 'Multipart', 'woocommerce',\n )\n )\n );\n }", "public function buildForm()\n {\n $this\n ->addNarrative('description_narrative')\n ->addAddMoreButton('add_narrative', 'description_narrative');\n }", "function setup_gravity_form_options() {\r\n\t\tif ( !$this->is_plugin_active() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$forms = RGFormsModel::get_forms(null, 'title');\r\n\r\n\t\tif ( !is_array($forms) || empty($forms) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$options = array(\r\n\t\t\t'0' => __('No form', 'crb'),\r\n\t\t);\r\n\r\n\t\tforeach ($forms as $form) {\r\n\t\t\t$options[$form->id] = $form->title;\r\n\t\t}\r\n\r\n\t\t$this->set_options($options);\r\n\t}", "function bbp_forum_form_fields()\n{\n}", "public function createFormFields($options=array()) {\n $html = '';\n $options['multiple'] = (isset($options['multiple']) && $options['multiple']) ? true : false;\n $options['idMultiple'] = ($options['multiple']) ? md5(rand()*rand()*rand()) : '';\n $options['idMultiple'] = (isset($options['idMultipleJs']) && $options['idMultipleJs']!='') ? $options['idMultipleJs'] : $options['idMultiple'];\n $options['nameMultiple'] = (isset($options['nameMultiple'])) ? $options['nameMultiple'] : '';\n if ($this->object->hasOrd()) {\n $nameOrd = ($options['nameMultiple']!='') ? $options['nameMultiple'].'['.$options['idMultiple'].'][ord]' : 'ord';\n $html .= FormField_Hidden::create(array_merge(array('name'=>$nameOrd, 'value'=>$this->object->get('ord'), 'class'=>'fieldOrd'), $options));\n }\n foreach($this->object->getAttributes() as $item) {\n if (!((string)$item->type=='password' && $this->object->get('password')!='')) {\n $html .= $this->createFormField($item, $options);\n }\n }\n return $html;\n }", "private function addForm() {\n\t\t$html .= '\n\t\t<div id=\"doctext\" style=\"height:300px;display:none\"> </div>\n\t\t<form name=\"couchfields\" action=\"' . $this->pi_getPageLink($GLOBALS['TSFE']->id) . '\" method=\"post\">';\n\t\tforeach ($this->defaultFields as $field) {\n\n\n\t\t\t$html .= '\n\t\t\t<label for=\"tx-relax-pi1-' . $field . '\">' . ucfirst($field) . '</label>\n\t\t\t<input type=\"text\" name=\"tx-relax-pi1[' . $field . ']\" id=\"tx-relax-pi1-' . $field . '\" />\n\t\t\t\t<br />';\n\t\t}\n\t\t$tempField = $this->getRandomFieldName();\n\t\t$html .= '\n\t\t\n\t\t\t<input type=\"text\" name=\"tx-relax-pi1[' . $tempField . '][fieldname]\" id=\"tx-relax-pi1-' . $tempField . '[label]\" />\n\t\t\t<input type=\"text\" name=\"tx-relax-pi1[' . $tempField . '][fieldvalue]\" id=\"tx-relax-pi1-' . $tempField . '[value]\" />\n\t\t\t<div class=\"addmore\">+</div>\n\t\t\t<br />\n\t\t\t<input type=\"submit\" name=\"tx-relax-pi1[add]\" value=\"add\" />\n\t\t\t\n\t\t</form>\n\t\t';\n\n\t\treturn $html;\n\t}" ]
[ "0.6807983", "0.67206717", "0.6676317", "0.6654291", "0.6610115", "0.6516515", "0.6508", "0.6480259", "0.6448565", "0.64422137", "0.64338696", "0.64189166", "0.64103717", "0.64076525", "0.63738036", "0.6366294", "0.63630295", "0.6358757", "0.6357407", "0.6326709", "0.6324986", "0.6313973", "0.62896615", "0.6271432", "0.62467706", "0.62432826", "0.62420714", "0.6238806", "0.62386787", "0.6229521" ]
0.6847051
0
inject course label into subject
private function formatSubject($subject) { $course = $this->core->getConfig()->getCourse(); return "[Submitty $course]: ".$subject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateCourseTitle($courseData) {\r\n\r\n return $courseData['subject'] . $courseData['crsenumb'] . '-' . sprintf('%03d',$courseData['sectnumb']) . ':' . $courseData['crsedescript'];\r\n\r\n}", "function quiz_get_category_coursename($category, $courseid = 0) {\n/// name\n $cname = (isset($category->indentedname)) ? $category->indentedname : $category->name;\n if ($category->course != $courseid && $category->publish) {\n if ($catcourse=get_record(\"course\",\"id\",$category->course)) {\n $cname .= \" ($catcourse->shortname) \";\n }\n }\n return $cname;\n}", "public function getLabel(): string {\n\t\treturn $this->getEmail()->getSubject();\n\t}", "function generateLessonName2($concept)\n {\n global $language;\n return $language . \": \" . $concept;\n }", "function Subject( $subject )\n {\n \t$this->xheaders['Subject'] = strtr( $subject, \"\\r\\n\" , \" \" );\n }", "function setSubject($value) {\n return $this->setFieldValue('subject', $value);\n }", "public function set_subject($value)\n {\n $this->subject = self::id_or_entity_helper($value, 'Subject');\n\n // if this is not a new patient, then set the subject for all the associated skills, too\n if ($this->id) {\n $skills = EntityUtils::getRepository('Patient')->getSkillsByPatient($this->id);\n foreach ($skills as $skill) {\n $skill->subject = $this->subject->id;\n }\n }\n }", "function smarty_block_label($params, $content, &$smarty, &$repeat) {\n $after_text = '';\n if(isset($params['after_text'])) {\n $after_text = $params['after_text'];\n unset($params['after_text']);\n } // if\n \n $is_required = false;\n if(isset($params['required'])) {\n $is_required = (boolean) $params['required'];\n unset($params['required']);\n } // if\n \n $not_lang = (boolean) array_var($params, 'not_lang');\n \n $text = $not_lang ? $content : lang($content);\n \n $render_text = trim($text) . $after_text;\n if($is_required) {\n $render_text = $render_text.'<em>*</em>';\n } // if\n \n return open_html_tag('label', $params) . $render_text . '</label>';\n }", "public function docSubject($subject = ''){$this->docSubject = $subject;}", "abstract protected function getSubjectName(): string;", "function getSubject() {\n return $this->getFieldValue('subject');\n }", "function getSubject() {\r\n return $this->data['entity']->title->text;\r\n }", "protected function getSubject():string {\n return (string) $this->getSubmittedValue('subject');\n }", "public function setLabel($var) {}", "public function setSubject(string $subject)\n {\n \t$this->claims['sub'] = $subject;\n }", "private function course()\n {\n $date = new DateBr();\n $course = new Course();\n $course = $course->courseAuth(0); \n $text = \"\";\n foreach($course as $item){\n $text .= empty($item->CourseType->description) ? '' : '<br><br><strong>'.$item->CourseType->description.'</strong><br>';\n $text .= empty($item->description) ? '' : ' '.$item->description;\n $text .= empty($item->institution) ? '' : ' - '.$item->institution;\n $text .= empty($item->start) ? '' : '<br> '.$date->convert($item->start);\n $text .= empty($item->end) ? '' : ' - '.$date->convert($item->end);\n $text .= empty($item->courseStatus->description) ? '' : ' - '.$item->courseStatus->description;\n }\n return $text;\n }", "function addSubject($subject1)\n\t\t{\n\t\t\t$subject = ucfirst($subject1);\n\t\t\t// build INSERT query string \n\t\t\t$sql = 'INSERT INTO `subjects` ( `subject` ) VALUES ( :subject );';\n\t\t\t// submit database query\n\t\t\t$stmt = $this->dbconn->prepare( $sql );\n\t\t\t$stmt->bindValue( ':subject', $subject );\n\t\t\t$stmt->execute();\n\t\t}", "protected function getEmailSubject()\r\n {\r\n return sprintf('Ride terms accepted by %s!', \r\n $this->otherUser->getProfiles()->getFullName());\r\n }", "protected function composeSubject() {\n\t\treturn $this->composePatternAttribute('subject');\n\t}", "public function lblSubject_Create($strControlId = null) {\n\t\t\t$this->lblSubject = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblSubject->Name = QApplication::Translate('Subject');\n\t\t\t$this->lblSubject->Text = $this->objEmailMessage->Subject;\n\t\t\treturn $this->lblSubject;\n\t\t}", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "function setSubject($subject) {\n $this->subject = trim($subject);\n }", "private function getSubject() {\n\t\treturn $this->ticket->getSubject();\n\t}", "public function getSubjectDescription()\n {\n return $this->subject_description;\n }", "public function setSubject()\n {\n if($this->template != false)\n {\n $this->subject = $this->template['subject'];\n }\n else\n {\n $this->subject = $this->getDefaultSubject();\n }\n }", "public function setSubject($val)\n {\n $this->_propDict[\"subject\"] = $val;\n return $this;\n }", "public function setSubject($val)\n {\n $this->_propDict[\"subject\"] = $val;\n return $this;\n }", "public function setSubject($subject){\n\t \n\t $this->_subject = $subject;\n\t \n\t}" ]
[ "0.6496406", "0.61165017", "0.59469277", "0.577887", "0.574987", "0.574823", "0.5733473", "0.57269686", "0.5649697", "0.5628886", "0.5590705", "0.5588469", "0.55820644", "0.5536633", "0.5517512", "0.55159026", "0.5495536", "0.54938495", "0.54870105", "0.5480872", "0.54441667", "0.54441667", "0.54441667", "0.5441844", "0.54412186", "0.54378325", "0.543562", "0.5421598", "0.5421598", "0.54101634" ]
0.64880604
1
Breaks up an xml file into several smaller files If the original archives xml file is smaller than max size it will be converted into a single file. Tested up to 1k articles.
function breakIntoFiles( $args ) { $uploads_dir = get_uploads_dir(); $boundaryTag = 'newsListItem'; $filename_index = $args['filename_index']; $articles_per_file = intval( $args['articles_per_file'] ); $xml_string = $args['xml_string']; $xml_array = explode("\n",$xml_string); $article_count = 0; // no.of articles added to xml file. resets to zero each time a file is created $files = $filename_index; // count of files created $length= count($xml_array); $header = ""; // header block for xml file $footer = "</news>"; // footer block for xml file "its fixed" $article_node = ""; // article_node of xml data to be written into file $filename_array = array(); // array of files created $article_start_tag = false; // true when first boundary tag is found $file_created = false; // false if some data has not been written to file //process main data for ( $i = 0; $i < $length; $i++ ){ $line = $xml_array[$i]; //if the line contains the string "<newsListItem" if ( strpos( $line , '&lt;newsListItem' ) !== false ) { //increase article count. $article_count ++; //We are at the start of an article node. $article_start_tag = true; } //Everything before the first article node //is the header of each new file if ( !$article_start_tag ) $header .= $line . "\r\n"; //Create new files As long as the article count is less than //number of articles per file if ( $article_count >= $articles_per_file) { $article_count = 0; $files++; $filename = $files . ".xml"; $f = fopen( $uploads_dir . $filename, "w"); fwrite($f, htmlspecialchars_decode( $header ) ); fwrite($f, htmlspecialchars_decode( $article_node ) ); fwrite($f, $footer); fclose($f); $filename_array[] = $filename; $article_node = $line . "\r\n"; $file_created = true; } else { $file_created = false; //push the line onto the article_node. if ( $article_start_tag ) $article_node .= $line . "\r\n"; } } if ( $file_created == false ) { $files++; $filename = $files . ".xml"; $f = fopen( $uploads_dir . $filename, "w" ); fwrite($f,htmlspecialchars_decode( $header ) ); fwrite($f, htmlspecialchars_decode($article_node ) ); fclose($f); $filename_array[] = $filename; $file_created = true; } return $filename_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _create()\n\t{\n\t\t$this->_xml->newXMLDocument();\n\t\t$this->_xml->addElement( 'xmlarchive', '', array( 'generator' => 'IPS_KERNEL', 'created' => time() ) );\n\t\t$this->_xml->addElement( 'fileset', 'xmlarchive' );\n\t\t\n\t\tforeach( $this->_fileArray as $f )\n\t\t{\n\t\t\t$f['content'] = chunk_split(base64_encode($f['content']));\n\t\t\t\n\t\t\t$this->_xml->addElementAsRecord( 'fileset', 'file', $f );\n\t\t}\n\t}", "function parseFile($xmlSource){\r\n\tglobal $tags;\r\n\t\r\n\t/*Creating the xml parser*/\r\n\t$xml_parser=xml_parser_create();\r\n\t\r\n\t/*Register the handlers*/\r\n\txml_set_element_handler($xml_parser,\"startElement\",\"endElement\");\r\n\txml_set_character_data_handler($xml_parser,\"characterData\");\r\n\t\r\n\t/*Disables case-folding. Needed for this example*/\r\n\txml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,false);\r\n\t\r\n\t/*Open the xml file and feed it to the parser in 4k blocks*/\r\n if(!($fp=fopen($xmlSource,\"r\"))){\r\n die(\"Cannot open $xmlSource \");\r\n }\r\n while(($data=fread($fp,4096))){\r\n\r\n if(!xml_parse($xml_parser,$data,feof($fp))){\r\n\t die(sprintf(\"XML error at line %d column %d \", \r\n xml_get_current_line_number($xml_parser), \r\n xml_get_current_column_number($xml_parser)));\r\n\t }\r\n }\r\n\r\n\t xml_parser_free($xml_parser);\r\n\t \r\n\t return $tags;\r\n\t\r\n}", "function parse_file ($file) {\n $fp = fopen($file, \"r\")\n or die(\"Couldn't open xml file\\n\");\n $index = 0;\n while (($line = fgets($fp)) && ($index = $index + 1)) { // $i++ ?!\n // commit 100 by 100\n if ($index % 100 == 0) {\n store($sxml);\n unset($sxml);\n }\n $sxml[] = simplexml_load_string(utf8_encode($line));\n }\n store($sxml);\n unset($sxml);\n printf(\"Done: read %d lines: \", $index);\n fclose($fp)\n or die(\"Couldn't close file\");\n }", "function setXML($result) {\n\t\t$this->debug('<h2>setXML ScrapeCore</h2>');\n\t\t$uri = strtolower($this->map).\"/\".strtolower($this->region);\n\n $A_contentTag = array('Enem', 'Prouni', 'Vestibular');\n\n\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<DirectoryFeed>\n\t<WEBSITE>\n\t\t<WEBSITE_NAME><![CDATA['.$this->siteUmbrellaName.']]></WEBSITE_NAME>\n\t\t<PORTAL_KEY><![CDATA[59600]]></PORTAL_KEY>\n\t\t<URLS>\n\t\t\t<URL><![CDATA['.$this->siteURL.']]></URL>\n\t\t</URLS>\n\t\t<PAGES>'.PHP_EOL;\n $i = 0;\n\t\tforeach($result as $row) {\n if ($i > 2) $i = 0;\n\t\t\t$this->debug($row['TB_MATERIA_ID']);\n $this->debug('<h1>file_name: '.$row['file_name'].'</h1>');\n //$this->debug($this->stripAccents(\"inscições\"));\n $fileName = $row['file_name'];\n $fileName = $this->stripAccents($fileName);\n //$fileName = $this->cleanForShortURL(utf8_decode($fileName));\n\t\t\t$fileName = $this->removeSpecialCharacters($fileName);\n\t\t\t$fileName = $this->removeExtraDashes($fileName);\n\t\t\t$fileName = preg_replace('/^-/', '', $fileName);\n\t\t\t$fileName = preg_replace('/-$/', '', $fileName);\n $fileName = preg_replace('/\\./', '', $fileName);\n\t\t\t$fileName .= \".html\";\n $this->debug(\"<h1>fileName: $fileName</h1>\");\n\n\t\t\t$old_uri = $this->oldPath . strtolower($this->map) . '_ler.php?id=' . $row['TB_MATERIA_ID'];\n\n\n if (strlen($row['article_body']) > 6) {\n $temp_body = $row['article_body'];\n $temp_body = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\"), \"\", $temp_body);\n $temp_body = nl2br($temp_body);\n $temp_body = strip_tags($temp_body);\n //$temp_body = $this->convertHTML2Text($temp_body, \"text\");\n //$temp_body = $this->stripAccents($body);\n $temp_body = $this->msword_conversion($temp_body);\n\n $metaDesc = $this->TruncateString($temp_body, 150);\n //$leader = nl2br($body);\n //$leader = strip_tags($leader);\n $leader = $this->TruncateString($temp_body, 100);\n\n\n $article_body = $this->msword_conversion($row['article_body']);\n //$article_body = $this->convertHTML2Text($article_body, \"text\");\n } else {\n $article_body = '&nbsp;';\n $metaDesc = '&nbsp;';\n $leader = '&nbsp;';\n }\n $this->debug(\"<h2>leader: $leader</h2>\");\n\n\n /*\n\t\t\t$body = strip_tags($row['article_body']);\n\t\t\t$body = $this->stripAccents($body);\n\n\t\t\t$article_body = $this->msword_conversion($row['article_body']);\n $article_body = $this->convertHTML2Text($article_body, \"text\");\n\n\t\t\t$metaDesc = $this->TruncateString($body, 150);\n */\n\t\t\t//$metaKey = $this->getMetaKeyword($this->region);\n $metaKey = utf8_decode($this->getMetaKeyword($this->region));\n\n\t\t\t$isPos = false;\n\t\t\t$isPos = $this->isPos($row['TB_MATERIA_ID']);\n\t\t\tif ($isPos === true) {\n\t\t\t\t$qualification = \"GRADUATE\";\n\t\t\t} else {\n\t\t\t\t$qualification = \"UNDERGRADUATE\";\n\t\t\t}\n\n $contentTag = $A_contentTag[$i];\n $i++;\n\n\n\n\t\t\t$xml .= \"\\t\\t\\t<PAGE>\n\t\t\t\t<PAGE_NAME><![CDATA[$fileName]]></PAGE_NAME>\n\t\t\t\t<DIRECTORIES>\n\t\t\t\t\t<DIRECTORY\n\t\t\t\t\t\tDIR_DEFAULT_FLAG='N'\n\t\t\t\t\t\tURI_TYPE='Primary'\n\t\t\t\t\t\tURI='/$uri'\n\t\t\t\t\t\tDISPLAY_NAME='\".$this->region.\"' />\n\t\t\t\t</DIRECTORIES>\n\t\t\t\t<ALTERNATE_PAGE_URIS>\n\t\t\t\t\t<URI URI_TYPE='301 Redirect' URI='$old_uri'/>\n\t\t\t\t</ALTERNATE_PAGE_URIS>\".PHP_EOL;\n\n\n\t\t\t$xml .= \"\\t\\t\\t\\t<ARTICLE Priority='1'>\n\t\t\t\t\t<ARTICLE_TYPE><![CDATA[Standard Article]]></ARTICLE_TYPE>\n\t\t\t\t\t<POSTING_DATE><![CDATA[\".$row['DATA_PUBLICACAO'].\"]]></POSTING_DATE>\".PHP_EOL;\n\t\t\t$xml .= \"\\t\\t\\t\\t\\t<TITLE><![CDATA[\".$row['title'].\"]]></TITLE>\n <LEADER><![CDATA[$leader]]></LEADER>\n\t\t\t\t\t<FILE_NAME><![CDATA[$fileName]]></FILE_NAME>\n\t\t\t\t\t<META_TITLE><![CDATA[\".$row['title'].\" | $this->siteName]]></META_TITLE>\n\t\t\t\t\t<META_KEYWORD><![CDATA[\".$metaKey.\"]]></META_KEYWORD>\n\t\t\t\t\t<META_DESC><![CDATA[\".$metaDesc.\"]]></META_DESC>\n\t\t\t\t\t<SEARCH_ENGINE_META_TAG><![CDATA[INDEX,FOLLOW]]></SEARCH_ENGINE_META_TAG>\".PHP_EOL;\n\n $xml .= \"\\t\\t\\t\\t\\t<LINK_TEXT><![CDATA[\".$row['title'].\"]]></LINK_TEXT>\".PHP_EOL;\n\n\t\t\t$xml .= \"\\t\\t\\t\\t\\t<INHERIT_FLAG><![CDATA[Y]]></INHERIT_FLAG>\".PHP_EOL;\n\n\t\t\t$xml .= \"\\t\\t\\t\\t\\t<BODY><![CDATA[$article_body]]></BODY>\".PHP_EOL;\n\n\n\n\n\t\t\t/* --- taxonomy --- */\n\n\t\t\t$xml .= \"\\t\\t\\t\\t\\t<SERVICES>\n\t\t\t\t\t <SERVICE PRIMARY='1'><![CDATA[GENERAL_AUDIENCE_EVERYONE]]></SERVICE>\n\t\t\t\t\t <SERVICE><![CDATA[UNIVERSITY_COLLEGE]]></SERVICE>\n </SERVICES>\".PHP_EOL;\n\n $xml .= \"\\t\\t\\t\\t\\t<SUBJECTS>\n <SUBJECT PRIMARY='1'>\n <![CDATA[SUBJECT]]>\n </SUBJECT>\n\t\t\t\t\t</SUBJECTS>\".PHP_EOL;\n\n\t\t\t$xml .= \"\\t\\t\\t\\t\\t<QUALIFICATIONS>\n\t\t\t\t\t\t<QUALIFICATION PRIMARY='1'>\n\t\t\t\t\t\t\t<![CDATA[$qualification]]>\n\t\t\t\t\t\t</QUALIFICATION>\n\t\t\t\t\t</QUALIFICATIONS>\".PHP_EOL;\n\n $xml .= \"\\t\\t\\t\\t\\t<GEOGRAPHIES>\n\t\t\t\t\t\t<GEO\n\t\t\t\t\t\t\tCOUNTRY='BR'\n STATE='$this->stateInitials'\n\t\t\t\t\t\t\tPRIMARY='1'/>\n\t\t\t\t\t</GEOGRAPHIES>\".PHP_EOL;\n\n /* tags for related articles */\n /* use enem for testing ONLY!!! */\n $xml .= \"\\t\\t\\t\\t\\t<CONTENT_TAGS>\n <TAG>\n <TAG_NAME><![CDATA[$contentTag]]></TAG_NAME>\n <CATEGORY><![CDATA[Education]]></CATEGORY>\n </TAG>\n </CONTENT_TAGS>\".PHP_EOL;\n\n\n\n\n\t\t\t/* --- photo --- */\n $T_photo = array();\n\t\t\t$A_photo = array();\n $T_photo = $this->getPhoto($row['TB_MATERIA_ID']);\n //$T_photo = $this->getPhoto(2558);\n $isPhoto = count($T_photo) > 0 ? true : false;\n\t\t\tif ($isPhoto) {\n\t\t\t\t$this->debug('<h2>isPhoto</h2>');\n\t\t\t\t$A_photo = $T_photo[0];\n\t\t\t\t$alt = $A_photo['LEGENDA'] != '' ? $A_photo['LEGENDA'] : $A_photo['TITULO'];\n\n $xml .= \"\\t\\t\\t\\t\\t<IMAGES>\".PHP_EOL;\n if ($A_photo['FOTO_PEQUENA'] != '') {\n $xml .= \"\\t\\t\\t\\t\\t\\t<IMAGE>\n\t\t\t\t\t\t\t<PATH><![CDATA[\".$A_photo['FOTO_PEQUENA'].\"]]></PATH>\n\t\t\t\t\t\t\t<ALT><![CDATA[$alt]]></ALT>\n\t\t\t\t\t\t\t<IMAGE_TYPE><![CDATA[Thumbnail]]></IMAGE_TYPE>\n\t\t\t\t\t\t\t<IS_REMOTE_IMAGE><![CDATA[N]]></IS_REMOTE_IMAGE>\n </IMAGE>\".PHP_EOL;\n }\n\n if ($A_photo['FOTO_MEDIA'] != '') {\n $xml .= \"\\t\\t\\t\\t\\t<IMAGE>\n\t\t\t\t\t\t\t<PATH><![CDATA[\".$A_photo['FOTO_MEDIA'].\"]]></PATH>\n\t\t\t\t\t\t\t<ALT><![CDATA[$alt]]></ALT>\n\t\t\t\t\t\t\t<IMAGE_TYPE><![CDATA[Feature]]></IMAGE_TYPE>\n\t\t\t\t\t\t\t<IS_REMOTE_IMAGE><![CDATA[N]]></IS_REMOTE_IMAGE>\n\t\t\t\t\t\t</IMAGE>\".PHP_EOL;\n }\n\n if ($A_photo['FOTO_GRANDE'] != '') {\n $xml .= \"\\t\\t\\t\\t\\t\\t<IMAGE>\n\t\t\t\t\t\t\t<PATH><![CDATA[\".$A_photo['FOTO_GRANDE'].\"]]></PATH>\n\t\t\t\t\t\t\t<ALT><![CDATA[$alt]]></ALT>\n\t\t\t\t\t\t\t<IMAGE_TYPE><![CDATA[Portrait]]></IMAGE_TYPE>\n\t\t\t\t\t\t\t<IS_REMOTE_IMAGE><![CDATA[N]]></IS_REMOTE_IMAGE>\n\t\t\t\t\t\t</IMAGE>\".PHP_EOL;\n }\n\t\t\t\t$xml .= \"\\t\\t\\t\\t\\t</IMAGES>\".PHP_EOL;\n }\n\n\t\t\t$xml .= \"\\t\\t\\t\\t</ARTICLE>\n\t\t\t</PAGE>\".PHP_EOL;\n\t\t}\n\n\t\t$xml .= \"\\t\\t</PAGES>\n\t</WEBSITE>\n</DirectoryFeed>\";\n\t\treturn $xml;\n\t}", "private function loadXmlFilesToExcel()\n {\n $path = $this->getTempDirPath() . DIRECTORY_SEPARATOR; \n foreach (glob($path.\"*.xml\") as $fileName) {\n $this->readXmlAndAppendToExcel($fileName);\n }\n }", "abstract protected function parseFile(DOMDocument $xml);", "function process_files($dummy_run = FALSE) {\n $input_dir = __DIR__ .'/input';\n $output_dir = array(__DIR__ . '/output');\n $archive_dir = __DIR__ . '/archive';\n\n // Open input directory.\n if ($handle = opendir($input_dir)) {\n\n // Loop over the input directory.\n while (false !== ($file = readdir($handle))) {\n $file_path_info = pathinfo($file);\n\n // Only process .xml files.\n if ($file_path_info['extension'] == 'xml' ) {\n\n $page_file_path = join('/', array($input_dir, $file));\n\n $user_page = new UserPage($page_file_path);\n\n // If SiteConfidence does not exist, jump to next file.\n if (!$user_page->hasSiteConfidence()) {\n print_r('Missing SiteConfidence in file : ' . $page_file_path);\n continue;\n }\n\n // @Todo - This is just for display purpose, so comment out or delete.\n print_r($user_page->getAccountId());\n print_r($user_page->getResponse());\n print_r($user_page->getAccount());\n\n // Create user object.\n $user = new User();\n $pages = array();\n\n // Get each element data.\n $user->setAccountId($user_page->getAccountId());\n $user->setResponse($user_page->getResponse());\n $user->setAccount($user_page->getAccount());\n $nitfDOM = $user->getNitfDOM();\n $nitfString = $nitfDOM->saveXML();\n\n // Validate final outut before writing to file.\n // if (!$nitfDOM->validate()) {\n // var_dump('ERROR: Validation failed in : ' . $contentsPage->page_file);\n // }\n\n // Get file name.\n $filename = $user->getFilename();\n\n // If arrgument passed 'dummy', then dont write/archive files.\n if ($dummy_run) {\n var_dump('Dummy Run: processed : ' . $filename);\n }\n else {\n // Write file.\n write_file($output_dir, $filename, $nitfString);\n // Archive processed input files.\n archive_files($input_dir, $archive_dir, $page_file_path);\n }\n }\n }\n closedir($handle);\n }\n}", "function parse($xmlFile)\n {\n $this->parser = xml_parser_create();\n xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);\n\n \n\n xml_set_character_data_handler($this->parser, array($this, \"saxText\"));\n xml_set_element_handler($this->parser, array($this, \"saxOpen\"), array($this, \"saxClose\"));\n\n\n $fp = fopen($xmlFile, \"r\");\n // file bigger than 10Mb send an error \n while($xml = fread($fp, 1024*1024*5))\n {\n $this->bytes += strlen($xml);\n if (!xml_parse($this->parser, $xml, feof($fp)))\n {\n echo sprintf(\n \"Erreur XML: %s , ligne %d\",\n xml_error_string(xml_get_error_code($this->parser)),\n xml_get_current_line_number($this->parser)\n );\n }\n }\n\n $this->docs++;\n xml_parser_free($this->parser);\n }", "public function gerar_xml()\r\n {\r\n\r\n require_once(\"includes/rotinas_gerais.inc.php\");\r\n require_once(\"includes/tabelas_ibge.fnc.php\");\r\n require_once(\"includes/inverte_data_amd_to_dma.fnc.php\");\r\n require_once(\"includes/inverte_data_dma_to_amd.fnc.php\");\r\n require_once(\"includes/assinadorTEX.inc.php\");\r\n\r\n //****************************************\r\n //*** INICIO - Gera o XML para o Envio ***\r\n //****************************************\r\n\r\n //*** INICIO - Obtem o Numero do Conhecimento Eletronico ***\r\n\r\n $mgt_numero_cte = $this->mgt_cte_numero->Text;\r\n\r\n //*** Apaga os Arquivos ja gerados ***\r\n\r\n if(file_exists('nfe/entrada/CTe_' . trim($mgt_numero_cte) . '.xml'))\r\n {\r\n unlink('nfe/entrada/CTe_' . trim($mgt_numero_cte) . '.xml');\r\n }\r\n\r\n if(file_exists('nfe/saida/CTe_' . trim($mgt_numero_cte) . '_sign.xml'))\r\n {\r\n unlink('nfe/saida/CTe_' . trim($mgt_numero_cte) . '_sign.xml');\r\n }\r\n\r\n if(file_exists('nfe/entregar_cliente/CTe_' . trim($mgt_numero_cte) . '.xml'))\r\n {\r\n unlink('nfe/entregar_cliente/CTe_' . trim($mgt_numero_cte) . '.xml');\r\n }\r\n\r\n if(file_exists('nfe/importa_conhecimento/CTe_' . trim($mgt_numero_cte) . '.xml'))\r\n {\r\n unlink('nfe/importa_conhecimento/CTe_' . trim($mgt_numero_cte) . '.xml');\r\n }\r\n\r\n //*** FINAL - Obtem o Numero do Conhecimento Eletronico ***\r\n\r\n //Declaracao de Variaveis\r\n $tipo_ambiente = $_SESSION['login_nfe_ambiente'];// 1 - Producao || 2 - Homologacao\r\n $cnpj_padrao = completa_zeros_retira_caracter($_SESSION['login_cnpj'], 14);\r\n $serie_cte = $_SESSION['login_nfe_serie'];// Serie da Nota Fiscal\r\n\r\n //*** versao do encoding xml ***\r\n $geraDom = new DOMDocument('1.0', 'UTF-8');\r\n\r\n //*** retirar os espacos em branco ***\r\n $geraDom->preserveWhiteSpace = false;\r\n\r\n //*** gerar o codigo ***\r\n $geraDom->formatOutput = false;// Se True Prevalece a Formatacao com Estrutura (Pulando Linha e Espacos).\r\n\r\n //*** criando o no principal (Raiz) ***\r\n //*** Cabeca do XML ***\r\n\r\n $ct000 = $geraDom->createElement('CTe');\r\n $ct000->setAttribute('xmlns', 'http://www.portalfiscal.inf.br/cte');\r\n\r\n //*** Dados do Conhecimento para o XML ***\r\n\r\n //*** INICIO - Geracao da Chave de Acesso ***\r\n\r\n $tipo_emissao = '1';\r\n $chave_acesso_nro = chave_acesso_cte('35', $cnpj_padrao, $mgt_numero_cte, $tipo_emissao, $serie_cte);\r\n $chave_acesso_nro = trim($chave_acesso_nro);\r\n\r\n $digito_chave_acesso_nro = substr($chave_acesso_nro, (strlen($chave_acesso_nro) - 1), 1);\r\n $digito_chave_acesso_nro = trim($digito_chave_acesso_nro);\r\n\r\n //*** FINAL - Geracao da Chave de Acesso ***\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct001 = $geraDom->createElement('infCte');\r\n $ct001->setAttribute('versao', '2.00');\r\n $ct001->setAttribute('Id', 'CTe' . $chave_acesso_nro);\r\n\r\n $ct004 = $geraDom->createElement('ide');\r\n $ct005 = $geraDom->createElement('cUF', '35');\r\n $ct006 = $geraDom->createElement('cCT', codigo_numerico($mgt_numero_cte));\r\n $ct007 = $geraDom->createElement('CFOP', retira_acentos(strtoupper($this->mgt_cte_cfop->Text), 0));\r\n $ct008 = $geraDom->createElement('natOp', retira_acentos(strtoupper($this->mgt_cte_natureza_operacao->Text), 0));\r\n\r\n $ct009 = $geraDom->createElement('forPag', retira_acentos(strtoupper($this->mgt_cte_forma_pagto->ItemIndex), 0));\r\n $ct010 = $geraDom->createElement('mod', retira_acentos(strtoupper($this->mgt_cte_modelo->Text), 0));\r\n $ct011 = $geraDom->createElement('serie', retira_acentos(strtoupper($this->mgt_cte_serie->Text), 0));\r\n $ct012 = $geraDom->createElement('nCT', retira_acentos(strtoupper($this->mgt_cte_numero->Text), 0));\r\n $ct013 = $geraDom->createElement('dhEmi', trim(date(\"Y-m-d\", time())) . 'T' . trim(date(\"H:i:s\", time())));\r\n $ct014 = $geraDom->createElement('tpImp', '1');\r\n $ct015 = $geraDom->createElement('tpEmis', '1');\r\n $ct016 = $geraDom->createElement('cDV', $digito_chave_acesso_nro);\r\n $ct017 = $geraDom->createElement('tpAmb', $tipo_ambiente);\r\n $ct018 = $geraDom->createElement('tpCTe', '0');\r\n $ct019 = $geraDom->createElement('procEmi', '0');\r\n $ct020 = $geraDom->createElement('verProc', 'MGTEXV2K77');\r\n $ct022 = $geraDom->createElement('cMunEnv', retira_acentos(strtoupper($_SESSION['login_cod_cidade']), 0));\r\n $ct023 = $geraDom->createElement('xMunEnv', retira_acentos(strtoupper($_SESSION['login_cidade']), 0));\r\n $ct024 = $geraDom->createElement('UFEnv', retira_acentos(strtoupper($_SESSION['login_estado']), 0));\r\n $ct025 = $geraDom->createElement('modal', '01');\r\n $ct026 = $geraDom->createElement('tpServ', '0');\r\n $ct027 = $geraDom->createElement('cMunIni', municipios_ibge($this->mgt_cte_origem_estado->ItemIndex, $this->mgt_cte_origem_cidade->Text));\r\n $ct028 = $geraDom->createElement('xMunIni', retira_acentos(strtoupper($this->mgt_cte_origem_cidade->Text), 60));\r\n $ct029 = $geraDom->createElement('UFIni', retira_acentos(strtoupper($this->mgt_cte_origem_estado->ItemIndex), 0));\r\n $ct030 = $geraDom->createElement('cMunFim', municipios_ibge($this->mgt_cte_destino_estado->ItemIndex, $this->mgt_cte_destino_cidade->Text));\r\n $ct031 = $geraDom->createElement('xMunFim', retira_acentos(strtoupper($this->mgt_cte_destino_cidade->Text), 60));\r\n $ct032 = $geraDom->createElement('UFFim', retira_acentos(strtoupper($this->mgt_cte_destino_estado->ItemIndex), 0));\r\n $ct033 = $geraDom->createElement('retira', '1');\r\n\r\n $ct035 = $geraDom->createElement('toma03');\r\n $ct036 = $geraDom->createElement('toma', '3');\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct035->appendChild($ct036);\r\n\r\n $ct004->appendChild($ct005);\r\n $ct004->appendChild($ct006);\r\n $ct004->appendChild($ct007);\r\n $ct004->appendChild($ct008);\r\n $ct004->appendChild($ct009);\r\n $ct004->appendChild($ct010);\r\n $ct004->appendChild($ct011);\r\n $ct004->appendChild($ct012);\r\n $ct004->appendChild($ct013);\r\n $ct004->appendChild($ct014);\r\n $ct004->appendChild($ct015);\r\n $ct004->appendChild($ct016);\r\n $ct004->appendChild($ct017);\r\n $ct004->appendChild($ct018);\r\n $ct004->appendChild($ct019);\r\n $ct004->appendChild($ct020);\r\n $ct004->appendChild($ct022);\r\n $ct004->appendChild($ct023);\r\n $ct004->appendChild($ct024);\r\n $ct004->appendChild($ct025);\r\n $ct004->appendChild($ct026);\r\n $ct004->appendChild($ct027);\r\n $ct004->appendChild($ct028);\r\n $ct004->appendChild($ct029);\r\n $ct004->appendChild($ct030);\r\n $ct004->appendChild($ct031);\r\n $ct004->appendChild($ct032);\r\n $ct004->appendChild($ct033);\r\n $ct004->appendChild($ct035);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct059 = $geraDom->createElement('compl');\r\n $ct063 = $geraDom->createElement('fluxo', '');\r\n\r\n if(trim($this->mgt_cte_forma_pagto->ItemIndex) == '1')\r\n {\r\n $this->mgt_cte_observacao->Text = trim($this->mgt_cte_observacao->Text) . \" // DUPLICATA: \" . trim($this->mgt_cte_numero->Text) . \" - VENCIMENTO: \" . trim($this->mgt_cte_data_receber->Text) . \" - VALOR: R$ \" . trim(number_format($this->mgt_cte_servico_valor_receber->Text, 2, '.', ''));\r\n }\r\n\r\n $this->mgt_cte_observacao->Text = trim($this->mgt_cte_observacao->Text);\r\n\r\n if(trim($this->mgt_cte_observacao->Text) <> '')\r\n {\r\n $ct090 = $geraDom->createElement('xObs', retira_acentos(strtoupper($this->mgt_cte_observacao->Text), 2000));\r\n }\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct059->appendChild($ct063);\r\n\r\n if(trim($this->mgt_cte_observacao->Text) <> '')\r\n {\r\n $ct059->appendChild($ct090);\r\n }\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct097 = $geraDom->createElement('emit');\r\n $ct098 = $geraDom->createElement('CNPJ', $cnpj_padrao);\r\n $ct099 = $geraDom->createElement('IE', retira_acentos_ponto_traco_barra(strtoupper($_SESSION['login_ie']), 0));\r\n $ct100 = $geraDom->createElement('xNome', retira_acentos(strtoupper($_SESSION['login_razao']), 0));\r\n $ct101 = $geraDom->createElement('xFant', retira_acentos(strtoupper($_SESSION['login_empresa']), 0));\r\n\r\n $ct102 = $geraDom->createElement('enderEmit');\r\n $ct103 = $geraDom->createElement('xLgr', retira_acentos(strtoupper($_SESSION['login_endereco']), 0));\r\n $ct104 = $geraDom->createElement('nro', retira_acentos(strtoupper($_SESSION['login_nro']), 0));\r\n\r\n if(trim($_SESSION['hd_login_complemento']) <> '')\r\n {\r\n $ct105 = $geraDom->createElement('xCpl', retira_acentos(strtoupper($_SESSION['hd_login_complemento']), 0));\r\n }\r\n\r\n $ct106 = $geraDom->createElement('xBairro', retira_acentos(strtoupper($_SESSION['login_bairro']), 0));\r\n $ct107 = $geraDom->createElement('cMun', retira_acentos(strtoupper($_SESSION['login_cod_cidade']), 0));\r\n $ct108 = $geraDom->createElement('xMun', retira_acentos(strtoupper($_SESSION['login_cidade']), 0));\r\n $ct109 = $geraDom->createElement('CEP', retira_acentos_ponto_traco_barra(strtoupper($_SESSION['login_cep']), 0));\r\n $ct110 = $geraDom->createElement('UF', retira_acentos(strtoupper($_SESSION['login_estado']), 0));\r\n $ct111 = $geraDom->createElement('fone', retira_acentos_ponto_traco_barra(strtoupper($_SESSION['login_fone']), 0));\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct102->appendChild($ct103);\r\n $ct102->appendChild($ct104);\r\n\r\n if(trim($_SESSION['hd_login_complemento']) <> '')\r\n {\r\n $ct102->appendChild($ct105);\r\n }\r\n\r\n $ct102->appendChild($ct106);\r\n $ct102->appendChild($ct107);\r\n $ct102->appendChild($ct108);\r\n $ct102->appendChild($ct109);\r\n $ct102->appendChild($ct110);\r\n $ct102->appendChild($ct111);\r\n\r\n $ct097->appendChild($ct098);\r\n $ct097->appendChild($ct099);\r\n $ct097->appendChild($ct100);\r\n $ct097->appendChild($ct101);\r\n $ct097->appendChild($ct102);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct112 = $geraDom->createElement('rem');\r\n\r\n if(strlen(retira_acentos_ponto_traco_barra(trim($this->mgt_cte_remetente_codigo->Text), 0)) < 14)\r\n {\r\n $ct113 = $geraDom->createElement('CPF', completa_zeros_retira_caracter($this->mgt_cte_remetente_codigo->Text, 11));\r\n }\r\n else\r\n {\r\n $ct113 = $geraDom->createElement('CNPJ', completa_zeros_retira_caracter($this->mgt_cte_remetente_codigo->Text, 14));\r\n }\r\n\r\n $ct115 = $geraDom->createElement('IE', retira_acentos_ponto_traco_barra($this->mgt_cte_remetente_inscricao_estadual->Text, 0));\r\n $ct116 = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_remetente_razao_social->Text), 0));\r\n $ct118 = $geraDom->createElement('fone', retira_acentos_ponto_traco_barra(strtoupper($this->mgt_cte_remetente_fone->Text), 0));\r\n\r\n $ct119 = $geraDom->createElement('enderReme');\r\n $ct120 = $geraDom->createElement('xLgr', retira_acentos(strtoupper($this->mgt_cte_remetente_endereco->Text), 0));\r\n $ct121 = $geraDom->createElement('nro', retira_acentos(strtoupper($this->mgt_cte_remetente_endereco->Text), 0));\r\n $ct123 = $geraDom->createElement('xBairro', retira_acentos(strtoupper($this->mgt_cte_remetente_bairro->Text), 0));\r\n $ct124 = $geraDom->createElement('cMun', municipios_ibge($this->mgt_cte_remetente_estado->Text, $this->mgt_cte_remetente_cidade->Text));\r\n $ct125 = $geraDom->createElement('xMun', retira_acentos(strtoupper($this->mgt_cte_remetente_cidade->Text), 0));\r\n $ct126 = $geraDom->createElement('CEP', retira_acentos_ponto_traco_barra(strtoupper($this->mgt_cte_remetente_cep->Text), 0));\r\n $ct127 = $geraDom->createElement('UF', retira_acentos(strtoupper($this->mgt_cte_remetente_estado->Text), 0));\r\n $ct128 = $geraDom->createElement('cPais', paises_ibge($this->mgt_cte_remetente_pais->Text));\r\n $ct129 = $geraDom->createElement('xPais', retira_acentos(strtoupper($this->mgt_cte_remetente_pais->Text), 0));\r\n\r\n $ct119->appendChild($ct120);\r\n $ct119->appendChild($ct121);\r\n $ct119->appendChild($ct123);\r\n $ct119->appendChild($ct124);\r\n $ct119->appendChild($ct125);\r\n $ct119->appendChild($ct126);\r\n $ct119->appendChild($ct127);\r\n $ct119->appendChild($ct128);\r\n $ct119->appendChild($ct129);\r\n\r\n $ct112->appendChild($ct113);\r\n $ct112->appendChild($ct115);\r\n $ct112->appendChild($ct116);\r\n $ct112->appendChild($ct118);\r\n $ct112->appendChild($ct119);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct203 = $geraDom->createElement('dest');\r\n\r\n if(strlen(retira_acentos_ponto_traco_barra(trim($this->mgt_cte_destinatario_codigo->Text), 0)) < 14)\r\n {\r\n $ct204 = $geraDom->createElement('CPF', completa_zeros_retira_caracter($this->mgt_cte_destinatario_codigo->Text, 11));\r\n }\r\n else\r\n {\r\n $ct204 = $geraDom->createElement('CNPJ', completa_zeros_retira_caracter($this->mgt_cte_destinatario_codigo->Text, 14));\r\n }\r\n\r\n $ct206 = $geraDom->createElement('IE', retira_acentos_ponto_traco_barra($this->mgt_cte_destinatario_inscricao_estadual->Text, 0));\r\n $ct207 = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_destinatario_razao_social->Text), 0));\r\n $ct208 = $geraDom->createElement('fone', retira_acentos_ponto_traco_barra(strtoupper($this->mgt_cte_destinatario_fone->Text), 0));\r\n\r\n $ct210 = $geraDom->createElement('enderDest');\r\n $ct211 = $geraDom->createElement('xLgr', retira_acentos(strtoupper($this->mgt_cte_destinatario_endereco->Text), 0));\r\n $ct212 = $geraDom->createElement('nro', retira_acentos(strtoupper($this->mgt_cte_destinatario_endereco->Text), 0));\r\n $ct214 = $geraDom->createElement('xBairro', retira_acentos(strtoupper($this->mgt_cte_destinatario_bairro->Text), 0));\r\n $ct215 = $geraDom->createElement('cMun', municipios_ibge($this->mgt_cte_destinatario_estado->Text, $this->mgt_cte_destinatario_cidade->Text));\r\n $ct216 = $geraDom->createElement('xMun', retira_acentos(strtoupper($this->mgt_cte_destinatario_cidade->Text), 0));\r\n $ct217 = $geraDom->createElement('CEP', retira_acentos_ponto_traco_barra(strtoupper($this->mgt_cte_destinatario_cep->Text), 0));\r\n $ct218 = $geraDom->createElement('UF', retira_acentos(strtoupper($this->mgt_cte_destinatario_estado->Text), 0));\r\n $ct219 = $geraDom->createElement('cPais', paises_ibge($this->mgt_cte_destinatario_pais->Text));\r\n $ct220 = $geraDom->createElement('xPais', retira_acentos(strtoupper($this->mgt_cte_destinatario_pais->Text), 0));\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct210->appendChild($ct211);\r\n $ct210->appendChild($ct212);\r\n $ct210->appendChild($ct214);\r\n $ct210->appendChild($ct215);\r\n $ct210->appendChild($ct216);\r\n $ct210->appendChild($ct217);\r\n $ct210->appendChild($ct218);\r\n $ct210->appendChild($ct219);\r\n $ct210->appendChild($ct220);\r\n\r\n $ct203->appendChild($ct204);\r\n $ct203->appendChild($ct206);\r\n $ct203->appendChild($ct207);\r\n $ct203->appendChild($ct208);\r\n $ct203->appendChild($ct210);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct233 = $geraDom->createElement('vPrest');\r\n $ct234 = $geraDom->createElement('vTPrest', number_format($this->mgt_cte_servico_valor_total->Text, 2, '.', ''));\r\n $ct235 = $geraDom->createElement('vRec', number_format($this->mgt_cte_servico_valor_receber->Text, 2, '.', ''));\r\n\r\n if(trim($this->mgt_cte_servico_1->Text) <> '')\r\n {\r\n $ct236a = $geraDom->createElement('Comp');\r\n $ct237a = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_1->Text), 0));\r\n $ct238a = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_1->Text, 2, '.', ''));\r\n\r\n $ct236a->appendChild($ct237a);\r\n $ct236a->appendChild($ct238a);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_2->Text) <> '')\r\n {\r\n $ct236b = $geraDom->createElement('Comp');\r\n $ct237b = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_2->Text), 0));\r\n $ct238b = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_2->Text, 2, '.', ''));\r\n\r\n $ct236b->appendChild($ct237b);\r\n $ct236b->appendChild($ct238b);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_3->Text) <> '')\r\n {\r\n $ct236c = $geraDom->createElement('Comp');\r\n $ct237c = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_3->Text), 0));\r\n $ct238c = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_3->Text, 2, '.', ''));\r\n\r\n $ct236c->appendChild($ct237c);\r\n $ct236c->appendChild($ct238c);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_4->Text) <> '')\r\n {\r\n $ct236d = $geraDom->createElement('Comp');\r\n $ct237d = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_4->Text), 0));\r\n $ct238d = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_4->Text, 2, '.', ''));\r\n\r\n $ct236d->appendChild($ct237d);\r\n $ct236d->appendChild($ct238d);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_5->Text) <> '')\r\n {\r\n $ct236e = $geraDom->createElement('Comp');\r\n $ct237e = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_5->Text), 0));\r\n $ct238e = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_5->Text, 2, '.', ''));\r\n\r\n $ct236e->appendChild($ct237e);\r\n $ct236e->appendChild($ct238e);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_6->Text) <> '')\r\n {\r\n $ct236f = $geraDom->createElement('Comp');\r\n $ct237f = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_6->Text), 0));\r\n $ct238f = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_6->Text, 2, '.', ''));\r\n\r\n $ct236f->appendChild($ct237f);\r\n $ct236f->appendChild($ct238f);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_7->Text) <> '')\r\n {\r\n $ct236g = $geraDom->createElement('Comp');\r\n $ct237g = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_7->Text), 0));\r\n $ct238g = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_7->Text, 2, '.', ''));\r\n\r\n $ct236g->appendChild($ct237g);\r\n $ct236g->appendChild($ct238g);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_8->Text) <> '')\r\n {\r\n $ct236h = $geraDom->createElement('Comp');\r\n $ct237h = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_8->Text), 0));\r\n $ct238h = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_8->Text, 2, '.', ''));\r\n\r\n $ct236h->appendChild($ct237h);\r\n $ct236h->appendChild($ct238h);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_9->Text) <> '')\r\n {\r\n $ct236i = $geraDom->createElement('Comp');\r\n $ct237i = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_9->Text), 0));\r\n $ct238i = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_9->Text, 2, '.', ''));\r\n\r\n $ct236i->appendChild($ct237i);\r\n $ct236i->appendChild($ct238i);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_10->Text) <> '')\r\n {\r\n $ct236j = $geraDom->createElement('Comp');\r\n $ct237j = $geraDom->createElement('xNome', retira_acentos(strtoupper($this->mgt_cte_servico_10->Text), 0));\r\n $ct238j = $geraDom->createElement('vComp', number_format($this->mgt_cte_servico_valor_10->Text, 2, '.', ''));\r\n\r\n $ct236j->appendChild($ct237j);\r\n $ct236j->appendChild($ct238j);\r\n }\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct233->appendChild($ct234);\r\n $ct233->appendChild($ct235);\r\n\r\n if(trim($this->mgt_cte_servico_1->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236a);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_2->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236b);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_3->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236c);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_4->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236d);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_5->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236e);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_6->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236f);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_7->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236g);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_8->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236h);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_9->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236i);\r\n }\r\n\r\n if(trim($this->mgt_cte_servico_10->Text) <> '')\r\n {\r\n $ct233->appendChild($ct236j);\r\n }\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct239 = $geraDom->createElement('imp');\r\n $ct240 = $geraDom->createElement('ICMS');\r\n\r\n //*** Gravando os Nos ***\r\n\r\n if(trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '00')\r\n {\r\n $ct241 = $geraDom->createElement('ICMS00');\r\n $ct242 = $geraDom->createElement('CST', trim($this->mgt_cte_situacao_tributaria->ItemIndex));\r\n $ct243 = $geraDom->createElement('vBC', number_format($this->mgt_cte_valor_bc_icms->Text, 2, '.', ''));\r\n $ct244 = $geraDom->createElement('pICMS', number_format($this->mgt_cte_aliquota_icms->Text, 2, '.', ''));\r\n $ct245 = $geraDom->createElement('vICMS', number_format($this->mgt_cte_valor_icms->Text, 2, '.', ''));\r\n\r\n $ct241->appendChild($ct242);\r\n $ct241->appendChild($ct243);\r\n $ct241->appendChild($ct244);\r\n $ct241->appendChild($ct245);\r\n\r\n $ct240->appendChild($ct241);\r\n $ct239->appendChild($ct240);\r\n }\r\n elseif(trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '20')\r\n {\r\n $ct246 = $geraDom->createElement('ICMS20');\r\n $ct247 = $geraDom->createElement('CST', trim($this->mgt_cte_situacao_tributaria->ItemIndex));\r\n $ct248 = $geraDom->createElement('pRedBC', number_format($this->mgt_cte_percentual_reducao_bc->Text, 2, '.', ''));\r\n $ct249 = $geraDom->createElement('vBC', number_format($this->mgt_cte_valor_bc_icms->Text, 2, '.', ''));\r\n $ct250 = $geraDom->createElement('pICMS', number_format($this->mgt_cte_aliquota_icms->Text, 2, '.', ''));\r\n $ct251 = $geraDom->createElement('vICMS', number_format($this->mgt_cte_valor_icms->Text, 2, '.', ''));\r\n\r\n $ct246->appendChild($ct247);\r\n $ct246->appendChild($ct248);\r\n $ct246->appendChild($ct249);\r\n $ct246->appendChild($ct250);\r\n $ct246->appendChild($ct251);\r\n\r\n $ct240->appendChild($ct246);\r\n $ct239->appendChild($ct240);\r\n }\r\n elseif(((trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '40') or (trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '41') or (trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '51')))\r\n {\r\n $ct252 = $geraDom->createElement('ICMS45');\r\n $ct253 = $geraDom->createElement('CST', trim($this->mgt_cte_situacao_tributaria->ItemIndex));\r\n\r\n $ct252->appendChild($ct253);\r\n\r\n $ct240->appendChild($ct252);\r\n $ct239->appendChild($ct240);\r\n }\r\n elseif(trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '60')\r\n {\r\n $ct254 = $geraDom->createElement('ICMS60');\r\n $ct255 = $geraDom->createElement('CST', trim($this->mgt_cte_situacao_tributaria->ItemIndex));\r\n $ct256 = $geraDom->createElement('vBCSTRet', number_format($this->mgt_cte_valor_bc_icms->Text, 2, '.', ''));\r\n $ct257 = $geraDom->createElement('vICMSSTRet', number_format($this->mgt_cte_valor_icms->Text, 2, '.', ''));\r\n $ct258 = $geraDom->createElement('pICMSSTRet', number_format($this->mgt_cte_aliquota_icms->Text, 2, '.', ''));\r\n $ct259 = $geraDom->createElement('vCred', number_format($this->mgt_cte_valor_outorgado->Text, 2, '.', ''));\r\n\r\n $ct254->appendChild($ct255);\r\n $ct254->appendChild($ct256);\r\n $ct254->appendChild($ct257);\r\n $ct254->appendChild($ct258);\r\n $ct254->appendChild($ct259);\r\n\r\n $ct240->appendChild($ct254);\r\n $ct239->appendChild($ct240);\r\n }\r\n elseif(trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '90')\r\n {\r\n $ct260 = $geraDom->createElement('ICMS90');\r\n $ct261 = $geraDom->createElement('CST', trim($this->mgt_cte_situacao_tributaria->ItemIndex));\r\n $ct262 = $geraDom->createElement('pRedBC', number_format($this->mgt_cte_percentual_reducao_bc->Text, 2, '.', ''));\r\n $ct263 = $geraDom->createElement('vBC', number_format($this->mgt_cte_valor_bc_icms->Text, 2, '.', ''));\r\n $ct264 = $geraDom->createElement('pICMS', number_format($this->mgt_cte_aliquota_icms->Text, 2, '.', ''));\r\n $ct265 = $geraDom->createElement('vICMS', number_format($this->mgt_cte_valor_icms->Text, 2, '.', ''));\r\n $ct266 = $geraDom->createElement('vCred', number_format($this->mgt_cte_valor_outorgado->Text, 2, '.', ''));\r\n\r\n $ct260->appendChild($ct261);\r\n $ct260->appendChild($ct262);\r\n $ct260->appendChild($ct263);\r\n $ct260->appendChild($ct264);\r\n $ct260->appendChild($ct265);\r\n $ct260->appendChild($ct266);\r\n\r\n $ct240->appendChild($ct260);\r\n $ct239->appendChild($ct240);\r\n }\r\n elseif(trim($this->mgt_cte_situacao_tributaria->ItemIndex) == '--')\r\n {\r\n $ct273 = $geraDom->createElement('ICMSSN');\r\n $ct274 = $geraDom->createElement('indSN', '1');\r\n $ct275 = $geraDom->createElement('infAdFisco', 'DOCUMENTO EMITIDO POR ME OU EPP OPTANTE PELO SIMPLES NACIONAL. NAO GERA DIREITO A CREDITO FISCAL DE ISS E IPI. PERMITE O APROVEITAMENTO DO CREDITO DE ICMS NOS TERMOS DO ART.23 DA LC 123.');\r\n\r\n $ct273->appendChild($ct274);\r\n $ct273->appendChild($ct275);\r\n\r\n $ct240->appendChild($ct273);\r\n $ct239->appendChild($ct240);\r\n }\r\n\r\n\t $ct250a = $geraDom->createElement('vTotTrib', number_format($this->mgt_cte_valor_icms->Text, 2, '.', ''));\r\n\t $ct239->appendChild($ct250a);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct276 = $geraDom->createElement('infCTeNorm');\r\n $ct277 = $geraDom->createElement('infCarga');\r\n $ct278 = $geraDom->createElement('vCarga', number_format($this->mgt_cte_produto_total_mercadoria->Text, 2, '.', ''));\r\n $ct279 = $geraDom->createElement('proPred', retira_acentos(strtoupper($this->mgt_cte_produto_predominante->Text), 0));\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_1->Text) <> '')\r\n {\r\n $ct281a = $geraDom->createElement('infQ');\r\n $ct282a = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_1->ItemIndex), 0));\r\n $ct283a = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_1->Items[$this->mgt_cte_produto_unidade_1->ItemIndex]), 0));\r\n $ct284a = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_1->Text, 4, '.', ''));\r\n\r\n $ct281a->appendChild($ct282a);\r\n $ct281a->appendChild($ct283a);\r\n $ct281a->appendChild($ct284a);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_2->Text) <> '')\r\n {\r\n $ct281b = $geraDom->createElement('infQ');\r\n $ct282b = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_2->ItemIndex), 0));\r\n $ct283b = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_2->Items[$this->mgt_cte_produto_unidade_2->ItemIndex]), 0));\r\n $ct284b = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_2->Text, 4, '.', ''));\r\n\r\n $ct281b->appendChild($ct282b);\r\n $ct281b->appendChild($ct283b);\r\n $ct281b->appendChild($ct284b);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_3->Text) <> '')\r\n {\r\n $ct281c = $geraDom->createElement('infQ');\r\n $ct282c = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_3->ItemIndex), 0));\r\n $ct283c = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_3->Items[$this->mgt_cte_produto_unidade_3->ItemIndex]), 0));\r\n $ct284c = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_3->Text, 4, '.', ''));\r\n\r\n $ct281c->appendChild($ct282c);\r\n $ct281c->appendChild($ct283c);\r\n $ct281c->appendChild($ct284c);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_4->Text) <> '')\r\n {\r\n $ct281d = $geraDom->createElement('infQ');\r\n $ct282d = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_4->ItemIndex), 0));\r\n $ct283d = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_4->Items[$this->mgt_cte_produto_unidade_4->ItemIndex]), 0));\r\n $ct284d = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_4->Text, 4, '.', ''));\r\n\r\n $ct281d->appendChild($ct282d);\r\n $ct281d->appendChild($ct283d);\r\n $ct281d->appendChild($ct284d);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_5->Text) <> '')\r\n {\r\n $ct281e = $geraDom->createElement('infQ');\r\n $ct282e = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_5->ItemIndex), 0));\r\n $ct283e = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_5->Items[$this->mgt_cte_produto_unidade_5->ItemIndex]), 0));\r\n $ct284e = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_5->Text, 4, '.', ''));\r\n\r\n $ct281e->appendChild($ct282e);\r\n $ct281e->appendChild($ct283e);\r\n $ct281e->appendChild($ct284e);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_6->Text) <> '')\r\n {\r\n $ct281f = $geraDom->createElement('infQ');\r\n $ct282f = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_6->ItemIndex), 0));\r\n $ct283f = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_6->Items[$this->mgt_cte_produto_unidade_6->ItemIndex]), 0));\r\n $ct284f = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_6->Text, 4, '.', ''));\r\n\r\n $ct281f->appendChild($ct282f);\r\n $ct281f->appendChild($ct283f);\r\n $ct281f->appendChild($ct284f);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_7->Text) <> '')\r\n {\r\n $ct281g = $geraDom->createElement('infQ');\r\n $ct282g = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_7->ItemIndex), 0));\r\n $ct283g = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_7->Items[$this->mgt_cte_produto_unidade_7->ItemIndex]), 0));\r\n $ct284g = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_7->Text, 4, '.', ''));\r\n\r\n $ct281g->appendChild($ct282g);\r\n $ct281g->appendChild($ct283g);\r\n $ct281g->appendChild($ct284g);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_8->Text) <> '')\r\n {\r\n $ct281h = $geraDom->createElement('infQ');\r\n $ct282h = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_8->ItemIndex), 0));\r\n $ct283h = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_8->Items[$this->mgt_cte_produto_unidade_8->ItemIndex]), 0));\r\n $ct284h = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_8->Text, 4, '.', ''));\r\n\r\n $ct281h->appendChild($ct282h);\r\n $ct281h->appendChild($ct283h);\r\n $ct281h->appendChild($ct284h);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_9->Text) <> '')\r\n {\r\n $ct281i = $geraDom->createElement('infQ');\r\n $ct282i = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_9->ItemIndex), 0));\r\n $ct283i = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_9->Items[$this->mgt_cte_produto_unidade_9->ItemIndex]), 0));\r\n $ct284i = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_9->Text, 4, '.', ''));\r\n\r\n $ct281i->appendChild($ct282i);\r\n $ct281i->appendChild($ct283i);\r\n $ct281i->appendChild($ct284i);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_10->Text) <> '')\r\n {\r\n $ct281j = $geraDom->createElement('infQ');\r\n $ct282j = $geraDom->createElement('cUnid', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_10->ItemIndex), 0));\r\n $ct283j = $geraDom->createElement('tpMed', retira_acentos(strtoupper($this->mgt_cte_produto_unidade_10->Items[$this->mgt_cte_produto_unidade_10->ItemIndex]), 0));\r\n $ct284j = $geraDom->createElement('qCarga', number_format($this->mgt_cte_produto_quantidade_10->Text, 4, '.', ''));\r\n\r\n $ct281j->appendChild($ct282j);\r\n $ct281j->appendChild($ct283j);\r\n $ct281j->appendChild($ct284j);\r\n }\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct277->appendChild($ct278);\r\n $ct277->appendChild($ct279);\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_1->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281a);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_2->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281b);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_3->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281c);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_4->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281d);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_5->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281e);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_6->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281f);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_7->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281g);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_8->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281h);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_9->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281i);\r\n }\r\n\r\n if(trim($this->mgt_cte_produto_quantidade_10->Text) <> '')\r\n {\r\n $ct277->appendChild($ct281j);\r\n }\r\n\r\n $ct276->appendChild($ct277);\r\n\r\n\t //*** Continuacao do XML ***\r\n\r\n\t $ct157 = $geraDom->createElement('infDoc');\r\n\r\n if(trim($this->mgt_cte_chave_1->Text) <> '')\r\n {\r\n $ct158a = $geraDom->createElement('infNFe');\r\n $ct159a = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_1->Text), 0));\r\n\r\n $ct158a->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_2->Text) <> '')\r\n {\r\n $ct158b = $geraDom->createElement('infNFe');\r\n $ct159b = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_2->Text), 0));\r\n\r\n $ct158b->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_3->Text) <> '')\r\n {\r\n $ct158c = $geraDom->createElement('infNFe');\r\n $ct159c = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_3->Text), 0));\r\n\r\n $ct158c->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_4->Text) <> '')\r\n {\r\n $ct158d = $geraDom->createElement('infNFe');\r\n $ct159d = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_4->Text), 0));\r\n\r\n $ct158d->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_5->Text) <> '')\r\n {\r\n $ct158e = $geraDom->createElement('infNFe');\r\n $ct159e = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_5->Text), 0));\r\n\r\n $ct158e->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_6->Text) <> '')\r\n {\r\n $ct158f = $geraDom->createElement('infNFe');\r\n $ct159f = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_6->Text), 0));\r\n\r\n $ct158f->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_7->Text) <> '')\r\n {\r\n $ct158g = $geraDom->createElement('infNFe');\r\n $ct159g = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_7->Text), 0));\r\n\r\n $ct158g->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_8->Text) <> '')\r\n {\r\n $ct158h = $geraDom->createElement('infNFe');\r\n $ct159h = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_8->Text), 0));\r\n\r\n $ct158h->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_9->Text) <> '')\r\n {\r\n $ct158i = $geraDom->createElement('infNFe');\r\n $ct159i = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_9->Text), 0));\r\n\r\n $ct158i->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_10->Text) <> '')\r\n {\r\n $ct158j = $geraDom->createElement('infNFe');\r\n $ct159j = $geraDom->createElement('chave', retira_acentos(strtoupper($this->mgt_cte_chave_10->Text), 0));\r\n\r\n $ct158j->appendChild($ct159a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_1->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158a);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_2->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158b);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_3->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158c);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_4->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158d);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_5->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158e);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_6->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158f);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_7->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158g);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_8->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158h);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_9->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158i);\r\n }\r\n\r\n if(trim($this->mgt_cte_chave_10->Text) <> '')\r\n {\r\n $ct157->appendChild($ct158j);\r\n }\r\n\r\n\t //*** Continuacao do XML ***\r\n\r\n $ct360 = $geraDom->createElement('seg');\r\n $ct361 = $geraDom->createElement('respSeg', retira_acentos(strtoupper($this->mgt_cte_seguro->ItemIndex), 0));\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct360->appendChild($ct361);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct312 = $geraDom->createElement('infModal');\r\n $ct312->setAttribute('versaoModal', '2.00');\r\n\r\n $ct314 = $geraDom->createElement('rodo');\r\n $ct314a = $geraDom->createElement('RNTRC', retira_acentos(strtoupper($this->mgt_cte_rntrc->Text), 0));\r\n $ct314b = $geraDom->createElement('dPrev', inverte_data_dma_to_amd(trim($this->mgt_cte_data_entrega->Text)));\r\n $ct314c = $geraDom->createElement('lota', retira_acentos(strtoupper($this->mgt_cte_lotacao->ItemIndex), 0));\r\n $ct314d = $geraDom->createElement('veic');\r\n $ct314e = $geraDom->createElement('RENAVAM', retira_acentos(strtoupper($this->mgt_cte_renavam->Text), 0));\r\n $ct314f = $geraDom->createElement('placa', retira_acentos(strtoupper($this->mgt_cte_placa->Text), 0));\r\n $ct314g = $geraDom->createElement('tara', retira_acentos(strtoupper($this->mgt_cte_tara->Text), 0));\r\n $ct314h = $geraDom->createElement('capKG', retira_acentos(strtoupper($this->mgt_cte_capkg->Text), 0));\r\n $ct314i = $geraDom->createElement('capM3', retira_acentos(strtoupper($this->mgt_cte_capm3->Text), 0));\r\n $ct314j = $geraDom->createElement('tpProp', retira_acentos(strtoupper($this->mgt_cte_tpprop->ItemIndex), 0));\r\n $ct314k = $geraDom->createElement('tpVeic', retira_acentos(strtoupper($this->mgt_cte_tpveic->ItemIndex), 0));\r\n $ct314l = $geraDom->createElement('tpRod', retira_acentos(strtoupper($this->mgt_cte_tprod->ItemIndex), 0));\r\n $ct314m = $geraDom->createElement('tpCar', retira_acentos(strtoupper($this->mgt_cte_tpcar->ItemIndex), 0));\r\n $ct314n = $geraDom->createElement('UF', retira_acentos(strtoupper($this->mgt_cte_uf->ItemIndex), 0));\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct314d->appendChild($ct314e);\r\n $ct314d->appendChild($ct314f);\r\n $ct314d->appendChild($ct314g);\r\n $ct314d->appendChild($ct314h);\r\n $ct314d->appendChild($ct314i);\r\n $ct314d->appendChild($ct314j);\r\n $ct314d->appendChild($ct314k);\r\n $ct314d->appendChild($ct314l);\r\n $ct314d->appendChild($ct314m);\r\n $ct314d->appendChild($ct314n);\r\n\r\n $ct314->appendChild($ct314a);\r\n $ct314->appendChild($ct314b);\r\n $ct314->appendChild($ct314c);\r\n $ct314->appendChild($ct314d);\r\n\r\n $ct312->appendChild($ct314);\r\n\r\n //*** Continuacao do XML ***\r\n\r\n $ct330 = $geraDom->createElement('cobr');\r\n $ct331 = $geraDom->createElement('fat');\r\n $ct332 = $geraDom->createElement('nFat', completa_zeros_retira_caracter(retira_acentos(strtoupper($this->mgt_cte_numero->Text), 0),7));\r\n $ct333 = $geraDom->createElement('vOrig', number_format($this->mgt_cte_servico_valor_receber->Text, 2, '.', ''));\r\n $ct335 = $geraDom->createElement('vLiq', number_format($this->mgt_cte_servico_valor_receber->Text, 2, '.', ''));\r\n\r\n $ct336 = $geraDom->createElement('dup');\r\n $ct337 = $geraDom->createElement('nDup', completa_zeros_retira_caracter(retira_acentos(strtoupper($this->mgt_cte_numero->Text), 0),7));\r\n $ct338 = $geraDom->createElement('dVenc', inverte_data_dma_to_amd(trim($this->mgt_cte_data_receber->Text)));\r\n $ct339 = $geraDom->createElement('vDup', number_format($this->mgt_cte_servico_valor_receber->Text, 2, '.', ''));\r\n\r\n //*** Gravando os Nos ***\r\n\r\n $ct331->appendChild($ct332);\r\n $ct331->appendChild($ct333);\r\n $ct331->appendChild($ct335);\r\n\r\n $ct336->appendChild($ct337);\r\n $ct336->appendChild($ct338);\r\n $ct336->appendChild($ct339);\r\n\r\n $ct330->appendChild($ct331);\r\n $ct330->appendChild($ct336);\r\n\r\n $ct276->appendChild($ct277);\r\n\t $ct276->appendChild($ct157);\r\n\t $ct276->appendChild($ct360);\r\n $ct276->appendChild($ct312);\r\n $ct276->appendChild($ct330);\r\n\r\n //*** Fecha a Raiz ***\r\n\r\n $ct001->appendChild($ct004);\r\n $ct001->appendChild($ct059);\r\n $ct001->appendChild($ct097);\r\n $ct001->appendChild($ct112);\r\n $ct001->appendChild($ct203);\r\n $ct001->appendChild($ct233);\r\n $ct001->appendChild($ct239);\r\n $ct001->appendChild($ct276);\r\n\r\n $ct000->appendChild($ct001);\r\n\r\n //*** Prepara o XML para a Transmissao ***\r\n\r\n $geraDom->appendChild($ct000);\r\n\r\n //*** Salvando o XML ***\r\n $geraDom->save('nfe/entrada/CTe_' . trim($this->mgt_cte_numero->Text) . '.xml');\r\n\r\n //***************************************\r\n //*** FINAL - Gera o XML para o Envio ***\r\n //***************************************\r\n }", "public function import_pages_xml()\n {\n $this->bbtohtml = new bbcode();\n $this->bbCodeParser = new BBCodeParser();\n set_time_limit(0);\n $this->importUsers = $_REQUEST['importUsers'];\n if ($this->importUsers) {\n $importUsers = new ImportUsers();\n $importUsers->run();\n }\n $this->txt = $this->app->make('helper/text');\n $this->uir = Core::make('Concrete\\Core\\User\\UserInfoRepository');\n $this->xml = simplexml_load_file($_FILES['xml']['tmp_name'], \\SimpleXMLElement::class, LIBXML_NOCDATA | LIBXML_NOBLANKS);\n $this->forumPage = Page::getByID($_REQUEST['forumPage']);\n $this->ct = CollectionType::getByID($_REQUEST['ctID']);\n $this->pt = PageTemplate::getByHandle($_REQUEST['ptID']);\n $this->area = $_REQUEST['area'];\n if (!empty($this->xml->pages->page)) {\n foreach ($this->xml->pages->page as $page) {\n // create new page for post\n $this->createNewPost($page);\n }\n }\n }", "public function importJobs()\n {\n SQL::delete($this->db);\n\n /* import each item */\n $count = 0;\n\n /* parse XML file */\n foreach ($this->file as $file) {\n # code...\n \n $xml = simplexml_load_file($file);\n\n ///////////Import file regionsjob.xml////////////////////////\n if($xml->item){\n foreach ($xml->item as $item) {\n SQL::insertregionsjob($this->db,$item);\n $count++;\n }\n }\n //////////////Import file jobteaser.xml/////////////////\n if($xml->offer){\n foreach ($xml->offer as $offer) {\n\n ///////////// Date management\n\n $offer->publisheddate = Datejobteaser::setdate($offer->publisheddate);\n\n SQL::insertjobteaser($this->db,$offer); \n $count++;\n }\n }\n }\n return $count;\n }", "function parse($file_id) {\n $this->file_id = $file_id;\n $file = $this->app->dbo->get('files', array('id'=>$file_id));\n \n array_push($this->route, 0);\n \n $handle = fopen(APPROOT.\"/upload/\".$file['filename'], 'r');\n \n $this->d('Filesize:' . filesize(APPROOT.\"/upload/\".$file['filename']));\n \n while ($data = fread($handle, filesize(APPROOT.\"/upload/\".$file['filename']))) {\n if (!xml_parse($this->xml_parser, $data, feof($handle))) {\n $this->d('Malformed XML'); // TODO: Warn user\n }\n }\n }", "public static function beautifyXmlFile($filename) {\n if(Storage::disk('local')->exists($filename)) {\n $xml_unbeautified = Storage::disk('local')->get($filename);\n\n Storage::disk('local')->put($filename, self::beautifyXml($xml_unbeautified));\n }\n }", "function lit_rss($fichier, $objets) {\n if ($chaine = @implode(\"\", @file($fichier))) {\n\n // on découpe la chaine obtenue en items\n $tmp = preg_split(\"/<\\/?\" . \"item\" . \">/\", $chaine);\n\n // pour chaque item\n for ($i = 1; $i < sizeof($tmp) - 1; $i+=2) {\n\n // on lit chaque objet de l'item\n foreach ($objets as $objet) {\n\n // on découpe la chaine pour obtenir le contenu de l'objet\n $tmp2 = preg_split(\"/<\\/?\" . $objet . \">/\", $tmp[$i]);\n\n // on ajoute le contenu de l'objet au tableau resultat\n $resultat[$i - 1][] = @$tmp2[1];\n }\n\n // on retourne le tableau resultat\n return $resultat[0][0];\n }\n }\n}", "public function cargar_archivo_wordpress(){\n\n //obtenemos es contenido del archivo xml que hemos subido\n $contenido_archivo = file_get_contents($_FILES['archivo']['tmp_name']);\n\n //cargamos la informacion del archivo en un objeto SimpleXMLElement\n $xml = simplexml_load_string($contenido_archivo);\n\n //declaramos el array de entradas\n $entradas = array();\n\n //recoremos los elementos del objeto SimpleXMLElement que representa un articulo\n foreach($xml->channel->item as $item)\n {\n //declaramos los array para categoria y etiquetas\n $categorias = array();\n $etiquetas = array();\n\n //recoremos los elementos del objeto SimpleXMLElement que representa una categoria o etiqueta (category)\n foreach($item->category as $category)\n {\n //recogemos las caterias del articulo\n if($category['nicename'] != \"uncategorized\" && $category['domain'] == \"category\")\n {\n $categorias[] = $category;\n }\n\n //recogemos las etiquetas del articulo\n if($category['nicename'] != \"uncategorized\" && $category['domain'] == \"post_tag\")\n {\n $etiquetas[] = $category;\n }\n }\n\n //si el articulo no tiene categoria, los guardamo como null\n if(!isset($categorias[0])){\n $categorias[0] = NULL;\n }\n\n //ejecutamos los archivos de configuracion de los elemento xmlns del archivo xml\n $content = $item->children('http://purl.org/rss/1.0/modules/content/');\n $excerpt = $item->children('http://wordpress.org/export/1.2/excerpt/');\n $wp = $item->children('http://wordpress.org/export/1.2/');\n\n //obtenemos la fecha y hora de la publicacion del articulo\n $publicacion = explode(\" \",$wp->post_date);\n\n //cambiamos el contenido de elementos [nombre atributos=value][/nombre], en formato html \n $contenido = html_entity_decode($content->encoded);\n $contenido = str_replace('[', '<',$contenido);\n $contenido = str_replace(']', '>',$contenido);\n\n //creamos por cada articulo del archivo xml un entrada tipo Medssocial\n $entradas[] = array(\n \"titulo\"=>html_entity_decode($item->title),\n \"extracto_texto\"=>html_entity_decode($excerpt->encoded),\n \"contenido\"=>$contenido,\n \"publicacion\"=>$publicacion[0],\n \"categoria\"=>html_entity_decode($categorias[0]),\n \"etiquetas\"=>implode(\",\", $etiquetas),\n \"titulo_url\"=>normalizar_string($item->title)\n );\n }\n\n return $entradas;\n }", "function extractAll($inputPath, $outputPath){\n \n $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($inputPath));\n\n foreach ($rii as $file) {\n\n if ($file->isDir()){ \n continue;\n }\n \n $filePath = $file->getPathname();\n \n if (strpos($filePath, '.xml') !== false) {\n $this->parseXmlFile($filePath, $outputPath);\n }\n }\n }", "public function clean(){\n\t\t$file = file($this->feed);\n\n\t\t// slice first 20 elements.\n\t\t$file = array_slice($file,0,20);\n\n\t\t// write back to file after joining.\n\t\tfile_put_contents($this->feed,implode(\"\",$file));\n\t}", "function checkmaxfilesize($filepath,$imagesizemax=''){\r\r\r\r\t\t\t\t\r\r\r\r\t\t\t\t\t$imagewidth = '';\r\r\r\r\t\t\t\t\t$imageheight = '';\r\r\r\r\t\t\t\t\t$newdiamentions=\"\";\r\r\r\r\t\t\t\t\tif($imagesizemax){\r\r\r\r\t\t\t\t\t\r\r\r\r\t\t\t\t\t\t$expimagedi = explode('x',$imagesizemax);\r\r\r\r\t\t\t\t\t\t$maxwidth = $expimagedi[0];\r\r\r\r\t\t\t\t\t\t$maxheight = $expimagedi[1];\r\r\r\r\t\t\t\t\t}\r\r\r\r\t\t\t\t\tif(file_exists($filepath)){\r\r\r\r\r\r\r\r\t\t\t\t\t\t$size = getimagesize($filepath);\r\r\r\r\t\t\t\t\t\tif($size){\r\r\r\r\t\t\t\t\t\t\t\t\r\r\r\r\t\t\t\t\t\t\t$imageorgwidth = $size[0];\r\r\r\r\t\t\t\t\t\t\t$imageorgheight = $size[1];\r\r\r\r\t\t\t\t\t\t\t##make image diamentions\r\r\r\r\t\t\t\t\t\t\tif($imageorgwidth > $maxwidth && $imageorgheight > $maxheight){\r\r\r\r\t\t\t\t\t\t\t\t$newdiamentions = $imagesizemax;\r\r\r\r\t\t\t\t\t\t\t\treturn $newdiamentions;\r\r\r\r\t\t\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\t\telse if($imageorgwidth > $maxwidth && $imageorgheight < $maxheight){\r\r\r\r\t\t\t\t\t\t\t\t$newdiamentions = $maxwidth.\"x\".$imageorgheight;\r\r\r\r\t\t\t\t\t\t\t\treturn $newdiamentions;\r\r\r\r\t\t\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\t\telse if($imageorgwidth < $maxwidth && $imageorgheight > $maxheight){\r\r\r\r\t\t\t\t\t\t\t\t$newdiamentions = $imageorgwidth.\"x\".$maxheight;\r\r\r\r\t\t\t\t\t\t\t\treturn $newdiamentions;\r\r\r\r\t\t\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\t\telse if($imageorgwidth < $maxwidth && $imageorgheight < $maxheight){\r\r\r\r\t\t\t\t\t\t\t\t$newdiamentions = $imageorgwidth.\"x\".$imageorgheight;\r\r\r\r\t\t\t\t\t\t\t\treturn $newdiamentions;\r\r\r\r\t\t\t\t\t\t\t}else{\r\r\r\r\t\t\t\t\t\t\t\treturn $imagesizemax;\r\r\r\r\t\t\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\t}else{\r\r\r\r\t\t\t\t\t\t\t\treturn $imagesizemax;\r\r\r\r\t\t\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\r\r\r\r\t\t\t\t\t}else{\r\r\r\r\t\t\t\t\t\t\treturn $imagesizemax;\r\r\r\r\t\t\t\t\t}\r\r\r\r\t\t\t\t\t\t\t\t\t\t\t\r\r\r\r\t\t}", "public function hitXmlFileAction()\n\t{\n\t\tini_set('memory_limit', '-1');//overrides the default PHP memory limit.\n\t\tini_set('max_execution_time', 28800); // this will set max_execution time for 8 hours\n\n\t\t//Key is compared with defined timesjob key in application.ini for security purpose to avoid unnecessory hits from unknown user.\n\t\t$config \t= Zend_Controller_Front::getInstance()->getParam('bootstrap');\n\t\t$options\t= $config->getOption('timesjobs');\n\t\t$key \t= $this->getRequest()->getParam( 'key' );\n\t\t$job_collec = array(); //define variables for xml objects.\n\t\t$temp_arr = array(); //Temporary array that holds duplicate values used in removing from jobs array.\n\t\t$jobs_array = array(); //Saving array converted from xml object.\n\t\t$jobCollecCounter = 0; //job collection intailzer that used to call processing job array function after 1000 collections\n\t\t if($options['key'] == $key){\n\n\t\t\t //Initializations.\n\t\t\t $counter = 0; //Used to check that when to call flush function on entity manager.\n\t\t\t $error_message = \"\"; //defines failure reasons of code\n\t\t\t $success_message = \"\";//defines code successfully executed after conditions applied\n\t\t\t //Get user obj by user type admin so that job can be posted by that user.\n\t\t\t $admin_user_obj = \\Extended\\ilook_user::getUserInfoByUserType(5);\n\t\t\t $xml_obj = simplexml_load_file($this->source, 'SimpleXMLElement', LIBXML_NOWARNING|LIBXML_NOERROR|LIBXML_PARSEHUGE);\n\n\t\t\t //If $xml_obj is not object.\n\t\t\t if(is_object($xml_obj))\n\t\t\t {\n\t\t\t\t //Looping on XML object to get array object of job.\n\t\t\t\t foreach ($xml_obj->Job as $job_info )\n\t\t\t\t {\n\t\t\t\t\t $job_collec[]['job'] = $job_info;\n\t\t\t\t }\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t $log_msg = \"Invalid XML\";\n\t\t\t\t Helper_common::logInfo($log_msg, \"RED\", $this->log_file_path);\n\n\t\t\t }\n\n\t\t\t //==================================================================================================\n\t\t\t //loop will cascade SimpleXMLElement Object values to string & collect all values in jobs array.\n\t\t\t // While creating this array we have followed followin rules.\n\t\t\t // 1. $temp_arr will keep the latest record in case id reference ID will repeat for edit or add. for e.g. if there is ref ID with action add and agian\n\t\t\t // \tref ID repeat with action edit then we will keep edit and remove previous record from array. And vice versa.\n\t\t\t //\t2. If there is any add/edit before delete action will remove that key from array for ADD/EDIT. But delete ref ID will be added to array for\n\t\t\t //\t\tcleaning that record from DB.\n\t\t\t //==================================================================================================\n\t\t\t if($job_collec)\n\t\t\t {\n\t\t\t\t $totalJobCount = count($job_collec);\n\t\t\t\t foreach ($job_collec as $key => $job_info) {\n\n\t\t\t\t\t try //an exception for job parsing into array, if fails save error msg into timesjob_import_log.html\n\t\t\t\t\t {\n\t\t\t\t\t\t $temp_arr[$key]['referencenumber'] = (string)$job_info['job']->referencenumber;\n\t\t\t\t\t\t $temp_arr[$key]['action'] = (string)$job_info['job']->ACTION;\n\t\t\t\t\t\t $temp_arr[$key]['key'] = $key;\n\t\t\t\t\t\t foreach ($temp_arr as $duplicate_job) {\n\t\t\t\t\t\t\t if (($duplicate_job['referencenumber'] == (string)$job_info['job']->referencenumber && $duplicate_job['action'] == 'ADD')\n\t\t\t\t\t\t\t\t || ($duplicate_job['referencenumber'] == (string)$job_info['job']->referencenumber && $duplicate_job['action'] == 'EDIT')\n\t\t\t\t\t\t\t ) {\n\t\t\t\t\t\t\t\t unset($jobs_array[$duplicate_job['key']]);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t if ($duplicate_job['referencenumber'] == (string)$job_info['job']->referencenumber && $jobs_array[$key]['action_key'] == 'DELETE') {\n\t\t\t\t\t\t\t\t unset($jobs_array[$duplicate_job['key']]);\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t if ((string)$job_info['job']->ACTION == 'ADD' || (string)$job_info['job']->ACTION == \"EDIT\") {\n\t\t\t\t\t\t\t $jobs_array[$key]['action_key'] = 'job_add_edit';\n\t\t\t\t\t\t\t $jobs_array[$key]['jobTitle'] = (string)$job_info['job']->title;\n\t\t\t\t\t\t\t $jobs_array[$key]['dd_industry'] = (string)$job_info['job']->category;\n\t\t\t\t\t\t\t $jobs_array[$key]['action'] = (string)$job_info['job']->ACTION;\n\n\t\t\t\t\t\t\t if($job_info['job']->jobtype =='full time'){\n\t\t\t\t\t\t\t\t $job_info['job']->jobtype ='Full Time';\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t //assign jobtype row obj for saving job type so that can map with saved job types.\n\t\t\t\t\t\t\t $jobs_array[$key]['dd_job_type'] = \\Extended\\job_type::getRowObjectByJobTypeName((string)$job_info['job']->jobtype);\n\t\t\t\t\t\t\t $jobs_array[$key]['jobDesc'] = (string)$job_info['job']->url . '<br/>' . (string)$job_info['job']->description . \"<br/><b>Experience Level:</b> \" . $job_info['job']->experience;\n\n\t\t\t\t\t\t\t //assign country row obj for job country so that can map with saved countries.\n\t\t\t\t\t\t\t //if timesjob api job's country not match with saved countries empty value.\n\t\t\t\t\t\t\t $countryObj = \\Extended\\country_ref::getRowObjectByName((string)$job_info['job']->country);\n\t\t\t\t\t\t\t if ($countryObj) {\n\t\t\t\t\t\t\t\t $jobs_array[$key]['dd_location'] = $countryObj->getId();\n\t\t\t\t\t\t\t } else {\n\t\t\t\t\t\t\t\t $jobs_array[$key]['dd_location'] = '';\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t $jobs_array[$key]['sender_ref_id'] = (string)$job_info['job']->referencenumber;\n\t\t\t\t\t\t\t //assign experience level row obj for job experience level so that can map with saved experience level.\n\t\t\t\t\t\t\t $jobs_array[$key]['dd_exp_lvl'] = \\Extended\\experienece_level::getRowObjectByExperienceLevelName((string)$job_info['job']->experience);\n\t\t\t\t\t\t\t $jobs_array[$key]['company'] = (string)$job_info['job']->company;\n\t\t\t\t\t\t\t $jobs_array[$key]['webJobUrl'] = (string)$job_info['job']->url;\n\t\t\t\t\t\t\t $jobs_array[$key]['created_at'] = \\DateTime::createFromFormat(\"D, j M Y H:i:s T\", (string)$job_info['job']->date);\n\t\t\t\t\t\t\t $jobs_array[$key]['applyfrm'] = 1;\n\t\t\t\t\t\t\t $jobs_array[$key]['user_id'] = $admin_user_obj->getId();\n\t\t\t\t\t\t } else if ((string)$job_info['job']->ACTION == 'DELETE') {\n\t\t\t\t\t\t\t $jobs_array[$key]['action_key'] = (string)$job_info['job']->ACTION;\n\t\t\t\t\t\t\t $jobs_array[$key]['sender_ref_id'] = (string)$job_info['job']->referencenumber;\n\t\t\t\t\t\t }\n\t\t\t\t\t } catch (Exception $e) {\n\t\t\t\t\t\t $log_msg = \"Some problem occurred while parsing and mapping timesjob XML.\";\n\t\t\t\t\t\t Helper_common::logInfo($log_msg, \"red\", $this->log_file_path);\n\t\t\t\t\t\t Helper_common::logInfo($e, \"red\", $this->log_file_path);\n\t\t\t\t\t\t continue;\n\t\t\t\t\t }\n\t\t\t\t\t $jobCollecCounter++;\n\t\t\t\t\t if (!($jobCollecCounter % 1000) || ($jobCollecCounter == $totalJobCount)) {\n\t\t\t\t\t\t //Processing job_arrays.\n\t\t\t\t\t\t $this->processJobsArrays($jobs_array, $admin_user_obj);\n\t\t\t\t\t\t unset($temp_arr);// to reduce load while comapring duplicacy from jobs arrays\n\t\t\t\t\t\t unset($jobs_array);// to reduce load while comapring duplicacy from jobs arrays\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 //END-Looping on XML object to get array object of job.\n\t\t\t\t //==================================================================================================\n\n\t\t\t\t // If $jobs_array is empty then show jobs could not be parsed.\n\t\t\t\t //This can happen if their XML does not contain any action attribute.\n\t\t\t } else {\n\t\t\t\t $log_msg =\" No jobs Parsed in this job feed.\";\n\t\t\t\t Helper_common::logInfo($log_msg, \"red\", $this->log_file_path);\n\t\t\t }\n\t\t } else {\n\t\t\t echo \"The key did not matched!\";\n\t\t }\n\t\tdie;\n\t}", "public function parse($import,$display=True)\n {\n //DSI\n //$xmlfile=\"/USERS/phpinfo/laravel/nupload/imports/Collection-15616/Collection-15616.xml\";\n //FAYOL\n //$xmlfile=\"/USERS/phpinfo/laravel/nupload/imports/Collection-5745/Collection-5745.xml\";\n //$xml = simplexml_load_file($xmlfile);\n\n //reconstruit le chemin de telle sorte\n $pathtoxml=\"/\".$import.\"/\".$import.\".xml\";\n\n $note=\"\";\n\n //recupere le contenu du fichier\n $xmlcontent = Storage::disk('imports')->get($pathtoxml);\n\n //convertit le texte xml en objet simplexml_load_file\n $xml = simplexml_load_string($xmlcontent);\n\n //print $import.$xmlcontent;\n\n $this->nuxeotab=\"\";\n\n #tableau contenant les données nuxeo\n\n\n //$file=fopen($xmlfile);\n\n foreach ($xml as $id => $dsobject) {\n #print_r($dsobject);\n\n\n //Type de document\n $ds_type=(string)$dsobject->attributes()->classname;\n\n\n //Nom Docushare du document\n $ds_id=(string)$dsobject->attributes()->handle;\n\n\n //description du document\n $this->getXmlProp($dsobject,\"description\",$ds_id);\n\n\n\n //Libellé du document/Collection\n $this->getXmlProp($dsobject,\"title\",$ds_id);\n\n\n //nom original du fichier\n $this->getXmlProp($dsobject,\"filename\",$ds_id);\n\n //résumé du fichier ( keywords)\n $this->getXmlProp($dsobject,\"keywords\",$ds_id);\n\n //résumé du fichier ( keywords)\n $this->getXmlProp($dsobject,\"original_file_name\",$ds_id);\n\n //Collections contenant le fichier/la collection\n $ds_father=(string)$dsobject->sourcelinks->containment;\n\n\n //Listre des contenus de la collection\n $ds_childs=\"\";\n $ds_child=\"\";\n $ds_child=array();\n $ds_childs=$dsobject->destinationlinks->containment;\n $i_father=0;\n\n foreach ($ds_childs as $child) {\n $ds_child[]=(string)$child;\n\n }\n\n //si aucun enfant et que c'est une collection, c'est la racine d'import\n if(count($dsobject->sourcelinks->containment)==0 && $ds_type==\"Collection\")\n {\n\n $this->nuxeoroot=$ds_id;\n }\n\n //Le propriétaire de l'objet\n $ds_owner=(string)$dsobject->destinationlinks->owner;\n\n\n\n $this->nuxeotab[$ds_id]['type']=$ds_type;\n\n $this->nuxeotab[$ds_id]['father']=$ds_father;\n $this->nuxeotab[$ds_id]['childs']=$ds_child;\n $this->nuxeotab[$ds_id]['owner']=$ds_owner;\n\n\n\n\n\nif($ds_id==\"Collection-16730\")\n{\n /*print_r($dsobject);\n print_r($this->nuxeotab[$ds_id]);*/\n}\n\n\n # $this->nuxeotab[$dsobject->attributes()['handle'][0]]=1;\n #$this->nuxeotab[$ds_id]['type']=1;\n\n\n #print \"$id *****<br>\";\n }\n\n\n #print_r($xml);\n if($display==true)\n print_r($this->nuxeotab);\n\n #return view('generic_view')->withNote('Test de connexion à '.$xml.$xmlfile)->withDatas(['tab1','tab2']);\n return view('generic_view')->withNote('Message '.$note)->withDatas([]);\n }", "static function exportVehiclesXML($vehicles, $all)\r\n {\r\n \r\n // print_r($vehicles); exit;\r\n \r\n global $mosConfig_live_site, $mosConfig_absolute_path, $vehiclemanager_configuration, $database;\r\n $strXmlDoc = \"\";\r\n $strXmlDoc .= \"<?xml version='1.0' encoding='utf-8'?>\\n\";\r\n\r\n //$istaller_data_dom = $xmlDoc->createElement(\"istaller_data\");\r\n $strXmlDoc .= \"<vechicles_data>\\n\";\r\n $strXmlDoc .= \"<version>\";\r\n $strXmlDoc .= $vehiclemanager_configuration['release']['version'];\r\n $strXmlDoc .= \"</version>\\n\";\r\n if ($all)\r\n {\r\n $strXmlDoc .= \"<categories>\\n\";\r\n $database->setQuery(\"SELECT name, title,section, id, parent_id, published, params, params2, language FROM #__vehiclemanager_main_categories \" .\r\n \"WHERE section='com_vehiclemanager' order by parent_id; \");\r\n $categories = $database->loadObjectList();\r\n\r\n foreach ($categories as $category) {\r\n //add category\r\n $strXmlDoc .= \"<category>\\n\";\r\n $strXmlDoc .= \"<category_id>\" . $category->id . \"</category_id>\";\r\n $strXmlDoc .= \"<category_parent_id>\" . $category->parent_id . \"</category_parent_id>\";\r\n $strXmlDoc .= \"<category_name><![CDATA[\" . $category->name . \"]]></category_name>\";\r\n $strXmlDoc .= \"<category_title><![CDATA[\" . $category->title . \"]]></category_title>\";\r\n $strXmlDoc .= \"<category_section><![CDATA[\" . $category->section . \"]]></category_section>\";\r\n $strXmlDoc .= \"<category_published><![CDATA[\" . $category->published . \"]]></category_published>\";\r\n $strXmlDoc .= \"<category_params><![CDATA[\" . $category->params . \"]]></category_params>\";\r\n $strXmlDoc .= \"<category_params2><![CDATA[\" . $category->params2 . \"]]></category_params2>\";\r\n $strXmlDoc .= \"<category_language><![CDATA[\" . $category->language . \"]]></category_language>\";\r\n $strXmlDoc .= \"</category>\\n\";\r\n }\r\n //create and append list element\r\n $strXmlDoc .= \"</categories>\\n\";\r\n\r\n $strXmlDoc .= \"<features>\\n\";\r\n $database->setQuery(\"SELECT * FROM #__vehiclemanager_feature \");\r\n $features = $database->loadObjectList();\r\n\r\n foreach ($features as $feature) {\r\n //add features\r\n $strXmlDoc .= \"<feature>\\n\";\r\n $strXmlDoc .= \"<feature_id>\" . $feature->id . \"</feature_id>\";\r\n $strXmlDoc .= \"<feature_name><![CDATA[\" . $feature->name . \"]]></feature_name>\";\r\n $strXmlDoc .= \"<feature_categories><![CDATA[\" . $feature->categories . \"]]></feature_categories>\";\r\n $strXmlDoc .= \"<feature_published><![CDATA[\" . $feature->published . \"]]></feature_published>\";\r\n $strXmlDoc .= \"<feature_image_link><![CDATA[\" . $feature->image_link . \"]]></feature_image_link>\";\r\n $strXmlDoc .= \"</feature>\\n\";\r\n \r\n \r\n \r\n }\r\n //create and append list element\r\n $strXmlDoc .= \"</features>\\n\";\r\n\r\n $strXmlDoc .= \"<features_vehicles>\\n\";\r\n $database->setQuery(\"SELECT * FROM #__vehiclemanager_feature_vehicles \");\r\n $features_vehicles = $database->loadObjectList();\r\n\r\n foreach ($features_vehicles as $feature_vehicle) {\r\n //add feature vehicle\r\n $strXmlDoc .= \"<feature_vehicle>\\n\";\r\n $strXmlDoc .= \"<feature_vehicle_id>\" . $feature_vehicle->id . \"</feature_vehicle_id>\";\r\n $strXmlDoc .= \"<feature_vehicle_fk_vehicleid><![CDATA[\" . $feature_vehicle->fk_vehicleid . \"]]></feature_vehicle_fk_vehicleid>\";\r\n $strXmlDoc .= \"<feature_vehicle_fk_featureid><![CDATA[\" . $feature_vehicle->fk_featureid . \"]]></feature_vehicle_fk_featureid>\";\r\n $strXmlDoc .= \"</feature_vehicle>\\n\";\r\n }\r\n //create and append list element\r\n $strXmlDoc .= \"</features_vehicles>\\n\";\r\n }\r\n //create and append list element\r\n $strXmlDoc .= \"<vechicles_list>\\n\";\r\n\r\n foreach ($vehicles as $vehicle) {\r\n \r\n \r\n $strXmlDoc .= $vehicle->toXML2($all);\r\n \r\n }\r\n \r\n \r\n \r\n $strXmlDoc .= \"</vechicles_list>\\n\";\r\n $strXmlDoc .= \"</vechicles_data>\";\r\n //print_r($strXmlDoc);exit;\r\n return $strXmlDoc;\r\n }", "function exportgml($filename) {\n\n if (!file_exists('/usr/bin/xsltproc')){ \n trigger_error(\"No gml support.\");\n return -1;\n }\n\n if (!file_exists('kml2gml.xsl')){ \n trigger_error(\"No kml2gml conversion schema found.\");\n return -1;\n }\n\n $parsedfile=$this->exportlocal($filename);\n if (strlen($parsedfile)<=0) {\n trigger_error(\"File name empty!\");\n return;\n }\n // Call command line tools\n/* pre 5.3 this worked\n $output=array();\n $retval=null;\n exec(\"/bin/sed 's/ xmlns=\\\"http\\:\\/\\/earth.google.com\\/kml\\/2.0\\\"//' \" . $parsedfile . \" > \" . $parsedfile .\"_post\",&$output,&$retval);\n exec(\"/usr/bin/xsltproc -o \" . $parsedfile . \".gml \". $this->getCurrentDirectory() .\"kml2gml.xsl \" . $parsedfile . \"_post\",&$output,&$retval);\n //debug($this->getCurrentDirectory());\n*/\n\n/* post 5.3 this does it */\n $cmd=\"/bin/sed 's/ xmlns=\\\"http\\:\\/\\/earth.google.com\\/kml\\/2.2\\\"//' \" . $parsedfile . \" > \" . $parsedfile .\"_post\";\n // echo $cmd . \"\\n\";\n exec($cmd);\n $xslt=\"/usr/bin/xsltproc -o \" . $parsedfile . \".gml \". $this->getCurrentDirectory() .\"/kml2gml.xsl \" . $parsedfile . \"_post\";\n // echo $xslt . \"\\n\";\n exec($xslt);\n //debug($this->getCurrentDirectory());\n\n // Clean up\n unlink($parsedfile .\"_post\");\n unlink($parsedfile);\n\n $content=null;\n $tempf = @fopen($parsedfile.\".gml\", 'r');\n if ($tempf) {\n while (!feof($tempf)) {\n $buffer = fgets($tempf, 4096);\n $content.=$buffer;\n }\n fclose($tempf);\n }\n\n header('Content-type: application/keyhole');\n header('Content-Disposition:atachment; filename=\"' . $filename. '.gml\"');\n header('Content-Length: ' . strlen($content));\n header('Expires: 0');\n header('Pragma: cache');\n header('Cache-Control: private');\n echo $content;\n //return($filename);\n }", "protected function exportFile()\n {\n $this->xml->asXML($this->outputPath . $this->fileName);\n \n }", "function ubl_metadata_synchronization_xsl_files() {\n $files = file_scan_directory(drupal_get_path('module', 'ubl_metadata_synchronization') . '/xsl/', '/.*\\.xslt?$/');\n\n $transform_options = array();\n\n foreach ($files as $file) {\n $transform_options[$file->uri] = $file->filename;\n }\n\n $oai_uploaded_files = array();\n $upload_path = 'public://ubl_metadata_synchronization_xsls';\n $uploaded_files = file_scan_directory($upload_path, '/.*\\.xslt?$/');\n\n foreach ($uploaded_files as $up_file) {\n $oai_uploaded_files[$up_file->uri] = $up_file->filename;\n }\n\n foreach ($oai_uploaded_files as $key => $file) {\n if (!in_array($file, $transform_options)) {\n $transform_options[$key] = $file;\n }\n }\n return $transform_options;\n}", "function merge_file($merged_file_name, $parts_num) {\n \n $content='';\n //put splited files content into content\n for($i=0;$i<$parts_num;$i++){\n $url = $_SERVER['DOCUMENT_ROOT'] . \"/test_ftp/temp_files/\" . $merged_file_name. \".00\" .$i;\n $file_size = filesize($url);\n $handle = fopen($url, 'rb') or die(\"error opening file\");\n $content .= fread($handle, $file_size) or die(\"error reading file\");\n fclose($handle);\n unlink($url) or die(\"Couldn't delete file\");\n }\n \n $url_after_merged = $_SERVER['DOCUMENT_ROOT'] . \"/test_ftp/uploads/\" . $merged_file_name;\n //write content to merged file\n $handle = fopen($url_after_merged, 'wb') or die(\"error creating/opening merged file\");\n fwrite($handle, $content) or die(\"error writing to merged file\");\n \n}", "public function cleanXHTML(){\n $this->xhtmlFiles = $this->getXhtmlFiles();\n $this->setShortedChapters();\n foreach ($this->xhtmlFiles as $item) {\n// $clean_html = $purifier->purify($dirty_html);\n $this->backToEpub($item, tidy_repair_string($this->zip->getFromName($item), array('char-encoding'=>'utf8','output-xhtml'=>true)));\n }\n\n }", "public function mergeWithXML() {\r\n\r\n\t\t$tc_scanned = $this->_scan($this->_directory);\r\n\r\n\t\tif(is_readable($this->_xmlFile)) {\r\n\t\t\t$parser = new TMXParser($this->_xmlFile, $this->_masterLanguage);\r\n\t\t\t$tc_existing = $parser->doParse();\r\n\t\r\n\t\t\t$tc_existing->merge($tc_scanned);\r\n\t\r\n\t\r\n\t\t\t$tw = new TMXWriter($this->_xmlFile);\r\n\t\t\t$tw->createTranslations($tc_existing);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$tw = new TMXWriter($this->_xmlFile);\r\n\t\t\t$tw->createTranslations($tc_scanned);\r\n\t\t}\r\n\r\n// \t\techo '<pre>';\r\n// \t\tprint_r($tc_existing);\r\n// \t\techo '</pre>';\r\n\t}", "public function exportXmlAction(){\n $fileName = 'magazine.xml';\n $content = $this->getLayout()->createBlock('unideal_topads/adminhtml_magazine_grid')->getXml();\n $this->_prepareDownloadResponse($fileName, $content);\n }", "protected function dumpXml($urls)\n {\n $webRootDir = $this->getContainer()->get('kernel')->getRootDir() .'/../web';\n $sitemapWebDir = '/' . $this->getContainer()->getParameter('armd_sitemap.directory');\n $sitemapDir = $webRootDir . $sitemapWebDir;\n\n // Remove old sitemap files.\n $finder = new Finder();\n $filesystem = new Filesystem();\n $filesystem->remove($finder->files()->name('sitemap*.xml')->in($sitemapDir));\n\n // Make new sitemap files\n $urlsPerFile = $this->getContainer()->getParameter('armd_sitemap.urls_per_file');\n $sitemaps = array();\n $index = 1;\n\n while ($fileUrls = array_splice($urls, 0, $urlsPerFile)) {\n $sitemapUrl = $sitemapWebDir . '/sitemap-' .$index .'.xml';\n $sitemapFile = $webRootDir . $sitemapUrl;\n\n file_put_contents(\n $sitemapFile,\n $this->renderXml(array('urls' => $fileUrls))\n );\n\n $sitemaps[] = array(\n 'url' => $this->getAbsoluteUrl($sitemapUrl),\n 'date' => new \\DateTime()\n );\n\n $index += 1;\n }\n\n file_put_contents(\n $sitemapDir .'/sitemap-index.xml',\n $this->renderXml(array('sitemaps' => $sitemaps), true)\n );\n }", "function xslt_process($proc, $xmlfile, $xslfile, $resultfile = null, $unsupportedargs = null, $parameters = null) {\n $doc = new DOMDocument;\n $doc->load($xmlfile, LIBXML_PARSEHUGE);\n $xsl = new DOMDocument;\n $xsl->load($xslfile, LIBXML_PARSEHUGE);\n\n // Set the html template file parameter.\n foreach ($parameters as $paramname => $paramvalue) {\n $proc->setParameter('', $paramname, $paramvalue);\n }\n\n $proc->importStylesheet($xsl);\n\n // Squash warnings because XSLT complains about COURSE_ACCESS tags which really are invalid XML (multiple root elements).\n if ($resultfile !== null) {\n $fp = fopen($resultfile, 'w');\n fwrite($fp, @$proc->transformToXML($doc));\n fclose($fp);\n return true;\n } else {\n return @$proc->transformToXML($doc);\n }\n }" ]
[ "0.50622517", "0.5028358", "0.5012962", "0.49778447", "0.49464968", "0.49289843", "0.48171982", "0.48004258", "0.47220832", "0.47168508", "0.4695937", "0.46870112", "0.46763766", "0.46625412", "0.4606413", "0.46031454", "0.45899555", "0.45803848", "0.45669416", "0.4561754", "0.4556908", "0.4544451", "0.45219892", "0.45134842", "0.4512007", "0.44904053", "0.44800246", "0.4471216", "0.4454925", "0.44416684" ]
0.69223183
0
Creates a new Averager. Of course, the current average and number of times averaged are both set to 0
public function __construct() { $this->currentAverage = 0; $this->timesAveraged = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calculateAverage()\n {\n return 0.0;\n }", "public function clear()\n\t{\n\t\t$this->currentAverage = 0;\n\t\t$this->timesAveraged = 0;\n\t\treturn $this;\n\t}", "public function average($d)\n\t{\n\t\t$this->currentAverage = (($this->currentAverage * $this->timesAveraged) + $d) / ++$this->timesAveraged;\n\t\treturn $this;\n\t}", "public function __construct($startingNumber)\n\t{\n\t\t$this->currentAverage = $startingNumber;\n\t\t$this->timesAveraged = 1;\n\t}", "public function calculateAverages() {\n\t\t$count = count($this->dates);\n\t\tif ($count == 0) return;\n\t\t$hits = 0;\n\t\t$visitors = 0;\n\t\tforeach($this->dates as $arr) {\n\t\t\t$hits += $arr['hits'];\n\t\t\t$visitors += count($arr['addresses']);\n\t\t}\n\t\t$this->average_hits = $hits / $count;\n\t\t$this->average_visitors = $visitors / $count;\n\t}", "public function getAverage()\n {\n return $this->time / $this->iterations;\n }", "public function computeAverageScore()\n {\n $count = count($this->votes);\n $total = 0;\n\n if (!$count) {\n return;\n }\n\n foreach ($this->votes as $vote) {\n $total += $vote->getScore();\n }\n\n $this->average = $total / $count;\n }", "protected function calculateAverageSetAndScore() : void\n {\n $average = 0;\n\n foreach($this->combination as $item) {\n $average += $item['score'];\n }\n $average = $average/count($this->combination);\n\n if($average > $this->highestAverageScore) {\n $this->highestAverageScore = $average;\n $this->highestAverageCombination = $this->combination;\n }\n }", "function avgrating($array) \n {\n $total = 0;\n foreach ($array as $number) {\n $total = $total + $number/5;\n }\n $avg = ($total/sizeof($array)) * 5; \n return $avg;\n }", "public function averageImages() {\n\t}", "function average() {\r\n $total = 0;\r\n foreach ($this->grades as $value)\r\n $total += $value;\r\n return $total / count($this->grades);\r\n }", "public function __construct() {\n\t\t$this->total_occurences = 0;\n\t\t$this->distribution = array();\n\t}", "public function __construct()\n {\n $this->performanceRating = 1500;\n\n $now = new \\DateTime();\n $this->created = $now;\n $this->modified = $now;\n }", "function average() {\n $total = 0;\n foreach ($this->grades as $value) {\n $total += $value;\n }\n return $total / count($this->grades);\n }", "function average() {\n $total = 0;\n foreach ($this->grades as $value) {\n $total += $value;\n }\n return $total / count($this->grades);\n }", "public static function addAverage(Review $review)\n {\n foreach ($review->responses as $response)\n {\n $question = $response->questions->first();\n\n // 1 - score\n // 2 - text\n // 3 - boolean (inactivated)\n // 4 - select (inactivated)\n if($question->type_id === 1)\n {\n // add question average\n $averageQuestion = $question->average;\n $averageQuestion->reviews = $averageQuestion->reviews + 1;\n $averageQuestion->total = $averageQuestion->total + $response->score;\n $averageQuestion->average = $averageQuestion->reviews === 0 ? 0 : $averageQuestion->total / $averageQuestion->reviews;\n $averageQuestion->save();\n\n // add object question average\n $objectAverageQuestion = ObjectQuestionAverage::firstOrCreate([\n 'poll_id' => $review->poll_id,\n 'question_id' => $question->id,\n 'object_id' => $review->object_id,\n 'object_type' => $review->object_type\n ]);\n\n $objectAverageQuestion->reviews = $objectAverageQuestion->reviews + 1;\n $objectAverageQuestion->total = $objectAverageQuestion->total + $response->score;\n $objectAverageQuestion->average = $objectAverageQuestion->reviews === 0 ? 0 : $objectAverageQuestion->total / $objectAverageQuestion->reviews;\n $objectAverageQuestion->save();\n }\n }\n }", "public function titleForAverage() { return 'Pace'; }", "public function calcAverage()\n {\n return round(array_sum($this->outcome) / count($this->outcome), 1);\n }", "public function testGetRatingAverage()\n {\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev1');\n $oRev->oxreviews__oxobjectid = new oxField('xxx');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(3);\n $oRev->save();\n\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev2');\n $oRev->oxreviews__oxobjectid = new oxField('xxx');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(1);\n $oRev->save();\n\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev3');\n $oRev->oxreviews__oxobjectid = new oxField('yyy');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(5);\n $oRev->save();\n\n $oRating = oxNew('oxRating');\n $this->assertEquals(2, $oRating->getRatingAverage('xxx', 'oxarticle'));\n $this->assertEquals(2, $oRating->getRatingCount('xxx', 'oxarticle'));\n $this->assertEquals(3, $oRating->getRatingAverage('xxx', 'oxarticle', array('yyy')));\n $this->assertEquals(3, $oRating->getRatingCount('xxx', 'oxarticle', array('yyy')));\n }", "public function get_averages() {\n $row_result = mysqli_num_rows($this->query_result);\n\n for ($i=0; $i<$row_result; $i++){\n //fetch data\n $rows = mysqli_fetch_assoc($this->query_result);\n\n //midterm arrays and midterm total\n $this->midterm_arr[$i] = $rows['midterm_score'];\n $total_midterm += $rows['midterm_score'];\n\n //final arrays and final total\n $this->final_arr[$i] = $rows['final_score'];\n $total_final += $rows['final_score'];\n }\n $this->ave_midterm = ($total_midterm/$row_result);\n $this->ave_final = ($total_final/$row_result);\n }", "public function getAverageEta()\n {\n return ($this->getEtaFrom() + $this->getEtaTo()) / 2;\n }", "protected function aging()\n {\n foreach ($this->males as $male) {\n $male->incrementAgeByMonth();\n }\n\n foreach ($this->females as $female) {\n $female->incrementAgeByMonth();\n }\n }", "function average($defValue = null);", "public function get_average_age_engineers()\n { \n echo $this->get_average_age('engineers'); \n }", "public function averageRating()\n {\n return Cache::remember(\n CacheKeys::averageRating(static::class, $this->id),\n $this->avarageRatingCacheLength,\n function () {\n $ratingsCounts = collect($this->getRatingsCounts());\n\n if ($ratingsCounts->sum() === 0) {\n return 0;\n }\n\n return round($ratingsCounts->map(function ($count, $stars) {\n return $count * $stars;\n })->sum() / $ratingsCounts->sum(), 1);\n }\n );\n }", "public function __construct()\n {\n $this->calculatedAmount = [\n 'subtotal' => 0,\n 'tax' => 0,\n 'total' => 0\n ];\n }", "public function get_average_age_internals()\n { \n echo $this->get_average_age('internals'); \n }", "public function average()\n {\n if($this->mapel->isNotEmpty()){\n $total = 0;\n $hitung = 0;\n foreach($this->mapel as $mapel){\n $total += $mapel->pivot->nilai;\n $hitung++; // setiap adala pengulangan, hitung ditambah 1\n }\n\n return round($total / $hitung);\n }\n\n return 0;\n }", "public function __construct()\n {\n $this->dice = 0;\n $this->throwResults = [];\n $this->lastRoll = 0;\n }", "public function getAverageTime ()\n {\n $count = $this->count();\n\n if ( $count == 0 )\n return 0;\n\n return max( $this->getTotalTime() / $count, 0 );\n }" ]
[ "0.58252466", "0.57647026", "0.5738939", "0.5720173", "0.55926204", "0.5251185", "0.5231757", "0.51885104", "0.5113264", "0.5096767", "0.5051129", "0.503048", "0.50272816", "0.50043845", "0.50043845", "0.4987256", "0.49727014", "0.49413112", "0.4929493", "0.49018332", "0.4893997", "0.48198915", "0.479881", "0.47978005", "0.47725058", "0.47697416", "0.476331", "0.47580165", "0.47467998", "0.47434023" ]
0.6856716
0
Creates a new Averager. The current average is set to the given number and number of times averaged is set to 1
public function __construct($startingNumber) { $this->currentAverage = $startingNumber; $this->timesAveraged = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function average($d)\n\t{\n\t\t$this->currentAverage = (($this->currentAverage * $this->timesAveraged) + $d) / ++$this->timesAveraged;\n\t\treturn $this;\n\t}", "public function __construct()\n\t{\n\t\t$this->currentAverage = 0;\n\t\t$this->timesAveraged = 0;\n\t}", "function avgrating($array) \n {\n $total = 0;\n foreach ($array as $number) {\n $total = $total + $number/5;\n }\n $avg = ($total/sizeof($array)) * 5; \n return $avg;\n }", "public function calculateAverages() {\n\t\t$count = count($this->dates);\n\t\tif ($count == 0) return;\n\t\t$hits = 0;\n\t\t$visitors = 0;\n\t\tforeach($this->dates as $arr) {\n\t\t\t$hits += $arr['hits'];\n\t\t\t$visitors += count($arr['addresses']);\n\t\t}\n\t\t$this->average_hits = $hits / $count;\n\t\t$this->average_visitors = $visitors / $count;\n\t}", "public function computeAverageScore()\n {\n $count = count($this->votes);\n $total = 0;\n\n if (!$count) {\n return;\n }\n\n foreach ($this->votes as $vote) {\n $total += $vote->getScore();\n }\n\n $this->average = $total / $count;\n }", "public function calculateAverage()\n {\n return 0.0;\n }", "public function getAverage()\n {\n return $this->time / $this->iterations;\n }", "function average() {\r\n $total = 0;\r\n foreach ($this->grades as $value)\r\n $total += $value;\r\n return $total / count($this->grades);\r\n }", "public static function addAverage(Review $review)\n {\n foreach ($review->responses as $response)\n {\n $question = $response->questions->first();\n\n // 1 - score\n // 2 - text\n // 3 - boolean (inactivated)\n // 4 - select (inactivated)\n if($question->type_id === 1)\n {\n // add question average\n $averageQuestion = $question->average;\n $averageQuestion->reviews = $averageQuestion->reviews + 1;\n $averageQuestion->total = $averageQuestion->total + $response->score;\n $averageQuestion->average = $averageQuestion->reviews === 0 ? 0 : $averageQuestion->total / $averageQuestion->reviews;\n $averageQuestion->save();\n\n // add object question average\n $objectAverageQuestion = ObjectQuestionAverage::firstOrCreate([\n 'poll_id' => $review->poll_id,\n 'question_id' => $question->id,\n 'object_id' => $review->object_id,\n 'object_type' => $review->object_type\n ]);\n\n $objectAverageQuestion->reviews = $objectAverageQuestion->reviews + 1;\n $objectAverageQuestion->total = $objectAverageQuestion->total + $response->score;\n $objectAverageQuestion->average = $objectAverageQuestion->reviews === 0 ? 0 : $objectAverageQuestion->total / $objectAverageQuestion->reviews;\n $objectAverageQuestion->save();\n }\n }\n }", "protected function calculateAverageSetAndScore() : void\n {\n $average = 0;\n\n foreach($this->combination as $item) {\n $average += $item['score'];\n }\n $average = $average/count($this->combination);\n\n if($average > $this->highestAverageScore) {\n $this->highestAverageScore = $average;\n $this->highestAverageCombination = $this->combination;\n }\n }", "function average() {\n $total = 0;\n foreach ($this->grades as $value) {\n $total += $value;\n }\n return $total / count($this->grades);\n }", "function average() {\n $total = 0;\n foreach ($this->grades as $value) {\n $total += $value;\n }\n return $total / count($this->grades);\n }", "function average($defValue = null);", "public function calcAverage()\n {\n return round(array_sum($this->outcome) / count($this->outcome), 1);\n }", "public function averageImages() {\n\t}", "public function testGetRatingAverage()\n {\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev1');\n $oRev->oxreviews__oxobjectid = new oxField('xxx');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(3);\n $oRev->save();\n\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev2');\n $oRev->oxreviews__oxobjectid = new oxField('xxx');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(1);\n $oRev->save();\n\n $oRev = oxNew('oxreview');\n $oRev->setId('_testrev3');\n $oRev->oxreviews__oxobjectid = new oxField('yyy');\n $oRev->oxreviews__oxtype = new oxField('oxarticle');\n $oRev->oxreviews__oxrating = new oxField(5);\n $oRev->save();\n\n $oRating = oxNew('oxRating');\n $this->assertEquals(2, $oRating->getRatingAverage('xxx', 'oxarticle'));\n $this->assertEquals(2, $oRating->getRatingCount('xxx', 'oxarticle'));\n $this->assertEquals(3, $oRating->getRatingAverage('xxx', 'oxarticle', array('yyy')));\n $this->assertEquals(3, $oRating->getRatingCount('xxx', 'oxarticle', array('yyy')));\n }", "public function calcAvg($sixth = '')\n {\n if ($sixth < 0 || $sixth > 5) {\n $msg = 'Invalid sixth given. Valid sixths range from 0 to 5.';\n throw new \\InvalidArgumentException($msg);\n }\n\n if ('' === $sixth) {\n $this->avg = $this->calcAvgGeneric(range(0, 59));\n } else {\n $var = 'avg' . $sixth;\n $range = range($sixth*10, $sixth*10 + 9);\n $this->$var = $this->calcAvgGeneric($range);\n }\n }", "public function get_averages() {\n $row_result = mysqli_num_rows($this->query_result);\n\n for ($i=0; $i<$row_result; $i++){\n //fetch data\n $rows = mysqli_fetch_assoc($this->query_result);\n\n //midterm arrays and midterm total\n $this->midterm_arr[$i] = $rows['midterm_score'];\n $total_midterm += $rows['midterm_score'];\n\n //final arrays and final total\n $this->final_arr[$i] = $rows['final_score'];\n $total_final += $rows['final_score'];\n }\n $this->ave_midterm = ($total_midterm/$row_result);\n $this->ave_final = ($total_final/$row_result);\n }", "public static function average(array $array)\n\t{\n\t\t// No arguments passed, lets not divide by 0\n\t\tif ( ! ($count = count($array)) > 0)\n\t\t\treturn 0;\n\n\t\treturn (array_sum($array) / $count);\n\t}", "function average($array)\r\n{\r\n $total = 0;\r\n foreach ($array as $item)\r\n {\r\n $total += $item;\r\n }\r\n return $total/count($array);\r\n}", "public function average()\n {\n if($this->mapel->isNotEmpty()){\n $total = 0;\n $hitung = 0;\n foreach($this->mapel as $mapel){\n $total += $mapel->pivot->nilai;\n $hitung++; // setiap adala pengulangan, hitung ditambah 1\n }\n\n return round($total / $hitung);\n }\n\n return 0;\n }", "public function averageRating()\n {\n return Cache::remember(\n CacheKeys::averageRating(static::class, $this->id),\n $this->avarageRatingCacheLength,\n function () {\n $ratingsCounts = collect($this->getRatingsCounts());\n\n if ($ratingsCounts->sum() === 0) {\n return 0;\n }\n\n return round($ratingsCounts->map(function ($count, $stars) {\n return $count * $stars;\n })->sum() / $ratingsCounts->sum(), 1);\n }\n );\n }", "function average()\r\n {\r\n // Built in function to get amount of items in array\r\n $numargs = func_num_args();\r\n\r\n //Get ampunt of aruments and divide by values to calculate average\r\n $average = array_sum(func_get_args())/func_num_args();\r\n\r\n //Display Number of argumets in array and average\r\n echo \"The average of $numargs numbers must be calculated.<br/>\";\r\n echo \"Average = $average\";\r\n }", "public static function grading_average($task_id,$organizer_id){\n $grads = grading::where('task_id','=',$task_id)\n ->where('organizer_id','=',$organizer_id)\n ->get();\n $number_of_criteria = count($grads);\n if($number_of_criteria == 0){\n return \" not set \";\n }else{\n $total = $grads->sum('grade');\n\n return $average = $total/($number_of_criteria * 5);\n\n }\n\n }", "public function average()\n {\n return ( $this->sum() / count($this->dices));\n }", "public static function instance($average, $total, $confidence = 0.95){\n if(!self::$instance){\n self::$instance = new self();\n }\n if (self::$instance->confidence != $confidence) {\n self::$instance->z = self::$instance->pnorm(1 - (1 - $confidence) / 2);\n }\n self::$instance->init($average, $total, $confidence);\n return self::$instance;\n }", "public function titleForAverage() { return 'Pace'; }", "public function avg($expression1, ...$expressions) : self\n {\n $this->expr->avg(empty($expressions) ? $expression1 : func_get_args());\n\n return $this;\n }", "public function averageImages () {}", "public static function average($param){\n $average = Review::where(['active'=> 1, 'staff_id' => $param ])->whereBetween('created_at', [Carbon::now()->subMonths(1)->startOfMonth(), Carbon::now()->subMonths(1)->endOfMonth()])->get();\n $avg = collect($average);\n\n return $avg->avg('point');\n\n }" ]
[ "0.6135217", "0.5859205", "0.5766972", "0.5358206", "0.5335756", "0.51876336", "0.51783204", "0.51624787", "0.51597565", "0.5150744", "0.51288366", "0.51288366", "0.50476635", "0.5000813", "0.49851444", "0.49098685", "0.49032965", "0.48924306", "0.48786515", "0.48595878", "0.48553196", "0.48361155", "0.4818991", "0.4790648", "0.47761208", "0.4754323", "0.4730186", "0.47164205", "0.4694905", "0.46848926" ]
0.62305105
0
This is a superhacky workaround to make sure this module uses its own view helpers Neilime's library realiases all of zend's view helpers, which is great if you're only using his library However, we require access to vanilla zend view helpers so that ztbFormElement still works This type of thing is being done both here and in TwBundleFormElement.php::renderShim() method, because we call these different ways throughout the code base
protected function getElementHelper() { $elementHelper = parent::getElementHelper(); if ($elementHelper && method_exists($this->view, 'plugin')) { switch(get_class($elementHelper)) { case 'Zend\Form\View\Helper\Form': $elementHelper = $this->view->plugin('bs3_form'); break; case 'Zend\Form\View\Helper\FormButton': $elementHelper = $this->view->plugin('bs3_form_button'); break; case 'Zend\Form\View\Helper\FormCheckbox': $elementHelper = $this->view->plugin('bs3_form_checkbox'); break; case 'Zend\Form\View\Helper\FormCollection': $elementHelper = $this->view->plugin('bs3_form_collection'); break; case 'Zend\Form\View\Helper\FormElement': $elementHelper = $this->view->plugin('bs3_form_element'); break; case 'Zend\Form\View\Helper\FormElementErrors': $elementHelper = $this->view->plugin('bs3_form_element_errors'); break; case 'Zend\Form\View\Helper\FormMultiCheckbox': $elementHelper = $this->view->plugin('bs3_form_multi_checkbox'); break; case 'Zend\Form\View\Helper\FormRadio': $elementHelper = $this->view->plugin('bs3_form_radio'); break; case 'Zend\Form\View\Helper\FormRow': $elementHelper = $this->view->plugin('bs3_form_row'); break; case 'Zend\Form\View\Helper\FormLabel': $elementHelper = $this->view->plugin('bs3_label'); break; } $this->elementHelper = $elementHelper; } return $elementHelper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _initViewHelper(){\n\t\t$this->bootstrap('view');\n\t\t$viewRenderer = $this->getResource('view');\n\t\t//add the global helper directory path\n\t\t$viewRenderer->addHelperPath(APPLICATION_ROOT.'/library/Fnde/Sice/View/Helper', 'Fnde_Sice_View_Helper_');\n\t\t\n\t}", "protected function getEscapeHtmlAttrHelper(){\n\t\tif($this->escapeHtmlAttrHelper)return $this->escapeHtmlAttrHelper;\n\t\tif(method_exists($this->view, 'plugin'))$this->escapeHtmlAttrHelper = $this->view->plugin('escapehtmlattr');\n\t\tif(!$this->escapeHtmlAttrHelper instanceof \\Zend\\View\\Helper\\EscapeHtmlAttr)$this->escapeHtmlAttrHelper = new \\Zend\\View\\Helper\\EscapeHtmlAttr();\n\t\treturn $this->escapeHtmlAttrHelper;\n\t}", "public function getClassName(){return \"Core.UI.Render.RenderHelper\";}", "public function getViewHelpers()\n {\n return [\n 'aliases' => [\n 'crudTable' => Helper\\CrudViewHelper::class,\n 'advCrudTable' => Helper\\AdvCrudViewHelper::class,\n 'bootstrap' => Helper\\BootstrapHelper::class,\n 'rootPage' => Helper\\RootPageHelper::class,\n 'mainMenu' => Helper\\MainMenuHelper::class,\n 'importer' => ImporterViewHelper::class,\n 'jsInit' => JSInitHelper::class,\n 'dojoLoader' => DojoLoaderViewHelper::class,\n 'addLsb' => LeftSideBarHelper::class,\n 'addNavbar' => NavbarHelper::class,\n 'fitScreenHeight' => FitScreenHeightHelper::class,\n 'rgrid' => RgridHelper::class\n ],\n 'factories' => [\n Helper\\RootPageHelper::class => RootPageHelperFactory::class,\n Helper\\CrudViewHelper::class => InvokableFactory::class,\n Helper\\AdvCrudViewHelper::class => InvokableFactory::class,\n Helper\\BootstrapHelper::class => InvokableFactory::class,\n Helper\\MainMenuHelper::class => InvokableFactory::class,\n ImporterViewHelper::class => InvokableFactory::class,\n JSInitHelper::class => JSInitHelperFactory::class,\n DojoLoaderViewHelper::class => InvokableFactory::class,\n LeftSideBarHelper::class => InvokableFactory::class,\n FitScreenHeightHelper::class => InvokableFactory::class,\n NavbarHelper::class => NavbarHelperFactory::class,\n RgridHelper::class => InvokableFactory::class\n ],\n 'abstract_factories' => [],\n ];\n }", "public function addExtHelpers()\n\t{\n\t\t# site-context-dependent JS support file for Extjs\n\t\t$render = $this->getTemplate('izomi_extjs_helpers');\n\t\treturn $render;\n\t}", "protected function _initViewHelperPaths()\n {\n \t$this->bootstrap('view');\n \t$view = $this->getResource('view');\n \t$view->addHelperPath(APPLICATION_PATH . '/../library/Application/Global/View/Helper', 'Application_Global_View_Helper_');\n }", "public function suggestViewHelper()\n {\n return 'form_multitext';\n }", "protected function getSelectElementHelper()\n {\n if ($this->selectHelper) {\n return $this->selectHelper;\n }\n\n if (method_exists($this->view, 'plugin')) {\n $this->selectHelper = $this->view->plugin('formselect');\n }\n\n return $this->selectHelper;\n }", "public function _initViewHelpers()\n {\n $this->bootstrap('layout');\n $this->_layout = $this->getResource('layout');\n $this->_view = $this->_layout->getView();\n\n $this->_view->broker('doctype')->setDoctype('XHTML1_STRICT');\n $this->_view->broker('headMeta')->appendHttpEquiv('Content-type', 'text/html;charset=utf-8');\n $this->_view->broker('headTitle')->direct('PHPplaneta.net')\n ->setSeparator(' / ');\n\n $this->_view->broker('headLink')->direct(array(\n 'rel' => 'alternate',\n 'type' => 'application/rss+xml',\n 'title' => 'PHPPlaneta glavni feed',\n 'href' => 'http://feeds.feedburner.com/PHPPlaneta'\n ));\n\n// $this->_view->addHelperPath('PPN/View/Helper','PPN_View_Helper');\n// $this->_view->addHelperPath('ZendX/JQuery/View/Helper','ZendX_JQuery_View_Helper');\n\n// $this->_view->jQuery()\n// ->addStylesheet('/static/css/smoothness/jquery-ui-1.8.1.custom.css')\n// ->setVersion('1.4.2')\n// ->enable()\n// ->setUiVersion('1.8.1')\n// ->setLocalPath('/static/js/jquery-1.4.2.min.js')\n// ->setUiLocalPath('/static/js/jquery-ui-1.8.1.custom.min.js')\n// ->uiEnable();\n $planetHelperLoader = new \\Planet\\View\\HelperLoader();\n $this->_view->broker()->getClassLoader()->registerPlugins($planetHelperLoader);\n }", "protected function _initViewHelpers()\r\n {\r\n $this->bootstrap(array('frontcontroller', 'view'));\r\n $frontController = $this->getResource('frontcontroller');\r\n $view = $this->getResource('view');\r\n\r\n // Add helper paths.\r\n $view->addHelperPath(APPLICATION_PATH . '/../library/Pandamp/Controller/Action/Helper', 'Pandamp_Controller_Action_Helper');\r\n\r\n // Set our DOCTYPE\r\n $view->doctype('XHTML1_STRICT');\r\n\r\n \r\n }", "public function getJsHelper()\n\t{\n\t\treturn $this->getResponse()->getJsHelper();\n\t}", "function zammad_fallback_form_markup()\n{\n echo '<div id=\"fallback-form\" style=\"display: none;\"></div>';\n}", "private function getElementHelper(ElementInterface $element)\n {\n $this->elemtent_helper = $element->getDefaultViewHelper();\n }", "public function getSystemHtmlForms();", "protected function fetchAdminFormElement() {\n $hp = Codendi_HTMLPurifier::instance();\n $html = '';\n $value = '';\n if ($this->hasDefaultValue()) {\n $value = $this->getDefaultValue();\n }\n $html .= '<input type=\"text\"\n value=\"'. $hp->purify($value, CODENDI_PURIFIER_CONVERT_HTML) .'\" autocomplete=\"off\" />';\n $html .= '<br />';\n $html .= '<a href=\"#\">bug #123</a><br />';\n $html .= '<a href=\"#\">bug #321</a><br />';\n $html .= '<a href=\"#\">story #10234</a>';\n return $html;\n }", "public function getViewHelperConfig() {\n\t\treturn array(\n\t\t\t'factories' => array(\n\t\t\t\t'Menu' => function($sm){\n\t\t\t\t\t$helper = new View\\Helper\\Menu($sm);\n\t\t\t\t\treturn $helper;\n\t\t\t\t},\n\t\t\t\t'Unicode' => function($sm){\n\t\t\t\t\t$helper = new View\\Helper\\Unicode($sm);\n\t\t\t\t\treturn $helper;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}", "protected function getTwig_Form_RendererService()\n {\n return $this->services['twig.form.renderer'] = new \\Symfony\\Bridge\\Twig\\Form\\TwigRenderer(new \\Symfony\\Bridge\\Twig\\Form\\TwigRendererEngine(array(0 => '@IvoryCKEditor/Form/ckeditor_widget.html.twig', 1 => 'GregwarCaptchaBundle::captcha.html.twig', 2 => 'form_div_layout.html.twig', 3 => '@MopaBootstrap/Form/fields.html.twig', 4 => 'SonataMediaBundle:Form:media_widgets.html.twig', 5 => '@SonataCore/Form/datepicker.html.twig', 6 => 'SonataUserBundle:Form:form_admin_fields.html.twig', 7 => 'LiipImagineBundle:Form:form_div_layout.html.twig'), ${($_ = isset($this->services['twig']) ? $this->services['twig'] : $this->get('twig')) && false ?: '_'}), ${($_ = isset($this->services['security.csrf.token_manager']) ? $this->services['security.csrf.token_manager'] : $this->get('security.csrf.token_manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'});\n }", "protected function _getAdditionalElementTypes()\n {\n \t$array = array();\n \t$array = parent::_getAdditionalElementTypes();\n \t\n \t$array['depends'] = Mage::getConfig()->getBlockClassName('prattski_dependentfilters/adminhtml_catalog_product_helper_form_depends');\n \t\n \treturn $array;\n \t\n }", "function renderRenderWayForm($renderWay, array $scenarios, $sTemplateViewPath, $aEnterTokenData, $surveyid)\n{\n switch ($renderWay) {\n case \"main\": //Token required, maybe Captcha required\n // Datas for the form\n $aForm = array();\n $aForm['sType'] = ($scenarios['tokenRequired']) ? 'token' : 'captcha';\n $aForm['token'] = array_key_exists('token', $aEnterTokenData) ? $aEnterTokenData['token'] : null;\n $aForm['aEnterErrors'] = $aEnterTokenData['aEnterErrors'];\n $aForm['bCaptchaEnabled'] = (isset($aEnterTokenData['bCaptchaEnabled'])) ? $aEnterTokenData['bCaptchaEnabled'] : '';\n if ($aForm['bCaptchaEnabled']) {\n Yii::app()->getController()->createAction('captcha');\n }\n $oSurvey = Survey::model()->findByPk($surveyid);\n // Rendering layout_user_forms.twig\n $thissurvey = $oSurvey->attributes;\n $thissurvey[\"aForm\"] = $aForm;\n $thissurvey['surveyUrl'] = App()->createUrl(\"/survey/index\", array(\"sid\"=>$surveyid));\n $thissurvey['include_content'] = 'userforms';\n \n \n Yii::app()->twigRenderer->renderTemplateFromFile(\"layout_user_forms.twig\", array('aSurveyInfo'=>$thissurvey), false);\n break;\n\n case \"register\": //Register new user\n // Add the event and test if done\n Yii::app()->runController(\"register/index/sid/{$surveyid}\");\n Yii::app()->end();\n break;\n\n case \"correct\": //Nothing to hold back, render survey\n default:\n break;\n }\n}", "function wsl_render_login_form(){ wsl_deprecated_function( __FUNCTION__, '2.2.3' ); return wsl_render_auth_widget(); }", "public function __construct()\n {\n $this->helpers = ['form', 'url'];\n }", "protected function renderForm()\n {\n $helper = new HelperForm();\n\n $helper->show_toolbar = false;\n $helper->table = $this->table;\n $helper->module = $this;\n $helper->default_form_language = $this->context->language->id;\n $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);\n\n $helper->identifier = $this->identifier;\n $helper->submit_action = 'submitAutologinbackofficeModule';\n $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)\n .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n\n $helper->tpl_vars = array(\n 'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */\n 'languages' => $this->context->controller->getLanguages(),\n 'id_language' => $this->context->language->id,\n );\n\n return $helper->generateForm(array($this->getConfigForm()));\n }", "public function setView(Zend_View_Interface $view = null)\n {\n if (null !== $view) {\n if (false === $view->getPluginLoader('helper')->getPaths('ZendX_JQuery_View_Helper')) {\n $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');\n }\n }\n return parent::setView($view);\n }", "public function renderView()\r\r\n {\r\r\n $helper = new Inix2HelperView($this);\r\r\n $this->setHelperDisplay($helper);\r\r\n $helper->tpl_vars = $this->tpl_view_vars;\r\r\n if (!is_null($this->base_tpl_view)) {\r\r\n $helper->base_tpl = $this->base_tpl_view;\r\r\n }\r\r\n $view = $helper->generateView();\r\r\n\r\r\n return $view;\r\r\n }", "public function render()\n {\n // Assuming, that child buttons already inserted their HTML code into 'form'/form_buttons\n\n if ($this->js_widget) {\n $fn = str_replace('ui.', '', $this->js_widget);\n $this->js(true)->_load($this->js_widget)->$fn($this->js_widget_arguments);\n }\n\n return parent::render();\n }", "public function getFunctions()\n {\n return array(\n 'draw_form' => new \\Twig_Function_Method($this, 'renderFormRow', array('is_safe' => array('html'))),\n 'form_row' => new \\Twig_Function_Method($this, 'renderFormRow', array('is_safe' => array('html'))),\n 'form_label' => new \\Twig_Function_Method($this, 'renderFieldLabel', array('is_safe' => array('html'))),\n 'form_widget' => new \\Twig_Function_Method($this, 'renderFieldWidgets', array('is_safe' => array('html'))),\n 'form_errors' => new \\Twig_Function_Method($this, 'renderFieldErrors', array('is_safe' => array('html'))),\n 'isChoiceSelected' => new \\Twig_Function_Method($this, 'isChoiceSelected', array('is_safe' => array('html')))\n );\n }", "public function render($content) {\n $element = $this->getElement();\n $view = $element->getView();\n if(null === $view) {\n return $content;\n }\n\n $description = $element->getDescription();\n $description = trim($description);\n\n if(!empty($description) && (null !== ($translator = $element->getTranslator()))) {\n $description = $translator->translate($description);\n }\n\n /*if(empty($description)) {\n return $content;\n }*/\n\n $separator = $this->getSeparator();\n $placement = $this->getPlacement();\n #$tag = $this->getTag();\n #$class = $this->getClass();\n $escape = $this->getEscape();\n #$options = $this->getOptions();\n\n if($escape) {\n $description = $view->escape($description);\n }\n\n /*if(!empty($tag)) {\n require_once 'Zend/Form/Decorator/HtmlTag.php';\n $options['tag'] = $tag;\n $decorator = new Zend_Form_Decorator_HtmlTag($options);\n $description = $decorator->render($description);\n }*/\n #$description = '<span title=\"'.$description.'\" class=\"ui-state-default ui-corner-all ui-icon ui-icon-help\">?</span>';\n $markup = '<span ';\n if(empty($description)) {\n $markup .= 'style=\"visibility:hidden\" ';\n } else {\n $markup .= 'title=\"' . $description . '\" ';\n }\n $markup .= 'class=\"ui-state-default ui-corner-all ui-icon ui-icon-help\">?</span>';\n\n switch($placement) {\n case self::PREPEND:\n return $markup . $separator . $content;\n case self::APPEND:\n default:\n return $content . $separator . $markup;\n }\n }", "function render()\n\t{\n\t\t$content = [];\n\t\tif (!$this->form) {\n\t\t\t$this->form = new HTMLForm();\n\t\t}\n\t\t$this->form->action(new URL(NULL, [\n\t\t\t'action' => 'upload',\n\t\t]));\n\t\t$this->form->formMore['class'] .= ' ' . $this->class;\n\t\t$index = Index::getInstance();\n\t\t$index->addJS('vendor/enyo/dropzone/dist/min/dropzone.min.js');\n\t\t$index->addCSS('vendor/enyo/dropzone/dist/min/dropzone.min.css');\n\n\t\tif ($this->makeFallback) {\n\t\t\t//$u = new Uploader();\n\t\t\t//$form = $u->getUploadForm();\n\t\t\t$form = new HTMLForm();\n\t\t\t$form->text('<div class=\"fallback\">');\n\t\t\t$form->file('file');\n\t\t\t$form->text('</div>');\n\t\t\t$content[] = $form->getBuffer();\n\t\t}\n\t\treturn $content;\n\t}", "public function render()\n\t{\n\t\treturn View::factory('bootstrap/form/field', array('field' => $this))\n\t\t\t->render();\n\t}", "public function getFormView()\n {\n return 'admin/modules/forms/text-module.html.twig';\n }" ]
[ "0.62889344", "0.626048", "0.6176551", "0.6156505", "0.60841537", "0.59213907", "0.5917081", "0.5875104", "0.58301526", "0.5759962", "0.5697871", "0.56726116", "0.550675", "0.54333615", "0.5423517", "0.5422679", "0.5377419", "0.5374095", "0.53678197", "0.536095", "0.53455806", "0.5326322", "0.5313375", "0.5300034", "0.52879065", "0.528158", "0.52653986", "0.52621776", "0.5258608", "0.52440554" ]
0.68199277
0
This method should return a boolean that indicates whether or not the $model passed is related to the models passed. $models can be any number of values, including a Jelly_Collection, an array of models, or a single model. The implementation should handle all forms.
public function has($model, $models);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has($model);", "public function save($models)\n\t{\n\t\t// If the given \"models\" are not an array, we'll force them into an array so\n\t\t// we can conveniently loop through them and insert all of them into the\n\t\t// related database table assigned to the associated model instance.\n\t\tif ( ! is_array($models)) $models = array($models);\n\n\t\t$current = $this->table->lists($this->model->key());\n\n\t\tforeach ($models as $attributes)\n\t\t{\n\t\t\t$class = get_class($this->model);\n\n\t\t\t// If the \"attributes\" are actually an array of the related model we'll\n\t\t\t// just use the existing instance instead of creating a fresh model\n\t\t\t// instance for the attributes. This allows for validation.\n\t\t\tif ($attributes instanceof $class)\n\t\t\t{\n\t\t\t\t$model = $attributes;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$model = $this->fresh_model($attributes);\n\t\t\t}\n\n\t\t\t// We'll need to associate the model with its parent, so we'll set the\n\t\t\t// foreign key on the model to the key of the parent model, making\n\t\t\t// sure that the two models are associated in the database.\n\t\t\t$foreign = $this->foreign_key();\n\n\t\t\t$model->$foreign = $this->base->get_key();\n\n\t\t\t$id = $model->get_key();\n\n\t\t\t$model->exists = ( ! is_null($id) and in_array($id, $current));\n\n\t\t\t// Before saving we'll force the entire model to be \"dirty\" so all of\n\t\t\t// the attributes are saved. It shouldn't affect the updates as\n\t\t\t// saving all the attributes shouldn't hurt anything.\n\t\t\t$model->original = array();\n\n\t\t\t$model->save();\n\t\t}\n\n\t\treturn true;\n\t}", "function hasModel( $a_model )\r\n\t{\r\n\t\tswitch( gettype($a_model) )\r\n\t\t{\r\n\t\t\tcase 'string':\r\n\t\t\t\treturn array_key_exists(Zoombi_String::normalize($a_model), $this->m_models);\r\n\r\n\t\t\tcase 'object':\r\n\t\t\t\tforeach( $this->m_models as $a_model )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( $a_model === $model )\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function represents($model): bool;", "protected function performValidation($model)\n {\n if (!is_array($model))\n $model = array($model);\n $valid = true;\n foreach ($model as $_model)\n if (!$_model->validate())\n $valid = false;\n return $valid;\n }", "public function sameModels($objModel1, $objModel2)\n {\n return false;\n }", "protected function hasModel()\n {\n return isset($this->model) && $this->model instanceof Model;\n }", "protected function performAjaxValidation($models)\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='object-form')\n\t\t{\n\t\t\techo CActiveForm::validate($models);\n\t\t\tYii::app()->end();\n\t\t}\n\t}", "public function isCandidate(Model $model): bool\n {\n $attributes = $model->attributes();\n\n return array_reduce(\n static::REQUIRED_ATTRIBUTES,\n function (bool $carry, string $attribute) use ($attributes): bool {\n return $carry && !empty($attributes[$attribute]);\n },\n $model instanceof Contact && !empty($attributes)\n );\n }", "public function dependsOn($model) {\n foreach ($this->depends as $dependent) {\n if ($model == $dependent) {\n return true;\n }\n }\n return false;\n }", "public function isModal($objects, $model) {\n\t\treturn \\count($objects) > 20;\n\t}", "protected function _checkElementModelCompliance($model)\n {\n return ($model instanceof BL_CustomGrid_Object);\n }", "public function isCandidate(Model $model): bool\n {\n return array_reduce(\n $this->importers,\n function (\n bool $carry,\n ModelImporterInterface $importer\n ) use ($model): bool {\n return $carry || $importer->isCandidate($model);\n },\n false\n );\n }", "public function isModal($objects, $model) {\n\t\treturn \\count ( $objects ) > 5;\n\t}", "public function canUpdate(&$model,$options = array())\n {\n if($this->authCheck($model,'update') && $this->authIsRelated($model,'project_id',$this->_authRead('Project.id')))\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "abstract public function isAllowedModel(AbstractModel $model);", "public function sameModels($objModel1, $objModel2)\n\t{\n\t\tforeach ($objModel1 as $key => $value)\n\t\t{\n\t\t\tif ($key == \"id\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tif (!is_array($objModel2->getProperty($key)))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (serialize($value) != serialize($objModel2->getProperty($key)))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($value != $objModel2->getProperty($key))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function validate($model)\n {\n // Mengumpulkan informasi validasi\n if($this->unvalidate) return true;\n $rules = $model->rules();\n if (is_array($rules)) {\n if (!empty($this->rules)) {\n $rules = array_merge($this->rules, $rules);\n }\n }\n $this->rules = $rules;\n if($rules === null) return true;\n\n // Memecah aturan validasi\n foreach ($rules as $rule) {\n if ($rule === null) continue;\n $fields = $rule[0];\n $action = $rule[1];\n $params = array_slice($rule, 2);\n \n if(preg_match('/,/i', $rule[1])) {\n foreach (explode(',', $rule[1]) as $action) {\n $this->execute($model, $action, $fields, $params);\n }\n } else {\n $this->execute($model, $action, $fields, $params);\n }\n }\n return !$model->hasError();\n }", "private function is_belongs_to($model_name){\n\n $class = get_called_class();\n if (empty($class::$belongs_to))\n return false;\n $relation = $class::$belongs_to;\n return isset($relation[$model_name]);\n }", "private function isManyToMany($tables, $tableName, $modelTable, $modelTableName)\n {\n // get table details\n $table = $tables[$tableName];\n\n $isAnyKeyOnModelTable = false;\n\n // many to many model table name\n $manyToManyTable = '';\n\n $foreignKeys = $table->foreignKeys;\n $primary = $table->primaryKey;\n\n // check if any foreign key is there from model table\n foreach ($foreignKeys as $foreignKey) {\n if ($foreignKey->foreignTable == $modelTableName) {\n $isAnyKeyOnModelTable = true;\n }\n }\n\n // if foreign key is there\n if ($isAnyKeyOnModelTable) {\n foreach ($foreignKeys as $foreignKey) {\n $foreignField = $foreignKey->foreignField;\n $foreignTableName = $foreignKey->foreignTable;\n\n // if foreign table is model table\n if ($foreignTableName == $modelTableName) {\n $foreignTable = $modelTable;\n } else {\n $foreignTable = $tables[$foreignTableName];\n // get the many to many model table name\n $manyToManyTable = $foreignTableName;\n }\n\n // if foreign field is not primary key of foreign table\n // then it can not be many to many\n if ($foreignField != $foreignTable->primaryKey) {\n return false;\n break;\n }\n\n // if foreign field is primary key of this table\n // then it can not be many to many\n if ($foreignField == $primary) {\n return false;\n }\n }\n }\n\n $modelName = model_name_from_table_name($manyToManyTable);\n\n return GeneratorFieldRelation::parseRelation('mtm,'.$modelName.','.$tableName);\n }", "function check_required_models($models, $requirements) {\n\t\t//loop through all the enabled models\n\t\tforeach ($models as $model) {\n\t\t\t//if this model has requirements\n\t\t\tif (!empty($requirements[$model])) {\n\t\t\t\t//loop though the models that are required\n\t\t\t\tforeach ($requirements[$model] as $required_model) {\n\t\t\t\t\t//if the required model isn't defined in config...\n\t\t\t\t\tif (!in_array($required_model, $models)) {\n\t\t\t\t\t\t//tell the user that they have to enable it\n\t\t\t\t\t\tthrow new Exception(\"Model {$model} requires {$required_model}. It must be enabled in config.php\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//if we got to here then all the required models are enabled\n\t\treturn;\n\t}", "public static function exists($model) {\n return class_exists(self::className($model));\n }", "abstract protected function modifyExistence(Model $model): bool;", "public function validate(): bool {\n\n if (count($this->fields) == 0 || count($this->show_fields) == 0) {\n return false;\n }\n\n\n // verify fields are part of respective models\n $lfields = $this->left_model->get_fields();\n $rfields = $this->right_model->get_fields();\n foreach ($this->fields as $field => $field_ref) {\n if (!is_string($field)) {\n return false;\n }\n if (!is_string($field_ref)) {\n return false;\n }\n\n if (!array_key_exists($field,$lfields)) {\n return false;\n }\n if (!array_key_exists($field_ref,$rfields)) {\n return false;\n }\n\n }\n\n foreach ($this->show_fields as $field) {\n if (!is_string($field)) {\n return false;\n }\n }\n\n if (empty($this->join_type)) {\n return false;\n }\n\n return true;\n }", "public function validateModel($request)\n\t{\n\t\t$hasModel = in_array('model',array_keys($request));\n\t\tif( false==$hasModel )\n\t\t{\n\t\t\t$this->setMessageState('modelIdIsMissing');\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$unitModel = new Unit_Model_UnitModel();\n\t\t\t$exists = $unitModel->exists(array('table'=>'unitModel','column'=>'id'), $request['model']);\n\t\t\tif( false==$exists )\n\t\t\t{\n\t\t\t\t$this->setMessageState('modelIdNotValid');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function exists(object $model): bool;", "public function beforeSave(Model $model, $options = array()){\n\n\t\tif (!empty($this->settings[$model->alias]['fields']) && $this->settings[$model->alias]['type'] == 'save'){\n\t\t\t//Looping through the data\n\t\t\tforeach($model->data as $row) {\n\t\t\t\tforeach($this->settings[$model->alias]['fields'] as $field) {\n\t\t\t\t\tif (isset($row[$field])){\n\t\t\t\t\t\tforeach($this->words as $word){\n\t\t\t\t\t\t\tif (preg_match(\"/$word/i\", $row[$field])) {\n\t\t\t\t\t\t\t\t$this->notify($field, $row[$field]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function checkConditions(Model $model, DataBus $data): bool;", "public function hasBelongsTo(string $modelName, string $modelRelation): bool\n {\n }", "protected abstract function isValidRecord(IModel $model);" ]
[ "0.636697", "0.6276665", "0.6191036", "0.6122709", "0.607519", "0.59474206", "0.5848741", "0.58301324", "0.5804795", "0.5793041", "0.5746667", "0.5723824", "0.55889684", "0.5575753", "0.5547826", "0.5528587", "0.5504321", "0.55033726", "0.5464467", "0.54619336", "0.53949255", "0.5380524", "0.53723055", "0.5366074", "0.5353368", "0.5329135", "0.53219247", "0.53213596", "0.5312524", "0.52983254" ]
0.7118394
0
Set table definition for sortable behavior (borrowed and modified from Sluggable in Doctrine core)
public function setTableDefinition () { $this->hasColumn( $this->getOption('versionColumn'), 'string', 10 + sfCacheTaggingToolkit::getPrecision(), array( 'notnull' => false, 'default' => self::UNSAVED_RECORD_DEFAULT_VERSION ) ); $this->addListener( new Doctrine_Template_Listener_Cachetaggable($this->getOptions()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortable_columns() {\n return array(\n 'exp' => 'exp',\n 'tags' => 'tags',\n 'display-category' => 'display-category',\n );\n}", "public function setTableDefinition()\n {\n foreach ($this->_options['columns'] as $key => $options)\n {\n $name = $options['name'];\n\n if ($options['alias'])\n {\n $name .= ' as ' . $options['alias'];\n }\n \n $this->hasColumn($name, $options['type'], $options['length'], $options['options']);\n }\n \n $this->addListener(new Doctrine_Template_Listener_Geolocatable($this->_options));\n }", "public function setTableDefinition()\n {\n $name = $this->_options['filtered_field'];\n\n if (!$this->getTable()->hasColumn($name)) {\n if ($this->_options['alias']) {\n $name .= ' AS ' . $this->_options['alias'];\n }\n\n $this->hasColumn($name, $this->_options['type'], $this->_options['length'], $this->_options['options']);\n $this->index($this->_options['filtered_field'], array('fields' => $this->_options['filtered_field']));\n }\n\n $this->addListener(new Doctrine_Template_Listener_RowSecurity($this->_options));\n }", "public function setTableDefinition()\n {\n parent::setTableDefinition();\n\n $this->hasColumn('content_id', 'integer');\n\n $this->addListener(new sfSympalContentTypeListener($this->_options));\n }", "public function setTableDefinition() {\n\t\tparent::setTableDefinition();\n\t\t\n\t\t$this->hasColumn('name', 'string', 150, array('notnull' => true, 'notblank' => true));\n\t\t$this->hasColumn('description', 'string', 500);\n\t\t$this->hasColumn('parentid', 'integer'); \n\t}", "public function setTableDefinition()\n {\n if ($this->_options['type'] == 'boolean') {\n $this->_options['length'] = 1;\n $this->_options['options'] = array('default' => false, 'notnull' => true);\n }\n \n $this->hasColumn($this->_options['name'], $this->_options['type'], $this->_options['length'], $this->_options['options']);\n\n $this->_listener = new AnulableBehaviorListener($this->_options);\n $this->addListener($this->_listener);\n }", "private function setTable()\n {\n $this->table = strtolower($this->entity);\n }", "public function testTable() {\n $view = Views::getView('test_table');\n\n $view->setDisplay('default');\n $view->initStyle();\n $view->initHandlers();\n $view->initQuery();\n $style_plugin = $view->style_plugin;\n\n // Test the buildSort() method.\n $request = new Request();\n $view->setRequest($request);\n\n $style_plugin->options['override'] = FALSE;\n\n $style_plugin->options['default'] = '';\n $this->assertTrue($style_plugin->buildSort(), 'If no order and no default order is specified, the normal sort should be used.');\n\n $style_plugin->options['default'] = 'id';\n $this->assertTrue($style_plugin->buildSort(), 'If no order but a default order is specified, the normal sort should be used.');\n\n $request->attributes->set('order', $this->randomMachineName());\n $this->assertTrue($style_plugin->buildSort(), 'If no valid field is chosen for order, the normal sort should be used.');\n\n $request->attributes->set('order', 'id');\n $this->assertTrue($style_plugin->buildSort(), 'If a valid order is specified but the table is configured to not override, the normal sort should be used.');\n\n $style_plugin->options['override'] = TRUE;\n\n $this->assertFalse($style_plugin->buildSort(), 'If a valid order is specified and the table is configured to override, the normal sort should not be used.');\n\n // Test the buildSortPost() method.\n $request = new Request();\n $view->setRequest($request);\n\n // Setup no valid default.\n $this->prepareView($view);\n $style_plugin = $view->style_plugin;\n $style_plugin->options['default'] = '';\n $style_plugin->buildSortPost();\n $this->assertNull($style_plugin->order, 'No sort order was set, when no order was specified and no default column was selected.');\n $this->assertNull($style_plugin->active, 'No sort field was set, when no order was specified and no default column was selected.');\n $view->destroy();\n\n // Setup a valid default + column specific default sort order.\n $this->prepareView($view);\n $style_plugin = $view->style_plugin;\n $style_plugin->options['default'] = 'id';\n $style_plugin->options['info']['id']['default_sort_order'] = 'desc';\n $style_plugin->buildSortPost();\n $this->assertSame('desc', $style_plugin->order, 'Fallback to the right default sort order.');\n $this->assertSame('id', $style_plugin->active, 'Fallback to the right default sort field.');\n $view->destroy();\n\n // Setup a valid default + table default sort order.\n $this->prepareView($view);\n $style_plugin = $view->style_plugin;\n $style_plugin->options['default'] = 'id';\n $style_plugin->options['info']['id']['default_sort_order'] = NULL;\n $style_plugin->options['order'] = 'asc';\n $style_plugin->buildSortPost();\n $this->assertSame('asc', $style_plugin->order, 'Fallback to the right default sort order.');\n $this->assertSame('id', $style_plugin->active, 'Fallback to the right default sort field.');\n $view->destroy();\n\n // Use an invalid field.\n $this->prepareView($view);\n $style_plugin = $view->style_plugin;\n $request->query->set('sort', 'asc');\n $random_name = $this->randomMachineName();\n $request->query->set('order', $random_name);\n $style_plugin->buildSortPost();\n $this->assertSame('asc', $style_plugin->order, 'No sort order was set, when invalid sort order was specified.');\n $this->assertNull($style_plugin->active, 'No sort field was set, when invalid sort order was specified.');\n $view->destroy();\n\n // Use an existing field, and sort both ascending and descending.\n foreach (['asc', 'desc'] as $order) {\n $this->prepareView($view);\n $style_plugin = $view->style_plugin;\n $request->query->set('sort', $order);\n $request->query->set('order', 'id');\n $style_plugin->buildSortPost();\n $this->assertSame($order, $style_plugin->order, 'Ensure the right sort order was set.');\n $this->assertSame('id', $style_plugin->active, 'Ensure the right order was set.');\n $view->destroy();\n }\n\n $view->destroy();\n\n // Excluded field to make sure its wrapping td doesn't show.\n $this->prepareView($view);\n $view->field['name']->options['exclude'] = TRUE;\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n $this->assertStringNotContainsString('views-field-name', $output, \"Excluded field's wrapper was not rendered.\");\n $view->destroy();\n\n // Render a non empty result, and ensure that the empty area handler is not\n // rendered.\n $this->executeView($view);\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n\n $this->assertStringNotContainsString('custom text', $output, 'Empty handler was not rendered on a non empty table.');\n\n // Render an empty result, and ensure that the area handler is rendered.\n $view->setDisplay('default');\n $view->executed = TRUE;\n $view->result = [];\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n\n $this->assertStringContainsString('custom text', $output, 'Empty handler got rendered on an empty table.');\n }", "public static function setSortElements() {\n $sortable = array('brand', 'model', 'available', 'min_cost', 'max_cost', 'size');\n $result = DB::select('alias')->from('specifications')->order_by('alias')->as_object()->execute();\n foreach($result AS $obj) {\n $sortable[] = $obj->alias;\n }\n conf::set('sortable', $sortable);\n }", "protected function constructTable()\n {\n $this->table = new SortableTable(\n $this->get_name(),\n array($this, 'countData'),\n array($this, 'getData'),\n $this->get_column_model()->get_default_order_column() + ($this->has_form_actions() ? 1 : 0),\n $this->get_default_row_count(),\n $this->get_column_model()->get_default_order_direction(),\n !$this->prohibits_page_selection(),\n true,\n $this->get_column_model() instanceof TableMultiColumnSortSupport\n );\n\n $this->table->setAdditionalParameters($this->get_parameters());\n }", "protected function prepareTable($table)\n\t{\n\t\t$date = JFactory::getDate();\n\t\t$user = JFactory::getUser();\n\n\t\t$table->title = htmlspecialchars_decode($table->title, ENT_QUOTES);\n\t\t$table->alias = JApplicationHelper::stringURLSafe($table->alias);\n\n\t\tif (empty($table->alias))\n\t\t{\n\t\t\t$table->alias = JApplicationHelper::stringURLSafe($table->title);\n\t\t}\n\n\t\tif (empty($table->id))\n\t\t{\n\t\t\t// Set the values\n\n\t\t\t// Set ordering to the last item if not set\n\t\t\tif (empty($table->ordering))\n\t\t\t{\n\t\t\t\t$db = $this->getDbo();\n\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t->select('MAX(ordering)')\n\t\t\t\t\t->from($db->quoteName('#__volunteers_roles'));\n\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$max = $db->loadResult();\n\n\t\t\t\t$table->ordering = $max + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Set the values\n\t\t\t\t$table->modified = $date->toSql();\n\t\t\t\t$table->modified_by = $user->id;\n\t\t\t}\n\t\t}\n\n\t\t// Increment the version number.\n\t\t$table->version++;\n\t}", "public function getSlugableColumn(): string;", "public function get_sortable_columns(){\n\t\treturn array('title' => array('title', false));\n\t}", "public function setTableDefinition()\n\t{\n\t\t$name = $this->_options['name'];\n\n\t\tif ($this->_options['alias'])\n\t\t{\n\t\t\t$name .= ' as ' . $this->_options['alias'];\n\t\t}\n\n\t\t$this->hasColumn($name, $this->_options['type'], $this->_options['length'], $this->_options['options']);\n\t}", "public function setup_table_names() {\n\t\t$wpdb='';\n\t\t$wpdb->qsot_event_zone_to_order = $wpdb->prefix . 'qsot_event_zone_to_order';\n\t}", "public function setTableDefinition()\n { \n $this->hasColumn('title as title', 'string', 100,\n array('notnull'));\n $this->hasColumn('color as color', 'string', 20,\n array('notnull', 'regexp' => '/^[a-zA-Z\\-]{3,}|#[0-9a-fA-F]{6}$/D'));\n $this->hasColumn('icon as icon', 'string', 50,\n array('notnull', 'default' => ' ', 'regexp' => '/^[a-zA-Z0-9_\\-]+\\.(jpg|gif|png)$/D')); \n }", "public function change()\n {\n // tab table\n $tag = $this->table('tag');\n \n $tag\n ->addColumn('name', 'string', ['null'=>false, 'limit'=>45])\n ->addColumn('description', 'text')\n ->addColumn('context', 'string', ['limit'=>25])\n ->addColumn('created', 'timestamp', ['null'=>false, 'default'=>'CURRENT_TIMESTAMP'])\n ->addColumn('created_by', 'integer', ['null'=>false, 'signed'=>false])\n ->addColumn('visibility', 'boolean', ['null'=>false, 'signed'=>false, 'default'=>1]);\n\n $tag->addIndex(['name', 'created_by', 'visibility'], ['unique'=>true, 'name'=>'name_creator_visible']);\n $tag->addIndex(['context']);\n\n $tag->create();\n\n\n // tag_relation table\n $tagRelation = $this->table('tag_relation', ['id'=>false, 'primary_key'=>['tag_id', 'entity_id', 'entity_type']]);\n\n $tagRelation\n ->addColumn('tag_id', 'integer', ['null'=>false])\n ->addColumn('entity_id', 'integer', ['null'=>false, 'signed'=>false])\n ->addColumn('entity_type', 'string', ['null'=>false, 'limit'=>45])\n ->addColumn('created', 'timestamp', ['null'=>false, 'default'=>'CURRENT_TIMESTAMP'])\n ->addColumn('created_by', 'integer', ['null'=>false, 'signed'=>false]);\n\n $tagRelation->addIndex(['tag_id']);\n $tagRelation->addIndex(['entity_id', 'entity_type'], ['name'=>'entity']);\n\n $tagRelation->addForeignKey('tag_id', 'tag', 'id', ['delete'=>'CASCADE', 'update'=>'NO_ACTION']);\n\n $tagRelation->create();\n }", "public function get_sortable_columns()\r\n {\r\n return array('title' => array('title', false));\r\n }", "function theme_facetapi_sort_settings_table($variables) {\n $output = '';\n\n // Gets variales for code readability.\n $searcher = $variables['element']['#facetapi']['adapter']->getSearcher();\n\n $header = array(\n 'active' => array(),\n 'label' => array('data' => t('Sort')),\n 'order' => array('data' => t('Order')),\n 'weight' => array('data' => t('Weight')),\n );\n\n // Builds field options.\n $rows = array();\n $sort_info = $variables['element']['#facetapi']['sort_info'];\n foreach ($sort_info as $sort_name => $sort) {\n $rows[$sort_name] = array(\n 'class' => array('draggable'),\n 'data' => array(\n drupal_render($variables['element']['active_sorts'][$sort_name]),\n check_plain($sort['label']) . \"<div class='description'>\" . filter_xss($sort['description']) . '</div>',\n drupal_render($variables['element']['sort_order'][$sort_name]),\n drupal_render($variables['element']['sort_weight'][$sort_name]),\n ),\n );\n }\n\n drupal_add_tabledrag('facetapi-sort-settings', 'order', 'sibling', 'facetapi-sort-weight');\n $output .= drupal_render_children($variables['element']);\n $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'facetapi-sort-settings')));\n\n return $output;\n}", "public function get_sortable_columns()\n {\n }", "function hs_column_register_sortable($columns) {\n $columns['ID'] = 'ID';\n\t\t$columns['impressions'] = 'impressions';\n\t\t$columns['clicks'] = 'clicks';\n $columns['ctr'] = 'ctr';\n\t\treturn $columns;\n\t}", "public static function set_table(){\n }", "static public function setInlineSorting($table, $column){\n \n global $TCA;\n \n $TCA[$table]['columns'][$column]['config']['foreign_sortby'] = 'sorting';\n $TCA[$table]['columns'][$column]['config']['appearance']['useSortable'] = '1';\n\n\t\t\n\t}", "public static function setSortElements() {\n $sortable = ['brand', 'model', 'available', 'min_cost', 'max_cost'];\n $result = DB::select('alias')->from('specifications')->where('status', '=', 1)->order_by('alias')->find_all();\n foreach($result AS $obj) {\n $sortable[] = $obj->alias;\n }\n Config::set('sortable', $sortable);\n }", "protected function _setupTableName(){\n\n if( !$this->_name ){\n\t\t\t$name = str_replace( \"_Model_DbTable\", \"\", get_class( $this ) );\n\t\t\tlist( $module, $item ) = explode( \"_\", $name );\n\t\t\tif( preg_match_all( '|[A-Z]+([a-z])*|', $item, $matches ) &&\n\t\t\t\tcount( $matches[ 0 ] > 1 ) ){\n\t\t\t\t$item = implode( \"_\", $matches[ 0 ] );\n\t\t\t\tif( \"R\" != end( $matches[ 0 ] ) ){\n\t\t\t\t\t$item = Go_Misc::plural( $item ); \n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_name = strtolower( $module . \"_\" . $item );\n\n }\n parent::_setupTableName();\n }", "protected function _setupTableName() {\n $this->_name = Zend_Registry::get('config')->resources->db->prefix . 'items';\n parent::_setupTableName();\n }", "function get_sortable_columns() {\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'title'\t\t\t=>\tarray( 'title', true ),\n\t\t\t\t'post_type'\t\t=>\tarray( 'post_type', false )\n\t\t\t);\n\t\t\t\n\t\t}", "public function modifyTable()\n {\n $table = $this->getTable();\n\n if (!$table->hasColumn($this->getParameter('rank_column'))) {\n $table->addColumn(array(\n 'name' => $this->getParameter('rank_column'),\n 'type' => 'INTEGER'\n ));\n }\n\n if ($this->useScope()) {\n if (!$this->hasMultipleScopes() && !$table->hasColumn($this->getParameter('scope_column'))) {\n $table->addColumn(array(\n 'name' => $this->getParameter('scope_column'),\n 'type' => 'INTEGER'\n ));\n }\n\n $scopes = $this->getScopes();\n if (0 === count($scopes)) {\n throw new \\InvalidArgumentException(sprintf(\n 'The sortable behavior in `%s` needs a `scope_column` parameter.',\n $this->getTable()->getName()\n ));\n }\n }\n }", "public function __construct()\n {\n $this->_table = 'lesson_tag_map';\n parent::__construct();\n }", "protected function _setupTableName() {\n $this->_name = Zend_Registry::get('config')->resources->db->prefix . 'feeds';\n parent::_setupTableName();\n }" ]
[ "0.6204123", "0.6121825", "0.6098608", "0.59262246", "0.58631074", "0.585984", "0.5858759", "0.5795856", "0.5729048", "0.5718695", "0.5602794", "0.55990326", "0.55870056", "0.55856746", "0.5577079", "0.5555646", "0.5551958", "0.55305344", "0.5523684", "0.55203503", "0.55111533", "0.5507791", "0.5497773", "0.5487386", "0.5475778", "0.5474677", "0.5459833", "0.5455735", "0.5399379", "0.53710264" ]
0.65464497
0
Retrieves object's version tags with once added. State locking stolen from Doctrine_Record::toArray(true|false).
public function getCacheTags ($deep = true) { if ( $this->_state == Doctrine_Record::STATE_LOCKED || $this->_state == Doctrine_Record::STATE_TLOCKED ) { return array(); } $tagHandler = null; try { $tagHandler = $this->getContentTagHandler(); } catch (sfCacheDisabledException $e) { return array(); } $stateBeforeLock = $this->_state; $invoker = $this->getInvoker(); $this->_state = $invoker->exists() ? Doctrine_Record::STATE_LOCKED : Doctrine_Record::STATE_TLOCKED; $invokerTags = array( $this->obtainTagName() => $this->obtainObjectVersion(), ); $tagHandler->addContentTags($invokerTags, $this->getInvokerNamespace()); if ($deep) { foreach ($invoker->getReferences() as $reference) { if ($reference instanceof Doctrine_Null) { continue; } if ($reference instanceof Doctrine_Record && ! $reference->exists()) { continue; } $table = $reference->getTable(); if (! $table->hasTemplate(sfCacheTaggingToolkit::TEMPLATE_NAME)) { continue; } $tagHandler->addContentTags( $reference->getCacheTags($deep), $this->getInvokerNamespace() ); } } /** * @todo mistical code (switching added tags with fetch on the fly) * maybe copy & past from toArray()? */ $tags = $tagHandler->getContentTags($this->getInvokerNamespace()); $tagHandler->removeContentTags($this->getInvokerNamespace()); $this->_state = $stateBeforeLock; return $tags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTags()\n {\n // Return cached values\n if ($this->tags) {\n return $this->tags;\n }\n\n // Get tag strings\n $repo = $this->getRepository();\n if ($this->getProject()->getFetchTags()) {\n // Fetch remote tags from origin first\n $repo->run('fetch', ['--tags']);\n }\n $result = $repo->run('tag');\n $tags = preg_split('~\\R~u', $result);\n $tags = array_filter($tags);\n\n // Objectify tags\n $this->tags = [];\n foreach ($tags as $tag) {\n // Skip invalid tags\n if (Version::parse($tag)) {\n $version = new Version($tag);\n $this->tags[$version->getValue()] = $version;\n }\n }\n return $this->tags;\n }", "function getVersions() {\n\t\t$q = Doctrine_Query::create();\n\t\t$q->from(\"XTableVersion INDEXBY table_name\");\n\t\t\n\t\t$data = $q->fetchArray();\n\t\t\n\t\treturn $data;\n\t}", "public function getVersions() {\n \tif (empty($this->versions)) {\n\t tx_pttools_assert::isTrue($this->isVersionable(), array('message' => 'Versioning is not enabled for this class'));\n\n\t $collectionClassname = $this->getCollectionClassName();\n\t $this->versions = new $collectionClassname('versions', array('uid' => $this->getOid()));\n\t // find current object and select it\n\t foreach ($this->versions as $key => $version) { /* @var $translation tx_tcaobject_object */\n\t \tif ($version->get_uid() == $this->get_uid()) {\n\t \t\t$this->versions->set_selectedId($key);\n\t \t}\n\t }\n\t if ($this->versions->get_selectedId() == 0) {\n\t \tthrow new tx_pttools_exception('No selected id found. (There should be one!)');\n\t }\n \t}\n return $this->versions;\n }", "public function getAllTag() {\n $arrConf = GFunc::getConf('SearchV2');\n $strCacheKey = $arrConf['properties']['searchTagCache'];\n \n $objRedis = IoCload('utils\\\\KsarchRedis');\n $arrTag = GFunc::cacheZgetOrigin($objRedis, $strCacheKey);\n if($arrTag === false) {\n $objModel = IoCload(\"models\\\\SearchModel\");\n $arrTag = $objModel->getTag();\n if (empty($arrTag)) {\n return $arrTag;\n }\n \n //set cache content and cache time is 15mins\n GFunc::cacheZsetOrigin($objRedis, $strCacheKey, $arrTag, GFunc::getCacheTime('15mins'));\n }\n \n return $arrTag;\n }", "function getTags() {\n global $tags;\n\n $list = array();\n foreach ($tags->db as $key=>$fields) {\n $tag = new Tag($key);\n array_push($list, $tag);\n }\n return $list;\n}", "function etbx_registry_versions_load() {\n $query = db_select(ENTITY_TOOLBOX_DB__VERSIONS, 'r')\n ->fields('r', array())\n //@todo use groupBy rather than the regrouping below.\n ->execute();\n\n $results = array();\n while (($result = $query->fetchAssoc())) {\n $results[$result['entity_type']][$result['version']] = $result;\n }\n\n return $results;\n}", "public function getCollectionTags ()\n {\n if (! sfConfig::get('sf_cache')) return array();\n\n $name = sfCacheTaggingToolkit::obtainCollectionName($this->getTable());\n $version = sfCacheTaggingToolkit::obtainCollectionVersion($name);\n\n return array($name => $version);\n }", "public function tags() {\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('tags', 'core'));\n }", "function getVersion($table) {\n\t\t$info = Doctrine::getTable(\"XTableVersion\")->find($table);\n\n\t\tif (!is_object($info)) {\n\t\t\t$info = new XTableVersion();\n\t\t\t$info->table_name = $table;\n\t\t\t$info->version = 1;\n\t\t\t$info->last_change = currentMysqlDatetime();\n\t\t\t$info->save();\n\t\t\treturn $info->toArray();\n\t\t} else {\n\t\t\treturn $info->toArray();\n\t\t}\n\t}", "function etbx_versions_registry_load() {\n $query = db_select(ENTITY_TOOLBOX_DB__VERSIONS, 'r')\n ->fields('r', array())\n ->execute();\n $results = array();\n while (($result = $query->fetchAssoc())) {\n $results[$result['entity_type']][$result['version']] = $result;\n }\n\n return $results;\n}", "private function __getTags() {\n $sql = 'SELECT \"tag\" FROM \"tag\"';\n $res = $this->__execSql($sql);\n return array_map(function($v) { return $v['tag']; }, $res);\n }", "public function obtainObjectVersion ()\n {\n return $this->getInvoker()->get($this->getOption('versionColumn'));\n }", "public function getVersions();", "public function getVersions();", "public function getVersions();", "public function getVersions(){\n\t\n\t\tif( empty($this->_allversions) ){\n\t\t\n\t\t\t$query = \"SELECT a.* \"\n\t\t\t.\"FROM #__zbrochure_client_versions AS a \"\n\t\t\t.\"WHERE a.client_id = \".$this->_id\n\t\t\t;\n\t\t\t\t\t\n\t\t\t$this->_db->setQuery( $query );\n\t\t\t$this->_allversions = $this->_db->loadObjectlist();\n\t\t\n\t\t}\n\t\t\n\t\treturn $this->_allversions;\n\t\t\n\t}", "public function getTags(): array;", "public function getTags(): array;", "function version($version, $asObject = true)\n {\n if ($asObject) {\n global $eZContentObjectVersionCache;\n\n if (!isset($eZContentObjectVersionCache)) // prevent PHP warning below\n {\n $eZContentObjectVersionCache = array();\n }\n\n if (array_key_exists($this->ID, $eZContentObjectVersionCache) &&\n array_key_exists($version, $eZContentObjectVersionCache[$this->ID])\n ) {\n return $eZContentObjectVersionCache[$this->ID][$version];\n } else {\n $eZContentObjectVersionCache[$this->ID][$version] = eZContentObjectVersion::fetchVersion($version, $this->ID, $asObject);\n\n return $eZContentObjectVersionCache[$this->ID][$version];\n }\n } else {\n return eZContentObjectVersion::fetchVersion($version, $this->ID, $asObject);\n }\n }", "private function getTags()\n\t{\n\t\t$db = Database::instance();\n\t\t$result = $db->query(Database::SELECT, 'SELECT tagId, tagDesc FROM tags')->as_array();\n\t\treturn $result;\n\t}", "function sqlToAGBVersionObjectArray($ergebnis){\n\t\t$agbVersions = array();\n\t\twhile($row = mysqli_fetch_object($ergebnis))\n\t\t{\n\t\t\t$agbVersionId = $row->agb_version_id;\n\t\t\t$agbSourceId = $row->agb_source_id;\n\t\t\t$text = $row->text; //preg_replace('/\\s+/', '', $row->text); //delete whitespaces\n\t\t\t$version = $row->version;\n\t\t\t$publishedAt = $row->published_at;\n\t\t\t\n\t\t\t$agbVersions[] = new AGBVersion($agbVersionId, $agbSourceId, $text, $version, $publishedAt);\n\t\t}\n\t\treturn $agbVersions;\n\t}", "public function getTags()\n {\n if (!$this->_extendedBackend) {\n Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);\n }\n if (!($this->_backendCapabilities['tags'])) {\n Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);\n }\n return $this->_backend->getTags();\n }", "public function getAllTags()\n {\n return $this->cache->get(\n self::ALL_TAGS_CACHE_KEY,\n array($this,'getAllTagsFromDatabase')\n );\n }", "public function getTags(){}", "public static function getUpdateTags()\n {\n if (!isset(self::$_updateTagsCache)) {\n self::$_updateTagsCache = Kwf_Registry::get('config')->server->updateTags->toArray();\n foreach (Kwf_Component_Abstract::getComponentClasses() as $class) {\n if (Kwc_Abstract::hasSetting($class, 'updateTags')) {\n self::$_updateTagsCache = array_unique(array_merge(self::$_updateTagsCache, Kwc_Abstract::getSetting($class, 'updateTags')));\n }\n }\n }\n return self::$_updateTagsCache;\n }", "public function getTags()\n {\n return $this->getDb()->fetchAll(\"SELECT DISTINCT (id) FROM cache_tags\");\n }", "protected function fetchTags()\n {\n $tags = array();\n\n try {\n $response = $this->github->read('git/refs/tags?per_page=100');\n } catch (\\RuntimeException $e) {\n if ($e->getCode() == 404) {\n return $tags;\n } else {\n throw $e;\n }\n }\n\n foreach ($response as $info) {\n if (!preg_match('/^refs\\/tags\\/(\\d\\d\\d\\d-\\d\\d-\\d\\d)$/', $info['ref'], $m)) continue;\n $tags[$m[1]] = $info['object']['sha'];\n }\n\n krsort($tags);\n return $tags;\n }", "public function listObjectVersions() {\n if (!$this->bucket) {\n throw new \\Exception('bucket must be defined');\n }\n\n $result = $this->client->listObjectVersions([\n 'Bucket' => $this->bucket, // REQUIRED\n ]);\n\n return $result;\n }", "public function getTags()\n{\n\treturn $this->tags;\n}", "public function getVersion() : ObjectVersion\n {\n return $this->version;\n }" ]
[ "0.6917368", "0.63019204", "0.6167337", "0.60079443", "0.6005293", "0.5983998", "0.5923872", "0.5883875", "0.58752877", "0.5824663", "0.5758113", "0.57302916", "0.5703434", "0.5703434", "0.5703434", "0.56543803", "0.56011915", "0.56011915", "0.55780256", "0.55743986", "0.5573172", "0.5561242", "0.554572", "0.5544456", "0.55384225", "0.5530609", "0.55273193", "0.55196774", "0.55115926", "0.55055404" ]
0.6417004
1
Retrieves collections tags version or initialize new version if nothing was before
public function obtainCollectionVersion () { try { $version = sfCacheTaggingToolkit::obtainCollectionVersion( $this->obtainCollectionName() ); return $version; } catch (sfCacheDisabledException $e) { } return self::UNSAVED_RECORD_DEFAULT_VERSION; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVersions() {\n \tif (empty($this->versions)) {\n\t tx_pttools_assert::isTrue($this->isVersionable(), array('message' => 'Versioning is not enabled for this class'));\n\n\t $collectionClassname = $this->getCollectionClassName();\n\t $this->versions = new $collectionClassname('versions', array('uid' => $this->getOid()));\n\t // find current object and select it\n\t foreach ($this->versions as $key => $version) { /* @var $translation tx_tcaobject_object */\n\t \tif ($version->get_uid() == $this->get_uid()) {\n\t \t\t$this->versions->set_selectedId($key);\n\t \t}\n\t }\n\t if ($this->versions->get_selectedId() == 0) {\n\t \tthrow new tx_pttools_exception('No selected id found. (There should be one!)');\n\t }\n \t}\n return $this->versions;\n }", "public function getCollectionTags ()\n {\n return array(\n $this->obtainCollectionName() => $this->obtainCollectionVersion()\n );\n }", "public function getCollectionTags ()\n {\n if (! sfConfig::get('sf_cache')) return array();\n\n $name = sfCacheTaggingToolkit::obtainCollectionName($this->getTable());\n $version = sfCacheTaggingToolkit::obtainCollectionVersion($name);\n\n return array($name => $version);\n }", "private function setLatestVer(){\n if (!$this->cache->get('plugin_list_version')) {\n $plugin_list = $this->getPluginXML();\n if ($plugin_list !== FALSE) {\n $ver_arr = array();\n foreach ($plugin_list->plugin as $xml) {\n if($xml->filename && $xml->version) $ver_arr[strval($xml->filename)] = strval($xml->version);\n }\n }else{\n $ver_arr = FALSE;\n }\n ($this->load_config()->pagecache_time == 0) ? $cache_time = 1 : $cache_time = $this->load_config()->pagecache_time; \n $this->cache->save('plugin_list_version', $ver_arr, ($cache_time * 60));\n unset($plugin_list, $ver_arr, $cache_time);\n }\n return $this->cache->get('plugin_list_version');\n }", "public function getVersions();", "public function getVersions();", "public function getVersions();", "public static function existingTags(): Collection\n {\n $model = TaggingUtility::taggedModelString();\n\n return $model::query()\n ->distinct()\n ->join('tagging_tags', 'tag_slug', '=', 'tagging_tags.slug')\n ->where('taggable_type', '=', (new static)->getMorphClass())\n ->orderBy('tag_slug', 'ASC')\n ->get(['tag_slug as slug', 'tag_name as name', 'tagging_tags.count as count']);\n }", "public static function getVersionSpecificCollection( $name )\n {\n return self::getVersionSpecificValueByTpl( $name, self::COLLECTION_TPL );\n }", "public function getVersions($reset = FALSE);", "public function get_version() {\r\n\t\treturn $this->new_version;\r\n\t}", "public function getTags()\n {\n // Return cached values\n if ($this->tags) {\n return $this->tags;\n }\n\n // Get tag strings\n $repo = $this->getRepository();\n if ($this->getProject()->getFetchTags()) {\n // Fetch remote tags from origin first\n $repo->run('fetch', ['--tags']);\n }\n $result = $repo->run('tag');\n $tags = preg_split('~\\R~u', $result);\n $tags = array_filter($tags);\n\n // Objectify tags\n $this->tags = [];\n foreach ($tags as $tag) {\n // Skip invalid tags\n if (Version::parse($tag)) {\n $version = new Version($tag);\n $this->tags[$version->getValue()] = $version;\n }\n }\n return $this->tags;\n }", "public function getVersion() {\n\t\tif (!isset($this->_version)) {\n\t\t\treturn $this->_getVersion();\n\t\t} else {\n\t\t\treturn $this->_version;\n\t\t}\n\t}", "function _previous_db_version() {\n\tstatic $cache;\n\treturn isset( $cache ) ? $cache : $cache = \\get_option( 'the_seo_framework_upgraded_db_version', '0' );\n}", "function getversion ()\n {\n return $this->version;\n }", "public function fixTags()\n {\n $tags = $this->fetchTags();\n\n if (count($tags)) {\n $newest = reset($tags);\n } else {\n $newest = '';\n }\n\n $changes = $this->fetchInfoTxtChanges($newest);\n\n foreach ($changes as $version => $sha) {\n if (!isset($tags[$version])) {\n $this->setTag($sha, $version);\n }\n }\n }", "function blog_version() {\n\n\t// Create a new app instance.\n\t$App = new App;\n\n\treturn $App->app_version;\n\n}", "public function getCurrentVersion();", "public function getCurrentVersion()\n {\n $json = $this->getJson();\n if (!isset($json->version)) {\n return null;\n }\n \n return new Version($json->version);\n }", "public function getVersion() {\r\n\t\t$vers = array ();\r\n\t\t$vers[] = 'MediaWiki ' . SpecialVersion::getVersion();\r\n\t\t$vers[] = __CLASS__ . ': $Id: ApiMain.php 24494 2007-07-31 17:53:37Z yurik $';\r\n\t\t$vers[] = ApiBase :: getBaseVersion();\r\n\t\t$vers[] = ApiFormatBase :: getBaseVersion();\r\n\t\t$vers[] = ApiQueryBase :: getBaseVersion();\r\n\t\t$vers[] = ApiFormatFeedWrapper :: getVersion(); // not accessible with format=xxx\r\n\t\treturn $vers;\r\n\t}", "abstract function getApiVersion();", "protected function _prepareCollection()\n {\n /* var $collection Gri_Cms_Model_Mysql4_Revision_Collection */\n $collection = Mage::getModel('gri_cms/page_revision')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVersionFilter($this->getVersion())\n ->addUserColumn()\n ->addUserNameColumn();\n\n // Commented this bc now revision are shown in scope of version and not page.\n // So if user has permission to load this version he\n // has permission to see all its versions\n //->addVisibilityFilter(Mage::getSingleton('admin/session')->getUser()->getId(),\n // Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel());\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();" ]
[ "0.5921259", "0.58406454", "0.57311654", "0.55599624", "0.55025625", "0.55025625", "0.55025625", "0.5458317", "0.5407455", "0.5331", "0.5239339", "0.5228346", "0.522023", "0.5205123", "0.5204917", "0.5199154", "0.51828486", "0.5154611", "0.5138895", "0.51388496", "0.51378405", "0.5122672", "0.51159805", "0.51159805", "0.51159805", "0.51159805", "0.51159805", "0.51159805", "0.51159805", "0.51159805" ]
0.714697
0
Retrieves object unique tag name based on its class
public function obtainTagName () { $invoker = $this->getInvoker(); /** * Allow to generete tags for new objects - it could already have required * values to generate valid key * * One difference, getData could returns (objects) inside array */ $objectArray = $invoker->isNew() ? $invoker->getData() : $invoker->toArray(false); return sfCacheTaggingToolkit::obtainTagName($this, $objectArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTagClassName(): string\n {\n return Tag::class;\n }", "function get_class_name();", "public function getTaggableType()\n {\n return strtolower(substr(strrchr(get_class($this), '\\\\'), 1));\n }", "protected function name()\n {\n return get_class();\n }", "public function getTagName();", "public function getName() {\n\t\treturn $this->tag->getId();\n\t}", "protected function __get_name()\n\t{\n\t\treturn $this->element->tagName;\n\t}", "public function getTagName() {\n\t\t$tagName = $this->tsValue('tagName');\n\t\tif ($tagName === NULL) {\n\t\t\t$tagName = 'div';\n\t\t}\n\t\treturn $tagName;\n\t}", "public function getTagName() {\n if ($this->isTag()) {\n $this->getRefName();\n } else {\n return NULL;\n }\n }", "public function getClassName(): string\n {\n return $this->vo->class_name;\n }", "public function getClassName($object);", "public function getTag()\n {\n return $this->get(self::TAG);\n }", "public function getTag();", "public function __toString() {\n \t$registryIdentifier = uniqid('tcaobject_'.$this->getClassName().'_', true);\n \ttx_pttools_registry::getInstance()->register($registryIdentifier, $this);\n \treturn $registryIdentifier;\n }", "function name()\n {\n return get_class($this);\n }", "private function getTypeName()\n {\n $split = explode(\"\\\\\", $this->className);\n return array_values(array_slice($split, -1))[0];\n }", "function _getObjectClassName(){\n\t\treturn String4::ToObject($this->getReferredTable())->singularize()->camelize()->toString(); // \"galleries\" -> \"Gallery\"\n\t}", "public function getTagName()\n {\n return $this->tag_name;\n }", "protected function getClassTagName($tagName)\n {\n if (null !== $tagName) {\n return $tagName;\n }\n\n if ($this->refClass->hasAnnotation('XmlTag')) {\n return $this->refClass->getAnnotation('XmlTag')->getTagName();\n }\n\n $className = $this->refClass->getName();\n return substr($className, strrpos($className, '\\\\') + 1);\n }", "protected function getClassName() {\r\n\t\tif (empty($this->tcaObjectName)) {\r\n\t\t\t// assuming that \"fooCollection\" contains \"foo\" objects\n\t\t\t$this->tcaObjectName = str_replace('Collection', '', get_class($this));\r\n\t\t}\r\n\t\treturn $this->tcaObjectName;\r\n\t}", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public function getClassName();", "public abstract static function object_name($object);", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName()\n {\n return substr(get_class($this), 18);\n }", "static public function getClass() {\n return self::getMetadata()->name;\n }", "public function getTag()\n {\n return isset($this->tag) ? $this->tag : '';\n }" ]
[ "0.70728064", "0.6841235", "0.66804624", "0.6675016", "0.6651523", "0.660057", "0.65892863", "0.6538043", "0.6522414", "0.650231", "0.6492819", "0.649062", "0.6426563", "0.64059275", "0.63790613", "0.6366712", "0.6361063", "0.63577044", "0.6349883", "0.6346622", "0.633131", "0.633131", "0.633131", "0.633131", "0.6322332", "0.62976295", "0.62976295", "0.62951535", "0.62909037", "0.6272373" ]
0.7637756
0
Fetches a version of the object
public function obtainObjectVersion () { return $this->getInvoker()->get($this->getOption('versionColumn')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _fetchVersion()\n {\n $key = $this->_prefix\n . \"/model\"\n . \"/{$this->_model->model_name}\"\n . \"/data_version\";\n \n $result = $this->_cache->fetch($key);\n return $result;\n }", "function version($version, $asObject = true)\n {\n if ($asObject) {\n global $eZContentObjectVersionCache;\n\n if (!isset($eZContentObjectVersionCache)) // prevent PHP warning below\n {\n $eZContentObjectVersionCache = array();\n }\n\n if (array_key_exists($this->ID, $eZContentObjectVersionCache) &&\n array_key_exists($version, $eZContentObjectVersionCache[$this->ID])\n ) {\n return $eZContentObjectVersionCache[$this->ID][$version];\n } else {\n $eZContentObjectVersionCache[$this->ID][$version] = eZContentObjectVersion::fetchVersion($version, $this->ID, $asObject);\n\n return $eZContentObjectVersionCache[$this->ID][$version];\n }\n } else {\n return eZContentObjectVersion::fetchVersion($version, $this->ID, $asObject);\n }\n }", "private function fetch()\n {\n return $this->client->get(\n sprintf(\n '%s/%s/%d.x',\n $this->releaseUrl,\n $this->projectName,\n $this->version\n )\n );\n }", "public function getVersion(): GetVersion\n {\n return new GetVersion($this->_provider);\n }", "public function getVersion()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('version', 1)->result();\n }", "public function getVersion() : ObjectVersion\n {\n return $this->version;\n }", "function currentVersion($asObject = true)\n {\n return eZContentObjectVersion::fetchVersion($this->attribute(\"current_version\"), $this->ID, $asObject);\n }", "function getversion ()\n {\n return $this->version;\n }", "public function versionObject( $id );", "public function refreshVersion() {\n\t\treturn $this->_getVersion();\n\t}", "abstract public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "static function fetch_version_info() {\n $result = new stdClass();\n try {\n list ($status, $headers, $body) = remote::do_request(upgrade_checker::CHECK_URL);\n if ($status == \"HTTP/1.1 200 OK\") {\n $result->status = \"success\";\n foreach (explode(\"\\n\", $body) as $line) {\n if ($line) {\n list($key, $val) = explode(\"=\", $line, 2);\n $result->data[$key] = $val;\n }\n }\n } else {\n $result->status = \"error\";\n }\n } catch (Exception $e) {\n Kohana_Log::add(\"error\",\n sprintf(\"%s in %s at line %s:\\n%s\", $e->getMessage(), $e->getFile(),\n $e->getLine(), $e->getTraceAsString()));\n }\n $result->timestamp = time();\n Cache::instance()->set(\"upgrade_checker_version_info\", serialize($result),\n array(\"upgrade\"), 86400 * 365);\n }", "public function getVersion()\n {\n return $this->get('/version');\n }", "public function fetchAndRememberCdnVersion(){\n\n if($this->property('caching')){\n \t\t$version = Cache::remember('CDN_version', 60, function(){\n \t\t return @file_get_contents($this->property('versionserver').'api/version/'.$this->property('domain'));\n \t\t});\n }\n else{\n $version = @file_get_contents($this->property('versionserver').'api/version/'.$this->property('domain'));\n }\n\n\t\tif($this->property('debug')){\n\t\t\t$this->page['version'] = $version;\n\t\t}\n\n\t\treturn $version;\n\t}", "public function getVersion() {}", "public function getObject();", "public function getObject();", "public function get_version()\n {\n return $this->_run('get_version');\n }" ]
[ "0.74507535", "0.6871191", "0.66744745", "0.66549754", "0.659522", "0.65257496", "0.6515472", "0.6489972", "0.6454935", "0.6409285", "0.6321617", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6266352", "0.6233518", "0.62125206", "0.6207258", "0.61597747", "0.61430144", "0.61430144", "0.61387235" ]
0.78215766
0
following are code adapted from Custom Post Type Category Pagination Fix by jdantzer
function fix_category_pagination($qs){ if(isset($qs['category_name']) && isset($qs['paged'])){ $qs['post_type'] = get_post_types($args = array( 'public' => true, '_builtin' => false )); array_push($qs['post_type'],'post'); } return $qs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fix_category_pagination($qs){\n\tif(isset($qs['category_name']) && isset($qs['paged'])){\n\t\t$qs['post_type'] = get_post_types($args = array(\n\t\t\t'public' => true,\n\t\t\t'_builtin' => false\n\t\t));\n\t\tarray_push($qs['post_type'],'post');\n\t}\n\treturn $qs;\n}", "function custom_post_type()\n{\n\n /*\n function paginate() {\n global $wp_query, $wp_rewrite;\n $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;\n $pagination = array(\n 'base' => @add_query_arg('page','%#%'),\n 'format' => '',\n 'total' => $wp_query->max_num_pages,\n 'current' => $current,\n 'show_all' => true,\n 'type' => 'plain'\n );\n if ( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );\n if ( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) );\n echo paginate_links( $pagination );\n }\n */\n\n function paginate($pages = '', $range = 4)\n {\n $showitems = ($range * 2) + 1;\n\n global $paged;\n if (empty($paged)) {\n $paged = 1;\n }\n\n if ($pages == '') {\n global $wp_query;\n $pages = $wp_query->max_num_pages;\n if (!$pages) {\n $pages = 1;\n }\n }\n\n $template_link = get_template_directory_uri();\n $previous_img = '<img src=\"'.$template_link.'/images/pager/previous.png\">';\n $next_img = '<img src=\"'.$template_link.'/images/pager/next.png\">';\n\n if (1 != $pages) {\n echo '<div class=\"pagination\"><ul>';\n\n // si on est a la page 2 on affiche fast first page\n /*\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<li class=\\\"previous-fast\\\"><a href='\".get_pagenum_link(1).\"'>$previous_img $previous_img</a></li>\";\n */\n\n // si on est a la page superieur a 1\n if ($paged > 0 && $showitems < $pages) {\n echo \"<li class=\\\"previous\\\"><a href='\".get_pagenum_link($paged - 1).\"'>$previous_img</a></li>\";\n }\n\n // pour toute les pages i = le nombre de pages\n for ($i = 1; $i <= $pages; $i++) {\n if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {\n echo ($paged == $i) ? '<li class=\"active\"><a >'.$i.'</a></li>' : \"<li class=\\\"inactive\\\"><a href='\".get_pagenum_link($i).\"' >\".$i.'</a></li>';\n }\n }\n\n // si il y as des pages apres on affiche next page\n if ($paged < $pages && $showitems < $pages) {\n echo '<li class=\"next\"><a href=\"'.get_pagenum_link($paged + 1).\"\\\">$next_img</a></li>\";\n }\n\n // si on est a la page on affiche fast last page\n /*\n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<li class=\\\"next-fast\\\"><a href='\".get_pagenum_link($pages).\"'>$next_img $next_img</a></li>\";\n */\n\n echo \"</div>\\n\";\n }\n }\n\n /* photos */\n register_post_type('photo', ['label' => 'Photos', 'description' => '', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => ['slug' => 'photo'], 'query_var' => true, 'exclude_from_search' => false, 'supports' => ['title', 'editor', 'comments', 'thumbnail', 'author'], 'taxonomies' => ['post_tag'], 'labels' => [\n 'name' => 'Photos',\n 'singular_name' => 'Photo',\n 'menu_name' => 'Mes photos',\n 'add_new' => 'Ajouter une photo',\n 'add_new_item' => 'Ajouter une photo',\n 'edit' => 'Editer',\n 'edit_item' => 'Editer la photo',\n 'new_item' => 'Nouvelle photo',\n 'view' => 'Voir ',\n 'view_item' => 'Voir la photo',\n 'search_items' => 'Rechercher une photo',\n 'not_found' => 'Pas de photo trouvé',\n 'not_found_in_trash' => 'pas de photo trouvé dans la corbeille ',\n 'parent' => 'photo parente',\n ]]);\n\n // bons plans\n register_post_type('bonplan', [\n 'label' => 'Bons plans',\n 'description' => '',\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => ['slug' => ''],\n 'query_var' => true,\n 'exclude_from_search' => false,\n 'supports' => [\n 'title',\n 'editor',\n 'excerpt',\n 'trackbacks',\n 'custom-fields',\n 'comments',\n 'revisions',\n 'thumbnail',\n 'author',\n 'page-attributes', ],\n 'taxonomies' => ['post_tag'], 'labels' => [\n 'name' => 'Bons plans',\n 'singular_name' => 'Bon plan',\n 'menu_name' => 'Bons plans',\n 'add_new' => 'Add Bon plan',\n 'add_new_item' => 'Add New Bon plan',\n 'edit' => 'Edit',\n 'edit_item' => 'Edit Bon plan',\n 'new_item' => 'New Bon plan',\n 'view' => 'View Bon plan',\n 'view_item' => 'View Bon plan',\n 'search_items' => 'Search Bons plans',\n 'not_found' => 'No Bons plans Found',\n 'not_found_in_trash' => 'No Bons plans Found in Trash',\n 'parent' => 'Parent Bon plan',\n ], ]);\n\n // video\n register_post_type('video', ['label' => 'Vidéos', 'description' => '', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => ['slug' => 'video', 'with_front' => true], 'query_var' => true, 'exclude_from_search' => false, 'supports' => ['title', 'editor', 'comments', 'thumbnail', 'author'], 'taxonomies' => ['category'], 'labels' => [\n 'name' => 'Vidéos',\n 'singular_name' => 'Vidéo',\n 'menu_name' => 'Mes Vidéos',\n 'add_new' => 'Ajouter une vidéo',\n 'add_new_item' => 'Ajouter une vidéo',\n 'edit' => 'Editer',\n 'edit_item' => 'Editer la vidéo',\n 'new_item' => 'Nouvelle vidéo',\n 'view' => 'Voir ',\n 'view_item' => 'Voir la vidéo',\n 'search_items' => 'Rechercher une vidéo',\n 'not_found' => 'Pas de vidéo trouvé',\n 'not_found_in_trash' => 'pas de vidéo trouvé dans la corbeille ',\n 'parent' => 'Vidéo parente',\n ]]);\n\n/* nombre de CPT par page */\nfunction arrange_post_per_page($query)\n{\n if (!isset($query->query_vars['posts_per_page'])\n && isset($query->query['post_type']) && $query->query['post_type'] == 'video'\n || isset($query->query['bonplan']) || isset($query->query['photo'])\n ) {\n $query->query_vars['posts_per_page'] = 5;\n }\n\n return $query;\n}\n add_filter('pre_get_posts', 'arrange_post_per_page');\n\n/* Ajout des archives au CPT*/\nfunction add_other_cpt_to_archives($query)\n{\n if (is_category() || is_tag() && empty($query->query_vars['suppress_filters'])) {\n $query->set('post_type', [\n 'post', 'bonplan',\n ]);\n\n return $query;\n }\n}\n add_filter('pre_get_posts', 'add_other_cpt_to_archives');\n}", "function adjustOffsetForPaginationInCategoryPage($found_posts, $query)\n{\n if (is_admin()) {\n return $found_posts;\n }\n\n if ($query->is_category() && $query->is_main_query()) {\n $category = get_queried_object();\n $offset = $category->slug == 'opinion' || verifyColumnist($category->name) ? 3 : 5;\n\n return $found_posts - $offset;\n }\n\n return $found_posts;\n}", "function cattag_related_posts(\n\n\t$order = 'DATE_DESC',\n\n\t$limit = 5,\n\n\t$exclude = '',\n\n\t$display_posts = true,\n\n\t$display_pages = false,\t\n\n\t$format = '<li><a href=\"%permalink%\" title=\"%title%\">%title%</a></li>',\n\n\t$dateformat = 'd.m',\n\n\t$notfound = '<li>No related posts found.</li>',\n\n\t$limit_days = 365\n\n\t) {\n\n\t##############################################\n\n\t# Globals, variables, etc.\n\n\t##############################################\n\n\tglobal $wpdb, $post, $wp_version;\n\n\t$limit = (int) $limit;\n\n\t$exclude = preg_replace('/[^0-9,]/','',$exclude);\t// remove everything except 0-9 and comma\n\n\t##############################################\n\n\t# Prepare selection of posts and pages\n\n\t##############################################\n\n\tif ( ($display_posts === true) AND ($display_pages === true) ) {\n\n\t\t// Display both posts and pages\n\n\t\t$poststatus = \"IN('publish', 'static')\";\n\n\t} elseif ( ($display_posts === true) AND ($display_pages === false) ) {\n\n\t\t// Display posts only\n\n\t\t$poststatus = \"= 'publish'\";\n\n\t} elseif ( ($display_posts === false) AND ($display_pages === true) ) {\n\n\t\t// Display pages only\n\n\t\t$poststatus = \"= 'static'\";\n\n\t} else {\n\n\t\t// Nothing can be displayed\n\n\t\treturn $notfound;\n\n\t}\n\n\t##############################################\n\n\t# Prepare exlusion of categories\n\n\t##############################################\t\n\n\t$exclude_ids_sql = ($exclude == '') ? '' : 'AND post2cat.category_id NOT IN(' . $exclude . ')';\n\n\t##############################################\n\n\t# Put the category IDs into a comma-separated string\n\n\t##############################################\n\n\t$catsList = '';\n\n\t$count = 0;\n\n\tforeach((get_the_category()) as $loop_cat) { \n\n\t\t// Add category id to list\n\n\t\t$catsList .= ( $catsList == '' ) ? $loop_cat->cat_ID : ',' . $loop_cat->cat_ID;\n\n\t}\n\n\t##############################################\n\n\t# Prepare order\n\n\t##############################################\n\n\tswitch (strtoupper($order)) {\n\n\t\tcase 'RANDOM':\n\n\t\t\t$order_by = 'RAND()';\n\n\t\t\tbreak;\n\n\t\tdefault:\t// 'DATE_DESC'\n\n\t\t\t$order_by = 'posts.post_date DESC';\n\n\t}\n\n\t##############################################\n\n\t# Set limit of posting date. 86400 seconds = 1 day\n\n\t##############################################\n\n\t$timelimit = '';\n\n\tif ($limit_days != 0) $timelimit = 'AND posts.post_date > ' . date('YmdHis', time() - $limit_days*86400);\n\n\t##############################################\n\n \t# SQL query. DISTINCT is here for getting a unique result without duplicates\n\n\t##############################################\n\n\t// since we support >= WP 2.1 only, stuff like AND posts.post_date < '\" . current_time('mysql') . \"'\n\n\t// is not necessary as future posts now gain the post_status of 'future' \n\n\tif ($wp_version < \"2.3\") {\n\n\t\t// check wp version - if lower than 2.3 use old database format of 'categories' and 'post2cat'\n\n\t\t$queryresult = $wpdb->get_results(\"SELECT DISTINCT posts.ID, posts.post_title, posts.post_date, posts.comment_count\n\n\t\t\t\t\t\t\t\tFROM $wpdb->posts posts, $wpdb->post2cat post2cat\n\n\t\t\t\t\t\t\t\tWHERE posts.ID <> $post->ID\n\n\t\t\t\t\t\t\t\tAND posts.post_status $poststatus\n\n\t\t\t\t\t\t\t\tAND posts.ID = post2cat.post_id\n\n\t\t\t\t\t\t\t\tAND post2cat.category_id IN($catsList)\n\n\t\t\t\t\t\t\t\t$timelimit\n\n\t\t\t\t\t\t\t\t$exclude_ids_sql\n\n\t\t\t\t\t\t\t\tORDER BY $order_by \n\n\t\t\t\t\t\t\t\tLIMIT $limit\n\n\t\t\t\t\t\t\t\t\");\n\n\t} else {\n\n\t\t// check wp version - if higher than 2.3 change to new database format of 'terms'\n\n\t\t$queryresult = $wpdb->get_results(\"SELECT DISTINCT posts.ID, posts.post_title, posts.post_date, posts.comment_count\n\n\t\t\t\t\t\t\t\tFROM $wpdb->posts posts, $wpdb->term_relationships term_relationships, $wpdb->term_taxonomy term_taxonomy\n\n\t\t\t\t\t\t\t\tWHERE posts.ID <> $post->ID\n\n\t\t\t\t\t\t\t\tAND posts.post_status $poststatus\n\n\t\t\t\t\t\t\t\tAND posts.ID = term_relationships.object_id\n\n\t\t\t\t\t\t\t\tAND term_relationships.term_taxonomy_id = term_taxonomy.term_taxonomy_id\n\n\t\t\t\t\t\t\t\tAND term_taxonomy.term_id IN($catsList)\n\n\t\t\t\t\t\t\t\t$timelimit\n\n\t\t\t\t\t\t\t\t$exclude_ids_sql\n\n\t\t\t\t\t\t\t\tORDER BY $order_by \n\n\t\t\t\t\t\t\t\tLIMIT $limit\n\n\t\t\t\t\t\t\t\t\");\n\n\t}\n\n\t##############################################\n\n\t// Return the related posts\n\n\t##############################################\n\n\t$result = '';\n\n\tif (count($queryresult) > 0) {\n\n\t\tforeach($queryresult as $tag_loop) {\n\n\t\t\t// Date of post\n\n\t\t\t$loop_postdate = mysql2date($dateformat, $tag_loop->post_date);\n\n\t\t\t// Get format\n\n\t\t\t$element_loop = $format;\n\n\t\t\t// Replace identifiers\n\n\t\t\t$element_loop = str_replace('%date%', $loop_postdate, $element_loop);\n\n\t\t\t$element_loop = str_replace('%permalink%', get_permalink($tag_loop->ID), $element_loop);\n\n\t\t\t$element_loop = str_replace('%title%', $tag_loop->post_title, $element_loop);\n\n\t\t\t$element_loop = str_replace('%commentcount%', $tag_loop->comment_count, $element_loop);\n\n\t\t\t// Add to list\n\n\t\t\t$result .= $element_loop . \"\\n\";\n\n\t\t}\n\n\t\t$result = \"\\n\" . '<!-- -->' . \"\\n\" . $result; \n\n\t\treturn $result;\n\n\t} else {\n\n\t\treturn $notfound;\n\n\t}\n\n}", "function mix_adjust_offset_pagination($found_posts, $query) {\n $offset = 1;\n\n //Ensure we're modifying the right query object...\n if ( $query->is_category() && $query->is_main_query() ) {\n //Reduce WordPress's found_posts count by the offset...\n return $found_posts - $offset;\n }\n return $found_posts;\n}", "function negar_per_page_query( $query ) {\n\n $is_blog = ( is_home() && is_front_page() ) || ( is_home() && !is_front_page() );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && ( is_category() || is_tag() || $is_blog ) ) {\n $query->set( 'posts_per_page', '2' ); //Change this number to anything you like.\n }\n\n /*$taxonomy = is_tax() ? get_queried_object()->taxonomy:\"\";\n\n $is_taxonomy = in_array( $taxonomy , array( 'product-category' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_taxonomy ) {\n $query->set( 'posts_per_page', '6' ); //Change this number to anything you like.\n }*/\n\n $post_type = $query->get('post_type');\n\n $is_post_type = in_array( $post_type , array( 'press_media' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_post_type && is_post_type_archive() ) {\n $query->set( 'posts_per_page', '2' ); //Change this number to anything you like.\n }\n\n /*\n $is_post_type = in_array( $post_type , array( 'service' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_post_type && is_post_type_archive() ) {\n $query->set( 'posts_per_page', '80' ); //Change this number to anything you like.\n }*/\n\n}", "function sf_campaign_pagination() {\n $prev_post = get_previous_post();\n $next_post = get_next_post();\n $has_both = false;\n\n if ( ! empty( $next_post ) && ! empty( $prev_post ) ) {\n $has_both = true;\n }\n ?>\n\n <?php if ( ! empty( $next_post ) || ! empty( $prev_post ) ) { ?>\n <?php if ( $has_both ) { ?>\n <div class=\"post-pagination-wrap prev-next\">\n <?php } else { ?>\n <div class=\"post-pagination-wrap\">\n <?php } ?>\n\n <div class=\"container\">\n\n <?php if ( ! empty( $next_post ) ) {\n $post_author = get_the_author_link( $next_post->ID );\n $post_date = get_the_date();\n $post_date_str = get_the_date('Y-m-d');\n $post_categories = get_the_category_list( ', ', '', $next_post->ID );\n ?>\n <div class=\"next-article\">\n <h6><?php _e( \"Next Project\", 'uplift' ); ?></h6>\n\n <h2>\n <a href=\"<?php echo get_permalink( $next_post->ID ); ?>\"><?php echo esc_attr($next_post->post_title); ?></a>\n </h2>\n\n <div\n class=\"blog-item-details\"><?php echo sprintf( __( '<span class=\"author\">By <a href=\"%2$s\" rel=\"author\" itemprop=\"author\">%1$s</a></span> in %3$s on <time datetime=\"%4$s\">%5$s</time>', 'uplift' ), $post_author, get_author_posts_url( get_the_author_meta( 'ID' ) ), $post_categories, $post_date_str, $post_date ); ?></div>\n </div>\n <?php } ?>\n\n <?php if ( ! empty( $prev_post ) ) {\n $post_author = get_the_author_link( $prev_post->ID );\n $post_date = get_the_date();\n $post_date_str = get_the_date('Y-m-d');\n $post_categories = get_the_category_list( ', ', '', $prev_post->ID );\n ?>\n <div class=\"prev-article\">\n <h6><?php _e( \"Previous Project\", 'uplift' ); ?></h6>\n\n <h2>\n <a href=\"<?php echo get_permalink( $prev_post->ID ); ?>\"><?php echo esc_attr($prev_post->post_title); ?></a>\n </h2>\n\n <div\n class=\"blog-item-details\"><?php echo sprintf( __( '<span class=\"author\">By <a href=\"%2$s\" rel=\"author\" itemprop=\"author\">%1$s</a></span> in %3$s on <time datetime=\"%4$s\">%5$s</time>', 'uplift' ), $post_author, get_author_posts_url( get_the_author_meta( 'ID' ) ), $post_categories, $post_date_str, $post_date ); ?></div>\n </div>\n <?php } ?>\n\n </div>\n\n </div>\n <?php } ?>\n <?php\n }", "function pre_get_post_category_page( $query ) {\n if ( !is_admin() && $query->is_main_query() ) {\n\t if ($query->is_archive() && !is_date()) {\n \t$query->set( 'offset','6' );\n\t }\n\t\t$query->set( 'offset','6' ); \n\t\treturn $query; \n }\n return $query;\n}", "function &get_wp_query ($atts = '', $paged = '') { //by ref\n extract(shortcode_atts(\n array(\n 'category_ids' => '',\n 'tag_slug' => '',\n 'sort' => '',\n 'limit' => 5,\n 'autors_id' => '',\n 'installed_post_types' => ''\n ),\n $atts\n )\n );\n\n\n $args = array(\n 'showposts' => $limit,\n 'ignore_sticky_posts' => 1\n );\n\n\n if (!empty($paged)) {\n $args['paged'] = $paged;\n } else {\n $args['paged'] = 1;\n }\n\n if (!empty($category_ids)) {\n $args['cat'] = $category_ids;\n }\n\n if (!empty($category_ids)) {\n //@todo fix this / make this faster\n $cat_id_array = explode (',', $category_ids);\n foreach ($cat_id_array as &$cat_id) {\n $cat_id = trim($cat_id);\n //get the category object\n $td_tmp_cat_obj = get_category($cat_id);\n if (empty($this->block_name)) {\n //print_r($td_tmp_cat_obj);\n if (!empty($td_tmp_cat_obj)) {\n //due to import sometimes the cat object may be empty\n $this->block_link = get_category_link($td_tmp_cat_obj->cat_ID);\n $this->block_name = mb_strtoupper($td_tmp_cat_obj->name);\n }\n } else {\n $this->block_name = $this->block_name . ' - ' . mb_strtoupper($td_tmp_cat_obj->name);\n }\n unset($td_tmp_cat_obj);\n }\n }\n\n\n if (!empty($tag_slug)) {\n $args['tag'] = $tag_slug;\n }\n\n switch ($sort) {\n case 'featured':\n if (!empty($category_ids)) {\n //for each category, get the object and compose the slug\n $cat_id_array = explode (',', $category_ids);\n\n foreach ($cat_id_array as &$cat_id) {\n $cat_id = trim($cat_id);\n\n //get the category object\n $td_tmp_cat_obj = get_category($cat_id);\n\n //make the $args\n if (empty($args['category_name'])) {\n $args['category_name'] = $td_tmp_cat_obj->slug; //get by slug (we get the children categories too)\n } else {\n $args['category_name'] .= ',' . $td_tmp_cat_obj->slug; //get by slug (we get the children categories too)\n }\n unset($td_tmp_cat_obj);\n }\n }\n\n $args['cat'] = get_cat_ID(TD_FEATURED_CAT); //add the fetured cat\n break;\n case 'popular':\n $args['meta_key'] = td_page_views::$post_view_counter_key;\n $args['orderby'] = 'meta_value_num';\n $args['order'] = 'DESC';\n break;\n case 'popular7':\n $args['meta_key'] = td_page_views::$post_view_counter_7_day_total;\n $args['orderby'] = 'meta_value_num';\n $args['order'] = 'DESC';\n break;\n case 'review_high':\n $args['meta_key'] = td_review::$td_review_key;\n $args['orderby'] = 'meta_value_num';\n $args['order'] = 'DESC';\n break;\n case 'random_posts':\n $args['orderby'] = 'rand';\n break;\n }\n\n if (!empty($autors_id)) {\n $args['author'] = $autors_id;\n }\n\n //add post_type to query\n if (!empty($installed_post_types)) {\n $array_selected_post_types = array();\n $expl_installed_post_types = explode(',', $installed_post_types);\n\n foreach ($expl_installed_post_types as $val_this_post_type) {\n if (trim($val_this_post_type) != '') {\n $array_selected_post_types[] = trim($val_this_post_type);\n }\n }\n\n $args['post_type'] = $array_selected_post_types;//$installed_post_types;\n }\n\n //print_r($args);\n\n //only show published posts\n $args['post_status'] = 'publish';\n $td_query = new WP_Query($args);\n\n wp_reset_query();\n\n return $td_query;\n }", "function bishel_per_page_query( $query ) {\n\n $is_blog = ( is_home() && is_front_page() ) || ( is_home() && !is_front_page() );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && ( is_category() || is_tag() || $is_blog ) ) {\n $query->set( 'posts_per_page', '4' ); //Change this number to anything you like.\n return ;\n }\n\n $taxonomy = is_tax() ? get_queried_object()->taxonomy:\"\";\n\n $is_taxonomy = in_array( $taxonomy , array( 'exhibition_city_state' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_taxonomy ) {\n $query->set( 'posts_per_page', '4' ); //Change this number to anything you like.\n return ;\n }\n\n $post_type = $query->get('post_type');\n\n $is_post_type = in_array( $post_type , array( 'exhibition' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_post_type && is_post_type_archive() ) {\n $query->set( 'posts_per_page', '4' ); //Change this number to anything you like.\n return ;\n }\n\n /*\n $is_post_type = in_array( $post_type , array( 'service' ) );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && $is_post_type && is_post_type_archive() ) {\n $query->set( 'posts_per_page', '80' ); //Change this number to anything you like.\n }*/\n\n}", "function bcg_posts_pagination_count($q){\n\n\t\t$posts_per_page = intval(get_query_var('posts_per_page'));\n\t\t$paged = intval(get_query_var('paged'));\n\t\t$numposts = $q->found_posts;\n $max_page = $q->max_num_pages;\n\t\tif(empty($paged) || $paged == 0) {\n\t\t\t$paged = 1;\n\t\t}\n\n $start_num = intval( $posts_per_page*($paged-1) ) + 1;\n $from_num = bp_core_number_format( $start_num );\n $to_num = bp_core_number_format( ( $start_num + ( $posts_per_page - 1 ) > $numposts ) ? $numposts : $start_num + ( $posts_per_page - 1 ) );\n $total = bp_core_number_format( $numposts );\n\n printf( __( 'Viewing posts %1$s to %2$s (of %3$s posts)', 'bcg' ), $from_num, $to_num, $total ).\"&nbsp;\";\n \n if(bcg_is_category())\n printf(__(\"In the category %s \",\"bcg\"), \"<span class='bcg-cat-name'>\". get_cat_name ($q->query_vars['cat']).\"</span>\");?>\n\t<span class=\"ajax-loader\"></span><?php\n}", "function st_blog_post_func( $atts, $content='' ) {\n \n\textract( shortcode_atts( array(\n\t\t'title' => '',\n\t\t'cats' => array(),\n 'numpost'=>5,\n 'exclude'=>'',\n 'orderby'=>'ID',\n 'order'=>'DESC',\n 'pbwith'=>'1_1',\n 'type'=>1,\n 'show_title'=>'n',\n 'show_paging'=>'n'\n\t), $atts ) );\n \n $wc = $pbwith;\n $w= explode('_',$wc);\n $t = intval($w[0]);\n $m = intval($w[1]);\n \n if($m>0 and $t>0){\n $c = $t/$m;\n }else{\n $c=1;\n }\n \n global $post , $paged;\n \n $tmp_post = $post;\n $html = $cat_link ='';\n \n // just only for one cate\n //$cats = $cats[0];\n $cats = (is_array($cats)) ? $cats[0] : intval($cats);\n \n if($cats>0){\n $cat_link = get_category_link($cats);\n $cat_title = get_cat_name($cats);\n }else{\n // do some thing\n }\n\n if($show_title =='y' and $title!=''){\n // $html .='<h1 class=\"st-category-heading blog-post\">'.esc_html($title).'</h1>';\n $html ='<h1 class=\"st-category-heading\"><a href=\"'.$cat_link.'\" >'.esc_html($title).'</a></h1>';\n }else{\n $html ='<h1 class=\"st-category-heading\"><a href=\"'.$cat_link.'\" >'.esc_html($cat_title).'</a></h1>';\n }\n \n $args = array( 'posts_per_page' => $numpost );\n if($cats>0){\n $args['category__in'] = array($cats);\n }\n \n if($exclude!=''){\n $exclude= explode(',',$exclude);\n }\n $args['post__not_in'] = $exclude;\n $args['orderby'] = $orderby;\n $args['order'] = $order;\n \n $page_num = 1;\n \n // ver 1.4\n if($show_paging=='y'){\n if($paged>0){\n $page_num = $paged;\n }else{\n $page_num = $paged = intval($_REQUEST['paged']);\n }\n // try get page if page <=1\n if($page_num<=1){\n $page_num = $paged = st_get_paging_in_home();\n }\n } \n \n if($page_num<=0){\n $page_num = 1;\n }\n \n $args['paged'] = $page_num;\n\n // added in ver 1.3\n if(st_is_wpml()){\n $args['sippress_filters'] = true;\n $args['language'] = get_bloginfo('language');\n }\n\n $new_query = new WP_Query($args);\n $myposts = $new_query->posts;\n \n $i = 0;\n if($type == 2){\n \n }\n \n $e = '';\n $c =0;\n if($type==3 && count($myposts)%2!=0){\n $myposts[] = false;\n }\n \n foreach( $myposts as $post ) : setup_postdata($post);\n //$class=get_post_class();\n if($type==3){\n if($c==0){\n $e.='<div class=\"row\">';\n $e.='<div class=\"six columns\">'.st_get_content(ST_DIR.'/templates/loop/loop-post.php',$post,array('display_type'=>$type,'i'=>$i)).'</div>';\n $c++;\n }else{\n \n $e.='<div class=\"six columns\">'.st_get_content(ST_DIR.'/templates/loop/loop-post.php',$post,array('display_type'=>$type,'i'=>$i)).'</div>';\n $e.='<div class=\"clear\"></div></div>';\n \n $c=0;\n }\n }else{\n $e.=st_get_content(ST_DIR.'/templates/loop/loop-post.php',$post,array('display_type'=>$type,'i'=>$i));\n }\n \n $i++;\n endforeach; \n \n wp_reset_postdata();\n \n $html .=$e;\n $p ='';\n \n \n if($show_paging=='y'){\n $p= st_post_pagination($new_query->max_num_pages,2,false);\n if($p!=''){\n $p = '<div class=\"pagination text-center t0 shortcode\">'.$p.'</div>';\n }\n } \n \n \n \n return '<div class=\"blog-wrap blog-type-'.$type.'\">'.do_shortcode($html).$p.'</div>';\n}", "function pages_custom( $category = array() ) {\r\n return \\query\\main::while_pages( $category );\r\n}", "function kaily_posts_pagination( $query = null )\n{\n $classes = array();\n\n if ( empty( $query ) )\n {\n $query = $GLOBALS['wp_query'];\n }\n\n if ( empty( $query->max_num_pages ) || ! is_numeric( $query->max_num_pages ) || $query->max_num_pages < 2 )\n {\n return;\n }\n\n $paged = get_query_var( 'paged' );\n\n if ( ! $paged && is_front_page() && ! is_home() )\n {\n $paged = get_query_var( 'page' );\n }\n\n $paged = $paged ? intval( $paged ) : 1;\n\n $pagenum_link = html_entity_decode( get_pagenum_link() );\n $query_args = array();\n $url_parts = explode( '?', $pagenum_link );\n\n if ( isset( $url_parts[1] ) )\n {\n wp_parse_str( $url_parts[1], $query_args );\n }\n\n $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );\n $pagenum_link = trailingslashit( $pagenum_link ) . '%_%';\n\n // Set up paginated links.\n $links = paginate_links( array(\n 'base' => $pagenum_link,\n 'total' => $query->max_num_pages,\n 'current' => $paged,\n 'mid_size' => 1,\n 'add_args' => array_map( 'urlencode', $query_args ),\n 'prev_text' => '</span><i class=\"fa fa-angle-left\"></i>',\n 'next_text' => '<i class=\"fa fa-angle-right\"></i>',\n ) );\n\n ?>\n <nav class=\"navigation posts-pagination\">\n <div class=\"pagination loop-pagination\">\n <?php echo wp_kses_post($links); ?>\n </div><!-- .pagination -->\n </nav>\n <?php\n}", "function custom_pagination($numpages = '', $pagerange = '', $paged='') {\n\n if (empty($pagerange)) {\n $pagerange = 2;\n }\n\n /**\n * This first part of our function is a fallback\n * for custom pagination inside a regular loop that\n * uses the global $paged and global $wp_query variables.\n *\n * It's good because we can now override default pagination\n * in our theme, and use this function in default quries\n * and custom queries.\n */\n global $paged;\n if (empty($paged)) {\n $paged = 1;\n }\n if ($numpages == '') {\n global $wp_query;\n $numpages = $wp_query->max_num_pages;\n if(!$numpages) {\n $numpages = 1;\n }\n }\n\n /**\n * We construct the pagination arguments to enter into our paginate_links\n * function.\n */\n $pagination_args = array(\n 'base' => get_pagenum_link(1) . '%_%',\n 'format' => 'page/%#%',\n 'total' => $numpages,\n 'current' => $paged,\n 'show_all' => False,\n 'end_size' => 1,\n 'mid_size' => $pagerange,\n 'prev_next' => True,\n 'prev_text' => __('&laquo;'),\n 'next_text' => __('&raquo;'),\n 'type' => 'plain',\n 'add_args' => false,\n 'add_fragment' => ''\n );\n\n $paginate_links = paginate_links($pagination_args);\n\n if ($paginate_links) {\n \n echo '<li class=\"waves-effect\" >'. $paginate_links . '</li>';\n }\n\n}", "function ft_pagination($pages = '', $range = 3)\n{ \n $showitems = ($range * 2)+1; \n\n global $paged;\n if(empty($paged)) $paged = 1;\n\n if($pages == '')\n {\n global $wp_query;\n $pages = $wp_query->max_num_pages;\n if(!$pages)\n {\n $pages = 1;\n }\n } \n\n if(1 != $pages)\n {\n echo \"<div class='pagination'>\";\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<a href='\".get_pagenum_link(1).\"'>&laquo;</a>\";\n if($paged > 1 && $showitems < $pages) echo \"<a href='\".get_pagenum_link($paged - 1).\"'>&lsaquo;</a>\";\n\n for ($i=1; $i <= $pages; $i++)\n {\n if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n {\n echo ($paged == $i)? \"<span class='current'>\".$i.\"</span>\":\"<a href='\".get_pagenum_link($i).\"' class='inactive' >\".$i.\"</a>\";\n }\n }\n\n if ($paged < $pages && $showitems < $pages) echo \"<a href='\".get_pagenum_link($paged + 1).\"'>&rsaquo;</a>\"; \n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<a href='\".get_pagenum_link($pages).\"'>&raquo;</a>\";\n echo \"</div>\\n\";\n }\n}", "function related_posts_shortcode( $atts ) {\r\n extract(shortcode_atts(array(\r\n 'limit' => '1',\r\n ), $atts));\r\n\r\n global $wpdb, $post, $table_prefix;\r\n\r\n // var_dump($post->post_date);\r\n if ($post->ID) {\r\n $retval = '';\r\n\r\n $this_post = $post;\r\n $category = get_the_category();\r\n $category = $category[0];\r\n $category = $category->cat_ID;\r\n\r\n if($category == 1214) {\r\n\r\n $args = [\r\n 'numberposts' => $limit,\r\n 'offset' => 0,\r\n 'orderby' => rand,\r\n 'order' => DESC,\r\n 'category' => $category,\r\n 'date_query' => array(\r\n 'before' => $post->post_date\r\n ),\r\n ];\r\n $posts = get_posts($args);\r\n\r\n\r\n if ( $posts ) {\r\n foreach ( $posts as $post ) {\r\n $retval .= '<center><a title=\"'.get_the_title().'\" href=\"'.get_the_permalink().'\">'.get_the_title().'</a></center></br>';\r\n }\r\n };\r\n return $retval;\r\n }\r\n return;\r\n }\r\n}", "function omid_per_page_query( $query ) {\n\n /*$is_blog = ( is_home() && is_front_page() ) || ( is_home() && !is_front_page() );\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && ( is_category() || is_tag() || $is_blog ) ) {\n $query->set( 'posts_per_page', '2' ); //Change this number to anything you like.\n }*/\n\n if ( $query->is_main_query() && ! $query->is_feed() && ! is_admin() && ( is_tax('video_cat') || is_post_type_archive('omid_video') ) ) {\n $query->set( 'posts_per_page', '100' ); //Change this number to anything you like.\n }\n\n}", "function pagination($pages = '', $range = 3)\n{ $showitems = ($range * 3)+1;\n global $paged; if(empty($paged)) $paged = 1;\n if($pages == '') {\n global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages)\n { $pages = 1; } }\n if(1 != $pages)\n { echo \"<div class='pagination'><ul>\";\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link(1).\"'>&laquo; First</a></li>\";\n if($paged > 1 && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link($paged - 1).\"' class='inactive'>&lsaquo; Previous</a></li>\";\n for ($i=1; $i <= $pages; $i++)\n { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n { echo ($paged == $i)? \"<li class='current'><span class='currenttext'>\".$i.\"</span></li>\":\"<li><a rel='nofollow' href='\".get_pagenum_link($i).\"' class='inactive'>\".$i.\"</a></li>\";\n } } if ($paged < $pages && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link($paged + 1).\"' class='inactive'>Next &rsaquo;</a></li>\";\n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<a rel='nofollow' class='inactive' href='\".get_pagenum_link($pages).\"'>Last &raquo;</a>\";\n echo \"</ul></div>\"; }}", "function pagination($pages = '', $range = 3)\n{ $showitems = ($range * 2)+1;\n global $paged; if(empty($paged)) $paged = 1;\n if($pages == '') {\n global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages)\n { $pages = 1; } }\n if(1 != $pages)\n { echo \"<div class='pagination'><ul>\";\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link(1).\"'>&laquo; First</a></li>\";\n if($paged > 1 && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link($paged - 1).\"' class='inactive'>&lsaquo; Previous</a></li>\";\n for ($i=1; $i <= $pages; $i++)\n { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n { echo ($paged == $i)? \"<li class='current'><span class='currenttext'>\".$i.\"</span></li>\":\"<li><a rel='nofollow' href='\".get_pagenum_link($i).\"' class='inactive'>\".$i.\"</a></li>\";\n } } if ($paged < $pages && $showitems < $pages) echo \"<li><a rel='nofollow' href='\".get_pagenum_link($paged + 1).\"' class='inactive'>Next &rsaquo;</a></li>\";\n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<a rel='nofollow' class='inactive' href='\".get_pagenum_link($pages).\"'>Last &raquo;</a>\";\n echo \"</ul></div>\"; }}", "function cpt_adjust_offset_pagination_hook(){\n\t\tadd_action( 'found_posts', array($this,'cpt_adjust_offset_pagination'), 1, 2 );\n\t}", "function mbdmaster_adjust_cpt_offset_pagination($found_posts, $query) {\n $offset = 1;\n\n //Ensure we're modifying the right query object...\n if( isset( $query->query_vars['my_special_cpt_query'] ) ) {\n //Reduce WordPress's found_posts count by the offset... \n return $found_posts - $offset;\n }\n return $found_posts;\n}", "function get_pagenum_link_custom( $pagenum = 1, $escape = true ) {\r\n global $wp_rewrite;\r\n \r\n $pagenum = (int) $pagenum;\r\n \r\n $request = remove_query_arg( 'paged' );\r\n \r\n $home_root = parse_url( home_url() );\r\n $home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : '';\r\n $home_root = preg_quote( $home_root, '|' );\r\n \r\n $request = preg_replace( '|^' . $home_root . '|i', '', $request );\r\n $request = preg_replace( '|^/+|', '', $request );\r\n \r\n if ( ! $wp_rewrite->using_permalinks() || is_admin() ) {\r\n $base = 'https://feed.mikle.com/support/';\r\n \r\n if ( $pagenum > 1 ) {\r\n $result = add_query_arg( 'paged', $pagenum, $base . $request );\r\n } else {\r\n $result = $base . $request;\r\n }\r\n } else {\r\n $qs_regex = '|\\?.*?$|';\r\n preg_match( $qs_regex, $request, $qs_match );\r\n \r\n if ( ! empty( $qs_match[0] ) ) {\r\n $query_string = $qs_match[0];\r\n $request = preg_replace( $qs_regex, '', $request );\r\n } else {\r\n $query_string = '';\r\n }\r\n \r\n $request = preg_replace( \"|$wp_rewrite->pagination_base/\\d+/?$|\", '', $request );\r\n $request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request );\r\n $request = ltrim( $request, '/' );\r\n \r\n $base = 'https://feed.mikle.com/support/';\r\n \r\n if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) {\r\n $base .= $wp_rewrite->index . '/';\r\n }\r\n \r\n if ( $pagenum > 1 ) {\r\n $request = ( ( ! empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . '/' . $pagenum, 'paged' );\r\n }\r\n \r\n $result = $base . $request . $query_string;\r\n }\r\n \r\n /**\r\n * Filters the page number link for the current request.\r\n *\r\n * @since 2.5.0\r\n *\r\n * @param string $result The page number link.\r\n */\r\n $result = apply_filters( 'get_pagenum_link', $result );\r\n \r\n if ( $escape ) {\r\n return esc_url( $result );\r\n } else {\r\n return esc_url_raw( $result );\r\n }\r\n}", "function mukesh_pagination($pages = '', $range = 3)\r\r\n{\r\r\n $showitems = ($range * 2)+1; \r\r\n \r\r\n global $paged;\r\r\n if(empty($paged)) $paged = 1;\r\r\n \r\r\n if($pages == '')\r\r\n {\r\r\n global $wp_query;\r\r\n $pages = $wp_query->max_num_pages;\r\r\n\t\t echo $pages;\r\r\n if(!$pages)\r\r\n {\r\r\n $pages = 1;\r\r\n }\r\r\n } \r\r\n \r\r\n if(1 != $pages)\r\r\n {\r\r\n echo \"<div class=\\\"w3grip_pagination\\\"><span>Page \".$paged.\" of \".$pages.\"</span>\";\r\r\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<a href='\".get_pagenum_link(1).\"'>&laquo; First</a>\";\r\r\n if($paged > 1 && $showitems < $pages) echo \"<a href='\".get_pagenum_link($paged - 1).\"'>&lsaquo; Previous</a>\";\r\r\n \r\r\n for ($i=1; $i <= $pages; $i++)\r\r\n {\r\r\n if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\r\r\n {\r\r\n echo ($paged == $i)? \"<span class=\\\"current\\\">\".$i.\"</span>\":\"<a href='\".get_pagenum_link($i).\"' class=\\\"inactive\\\">\".$i.\"</a>\";\r\r\n }\r\r\n }\r\r\n \r\r\n if ($paged < $pages && $showitems < $pages) echo \"<a href=\\\"\".get_pagenum_link($paged + 1).\"\\\">Next &rsaquo;</a>\";\r\r\n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<a href='\".get_pagenum_link($pages).\"'>Last &raquo;</a>\";\r\r\n echo \"</div>\\n\";\r\r\n }\r\r\n}", "function custom_base_pagination($args = array(), $query_object = 'wp_query') {\n if ($query_object == 'wp_query') {\n global $wp_query;\n $main_query = $wp_query;\n } else {\n $main_query = $query_object;\n }\n //var_dump($wp_query);\n $big = 99999; // This needs to be an unlikely integer\n // For more options and info view the docs for paginate_links()\n // http://codex.wordpress.org/Function_Reference/paginate_links\n $current_page = max(1, get_query_var('paged'));\n $pages_count = $main_query->max_num_pages;\n $default_args = array(\n //'base' => str_replace($big, '%#%', get_pagenum_link($big)),\n 'current' => $current_page,\n 'total' => $pages_count,\n 'mid_size' => 2,\n 'prev_text' => '<i class=\"fa fa-caret-left\" aria-hidden=\"true\"></i>',\n 'next_text' => '<i class=\"fa fa-caret-right\" aria-hidden=\"true\"></i>',\n 'type' => 'array'\n );\n $args = wp_parse_args($args, $default_args);\n $paginate_links = paginate_links($args);\n if ($paginate_links) {\n ?>\n\n <ul class=\"pagination col-12 row justify-content-center ml-0 mr-0 mt-5 mb-5\">\n <?php foreach ($paginate_links as $link): ?>\n <li class=\"page-item\"><span class=\"page-link\"><?php echo $link; ?></span></li>\n <?php endforeach; ?>\n </ul>\n\n <?php\n }\n}", "function single_post_pagination()\r\n{\r\n\t?>\r\n\t\t<div class=\"pos_navigation clearfix\">\r\n\t\t\t<div class=\"post_left fl\"><?php previous_post_link('%link','<i class=\"fa fa-angle-left\"></i> %title') ?></div>\r\n\t\t\t<div class=\"post_right fr\"><?php next_post_link('%link','%title <i class=\"fa fa-angle-right\"></i>' ) ?></div>\r\n\t\t</div>\r\n\t<?php\r\n}", "function wiziapp_get_categories_nav(){\n global $post;\n $categories = get_the_category($post->ID);\n// $max_to_show = 2;\n $count = count($categories);\n $html = '';\n \n if ($categories){\n if ($count == 1 && $categories[0]->cat_name == 'Uncategorized') {\n // Do nothing, if the only category we have is uncategorized, we will not show anything\n } else { \n if ($count > 1){\n $link = wiziapp_buildPostCategoriesLink($post->ID); \n $cat_names = $count . ' ' . __('Categories', 'wiziapp');\n } else {\n $link = wiziapp_buildCategoryLink($categories[0]->cat_ID);\n $cat_names = wiziapp_makeShortString($categories[0]->cat_name, 13);\n }\n $cat_names = '<span class=\"names\">: ' . $cat_names . '</span>';\n\n $html .= '<li class=\"categories\"><a id=\"wizapp_cats_footer_link\" class=\"wiziapp_footer_links\" href=\"' . $link . '\">';\n $html .= '<div class=\"title-bar\"></div><span class=\"title\">' . __('Categories', 'wiziapp') . '</span>';\n /**$names = array();\n for($c=0; $c < $count && $c < $max_to_show; ++$c){\n $names[] = \"{$categories[$c]->cat_name}\";\n }\n \n $cat_names = implode(', ', $names);\n $cat_names = wiziapp_makeShortString($cat_names, 25);\n if ( strpos($cat_names, '...') === FALSE ){\n if ( $count > $max_to_show ){\n $cat_names .= '...';\n }\n } */\n $html .= $cat_names . '</a></li>';\n } \n }\n \n echo $html;\n}", "function kriesi_pagination($pages = '', $range = 2){\n $showitems = ($range * 2)+1;\n\n global $paged;\n if(empty($paged)) $paged = 1;\n\n if($pages == '')\n {\n global $wp_query;\n $pages = $wp_query->max_num_pages;\n if(!$pages)\n {\n $pages = 1;\n }\n }\n\n if(1 != $pages)\n {\n echo \"<div class='pagination'><ul class='list-inline'>\";\n if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link(1).\"'><i class='fa fa-angle-double-left'></i></a></li>\";\n if($paged > 1 && $showitems < $pages) echo \"<li class='spacing-right'><a href='\".get_pagenum_link($paged - 1).\"'><i class='fa fa-angle-left'></i></a></li>\";\n\n for ($i=1; $i <= $pages; $i++)\n {\n if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))\n {\n echo ($paged == $i)? \"<li><a class='active'>\".$i.\"</a></li>\":\"<li><a href='\".get_pagenum_link($i).\"' class=\\\"btn-green\\\">\".$i.\"</a></li>\";\n }\n }\n\n if ($paged < $pages && $showitems < $pages) echo \"<li class='spacing-left'><a href='\".get_pagenum_link($paged + 1).\"'><i class='fa fa-angle-right'></i></a></li>\";\n if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo \"<li><a href='\".get_pagenum_link($pages).\"'><i class='fa fa-angle-double-right'></i></a></li>\";\n echo \"</ul></div>\\n\";\n }\n}", "protected function getProjectCategoriesWithPagination(){\n return static::paginate();\n }", "function post_pagination()\n{\n global $wp_query;\n $big = 999999999;\n echo paginate_links(array(\n 'base' => str_replace($big, '%#%', get_pagenum_link($big)),\n 'format' => '?paged=%#%',\n 'current' => max(1, get_query_var('paged')),\n 'total' => $wp_query->max_num_pages\n ));\n}" ]
[ "0.77943265", "0.7265461", "0.7124092", "0.67990667", "0.67962056", "0.6777679", "0.6743889", "0.6739637", "0.67114", "0.6549704", "0.6544172", "0.65372473", "0.65371805", "0.65169394", "0.6515429", "0.64984614", "0.6492549", "0.64820623", "0.6478959", "0.6458297", "0.64563155", "0.64440006", "0.6441411", "0.6420345", "0.6417165", "0.6394096", "0.6390691", "0.6388268", "0.63869756", "0.637747" ]
0.78653264
0
/ save to cookie time : thoi gian save cookie, neu = 0 thi` save o cua so hien ha`nh
function savecookie($time = 0){ if ($this->logged!=1) return false; if ($time > 0){ setcookie("login_email",$this->use_email,time()+$time,"/", $this->server_name,null,1); setcookie("login_name",$this->login_name,time()+$time,"/", $this->server_name,null,1); setcookie("PHPSESS1D",$this->password,time()+$time,"/", $this->server_name,null,1); setcookie("login_email",$this->use_email,time()+$time,"/","",null,1); setcookie("login_name",$this->login_name,time()+$time,"/","",null,1); setcookie("PHPSESS1D",$this->password,time()+$time,"/","",null,1); } else{ //Set cookie cho domain bằng rỗng để chống lưu cookie save setcookie("login_email","",time()-365*24*60*60,"/",$this->server_name,null,1); setcookie("login_name","",time()-365*24*60*60,"/",$this->server_name,null,1); setcookie("PHPSESS1D","",time()-365*24*60*60,"/",$this->server_name,null,1); //Set temporary cookie setcookie("login_email",$this->use_email,null,"/",$this->server_name,null,1); setcookie("login_name",$this->login_name,null,"/",$this->server_name,null,1); setcookie("PHPSESS1D",$this->password,null,"/",$this->server_name,null,1); setcookie("login_email",$this->use_email,null,"/","",null,1); setcookie("login_name",$this->login_name,null,"/","",null,1); setcookie("PHPSESS1D",$this->password,null,"/","",null,1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function save() {\n\t\t$self = CookieStore::get_current();\n\t\t$expiration_date = time() + 30*60;\n\t\tif(!empty($self->_stored)) {\n\t\t\tforeach($self->_stored as $ckey => $cval) {\n\t\t\t\tif(empty($self->_saved[$ckey])) {\n\t\t\t\t\tsetcookie($ckey, $self->_to_cookie_val($cval), $expiration_date, '/', DOMAIN);\n\t\t\t\t\t$self->_saved[$ckey] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!empty($self->_destroyed)) {\n\t\t\tforeach($self->_destroyed as $ckey => $cval) {\n\t\t\t\tsetcookie($ckey, 0, time() - 86400, '/', DOMAIN);\n\t\t\t}\n\t\t}\n\t}", "function wpb_lastvisit_set_cookie() {\n\nif ( is_admin() ) return;\n$current = current_time( 'timestamp', 1);\nsetcookie( 'lastvisit', $current, time()+60+60*24*7, COOKIEPATH, COOKIE_DOMAIN );\n}", "function save()\n {\n $cookie = new RequestCookie(\"Warriors\");\n $w = $cookie->getValue();\n\n $w = BaseWarrior::saveBase($w);\n\n // Save cookie\n new SendCookie( new Cookie( \"Warriors\", htmlentities(serialize($w)), new \\DateTime( \"14day\" ) ) );\n }", "function _saveLogin() {\n $save = array(\"ID\" => $this->logged(), \"password\" => md5($this->info('password')));\n $ckContent = base64_encode(@serialize($save));\n setCookie(\"m8slogin\", $ckContent, LOGINCOOKIELIFETIME);\n debugLog(\"Cookie gesaved\", \"Login cookie wurde gespeichert\");\n }", "function paniers_setcookie($nom,$valeur){\n\tstatic $expire = NULL;\n\tif ($expire==NULL) $expire = time()+_PANIER_EPHEMERE_TTL;\n\tinclude_spip('inc/cookie');\n\tspip_setcookie($nom,$_COOKIE[$nom] = $valeur, $expire);\n}", "public function saveNew()\n {\n $cookie = new RequestCookie(\"Warriors\");\n $w = $cookie->getValue();\n\n $w = BaseWarrior::saveNewBase($w);\n\n // Save cookie\n new SendCookie( new Cookie( \"Warriors\", htmlentities(serialize($w)), new \\DateTime( \"14day\" ) ) );\n }", "public function save()\n {\n $this->session['last_activity'] = time();\n $this->age();\n\n $config = Config::get('session');\n $this->driver->save($this->session, $config, $this->exists);\n $this->cookie($config);\n\n $sweepage = $config['sweepage'];\n\n if (mt_rand(1, $sweepage[1]) <= $sweepage[0]) {\n $this->sweep();\n }\n }", "function setDate() {\n\tdate_default_timezone_set('America/Los_Angeles');\n\t$date = date(\"D y M d, g:i:s a\");\n\t# set expire time to one week\n\t$expireTime = time() + 60*60*24*7;\n\tsetcookie('date', $date, $expireTime);\n}", "function cookieLANG() { \n\n setcookie(lang,$this->lang,time()+365*24*3600);\n\n }", "function cookieset($c_name) { \n \n $more1 = substr(md5(rand()), 0, 3);\n $more2 = substr(md5(rand()), 0, 3);\n \n if ( $this->email && $this->pw ) {\n\n $usertoken = $this->getUserToken();\n\n $cookie = \"$more1$usertoken$more2$this->pw\";\n\n }\n \n else {\n\n $cookie = '';\n\n }\n\n if ($this->cookie_duration == 0) setcookie($c_name, $cookie, 0, \"/\"); \n else setcookie($c_name, $cookie, time()+365*3600*24, \"/\");\n \n }", "function store_appt_id_change_time($transmit) {\n\t\t\tglobal $database, $response;\n\t\t\t// store cookie\n\t\t\t$_SESSION['appt_id_change_time'] = $transmit[\"appt_id\"];\n\t}", "protected function cookie()\n\t{\n\t\t$config = Config::$items['session'];\n\n\t\textract($config, EXTR_SKIP);\n\n\t\t$minutes = ( ! $expire_on_close) ? $lifetime : 0;\n\n\t\tCookie::put($cookie, $this->session['id'], $minutes, $path, $domain, $secure);\t\n\t}", "private function setCookie() {\r\n\t\t$data = md5($this->id.'|'.$this->username.'|'.$this->created);\r\n\t\tsetcookie($this->cookieName, $data, time() + $this->cookieDuration, '/', '.'.$this->domain); // two week login cookie\r\n\t}", "public function cookieUser() {\n setcookie('pseudo', \n $_POST['pseudo'], \n time() +365*24*3600, \n '/', \n null, \n false, \n true );\n }", "function cookieIP($c_name, $c_content, $c_time, $c_dir) { \n \n setcookie($c_name, $c_content, $c_time, $c_dir);\n\n }", "public function save($docookie=false) {\n\t\t$json = json_encode($this->vars);\n\t\t$_SESSION[$this->name] = $json;\n\t\tif(COOKIE_DOOD||$docookie) setcookie($this->name, $json, ($this->ttl + time()));\n\t\t$this->saved=true;\n\t}", "function setCookie($key,$value)\n {\n setcookie($key,$value,time()+30,'/');\n }", "function setCookies()\n{\n if (empty(filter_input(INPUT_COOKIE, 'id_visita'))) {\n setcookie('id_visita', rand(100, 999));\n }\n if (empty(filter_input(INPUT_COOKIE, 'id_visitatore'))) {\n setcookie('id_visitatore', rand(100, 999), time() + 60 * 60 * 24);\n }\n}", "function cookie() {\n\t\tif(!isset($_COOKIE['id'])) {\n\t\t\t\n\t\t\tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t\t$ip=$_SERVER['HTTP_CLIENT_IP'];\n\t\t\t}\n\t\t\telseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t\t$browser = hash('sha512', $ip.$_SERVER['HTTP_USER_AGENT']);\n\t\t\tsetcookie(\"id\", $browser, strtotime('+30 days'));\n\t\t\t$_COOKIE['id'] = $browser;\n\t\t\treturn $s;\n\t\t}\n\t}", "function createCookie($cookie){\n\t\tsetcookie('lang', $cookie, time() + 365*24*3600, null, null, false, true);\n\t}", "public function saveCookie($thread)\n {\n $thread = \"$thread,\";\n $cookie = $this->cookie->t != false ? $this->cookie->t : ',';\n if(strpos($cookie, $thread) === false) $cookie .= $thread;\n setcookie('t', $cookie , time() + 60 * 60 * 24 * 30);\n }", "public function setCookie($startTime = null);", "private static function saveState() : void {\n if ( self::zooStarted() ) {\n $_SESSION['time'] = self::$time;\n $_SESSION['animals'] = self::$animals;\n }\n }", "function cookie_auth($user_login, $user){\n\n $url = $_SERVER['HTTP_REFERER'];\n $Token = md5(uniqid(rand(), true));\n\n setcookie(\"wp_la_token\", $Token, time() + 86400 , \"/\", \".churchfuel.com\"); // 86400 = 1 day\n //setcookie(\"User_detail\", $user_detail, time() + 86400, \".churchfuel.com\"); // 86400 = 1 day\n database_conn($Token, $user);\n la_flag($url);\n}", "public function setTime()\r\n\t{\r\n\t\t$_SESSION['form_time'] = microtime(true);\t\r\n\t\treturn TRUE;\r\n\t}", "public function save()\n\t{\n\t\t$this->session['last_activity'] = time();\n\n\t\t$this->age();\n\n\t\t$config = Config::$items['session'];\n\n\t\t$this->driver->save($this->session, $config, $this->exists);\n\n\t\t$this->cookie();\n\n\t\t// Some session drivers implement the Sweeper interface, meaning that they\n\t\t// must clean up expired sessions manually. If the driver is a sweeper, we\n\t\t// need to determine if garbage collection should be run for the request.\n\t\t// Since garbage collection can be expensive, the probability of it\n\t\t// occuring is controlled by the \"sweepage\" configuration option.\n\t\t$sweepage = $config['sweepage'];\n\n\t\tif ($this->driver instanceof Sweeper and (mt_rand(1, $sweepage[1]) <= $sweepage[0]))\n\t\t{\n\t\t\t$this->driver->sweep(time() - ($config['lifetime'] * 60));\n\t\t}\n\t}", "public function saveSessionId() {\n\t\t$this->Cookie->write('session_id', $this->Session->id());\n\t}", "public function saveUserToCookie($cookie) { }", "function satb_setTbCookie(){\n setcookie('GS_ADMIN_TOOLBAR', 1, time() + 15552000,'/');\n}", "function stayLoggedIn($member)\n{\n // coockie is set for 1 month\n $duration = time() + 3600 * 24 * 30;\n\n setcookie('id', $member[0]['id'], $duration, '/');\n}" ]
[ "0.7469224", "0.7234643", "0.7123489", "0.70208037", "0.68178177", "0.68090004", "0.6799647", "0.6796166", "0.67686427", "0.6749605", "0.6742534", "0.67244035", "0.6695617", "0.6612825", "0.6604347", "0.65930337", "0.6585504", "0.6554318", "0.65266746", "0.6521086", "0.64620984", "0.6442641", "0.64367115", "0.6432429", "0.64182395", "0.6397662", "0.6342513", "0.6299491", "0.6298959", "0.6293197" ]
0.73906773
1
FaceloginOpenID($emai, $name); Ham fake dang nhap cho nhung user khong tao tai khoan truc tiep tren cucre ma tao qua facebook hoac google
function fakeloginopenid($email = '', $name = ''){ $user_email = htmlspecialbo($email); $user_name = ($name != '')? htmlspecialbo($name) : $user_email; $pass = md5('cropenid'); // nếu email != '' thì thực hiện tiếp if($user_email != ''){ /* Kiểm tra email + cucre có trong dữ liệu chưa nếu chưa có thì thêm vào nếu có rồi thì kiểm tra use_openid có == 1 hay không */ $db_query = new db_query(" SELECT * FROM users WHERE use_login = 'cr_" . $user_email . "'", __FILE__ . " Line: " . __LINE__, "USE_SLAVE"); // nếu tồn tại dữ liệu if($row = mysql_fetch_assoc($db_query->result)){ if($row['use_openid'] == 1){ $this->logged = 1; $this->use_name = $user_name; $this->login_name = 'cr_' . $user_email; $this->use_email = $user_email; $this->password = $pass; $this->savecookie(31536000); return 1; } }else{ // nếu không tồn tại dữ liệu thì thêm dữ liệu mới vào $db_insert = new db_execute("INSERT INTO users(use_login, use_password, use_name, use_email, use_active, use_openid, use_group) VALUES('cr_" . $user_email . "','". $pass ."','" . $user_name . "','cr_" . $user_email . "',1,1,1)"); unset($db_insert); $this->logged = 1; $this->use_name = $user_name; $this->login_name = 'cr_' . $user_email; $this->use_email = $user_email; $this->password = $pass; $this->savecookie(31536000); return 1; } }//end if user_email != '' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function houzez_openid_login($get_vars) {\n $dir = plugin_dir_path( __DIR__ ) . 'social/';\n require $dir.'openid.php';\n\n $openID = new LightOpenID(houzez_get_domain_openid());\n $allowed_html = array();\n\n if ( $openID->validate() ) {\n\n $dashboard_profile_link = houzez_get_dashboard_profile_link();\n $openID_identity = wp_kses($get_vars['openid_identity'], $allowed_html);\n\n if ( strrpos($openID_identity, 'yahoo') ) {\n $email = wp_kses($get_vars['openid_ax_value_email'], $allowed_html);\n $username = explode( '@', $email );\n $username= $username[0];\n $display_name = wp_kses($get_vars['openid_ax_value_fullname'], $allowed_html);\n $openID_identity_pos = strrpos( $openID_identity, '/a/.' );\n $openID_identity = str_split( $openID_identity, $openID_identity_pos + 4 );\n $openID_identity_code = $openID_identity[1];\n }\n\n houzez_register_user_social( $email, $username, $display_name, $openID_identity_code, '' );\n\n $info = array();\n $info['user_login'] = $username;\n $info['user_password'] = $openID_identity_code;\n $info['remember'] = true;\n $user_logon = wp_signon( $info, false );\n\n if (is_wp_error( $user_logon )) {\n wp_redirect(home_url());\n } else {\n ///ueu\n wp_redirect( $dashboard_profile_link );\n }\n\n }\n }", "function houzez_yahoo_login() {\n $dir = plugin_dir_path( __DIR__ ) . 'social/';\n require $dir.'openid.php';\n\n $dashboard_profile_link = houzez_get_dashboard_profile_link();\n\n try {\n $openID = new LightOpenID( houzez_get_domain_openid() );\n\n if ( !$openID->mode ) {\n $openID->identity = 'https://me.yahoo.com';\n\n $openID->required = array(\n 'namePerson',\n 'namePerson/first',\n 'namePerson/last',\n 'contact/email',\n );\n $openID->optional = array('namePerson', 'namePerson/friendly');\n $openID->returnUrl = $dashboard_profile_link;\n\n print $openID->authUrl();\n wp_die();\n\n }\n } catch (ErrorException $e) {\n echo $e->getMessage();\n }\n }", "function openid_login ($url) {\n global $db, $_SESSION, $LoginError, $LoginSuccessful;\n $url = $db->escape($url);\n $sql = 'SELECT user_id FROM ' . TABLE_USERS_AUTH\n . \" WHERE auth_type = 'OpenID' AND auth_identity LIKE '$url'\";\n if ($user_id = $db->queryScalar($sql)) {\n $sql = \"UPDATE \" . TABLE_SESSIONS . \" SET user_id = '$user_id' WHERE session_id LIKE '$_SESSION[ID]'\";\n if (!$db->query($sql)) {\n message_die(SQL_ERROR, \"Can't update session table\", '', __LINE__, __FILE__, $sql);\n }\n $LoginSuccessful = true;\n setcookie(\"LastOpenID\", $url, time() + 2592000);\n header(\"location: \" . get_url());\n } else {\n $LoginError = \"Read the source to get an invite.\";\n }\n}", "function login(){\n\t\t$openid = new LightOpenID;\n\t\t\n\t\t// if the process hasn't been started yet, go to google and start it\n\t\tif(!$openid->mode){\n\t\t\t$openid->identity = 'https://www.google.com/accounts/o8/id';\n\t\t\theader('Location: ' . $openid->authUrl());\n\t\t\techo $openid->authUrl();\n\t\t\t\n\t\t// if the process has been started already, save the resulting id\n\t\t}else{\n\t\t\t$openid->validate();\n\t\t\t$_SESSION['id'] = $openid->identity;\n\t\t\t\n\t\t\theader('Location: /unread');\n\t\t\texit;\n\t\t}\n\t}", "public function doLoginFB() {\n\t\t$ret = '0';\n\t\t$id = 0;\n\t\t\n\t\t$tmp = $this->checkDuplicate();\n\n\t\tif($tmp !== false) {\n\t\t\tif($tmp[0]['store_id'] != NULL) {\n\t\t\t\t$_SESSION['sess_user_id'] = $tmp[0]['id'];\n\t\t\t\t$_SESSION['sess_user_name'] = $this->input->post('txt_email');\n\t\t\t\t$_SESSION['sess_store_id'] = $tmp[0]['store_id'];\n\t\t\t\t$_SESSION['sess_store_name'] = $tmp[0]['store_name'];\n\t\t\t\t$ret='1';\n\t\t\t\t$id = $tmp[0]['id'];\n\t\t\t}\n\t\t} else {\n\t\t\t//reg\n\t\t\t$this->doReg();\n\t\t\t$this->doRegGG();\n\t\t\t$id = $this->lastUpdateUserId;\n\t\t}\necho $ret;\n\t\treturn array($ret, $id);\n\t}", "function facebook_login() {\r\n \r\nif( \\query\\main::get_option( 'facebook_appID' ) === '' || \\query\\main::get_option( 'facebook_secret' ) === '' ) {\r\n return false;\r\n}\r\n\r\nreturn true;\r\n\r\n}", "public static function fb_login($me_id){\n\t\t$db = new mysqli('pseudocodingnet.fatcowmysql.com', 'kittenfire', '128411', 'chatengine');\n\t\tif(!$db){\n\t\t\techo \"Could not connect\";\n\t\t\tdie();\n\t\t}\n\t\t//Creates a new GUID every attempt to login to prevent hackers from hacking the place!\n\t\t$guid = uniqid('', true);\n\t\t$db->query(\"update Members set guid='$guid' where fb_id='$me_id'\"); \n\t\t\n\t\t//Check to see if the user exists with the username and pw..\n\t\t$stmt = $db->prepare(\"select screen_name from Members where fb_id=? \");\n\t\t$stmt->bind_param('i', $me_id);\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($screen_name);\n\t\tif($stmt->fetch())\n\t\t{\n\t\t\treturn new User($screen_name, $guid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//echo \"FUCK YOU HACKER\";//lol.\n\t\t\treturn NULL;\n\t\t}\n\t}", "function oidc_login(OpenIDConnectClient $oidc, $token, $remember_me)\n{\n\tglobal $conf;\n\n\t// Find user in piwigo database\n\t$id = oidc_retrieve($oidc);\n\tif ($id === null) {\n\t\treturn false;\n\t}\n\n\t$name = get_preferred_username($oidc);\n\t$email = $oidc->requestUserInfo('email');\n\n\t// Store access token in the session\n\t$_SESSION[OIDC_SESSION] = json_encode([\n\t\t'refresh_token' => $token->refresh_token,\n\t\t'access_token' => $token->access_token,\n\t\t'expires' => time() + $token->expires_in\n\t]);\n\n\t// Update user data from ID token data\n\t$fields = array($conf['user_fields']['email'], $conf['user_fields']['username']);\n\n\t$data = array();\n\t$data[$conf['user_fields']['id']] = $id;\n\t$data[$conf['user_fields']['email']] = $email;\n\t$data[$conf['user_fields']['username']] = $name;\n\t\n\tmass_updates(USERS_TABLE,\n\t\t\t\tarray(\n\t\t\t\t'primary' => array($conf['user_fields']['id']),\n\t\t\t\t'update' => $fields\n\t\t\t\t),\n\t\t\t\tarray($data));\n\n\t// Log the user in\n\tlog_user($id, $remember_me);\n\ttrigger_notify('login_success', stripslashes($name));\n\n\treturn true;\n}", "function init()\n{\n session_name('openid_server');\n session_start();\n}", "public function loginAction(){\n\t\t$key = $this->container->getParameter('oauth_key');\n\t\t$secret = $this->container->getParameter('oauth_secret');\n \t\t$request = $this->getRequest();\n\t\t$identifier = $request->request->get('openid_identifier');\n\t\t$existing_user = '';\n\t\t\n\t\t//first check for current session if there is one redirect to matchup\n\t\tif($this->container->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')){\n\t\t\treturn $this->redirect('/matchup');\n\t\t}\n\t\n\t\t//2nd check if user is in the db.\n\t\tif($identifier){\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t$existing_user = $em->getRepository('MockUserBundle:User')->findOneByUsername($identifier);\n\t\t} \n\t\t$openid_domain = $this->container->getParameter('oauth_domain');\n\t\t$openid = new LightOpenID($openid_domain, $key);\n\t\t//3rd if the user does exist in db attempt to authenticate them with yahoo\n\t\tif($existing_user or (is_object($openid) and !$identifier and $openid->mode)){\n\t\t \tif($identifier and !$openid->mode){\n\t\t\t\t$openid->identity = $identifier;\n\t\t\t\t$openid->required = array('contact/email', 'person/guid');\n\t $openid->optional = array('namePerson', 'namePerson/friendly');\n\t\t\t\t$url = $openid->authUrl(false, false); \n\t\t\t\t//print_r($openid->authUrl());\n\t\t\t\treturn $this->redirect($url);\n\t\t\t}\n\t\t\telse if($openid->mode == 'cancel') {\n\t\t\t\t$form = 'Cancelled';\n\t\t\t} else {\n\t\t\t\t$attributes = $openid->getAttributes();\n\t\t\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\t\t$existing_user = $em->getRepository('MockUserBundle:User')->findOneByUsername($attributes['openid_ax_value_email']);\n\t\t\t\t\n\t\t\t\t// create the authentication token\n\t\t\t\t$token = new \\Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken($existing_user, null, 'main', $existing_user->getRoles());\n\t\t\t\t// give it to the security context\n\t\t\t\t$this->container->get('security.context')->setToken($token);\n\t\t\t\treturn $this->redirect('/matchup');\n\t\t\t} \n\t } elseif(!$identifier) {\n\t\t\t$message = '';\n\t\t\treturn array('message' => $message);\n\t\t\t\n\t } else {\n\t\t\t$message = 'You have not yet registered. Please register first';\n\t\t\treturn array('message' => $message); \n\t }\n\t}", "public function SpotifyLogin()\r\n\t{\r\n\t\t$arreglo_scopes = explode(\",\", variable_get('p_scopes'));\r\n\t\tif (isset($_GET['code'])) {\r\n\t\t\t\r\n\t\t\terror_log(\"blve_spotify_class IF \\n\",3,'/mnt/var/log/registro.log');\r\n\r\n\t\t\t$this->session->requestAccessToken($_GET['code']);\r\n\t\t\t$this->data = $this->api->setAccessToken($this->session->getAccessToken());\r\n\r\n\t\t\terror_log(\"blve_spotify_class token: \".$this->session->getAccessToken().\"\\n\",3,'/mnt/var/log/registro.log');\r\n\t\t\t\r\n\t\t\t$_SESSION['blve_spotify_token'] = $this->session->getAccessToken();\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t$scopes = array(\r\n\t\t\t\t'scope' => $arreglo_scopes,\r\n\t\t\t);\r\n\r\n\t\t\terror_log(\"blve_spotify_class ELSE \\n\",3,'/mnt/var/log/registro.log');\r\n\r\n\t\t\theader('Location: ' . $this->session->getAuthorizeUrl($scopes));\r\n\t\t}\r\n\r\n\t}", "function user_login() {\n global $user, $GETPOST;\n \n // If the user is already logged in, return\n if (isset($user[\"uid\"])) openid_indirect_response(simpleid_url(), '');\n \n $destination = (isset($GETPOST['destination'])) ? $GETPOST['destination'] : '';\n $state = (isset($GETPOST['s'])) ? $GETPOST['s'] : '';\n $query = ($state) ? 's=' . rawurlencode($state) : '';\n \n if (isset($_POST['op']) && $_POST['op'] == 'Cancel') {\n global $version;\n \n $request = unpickle($state);\n $version = openid_get_version($request);\n \n if (isset($request['openid.return_to'])) {\n $return_to = $request['openid.return_to'];\n $response = simpleid_checkid_error(FALSE);\n simpleid_assertion_response($response, $return_to);\n } else {\n indirect_fatal_error('Login cancelled without a proper OpenID request.');\n }\n return;\n }\n \n // We allow legacy login if the connection is via HTTPS or if SIMPLEID_ALLOW_LEGACY_LOGIN is true\n $allow_legacy_login = (is_https() || SIMPLEID_ALLOW_LEGACY_LOGIN);\n \n if (!isset($_POST['name'])) $_POST['name'] = '';\n if (!isset($_POST['pass'])) $_POST['pass'] = '';\n if (!isset($_POST['digest'])) $_POST['digest'] = '';\n \n if (\n ($_POST['name'] == '')\n || (\n ($allow_legacy_login && ($_POST['pass'] == '') && ($_POST['digest'] == ''))\n || (!$allow_legacy_login && ($_POST['digest'] == ''))\n )\n ) {\n if (isset($_POST['destination'])) {\n // User came from a log in form.\n set_message('You need to supply the user name and the password in order to log in.');\n }\n if (isset($_POST['nonce'])) cache_delete('user-nonce', $_POST['nonce']);\n user_login_form($destination, $state);\n return;\n }\n \n if (!isset($_POST['nonce'])) {\n if (isset($_POST['destination'])) {\n // User came from a log in form.\n set_message('You seem to be attempting to log in from another web page. You must use this page to log in.');\n }\n user_login_form($destination, $state);\n return;\n }\n \n $time = strtotime(substr($_POST['nonce'], 0, 20));\n // Some old versions of PHP does not recognise the T in the ISO 8601 date. We may need to convert the T to a space\n if (($time == -1) || ($time === FALSE)) $time = strtotime(strtr(substr($_POST['nonce'], 0, 20), 'T', ' '));\n \n if (!cache_get('user-nonce', $_POST['nonce'])) {\n log_warn('Login attempt: Nonce ' . $_POST['nonce'] . ' not issued or is being reused.');\n set_message('SimpleID detected a potential security attack on your log in. Please log in again.');\n user_login_form($destination, $state);\n return;\n } elseif ($time < time() - SIMPLEID_LOGIN_NONCE_EXPIRES_IN) {\n log_notice('Login attempt: Nonce ' . $_POST['nonce'] . ' expired.');\n set_message('The log in page has expired. Please log in again.');\n user_login_form($destination, $state);\n return;\n } else {\n cache_delete('user-nonce', $_POST['nonce']);\n }\n \n if (store_user_verify_credentials($_POST['name'], $_POST, $allow_legacy_login) === false) {\n set_message('The user name or password is not correct.');\n user_login_form($destination, $state);\n return;\n }\n \n // Set the current authentication time\n $test_user = user_load($_POST['name']);\n $test_user['auth_time'] = time();\n user_save($test_user);\n \n // Set user has been actively authenticated this and the next request only\n $test_user['auth_active'] = true;\n $_SESSION['user_auth_active'] = true;\n \n _user_login($test_user);\n log_info('Login successful: ' . $test_user['uid'] . '['. gmstrftime('%Y-%m-%dT%H:%M:%SZ', $test_user['auth_time']) . ']');\n \n \n if (isset($_POST['autologin']) && ($_POST['autologin'] == 1)) user_autologin_create();\n\n openid_indirect_response(simpleid_url($destination, $query), '');\n}", "function liberatid_start_login( $claimed_url, $action, $finish_url = null) {\n\tif ( empty($claimed_url) ) return; // do nothing.\n\n\t$auth_request = liberatid_begin_consumer( $claimed_url );\n\n\tif ( null === $auth_request ) {\n\t\tliberatid_status('error');\n\t\tliberatid_message(sprintf(\n\t\t\t__('Could not discover an OpenID identity server endpoint at the url: %s', 'liberatid'),\n\t\t\thtmlentities($claimed_url)\n\t\t));\n\n\t\treturn;\n\t}\n\n\t@session_start();\n\t$_SESSION['liberatid_action'] = $action;\n\t$_SESSION['liberatid_finish_url'] = $finish_url;\n\n\t$extensions = apply_filters('liberatid_auth_request_extensions', array(), $auth_request);\n\tforeach ($extensions as $e) {\n\t\tif (is_a($e, 'Auth_OpenID_Extension')) {\n\t\t\t$auth_request->addExtension($e);\n\t\t}\n\t}\n\n\t$return_to = liberatid_service_url('consumer', 'login_post');\n\t$return_to = apply_filters('liberatid_return_to', $return_to);\n\n\t$trust_root = liberatid_trust_root($return_to);\n\n\tliberatid_redirect($auth_request, $trust_root, $return_to);\n\texit(0);\n}", "public function loginWithFacebook() {\n\n\t\t// get data from input\n\t\t$code = Request::get( 'code' );\n\n\t\t// get fb service\n\t\t$fb = \\OAuth::consumer( 'Facebook' );\n\n\t\t$input = Request::all();\n\n\t\t$arr = $this->iplookup();\n\t\tif (isset($input)) {\n\t\t\tif (!Session::has('signup_params')) {\n\t\t\t\tSession::put('signup_params', $input);\n\t\t\t}\n\t\t\tif (!Cache::has(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'])) {\n\t\t\t\tCache::put(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'], $input, 5);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check if code is valid\n\t\t// if code is provided get user data and sign in\n\t\tif ( !empty( $code ) ) {\n\n\t\t\t// This was a callback request from facebook, get the token\n\t\t\t$token = $fb->requestAccessToken( $code );\n\n\t\t\t// Send a request with it\n\t\t\t$result = json_decode( $fb->request( '/me?fields=id,name,email,first_name,last_name' ), true );\n\n\t\t\t$id = $result['id'];\n\t\t\tif ( isset($result['email'] )) {\n\t\t\t\t$email = $result['email'];\n\t\t\t} else {\n\t\t\t\t$email = 'none';\n\t\t\t}\n\t\t\t$first_name = $result['first_name'];\n\t\t\t$last_name = $result['last_name'];\n\t\t\t$rnd = str_random( 20 );\n\t\t\t$password = $rnd;\n\n\t\t\t//Check if id is in the database.\n\t\t\t$user = User::on('rds1')->where( 'fb_id', '=', $result['id'] );\n\n\t\t\tif ($email !== 'none') {\n\t\t\t\t$user = $user->orWhere('email', $email);\n\t\t\t}\n\n\t\t\t$user = $user->first();\n\n\t\t\tif ( $user ) {\n\t\t\t\t//Auth::login( $user );\n\t\t\t\tAuth::loginUsingId( $user->id, true );\n\t\t\t\t$this->setAjaxToken( Auth::user()->id );\n\t\t\t\tSession::put('userinfo.session_reset', 1);\n\n\t\t\t\t$data = $this->setSignedInUserData();\n\n\t\t\t\tif(Session::has('redirect')){\n\t\t\t\t\t$redirect = Session::get('redirect');\n\n\t\t\t\t\treturn redirect($redirect);\n\t\t\t\t}\n\n if( Session::has('redirect_from_signin') ){\n \t$redirect = Session::get('redirect_from_signin');\n \tif (substr($redirect, 0, 1) == '/') {\n \t\t$path = $redirect;\n \t}else{\n \t\t$path = '/'. $redirect;\n \t}\n Session::forget('redirect_from_signin');\n\n // Don't redirect here!!!! this was a bug.\n if ($path !== 'ajax/profile/getnotifications' && $path !== '/ajax/profile/getnotifications') {\n \treturn redirect($path);\n }\n }\n\n\t\t\t\tif (isset($data['is_organization']) && $data['is_organization'] == 1) {\n\t\t\t\t\treturn redirect()->intended( '/admin' );\n\t\t\t\t}\n\n\t\t\t\tif (isset($data['agency_collection'])) {\n\t\t\t\t\treturn redirect()->intended( '/agency' );\n\t\t\t\t}\n\n\t\t\t\tif( (isset($user->profile_percent) && $user->profile_percent < 30) ||\n\t\t\t\t\t(!isset($user->email) || empty($user->email) || $user->email == 'none') ){\n\t\t\t\t\t// return redirect()->intended('/social/one-app');\n\t\t\t\t\treturn redirect()->intended('/get_started');\n\t\t\t\t}\n\n\t\t\t\treturn redirect( '/home' );\n\t\t\t} else {\n\t\t\t\t$user = new User;\n\t\t\t\t$user->fb_id = $result['id'];\n\t\t\t\t$user->fname = $result['first_name'];\n\t\t\t\t$user->lname = $result['last_name'];\n\t\t\t\t$user->email = $email;\n\t\t\t\t$user->password = Hash::make( $password );\n\t\t\t\t$user->email_confirmed = 1;\n \n $ip_lookup = $this->iplookup();\n\n\t\t\t\tif (Session::has('signup_params')) {\n\t\t\t\t\t$signup_params = Session::get('signup_params');\n\t\t\t\t\t\n\t\t\t\t\t$user->utm_source = isset($signup_params['utm_source']) ? $signup_params['utm_source'] : '';\n\t\t\t\t\t$user->utm_medium = isset($signup_params['utm_medium']) ? $signup_params['utm_medium'] : '';\n\t\t\t\t\t$user->utm_content = isset($signup_params['utm_content']) ? $signup_params['utm_content'] : '';\n\t\t\t\t\t$user->utm_campaign = isset($signup_params['utm_campaign']) ? $signup_params['utm_campaign'] : '';\n\t\t\t\t\t$user->utm_term = isset($signup_params['utm_term']) ? $signup_params['utm_term'] : '';\n\t\t\t\t\n\t\t\t\t}elseif(Cache::has(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip'])){\n\t\t\t\t\t$signup_params = Cache::get(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip']);\n\t\t\t\t\t\n\t\t\t\t\t$user->utm_source = isset($signup_params['utm_source']) ? $signup_params['utm_source'] : '';\n\t\t\t\t\t$user->utm_medium = isset($signup_params['utm_medium']) ? $signup_params['utm_medium'] : '';\n\t\t\t\t\t$user->utm_content = isset($signup_params['utm_content']) ? $signup_params['utm_content'] : '';\n\t\t\t\t\t$user->utm_campaign = isset($signup_params['utm_campaign']) ? $signup_params['utm_campaign'] : '';\n\t\t\t\t\t$user->utm_term = isset($signup_params['utm_term']) ? $signup_params['utm_term'] : '';\n\n\t\t\t\t\tCache::forget(env('ENVIRONMENT') .'_'.'signup_params_'.$arr['ip']);\n\t\t\t\t}\t\t\n\n\t\t\t\t$arr = $this->iplookup();\n\n\t\t\t\tif (isset($arr['countryName'])) {\n\t\t\t\t\t$countries = Country::where('country_name', $arr['countryName'])->first();\n\t\t\t\t\tif (isset($countries)) {\n\t\t\t\t\t \t$user->country_id = $countries->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$user->save();\n\t\t\t\t$confirmation = str_random( 20 );\n\t\t\t\t$token = new ConfirmToken( array( 'token' => $confirmation ) );\n\t\t\t\t$user->confirmtoken()->save( $token );\n\n\t\t\t\t\n\t\t\t\t/************MAILCHIMP WELCOME EMAIL ***********/\n\n\t\t\t\t// if (isset($result['email'])) {\n\n\t\t\t\t// \t$dt = array();\n\t\t\t\t// \t$dt['email'] = $result['email'];\n\t\t\t\t// \t$dt['fname'] = $result['first_name'];\n\t\t\t\t// \t$dt['lname'] = $result['last_name'];\n\n\t\t\t\t// \t$this->integrateMailChimp($dt);\n\t\t\t\t// }\n\t\t\t\t/************END OF MAILCHIMP WELCOME EMAIL*****/\n\n\t\t\t\tAuth::loginUsingId( $user->id, true );\n\t\t\t\t$this->setAjaxToken( Auth::user()->id );\n\t\t\t\tSession::put('userinfo.session_reset', 1);\n\t\t\t\t\n\t\t\t\t$data = $this->setSignedInUserData();\n\n\t\t\t\tif(Session::has('redirect') || Cache::has('AuthController_redirect_'. $arr['ip'])){\n\t\t\t\t\t\n\t\t\t\t\tif (Cache::has('AuthController_redirect_'. $arr['ip'])) {\n\t\t\t\t\t\t$redirect = Cache::get('AuthController_redirect_'. $arr['ip']);\n\t\t\t\t\t\tCache::forget('AuthController_redirect_'. $arr['ip']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$redirect = Session::get('redirect');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn redirect($redirect);\n\t\t\t\t}\n\n if( Session::has('redirect_from_signin') ){\n $path = '/'.Session::get('redirect_from_signin');\n Session::forget('redirect_from_signin');\n return redirect($path);\n }\n\n\t\t\t\tif (isset($data['is_organization']) && $data['is_organization'] == 1) {\n\t\t\t\t\treturn redirect()->intended( '/admin' );\n\t\t\t\t}\n\n\t\t\t\tif (isset($data['agency_collection'])) {\n\t\t\t\t\treturn redirect()->intended( '/agency' );\n\t\t\t\t}\n\n // if (isset($ip_lookup) && $ip_lookup['countryName'] == 'United States') {\n // return redirect()->intended( '/get_started' );\n // } else {\n // // return redirect()->intended( '/social/one-app' );\n // return redirect()->intended('/get_started');\n // }\n \n return redirect()->intended('/get_started');\n\t\t\t\t// $ucq = UsersCustomQuestion::on('rds1')->where('user_id', Auth::user()->id)->first();\n\n\t\t\t\t// if (isset($ucq)) {\n\t\t\t\t// \t$step = $ucq->application_state;\n\n\t\t\t\t// \tif (isset($step) && !empty($step) && $step == 'submit') {\n\t\t\t\t// \t\treturn redirect()->intended( '/portal/collegesrecruityou' );\n\t\t\t\t// \t}else if (isset($step) && !empty($step)) {\n\t\t\t\t// \t\treturn redirect()->intended( '/social/one-app/'.$step);\n\t\t\t\t// \t}else{\n\t\t\t\t// \t\treturn redirect()->intended( '/social/one-app/');\n\t\t\t\t// \t}\n\t\t\t\t// }\n\n\t\t\t\t// if( isset($user->profile_percent) && $user->profile_percent < 30 ||\n\t\t\t\t// \t(!isset($user->email) || empty($user->email) || $user->email == 'none') ){\n\t\t\t\t// \t// return redirect()->intended('/social/one-app');\n\t\t\t\t// \treturn redirect()->intended('/get_started');\n\t\t\t\t// }\n\t\t\t\t// if (isset($arr['countryAbbr']) && $arr['countryAbbr'] != 'US') {\n\t\t\t\t// \treturn redirect( '/international-students' );\n\t\t\t\t// }\n\t\t\t\t// return redirect( '/home' );\n\t\t\t}\n\t\t}\n\t\t// if not ask for permission first\n\t\telse {\n\t\t\t// get fb authorization\n\t\t\t$url = $fb->getAuthorizationUri();\n\n\t\t\t// return to facebook login url\n\t\t\treturn redirect( (string)$url );\n\t\t}\n\t}", "public function fb_login( array $data )\n\t{\n\t\tif( !empty( $data ) ){\n\t\t\t// Trim all the incoming data:\n\t\t\t$trimmed_data = array_map('trim', $data);\n\t\t\t//print_r($trimmed_data); die();\n\t\t}\t\n\t\t\n\t\t// escape variables for security\n\t\t$name = mysqli_real_escape_string( $this->_con, $trimmed_data['name'] );\n\t\t$email = mysqli_real_escape_string( $this->_con, $trimmed_data['email'] );\n\t\t$social_id = mysqli_real_escape_string( $this->_con, $trimmed_data['id'] );\n\t\t$fb_image = mysqli_real_escape_string( $this->_con, $trimmed_data['image'] );\n\t\t\n\t\t\n\t\t$query = \"SELECT id, name, email, user_picture regDate, user_type FROM users where email = '$email' and social_id = '$social_id' \";\n\t\t$result = mysqli_query($this->_con, $query);\n\t\t$data = mysqli_fetch_assoc($result);\n\t\t$uid = $data['id'];\n\t\t$username = $data['name'];\n\t\t$count = mysqli_num_rows($result);\n\t\tif( $data >= 1){\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t$uip=$_SERVER['REMOTE_ADDR'];\n\t\t\t$status=0;\n\t\t\t$log=mysqli_query($this->_con, \"insert into userlog(userEmail,userip,status) values('\".$email.\"','$uip','$status')\");\n\t\t\t}\n\t\tif( $count >= 1){\n\t\t\t$_SESSION = $data;\n\t\t\t$_SESSION['login'] = true;\n\t\t\t$_SESSION['username'] = $username;\n\t\t\t$this->coins_by_social_login();\n\t\t\t$result = $this->get_points_supplement();\n\t\t\t$points_by_login = $result['points_by_login'];\n\t\t\t$date_of_points_get = $this->points_get_date($uid,'By Social Login');\n $cur_date_12= date(\"Y-m-d\");\n\t\t\tif($cur_date_12 > $date_of_points_get)\n\t\t\t{\n\t\t\t $this->set_user_points($uid,$points_by_login,'By Social Login');\n\t\t\t $this->set_points_users($uid,$points_by_login);\n\t\t\t}\n\t\t\t$_SESSION['UserEmail'] = $email;\n\t\t\t$_SESSION['username'] = $username;\n\t\t\t$uip=$_SERVER['REMOTE_ADDR'];\n\t\t\t$status=1;\n\t\t\t$logindate=date(\"Y-m-d\");\n\t\t\t$log=mysqli_query($this->_con, \"insert into userlog(user_id,userEmail,userip,status,logindate) values('$uid','\".$_SESSION['UserEmail'].\"','$uip','$status','$logindate')\");\n\t\t\treturn true;\n\t\t}else{\n\t\t\t\n\t\t\t$password = $this->randomPassword();\n\t\t\t$password1 = md5( $password );\n\t\t\t/*Generate referal code for user*/\n\t\t\t$chars = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t$res = \"\";\n\t\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t\t$res .= $chars[mt_rand(0, strlen($chars)-1)];\n\t\t\t}\n\t\t\t$result = substr($name, 0, 4);\n\t\t\t$rel_lo =strtoupper($result);\n\t\t\t$referal_code = $rel_lo . '_' . $res;\n\t\t\t/*End of Generate referal code for user*/\n\t\t\t$query = \"INSERT INTO users (id, password, name,username, email, social_id, user_picture,referal_code, regDate) VALUES (NULL, '$password1', '$name','$name', '$email', '$social_id', '$fb_image','$referal_code', CURRENT_TIMESTAMP)\";\n\t\t\t$query2 = mysqli_query($this->_con, \"update `users` set online = 1 where id = '\".$uid.\"'\");\n $res = mysqli_query($this->_con, \"UPDATE `users` SET online=1, last_active_timestamp = NOW() WHERE id = {$uid};\");\n\t\t\tif(mysqli_query($this->_con, $query)){\n\t\t\t\t$to = $email;\n\t\t\t\t$subject = \"Account Create - SmartTutorials.net\";\n\t\t\t\t$txt = \"Your Email \".$email;\n\t\t\t\t$txt .= \"<br/>Your New Password \".$password;\n\t\t\t\t$headers = \"From: [email protected]\" . \"\\r\\n\" .\n\t\t\t\t\t\t\"CC: [email protected]\";\n\t\t\t\t\t\n\t\t\t\tmail($to,$subject,$txt,$headers);\n\t\t\t}\n\t\t\t\n\t\t\t$query = \"SELECT id, name, email, regDate, user_type FROM users where email = '$email' and social_id = '$social_id' \";\n\t\t\t$result = mysqli_query($this->_con, $query);\n\t\t\t$data = mysqli_fetch_assoc($result);\n\t\t\t$count = mysqli_num_rows($result);\n\t\t\tif( $count >= 1){\n\t\t\t\t$_SESSION = $data;\n\t\t\t\t$_SESSION['login'] = true;\n\t\t\t\t//$this->coins_by_login();\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tthrow new Exception( LOGIN_FAIL );\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t\n\t}", "function verify() {\n\t\t$openid_identifier = getPost('openid_identifier');\n\t\t$provider = getPost('provider');\n\t\tswitch ($provider) {\n\t\t\tcase 'facebook':\n\t\t\t\tredirect('/user/fbconnect');\n\t\t\t\tbreak;\n\t\t\tcase 'google':\n\t\t\t\t$url = 'https://www.google.com/accounts/o8/id';\n\t\t\t\tbreak;\n\t\t\tcase 'yahoo':\n\t\t\t\t$url = 'http://yahoo.com';\n\t\t\t\tbreak;\n\t\t\tcase 'aol':\n\t\t\t\t$url = 'http://openid.aol.com/'.$openid_identifier;\n\t\t\t\tbreak;\n\t\t\tcase 'openid':\n\t\t\t\t$url = $openid_identifier;\n\t\t\t\tbreak;\n\t\t\tcase 'myopenid':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.myopenid.com';\n\t\t\t\tbreak;\n\t\t\tcase 'livejournal':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.livejournal.com';\n\t\t\t\tbreak;\n\t\t\tcase 'flickr':\n\t\t\t\t$url = 'http://flickr.com/'.$openid_identifier;\n\t\t\t\tbreak;\n\t\t\tcase 'technorati':\n\t\t\t\t$url = 'http://technorati.com/people/technorati/'.$openid_identifier;\n\t\t\t\tbreak;\n\t\t\tcase 'wordpress':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.wordpress.com';\n\t\t\t\tbreak;\n\t\t\tcase 'blogger':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.blogspot.com';\n\t\t\t\tbreak;\n\t\t\tcase 'verisign':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.pip.verisignlabs.com';\n\t\t\t\tbreak;\n\t\t\tcase 'vidoop':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.myvidoop.com';\n\t\t\t\tbreak;\n\t\t\tcase 'verisign':\n\t\t\t\t$url = 'http://'.$openid_identifier.'.pip.verisignlabs.com';\n\t\t\t\tbreak;\n\t\t\tcase 'claimid':\n\t\t\t\t$url = 'http://claimid.com/'.$openid_identifier;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$url = NULL;\n\t\t\t\tbreak;\n\t\t}\n\t\t$url = preg_replace('/\\/$/', '', $url);\n\t\trequire_once 'Auth/OpenID/Consumer.php';\n\t\trequire_once 'Auth/OpenID/MemcachedStore.php';\n\t\t$cache = cache::getInstance();\n\t\t$store = new Auth_OpenID_MemcachedStore($cache);\n\t\t$consumer = new Auth_OpenID_Consumer($store);\n\t\t$auth = $consumer->begin($url);\n\t\tif ($auth) {\n\t\t\t$siteURL = systemSettings::get('SITEURL');\n\t\t\tif (!preg_match('/^http/', $siteURL)) {\n\t\t\t\t$siteURL = 'http://'.$siteURL;\n\t\t\t}\n\t\t\t$url = $auth->redirectURL($siteURL, $siteURL.'/user/openid/action/authorize');\n\t\t} else {\n\t\t\taddError('c\\'mon now, you submitted an unrecognized id or provider');\n\t\t\t$url = '/user/login';\n\t\t}\n\t\t$_SESSION['auth'] = array(\n\t\t\t'provider' => $provider,\n\t\t\t'time' => time()\n\t\t);\n\t\tredirect($url);\n\t}", "function sflogin()\n\t{\n\t\t$hash = $this->args['dsnp_hash'];\n\t\t$this->submitFriendLogin( $hash );\n\t}", "function login( $provider = \"jabali\" )\r\n{\r\n\t$theme = getOption( 'activetheme' );\r\n\tif ( file_exists( _ABSTHEMES_ . $theme . '/templates/login.php') ) {\r\n\t\t$themefile = _ABSTHEMES_ . $theme . '/templates/login.php';\r\n\t} elseif ( file_exists( _ABSTHEMES_ . $theme . '/templates/signin.php') ) {\r\n\t\t$themefile = _ABSTHEMES_ . $theme . '/templates/signin.php';\r\n\t} else {\r\n\t\t$themefile = \"\";\r\n\t}\r\n\r\n\tif ( $themefile !== \"\" ) {\r\n\t\tgetHeader();\r\n\t\trequire_once ( $themefile );\r\n\t\tgetFooter();\r\n\t} else {\r\n\t\ttheHeader();\r\n\t\tif ( $provider == \"jabali\" || empty( $provider ) ) { ?>\r\n\t\t\t \t<title>Sign In <?php if( isset( $_GET['alert'] )){ echo( ucfirst( $_GET['alert'] ) ); } ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t\t\t \trenderView( 'login' );\r\n\t\t} elseif ( $provider == \"facebook\" || $provider == \"twitter\" || $provider == \"github\" || $provider == \"google\" ) { ?>\r\n\t\t \t<title>Sign In - <?php showOption( 'name' ); ?></title><?php\r\n\t\t \tinclude 'app/lib/hybridauth/config.php';\r\n\t\t \trequire_once( 'app/lib/hybridauth/Hybrid/Auth.php' );\r\n\t\t\ttry {\r\n\t\t $hybridauth = new \\Hybrid_Auth( $config );\r\n\t\t $authProvider = $hybridauth -> authenticate( $provider );\r\n\t\t $user_profile = $authProvider -> getUserProfile();\r\n\t\t\t if ( $user_profile && isset( $user_profile->identifier ) ) {\r\n\t\t\t echo \"<b>Name</b> :\".$user_profile->displayName.\"<br>\";\r\n\t\t\t echo \"<b>Profile URL</b> :\".$user_profile->profileURL.\"<br>\";\r\n\t\t\t echo \"<b>Image</b> :\".$user_profile->photoURL.\"<br> \";\r\n\t\t\t echo \"<img src='\".$user_profile->photoURL.\"'/><br>\";\r\n\t\t\t echo \"<b>Email</b> :\".$user_profile->email.\"<br>\";\r\n\t\t\t echo \"<br> <a href='logout.php'>Logout</a>\";\r\n\t\t\t }\r\n\t\t }\r\n\r\n\t\t catch( Exception $e ) {\r\n\t\t switch( $e->getCode() )\r\n\t\t {\r\n\t\t case 0 : echo \"Unspecified error.\"; break;\r\n\t\t case 1 : echo \"Hybridauth configuration error.\"; break;\r\n\t\t case 2 : echo \"Provider not properly configured.\"; break;\r\n\t\t case 3 : echo \"Unknown or disabled provider.\"; break;\r\n\t\t case 4 : echo \"Missing provider application credentials.\"; break;\r\n\t\t case 5 : echo \"Authentication failed The user has canceled the authentication or the provider refused the connection.\";\r\n\t\t break;\r\n\t\t case 6 : echo \"User profile request failed. Most likely the user is not connected to the provider and he should to authenticate again.\";\r\n\t\t $authProvider->logout();\r\n\t\t break;\r\n\t\t case 7 : echo \"User not connected to the provider.\";\r\n\t\t $authProvider->logout();\r\n\t\t break;\r\n\t\t case 8 : echo \"Provider does not support this feature.\"; break;\r\n\t\t }\r\n\r\n\t\t echo \"<br /><br /><b>Original error message:</b> \" . $e->getMessage();\r\n\r\n\t\t echo \"<hr /><h3>Trace</h3> <pre>\" . $e->getTraceAsString() . \"</pre>\";\r\n\t\t }\r\n\t\t} else { ?>\r\n\t\t\t<title>Sign In <?php if( isset( $_GET['alert'] )){ echo( ucfirst( $_GET['alert'] ) ); } ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t\t\t\trenderView( 'login' );\r\n\t\t\t }\r\n\t\ttheFooter();\r\n\t}\r\n}", "function loginToFb($param){\n\t$login_url = $GLOBALS['facebook']->getLoginUrl($param);\n\trequire 'templates/login.php';\n\t//echo 'Please <a href=\"' . $login_url . '\">login.</a>';\n}", "public function fb_login($fb_data) {\n $first_name = $fb_data['first_name'];\n $last_name = $fb_data['last_name'];\n $fb_id = $fb_data['id'];\n // $fb_email = $fb_data['email'];\n\n $this -> db -> select('Id');\n $this -> db -> from('users');\n $this -> db -> where(array(\n 'FacebookId' => $fb_id,\n 'IsActive' => 1,\n 'IsRemoved' => 0\n ));\n $this -> db -> limit(1);\n\n $query = $this -> db -> get();\n\n // If exists, login ( set session data ) else register and then login( set session data )\n if ($query -> num_rows() > 0) {\n $this -> insert_user_preference($query -> row() -> Id);\n return $query -> row() -> Id;\n }\n else {\n $ImageName = generateRandomString(20) . '.jpg';\n $large = $this -> DownloadImage('https://graph.facebook.com/' . $fb_id . '/picture?type=large&access_token=176514089453791|8a5718f25f7e959d5e22024cf76f264d', './assets/images/users/large/' . $ImageName);\n $medium = $this -> DownloadImage('https://graph.facebook.com/' . $fb_id . '/picture?type=large&access_token=176514089453791|8a5718f25f7e959d5e22024cf76f264d', './assets/images/users/medium/' . $ImageName);\n $small = $this -> DownloadImage('https://graph.facebook.com/' . $fb_id . '/picture?type=large&access_token=176514089453791|8a5718f25f7e959d5e22024cf76f264d', './assets/images/users/small/' . $ImageName);\n $original = $this -> DownloadImage('https://graph.facebook.com/' . $fb_id . '/picture?type=large&access_token=176514089453791|8a5718f25f7e959d5e22024cf76f264d', './assets/images/users/original/' . $ImageName);\n if (!$large || !$medium || !$small || !$original) {\n $ImageName = '';\n }\n $insert_data = array('FacebookId' => $fb_id\n , 'FirstName' => $first_name\n , 'LastName' => $last_name,\n 'ProfileImage' => $ImageName,\n 'SocialMedia' => 'Facebook'\n );\n\n return $this -> register($insert_data);\n }\n }", "public static function login($args) {\n\t\t$bool = false;\n\n\t\t$openid = new LightOpenID(APP_HOST);\n\n\t\ttry {\n\t\t\tif (array_key_exists('openid_mode', $_GET) && trim($_GET['openid_mode']) != '') {\n\t\t\t\tif ($openid->validate()) {\n\t\t\t\t\t$bool = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$openid->identity = 'https://www.google.com/accounts/o8/id';\n\t\t\t\t$openid->required = array('contact/email');\n\t\t\t\theader('Location: ' . $openid->authUrl());\n\t\t\t\texit(1);\n\t\t\t}\n\t\t} catch(ErrorException $e) {\n\t\t\ttrigger_error($e->getMessage());\n\t\t}\n\t\t\n\t\tif (!$bool) { // didn't successfully login\n\t\t\theader(\"Location: http://www.google.com\");\n\t\t} else { // successfully logged in\n\t\t\t$attr = $openid->getAttributes();\n\t\t\t$googleId = trim($attr['contact/email']);\n\n\t\t\t$user = new User($googleId);\n\t\t\t$_SESSION['authorizeduser'] = array();\n\n\t\t\tif ($user->getExisting()) {\n\t\t\t\t$_SESSION['authorizeduser']['auth'] = true;\n\t\t\t\t$_SESSION['authorizeduser']['google'] = $googleId;\n\n\t\t\t\tif ($user->getUsername() == '') {\n\t\t\t\t\theader('Location: ' . APP_URL . '/newaccount/');\n\t\t\t\t} else {\n\t\t\t\t\t$_SESSION['authorizeduser']['username'] = $user->getUsername();\n\t\t\t\t\tif (array_key_exists('redirect_url', $_SESSION) && $_SESSION['redirect_url'] != ''){\n\t\t\t\t\t\theader('Location: ' . $_SESSION['redirect_url']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader('Location: ' . APP_URL . '/' . $user->getUsername());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else { // new user\n\t\t\t\t$_SESSION['authorizeduser']['auth'] = true;\n\t\t\t\t$_SESSION['authorizeduser']['google'] = $googleId;\n\n\t\t\t\t$user->setGoogleIdentifier($googleId);\n\t\t\t\t$user->setEmail($googleId);\n\t\t\t\t$user->save();\n\n\t\t\t\theader('Location: ' . APP_URL . '/newaccount/');\n\t\t\t}\n\t\t}\n\t}", "function good_login()\n\t{\n\t}", "public function testCreateFacebookId()\n {\n\n }", "public function loginFacebook(){\n\t\t $code = Input::get( 'code' );\n\n\t\t // get fb service\n\t\t $fb = OAuth::consumer( 'Facebook' );\n\n\t\t // check if code is valid\n\n\t\t // if code is provided get user data and sign in\n\t\t if ( !empty( $code ) ) {\n\n\t\t // This was a callback request from facebook, get the token\n\t\t $token = $fb->requestAccessToken( $code );\n\n\t\t // Send a request with it\n\t\t $result = json_decode( $fb->request( '/me' ), true );\n\n\t\t $message = 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];\n\t\t echo $message. \"<br/>\";\n\n\t\t //Var_dump\n\t\t //display whole array().\n\t\t dd($result);\n\n\t\t }\n\t\t // if not ask for permission first\n\t\t else {\n\t\t // get fb authorization\n\t\t $url = $fb->getAuthorizationUri();\n\n\t\t // return to facebook login url\n\t\t return Redirect::to( (string)$url );\n\t\t }\n\n\t}", "private function isOpenidProvider($identity)\n\t{\n\t\t// add http prefix if its not an email\n\t\tif(strpos($identity, '@') === false && substr($identity, 0, 7) != 'http://' && substr($identity, 0, 8) != 'https://')\n\t\t{\n\t\t\t$identity = 'http://' . $identity;\n\t\t}\n\n\n\t\t// build callback\n\t\t$callback = $this->page->url . '/login/callback';\n\n\n\t\t// create an openid object\n\t\t$http = new PSX_Http(new PSX_Http_Handler_Curl());\n\t\t$store = new PSX_OpenId_Store_Sql($this->sql, $this->registry['table.system_assoc']);\n\t\t$openid = new PSX_OpenId($http, $this->config['psx_url'], $store);\n\n\n\t\t// check whether identity is an url if not it is an email\n\t\t$filter = new PSX_Filter_Url();\n\n\t\tif($filter->apply($identity) !== false)\n\t\t{\n\t\t\t$openid->initialize($identity, $callback);\n\n\t\t\treturn $openid;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pos = strpos($identity, '@');\n\t\t\t$provider = substr($identity, $pos + 1);\n\n\t\t\t// we check whether the email provider is an known openid porivder\n\t\t\tswitch($provider)\n\t\t\t{\n\t\t\t\tcase 'googlemail.com':\n\t\t\t\tcase 'gmail.com':\n\n\t\t\t\t\t$openid = new PSX_OpenId_Op_Google($http, $this->config['psx_url'], $store);\n\n\t\t\t\t\t$openid->initialize($identity, $callback);\n\n\t\t\t\t\treturn $openid;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'yahoo.com':\n\n\t\t\t\t\t$openid = new PSX_OpenId_Op_Yahoo($http, $this->config['psx_url'], $store);\n\n\t\t\t\t\t$openid->initialize($identity, $callback);\n\n\t\t\t\t\treturn $openid;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'aol.com':\n\t\t\t\tcase 'aim.com':\n\n\t\t\t\t\t$openid = new PSX_OpenId_Op_Aol($http, $this->config['psx_url'], $store);\n\n\t\t\t\t\t$openid->initialize($identity, $callback);\n\n\t\t\t\t\treturn $openid;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\t// check whether the provider belongs to an connected website. If\n\t\t\t\t\t// yes we also try to get an token and tokenSecret for the user\n\t\t\t\t\t$host = Amun_Sql_Table_Registry::get('System_Host')\n\t\t\t\t\t\t->select(array('id', 'consumerKey', 'url', 'template'))\n\t\t\t\t\t\t->where('name', '=', $provider)\n\t\t\t\t\t\t->where('status', '=', Amun_System_Host::NORMAL)\n\t\t\t\t\t\t->getRow();\n\n\t\t\t\t\tif(!empty($host))\n\t\t\t\t\t{\n\t\t\t\t\t\t// make webfinger request\n\t\t\t\t\t\t$http = new PSX_Http(new PSX_Http_Handler_Curl());\n\t\t\t\t\t\t$webfinger = new PSX_Webfinger($http);\n\n\t\t\t\t\t\t$acct = 'acct:' . $identity;\n\t\t\t\t\t\t$xrd = $webfinger->getLrdd($acct, $host['template']);\n\n\t\t\t\t\t\t// check subject\n\t\t\t\t\t\tif(strcmp($xrd->getSubject(), $acct) !== 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Amun_Exception('Invalid subject');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// get profile url\n\t\t\t\t\t\t$profileUrl = $xrd->getLinkHref('profile');\n\n\t\t\t\t\t\tif(empty($profileUrl))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Amun_Exception('Could not find profile');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// get global id\n\t\t\t\t\t\t$globalId = $xrd->getPropertyValue('http://ns.amun-project.org/2011/meta/id');\n\n\n\t\t\t\t\t\t// initalize openid\n\t\t\t\t\t\t$openid->initialize($profileUrl, $callback);\n\n\n\t\t\t\t\t\t// if the provider is connected with the website and\n\t\t\t\t\t\t// supports the oauth extension request an token\n\t\t\t\t\t\t$identity = sha1(Amun_Security::getSalt() . PSX_OpenId::normalizeIdentifier($profileUrl));\n\t\t\t\t\t\t$con = new PSX_Sql_Condition(array('identity', '=', $identity));\n\t\t\t\t\t\t$userId = Amun_Sql_Table_Registry::get('User_Account')->getField('id', $con);\n\t\t\t\t\t\t$oauth = false;\n\n\t\t\t\t\t\tif(!empty($userId))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$con = new PSX_Sql_Condition();\n\t\t\t\t\t\t\t$con->add('hostId', '=', $host['id']);\n\t\t\t\t\t\t\t$con->add('userId', '=', $userId);\n\n\t\t\t\t\t\t\t$requestId = Amun_Sql_Table_Registry::get('System_Host_Request')->getField('id', $con);\n\n\t\t\t\t\t\t\tif(empty($requestId))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oauth = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oauth = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($oauth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oauth = new PSX_OpenId_Extension_Oauth($host['consumerKey']);\n\n\t\t\t\t\t\t\tif($openid->hasExtension($oauth->getNs()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->session->set('openid_register_user_host_id', $host['id']);\n\t\t\t\t\t\t\t\t$this->session->set('openid_register_user_global_id', $globalId);\n\n\t\t\t\t\t\t\t\t$openid->add($oauth);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\treturn $openid;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// @todo we could make an webfinger request to get more informations\n\t\t\t// about the user ...\n\t\t}\n\n\t\treturn false;\n\t}", "function login($username, $name, $id) {\n\t\tsession_regenerate_id();\n\n\t\t$_SESSION['logged_in_username'] = $username;\n\t\t$_SESSION['logged_in_doctor'] = $name;\n\t\t$_SESSION['logged_in_id'] = $id;\n\t}", "function loginUser($user_id, $email, $nickname, $permissions_id) {\n $_SESSION['user_id'] = $user_id;\n // Save the email for use later\n $_SESSION['email'] = $email;\n // Save the username for use later\n $_SESSION['nickname'] = $nickname;\n //save the permissions id\n $_SESSION['permissions_id'] = $permissions_id;\n //save Facebook ID\n if ($fb_id = get_fb_id($user_id)) {\n $_SESSION['fb_id'] = $fb_id;\n }\n //Log the Login\n log_this_action (login_action(), login_basic_action());\n}", "function scratchpad_logins_submit(){\n // via /user (which won't allow us to alter whom we are logged in as if we are\n // already logged in).\n global $user;\n if(variable_get('site_offline', 0) && !$user->uid){\n openid_begin($_POST['openid'], url('user', array(\n 'absolute' => TRUE,\n 'query' => array(\n 'uid' => $_POST['uid']\n )\n )));\n }else{\n openid_begin($_POST['openid'], url('logins/return/' . $_POST['uid'], array(\n 'absolute' => TRUE\n )));\n }\n}", "public function eduid(){\n // user, idp_user\n $saml_lib = FCPATH.\"../application/vendor/simplesaml/simplesamlphp/lib/\";\n require_once $saml_lib.\"_autoload.php\";\n require_once $saml_lib.\"SimpleSAML/Auth/Simple.php\";\n\n $simpleSaml = new SimpleSAML_Auth_Simple('kooplex-veo-eduid-sp');\n\n\t$simpleSaml->requireAuth([\n \t\t'ReturnTo' => 'https://kooplex-veo.elte.hu/consent/auth/eduid'\n\t]);\n $attr = $simpleSaml->getAttributes();\n $this->session->elte_data = json_encode($attr);\n\n\t$username = $attr['eduPersonPrincipalName'][0];\n $this->session->user = $username;\n $u_gusztustalan = preg_split ( '/@+/' , $username)[0];\n $this->session->idp_user = $u_gusztustalan; //strtolower($attr['username'][0]); //FIXME: the other attribute is empty!\n\n header(\"Location: /consent/consent/handle\");\n exit();\n }", "public function login() {\n $code = $this->CI->input->get('code');\n\n //if you have the code, you can authenticate the user and get the Access Token\n if ($code) {\n $this->client->authenticate();\n $this->CI->session->set_userdata('gplustoken', $this->client->getAccessToken());\n }\n\n //Setting up the Access Token\n if ($this->CI->session->userdata('gplustoken')) {\n $token = $this->CI->session->userdata('gplustoken');\n $this->client->setAccessToken($token);\n }\n\n //if you don´t have an Access Token, you will be redirected to the Google Login page.\n if (!$this->client->getAccessToken()) {\n $authUrl = $this->client->createAuthUrl();\n redirect($authUrl);\n }\n\n //This is the method to get all the user information\n $aGData = $this->plus->people->get('me');\n\n /*\n * Using Ion Auth methods to validate users. In this case, I use the email field as primary.\n * As Google doesn´t retrieve the user password, I use a fake one: 'googleplusdoesnothavepass123^&*%' for these users\n * If the user email is not registered in the system, I register it, with additional data as Name, Gender and Picture\n * Else, I login the user with his email and the fake password\n */\n if(!$this->CI->ion_auth_model->identity_check($aGData['emails'][0]['value'])){\n $register = $this->CI->ion_auth->register($aGData['displayName'], 'googleplusdoesnothavepass123^&*%', $aGData['emails'][0]['value'], array('first_name' => $aGData['name']['givenName'],'last_name'=>$aGData['name']['familyName'], 'avatar' => $aGData['image']['url']));\n if($register){\n $login = $this->CI->ion_auth->login($aGData['emails'][0]['value'], 'googleplusdoesnothavepass123^&*%', 1);\n }\n } else {\n $login = $this->CI->ion_auth->login($aGData['emails'][0]['value'], 'googleplusdoesnothavepass123^&*%', 1);\n }\n return true;\n }" ]
[ "0.6555699", "0.6514936", "0.6245241", "0.62148523", "0.6096465", "0.5880464", "0.58739394", "0.5829972", "0.5798805", "0.5785558", "0.5777304", "0.5758922", "0.5740323", "0.5723135", "0.57129204", "0.56996804", "0.56546086", "0.5642496", "0.5642178", "0.56394416", "0.56207186", "0.5618016", "0.5611356", "0.5600268", "0.55932534", "0.5582354", "0.55511993", "0.5517612", "0.5501618", "0.5481926" ]
0.7348768
0
Load possible timeslots that should be found
private function loadPossibleTimeSlots(ISource $source) { $input = $source->getData(); if (isset($input[Fields::POSSIBLE_TIME_SLOTS])) { $number = (int)$input[Fields::POSSIBLE_TIME_SLOTS]; if ($number < 1) { throw new \RuntimeException('Possible times-lots must be greater than 0'); } if ($number > self::MAX_NUMBER_OF_POSSIBLE_TIME_SLOTS) { $number = self::MAX_NUMBER_OF_POSSIBLE_TIME_SLOTS; } $this->data->setPossibleTimeSlots($number); } else { $this->data->setPossibleTimeSlots(self::DEFAULT_NUMBER_OF_POSSIBLE_TIME_SLOTS); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_all( $force_reload = FALSE ) {\n $starttime = microtime(true);\n echo \"Caricamento dati Italia ==> Tempo di esecuzione: \" . round(load_italia($force_reload),1) . \"s<br>\";\n echo \"Caricamento dati Italia ==> Tempo di esecuzione: \" . round(load_regioni($force_reload),1) . \"s<br>\";\n echo \"Caricamento dati Italia ==> Tempo di esecuzione: \" . round(load_province($force_reload),1) . \"s<br>\";\n $timediff = microtime(true) - $starttime;\n echo \"Tempo totale di esecuzione: \" . round($timediff,1) . \"s<br>\";\n}", "function load_slots()\n{\n\t$slot_db=fopen(SLOT_DB, 'c');\n\twhile(!flock($slot_db, LOCK_EX | LOCK_NB))\t\t//8 sekunden lang jede 100 millisekunden versuchen\n\t{\n\t\tif($count++>80)\n\t\t\tdie(http_return(503));\n\t\tusleep(100000);\n\t}\n\t//load db\n\t$active_slots=@unserialize(file_get_contents(SLOT_DB));\n\tif(!is_array($active_slots))\n\t\t$active_slots=array();\n\t//delete timed out slots\n\t$_active_slots=$active_slots;\n\tforeach($_active_slots as $uuid=>$time)\n\t\tif($time<time())\n\t\t\tunset($active_slots[$uuid]);\n\t//save db again\n\tfile_put_contents(SLOT_DB, serialize($active_slots));\n\tflock($slot_db, LOCK_UN);\n\tfclose($slot_db);\n\t\n\treturn $active_slots;\n}", "function Schedules_TimeLoad($event=array())\n {\n $timeids=\n $this->Sql_Select_Hashes\n (\n array\n (\n \"Unit\" => $this->Unit(\"ID\"),\n \"Event\" => $event[ \"ID\" ],\n ),\n array(\"Time\")\n );\n \n $timeids=$this->MyHash_HashesList_Key($timeids,$key=\"Time\");\n\n $chmins=0;\n foreach (array_keys($timeids) as $timeid)\n {\n $chmin=$this->TimesObj()->Sql_Select_Hash_Value($timeid,\"Duration\"); \n $chmins+=count($timeids[ $timeid ])*$chmin;\n }\n\n $onehour=60;\n\n $rchmins=intval($chmins);\n $nhours=$rchmins/$onehour;\n \n $rchmins-=$nhours*$onehour;\n\n return\n sprintf(\"%02d\",$nhours).\" hs \".\n sprintf(\"%02d\",$rchmins).\" min\".\n \"\";\n }", "public function getScheduleTimes();", "private function _findSlots()\n {\n $this->data = array();\n\n $slots = 0; // number of handled slots\n $groups = 0; // number of handled groups\n\n $multi_day_data = array(); // temporary data for multi-day services\n\n $next_month = null;\n $stop_group = null;\n if ( $this->at->show_calendar ) {\n $next_month = clone $this->date;\n if ( Config::useClientTimeZone() ) {\n // Add one day since it was subtracted in AvailableTime::_prepareDates\n //(when _findSlots is called the next time, this one day does not break anything).\n $next_month->add( $this->at->one_day );\n }\n $next_month->modify( 'first day of next month' );\n if ( $this->srv_duration_days > 1 ) {\n // For multi-day services check first days of the next month.\n $next_month->modify( ( $this->srv_duration_days - 1 ) . ' days' );\n }\n $stop_group = $next_month->format( 'Y-m-d' );\n }\n\n while ( true ) {\n $continue = false;\n // Check loop end conditions.\n if ( $this->at->params['break_on_first_fetched_day'] == false || $slots == 0 ) {\n if ( $this->_findNextDay() ) {\n if ( $this->at->show_calendar ) {\n if ( $this->date < $next_month ) {\n $continue = true;\n }\n } else {\n if ( $this->at->show_day_per_column ) {\n $continue = true; // this loop will break when $groups reaches 10 (see loop body)\n } elseif ( $slots < 100 ) {\n $continue = true; // 10 slots/column * 10 columns\n }\n }\n }\n }\n if ( ! $continue ) {\n break;\n }\n\n foreach ( $this->_findFrames() as $frame ) {\n $blocked = isset ( $frame['blocked'] );\n $not_full = isset ( $frame['not_full'] );\n // Loop from start to:\n // 1. end minus time slot length when 'blocked' or 'not_full' is set.\n // 2. end minus service duration when nothing is set.\n $end = null;\n if ( $blocked || $not_full ) {\n $end = $frame['end'] - $this->time_slot_length;\n } else {\n $end = $frame['end'] - $this->srv_duration - $this->extras_duration;\n }\n for ( $time = $frame['start']; $time <= $end; $time += $this->time_slot_length ) {\n\n $timestamp = $this->date->getTimestamp() + $time;\n $client_timestamp = $timestamp - $this->at->client_diff;\n\n if ( $timestamp < $this->at->current_timestamp || $client_timestamp < $this->at->req_timestamp ) {\n // Skip all slots in the past.\n // Also when we start 1 day before the requested date skip slots which do not fit the requested date in client's time zone.\n continue;\n }\n\n $group = date( 'Y-m-d', ( $this->srv_duration_days && ! $this->at->show_calendar )\n ? strtotime( 'first day of this month', $client_timestamp ) // group slots by months\n : $client_timestamp // group slots by days\n );\n\n if ( $this->at->show_calendar && $group == $stop_group ) {\n break;\n }\n\n // Create/update slots.\n if ( ! isset ( $this->data[ $group ][ $client_timestamp ] ) ) {\n $data = null;\n\n if ( $this->next_slots === null ) {\n $data = array( array( (int) $this->service->get( 'id' ), $frame['staff_id'], $timestamp ) );\n } else {\n $next_data = null;\n $next_timestamp = $client_timestamp + $this->srv_duration + $this->extras_duration;\n $next_group = date( 'Y-m-d', ( $this->next_slots->srv_duration_days && ! $this->at->show_calendar )\n ? strtotime( 'first day of this month', $next_timestamp )\n : $next_timestamp\n );\n $padding = $this->service->get( 'padding_right' ) + $this->next_slots->service->get( 'padding_left' );\n // Look for available slot for next service. There are 2 possible options:\n // 1. next service is done by another staff, then do not take into account padding\n // 2. next service is done by the same staff, then count padding\n if ( ( $slot = $this->next_slots->get( $next_group, $next_timestamp ) ) &&\n $slot['blocked'] == false &&\n ( $padding == 0 || $slot['data'][0][1] != $frame['staff_id'] )\n ) {\n $next_data = $slot['data'];\n } else {\n $next_timestamp += $padding;\n $next_group = date( 'Y-m-d', ( $this->next_slots->srv_duration_days && ! $this->at->show_calendar )\n ? strtotime( 'first day of this month', $next_timestamp )\n : $next_timestamp\n );\n if ( ( $slot = $this->next_slots->get( $next_group, $next_timestamp ) ) &&\n $slot['blocked'] == false &&\n $slot['data'][0][1] == $frame['staff_id']\n ) {\n $next_data = $slot['data'];\n }\n }\n // If slot is found, then add its data to the current slot data.\n if ( $next_data !== null ) {\n $data = array_merge( array( array( (int) $this->service->get( 'id' ), $frame['staff_id'], $timestamp ) ), $next_data );\n }\n }\n\n if ( $data !== null ) {\n $add_slot = true;\n if ( $this->srv_duration_days > 1 && ! $not_full ) {\n // Handle multi-day services.\n $multi_day_data[ $timestamp ] = array(\n 'data' => $data,\n 'blocked' => $blocked,\n );\n if ( ! $blocked ) {\n // Check if there are enough valid days for service duration in the past.\n for ( $d = 1; $d < $this->srv_duration_days; ++ $d ) {\n $timestamp -= DAY_IN_SECONDS;\n if ( ! isset ( $multi_day_data[ $timestamp ] ) || $multi_day_data[ $timestamp ]['blocked'] ) {\n $add_slot = false;\n break;\n }\n }\n if ( $add_slot ) {\n // Replace first slot with data from the day when service starts.\n $data[0] = $multi_day_data[ $timestamp ]['data'][0];\n // Re-calculate client timestamp and group.\n $client_timestamp = $timestamp - $this->at->client_diff;\n $group = date( 'Y-m-d', ! $this->at->show_calendar\n ? strtotime( 'first day of this month', $client_timestamp ) // group slots by months\n : $client_timestamp // group slots by days\n );\n }\n }\n }\n if ( $add_slot ) {\n if ( ! isset ( $this->data[ $group ] ) ) {\n if ( ! $this->at->show_calendar && $this->at->show_day_per_column && $groups + 1 > 10 ) {\n // Break the while-loop.\n break ( 3 );\n }\n $this->data[ $group ] = array();\n ++ $slots;\n ++ $groups;\n }\n $this->data[ $group ][ $client_timestamp ] = array(\n 'data' => $data,\n 'blocked' => $blocked,\n );\n ++ $slots;\n }\n }\n } elseif ( ! $blocked ) {\n if ( $this->data[ $group ][ $client_timestamp ]['blocked'] ) {\n // Set slot to available if it was marked as 'blocked' before.\n $this->data[ $group ][ $client_timestamp ]['data'][0][1] = $frame['staff_id'];\n $this->data[ $group ][ $client_timestamp ]['blocked'] = false;\n } else {\n // Change staff member for this slot if the other staff member has higher price.\n $staff_id = $this->data[ $group ][ $client_timestamp ]['data'][0][1];\n if ( $this->at->staff_data[ $staff_id ]['services'][ $this->service->get( 'id' ) ]['price'] <\n $this->at->staff_data[ $frame['staff_id'] ]['services'][ $this->service->get( 'id' ) ]['price'] ) {\n $this->data[ $group ][ $client_timestamp ]['data'][0][1] = $frame['staff_id'];\n }\n }\n }\n }\n }\n\n $this->date->add( $this->at->one_day );\n }\n\n // Arrange slots in time.\n foreach ( $this->data as $group => &$group_slots ) {\n ksort( $group_slots );\n }\n ksort( $this->data );\n\n return $slots > 0;\n }", "static function LoadAll($cid) {\n\t\tglobal $CACHE;\n\t\tglobal $tables;\n\n\t\tif (isset($CACHE->allPracticeTimes) && false !== @$CACHE->allPracticeTimes) {\n\t\t\treturn $CACHE->allPracticeTimes;\n\t\t}\n\n\t\t$CACHE->allPracticeTimes = array();\n\t\t$CACHE->activePracticeTimes = array();\n\t\t$CACHE->futurePracticeTimes = array();\n\n\t\t$q = \"SELECT `practice_id`, `club_id`, `dow`, `begin`, `end`, `first`, `last`, `data` FROM `{$tables['practices_conf']}` \"\n\t\t\t. \" WHERE `club_id` = ?\"\n\t\t\t. \" ORDER BY `last` < CURDATE(),\"\n\t\t\t. \" `first` ASC,\"\n\t\t\t. \" `last` ASC\";//TODO: add deleted\n\t\t$result = DbQueryP($q, 's', $cid);\n\n\t\tif (mysqli_num_rows($result) > 0) {\n\t\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t\t$p = self::row2practice($row);\n\n\t\t\t\t$CACHE->allPracticeTimes[] = $p;\n\n\t\t\t\tif ($p['active']) {\n\t\t\t\t\t$CACHE->activePracticeTimes[] = $p;\n\t\t\t\t}\n\t\t\t\tif (!$p['has-started']) {\n\t\t\t\t\t$CACHE->futurePracticeTimes[] = $p;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//asort($CACHE->allPracticeTimes);// TODO: Sort by dow, meaningfully\n\n\t\treturn $CACHE->allPracticeTimes;\n\t}", "function get_possible_times($transmit) {\n\t\tglobal $database, $conn, $response;\n\t\t// need a new PDO to make a new query\n\t\t$conn = $database->getConnection();\n\t\t$stmt = $conn->query(\"call getAppointmentTimes(\\\"{$transmit[\"date\"]}\\\")\");\n\n\n\n\t\t// expect at least one tuple returned\n\t\tif ($row = $stmt->fetch()) {\n\t\t\t// these fields are defined whether there are appointments scheduled or not\n\t\t\t$response->openTime = $row[\"openTime\"];\n\t\t\t$response->closeTime = $row[\"closeTime\"];\n\t\t\t$response->existsAppts = intval($row[\"existsAppts\"]);\n\n\t\t\t// A Workday may or may not have any scheduled appointments.\n\t\t\t// First, we read in all the appointments, then generate possible\n\t\t\t// appointment times in the gaps.\n\t\t\tif ($response->existsAppts == 1) {\n\t\t\t\t// Reading them in:\n\t\t\t\t// \t\tapts is a 2D array, the first indexes the appointment,\n\t\t\t\t// \t\tthe second accesses the start time [0] or end time [1]\n\t\t\t\t$response->appts = array(array());\n\t\t\t\t$i = 0;\n\n\t\t\t\t$response->appts[$i][0] = $row[\"startTime\"];\n\t\t\t\t$response->appts[$i][1] = $row[\"endTime\"];\n\n\t\t\t\twhile ($row = $stmt->fetch()) {\n\t\t\t\t\t$i++;\n\t\t\t\t\t$response->appts[$i][0] = $row[\"startTime\"];\n\t\t\t\t\t$response->appts[$i][1] = $row[\"endTime\"];\n\t\t\t\t}\n\n\t\t\t\t// Now we generate the possible appointments\n\t\t\t\t// STEP 1: GENERATE APPOINTMENTS BETWEEN THE SITE OWNER'S (openTime)\n\t\t\t\t// AND THE FIRST SCHEDULED APPOINTMENT\n\t\t\t\t$response->firstApptStart = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->appts[0][0]}\");\n\t\t\t\t$response->firstApptStart = $response->firstApptStart->modify(\"-5 minute\");\n\t\t\t\t// traverses all possible times and adds them to response\n\t\t\t\t$trav = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->openTime}\");\n\t\t\t\t$response->startTime = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->openTime}\");\n\t\t\t\t$interval_num = 0;\n\n\t\t\t\twhile ($trav->modify(\"+{$transmit[\"duration\"]} minute\") <= $response->firstApptStart)\n\t\t\t\t{\n\t\t\t\t\t$response->times[$interval_num][0] = $trav->format(\"H:i\");\n\t\t\t\t\t$response->times[$interval_num][1] = $trav->modify(\"+{$transmit[\"duration\"]} minute\")->format(\"H:i\");\n\n\n\t\t\t\t\t$trav = $trav->modify(\"+15 minute\");\n\n\t\t\t\t\t$interval_num++;\n\t\t\t\t}\n\n\t\t\t\t// STEP 2: GENERATE POSSIBLE APPOINTMENTS \"IN THE GAPS\" -> BETWEEN SCHEDULED APPOINTMENTS\n\n\t\t\t\tfor ($i = 0; $i < count($response->appts) - 1; $i++) {\n\t\t\t\t\t// next appt start time\n\t\t\t\t\t$response->nextApptStart = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->appts[$i + 1][0]}\");\n\t\t\t\t\t$response->nextApptStart = $response->nextApptStart->modify(\"-5 minute\");\n\t\t\t\t\t// traverses all possible times and adds them to response - starts with first appointment end time + buffer\n\t\t\t\t\t$trav = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->appts[$i][1]}\");\n\t\t\t\t\t$trav = $trav->modify(\"+5 minute\");\n\t\t\t\t\t$adjustIntervalVal = $interval_num;\n\t\t\t\t\twhile ($trav->modify(\"+{$transmit[\"duration\"]} minute\") <= $response->nextApptStart)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response->times[$interval_num][0] = $trav->format(\"H:i\");\n\t\t\t\t\t\t$response->times[$interval_num][1] = $trav->modify(\"+{$transmit[\"duration\"]} minute\")->format(\"H:i\");\n\n\t\t\t\t\t\tif ($adjustIntervalVal == $interval_num){\n\t\t\t\t\t\t\t$trav = $trav->modify(\"+10 minute\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$trav = $trav->modify(\"+15 minute\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$interval_num++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// STEP 3: GENERATE POSSIBLE APPOINTMENTS BETWEEN THE LAST APPOINTMENT'S END TIME\n\t\t\t\t// AND THE SITE OWNER'S (closeTime)\n\t\t\t\t// site owner's close time\n\t\t\t\t$response->closingTimeObj = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->closeTime}\");\n\t\t\t\t// traverses all possible times and adds them to response -> starts with last appointment end time + buffer\n\t\t\t\t$trav = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->appts[count($response->appts) - 1][1]}\");\n\t\t\t\t$trav = $trav->modify(\"+5 minute\");\n\n\t\t\t\t$adjustIntervalVal = $interval_num;\n\t\t\t\twhile ($trav->modify(\"+{$transmit[\"duration\"]} minute\") <= $response->closingTimeObj)\n\t\t\t\t{\n\t\t\t\t\t$response->times[$interval_num][0] = $trav->format(\"H:i\");\n\t\t\t\t\t$response->times[$interval_num][1] = $trav->modify(\"+{$transmit[\"duration\"]} minute\")->format(\"H:i\");\n\n\t\t\t\t\tif ($adjustIntervalVal == $interval_num){\n\t\t\t\t\t\t$trav = $trav->modify(\"+10 minute\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$trav = $trav->modify(\"+15 minute\");\n\t\t\t\t\t}\n\t\t\t\t\t$interval_num++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// if no appointments exist, generate possible appointments between openTime and endTime\n\t\t\t\t$response->times = array(array());\n\n\t\t\t\t$response->end = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->closeTime}\");\n\t\t\t\t$trav = new DateTimeImmutable(\"{$transmit[\"date\"]} {$response->openTime}\");\n\n\t\t\t\t$interval_num = 0;\n\t\t\t\twhile ($trav->modify(\"+{$transmit[\"duration\"]} minute\") <= $response->end)\n\t\t\t\t{\n\t\t\t\t\t$response->times[$interval_num][0] = $trav->format(\"H:i\");\n\t\t\t\t\t$response->times[$interval_num][1] = $trav->modify(\"+{$transmit[\"duration\"]} minute\")->format(\"H:i\");\n\n\t\t\t\t\t$trav = $trav->modify(\"+15 minute\");\n\t\t\t\t\t$interval_num++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$respones->error = 1;\n\t\t\t$response->text += \"unknown database error\";\n\t\t}\n\n\t}", "abstract public function getListFromFile($file_path, $time);", "private function make_timeblocks() {\n\n $startTime = new \\DateTime($this->daySchedule['start_time']);\n $endTime = new \\DateTime($this->daySchedule['end_time']);\n $interval = new \\DateInterval('PT' . $this->periodInterval . 'M');\n $breaksArray = $this->breaksArray;\n $chairScheduleArray = $this->dayScheduleArray;\n $intervalLines = $this->calc_interval($this->periodInterval, $this->intervalLines);\n $arrayCount = count($intervalLines);\n //$chairID = '';\n\n $startWhile = clone $startTime;\n $countLoop = 0;\n\n while ($startWhile <= $endTime) {\n\n $interval = new \\DateInterval('PT' . $intervalLines[$countLoop] . 'M');\n\n\n $timeblockColl = collect(array('time' => $startWhile->format('H:i'),\n 'break' => NULL,\n 'scheduled' => NULL,\n 'text' => NULL,\n 'appointment' => NULL));\n\n if ($this->inside_break_time($startWhile->format('H:i:s'), $breaksArray)) {\n\n $timeblockColl['break'] = 'break';\n\n }\n\n if (!empty($chairID = $this->inside_schedule_time($startWhile->format('H:i:s'), $chairScheduleArray))) {\n\n $chairDescription = DB::select('SELECT `description` FROM `chair` WHERE `id` = \"' . $chairID .'\"');\n $chairDescription = $chairDescription[0]->description;\n $timeblockColl['scheduled'] = 'Ingeroosterd: ' . $chairDescription;\n\n //Check for appointment for this chair, time and date\n if ($appointm = $this->get_appointment($startWhile->format('H:i:s'), $chairID)) {\n\n $appointm = $appointm->toArray();\n // vd($appointm[0]);\n $timeblockColl['appointment'] = $appointm;\n\n //change interval to appointment duration to skip blocks related to the appointment\n $interval = new \\DateInterval('PT' . $appointm[0]->duration . 'M');\n\n }\n }\n\n\n $startWhile->add($interval);\n\n if ($countLoop == $arrayCount - 1) {\n $countLoop = 0;\n } else {\n $countLoop++;\n }\n\n $this->timeBlocksArray[] = $timeblockColl;\n }\n\n }", "public function run()\n {\n DB::table('timeslots')->insert([\n [\n 'time' => '8:30 - 11:30',\n 'rank' => 1,\n 'label' => 'Morning',\n 'type' => 'EXAM'\n ],\n [\n 'time' => '12:30 - 15:30',\n 'rank' => 2,\n 'label' => 'Afternoon',\n 'type' => 'EXAM'\n ],\n [\n 'time' => '16:30 - 19:30',\n 'rank' => 3,\n 'label' => 'Evening',\n 'type' => 'EXAM'\n ],\n [\n 'time' => '8:00 - 10:00',\n 'rank' => 1,\n 'label' => '8:00 - 10:00',\n 'type' => 'NORMAL'\n ],\n [\n 'time' => '10:30 - 12:30',\n 'rank' => 2,\n 'label' => '10:30 - 12:30',\n 'type' => 'NORMAL'\n ],\n [\n 'time' => '13:00 - 15:00',\n 'rank' => 3,\n 'label' => '13:00 - 15:00',\n 'type' => 'NORMAL'\n ],\n [\n 'time' => '15:00 - 17:00',\n 'rank' => 4,\n 'label' => '15:00 - 17:00',\n 'type' => 'NORMAL'\n ]\n ]);\n }", "function get_timeslots($year_id){\n\t\t\n\t\t$sql = 'SELECT * FROM timeslots WHERE year_id = ?';\n\t\t$query = $this->db->query($sql, array($year_id));\n\t\t\n\t\tif($query->num_rows() == 0){\n\t\t\t\n\t\t\treturn FALSE;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$timeslots = $query->row();\n\t\t\t\n\t\t\t// Determine denomination\n\t\t\t$minutes = $timeslots->interval / 60;\n\t\t\t$hours = $timeslots->interval / 3600;\n\t\t\t\n\t\t\tlist($time, $measure) = ($minutes >= 60) ? array($hours, 'h') : array($minutes, 'm');\n\t\t\tif($minutes >= 60){\n\t\t\t\t$interval['time'] = $hours;\n\t\t\t\t$interval['measure'] = 3600;\n\t\t\t} else {\n\t\t\t\t$interval['time'] = $minutes;\n\t\t\t\t$interval['measure'] = 60;\n\t\t\t}\n\t\t\t$timeslots->interval = $interval;\n\t\t\t\n\t\t\treturn $timeslots;\n\t\t\t\n\t\t}\n\t\t\n\t}", "private function syncTimeToTimeList($sync_times)\n\t\t{\n\t\t\t$complete_time_list = array();\n\n\t\t\tforeach ($sync_times as $sync_time) {\n\n\t\t\t\t$time_list = array();\n\n\t\t\t\t$sync_time = str_replace(\":\",\"\",$sync_time);\n\t\t\t\t\n\t\t\t\tif ($sync_time[0] == \"*\") {\n\t\t\t\t\t$time_list[] = \"0\";\n\t\t\t\t\t$time_list[] = \"1\";\n\t\t\t\t\t$time_list[] = \"2\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$time_list[] = $sync_time[0];\n\t\t\t\t}\n\n\t\t\t\tif ($sync_time[1] == \"*\") {\n\t\t\t\t\tforeach ($time_list as $key => $time) {\n\t\t\t\t\t\tif ($time[0] == \"2\") {\n\t\t\t\t\t\t\t$time_list[] = \"20\";\n\t\t\t\t\t\t\t$time_list[] = \"21\";\n\t\t\t\t\t\t\t$time_list[] = \"22\";\n\t\t\t\t\t\t\t$time_list[] = \"23\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($i=0; $i<10; $i++) {\n\t\t\t\t\t\t\t\t$time_list[] = $time[0].$i;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tforeach ($time_list as $key => $time) {\n\t\t\t\t\t\t$time_list[] = $time.$sync_time[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($sync_time[2] == \"*\") {\n\t\t\t\t\tforeach ($time_list as $key => $time) {\n\t\t\t\t\t\tfor ($i=0; $i<6; $i++) {\n\t\t\t\t\t\t\t$time_list[] = $time.$i;\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 ($time_list as $key => $time) {\n\t\t\t\t\t\t$time_list[] = $time.$sync_time[2];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($sync_time[3] == \"*\") {\n\t\t\t\t\tforeach ($time_list as $key => $time) {\n\t\t\t\t\t\tfor ($i=0; $i<10; $i++) {\n\t\t\t\t\t\t\t$time_list[] = $time.$i;\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 ($time_list as $key => $time) {\n\t\t\t\t\t\t$time_list[] = $time.$sync_time[3];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tforeach ($time_list as $key => &$time) {\n\t\t\t\t\tif (strlen($time) == 4) {\n\t\t\t\t\t\t$time = $time[0].$time[1].\":\".$time[2].$time[3];\n\t\t\t\t\t\t$complete_time_list[] = $time;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tunset($time_list[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $complete_time_list;\n\t\t}", "public static function listTimeGenerators() {\r\n\t\treturn array('Time' => self::listMethods('Time') );\r\n\t}", "function getTimes()\n {\n $ret = array();\n $ret['nolimit']=_(\"no limit\"); \n foreach(array(1,2,4,8,12,24,36,48) as $i){\n if($i == 1){\n $ret[$i] = $i.\"&nbsp;\"._(\"hour\");\n }else{\n $ret[$i] = $i.\"&nbsp;\"._(\"hours\");\n }\n }\n return($ret);\n }", "public function getTimes() {\n\t\t$data = array();\n\t\tfor ( $i = 0; $i < 24; $i ++ ) {\n\t\t\tforeach ( apply_filters( 'wd_scan_get_times_interval', array( '00', '30' ) ) as $min ) {\n\t\t\t\t$time = $i . ':' . $min;\n\t\t\t\t$data[ $time ] = apply_filters( 'wd_scan_get_times_hour_min', $time );\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'wd_scan_get_times', $data );\n\t}", "public function _listAllTime(){\n return $this->timeDAO->listAllTimes();\n }", "private function getTasks() {\n\t\tglobal $dbc;\n\t\t$time = date('c', time());\n\t\t$query = 'select id from ek_wysylka where status = 0 and data_wysylki <= \"' . $time . '\"';\n\t\t$ret = $dbc->select($query);\n\t\tforeach ($ret as $v) {\n\t\t\t$this->tasks[] = (int)$v['id'];\n\t\t}\n\t}", "function LoadAllPracticeTimes($cid) {\n\tdie('deprecated :'.__FUNCTION__);\n\treturn PracticeTime::LoadAll($cid);\n}", "function getAvailableTimes($date) {\n if ($date . dayOfWeek == \"Monday\") {\n return array(\"8:00 AM\", \"9:00 AM\", \"10:00 AM\");\n } else if ($date . dayOfWeek == \"Tuesday\") {\n return array(\"11:00 AM\", \"12:00 PM\", \"1:00 PM\");\n } else if ($date . dayOfWeek == \"Wednesday\") {\n return array(\"2:00 PM\", \"3:00 PM\", \"4:00 PM\");\n } else if ($date . dayOfWeek == \"Thursday\") {\n return array(\"5:00 PM\", \"6:00 PM\", \"7:00PM\");\n } else if ($date . dayOfWeek == \"Friday\") {\n return array(\"8:00 AM\", \"9:00 AM\", \"10:00 AM\");\n } else if ($date . dayOfWeek == \"Saturday\") {\n return array(\"11:00 AM\", \"12:00 PM\", \"1:00 PM\");\n } else if ($date . dayOfWeek == \"Sunday\") {\n return array(\"2:00 PM\", \"3:00 PM\", \"4:00 PM\");\n }\n }", "function loadTicks($symbol, $gmtHour, $fxtHour) {\n Assert::int($gmtHour, '$gmtHour');\n Assert::int($fxtHour, '$fxtHour');\n $shortDate = gmdate('D, d-M-Y H:i', $fxtHour);\n\n // Die Tickdaten der Handelsstunde werden in folgender Reihenfolge gesucht:\n // - in bereits dekomprimierten Dukascopy-Dateien\n // - in noch komprimierten Dukascopy-Dateien\n // - als Dukascopy-Download\n\n global $saveCompressedDukascopyFiles;\n $ticks = [];\n\n // dekomprimierte Dukascopy-Datei suchen und bei Erfolg Ticks laden\n if (!$ticks) {\n if (is_file($file=getVar('dukaFile.raw', $symbol, $gmtHour))) {\n $ticks = loadRawDukascopyTickFile($file, $symbol, $gmtHour, $fxtHour);\n if (!$ticks) return [];\n }\n }\n\n // ggf. komprimierte Dukascopy-Datei suchen und bei Erfolg Ticks laden\n if (!$ticks) {\n if (is_file($file=getVar('dukaFile.compressed', $symbol, $gmtHour))) {\n $ticks = loadCompressedDukascopyTickFile($file, $symbol, $gmtHour, $fxtHour);\n if (!$ticks) return [];\n }\n }\n\n // ggf. Dukascopy-Datei herunterladen und Ticks laden\n if (!$ticks) {\n $data = downloadTickdata($symbol, $gmtHour, $fxtHour, false, $saveCompressedDukascopyFiles);\n if (!$data) return [];\n\n $ticks = loadCompressedDukascopyTickData($data, $symbol, $gmtHour, $fxtHour);\n }\n return $ticks;\n}", "function get_lab_times(){\n\t\t$completed_query = $this->db->query(\"SELECT `session`.`treatment_id` FROM `session`,`session_members`,`user` WHERE `session_members`.`user_id` = `user`.`id` AND `session`.`end_time` <> 0 AND `session_members`.`session_id` = `session`.`id` AND `user`.`email` = '\" . $this->session->userdata('email') . \"'\");\n\t\tif($completed_query->num_rows()>0){ // user has completed at least one treatment\n\t\t\tforeach ($completed_query->result_array() as $row) {\n\t\t\t $completed[] = $row['treatment_id'];\n\t\t\t}\n\t\t\t//$exclusion_str = \"(\" . implode(\",\",$completed) . \")\";\n\t\t\t$exclusion_str = \"(0)\";\n\n\t\t\t// grab all the labs that are not closed yet, grab the dates in UTC format\n\t\t\t$open_lab_query = $this->db->query(\"SELECT `id`,`treatment_ids`, UNIX_TIMESTAMP(`open_time`) AS 'open', UNIX_TIMESTAMP(`close_time`) AS 'close' FROM `schedule` WHERE `close_time` > NOW() ORDER BY 'open'\");\n\t\t\tif($open_lab_query->num_rows()>0){ // there are open lab times\n\t\t\t\tforeach ($open_lab_query->result_array() as $row3) {\n\t\t\t\t\t//$row['treatment_ids']\n\t\t\t\t\t// see if this lab includes a treatment that this user has yet to complete\n\t\t\t\t\t$available_query = $this->db->query(\"SELECT * FROM `treatment` WHERE `treatment`.`id` IN \" . $row3['treatment_ids'] . \" AND `treatment`.`id` NOT IN $exclusion_str\");\n\t\t\t\t\tif($available_query->num_rows()>0){ // there are available treatments in this lab\n\t\t\t\t\t\tforeach ($available_query->result_array() as $row2) {\n\t\t\t\t\t\t $treatments[] = $row2['id'];\n\t\t\t\t\t\t if(in_array($row2['id'], $completed)){\n\t\t\t\t\t\t \t\t$closed_array[] = 1;\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t \t\t$closed_array[] = 0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //$controllers[] = \n\t\t\t\t\t\t}\n\t\t\t\t\t\t$treatments_str = \"(\" . implode(\",\",$treatments) . \")\";\n\t\t\t\t\t\t$available[$row3['id']]['treatment_ids'] = $treatments_str;\n\n\t\t\t\t\t\t$closed_str = \"(\" . implode(\",\", $closed_array) . \")\";\n\t\t\t\t\t\t$available[$row3['id']]['closed'] = $closed_str;\n\n\t\t\t\t\t\t$available[$row3['id']]['open_time'] = $row3['open'];\n\t\t\t\t\t\t$available[$row3['id']]['close_time'] = $row3['close'];\n\t\t\t\t\t\t$available[$row3['id']]['controller'] = $row3['close'];\n\t\t\t\t\t} else { // no available treatments\n\t\t\t\t\t\t// do nothing\n\t\t\t\t\t}\n\t\t\t\t\t$treatments = array();\n\t\t\t\t\t$closed_array = array();\n\t\t\t\t}\n\n\t\t\t\t// see if there are any available lab times\n\t\t\t\tif(isset($available)){\n\t\t\t\t\treturn $available;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else { // there are no open lab times\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t} else { // user has not completed any treatments\n\t\t\t$open_lab_query = $this->db->query(\"SELECT `id`,`treatment_ids`, UNIX_TIMESTAMP(`open_time`) AS 'open', UNIX_TIMESTAMP(`close_time`) AS 'close' FROM `schedule` WHERE `close_time` > NOW() ORDER BY 'open'\");\n\t\t\tif($open_lab_query->num_rows()>0){\n\t\t\t\tforeach ($open_lab_query->result_array() as $row3) {\n\t\t\t\t\t$available[$row3['id']]['treatment_ids'] = $row3['treatment_ids'];\n\t\t\t\t\t$available[$row3['id']]['open_time'] = $row3['open'];\n\t\t\t\t\t$available[$row3['id']]['close_time'] = $row3['close'];\n\t\t\t\t}\n\t\t\t\treturn $available;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function time_tracker_get_time_entries_for_node($nid, $type = 'all') {\n $time_entries = array();\n switch ($type) {\n case 'node':\n $sql = \"SELECT * FROM {time_tracker_entry} AS t\n WHERE nid = %d AND cid = 0\n ORDER BY t.timestamp DESC, t.start DESC, t.teid DESC\";\n // Get the entries associated with this node\n $resource = db_query($sql, $nid);\n // Store the db objects in an array for theme function\n while ($time_entry = $resource->fetchObject()) {\n $time_entries[] = $time_entry;\n }\n break;\n case 'comment':\n $sql = \"SELECT * FROM {time_tracker_entry} AS t\n WHERE nid = %d AND cid <> 0\n ORDER BY t.timestamp DESC, t.start DESC, t.teid DESC\";\n // Get the entries associated with this node\n $resource = db_query($sql, $nid);\n // Store the db objects in an array for theme function\n while ($time_entry = $resource->fetchObject()) {\n $time_entries[] = $time_entry;\n }\n breal;\n case 'all':\n $sql = \"SELECT * FROM {time_tracker_entry} AS t\n WHERE nid = %d\n ORDER BY t.timestamp DESC, t.start DESC, t.teid DESC\";\n // Get the entries associated with this node\n $resource = db_query($sql, $nid);\n // Store the db objects in an array for theme function\n while ($time_entry = $resource->fetchObject()) {\n $time_entries[] = $time_entry;\n }\n break;\n }\n return $time_entries;\n}", "private function getDataVariables($timeframe) {\n\n if ($timeframe == \"lasthour\") {\n $sql_timeframe = \"%Y-%m-%d %H:%i\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") - 1 , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\") , date(\"Y\")),\n \"for_x\" => 60,\n \"str_to_time\" => \"minute\",\n \"date_str\" => DEFAULT_DATEFORMAT_SHORT,\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n }\n elseif ($timeframe == \"last15min\") {\n $sql_timeframe = \"%Y-%m-%d %H:%i\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") - 15 , date(\"d\") , date(\"Y\")),\n \"for_x\" => 15,\n \"str_to_time\" => \"minute\",\n \"date_str\" => DEFAULT_DATEFORMAT_SHORT,\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n }\n elseif ($timeframe == \"last30min\") {\n $sql_timeframe = \"%Y-%m-%d %H:%i\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") - 30, date(\"d\") , date(\"Y\")),\n \"for_x\" => 30,\n \"str_to_time\" => \"minute\",\n \"date_str\" => DEFAULT_DATEFORMAT_SHORT,\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n } \n elseif ($timeframe == \"lastweek\") {\n $sql_timeframe = \"%Y-%m-%d\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\") - 7, date(\"Y\")),\n \"for_x\" => 7,\n \"str_to_time\" => \"day\",\n \"date_str\" => \"Y-m-d\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n }\n elseif ($timeframe == \"last4hour\") {\n $sql_timeframe = \"%d/%m %H:00\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") - 4 , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\"), date(\"Y\")),\n \"for_x\" => 4,\n \"str_to_time\" => \"hour\",\n \"date_str\" => \"d/m H:00\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n ); \n } \n elseif ($timeframe == \"last12hour\") {\n $sql_timeframe = \"%d/%m %H:00\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") - 12 , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\"), date(\"Y\")),\n \"for_x\" => 12,\n \"str_to_time\" => \"hour\",\n \"date_str\" => \"d/m H:00\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n ); \n }\n elseif ($timeframe == \"lastday\") {\n $sql_timeframe = \"%d/%m %H:00\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\") - 1, date(\"Y\")),\n \"for_x\" => 24,\n \"str_to_time\" => \"hour\",\n \"date_str\" => \"d/m H:00\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n ); \n }\n elseif ($timeframe == \"last2day\") {\n $sql_timeframe = \"%d/%m %H:00\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\") - 2, date(\"Y\")),\n \"for_x\" => 48,\n \"str_to_time\" => \"hour\",\n \"date_str\" => \"d/m H:00\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n ); \n } \n elseif ($timeframe == \"last3day\") {\n $sql_timeframe = \"%d/%m %H:00\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") , date(\"d\") - 3, date(\"Y\")),\n \"for_x\" => 76,\n \"str_to_time\" => \"hour\",\n \"date_str\" => \"d/m H:00\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n ); \n }\n elseif ($timeframe == \"lastmonth\") {\n $sql_timeframe = \"%d/%m\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") - 1, date(\"d\") , date(\"Y\")),\n \"for_x\" => 31,\n \"str_to_time\" => \"day\",\n \"date_str\" => \"d/m\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n }\n elseif ($timeframe == \"last3month\") {\n $sql_timeframe = \"%d/%m\";\n $result = array(\n \"starttime\" => mktime(date(\"H\") , date(\"i\"), date(\"s\"), date(\"m\") - 3, date(\"d\") , date(\"Y\")),\n \"for_x\" => 93,\n \"str_to_time\" => \"day\",\n \"date_str\" => \"d/m\",\n \"sql_timeframe\" => $sql_timeframe,\n \"sql_from\" => \"from_unixtime(oob_time_sec, '$sql_timeframe')\"\n );\n }\n\n return $result;\n }", "function grabReservationIds($start, $end, $mach){\n\t\t$type = $this->getType($mach);\n\t\t\n\t\t//first grab all timeslots that this will occur in\n\t\t//$q = \"SELECT `reservedTimestamp` FROM `$type` WHERE ((`start`>=$start AND `start`<$end) OR (`end`>$start AND `end`<=$end)) AND `machine`='$mach'\"; \n\t\t$q = \"SELECT `reservedTimestamp` FROM `$type` WHERE `start`>=$start AND `start`<=$end AND `machine`='$mach'\";\n\t\t$result = $this->query($q);\n\t\t$data = array();\n\t\tif ($result)\n\t\t{\n\t\t\twhile ($row= mysql_fetch_assoc($result)){\n\t\t\t\t$data[$row[\"reservedTimestamp\"]] = $row[\"reservedTimestamp\"];\n\t\t\t}\n\t\t\t$newArray = array();\n\t\t\tforeach ($data as $value){\n\t\t\t\t$aDay = (60 * 60 * 24);\n\t\t\t\t$newArray[$value] = $this->getReservationDataById($value, $mach);\n\t\t\t\t\n\t\t\t\t//this will add the next timeslots in the list if its more then just 1 hour\n\t\t\t\tif ($newArray[$value][\"hours\"]>1){\n\t\t\t\t\t$time = explode(\"-\", $value);\n\t\t\t\t\t$time = $time[0];\n\t\t\t\t\t$hour = explode(\"-\", $value);\n\t\t\t\t\t$hour = $hour[1];\n\t\t\t\t\tfor ($x=1; $x<$newArray[$value][\"hours\"]; $x++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour++;\n\t\t\t\t\t\tif ($hour==24){\n\t\t\t\t\t\t\t$hour=0;\n\t\t\t\t\t\t\t$time+=$aDay;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$newArray[$time.\"-\".$hour]= $newArray[$value];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//returns an array of all timeslots\n\t\t\treturn $newArray;\n\t\t}\n\t\telse \n\t\t\treturn false;\n\t}", "protected function getSchedulerTimings(){\n return [\n 'start' => Config::where('name', '=', 'scheduler_start_time')->first()->value,\n 'end' => Config::where('name', '=', 'scheduler_end_time')->first()->value\n ];\n }", "public static function pollAutomaticSyncs()\n\t{\n\t\t/* Get latest sync */\n\t\t$lastSync = SERIA_Meta::all('NDLA_SyncLog')->order('-executedAt')->limit(0, 1)->current();\n\t\tif ($lastSync)\n\t\t\t$fromTime = strtotime($lastSync->get('executedAt'));\n\t\telse {\n\t\t\t/* Create a starting-point */\n\t\t\tself::writeSyncLogEntry('Polled: Did not sync. (Started sync-scheduler from here)');\n\t\t\treturn;\n\t\t}\n\t\t$toTime = time();\n\t\t/* Get hours */\n\t\t$weekdays = array(\n\t\t\t'Sunday',\n\t\t\t'Monday',\n\t\t\t'Tuesday',\n\t\t\t'Wednesday',\n\t\t\t'Thursday',\n\t\t\t'Friday',\n\t\t\t'Saturday'\n\t\t);\n\t\t$fromHour = intval(date('H', $fromTime));\n\t\tif (intval(date('i', $fromTime)) != 0 || intval(date('s', $fromTime)) != 0)\n\t\t\t$fromHour++;\n\t\t$fromDay = intval(date('j', $fromTime));\n\t\t$fromMonth = intval(date('m', $fromTime));\n\t\t$fromYear = intval(date('Y', $fromTime));\n\t\t$point = mktime($fromHour, 0, 0, $fromMonth, $fromDay, $fromYear);\n\t\t$rotationMap = array();\n\t\tfor ($i = 0; $i < 6; $i++)\n\t\t\tfor ($j = 0; $j < 24; $j++)\n\t\t\t\t$rotationMap[$i][$j] = 0; /* Not visited */\n\t\t$hours = array();\n\t\t$doSync = false;\n\t\twhile ($point < $toTime) {\n\t\t\t$hour = intval(date('H', $point));\n\t\t\t$wday = intval(date('w', $point));\n\t\t\tSERIA_Base::debug('Checking '.date('Y-m-d H:i:s', $point).' wday '.$wday.' hour '.$hour);\n\t\t\tif ($rotationMap[$wday][$hour])\n\t\t\t\tbreak; /* Did go through the whole weekly schedule without sync */\n\t\t\t$rotationMap[$wday][$hour] = 1;\n\t\t\t$wdayName = $weekdays[$wday];\n\t\t\tif (!isset($hours[$hour]))\n\t\t\t\t$hours[$hour] = SERIA_Meta::all('NDLA_WeeklySyncSchedule')->where('hour = :hour', array('hour' => $hour))->current();\n\t\t\tif ($hours[$hour]) {\n\t\t\t\tif ($hours[$hour]->get($wdayName)) {\n\t\t\t\t\tSERIA_Base::debug('Syncing because scheduled at '.$wdayName.' '.$hour.' o\\'clock.');\n\t\t\t\t\t$doSync = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($doSync)\n\t\t\t\tbreak;\n\t\t\t$fromHour = intval(date('H', $point)) + 1;\n\t\t\t$fromDay = intval(date('j', $point));\n\t\t\t$fromMonth = intval(date('m', $point));\n\t\t\t$fromYear = intval(date('Y', $point));\n\t\t\t$point = mktime($fromHour, 0, 0, $fromMonth, $fromDay, $fromYear);\n\t\t}\n\t\tif ($doSync) {\n\t\t\tif (!self::syncPause())\n\t\t\t\tself::doSync('Scheduled sync');\n\t\t\telse\n\t\t\t\tself::writeSyncLogEntry('Not syncing: Paused');\n\t\t\treturn;\n\t\t}\n\t\t/* Check schedules */\n\t\t$fromDateTime = new SERIA_DateTimeMetaField($fromTime);\n\t\t$toDateTime = new SERIA_DateTimeMetaField($toTime);\n\t\t$syncs = SERIA_Meta::all('NDLA_ScheduledSync')->where('syncDate > :fromTime AND syncDate <= :toTime', array('fromTime' => $fromDateTime->toDbFieldValue(), 'toTime' => $toDateTime->toDbFieldValue()))->count();\n\t\tif ($syncs) {\n\t\t\tif (!self::syncPause())\n\t\t\t\tself::doSync('Scheduled sync');\n\t\t\telse\n\t\t\t\tself::writeSyncLogEntry('Not syncing: Paused');\n\t\t} else if (($toTime - $fromTime) > 2592000) { /* 30 days since last sync or logging */\n\t\t\t$minute = intval(date('i', $toTime));\n\t\t\tif ($minute < 45) {\n\t\t\t\t$fromDateTime = new SERIA_DateTimeMetaField($toTime);\n\t\t\t\t$toDateTime = new SERIA_DateTimeMetaField($toTime + 36000); /* 10 hrs */\n\t\t\t\t$nearFutureSyncs = SERIA_Meta::all('NDLA_ScheduledSync')->where('syncDate > :fromTime AND syncDate <= :toTime', array('fromTime' => $fromDateTime->toDbFieldValue(), 'toTime' => $toDateTime->toDbFieldValue()))->count();\n\t\t\t\tif (!$nearFutureSyncs)\n\t\t\t\t\tself::writeSyncLogEntry('Polled: Not syncing');\n\t\t\t}\n\t\t}\n\t}", "function get_lunch_schedule($schedtype,$gc_start_break,$sched_break_start,$gc_end_break,$sched_break_end,$start_break_partner,$end_break_partner,$sched_to,$actual_timeout,$employee_idno,$date_timelog){\n\t//------------------$gc_end_break - lunch start\n\t//-------------------$gc_start_break - lunch end\n\t//--baligtad\n\t$trs = get_instance();\n\t$trs->load->model('time_record/Timerecordsummary_model');\n\t\t$ded1 = 0;\n\t\t$ded2 = 0;\n\t\t$fix_lunch_break = 0;\n\t\t$lunch_deduction = 0;\n\t\t//-----------LUNCH DEDUCTION / OVERBREAK--------------------------\n\t\t//early out\n\t\tif($gc_start_break <= $sched_break_start){\n\t\t\t$x = $gc_start_break - $sched_break_start;\n\t\t\t$ded1 = $ded1 + $ded2;\n\t\t}\n\t\t//late in\n\t\tif($gc_end_break >= $sched_break_end){\n\t\t\t$y = $gc_end_break -$sched_break_end;\n\t\t\t$ded2 = $ded2 + $y;\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$lunch_deduction = 0;\n\t\t}else{\n\t\t\t//\n\t\t\t$lunch_deduction = $ded1 + $ded2;\n\t\t}\n\t\t// $lunch_deduction = $ded1 + $ded2;\n\n\t\t// $one = date('H:i', mktime(0,$gc_start_break));\n\t\t// $two = date('H:i', mktime(0,$start_break_partner));\n\t\t// $three = date('H:i', mktime(0,$gc_end_break));\n\t\t// $four = date('H:i', mktime(0,$end_break_partner));\n\t\t// print_r(array(\n\t\t// \t'start_break' => $one,\n\t\t// \t'start_partner' => $two,\n\t\t// \t'end_break' => $three,\n\t\t// \t'end_break_partner' => $four\n\t\t// ));\n\n\n\t\t// print_r(array('start' => $start_break_partner, 'sched' => $sched_break_start));\n\t\t//----FIX LUNCH BREAK------------------\n\t\tif(($gc_start_break > $sched_break_start) && ($start_break_partner < $sched_break_start)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($gc_start_break - $sched_break_start);\n\t\t}\n\t\telse{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\tif(($gc_end_break < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break + ($sched_break_end - $gc_end_break);\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break + 0;\n\t\t}\n\t\t//checks if employee is half day\n\t\tif(($actual_timeout == $gc_start_break) && ($actual_timeout < $sched_break_end)){\n\t\t\t$fix_lunch_break = $fix_lunch_break\t+ ($gc_start_break - $gc_end_break);\n\t\t}\n\t\t//checks if start or end break of employee is greater than his actual time out\n\t\tif($gc_start_break > $sched_to || $gc_end_break > $sched_to){\n\t\t\t$fix_lunch_break = 0;\n\t\t}else{\n\t\t\t$fix_lunch_break = $fix_lunch_break;\n\t\t}\n\t\t//will check if time record exist in work order. if workorder exist, it will remove the overbreak of employee\n\t\t$breakout_hhmm = date('H:i', mktime(0,$gc_start_break));\n\t\t$check_workorder = $trs->Timerecordsummary_model->check_lunch_workorder($employee_idno,$date_timelog,$breakout_hhmm)->row();\n\t\tif($check_workorder != null){\n\t\t\t$et = convert_to_minutes($check_workorder->end_time);\n\t\t\tif($et > $sched_break_end){\n\t\t\t\t$overbreak_deduct = $et - $sched_break_end;\n\t\t\t\t$fix_lunch_break = $fix_lunch_break - $lunch_deduction;\n\t\t\t\t$lunch_deduction = $lunch_deduction - $overbreak_deduct;\n\n\t\t\t}\n\t\t}\n\t\t$getbreaks = array(\n\t\t\t'fix_lunch_break' => $fix_lunch_break,\n\t\t\t'lunch_deduction' => $lunch_deduction\n\t\t);\n\t\treturn $getbreaks;\n}", "public function run()\n {\n $set_times1= SetTime::create([\n 'time_group'=>'1',\n 'jam_awal'=>'08:00',\n 'jam_akhir'=>'12:00'\n ]);\n\n $set_times2= SetTime::create([\n 'time_group'=>'2',\n 'jam_awal'=>'13:00',\n 'jam_akhir'=>'17:00'\n ]);\n\n $set_times3= SetTime::create([\n 'time_group'=>'3',\n 'jam_awal'=>'18:00',\n 'jam_akhir'=>'23:00'\n ]);\n }", "function getAvailableTimesArray($open_close_ts_array,$first_time,$the_time,$hour_type)\n\t{\n\t\tmyerror_logging(3, \"current time is: \".date(\"l F j, Y, g:i a\",$the_time));\n\t\tmyerror_logging(3, \"closing time today is: \".date(\"l F j, Y, g:i a\",$open_close_ts_array[0]['close']));\n\t\tmyerror_logging(3, \"opening time today is: \".date(\"l F j, Y, g:i a\",$open_close_ts_array[0]['open']));\n\t\tmyerror_logging(3, \"first available time is: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t$order_day = date('w', $the_time)+1;\n\t\t$hole_hour_for_order_day = isset($this->hole_hours[$order_day])? $this->hole_hours[$order_day] : array();\n\t\tif(!empty($hole_hour_for_order_day)){\n\t\t myerror_log(\"we have hole hours for order day\",3);\n\t\t\tif($first_time > $hole_hour_for_order_day['start'] && $first_time < $hole_hour_for_order_day['end']){\n\t\t\t\tmyerror_logging(3,\"first time into hole hour\");\n\t\t\t\t$diference = $hole_hour_for_order_day['end'] - $first_time;\n\t\t\t\t$first_time = $first_time + $diference;\n\t\t\t\tmyerror_logging(3, \"recalculate first available time is: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t\t}\n\t\t}\n\n\t\t$initial_first_time = $first_time;\n\t\t$increment_in_seconds = $this->increment_for_order * 60;\n\t\t$over_max = false;\n\t\t// does need to be max + 60? i think it just needs to be max + 1 second so the last value doesn't get dropped.\n\t\t$max_ts = $the_time + ($this->min_lead_for_order * 60) + ($this->max_lead_for_order * 60) + 60; // so the last value doesn't get dropped\n\t\tif ($max_ts < $first_time + 60) {\n\t\t\t$max_ts = $first_time + ($this->min_lead_for_order * 60) + ($this->max_lead_for_order * 60) + 60;\n\t\t}\n\n\t\tmyerror_logging(3,\"the max time for this order is: \".date(\"l F j, Y, g:i a\",$max_ts));\n\t\t$available_times = array();\n\t\t$index_of_first_day = 0;\n $advanced_increment = $this->advanced_ordering_increment*60;\n $test_min_lead_value = $this->min_lead_for_order;\n if ($this->catering) {\n // need to determine which type of catering it is.\n if ($this->merchantDoesNotHaveCateringInfoRecord()) {\n //set test value to 2 hours\n $test_min_lead_value = 120;\n }\n }\n foreach ($open_close_ts_array as $day_num => $day_record) {\n\t\t\tmyerror_log(\"Starting day number $day_num\",3);\n\t\t\tif ($over_max) {\n\t\t\t myerror_log(\"over max\",5);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (sizeof($day_record) == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$open_ts = $day_record['open'];\n\t\t\t$close_ts = $day_record['close'];\n myerror_logging(3, \"closing time today is: \".date(\"l F j, Y, g:i a\",$close_ts));\n myerror_logging(3, \"opening time today is: \".date(\"l F j, Y, g:i a\",$open_ts));\n\n if ($initial_first_time > $close_ts-(1.5*$increment_in_seconds)) {\n $index_of_first_day++;\n continue;\n } else if ($day_num == $index_of_first_day && $this->catering && $this->merchantDOESHaveCateringInfoRecord()) {\n if( $first_time <= $open_ts) {\n // the bump should have already been taken care of so just set first time to open time\n $first_time = $open_ts;\n myerror_log(\"first time is now set to: \".date(\"l F j, Y, g:i a\", $first_time),5);\n }\n } else if ($this->catering && $day_num == $index_of_first_day && $first_time <= $open_ts + ($test_min_lead_value*60)) {\n $first_time = $open_ts + ($test_min_lead_value*60);\n myerror_log(\"We have catering so first time is now set to: \".date(\"l F j, Y, g:i a\", $first_time),5);\n $initial_first_time = $first_time;\n // now set last time to be first time + max_lead + 60 seconds\n if ($max_ts > $open_ts) {\n $max_ts = $open_ts + ($this->max_lead_for_order * 60) + 60;\n }\n } else if ($day_num == $index_of_first_day && $first_time <= $open_ts) {\n // set first time to be opening time plus 1 minute\n $first_time = $open_ts + 60;\n myerror_log(\"first time is now set to: \".date(\"l F j, Y, g:i a\", $first_time),5);\n $initial_first_time = $first_time;\n // now set last time to be first time + max_lead + 60 seconds\n\t\t\t\tif ($max_ts > $open_ts) {\n\t\t\t\t\t$max_ts = $open_ts + ($this->max_lead_for_order * 60) + 60;\n\t\t\t\t}\n\t\t\t} else if ($day_num != $index_of_first_day) {\n /* if ($this->min_lead_for_order < 16) {\n $first_time = $open_ts + 900;\n } else if (15 < $this->min_lead_for_order && $this->min_lead_for_order < 31) {\n $first_time = $open_ts + 1800;\n } else */ if ($this->catering && $this->merchantDOESHaveCateringInfoRecord()) {\n // for full catering the bump is already built into the open_ts at this point\n $first_time = $open_ts;\n } else {\n // no longer buffering\n //$first_time = $open_ts + 3600;\n $first_time = $open_ts+1;\n\t\t\t }\n }\n\n myerror_logging(3, \"opening time today is: \" . date(\"l F j, Y, g:i a\", $open_ts));\n\t\t\tmyerror_logging(3, \"closing time today is: \".date(\"l F j, Y, g:i a\",$close_ts));\n\t\t\tmyerror_logging(3, \"max lead for order is: \".date(\"l F j, Y, g:i a\",$max_ts));\n\t\t\tif (date(\"Y-m-d\",$max_ts) == date(\"Y-m-d\",$close_ts) && $max_ts > $close_ts) {\n\t\t\t\t$max_ts = $close_ts;\n\t\t\t}\n\n\n\t\t\t$current_day_for_hole_hour = date(\"w\",$first_time)+1;\n\t\t\tif ($day_num > 6) {\n $current_day_for_hole_hour = $current_day_for_hole_hour + $day_num;\n }\n\t\t\t$hole_hour = isset($this->hole_hours[$current_day_for_hole_hour])? $this->hole_hours[$current_day_for_hole_hour] : array();\n\n\t\t\tif(!empty($hole_hour)){\n\t\t\t\tmyerror_logging(3, \"hole hour day $current_day_for_hole_hour \" . date(\"l F j, Y, g:i a\",$hole_hour['start']));\n\t\t\t\tmyerror_logging(3, \"Start hole hours for day $current_day_for_hole_hour \" . date(\"l F j, Y, g:i a\",$hole_hour['start']));\n\t\t\t\tmyerror_logging(3, \"End hole hours for day $current_day_for_hole_hour \" . date(\"l F j, Y, g:i a\",$hole_hour['end']));\n\t\t\t}else{\n\t\t\t\tmyerror_logging(3, \"no set hole hour for day $current_day_for_hole_hour \");\n\t\t\t}\n\n //push delivery first time to 5 minute increments\n if ($hour_type == 'D') {\n\t\t\t $buffer_seconds = $this->delivery_order_buffer_in_minutes * 60;\n\t\t\t myerror_log(\"we have the buffer in seconds: \".$buffer_seconds,3);\n\t\t\t if ($buffer_seconds < 300) {\n\t\t\t myerror_log(\"resetting buffer to 300 seconds\");\n\t\t\t $buffer_seconds = 300;\n }\n $first_time = ceil($first_time/$buffer_seconds)*$buffer_seconds;\n }\n\n\t\t\tif ($day_num == $index_of_first_day) {\n\t\t\t\t$starting_time = $first_time;\n\t\t\t} else {\n\t\t\t // maybe set increment here\n //$increment_in_seconds = $this->advanced_increment_for_order * 60;\n }\n\n myerror_log(\"first_time: $first_time, close_ts: $close_ts, over_max: $over_max\",5);\n while ($first_time < $close_ts && !$over_max) {\n myerror_log(\"looping time: \".date(\"Y-m-d H:i\",$first_time),5);\n if ($first_time > $max_ts) {\n\t\t\t\t\t// exceeded max lead time\n\t\t\t\t\t$over_max = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n if (!$this->catering && $hour_type == 'R') {\n\t\t\t\t\t// do 1 minute intervals for first 15 minutes (NOT EVEN NUBMERS)\n if ($first_time < $starting_time + 900) {\n\t\t\t\t\t\t$increment_in_seconds = 60;\n } else {\n\t\t\t\t\t\t$increment_in_seconds = $this->increment_for_order * 60;\n\t\t\t\t }\n }\n\n if (!$this->catering) {\n myerror_log(\"first time: $first_time, hole hour start: \".$hole_hour['start'].\", hole hour end: \".$hole_hour['end'],3);\n\t\t\t\t\tif((!empty($hole_hour)) && ($first_time > $hole_hour['start'] && $first_time < $hole_hour['end'])){\n\t\t\t\t\t\tmyerror_logging(3,\"exclude: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmyerror_logging(3,\"adding: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t\t\t\t\t$available_times[] = $first_time;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tmyerror_logging(3,\"skipping hole logic because catering and adding: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t\t\t\t$available_times[] = $first_time;\n\t\t\t\t}\n\n\t\t\t\tif (!$this->catering && $hour_type != 'D') {\n if ($first_time > $initial_first_time + 900 && $first_time < $initial_first_time + 5400) {\n $increment_in_seconds = 300;\n } else if ($first_time > $initial_first_time + 5400 && $day_num < 2) {\n $increment_in_seconds = 900;\n }\n }\n myerror_log(\"the increment in seconds is: $increment_in_seconds\",5);\n $first_time = $first_time + $increment_in_seconds;\n\t\t\t\t\n\t\t\t\t// ok we want to include the closing time in the list\n\t\t\t\tif ($first_time >= $close_ts) {\n myerror_logging(3,\"adding: \".date(\"l F j, Y, g:i a\",$first_time));\n\t\t\t\t\t$available_times[] = $close_ts;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tif (!$this->catering) {\n if ($day_num == 0) {\n // just finished today so set increment to 15 minutes to start tomorrow\n $increment_in_seconds = 900;\n } else if ($day_num == 1) {\n // just finished first day in the future so set increment to 30 to start the next day\n $this->increment_for_order = 30;\n $increment_in_seconds = 1800;\n }\n } else {\n\t\t\t if ($day_num > 6) {\n $increment_in_seconds = 7200;\n }\n }\n\t\t}\n\t\treturn $available_times;\n\t\t\n\t}", "public function get_times() {\r\n\t\tif ($this->date_id) {\r\n\t\t\t$sql = \"SELECT begin_datetime, end_datetime FROM `badminton_dates` WHERE date_id = '$this->date_id'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\tif ($result->num_rows == 1) {\r\n\t\t\t\tlist($this->begin_datetime, $this->end_datetime) = mysqli_fetch_array($result, MYSQLI_NUM);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new OutOfRangeException('OutOfRangeException occured on method call get_times, date does not exist for date_id ' .$this->date_id);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on request, date_id is not valid');\r\n\t\t}\r\n\t}" ]
[ "0.58445644", "0.5710736", "0.56709445", "0.5635433", "0.5625808", "0.5469544", "0.5401252", "0.5332087", "0.5330663", "0.5281071", "0.52560043", "0.5190191", "0.5132562", "0.51287854", "0.5091029", "0.50871164", "0.5061402", "0.5044384", "0.5040794", "0.4983293", "0.4933793", "0.49325", "0.4911627", "0.49115774", "0.49049944", "0.490014", "0.4896872", "0.48858464", "0.4869294", "0.48682636" ]
0.6460927
0
Return default time zone
private static function getDefaultTimezone() { static $tz; if ($tz === null) { $tz = new \DateTimeZone(self::DEFAULT_TIME_ZONE); } return $tz; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultTimezone()\r\n\t{\r\n\t\treturn APP_DEFAULT_TIMEZONE;\r\n\t}", "public function getDefaultTimezone(): string|null;", "protected function getDefaultTimeZone()\n {\n if (is_null(self::$defaultTimeZone)) {\n date_default_timezone_set(\"Europe/Rome\");\n self::$defaultTimeZone = new DateTimeZone(date_default_timezone_get());\n }\n return (self::$defaultTimeZone);\n }", "public static function getTimeZone()\r\n {\r\n return date_default_timezone_get();\r\n }", "public function getUserDefaultTimezone()\n\t{\n\t\treturn $this->user_default_timezone;\n\t}", "public function getTimeZone()\n\t{\n\t\treturn date_default_timezone_get();\n\t}", "function getTimeZone()\r\n{\r\n\tglobal $lang;\r\n\t$timezone = (function_exists(\"date_default_timezone_get\")) ? date_default_timezone_get() : ini_get('date.timezone');\r\n\tif (empty($timezone)) $timezone = $lang['survey_298'];\r\n\treturn $timezone;\r\n}", "private function setTimeZone()\n {\n switch(Yii::$app->user->identity->country) {\n case 'ID':\n $dt = Carbon::now('Asia/Jakarta');\n break;\n case 'MYR':\n $dt = Carbon::now('Asia/Kuala_Lumpur');\n break;\n }\n return $dt;\n }", "protected function getTimezone() : \\DateTimeZone\n {\n $config = \\Drupal::config('system.date');\n $defaultTimezone = $config->get('timezone.default');\n\n return new \\DateTimeZone($defaultTimezone ?: @date_default_timezone_get());\n }", "public function getTime_zone()\n {\n return $this->time_zone;\n }", "function timezone()\n\t{\n\t\treturn 'Brazil/East';\n\t}", "public static function get_timezone():string { return self::$timezone; }", "public function getTimezone(): string|null;", "public static function getUserTimezone()\n {\n if (!self::$localTimezone) {\n self::$localTimezone = new \\DateTimeZone(date_default_timezone_get());\n }\n\n return self::$localTimezone;\n }", "public function getTimeZone() {\n try {\n return new \\DateTimeZone($this->timezone);\n } catch (\\Exception $e) {\n // Default to application time zone if the user hasn't set their time zone\n return new \\DateTimeZone(\\Yii::$app->timeZone);\n }\n }", "public function getMyTimezone()\n {\n if (is_null($this->timezoneById)) {\n $this->getList();\n }\n\n if (is_null($this->myTimezone)) {\n if (!is_null($this->myGMT) && isset($this->timezoneById[$this->myGMT])) {\n $this->myTimezone = $this->timezoneById[$this->myGMT];\n } else {\n $this->getCentreonTimezone();\n if (!empty($this->sDefaultTimezone) && !empty($this->timezoneById[$this->sDefaultTimezone])) {\n $this->myTimezone = $this->timezoneById[$this->sDefaultTimezone];\n } else { //if we take the empty PHP\n $this->myTimezone = date_default_timezone_get();\n }\n }\n }\n\n $this->myTimezone = trim($this->myTimezone);\n return $this->myTimezone;\n }", "function common_get_blog_timezone() {\n\t\tstatic $tz;\n\n\t\tif (\\is_null($tz)) {\n\t\t\t// Try the timezone string.\n\t\t\tif (false === $tz = \\get_option('timezone_string', false)) {\n\n\t\t\t\t// Try a GMT offset.\n\t\t\t\tif (0.0 === ($utc_offset = (float) \\get_option('gmt_offset', 0.0))) {\n\t\t\t\t\t$tz = 'UTC';\n\t\t\t\t}\n\t\t\t\t// Pull proper tz abbreviation from the offset, or default to UTC.\n\t\t\t\telseif (false === $tz = \\timezone_name_from_abbr('', ($utc_offset * 3600), 0)) {\n\t\t\t\t\t$tz = 'UTC';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr_sanitize::timezone($tz);\n\t\t}\n\n\t\treturn $tz;\n\t}", "public function getTimezone(){\n\t\treturn parent::getSingleValue('2');\n\t}", "public function getCentreonTimezone()\n {\n if (is_null($this->sDefaultTimezone)) {\n $sTimezone = '';\n\n $query = \"SELECT `value` FROM `options` WHERE `key` = 'gmt' LIMIT 1\";\n try {\n $res = CentreonDBInstance::getConfInstance()->query($query);\n $row = $res->fetchRow();\n $sTimezone = $row[\"value\"];\n } catch (\\Exception $e) {\n // Nothing to do\n }\n $this->sDefaultTimezone = $sTimezone;\n }\n return $this->sDefaultTimezone;\n }", "public function getTimeZone()\n\t{\n\t\treturn $this->getKeyValue('time_zone'); \n\n\t}", "public function getTimeZone(): ?string\n {\n return $this->getProfile()->getTimeZone();\n }", "public function local_tz()\n\t{\n\t\tif ($this->local_tz) return $this->local_tz;\n\n\t\t// use the timezone for the current newsroom\n\t\tif ($this->newsroom && $this->newsroom->timezone) return \n\t\t\t$this->local_tz = new DateTimeZone($this->newsroom->timezone);\n\n\t\t// use the timezone for the default newsroom for this user\n\t\tif (($user = Auth::user()) && ($default_newsroom = $user->default_newsroom()))\n\t\t\tif ($default_newsroom->timezone) return\n\t\t\t\t$this->local_tz = new DateTimeZone($default_newsroom->timezone);\n\n\t\t// use the default UTC timezone\n\t\treturn $this->local_tz = new DateTimeZone($this->conf('timezone'));\n\t}", "function fluentCrmGetTimezoneString()\n{\n // if site timezone string exists, return it\n $timezone = get_option('timezone_string');\n if ($timezone) {\n return $timezone;\n }\n\n // get UTC offset, if it isn't set then return UTC\n $utcOffset = get_option('gmt_offset', 0);\n if ($utcOffset === 0) {\n return 'UTC';\n }\n\n // Adjust UTC offset from hours to seconds\n $utcOffset *= 3600;\n\n // Attempt to guess the timezone string from the UTC offset\n $timezone = timezone_name_from_abbr('', $utcOffset, 0);\n if ($timezone) {\n return $timezone;\n }\n\n // Guess timezone string manually\n $isDst = date('I');\n foreach (timezone_abbreviations_list() as $abbr) {\n foreach ($abbr as $city) {\n if ($city['dst'] == $isDst && $city['offset'] == $utcOffset) {\n $timezoneId = $city['timezone_id'];\n $timezone = $timezoneId ?: timezone_name_from_abbr('', $timezoneId, 0);\n if ($timezone) return $timezone;\n }\n }\n }\n\n // Fallback\n return 'UTC';\n}", "public function getTimeZone()\n {\n return $this->time_zone;\n }", "function getPreferredTimezone($usr_id = FALSE)\r\n\t{\r\n\t\tif ($usr_id === FALSE) {\r\n\t\t\t$usr_id = Auth::getUserID();\r\n\t\t}\r\n\t\tif (empty($usr_id)) {\r\n\t\t\t// return Date_API::getDefaultTimezone();\r\n\t\t\treturn APP_DEFAULT_USER_TIMEZONE;\r\n\t\t}\r\n\r\n\t\t$prefs = Prefs::get($usr_id);\r\n\t\tif (empty($prefs[\"timezone\"])) {\r\n\t\t\treturn APP_DEFAULT_USER_TIMEZONE;\r\n\t\t} else {\r\n\t\t\treturn $prefs[\"timezone\"];\r\n\t\t}\r\n\t}", "function blog_timezone() {\n\n\treturn blog_setting( 'timezone' );\n\n}", "public function timezone() {\n\t\treturn $this->data['timezone'];\n\t}", "protected function scheduleTimezone()\n {\n return 'America/Chicago';\n }", "public function getTimezone()\n {\n if (! isset($this->data->tz_continent)\n || ! isset($this->data->tz_place)\n || ! $this->data->tz_continent\n || ! $this->data->tz_place\n ) {\n return null;\n }\n\n return $this->data->tz_continent . '/' . $this->data->tz_place;\n }", "public function getTimeZone()\n {\n $value = $this->get(self::TIMEZONE);\n return $value === null ? (string)$value : $value;\n }" ]
[ "0.8163387", "0.81542087", "0.8076998", "0.80432403", "0.79838175", "0.776587", "0.75419194", "0.7435893", "0.7358589", "0.7297028", "0.7293946", "0.72560596", "0.7160786", "0.71367913", "0.7024976", "0.702236", "0.69944906", "0.6985106", "0.6979385", "0.6950193", "0.69374925", "0.68940836", "0.6882592", "0.68811613", "0.6827174", "0.68011045", "0.6779923", "0.6767234", "0.6708128", "0.6691586" ]
0.8199632
0
The below variables are needed for rrp calculation (price_service>calc_website_product_rrp())
public function get_fixed_rrp() { return $this->fixed_rrp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRRP()\n\t{\n\t\tif(count($prices = ProductPrice::getPrices($this, ProductPriceType::get(ProductPriceType::ID_RRP), '', '', '', '', 1, 1)) > 0)\n\t\t\treturn $prices[0];\n\t\treturn null;\n\t}", "public function calculatePricePT()\n {\n//\t\tvar_dump($this->Price_pT_Base_override).\"<br>\";\n\t\tif(isset($this->Price_pT_Base_override) && $this->Price_pT_Base_override != \"\")\n\t\t\t{\n//\t\t\techo \"Price over ride<br>\";\n\t\t\t$this->Price_Sub_Total = $this->Price_pT_Base_override + $this->Price_production_pT + $this->Price_transport_pT;\t\n\t\t\t}\n\t\telse{\n\t\t\t//First calculate the price per ton, which is the sum of the ingedients->product price per tom\n\t \t\t$sum = 0;\n\t\t\tforeach($this->ingredients as $ingredientItem)\n\t\t\t\t{\n\t\t\t\t$sum += $ingredientItem->weightedCost;\n\t\t\t\t}\n\t\t\t$this->Price_pT_Base = $sum;\n\t\t\t$this->Price_Sub_Total = $this->Price_pT_Base + $this->Price_production_pT + $this->Price_transport_pT;\n\t\t}\n\t\t\n\n\t\t\n }", "public function getMerchandisePricing();", "public function getShippingPricing();", "function jr_plan_price( $plan_data ) {\n\n\t$price = $plan_data[JR_FIELD_PREFIX.'price'];\n\n\tif ( ( get_query_var('job_relist') || isset($_POST['relist']) ) && isset($plan_data[JR_FIELD_PREFIX.'relist_price']) ) {\n\t\t$price = intval($plan_data[JR_FIELD_PREFIX.'relist_price']);\n\t}\n\treturn apply_filters( 'jr_plan_price', $price, $plan_data );\n}", "function totalPriceForReservation(){\r\n\r\n\t\tif(!$this->isPostRequest()) exit;\r\n\r\n\t\t$post=$this->data;\r\n\t\t//$post[\"reserve_id\"]=1;\r\n\t\t$reserve_id=$post[\"reserve_id\"];\r\n\r\n\t\t$last_edit_time=$post[\"last_edit_time\"];\r\n\t\t$local_time_key=$post[\"local_time_key\"];\r\n\t\t$this->__isEditAuthorityOutput($last_edit_time,$local_time_key);\r\n\r\n\t\t$reservation_data=$this->K9DataReservation->getReservationWhenFinal($reserve_id);\r\n\t\t$price_values=$this->__priceValues($reserve_id,$reservation_data);\r\n\t\t$total_value=$price_values[\"total\"];\r\n\t\t$price_values=$price_values[\"price_values\"];\r\n\r\n\t\t$status_info=array();\r\n\t\tforeach($price_values as $ymd=>$v){\r\n\r\n\t\t\t$count=isset($status_info[$v[\"price_base_status\"]])?count($status_info[$v[\"price_base_status\"]]):0;\r\n\t\t\t$status_info[$v[\"price_base_status\"]][$count][\"data_id\"] =$v[\"data_id\"];\r\n\t\t\t$status_info[$v[\"price_base_status\"]][$count][\"schedule_id\"]=$v[\"schedule_id\"];\r\n\t\t\t$status_info[$v[\"price_base_status\"]][$count][\"status\"]=$v[\"status\"];\r\n\t\t} \r\n\r\n\t\t$price_details=$this->__priceDetailForStatus($status_info);\r\n\t\tif(empty($price_details)) throw new Exception(\"price detail is nothing \".__FUNCTION__);\r\n\r\n\t\tforeach($price_values as $ymd=>$v){\r\n\r\n\t\t\t$price_base_status=$v[\"price_base_status\"];\r\n\t\t\t$data_id=$v[\"data_id\"];\r\n\t\t\t$price_values[$ymd][\"price_detail\"]=$price_details[$price_base_status][$data_id];\r\n\t\t}\r\n\r\n\t\t$res[\"price_values\"]=$price_values;\r\n\t\t$res[\"total_value\"]=$total_value;\r\n\t\t$res[\"priority_price\"]=$reservation_data[\"K9DataReservation\"][\"priority_price\"];\r\n\t\tOutput::__outputYes($res);\r\n\t}", "function google_get_products_base_price($products_id) {\n global $db;\n $product_check = $db->Execute(\"select products_price, products_priced_by_attribute from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$products_id . \"'\");\n\n// is there a products_price to add to attributes\n $products_price = $product_check->fields['products_price'];\n\n // do not select display only attributes and attributes_price_base_included is true\n $product_att_query = $db->Execute(\"select options_id, price_prefix, options_values_price, attributes_display_only, attributes_price_base_included from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$products_id . \"' and attributes_display_only != '1' and attributes_price_base_included='1' and options_values_price > 0\". \" order by options_id, price_prefix, options_values_price\");\n //echo $products_id . ' ';\n //print_r($product_att_query);\n //die();\n $the_options_id= 'x';\n $the_base_price= 0;\n// add attributes price to price\n if ($product_check->fields['products_priced_by_attribute'] == '1' and $product_att_query->RecordCount() >= 1) {\n while (!$product_att_query->EOF) {\n if ( $the_options_id != $product_att_query->fields['options_id']) {\n $the_options_id = $product_att_query->fields['options_id'];\n $the_base_price += $product_att_query->fields['options_values_price'];\n //echo $product_att_query->fields['options_values_price'];\n //die();\n }\n $product_att_query->MoveNext();\n }\n\n $the_base_price = $products_price + $the_base_price;\n } else {\n $the_base_price = $products_price;\n }\n //echo $the_base_price;\n return $the_base_price;\n }", "function nzshpcrt_price_range($args){\n\twpsc_price_range($args);\n}", "function price_calculator($data, $accessedBy = NULL){\n\n $free_artworks = 1;\n $pressproofprice = 0.00;\n $labels_per_rolls = '';\n $promotiondiscount = 0.00;\n $plainlabelsprice = 0.00;\n $label_finish = 0.00;\n\n $producttype = $data['producttype'];\n $labels = $data['labels'];\n $persheets = $data['persheets'];\n $menu = $data['menu'];\n $design = $data['design'];\n //$labeltype = $data['labeltype'];\n\n $labeltype = $this->home_model->get_db_column('digital_printing_process', 'Print_Type', 'name', $data['labeltype']);\n $ProductBrand = $this->ProductBrand($menu);\n\n if($producttype == 'sheet'){\n\n $sheets = ceil($labels/$persheets);\n //$sheets = $labels;\n // $labels = $persheets*$labels;\n\n $data=$this->product_model->ajax_price($sheets, $menu, $ProductBrand);\n $price = $data['custom_price'];\n $printprice = 0.00;\n $designprice = 0.00;\n $free_artworks = 1;\n\n if($labeltype=='Mono' || $labeltype=='Fullcolour'){\n $printprice = $this->home_model->calculate_printed_sheets($sheets, $labeltype, $design, $ProductBrand, $menu);\n $free_artworks = $printprice['artworks'];\n $designprice = $printprice['desginprice'];\n $printprice = $printprice['price'];\n }\n }else{\n\n\n $pressproof = $data['pressproof'];\n $rollfinish = $data['finish'];\n\n //$rolls = (isset($data['rolls']) and $data['rolls']!='')?$data['rolls']:'';\n\n $min_qty = $this->home_model->min_qty_roll($menu);\n\n if ($accessedBy != '' && $accessedBy == 'material_page') {\n $response = $this->home_model->rolls_calculation($min_qty, $persheets, $labels, \"\", $accessedBy);\n } else {\n $response = $this->home_model->rolls_calculation($min_qty, $persheets, $labels);\n }\n\n\n $labels = $response['total_labels'];\n $labels_per_rolls = $response['per_roll'];\n $sheets = $response['rolls'];\n\n\n $collection['labels'] = $labels;\n $collection['manufature'] = $menu;\n $collection['finish'] = $data['finish'];\n $collection['rolls'] = $sheets;\n $collection['labeltype'] = $labeltype;\n\n $price_res = $this->home_model->calculate_printing_price($collection);\n $promotiondiscount = $price_res['promotiondiscount'];\n $plainlabelsprice = $price_res['plainprice'];\n $label_finish = $price_res['label_finish'];\n\n\n //137.51*1.1 = 151.261\n $price = $plainprice = $price_res['final_price'];\n\n /*************** Roll Labels Price *************/\n $printprice = 0.00;\n $designprice = 0.00;\n $free_artworks = 10;\n if ($pressproof == 1) {\n $pressproofprice = 50.00;\n }\n /*************** Roll Labels Price *************/\n }\n\n\n\n\n //$('.nlabelfilter').trigger('mouseover');\n\n $delivery_txt = $this->shopping_model->delevery_txt();\n\n $ProductBrand = $this->ProductBrand($menu);\n\n\n if (preg_match(\"/A4 Labels/is\", $ProductBrand) || preg_match(\"/A5 Labels/is\", $ProductBrand)) { //For A5 Sheet Discount\n $mat_code = $this->home_model->getmaterialcode($menu);\n //For A5 Sheet Discount\n if (preg_match(\"/A5 Labels/is\", $ProductBrand)) {\n $material_discount = $this->home_model->check_material_discount($mat_code, 'A5');\n } else {\n $material_discount = $this->home_model->check_material_discount($mat_code, 'A4');\n }\n\n if ($material_discount) {\n $wpep_discount = (($price) * ($material_discount / 100));\n $wpep_discount = number_format($wpep_discount, 2, '.', '');\n $wpep_discount_txt = '<small class=\"discount_price\">' . symbol . $price . ' </small>';\n $price = number_format(($price - $wpep_discount), 2, '.', '');\n }\n }\n\n\n $plainprice = number_format($price,2,'.','');\n $price = $designprice+$printprice+$price+$pressproofprice;\n $price = number_format($price,2,'.','');\n\n $pressproofprice = number_format($pressproofprice,2,'.','');\n\n\n if (preg_match(\"/WPEP/i\", $menu) and $producttype == 'sheet') {\n $wpep_discount = (($plain) * (20 / 100));\n $price = number_format(($price - $wpep_discount),2,'.','');\n\n }\n\n $delivery_txt = '';\n if($price > 25){\n $delivery_txt = '<b> Free Delivery </b>';\n }\n\n $priceperlabels = number_format(($price/$labels),3,'.','');\n\n $price_array = array('price'=>$price,\n 'plainprint'=>($plainprice+$printprice),\n 'plainprice'=>$plainprice,\n 'printprice'=>$printprice,\n 'designprice'=>$designprice,\n 'pressproof'=>$pressproofprice,\n 'priceperlabels'=>$priceperlabels,\n 'artworks'=>$free_artworks,\n 'nodesing'=>$design,\n 'sheets'=>$sheets,\n 'rolls'=>$sheets,\n 'labels'=>$labels,\n 'labels_per_rolls'=>$labels_per_rolls,\n 'delivery_txt'=>$delivery_txt,\n 'promotiondiscount'=>$promotiondiscount,\n 'plainlabelsprice'=>$plainlabelsprice,\n 'label_finish'=>$label_finish);\n return $price_array;\n\n\n }", "function ovacrs_price_special_time( $product_id, $rent_time, $key_rt ){\n\n \n $ovacrs_rt_startdate = get_post_meta( $product_id, 'ovacrs_rt_startdate', true );\n $ovacrs_rt_price = get_post_meta( $product_id, 'ovacrs_rt_price', true );\n $ovacrs_rt_price_hour = get_post_meta( $product_id, 'ovacrs_rt_price_hour', true );\n $ovacrs_rt_discount = get_post_meta( $product_id, 'ovacrs_rt_discount', true );\n\n $price_type = get_post_meta( $product_id, 'ovacrs_price_type', true );\n \n if( $ovacrs_rt_startdate[$key_rt] ){\n \n \n\n\n // Check if PickUp Date bettwen date of Range Time\n if( $price_type == 'day' ){\n\n $rt_price = $ovacrs_rt_price[$key_rt];\n // Return ST Price Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount($ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='days', $rent_time['rent_time_day'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n \n\n }else if( $price_type == 'hour' ){\n\n $rt_price = $ovacrs_rt_price_hour[$key_rt];\n\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='hours', $rent_time['rent_time_hour'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }else{ // Price type is Mixed\n\n if( $rent_time['rent_time_day_raw'] < 1 ){\n\n $rt_price = $ovacrs_rt_price_hour[$key_rt];\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='hours', $rent_time['rent_time_hour'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }else{\n\n $rt_price = $ovacrs_rt_price[$key_rt];\n // Set Price by RT(ST) Discount\n if( isset( $ovacrs_rt_discount[$key_rt] ) ){\n $ovacrs_rt_discount_duration_val = $ovacrs_rt_discount[$key_rt]['duration'];\n arsort($ovacrs_rt_discount_duration_val);\n\n $ovacrs_rt_discount_duration_type = $ovacrs_rt_discount[$key_rt]['duration_type'];\n $ovacrs_rt_discount_duration_price = $ovacrs_rt_discount[$key_rt]['price'];\n $st_set_price = set_price_by_rt_discount( $ovacrs_rt_discount_duration_val, $ovacrs_rt_discount_duration_type, $ovacrs_rt_discount_duration_price, $price_type='days', $rent_time['rent_time_day'] );\n $rt_price = $st_set_price != false ? $st_set_price : $rt_price;\n }\n\n return $rt_price;\n\n }\n }\n \n } // endif\n}", "public function getProductPricing()\n {\n $pulseSiteId = 2;\n $pricingData = $this->join('order_core.product as p', 'p.id', '=', 'product_price.product_id')\n ->join('order_core.product_print as pp2', 'pp2.id', '=', 'p.product_print_id')\n ->where('site_id', '=', $pulseSiteId)\n ->whereRaw(\n '((order_core.product_price.date_start <= curdate() AND order_core.product_price.date_end >= curdate()) \n OR (order_core.product_price.date_start <= curdate() AND order_core.product_price.date_end IS NULL))'\n )\n ->distinct()\n ->select('p.*')\n ->get();\n\n return $pricingData;\n }", "function pricing() {\r\n\t\t/*else*/ $this->layout = 'before_login';\r\n\t\t\r\n\t\t//session_regenerate_id();\r\n\t\t\r\n\t\t$cond['conditions']['Pricing.status'] = 0;\r\n\t\t$cond['conditions']['Pricing.validity'] = 6;\r\n\t\t$package1 = $this->Pricing->find('all', $cond);\r\n\t\t\r\n\t\t$cond['conditions']['Pricing.validity'] = 12;\r\n\t\t$package2 = $this->Pricing->find('all', $cond);\r\n\t\t\r\n\t\t$this->set('app', $this);\r\n\t\t$this->set('package1', $package1);\r\n\t\t$this->set('package2', $package2);\r\n\t\t$this->set('tab', array('7'));\r\n\t\t$this->getFeedback();\r\n\r\n\t}", "protected function prepareMyPrice() {\n\t\t$this->throttleTime = MWSConstant::THROTTLE_TIME_PRODUCTPRICE;\n\t}", "function get_resource_price($product_id, $resource_id)\n{\n $product = wc_get_product($product_id);\n if (!$product->has_person_types()) {\n return;\n }\n\n global $wpdb;\n $price = $wpdb->get_var(\n $wpdb->prepare(\n \"SELECT meta_value\n FROM $wpdb->postmeta\n WHERE post_id = %d AND meta_key = %s\",\n [$resource_id, 'cost']\n )\n );\n\n return sanitize_text_field($price);\n}", "function get_resource_byoe_price($product_id, $resource_id)\n{\n $product = wc_get_product($product_id);\n if (!$product->has_person_types()) {\n return;\n }\n\n $byoe_price = get_byoe_price($resource_id);\n\n return is_null($byoe_price) ? null : +$byoe_price;\n}", "function google_get_products_special_price($product_id, $product_price, $specials_price_only=false) {\n global $db;\n $product = $db->Execute(\"select products_price, products_model, products_priced_by_attribute from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$product_id . \"'\");\n\n //if ($product->RecordCount() > 0) {\n// $product_price = $product->fields['products_price'];\n //$product_price = zen_get_products_base_price($product_id);\n //} else {\n //return false;\n //}\n\n $specials = $db->Execute(\"select specials_new_products_price from \" . TABLE_SPECIALS . \" where products_id = '\" . (int)$product_id . \"' and status='1'\");\n if ($specials->RecordCount() > 0) {\n// if ($product->fields['products_priced_by_attribute'] == 1) {\n $special_price = $specials->fields['specials_new_products_price'];\n } else {\n $special_price = false;\n }\n\n if(substr($product->fields['products_model'], 0, 4) == 'GIFT') { //Never apply a salededuction to Ian Wilson's Giftvouchers\n if (zen_not_null($special_price)) {\n return $special_price;\n } else {\n return false;\n }\n }\n\n// return special price only\n if ($specials_price_only==true) {\n if (zen_not_null($special_price)) {\n return $special_price;\n } else {\n return false;\n }\n } else {\n// get sale price\n\n// changed to use master_categories_id\n// $product_to_categories = $db->Execute(\"select categories_id from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$product_id . \"'\");\n// $category = $product_to_categories->fields['categories_id'];\n\n $product_to_categories = $db->Execute(\"select master_categories_id from \" . TABLE_PRODUCTS . \" where products_id = '\" . $product_id . \"'\");\n $category = $product_to_categories->fields['master_categories_id'];\n\n $sale = $db->Execute(\"select sale_specials_condition, sale_deduction_value, sale_deduction_type from \" . TABLE_SALEMAKER_SALES . \" where sale_categories_all like '%,\" . $category . \",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0001-01-01') and (sale_date_end >= now() or sale_date_end = '0001-01-01') and (sale_pricerange_from <= '\" . $product_price . \"' or sale_pricerange_from = '0') and (sale_pricerange_to >= '\" . $product_price . \"' or sale_pricerange_to = '0')\");\n if ($sale->RecordCount() < 1) {\n return $special_price;\n }\n\n if (!$special_price) {\n $tmp_special_price = $product_price;\n } else {\n $tmp_special_price = $special_price;\n }\n switch ($sale->fields['sale_deduction_type']) {\n case 0:\n $sale_product_price = $product_price - $sale->fields['sale_deduction_value'];\n $sale_special_price = $tmp_special_price - $sale->fields['sale_deduction_value'];\n break;\n case 1:\n $sale_product_price = $product_price - (($product_price * $sale->fields['sale_deduction_value']) / 100);\n $sale_special_price = $tmp_special_price - (($tmp_special_price * $sale->fields['sale_deduction_value']) / 100);\n break;\n case 2:\n $sale_product_price = $sale->fields['sale_deduction_value'];\n $sale_special_price = $sale->fields['sale_deduction_value'];\n break;\n default:\n return $special_price;\n }\n\n if ($sale_product_price < 0) {\n $sale_product_price = 0;\n }\n\n if ($sale_special_price < 0) {\n $sale_special_price = 0;\n }\n\n if (!$special_price) {\n return number_format($sale_product_price, 4, '.', '');\n } else {\n switch($sale->fields['sale_specials_condition']){\n case 0:\n return number_format($sale_product_price, 4, '.', '');\n break;\n case 1:\n return number_format($special_price, 4, '.', '');\n break;\n case 2:\n return number_format($sale_special_price, 4, '.', '');\n break;\n default:\n return number_format($special_price, 4, '.', '');\n }\n }\n }\n }", "private function get_final_booking_price_details($Fare, $multiplier, $specific_markup_config, $currency_obj, $deduction_cur_obj, $module, $token_value = array(), $is_domestic='') {\r\n $data = array();\r\n //$core_agent_commision = ($Fare['PublishedFare'] - $Fare['OfferedFare']);\r\n $core_agent_commision = $token_value['api_original_price_details']['PriceBreakup']['AgentCommission'];\r\n // echo \"core_agent_commision\".$core_agent_commision.'<br/>';\r\n $commissionable_fare = $Fare['PublishedFare'];\r\n if ($module == 'b2c') {\r\n $trans_total_fare = $this->total_price($Fare, false, $currency_obj);\r\n // echo $trans_total_fare;exit; \r\n $markup_total_fare = $currency_obj->get_currency($Fare['OfferedFare'], true, false, true, $multiplier, $specific_markup_config, $is_domestic);\r\n\r\n $ded_total_fare = $deduction_cur_obj->get_currency($Fare['OfferedFare'], true, true, false, $multiplier, $specific_markup_config, $is_domestic);\r\n $admin_markup = roundoff_number($markup_total_fare['default_value'] - $ded_total_fare['default_value']);\r\n $admin_commission = $core_agent_commision;\r\n $agent_markup = 0;\r\n $agent_commission = 0;\r\n } else {\r\n //B2B Calculation\r\n //Markup # Modified Balu\r\n # debug($Fare);\r\n $trans_total_fare = $Fare['PublishedFare'];\r\n # echo \"commission\";\r\n \r\n $group_id = 2;\r\n $CI =&get_instance();\r\n $user_oid = $CI->entity_user_id;\r\n\r\n //$this->commission = $currency_obj->get_commission($__trip_flight,$user_oid,$group_id, PROVAB_FLIGHT_BOOKING_SOURCE);\r\n\r\n $this->commission = $currency_obj->get_commission($token_value,$user_oid,$group_id, PROVAB_FLIGHT_BOOKING_SOURCE);\r\n\r\n $AgentCommission = $this->calculate_commission($core_agent_commision);\r\n #debug($this->commission);\r\n\r\n $admin_commission = roundoff_number($core_agent_commision - $AgentCommission); //calculate here\r\n $agent_commission = roundoff_number($AgentCommission);\r\n \r\n #echo \"agent_commission\".$agent_commission.'<br/>';\r\n $admin_net_rate=($trans_total_fare-$agent_commission);\r\n\r\n # echo \"admin_net_rate\".$admin_net_rate.'<br/>';\r\n\r\n $markup_total_fare = $currency_obj->get_currency($admin_net_rate, true, true, false, $multiplier, $specific_markup_config, $is_domestic);\r\n \r\n # debug($markup_total_fare);\r\n\r\n $admin_markup = abs($markup_total_fare['default_value'] - $admin_net_rate);\r\n # echo $admin_markup;\r\n\r\n $agent_net_rate=(($trans_total_fare + $admin_markup)-$agent_commission);\r\n $ded_total_fare = $deduction_cur_obj->get_currency($agent_net_rate, true, false, true, $multiplier, $specific_markup_config, $is_domestic);\r\n\r\n # debug($ded_total_fare);\r\n\r\n $agent_markup = roundoff_number($ded_total_fare['default_value'] - $agent_net_rate);\r\n \r\n \r\n }\r\n //TDS Calculation\r\n $admin_tds = $currency_obj->calculate_tds($admin_commission);\r\n $agent_tds = $currency_obj->calculate_tds($agent_commission);\r\n\r\n $data['commissionable_fare'] = $commissionable_fare;\r\n $data['trans_total_fare'] = $trans_total_fare;\r\n $data['admin_markup'] = $admin_markup;\r\n $data['agent_markup'] = $agent_markup;\r\n $data['admin_commission'] = $admin_commission;\r\n $data['agent_commission'] = $agent_commission;\r\n $data['admin_tds'] = $admin_tds;\r\n $data['agent_tds'] = $agent_tds;\r\n return $data;\r\n }", "function __service_request_price_calculate($data) {\n\t$data = _services_arg_value($data, 'data');\n\n\tif (!isset($data['location']) || !isset($data['category']) || !isset($data['date'])) return services_error('Invalid format data', 404);\n\n $location = $data['location'];\n $category = $data['category'];\n $date = $data['date'];\n $mail = isset($data['mail']) ? $data['mail'] : NULL;\n\n $price = maritpal_services_old_calculate_request_service_price($location, $category, $date, $mail);\n return !$price ? (object)array('data' => (object)array()) : $price;\n}", "public function getPrice() {\n $product = Product::findOne($this->product['id']);\n if ($this->getType() > 0) {\n if (!empty($product->classify[$this->getType() - 1]['frame']) && ($product->classify[$this->getType() - 1]['frame'] != \"\")) {\n foreach ($product->classify[$this->getType() - 1]['frame'] as $value) {\n if ($this->getQuantity() >= (int) $value['quantity_min'] && $this->getQuantity() <= (int) $value['quantity_max']) {\n\n return $value['price'];\n }\n }\n } else {\n return $product->classify[$this->getType() - 1]['price_min'];\n }\n } else {\n if (!empty($product->approx)) {\n foreach ($product->approx as $value) {\n if ($this->getQuantity() >= $value['quantity_min'] && $this->getQuantity() <= $value['quantity_max']) {\n return $value['price'];\n }\n }\n } else {\n return $product->price['min'];\n }\n }\n }", "abstract function getPrice();", "public function render(){\n\t\t$part = $this->arguments['part'];\n\t\t$trailer = $this->arguments['trailer'];\n\n\t\t$settings = $this->templateVariableContainer->get('settings');\n\t\t$geoIp = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\KcHumbaurProducts\\Utility\\GeoIp');\n\n\t\t$price = $geoIp->recommendedPriceByIp($part, $trailer);\n\n\t\t$objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');\n\t\t$configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');\n\t\t$settings = $configurationManager->getConfiguration(\n\t\t\t\t\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'KcHumbaurProducts'\n\t\t);\n\n\n\t\t/*\n\t\t**\t25.02.2014 / oliverk\n\t\t** Specialprices / Pricehighlights should only be shown in Germany\n\t\t** (so said by Waliczek)\n\t\t*/\n\n\n\t\tif($geoIp->iso2ByIp() !== \"de\" || $settings[\"SpecialPriceHidden\"] == \"1\")\n\t\t{\n\t\t\tif(isset($price) && method_exists($price, \"setSpecialpricegross\"))\n\t\t\t{\n\t\t\t\t$price->setSpecialpricegross(0);\n\t\t\t\t$price->setSpecialpricenet(0);\n\t\t\t}\n\t\t}\n\t\treturn $price;\n\n\t}", "private function _updateProductPrices() {\n $query=\"UPDATE \".DB_PREFIX.\"product p SET p.labour_cost=p.price, \"\n . \"p.price='' WHERE is_updated IS NULL AND model != 'grouped'\";\n \n $this->db->query($query);\n }", "function getPrice();", "function google_get_products_actual_price($products_id) {\n global $db, $currencies;\n $product_check = $db->Execute(\"select products_tax_class_id, products_price, products_priced_by_attribute, product_is_free, product_is_call from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$products_id . \"'\" . \" limit 1\");\n\n $show_display_price = '';\n $display_normal_price = $this->google_get_products_base_price($products_id);\n //echo $display_normal_price . '<br />';\n $display_special_price = $this->google_get_products_special_price($products_id, $display_normal_price, true);\n //echo $display_special_price . '<br />';\n $display_sale_price = $this->google_get_products_special_price($products_id, $display_normal_price, false);\n //echo $display_sale_price . '<br />';\n $products_actual_price = $display_normal_price;\n\n if ($display_special_price) {\n $products_actual_price = $display_special_price;\n }\n if ($display_sale_price) {\n $products_actual_price = $display_sale_price;\n }\n\n // If Free, Show it\n if ($product_check->fields['product_is_free'] == '1') {\n $products_actual_price = 0;\n }\n //die();\n\n return $products_actual_price;\n }", "function communityservice_template_loop_price() {\n\t\tcs_get_template( 'loop/price.php' );\n\t}", "function __service_request_rate_calculate($data) {\n\t$data = _services_arg_value($data, 'data');\n\n\tif (!isset($data['location']) || !isset($data['category']) || !isset($data['date'])) return services_error('Invalid format data', 404);\n\n $location = $data['location'];\n $category = $data['category'];\n $date = $data['date'];\n $mail = $data['mail'];\n\n $price = maritpal_services_old_calculate_request_service_price_rate($location, $category, $date, $mail);\n return !$price ? (object)array('data' => (object)array()) : $price;\n}", "function costs(){\n\t\t\tforeach ($this->_companies as $company){\n\t\t\t\t$company->setInterestTotal();\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['pr_fixed_cost']=$company->getPrFixedCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_hiring_costs']=$company->getHrHiringCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_training_costs']=$company->getHrTrainingCost();\n\t\t\t\t$this->_costs[$company->getId()]['hr_wages_costs']=$company->getHrWagesCost();\t\n\t\t\t\t// Los de distribución sacados de abajo porque se calculan completos (excepto los de distribución de stock) en la rutina $company->getPrDistribCost()\n\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\t\t\t\t}\n\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=$company->getPrDistribCost();\n\t\t\t\t//todo lo incluido en este foreach funciona debidamente\n\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){ \n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_var_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_var_costs']+=$company->getPrVarCost($channel->getChannelNumber(), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $product->getProductNumber());\n\t\t\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_rawMaterials_costs'][$channel->getChannelNumber()]+=$company->getPrRawMaterialsCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['pr_distrib_costs'])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']=0;\n\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// Sacado el cálculo fuera porque la rutina ya calcula el total.\n\t\t\t\t\t\t\t\t// $this->_costs[$company->getId()]['pr_distrib_costs']+=(($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//test\n\t\t\t\t\t\t\t\t// if ($company->getId()==168) {\n\t\t\t\t\t\t\t\t\t\t// echo(\"Costes distribución Test. Empresa: \" . $company->getId() . \", Canal: \" . $channel->getChannelNumber() . \", Región : \" . $region->getRegionNumber() . \", Producto: \" . $product->getProductNumber() . \", COSTE = \" . ($company->getPrDistribCost($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber())) . \"<br/>\");\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t//VERO: Costes de distribución de stocks\n\t\t\t\t\t\t\t\tforeach($this->_channels as $channelD){\n\t\t\t\t\t\t\t\t\tforeach ($this->_regions as $regionD){\n\t\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['pr_distrib_costs']+=$company->getStDistribCost($channel->getChannelNumber(), $channelD->getChannelNumber(), $region->getRegionNumber(), $regionD->getRegionNumber(), $product->getProductNumber());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//VERO\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_sales_costs'][$channel->getChannelNumber()]+=$company->getMkSalesCost($channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]=0;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_fixed_costs'][$channel->getChannelNumber()]+=$company->getMkFixedCost2($channel->getChannelNumber(), $region->getRegionNumber(), $product->getProductNumber()); // getMkFixedCost does not have $product as argument!\n\t\t\t\t\t\t\t\t// AHG 20171122 Mode change can be done by providing or not $product as argument\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//Costes funcionan por canal, para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\tforeach ($this->_medias as $media){\n\t\t\t\t\tforeach ($this->_regions as $region){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_advert_costs'][$media->getMediaNumber()]+=$company->getMkAdvertCost($media->getMediaNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$region->getRegionNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tforeach ($this->_trademedias as $trademedia){\n\t\t\t\t\tforeach ($this->_channels as $channel){\n\t\t\t\t\t\tforeach ($this->_products as $product){\n\t\t\t\t\t\t\t$availability=$this->_games->getProductAvailibility($this->_game['id'], $this->_round['round_number'],$company->getId(), $product->getProductNumber());\n\t\t\t\t\t\t\tif($availability==1){\n\t\t\t\t\t\t\t\tif (! isset($this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']])){\n\t\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->_costs[$company->getId()]['mk_trade_costs'][$trademedia['trademedia_number']]+=$company->getMkTradeCost($trademedia['trademedia_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$channel->getChannelNumber(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$product->getProductNumber());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Medias y TradeMedias funcionan para todos los productos y todas las regiones\n\t\t\t\t\n\t\t\t\t//costes de las iniciativas selecionadas funcionando OK.\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_pr_costs']=$company->getInitiativesProductionCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_mk_costs']=$company->getInitiativesMarketingCost();\n\t\t\t\t$this->_costs[$company->getId()]['initiatives_hr_costs']=$company->getInitiativesHumanResourcesCost();\n\t\t\t\t\n\t\t\t\t//costes de los estudios de mercado solicitados funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['market_researches_costs']=$company->getMarketResearchesCosts();\n\t\t\t\t//costes de cambios de I+D+i funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_changes_costs']=$company->getIdiChangesCosts();\n\t\t\t\t//costes de I+D+i en lanzamiento de nuevos productos funcionando OK\n\t\t\t\t$this->_costs[$company->getId()]['idi_new_costs']=$company->getIdiNewCosts();\n\t\t\t\t\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_st']=$company->getFiDebtCostsSt();\n\t\t\t\t$this->_costs[$company->getId()]['fi_debt_costs_lt']=$company->getFiDebtCostsLt();\n\t\t\t\techo(\"<br>CORE (1) FIDEBTCOSTS: \".$company->getFiDebtCostsLt().\"<br>\");\n\t\t\t\t\n\t\t\t\t//Para que no haya ningun coste a NULL\n\t\t\t\tforeach ($this->_costs[$company->getId()] as $name=>$cost){\n\t\t\t\t\tif(!isset($cost)){\n\t\t\t\t\t\t$this->_costs[$company->getId()][$name]=0;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$this->save_costs();\n\t\t}", "function total_price()\r\n{\r\n\r\n$total=0;\r\n\r\n$ip=getIP();\r\n\r\n$price_product=\"select *from cart where ip_address='$ip'\";\r\n\r\n$price_run=mysql_query($price_product);\r\n\r\nwhile($price_select=mysql_fetch_array($price_run))\r\n\r\n{\r\n\r\n$pro_id=$price_select['p_id'];\r\n$price=\"select * from products where product_id='$pro_id'\";\r\n\r\n$item_price=mysql_query($price);\r\n\r\nwhile($p_price=mysql_fetch_array($item_price))\r\n{\r\n$pro_price=array($p_price['product_price']);\r\n\r\n$total_price=array_sum($pro_price);\r\n\r\n$total+=$total_price;\r\n}\r\n\r\n\r\n}\r\necho $total;\r\n\r\n}", "function calculate_price(){\n\t\t//any programatic price adjustments should be added here, otherwise you need to run this function again\n\t\tdo_action('em_booking_pre_calculate_price', $this);\n\t //reset price and taxes calculations\n\t $this->booking_price = $this->booking_taxes = null;\n\t //get post-tax price and save it to booking_price\n\t $this->booking_price = apply_filters('em_booking_calculate_price', $this->get_price_post_taxes(), $this);\n\t return $this->booking_price; \n\t}", "public function totalprice();" ]
[ "0.60928506", "0.60788625", "0.59971386", "0.5852529", "0.58190364", "0.57931817", "0.57930124", "0.56194496", "0.56120306", "0.5596456", "0.5576108", "0.55705404", "0.55515856", "0.5538749", "0.5526993", "0.55253524", "0.5502216", "0.5482231", "0.5461215", "0.5402955", "0.53985023", "0.53965545", "0.5393858", "0.537853", "0.53490627", "0.5348933", "0.5326074", "0.5307644", "0.5305891", "0.5290983" ]
0.6112332
0
Transform the OtherService entity.
public function transform(OtherService $model) { return [ 'id' => (int) $model->id, /* place your other model properties here */ 'created_at' => $model->created_at, 'updated_at' => $model->updated_at ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getLexikFormFilter_Type_FilterEntityService()\n {\n return $this->services['lexik_form_filter.type.filter_entity'] = new \\Lexik\\Bundle\\FormFilterBundle\\Filter\\Form\\Type\\EntityFilterType(${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'});\n }", "abstract public function getMappedSecondEntities();", "public function transform(Order $model)\n {\n\n $orderStatus = $model->currentStatus;\n\n $relationships = [\n 'items' => $model->uri.'/items',\n 'status-history' => $model->uri.'/statuses',\n 'payments' => $model->uri.'/payments'\n ];\n\n if ($model->location) {\n $relationships = array_add($relationships, 'location', $model->location->uri);\n }\n if ($model->customer) {\n $relationships = array_add($relationships, 'customer', $model->customer->uri);\n }\n\n $response = $this->transformAll($model, $relationships, [\n 'reference' => $model->reference,\n 'code' => $model->code,\n 'source' => $model->source,\n 'type' => $model->type,\n 'promised-time' => $this->formatTimestamp($model->promised_time),\n 'subtotal' => $model->subtotal,\n 'total' => $model->total,\n 'discount' => $model->discount,\n 'coupon-code' => $model->coupon_code,\n 'payment-type' => $model->payment_type\n\n ]);\n\n if ($orderStatus && sizeof($orderStatus)>0) {\n $current_status = [\n 'sequence' => $orderStatus[0]->orderStatus->sequence,\n 'code' => $orderStatus[0]->orderStatus->code,\n 'description' => $orderStatus[0]->orderStatus->description,\n 'changed-at' => $this->formatTimestamp($orderStatus[0]->created_at)\n ];\n $response = array_add($response, 'current-status', $current_status);\n }\n\n $order_items = $model->orderItem()->get();\n $transform = new OrderItemTransformer();\n $items = $transform->transformCollection($order_items->all());\n $response = array_add($response, 'items', $items);\n\n return $response;\n }", "protected abstract function createTransformationService();", "public function getOldEntity();", "abstract public function getSecondEntityByName($secondEntityName);", "public function toDTO($filterByKey = null)\n {\n $baseMeta = $this->meta();\n\n $baseEntity = [\n \"timeStamp\" => $this->timeStamp()->toDTO(),\n \"fee\" => $this->fee()->toMicro(),\n ];\n\n // extend entity data in sub class\n // @see \\NEM\\Models\\Transaction\\MosaicTransfer\n $meta = array_merge($baseMeta, $this->extendMeta());\n $entity = array_merge($baseEntity, $this->extend());\n\n // mosaics field is used to determine the version\n $versionByContent = !isset($entity[\"mosaics\"]) ? self::VERSION_1 \n : self::VERSION_2;\n\n // validate version field, should always reflect valid NIS tx version\n $version = $this->getAttribute(\"version\");\n $versions = [\n self::VERSION_1, self::VERSION_2,\n self::VERSION_1_TEST, self::VERSION_2_TEST,\n self::VERSION_1_MIJIN, self::VERSION_2_MIJIN\n ];\n if (! $version || !in_array($version, $versions)) {\n $version = $versionByContent;\n }\n\n // validate transaction type, should always be a valid type\n $type = $this->getAttribute(\"type\") ?: (isset($entity[\"type\"]) ? $entity[\"type\"] : null);\n $validTypes = array_keys(self::$typesClassMap);\n if (! $type || ! in_array($type, $validTypes)) {\n $type = TransactionType::TRANSFER;\n $this->setAttribute(\"type\", $type);\n }\n\n // deadline set to +1 hour if none set\n $deadline = $this->deadline()->toDTO();\n if (! $deadline || $deadline <= 0) {\n $txTime = $entity[\"timeStamp\"];\n $deadline = $txTime + 3600;\n $this->setAttribute(\"deadline\", $deadline);\n }\n\n // do we have optional fields\n $optionals = [\"signer\", \"signature\"];\n foreach ($optionals as $field) {\n $data = $this->getAttribute($field);\n if (null !== $data) {\n $entity[$field] = $data;\n }\n }\n\n // push validated input\n $entity[\"type\"] = $type;\n $entity[\"version\"] = $version;\n $entity[\"deadline\"] = $deadline;\n\n $toDTO = [\n \"meta\" => $meta,\n \"transaction\" => $entity,\n ];\n\n if ($filterByKey && isset($toDTO[$filterByKey]))\n return $toDTO[$filterByKey];\n\n return $toDTO;\n }", "protected function getForm_Type_EntityService()\n {\n return $this->services['form.type.entity'] = new \\Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType(${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'});\n }", "protected function getSensioFrameworkExtra_Converter_Doctrine_OrmService()\n {\n return $this->services['sensio_framework_extra.converter.doctrine.orm'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter(${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE)) && false ?: '_'});\n }", "public function transform();", "public function transform();", "protected function getForm_Type_EntityService()\n {\n return $this->services['form.type.entity'] = new \\Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType($this->get('doctrine'));\n }", "public function entityObject()\r\n {\r\n return $this;\r\n }", "public function entityObject()\n {\n return $this;\n }", "public function services()\n {\n return $this->belongsToMany(Service::class, 'service_to_tariff', 'tariff_id', 'service_id');\n }", "abstract public function returnEntity();", "private function mapResponseToEntity(ProcessEvent $event)\n {\n /** @var \\GuzzleHttp\\Command\\Model $result */\n $result = $event->getResult();\n\n $isCollection = false;\n $mapper = $this->findMapper($event, $isCollection);\n if (! $mapper || ! $result->toArray()) {\n $event->setResult($result->toArray());\n return;\n }\n\n $resource = current($result->toArray());\n\n if (! $isCollection) {\n $resource = $mapper->map($resource);\n } else {\n // map each element in the provided resource collection\n foreach ($resource as $key => $resourceItem) {\n $resource[$key] = $mapper->map($resourceItem);\n }\n }\n\n $event->setResult(new Response($resource, $result['meta']));\n }", "public function transform(ServiceAd $model)\n {\n return [\n 'id' => (int) $model->id,\n\n /* place your other model properties here */\n\n 'created_at' => $model->created_at,\n 'updated_at' => $model->updated_at\n ];\n }", "public function process()\n {\n $entityDefs = $this->getEntityDefs(true);\n\n $ormMeta = array();\n foreach($entityDefs as $entityName => $entityMeta) {\n\n if (empty($entityMeta)) {\n $GLOBALS['log']->critical('Orm\\Converter:process(), Entity:'.$entityName.' - metadata cannot be converted into ORM format');\n continue;\n }\n\n $ormMeta = Util::merge($ormMeta, $this->convertEntity($entityName, $entityMeta));\n }\n\n $ormMeta = $this->afterProcess($ormMeta);\n\n return $ormMeta;\n }", "public function reverseTransform($entityClass, $value);", "public function getOtherServiceInformations()\n {\n return $this->otherServiceInformations;\n }", "public function transform()\n {\n }", "public function getOriginalEntity()\n\t{\n\t\treturn $this->getElement('originalEntity');\n\t}", "public function transform($entity) {\n /*\n * Modified from comments to use instanceof so that base classes or\n * interfaces can be specified\n */\n if (null === $entity || !($entity instanceof $this->entityClass)) {\n return '';\n }\n\n return $entity->getId();\n }", "public function addToOtherServiceInformations(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\SpecialReqDetailsType\\OtherServiceInformationsAType\\OtherServiceInformationAType $otherServiceInformation)\n {\n $this->otherServiceInformations[] = $otherServiceInformation;\n return $this;\n }", "abstract protected function transformer();", "protected function getEntity($i_id,$I_service=null) {\n if ( $I_service === null){\n $I_service = $this->I_service;\n }\n $I_entity = $I_service->getEntity($i_id);\n return $I_entity;\n }", "public function transformFromObject( UserEntityInterface $user ): UserResponseDto;", "public function makeInstanceOfEntity()\n {\n /** @var string|mixed|null $type **/\n $type = $this->getEntityType();\n\n return $this->makeInstanceByEntityType($type);\n }", "public function hydrate(ServiceInterface $service);" ]
[ "0.5208354", "0.5130167", "0.5033544", "0.49676308", "0.4915548", "0.49151286", "0.49149176", "0.4908309", "0.48932654", "0.48708987", "0.48708987", "0.48550445", "0.47953448", "0.47920164", "0.47852093", "0.47757483", "0.47368222", "0.47238734", "0.47185877", "0.46723396", "0.46532562", "0.46454343", "0.4644589", "0.46380204", "0.46303013", "0.46154302", "0.46111715", "0.4585145", "0.45773032", "0.45745277" ]
0.63915205
0
Clean out all the data for draft or scheduled events This information is not available to unprivileged users
protected function clearDataForDraftOrScheduledEvent() { if (!$this->isPublished || $this->isScheduled) { $this->name = 'Scheduled'; $this->courseTitle = null; $this->offering = null; $this->ilmSession = null; $this->color = null; $this->location = null; $this->url = null; $this->attireRequired = null; $this->equipmentRequired = null; $this->supplemental = null; $this->attendanceRequired = null; $this->courseExternalId = null; $this->sessionDescription = null; $this->sessionTitle = null; $this->sessionTypeTitle = null; $this->sessionTypeId = null; $this->courseLevel = null; $this->instructors = []; $this->learningMaterials = []; $this->sessionObjectives = []; $this->courseObjectives = []; $this->competencies = []; $this->cohorts = []; $this->sessionTerms = []; $this->courseTerms = []; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearDataForDraftOrScheduledEvent()\n {\n if (!$this->isPublished || $this->isScheduled) {\n $this->name = 'Scheduled';\n $this->courseTitle = null;\n $this->offering = null;\n $this->ilmSession = null;\n $this->color = null;\n $this->location = null;\n $this->attireRequired = null;\n $this->equipmentRequired = null;\n $this->supplemental = null;\n $this->attendanceRequired = null;\n $this->courseExternalId = null;\n $this->sessionDescription = null;\n $this->sessionTitle = null;\n $this->sessionTypeTitle = null;\n\n $this->instructors = [];\n $this->learningMaterials = [];\n }\n }", "public function cleanOldEntries()\n {\n $this->removeExpiredAccessTokens();\n $this->removeExpiredRefreshTokens();\n $this->removeExpiredResourceAuthCodes();\n }", "public function clean() {\n\t\ttry {\n\t\t\t$objectAPI = $this->calendar->getBackend()->getObjectAPI($this->calendar);\n\n\t\t\t$list = $objectAPI->listAll();\n\t\t} catch(BackendUtils\\Exception $ex) {\n\t\t\treturn;\n\t\t}\n\t\t$cList = $this->cache->listAll();\n\n\t\t$deletedOnRemote = array_diff($cList, $list);\n\n\t\t$this->cache->deleteList($deletedOnRemote);\n\t}", "private function delete_all_cron_events() {\n\t\twp_clear_scheduled_hook( 'wp_stream_auto_purge' );\n\t}", "private function clean_events($data)\n\t{\n\t\t$data['event_name'] = $data['name'];\n\t\t$data['event_id'] = $data['id'];\n\t\t$data['event_created'] = $data['created'];\n\t\t$data['event_status'] = $data['status'];\n\t\t$data['time'] = ($data['time'] / 1000);\n\t\treturn $data;\n\t}", "public function reset()\n {\n $this->values[self::EVENT_STREAM_ID] = null;\n $this->values[self::EVENT_NUMBER] = null;\n $this->values[self::EVENT_ID] = null;\n $this->values[self::EVENT_TYPE] = null;\n $this->values[self::DATA_CONTENT_TYPE] = null;\n $this->values[self::METADATA_CONTENT_TYPE] = null;\n $this->values[self::DATA] = null;\n $this->values[self::METADATA] = null;\n $this->values[self::CREATED] = null;\n $this->values[self::CREATED_EPOCH] = null;\n }", "public function cleanNewData()\n\t{\n\t\t$user = $this->cron_model->deleteData();\n\t}", "public function cleanup()\n {\n $iTimeFrame = oxRegistry::getConfig()->getRequestParameter(\"timeframe\");\n $dNow = time();\n $iTimestamp = mktime(\n date(\"H\", $dNow),\n date(\"i\", $dNow),\n date(\"s\", $dNow),\n date(\"m\", $dNow),\n date(\"d\", $dNow) - $iTimeFrame,\n date(\"Y\", $dNow)\n );\n $sDeleteFrom = date(\"Y-m-d H:i:s\", $iTimestamp);\n\n $oDb = oxDb::getDb();\n $oDb->Execute(\"delete from oxlogs where oxtime < \" . $oDb->quote($sDeleteFrom));\n }", "public function delete_unreserved_events()\n {\n $date = new DateTime();\n $date->add(new DateInterval('PT3H'));\n\n $this->ci->db->where('date_start <', $date->format('Y-m-d H:m:s'));\n $result = $this->ci->db->get('calendar');\n\n foreach ($result->result() as $entry) {\n\n $this->ci->db->where('id', $entry->id);\n if(!$this->ci->db->delete('calendar'))\n log_message('error', 'Delete entry in calendar');\n\n $this->ci->db->where('id', $entry->stream_entry_id);\n if(!$this->ci->db->delete('c_i_events_list'))\n log_message('error', 'Delete entry in c_i_events_list');\n }\n\n // you can load a model or etc here if you like using $this->ci->load();\n return 'The streams_post_insert_entry has ran';\n }", "public function reset()\n {\n $this->values[self::EVENTID] = null;\n $this->values[self::TIMESTAMP] = null;\n $this->values[self::DOCUMENTID] = null;\n $this->values[self::INDEXKEY] = null;\n $this->values[self::DOCUMENT] = null;\n $this->values[self::PREVIOUSEVENTID] = null;\n $this->values[self::PREVIOUSDOCUMENTSTATE] = null;\n }", "public function clear() {\n\t\t$this->calendars = [];\n\t\t$this->calendarLoaders = [];\n\t}", "public function cleanup() {\n $this->basedir = $this->directoryList->getRoot();\n $this->checkCronFolderExistence();\n $this->initialize();\n /* gets a list of all schedule ids in the cron table */\n $scheduleids = $this->resource->cleanSchedule($this->history);\n /* gets a list of all cron schedule output files */\n $fileids = $this->getScheduleOutputIds();\n /* get a list of all schedule output files that are no longer in the cron schedule file */\n $diff = array_diff($fileids,$scheduleids);\n foreach ($diff as $id) {\n /* remove the old cron schedule output files */\n $this->unsetPid('schedule.'.$id);\n }\n }", "public static function action_reset_data() {\n\t\t// Do the same as when we finish then tell use to delete manuallyrather than remove all data\n\t\tself::reset_sitemap_data();\n\t\tMetro_Sitemap::show_action_message( sprintf(\n\t\t\t\t__( '<p>Sitemap data reset. If you want to completely remove the data you must do so manually by deleting all posts with post type <code>%1$s</code>.</p><p>The WP-CLI command to do this is: <code>%2$s</code></p>', 'msm-sitemap' ),\n\t\t\t\tMetro_Sitemap::SITEMAP_CPT,\n\t\t\t\t'wp post delete $(wp post list --post_type=' . Metro_Sitemap::SITEMAP_CPT . ' --format=ids)'\n\t\t) );\n\t}", "public function clean() {\n\t\t$this->pendingFiltersStack = array();\n\t\t$this->executedFiltersStack = array();\n\t}", "public function eraseMessages()\n {\n $this->collectedEvents = [];\n }", "public function deinitialize() {\n\t\tremove_action( 'switch_blog', array( &$this, 'setup_table_names' ), PHP_INT_MAX );\n\t\tremove_filter( 'qsot-upgrader-table-descriptions', array( &$this, 'setup_tables' ) );\n\t\tremove_action( 'init', array( &$this, 'registerpost_type' ), 2 );\n\t\tremove_action( 'init', array( &$this, 'register_assets' ), 1000 );\n\t\tremove_action( 'qsot-register-event-area-type', array( &$this, 'register_event_area_type' ), 1000 );\n\t\tremove_action( 'qsot-deregister-event-area-type', array( &$this, 'deregister_event_area_type' ), 1000 );\n\t\tremove_action( 'add_meta_boxes_qsot-event-area', array( &$this, 'add_meta_boxes' ), 1000 );\n\t\tremove_action( 'qsot-admin-load-assets-qsot-event-area', array( &$this, 'enqueue_admin_assets_event_area' ), 10 );\n\t\tremove_action( 'qsot-admin-load-assets-qsot-event', array( &$this, 'enqueue_admin_assets_event' ), 10 );\n\t\tremove_filter( 'qsot-event-area-for-event', array( &$this, 'get_event_area_for_event' ), 10 );\n\t\tremove_filter( 'qsot-event-area-type-for-event', array( &$this, 'get_event_area_type_for_event' ), 10 );\n\t\tremove_filter( 'qsot-get-event-area', array( &$this, 'get_event_area' ), 10 );\n\t\tremove_filter( 'woocommerce_get_cart_item_from_session', array( &$this, 'load_item_data' ), 20 );\n\t\tremove_action( 'woocommerce_add_order_item_meta', array( &$this, 'add_item_meta' ), 10 );\n\t\tremove_action( 'woocommerce_ajax_add_order_item_meta', array( &$this, 'add_item_meta' ), 10 );\n\t\tremove_filter( 'woocommerce_hidden_order_itemmeta', array( &$this, 'hide_item_meta' ), 10 );\n\t\tremove_action( 'woocommerce_before_view_order_itemmeta', array( &$this, 'before_view_item_meta' ), 10 );\n\t\tremove_action( 'woocommerce_before_edit_order_itemmeta', array( &$this, 'before_edit_item_meta' ), 10 );\n\t\tremove_action( 'wp_loaded', array( &$this, 'sync_cart_tickets' ), 6 );\n\t\tremove_action( 'woocommerce_cart_loaded_from_session', array( &$this, 'sync_cart_tickets' ), 6 );\n\t\tremove_action( 'qsot-sync-cart', array( &$this, 'sync_cart_tickets' ), 10 );\n\t\tremove_action( 'qsot-clear-zone-locks', array( &$this, 'clear_zone_locks' ), 10 );\n\t\tremove_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed' ), 100 );\n\t\tremove_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed_pending' ), 101 );\n\t\tremove_action( 'woocommerce_order_status_changed', array( &$this, 'order_status_changed_cancel' ), 102 );\n\t\tremove_filter( 'woocommerce_order_again_cart_item_data', array( &$this, 'adjust_order_again_items' ), 10 );\n\t\tremove_filter( 'woocommerce_add_to_cart_validation', array( &$this, 'sniff_order_again_and_readd_to_cart' ), 10 );\n\t\tremove_action( 'qsot-events-bulk-edit-settings', array( &$this, 'event_area_bulk_edit_settings' ), 30 );\n\t\tremove_filter( 'qsot-events-save-sub-event-settings', array( &$this, 'save_sub_event_settings' ), 10 );\n\t\tremove_filter( 'qsot-load-child-event-settings', array( &$this, 'load_child_event_settings' ), 10 );\n\t\tremove_action( 'woocommerce_before_delete_order_item', array( &$this, 'woocommerce_before_delete_order_item' ), 10 );\n\t\tif ( is_admin() ) {\n\t\t\tremove_action( 'qsot-admin-load-assets-shop_order', array( &$this, 'load_assets_edit_order' ), 10 );\n\t\t\tremove_filter( 'qsot-ticket-selection-templates', array( &$this, 'admin_ticket_selection_templates' ), 10 );\n\t\t\tremove_action( 'woocommerce_order_item_add_line_buttons', array( &$this, 'add_tickets_button' ), 10 );\n\t\t}\n\t}", "function nuclear() {\n\t\t\n\t\tforeach ( $this->all_pages as $thispage ){\n\t\t\tupdate_post_meta( $thispage->ID , 'idies_update_status' , $this->default_status ) ;\n\t\t\tupdate_post_meta( $thispage->ID , 'idies_update_reviewer' , $this->default_reviewer ) ;\n\t\t\tupdate_post_meta( $thispage->ID , 'idies_update_comment' , '' ) ;\n\t\t}\n\t\n\t}", "public function __destruct()\n {\n for ($i = 0; $i < $this->eventCount; $i++) {\n unset($this->events[$i]);\n unset($this->interested[$i]);\n }\n unset($this->eventCount);\n unset($this->events);\n unset($this->interested);\n unset($this->started);\n unset($this->type);\n }", "public function clear_notifications() {\n $this->delete_old_records();\n }", "public function reset()\n {\n $this->values[self::SUBSCRIPTION_ID] = null;\n $this->values[self::EVENT_STREAM_ID] = null;\n $this->values[self::ALLOWED_IN_FLIGHT_MESSAGES] = null;\n }", "public function clear() {\r\n $this->business_data = array(\r\n \"task_group_id\" => 0,\r\n \"task_group_name\" => \"\",\r\n \"task_group_description\" => \"\",\r\n \"task_group_project_id\" => 0,\r\n \"task_group_status\" => \"\",\r\n \"task_group_creation_date\" => 0,\r\n \"task_group_estimated_days\" => 0,\r\n \"task_group_end_date\" => 0,\r\n \r\n );\r\n }", "public function purge()\n {\n $this->absentTypes->each->delete();\n\n $this->publicHolidays->each->delete();\n\n $this->owner()->where('current_location_id', $this->id)\n ->update(['current_location_id' => null]);\n\n $this->users()->where('current_location_id', $this->id)\n ->update(['current_location_id' => null]);\n\n $this->users()->detach();\n\n $this->delete();\n }", "public function clearBookingDayDetails()\n {\n $this->collBookingDayDetails = null; // important to set this to NULL since that means it is uninitialized\n }", "function purgeUnsavedChangeSets() {\t\n\n\t$sets_to_purge = sqlSelect(\"*\", CHANGE_SETS_TABLE, \"scheduler_run_id = \" . scheduler_run()['id'] . \" and when_saved is null\", \"\", (0), \"purgeUnsavedChangeSets()\");\n\tforeach ($sets_to_purge as $i=>$set_to_purge) {\n\t\tsqlDelete(CHANGES_TABLE, \"change_set_id = {$set_to_purge['id']}\", (0), \"purgeUnsavedChangeSets(): deleting changes in change set\");\n\t\tsqlDelete(CHANGE_SETS_TABLE, \"id = {$set_to_purge['id']}\", (0), \"purgeUnsavedChangeSets(): deleting change set\");\n\t}\n}", "public function reset(){\n Attendance::truncate();\n AttendanceSummary::truncate();\n Client::truncate();\n Holiday::truncate();\n return \"Successfully Deleted\";\n }", "static function clear_cron_events() {\r\n wp_clear_scheduled_hook('aiowps_hourly_cron_event');\r\n wp_clear_scheduled_hook('aiowps_daily_cron_event');\r\n }", "public function _cleanup()\n\t{\n\t\t$where = array();\n\t\t$where['created <'] = now() - 30*24*60*60;\n\t\t\n\t\t$this->del_rule($where);\n\t}", "protected function clearData()\n\t{\n\t\t$this->clearProcessedArray();\n\t\t$this->clearErrors();\n\t\t$this->replace_array = null;\n\t}", "public function purgeData()\n {\n $maxIdVisit = $this->getDeleteIdVisitOffset();\n\n // break if no ID was found (nothing to delete for given period)\n if (empty($maxIdVisit)) {\n return;\n }\n\n $logTables = self::getDeleteTableLogTables();\n\n // delete data from log tables\n $where = \"WHERE idvisit <= ?\";\n foreach ($logTables as $logTable) {\n // deleting from log_action must be handled differently, so we do it later\n if ($logTable != Common::prefixTable('log_action')) {\n Db::deleteAllRows($logTable, $where, \"idvisit ASC\", $this->maxRowsToDeletePerQuery, array($maxIdVisit));\n }\n }\n\n // delete unused actions from the log_action table (but only if we can lock tables)\n if (Db::isLockPrivilegeGranted()) {\n $this->purgeUnusedLogActions();\n } else {\n $logMessage = get_class($this) . \": LOCK TABLES privilege not granted; skipping unused actions purge\";\n Log::warning($logMessage);\n }\n\n // optimize table overhead after deletion\n Db::optimizeTables($logTables);\n }", "public function cleanup(): void\n {\n $expired = $this->instances()->all()->filterBy('hasExpired', '==', true);\n\n foreach ($expired as $instance) {\n $instance->delete();\n }\n\n $this->runHook($this->config()->templateRoot(), 'cleanup', $this);\n }" ]
[ "0.7917741", "0.6504101", "0.6452411", "0.63611346", "0.634203", "0.6339934", "0.6199264", "0.60241014", "0.6019135", "0.59959334", "0.5936114", "0.5932478", "0.5914179", "0.5906753", "0.58983624", "0.5881127", "0.58630466", "0.5827667", "0.5807495", "0.5794526", "0.57798475", "0.57786506", "0.57732314", "0.5769386", "0.57537466", "0.57483935", "0.5739826", "0.5735327", "0.5733023", "0.5726515" ]
0.793543
0
Removes any materials that are in draft mode.
protected function removeMaterialsInDraft() { $this->learningMaterials = array_values( array_filter( $this->learningMaterials, fn(UserMaterial $lm) => $lm->status !== LearningMaterialStatusInterface::IN_DRAFT ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeMaterialsInDraft()\n {\n $this->learningMaterials = array_values(array_filter($this->learningMaterials, function (UserMaterial $lm) {\n return $lm->status !== LearningMaterialStatusInterface::IN_DRAFT;\n }));\n }", "public function draft_discard()\n\t{\n\t\t$where = array(\n\t\t\t'entry_id' => $this->settings['entry_id'],\n\t\t\t'field_id' => $this->settings['field_id'],\n\t\t\t'is_draft' => 1\n\t\t);\n\n\t\t$this->EE->db->where($where)->delete('assets_selections');\n\t}", "public function discard_element_draft($data)\n\t{\n\n\t\t$where = array(\n\t\t\t'element_id' => $this->element_id,\n\t\t\t'is_draft' => 1\n\t\t);\n\n\t\t$this->EE->db->where($where)->delete('assets_selections');\n\t}", "function flushMaterials() \n\t{\n $this->materials = array();\n }", "function purge_material( $id ) {\r\n\t\t$data = array(\r\n\t\t\t'is_deleted' => TRUE\r\n\t\t);\r\n\t\t\r\n\t\t$this->db->where('im_id', $id);\r\n\t\t$query = $this->db->update('incoming_materials', $data);\r\n\t}", "public function undraft()\n {\n $this->unsetDraftedFlag()->save();\n\n // :TODO: Fire an event here\n }", "public function discardDrafts($publishScope)\r\n\t{\r\n\t\t$mozuClient = PublishingScopeClient::discardDraftsClient($this->dataViewMode, $publishScope);\r\n\t\t$mozuClient = $mozuClient->withContext($this->apiContext);\r\n\t\t$mozuClient->execute();\r\n\r\n\t}", "public function draft_publish()\n\t{\n\t\t$where = array(\n\t\t\t'entry_id' => $this->settings['entry_id'],\n\t\t\t'field_id' => $this->settings['field_id'],\n\t\t\t'is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('assets_selections');\n\n\t\t$where['is_draft'] = 1;\n\t\t$update = array('is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('assets_selections', $update);\n\n\t\treturn;\n\t}", "function deleteMaterial($materials_name = \"\") \n\t{\n\t\tforeach ($this->materials as $key => $value) \n\t\t{\n\t\t\tif (strcmp($key, $materials_name)==0) \n\t\t\t{\n\t\t\t\tif (file_exists($this->getMaterialsPath().$value)) \n\t\t\t\t{\n\t\t\t\t\tunlink($this->getMaterialsPath().$value);\n\t\t\t\t}\n\t\t\t\tunset($this->materials[$key]);\n\t\t\t}\n\t\t}\n }", "function ubermenu_sandbox_remove_all_styles() {\n global $wp_styles;\n //uberp($wp_styles->queue);\n foreach( $wp_styles->queue as $i => $sheet ){\n if( strpos( $sheet , 'ubermenu' ) !== 0 ){\n unset( $wp_styles->queue[$i] );\n }\n }\n //uberp($wp_styles->queue);\n //$wp_styles->queue = array();\n\n}", "function deleteMaterial($material){\n //no implementado por no requerimiento del proyecto\n }", "public function renderDrafts() {\n\t\t$this->template->drafts = $this->articles->findAllDrafts();\n\t}", "public function discard()\n {\n if ($this->isNew()) {\n $app = Facade::getFacadeApplication();\n $db = $app->make('database')->connection();\n // check for related version edits. This only gets applied when we edit global areas.\n $r = $db->executeQuery('select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(\n $this->cID,\n $this->cvID,\n ));\n while ($row = $r->fetch()) {\n $cn = Page::getByID($row['cRelationID'], $row['cvRelationID']);\n $cnp = new Permissions($cn);\n if ($cnp->canApprovePageVersions()) {\n $v = $cn->getVersionObject();\n $v->delete();\n $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ? and cRelationID = ? and cvRelationID = ?', array(\n $this->cID,\n $this->cvID,\n $row['cRelationID'],\n $row['cvRelationID'],\n ));\n }\n }\n $this->delete();\n }\n $this->refreshCache();\n }", "public function clean()\n\t{\n\t\tif ($this['item'])\n\t\t{\n\t\t\tif (!$this['original']->is_empty())\n\t\t\t{\n\t\t\t//\tGet all the other items in the workflow for this original\n\t\t\t\t$copies = i('workflow', array(\n\t\t\t\t\t'original' => $this['original']->get(),\n\t\t\t\t));\n\t\t\t//\tDelete them\n\t\t\t\tforeach ($copies as $copy) $copy->delete();\n\t\t\t}\n\t\t}\n\t}", "public function getTable_pmDrafts()\n {\n return DB_TABLE_PREFIX.'t_pm_drafts';\n }", "public function clear_all_messages() {\n\t\t$posts = get_posts(['post_type' => 'dev_mail']);\n\n\t\tforeach ($posts as $post_id) {\n\t\t\twp_delete_post($post_id, true);\n\t\t}\n\n\t\t$this->add_notice('success', 'Cleared all dev messages');\n\t}", "function drafts(){\n\nglobal $user, $conn, $dbtables, $logged_in, $globals, $l, $AEF_SESS, $theme;\nglobal $drafts, $foldercount, $tree;\n\t\n\t//Check whether the PM system is allowed\n\tcheckpmon();\t\n\t\n\t//Count the Number of PM's in a Folder\n\tcountpm();\n\t\n\t\n\t/////////////////////////////\n\t// Define the necessary VARS\n\t/////////////////////////////\n\t\n\t$pmids = array();//The Fianl PM ID's Array\n\t\n\t$pmidarray = array();\n\t\n\t$drafts = array();//The array holding the Drafts\n\t\n\t$tree[] = array('l' => $globals['index_url'].'act=usercp&ucpact=inbox',\n\t\t\t\t\t'txt' => $l['pm_messages']);\n\t\n\t$tree[] = array('l' => $globals['index_url'].'act=usercp&ucpact=drafts',\n\t\t\t\t\t'txt' => $l['pm_drafts']);\n\t\n\t//If the user has asked to delete some PM's\n\tif(isset($_POST['deleteseldrafts'])){\n\t\t\n\t\t//The User might have not selected any PM's\n\t\tif(empty($_POST['list'])){\n\t\t\n\t\t\t//Redirect\n\t\t\tredirect('act=usercp&ucpact=drafts');\n\t\t\n\t\t}\n\t\t\n\t\t$pmidarray = $_POST['list'];\n\t\t\n\t\tforeach($pmidarray as $pmk => $pmv){\n\t\t\t\n\t\t\t//It must be Numeric\n\t\t\tif(is_numeric($pmv)){\n\t\t\t\n\t\t\t\t$pmids[] = $pmv;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t//Finally call the Function to Delete the PM's\n\t\tdeletepm($pmids, 2);\n\t\t\n\t\n\t}\n\t\n\t\n\t//Check the PM Page\n\t$page = get_page('pmfpg', $globals['pmnumshowinfolders']);\n\t\n\t//Get the PM in the drafts of this user.\n\t$qresult = makequery(\"SELECT pm.*\n\t\t\tFROM \".$dbtables['pm'].\" pm \n\t\t\tWHERE pm.pm_from = '\".$user['id'].\"'\n\t\t\tAND pm_folder = '2'\n\t\t\tORDER BY pm.pmid DESC\n\t\t\tLIMIT $page, \".$globals['pmnumshowinfolders']);\n\t\n\tif(mysql_num_rows($qresult) < 1){\n\t\t\n\t\t//If it is not the first page - then you specified an invalid link\n\t\tif($page > 0){\n\t\n\t\t\t//Show a major error and return\n\t\t\treporterror($l['pm_no page found'] ,$l['pm_no_page_found_exp2']);\n\t\t\t\t\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\n\t}else{\t\n\t\n\t\tfor($i = 1; $i <= mysql_num_rows($qresult); $i++){\n\t\t\n\t\t\t$drafts[$i] = mysql_fetch_assoc($qresult);\n\t\t\n\t\t\t$rec = explode('||||', $drafts[$i]['pm_to_text']);\n\t\t\t\n\t\t\t//The Usernames of the recivers\n\t\t\t$drafts[$i]['rec_usernames'] = explode(\";\", $rec[0]);\n\t\t\t\n\t\t\t//The ID's of the recivers\n\t\t\t$drafts[$i]['rec_id'] = explode(\";\", $rec[1]);\n\t\t\n\t\t}\n\t\t\n\t}\n\t\n}", "protected function destroy()\n {\n header('Content-Type: application/json');\n\n $cp = new Permissions($this->walk->getPage());\n if ($cp->canEditPageContents()) {\n $this->c->setAttribute('exclude_page_list', true);\n\n // TODO: Update the MirrorWalk to unpublish\n echo json_encode([\n 'id' => $this->walk->getPage()->getCollectionID(),\n 'message' => 'Walk set to draft.',\n 'error' => false,\n ]);\n } else {\n echo json_encode([\n 'error' => true,\n 'message' => 'Insufficient permissions.',\n ]);\n }\n exit;\n }", "function vibrant_life_remove_contact_metaboxes() {\n \n if ( vibrant_life_is_editing_contact() ) {\n \n }\n \n}", "function delMmaterials($id)\n\t{\n\t\t//delete from product\n\t\t$delete1 = \"DELETE FROM mmaterials WHERE id='$id'\";\n\t\t\n\t\t//execute quary\n\t\t$query1\t= mysql_query($delete1);\n\t\t\n\t}", "public function unlinkDisownedObjects()\n {\n $object = $this->getObjectInStage(Versioned::DRAFT);\n if ($object) {\n $object->unlinkDisownedObjects($object, Versioned::LIVE);\n }\n }", "static function draft_cleanup($contextid, $itemid) {\n return quickmail::cleanup('block_quickmail_drafts', $contextid, $itemid);\n }", "public static function withDrafts()\n {\n return with(new static)->newQueryWithoutScope(new PublishedScope);\n }", "function reset_global_settings(){\n\n\t$settings = pl_get_global_settings();\n\n\t$set['draft'] = array();\n\t\n\tpl_update_global_settings( $set );\n\t\n\tset_default_settings();\n\n\tglobal $dms_cache;\n\t$dms_cache->purge('draft');\n\t\n\treturn $set;\n}", "public function unpublish()\n {\n if($this->userHasPrivilege('publish'))\n {\n $this['status'] = 'draft';\n $this->save();\n }\n }", "public function isDraft()\n {\n return isset($this->frontMatter['draft']) && $this->frontMatter['draft'] === true;\n }", "function cfcpt_clear_meta_boxes() {\n\t\tglobal $wp_meta_boxes;\t\t\n\t\t$allowed_boxes = apply_filters('cfcpt_allowed_meta_boxes',array(\n\t\t\t'submitdiv',\n\t\t\t'tagsdiv',\n\t\t\t'postexcerpt',\n\t\t\t'revisionsdiv'\n\t\t));\n\n\t\tforeach($wp_meta_boxes['post-welcome'] as $group_id => $group) {\n\t\t\tforeach($group as $priority_id => $priority) {\t\t\t\t\n\t\t\t\tforeach($priority as $id => $box) {\n\t\t\t\t\tif(!in_array($id, $allowed_boxes)) {\n\t\t\t\t\t\tunset($wp_meta_boxes['post-welcome'][$group_id][$priority_id][$id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach($wp_meta_boxes['post-learn-more'] as $group_id => $group) {\n\t\t\tforeach($group as $priority_id => $priority) {\t\t\t\t\n\t\t\t\tforeach($priority as $id => $box) {\n\t\t\t\t\tif(!in_array($id, $allowed_boxes)) {\n\t\t\t\t\t\tunset($wp_meta_boxes['post-learn-more'][$group_id][$priority_id][$id]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function publish_element_draft($data)\n\t{\n\n\t\t$where = array(\n\t\t\t'element_id' => $this->element_id,\n\t\t\t'is_draft' => 0\n\t\t);\n\t\t$this->EE->db->where($where)->delete('assets_selections');\n\n\t\t$where['is_draft'] = 1;\n\t\t$update = array('is_draft' => 0);\n\t\t$this->EE->db->where($where)->update('assets_selections', $update);\n\n\t\treturn;\n\t}", "public function destroy(Material $material)\n {\n //\n $material->delete();\n }", "function remove_content_editor(){\n remove_post_type_support('page', 'editor');\n remove_post_type_support('post', 'editor');\n}" ]
[ "0.8163804", "0.67929965", "0.6058878", "0.6049612", "0.56711876", "0.56708807", "0.55083466", "0.5504107", "0.5489362", "0.53843737", "0.53318375", "0.5211613", "0.52074844", "0.5205234", "0.51685834", "0.5156896", "0.5134008", "0.51325375", "0.51185244", "0.51062673", "0.509233", "0.5047225", "0.5031772", "0.50233966", "0.50100756", "0.49858356", "0.49663445", "0.49563032", "0.49439228", "0.49332243" ]
0.81364435
1
Singleton method for returning a cookie object
public static function Cookie() { if (!self::$Cookie) { self::$Cookie = new Request\Cookie; } return self::$Cookie; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function & instance() {\n static $instance;\n if(!instance_of($instance, 'Cookies')) {\n $instance = new Cookies();\n } // if\n return $instance;\n }", "public static function createInstance()\n {\n return new WebClientCookie('','');\n }", "public static function getInstance($expires=null, $path=null, $domain=null, $secure=null, $httponly=null)\r\n\t{\r\n\t\tif ( !isset(self::$instance))\r\n\t\t{\r\n\t\t\tself::$instance = new Cookie($expires, $path, $domain, $secure, $httponly);\r\n\t\t}\r\n\t\t\t\r\n\t\treturn self::$instance;\r\n\t}", "public static function createInstance()\n {\n return new WebClientCookieContainer();\n }", "public function create()\n\t{\n\t\treturn setcookie(\n\t\t\t$this->name,\n\t\t\t$this->value,\n\t\t\t$this->expire,\n\t\t\t$this->path,\n\t\t\t$this->domain,\n\t\t\t$this->secure,\n\t\t\t$this->httpOnly\n\t\t);\n\t}", "public function get($name)\n\t{\n\t\tif (isset($this->_cookies[$name])) {\n\t\t\treturn $this->_cookies[$name];\n\t\t}\n\t\t/**\n\t\t * Create the cookie if the it does not exist\n\t\t */\n\t\t$cookie = new \\Leaps\\Web\\Cookie($name);\n\t\t$dependencyInjector = $this->_dependencyInjector;\n\n\t\tif (is_object($dependencyInjector)){\n\n\t\t\t/**\n\t\t\t * Pass the DI to created cookies\n\t\t\t */\n\t\t\t$cookie->setDi($dependencyInjector);\n\n\t\t\t$encryption = $this->_useEncryption;\n\n\t\t\t/**\n\t\t\t * Enable encryption in the cookie\n\t\t\t */\n\t\t\tif ($encryption) {\n\t\t\t\t$cookie->useEncryption($encryption);\n\t\t\t}\n\t\t}\n\t\t$this->_cookies[$name] = $cookie;\n\t\treturn $cookie;\n\t}", "public function cookies();", "function getCookie(){\n return $this->get('Cookie','');\n }", "public static function makeExpired() : Cookie\n {\n return new Cookie(self::COOKIE_NAME, null);\n }", "private function createCookieJar()\r\n {\r\n return $this->cookieJar = tempnam(\"stif\", \"CURLCOOKIE\");\r\n }", "public function get(string $name): CookieInterface\n {\n }", "function cookie($name = null, $value = null, $minutes = 0, $path = null, $domain = null, $secure = null, $httpOnly = true, $raw = false, $sameSite = null)\n {\n $cookie = app(CookieFactory::class);\n\n if (is_null($name)) {\n return $cookie;\n }\n\n return $cookie->make($name, $value, $minutes, $path, $domain, $secure, $httpOnly, $raw, $sameSite);\n }", "protected function createCookieDriver()\n {\n return $this->buildSession(new CookieSessionHandler(\n $this->container->make('cookie'), $this->config->get('session.lifetime')\n ));\n }", "public static function restore($name)\n\t{\n\t\t$cookieObj = null;\n\n\t\tif(self::exists($name))\n\t\t{\n\t\t\t$cookieObj = new self;\n\t\t\t$cookieObj->name = $name;\n\t\t\t$value = base64_decode($_COOKIE[$name]);\n\t\t\t$cookieId = $cookieObj->id;\n\n\t\t\tif(Text::find(':|:', $value))\n\t\t\t{\n\t\t\t\t$value = Text::split(':|:', $value);\n\t\t\t\t$cookieId = $value[0];\n\t\t\t\t$value = $value[1];\n\t\t\t}\n\n\t\t\t$cookiePath = (Application::getCurrent() ? Application::getCurrent()->getPath('temp') : Enviroment::getPath('temp')) . \"{$cookieId}.cookie\";\n\t\t\t$params = File::exists($cookiePath) ? Text::split(':|:', File::open($cookiePath)->read()) : array();\n\n\t\t\tif(!empty($params[0]))\n\t\t\t{\n\t\t\t\t$cookieObj->id = $cookieId;\n\n\t\t\t\tswitch($params[0])\n\t\t\t\t{\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\t$cookieObj->value = $value == '1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'object':\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t$cookieObj->value = unserialize($value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$cookieObj->value = $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$cookieObj->expires = (int)$params[1];\n\t\t\t\t$cookieObj->path = $params[2];\n\t\t\t\t$cookieObj->domain = $params[3];\n\t\t\t\t$cookieObj->secure = (int)$params[4] === 1;\n\t\t\t\t$cookieObj->onlyHttp = (int)$params[5] === 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$cookieObj->value = $value;\n\t\t\t\t$cookieObj->expires = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $cookieObj;\n\t}", "protected function createCookieDriver()\n {\n $lifetime = $this->app['config']['session.lifetime'];\n return $this->buildSession(new CookieSessionHandler($this->app['cookie'], $lifetime));\n }", "public function cookie($key = '', $value = '')\n\t{\n\t\tif ($value !== '') $_COOKIE[$key] = $value;\n\t\tif ($key) return @$_COOKIE[$key];\n\t\treturn $_COOKIE;\n\t}", "public function getCookie($name);", "public function getCookie($cookieName);", "public function getCookie($cookieName);", "public function withRealValue($value): CookieInterface;", "public function getCookie($key);", "protected function getCookie(){\n if( Cookie::has($this->getCookieName()) ){\n return Cookie::get($this->getCookieName())->value;\n }\n return null;\n }", "public function getCookie(ServerRequestInterface $request, string $cookieName) : Cookie;", "protected function getTest_Client_CookiejarService()\n {\n return new \\Symfony\\Component\\BrowserKit\\CookieJar();\n }", "public function __construct(Cookie $cookie)\r\n {\r\n $this->cookie = $cookie->first();\r\n }", "public function testGetCookieAsObject()\n {\n $cookie = Zend_Http_Cookie::fromString('foo=bar; domain=www.example.com; path=/tests');\n $jar = new Zend_Http_CookieJar();\n $jar->addCookie($cookie->__toString(), 'http://www.example.com/tests/');\n\n $cobj = $jar->getCookie('http://www.example.com/tests/', 'foo');\n\n $this->assertTrue($cobj instanceof Zend_Http_Cookie, '$cobj is not a Cookie object');\n $this->assertEquals($cookie->getName(), $cobj->getName(), 'Cookie name is not as expected');\n $this->assertEquals($cookie->getValue(), $cobj->getValue(), 'Cookie value is not as expected');\n $this->assertEquals($cookie->getDomain(), $cobj->getDomain(), 'Cookie domain is not as expected');\n $this->assertEquals($cookie->getPath(), $cobj->getPath(), 'Cookie path is not as expected');\n }", "public function getCookie($key = null);", "protected function makeCookie(array $data = []): Cookie\n {\n return new SetCookie($data);\n }", "public function getCookieJar(): CookieJarInterface|null;", "public function retrieve($uuid, $session_id, $hmac_hash, $expiration)\n {\n $cookie = new Cookie();\n $cookie->set_uuid($uuid);\n $cookie->set_session_id($session_id);\n $cookie->set_hmac_hash($hmac_hash);\n $cookie->expiration = $expiration;\n return $cookie;\n }" ]
[ "0.7556003", "0.74551815", "0.736639", "0.73602384", "0.72879994", "0.7008806", "0.7005283", "0.69735503", "0.6880573", "0.67580855", "0.66918135", "0.6691467", "0.66300386", "0.6594026", "0.6572367", "0.65171134", "0.6485493", "0.6482338", "0.6482338", "0.6478201", "0.64764524", "0.64211154", "0.6405295", "0.63973516", "0.63884926", "0.6374607", "0.63735163", "0.6371049", "0.6351568", "0.6343805" ]
0.7716594
0
Singleton method for returning a Header object
public static function Header() { if (!self::$Header) { self::$Header = new Request\Header; } return self::$Header; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createHeader(): Header\n {\n return new Header([\n 'batchCustomerId' => '85765',\n 'customerShortName' => 'CustomerShortName',\n 'processingDate' => '20171104',\n ]);\n }", "public function createheader()\n {\n //\n }", "public static function header() {\n\t\treturn static::instance()->header();\n\t}", "protected function _header() { return; }", "function civil_header( array $settings = [], array $data = [], array $fm_fields = [] ) : Civil_Header {\n\treturn new Civil_Header( $settings, $data );\n}", "abstract public function getHeader();", "public function buildHeader();", "public function getHeader()\n {\n }", "private function getHeader()\r\n {\r\n return $this->header;\r\n }", "public function createHeader()\n {\n $num = array_push($this->headers, new Parameter());\n\n return $this->headers[$num - 1];\n }", "public function &header() {\n\t\treturn $this->responseHeader;\n\t}", "public function getHeader();", "function __construct($header_info) {\n if (isset($header_info) && !empty($header_info)) {\n if (array_key_exists('name', $header_info)) {\n $this->setName($header_info['name']);\n }\n if (array_key_exists('email', $header_info)) {\n $this->setEmail($header_info['email']);\n }\n if (array_key_exists('phone_number', $header_info)) {\n $this->setPhoneNumber($header_info['phone_number']);\n }\n if (array_key_exists('address', $header_info)) {\n $this->setAddress($header_info['address']);\n }\n if (array_key_exists('personal_website', $header_info)) {\n $this->setPersonalWebsite($header_info['personal_website']);\n }\n }\n return $this->getHeaderInformation();\n }", "function Header()\n {\n }", "function getHeader($header);", "public function getHeader()\n {\n return $this->_header;\n }", "public function getHeader()\r\n {\r\n return $this->header;\r\n }", "function Header() {\n }", "function &addHeader($type = 'all') {\r\n\t \tif (empty($this->oddEvenDifferent) && $type == 'all') {\r\n\t\t $header = new Header($this, $type);\r\n\t\t} else if (!empty($this->oddEvenDifferent) \r\n\t\t\t&& ($type == 'left' || $type == 'right')) \r\n\t\t{\t\t \r\n\t\t \t$header = new Header($this, $type);\t\r\n\t\t} else if ($type == 'first') {\r\n\t\t \t$header = new Header($this, $type);\t\r\n\t\t \t$this->titlepg = 1;\r\n\t\t} else {\t\r\n\t\t \techo 'Error: headers';\r\n\t\t \treturn;\r\n\t\t}\t\t \r\n\t\r\n\t\t$this->headers[$type] = &$header;\r\n\t\treturn $header;\t\t\r\n\t}", "public static function headers();", "protected function getHeader()\r\n {\r\n $result = parent::getHeader();\r\n return $result;\r\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function header() {}", "public function getHeader()\n {\n return $this->_header;\n }", "public function writeHeader()\n {\n if (!empty($this->header)) {\n $this->file->write($this->header);\n }\n return $this;\n }", "abstract public function getHeaderInfo();", "public function getHeader() {\n\t\treturn $this->header;\n\t}", "public function header($header) {\n\t\t$this->option('-H', $header);\n\t\treturn $this;\n\t}" ]
[ "0.70866984", "0.69709885", "0.6936017", "0.6911841", "0.6755355", "0.67399347", "0.6716351", "0.67094606", "0.6708207", "0.6686054", "0.658451", "0.65828496", "0.6571673", "0.65589434", "0.6555596", "0.6499304", "0.6464409", "0.64610666", "0.6419556", "0.64193034", "0.63523906", "0.6334188", "0.6334188", "0.6334188", "0.6330605", "0.6303898", "0.62895745", "0.62706447", "0.62485754", "0.62342775" ]
0.77810633
0
Singleton method for returning a Post object
public static function Post() { if (!self::$Post) { self::$Post = new Request\Post; } return self::$Post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instance(){\n static $inst = null;\n if ($inst === null) {\n $inst = new Posts();\n }\n\n return $inst;\n }", "public static function newEmptyPost()\n {\n return new Post();\n }", "function post()\r\n {\r\n return Cache::variable($this->post, function()\r\n {\r\n return Posts::get($this->postId);\r\n });\r\n }", "public static function newPostFromInput()\n {\n $post = new Post();\n\n $post->title = Pal::get($_POST, 'title');\n $post->name = Pal::get($_POST, 'name');\n $post->parent = Pal::get($_POST, 'id');\n\n if (strtolower(Pal::get($_POST, 'secrecy')) === 'yes')\n $post->key = bin2hex(openssl_random_pseudo_bytes(20));\n\n $post->enabled = true;\n $post->code = Pal::get($_POST, 'code');\n\n $post->normalize();\n return $post;\n }", "function getPostById($pid)\r\n\t{\r\n\t\treturn new AntApi_BlogPost($this->server, $this->username, $this->password, $this->fid, $pid);\r\n\t}", "public function getPost()\n\t{\n\t\treturn App::make('Asmoyo\\Core\\Post\\PostInterface');\n\t}", "public function addPost()\n {\n $handlerAddPost = new HandlerPost();\n return $handlerAddPost->handlerAddPost();\n }", "function getPost($id)\n\t{\n\t\t$post = $this->postfactory->create()->load($id);\n\t\treturn $post;\n\t}", "public function post() {\n \n if ($this->getId() == null) {\n Model::getInstance()->addPost($this);\n } else {\n Model::getInstance()->updatePost($this);\n }\n \n return $this;\n }", "public static function get( $id ) {\r\n\t\treturn new CN_Post( $id );\r\n\t}", "public static function globalPost()\n {\n global $post;\n\n return $post;\n }", "public function getPost()\n {\n return $this->get('post');\n }", "public function create($post)\n {\n\n }", "public function submit(): Post;", "public function getInstance()\n {\n if($this->instance) {\n return $this->instance;\n }\n\n $this->instance = $this->create();\n return $this->instance;\n }", "function createPost();", "public function create() {\n return @wp_insert_post( self::$post_data );\n }", "public static function post() {\n\t\treturn static::instance()->getPost();\n\t}", "public static function instance($courseid) {\n static $posts;\n\n if (isset($posts)) {\n return $posts;\n }\n\n $posts = new posts($courseid);\n return $posts;\n }", "public function create()\n\t{\n\t\t//Validate id (must be integer >= 0)\n\t\tif($this->get('id') < 0)\n\t\t{\n\t\t\t//Throw exception\n\t\t}\n\t\t//Validate title (must be <= 160 chars)\n\t\tif(strlen($this->get('title')) > 160)\n\t\t{\n\t\t\t//Throw exception\n\t\t}\n\t\t//Validate content (must be <= 1000 chars)\n\t\tif(strlen($this->get('content')) > 1000)\n\t\t{\n\t\t\t//Throw exception\n\t\t}\n\t\t//Validate date_time (must be MySQL default datetime format)\n\t\tif(!is_int($this->get('date_time')))\n\t\t{\n\t\t\tif($this->get('date_time') != date('Y-m-d H:i:s', strtotime($this->get('date_time'))))\n\t\t\t{\n\t\t\t\t//Throw exception\n\t\t\t}\n\t\t}else{\n\t\t\tif($this->get('date_time') != date('Y-m-d H:i:s', $this->get('date_time')))\n\t\t\t{\n\t\t\t\t//Throw exception\n\t\t\t}\n\t\t}\n\t\t//Validate author_id (must be integer >= 0)\n\t\tif($this->get('author_id') < 0)\n\t\t{\n\t\t\t//Throw exception\n\t\t}\n\t\t\n\t\t$this->data['id'] = DB::insert('posts', array_keys($this->data))->values($this->data)->execute($this->_db);\n\t\t\n\t\treturn $this;\n\t}", "public function getPost() {\n return $this->post;\n }", "private function _date_instance() {\n\t\tif ( ! $this->_date ) {\n\t\t\t$this->_date = new PWCCRM_PostDate( $this->_post );\n\t\t}\n\t\treturn $this->_date;\n\t}", "protected function getPostFactory() {\n\t\tif(!$this->postFactory) {\n\t\t\t$this->postFactory = t3lib_div::getUserObj('EXT:mm_forum/pi1/class.tx_mmforum_postfactory.php:tx_mmforum_postfactory');\n\t\t\t$this->postFactory->init(array('storagePID' => $this->setup['plugin.']['tx_mmforum.']['storagePID']));\n\t\t} return $this->postFactory;\n\t}", "public function setupPostData() {\n\t\tsetup_postdata($GLOBALS[\"post\"] = (object) (array) $this); // Create standard object from Post\n\n\t\treturn $this;\n\t}", "public function getInstance()\n\t{\n\t\tif (is_null($this->instance)) {\n\t\t\treturn $this->instance = $this->make();\n\t\t} else {\n\t\t\treturn $this->instance;\n\t\t}\n\t}", "function &singleton ()\n {\n\t\tstatic $instance;\n\n if (! isset($instance)) {\n $instance = new Request;\n }\n\n return $instance;\n }", "function getPost($ind)\r\n\t{\r\n\t\t$prow = $this->objListPosts->getObjectMin($ind);\r\n\t\treturn new AntApi_BlogPost($this->server, $this->username, $this->password, $this->fid, $prow['id']);\r\n\t}", "public function createActionPost() : object\n {\n $db = $this->app->db;\n $contentWrapper = new ContentWrapper();\n\n if (hasKeyPost(\"doCreate\")) {\n $id = $contentWrapper->create($db, getPost(\"contentTitle\"));\n setSession(\"flashmessage\", \"Ny databaspost med id \" . $id . \" har lagts till i databasen!\");\n return $this->app->response->redirect(\"content/update?contentId=\" . $id);\n }\n\n return $this->app->response->redirect(\"content\");\n }", "public function create(Post $post)\n {\n }", "public function get() {\n return new $this->instance_name(\n $this->client, $this->uri\n );\n }" ]
[ "0.75920683", "0.7290437", "0.6886556", "0.68717414", "0.6690945", "0.66904026", "0.65215546", "0.651744", "0.64327013", "0.6411066", "0.6372095", "0.6343376", "0.63253534", "0.6312383", "0.6283816", "0.6260455", "0.62347215", "0.6216296", "0.6208326", "0.61762136", "0.6161374", "0.6151923", "0.6149127", "0.61358404", "0.6097575", "0.60889924", "0.60831296", "0.606785", "0.6056019", "0.6048988" ]
0.7452183
1
Views for the compare page. Implements hook_views_default_views().
function compare_item_views_default_views() { $instances = field_info_instances('commerce_product');//returns list of all commerce_products,their fields,field details // print_r($instances); $count=0;//using this for naming the different views,pages $bundle_name;//stores the name of the bundle to use in the filter(bundle = product) $compare_field_name;//stores the name of the compare type field for each bundle $views = array(); foreach ($instances as $val) {//for getting the array of each bundle/product $count++; $compare_field_present=0; //flag to check whether the current bundle has a field of type compare // Define the shopping cart update form as a View. $view = new view; $view->name = 'compare_page_'.$count; $view->description = 'Display the compare page.'; $view->tag = 'compare'; $view->base_table = 'commerce_product'; $view->human_name = 'Compare Page '.$count; $view->core = 7; $view->api_version = '3.0'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ // /* Display: Defaults */ $handler = $view->new_display('default', 'Master', 'default'); $handler->display->display_options['title'] = 'Compare page '.$count; $handler->display->display_options['access']['type'] = 'none'; $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['query']['options']['query_comment'] = FALSE; $handler->display->display_options['exposed_form']['type'] = 'basic'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['pager']['options']['items_per_page'] = '10'; // $handler->display->display_options['style_plugin'] = 'list'; $handler->display->display_options['style_plugin'] = 'table'; $handler->display->display_options['style_options']['override'] = 1; $handler->display->display_options['style_options']['sticky'] = 0; $handler->display->display_options['style_options']['empty_table'] = 0; /* Field: Commerce Product: Title */ $handler->display->display_options['fields']['title']['id'] = 'title'; $handler->display->display_options['fields']['title']['table'] = 'commerce_product'; $handler->display->display_options['fields']['title']['field'] = 'title'; $handler->display->display_options['fields']['title']['alter']['alter_text'] = 0; $handler->display->display_options['fields']['title']['alter']['make_link'] = 0; $handler->display->display_options['fields']['title']['alter']['absolute'] = 0; $handler->display->display_options['fields']['title']['alter']['external'] = 0; $handler->display->display_options['fields']['title']['alter']['replace_spaces'] = 0; $handler->display->display_options['fields']['title']['alter']['trim_whitespace'] = 0; $handler->display->display_options['fields']['title']['alter']['nl2br'] = 0; $handler->display->display_options['fields']['title']['alter']['word_boundary'] = 1; $handler->display->display_options['fields']['title']['alter']['ellipsis'] = 1; $handler->display->display_options['fields']['title']['alter']['more_link'] = 0; $handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0; $handler->display->display_options['fields']['title']['alter']['trim'] = 0; $handler->display->display_options['fields']['title']['alter']['html'] = 0; $handler->display->display_options['fields']['title']['element_label_colon'] = 0; $handler->display->display_options['fields']['title']['element_default_classes'] = 1; $handler->display->display_options['fields']['title']['hide_empty'] = 0; $handler->display->display_options['fields']['title']['empty_zero'] = 0; $handler->display->display_options['fields']['title']['hide_alter_empty'] = 1; $handler->display->display_options['fields']['title']['link_to_product'] = 0; foreach ($val as $value) {//for getting the array of each field in the current bundle/product echo "FIELD NAME: "; print_r($value['field_name']); echo "\n"; //add a field only if its not the commerce price field or the compare type field if($value['field_name'] != "commerce_price" && $value['widget']['type'] != "compare_item_compare_widget") { echo "THE OTHER FIELD NAME: "; print_r($value['field_name']); echo "\n"; $handler->display->display_options['fields'][$value['field_name']]['id'] = $value['field_name']; $handler->display->display_options['fields'][$value['field_name']]['table'] = 'field_data_'.$value['field_name']; $handler->display->display_options['fields'][$value['field_name']]['field'] = $value['field_name']; // $handler->display->display_options['fields'][$value['field_name']]['label'] = ''; $handler->display->display_options['fields'][$value['field_name']]['alter']['alter_text'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['make_link'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['absolute'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['external'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['replace_spaces'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['trim_whitespace'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['nl2br'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['word_boundary'] = 1; $handler->display->display_options['fields'][$value['field_name']]['alter']['ellipsis'] = 1; $handler->display->display_options['fields'][$value['field_name']]['alter']['more_link'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['strip_tags'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['trim'] = 0; $handler->display->display_options['fields'][$value['field_name']]['alter']['html'] = 0; $handler->display->display_options['fields'][$value['field_name']]['element_label_colon'] = 0; $handler->display->display_options['fields'][$value['field_name']]['element_default_classes'] = 1; $handler->display->display_options['fields'][$value['field_name']]['hide_empty'] = 0; $handler->display->display_options['fields'][$value['field_name']]['empty_zero'] = 0; $handler->display->display_options['fields'][$value['field_name']]['hide_alter_empty'] = 1; $handler->display->display_options['fields'][$value['field_name']]['field_api_classes'] = 0; } //if field is an image setting for showing image as a thumbnail if($value['widget']['type'] == "image_image") { /* Field: Commerce Product: Image */ $handler->display->display_options['fields'][$value['field_name']]['settings'] = array( 'image_style' => 'thumbnail', 'image_link' => 'content', ); } //if field is compare type then set flag to true and save the name of the field to use as a filter if($value['widget']['type'] == "compare_item_compare_widget") { $compare_field_present=1; $compare_field_name=$value['field_name']; // echo "\nCOMPARE FIELD NAME:".$compare_field_name."\n"; } $bundle_name=$value['bundle']; $handler->display->display_options['css_class'] = $bundle_name; } //if the current bundle/product doesnt have a compare field skip creating the view if($compare_field_present == 0) { // echo "\n**no compare field**\n"; continue; } // echo "\nBUNDLE:$bundle_name\n"; /* Filter criterion: Commerce Product: Type */ $handler->display->display_options['filters']['type']['id'] = 'type'; $handler->display->display_options['filters']['type']['table'] = 'commerce_product'; $handler->display->display_options['filters']['type']['field'] = 'type'; $handler->display->display_options['filters']['type']['value'] = array( $bundle_name => $bundle_name, ); /* Filter criterion: Commerce Product: Comparable Allowed */ $column_name=$compare_field_name.'_comparable'; $handler->display->display_options['filters'][$column_name]['id'] = $column_name; $handler->display->display_options['filters'][$column_name]['table'] = 'field_data_'.$compare_field_name; $handler->display->display_options['filters'][$column_name]['field'] = $column_name; $handler->display->display_options['filters'][$column_name]['operator'] = 'not empty'; /* Contextual filter: Commerce Product: SKU */ $handler->display->display_options['arguments']['sku']['id'] = 'sku'; $handler->display->display_options['arguments']['sku']['table'] = 'commerce_product'; $handler->display->display_options['arguments']['sku']['field'] = 'sku'; $handler->display->display_options['arguments']['sku']['default_action'] = 'default'; $handler->display->display_options['arguments']['sku']['default_argument_type'] = 'raw'; $handler->display->display_options['arguments']['sku']['default_argument_options']['index'] = '2'; $handler->display->display_options['arguments']['sku']['default_argument_skip_url'] = 1; $handler->display->display_options['arguments']['sku']['summary']['number_of_records'] = '0'; $handler->display->display_options['arguments']['sku']['summary']['format'] = 'default_summary'; $handler->display->display_options['arguments']['sku']['summary_options']['items_per_page'] = '25'; $handler->display->display_options['arguments']['sku']['glossary'] = 0; $handler->display->display_options['arguments']['sku']['limit'] = '0'; $handler->display->display_options['arguments']['sku']['transform_dash'] = 0; $handler->display->display_options['arguments']['sku']['break_phrase'] = 1; /* Display: Page */ $handler = $view->new_display('page', 'Page', 'page'); $handler->display->display_options['path'] = $bundle_name.'/comparepage'; $handler->display->display_options['menu']['type'] = 'normal'; $handler->display->display_options['menu']['title'] = 'Compare Page '.$bundle_name; $handler->display->display_options['menu']['name'] = 'main-menu'; //adds a new view to the views array $views[$view->name] = $view; } return $views; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tripal_gbrowse_views_default_views() {\n \n $views = array();\n \n $view = new view;\n\n $view->name = 'all_tripal_gbrowse_instances';\n $view->description = '';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'tripal_gbrowse_instances';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n \n $handler->override_option('fields', array(\n 'gbrowse_name' => array(\n 'label' => 'Instance Name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'gbrowse_name',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'gbrowse_name',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'database_name' => array(\n 'label' => 'Database Name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'database_name',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'database_name',\n 'relationship' => 'none',\n ),\n 'gbrowse_link' => array(\n 'label' => 'GBrowse Instance Link',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'gbrowse_link',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'gbrowse_link',\n 'relationship' => 'none',\n ),\n));\n\n$handler->override_option('filters', array(\n 'database_name' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'database_name_op',\n 'identifier' => 'database_name',\n 'label' => 'GBrowse: Database Name',\n 'optional' => 1,\n 'remember' => 0,\n ),\n 'case' => 1,\n 'id' => 'database_name',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'database_name',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'gbrowse_name' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'gbrowse_name_op',\n 'identifier' => 'gbrowse_name',\n 'label' => 'GBrowse: Instance Name',\n 'optional' => 1,\n 'remember' => 0,\n ),\n 'case' => 1,\n 'id' => 'gbrowse_name',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'gbrowse_name',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'database_user' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'database_user_op',\n 'identifier' => 'database_user',\n 'label' => 'GBrowse: Database User',\n 'optional' => 1,\n 'remember' => 0,\n ),\n 'case' => 1,\n 'id' => 'database_user',\n 'table' => 'tripal_gbrowse_instances',\n 'field' => 'database_user',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n));\n\n $handler->override_option('access', array(\n 'type' => 'perm',\n 'perm' => 'access tripal_gbrowse content',\n ));\n\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n \n$handler->override_option('empty', 'No GBrowse instances match these criteria.');\n\n$handler->override_option('empty_format', '1');\n\n$handler->override_option('use_pager', '1');\n\n$handler->override_option('style_plugin', 'table');\n\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'override' => 1,\n 'sticky' => 0,\n 'order' => 'asc',\n 'columns' => array(\n 'gbrowse_name' => 'gbrowse_name',\n 'database_name' => 'database_name',\n 'gbrowse_link' => 'gbrowse_link',\n ),\n 'info' => array(\n 'gbrowse_name' => array(\n 'sortable' => 1,\n 'separator' => '',\n ),\n 'database_name' => array(\n 'sortable' => 1,\n 'separator' => '',\n ),\n 'gbrowse_link' => array(\n 'sortable' => 1,\n 'separator' => '',\n ),\n ),\n 'default' => 'gbrowse_name',\n ));\n\n$handler = $view->new_display('page', 'Page', 'page_1');\n\n $handler->override_option('fields', array(\n 'title' => array(\n 'label' => 'GBrowse Instance Name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n \t'target' => '',\n\t\t\t\t'help' => '',\n \t'trim' => 0,\n \t'max_length' => '',\n \t'word_boundary' => 1,\n \t'ellipsis' => 1,\n \t'html' => 0,\n \t'strip_tags' => 0,\n \t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 0,\n\t\t\t'empty_zero' => 0,\n\t\t\t'link_to_node' => 1,\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'title',\n\t\t\t'table' => 'node',\n\t\t\t'field' => 'title',\n\t\t\t'override' => array(\n\t\t\t\t'button' => 'Use default',\n\t\t\t),\n\t\t\t'relationship' => 'none',\n\t\t),\n\t\t'database_name' => array(\n\t\t\t'label' => 'Database Name',\n\t\t\t'alter' => array(\n\t\t\t\t'alter_text' => 0,\n\t\t\t\t'text' => '',\n\t\t\t\t'make_link' => 0,\n\t\t\t\t'path' => '',\n\t\t\t\t'link_class' => '',\n\t\t\t\t'alt' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'suffix' => '',\n\t\t\t\t'target' => '',\n\t\t\t\t'help' => '',\n\t\t\t\t'trim' => 0,\n\t\t\t\t'max_length' => '',\n\t\t\t\t'word_boundary' => 1,\n\t\t\t\t'ellipsis' => 1,\n\t\t\t\t'html' => 0,\n\t\t\t\t'strip_tags' => 0,\n\t\t\t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 0,\n\t\t\t'empty_zero' => 0,\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'database_name',\n\t\t\t'table' => 'tripal_gbrowse_instances',\n\t\t\t'field' => 'database_name',\n\t\t\t'relationship' => 'none',\n\t\t),\n\t\t'gbrowse_link' => array(\n\t\t\t'label' => 'GBrowse Instance Link',\n\t\t\t'alter' => array(\n\t\t\t\t'alter_text' => 0,\n\t\t\t\t'text' => '',\n\t\t\t\t'make_link' => 1,\n\t\t\t\t'path' => '[gbrowse_link]',\n\t\t\t\t'link_class' => '',\n\t\t\t\t'alt' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'suffix' => '',\n\t\t\t\t'target' => '',\n\t\t\t\t'help' => '',\n\t\t\t\t'trim' => 0,\n\t\t\t\t'max_length' => '',\n\t\t\t\t'word_boundary' => 1,\n\t\t\t\t'ellipsis' => 1,\n\t\t\t\t'html' => 0,\n\t\t\t\t'strip_tags' => 0,\n\t\t\t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 1,\n\t\t\t'empty_zero' => 0,\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'gbrowse_link',\n\t\t\t'table' => 'tripal_gbrowse_instances',\n\t\t\t'field' => 'gbrowse_link',\n\t\t\t'relationship' => 'none',\n\t\t\t'override' => array(\n\t\t\t\t'button' => 'Use default',\n\t\t\t),\n\t\t),\n\t\t'changed' => array(\n\t\t\t'label' => 'Updated date',\n\t\t\t'alter' => array(\n\t\t\t\t'alter_text' => 0,\n\t\t\t\t'text' => '',\n\t\t\t\t'make_link' => 0,\n\t\t\t\t'path' => '',\n\t\t\t\t'link_class' => '',\n\t\t\t\t'alt' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'suffix' => '',\n\t\t\t\t'target' => '',\n\t\t\t\t'help' => '',\n\t\t\t\t'trim' => 0,\n\t\t\t\t'max_length' => '',\n\t\t\t\t'word_boundary' => 1,\n\t\t\t\t'ellipsis' => 1,\n\t\t\t\t'html' => 0,\n\t\t\t\t'strip_tags' => 0,\n\t\t\t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 0,\n\t\t\t'empty_zero' => 0,\n\t\t\t'date_format' => 'custom',\n\t\t\t'custom_date_format' => 'D, d M Y ',\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'changed',\n\t\t\t'table' => 'node',\n\t\t\t'field' => 'changed',\n\t\t\t'override' => array(\n\t\t\t\t'button' => 'Use default',\n\t\t\t),\n\t\t\t'relationship' => 'none',\n\t\t),\n\t\t'created' => array(\n\t\t\t'label' => 'Post date',\n\t\t\t'alter' => array(\n\t\t\t\t'alter_text' => 0,\n\t\t\t\t'text' => '',\n\t\t\t\t'make_link' => 0,\n\t\t\t\t'path' => '',\n\t\t\t\t'link_class' => '',\n\t\t\t\t'alt' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'suffix' => '',\n\t\t\t\t'target' => '',\n\t\t\t\t'help' => '',\n\t\t\t\t'trim' => 0,\n\t\t\t\t'max_length' => '',\n\t\t\t\t'word_boundary' => 1,\n\t\t\t\t'ellipsis' => 1,\n\t\t\t\t'html' => 0,\n\t\t\t\t'strip_tags' => 0,\n\t\t\t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 0,\n\t\t\t'empty_zero' => 0,\n\t\t\t'date_format' => 'custom',\n\t\t\t'custom_date_format' => 'D, d M Y ',\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'created',\n\t\t\t'table' => 'node',\n\t\t\t'field' => 'created',\n\t\t\t'override' => array(\n\t\t\t\t'button' => 'Use default',\n\t\t\t),\n\t\t\t'relationship' => 'none',\n\t\t),\n\t\t'edit_node' => array(\n\t\t\t'label' => 'Edit link',\n\t\t\t'alter' => array(\n\t\t\t\t'alter_text' => 0,\n\t\t\t\t'text' => '',\n\t\t\t\t'make_link' => 1,\n\t\t\t\t'path' => '[gbrowse_link]',\n\t\t\t\t'link_class' => '',\n\t\t\t\t'alt' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'suffix' => '',\n\t\t\t\t'target' => '',\n\t\t\t\t'help' => '',\n\t\t\t\t'trim' => 0,\n\t\t\t\t'max_length' => '',\n\t\t\t\t'word_boundary' => 1,\n\t\t\t\t'ellipsis' => 1,\n\t\t\t\t'html' => 0,\n\t\t\t\t'strip_tags' => 0,\n\t\t\t),\n\t\t\t'empty' => '',\n\t\t\t'hide_empty' => 1,\n\t\t\t'empty_zero' => 0,\n\t\t\t'text' => '',\n\t\t\t'exclude' => 0,\n\t\t\t'id' => 'edit_node',\n\t\t\t'table' => 'node',\n\t\t\t'field' => 'edit_node',\n\t\t\t'override' => array(\n\t\t\t\t'button' => 'Use default',\n\t\t\t),\n\t\t\t'relationship' => 'none',\n\t\t),\n\t));\n\t$handler->override_option('path', 'gbrowse_instances');\n\t$handler->override_option('menu', array(\n\t\t'type' => 'normal',\n\t\t'title' => 'GBrowse Instances',\n\t\t'description' => '',\n\t\t'weight' => '0',\n\t\t'name' => 'primary-links',\n\t));\n\t$handler->override_option('tab_options', array(\n\t\t'type' => 'none',\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'weight' => 0,\n\t\t'name' => 'navigation',\n\t));\n \n \n $views[$view->name] = $view; \n \n return $views;\n\n}", "public function index()\n {\n \treturn view('compare-form');\n }", "public function compareTask()\n\t{\n\t\tinclude_once dirname(dirname(__DIR__)) . DS . 'helpers' . DS . 'Diff.php';\n\n\t\t// Incoming\n\t\t$oldid = Request::getInt('oldid', 0);\n\t\t$diff = Request::getInt('diff', 0);\n\n\t\t// Do some error checking\n\t\tif (!$diff)\n\t\t{\n\t\t\t$this->setError(Lang::txt('COM_WIKI_ERROR_MISSING_VERSION'));\n\t\t\treturn $this->displayTask();\n\t\t}\n\n\t\tif ($diff == $oldid)\n\t\t{\n\t\t\t$this->setError(Lang::txt('COM_WIKI_ERROR_SAME_VERSIONS'));\n\t\t\treturn $this->displayTask();\n\t\t}\n\n\t\t// If no initial page is given, compare to the current revision\n\t\t$oldid = $oldid ?: $this->page->get('version_id');\n\n\t\t$or = $this->page->versions()->whereEquals('version', $oldid)->row();\n\t\t$dr = $this->page->versions()->whereEquals('version', $diff)->row();\n\n\t\t// Diff the two versions\n\t\t$ota = explode(\"\\n\", $or->get('pagetext'));\n\t\t$nta = explode(\"\\n\", $dr->get('pagetext'));\n\n\t\t$formatter = new \\TableDiffFormatter();\n\t\t$result = $formatter->format(new \\Diff($ota, $nta));\n\n\t\t// Set the page's <title> tag\n\t\tDocument::setTitle(\n\t\t\tLang::txt(strtoupper($this->_option)) . ': ' .\n\t\t\t$this->page->title . ': ' .\n\t\t\tLang::txt(strtoupper($this->_option . '_' . $this->_task))\n\t\t);\n\n\t\t// Set the pathway\n\t\tif (Pathway::count() <= 0)\n\t\t{\n\t\t\tPathway::append(\n\t\t\t\tLang::txt(strtoupper($this->_option)),\n\t\t\t\t'index.php?option=' . $this->_option\n\t\t\t);\n\t\t}\n\n\t\t$parents = array();\n\n\t\tif ($this->page->get('parent'))\n\t\t{\n\t\t\t$parents = $this->page->ancestors();\n\n\t\t\tforeach ($parents as $p)\n\t\t\t{\n\t\t\t\tPathway::append(\n\t\t\t\t\t$p->get('title'),\n\t\t\t\t\t$p->link()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tPathway::append(\n\t\t\t$this->page->title,\n\t\t\t$this->page->link()\n\t\t);\n\t\tPathway::append(\n\t\t\tLang::txt(strtoupper($this->_option . '_' . $this->_task)),\n\t\t\t$this->page->link() . '&' . ($this->sub ? 'action' : 'task') . '=' . $this->_task\n\t\t);\n\n\t\t// Output view\n\t\t$this->view\n\t\t\t->set('parents', $parents)\n\t\t\t->set('page', $this->page)\n\t\t\t->set('sub', $this->sub)\n\t\t\t->set('content', $result)\n\t\t\t->set('or', $or)\n\t\t\t->set('dr', $dr)\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}", "public function getDefaultView()\n {\n return 'kumaPortfolioBundle:Pages:Common/view.html.twig';\n }", "function kaltura_views_default_views() {\n $view = new view;\n $view->name = 'kaltura_most_popular_videos';\n $view->description = 'Displays the thumbnails of the videos that were most played. '.\n 'Placing the mouse over the thumbnail will create a quick preview of '.\n 'remixes and collaborative videos. Clicking the thumbnail will lead to the video node page where the video can be viewed.';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Most Popular Videos', 'default');\n $handler->override_option('fields', array(\n 'kaltura_thumbnail_url' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_thumbnail_url',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_thumbnail_url',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'kaltura_entryId' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'kaltura_entryId',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_entryId',\n 'relationship' => 'none',\n ),\n 'kaltura_plays' => array(\n 'label' => 'played',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Created at',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'date_format' => 'small',\n 'field' => 'timestamp',\n 'id' => 'timestamp',\n 'table' => 'node_revisions',\n 'relationship' => 'none'\n ),\n 'kaltura_duration' => array(\n 'label' => '',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'label' => 'Tags',\n 'exclude' => 0,\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n 'kaltura_admin_tags' => array(\n 'label' => 'Categories',\n 'exclude' => 0,\n 'id' => 'kaltura_admin_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_admin_tags',\n 'relationship' => 'none',\n ),\n 'user_id' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'users_uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'user_name' => array(\n 'label' => 'Created By',\n 'exclude' => 0,\n 'id' => 'users_name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'kaltura_plays' => array(\n 'order' => 'DESC',\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n ),\n ));\n $handler->override_option('filters', array(\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '1' => '1',\n '6' => '6',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'media_type_op',\n 'label' => 'Filter by media type',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_media_type',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'operator' => 'contains',\n 'value' => '',\n 'exposed' => TRUE,\n 'expose' => array(\n 'operator' => 'kaltura_tags_op',\n 'label' => 'kaltura: kaltura item tags',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_tags',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Most Popular Videos');\n $handler->override_option('empty', 'You did not create any Kaltura items');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'Most Popular Videos', 'page_1');\n $handler->override_option('path', 'kaltura/most/popular-videos');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $views[$view->name] = $view;\n/***********************/\n $view = new view;\n $view->name = 'kaltura_most_popular_videos_all_fields';\n $view->description = 'Displays the thumbnails of the videos that were most played. '.\n 'Placing the mouse over the thumbnail will create a quick preview of '.\n 'remixes and collaborative videos. Clicking the thumbnail will lead to the video node page where the video can be viewed.';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Most Popular Videos with All Fields', 'default');\n $handler->override_option('fields', array(\n 'kaltura_thumbnail_url' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_thumbnail_url',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_thumbnail_url',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'kaltura_duration' => array(\n 'label' => '',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_entryId' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'kaltura_entryId',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_entryId',\n 'relationship' => 'none',\n ),\n 'kaltura_plays' => array(\n 'label' => 'played',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Created at',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'date_format' => 'small',\n 'field' => 'timestamp',\n 'id' => 'timestamp',\n 'table' => 'node_revisions',\n 'relationship' => 'none'\n ),\n 'kaltura_tags' => array(\n 'label' => 'Tags',\n 'exclude' => 0,\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n 'kaltura_admin_tags' => array(\n 'label' => 'Categories',\n 'exclude' => 0,\n 'id' => 'kaltura_admin_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_admin_tags',\n 'relationship' => 'none',\n ),\n 'user_id' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'users_uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'user_name' => array(\n 'label' => 'Created By',\n 'exclude' => 0,\n 'id' => 'users_name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n 'kaltura_plays' => array(\n 'label' => 'Plays',\n 'exclude' => 0,\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n 'relationship' => 'none',\n ),\n 'kaltura_rank' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_rank',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_rank',\n 'relationship' => 'none',\n ),\n 'kaltura_votes' => array(\n 'label' => 'Rank',\n 'exclude' => 0,\n 'id' => 'kaltura_votes',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_votes',\n 'relationship' => 'none',\n ), ));\n $handler->override_option('sorts', array(\n 'kaltura_plays' => array(\n 'order' => 'DESC',\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n ),\n ));\n $handler->override_option('filters', array(\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '1' => '1',\n '6' => '6',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'media_type_op',\n 'label' => 'Filter by media type',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_media_type',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'operator' => 'contains',\n 'value' => '',\n 'exposed' => TRUE,\n 'expose' => array(\n 'operator' => 'kaltura_tags_op',\n 'label' => 'kaltura: kaltura item tags',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_tags',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Most Popular Videos with All Fields');\n $handler->override_option('empty', 'You did not create any Kaltura items');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'Most Popular Videos', 'page_1');\n $handler->override_option('path', 'kaltura/most/popular-videos-all-fields');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $views[$view->name] = $view;\n/***********************/\n\n $view = new view;\n $view->name = 'kaltura_most_popular_audio';\n $view->description = 'Displays a list of the audio entries that were most listened to. Each name is a link to the audio node page.';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Most Popular Audio', 'default');\n $handler->override_option('fields', array(\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Created at',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'date_format' => 'small',\n 'field' => 'timestamp',\n 'id' => 'timestamp',\n 'table' => 'node_revisions',\n 'relationship' => 'none'\n ),\n 'kaltura_duration' => array(\n 'label' => '',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'label' => 'Tags',\n 'exclude' => 0,\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n 'kaltura_admin_tags' => array(\n 'label' => 'Categories',\n 'exclude' => 0,\n 'id' => 'kaltura_admin_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_admin_tags',\n 'relationship' => 'none',\n ),\n 'user_id' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'users_uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'user_name' => array(\n 'label' => 'Created By',\n 'exclude' => 0,\n 'id' => 'users_name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'kaltura_plays' => array(\n 'order' => 'DESC',\n 'id' => 'kaltura_plays',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_plays',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '5' => '5',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'media_type_op',\n 'label' => 'Filter by media type',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_media_type',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'operator' => 'contains',\n 'value' => '',\n 'exposed' => TRUE,\n 'expose' => array(\n 'operator' => 'kaltura_tags_op',\n 'label' => 'kaltura: kaltura item tags',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_tags',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Most Popular Audio');\n $handler->override_option('empty', 'You did not create any Kaltura items');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'Most Popular Audio', 'page_1');\n $handler->override_option('path', 'kaltura/most/popular-audio');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $views[$view->name] = $view;\n\n $view = new view;\n $view->name = 'kaltura_recently_added_videos';\n $view->description = 'kaltura_recently_added_videos';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Most Recently Uploaded Videos', 'default');\n\n $handler->override_option('fields', array(\n 'kaltura_thumbnail_url' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_thumbnail_url',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_thumbnail_url',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'kaltura_duration' => array(\n 'label' => 'kaltura item duration',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_entryId' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'kaltura_entryId',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_entryId',\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Created at',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'date_format' => 'small',\n 'field' => 'timestamp',\n 'id' => 'timestamp',\n 'table' => 'node_revisions',\n 'relationship' => 'none'\n ),\n 'kaltura_duration' => array(\n 'label' => '',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'label' => 'Tags',\n 'exclude' => 0,\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n 'kaltura_admin_tags' => array(\n 'label' => 'Categories',\n 'exclude' => 0,\n 'id' => 'kaltura_admin_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_admin_tags',\n 'relationship' => 'none',\n ),\n 'user_id' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'users_uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'user_name' => array(\n 'label' => 'Created By',\n 'exclude' => 0,\n 'id' => 'users_name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'created' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'relationship' => 'none',\n ),\n 'sticky' => array(\n 'order' => 'DESC',\n 'id' => 'sticky',\n 'table' => 'node',\n 'field' => 'sticky',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'kaltura_entry' => 'kaltura_entry',\n 'kaltura_mix' => 'kaltura_mix',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '1' => '1',\n '6' => '6',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'operator' => 'contains',\n 'value' => '',\n 'exposed' => TRUE,\n 'expose' => array(\n 'operator' => 'kaltura_tags_op',\n 'label' => 'kaltura: kaltura item tags',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_tags',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Most Recently Uploaded Videos');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'Most Recently Uploaded Videos', 'page_1');\n $handler->override_option('path', 'kaltura/recently/videos');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $handler = $view->new_display('block', 'Block', 'block_1');\n $handler->override_option('block_description', '');\n $handler->override_option('block_caching', -1);\n $views[$view->name] = $view;\n\n $view = new view;\n $view->name = 'kaltura_my_media';\n $view->description = 'logged-in user\\'s media';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'My Kaltura Items', 'default');\n\n $handler->override_option('fields', array(\n 'kaltura_thumbnail_url' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_thumbnail_url',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_thumbnail_url',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'kaltura_entryId' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'kaltura_entryId',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_entryId',\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Created at',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'date_format' => 'small',\n 'field' => 'timestamp',\n 'id' => 'timestamp',\n 'table' => 'node_revisions',\n 'relationship' => 'none'\n ),\n 'kaltura_duration' => array(\n 'label' => '',\n 'set_precision' => FALSE,\n 'precision' => 0,\n 'decimal' => '.',\n 'separator' => ',',\n 'prefix' => '',\n 'suffix' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_duration',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_duration',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'label' => 'Tags',\n 'exclude' => 0,\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n 'kaltura_admin_tags' => array(\n 'label' => 'Categories',\n 'exclude' => 0,\n 'id' => 'kaltura_admin_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_admin_tags',\n 'relationship' => 'none',\n ),\n 'user_id' => array(\n 'label' => '',\n 'exclude' => 1,\n 'id' => 'users_uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'user_name' => array(\n 'label' => 'Created By',\n 'exclude' => 0,\n 'id' => 'users_name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n\n ));\n $handler->override_option('filters', array(\n 'uid_current' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'uid_current',\n 'table' => 'users',\n 'field' => 'uid_current',\n 'relationship' => 'none',\n ),\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '1' => '1',\n '2' => '2',\n '5' => '5',\n '6' => '6',\n ),\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 1,\n 'operator' => 'media_type_op',\n 'identifier' => 'kaltura_media_type',\n 'label' => 'Filter by media type',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n 'kaltura_tags' => array(\n 'operator' => 'contains',\n 'value' => '',\n 'exposed' => TRUE,\n 'expose' => array(\n 'operator' => 'kaltura_tags_op',\n 'label' => 'kaltura: kaltura item tags',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_tags',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_tags',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_tags',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'My Kaltura Items');\n $handler->override_option('empty', 'You did not create any Kaltura items');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'My Kaltura Items', 'page_1');\n $handler->override_option('path', 'kaltura/my_items');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $views[$view->name] = $view;\n\n $view = new view;\n $view->name = 'kaltura_recently_added_photos';\n $view->description = 'kaltura recently added photos';\n $view->tag = 'kaltura';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Most Recently Uploaded Photos', 'default');\n $handler->override_option('fields', array(\n 'kaltura_thumbnail_url' => array(\n 'label' => '',\n 'exclude' => 0,\n 'id' => 'kaltura_thumbnail_url',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_thumbnail_url',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'label' => '',\n 'link_to_user' => 0,\n 'exclude' => 0,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'created' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'relationship' => 'none',\n ),\n 'sticky' => array(\n 'order' => 'DESC',\n 'id' => 'sticky',\n 'table' => 'node',\n 'field' => 'sticky',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'kaltura_entry' => 'kaltura_entry',\n 'kaltura_mix' => 'kaltura_mix',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => 1,\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'kaltura_media_type' => array(\n 'operator' => 'in',\n 'value' => array(\n '2' => '2',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'kaltura_media_type',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_media_type',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'kaltura_video_comment' => array(\n 'operator' => 'in',\n 'value' => array(\n '0' => '0',\n ),\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => 'is_comment_op',\n 'label' => 'Filter by created as comment',\n 'use_operator' => 1,\n 'identifier' => 'kaltura_video_comment',\n 'optional' => 1,\n 'single' => 0,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'kaltura_video_comment',\n 'table' => 'node_kaltura',\n 'field' => 'kaltura_video_comment',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Most Recently Uploaded Photos');\n $handler->override_option('use_ajax', TRUE);\n $handler->override_option('use_pager', '1');\n $handler->override_option('distinct', 1);\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'type' => 'ul',\n ));\n $handler = $view->new_display('page', 'Most Recently Uploaded Photos', 'page_1');\n $handler->override_option('path', 'kaltura/recently/photos');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'weight' => 0,\n ));\n $handler = $view->new_display('block', 'Block', 'block_1');\n $handler->override_option('block_description', '');\n $handler->override_option('block_caching', -1);\n $views[$view->name] = $view;\n\n return $views;\n}", "private function getViews() {\n if(empty($this->tpl)) {\n $this->tpl = Theme::getSelected()->getView('item-list/container.tpl');\n }\n\n if(empty($this->navigationBarTpl)) {\n $this->navigationBarTpl = Theme::getSelected()->getView('item-list/navigation-bar.tpl');\n }\n\n if(empty($this->listTpl)) {\n $this->listTpl = Theme::getSelected()->getView('item-list/list.tpl');\n }\n\n if(empty($this->resultTpl)) {\n $this->resultTpl = Theme::getSelected()->getView('item-list/result.tpl');\n }\n\n }", "public function getReviewPage()\n {\n return view('pages.getReview');\n }", "public function getDefaultView()\n {\n return 'IsmaserranoPortfolioBundle:Pages:Common/view.html.twig';\n }", "function _tap_features_views_default_views() {\n $views = array();\n\n // Exported view: node_reference_stop_groups\n$view = new view;\n$view->name = 'node_reference_stop_groups';\n$view->description = '';\n$view->tag = '';\n$view->view_php = '';\n$view->base_table = 'node';\n$view->is_cacheable = FALSE;\n$view->api_version = 2;\n$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n$handler = $view->new_display('default', 'Defaults', 'default');\n$handler->override_option('fields', array(\n 'field_code_value' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '---',\n 'hide_empty' => 0,\n 'empty_zero' => 1,\n 'link_to_node' => 0,\n 'label_type' => 'none',\n 'format' => 'default',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_code_value',\n 'table' => 'node_data_field_code',\n 'field' => 'field_code_value',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'field_tour_nid' => array(\n 'label' => 'Tour',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => 'none',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'label_type' => 'widget',\n 'format' => 'plain',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_tour_nid',\n 'table' => 'node_data_field_tour',\n 'field' => 'field_tour_nid',\n 'relationship' => 'none',\n ),\n));\n$handler->override_option('sorts', array(\n 'created' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'relationship' => 'none',\n ),\n));\n$handler->override_option('arguments', array(\n 'field_tour_nid' => array(\n 'default_action' => 'ignore',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '',\n 'breadcrumb' => '',\n 'default_argument_type' => 'fixed',\n 'default_argument' => '',\n 'validate_type' => 'node',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'field_tour_nid',\n 'table' => 'node_data_field_tour',\n 'field' => 'field_tour_nid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '6' => 0,\n '11' => 0,\n '3' => 0,\n '9' => 0,\n '16' => 0,\n '7' => 0,\n '15' => 0,\n '12' => 0,\n '10' => 0,\n '8' => 0,\n '5' => 0,\n '14' => 0,\n '4' => 0,\n '13' => 0,\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'audio_stop' => 0,\n 'image_stop' => 0,\n 'page' => 0,\n 'poll_stop' => 0,\n 'stop_group' => 0,\n 'tour' => 0,\n 'video_stop' => 0,\n 'web_stop' => 0,\n ),\n 'validate_argument_node_access' => 1,\n 'validate_argument_nid_type' => 'nid',\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_php' => '',\n ),\n));\n$handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'audio_stop' => 'audio_stop',\n 'image_stop' => 'image_stop',\n 'poll_stop' => 'poll_stop',\n 'stop_group' => 'stop_group',\n 'video_stop' => 'video_stop',\n 'web_stop' => 'web_stop',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n));\n$handler->override_option('access', array(\n 'type' => 'none',\n));\n$handler->override_option('cache', array(\n 'type' => 'none',\n));\n$handler->override_option('style_plugin', 'table');\n$handler->override_option('style_options', array(\n 'grouping' => '',\n 'override' => 1,\n 'sticky' => 0,\n 'order' => 'asc',\n 'columns' => array(\n 'field_code_value' => 'field_code_value',\n 'title' => 'title',\n 'field_tour_nid' => 'field_tour_nid',\n ),\n 'info' => array(\n 'field_code_value' => array(\n 'sortable' => 0,\n 'separator' => '',\n ),\n 'title' => array(\n 'sortable' => 0,\n 'separator' => '',\n ),\n 'field_tour_nid' => array(\n 'separator' => '',\n ),\n ),\n 'default' => '-1',\n));\n\n $views[$view->name] = $view;\n\n // Exported view: tour_images\n $view = new view;\n $view->name = 'tour_images';\n $view->description = '';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('fields', array(\n 'field_image_fid' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'label_type' => 'none',\n 'format' => 'thumbnail_sq_default',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_image_fid',\n 'table' => 'node_data_field_image',\n 'field' => 'field_image_fid',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'random' => array(\n 'order' => 'ASC',\n 'id' => 'random',\n 'table' => 'views',\n 'field' => 'random',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'field_tour_nid' => array(\n 'default_action' => 'ignore',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '',\n 'breadcrumb' => '',\n 'default_argument_type' => 'fixed',\n 'default_argument' => '',\n 'validate_type' => 'none',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'field_tour_nid',\n 'table' => 'node_data_field_tour',\n 'field' => 'field_tour_nid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '6' => 0,\n '11' => 0,\n '3' => 0,\n '9' => 0,\n '16' => 0,\n '7' => 0,\n '15' => 0,\n '12' => 0,\n '10' => 0,\n '8' => 0,\n '5' => 0,\n '14' => 0,\n '4' => 0,\n '13' => 0,\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'validate_argument_node_type' => array(\n 'audio_stop' => 0,\n 'image_stop' => 0,\n 'page' => 0,\n 'poll_stop' => 0,\n 'stop_group' => 0,\n 'tour' => 0,\n 'video_stop' => 0,\n 'web_stop' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_user_restrict_roles' => 0,\n ),\n ));\n $handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'image_stop' => 'image_stop',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('items_per_page', 5);\n\n $views[$view->name] = $view;\n\n // Exported view: tour_stop_groups\n $view = new view;\n $view->name = 'tour_stop_groups';\n $view->description = 'Returns a list of stop groups per tour';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('fields', array(\n 'type' => array(\n 'label' => 'Type',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n 'field_image_fid' => array(\n 'label' => 'Image',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'label_type' => 'widget',\n 'format' => 'thumbnail_default',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_image_fid',\n 'table' => 'node_data_field_image',\n 'field' => 'field_image_fid',\n 'relationship' => 'none',\n ),\n 'field_code_value' => array(\n 'label' => 'Code',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'label_type' => 'widget',\n 'format' => 'default',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_code_value',\n 'table' => 'node_data_field_code',\n 'field' => 'field_code_value',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => 'Title',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n ),\n 'field_stops_nid' => array(\n 'label' => 'Stops',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'label_type' => 'widget',\n 'format' => 'default',\n 'multiple' => array(\n 'group' => 1,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => 0,\n ),\n 'exclude' => 0,\n 'id' => 'field_stops_nid',\n 'table' => 'node_data_field_stops',\n 'field' => 'field_stops_nid',\n 'relationship' => 'none',\n ),\n 'edit_node' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '[edit_node]',\n 'link_class' => 'popups-form popups-processed',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'text' => '',\n 'exclude' => 0,\n 'id' => 'edit_node',\n 'table' => 'node',\n 'field' => 'edit_node',\n 'relationship' => 'none',\n ),\n 'delete_node' => array(\n 'label' => 'Delete link',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'text' => '',\n 'exclude' => 0,\n 'id' => 'delete_node',\n 'table' => 'node',\n 'field' => 'delete_node',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'field_code_value' => array(\n 'order' => 'ASC',\n 'delta' => -1,\n 'id' => 'field_code_value',\n 'table' => 'node_data_field_code',\n 'field' => 'field_code_value',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'field_tour_nid' => array(\n 'default_action' => 'ignore',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => 'Stops',\n 'breadcrumb' => '',\n 'default_argument_type' => 'fixed',\n 'default_argument' => '',\n 'validate_type' => 'node',\n 'validate_fail' => 'ignore',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'field_tour_nid',\n 'table' => 'node_data_field_tour',\n 'field' => 'field_tour_nid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '6' => 0,\n '11' => 0,\n '3' => 0,\n '9' => 0,\n '16' => 0,\n '7' => 0,\n '15' => 0,\n '12' => 0,\n '10' => 0,\n '8' => 0,\n '5' => 0,\n '14' => 0,\n '4' => 0,\n '13' => 0,\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'audio_stop' => 0,\n 'image_stop' => 0,\n 'page' => 0,\n 'poll_stop' => 0,\n 'stop_group' => 0,\n 'tour' => 0,\n 'video_stop' => 0,\n 'web_stop' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_php' => '',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n ));\n $handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'audio_stop' => 'audio_stop',\n 'image_stop' => 'image_stop',\n 'poll_stop' => 'poll_stop',\n 'stop_group' => 'stop_group',\n 'video_stop' => 'video_stop',\n 'web_stop' => 'web_stop',\n ),\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'type_op',\n 'identifier' => 'type',\n 'label' => 'Stop Type',\n 'optional' => 1,\n 'single' => 1,\n 'remember' => 0,\n 'reduce' => 1,\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n 'field_code_value' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'field_code_value_op',\n 'identifier' => 'field_code_value',\n 'label' => 'Code',\n 'optional' => 1,\n 'remember' => 0,\n ),\n 'case' => 1,\n 'id' => 'field_code_value',\n 'table' => 'node_data_field_code',\n 'field' => 'field_code_value',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('empty', 'Sorry, there are no stops');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('style_plugin', 'table');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'override' => 1,\n 'sticky' => 0,\n 'order' => 'asc',\n 'columns' => array(\n 'type' => 'type',\n 'field_code_value' => 'field_code_value',\n 'title' => 'title',\n 'field_stops_nid' => 'field_stops_nid',\n 'edit_node' => 'edit_node',\n ),\n 'info' => array(\n 'type' => array(\n 'sortable' => 0,\n 'separator' => '',\n ),\n 'field_code_value' => array(\n 'sortable' => 0,\n 'separator' => '',\n ),\n 'title' => array(\n 'sortable' => 0,\n 'separator' => '',\n ),\n 'field_stops_nid' => array(\n 'separator' => '',\n ),\n 'edit_node' => array(\n 'separator' => '',\n ),\n ),\n 'default' => '-1',\n ));\n\n $views[$view->name] = $view;\n\n // Exported view: tours\n $view = new view;\n $view->name = 'tours';\n $view->description = '';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('sorts', array(\n 'created' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'tour' => 'tour',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'Tours');\n $handler->override_option('empty', 'There are currently no tours');\n $handler->override_option('empty_format', '1');\n $handler->override_option('use_pager', '1');\n $handler->override_option('row_plugin', 'node');\n $handler = $view->new_display('page', 'Page', 'page_1');\n $handler->override_option('path', 'tours');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n ));\n\n $views[$view->name] = $view;\n\n return $views;\n}", "public function getReviewsPage()\n {\n return view('pages.getReviews');\n }", "public function useComparativeTermView() {\n \t$this->useComparativeView();\n }", "function edd_payments_new_views( $views ) {\n \n $views['challenge'] = sprintf( '<a href=\"%s\">%s</a>', add_query_arg( array( 'status' => 'challenge', 'paged' => FALSE ) ), 'Challenge' ); \n $views['cancel'] = sprintf( '<a href=\"%s\">%s</a>', add_query_arg( array( 'status' => 'cancel', 'paged' => FALSE ) ), 'Cancel' );\n \n return $views;\n \n}", "public function getDefaultView()\n {\n\treturn 'KumaBroodjesBundle:PageParts:TocPagePart/view.html.twig';\n }", "function hook_field_diff_view_alter($values, $items, $context) {\n\n}", "function pixel_structure_views_default_views() {\n // get all views in code (hold in files ending with .view)\n $views = array();\n $files = file_scan_directory(drupal_get_path('module', 'pixel_structure') . '/views', '#\\.view$#');\n foreach ($files as $filepath => $file) {\n // import view\n require $filepath;\n\n // Add view to list of views to provide.\n if (isset($view)) {\n $views[$view->name] = $view;\n }\n }\n return $views;\n}", "function test_page_2_of_a_view(){\n\t\tself::clear_get_values();\n\n\t\t$dynamic_view = self::get_view_by_key( 'dynamic-view' );\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 2;\n\n\t\t// On page 2 with page size of 1\n\t\t$dynamic_view->frm_page_size = 1;\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steph', 'frm_pagination_cont' ), array( 'Jamie', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view on page 2 with 1 entry showing' );\n\n\t\t// On page 2 with page size of 2\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 2;\n\t\t$d = self::get_default_args( $dynamic_view, array( 'Steve', 'frm_pagination_cont' ), array( 'Jamie', 'Steph' ) );\n\t\tself::run_get_display_data_tests( $d, 'view on page 2 with 1 entry showing, 2 on first page' );\n\n\t\t// On page 3 with page size of 2\n\t\t$dynamic_view = self::reset_view( 'dynamic-view' );\n\t\t$dynamic_view->frm_page_size = 2;\n\t\t$_GET['frm-page-'. $dynamic_view->ID] = 3;\n\t\t$d = self::get_default_args( $dynamic_view, array( 'frm_pagination_cont', 'frm_no_entries' ), array( 'Jamie', 'Steph', 'Steve' ) );\n\t\tself::run_get_display_data_tests( $d, 'view on page 3 with no entries showing' );\n\t}", "function view() { return $this->get('view'); }", "function _activity_source_views_default_views() {\n $views = array();\n\n // Exported view: activity_feed\n $view = new view;\n $view->name = 'activity_feed';\n $view->description = '';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('fields', array(\n 'authname' => array(\n 'label' => 'OpenID Identifier',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 0,\n 'ellipsis' => 0,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'authname',\n 'table' => 'authmap',\n 'field' => 'authname',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'site_info' => array(\n 'label' => 'Site name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'site_name',\n 'exclude' => 1,\n 'id' => 'site_info',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'site_info_1' => array(\n 'label' => 'Site URL',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'base_url',\n 'exclude' => 1,\n 'id' => 'site_info_1',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'uid' => array(\n 'label' => 'Full URL to user',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/user/[uid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 1,\n 'exclude' => 1,\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'nothing_2' => array(\n 'label' => 'Linked site',\n 'alter' => array(\n 'text' => '[site_info]',\n 'make_link' => 1,\n 'path' => '[site_info_1]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 1,\n 'id' => 'nothing_2',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'label' => 'User name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '[uid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 0,\n 'overwrite_anonymous' => 0,\n 'anonymous_text' => '',\n 'exclude' => 1,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nothing_4' => array(\n 'label' => 'Linked user name',\n 'alter' => array(\n 'text' => '[name]',\n 'make_link' => 1,\n 'path' => '[uid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_4',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => 'Title',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 1,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nid' => array(\n 'label' => 'Full URL to node',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/node/[nid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'nid',\n 'table' => 'node',\n 'field' => 'nid',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nothing_3' => array(\n 'label' => 'Linked title',\n 'alter' => array(\n 'text' => '[title]',\n 'make_link' => 1,\n 'path' => '[nid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_3',\n 'table' => 'views',\n 'field' => 'nothing',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'created' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'date_format' => 'custom',\n 'custom_date_format' => 'r',\n 'exclude' => 0,\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nothing' => array(\n 'label' => 'RSS Title',\n 'alter' => array(\n 'text' => '[nothing_4] posted [nothing_3] on [nothing_2]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing',\n 'table' => 'views',\n 'field' => 'nothing',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nothing_1' => array(\n 'label' => 'Activity type',\n 'alter' => array(\n 'text' => 'posted',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_1',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'subject' => array(\n 'id' => 'subject',\n 'table' => 'comments',\n 'field' => 'subject',\n ),\n ));\n $handler->override_option('sorts', array(\n 'created' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'module' => array(\n 'operator' => '=',\n 'value' => 'openid',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'case' => 1,\n 'id' => 'module',\n 'table' => 'authmap',\n 'field' => 'module',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'perm',\n 'perm' => 'access content',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('items_per_page', 20);\n $handler = $view->new_display('feed', 'New posts', 'feed_1');\n $handler->override_option('style_plugin', 'rss_fields');\n $handler->override_option('style_options', array(\n 'mission_description' => FALSE,\n 'description' => array(\n 'feed_description' => '',\n ),\n 'fields' => array(\n 'title' => 'nothing',\n 'description' => 'nothing_1',\n 'link' => 'nid',\n 'author' => 'authname',\n 'dc:creator' => 'name',\n 'category' => '',\n 'guid' => '',\n 'pubDate' => 'created',\n ),\n 'georss' => array(\n 'lat' => '',\n 'lon' => '',\n ),\n ));\n $handler->override_option('row_plugin', '');\n $handler->override_option('path', 'activity/posts');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('displays', array());\n $handler->override_option('sitename_title', 1);\n $handler = $view->new_display('feed', 'Updated posts', 'feed_2');\n $handler->override_option('relationships', array(\n 'uid' => array(\n 'label' => 'user',\n 'required' => 1,\n 'id' => 'uid',\n 'table' => 'node_revisions',\n 'field' => 'uid',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('fields', array(\n 'authname' => array(\n 'label' => 'OpenID Identifier',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 0,\n 'ellipsis' => 0,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'authname',\n 'table' => 'authmap',\n 'field' => 'authname',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'site_info' => array(\n 'label' => 'Site name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'site_name',\n 'exclude' => 1,\n 'id' => 'site_info',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'site_info_1' => array(\n 'label' => 'Site URL',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'base_url',\n 'exclude' => 1,\n 'id' => 'site_info_1',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'uid' => array(\n 'label' => 'Full URL to user',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/user/[uid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 1,\n 'exclude' => 1,\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'uid',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n 'nothing_2' => array(\n 'label' => 'Linked site',\n 'alter' => array(\n 'text' => '[site_info]',\n 'make_link' => 1,\n 'path' => '[site_info_1]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 1,\n 'id' => 'nothing_2',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'label' => 'User name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '[uid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 0,\n 'overwrite_anonymous' => 0,\n 'anonymous_text' => '',\n 'exclude' => 1,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'uid',\n ),\n 'nothing_4' => array(\n 'label' => 'Linked user name',\n 'alter' => array(\n 'text' => '[name]',\n 'make_link' => 1,\n 'path' => '[uid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_4',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => 'Title',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 1,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nid' => array(\n 'label' => 'Full URL to node',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/node/[nid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'nid',\n 'table' => 'node',\n 'field' => 'nid',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n 'nothing_3' => array(\n 'label' => 'Linked title',\n 'alter' => array(\n 'text' => '[title]',\n 'make_link' => 1,\n 'path' => '[nid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_3',\n 'table' => 'views',\n 'field' => 'nothing',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'created' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'date_format' => 'custom',\n 'custom_date_format' => 'r',\n 'exclude' => 0,\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'nothing' => array(\n 'label' => 'RSS Title',\n 'alter' => array(\n 'text' => '[nothing_4] updated [nothing_3] on [nothing_2]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing',\n 'table' => 'views',\n 'field' => 'nothing',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n 'nothing_1' => array(\n 'label' => 'Activity type',\n 'alter' => array(\n 'text' => 'updated',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_1',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n ));\n $handler->override_option('sorts', array(\n 'changed' => array(\n 'order' => 'DESC',\n 'granularity' => 'second',\n 'id' => 'changed',\n 'table' => 'node',\n 'field' => 'changed',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('filters', array(\n 'module' => array(\n 'operator' => '=',\n 'value' => 'openid',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'case' => 1,\n 'id' => 'module',\n 'table' => 'authmap',\n 'field' => 'module',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'updated' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'updated',\n 'table' => 'node',\n 'field' => 'updated',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('style_plugin', 'rss_fields');\n $handler->override_option('style_options', array(\n 'mission_description' => FALSE,\n 'description' => array(\n 'feed_description' => '',\n ),\n 'fields' => array(\n 'title' => 'nothing',\n 'description' => 'nothing_1',\n 'link' => 'nid',\n 'author' => 'authname',\n 'dc:creator' => 'name',\n 'category' => '',\n 'guid' => 'nid',\n 'pubDate' => 'created',\n ),\n 'georss' => array(\n 'lat' => '',\n 'lon' => '',\n ),\n ));\n $handler->override_option('row_plugin', '');\n $handler->override_option('path', 'activity/updates');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('displays', array());\n $handler->override_option('sitename_title', 1);\n\n $views[$view->name] = $view;\n\n // Exported view: activity_feed_comments\n $view = new view;\n $view->name = 'activity_feed_comments';\n $view->description = '';\n $view->tag = '';\n $view->view_php = '';\n $view->base_table = 'comments';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('relationships', array(\n 'uid' => array(\n 'label' => 'User',\n 'required' => 1,\n 'id' => 'uid',\n 'table' => 'comments',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n 'nid' => array(\n 'label' => 'Node',\n 'required' => 1,\n 'id' => 'nid',\n 'table' => 'comments',\n 'field' => 'nid',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('fields', array(\n 'authname' => array(\n 'label' => 'OpenID Identifier',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'authname',\n 'table' => 'authmap',\n 'field' => 'authname',\n 'relationship' => 'uid',\n ),\n 'site_info' => array(\n 'label' => 'Site name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'site_name',\n 'exclude' => 0,\n 'id' => 'site_info',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'site_info_1' => array(\n 'label' => 'Site URL',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'site_info' => 'base_url',\n 'exclude' => 0,\n 'id' => 'site_info_1',\n 'table' => 'views',\n 'field' => 'site_info',\n 'relationship' => 'none',\n ),\n 'uid' => array(\n 'label' => 'Full URL to user',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/user/[uid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 1,\n 'exclude' => 1,\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'uid',\n ),\n 'nothing' => array(\n 'label' => 'Custom text',\n 'alter' => array(\n 'text' => '[site_info]',\n 'make_link' => 1,\n 'path' => '[site_info_1]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 1,\n 'id' => 'nothing',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'label' => 'User name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 0,\n 'overwrite_anonymous' => 0,\n 'anonymous_text' => '',\n 'exclude' => 1,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'uid',\n ),\n 'nothing_1' => array(\n 'label' => 'Linked user name',\n 'alter' => array(\n 'text' => '[name]',\n 'make_link' => 1,\n 'path' => '[uid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_1',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'nid',\n ),\n 'nid' => array(\n 'label' => 'Full URL to node',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[site_info_1]/node/[nid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'nid',\n 'table' => 'node',\n 'field' => 'nid',\n 'relationship' => 'nid',\n ),\n 'cid' => array(\n 'label' => 'Full URL to comment',\n 'alter' => array(\n 'alter_text' => 1,\n 'text' => '[nid]#comment-[cid]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_comment' => 1,\n 'exclude' => 0,\n 'id' => 'cid',\n 'table' => 'comments',\n 'field' => 'cid',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'nothing_2' => array(\n 'label' => 'Linked title',\n 'alter' => array(\n 'text' => '[title]',\n 'make_link' => 1,\n 'path' => '[nid]',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_2',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Post date',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'date_format' => 'custom',\n 'custom_date_format' => 'r',\n 'exclude' => 0,\n 'id' => 'timestamp',\n 'table' => 'comments',\n 'field' => 'timestamp',\n 'relationship' => 'none',\n ),\n 'nothing_3' => array(\n 'label' => 'RSS Title',\n 'alter' => array(\n 'text' => '[nothing_1] commented on [nothing_3] on [nothing_2]',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_3',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n 'nothing_4' => array(\n 'label' => 'Activity type',\n 'alter' => array(\n 'text' => 'commented',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'nothing_4',\n 'table' => 'views',\n 'field' => 'nothing',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('title', 'New comments');\n $handler = $view->new_display('feed', 'New comments', 'feed_1');\n $handler->override_option('items_per_page', 20);\n $handler->override_option('style_plugin', 'rss_fields');\n $handler->override_option('style_options', array(\n 'mission_description' => FALSE,\n 'description' => array(\n 'feed_description' => '',\n ),\n 'fields' => array(\n 'title' => 'nothing_3',\n 'description' => 'nothing_4',\n 'link' => 'cid',\n 'author' => 'authname',\n 'dc:creator' => 'name',\n 'category' => '',\n 'guid' => 'cid',\n 'pubDate' => 'timestamp',\n ),\n 'georss' => array(\n 'lat' => '',\n 'lon' => '',\n ),\n ));\n $handler->override_option('row_plugin', '');\n $handler->override_option('path', 'activity/comments');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('displays', array());\n $handler->override_option('sitename_title', FALSE);\n\n $views[$view->name] = $view;\n\n return $views;\n}", "function _video_series_views_default_views() {\n $views = array();\n\n // Exported view: video_episodes\n $view = new view;\n $view->name = 'video_episodes';\n $view->description = 'Listing of Episodes in a Video Series';\n $view->tag = 'VideoSerial';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('fields', array(\n 'view_node' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'text' => 'Watch Episode Now',\n 'exclude' => 0,\n 'id' => 'view_node',\n 'table' => 'node',\n 'field' => 'view_node',\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '<h2><a href=\"[view_node]\">[title]</a></h2>',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_node' => 1,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'none',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n 'teaser' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'exclude' => 0,\n 'id' => 'teaser',\n 'table' => 'node_revisions',\n 'field' => 'teaser',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'title' => array(\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n ),\n 'created' => array(\n 'order' => 'ASC',\n 'granularity' => 'second',\n 'id' => 'created',\n 'table' => 'node',\n 'field' => 'created',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'field_series_nid' => array(\n 'default_action' => 'not found',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '',\n 'breadcrumb' => '',\n 'default_argument_type' => 'fixed',\n 'default_argument' => '',\n 'validate_type' => 'node',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'field_series_nid',\n 'table' => 'node_data_field_series',\n 'field' => 'field_series_nid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '3' => 0,\n ),\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_fixed' => '',\n 'default_argument_user' => 0,\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'series' => 'series',\n 'webform' => 0,\n 'kaltura_entry' => 0,\n 'page' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_argument_vocabulary' => array(\n '3' => 0,\n '2' => 0,\n '1' => 0,\n ),\n 'validate_argument_type' => 'tid',\n 'validate_argument_transform' => 0,\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_node_flag_name' => '*relationship*',\n 'validate_argument_node_flag_test' => 'flaggable',\n 'validate_argument_node_flag_id_type' => 'id',\n 'validate_argument_user_flag_name' => '*relationship*',\n 'validate_argument_user_flag_test' => 'flaggable',\n 'validate_argument_user_flag_id_type' => 'id',\n 'validate_argument_php' => '',\n ),\n ));\n $handler->override_option('filters', array(\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'video' => 'video',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('items_per_page', 0);\n $handler = $view->new_display('node_content', 'Episodes', 'node_content_1');\n $handler->override_option('types', array(\n 'series' => 'series',\n ));\n $handler->override_option('modes', array(\n '0' => 'full',\n ));\n $handler->override_option('argument_mode', 'nid');\n $handler->override_option('default_argument', '');\n\n $views[$view->name] = $view;\n\n // Exported view: video_purchases\n $view = new view;\n $view->name = 'video_purchases';\n $view->description = 'Show the list of users who have purchased a specific video.';\n $view->tag = 'VideoSerial';\n $view->view_php = '';\n $view->base_table = 'users';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('relationships', array(\n 'flag_user_content_rel' => array(\n 'label' => 'user flagged content',\n 'required' => 0,\n 'flag' => 'video_series_purchased_content',\n 'id' => 'flag_user_content_rel',\n 'table' => 'users',\n 'field' => 'flag_user_content_rel',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('fields', array(\n 'name' => array(\n 'label' => 'User',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'link_to_user' => 1,\n 'overwrite_anonymous' => 0,\n 'anonymous_text' => '',\n 'exclude' => 0,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => 'Purchased',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'target' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'html' => 0,\n 'strip_tags' => 0,\n ),\n 'empty' => '',\n 'hide_empty' => 0,\n 'empty_zero' => 0,\n 'date_format' => 'small',\n 'custom_date_format' => '',\n 'exclude' => 0,\n 'id' => 'timestamp',\n 'table' => 'flag_content',\n 'field' => 'timestamp',\n 'relationship' => 'flag_user_content_rel',\n 'override' => array(\n 'button' => 'Override',\n ),\n ),\n ));\n $handler->override_option('arguments', array(\n 'content_id' => array(\n 'default_action' => 'not found',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '',\n 'breadcrumb' => '',\n 'default_argument_type' => 'fixed',\n 'default_argument' => '',\n 'validate_type' => 'flag_flaggable_node',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'content_id',\n 'table' => 'flag_content',\n 'field' => 'content_id',\n 'relationship' => 'flag_user_content_rel',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '3' => 0,\n ),\n 'default_options_div_prefix' => '',\n 'default_argument_fixed' => '',\n 'default_argument_user' => 0,\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'webform' => 0,\n 'kaltura_playlist' => 0,\n 'kaltura_entry' => 0,\n 'kaltura_mix' => 0,\n 'series' => 0,\n 'video' => 0,\n 'page' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_argument_vocabulary' => array(\n '2' => 0,\n '5' => 0,\n '4' => 0,\n '1' => 0,\n '3' => 0,\n ),\n 'validate_argument_type' => 'tid',\n 'validate_argument_transform' => 0,\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_node_flag_name' => 'video_series_purchased_content',\n 'validate_argument_node_flag_test' => 'flaggable',\n 'validate_argument_node_flag_id_type' => 'id',\n 'validate_argument_user_flag_name' => '*relationship*',\n 'validate_argument_user_flag_test' => 'flaggable',\n 'validate_argument_user_flag_id_type' => 'id',\n 'validate_argument_php' => '',\n ),\n ));\n $handler->override_option('filters', array(\n 'uid' => array(\n 'operator' => 'in',\n 'value' => '',\n 'group' => '0',\n 'exposed' => TRUE,\n 'expose' => array(\n 'use_operator' => 0,\n 'operator' => 'uid_op',\n 'identifier' => 'uid',\n 'label' => 'Member',\n 'optional' => 1,\n 'remember' => 0,\n 'reduce' => 0,\n ),\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('use_ajax', TRUE);\n $handler->override_option('items_per_page', 30);\n $handler->override_option('use_pager', '1');\n $handler->override_option('style_plugin', 'table');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'override' => 1,\n 'sticky' => 0,\n 'order' => 'asc',\n 'columns' => array(\n 'name' => 'name',\n 'timestamp' => 'timestamp',\n ),\n 'info' => array(\n 'name' => array(\n 'sortable' => 1,\n 'separator' => '',\n ),\n 'timestamp' => array(\n 'sortable' => 1,\n 'separator' => '',\n ),\n ),\n 'default' => '-1',\n ));\n $handler = $view->new_display('page', 'Page', 'page_1');\n $handler->override_option('path', 'node/%/purchases');\n $handler->override_option('menu', array(\n 'type' => 'tab',\n 'title' => 'Purchases',\n 'description' => 'Purchases',\n 'weight' => '0',\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n\n $views[$view->name] = $view;\n\n // Exported view: video_shows\n $view = new view;\n $view->name = 'video_shows';\n $view->description = 'Listing of all the shows';\n $view->tag = 'VideoSerial';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('filters', array(\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'none',\n ),\n 'type' => array(\n 'operator' => 'in',\n 'value' => array(\n 'series' => 'series',\n ),\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'type',\n 'table' => 'node',\n 'field' => 'type',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('items_per_page', 0);\n $handler->override_option('row_plugin', 'node');\n $handler->override_option('row_options', array(\n 'relationship' => 'none',\n 'build_mode' => 'teaser',\n 'links' => 1,\n 'comments' => 0,\n ));\n $handler = $view->new_display('page', 'Page', 'page_1');\n $handler->override_option('path', 'shows');\n $handler->override_option('menu', array(\n 'type' => 'normal',\n 'title' => 'Shows',\n 'description' => '',\n 'weight' => '0',\n 'name' => 'primary-links',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n\n $views[$view->name] = $view;\n\n return $views;\n}", "public function view_verifpageAdmin(){\n return View::createView('verificationAdmin.php', []);\n }", "public function testGetTeamViews()\n {\n // Setup team vuew\n $teamView = new BrowserView();\n $teamView->setObjType(\"note\");\n $teamView->setTeamId(1);\n $this->browserViewService->saveView($teamView);\n\n // Setup user view\n $userView = new BrowserView();\n $userView->setObjType(\"note\");\n $userView->setUserId(2);\n $this->browserViewService->saveView($userView);\n\n // Set global account view\n $accountView = new BrowserView();\n $accountView->setObjType(\"note\");\n $this->browserViewService->saveView($accountView);\n\n // Make sure getting accounts views does not return user or team views\n $teamViews = $this->browserViewService->getTeamViews(\"note\", 1);\n $foundUserView = false;\n $foundAccountView = false;\n foreach ($teamViews as $view)\n {\n if ($view->getUserId())\n $foundUserView = true;\n if (empty($view->getTeamId()) && empty($view->getUserId()))\n $foundAccountView = true;\n }\n $this->assertTrue(count($teamViews) >= 1);\n $this->assertFalse($foundUserView);\n $this->assertFalse($foundAccountView);\n\n // Cleanup\n $this->browserViewService->deleteView($teamView);\n $this->browserViewService->deleteView($userView);\n $this->browserViewService->deleteView($accountView);\n }", "public function actionView() {\n\t\t$this->actionIndex();\n\t}", "function getViewName()\n {\n return 'views';\n }", "public function view() {\n\n // Set the Team's styles\n set_css_urls(array('stylesheet', base_url('assets/base/user/components/collection/team/styles/css/styles.css?ver=' . MIDRUB_BASE_USER_COMPONENTS_TEAM_VERSION), 'text/css', 'all'));\n \n // Set the Team's Js\n set_js_urls(array(base_url('assets/base/user/components/collection/team/js/main.js?ver=' . MIDRUB_BASE_USER_COMPONENTS_TEAM_VERSION)));\n\n // Set views params\n set_user_view(\n $this->CI->load->ext_view(\n MIDRUB_BASE_USER_COMPONENTS_TEAM . 'views',\n 'main',\n array(),\n true\n )\n );\n \n }", "public function testGetAccountViews()\n {\n // Setup team vuew\n $teamView = new BrowserView();\n $teamView->setObjType(\"note\");\n $teamView->setTeamId(1);\n $this->browserViewService->saveView($teamView);\n\n // Setup user view\n $userView = new BrowserView();\n $userView->setObjType(\"note\");\n $userView->setUserId(1);\n $this->browserViewService->saveView($userView);\n\n // Set global account view\n $accountView = new BrowserView();\n $accountView->setObjType(\"note\");\n $this->browserViewService->saveView($accountView);\n\n // Make sure getting accounts views does not return user or team views\n $accountViews = $this->browserViewService->getAccountViews(\"note\");\n $foundUserView = false;\n $foundTeamView = false;\n foreach ($accountViews as $view)\n {\n if ($view->getUserId())\n $foundUserView = true;\n if ($view->getTeamId())\n $foundTeamView = true;\n }\n $this->assertTrue(count($accountViews) >= 1);\n $this->assertFalse($foundUserView);\n $this->assertFalse($foundTeamView);\n\n // Cleanup\n $this->browserViewService->deleteView($teamView);\n $this->browserViewService->deleteView($userView);\n $this->browserViewService->deleteView($accountView);\n }", "function GetTestResultsViewAction()\n {\n return \"TestResultsView\";\n }", "public function useComparativeCourseOfferingView() {\n \t$this->useComparativeView();\n }", "public function views();", "function onView () {\r\n \r\n switch (parent::getAction()) {\r\n case \"sendEmails\":\r\n $this->printSendingEmailsView();\r\n break;\r\n case \"sendReport\":\r\n $this->printSendReportView();\r\n break;\r\n default:\r\n $this->printMainView();\r\n }\r\n }", "function _atrium_profile_views_default_views() {\n $views = array();\n\n // Exported view: atrium_profile\n $view = new view;\n $view->name = 'atrium_profile';\n $view->description = 'Atrium > Profile';\n $view->tag = 'atrium';\n $view->view_php = '';\n $view->base_table = 'users';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('fields', array(\n 'picture' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'exclude' => 0,\n 'id' => 'picture',\n 'table' => 'users',\n 'field' => 'picture',\n 'relationship' => 'none',\n ),\n 'name' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_user' => 0,\n 'overwrite_anonymous' => 0,\n 'anonymous_text' => '',\n 'exclude' => 0,\n 'id' => 'name',\n 'table' => 'users',\n 'field' => 'name',\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'uid' => array(\n 'default_action' => 'default',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '',\n 'breadcrumb' => '',\n 'default_argument_type' => 'user',\n 'default_argument' => '',\n 'validate_type' => 'useringroups',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '3' => 0,\n '4' => 0,\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'blog' => 0,\n 'book' => 0,\n 'event' => 0,\n 'feed_ical' => 0,\n 'feed_ical_item' => 0,\n 'casetracker_basic_case' => 0,\n 'casetracker_basic_project' => 0,\n 'group' => 0,\n 'profile' => 0,\n 'feed' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_argument_vocabulary' => array(\n '1' => 0,\n ),\n 'validate_argument_type' => 'tid',\n 'validate_argument_transform' => 0,\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_is_member' => 0,\n 'validate_argument_php' => '',\n ),\n ));\n $handler->override_option('access', array(\n 'type' => 'perm',\n 'perm' => 'access user profiles',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('items_per_page', 1);\n $handler = $view->new_display('page', 'Profile', 'page_1');\n $handler->override_option('path', 'user/%');\n $handler->override_option('menu', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n 'name' => 'navigation',\n ));\n $handler->override_option('tab_options', array(\n 'type' => 'none',\n 'title' => '',\n 'description' => '',\n 'weight' => 0,\n ));\n $handler = $view->new_display('attachment', 'Profile fields', 'attachment_1');\n $handler->override_option('relationships', array(\n 'content_profile_rel' => array(\n 'label' => 'Content Profile',\n 'required' => 1,\n 'type' => 'profile',\n 'id' => 'content_profile_rel',\n 'table' => 'users',\n 'field' => 'content_profile_rel',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('fields', array(\n 'mail' => array(\n 'label' => 'E-mail',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_user' => 'mailto',\n 'exclude' => 0,\n 'id' => 'mail',\n 'table' => 'users',\n 'field' => 'mail',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n 'title' => array(\n 'label' => 'Full name',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'relationship' => 'content_profile_rel',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n 'field_profile_organization_value' => array(\n 'id' => 'field_profile_organization_value',\n 'table' => 'node_data_field_profile_organization',\n 'field' => 'field_profile_organization_value',\n 'relationship' => 'content_profile_rel',\n ),\n 'field_profile_telephone_value' => array(\n 'id' => 'field_profile_telephone_value',\n 'table' => 'node_data_field_profile_telephone',\n 'field' => 'field_profile_telephone_value',\n 'relationship' => 'content_profile_rel',\n ),\n 'field_profile_url_value' => array(\n 'id' => 'field_profile_url_value',\n 'table' => 'node_data_field_profile_url',\n 'field' => 'field_profile_url_value',\n 'relationship' => 'content_profile_rel',\n ),\n 'field_profile_address_value' => array(\n 'label' => 'Address',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_node' => 0,\n 'label_type' => 'widget',\n 'format' => 'default',\n 'multiple' => array(\n 'group' => TRUE,\n 'multiple_number' => '',\n 'multiple_from' => '',\n 'multiple_reversed' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'field_profile_address_value',\n 'table' => 'node_data_field_profile_address',\n 'field' => 'field_profile_address_value',\n 'relationship' => 'content_profile_rel',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n ));\n $handler->override_option('filters', array(\n 'nid' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'nid',\n 'table' => 'node_access',\n 'field' => 'nid',\n 'relationship' => 'content_profile_rel',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'relationship' => 'content_profile_rel',\n 'override' => array(\n 'button' => 'Use default',\n ),\n ),\n ));\n $handler->override_option('attachment_position', 'after');\n $handler->override_option('inherit_arguments', TRUE);\n $handler->override_option('inherit_exposed_filters', FALSE);\n $handler->override_option('inherit_pager', FALSE);\n $handler->override_option('render_pager', TRUE);\n $handler->override_option('displays', array(\n 'default' => 'default',\n 'page_1' => 'page_1',\n ));\n $translatables['atrium_profile'] = array(\n t('Defaults'),\n t('Profile'),\n t('Profile fields'),\n );\n\n $views[$view->name] = $view;\n\n // Exported view: atrium_profile_blocks\n $view = new view;\n $view->name = 'atrium_profile_blocks';\n $view->description = 'Atrium > Profile blocks';\n $view->tag = 'atrium';\n $view->view_php = '';\n $view->base_table = 'node';\n $view->is_cacheable = FALSE;\n $view->api_version = 2;\n $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */\n $handler = $view->new_display('default', 'Defaults', 'default');\n $handler->override_option('access', array(\n 'type' => 'none',\n ));\n $handler->override_option('cache', array(\n 'type' => 'none',\n ));\n $handler->override_option('use_pager', '0');\n $handler->override_option('row_plugin', 'node');\n $handler->override_option('row_options', array(\n 'relationship' => 'none',\n 'build_mode' => 'teaser',\n 'links' => 1,\n 'comments' => 0,\n ));\n $handler = $view->new_display('block', 'Activity', 'block_1');\n $handler->override_option('fields', array(\n 'group_nid' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'exclude' => 0,\n 'id' => 'group_nid',\n 'table' => 'og_ancestry',\n 'field' => 'group_nid',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'feature' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_node' => 0,\n 'exclude' => 0,\n 'id' => 'feature',\n 'table' => 'spaces_node',\n 'field' => 'feature',\n 'override' => array(\n 'button' => 'Override',\n ),\n 'relationship' => 'none',\n ),\n 'atrium_activity_timestamp' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => FALSE,\n 'text' => '',\n 'make_link' => FALSE,\n 'path' => '',\n 'alt' => '',\n 'link_class' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'trim' => FALSE,\n 'max_length' => '',\n 'word_boundary' => TRUE,\n 'ellipsis' => TRUE,\n 'strip_tags' => FALSE,\n 'html' => FALSE,\n ),\n 'time_horizon' => 30,\n 'exclude' => 0,\n 'id' => 'atrium_activity_timestamp',\n 'table' => 'comments',\n 'field' => 'atrium_activity_timestamp',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n 'date_format' => 'reldate',\n 'custom_date_format' => '',\n ),\n 'atrium_activity' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => FALSE,\n 'text' => '',\n 'make_link' => FALSE,\n 'path' => '',\n 'alt' => '',\n 'link_class' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'trim' => FALSE,\n 'max_length' => '',\n 'word_boundary' => TRUE,\n 'ellipsis' => TRUE,\n 'strip_tags' => FALSE,\n 'html' => FALSE,\n ),\n 'time_horizon' => '90',\n 'exclude' => 0,\n 'id' => 'atrium_activity',\n 'table' => 'comments',\n 'field' => 'atrium_activity',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n 'timestamp' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => 0,\n 'text' => '',\n 'make_link' => 0,\n 'path' => '',\n 'link_class' => '',\n 'alt' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'help' => '',\n 'trim' => 0,\n 'max_length' => '',\n 'word_boundary' => 1,\n 'ellipsis' => 1,\n 'strip_tags' => 0,\n 'html' => 0,\n ),\n 'link_to_node' => 0,\n 'comments' => 0,\n 'exclude' => 0,\n 'id' => 'timestamp',\n 'table' => 'history_user',\n 'field' => 'timestamp',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'uid' => array(\n 'default_action' => 'default',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '%1\\'s activity',\n 'breadcrumb' => '',\n 'default_argument_type' => 'user',\n 'default_argument' => '',\n 'validate_type' => 'user',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'uid',\n 'table' => 'users',\n 'field' => 'uid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '3' => 0,\n '4' => 0,\n ),\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'blog' => 0,\n 'book' => 0,\n 'event' => 0,\n 'feed_ical' => 0,\n 'feed_ical_item' => 0,\n 'casetracker_basic_case' => 0,\n 'casetracker_basic_project' => 0,\n 'group' => 0,\n 'profile' => 0,\n 'shoutbox' => 0,\n 'admin_message' => 0,\n 'feedapi_node' => 0,\n 'feed_reader' => 0,\n 'imageset' => 0,\n 'page' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_argument_vocabulary' => array(\n '5' => 0,\n '1' => 0,\n '2' => 0,\n '6' => 0,\n '4' => 0,\n ),\n 'validate_argument_type' => 'tid',\n 'validate_argument_transform' => 0,\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_is_member' => 0,\n 'validate_argument_php' => '',\n ),\n ));\n $handler->override_option('filters', array(\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n 'update_type' => array(\n 'operator' => '=',\n 'value' => '',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'update_type',\n 'table' => 'node',\n 'field' => 'update_type',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('title', 'Recent activity');\n $handler->override_option('use_ajax', TRUE);\n $handler->override_option('items_per_page', 15);\n $handler->override_option('use_pager', 'mini');\n $handler->override_option('style_plugin', 'table');\n $handler->override_option('style_options', array(\n 'grouping' => '',\n 'override' => 1,\n 'sticky' => 0,\n 'order' => 'asc',\n 'columns' => array(\n 'group_nid' => 'group_nid',\n 'feature' => 'feature',\n 'atrium_activity_timestamp' => 'atrium_activity_timestamp',\n 'atrium_activity' => 'atrium_activity',\n 'timestamp' => 'timestamp',\n ),\n 'info' => array(\n 'group_nid' => array(\n 'separator' => '',\n ),\n 'feature' => array(\n 'separator' => '',\n ),\n 'atrium_activity_timestamp' => array(\n 'separator' => '',\n ),\n 'atrium_activity' => array(\n 'separator' => '',\n ),\n 'timestamp' => array(\n 'separator' => '',\n ),\n ),\n 'default' => '-1',\n ));\n $handler->override_option('row_plugin', 'fields');\n $handler->override_option('row_options', array());\n $handler->override_option('block_description', 'User\\'s activity');\n $handler->override_option('block_caching', -1);\n $handler = $view->new_display('block', 'Groups', 'block_2');\n $handler->override_option('fields', array(\n 'atrium_group' => array(\n 'label' => '',\n 'alter' => array(\n 'alter_text' => FALSE,\n 'text' => '',\n 'make_link' => FALSE,\n 'path' => '',\n 'alt' => '',\n 'link_class' => '',\n 'prefix' => '',\n 'suffix' => '',\n 'trim' => FALSE,\n 'max_length' => '',\n 'word_boundary' => TRUE,\n 'ellipsis' => TRUE,\n 'strip_tags' => FALSE,\n 'html' => FALSE,\n ),\n 'exclude' => 0,\n 'id' => 'atrium_group',\n 'table' => 'node',\n 'field' => 'atrium_group',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('sorts', array(\n 'title' => array(\n 'order' => 'ASC',\n 'id' => 'title',\n 'table' => 'node',\n 'field' => 'title',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('arguments', array(\n 'uid' => array(\n 'default_action' => 'default',\n 'style_plugin' => 'default_summary',\n 'style_options' => array(),\n 'wildcard' => 'all',\n 'wildcard_substitution' => 'All',\n 'title' => '%1\\'s groups',\n 'breadcrumb' => '',\n 'default_argument_type' => 'user',\n 'default_argument' => '',\n 'validate_type' => 'user',\n 'validate_fail' => 'not found',\n 'break_phrase' => 0,\n 'not' => 0,\n 'id' => 'uid',\n 'table' => 'og_uid',\n 'field' => 'uid',\n 'validate_user_argument_type' => 'uid',\n 'validate_user_roles' => array(\n '2' => 0,\n '3' => 0,\n '4' => 0,\n ),\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n 'default_options_div_prefix' => '',\n 'default_argument_user' => 0,\n 'default_argument_fixed' => '',\n 'default_argument_php' => '',\n 'validate_argument_node_type' => array(\n 'blog' => 0,\n 'book' => 0,\n 'event' => 0,\n 'feed_ical' => 0,\n 'feed_ical_item' => 0,\n 'casetracker_basic_case' => 0,\n 'casetracker_basic_project' => 0,\n 'group' => 0,\n 'profile' => 0,\n 'feed' => 0,\n ),\n 'validate_argument_node_access' => 0,\n 'validate_argument_nid_type' => 'nid',\n 'validate_argument_vocabulary' => array(\n '1' => 0,\n ),\n 'validate_argument_type' => 'tid',\n 'validate_argument_transform' => 0,\n 'validate_user_restrict_roles' => 0,\n 'validate_argument_is_member' => 0,\n 'validate_argument_php' => '',\n ),\n ));\n $handler->override_option('filters', array(\n 'status' => array(\n 'operator' => '=',\n 'value' => '1',\n 'group' => '0',\n 'exposed' => FALSE,\n 'expose' => array(\n 'operator' => FALSE,\n 'label' => '',\n ),\n 'id' => 'status',\n 'table' => 'node',\n 'field' => 'status',\n 'override' => array(\n 'button' => 'Use default',\n ),\n 'relationship' => 'none',\n ),\n ));\n $handler->override_option('use_ajax', TRUE);\n $handler->override_option('use_pager', 'mini');\n $handler->override_option('style_plugin', 'list');\n $handler->override_option('row_plugin', 'fields');\n $handler->override_option('row_options', array());\n $handler->override_option('block_description', 'User\\'s groups');\n $handler->override_option('block_caching', -1);\n $translatables['atrium_profile_blocks'] = array(\n t('Activity'),\n t('Defaults'),\n t('Groups'),\n t('Recent activity'),\n t('User\\'s activity'),\n t('User\\'s groups'),\n );\n\n $views[$view->name] = $view;\n\n return $views;\n}" ]
[ "0.59114957", "0.5639795", "0.562382", "0.5593541", "0.55882937", "0.5515865", "0.55098933", "0.550793", "0.5480423", "0.5464813", "0.5459747", "0.54428184", "0.5435714", "0.5424189", "0.54161507", "0.53821766", "0.53803307", "0.5379226", "0.53695923", "0.5360702", "0.5310288", "0.5298986", "0.5298413", "0.52973205", "0.5295442", "0.52932775", "0.52925354", "0.529132", "0.5272304", "0.5266746" ]
0.6512862
0
/ redirect to list sites
function index(){ //List sites $this->sites(); $this->view->template_action = 'sites'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sitesAction()\n {\n $this->view->title = \"Trusted Sites\";\n\n $user = new Default_Model_User();\n $this->view->sites = $user->findSites()->toArray();\n }", "public function indexAction() {\n\t\t$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper ( 'redirector' );\n\t\t$redirector->gotoUrl ( '/default/domains/list' );\n\t}", "function index() {\n\t\tredirect('data_ktp/lists');\n\t}", "function sites () {\n\t\t$q = $this->db->get('db91576_cortex.sites');\n\t\t$sites = $q->result_array();\n\t\t\n\t\t$console['body'] = $this->load->view('cortex/list_sites', array('data'=>$sites), TRUE);\n\t\t\n\t\t$data['content']['body'] = $this->load->view('console', $console, true);\n\t\t$data['content']['side'] = $this->load->view('_sidebar', null, true);\n\t\t\n\t\t$this->load->view('main',$data);\n\t}", "private function list_page_redirect() {\r\n wp_redirect( \r\n esc_url_raw( \r\n add_query_arg( \r\n array(\r\n 'page' => self::LIST_PAGE \r\n ),\r\n admin_url( self::PARENT_MENU )\r\n ) \r\n ) );\r\n exit; \r\n }", "protected function redirectToList()\n {\n $this->_redirect($this->view->url(array(\n 'action' => 'list',\n 'user' => ''\n )));\n }", "public function siteAction()\n {\n $websites = Mage::app()->getWebsites();\n $sites = array();\n foreach ($websites as $website) {\n $sites[] = array('name' => $website->getName(),\n 'id' => $website->getId(),\n 'numDocs' => $this->helper()->getNumberOfDocsInUnbxd($website));\n }\n $response = array('sites' => $sites);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n $this->getResponse()->setBody(json_encode($response));\n }", "function plc_my_site_links() {\n $html = '';\n $sites = plc_my_sites();\n if (count($sites)>1) foreach ($sites as $site) {\n $html .= leaf( href(l_site($site['site_id']),$site['abbreviated_name']));\n } else {\n $html .= leaf( href(l_site(plc_my_site_id()),\"My Site\"));\n }\n return $html;\n}", "public function indexAction()\n\t{\n\t\t// redirect to member list?\n\t}", "function index(){\n\t\tredirect(\"dashboard/listing\", \"location\");\n\t}", "public function site_list($params) {\n\t\tif ($this->version == 1) {\n\t\t\t// not supported currently.\n\t\t\t//$request_url = \"{$this->url}&api_action=contact_delete_list&api_output={$this->output}&{$params}\";\n\t\t} elseif ($this->version == 2) {\n\t\t\t$request_url = \"{$this->url_base}/track/site\";\n\t\t}\n\t\t$response = parent::curl($request_url, array(), \"GET\", \"tracking_site_list\");\n\t\treturn $response;\n\t}", "function ciniki_web_redirectList($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'checkAccess');\n $rc = ciniki_web_checkAccess($ciniki, $args['tnid'], 'ciniki.web.redirectList');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the list of redirects\n //\n $strsql = \"SELECT ciniki_web_redirects.id, \"\n . \"ciniki_web_redirects.oldurl, \"\n . \"ciniki_web_redirects.newurl \"\n . \"FROM ciniki_web_redirects \"\n . \"WHERE ciniki_web_redirects.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.web', array(\n array('container'=>'redirects', 'fname'=>'id', \n 'fields'=>array('id', 'oldurl', 'newurl')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['redirects']) ) {\n $redirects = $rc['redirects'];\n } else {\n $redirects = array();\n }\n\n return array('stat'=>'ok', 'redirects'=>$redirects);\n}", "public function actionIndex()\n {\n $data = [];\n\n // TODO: Workaround to check editable sites\n $sites = Craft::$app->sites->getAllSites();\n $siteIds = Craft::$app->sites->getAllSiteIds();\n $primarySite = Craft::$app->sites->getPrimarySite();\n if (count($sites) == 1) {\n $data['defaultSite'] = Craft::$app->sites->getPrimarySite();\n } else {\n $sites = Craft::$app->sites->getEditableSites();\n $canEditDefault = false;\n $canEditDefault = array_filter($sites, function ($site) use ($primarySite, $canEditDefault) {\n if ($site->id == $primarySite->id) {\n return true;\n }\n });\n\n if ($canEditDefault) {\n $data['defaultSite'] = $primarySite;\n } else {\n $data['defaultSite'] = reset($sites);\n }\n }\n $data['settings'] = Navigate::$plugin->getSettings();\n $data['navigations'] = Navigate::$plugin->navigate->getAllNavigations();\n return $this->renderTemplate('navigate/_index', $data);\n }", "protected function _list_index()\n {\n $this->request->redirect('');\n }", "public function indexAction()\n {\n return $this->app->response->redirect(\"cms/show-all\");\n }", "public function index()\n {\n $status = [];\n $sites = Auth::user()->sites;\n foreach($sites as $site){\n $client = new \\GuzzleHttp\\Client(['verify' => false]);\n try {\n $punycode = new Punycode();\n $parsed_url = parse_url( $site->url );\n $response = $client->get( $parsed_url['scheme'].\"://\".$punycode->encode( $parsed_url['host'] ) );\n $code = $response->getStatusCode();\n if ($code != 200) {\n $status[$site->id] = 'Ошибка';\n } else {\n $body = $response->getBody();\n $remainingBytes = $body->getContents();\n if (strpos($remainingBytes, $site->code) !== false) {\n $status[$site->id] = 'OK';\n } else {\n $status[$site->id] = 'Код не найден';\n }\n }\n } catch (RequestException $e){\n $status[$site->id] = 'Ошибка';\n }\n\n }\n return view('site.sites',['status'=>$status]);\n }", "public function actionIndex()\n {\n $searchModel = new sitesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function indexAction()\n {\n redirect('/blog/index/show/id/1');\n }", "public function indexAction() \n {\n $this->_helper->redirector('bulklogin');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $sites = $em->getRepository('GestionBundle:Site')->findAll();\n\n return $this->render('site/index.html.twig', array(\n 'sites' => $sites,\n ));\n }", "public function index() {\n CakeLog::config('apache.log', array(\n 'engine' => 'CustomFileLog',\n 'path' => dirname(APP) . DS . \"app\" . DS . \"tmp\" . DS . \"logs\" . DS\n ));\n\n if (isset($this->request->query['u'])) {\n\n $externalUrl = $this->request->query['u'];\n\n $externalDomain = explode('?', $externalUrl);\n\n // Log a successful place search\n $message = array(\n 'clientIp' => $this->request->clientIp(),\n 'method' => $this->request->method(),\n 'here' => $this->request->here . \"?u=\" . $externalDomain[0],\n 'referer' => $this->request->referer(),\n 'status' => 302,\n 'filesize' => 0\n );\n CakeLog::write(\"apache_access\", $message);\n\n $this->redirect($externalUrl, 404, true);\n } else {\n $this->redirect(array('controller' => 'sites', 'action' => 'main'));\n }\n }", "function mulr_allowed_redirect_hosts($content) {\n\t$allowed_domains = [];\n\t$sites = get_sites();\n\tforeach ($sites as $site) {\n\t\t$allowed_domains[] = $site->domain;\n\t}\n\t// error_log(\"allowed_redirect_hosts: \". implode(', ', $allowed_domains));\n\treturn $allowed_domains;\n}", "public function indexAction() {\n\t\t$this->view->assign('staticLists', $this->staticListService->listAll());\n\t}", "public function redirectToList()\n {\n // It should be saved to the db. Redirect back to the entity list\n return $this->redirect()->toRoute('major');\n }", "public function actionIndex()\r\n\t\t{\r\n\t\t\t$this->redirect(['listado-solicitud']);\r\n\t\t}", "function pshb_template_redirect() {\n\t// get all feeds\n\t$feed_urls = pshb_get_feed_urls();\n\t$comment_feed_urls = pshb_get_comment_feed_urls();\n\n\t// get current url\n\t$urls = array_unique( array_merge( $feed_urls, $comment_feed_urls ) );\n\t$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n\t// check if current url is one of the feed urls\n\tif ( in_array( $current_url, $urls ) ) {\n\t\t$hub_urls = pshb_get_pubsub_endpoints();\n\t\t// add all \"hub\" headers\n\t\tforeach ( $hub_urls as $hub_url ) {\n\t\t\theader( 'Link: <'.$hub_url.'>; rel=\"hub\"', false );\n\t\t}\n\t\t// add the \"self\" header\n\t\theader( 'Link: <'.$current_url.'>; rel=\"self\"', false );\n\t}\n}", "public function indexAction()\n {\n return $this->redirect()->toRoute('', ['action' => 'list']);\n }", "public function index()\n {\n redirect('profiles/list_all');\n }", "public function index()\n\t\t{\n\t\t\treturn $this->redirect(['controller' => 'Pages', 'action' => 'display', 'home']);\n\t\t}", "function index()\n\t{\n\t\tredirect($this->config->item('base_url').'');\t\t\n\t}" ]
[ "0.7466051", "0.6982101", "0.67290956", "0.66428226", "0.6437672", "0.6436421", "0.6426502", "0.6311705", "0.6266232", "0.62662095", "0.6172995", "0.6163664", "0.6158576", "0.6132837", "0.61117566", "0.60554725", "0.6039874", "0.6039206", "0.6016942", "0.601636", "0.5976802", "0.5967464", "0.5947242", "0.5926758", "0.5924052", "0.59217304", "0.59059995", "0.58950514", "0.588791", "0.5881994" ]
0.7180031
1
/ List campaigns to site
function campaigns($site=''){ if($site!=''){ //select site $s = Site::find('first', array( 'conditions' => "name = ".ActiveRecord::quote($site) )); $this->view->site = $s->name; if($site != 'all'){ //list campaigns setcookie('site', $site); $_COOKIE['site'] = $site; $this->view->campaigns = $s->my_campaigns(); }else{ $this->view->campaigns = Campaign::find('all', array('order'=>'id DESC')); } }else{ //List sites $this->sites(); $this->view->template_action = 'sites'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ListCampaigns() {\n\t\treturn $this->doQuery(\"campaigns\", \"GET\");\n\t}", "function index()\n {\n $this->view_all_campaign();\n }", "public function all_campaigns()\n {\n //\n $campaigns = Campaign::paginate(10);\n return view('all_campaigns',[\n 'campaigns'=>$campaigns\n ]);\n\n }", "public function get_campaigns() {\n\t\treturn $this->campaigns;\n\t}", "public function getCampaigns()\r\n {\r\n // with a draft status of 1\r\n $select = new Select('launchcampaign');\r\n \r\n $select->columns(array('campaign_id', 'title', 'campaign_status'))\r\n ->where(\"draft_status = '1'\");\r\n \r\n $adapter = $this->table_gateway->getAdapter();\r\n \r\n $query = $adapter->query($this->sql->buildSqlString($select), $adapter::QUERY_MODE_EXECUTE);\r\n \r\n $holder = array();\r\n \r\n foreach ($query as $key => $row) {\r\n $holder[$key] = $row;\r\n }\r\n \r\n return $holder;\r\n }", "Public Function getCampaigns()\n\t{\n\t\treturn $this->_db->fetchAll('SELECT * FROM bevomedia_ppc_campaigns WHERE accountId = ' . $this->id . ' AND providerType = ' . $this->providerType);\n\t}", "function get_a_list_of_campaigns( $campaign_name ) {\n\t $headerdata = array(\n\t\t 'X-Auth-Token: api-key ' . $GLOBALS['token'],\n\t\t 'Content-Type: application/x-www-form-urlencoded',\n\t );\n\n\t\t$post_data = array(\n\t\t\t'query' => array(\n\t\t\t\t'name' => $campaign_name,\n\t\t\t\t'isDefault' => null,\n\t\t\t),\n\t\t\t'sort' => array(\n\t\t\t\t'name' => null,\n\t\t\t\t'createdOn' => null,\n\t\t\t),\n\t\t\t'fields' => null,\n\t\t\t'perPage' => null,\n\t\t\t'page' => null,\n\t\t);\n\n\t\t$post_data = json_decode( json_encode( $post_data ) );\n\t\t$post_data = http_build_query( $post_data );\n\n\t\t$ch = curl_init();\n\t\t$url = $GLOBALS['api_url'] . '/campaigns?' . $post_data;\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, false );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, $headerdata );\n\t\tcurl_setopt( $ch, CURLPROTO_HTTPS, true );\n\n\t\t$response = curl_exec( $ch );\n\n\t\tif ( false === $response ) :\n\t\t\t$error_obj = array(\n\t\t\t\t'error' => curl_error( $ch ),\n\t\t\t\t'status' => 'failed',\n\t\t\t);\n\t\t\tcurl_close( $ch );\n\t\t\t$error_obj = json_decode( json_encode( $error_obj ) );\n\t\t\treturn $error_obj;\n\t\telse :\n\t\t\tcurl_close( $ch );\n\t\t\t$response = json_decode( $response );\n\n\t\t\treturn true;\n\t\tendif;\n}", "public function getCampaigns()\n {\n if (isset($this->_pageId)) {\n $this->_getFacade()->getProductCampaignAdapter()->makePageCampaign();\n return parent::getCampaigns();\n }\n return array();\n }", "public function actionAllcampaigns()\n {\n $params = \\Yii::$app->request->getQueryParams();\n $defaultParams = array(\n 'status' => Campaign::STATUS_ACTIVE,\n 'offset' => 0,\n 'limit' => 0,\n 'sort' => '-id'\n );\n $user = $this->getUser();\n $params = array_merge($defaultParams, $params);\n /**\n * check params\n */\n // check status\n if (in_array($params['status'], array(Campaign::STATUS_ACTIVE, Campaign::STATUS_PENDING, Campaign::STATUS_DELETED)) == false) {\n $this->throwError(\"407\", \"status param is wrong\");\n }\n //check sort\n if (substr($params['sort'], 0, 1) == '-') {\n $params['sort'] = substr($params['sort'], 1);\n $orderAttr = 'DESC';\n } else {\n $orderAttr = 'ASC';\n }\n if (in_array($params['sort'], array('id', 'name', 'amountRaised', 'goalAmount')) == false) {\n $this->throwError(\"407\", \"sort prama is wrong\");\n }\n\n $sql = $user->getCampaigns($params['status'], false)->orderBy(sprintf('%s %s', $params['sort'], $orderAttr));\n if ($params['limit'] != 0) {\n $sql->offset($params['offset'])->limit($params['limit']);\n }\n $data = array();\n if ($sql->count() > 0) {\n foreach ($sql->all() as $capaign) {\n $data[] = array(\n 'id' => $capaign['id'],\n 'name' => $capaign['name'],\n 'description' => $capaign['description'],\n 'alias' => $capaign['alias'],\n 'amountRaised' => $capaign['amountRaised'],\n 'goalAmount' => $capaign['goalAmount'],\n 'type' => $capaign['type'],\n 'startDate' => $capaign['startDate'],\n 'endDate' => $capaign['endDate'],\n 'status' => $capaign['status'],\n 'numberOfDonations' => $capaign['numberOfDonations'],\n 'numberOfUniqueDonors' => $capaign['numberOfUniqueDonors'],\n 'date' => $capaign['date']\n );\n }\n }\n return $data;\n }", "public function getAll(){\n\t\t $campaignService = $this->api->getService('CampaignService');\n\t\t\n\t\t # Create selector.\n\t\t $selector = new \\Selector();\n\t\t $selector->fields = array('Id', 'Name', 'Impressions', 'Clicks', 'Cost', 'Ctr');\n\n\t\t $selector->ordering[] = new \\OrderBy('Name', 'ASCENDING');\n\t\t\n\t\t # Create paging controls.\n\t\t $selector->paging = new \\Paging(0, \\AdWordsConstants::RECOMMENDED_PAGE_SIZE);\n\t\t \n\t\t $selector->predicates[] = new \\Predicate('Status', 'IN', array('ACTIVE'));\n \t\t \n\t\t //$selector->predicates[] = new \\Predicate('Status', 'NOT_IN', array('PAUSED'));\n\t\t \n\n\t\t # Date Range\n\t\t $dateRange = new \\DateRange();\n\t\t $dateRange->min = date('Ymd', strtotime('-2 week'));\n\t\t $dateRange->max = date('Ymd', strtotime('-1 day'));\n\t\t $selector->dateRange = $dateRange;\n\t\t \n\t\t do {\n\t\t\t# Make the get request.\n\t\t\t$page = $campaignService->get($selector);\n\t\t\n\t\t\t# Display results.\n\t\t\tif (isset($page->entries)) {\n\t\t\t foreach ($page->entries as $campaign) {\n\t\t\t\t$campaigns_array[] = $campaign;\t\t\t\t\n\t\t\t }\n\t\t\t}\n\t\t\t# Advance the paging index.\n\t\t\t$selector->paging->startIndex += \\AdWordsConstants::RECOMMENDED_PAGE_SIZE;\n\t\t } while ($page->totalNumEntries > $selector->paging->startIndex);\n\t\t \n\t\n\t\treturn $campaigns_array;\n\t}", "public function listCampaigns($post){\n\t\t$api_ver =\t$this->api_ver;\n\t\t$account_id = $this->account_id;\n\t\t$api_key = $this->api_key;\n\t\t$user_id = $this->user_id;\n\t\t\n\t\t$fields = array(\n\t\t\t'API'\t\t\t\t=> $api_ver,\n\t\t\t'user_id'\t\t\t=> $user_id,\n\t\t\t'user_password'\t\t=> $api_key,\n\t\t\t'account_id'\t\t=> $account_id,\n\t\t\t'type'\t\t\t\t=> 'campaigns_list'\n\t\t);\n\t\tif(!empty($post['type_restrict'])) $fields['type_restrict'] = $post['type_restrict'];\n\t\tif(!empty($post['searchField'])) $fields['searchField'] = $post['searchField'];\n\t\tif(!empty($post['searchOper'])) $fields['searchOper'] = $post['searchOper'];\n\t\tif(!empty($post['searchValue'])) $fields['searchValue'] = $post['searchValue'];\n\t\tif(!empty($post['sortField'])) $fields['sortField'] = $post['sortField'];\n\t\tif(!empty($post['sortOrder'])) $fields['sortOrder'] = $post['sortOrder'];\n\t\tif(!empty($post['offset'])) $fields['offset'] = $post['offset'];\n\t\tif(!empty($post['length'])) $fields['length'] = $post['length'];\t\n\t\treturn $this->sendData($fields);\n\t}", "public function list_($params) {\n\t\t$request_url = \"{$this->url}&api_action=campaign_list&api_output={$this->output}&{$params}\";\n\t\t$response = parent::curl($request_url);\n\t\treturn $response;\n\t}", "public function indexAction()\n {\n $end = date(\"Y-m-d\"); // fetch live campaigns\n //$rangeQuery = array('conditions' => array('EndDate' => array('$gte' => $end)));\n $get_campaigns = MasterCampaign::find(\"EndDate >= $end\");\n $this->view->setVar('get_campaigns', $get_campaigns);\n }", "static function list_campaigns($state = 'all')\n {\n global $wpdb;\n // Select Query\n $query = 'SELECT id FROM ' . self::campaigns_table() . ';';\n $arr = array();\n $result = $wpdb->get_col($query);\n\n // Filtering\n if (!empty($result)) {\n for ($i = 0; $i < count($result); $i++) {\n $campaign = new wp_adpress_campaign((int)$result[$i]);\n switch ($state) {\n case 'active':\n case 'inactive':\n if ($campaign->state() === $state) {\n $arr[] = $campaign;\n }\n break;\n case 'all':\n default:\n $arr[] = $campaign;\n break;\n }\n }\n }\n return $arr;\n }", "public function index()\n {\n return AdvertisementCampaignResource::collection(AdvertisementCampaign::all());\n }", "public function campaignList()\n {\n $this->campaignListWithHttpInfo();\n }", "public function ajaxCampaignsListAction()\n {\n // Pas de layout pour cette action\n $this->_helper->layout->disableLayout();\n\n // Liste de statuts\n $statusList = array(\n Service_Api_Object_Campaign::STATUS_EDITING => Service_Api_Object_Campaign::STATUS_EDITING,\n Service_Api_Object_Campaign::STATUS_CONFIRMED => Service_Api_Object_Campaign::STATUS_RUNNING,\n Service_Api_Object_Campaign::STATUS_RUNNING => Service_Api_Object_Campaign::STATUS_RUNNING,\n Service_Api_Object_Campaign::STATUS_BUILD_DONE => Service_Api_Object_Campaign::STATUS_RUNNING,\n Service_Api_Object_Campaign::STATUS_BUILD_IN_PROGRESS => Service_Api_Object_Campaign::STATUS_RUNNING,\n Service_Api_Object_Campaign::STATUS_STOPPED => Service_Api_Object_Campaign::STATUS_STOPPED,\n Service_Api_Object_Campaign::STATUS_STOPPED_WHILE_RUNNING => Service_Api_Object_Campaign::STATUS_STOPPED,\n Service_Api_Object_Campaign::STATUS_CLOSED => Service_Api_Object_Campaign::STATUS_STOPPED,\n Service_Api_Object_Campaign::STATUS_CREATED => Service_Api_Object_Campaign::STATUS_CREATED,\n Service_Api_Object_Campaign::STATUS_CANCELLED => Service_Api_Object_Campaign::STATUS_CANCELLED,\n Service_Api_Object_Campaign::STATUS_CANCELED => Service_Api_Object_Campaign::STATUS_CANCELED,\n Service_Api_Object_Campaign::STATUS_INTERRUPTED => Service_Api_Object_Campaign::STATUS_INTERRUPTED,\n Service_Api_Object_Campaign::STATUS_ENDED => Service_Api_Object_Campaign::STATUS_ENDED\n );\n $this->view->statusList = $statusList;\n\n // Récupération des dernières campagnes\n $campaignFilter = new Service_Api_Filter_Campaign();\n $campaignFilter->limit = 10;\n $campaignFilter->sort = array(\n array('dateCreated', 'DESC')\n );\n $campaignFilter->properties = array(\n 'id',\n 'name',\n 'status',\n 'dateStart',\n 'contactListName', //Setté uniquement pour les campagnes confirmées\n 'contactListExtId',\n 'isAutomatic'\n );\n $campaignContainer = $this->_campaignService->campaignRead($campaignFilter);\n $campaigns = $campaignContainer->list;\n\n //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n // @TODO Deplacer ce traitement pour qu'il soit fait au rennomage de la liste\n // actuellement le nom de la liste n'est sauve qu'une fois la campagne confirmée\n // c'est pourquoi le code ci dessous se charge de recupere le nom de la liste des\n // campagne non confirmée\n //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n // Les derniers ids de listes contacts\n $contactListExtId = array();\n // Lecture des identifiants de campagnes pour les passer\n // dans le filtre de séléction de listes\n if (!empty($campaigns)) {\n foreach ($campaigns as $campaign) {\n /* @var $campaign Service_Api_Object_Campaign */\n if ($campaign->contactListExtId != null) {\n $contactListExtId[] = $campaign->contactListExtId;\n }\n }\n }\n // Lecture des listes de contacts des compagnes en edition\n $listIds = array_values(array_filter(array_unique($contactListExtId)));\n $lContainer = $this->_contactListService->listRead(new Mk_Contacts_ContactList_Filter($listIds));\n /* @var $lContainer Mk_Contacts_ContactList_Output_List */\n $lists = $lContainer->list;\n // Lecture de nom de listes de contacts pour les passer\n // à la vue d'affichage de listes de campagnes\n if (!empty($campaigns) && !empty($lists)) {\n foreach ($lists as $list) {\n $listNames[$list->id] = $list->name;\n }\n } else {\n $listNames = array();\n }\n\n if (!empty($campaigns)) {\n foreach ($campaigns as $campaign) {\n if (empty($campaign->contactListName)) {\n if (array_key_exists($campaign->contactListExtId, $listNames)) {\n $campaign->contactListName = $listNames[$campaign->contactListExtId];\n } else {\n $campaign->contactListName = \"-\";\n }\n }\n }\n }\n\n //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n $this->view->campaigns = $campaigns;\n }", "function view_all_campaign() \n { \n $data['admin_info'] = $this->admin_model->admin_profile_detail();\n $data['campaign'] = $this->admin_campaign_model->all_campaign(); \n\t$this->load->view('admin/view-all-campaign',$data); \n }", "public function actionCampaigns($list_uid, $subscriber_uid)\n {\n $list = $this->loadListModel($list_uid);\n $subscriber = $this->loadSubscriberModel($list->list_id, $subscriber_uid);\n $request = Yii::app()->request;\n\n $model = new CampaignDeliveryLog('search');\n $model->campaign_id = -1;\n $model->subscriber_id = (int)$subscriber->subscriber_id;\n $model->status = null;\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('list_subscribers', 'Subscriber campaigns'),\n 'pageHeading' => Yii::t('list_subscribers', 'Subscriber campaigns'),\n 'pageBreadcrumbs' => array(\n Yii::t('lists', 'Lists') => $this->createUrl('lists/index'),\n $list->name => $this->createUrl('lists/overview', array('list_uid' => $list->list_uid)),\n Yii::t('list_subscribers', 'Subscribers') => $this->createUrl('list_subscribers/index', array('list_uid' => $list->list_uid)),\n Yii::t('list_subscribers', 'Campaigns') => $this->createUrl('list_subscribers/campaigns', array('list_uid' => $list_uid, 'subscriber_uid' => $subscriber_uid)),\n Yii::t('app', 'View all')\n )\n ));\n\n $this->render('campaigns', compact('model', 'list', 'subscriber'));\n }", "public function index()\n {\n $this->authorize('view', $this->campaign);\n\n $campaigns = $this->api->get('campaigns');\n\n return view('admin.campaigns.index')->with('campaigns', $campaigns);\n }", "public function index()\n {\n $campaigns = \\Campaign::all();\n $this->layout->content = View::make('admin.campaign.index')\n ->with('active', 'campaign')->with('campaigns', $campaigns);\n }", "public function getLiveCampaigns()\r\n {\r\n // from the launch campaigns table\r\n // based on the condition the the time limit in days has not expired\r\n $adapter = $this->sql->getAdapter()->getDriver()->getConnection();\r\n \r\n $query = $adapter->execute(\"SELECT *, date_add(launch_date, INTERVAL campaign_length DAY)\r\n AS endData FROM launchcampaign WHERE (campaign_status = 1 AND draft_status = 1)\r\n AND date_add(launch_date, INTERVAL campaign_length DAY) >= CURDATE()\r\n ORDER BY endData DESC\");\r\n \r\n return $query;\r\n }", "protected function get_available_campaigns() {\n\n\t\t/**\n\t\t * cache the campaigns during the current request\n\t\t */\n\t\tif ( ! empty( $this->campaigns ) ) {\n\t\t\treturn $this->campaigns;\n\t\t}\n\n\t\t$filtered = array();\n\n\t\t$all_campaigns = tve_ult_get_campaigns( array(\n\t\t\t'get_designs' => true,\n\t\t\t'get_events' => false,\n\t\t\t'get_settings' => false,\n\t\t\t'get_logs' => false,\n\t\t\t'only_running' => true,\n\t\t) );;\n\n\t\tforeach ( $all_campaigns as $campaign ) {\n\n\t\t\t/**\n\t\t\t * if the schedule for the campaign applies (e.g. the current time is in the required interval, or a cookie exists)\n\t\t\t * we continue checking if the display settings apply\n\t\t\t *\n\t\t\t */\n\t\t\tif ( ! isset( $manager ) ) {\n\t\t\t\trequire_once TVE_Ult_Const::plugin_path( 'inc/classes/display_settings/class-thrive-display-settings-manager.php' );\n\t\t\t\t$manager = new Thrive_Ult_Display_Settings_Manager();\n\t\t\t\t$manager->load_dependencies();\n\t\t\t}\n\n\t\t\t$saved_ptions = new Thrive_Ult_Campaign_Options( $campaign->ID );\n\t\t\t$saved_ptions->initOptions();\n\n\t\t\t$available = $saved_ptions->displayCampaign();\n\n\t\t\t/**\n\t\t\t * a campaign is available if it has display settings and also has designs other than shortcodes\n\t\t\t */\n\t\t\tif ( $available && count( $campaign->designs ) ) {\n\t\t\t\t$other_than_shortcode = false;\n\t\t\t\tforeach ( $campaign->designs as $design ) {\n\t\t\t\t\tif ( $design['post_type'] !== TVE_Ult_Const::DESIGN_TYPE_SHORTCODE ) {\n\t\t\t\t\t\t$other_than_shortcode = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$available = $other_than_shortcode;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * TODO: why do we check here for shortcodes if the shortcodes campaigns are loaded separately ? see line 193: $shortcode_campaigns = TU_Shortcodes::get_campaigns();\n\t\t\t *\n\t\t\t * the campaign has no display settings and has no other designs than shortcode\n\t\t\t * but a shortcode design of campaign was used\n\t\t\t *\n\t\t\t * not sure why this check is made here\n\t\t\t */\n\t\t\tif ( ! $available && in_array( $campaign->ID, array_values( TU_Shortcodes::get_campaigns() ) ) ) {\n//\t\t\t\t$available = true;\n\t\t\t}\n\n\t\t\tif ( $available ) {\n\t\t\t\t$filtered [] = $campaign;\n\t\t\t}\n\t\t}\n\n\t\t$this->campaigns = $filtered;\n\n\t\treturn $filtered;\n\t}", "public function index()\n {\n // for member\n $user = auth()->user();\n if ($user->isMember()) {\n $campaigns = Campaign::where('created_by', $user->id)->orderBy('created_at', 'desc')->get();\n return view('member.campaigns/index', compact('campaigns'));\n }\n }", "public function getCampaigns()\n {\n if (is_null($this->campaigns)\n || !$this->campaignsUpToDate\n ) {\n $this->request->resetLoaded();\n $this->campaigns = $this->createCampaigns();\n $this->campaignsUpToDate = true;\n }\n\n return $this->campaigns;\n }", "public function getCampaignCategories()\n {\n return $this->execute(__FUNCTION__, new Mapper\\CampaignCategoryMapper());\n }", "public function actionCampaign()\n {\n $campaignAlias = \\Yii::$app->request->getQueryParam('campaignAlias');\n $user = $this->getUser();\n $campaign = Campaign::findOne(['userId' => $user->id, 'status' => Campaign::STATUS_ACTIVE, 'alias' => $campaignAlias]);\n $response = array();\n if (count($campaign) != 0) {\n $response = $campaign->toArray(['amountRaised', 'goalAmount', 'startDate', 'endDate']);\n $response['name'] = $campaign->name;\n $response['description'] = $campaign->description;\n $response['alias'] = $campaign->alias;\n $response['goalAmount'] = $campaign->goalAmount;\n $response['amountRaised'] = $campaign->amountRaised;\n $response['numberOfDonations'] = $campaign->getDonations()->count();\n $response['numberOfDonors'] = $campaign->getDonations()->count('DISTINCT email');\n// $donationsArray = [];\n// $donations = $campaign->getDonations()->all();\n// foreach ($donations as $donation) {\n// $donationsArray[] = $donation->toArray(['id', 'amount', 'nameFromForm', 'comments', 'paymentDate']);\n// }\n $response['donations'] = [];//;$donationsArray;\n }\n return $response;\n }", "public function getListCampaignsByGroupID(){\r\n $data = array();\r\n\r\n $customer_id = $this->session->getCustomerId();\r\n $group_id = $this->getGroupIdByCustomerSession($customer_id);\r\n if ($group_id > 0) {\r\n $currentDate = $this->_stdTimezone->date()->format('Y-m-d');\r\n\r\n $campaignModel = $this->_objectManager->create('Lof\\Affiliate\\Model\\CampaignAffiliate')->getCollection();\r\n $listCampaigns = $campaignModel->addFieldToFilter('is_active', 1)\r\n ->addStoreFilter($this->_storeManager->getStore())\r\n ->addFieldToFilter('from_date', array('or'=> array(\r\n 0 => array('date' => true, 'lteq' => $currentDate),\r\n 1 => array('is' => new \\Zend_Db_Expr('null')))\r\n ), 'left')\r\n ->addFieldToFilter('to_date', array('or'=> array(\r\n 0 => array('date' => true, 'gteq' => $currentDate),\r\n 1 => array('is' => new \\Zend_Db_Expr('null')))\r\n ), 'left');\r\n $listCampaigns->getSelect()\r\n ->joinLeft(\r\n [\r\n 'cat' => $this->_resourceModel->getTableName('lof_affiliate_campaign_group')],\r\n 'cat.campaign_id = main_table.campaign_id',\r\n [\r\n 'campaign_id' => 'campaign_id',\r\n ]\r\n )\r\n ->where('cat.group_id = (?)', $group_id);\r\n\r\n $value = $this->getConfig('general_settings/url_campaign_param_value');\r\n\r\n foreach ($listCampaigns as $campaign) {\r\n $data[] = array(\r\n 'name' => $campaign['name'],\r\n 'value' => ($value == 1) ? $campaign['tracking_code'] : $campaign['campaign_id'],\r\n );\r\n }\r\n }\r\n\r\n return $data;\r\n }", "public function getLeadCampaigns($id)\n {\n return $this->makeRequest('leads/'.$id.'/campaigns');\n }", "static function widget_list_campaigns($selected_campaign)\n {\n $html = '';\n $active = self::list_campaigns('active');\n foreach ($active as $campaign) {\n if ((int)$selected_campaign === $campaign->id) {\n $html .= '<option selected value=\"' . $campaign->id . '\">';\n } else {\n $html .= '<option value=\"' . $campaign->id . '\">';\n }\n $html .= $campaign->settings['name'];\n $html .= '</option>';\n }\n return $html;\n }" ]
[ "0.79385436", "0.7005961", "0.6943827", "0.6933367", "0.6868347", "0.68599284", "0.6851552", "0.68428046", "0.68342555", "0.6795393", "0.67696065", "0.6613317", "0.6515109", "0.646929", "0.6416107", "0.6390249", "0.6343171", "0.63311434", "0.63058007", "0.6293141", "0.61919767", "0.6127399", "0.61252886", "0.610765", "0.6089799", "0.6068859", "0.60687864", "0.602743", "0.60140246", "0.5980334" ]
0.735409
1
Loops over the predefined list of operators and their price lists and retreives the best price for the provided phone number. It should be said that this method makes no assumptions about whether the lists are sorted or not. In a real world scenario, we would probably load the lists from a database, and we could then store the prefixes as integers and ask the database to sort the price list for us as we request the lists. If we sorted the lists by prefix in descending order, we would be able to more quickly exit the loop that determines what the best matching prefix for an operator is. But sorting the lists in the application before we loop over them to find the best matching prefix would take more time than to simply loop over them once in an unordered format.
public function getLowestPrice($phoneNumber) { $operatorPrices = array_map(function($operator) use ($phoneNumber) { $cheapest = array_reduce($operator['entries'], function($result, $entry) use ($phoneNumber) { $prefixMatches = strpos($phoneNumber, $entry['prefix']) === 0; $prefixIsLonger = strlen($entry['prefix']) > strlen($result['prefix']); return $prefixMatches && $prefixIsLonger ? $entry : $result; }, ['prefix' => '']); return [ 'operator' => $operator['name'], 'price' => array_key_exists('price', $cheapest) ? $cheapest['price'] : null, 'prefix' => array_key_exists('prefix', $cheapest) ? $cheapest['prefix'] : null ]; }, $this->priceLists); return array_reduce($operatorPrices, function($result, $operator) { $resultHasPrice = is_numeric($result['price']); $operatorHasPrice = is_numeric($operator['price']); $operatorIsCheapest = $operator['price'] < $result['price']; return ((!$resultHasPrice && $operatorHasPrice) || ($operatorHasPrice && $operatorIsCheapest)) ? $operator : $result; }, $this->defaultResponse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function operator($phone)\n {\n $phone = self::phone($phone);\n $prefix = substr($phone, 0, 6);\n\n // load providers\n $carrier = self::imsi();\n $cc = json_decode(json_encode($carrier));\n // Providers\n $Safaricom = $cc->kenya->carriers->Safaricom;\n $Airtel = $cc->kenya->carriers->Airtel;\n $Telkom = $cc->kenya->carriers->Telkom;\n $Equitel = $cc->kenya->carriers->Equitel;\n $Faiba4G = $cc->kenya->carriers->Faiba4G;\n $Eferio = $cc->kenya->carriers->Eferio;\n $Sema_Mobile = $cc->kenya->carriers->Sema_Mobile;\n $Homelands_media = $cc->kenya->carriers->Homelands_media;\n\n $operators = [\n 'safaricom' => $Safaricom,\n 'airtel' => $Airtel,\n 'telkom' => $Telkom,\n 'equitel' => $Equitel,\n 'faiba4g' => $Faiba4G,\n 'Eferio' => $Eferio,\n 'Sema_Mobile' => $Sema_Mobile,\n 'Homelands_media' => $Homelands_media,\n ];\n\n /**\n * could possibly use an array intersect instead of a foreach loop but not tested\n *\n *\n * $result = array_intersect($operators, [$prefix]);\n *\n * if (!empty($result)) {\n * return key($result);\n * }\n */\n\n\n foreach ($operators as $key => $value) {\n if (in_array($prefix, $value)) {\n return $key;\n }\n }\n\n return 'Invalid Operator';\n\n }", "function findBestNum($listCombiIndex, $num1){\n\t$bestNum = 0;\n\t// On initialise l'écart minimum avec la valeur négative du nombre d'origine\n\t$ecartMin = -$num1;\n\t// On parcours les combinaisons possibles\n\tforeach ($listCombiIndex as $combi) {\n\t\t$combiNum = intval($combi);\n\t\t// Si la combinaison est différente du nombre d'origine\n\t\tif ($combiNum != $num1) {\n\t\t\t// On calcul l'écart entre la combinaison et le nombre d'origine\n\t\t\t$ecart = $num1-$combiNum;\n\t\t\t// Si l'écart est inférieur à zéro et supérieur à l'écart minimum\n\t\t\tif ($ecart < 0 && $ecart > $ecartMin) {\n\t\t\t\t$ecartMin = $ecart;\n\t\t\t\t$bestNum = $combiNum;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\treturn $bestNum;\n}", "function simpleTernarySearch($itemList) {\n\t$left = 0;\n $right = count($itemList) - 1;\n\t$found = false;\n\t$precision = 3;\n\n\twhile ($left <= $right) {\n\t\tif (($right - $left) < $precision) { //Here 3 is the smallest range to divide the left and right value\n\t\t\t$found = true;\n\t\t\tbreak;\n\t\t}\n\n\t\t$leftThird = $left + floor(($right - $left) / 3);\n\t $rightThird = $right - floor(($right - $left) / 3);\n\n\t\t//To find the minimum in an unimodal function change the following comparison to >\n\t\tif ($itemList[$leftThird] < $itemList[$rightThird])\n\t\t\t$left = $leftThird;\n\t\telse\n\t\t\t$right = $rightThird;\n\t}\n\n\treturn floor(($left + $right) / 2);\n}", "function max_pair(flist $zipped_square_score) : flist {\n $compare = function(flist $square_score, flist $acc) : flist {\n $score = $square_score->list()->element();\n $acc_score = $acc->list()->element();\n\n if ($score > $acc_score) return $square_score;\n return $acc;\n };\n return fold_l(fl2list(-1, PHP_INT_MIN), $compare, $zipped_square_score);\n}", "public function syncPriceLists()\n {\n $response = $this->makeRequest('GET', 'PRICELIST?$expand=PLISTCUSTOMERS_SUBFORM,PARTPRICE2_SUBFORM', [], $this->option('log_pricelist_priority', true));\n\n // check response status\n if ($response['status']) {\n\n // allow multisite\n $blog_id = get_current_blog_id();\n\n // price lists table\n $table = $GLOBALS['wpdb']->prefix . 'p18a_pricelists';\n\n // delete all existing data from price list table\n $GLOBALS['wpdb']->query('DELETE FROM ' . $table);\n\n // decode raw response\n $data = json_decode($response['body_raw'], true);\n\n $priceList = [];\n\n if (isset($data['value'])) {\n\n foreach($data['value'] as $list)\n {\n /*\n\n Assign user to price list, no needed for now\n\n // update customers price list\n foreach($list['PLISTCUSTOMERS_SUBFORM'] as $customer) {\n update_user_meta($customer['CUSTNAME'], '_priority_price_list', $list['PLNAME']);\n }\n */\n\n // products price lists\n foreach($list['PARTPRICE2_SUBFORM'] as $product) {\n\n\n $GLOBALS['wpdb']->insert($table, [\n 'product_sku' => $product['PARTNAME'],\n 'price_list_code' => $list['PLNAME'],\n 'price_list_name' => $list['PLDES'],\n 'price_list_currency' => $list['CODE'],\n 'price_list_price' => $product['PRICE'],\n 'blog_id' => $blog_id\n ]);\n\n }\n\n }\n\n // add timestamp\n $this->updateOption('pricelist_priority_update', time());\n\n }\n\n } else {\n /**\n * t149\n */\n $this->sendEmailError(\n $this->option('email_error_sync_pricelist_priority'),\n 'Error Sync Price Lists Priority',\n $response['body']\n );\n\n }\n\n }", "public function get_standard_mobile_number($countries,$networks,$number=''){\n $valid_number='';\n if(empty($number)){return false;}\n $number=$this->clean_string($number,array(' ','-',',','+'));\n $number=filter_var($number, FILTER_SANITIZE_NUMBER_FLOAT);\n $length=strlen($number);\n\n foreach($countries as $country){\n if(!empty($valid_number)){break;}\n if(strtolower($country['country_code'])=='pk'){\n foreach($networks as $network){\n if(!empty($valid_number)){break;}\n if($network['country_id']==$country['mid']){\n $network_code=substr($network['dial_code'],2,3);\n $cn_dial_code=$network['dial_code'];\n switch ($length){\n case 10 : { \n if(substr($number, 0, 2)==$network_code){\n $valid_number=$cn_dial_code.substr($number, 2, $length);\n } \n }break;\n case 11 : { \n if(substr($number, 0, 3)=='0'.$network_code){ \n $valid_number=$cn_dial_code.substr($number, 3, $length);\n } \n }break;\n case 12 : { \n if(substr($number, 0, 4)=='92'.$network_code){ \n $valid_number=$cn_dial_code.substr($number, 4, $length);\n } \n }break;\n case 13 : { \n if(substr($number, 0, 5)=='+92'.$network_code){ \n $valid_number=$cn_dial_code.substr($number, 5, $length);\n } \n }break;\n }\n }\n }\n }else{\n foreach($networks as $network){\n if(!empty($valid_number)){break;}\n if($network['country_id']==$country['mid']){\n $network_code=substr($network['dial_code'],2,3);\n $cn_dial_code=$network['dial_code'];\n if(substr($number, 0, strlen($network['dial_code']))==$network['dial_code'] && $length==$network['number_length']){\n $valid_number=$cn_dial_code.substr($number, strlen($network['dial_code'])+1, $length);\n } \n }\n } \n }\n }\n return $valid_number;\n }", "function get_phone() {\n $ph = str_split(INFO_PHONE);\n $r1 = '';\n $r2 = '';\n $cc = false;\n\n foreach ($ph as $chr) {\n switch ($chr) {\n case '(':\n $cc = true;\n break;\n case ')':\n $cc = false;\n break;\n case '+': case '0': case '1': case '2': case '3':\n case '4': case '5': case '6': case '7': case '8':\n case '9':\n if ($cc) $r1 .= _PLW_NUMBERS[$chr];\n else $r2 .= _PLW_NUMBERS[$chr];\n break;\n default:\n if ($cc) $r1 .= $chr;\n else $r2 .= $chr;\n }\n }\n if (!$r1)\n $r1 = _PLW_NUMBERS['+'] . _PLW_NUMBERS['3'] . _PLW_NUMBERS['7'] . _PLW_NUMBERS['2'];\n\n return array($r1, $r2);\n}", "function extractPrice($displayPrice, &$loPrice, &$hiPrice) {\n // Checks for things like 'K' for thousand and 'M' for million.\n $nMatches = preg_match_all(\"/[\\d\\,\\.]+(k|M| Million)?/i\", $displayPrice, $matches);\n if ($nMatches == 0) {\n $loPrice = 0;\n $hiPrice = 0;\n return;\n }\n $matches = $matches[0];\n // process matches - convert strings to numbers:\n foreach ($matches as $key => $price) {\n $price = strtolower($price);\n if (strpos($price, ' million') !== false) {\n $price = str_replace(' million', '', $price);\n $mult = 1000000;\n }\n else {\n if (strpos($price, 'k') !== false) {\n $price = str_replace('k', '', $price);\n $mult = 1000;\n }\n else {\n if (strpos($price, 'm') !== false) {\n $price = str_replace('m', '', $price);\n $mult = 1000000;\n }\n else {\n $mult = 1;\n }\n }\n }\n $matches[$key] = strtonum($price) * $mult;\n }\n if ($nMatches == 1) {\n $loPrice = $matches[0];\n $hiPrice = 0;\n }\n else {\n // multiply first number until it's the same order of magnitude:\n $loPrice = $matches[0];\n $hiPrice = $matches[1];\n while ($loPrice < $hiPrice / 10) {\n $loPrice *= 10;\n }\n }\n}", "function findMatches($accepted, $available) {\n $matches = array();\n $any = false;\n foreach ($available as $availableLocale => $availableName) {\n foreach ($accepted as $acceptedQuality => $acceptedLocale) {\n $acceptedQuality = floatval($acceptedQuality);\n if ($acceptedQuality === 0.0) continue;\n if ($acceptedLocale === '*') {\n $any = true;\n }\n $matchingGrade = matchLanguage($acceptedLocale, $availableLocale);\n if ($matchingGrade > 0) {\n $q = ($acceptedQuality * $matchingGrade);\n if (!array_key_exists($availableLocale, $matches) || $matches[$availableLocale] < $q) {\n $matches[$availableLocale] = $q;\n }\n }\n }\n }\n if (count($matches) === 0 && $any) {\n $matches = $available;\n }\n arsort($matches);\n return $matches;\n}", "private function getResultsForLeaf(&$leaf, &$wordarr)\n {\n // no wildcards\n if ($leaf->getType() == SQEXACT && !$this->phonetic) {\n return isset($wordarr[$leaf->label()]) ? $wordarr[$leaf->label()] : array();\n }\n\n //some wildcards or phonetic\n // Front or Both\n $keys = $search_keys = array_keys($wordarr);\n $front = $end = array();\n $label = $leaf->label();\n\n //phonetic search\n if ($this->phonetic) {\n $label = soundex($leaf->label());\n $search_keys = array_map('soundex', $keys);\n }\n\n\n if ($leaf->getType() == SQFRONT || $leaf->getType() == SQBOTH) {\n $front = preg_grep('/(.+)' . $label . '/', $search_keys);\n if ($this->phonetic)\n $front = array_values_by_keys($keys, array_keys($front));\n } // End or Both\n elseif ($leaf->getType() == SQEND || $leaf->getType() == SQBOTH) {\n $end = preg_grep('/' . $label . '(.+)/', $search_keys);\n if ($this->phonetic)\n $end = array_values_by_keys($keys, array_keys($end));\n } // \"Exact\" phonetic\n else {\n $front = preg_grep('/' . $label . '/', $search_keys);\n if ($this->phonetic)\n $front = array_values_by_keys($keys, array_keys($front));\n }\n\n $keys = array_unique(array_merge($front, $end), SORT_STRING);\n\n // fucntion to compare found-data-arrays\n $cmp = create_function('$v1, $v2', '\n if ($v1[\\'id\\'] > $v2[\\'id\\']) return -1;\n if ($v1[\\'id\\'] == $v2[\\'id\\']) return 0;\n return 1;');\n\n // fucntion to compare found-data-arrays and update rank\n $cmp_newrank = create_function('&$v1, $v2', '\n if ($v1[\\'id\\'] > $v2[\\'id\\'])\n return -1;\n if ($v1[\\'id\\'] == $v2[\\'id\\']) {\n $v1[\\'rank\\'] = $v1[\\'rank\\']+$v2[\\'rank\\'];\n return 0;\n }\n return 1;');\n\n //compare and add rank\n $cmp_plus = create_function('&$v1, $v2', '\n return compare_update_rank ($v1, $v2, create_function(\\'$v1, $v2\\', \\'return $v1+$v2;\\'));');\n\n // get data for matching keys\n $return_array = array();\n foreach ($keys as $key) {\n $data = array_values($wordarr[$key]);\n $return_array = array_real_merge($return_array, $data, $cmp_plus, 'compare_found_data');\n }\n\n // return found data\n return $return_array;\n }", "private static function getSuggestion(array $items, $value): ?string\n\t{\n\t\t$best = null;\n\t\t$min = (strlen($value) / 4 + 1) * 10 + .1;\n\t\tforeach (array_unique($items, SORT_REGULAR) as $item) {\n\t\t\t$item = is_object($item) ? $item->getName() : $item;\n\t\t\tif (($len = levenshtein($item, $value, 10, 11, 10)) > 0 && $len < $min) {\n\t\t\t\t$min = $len;\n\t\t\t\t$best = $item;\n\t\t\t}\n\t\t}\n\n\t\treturn $best;\n\t}", "public function get_phones()\n\t{\n\t $this->db->select('*');\n\t $this->db->order_by('price','DESC');\n\t $query = $this->db->get('phones');\n\t return $query->result();\n\n\t}", "public function getClosest($prefix);", "function nextItem($str, $p, $low, $high, &$DP) {\n $lower_sum = 0; $higher_sum = 0; $len = strlen($str);\n for ($i = 0; $i < $len; $i ++) if ($str[$i] == '1') {\n $lower_sum += $low[$i]; $higher_sum += $high[$i];\n }\n // reach the max digit\n if ($len == count($low)) { $DP[$str] = min($higher_sum, $p); return $DP[$str]; }\n // no necessary to continue\n $l = $low[$len]; $h = $high[$len]; dd($l.', '.$h, 'range of next ['.$str.']');\n if ($lower_sum + $l <= $p && $higher_sum + $h >= $p) { // hit\n $DP[$str.'*'] = $p; dd($str, 'hit'); return $p;\n }\n // check next digit\n $r1 = ($lower_sum + $l > $p) ? false : nextItem($str.'1', $p, $low, $high, $DP); // with\n if ($r1 !== false && $r1 == $p) { $DP[$str] = $p; dd($str, 'with'); return $p; }\n $r2 = nextItem($str.'0', $p, $low, $high, $DP); // without\n $DP[$str] = $r1 === false ? $r2 : max($r1, $r2); dd('with or without ['.$str.']');\n return $DP[$str];\n}", "function sort_service_list($service_list)\n{\n\t$counter = 0;\n //rank of service list in order\n $orders = array(24,15,9,26,11,21,25,1,6,4,20,19,29,8,16,27,3,9,17,18,2,378,10,7,375,5,377,376,12,13,22,23,28,30,31,32);\n\n foreach($orders as $order){\n \t\tforeach($service_list as $service){\n \t\t\tif($service->service_code == $order){\n \t\techo \"service_list_array[\".$counter.\"]\".\"=[\\\"\".$service->service_code.\"\\\",\\\"\".str_replace(\"_\", \" \", $service->service_name).\"\\\",\\\"\".str_replace('\"', '\\\"', trim($service->description)) .\"\\\"];\".\"\\n\"; break;\n \t}\n }\n $counter++;\n }\n\n}", "function lowest($arr, $tickerList, $case)\n{\n $result = [];\n $max = max(array_column($arr, $case));\n $result[0] = $max;\n $maxKeys = array_keys(array_column($arr, $case), $max);\n $i = 1;\n foreach ($maxKeys as $va) {\n $result[$i] = $tickerList[$va][\"ticker\"];\n $i++;\n }\n return $result;\n}", "public function evaluateArithmeticExpression(array $operands, array $operators)\n {\n $result = 0;\n //print_r($operands);\n //print_r($operators);\n if (empty($operators)) {\n return $operands[0];\n }\n while (!empty($operators)) {\n $elementKey = array_search(\"Of\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n $nextVal = $this->getNext($operands, $elementKey);\n $result = $operands[$elementKey] * $nextVal;\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n if (array_search(\"Of\", $operators)) {\n continue;\n }\n }\n $elementKey = array_search(\"^\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n //echo '<br />^';\n $nextVal = $this->getNext($operands, $elementKey);\n $result = pow($operands[$elementKey], $nextVal);\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n //print_r($operands);\n //print_r($operators);\n if (array_search(\"^\", $operators)) {\n continue;\n }\n }\n $elementKey = array_search(\"/\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n $nextVal = $this->getNext($operands, $elementKey);\n $result = $operands[$elementKey] / $nextVal;\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n //print_r($operands);\n //print_r($operators);\n if (array_search(\"/\", $operators)) {\n continue;\n }\n }\n $elementKey = array_search(\"*\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n $nextVal = $this->getNext($operands, $elementKey);\n $result = $operands[$elementKey] * $nextVal;\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n if (array_search(\"*\", $operators)) {\n continue;\n }\n }\n //var_dump($elementKey);\n $elementKey = array_search(\"+\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n $nextVal = $this->getNext($operands, $elementKey);\n $result = $operands[$elementKey] + $nextVal;\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n if (array_search(\"+\", $operators)) {\n continue;\n }\n }\n $elementKey = array_search(\"-\", $operators);\n //var_dump($elementKey);\n if ($elementKey !== FALSE) {\n $nextVal = $this->getNext($operands, $elementKey);\n $result = $operands[$elementKey] - $nextVal;\n $nextKey = array_search($nextVal, $operands);\n $operands[$nextKey] = $result;\n unset($operands[$elementKey]);\n unset($operators[$elementKey]);\n if (array_search(\"-\", $operators)) {\n continue;\n }\n }\n }\n return $result;\n }", "public function xorsearch_list_int($input_list, $max_candidate) \n {\n // Top candidate list, and min point to be in the list\n $judge = new StringFreqJudge();\n $top_list = Array(); // XorByteItem[]\n\n // Error check the size\n if (empty($max_candidate) || $max_candidate < 3) {\n $max_candidate = 3;\n }\n\n // For each string XOR with each integer \n foreach ($input_list as $input_str)\n {\n foreach (range(0,255) as $key)\n {\n // Convert decimal to hex value(string) and pack() to binary format.\n // * http://stackoverflow.com/questions/5799399/php5-pack-is-broken-on-x84-64-env\n $bin_key = pack(\"H*\", dechex($key)); // decbin()\n $bin_out = $this->xor_str_int($input_str, $bin_key);\n $output_str = implode(unpack(\"H*\", $bin_out)); // bindec()\n\n // If contain non-printable chars, skip it\n $matches = array();\n if (preg_match_all(\"/[\\x01-\\x1F\\x7F-\\xFF]/\", $bin_out, $matches) > 0) {\n continue;\n }\n\n // Compute the relevant point, and skip if not matching the standard.\n $point = $judge->compute_point($bin_out);\n\n // Create the item\n $item = new XorByteItem();\n $item->input_str = $input_str;\n $item->xor_byte = $key;\n $item->output_str = $output_str;\n $item->point = $point;\n\n // Update top_list\n $top_list = $this->add_to_top_list($top_list, $max_candidate, $item);\n }\n\n }\n\n return $top_list;\n }", "private function findBest($elements,$node,$grammar){\n\t \tforeach ($elements as $element) {\n\t \t\t$parent = $element;\n\t \t\twhile($parent->getNodeType()->getName() != $node->getNodeType()->getName()){\n\t \t\t\t\t$parent = $parent->getParent();\n\t \t\t}\n\t \t\tif($parent == $node)\n\t \t\t\treturn $element;\n\t \t}\n\t \treturn $elements->get(0);\n\t }", "private function getProtocolChoices($procName=NULL\r\n ,$sFirstElementText=''\r\n ,$cluesmap=NULL)\r\n {\r\n try\r\n {\r\n $kwmap = $this->getKeywordMap();\r\n $protocol_code_map = $this->getAllProtocolCodeMap();\r\n\r\n //Get all the protocols from the library\r\n $result = db_select('raptor_protocol_lib','p')\r\n ->fields('p')\r\n ->condition('p.active_yn',1,'=')\r\n ->orderBy('modality_abbr', 'ASC')\r\n ->orderBy('name', 'ASC')\r\n ->execute();\r\n $shortcount = 0;\r\n $scoretrack = array();\r\n $aShortList = array();\r\n $aCombinedList = array();\r\n while($record = $result->fetchAssoc()) \r\n {\r\n $categoryname = trim($record['modality_abbr']).' List';\r\n $longname = $record['name'];\r\n $psn = $record['protocol_shortname'];\r\n if($categoryname == ' List')\r\n {\r\n //Put it on the shortlist\r\n $categoryname = 'Short List';\r\n }\r\n $oC = new \\raptor\\FormControlChoiceItem(\r\n $longname\r\n ,$psn\r\n ,$categoryname\r\n ,FALSE);\r\n $aCombinedList[] = $oC;\r\n\r\n if($categoryname != 'Short List')\r\n {\r\n //Does this also belong on the shortlist?\r\n $modality_abbr = $record['modality_abbr'];\r\n $contrast_yn = $record['contrast_yn'];\r\n $scoredetails = $this->m_oMOP->getProtocolMatchScore($cluesmap\r\n , $psn\r\n , $longname\r\n , $modality_abbr\r\n , $contrast_yn\r\n , $kwmap\r\n , $protocol_code_map); \r\n $matchscore = $scoredetails['score'];\r\n if($matchscore > 0)\r\n {\r\n //Good enough on contrast check\r\n $categoryname = 'Short List';\r\n $oC = new \\raptor\\FormControlChoiceItem(\r\n $longname\r\n ,$psn\r\n ,$categoryname\r\n ,FALSE);\r\n $oC->nScore = $matchscore;\r\n $aShortList[$matchscore][] = $oC;\r\n if($matchscore > 1)\r\n {\r\n if(!isset($scoretrack[$matchscore]))\r\n {\r\n $scoretrack[$matchscore] = 1;\r\n } else {\r\n $scoretrack[$matchscore] = $scoretrack[$matchscore] + 1;\r\n }\r\n $shortcount++;\r\n }\r\n }\r\n }\r\n }\r\n $aFinalList = array();\r\n $oC = new \\raptor\\FormControlChoiceItem(\r\n $sFirstElementText\r\n ,NULL\r\n ,NULL\r\n ,FALSE);\r\n $aFinalList[] = $oC;\r\n krsort($aShortList);\r\n if($shortcount > 0)\r\n {\r\n krsort($scoretrack);\r\n //drupal_set_message('SCORE TRACK>>>'.print_r($scoretrack,TRUE));\r\n $items = 0;\r\n $minscore = 2; //Default min score\r\n foreach($scoretrack as $score=>$count)\r\n {\r\n $items += $count;\r\n if($items >= PROTOCOL_SHORTLIST_MIN_SIZE)\r\n {\r\n //Thats enough for our shortlist.\r\n $minscore = $score;\r\n break;\r\n }\r\n }\r\n //drupal_set_message('$minscore>>>'.$minscore);\r\n } else {\r\n //Put them all in.\r\n $minscore = 0;\r\n }\r\n foreach($aShortList as $k=>$list)\r\n {\r\n foreach($list as $oC)\r\n {\r\n if($oC->nScore >= $minscore)\r\n {\r\n $aFinalList[] = $oC;\r\n }\r\n }\r\n }\r\n foreach($aCombinedList as $oC)\r\n {\r\n $aFinalList[] = $oC;\r\n }\r\n\r\n return $aFinalList;\r\n } catch (\\Exception $ex) {\r\n error_log(\"FAILED in getProtocolChoices because $ex\");\r\n throw $ex;\r\n }\r\n }", "public static function getSuggestion(array $items, string $value): ?string\n\t{\n\t\t$best = null;\n\t\t$min = (strlen($value) / 4 + 1) * 10 + .1;\n\t\tforeach (array_unique($items) as $item) {\n\t\t\tif (($len = levenshtein($item, $value, 10, 11, 10)) > 0 && $len < $min) {\n\t\t\t\t$min = $len;\n\t\t\t\t$best = $item;\n\t\t\t}\n\t\t}\n\n\t\treturn $best;\n\t}", "public function search_orderlist($orderlist, $itemstatus = 'P'){\n\t\t$ret = array();\n\t\tif (isset($_SESSION['authuser'])){\n\t\t\tif(isset($orderlist)){\n\t\t\t\t$orders = $this->seller->getDemoAPI('orders','sellersuite='.$this->authuser->suite.'&itemstatus='.$itemstatus.'&limit=100&pageoffset=1');\n\t\t\t\tif(!empty($orders['orderlist'])){\n\t\t\t\t\tforeach ($orders['orderlist'] as $orderK => $orderV) {\n\t\t\t\t\t\tif ($orderlist == $orderV['txnRef']){\n\t\t\t\t\t\t\t$item_sla = $this->getItemSla($orderV['itmelist'], $orderV['createTime']);\n\t\t\t\t\t\t\t$order_sla = '';\n\t\t\t\t\t\t\tif (count($item_sla)>1){\n\t\t\t\t\t\t\t\t$order_sla = max($item_sla);\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$order_sla = array_pop($item_sla);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($order_sla == 'N/A'){\n\t\t\t\t\t\t\t\t$orderV['order_sla_days'] = 'N/A';\n\t\t\t\t\t\t\t\t$orderV['order_sla_remaining'] = 'N/A';\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$remaining = $order_sla - time();\n\t\t\t\t\t\t\t\t$days_remaining = round($remaining / 86400);\n\t\t\t\t\t\t\t\t$hours_remaining = floor(($remaining % 86400) / 3600);\n\t\t\t\t\t\t\t\t$orderV['order_sla_remaining'] = $days_remaining;\n\t\t\t\t\t\t\t\t$orderV['order_sla_days'] = ($order_sla - strtotime($orderV['createTime'])) / 86400; \n\t\t\t\t\t\t\t\t$orderV['pickupTime'] = date('d F Y | g:i:s A',strtotime($orderV['createTime'].' +'.$orderV['order_sla_days'].' days'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$orderV['createTime'] = date('d F Y | g:i:s A',strtotime($orderV['createTime']));\n\t\t\t\t\t\t\t$ret = $orderV;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$ret['status'] = false;\n\t\t\t\t\t\t\t$ret['msg'] = 'Orderlist not found.';\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\telse{\n\t\t\t\t$ret['status'] = false;\n\t\t\t\t$ret['msg'] = 'No orderlist specified.';\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$ret['status'] = false;\n\t\t\t$ret['msg'] = 'No suite found; Please login.';\n\t\t}\n\t\treturn $ret;\n\t}", "protected function operatorCombinationsWithoutSpaces()\n\t{\n\t\t$return = array();\n\n\t\t$operator_combinations = array(\n\t\t\t'==='\t=> array(array('OPERATOR', '=='),\tarray('MISC', '=')),\n\n\t\t\t/**\n\t\t\t * The following array elements were generated with this code:\n\t\t\t *\n\t\t\t * $valid_operators = array(\n\t\t\t * \t'||', '&&', '**',\n\t\t\t * \t'==', '!=', '<=', '>=', '<>', '<', '>',\n\t\t\t * \t'%', '+', '-', '*', '/',\n\t\t\t * \t'.', '!', '^',\n\t\t\t *\t'^=', '*=', '$=', '~'\n\t\t\t * );\n *\n\t\t\t * // Build out some combinations\n\t\t\t * foreach ($valid_operators as $first)\n\t\t\t * {\n\t\t\t * \tforeach ($valid_operators as $second)\n\t\t\t * \t{\n\t\t\t * \t\t$operator = $first.$second;\n *\n\t\t\t * \t\tif (in_array($operator, $valid_operators) ||\n\t\t\t * \t\t\tisset($invalid_operators[$operator]))\n\t\t\t * \t\t{\n\t\t\t * \t\t\tcontinue;\n\t\t\t * \t\t}\n *\n\t\t\t * \t\tif ($operator == '--')\n\t\t\t * \t\t{\n\t\t\t * \t\t\tcontinue;\n\t\t\t * \t\t}\n *\n\t\t\t * \t\tif ($first == '.' || $second == '.')\n\t\t\t * \t\t{\n\t\t\t * \t\t\tcontinue;\n\t\t\t * \t\t}\n *\n\t\t\t * \t\t// Handle the case where first.second create a valid\n\t\t\t * \t\t// operator in the first half: ! + == => !== => OP(!=) MISC(=)\n\t\t\t * \t\tif (in_array($first.$second[0], $valid_operators))\n\t\t\t * \t\t{\n\t\t\t * \t\t\t$first = $first.$second[0];\n\t\t\t * \t\t\t$second = substr($second, 1);\n\t\t\t * \t\t}\n *\n\t\t\t * \t\t$token = (in_array($second, $valid_operators)) ? 'OPERATOR' : 'MISC';\n *\n\t\t\t * \t\tprintf(\"'%s'\\t=> array(array('OPERATOR', '%s'),\\tarray('%s', '%s')),\\n\", $operator, $first, $token, $second);\n\t\t\t * \t}\n\t\t\t * \tprint \"\\n\";\n\t\t\t * }\n\t\t\t */\n\n\t\t\t'||||'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '||')),\n\t\t\t'||&&'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '&&')),\n\t\t\t'||**'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '**')),\n\t\t\t'||=='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '==')),\n\t\t\t'||!='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '!=')),\n\t\t\t'||<='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '<=')),\n\t\t\t'||>='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '>=')),\n\t\t\t'||<>'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '<>')),\n\t\t\t'||<'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '<')),\n\t\t\t'||>'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '>')),\n\t\t\t'||%'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '%')),\n\t\t\t'||+'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '+')),\n\t\t\t'||-'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '-')),\n\t\t\t'||*'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '*')),\n\t\t\t'||/'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '/')),\n\t\t\t'||!'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '!')),\n\t\t\t'||^'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '^')),\n\t\t\t'||^='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '^=')),\n\t\t\t'||*='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '*=')),\n\t\t\t'||$='\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '$=')),\n\t\t\t'||~'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '~')),\n\n\t\t\t'&&||'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '||')),\n\t\t\t'&&&&'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '&&')),\n\t\t\t'&&**'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '**')),\n\t\t\t'&&=='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '==')),\n\t\t\t'&&!='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '!=')),\n\t\t\t'&&<='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '<=')),\n\t\t\t'&&>='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '>=')),\n\t\t\t'&&<>'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '<>')),\n\t\t\t'&&<'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '<')),\n\t\t\t'&&>'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '>')),\n\t\t\t'&&%'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '%')),\n\t\t\t'&&+'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '+')),\n\t\t\t'&&-'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '-')),\n\t\t\t'&&*'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '*')),\n\t\t\t'&&/'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '/')),\n\t\t\t'&&!'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '!')),\n\t\t\t'&&^'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '^')),\n\t\t\t'&&^='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '^=')),\n\t\t\t'&&*='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '*=')),\n\t\t\t'&&$='\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '$=')),\n\t\t\t'&&~'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '~')),\n\n\t\t\t'**||'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '||')),\n\t\t\t'**&&'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '&&')),\n\t\t\t'****'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '**')),\n\t\t\t'**=='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '==')),\n\t\t\t'**!='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '!=')),\n\t\t\t'**<='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<=')),\n\t\t\t'**>='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '>=')),\n\t\t\t'**<>'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<>')),\n\t\t\t'**<'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<')),\n\t\t\t'**>'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '>')),\n\t\t\t'**%'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '%')),\n\t\t\t'**+'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '+')),\n\t\t\t'**-'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '-')),\n\t\t\t'***'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '*')),\n\t\t\t'**/'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '/')),\n\t\t\t'**!'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '!')),\n\t\t\t'**^'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '^')),\n\t\t\t'**^='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '^=')),\n\t\t\t'***='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '*=')),\n\t\t\t'**$='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '$=')),\n\t\t\t'**~'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '~')),\n\n\t\t\t'==||'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '||')),\n\t\t\t'==&&'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '&&')),\n\t\t\t'==**'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '**')),\n\t\t\t'===='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '==')),\n\t\t\t'==!='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '!=')),\n\t\t\t'==<='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '<=')),\n\t\t\t'==>='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '>=')),\n\t\t\t'==<>'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '<>')),\n\t\t\t'==<'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '<')),\n\t\t\t'==>'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '>')),\n\t\t\t'==%'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '%')),\n\t\t\t'==+'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '+')),\n\t\t\t'==-'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '-')),\n\t\t\t'==*'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '*')),\n\t\t\t'==/'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '/')),\n\t\t\t'==!'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '!')),\n\t\t\t'==^'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '^')),\n\t\t\t'==^='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '^=')),\n\t\t\t'==*='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '*=')),\n\t\t\t'==$='\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '$=')),\n\t\t\t'==~'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '~')),\n\n\t\t\t'!=||'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '||')),\n\t\t\t'!=&&'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '&&')),\n\t\t\t'!=**'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '**')),\n\t\t\t'!==='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '==')),\n\t\t\t'!=!='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '!=')),\n\t\t\t'!=<='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<=')),\n\t\t\t'!=>='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '>=')),\n\t\t\t'!=<>'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<>')),\n\t\t\t'!=<'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<')),\n\t\t\t'!=>'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '>')),\n\t\t\t'!=%'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '%')),\n\t\t\t'!=+'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '+')),\n\t\t\t'!=-'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '-')),\n\t\t\t'!=*'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '*')),\n\t\t\t'!=/'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '/')),\n\t\t\t'!=!'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '!')),\n\t\t\t'!=^'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '^')),\n\t\t\t'!=^='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '^=')),\n\t\t\t'!=*='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '*=')),\n\t\t\t'!=$='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '$=')),\n\t\t\t'!=~'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '~')),\n\n\t\t\t'<=||'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '||')),\n\t\t\t'<=&&'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '&&')),\n\t\t\t'<=**'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '**')),\n\t\t\t'<==='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '==')),\n\t\t\t'<=!='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '!=')),\n\t\t\t'<=<='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<=')),\n\t\t\t'<=>='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '>=')),\n\t\t\t'<=<>'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<>')),\n\t\t\t'<=<'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<')),\n\t\t\t'<=>'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '>')),\n\t\t\t'<=%'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '%')),\n\t\t\t'<=+'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '+')),\n\t\t\t'<=-'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '-')),\n\t\t\t'<=*'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '*')),\n\t\t\t'<=/'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '/')),\n\t\t\t'<=!'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '!')),\n\t\t\t'<=^'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '^')),\n\t\t\t'<=^='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '^=')),\n\t\t\t'<=*='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '*=')),\n\t\t\t'<=$='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '$=')),\n\t\t\t'<=~'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '~')),\n\n\t\t\t'>=||'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '||')),\n\t\t\t'>=&&'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '&&')),\n\t\t\t'>=**'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '**')),\n\t\t\t'>==='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '==')),\n\t\t\t'>=!='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '!=')),\n\t\t\t'>=<='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<=')),\n\t\t\t'>=>='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '>=')),\n\t\t\t'>=<>'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<>')),\n\t\t\t'>=<'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<')),\n\t\t\t'>=>'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '>')),\n\t\t\t'>=%'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '%')),\n\t\t\t'>=+'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '+')),\n\t\t\t'>=-'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '-')),\n\t\t\t'>=*'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '*')),\n\t\t\t'>=/'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '/')),\n\t\t\t'>=!'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '!')),\n\t\t\t'>=^'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '^')),\n\t\t\t'>=^='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '^=')),\n\t\t\t'>=*='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '*=')),\n\t\t\t'>=$='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '$=')),\n\t\t\t'>=~'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '~')),\n\n\t\t\t'<>||'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '||')),\n\t\t\t'<>&&'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '&&')),\n\t\t\t'<>**'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '**')),\n\t\t\t'<>=='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '==')),\n\t\t\t'<>!='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '!=')),\n\t\t\t'<><='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '<=')),\n\t\t\t'<>>='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '>=')),\n\t\t\t'<><>'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '<>')),\n\t\t\t'<><'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '<')),\n\t\t\t'<>>'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '>')),\n\t\t\t'<>%'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '%')),\n\t\t\t'<>+'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '+')),\n\t\t\t'<>-'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '-')),\n\t\t\t'<>*'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '*')),\n\t\t\t'<>/'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '/')),\n\t\t\t'<>!'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '!')),\n\t\t\t'<>^'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '^')),\n\t\t\t'<>^='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '^=')),\n\t\t\t'<>*='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '*=')),\n\t\t\t'<>$='\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '$=')),\n\t\t\t'<>~'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '~')),\n\n\t\t\t'<||'\t=> array(array('OPERATOR', '<'),\tarray('OPERATOR', '||')),\n\t\t\t'<&&'\t=> array(array('OPERATOR', '<'),\tarray('OPERATOR', '&&')),\n\t\t\t'<**'\t=> array(array('OPERATOR', '<'),\tarray('OPERATOR', '**')),\n\t\t\t'<=='\t=> array(array('OPERATOR', '<='),\tarray('MISC', '=')),\n\t\t\t'<=!='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '!=')),\n\t\t\t'<=<='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<=')),\n\t\t\t'<=>='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '>=')),\n\t\t\t'<=<>'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<>')),\n\t\t\t'<=<'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '<')),\n\t\t\t'<=>'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '>')),\n\t\t\t'<=%'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '%')),\n\t\t\t'<=+'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '+')),\n\t\t\t'<=-'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '-')),\n\t\t\t'<=*'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '*')),\n\t\t\t'<=/'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '/')),\n\t\t\t'<=!'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '!')),\n\t\t\t'<=^'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '^')),\n\t\t\t'<=^='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '^=')),\n\t\t\t'<=*='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '*=')),\n\t\t\t'<=$='\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '$=')),\n\t\t\t'<=~'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '~')),\n\n\t\t\t'>||'\t=> array(array('OPERATOR', '>'),\tarray('OPERATOR', '||')),\n\t\t\t'>&&'\t=> array(array('OPERATOR', '>'),\tarray('OPERATOR', '&&')),\n\t\t\t'>**'\t=> array(array('OPERATOR', '>'),\tarray('OPERATOR', '**')),\n\t\t\t'>=='\t=> array(array('OPERATOR', '>='),\tarray('MISC', '=')),\n\t\t\t'>=!='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '!=')),\n\t\t\t'>=<='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<=')),\n\t\t\t'>=>='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '>=')),\n\t\t\t'>=<>'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<>')),\n\t\t\t'>=<'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '<')),\n\t\t\t'>=>'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '>')),\n\t\t\t'>=%'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '%')),\n\t\t\t'>=+'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '+')),\n\t\t\t'>=-'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '-')),\n\t\t\t'>=*'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '*')),\n\t\t\t'>=/'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '/')),\n\t\t\t'>=!'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '!')),\n\t\t\t'>=^'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '^')),\n\t\t\t'>=^='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '^=')),\n\t\t\t'>=*='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '*=')),\n\t\t\t'>=$='\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '$=')),\n\t\t\t'>=~'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '~')),\n\n\t\t\t'%||'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '||')),\n\t\t\t'%&&'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '&&')),\n\t\t\t'%**'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '**')),\n\t\t\t'%=='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '==')),\n\t\t\t'%!='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '!=')),\n\t\t\t'%<='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '<=')),\n\t\t\t'%>='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '>=')),\n\t\t\t'%<>'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '<>')),\n\t\t\t'%<'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '<')),\n\t\t\t'%>'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '>')),\n\t\t\t'%%'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '%')),\n\t\t\t'%+'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '+')),\n\t\t\t'%-'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '-')),\n\t\t\t'%*'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '*')),\n\t\t\t'%/'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '/')),\n\t\t\t'%!'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '!')),\n\t\t\t'%^'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '^')),\n\t\t\t'%^='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '^=')),\n\t\t\t'%*='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '*=')),\n\t\t\t'%$='\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '$=')),\n\t\t\t'%~'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '~')),\n\n\t\t\t'+||'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '||')),\n\t\t\t'+&&'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '&&')),\n\t\t\t'+**'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '**')),\n\t\t\t'+=='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '==')),\n\t\t\t'+!='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '!=')),\n\t\t\t'+<='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '<=')),\n\t\t\t'+>='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '>=')),\n\t\t\t'+<>'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '<>')),\n\t\t\t'+<'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '<')),\n\t\t\t'+>'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '>')),\n\t\t\t'+%'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '%')),\n\t\t\t'++'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '+')),\n\t\t\t'+-'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '-')),\n\t\t\t'+*'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '*')),\n\t\t\t'+/'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '/')),\n\t\t\t'+!'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '!')),\n\t\t\t'+^'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '^')),\n\t\t\t'+^='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '^=')),\n\t\t\t'+*='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '*=')),\n\t\t\t'+$='\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '$=')),\n\t\t\t'+~'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '~')),\n\n\t\t\t'-||'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '||')),\n\t\t\t'-&&'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '&&')),\n\t\t\t'-**'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '**')),\n\t\t\t'-=='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '==')),\n\t\t\t'-!='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '!=')),\n\t\t\t'-<='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '<=')),\n\t\t\t'->='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '>=')),\n\t\t\t'-<>'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '<>')),\n\t\t\t'-<'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '<')),\n\t\t\t'->'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '>')),\n\t\t\t'-%'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '%')),\n\t\t\t'-+'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '+')),\n\t\t\t'-*'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '*')),\n\t\t\t'-/'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '/')),\n\t\t\t'-!'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '!')),\n\t\t\t'-^'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '^')),\n\t\t\t'-^='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '^=')),\n\t\t\t'-*='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '*=')),\n\t\t\t'-$='\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '$=')),\n\t\t\t'-~'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '~')),\n\n\t\t\t'*||'\t=> array(array('OPERATOR', '*'),\tarray('OPERATOR', '||')),\n\t\t\t'*&&'\t=> array(array('OPERATOR', '*'),\tarray('OPERATOR', '&&')),\n\t\t\t'***'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '*')),\n\t\t\t'**=='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '==')),\n\t\t\t'**!='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '!=')),\n\t\t\t'**<='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<=')),\n\t\t\t'**>='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '>=')),\n\t\t\t'**<>'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<>')),\n\t\t\t'**<'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '<')),\n\t\t\t'**>'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '>')),\n\t\t\t'**%'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '%')),\n\t\t\t'**+'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '+')),\n\t\t\t'**-'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '-')),\n\t\t\t'***'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '*')),\n\t\t\t'**/'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '/')),\n\t\t\t'**!'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '!')),\n\t\t\t'**^'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '^')),\n\t\t\t'**^='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '^=')),\n\t\t\t'***='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '*=')),\n\t\t\t'**$='\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '$=')),\n\t\t\t'**~'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '~')),\n\n\t\t\t'/||'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '||')),\n\t\t\t'/&&'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '&&')),\n\t\t\t'/**'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '**')),\n\t\t\t'/=='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '==')),\n\t\t\t'/!='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '!=')),\n\t\t\t'/<='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '<=')),\n\t\t\t'/>='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '>=')),\n\t\t\t'/<>'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '<>')),\n\t\t\t'/<'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '<')),\n\t\t\t'/>'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '>')),\n\t\t\t'/%'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '%')),\n\t\t\t'/+'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '+')),\n\t\t\t'/-'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '-')),\n\t\t\t'/*'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '*')),\n\t\t\t'//'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '/')),\n\t\t\t'/!'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '!')),\n\t\t\t'/^'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '^')),\n\t\t\t'/^='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '^=')),\n\t\t\t'/*='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '*=')),\n\t\t\t'/$='\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '$=')),\n\t\t\t'/~'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '~')),\n\n\n\t\t\t'!||'\t=> array(array('OPERATOR', '!'),\tarray('OPERATOR', '||')),\n\t\t\t'!&&'\t=> array(array('OPERATOR', '!'),\tarray('OPERATOR', '&&')),\n\t\t\t'!**'\t=> array(array('OPERATOR', '!'),\tarray('OPERATOR', '**')),\n\t\t\t'!=='\t=> array(array('OPERATOR', '!='),\tarray('MISC', '=')),\n\t\t\t'!=!='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '!=')),\n\t\t\t'!=<='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<=')),\n\t\t\t'!=>='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '>=')),\n\t\t\t'!=<>'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<>')),\n\t\t\t'!=<'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '<')),\n\t\t\t'!=>'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '>')),\n\t\t\t'!=%'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '%')),\n\t\t\t'!=+'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '+')),\n\t\t\t'!=-'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '-')),\n\t\t\t'!=*'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '*')),\n\t\t\t'!=/'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '/')),\n\t\t\t'!=!'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '!')),\n\t\t\t'!=^'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '^')),\n\t\t\t'!=^='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '^=')),\n\t\t\t'!=*='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '*=')),\n\t\t\t'!=$='\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '$=')),\n\t\t\t'!=~'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '~')),\n\n\t\t\t'^||'\t=> array(array('OPERATOR', '^'),\tarray('OPERATOR', '||')),\n\t\t\t'^&&'\t=> array(array('OPERATOR', '^'),\tarray('OPERATOR', '&&')),\n\t\t\t'^**'\t=> array(array('OPERATOR', '^'),\tarray('OPERATOR', '**')),\n\t\t\t'^=='\t=> array(array('OPERATOR', '^='),\tarray('MISC', '=')),\n\t\t\t'^=!='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '!=')),\n\t\t\t'^=<='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<=')),\n\t\t\t'^=>='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '>=')),\n\t\t\t'^=<>'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<>')),\n\t\t\t'^=<'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<')),\n\t\t\t'^=>'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '>')),\n\t\t\t'^=%'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '%')),\n\t\t\t'^=+'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '+')),\n\t\t\t'^=-'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '-')),\n\t\t\t'^=*'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '*')),\n\t\t\t'^=/'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '/')),\n\t\t\t'^=!'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '!')),\n\t\t\t'^=^'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '^')),\n\t\t\t'^=^='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '^=')),\n\t\t\t'^=*='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '*=')),\n\t\t\t'^=$='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '$=')),\n\t\t\t'^=~'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '~')),\n\n\t\t\t'^=||'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '||')),\n\t\t\t'^=&&'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '&&')),\n\t\t\t'^=**'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '**')),\n\t\t\t'^==='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '==')),\n\t\t\t'^=!='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '!=')),\n\t\t\t'^=<='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<=')),\n\t\t\t'^=>='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '>=')),\n\t\t\t'^=<>'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<>')),\n\t\t\t'^=<'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '<')),\n\t\t\t'^=>'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '>')),\n\t\t\t'^=%'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '%')),\n\t\t\t'^=+'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '+')),\n\t\t\t'^=-'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '-')),\n\t\t\t'^=*'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '*')),\n\t\t\t'^=/'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '/')),\n\t\t\t'^=!'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '!')),\n\t\t\t'^=^'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '^')),\n\t\t\t'^=^='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '^=')),\n\t\t\t'^=*='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '*=')),\n\t\t\t'^=$='\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '$=')),\n\t\t\t'^=~'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '~')),\n\n\t\t\t'*=||'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '||')),\n\t\t\t'*=&&'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '&&')),\n\t\t\t'*=**'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '**')),\n\t\t\t'*==='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '==')),\n\t\t\t'*=!='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '!=')),\n\t\t\t'*=<='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '<=')),\n\t\t\t'*=>='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '>=')),\n\t\t\t'*=<>'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '<>')),\n\t\t\t'*=<'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '<')),\n\t\t\t'*=>'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '>')),\n\t\t\t'*=%'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '%')),\n\t\t\t'*=+'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '+')),\n\t\t\t'*=-'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '-')),\n\t\t\t'*=*'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '*')),\n\t\t\t'*=/'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '/')),\n\t\t\t'*=!'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '!')),\n\t\t\t'*=^'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '^')),\n\t\t\t'*=^='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '^=')),\n\t\t\t'*=*='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '*=')),\n\t\t\t'*=$='\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '$=')),\n\t\t\t'*=~'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '~')),\n\n\t\t\t'$=||'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '||')),\n\t\t\t'$=&&'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '&&')),\n\t\t\t'$=**'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '**')),\n\t\t\t'$==='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '==')),\n\t\t\t'$=!='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '!=')),\n\t\t\t'$=<='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '<=')),\n\t\t\t'$=>='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '>=')),\n\t\t\t'$=<>'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '<>')),\n\t\t\t'$=<'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '<')),\n\t\t\t'$=>'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '>')),\n\t\t\t'$=%'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '%')),\n\t\t\t'$=+'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '+')),\n\t\t\t'$=-'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '-')),\n\t\t\t'$=*'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '*')),\n\t\t\t'$=/'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '/')),\n\t\t\t'$=!'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '!')),\n\t\t\t'$=^'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '^')),\n\t\t\t'$=^='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '^=')),\n\t\t\t'$=*='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '*=')),\n\t\t\t'$=$='\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '$=')),\n\t\t\t'$=~'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '~')),\n\n\t\t\t'~||'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '||')),\n\t\t\t'~&&'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '&&')),\n\t\t\t'~**'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '**')),\n\t\t\t'~=='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '==')),\n\t\t\t'~!='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '!=')),\n\t\t\t'~<='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '<=')),\n\t\t\t'~>='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '>=')),\n\t\t\t'~<>'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '<>')),\n\t\t\t'~<'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '<')),\n\t\t\t'~>'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '>')),\n\t\t\t'~%'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '%')),\n\t\t\t'~+'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '+')),\n\t\t\t'~-'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '-')),\n\t\t\t'~*'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '*')),\n\t\t\t'~/'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '/')),\n\t\t\t'~!'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '!')),\n\t\t\t'~^'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '^')),\n\t\t\t'~^='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '^=')),\n\t\t\t'~*='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '*=')),\n\t\t\t'~$='\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '$=')),\n\t\t\t'~~'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '~'))\n\t\t);\n\n\t\tforeach ($operator_combinations as $operator => $tokens)\n\t\t{\n\t\t\tforeach ($this->valueTypes as $type => $value)\n\t\t\t{\n\t\t\t\t$expected = array(\n\t\t\t\t\t$value['token'],\n\t\t\t\t\t$tokens[0],\n\t\t\t\t\t$tokens[1],\n\t\t\t\t\t$value['token']\n\t\t\t\t);\n\n\t\t\t\t$return[] = array(\n\t\t\t\t\t\"The \\\"{$operator}\\\" operator combination with {$type} values (no spaces)\",\n\t\t\t\t\t$this->assembleCommonCondition($value['value'].$operator.$value['value']),\n\t\t\t\t\t$this->assembleCommonTokens($expected)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\n\t\t$operator_combinations = array(\n\t\t\t/**\n\t\t\t * The following array elements were generated with this code:\n\t\t\t *\n\t\t\t * $valid_operators = array(\n\t\t\t * \t'||', '&&', '**',\n\t\t\t * \t'==', '!=', '<=', '>=', '<>', '<', '>',\n\t\t\t * \t'%', '+', '-', '*', '/',\n\t\t\t *\t'.', '!', '^',\n\t\t\t *\t'^=', '*=', '$=',\n\t\t\t * );\n *\n\t\t\t * // Build out some combinations\n\t\t\t * foreach ($valid_operators as $first)\n\t\t\t * {\n\t\t\t * \tforeach ($valid_operators as $second)\n\t\t\t * \t{\n\t\t\t * \t\t$operator = $first.$second;\n *\n\t\t\t * \t\tif (in_array($operator, $valid_operators) ||\n\t\t\t * \t\t\tisset($invalid_operators[$operator]))\n\t\t\t * \t\t{\n\t\t\t * \t\t\tcontinue;\n\t\t\t * \t\t}\n *\n\t\t\t * \t\tif ($operator == '--')\n\t\t\t * \t\t{\n\t\t\t * \t\t\tcontinue;\n\t\t\t * \t\t}\n *\n\t\t\t * \t\tif ($first == '.' || $second == '.')\n\t\t\t * \t\t{\n\t\t\t * \t\t\t$token = (in_array($second, $valid_operators)) ? 'OPERATOR' : 'MISC';\n\t\t\t *\n\t\t\t * \t\t\tprintf(\"'%s'\\t=> array(array('OPERATOR', '%s'),\\tarray('%s', '%s')),\\n\", $operator, $first, $token, $second);\n\t\t\t * \t\t}\n\t\t\t * \t}\n\t\t\t * \tprint \"\\n\";\n\t\t\t * }\n\t\t\t */\n\n\t\t\t'||.'\t=> array(array('OPERATOR', '||'),\tarray('OPERATOR', '.')),\n\n\t\t\t'&&.'\t=> array(array('OPERATOR', '&&'),\tarray('OPERATOR', '.')),\n\n\t\t\t'**.'\t=> array(array('OPERATOR', '**'),\tarray('OPERATOR', '.')),\n\n\t\t\t'==.'\t=> array(array('OPERATOR', '=='),\tarray('OPERATOR', '.')),\n\n\t\t\t'!=.'\t=> array(array('OPERATOR', '!='),\tarray('OPERATOR', '.')),\n\n\t\t\t'<=.'\t=> array(array('OPERATOR', '<='),\tarray('OPERATOR', '.')),\n\n\t\t\t'>=.'\t=> array(array('OPERATOR', '>='),\tarray('OPERATOR', '.')),\n\n\t\t\t'<>.'\t=> array(array('OPERATOR', '<>'),\tarray('OPERATOR', '.')),\n\n\t\t\t'<.'\t=> array(array('OPERATOR', '<'),\tarray('OPERATOR', '.')),\n\n\t\t\t'>.'\t=> array(array('OPERATOR', '>'),\tarray('OPERATOR', '.')),\n\n\t\t\t'%.'\t=> array(array('OPERATOR', '%'),\tarray('OPERATOR', '.')),\n\n\t\t\t'+.'\t=> array(array('OPERATOR', '+'),\tarray('OPERATOR', '.')),\n\n\t\t\t'-.'\t=> array(array('OPERATOR', '-'),\tarray('OPERATOR', '.')),\n\n\t\t\t'*.'\t=> array(array('OPERATOR', '*'),\tarray('OPERATOR', '.')),\n\n\t\t\t'/.'\t=> array(array('OPERATOR', '/'),\tarray('OPERATOR', '.')),\n\n\t\t\t'.||'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '||')),\n\t\t\t'.&&'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '&&')),\n\t\t\t'.**'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '**')),\n\t\t\t'.=='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '==')),\n\t\t\t'.!='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '!=')),\n\t\t\t'.<='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '<=')),\n\t\t\t'.>='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '>=')),\n\t\t\t'.<>'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '<>')),\n\t\t\t'.<'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '<')),\n\t\t\t'.>'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '>')),\n\t\t\t'.%'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '%')),\n\t\t\t'.+'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '+')),\n\t\t\t'.-'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '-')),\n\t\t\t'.*'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '*')),\n\t\t\t'./'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '/')),\n\t\t\t'..'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '.')),\n\t\t\t'.!'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '!')),\n\t\t\t'.^'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '^')),\n\t\t\t'.^='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '^=')),\n\t\t\t'.*='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '*=')),\n\t\t\t'.$='\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '$=')),\n\t\t\t'.~'\t=> array(array('OPERATOR', '.'),\tarray('OPERATOR', '~')),\n\n\t\t\t'!.'\t=> array(array('OPERATOR', '!'),\tarray('OPERATOR', '.')),\n\n\t\t\t'^.'\t=> array(array('OPERATOR', '^'),\tarray('OPERATOR', '.')),\n\n\t\t\t'^=.'\t=> array(array('OPERATOR', '^='),\tarray('OPERATOR', '.')),\n\n\t\t\t'*=.'\t=> array(array('OPERATOR', '*='),\tarray('OPERATOR', '.')),\n\n\t\t\t'$=.'\t=> array(array('OPERATOR', '$='),\tarray('OPERATOR', '.')),\n\n\t\t\t'~.'\t=> array(array('OPERATOR', '~'),\tarray('OPERATOR', '.'))\n\t\t);\n\n\t\t// When a period or dash end an operator and the next character is\n\t\t// a digit then it's not an operator any longer\n\t\tforeach ($operator_combinations as $operator => $tokens)\n\t\t{\n\t\t\tforeach ($this->valueTypes as $type => $value)\n\t\t\t{\n\t\t\t\t// To avoid confusing code these will be done \"by hand\" see: edgyOperatorCombinationsWithoutSpaces()\n\t\t\t\tif ($type == 'negative' || $value['token'][0] == 'NUMBER')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$expected = array(\n\t\t\t\t\t$value['token'],\n\t\t\t\t\t$tokens[0],\n\t\t\t\t\t$tokens[1],\n\t\t\t\t\t$value['token']\n\t\t\t\t);\n\n\t\t\t\t$return[] = array(\n\t\t\t\t\t\"The \\\"{$operator}\\\" operator with {$type} values (no spaces)\",\n\t\t\t\t\t$this->assembleCommonCondition($value['value'].$operator.$value['value']),\n\t\t\t\t\t$this->assembleCommonTokens($expected)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public static function getOperators();", "function findBestPrice($message)\n{\n $newMessage = preg_replace('/\\./m', '', $message);\n\n //Replace cents delimiter to prevenr conversion errors to float\n $newMessage = preg_replace('/,/m', '.', $newMessage);\n\n //Retrieve desired sequence\n $sequence = '/R\\$(.*)\\(1\\)/m';\n preg_match_all($sequence, $newMessage, $matches, PREG_SET_ORDER, 0);\n\n //Check if there is connection prices in message\n if (preg_match(\"/com escalas/\", $message)) {\n $preco_com_escala = convertToString($matches[0][1]);\n } else {\n $preco_com_escala = '';\n }\n\n //check is there is no connection prices in message\n if (preg_match(\"/sem escalas/\", $message)) {\n $preco_sem_escala = convertToString($matches[1][1]);\n } else {\n $preco_sem_escala = '';\n }\n\n return [\n 'com-escala' => $preco_com_escala,\n 'sem-escala' => $preco_sem_escala,\n ];\n}", "function priceSearch()\r\n{\r\n $json_str = file_get_contents(HC_PATH.\"getPriceList\".get_credentials());\r\n $prices = json_decode($json_str, true);\r\n if(isset($prices['errors'])) death(\"Service call returned an error.\"); //If the service call is bad, call death.\r\n printBestPrices($prices['best_price']);\r\n}", "function calc($operand1, $operand2, $operator)\n{\n $result=0;\n if($operator == '+'){\n $result = $operand1 + $operand2;\n }\n elseif($operator == '-'){\n $result = $operand1 - $operand2;\n }\n elseif($operator == '*'){\n $result = $operand1 * $operand2;\n }\n elseif($operator == '/'){\n $result = $operand1 / $operand2;\n }\n\n return $result;\n \n}", "function getOperators();", "function getProductSizes($pos_product_id)\n{\t//hmmmmm\n\t//a size really needs to be a combination of all 'parameters'\n\t// this way 32A but not 38A can exist\n\t//the sub id will know that it is a '32A' and has a cup of A\n\t//why? In case I need to populate the purchase order, I will need to find the \"size\" which is will be the \"size\" less the cup, inseam, etc...\n\t// so essentially that will need to be parsed. \n\t\n\t$sql = \"SELECT pos_product_option_id, option_name as size_name,option_code as size_code,sort_index \n\t\t\t\t\tFROM pos_product_options\n\t\t\t\t\tINNER JOIN pos_product_attributes USING (pos_product_attribute_id)\n\t\t\t\t\tWHERE pos_product_id = $pos_product_id AND attribute_name = 'Size' ORDER by sort_index ASC\";\n\t\t\t\t\t\n\t$sql2 = \"SELECT size_options.pos_product_option_id, size_options.option_name as size_name, size_options.option_code as size_code, size_options.sort_index , cup_options.option_code as cup_code\t\t\n\t\t\t\t\tFROM pos_product_options size_options\n\t\t\t\t\tINNER JOIN pos_product_options cup_options USING (pos_product_id) \n\t\t\t\t\tINNER JOIN pos_product_attributes size ON size_options.pos_product_attribute_id = size.pos_product_attribute_id\n\t\t\t\t\tINNER JOIN pos_product_attributes cup ON cup_options.pos_product_attribute_id = cup.pos_product_attribute_id\n\t\t\t\t\tWHERE pos_product_id = $pos_product_id AND size.attribute_name = 'Size' AND cup.attribute_name = 'Cup' ORDER by sort_index ASC\";\n\t\t\t\t\t\n\n\t\t\n\t\t\n\t\t\t\t\t\n\t//try again...\n\t//we need to get the size and cup options for the product.... \n\t// the size and cup option are not linked...\n\t//however they should be?\n\t//\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n$data = getSQL($sql);\n\treturn $data;\n}", "function lookupPrice($drinkName, $drinkSize) {\n global $drinks;\n foreach ($drinks as $drink) {\n if ($drink->drink_name == $drinkName) {\n foreach ($drink->prices as $size => $price) {\n if ($size == $drinkSize) {\n return $price;\n }\n }\n }\n }\n}" ]
[ "0.6106679", "0.4553719", "0.4543876", "0.4262415", "0.42504832", "0.41972926", "0.4190154", "0.41597435", "0.41519174", "0.41400915", "0.4134004", "0.41335872", "0.4127299", "0.41232723", "0.41019687", "0.40887216", "0.40636158", "0.40283567", "0.4027811", "0.4023234", "0.40164524", "0.40015882", "0.3980459", "0.39706498", "0.39647183", "0.39602274", "0.3958726", "0.39528728", "0.3939294", "0.39357802" ]
0.69012815
0
Extrai os dados dos Produtos a partir de objeto DOMElement
public static function get_products_data(DOMElement $div) { $data = array(); $tables = $div->getElementsByTagName('table'); /** * Cada produto na nota possui 2 tabelas principais (e internas) de dados dentro da div "aba_nft_3"; * Na aba de produtos, o cabeçalho seria a tabela 0, ao buscar pela lista de tabelas, por isso $i=1; * A lista de tabelas retorna também as tabelas filhas, o que permitiria a replicação de dados; * Cada uma das 2 tabelas principais possui a classe "toggle" ou "toggable"; * Essas classes são verificadas, assim é possível pegar todas as TDs internas com segurança; */ $c = 0; for ($i=1; $i < $tables->length; $i++) { $classe = $tables->item($i)->getAttribute("class"); if(stripos($classe, "toggle") !== FALSE){ $cols = $tables->item($i)->getElementsByTagName('td'); foreach ($cols as $col) { if($col->getAttribute("class")=="fixo-prod-serv-descricao"){ $data[$c]['descricao'] = $col->nodeValue; }else if ($col->getAttribute("class")=="fixo-prod-serv-uc"){ $data[$c]['un'] = $col->nodeValue; } } }else if(stripos($classe, "toggable") !== FALSE){ $cols = $tables->item($i)->getElementsByTagName('td'); foreach ($cols as $col) { $label = $col->getElementsByTagName('label')->item(0); if($label){ // $label->nodeValue = utf8_decode($label->nodeValue); if(stripos($label->nodeValue, "Código do Produto") !== FALSE){ $data[$c]['codigo'] = $col->getElementsByTagName('span')->item(0)->nodeValue; }else if(stripos($label->nodeValue, "Código NCM") !== FALSE){ $data[$c]['ncm'] = $col->getElementsByTagName('span')->item(0)->nodeValue; }else if(stripos($label->nodeValue, "Código EAN Comercial") !== FALSE){ $data[$c]['ean'] = $col->getElementsByTagName('span')->item(0)->nodeValue; }else if(stripos($label->nodeValue, "Valor unitário de comercialização") !== FALSE){ $data[$c]['valor'] = $col->getElementsByTagName('span')->item(0)->nodeValue; } } } $c++; } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_products_data(DOMElement $table){\n\n $data = array();\n // TABELA 6 - Dados sobre os PRODUTOS\n $rows = $table->getElementsByTagName('tr');\n\n for ($i=1; $i < $rows->length; $i++) { \n $cols = $rows->item($i)->getElementsByTagName('td');\n \n $produto['codigo'] = $cols->item(0)->nodeValue;\n $produto['descricao'] = $cols->item(1)->nodeValue;\n $produto['valor'] = $cols->item(4)->nodeValue;\n $produto['un'] = $cols->item(3)->nodeValue;\n\n array_push($data,$produto);\n \n }\n\n return $data;\n\n }", "public function getProdutos(){\n //CONEXAO\n $this->conexao = DBConnection::getConexao();\n\n //SELECT\n $sql = 'select * from produto';\n $resultado = $this->conexao->query($sql);\n\n //resultset do BD\n $produtos = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\n $listaProdutos = [];\n foreach ($produtos as $produto) {\n $listaProdutos[] = new Produtos($produto['nome_produto'], $produto['descricao_produto'], $produto['id_produto']);\n }\n return $listaProdutos;\n }", "private function getElementosData () {\n\n if ((is_array($this->data) or is_object($this->data)) and count($this->data) > 0) {\n\n if ($this->selector == 'TABLE') {\n #Debug::mostrarArray($this->data);\n }\n foreach ($this->data as $key => $value) {\n\n $this->selectorCreado .= \" $key='\" . $value . \"'\";\n }\n }\n }", "public function getDetailProduct(){\n // Multi Curl\n //var_dump($this->productoUrl);\n parent::__construct($this->productoUrl);\n $this->setContentAndOptions();\n $content = $this->getContent();\n //var_dump($content);\n // Dom Object\n $this->dom = new Dom($content);\n // Referencias\n $tag = \"div\";\n $class = \"product-name\";\n $referenciasVector = $this->dom->getElementsByTagClassNameOther($tag,$class);\n $contador = 0;\n $contadorProductos = 1;\n foreach($referenciasVector as $referencias){\n foreach($referencias as $referencia){\n if ($contador == 1){\n //echo \"referencia: \".rtrim(ltrim($referencia->nodeValue)).\"<br>\";\n //array_push($this->productoReferencia,rtrim(ltrim($referencia->nodeValue)));\n array_push($this->productoReferencia,$contadorProductos);\n $contadorProductos++;\n }\n $contador++;\n }\n $contador = 0;\n }\n\n // Name and Reference\n $vectorNameAndReference = $this->dom->getNameAndReference();\n foreach($vectorNameAndReference[\"name\"] as $name){\n array_push($this->productoNombre,$name);\n }\n foreach($vectorNameAndReference[\"reference\"] as $reference){\n array_push($this->productoReferencia,$reference);\n }\n\n // Price and Old price\n $vectorOldPriceAndPrice = $this->dom->getPriceAndOldPrice();\n foreach($vectorOldPriceAndPrice[\"oldprice\"] as $old){\n array_push($this->productoPrecioAntiguo,$old);\n }\n foreach($vectorOldPriceAndPrice[\"price\"] as $precio){\n array_push($this->productoPrecio,$precio);\n }\n\n // Images\n $this->productoUrlFotos = $this->dom->getImages();\n\n // Caracteristicas\n $caracteristicas = $this->dom->getCaracteristicas();\n $encontrado = FALSE;\n $contador = 0;\n $contadorCarac = 0;\n //\"td\" => array(), valores\n //\"th\" => array(), nombre\n //var_dump($caracteristicas);\n foreach($caracteristicas as $caracteristica){\n foreach($caracteristica[\"th\"] as $caracteristicaNombre){\n foreach($this->caracteristicasDefault as $caracDefault){\n $caracteristicaNombre = rtrim(ltrim($caracteristicaNombre));\n if ($caracteristicaNombre == $caracDefault){\n //echo \"Encontrado<br>\";\n $encontrado = TRUE;\n }\n }\n if ($encontrado == FALSE){\n //echo \"No Encontrado<br>\";\n array_push($this->caracteristicasDefault,$caracteristicaNombre);\n }\n }\n $contador++;\n }\n\n $contador = 0;\n //echo \"<br><br>\";\n //var_dump($caracteristicas);\n foreach($caracteristicas as $caracteristica){\n $caracteristicaString = \"\";\n foreach($caracteristica[\"td\"] as $caracValue) {\n //echo \"hola desc carac: \".$caracteristicas[$contador][\"th\"][$contadorCarac].\"<br><br>\";\n if ($caracteristicas[$contador][\"th\"][$contadorCarac] == \"Descripción\"){\n //echo (\"descripcion\".$caracValue.\"<br><br>\");\n array_push($this->productoDescLarga,$caracValue);\n }else if ($caracteristicas[$contador][\"th\"][$contadorCarac] != \"Marca\") {\n $caracTemp = $caracValue;\n $caracMod = str_replace(\",\",\" \",$caracTemp);\n $caracMod = str_replace(\":\",\" \",$caracMod);\n $caracMod = mb_strimwidth($caracMod,0,255,'...','utf-8');\n $caracteristicaString.= $caracteristicas[$contador][\"th\"][$contadorCarac].\":\".$caracMod.\",\";\n }\n $contadorCarac++;\n }\n $caracteristicaString = substr($caracteristicaString,0,strlen($caracteristicaString)-1);\n //echo (\"String caracteristica es: \".$caracteristicaString.\"<br><br>\");\n array_push($this->caracteristicas,$caracteristicaString);\n echo (\"Contador: \".$contador.\"contadorCarac: \".$contadorCarac.\"<br>\");\n $contadorCarac = 0;\n $contador++;\n }\n }", "function GetProdutos(){\n\t\t$query = \"SELECT * FROM {$this->prefix}produtos p INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n\n\t\n\t\t$query .= \" ORDER BY pro_id DESC\";\n\n\t\t$query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n\n\t\t\n\t\t$this->ExecuteSQL($query);\n\n\t\t$this->GetLista();\n\t\t\n\t}", "public function getElementos() {\n return array($this->atributosBeneficioServidor());\n }", "public function GetProdutos(){\n $query = \"SELECT * FROM {$this->prefix}produtos p \n INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n \n $query .= \" ORDER BY pro_id DESC\";\n \n $query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n\n\n\n $this->ExecuteSQL($query);\n \n $this->GetLista();\n \n }", "public function getElementos() \n\t{\n\t\t$opcMenu = $this->getOpciones();\n\n\t\t//$ret = [\"nota\" => $this->datosId, \"ruta\" => $this->datosRuta], compact('opcMenu');\n\t\t//$ret = [\"nota\" => $this->datosId, \"ruta\" => $this->datosRuta, compact('opcMenu')];\n\t\t//$ret = compact($this->datosId, $this->datosRuta, $opcMenu);\n\n\t\t$ret = [\n\t\t\t\"nota\" => $this->datosId,\n\t\t\t\"ruta\" => $this->datosRuta,\n\t\t\t\"opciones\" => $opcMenu['opciones'],\n\t\t\t\"notas\"\t=> $opcMenu['notas']\n\t\t];\n\n\t\treturn $ret;\n\t}", "function GetProdutos(){\n \t\n\t\t $query = \"SELECT * FROM {$this->prefix}produtos p INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n\n\t\n\t\t $query .= \" ORDER BY pro_id DESC\";\n \n\t\t $query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n \n\t\t \n\t\t $this->ExecuteSQL($query);\n \n\t\t $this->GetLista();\n\t\t \n\t }", "public function get_pedido_productos(){\r\n\t\t\t$sql = 'SELECT * FROM productos_traspasos WHERE folio='.$_SESSION['folio'];\r\n\t\t\treturn $this->query($sql);\r\n\t\t}", "function puestoDatos($idPuesto){\n $pdo = new conexion();\n $query = $pdo->prepare(\"SELECT * FROM puesto WHERE idPuesto = $idPuesto;\");\n $query->execute();\n $res = $query->fetchAll();\n \n foreach ($res as $value) {\n $this->idPuesto=$value['idPuesto'];\n $this->nombrePuest=$value['nombrePuest'];\n $this->descripcion=$value['descripcion'];\n $this->salarioDia=$value['salarioDia'];\n }\n }", "public function listarProdutos(){\n require_once('../model/produtoClass.php');\n require_once('../model/DAO/produtoDAO.php');\n \n $produtoDAO = new ProdutoDAO();\n \n return $produtoDAO->selectAllProdutos();\n }", "function pegar_dados_proposta( $ppoid )\n\t\t{\n\t\t\tglobal $db;\n\t\t\t$acaid = (integer) $acaid;\n\t\t\t$sql = \"select ppodsc from elabrev.propostaorcamento where ppoid = \" . $ppoid;\n\t\t\t$dados = $db->recuperar( $sql );\n\t\t\tif ( !$dados )\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\treturn $dados;\n\t\t}", "public function Select(){\n\n $sql=\"select * from tbl_produto order by idProduto desc\";\n\n $conex=new Mysql_db();\n //Faz a conexão com o banco\n $PDOconex = $conex->Conectar();\n\n //Executa o select no DB e guarda o retorno na variável select\n $select = $PDOconex->query($sql);\n\n $cont=0;\n\n while ($rs=$select->fetch(PDO::FETCH_ASSOC)) {\n $listProdutos[] = new Produto();\n\n $listProdutos[$cont]->idProduto=$rs['idProduto'];\n $listProdutos[$cont]->codigo=$rs['codigo'];\n $listProdutos[$cont]->descricao=$rs['descricao'];\n $listProdutos[$cont]->preco=$rs['preco'];\n $listProdutos[$cont]->quantidade=$rs['quantidade'];\n $listProdutos[$cont]->idCategoria=$rs['idCategoria'];\n $listProdutos[$cont]->imagen=$rs['imagen'];\n\n\n\n $cont+=1;\n }\n\n\n\n $conex->Desconectar();\n\n if (isset($listProdutos)) {\n return $listProdutos;\n }\n }", "public function obtener_Objetos(){\n\t\t\t\t$posts=array();\n\t\t\t\t$cont=0;\n\t\t\t\t$sql = \"EXEC pa_Usuarios @UsuarioNombre ='',@UsuarioCorreo ='',\t@UsuarioEstado ='',\t@UsuarioPassword ='',\t@UsuarioInclusion ='',\t@UsuarioRol ='',@Accion = 'S',@GRU_Titulo='' ,@Usr_Usuario =0\";\n\t\t\t\t$stmt = $this->conexion->consulta($sql);\n\t\t\t\twhile( $row = $this->conexion->obtener_Columnas($stmt)) {\n\t\t\t\t\t$posts[$cont][0]=$row[0];\n\t\t\t\t\t$posts[$cont][1]=$row[1];\n\t\t\t\t\t$posts[$cont][2]=$row[2];\n\t\t\t\t\t$posts[$cont][3]=$row[3];\n\t\t\t\t\t$posts[$cont][4]=$row[4];\n\t\t\t\t\t$posts[$cont][5]=$row[5];\n\t\t\t\t\t$posts[$cont][6]=$row[6];\n\t\t\t\t\t$cont++;\n\t\t\t\t}\n\t\t\t\treturn $posts;\n\t\t\t}", "public function listarElementos(){\n\t\t$array=null;\n\t\trequire_once \"../util/datosconexion.php\";\n\t\ttry {\n\t\t\t$bd =$this->bd=Conexiona::Conexion();\n \t\t$sql=\"CALL paListarElementos()\";\n \t\t$cns= $bd->query($sql);\n \t\twhile($fila=$cns->fetch(PDO::FETCH_ASSOC)){\n \t\t\t$this->consulta[]=$fila;\n \t\t}\n \t\treturn $this->consulta;\t\n \t\t$bd=null;\n\t\t} catch (Exception $e) {\n\t\t\techo 'Excepción capturada: ',$e->getMessage();\n\t\t\treturn null;\n\t\t}\n\t}", "function listaProduto($conexao){\n\t\t\n $produtos = array();\n \n\t $resultado = mysqli_query ($conexao, \"select pp.*, cc.nome as categoria_nome from produtos as pp join categorias as cc on pp.categoria_id = cc.id\");\n\t while($produtos_array = mysqli_fetch_assoc($resultado)){\n \n \n $categoria = new Categoria();\n $categoria->setNome($produtos_array[\"categoria_nome\"]);\n \n $produto = new Produto();\n $produto->setId($produtos_array[\"id\"]);\n $produto->setNome($produtos_array[\"nome\"]);\n $produto->setPreco($produtos_array[\"preco\"]);\n $produto->setDescricao($produtos_array[\"descricao\"]);\n $produto->setCategoria($categoria);\n $produto->setUsado($produtos_array[\"usado\"]);\n \n array_push($produtos, $produto);\n\n\t\t}\n\t\treturn $produtos;\n\t}", "private function parseCommande(\\DOMElement $node)\n {\n $datas = array();\n \n $reference_nodes = $node->getElementsByTagName('Reference');\n if ($reference_nodes->length > 0) {\n $datas['reference'] = $reference_nodes->item(0)->nodeValue;\n }\n \n $date_nodes = $node->getElementsByTagName('DatePaiement');\n if ($date_nodes->length > 0) {\n $datas['date'] = $date_nodes->item(0)->nodeValue;\n }\n \n $paiement_nodes = $node->getElementsByTagName('Montant');\n if ($paiement_nodes->length > 0) {\n $paiement_node = $paiement_nodes->item(0);\n $amount_nodes = $paiement_node->getElementsByTagName('Valeur');\n $currency_nodes = $paiement_node->getElementsByTagName('Devise');\n \n if ($amount_nodes->length > 0) {\n $datas['amount'] = $amount_nodes->item(0)->nodeValue;\n }\n \n if ($currency_nodes->length > 0) {\n $datas['currency'] = $currency_nodes->item(0)->nodeValue;\n }\n }\n \n return $datas;\n }", "function tampil_prodi(){\n\t\t\tglobal $con;\n\n\t\t\t$query=mysqli_query($con, \"select a.*, b.* from tb_prodi a, tb_jurusan b where a.id_jurusan=b.id_jurusan\");\n\t\t\twhile($row=mysqli_fetch_array($query))\n\t\t\t\t$data[] = $row;\n\n\t\t\t\treturn $data;\n\t\t}", "public static function obtenerPropiedades()\n {\n //http://localhost/proyecto2-progra-web/server/index.php/propiedad/1/?metodo=getpropiedades\n $dbh = Propiedad::obtenerconexion();\n try {\n $stmt = $dbh->prepare(\"SELECT * FROM PROPIEDAD\");\n $stmt->execute();\n $data = Array();\n while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $data[] = $result;\n }\n echo json_encode($data);\n } catch (Exception $e) {\n echo \"Failed: \" . $e->getMessage();\n }\n }", "public function getProductList(){\n // Multi Curl\n parent::__construct($this->vectorUrlsFormateadas);\n $this->setContentAndOptions();\n $content = $this->getContent();\n // Dom Object\n $this->dom = new Dom($content);\n $tag = \"p\";\n $class = \"amount\";\n $vectorNumeroItems = $this->dom->getElementsByTagClassNameOther($tag,$class);\n $vectorItems = $this->dom->getElementsByTagClassNameOther(\"li\",\"item\");\n foreach($vectorNumeroItems as $numeroItems){\n if ($numeroItems->length > 0){\n $numero = rtrim(ltrim($numeroItems->item(0)->nodeValue));\n $findme = 'totales';\n $pos = strpos($numero, $findme);\n if ($pos === false) {\n $numero = str_replace(\"Artículo(s)\",\" \",$numero);\n $numero = rtrim(ltrim($numero));\n } else {\n $vector = explode(\" \",$numero);\n $numero = rtrim(ltrim($vector[3]));\n //echo \"La cadena '$findme' fue encontrada en la cadena '$mystring'\";\n //echo \" y existe en la posición $pos\";\n }\n //echo \"<br>Número de productos: \".$numero.\"<br>\";\n array_push($this->vectorNProductosIdCat,$numero);\n }\n }\n\n foreach($vectorItems as $items){\n foreach($items as $item){\n $nombresProductos = $item->getElementsByTagName(\"h2\");\n $divsProductos = $item->getElementsByTagName(\"div\");\n if ($nombresProductos->length > 0){\n //$nombreProducto = $nombresProductos->item(0)->nodeValue;\n $urlProducto = $nombresProductos->item(0)->firstChild->getAttribute(\"href\");\n //array_push($this->productoNombre,$nombreProducto);\n array_push($this->productoUrl,$urlProducto);\n //echo (\"urlProducto: \".$urlProducto.\"<br>\");\n //echo (\"nombrePdocuto: \".$nombreProducto.\"<br>\");\n }\n }\n }\n\n // Desc corta\n $vectorElementos = $this->dom->getDescCorta();\n foreach($vectorElementos as $elemento){\n array_push($this->productoDescCorta,$elemento);\n }\n var_dump($this->productoUrl);\n var_dump($this->vectorNProductosIdCat);\n var_dump($this->productoDescCorta);\n\n }", "public function todosProdutos(): array\n {\n $sqlConsulta = \"SELECT * FROM produto\";\n $stmt = $this->conexao->query($sqlConsulta);\n\n return $this->hidratarListaProdutos($stmt);\n }", "public function cargarProyectos() {\n try {\n if ($_SESSION['posicion'] == 0) {\n $query = $this->db->connect()->prepare('SELECT nombre \n FROM proyecto');\n\n $query->execute();\n }\n else {\n $query = $this->db->connect()->prepare('SELECT nombre \n FROM proyecto \n WHERE departamento = :departamento');\n\n $query->execute(['departamento'=>$_SESSION['departamento']]);\n }\n\n $proyectos = [];\n\n while ($result = $query->fetch()) {\n array_push($proyectos,$result['nombre']);\n }\n\n return $proyectos;\n }\n catch (PDOException $e) {\n return $e;\n }\n }", "public function productosDestacados(){\n $datos = $this->mysql->consulta(\"SELECT * FROM productos\");\n return $datos;\n }", "public function getProyectos()\n {\n $dql = \"SELECT \n p.id,\n p.proNombre\n FROM \n sgiiBundle:TblProyecto p\n WHERE p.proEstado = 1\";\n \n $query = $this->em->createQuery($dql);\n $result = $query->getResult(); \n return $result;\n }", "function getParametrs() {\n\n $html = $this->htmlContent();\n\n $domd \t= new DOMDocument();\n\n libxml_use_internal_errors(true);\n\n try {\n $domd->loadHTML($html);\n }\n catch(Exception $e){\n return false;\n }\n\n $domd->preserveWhiteSpace = false;\n\n $foo = array();\n\n $titles = $domd->getElementsByTagName('h1');\n $end \t= false;\n\n foreach( $titles as $title ) {\n\n if( $end )\n continue;\n\n if ( $title->getAttribute('class') == 'product-name' ) {\n $foo['title'] = trim($title->nodeValue);\n $end = true;\n }\n }\n\n $sku = $domd->getElementById('product-info-sku');\n\n $foo['sku'] = $this->listSKUParams($sku);\n\n $pack = $domd->getElementById('shipping-payment');\n $foo['pack'] = $this->listPackParams($pack);\n\n $quantity = $domd->getElementById('quantity-no');\n if( !empty($quantity) )\n $foo['quantity'] = $quantity->textContent;\n\n $params = $domd->getElementById('product-desc');\n $foo['attribute'] = $this->listParams($params);\n\n $foo['timeleft'] = 0;\n\n $time = $domd->getElementById('discount-count-down');\n if( empty($time) ) {\n\n $xpath = new DOMXpath($domd);\n $times = $xpath->query('//span[@class=\"time-left\"]');\n\n if( $times->length > 0 ) {\n $it = 0;\n\n foreach($times as $time) {\n\n $it++;\n\n if($it > 1) continue;\n\n $foo['timeleft'] = strtotime('now') + ( preg_replace('/\\D/', '', $time->nodeValue)*24*60*60 );\n }\n }\n }\n\n return $foo;\n }", "public function selectById($Produto){\n\n $sql=\"select * from tbl_produto where idProduto=\".$Produto->idProduto;\n\n $conex=new Mysql_db();\n //Faz a conexão com o banco\n $PDOconex = $conex->Conectar();\n\n //Executa o select no DB e guarda o retorno na variável select\n $select = $PDOconex->query($sql);\n\n\n if ($rs=$select->fetch(PDO::FETCH_ASSOC)) {\n $listProdutos = new Produto();\n\n $listProdutos->idProduto=$rs['idProduto'];\n $listProdutos->codigo=$rs['codigo'];\n $listProdutos->descricao=$rs['descricao'];\n $listProdutos->preco=$rs['preco'];\n $listProdutos->quantidade=$rs['quantidade'];\n $listProdutos->idCategoria=$rs['idCategoria'];\n $listProdutos->imagen=$rs['imagen'];\n\n }\n\n\n\n $conex->Desconectar();\n\n if (isset($listProdutos)) {\n return $listProdutos;\n }\n }", "public function AcargarRegistroMxserpro($datos) {\r\n $o_TablaHtmlx = new tablaDHTMLX();\r\n\r\n $arrayFilas = array();\r\n $arrayFilas[0][0] = 1;\r\n $arrayFilas[0][1] = $datos[\"iIdCPT\"];\r\n $arrayFilas[0][2] = $datos[\"vCPTdescripcion\"];\r\n $arrayFilas[0][3] = 0;\r\n $arrayFilas[0][4] = 0;\r\n $arrayFilas[0][5] = \"../../../../fastmedical_front/imagen/icono/grabar.png ^ guardar\";\r\n\r\n $arrayCabecera = array(\"0\" => \"iId\", \"1\" => \"iIdCPT\", \"2\" => \"Descripcion CPT\", \"3\" => \"idSerProd\", \"4\" => \"Descrip_Prod\", \"5\" => \"Accion\");\r\n $arrayTamano = array(0 => \"50\", 1 => \"30\", 2 => \"*\", 3 => \"80\", 4 => \"*\", 5 => \"50\");\r\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"img\");\r\n $arrayAlineacion = array(\"0\" => \"left\", \"1\" => \"left\", \"2\" => \"left\", \"3\" => \"left\", \"4\" => \"left\", \"5\" => \"left\");\r\n $arrayHidden = array(\"0\" => \"true\", \"1\" => \"false\", \"2\" => \"false\", \"3\" => \"false\", \"4\" => \"false\", \"5\" => \"false\");\r\n return $o_TablaHtmlx->stringXml($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayAlineacion, 0, $arrayHidden);\r\n }", "function ListarDados(){\r\n\t\t\treturn $this->obj->fetch(PDO::FETCH_ASSOC);\r\n\t\t}", "public function ListarProveedores() {\n try {\n $result = array();\n $stm = $this->pdo->prepare(\"SELECT * FROM V_PROVEEDOR\");\n $stm->execute();\n return $stm->fetchAll(PDO::FETCH_OBJ);\n } catch (Exception $e) {\n die($e->getMessage());\n }\n }" ]
[ "0.67372733", "0.6219168", "0.60621333", "0.59695697", "0.58725744", "0.5796832", "0.57564825", "0.5715745", "0.5710898", "0.5628797", "0.56239104", "0.5585845", "0.5578594", "0.5576958", "0.554976", "0.55488414", "0.5507655", "0.5487115", "0.5484025", "0.5464061", "0.54175806", "0.54136705", "0.54105216", "0.53991246", "0.53920496", "0.53370744", "0.53236395", "0.53066504", "0.5288088", "0.527356" ]
0.6527463
1
Creates entries on database for 'estabelecimento', 'nota' and 'produto' extracted from the provided nfce if they don't already exist Existing entries for a specific product on a specified establishment are updated with it's new price
public static function store_nfce($key) { DB::beginTransaction(); $ERROS = 0; // Verifica se Nota existe, se sim, pula para a próxima $nota = DB::table('notas')->where('chave_acesso', $key)->first(); if(!is_null($nota)){ // echo "<br/>Nota fiscal já cadastrada. ".$nota->chave_acesso; return "400"; } $data = self::get_all_data($key); if($data == "400") return "400"; $data = json_decode(json_encode ($data), FALSE); $data->nfce->data_emissao = preg_replace('#(\d{2})/(\d{2})/(\d{4})#', '$3-$2-$1', $data->nfce->data_emissao); // Verifica se Estabelecimento existe, se não, cadastra $estabelecimento = DB::table('estabelecimentos')->where([ ['cnpj', $data->estabelecimento->cnpj], ['endereco', $data->estabelecimento->endereco]])->first(); if(is_null($estabelecimento)){ try { $estabelecimento = Estabelecimento::create([ 'nome' => $data->estabelecimento->nome, 'cnpj' => $data->estabelecimento->cnpj, 'endereco' => $data->estabelecimento->endereco, 'bairro' => $data->estabelecimento->bairro, 'cep' => $data->estabelecimento->cep, 'cidade' => $data->estabelecimento->cidade, 'uf' => $data->estabelecimento->uf, 'telefone' => $data->estabelecimento->telefone ]); } catch (\Illuminate\Database\QueryException $e) { // echo "<br/>Falha ao cadastrar estabelecimento ".$data->estabelecimento->nome; $ERROS++; } } try { $nota = Nota::create([ 'user_id' => 1, 'estabelecimento_id' => $estabelecimento->id, 'serie' => $data->nfce->serie, 'chave_acesso' => $key, 'data_emissao' => $data->nfce->data_emissao, 'hora_emissao' => $data->nfce->hora_emissao ]); } catch (\Illuminate\Database\QueryException $e) { // echo "<br/>Falha ao cadastrar nota"; $ERROS++; } foreach ($data->produtos as $produto) { $produto_result = DB::table('produtos') ->join('notas', 'produtos.nfce_id', '=', 'notas.id') ->where([ ['produtos.codigo', $produto->codigo], ['notas.estabelecimento_id', $estabelecimento->id]]) ->first(); $produto->valor = floatval(str_replace(",", ".", $produto->valor)); if(is_null($produto_result)){ try { $produto = Produto::create([ 'nfce_id' => $nota->id, 'codigo' => $produto->codigo, 'descricao' => strtoupper($produto->descricao), 'valor' => $produto->valor, 'un' => strtoupper($produto->un), 'ean' => $produto->ean, 'ncm' => $produto->ncm ]); } catch (\Illuminate\Database\QueryException $e) { // echo "<br/>Falha ao cadastrar produto ".$produto->descricao." da nota ".$key; $ERROS++; break; } }else{ if($produto_result->data_emissao > $nota->data_emissao){ try{ $produto_result = DB::table('produtos') ->where('id', $produto_result->id) ->update(['valor' => $produto->valor]); } catch (\Illuminate\Database\QueryException $e) { // echo "<br/>Falha ao atualizar produto ".$produto->descricao." da nota ".$nota->id." ERRO: ".$e; $ERROS++; break; } } } } // Fecha foreach de produtos if($ERROS){ DB::rollback(); // echo "<br/>ERRO - ".$key.""; return "400"; }else{ DB::commit(); // echo "Ok - ".$key."<br/>"; return "200"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function integrate_nfces(){\n $nfces = DB::table('nfces')->get();\n\n foreach ($nfces as $nfce) {\n DB::beginTransaction();\n\n $ERROS = 0;\n // Verifica se Nota existe, se sim, pula para a próxima\n $nota = DB::table('notas')->where('chave_acesso', $nfce->access_key)->first();\n if(!is_null($nota)){\n echo \"<br/>Nota fiscal já cadastrada. \".$nota->chave_acesso;\n continue;\n }\n\n $data = self::get_all_data($nfce->access_key, true);\n\n $data = json_decode(json_encode ($data), FALSE);\n\n $data->nfce->data_emissao = preg_replace('#(\\d{2})/(\\d{2})/(\\d{4})#', '$3-$2-$1', $data->nfce->data_emissao);\n\n // Verifica se Estabelecimento existe, se não, cadastra\n $estabelecimento = DB::table('estabelecimentos')->where([\n ['cnpj', $data->estabelecimento->cnpj], \n ['endereco', $data->estabelecimento->endereco]])->first();\n\n if(is_null($estabelecimento)){\n try {\n $estabelecimento = Estabelecimento::create([\n 'nome' => $data->estabelecimento->nome,\n 'cnpj' => $data->estabelecimento->cnpj,\n 'endereco' => $data->estabelecimento->endereco\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n echo \"<br/>Falha ao cadastrar estabelecimento \".$data->estabelecimento->nome;\n $ERROS++;\n continue;\n }\n }\n\n try {\n $nota = Nota::create([\n 'user_id' => 1,\n 'estabelecimento_id' => $estabelecimento->id,\n 'serie' => $data->nfce->serie,\n 'chave_acesso' => $nfce->access_key,\n 'data_emissao' => $data->nfce->data_emissao,\n 'hora_emissao' => $data->nfce->hora_emissao\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n echo \"<br/>Falha ao cadastrar nota do ID: \".$nfce->id.\" e chave \".$nfce->access_key;\n $ERROS++;\n continue;\n }\n\n foreach ($data->produtos as $produto) {\n $produto_result = DB::table('produtos')\n ->join('notas', 'produtos.nfce_id', '=', 'notas.id')\n ->where([\n ['produtos.codigo', $produto->codigo], \n ['notas.estabelecimento_id', $estabelecimento->id]])\n ->first();\n\n $produto->valor = floatval(str_replace(\",\", \".\", $produto->valor));\n\n if(is_null($produto_result)){\n try {\n $produto = Produto::create([\n 'nfce_id' => $nota->id,\n 'codigo' => $produto->codigo,\n 'descricao' => strtoupper($produto->descricao),\n 'valor' => $produto->valor,\n 'un' => strtoupper($produto->un)\n ]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n echo \"<br/>Falha ao cadastrar produto \".$produto->descricao.\" da nota \".$nfce->access_key;\n $ERROS++;\n break;\n }\n }else{\n if($produto_result->data_emissao > $nota->data_emissao){\n try{\n $produto_result = DB::table('produtos')\n ->where('id', $produto_result->id)\n ->update(['valor' => $produto->valor]);\n } catch (\\Illuminate\\Database\\QueryException $e) {\n echo \"<br/>Falha ao atualizar produto \".$produto->descricao.\" da nota \".$nota->id.\" ERRO: \".$e;\n $ERROS++;\n break;\n }\n }\n }\n } // Fecha foreach de produtos\n if($ERROS){\n DB::rollback();\n echo \"<br/>ERRO - \".$nfce->access_key.\"\";\n return;\n }else{\n DB::commit();\n echo \"Ok - \".$nfce->access_key.\"<br/>\";\n }\n } // Fecha foreach de nfces\n return;\n }", "public function store(Request $request)\n {\n //crear primero el ingreso\n $entry = Entry::create([\n 'provider_id' => $request->provider_id,\n 'office_id' => $request->office_id,\n 'mandated' => $request->mandated,\n 'type' => $request->type,\n 'purchase_date' => $request->purchase_date,\n 'purchase_order' => $request->purchase_order,\n 'user_id' => Auth::user()->id\n ]);\n\n foreach ($request->items as $item) {\n if($item['item_serie'] == \"\"){\n $serie = \"Default-serial\";\n }else{\n $serie = $item[\"item_serie\"];\n }\n //Verificar si ya existe un item con este numero de serie\n $existItem = Item::where([\n ['serial_number', '=', $serie],\n ['catalog_id', '=', $item['catalog_id']]\n ])->first();\n\n if ($existItem) {\n //Actualizar el stock y el quien lo actualizo\n $existItem->stock = $existItem->stock + $item['item_amount'];\n $existItem->updated_by = Auth::user()->id;\n\n $existItem->save();\n\n //Guardar el registro\n Log::create([\n 'type' => \"Ingreso\",\n 'entry_id' => $entry->id,\n 'amount' => $item['item_amount'],\n 'item_id' => $existItem->id\n ]);\n\n //Guardar existencias ಥ_ಥ verificar si la tabla de relacion ya existe o hay que crearla\n $existRelationship = DB::select('select * from item_office where item_id = ? AND office_id = ?', [$existItem->id, $entry->office_id]);\n if ($existRelationship) {\n $newStock = $existRelationship[0]->stock + $item['item_amount'];\n //Guardar el registro\n DB::update(\"update item_office set stock = ? where item_id = ? AND office_id = ?\", [$newStock, $existItem->id, $entry->office_id]);\n } else {\n DB::insert('insert into item_office (item_id, office_id, stock) values (?, ?,?)', [$existItem->id, $entry->office_id, $item['item_amount']]);\n }\n } else {\n \n $newItem = Item::create([\n 'catalog_id' => $item['catalog_id'],\n 'serial_number' => $serie,\n 'lot' => $item['item_lot'],\n 'caducity' => $item['item_caducity'],\n 'stock' => $item['item_amount'],\n 'user_id' => Auth::user()->id\n ]);\n\n //Crear el registro\n Log::create([\n 'type' => \"Ingreso\",\n 'entry_id' => $entry->id,\n 'amount' => $item['item_amount'],\n 'item_id' => $newItem->id\n ]);\n\n //Crear la relacion entre sucursal e item\n DB::insert('insert into item_office (item_id, office_id, stock) values (?, ?,?)', [$newItem->id, $entry->office_id, $item['item_amount']]);\n }\n }\n\n return \"ok\";\n }", "public function CreateProduct($naam, $prijs, $geschikt, $specificaties, $foto){\n\n\n try{\n\n\n $sql = \"INSERT INTO `vr_brillen`.`producten` (`naam`, `prijs`, `geschikt`, `specificaties`, `foto`) VALUES ('$naam', '$prijs', '$geschikt', '$specificaties', '$foto');\";\n\n $stmt = $this->DataHandler->Create($sql);\n\n\n }catch (Exception $e){\n throw $e;\n }\n\n\n }", "private function savePremiumProductos($list_materia_prima, $list_productos)\n {\n $idempresa = sfConfig::get('app_premium_empresa');\n $sucursal = sfConfig::get('app_premium_sucursal');\n\n $ordpro = $this->getObject();\n\n // Obteniendo la información de configuracion:\n $almconf = Doctrine_Query::create()->from('Almconf')->fetchOne();\n\n if($idempresa!='' && $sucursal!=''){\n\n $codigo = str_pad($almconf->getCondoc()+1, 8, '0', STR_PAD_LEFT);\n\n\n // Maestro de la salida de almacen\n $cargoenc = new Cargoenc();\n $data = array();\n\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['ordentrab']=' ';\n $data['requisicio']=' ';\n $data['cargado']=0;\n $data['status']=0;\n $data['realizador']= 'Gestión de Producción';\n $data['emisor']= $almconf->getUsuario();\n $data['motivo']='Entradas de Produccion segun Orden de Producción Nro. '.$ordpro->getNumord();\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['estacion']= '000';\n $data['tipoentradasalida']=$almconf->getTipent();\n\n $cargoenc->merge($data);\n $cargoenc->save();\n\n // Actualizar la existencia en la tabla existenc\n foreach ($list_productos as $prod){\n\n $articulo = Doctrine::getTable('Articulo')->findOneBy('codigo', $prod['artcomp']);\n\n if($articulo){\n $existenc = Doctrine_Query::create()\n ->update('Existenc e')\n ->set('existencia','existencia + ('.$prod['cantidad'].')')\n ->where('codigo = ? AND almacen = ?',array($prod['artcomp'],$almconf->getAlmmatpri()));\n $existenc->execute();\n\n $art = Doctrine_Query::create()\n ->update('Articulo e')\n ->set('existencia','existencia + ('.$prod['cantidad'].')')\n ->where('codigo = ?',array($prod['artcomp']));\n $art->execute();\n\n $kardex = new Kardex();\n\n $data = array();\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['codigo']= $prod['artcomp'];\n $data['hora']= date('h:i a');\n $data['grupo']= $articulo->getGrupo();\n $data['origen']= 'C&D';\n $data['concepto']= 'Cargo y descargo # '.$codigo;\n $data['cantidad']= $prod['cantidad'];\n $data['estacion']= '000';\n $data['almacen']= $almconf->getAlmmatpri();\n $data['sumaresta']= 1;\n $data['emisor']= $almconf->getUsuario();\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['aux1']= 0.0;\n $data['aux2']= 0.0;\n $data['aux3']= 0.0;\n $data['tipo_resta']= 0;\n $data['idvalidacion']= ' ';\n\n $kardex->merge($data);\n //$kardex->assignIdentifier();\n $kardex->save();\n\n $cargodet = new Cargodet();\n\n $data = array();\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['status']= 0.0;\n $data['ordentrab']= ' ';\n $data['codigo']= $prod['artcomp'];\n $data['idvalidacion']= OrdProForm::getIdCampo();\n $data['nombre']= $articulo->getNombre();\n $data['grupo']= $articulo->getGrupo();\n $data['subgrupo']= $articulo->getSubgrupo();\n $data['proceso']= 1.0;\n $data['cantidad']= $prod['cantidad'];\n $data['tallas']= ' ';\n $data['colores']= ' ';\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['almacen']= $almconf->getAlmmatpri();\n $data['emisor']= $almconf->getUsuario();\n $data['estacion']= '000';\n $data['usaserial']= 2;\n $data['seriales']= '';\n $data['ubicacion']= '';\n $data['almacenhas']= '';\n $data['precio']= 0.0;\n $data['fechanul']= '0000-00-00';\n $data['useranul']= ' ';\n $data['motivoanul']= ' ';\n $data['lote']= '';\n $data['costo']= 0.0;\n $data['costopromfecha']= 0.0;\n $data['factor']= 0.0;\n $data['tipo']= 0.0;\n\n $cargodet->merge($data);\n $cargodet->save();\n\n }\n }\n\n $ordpro->setDocumentopro($codigo);\n $ordpro->save();\n\n }\n\n\n }", "function import() {\n\t\t// vyprazdnim tabulku\n\t\t$this->truncate();\n\t\t$condition = null;\n\t\t$snProducts = $this->findAllSn();\n\t\tforeach ($snProducts as $snProduct) {\n\t\t\tif ($product = $this->transformSn($snProduct)) {\n\t\t\t\t$this->create();\n\t\t\t\tif (!$this->save($product)) {\n\t\t\t\t\tdebug($product);\n\t\t\t\t\tdebug($this->validationErrors);\n\t\t\t\t\t$this->save($product, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function inserta_estados_envio()\n {\n $this->load->Model('Sepomex_model','SP');\n $estados = $this->SP->get_estados();\n $estados_miele = catalogo('estados_envio',FALSE);\n debug($estados_miele);\n foreach($estados as $k=>$e)\n {\n $data=array();\n $data['estado']=$e;\n $data['productos_porcentaje'] = in_array($e,$estados_miele)?0.00:8.00;\n $data['accesorios_porcentaje'] = in_array($e,$estados_miele)?0.00:8.00;\n $data['consumibles_porcentaje'] = in_array($e,$estados_miele)?0.00:8.00;\n $data['consumibles_monto_fijo'] = $e=='DISTRITO FEDERAL'?100.00:200.00;\n $data['consumibles_monto_minimo_porcentaje'] = 1250.00;\n\n $data['productos_numero'] = 2;\n $data['accesorios_numero'] = 2;\n $data['consumibles_numero'] = 2;\n\n\n $data['created']=date('Y-m-d H:i:s');\n $data['created_by']=$this->session->userdata('id');\n\n $this->db->insert('gastos_envios',$data);\n }\n debug($estados);exit;\n }", "function hacerReserva($reservaProducto){\n\n \t\t\t\t$sql = array();\n\t\t\t\t$valor = array();\n\t\t\t\t$sql1 = array();\n\t\t\t\t$valor1 = array();\n\t\t\t\n\n\t\t\t\t$conecta = new \\Conexion\\Conexion(BDNOMBRE, HOST, USUARIO, CONTRA, CHARSET);\n\n\t\t\t\t$sql[0] ='INSERT INTO reserva_prod (id_reserva, id_usuario, id_producto, id_tienda, cantidad, precio_total, fecha) VALUES (:id_reserva, :id_usuario, :id_producto, :id_tienda, :cantidad, :precio_total, :fecha)';\n\n\t\t\t\t$valor[0]=array(\":id_reserva\"\t=> $reservaProducto->id_reserva,\n\t\t\t\t\t\t\t\t\":id_usuario\"\t=> $reservaProducto->id_usuario,\n\t\t\t\t\t\t\t\t\":id_producto\" \t=> $reservaProducto->id_objeto,\n\t\t\t\t\t\t\t\t\":id_tienda\"\t=> $reservaProducto->id_tienda,\n\t\t\t\t\t\t\t\t\":cantidad\"\t\t=> $reservaProducto->cantidad,\n\t\t\t\t\t\t\t\t\":precio_total\"\t=> $reservaProducto->precio_total,\n\t\t\t\t\t\t\t\t\":fecha\"\t\t=> $reservaProducto->fecha\t\t\n\t\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\n\n\n\t\t\t\t$sql1 ='SELECT estado, stock FROM producto_tienda WHERE id_producto_tienda = :id_producto_tienda';\n\n\t\t\t\t$valor1=array(\":id_producto_tienda\"=>$reservaProducto->id_objetoespecifico);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$conecta->abrirConexion();\n\n\t\t\t\t\n\t\t\t\t$resultado=$conecta->consultaPreparada($sql1, $valor1);\n\n\t\t\t\t$cantidad = $resultado[0]['stock'] - $reservaProducto->cantidad;\n\t\t\t\n\n\n\t\t\t\tif($cantidad==0){\n\n\t\t\t\t$sql[1] ='UPDATE producto_tienda SET stock = 0, estado=3 WHERE id_producto_tienda= :id_producto_tienda';\n\n\t\t\t\t$valor[1]=array(\":id_producto_tienda\" \t=> $reservaProducto->id_objetoespecifico);\n\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\t$sql[1] ='UPDATE producto_tienda SET stock = :stock WHERE id_producto_tienda= :id_producto_tienda';\n\n\t\t\t\t\t$valor[1]=array(\":stock\" => $cantidad, \n\t\t\t\t\t\t\t\t\":id_producto_tienda\" \t=> $reservaProducto->id_objetoespecifico);\n\n\t\t\t\t}\n\n\n\t\t\t\t$resultado=$conecta->actualizarDatos($sql, $valor);\n\n\n\t\t\t\t$conecta->cerrarConexion();\n\n\t\t\t\treturn $cantidad;\n\n \t}", "public static function setTblentregaproducto($nombreproveedor,$fchentre,$numproductpedidos,$numproductentregados,$status,$descripcion,$statusdeposito,$fchcorte,$srcimg1,$srcimg2,$emailcreo,$idtblordencompra,$idtblproveedor,$fchpagoproveedor){\n\t \t\n \n $insert =\"INSERT INTO tblentregaproducto (tblentregaproducto_nombreproveedor,\n\t\ttblentregaproducto_fchentrega,tblentregaproducto_numproductpedidos,\n\t\ttblentregaproducto_numproductentregados,tblentregaproducto_status,tblentregaproducto_descripcion, \n\t\ttblentregaproducto_statusdeposito,tblentregaproducto_fchcortepago,tblentregaproducto_srcimgevidencia1,\n\t\ttblentregaproducto_srcimgevidencia2,tblentregaproducto_fchmodificacion,tblentregaproducto_fchcreacion,\n\t\ttblentregaproducto_emailusuacreo,tblentregaproducto_emailusuamodifico,tblentregaproducto_idtblordencompra,\n\t\ttblentregaproducto_idtblproveedor,tblentregaproducto_fchpagoproveedor) VALUES (?,?,?,?,?,?,?,?,?,?,NOW(),NOW(),?,?,?,?,?)\"; \n\n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$nombreproveedor,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$fchentre,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$numproductpedidos,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(4,$numproductentregados,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(5,$status,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$descripcion,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$statusdeposito,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(8,$fchcorte,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(9,$srcimg1,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(10,$srcimg2,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(11,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(12,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(13,$idtblordencompra,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(14,$idtblproveedor,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(15,$fchpagoproveedor,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }", "function cadastrar($nome, $ISSN, $entidadeMantenedora, $mesDoExemplar, $anoDoExemplar, $numeroDoExemplar, $volumeDoExemplar, $status, $capa){\n $sql = \" INSERT INTO exemplares(nome, ISSN, entidadeMantenedora, mesDoExemplar, anoDoExemplar, numeroDoExemplar, volumeDoExemplar, status, capa) \";\n $sql .= \" VALUES('\".$nome.\"','\".$ISSN.\"','\".$entidadeMantenedora.\"','\".$mesDoExemplar.\"','\".$anoDoExemplar.\"','\".$numeroDoExemplar.\"','\".$volumeDoExemplar.\"','\".$status.\"','\".$capa.\"')\";\n $this->db->execute($sql);\n }", "public function actionCreateConsumo()\n\t{\n\t\t// $this->performAjaxValidation($model);\n\t\n\t\tif(isset($_POST['ErpnetOrdem']))\n\t\t{\n\t\t\t$model=new ErpnetOrdem;\n\t\t\t$model->setScenario('consumo');\n\t\t\t$model->attributes=$_POST['ErpnetOrdem'];\n\t\t\t$desc=explode(':', $_POST['ErpnetOrdem']['id_wbs_destino']);\n\t\t\t$model->id_wbs_destino=$desc[0];\n\t\t\t$transaction=$model->dbConnection->beginTransaction();\n\t\n\t\t\tif ( (isset($_POST['ErpnetOrdemItem']))&&($model->save()) ) {\n\t\t\t\t$sucesso='';\n\t\t\t\t$valor=0;\n\t\t\t\tfor ($i=0;$i<count($_POST['ErpnetOrdemItem']);$i++) {\n\t\t\t\t\t$modelOrdemItem=new ErpnetOrdemItem;\n\t\t\t\t\t$modelOrdemItem->setScenario('consumo');\n\t\t\t\t\t$modelOrdemItem->attributes=$_POST['ErpnetOrdemItem'][$i];\n\t\t\t\t\t$modelOrdemItem->id_ordem=$model->getPrimaryKey();\n\t\t\t\t\t$modelOrdemItem->data_termino=$model->data_termino;\n\t\t\t\t\t$valor=$valor+($modelOrdemItem->valor*Helpers::getQuote(time(),$modelOrdemItem->moeda)*$modelOrdemItem->quantidade);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($modelOrdemItem->save()) {\n\t\t\t\t\t\t// Pega dados do produto\n\t\t\t\t\t\t$modelProduto=ErpnetProduto::model()->findByPk($modelOrdemItem->id_produto);\n\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$modelEstoque=new ErpnetEstoque;\n\t\t\t\t\t\t// Cria movimento de estoque\n\t\t\t\t\t\t$modelEstoque->id_produto=$modelOrdemItem->id_produto;\n\t\t\t\t\t\tif ($modelOrdemItem->quantidade>0) $modelEstoque->quantidade=$modelOrdemItem->quantidade*(-1);\n\t\t\t\t\t\telse $modelEstoque->quantidade=$modelOrdemItem->quantidade;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$modelEstoque->id_ordem=$model->getPrimaryKey();\n\t\t\t\t\t\t//$modelEstoque->id_ordem_item=$modelOrdemItem->getPrimaryKey();\n\t\t\t\t\t\t$modelEstoque->id_wbs=$model->id_wbs;\n\t\t\t\t\t\t$modelEstoque->descricao_wbs=$model->idWbs->concatened;\n\t\t\t\t\t\t$modelEstoque->data_movimento=date('d/m/Y',strtotime($model->data_termino));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$modelEstoque->empresa=Yii::app()->user->empresa;\n\t\t\t\t\t\t$modelEstoque->usuario=Yii::app()->user->name;\n\t\t\t\t\t\t$modelEstoque->tipo='saida';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//*\n\t\t\t\t\t\t// Cria movimento de faturamento\n\t\t\t\t\t\t$modelFatura=new ErpnetFatura;\n\t\t\t\t\t\t$modelFatura->id_produto=$modelOrdemItem->id_produto;\n\t\t\t\t\t\tif ($modelOrdemItem->quantidade<0) $modelFatura->quantidade=$modelOrdemItem->quantidade*(-1);\n\t\t\t\t\t\telse $modelFatura->quantidade=$modelOrdemItem->quantidade;\n\t\n\t\t\t\t\t\t$modelFatura->id_ordem=$model->getPrimaryKey();\n\t\t\t\t\t\t$modelFatura->id_wbs=$model->id_wbs_destino;\n\t\t\t\t\t\t//$modelFatura->descricao_wbs=$model->idWbs->concatened;\n\t\t\t\t\t\t$modelFatura->data_movimento=date('d/m/Y',strtotime($model->data_termino));\n\t\n\t\t\t\t\t\t$modelFatura->empresa=Yii::app()->user->empresa;\n\t\t\t\t\t\t$modelFatura->usuario=Yii::app()->user->name;\n\t\t\t\t\t\t$modelFatura->tipo='entrada';\n\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t// Pega o valor e moeda do cadastro do produto\n\t\t\t\t\t\tif ($modelOrdemItem->valor==0) {\n\t\t\t\t\t\t\t$modelFatura->valor=$modelProduto->valor;\n\t\t\t\t\t\t\t$modelFatura->moeda=$modelProduto->moeda;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$modelFatura->valor=$modelOrdemItem->valor;\n\t\t\t\t\t\t\t$modelFatura->moeda=$modelOrdemItem->moeda;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif ( ($modelFatura->save())&&($modelEstoque->save()) ) {\n\t\t\t\t\t\t\t$sucesso=$sucesso.$modelOrdemItem->idProduto->concatened.': '.$modelOrdemItem->quantidade.'<br>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//$transactionOrdemItem->rollback();\n\t\t\t\t\t\t\tYii::app()->user->setFlash('erro',utf8_encode(Yii::t('erpnetUi', '1viewCreateFlash', array(), 'i18n')));\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//$transactionOrdemItem->rollback();\n\t\t\t\t\t\tYii::app()->user->setFlash('erro',utf8_encode(Yii::t('erpnetUi', '2viewCreateFlash', array(), 'i18n')));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$model->valor=$valor;\n\t\t\t\t$model->data_termino=date('d/m/Y',strtotime($model->data_termino));\n\t\t\t\t$model->save();\n\t\n\t\t\t\tif ($sucesso=='') {\n\t\t\t\t\t$transaction->rollback();\n\t\t\t\t\t//Yii::app()->user->setFlash('erro',utf8_encode(Yii::t('erpnetUi', '3viewCreateFlash', array(), 'i18n')));\n\t\t\t\t} else {\n\t\t\t\t\t$transaction->commit();\n\t\t\t\t\tYii::app()->user->setFlash('ordem',$sucesso.' <br> '.utf8_encode(Yii::t('erpnetUi', 'viewCreateFlash', array(), 'i18n')));\n\t\t\t\t}\n\t\t\t\tif(Yii::app()->user->hasFlash('ordem')) $this->redirect(array('createConsumo'));\n\t\t\t}\n\t\t}\n\t\n\t\t$model=new ErpnetOrdem;\n\t\t$model->setScenario('consumo');\n\t\t$modelOrdemItem=new ErpnetOrdemItem;\n\t\t$modelOrdemItem->setScenario('consumo');\n\t\t$modelEstoque=new ErpnetEstoque;\n\t\t$modelFatura=new ErpnetFatura;\n\t\n\t\t$tabular=array(\n\t\t\t\t'models'=>array($modelOrdemItem),\n\t\t\t\t'containerTagName'=>'table',\n\t\t\t\t'headerTagName'=>'thead',\n\t\t\t\t'inputContainerTagName'=>'tbody',\n\t\t\t\t'inputTagName'=>'tr',\n\t\t\t\t'addTemplate'=>'<tbody><tr><td colspan=\"3\">{link}</td></tr></tbody>',\n\t\t\t\t'addLabel'=>Yii::t('ui','Adicionar novo item'),\n\t\t\t\t'addHtmlOptions'=>array('class'=>'blue pill'),\n\t\t\t\t'removeTemplate'=>'<td>{link}</td>',\n\t\t\t\t'removeLabel'=>Yii::t('ui','Retirar'),\n\t\t\t\t'removeHtmlOptions'=>array('class'=>'red pill'),\n\t\t);\n\t\n\t\t$tabular['inputView']='extensions/_tabularInputConsumo';\n\t\t$tabular['inputUrl']=$this->createUrl('addTabularInputsConsumo');\n\t\t$tabular['header']='<tr><td>'.\n\t\t\t\tCHtml::activeLabelEX($modelOrdemItem,'id_produto',array('class'=>'input-xlarge')).'</td><td>'.\n\t\t\t\t//CHtml::activeLabelEX(ErpnetOrdemItem::model(),'data_entrega',array('class'=>'input-small')).'</td><td>'.\n\t\tCHtml::activeLabelEX($modelOrdemItem,'quantidade',array('class'=>'input-small')).'</td><td>'.\n\t\tCHtml::activeLabelEX($modelOrdemItem,'valor',array('class'=>'input-small')).'</td><td>'.\n\t\tCHtml::activeLabelEX($modelOrdemItem,'moeda',array('class'=>'input-small')).'</td>'.\n\t\t'</tr>';\n\t\n\t\t$this->render('createOrdemServico',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'modelEstoque'=>$modelEstoque,\n\t\t\t\t'modelFatura'=>$modelFatura,\n\t\t\t\t'modelOrdemItem'=>$modelOrdemItem,\n\t\t\t\t'tabular'=>$tabular,\n\t\t\t\t'fileForm'=>'_formConsumo',\n\t\t\t\t'fileFormHeader'=>'_formConsumoHeader',\n\t\t));\n\t}", "public function create()\n {\n //\n $rules = [\n 'folio' => 'required|is_unique[sales.folio]',\n 'client' => 'required',\n ];\n\n if (!$this->validate($rules))\n return $this->failValidationErrors($this->validator->listErrors());\n $folio = $this->request->getPost('folio');\n $client = $this->request->getPost('client');\n if (!$client = $this->client->find($client))\n return $this->failNotFound('Client doesn\\'t exist!.');\n if (!$items = $this->temp->where('hash', $folio)->findAll())\n return $this->failNotFound('Need to add items!.');\n $subtotal = 0;\n $iva = 0;\n foreach ($items as $item) {\n $iva += $item->iva;\n $subtotal += $item->subtotal;\n }\n $this->entity->fill([\n 'folio' => $folio,\n 'iva' => $iva,\n 'subtotal' => $subtotal,\n 'total' => $iva + $subtotal,\n 'client_id' => $this->request->getPost('client'),\n 'user_id' => session()->user_id\n ]);\n if (!$this->model->insert($this->entity))\n return $this->failValidationErrors($this->validator->listErrors());\n $this->temp->where('hash', $folio)->delete();\n $this->temp->purgeDeleted();\n foreach ($items as $item) {\n $product = $this->product->find($item->product_id);\n $product->stock -= $item->quantity;\n $product->total -= ($item->quantity * $product->cost);\n $this->product->save($product);\n $data = [\n 'folio' => $item->hash,\n 'details' => $item->details,\n 'price' => $item->price,\n 'quantity' => $item->quantity,\n 'subtotal' => $item->subtotal,\n 'iva' => $item->iva,\n 'total' => $item->total,\n 'new_stock' => $product->stock,\n 'sale_id' => $this->model->insertID,\n 'product_id' => $product->id,\n ];\n if(!$this->details->insert($data))\n return $this->failValidationErrors($this->details->validator->listErrors());\n }\n return $this->respond([\n 'message' => 'Now you must be add new sales price',\n 'data' => [\n 'folio' => $folio,\n 'client' => $client->name,\n 'subtotal' => number_format($subtotal, 2, '.', ','),\n 'iva' => number_format($iva, 2, '.', ','),\n 'total' => number_format($iva + $subtotal, 2, '.', ','),\n ]\n ]);\n }", "static public function mdlIngresarProducto($tabla, $datos){\n\t\n\t\t$stmt = Conexion::conectarEnlace()->prepare(\"INSERT INTO $tabla(`id`,`nombre`, `descripcion`, `codigo`, `nrocomprobante`, `cantventa`, `id_rubro`, `cantminima`, `cuotas`, `importe`, `obs`) VALUES (:id,:nombre,:descripcion,:codigo,:nrocomprobante,:cantventa,:id_rubro,:cantminima,:cuotas,:importe,:obs)\");\n\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":descripcion\", $datos[\"descripcion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nrocomprobante\", $datos[\"nrocomprobante\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":cantventa\", $datos[\"cantventa\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_rubro\", $datos[\"id_rubro\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":cantminima\", $datos[\"cantminima\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":cuotas\", $datos[\"cuotas\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":importe\", $datos[\"importe\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":obs\", $datos[\"obs\"], PDO::PARAM_STR);\n\t\t\n\t\n\n\t\tif($stmt->execute()){\n\n\t\t\t return \"ok\";\n\n\t\t\t\n\t\t}else{\n\n\t\t\t return \"error\";\n\n\t\t\n\t\t}\n\n\t\t// $stmt->close();\n\t\t// $stmt = null;\n\n\t}", "public static function settblcarritoproductnuevcotiza($numpersonas,$fchentrega,$srcimgproducto,$tipoevento,$sabores,$comentarios,$idtblordencotizador,$emailcreo){\n \n $insert =\"INSERT INTO tblcarritoproductnuevcotiza (tblcarritoproductnuevcotiza_numpersonas,tblcarritoproductnuevcotiza_fchentrega,tblcarritoproductnuevcotiza_srcimg,tblcarritoproductnuevcotiza_tipodeevento,tblcarritoproductnuevcotiza_sabores,tblcarritoproductnuevcotiza_comentarios,tblordencotizador_idtblordencotizador,tblcarritoproductnuevcotiza_fchmodificacion,tblcarritoproductnuevcotiza_fchcreacion,tblcarritoproductnuevcotiza_emailusuacreo,tblcarritoproductnuevcotiza_emailusuamodifico) VALUES (?,?,?,?,?,?,?,NOW(),NOW(),?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$numpersonas,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(2,$fchentrega,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$srcimgproducto,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(4,$tipoevento,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$sabores,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$comentarios,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$idtblordencotizador,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(8,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(9,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }", "public function insertIntoDB()\n {\n if (isset($this->sell) OR isset($this->buy)) {\n $sdeClass = \\iveeCore\\Config::getIveeClassName('SDE');\n\n //check if row already exists\n $res = $sdeClass::instance()->query(\n \"SELECT regionID FROM iveePrices\n WHERE regionID = \" . $this->regionID . \"\n AND typeID = \" . $this->typeID . \"\n AND date = '\" . date('Y-m-d', $this->generatedAt) . \"';\"\n );\n\n //if row already exists\n if ($res->num_rows == 1) {\n //update data\n $updatetData = array();\n if (isset($this->sell)) \n $updatetData['sell'] = $this->sell;\n if (isset($this->buy)) \n $updatetData['buy'] = $this->buy;\n if (isset($this->avgSell5OrderAge)) \n $updatetData['avgSell5OrderAge'] = $this->avgSell5OrderAge;\n if (isset($this->avgBuy5OrderAge)) \n $updatetData['avgBuy5OrderAge'] = $this->avgBuy5OrderAge;\n if (isset($this->demandIn5)) \n $updatetData['demandIn5'] = $this->demandIn5;\n if (isset($this->supplyIn5)) \n $updatetData['supplyIn5'] = $this->supplyIn5;\n\n $where = array(\n 'typeID' => $this->typeID,\n 'regionID' => $this->regionID,\n 'date' => date('Y-m-d', $this->generatedAt)\n );\n\n //build update query\n $sql = $sdeClass::makeUpdateQuery('iveePrices', $updatetData, $where);\n } else { //insert data\n $insertData = array(\n 'typeID' => $this->typeID,\n 'regionID' => $this->regionID,\n 'date' => date('Y-m-d', $this->generatedAt)\n );\n\n if (isset($this->sell)) \n $insertData['sell'] = $this->sell;\n if (isset($this->buy)) \n $insertData['buy'] = $this->buy;\n if (isset($this->avgSell5OrderAge)) \n $insertData['avgSell5OrderAge'] = $this->avgSell5OrderAge;\n if (isset($this->avgBuy5OrderAge)) \n $insertData['avgBuy5OrderAge'] = $this->avgBuy5OrderAge;\n if (isset($this->demandIn5)) \n $insertData['demandIn5'] = $this->demandIn5;\n if (isset($this->supplyIn5)) \n $insertData['supplyIn5'] = $this->supplyIn5;\n\n //build insert query\n $sql = $sdeClass::makeUpsertQuery('iveePrices', $insertData);\n }\n\n //add stored procedure call to complete the update\n $sql .= \"CALL iveeCompletePriceUpdate(\" . $this->typeID . \", \" . $this->regionID . \", '\"\n . date('Y-m-d H:i:s', $this->generatedAt) . \"'); COMMIT;\" . PHP_EOL;\n\n //execute the combined queries\n $sdeClass::instance()->multiQuery($sql);\n\n if (VERBOSE) {\n $ecClass = \\iveeCore\\Config::getIveeClassName('EmdrConsumer');\n $ec = $ecClass::instance();\n echo \"P: \" . $ec->getTypeNameById($this->typeID) . ' (' . $this->typeID . '), '\n . $ec->getRegionNameById($this->regionID) . ' ('. $this->regionID . ')' . PHP_EOL;\n }\n }\n }", "public function AgregarRegraNova(array $lis_variables_pre, array $lis_operadores_pre, array $lis_valores_pre, array $lits_numerico_o_literal, array $lis_conectores_pre, array $lis_variables_con, array $lis_operadores_con, array $lis_valores_con, array $lis_conectores_con, $ni){\n $em = $this->em;\n $regra = new Regra_producao();\n $regra->setNombre(\"R\".count($this->list));\n $regra->setProblema($this->problemaEntity);\n //beginTrans\n $em->beginTransaction();\n $em->persist($regra);\n foreach ($lis_variables_pre as $key=>$value) {\n $facto = new Facto();\n $facto->setVariavel($value);\n $facto->setOperador($lis_operadores_pre[$key]);\n $facto->setValorBooleano(false);\n $facto->setValorNumerico($lis_valores_pre[$key]);\n $facto->setValorLiteral(\"\");\n if ($lits_numerico_o_literal[$key]!=\"num\") {\n $facto->setValorNumerico(0);\n $facto->setValorLiteral($lis_valores_pre[$key]);\n\n }\n $em->persist($facto);\n $regraFacto = new RegraFacto();\n $regraFacto->setFacto($facto);\n $regraFacto->setPremisas(\"pre\");\n $premisa = new Premisas();\n $premisa->setPremisas($regraFacto->getPremisas());\n $regraFacto->setRegra($regra);\n $em->persist($regraFacto);\n $em->persist($premisa);\n $regra->AgregarRegraFacto($regraFacto);\n \n if ($key<count($lis_conectores_pre)) {\n $regra->setRegraConector($lis_conectores_pre[$key]);\n $conector = new Conector();\n $conector->setSignal($lis_conectores_pre[$key]);\n $regra->AgregarConectorPremisa($conector);\n $regraConector = new RegraConector();\n $regraConector->setRegra($regra);\n $regraConector->setConector($conector);\n $regraConector->setPremisas(\"pre\");\n $regra->AgregarRegraConector($regraConector);\n $em->persist($conector);\n $em->persist($regraConector);\n }\n }\n\n\n\n\n foreach ($lis_variables_con as $key=>$value) {\n $facto = new Facto();\n $facto->setVariavel($lis_variables_con[$key]);\n $facto->setOperador($lis_operadores_con[$key]);\n $facto->setValorBooleano(false);\n $facto->setValorNumerico(0);\n $facto->setValorLiteral($lis_valores_con[$key]);\n if ($lis_valores_con[$key]!=\"\") {\n $facto->setValorNumerico($lis_valores_con[$key]);\n $facto->setValorLiteral(\"\");\n }\n $regra->setNodoConclusion($facto);\n $regraFacto = new RegraFacto();\n $regraFacto->setPremisas(\"con\");\n $regraFacto->setRegra($regra);\n $regraFacto->setFacto($facto);\n $em->persist($regraFacto);\n $regra->AgregarRegraFacto($regraFacto);\n if ($key<count($lis_conectores_con)) {\n $regra->setConectorConclusion($lis_conectores_con[$key]);\n $conector = new Conector();\n $conector->setSignal($lis_conectores_con[$key]);\n $regraConector = new RegraConector();\n $regraConector->setRegra($regra);\n $regraConector->setConector($conector);\n $regraConector->setPremisas(\"con\");\n $em->persist($conector);\n $em->persist($regraConector);\n $regra->AgregarRegraConector($regraConector);\n\n }\n\n\n $regra->setNivel($ni);\n// $contador =array_reduce($this->list,function($a,$b)use($ni){\n// if ($b instanceof Regra_producao) {\n// if ($b->getNivel()==$ni) {\n// $a=$a+1;\n// }\n// }\n// return $a;\n// });\n\n $contador = count(array_filter($this->list,function($iter)use($ni){\n return $iter instanceof Regra_producao && $iter->getNivel()==$ni;\n }));\n\n $this->list[$contador]=$regra;\n\n $em->persist($facto);\n $em->persist($regraFacto);\n $em->persist($regra);\n\n }\n\n try{\n $em->flush();\n $em->commit();\n }\n catch (\\Exception $e){\n $em->rollback();\n throw $e;\n }\n\n }", "public static function setTblproducto($nombreproduct, $descripcion,$ingredientes,$seo,$promcalif,$activado,$idtblproveedor,$idtblcategproduc,$idtblclasifproduct,$emailcreo){\n \n $insert =\"INSERT INTO tblproducto (\n tblproducto_nombre,\n tblproducto_descripcion,\n tblproducto_ingredientes,\n tblproducto_seo,\n tblproducto_promcalificacion,\n tblproducto_activado,\n tblproveedor_idtblproveedor,\n tblcategproduct_idtblcategproduct,\n tblclasifproduct_idtblclasifproduct,\n tblproducto_fchmodificacion,\n tblproducto_fchcreacion,\n tblproducto_emailusuacreo,\n tblproducto_emailusuamodifico) VALUES (?,?,?,?,?,?,?,?,?,NOW(),NOW(),?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$nombreproduct,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$descripcion,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$ingredientes,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(4,$seo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$promcalif,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$activado,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(7,$idtblproveedor,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(8,$idtblcategproduc,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(9,$idtblclasifproduct,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(10,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(11,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }", "private function savePremiumMatPri($list_materia_prima, $list_productos)\n {\n $idempresa = sfConfig::get('app_premium_empresa');\n $sucursal = sfConfig::get('app_premium_sucursal');\n\n $ordpro = $this->getObject();\n\n // Obteniendo la información de configuracion:\n $almconf = Doctrine_Query::create()->from('Almconf')->fetchOne();\n \n if($idempresa!='' && $sucursal!=''){\n\n $codigo = str_pad($almconf->getCondoc()+1, 8, '0', STR_PAD_LEFT);\n\n\n // Maestro de la salida de almacen\n $cargoenc = new Cargoenc();\n $data = array();\n\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['ordentrab']=' ';\n $data['requisicio']=' ';\n $data['cargado']=0;\n $data['status']=0;\n $data['realizador']= 'Gestión de Producción';\n $data['emisor']= $almconf->getUsuario();\n $data['motivo']='Salida De Materia Prima según Orden de Producción Nro. '.$ordpro->getNumord();\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['estacion']= '000';\n $data['tipoentradasalida']=$almconf->getTipsal();\n\n $cargoenc->merge($data);\n $cargoenc->save();\n\n // Actualizar la existencia en la tabla existenc\n foreach ($list_materia_prima as $matpri){\n\n $articulo = Doctrine::getTable('Articulo')->findOneBy('codigo', $matpri['artcomp']);\n\n if($articulo){\n $existenc = Doctrine_Query::create()\n ->update('Existenc e')\n ->set('existencia','existencia - ('.$matpri['cantidad'].')')\n ->where('codigo = ? AND almacen = ?',array($matpri['artcomp'],$almconf->getAlmmatpri()));\n $existenc->execute();\n\n $articulo = Doctrine_Query::create()\n ->update('Articulo e')\n ->set('existencia','existencia - ('.$matpri['cantidad'].')')\n ->where('codigo = ?',array($matpri['artcomp']));\n $articulo->execute();\n\n $kardex = new Kardex();\n\n $data = array();\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['codigo']= $matpri['artcomp'];\n $data['hora']= date('h:i a');\n $data['grupo']= $articulo->getGrupo();\n $data['origen']= 'C&D';\n $data['concepto']= 'Cargo y descargo # '.$codigo;\n $data['cantidad']= $matpri['cantidad'];\n $data['estacion']= '000';\n $data['almacen']= $almconf->getAlmmatpri();\n $data['sumaresta']= 2;\n $data['emisor']= $almconf->getUsuario();\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['aux1']= 0.0;\n $data['aux2']= 0.0;\n $data['aux3']= 0.0;\n $data['tipo_resta']= 0;\n $data['idvalidacion']= ' ';\n\n $kardex->merge($data);\n //$kardex->assignIdentifier();\n $kardex->save();\n\n $cargodet = new Cargodet();\n\n $data = array();\n $data['id_empresa']= $idempresa;\n $data['agencia']= $sucursal;\n $data['documento']= $codigo;\n $data['status']= 0.0;\n $data['ordentrab']= ' ';\n $data['codigo']= $matpri['artcomp'];\n $data['idvalidacion']= $this->getIdCampo();\n $data['nombre']= $articulo->getNombre();\n $data['grupo']= $articulo->getGrupo();\n $data['subgrupo']= $articulo->getSubgrupo();\n $data['proceso']= 2.0;\n $data['cantidad']= $matpri['cantidad'];\n $data['tallas']= ' ';\n $data['colores']= ' ';\n $data['fecha']= date('Y-m-d',strtotime($ordpro->getFecord()));\n $data['almacen']= $almconf->getAlmmatpri();\n $data['emisor']= $almconf->getUsuario();\n $data['estacion']= '000';\n $data['usaserial']= 2;\n $data['seriales']= '';\n $data['ubicacion']= '';\n $data['almacenhas']= '';\n $data['precio']= 0.0;\n $data['fechanul']= '0000-00-00';\n $data['useranul']= ' ';\n $data['motivoanul']= ' ';\n $data['lote']= '';\n $data['costo']= 0.0;\n $data['costopromfecha']= 0.0;\n $data['factor']= 0.0;\n $data['tipo']= 0.0;\n\n $cargodet->merge($data);\n $cargodet->save();\n\n }\n\n\n }\n\n // actualizamos OrdPro\n $ordpro->setDocumento($codigo);\n $ordpro->save();\n\n // Actualizamos el contador de documentos\n $almconf->setCondoc($almconf->getCondoc()+1);\n $almconf->save();\n\n }\n\n }", "function insertProduct ($connection, $nome, $preco, $description){\n $query = \"insert into products (item, price, description) values ('{$nome}', {$preco}, '{$description}')\";\n return mysqli_query($connection, $query);\n }", "function a_stock_produccion($nro_orden,$id_licitacion,$id_producto,$id_proveedor,$cant,$id_fila)\r\n{global $db,$_ses_user;\r\n\r\n $db->StartTrans();\r\n\r\n $fecha_modif=date(\"Y-m-d H:i:s\",mktime());\r\n $comentario=\"Incremento generado al agregar los productos a Stock de Producción, mediante la Orden de Compra Nº $nro_orden\";\r\n\r\n\r\n //traemos el id del deposito de Produccion\r\n $query=\"select id_deposito from depositos where nombre='Produccion'\";\r\n $dep_prod=sql($query,\"<br>Error al traer el id del deposito de Produccion<br>\") or fin_pagina();\r\n $id_deposito=$dep_prod->fields[\"id_deposito\"];\r\n\r\n //revisamos si el producto-proveedor ya tiene una entrada para esta licitacion y esta OC, dentro de la tabla en_produccion\r\n $query=\"select id_en_produccion from en_produccion\r\n where id_licitacion=$id_licitacion and nro_orden=$nro_orden and id_producto=$id_producto and id_proveedor=$id_proveedor\";\r\n $actualizar_entrada=sql($query,\"<br>Error al revisar si existe entrada para el producto<br>\") or fin_pagina();\r\n\r\n //si existe entrada de antes (se entrego una parte antes y ahora el resto, actualizamos dicha entrada\r\n //die(\"AAA\".$actualizar_entrada->fields[\"id_en_produccion\"]);\r\n if($actualizar_entrada->fields[\"id_en_produccion\"]!=\"\")\r\n {\r\n $id_en_produccion=$actualizar_entrada->fields[\"id_en_produccion\"];\r\n\r\n //como existe entrada en la tabla en_produccion, es claro que existe tambien la correspondiente entrada en stock\r\n $query=\"update stock set cant_disp=cant_disp+$cant, comentario='$comentario'\r\n\t where id_producto=$id_producto AND id_deposito=$id_deposito AND id_proveedor=$id_proveedor\";\r\n sql($query,\"<br>Error al actualizar el stock de produccion<br>\") or fin_pagina();\r\n\r\n //actualizamos la cantidad en la correspondiente entrada en la tabla en_produccion\r\n $query=\"update en_produccion set cantidad=cantidad+$cant\r\n where id_en_produccion=$id_en_produccion\";\r\n sql($query,\"<br>Error al actualizar la tabla en produccion<br>\") or fin_pagina();\r\n\r\n }//de if($actualizar_entrada->[\"id_en_produccion\"]!=\"\")\r\n else//sino, creamos una nueva entrada, para la tabla en_produccion\r\n {\r\n //insertamos precio si no existe con este proveedor\r\n $sql=\"select id_producto from precios where id_producto=$id_producto and id_proveedor=$id_proveedor \";\r\n $result=sql($sql,\"<br>Error al buscar el precio para stock de produccion<br>\") or fin_pagina();\r\n $cant_precios=$result->RecordCount();\r\n if($cant_precios==0)\r\n {\r\n \t//traemos el precio de la fila\r\n \t$query=\"select precio_unitario from fila where id_fila=$id_fila\";\r\n \t$precio=sql($query,\"<br>Error al traer el precio de la fila<br>\") or fin_pagina();\r\n\r\n\tinsertar_precio($id_producto,$id_proveedor,$precio->fields[\"precio_unitario\"],0);\r\n }\r\n\r\n //revisamos si esta la entrada para ese producto, proveedor, deposito, en el stock.\r\n $query=\"select count(*)as cuenta from stock\r\n where id_producto=$id_producto and id_deposito=$id_deposito and id_proveedor=$id_proveedor\";\r\n $esta=sql($query,\"<br>Error al revisar si existe la entrada en la tabla stock<br>\") or fin_pagina();\r\n\r\n if($esta->fields[\"cuenta\"]==0)\r\n {//insertamos la nueva entrada en la tabla stock, si no existe\r\n $query=\"insert into stock(id_producto,id_deposito,id_proveedor,cant_disp,comentario,last_user,last_modif)\r\n \tvalues($id_producto,$id_deposito,$id_proveedor,$cant,'$comentario','\".$_ses_user['login'].\"','$fecha_modif')\";\r\n sql($query,\"<br>Error al insertar el stock de produccion<br>\") or fin_pagina();\r\n }\r\n else\r\n {\r\n //como existe entrada en la tabla stock, la actualizamos con la cantidad correspondiente\r\n $query=\"update stock set cant_disp=cant_disp+$cant, comentario='$comentario'\r\n\t where id_producto=$id_producto AND id_deposito=$id_deposito AND id_proveedor=$id_proveedor\";\r\n sql($query,\"<br>Error al actualizar el stock de produccion<br>\") or fin_pagina();\r\n }\r\n\r\n //creamos la entrada necesaria en la tabla en_produccion\r\n $query=\"select nextval('en_produccion_id_en_produccion_seq') as id_en_produccion\";\r\n $id_en_prod=sql($query,\"<br>Error al traer la secuencia de en_produccion<br>\") or fin_pagina();\r\n $id_en_produccion=$id_en_prod->fields[\"id_en_produccion\"];\r\n\r\n $query=\"insert into en_produccion(id_en_produccion,nro_orden,id_licitacion,id_deposito,id_producto,id_proveedor,cantidad)\r\n values($id_en_produccion,$nro_orden,$id_licitacion,$id_deposito,$id_producto,$id_proveedor,$cant)\";\r\n\r\n sql($query,\"<br>Error al insetar tabla en Produccion<br>\") or fin_pagina();\r\n\r\n }//del else de if($actualizar_entrada->[\"id_en_produccion\"]!=\"\")\r\n\r\n //finalmente, registramos lo agregado a stock de produccion, en las tablas correspondientes\r\n $query=\"select nextval('control_stock_id_control_stock_seq') as id_control_stock\";\r\n $id_control_stock=sql($query,\"<br>Error al traer la secuencia de control de stock<br>\") or fin_pagina();\r\n\r\n\r\n $query=\"insert into control_stock(id_control_stock,fecha_modif,usuario,comentario,estado)\r\n values(\".$id_control_stock->fields['id_control_stock'].\",'$fecha_modif','\".$_ses_user[\"name\"].\"','$comentario','oc')\";\r\n sql($query,\"<br>Error al insertar en control_stock<br>\") or fin_pagina();\r\n\r\n $query=\"insert into descuento (id_deposito,id_producto,id_proveedor,id_control_stock,cant_desc,id_en_produccion)\r\n values($id_deposito,$id_producto,$id_proveedor,\".$id_control_stock->fields['id_control_stock'].\",$cant,$id_en_produccion)\";\r\n sql($query,\"<br>Error al insertar en descuento<br>\") or fin_pagina();\r\n\r\n $query=\"insert into log_stock(id_control_stock,usuario,fecha,tipo)\r\n values (\".$id_control_stock->fields['id_control_stock'].\",'\".$_ses_user['name'].\"','$fecha_modif','$comentario')\";\r\n sql($query,\"<br>Error al insertar en log_stock<br>\") or fin_pagina();\r\n\r\n\r\n $db->CompleteTrans();\r\n}", "public function add(){\n\t\tif(isset($_SESSION['identity'])){//verifico si me logie\n\t\t\t$usuario_id = $_SESSION['identity']->id;//guardo el id del usuario\n\t\t\t$provincia = isset($_POST['provincia']) ? $_POST['provincia'] : false;//si existe el dato lo guado si no guardo false\n\t\t\t$localidad = isset($_POST['localidad']) ? $_POST['localidad'] : false;\n\t\t\t$direccion = isset($_POST['direccion']) ? $_POST['direccion'] : false;\n\n\t\t\t$stats = Utils::statsCarrito();//me trae la cantidad de los productos y el total de plata\n\t\t\t$coste = $stats['total'];\n\n\t\t\tif($provincia && $localidad && $direccion){//si existen estos datos\n\t\t\t\t// Guardar datos en bd\n\t\t\t\t$pedido = new Pedido();//instancio Pedido del modelo y seteo con lo llegado del post\n\t\t\t\t$pedido->setUsuario_id($usuario_id);\n\t\t\t\t$pedido->setProvincia($provincia);\n\t\t\t\t$pedido->setLocalidad($localidad);\n\t\t\t\t$pedido->setDireccion($direccion);\n\t\t\t\t$pedido->setCoste($coste);\n\n\t\t\t\t$save = $pedido->save();//llamo al metodo q esta en el modelo class pedido y guardo en la base de datos todo y pongo estado confirm\n\n\t\t\t\t// Guardar linea pedido\n\t\t\t\t$save_linea = $pedido->save_linea();//llamo al metodo q esta en el modelo class pedido\n\t\t\t\t//y voy guardando con un foreach todos los productos del carrito a una tabla lineas_pedidos con el mismo numero de pedido\n\n\n\n// ACTUALIZA EL STOCK DEL PRODUCTO\n\t\t\t\t$updates=$pedido->updateStock();\n\n\t\t\t\tif($save && $save_linea && $updates){//si se guardo estas dos query\n\t\t\t\t\t$_SESSION['pedido'] = \"complete\";//creo la session\n\t\t\t\t}else{\n\t\t\t\t\t$_SESSION['pedido'] = \"failed\";\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$_SESSION['pedido'] = \"failed\";\n\t\t\t}\n\n\t\t\theader(\"Location:\".base_url.'Pedido/confirmado');//voy a pedidoController y llamo al metodo confirmado\n\t\t}else{\n\t\t\t// Redigir al index al no estar logeado\n\t\t\theader(\"Location:\".base_url);\n\t\t}\n\t}", "public function create($produtoid)\n {\n //\n\n }", "public function run()\n {\n Produto::insert\n (\n [\n ['nm_produto' => 'Bolacha'],\n ['nm_produto' => 'Leite'],\n ['nm_produto' => 'Arroz'],\n ['nm_produto' => 'Feijão'],\n ['nm_produto' => 'Macarrão'],\n ['nm_produto' => 'Óleo'],\n ['nm_produto' => 'Azeite'],\n ['nm_produto' => 'Tempero'],\n ['nm_produto' => 'Maionese'],\n ['nm_produto' => 'Extrato de tomate'],\n ['nm_produto' => 'Enlatados'],\n ['nm_produto' => 'Farinha'],\n ['nm_produto' => 'Café'],\n ['nm_produto' => 'Chá'],\n ['nm_produto' => 'Atum'],\n ['nm_produto' => 'Sardinha'],\n ['nm_produto' => 'Milho'],\n ['nm_produto' => 'Ervilha'],\n ['nm_produto' => 'Banana'],\n ['nm_produto' => 'Mussarela'],\n ['nm_produto' => 'Tomate'],\n ['nm_produto' => 'Alface'],\n ['nm_produto' => 'Requeijão'],\n ['nm_produto' => 'Cebola'],\n ['nm_produto' => 'Oregano'],\n ['nm_produto' => 'Pimenta do Reino'],\n ['nm_produto' => 'Pimentão'],\n ['nm_produto' => 'Salsa'],\n ['nm_produto' => 'Coentro'],\n ['nm_produto' => 'Batata'],\n ['nm_produto' => 'Batata Doce'],\n ['nm_produto' => 'Mandioca'],\n ['nm_produto' => 'Mandioquinha'],\n ['nm_produto' => 'Brócolis'],\n ['nm_produto' => 'Arroz Integral'],\n ['nm_produto' => 'Farofas'],\n ['nm_produto' => 'Macarrão Integral'],\n ['nm_produto' => 'Leite Desnatado'],\n ['nm_produto' => 'Morango'],\n ['nm_produto' => 'Salsichão'],\n ['nm_produto' => 'Frango'],\n ['nm_produto' => 'Lasanha'],\n ['nm_produto' => 'Pizza'],\n ['nm_produto' => 'Salsicha'],\n ['nm_produto' => 'Petiscos'],\n ['nm_produto' => 'Produtos Para Churrasco'],\n ['nm_produto' => 'Hambúrguer'],\n ['nm_produto' => 'Linguiça'],\n ['nm_produto' => 'Pão de Queijo'],\n ['nm_produto' => 'Batata Palito'],\n ['nm_produto' => 'Pratos Prontos'],\n ['nm_produto' => 'Manteiga'],\n ['nm_produto' => 'Margarina'],\n ['nm_produto' => 'Apresuntado'],\n ['nm_produto' => 'Leite Fermentado'],\n ['nm_produto' => 'Queijo'],\n ['nm_produto' => 'Presunto'],\n ['nm_produto' => 'Mortadela'],\n ['nm_produto' => 'Peito de Frango Defumado'],\n ['nm_produto' => 'Melancia'],\n ['nm_produto' => 'Cenoura'],\n ['nm_produto' => 'Couve'],\n ['nm_produto' => 'Alho'],\n ['nm_produto' => 'Polpas de Frutas Congeladas'],\n ['nm_produto' => 'Vegetais Congelados'],\n ['nm_produto' => 'Abacaxi'],\n ['nm_produto' => 'Manga'],\n ['nm_produto' => 'Maçã'],\n ['nm_produto' => 'Beterraba'],\n ['nm_produto' => 'Couve-flor'],\n ['nm_produto' => 'Repolho'],\n ['nm_produto' => 'Frutas'],\n ['nm_produto' => 'Legumes'],\n ['nm_produto' => 'Verduras'],\n ['nm_produto' => 'Temperos'],\n ['nm_produto' => 'Cebolinha'],\n ['nm_produto' => 'Ervas'],\n ['nm_produto' => 'Picles'],\n ['nm_produto' => 'Destilados'],\n ['nm_produto' => 'Limão'],\n ['nm_produto' => 'Gelo'],\n ['nm_produto' => 'Salgadinhos'],\n ['nm_produto' => 'Sorvetes'],\n ['nm_produto' => 'Farinha de Trigo'],\n ['nm_produto' => 'Fígado'],\n ['nm_produto' => 'Fermento'],\n ['nm_produto' => 'Achocolatados em Pó'],\n ['nm_produto' => 'Vegetais'],\n ['nm_produto' => 'Pão de Forma'],\n ['nm_produto' => 'Pão de Cachorro Quente'],\n ['nm_produto' => 'Pão de Hambúrguer'],\n ['nm_produto' => 'Bisnaguinha'],\n ['nm_produto' => 'Biscoitos'],\n ['nm_produto' => 'Massa Pronta Para Bolo'],\n ['nm_produto' => 'Broinha de Milho'],\n ['nm_produto' => 'Pães de Queijo'],\n ['nm_produto' => 'Água'],\n ['nm_produto' => 'Chás Prontos'],\n ['nm_produto' => 'Iogurtes'],\n ['nm_produto' => 'Suco'],\n ['nm_produto' => 'Refrigerante'],\n ['nm_produto' => 'Vitamina'],\n ['nm_produto' => 'Achocolatado'],\n ['nm_produto' => 'Cerveja'],\n ['nm_produto' => 'Vinho'],\n ['nm_produto' => 'Vodka'],\n ['nm_produto' => 'Água Sanitária'],\n ['nm_produto' => 'Desinfetante'],\n ['nm_produto' => 'Detergente'],\n ['nm_produto' => 'Esponja de Aço'],\n ['nm_produto' => 'Sabão em Pó'],\n ['nm_produto' => 'Sabão em Barra'],\n ['nm_produto' => 'Amaciante'],\n ['nm_produto' => 'Alvejante'],\n ['nm_produto' => 'Escovinhas'],\n ['nm_produto' => 'Vassoura'],\n ['nm_produto' => 'Rodo'],\n ['nm_produto' => 'Pano de Chão'],\n ['nm_produto' => 'Pano de Prato'],\n ['nm_produto' => 'Luvas de Borracha'],\n ['nm_produto' => 'Shampoo'],\n ['nm_produto' => 'Condicionador'],\n ['nm_produto' => 'Creme de Pentear'],\n ['nm_produto' => 'Escova de Cabelo'],\n ['nm_produto' => 'Pente'],\n ['nm_produto' => 'Desodorante'],\n ['nm_produto' => 'Lâmina de Barbear'],\n ['nm_produto' => 'Creme Dental'],\n ['nm_produto' => 'Escova de Dentes'],\n ['nm_produto' => 'Enxaguante Bucal'],\n ['nm_produto' => 'Creme Hidratante Para o Corpo'],\n ['nm_produto' => 'Sabonete'],\n ['nm_produto' => 'Papel Higiênico'],\n ['nm_produto' => 'Absorvente'],\n ['nm_produto' => 'Nuggets'],\n ['nm_produto' => 'Carne Moída'],\n ['nm_produto' => 'Sucrilhos'],\n ['nm_produto' => 'Bolinho'],\n ['nm_produto' => 'Coca-Cola'],\n ['nm_produto' => 'Energético'],\n ['nm_produto' => 'Saco de Lixo'],\n ['nm_produto' => 'Pratos Descartaveis'],\n ['nm_produto' => 'Cotonetes'],\n ['nm_produto' => 'Lenço Umidecido'],\n ['nm_produto' => 'Ração de Cachorro'],\n ['nm_produto' => 'Geléias'],\n ['nm_produto' => 'Pilhas'],\n ['nm_produto' => 'Absorventes'],\n ['nm_produto' => 'Gelatina'],\n ['nm_produto' => 'Chicletes'],\n ['nm_produto' => 'Cachaça'],\n ['nm_produto' => 'Peixe'],\n ['nm_produto' => 'Chinelo'],\n ['nm_produto' => 'Fio Dental'],\n ['nm_produto' => 'Algodão'],\n ['nm_produto' => 'Bolo'],\n ['nm_produto' => 'Agua de Coco'],\n ['nm_produto' => 'Isotônico'],\n ['nm_produto' => 'Gatorade'],\n ['nm_produto' => 'Creme de Barbear'],\n ['nm_produto' => 'Preservativos'],\n ['nm_produto' => 'Pá de Lixo'],\n ['nm_produto' => 'Pipoca'],\n ['nm_produto' => 'Carnes'],\n ['nm_produto' => 'Peito de Peru'],\n ['nm_produto' => 'Torta Salgada'],\n ['nm_produto' => 'Limpeza e embelezamento automotivo'],\n ['nm_produto' => 'Cereais'],\n ['nm_produto' => 'Leite Condensado'],\n ['nm_produto' => 'Creme de leite'],\n ['nm_produto' => 'Pão de Alho'],\n ['nm_produto' => 'Palmito'],\n ['nm_produto' => 'Molho de Tomate'],\n ['nm_produto' => 'Chocolate'],\n ['nm_produto' => 'Vinagre'],\n ['nm_produto' => 'Whisky'],\n ['nm_produto' => 'Rúcula'],\n ['nm_produto' => 'Agrião'],\n ['nm_produto' => 'Escarola'],\n ['nm_produto' => 'Maracujá'],\n ['nm_produto' => 'Uva'],\n ['nm_produto' => 'Guardanapo'],\n ['nm_produto' => 'Toalha de Papel'],\n ['nm_produto' => 'Inseticidas'],\n ['nm_produto' => 'Repelente'],\n ['nm_produto' => 'Toalha umedecida'],\n ['nm_produto' => 'Farinha Láctea'],\n ['nm_produto' => 'Leite em Pó'],\n ['nm_produto' => 'Açúcar'],\n ['nm_produto' => 'Adoçante'],\n ['nm_produto' => 'Fralda Descartável'],\n ['nm_produto' => 'Acelga'],\n ['nm_produto' => 'Abacate'],\n ['nm_produto' => 'Kiwi'],\n ['nm_produto' => 'Mamão'],\n ['nm_produto' => 'Melão'],\n ['nm_produto' => 'Laranja'],\n ['nm_produto' => 'Pêssego'],\n ['nm_produto' => 'Pêra'],\n ['nm_produto' => 'Tangerina'],\n ['nm_produto' => 'Abóbora'],\n ['nm_produto' => 'Abobrinha'],\n ['nm_produto' => 'Alcachofra'],\n ['nm_produto' => 'Ovo'],\n ['nm_produto' => 'Vagem'],\n ['nm_produto' => 'Berinjela'],\n ['nm_produto' => 'Goiaba'],\n ['nm_produto' => 'Pepino'],\n ['nm_produto' => 'Cogumelo'],\n ['nm_produto' => 'Espumante'],\n ['nm_produto' => 'Molho Inglês'],\n ['nm_produto' => 'Aguardente']\n ]\n );\n }", "public static function setTblcarritoproduct($cantidad,$nombreproduct,$nombreproveedor,$precioreal,$preciobp,$personalizar,$msjtarjeta,$calif,$emailcreo,$idtblordencompra,$idtblproductdetalle){\n \n $insert =\"INSERT INTO tblcarritoproduct (tblcarritoproduct_cantidad, tblcarritoproduct_nombreproducto,tblcarritoproduct_nombreproveedor,tblcarritoproduct_precioreal,tblcarritoproduct_preciobp,tblcarritoproduct_personalizar,tblcarritoproduct_mensajetarjeta,tblcarritoproduct_calificacion,tblcarritoproduct_fchmodificacion,tblcarritoproduct_fchcreacion,tblcarritoproduct_emailusuacreo,tblcarritoproduct_emailusuamodifico,tblcarritoproduct_idtblordencompra,tblcarritoproduct_idtblproductdetalle) VALUES (?,?,?,?,?,?,?,?,NOW(),Now(),?,?,?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$cantidad,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(2,$nombreproduct,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$nombreproveedor,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(4,$precioreal,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$preciobp,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$personalizar,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$msjtarjeta,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(8,$calif,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(9,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(10,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(11,$idtblordencompra,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(12,$idtblproductdetalle,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n \n }", "public function crearFromItem(Item $producto){\n $bodegas=Bodega::model()->findAll();\n if(is_array($bodegas)){\n foreach($bodegas as $key =>$value){\n $crit=self::setCriterio($producto->id,$value->id);\n $item_bodega=Itembodega::model()->find($crit);\n if($item_bodega==null){\n $relacion=new ItemBodega;\n $relacion->setScenario('ínsert');\n $relacion->idbodega=$value->id;\n $relacion->iditem=$producto->id;\n $relacion->stock=0;\n $relacion->stockcomprometido=0;\n $relacion->stockporllegar=0;\n $relacion->stockcomprometido=0;\n $relacion->idempresa=$this->empresa_id;\n $relacion->save();\n }\n }\n }\n }", "public function run()\n {\n DB::table('produto')->insert([\n ['produtor_id' => 2, 'categoria_id' => 1, 'embalagem_id' => 4, 'nome' => 'Arroz',\n 'descricao' => 'O arroz é fonte de energia ao organismo com carboidratos saudáveis. Ele é um alimento rico em carboidratos mas também tem proteínas, vitaminas e minerais.',\n 'valor' => 3, 'minPorAssinatura' => 2, 'maxPorDia' => 30,\n 'freteMax' => 25, 'seg' => true, 'ter' => true, 'qua' => true,\n 'qui' => true, 'sex' => false, 'sab' => false, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 1, 'embalagem_id' =>4, 'nome' => 'Aveia',\n 'descricao' => 'Produto não - transgênico que possui o certificado pela ECOCERT. Pode ser consumido com qualquer preparação e é feito basicamente por flocos de aveia.',\n 'valor' => 2, 'minPorAssinatura' => 2, 'maxPorDia' => 33,\n 'freteMax' => 22, 'seg' => true, 'ter' => false, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => false, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 1, 'embalagem_id' =>4, 'nome' => 'Cevada',\n 'descricao' => 'Alimento Concentrado de alta qualidade, muito palatável.',\n 'valor' => 1.50, 'minPorAssinatura' => 1, 'maxPorDia' => 25,\n 'freteMax' => 10, 'seg' => true, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => false, 'sab' => false, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 1, 'embalagem_id' =>4, 'nome' => 'Milho',\n 'descricao' => 'Milho limpo, seco e estocado em armazém profissional e com um ótimo padrão de qualidade.',\n 'valor' => 4, 'minPorAssinatura' => 2, 'maxPorDia' => 15,\n 'freteMax' => 14, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => false, 'sex' => false, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 1, 'embalagem_id' =>4, 'nome' => 'Soja',\n 'descricao' => 'Produto não transgênico, embalado a vácuo, isento de agrotóxicos e produtos químicos.',\n 'valor' => 2.30, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Abacaxi',\n 'descricao' => 'Abacaxi de qualidade, cultivado sem agrotóxicos.',\n 'valor' => 1.50, 'minPorAssinatura' => 4, 'maxPorDia' => 30,\n 'freteMax' => 8, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>3, 'nome' => 'Acerola',\n 'descricao' => 'Produto não transgênico e isento de agrotóxicos.',\n 'valor' => 2.10, 'minPorAssinatura' => 1, 'maxPorDia' => 5,\n 'freteMax' => 4, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => false, 'sab' => true, 'dom' => true],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>1, 'nome' => 'Carambola',\n 'descricao' => 'Produto 100% orgânico e saudável.',\n 'valor' => 0.90, 'minPorAssinatura' => 5, 'maxPorDia' => 50,\n 'freteMax' => 6, 'seg' => true, 'ter' => false, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => false, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Laranja',\n 'descricao' => 'Fruta excelente para consumo, docinha e de qualidade.',\n 'valor' => 2.90, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Melancia',\n 'descricao' => 'Fruta suculenta e refrescante, excelente no período do verão.',\n 'valor' => 7, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 3, 'embalagem_id' =>1, 'nome' => 'Abóbora',\n 'descricao' => 'Legume saudável, que possui diversas vitaminas para o corpo\n humano.',\n 'valor' => 5, 'minPorAssinatura' => 1, 'maxPorDia' => 20,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 3, 'embalagem_id' =>1, 'nome' => 'Beringela',\n 'descricao' => 'Fruta suculenta e refrescante, excelente no período do verão.',\n 'valor' => 2.50, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 3, 'embalagem_id' =>1, 'nome' => 'Beterraba',\n 'descricao' => 'Fruta suculenta e refrescante, excelente no período do verão.',\n 'valor' => 3, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 3, 'embalagem_id' =>1, 'nome' => 'Chuchu',\n 'descricao' => 'Fruta suculenta e refrescante, excelente no período do verão.',\n 'valor' => 2, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 3, 'embalagem_id' =>1, 'nome' => 'Pimentão',\n 'descricao' => 'Fruta suculenta e refrescante, excelente no período do verão.',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 4, 'embalagem_id' =>3, 'nome' => 'Amendoim',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 4, 'embalagem_id' =>3, 'nome' => 'Ervilha',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 4, 'embalagem_id' =>3, 'nome' => 'Feijão',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 4, 'embalagem_id' =>3, 'nome' => 'Grão de bico',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 4, 'embalagem_id' =>3, 'nome' => 'Lentilha',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Batata doce',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Batata Yacon',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Gengibre',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Mandioca',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Rabanete',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Alface',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Brócolis',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Couve-flor',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Espinafre',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 3, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Rúcula',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 6, 'embalagem_id' =>3, 'nome' => 'Batata inglesa',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Pimentão vermelho',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 7, 'embalagem_id' =>3, 'nome' => 'Cenoura',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 5, 'embalagem_id' =>3, 'nome' => 'Inhame',\n 'descricao' => '-',\n 'valor' => 2.50, 'minPorAssinatura' => 5, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>2, 'nome' => 'Banana',\n 'descricao' => 'Bem delícia.',\n 'valor' => 2.50, 'minPorAssinatura' => 13, 'maxPorDia' => 20,\n 'freteMax' => 9, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>2, 'nome' => 'Pera',\n 'descricao' => 'Bem delícia e docinha hein.',\n 'valor' => 1.90, 'minPorAssinatura' => 13, 'maxPorDia' => 20,\n 'freteMax' => 9, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Tomate',\n 'descricao' => 'Fruta excelente para consumo, docinha e de qualidade.',\n 'valor' => 2.90, 'minPorAssinatura' => 1, 'maxPorDia' => 10,\n 'freteMax' => 10, 'seg' => false, 'ter' => false, 'qua' => true,\n 'qui' => true, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Uva verde',\n 'descricao' => 'Abacaxi de qualidade, cultivado sem agrotóxicos.',\n 'valor' => 1.50, 'minPorAssinatura' => 4, 'maxPorDia' => 30,\n 'freteMax' => 8, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Abacate',\n 'descricao' => 'Abacaxi de qualidade, cultivado sem agrotóxicos.',\n 'valor' => 1.50, 'minPorAssinatura' => 4, 'maxPorDia' => 30,\n 'freteMax' => 8, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Morango',\n 'descricao' => 'Abacaxi de qualidade, cultivado sem agrotóxicos.',\n 'valor' => 1.50, 'minPorAssinatura' => 4, 'maxPorDia' => 30,\n 'freteMax' => 8, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => true, 'dom' => false],\n\n ['produtor_id' => 2, 'categoria_id' => 2, 'embalagem_id' =>4, 'nome' => 'Amora',\n 'descricao' => 'Abacaxi de qualidade, cultivado sem agrotóxicos.',\n 'valor' => 1.50, 'minPorAssinatura' => 4, 'maxPorDia' => 30,\n 'freteMax' => 8, 'seg' => false, 'ter' => true, 'qua' => true,\n 'qui' => false, 'sex' => true, 'sab' => true, 'dom' => false],\n ]);\n\n\n }", "public static function setTblproductcomplem($nombreproductcomplem, $descripcion, $seo, $precioreal, $preciobp, $srcimg,$activado,$idtblproveedor,$stock,$emailcreo){\n \n $insert =\"INSERT INTO tblproductcomplem \n\t\t(tblproductcomplem_nombre,tblproductcomplem_descripcion,tblproductcomplem_seo,\n\t\ttblproductcomplem_precioreal,tblproductcomplem_preciobp,tblproductcomplem_srcimg,\n\t\ttblproductcomplem_activado,tblproveedor_idtblproveedor,tblproductcomplem_stock,\n\t\ttblproductcomplem_fchmodificacion,tblproductcomplem_fchcreacion,tblproductcomplem_emailusuacreo,\n\t\ttblproductcomplem_emailusuamodifico) VALUES (?,?,?,?,?,?,?,?,?,NOW(),NOW(),?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$nombreproductcomplem,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$descripcion,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$seo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(4,$precioreal,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$preciobp,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$srcimg,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$activado,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(8,$idtblproveedor,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(9,$stock,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(10,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(11,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }", "function insertarEntradaProducto($post){\n //TABLA MATERIAL\n $datosMaterial = Array();\n $datosMaterial['id_tipobodega'] = $post['tipobodega'];\n $datosMaterial['id_tipomaterial'] = $post['tipoproducto'];\n $datosMaterial['nombrematerial'] = $post['nombreproducto'];\n $datosMaterial['stock'] = $post['cantidadentrada'];\n $datosMaterial['detalle'] = $post['glosa'];\n \n $verificacion = $this->db->insert('material', $datosMaterial);\n \n \n //TABLA ENTRADA\n if($verificacion == TRUE){\n $datosEntrada = Array();\n\n $datosEntrada['id_proyecto'] = $post['centrocostos'];\n $datosEntrada['cantidadingresada'] = $post['cantidadentrada'];\n $this->db->insert('entrada', $datosEntrada);\n }\n }", "public function store(Request $request)//inserir valor no banco de dados\n {\n $user = auth()->user();\n\n if(!Dono::where('user_id', $user->id)->count()>0){\n //1 - criar um endereco e salvar\n $end = new Endereco();\n $end->rua = $request->rua;\n $end->bairro = $request->bairro;\n $end->numero = $request->numero;\n $end->cep = $request->cep;\n $end->cidade = $request->cidade;\n $end->uf = $request->uf;\n\n $end->save();\n\n //1 - cverificar se possuir perfil se não possuir criar um\n //$perfil = Perfil::where('perfil','2')->exists(); //retorna false ou true\n //$perfil = Perfil::where('perfil','2')->get(); //retorna o valor se encontrar\n /*$perfil = new Perfil();\n if($perfil->perfil_exists('1')){\n $perfil->perfil = '1';\n $perfil->descricao = 'Proprietario';\n $perfil->save();\n\n }\n $perfil = Perfil::where('perfil','1')->get();\n foreach ($perfil as $key) {\n $perfil_id = ($key->id);\n }*/\n\n $tel = new Contato();\n $tel->tel = $request->tel;\n $tel->tipo = $request->tipo;\n\n $tel->save();\n //3 - criar um proprietário(Dono) com os dados de endereco e perfil\n $prop = new Dono();\n $prop->nome = $request->nome;\n $prop->cpf = $request->cpf;\n $prop->rg = $request->rg;\n $prop->email = $request->email;\n $prop->endereco()->associate($end->id);\n //$prop->perfil()->associate($perfil_id);\n $prop ->contato()->associate($tel->id);\n\n $prop->user_id = $user->id;\n\n $prop->save();\n\n // $end->Dono()->associate($prop->id);\n\n //$end->save();\n\n return redirect ('prop/create')->with('msg','Proprietário cadastrado com sucesso!');\n }\n return redirect(\"/proprietario/$user->dono()->id\");\n }", "public function run()\n {\n $items = [\n \n ['id' => 1, 'vendor_id' => 1, 'price' => '10', 'product_id' => null,],\n ['id' => 2, 'vendor_id' => 1, 'price' => '10', 'product_id' => 1,],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Productprice::create($item);\n }\n }", "public function create ($product)\n {\n $statement = \"INSERT INTO products (name, description, price) \n VALUES (:name, :description, :price)\";\n \n $prepare = $this->db->prepare($statement);\n $prepare->bindValue(\":name\", $product->getName());\n $prepare->bindValue(\":description\", $product->getDescription());\n $prepare->bindValue(\":price\", $product->getPrice());\n\n $prepare->execute();\n }" ]
[ "0.6114841", "0.5685196", "0.5615785", "0.5517588", "0.5457171", "0.5454995", "0.54455954", "0.54362583", "0.5408826", "0.5393476", "0.53822225", "0.5326477", "0.53242934", "0.5321687", "0.5288787", "0.52830803", "0.5269178", "0.5264866", "0.52582467", "0.5244399", "0.52397496", "0.52331084", "0.5225878", "0.5217285", "0.5200768", "0.5150554", "0.5132864", "0.5119362", "0.51183975", "0.51039267" ]
0.57748586
1
The name of the publicfacing route that relates to this content. Some situations may append more specific actions to this. This will generally depend on the content being passed into the route to build the link. Note that the URL generated from getContentUrl may differ from the public route. If there is no public route that's applicable, return null.
public function getContentPublicRoute();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteName();", "public function getRouteName();", "public function getRouteName();", "public function route()\n {\n $route = '/'.$this->category;\n\n if ($this->page == 'readme') {\n return $route;\n }\n\n $route .= '/'.$this->page;\n\n if ($this->subpage == 'readme') {\n return $route;\n }\n\n return $route.'/'.$this->subpage;\n }", "abstract protected function getRouteName();", "public function getPublicUrl()\n {\n\n return route('file.show', $this->getAttribute('file_name'));\n\n }", "public function GetRoute()\n {\n $this->Route->SetPublic(array(\"Category\", \"Article\", \"Subscribe\"));\n \n return $this->Route;\n }", "public function url()\n {\n return route($this->getRouteName(), $this->getRouteParams(true));\n }", "public function getRouteName(): string;", "public function getPublicUrlAttribute()\n\t{\n\t\treturn $this->slug ? route('client::products.show',[\n\t\t\t'public_product' => $this->slug\n\t\t]) : null;\n\t}", "abstract public function routeName();", "public function getRoute(): string;", "public function url()\n {\n if (!is_null($this->href)) {\n return $this->href;\n } elseif (isset($this->path['url'])) {\n return $this->getUrl();\n } elseif (isset($this->path['route'])) {\n return $this->getRoute();\n } elseif (isset($this->path['action'])) {\n return $this->getControllerAction();\n }\n\n return null;\n }", "abstract public function getRouteName(): string;", "public function getRouteKeyName()\n {\n return 'permalink';\n }", "public function getRoute(): string\n {\n return $this->data['route'];\n }", "public function getCanonicalRoute() {\n return $this->route;\n }", "public function getRoute(): string\n {\n return $this->route;\n }", "public function getRoute();", "final public function getPublicMountRoute()\n {\n return Configuration::forkBaseUrl . '/' . $this->mountEntity->route;\n\n }", "private function getRoute()\n {\n $Route = Route::getCurrentRoute();\n\n if (isset($Route)) {\n return $Route->getName();\n }\n }", "function getRoute():string\n {\n if(isset($_REQUEST['url'])){\n $url=$_REQUEST['url'];\n }else{\n $url='home';\n }\n switch($url){\n //acceso a la vista\n case 'login':\n return 'login';\n case 'register':\n return 'register';\n //acceso a proceso login\n case 'login_action';\n return 'login_action';\n case 'register_action';\n return 'register_action';\n case 'escritorio';\n return 'escritorio';\n case 'lista';\n return 'lista';\n case 'lista_action';\n return 'lista_action';\n case 'tarea';\n return 'tarea';\n case 'tarea_action';\n return 'tarea_action';\n default:\n return 'home';\n }\n \n }", "public function urlPath()\n {\n $routes = array_get(Config::getRoutes(), 'collections', []);\n\n if (! $route = array_get($routes, $this->collectionName())) {\n return false;\n }\n\n return app('Statamic\\Contracts\\Data\\Content\\UrlBuilder')->content($this)->build($route);\n }", "protected function getRouteName()\n {\n $route = request()->route();\n\n if ( ! $route) return null;\n\n return $route->getName();\n }", "public function currentRouteName()\n {\n //if this function is called in dynapart contoller,\n //_route returns \"_internal\", so it need to look at\n //_frontendRoute for real front end route.\n //_frontendRoute is the variable that has been injected by\n //dynapart twig template\n //$route = $this->request()->attributes->get('_route');\n $route = $this->request()->get('_route');\n\n if ($route && $route !== \"_internal\") {\n return $route;\n }\n\n return $this->request()->get('_frontendRoute');\n }", "public function getRouteName(): ?string;", "public function canonicalRoute(): ?string\n {\n if (isset($this->canonicalRoute)) {\n return $this->canonicalRoute;\n }\n\n return $this->canonicalRoute = !empty($this->data['canonicalRoute'])\n ? Path::normalize($this->data['canonicalRoute'])\n : null;\n }", "public function getRouteName()\n {\n return $this->routeName;\n }", "public function getRoute() {\n\t\treturn $this->kernel()->route();\n\t}", "public function Link()\n {\n if (!$this->owner->Slug && $this->owner->ID) {\n if ($this->canWriteSlug()) {\n $this->owner->write();\n } else {\n return '';\n }\n }\n $page = $this->owner->Page();\n if (is_string($page)) {\n return rtrim($page, '/') . '/' . $this->owner->Slug;\n }\n if (!$page) {\n if (Controller::has_curr()) {\n return Controller::curr()->Link('detail/'.$this->owner->Slug);\n }\n return '';\n }\n return $page->Link('detail/'.$this->owner->Slug);\n }" ]
[ "0.64863235", "0.64863235", "0.64863235", "0.64021325", "0.63768727", "0.63667697", "0.6287388", "0.6287276", "0.62507725", "0.61878777", "0.61816263", "0.6168791", "0.6158321", "0.61319417", "0.6116159", "0.6059922", "0.6031692", "0.60287267", "0.6004719", "0.59944654", "0.59910804", "0.59854364", "0.59180194", "0.5914867", "0.5904608", "0.58793", "0.58665645", "0.58492136", "0.5845494", "0.58425397" ]
0.73374593
0
Return the inmemory size of the session ($_SESSION) array.
public function getSize() { return strlen(serialize($_SESSION)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSize(){\n\t\t// Ambil ukuran tabel(array) dalam session\n\t\t$tmp = $this->session->userdata($this->sess_beli);\n\t\treturn count($tmp);\n\t}", "public function getSessionCount()\n {\n return count($this->session);\n }", "public function count()\r\n {\r\n return count($_SESSION);\r\n }", "public function count()\n {\n return count($_SESSION);\n }", "public function getPageSize()\n {\n return session()->get($this->getSessionKey(static::TYPE_PAGESIZE));\n }", "public function stat($key) {\n\t\tif (array_key_exists($key, $_SESSION[$this->token])) {\n\t\t\treturn [\n\t\t\t\t'type' => 'persistent',\n\t\t\t\t'size' => $this->sizeof($_SESSION[$this->token][$key])\n\t\t\t];\n\t\t}\n\n\t\tif (array_key_exists($key, $_SESSION[$this->token . '_flash'])) {\n\t\t\treturn [\n\t\t\t\t'type' => 'flash',\n\t\t\t\t'size' => $this->sizeof($_SESSION[$this->token . '_flash'][$key])\n\t\t\t];\n\t\t}\n\n\t\tif (array_key_exists($key, $this->sessionData)) {\n\t\t\treturn [\n\t\t\t\t'type' => 'temporary',\n\t\t\t\t'size' => $this->sizeof($this->sessionData[$key])\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t'type' => 'unknown',\n\t\t\t'size' => 0\n\t\t];\n\t}", "function session_vars(){\n\t\treturn $_SESSION;\n\t}", "function countSessions()\n {\n $this->fDebug->add(\"Counting Sessions.\", 6);\n return 0;\n }", "public static function GET_SIZE()\n\t{\n\t\treturn self::$size ?? (self::$size = self::$thiss->getSize());\n\t}", "function countAuthedSessions()\n {\n return 0;\n }", "function countGuestSessions()\n {\n return 0;\n }", "public function \t\t size() {\n Debug::trace();\n return $this->size;\n }", "public function get_size(): int\n {\n return $this->_size;\n }", "public function getNumberOfProductsIncart(){\n $cart = $_SESSION[\"shopping_cart\"];\n return $cart->getNumberOfProducts();\n }", "public function getSize()\n {\n return $this->_DATA[ 'size' ];\n }", "static public function storeSessionData(){\n\t\tself::$_dataInitialized = false;\n\t\tif(isset($_SESSION['session_data'])&&is_array($_SESSION['session_data'])){\n\t\t\t$_SESSION['session_data'] = serialize($_SESSION['session_data']);\n\t\t}\n\t\tsession_write_close();\n\t}", "function cart_item_count() {\r\n\t$item_count = 0;\r\n\r\n\tforeach ( $_SESSION['cart'] as $item ) {\r\n\t\t$item_count += $item['quantity'];\r\n\t}\r\n\r\n\treturn $item_count;\r\n}", "public function count() {\n $items_in_cart = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $key => $value) {\n $items_in_cart += $value['quantity'];\n }\n }\n\n return $items_in_cart;\n }", "public function size()\n\t{\n\t\treturn $this->size;\n\t}", "public function getSize()\n\t{\n\t\treturn count($this->data);\n\t}", "public function getLength () {\n\t\treturn $this->handlers->used;\n\t}", "public function getSize()\n {\n return Mage::getStoreConfig(self::MODULE_KEY_SIZE);\n }", "public function size() {\n\t\treturn $this->size;\n\t}", "public static function get_stats (){\n\t\t\t$return = false;\n\n\t\t //is the data already in the session?\n\t\t\tif (isset($_SESSION['stats'])){\n\t\t\t\t$return = $_SESSION['stats'];\n\t\t\t}else{\n\t\t\t\t$db = DB::connect(DB_CONNECTION_STRING);\n\t\t\t\t$alert_count = 0;\n\t\t\t\t$authority_count = 0;\t\t\t\n\n\t\t\t\t//Count of applications\n\t\t\t\t$alert_sql = \"select value from stats where `key` = 'applications_sent'\";\n\t\t\t\t$results = $db->getAll($alert_sql);\n\n\t\t\t\tif(sizeof($results) >0){\n\t\t\t\t\t$alert_count = $results[0][0];\n\t\t\t\t}\n\n\t\t\t\t//Count of authorities\n\t\t\t\t$authority_sql = \"select count(authority_id) from authority where disabled = 0 or disabled is null\";\n\t\t\t\t$results = $db->getAll($authority_sql);\n\t\t\t\tif(sizeof($results) >0){\n\t\t\t\t\t$authority_count = $results[0][0];\n\t\t\t\t}\t\n\n\t\t\t\t//save to session\n\t\t\t\t$return = array('alert_count' => $alert_count, 'authority_count' => $authority_count);\n\t\t\t\t$_SESSION['stats'] = $return;\n\t\t\t}\n\n\t\t\treturn $return;\n\n\t }", "function count () {\n\n $total = 0;\n if (count($_SESSION['cart'])>0) {\n foreach ($_SESSION['cart'] as $id => $qty) {\n $total += $qty;\n }\n }\n return $total;\n }", "public function stream_stat() {\n return array(\n 'size' => strlen(self::$bytes[$this->current])\n );\n }", "function getTotalCountOfItems() {\n $session = new Session();\n return ($session->has('myCart')) ? array_sum($session->get('myCart')['count']) : 0;\n}", "public static function read_session_array () {\n\t\t$session_array = array();\n\n\t\t// Create a unique-ish $session_var_name\n\t\t// (avoid session variable clash when different OPT tools are run in same browser)\n\t\t$session_var_name = 'opt_tools_' . get_current_blog_id();\n\n\t\tif ( isset($_SESSION[$session_var_name]) ) {\n\t\t\t$session_array = maybe_unserialize ( $_SESSION[$session_var_name] );\n\t\t}\n\n\t\t// Now sanity-check the result.\n\t\tif ( is_array($session_array) ) {\n\t\t\t// At least the 'chrono_array' should be present.\n\t\t\tif ( !is_array($session_array['chrono_array']) ) {\n\t\t\t\tunset ( $session_array );\n\t\t\t\t$session_array = array();\n\t\t\t}\n\t\t} else {\n\t\t\tunset ( $session_array );\n\t\t\t$session_array = array();\n\t\t}\n\n\t\treturn $session_array;\n\t}", "function size()\n\t{\n\t\treturn $this->size;\n\t}", "public function size() : int {\n return $this->size;\n }" ]
[ "0.7283972", "0.6852018", "0.68007946", "0.6762559", "0.63477725", "0.6291906", "0.6036646", "0.5969897", "0.5949898", "0.5895704", "0.5837566", "0.58118343", "0.58074594", "0.5799021", "0.57894385", "0.5780469", "0.5777023", "0.5767695", "0.57575595", "0.5756763", "0.57511413", "0.5750774", "0.57485765", "0.5737948", "0.57071245", "0.5702205", "0.5686071", "0.5665691", "0.56587124", "0.5644285" ]
0.853356
0
Validate the session and reset if necessary.
protected function validate() { // Regenerate session if gone too long and reset timers if ((time() - $this->get('timer.start', null, 'session') > self::EXPIRE)) { session_regenerate_id(true); $this->setTimers(true); } // Destroy session if expired and start a new one if ((time() - $this->get('timer.last', null, 'session') > self::EXPIRE)) { $this->destroy(); $this->start(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateSession(){\n parent::validateSession();\n }", "public function validateLocalSession() {\n\t\t}", "protected function _validate()\n {\n if (!isset($_SESSION)) {\n throw new Exception('Session may not be started.');\n }\n return;\n }", "function _clearErrorSession()\n\t{\n\t\t$_SESSION['XE_VALIDATOR_ERROR'] = '';\n\t\t$_SESSION['XE_VALIDATOR_MESSAGE'] = '';\n\t\t$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = '';\n\t\t$_SESSION['XE_VALIDATOR_RETURN_URL'] = '';\n\t\t$_SESSION['XE_VALIDATOR_ID'] = '';\n\t\t$_SESSION['INPUT_ERROR'] = '';\n\t}", "public function validate() {\n\t\t$sess = $this->sm->checkSession(session_id());\n\t\tif(!isset($sess[0]) || $sess[0]['data'] == '' || $sess[0]['fingerprint'] != $this->fingerprint) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif(time() >= (time()+$this->sessionLifetime)) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "public function validateSession()\n {\n $data = $this->get(self::INTERNAL_SESSION_DATA_VAR);\n $sessLen = $this->sessionLength;\n\n if ($data['userAgent'] != $_SERVER['HTTP_USER_AGENT']) {\n throw new Exception('UserAgent is incorrect!', 1);\n } elseif ($data['remoteAddress'] != $_SERVER['REMOTE_ADDR']) {\n throw new Exception('IP Address of the user has changed!', 2);\n } elseif ($data['lastActivity'] < (new \\DateTime('now'))->modify(\"-$sessLen seconds\")->format('U')\n ) {\n throw new Exception('Last Activity was too long ago!', 3);\n }\n }", "public function getSessionValidate()\n{\n\t$this->__session_details = $this->session->all_userdata();\n\tif(!isset($this->__session_details['admin_login']))\n\t{\n\t\tredirect('Admin','refresh');\n\t}\n}", "function validateSession() {\n \n // if the session array is active\n if ($aUser = $this->getSession()) {\n \n // validate account credentials\n $sql = \"SELECT \n account_id \n FROM \n \".PREFIX.\"_accounts \n WHERE \n account_id=\".$aUser[\"Account Id\"].\" \n AND account_pass='\".$aUser[\"Password\"].\"' \n AND account_email='\".$aUser[\"Email\"].\"' \n AND account_screenname='\".$aUser[\"Screen Name\"].\"' \n AND status=1 \n AND deleted=0\";\n \n if (DB::isError($rsTmp = $this->_oConn->query($sql))) {\n \n catchExc($rsTmp->getMessage());\n return false;\n }\n \n // verify single record for account\n if (!strcmp(1, $rsTmp->numRows())) {\n \n // update session\n $this->_setSession($aUser);\n $iAccountId = (int) $aUser[\"Account Id\"];\n $this->setAccountId($iAccountId);\n return true;\n }\n \n return false;\n }\n \n return false;\n }", "protected static function validateSession() {\n if(isset($_SESSION['OBSOLETE']) && !isset($_SESSION['EXPIRES'])) return false;\n if(isset($_SESSION['EXPIRES']) && $_SESSION['EXPIRES'] < time()) return false;\n return true;\n }", "public static function checkForValidSession(): void\n {\n if (session_status() === PHP_SESSION_ACTIVE && !$_SESSION['activeGame']) {\n self::flash('warning', 'Invalid session or your session has expired. Ending game.');\n }\n }", "public static function checkSession(){\n\t\t\tself::init();\n\t\t\tif (self::get(\"login\")==false) {\n\t\t\t\tself::destroy();\n\t\t\t\theader(\"Location:login.php\");\n\t\t\t}\n\t\t}", "public function testValidateAndStartup() {\n\t\t$session = new Session();\n\t\t$token = $session->get('Session');\n\n\t\t// sleep so that we can cause time changes\n\t\tsleep(1);\n\n\t\t// changing browser should cause a destroy\n\t\t$_SERVER['HTTP_USER_AGENT'] = 'browser changed, hacking attempt!';\n\t\t$session->validate();\n\n\t\t$this->assertNotEquals($token['time'], $session->get('Session.time'));\n\t\t$this->assertNotEquals($token['agent'], $session->get('Session.agent'));\n\n\t\t// try again with no agent check\n\t\t$session = new Session(['checkUserAgent' => false]);\n\t\t$token = $session->get('Session');\n\n\t\tsleep(1);\n\n\t\t$_SERVER['HTTP_USER_AGENT'] = 'browser changed, hacking attempt!';\n\t\t$session->validate();\n\n\t\t// should be equal since we dont care if user agent changed\n\t\t$this->assertEquals($token['time'], $session->get('Session.time'));\n\t\t$this->assertEquals($token['agent'], $session->get('Session.agent'));\n\t}", "function resetSession()\n {\n if (isset($_SESSION['requestToken'])) {\n unset($_SESSION['requestToken']);\n }\n if (isset($_SESSION['requestTokenSecret'])) {\n unset($_SESSION['requestTokenSecret']);\n }\n if (isset($_SESSION['oauthVerifier'])) {\n unset($_SESSION['oauthVerifier']);\n }\n if (isset($_SESSION['accessToken'])) {\n unset($_SESSION['accessToken']);\n }\n if (isset($_SESSION['accessTokenSecret'])) {\n unset($_SESSION['accessTokenSecret']);\n }\n if (isset($_SESSION['noteStoreUrl'])) {\n unset($_SESSION['noteStoreUrl']);\n }\n if (isset($_SESSION['webApiUrlPrefix'])) {\n unset($_SESSION['webApiUrlPrefix']);\n }\n if (isset($_SESSION['tokenExpires'])) {\n unset($_SESSION['tokenExpires']);\n }\n if (isset($_SESSION['userId'])) {\n unset($_SESSION['userId']);\n }\n if (isset($_SESSION['notebooks'])) {\n unset($_SESSION['notebooks']);\n }\n }", "public function clean() \r\n {\r\n $_SESSION = array();\r\n }", "public function checkSession()\n {\n \n }", "function validate()\n{\n\tif (time() - $_SESSION['CREATED'] > 1800) \n {\n \t\t// session started more than 30 minutes ago\n \t//session_regenerate_id(true); // change session ID for the current session and invalidate old session ID\n \t//$_SESSION['CREATED'] = time(); // update creation time\n\t\theader(\"location:sign-in\");\n\t\texit();\n\t}\n}", "protected function _validateUserSession( )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\tif ( $this->session->getBoundIP( ) != getenv( 'REMOTE_ADDR' ) )\r\n\t\t{\r\n\t\t\t$this->session->unsetSessionVariable( 'user_id' );\r\n\t\t\t$this->session->unsetSessionVariable( 'user_key' );\r\n\t\t\t$this->session->stopSession( );\r\n\r\n\t\t\t$this->debug->write( 'Problem validating the user session: IP does not match the session', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem validating the user session: IP does not match the session', 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$this->debug->unguard( true );\r\n\t\treturn true;\r\n\t}", "public function session_verify() {\n global $CFG;\n\n /// disable checks when working in cookieless mode\n if (empty($CFG->usesid) || !empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {\n if ($this->session != NULL) {\n if (empty($_COOKIE['MoodleSessionTest'.$CFG->sessioncookie])) {\n $this->report_session_error();\n } else if (isset($this->session->session_test) && $_COOKIE['MoodleSessionTest'.$CFG->sessioncookie] != $this->session->session_test) {\n $this->report_session_error();\n }\n }\n }\n }", "private function checkSession () {\n \t$this->_session = new Zend_Session_Namespace($this->_config->session->name . \"_\" .APPSTAGE);\n \t/*$this->_session = $this->_registry->get(\"Zend_Session\");*/\n if (empty($this->_session->username)) {\n $this->_response->setRedirect($this->_siteurl.\"/index/login\")->sendResponse();\n\t \texit;\n }\n }", "public function checkSession() {\n\t\treturn $this->_mgrValidated;\n\t}", "public function validate() {\n if(isset($_SESSION['_EXPIRES']) && $_SESSION['_EXPIRES'] < time()) {\n return false;\n }\n return true;\n }", "public function error_validation_session_check()\n{\n\tif(!isset($_SESSION['user_login']))\n\t{\n\t\t\tredirect('Home','refresh');\n\t}\n}", "function validateSession()\n\t{\n\t\tsession_start();\n\t\tif(!isset($_SESSION['accID']))\n\t\t{\n\t\t\t#there is no session active: redirect to login\n\t\t\theader('location: login.php');\n\t\t}\n\t}", "function VerifySession(){\n\t\n\t$SessionKeyCount = count( $_SESSION, COUNT_RECURSIVE );\n\t$SessionId = session_id();\n\t$SessionName = session_name();\n\t\n\t// ensure all session variables are set.\n\tif( \n\t\t$SessionKeyCount < 5 ||\n\t\t! isset( $_SESSION[ \"SESSION_RTPK_R\" ] ) ||\n\t\t! isset( $_SESSION[ \"SESSION_RTPK_T\" ] ) ||\n\t\t! isset( $_SESSION[ \"SESSION_RTPK_K\" ] ) ||\n\t\t! isset( $_SESSION[ \"SESSION_KEY\" ] ) ||\n\t\t! isset( $_SESSION[ \"User\" ] ) ) {\n\n\t\tDestroySession(); // kill whatever may be there\n\t\t\n\t\t// session is not valid ... why ?\n\t\t\n\t\t// no session variables exist - not logged in\n\t\tif( 0 == $SessionKeyCount ){\n\t\t\tif( \"/\" === $_SERVER[\"REQUEST_URI\"] )\t\n\t\t\t\treturn( -1 );\n\t\t\telse\n\t\t\t\treturn( -2 );\n\t\t}\n\t\t// on or more session variables missing\n\t\treturn( -3 ); // session was corrupt\n\t}\n\t// other checks can be added here (ip checks for content availability etc)\n\t\t\n\t// create a new key from session key ingredients\n\t$calc_key = md5( $_SESSION[ \"SESSION_RTPK_R\" ] . $_SESSION[ \"SESSION_RTPK_T\" ] . serialize( $_SESSION[ \"User\" ] ) . $_SESSION[ \"SESSION_KEY\" ] . \"D^f<8@fh6(*SA@!><*JKfjdh5\" );\n\n\t// verify new key against existing key\n\tif( 0 != strcmp( $calc_key, $_SESSION[ \"SESSION_RTPK_K\" ] ) ){\n\t\tDestroySession();\n\t\treturn( -4 );\n\t}\n\t// session is good!\n\t// update key ingredients and generate a new key\n\tmt_srand( (double)microtime() * 1000000 );\n\t$r = mt_rand( 0, mt_getrandmax() ); \n\t$t = time();\n\t// regenerate key\n\t$k = md5( $r . $t . serialize( $_SESSION[ \"User\" ] ) . $_SESSION[ \"SESSION_KEY\" ] . \"D^f<8@fh6(*SA@!><*JKfjdh5\" );\n\t\n\t$_SESSION[ \"SESSION_RTPK_R\" ] = $r;\n\t$_SESSION[ \"SESSION_RTPK_T\" ] = $t;\n\t$_SESSION[ \"SESSION_RTPK_K\" ] = $k;\n\t\n\t// all good!\n\treturn( 0 );\n}", "static protected function validate_session() {\n\t\t// Checks if obsolete is set and if expires is not set\n\t\tif ( isset( $_SESSION['OBSOLETE'] ) && ! isset( $_SESSION['EXPIRES'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Checks if expires is set and if it has expired\n\t\tif ( isset( $_SESSION['EXPIRES'] ) && $_SESSION['EXPIRES'] < time() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static function reset()\n {\n session_unset();\n self::_init();\n }", "public function IsValidAction() {\n $r = Request::createFromGlobals();\n $sid = $r->query->get(\"sid\");\n $v = Session::getInstance()->check($sid);\n\n if ($v) {\n Response::Message($sid);\n }\n else {\n Response::Error(\"Invalid session\");\n }\n }", "public function reset() {\n session_destroy();\n $_SESSION = array();\n }", "public static function run() {\n if (session_status() == PHP_SESSION_NONE) {\n self::$error = \"Please start session!\";\n\n return false;\n }\n\n //check if there is a csrf token in sessions\n if (!isset($_SESSION['autocsrf_token'])) {\n\n //if not\n //generate new token\n $token = self::generateToken();\n\n //set it to sessions\n $_SESSION['autocsrf_token'] = $token;\n $_SESSION['autocsrf_token_time'] = time();\n }\n\n //there is a token\n else {\n $token = $_SESSION['autocsrf_token'];\n }\n }", "public function failSession()\n\t{\n\t\t//\n\t\t// Init local storage.\n\t\t//\n\t\t$session = $this->session();\n\t\t\n\t\t//\n\t\t// Close session.\n\t\t//\n\t\t$session->offsetSet( kTAG_SESSION_END, TRUE );\n\t\t$session->offsetSet( kTAG_SESSION_STATUS, kTYPE_STATUS_FAILED );\n\t\t\n\t\treturn FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}" ]
[ "0.7418648", "0.7201644", "0.69388366", "0.6917461", "0.6615648", "0.6533791", "0.64521223", "0.64379513", "0.64180654", "0.6415134", "0.6405423", "0.6396664", "0.63797176", "0.6360868", "0.63442516", "0.62958854", "0.62931633", "0.6253796", "0.62419796", "0.62395096", "0.621734", "0.61991644", "0.6183155", "0.6177216", "0.614375", "0.61276305", "0.61093223", "0.6104088", "0.6097396", "0.6093438" ]
0.78814316
0
Filter the response on one or more specific PiT source(s) For instance: only PiTs that have a "nwb" source
public function getFilteredResponse() { $tempCollection = $this->json->features; if ($this->hits > 0) { foreach ($tempCollection as $key => $feature) { $filteredPits = []; if (property_exists($feature->properties, 'pits')) { foreach ($feature->properties->pits as $pit) { // filter on both conditions if ($this->filters['source'] && $this->filters['type']) { if (in_array($pit->dataset, $this->filters['source']) && in_array($pit->type, $this->filters['type']) ) { // special tgn filter to disregard "/tgn/term" if (in_array('tgn', $this->filters['source'])) { if (strpos($pit->uri, "/tgn/term/")) { continue; } } $filteredPits[] = $pit; } } // or just one elseif ($this->filters['source'] && !$this->filters['type']) { if (in_array($pit->dataset, $this->filters['source'])) { // special tgn filter to disregard "/tgn/term" if (in_array('tgn', $this->filters['source'])) { if (strpos($pit->uri, "/tgn/term/")) { continue; } } $filteredPits[] = $pit; } } // or the other elseif (!$this->filters['source'] && $this->filters['type']) { if (in_array($pit->type, $this->filters['type'])) { $filteredPits[] = $pit; } } } $feature->properties->pits = $filteredPits; } } // clean up if there were any features found that have no pits with the required type or source foreach ($tempCollection as $key => $col) { if (count($col->properties->pits) === 0) { unset ($tempCollection[$key]); } } return $tempCollection; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function filterToWhere($filter) {\n $where = \"\";\n if (is_array($filter) and array_key_exists(\"protocol\",$filter)) {\n $protocol = strtolower($filter[\"protocol\"]);\n if ($protocol == \"tcp\") $where .= \" AND ip_protocol = 6 \";\n elseif ($protocol == \"udp\") $where .= \" AND ip_protocol = 17 \";\n elseif ($protocol == \"icmp\") $where .= \" AND ip_protocol = 1 \";\n }\n if (is_array($filter) and array_key_exists(\"port\",$filter)) {\n $port = (int) $filter[\"port\"];\n if ($port >= 0) {\n if ($protocol == \"tcp\") $where .= \" AND tcp_dport = $port \";\n elseif ($protocol == \"udp\") $where .= \" AND udp_dport = $port \";\n elseif ($protocol == \"icmp\") $where .= \" AND icmp_type = $port \";\n elseif ($protocol == \"any\") $where .= \" AND (tcp_dport = $port OR udp_dport = $port OR icmp_type = $port ) \"; \n }\n }\n if (is_array($filter) and array_key_exists(\"host\", $filter)) {\n $ip = ip2db($filter[\"host\"]);\n $flow = $filter[\"flow\"];\n $include = $filter[\"include\"];\n\n if ($flow == \"source\") {\n if ($include == \"include\") $where .= \" AND hex(ip_saddr) = '\" . $ip . \"' \";\n elseif ($include == \"exclude\") $where .= \" AND hex(ip_saddr) != '\" . $ip . \"' \";\n } \n elseif ($flow == \"dest\") {\n if ($include == \"include\") $where .= \" AND hex(ip_daddr) = '\" . $ip . \"' \";\n elseif ($include == \"exclude\") $where .= \" AND hex(ip_daddr) != '\" . $ip . \"' \";\n }\n elseif ($flow == \"sourcedest\") {\n if ($include == \"include\") $where .= \" AND ( hex(ip_saddr) = '\" . $ip . \"' OR hex(ip_daddr) = '\" . $ip . \"' ) \";\n elseif ($include == \"exclude\") $where .= \" AND !( hex(ip_saddr) = '\" . $ip . \"' OR hex(ip_daddr) = '\" . $ip . \"' ) \";\n }\n }\n return $where;\n }", "public function showSourceFilterByRequest()\n\t{\n\t\t$request = Main\\Context::getCurrent()->getRequest();\n\t\t$sourceIndex = (string)$request->get('SOURCE_ID');\n\t\tunset($request);\n\t\tif ($sourceIndex === '')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t$this->showSourceFilter($sourceIndex);\n\t}", "public function trelloDataIsFiltered()\n {\n //print_r( $this->trelloRawData() );\n }", "public function filters();", "public function filters() {\n\t\treturn [\n\t\t\t'mask_url',\n\t\t\t'redirect_traffic_url'\n\t\t];\n\t}", "function advanced_remove_piVars_filter()\n {\n static $bool_firstCall = true;\n\n ///////////////////////////////////////////////////////////\n //\n // RETURN if we have a second call\n\n if ( !$bool_firstCall )\n {\n return;\n }\n // RETURN if we have a second call\n\n\n\n $bool_firstCall = false;\n\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n\n $view = $this->pObj->view;\n $viewWiDot = $view . '.';\n $conf_view = $conf[ 'views.' ][ $viewWiDot ][ $mode . '.' ];\n\n\n\n ///////////////////////////////////////////////////////////\n //\n // RETURN if there isn't any filter\n\n if ( empty( $conf_view[ 'filter.' ] ) )\n {\n return;\n }\n // RETURN if there isn't any filter\n ///////////////////////////////////////////////////////////\n //\n // Remove filter piVars\n\n $arr_rmPiVars = array();\n foreach ( ( array ) $conf_view[ 'filter.' ] as $tableWiDot => $arr_fields )\n {\n // 120915, dwildt, 1-\n //foreach( ( array ) $arr_fields as $fieldWiDot => $arr_field )\n // 120915, dwildt, 1+\n foreach ( array_keys( ( array ) $arr_fields ) as $fieldWiDot )\n {\n if ( substr( $fieldWiDot, -1 ) == '.' )\n {\n $field = substr( $fieldWiDot, 0, -1 );\n $tableField = $tableWiDot . $field;\n if ( isset( $this->pObj->piVars[ $tableField ] ) )\n {\n unset( $this->pObj->piVars[ $tableField ] );\n $arr_rmPiVars[] = $tableField;\n }\n }\n }\n }\n // Remove filter piVars\n ///////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n\n if ( $this->pObj->b_drs_templating )\n {\n if ( !empty( $arr_rmPiVars ) )\n {\n $str_prompt = implode( '], piVars[', array_keys( $arr_rmPiVars ) );\n $str_prompt = 'piVars[' . $str_prompt . ']';\n t3lib_div::devLog( '[INFO/FILTER] filter values are removed from links to single views<br />\n <br />\n removed: ' . $str_prompt . '.', $this->pObj->extKey, 0 );\n }\n }\n // DRS - Development Reporting System\n }", "public function sourceRecords($params = null) {\n\t\treturn Subscription::get()->filter(array(\n\t\t 'Status' => 1,\n\t\t\t'IsTrial' => 1)\n\t\t)->exclude('Member.ID',null);\n }", "public function sourceRecords($params = null) {\n\t\treturn Subscription::get()->filter(array(\n\t\t 'ProductID' => 2,\n\t\t\t'Status' => 1)\n\t\t)->exclude('Member.ID',null);\n }", "public function sourceRecords($params = null) {\n\t\treturn Subscription::get()->filter(array(\n\t\t 'ProductID' => 3,\n\t\t\t'Status' => 1)\n\t\t)->exclude('Member.ID',null);\n }", "function getTweetsByFilter() {\n\n // for each filter, get tweets, write them to a JSON file\n \n // hardcode for all filter\n\n // hardcode for main filter\n getTweetsByUsername(\"jay_raiii\");\n\n // hardcode for employee filter\n\n // hardcode for customer filter\n }", "public function sourceRecords($params = null) {\n\t\treturn Subscription::get()->filter(array(\n\t\t 'Status' => 0,\n\t\t\t'IsTrial' => 1)\n\t\t)->exclude('Member.ID',null);\n }", "public function setPitSourceFilter(array $sources)\n {\n foreach ($sources as $source) {\n if (!in_array($source, Sources::getAllSets())) {\n throw new \\RuntimeException(\"Unknown histograph source '{$source}'.\");\n }\n }\n\n $this->filters['source'] = $sources;\n\n return $this;\n }", "function getSourcesNotTracked($username) {\n $sources = array();\n $db = mysqli_connect($this->dbInfo['DB_SERVER'], $this->dbInfo['DB_USERNAME'],\n $this->dbInfo['DB_PASSWORD'], $this->dbInfo['DB_DATABASE']);\n mysqli_set_charset($db, \"utf8\");\n if (!$db)\n die(\"Connection failed: \" . mysqli_connect_error());\n\n $stmt = $db->prepare(\"SELECT ks.source\n FROM kanji_source ks\n WHERE ks.id NOT IN (SELECT k.source_id\n FROM student_kanji sk\n JOIN kanji k ON sk.kanji_id = k.id\n JOIN kanji_source kks ON k.source_id = kks.id\n JOIN student s ON sk.student_id = s.id\n WHERE s.username = ?)\");\n $stmt->bind_param(\"s\", $username);\n $stmt->execute();\n $results = $stmt->get_result();\n\n if (mysqli_num_rows($results) > 0) {\n while($row = mysqli_fetch_assoc($results))\n array_push($sources, $row[\"source\"]);\n }\n mysqli_close($db);\n\n return $sources;\n }", "public function sourceRecords($params = null) {\n\t\treturn Subscription::get()->filter(array(\n\t\t 'ProductID' => 1,\n\t\t\t'Status' => 1)\n\t\t)->exclude('Member.ID',null);\n }", "function removeFiltersFromPiVars( $inputPiVars, $filterConf )\n {\n // For development prompts only\n static $bool_firsttime = true;\n\n//if( $bool_firsttime )\n//{\n// $this->pObj->dev_var_dump( $inputPiVars, $filterConf );\n//}\n $arr_tableFilter = null;\n\n // #40958, 4.1.10, 120916, dwildt, +\n // SWITCH : RETURN if there aren't piVars or if any filter filter isn't set\n switch ( true )\n {\n case( empty( $inputPiVars ) ):\n case( empty( $filterConf ) ):\n $bool_firsttime = false;\n return $inputPiVars;\n default:\n // Follow the workflow\n break;\n }\n // SWITCH : RETURN if there aren't piVars or if any filter filter isn't set\n // #40958, 4.1.10, 120916, dwildt, +\n // Get the filter fields\n // #40958, 4.1.10, 120916, dwildt, 2-\n// if( is_array( $filterConf ) && is_array( $inputPiVars ) )\n// {\n foreach ( ( array ) $filterConf as $tableWiDot => $arrFields )\n {\n // 120915,dwildt, 1-\n //foreach( ( array ) $arrFields as $fieldWiWoDot => $dummy)\n // 120915,dwildt, 1+\n foreach ( array_keys( ( array ) $arrFields ) as $fieldWiWoDot )\n {\n if ( substr( $fieldWiWoDot, -1 ) != '.' )\n {\n $arr_tableFilter[] = $tableWiDot . $fieldWiWoDot;\n }\n }\n }\n // #40958, 4.1.10, 120916, dwildt, 1-\n// }\n // Get the filter fields\n // Remove the filter fields temporarily\n if ( is_array( $arr_tableFilter ) )\n {\n $outputPiVars = array_diff_key( $inputPiVars, array_flip( $arr_tableFilter ) );\n }\n // Remove the filter fields temporarily\n // RETURN false in case of any piVar\n if ( count( $outputPiVars ) == 0 )\n {\n $bool_firsttime = false;\n return false;\n }\n // RETURN false in case of any piVar\n\n $bool_firsttime = false;\n return $outputPiVars;\n }", "public function trips_filter_from_to()\n {\n $this->get('/api/v1/get-available-trips?from=Cairo&to=Suiz')\n ->assertSee('Suiz')\n ->assertDontSee('Gharbia');\n\n }", "public function getDescriptions($filter = StreamWrapperInterface::ALL);", "function getGSFiles_filteredBy_TEST($fn,$filters) {\n\n $filter = array_merge(array('user_id' => $_SESSION['User']['id']),$filters);\n\n $fileDMP = DMP_http(\"get\",\"file\",$filter);\n\n // convert DMP file to VRE file\n list($fileData,$fileMeta) = getVREfile_fromFile($fileDMP);\n\n // return VRE file according filter\n\n\tif (empty($fileData))\n\t\treturn 0;\n\n\telseif (empty($fileMeta))\n\t\treturn $fileData;\n\telse\n\t\treturn array_merge($fileData,$fileMeta);\t\n}", "public function showSourceFilter($index)\n\t{\n\t\tglobal $APPLICATION;\n\n\t\t$source = $this->findSource($index);\n\t\tif (empty($source))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ($source['TYPE'])\n\t\t{\n\t\t\tcase self::SOURCE_TYPE_COMPONENT:\n\t\t\t\t$APPLICATION->IncludeComponent(\n\t\t\t\t\t'bitrix:ui.sidepanel.wrapper',\n\t\t\t\t\t'.default',\n\t\t\t\t\t[\n\t\t\t\t\t\t'POPUP_COMPONENT_NAME' => $source['SETTINGS']['COMPONENT_NAME'],\n\t\t\t\t\t\t'POPUP_COMPONENT_TEMPLATE_NAME' => $source['SETTINGS']['COMPONENT_TEMPLATE_NAME'],\n\t\t\t\t\t\t'POPUP_COMPONENT_PARAMS' => $source['SETTINGS']['COMPONENT_PARAMS'],\n\t\t\t\t\t] + $source['SETTINGS']['WRAPPER']\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function getSources() {\n return self::SOURCE_REQUEST;\n }", "private function filterHeaderWM($t){\n\t\t\t$hilangkanHeader = array('W213','W217');\n\t\t\t$result = array();\n\t\t\tif(!empty($t)){\n\t\t\t\tforeach ($t as $_t) {\n\t\t\t\t\tif(in_array($_t['SLOC'],$hilangkanHeader)){\n\t\t\t\t\t\tif(empty($_t['WHN'])){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$result[] = $_t;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function paper_filter($contact, $req, AssignmentState $state) {\n return null;\n }", "protected function filter()\n {\n $lists = [\n 'listCompetitions',\n 'listCountries',\n 'listEvents',\n 'listEventTypes',\n 'listMarketTypes',\n 'listVenues',\n 'listMarketCatalogue'\n ];\n\n if (in_array($this->method, $lists) && empty($this->params[ 'filter' ])) {\n $this->params[ 'filter' ] = new \\stdClass;\n }\n }", "public function testGenerateViewWithFilterRemovesFilteredDataButKeepsResourcesInTheImpactIndex()\n {\n // get the view - this should trigger generation\n $this->tripodViews->getViewForResource(\"http://talisaspire.com/resources/filter1\",\"v_resource_filter1\");\n\n $expectedView = array(\n \"_id\"=>array(\n _ID_RESOURCE=>\"http://talisaspire.com/resources/filter1\",\n _ID_CONTEXT=>'http://talisaspire.com/',\n \"type\"=>\"v_resource_filter1\"),\n \"value\"=>array(\n _GRAPHS=>array(\n // This Book should not be included in the view - we are filtering to include only chapters.\n //\n // array(\n // \"_id\"=>array(\"r\"=>\"http://talisaspire.com/works/filter1\",\"c\"=>'http://talisaspire.com/'),\n // \"dct:subject\"=>array(\"u\"=>\"http://talisaspire.com/disciplines/physics\"),\n // \"rdf:type\"=>array(\n // array(VALUE_URI=>\"bibo:Book\"),\n // array(VALUE_URI=>\"acorn:Work\")\n // )\n // ),\n array(\n \"_id\"=>array(\"r\"=>\"http://talisaspire.com/works/filter3\",\"c\"=>'http://talisaspire.com/'),\n \"dct:subject\"=>array(\"u\"=>\"http://talisaspire.com/disciplines/physics\"),\n \"rdf:type\"=>array(\n array(VALUE_URI=>\"bibo:Chapter\"),\n array(VALUE_URI=>\"acorn:Work\")\n )\n ),\n array(\n \"_id\"=>array(\"r\"=>\"http://talisaspire.com/resources/filter1\",\"c\"=>'http://talisaspire.com/'),\n \"rdf:type\"=>array(\n array(VALUE_URI=>\"bibo:Book\"),\n array(VALUE_URI=>\"acorn:Resource\"),\n array(VALUE_URI=>\"rdf:Seq\")\n ),\n \"searchterms:topic\"=>array(\n array(VALUE_LITERAL=>\"engineering: general\"),\n array(VALUE_LITERAL=>\"physics\"),\n array(VALUE_LITERAL=>\"science\")\n ),\n \"dct:isVersionOf\"=>array(\n array(VALUE_URI=>\"http://talisaspire.com/works/filter1\"),\n array(VALUE_URI=>\"http://talisaspire.com/works/filter2\"),\n array(VALUE_URI=>\"http://talisaspire.com/works/filter3\")\n )\n )\n ),\n _IMPACT_INDEX=>array(\n array(_ID_RESOURCE=>\"http://talisaspire.com/resources/filter1\",_ID_CONTEXT=>'http://talisaspire.com/'),\n // This item has been filtered - but it should still be in the impact index\n array(_ID_RESOURCE=>\"http://talisaspire.com/works/filter1\",_ID_CONTEXT=>'http://talisaspire.com/'),\n array(_ID_RESOURCE=>\"http://talisaspire.com/works/filter2\",_ID_CONTEXT=>'http://talisaspire.com/'),\n array(_ID_RESOURCE=>\"http://talisaspire.com/works/filter3\",_ID_CONTEXT=>'http://talisaspire.com/')\n )\n )\n );\n // get the view direct from mongo\n $mongo = new Client(\n \\Tripod\\Config::getInstance()->getConnStr('tripod_php_testing'),\n [],\n ['typeMap' => ['root' => 'array', 'document' => 'array', 'array' => 'array']]\n );\n $actualView = $mongo->selectCollection('tripod_php_testing','views')->findOne(array('_id'=>array(\"r\"=>'http://talisaspire.com/resources/filter1',\"c\"=>'http://talisaspire.com/',\"type\"=>'v_resource_filter1')));\n $this->assertEquals($expectedView['_id'], $actualView['_id']);\n $this->assertEquals($expectedView['value'], $actualView['value']);\n $this->assertInstanceOf('\\MongoDB\\BSON\\UTCDateTime', $actualView['_cts']);\n }", "public function get_sppm_filter($filter) {\r\n $sql = \"SELECT PAYMENT_DATE , INVOICE_NUM, CHECK_DATE, to_char(CREATION_DATE,'dd-mm-yyyy hh24:mi:ss') CREATION_DATE, \r\n\t\t\t\tCHECK_NUMBER, CHECK_NUMBER_LINE_NUM, CHECK_AMOUNT, BANK_ACCOUNT_NAME ,\r\n\t\t\t\tBANK_NAME, VENDOR_EXT_BANK_ACCOUNT_NUM, VENDOR_NAME, \r\n\t\t\t\tINVOICE_DESCRIPTION, FTP_FILE_NAME, RETURN_DESC, RETURN_CODE, KDKPPN, PAYMENT_METHOD, SORBOR_NUMBER, SORBOR_DATE\r\n\t\t\t\tFROM \" . $this->_table . \"\r\n\t\t\t\tWHERE FL_VOID <> 1 \r\n AND PAYMENT_DATE BETWEEN TO_DATE ('\".Session::get('ta').\"0101','YYYYMMDD') AND TO_DATE ('\".Session::get('ta').\"1231','YYYYMMDD') \";\r\n //SP2D = 140181301002823\r\n //xml = 520002000990_SP2D_O_20140408_101509_367.xml\r\n $no = 0;\r\n //var_dump($filter);\r\n foreach ($filter as $filter) {\r\n $sql .= \" AND \" . $filter;\r\n }\r\n $sql .= \" ORDER BY PAYMENT_DATE DESC, CREATION_DATE DESC\";\r\n //var_dump ($sql);\r\n $result = $this->db->select($sql);\r\n $data = array();\r\n foreach ($result as $val) {\r\n $d_data = new $this($this->registry);\r\n $d_data->set_payment_date(date(\"d-m-Y\", strtotime($val['PAYMENT_DATE'])));\r\n $d_data->set_invoice_num($val['INVOICE_NUM']);\r\n $d_data->set_check_date(date(\"d-m-Y\", strtotime($val['CHECK_DATE'])));\r\n $d_data->set_creation_date($val['CREATION_DATE']);\r\n $d_data->set_check_number($val['CHECK_NUMBER']);\r\n $d_data->set_check_number_line_num($val['CHECK_NUMBER_LINE_NUM']);\r\n\t\t\t$d_data->set_check_amount(($val['CHECK_AMOUNT']));\r\n $d_data->set_bank_account_name($val['BANK_ACCOUNT_NAME']);\r\n $d_data->set_bank_name($val['BANK_NAME']);\r\n $d_data->set_vendor_ext_bank_account_num($val['VENDOR_EXT_BANK_ACCOUNT_NUM']);\r\n $d_data->set_vendor_name($val['VENDOR_NAME']);\r\n $d_data->set_invoice_description($val['INVOICE_DESCRIPTION']);\r\n $d_data->set_ftp_file_name($val['FTP_FILE_NAME']);\r\n $d_data->set_return_code($val['RETURN_CODE']);\r\n $d_data->set_return_desc($val['RETURN_DESC']);\r\n $d_data->set_payment_method($val['PAYMENT_METHOD']);\r\n $d_data->set_kdkppn($val['KDKPPN']);\r\n if (is_null($val['SORBOR_NUMBER'])) {\r\n $d_data->set_sorbor_number('-');\r\n } else {\r\n $d_data->set_sorbor_number($val['SORBOR_NUMBER']);\r\n }\r\n if (is_null($val['SORBOR_DATE'])) {\r\n $d_data->set_sorbor_date('-');\r\n } else {\r\n $d_data->set_sorbor_date(date(\"d-m-Y\", strtotime($val['SORBOR_DATE'])));\r\n }\r\n $data[] = $d_data;\r\n\t\t\t//var_dump($d_data);\r\n }\r\n return $data;\r\n }", "public function filterResponse(Response $response);", "function filter($s = NULL, $p = NULL, $o = NULL, $s_type = NULL, $o_type = NULL, $o_datatype = NULL, $o_lang = NULL) {\r\n\t\t$input = $this->getTriples ();\r\n\t\t$output = array ();\r\n\t\t// We add the given filter\r\n\t\t$this->filterAdd ( $s, $p, $o, $s_type, $o_type, $o_datatype, $o_lang );\r\n\r\n\t\t// We cycle throught the triples\r\n\t\tforeach ( $input as $triple ) {\r\n\t\t\t// We cycle through the filter stack\r\n\t\t\t$matches = true;\r\n\t\t\tforeach ( $this->filterStack as $filter ) {\r\n\t\t\t\t// If the triple does not match one filter, do not add it the output set\r\n\t\t\t\tif (! $this->match ( $triple, $filter [0], $filter [1], $filter [2], $filter [3], $filter [4], $filter [5], $filter [6] )) {\r\n\t\t\t\t\t$matches = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($matches)\r\n\t\t\tarray_push ( $output, $triple );\r\n\t\t}\r\n\t\t// We clean the filter\r\n\t\t$this->filterInit ();\r\n\t\treturn new Bucket ( $output, $this->arc );\r\n\t}", "function stream_get_filters () {}", "public function get_sources() {\n\t\t$sources = [];\n\t\tif ( substr( $this->source, 0, 1 ) === '[' && substr( $this->source, -1 ) === ']' ) {\n\t\t\t$sources = json_decode( $this->source, true );\n\t\t\tif ( ! is_array( $sources ) || empty( $sources ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $sources;\n\t\t}\n\n\t\t$sources = [\n\t\t\t[\n\t\t\t\t'pattern' => $this->source,\n\t\t\t\t'comparison' => $this->matching,\n\t\t\t],\n\t\t];\n\n\t\treturn $sources;\n\t}", "function prop_filter_headers($headers)\n{\n\n if (isset($headers['X-Pingback'])) {\n unset($headers['X-Pingback']);\n }\n return $headers;\n\n}" ]
[ "0.54422057", "0.52951324", "0.5195428", "0.5075057", "0.50221264", "0.5004541", "0.48899916", "0.48856542", "0.4880364", "0.48781866", "0.48578036", "0.48525894", "0.48403513", "0.48186594", "0.4812417", "0.4733212", "0.47330976", "0.47262222", "0.471077", "0.47088847", "0.47031388", "0.46976086", "0.46837774", "0.4663343", "0.46452728", "0.46365178", "0.46256524", "0.4609", "0.45882142", "0.45855483" ]
0.61075413
0
Returns the expected total for items. If we have 2 for $200, and 6 item units, we expect $600 as a result here
private function getExpectedTotal(int $expectedAmount, int $itemsAmount, iterable $items): int { // Since the promotion is registered as x products for y amount, calculate price per item $amountPerItem = (int) \round($expectedAmount / $itemsAmount); // Return the price per item * items amount $units = []; /** @var OrderItemInterface $item */ foreach ($items as $item) { $units = \array_merge($units, $item->getUnits()->toArray()); } return $amountPerItem * count($units); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function calculateTotals(): float{\r\n $tempTotal = 0;\r\n foreach($this->listOfItems as &$item){\r\n $item['total'] = $item['price'] * $item['quantity'];\r\n $tempTotal += $item['total'];\r\n }\r\n\r\n return $tempTotal;\r\n }", "public function get_total() {\n $total = 0;\n if (!empty($this->items)) {\n foreach ($this->items as $item) {\n if (!empty($item['discount'])) {\n $total += $item['quantity'] * $item['price'] * ($item['discount'] / 100);\n } else {\n if($item['total'] != 0){\n $total = $item['total'];\n }\n }\n }\n \n foreach ($this->items as $item) {\n if (!empty($item['discount'])) {\n $total += $item['quantity'] * $item['price'] * ($item['discount'] / 100);\n } else {\n if($item['price'] > 0 && empty($item['total'])){\n $total += $item['quantity'] * $item['price'];\n }\n }\n }\n }\n return $total;\n }", "public function getTotal(){\n\t\t$total = 0;\n\n\t\tforeach ($this->items as $id) {\n\t\t\t\t\t\t$subtotal = $id['qty'] * ($id['item']->getPrice());\n\t\t\t\t\t\t$total += $subtotal;\n\t\t\t\t\t}\n\n\t\treturn $total;\t\t\t\n\t}", "public function getTotalItems() {\r\n $result = 0;\r\n foreach ($this->cartItems as $item) {\r\n $result += $item->getQuantity();\r\n }\r\n return $result;\r\n }", "public function test_net_total()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$basket->add_item($item, 6);\n\n\t\t$this->assertSame($basket->net_total(), 29.94);\n\t}", "private function _calcTotal()\n {\n $total = 0;\n foreach ($this->cart as $item) {\n $total += ($item->bundlePrice ? ($item->bundlePrice * $item->quantity) : ($item->price * $item->quantity));\n }\n return $total;\n }", "public function testCalcItemsPrice()\n {\n // deleting discounts\n foreach ( $this->aDiscounts as $oDiscount )\n $oDiscount->delete();\n\n $oBasket = new modForTestAddBundles();\n $oBasket->addToBasket( $this->oArticle->getId(), 10 );\n $oBasket->UNITcalcItemsPrice();\n\n $this->assertEquals( 1, $oBasket->getVar( 'iProductsCnt' ) );\n $this->assertEquals( 10, $oBasket->getVar( 'dItemsCnt' ) );\n $this->assertEquals( 100, $oBasket->getVar( 'dWeight' ) );\n }", "public function getTotal() : float\n {\n return $this->items->pluck('amount')->sum();\n }", "private function calculateTotal() {\n $this->total = 0.00;\n if($this->hasItems()) {\n $tot = 0.00;\n foreach($this->items as $item) {\n $tot += $item['subtotal'];\n }\n $this->total = $tot;\n }\n }", "public function test_gross_total()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$basket->add_item($item, 4);\n\n\t\t$this->assertSame($basket->gross_total(), 23.95);\n\t}", "public function getTotal()\n {\n $total_ht = 0;\n\n foreach ($this->getItems() as $item)\n { \n if ($this->is_unit_price_ttc)\n { \n $total_ht += $item->getQuantity() * $item->getPriceDueToday() * (1 - $item->getDiscount() / 100) / (1 + $this->tax / 100);\n }\n else\n {\n $total_ht += $item->getQuantity() * $item->getPriceDueToday() * (1 - $item->getDiscount() / 100);\n }\n }\n \n $total_ht = $this->applyDiscounts($total_ht);\n\n return $total_ht;\n }", "public function getTotal(): float\n\t{\n\t\t$total = 0;\n\n\t\tforeach ($this->items as $item) {\n\n\t\t\t$total += $item->getPrice();\n\t\t}\n\n\t\treturn $total;\n\t}", "function getTotal(){\n\t\t$items = $this->Items();\n\t\t$sum = 0;\n\t\tif ($items){\n\t\t\tforeach ($items as $item) {\n\t\t\t\t$sum+= $item->getSubTotal();\n\t\t\t}\n\t\t}\n\t\treturn $sum;\n\t}", "public function getTotal()\n {\n\n $total = 0;\n\n foreach ($this->items as $item) {\n $total += $item->getTotal();\n }\n return $total;\n }", "function GetItemTotalPrice($item){\n\t\treturn $item['ItemPrice'] * $item['ItemQty'];\n\t}", "public function getExpectedQuantity()\n {\n return $this->expectedQuantity;\n }", "function GetItemTotalPrice($item){\n\t\t\treturn $item['ItemPrice'] * $item['ItemQty']; \n\t\t}", "protected function getTotalItems()\n {\n return (int)$this->total_items;\n }", "function _update_total()\n\t\t{\n\t\t$this->itemcount = 0;\n\t\t$this->total = 0;\n\t\tif(sizeof($this->items > 0))\n\t\t\t{\n\t\t\tforeach($this->items as $item)\n\t\t\t\t{\n\t\t\t\t$this->total = $this->total + ($this->itemprices[$item] * $this->itemqtys[$item]);\n\n\t\t\t\t// TOTAL ITEMS IN CART (ORIGINAL wfCart COUNTED TOTAL NUMBER OF LINE ITEMS)\n\t\t\t\t$this->itemcount += $this->itemqtys[$item];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public static function get_total_items() {\n\t\treturn (int) self::db()->singleQuery('\n SELECT COUNT(1)\n FROM items');\n\t}", "public function testTotal()\n {\n $order = factory('App\\Order')->create();\n\n $this->assertEquals($order->quantity * $order->product->price, $order->total);\n }", "public function total()\n\t{\n\t\treturn $this->total_items;\n\t}", "public function get_item_count() {\n $total = 0;\n if (!empty($this->items)) {\n foreach ($this->items as $item) {\n $total += $item['quantity'];\n }\n }\n return $total;\n }", "public function getTotal(): float\n {\n $total = 0;\n\n foreach ($this->getItems() as $item) {\n $total += $item->getTotal();\n }\n\n return $total;\n }", "public function getTotalPrice() {\r\n $result = 0;\r\n foreach ($this->cartItems as $item) {\r\n $result += $item->getTotal();\r\n }\r\n return $result;\r\n }", "public function total_items () {\n return $this->getShoppingCartService()->total_items();\n }", "public function getItemsTotal()\n {\n $this->recalculateItemsTotalIfNeeded();\n\n return $this->itemsTotal;\n }", "protected function validateItemTotal() {\n\t}", "public function total()\n {\n return $this->quantity * $this->unitPrice;\n }", "function total_items($cart){\n\t\t$items = 0;\n\t\tif(is_array($cart)){\n\t\t\tforeach($cart as $isbn => $qty){\n\t\t\t\t$items += $qty;\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}" ]
[ "0.7135809", "0.7081638", "0.70666504", "0.69815737", "0.6958673", "0.6904265", "0.6902634", "0.6798975", "0.67984647", "0.67905223", "0.6773618", "0.67153543", "0.6706052", "0.67033577", "0.6679885", "0.66499364", "0.66432077", "0.65883917", "0.6527464", "0.6438689", "0.64333314", "0.642432", "0.6424046", "0.64156246", "0.640261", "0.6390721", "0.6373478", "0.63658386", "0.6336018", "0.6330334" ]
0.7867813
0
pwdExists checks if a password truely exists in the database
public function pwdExists(){ $sql = "SELECT * FROM admin WHERE password = '".md5($this->passWord)."' AND id = $this->id LIMIT 1 "; $result = $this->dbObj->fetchAssoc($sql); if($result != false){ return true; } else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function passwordExists($dbConn, $username, $password){\n $isValid = false;\n $dbQuery = \"SELECT Password FROM USERS WHERE Username = '\".$username.\"' LIMIT 1\";\n \n $dbRows = mysqli_query($dbConn, $dbQuery);\n $dbValues = mysqli_fetch_assoc($dbRows);\n $dbPassword = $dbValues['Password'];\n \n if (password_verify($password, $dbPassword)){\n $isValid = true;\n // Check if the password needs a rehash.\n if (password_needs_rehash($dbPassword, PASSWORD_DEFAULT)){\n $dbPassword = password_hash($password, PASSWORD_DEFAULT);\n $dbQuery = \"UPDATE USERS SET Password = '\".$dbPassword.\"' WHERE Username = '\".$username.\"'\";\n $dbRows = mysqli_query($dbConn, $dbQuery);\n }\n }\n \n return $isValid;\n }", "function usernamePasswordExist($username, $password) {\n if (checkUsername($username) && checkPassword($password)) {\n // Check if username and password are in database\n $query = \"SELECT COUNT(username) as num FROM accounts WHERE username = :username AND password = :password\";\n $params = array(\":username\"=>trim($_POST[\"username\"]), \":password\"=>trim($_POST[\"password\"]));\n $results = db_execute_one($query, $params);\n if ($results[\"num\"] > 0) {\n return true;\n }\n }\n return false;\n}", "public function checkPasswordExistence($password){\n $query = \"SELECT * FROM users WHERE password='$password'\";\n\n $res = mysqli_query($this->__construct(), $query);\n\n if (mysqli_num_rows($res) > 0){\n return true;\n }else{\n return false;\n }\n }", "public function CheckPassword(){\r\n\r\n\t\t\tif($this->data[$this->alias]['password'] == Security::hash($this->data[$this->alias]['pass'],null,true)){\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}", "function checkPassword($randname,$password) {\n\t$db = new PDO('sqlite:f2.sqlite');\n\n\t$stmt = $db->prepare(\"SELECT password FROM files WHERE randname = :randname;\");\n\t$stmt->bindValue(':randname', $randname);\n\t$stmt->execute();\n\t$result = $stmt->fetch();\n\t$dbpass = $result['password'];\n\n\tif (password_verify($password, $dbpass)) {\n\t\t$return = TRUE;\n\t}\n\telse {\n\t\t$return = FALSE;\n\t}\n\n\treturn $return;\n}", "function fun_checkuserpwd($arg_user,$arg_pwd){\n\t\t\t//create Sql statement\n\t\t\t$this->pro_sql =\"SELECT * FROM tbl_staff WHERE UserName='$arg_user' and Password='$arg_pwd'\";\n\t\t\t//sent sql statement to server\n\t\t\t$this->pro_query = mysqli_query($this->fun_link(),$this->pro_sql);\n\t\t\t$this->pro_count = mysqli_num_rows($this->pro_query);\n\t\t\t//echo $this->pro_count;\n\t\t\n\t\t\tif($this->pro_count == 1){\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 checkPassword($pwd) {\n if(!preg_match('/(?=^.{8,}$)((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/',$pwd)) {\n return false;\n } else {\n return true;\n }\n}", "public function verifyPassword($uid, $pw){\n\t\t$query = \"SELECT user_password FROM user WHERE user_id = ?\";\n\t\t\n\t\t$stmt = $this->prepareStatement($query);\n\t\t$bind = $stmt->bind_param(\"i\", $uid);\n\t\tif(!$bind)\n\t\t\treturn false;\n\t\t\n\t\t$exec = $stmt->execute();\n\t\tif(!$exec)\n\t\t\treturn false;\n\t\t\t\n\t\t$stmt->store_result();\n\t\t\t\n\t\tif($stmt->num_rows == 0)\n\t\t\treturn false;\n\t\t\t\n\t\t$stmt->bind_result($stored_pw);\n\t\t$stmt->fetch();\n\t\t\n\t\t$pw = $this->hashPassword($pw);\n\t\t\n\t\treturn (strcmp($pw, $stored_pw) == 0);\n\t}", "function login_exists($email, $password)\n \t{\n\t\t// check if login info exists\n \t$stmt = $this->database->stmt_init();\n \tif ($stmt->prepare(\"SELECT * FROM users \n \tWHERE email=?\n \tAND passwd = sha1(?)\"))\n \t{ \n \t\t$stmt->bind_param('ss', $email, $password);\n \t\t$stmt->execute();\n \t\t$stmt->store_result();\n \t\t\tif ($stmt->num_rows()>0)\n \t\t\treturn true;\n \t\telse \n \t\t\treturn false;\n \t} \n\t\telse \n\t\t{\n \tthrow new Exception('DB query error');\n \t}\n \t}", "function chkPassword($CurPwd, $admin_id)\n\t{\n\t\t$SelQuery\t= \"SELECT `Ident` FROM `admin`\"\n\t\t .\" WHERE binary `Password` = '\".$CurPwd.\"' AND `Ident` = \".$admin_id.\" LIMIT 0,1\";\n\t\t$SelResult\t= $this->ExecuteQuery($SelQuery, \"select\");\n\t\tif(!empty($SelResult) && !empty($SelResult[0]['Ident']))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function password_match($pwd) {\r\n\t\t$algo = Users::create_hash_algorithm($this->hash_type);\r\n\t\treturn $algo->check($pwd, $this->password);\r\n\t}", "function getCredentialsAreValid($username, $password)\r\n{\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try\r\n {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username); \r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n // Validate using password_verify()\r\n return (password_verify($password, $result['password']));\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n } \r\n}", "function checkPasswordMatchesRepeat($pwd, $pwdRepeat) {\r\n return ($pwd === $pwdRepeat);\r\n}", "public function checkPassword($passwd,$dbpasswd) {\n $hash = password_hash($passwd, PASSWORD_BCRYPT);\n $dbpasswd = $this->getPassword();\n if (password_verify($dbpasswd, $hash)) {\n return true; \n }\n }", "function checkPassword($user_id, $passw) {\n\n $db = dbConnect();\n\n $sql = \"SELECT user_passw FROM `linfo_users` WHERE `user_id` = '$user_id'\";\n\n $sm = $db->prepare($sql);\n\n if (!$sm->execute()) {\n echo \"something not ok <br>\";\n echo \"error-code: 61\";\n die();\n }\n\n $passw_id_db = $sm->fetchColumn();\n\n if (password_verify($passw, $passw_id_db)) {\n\n return true;\n } else {\n\n return false;\n }\n }", "function is_user_exist($user, $password){\n\t\n $SQL = \"SELECT * FROM user_list WHERE username = '$user' and password = '$password'\";\n global $db;\n $res = $db->prepare($SQL);\n $res->execute();\n \n if($res->rowCount() === 0) return false;\n else return true;\n}", "private function pwdCheck($pwd, $result) {\n if ($this->saltedsha1($pwd) == $result || $this->sha1pwd($pwd) == $result || $this->md5pwd($pwd) == $result) {\n return true;\n } else {\n return false;\n }\n }", "function password_check($password, $existing_hash){\r\n // $hash = crypt($password, $existing_hash);\r\n //if ($hash === $existing_hash){\r\n if($password === $existing_hash){\r\n return TRUE;\r\n }\r\n else {\r\n return FALSE;\r\n }\r\n }", "function checkPassword($username, $password, $connection)\n{\n\t$sql = \"SELECT password FROM USERS WHERE username = '$username'\";\n\t$result = $connection->query($sql);\n\tif($result->num_rows > 0)\n\t{\n\t\twhile($row = $result->fetch_assoc())\n\t \t{\n\t\t\t$passwd = $row[\"password\"]; \n\t\t}\n\t\tif($passwd === $password)\n\t\t{\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}\n}", "function checklogin($name, $passwd){\n\t$dbc = connectToDB(\"jed\");\n\t$encodepw = sha1($passwd);\n\t$result = performQuery($dbc, \n\t\t\"select * FROM pwdemo where name='$name' and pass='$encodepw'\");\n\t$matches = mysqli_num_rows($result);\n\tmysqli_free_result($result);\n\tdisconnectFromDB($dbc);\n\treturn($matches == 1);\n}", "public function validatePassword($pswd){\n $isCorrect = password_verify($pswd, $this->hash);\n if ($isCorrect){\n $this->_id = $this->id;\n $auth = $this->hash;//str_split(password_hash($this->id, PASSWORD_DEFAULT));\n // shuffle($auth);\n $this->_authKey = $auth;\n // echo implode(' ', [$this->id, $this->_authKey]);\n // die();\n }\n return $isCorrect;\n }", "public function checkPassword($password);", "function pwdMatch($password, $repeatPassword) {\n return $password !== $repeatPassword;\n }", "private function verify_password() {\n $query = $this->db->prepare('SELECT id FROM users\n WHERE userName = :userName AND password = :password');\n $query->bindParam(':userName', $this->userName);\n $query->bindParam(':password', $this->password);\n\n $query->execute();\n return $query->fetch(PDO::FETCH_OBJ);\n }", "function getUser($pdo, $user, $password) {\r\n // Does the user exist in the database?\r\n $userQ = $pdo->quote($user);\r\n $query = \"SELECT password from checkeruser where user=$userQ\";\r\n\r\n $rows = $pdo->query($query);\r\n if($row = $rows->fetch()) {\r\n // We found the record in the database\r\n // Check the password\r\n if($row['password'] != $password) {\r\n echo $row['password'];\r\n echo '<hatter status=\"no\" msg=\"password error\" />';\r\n exit;\r\n }\r\n\r\n echo '<hatter status=\"yes\" msg=\"password match\" />';\r\n exit;\r\n }\r\n\r\n echo '<hatter status=\"no\" msg=\"user error\" />';\r\n exit;\r\n}", "function verifyPassword($password){\n\n global $connection;\n\n $stmt = $connection->stmt_init();\n\n $stmt->prepare(\"SELECT hashed_password FROM ssf_users WHERE username=?\");\n\n $stmt->bind_param(\"s\",$this->username);\n\n $stmt->execute();\n\n if($stmt->error){\n $this->error = $stmt->error;\n return false;\n }\n\n $result = $stmt->get_result();\n\n if($result->num_rows == 1){\n $psr = $result->fetch_assoc();\n $hashed_password = $psr[\"hashed_password\"];\n\n if(password_verify($password,$hashed_password)){\n return true;\n } else {\n $this->error = \"Invalid Password.\";\n return false;\n }\n } else {\n $this->error = \"No saved password found.\";\n return false;\n }\n\n }", "function testPassword($username,$password) // Vérifie le mot de passe actuel\n{\n\t$db = dbConnect();\n\t$username = htmlspecialchars($username);\n\t$password = htmlspecialchars($password);\n\t$result = $db->prepare('SELECT username, password FROM account WHERE username = :username');\n\t$result->execute(array('username' => $username));\n\t$content = $result->fetch();\n\tif($content)\n\t{\n\t\t$actual_password = htmlspecialchars($content['password']);\n\t\t$testpass = password_verify($password,$actual_password);\n\t}\n\telse // ne devrait pas arriver\n\t{\n\t\t$testpass = false;\n\t}\n\treturn $testpass;\n}", "public function checkCurrPassword_exist($curr_password, $user_id) {\n $curr_pass = base64_encode($curr_password);\n\n $sql = \"SELECT * FROM user_tab WHERE unique_id = '$user_id' AND password = '$curr_pass'\";\n //echo $sql;die();\n $result = $this->db->query($sql);\n if ($result->num_rows() <= 0) {\n return false;\n } else {\n return true;\n }\n }", "function passCheck(){\n\t\t$trimmedPass = trim($_POST['oldPass']);\n\t\tif ($trimmedPass !== ''){\n\t\t$bdd = $this->databaseConnect();\n\t\t$passReq = $bdd->prepare('SELECT password FROM users WHERE id = :id');\n\t\t$passReq->execute(array('id'=>$_SESSION['id']));\n\t\t$passExisting = $passReq->fetch();\n\t\t$passwordCheck = password_verify($_POST['oldPass'],$passExisting['password']);\n\t\t\tif ($passwordCheck){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function dbCheckUserInjection($db, $login, $password)\r\n {\r\n try\r\n {\r\n $statement = $db->query(\"select * from users where login='\".$login.\"' and\r\n password=sha1('\".$password.\"')\");\r\n $result = $statement->fetch();\r\n }\r\n catch (PDOException $exception)\r\n {\r\n error_log('Request error: '.$exception->getMessage());\r\n return false;\r\n }\r\n if (!$result)\r\n return false;\r\n return true;\r\n }" ]
[ "0.75564337", "0.7312251", "0.714167", "0.70795774", "0.7003921", "0.6872504", "0.6870683", "0.6845968", "0.6830246", "0.68177634", "0.67312837", "0.6729524", "0.66963404", "0.6689655", "0.6668927", "0.6667219", "0.66614294", "0.6660231", "0.6650037", "0.6631281", "0.6595673", "0.6595528", "0.6580629", "0.6570231", "0.656399", "0.6521814", "0.65188783", "0.6517926", "0.6512267", "0.648982" ]
0.82285213
0
Check if modal dialog is visible in top frame
public function canSeeDialog() { $I = $this->tester; $I->switchToIFrame(); $I->waitForElement(self::$openedModalSelector); // I will wait two seconds to prevent failing tests $I->wait(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isModalDialog()\n {\n return $this->requestStack->getMasterRequest()->headers->has('X-Modal-Dialog');\n }", "public function has_modal() {\n return !(empty($this->controller) || empty($this->gradinginstance) || (!empty($this->controller) && !$this->controller->is_form_available()));\n }", "function IsModal()\n\t{\n\t\treturn $this->_bolModal;\n\t}", "public function getWidgetVisible();", "public function isModalRequest(): bool\n {\n return $this->request()->hasHeader(static::HEADER_MODAL);\n }", "public function isVisible();", "public function isVisible();", "public function isVisible();", "public function isInvisible()\n {\n return false === $this->isVisible();\n }", "function isDisplayed();", "public function getIsHideDlg()\n {\n return $this->hidedlg;\n }", "public function shouldDialogBeShown(): bool\n {\n if (!$this->settings->get('Core', 'show_consent_dialog', false)) {\n return false;\n }\n\n // no levels mean there should not be any consent\n if (empty($this->getLevels())) {\n return false;\n }\n\n // if the hash in the cookie is the same as the current has it means the user\n // has already stored their preferences\n if ($this->cookie->get('privacy_consent_hash', '') === $this->getLevelsHash()) {\n return false;\n }\n\n return true;\n }", "public function isVisible(): bool;", "public function getSeenRedesignModal(): bool {\r\n return $this->seenRedesignModal;\r\n }", "public function should_see_popup() {\n $windowames = $this->getSession()->getWindowNames();\n if (count($windowames) < 2) {\n throw new ElementNotFoundException();\n }\n }", "public function getMpVisible();", "public function isOpened(): bool\n\t{\n\t\treturn $this->form instanceof Form\n\t\t\t&& $this->form->isOpened();\n\t}", "protected function isVisible()\n {\n return parent::isVisible() || $this->isExported();\n }", "public function hasInfoWindow()\n {\n return $this->infoWindow !== null;\n }", "public function hasFocus(): bool\r\n {\r\n return $this->sfml->window->ffi->sfWindow_hasFocus($this->cdata) === 1;\r\n }", "public function keepModalOpen()\n {\n return $this->keepOpen();\n }", "public function isVisible()\n {\n return true;\n }", "public function hasUi();", "function estVisible(){\r\n\t\t\tif($this->visible == 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public function getSeenPremiumAdblockModal(): bool {\r\n return $this->seenPremiumAdblockModal;\r\n }", "public function isOpen(): bool\r\n {\r\n return $this->sfml->window->ffi->sfWindow_isOpen($this->cdata) === 1;\r\n }", "function isVisible() {\n\t\treturn $this->_dao->get('isVisible');\n\t}", "public function isHidden(): bool;", "public function getOcVisible();", "public function isVisible(): bool {\n return $this->visible;\n }" ]
[ "0.7111419", "0.631767", "0.62574124", "0.60472304", "0.5919025", "0.5895857", "0.5895857", "0.5895857", "0.5861898", "0.58462757", "0.58219796", "0.57335955", "0.5667269", "0.5628177", "0.56258225", "0.5623487", "0.5619437", "0.5562415", "0.5559028", "0.55498105", "0.5529721", "0.5484351", "0.54737246", "0.54304105", "0.5364791", "0.534123", "0.5307475", "0.5284676", "0.5278715", "0.52766675" ]
0.75168455
0
Description This method will apply one of multiple actions to a wineproduction order. Arguments api_key: auth_token: tnid: The ID of the tenant the order belongs to. wineproduction_id: The ID of the wineproduction order to take action on. action: The action to be performed. Started Change the status to 20 SGRead Change the status to 25 Racked Change the status to 30 Filtered Change the status to 40 Filter Today Change the filter_date to today Bottled Change the status to 60 sg_reading: (optional) The value for the SG Reading if action is SGRead. kit_length: (optional) The number of days the wine needs to be racked for, must be specified if action is Racked. batch_code: (optional) The batch code from the kit box. This should be specified if the action is Started. Returns
function ciniki_wineproduction_actionOrder(&$ciniki) { // // Find all the required and optional arguments // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs'); $rc = ciniki_core_prepareArgs($ciniki, 'no', array( 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), 'wineproduction_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Order'), 'action'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Action'), 'sg_reading'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'SG Reading'), 'kit_length'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Racking Length'), 'batch_code'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Batch Code'), )); if( $rc['stat'] != 'ok' ) { return $rc; } $args = $rc['args']; // // Make sure this module is activated, and // check permission to run this function for this tenant // ciniki_core_loadMethod($ciniki, 'ciniki', 'wineproduction', 'private', 'checkAccess'); $rc = ciniki_wineproduction_checkAccess($ciniki, $args['tnid'], 'ciniki.wineproduction.actionOrder'); if( $rc['stat'] != 'ok' ) { return $rc; } // // Grab the settings for the tenant from the database // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQuery'); $rc = ciniki_core_dbDetailsQuery($ciniki, 'ciniki_wineproduction_settings', 'tnid', $args['tnid'], 'ciniki.wineproduction', 'settings', ''); if( $rc['stat'] != 'ok' ) { return $rc; } $settings = $rc['settings']; // // Load the tenant settings // ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings'); $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']); if( $rc['stat'] != 'ok' ) { return $rc; } $intl_timezone = $rc['settings']['intl-default-timezone']; // // Setup todays date // $dt = new DateTime('now', new DateTimezone($intl_timezone)); $todays_date = $dt->format('Y-m-d'); // // Turn off autocommit // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory'); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate'); $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.wineproduction'); if( $rc['stat'] != 'ok' ) { return $rc; } // // The wine was just started, setup the racking date automatically // $strsql = ""; $update_args = array(); if( $args['action'] == 'Started' ) { $update_args['status'] = 20; $update_args['start_date'] = $todays_date; $update_args['batch_code'] = $args['batch_code']; $racking_autoschedule = "racking.autoschedule.madeon" . strtolower(date('D', strtotime($todays_date))); if( isset($settings[$racking_autoschedule]) && $settings[$racking_autoschedule] > 0 ) { $racking_date = new DateTime($todays_date); $racking_date->modify('+' . $settings[$racking_autoschedule] . ' days'); $update_args['racking_date'] = $racking_date->format('Y-m-d'); // // Check the day of week, and setup colour based on day // $rack_week = ((date_format($racking_date, 'U') - 1468800)/604800)%3; $rack_dayofweek = strtolower(date_format($racking_date, 'D')); $racking_autocolour = "racking.autocolour.week" . $rack_week . $rack_dayofweek; if( isset($settings[$racking_autocolour]) && $settings[$racking_autocolour] != '' ) { $update_args['rack_colour'] = $settings[$racking_autocolour]; } } // // Check if transfer date should be setup // // FIXME: CHange to option from products if( ciniki_core_checkModuleFlags($ciniki, 'ciniki.wineproduction', 0x0800) ) { $dt = new DateTime('now', new DateTimezone($intl_timezone)); $dt->add(new DateInterval('P7D')); $update_args['transferring_date'] = $dt->format('Y-m-d'); } $notification_trigger = 'started'; } // // Bump the status to ready if SG in correct range // elseif( $args['action'] == 'SGRead' ) { $update_args['sg_reading'] = $args['sg_reading']; if( isset($args['sg_reading']) && $args['sg_reading'] >= 992 && $args['sg_reading'] <= 998 ) { $update_args['status'] = 25; } } // // The wine was just racked, update the rack_date, and set the filtering date and colour automatically // elseif( $args['action'] == 'Transferred' ) { $update_args['status'] = 23; $update_args['transfer_date'] = $todays_date; // $notification_trigger = 'transferred'; } // // The wine was just racked, update the rack_date, and set the filtering date and colour automatically // elseif( $args['action'] == 'Racked' ) { $update_args['status'] = 30; $update_args['rack_date'] = $todays_date; if( isset($args['kit_length']) && $args['kit_length'] > 0 ) { $filtering_date = new DateTime($todays_date); $filtering_date->modify('+' . ($args['kit_length'] - 2) . ' weeks'); $update_args['filtering_date'] = $filtering_date->format('Y-m-d'); $filter_week = ((date_format($filtering_date, 'U') - 1468800)/604800)%7; $filter_dayofweek = strtolower(date_format($filtering_date, 'D')); $filtering_autocolour = "filtering.autocolour.week" . $filter_week . $filter_dayofweek; if( isset($settings[$filtering_autocolour]) && $settings[$filtering_autocolour] != '' ) { $update_args['filter_colour'] = $settings[$filtering_autocolour]; } } $notification_trigger = 'racked'; } // // The wine was filtered // elseif( $args['action'] == 'Filtered' ) { $update_args['status'] = 40; $update_args['filter_date'] = $todays_date; $notification_trigger = 'filtered'; } // // Wines can be pulled and filtered early if necessary // elseif( $args['action'] == 'Filter Today' ) { $update_args['filtering_date'] = $todays_date; } // // The wine has been bottled // elseif( $args['action'] == 'Bottled' ) { $update_args['status'] = 60; $update_args['bottle_date'] = $todays_date; $notification_trigger = 'bottled'; } // if( $strsql != "" ) { if( count($update_args) > 0 ) { // // Update the order // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate'); $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.wineproduction.order', $args['wineproduction_id'], $update_args, 0x04); if( $rc['stat'] != 'ok' ) { ciniki_core_dbTransactionRollback($ciniki, 'ciniki.wineproduction'); return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.wineproduction.261', 'msg'=>'Unable to update the order', 'err'=>$rc['err'])); } } // // When the wine is started, decrease inventory // if( isset($notification_trigger) && $notification_trigger == 'started' ) { // // Get the current number in inventory and decrement by 1 // $strsql_inventory = "SELECT orders.id, " . "IFNULL(products.id, 0) AS product_id, " . "IFNULL(products.inventory_current_num, 0) AS inventory_current_num " . "FROM ciniki_wineproductions AS orders " . "LEFT JOIN ciniki_wineproduction_products AS products ON (" . "orders.product_id = products.id " . "AND products.tnid = '" . ciniki_core_dbQuote($ciniki, $args['tnid']) . "' " . ") " . "WHERE orders.id = '" . ciniki_core_dbQuote($ciniki, $args['wineproduction_id']) . "' " . "AND orders.tnid = '" . ciniki_core_dbQuote($ciniki, $args['tnid']) . "' " . ""; $rc = ciniki_core_dbHashQuery($ciniki, $strsql_inventory, 'ciniki.wineproduction', 'product'); if( $rc['stat'] != 'ok' ) { ciniki_core_dbTransactionRollback($ciniki, 'ciniki.wineproduction'); return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.wineproduction.199', 'msg'=>'Unable to load product', 'err'=>$rc['err'])); } $product = isset($rc['product']) ? $rc['product'] : array(); if( isset($product['product_id']) && $product['product_id'] > 0 && isset($product['inventory_current_num']) && $product['inventory_current_num'] > 0 ) { // // Update the inventory // $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.wineproduction.product', $product['product_id'], array( 'inventory_current_num' => ($product['inventory_current_num'] - 1), ), 0x04); if( $rc['stat'] != 'ok' ) { ciniki_core_dbTransactionRollback($ciniki, 'ciniki.wineproduction'); return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.wineproduction.200', 'msg'=>'Unable to update the inventory')); } } } // // Trigger customer notifications // if( isset($notification_trigger) && $notification_trigger != '' ) { ciniki_core_loadMethod($ciniki, 'ciniki', 'wineproduction', 'private', 'notificationTrigger'); $rc = ciniki_wineproduction_notificationTrigger($ciniki, $args['tnid'], $notification_trigger, $args['wineproduction_id']); if( $rc['stat'] != 'ok' ) { // FIXME: Find way to warn user without return full error error_log('WINEPRODUCTION[actionOrder:' . __LINE__ . ']: ' . print_r($rc['err'], true)); } } // // Commit the database changes // $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.wineproduction'); if( $rc['stat'] != 'ok' ) { return $rc; } // // Update the last_change date in the tenant modules // Ignore the result, as we don't want to stop user updates if this fails. // ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate'); ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'wineproduction'); $ciniki['syncqueue'][] = array('push'=>'ciniki.wineproduction.order', 'args'=>array('id'=>$args['wineproduction_id'])); return array('stat'=>'ok'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function perform_action() {\r\n $action = ( isset($_POST['action']) ) ?\r\n filter_input(INPUT_POST, 'action', FILTER_SANITIZE_STRIPPED) : 'default_top_bulk_action';\r\n\r\n // this is the bottom bulk action!!\r\n $action2 = ( isset($_POST['action2']) ) ?\r\n filter_input(INPUT_POST, 'action2', FILTER_SANITIZE_STRIPPED) : 'default_bottom_bulk_action';\r\n\r\n switch ($action) {\r\n case 'delete':\r\n $this->perform_bulk_delete();\r\n break;\r\n default:\r\n break;\r\n }\r\n switch ($action2) {\r\n case 'delete':\r\n $this->perform_bulk_delete();\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n if (isset($_GET['action'])) {\r\n switch (trim($_GET['action'])) {\r\n case 'edit':\r\n $this->edit($_GET['prac']);\r\n break;\r\n case 'set_schedule':\r\n $this->set_schedule();\r\n break;\r\n case 'delete':\r\n $this->delete();\r\n break;\r\n case 'activate':\r\n $this->activate();\r\n break;\r\n case 'deactivate':\r\n $this->deactivate();\r\n break;\r\n }\r\n }\r\n }", "public function setAction($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::UINT32);\n $this->action = $arr;\n\n return $this;\n }", "function sendX10($device, $action, $count) {\n\t\n\tglobal $ini_x10;\n\n\t// Replace spaces with underscores in the name of the appliance\n\t\n\t$appliance = str_replace(' ','_',$device);\n\t\n\t// Now we need to know the code of the appliance\n\t\n\tif ($device == \"projector\")\n\t{\n\t\tif ($action == \"on\")\n\t\t{\n\t\t\t$command1 = \"python /home/ubuntu/epson_5030ub.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" ON\";\n\t\t\tsystem($command1);\n\t\t\tsleep(1);\n\t\t\t$command2 = \"python /home/ubuntu/yamaha_3.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" \\\"PWR: ON (ALL)\\\"\";\n\t\t\tsystem($command2);\n\t\t\tsleep(1);\n\t\t\t$command3 = \"python /home/ubuntu/directv.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" POWER\";\n\t\t\tsystem($command3);\n\t\t\treturn $command1 . \"\\n\" . $command2 . \"\\n\" . $command3 . \"\\nProjector turned on\";\n\t\t}\n\t\telse if ($action == \"off\")\n\t\t{\n\t\t\t$command1 = \"python /home/ubuntu/epson_5030ub.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" OFF\";\n\t\t\tsystem($command1);\n\t\t\tsleep(1);\n\t\t\t$command2 = \"python /home/ubuntu/yamaha_3.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" \\\"PWR: STANDBY (ALL)\\\"\";\n\t\t\tsystem($command2);\n\t\t\tsleep(1);\n\t\t\t$command3 = \"python /home/ubuntu/directv.py --device \\\"0x2712 192.168.0.157 5c73c134ea34\\\" POWER\";\n\t\t\tsystem($command3);\n\t\t\treturn $command1 . \"\\n\" . $command2 . \"\\n\" . $command3 . \"\\nProjector turned on\";\n\t\t}\n\t\treturn $device . \" : unknown action\";\n\t}\n\telse if ($device == \"basement_tv\")\n\t{\n\t\tif ($action == \"on\")\n\t\t{\n\t\t\t$command_dtv = \"python3 /home/ubuntu/dtv_keypress.py poweron\";\n\t\t\tsystem($command_dtv);\n\t\t\tsleep(1);\n\t\t\t$command_rxv_on = \"python3 /home/ubuntu/rxv/rxv.py 1\";\n\t\t\tsystem($command_rxv_on);\n\t\t\tsleep(1);\n\t\t\t$command_tv_off = \"/home/ubuntu/bravia-auth-and-remote/send_command.sh 192.168.0.31 AAAAAQAAAAEAAAAVAw==\";\n\t\t\tsystem($command_tv_off);\n\t\t\tsleep(1);\n\t\t\t$command_tv_on = \"/home/ubuntu/bravia-auth-and-remote/send_command.sh 192.168.0.31 AAAAAQAAAAEAAAAuAw==\";\n\t\t\tsystem($command_tv_on);\n\t\t\tsleep(1);\n\t\t\t$command_tv_hdmi3 = \"/home/ubuntu/bravia-auth-and-remote/send_command.sh 192.168.0.31 AAAAAgAAABoAAABcAw==\";\n\t\t\tsystem($command_tv_hdmi3);\n\t\t\treturn $command_dtv . \"\\n\" . $command_tv_off . \"\\n\" . $command_tv_on . \"\\n\" . $command_tv_hdmi3 . \"\\n\" . $command_rxv_on . \"\\nBasement TV turned on\";\n\t\t}\n\t\telse if ($action == \"off\")\n\t\t{\n\t\t\t$command_dtv = \"python3 /home/ubuntu/dtv_keypress.py poweroff\";\n\t\t\tsystem($command_dtv);\n\t\t\tsleep(1);\n\t\t\t$command_rxv_off = \"python3 /home/ubuntu/rxv/rxv.py 0\";\n\t\t\tsystem($command_rxv_off);\n\t\t\tsleep(1);\n\t\t\t$command_tv_off = \"/home/ubuntu/bravia-auth-and-remote/send_command.sh 192.168.0.31 AAAAAQAAAAEAAAAVAw==\";\n\t\t\tsystem($command_tv_off);\n\t\t\treturn $command_dtv . \"\\n\" . $command_tv_off . \"\\n\" . $command_rxv_off . \"\\nBasement TV turned off\";\n\t\t}\n\t\treturn $device . \" : unknown action\";\n\t}\n\telse if ($device == \"directv\")\n\t{\n\t\tif ($action == \"advanced\")\n\t\t{\n\t\t\t$action = \"advance\";\n\t\t}\n\t\t$command_dtv = \"python3 /home/ubuntu/dtv_keypress.py $action $count\";\n\t\tsystem($command_dtv);\n\t\treturn $command_dtv . \"\\nDirecTV\";\n\t}\n\telse if (isset($ini_x10[$appliance]['code'])) {\n\t\t\n\t\tif (($action == \"dim\" || $action == \"bright\") && isset($ini_x10[$appliance]['dim']))\n\t\t\treturn \"The appliance doesn't support dim or bright commands.\";\n\t\t\n\t\t#$hostname = $ini_x10['general']['hostname'];\n\t\t#$port = $ini_x10['general']['port'];\n\t\t\n\t\t#$fp = fsockopen($hostname, $port, $errno, $errstr);\n\t\t#if (!$fp) {\n\t\t\t#return \"There was an error trying to connect to the X10 server: \" . $errstr;\n\t\t#} else {\n\t\t\t$loop = 1;\n\t\t\tif ($action == \"dim\" || $action == \"bright\")\n\t\t\t\t$loop = $ini_x10[$appliance]['dim'];\n\t\t\t\t\t\n\t\t\tfor ($i = 0; $i < $loop; $i++) { \n\t\t#\t\t$command = \"rf \" . $ini_x10[$appliance]['code'] . \" \" . $action . \"\\n\";\n\t\t#\t\tfwrite($fp, $command);\n\t\t\t\t\n\t\t\t\t$command = \"heyu f\" . $action . \" \" . $ini_x10[$appliance]['code'];\n\t\t\t\tsystem($command);\n\t\t\t\tsleep(1);\n\t\t \t}\n\t\t#\tfclose($fp);\n\t\t \n\t\t\t$verb = (preg_match('/lights/',$appliance)) ? \"have\" : \"has\";\n\t\t \n\t\t\tif ($action == \"dim\")\n\t\t\t\t$strAction = \"dimmed\";\n\t\t\telse if ($action == \"bright\")\n\t\t\t\t$strAction = \"brighten\";\n\t\t\telse\n\t\t\t\t$strAction = \"turned \" . $action;\n\t\t \t\n\t\t\treturn ucfirst($appliance . \" \" . $verb . \" been \" . $strAction . \".\");\n\t\t#}\n\t}\n\telse\n\t{\n\t\treturn \"Couldn't find the appliance named \" . $device;\n\t}\n}", "private function _post_process($action)\n\t{\n\t\tswitch($action) {\n\n\t\t\tcase 'downloaded_master_stock_list':\n\t\t\t\t$html = '<form action=\"'.Tools::safeOutput($_SERVER['REQUEST_URI']).'\" method=\"POST\">';\n\t\t\t\t$html .= '<table border=\"0\">';\n\t\t\t\tif ($_POST['action'] == \"downloaded_master_stock_list\") {\n\t\t\t\t\t$db = Db::getInstance();\n\t\t\t\t\tif ($results = $db->executeS($this->export_stock_query))\n\t\t\t\t\t\tforeach ($results as $row)\n\t\t\t\t\t\t\t$html .= '<tr><th>'.$row['name'].' - '.$row['size'].'</th><td> has stock of \n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"4\" name=\"stock_available[]\" value=\"'.$row['quantity'].'\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" size=\"4\" name=\"id_stock_available[]\" value=\"'.$row['id_stock_available'].'\"/></td></tr>';\n\t\t\t\t\n\t\t\t\t\t$html .='</table>';\n\t\t\t\t\t$html .='<input type=\"hidden\" name=\"action\" value=\"update_stock_values\"/>';\n\t\t\t\t\t$html .='<input type=\"submit\" class=\"button\" name=\"\" value=\"'.$this->l('Submit').'\"/>';\n\t\t\t\t\t$html .='</form>';\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'update_stock_values':\n\t\t\t\t$db = Db::getInstance();\n\t\t\t\tforeach ($_POST['id_stock_available'] as $i=>$stock_available) {\n\t\t\t\t\t$db->update('stock_available',array('quantity'=>(int)$_POST['stock_available'][$i]), $where = 'id_stock_available = '.(int)$stock_available);\n\t\t\t\t}\n\n\t\t\t\t$html = $this->_get_export_form();\n\t\t\tbreak;\n\t\t\tcase 'upload_stock_levels':\n\t\t\t\t//user is uploading a doc so we need to grab it from temporary files and process accordingly....\n\t\t\t\t$db = Db::getInstance();\n\t\t\t\t$fh = fopen($_FILES['stock']['tmp_name'],'r');\n\t\t\t\t$updatedItems = 0;\n\t\t\t\twhile ($row = fgetcsv($fh)) {\n\t\t\t\t\t$db->update('stock_available',array('quantity'=>(int)$row[2]), $where = 'id_stock_available = '.(int)$row[1]);\n\t\t\t\t\t$updatedItems++;\n\t\t\t\t}\n\t\t\t\t$html = $updatedItems.' items have been updated.';\n\t\t\tbreak;\n\t\t}\n\n\t\treturn $html;\n\n\t}", "public function process_bulk_action() {\n\t\tglobal $wpdb;\n\n\t\t// Row Action Mark Read\n\t\tif ( 'mark_success' === $this->current_action() ) {\n\t\t\t$nonce = esc_attr( $_REQUEST['_wpnonce'] );\n\n\t\t\tif ( ! wp_verify_nonce( $nonce, 'mark_as_success' ) ) {\n\t\t\t\twp_die( __( \"You are not permission for this action.\", \"wp-extensions\" ) );\n\t\t\t} else {\n\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t$wpdb->prefix . 'woo_booking',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'status' => 2, // string\n\t\t\t\t\t),\n\t\t\t\t\tarray( 'ID' => $_REQUEST['ID'] )\n\t\t\t\t);\n\n\t\t\t\twp_redirect( esc_url_raw( add_query_arg( array( 'page' => 'woo_class_list', 'alert' => 'mark_as_success' ), admin_url( \"admin.php\" ) ) ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\n\t\t// Update Class\n\t\tif ( isset( $_REQUEST['update_link_class'] ) and isset( $_REQUEST['link'] ) ) {\n\n\t\t\t// Now Class Date and Class time\n\t\t\t$ID = $_REQUEST['update_link_class'];\n\t\t\t$current = $wpdb->get_row( \"SELECT * FROM {$wpdb->prefix}woo_booking WHERE ID = {$ID}\", ARRAY_A );\n\t\t\t$class_date = $current['class_date'];\n\t\t\t$class_time = $current['class_time'];\n\n\t\t\t// convert New Date\n\t\t\t$new_shamsi_year = $_REQUEST['class-date-year'];\n\t\t\t$new_shamsi_mounth = ( $_REQUEST['class-date-month'] < 10 ? '0' . $_REQUEST['class-date-month'] : $_REQUEST['class-date-month'] );\n\t\t\t$new_shamsi_day = ( $_REQUEST['class-date-day'] < 10 ? '0' . $_REQUEST['class-date-day'] : $_REQUEST['class-date-day'] );\n\t\t\t$new_shamsi_hour = $_REQUEST['class-date-time-hour'] . \":00:00\";\n\t\t\t$new_date = gregdate( \"Y-m-d\", $new_shamsi_year . '-' . $new_shamsi_mounth . '-' . $new_shamsi_day );\n\n\t\t\t// Check Before Get this Time\n\t\t\t$count = $wpdb->get_var( \"SELECT COUNT(*) FROM {$wpdb->prefix}woo_booking WHERE `class_date` = '$new_date' AND `class_time` = '$new_shamsi_hour'\" );\n\t\t\tif ( $count > 0 ) {\n\t\t\t\t$ids = $wpdb->get_var( \"SELECT `ID` FROM {$wpdb->prefix}woo_booking WHERE `class_date` = '$new_date' AND `class_time` = '$new_shamsi_hour'\" );\n\t\t\t\tif ( $ids != $_REQUEST['update_link_class'] ) {\n\t\t\t\t\twp_die( \"خطا : این ساعت کلاس قبلا برای یک کلاس دیگر انتخاب شده است و قابلیت انتخاب برای این کلاس ندارد\" );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check Time is changed\n\t\t\tif ( $new_date != $class_date || $class_time != $new_shamsi_hour ) {\n\t\t\t\t$class_date = $new_date;\n\t\t\t\t$class_time = $new_shamsi_hour;\n\n\t\t\t\t// Send Mail To User\n\t\t\t\t$subscriber_data = get_userdata( $current['user_id'] );\n\t\t\t\tadd_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );\n\t\t\t\t$to = $subscriber_data->user_email;\n\t\t\t\t$subject = 'تغییر ساعت کلاس شما توسط استاد';\n\t\t\t\t$body = '<html dir=\"rtl\">';\n\t\t\t\t$body .= '<body style = \"text-align:right; direction:rtl;\">';\n\t\t\t\t$body .= '<p style=\"font-family: Tahoma; font-size: 12px;\">';\n\t\t\t\t$body .= $subscriber_data->first_name . ' ' . $subscriber_data->last_name;\n\t\t\t\t$body .= ' عزیز, ';\n\t\t\t\t$body .= 'استاد ساعت کلاس شما را از ';\n\t\t\t\t$body .= parsidate( \"Y-m-d H:i\", strtotime( $current['class_date'] . ' ' . $current['class_time'] ), \"eng\" );\n\t\t\t\t$body .= ' به ';\n\t\t\t\t$body .= parsidate( \"Y-m-d H:i\", strtotime( $new_date . ' ' . $new_shamsi_hour ), \"eng\" );\n\t\t\t\t$body .= ' تغییر داده است. ';\n\t\t\t\t$body .= '</p>';\n\t\t\t\t$body .= '</body>';\n\t\t\t\t$body .= '</html>';\n\t\t\t\twp_mail( $to, $subject, $body );\n\t\t\t\tremove_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );\n\t\t\t}\n\n\t\t\t// Update Data\n\t\t\t$wpdb->update(\n\t\t\t\t$wpdb->prefix . 'woo_booking',\n\t\t\t\tarray(\n\t\t\t\t\t'link' => trim( $_REQUEST['link'] ),\n\t\t\t\t\t'class_date' => $class_date,\n\t\t\t\t\t'class_time' => $class_time,\n\t\t\t\t),\n\t\t\t\tarray( 'ID' => $_REQUEST['update_link_class'] )\n\t\t\t);\n\n\t\t\twp_redirect( esc_url_raw( add_query_arg( array( 'page' => 'woo_class_list', 'alert' => 'update' ), admin_url( \"admin.php\" ) ) ) );\n\t\t\texit;\n\t\t}\n\n\n\t\t// New Class\n\t\tif ( isset( $_REQUEST['new_class_by_admin'] ) ) {\n\n\t\t\t// Convert New Date\n\t\t\t$new_shamsi_year = $_REQUEST['class-date-year'];\n\t\t\t$new_shamsi_mounth = ( $_REQUEST['class-date-month'] < 10 ? '0' . $_REQUEST['class-date-month'] : $_REQUEST['class-date-month'] );\n\t\t\t$new_shamsi_day = ( $_REQUEST['class-date-day'] < 10 ? '0' . $_REQUEST['class-date-day'] : $_REQUEST['class-date-day'] );\n\t\t\t$new_shamsi_hour = $_REQUEST['class-date-time-hour'] . \":00:00\";\n\t\t\t$new_date = gregdate( \"Y-m-d\", $new_shamsi_year . '-' . $new_shamsi_mounth . '-' . $new_shamsi_day );\n\n\t\t\t// Check Before Create this class\n\t\t\t$count = $wpdb->get_var( \"SELECT COUNT(*) FROM {$wpdb->prefix}woo_booking WHERE `class_date` = '$new_date' AND `class_time` = '$new_shamsi_hour'\" );\n\t\t\tif ( $count > 0 ) {\n\t\t\t\twp_die( \"خطا : این ساعت کلاس قبلا برای یک کلاس دیگر انتخاب شده است و قابلیت ایجاد را ندارد\" );\n\t\t\t}\n\n\t\t\t$wpdb->insert(\n\t\t\t\t$wpdb->prefix . 'woo_booking',\n\t\t\t\tarray(\n\t\t\t\t\t'user_id' => $_REQUEST['user'],\n\t\t\t\t\t'class_date' => $new_date,\n\t\t\t\t\t'class_time' => $new_shamsi_hour . \":00:00\",\n\t\t\t\t\t'status' => 1,\n\t\t\t\t\t'payment' => $_REQUEST['payment'],\n\t\t\t\t\t'type_class' => 1,\n\t\t\t\t\t'number_change_class' => 0,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twp_redirect( esc_url_raw( add_query_arg( array( 'page' => 'woo_class_list', 'alert' => 'new_class' ), admin_url( \"admin.php\" ) ) ) );\n\t\t\texit;\n\t\t}\n\n\t}", "public function getAction()\n {\n if (My_Validate_API::getCod() != '200')\n {\n return My_Response::_handleCodeResponse(\"400\", My_String::ERROR_MSG_INVALID_CODE);\n }\n\n if (My_Validate_API::getRole() != My_String::ROLE_SUPER_ADMIN && My_Validate_API::getRole() != My_String::ROLE_ADMIN)\n {\n return My_Response::_handleCodeResponse(\"400\", My_String::ERROR_MSG_PERMISSION_DENIED);\n }\n\n $data = $this->getRequest()->getParams();\n $data = array_map('trim', $data);\n\n if (!isset($data['id']) && !isset($data['getAllWarehousesByMyCompany']))\n {\n return My_Response::_handleCodeResponse(\"404\", My_String::ERROR_MSG_INVALID_PARAMS); \n }\n\n $warehouseModel = new API_Model_Warehouse();\n\n if (isset($data['id']))\n {\n $warehouse = $warehouseModel->getWarehouseByIdOBJECT($data['id']);\n\n if (!empty($warehouse))\n {\n $warehouse = $warehouse->toArray();\n }\n }\n elseif (isset($data['getAllWarehousesByMyCompany']))\n {\n $warehouse = $warehouseModel->getAllWarehouseByIdCompany(My_Validate_API::getCompany());\n }\n\n if (empty($warehouse))\n {\n return My_Response::_handleCodeResponse(\"400\", My_String::ERROR_MSG_RESOURCE_NOT_FOUND);\n }\n\n return My_Response::_handleCodeResponse(\"200\", $warehouse);\n }", "public function apply($spa, $action);", "function site_action($action, $sf_obj) {\n \n heavylog(\"FUNCTION \" . __FUNCTION__ . \" CALLED WITH $action ACTION!\");\n global $function;\n $function = __FUNCTION__;\n global $api_url;\n $url_arr = [];\n $url_arr[] = $api_url . '?action=' . $action;\n foreach ($sf_obj as $param_name => $param_val) {\n $url_arr[] = '&' . $param_name . '=' . str_replace(\" \", \"+\", $param_val);\n }\n writelog(\"url_arr:\");\n writelog($url_arr);\n $params_missing_arr = [];\n foreach ($sf_obj as $param_name => $param_val) {\n if (empty($param_val)) $params_missing_arr[] = $param_name;\n }\n writelog(\"params_missing_arr:\");\n writelog($params_missing_arr);\n if (empty($params_missing_arr)) {\n $url = implode('', $url_arr);\n writelog(\"\\nurl:\");\n writelog(\"\\n$url\");\n $result = CallAPI($url);\n } else {\n $msg = \"ERROR - One or more required parameters was not found: \";\n $msg2 = implode(\", \", $params_missing_arr);\n writelog(\"\\n\\n$msg\\n$msg2\");\n }\n $function = '';\n return isset($result) ? $result : 0;\n}", "private function _requestState ($action) {\n $this->_getDetails();\n\n curl_setopt($this->_conn, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($this->_conn, CURLOPT_URL, $this->_baseUrl . $this->_putDeviceStateUri);\n $payload = array (\n 'AttributeName' => 'desireddoorstate',\n 'AttributeValue' => $action,\n 'MyQDeviceId' => $this->_deviceId,\n );\n curl_setopt($this->_conn, CURLOPT_POSTFIELDS, json_encode($payload));\n $output = curl_exec($this->_conn);\n $err = curl_error($this->_conn);\n\n if ($err) {\n throw new MyQException(\"cURL Error #:\" . $err);\n }\n\n $data = json_decode($output);\n if ($data == false) {\n throw new MyQException(\"Error updating device state: $output\");\n }\n\n if (strlen($data->ErrorMessage) > 0 || $data->ReturnCode != 0) {\n throw new MyQException(\"Error returned from API: \" . var_export($data));\n }\n\n // Update was successful, fetch the new status and report\n return $this->refresh();\n\n }", "function process_bulk_action() {\n\n switch ( $this->current_action() ) {\n case 'trash':\n $result = WPSmartShopShipments::trash( $_REQUEST['shipmentid'], 'id', 'status' );\n break;\n\n case 'untrash':\n $result = WPSmartShopShipments::untrash( $_REQUEST['shipmentid'], 'id', 'status' );\n break;\n\n case 'delete':\n if ( isset( $_REQUEST['shipmentid'] ) ) {\n $result = WPSmartShopShipments::delete( $_REQUEST['shipmentid'] );\n if ( !is_wp_error( $result ) ) : ?>\n\n <div class=\"updated\">\n <p><?php echo $result ?> <?php _e( 'Shipment deleted successfully', WPXSMARTSHOP_TEXTDOMAIN ) ?></p>\n </div>\n\n <?php else : ?>\n\n <div class=\"error\">\n <p><?php echo sprintf( '%s: %s', _e( 'Error while deleting Shipment', WPXSMARTSHOP_TEXTDOMAIN ), $result->get_error_message() ) ?></p>\n </div>\n <?php endif;\n }\n return false;\n case 'update':\n if ( WPDKForm::isNonceVerify( 'shipments' ) ) {\n $result = WPSmartShopShipments::update(); ?>\n\n <?php if ( !is_wp_error( $result ) ) : ?>\n\n <div class=\"updated\">\n <p><?php _e( 'Shipment update successfully', WPXSMARTSHOP_TEXTDOMAIN ) ?></p>\n </div>\n\n <?php else : ?>\n\n <div class=\"updated\">\n <p><?php echo sprintf( '%s: %s', _e( 'Error while updating Shipment', WPXSMARTSHOP_TEXTDOMAIN ), $result->get_error_message() ) ?></p>\n </div>\n\n <?php endif;\n }\n break;\n case 'insert':\n if ( WPDKForm::isNonceVerify( 'shipments' ) ) {\n $result = WPSmartShopShipments::create(); ?>\n\n <?php if ( !is_wp_error( $result ) ) : ?>\n\n <div class=\"updated\">\n <p><?php _e( 'Shipment added successfully', WPXSMARTSHOP_TEXTDOMAIN ) ?></p>\n </div>\n\n <?php else : ?>\n\n <div class=\"updated\">\n <p><?php echo sprintf( '%s: %s', _e( 'Error while adding Shipment', WPXSMARTSHOP_TEXTDOMAIN ), $result->get_error_message() ) ?></p>\n </div>\n\n <?php endif;\n }\n break;\n\n case 'new':\n WPSmartShopShipmentsViewController::editView();\n return true;\n case 'edit':\n WPSmartShopShipmentsViewController::editView( $_REQUEST['shipmentid'] );\n return true;\n }\n }", "public function process_bulk_action() {\r\n //when delete action is used\r\n if ('delete' === $this->current_action()) {\r\n //verify the nonce\r\n $nonce = esc_attr($_REQUEST['_wpnonce']);\r\n if (! wp_verify_nonce($nonce, 'delete_survey')) {\r\n die('Not authorized.');\r\n }\r\n else {\r\n self::delete_survey(absint($_GET['survey']));\r\n }\r\n }\r\n\r\n //when bulk delete action is used\r\n if ((isset($_POST['action']) && $_POST['action'] == 'survey-bulk-delete')\r\n || (isset($_POST['action2']) && $_POST['action2'] == 'survey-bulk-delete')) {\r\n $delete_ids = esc_sql($_POST['survey-bulk-action']);\r\n\r\n // loop over the array of record IDs and delete them\r\n foreach ($delete_ids as $id) {\r\n self::delete_survey($id);\r\n }\r\n }\r\n \r\n //when accept action is used\r\n if ('accept' === $this->current_action()) {\r\n //verify the nonce\r\n $nonce = esc_attr($_REQUEST['_wpnonce']);\r\n if (! wp_verify_nonce($nonce, 'accept_survey')) {\r\n die('Not authorized.');\r\n }\r\n else {\r\n self::accept_survey(absint($_GET['survey']));\r\n }\r\n }\r\n\r\n //when bulk accept action is used\r\n if ((isset($_POST['action']) && $_POST['action'] == 'survey-bulk-accept')\r\n || (isset($_POST['action2']) && $_POST['action2'] == 'survey-bulk-accept')) {\r\n $accept_ids = esc_sql($_POST['survey-bulk-action']);\r\n\r\n // loop over the array of record IDs and delete them\r\n foreach ($accept_ids as $id) {\r\n self::accept_survey($id);\r\n }\r\n }\r\n \r\n //when reject action is used\r\n if ('reject' === $this->current_action()) {\r\n //verify the nonce\r\n $nonce = esc_attr($_REQUEST['_wpnonce']);\r\n if (! wp_verify_nonce($nonce, 'reject_survey')) {\r\n die('Not authorized.');\r\n }\r\n else {\r\n self::reject_survey(absint($_GET['survey']));\r\n }\r\n }\r\n\r\n //when bulk delete action is used\r\n if ((isset($_POST['action']) && $_POST['action'] == 'survey-bulk-reject')\r\n || (isset($_POST['action2']) && $_POST['action2'] == 'survey-bulk-reject')) {\r\n $reject_ids = esc_sql($_POST['survey-bulk-action']);\r\n // loop over the array of record IDs and delete them\r\n foreach ($reject_ids as $id) {\r\n self::reject_survey($id);\r\n }\r\n }\r\n \r\n //when bulk pdf action is used\r\n if ((isset($_POST['action']) && $_POST['action'] == 'survey-bulk-pdf')\r\n || (isset($_POST['action2']) && $_POST['action2'] == 'survey-bulk-pdf')) {\r\n \r\n }\r\n }", "public function bulkaction()\n {\n if ($this->request->is(['patch', 'post', 'put'])) \n {\n $intBulkAction = $_POST['bulkaction'];\n if($intBulkAction>0)\n {\n $aryPostData =$_POST;\n $intBulkAction = $aryPostData['bulkaction'];\n if($intBulkAction==1)\n {\n $this->SkProduct->deleteAll( ['product_id IN' =>$aryPostData['product_id']]);\n $this->Flash->success(__('Deleted Successfully'));\n return $this->redirect(['action' => 'index']);\n }\n if($intBulkAction==2)\n {\n $this->SkProduct->updateAll(['product_status'=>'1'],['product_id IN' =>$aryPostData['product_id']]);\n $this->Flash->success(__('Selected Entry Active Successfully'));\n return $this->redirect(['action' => 'index']);\n }\n if($intBulkAction==3)\n {\n $this->SkProduct->updateAll(['product_status'=>'0'],['product_id IN' =>$aryPostData['product_id'] ]);\n $this->Flash->success(__('Selected Entry Inactive Successfully'));\n return $this->redirect(['action' => 'index']);\n }\n }\n }else{\n self::sendfcm();\n }\n }", "public function secondaryAction()\n {\n $order = null;\n\n try {\n\n // Model is not necessary to perform the action\n // But we need to validate it\n $order = $this->getOrder();\n\n $api = Mage::helper('api_xpc');\n\n $txnId = $this->getRequest()->getParam('xpc_txnid');\n $action = $this->getRequest()->getParam('xpc_action');\n $amount = $this->getRequest()->getParam('transaction_amount');\n\n switch ($action) {\n\n case 'refund':\n $response = $api->requestPaymentRefund($txnId, $amount);\n break;\n\n case 'capture':\n $response = $api->requestPaymentCapture($txnId, $amount);\n break;\n\n case 'void':\n $response = $api->requestPaymentVoid($txnId, $amount);\n break;\n\n default:\n throw new Exception('Incorrect action');\n break;\n }\n\n $this->processResponseAndRedirect(\n $response,\n 'Operation successful',\n 'Operation failed'\n );\n\n } catch (Exception $exception) {\n\n $this->processExceptionAndRedirect($exception, $order);\n }\n }", "function updateActionsAction()\n {\n if (isset($_GET['schedule']))\n {\n $this->schedule();\n }\n else if (isset($_GET['over']))\n {\n $this->mouseOverAction();\n }\n else if (isset($_GET['comment']))\n {\n print($_GET['comment']);\n $this->sendCommentAction();\n }\n else if (isset($_GET['type']))\n {\n if ($_GET['type'] == 'getcomment')\n {\n $this->getCommentValue();\n }\n else if ($_GET['type'] == 'gettodo')\n {\n $this->getTodosAction();\n }\n else\n {\n $this->changeProfileAction();\n }\n }\n else\n {\n if (isset($_GET['clearProduct']))\n {\n $this->clearDataAction();\n }\n else\n {\n $this->addCompetencesAction();\n }\n }\n }", "public function actionUpgrade()\n\t{\n\n\t\t$this->online = _xls_number_only($_POST['online']);\n\t\tif(isset($_GET['debug']))\n\t\t\tYii::log(\"InstallController on line \".$this->online, 'error', 'application.'.__CLASS__.\".\".__FUNCTION__);\n\t\tif ($this->online==1) $retval = $this->actionConvertStart();\n\t\tif ($this->online==2) $retval = $this->actionConvertAddressBook();\n\t\tif ($this->online==8) $retval = $this->actionConvertModules();\n\t\tif ($this->online>=9 && $this->online<=13) $retval = $this->actionConvertGoogle();\n\t\tif ($this->online==14) $retval = $this->actionConvertKeywordsToTags();\n\t\tif ($this->online==15) $retval = $this->actionConvertFamilies();\n\t\tif ($this->online==16) $retval = $this->actionConvertClasses();\n\t\tif ($this->online==18) $retval = $this->actionConvertDestinationTables();\n\t\tif ($this->online==19) $retval = $this->actionDropcartfields1();\n\t\tif ($this->online==20) $retval = $this->actionDropcartfields2();\n\t\tif ($this->online==21) $retval = $this->actionDropcartfields3();\n\t\tif ($this->online==25) $retval = $this->actionConvertProductSEO();\n\t\tif ($this->online>=32 && $this->online<=44) $retval = $this->actionImportAmazon();\n\t\tif ($this->online==45) $retval = $this->actionDropcustomerfields();\n\t\tif ($this->online==46) $retval = $this->actionDropMoreCartfields();\n\t\tif ($this->online==47) $retval = $this->actionDropProductFields();\n\t\tif ($this->online==48) $retval = $this->actionCalculateInventory();\n\t\tif ($this->online==49) $retval = $this->actionUpdateConfiguration();\n\n\t\tif(isset($_GET['debug']))\n\t\t\tif(isset($retval['tag']))\n\t\t\t\t$retval['tag'] .= \" online \".$this->online; else $retval['tag'] = \" online \".$this->online;\n\n\t\techo json_encode($retval);\n\n\n\t}", "private function handle_action_request($action_type){\n // Delete bulk items\n if($action_type === Inventory::$bulk_delete_action){\n $this->bulk_item_delete();\n }\n\n if(!empty($this->bulk_actions[$action_type])){\n // Update bulk \n $current_bulk_action = $this->bulk_actions[$action_type];\n if( empty($current_bulk_action['db_values']) || !is_array($current_bulk_action['db_values']) ){\n throw new Error(\"$action_type bulk-action must have an array under 'db_values'. Array shape must be 'item_sql_col_name' => 'new_value'\");\n }\n $this->bulk_item_update($current_bulk_action['db_values']);\n \n } else {\n if($action_type === Inventory::$save_item_action ){ \n $this->save_item(); \n }\n if($action_type === Inventory::$delete_item_action ){ \n $this->delete_item(); \n }\n }\n }", "public function sendTo_WO(){\n\t\textract($_POST);\n\t\t//print_r($_POST);\n\t\t//-----------session branch_name--------------\n $branch_name=$this->session->userdata('branch_name');\n\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageQuotations_api/sendTo_WO?quotation_id='.$quotation_id.'&branch_name='.$branch_name;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//echo($response_json);die();\n\t\techo($response['status_message']);\n\t}", "public function getBatchActions();", "public function doAction($action = '', array $parameter = array()) {\n\n\t\tif (isset($this->forcedNextAction['actionName'])) {\n\n\t\t\t$originalAction = $action;\n\n\t\t\t// copy actionName and parameters to local variables\n\t\t\t$action = $this->forcedNextAction['actionName'];\n\t\t\t$parameter = $this->forcedNextAction['params'];\n\n\t\t\t// reset class variable\n\t\t\t$this->forcedNextAction = array();\n\n\t\t\tif (TYPO3_DLOG) t3lib_div::devLog(sprintf('Executing \"%s\" instead of \"%s\"', $action, $originalAction), 'pt_list');\n\t\t}\n\n\t\treturn parent::doAction($action, $parameter);\n\n\t}", "function mashsb_process_actions() {\n\tif ( isset( $_POST['mashsb-action'] ) ) {\n\t\tdo_action( 'mashsb_' . $_POST['mashsb-action'], $_POST );\n\t}\n\n\tif ( isset( $_GET['mashsb-action'] ) ) {\n\t\tdo_action( 'mashsb_' . $_GET['mashsb-action'], $_GET );\n\t}\n}", "protected function actionUpdateConfiguration()\n\t{\n\n\n\t\t//Amazon changes\n\t\t_dbx(\"update xlsws_category_amazon set product_type='AutoAccessory' where name1 like '%Automotive%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Beauty' where name1 like '%Beauty%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Beauty' where name1 like '%Beauty%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='CameraPhoto' where name0 like '%camera & photo%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='CE' where name1 like '%Electronics%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Computers' where name2 like '%Computers & Accessories%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='FoodAndBeverages' where name1 like '%Grocery & Gourmet Food%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Health' where name1 like '%Health & Personal Care%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Home' where name1 like '%Home & Kitchen%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Jewelry' where name1 like '%Jewelry%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Jewelry' where name1 like '%Jewelry%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='MusicalInstruments' where name1 like '%Musical Instruments%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Office' where name1 like '%Office%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='PetSupplies' where name1 like '%Pet Supplies%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Shoes' where name1 like '%Shoes%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Sports' where name1='Sports & Outdoors' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='SWVG' where name1='Software' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='SWVG' where name1='Video Games' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='TiresAndWheels' where name2 like '%Tires & Wheels%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Tools' where name1 like '%Tools & Home Improvement%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='Toys' where name1 like '%Toys & Games%' and product_type is null;\");\n\t\t_dbx(\"update xlsws_category_amazon set product_type='ToysBaby' where name2 like '%Baby & Toddler Toys%';\");\n\n\n\t\t_dbx(\"update xlsws_customer as a set default_billing_id=(select id from xlsws_customer_address as b where customer_id=a.id order by b.id desc limit 1)\");\n\t\t\n\t\t_dbx(\"update xlsws_customer as a set default_shipping_id=(select id from xlsws_customer_address as b where customer_id=a.id order by b.id desc limit 1)\");\n\n\n\n\t\t_dbx(\"update xlsws_wishlist_item set cart_item_id=null where cart_item_id=0;\");\n\t\t_dbx(\"update xlsws_wishlist_item set purchased_by=null where purchased_by=0;\");\n\t\t_dbx(\"update xlsws_wishlist set visibility=\".Wishlist::PERSONALLIST);\n\t\t_dbx(\"ALTER TABLE `xlsws_wishlist` DROP `registry_password`;\");\n\t\t_dbx(\"update xlsws_promo_code set valid_from=null where valid_from='0000-00-00';\");\n\t\t_dbx(\"update xlsws_promo_code set valid_until=null where valid_until='0000-00-00';\");\n\t\t_dbx(\"delete from xlsws_configuration where `key_name`='PHONE_TYPES';\");\n\n\n\t\t//Migrate our header image to the new folder\n\t\t$objConfig = Configuration::LoadByKey('HEADER_IMAGE');\n\t\t$objConfig->key_value = str_replace(\"/photos/\",\"/images/header/\",$objConfig->key_value);\n\t\t$objConfig->save();\n\n\t\t$objConfig = Configuration::LoadByKey('PRODUCT_SORT_FIELD');\n\t\t$objConfig->key_value = str_replace(\"Name\",\"title\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"Rowid\",\"id\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"Modified\",\"modified\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"Code\",\"code\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"InventoryTotal\",\"inventory_total\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"DescriptionShort\",\"description_short\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"WebKeyword1\",\"title\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"WebKeyword2\",\"title\",$objConfig->key_value);\n\t\t$objConfig->key_value = str_replace(\"WebKeyword3\",\"title\",$objConfig->key_value);\n\t\t$objConfig->save();\n\n\n\n\t\t_dbx(\"update xlsws_configuration set configuration_type_id=15,sort_order=2 where key_name='LANGUAGES'\");\n\t\t_dbx(\"update xlsws_configuration set sort_order=sort_order+8 where configuration_type_id=19\");\n\t\t_dbx(\"update xlsws_configuration set `key_name`='THEME',title='Site Theme',options='THEME',\n\t\t\tconfiguration_type_id=0,sort_order=2,param=0 where `key_name`='DEFAULT_TEMPLATE'\");\n\t\t_dbx(\"update xlsws_configuration set `key_name`='CHILD_THEME',title='Theme {color} scheme',\n\t\t\toptions='CHILD_THEME',sort_order=3,param=0,configuration_type_id=0 where `key_name`='DEFAULT_TEMPLATE_THEME'\");\n\t\t_dbx(\"INSERT INTO `xlsws_configuration`\n\t\t\t(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)\n\t\t\tVALUES ('Template Viewset', 'VIEWSET', 'cities', 'The master design set for themes.', 0, 1, 'VIEWSET', 0, 0, 1)\");\n\t\t_dbx(\"INSERT INTO `xlsws_configuration`\n\t\t\t(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)\n\t\t\tVALUES ('Enable Language Menu', 'LANG_MENU', '0', 'Show language switch menu on website.', 15, 1, 'BOOL', 0, 0, 1)\");\n\t\t_dbx(\"INSERT INTO `xlsws_configuration`\n\t\t\t(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)\n\t\t\tVALUES ('Add missing translations while navigating', 'LANG_MISSING', '0', 'For creating new translations. Do NOT leave this option on, it will slow your server down.', 15, 3, 'BOOL', 0, 0, 1)\");\n\n\t\t_dbx(\"delete from xlsws_configuration where key_name='MODERATE_REGISTRATION'\");\n\t\t_dbx(\"INSERT INTO `xlsws_configuration`\n\t\t\t(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)\n\t\t\tVALUES ('Moderate Customer Registration', 'MODERATE_REGISTRATION', '0',\n\t\t\t 'If enabled, customer registrations will need to be moderated before they are approved.', 0, 1, 'BOOL', 0, 0, 1)\");\n\n\t\t_dbx(\"INSERT INTO `xlsws_configuration`\n\t\t\t(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)\n\t\t\tVALUES ('Language Options', 'LANG_OPTIONS', 'en:English,fr:français',\n\t\t\t '', 0,0, NULL, 0, 0, 1)\");\n\n\t\t_dbx(\"UPDATE `xlsws_configuration` SET `configuration_type_id`='0' where `key_name`='CURRENCY_FORMAT'\");\n\t\t_dbx(\"UPDATE `xlsws_configuration` SET `title`='Require account creation',`key_name`='REQUIRE_ACCOUNT',options='BOOL' where `key_name`='ALLOW_GUEST_CHECKOUT'\");\n\t\t_dbx(\"UPDATE `xlsws_configuration` SET `configuration_type_id`='0' where `key_name`='LOCALE'\");\n\t\t_dbx(\"UPDATE `xlsws_configuration` SET `title`='Default Locale (Language) Code' where `key_name`='LANG_CODE'\");\n\t\t_dbx(\"UPDATE `xlsws_configuration` SET `key_value`='300' where `key_name`='DATABASE_SCHEMA_VERSION'\");\n\t\t_dbx(\"UPDATE `xlsws_customer` SET `pricing_level`=1 where pricing_level is null\");\n\n\t\t_dbx(\"INSERT INTO `xlsws_modules` (`active`, `module`, `category`, `version`, `name`, `sort_order`,\t`configuration`, `modified`, `created`)\n\t\t\t\tVALUES (1, 'wsamazon', 'CEventProduct,CEventPhoto,CEventOrder', 1, 'Amazon MWS', 2, NULL, '2013-04-04 11:34:38', NULL);\");\n\t\treturn array('result'=>\"success\",'makeline'=>50,'total'=>50);\n\n\t}", "public function runAction(){\n Mirage::loadModels('SpyderRequestLogsModel');\n $spyderRequestLogsModel = new SpyderRequestLogsModel();\n \n $terminalName = '';\n $commandId = '';\n $username = '';\n $password = '';\n $type = '';\n $spyderReqLogID = '';\n $casinoId = '';\n \n //catch get variables\n if(isset($_GET['TerminalName']))\n $terminalName = $_GET['TerminalName'];\n if(isset($_GET['CommandID']))\n $commandId = $_GET['CommandID'];\n if(isset($_GET['UserName']))\n $username = $_GET['UserName'];\n if(isset($_GET['Password']))\n $password = $_GET['Password'];\n if(isset($_GET['TerminalName']))\n $type = $_GET['Type'];\n if(isset($_GET['SpyderReqID']))\n $spyderReqLogID = $_GET['SpyderReqID']; \n if(isset($_GET['CasinoID']))\n $casinoId = $_GET['CasinoID'];\n \n $queryString = '?';\n $queryString = $queryString. 'TerminalName='.$terminalName;\n $queryString = $queryString. '&CommandID='.$commandId;\n $queryString = $queryString. '&UserName='.$username;\n $queryString = $queryString. '&Password='.$password;\n $queryString = $queryString. '&Type='.$type;\n $queryString = $queryString. '&CasinoID='.$casinoId;\n \n $sapi = Mirage::app()->param['SAPI_URI'].$queryString;\n \n $response = $this->SubmitData($sapi);\n if($response[0] == 200 ){\n if($response[1] == \"1\"){\n //update spyder request logs as successful\n $status = 1;\n $spyderRequestLogsModel->update($status, $spyderReqLogID);\n \n } else {\n //update spyder request logs as failed\n $status = 2;\n $spyderRequestLogsModel->update($status, $spyderReqLogID);\n }\n } else {\n //update spyder request logs as failed\n $status = 2;\n $spyderRequestLogsModel->update($status, $spyderReqLogID);\n }\n }", "function action_process(){\n\t\t//debug($this->data);\n\t\t$this->autoRender = false;\n\t\t/*\n\t\t * code of 1 for delete\n\t\t */\n\t\tif(1 == $this->data[$this->modelClass]['action_value']){\n\t\t\tunset($this->data[$this->modelClass]['action_value']);\n\t\t\t$this->delete_multiple($this->data);\n\t\t}\n\t\t/*\n\t\t * code of 2 for edit\n\t\t */\n\t\tif(2 == $this->data[$this->modelClass]['action_value']){\n\t\t\t\n\t\t\tunset($this->data[$this->modelClass]['action_value']);\t\t\t\n\t\t\t$ids = array();\n\t\t\t//debug($record,true);\n\t\t\t foreach($this->data[$this->modelClass] as $record) {\n\t\t\t\tif($record != 0)\n\t\t\t\t\t$ids[] = $record;\n\t\t\t}\n\t\t\t$this->Session->write('Record',$ids);\n\t\t\t$this->redirect(array('action'=>'edit'));\n\t\t}\n\t\t/*\n\t\t * code 3 for filter\n\t\t */\n\t\tif(3 == $this->data[$this->modelClass]['action_value_search']){\n\t\n\t\t\tunset($this->data[$this->modelClass]['action_value_search']);\n\t\t\tdebug('in action_process', true);\n\t\t\t\n\t\t\t$this->Session->write('FilterValues', $this->data);\n\t\t\t\n\t\t\t//$this->redirect(array('action'=>'index'));\n\t\t}\n\t}", "public function setAction(array $action)\n {\n $this->action = $action;\n\n return $this;\n }", "public static function action()\n\t{\n\t\tlist( $action, $return ) = func_get_args();\n\t\t$function = str_replace(\".\", \"_\", $action);\n\t\t$filterargs = array_slice(func_get_args(), 2);\n\n\t\tforeach ( self::$active as $name => $module )\n\t\t{\n\t\t\t$class = \"{$name}_Action\";\n\t\t\t$args = $filterargs;\n\t\t\tarray_unshift( $args, $return );\n\n\t\t\tif (is_callable( array($class, $function) ))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$return = call_user_func_array(array( $class, $function ), $args);\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e){}\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function ajaxMassActions( $ids = false, $action = false )\n\t{\n\t\tglobal $_response, $rlSmarty, $config, $lang, $pages, $rlListingTypes;\n\n\t\tif ( !$ids || !$action )\n\t\t\treturn $_response;\n\t\t\n\t\t$ids = explode('|', $ids);\n\t\t$this -> loadClass('Mail');\n\t\t\n\t\t/* inform listing owner about status changing */\n\t\t$mail_tpl = $GLOBALS['rlMail'] -> getEmailTemplate( $action == 'activate' ? 'listing_activated' : 'listing_deactivated' );\n\t\t$this -> loadClass('Categories');\n\t\t$this -> loadClass('Account');\n\n\t\t$this -> loadClass('Notice');\n\t\tif ( in_array($action, array('activate', 'approve')) )\n\t\t{\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$mail_tpl_copy = $mail_tpl;\n\t\t\t\t\n\t\t\t\t/* get listing info */\n\t\t\t\t$sql = \"SELECT `T1`.*, UNIX_TIMESTAMP(`T1`.`Pay_date`) AS `Payed`, `T2`.`Username`, `T2`.`Mail`, `T3`.`Type` AS `Listing_type`, `T3`.`Path` AS `Category_path` \";\n\t\t\t\t$sql .= \"FROM `\".RL_DBPREFIX.\"listings` AS `T1` \";\n\t\t\t\t$sql .= \"RIGHT JOIN `\".RL_DBPREFIX.\"accounts` AS `T2` ON `T1`.`Account_ID` = `T2`.`ID` \";\n\t\t\t\t$sql .= \"LEFT JOIN `\".RL_DBPREFIX.\"categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` \";\n\t\t\t\t$sql .= \"WHERE `T1`.`ID` = '{$id}'\";\n\t\t\t\t\n\t\t\t\t$listing_info = $this -> getRow($sql);\n\t\t\t\t$set_status = $action == 'activate' ? 'active' : 'approval';\n\t\n\t\t\t\t/* get account info */\n\t\t\t\t$owner_info = $GLOBALS['rlAccount'] -> getProfile((int)$listing_info['Account_ID']);\n\t\t\t\t\n\t\t\t\tif ( $listing_info['Status'] == $set_status )\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t$listing_type = $rlListingTypes -> types[$listing_info['Listing_type']];\n\t\t\t\t\n\t\t\t\t/* generate link */\n\t\t\t\tif ($action == 'activate')\n\t\t\t\t{\n\t\t\t\t\t/* increase listings counter */\n\t\t\t\t\tif (!empty($listing_info['Payed']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['rlCategories'] -> listingsIncrease($listing_info['Category_ID']);\n\t\t\t\t\t\tif ( !empty($listing_info['Crossed']) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$crossed_cats = explode(',', trim($listing_info['Crossed'], ','));\n\t\t\t\t\t\t\tforeach ($crossed_cats as $crossed_cat_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$GLOBALS['rlCategories'] -> listingsIncrease($crossed_cat_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\t\n\t\t\t\t\t$listing_title = $this -> getListingTitle($listing_info['Category_ID'], $listing_info, $listing_type['Key']);\n\t\t\t\t\t\n\t\t\t\t\t$link = RL_URL_HOME;\n\t\t\t\t\t$link .= $config['mod_rewrite'] ? $pages[$listing_type['Page_key']] .'/'. $listing_info['Category_path'] .'/'. $rlSmarty -> str2path($listing_title) .'-'.$id.'.html' : 'index.php?page='. $pages[$listing_type['Page_key']] .'&amp;id='.$id ;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/* deincrease listings counter */\n\t\t\t\t\tif (!empty($listing_info['Payed']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['rlCategories'] -> listingsDecrease($listing_info['Category_ID']);\n\t\t\t\t\t\tif ( !empty($listing_info['Crossed']) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$crossed_cats = explode(',', trim($listing_info['Crossed'], ','));\n\t\t\t\t\t\t\tforeach ($crossed_cats as $crossed_cat_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$GLOBALS['rlCategories'] -> listingsDecrease($crossed_cat_id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = \"UPDATE `\".RL_DBPREFIX.\"listings` SET `Status` = '{$set_status}' WHERE `ID` = '{$listing_info['ID']}'\";\n\t\t\t\t$success = $this -> query($sql);\n\n\t\t\t\t$mail_tpl_copy['body'] = str_replace( array('{username}', '{link}'), array($owner_info['Full_name'], '<a href=\"'.$link.'\">'.$link.'</a>'), $mail_tpl_copy['body'] );\n\t\t\t\t$GLOBALS['rlMail'] -> send( $mail_tpl_copy, $owner_info['Mail'] );\n\t\t\t}\n\t\t\t\n\t\t\tif ( $success )\n\t\t\t{\n\t\t\t\t$_response -> script(\"printMessage('notice', '{$lang['mass_action_completed']}')\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttrigger_error(\"Can not run mass action with listings (MySQL Fail). Action: {$action}\", E_USER_ERROR);\n\t\t\t\t$GLOBALS['rlDebug'] -> logger(\"Can not run mass action with listings (MySQL Fail). Action: {$action}\");\n\t\t\t}\n\t\t}\n\t\telseif ( $action == 'delete' )\n\t\t{\n\t\t\t$this -> loadClass('Categories');\n\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$listing = $this -> fetch( array('Category_ID', 'Crossed'), array('ID' => $id), null, 1, 'listings', 'row');\n\n\t\t\t\t/* Decrease listing count in category */\n\t\t\t\t$GLOBALS['rlCategories'] -> listingsDecrease($listing['Category_ID']);\n\t\t\t\tif ( !empty($listing['Crossed']) )\n\t\t\t\t{\n\t\t\t\t\t$crossed_cats = explode(',', trim($listing['Crossed'], ','));\n\t\t\t\t\tforeach ($crossed_cats as $crossed_cat_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['rlCategories'] -> listingsDecrease($crossed_cat_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$GLOBALS['rlActions'] -> delete( array('ID' => $id), 'listings', $id, 1 );\n\t\t\t\t\n\t\t\t\tif (!$GLOBALS['config']['trash'])\n\t\t\t\t{\n\t\t\t\t\t$this -> deleteListingData($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$del_action = $GLOBALS['rlActions'] -> action;\n\t\t\t$_response -> script(\"printMessage('notice', '{$lang['mass_listings_'.$del_action]}')\");\n\t\t}\n\t\t\n\t\treturn $_response;\n\t}", "public function action()\n { \n if($this->error) {\n $response = $this->error;\n return $response;\n } \n @file_put_contents('payload.json', json_encode($this->payload)); \n $namespace = 'App\\\\Http\\\\Controllers\\Api\\\\V2\\\\'; \n $getaction = Action::where('action', $this->action)->first(); \n if( $getaction ){\n if( strtolower($getaction->action) == strtolower($this->action) ){ \n $data['controller'] = $getaction->controller;\n $data['method'] = $getaction->method; \n \n } \n \n $controller_name = App::make( $namespace.$data['controller'] );\n $response = (new $controller_name)->{$data['method']}( $this->payload );\n\n\n } else {\n $msg = ['errorMessage' => Lang::get('shipping.invalidAction')];\n $response = Helper::ifValidationFalse($this->action, $msg); \n } \n \n return $response; \n }", "protected function performAction()\n { \n $actionSlug = sfContext::getInstance()->getRequest()->getParameter('action_slug', 'save_close');\n\n if ($this->ullFlowAction = Doctrine::getTable('UllFlowAction')->findOneBySlug($actionSlug))\n {\n $ullFlowActionHandlerValues = array();\n foreach ($this->values as $key => $value)\n {\n if (strstr($key, 'ull_flow_action_'))\n {\n $ullFlowActionHandlerValues[$key] = $value; \n }\n }\n \n $this->object->performAction($this->ullFlowAction, $ullFlowActionHandlerValues);\n }\n else\n {\n throw new InvalidArgumentException('Invalid UllFlowAction given: ' . $actionSlug); \n }\n }", "public function postIntegrationsActionsDraftsWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\Action';\n $request = $this->postIntegrationsActionsDraftsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\Action',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function _process_action( $action ) {\r\n\t\tdo_action( 'wpmudev_dashboard_action-' . $action );\r\n\t\t$success = 'SILENT';\r\n\t\t$type = WPMUDEV_Dashboard::$api->get_membership_type();\r\n\r\n\t\tswitch ( $action ) {\r\n\t\t\t// Tab: Support\r\n\t\t\t// Function Grant support access.\r\n\t\t\tcase 'remote-grant':\r\n\t\t\t\tif ( ! is_wpmudev_member() && 'unit' !== $type ) {\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$success = WPMUDEV_Dashboard::$api->enable_remote_access( 'start' );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Support\r\n\t\t\t// Function Revoke support access.\r\n\t\t\tcase 'remote-revoke':\r\n\t\t\t\tif ( ! current_user_can( 'edit_users' ) ) {\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$success = WPMUDEV_Dashboard::$api->revoke_remote_access();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Support\r\n\t\t\t// Function Extend support access.\r\n\t\t\tcase 'remote-extend':\r\n\t\t\t\tif ( ! is_wpmudev_member() && 'unit' !== $type ) {\r\n\t\t\t\t\t$success = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$success = WPMUDEV_Dashboard::$api->enable_remote_access( 'extend' );\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Support\r\n\t\t\t// Function Save notes for support staff.\r\n\t\t\tcase 'staff-note':\r\n\t\t\t\t$notes = '';\r\n\t\t\t\tif ( isset( $_REQUEST['notes'] ) ) {\r\n\t\t\t\t\t$notes = stripslashes( $_REQUEST['notes'] );\r\n\t\t\t\t}\r\n\t\t\t\tWPMUDEV_Dashboard::$site->set_option( 'staff_notes', $notes );\r\n\t\t\t\t// un silent message\r\n\t\t\t\t$success = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Settings\r\n\t\t\t// Function Add new admin user for Dashboard.\r\n\t\t\tcase 'admin-add':\r\n\t\t\t\tif ( ! empty( $_REQUEST['user'] ) ) {\r\n\t\t\t\t\t$user_id = $_REQUEST['user'];\r\n\t\t\t\t\t$success = WPMUDEV_Dashboard::$site->add_allowed_user( $user_id );\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Settings\r\n\t\t\t// Function Remove other admin user for Dashboard.\r\n\t\t\tcase 'admin-remove':\r\n\t\t\t\tif ( ! empty( $_REQUEST['user'] ) ) {\r\n\t\t\t\t\t$user_id = $_REQUEST['user'];\r\n\t\t\t\t\t$success = WPMUDEV_Dashboard::$site->remove_allowed_user( $user_id );\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Plugins\r\n\t\t\t// Function to check for updates again.\r\n\t\t\tcase 'check-updates':\r\n\t\t\t\tWPMUDEV_Dashboard::$site->set_option( 'refresh_profile_flag', 1 );\r\n\t\t\t\tWPMUDEV_Dashboard::$api->refresh_projects_data();\r\n\t\t\t\tWPMUDEV_Dashboard::$site->refresh_local_projects( 'remote' );\r\n\r\n\t\t\t\t// un silent message\r\n\t\t\t\t$success = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Tab: Settings\r\n\t\t\t// Function to setup whitelabel.\r\n\t\t\tcase 'whitelabel-setup':\r\n\t\t\t\t$status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : '';// wpcs CSRF ok. already validated on process_ajax\r\n\t\t\t\tswitch ( $status ) {\r\n\t\t\t\t\tcase 'activate':\r\n\t\t\t\t\t\t$this->set_option( 'whitelabel_enabled', true );\r\n\t\t\t\t\t\t// un silent message\r\n\t\t\t\t\t\t$success = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'deactivate':\r\n\t\t\t\t\t\t$this->set_option( 'whitelabel_enabled', false );\r\n\t\t\t\t\t\t// un silent message\r\n\t\t\t\t\t\t$success = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'settings':\r\n\t\t\t\t\t\t$setting_data = $_REQUEST; // wpcs CSRF ok. already validated on process_ajax\r\n\t\t\t\t\t\t$options_map = array(\r\n\t\t\t\t\t\t\t'branding_enabled' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_branding_enabled',\r\n\t\t\t\t\t\t\t\t'default' => false,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'branding_enabled_subsite' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'branding_enabled_subsite',\r\n\t\t\t\t\t\t\t\t'expected_type' => 'boolean',\r\n\t\t\t\t\t\t\t\t'default' => false,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'branding_image' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_branding_image',\r\n\t\t\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'branding_image_id' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_branding_image_id',\r\n\t\t\t\t\t\t\t\t'default' => '',\r\n\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'footer_enabled' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_footer_enabled',\r\n\t\t\t\t\t\t\t\t'default' => false,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'footer_text' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_footer_text',\r\n\t\t\t\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t'doc_links_enabled' => array(\r\n\t\t\t\t\t\t\t\t'option_name' => 'whitelabel_doc_links_enabled',\r\n\t\t\t\t\t\t\t\t'default' => false,\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\tforeach ( $options_map as $key => $value ) {\r\n\t\t\t\t\t\t\tif ( ! isset( $value['option_name'] ) || empty( $value['option_name'] ) ) {\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$option_value = isset( $value['default'] ) ? $value['default'] : false;\r\n\t\t\t\t\t\t\tif ( isset( $setting_data[ $key ] ) ) {\r\n\t\t\t\t\t\t\t\tif ( is_string( $option_value ) ) {\r\n\t\t\t\t\t\t\t\t\t$option_value = sanitize_text_field( wp_unslash( $setting_data[ $key ] ) );\r\n\t\t\t\t\t\t\t\t} elseif ( is_bool( $option_value ) ) {\r\n\t\t\t\t\t\t\t\t\t$option_value = filter_var( $setting_data[ $key ], FILTER_VALIDATE_BOOLEAN );\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t$this->set_option( $value['option_name'], $option_value );\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// un silent message\r\n\t\t\t\t\t\t$success = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$success = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// Function to setup analytics.\r\n\t\t\tcase 'analytics-setup':\r\n\t\t\t\t$status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : ''; // wpcs CSRF ok. already validated on process_ajax\r\n\t\t\t\tswitch ( $status ) {\r\n\t\t\t\t\tcase 'activate':\r\n\t\t\t\t\t\t$success = WPMUDEV_Dashboard::$api->analytics_enable();\r\n\t\t\t\t\t\tif ( $success ) {\r\n\t\t\t\t\t\t\t$this->set_option( 'analytics_enabled', true );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'deactivate':\r\n\t\t\t\t\t\t$success = WPMUDEV_Dashboard::$api->analytics_disable();\r\n\t\t\t\t\t\tif ( $success ) {\r\n\t\t\t\t\t\t\t$this->set_option( 'analytics_enabled', false );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'settings':\r\n\t\t\t\t\t\t$option_value = isset( $_REQUEST['analytics_role'] ) && get_role( $_REQUEST['analytics_role'] ) ? $_REQUEST['analytics_role']\r\n\t\t\t\t\t\t\t: 'administrator'; // wpcs CSRF ok. already validated on process_ajax\r\n\t\t\t\t\t\t$this->set_option( 'analytics_role', sanitize_text_field( $option_value ) );\r\n\r\n\t\t\t\t\t\t$metrics = isset( $_REQUEST['analytics_metrics'] ) && is_array( $_REQUEST['analytics_metrics'] ) ? $_REQUEST['analytics_metrics'] : array();\r\n\t\t\t\t\t\t$this->set_option( 'analytics_metrics', $metrics );\r\n\r\n\t\t\t\t\t\t$success = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$success = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// setup translation updates\r\n\t\t\tcase 'translation-setup':\r\n\t\t\t\t$locale = empty( $_REQUEST['selected_locale'] ) ? 'en_US' : $_REQUEST['selected_locale'];\r\n\r\n\t\t\t\t$enable_auto_translation = isset( $_REQUEST['enable_auto_translation'] ) ? absint( $_REQUEST['enable_auto_translation'] ) : 0;\r\n\r\n\t\t\t\t$this->set_option( 'enable_auto_translation', $enable_auto_translation );\r\n\r\n\t\t\t\t$prev_locale = WPMUDEV_Dashboard::$site->get_option( 'translation_locale' );\r\n\r\n\t\t\t\t$this->set_option( 'translation_locale', $locale );\r\n\r\n\t\t\t\t// hub-sync to check prev locale\r\n\t\t\t\tif ( $prev_locale !== $locale ) {\r\n\t\t\t\t\t// Also, force a hub-sync, since the translation setting changed.\r\n\t\t\t\t\tWPMUDEV_Dashboard::$api->calculate_translation_upgrades( true );\r\n\t\t\t\t}\r\n\t\t\t\t$success = true;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t// setup autoupdate dashboard\r\n\t\t\tcase 'autoupdate-dashboard':\r\n\t\t\t\t$status = isset( $_REQUEST['status'] ) ? $_REQUEST['status'] : ''; // wpcs CSRF ok. already validated on process_ajax\r\n\t\t\t\tswitch ( $status ) {\r\n\t\t\t\t\tcase 'settings':\r\n\t\t\t\t\t\t$auto_update = isset( $_REQUEST['autoupdate_dashboard'] ) ? filter_var( $_REQUEST['autoupdate_dashboard'], FILTER_VALIDATE_BOOLEAN ) : false;\r\n\t\t\t\t\t\t$this->set_option( 'autoupdate_dashboard', $auto_update );\r\n\r\n\t\t\t\t\t\t$enable_sso = isset( $_REQUEST['enable_sso'] ) ? absint( $_REQUEST['enable_sso'] ) : 0;\r\n\t\t\t\t\t\t$previous_sso = $this->get_option( 'enable_sso', true );\r\n\r\n\t\t\t\t\t\t// Register the user to be logged in for SSO, only if the SSO was just enabled.\r\n\t\t\t\t\t\tif ( $enable_sso && ! $previous_sso ) {\r\n\t\t\t\t\t\t\t$sso_userid = get_current_user_id();\r\n\t\t\t\t\t\t\t$this->set_option( 'sso_userid', $sso_userid );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$this->set_option( 'enable_sso', $enable_sso );\r\n\r\n\t\t\t\t\t\tif ( ( $enable_sso && ! $previous_sso ) || ( ! $enable_sso && $previous_sso ) ) {\r\n\t\t\t\t\t\t\t// Also, force a hub-sync, since the SSO setting changed.\r\n\t\t\t\t\t\t\tWPMUDEV_Dashboard::$api->hub_sync( false, true );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$success = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$success = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$success = false;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif ( true === $success ) {\r\n\t\t\t$success = 'OK';\r\n\t\t} elseif ( false === $success ) {\r\n\t\t\t$success = 'ERR';\r\n\t\t}\r\n\r\n\t\treturn $success;\r\n\t}" ]
[ "0.4632726", "0.46027517", "0.4466881", "0.4465436", "0.4417681", "0.44169408", "0.43867895", "0.43664846", "0.43577164", "0.43435735", "0.43400797", "0.4339715", "0.43142936", "0.4298181", "0.42902672", "0.42593366", "0.4258508", "0.42060584", "0.4197949", "0.41928646", "0.41797918", "0.41663378", "0.41189927", "0.40824208", "0.4076105", "0.40720066", "0.4070885", "0.4032603", "0.4030555", "0.40268138" ]
0.52639407
0
$Id: uc_price.inc,v 1.5 20100303 19:34:12 islandusurper Exp $
function uc_price($price_info, $context, $options = array()) { global $user; $values = array(); // If we're passed just a number for price, we'll set the quantity to 1. if (is_numeric($price_info)) { $price_info = array( 'price' => $price_info, 'qty' => 1, ); } elseif (!is_array($price_info)) { $price_info = array( 'price' => 0, 'qty' => 1, ); } // Initialize the options and context. $options += array( 'cache' => variable_get('uc_price_caching', TRUE), ); $context += array( 'revision' => 'themed', 'type' => 'amount', ); // Clamp to allowed revisions. $revisions = array('original', 'altered', 'formatted-original', 'formatted', 'themed-original', 'themed'); if (!in_array($context['revision'], $revisions)) { $context['revision'] = 'themed'; } // Get all the active handlers. $handlers = _uc_price_get_handlers($options); // Use the global user if none was passed in. if (!isset($context['account'])) { $context['account'] = $user; } // Merge any incoming options, giving them precedence. $options += $handlers['options']; // Build the cache key with the original state, trimming down the account to // an array with a limited set of keys that don't change every pageload; the // uid, name, mail, and roles of the user account. $context_clone = $context; // TODO: array_intersect_key() isn't available until PHP 5.1.0. (Drupal 7) //$context_clone['account'] = array_intersect_key((array) $context['account'], drupal_map_assoc(array())); $context_clone['account'] = array( 'uid' => $context['account']->uid, 'name' => $context['account']->name, 'mail' => $context['account']->mail, 'roles' => $context['account']->roles, ); $key = md5(serialize($price_info + $context_clone + $options)); // If this price has already been calculated and cached... if ($options['cache'] && $cache = cache_get($key, 'cache_uc_price')) { // Use the cached price data. $values = $cache->data; } else { // Otherwise, build it from scratch. $values['original'] = $price_info['price'] * $price_info['qty']; // Alter the price, context, and options. foreach ($handlers['alterers'] as $alterer) { $alterer($price_info, $context, $options); } // If a price placeholder was specified in the price info array... if (isset($price_info['placeholder'])) { // Force the formatted value to the placeholder. $values['formatted'] = $price_info['placeholder']; } else { // Otherwise use the actual numeric and formatted numeric values. $values['altered'] = $price_info['price'] * $price_info['qty']; // Format the original and altered prices using the formatter callback. $values['formatted-original'] = $handlers['formatter']($values['original'], $options); $values['formatted'] = $handlers['formatter']($values['altered'], $options); } // Theme the price. $values['themed-original'] = theme('uc_price', array('value' => $values['formatted-original'], 'context' => $context, 'options' => $options)); $values['themed'] = theme('uc_price', array('value' => $values['formatted'], 'context' => $context, 'options' => $options)); // Cache this price values. // TODO: Determine if we can safely cache these things... if ($options['cache']) { cache_set($key, $values, 'cache_uc_price', CACHE_TEMPORARY); } } // Return the requested revision. return $values[$context['revision']]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPrice();", "abstract function getPrice();", "function show_price($price, $custom_currency = 0, $priceInUC = true){\r\n\t\r\n\tif($custom_currency){\r\n\t\t$currencyEntry = new Currency();\r\n\t\t$currencyEntry->loadByCID($custom_currency);\r\n\t}else{\r\n\t\t$Register = &Register::getInstance();\r\n\t\t/*@var $Register Register*/\r\n\t\t$currencyEntry = $Register->get('admin_mode')?Currency::getDefaultCurrencyInstance():Currency::getSelectedCurrencyInstance();\r\n\t\t/*@var $currencyEntry Currency*/\r\n\t}\r\n\t\r\n\t$price = $priceInUC?$currencyEntry->convertUnits($price):$price;\r\n\r\n\treturn $currencyEntry->getView($price);\r\n}", "function getTotalPrice()\r\n {\r\n }", "function currency_usd($price = 0, $type = 'html') { \r\n\t\tif($price >= 0) {\r\n $code = \"$\";\r\n \r\n $currency = 20000;\r\n $price = round($price/$currency, 2);\r\n\t\t\t\t$price = $code .\" \" .$price; \r\n\t\t\t\treturn $price;\r\n \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t}", "function cp_pos_price( $price, $price_type = '' ) {\n\t_deprecated_function( __FUNCTION__, '3.3', 'cp_pos_currency' );\n\t$price = cp_pos_currency( $price, $price_type );\n\techo $price;\n}", "public function totalprice();", "function lt_change_price( $price ) {\n \n $base_currency = LT_DEFAULT_CURRENCY_CODE;\n \n //get selected currency code\n $selected_currency_code = lt_get_currency_cookie();\n \n //open exchange rates\n $rates = lt_get_open_exchange_rate();\n\n $base_currency_rate = isset( $rates[$base_currency] ) ? $rates[$base_currency] : 1;\n $choosen_currency_rate = isset( $rates[$selected_currency_code] ) ? $rates[$selected_currency_code] : 1;\n \n $price = ( ( $price / $base_currency_rate ) * $choosen_currency_rate );\n $price = number_format( $price, 2 );\n \n return $price;\n}", "function price( $price ) {\r\n return sprintf( PRICE_FORMAT, $price );\r\n}", "public function price(): float;", "function setPrice($price);", "function fix_articles_price($article_uid=0){\n \t\tif($article_uid==0){\n \t\t\treturn ;\n \t\t}\n \t\t\n\t\treturn updatePriceXMLFromDatabase($article_uid);\n }", "function communityservice_template_loop_price() {\n\t\tcs_get_template( 'loop/price.php' );\n\t}", "public function _get__price() {\n return $this->getprice();\n }", "public function getUnitPrice();", "public function getUnitPrice();", "public function getListPrice();", "function price_format( $price ) {\r\n return \\site\\utils::money_format( $price );\r\n}", "protected function prepareMyPrice() {\n\t\t$this->throttleTime = MWSConstant::THROTTLE_TIME_PRODUCTPRICE;\n\t}", "function getProductRate($sell_type,$pid)\n\t {\t\n\t \n\t \tob_start();\n\t\t $sql=\"select * from \".INFINITE_PRODUCT_DETAIL.\" where product_id='\".$pid.\"'\";\n\t\t$result= $this->db->query($sql,__FILE__,__LINE__);\n\t\t$row= $this->db->fetch_array($result);\n\t\t ?>\n <input name=\"unit_price[]\" readonly=\"readonly\" style=\"width:100px\" class=\"cost\" value=\"<?php if($sell_type=='bundel' or $sell_type=='kg') echo $row['bundel_price']; else echo $row['pices_price']; ?>\" type=\"text\">\n <?php \n\t\t $html = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $html;\n\t }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "function get_list_product_price()\n{\n global $product;\n if ($price_html = $product->get_price_html()) :\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n endif; \n}", "function fun_prec($prec){\r\n\t\t\t\tif($prec=='vlow')\r\n\t\t\t\t\t$prec = 4.05 ;\r\n\t\t\t\telse if($prec==\"low\")\r\n\t\t\t\t\t$pre = 3.24 ;\r\n\t\t\t\telse if($prec==\"nom\")\r\n\t\t\t\t\t$prec = 2.43 ;\r\n\t\t\t\telse if($prec=='high')\r\n\t\t\t\t\t$prec = 1.62 ;\r\n\t\t\t\telse if($prec=='vhigh')\r\n\t\t\t\t\t$prec = 0.81 ;\r\n\t\t\t\telse if($prec=='ehigh')\r\n\t\t\t\t\t$prec = 0.00 ;\r\n\t\t\t\treturn $prec;\r\n\t\t\t}", "public function calculateTotalPrice()\n {\n }", "public function get_price()\n\t{\n\t\treturn $this->price;\n\t}", "public function presentPrice()\n {\n //$pricetotal = asDollars($pricetotal);\n return \"$\".number_format($this->price / 100);\n }" ]
[ "0.6833893", "0.6595227", "0.65816325", "0.6540857", "0.6509435", "0.6471708", "0.6453516", "0.638038", "0.6374957", "0.6359332", "0.6334834", "0.6297833", "0.6280792", "0.625945", "0.6255704", "0.6255704", "0.6157837", "0.61485004", "0.61401707", "0.61324257", "0.61270714", "0.61270714", "0.61270714", "0.61270714", "0.61270714", "0.6112176", "0.6106647", "0.60981464", "0.60813165", "0.60797584" ]
0.6642351
1
Return an array of price handler data.
function _uc_price_get_handlers($options = array()) { static $handlers = array(); // Set default options. $options += array( 'rebuild_handlers' => FALSE, 'all_handlers' => FALSE, ); // Get handlers only if we haven't already, or if this is a rebuild. if (empty($handlers) || $options['rebuild_handlers']) { // Get the handlers and sort them by weight. $config = variable_get('uc_price_handler_config', array()); foreach (module_implements('uc_price_handler') as $module) { // Create a price handler hook data array and merge in sensible defaults. $hooks[$module] = module_invoke($module, 'uc_price_handler') + array( 'weight' => 0, 'enabled' => TRUE, ); // Merge any configuration state in. if (isset($config[$module])) { $hooks[$module] = $config[$module] + $hooks[$module]; } // Unset disabled hooks if we're not building the selection form. if (!$options['all_handlers'] && !$hooks[$module]['enabled']) { unset($hooks[$module]); } } // Sort the hook data by weight. uasort($hooks, 'uc_weight_sort'); // Store the raw data for selection form building. $handlers['hook_data'] = $hooks; // Store the selected formatter, defaulting to uc_store's implementation. $formatter = variable_get('uc_price_format_callback', 'uc_store_price_handler_format'); if (function_exists($formatter)) { $handlers['formatter'] = $formatter; } else { $handlers['formatter'] = 'uc_store_price_handler_format'; } // Grab all the alter/format callbacks, as well as merging the options. // This happens in order by weight, so we're kosher. $handlers['alterers'] = array(); // We set some default options here. We could set them in the uc_store price handler, // but that means if that handler is disabled, we won't get them merged in. $handlers['options'] = array( 'sign' => variable_get('uc_currency_sign', '$'), 'sign_after' => variable_get('uc_sign_after_amount', FALSE), 'prec' => variable_get('uc_currency_prec', 2), 'dec' => variable_get('uc_currency_dec', '.'), 'thou' => variable_get('uc_currency_thou', ','), 'label' => TRUE, ); foreach ($hooks as $hook) { if (isset($hook['alter']['callback']) && function_exists($hook['alter']['callback'])) { $handlers['alterers'][] = $hook['alter']['callback']; } if (isset($hook['format']['callback']) && function_exists($hook['format']['callback'])) { $handlers['formatters'][] = $hook['format']['callback']; } if (isset($hook['options']) && is_array($hook['options'])) { $handlers['options'] += $hook['options']; } } } return $handlers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPrices() {\n\t\tif ($this->_id) {\n\t\t\t$sql = 'SELECT * FROM #__eb_event_group_prices WHERE event_id='.$this->_id.' ORDER BY id ';\n\t\t\t$this->_db->setQuery($sql);\t\t\t\n\t\t\t$prices = $this->_db->loadObjectList();\t\t\t\n\t\t} else {\n\t\t\t$prices = array();\t\t\t\n\t\t}\n\t\treturn $prices ;\n\t}", "public function getPricing() : array;", "protected function prices() : array\n {\n return [\n 'min' => Arr::get($this->request, 'min'),\n 'max' => Arr::get($this->request, 'max'),\n ];\n }", "protected function _getItemsData()\n {\n $key = $this->_getCacheKey();\n $data = $this->getLayer()->getAggregator()->getCacheData($key);\n\n\n \n\n\n\n if ($data === null) {\n $dbRanges = $this->getRangeItemCounts($this->getMaxPriceInt());\n foreach ($dbRanges as $index=>$count) {\n $data[] = array(\n 'label' => $this->_renderItemLabel(0, $this->getMaxPriceInt()),\n 'value' => 0 . ',' . $this->getMaxPriceInt(),\n 'count' => $count,\n );\n }\n $tags = array(\n Mage_Catalog_Model_Product_Type_Price::CACHE_TAG,\n );\n $tags = $this->getLayer()->getStateTags($tags);\n $this->getLayer()->getAggregator()->saveCacheData($data, $key, $tags);\n }\n return $data;\n }", "public function getPrices()\n {\n return $this->prices;\n }", "private function getWholesalePriceMeta(): array\n {\n try {\n /** @phpstan-ignore-next-line */\n return \\WooCommerceWholeSalePrices::getInstance()->wwp_import_export->wholesale_prices_meta();\n } catch (\\Throwable $throwable) {\n Splash::log()->report($throwable);\n\n return array();\n }\n }", "public function getListPrice();", "public function getData()\n {\n $this->validate(\n 'currency',\n 'amount',\n 'transactionId',\n 'currency',\n 'description',\n 'returnUrl',\n 'cancelUrl',\n 'language'\n );\n\n $parameters = [\n 'publicKey' => $this->getPublicKey(),\n 'order' => [\n 'id' => $this->getTransactionId(),\n 'amount' => $this->getAmount(),\n 'currency' => $this->getCurrency(),\n 'items' => [\n 'name' => $this->getProductName(),\n 'price' => $this->getAmount(),\n 'currency' => $this->getCurrency(),\n ],\n 'description' => $this->getDescription(),\n ],\n 'payer' => $this->getPayer(),\n 'language' => $this->getLanguage(),\n 'resultUrl' => $this->getReturnUrl(),\n 'failPath' => $this->getCancelUrl(),\n 'signature' => $this->signature(),\n ];\n\n if ($this->getPaymentMethod() != '') {\n $parameters['paymentMethod'] = $this->getPaymentMethod();\n }\n\n return array_merge($this->getCustomData(), $parameters);\n }", "public function getData()\n {\n return [\n 'symbol' => $this->params['symbol'],\n 'orderId' => $this->params['id'],\n ];\n }", "public function findAll() {\n $sql = \"SELECT * FROM prices\";\n $result = $this->db->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $prices = array();\n foreach ($result as $row) {\n $pricesID = $row['id'];\n $prices[$pricesID] = $this->buildPrices($row);\n }\n return $prices;\n }", "public function get_product_data()\n {\n $query = \"\n SELECT\n prd_id,\n prd_product,\n prd_price + (1000 - MOD(prd_price,1000)) AS prd_price,\n prd_atlas,\n prd_type\n FROM bc_product\n\n INNER JOIN\n (\n SELECT\n mpr_product,\n SUM(mtr_price) AS prd_price\n FROM bc_material_product\n\n INNER JOIN bc_material\n ON mpr_material = mtr_id\n\n GROUP BY mpr_product\n ) product_price\n ON prd_id = mpr_product\n \";\n\n $result = $this->ManualQuery($query);\n if ($result && $this->CountRow() > 0) {\n return $this->FetchData();\n } else {\n return [];\n }\n }", "function getData() {\t\t\n\t\tif(isset($_SESSION['pharmacyId'])) {\n\t\t\t$productModel = new ProductModel();\n\t\t\t$content = $productModel->grabAll($_SESSION['pharmacyId']);\n\t\t\t$data['products'] = $content;\n\t\t\t$data['counter'] = sizeof($content);\n\t\t\treturn $data;\n\t\t}\n\t}", "public function __invoke()\n {\n return [\n Currency::make('Price'),\n Select::make('Type')->options([\n 'personal' => 'Personal',\n 'gift' => 'Gift',\n ])->default($this->type),\n DateTime::make('Purchased At'),\n ];\n }", "public function listPricesSettings()\n {\n\n\n // parse inputs\n $resourcePath = \"/resellers/prices\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array());\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n\n\n\n\n\n\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n\n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams\n );\n\n return array($response, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n\n throw $e;\n }\n\n }", "public function collectOldDataFromQuoteDataProvider()\n {\n return [\n [\n 'specifiedRuleIds' => [1, 5, 8],\n 'itemsPriceData' => [\n 'test_product' => 50,\n 'test_product_1' => 75\n ],\n 'cartPriceData' => [\n 'test_product' => 60,\n 'test_product_1' => 90\n ],\n 'totalDiscount' => 45\n ],\n ];\n }", "public function getData()\n {\n $this->validate(\n 'app_id',\n 'app_key',\n 'partner',\n 'body',\n 'out_trade_no',\n 'total_fee',\n 'spbill_create_ip',\n 'notify_url',\n 'cert_path',\n 'cert_key_path'\n );\n\n $params = array_only($this->parameters->all(), array(\n 'app_id', 'app_key', 'partner',\n 'body', 'out_trade_no', 'total_fee',\n 'spbill_create_ip', 'notify_url', 'trade_type',\n 'open_id', 'product_id',\n 'device_info', 'attach',\n 'time_start', 'time_expire', 'goods_tag', 'cert_path', 'cert_key_path'\n ));\n $params['appid'] = $params['app_id'];\n $params['openid'] = $params['open_id'];\n $params['mch_id'] = $params['partner'];\n $params['nonstr'] = str_random(8);\n $params['time_start'] = date('YmdHis');\n $params['trade_type'] = array_get($params, 'trade_type', 'JSAPI');\n return array_except($params, ['app_id', 'open_id', 'partner']);\n }", "function get_imagify_all_prices() {\n\treturn imagify()->get_all_prices();\n}", "public function get_data() {\n\t\treturn array();\n\t}", "function getData($svc){\n\t\tglobal $db_defaultdb;\n\t\t$items = dbSelect(\"SELECT iddata, data FROM `\".$db_defaultdb.\"`.`infobox_data` where context=?\", array($svc));\n\t\tif (dbIsNotEmpty($items)){\n\t\t\treturn json_decode(dbGetColumnValueFromRow1($items, 'data'), true);\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "protected function getData(): array\n {\n return [\n 'amounts' => [\n $this->logRepository->getOverallClicks(),\n ($this->logRepository->getOverallOpenings() - $this->logRepository->getOverallClicks())\n ],\n 'titles' => [\n $this->getWidgetLabel('clickrate.label.0'),\n $this->getWidgetLabel('clickrate.label.1')\n ]\n ];\n }", "public function getData()\n {\n $data = [\n 'productid' => $this->getProductId(),\n 'transactionreference' => $this->getTransactionReference(),\n 'amount' => $this->getAmount()\n ];\n\n return $data;\n }", "public function getData(): array\n {\n $data = parent::getData();\n\n $data['CardHolderID'] = $this->getCardHolderId();\n if ($this->getCurrency()) {\n $data['Currency'] = str_pad($this->getCurrencyNumeric(), 3, 0, STR_PAD_LEFT);\n }\n $data['Description'] = $this->getDescription();\n $data['OrderId'] = $this->getTransactionId();\n $data['Amount'] = $this->getAmountInteger();\n $data['BackURL'] = $this->getReturnUrl();\n if ($this->getOpaque()) {\n $data['Opaque'] = $this->getOpaque();\n }\n\n return $data;\n }", "public function getAll(){\n return Price::all();\n }", "public function getPriceInfo()\n {\n return $this->priceInfo;\n }", "public function getData()\n {\n $date = $this->db->run(\"select * FROM products\");\n return $date->fetchAll();\n }", "protected function getData(): array\n {\n $logRepository = ObjectUtility::getObjectManager()->get(LogRepository::class);\n return [\n 'amounts' => [\n $logRepository->getOverallOpenings(),\n ($logRepository->getOverallMailsSent() - $logRepository->getOverallOpenings())\n ],\n 'titles' => [\n $this->getWidgetLabel('openingrate.label.0'),\n $this->getWidgetLabel('openingrate.label.1')\n ]\n ];\n }", "static public function getPrices( array $aItem ) {\n \n // The actual displayed tag price. This can be a discount price or proper price.\n $_aBuyingPrice = self::getElementAsArray(\n $aItem,\n array( 'Offers', 'Listings', 0, 'Price' )\n );\n $_sBuyingPrice = self::getElement( $_aBuyingPrice, array( 'DisplayAmount' ), '' );\n $_sCurrency = self::getElement( $_aBuyingPrice, array( 'Currency' ), '' );\n $_inBuyingPrice = self::getElement( $_aBuyingPrice, array( 'Amount' ) );\n // Saved price, present if there is a discount\n $_sSavingPrice = self::getElement(\n $aItem,\n array( 'Offers', 'Listings', 0, 'Price', 'Savings', 'DisplayAmount' ),\n ''\n );\n\n // There cases that `SavingBasis` is missing when there is no discount item.\n // @see https://webservices.amazon.com/paapi5/documentation/offers.html#savingbasis\n $_sProperPrice = self::getElement(\n $aItem,\n array( 'Offers', 'Listings', 'SavingBasis', 'DisplayAmount' ),\n $_sBuyingPrice\n );\n $_sDiscountedPrice = $_sSavingPrice ? $_sBuyingPrice : '';\n $_inDiscountedPrice = $_sSavingPrice ? $_inBuyingPrice : null;\n $_aSummaries = self::getElementAsArray( $aItem, array( 'Offers', 'Summaries' ) );\n $_aLowests = self::___getLowestPrices( $_aSummaries );\n\n $_aPrices = array(\n 'proper_price' => $_sProperPrice // 3.8.11 changed from `price`\n ? \"<span class='amazon-product-price-value'>\" \n . \"<span class='proper-price'>\" . $_sProperPrice . \"</span>\"\n . \"</span>\"\n : \"\",\n 'discounted_price' => $_sDiscountedPrice\n ? \"<span class='amazon-product-discounted-price-value'>\" \n . $_sDiscountedPrice\n . \"</span>\"\n : '',\n 'lowest_new_price' => isset( $_aLowests[ 'new_formatted' ] )\n ? \"<span class='amazon-product-lowest-new-price-value'>\"\n . $_aLowests[ 'new_formatted' ]\n . \"</span>\"\n : '',\n 'lowest_used_price' => isset( $_aLowests[ 'used_formatted' ] )\n ? \"<span class='amazon-product-lowest-used-price-value'>\"\n . $_aLowests[ 'used_formatted' ]\n . \"</span>\"\n : '',\n\n // For DB\n 'currency' => $_sCurrency,\n 'price_amount' => is_null( $_inBuyingPrice ) ? '' : $_inBuyingPrice * 100, // price\n 'price_formatted' => $_sBuyingPrice, // price_formatted\n 'lowest_new_price_amount' => is_null( $_aLowests[ 'new_amount' ] ) ? '' : $_aLowests[ 'new_amount' ] * 100, // lowest_new_price\n 'lowest_new_price_formatted' => $_aLowests[ 'new_formatted' ], // lowest_new_price_formatted\n 'lowest_used_price_amount' => is_null( $_aLowests[ 'used_amount' ] ) ? '' : $_aLowests[ 'used_amount' ] * 100, // lowest_used_price\n 'lowest_used_price_formatted' => $_aLowests[ 'used_formatted' ], // lowest_used_price_formatted\n 'discounted_price_amount' => is_null( $_inDiscountedPrice ) ? '' : $_inDiscountedPrice * 100, // discounted_price\n 'discounted_price_formatted' => $_sDiscountedPrice, // discounted_price_formatted\n );\n\n $_aPrices[ 'formatted_price' ] = self::getPrice(\n $_sProperPrice, // string\n $_inDiscountedPrice, // integer|null\n $_aLowests[ 'new_amount' ], // integer|null\n $_sDiscountedPrice, // string\n $_aLowests[ 'new_formatted' ] // string\n );\n return $_aPrices;\n\n }", "function get_imagify_packs_prices() {\n\treturn imagify()->get_packs_prices();\n}", "private function _getQuantitiesAndPrices()\n {\n $options = [];\n \n if( !$this->_isEmptyOptions() )\n {\n # get Cart\n $cart = $this->_getCurrentCartItem();\n # Get all paper pricing according to params provided\n $options = PaperPricingModel::wherePaperSizeId($cart['paper_size']['id'])\n ->activeList()\n ->paperTypeId($cart['paper_type']['id'])\n ->paperColorId($cart['paper_color']['id'])\n ->orderBy('quantity')\n ->orderBy('tat')\n ->get(); \n }\n \n return $options;\n }", "public function getData() {\n $data = array();\n $lines = $this->retrieveYahooData();\n\n foreach ($lines as $line)\n $data[] = explode(',', $line);\n\n return $data;\n }" ]
[ "0.6785476", "0.658336", "0.6567992", "0.6425682", "0.62652946", "0.61778784", "0.6176753", "0.6083373", "0.60585773", "0.6052435", "0.5991832", "0.59805626", "0.5965811", "0.59045565", "0.58960545", "0.58538246", "0.5849515", "0.5847839", "0.579916", "0.5755351", "0.57289654", "0.57054526", "0.5678569", "0.56753564", "0.56750023", "0.5657643", "0.5641298", "0.56372327", "0.5617109", "0.5613393" ]
0.6787746
0
Default price handler alterer; adds the default prefixes to the various product prices when viewing a product node.
function uc_store_price_handler_alter(&$price, &$context, &$options) { // If a class was specified in the price's context array... if (is_array($context['class'])) { // Look for a product price type in the class array and adjust the price // prefix accordingly. if (in_array('list', $context['class'])) { $options['prefixes'][] = t('List Price: '); } elseif (in_array('cost', $context['class'])) { $options['prefixes'][] = t('Cost: '); } elseif (in_array('sell', $context['class'])) { $options['prefixes'][] = t('Price: '); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sv_change_product_price_display($price)\n{\n if (is_shop()) {\n global $product;\n $id = $product->get_id();\n if ($id === 44) {\n $price = $price.' per kasse';\n return $price;\n } elseif ($id === 50) {\n $price = 'Testa-på pris '.$price;\n return $price;\n }\n }\n}", "function inspiry_price_defaults( WP_Customize_Manager $wp_customize ) {\n\t\t$price_settings_ids = array(\n\t\t\t'theme_currency_sign',\n\t\t\t'theme_currency_position',\n\t\t\t'theme_decimals',\n\t\t\t'theme_dec_point',\n\t\t\t'theme_thousands_sep',\n\t\t);\n\t\tinspiry_initialize_defaults( $wp_customize, $price_settings_ids );\n\t}", "public function price()\r\n {\r\n $this->app->jbtables->checkSku(true);\r\n $this->groupList = $this->_element->getGroups(array(JBCart::ELEMENT_TYPE_PRICE));\r\n $this->elementList = $this->app->jbprice->getPricesList();\r\n\r\n $this->element = $this->_jbrequest->take('jbcart.price.element', 'element', key($this->elementList), 'string');\r\n $this->positions = $this->_position->loadPositions(JBCart::CONFIG_PRICE . '.' . $this->element, array(JBCart::DEFAULT_POSITION));\r\n\r\n $this->groupKey = JBCart::CONFIG_PRICE;\r\n $this->saveTask = 'savePricePositions';\r\n\r\n $this->renderView();\r\n }", "protected function addFieldHandlers()\n {\n\n try {\n\n $this->addFieldHandler('description_html', function ($item) {\n $description = $this->getAttributeValue($item, 'description') ? htmlentities($this->getAttributeValue($item, 'description'), ENT_QUOTES) : '';\n return $description;\n });\n\n $this->addFieldHandler('description', function ($item) {\n $description = $this->getAttributeValue($item, 'description') ? str_replace(array(\"\\r\", \"\\n\"), ' ', strip_tags( html_entity_decode( $this->getAttributeValue($item, 'description') ) ) ) : '';\n return $description;\n });\n\n $this->addFieldHandler('visibility', function ($item) {\n return $item->getAttributeText('visibility');\n });\n\n //Add price fieldhandler\n $this->addFieldHandler('price', function ($item) {\n try {\n\n $price = $this->taxHelper->getTaxPrice($item, $item->getFinalPrice(), true);\n\n $item_type = $item->getTypeId();\n\n switch($item_type) {\n case Configurable::TYPE_CODE:\n $childPrices = array();\n $parentInstance = $item->getTypeInstance();\n $childProducts = $parentInstance->getUsedProducts($item);\n foreach ($childProducts as $child) {\n $childPrices[] = (is_numeric($child->getFinalPrice()) && $child->getFinalPrice() > 0) ? $child->getFinalPrice() : 0;\n }\n if(!empty($childPrices)) {\n $price = min($childPrices) > 0 ? min($childPrices) : $item->getPriceInfo()->getPrice('final_price')->getAmount()->getValue();\n } else {\n $price = $item->getPriceInfo()->getPrice('final_price')->getAmount()->getValue();\n }\n break;\n case Grouped::TYPE_CODE:\n $associatedProducts = $item->getTypeInstance()->getAssociatedProducts($item);\n if ( ! empty( $associatedProducts ) ) {\n foreach ( $associatedProducts as $associatedProduct ) {\n if ( empty( $price ) ) {\n $price = $this->taxHelper->getTaxPrice($associatedProduct, $associatedProduct->getFinalPrice(), true);\n $price = str_replace(',', '', $price);\n } elseif ( $price > $associatedProduct->getPrice() ) {\n $price = $this->taxHelper->getTaxPrice($associatedProduct, $associatedProduct->getFinalPrice(), true);\n $price = str_replace(',', '', $price);\n }\n }\n }\n break;\n case Bundle::TYPE_CODE:\n $price = $item->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getValue();\n break;\n case self::PRODUCT_TYPE_SIMPLE:\n $price = $this->taxHelper->getTaxPrice($item, $item->getFinalPrice(), true);\n break;\n }\n return number_format( (float) $price, 2 );\n } catch (\\Exception $e) {\n return 0;\n }\n });\n\n //Add list_price fieldhandler\n $this->addFieldHandler('list_price', function ($item) {\n try {\n\n $price = $this->taxHelper->getTaxPrice($item, $item->getPrice(), true);\n\n $item_type = $item->getTypeId();\n\n switch($item_type) {\n case Configurable::TYPE_CODE:\n $childPrices = array();\n $parentInstance = $item->getTypeInstance();\n $childProducts = $parentInstance->getUsedProducts($item);\n foreach ($childProducts as $child) {\n $childPrices[] = (is_numeric($child->getPrice()) && $child->getPrice() > 0) ? $child->getPrice() : 0;\n }\n if(!empty($childPrices)) {\n $price = min($childPrices) > 0 ? min($childPrices) : $item->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue();\n } else {\n $price = $item->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue();\n }\n break;\n case Grouped::TYPE_CODE:\n $associatedProducts = $item->getTypeInstance()->getAssociatedProducts($item);\n if (!empty($associatedProducts)) {\n foreach ($associatedProducts as $associatedProduct) {\n if (empty($price)) {\n $price = $this->taxHelper->getTaxPrice($associatedProduct, $associatedProduct->getPrice(), true);\n $price = str_replace(',', '', $price);\n } elseif ($price > $associatedProduct->getPrice()) {\n $price = $this->taxHelper->getTaxPrice($associatedProduct, $associatedProduct->getPrice(), true);\n $price = str_replace(',', '', $price);\n }\n }\n }\n break;\n case Bundle::TYPE_CODE:\n $price = $item->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();\n break;\n case self::PRODUCT_TYPE_SIMPLE:\n $price = $this->taxHelper->getTaxPrice($item, $item->getPrice(), true);\n break;\n }\n\n return number_format((float)$price, 2);\n } catch (\\Exception $e) {\n return 0;\n }\n });\n\n $this->addFieldHandler('tier_price_values', function ($item) {\n $holderArray = [];\n $tierPriceObj = $item->getTierPrice();\n if (count($tierPriceObj) > 0) {\n foreach ($tierPriceObj as $price) {\n if (isset($price['price'])) {\n array_push($holderArray, floatval($price['price']));\n }\n }\n }\n return $holderArray;\n });\n\n $this->addFieldHandler('tier_price_quantities', function ($item) {\n $holderArray = [];\n $tierPriceObj = $item->getTierPrice();\n if (count($tierPriceObj) > 0) {\n foreach ($tierPriceObj as $price) {\n if (isset($price['price_qty'])) {\n array_push($holderArray, floatval($price['price_qty']));\n }\n }\n }\n return $holderArray;\n });\n\n //Add image fieldhandler\n $this->addFieldHandler('image', function ($item) {\n $imageUrl = $this->imageHelper->getUrl($item);\n\n /***\n * Fix malformed image url's.\n */\n $valid_path = strpos($imageUrl, 'catalog/product/');\n if ($valid_path > -1) {\n return $imageUrl;\n } else {\n $imageUrl = str_replace('catalog/product', 'catalog/product/', $imageUrl);\n return $imageUrl;\n }\n\n\n });\n\n //Add url fieldhandler\n $this->addFieldHandler('url', function ($item) {\n $_params = $this->requestInterface->getParams();\n if (array_key_exists('scope_id', $_params)){\n $storeId = $_params['scope_id'];\n } else {\n $storeId = $this->storeManager->getStore()->getId();\n }\n return $item->setStoreId($storeId)->getUrlInStore();\n });\n\n //Add categories fieldhandler\n $this->addFieldHandler('categories', function ($item) {\n return $item->getCategoryIds();\n });\n\n $this->addFieldHandler('child_stocks', function ($item) {\n $productType = $item->getTypeID();\n $StockState = $this->StockStateInterface;\n $stock_list = [];\n switch ($productType) {\n case 'configurable':\n $productTypeInstance = $item->getTypeInstance();\n $usedProducts = $productTypeInstance->getUsedProducts($item);\n foreach ($usedProducts as $simple) {\n $stock_list[] = $StockState->getStockQty($simple->getId(), $simple->getStore()->getWebsiteId());\n }\n break;\n case 'grouped':\n $productTypeInstance = $item->getTypeInstance();\n $usedProducts = $productTypeInstance->getAssociatedProducts($item);\n foreach ($usedProducts as $simple) {\n $stock_list[] = $StockState->getStockQty($simple->getId(), $simple->getStore()->getWebsiteId());\n }\n break;\n }\n return $stock_list;\n });\n\n //Add stock fieldhandler\n $this->addFieldHandler('stock', function ($item) {\n $productType = $item->getTypeID();\n $StockState = $this->StockStateInterface;\n $total_stock = 0;\n\n switch ($productType) {\n case 'configurable':\n $productTypeInstance = $item->getTypeInstance();\n $usedProducts = $productTypeInstance->getUsedProducts($item);\n foreach ($usedProducts as $simple) {\n $total_stock += $StockState->getStockQty($simple->getId(), $simple->getStore()->getWebsiteId());\n }\n break;\n case 'simple':\n $total_stock = $StockState->getStockQty($item->getId(), $item->getStore()->getWebsiteId());\n break;\n case 'bundle':\n // Get the inventory qty of each child item\n $productsArray = [];\n $selectionCollection = $item->getTypeInstance(true)\n ->getSelectionsCollection(\n $item->getTypeInstance(true)->getOptionsIds($item),\n $item\n );\n\n foreach ($selectionCollection as $proselection) {\n $selectionArray = [];\n $selectionArray['min_qty'] = $proselection->getSelectionQty();\n $selectionArray['stock'] = $StockState->getStockQty($proselection->getProductId(), $item->getStore()->getWebsiteId());\n $productsArray[$proselection->getOptionId()][$proselection->getSelectionId()] = $selectionArray;\n }\n\n $bundle_stock = 0;\n foreach ($productsArray as $_ => $bundle_item) {\n $bundle_option_min_stock = 0;\n foreach ($bundle_item as $__ => $bundle_option) {\n if ((integer)$bundle_option['min_qty'] <= $bundle_option['stock']) {\n $bundle_option_min_stock = ($bundle_option_min_stock == 0) ? $bundle_option['stock'] : $bundle_option_min_stock;\n $bundle_option_min_stock = ($bundle_option_min_stock < $bundle_option['stock']) ? $bundle_option['stock'] : $bundle_option_min_stock;\n }\n }\n $bundle_stock = ($bundle_stock == 0) ? $bundle_option_min_stock : $bundle_stock;\n $bundle_stock = ($bundle_stock < $bundle_option_min_stock) ? $bundle_option_min_stock : $bundle_stock;\n }\n\n $total_stock = $bundle_stock;\n break;\n case 'grouped':\n $productTypeInstance = $item->getTypeInstance();\n $usedProducts = $productTypeInstance->getAssociatedProducts($item);\n foreach ($usedProducts as $simple) {\n $total_stock += $StockState->getStockQty($simple->getId(), $simple->getStore()->getWebsiteId());\n }\n break;\n }\n\n return $total_stock;\n });\n\n //Add age fieldhandler\n $this->addFieldHandler('age', function ($item) {\n $createdAt = strtotime($item->getCreatedAt());\n $now = time();\n $diff = $now - $createdAt;\n return floor($diff / (60 * 60 * 24));\n });\n\n //Add created_at fieldhandler\n $this->addFieldHandler('created_at', function ($item) {\n $createdAt = strtotime($item->getCreatedAt());\n return $createdAt;\n });\n\n $this->addFieldHandler('product_type', function ($item) {\n $type = $item->getTypeId();\n return $type;\n });\n\n $this->addFieldHandler('manufacturer', function ($item) {\n $brand = $this->getAttributeValue($item, 'manufacturer');\n return $brand;\n });\n\n //Add on_sale fieldhandler\n $this->addFieldHandler('on_sale', function ($item) {\n try {\n $price = $item->getPrice();\n $finalPrice = $item->getFinalPrice();\n //Fix for configurable products\n if ($item->getTypeId() === Configurable::TYPE_CODE) {\n $price = $item->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue();\n $finalPrice = $item->getPriceInfo()->getPrice('final_price')->getAmount()->getValue();\n }\n\n if ($item->getTypeId() === Bundle::TYPE_CODE) {\n $price = $item\n ->getPriceInfo()\n ->getPrice('regular_price')\n ->getMinimalPrice()\n ->getValue();\n\n $finalPrice = $item\n ->getPriceInfo()\n ->getPrice('final_price')\n ->getMinimalPrice()\n ->getValue();\n }\n\n return $finalPrice < $price;\n } catch (\\Exception $e) {\n return false;\n }\n });\n\n } catch (\\Exception $e) {\n\n $this->clerk_logger->error('Getting Field Handlers Error', ['error' => $e->getMessage()]);\n\n }\n }", "public function __construct($suffix = 'Price', $prefix = '')\n {\n $this->suffix = $suffix;\n $this->prefix = $prefix;\n parent::__construct();\n }", "function get_product_addon_price_for_display( $price ) {\n\t\tglobal $product;\n\n\t\tif ( $price === '' || $price == '0' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_object( $product ) ) {\n\t\t\t$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );\n\t\t\t$display_price = $tax_display_mode == 'incl' ? $product->get_price_including_tax( 1, $price ) : $product->get_price_excluding_tax( 1, $price );\n\t\t} else {\n\t\t\t$display_price = $price;\n\t\t}\n\n\t\treturn $display_price;\n\t}", "public static function get_price_format() {\n\t\tself::instance()->save();\n\t\tLP()->settings()->refresh();\n\t\techo learn_press_format_price( 1234.56, true );\n\t\tdie();\n\t}", "function lt_change_price( $price ) {\n \n $base_currency = LT_DEFAULT_CURRENCY_CODE;\n \n //get selected currency code\n $selected_currency_code = lt_get_currency_cookie();\n \n //open exchange rates\n $rates = lt_get_open_exchange_rate();\n\n $base_currency_rate = isset( $rates[$base_currency] ) ? $rates[$base_currency] : 1;\n $choosen_currency_rate = isset( $rates[$selected_currency_code] ) ? $rates[$selected_currency_code] : 1;\n \n $price = ( ( $price / $base_currency_rate ) * $choosen_currency_rate );\n $price = number_format( $price, 2 );\n \n return $price;\n}", "function print_price($currency, $old, $new=0, $discount=false)\n{\n $old=amount_to_print($old);\n $new=amount_to_print($new);\n\n if($new and $discount)\n {\n return \"<div class='cena_b'><strike>$old</strike></div>\n <div class='cena_n'>&nbsp;$new</div>\";\n }\n\n return \"<div class='cena_b'>&nbsp;$old</div>\";\n}", "function _uc_price_get_handlers($options = array()) {\n static $handlers = array();\n\n // Set default options.\n $options += array(\n 'rebuild_handlers' => FALSE,\n 'all_handlers' => FALSE,\n );\n\n // Get handlers only if we haven't already, or if this is a rebuild.\n if (empty($handlers) || $options['rebuild_handlers']) {\n // Get the handlers and sort them by weight.\n $config = variable_get('uc_price_handler_config', array());\n\n foreach (module_implements('uc_price_handler') as $module) {\n // Create a price handler hook data array and merge in sensible defaults.\n $hooks[$module] = module_invoke($module, 'uc_price_handler') + array(\n 'weight' => 0,\n 'enabled' => TRUE,\n );\n\n // Merge any configuration state in.\n if (isset($config[$module])) {\n $hooks[$module] = $config[$module] + $hooks[$module];\n }\n\n // Unset disabled hooks if we're not building the selection form.\n if (!$options['all_handlers'] && !$hooks[$module]['enabled']) {\n unset($hooks[$module]);\n }\n }\n\n // Sort the hook data by weight.\n uasort($hooks, 'uc_weight_sort');\n\n // Store the raw data for selection form building.\n $handlers['hook_data'] = $hooks;\n\n // Store the selected formatter, defaulting to uc_store's implementation.\n $formatter = variable_get('uc_price_format_callback', 'uc_store_price_handler_format');\n\n if (function_exists($formatter)) {\n $handlers['formatter'] = $formatter;\n }\n else {\n $handlers['formatter'] = 'uc_store_price_handler_format';\n }\n\n // Grab all the alter/format callbacks, as well as merging the options.\n // This happens in order by weight, so we're kosher.\n $handlers['alterers'] = array();\n\n // We set some default options here. We could set them in the uc_store price handler,\n // but that means if that handler is disabled, we won't get them merged in.\n $handlers['options'] = array(\n 'sign' => variable_get('uc_currency_sign', '$'),\n 'sign_after' => variable_get('uc_sign_after_amount', FALSE),\n 'prec' => variable_get('uc_currency_prec', 2),\n 'dec' => variable_get('uc_currency_dec', '.'),\n 'thou' => variable_get('uc_currency_thou', ','),\n 'label' => TRUE,\n );\n\n foreach ($hooks as $hook) {\n if (isset($hook['alter']['callback']) && function_exists($hook['alter']['callback'])) {\n $handlers['alterers'][] = $hook['alter']['callback'];\n }\n if (isset($hook['format']['callback']) && function_exists($hook['format']['callback'])) {\n $handlers['formatters'][] = $hook['format']['callback'];\n }\n\n if (isset($hook['options']) && is_array($hook['options'])) {\n $handlers['options'] += $hook['options'];\n }\n }\n }\n\n return $handlers;\n}", "function rth_mpc_prijs( $price ) {\n\n\tif ( ! class_exists( 'WC_Price_Calculator_Product' ) ) {\n\t\treturn;\n\t}\n\n\tglobal $product;\n\t$measurement = WC_Price_Calculator_Product::calculator_enabled( $product );\n\t\n\tif ( $measurement ) {\n\t\t\n$textafter = '<span class=\"m2\"> /m<sup>2</sup></span> '; //tekst achter prijs\nreturn $price . '' . $textafter . '';\n\n\t}\n\nelse {\n$textafter = ''; //tekst achter prijs\nreturn $price . '' . $textafter . '';\n}\n\n}", "function get_list_product_price()\n{\n global $product;\n if ($price_html = $product->get_price_html()) :\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n endif; \n}", "function set_product_price_on_add_to_cart( $woo_data ) {\n if ( ! isset( $_REQUEST['location'] ) || empty( $_REQUEST['location'] ) ) { return $woo_data; }\n if ( ! $this->slplus->currentLocation->isvalid_ID( $_REQUEST['location'] ) ) { return $woo_data; }\n\n $this->slplus->currentLocation->get_location( $_REQUEST['location'] );\n $woo_data['location_id'] = $this->slplus->currentLocation->id;\n\n\n $this->set_current_products( $this->slplus->currentLocation->exdata['woo_products'] );\n\n // Dynamic Pricing\n //\n if (\n isset ( $this->current_products[ $woo_data['data']->sku ] ) &&\n ! is_null( $this->current_products[ $woo_data['data']->sku ] ) &&\n ! empty ( $this->current_products[ $woo_data['data']->sku ] )\n ) {\n $woo_data['data']->set_price( $this->current_products[ $woo_data['data']->sku ] );\n $woo_data['data']->post->post_title =\n $woo_data['data']->post->post_title . \"<br/>\\n\" .\n sprintf( '<span class=\"product_subtitle in_cart\">%s</span>', $this->slplus->currentLocation->store );\n\n // Standard Pricing\n //\n } else {\n $woo_data['data']->post->post_title =\n $woo_data['data']->post->post_title . \"<br/>\\n\" .\n sprintf( '<span class=\"product_subtitle in_cart\">%s</span>', __( 'Standard Pricing' , 'slp-premier' ) );\n ;\n }\n\n return $woo_data;\n }", "public function change_my_product_page(){\n remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);\n add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 25);\n }", "function setPrice($price);", "function communityservice_template_loop_price() {\n\t\tcs_get_template( 'loop/price.php' );\n\t}", "private function reloadProductPriceInfo(): void\n {\n $product = $this->registry->registry('product');\n self::assertNotNull($product);\n $product->reloadPriceInfo();\n }", "function uc_store_price_handler_format($price, $options) {\n $output = '';\n\n // If the value is less than the minimum precision, zero it.\n if ($options['prec'] > 0 && abs($price) < 1 / pow(10, $options['prec'])) {\n $price = 0;\n }\n\n // Force the price to a positive value and add a negative sign if necessary.\n if ($price < 0) {\n $price = abs($price);\n $output .= '-';\n }\n\n // Add the currency sign first if specified.\n if ($options['sign'] && !$options['sign_after']) {\n $output .= $options['sign'];\n }\n\n // Format the number, like 1234.567 => 1,234.57\n $output .= number_format($price, $options['prec'], $options['dec'], $options['thou']);\n\n // Add the currency sign last if specified.\n if ($options['sign'] && $options['sign_after']) {\n $output .= $options['sign'];\n }\n\n return $output;\n}", "function uc_price($price_info, $context, $options = array()) {\n global $user;\n $values = array();\n\n // If we're passed just a number for price, we'll set the quantity to 1.\n if (is_numeric($price_info)) {\n $price_info = array(\n 'price' => $price_info,\n 'qty' => 1,\n );\n }\n elseif (!is_array($price_info)) {\n $price_info = array(\n 'price' => 0,\n 'qty' => 1,\n );\n }\n\n // Initialize the options and context.\n $options += array(\n 'cache' => variable_get('uc_price_caching', TRUE),\n );\n\n $context += array(\n 'revision' => 'themed',\n 'type' => 'amount',\n );\n\n // Clamp to allowed revisions.\n $revisions = array('original', 'altered', 'formatted-original', 'formatted', 'themed-original', 'themed');\n\n if (!in_array($context['revision'], $revisions)) {\n $context['revision'] = 'themed';\n }\n\n // Get all the active handlers.\n $handlers = _uc_price_get_handlers($options);\n\n // Use the global user if none was passed in.\n if (!isset($context['account'])) {\n $context['account'] = $user;\n }\n\n // Merge any incoming options, giving them precedence.\n $options += $handlers['options'];\n\n // Build the cache key with the original state, trimming down the account to\n // an array with a limited set of keys that don't change every pageload; the\n // uid, name, mail, and roles of the user account.\n $context_clone = $context;\n // TODO: array_intersect_key() isn't available until PHP 5.1.0. (Drupal 7)\n //$context_clone['account'] = array_intersect_key((array) $context['account'], drupal_map_assoc(array()));\n $context_clone['account'] = array(\n 'uid' => $context['account']->uid,\n 'name' => $context['account']->name,\n 'mail' => $context['account']->mail,\n 'roles' => $context['account']->roles,\n );\n\n $key = md5(serialize($price_info + $context_clone + $options));\n\n // If this price has already been calculated and cached...\n if ($options['cache'] && $cache = cache_get($key, 'cache_uc_price')) {\n // Use the cached price data.\n $values = $cache->data;\n }\n else {\n // Otherwise, build it from scratch.\n $values['original'] = $price_info['price'] * $price_info['qty'];\n\n // Alter the price, context, and options.\n foreach ($handlers['alterers'] as $alterer) {\n $alterer($price_info, $context, $options);\n }\n\n // If a price placeholder was specified in the price info array...\n if (isset($price_info['placeholder'])) {\n // Force the formatted value to the placeholder.\n $values['formatted'] = $price_info['placeholder'];\n }\n else {\n // Otherwise use the actual numeric and formatted numeric values.\n $values['altered'] = $price_info['price'] * $price_info['qty'];\n\n // Format the original and altered prices using the formatter callback.\n $values['formatted-original'] = $handlers['formatter']($values['original'], $options);\n $values['formatted'] = $handlers['formatter']($values['altered'], $options);\n }\n\n // Theme the price.\n $values['themed-original'] = theme('uc_price', array('value' => $values['formatted-original'], 'context' => $context, 'options' => $options));\n $values['themed'] = theme('uc_price', array('value' => $values['formatted'], 'context' => $context, 'options' => $options));\n\n // Cache this price values.\n // TODO: Determine if we can safely cache these things...\n if ($options['cache']) {\n cache_set($key, $values, 'cache_uc_price', CACHE_TEMPORARY);\n }\n }\n\n // Return the requested revision.\n return $values[$context['revision']];\n}", "function _default($product_id){\n\t\t\t$this->dosage_id = findEmptyKey('DOSAGE', 'dosage_id'); \n\t\t\t$this->product_id = htmlspecialchars(strip_tags(trim($product_id))); \n\t\t\t//FOR LATER, UPDATE TO ALLOW FOR COMPOUND SELECTION\n\t\t\t$this->setCompounds('NEW'); \n\t\t\t//echo \"<p>Value = \".$this->compounds[0]->value.\"</p>\"; \n\t\t\t$this->form = 'default'; \n\t\t\t$this->quantity = 10; \n\t\t\t$this->image = 'uploads/Umbrella.jpg'; \n\t\t\t$this->price = 20.00;\n\t\t}", "protected function prepareMyPrice() {\n\t\t$this->throttleTime = MWSConstant::THROTTLE_TIME_PRODUCTPRICE;\n\t}", "function wccp_append_prices( $data, $product, $variation ) {\n\tif ( ! is_single() ) {\n\t\treturn $data;\n\t}\n\t$original_price = $variation->get_price();\n\t$btc_course = wccp_get_rate( 'btc' );\n\t$ltc_course = wccp_get_rate( 'ltc' );\n\t$doge_course = wccp_get_rate( 'doge' );\n\t$dash_course = wccp_get_rate( 'dash' );\n\t$original_price = $variation->get_price();\n $data['price_html'] = '<span class=\"price\">' . wc_price( $original_price ) . '</span>';\n if ( $btc_course ) {\n \t$btc_price = $variation->get_price() / $btc_course;\n \t$data['price_html'] .= '<br/><span class=\"price\"><img src=\"https://s2.coinmarketcap.com/static/img/coins/16x16/1.png\"> ' . \nwc_price( $btc_price, ['currency' => 'BTC', 'decimals' => 8] ) . ' BTC</span>';\n }\n if ( $ltc_course ) {\n\t $ltc_price = $variation->get_price() / $ltc_course;\n\t $data['price_html'] .= '<br/><span class=\"price\"><img src=\"https://s2.coinmarketcap.com/static/img/coins/16x16/2.png\"> ' \n.wc_price( $ltc_price, ['currency' => 'LTC', 'decimals' => 8] ) . ' LTC</span>';\n }\n\t\n\tif ( $doge_course ) {\n\t $doge_price = $variation->get_price() / $doge_course;\n\t $data['price_html'] .= '<br/><span class=\"price\"><img src=\"https://s2.coinmarketcap.com/static/img/coins/16x16/74.png\"> ' \n.wc_price( $doge_price, ['currency' => 'DOGE', 'decimals' => 8] ) . ' DOGE</span>';\n }\n\t \n\tif ( $dash_course ) {\n\t $dash_price = $variation->get_price() / $dash_course;\n\t $data['price_html'] .= '<br/><span class=\"price\"><img src=\"https://s2.coinmarketcap.com/static/img/coins/16x16/131.png\"> ' \n.wc_price( $dash_price, ['currency' => 'DASH', 'decimals' => 8] ) . ' DASH</span>';\n }\n return $data;\n}", "public function price($price, $old = null) {\n\t $output = $this->Number->currency($price, 'zł');\n\t\n\t // adding old price (using recurrency)\n\t if ($old !== null) {\n\t\t$output = \"<del>\".$this->Number->currency($old, 'zł', array('after' => '')).\"</del> \".$output;\n\t } \n\t \n\t return $output;\n\t}", "function uni_cpo_price( $price, $args = array() )\n{\n $defaults = array(\n 'ex_tax_label' => false,\n 'currency' => '',\n 'decimal_separator' => wc_get_price_decimal_separator(),\n 'thousand_separator' => wc_get_price_thousand_separator(),\n 'decimals' => wc_get_price_decimals(),\n 'price_format' => get_woocommerce_price_format(),\n );\n $data = apply_filters( 'wc_price_args', wp_parse_args( $args, $defaults ) );\n $negative = $price < 0;\n $price = apply_filters( 'uni_cpo_price_raw', floatval( ( $negative ? $price * -1 : $price ) ) );\n $price = apply_filters(\n 'formatted_uni_cpo_price',\n number_format(\n $price,\n $data['decimals'],\n $data['decimal_separator'],\n $data['thousand_separator']\n ),\n $price,\n $data['decimals'],\n $data['decimal_separator'],\n $data['thousand_separator']\n );\n if ( apply_filters( 'uni_cpo_price_trim_zeros', false ) && $data['decimals'] > 0 ) {\n $price = wc_trim_zeros( $price );\n }\n $formatted_price = (( $negative ? '-' : '' )) . sprintf( $data['price_format'], get_woocommerce_currency_symbol( $data['currency'] ), $price );\n if ( $data['ex_tax_label'] && wc_tax_enabled() ) {\n $formatted_price .= ' <small class=\"tax_label\">' . WC()->countries->ex_tax_or_vat() . '</small>';\n }\n return apply_filters(\n 'uni_cpo_price',\n $formatted_price,\n $price,\n $args\n );\n}", "protected function _construct()\r\n {\r\n $this->_init('catalog/product_index_price', 'entity_id');\r\n }", "function ts_custom_change_stock() {\n\tadd_rewrite_endpoint('change-stock', EP_ROOT | EP_PAGES);\n\n\tif (get_option('mw_stock_flush_rewrite_rules_flag')) {\n\t\tflush_rewrite_rules();\n\t\tdelete_option('mw_stock_flush_rewrite_rules_flag');\n\t}\n}", "final public function price()\n {\n echo \"<br><br><br>Especially apples!\";\n }", "function setPrice($price){\n $this->price = $price;\n }", "public function set_price($price = NULL)\n {\n if (is_null($price) || empty($price))\n {\n return $this->set_point_of_initiation_static();\n } else\n {\n $this->point_of_initiation = parent::POINT_OF_INITIATION_DYNAMIC;\n if (is_numeric($price))\n {\n $this->transaction_amount = number_format($price, 2, '.', '');\n } else\n {\n return $this->return_status(FALSE, self::STATUS_INVALID_VALUE, parent::ID_TRANSACTION_AMOUNT);\n }\n }\n return $this->return_status(TRUE);\n }", "public function _set__price($value) {\n $this->price = $value;\n }" ]
[ "0.6036308", "0.57739294", "0.5596515", "0.55146664", "0.54758596", "0.54512644", "0.5426442", "0.542047", "0.5352925", "0.53195757", "0.5298007", "0.5233953", "0.5218258", "0.51916033", "0.51905864", "0.5176291", "0.5156707", "0.5110115", "0.5097457", "0.507611", "0.5045937", "0.50409085", "0.5040324", "0.5031307", "0.4992096", "0.49896127", "0.49743712", "0.49612355", "0.49604896", "0.49445805" ]
0.6858196
0
Default price handler formatter; formats the price using the store currency display settings.
function uc_store_price_handler_format($price, $options) { $output = ''; // If the value is less than the minimum precision, zero it. if ($options['prec'] > 0 && abs($price) < 1 / pow(10, $options['prec'])) { $price = 0; } // Force the price to a positive value and add a negative sign if necessary. if ($price < 0) { $price = abs($price); $output .= '-'; } // Add the currency sign first if specified. if ($options['sign'] && !$options['sign_after']) { $output .= $options['sign']; } // Format the number, like 1234.567 => 1,234.57 $output .= number_format($price, $options['prec'], $options['dec'], $options['thou']); // Add the currency sign last if specified. if ($options['sign'] && $options['sign_after']) { $output .= $options['sign']; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_price_format() {\n\t\tself::instance()->save();\n\t\tLP()->settings()->refresh();\n\t\techo learn_press_format_price( 1234.56, true );\n\t\tdie();\n\t}", "function price_format( $price ) {\r\n return \\site\\utils::money_format( $price );\r\n}", "public function displayPrice()\n {\n $currency = Setting::displayCurrency();\n return $currency.' '.number_format($this->price, 2);\n }", "public static function displayPrice($price, $currency = null, $no_utf8 = false, Context $context = null)\n {\n }", "function wpsc_format_currency( $amt, $args = '' ) {\n\t$defaults = array(\n\t\t'display_currency_symbol' => true,\n\t\t'display_decimal_point' => true,\n\t\t'display_currency_code' => false,\n\t\t'isocode' => false,\n\t\t'currency_code' => false,\n\t);\n\n\t$args = wp_parse_args( $args );\n\n\t// Either display symbol or code, not both\n\tif ( array_key_exists( 'display_currency_symbol', $args ) ) {\n\t\t$args['display_currency_code'] = ! $args['display_currency_symbol'];\n\t} elseif ( array_key_exists( 'display_currency_code', $args ) ) {\n\t\t$args['display_currency_symbol'] = ! $args['display_currency_code'];\n\t}\n\n\t$r = wp_parse_args( $args, $defaults );\n\textract( $r );\n\n\t$currencies_without_fractions = array( 'JPY', 'HUF', 'VND' );\n\n\tif ( $isocode ) {\n\t\t$currency = new WPSC_Country( $isocode );\n\t} else {\n\t\t$currency = new WPSC_Country( get_option( 'currency_type' ) );\n\t}\n\n\t$currency_code = $currency->get_currency_code();\n\n\t// No decimal point, no decimals\n\tif ( ! $display_decimal_point || in_array( $currency_code, $currencies_without_fractions ) ) {\n\t\t$decimals = 0;\n\t} else {\n\t\t$decimals = 2; // default is 2\n\t}\n\n\t$decimals = apply_filters( 'wpsc_modify_decimals' , $decimals, $isocode );\n\t$decimal_separator = apply_filters( 'wpsc_format_currency_decimal_separator' , wpsc_get_option( 'decimal_separator' ), $isocode );\n\t$thousands_separator = apply_filters( 'wpsc_format_currency_thousands_separator', wpsc_get_option( 'thousands_separator' ), $isocode );\n\n\t// Format the price for output\n\t$formatted = number_format( $amt, $decimals, $decimal_separator, $thousands_separator );\n\n\tif ( ! $display_currency_code ) {\n\t\t$currency_code = '';\n\t}\n\n\t$symbol = $display_currency_symbol ? $currency->get_currency_symbol() : '';\n\t$symbol = esc_html( $symbol );\n\t$symbol = apply_filters( 'wpsc_format_currency_currency_symbol', $symbol, $isocode );\n\n\t$currency_sign_location = get_option( 'currency_sign_location' );\n\n\t// Rejig the currency sign location\n\tswitch ( $currency_sign_location ) {\n\t\tcase 1:\n\t\t\t$format_string = '%3$s%1$s%2$s';\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\t$format_string = '%3$s %1$s%2$s';\n\t\t\tbreak;\n\n\t\tcase 4:\n\t\t\t$format_string = '%1$s%2$s %3$s';\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\tdefault:\n\t\t\t$format_string = '%1$s %2$s%3$s';\n\t\t\tbreak;\n\t}\n\t$currency_code = apply_filters( 'wpsc_format_currency_currency_code', $currency_code, $isocode );\n\n\t// Compile the output\n\t$output = trim( sprintf( $format_string, $currency_code, $symbol, $formatted ) );\n\treturn $output;\n}", "function format_price($value) {\n\treturn '&#36;'.number_format($value, 2);\n}", "public function showPrice()\n {\n return number_format($this->amount/100, 2);\n }", "function format_price( $price = 0, $echo = true ) {\n if ( is_numeric( $price ) ) {\n $price = sprintf('<span class=\"amount\">%s %s</span>', CURRENCY_CODE, nf($price));\n\n if (!$echo) {\n return $price;\n }\n \n }\n echo $price;\n}", "function my_custom_price_format($formatted_price, $price, $args)\n{\n\t$price_usd = convert_idr_to_usd_cart($price);\n\n\t// the currency symbol for US dollars\n\t$currency = '';\n\t$currency_symbol = get_woocommerce_currency_symbol($currency);\n\t$price_usd = 'Bs ' . $price_usd; // adding currency symbol\n\n\t// The USD formatted price\n\t$formatted_price_usd = \"<span class='price-vef'> $price_usd</span>\";\n\n\t// Return both formatted currencies\n\treturn $formatted_price_usd;\n\t// return $formatted_price . $formatted_price_usd;\n\t// https://stackoverflow.com/questions/45318117/calculations-displaying-2-currencies-in-woocommerce-cart-prices\n}", "function show_price($number, $curr=false){\t\t\r\n\t\tif($curr == false){\t\t\r\n\t\t$formated = $this->currency().' '.number_format($number, 2, ',', '.');\t\t\r\n\t\t}else{\t\r\n\t\t\t// TODO : Change when currency session change\t\r\n\t\t$formated = $curr.' '.number_format($number, 2, ',', '.');\t\t\r\n\t\t}\t\t\r\n\t\treturn $formated;\t\t\r\n\t}", "public function viewPrice()\n\t{\n\t\treturn money_format('%i', $this->price / 100);\n\t}", "function get_product_addon_price_for_display( $price ) {\n\t\tglobal $product;\n\n\t\tif ( $price === '' || $price == '0' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_object( $product ) ) {\n\t\t\t$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );\n\t\t\t$display_price = $tax_display_mode == 'incl' ? $product->get_price_including_tax( 1, $price ) : $product->get_price_excluding_tax( 1, $price );\n\t\t} else {\n\t\t\t$display_price = $price;\n\t\t}\n\n\t\treturn $display_price;\n\t}", "function price_format($value, $decimals = 2, $point = '.', $thousands_sep = ',')\n{\n return number_format($value, $decimals, $point, $thousands_sep);\n}", "function price( $price ) {\r\n return sprintf( PRICE_FORMAT, $price );\r\n}", "public function getformattedPriceAttribute()\n {\n $format = new \\NumberFormatter('fr_CH', \\NumberFormatter::CURRENCY);\n return $format->formatCurrency($this->full_price, 'CHF');\n }", "function em_get_currency_symbol( $price = '' ) {\n\t$options = get_option( 'events_maker_general' );\n\n\t$symbol = ( $options['currencies']['symbol'] === '' ? strtoupper( $options['currencies']['code'] ) : $options['currencies']['symbol'] );\n\n\tif ( is_numeric( $price ) ) {\n\t\tswitch ( $options['currencies']['format'] ) {\n\t\t\tcase 1:\n\t\t\t\t$price = number_format( $price, 2, '.', ',' );\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\t$price = number_format( $price, 0, '', ',' );\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\t$price = number_format( $price, 0, '', '' );\n\t\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\t\t\t$price = number_format( $price, 2, '.', '' );\n\t\t\t\tbreak;\n\n\t\t\tcase 5:\n\t\t\t\t$price = number_format( $price, 2, ',', ' ' );\n\t\t\t\tbreak;\n\n\t\t\tcase 6:\n\t\t\t\t$price = number_format( $price, 2, '.', ' ' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn apply_filters( 'em_get_currency_symbol', ( $options['currencies']['position'] === 'after' ? $price . ' ' . $symbol : $symbol . ' ' . $price ), $price );\n\t} else\n\t\treturn apply_filters( 'em_get_currency_symbol', $symbol, $price );\n}", "public function getFormattedPrice(string $type = 'default', ?string $currency = null): ?string;", "function uc_store_price_handler_alter(&$price, &$context, &$options) {\n // If a class was specified in the price's context array...\n if (is_array($context['class'])) {\n // Look for a product price type in the class array and adjust the price\n // prefix accordingly.\n if (in_array('list', $context['class'])) {\n $options['prefixes'][] = t('List Price: ');\n }\n elseif (in_array('cost', $context['class'])) {\n $options['prefixes'][] = t('Cost: ');\n }\n elseif (in_array('sell', $context['class'])) {\n $options['prefixes'][] = t('Price: ');\n }\n }\n}", "function formatPrice( $price ) {\n\n return intval( $price * 100 );\n }", "public static function getFormattedPrice($price){\n return $price == null? \"-\":number_format($price, 2, \",\", \"\") . \"€\";\n }", "public static function format($value)\n {\n $formatFunction = Config::get('shop.display_price_number_format') ?: function($price) { return number_format($price, 2); };\n return preg_replace(\n [\n '/:symbol/',\n '/:price/',\n '/:currency/'\n ],\n [\n Config::get('shop.currency_symbol'),\n $formatFunction($value),\n Config::get('shop.currency')\n ],\n Config::get('shop.display_price_format')\n );\n }", "function get_price_base( $format = false ){\n\t $price = apply_filters('em_booking_get_price_base', $this->get_tickets_bookings()->get_price(), $this);\n\t\tif($format){\n\t\t\treturn $this->format_price($price);\n\t\t}\n\t return $price;\n\t}", "protected function fmtPrice($value, array $aArgs){\n $oTpl = $this->getTemplate();\n if(is_null($value)){\n $value = $oTpl->parse($this->tplBlockName . ':price_empty');\n }else{\n $value = AMI::getSingleton('eshop')->formatNumber($value, FALSE);\n }\n $value = $oTpl->parse($this->tplBlockName . ':price', array('price' => $value));\n return $value;\n }", "public function get_formatted_price($price = null)\n {\n\n $formatted_price = null;\n\n // Get recurring price\n $recurring_price = $this->get_recurring_price($price);\n\n // Check if recurring price is set\n if ($recurring_price !== null) {\n\n // Tax adjustment\n $recurring_price = RightPress_Product_Price_Display::prepare_product_price_for_display($this->get_wc_product(), $recurring_price, false, true);\n\n // Format recurring amount\n $formatted_price = RP_SUB_Pricing::format_recurring_amount_for_display($recurring_price, $this->get_billing_cycle_length(), $this->get_billing_cycle_period());\n }\n\n // Allow developers to override and return\n return apply_filters('subscriptio_subscription_product_formatted_price', $formatted_price, $recurring_price, $this);\n }", "public function getPriceFormatted($price) {\n $fPrice = number_format($price, $this->number_format_decimals, $this->number_format_dec_point, $this->number_format_thousands_sep);\n if ($this->currency_char_position == 1) {\n return $this->currency_char . $fPrice;\n } else {\n return $fPrice . $this->currency_char;\n }\n }", "public function price()\n {\n return number_format((float)$this->price, 0, ',', '.');\n }", "function getProductPrice($price){\n $decimal_number = $this -> getSetting('decimal_number');\n $price = (float)number_format($price, $decimal_number, '.', '');\n return $price;\n }", "public function getPriceAttribute($price)\n {\n return number_format($price / 100, 2);\n }", "public static function format_price( $price, $currency, $symbol = true ) {\n\t\t// Fall back to unspecified currency symbol like `¤1,234.05`.\n\t\t// @link https://en.wikipedia.org/wiki/Currency_sign_(typography).\n\t\tif ( ! array_key_exists( $currency, self::CURRENCIES ) ) {\n\t\t\treturn '¤' . number_format_i18n( $price, 2 );\n\t\t}\n\n\t\t$currency_details = self::CURRENCIES[ $currency ];\n\n\t\t// Ensure USD displays as 1234.56 even in non-US locales.\n\t\t$amount = 'USD' === $currency\n\t\t\t? number_format( $price, $currency_details['decimal'], '.', ',' )\n\t\t\t: number_format_i18n( $price, $currency_details['decimal'] );\n\n\t\treturn sprintf(\n\t\t\t$currency_details['format'],\n\t\t\t$symbol ? $currency_details['symbol'] : '',\n\t\t\t$amount\n\t\t);\n\t}", "function formatPrice($value){\n if(!$value==null){\n return number_format($value,2,\",\",\".\");\n }else{\n return 0;\n }\n}" ]
[ "0.71813583", "0.6992939", "0.6791553", "0.6649624", "0.6386856", "0.6373298", "0.6350292", "0.62891805", "0.6274551", "0.61487305", "0.61049587", "0.60918707", "0.6001892", "0.59939593", "0.5991738", "0.598432", "0.59681904", "0.591627", "0.5889093", "0.587487", "0.5854422", "0.58480364", "0.5833446", "0.5788514", "0.5782859", "0.5771851", "0.5762696", "0.57533216", "0.5744233", "0.5728272" ]
0.73841107
0
Returns the length of the given string, or null if not a valid UTF8 string.
private function getLength(string $string) : ?int { if (extension_loaded('mbstring') && ! defined('NO_PHP_EXTENSIONS')) { // constant used for tests if (! mb_check_encoding($string, 'UTF-8')) { return null; } return mb_strlen($string, 'UTF-8'); } $charLength = 0; $length = strlen($string); for ($i = 0; $i < $length; $i++) { $charLength++; $char = ord($string[$i]); if ($char < 0x80) { // 0bbbbbbb continue; } if (($char & 0xE0) === 0xC0) { // 110bbbbb $n = 1; } elseif (($char & 0xF0) === 0xE0) { // 1110bbbb $n = 2; } elseif (($char & 0xF0) === 0xF0) { // 11110bbb $n = 3; } else { // invalid char return null; } for ($j = 0; $j < $n; $j++) { if (++$i === $length) { // unexpected end of string return null; } if ((ord($string[$i]) & 0xC0) !== 0x80) { // does not match 10bbbbbb return null; } } } return $charLength; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function length($string)\n {\n return mb_strlen($string, 'UTF-8');\n }", "private function _strlen ($string) {\n\t\treturn strlen (utf8_decode ($string));\n\t}", "static protected function _strlen ($string) {\n\t\tif ( function_exists(\"mb_strlen\") ) return mb_strlen($string);\n\t\treturn strlen( utf8_decode($string) );\n\t}", "public static function length($string)\n {\n if (function_exists('mb_strlen')) {\n return mb_strlen($string, '8bit');\n }\n return strlen($string);\n }", "public static function length($string)\n {\n if (function_exists('mb_strlen')) {\n return mb_strlen($string);\n }\n\n if (function_exists('iconv_strlen')) {\n return iconv_strlen($string);\n }\n\n return false;\n }", "public function getStringLength($string)\n {\n return $this->hasMbstringSupport ? mb_strlen($string) : strlen($string);\n }", "static function strlen($str) {\n return mb_strlen($str, \"UTF-8\");\n }", "public static function safeStrlen($string)\n {\n if (\\function_exists('mb_strlen')) {\n return \\mb_strlen($string, '8bit');\n }\n return \\strlen($string);\n }", "public static function safeStrLen($str)\n {\n if (function_exists('mb_strlen')\n && function_exists(\n 'mb_detect_encoding'\n )\n ) {\n $length = mb_strlen($str, mb_detect_encoding($str));\n }\n else {\n // iconv will return PHP notice if non-ascii characters are present in input string\n $str = iconv('ASCII', 'ASCII', $str);\n\n $length = strlen($str);\n }\n\n return $length;\n }", "function GetStringLength($string)\n {\n $str_len = mb_strlen($string, \"utf-8\");\n while ($str_len > 0 && \n mb_substr($string, $str_len - 1, 1, \"utf-8\") == \"\\n\")\n {\n --$str_len;\n }\n return($str_len);\n }", "public static function length(string $string) : int {\n\n\t\t\treturn (function_exists('mb_strlen') ? 'mb_strlen' : 'strlen')($string);\n\t\t}", "public function strlen() {\n\t\treturn mb_strlen($this->_string, \"UTF-8\");\n\t}", "function mzz_strlen($str)\n{\n return $GLOBALS['charsetDriver']->strlen($str);\n}", "public function length($string);", "public static function length(string $string, $encoding = null) : int\n {\n $encoding = $encoding ?? static::getEncoding();\n return mb_strlen($string, $encoding);\n }", "public function mb_strlen( $str = '', $encoding = 'UTF-8' ) {\n\t\tif ( $this->has_mb_strlen )\n\t\t\treturn mb_strlen( $str, $encoding );\n\t\telse\n\t\t\treturn preg_match_all( \"/./us\", $str, $match );\n\t}", "protected function strlen(string $string): int\n {\n if (false === $encoding = mb_detect_encoding($string, null, true)) {\n return strlen($string);\n }\n\n return mb_strwidth($string, $encoding);\n }", "function utf8_strlen($s) {\n $c = strlen($s); $l = 0;\n for ($i = 0; $i < $c; ++$i)\n if ((ord($s[$i]) & 0xC0) != 0x80) ++$l;\n return $l;\n }", "public static function length(string $string, string $encoding = 'UTF-8'): int {\n\t\tif ($encoding === '') {\n\t\t\t$encoding = mb_internal_encoding();\n\t\t}\n\t\treturn mb_strlen($string, $encoding);\n\t}", "function utf8_strlen($str) {\r\n\t\t$i = 0; $count = 0; $len = strlen ($str);\r\n\t\twhile ($i < $len) {\r\n\t\t\t$chr = ord ($str[$i]); $count++; $i++;\r\n\t\t \tif ($i >= $len) break;\r\n\t\t\tif ($chr & 0x80) { $chr <<= 1; while ($chr & 0x80) { $i++; $chr <<= 1; } } }\r\n\t\treturn $count; }", "public static function length($string, $encoding = 'UTF-8')\n {\n return mb_strlen($string, $encoding);\n }", "public static function getLength($str)\n {\n return mb_strlen(strip_tags($str), 'UTF-8');\n }", "public static function length(string $value)\r\n {\r\n return mb_strlen($value);\r\n }", "public static function count(string $string, $encoding = null) : int\n {\n return static::length($string, $encoding);\n }", "function safe_strlen($str){\n\tstatic $strlen;\n\tif(! isset($strlen)){ //-- detect environment only once\n\t\tif( function_exists('mb_strlen') && (ini_get('mbstring.func_overload') & 2) ){\n\t\t\t$strlen = create_function('str','return mb_strlen($str,\"8bit\");');\n\t\t}else{\n\t\t\t$strlen = 'strlen';\n\t\t}\n\t}\n\treturn $strlen($str);\n}", "function len() {\n return mb_strlen($this->s);\n }", "protected function stringLength(string $file)\n {\n if (function_exists('mb_strlen')) {\n return mb_strlen($file);\n }\n return strlen($file);\n }", "function MBGetStringLength($s)\n {\n if($this->CurrentFont['type']=='Type0')\n {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; $i++)\n {\n if (ord($s[$i])<128)\n $len++;\n else\n {\n $len++;\n $i++;\n }\n }\n return $len;\n }\n else\n return strlen($s);\n }", "public static function length(string $str): int\n {\n return BaseStringy::create($str)->length();\n }", "function mb_strlen( $str, $enc = '' ) {\n\t\t$counts = count_chars( $str );\n\t\t$total = 0;\n\n\t\t// Count ASCII bytes\n\t\tfor( $i = 0; $i < 0x80; $i++ ) {\n\t\t\t$total += $counts[$i];\n\t\t}\n\n\t\t// Count multibyte sequence heads\n\t\tfor( $i = 0xc0; $i < 0xff; $i++ ) {\n\t\t\t$total += $counts[$i];\n\t\t}\n\t\treturn $total;\n\t}" ]
[ "0.73258424", "0.7302043", "0.72538483", "0.7195062", "0.71142566", "0.706276", "0.70305914", "0.70162445", "0.6932444", "0.6903418", "0.6853852", "0.6812616", "0.67551804", "0.6685213", "0.6681785", "0.65642124", "0.65547055", "0.6460179", "0.63833016", "0.63814235", "0.6335267", "0.63134587", "0.6310543", "0.6152855", "0.6139044", "0.6029036", "0.59761006", "0.5970491", "0.595119", "0.5916596" ]
0.78457314
0
check if real data file is newer than stored in a _data field; if so refresh _data and return true, otherwise false
private function update(){ if( false == is_file( $this->_filename ) ){ return false; } else { $time = filemtime( $this->_filename ); if( $time > $this->_time ){ $this->setData(); $this->_is_updated = true; return true; } else { return false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refresh() {\n\t\t$this->dataCached = FALSE;\n\t\tif ($this->getData() === FALSE)\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "function IsCachedDataOld($dataversion, $current) {\n if ($dataversion < 1)\n return FALSE;\n return $current > $dataversion;\n}", "protected function isFileUpToDate($file)\n {\n if (!file_exists($file)) {\n return false;\n }\n $lastUpdate = filemtime($file);\n $cache = $this->getConfigCache();\n // data not in cache\n if (!($lastVersionTime = $cache->load(self::TIMESTAMP_KEY))) {\n $cache->save($lastUpdate, self::TIMESTAMP_KEY);\n return false;\n }\n if ($lastUpdate > $lastVersionTime) {\n $cache->save($lastUpdate, self::TIMESTAMP_KEY);\n // reload config\n return false;\n }\n // use cache\n return true;\n }", "protected function wasChanged($key)\n {\n return true;\n \n /*$session = new Session();\n $db = new FileDB($key);\n \n if($session->getLastTime($key) < $db->getAsFloat())\n return true;\n else\n return false;*/\n }", "function isOld() : bool {\n // Not yet modified? Not old..\n if (!isset($this->data[\"modified\"])) return false;\n\n $sYesterday = date(\"Y-m-d H:i:s\", strtotime(\"-1 days\"));\n return $this->data[\"modified\"] < $sYesterday;\n }", "public function isFresh()\n {\n if (!is_file($this->file)) {\n return false;\n }\n\n if ($this->debug) {\n return false;\n }\n\n return true;\n }", "private function fileRequiresUpdate($destFile)\n\t{\n\t\t$cacheFile = $this->getCacheFileName($destFile);\n\n\t\tif (!file_exists($cacheFile))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$destFileTime = filemtime($destFile);\n\n\t\t$dependencies = json_decode(file_get_contents($cacheFile));\n\n\t\tforeach ($dependencies as $file => $fileUpdateTime)\n\t\t{\n\t\t\tif (!file_exists($file))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$overridenFile = $this->getOverridenFile($file);\n\n\t\t\tif ($overridenFile)\n\t\t\t{\n\t\t\t\t$file = $overridenFile;\n\t\t\t}\n\n\t\t\t$currentFileTime = filemtime($file);\n\n\t\t\tif ($currentFileTime !== $fileUpdateTime || $currentFileTime > $destFileTime)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function spgm_IsNew($strFilePath) {\n\t\n global $cfg;\n\n spgm_Trace(\n '<p>function spgm_IsNew</p>'.\"\\n\"\n .'strFilePath: '.$strFilePath.'<br />'.\"\\n\"\n );\n\n if (! file_exists($strFilePath) || $cfg['conf']['newStatusDuration'] == 0) return false;\n return (filemtime($strFilePath) > (time()-$cfg['conf']['newStatusDuration']*24*3600));\n}", "public function cacheValid()\n {\n // If files exists And is not expired\n if (file_exists($this->path.$this->name.'.xml') && $this->isExpired() !== true){\n return true;\n }else {\n return false;\n }\n }", "protected function isCacheUpToDate($input, &$path)\n {\n if (is_file($input)) {\n $path = $this->getCachePath(\n ($this->pug->getOption('keepBaseName') ? basename($input) : '') .\n $this->hashPrint(realpath($input))\n );\n\n // Do not re-parse file if original is older\n return (!$this->pug->getOption('upToDateCheck')) || (file_exists($path) && filemtime($input) < filemtime($path));\n }\n\n $path = $this->getCachePath($this->hashPrint($input));\n\n // Do not re-parse file if the same hash exists\n return file_exists($path);\n }", "public function isCacheStale()\n {\n if (!$this->hasCache()) {\n return true;\n }\n\n if (!$this->checkFileModifiedTimes) {\n return false;\n }\n\n $cacheTime = $this->getCacheModifiedTime();\n\n if (!$cacheTime) {\n return true;\n }\n\n $sourceTime = $this->getSourceModifiedTime();\n\n return $cacheTime < $sourceTime;\n }", "public function isFresh($timestamp)\n {\n if (!isset($this->templates) || !isset($this->engine)) {\n return true;\n }\n\n $files = $this->_getFiles();\n if (isset($files)) {\n foreach ($files as $file) {\n if (file_exists($file) && filemtime($file) <= $timestamp === false) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }", "protected function _isModifiedTimeEquals()\n {\n return $this->_config->application->modifyDateTime == filemtime($this->_filePath);\n }", "public function hasChanged() {\n return ($this->_dataModel->getContent() != $this->_dataModel->getOrigContent());\n }", "function getNewData($data) {\n\t\t//Make sure there is a path, otherwise we can do nothing.\n\t\tif(!isset($data['path'])) {\n\t\t\treturn false;\n\t\t}\n\t\t$newData = $data;\n\t\t/**\n\t\t * @var \\OC\\Files\\Storage\\Storage $storage\n\t\t * @var string $internalPath;\n\t\t */\n\t\tlist($storage, $internalPath) = \\OC\\Files\\Filesystem::resolvePath($data['path']);\n\t\tif ($storage) {\n\t\t\t$newData['etag'] = $data['etag'];\n\t\t\t$newData['path_hash'] = md5($internalPath);\n\t\t\t$newData['path'] = $internalPath;\n\t\t\t$newData['storage'] = $this->getNumericId($storage);\n\t\t\t$newData['parent'] = ($internalPath === '') ? -1 : $data['parent'];\n\t\t\t$newData['permissions'] = ($data['writable']) ? \\OCP\\PERMISSION_ALL : \\OCP\\PERMISSION_READ;\n\t\t\t$newData['storage_object'] = $storage;\n\t\t\t$newData['mimetype'] = $this->getMimetypeId($newData['mimetype'], $storage);\n\t\t\t$newData['mimepart'] = $this->getMimetypeId($newData['mimepart'], $storage);\n\t\t\treturn $newData;\n\t\t} else {\n\t\t\t\\OC_Log::write('core', 'Unable to migrate data from old cache for '.$data['path'].' because the storage was not found', \\OC_Log::ERROR);\n\t\t\treturn false;\n\t\t}\n\t}", "public function saveFile($data) {\r\n $filename = $this->config[$this->_filetype . 'Filename'];\r\n if (pathinfo($filename, PATHINFO_EXTENSION) == $this->_filetype) {\r\n $this->_filename = $filename;\r\n if (file_exists($this->getFilePath())) $this->cachedFiles[] = $this->_filename;\r\n } else {\r\n $extension = $this->config[$this->_filetype.'Ext'];\r\n $hash = substr(sha1($data), 0, $this->config['hash_length']);\r\n $this->_filename = $filename . '_' . $hash . $extension;\r\n }\r\n $this->setContent($data);\r\n $this->processHooks($this->config['hooks']);\r\n if (empty($this->_filename)) return false;\r\n $tmp = array_flip($this->cachedFiles);\r\n if (!isset($tmp[$this->_filename]) || $this->config['forceUpdate']) {\r\n if (!file_put_contents($this->getFilePath(), $this->getContent())) {\r\n $this->modx->log(modX::LOG_LEVEL_ERROR, '[MinifyX] Could not save cache file '. $this->config['cacheFolderPath'] . $this->_filename);\r\n return false;\r\n }\r\n if (!isset($tmp[$this->_filename])) $this->cachedFiles[] = $this->_filename;\r\n }\r\n\r\n return file_exists($this->getFilePath());\r\n }", "public function valid()\n {\n if ($this->retrieved) {\n return false !== current($this->updatedDatas);\n } else {\n return parent::valid();\n }\n }", "public function check() {\n if (array_key_exists($this->shortKey, self::$cache) || file_exists($this->fileLock)) {\n return true;\n }\n return (file_exists($this->file) && ($this->cacheTime == -1 || time() - filemtime($this->file) <= $this->cacheTime));\n }", "public function hasUpdated($path, $time) {\n\t\treturn $this->storage->hasUpdated($path, $time);\n\t}", "public function exists() {\n\t\n\t\treturn ($this->mtime !== false) and ($this->mtime !== null);\n\t}", "public function _on_updating() : bool\n {\n $this->timestamp = time();\n return true;\n }", "public function dataFileExists() {\n\t\tif(!file_exists($this->tabFile)) {\n\t\t\terror_log(\"FilemakerProImporter: Data file not found: \".$this->tabFile);\n\t\t\treturn false;\n\t\t} else {\t\n\t\t\treturn true;\n\t\t}\n\t}", "public function hasChanged(array $data);", "public function isUpdated(){\n return $this->_dataArray['updateFlag'] == 'TRUE';\n }", "public function wasModified() {\n\t\t$oldMD5Hash = $currentMD5Hash = '';\n\t\tif (file_exists($this->settings['md5File'])) {\n\t\t\t$oldMD5Hash = file_get_contents($this->settings['md5File']);\n\t\t}\n\n\t\treturn ($oldMD5Hash != $currentMD5Hash);\n\t}", "protected function checkFileIsStale($filepath, $rootFolder) {\n\n if (!file_exists($this->getDestinationFilepath($filepath, $rootFolder))) {\n return true;\n }\n\n $sourceTime = filemtime($this->getOriginFilePath($filepath, $rootFolder));\n $destinationTime = filemtime($this->getDestinationFilepath($filepath, $rootFolder));\n\n //check to see if there is a newer file placed on server\n return $sourceTime > $destinationTime;\n }", "public function hasLastUpdateTime(){\n return $this->_has(3);\n }", "function _checkCache ($tmplfile) {\r\n $this->_cachefile = $this->_getFilename($tmplfile);\r\n if ($this->_clearcache) {\r\n if (file_exists($this->_cachefile)) unlink($this->_cachefile);\r\n return false;\r\n }\r\n\r\n if (file_exists($this->_cachefile)) {\r\n $this->_cacheexists = 1;\r\n\r\n // if it's expired\r\n if ((filemtime($this->_cachefile) + $this->OPTIONS['CACHE_LIFETIME']) < date ('U')\r\n || filemtime($this->_cachefile) < filemtime($tmplfile)) {\r\n $this->_cacheexists = 0;\r\n return false; // so that we know to recache\r\n }\r\n else {\r\n return true;\r\n }\r\n\r\n } else {\r\n $this->_cacheexists = 0;\r\n return false;\r\n }\r\n }", "protected function isLogFileChanged(): bool\n {\n if (!$this->logFile) {\n return false;\n }\n\n // log file isn't opened yet\n if (!is_resource($this->logHandle)) {\n return true;\n }\n\n // advanced checks are slower since it has to stat the filesystem on every call.\n // todo maybe use a frequency to only do this once in X calls\n if ($this->advancedLogChecks) {\n clearstatcache(true, $this->logFile);\n\n // if it doesn't exist it was deleted/renamed since our last call but wasn't rotated yet.\n if (!file_exists($this->logFile)) {\n return true;\n }\n\n $stat = @stat($this->logFile);\n if ($stat) {\n if ($this->logNode !== 0) {\n // iNode was changed so the filename was most likely renamed/rotated\n if ($stat['ino'] != $this->logNode) {\n return true;\n }\n }\n\n // checking file size (mainly for windows); If the current log file size when it was opened is now\n // todo; this only seems to work once on the same file ... need more testing\n if ($stat['size'] < $this->logSize) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function updateDataDetail($data) {\n\t\t$status = false;\n\t\tif (count ( $data ) > 0) {\n\t\t\tif ($this->deleteDataDetail ()) {\n\t\t\t\tif ($this->createDataDetail ( $data )) {\n\t\t\t\t\t$status = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}" ]
[ "0.7098471", "0.6618222", "0.65914124", "0.64152324", "0.6282605", "0.61768776", "0.61429024", "0.6136498", "0.61149406", "0.60349834", "0.60307604", "0.59926426", "0.5991327", "0.5972052", "0.5963133", "0.5951925", "0.59422857", "0.5940029", "0.59250534", "0.59157705", "0.5909137", "0.5906948", "0.5905944", "0.59052116", "0.5902216", "0.58828074", "0.5874771", "0.5862274", "0.58465636", "0.58388174" ]
0.8056705
0
Get the value of nik
public function getNik() { return $this->nik; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNik()\n {\n return $this->nik;\n }", "function getNVal() {\n\t\treturn $this->getProperty ( \"n_val\" );\n\t}", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}" ]
[ "0.7355345", "0.6842075", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6624564", "0.6468513", "0.6468513", "0.6468513", "0.6468513", "0.6468513", "0.6468513" ]
0.7292298
1
Get the value of tanggal
public function getTanggal() { return $this->tanggal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function new_get_tanggal()\n\t{\n\t\t$case_type = $this->input->post('case_type');\n\t\t$case_status = $this->input->post('case_status');\n\t\t$payment_by = $this->input->post('payment_by');\n\t\t$user = '';\n\n\t\techo $this->new_case->get_tanggal($case_type, $case_status, $payment_by, $user);\n\t}", "public function get_tanggal($jenis)\n\t{\n\t\treturn $this->db->select('gp.tanggal')\n\t\t\t\t\t\t\t\t\t\t->from('garbage_price gp')\n\t\t\t\t\t\t\t\t\t\t->join('garbage_list gl','gl.id = gp.jenis')\n\t\t\t\t\t\t\t\t\t\t->where('gl.nama',$jenis)\n\t\t\t\t\t\t\t\t\t\t->order_by('gp.tanggal','DESC')\n\t\t\t\t\t\t\t\t\t\t->limit(2,0)\n\t\t\t\t\t\t\t\t\t\t->get()\n\t\t\t\t\t\t\t\t\t\t->result_array();\n\t}", "public function calc_btu($gal,$deltaT)\n\t{\n\t\treturn $gal * 8.33 * $deltaT;\n\t}", "function tanggal_indonesia($tanggal) {\n\n\t$format = array(\n\t\t\t'Sun' => 'Minggu',\n\t\t\t'Mon' => 'Senin',\n\t\t\t'Tue' => 'Selasa',\n\t\t\t'Wed' => 'Rabu',\n\t\t\t'Thu' => 'Kamis',\n\t\t\t'Fri' => 'Jumat',\n\t\t\t'Sat' => 'Sabtu',\n\t\t\t'Jan' => 'Januari',\n\t\t\t'Feb' => 'Februari',\n\t\t\t'Mar' => 'Maret',\n\t\t\t'Apr' => 'April',\n\t\t\t'May' => 'Mei',\n\t\t\t'Jun' => 'Juni',\n\t\t\t'Jul' => 'Juli',\n\t\t\t'Aug' => 'Agustus',\n\t\t\t'Sep' => 'September',\n\t\t\t'Oct' => 'Oktober',\n\t\t\t'Nov' => 'November',\n\t\t\t'Dec' => 'Desember'\n\t);\n\n\treturn strtr($tanggal, $format);\n}", "function ubahformatTgl($tanggal) {\n\t\t\t$pisah = explode('/',$tanggal);\n\t\t\t$urutan = array($pisah[2],$pisah[1],$pisah[0]);\n\t\t\t$satukan = implode('-',$urutan);\n\t\t\treturn $satukan;\n\t\t}", "public function chartthn() //Menampilkan data per tahun\n {\n $tahun = array();\n\n $this->db->select('SUM(jumlahkids) as kid','year(tgljadi)');\n $this->db->from('kiddiejadi');\n $this->db->group_by('year(tgljadi)');\n\n $query = $this->db->get();\n\n if ($query->num_rows() > 0) {\n $tahun = $query->result();\n }\n return $tahun;\n }", "function ubah_tgl($tanggal) {\n\t$pisah = explode('/',$tanggal);\n\t$larik = array($pisah[2], $pisah[0], $pisah[1]);\n\t$satukan = implode('-', $larik);\n\treturn $satukan;\n}", "function tunjangan ($gaji)\r\n{\r\n\t$tjg = (15/100);\r\n\t$hasil = $gaji * $tjg;\r\n\treturn $hasil;\r\n}", "function get_data_graf4(){\n $query =$this->db->query(\"SELECT Sum(zaplatene) as suma,p.meno FROM kalendar k INNER JOIN pouzivatelia p on k.Pouzivatelia_idPouzivatelia=p.idPouzivatelia GROUP by p.meno\");\n return $query->result();\n }", "public function hitung_luas (){\n Return $this->alas * $this->tinggi;\n }", "public function get_trans_by_tgl($tanggal_transaki)\n {\n # field yg tampil\n $field = \"$this->table1.id_transaksi AS transID,\";\n $field .= \"$this->table1.jumlah_sample AS sampleCount,\";\n $field .= \"$this->table1.tanggal_transaksi AS transDate\";\n \n $data = $this->db\n ->select($field)\n ->from($this->table1)\n ->where(\n array(\n 'id_divisi'=> $this->divisi,\n 'DATE(tanggal_transaksi)'=> $tanggal_transaki,\n )\n )\n ->order_by('tanggal_transaksi', 'DESC')\n ->get()->result();\n \n return $data;\n }", "public function getChart1()\n\t\t{\n\t\t\t\n\t\t\t$data = $this->db->query(\"SELECT * FROM tb_karyawan\");\n\t\t\treturn $data->result();\n\n\t\t}", "public function tanggal_indonesia($tanggal)\n {\n $nama_hari = [1 => 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu', 'Minggu'];\n $nama_bulan = [1 => 'Januari', 'Februari', 'Maret', 'April', 'Mei','Juni' ,'Juli', 'Agustus','September','Oktober', 'November', 'Desember'];\n $tanggal_split = explode('-', $tanggal);\n $tanggal_output = $tanggal_split[0].\"/\".$nama_bulan[(int)$tanggal_split[1]].\"/\".$nama_hari[(int)$tanggal_split[3]].\"-\".$tanggal_split[2].\"/\";\n\n return $tanggal_output;\n }", "public function cetak($tanggal)\r\n {\r\n\r\n $sql2 = \"SELECT * FROM input_permohonan_kh_lab_parasit WHERE tanggal_acu_permohonan BETWEEN '$tanggal' AND '$tanggal' GROUP BY tanggal_acu_permohonan\";\r\n\r\n $query2 = $this->db->query($sql2) or die($this->db->error);\r\n\r\n return $query2;\r\n\r\n }", "function Tangent($angle)\n{\n $tangent = tan(deg2rad($angle));\n return $tangent; \n}", "public function tanggalId(){\n\t\tfunction bulanId($bln){\n\t\t\tswitch ($bln) {\n\t\t\t\tcase 1: \n\t\t\t\treturn \"Januari\";\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\treturn \"Februari\";\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\treturn \"Maret\";\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\treturn \"April\";\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\treturn \"Mei\";\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\treturn \"Juni\";\n\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\treturn \"Juli\";\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\treturn \"Agustus\";\n\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\treturn \"September\";\n\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\treturn \"Oktober\";\n\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\treturn \"November\";\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn \"Desember\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfunction bulanRomawi($bln){\n\t\t\tswitch ($bln) {\n\t\t\t\tcase 1: \n\t\t\t\treturn \"I\";\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\treturn \"II\";\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\treturn \"III\";\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\treturn \"IV\";\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\treturn \"V\";\n\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\treturn \"VI\";\n\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\treturn \"VII\";\n\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\treturn \"VIII\";\n\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\treturn \"IX\";\n\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\treturn \"X\";\n\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\treturn \"XI\";\n\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\treturn \"XII\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfunction dateId($date) {\n\t\t\t$temp_date = explode(\"-\", $date);\n\t\t\t$day = date_format(date_create($date), 'D');\n\t\t\t$hari = '';\n\t\t\tswitch ($day) {\n\t\t\t\tcase \"Mon\": \n\t\t\t\t$hari = \"Senin\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Tue\":\n\t\t\t\t$hari = \"Selasa\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Wed\":\n\t\t\t\t$hari = \"Rabu\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Thu\":\n\t\t\t\t$hari = \"Kamis\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Fri\":\n\t\t\t\t$hari = \"Jumat\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Sat\":\n\t\t\t\t$hari = \"Sabtu\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Sun\":\n\t\t\t\t$hari = \"Minggu\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$tanggal = $temp_date[0];\n\t\t\t$bulan = bulanId($temp_date[1]);\n\t\t\t$tahun = $temp_date[2];\n\t\t\treturn $hari.\", \".$tanggal.\" \".$bulan.\" \".$tahun;\n\t\t}\n\t\tfunction dateRomawi($date) {\n\t\t\t$temp_date = explode(\"-\", $date);\n\t\t\t$day = date_format(date_create($date), 'D');\n\t\t\t$hari = '';\n\t\t\tswitch ($day) {\n\t\t\t\tcase \"Mon\": \n\t\t\t\t$hari = \"Senin\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Tue\":\n\t\t\t\t$hari = \"Selasa\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Wed\":\n\t\t\t\t$hari = \"Rabu\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Thu\":\n\t\t\t\t$hari = \"Kamis\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Fri\":\n\t\t\t\t$hari = \"Jumat\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Sat\":\n\t\t\t\t$hari = \"Sabtu\";\n\t\t\t\tbreak;\n\t\t\t\tcase \"Sun\":\n\t\t\t\t$hari = \"Minggu\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$tanggal = $temp_date[0];\n\t\t\t$bulan = bulanRomawi($temp_date[1]);\n\t\t\t$tahun = $temp_date[2];\n\t\t\treturn $bulan;\n\t\t}\n\t}", "function tertanggal($tanggal)\n {\n setlocale(LC_TIME, 'id_ID.utf8', 'id_ID.UTF-8', 'id_ID', 'id');\n\n $tanggal = preg_replace('/januari/i', 'jan', $tanggal);\n $tanggal = preg_replace('/februari|febuari|pebruari|pebuari|peb/i', 'feb', $tanggal);\n $tanggal = preg_replace('/maret/i', 'mar', $tanggal);\n $tanggal = preg_replace('/april/i', 'apr', $tanggal);\n $tanggal = preg_replace('/mei/i', 'may', $tanggal);\n $tanggal = preg_replace('/juni/i', 'jun', $tanggal);\n $tanggal = preg_replace('/juli/i', 'jul', $tanggal);\n $tanggal = preg_replace('/agustus|ags|agu/i', 'aug', $tanggal);\n $tanggal = preg_replace('/oktober|okt/i', 'oct', $tanggal);\n $tanggal = preg_replace('/desember|des/i', 'dec', $tanggal);\n\n $d = new DateTime($tanggal);\n\n $hasil = 'tanggal ' . terbilang($d->format('d'));\n $hasil .= ' bulan ' . strftime('%B', $d->getTimestamp());\n $hasil .= ' tahun ' . terbilang($d->format('Y'));\n\n // bentuk bakunya ada februari, bukan pebruari\n // https://kbbi.kemdikbud.go.id/entri/februari\n $hasil = preg_replace('/peb/i', 'feb', $hasil);\n $hasil = preg_replace('/pebruari|pebuari/i', 'februari', $hasil);\n\n return strtolower($hasil);\n }", "public function luassegitiga()\n {\n \n return ($this-> alas * $this-> tinggi / 2);\n }", "function tampil_pengajuan(){\r\n return $this->db->query(\"SELECT *, DATE_FORMAT(tanggal, '%d/%m/%Y') AS pelaksanaan, DATE_FORMAT(tanggal_selesai, '%d/%m/%Y') AS selesai, DATE_FORMAT(tgl_upload, '%d/%m/%Y %T') AS tanggal_upload FROM pengajuan WHERE pengajuan.id_kabkota='\".$_SESSION['id_kabkota'].\"'\");\r\n }", "public function getAmountChartData()\n {\n return $this->_get(self::AMOUNT_CHART);\n }", "function zakat_tarif_bulanan()\n\t\t{\n\t\t\treturn $this->db->query(\"SELECT (SUM(tarif) ) as zakat_tarif FROM kunjungan WHERE month(tgl_kunjungan) = 12 AND year(tgl_kunjungan) = 2019\")->result();\n\n\t\t}", "public function getValor();", "function detailchart($tgl, $tgl2, $kota){\n $sql =\"select total, airlines, tanggal from printingdocument where airlines!='TOTAL' and tanggal between '$tgl' and '$tgl2' and kota='$kota' order by tanggal, airlines\";\n $query = $this->db->query($sql);\n\n return $query;\n\n\n }", "function InggrisTgl($tanggal){\n\t$tgl=substr($tanggal,0,2);\n\t$bln=substr($tanggal,3,2);\n\t$thn=substr($tanggal,6,4);\n\t$awal=\"$thn-$bln-$tgl\";\n\treturn $awal;\n}", "public function getTahunAktif(){\n $results = array();\n $query = \"SELECT DISTINCT YEAR(tanggal) as TAHUN FROM harga_distribusi;\";\n $hasil = $this->db->query($query);\n if ($hasil->num_rows() > 0) {\n $results = $hasil->result();\n }\n return $results;\n }", "function InggrisTgl($tanggal){\n\t$tgl=substr($tanggal,0,2);\n\t$bln=substr($tanggal,3,2);\n\t$thn=substr($tanggal,6,4);\n\t$tanggal=\"$thn-$bln-$tgl\";\n\treturn $tanggal;\n}", "function tgl_indo($tanggal){ //dipecah ke dalam bentuk \n $bulan = array (\n 1 => 'Januari', //cukup index pertama saja yang diberi key itu sudah bisa mengartikan key index selanjutnya\n 'Februari',\n 'Maret',\n 'April',\n 'Mei',\n 'Juni',\n 'Juli',\n 'Agustus',\n 'September',\n 'Oktober',\n 'November',\n 'Desember'\n );\n $pecahkan = explode('-', $tanggal);\n \n return $pecahkan[2] . ' ' . $bulan[ (int)$pecahkan[1] ] . ' ' . $pecahkan[0];\n }", "public function getToatalValue()\n {\n return $this->totalvalue;\n }", "public function getTarjeta();", "function IndonesiaTgl($tanggal){\n\t$tgl=substr($tanggal,8,2);\n\t$bln=substr($tanggal,5,2);\n\t$thn=substr($tanggal,0,4);\n\t$tanggal=\"$tgl-$bln-$thn\";\n\treturn $tanggal;\n}" ]
[ "0.64700234", "0.6232873", "0.59606326", "0.5921584", "0.5914776", "0.5881857", "0.5857073", "0.5832791", "0.5818629", "0.5789867", "0.5779114", "0.57560277", "0.5694965", "0.567111", "0.5662953", "0.5634416", "0.5597341", "0.55680317", "0.55656296", "0.55499595", "0.5533934", "0.552252", "0.5490014", "0.548817", "0.5483857", "0.5474834", "0.54385734", "0.54359525", "0.5426276", "0.54182595" ]
0.7069413
0
Return the paginator params for the list action.
protected function getPaginatorParams() : array { $params = array(); $range = $this->getParam('range', static::PAGE_RANGE); $count = $this->getParam('count', static::ITEM_COUNT_PER_PAGE); $params['pageRange'] = $range; $params['currentPageNumber'] = $this->getParam('page', 1); $params['itemCountPerPage'] = $count; return $params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function si_exhibition_get_pager_parameters() {\n $show = isset($_GET['show']) ? $_GET['show'] : 'all';\n $sort = isset($_GET['sort']) ? $_GET['sort'] : 'asc';\n $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;\n $page = isset($_GET['page']) ? $_GET['page'] : 0;\n return array($show, $sort, $limit, $page);\n}", "public function getPageParameters()\n {\n $page = isset($this->get['page']) ? $this->get['page'] : 0;\n $perPage = isset($this->get['perPage']) ? $this->get['perPage'] : 10;\n\n return compact('page', 'perPage');\n }", "public function get_collection_params() {\n\t\t$params = array();\n\t\t$params['context'] = $this->get_context_param();\n\t\t$params['context']['default'] = 'view';\n\n\t\t$params['page'] = array(\n\t\t\t'description' => __( 'Current page of the collection.', 'woocommerce' ),\n\t\t\t'type' => 'integer',\n\t\t\t'default' => 1,\n\t\t\t'sanitize_callback' => 'absint',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t\t'minimum' => 1,\n\t\t);\n\n\t\t$params['per_page'] = array(\n\t\t\t'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),\n\t\t\t'type' => 'integer',\n\t\t\t'default' => 10,\n\t\t\t'minimum' => 1,\n\t\t\t'maximum' => 100,\n\t\t\t'sanitize_callback' => 'absint',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['search'] = array(\n\t\t\t'description' => __( 'Limit results to those matching a string.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['after'] = array(\n\t\t\t'description' => __( 'Limit response to resources created after a given ISO8601 compliant date.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'format' => 'date-time',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['before'] = array(\n\t\t\t'description' => __( 'Limit response to resources created before a given ISO8601 compliant date.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'format' => 'date-time',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['date_column'] = array(\n\t\t\t'description' => __( 'When limiting response using after/before, which date column to compare against.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'default' => 'date',\n\t\t\t'enum' => array(\n\t\t\t\t'date',\n\t\t\t\t'date_gmt',\n\t\t\t\t'modified',\n\t\t\t\t'modified_gmt',\n\t\t\t),\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['exclude'] = array(\n\t\t\t'description' => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default' => array(),\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t);\n\n\t\t$params['include'] = array(\n\t\t\t'description' => __( 'Limit result set to specific ids.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'default' => array(),\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t);\n\n\t\t$params['offset'] = array(\n\t\t\t'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),\n\t\t\t'type' => 'integer',\n\t\t\t'sanitize_callback' => 'absint',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['order'] = array(\n\t\t\t'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'default' => 'desc',\n\t\t\t'enum' => array( 'asc', 'desc' ),\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['orderby'] = array(\n\t\t\t'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'default' => 'date',\n\t\t\t'enum' => array(\n\t\t\t\t'date',\n\t\t\t\t'modified',\n\t\t\t\t'id',\n\t\t\t\t'include',\n\t\t\t\t'title',\n\t\t\t\t'slug',\n\t\t\t\t'price',\n\t\t\t\t'popularity',\n\t\t\t\t'rating',\n\t\t\t\t'menu_order',\n\t\t\t\t'comment_count',\n\t\t\t),\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['parent'] = array(\n\t\t\t'description' => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t'default' => array(),\n\t\t);\n\n\t\t$params['parent_exclude'] = array(\n\t\t\t'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t),\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t'default' => array(),\n\t\t);\n\n\t\t$params['type'] = array(\n\t\t\t'description' => __( 'Limit result set to products assigned a specific type.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => array_keys( wc_get_product_types() ),\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['sku'] = array(\n\t\t\t'description' => __( 'Limit result set to products with specific SKU(s). Use commas to separate.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['featured'] = array(\n\t\t\t'description' => __( 'Limit result set to featured products.', 'woocommerce' ),\n\t\t\t'type' => 'boolean',\n\t\t\t'sanitize_callback' => 'wc_string_to_bool',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['category'] = array(\n\t\t\t'description' => __( 'Limit result set to products assigned a specific category ID.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['category_operator'] = array(\n\t\t\t'description' => __( 'Operator to compare product category terms.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => [ 'in', 'not in', 'and' ],\n\t\t\t'default' => 'in',\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['tag'] = array(\n\t\t\t'description' => __( 'Limit result set to products assigned a specific tag ID.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['tag_operator'] = array(\n\t\t\t'description' => __( 'Operator to compare product tags.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => [ 'in', 'not in', 'and' ],\n\t\t\t'default' => 'in',\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['on_sale'] = array(\n\t\t\t'description' => __( 'Limit result set to products on sale.', 'woocommerce' ),\n\t\t\t'type' => 'boolean',\n\t\t\t'sanitize_callback' => 'wc_string_to_bool',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['min_price'] = array(\n\t\t\t'description' => __( 'Limit result set to products based on a minimum price.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['max_price'] = array(\n\t\t\t'description' => __( 'Limit result set to products based on a maximum price.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['stock_status'] = array(\n\t\t\t'description' => __( 'Limit result set to products with specified stock status.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => array_keys( wc_get_product_stock_status_options() ),\n\t\t\t'sanitize_callback' => 'sanitize_text_field',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['attributes'] = array(\n\t\t\t'description' => __( 'Limit result set to products with selected global attributes.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'attribute' => array(\n\t\t\t\t\t\t'description' => __( 'Attribute taxonomy name.', 'woocommerce' ),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'sanitize_callback' => 'wc_sanitize_taxonomy_name',\n\t\t\t\t\t),\n\t\t\t\t\t'term_id' => array(\n\t\t\t\t\t\t'description' => __( 'List of attribute term IDs.', 'woocommerce' ),\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t\t\t\t),\n\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t'description' => __( 'List of attribute slug(s). If a term ID is provided, this will be ignored.', 'woocommerce' ),\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'sanitize_callback' => 'wp_parse_slug_list',\n\t\t\t\t\t),\n\t\t\t\t\t'operator' => array(\n\t\t\t\t\t\t'description' => __( 'Operator to compare product attribute terms.', 'woocommerce' ),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'enum' => [ 'in', 'not in', 'and' ],\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'default' => array(),\n\t\t);\n\n\t\t$params['attribute_relation'] = array(\n\t\t\t'description' => __( 'The logical relationship between attributes when filtering across multiple at once.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => [ 'in', 'and' ],\n\t\t\t'default' => 'and',\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['catalog_visibility'] = array(\n\t\t\t'description' => __( 'Determines if hidden or visible catalog products are shown.', 'woocommerce' ),\n\t\t\t'type' => 'string',\n\t\t\t'enum' => array( 'any', 'visible', 'catalog', 'search', 'hidden' ),\n\t\t\t'sanitize_callback' => 'sanitize_key',\n\t\t\t'validate_callback' => 'rest_validate_request_arg',\n\t\t);\n\n\t\t$params['rating'] = array(\n\t\t\t'description' => __( 'Limit result set to products with a certain average rating.', 'woocommerce' ),\n\t\t\t'type' => 'array',\n\t\t\t'items' => array(\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'enum' => range( 1, 5 ),\n\t\t\t),\n\t\t\t'default' => array(),\n\t\t\t'sanitize_callback' => 'wp_parse_id_list',\n\t\t);\n\n\t\treturn $params;\n\t}", "private function setPaginationDefaultParameters()\n {\n $limit = request()->get('limit', 50);\n $page = request()->get('page', 0);\n $orderBy = request()->get('order_by');\n $orderByMode = request()->get('order_by_mode');\n $search = request()->get('search');\n\n if (!is_numeric($page) or ($page < 1) or empty($page)) $page = 1;\n if (!is_numeric($limit) or ($limit < 10) or ($limit > 500)) $limit = 50;\n if (empty($orderBy)) $orderBy = null;\n if (empty($orderByMode)) $orderByMode = null;\n if (empty($search)) $search = null;\n\n return [\n 'limit' => $limit,\n 'page' => $page,\n 'order_by' => $orderBy,\n 'order_by_mode' => $orderByMode,\n 'search' => $search,\n ];\n }", "public function getListUrlParameters();", "public function get_collection_params() {\n\t\treturn array();\n\t}", "public function get_collection_params() {\n return [];\n }", "public function get_collection_params() {\n\t\treturn array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t}", "public function get_collection_params() {\n\t\treturn array(\n\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t);\n\t}", "public function getParamsListToInject() : array {\n return [\n 'items',\n 'title'\n ];\n }", "public function get_collection_params() : array {\n\t\t$query_params = parent::get_collection_params();\n\t\t$query_params['context']['default'] = 'view';\n\t\tunset( $query_params['search'] );\n\t\treturn $query_params;\n\t}", "public static function listParams() {\n\t\t\t$params = array();\n\n\t\t\t// It's no fun without Symphony\n\t\t\tif (!defined('TOOLKIT') || !class_exists('Symphony') || !Symphony::Database()) return $params;\n\n\t\t\t// Get page params\n\t\t\t$pages = Symphony::Database()->fetch('SELECT params FROM tbl_pages WHERE params IS NOT NULL');\n\t\t\tif (is_array($pages) && !empty($pages)) {\n\t\t\t\tforeach ($pages as $page => $data) {\n\t\t\t\t\tif (($data = trim($data['params']))) {\n\t\t\t\t\t\tforeach (explode('/', $data) as $p) {\n\t\t\t\t\t\t\t$params['$'.$p] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get datasource generated params\n\t\t\tif (!class_exists('DatasourceManager')) {\n\t\t\t\trequire_once(TOOLKIT . '/class.datasourcemanager.php');\n\t\t\t}\n\t\t\tforeach (DatasourceManager::listAll() as $name => $info) {\n\t\t\t\t$ds = DatasourceManager::create($name, NULL, false);\n\t\t\t\t// Support Symphony's section fields\n\t\t\t\tif (isset($ds->dsParamPARAMOUTPUT) && !empty($ds->dsParamPARAMOUTPUT)) {\n\t\t\t\t\tif (!is_array($ds->dsParamPARAMOUTPUT)) $params['$ds-'.$ds->dsParamROOTELEMENT] = $ds->dsParamPARAMOUTPUT;\n\t\t\t\t\telse {\n\t\t\t\t\t\tforeach ($ds->dsParamPARAMOUTPUT as $field) {\n\t\t\t\t\t\t\t$params['$ds-'.$ds->dsParamROOTELEMENT.'.'.$field] = $field;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Support Parametrisator's xpaths\n\t\t\t\tif (isset($ds->dsParamParametrisator) && is_array($ds->dsParamParametrisator) && isset($ds->dsParamParametrisator['xpaths'])) {\n\t\t\t\t\tforeach ($ds->dsParamParametrisator['xpaths'] as $name => $xpath) {\n\t\t\t\t\t\t$params['$ds-'.$ds->dsParamROOTELEMENT.'-'.$name] = $name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $params;\n\t\t}", "private function getManagerParams() {\r\n $params = array(\r\n 'show_create_button' => false,\r\n 'show_mass_update' => false,\r\n 'show_tabs' => false,\r\n 'show_filter' => false,\r\n 'show_help' => false,\r\n 'custom_title_html' => translate(self::LIST_TITLE),\r\n 'hide_navigation_controls' => true,\r\n 'no_sort' => true,\r\n 'default_list_limit' => self::NO_LIMIT\r\n );\r\n\r\n return $params;\r\n }", "public function getParamsListToInject() : array\n {\n return [\n 'sectionTitle',\n 'sectionSubtitle',\n 'layout',\n 'isFlat',\n 'panels',\n 'button'\n ];\n }", "public function getPaginate(){ }", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function listPaginate(Paginator $paginator, array $search_field = null, $page = 1);", "public function getPaginator();", "private function getParamsFromRequest() {\n if (isset($_GET['page'])) {\n $this->currentpage = $_GET['page'];\n } else {\n //else set default page to render\n $this->currentpage = 1;\n }\n //If limit is defined in URL\n if (isset($_GET['limit'])) {\n $this->limit = $_GET['limit'];\n } else { //else set default limit to 20\n $this->limit = 50;\n }\n //If currentpage is set to null or is set to 0 or less\n //set it to default (1)\n if (($this->currentpage == null) || ($this->currentpage < 1)) {\n $this->currentpage = 1;\n }\n //if limit is set to null set it to default (50)\n if (($this->limit == null)) {\n $this->limit = 50;\n //if limit is any number less than 1 then set it to 0 for displaying\n //items without limit\n } else if ($this->limit < 1) {\n $this->limit = 0;\n }\n }", "public function paginate()\n {\n $param = $this->query->get('paginate', []);\n\n switch (count($param)) {\n case 0:\n return null;\n break;\n case 1:\n $page = 1;\n $per_page = $param[0];\n break;\n case 2:\n $page = $param[0];\n $per_page = $param[1];\n break;\n }\n\n return [\n 'page' => (int) $page,\n 'per_page' => (int) $per_page\n ];\n }", "private function getParams()\n {\n return array('playlistId' => $this->playlistId, 'maxResults' => $this->maxResults);\n }", "public function paginatedListAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n try {\n //Get parameters\n $request = $this->get('request');\n $limit = $request->get('limit');\n $offset = $request->get('offset');\n $order = $request->get('order');\n $search = $request->get('search');\n $sort = $request->get('sort');\n $em = $this->getDoctrine()->getManager();\n $usr= $this->get('security.context')->getToken()->getUser();\n $paginator = $em->getRepository('TecnotekAsiloBundle:User')\n ->getListWithFilter($offset, $limit, $search, $sort, $order, $usr->getId());\n\n $results = array();\n foreach($paginator as $user){\n array_push($results, array('id' => $user->getId(),\n 'name' => $user->getName(),\n 'lastname' => $user->getLastname(),\n 'username' => $user->getUsername(),\n 'email' => $user->getEmail(),\n 'cellPhone' => $user->getCellPhone(),\n 'isActive' => $user->isActive(),\n 'username' => $user->getUsername()));\n }\n return new Response(json_encode(array('total' => count($paginator),\n 'rows' => $results)));\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::paginatedListAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'message' => $info)));\n }\n }", "public function getPerPage();", "public function getPerPage();", "public function get_params()\n {\n return $this->params;\n }", "public function get_params() {\n\n\t\treturn array( 'fields' => 'name,link' );\n\t}", "protected function getParameters() {\n\n\t\t// get standard parameters form tx_ptmvc_controllerFrontend class\n\t\tparent::getParameters();\n\n\t\ttx_pttools_assert::isNotEmptyString($this->listPrefix, array('message' => 'No \"listPrefix\" found.'));\n\n\t\t// merge parameters\n\t\tif (t3lib_div::compat_version('4.3')) {\n\t\t\t$this->listPrefixParams = t3lib_div::_GPmerged($this->listPrefix);\n\t\t} else {\n\t\t\t$this->listPrefixParams = t3lib_div::GParrayMerged($this->listPrefix);\n\t\t}\n\n\t\t$this->params = t3lib_div::array_merge_recursive_overrule($this->listPrefixParams, $this->params);\n\t}", "protected function paginate()\n {\n if (! is_null($this->request->get('start'))) {\n $this->query()\n ->skip($this->request->get('start'))\n ->take($this->request->get('length', $this->config->get('laratables.defaultLength')));\n }\n }", "public function getListPaginate($perPage = 10, ...$params)\n {\n $resultModel = $this->getModel();\n // foreach condition\n if(count($params) > 0){\n foreach ($params as $key => $statement) {\n $condition = $statement[0];\n $operator = (in_array($statement[1], $this->operators) ? $statement[1] : '=');\n $value = (in_array($statement[1], $this->operators) ? $statement[2] : $statement[1]);\n $clause = isset($statement[3]) ? $statement[3] : 'and';\n $relation = isset($statement[4]) ? $statement[4] : '';\n $id = isset($statement[5]) ? $statement[5] : '';\n $resultModel = $this->getData($resultModel, $condition,$operator,$value,$clause,$relation,$id);\n }\n }\n // return paginate\n return $resultModel->paginate($perPage);\n }" ]
[ "0.7214929", "0.6994178", "0.6627524", "0.6575555", "0.6572815", "0.64489895", "0.6444318", "0.63676476", "0.63676476", "0.6355278", "0.6338775", "0.6327109", "0.63128394", "0.61905944", "0.6155817", "0.6150205", "0.6150205", "0.6137021", "0.6121533", "0.61022824", "0.60958695", "0.60923386", "0.608599", "0.60731375", "0.60731375", "0.602002", "0.60166943", "0.60136783", "0.6005842", "0.59972817" ]
0.74772686
0
Set service manager instance
public function setServiceManager(ServiceManager $serviceManager) { $this->sm = $serviceManager; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setServiceManager(ServiceManager $sm){\n\t\tif(!$this->serviceManager)\n\t\t\t$this->serviceManager = $sm;\n\t\treturn $this;\n\t}", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->sm = $serviceManager;\n }", "public static function setServiceManager(ServiceManager $serviceManager)\n {\n // store service manager instance\n static::$serviceManager = $serviceManager;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n }", "public function setServiceManager(ContainerInterface $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n }", "public function setManager( $manager ) { // most likely User $manager = null\n\t\t$this->manager = $manager;\n\t}", "protected function createInstanceManager()\n {\n $this->instance_manager = new GoogleInstanceManager($this);\n }", "public function setServiceManager(ServiceManager $serviceManager)\r\n {\r\n $this->serviceManager = $serviceManager;\r\n return $this;\r\n }", "public function setServiceManager(ServiceManager $serviceManager)\r\n {\r\n $this->serviceManager = $serviceManager;\r\n return $this;\r\n }", "public function options_manager(){\n $this->options_manager = OptionsManager::get_instance( $this );\n }", "public static function setInstance(ObjectManager $objectManager)\n {\n self::$instance = $objectManager;\n }", "private function registerManager(): void\n {\n $this->app->singleton('digitalocean', function (Container $app): DigitalOceanManager {\n $config = $app['config'];\n $factory = $app['digitalocean.factory'];\n\n return new DigitalOceanManager($config, $factory);\n });\n\n $this->app->alias('digitalocean', DigitalOceanManager::class);\n }", "public function setManager(?ObjectManager $manager): void\n {\n if (empty($this->em) && $manager !== null) {\n $this->em = $manager;\n }\n }", "public function setService(Service $service): self;", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n return $this;\n }", "public static function setInstance(AppObjectManager $appObjectManager)\r\n {\r\n self::$instance = $appObjectManager;\r\n }", "protected function setupManager()\n {\n $factory = new ConnectionFactory ( $this->container );\n $this->manager = new DatabaseManager ( $this->container, $factory );\n }", "public function setService($var) {}", "public function setService( $service )\n {\n $this->service = $service;\n }", "protected function setupManager(): void\n {\n $factory = new ConnectionFactory($this->container);\n $this->manager = new DatabaseManager($this->container, $factory);\n }", "public function setService($service)\n{\n$this->service = $service;\n}", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n\n return $this;\n }", "public function setServiceManager(ServiceManager $serviceManager)\n {\n $this->serviceManager = $serviceManager;\n\n return $this;\n }" ]
[ "0.73327667", "0.71556216", "0.7095802", "0.6954697", "0.6954697", "0.6954697", "0.6638204", "0.65914935", "0.65837806", "0.6428546", "0.6428546", "0.6415657", "0.64044917", "0.64041096", "0.6400051", "0.63612336", "0.63206756", "0.63206756", "0.63206756", "0.63206756", "0.63206756", "0.6309089", "0.63083124", "0.6305665", "0.62754184", "0.6267611", "0.62492365", "0.6221167", "0.6221167", "0.6221167" ]
0.7208615
1
Create request headers payload
public function createRequestHeaders(): RequestPayload\Headers;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function makeHeaders() {\n $headers = array_merge($this->caliperConfig->getHttpHeaders(), [\n 'Content-Type' => 'application/json',\n 'Authorization' => $this->caliperConfig->getApiKey(),\n 'User-Agent' => 'Resque worker class: ' . __CLASS__,\n ]);\n\n return $headers;\n }", "private function constructHeaders()\n\t{\n\t\treturn [\n\t\t\t'Content-Type: application/json',\n\t\t\t'Authorization: '.$this->access_token,\n\t\t];\n\t}", "public function createResponseHeaders(): ResponsePayload\\Headers;", "public function buildHeaders()\n {\n $now = new \\DateTime();\n $headers = $this->headers + array(\n 'Accept' => '*/*',\n 'Content-Length' => strlen($this->getContent()),\n 'Content-Type' => 'text/html',\n 'Date' => $now->format(\\DateTime::RFC1123)\n );\n\n $return = array();\n\n foreach ($headers as $name => $value) {\n $return[] = \"$name: $value\";\n }\n\n return $return;\n }", "private function createHeader()\n {\n $headers = $this->headers;\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n\n if ('hash' == $auth_type) {\n $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword());\n } elseif ('password' == $auth_type) {\n $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());\n }\n return $headers;\n }", "private function getHeaders() {\n\n $contentType = $this->apiVersion == '1.5' ? 'application/x-www-form-urlencoded' : 'application/json';\n\n switch ($this->apiVersion) {\n case '1.5':\n return array(\n 'Content-type:' . $contentType\n );\n break;\n case '3':\n default :\n return array(\n 'MerchantId:' . $this->merchantId,\n 'MerchantKey:' . $this->merchantKey,\n 'Content-type:' . 'application/json'\n );\n break;\n }\n }", "public function outputHeaders()\n {\n $url = sprintf(Client::URL, $this->config->getApiKey(), Client::PROTOCOL_VERSION, $this->getHash());\n $content = gzencode($this->toJson(), 1);\n\n $request = \"POST $url HTTP/1.1\\r\\n\";\n $request .= \"Host: \".Client::HOST.\"\\r\\n\";\n $request .= \"Accept: */*\\r\\n\";\n $request .= \"User-Agent: \".Client::CLIENT_NAME.\" \".Client::VERSION.\"\\r\\n\";\n $request .= \"Content-Type: text/json\\r\\n\";\n $request .= \"Connection: close\\r\\n\";\n $request .= \"Content-Length: \".strlen($content).\"\\r\\n\\r\\n\";\n $request .= $content.\"\\r\\n\";\n\n return $request;\n }", "protected function getRequestHeaders()\n {\n $userAgents = array(\n 'PHP/'.PHP_VERSION,\n str_replace(\n array(' ', \"\\t\", \"\\n\", \"\\r\"),\n '-',\n $this->configService->getIntegrationName().'/'.$this->configService->getIntegrationVersion()\n ),\n str_replace(\n array(' ', \"\\t\", \"\\n\", \"\\r\"),\n '-',\n $this->configService->getExtensionName().'/'.$this->configService->getExtensionVersion()\n ),\n );\n\n return array(\n 'accept' => 'Accept: application/json',\n 'content' => 'Content-Type: application/json',\n 'useragent' => 'User-Agent: '.implode(' ', $userAgents),\n 'token' => 'Authorization: Bearer ' . $this->configService->getAuthorizationToken(),\n );\n }", "protected function createCurlHeaders()\n {\n $this->headers[] = 'Content-Type:' . $this->enctype;\n $this->headers[] = 'Authorization: Basic '. base64_encode($this->auth['user'] . ':' . $this->auth['password']);\n }", "private function getRequestHeaders() : array\n {\n // Default Headers Set\n $headers = [\n 'Content-Type' => 'application/x-ndjson',\n 'User-Agent' => sprintf('apm-agent-php/%s', Agent::VERSION),\n ];\n\n // Add Secret Token to Header\n if ($this->config->get('secretToken') !== null) {\n $headers['Authorization'] = sprintf('Bearer %s', $this->config->get('secretToken'));\n }\n\n return $headers;\n }", "private static function buildHeaders()\n {\n return [\n 'User-Agent' => 'ChallongePHP/' . CHALLONGE_VERSION . ' ChallongePHP (https://github.com/interludic/ChallongePHP, ' . CHALLONGE_VERSION . ')'\n ];\n }", "public function buildWsseHeader()\n {\n // get Parameters from symfony ParameterBag\n try {\n $username = $this->params->get('API_USERNAME');\n $password = $this->params->get('API_PASSWORD');\n } catch (ParameterNotFoundException $e) {\n $this->logger->error(\"Error get parameters API_USERNAME,API_PASSWORD not found in .env file\");\n return [];\n }\n\n if (empty($username)) {\n $this->logger->error(\"Error get parameters API_USERNAME is empty in .env file\");\n return [];\n }\n\n if (empty($password)) {\n $this->logger->error(\"Error get parameters API_PASSWORD is empty in .env file\");\n return [];\n }\n\n // Initialisation of the nonce\n $nonce = '';\n // Making the nonce and the encoded nonce\n for ($i = 0; $i < 32; $i++) {\n $nonce .= self::HEADERS_CHARTS[rand(0, 15)];\n }\n $nonce64 = base64_encode($nonce);\n // Getting the date at the right format (e.g. YYYY-MM-DDTHH:MM:SSZ)\n $date = substr(gmdate('c'), 0, 19) . \"Z\";\n // Getting the password digest\n $digest = base64_encode(sha1($nonce . $date . $password, true));\n return [\n sprintf('X-WSSE: UsernameToken Username=\"%s\", PasswordDigest=\"%s\", Nonce=\"%s\", Created=\"%s\"', $username, $digest, $nonce64, $date),\n 'Content-Type: application/json'\n ];\n }", "protected function prepareHeaders()\r\n {\r\n $headers = $this->request->getHeaders();\r\n $url = $this->request->getUrl();\r\n\r\n $host = $url->getHost();\r\n if ($port = $url->getPort()) {\r\n $scheme = $url->getScheme();\r\n if ((0 == strcasecmp($scheme, 'http') && 80 != $port) ||\r\n (0 == strcasecmp($scheme, 'https') && 443 != $port)\r\n ) {\r\n $host .= ':' . $port;\r\n }\r\n }\r\n $headers['host'] = $host;\r\n\r\n if (!$this->request->getConfig('proxy_host')) {\r\n $requestUrl = '';\r\n } else {\r\n if ($user = $this->request->getConfig('proxy_user')) {\r\n $headers['proxy-authorization'] = $this->createAuthHeader(\r\n $user, $this->request->getConfig('proxy_password'),\r\n $this->request->getConfig('proxy_auth_scheme')\r\n );\r\n }\r\n $requestUrl = $url->getScheme() . '://' . $host;\r\n }\r\n $path = $url->getPath();\r\n $query = $url->getQuery();\r\n $requestUrl .= (empty($path)? '/': $path) . (empty($query)? '': '?' . $query);\r\n\r\n if ($auth = $this->request->getAuth()) {\r\n $headers['authorization'] = $this->createAuthHeader(\r\n $auth['user'], $auth['password'], $auth['scheme']\r\n );\r\n }\r\n if ('1.1' == $this->request->getConfig('protocol_version') &&\r\n extension_loaded('zlib') && !isset($headers['accept-encoding'])\r\n ) {\r\n $headers['accept-encoding'] = 'gzip, deflate';\r\n }\r\n\r\n $this->calculateRequestLength($headers);\r\n\r\n $headersStr = $this->request->getMethod() . ' ' . $requestUrl . ' HTTP/' .\r\n $this->request->getConfig('protocol_version') . \"\\r\\n\";\r\n foreach ($headers as $name => $value) {\r\n $canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));\r\n $headersStr .= $canonicalName . ': ' . $value . \"\\r\\n\";\r\n }\r\n return $headersStr . \"\\r\\n\";\r\n }", "private function build_header() {\n\t\t$header = self::fetch(self::primary_lookup(), [':customer_quote_id' => $this->id()]);\n\n\t\tif (!empty($header)) {\n\t\t\tif (!($header['expiration_date'] instanceof DateTime)) $header['expiration_date'] = new DateTime($header['expiration_date']);\n\t\t\tif (!($header['created'] instanceof DateTime)) $header['created'] = new DateTime($header['created']);\n\t\t}\n\t\telse $header = [];\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "private function prepareHeader(array $data)\n {\n $data['nonce'] = (string) number_format(round(microtime(true) * 1000000), 0, '.', '');\n\n $payload = base64_encode(json_encode($data));\n $signature = hash_hmac('sha384', $payload, $this->apiSecret);\n\n $this->pay = $payload;\n $this->sig = $signature;\n\n return array(\n 'X-BFX-APIKEY: ' . $this->apiKey,\n 'X-BFX-PAYLOAD: ' . $payload,\n 'X-BFX-SIGNATURE: ' . $signature\n );\n }", "private function getRequestHeaders()\n {\n $headers = [];\n $headers[] = 'Accept:application/json';\n $headers[] = 'Authorization:Bearer ' . $this->token;\n\n foreach ($_SERVER as $key => $value) {\n if (false !== strpos($key, 'HTTP')) {\n if ('HTTP_HOST' !== $key &&\n 'HTTP_ORIGIN' !== $key &&\n 'HTTP_CONTENT_TYPE' !== $key &&\n false === strpos($key, 'HTTP_CONTENT_LEN')) {\n $key = str_replace(' ', '-',\n ucwords(strtolower(str_replace('_', ' ', substr($key, 5)))));\n array_push($headers, $key . ': ' . $value);\n }\n }\n }\n\n return $headers;\n }", "protected function get_header() {\n\n\t\t$header = array( 'Authorization' => '' );\n\t\t$param = $this->request_parameter;\n\t\t$param[ 'oauth_signature' ] = $this->get_signature();\n\n\t\tforeach ( $param as $name => $value ) {\n\t\t\t$param[] =\n\t\t\t\t oAuth_urlencode( $name )\n\t\t\t\t. '=\"'\n\t\t\t\t. oAuth_urlencode( $value )\n\t\t\t\t. '\"'\n\t\t\t;\n\t\t\tunset( $param[ $name ] );\n\t\t}\n\t\t$header[ 'Authorization' ] = 'OAuth ' . implode( ',', $param );\n\n\t\treturn $header;\n\t}", "function generateHeader () {\n $header = json_encode(['typ' => 'JWT', 'alg' => 'HS256']);\n // Encode header to Base64Url string\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n return $base64UrlHeader;\n}", "function BuildHeaders($PrintHeaders)\n\t{\n\t\t$timestamp = intval(round(microtime(true) * 1000));\n\t\t$token = sha1($this->ClientSecret.$timestamp);\n\n\t\t$headers = array(\n\t\t\t\"AUTHORIZATION: FPA \".$this->AccessKey.\":\".$token.\":\".$timestamp,\n\t\t\t\"CONTENT-TYPE: application/json\", \n\t\t\t\"ACCEPT: application/json\"\n\t\t);\n\t\t\n\t\tif($PrintHeaders)\n\t\t{\n\t\t\techo '<pre />';\n\t\t\tprint_r($headers);\n\t\t}\n\t\t\n\t\treturn $headers;\n\t}", "protected function prepareHeaders()\n {\n $headers = array();\n\n // Set the connection header\n if (!isset($this->headers['connection'])) {\n $headers[] = \"Connection: close\";\n }\n\n // Set the Accept header\n if (isset($this->accept)) {\n $headers[] = \"Accept: \" . $this->accept;\n }\n\n // Add all other user defined headers\n foreach ($headers as $header) {\n list($name, $value) = $header;\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n\n $headers[] = \"$name: $value\";\n }\n\n return $headers;\n }", "private function makeHeaders()\n {\n $headers = [];\n $headers[] = $this->makeHeader('From', $this->makeAddress($this->from));\n $headers[] = $this->makeHeader('Message-ID', $this->uniqId);\n if (count($this->replyTo)) {\n $replyTo = implode(' ', $this->replyTo);\n $headers[] = $this->makeHeader('References', $replyTo);\n $headers[] = $this->makeHeader('In-Reply-To', $replyTo);\n }\n $headers[] = $this->makeHeader('MIME-Version', '1.0');\n $headers[] = $this->makeHeader('Date', date(DATE_RFC2822, $this->timestamp ?: time()));\n if ($this->multipart) {\n $this->boundary = sha1($this->uniqId);\n $headers[] = $this->makeHeader('Content-Type', 'multipart/mixed; boundary=\"' . $this->boundary . '\"');\n } else {\n $headers[] = $this->makeHeader('Content-Type', 'text/plain; charset=\"utf-8\"');\n // we use base64 for avoiding some problems sush string length limit, safety encoding etc.\n $headers[] = $this->makeHeader('Content-Transfer-Encoding', 'quoted-printable');\n }\n return implode(self::CRLF , $headers);\n }", "private function initHeaders(){\n $this->headers = [\n 'api_key:'.$this->api_key,\n 'Content-Type:application/json'\n ];\n }", "public function buildHeader();", "public function getRawRequestHeaders () {}", "public function buildHeader() {\n $header = [\n 'title' => $this->t('Title'),\n 'type' => [\n 'data' => $this->t('Content type'),\n 'class' => [RESPONSIVE_PRIORITY_MEDIUM],\n ],\n 'author' => [\n 'data' => $this->t('Author'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ],\n 'status' => $this->t('Status'),\n 'changed' => [\n 'data' => $this->t('Updated'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ],\n ];\n return $header;\n }", "private function getHeaders(): array\n {\n return [\n \"Content-Type\" => \"application/json; charset=utf-8\",\n \"accept\" => \"application/json\",\n ];\n }", "private function _setHeaders()\n {\n $headers = array(\n \"Content-Type:application/json\",\n );\n if ($this->_APIKey)\n {\n $headers[] = \"Authorization: Bearer {$this->_APIKey}\";\n }\n return $headers;\n }", "public function createheader()\n {\n //\n }", "private function initHeaderKeys()\n {\n $this->headers = array\n (\n 'Authorization: key=' . $this->configs['API_ACCESS_KEY'],\n 'Content-Type: '.$this->configs['CONTENT_TYPE']\n );\n }", "public function createHeader()\n {\n $num = array_push($this->headers, new Parameter());\n\n return $this->headers[$num - 1];\n }" ]
[ "0.6991563", "0.6970738", "0.69128835", "0.67674875", "0.6534251", "0.65196025", "0.64754957", "0.6403833", "0.6399993", "0.63785696", "0.63696593", "0.63500863", "0.63459706", "0.626116", "0.62136066", "0.6206275", "0.6152937", "0.61428154", "0.6134031", "0.61022174", "0.6080501", "0.6079319", "0.60644376", "0.60256565", "0.60214216", "0.6013115", "0.5953848", "0.59424293", "0.59352547", "0.59143525" ]
0.78140414
0
Create response headers payload
public function createResponseHeaders(): ResponsePayload\Headers;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createRequestHeaders(): RequestPayload\\Headers;", "private function makeHeaders() {\n $headers = array_merge($this->caliperConfig->getHttpHeaders(), [\n 'Content-Type' => 'application/json',\n 'Authorization' => $this->caliperConfig->getApiKey(),\n 'User-Agent' => 'Resque worker class: ' . __CLASS__,\n ]);\n\n return $headers;\n }", "private function constructHeaders()\n\t{\n\t\treturn [\n\t\t\t'Content-Type: application/json',\n\t\t\t'Authorization: '.$this->access_token,\n\t\t];\n\t}", "public function writeResponseHeader();", "public function buildHeaders()\n {\n $now = new \\DateTime();\n $headers = $this->headers + array(\n 'Accept' => '*/*',\n 'Content-Length' => strlen($this->getContent()),\n 'Content-Type' => 'text/html',\n 'Date' => $now->format(\\DateTime::RFC1123)\n );\n\n $return = array();\n\n foreach ($headers as $name => $value) {\n $return[] = \"$name: $value\";\n }\n\n return $return;\n }", "private function createHeader()\n {\n $headers = $this->headers;\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n\n if ('hash' == $auth_type) {\n $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword());\n } elseif ('password' == $auth_type) {\n $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());\n }\n return $headers;\n }", "private static function getResponseHeaders()\n {\n return ['Content-Type' => 'application/json'];\n }", "public function outputHeaders()\n {\n $url = sprintf(Client::URL, $this->config->getApiKey(), Client::PROTOCOL_VERSION, $this->getHash());\n $content = gzencode($this->toJson(), 1);\n\n $request = \"POST $url HTTP/1.1\\r\\n\";\n $request .= \"Host: \".Client::HOST.\"\\r\\n\";\n $request .= \"Accept: */*\\r\\n\";\n $request .= \"User-Agent: \".Client::CLIENT_NAME.\" \".Client::VERSION.\"\\r\\n\";\n $request .= \"Content-Type: text/json\\r\\n\";\n $request .= \"Connection: close\\r\\n\";\n $request .= \"Content-Length: \".strlen($content).\"\\r\\n\\r\\n\";\n $request .= $content.\"\\r\\n\";\n\n return $request;\n }", "public function getResponseHeaders();", "public function getResponseHeaders();", "public static function headers();", "function setup_json_header(Response $response) {\n\treturn $response->withHeader('Content-Type', 'application/json');\n}", "public function buildWsseHeader()\n {\n // get Parameters from symfony ParameterBag\n try {\n $username = $this->params->get('API_USERNAME');\n $password = $this->params->get('API_PASSWORD');\n } catch (ParameterNotFoundException $e) {\n $this->logger->error(\"Error get parameters API_USERNAME,API_PASSWORD not found in .env file\");\n return [];\n }\n\n if (empty($username)) {\n $this->logger->error(\"Error get parameters API_USERNAME is empty in .env file\");\n return [];\n }\n\n if (empty($password)) {\n $this->logger->error(\"Error get parameters API_PASSWORD is empty in .env file\");\n return [];\n }\n\n // Initialisation of the nonce\n $nonce = '';\n // Making the nonce and the encoded nonce\n for ($i = 0; $i < 32; $i++) {\n $nonce .= self::HEADERS_CHARTS[rand(0, 15)];\n }\n $nonce64 = base64_encode($nonce);\n // Getting the date at the right format (e.g. YYYY-MM-DDTHH:MM:SSZ)\n $date = substr(gmdate('c'), 0, 19) . \"Z\";\n // Getting the password digest\n $digest = base64_encode(sha1($nonce . $date . $password, true));\n return [\n sprintf('X-WSSE: UsernameToken Username=\"%s\", PasswordDigest=\"%s\", Nonce=\"%s\", Created=\"%s\"', $username, $digest, $nonce64, $date),\n 'Content-Type: application/json'\n ];\n }", "protected function createCurlHeaders()\n {\n $this->headers[] = 'Content-Type:' . $this->enctype;\n $this->headers[] = 'Authorization: Basic '. base64_encode($this->auth['user'] . ':' . $this->auth['password']);\n }", "private function getHeaders() {\n\n $contentType = $this->apiVersion == '1.5' ? 'application/x-www-form-urlencoded' : 'application/json';\n\n switch ($this->apiVersion) {\n case '1.5':\n return array(\n 'Content-type:' . $contentType\n );\n break;\n case '3':\n default :\n return array(\n 'MerchantId:' . $this->merchantId,\n 'MerchantKey:' . $this->merchantKey,\n 'Content-type:' . 'application/json'\n );\n break;\n }\n }", "private function makeHeaders()\n {\n $headers = [];\n $headers[] = $this->makeHeader('From', $this->makeAddress($this->from));\n $headers[] = $this->makeHeader('Message-ID', $this->uniqId);\n if (count($this->replyTo)) {\n $replyTo = implode(' ', $this->replyTo);\n $headers[] = $this->makeHeader('References', $replyTo);\n $headers[] = $this->makeHeader('In-Reply-To', $replyTo);\n }\n $headers[] = $this->makeHeader('MIME-Version', '1.0');\n $headers[] = $this->makeHeader('Date', date(DATE_RFC2822, $this->timestamp ?: time()));\n if ($this->multipart) {\n $this->boundary = sha1($this->uniqId);\n $headers[] = $this->makeHeader('Content-Type', 'multipart/mixed; boundary=\"' . $this->boundary . '\"');\n } else {\n $headers[] = $this->makeHeader('Content-Type', 'text/plain; charset=\"utf-8\"');\n // we use base64 for avoiding some problems sush string length limit, safety encoding etc.\n $headers[] = $this->makeHeader('Content-Transfer-Encoding', 'quoted-printable');\n }\n return implode(self::CRLF , $headers);\n }", "public function buildHeader() {\n $header = [\n 'title' => $this->t('Title'),\n 'type' => [\n 'data' => $this->t('Content type'),\n 'class' => [RESPONSIVE_PRIORITY_MEDIUM],\n ],\n 'author' => [\n 'data' => $this->t('Author'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ],\n 'status' => $this->t('Status'),\n 'changed' => [\n 'data' => $this->t('Updated'),\n 'class' => [RESPONSIVE_PRIORITY_LOW],\n ],\n ];\n return $header;\n }", "private static function buildHeaders()\n {\n return [\n 'User-Agent' => 'ChallongePHP/' . CHALLONGE_VERSION . ' ChallongePHP (https://github.com/interludic/ChallongePHP, ' . CHALLONGE_VERSION . ')'\n ];\n }", "protected function generateHeader() {\n $header = [\n 'month name',\n 'salary payment date',\n 'bonus payment date',\n ];\n\n return $header;\n }", "public function getResponseHeaders($token)\n { \n \n return ([\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer '.$token\n ]);\n }", "public function createheader()\n {\n //\n }", "function BuildHeaders($PrintHeaders)\n\t{\n\t\t$timestamp = intval(round(microtime(true) * 1000));\n\t\t$token = sha1($this->ClientSecret.$timestamp);\n\n\t\t$headers = array(\n\t\t\t\"AUTHORIZATION: FPA \".$this->AccessKey.\":\".$token.\":\".$timestamp,\n\t\t\t\"CONTENT-TYPE: application/json\", \n\t\t\t\"ACCEPT: application/json\"\n\t\t);\n\t\t\n\t\tif($PrintHeaders)\n\t\t{\n\t\t\techo '<pre />';\n\t\t\tprint_r($headers);\n\t\t}\n\t\t\n\t\treturn $headers;\n\t}", "private function build_header() {\n\t\t$header = self::fetch(self::primary_lookup(), [':customer_quote_id' => $this->id()]);\n\n\t\tif (!empty($header)) {\n\t\t\tif (!($header['expiration_date'] instanceof DateTime)) $header['expiration_date'] = new DateTime($header['expiration_date']);\n\t\t\tif (!($header['created'] instanceof DateTime)) $header['created'] = new DateTime($header['created']);\n\t\t}\n\t\telse $header = [];\n\n\t\t$this->skeleton->load('header', $header);\n\t}", "private function get_headers(): array {\n $headers = [];\n $headers[] = get_string('status');\n $headers[] = get_string('gradenoun');\n $headers[] = get_string('attemptedon', 'report_embedquestion');\n return $headers;\n }", "protected function prepareHeaders()\n {\n $headers = array();\n\n // Set the connection header\n if (!isset($this->headers['connection'])) {\n $headers[] = \"Connection: close\";\n }\n\n // Set the Accept header\n if (isset($this->accept)) {\n $headers[] = \"Accept: \" . $this->accept;\n }\n\n // Add all other user defined headers\n foreach ($headers as $header) {\n list($name, $value) = $header;\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n\n $headers[] = \"$name: $value\";\n }\n\n return $headers;\n }", "protected function createHeaders() : void\n {\n foreach($this->headers as $header) {\n header($header);\n }\n }", "private function get_headers() {\n if ( ! $this->seller_id || ! $this->secret_key ) {\n throw new Exception( 'Merchandiser needs a valid 2Checkout SellerId and SecretKey to authenticate!' );\n }\n $gmt_date = gmdate( 'Y-m-d H:i:s' );\n $string = strlen( $this->seller_id ) . $this->seller_id . strlen( $gmt_date ) . $gmt_date;\n $hash = hash_hmac( 'md5', $string, $this->secret_key );\n\n $headers[] = 'Content-Type: application/json';\n $headers[] = 'Accept: application/json';\n $headers[] = 'X-Avangate-Authentication: code=\"' . $this->seller_id . '\" date=\"' . $gmt_date . '\" hash=\"' . $hash . '\"';;\n\n return $headers;\n }", "abstract public function getHeaders();", "public function getHttpHeaders();", "public function doHeaders() { }" ]
[ "0.70859575", "0.69023156", "0.6738736", "0.6719075", "0.65950966", "0.65663064", "0.65388", "0.647839", "0.6426668", "0.6426668", "0.6269874", "0.6255915", "0.62118495", "0.6210974", "0.6159417", "0.615214", "0.6151082", "0.6139076", "0.6106436", "0.6102173", "0.6091222", "0.60757774", "0.6073988", "0.60637856", "0.60485965", "0.6046596", "0.603223", "0.5981682", "0.5973464", "0.5972091" ]
0.81357026
0
Returns an array of supported field search types, each entry being ( type, humanreadable string )
public function getFieldSearchTypes() { return array( array( 'exact' , ipsRegistry::instance()->getClass('class_localization')->words['cf_search_exact'] ), array( 'loose' , ipsRegistry::instance()->getClass('class_localization')->words['cf_search_loose'] ), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getSearchType()\n {\n return array( self::SEARCH_TITLE=>'Title',\n self::SEARCH_AUTHOR=>'Author',\n self::SEARCH_CONTROL_NUMBER=>'Control Number',\n self::SEARCH_ISBN=>'ISBN',\n self::SEARCH_ISSN=>'ISSN');\n \n }", "public function getFieldTypes() {\n\t\treturn array(crud::TYPE_STRING,crud::TYPE_STRING);\n\t}", "public function getFieldTypes()\n\t{\n\t\treturn array( \n\t\t\t\t\t\tarray( 'drop' , ipsRegistry::instance()->getClass('class_localization')->words['cf_drop'] ),\n\t\t\t\t\t\tarray( 'cbox' , ipsRegistry::instance()->getClass('class_localization')->words['cf_cbox'] ),\n\t\t\t\t\t\tarray( 'radio' , ipsRegistry::instance()->getClass('class_localization')->words['cf_radio'] ),\n\t\t\t\t\t\tarray( 'input' , ipsRegistry::instance()->getClass('class_localization')->words['cf_input'] ),\n\t\t\t\t\t\tarray( 'textarea' , ipsRegistry::instance()->getClass('class_localization')->words['cf_textarea'] ),\n\t\t\t\t\t);\n\t}", "public static function getValidFieldTypes(): array;", "public function getSearchableFields(): array;", "public function getFieldTypes()\n\t{\n\t\treturn array(\n\t\t\t'textbox' => array(\n\t\t\t\t'value' => 'textbox',\n\t\t\t\t'label' => new XenForo_Phrase('single_line_text_box')\n\t\t\t),\n\t\t\t'textarea' => array(\n\t\t\t\t'value' => 'textarea',\n\t\t\t\t'label' => new XenForo_Phrase('multi_line_text_box')\n\t\t\t),\n\t\t\t'select' => array(\n\t\t\t\t'value' => 'select',\n\t\t\t\t'label' => new XenForo_Phrase('drop_down_selection')\n\t\t\t),\n\t\t\t'radio' => array(\n\t\t\t\t'value' => 'radio',\n\t\t\t\t'label' => new XenForo_Phrase('radio_buttons')\n\t\t\t),\n\t\t\t'checkbox' => array(\n\t\t\t\t'value' => 'checkbox',\n\t\t\t\t'label' => new XenForo_Phrase('check_boxes')\n\t\t\t),\n\t\t\t'multiselect' => array(\n\t\t\t\t'value' => 'multiselect',\n\t\t\t\t'label' => new XenForo_Phrase('multiple_choice_drop_down_selection')\n\t\t\t),\n\t\t\t'wysiwyg' => array(\n\t\t\t\t'value' => 'wysiwyg',\n\t\t\t\t'label' => new XenForo_Phrase('wysiwyg')\n\t\t\t),\n\t\t\t'date' => array(\n\t\t\t\t'value' => 'date',\n\t\t\t\t'label' => new XenForo_Phrase('kmkform__date')\n\t\t\t),\n\t\t\t'rating' => array(\n\t\t\t\t'value' => 'rating',\n\t\t\t\t'label' => new XenForo_Phrase('kmkform__rating')\n\t\t\t),\n\t\t 'datetime' => array(\n\t\t 'value' => 'datetime',\n\t\t 'label' => new XenForo_Phrase('kmkform__datetime')\n\t\t ),\n\t\t 'time' => array(\n\t\t 'value' => 'time',\n\t\t 'label' => new XenForo_Phrase('kmkform__time')\n\t\t )\t\t \n\t\t);\n\t}", "abstract public function getFieldsSearchable(): array;", "public static function getAvailableFieldtypesShort() {\n return array(\n 'text',\n 'textarea',\n 'email',\n 'datetime',\n 'checkbox',\n 'file',\n 'float',\n 'image',\n 'integer',\n 'page',\n 'fieldset',\n 'tab'\n );\n }", "function get_form_field_types(){\n\t\treturn array(\n\t\t\t'text' => 'Textbox',\n\t\t\t'number' => 'Number',\n\t\t\t'decimal' => 'Decimal',\n\t\t\t'tel' => 'Phone Number',\n\t\t\t'url' => 'URL',\n\t\t\t'email' => 'Email Address',\n\t\t\t'date' => 'Date',\n\t\t\t'textarea' => 'Textarea',\n\t\t\t'file' => 'File Upload',\n\t\t);\n\t}", "public function getTypes()\n {\n $types = [];\n $validCustomFieldTypes = $this->getCustomFieldTypes();\n if (empty($validCustomFieldTypes)) {\n return $types;\n }\n foreach ($validCustomFieldTypes as $k => $customField) {\n $types[$k] = $customField['title'];\n }\n return $types;\n }", "public static function getFieldTypes() {\n\t\treturn self::$FIELD_TYPES;\n\t}", "function bbp_get_search_type_ids()\n{\n}", "public function getFieldsSearchable()\n {\n return [];\n }", "public function genericSearchFields()\n {\n return ['url', 'content', 'title', 'language_info'];\n }", "public function supportedTypes(): array;", "public static function getAvailableTypes()\n {\n return array(\n \"string\",\n \"number\",\n \"integer\", \n \"file\",\n \"boolean\",\n \"date\",\n );\n }", "function getContentFieldTypes(){\n return [\n \"string\"=>\"String\",\n \"text\"=>\"Text\",\n \"richtext\"=>\"Rich format text\",\n \"image\"=>\"Image\",\n \"file\"=>\"File\",\n \"datetime\"=>\"Date and Time\",\n \"link\"=>\"Link to other table\"\n ];\n }", "public function fields(): array\n {\n $fields = [];\n\n foreach ($this->schema->getFields() as $name => $field) {\n $field = Utils::toFieldArray($field);\n $type = Type::getNamedType($field['type']);\n\n if ($type instanceof StringType || $type instanceof IDType) {\n $fields[$name] = Bakery::boolean();\n }\n }\n\n foreach ($this->schema->getRelations() as $relation => $field) {\n $fieldType = Type::getNamedType($field['type']);\n\n if ($fieldType instanceof UnionType) {\n continue;\n }\n\n $fields[$relation] = Bakery::type($fieldType->name.'Search');\n }\n\n return $fields;\n }", "public function getFieldTypes()\n {\n $fields = self::$field_types;\n\n $this->extend('updateFieldTypes', $fields);\n\n return $fields;\n }", "function lingotek_supported_field_type($type) {\n return in_array($type, array('text_long', 'text_with_summary', 'text')); //'taxonomy_term_reference'));\n}", "function filter_pods_api_field_types( $field_types ){\r\n\t//\tprint_r( $field_types );\r\n\t\tif( !in_array( 'fsrepeaterfield', $field_types ) ){\r\n\t\t\tarray_push( $field_types, 'fsrepeaterfield' );\r\n\t\t\t\r\n\t\t}\r\n\t\treturn $field_types ;\r\n\t}", "protected function getFieldtypeOptions()\n {\n return array();\n }", "function getDocumentTypes() {\n\t\tglobal $default;\n\t\t$aDocumentTypes = array();\n\t\t$sql = $default->db;\n\t\t$sQuery = \"SELECT document_type_id FROM \" . $default->document_type_fields_table . \" WHERE field_id = ?\";/*ok*/\n $aParams = array($this->iId);\n\t\tif ($sql->query(array($sQuery, $aParams))) {\n\t\t\twhile ($sql->next_record()) {\n \t\t\t$aDocumentTypes[] = & DocumentType::get($sql->f(\"document_type_id\"));\n \t\t}\n\t\t\treturn $aDocumentTypes;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "function getFieldTypes($names) {\n $types = array();\n foreach ($names as $name) {\n foreach ($this->fields as $fieldname => $field) {\n if ($name == $fieldname) {\n $types[$name] = $field['type'];\n }\n }\n }\n return $types;\n }", "public function get_field_type_definitions() {\n\t\t$field_types = $this->get_all_definitions();\n\t\t$field_type_names = array();\n\t\tforeach( $field_types as $field_type ) {\n\t\t\t$field_type_names[ $field_type->get_slug() ] = array(\n\t\t\t\t'slug' => $field_type->get_slug(),\n\t\t\t\t'displayName' => $field_type->get_display_name(),\n\t\t\t\t'canBeRepetitive' => $field_type->can_be_repetitive(),\n\t\t\t\t'iconClasses' => $field_type->get_icon_classes()\n\t\t\t);\n\t\t}\n\n\t\treturn $field_type_names;\n\t}", "public static function getTypes();", "public static function get_type_option_names() {\n return array('webservicesurl', 'pluginname', 'sharedsecret', 'sitecollectionurl', 'domainname', 'dateformat',\n 'maxresults');\n }", "public function getFieldTypeMap()\n\t{\n\t\treturn array(\n\t\t\t'textbox' => 'text',\n\t\t\t'textarea' => 'text',\n\t\t\t'radio' => 'single',\n\t\t\t'select' => 'single',\n\t\t\t'checkbox' => 'multiple',\n\t\t\t'multiselect' => 'multiple',\n\t\t\t'wysiwyg' => 'text',\n\t\t\t'date' => 'text',\n\t\t\t'rating' => 'rating',\n\t\t 'datetime' => 'text',\n\t\t 'time' => 'text'\n\t\t);\n\t}", "public function getTypes();", "function fieldtypes()\n {\n return app()->make(App\\Fieldtypes\\Registry::class);\n }" ]
[ "0.74589115", "0.7379439", "0.73670465", "0.73387796", "0.7069108", "0.69977903", "0.6953794", "0.69359684", "0.6894496", "0.6867289", "0.68467665", "0.6806633", "0.6769787", "0.664797", "0.6645725", "0.65919816", "0.65813303", "0.65708005", "0.6567729", "0.6529462", "0.65278333", "0.6519034", "0.650284", "0.6467057", "0.6435357", "0.64296496", "0.64028084", "0.6398415", "0.6392915", "0.6387237" ]
0.86045873
0
Start the data sync. Fetch the data from remote url and write into the database.
private function syncDataInternal() { Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' '); $this->_contentRowsCount = 0; $dataChunk = []; for ($i = 0; $i < $this->getOffsetTotal(); ++$i) { $requestData = $this->request($i); if (!$requestData) { continue; } if (0 === $i % $this->build->syncRequestsCount) { $inserted = $this->insertData($dataChunk); $this->_contentRowsCount += $inserted; $dataChunk = []; } Console::updateProgress($i + 1, $this->getOffsetTotal()); $dataChunk = array_merge($requestData, $dataChunk); gc_collect_cycles(); } if (!empty($dataChunk)) { $this->insertData($dataChunk); } Console::endProgress(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sync();", "public function run()\n\t{\n\t\t$database = new Database(\"localhost\",\"footballhome\",\"postgres\",\"mibesfat\");\n\n $results = $database->query($this->mSQL);\n\n $myarray = array();\n\n $resultArray = pg_fetch_all($results);\n\n while ($row = pg_fetch_row($results))\n {\n $myarray[] = $row;\n }\n $data = json_encode($myarray);\n\t\t$this->mData = 111 . $data; //111 update success\n\t}", "function fetch() {\n $this->data = file_get_contents($this->url());\n }", "public function sync(){}", "public static function updateTorqueWithDB() {\r\n # create curl resource\r\n $ch = curl_init();\r\n # set url\r\n curl_setopt($ch, CURLOPT_URL, Yii::app()->createAbsoluteUrl('crawler/index'));\r\n # return the transfer as a string\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n # $output contains the output string\r\n $output = curl_exec($ch);\r\n # close curl resource to free up system resources\r\n curl_close($ch);\r\n }", "public function store()\n {\n $sync = new Sync();\n\n $sync->run();\n }", "public function store()\n {\n $sync = new Sync();\n\n $sync->run();\n }", "public function run()\n {\n $json = File::get('database/data/remote-meeting.json');\n $data = json_decode($json, true);\n\n foreach($data as $obj){\n DB::table('meeting_settings')->insert([\n 'identity' => $obj['identity'],\n 'logo' => $obj['logo'],\n 'link' => $obj['link'],\n 'config' => json_encode($obj['config']),\n 'status' => $obj['status']\n ]);\n }\n\n }", "public function sync(): void\n {\n $subscriptions = $this->wallhaven->getSubscriptions();\n foreach ($subscriptions['tags'] as $tag) {\n $page = 1;\n do {\n $wallpapers = $this->wallhaven->search(\n \"\\\"#{$tag}\\\"\",\n Category::ALL,\n Purity::SFW,\n Sorting::DATE_ADDED,\n Order::DESC,\n [],\n [],\n $page\n );\n $this->download($wallpapers, ['tag', $tag]);\n } while ($wallpapers->count() >= self::PAGE_SIZE); // Deteremine if there are more pages to come\n }\n }", "static function syncfile() {\n\t\tself::log(\"Updating tabdata file ... \", false);\n\t\tcreate_tab_data_file();\n\t\tself::log(\"DONE\");\n\t}", "protected function syncCities(){\n $citiesApiJson = $this->_getCitiesFromServer();\n $citiesApi = json_decode($citiesApiJson);\n if (property_exists($citiesApi, 'success') && $citiesApi->success === true) {\n $this->_syncWithDb($citiesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($citiesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n }", "public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }", "public function sync()\n\t{\n\t\t// After this call, $this->destinationMilestones is sync'd\n\t\t// After this call, $this->sourceMilestones includes a destination_id key\n\t\t$this->syncMilestones();\n\n\t\t// After this call, $this->destinationSuites is sync'd\n\t\t// After this call, $this->sourceSuites includes a destination_id key\n\t\t$this->syncSuites();\n\n\n\t\t$this->deleteOrphanedSuites();\n\t\t$this->matchSuites();\n\t\t$this->copySuites();\n\n\t\tforeach ($this->sourceSuites as $sourceSuite)\n\t\t{\n\t\t\t$this->syncSection($sourceSuite);\n\t\t}\n\t}", "public function run()\n {\n $source = new SourceInfo;\n $source->title = \"殯葬業者\";\n $source->provider = \"Data Taipei\";\n $source->url = \"http://data.taipei/opendata/datalist/apiAccess\";\n $source->query = [\n \"scope\" => \"resourceAquire\",\n \"rid\" => \"132c39fa-34f8-47e5-93e7-6c1a6b36cbb8\"\n ];\n $source->index_name = \"location\";\n\t\t$source->name_index = \"name\";\n\t\t$source->address_index = \"address\";\n $source->original_type = \"json\";\n $source->synced_interval = 3 * 24 * 60 * 60;\n $source->last_synced_time = \"\";\n $source->remote_updated_time = \"\";\n $source->save();\n }", "public function run()\n {\n Source::create([\n 'url' => 'https://www.ofracosmetics.com/products.json',\n ]);\n Source::create([\n 'url' => 'https://www.lonb.com/products.json',\n ]);\n Source::create([\n 'url' => 'https://www.pringlescotland.com/products.json',\n ]);\n }", "abstract public function get_remote_data();", "public function storeData() {\n $attributes = implode(', ', array_keys($this->data));\n $values = ':' . implode(', :', array_keys($this->data));\n\n $query = $this->db->prepare(\"INSERT INTO track ($attributes) VALUES ($values)\");\n\n foreach ($this->data as $k => $v) {\n $query->bindValue(\":$k\", $v);\n }\n\n if (!$query->execute()) {\n echo 'This URL was not found';\n }\n }", "public function sync()\n\t{\n\t\t$this->_updateAll = true;\n\t\treturn $this->update();\n\t}", "public function synchronize();", "public function api_sync() {\n\t\t$facility_code = $this -> session -> userdata('facility');\n\t\t$facility = Facilities::getSupplier($facility_code);\n\t\t$supplier = $facility -> supplier -> name;\n\t\t$links = array();\n\t\t$success_log = \"\";\n\t\t$error_log = \"\";\n\t\t$curl = new Curl();\n\t\tif (strtoupper($supplier) == \"KENYA PHARMA\") {\n\t\t\t$url = $this -> esm_url;\n\t\t\t$links['sync_drug'] = \"drugs\";\n\t\t\t$links['sync_facility'] = \"facilities\";\n\t\t\t$links['sync_regimen'] = \"regimen\";\n\t\t\t$username = $this -> session -> userdata('api_user');\n\t\t\t$password = $this -> session -> userdata('api_pass');\n\t\t\t$curl -> setBasicAuthentication($username, $password);\n\t\t\t$curl -> setOpt(CURLOPT_RETURNTRANSFER, TRUE);\n\t\t} else {\n\t\t\t$url = $this -> nascop_url;\n\t\t\t$links['sync_drug'] = \"sync/drugs\";\n\t\t\t$links['sync_facility'] = \"sync/facilities\";\n\t\t\t$links['sync_regimen'] = \"sync/regimen\";\n\t\t}\n\t\tforeach ($links as $table => $link) {\n\t\t\t$target_url = $url . $link;\n\t\t\t$curl -> get($target_url);\n\t\t\tif ($curl -> error) {\n\t\t\t\t$curl -> error_code;\n\t\t\t\t$error_log .= \"Error: \" . $curl -> error_code . \"<br/>\";\n\t\t\t} else {\n\t\t\t\t$main_array = json_decode($curl -> response, TRUE);\n\t\t\t\tforeach ($main_array as $key => $value) {\n\t\t\t\t\tunset($main_array[$key]['lmis_id']);\n\t\t\t\t}\n\t\t\t\t$this -> db -> query(\"TRUNCATE $table\");\n\t\t\t\t$this -> db -> insert_batch($table, $main_array);\n\t\t\t\t$success_log .= \"Success: \" . $table . \" Synched <br/>\";\n\t\t\t\t//start mapping process\n\t\t\t\t//$this -> map_process();\n\t\t\t}\n\t\t}\n\t\t$this -> session -> set_flashdata('order_message', $success_log);\n\t}", "public function actionSync()\n {\n if ($this->src && Source::findOne($this->src)->status === 0) {\n return;\n }\n // Yii::info('SYNC ' . ($this->src ? Source::findOne($this->src)->title : '') . ' Products:' . PHP_EOL, 'parse-console');\n // $this->stdout('SYNC ' . ($this->src ? Source::findOne($this->src)->title : '') . ' Products:' . PHP_EOL);\n\n if ($syncData = OcSettler::saveProducts($this->src ?? null)) {\n Yii::info(\n 'Processed: ' . $syncData['processed'] . PHP_EOL . 'Synced/Updated: ' . $syncData['synced'] . '/' . $syncData['updated'] . PHP_EOL,\n 'parse-console'\n );\n\n $this->stdout(\n 'Processed: ' . $syncData['processed'] . PHP_EOL .\n 'Synced/Updated: ' . $syncData['synced'] . '/' . $syncData['updated'] . PHP_EOL\n );\n }\n }", "private function synDBandMailchimp()\n {\n\n echo '<br>syncing data <br>';\n\n $this->db_conn->dropTables();\n\n $mailChimpList = json_decode($this->getLists(),true);\n $newList = array();\n if(isset($mailChimpList['lists']))\n {\n foreach ($mailChimpList['lists'] as $item)\n {\n $newList[] = array('id'=>$item['id'], 'name'=>$item['name']);\n }\n }\n $this->setListCount(count($newList));\n return $this->db_conn->syncList($newList);\n }", "function data(){\r\n $this->db = $this->startDB();\r\n }", "public function run()\n {\n \tDB::table('channels')->insert([\n \t\t\t'name' => 'Shopify',\n \t\t\t'sync' => 'https://3155a4a7f64a0ce0f7cf95f93b852182:fcd5194e83e316e7d1b3f2d915d92b06@stitchlite-jimhoyd.myshopify.com/admin/products.json'\n \t]);\n \tDB::table('channels')->insert([\n \t\t\t'name' => 'Vend',\n \t\t\t'sync' => 'https://vendjimhoyd.vendhq.com/api/products?active=1&access_token=2cm49piD4flvIAmaZGUpKYZAF1gOCkKKzjpatR8z'\n \t]); \t\n }", "public function update_data()\n\t{\n\t\t$data = $this->get_remote_data();\n\t\tif (!empty($data))\n\t\t{\n\t\t\t$this->_twitterify($data);\n\t\t\t$id = $this->get_data_id();\n\t\t\t$cache = new ObjectCache($id);\n\t\t\t$cache->set($data);\n\t\t}\n\t\telse // lets update the timestamp anyway by fetching and resetting the local data (if it is fetchable)\n\t\t{\n\t\t\t$data = $this->get_local_data();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t$id = $this->get_data_id();\n\t\t\t\t$cache = new ObjectCache($id);\n\t\t\t\t$cache->set($data);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function run() {\n\t\tfile_put_contents($this->config['pidfile'], getmypid().\"\\n\");\n\t\tpcntl_signal(SIGTERM, array(&$this, 'signal_handler'));\n\t\tpcntl_signal(SIGINT, array(&$this, 'signal_handler'));\n\n\t\t$this->connect_dbh();\n\t\t$this->create_table();\n\n\t\t$this->reset_client();\n\t\t$this->load_signkey();\n\n\t\tfor ($this->stop = false; !$this->stop; sleep(1)) {\n\t\t\tpcntl_signal_dispatch();\n\t\t\t// send\n\t\t\t$this->put_changes();\n\t\t\t// recv\n\t\t\t$items = $this->client->get_feed();\n\t\t\tif (empty($items)) {\n\t\t\t\tsleep(5);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$toget = array();\n\t\t\tforeach ($items as $i)\n\t\t\t\tif ($this->test_exists($i->id) === false)\n\t\t\t\t\t$toget[] = $i->id;\n\t\t\t$this->log_message(\"Recv %d save %d\",\n\t\t\t\tcount($items), count($toget));\n\t\t\tif (empty($toget))\n\t\t\t\tcontinue;\n\t\t\t$toget = implode(',', $toget);\n\t\t\t$objects = $this->client->get_object($toget);\n\t\t\t$this->save_multi($objects);\n\t\t}\n\n\t\tif ($this->stop) {\n\t\t\t$this->log_message(\"Remove pidfile\");\n\t\t\tunlink($this->config['pidfile']);\n\t\t}\n\t}", "public function run()\n {\n //$url_server = 'http://portal.toos:8002/api/';\n //$url_server = 'http://newtoos.cyberelectra.co.id/api/';\n $url_server = 'https://portal.cyberelectra.co.id/api/';\n $all_data = array(\n array('key' => 'app_name', 'value' => 'TOOS (Tes Online Offline Sekolah)'),\n\t\t\tarray('key' => 'app_version', 'value' => '3.0.0'),\n\t\t\tarray('key' => 'db_version', 'value' => '2.0.0'),\n array('key' => 'semester_id', 'value' => 20201),\n array('key' => 'menu', 'value' => 0),\n array('key' => 'url_server', 'value' => $url_server),\n\t\t);\n\t\t//DB::table('settings')->truncate();\n\t\tforeach($all_data as $data){\n\t\t\tDB::table('settings')->insert($data);\n\t\t}\n }", "public function transferBatchData()\r\n {\r\n $this->connectCourier();\r\n // Send the dataset\r\n }", "protected function syncWithDb()\n {\n $this->properties = $this->repository->getProperties($this->fileName);\n }", "public function run()\n {\n // 制作数据\n $this->makeDataLoop($this->orgTree, $this->parent);\n \n // 插入数据\n Org::dbTable()->insert($this->dataList);\n }" ]
[ "0.6376922", "0.6037973", "0.59700155", "0.5885106", "0.5708703", "0.5683362", "0.5683362", "0.5663908", "0.5568638", "0.5508131", "0.54409236", "0.5437613", "0.5428872", "0.5425632", "0.54019344", "0.5397188", "0.5396737", "0.5393554", "0.53752923", "0.53742236", "0.53651965", "0.53643715", "0.53261477", "0.5322328", "0.5312856", "0.5275081", "0.5188627", "0.5175004", "0.5164559", "0.5163718" ]
0.6302898
1
Sets the passed in user as the authenticated user of the application. Will generate a ticket for this user which will be used for subsequent requests.
public function setAuthenticatedUser(NovemberUser $user, $regenTicket=true) { if ($regenTicket) { $user->ticket = $this->generateTicket($user->getUsername()); } $today = date('Y-m-d H:i:s'); $user->setLastLogin($today); $this->dbService->updateObject($user); za()->setUser($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setAuthenticatedUser(){\n $this->user = auth()->user();\n }", "public function setAuthUser($user)\n {\n $this->authUser = $user;\n }", "public function setUser(Authenticatable $user)\n {\n $this->user = $user;\n $this->loggedOut = false;\n }", "public function set_user($user)\n {\n $this->user = $user;\n }", "public function _setRealUser() {\n\t\t$user = $this->Auth->user();\n\t\t$user['id'] = $user['real_user_id'];\n\t\tunset($user['real_user_id']);\n\n\t\t$this->Auth->login($user);\n\t}", "public function setUser(Authenticatable $user){\n $token = $this->provider->createToken($user, $this->request->input(\"device\"));\n $user->token = $token;\n $this->user = $user;\n }", "private function setUser()\n {\n $this->cas_user = phpCAS::getUser();\n Session::put('cas_user', $this->cas_user);\n }", "public function setUser($user) {\n $this->user = $user;\n }", "public function setUser($user)\n\t{\n\t\t$this->user = $user;\n\t}", "public function setUser($user)\n {\n $this->user = $user;\n }", "function setUser( &$user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }", "public function setUser(\\Illuminate\\Contracts\\Auth\\Authenticatable $user) {\n Log::debug(\"setUser()\");\n //Do not do anything, not supported.\n }", "public function on_set_current_user()\n {\n $current_user = wp_get_current_user();\n\n // Default user context to anonymous.\n $user_context = [\n 'id' => 0,\n 'name' => 'anonymous'\n ];\n\n // Determine whether the user is logged in assign their details.\n if ($current_user instanceof \\WP_User) {\n if ($current_user->exists()) {\n $user_context = [\n 'id' => $current_user->ID,\n 'name' => $current_user->display_name,\n 'email' => $current_user->user_email,\n 'username' => $current_user->user_login\n ];\n }\n }\n\n // Filter the user context so that plugins that manage users on their\n // own can provide alternate user context. ie. members plugin\n if (has_filter('wp_sentry_user_context')) {\n $user_context = apply_filters(\n 'wp_sentry_user_context',\n $user_context\n );\n }\n\n // Finally assign the user context to the client.\n $this->set_user_context($user_context);\n }", "function setUser($user)\n {\n $this->_reaktorfile->setUserId($user->getId());\n }", "public function __construct($user, $ticket)\n {\n $this->user = $user;\n $this->ticket = $ticket;\n }", "public static function set($user)\n {\n self::$user = $user;\n }", "public function setCurrentUser($user)\n {\n $this->currentuser = $user;\n }", "public function setUser(TM_User_User $value)\n {\n $this->_user = $value;\n }", "public function setAuthUser($user)\n {\n $this->set('user', $user);\n return $this;\n }", "public function setUser( RPC_User $user );", "public function setCurrentUser( User $user );", "public function setCurrentUser(sly_Model_User $user) {\n\t\tsly_Util_Session::set('UID', $user->getId());\n\t\tself::$currentUser = $user;\n\t}", "public function setUserId( $user );", "public function setCurrentUser($user){\n $_SESSION[$this->session_name] = $user;\n }", "public function setUser(Authenticatable $user) {\n \n }", "public function setUser(User $user) {\r\n $this->user = $user;\r\n }", "public function setUser( User $user ) {\n posix_setuid( $user->id );\n }", "public function setUser($user) {\n $_SESSION['user.id'] = $user->getId();\n }", "public function setUser(User $user) {\n $this->user = $user;\n }", "public function setUser(UserInterface $user)\n\t{\n\t\t$this->user = $user;\n\t}" ]
[ "0.6919086", "0.6809252", "0.6714205", "0.67061204", "0.66455", "0.66369516", "0.65356284", "0.6503291", "0.6493944", "0.6487406", "0.6471429", "0.6443014", "0.63779044", "0.6373865", "0.6367524", "0.63476455", "0.6338584", "0.6302238", "0.6299375", "0.629767", "0.6293713", "0.629196", "0.6277149", "0.6269594", "0.62638223", "0.6251793", "0.62254757", "0.621866", "0.6215962", "0.6210481" ]
0.7243054
0
Validates that the given user has the given ticket, and sets them into the current user session
public function validateTicket($username, $ticket) { $fields = array('username' => $username, 'ticket' => $ticket); $user = $this->dbService->getByField($fields, $this->userClass); if ($user != null) { $this->setAuthenticatedUser($user, false); } return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($user, $ticket)\n {\n $this->user = $user;\n $this->ticket = $ticket;\n }", "public function setAuthenticatedUser(NovemberUser $user, $regenTicket=true)\r\n\t{\r\n\t if ($regenTicket) {\r\n\t\t $user->ticket = $this->generateTicket($user->getUsername());\r\n\t }\r\n $today = date('Y-m-d H:i:s');\r\n\t\t$user->setLastLogin($today);\r\n\t\t$this->dbService->updateObject($user);\r\n\t\tza()->setUser($user);\r\n\t}", "function setTicketId($ticket_id) { $this->ticket_id = $ticket_id; }", "public function __construct(User $user, Ticket $ticket, User $userAuth)\n { \n $this->user = $user;\n $this->ticket = $ticket;\n $this->userAuth = $userAuth;\n\n }", "public function update(User $user, Ticket $ticket)\n {\n return $user->id === $ticket->user_id;\n }", "public function update(Request $request, Ticket $ticket)\n {\n if(Auth::user()->type == 1){\n $validator = Validator::make($request->all(), [\n 'session_id' => 'required',\n 'user_id' => 'required',\n ]);\n if ($validator->fails()) {\n session()->flash('mensagem', 'Dados inválidos');\n return redirect()->route('ticket.edit',$ticket->id);\n }\n $ticket->fill($request->all());\n $ticket->save();\n session()->flash('mensagem', 'Seção atualizado com sucesso!');\n return redirect()->route('ticket.show',$ticket->id);\n }\n else{\n session()->flash('mensagem', 'Acesso restrito a administradores!');\n return redirect()->route('home');\n }\n }", "function customer_register_ticket($ticket_info) {\n $condition = !isset($ticket_info['ticketN']) || !isset($ticket_info['service'])\n || !isset($ticket_info['serviceID']) || !is_numeric($ticket_info['ticketN'])\n || !is_numeric($ticket_info['serviceID']);\n if ($condition)\n return false;\n $_SESSION['ticketN'] = $ticket_info[\"ticketN\"];\n $_SESSION['service'] = $ticket_info[\"service\"];\n $_SESSION['serviceID'] = $ticket_info[\"serviceID\"];\n $_SESSION['pendingTicket'] = true;\n}", "public function answer(User $user, Tickets $ticket): bool\n {\n return ! $ticket->isClosed($ticket) and $ticket->isAuthoredBy($user) or $user->isAdmin();\n }", "function ticketManager($ticketId,$userId){\n// $userId = $this->view->session->storage->user_id; \n $objTicketModel = Application_Model_TicketSystem::getInstance();\n \n $data = $objTicketModel->getTicketDetailsById($ticketId); \n \n $ticketUsers = array();\n \n if(!empty($data['ticket_for'])){ \n \n $ticketUsers = json_decode($data['ticket_for'],true); \n }else{ \n \n $user[] = $userId; \n $edit = json_encode($user,JSON_FORCE_OBJECT); \n $ok = $objTicketModel->updateTicketUsers($edit,$ticketId);\n }\n\n if((is_array($ticketUsers))&&(!empty($ticketUsers))){ \n \n $check = array_search($userId, $ticketUsers);\n \n if($check === false){\n \n array_push($ticketUsers, $userId); \n $edit = json_encode($ticketUsers,JSON_FORCE_OBJECT);\n $ok = $objTicketModel->updateTicketUsers($edit,$ticketId);\n }\n }\n }", "public function view(User $user, Tickets $ticket): bool\n {\n return $ticket->isAuthoredBy($user);\n }", "public function view(User $user, Ticket $ticket)\n {\n return $user->id === $ticket->user_id;\n }", "abstract public function set($cas_ticket, $session_id);", "public function setTicket($ticket)\n\t{\n\t\t$this->ticket = ky_assure_object($ticket, 'kyTicket');\n\t\t$this->ticket_id = $this->ticket !== null ? $this->ticket->getId() : null;\n\t\treturn $this;\n\t}", "public function loginCas($ticket, $service) {\n\t\t$login = Cas::authenticate($ticket, $service);\n if ($login < 0) {\n \t\t\treturn array(\"error\"=>-1, \"error_msg\"=>\"Erreur de login CAS.\");\n }\n\t\t$this->User = new User($login, 1, \"\", 0, 1, 0);\n\t\n\t\t$r = $this->User->getState();\n\t\tif($r == 405){\n\t\t\t$this->loginToRegister = $login;\n\t\t\treturn array(\"error\"=>$r, \"error_msg\"=>\"Le user n'existe pas ici.\");\n\t\t}\n\t\telseif($r != 1) {\n\t\t\treturn array(\"error\"=>$r, \"error_msg\"=>\"Le user n'a pas pu être chargé.\");\n\t\t}\n\t\telse {\n\t\t\treturn array(\"success\"=>\"ok\");\n\t\t}\n }", "public function appendTicket(\\VerifyUserValidTicket $value)\n {\n return $this->append(self::TICKET, $value);\n }", "public function set_user_id(string $login_token, int $user_id) : bool {\n\n\t\treturn $this->db->update(\n\t\t\t//Table\n\t\t\t\"login_tickets\", \n\n\t\t\t//Editions\n\t\t\tarray(\"user_id\" => $user_id), \n\n\t\t\t//Conditions\n\t\t\tarray(\"ticket_token\" => $login_token),\n\n\t\t\t//Limit\n\t\t\t1);\n\n\t}", "public function getTicketByUser($user){\n\t\treturn $this->db->getOne(\"select ticket from onlineuser where user='$user' and expiry>UNIX_TIMESTAMP()\");\n\t}", "public function raiseTicketStore(RaiseTicketFormRequest $request){\n\n $ticketId = uniqid();\n $status = \"Pending\";\n $priority = \"\";\n\n if(!UserDetails::where('emailId', '=', $request->emailId)->exists()){\n UserDetails::create(array_merge($request->all(), ['password'=>'password', 'role'=>'user']));\n }\n\n if($request->preferredContact == 'Email'){\n $contact = $request->emailId;\n }\n else if($request->preferredContact == 'Phone'){\n $contact = $request-> phoneNo;\n }\n //Displaying success message.\n session()->put('success', 'Thanks '.$request->firstName.' for contacting us, your ticket id is '.$ticketId.', we will contact you via '.$request->preferredContact.' on '.$contact.' shortly.');\n\n //Inserting ticket into DB.\n Ticket::create(array_merge($request->all(),['ticketId'=>$ticketId, 'status'=>$status, 'priority'=>$priority]));\n\n //Sending email to user and admin.\n Mail::to($request->emailId)->send(new TicketRaised($request,$ticketId));\n\n return Redirect::route('raiseTicket');\n }", "public function store($ticket, Request $request)\n { //todo moze uzivatel presunut?\n\n $data = $request->all();\n\n $ticketObj = Ticket::find($ticket);\n $areaObj = $ticketObj->area;\n\n if ($data['status'] == 3) {\n\n // presun poziadavky na vyssi level\n\n $oldLevel = $ticketObj->actualStatus()->level;\n $newLevel = $ticketObj->actualStatus()->level + 1;\n\n //presun na vyssiu uroven\n $ticketStatus = TicketStatus::create([\n 'ticket_id' => $ticketObj->id,\n 'user_id' => Auth::user()->id,\n 'status' => $data['status'],\n 'level' => $newLevel,\n 'description' => $data['description']\n ]);\n\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketTransfered($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketTransfered($ticketObj));\n\n\n //notifikacia pre vsetkych adminov urovne $oldLevel\n $managers = $ticketObj->area->managers()\n ->where('users.id', '!=', Auth::user()->id)\n ->wherePivot('level', $oldLevel)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->where('users.id', '!=', Auth::user()->id)\n ->wherePivot('level', $oldLevel)->get()\n );\n\n\n Notification::send($managers, new Manager\\Area\\TicketTransfered($ticketObj));\n\n //notifikacia pre vsetkych adminov urovne $newLevel\n $managers = $ticketObj->area\n ->managers()->wherePivot('level', $newLevel)\n ->where('users.id', '!=', Auth::user()->id)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->wherePivot('level', $newLevel)\n ->where('users.id', '!=', Auth::user()->id)->get()\n );\n\n Notification::send($managers, new Manager\\Area\\TicketTransfered($ticketObj));\n\n } else {\n //zmena stavu\n TicketStatus::create([\n 'ticket_id' => $ticketObj->id,\n 'user_id' => Auth::user()->id,\n 'status' => $data['status'],\n 'level' => $ticketObj->actualStatus()->level,\n 'description' => $data['description']\n ]);\n\n\n if ($data['status'] == env('MANAGER_LEVELS')) {\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketSolved($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketSolved($ticketObj));\n\n } else {\n\n //notifikacia autorovi ticketu\n $ticketObj->user->notify(new User\\TicketUpdated($ticketObj));\n\n //notifikacia manazerovi, ktory upravil ticket\n Auth::user()->notify(new Manager\\TicketUpdated($ticketObj));\n\n $managers = $ticketObj->area->\n managers()->wherePivot('level', $ticketObj->actualStatus()->level)\n ->where('users.id', '!=', Auth::user()->id)->get();\n\n $managers = $managers->concat(\n Area::withoutGlobalScope('not_global')->find(1)\n ->managers()->wherePivot('level', $ticketObj->actualStatus()->level)\n ->where('users.id', '!=', Auth::user()->id)->get()\n );\n\n Notification::send($managers, new Manager\\Area\\TicketUpdated($ticketObj));\n }\n\n //todo notifikacia - pre vsetkch adminov danej urovne tejto oblasti\n\n }\n\n return redirect(action('Management\\TicketController@show', [$ticketObj->id]));\n }", "public function addTicketObserver($ticket, $user = null)\n {\n $args = array(\n 'method' => 'glpi.addTicketObserver',\n 'session' => $this->getSessionHash(),\n 'ticket' => $ticket\n );\n\n if (isset($user)) {\n $args['user'] = $user;\n }\n\n return $this->service->call($args);\n }", "private function setUser()\n {\n $this->cas_user = phpCAS::getUser();\n Session::put('cas_user', $this->cas_user);\n }", "public function __construct($ticket)\n {\n $this->ticket = $ticket;\n }", "public function __construct($ticket){\n\t\t$this->ticket = $ticket;\n\t}", "public function delete(User $user, Ticket $ticket)\n {\n return false;\n }", "private function checkUser()\r\n\t{\r\n\t\t$tmp_user = $this->getRequest()->getSession()->get('user');\r\n\t\t\r\n\t\tif (!$tmp_user) {\r\n\t\t\tthrow new \\Exception('Applications are connected features, go to login page.');\r\n\t\t}\r\n\t\t$this->user = $this->getDoctrine()->getRepository('ScubeBaseBundle:User')->find($tmp_user->getId());\r\n\t}", "public function _setRealUser() {\n\t\t$user = $this->Auth->user();\n\t\t$user['id'] = $user['real_user_id'];\n\t\tunset($user['real_user_id']);\n\n\t\t$this->Auth->login($user);\n\t}", "protected function checkAuth(): void\n {\n $check = get_session_instance()->get('shieldon_user_login');\n\n if (empty($check)) {\n $user = new User();\n $user->setCsrfField($this->getCsrfField());\n\n if ($this->mode === 'demo') {\n $user->demo(\n $this->demoUser['user'],\n $this->demoUser['pass']\n );\n }\n\n $this->resolver($user->login());\n }\n }", "private function setCurrentUser()\n {\n if ( $this->session->userdata ) { //if session => get user props\n $id = $this->session->userdata( 'id' );\n $this->user = $this->user_model->get( $id );\n } else {\n redirect( 'user/login' );\n }\n }", "public function log_user_in(&$Obj_User)\n\t{\n\t\tglobal $CMD;\n\n\t\t//*!*I need to test here for a session id.\n\t\t//There is a need to optimise my session setting/getting using isset($_SESSION['SESSIONID'])\n\t\t//I'm not sure if his is best done here of in the session object itself\n\t\t//It might need to be done in initialise_user() metyhod instead, I'll come back to this\n\n\n\t\t//*!*These checks are yet to be done!\n\t\t//Check that object supplied is of correct type.\n\t\t//Check user credentials against database entries.\n\n\t\t//Get user from the database.\n\t\tif (!$Obj_User->data('id'))\n\t\t{\n\t\t\t$Obj_User = $CMD->model('user', $Obj_User->data('username'));\n\t\t}\n\n\t\t//Set user sesion values.\n\t\t$Int_Timeout = ($Obj_User->data('disable'))? $Obj_User->data('disable'): true;\n\t\t$this->set_session(MW_STR_SESSION_USERLOGN, $Int_Timeout);\n\t\t$this->set_session(MW_STR_SESSION_USERIDEN, $Obj_User->data('id'));\n\t\t$this->set_session(MW_STR_SESSION_USERNAME, $Obj_User->data('username'));\n\t\t$this->set_session(MW_STR_SESSION_USERMAIL, $Obj_User->data('email'));\n\t\t$this->set_session(MW_STR_SESSION_USERSTAT, $Obj_User->data('status'));\n\t\t$this->set_session(MW_STR_SESSION_USERLOCK, $Obj_User->data('lock'));\n\t\t$this->set_session(MW_STR_SESSION_USERVIEW, $Obj_User->data('access'));\n\t\t$this->set_session(MW_STR_SESSION_USEREDIT, $Obj_User->data('access'));\n\t\t//*!*These are the defaults but can be changed.\n\t\t$this->set_session(MW_STR_SESSION_USERVRSN, $CMD->config('version'));\n\t\t$this->set_session(MW_STR_SESSION_USERZONE, $CMD->config('timezone'));\n\t\t$this->set_session(MW_STR_SESSION_USERLANG, $CMD->config('language'));\n\n\n\t\treturn;\n\t}", "public function __construct(User $user,Ticket $ticket,$comment)\n {\n $this->ticket = $ticket;\n $this->user = $user;\n $this->comment = $comment;\n }" ]
[ "0.6585772", "0.6314962", "0.61206514", "0.6040561", "0.6028855", "0.60235405", "0.5977092", "0.59539276", "0.58682036", "0.58347714", "0.5827429", "0.58152854", "0.5747716", "0.5725056", "0.56967354", "0.56777936", "0.56769013", "0.56470966", "0.56336516", "0.55367965", "0.5532732", "0.5502259", "0.54900897", "0.5484464", "0.54675794", "0.5455085", "0.5453695", "0.540525", "0.5403881", "0.5398366" ]
0.64981425
1
/ Remove duplicates from revisions if we just shared the types in changes
public function removeDuplicates($changes, $revisions) { $showRevisions = []; foreach($revisions as $group_id => $labels) { if(isset($changes[$group_id])) { $diff = array_diff_key($revisions[$group_id], $changes[$group_id]); if(!empty($diff)) { $showRevisions[$group_id] = $diff; } } else { $showRevisions[$group_id] = $revisions[$group_id]; } } return $showRevisions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acf_revision_support($types)\n{\n $types['revision'] = 'revision';\n return $types;\n}", "protected function _partitionByType()\n {\n $types = $this->_typeManager->getTypesForCommand();\n $result = array_combine(array_keys($types), array_fill(0, count($types), []));\n\n foreach ($this->_changes as $change) {\n $result[$change->getType()->getCode()][] = $change;\n }\n\n return array_filter($result);\n }", "public function hasRevisions();", "protected function removeDublicates()\n {\n foreach ($this->possibleHookDefs AS $defPath) {\n if ($defPath != $this->getMainDefFile()) {\n $this->unlink($defPath);\n }\n }\n }", "function hook_ENTITY_TYPE_revision_delete(\\Drupal\\Core\\Entity\\EntityInterface $entity) {\n $referenced_files_by_field = _editor_get_file_uuids_by_field($entity);\n foreach ($referenced_files_by_field as $field => $uuids) {\n _editor_delete_file_usage($uuids, $entity, 1);\n }\n}", "function drush_salesforce_mapping_sf_prune_revisions() {\n _drush_salesforce_deprecated();\n\n $limit =\n \\Drupal::service('config.factory')\n ->get('salesforce.settings')\n ->get('limit_mapped_object_revisions');\n if ($limit <= 0) {\n drush_log('Mapped Object revisions limit is 0. No action taken.', 'warning');\n return;\n }\n $etm = \\Drupal::service('entity_type.manager');\n /** @var \\Drupal\\salesforce_mapping\\MappedObjectStorage $storage */\n $storage = $etm\n ->getStorage('salesforce_mapped_object');\n $revision_table = $etm\n ->getDefinition('salesforce_mapped_object')\n ->getRevisionTable();\n $ids = \\Drupal::service('database')\n ->select($revision_table, 'r')\n ->fields('r', ['id'])\n ->having('COUNT(r.id) > ' . $limit)\n ->groupBy('r.id')\n ->execute()\n ->fetchCol();\n if (empty($ids)) {\n drush_log(\"No Mapped Objects with more than $limit revision(s). No action taken.\", 'warning');\n return;\n }\n drush_log('Found ' . count($ids) . ' mapped objects with excessive revisions. Will prune to ' . $limit . ' revision(s) each. This may take a while.', 'ok');\n $total = count($ids);\n $i = 0;\n $buckets = ceil($total / 20);\n if ($buckets == 0) {\n $buckets = 1;\n }\n foreach ($ids as $id) {\n if ($i++ % $buckets == 0) {\n drush_log(\"Pruned $i of $total records.\", 'ok');\n }\n /** @var \\Drupal\\salesforce_mapping\\Entity\\MappedObject $mapped_object */\n if ($mapped_object = $storage->load($id)) {\n $mapped_object->pruneRevisions($storage);\n }\n }\n\n}", "public function disableRevisioning();", "function AJdeleteRevisions() {\n\t$revids = getContinuationVar('revids');\n\t$imageid = getContinuationVar('imageid');\n\t$checkedids = processInputVar('checkedids', ARG_STRING);\n\t$ids = explode(',', $checkedids);\n\tforeach($ids as $id) {\n\t\tif(! is_numeric($id) || ! in_array($id, $revids)) {\n\t\t\theader('Content-Type: text/json-comment-filtered; charset=utf-8');\n\t\t\tprint '/*{\"items\":' . json_encode(array()) . '}*/';\n\t\t\treturn;\n\t\t}\n\t}\n\t$query = \"UPDATE imagerevision \"\n\t . \"SET deleted = 1 \"\n\t . \"WHERE id IN ($checkedids) \"\n\t . \"AND production != 1\";\n\tdoQuery($query, 101);\n\t$html = getRevisionHTML($imageid);\n\t$arr = array('html' => $html);\n\theader('Content-Type: text/json-comment-filtered; charset=utf-8');\n\tprint '/*{\"items\":' . json_encode($arr) . '}*/';\n}", "protected function processDuplicationFromOriginal(): void\n {\n /** @var DataExtension $extension */\n $extension = singleton(DataExtension::class);\n\n if (!$extension->getTopPageUpdate()) {\n return;\n }\n\n $owner = $this->owner;\n\n if (!isset($owner->duplicationOriginal)) {\n return;\n }\n\n $original = $owner->duplicationOriginal;\n\n if (!$original instanceof Page) {\n return;\n }\n\n unset($owner->duplicationOriginal);\n $this->writeDuplication($original);\n }", "public function fixTags()\n {\n $tags = $this->fetchTags();\n\n if (count($tags)) {\n $newest = reset($tags);\n } else {\n $newest = '';\n }\n\n $changes = $this->fetchInfoTxtChanges($newest);\n\n foreach ($changes as $version => $sha) {\n if (!isset($tags[$version])) {\n $this->setTag($sha, $version);\n }\n }\n }", "function removePriorRevisions($fileId, $revision) {\n\t\t$paperFileDao =& DAORegistry::getDAO('PaperFileDAO');\n\t\t$revisions = $paperFileDao->getPaperFileRevisions($fileId);\n\t\tforeach ($revisions as $revisionFile) {\n\t\t\tif ($revisionFile->getRevision() != $revision) {\n\t\t\t\t$this->deleteFile($fileId, $revisionFile->getRevision());\n\t\t\t}\n\t\t}\n\t}", "function diffLogAgainst(Ticket $t2 = null) {\n\t\t$t1 = $this;\n\t\tif($t1->revision < 2) return array();\n\t\t\n\t\tif($t2 === null) {\n\t\t\t$t2 = $this->context->repository->get('vManager\\Modules\\Tickets\\Ticket', array('ticketId' => $t1->id, 'revision' => 0 - ($t1->revision - 1)));\n\t\t\t\n\t\t\tif(!$t2 || !$t2->exists()) return array();\n\t\t}\n\t\t\n\t\t\n\t\t$log = array();\n\t\t\n\t\tforeach($t2->getMetadata()->getFields() as $field) {\n\t\t\tif(in_array($field, array('timestamp', 'author', 'revision', 'comment', 'attachment')))\n\t\t\t\tcontinue;\n\n\t\t\t$change = null;\n\n\t\t\tif($field == 'assignedTo') {\n\t\t\t\tif($t1->$field === null) {\n\t\t\t\t\tif($t2->$field !== $t1->$field)\n\t\t\t\t\t\t$change = __('Reassigned to <strong class=\"value\">nobody</strong>');\n\t\t\t\t} elseif($t2->$field === null || $t2->$field->id != $t1->$field->id) {\n\t\t\t\t\t$change = _x('Reassigned to <strong class=\"value\">%s</strong>', array($t1->$field->exists()\n\t\t\t\t\t\t\t\t\t\t? $t1->$field->username : _x('User n. %d', array($t1->$field->id))));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} elseif($field == 'project') {\n\t\t\t\tif($t1->$field === null) {\n\t\t\t\t\tif($t2->$field !== $t1->$field)\n\t\t\t\t\t\t$change = _x('Removed task from project <strong class=\"value\">%s</strong>', array($t2->$field->name));\n\t\t\t\t} elseif($t2->$field === null || $t2->$field->id != $t1->$field->id) {\n\t\t\t\t\t$change = _x('Moved task under project <strong class=\"value\">%s</strong>', array($t1->$field->exists()\n\t\t\t\t\t\t\t\t\t\t? $t1->$field->name : _x('Project n. %d', array($t1->$field->id))));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} elseif($field == 'priority' && $t1->$field !== null) {\n\t\t\t\tif($t2->$field === null || $t2->$field->id != $t1->$field->id) {\n\t\t\t\t\t$change = _x('Changed priority to <strong class=\"value\">%s</strong>', array($t1->$field->exists()\n\t\t\t\t\t\t\t\t\t\t? $t1->$field->label : __('unknown priority') ));\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t} elseif($t2->data->$field != $t1->data->$field) {\n\t\t\t\n\t\t\t\tif(is_object($t1->$field) && $t1->$field instanceof vBuilder\\Orm\\DataTypes\\DateTime)\n\t\t\t\t\t$change = _x('Changed field <strong class=\"field\">%s</strong> to <strong class=\"value\">%s</strong>', array($field, $t1->$field->format(\"d. m. Y\")));\n\t\t\t\telseif($field == 'state') {\n\t\t\t\t\t$module = vManager\\Modules\\Tickets::getInstance();\n\t\t\t\t\t\n\t\t\t\t\tif(!$t1->getState()->isFinal() && $t2->getState()->isFinal() && count($module->initialTicketStates) < 2)\n\t\t\t\t\t\t\t$change = __('Reopened this ticket');\n\t\t\t\t\telseif($t1->getState()->isFinal())\n\t\t\t\t\t\t\t$change = _x('Resolved this ticket as <strong class=\"field\">%s</strong>', array($t1->getState()->name));\n\t\t\t\t\telse\n\t\t\t\t\t\t\t$change = _x('Changed ticket state to <strong class=\"field\">%s</strong>', array($t1->getState()->name));\n\n\t\t\t\t} elseif($t1->$field == \"\") \n\t\t\t\t\t$change = _x('Unset field <strong class=\"field\">%s</strong>', array($field));\n\t\t\t\telseif(strlen($t1->$field) < 40)\n\t\t\t\t\t$change = _x('Changed field <strong class=\"field\">%s</strong> to <strong class=\"value\">%s</strong>', array($field, $t1->$field));\n\t\t\t\telse\n\t\t\t\t\t$change = _x('Changed field <strong class=\"field\">%s</strong>', array($field));\n\t\t\t}\n\n\t\t\tif($change !== null)\n\t\t\t\t$log[] = \"<div class=\\\"change\\\">$change</div>\";\n\t\t}\n\t\t\n\t\treturn $log;\n\t}", "function hook_entity_revision_delete(\\Drupal\\Core\\Entity\\EntityInterface $entity) {\n $referenced_files_by_field = _editor_get_file_uuids_by_field($entity);\n foreach ($referenced_files_by_field as $field => $uuids) {\n _editor_delete_file_usage($uuids, $entity, 1);\n }\n}", "public function reprocess($variants = ['*']);", "function purgeUnsavedChangeSets() {\t\n\n\t$sets_to_purge = sqlSelect(\"*\", CHANGE_SETS_TABLE, \"scheduler_run_id = \" . scheduler_run()['id'] . \" and when_saved is null\", \"\", (0), \"purgeUnsavedChangeSets()\");\n\tforeach ($sets_to_purge as $i=>$set_to_purge) {\n\t\tsqlDelete(CHANGES_TABLE, \"change_set_id = {$set_to_purge['id']}\", (0), \"purgeUnsavedChangeSets(): deleting changes in change set\");\n\t\tsqlDelete(CHANGE_SETS_TABLE, \"id = {$set_to_purge['id']}\", (0), \"purgeUnsavedChangeSets(): deleting change set\");\n\t}\n}", "function wp_boilerplate_nodes_wpseo_remove_post_types( $post_types ) {\n\t$allowed = apply_filters( 'wp_boilerplate_nodes_allowed_sitemap_post_types', array( 'post', 'page' ) );\n\tforeach ( $post_types as $post_type => $value ) {\n\t\tif ( ! in_array( $post_type, $allowed, true ) ) {\n\t\t\tunset( $post_types[ $post_type ] );\n\t\t}\n\t}\n\n\treturn $post_types;\n}", "public function isRevisioned();", "private function remove_conflicting_shortcodes() {\n\t\tglobal $shortcode_tags;\n\n\t\tforeach ( self::$shortcodes_for_conversion as $key => $shortcode ) {\n\t\t\tif ( isset( $shortcode_tags[ $shortcode ] ) && ( ! is_array( $shortcode_tags[ $shortcode ] ) || ( is_object( $shortcode_tags[ $shortcode ][0] ) && false === strpos( get_class( $shortcode_tags[ $shortcode ][0] ), 'FusionSC' ) ) ) ) {\n\t\t\t\tunset( self::$shortcodes_for_conversion[ $key ] );\n\t\t\t}\n\t\t}\n\t}", "function deleteRevisionHistoryForNodes(array $nids) {\n $node_storage = \\Drupal::entityManager()->getStorage('node');\n $nodes = $node_storage->loadMultiple($nids);\n foreach ($nodes as $node) {\n $default_revision_id = $node->getRevisionId();\n $revision_ids = array_diff($node_storage->revisionIds($node), [ $default_revision_id ]);\n foreach ($revision_ids as $revision_id) {\n logMessage(\"Deleting old revision #$revision_id for node #{$node->id()}.\");\n $node_storage->deleteRevision($revision_id);\n }\n }\n}", "public function delete_duplicates()\r\t{\r\t\t$tweets = $this->mongo_db->get('tweets');\r\t\t$i=$h=0;\r\t\tforeach ($tweets as $tweet)\r\t\t{\r\t\t\t//check if unique tweetid if yes add it to unique_keys\r\t\t\t//for next position check\r\r\t\t\tif (!in_array($unique_keys,$tweet['id'],true))\r\t\t\t{\r\t\t\t\t$unique_keys[$i] = $tweet['id'];//tweet id only\r\t\t\t\t$i++;\r\t\t\t}//else put in non_unique_keys for deletion\r\r\t\t\telse \r\t\t\t{\r\t\t\t\t$non_unique_keys[$h] = $tweet;//tweet object\r\t\t\t\t$h++;\r\t\t\t}\r\r\t\t}//end foreach with non_unique_keys available for deletion\r\r\t\t\r\r\t\tforeach ($non_unique_keys as $tweet)\r\t\t{\t\r\t\t\t$this->mongo_db->delete_all($tweet['id']);\r\t\t\t$this->save_tweets($tweet);\r\t\t}\r\t}", "public function detachAll($type=null){ }", "private function removeDuplicates(): void\n {\n if (is_array($this->value) && count(array_filter(array_keys($this->value), 'is_string')) == 0) {\n $this->value = array_values($this->value);\n }\n }", "function mergeDetailsHiddenDiffDocType(&$base_record, &$dup_record)\r\n\t{\r\n\t\t// not much we can do but will try to rescue any isi_loc or rm_prn\r\n\r\n\t\t// get the values for both records and copy over anything that isn't set in the base.\r\n\t\t$base_det = $base_record->getDetails();\r\n\t\t$dup_det = $dup_record->getDetails();\r\n\r\n\t\t// assumes the sub looping title is the identifier type in caps with no underscore\r\n\t\t$xsdmf_id = $base_record->display->xsd_html_match->getXSDMF_ID_ByElementInSubElement(\r\n\t\t\t\t\t\t\t\t\t\t\t'!identifier','ISI LOC',\r\n\t\t\t\t\t\t\t\t\t\t\t'!identifier');\r\n\t\tif ($xsdmf_id < 0) {\r\n\t\t\t$id_xsdmf_id = $base_record->display->xsd_html_match->getXSDMF_IDByXDIS_ID('!identifier');\r\n\t\t\t$type_xsdmf_id = $base_record->display->xsd_html_match->getXSDMF_IDByXDIS_ID('!identifier!type');\r\n\t\t\t// make sure the base record slots for identifiers are arrays\r\n\t\t\tif (!isset($base_det[$id_xsdmf_id])) {\r\n\t\t\t\t$base_det[$id_xsdmf_id] = array();\r\n\t\t\t} elseif (!is_array($base_det[$id_xsdmf_id])) {\r\n\t\t\t\t$base_det[$id_xsdmf_id] = array($base_det[$id_xsdmf_id]);\r\n\t\t\t}\r\n\t\t\tif (!isset($base_det[$type_xsdmf_id])) {\r\n\t\t\t\t$base_det[$type_xsdmf_id] = array();\r\n\t\t\t} elseif (!is_array($base_det[$type_xsdmf_id])) {\r\n\t\t\t\t$base_det[$type_xsdmf_id] = array($base_det[$type_xsdmf_id]);\r\n\t\t\t}\r\n\t\t\t// copy over the identifiers from the dupe\r\n\t\t\tforeach (array('rm_prn', 'isi_loc', 'isbn','issn') as $id_type) {\r\n\t\t\t\t// don't merge if the identifier type is already in the base record\r\n\t\t\t\tif (in_array($id_type, $base_det[$type_xsdmf_id])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t// copy the identifier over to the base record\r\n\t\t\t\t$dup_id = $this->getIdentifier($dup_record, $id_type);\r\n\t\t\t\tif (!empty($dup_id)) {\r\n\t\t\t\t\t$base_det[$id_xsdmf_id][] = $dup_id;\r\n\t\t\t\t\t$base_det[$type_xsdmf_id][] = $id_type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tforeach (array('rm_prn', 'isi_loc', 'isbn','issn') as $id_type) {\r\n\t\t\t\t$sel_title = str_replace('_', ' ', strtoupper($id_type));\r\n\t\t\t\t$base_xsdmf_id = $base_record->display->xsd_html_match->getXSDMF_ID_ByElementInSubElement(\r\n\t\t\t\t\t\t\t\t\t\t\t'!identifier',$sel_title,\r\n\t\t\t\t\t\t\t\t\t\t\t'!identifier');\r\n\t\t\t\tif (empty($base_det[$base_xsdmf_id])) {\r\n\t\t\t\t\t$dup_id = $this->getIdentifier($dup_record, $id_type);\r\n\t\t\t\t\tif (!empty($dup_id)) {\r\n\t\t\t\t\t\t$base_det[$base_xsdmf_id] = $dup_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $base_det;\r\n\t}", "public function process()\n\t{\n\t\t$aModules = Phpfox::massCallback('removeDuplicateList');\n\t\t$sCheck = $this->request()->get('table');\n\t\t\n\t\t$aLists = array();\n\t\tforeach ($aModules as $sModule => $aList)\n\t\t{\n\t\t\tif (isset($aList['name']))\n\t\t\t{\n\t\t\t\t$aList = array($aList);\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($aList as $iKey => $aRow)\n\t\t\t{\t\t\t\t\n\t\t\t\tif (!empty($sCheck) && $aRow['table'] == $sCheck)\n\t\t\t\t{\n\t\t\t\t\t$mReturn = Phpfox::getService('admincp.maintain')->removeDuplicates($aRow);\n\t\t\t\t\t\n\t\t\t\t\tif ($mReturn === true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->url()->send('admincp.maintain.duplicate', null, Phpfox::getPhrase('admincp.successfully_removed_duplicate_entries'));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$aLists = array_merge($aLists, $aList);\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(Phpfox::getPhrase('admincp.remove_duplicates'))\n\t\t\t->setBreadcrumb('Tools', '#tools')\n\t\t\t->setBreadCrumb('Maintenance', '#maintenance')\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('admincp.remove_duplicates'), $this->url()->makeUrl('admincp.maintain.duplicate'), true)\n\t\t\t->assign(array(\n\t\t\t\t\t'aLists' => $aLists\n\t\t\t\t)\n\t\t\t);\n\t}", "public function detachAll($type=null);", "public function remove_dupe_link( $actions, $post ) { \n\t\tunset($actions['duplicate']); \n\t\treturn $actions; \n\t}", "public function enableRevisioning();", "public function onDeleteAllRevisionsByModel()\n {\n if ($this->readOnly) {\n Flash::error(Lang::get('samuell.revisions::lang.revision.read_only_error'));\n return;\n }\n\n if ($id = $this->model->id) {\n Revision::where('revisionable_id', $id)->delete();\n\n Flash::success(Lang::get('samuell.revisions::lang.messages.all_successfully_deleted'));\n } else {\n Flash::warning(Lang::get('samuell.revisions::lang.messages.model_not_found'));\n }\n\n $this->prepareVars();\n\n return [\n '#RevisionHistory-formHistory-history' => $this->makePartial('revisionhistory-container')\n ];\n }", "private function updatePostTypes()\n {\n $forbidden = apply_filters('cgit_seo_post_types_hidden', [\n 'attachment',\n 'revision',\n 'nav_menu_item',\n 'custom_css',\n 'customize_changeset',\n 'acf-field-group',\n 'acf-field',\n ]);\n \n if($this->isPostsArchivePage()) {\n $forbidden[] = 'page';\n }\n \n $types = array_diff(get_post_types(), $forbidden);\n $types = apply_filters('cgit_seo_post_types', $types);\n \n $this->types = $types;\n }", "public function replace_related_post_types() {\n\n\t\t\t$filters = apply_filters(\n\t\t\t\t'monstroid_dashboard_custom_post_types_args',\n\t\t\t\tarray(\n\t\t\t\t\t'cherry_testimonials_post_type_args',\n\t\t\t\t\t'cherry_portfolio_post_type_args',\n\t\t\t\t\t'cherry_services_post_type_args',\n\t\t\t\t\t'cherry_team_post_type_args',\n\t\t\t\t\t'cherry_slider_post_type_args',\n\t\t\t\t\t'cherry_chart_post_type_args',\n\t\t\t\t\t'cherry_clients_post_type_args',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->iter++;\n\n\t\t\tforeach ( $filters as $filter ) {\n\t\t\t\tadd_filter( $filter, array( $this, 'change_position' ) );\n\t\t\t}\n\n\t\t}" ]
[ "0.54781413", "0.5361245", "0.53100085", "0.5178743", "0.5057766", "0.49383098", "0.4925128", "0.49046275", "0.48884627", "0.4886185", "0.48803627", "0.48789945", "0.48507044", "0.48355034", "0.4795349", "0.4792737", "0.47761965", "0.4741732", "0.4740228", "0.47282588", "0.4728247", "0.4706184", "0.469835", "0.46795133", "0.4675015", "0.46724927", "0.46366683", "0.46295726", "0.4612569", "0.46123382" ]
0.59740514
0
/ Convert change to labels
public function getChangesConverted() { return $this->convertToLabels($this->getChanges(),$this->part); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOriginalLabel();", "abstract protected function getLabels();", "public function convertToLabels($difference)\n {\n $this->label->invited = $this->invited;\n\n if( !empty($difference) && isset($difference[$this->part]) && !empty($difference[$this->part]) )\n {\n return $data[$this->part] = $this->label->getLabels($difference[$this->part],true);\n }\n\n return [];\n }", "public function label($new_value = null)\n {\n }", "public function formatLabels()\n {\n return Collection::make($this->labels)\n ->map(function ($label) {\n return ['label' => $label];\n })\n ->toJson();\n }", "public function getLabel() {}", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "protected function convertTagToString(array &$changes): void\n {\n foreach ($changes as &$hunks) {\n foreach ($hunks as &$block) {\n $block['tag'] = SequenceMatcher::opIntToStr($block['tag']);\n }\n }\n }", "protected function obtain_labels()\n\t{\n\t\t$labels = &$this->labels;\n\n\t\tif ($labels === null)\n\t\t{\n\t\t\t$labels = $this->collect_labels();\n\t\t}\n\n\t\treturn $labels;\n\t}", "abstract public function get_label();", "public function labels()\n\t{\n return array(\n 'name' => 'Projeto',\n 'segmento_id' => 'Segmento',\n 'description' => 'Descrição',\n 'pasta' => 'Pasta',\n );\n\t}", "private function dec_labels()\n {\n foreach ($this->labels as &$level)\n --$level;\n }", "function getLabel();", "function getLabel();", "protected function renameLabels()\n {\n $labelSet = array_flip(array_keys($this->objects));\n \n foreach ($this->objects as $newLabel => $obj) {\n if (isset($labelSet[$newLabel])) {\n $this->objects[$labelSet[$newLabel]] = $obj;\n unset($this->objects[$newLabel]);\n }\n }\n }", "private static function getLabel($resultArray){\r\n\t\t$max = max($resultArray);\r\n\r\n\t\tif( $max == $resultArray[2] ){\r\n\t\t\treturn\"NEG\";\r\n\t\t}\r\n\t\telse if( $max ==$resultArray[1] ){\r\n\t\t\treturn \"NEU\";\r\n\t\t}\r\n\r\n\t\treturn \"POS\";\r\n\t}", "public function renameLabel($params)\n {\n \t$params = $this->toParams($params);\n $params->mode = 'renameLabel';\n $params->required(array('oldlabel', 'newlabel'));\n return $this->_labelsRequest($params);\n }", "private function inc_labels()\n {\n foreach ($this->labels as &$level)\n ++$level;\n }", "public function getLabel() {\n\t}", "public function labels() : array\n {\n return $this->labels;\n }" ]
[ "0.64823216", "0.6244073", "0.6093458", "0.59159833", "0.58717", "0.5804744", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5802685", "0.5750285", "0.57252544", "0.5692569", "0.5672579", "0.56267655", "0.5615338", "0.5615338", "0.55844295", "0.55717003", "0.54848474", "0.5477023", "0.54716593", "0.54714775" ]
0.6791035
0
Directs route in case active ROUTE starts with given $route
function router_direct($route = null) { if ($route === null) { return; } $route = strtolower(trim($route)).'/'; if ( str_starts($route, ROUTE.'/') ) { $routPath = ROUTES.'_'.str_replace('/', '_', $route).'php'; if ( file_exists($routPath) ) { require_once $routPath; exit; } } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getStartRoute();", "public function nextStepRoute($route)\n{ \n $checkoutType = $this->checkDirectOrNot();\n return $checkoutType == \"direct\" ? url(route(\"direct.\".$route)) : url(route($route));\n \n}", "function set_active_route($route) {\n\t\t\t// une chaine de caractères vide\n\t\t\treturn Route::is($route) ? 'active' : '';\n\t\t}", "function route_start($uri, array $except = array())\n{\n if (call_user_func_array('route_except', $except) === false) {\n return false;\n }\n\n if ($uri) {\n $uri = trim($uri, '/');\n }\n\n return $uri && stripos(_rr(), $uri) === 0;\n}", "function isRouteStartsWith($start, $routeName = '')\n{\n $routeName = $routeName ? $routeName : Route::currentRouteName();\n\n return substr($routeName, 0, strlen($start)) == $start;\n}", "public function any( $route, $controller ){\n\t}", "function route($route = null)\n\t{\n\t\tif($route != null){\n\t\t\t$path = rtrim($route, \"/\");\n\t\t\t\t\t\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$countPath = count($path);\n\n\t\t\t//0 => classe\n\t\t\t//1 => acao\n\t\t\t//2 => parametro\n\t\t\t\n\t\t\tswitch($countPath)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\treturn APP_HOST . $path[0] . \"/index\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\treturn APP_HOST . $path[0] . \"/\" . $path[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\treturn APP_HOST . $path[0] . \"/\" . $path[1] . $path[2];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn APP_HOST;\n\t\t\t}\n\t\t}\n\n\t\treturn APP_HOST;\t\t\n\t\t\n\t}", "function router_check($route = null) {\n\t\tif ($route === null) { return; }\n\t\t\n\t\t$routes = array();\n\t\tif ( is_array( $route ) ) {\n\t\t\t$routes = $route;\n\t\t} else {\n\t\t\t\n\t\t\t$routes = array();\n\t\t\t$routes[] = $route;\n\t\t}\n\n\t\t$route = reset($routes);\n\t\tdo {\n\t\t\t$result = str_starts(strtolower(trim($route)).'/', ROUTE.'/') ? true : false;\n\t\t\t$route = next($routes);\n\t\t} while ($result === false && $route !== false );\n\t\t\t\n\t\treturn $result;\n\t\t\n\t}", "public function resolveRoute($route)\n {\n $routeParts = explode('/', $route);\n foreach ($routeParts as $k => $v) {\n if (($k == 0 && $v == $this->id) || (empty($v))) {\n unset($routeParts[$k]);\n }\n }\n if (count($routeParts) == 0) {\n return $this->defaultRoute;\n }\n\n return implode('/', $routeParts);\n }", "private function matchRoute($route)\n {\n if (is_array($route)) {\n return $this->request->routeIs($route[0]);\n }\n return $this->request->routeIs($route);\n }", "function urlFor($route) {\n return container(\"RouterContract\")->generate($route);\n }", "function route($path)\n{\n $route = '';\n if (!empty(MightyCore\\Routing\\RouteStore::$namedRoutes[$path])) {\n $route = MightyCore\\Routing\\RouteStore::$namedRoutes[$path];\n }\n return $route;\n}", "public function alterRoute(Route &$route);", "public static function in($route)\n {\n // Route handler\n $route = self::stripRoute($route);\n $route = ($route) ? $route . '/' : '';\n $route = self::$prefix . $route;\n\n return strpos(self::get() . '/', $route)===0 ? true : false;\n }", "private function isDirectMatch(array $route)\n {\n if ($route['path'] == $this->path) {\n return $route;\n }\n\n return false;\n }", "function getRoute();", "private function routeUrl()\n\t{\n\t\t// If we have a route then use it\n\t\tif( isset( $_GET['route'] ) )\n\t\t{\n\t\t\t// Split sanitizes and trimmed URL\n\t\t\t$route = rtrim($_GET['route'], '/');\n\t\t\t$route = filter_var($route, FILTER_SANITIZE_URL);\n\t\t\t$route = html_entity_decode($route);\n\t\t\t$route = explode('/', $route);\n\t\t\t$this->route = $route;\n\n\t\t\t// If the first part of the rout is 'admin' we are in the admin system\n\t\t\tif(isset($this->route[0]) && $this->route[0] == 'admin')\n\t\t\t{\n\t\t\t\t// Strip the first part of the route as it is admin\n\t\t\t\tarray_shift($this->route);\n\n\t\t\t\t// Route to the correct constructor\n\t\t\t\t$this->route();\n\n\t\t\t}\n\t\t\tif(isset($this->route[0]) && $this->route[0] == 'api')\n\t\t\t{\n\t\t\t\t// Route to the correct constructor\n\t\t\t\t$this->route();\n\t\t\t}\n\t\t\telse // We are not in the admin or api and must deal with the frontend\n\t\t\t{\n\t\t\t\t// We are on the frontend (not admin) and can deal with this\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We are on the home page and can deal with this. Default is admin home\n\t\t}\n\t}", "public function loadByRoute($route);", "public function hasCurrentRoute();", "private function matchRoute() {\n $this->match = $this->router->match();\n #var_dump($match); /* DEBUG */\n\n if(!$this->match) {\n http_response_code(404);\n }\n $this->target = $this->match[\"target\"];\n }", "function route($path, $action) {\n if ($_GET['uri'] === $path) {\n call_user_func($action);\n exit;\n }\n}", "function url($route) {\n if(trim($_SERVER['PHP_SELF'], \"/\") == \"index.php\") {\n echo \"/\" . $route;\n } else {\n $urlmain = str_replace(\"index.php\", \"\", $_SERVER['PHP_SELF']);\n echo \"/\" . trim($urlmain, \"/\") . \"/\" . $route;\n }\n }", "public function direct($uri)\n {\n $uriPart = explode('/', $uri);\n if (array_key_exists($uri,$this->routes)){ //tikrina ar egzistuoja uri masyve\n return $this->routes[$uri];\n } else {\n $newUri = $uriPart[0].\"/\".$uriPart[1];\n if (array_key_exists($newUri, $this->routes)) { //tikrinam ar egzistuoja pirma uri dalis masyve\n// var_dump($uriPart[$newUri]);\n $this->routes[$uri] = $this->routes[$newUri]; //perrasom masyvo elemento ideksa su reikiamu id\n unset($this->routes[$newUri]);\n// var_dump($this->routes);\n if (array_key_exists($uri, $this->routes)) {//tikrinam ar masyve yra rout'as su reikiamu indeksu\n return $this->routes[$uri]; //grazinam faila\n }\n } else {\n return $this->routes[404]; // parasom, kad nieko neradom\n }\n }\n }", "public function route($route)\n {\n /**\n * Register endpoints\n */\n $this->endpoints->baseApiRoot(dirname(__DIR__));\n $this->endpoints->register();\n\n /**\n * Initialise the router\n */\n $this->routerClass = new route\\router();\n $this->routerClass->setOptions($this->getOptions());\n $router = $this->routerClass;\n\n $router->baseApiRoot(dirname(__DIR__));\n $this->router = $router->route($route);\n $this->router->options = $this->getOptions();\n $this->router->auth = $this->auth->user();\n $this->router->limiter = $this->limiter->getThrottle();\n\n /**\n * Endpoint tiers must be larger than 1\n */\n if ($router->getSize() < 2) {\n (new exception\\errorException)\n ->setOptions($this->getOptions())\n ->error('NOT_FOUND');\n }\n\n /**\n * Check if the requested endpoint is allowed\n */\n if (!$this->router->endpoint =\n $this->endpoints->isEndpoint($router->getApi(), $router->getPath())\n ) {\n (new exception\\errorException)\n ->setOptions($this->getOptions())\n ->error('BAD_REQUEST');\n }\n\n $this->router->endpoint->header = [\n 'method' => $this->header->getServerMethod(),\n 'status' => $this->header->getHeaderStatus(),\n 'body' => $this->header->getMethod(),\n ];\n\n /**\n * Check if theres a request payload sent\n */\n if(isset($_REQUEST['payload'])) {\n $router->setRequestBody($_REQUEST['payload']);\n }\n $router->setPostBody($this->header->getBody());\n\n $this->router->payload = $router->getRequestBody();\n $this->router->body = $router->getBody();\n\n /**\n * Check the access scope\n */\n if( !isset($this->router->endpoint->model['scope']) ) {\n $this->router->endpoint->model['scope'] = 'private';\n }\n\n if( isset($this->header->getMethod()->data['scope']) && \n ($this->header->getMethod()->data['scope'] == 'anonymous')\n ) {\n $this->router->endpoint->model['scope'] = 'anonymous';\n }\n\n $router->setScope($this->router->endpoint->model['scope']);\n \n // @codeCoverageIgnoreStart\n if (!$this->auth->isGrantType() && !$this->isMockTest()) {\n if (!$router->systemAccess($this->auth->user())) {\n $this->header->unauthorised();\n }\n }\n // @codeCoverageIgnoreEnd\n\n /**\n * Try run the requests\n */\n if ($router->getScope() !== 'system') {\n $response = $router->run();\n\n } else {\n /*$response = [\n 'system' => $router->getApi(),\n ];*/\n\n $response = $router->run();\n }\n\n $this->setResponse('', $response);\n\n return $this;\n }", "function route($name = null)\n{\n global $routes;\n\n if (!$name) return $routes->route;\n return $routes->getRouteByName($name);\n}", "public function getUrlFromRoute(string $route);", "function _route( $resource = null ) {\n\n\n epl_log( \"init\", \"<pre>\" . print_r( $resource, true ) . \"</pre>\" );\n\n if ( self::$routed )\n return;\n epl_log( \"init\", \"<pre>\" . print_r( $resource, true ) . \"</pre>\" );\n\n\n global $valid_controllers, $post; //When the shortcode is processed, the page id is ready\n\n\n if ( !array_key_exists( $resource, $valid_controllers ) )\n return false;\n\n $epl = & EPL_Base::get_instance();\n $controller_location = $valid_controllers[$resource]['location'];\n\n $controller = $epl->load_controller( $controller_location );\n\n self::$routed = true;\n\n if ( !EPL_IS_ADMIN && !isset( $_REQUEST['epl_action'] ) ) {\n return $controller->run(); //doing this for the shortcode\n }\n }", "protected function forward_to_route(Route $route)\n\t{\n\t\t$route->pattern->match($this->request->uri, $captured);\n\n\t\t$request = $this->request->with([\n\n\t\t\t'path_params' => $captured\n\n\t\t]);\n\n\t\t$request->context->route = $route;\n\n\t\t$controller = $route->controller;\n\n\t\tif (!is_callable($controller))\n\t\t{\n\t\t\t$controller = new $controller;\n\t\t}\n\n\t\treturn $controller($request);\n\t}", "function active($url) {\n global $route;\n return $route['url'] == $url ? 'active' : '';\n}", "static function accept_route(Route $route, Request $request) {\n $class = get_called_class();\n if(isset(self::$acceptors[$class])) goto acception;\n \n $acceptor = new static();\n self::$acceptors[$class] = $acceptor;\n \n acception:\n return self::$acceptors[$class]->accept($route, $request);\n }" ]
[ "0.6969436", "0.65663105", "0.64506245", "0.64024156", "0.63971156", "0.6033306", "0.6031855", "0.59674174", "0.59470963", "0.58600974", "0.5805472", "0.5762444", "0.57605696", "0.5754117", "0.574631", "0.57283616", "0.57209975", "0.57121426", "0.56742454", "0.5658468", "0.5638007", "0.56120515", "0.5606408", "0.55958736", "0.5594086", "0.55900955", "0.5578188", "0.55687964", "0.55645525", "0.5560731" ]
0.7355465
0
Checks if active ROUTE starts with given $route
function router_check($route = null) { if ($route === null) { return; } $routes = array(); if ( is_array( $route ) ) { $routes = $route; } else { $routes = array(); $routes[] = $route; } $route = reset($routes); do { $result = str_starts(strtolower(trim($route)).'/', ROUTE.'/') ? true : false; $route = next($routes); } while ($result === false && $route !== false ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRouteStartsWith($start, $routeName = '')\n{\n $routeName = $routeName ? $routeName : Route::currentRouteName();\n\n return substr($routeName, 0, strlen($start)) == $start;\n}", "public static function in($route)\n {\n // Route handler\n $route = self::stripRoute($route);\n $route = ($route) ? $route . '/' : '';\n $route = self::$prefix . $route;\n\n return strpos(self::get() . '/', $route)===0 ? true : false;\n }", "public function hasCurrentRoute();", "function isRoute($route) {\r\n\t\t\treturn isset( $this->routes[$route] );\r\n\t\t}", "function set_active_route($route) {\n\t\t\t// une chaine de caractères vide\n\t\t\treturn Route::is($route) ? 'active' : '';\n\t\t}", "private function matchRoute($route)\n {\n if (is_array($route)) {\n return $this->request->routeIs($route[0]);\n }\n return $this->request->routeIs($route);\n }", "public static function is($route)\n {\n $route = self::$prefix . self::stripRoute($route);\n\n return self::get()==$route ? true : false;\n }", "public function isRouteExists($route) {\n\n foreach ($this->routes as $Route) {\n if($Route->isMatching($route))\n return true;\n else\n echo $Route->getController().'<br>';\n }\n\n return false;\n }", "static public function route_exists(CmsRoute $route)\n {\n if( !is_array(self::$_routes) ) return FALSE;\n\n foreach( self::$_routes as $test )\n {\n\tif( $test == $route ) return TRUE;\n }\n return FALSE;\n }", "public function match($route)\n {\n if ($this->getOption('route') != $route)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function hasStarted() {\n return $this->_matchedRoute !== null;\n }", "function is_route( $name )\n {\n if( current_route() == strtolower($name))\n {\n return true;\n }\n\n return false;\n }", "private function urlMatchesRoute(&$route) {\n if ($route['method'] != strtolower($this->req->method) && $route['method'] != 'all') {\n return false; }\n if ($route['url'] == '*' || $route['url'] == $this->req->url->path) {\n return true; }\n if ($route['url'] == '/' && $this->req->url->path != $route['url']) {\n return false; } /* Dirty hack for '/' */\n \n $result = array();\n preg_match_all($route['regex'], $this->req->url->path, $result, PREG_PATTERN_ORDER);\n \n if (count($result[0]) > 0) {\n return true; }\n return false;\n }", "function active($url) {\n global $route;\n return $route['url'] == $url ? 'active' : '';\n}", "public function matches($route)\n\t{\n\t\tif ( ! preg_match('#^'. $route . '$#', $this->uri, $subs ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ( count($subs) )\n\t\t{\n\t\t\tunset($subs[0]);\n\t\t}\n\t\t\n\t\t$this->args = array_values($subs);\n\t\t\n\t\treturn true;\n\t}", "public function isResourceRoute($route) {\n $last = array_pop(explode('/',$route));\n\n return preg_match('#^\\[.?:[\\w_]+]$/?#',$last) === 1;\n }", "protected function isItemActive($item,$route)\n\t{\n\t\tif(isset($item['url']) && is_array($item['url']) && !strcasecmp(trim($item['url'][0],'/'),$route))\n\t\t{\n\t\t\tunset($item['url']['#']);\n\t\t\tif(count($item['url'])>1)\n\t\t\t{\n\t\t\t\tforeach(array_splice($item['url'],1) as $name=>$value)\n\t\t\t\t{\n\t\t\t\t\tif(!isset($_GET[$name]) || $_GET[$name]!=$value)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function check($route) {\n if (array_key_exists('access', $route['config'])) {\n $account = $this->get();\n $list = $route['config']['access'];\n\n return ($account === null) ? in_array('guest', $list) : in_array($account->getRank(), $list);\n }\n else {\n return true;\n }\n }", "function route_start($uri, array $except = array())\n{\n if (call_user_func_array('route_except', $except) === false) {\n return false;\n }\n\n if ($uri) {\n $uri = trim($uri, '/');\n }\n\n return $uri && stripos(_rr(), $uri) === 0;\n}", "public static function interestedInRoute(Route $route)\n {\n $controllerName = $route->getDefault('_controller');\n $topName = strtok($controllerName, ':\\\\.');\n\n return 'AppBundle' === $topName || 'App' === $topName;\n }", "public function hasRoute($name);", "public function is_route()\n {\n if (!array_key_exists($this->route, $this->routes)) {\n return false;\n } else {\n return true;\n }\n }", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "function current_route_is( $name ) {\n\t$route = request()->getLoadedRoute();\n\n\tif ( $route ) {\n\t\treturn $route->hasName( $name );\n\t}\n\n\treturn false;\n\n}", "public function match($route, $request)\n {\n if (!isset($this->_routes[$route])) {\n return false;\n }\n\n return (bool)preg_match($this->_routes[$route]['regex'], $request);\n }", "public function routeExists($route)\n\t{\n\t\treturn array_key_exists($route, $this->config);\n\t}", "public function isEnabledRoute($route)\n {\n foreach ($this->getEnabledRoutes() as $enabledRoute) {\n if (false !== strpos($route, $enabledRoute)) {\n return true;\n }\n }\n\n return false;\n }", "private function routeExists($url)\n { \n return $this->routes->offsetExists($url);\n }", "public function hasRoute()\n {\n return !empty($this->route);\n }", "protected function routeBelongsToComponent(Route $route)\n {\n return strpos($route->getName(), 'two_factor_auth') !== false;\n }" ]
[ "0.7387148", "0.72288793", "0.7210324", "0.70960057", "0.6831162", "0.67912006", "0.67021775", "0.6695668", "0.658513", "0.65720767", "0.64957637", "0.6477835", "0.6442035", "0.6429862", "0.6428256", "0.6383125", "0.63036764", "0.628459", "0.62845415", "0.6280972", "0.62678134", "0.6261592", "0.62572837", "0.62572837", "0.6252751", "0.6202249", "0.6198751", "0.6197725", "0.61612254", "0.61255044" ]
0.7277798
1
Render post preview button
static function renderPreviewButton(string $form, string $area): string { return '<button class="post-form-preview" onclick="Sunlight.postPreview(this, \'' . $form . '\', \'' . $area . '\'); return false;">' . _lang('global.preview') . '</button>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dp_preview_button_options( $post, $post_id){\n\tglobal $post;\n\n\t$dp_preview_button = get_post_meta( $post->ID, 'dp_preview_button', true);\n\n\techo '<div class=\"preview_button\"> </div>';\n}", "public function showPreview($postPreview, $title = null);", "public function previewAction() {\n\n // Получим обьект сообщения\n $request = $this->getRequest();\n $post_id = (int) $request->getQuery('id');\n $post = new Default_Model_DbTable_BlogPost($this->db);\n\n if (!$post->loadForUser($this->_identity->user_id, $post_id)) {\n $this->_redirect('/blogmanager');\n }\n // Отображение ошибок\n if ($request->getQuery('message')) {\n $this->view->class_message = $request->getQuery('class_message');\n $this->view->message = $request->getQuery('message');\n }\n\n // Set PHP config\n Default_Plugin_FileUploader::iniSetConfig_PHP(array('image', 'audio', 'video'));\n\n $this->_breadcrumbs->addStep($this->Translate('Просмотр сообщения') . ': ' . $post->profile->title);\n\n $this->view->username = $this->_identity->username;\n $this->view->post = $post;\n }", "public function meta_box_preview( $post ) {\n\t\tglobal $pagenow;\n\n\t\tif ( 'post-new.php' === $pagenow ) {\n\t\t\t?>\n\t\t\t<p><?php esc_html_e( 'Save your new form to see a preview.' ); ?></p>\n\t\t\t<?php\n\t\t} else {\n\t\t\t?>\n\t\t\t<div class=\"ccf-form-cpt-preview\" data-form-id=\"<?php echo (int) $post->ID; ?>\">\n\t\t\t\t<div class=\"spinner\"></div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t}", "function pb_meta_preview_content( $post )\n{\n\t?>\n\t<p><strong>Please Note:</strong> The preview might look much different on the actual site.</p>\n\t<hr>\n\t<div id=\"pbPreview\"></div>\n\t<?php\n}", "public function add_view_btn( $post ) {\n\t\tif ( $this->post_type == $post->post_type ) {\n\t\t\techo sprintf( '<a href=\"%s\" class=\"button\">%s</a>', \n\t\t\t\tesc_url( add_query_arg( 'tf', 1, get_permalink( $post->ID ) ) ),\n\t\t\t\t__('Switch to frontend', 'themify-flow') \n\t\t\t);\n\n\t\t}\n\t}", "public function media_buttons() {\n\t\tglobal $pagenow, $typenow, $wp_version;\n\n\t\t$button = '';\n\n\t\tif ( in_array( $pagenow, array( 'post.php', 'page.php', 'post-new.php', 'post-edit.php' ) ) ) {\n\t\t\t$icon = '<span class=\"wp-media-buttons-icon dashicons dashicons-star-filled\"></span>';\n\t\t\t$button = '<a href=\"#TB_inline?width=640&inlineId=edd-choose-review\" class=\"thickbox button edd-reviews-thickbox\" title=\"' . __( 'Insert Review', 'edd-reviews' ) . '\">' . $icon . __( 'Insert Review', 'edd-reviews' ) . '</a>';\n\t\t}\n\n\t\techo $button;\n\t}", "public function display_button_on_single() {\n\t\tglobal $wp_query;\n\n\t\t$post_ids = array();\n\n\t\t// gather all ids\n\t\tforeach( $wp_query->posts as $post ) {\n\t\t\t$post_ids[] = $post->ID;\n\t\t}\n\n\t\t$output = '';\n\t\t$output .= '<p class=\"wc-store-catalog-pdf-download\">' . PHP_EOL;\n\n\t\t$output .= '<a href=\"#\" class=\"wc-store-catalog-pdf-download-link button\" target=\"_blank\" download=\"\"><i class=\"icon-file-pdf\" aria-hidden=\"true\"></i> ' . $this->link_label . '</a>' . PHP_EOL;\n\n\t\t$output .= '<input type=\"hidden\" value=\"true\" name=\"is_single\" />' . PHP_EOL;\n\n\t\t$output .= '<input type=\"hidden\" value=\"' . esc_attr( json_encode( $post_ids ) ) . '\" name=\"posts\" />' . PHP_EOL;\n\n\t\t$output .= '</p>' . PHP_EOL;\n\n\t\techo $output;\n\t}", "protected function preview()\n {\n return $this->objectUrl(Admin::url()->image($this->value));\n }", "function post_preview() {\n\n\t$post_ID = (int) $_POST['post_ID'];\n\t$_POST['ID'] = $post_ID;\n\n\t$post = get_post( $post_ID );\n\tif ( ! $post ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t}\n\n\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\twp_die( __( 'Sorry, you are not allowed to edit this post.' ) );\n\t}\n\n\t$is_autosave = false;\n\n\tif ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author\n\t\t&& ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status )\n\t) {\n\t\t$saved_post_id = edit_post();\n\t} else {\n\t\t$is_autosave = true;\n\n\t\tif ( isset( $_POST['post_status'] ) && 'auto-draft' === $_POST['post_status'] ) {\n\t\t\t$_POST['post_status'] = 'draft';\n\t\t}\n\n\t\t$saved_post_id = wp_create_post_autosave( $post->ID );\n\t}\n\n\tif ( is_wp_error( $saved_post_id ) ) {\n\t\twp_die( $saved_post_id->get_error_message() );\n\t}\n\n\t$query_args = array();\n\n\tif ( $is_autosave && $saved_post_id ) {\n\t\t$query_args['preview_id'] = $post->ID;\n\t\t$query_args['preview_nonce'] = wp_create_nonce( 'post_preview_' . $post->ID );\n\n\t\tif ( isset( $_POST['post_format'] ) ) {\n\t\t\t$query_args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] );\n\t\t}\n\n\t\tif ( isset( $_POST['_thumbnail_id'] ) ) {\n\t\t\t$query_args['_thumbnail_id'] = ( intval( $_POST['_thumbnail_id'] ) <= 0 ) ? '-1' : intval( $_POST['_thumbnail_id'] );\n\t\t}\n\t}\n\n\treturn get_preview_post_link( $post, $query_args );\n}", "function button_before_main_editor( $post ) {\n\techo '<div class=\"hummer\" style=\"text-align: right;\"><a href=\"#\" id=\"il_builder-trigger\" class=\"button button-primary button-large\">Inject Layout Builder</a></div>';\n\n}", "function media_button() {\n global $post_ID, $temp_ID;\n $title = $this->title;\n $iframe_post_id = (int) ( 0 == $post_ID ? $temp_ID : $post_ID );\n $site_url = admin_url(\"/admin-ajax.php?post_id=$iframe_post_id&amp;action=shortcode_popup-$this->shortcode&amp;TB_iframe=true&amp;width=768\");\n echo \"<a href=$site_url&id=add_form' onclick='return false;' id='popup' class='thickbox' title='$title'><img src='$this->icon_url' alt='$title' width='15' height='15' /></a>\";\n }", "function displayPreview($args = array()){\n global $DOPBSP;\n \n $field = $args['field'];\n $language = isset($args['language']) && $args['language'] != '' ? $args['language']:$DOPBSP->classes->backend_language->get();\n $select_options = isset($args['select_options']) ? $args['select_options']:'';\n?>\n <div class=\"dopbsp-preview-wrapper\">\n <div class=\"dopbsp-preview dopbsp-input-wrapper\">\n<?php\n if ($field->type != 'checkbox'){\n echo '<label id=\"DOPBSP-form-field-label-preview-'.$field->id.'\" for=\"DOPBSP-form-field-preview-'.$field->id.'\">'.$DOPBSP->classes->translation->decodeJSON($field->translation, $language).' <span class=\"dopbsp-required\">'.($field->required == 'true' ? '*':'').'</span></label>';\n }\n \n switch ($field->type){\n case 'checkbox':\n?> \n <input type=\"checkbox\" name=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" id=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" disabled=\"disabled\" />\n <label id=\"DOPBSP-form-field-label-preview-<?php echo $field->id; ?>\" for=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" class=\"dopbsp-left\"><?php echo $DOPBSP->classes->translation->decodeJSON($field->translation, $language); ?> <span class=\"dopbsp-required\"><?php echo $field->required == 'true' ? '*':''; ?></span></label>\n<?php\n break;\n case 'select':\n?> \n <select name=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" id=\"DOPBSP-form-field-preview-<?php echo $field->id; ?>\" value=\"\" disabled=\"disabled\"<?php echo $field->multiple_select == 'true' ? ' multiple=\"multiple\"':''; ?>>\n<?php\n $i = 0;\n \n foreach ($select_options as $select_option){\n $i++;\n echo '<option value=\"'.$i.'\">'.$DOPBSP->classes->translation->decodeJSON($select_option->translation, $language).'</option>';\n }\n?>\n </select>\n <script type=\"text/JavaScript\">\n jQuery('#DOPBSP-form-field-preview-<?php echo $field->id; ?>').DOPSelect();\n </script>\n<?php \n break;\n case 'text':\n echo '<input type=\"text\" name=\"DOPBSP-form-field-preview-'.$field->id.'\" id=\"DOPBSP-form-field-preview-'.$field->id.'\" value=\"\" disabled=\"disabled\" />';\n break;\n case 'textarea':\n echo '<textarea name=\"DOPBSP-form-field-preview-'.$field->id.'\" id=\"DOPBSP-form-field-preview-'.$field->id.'\" value=\"\" disabled=\"disabled\"></textarea>';\n break;\n }\n?>\n </div>\n <div class=\"dopbsp-buttons-wrapper\">\n <a href=\"javascript:DOPBSPBackEndFormField.toggle(<?php echo $field->id; ?>)\" class=\"dopbsp-button dopbsp-toggle\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_FIELD_SHOW_SETTINGS'); ?></span></a>\n <a href=\"javascript:DOPBSPBackEnd.confirmation('FORMS_FORM_DELETE_FIELD_CONFIRMATION', 'DOPBSPBackEndFormField.delete(<?php echo $field->id; ?>)')\" class=\"dopbsp-button dopbsp-delete\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_DELETE_FIELD_SUBMIT'); ?></span></a>\n <a href=\"javascript:void(0)\" class=\"dopbsp-button dopbsp-handle\"><span class=\"dopbsp-info\"><?php echo $DOPBSP->text('FORMS_FORM_FIELD_SORT'); ?></span></a>\n </div>\n <br class=\"dopbsp-clear\" />\n </div>\n<?php \n }", "public function preview($args) {\n }", "function air_helper_post_preview_message() {\n\tprintf( '<br /><p style=\"color:#ddd;\">%s</p>', __( 'Two preview times might be needed to see all content correctly.', 'air-helper' ) );\n}", "function wp2_btn_func_preview( $atts, $content=null ) {\r\n extract(shortcode_atts( array(\r\n 'selected_btn' => '',\r\n 'selected_btn_size' => '',\r\n 'button_text' => 'Add to cart',\r\n 'button' => '',\r\n 'button_icon' => '',\r\n 'button_bg' => '',\r\n 'button_fg' => '',\r\n ), $atts));\r\n \r\n $data = '';\r\n\r\n if(strpos($selected_btn, 'outline') !== false)\r\n {\r\n \r\n $data .= '\r\n <div class=\"wp2-btn\">\r\n <a style=\"background:' . $button_bg . ';color:' . $button_fg . ';border: 1px solid ' . $button_fg . ';\" \r\n class=\"'.$selected_btn.' '.$selected_btn_size.'\" href=\"' . $button . '\" target=\"_blank\"><i class=\"'.$button_icon.'\"></i> ' . $button_text . '</a>\r\n </div>';\r\n }else{\r\n $data .= '\r\n <div class=\"wp2-btn\">\r\n <a style=\"background:' . $button_bg . ';color:' . $button_fg . ';border:' . $button_bg . ';\" \r\n class=\"'.$selected_btn.' '.$selected_btn_size.'\" href=\"' . $button . '\" target=\"_blank\"><i class=\"'.$button_icon.'\"></i> ' . $button_text . '</a>\r\n </div>';\r\n }\r\n\r\n return $data;\r\n}", "public function previewAction()\n {\n $this->container->get('contao.framework')->initialize();\n\n $controller = new BackendPreview();\n\n return $controller->run();\n }", "public function preview_entry() {\n $entry = $this->get_entry();\n\n if ($entry === false) {\n die('-1');\n }\n\n if ($entry->get_can_preview_by_cloud() === false) {\n die('-1');\n }\n\n if ($this->get_processor()->get_user()->can_preview() === false) {\n die('-1');\n }\n\n /* Preview for Media files in HTML5 Player */\n if (in_array($entry->get_extension(), array('mp4', 'm4v', 'ogg', 'ogv', 'webmv', 'mp3', 'm4a', 'ogg', 'oga'))) {\n if ($this->has_shared_link($entry)) {\n $temporarily_link = $this->get_shared_link($entry) . '?raw=1';\n } else {\n $temporarily_link = $this->get_temporarily_link($entry);\n }\n header('Location: ' . $temporarily_link);\n die();\n }\n\n /* Preview for Image files */\n if (in_array($entry->get_extension(), array('txt', 'pdf', 'jpg', 'jpeg', 'gif', 'png'))) {\n $shared_link = $this->get_shared_link($entry);\n header('Location: ' . $shared_link . '?raw=1');\n die();\n }\n\n /* Preview for PDF files */\n /* Preview for Excel files */\n if (in_array($entry->get_extension(), array('xls', 'xlsx', 'xlsm'))) {\n header('Content-Type: text/html');\n } else {\n header('Content-Disposition: inline; filename=\"' . $entry->get_basename() . '.pdf\"');\n header('Content-Description: \"' . $entry->get_basename() . '\"');\n header('Content-Type: application/pdf');\n }\n\n try {\n $preview_file = $this->_client->preview($entry->get_path());\n echo $preview_file->getContents();\n } catch (\\Exception $ex) {\n die('-1');\n }\n\n die();\n }", "public function template() {\n\t\t?>\n <div class=\"input-with-button\">\n <input id=\"{{ id }}\" type=\"hidden\" name=\"{{ name }}\" value=\"{{ value }}\"\n class=\"carbon-image-gallery-field\"/>\n\n <span id=\"c2_open_media{{ id.replace('-', '_') }}\" class=\"button c2_open_media\">\n\t\t\t\t{{{ button_label }}}\n\t\t\t</span>\n </div>\n\n {{{ description }}}\n\t\t<?php\n\t}", "private function preview( $attributes = [] ) {\n\t\tunset( $attributes['align'] );\n\n\t\t$post_id = filter_input( INPUT_POST, 'post_id', FILTER_SANITIZE_NUMBER_INT );\n\t\t$this->render_block( $attributes, true, $post_id );\n\t}", "public function preview(ColumnBuilder $preview): void\n {\n $preview->image('Image')->src('{image.url}');\n }", "function getPreviewLink()\n {\n }", "protected function DisplayPost()\n\t{\n\t\t\n\t}", "public function slider_preview_link( $url ){\n\t\tglobal $post;\n\t\tif( !$post || parent::get_type_slider() != $post->post_type ){\n\t\t\treturn $url;\n\t\t}\n\t\t\n\t\t$preview_args = array(\n\t\t\t'post_id' \t=> $post->ID,\n\t\t\t'theme' \t=> ( isset( $_POST['theme']['active'] ) ? $_POST['theme']['active'] : '' ),\n\t\t\t'vars'\t\t=> array(\n\t\t\t\t'color' => ( isset( $_POST['theme']['color'] ) ? $_POST['theme']['color'] : '' )\n\t\t\t),\n\t\t\t'echo'\t\t=> false\n\t\t);\n\t\t$url = fa_slider_preview_homepage( $preview_args );\n\t\treturn htmlspecialchars_decode( $url );\n\t}", "protected function showPostAction()\n {\n $this->dispatch(EasyAdminEvents::PRE_SHOW);\n\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $fields = $this->entity['show']['fields'];\n $deleteForm = $this->createDeleteForm($this->entity['name'], $id);\n\n $this->dispatch(EasyAdminEvents::POST_SHOW, array(\n 'deleteForm' => $deleteForm,\n 'fields' => $fields,\n 'entity' => $entity,\n ));\n\n return $this->render('@EasyAdmin/default/show_gen.html.twig', array(\n 'entity' => $entity,\n 'fields' => $fields,\n 'delete_form' => $deleteForm->createView(),\n 'tabla_doctrine' => 'BlogiridianBundle:GaleriaPost',\n 'tabla' => 'GaleriaPost',\n 'campo' => 'post',\n 'ruta' => $this->container->getParameter('app.path.blogs')\n ));\n }", "function pp_builder_preview_handler() {\n\tif ( isset( $_GET['action'] ) && $_GET['action'] == 'pp-builder-preview' ) {\n\t\tinclude VIEWS . '/live-preview/builder-preview.php';\n\t}\n\t// if ajax post request is received return the parsed shortcode\n\telseif ( isset( $_POST['builder_structure'] ) && ! empty( $_POST['builder_structure'] ) ) {\n\t\techo do_shortcode( stripslashes( $_POST['builder_structure'] ) );\n\t}\n\n\t// IMPORTANT: don't forget to \"exit\"\n\texit;\n\n}", "protected function preview()\n {\n return $this->objectUrl($this->value);\n }", "public function custom_button( WP_Post $post ) {\n\t\t/**\n\t\t * Check if the post type is whitelisted to be clonable and we're not\n\t\t * trying to clone a trashed/pending review post.\n\t\t */\n\t\tif ( ! is_post_clonable( $post ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// User is not allowed to clone posts - bail.\n\t\tif ( ! can_user_clone() ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Assemble the clone button text.\n\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t$text = sprintf( '%1$s %2$s',\n\t\t\t__( 'Clone', 'post-cloner' ),\n\t\t\t$post_type->labels->singular_name\n\t\t);\n\n\t\t?>\n\t\t<div class=\"clone-actions misc-pub-section\">\n\t\t\t<a href=\"<?php echo esc_url( $this->clone_post_link( $post->ID ) ); ?>\" id=\"clone_post\" class=\"button\"><?php echo esc_html( $text ); ?></a>\n\t\t</div>\n\t\t<?php\n\t}", "public function preview()\n\t{\n\t\tJRequest::checkToken() or jexit(JText::_('JInvalid_Token'));\n\n\t\t// Initialise some variables\n\t\t$app\t\t= JFactory::getApplication();\n\n\t\t$model = $this->getModel('HotelProfile');\n\t\t\n\t\t$post = JRequest::get('post');\t\t\n\t\t$result = $model->saveTransport($post);\n\t\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_sfs&view=hotelprofile&layout=formtransport&Itemid='.JRequest::getInt('Itemid').'&preview=1', false));\t\t\n\t}", "function dp_return_save_draft_button(&$postform) {\n\n // Add the save draft button.\n $postform->insertElementBefore($postform->createElement('button', 'savedraft',\n get_string('savedraft', 'local_draftposts'),\n 'class=\"savedraftbtn\", onclick=\"M.local_draftposts.save_draft();\"'),\n 'submitbutton');\n\n}" ]
[ "0.75047165", "0.6975049", "0.6851837", "0.68347114", "0.6794569", "0.6660964", "0.65175617", "0.6429245", "0.63936806", "0.6349182", "0.62911236", "0.62840295", "0.621546", "0.6196338", "0.6189984", "0.61392576", "0.61359036", "0.6127964", "0.6101332", "0.6062235", "0.6052376", "0.60520375", "0.6041726", "0.603183", "0.60083884", "0.6003126", "0.6002487", "0.5966796", "0.5961743", "0.59468454" ]
0.7040491
1
Method for finding a miner by $minerId and checking of user privileges to work with the found miner
protected function findMinerWithCheckAccess($minerId){ try{ /** @var Miner $miner */ $miner=$this->minersFacade->findMiner($minerId); }catch (\Exception $e){ $this->error('Requested miner was not found.'); return null; } $this->checkMinerAccess($miner); return $miner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkMinerAccess($miner) {\n if(!$this->minersFacade->checkMinerAccess($miner, $this->getCurrentUser())) {\n throw new UnauthorizedRequestException('You are not authorized to use the selected miner!');\n }\n }", "public static function giveMod($id) {\r\n $app = Aplicacion::getSingleton();\r\n $conn = $app->conexionBd();\r\n $sql = 'UPDATE users SET moderator = 1 WHERE id = '.$id.'';\r\n $result = $conn->query($sql);\r\n return $result;\r\n }", "public function start_miner()\n\t{\n\t\tif (!$this->session->userdata(\"loggedin\"))\n\t\t\tredirect('app/index');\n\t\t\n\t\tif (!$this->util_model->isOnline())\n\t\t\t$this->util_model->minerdStart();\n\t\telse\n\t\t{\n\t\t\t$this->session->set_flashdata('message', \"<b>Warning!</b> Your miner is currently mining, before you can start it you need to stop it before, or try the restart link.\");\n\t\t}\n\t\t\t\n\t\t\n\t\tredirect('app/dashboard');\n\t}", "function _checkMiner($miner_address = FALSE, $redis) {\n if ($miner_address && !$redis->exists($miner_address)) {\n $redis->hmset($miner_address, [\n 'time_created' => time(),\n 'time_date' => date(\"Y-m-d h:i:sa\"),\n 'blocks_found' => 0,\n 'shares_valid' => 0,\n 'shares_invalid' => 0,\n 'shares_total_valid' => 0,\n 'shares_total_invalid' => 0\n ]);\n }\n}", "public static function getWorker($id)\n {\n $role = Role::where_name('worker')->first();\n $worker = $role->users()->where_user_id($id)->get();\n\n if($worker)\n {\n return Response::eloquent($worker);\n }\n return Response::json(array('error'=>'Worker Doesn\\'t Exists'));\n }", "function userManagement($id)\n{\n /* Checks if user is an admin */\n if (adminCheck($_SESSION['mail'])) {\n $users = displayJson();\n /* Checks if the user clicked on a mdofiy button */\n if (isset($id)) {\n $user = getUserById($id);\n require_once \"view/userManagementHome.php\";\n } else {\n require_once \"view/userManagementHome.php\";\n }\n } else {\n require_once \"view/adminError.php\";\n }\n\n\n}", "public function dohvSmestajId($idRezervacija){\n return $this->where('id',$idRezervacija)->first()->idSmestaj;\n }", "public function getMining()\n {\n return $this->Mining;\n }", "public function set_wager ($wager_id) {\n foreach ($this->wagers as $wager) {\n if ($wager->id == $wager_id) {\n return $wager;\n }\n }\n }", "public function run($id)\n {\n $model = $this->findModel($id);\n\n if ($this->checkAccess) {\n call_user_func($this->checkAccess, $this->id, $model);\n }\n\n if (!Yii::$app->adminuser->identity->is_api_user) {\n $modelClass = $this->modelClass;\n $table = $modelClass::tableName();\n $alias = Yii::$app->adminmenu->getApiDetail($modelClass::ngRestApiEndpoint());\n UserOnline::lock(Yii::$app->adminuser->id, $table, $id, 'lock_admin_edit_crud_item', ['table' => $alias['alias'], 'id' => $id, 'module' => $alias['module']['alias']]);\n }\n \n return $model;\n }", "public function getModeratorId(){\r\n return $this->id;\r\n }", "function job_search_miner($miner_id)\n{\n\t$query = \"SELECT `id` FROM `site_jobs` WHERE `miner_id` = '\".$miner_id.\"' AND `status` = 'pending';\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$records = mysql_num_rows($result);\n\treturn $records;\n}", "function getUserPrivilege($user_id)\n{\n include(\"dbForGreeley.php\");\n $results = $mysqli->query(\"SELECT * FROM loginInfo\");\n if($results)\n {\n for ($i = 0; $i < $results->num_rows; $i++)\n {\n $results->data_seek($i);\n $row = $results->fetch_assoc();\n if($user_id == $row['user_id'])\n {\n $userPrivilege = $row['privilegeTier'];\n /*Lower the privilege, higher the authority\n *-1= Webmaster-2= Principal, 3=Schedulers, 4=Teachers, 5=Students\n */\n return $userPrivilege;\n }\n }\n }\n}", "function getUserStamm( $id, $login = false ) {\n if ( $login ) {\n $sql = \"select * from employee where login = '$login'\";\n }\n else {\n $sql = \"select * from employee where id=$id\";\n }\n $daten = $GLOBALS['dbh']->getOne( $sql );\n $id = $daten['id'];\n if ( !$daten ) {\n return false;\n }\n else {\n $sql = \"select * from gruppenname N left join grpusr G on G.grpid=N.grpid where usrid=$id\";\n $rs2 = $GLOBALS['dbh']->getAll( $sql );\n $daten[\"gruppen\"] = $rs2;\n //Mandanteneinstellungen\n $sql = \"SELECT key, val FROM crmdefaults WHERE employee = -1\";\n $rs = $GLOBALS['dbh']->getAll( $sql );\n if ( $rs )\n foreach ( $rs as $row ) {\n $daten[$row['key']] = $row['val'];\n }\n //Usereinstellungen\n $sql = \"SELECT * FROM crmemployee WHERE uid = $id AND manid = \".$_SESSION['manid'];\n $rs = $GLOBALS['dbh']->getAll( $sql );\n if ( $rs ) {\n foreach ( $rs as $row ) {\n if ( $row['typ'] == 'i' ) {\n $daten[$row['key']] = (int) $row['val'];\n }\n elseif ( $row['typ'] == 'f' ) {\n $daten[$row['key']] = (float) $row['val'];\n }\n elseif ( $row['typ'] == 'b' ) {\n $daten[$row['key']] = ( $row['val'] == 't' ) ? true : false;\n }\n else {\n $daten[$row['key']] = $row['val'];\n }\n }\n }\n else { //neuer Benutzer hat ja noch keine Einträge in crmemployee\n loadUserDefaults($id);\n }\n if ( $daten[\"vertreter\"] ) {\n $sql = \"select * from employee where id=\".$daten[\"vertreter\"];\n $rs3 = $GLOBALS['dbh']->getOne( $sql );\n $daten[\"vname\"] = ( $rs3['name'] != '' ) ? $rs3[\"name\"] : $rs3[\"login\"];\n };\n $sql = \"SELECT signature FROM defaults\";\n $rs = $GLOBALS['dbh']->getOne($sql);\n if ( $rs ) $daten['msignature'] = $rs['signature'];\n return $daten;\n }\n}", "public function mineral()\n {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('App\\Models\\Mineral');\n }", "public function edit($id)\n\t{\n\t\t$requester = Requester::findOrFail($id);\n\t\treturn $requester;\n\t}", "public function getOnwer() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->user_id);\n }", "public function show($moderatorId)\n {\n try{\n\n /**\n * Here we check the coming client id wheter a number or not.\n * If a number we will store it in the moderatorId variable.\n * If not a number we will assign the variable to zero\n */\n $moderatorId = intval($moderatorId) ? $moderatorId : 0;\n\n /**\n * System will call the client with the coming id\n */\n $moderator = Moderator::with(\"account\")->where(\"moderatorId\", $moderatorId)->first();\n\n /**\n * System checks the moderator if exists or not.\n * If no moderator is found in the moderators table, system will return an error\n */\n if($moderator == null){\n $error = new Error(null);\n $error->errorMessage = \"There is no moderator with this id\";\n $error->messageInArabic = \"لا يوجد مشرف مسجل\";\n $error->statusCode = 404;\n throw $error;\n }\n\n\n return response()->json([\n \"moderator\" => $moderator,\n \"statusCode\" => 200,\n ], 200);\n \n\n }catch(Error $err){\n return response()->json([\n \"message\" => $err->errorMessage,\n \"messageInArabic\" => $err->messageInArabic,\n \"statusCode\" => $err->statusCode\n ], $err->statusCode);\n \n }\n }", "public function userHireAction($userInternshipId) {\n //check for logrdin company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //return $this->redirect($this->generateUrl('site_homepage', array(), TRUE));\n $this->getRequest()->getSession()->set('redirectUrl', $this->getRequest()->getRequestUri());\n return $this->redirect($this->generateUrl('login'));\n }\n\n //get logedin user objects\n $user = $this->get('security.context')->getToken()->getUser();\n $em = $this->getDoctrine()->getEntityManager();\n $userInternshipRepo = $em->getRepository('ObjectsInternJumpBundle:UserInternship');\n\n //get the userInternship object\n $userInternship = $userInternshipRepo->find($userInternshipId);\n if (!$userInternship || $userInternship->getUser()->getId() != $user->getId()) {\n $message = $this->container->getParameter('request_not_found_error_msg');\n return $this->render('ObjectsInternJumpBundle:Internjump:general.html.twig', array(\n 'message' => $message,));\n }\n\n\n //get the company\n $company = $userInternship->getInternship()->getCompany();\n\n return $this->render('ObjectsInternJumpBundle:InternjumpUser:userHire.html.twig', array(\n 'user' => $user,\n 'userInternship' => $userInternship,\n 'company' => $company\n ));\n }", "public function get( $id ) {\n\t\t$logger = $this->getServiceLocator()->get( 'Log\\App' );\n\t\t$logger->log( \\Zend\\Log\\Logger::INFO, \"Rest call to GET /mentor/\".$id );\n\n\t\t/* must be logged in & must be either admin or a mentee of this mentor */\n\t\tif ( !$this->identity() ) {\n\t\t\treturn JsonModel( array() );\n\t\t}\n\n\t\t$entityManager = $this->getServiceLocator()->get( 'doctrine.entitymanager.orm_default' );\n\n\t\t/* if not admin make sure this is a parent of the current logged in customer */\n\t\tif ($this->identity()->getRole()->getName() !== \"Admin\") {\n\t\t\t/* make sure this customer has the saq in customer_questionnaire */\n\t }\n\n\t}", "function pridejSpravce ($uId, $grantDeny) {\n if ($grantDeny == 'grant') {\n // pridavam spravcovsti\n mysql_query(\"INSERT INTO `chatt_spravce` \n (`idUsers`, `idMistnost`) \n VALUES('\".(int)$uId.\"', '\".(int)$this -> getId().\"');\");\n \n return (bool)mysql_affected_rows();\n } elseif ($grantDeny == 'deny') {\n // smazu spravcovsti\n mysql_query(\"DELETE FROM `chatt_spravce`\n WHERE `idMistnost` = '\".(int)$this -> getId().\"'\n AND `idUsers` = '\".(int)$uId.\"';\");\n \n return (bool)mysql_affected_rows();\n } else return false;\n \n \n }", "public static function adminOrCreator($id) {\n $creatorId = Post::findCreatorId($id);\n\n $user = SessionController::currentUser();\n if (!$user || ($user -> id !== $creatorId && !$user -> admin)) {\n Redirect::to('/', array('message' => \"You don't have permission to that!\"));\n }\n\n }", "public function viewTrainersInfo($id)\n {\n\n $self='trainers';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n $trainer=Trainers::find($id);\n\n if($trainer){\n return view('admin.view-trainer-info',compact('trainer'));\n\n }else{\n return redirect('training/trainers')->with([\n 'message'=> language_data('Trainer info not found'),\n 'message_important'=>true\n ]);\n }\n }", "function update_min_id($new_min_id)\n\t{\n\t\t$this->openDb();\n\t\t\n\t\t$query = \"UPDATE persistEntries SET min_id ='\".$new_min_id.\"';\";\n\t\t$result = mysql_query($query);\n\t\tfile_put_contents('activity.log', \"Update Query: \".$query.\"\\r\\n\", FILE_APPEND);\n\t\tif (!$result) {file_put_contents('activity.log', \"UpdateMinID Query Failed\\r\\n\", FILE_APPEND); }\n\t\telse {file_put_contents('activity.log', \"UpdateMinID Query Succeeded\\r\\n\", FILE_APPEND); }\t\t\n\t\t$this->closeDb();\n\t}", "function get_member_id($id_costumer)\n\t\t{\n\t\t\t$query = $this->db->get_where('tb_costumer', array('id_costumer' => $id_costumer,'kode_kantor' => $this->session->userdata('ses_kode_kantor') ));\n\t\t\tif($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\treturn $query->row();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function GetWerfByWerfID($werf){\n\t\t\t\n global $db;\n\t\t\t\n\t\t\t$result = $db->query(\"SELECT * FROM werven where ID = '$werf'\");\n\t\t\t$werf = $result->fetchrow(MDB2_FETCHMODE_ASSOC);\n\t\t\treturn $werf;\n\t\t}", "public function getMiningInfo()\n {\n return $this->__call('getmininginfo');\n }", "public function getbyid() {\n\t\t$headers = $this->request->getHeaders ();\n\t\tif (empty ( $headers ['Token'] )) {\n\t\t\treturn $this->response->setJsonContent ( [\n\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\"message\" => \"Please give the token\"\n\t\t\t] );\n\t\t}\n\t\t$baseurl = $this->config->baseurl;\n\t\t$token_check = $this->tokenvalidate->tokencheck ( $headers ['Token'], $baseurl );\n\t\tif ($token_check->status != 1) {\n\t\t\treturn $this->response->setJsonContent ( [\n\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\"message\" => \"Invalid User\"\n\t\t\t] );\n\t\t}\n\t\t$input_data = $this->request->getJsonRawBody ();\n\t\t$id = isset ( $input_data->nidara_kid_profile_id ) ? $input_data->nidara_kid_profile_id : '';\n\t\tif (empty ( $id )) :\n\t\t\treturn $this->response->setJsonContent ([ \n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'Invalid input parameter' \n\t\t\t] );\n\t\t else :\n\t\t\t$kidprofile = NidaraKidProfile::findFirstByid ( $id )->toArray();\n\t\t\tif ($kidprofile) :\n\t\t\t\t$guided_learning = KidGuidedLearningMap::findFirstBynidara_kid_profile_id ($id);\n\t\t\t\tif (! empty ( $guided_learning )) {\n\t\t\t\t\t$kidprofile['guided_learning_id'] = $guided_learning->id;\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\treturn $this->response->setJsonContent ( [ \n\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t'data' =>$kidprofile\n\t\t\t\t] );\n\t\t\t else :\n\t\t\t\treturn $this->response->setJsonContent ( [ \n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => 'You have not entered any information' \n\t\t\t\t] );\n\t\t\tendif;\n\t\tendif;\n\t}", "function requireById($id);", "function getUserToolsById($id) {\n $select = \"SELECT *,user_tools.id as us_id,tools.name as name FROM user_tools\n \t\tLEFT JOIN tools ON user_tools.tool_id = tools.id \n \t\tWHERE user_tools.id=?\";\n //echo($select);\n \n try {\n $select = $this->pdo->prepare($select);\n $select->execute(array($id));\n $row = $select->fetch(PDO::FETCH_ASSOC);\n //print_r($row);\n //return $row['qualification'];\n return $row;\n } catch (PDOException $e) {\n $this->setError($e->getMessage());\n return false;\n }\n }" ]
[ "0.64906037", "0.513765", "0.51066583", "0.4838356", "0.47267857", "0.47121966", "0.4669826", "0.46314296", "0.46229458", "0.46130687", "0.45820236", "0.4542012", "0.45280024", "0.45188737", "0.45103818", "0.4509494", "0.4484236", "0.44742787", "0.44692698", "0.44637322", "0.4395694", "0.43865305", "0.43837556", "0.43449453", "0.43444446", "0.4335736", "0.43320817", "0.43235296", "0.43175888", "0.4317534" ]
0.80343604
0
(PECL mongo &gt;= 0.9.0) Gets this database's profiling level
public function getProfilingLevel() { return static::PROFILING_OFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_profesion(){\n return $this->profesion;\n }", "static public function get_level () {\n\t\treturn self::$level;\n\t}", "public function level()\n\t{\n\t\treturn $this->level;\n\t}", "public function profile()\n {\n return 1;\n }", "function level() {\n\t\treturn $this->_level;\n\t}", "public function getIntbwhseprofwhse()\n {\n return $this->intbwhseprofwhse;\n }", "function getLevel() {\n if($this->Session->check('User.level') === false) {\n return false;\n }\n else {\n return $this->Session->read('User.level');\n }\n\t}", "public function getUser_level()\n {\n return $this->user_level;\n }", "public function getOppoLevel()\r\n {\r\n return $this->get(self::_OPPO_LEVEL);\r\n }", "public function getOppoLevel()\r\n {\r\n return $this->get(self::_OPPO_LEVEL);\r\n }", "public function getOppoLevel()\r\n {\r\n return $this->get(self::_OPPO_LEVEL);\r\n }", "public function getLevel()\n {\n $value = $this->get(self::LEVEL);\n return $value === null ? (integer)$value : $value;\n }", "public function getLevel()\n {\n $value = $this->get(self::LEVEL);\n return $value === null ? (integer)$value : $value;\n }", "public static function getLevel()\n\t{\n\t\treturn self::$level;\n\t}", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "public function getLevel()\r\n {\r\n return $this->get(self::_LEVEL);\r\n }", "static public function s()\n {\n $db=DB::init();\n return $db->stats;\n }", "public function get_level()\n\t{\n\t\treturn $this->_level;\n\t}", "public function getProfiler()\n {\n if (!$this->profiler) {\n $this->profiler = new DbProfiler();\n }\n\n return $this->profiler;\n }", "public function getLevel()\n {\n return $this->fields['level'];\n }", "public function level(): string\n {\n return $this->level;\n }", "public function getLevel(): int\n {\n $result = parent::get(self::A_LEVEL);\n return $result;\n }", "public function getLevel(): Level {\n\t\treturn Server::getInstance()->getLevel($this->level);\n\t}", "public function getProf()\n {\n $this->db->query(\"SELECT * FROM `prof` \");\n //execution de la query / fetch all \n $result = $this->db->resultSet();\n return $result;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }" ]
[ "0.61164105", "0.60253406", "0.60205716", "0.5969639", "0.5903534", "0.5868328", "0.5865783", "0.5860851", "0.5838657", "0.5838657", "0.5838657", "0.5789343", "0.5789343", "0.57831275", "0.57760835", "0.57760835", "0.57760835", "0.57760835", "0.57760835", "0.5774082", "0.57545006", "0.5749034", "0.5732028", "0.5715649", "0.56568164", "0.56075394", "0.5603107", "0.55802983", "0.55802983", "0.55802983" ]
0.69685566
0
(PECL mongo &gt;= 1.5.0) Get the write concern for this database
public function getWriteConcern() { $this->notImplemented(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWriteConcern(): int\n {\n return $this->writeConcern;\n }", "public function setWriteConcern($write_concern) {\n\n $this->setOption('w', $write_concern);\n\n return $this;\n }", "final public function getWriteConcernError(): ?WriteConcernError {}", "public static function useWritePdo()\n {\n /** @var \\Illuminate\\Database\\Query\\Builder $instance */\n return $instance->useWritePdo();\n }", "public function write() {\n\t\treturn($this->__meta__['orm']::write($this));\n\t}", "public static function connectWriteDB()\n {\n global $conf;\n // Check if null\n if(self::$writeDBConnection === null)\n {\n //Connect to Database\n self::$writeDBConnection = new PDO($conf['con_str'], $conf['user'], $conf['pwd']);\n //Set Attributes for PDO\n self::$writeDBConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n self::$writeDBConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n }\n //return connection\n return self::$writeDBConnection;\n }", "public function getWriteConnection()\n\t{\n\t\t// Select master\n\t\t$write = $this->_masters->selectNode();\n\t\tif ($write) $write->connect();\n\t\t\n\t\treturn $write;\n\t}", "public function setWriteConcern(int $writeConcern): void\n {\n $this->writeConcern = $writeConcern;\n }", "public function isWriteMode(): bool {\n\t\treturn true;\n\t}", "public function getWrite()\n {\n return $this->fields['write'];\n }", "public function getWrite()\n {\n return $this->get(self::WRITE);\n }", "public function setWriteConcern($w, $wtimeout)\n {\n $this->notImplemented();\n }", "abstract protected function _getWriteAdapter();", "public static function getWriteQueries() {\n\t\treturn SystemDatabaseManager::$writeQueries;\n\t}", "public function getCouchDB()\n {\n return $this->db;\n }", "public function getWrite(string $name = ''): ConnectionInterface\n {\n }", "public static function connection($writeable = false)\n\t{\n\t\t// if in tracsaction, conection force to be writable.\n\t\tif (\\DB::in_transaction()) $writeable = true;\n\n\t\tif ($writeable)\n\t\t{\n\t\t\tif (empty(static::$_write_connection))\n\t\t\t{\n\t\t\t\tstatic::$_write_connection = static::get_write_connection_default();\n\t\t\t}\n\n\t\t\treturn static::$_write_connection;\n\t\t}\n\n\t\tif (empty(static::$_connection))\n\t\t{\n\t\t\tstatic::$_connection = static::get_read_connection_default();\n\t\t}\n\n\t\treturn static::$_connection;\n\t}", "public static function connectWriteDB(){\n if(self::$writeDBConnection === null)\n\n //PDO allows to quickly switch databases easily (Although queries can format can change)\n self::$writeDBConnection = new PDO('mysql:host=localhost;dbname=tasksdb;charset=utf8', 'root', '');\n self::$writeDBConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //setting exception error mode\n self::$writeDBConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); //not all db's can handle prepared statements, therefore, this attemps to emulate them (mySQL handles prepared statements natively, therefore, this is false)\n\n return self::$writeDBConnection;\n }", "public function getConnection()\n {\n return Mage::getSingleton('core/resource')->getConnection('core_write');\n }", "public function getDb()\n\t{\n\t\tif (!isset($this->_db))\n\t\t $this->_db = Yii::app()->edmsMongoDb($this->_dbName,$this->_connectionId);\n\n $this->callObjectMethods($this->_db,$this->_callAfterMongoDbCreate,self::CALLAFTER_MONGODBCREATE);\n\n\t\treturn $this->_db;\n\t}", "private function getConnectionObj() { \n return Mage::getSingleton('core/resource')->getConnection('core_write');\n \n }", "public function isWrite()\n\t{\n\t\treturn $this->write;\n\t}", "public function GetDatabase()\n\t{\n\t\treturn $this->mongo_client_db;\n\t}", "protected static function getWriteHandle() {\n\t\tif(!isset(self::$writeHandle)) {\n\t\t\tself::$writeHandle = new RedisWrite();\n\t\t}\n\t\treturn self::$writeHandle;\n\t}", "public static function getWriteConnection($connectionGroupName = 'default')\n\t{\n\t\t$connectionGroup = static::getConnectionGroup($connectionGroupName);\n\t\t\n\t\tif ($connectionGroupName == 'default' && count($connectionGroup->getMasters()) === 0) {\n\t\t\t// Add a connection to localhost if no connections currently exist for the default connection group\n\t\t\t$connectionGroup->addMaster(new Shanty_Mongo_Connection('127.0.0.1'));\n\t\t}\n\t\t\n\t\tif (!$connection = $connectionGroup->getWriteConnection($connectionGroupName)) {\n\t\t\trequire_once 'Shanty/Mongo/Exception.php';\n\t\t\tthrow new Shanty_Mongo_Exception(\"No write connection available for the '{$connectionGroupName}' connection group\");\n\t\t}\n\t\t\n\t\treturn $connection;\n\t}", "private function set_write_db($write_db){\n global $dbw_host;\n return($dbw_host = $write_db);\n }", "public function setWriteDestinationDb()\n\t{\n\t\t$this -> setWriteConnectionService($this -> destinationDb);\n\t}", "public function getDatabase()\n {\n if (! $this->database instanceof \\MongoDB) {\n throw new \\Exception('Mongo database object not set.');\n }\n\n return $this->database;\n }", "protected function enableReadWrite()\n {\n //Make sure we are bound in write mode\n $auth = \\Flipside\\AuthProvider::getInstance();\n $ldap = $auth->getMethodByName('Flipside\\Auth\\LDAPAuthenticator');\n if($ldap !== false)\n {\n $this->server = $ldap->getAndBindServer(true);\n }\n }", "public function getForceAdditionalWrite() {\n if(isset($this->_forceAdditionalWrite)) {\n return $this->_forceAdditionalWrite;\n }\n return false;\n }" ]
[ "0.7597369", "0.68949723", "0.6471995", "0.60799503", "0.5707621", "0.56743985", "0.56205255", "0.5539004", "0.5513354", "0.5505409", "0.5495799", "0.548624", "0.5480001", "0.54598695", "0.5379356", "0.53750014", "0.5333305", "0.52904266", "0.52667403", "0.52454776", "0.52419865", "0.52279395", "0.5212365", "0.52088845", "0.5200683", "0.5196685", "0.51808643", "0.5159329", "0.51464725", "0.51268345" ]
0.7158489
1
(PECL mongo &gt;= 1.3.0) Get the read preference for this database
public function getReadPreference() { $this->notImplemented(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReadPreference()\n {\n return $this->baseCursor->getReadPreference();\n }", "public function getRead()\n {\n return $this->fields['read'];\n }", "public function getRead()\n {\n return $this->read;\n }", "public function getRead()\n {\n return $this->get(self::READ);\n }", "public function getIsRead()\n {\n $value = $this->get(self::is_read);\n return $value === null ? (integer)$value : $value;\n }", "public function getSetReadReplicasSettings()\n {\n return $this->set_read_replicas_settings;\n }", "public function getReadConnection()\n\t{\n\t\tif (count($this->_slaves) === 0) {\n\t\t\t// If no slaves then get a master connection\n\t\t\t$read = $this->getWriteConnection();\n\t\t}\n\t\telse {\n\t\t\t// Select slave\n\t\t\t$read = $this->_slaves->selectNode();\n\t\t\tif ($read) $read->connect();\n\t\t}\n\t\t\n\t\treturn $read;\n\t}", "public function getReadAlias(): string\n {\n return $this->readAlias;\n }", "public function getPref()\n {\n return $this->pref;\n }", "public function getReadOptions()\n {\n return $this->read_options;\n }", "public function getHasReadRole()\n {\n return $this->getProperty(\"HasReadRole\");\n }", "public function getUserPref()\n\t{\n\t\t//global $user_pref;\n\t\t// return vartrue($user_pref['admin_cols_'.$this->getTableName()], array());\n\t\treturn e107::getUser()->getPref('admin_cols_'.$this->getTableName(), array());\n\t}", "public function setReadPreference($readPreference, array $tags = null)\n {\n $this->cursor->setReadPreference($readPreference, $tags);\n $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE] = $readPreference;\n $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE_TAGS] = $tags;\n return $this;\n }", "public function getPreference()\n {\n return isset($this->Preference) ? $this->Preference : null;\n }", "public function setReadPreference($readPreference, array $tags = null)\n {\n $this->baseCursor->setReadPreference($readPreference, $tags);\n $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE] = $readPreference;\n $this->unitOfWorkHints[Query::HINT_READ_PREFERENCE_TAGS] = $tags;\n return $this;\n }", "public static function getReadQueryComments() {\n\t\treturn SystemDatabaseManager::$readQueryComments;\n\t}", "protected function readReadOnly() { return $this->_readonly; }", "public function getReadConnectionAlias()\n {\n return $this->getReadConnection()->getAlias();\n }", "public function read($p_id, $p_pk_name=NULL, $p_table=NULL, $p_dbname=NULL){ return $this->getRecordAssoc($p_id, $p_pk_name, NULL, true, $p_table, $p_dbname); }", "public static function read()\n\t\t{\n\t\t\t$result = DB::table( self::$table )->get();\n\t\t\treturn $result;\n\t\t}", "public function getRead() : bool\n {\n return $this->read;\n }", "public static function getReadQueries() {\n\t\treturn SystemDatabaseManager::$readQueries;\n\t}", "function getReadOn()\n {\n return strlen($this->_sReadOn) ? (string) $this->_sReadOn : NULL;\n }", "public function getFieldPref()\n\t{\n\t\treturn $this->fieldpref;\n\t}", "public function read()\n\t{\n\t \n \t $q = 'UPDATE ?t SET `read` = 1, time_read = NOW() WHERE interlocutor_id = ?i and topic_code = ?i and topic_id = ?i and user_id = ?i';\n\t return $this->_DB->query($q, array(self::$tableTopicText,\n\t $this->_id,\n\t $this->_topicCode, \n\t $this->_topicId,\n\t $this->_interlocutorId\n\t ), Dune_MysqliSystem::RESULT_AR);\n\t \n\t}", "public function readOne()\n\t{\n\t \n \t $q = 'UPDATE ?t SET `read` = 1, time_read = NOW() WHERE interlocutor_id = ?i AND id = ?i';\n\t $result = $this->_DB->query($q, array(self::$tableTopicText,\n\t $this->_id,\n\t $this->_messageId\n\t ), Dune_MysqliSystem::RESULT_AR);\n\n//\t echo $this->_DB->getQuery(); die();\n\t return $result;\n\t \n\t}", "public function getPreferLevel()\n {\n return $this->preferLevel;\n }", "public function getPreferLevel()\n {\n return $this->preferLevel;\n }", "public function getPreferLevel()\n {\n return $this->preferLevel;\n }", "public function getPreferLevel()\n {\n return $this->preferLevel;\n }" ]
[ "0.78600407", "0.62608564", "0.60190326", "0.5999076", "0.58448803", "0.573495", "0.56932414", "0.5673226", "0.56604934", "0.5642039", "0.5618371", "0.56077355", "0.5559084", "0.55418605", "0.55280906", "0.55069244", "0.5490529", "0.5477633", "0.54726166", "0.54638577", "0.54518837", "0.5450323", "0.53911924", "0.53897923", "0.5377459", "0.5358861", "0.5328657", "0.5328657", "0.5328657", "0.5328657" ]
0.70126235
1
Insertion Sort. Time Complexity: O(n^2) Space Compleity: O(n), O(1) extra space
function insertion_sort(&$array) { $n_length = count($array); for ($i = 1; $i < $n_length; $i++) { $j = $i; while ($j > 0 && $array[$j - 1] > $array[$j]) { swap($array[$j], $array[$j-1]); $j--; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertSort(&$input) {\n $len=count($input);\n for($i=1; $i<$len; $i++) {\n $tmp = $input[$i];\n for($j=$i-1;$j>=0;$j--) {\n if($tmp < $input[$j]) {\n $input[$j+1] = $input[$j];\n $input[$j] = $tmp;\n } else {\n break;\n }\n }\n }\n}", "function insertionSort(array $array){\n\n for ($i=1;$i<count($array);$i++){\n $currentVal=$array[$i];\n for ($j=$i-1;$j>=0&&$array[$j]>$currentVal;$j--){\n $array[$j+1]=$array[$j];\n }\n $array[$j+1]=$currentVal;\n }\n return $array;\n}", "function insertion_sort($arr) {\r\n for($j=1; $j < count($arr); $j++) {\r\n $tmp = $arr[$j];\r\n $i = $j;\r\n while(($i >= 0) && ($arr[$i-1] > $tmp)) {\r\n $arr[$i] = $arr[$i-1];\r\n $i--;\r\n }\r\n $arr[$i] = $tmp;\r\n\t\r\n\tforeach($arr as $arritems){\r\n\t\techo $arritems . \" \"; \r\n }\r\n\techo \"<br>\";\r\n }\r\n \r\n return $arr;\r\n\r\n}", "function insertionSort(&$arr, $n) \n{ \n\tfor ($i = 1; $i < $n; $i++) \n\t{ \n\t\t$key = $arr[$i]; \n\t\t$j = $i-1; \n\t\n\t\t// Move elements of arr[0..i-1], \n\t\t// that are greater than key, to \n\t\t// one position ahead of their \n\t\t// current position \n\t\twhile ($j >= 0 && $arr[$j] > $key) \n\t\t{ \n\t\t\t$arr[$j + 1] = $arr[$j]; \n\t\t\t$j = $j - 1; \n\t\t} \n\t\t\n\t\t$arr[$j + 1] = $key; \n\t} \n}", "function insertionSort2($n, $arr) {\n $result = '';\n\n for ($i = 1; $i < $n; $i++) {\n $k = $arr[$i];\n $j = $i - 1;\n\n while ($j > -1 && $arr[$j] > $k) {\n $arr[$j + 1] = $arr[$j];\n $j--;\n }\n\n $arr[$j + 1] = $k;\n\n for ($j = 0; $j < $n; $j++) {\n $result .= $arr[$j] . ' ';\n }\n\n //$result .= '<br />' . PHP_EOL;\n $result .= PHP_EOL;\n }\n\n echo $result;\n}", "function insertionSort($myArray)\n{\n for($index =1; $index < count($myArray); $index++)\n {\n $temp = $myArray[$index];\n $j = $index - 1;\n while($j >= 0 && $myArray[$j] > $temp)\n {\n $myArray[$j+1] = $myArray[$j];\n $j--;\n }\n $myArray[$j+1] = $temp;\n }\n\n echo \"The Sorted Elements are:\\n\";\n \n //printing the array values using for each.\n foreach($myArray as $value)\n {\n echo $value.\" \"; \n }\n}", "function sorting_by_insertion_sort_algo($amount_of_number){\n\t\n\t//=========================\n\t\n\t//get a collection of unsorted numbers\n\t$unsorted_number_arr = unsorted_num_generator($amount_of_number);\n\n\t//print those unsorted number\n\techo \"Unsorted state <br/>\";\n\techo \"<pre>\";\n\tprint_r($unsorted_number_arr);\n\n\n\tfor($i=1; $i<$amount_of_number; $i++){\n\t\t$counter = $i;\n\t\t\n\t\t//sorting will take place here\n\t\twhile($counter > 0 && $unsorted_number_arr[$counter] < $unsorted_number_arr[$counter-1]){\n\t\t\t$smallest_num = $unsorted_number_arr[$counter];\n\t\t\t\n\t\t\t$unsorted_number_arr[$counter] = $unsorted_number_arr[$counter-1];\n\t\t\t\n\t\t\t$unsorted_number_arr[$counter-1] = $smallest_num;\n\t\t\t\n\t\t\t\n\t\t\t$counter--;\n\t\t\t\n\t\t}\n\t}\n\n\techo \"Sorted state <br/>\";\n\techo \"<pre>\";\n\tprint_r($unsorted_number_arr);\n\n\n\t\n\t//=========================\n\t\n\t\n}", "public function insertionShort()\n {\n for ($i = 0; $i < count($this->arr); $i++) {\n $j = $i - 1; // j is the index before i\n $temp = $this->arr[$i];\n\n while ($j >= 0 && $this->arr[$j] > $temp) {\n $this->arr[$j + 1] = $this->arr[$j];\n $j--; // Decrease $j to continue compare with $temp\n }\n // Default\n $this->arr[$j + 1] = $temp;\n }\n }", "public static function insertion_sort_num($arr, $num)\n {\n\n\n for($i =1 ;$i <$num ;$i++)\n {\n for($j =$i ;$j > 0 ;$j--)\n {\n //comparing two numbers\n if($arr[$j-1] > $arr[$j])\n {\n $temp = $arr[$j -1];\n $arr[$j-1] = $arr[$j];\n $arr[$j] = $temp;\n }\n \n }\n\n }\n return $arr;\n }", "private static function insertionSort(array &$data, int $left, int $right) : array\n {\n for ($i = $left + 1; $i <= $right; $i++) {\n $temp = $data[$i];\n $j = $i - 1;\n\n while ($j >= $left && $data[$j] > $temp) {\n $data[$j + 1] = $data[$j];\n $j--;\n }\n\n $data[$j + 1] = $temp;\n }\n\n return $data;\n }", "private function insertion_sort($arrayParaOrdenar, &$objInsertionSort)\n {\n //Elemento já está em seu lugar, por isso começamos\n //Do elemento 1\n for ($i = 1; $i < $objInsertionSort->numeroDeElementos; $i++) \n { \n //Gravo num variável auxiliar o valor que vamos comparar\n $valorAux = $arrayParaOrdenar[$i]; \n\n //$j se inicia em $i-1 pois precisamos comparar\n //Desde o item anterior ao item de comparação vigente:\n /*\n Se $i é 1, devemos começar a olhar o array \n a patir do 0.\n \n Se $i é 2, devemos começar a olhar o array \n a patir do 1\n */\n $j = $i-1; \n \n $objInsertionSort->numeroComparacoes++;\n // Movo os elementos dos array[0..i-1], \n // que são maiores que o valorAux, para uma posição \n // a frente da sua posição atual\n while ($j >= 0 && $arrayParaOrdenar[$j] > $valorAux) \n { \n $arrayParaOrdenar[$j + 1] = $arrayParaOrdenar[$j]; \n $j = $j - 1; \n } \n //Depois de ter ordenado todos os valores após\n //a casa do valorAux, recoloco ele no array na posição\n //em que J parou\n $arrayParaOrdenar[$j + 1] = $valorAux; \n }\n }", "function sortInsert(array $array): array {\n // Count of all objects\n $length = count($array);\n for ($i = 0; $i < $length - 1; $i++) {\n // Get next object key\n $nextValueKey = $i + 1;\n // Get next object value in buffer\n $nextValue = $array[$nextValueKey];\n\n //Examine all previous objects\n for ($y = 0; $y < $nextValueKey; $y++) {\n if ($array[$nextValueKey] < $array[$y]) {\n for ($k = $nextValueKey - 1; $k >= $y; $k--) {\n $array[$k + 1] = $array[$k];\n }\n $array[$y] = $nextValue;\n }\n }\n }\n\n return $array;\n}", "function simple_sorting($array){\n\t/*\tfor($i=0; $i<count($array); $i++){\n\t\t\tfor($j=0; $j<count($array); $j++){\n\t\t\t\tif($array[$i] < $array[$j]){\n\t\t\t\t\t$n = $array[$j];\n\t\t\t\t\t$array[$j] = $array[$i];\n\t\t\t\t\t$array[$i] = $n;\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\tfor($i=0; $i<count($array)-1; $i++){\n\t\t\t$swap_count = 0;\n\t\t\tfor($j=1; $j<count($array); $j++){\n\t\t\t\tif($array[$j-1] > $array[$j]){\n\t\t\t\t\t$n = $array[$j];\n\t\t\t\t\t$array[$j] = $array[$j-1];\n\t\t\t\t\t$array[$j-1] = $n;\n\t\t\t\t\t$swap_count++;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\tif($swap_count === 0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public function testSortInsert() {\n\n // $left = new Add('g');\n // $left->next = new Add('e');\n // $left->next->next = new Add('e');\n // $left->next->next->next = new Add('k');\n // $left->next->next->next->next = new Add('s');\n // $left->next->next->next->next->next = new Add('a');\n\n // $right = new Add('g');\n // $right->next = new Add('e');\n // $right->next->next = new Add('e');\n // $right->next->next->next = new Add('k');\n // $right->next->next->next->next = new Add('s');\n // $right->next->next->next->next->next = new Add('b');\n \n // $this->assertTrue($sll->compare($left, $right) == -1);\n }", "public static function time_Elapsed_Insertion($arr,$num)\n {\n $start = 0;\n $arr1 = $arr;\n $end = count($arr)-1;\n $num1 = $num;\n \n //current start time\n $starttime = microtime(true);\n \n //calling insertion sort\n $arr = Utility::insertion_sort_num($arr, $num);\n \n echo \"sorted array is\\n\";\n echo implode(\",\",$arr).\"\\n\";\n\n //current stop time\n $stop = microtime(true);\n\n //finding time elapsed\n $time = $stop-$starttime;\n return $time;\n }", "function searchInsert($nums, $target)\n{\n $key = array_search($target, $nums);\n if (empty($key) && $key !== 0) {\n $count = count($nums) -1;\n if ($nums[0] > $target) {\n return 0;\n }\n if ($nums[$count] < $target) {\n return $count+1;\n }\n for ($i=0; $i<$count; $i++) {\n if ($nums[$i] < $target && $nums[$i+1] > $target) {\n $key = $i+1;\n break;\n }\n }\n }\n\n return $key;\n}", "public function sort();", "function selection_sort(&$arr, $n) \n{ \n\tfor($i = 0; $i < $n ; $i++) \n\t{ \n\t\t$low = $i; \n\t\tfor($j = $i + 1; $j < $n ; $j++) \n\t\t{ \n\t\t\tif ($arr[$j] < $arr[$low]) \n\t\t\t{ \n\t\t\t\t$low = $j; \n\t\t\t} \n\t\t} \n\t\t\n\t\t// swap the minimum value to $ith node \n\t\tif ($arr[$i] > $arr[$low]) \n\t\t{ \n\t\t\t$tmp = $arr[$i]; \n\t\t\t$arr[$i] = $arr[$low]; \n\t\t\t$arr[$low] = $tmp; \n\t\t} \n\t} \n}", "function array_insert(&$array, $value, $offset){\n\t\t\t if(!isset($array[$offset])){\n\t\t\t\t $array[$offset] = $value;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t $elements = $array;\n\t\t\t\t foreach($elements as $key=>$element){\n\t\t\t\t\t if(is_numeric($key) && $key >= $offset){\n\t\t\t\t\t\t $array[($key+1)] = $element;\n\t\t\t\t\t\t if($array[$key] == $element) unset($array[$key]);\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t $array[$offset] = $value;\n\t\t\t }\n\t\t\t ksort($array);\n\t\t\t return $array;\n\t}", "function bubbleSortImproved(array $arr)\n{\n $n = sizeof($arr);\n for ($i = 1; $i < $n; $i++) {\n $flag = false;\n for ($j = $n - 1; $j >= $i; $j--) {\n if($arr[$j-1] > $arr[$j]) {\n $tmp = $arr[$j - 1];\n $arr[$j - 1] = $arr[$j];\n $arr[$j] = $tmp;\n $flag = true;\n }\n }\n if (!$flag) {\n break;\n }\n }\n\n return $arr;\n}", "public function doSort();", "function bubbleSort($arr)\n{\n $size = sizeof($arr);\n do {\n $swapped = false;\n for ($i = 0; $i < $size - 1; $i++) {\n if ($arr[$i] > $arr[$i + 1]) {\n $temp = $arr[$i];\n $arr[$i] = $arr[$i + 1];\n $arr[$i + 1] = $temp;\n $swapped = true;\n }\n } $size--;\n } while($swapped);\n return $arr;\n}", "function returnArraySortedByInsertion($array, $order, $key){\n // Key = if array holds arrays, which key holds the value\n self::verifyThatArrayIsUsable($array, $order, $key);\n $total = count($array);\n //print \"init ---\";\n //var_dump($array);\n //print \"<Br><Br>\";\n for($index = 0; $index < $total; $index++){\n self::moveElementBackUntillPlaceIsFound($array, $index, $order, $key); // Array is Pased by Reference\n //print \"<br>After for $index ---\";\n //var_dump($array);\n //print \"<Br><Br>\";\n }\n \n return $array;\n }", "function natsort (array &$array) {}", "function selectSort($arr){\n $n=count($arr);\n for($i=0;$i<$n;$i++){\n //开始假设该轮循环的第一位为最小值\n $minIndex=$i;\n for($j=$i+1;$j<$n;$j++){\n //按照升序排序 将最小的一个数挑出来\n if($arr[$j]<$arr[$minIndex]){\n $minIndex=$j;\n }\n }\n //将每次循环所挑出的最小数与低位元素交换,低位较高位先排好序。\n if($minIndex!=$i){\n $temp=$arr[$i];\n $arr[$i]=$arr[$minIndex];\n $arr[$minIndex]=$temp;\n }\n }\n return $arr;\n }", "function bubble_sort($array){\n\t\t\t\t\t$size = sizeof($array);\n\t\t\t\t\tfor ( $i = 0; $i < $size; $i++ ) {\n\t\t\t\t\t for ($j = 0; $j < $size; $j++ ) \n\t\t\t\t\t { \n\t\t\t\t\t if ($array[$i] < $array[$j]) \n\t\t\t\t\t { \n\t\t\t\t\t $temp = $array[$i]; \n\t\t\t\t\t $array[$i] = $array[$j]; \n\t\t\t\t\t $array[$j] = $temp; \n\t\t\t\t\t } \n\t\t\t\t\t } \n\t\t\t\t\t} \n\t\t\t\t\treturn $array;\n\t\t\t\t}", "public static function insertionSort($my_array, $field)\n {\n if (is_array($my_array)) {\n for ($i = 0; $i < count($my_array); $i++) {\n $val = $my_array[$i][$field];\n $info = $my_array[$i];\n $j = $i - 1;\n while ($j >= 0 && $my_array[$j][$field] > $val) {\n $my_array[$j + 1] = $my_array[$j];\n $j--;\n }\n $my_array[$j + 1] = $info;\n }\n return $my_array;\n } else {\n new TMessage('error', 'Não é um Array');\n }\n }", "function mergeSort(&$A, $p, $r)\n{\n if ($p < $r) { // 2n - 1\n $q = floor(($p + $r) / 2); // n - 1\n mergeSort($A, $p, $q); // n - 1\n mergeSort($A, $q + 1, $r); // n - 1\n merge($A, $p, $q, $r); // n - 1\n }\n}", "function bubbleSortWithBounds(array $arr): array\n{\n $len = count($arr); // Length of array\n $count = 0;\n $bound = $len - 1;\n for ($i = 0; $i < $len; $i++) {\n\n $swapped = false;\n $newBound = 0;\n for ($j = 0; $j < $bound - 1; $j++) {\n $count++;\n if ($arr[$j] < $arr[$j + 1]) {\n $tmp = $arr[$j + 1];\n $arr[$j + 1] = $arr[$j];\n $arr[$j] = $tmp;\n $swapped = true;\n $newBound = $j;\n }\n }\n $bound = $newBound;\n if (!$swapped) break;\n }\n echo $count . '<br/>';\n return $arr;\n}", "public function insertionSort(bool $ascending = true) : bool {\n $array = $this->toArray();\n $count = count($array);\n $hasObject = false;\n $firstElType = $count > 0 ? gettype($array[0]) : 'N/A';\n $numTypes = ['integer', 'double'];\n for ($i = 0 ; $i < $count ; $i++) {\n $val = $array[$i];\n $j = $i - 1;\n $elType = gettype($val);\n if (!($elType == $firstElType)) {\n if (!(in_array($elType, $numTypes) && in_array($firstElType, $numTypes))) {\n return false;\n }\n }\n if ($elType == 'object') {\n $hasObject = true;\n\n if ($val instanceof Comparable) {\n while ($j >= 0 && $val->compare($array[$j]) < 0) {\n $array[$j + 1] = $array[$j];\n $j--;\n }\n $array[$j + 1] = $val;\n } else {\n return false;\n }\n } else if ($elType == 'string') {\n while ($j >= 0 && strcmp($array[$j], $val) > 0) {\n $array[$j + 1] = $array[$j];\n $j--;\n }\n $array[$j + 1] = $val;\n } else if (in_array($elType, $numTypes)) {\n while ($j >= 0 && $array[$j] > $val) {\n $array[$j + 1] = $array[$j];\n $j--;\n }\n $array[$j + 1] = $val;\n } else {\n return false;\n }\n }\n $this->_insertionSortHelper($ascending, $array);\n \n return true;\n }" ]
[ "0.8243451", "0.7506401", "0.7342011", "0.7323278", "0.71380836", "0.7115772", "0.6756757", "0.6686905", "0.6218333", "0.62106997", "0.61893064", "0.6090497", "0.6053915", "0.6003859", "0.5614946", "0.56049734", "0.54992986", "0.5483576", "0.5455398", "0.5444954", "0.5425253", "0.5379588", "0.53794205", "0.53546786", "0.53028405", "0.5271552", "0.522128", "0.5216278", "0.51870185", "0.5134772" ]
0.77861863
1
Test case for cloudPosCheckAddCheck .
public function testCloudPosCheckAddCheck() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckUpdateCheck()\n {\n }", "public function testCloudPosCheckGetCheckByCheckNumber()\n {\n }", "public function testCloudPosCheckBumpCheck()\n {\n }", "public function testCloudPosCheckFastTrackCheck()\n {\n }", "public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }", "public function testCloudPosCheckDeleteCheck()\n {\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "public function testCloudPosCheckAddCourseToCheck()\n {\n }", "public function testCloudPosCheckAddItemsToCourse()\n {\n }", "public function testCloudPosCheckFastTrackCourse()\n {\n }", "public function testCloudPosCheckFastTrackItemInCourse()\n {\n }", "public function testCloudPosCheckUpdateItemInCourse()\n {\n }", "public function testCloudPosCheckUpdateCourse()\n {\n }", "public function testCloudPosCheckUpdateCoursesInCheck()\n {\n }", "public function testCloudPosCheckAddPaymentStateToCourse()\n {\n }", "abstract public function runCheck();", "public function testCloudPosCheckDeleteCourseFromCheck()\n {\n }", "public function testCloudPosCheckCancelCourseInCheck()\n {\n }", "public function testKycChecksPut()\n {\n }", "public function testCloudPosCheckCancelItemInCourse()\n {\n }", "abstract protected function doCheck();", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "public function check();", "abstract public function check();", "abstract public function check();", "abstract public function check();" ]
[ "0.77130723", "0.7709492", "0.7464209", "0.72299546", "0.71103424", "0.71009874", "0.70994514", "0.6962034", "0.69326454", "0.68651307", "0.6739637", "0.656633", "0.6534707", "0.63097274", "0.6216667", "0.6187245", "0.6139212", "0.60959995", "0.6056104", "0.6035992", "0.60211307", "0.5989626", "0.5989626", "0.5989626", "0.5989626", "0.5989626", "0.5989626", "0.59172356", "0.59172356", "0.59172356" ]
0.88708484
0
Test case for cloudPosCheckAddCourseToCheck .
public function testCloudPosCheckAddCourseToCheck() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckAddItemsToCourse()\n {\n }", "public function testCloudPosCheckUpdateCourse()\n {\n }", "public function testCloudPosCheckUpdateCoursesInCheck()\n {\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "public function testCloudPosCheckCancelCourseInCheck()\n {\n }", "public function testCloudPosCheckAddPaymentStateToCourse()\n {\n }", "public function testCloudPosCheckUpdateItemInCourse()\n {\n }", "public function testCloudPosCheckCancelAllCoursesInCheck()\n {\n }", "public function testCloudPosCheckDeleteCourseFromCheck()\n {\n }", "public function testCloudPosCheckCancelItemInCourse()\n {\n }", "public function testCloudPosCheckFastTrackCourse()\n {\n }", "public function testCloudPosCheckFastTrackItemInCourse()\n {\n }", "public function testCloudPosCheckAddCheck()\n {\n }", "public function testAddCourse()\n {\n $data = ['id' => 'PRJG5'];\n $course1 = factory(Course::class)->create($data);\n $course = Course::find('PRJG5');\n $this->assertDatabaseHas('courses', $data);\n }", "public function test_auth_user_can_create_course()\n {\n $this->actingAs($this->user);\n $courseData = factory('App\\Course')->make()->toArray();\n $courseData['start_date'] = '10/10/2000';\n $courseData['end_date'] = '10/10/2000';\n $this->post(route('courses.store'), $courseData)->assertStatus(302);\n $this->assertEquals($courseData['description'], Course::latest()->first()->description);\n }", "public function test_elis_createorupdate_creates_course() {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/elis/program/lib/data/course.class.php');\n\n // Set up initial conditions.\n set_config('createorupdate', 1, 'rlipimport_version1elis');\n\n // Run the course create action.\n $record = new stdClass;\n $record->action = 'update';\n $record->context = 'course';\n $record->name = 'testcoursename';\n $record->idnumber = 'testcourseidnumber';\n $record->credits = '0';\n\n $importplugin = rlip_dataplugin_factory::factory('rlipimport_version1elis');\n $importplugin->fslogger = new silent_fslogger(null);\n $importplugin->process_record('course', $record, 'bogus');\n\n // Validation.\n $this->assertTrue($DB->record_exists(course::TABLE, array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'credits' => '0'\n )));\n }", "public function test_elis_createorupdate_updates_course() {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/elis/program/lib/data/course.class.php');\n\n // Set up initial conditions.\n set_config('createorupdate', 1, 'rlipimport_version1elis');\n\n // Create the test course.\n $course = new course(array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'syllabus' => '',\n 'credits' => '0'\n ));\n $course->save();\n\n // Run the course create action.\n $record = new stdClass;\n $record->action = 'update';\n $record->context = 'course';\n $record->idnumber = 'testcourseidnumber';\n $record->credits = '5';\n\n $importplugin = rlip_dataplugin_factory::factory('rlipimport_version1elis');\n $importplugin->fslogger = new silent_fslogger(null);\n $importplugin->process_record('course', $record, 'bogus');\n\n // Validation.\n $this->assertTrue($DB->record_exists(course::TABLE, array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'credits' => 5\n )));\n }", "public function addCourse() {\n $q = 'INSERT INTO susanneni_dt173g.courses \n SET\n name = :name,\n code = :code,\n progression = :progression,\n syllabus = :syllabus';\n\n $stmt = $this->connect()->prepare($q);\n\n //strip data of tags\n $this->name = htmlspecialchars(strip_tags($this->name));\n $this->code = htmlspecialchars(strip_tags($this->code));\n $this->progression = htmlspecialchars(strip_tags($this->progression));\n $this->syllabus = htmlspecialchars(strip_tags($this->syllabus));\n\n // bind data\n $stmt->bindParam(':name', $this->name);\n $stmt->bindParam(':code', $this->code);\n $stmt->bindParam(':progression', $this->progression);\n $stmt->bindParam(':syllabus', $this->syllabus);\n\n if($stmt->execute()) {\n return true;\n } else {\n printif('Error: %s.\\n', $stmt->error);\n return false;\n }\n }", "public function createCourse()\n {\n $user = factory(\\Modulos\\Seguranca\\Models\\Usuario::class)->create();\n $this->actingAs($user);\n\n $curso = factory(\\Modulos\\Academico\\Models\\Curso::class)->raw();\n $configs = $this->mockConfigs();\n\n $data = array_merge($curso, $configs);\n\n $this->assertEquals(0, \\Modulos\\Academico\\Models\\Curso::all()->count());\n $this->assertEquals(0, \\Modulos\\Academico\\Models\\ConfiguracaoCurso::all()->count());\n $return = $this->crsRepo->create($data);\n\n $this->assertTrue(is_array($return));\n $this->assertEquals(5, \\Modulos\\Academico\\Models\\ConfiguracaoCurso::all()->count());\n\n return $return;\n }", "public function test_get_user_competency_in_course() {\n $this->resetAfterTest(true);\n $dg = $this->getDataGenerator();\n $lpg = $dg->get_plugin_generator('core_competency');\n $this->setAdminUser();\n\n $user = $dg->create_user();\n $c1 = $dg->create_course();\n\n // Enrol the user so they can be rated in the course.\n $studentarch = get_archetype_roles('student');\n $studentrole = array_shift($studentarch);\n $coursecontext = context_course::instance($c1->id);\n $dg->role_assign($studentrole->id, $user->id, $coursecontext->id);\n $dg->enrol_user($user->id, $c1->id, $studentrole->id);\n\n $framework = $lpg->create_framework();\n $comp1 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));\n $comp2 = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));\n $lpg->create_course_competency(array('competencyid' => $comp1->get('id'), 'courseid' => $c1->id));\n $lpg->create_course_competency(array('competencyid' => $comp2->get('id'), 'courseid' => $c1->id));\n\n // Create a user competency for comp1.\n api::grade_competency_in_course($c1, $user->id, $comp1->get('id'), 3, 'Unit test');\n\n // Test for competency already exist in user_competency.\n $uc = api::get_user_competency_in_course($c1->id, $user->id, $comp1->get('id'));\n $this->assertEquals($comp1->get('id'), $uc->get('competencyid'));\n $this->assertEquals($user->id, $uc->get('userid'));\n $this->assertEquals(3, $uc->get('grade'));\n $this->assertEquals(true, $uc->get('proficiency'));\n\n // Test for competency does not exist in user_competency.\n $uc2 = api::get_user_competency_in_course($c1->id, $user->id, $comp2->get('id'));\n $this->assertEquals($comp2->get('id'), $uc2->get('competencyid'));\n $this->assertEquals($user->id, $uc2->get('userid'));\n $this->assertEquals(null, $uc2->get('grade'));\n $this->assertEquals(null, $uc2->get('proficiency'));\n }", "public function testCreateCourse() {\n createCourse(\"test course\");\n $test_course = DB::run(\"SELECT * FROM courses ORDER BY course_id DESC LIMIT 1\")->fetch(PDO::FETCH_ASSOC);\n\n $this->assertSame(\"test course\", $test_course[\"name\"]);\n }", "public function test_add_evidence_user_competency_course_grade_in_course() {\n global $USER;\n\n $this->resetAfterTest(true);\n $dg = $this->getDataGenerator();\n\n // Create and assign a current user.\n $currentuser = $dg->create_user();\n $this->setUser($currentuser);\n\n // Create a course.\n $course = $dg->create_course();\n $record = array('courseid' => $course->id, 'pushratingstouserplans' => false);\n $settings = new course_competency_settings(0, (object) $record);\n $settings->create();\n $coursecontext = context_course::instance($course->id);\n\n // Create a student and enrol into the course.\n $student = $dg->create_user();\n $studentarch = get_archetype_roles('student');\n $studentrole = array_shift($studentarch);\n $dg->role_assign($studentrole->id, $student->id, $coursecontext->id);\n $dg->enrol_user($student->id, $course->id, $studentrole->id);\n\n // Create a competency for the course.\n $lpg = $dg->get_plugin_generator('core_competency');\n $framework = $lpg->create_framework();\n // Do not push ratings from course to user plans.\n $comp = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));\n $lpg->create_course_competency(array('courseid' => $course->id, 'competencyid' => $comp->get('id')));\n\n // Query for user_competency_course data.\n $filterparams = array(\n 'userid' => $student->id,\n 'competencyid' => $comp->get('id'),\n 'courseid' => $course->id\n );\n\n // Add evidence that sets a grade to the course.\n $evidence = api::add_evidence($student->id, $comp, $coursecontext, evidence::ACTION_OVERRIDE,\n 'commentincontext', 'core', null, false, null, 3, $USER->id);\n // Get user competency course record.\n $usercompcourse = \\core_competency\\user_competency_course::get_record($filterparams);\n // There should be a user_competency_course object when adding a grade.\n $this->assertNotEmpty($usercompcourse);\n $grade = $evidence->get('grade');\n $this->assertEquals($grade, $usercompcourse->get('grade'));\n $this->assertEquals(3, $usercompcourse->get('grade'));\n $proficiency = $comp->get_proficiency_of_grade($grade);\n $this->assertEquals($proficiency, $usercompcourse->get('proficiency'));\n\n // Confirm that the user competency's grade/proficiency has not been affected by the grade.\n $usercompetencyparams = [\n 'userid' => $student->id,\n 'competencyid' => $comp->get('id'),\n ];\n $usercompetency = \\core_competency\\user_competency::get_record($usercompetencyparams);\n $this->assertNotEmpty($usercompetency);\n $this->assertNotEquals($usercompcourse->get('grade'), $usercompetency->get('grade'));\n $this->assertNotEquals($usercompcourse->get('proficiency'), $usercompetency->get('proficiency'));\n }", "public function test_add_evidence_for_user_competency_course_grade_outside_course() {\n $this->resetAfterTest(true);\n $dg = $this->getDataGenerator();\n $syscontext = context_system::instance();\n\n // Create a student.\n $student = $dg->create_user();\n\n // Create a competency for the course.\n $lpg = $dg->get_plugin_generator('core_competency');\n $framework = $lpg->create_framework();\n $comp = $lpg->create_competency(array('competencyframeworkid' => $framework->get('id')));\n\n // Add evidence.\n api::add_evidence($student->id, $comp, $syscontext, evidence::ACTION_OVERRIDE,\n 'commentincontext', 'core', null, false, null, 1);\n\n // Query for user_competency_course data.\n $filterparams = array(\n 'userid' => $student->id,\n 'competencyid' => $comp->get('id'),\n );\n $usercompcourse = \\core_competency\\user_competency_course::get_record($filterparams);\n // There should be no user_competency_course object created when grading.\n $this->assertFalse($usercompcourse);\n }", "public function testCreate()\n {\n $courseRepository = new CourseRepository;\n $params = [\n 'instructor_id' => 1,\n 'title' => 'Course Test',\n 'introduce' => 'I\\'m test',\n 'price' => 100000,\n ];\n $request = new \\Illuminate\\Http\\Request();\n $request->replace($params);\n \n $expectCourseCount = Course::all()->count() + 1;\n $expectCourseId = Course::all()->last();\n if($expectCourseId){\n $expectCourseId = $expectCourseId->id + 1;\n }else $expectCourseId = 1;\n $course = $courseRepository->create($request->all());\n // Course::create($request->all());\n $this->assertEquals($expectCourseCount, Course::all()->count());\n $this->assertEquals($expectCourseId, $course->id);\n }", "public function testUpdateValidCourse()\n {\n $data = factory(Course::class)->create(['id' => 'PRJG5']);\n $course = Course::find('PRJG5');\n $course->id = 'DONG5';\n $course->save();\n $other = Course::find('DONG5');\n $this->assertEquals('DONG5', $other->id);\n }", "public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }", "public function insertCourse(Course $course)\n {\n $query = 'INSERT INTO tbl_cursos (eva_codigo, eva_nombre,eva_estado,eva_fechacreacion,eva_usuariofk) VALUES(?,?,?,?,?)';\n try {\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $course->getCode(), PDO::PARAM_INT);\n $stmt->bindParam(2, $course->getName(), PDO::PARAM_STR);\n $stmt->bindParam(3, $course->getState(), PDO::PARAM_INT);\n $stmt->bindParam(4, date(\"Y-m-d H:i:s\"), PDO::PARAM_INT);\n $stmt->bindParam(5, $course->getIdUser(), PDO::PARAM_INT);\n $stmt->execute();\n if ($stmt->rowCount() != 0) {\n return true;\n } else {\n return false;\n }\n }\n catch (PDOException $e) {\n return false;\n }\n finally{\n DbConnection::disconnect();\n }\n\n }", "public function addcourses ($id_course , $description , $lecture_id) {\n return ($this -> restfullDAO -> insertcourses ( $id_course , $description , $lecture_id ));\n }", "public function test_coursedescriptionvalidation_preventsduplicates() {\n global $DB;\n\n $this->load_csv_data();\n\n // Need course and userset.\n $userset = new stdClass();\n $userset->id = 1;\n $userset->name = 'test';\n\n $course = new course(array('idnumber' => 'test', 'name' => 'test', 'syllabus' => 1));\n $options = array();\n $options['targetcluster'] = $userset;\n $options['targetcurriculum'] = 5;\n $options['moodlecourses'] = 'copyalways';\n $options['courses'] = 1;\n\n $return = $course->duplicate($options);\n\n // Make sure that a we get a program returned.\n $this->assertTrue(is_array($return['courses']));\n\n $id = $return['courses'][''];\n $record = $DB->get_record('local_elisprogram_crs', array('id' => $id));\n\n // We want to validate that the unique idnumber is \"test - test.3\".\n $expectedvalue = 'test - test.3';\n $this->assertEquals($expectedvalue, $record->idnumber);\n // The name is also to be unique.\n $this->assertEquals($expectedvalue, $record->name);\n }", "public function testExample()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n $this->addRequired();\n\n\n\n $CAC = new CourseAssignmentController();\n // prep post. \n $_POST = ['courseID' => \"CNET 295\",\n 'courseSection' => \"CNET 295 sec L004\",\n 'courseSectionDescrip' => \"\",\n 'studentList' => (array(\n 0 => \"Stu002\")),\n 'professorList' => (array(\n 0 => \"Pro002\"))\n ];\n\n // submit with section selected and one student and one professor\n $successJsonObj = $CAC->assignToSection();\n\n // check that the section assignment was successfull \n $this->assertTrue((strpos($successJsonObj, \"CNET 295 sec L004 has been successfully added\")) != false);\n\n $_POST = ['courseID' => \"CNET 295\",\n 'courseSection' => \"CNET 295 sec L004\",\n 'courseSectionDescrip' => \"\",\n 'studentList' => (array(\n 0 => \"Stu002\")),\n 'professorList' => (array(\n 0 => \"Pro002\"))\n ];\n // submit with section selected and one student and one professor\n $failCaseJsonObj = $CAC->assignToSection();\n \n // check that the section assignment was already submited and sends back that information\n $this->assertTrue((strpos($failCaseJsonObj, \" Stu002, Pro002, are already in CNET 295 sec L004. has been successfully Updated\")) != false);\n }" ]
[ "0.82740855", "0.81129014", "0.80251706", "0.7886504", "0.78603745", "0.78128827", "0.76612616", "0.7533197", "0.7528387", "0.7466489", "0.7259881", "0.72115034", "0.6707549", "0.66161615", "0.6487575", "0.6413536", "0.63474655", "0.6266347", "0.621182", "0.617547", "0.61524427", "0.6111451", "0.6105316", "0.6105239", "0.61022294", "0.6083758", "0.60513717", "0.60332257", "0.60239476", "0.59813696" ]
0.87973166
0
Test case for cloudPosCheckAddItemsToCourse .
public function testCloudPosCheckAddItemsToCourse() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckUpdateItemInCourse()\n {\n }", "public function testCloudPosCheckCancelItemInCourse()\n {\n }", "public function testCloudPosCheckAddCourseToCheck()\n {\n }", "public function testCloudPosCheckFastTrackItemInCourse()\n {\n }", "public function testCloudPosCheckUpdateCoursesInCheck()\n {\n }", "public function testCloudPosCheckUpdateCourse()\n {\n }", "public function testCloudPosCheckAddPaymentStateToCourse()\n {\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "public function testCloudPosCheckCancelCourseInCheck()\n {\n }", "public function testCloudPosCheckCancelAllCoursesInCheck()\n {\n }", "public function testCloudPosCheckDeleteCourseFromCheck()\n {\n }", "public function testCloudPosCheckAddCheck()\n {\n }", "public function testCatalogueLearnv1catalogitemsbatch()\n {\n\n }", "public function testCloudPosCheckFastTrackCourse()\n {\n }", "public function testAddingNewItemTrue() {\n $addCart = array(\"isbn\" => \"9791296965391\", \"amt\" => 20, \"title\" => \"Book of Life\", \"pic\" => \"https://unsplash.com/photos/DCzpr09cTXY\", \"price\" => 294);\n $result = $this->object->addingNewItem($addCart);\n $this->assertNotSame(0, count($result));\n $this->assertNotEmpty($result);\n }", "public function testAddCompleteItem()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/login')\n ->type('email', '[email protected]')\n ->type('password', 'password')\n ->press('Login')\n ->visit('/item/create')\n ->type('Name', 'test')\n ->type('Price', '12')\n ->type('Bulk Price', '20')\n ->type('Tokens Given', '3')\n ->type('Threshold', '1')\n ->type('Short Description', 'this is a test')\n ->type('Long Description', 'this is another test')\n ->keys('#start-date', '2017', '{tab}', '09', '15')\n ->keys('#end-date', '2018', '{tab}', '02', '20')\n ->type('Picture URL', 'test.jpg')\n ->press('Submit')\n ->assertSee('Item successfully created.');\n });\n }", "public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }", "public function testAddCourse()\n {\n $data = ['id' => 'PRJG5'];\n $course1 = factory(Course::class)->create($data);\n $course = Course::find('PRJG5');\n $this->assertDatabaseHas('courses', $data);\n }", "public function addcourses ($id_course , $description , $lecture_id) {\n return ($this -> restfullDAO -> insertcourses ( $id_course , $description , $lecture_id ));\n }", "public function testCatalogueLearnv1catalogassignmentsbatch()\n {\n\n }", "public function test_prepare_item() {\n\t}", "function testCategoryAdd() {\n\n $data = array(\n 'name' => 'Big Game 21' . md5(date('Y-m-d H:i:s').rand(1,100)),\n );\n\n // To verify add Parlay Category is invalid\n //========================================= \n // To verify data is empty\n $dataInvalid = '';\n $testResultFirst = $this->parlaycategory->add( $dataInvalid );\n if (is_array($testResultFirst) && isset($testResultFirst['message']) ) {\n\n $this->unit->run( $testResultFirst['message'], 'Please enter the required data', 'To verify add Category is invalid', 'To verify data is empty');\n }\n\n // To verify data is empty\n $dataInvalid['name'] = '';\n $testResultSecond = $this->parlaycategory->add( $dataInvalid );\n\n if (is_array($testResultSecond) && isset($testResultSecond['message']) ) {\n\n $this->unit->run( $testResultSecond['message'][0], 'The name field is required.', 'To verify add Category is invalid', 'To verify data is empty');\n }\n\n // To verify add category is exist\n $categories = $this->parlaycategory->get_by(array('id !=' => 0));\n\n if ( !empty( $categories ) ) {\n\n $dataInvalid['name'] = $categories->name;\n $testResultThird = $this->parlaycategory->add( $dataInvalid ); \n\n if (is_array($testResultThird) && isset($testResultThird['message']) ) {\n\n $this->unit->run( $testResultThird['message'], 'Cannot save a duplicate Parlay Category with name - ' . $dataInvalid['name'] , 'To verify add Parlay Category is invalid', 'To verify add category is exist');\n }\n }\n\n // To verify add Parlay Category is valid\n //======================================= \n $nameExpected = $data['name'];\n $testResultFourth = $this->parlaycategory->add( $data );\n\n if ( is_object($testResultFourth) ) {\n\n // To verify name returm must be equal name Parlay Category input\n $this->unit->run($testResultFourth->name, $nameExpected, 'To verify add Parlay Category is valid', 'To verify name returm must be equal name Parlay Category input');\n\n } else {\n\n echo \"<h4 style='color:red;'> Can't verify add category parlay is case valid</h4>\";\n }\n\n echo $this->unit->report();\n echo $this->returnResult($this->unit->result()); \n }", "public function test_auth_user_can_create_course()\n {\n $this->actingAs($this->user);\n $courseData = factory('App\\Course')->make()->toArray();\n $courseData['start_date'] = '10/10/2000';\n $courseData['end_date'] = '10/10/2000';\n $this->post(route('courses.store'), $courseData)->assertStatus(302);\n $this->assertEquals($courseData['description'], Course::latest()->first()->description);\n }", "public function testinsertItemArray()\n\t\t{\n\t\t\t$parameters[\"property_description\"] =\"lhsedjfhlkhf\";\n\t\t\t$parameters[\"auction_start_date\"] = \"2011-06-06\";\n\t\t\t$parameters[\"auction_close_date\"] = \"2011-06-06\";\n\t\t \t$parameters[\"auction_actual_selling_price\"] = \"300\";\n\t\t $parameters[\"property_reserve_price\"] = \"1\";\n\t\t $parameters[\"current_successful_bidder_user\"] = \"user 5\";\n\t\t \t$parameters[\"property_comments\"] = \"comments\";\n\t\t $parameters[\"property_photo\"] = \"1\";\n\t\t $parameters[\"property_rooms\"] = \"56\";\n\t\t $parameters[\"property_address\"] = \"out there somewhere\";\n\t\t \t$this->assertTrue($this->propDAO->insertItemArray($parameters));\n\t\t \t$this->insertedid = $this->propDAO->getLast();\n\t\t \t$this->assertTrue($this->propDAO->isExisting($this->insertedid ));\n\t\t \t\n\t\t \t//compare the writen results by reading back from the database\n\t\t \t$compare = $this->propDAO->getItem($this->insertedid);\n\t\t \t$this->compareArrays($compare , $parameters);\n\t\t \t\n\n\t\t}", "public function test_insert() {\n $rowid = \\tool_carcastc\\tool_carcastc_model::save_row((object)[\n 'courseid' => $this->course->id,\n 'name' => 'Row test 1',\n 'completed' => 1,\n 'priority' => 0\n ]);\n\n $row = \\tool_carcastc\\tool_carcastc_model::get_row(['id' => $rowid]);\n $this->assertEquals($this->course->id, $row->courseid);\n $this->assertEquals('Row test 1', $row->name);\n }", "public function test_elis_createorupdate_updates_course() {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/elis/program/lib/data/course.class.php');\n\n // Set up initial conditions.\n set_config('createorupdate', 1, 'rlipimport_version1elis');\n\n // Create the test course.\n $course = new course(array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'syllabus' => '',\n 'credits' => '0'\n ));\n $course->save();\n\n // Run the course create action.\n $record = new stdClass;\n $record->action = 'update';\n $record->context = 'course';\n $record->idnumber = 'testcourseidnumber';\n $record->credits = '5';\n\n $importplugin = rlip_dataplugin_factory::factory('rlipimport_version1elis');\n $importplugin->fslogger = new silent_fslogger(null);\n $importplugin->process_record('course', $record, 'bogus');\n\n // Validation.\n $this->assertTrue($DB->record_exists(course::TABLE, array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'credits' => 5\n )));\n }", "function public_on_create_item(&$inv_item, $is_in_acp = 0) { return true; }", "public function testItemConstruction() {\n $data = [\n 'id'=>1,\n 'name'=>'Solidarity4All',\n 'addr'=>'Akadimias 74, Athens 106 78, Greece',\n 'web'=>'www.solidarity4all.gr',\n 'plId'=>'ChIJHY6tsDC9oRQR4Jz2kwclWrQ',\n 'ico'=>'solidarity4all.png',\n 'free'=>true,\n 'lat'=>37.983587,\n 'lon'=>23.732831900000065,\n 'phone'=>'+34988765432',\n 'cfa'=>true,\n 'cat'=>'cat_food',\n 'order'=>'rest',\n 'lg'=>'en'\n ];\n $item = new Item($data['id'], $data['name'], $data['addr'],\n $data['web'],$data['plId'],$data['ico'],$data['free'],\n $data['lat'],$data['lon'],$data['phone'],$data['cfa'],\n $data['cat'],$data['lg'], $data['order'], $this->fakeGateway);\n $this->assertEquals($data['id'], $item->getItemId());\n $this->assertEquals($data['name'], $item->getName());\n $this->assertEquals($data['addr'], $item->getAddress());\n $this->assertEquals($data['web'], $item->getWebLink());\n $this->assertEquals($data['plId'], $item->getPlaceId());\n $this->assertEquals($data['ico'], $item->getIconUri());\n $this->assertEquals($data['free'], $item->isFree());\n $this->assertEquals($data['lat'], $item->getCoordLat());\n $this->assertEquals($data['lon'], $item->getCoordLon());\n $this->assertEquals($data['phone'], $item->getPhone());\n $this->assertEquals($data['cfa'], $item->shouldCallForAppointment());\n $this->assertEquals($data['cat'], $item->getCategoryCode());\n $this->assertEquals($data['order'], $item->getOrder());\n $this->assertEquals($data['lg'], $item->getLanguageCodes());\n }", "public function updateUserCourseDetailsByUserPurchaseItems() {\n try {\n $status = FALSE;\n $message = '';\n if ($this->request->is('post')) {\n $req_data = $this->request->data;\n if (!isset($req_data['user_id'])) {\n $message = 'user_id not found';\n throw new Exception($message);\n }\n if (empty($req_data['user_id'])) {\n $message = 'user id can not be empty';\n throw new Exception($message);\n }\n $payment_controller = new PaymentController();\n $purchase_detail_curl['url'] = Router::url('/', true) . 'users/getUserPurchaseDetails/' . $req_data['user_id'] . '/0/1';\n $purchase_detail_curl['return_transfer'] = 1;\n $purchase_detail_curl['post_fields'] = array();\n $purchase_detail_curl_response = $payment_controller->sendCurl($purchase_detail_curl);\n if ($purchase_detail_curl_response['status'] == TRUE && !empty($purchase_detail_curl_response['curl_exec_result'])) {\n $purchase_details = json_decode($purchase_detail_curl_response['curl_exec_result'], TRUE);\n if ($purchase_details['status'] == TRUE && !empty($purchase_details['response'])) {\n $purchase_details_response = $purchase_details['response'];\n if ($purchase_details_response['paid_status'] == 1) {\n $data['user_id'] = $purchase_details_response['user_id'];\n $data['course_ids'] = array();\n foreach ($purchase_details_response['purchase_detail'] as $detail) {\n $data['course_ids'][] = $detail['course_id'];\n }\n $delete_user_courses_curl['url'] = Router::url('/', true) . 'courses/deleteUserAllCourses';\n $delete_user_courses_curl['return_transfer'] = 1;\n $delete_user_courses_curl['post_fields'] = array('user_id' => $data['user_id']);\n $delete_user_courses_curl['json_post_fields'] = TRUE;\n $delete_user_courses_curl['curl_post'] = 1;\n $delete_user_courses_curl_response = $payment_controller->sendCurl($delete_user_courses_curl);\n if ($delete_user_courses_curl_response['status'] == TRUE && !empty($delete_user_courses_curl_response['curl_exec_result'])) {\n $delete_user_courses = json_decode($delete_user_courses_curl_response['curl_exec_result'], TRUE);\n if ($delete_user_courses['status'] == TRUE || $delete_user_courses['record_found'] == 0) {\n $set_user_courses_curl['url'] = Router::url('/', true) . 'courses/setUserCourse';\n $set_user_courses_curl['return_transfer'] = 1;\n $set_user_courses_curl['post_fields'] = $data;\n $set_user_courses_curl['json_post_fields'] = TRUE;\n $set_user_courses_curl['curl_post'] = 1;\n $set_user_courses_curl_response = $payment_controller->sendCurl($set_user_courses_curl);\n if ($set_user_courses_curl_response['status'] == TRUE && !empty($set_user_courses_curl_response['curl_exec_result'])) {\n $set_user_courses = json_decode($set_user_courses_curl_response['curl_exec_result'], TRUE);\n if ($set_user_courses['status'] == TRUE) {\n $status = TRUE;\n } else {\n $message = 'Unable to set user new courses';\n throw new Exception($message);\n }\n } else {\n $message = 'Unable to get curl response from set courses for users';\n throw new Exception($message);\n }\n } else {\n $message = 'Unable to delete courses for users';\n throw new Exception($message);\n }\n } else {\n $message = 'Unable to get curl response from delete courses for users';\n throw new Exception($message);\n }\n } else {\n $message = 'user has not purchased the courses yet';\n throw new Exception($message);\n }\n } else {\n $message = 'Unable to get info about purchase details';\n throw new Exception($message);\n }\n } else {\n $message = 'Unable to get curl response';\n throw new Exception($message);\n }\n }\n } catch (Exception $ex) {\n $this->log($ex->getMessage() . '(' . __METHOD__ . ')');\n }\n $this->set([\n 'status' => $status,\n 'message' => $message,\n '_serialize' => ['status', 'message']\n ]);\n }", "function ciniki_writingcatalog_itemAdd(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'title'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Title'), \n 'subtitle'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Subtitle'), \n 'permalink'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Permalink'), \n 'type'=>array('required'=>'no', 'blank'=>'no', 'default'=>'30', 'name'=>'Type'),\n 'webflags'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'0', 'name'=>'Web Flags'), \n 'image_id'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'0', 'name'=>'Image'),\n 'catalog_number'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Catalog Number'), \n 'year'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Year'), \n 'month'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Month'), \n 'day'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Day'), \n 'synopsis'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Synopsis'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Description'), \n 'content'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Content'), \n 'inspiration'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Inspiration'), \n 'awards'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Awards'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Notes'), \n 'categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Categories'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'writingcatalog', 'private', 'checkAccess');\n $rc = ciniki_writingcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.writingcatalog.itemAdd'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['title']);\n \n //\n // Get a new UUID\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUUID');\n $rc = ciniki_core_dbUUID($ciniki, 'ciniki.writingcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args['uuid'] = $rc['uuid'];\n\n //\n // Check the permalink doesn't already exist\n //\n $strsql = \"SELECT id, title, permalink FROM ciniki_writingcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.writingcatalog', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingcatalog.15', 'msg'=>'You already have an item with this title, please choose another title.'));\n }\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.writingcatalog');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.writingcatalog.item', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.writingcatalog');\n return $rc;\n }\n $writingcatalog_id = $rc['id'];\n\n //\n // Update the categories\n //\n if( isset($args['categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.writingcatalog', 'tag', $args['tnid'],\n 'ciniki_writingcatalog_tags', 'ciniki_writingcatalog_history',\n 'writingcatalog_id', $writingcatalog_id, 10, $args['categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.writingcatalog');\n return $rc;\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.writingcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'writingcatalog');\n\n return array('stat'=>'ok', 'id'=>$writingcatalog_id);\n}" ]
[ "0.8269776", "0.7943211", "0.79268444", "0.7542986", "0.75186133", "0.743225", "0.7394996", "0.72358614", "0.7110972", "0.70349044", "0.6992005", "0.6546899", "0.6507709", "0.6397305", "0.61310285", "0.60987025", "0.60770303", "0.60762566", "0.5863279", "0.5830748", "0.57927305", "0.57878625", "0.57761127", "0.5759855", "0.5752509", "0.574157", "0.57139844", "0.5713727", "0.57075524", "0.56944305" ]
0.89112914
0
Test case for cloudPosCheckAddPaymentStateToCourse .
public function testCloudPosCheckAddPaymentStateToCourse() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }", "public function testCloudPosCheckCancelCourseInCheck()\n {\n }", "public function testCloudPosCheckAddCourseToCheck()\n {\n }", "public function testCloudPosCheckUpdateCourse()\n {\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "public function testCloudPosCheckAddItemsToCourse()\n {\n }", "public function testCloudPosCheckCancelItemInCourse()\n {\n }", "public function testCloudPosCheckUpdateCoursesInCheck()\n {\n }", "public function testCloudPosCheckUpdateItemInCourse()\n {\n }", "public function testCloudPosCheckCancelAllCoursesInCheck()\n {\n }", "function paymentSuccessCheck();", "public function testCloudPosCheckDeleteCourseFromCheck()\n {\n }", "public function testCloudPosCheckFastTrackItemInCourse()\n {\n }", "public function testStandalonePayment()\n {\n }", "public function testPayWithPaymentAccount()\n {\n }", "public function testProductAPISetProductIsPrepaymentStatus()\n {\n\n }", "public function testPayWithCustomerPaymentAccount()\n {\n }", "public function testCloudPosCheckFastTrackCourse()\n {\n }", "public function testPayWithSelectedPaymentNetwork()\n {\n }", "public function it_should_check_status_pay()\n {\n $sessionPayment = $this->placetopay->payment(1);\n $response = $this->placetopay->payInfo($sessionPayment->requestId());\n $this->assertTrue($response->isSuccessful());\n $this->assertNotEmpty($response->status());\n }", "public function testPayWithPaymentNetwork()\n {\n }", "public function testPayStatus()\n {\n $this->assertArraySubset(\n ['status' => 'success'],\n $this->payStatusClient->getStatus([\n 'location' => 'http://localhost:3000/api/v1/payments/79600157-2ebb-4d7b-be1a-b7ad445554cd',\n 'accessToken' => 'myRand0mAcc3ssT0k3n',\n ])\n );\n }", "public function testGetPendingPayments()\n {\n\n }", "public function testVoucherMarkAsPaid()\n {\n }", "public function testPayoutTransaction()\n {\n }", "public function testCloudPosCheckAddCheck()\n {\n }", "function paidCheckout () {\t\t\n\t\t\n\t\t/* PAYPAL API DETAILS */\n\t\t$API_UserName \t= $this->API_UserName;\n\t\t$API_Password \t= $this->API_Password;\n\t\t$API_Signature = $this->API_Signature;\n\t\t$API_Endpoint \t= $this->API_Endpoint;\n\t $version = $this->version;\n\t\t\n\t\t/*SET SUCCESS AND FAIL URL*/\n\t\t$host \t = $_SERVER['SERVER_NAME'];\t\t \n\t\t$root = $this->webroot; \n\t\t$returnURL = \"http://$host$root\".'controller/reviewOrder';\n\t\t$cancelURL = \"http://$host$root\".'controller/signupFailure';\n\t\t\n\t\t/* SET VALUES */\t\n\t\t$environment \t= $this->environment;\t\t\n\t\t$L_BILLINGTYPE0 = 'RecurringPayments';\t\t\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t\n\t $obj\t= new PaypalRecurring;\t\t\n\t\t\t\n\t\t\t/* PAYPAL API DETAILS */\n\t\t\t$obj->API_UserName \t= urlencode($API_UserName);\n\t\t\t$obj->API_Password \t= urlencode($API_Password);\n\t\t\t$obj->API_Signature = urlencode($API_Signature);\n\t\t\t$obj->API_Endpoint \t= $API_Endpoint;\n\t\t\t$obj->version \t\t= urlencode($version);\n\t\t\t\n\t\t\t/*SET SUCCESS AND FAIL URL*/\n\t\t\t$obj->returnURL = urlencode($returnURL);\n\t\t\t$obj->cancelURL = urlencode($cancelURL);\n\t\t\t\n\t\t\t$obj->environment \t\t\t\t\t\t= $environment;\t\n\t\t\t$obj->paymentType \t\t\t\t\t\t= urlencode($paymentType);\t\n\t\t\t$obj->L_BILLINGTYPE0 \t\t\t\t\t= $L_BILLINGTYPE0;\t\t\n\t\t\t$obj->L_BILLINGAGREEMENTDESCRIPTION0\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0);\t\n\t\t\t$obj->paymentAmount\t\t\t\t\t\t= urlencode($subscription_cost); //Amt\n\t\t\t$obj->taxamount\t\t\t\t\t\t\t= urlencode($service_tax);\t\n\t\t\t$obj->currencyID\t\t\t\t\t\t= urlencode($currency_code);\t\n\t\t\t$obj->L_PAYMENTREQUEST_0_NAME0\t\t\t= urlencode($subscription_name);\n\t\t\t$obj->L_PAYMENTREQUEST_0_AMT0\t\t\t= urlencode($subscription_cost);\n\t\t\t$obj->L_PAYMENTREQUEST_0_DESC0\t\t\t= urlencode($L_BILLINGAGREEMENTDESCRIPTION0);\t\n\t\t\t$obj->PAYMENTREQUEST_0_ITEMAMT\t\t\t= urlencode($subscription_cost);\n\t\t\t$obj->PAYMENTREQUEST_0_TAXAMT\t\t\t= urlencode($service_tax);\n\t\t\t$obj->PAYMENTREQUEST_0_AMT\t\t\t\t= urlencode($bill_amount); // grand total\n\t\t\t$obj->PAYMENTREQUEST_0_CURRENCYCODE\t\t= urlencode($currency_code);\n\t\t\t\t\t\t\t\n\t\t\t$task = \"setExpressCheckout\"; //set initial task as Express Checkout\t\t\t\n\t\t\t$httpParsedResponseAr = $obj->setExpressCheckout();\n\t\t\t$methodError = 'SetExpressCheckout';\t\t\t\n\t\t\t$errorCode \t= urldecode($httpParsedResponseAr[\"L_ERRORCODE0\"]);\n\t\t\t$errorSmallMsg = urldecode($httpParsedResponseAr[\"L_SHORTMESSAGE0\"]);\n\t\t\t$errorLongMsg = urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]);\n\t\t\t$serverCode = urldecode($httpParsedResponseAr[\"L_SEVERITYCODE0\"]);\n\t\t\t\n\t\t\t// store in session for later use\n\t\t\t$this->Session->write('errorCode',$errorCode);\t\t\t\n\t\t\t$this->Session->write('errorSmallMsg',$errorSmallMsg);\n\t\t\t$this->Session->write('errorLongMsg',$errorLongMsg);\t\n\t\t\t$this->Session->write('serverCode',$serverCode);\t\t\t\n\t\t\t$this->redirect(array('controller'=>'controller','action' => 'action/'.$methodError));\n\t\t\t\n\t\t}\n\t}", "private function transitionCourseCheck()\n {\n if ($this->userContext->getPrimarySerialNumber()->hasTransitionCourse()) {\n $code = $this->_getParam(\"code\");\n if ($code) {\n $link = \"/account/new/index/code/$code\";\n $errorMsg = \"That activation code cannot be used with a Transition Course account, but you can use it \".\n \"to <a href='$link'>create a new account</a>.\";\n } else {\n $link = \"/account/new\";\n $errorMsg = \"Transition Course accounts cannot be upgraded, but you can \".\n \"<a href='$link'>create a new account</a>.\";\n }\n $this->displayError($errorMsg);\n return;\n }\n }", "public function testGetPaymentMethods()\n {\n\n }", "protected function testGetPaymentStatus() {\n $payment_status_a = $this->statusManager->createInstance('payment_pending');\n $payment_status_b = $this->statusManager->createInstance('payment_failed');\n $this->assertEqual(spl_object_hash($this->payment->setPaymentStatus($payment_status_a)), spl_object_hash($this->payment));\n $this->assertEqual(spl_object_hash($this->payment->getPaymentStatus()), spl_object_hash($payment_status_a));\n // Make sure we always get the last status.\n $this->payment->setPaymentStatus($payment_status_b);\n $this->assertEqual(spl_object_hash($this->payment->getPaymentStatus()), spl_object_hash($payment_status_b));\n }" ]
[ "0.81946516", "0.7423585", "0.7348993", "0.717222", "0.7154", "0.71290946", "0.7065115", "0.7041058", "0.7013538", "0.67557406", "0.6535058", "0.64878684", "0.63479966", "0.6306831", "0.6300727", "0.6280576", "0.61663866", "0.61509764", "0.6147427", "0.60987455", "0.60083115", "0.59632987", "0.5957312", "0.5937496", "0.59172994", "0.586233", "0.5861905", "0.5849771", "0.5849004", "0.584562" ]
0.90262926
0
Test case for cloudPosCheckAddPaymentStatesToCheck .
public function testCloudPosCheckAddPaymentStatesToCheck() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckAddPaymentStateToCourse()\n {\n }", "function paymentSuccessCheck();", "public function testCloudPosCheckAddCheck()\n {\n }", "public function testPayWithPaymentAccount()\n {\n }", "public function testPayWithSelectedPaymentNetwork()\n {\n }", "public function testCloudPosCheckGetCheckByCheckNumber()\n {\n }", "public function testProductAPISetProductIsPrepaymentStatus()\n {\n\n }", "public function testStandalonePayment()\n {\n }", "public function testGetPendingPayments()\n {\n\n }", "public function testPayWithPaymentNetwork()\n {\n }", "public function testPayWithCustomerPaymentAccount()\n {\n }", "public function testPayoutTransaction()\n {\n }", "public function testPayinTransaction()\n {\n }", "protected function testGetPaymentStatus() {\n $payment_status_a = $this->statusManager->createInstance('payment_pending');\n $payment_status_b = $this->statusManager->createInstance('payment_failed');\n $this->assertEqual(spl_object_hash($this->payment->setPaymentStatus($payment_status_a)), spl_object_hash($this->payment));\n $this->assertEqual(spl_object_hash($this->payment->getPaymentStatus()), spl_object_hash($payment_status_a));\n // Make sure we always get the last status.\n $this->payment->setPaymentStatus($payment_status_b);\n $this->assertEqual(spl_object_hash($this->payment->getPaymentStatus()), spl_object_hash($payment_status_b));\n }", "public function it_should_check_status_pay()\n {\n $sessionPayment = $this->placetopay->payment(1);\n $response = $this->placetopay->payInfo($sessionPayment->requestId());\n $this->assertTrue($response->isSuccessful());\n $this->assertNotEmpty($response->status());\n }", "public function testPOSTDeliveryCheckoutsDeliveryCheckoutIdSummaryCurrency()\n {\n }", "public function testVoucherMarkAsPaid()\n {\n }", "public function testVoucherChangeStatus()\n {\n }", "public function testPayRunsPost()\n {\n }", "function wpbc_add_payment_status_ok__sage( $payment_status ){\n $payment_status = array_merge( $payment_status, \n array(\n 'Sage:OK'\n ) \n ); \n return $payment_status; \n }", "public function testWorkflow_Active_FromSignup()\n {\n $plan = $this->setUpPlan();\n $plan->plan_monthly_behavior = 'monthly_signup';\n $plan->save();\n\n list($user, $plan, $membership, $service, $invoice) = $payload = $this->generatePaidMembership($plan);\n $this->assertNotNull($plan, $membership, $service, $service->status, $invoice, $invoice->status);\n\n $this->assertEquals(Carbon::now(), $service->service_period_start, '', 5);\n $this->assertEquals(Carbon::now()->addMonth(), $service->service_period_end, '', 5);\n $this->assertEquals(100, $invoice->total);\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "function before_process() {\r\n global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart;\r\n global $$payment;\r\n \r\n // check the Signature \r\n // state+amount+currency+orderid+mosoauth+postref\r\n $msg = $_REQUEST['state'];\r\n $msg .= $_REQUEST['amount'];\r\n $msg .= $_REQUEST['currency'];\r\n $msg .= $_REQUEST['orderid'];\r\n $msg .= $_REQUEST['mosoauth'];\r\n $msg .= $_REQUEST['postref'];\r\n \r\n $check = $this->hmac_sha ( pack ( \"H*\", MODULE_PAYMENT_MOBILESOLUTIONS_SIGNKEY ), $msg );\r\n \r\n // If not the Same, redirect to Payment Method selection !!\r\n if ($check != $_REQUEST['sign']) {\r\n tep_redirect ( tep_href_link ( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode ( MODULE_PAYMENT_MOBILESOLUTIONS_ERROR_PAYMENT_FAILED ), 'SSL' ) );\r\n }\r\n \r\n $order_id = $_REQUEST['orderid'];\r\n $order_status = $_REQUEST['state'];\r\n \r\n $order_query = tep_db_query(\"select orders_status from \" . TABLE_ORDERS . \" where orders_id = '\" . (int)$order_id . \"'\");\r\n if (tep_db_num_rows($order_query) > 0) {\r\n $db_array = tep_db_fetch_array($order_query);\r\n $db_order_status = $db_array['orders_status'];\r\n\r\n // Change the State only, if current State is Preparation\r\n if ($db_order_status == MODULE_PAYMENT_MOBILESOLUTIONS_PREPARE_ORDER_STATUS_ID ) {\r\n \r\n if ($order_status == 'error') {\r\n if (tep_not_null(MODULE_PAYMENT_MOBILESOLUTIONS_DEBUG_EMAIL)) {\r\n $email_body = '$_POST:' . \"\\n\\n\";\r\n \r\n reset($_POST);\r\n while (list($key, $value) = each($_POST)) {\r\n \t $email_body .= $key . '=' . $value . \"\\n\";\r\n }\r\n \r\n $email_body .= \"\\n\" . '$_GET:' . \"\\n\\n\";\r\n \r\n reset($_GET);\r\n while (list($key, $value) = each($_GET)) {\r\n \t $email_body .= $key . '=' . $value . \"\\n\";\r\n }\r\n \r\n tep_mail('', MODULE_PAYMENT_MOBILESOLUTIONS_DEBUG_EMAIL, 'Post Finance Mobile (mobile solutions ag) Invalid Process', $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);\r\n }\r\n tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = \"' . $order_id . '\"');\r\n tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT));\r\n \r\n } else if ($order_status == 'success') {\r\n $new_status_id = MODULE_PAYMENT_MOBILESOLUTIONS_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_MOBILESOLUTIONS_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID;\r\n \r\n // Set the Default Order State (after Preparation)\r\n tep_db_query(\"update \" . TABLE_ORDERS . \" set orders_status = '\" . (int)$new_status_id . \"', last_modified = now() where orders_id = '\" . (int)$order_id . \"'\");\r\n \r\n // Add en State History Entry\r\n $sql_data_array = array('orders_id' => $order_id,\r\n 'orders_status_id' => $new_status_id,\r\n 'date_added' => 'now()',\r\n 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0',\r\n 'comments' => 'PostFinance Mobile ('. $_GET['mosoauth'] .')');\r\n \r\n tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\r\n \r\n // initialized for the email confirmation\r\n $products_ordered = '';\r\n $subtotal = 0;\r\n $total_tax = 0;\r\n \r\n for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {\r\n // Stock Update - Joao Correia\r\n if (STOCK_LIMITED == 'true') {\r\n if (DOWNLOAD_ENABLED == 'true') {\r\n $stock_query_raw = \"SELECT products_quantity, pad.products_attributes_filename\r\n FROM \" . TABLE_PRODUCTS . \" p\r\n LEFT JOIN \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\r\n ON p.products_id=pa.products_id\r\n LEFT JOIN \" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . \" pad\r\n ON pa.products_attributes_id=pad.products_attributes_id\r\n WHERE p.products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\";\r\n // Will work with only one option for downloadable products\r\n // otherwise, we have to build the query dynamically with a loop\r\n $products_attributes = $order->products[$i]['attributes'];\r\n if (is_array($products_attributes)) {\r\n $stock_query_raw .= \" AND pa.options_id = '\" . $products_attributes[0]['option_id'] . \"' AND pa.options_values_id = '\" . $products_attributes[0]['value_id'] . \"'\";\r\n }\r\n $stock_query = tep_db_query($stock_query_raw);\r\n } else {\r\n $stock_query = tep_db_query(\"select products_quantity from \" . TABLE_PRODUCTS . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\r\n }\r\n if (tep_db_num_rows($stock_query) > 0) {\r\n $stock_values = tep_db_fetch_array($stock_query);\r\n // do not decrement quantities if products_attributes_filename exists\r\n if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {\r\n $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];\r\n } else {\r\n $stock_left = $stock_values['products_quantity'];\r\n }\r\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = '\" . $stock_left . \"' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\r\n if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {\r\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_status = '0' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\r\n }\r\n }\r\n }\r\n \r\n // Update products_ordered (for bestsellers list)\r\n \t\ttep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_ordered = products_ordered + \" . sprintf('%d', $order->products[$i]['qty']) . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\r\n \r\n \t\t//------insert customer choosen option to order--------\r\n $attributes_exist = '0';\r\n $products_ordered_attributes = '';\r\n if (isset($order->products[$i]['attributes'])) {\r\n $attributes_exist = '1';\r\n for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {\r\n if (DOWNLOAD_ENABLED == 'true') {\r\n $attributes_query = \"select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename\r\n from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\r\n left join \" . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . \" pad\r\n on pa.products_attributes_id=pad.products_attributes_id\r\n where pa.products_id = '\" . $order->products[$i]['id'] . \"'\r\n and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"'\r\n and pa.options_id = popt.products_options_id\r\n and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"'\r\n and pa.options_values_id = poval.products_options_values_id\r\n and popt.language_id = '\" . $languages_id . \"'\r\n and poval.language_id = '\" . $languages_id . \"'\";\r\n $attributes = tep_db_query($attributes_query);\r\n } else {\r\n $attributes = tep_db_query(\"select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa where pa.products_id = '\" . $order->products[$i]['id'] . \"' and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"' and pa.options_id = popt.products_options_id and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '\" . $languages_id . \"' and poval.language_id = '\" . $languages_id . \"'\");\r\n }\r\n $attributes_values = tep_db_fetch_array($attributes);\r\n \r\n $products_ordered_attributes .= \"\\n\\t\" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];\r\n }\r\n }\r\n \t\t//------insert customer choosen option eof ----\r\n $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);\r\n $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];\r\n $total_cost += $total_products_price;\r\n \r\n $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . \"\\n\";\r\n }\r\n \r\n // lets start with the email confirmation\r\n $email_order = STORE_NAME . \"\\n\" .\r\n EMAIL_SEPARATOR . \"\\n\" .\r\n EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . \"\\n\" .\r\n EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . \"\\n\" .\r\n EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . \"\\n\\n\";\r\n if ($order->info['comments']) {\r\n $email_order .= tep_db_output($order->info['comments']) . \"\\n\\n\";\r\n }\r\n $email_order .= EMAIL_TEXT_PRODUCTS . \"\\n\" .\r\n EMAIL_SEPARATOR . \"\\n\" .\r\n $products_ordered .\r\n EMAIL_SEPARATOR . \"\\n\";\r\n \r\n for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {\r\n $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . \"\\n\";\r\n }\r\n \r\n if ($order->content_type != 'virtual') {\r\n $email_order .= \"\\n\" . EMAIL_TEXT_DELIVERY_ADDRESS . \"\\n\" .\r\n EMAIL_SEPARATOR . \"\\n\" .\r\n tep_address_label($customer_id, $sendto, 0, '', \"\\n\") . \"\\n\";\r\n }\r\n \r\n $email_order .= \"\\n\" . EMAIL_TEXT_BILLING_ADDRESS . \"\\n\" .\r\n EMAIL_SEPARATOR . \"\\n\" .\r\n tep_address_label($customer_id, $billto, 0, '', \"\\n\") . \"\\n\\n\";\r\n if (is_object($$payment)) {\r\n $email_order .= EMAIL_TEXT_PAYMENT_METHOD . \"\\n\" .\r\n EMAIL_SEPARATOR . \"\\n\";\r\n $payment_class = $$payment;\r\n $email_order .= $payment_class->title . \"\\n\\n\";\r\n if ($payment_class->email_footer) {\r\n $email_order .= $payment_class->email_footer . \"\\n\\n\";\r\n }\r\n \t }\r\n \r\n // send email to customer and (maybe) other people\r\n tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);\r\n if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\r\n tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);\r\n }\r\n \r\n // Reset Cart, if User-Agent does not start with \"Java\"\r\n if (strncasecmp($_SERVER['HTTP_USER_AGENT'],\"Java\",4) == 0) {\r\n // Remove Database part of Shopping Cart\r\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET . \" where customers_id = '\" . (int)$customer_id . \"'\");\r\n tep_db_query(\"delete from \" . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . \" where customers_id = '\" . (int)$customer_id . \"'\");\r\n \r\n } else {\r\n // Real User\r\n $cart->reset(true);\r\n \r\n // unregister session variables used during checkout\r\n tep_session_unregister('sendto');\r\n tep_session_unregister('billto');\r\n tep_session_unregister('shipping');\r\n tep_session_unregister('payment');\r\n tep_session_unregister('comments');\r\n }\r\n \r\n tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));\r\n }\r\n \r\n } else if($db_order_status == MODULE_PAYMENT_MOBILESOLUTIONS_ORDER_STATUS_ID ||\r\n $db_order_status == DEFAULT_ORDERS_STATUS_ID) {\r\n \r\n // HTTP Post call was faster than the User, just unregister the cart and redirect User \r\n $cart->reset(true);\r\n\r\n // unregister session variables used during checkout\r\n tep_session_unregister('sendto');\r\n tep_session_unregister('billto');\r\n tep_session_unregister('shipping');\r\n tep_session_unregister('payment');\r\n tep_session_unregister('comments');\r\n \r\n tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));\r\n }\r\n }\r\n tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\r\n }", "public function testVoucherGetCheckAccountTransactions()\n {\n }", "public function testPayStatus()\n {\n $this->assertArraySubset(\n ['status' => 'success'],\n $this->payStatusClient->getStatus([\n 'location' => 'http://localhost:3000/api/v1/payments/79600157-2ebb-4d7b-be1a-b7ad445554cd',\n 'accessToken' => 'myRand0mAcc3ssT0k3n',\n ])\n );\n }", "public function testGetPaymentMethods()\n {\n\n }", "function transaction_check(){\n }", "public function testPostingAPIPostingFBSActCheckStatus()\n {\n\n }", "function check_validity_followup_new($billid,$op_name='',$db='')\n{\n $priv=getprivilage(\"\",$op_name);\n $privilages=explode(\"+\",$priv);\n\n $sql_service =\"SELECT PROFILEID,ENTRY_DT,SERVICEID FROM billing.PURCHASES WHERE BILLID='$billid' AND STATUS='DONE'\";\n $res_service =mysql_query_decide($sql_service,$db) or die(\"Could not return from PURCHASES\");\n $row_check =mysql_fetch_assoc($res_service);\n\n if(in_array(\"ExcPrm\",$privilages) || in_array(\"ExPrmO\",$privilages)){\n if($row_check){\n $service=$row_check['SERVICEID'];\n if(in_array(\"ExPrmO\",$privilages)){\n if(!strstr($service,'X'))\n return 0;\n }\n else{\n if(!strstr($service,'ES')&&!strstr($service,'X'))\n return 0;\n }\n }\n }\n /* Code for JS Premium/ JS Premium Outsourced users check*/\n\n $profileid =$row_check[\"PROFILEID\"];\n $billing_day =JSstrToTime($row_check[\"ENTRY_DT\"]);\n $billing_dt =date(\"Y-m-d\",$billing_day);\n $checking_day =date(\"Y-m-d\",$billing_day-86400);\n $sql_check2 =\"SELECT ALLOTED_TO,ALLOT_TIME FROM incentive.CRM_DAILY_ALLOT WHERE PROFILEID='$profileid' ORDER BY ID DESC LIMIT 1\";\n $res_check2 =mysql_query_decide($sql_check2,$db) or die(\"Could not get from CRM_DAILY_ALLOT\");\n $row_check2 =mysql_fetch_array($res_check2);\n $allot_time =JSstrToTime($row_check2[\"ALLOT_TIME\"]);\n $allot_to =$row_check2[\"ALLOTED_TO\"];\n if($op_name!=''){\n if($allot_to!=$op_name)\n return 0;\n }\n $allot_dt =date(\"Y-m-d\",$allot_time);\n $checking_time =JSstrToTime($checking_day);\n $diff_time =($checking_time-$allot_time)/86400;\n if($allot_dt==$billing_dt || $diff_time<=15)\n $go = 1;\n else\n $go = 0;\n\n $sql_check1=\"SELECT COUNT(*) AS CNT FROM incentive.MANUAL_ALLOT m JOIN incentive.MAIN_ADMIN ma ON m.PROFILEID=ma.PROFILEID WHERE m.PROFILEID='$profileid' AND m.ALLOTED_TO='$op_name' AND m.ALLOT_TIME>=ma.ALLOT_TIME\";\n $res_check1=mysql_query($sql_check1,$db) or logError($sql_check1);\n $row_check1=mysql_fetch_array($res_check1);\n if($row_check1[\"CNT\"]>0)\n $manual_case = 1;\n else\n $manual_case = 0;\n if(!$manual_case && !$go)\n {\n $sql_history = \"SELECT COUNT(*) AS cnt FROM incentive.HISTORY WHERE PROFILEID = '$profileid' AND ENTRYBY = '$op_name' AND DATEDIFF('$checking_day', ENTRY_DT) <=15 AND DATEDIFF('$checking_day', ENTRY_DT) >=0\";\n $res_history = mysql_query($sql_history,$db) or logError($sql_history);\n if($row_history =mysql_fetch_array($res_history))\n $count=$row_history['cnt'];\n if($count>0)\n return 1;\n else\n return 0;\n }\n else\n return 1;\n}", "public function testCreatePaymentSuccess(): void\n {\n $data = ['total_product' => 50000, 'total_cash' => 10000];\n $this->artisan('db:seed --class=CashRegisterSeeder');\n $response = $this->post(route('payment.create'), $data, ['Accept' => 'application/json']);\n\n $response->assertStatus(201);\n $this->assertDatabaseHas('payments', $data);\n $this->assertDatabaseHas('logs', ['type' => 'entry', 'total' => $data['total_cash']]);\n }" ]
[ "0.76512873", "0.68058425", "0.66055363", "0.64621925", "0.6383272", "0.6316606", "0.63159317", "0.6299503", "0.62966436", "0.6227688", "0.6206887", "0.6199607", "0.61829436", "0.6155864", "0.61389285", "0.61262584", "0.6082374", "0.6079553", "0.6073154", "0.60380656", "0.5995286", "0.5984501", "0.5978605", "0.5975398", "0.5966414", "0.5965754", "0.59562314", "0.59081745", "0.58968985", "0.58902067" ]
0.900204
0
Test case for cloudPosCheckBumpCheck .
public function testCloudPosCheckBumpCheck() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloudPosCheckUpdateCheck()\n {\n }", "public function testCloudPosCheckBumpCourseOnCheck()\n {\n }", "public function testCloudPosCheckFastTrackCheck()\n {\n }", "public function testCloudPosCheckAddCheck()\n {\n }", "private function bump_step()\n {\n }", "public function testCloudPosCheckGetCheckByCheckNumber()\n {\n }", "function bbp_version_bump()\n{\n}", "public function testCloudPosCheckDeleteCheck()\n {\n }", "public function testCloudPosCheckFastTrackCourse()\n {\n }", "public function testCloudPosCheckFastTrackItemInCourse()\n {\n }", "public function testGameStatusPointsBelow100()\n {\n $game = new Game();\n $res = $game->checkGameStatus();\n $exp = false;\n $this->assertEquals($exp, $res);\n }", "public function testSpaceUpdate()\n {\n }", "public function testCloudPosCheckAddPaymentStatesToCheck()\n {\n }", "public function testCloudPosCheckUpdateItemInCourse()\n {\n }", "public function testCloudPosCheckUpdateCourse()\n {\n }", "public function testPingTreeTargetGetCurrentCounts()\n {\n }", "public function testSupportResistance()\n {\n }", "public function testGetPostition()\n {\n $this->assertTrue(0 <= $this->blockGroup->getPosition());\n $this->assertTrue(100 >= $this->blockGroup->getPosition());\n\n return true;\n }", "function test_update_existing() {\n\t}", "public function testStatusUpdate(): void\n {\n Queue::fake();\n $checkpoints = [];\n $snapshot = \\factory(Snapshot::class)->create();\n $checkpoints[] = \\factory(Checkpoint::class)->create([\n 'snapshot_id' => $snapshot->id,\n 'name' => 'one',\n 'image_status' => Checkpoint::IMAGE_STATUS_AVAILABLE,\n 'approval_status' => Checkpoint::APPROVAL_STATUS_UNKNOWN,\n 'diff_status' => Checkpoint::DIFF_STATUS_DIFFERENT,\n ]);\n $checkpoints[] = \\factory(Checkpoint::class)->create([\n 'snapshot_id' => $snapshot->id,\n 'name' => 'one',\n 'image_status' => Checkpoint::IMAGE_STATUS_AVAILABLE,\n 'approval_status' => Checkpoint::APPROVAL_STATUS_UNKNOWN,\n 'diff_status' => Checkpoint::DIFF_STATUS_DIFFERENT,\n ]);\n\n // Processing status is waiting if there's unknown checkpoints.\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n\n // Should stay at unknown as long as there's unknown checkpoints.\n $checkpoints[0]->approval_status = Checkpoint::APPROVAL_STATUS_APPROVED;\n $checkpoints[0]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n\n // Should pass when all checkpoints are either approved or ignored\n $checkpoints[1]->approval_status = Checkpoint::APPROVAL_STATUS_IGNORED;\n $checkpoints[1]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_PASSED, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_DONE, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n\n // Run status should be pending as long as there's active batches.\n $batch = \\factory(Batch::class)->create(['snapshot_id' => $snapshot->id]);\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_DONE, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_PENDING, $snapshot->run_status);\n\n $batch->delete();\n\n // Or pending Checkpoints.\n $checkpoints[1]->approval_status = Checkpoint::APPROVAL_STATUS_UNKNOWN;\n $checkpoints[1]->image_status = Checkpoint::IMAGE_STATUS_PENDING;\n $checkpoints[1]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_PENDING, $snapshot->run_status);\n\n // Or Checkpoints needing diff, but only if it has both image and baseline.\n $checkpoints[1]->image_status = Checkpoint::IMAGE_STATUS_AVAILABLE;\n $checkpoints[1]->diff_status = Checkpoint::DIFF_STATUS_UNKNOWN;\n $checkpoints[1]->image_url = 'url';\n $checkpoints[1]->baseline_url = 'url';\n $checkpoints[1]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_PENDING, $snapshot->run_status);\n\n // Else run status should be done.\n $checkpoints[1]->image_url = null;\n $checkpoints[1]->baseline_url = null;\n $checkpoints[1]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_UNKNOWN, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n\n // Should fail if there's rejected checkpoints.\n $checkpoints[1]->image_status = Checkpoint::IMAGE_STATUS_AVAILABLE;\n $checkpoints[1]->diff_status = Checkpoint::DIFF_STATUS_DIFFERENT;\n $checkpoints[1]->approval_status = Checkpoint::APPROVAL_STATUS_REJECTED;\n $checkpoints[1]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_FAILED, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_DONE, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n\n // Rejected trumps unknown.\n $checkpoints[0]->approval_status = Checkpoint::APPROVAL_STATUS_UNKNOWN;\n $checkpoints[0]->save();\n\n $snapshot->updateStatus();\n $this->assertEquals(Snapshot::STATUS_FAILED, $snapshot->status);\n $this->assertEquals(Snapshot::PROCESSING_STATUS_PENDING, $snapshot->processing_status);\n $this->assertEquals(Snapshot::RUN_STATUS_DONE, $snapshot->run_status);\n }", "public function testKycChecksPut()\n {\n }", "public function testPingTreeTargetPatch()\n {\n }", "function run() {\n\t\t// rather than being one greater than the last known update\n\n\t\treturn UPDATE_SUCCESS;\n\n\t}", "public function testPingTreeTargetResetCount()\n {\n }", "public function testKycChecksPost()\n {\n }", "public function testCloudPosCheckUpdateCoursesInCheck()\n {\n }", "private function bump_start()\n {\n }", "public function testGameStatusPointsPlayer1Over100()\n {\n $game = new Game(101, 0);\n $res = $game->checkGameStatus();\n $exp = true;\n $this->assertEquals($exp, $res);\n }", "public function testParse0()\n{\n\n // Traversed conditions\n // if ($this->compressed_size >= $this->min_compressed_size) == false (line 204)\n\n $actual = $this->simplePie_gzdecode->parse();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function upDateSpots($spot,$currentTime,$beginTime,$endTime,$dbconnect){\r\n\t$currentTime=strtotime($currentTime);\r\n\t$beginTime = strtotime($beginTime);\r\n\t$endTime = strtotime($endTime);\r\n\t$p1 = ($beginTime-$currentTime)/1800;\r\n\t$p2 = ($endTime-$currentTime)/1800;\r\n\tif($p1>32){//if both larger than 32, check second future state only\r\n\t\t$p1 = $p1-32;\r\n\t\t$p2 = $p2-32;\r\n\t\t$checkBits = ((1<<$p2)-1)&(1<<($p1-1));\r\n\t\t\r\n\t\t$spot['futurestate2'] = $spot['futurestate2']|$checkBits;\r\n\t\t\r\n\t}\r\n\t\r\n\telse if($p2>32){//if only p2 larger than 32, needs to check second future state\r\n\t\t$checkBits1 = (0-1)<<($p1-1);\r\n\t\t$checkBits2 = (1<<($p2-31)-1);\r\n\t\t$spot['futurestate1'] = $spot['futurestate1']|$checkBits1;\r\n\t\t$spot['futurestate2'] = $spot['futurestate2']|$checkBits2;\r\n\t\t\r\n\t}\r\n\telse{//check futurestate1 only\r\n\t\t$checkBits = ((1<<$p2)-1)&(1<<($p1-1));\r\n\t\t$spot['futurestate1'] = $spot['futurestate1']|$checkBits;\t\r\n\t}\r\n\t\r\n\tmysqli_query($dbconnect,\"UPDATE spots \r\n\tSET futurestate1 = \".$spot['futurestate1'].\",\r\n\tfuturestate2 = \".$spot['futurestate2'].\"\r\n\tWHERE spot_id = '\".$spot['spot_id'].\"';\");\r\n}" ]
[ "0.73127395", "0.7039642", "0.6752492", "0.6731752", "0.637904", "0.6105455", "0.572958", "0.5724394", "0.55744874", "0.54487604", "0.53658557", "0.5359754", "0.5357389", "0.53351086", "0.5272714", "0.5251116", "0.51038945", "0.5101567", "0.5092717", "0.5044515", "0.50377595", "0.5008979", "0.4993758", "0.4992469", "0.4990453", "0.49773636", "0.49765202", "0.49675173", "0.49570364", "0.48829904" ]
0.91938424
0