query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Test view entity clone.
public function testViewEntityClone() { $edit = [ 'id' => 'test_view_cloned', 'label' => 'Test view cloned', ]; $this->drupalPostForm('entity_clone/view/who_s_new', $edit, t('Clone')); $views = \Drupal::entityTypeManager() ->getStorage('view') ->loadByProperties([ 'id' => $edit['id'], ]); $view = reset($views); $this->assertTrue($view, 'Test default view cloned found in database.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCloneTDBMObject()\n {\n $object = $this->tdbmService->getNewObject('departements');\n $object->id_region = 22;\n $object->numero = '100';\n $object->nom = 'test';\n $object->nom_web = 'test';\n // Save the object\n $object->save();\n\n // Try to clone the object\n $cloneObject = clone $object;\n // Save the cloned object\n $cloneObject->save();\n\n $this->assertNotEquals($object->id, $cloneObject->id);\n $this->assertEquals($object->nom, $cloneObject->nom);\n\n $this->tdbmService->deleteObject($object);\n $this->tdbmService->deleteObject($cloneObject);\n }", "public function testArticleClone()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $clonedArticle = clone $article;\n $this->assertFalse($article === $clonedArticle);\n $this->assertFalse($article->getDocument() === $clonedArticle->getDocument());\n $this->assertEquals($article->toArray(), $clonedArticle->toArray());\n }", "public function __clone()\n {\n // If the entity has an identity, proceed as normal.\n if ($this->id) {\n // unset identifiers\n $this->setId(0);\n \n // init validator\n $this->initValidator();\n \n // reset Workflow\n $this->resetWorkflow();\n \n $this->setCreatedDate(null);\n $this->setCreatedUserId(null);\n $this->setUpdatedDate(null);\n $this->setUpdatedUserId(null);\n \n \n }\n // otherwise do nothing, do NOT throw an exception!\n }", "protected function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone(){\n\t trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n\t }", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "private function __clone(){ }", "public function __clone()\n\t {\n\t trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n\t }", "protected function __clone()\n {\n\n }" ]
[ "0.69796026", "0.6586794", "0.6434951", "0.6284804", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.6231322", "0.62255716", "0.62255716", "0.62255716", "0.62255716", "0.6212186", "0.62117714", "0.62117714", "0.62117714", "0.62117714", "0.62117714", "0.62117714", "0.62117714", "0.62082326", "0.620296", "0.6195061" ]
0.8761566
0
Create fake instance of CustomerKey and save it in database
public function makeCustomerKey($customerKeyFields = []) { /** @var CustomerKeyRepository $customerKeyRepo */ $customerKeyRepo = App::make(CustomerKeyRepository::class); $theme = $this->fakeCustomerKeyData($customerKeyFields); return $customerKeyRepo->create($theme); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fakeCustomerKey($customerKeyFields = [])\n {\n return new CustomerKey($this->fakeCustomerKeyData($customerKeyFields));\n }", "public function getOrCreateCustomer();", "public function testGetKey()\n {\n $subject = $this->createInstance();\n $reflect = $this->reflect($subject);\n\n $key = uniqid('key-');\n\n $reflect->_setKey($key);\n\n $this->assertEquals($key, $subject->getKey(), 'Set and retrieved keys are not the same.');\n }", "public function fakeCustomerKeyData($customerKeyFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'customer_id' => $fake->randomDigitNotNull,\n 'key' => $fake->word,\n 'created_at' => $fake->word,\n 'updated_at' => $fake->word\n ], $customerKeyFields);\n }", "public function testKeyGenerator()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n $request->cookies->add([\n 'localisation' => '{\"client\":{\"11\":\"AOK Bayern\"},\"location\":null}'\n ]);\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('null_11', $id);\n }", "abstract protected function generateKey();", "public function testValidateActivationKey()\n {\n\n $activation_key = $this->Users->generateActivationKey();\n\n $email = '[email protected]';\n\n $_user = [\n 'email' => $email,\n 'password' => 'cakemanager',\n ];\n\n $entity = $this->Users->newEntity($_user);\n\n $entity->set('activation_key', $activation_key);\n\n $save = $this->Users->save($entity);\n\n // assert if saved\n $this->assertNotFalse($save);\n\n // test if key is null\n $this->assertFalse($this->Users->validateActivationKey($email, null));\n\n // test if key is wrong\n $this->assertFalse($this->Users->validateActivationKey($email, 'wrongActivationKey'));\n\n // test if email is wrong\n $this->assertFalse($this->Users->validateActivationKey('wrong_email', $activation_key));\n\n // test if its true\n $this->assertTrue($this->Users->validateActivationKey($email, $activation_key));\n\n $save->set('activation_key', null);\n $this->Users->save($save);\n\n // test if key is null\n $this->assertFalse($this->Users->validateActivationKey($email, null));\n }", "function it_gets_and_sets_the_key()\n {\n $this->getKey()->shouldReturn('apikey');\n\n // Set the api key\n $this->setKey('keyapi');\n\n // Get the current key\n $this->getKey()->shouldReturn('keyapi');\n }", "public function testInsertValidKid(): void\n {\n // count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"kid\");\n\n $kidId = generateUuidV4();\n\n\n $kid = new Kid($kidId, $this->adult->getAdultId(), $this->VALID_AVATAR_URL, $this->VALID_CLOUDINARY_TOKEN, $this->VALID_HASH, $this->VALID_NAME, $this->VALID_USERNAME);\n $kid->insert($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoKid = Kid::getKidByKidId($this->getPDO(), $kid->getKidId());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"kid\"));\n $this->assertEquals($pdoKid->getKidId(), $kidId);\n $this->assertEquals($pdoKid->getKidAdultId(), $this->adult->getAdultId());\n $this->assertEquals($pdoKid->getKidAvatarUrl(), $this->VALID_AVATAR_URL);\n $this->assertEquals($pdoKid->getKidCloudinaryToken(), $this->VALID_CLOUDINARY_TOKEN);\n $this->assertEquals($pdoKid->getKidHash(), $this->VALID_HASH);\n $this->assertEquals($pdoKid->getKidName(), $this->VALID_NAME);\n $this->assertEquals($pdoKid->getKidUsername(), $this->VALID_USERNAME);\n\n }", "public function\n createKey()\n {\n $customer_private_key = null;\n $privateKey = openssl_pkey_new(array(\n 'digest_alg' => 'sha512',\n 'private_key_bits' => 4096,\n 'private_key_type' => OPENSSL_KEYTYPE_RSA,\n ));\n\n// export private key\n $result = openssl_pkey_export($privateKey,\n $customer_private_key, $this->getPassphrase());\n// generate public key from the private key\n $customer_public_key_array = openssl_pkey_get_details($privateKey);\n $this->setPublicKey($customer_public_key_array['key']);\n $this->setPrivateKey($customer_private_key);\n openssl_free_key($privateKey);\n return $result;\n }", "public function testCustomerCreation()\n {\n $customer = factory(Customer::class)->create([\n 'name' => 'John Doe'\n ]);\n\n $this->assertDatabaseHas('customers', ['name' => 'John Doe']);\n }", "public static function saveCustomer($data) {\n $objCustomer = new Customer();\n $objCustomer->setFirstname($data['firstname']);\n $objCustomer->setLastname($data[\"lastname\"]);\n $objCustomer->setEmail($data[\"email\"]);\n $objCustomer->setTelephone($data[\"telephone\"]);\n $objCustomer->setFax($data[\"fax\"]);\n $objCustomer->setPassword($data[\"password\"]);\n $objCustomer->setStoreId(1);\n $objCustomer->setSalt(\"\");\n $objCustomer->setCart(\"\");\n $objCustomer->setWishlist(\"\");\n $objCustomer->setNewsletter(0);\n $objCustomer->setAddressId(0);\n $objCustomer->setCustomerGroupId(1);\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus(1);\n $objCustomer->setApproved(1);\n $objCustomer->setToken(\"\");\n $objCustomer->setDateAdded(date(\"Y-m-d H;i:s\"));\n\n $customerResult = $objCustomer->save(); // Save customer information\n\n $customerId = $objCustomer->getCustomerId();\n if($customerResult['success']){\n $objCustomerAddress = new CustomerAddress();\n $objCustomerAddress->setCustomerId($customerId);\n $objCustomerAddress->setFirstname($data[\"firstname\"]);\n $objCustomerAddress->setLastname($data[\"lastname\"]);\n $objCustomerAddress->setCompanyId($data[\"company\"]);\n $objCustomerAddress->setAddress1($data[\"address_1\"]);\n $objCustomerAddress->setAddress2($data[\"address_2\"]);\n $objCustomerAddress->setCity($data[\"city\"]);\n $objCustomerAddress->setPostcode($data[\"postcode\"]);\n $objCustomerAddress->setCountryId($data[\"country\"]);\n $objCustomerAddress->setZoneId($data[\"zone_id\"]);\n $objCustomerAddress->setTaxId(0);\n\n $result = $objCustomerAddress->save();// Save Customer Address information\n\n $addressId = $objCustomerAddress->getAddressId();\n\n $customerInfoObj = Customer::loadById($customerId);\n $objCustomer = new Customer();\n $objCustomer->setCustomerId($customerId);\n $objCustomer->setFirstname($customerInfoObj->getFirstname());\n $objCustomer->setLastname($customerInfoObj->getLastname());\n $objCustomer->setEmail($customerInfoObj->getEmail());\n $objCustomer->setTelephone($customerInfoObj->getTelephone());\n $objCustomer->setFax($customerInfoObj->getFax());\n $objCustomer->setPassword($customerInfoObj->getPassword());\n $objCustomer->setStoreId($customerInfoObj->getStoreId());\n $objCustomer->setSalt($customerInfoObj->getSalt());\n $objCustomer->setCart($customerInfoObj->getCart());\n $objCustomer->setWishlist($customerInfoObj->getWishlist());\n $objCustomer->setNewsletter($customerInfoObj->getNewsletter());\n $objCustomer->setAddressId($addressId);\n $objCustomer->setCustomerGroupId($customerInfoObj->getCustomerGroupId());\n $objCustomer->setIp($_SERVER['REMOTE_ADDR']);\n $objCustomer->setStatus($customerInfoObj->getStatus());\n $objCustomer->setApproved($customerInfoObj->getApproved());\n $objCustomer->setToken($customerInfoObj->getToken());\n $objCustomer->setDateAdded($customerInfoObj->getDateAdded());\n\n return $objCustomer->save(); // Save customer information\n }\n }", "public function Make($key);", "public function storeclient(CustomerRequest $request)\n {\n $customer = $request->all();\n\n // create customer account\n $customer = $this->customer->insert($customer);\n // return the resource just created\n return $this->customer->findBy(\"id\", $customer->id);\n }", "public function createCustomer(Customer $customer): Customer;", "private function saveCustomer($customer){\n \n $customermodel = new CustomerModel();\n $customermodel->save($customer);\n return $this->insertID();\n }", "public static function bootUuidKey()\n {\n static::creating(function ($model) {\n $model->incrementing = false;\n $model->{$model->getKeyName()} = (string) Uuid::uuid4();\n });\n }", "function generateKey($id, $type);", "public function generateAuthKey() {\n $this->employer_auth_key = Yii::$app->security->generateRandomString();\n }", "public function testGenerateActivationKey()\n {\n\n $data = $this->Users->generateActivationKey();\n $_data = $this->Users->generateActivationKey();\n\n $this->assertEquals(40, strlen($data));\n $this->assertEquals(40, strlen($_data));\n $this->assertNotEmpty($data);\n $this->assertNotEmpty($_data);\n $this->assertNotEquals($data, $_data);\n }", "public static function fakeCustomerId() {\n\t\t\t\n\t\t\t$lastCustomerId = Customer::select('customer_id')->orderBy('customer_id', 'desc')->take(1)->get()->first();\n\t\t\tif ($lastCustomerId == null) {\n\t\t\t\t$lastCustomerId = 0;\n\t\t\t}\n\t\t\treturn ++$lastCustomerId;\n\t\t}", "private function storeCustomer(CustomerRequest $request)\n {\n // set the address values and create\n $address_array = array_add(array_add($request->address, 'city_id', $request->city_id), 'location', $request->location);\n $address = Address::create($address_array);\n\n // set the customer values\n $customer_array = array_add(array_add($request->except('address', 'city_id', 'country_id', 'location'), 'address_id', $address->address_id), 'active', $request->has('active'));\n $customer =Customer::create($customer_array);\n }", "private function set_keys() {\n\t\t$this->skeleton->load('customers_id', !empty($_SESSION['customer_id'])?$_SESSION['customer_id']:NULL);\n\t\t$this->skeleton->load('customers_extra_logins_id', !empty($_SESSION['customer_extra_login_id'])?$_SESSION['customer_extra_login_id']:NULL);\n\n\t\t// this will set the ID as the session value, if one is found, otherwise if there is an existing cart for this user, pull it out\n\t\tif (empty($this->id()) && $header = self::fetch('cart_header_by_key', [':cart_key' => $this->get_cart_key()])) {\n\t\t\t$this->id($header['cart_id']);\n\t\t}\n\n\t\t//var_dump([$this->skeleton->get('customers_id'), $_SESSION['customer_id']]);\n\t}", "public function getBusinessKey();", "abstract public function createSecretKey();", "protected function _createKey() {\n return new PapayaDatabaseRecordKeyFields(\n $this,\n $this->_tableName,\n array('source_id', 'target_id')\n );\n }", "private function _generate_enckey()\n {\n // encrypt user id and email so that nobody gets the user information\n $this->_user->enc_key = $this->encryption->encrypt($this->_user->id . '-' . $this->_user->email_address);\n\n // use codeigniters string helper to generate random key\n $string = random_string('alnum', 16);\n\n // encrypt it again just for nothing and then return the key.\n return $this->encryption->encrypt($string);\n }", "public function testValidCustomerIdTest()\n {\n $customerId = '10';\n $expected_customer_first_Name = 'Juanita';\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue($expected_customer_first_Name == $customer->first_name);\n }", "protected function setKey()\n {\n $paymentGateway = \\App\\Models\\PaymentGateway::where('name', 'paystack')->first();\n $this->secretKey = $paymentGateway['information']['private_key'];\n $this->publicKey = $paymentGateway['information']['public_key'];\n }", "function generateReferenceKey($key='')\n{\n return $key . \\Ramsey\\Uuid\\Uuid::uuid4()->toString();\n}" ]
[ "0.71249366", "0.6139686", "0.61021245", "0.60461277", "0.59981084", "0.59558487", "0.5921256", "0.5719616", "0.5699868", "0.5605308", "0.55782944", "0.5577578", "0.55775595", "0.5494093", "0.54781383", "0.54573417", "0.5433716", "0.5403689", "0.5393929", "0.53817797", "0.53775984", "0.5360976", "0.535581", "0.5332097", "0.5322522", "0.5321607", "0.53164065", "0.5313089", "0.53065354", "0.52937686" ]
0.6478008
1
Get fake instance of CustomerKey
public function fakeCustomerKey($customerKeyFields = []) { return new CustomerKey($this->fakeCustomerKeyData($customerKeyFields)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeCustomerKey($customerKeyFields = [])\n {\n /** @var CustomerKeyRepository $customerKeyRepo */\n $customerKeyRepo = App::make(CustomerKeyRepository::class);\n $theme = $this->fakeCustomerKeyData($customerKeyFields);\n return $customerKeyRepo->create($theme);\n }", "public function testGetKey()\n {\n $subject = $this->createInstance();\n $reflect = $this->reflect($subject);\n\n $key = uniqid('key-');\n\n $reflect->_setKey($key);\n\n $this->assertEquals($key, $subject->getKey(), 'Set and retrieved keys are not the same.');\n }", "public function getBusinessKey();", "public function getOrCreateCustomer();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "protected function keyGenerator() {\n\t\treturn $this->serviceLocator->get('Application\\Common\\KeyGeneratator');\n\t}", "public function testKeyGenerator()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n $request->cookies->add([\n 'localisation' => '{\"client\":{\"11\":\"AOK Bayern\"},\"location\":null}'\n ]);\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('null_11', $id);\n }", "abstract protected function generateKey();", "public function getDeveloperKey();", "public function fakeCustomerKeyData($customerKeyFields = [])\n {\n $fake = Faker::create();\n\n return array_merge([\n 'customer_id' => $fake->randomDigitNotNull,\n 'key' => $fake->word,\n 'created_at' => $fake->word,\n 'updated_at' => $fake->word\n ], $customerKeyFields);\n }", "public function customer()\n {\n return $this->morphTo(__FUNCTION__, 'customer_type', 'customer_uuid')->withoutGlobalScopes();\n }", "public function getServiceKey() {}", "public function generateKey(): GenerateKeyRequestBuilder {\n return new GenerateKeyRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function fakeCustomerId() {\n\t\t\t\n\t\t\t$lastCustomerId = Customer::select('customer_id')->orderBy('customer_id', 'desc')->take(1)->get()->first();\n\t\t\tif ($lastCustomerId == null) {\n\t\t\t\t$lastCustomerId = 0;\n\t\t\t}\n\t\t\treturn ++$lastCustomerId;\n\t\t}", "public function getKey(): KeyInterface;", "public function getCustomer();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function getExtCustomerId();", "public function getKey() {}", "public function getKey() {}" ]
[ "0.62511957", "0.6206668", "0.6199511", "0.6150803", "0.6093767", "0.6093767", "0.6093767", "0.60555726", "0.6053619", "0.59828645", "0.5933406", "0.58896226", "0.5838514", "0.58058745", "0.57485574", "0.5732951", "0.57168174", "0.57010937", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.5666175", "0.56619686", "0.56514305", "0.56514305" ]
0.76041317
0
Get fake data of CustomerKey
public function fakeCustomerKeyData($customerKeyFields = []) { $fake = Faker::create(); return array_merge([ 'customer_id' => $fake->randomDigitNotNull, 'key' => $fake->word, 'created_at' => $fake->word, 'updated_at' => $fake->word ], $customerKeyFields); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fakeCustomerKey($customerKeyFields = [])\n {\n return new CustomerKey($this->fakeCustomerKeyData($customerKeyFields));\n }", "function getMetafieldCustomer($customerId, $key) {\n\n try {\n $client = HttpClient::create();\n $response = $client->request('GET', shopifyApiurl . 'customers/'.$customerId.'/metafields.json?key='.$key);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n\n return $response->getContent();\n }", "public function getBusinessKey();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomer();", "public function getCustomer($customer_id);", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public function customerDummyData($faker)\n {\n $gender = $faker->randomElement(['male', 'female']);\n\n $customerGroup = $this->customerGroupRepository->get()->random();\n\n return [\n 'first_name' => $faker->firstName($gender),\n 'last_name' => $faker->lastName,\n 'gender' => $gender,\n 'date_of_birth' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'email' => $faker->unique()->safeEmail(),\n 'phone' => $faker->e164PhoneNumber,\n 'password' => bcrypt('admin123'),\n 'customer_group_id' => $customerGroup->id,\n 'is_verified' => 1,\n 'remember_token' =>str_random(10)\n ];\n }", "public function getDeveloperKey();", "public function getCustomer()\n {\n return $this->data->customer;\n }", "public function getCustomerCode(): string\n {\n return $this->getData(self::CUSTOMER_CODE);\n }", "public function setMollieCustomerIdTestData()\n {\n return [\n 'New Mollie customer, live' => [\n 'foo', 'cst_123', 'pfl_123', false,\n [], // existing customfields\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_123' => [\n 'live' => 'cst_123',\n 'test' => '',\n ]\n ]\n ]\n ]\n ],\n 'New Mollie customer, test' => [\n 'bar', 'cst_321', 'pfl_321', true,\n [], // existing customfields\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_321' => [\n 'live' => '',\n 'test' => 'cst_321'\n ]\n ]\n ]\n ]\n ],\n 'Existing Mollie customer, live' => [\n 'baz', 'cst_456', 'pfl_456', false,\n [ // existing customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_456' => [\n 'live' => 'cst_456',\n 'test' => '',\n ]\n ]\n ]\n ],\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_456' => [\n 'live' => 'cst_456',\n 'test' => '',\n ]\n ]\n ]\n ]\n ],\n 'Existing Mollie customer, test' => [\n 'bax', 'cst_654', 'pfl_654', true,\n [ // existing customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_654' => [\n 'live' => '',\n 'test' => 'cst_654'\n ]\n ]\n ]\n ],\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_654' => [\n 'live' => '',\n 'test' => 'cst_654'\n ]\n ]\n ]\n ]\n ],\n 'Existing legacy Mollie customer, matches with live profile' => [\n 'fizz', 'cst_789', 'pfl_789', false,\n [ // existing customfields\n 'customer_id' => 'cst_789',\n ],\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_789' => [\n 'live' => 'cst_789',\n 'test' => '',\n ]\n ]\n ],\n 'customer_id' => null,\n ]\n ],\n 'Existing legacy Mollie customer, does not match with live profile' => [\n 'buzz', 'cst_789', 'pfl_789', false,\n [ // existing customfields\n 'customer_id' => 'cst_987',\n ],\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_789' => [\n 'live' => 'cst_789',\n 'test' => '',\n ]\n ]\n ],\n 'customer_id' => 'cst_987',\n ]\n ],\n 'Broken mollie_payments custom Fields by external plugins' => [\n 'bar', 'cst_321', 'pfl_321', true,\n ['mollie_payments' => 'foo'], // existing customfields\n [ // expected customfields\n 'mollie_payments' => [\n 'customer_ids' => [\n 'pfl_321' => [\n 'live' => '',\n 'test' => 'cst_321'\n ]\n ]\n ]\n ]\n ]\n ];\n }", "public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }", "public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }", "private function getRandomCustomer(): int {\n $rand_key = array_rand($this->customers, 1);\n return $this->customers[$rand_key];\n }", "public function getExtCustomerId();", "public function getCustomerId() {\n return $this->customerID;\n }", "public function getDataByCustomer()\n {\n $company = $this->companyFactory->create();\n $this->resource->load($company, $this->customerSession->getId(), 'customer_id');\n if (!$company->getId()) {\n return null;\n }\n return $company->getData();\n }", "public static function fakeCustomerId() {\n\t\t\t\n\t\t\t$lastCustomerId = Customer::select('customer_id')->orderBy('customer_id', 'desc')->take(1)->get()->first();\n\t\t\tif ($lastCustomerId == null) {\n\t\t\t\t$lastCustomerId = 0;\n\t\t\t}\n\t\t\treturn ++$lastCustomerId;\n\t\t}", "public function testCustomerPaymentMethodGetCustomerPaymentMethodsBycustomerId()\n {\n }", "public function getCustomerName();", "public function getHostData($customerId) {\n return $this->_customerProfile->load ( $customerId, 'customer_id' );\n }", "public function getCustomerData($apiKey){\n $customerData = Customer::where('api_key', $apiKey)->get();\n\n return $customerData;\n }", "public function getOrCreateCustomer();", "public function getCustomerDob();", "public function testKeyGenerator()\n {\n $localisationCookieIdGenerator = new LocalisationCookieIdGenerator();\n\n $request = new Request();\n $request->cookies->add([\n 'localisation' => '{\"client\":{\"11\":\"AOK Bayern\"},\"location\":null}'\n ]);\n\n $id = $localisationCookieIdGenerator->generate($request);\n $this->assertEquals('null_11', $id);\n }", "public function unknownCustomer() {\r\n\t\t$data = array();\r\n\t\t\t$data['name'] = 'Unknown';\r\n\t\t\t$data['link'] = '';\r\n\t\t\t$data['first_name'] = 'Unknown';\r\n\t\t\t$data['customer_type'] = 0;\r\n\t\t\t$data['last_name'] = 'Unknown';\r\n\t\t\t$data['spouse_first'] = 'Unknown';\r\n\t\t\t$data['spouse_last'] = 'Unknown';\r\n\t\t\t$data['phone'] = 'Unknown';\r\n\t\t\t$data['home_phone'] = 'Unknown';\r\n\t\t\t$data['work_phone'] = 'Unknown';\r\n\t\t\t$data['address'] = 'Unknown';\r\n\t\t\t$data['address2'] = 'Unknown';\r\n\t\t\t$data['city'] = 'Unknown';\r\n\t\t\t$data['state'] = 'Unknown';\r\n\t\t\t$data['zip'] = 'Unknown';\r\n\t\t\t$data['country'] = 'Unknown';\r\n\t\t\t$data['has_ship'] = 0;\r\n\t\t\t$data['ship_address'] = 'Unknown';\r\n\t\t\t$data['ship_address2'] = 'Unknown';\r\n\t\t\t$data['ship_city'] = 'Unknown';\r\n\t\t\t$data['ship_state'] = 'Unknown';\r\n\t\t\t$data['ship_zip'] = 'Unknown';\r\n\t\t\t$data['ship_country'] = 'Unknown';\r\n\t\t\t$data['email'] = 'Unknown';\r\n\t\t\t$data['notes'] = 'Unknown';\r\n\t\t\t$data['ship_contact'] = 'Unknown';\r\n\t\t\t$data['ship_phone'] = 'Unknown';\r\n\t\t\t$data['ship_other_phone'] = 'Unknown';\r\n\t\t\t$data['mailing_list'] = 0;\r\n\t\t\t$data['password'] = 'Unknown';\r\n\r\n\t\treturn $data; //array\r\n\t}", "public function getCustomerId()\n {\n return $this->customer_id;\n }" ]
[ "0.6582925", "0.65438646", "0.63593304", "0.62443227", "0.62443227", "0.62443227", "0.6204201", "0.60999787", "0.6055148", "0.60466945", "0.59881634", "0.59305775", "0.5920348", "0.5894932", "0.5852823", "0.583233", "0.5810067", "0.58096117", "0.58016527", "0.5794624", "0.5784538", "0.5760191", "0.5757169", "0.5755092", "0.57515746", "0.5748169", "0.5722089", "0.57150614", "0.56999767", "0.56815517" ]
0.6966223
0
Creates a new VideoCodec instance from an array of qualifiers.
public static function fromParams($qualifiers) { if (is_array($qualifiers)) { $codec = ArrayUtils::get($qualifiers, 'codec'); $profile = ArrayUtils::get($qualifiers, 'profile'); $level = ArrayUtils::get($qualifiers, 'level'); } else { $codec = $qualifiers; $profile = $level = null; } return (new static($codec))->profile($profile)->level($level); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setAvailableVideoCodecs(array $codecs, $force = false)\n\t{\n\t\tif ( ! $force && $this->getAvailableVideoCodecs())\n\t\t{\n\t\t\t$codecs = array_intersect($this->getAvailableVideoCodecs(), $codecs);\n\t\t}\n\t\t\n\t\t$this->videoAvailableCodecs = array_map('strval', $codecs);\n\t\t\n\t\treturn $this;\n\t}", "protected function __construct(array $ids) {\n $this->video_id_list = [];\n foreach ($ids as $id) {\n $cid = \\Filters\\FilterManager::F()->apply_chain($id, ['Strip', 'Trim', 'NEString', 'DefaultNull']);\n $cid ? $this->video_id_list[] = $cid : 0;\n }\n sort($this->video_id_list);\n $this->reader_hash = sprintf(\"%s:%s\", count($this->video_id_list), md5(implode(\";\", $this->video_id_list)));\n }", "public static function fromParams($qualifiers)\n {\n return (new static())->addActionFromQualifiers($qualifiers);\n }", "public function setVideoCodec($val)\n {\n $this->_propDict[\"videoCodec\"] = $val;\n return $this;\n }", "public function setQualifiers($qualifiers)\n {\n $this->qualifiers = $qualifiers;\n }", "public static function fromArray(array $values): AudioProfile\n {\n $profile = new static();\n\n foreach ($values as $key => $value) {\n switch ($key) {\n case static::CODEC:\n $profile->setCodec($value);\n break;\n\n case static::PROFILE:\n $profile->setProfile($value);\n break;\n\n case static::BITRATE:\n $profile->setBitrate($value);\n break;\n\n case static::SAMPLE_RATE:\n $profile->setSampleRate($value);\n break;\n\n case static::CHANNELS:\n $profile->setChannels($value);\n break;\n\n case static::DURATION:\n $profile->setDuration($value);\n break;\n }\n }\n\n return $profile;\n }", "public function __construct(array $encodings = null)\n {\n if ($encodings !== null) {\n $this->encodings = $encodings;\n }\n }", "public function setVideoCodec(Codec $codec)\n\t{\n\t\tif ($this->getAvailableVideoCodecs() && ! in_array($codec, $this->getAvailableVideoCodecs(), false))\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException(sprintf('Wrong video codec value for \"%s\", available values are %s',\n\t\t\t\t$codec, implode(', ', $this->getAvailableVideoCodecs())));\n\t\t}\n\t\t\n\t\t$this->videoCodec = $codec;\n\t\t\n\t\treturn $this;\n\t}", "public static function fromValidArray(array $attributes)\n {\n $filtered = array_filter($attributes, function ($v) {\n return !Validator::make($v, self::RULES)->fails();\n });\n\n return Video::hydrate($filtered);\n }", "public static function createFromAttrs(array $attrs): self\n {\n $paramBag = new static();\n $paramBag->set($attrs);\n\n return $paramBag;\n }", "public function setCodec(Codec $codec);", "public function getVideoCodec() {}", "public static function from($values)\n {\n return new static($values);\n }", "public static function createFrom(array $elements)\n {\n return new static($elements);\n }", "public function getVideoEncoders($default = \"copy\")\n {\n //Function have same code for video, audio and subtitle codecs\n //FFMPeg encoder looks like this:\n //H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )\n //We need to extract only name of encoder and their corresponding encoders (sub encoders)\n //set default to copy (no encoding needed)\n $vencArray = array($default => $default);\n $vencArray['copy'] = 'copy';\n $venc = $this->getSupportedCodecs();\n\n foreach ($venc as $line) :\n $line = trim($line);\n //EV stands for Encoding Video. Change EA for Encoding Audio\n if (strpos($line, 'EV')) { //if line have Encoding Video\n $splitted = explode(\" \", $line); //remove empty space from array\n $i = 0; //$i = index of $splitted line for removing from array $splitted\n foreach ($splitted as $emptyItem) : //array 0=codec params (encoder, decoder..) , 1=name, ... = description and sub-encoders\n if (empty($emptyItem)) {\n unset($splitted[$i]);\n }\n $i++;\n endforeach;\n\n //reindex array\n $splitted_reindexed = array_values($splitted);\n\n //add encoder to vencArray\n // $apush[$splitted_reindexed[1]] = $splitted_reindexed[1];\n $vencArray[$splitted_reindexed[1]] = $splitted_reindexed[1];\n // array_push($vencArray, $apush);\n\n //get sub encoders ex: h264 (h264_nvenc, h264_cuvid.. )\n $sr = 0; // index of $splitted_reindexed\n foreach ($splitted_reindexed as $encItem) {\n if ($encItem === \"(encoders:\") {\n //remove unnecessary words from array\n $spliced = array_splice($splitted_reindexed, $sr);\n $i = 1; //$i = index of splitted encoder description. Skip index 0 because it is not encoder name ;\n while ($spliced[$i] != ')') {\n //add to encoder array\n $vencArray[$spliced[$i]] = $spliced[$i];\n $i++;\n }\n }\n $sr++;\n }\n }\n endforeach;\n\n //remove double and return\n return array_unique($vencArray);\n }", "public static function create(array $values = []);", "public function __construct(array $values)\n {\n if (empty($values)) {\n throw new InvalidArgumentException('Values should be given.');\n }\n\n foreach ($values as $value) {\n $this->assertValueIsValid($value);\n }\n\n $this->supportedValues = $values;\n }", "public static function fromArray(array $claims): self\n {\n return new self($claims);\n }", "public static function cc_mime_types($mimes) {\n $mimes['mp4'] = 'video/mp4';\n $mimes['avi'] = 'video/avi';\n $mimes['svg'] = 'image/svg+xml';\n $mimes['webp'] = 'image/webp';\n return $mimes;\n }", "private function getSupportedCodecs()\n {\n $venc = shell_exec('ffmpeg -codecs');\n return preg_split(\"#[\\r\\n]+#\", $venc);\n }", "public function getCodec();", "public function getCodec();", "public static function fromArray($arr)\n {\n $type = isset($arr['type']) ? $arr['type'] : null;\n $pref = isset($arr['preferred']) ? $arr['preferred'] : null;\n $uri = isset($arr['imUri']) ? $arr['imUri'] : null;\n\n return new Im($type, $pref, $uri);\n }", "public function filterByCodec($codec = null, $comparison = null)\n {\n if (is_array($codec)) {\n $useMinMax = false;\n if (isset($codec['min'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($codec['max'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec, $comparison);\n }", "public function __construct(array $releaseGroups = [])\n {\n parent::__construct(\n array_map(\n function ($releaseGroup) {\n return new ReleaseGroup($releaseGroup);\n },\n $releaseGroups\n )\n );\n }", "function video ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('tvideo');\n return $rc->newInstanceArgs ( $arguments );\n}", "public function __construct (array $filters) {\n\t\t$this->_filters = $filters;\n\t}", "public static function anArray(/* args... */)\n {\n $args = func_get_args();\n\n return new self(Util::createMatcherArray($args));\n }", "public static function create(array $elements = [])\n {\n return new static($elements);\n }", "public static function fromArray(array $data);" ]
[ "0.5693514", "0.5022168", "0.49583024", "0.49524313", "0.48688334", "0.47123238", "0.46611506", "0.46252465", "0.4500487", "0.4471624", "0.44566977", "0.44419694", "0.43627235", "0.43527424", "0.43500996", "0.43298367", "0.4301836", "0.42954147", "0.42520854", "0.4169692", "0.41188428", "0.41188428", "0.41132993", "0.4108244", "0.41077694", "0.40931734", "0.40880993", "0.4081777", "0.40811533", "0.406725" ]
0.6111663
0
Loads Google Map API
function ale_map_load_scripts() { wp_register_script( 'google-maps-api', 'http://maps.google.com/maps/api/js?sensor=false' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function et_extra_enqueue_google_maps_api() {\n\n\t$google_api_option = get_option( 'et_google_api_settings' );\n\n\t// If for some reason the setting doesn't exist, then we probably shouldn't load the API\n\tif ( ! isset( $google_api_option['enqueue_google_maps_script'] ) ) {\n\t\treturn false;\n\t}\n\n\t// If the setting has been disabled, then we shouldn't load the API\n\tif ( 'false' === $google_api_option['enqueue_google_maps_script'] ) {\n\t\treturn false;\n\t}\n\n\t// If we've gotten this far, let's build the URL and load that API!\n\n\t// Google Maps API address\n\t$gmap_url_base = 'https://maps.googleapis.com/maps/api/js';\n\n\t// If we're not using SSL, switch to the HTTP address for the Google Maps API\n\t// TODO: Is this actually necessary? Security notices don't trigger in this direction\n\tif ( ! is_ssl() ) {\n\t\t$gmap_url_base = 'http://maps.googleapis.com/maps/api/js';\n\t}\n\n\t// Grab the value of `et_google_api_settings['api_key']` and append it to the API's address\n\t$gmap_url_full = esc_url( add_query_arg( array(\n\t\t'key' => et_pb_get_google_api_key(),\n\t\t'callback' => 'initMap'\n\t), $gmap_url_base ) );\n\n\twp_enqueue_script( 'google-maps-api', $gmap_url_full, array(), '3', true );\n\n}", "public static function register_maps_api() {\n\n\t\t\tacf_update_setting( 'google_api_key', Project045_Definitions::$maps_api_key );\n\t\t\t\n\t\t}", "function kulam_acf_init_google_maps_api() {\n\n\t$google_maps_api = get_field( 'acf-option_google_maps_api', 'option' );\n\n\tif ( $google_maps_api ) {\n\t\tacf_update_setting( 'google_api_key', $google_maps_api );\n\t}\n\n}", "function google_map_load_scripts(){\n\twp_register_script( 'google-maps-api', 'http://maps.google.com/maps/api/js?sensor=false' );\n}", "function church_admin_google_map_api()\n {\n \t\n \t//fix issue caused by some \"premium\" themes, which call google maps w/o key on every admin page. D'uh!\n \twp_dequeue_script('avia-google-maps-api');\n \t\n //now enqueue google map api with the key\n $src = 'https://maps.googleapis.com/maps/api/js';\n $key='?key='.get_option('church_admin_google_api_key');\n wp_enqueue_script( 'Google Map Script',$src.$key, array() ,FALSE, TRUE);\n \n \n }", "function load_google_maps() {\n\t?>\n\n <script sync\n src=\"https://maps.googleapis.com/maps/api/js?key=<?php $options = get_option( 'dhl_parcel_options' );echo esc_html($options['gmac_google_map_api_key']) ?>\">\n </script>\n\n <?php\n}", "function mpfy_enqueue_gmaps() {\n\twp_dequeue_script('google_map_api');\n\twp_dequeue_script('google-maps');\n\twp_dequeue_script('cspm_google_maps_api');\n\twp_dequeue_script('gmaps');\n\twp_deregister_script('gmaps');\n\n\t// load our own version of gmaps as we require the geometry library\n\t$api_key = carbon_get_theme_option('mpfy_google_api_key');\n\t$api_key_param = $api_key ? '&key=' . $api_key : '';\n\twp_enqueue_script('gmaps', '//maps.googleapis.com/maps/api/js?libraries=geometry' . $api_key_param, array(), false, true);\n}", "function my_acf_google_map_api( $api ){\n\t\n\t$api['key'] = 'AIzaSyDBg7JakMFZ9desjEHnoPJHpm2GEtmYN-E';\n\t\n\treturn $api;\n\t\n}", "public function map()\n\t{\n\t\t$map = 'http://maps.googleapis.com/maps/api/staticmap?zoom=12&format=png&maptype=roadmap&style=element:geometry|color:0xf5f5f5&style=element:labels.icon|visibility:off&style=element:labels.text.fill|color:0x616161&style=element:labels.text.stroke|color:0xf5f5f5&style=feature:administrative.land_parcel|element:labels.text.fill|color:0xbdbdbd&style=feature:poi|element:geometry|color:0xeeeeee&style=feature:poi|element:labels.text.fill|color:0x757575&style=feature:poi.business|visibility:off&style=feature:poi.park|element:geometry|color:0xe5e5e5&style=feature:poi.park|element:labels.text|visibility:off&style=feature:poi.park|element:labels.text.fill|color:0x9e9e9e&style=feature:road|element:geometry|color:0xffffff&style=feature:road.arterial|element:labels|visibility:off&style=feature:road.arterial|element:labels.text.fill|color:0x757575&style=feature:road.highway|element:geometry|color:0xdadada&style=feature:road.highway|element:labels|visibility:off&style=feature:road.highway|element:labels.text.fill|color:0x616161&style=feature:road.local|visibility:off&style=feature:road.local|element:labels.text.fill|color:0x9e9e9e&style=feature:transit.line|element:geometry|color:0xe5e5e5&style=feature:transit.station|element:geometry|color:0xeeeeee&style=feature:water|element:geometry|color:0xc9c9c9&style=feature:water|element:labels.text.fill|color:0x9e9e9e&size=640x250&scale=4&center='.urlencode(trim(preg_replace('/\\s\\s+/', ' ', $this->cfg->address)));\n\t\t$con = curl_init($map);\n\t\tcurl_setopt($con, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($con, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($con, CURLOPT_RETURNTRANSFER, 1);\n\t\treturn response(curl_exec($con))->header('Content-Type', 'image/png');\n\t}", "function my_acf_google_map_api( $api ){\n\t\n $api['key'] = 'AIzaSyDJZT6rmdKIiev1YgfKkEeKKJ4UJDJzwhE';\n \n return $api;\n \n}", "function aurum_get_google_api() {\n\treturn apply_filters( 'aurum_google_api_key', get_data( 'google_maps_api' ) );\n}", "public static function init()\n {\n if (!Pronamic_Google_Maps_Settings::has_settings()) {\n Pronamic_Google_Maps_Settings::set_default_options();\n }\n\n // Plugins URL\n $url = THEMEROOT . '/plugins/pronamic-google-maps/';\n self::$pluginsUrl = trailingslashit(apply_filters('google_maps_plugins_url', $url));\n\n self::$pluginsPath = trailingslashit(apply_filters('google_maps_plugins_path', GOOGLE_MAPS_PATH));\n\n // Load plugin text domain\n $rel_path = dirname(plugin_basename(self::$file)) . '/languages/';\n\n load_plugin_textdomain('pronamic_google_maps', false, $rel_path);\n\n // Scripts\n self::registerScripts();\n\n // Other\n if (is_admin()) {\n Pronamic_Google_Maps_Admin::bootstrap();\n } else {\n Pronamic_Google_Maps_Site::bootstrap();\n }\n }", "function set_map(){\r\n //setta chiave api nella composizione dell'url\r\n echo \"\r\n <script src=\\\"http://maps.google.com/maps?file=api&v=2&key=\". $this->apikey .\"&sensor=false\\\" type=\\\"text/javascript\\\">\r\n </script>\r\n \";\r\n \r\n //assegna il contenuto alla variabile JScenterMap la quale permette di geolocalizzare un punto sulla mappa tramite indirizzo\r\n \r\n if($this->indirizzo!=\"\"){\r\n \t$JScenterMap = \"\r\n \tvar geocoder = new GClientGeocoder();\r\n \tgeocoder.getLatLng('\".$this->indirizzo.\"',function(point) {\r\n if (!point) {\r\n alert('\".$this->indirizzo.\"' + \\\" not found\\\");\r\n } else {\r\n map.setCenter(point, 13);\r\n var marker = createMarker(point, 'Ciao');\r\n map.addOverlay(marker); \r\n }\r\n });\r\n \t\";\r\n\t } else {\r\n \t\t$JScenterMap = \"map.setCenter(new GLatLng(\".$this->latitudine.\", \".$this->longitudine.\"), 11);\";\r\n /*\r\n $creamarker = \"var marker1 = createMarker(new GLatLng(\".$this->latitudini[$i].\", \".$this->longitudine[$i].\"), '\" .$this->nomi[$i] .\"');\r\n map.addOverlay(marker1);\";*/\r\n \r\n }\r\n \r\n\t \r\n //inizializza il punto sulla mappa in base al contenuto della variabile JScenterMap\r\n //window.onload permette di richiamare il metodo initialize e Gunload (per svuotare la memoria) direttamente da qui senza specificarlo nel body\r\n echo \"\r\n <script type=\\\"text/javascript\\\">\r\n \r\n \t function createMarker(point,html) {\r\n\t\t\t\tvar marker = new GMarker(point);\r\n\t\t\t\tGEvent.addListener(marker, \\\"mouseover\\\", function() { marker.openInfoWindowHtml(html); });\r\n\t\t\t\treturn marker;\r\n\t\t\t }\r\n \r\n \t window.onload = initialize; \r\n window.onunload = GUnload;\r\n function initialize() {\r\n if (GBrowserIsCompatible()) {\r\n var map = new GMap2(document.getElementById(\\\"map_canvas\\\")); \";\r\n echo $JScenterMap; \r\n //CREAZIONE MARKER DINAMICAMENTE\r\n //alert(\\\"ciao\\\" + $i);\r\n for ($i=0;$i<10;$i++){\r\n echo \"\r\n var marker1 = createMarker(new GLatLng(\".$this->latitudini[$i].\", \".$this->longitudini[$i].\"), '\" .$this->nomi[$i] .\"');\r\n \t\t\tmap.addOverlay(marker1); \";\r\n \t\t } \r\n echo \"map.setUIToDefault();\r\n }\r\n }\r\n </script>\r\n \";\r\n\t}", "public function getGoogleMap() \n {\n return $this->content;\n }", "public function getGoogleMapJS()\n\t{\n\t\tif(!isset($oGoogleMapService))\n\t\t\t$oGoogleMapService = Phpfox::getService('gmap.googlemap');\n\t\n\t\treturn $oGoogleMapService->getGoogleMap();\n\t}", "public function __construct()\r\n {\r\n $this->googleKey = get_option('wpGoogleMaps_api_key');\r\n $this->mapApiUrl = \"http://maps.google.com/maps?file=api&amp;v=2&amp;key={$this->googleKey}\";\r\n\r\n $jsDir = get_option('siteurl') . '/wp-content/plugins/google-maps-for-wordpress/js/';\r\n\r\n wp_register_script('googleMaps', $this->mapApiUrl, false, 2);\r\n wp_register_script('wpGoogleMaps', \"{$jsDir}wp-google-maps.js\", array('prototype', 'googleMaps'), '0.0.1');\r\n wp_register_script('wpGoogleMapsAdmin', \"{$jsDir}wp-google-maps-admin.js\", array('jquery'), '0.0.2');\r\n }", "public function enqueue()\n {\n wp_enqueue_script('google-maps', '//maps.googleapis.com/maps/api/js?key=' . $this->apiKey, array(), '3', true);\n wp_enqueue_script('google-map-init');\n }", "function InitializeGoogleMap($addresses, $width=500, $height=300, $markerIconColor = 'NAUTICA', $mapZoom = 12) {\n $googleMap = \"\";\n\n if (is_array($addresses) && count($addresses) > 0) {\n include_once(SITE_PATH . '/include/google_map.php');\n\n $gm = & new EasyGoogleMap(GOOGLE_KEY);\n\n $gm->SetMapWidth($width);\n $gm->SetMapHeight($height);\n $gm->SetMarkerIconStyle('GT_FLAT');\n $gm->SetMapZoom($mapZoom);\n $gm->mContinuousZoom = TRUE;\n $gm->mMapType = TRUE;\n for ($a = 0; $a < count($addresses); $a++) {\n $gm->SetAddress($addresses[$a]['location']);\n $gm->SetInfoWindowText($addresses[$a]['html']);\n $gm->SetCountry($addresses[$a]['country'], $addresses[$a]['location']);\n }\n $googleMap.=$gm->GmapsKey();\n $googleMap.=$gm->MapHolder();\n $googleMap.=$gm->InitJs();\n $googleMap.=$gm->UnloadMap();\n }\n return $googleMap;\n }", "function zthemename_register_google_map_widget() {\n\tregister_widget( 'Zthemename_Google_Map_Widget' );\n}", "function my_acf_google_map_api( $api ){\n\t$api['key'] = '';\n\treturn $api;\n}", "function googleMapsToolsAutoload($class) {\n $data = explode('\\\\', $class);\n if ($data[0] == 'GoogleMapsTools') {\n $file = implode('/', $data) . '.php';\n if (file_exists($file)) {\n require_once($file);\n }\n }\n}", "function add_cf7_tag_generator_googleMap() {\n\t if ( class_exists( 'WPCF7_TagGenerator' ) ) {\n\t $tag_generator = WPCF7_TagGenerator::get_instance();\n\t $tag_generator->add( 'map', __( 'Google map', 'cf7-google-map' ), array($this,'googleMap_tag_generator') );\n\t }\n\t}", "public function __construct() {\n\t\t\tparent::__construct(\n\t\t\t\t'zthemename_google_map',\n\t\t\t\tesc_html__( 'Google Map', 'zthemename' ),\n\t\t\t\tarray(\n\t\t\t\t\t'description' => esc_html__( 'Adds a google static map to your website.', 'zthemename' ),\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function GoogleGeoCoder() \r\n {\r\n parent::GeoCoder();\r\n }", "function google_api_acf_init() {\n\n\tacf_update_setting( 'google_api_key', get_field('google_maps','apikey') );\n}", "public function woo_slg_load_google() {\n\t\t\t\n\t\t\tglobal $woo_slg_options;\n\t\t\t\n\t\t\t//google class declaration\n\t\t\tif( !empty( $woo_slg_options['woo_slg_enable_googleplus'] ) \n\t\t\t\t&& !empty( $woo_slg_options['woo_slg_gp_client_id'] ) && !empty( $woo_slg_options['woo_slg_gp_client_secret'] ) ) {\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private function loadMapa()\n {\n \n $this->evento->id = $this->id;\n $this->evento->pegaInfo();\n \n echo \"<div class='evento-info2-title'>\".$this->evento->nome.\"</div>\";\n echo \"<div class='evento-list-introduction'>Visualize o mapa para chegar ao local do seu evento.</div>\";\n echo \"<input type='hidden' id='adress' value='\".$this->evento->logradouro.\" \".$this->evento->bairro.\", \".$this->evento->cidade.\" ,\" . $this->evento->escolherEstado() . \"' />\";\n echo \"<script type=\\\"text/javascript\\\" src=\\\"http://maps.google.com/maps/api/js?sensor=false\\\"></script>\";\n echo \"<div id=\\\"mapevento\\\"></div>\";\n \n }", "function gmap_obj($args){\n /*\n $args = array(\n 'id' => \"map-lyra\",\n 'lattitude' => \"43.5414097\",\n 'longitude' => \"1.5165507000000389\",\n 'zoom' => 16,\n 'address' => null,\n 'map_text' => null,\n );*/\n\n $output = \"<script src='https://maps.googleapis.com/maps/api/js?key=&sensor=false&extension=.js'></script>\";\n\n $output .= \"<script>\n google.maps.event.addDomListener(window, 'load', init);\n var map;\n function init() {\n var mapOptions = {\n center: new google.maps.LatLng(\".$args['lattitude'].\",\".$args['longitude'].\"),\n zoom: \".$args['zoom'].\",\n zoomControl: true,\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.SMALL\n },\n disableDoubleClickZoom: true,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU\n },\n scaleControl: true,\n scrollwheel: false,\n panControl: true,\n streetViewControl: false,\n draggable : true,\n overviewMapControl: false,\n overviewMapControlOptions: {\n opened: false\n },\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n styles: [{\\\"featureType\\\":\\\"all\\\",\\\"elementType\\\":\\\"all\\\",\\\"stylers\\\":[{\\\"saturation\\\":-100},{\\\"gamma\\\":0.5}]}]\n };\n var mapElement = document.getElementById('\".$args['id'].\"');\n var map = new google.maps.Map(mapElement, mapOptions);\n var locations = [\n ['\".$args['map_text'].\"', '\".$args['address'].\"', 'undefined', 'undefined','undefined', \".$args['lattitude'].\", \".$args['longitude'].\", '\".get_template_directory_uri().\"/img/marker.png']\n ];\n for (i = 0; i < locations.length; i++) {\n if (locations[i][1] =='undefined'){ description ='';} else { description = locations[i][1];}\n if (locations[i][2] =='undefined'){ telephone ='';} else { telephone = locations[i][2];}\n if (locations[i][3] =='undefined'){ email ='';} else { email = locations[i][3];}\n if (locations[i][4] =='undefined'){ web ='';} else { web = locations[i][4];}\n if (locations[i][7] =='undefined'){ markericon ='';} else { markericon = locations[i][7];}\n marker = new google.maps.Marker({\n icon: markericon,\n position: new google.maps.LatLng(locations[i][5], locations[i][6]),\n map: map,\n title: locations[i][0],\n desc: description,\n tel: telephone,\n email: email,\n web: web\n });\n if (web.substring(0, 7) != \\\"http://\\\") {\n link = \\\"http://\\\" + web;\n } else {\n link = web;\n }\n bindInfoWindow(marker, map, locations[i][0], description, telephone, email, web, link);\n }\n function bindInfoWindow(marker, map, title, desc, telephone, email, web, link) {\n var infoWindowVisible = (function () {\n var currentlyVisible = false;\n return function (visible) {\n if (visible !== undefined) {\n currentlyVisible = visible;\n }\n return currentlyVisible;\n };\n }());\n iw = new google.maps.InfoWindow();\n google.maps.event.addListener(marker, 'click', function() {\n if (infoWindowVisible()) {\n iw.close();\n infoWindowVisible(false);\n } else {\n var html= \\\"<div style='color:#000;background-color:#fff;padding:5px;width:90%;'><h4>\\\"+title+\\\"</h4><p>\\\"+desc+\\\"<p><a href='mailto:\\\"+email+\\\"' >\\\"+email+\\\"<a><a href='\\\"+link+\\\"'' >\\\"+web+\\\"<a></div>\\\";\n iw = new google.maps.InfoWindow({content:html});\n iw.open(map,marker);\n infoWindowVisible(true);\n }\n });\n google.maps.event.addListener(iw, 'closeclick', function () {\n infoWindowVisible(false);\n });\n }\n }\n</script>\";\n\n return $output;\n}", "public function __construct() {\n parent::__construct();\n $this->load->model('M_Masyarakat');\n $this->load->library('googlemaps');\n }", "function initMap() {\n\n\t\t// Instantiate the xajax object and configure it\n\t\trequire_once (t3lib_extMgm::extPath('xajax') . 'class.tx_xajax.php');\n\t\t$this->xajax = t3lib_div::makeInstance('tx_xajax'); // Make the instance\n\t\tif ($GLOBALS['TSFE']->metaCharset == 'utf-8') {\n\t\t\t$this->xajax->decodeUTF8InputOn(); // Decode form vars from utf8\n\t\t}\n\t\t$this->xajax->setCharEncoding($GLOBALS['TSFE']->metaCharset); \t\t// Encode of the response to utf-8 ???\n\t\t$this->xajax->setWrapperPrefix($this->prefixId); \t\t// To prevent conflicts, prepend the extension prefix\n\t\t$this->xajax->statusMessagesOn(); \t\t// Do you wnat messages in the status bar?\n\n\t\t// register the functions of the ajax requests\n\t\t$this->xajax->registerFunction(array('infomsg', &$this, 'ajaxGetInfomsg'));\n\t\t$this->xajax->registerFunction(array('activeRecords', &$this, 'ajaxGetActiveRecords'));\n\t\t$this->xajax->registerFunction(array('processCat', &$this, 'ajaxProcessCat'));\n\t\t$this->xajax->registerFunction(array('tab', &$this, 'ajaxGetPoiTab'));\n\t\t$this->xajax->registerFunction(array('search', &$this, 'ajaxSearch'));\n\t\t$this->xajax->registerFunction(array('processCatTree', &$this, 'ajaxProcessCatTree'));\n\t\t$this->xajax->registerFunction(array('getDynamicList', &$this, 'ajaxGetDynamicList'));\n\n\t\t$this->xajax->processRequests();\n\n\t\t// additional output using a template\n\t\t$template['total'] = $this->cObj2->getSubpart($this->templateCode,'###HEADER###');\n\t\t$markerArray = $subpartArray = array();\n\t\t$markerArray['###PATH###'] = t3lib_extMgm::siteRelpath('rggooglemap');\n\n\t\tif ($this->conf['map.']['addLanguage'] == 1) {\n\t\t\tif ($this->conf['map.']['addLanguage.']['override'] != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $this->conf['map.']['addLanguage.']['override'];\n\t\t\t} elseif ($GLOBALS['TSFE']->lang != '') {\n\t\t\t\t$markerArray['###MAP_KEY###'] .= '&hl=' . $GLOBALS['TSFE']->lang;\n\t\t\t}\n\t\t}\n\n\t\t$markerArray['###DYNAMIC_JS###'] = $this->getJs();\n\n\t\t// load spefic files if needed for clustering\n\t\tif ($this->conf['map.']['activateCluster'] == 1) { // gxmarkers\n\t\t\t$subpartArray['###CLUSTER_2###'] = '';\n\n\t\t} elseif ($this->conf['map.']['activateCluster'] == 2) { // markerclusterer\n\t\t\t$subpartArray['###CLUSTER_1###'] = '';\n\t\t} else { // no clustering\n\t\t\t$subpartArray['###CLUSTER_1###'] = $subpartArray['###CLUSTER_2###'] = '';\n\t\t}\n\n\t\t$totalJS = $this->cObj2->substituteMarkerArrayCached($template['total'],$markerArray, $subpartArray);\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_xajax'] = $this->xajax->getJavascript(t3lib_extMgm::siteRelPath('xajax'));\n\t\t$GLOBALS['TSFE']->additionalHeaderData['rggooglemap_js'] = $totalJS;\n\t}" ]
[ "0.70612305", "0.70271856", "0.6998376", "0.6912078", "0.67158896", "0.6521245", "0.65111804", "0.6457027", "0.6455555", "0.6386621", "0.637926", "0.6290871", "0.6161926", "0.613236", "0.6128419", "0.59714395", "0.5960694", "0.5953908", "0.5881248", "0.58590627", "0.58145326", "0.5801224", "0.57844746", "0.57522863", "0.5751615", "0.57366467", "0.5718135", "0.5683046", "0.5675701", "0.56606656" ]
0.70660686
0
Llamado a la vista tutoriaperfil
public function Perfil(){ $pvd = new tutoria(); //Se obtienen los datos del tutoria. if(isset($_REQUEST['persona_id'])){ $pvd = $this->model->Obtener($_REQUEST['persona_id']); } //Llamado de las vistas. require_once '../Vista/Tutoria/perfil-tutoria.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function archobjet_autoriser() {\n}", "function livraison_autoriser() {}", "function cilien_autoriser(){}", "public function getAutor()\n {\n return $this->autor;\n }", "public function getAutor()\n {\n return $this->autor;\n }", "public function getAutor()\n {\n return $this->autor;\n }", "function rang_autoriser(){}", "function date_modif_manuelle_autoriser() {\n}", "function cl_autoriser(){}", "function mots_autoriser() {\n}", "function metas_autoriser() {\n}", "function grappes_autoriser() {\n}", "function d3jspie_generateur_autoriser(){}", "function medias_autoriser(){}", "private function metodo_privado() {\n }", "function hal_autoriser() {\n}", "public function accionPerfilArtista(){\n // (si es que hay alguno logueado)\n $sw = false;\n $codRole = 0;\n \n if(Sistema::app()->Acceso()->hayUsuario()){\n $sw = true;\n \n $nick = Sistema::app()->Acceso()->getNick();\n $codRole = Sistema::app()->ACL()->getUsuarioRole($nick);\n \n }\n \n // Si el usuario que intenta acceder es un restaurante, administrador\n // o simplemente no hay usuario validado, lo mando a una página de\n // error. Los artistas tienen el rol 5\n if(!$sw || $codRole != 5){\n Sistema::app()->paginaError(403, \"No tiene permiso para acceder a esta página.\");\n exit();\n }\n \n // Una vez comprobado que está accediendo un artista, procedo a\n // obtener los datos del artista\n $art = new Artistas();\n \n // El nick del usuario es el correo electrónico. Es un valor\n // único, por lo que puedo buscar al artista por\n // su dirección de correo\n if(!$art->buscarPor([\"where\"=>\"correo='$nick'\"])){\n \n Sistema::app()->paginaError(300,\"Ha habido un problema al encontrar tu perfil.\");\n return;\n \n }\n \n $imagenAntigua = $art->imagen;\n $nombre=$art->getNombre();\n \n // Si se modifican los datos del artista, esta variable\n // pasará a true para notificar a la vista\n $artistaModificado = false;\n if (isset($_POST[$nombre]))\n {\n $hayImagen = true;\n // Si ha subido una nueva imagen, recojo su nombre\n if($_FILES[\"nombre\"][\"name\"][\"imagen\"]!=\"\"){\n $_POST[\"nombre\"][\"imagen\"] = $_FILES[\"nombre\"][\"name\"][\"imagen\"];\n }\n else{\n $hayImagen = false;\n $_POST[\"nombre\"][\"imagen\"] = $art->imagen;\n }\n // El coreo es una clave foránea, así que tengo\n // que cambiar el correo en la tabla ACLUsuarios\n Sistema::app()->ACL()->setNick($nick, $_POST[\"nombre\"][\"correo\"]);\n \n $art->setValores($_POST[$nombre]);\n \n if ($art->validar())\n {\n // Si se ha guardado correctamente, actualizo la imagen de perfil\n // e inicio sesión con el nuevo correo automáticamente\n if ($art->guardar()){\n $artistaModificado = true;\n if($hayImagen){\n // Obtengo la carpeta destino de la imagen\n $carpetaDestino = $_SERVER['DOCUMENT_ROOT'].\"/imagenes/artistas/\";\n // Elimino la imagen antigua\n unlink($carpetaDestino.$imagenAntigua);\n \n // Y guardo la nueva\n move_uploaded_file($_FILES['nombre']['tmp_name']['imagen'], $carpetaDestino.$_POST[\"nombre\"][\"imagen\"]);\n }\n Sistema::app()->Acceso()->registrarUsuario(\n $_POST[\"nombre\"][\"correo\"],\n mb_strtolower($art->nombre),\n 0,\n 0,\n [1,1,1,1,1,0,0,0,0,0]);\n }\n \n }\n }\n \n $this->dibujaVista(\"perfilArtista\",\n [\"art\"=>$art, \"artistaModificado\"=>$artistaModificado],\n \"Perfil\");\n \n }", "public function get_autor()\n {\n return $this->_autor;\n }", "function get_aut_idautor(){return $this->aut_idautor;}", "public function perfil() {\n require_once 'views/usuarios/perfil.php';\n }", "function perfil (){\n \t $dato=$_SESSION['Usuarios'];\n\t\t $datos = Usuario::mostrar($dato);\n \t require \"app/Views/Perfil.php\";\n }", "public function tutorPublicProfile() {\n\t\t$this->isLoggedIn();\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'tutor_public_profile';\n\t\t$data['pageName'] = 'My Tutor Profile (Public)';\n\t\t$tutor_id = $data['common_data']['user_id'];\n/*\t\tif($tutor_id != $data['common_data']['user_id']){\n\t\t\tshow_404();\n\t\t\tdie();\n\t\t}*/\n\t\t// get tutor details\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($tutor_id);\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t// get main subjects and sub subjects\n\t\t$data['main_subjects'] = $this->profile_model->getMainSubjects();\n\t\tif(!empty($data['main_subjects'])){\n\t\t\tforeach($data['main_subjects'] as $key=>$row){\n\t\t\t\t$data['main_subjects'][$key]['subjects'] = $this->profile_model->getSubjectsByMainId($row['id']);\n\t\t\t}\n\t\t}\n\t\tif(empty($data['tutor_details'])){\n\t\t\t$level_type = ($data['common_data']['user_data']['role'] == STUDENT)? OPEN_STAR:TIER;\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getTutorFirstLevel($level_type);\n\t\t\tif(!empty($data['tutor_level'])){\n\t\t\t\t$this->profile_model->saveTutorLevel($data['common_data']['user_id'],$data['tutor_level']['id']);\n\t\t\t\t$this->profile_model->saveTutorLevelinDetail($data['common_data']['user_id'],$data['tutor_level']['id']);\n\t\t\t}\n\t\t} else {\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getLevelById($data['tutor_details']['level_id']);\n\t\t\t// get subjects\n\t\t\t$data['tutor_details']['subjects'] = $this->profile_model->getSubjectsByTutorId($tutor_id);\n\t\t\t// get avaiability\n\t\t\t$availability = $this->profile_model->getAvailabilityByTutorId($tutor_id);\n\t\t\t$index = 0;\n\t\t\tforeach ($availability as $row){\n//\t\t\t\t$data['tutor_details']['availability'][$row['day_available']]['times'][$index] = $row['time_available'];\n\t\t\t\t$data['tutor_details']['availability'][$row['day_available']]['times'][$row['id']] = $row['time_available'];\n\t\t\t\t$index++;\n\t\t\t}\n\t\t\t// get avaiability\n\t\t\t$group_availability = $this->profile_model->getGroupAvailabilityByTutorId($tutor_id);\n\t\t\t$g_index = 0;\n\t\t\tforeach ($group_availability as $row){\n//\t\t\t\t$data['tutor_details']['group_availability'][$row['day_available']]['times'][$g_index] = $row['time_available'];\n\t\t\t\t$data['tutor_details']['group_availability'][$row['day_available']]['times'][$row['id']] = $row['time_available'];\n\t\t\t\t$data['tutor_details']['group_availability'][$row['day_available']]['no_of_students'] = $row['seats'];\n\t\t\t\t$data['tutor_details']['group_availability'][$row['day_available']]['syllabus'] = $row['syllabus'];\n\t\t\t\t$g_index++;\n\t\t\t}\n\t\t}\n\t\t//Getting all payment details\n\t\t$data['payment_details'] = $this->payment_model->getPaymentDetailsById($data['common_data']['user_id']);\n\t\t$data['teaching_levels'] = $this->profile_model->getTeachingLevels();\n\t\t$data['tutor_badges'] = $this->user_model->getTutorBadges($data['common_data']['user_id']);\n\t\t$data['badges'] = $this->user_model->getBadges();\n\n\t\t$data['page'] = 'tutor-public-profile';\n\t\t$data['countries'] = $this->user_model->getCountries();\n\t\t$template['body_content'] = $this->load->view('frontend/profile/tutor-public-profile', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\t\t\n\t}", "public function get_author_permastruct()\n {\n }", "function plugonet_autoriser() {}", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function cl_db_usuariosrhlota() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_usuariosrhlota\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function factures_autoriser(){}", "private function setRutasVista() {\n /* variable relacionadas a un controlador especifico */\n $this->_rutas = [\n 'vista' => RUTA_MODULOS . 'vista' . DS . $this->_controlador . DS,\n 'img' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/img/\",\n 'js' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/js/\",\n 'css' => URL_MODULOS . \"vista/\" . $this->_controlador . \"/css/\",\n ];\n }", "public function user()\n {\n return $this->session()->tutor();\n }", "public function Crud(){\n $pvd = new tutoria();\n\n //Se obtienen los datos del tutoria a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Tutoria/editar-tutorias.php';\n\t}" ]
[ "0.7043696", "0.6953432", "0.66480434", "0.66125095", "0.66125095", "0.66125095", "0.6595196", "0.6492149", "0.64842004", "0.6482642", "0.63589114", "0.6309867", "0.6297492", "0.62511635", "0.62179387", "0.61126333", "0.6112123", "0.61113006", "0.605266", "0.6019882", "0.5999282", "0.5969606", "0.5950603", "0.5918464", "0.58356225", "0.5830902", "0.5830761", "0.58254015", "0.5782795", "0.5772828" ]
0.6969891
1
TODO: Implement setWalkModel() method.
public function setWalkModel() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setModel(&$m) {\n\t\t$this->_model =& $m;\n\t}", "function setModel(&$m) {\n\t\t$this->_model =& $m;\n\t}", "function setModel(&$m) {\n\t\t$this->_model =& $m;\n\t}", "public static function preModel(){\n\t\t\n\t}", "public function __construct(Visit $model)\n\t{\n\t\t$this->model = $model;\n\t}", "function setup(&$model) {\r\n\t\tif (!array_key_exists($model->name, $this->models)) {\r\n\t\t\t$this->models[$model->name] =& $model;\r\n\t\t}\r\n\t}", "abstract protected function getModel();", "public function loadModel() : void\n {\n $model = $this->newModel();\n\n $model->loadModel($this->modelPath);\n $model->printModel();\n\n $this->fm = FunctionMap::loadFunctionMap();\n }", "public function walk()\r\n {\r\n echo \"I am walking....\" . \"<br>\";\r\n }", "protected function setModel(): void\n {\n $this->model = Location::class;\n }", "protected function setModel()\n {\n $class = 'Src\\Modules\\\\' . $this->module_name . '\\Models\\\\' . $this->class . 'Model';\n $this->model = new $class;\n $this->model->setModuleName( $this->module_name );\n $this->model->run();\n }", "public function setModel($model)\r\n {\r\n //Complete this function and assign model to Class Property $model\r\n $this->model = $model;\r\n }", "protected abstract function model();", "abstract public function getModel();", "public function setModel(Model $model) : void\n {\n $this->model = $model;\n\n $this->fm = FunctionMap::loadFunctionMap();\n }", "public function updatedModel(Model &$model)\n {\n }", "abstract function getModel();", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "public function generateModels () {\r\n $modelParam = \\app\\lib\\router::getModel();\r\n $ModelPath = \\app\\lib\\router::getPath();\r\n $ModelName = \"app\\model\\\\\" . end($ModelPath);\r\n $this->model =new $ModelName;\r\n }", "abstract protected function model();", "abstract protected function model();", "private function initDepth()\n {\n if ($this->depth !== null) { // Is de diepte reeds ingesteld?\n return;\n }\n if (isset(self::$current) == false) { // Gaat het om de eerste VirtualFolder (Website)\n if (($this instanceof Website) == false) {\n notice('VirtualFolder outside a Website object?');\n }\n self::$current = &$this; // De globale pointer laten verwijzen naar deze 'virtuele map'\n if (defined('Sledgehammer\\WEBPATH')) {\n $this->depth = preg_match_all('/[^\\/]+\\//', \\Sledgehammer\\WEBPATH, $match);\n } else {\n $this->depth = 0;\n }\n\n return;\n }\n $this->parent = &self::$current;\n self::$current = &$this; // De globale pointer laten verwijzen naar deze 'virtuele map'\n $this->depth = $this->parent->depth + $this->parent->depthIncrement;\n }", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "abstract protected function setModel(): String;", "public function testSetNativeModel()\n {\n $this->todo('stub');\n }", "function VisitorModel()\n\t\t{\n\t\t\tparent::Model();\n\t\t}", "public function storedModel(Model &$model)\n {\n }", "public function setModel($model)\n{\n$this->model = $model;\n\nreturn $this;\n}", "public function setCurModelObject() {\n //'cause when the Controller is called by another Controller\n //and thus the Model in the local Controller is also called remotely\n //by that remote Controller\n //$curModel = CURMODEL;\n //$this->model = new $curModel();\n\n $model = $this->CMO->model_prefix.get_class($this);\n $this->model = new $model();\n //Models' pseudo constructor cannot pass Parameters\n if(method_exists($this->model,'_construct')) {\n call_user_func_array(array($this->model,'_construct'),array());//this invokes the pseudo constructor of Model class\n }\n if(method_exists($this->model,'_'.$model)) {\n call_user_func_array(array($this->model,'_'.$model),array());//this invokes the pseudo constructor of Model class\n }\n }", "public function loadWalk(Walk $walk)\n {\n $this->page = $walk->getPage();\n $this->eid = $this->page->getAttribute('eventbrite');\n $this->eventParams = [\n 'id' => $this->eid,\n 'privacy' => '1',\n 'confirmation_page' => 'http://janeswalk.org/donate',\n 'title' => (string) $walk,\n 'description' => $walk->longdescription,\n // Default status to draft, so only explicit calls publish an event\n 'status' => 'draft',\n 'timezone' => $walk->getTimezone(),\n 'app_key' => EVENTBRITE_APP_KEY,\n 'user_key' => EVENTBRITE_USER_KEY\n ];\n\n // Load the available time slots\n // TODO: just syncing the next time -- check if the EB API supports\n // easily setting multi-date events;\n if ($walk->time['open']) {\n $this->eventParams['repeats'] = 'yes';\n }\n foreach ((array) $walk->time['slots'] as $time) {\n $this->eventParams['start_date'] = gmdate('Y-m-d H:i:s', $time[0]);\n $this->eventParams['end_date'] = gmdate('Y-m-d H:i:s', $time[1]);\n }\n }" ]
[ "0.5429168", "0.5429168", "0.5429168", "0.54023165", "0.5257354", "0.52340764", "0.5209344", "0.5197934", "0.518204", "0.516158", "0.5109569", "0.51077795", "0.5062973", "0.5029167", "0.50169235", "0.49938047", "0.49760336", "0.49649176", "0.49567896", "0.49439067", "0.49439067", "0.49387816", "0.49324027", "0.49220258", "0.49028525", "0.4893668", "0.48754233", "0.48717615", "0.48658422", "0.4865392" ]
0.8960129
0
TODO: Implement setSiteUrl() method.
public function setSiteUrl() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function siteUrl() {}", "function site($url) {\n\t\t$this->url = $url;\n\t}", "public function getSiteURL()\r\n {\r\n return $this->siteURL;\r\n }", "public function getSite();", "public function getUrl() {\n\t\treturn $this->siteURL;\n\t}", "public function setSiteURL($siteURL)\r\n {\r\n //Find out how to validate urls\r\n $this->siteURL = $siteURL;\r\n }", "protected function defineSitePath() {}", "protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}", "public function getSite() {\n return $this->sSite;\n }", "public function setUrl( $url );", "function site_url(){\n\treturn config( 'site.url' );\n}", "public function setUrl($url) {}", "public function getSite()\n {\n return $this->site;\n }", "public function testUpdateSite()\n {\n }", "public function getWebsite();", "function _config_wp_siteurl($url = '')\n {\n }", "public function getUrl()\n\t{\n\t\tif ($this->uri !== null)\n\t\t{\n\t\t\treturn UrlHelper::getSiteUrl($this->uri);\n\t\t}\n\t}", "private static function getSiteUrl()\n {\n return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://\" . $_SERVER['HTTP_HOST'] . ( isset($_SERVER['SCRIPT_URL'] ) ? $_SERVER['SCRIPT_URL'] : '' );\n }", "public function getSiteURL()\n {\n return $this->config->get('site.url').$this->config->get('site.dir');\n }", "private function set_base_url()\n\t{\n\t\t// We completely kill the site URL value. It's now blank.\n\t\t// This enables us to use only the \"index.php\" part of the URL.\n\t\t// Since we do not know where the CP access file is being loaded from\n\t\t// we need to use only the relative URL\n\t\t$this->config->set_item('site_url', '');\n\n\t\t// We set the index page to the SELF value.\n\t\t// but it might have been renamed by the user\n\t\t$this->config->set_item('index_page', SELF);\n\t\t$this->config->set_item('site_index', SELF); // Same with the CI site_index\n\t}", "public function site(){\n return $this->site;\n }", "protected function setUpFakeSitePathAndHost() {}", "function setSite(mvcSiteTools $inSite) {\r\n\t\tif ( $inSite !== $this->_Site ) {\r\n\t\t\t$this->_Site = $inSite;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "public function setUrl()\n {\n $this->set('url', function() {\n $url = new Url();\n $url->setBaseUri('/');\n return $url;\n });\n }", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "function setUrl($url);", "public function setWebsite($uri);" ]
[ "0.7872323", "0.734641", "0.71792513", "0.71238", "0.71180004", "0.69351494", "0.6818418", "0.6717588", "0.6679266", "0.664581", "0.65983564", "0.6567585", "0.6555756", "0.65196043", "0.6509995", "0.6502158", "0.64982486", "0.649403", "0.64770174", "0.6453908", "0.64534837", "0.64238936", "0.6421285", "0.63986194", "0.63949466", "0.63949466", "0.63949466", "0.63949466", "0.6392391", "0.6391758" ]
0.8813554
0
////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////// BEGIN Character Build Stats and Character Card ////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// checks to see if character needs to be rebuilt or if it can be pulled from cache.
function fyxt_isCharUpdateNeeded ( $charID, $fyxtAccountID ) { //checks to see if character needs to be built. if ( isset( $charID ) ) { $charLastUpdated = fyxt_lastCharUpdate ( $charID ); $charCalcInfo = fyxt_characterBuiltInfo ( $charID ); //if date is blank, later then card, or rebuild says 1 if ( ( empty( $charCalcInfo->fyxt_cc_updated ) ) || ( $charLastUpdated > $charCalcInfo->fyxt_cc_updated ) || ( $charCalcInfo->fyxt_cc_rebuild_character == 1 ) ){ //Builds character if needed //////////////////////////////////////////////////////////////// fyxt_updateCharacterCard ( $charID, $fyxtAccountID ); $fireCharInfoFunction = 'Character has been rebuilt.'; } else { $fireCharInfoFunction = 'Character does not need to be built. Grabbing card info.'; } } $array = array( "Character Last Updated" => $charLastUpdated, "Card Last Built" => $charCalcInfo->fyxt_cc_updated, "Force Rebuild" => $charCalcInfo->fyxt_cc_rebuild_character, "Build Message" => $fireCharInfoFunction ); return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _can_cache() {\n\t\treturn true;\n\t}", "public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }", "private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }", "public function cacheCheck(){\n \n if(file_exists($this->cacheName)){\n\t \n $cTime = intval(filemtime($this->cacheName));\n \n if( $cTime + $this->cacheTime > time() ) {\n\t \n echo file_get_contents( $this->cacheName );\n \n ob_end_flush();\n \n exit;}\t\t\t\t\t\n \n \t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n return false;\n \n}", "function Reload_Character($uid) {\r\n\t\tglobal $gameinstance, $moduleinstance, $char;\r\n\t\tdb(__FILE__,__LINE__,\"select * from ${gameinstance}_characters where login_id = '$uid'\");\r\n\t\t$char_reload = dbr();\r\n\t\t//NOTE: char_reload deliberately does not reload the SESSION modifiers data\r\n\t\t// add ability bonuses to a characters attributes\r\n\t\tif(!empty($_SESSION['modifiers'])) \r\n\t\t{\r\n\t\t\t$char->Add_Ability_Bonuses($char_reload);\r\n\t\t}\r\n\t\t// calculate a characters ability/attribute modifiers (once bonuses added to the attributes)\r\n\t\t$char->Calculate_Ability_Modifiers($char_reload);\r\n\t\treturn $char_reload;\r\n\t}", "public function check_cache() \r\n\t{\r\n\t\tif (!is_readable($this->cache_file))\r\n\t\t{\r\n\t\t\t$this->generate_cache();\r\n\t\t}\r\n\t\t$contents = file_get_contents($this->cache_file);\r\n\t\treturn $contents;\r\n\t}", "private function check_cache()\n\t{\n\t\t$cache_file = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t$this->skip = FALSE;\n\t\t\n\t\tif (is_file($cache_file))\n\t\t{\n\t\t\t// touch file. helps determine if template was modified\n\t\t\ttouch($cache_file);\n\t\t\t// check if template has been mofilemtime($cache_file)dified and is newer than cache\n\t\t\t// allow $cache_time difference\n\t\t\tif ((filemtime($this->file)) > (filemtime($cache_file)+$this->cache_time))\n\t\t\t\t$this->skip = TRUE;\n\t\t}\n\t\t\n\t\treturn $cache_file;\n\t}", "function check_cache ($cache_dir, $quality, $zoom_crop) {\n if(!file_exists($cache_dir)) {\n // give 777 permissions so that developer can overwrite\n // files created by web server user\n mkdir($cache_dir);\n chmod($cache_dir, 0777);\n }\n\n show_cache_file($cache_dir, $quality, $zoom_crop);\n}", "protected static function buildSpriteDataAndCreateCacheEntry() {}", "private function decide(): bool\n {\n if ($this->cloudflare && isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {\n $this->cache = false;\n $this->addMessage('request from cloudflare');\n }\n // don't cache if user is logged in\n if (strpos('test ' . implode(' ', array_keys($_COOKIE)), 'wordpress_logged_in')) {\n $this->cache = false;\n $this->loggedin = true;\n $this->addMessage('Loggedin user');\n }\n // don't cache post requests\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $this->cache = false;\n $this->addMessage('Post request');\n }\n // don't cache requests to wordpress php files\n if (preg_match('%(/wp-admin|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)%',\n $this->path)) {\n $this->cache = false;\n $this->addMessage('This is a WordPress file ');\n }\n\n // don't cache if url has a query string\n // TODO verify that this is reasonable\n if (parse_url($this->url, PHP_URL_QUERY)) {\n $this->cache = false;\n $this->addMessage('Not caching query strings');\n }\n\n return $this->cache;\n }", "final protected function getCacheNeed()\n\t{\n\t\treturn\tintval($this->arParams['CACHE_TIME']) > 0 &&\n\t\t\t\t$this->arParams['CACHE_TYPE'] != 'N' &&\n\t\t\t\tConfig\\Option::get(\"main\", \"component_cache_on\", \"Y\") == \"Y\";\n\t}", "private function do_caching() {\n if ($this->is_logged_in) {\n return false;\n }\n //Dont cache the request if it's either POST or PUT\n else if (preg_match(\"/^(?:POST|PUT)$/i\", $_SERVER[\"REQUEST_METHOD\"])) {\n return false;\n }\n if (preg_match(\"#register#\", $_SERVER[\"REQUEST_URI\"])) {\n return false;\n }\n if (preg_match(\"#login#\", $_SERVER[\"REQUEST_URI\"])) {\n return false;\n }\n if (is_array($_COOKIE) && !empty($_COOKIE)) {\n foreach ($_COOKIE as $k => $v) {\n if (preg_match('#session#', $k) && strlen($v))\n return false;\n if (preg_match(\"#fbs_#\", $k) && strlen($v))\n return false;\n }\n }\n return true;\n }", "function Character($uid) {\r\n\t\tglobal $CONFIG, $gameinstance, $moduleinstance;\r\n\t\tdb(__FILE__,__LINE__,\"select char_check from ${gameinstance}_characters where login_id = '$uid'\");\r\n\t\t$created = dbr();\r\n\t\tif($created['char_check'] < 1 && $_GET['op_c'] != \"create\" && $_POST['op'] != \"race\" && $_POST['op'] != \"class\" && $_POST['op'] != \"class2\" && $_POST['op'] != \"save_skills\" && $_POST['op'] != \"finalise\") \r\n\t\t{\t\r\n\t\techo(\"<script>self.location='$CONFIG[url_prefix]/core/character_create.php?op_c=create';</script>\");\r\n\t\t}\r\n\t}", "private function isCssUpdated() {\n\n $changed = false;\n\n if ($this->compiler == 'less') {\n $generateSourceMap = $this->params->get('generate_css_sourcemap', false);\n\n // if the source map still exists but shouldn't be created, just recompile.\n if (JFile::exists($this->paths->get('css.sourcemap')) && !$generateSourceMap) {\n $changed = true;\n }\n\n // if the source map doesn't exist but should, just recompile.\n if (!JFile::exists($this->paths->get('css.sourcemap')) && $generateSourceMap) {\n $changed = true;\n }\n } else {\n if (!$changed) {\n if ($this->cache->get(self::CACHEKEY.'.scss.formatter') !== $this->formatting) {\n $changed = true;\n }\n }\n }\n\n if (!$changed) {\n if ($this->cache->get(self::CACHEKEY.'.compiler') !== $this->compiler) {\n $changed = true;\n }\n }\n\n if (!$changed) {\n $changed = $this->isCacheChanged(self::CACHEKEY.'.files.css');\n }\n\n return $changed;\n }", "protected function hasToRegenerateFull() {\n return Cache::read('regenerate_full', 'estadisticas_full') === false;\n }", "protected function _cached_required()\n {\n $image_info = getimagesize($this->source_file);\n\n if (($this->url_params['w'] == $image_info[0]) AND ($this->url_params['h'] == $image_info[1]))\n {\n $this->serve_default = TRUE;\n return FALSE;\n }\n\n return TRUE;\n }", "public function get_css_cache_invalidated(): bool{\n\t\t\t// false = cache valid\n\n\t\t\tif($this->module_css_cache_invalidated !== NULL){\n\t\t\t\treturn $this->module_css_cache_invalidated; // status already retrieved\n\t\t\t}\n\n\t\t\tif(!isset(static::$list[$this->get_UID()]['cache'][ 'invalidated' ])){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // setting not saved yet\n\t\t\t}\n\n\t\t\tif(is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['gutenberg']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\t\t\tif(!is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['frontend']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\n\t\t\t$this->module_css_cache_invalidated = false;\n\t\t\treturn false; // cache is valid\n\t\t}", "protected function _loadCache()\n {\n return false;\n }", "public function can_cache() {\n return $this->valid;\n }", "protected function checkSomePhpOpcodeCacheIsLoaded() {}", "static public function check_for_updates()\n {\n if( self::is_dev() ) {\n self::compile_css();\n return true;\n }\n\n\t\t$sass_file_time = filemtime( YDG_CHILD_THEME_DIR . '/theme.scss' );\n\t\t$style_file_time = filemtime( YDG_CHILD_THEME_DIR . '/style.css' );\n\t\t$output_file_time = filemtime( YDG_CHILD_THEME_DIR . '/css/theme.css' );\n\n\t\tif( $sass_file_time > $output_file_time || $style_file_time > $output_file_time ) {\n\t\t\tself::compile_css();\n return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function prewarmCache()\n {\n //Now that installation is complete, we need to set this to false to have the caches build correctly\n $GLOBALS['installing'] = false;\n $this->log(\"Populating metadata cache\");\n $GLOBALS['app_list_strings'] = return_app_list_strings_language('en_us');\n require_once 'include/MetaDataManager/MetaDataManager.php';\n MetaDataManager::setupMetadata(array('base'), array('en_us'));\n $this->log(\"Metadata cache populated\");\n }", "function need_update() {\r\n\t\treturn (bool) get_transient( 'av5_css_file' );\r\n\t}", "function mysteam_check_cache()\n{\t\n\tglobal $mybb, $cache;\n\t\n\t// Don't touch the cache if disabled, just return the results from Steam's network.\n\tif (!$mybb->settings['mysteam_cache'])\n\t{\n\t\t$steam = mysteam_build_cache();\n\t\t\n\t\tif ($steam['users'])\n\t\t{\n\t\t\treturn $steam;\n\t\t}\n\t\treturn false;\n\t}\n\t\n\t$steam = $cache->read('mysteam');\n\t\n\t// Convert the cache lifespan setting into seconds.\n\t$cache_lifespan = 60 * (int) $mybb->settings['mysteam_cache'];\n\t\n\t// If the cache is still current enough, just return the cached info.\n\tif (TIME_NOW - (int) $steam['time'] < $cache_lifespan)\n\t{\t\n\t\treturn $steam;\n\t}\t\n\t\n\t// If last attempt to contact Steam failed, check if it has been over 3 minutes since then. If not, return false (i.e. do not attempt another contact).\n\tif (TIME_NOW - (int) $steam['lastattempt'] < 180)\n\t{\n\t\treturn false;\n\t}\n\t\t\n\t$steam_update = mysteam_build_cache();\n\t\n\t// If response generated, update the cache.\n\tif ($steam_update['users'])\n\t{\n\t\t$steam_update['version'] = $steam['version'];\n\t\t$cache->update('mysteam', $steam_update);\n\t\treturn $steam_update;\n\t}\n\t// If not, cache time of last attempt to contact Steam, so it can be checked later.\n\telse\n\t{\n\t\t$steam_update['lastattempt'] = TIME_NOW;\n\t\t$steam_update['version'] = $steam['version'];\n\t\t$cache->update('mysteam', $steam_update);\n\t\treturn false;\n\t}\n}", "private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function can_be_buyed_by(Character $character)\n\t{\n\t\tif ( $this->has_expired() )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ( $character->id == $this->seller_id )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $this->clan_id > 0 )\n\t\t{\n\t\t\tif ( $character->clan_id != $this->clan_id )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$coins = $character->get_coins();\n\t\t\n\t\tif ( ! $coins )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ( $coins->count < $this->price_copper )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function isUpdateRequired()\n {\n $CacheCreated = filemtime($this->cachedPath);\n $CacheRenewal = $CacheCreated + $this->CacheLife;\n if(time() >= $CacheRenewal)\n return true;\n else\n return false;\n }", "public function checkAdvancedCache()\n {\n if (!$this->options['enable']) {\n return; // Nothing to do.\n } elseif (!empty($_REQUEST[GLOBAL_NS])) {\n return; // Skip on plugin actions.\n }\n $cache_dir = $this->cacheDir();\n $advanced_cache_file = WP_CONTENT_DIR.'/advanced-cache.php';\n $advanced_cache_check_file = $cache_dir.'/'.mb_strtolower(SHORT_NAME).'-advanced-cache';\n\n // Fixes zero-byte advanced-cache.php bug related to migrating from ZenCache\n // See: <https://github.com/websharks/zencache/issues/432>\n\n // Also fixes a missing `define( 'WP_CACHE', true )` bug related to migrating from ZenCache\n // See <https://github.com/websharks/zencache/issues/450>\n\n if (!is_file($advanced_cache_check_file) || !is_file($advanced_cache_file) || filesize($advanced_cache_file) === 0) {\n $this->addAdvancedCache();\n $this->addWpCacheToWpConfig();\n }\n }", "static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.5643225", "0.5550364", "0.54961604", "0.54672927", "0.5434115", "0.54186445", "0.53957343", "0.53805023", "0.5375239", "0.5329102", "0.5318657", "0.52990526", "0.52928925", "0.52452093", "0.52394813", "0.5188692", "0.51526463", "0.5146828", "0.5103195", "0.5096929", "0.5092109", "0.50861293", "0.50787365", "0.5075079", "0.50337756", "0.5033556", "0.5023209", "0.5017503", "0.5012424", "0.5009505" ]
0.6842195
0
Creates a table type object with passed data
public static function create($data) { $name = $data['name']; $language = $data['language']; $columnOption = $data['columnOption']; $specificColumns = $data['specificColumns']; return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function createTestTable();", "function mscaffolding_create_table($name, $data)\n\t{\n\t\t$query_string = \"CREATE TABLE `\" . lconf_get(\"db_name\") . \"`.`\" . $name . \"` (`id` INT NOT NULL AUTO_INCREMENT,\";\n\n\t\tfor ($i = 0; $i < count($data) / 2; $i++)\n\t\t{\n\t\t\t$query_string .= \"`\" . $data[\"name\" . $i] . \"`\" . mscaffolding_get_type($data[\"type\" . $i]);\n\t\t}\n\n\t\t$query_string .= \" PRIMARY KEY ( `id` )) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_slovenian_ci\";\n\n\t\treturn ldb_query($query_string);\n\t}", "private function createDummyTable() {}", "public static function create($data = [])\n {\n $table = new static();\n\n return $table->createRow((array) $data);\n }", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "function table ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('ttable');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function create_table($name, $data) {\n\t\t$this->execute($this->engine->create_table_sql($name, $data));\n\t}", "function createTable($objSchema);", "public function generateTable($type, $data){\n\t\t$db = new Database();\n\t\t$conn_result = $db->connect();\n\t\tif($conn_result[\"error\"] == TRUE){ \n\t\t\t\t\treturn $conn_result; \n\t\t\t\t}\n\t\t//fetch array\n\t\twhile($row = mysqli_fetch_array($data)){\n\t\t\t//FETCH DATA TO DISPLAY\n\t\t\t$array = $this->setTableData($row, $db);\n\t\t\t//grab first td entry depending on type\n\t\t\t$this->printTableData($array, $type);\n\t\t}//end while\n\t}", "public function newTable($items);", "protected function tinydb_create($data)\n {\n $values = array();\n foreach (static::tinydb_get_table_info()->table_info() as $field => $info) {\n if (isset($data[$field])) {\n if ($this->tinydb_getset_is_method(\"create_$field\", true)) {\n $method_name = \"create_$field\";\n $values[$field] = $this->$method_name($data[$field]);\n } else {\n $values[$field] = $data[$field];\n }\n } else if ($field === 'created_at' || $field === 'modified_at') {\n $values[$field] = time();\n } else if (!$info->nullable && !$info->auto_increment && !isset($info->default)) {\n throw new \\InvalidArgumentException($field . ' is required when creating this object.');\n }\n\n // If a value was set, encode it properly\n if (isset($values[$field])) {\n $values[$field] = \\TinyDb\\Internal\\SqlDataAdapters::encode($info->type, $values[$field]);\n }\n }\n\n $id = \\TinyDb\\Query::create()->insert()->into(static::$table_name, array_keys($values))->values(array_values($values))->exec();\n\n // If the primary key is composite, generate the primary key\n if (is_array(static::tinydb_get_table_info()->primary_key)) {\n $id = array();\n foreach (static::tinydb_get_table_info()->primary_key as $field) {\n $id[$field] = $data[$field];\n }\n // If the primary key was provided, use that\n } else if (isset($values[static::tinydb_get_table_info()->primary_key])) {\n $id = $values[static::tinydb_get_table_info()->primary_key];\n }\n\n $query = \\TinyDb\\Query::create()->select('*')->from(static::$table_name);\n $query = static::tinydb_add_where_for_pkey($id, $query);\n $rows = $query->exec();\n $this->tinydb_datafill($rows[0]);\n }", "public function __construct(object $data, $format = null)\n {\n $this->data = $data;\n $this->format = $format;\n // collect();\n // if ($format) {\n // foreach ($format as $column) {\n // $col = new TableColumn($column);\n // $this->format->push($col);\n // }\n // } elseif ($data) {\n // $first = $data[0];\n // if ($first) {\n // $first = array_keys($first->toArray());\n // foreach ($first as $column_name) {\n // $col = new TableColumn();\n // $col->column = $column_name;\n // $col->title = $column_name;\n\n // $this->format->push($col);\n // }\n // }\n // }\n }", "protected function _toTableRow($tableName, array $data) // {{{\n {\n $table = $this->_getTable($tableName);\n $rowClass = $table->getRowClass();\n\n return new $rowClass(array(\n 'table' => $table,\n 'data' => $data,\n 'readOnly' => false,\n 'stored' => true, // use given data as clean data, i.e. treat\n // this record as stored in the database\n ));\n }", "function plugin_customfields_create_data_table($itemtype) {\n global $DB;\n\n $table = plugin_customfields_table($itemtype);\n\n if (!TableExists($table)) {\n $sql = \"CREATE TABLE `$table` (\n `id` int(11) NOT NULL default '0',\n PRIMARY KEY (`id`)\n )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3;\";\n $result = $DB->query($sql);\n return ($result ? true : false);\n }\n return true;\n}", "public static function buildObject($table, $data)\n {\n $objectClass = $table->getPersistClassName();\n $object = new $objectClass;\n $errors = array();\n foreach($table->getFields() as $field) {\n $name = $field->getName();\n if (!isset($data[$name])) {\n $data[$name] = null;\n }\n $postfix = '';\n foreach($table->getBinds() as $bind) {\n if($bind->getLeftField() === $field->getName()){\n $postfix = $bind->getLeftField() === $field->getName() ? OrmUtils::BIND_PREFIX : \"\";\n break;\n }\n }\n $setter = \"set\" . ucfirst($name).$postfix;\n $object->$setter($data[$name]);\n }\n return array($object, $errors);\n }", "private function __construct($table, $data = array()) {\n $temp = array_merge(array('data' => array()), $data);\n\n $this->set_table_name($table);\n $this->load_columns_information();\n $this->new_register = true;\n\n\n // Carrega os dados iniciais, caso $temp['data'] esteja definido\n if(sizeof($temp['data']) > 0)\n $this->load_data($temp['data']);\n }", "function table($table, array $params = ['pk' => 'id'])\n {\n if (class_exists($table) && is_subclass_of($table, 'Objectiveweb\\DB\\Table')) {\n\n return new $table($this);\n } else {\n return new DB\\Table($this, $table, $params);\n }\n }", "public function __construct($data=null){\r\n\t\t// Load Table\r\n\t\t$class = get_class($this);\r\n\t\t$this->definition = DBObjectDefinition::getByClassName($class,$this);\r\n\t\t\r\n\t\t// Process Input\r\n\t\t$dataLoaded = false;\r\n\t\tif (!is_null($data)){\r\n\t\t\tif ($data instanceof SQLQueryResultRow){\r\n\t\t\t\tif (!$this->loadFromSqlResult($data)){\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Unable to load '.get_class($this).' object from SQL result row');\r\n\t\t\t\t}\r\n\t\t\t\t$dataLoaded = true;\r\n\t\t\t} elseif (is_array($data) || $data instanceof ArrayAccess) {\r\n\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t} elseif (is_numeric($data)) {\r\n\t\t\t\t$data = (int)$data;\r\n\t\t\t\t$pk = $this->getTable()->getPrimaryKey();\r\n\t\t\t\tif ($pk->size()==1){\r\n\t\t\t\t\t$id = $data;\r\n\t\t\t\t\t$data = array(ArrayUtils::getFirst($pk->getColumns())=>$id);\r\n\t\t\t\t\t$dataLoaded = $this->loadFromQuery($data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from ID, but primary key contains multiple fields: '.$data);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new DBObjectException(get_class(),'Attempted to create '.get_class($this).' object from unexpected data: '.var_export($data,true).']');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Load Data\r\n\t\tif ($dataLoaded){\r\n\t\t\t$this->new = false;\r\n\t\t\t$this->hasChanged = false;\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t} else {\r\n\t\t\t$this->values = array();\r\n\t\t\tforeach ($this->definition->getColumns() as $name=>$column){\r\n\t\t\t\t$this->values[$name] = new SQLValue($column,$column->getDefaultValue());\r\n\t\t\t}\r\n\t\t\t$this->values = SQLQueryResultRow::wrap($this->values);\r\n\t\t\t\r\n\t\t\t// If a query was specified, but data has not been loaded from it because the record doesn't exist, load that information\r\n\t\t\tif (is_array($data)){\r\n\t\t\t\tforeach ($data as $field=>$value){\r\n\t\t\t\t\t$this->values[$field]->setValue($value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "abstract public function createTable();", "public function initTable(){\n\t\t\t\n\t\t}", "public static function createTable(){\n if (RBModel::recreateTable(get_called_class()) == false){\n return;\n }\n\n $bean = R::dispense( strtolower(get_called_class()));\n $fields = get_class_vars(get_called_class());\n \n foreach( $fields as $field=>$value){\n\n \n //ignora as variaveis que começam com _\n if ($field[0] == \"_\" || $field == \"id\"){\n continue;\n }\n\n $r = new ReflectionProperty(get_called_class(), $field);\n $comment = strtolower($r->getDocComment());\n\n if (strstr($comment,\"@varchar\")){\n $value = \"\";\n } else\n if (strstr($comment,\"@int\")){\n $value = 0;\n } else\n if (strstr($comment,\"@date\")){\n $value = \"1990-01-01\";\n } else\n if (strstr($comment,\"@datetime\")){\n $value = \"1990-01-01 00:00:00\";\n } else\n if (strstr($comment,\"@double\")){\n $value = 0.0;\n } else\n if (strstr($comment,\"@bool\")){\n $value = false;\n } else\n if (strstr($comment,\"@money\")){\n $value = \"10.00\";\n }\n \n \n $bean->$field = $value;\n }\n \n R::store($bean);\n R::trash($bean);\n }", "public function __construct($data, $tableName)\n\t{\n\t\t//set our table name...\n\t\t$this->tableName = $tableName;\n\n\t\t//omg noob... dont forget to load!\n\t\t$this->load($data);\n\t}", "function create_table($id, $data, $headers=[], $caption = \"\") {\n $table = \"<table id=\\\"$id\\\"><caption>$caption</caption>\";\n\n if (sizeof($headers) > 0) {\n $table .= add_row(create_headers($headers));\n }\n\n foreach($data as $vals) {\n $table .= add_row(create_row($vals));\n }\n\n $table .= \"</table>\";\n return $table;\n }", "public function createSchemaTable();", "public function newTable($name, $attr) {\n $t= new DBTable($name);\n foreach ($attr as $key => $definitions) {\n $t->attributes[]= new DBTableAttribute(\n $key,\n $definitions[0], // Type\n TRUE,\n FALSE,\n $definitions[1] // Length\n );\n }\n $t->indexes[]= new DBIndex(\n 'PRIMARY',\n array('deviceinfo_id')\n );\n $t->indexes[0]->unique= TRUE;\n $t->indexes[0]->primary= TRUE;\n $t->indexes[]= new DBIndex(\n 'deviceinfo_I_serial',\n array('serial_number')\n );\n return $t;\n }", "public function createRowTable($options = NULL) {\n $request = $this->getRequest();\n $params = $request->getParams();\n $table = $params['table'];\n //---------------------------\n\n if ($table == 'admin.blog_posts') {\n return new Default_Model_DbTable_BlogPost($this->db);\n }\n\n if ($table == 'admin.blog_posts_tags') {\n return new Default_Model_DbTable_BlogPostTag($this->db);\n }\n\n if ($table == 'admin.blog_posts_images') {\n return new Default_Model_DbTable_BlogPostImage($this->db);\n }\n\n if ($table == 'admin.blog_posts_audio') {\n return new Default_Model_DbTable_BlogPostAudio($this->db);\n }\n\n if ($table == 'admin.blog_posts_video') {\n return new Default_Model_DbTable_BlogPostVideo($this->db);\n }\n\n if ($table == 'admin.blog_posts_locations') {\n return new Default_Model_DbTable_BlogPostLocation($this->db);\n }\n }", "public static function buildTable($data)\r\n {\r\n $table = '<table class=\"table table-hover\">';\r\n // Create the table header row\r\n $header = '<tr>';\r\n foreach ( $data[ 0 ] as $key => $cell ) {\r\n $header .= '<th>' . $key . '</th>';\r\n }\r\n $header .= '</tr>';\r\n // Add the header to the table\r\n $table .= $header;\r\n // Build the table rows\r\n $rowHTML = '';\r\n // Loop through each row of data and build a row\r\n foreach ( $data as $row ) {\r\n $rowHTML .= '<tr>';\r\n // Loop through each cell and create the cells\r\n foreach ( $row as $cell ) {\r\n $rowHTML .= '<td>' . $cell . '</td>';\r\n }\r\n $rowHTML .= '</tr>';\r\n }\r\n // Add the rows to the table\r\n $table .= $rowHTML;\r\n // Close out the table\r\n $table .= '</table>';\r\n return $table;\r\n }", "public function createTable($code){\n\t\t$tableName = 'tcimport_populating_' . $code;\n\t\t$this->_table = $tableName;\n\n\t\t// $comment = 'Drop ' . $this->_table . ' table';\n\t\t// $sql = 'DROP TABLE IF EXISTS ' . $this->_table . ';';\n\t\t// $this->addQuery($sql, $comment);\n\n\t\t$comment = 'Create ' . $this->_table . ' table';\n\n\t\t$sql = $this->generateTable();\n\t\t$this->addQuery($sql, $comment);\n\n\t\treturn $this;\n\t}", "public function __construct() {\n\n $this->tableName = \"re_event_type\";\n $this->setColumnsInfo(\"id\", \"int(11)\", 0);\n $this->setColumnsInfo(\"name\", \"varchar(250)\", \"\");\n $this->setColumnsInfo(\"id_space\", \"int(11)\", 0);\n $this->primaryKey = \"id\";\n }", "public function __construct()\n\t\t{\n\t\t\t$this->_db_table = new Application_Model_DbTable_TourType();\n\t\t}" ]
[ "0.68280834", "0.664906", "0.6590249", "0.652532", "0.62810993", "0.6246316", "0.6195164", "0.61813045", "0.6162648", "0.61307395", "0.6108781", "0.60786545", "0.60666347", "0.60467005", "0.6043647", "0.60329276", "0.6025225", "0.6016322", "0.60160416", "0.601286", "0.6011447", "0.6008054", "0.6000826", "0.60000396", "0.59442586", "0.59405345", "0.5933121", "0.59274536", "0.592073", "0.59135985" ]
0.8152061
0
Gets the TableType with passed id
public static function get($id) { $savedTableTypes = ipGetOption(self::OPTION); if (!isset($savedTableTypes[$id])) { return null; } $tableTypeAsArray = $savedTableTypes[$id]; $id = $tableTypeAsArray['id']; $name = $tableTypeAsArray['name']; $language = $tableTypeAsArray['language']; $columnOption = $tableTypeAsArray['columnOption']; $specificColumns = $tableTypeAsArray['specificColumns']; return new TableType($id, $name, $language, $columnOption, $specificColumns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getType($id) {\n \n $this->loadTypes();\n \n foreach ($this->types as $type) {\n \n if ($type->getId() === $id) return $type;\n }\n \n return NULL;\n }", "protected function get_type_from_id($id)\n\t{\n\t\treturn $this->types->get($id);\n\t}", "public function getTABLENAMEById($id)\n {\n \t$id = (int) $id;\n \t$query = $this->getBdd()->prepare('SELECT * FROM TABLENAME WHERE id = :id');\n \t$query->bindValue('id', $id, PDO::PARAM_INT);\n \t$query->execute();\n }", "public static function getTypeName($id){\n return Types::findOne($id);\n }", "private function selectItemType($id)\n {\n $tables = array(\"desktops\" => \"DS\", \"laptops\" => \"LP\"); //this array stores the names of the tables in database\n\n $prefix = substr($id, 0, 2); //all of the product types have unique prefix\n\n return array_search($prefix, $tables);\n }", "public function type($id)\n {\n return $this->where('user_type_id', $id);\n }", "public function fetchFieldTypeFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('type', 0, \"SELECT `type` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\t}", "function getTypeName($id){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_id={$id}\", 'type_name');\n}", "public static function fetchFieldTypeFromID($id)\n {\n return Symphony::Database()->fetchVar('type', 0, sprintf(\"\n SELECT `type` FROM `tbl_fields` WHERE `id` = %d LIMIT 1\",\n $id\n ));\n }", "public function get_message_type_by_id($id)\n\t{\n\t\t$query = $this->db->get_where('message_type', array('message_type_id' => $id));\n\t\treturn $query;\n\t}", "public function getUserTypeById($id){\n\t\t\treturn $this->searchUserType('id', $id);\n\t\t}", "public function getServiceType($id) {\n $dql = \"SELECT s FROM ServiceType s\n WHERE s.id = :id\";\n\n $serviceType = $this->em\n ->createQuery($dql)\n ->setParameter('id', $id)\n ->getSingleResult();\n\n return $serviceType;\n }", "protected function getTypeName($id) {\n\t\t$beerType = M('beer_type', 'ac_')->where(array('id' => $id))->find();\n\t\treturn $beerType;\n\t}", "public function get_job_type_by_id($id){\n\t\t$query = $this->db->get_where('xx_job_type', array('id' => $id));\n\t\treturn $result = $query->row_array();\n\t}", "public static function _getTypeOfId($a_id)\n\t{\n\t\tglobal $ilias, $ilDB;\n\n\t\t$q = \"SELECT * FROM bookmark_data WHERE obj_id = \".\n\t\t\t$ilDB->quote($a_id, \"integer\");\n\t\t$bm_set = $ilDB->query($q);\n\t\tif ($ilDB->numRows($bm_set) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bm = $ilDB->fetchAssoc($bm_set);\n\t\t\treturn $bm[\"type\"];\n\t\t}\n\t}", "public function getAdType($id)\n {\n $query = \"SELECT ALL FROM adv_type WHERE id = $id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "public static function _getDatatypeForId($id)\n\t{\n\t\tswitch($id)\n\t\t{\n\t\t\tcase 'id':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_NUMBER;\n\t\t\tcase 'owner';\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_TEXT;\n\t\t\tcase 'create_date':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_DATETIME;\n\t\t\tcase 'last_edit_by':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_TEXT;\n\t\t\tcase 'table_id':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_NUMBER;\n\t\t\tcase 'last_update':\n\t\t\t\treturn ilDataCollectionDatatype::INPUTFORMAT_DATETIME;\n\t\t}\n\t\treturn NULL;\n\t}", "private function _getContentType( $id ){\n\t\t\n\t\tif( empty( $this->_type ) ){\n\t\t\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'c.*' );\n\t\t\t\n\t\t\t$query->from( '#__zbrochure_content_types AS c' );\n\t\t\t$query->where( 'c.content_type_id = '.$id );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_type = $this->_db->loadObject();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_type;\n\t\t\n\t}", "public function class_from_id($id)\n {\n $table = $this->return_table();\n $this->db->where(\"id\",$id);\n $query = $this->db->get($table);\n foreach ($query->result() as $key => $value) {\n $class = $value->class_name;\n return $class;\n }\n \n }", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)){\n $sql = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n if($result = $db->fetch_assoc($sql))\n return $result;\n else\n return null;\n }\n}", "function getResourceTypeName($id){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_id='$id'\", 'type_name');\n}", "public function findById($id, $table){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM $table WHERE id ='$id' ORDER BY id DESC\"); \n \t\t$query->execute();\n \t\treturn $query->fetch();\n\t\t}", "public function get_message_type($id)\n\t{\n\t\t$sql=\"SELECT * FROM message_type ORDER BY (`message_type_id` = $id) DESC\";\n\t\t$query=$this->db->query($sql);\n\t\treturn $query->result_object();\n\n\t}", "function get_booktype($id)\n {\n return $this->db->get_where('booktypes',array('id'=>$id))->row_array();\n }", "public static function get_table_item_by_id($id){\n\n return Setup::module_locations_item_by_id($id);\n\n }", "public function getType($id)\n {\n if (null === $id) {\n // The caller might call us using a row from database that contains\n // a strict null, it is useless for us to do any query since null\n // typed messages are valid by the MessageInterface signature\n return null;\n }\n\n if (null === $this->types) {\n $this->loadCache();\n }\n\n if (!isset($this->types[$id])) {\n // Someone may have created it before we loaded the cache\n $this->loadCache();\n\n if (!isset($this->types[$id])) {\n // It seems that the type really does not exists, mark it as\n // being wrong in order to avoid to refresh the cache too often\n // and return a null type\n $this->types[$type] = false;\n }\n }\n\n if (false === $this->types[$id]) {\n return null;\n } else {\n return $this->types[$id];\n }\n }", "public function getTable($id)\n\t{\n\t\tif(! intval( $id )){\n\t\t\treturn false;\n\t\t}\n\t\t$id=$this->db->real_escape_string($id);\n\t\t$sql= \"SELECT * FROM servicio_paquete WHERE id=$id;\";\n\t\t$res=$this->db->query($sql);\n\t\tif(!$res)\n\t\t\t{die(\"Error getting result servicio paquete\");}\n\t\t$row = $res->fetch_assoc();\n\t\t$res->close();\n\t\treturn $row;\n\t}", "function find_by_id($table,$id)\n{\n global $db;\n $id = (int)$id;\n if(tableExists($table)) \n {\n /*\n $sql_result = $db->query(\"SELECT * FROM {$db->escape($table)} WHERE id='{$db->escape($id)}' LIMIT 1\");\n */\n $sql = \"SELECT * FROM \".$db->escape($table);\n $sql .= \" WHERE id=\".$db->escape($id);\n $sql .= \" LIMIT 1\";\n $sql_result = $db->query($sql);\n if( $result = $db->fetch_assoc($sql_result) )\n return $result;\n else\n return NULL;\n }\n else\n return NULL;\n}", "function getDataType($connection, $idDataType){\n\t$query = \"SELECT * FROM tDataType WHERE idDataType =\".$idDataType;\n\treturn fetchRowFromDBOnID($connection, $query, $idDataType, \"DataType\");\n}", "function getTipo($id) {\n\t\t$stm = DB::prepare ( \"SELECT tipo FROM fornecedor WHERE id = :id\" );\n\t\t$stm->bindParam ( ':id', $id, PDO::PARAM_INT );\n\t\t$stm->execute ();\n\t\t$tipo = $stm->fetch ( PDO::FETCH_ASSOC );\n\t\treturn $tipo ['tipo'] == 1 ? 1 : 0;\n\t}" ]
[ "0.75106096", "0.7327219", "0.72103107", "0.6890211", "0.68465996", "0.6846289", "0.6547877", "0.648456", "0.6480464", "0.6437138", "0.6399817", "0.63463837", "0.6336722", "0.62903553", "0.6282421", "0.6262594", "0.62446076", "0.620985", "0.6200039", "0.61796373", "0.6065611", "0.6052272", "0.60498756", "0.60178244", "0.60071313", "0.59970725", "0.5986131", "0.59821504", "0.59547997", "0.5945388" ]
0.7720888
0
Gets all TableType as array
public static function getAllAsArray() { $savedTableTypes = ipGetOption(self::OPTION); $array = array(); foreach ($savedTableTypes as $savedTableType) { array_push($array, $savedTableType); } return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFieldtypesFromTable()\n {\n $used_fieldtypes = ee()->db->select('name')->order_by('name')->get('fieldtypes');\n\n return array_column($used_fieldtypes->result_array(), 'name');\n }", "public static function getAllFieldsWithTypes(): array\n {\n $className = get_called_class();\n $table = with(new $className)->getTable();\n\n\n $cache_key = self::$cache_prefix.'.ALLFIELDS.WITH.TYPES.' . strtoupper($table);\n\n return self::$use_cache ? Cache::remember($cache_key, 5 * 60, function () use ($table) {\n return self::getArrayTableInfo($table);\n }) : self::getArrayTableInfo($table);\n }", "abstract public function getTablesArray();", "public function getTypes(): array;", "public function getTypes(): array;", "public function getAllTypes() {\n\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(\n array('t' => 'NEWAGENTTYPELOOKUP')\n );\n $allTypes = $this->fetchAll($select);\n $returnVal = array();\n foreach ($allTypes as $typeRow) {\n $returnVal[$typeRow->NEWAGENTTYPELOOKUPID] = $typeRow->LABEL;\n }\n\n return $returnVal;\n }", "public function listAllType(){\n try {\n return $this->identityTypeGateway->getAllTypes();\n } catch (Exception $ex) {\n throw $ex;\n }catch (PDOException $e){\n throw $e;\n }\n }", "public function getAllTypes(){\n return $this->find()->asArray()->orderBy('typeDesc ASC')->all();\n }", "public function getAdtTypes()\n {\n $query = \"SELECT ALL FROM adv_type\";\n return $this->getQueryData($query, $this->getConnection());\n }", "protected function getTableTypes(): array\n {\n // are not detected unless the corresponding table type flag is added.\n /*if (DatabaseUtil.checkDatabaseType(DbSqlSessionFactory.POSTGRES)) {\n return PG_DBC_METADATA_TABLE_TYPES;\n }\n return DBC_METADATA_TABLE_TYPES;*/\n return self::PG_DBC_METADATA_TABLE_TYPES;\n }", "public function getAllType()\n {\n $q=\"SELECT type_id FROM `status`\";\n $result = $this->fetchAll($q);\n return $result;\n }", "public function getTypes(): array\n {\n return $this->map(static function (DataSetColumn $column) {\n return $column->getType();\n })->toArray();\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "function getRTypesArray(){\n $STH = sqlSelect(\"SELECT * FROM types\");\n $returnArray = Array();\n while($row = $STH->fetch()) {\n $rtype = Array();\n $rType['type_id'] = $row['type_id'];\n $rType['type_name'] = $row['type_name'];\n $returnArray[] = $rType;\n }\n\n return $returnArray;\n}", "public function getAllTabelas() {\n \t$sql = \"select\n \t\t\t\t\ttable_name,\n \t\t\t\t\ttable_schema\n\t\t\t\tfrom\n\t\t\t\t\tINFORMATION_SCHEMA.TABLES\n\t\t\t\twhere\n\t\t\t\t\tTABLE_TYPE = 'BASE TABLE'\";\n \t\n \t$this->execute($sql);\n \t$aDados = array();\n \twhile ($aReg = $this->fetchReg()){\n \t\t$aDados[] = $aReg;\n \t}\n \treturn $aDados;\n }", "protected static function _getDataTypes()\n {\n return [];\n }", "public function getAllTypes()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTypes()\n );\n }", "public function getAllTypes()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTypes()\n );\n }", "function getAll( )\n {\n $this->dbInit(); \n $phone_type_array = 0;\n \n array_query( $phone_type_array, \"SELECT * FROM PhoneType\" );\n \n return $phone_type_array;\n }", "public function getTableList()\n\t{\n\t\treturn [];\n\t}", "public function get_if_types()\n {\n $this->db->from('oid__iftype');\n $this->db->where('active', 1);\n $this->db->order_by('id', 'ASC');\n $query = $this->db->get();\n return $query->result_array();\n }", "public function all()\n {\n return $this->type->all();\n }", "public function getTypes()\n {\n $oDb = Factory::service('Database');\n $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE \"type\"')->row();\n $sTypes = $oResult->Type;\n $sTypes = preg_replace('/enum\\((.*)\\)/', '$1', $sTypes);\n $sTypes = str_replace(\"'\", '', $sTypes);\n $aTypes = explode(',', $sTypes);\n\n $aOut = [];\n\n foreach ($aTypes as $sType) {\n $aOut[$sType] = ucwords(strtolower($sType));\n }\n\n return $aOut;\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public static function all(){\n\n\t\t//Connection to DB\n\t\t$db = $_COOKIE[\"db\"];\n\n\t\t//Fields\n\t\t$sql = \"SELECT * FROM company_types\";\n\n\t\t//Query\n\t\t$statement = $db->prepare($sql);\n\n\t\t//SET FETCH MODE\n\t\t$statement->setFetchMode(PDO::FETCH_ASSOC);\n\n\t\t//EXECUTE\n\t\t$statement->execute();\n\n\n\t\treturn $statement->fetchAll();\n\t}", "public function getSkuTypes ()\n {\n\n $this->db->select( '*' );\n $query = $this->db->get( 'tbld_sku_type' )->result_array();\n return $query;\n }", "public function getFieldTypeClasses() : array\n {\n return [TableType::class];\n }" ]
[ "0.77058834", "0.7433899", "0.7147784", "0.7145039", "0.7145039", "0.7125032", "0.7109778", "0.7087858", "0.70765835", "0.7067415", "0.7053062", "0.6954229", "0.6949877", "0.69330084", "0.6826442", "0.6773978", "0.67699516", "0.67699516", "0.67220426", "0.6717577", "0.6709629", "0.6706245", "0.6705408", "0.67029876", "0.67029876", "0.67029876", "0.67029876", "0.66895014", "0.66729414", "0.6672787" ]
0.8235226
0
Gets the column option
public function getColumnOption() { return $this->_columnOption; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function columnOptions() {\n\t\treturn $this->columnNames;\n\t}", "public function getColumn() { return $this->column; }", "public function getCol()\n {\n return $this->col;\n }", "public function getColumn(): string\n {\n return $this->_column;\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumna() {\n return $this->columna;\n }", "public function getColumn(): string;", "public function getColumnConfig();", "public function getUpdateColumn()\n {\n return $this->select_list;\n }", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "public function getColumns()\n {\n return $this->select_list;\n }", "protected function getWhereColumn()\n {\n $table = $this->getDoctrineTable();\n \n if ($this->getOption('column'))\n {\n return $table->getColumnName($this->getOption('column'));\n }\n\n $identifier = (array) $table->getIdentifier();\n $columnName = current($identifier);\n\n return $table->getColumnName($columnName);\n }", "public function getSortColumn();", "public function getSqlCol()\n {\n return $this->sqlCol;\n }", "public function getAdminColumnOptions() {\n $options = $this->getEol();\n $options .= $this->getPadding(3);\n $options .= \"'type'=> 'date',\".$this->getEol();\n return $options;\n }", "public function getDataColumn()\n {\n return $this->dataColumn;\n }", "public function column() : int\n {\n return $this->column;\n }", "public function options(): ?array\n {\n return $this->column->options();\n }", "protected function get_column() {\n\n\t\t$column = $this->foreign_column ?: $this->foreign_table->get_primary_key();\n\t\t$columns = $this->foreign_table->get_columns();\n\n\t\treturn $columns[ $column ];\n\t}", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "protected function findColumn($field_name) {\n //\\Drupal::logger('field_validation')->notice('1234:' . $field_name);\n $column_options = array(\n '' => t('- Select -'),\n );\n\tif(empty($field_name)){\n\t return $column_options;\n\t}\n\t$entity_type_id = $this->fieldValidationRuleSet->getAttachedEntityType();\n\t$field_info = \\Drupal\\field\\Entity\\FieldStorageConfig::loadByName($entity_type_id, $field_name);\n\t$schema = $field_info->getSchema();\n\t// \\Drupal::logger('field_validation')->notice('1234:' . var_export($schema, true));\n\tif(!empty($schema['columns'])){\n\t $columns = $schema['columns'];\n\t foreach($columns as $key=>$value){\n\t $column_options[$key] = $key;\n\t }\n\t}\n return $column_options;\n }", "function column(){\n\t\t$column_array = array(\n\t\t\t\t0 => 'A.date_add',//default order sort\n\t\t\t\t1 => 'A.po_number',\n\t\t\t\t2 => 'A.po_date',\n\t\t\t\t3 => 'B.nama_supplier',\t\t\n\t\t\t\t4 => 'A.state_received',\t\n\t\t\t\t5 => 'A.active',\t\n\t\t\t\t6 => 'A.add_by',\n\t\t\t\t7 => 'A.date_add',\n\t\t);\n\t\treturn $column_array;\n\t}", "public static function getColumnOptions()\n {\n return array(\n TableType::SHOW_ALL_COLUMNS => array('name' => __('Show all columns and their headings', 'DataTableWidget-admin', false), 'isColumnFilter' => false),\n TableType::SHOW_SPECIFIC_COLUMNS => array('name' => __('Show specific columns and/or different headings', 'DataTableWidget-admin', false), 'isColumnFilter' => true)\n );\n }", "public function getColumnModel();", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "public function getColumns()\n {\n return array_flip($this->model->getStream()->view_options);\n }", "public function getSpecificColumns()\n {\n return $this->_specificColumns;\n }" ]
[ "0.7636754", "0.739783", "0.72817713", "0.7269705", "0.72654325", "0.72456485", "0.7244181", "0.7244181", "0.7160969", "0.7021225", "0.69906497", "0.6934737", "0.68375427", "0.6815397", "0.679447", "0.67125654", "0.6687637", "0.66455877", "0.6604395", "0.6595849", "0.6549956", "0.65402025", "0.64744383", "0.6471587", "0.64637345", "0.6457966", "0.64458776", "0.6397097", "0.63924557", "0.6389549" ]
0.8929812
0
Resolves a new service for the given model.
public function resolveService($model) { return parent::resolveService($model); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function resolveService();", "public function resolve()\n {\n if (!isset($this->model)) {\n throw new Exception('Unable to resolve service - model or model classname is not set.');\n }\n\n // If the model property is a string classname of a model, or if the resolved \n // service is `NULL` we'll attempt to return the default service.\n if (is_string($this->model) || is_null($service = $this->resolveService())) {\n return $this->defaultService();\n }\n\n // If we're here, then the model is not a string and the function `resolveService` \n // did resolve a service (and not NULL). We'll jut return what was resolved.\n return $service;\n }", "public function resolve(ModelInformationInterface $information);", "public function defaultService()\n {\n $model = isset($this->model) ? $this->model : ''; \n $model = is_string($this->model) ? $this->model : get_class($this->model);\n\n throw new BindingResolutionException('No service registered for the model ' . $model);\n }", "public function resolve($label)\n {\n\n if ($service = $this->get($label)) {\n if (is_string($service)) {\n return new $service();\n }\n\n if ($service instanceof Closure) {\n return $service($this);\n }\n\n if (is_object($service) && !($service instanceof Closure)) {\n return $service;\n }\n }\n\n if (class_exists($label)) {\n return new $label();\n }\n\n throw new BindingResolutionException(\"$label could not be resolved\", 500);\n }", "abstract public function resolveById($id);", "private function transformModel(Model $model, $resource){\n $transform = new $resource($model);\n\n return $transform;\n }", "public function getService($modelName) {\n\t\t$id = 'sly-service-model-'.$modelName;\n\n\t\tif (!$this->has($id)) {\n\t\t\t$className = 'sly_Service_'.$modelName;\n\n\t\t\tif (!class_exists($className)) {\n\t\t\t\tthrow new sly_Exception(t('service_not_found', $modelName));\n\t\t\t}\n\n\t\t\t$service = new $className();\n\t\t\t$this->set($id, $service);\n\t\t}\n\n\t\treturn $this->get($id);\n\t}", "public function find(string $id): ServiceHolder;", "public function manager($model) {\n $namespaceModel = 'App\\Model\\\\' . $model;\n return new $namespaceModel(); \n }", "protected function resolveModel()\n {\n if (!\\method_exists($this, 'model')) {\n throw new NoModelDefined('No model defined');\n }\n\n return app()->make($this->model()); //make model\n }", "public function consumeModel(Model $model);", "private function resolve($name, $id)\n {\n $class = \"\\\\App\\\\Models\\\\{$name}\";\n return (new $class)->findOrFail($id);\n }", "abstract protected function getService($id);", "protected function resolve(ConnectionModel $connectionModel)\n {\n $config = $connectionModel->getAttributes();\n $config['host'] = $connectionModel->host->address;\n\n return $this->getConnector($config['driver'])\n ->connect($config);\n }", "public function resolve($resource, $type = null);", "protected function getRouting_ResolverService()\n {\n return $this->services['routing.resolver'] = new \\phpbb\\routing\\loader_resolver(${($_ = isset($this->services['routing.loader.collection']) ? $this->services['routing.loader.collection'] : $this->getRouting_Loader_CollectionService()) && false ?: '_'});\n }", "protected function getController_ResolverService()\n {\n return $this->services['controller.resolver'] = new \\phpbb\\controller\\resolver($this, './../', ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "protected function getModelServiceFromConfig(array $config, ServiceLocatorInterface $services)\n {\n if ($services->get('Matryoshka\\Model\\ModelManager')->has($config['model'])) {\n return $services->get('Matryoshka\\Model\\ModelManager')->get($config['model']);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to create instance for service \"%s\"',\n $config['model']\n )\n );\n }", "public function make($service)\n {\n if (! isset($this->services[$service])) {\n throw new \\BadMethodCallException(\"{$method} is not a supported Plaid service.\");\n }\n\n // If we already have an instance, then just return it\n if ( isset($this->instances[$service]) ) {\n return $this->instances[$service];\n }\n\n // Otherwise, create it, save it, & return it\n return $this->instances[$service] = new $this->services[$service]($this->request);\n }", "protected function resourceService(){\n return new $this->resourceService;\n }", "public function resolve(Job $job);", "abstract public function resolve();", "public function transform(Model $model): EntityInterface;", "public function getOne($id)\n {\n return ServiceModel::findOrFail($id);\n }", "public static function getNew($model, $ttl = self::DEFAULT_TTL){\n $class = null;\n\n $model = '\\\\' . __NAMESPACE__ . '\\\\' . $model;\n if(class_exists($model)){\n $class = new $model( null, null, null, $ttl );\n }else{\n throw new \\Exception(sprintf(self::ERROR_INVALID_MODEL_CLASS, $model));\n }\n\n return $class;\n }", "public function resolve(string $className): object;", "public function resolve($resource);", "protected function getModelResolvingScope()\n\t{\n\t\tif (interface_exists(\\Illuminate\\Database\\Eloquent\\ScopeInterface::class)) {\n\t\t\t// Laravel 5.0 to 5.1\n\t\t\treturn new ResolveModelLegacyScope($this);\n\t\t}\n\n\t\treturn new ResolveModelScope($this);\n\t}", "protected function getForm_ResolvedTypeFactoryService()\n {\n return $this->services['form.resolved_type_factory'] = new \\Symfony\\Component\\Form\\ResolvedFormTypeFactory();\n }" ]
[ "0.69039714", "0.68657833", "0.6033256", "0.57936436", "0.5316076", "0.52972704", "0.5268993", "0.52398044", "0.5160056", "0.5088969", "0.5053547", "0.502932", "0.5019786", "0.49518603", "0.4941856", "0.49017918", "0.48994035", "0.48932478", "0.48880196", "0.4866832", "0.4856636", "0.47959965", "0.47866786", "0.47853318", "0.47836646", "0.47679633", "0.47572044", "0.47513044", "0.47439626", "0.4741" ]
0.82937795
0
Verifie si le formulaire est rempli
function formulaire_rempli(){ return isset($_POST['titre'], $_POST['contenu']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFormula($row, $column) {\n\t}", "public function isRelawan();", "function ods_recover_formula(){\n /*\n * mark numbers of row\n */\n \n /*\n * get cells with formula\n */\n \n /*\n * check attribute\n * table:formula=\"of:=[.E10]*[.D10]\" \n * ^^ ^^\n * This row number need to check\n */\n }", "function formulaireValider(){\n\n\tuserInscritionFormulaire();\n\n}", "public function testFormula()\n {\n $distance = new Distance();\n $distance->setFormula('vincenty');\n\n $this->assertEquals('vincenty', $distance->getFormula());\n }", "function qtype_calculated_find_formula_errors($formula) {\n/// Returns false if everything is alright.\n/// Otherwise it constructs an error message\n // Strip away dataset names\n while (ereg('\\\\{[[:alpha:]][^>} <{\"\\']*\\\\}', $formula, $regs)) {\n $formula = str_replace($regs[0], '1', $formula);\n }\n\n // Strip away empty space and lowercase it\n $formula = strtolower(str_replace(' ', '', $formula));\n\n $safeoperatorchar = '-+/*%>:^~<?=&|!'; /* */\n $operatorornumber = \"[$safeoperatorchar.0-9eE]\";\n\n\n while (ereg(\"(^|[$safeoperatorchar,(])([a-z0-9_]*)\\\\(($operatorornumber+(,$operatorornumber+((,$operatorornumber+)+)?)?)?\\\\)\",\n $formula, $regs)) {\n\n switch ($regs[2]) {\n // Simple parenthesis\n case '':\n if ($regs[4] || strlen($regs[3])==0) {\n return get_string('illegalformulasyntax', 'quiz', $regs[0]);\n }\n break;\n\n // Zero argument functions\n case 'pi':\n if ($regs[3]) {\n return get_string('functiontakesnoargs', 'quiz', $regs[2]);\n }\n break;\n\n // Single argument functions (the most common case)\n case 'abs': case 'acos': case 'acosh': case 'asin': case 'asinh':\n case 'atan': case 'atanh': case 'bindec': case 'ceil': case 'cos':\n case 'cosh': case 'decbin': case 'decoct': case 'deg2rad':\n case 'exp': case 'expm1': case 'floor': case 'is_finite':\n case 'is_infinite': case 'is_nan': case 'log10': case 'log1p':\n case 'octdec': case 'rad2deg': case 'sin': case 'sinh': case 'sqrt':\n case 'tan': case 'tanh':\n if ($regs[4] || empty($regs[3])) {\n return get_string('functiontakesonearg','quiz',$regs[2]);\n }\n break;\n\n // Functions that take one or two arguments\n case 'log': case 'round':\n if ($regs[5] || empty($regs[3])) {\n return get_string('functiontakesoneortwoargs','quiz',$regs[2]);\n }\n break;\n\n // Functions that must have two arguments\n case 'atan2': case 'fmod': case 'pow':\n if ($regs[5] || empty($regs[4])) {\n return get_string('functiontakestwoargs', 'quiz', $regs[2]);\n }\n break;\n\n // Functions that take two or more arguments\n case 'min': case 'max':\n if (empty($regs[4])) {\n return get_string('functiontakesatleasttwo','quiz',$regs[2]);\n }\n break;\n\n default:\n return get_string('unsupportedformulafunction','quiz',$regs[2]);\n }\n\n // Exchange the function call with '1' and then chack for\n // another function call...\n if ($regs[1]) {\n // The function call is proceeded by an operator\n $formula = str_replace($regs[0], $regs[1] . '1', $formula);\n } else {\n // The function call starts the formula\n $formula = ereg_replace(\"^$regs[2]\\\\([^)]*\\\\)\", '1', $formula);\n }\n }\n\n if (ereg(\"[^$safeoperatorchar.0-9eE]+\", $formula, $regs)) {\n return get_string('illegalformulasyntax', 'quiz', $regs[0]);\n } else {\n // Formula just might be valid\n return false;\n }\n\n}", "function formulaires_abosympa_verifier_dist(){\n\t$erreurs = array();\n\n\t// recuperation des valeurs du formulaire\n\t$nom = _request('nom');\n\t$email = _request('email');\n\t$listes = _request('listes', true);\n\t$abonnement = _request('abonnement');\n\t$desabonnement = _request('desabonnement');\n\n\t// Faire une fonction de verif sur le mail pour validite\n\n\tif($email == ''){\n\t\t$erreurs['erreur_email'] = _T(\"soapsympa:email_oublie\");\n\t}\n\telse{\n\t\tinclude_spip('inc/filtres'); # pour email_valide()\n\t\tif (!email_valide($email)){\n\t\t\t$erreurs['email'] = _T(\"form_email_non_valide\");\n\t\t}\n\t\telse{\n\t\t\tspip_log(\"Email = $email;\",\"soapsympa\");\n\t\t\t\n\t\t}\n\t}\n\n\tif(empty($listes)){\n\t\t$erreurs['listes'] = _T(\"soapsympa:choisir_liste\");\n\t}\n\n //message d'erreur generalise\n if (count($erreurs)) {\n $erreurs['message_erreur'] .= _T('soapsympa:verifier_formulaire');\n }\n\n return $erreurs; // si c'est vide, traiter sera appele, sinon le formulaire sera ressoumis\n}", "function OBTENER_FORMULA($_ARGS) {\r\n\t$sql = \"SELECT Formula FROM pr_concepto WHERE CodConcepto = '\".$_ARGS['CONCEPTO'].\"'\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\tif (mysql_num_rows($query) != 0) {\r\n\t\t$field = mysql_fetch_array($query);\r\n\t\treturn $field['Formula'];\r\n\t} else return \"\";\r\n}", "public function calculateValuation(): bool\n {\n return 0;\n }", "function isValid() ;", "function qtype_calculatedformat_find_formula_errors($formula) {\n // Returns false if everything is alright\n // otherwise it constructs an error message.\n // Strip away dataset names.\n while (preg_match('~\\\\{[[:alpha:]][^>} <{\"\\']*\\\\}~', $formula, $regs)) {\n $formula = str_replace($regs[0], '1', $formula);\n }\n\n // Strip away empty space and lowercase it.\n $formula = strtolower(str_replace(' ', '', $formula));\n\n $safeoperatorchar = '-+/*%>:^\\~<?=&|!'; /* */\n $operatorornumber = \"[$safeoperatorchar.0-9a-fA-F_bodxBODX]\";\n\n while (preg_match(\"~(^|[$safeoperatorchar,(])([a-z0-9_]*)\" .\n \"\\\\(($operatorornumber+(,$operatorornumber+((,$operatorornumber+)+)?)?)?\\\\)~\",\n $formula, $regs)) {\n switch ($regs[2]) {\n // Simple parenthesis.\n case '':\n if ((isset($regs[4]) && $regs[4]) || strlen($regs[3]) == 0) {\n return get_string('illegalformulasyntax', 'qtype_calculatedformat', $regs[0]);\n }\n break;\n\n // Zero argument functions.\n case 'pi':\n if ($regs[3]) {\n return get_string('functiontakesnoargs', 'qtype_calculatedformat', $regs[2]);\n }\n break;\n\n // Single argument functions (the most common case).\n case 'abs': case 'acos': case 'acosh': case 'asin': case 'asinh':\n case 'atan': case 'atanh': case 'bindec': case 'ceil': case 'cos':\n case 'cosh': case 'decbin': case 'decoct': case 'deg2rad':\n case 'exp': case 'expm1': case 'floor': case 'is_finite':\n case 'is_infinite': case 'is_nan': case 'log10': case 'log1p':\n case 'octdec': case 'rad2deg': case 'sin': case 'sinh': case 'sqrt':\n case 'tan': case 'tanh':\n if (!empty($regs[4]) || empty($regs[3])) {\n return get_string('functiontakesonearg', 'qtype_calculatedformat', $regs[2]);\n }\n break;\n\n // Functions that take one or two arguments.\n case 'log': case 'round':\n if (!empty($regs[5]) || empty($regs[3])) {\n return get_string('functiontakesoneortwoargs', 'qtype_calculatedformat', $regs[2]);\n }\n break;\n\n // Functions that must have two arguments.\n case 'atan2': case 'fmod': case 'pow':\n if (!empty($regs[5]) || empty($regs[4])) {\n return get_string('functiontakestwoargs', 'qtype_calculatedformat', $regs[2]);\n }\n break;\n\n // Functions that take two or more arguments.\n case 'min': case 'max':\n if (empty($regs[4])) {\n return get_string('functiontakesatleasttwo', 'qtype_calculatedformat', $regs[2]);\n }\n break;\n\n default:\n return get_string('unsupportedformulafunction', 'qtype_calculatedformat', $regs[2]);\n }\n\n // Exchange the function call with '1' and then check for\n // another function call...\n if ($regs[1]) {\n // The function call is proceeded by an operator.\n $formula = str_replace($regs[0], $regs[1] . '1', $formula);\n } else {\n // The function call starts the formula.\n $formula = preg_replace(\"~^$regs[2]\\\\([^)]*\\\\)~\", '1', $formula);\n }\n }\n\n if (preg_match(\"~[^$safeoperatorchar.0-9a-fA-F_bdoxBDOX]+~\", $formula, $regs)) {\n return get_string('illegalformulasyntax', 'qtype_calculatedformat', $regs[0]);\n } else {\n // Formula just might be valid.\n return false;\n }\n}", "function modificarFormula(){\r\n\t\t$this->procedimiento='vef.ft_formula_v2_ime';\r\n\t\t$this->transaccion='VF_FORMULAV2_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_formula','id_formula','int4');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('nombre','nombre','varchar');\r\n\t\t$this->setParametro('descripcion','descripcion','text');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function test($marca){\n\t\t//return FALSE;\n\t\treturn true;\n\t}", "public function tieneReceta()\n {\n if (!is_null($this->receta)) {\n return true;\n }\n\n return false;\n }", "function isFallo();", "public function isReal(): bool;", "function consultarMatriculas($cod_estudiante){\r\n $cadena_sql = $this->sql->cadena_sql(\"matriculas\", $cod_estudiante);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado;\r\n }", "public function VanMegLapAPakliban():bool\r\n {\r\n return ($this->getLapokSzama()>0);\r\n }", "function checkOblig(&$falta, &$f, $oblig) {\r\n# versio obligatoris en formulari\r\n foreach (explode(\"#\", $oblig) as $cm) {\r\n if (!$f[$cm])\r\n $falta[$cm][] = 'oblig';\r\n }\r\n return count($falta);\r\n}", "function isValid();", "public function isMandatory_correct() {\n\t\t$this->getMandatory_correct();\n\t}", "function existenNotasRegistradas($matricula){\n return false;\n }", "public function testInvalidFormula()\n {\n $distance = new Distance();\n\n $distance->setFormula('Leonardo');\n }", "function Comprobar_atributos()\n{\n\t//si se cumple la condicion\n\tif ($this->Comprobar_codedificio() &\n\t\t$this->Comprobar_nombreedificio() &\n\t\t$this->Comprobar_direccionedificio() &\n\t\t$this->Comprobar_campusedificio()\n\t\t)\n\t{\n\t\treturn true;\n\t}\n\t//si no\n\telse\n\t\t{\n\t\t\treturn $this->erroresdatos;\n\t\t}\n}", "public function totalRegistros();", "public function calculateProfit(): bool\n {\n return true;\n }", "function valida_ingreso_ambulatorio_modo_1($id_comprobante,$prestacion,$cantidad){\n\t$query=\"select codigo from facturacion.nomenclador \n\t\t\twhere id_nomenclador='$prestacion'\";\t \n\t$res_codigo_nomenclador=sql($query, \"Error 1\") or fin_pagina();\t\n\t$codigo=$res_codigo_nomenclador->fields['codigo'];\n\t\n\tif(trim($codigo) == 'CT-C021'){\n\t\t//debo saber si alguna vez se al facturo beneficiario el \"CT-C020\"\n\t\t\n\t\t//traigo el id_smiafiliados para buscar el codigo \"CT-C020\"\n\t\t$query=\"select id_smiafiliados from facturacion.comprobante \n\t\t\t\twhere id_comprobante='$id_comprobante'\";\t \n\t\t$res_codigo_nomenclador=sql($query, \"Error 1\") or fin_pagina();\t\n\t\t$id_smiafiliados=$res_codigo_nomenclador->fields['id_smiafiliados'];\n\t\t\n\t\t//busco el codigo \"CT-C020\"\n\t\t$query=\"SELECT id_prestacion\t\t\t\t\n\t\t\t\tFROM nacer.smiafiliados\n \t\t\t\tINNER JOIN facturacion.comprobante ON (nacer.smiafiliados.id_smiafiliados = facturacion.comprobante.id_smiafiliados)\n \t\t\t\tINNER JOIN facturacion.prestacion ON (facturacion.comprobante.id_comprobante = facturacion.prestacion.id_comprobante)\n \t\t\t\tINNER JOIN facturacion.nomenclador ON (facturacion.prestacion.id_nomenclador = facturacion.nomenclador.id_nomenclador)\n \t\t\t\twhere smiafiliados.id_smiafiliados='$id_smiafiliados' and codigo='CT-C020'\";\n \t\t$cant_pres=sql($query, \"Error 3\") or fin_pagina();\n \t\tif ($cant_pres->RecordCount()>=1)return 1;\n \t\telse return 0;\n\t}\n\telse return 1;\n}", "function eliminarFormula(){\r\n\t\t$this->procedimiento='vef.ft_formula_v2_ime';\r\n\t\t$this->transaccion='VF_FORMULAV2_ELI';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_formula','id_formula','int4');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public static function Znevalidni_kolize_ucastnika_formulare($iducast,$formular) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table left join s_typ_kolize on (s_typ_kolize.id_s_typ_kolize = uc_kolize_table.id_s_typ_kolize_FK) \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and s_typ_kolize.formular='\" . $formular . \"' and uc_kolize_table.valid\" ;\r\n \r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika_formulare: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute();\r\n \r\n while($zaznam_kolize = $sth->fetch()) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}", "public function isMatriculationFNINormal(): bool\n {\n $pattern = '^(?!0)(?:(?:[0-9]{1,4}(?:\\s|-)?(?![DIOW])[A-Z])|(?:[0-9]{1,4}(?:\\s|-)?(?!SS|TT|WW)[A-HJ-NP-Z]{2})|(?:[0-9]{1,3}(?:\\s|-)?(?!T|W|KKK|MMM|MMW|MWM|MWW)[A-HJ-NP-Z]{3}))(?:\\s|-)?(?!20)(?:97[1-6]|0[1-9]|[1-8][0-9]|9[0-5]|2[AB])$';\n\n return 1 === preg_match('/'.$pattern.'/i', $this->matriculation);\n }" ]
[ "0.6390007", "0.6372311", "0.6205228", "0.6088564", "0.6018214", "0.60071427", "0.5975724", "0.58397764", "0.57558274", "0.5691425", "0.56615037", "0.5647205", "0.55935895", "0.5576928", "0.5511693", "0.54940104", "0.5471909", "0.54523015", "0.5449452", "0.5434146", "0.5315542", "0.5309382", "0.5308172", "0.53068733", "0.52793205", "0.5274805", "0.5272809", "0.5261163", "0.52606833", "0.5254271" ]
0.6948553
0
Test inactive status when there is single admin present.
public function testAdminInactiveStatusWithSingleAdmin(FunctionalTester $I): void { /** * Logged in user. */ $admin = $I->loginAsAdmin(); /** * Change the status. */ $this->proceedToChangeStatus($I, $admin); /** * Current route should be user listing page. */ $I->seeCurrentRouteIs('admin.users.index'); /** * Grabbed latest record. */ $latestRecord = $I->grabRecord(Admin::class, [ 'id' => $admin->id, ]); /** * Assertion. */ $I->assertEquals(1, $latestRecord->status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAdminInactiveStatusWhenMoreAdminsPresent(FunctionalTester $I): void\n {\n /**\n * Logged in user.\n */\n $I->loginAsAdmin();\n\n /**\n * Created one more admin so that status get changed.\n */\n $anotherAdmin = $I->have(Admin::class);\n\n /**\n * Change the status.\n */\n $this->proceedToChangeStatus($I, $anotherAdmin);\n\n /**\n * Current route should be user listing page.\n */\n $I->seeCurrentRouteIs('admin.users.index');\n\n /**\n * Grabbed latest record.\n */\n $latestRecord = $I->grabRecord(Admin::class, [\n 'id' => $anotherAdmin->id,\n ]);\n\n /**\n * Assertion.\n */\n $I->assertEquals(0, $latestRecord->status);\n }", "public static function requireAdmin() {\n\t$status = (Yii::$app->user->identity->roles == 'admin') ? true : false;\n return $status\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "public function isAdmin(){\n if($this->role->name == 'Administrator' && $this->is_active == 1){\n return true;\n }\n return false;\n }", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function is_inactive(): bool;", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }", "public function CheckAdminStatus()\n {\n if (!$this->IsAuth() || $this->mUserInfo['IsAdmin'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "public function adminUserConditionMatchesAdminUser() {}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "function is_admin()\n\t{\n\t\treturn strtolower($this->ci->session->userdata('DX_role_name')) == 'admin';\n\t}", "function checkUserIsAdmin()\n {\n $user_db = new SafeMySQL();\n\n $user_id = htmlentities($_SESSION[SES_NAME]['user_id'], ENT_QUOTES, 'UTF-8');\n\n if($user_db->getRow(\"SELECT user_id FROM app_users WHERE user_status = 'Active' AND user_id = ?s\",$user_id)){\n return true;\n } else {\n return false;\n }\n\n }", "public function checkAdmin();", "public function isAdmin() {}", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "public function isAdmin()\n {\n return $this->role == 1;\n }", "public function isAdmin()\n {\n return $this->hasCredential('admin');\n }", "public function getIsAdministrator() {}", "public function isAdmin(): bool\n {\n return $this->is_admin === true;\n }", "public function checkIsAdmin() {\n\t\treturn Mage::getSingleton('admin/session')->isLoggedIn();\n\t}", "public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }", "function is_admin() {\n\tif(\n\t\tisset($_SESSION['admin']->iduser) \n\t\t&& !empty($_SESSION['admin']->iduser) \n\t\t&& $_SESSION['admin']->type = 'admin'\n\t\t&& $_SESSION['active']->type = 1\n\t\t&& $_SESSION['confirmed']->type = 1\n\t) return TRUE;\n\t\t\t\n\treturn FALSE;\n}", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}" ]
[ "0.754551", "0.7070818", "0.7006946", "0.6915998", "0.68572605", "0.678983", "0.67580277", "0.67565525", "0.67352396", "0.67244214", "0.67062205", "0.66878736", "0.6681118", "0.6670979", "0.6659999", "0.6659225", "0.66304135", "0.6613148", "0.661258", "0.6601176", "0.65946716", "0.65909374", "0.6580224", "0.6571717", "0.6570645", "0.65547115", "0.6547387", "0.65452135", "0.654447", "0.6543579" ]
0.7658518
0
Test inactive status when there are more admins present.
public function testAdminInactiveStatusWhenMoreAdminsPresent(FunctionalTester $I): void { /** * Logged in user. */ $I->loginAsAdmin(); /** * Created one more admin so that status get changed. */ $anotherAdmin = $I->have(Admin::class); /** * Change the status. */ $this->proceedToChangeStatus($I, $anotherAdmin); /** * Current route should be user listing page. */ $I->seeCurrentRouteIs('admin.users.index'); /** * Grabbed latest record. */ $latestRecord = $I->grabRecord(Admin::class, [ 'id' => $anotherAdmin->id, ]); /** * Assertion. */ $I->assertEquals(0, $latestRecord->status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAdminInactiveStatusWithSingleAdmin(FunctionalTester $I): void\n {\n /**\n * Logged in user.\n */\n $admin = $I->loginAsAdmin();\n\n /**\n * Change the status.\n */\n $this->proceedToChangeStatus($I, $admin);\n\n /**\n * Current route should be user listing page.\n */\n $I->seeCurrentRouteIs('admin.users.index');\n\n /**\n * Grabbed latest record.\n */\n $latestRecord = $I->grabRecord(Admin::class, [\n 'id' => $admin->id,\n ]);\n\n /**\n * Assertion.\n */\n $I->assertEquals(1, $latestRecord->status);\n }", "static function countAdministrators() {\n return Users::count(\"type = 'Administrator' AND state = '\" . STATE_VISIBLE . \"'\");\n }", "public function isAdministrator(){\n return $this->roles->where('role', 'admin')->count();\n }", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "public function adminUserConditionMatchesAdminUser() {}", "public function validateAdminUserAction()\n {\n $id = $this->_request->getParam('user_id');\n if ($id) {\n $limited = $this->_collectionsFactory->create()->getUsersOutsideLimitedScope(\n $this->_role->getIsAll(),\n $this->_role->getWebsiteIds(),\n $this->_role->getStoreGroupIds()\n );\n\n if (in_array($id, $limited)) {\n $this->_forward();\n return false;\n }\n }\n return true;\n }", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "function iAmAdmin(){\n $adminIDs = Array( 1, 2 );\n \n return in_array( $_SESSION['userid'], $adminIDs );\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function isAdministrator() {\n\t $adminuserId = Mage::getSingleton('admin/session')->getUser()->getUserId();\t \n\t $role_data = Mage::getModel('admin/user')->load($adminuserId)->getRole()->getData();\n\t \n\t return in_array(self::ADMIN_ROLE_NAME, $role_data);\n\t}", "public static function requireAdmin() {\n\t$status = (Yii::$app->user->identity->roles == 'admin') ? true : false;\n return $status\n }", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "public function isAdmin(){\n if($this->role->name == 'Administrator' && $this->is_active == 1){\n return true;\n }\n return false;\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "public function inactiveAction()\n {\n $this->initialize();\n\n $all = $this->users->query()\n ->where('deleted IS NOT NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are inactive\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are inactive\",\n ]);\n }", "public static function adminsAreAlreadySet()\n {\n return Cache::rememberForever('config:has-admin', function () {\n return User::where(\"admin\", true)->exists();\n });\n }", "public function CheckAdminStatus()\n {\n if (!$this->IsAuth() || $this->mUserInfo['IsAdmin'] != 1)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function is_admin($params) {\n return has_capability(\n 'local/intelliboard:attendanceadmin',\n context_system::instance(),\n $params['userid']\n );\n }", "function isUserAdmin() {\r\n $user = $_SESSION['user'];\r\n return checkAdminStatus($user);\r\n }", "public function isAdmin() {\n\t\tif ($this->getLevelId() == 2 || $this->isSupervisor())\n\t\t\treturn true;\n\n\t\t$groups = $this->getGroups();\n\t\tforeach ($groups as $group) {\n\t\t\tif ($group->getGroupId() == 2)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAdmin()\n {\n if($this->u_r_id==null )\n {\n $this->u_r_id = array();\n $this->u_r_id[]=0;\n\n\n }\n foreach ($this->u_r_id as $int)\n {\n if($int==1)\n return true;\n }\n return false;\n }", "public function isAdmin()\n {\n return in_array(Role::ADMINS_SYSTEM_ROLE, $this->getRoleNamesForCurrentViewer());\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdmin()\n {\n return $this->role == 1;\n }", "function admin_check($redirect = \"index.php\")\n\t{\n\t\t// makes sure they are logged in:\n\t\trequire_login($redirect);\n\t\t\n\t\t// makes sure they are admin\n\t\t$sql = sprintf(\"SELECT admin FROM users WHERE uid=%d\", \n\t\t$_SESSION[\"uid\"]);\n\t\t\n\t\t// apologize if they are not.\n\t\t$admin = mysql_fetch_row(mysql_query($sql));\n\t\tif ($admin[0] == 0)\n\t\t\tapologize(\"You do not have administrator priveleges\");\n\t}", "public function checkAdmin() {\n if (self::redirectIfNotLoggedIn()) {\n return TRUE;\n }\n\n if (!LoggedInUserDetails::isCrew() && !LoggedInUserDetails::hasFullRights()) {\n if (\\Drupal::moduleHandler()->moduleExists('iish_conference_login_logout')) {\n $link = Link::fromTextAndUrl(\n iish_t('log out and login'),\n Url::fromRoute(\n 'iish_conference_login_logout.login_form',\n array(),\n array('query' => \\Drupal::destination()->getAsArray())\n )\n );\n\n drupal_set_message(new ConferenceHTML(\n iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())) . '<br>' .\n iish_t('Please @login as a crew member.',\n array('@login' => $link->toString())), TRUE\n ), 'error');\n }\n else {\n drupal_set_message(iish_t('Access denied.') . '<br>' .\n iish_t('Current user ( @user ) is not a conference crew member.',\n array('@user' => LoggedInUserDetails::getUser())), 'error');\n }\n\n return TRUE;\n }\n\n return FALSE;\n }", "function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}", "function checkUserIsAdmin()\n {\n $user_db = new SafeMySQL();\n\n $user_id = htmlentities($_SESSION[SES_NAME]['user_id'], ENT_QUOTES, 'UTF-8');\n\n if($user_db->getRow(\"SELECT user_id FROM app_users WHERE user_status = 'Active' AND user_id = ?s\",$user_id)){\n return true;\n } else {\n return false;\n }\n\n }" ]
[ "0.6863647", "0.6637122", "0.6610062", "0.6542218", "0.6445347", "0.6371347", "0.63659835", "0.6355638", "0.6333277", "0.6319981", "0.63102615", "0.6303824", "0.627453", "0.62432444", "0.6238742", "0.62255114", "0.6207895", "0.6204221", "0.61829317", "0.6180497", "0.6173775", "0.6144189", "0.6141062", "0.6141062", "0.6134895", "0.6133496", "0.6130226", "0.6119924", "0.6118122", "0.61161155" ]
0.78938884
0
Provides connection for given stop.
public function getConnection($stopNumber);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function getConnect();", "public function getStop($stopId);", "public function getConnection()\n {\n return $this->mc[self::LOCAL_MC];\n }", "public function get(): ConnectionInterface;", "public function get_connection()\n {\n }", "public function getConnection()\n\t{\n\t\treturn static::$instances[$this->_instance];\n\t}", "public function connect() {\n return $this->_connect;\n }", "function getConnection() {\n\t\tself::createConnection( $this->_connectionName );\n\t\treturn Kwerry::$_connections[ $this->_connectionName ];\n\t}", "public function getConnector();", "function getStop($db, $stop_id)\n\t{\n\t\t//get the stop info\n\t\t$query = array(\"stop_id\" => $stop_id);\n\t\t$cursor = $db->stops->find( $query );\n\t\t\n\t\t//print_debug($cursor);\n\t\treturn ($cursor);\n\t}", "public function getConnection() {\n return $this->redis;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn(){\n return $this->conn;\n }", "public function getConn(){\n\t\treturn $this->conn;\n\t}", "public function getConn()\n\t{\n\t\treturn $this->conn;\n\t}", "public function getConn() {\n\n return $this->conn;\n }", "public function getConnection()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\treturn $this->conn;\n\t\t\t}\n\t\t}", "public function getConnection()\n {\n return($this->connx);\n }", "public function getConn() {\n\t\tif ($this->conn) {\n\t\t\treturn $this->conn;\n\t\t}\n\t}", "public function getConnection(){\n\t\treturn $this->connection;\n\t}", "public function connect()\n {\n if (!isset($this->_resourceId)) {\n $this->_resourceId = $this->_doConnect();\n }\n \n return $this->_resourceId;\n }", "public function get() {\n if($this->connected) {\n return $this->conn;\n }\n else {\n return $this->connect();\n }\n }", "function getCONN(){\n return $this ->CONN;\n }", "public function getConnections();", "public function getConnections();", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->conn;\n }", "private function connector(){\n switch ($this->connection_type) {\n case self::CONN_TYPE_PDO:\n return $this->pdo;\n break;\n\n case self::CONN_TYPE_MYSQLI:\n return $this->mysqli;\n break;\n\n default:\n echo \"Error: connection type '\".$this->connection_type.\"' not suppordted\" . PHP_EOL;\n exit;\n break;\n }\n }" ]
[ "0.56271595", "0.5542259", "0.54873854", "0.54693866", "0.5420136", "0.5408355", "0.53212416", "0.5320704", "0.528877", "0.52782404", "0.52733475", "0.52728486", "0.52728486", "0.526507", "0.5254804", "0.5236893", "0.5229276", "0.5219481", "0.5206562", "0.52046275", "0.5174191", "0.5169252", "0.51691467", "0.51611054", "0.51573026", "0.5151154", "0.5151154", "0.5126163", "0.5126163", "0.51167285" ]
0.77532566
0
Once the PerTitle encoding is done, the generated streams will have this mode set.
public static function PER_TITLE_RESULT() { return new StreamMode(self::PER_TITLE_RESULT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function PER_TITLE_TEMPLATE()\n {\n return new StreamMode(self::PER_TITLE_TEMPLATE);\n }", "public static function PER_TITLE_TEMPLATE_FIXED_RESOLUTION_AND_BITRATE()\n {\n return new StreamMode(self::PER_TITLE_TEMPLATE_FIXED_RESOLUTION_AND_BITRATE);\n }", "public static function PER_TITLE_TEMPLATE_FIXED_RESOLUTION()\n {\n return new StreamMode(self::PER_TITLE_TEMPLATE_FIXED_RESOLUTION);\n }", "protected function onBeforeWrite()\n {\n // If no title provided, reformat filename\n if (!$this->Title) {\n // Strip the extension\n $this->Title = preg_replace('#\\.[[:alnum:]]*$#', '', $this->Name);\n // Replace all punctuation with space\n $this->Title = preg_replace('#[[:punct:]]#', ' ', $this->Title);\n // Remove unecessary spaces\n $this->Title = preg_replace('#[[:blank:]]+#', ' ', $this->Title);\n }\n return parent::onBeforeWrite();\n }", "protected function onBeforeWrite()\n {\n if (!$this->Title) {\n // Strip the extension\n $this->Title = preg_replace('#\\.[[:alnum:]]*$#', '', $this->Name);\n // Replace all punctuation with space\n $this->Title = preg_replace('#[[:punct:]]#', ' ', $this->Title);\n // Remove unecessary spaces\n $this->Title = preg_replace('#[[:blank:]]+#', ' ', $this->Title);\n }\n\n parent::onBeforeWrite();\n }", "abstract protected function finalize_stream_context_settings(): void;", "public function onBeforeWrite() {\n\t\tparent::onBeforeWrite();\n\t\t$this->Title = $this->Value;\n\t}", "private function setMode() {\r\n\t\t$this->mode = substr($this->mode, -1);\r\n\t}", "public function passOnEncodingAuto()\n {\n return false;\n }", "protected function _updateToUnicodeStream() {}", "function SetTitle($title, $isUTF8 = false) {\n parent::SetTitle($title, $isUTF8);\n $this->title = ($isUTF8 ? utf8_encode($title) : $title);\n }", "public function onBegin($instance) {\n $this->encoding= $instance->getEncoding();\n }", "public function updateAutoEncoding() {}", "function Open() {\n\t\t if ($this->Status == PHPCODE_WRITER_STATUS_CLOSE) {\t\t \n\t\t $this->Stream = '<? '.chr(10);\n\t\t $this->Status = PHPCODE_WRITER_STATUS_OPEN;\n\t\t } \n\t\t}", "public static function STANDARD()\n {\n return new StreamMode(self::STANDARD);\n }", "function use8Bit() {\n\t\tparent::use8Bit();\n\t\tif ($this->flowedFormat) {\n\t\t\t$this->plain_text_header = 'Content-Type: text/plain; charset='.$this->charset.'; format=flowed'.$this->linebreak.'Content-Transfer-Encoding: 8bit';\n\t\t}\n\t}", "public function onBeforeWrite()\n {\n /** @var SiteConfig $siteconfig */\n $siteconfig = SiteConfig::current_site_config();\n if (!$siteconfig->Title) {\n $siteconfig->Title = $this->Title;\n $siteconfig->Tagline = $this->Tagline;\n $siteconfig->write();\n }\n\n parent::onBeforeWrite();\n }", "function set_mode($mode){\r\n\r\n\t\tswitch($mode){\r\n\t\t\tcase self::OUTPUT_MODE_NORMAL:\r\n\t\t\tcase self::OUTPUT_MODE_TEMPLATE:\r\n\t\t\t$this->_mode = $mode;\r\n\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\tthrow new Exception(get_instance()->lang->line(\"Unknown output mode.\"));\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}", "public function setOutputMode($mode)\n {\n $this->output = $mode;\n return $this;\n }", "protected function initializeOutputCompression() {}", "function reset() {\n\t\t$_this =& AmfStream::getInstance();\n\t\t$_this->__stream = '';\n\t\treturn true;\n\t}", "public function _syncTitle() {}", "function output() {\n\t\t$_this =& AmfStream::getInstance();\n\t\tprint($_this->__stream);\n\t\t$_this->reset();\n\t\treturn true;\n\t}", "public function initializeOutputCompression() {}", "protected function before_stream() {\n\t\tGyroHeaders::send();\n\t\tsession_write_close();\n\t\tob_end_clean();//required here or large files will not work\n\t}", "public function setTitle($title, $encoding = 'UTF-8') {}", "public function setTitle($title, $encoding = 'UTF-8') {}", "public function onBeforeWrite()\n {\n $this->Title = $this->getName();\n\n // Generate the ticket code\n if ($this->exists() && empty($this->TicketCode)) {\n $this->TicketCode = $this->generateTicketCode();\n }\n\n parent::onBeforeWrite();\n }", "public function getContentEncoding()\n {\n }", "function initialize () {\n $this->set_openingtag ( \"<TITLE[attributes]>\" );\n\t $this->set_closingtag ( \"</TITLE>\" );\n }" ]
[ "0.66349936", "0.6003843", "0.5964164", "0.5385942", "0.5234276", "0.52289623", "0.51980793", "0.5048008", "0.49819633", "0.49710974", "0.4964579", "0.49628368", "0.4959079", "0.4948357", "0.49237743", "0.4832361", "0.48209366", "0.48095387", "0.4803196", "0.4802122", "0.48004335", "0.4766188", "0.47344595", "0.47324836", "0.4720064", "0.46979934", "0.46964782", "0.4694138", "0.46256065", "0.46120653" ]
0.6631084
1
Get the sort key name
public function getSortKeyName() { return $this->sortKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSortKey() {\n // results.\n if ($this->unique) {\n $prefix = 'A';\n } else {\n $prefix = 'B';\n }\n\n return $prefix.phutil_utf8_strtolower($this->getName());\n }", "public function getSortKey() {\n return $this->allBar->getSortKey();\n }", "function getSortKey($def='nickname')\n {\n switch ($this->sort) {\n case 'nickname':\n case 'created':\n return $this->sort;\n default:\n return 'nickname';\n }\n }", "public static function sortName(): string\n {\n return 'sortname';\n }", "final public function getPanelSortKey() {\n return sprintf(\n '%s'.chr(255).'%s',\n $this->getPanelGroup(),\n $this->getPanelName());\n }", "public function getForeignSortKeyName()\n {\n return $this->foreignKey[1];\n }", "public function getsort()\n {\n $s = $this->getname();\n return $s;\n }", "function getKeyName() {\n\t\treturn (string)$this->keypair->keyName;\n\t}", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getKeyName()\n {\n return $this->keyName ?: 'id';\n }", "public function getSortColumnName()\n {\n return $this->sortColumnName;\n }", "public function getKeyName();", "public function getKeyName();", "public function getKeyName();", "public function getSearchKeyName(): string\n {\n return $this->getKeyName();\n }", "public function getTagKeyName($sortBy): string\n {\n return $this->cacheTag . $sortBy;\n }", "public function getForeignSortKey()\n {\n return $this->parent->getAttribute($this->localKey[1]);\n }", "final public function key(): string\n {\n $this->sort();\n\n return (string) key($this->index);\n }", "public function getKey(): string {\n return $this->getType() . $this->getId() . $this->getLang() . $this->getRevisionId() ?? '';\n }", "public function sortField(): string\n {\n return $this->primaryKey;\n }", "protected abstract function getKeyName();", "public function key()\n {\n if ( ! $this->isTranslated()) {\n return $this->key;\n }\n\n $parts = explode('.', $this->key);\n\n array_splice($parts, $this->localeIndex, 0, $this->getLocalePlaceholder());\n\n return trim(implode('.', $parts), '.');\n }", "public function getRouteKeyName()\n {\n return $this->getKeyName();\n }", "protected function _getEntriesKeyName() {}", "protected function _getEntriesKeyName() {}", "public static function getNameKey()\n {\n return self::getRepo()->getNameKey();\n }", "public function getRouteKeyName()\n {\n // get the category where the name column is equal to user input\n return 'name';\n }", "public function getDefaultSortColumnName()\n {\n return $this->defaultSortColumnName;\n }", "public function getKeyField()\n {\n $class = get_class($this);\n $parts = explode('\\\\', $class);\n $name = $parts[count($parts)-1];\n return strtolower($name) . '_id';\n }", "abstract protected function _getEntriesKeyName();" ]
[ "0.8206142", "0.7483277", "0.7368126", "0.72747546", "0.7271819", "0.721986", "0.71841544", "0.7146666", "0.7088825", "0.7088825", "0.7062073", "0.7022944", "0.7022944", "0.7022944", "0.68585044", "0.6834921", "0.6817985", "0.6735678", "0.66915584", "0.6690749", "0.6676458", "0.6588988", "0.6583122", "0.65661967", "0.65661967", "0.65383667", "0.6503917", "0.64684635", "0.64656997", "0.64477086" ]
0.86797994
0
Get a new query builder that doesn't have any global scopes.
public function newQueryWithoutScopes(): Builder { return $this->newModelQuery(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newQueryWithoutScopes()\n {\n $builder = $this->newBuilder();\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n return $builder->setModel($this);\n }", "public function newQueryWithoutScopes()\n {\n $builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());\n\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n\n return $builder->setModel($this)\n //->setfillableColumns($this->fillable)\n ->with($this->with)\n ->withCount($this->withCount);\n }", "public function newQueryWithoutScopes();", "public function newQuery(): Builder\n {\n return new static($this->connection);\n }", "public function newQueryWithoutScope($scope);", "public function newQuery() {\n return new Builder($this->connection);\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }", "public function newQuery()\n {\n $builder = new Builder($this->newBaseQueryBuilder());\n\n $builder->setModel($this);\n\n return $builder;\n }", "public function newQuery()\n {\n return $this->registerGlobalScopes($this->newQueryWithoutScopes());\n }", "public function newQuery()\n {\n return new Builder($this->connection, $this->grammar, $this->processor);\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n $builder = in_array(self::class, config('autocache.models'))\n ? \\LaravelAutoCache\\Builder::class\n : \\Illuminate\\Database\\Query\\Builder::class;\n\n return new $builder($connection, $connection->getQueryGrammar(), $connection->getPostProcessor());\n }", "public function newQuery()\n {\n return $this->model->newQueryWithoutScopes();\n }", "public function newQuery()\n {\n $datasource = $this->getDatasource();\n\n $query = new Builder($datasource, $datasource->getPostProcessor());\n\n return $query->setModel($this);\n }", "protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n $builder = new Builder($conn, $grammar, $conn->getPostProcessor());\n\n if (isset($this->rememberFor)) {\n $builder->remember($this->rememberFor);\n }\n\n if (isset($this->rememberCacheTag)) {\n $builder->cacheTags($this->rememberCacheTag);\n }\n\n //if (isset($this->rememberCachePrefix)) {\n //ToDo: see if using server_hostname or whatever speeds this up\n $tenant = app(\\Hyn\\Tenancy\\Environment::class)->tenant();\n if(isset($tenant->id)){\n $set_tenant = $tenant->id;\n }else{\n $set_tenant = \"default\";\n }\n $builder->prefix($set_tenant);\n //}\n\n if (isset($this->rememberCacheDriver)) {\n $builder->cacheDriver($this->rememberCacheDriver);\n }\n\n return $builder;\n }", "public function toBase() : QueryBuilder\n {\n return $this->applyScopes()->getQuery();\n }", "public function newQueryBuilder()\n {\n return new Builder($this->config);\n }", "public function newQuery($excludeDeleted = true)\n {\n $builder = new EloquentQueryBuilder($this->newBaseQueryBuilder());\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n $builder->setModel($this)->with($this->with);\n\n if ($excludeDeleted and $this->softDelete) {\n $builder->whereNull($this->getQualifiedDeletedAtColumn());\n }\n\n return $builder;\n }", "protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n return new QueryBuilder($conn, $grammar, $conn->getPostProcessor());\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder($connection, $connection->getPostProcessor());\n }", "protected function createQueryBuilder()\n {\n $builder = new QueryBuilder();\n return $builder;\n }", "protected function newBaseQueryBuilder()\n {\n return $this->getConnection()->query();\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection, $connection->getQueryGrammar(), $connection->getPostProcessor()\n );\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return new QueryBuilder(\n $connection,\n $connection->getQueryGrammar(),\n $connection->getPostProcessor()\n );\n }", "public function newQuery()\n {\n $builder = $this->newAlfrescoBuilder($this->getConnection());\n $builder->setModel($this);\n return $builder;\n }", "protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n return $connection->query();\n }", "public function getBuilder()\n {\n $builder = new Query\\Builder($this->getKeys());\n $builder->setVisitors([\n new Visitors\\EqVisitor($builder),\n new Visitors\\NotEqVisitor($builder),\n new Visitors\\GtVisitor($builder),\n new Visitors\\GteVisitor($builder),\n new Visitors\\LtVisitor($builder),\n new Visitors\\LteVisitor($builder),\n new Visitors\\CtVisitor($builder),\n new Visitors\\SwVisitor($builder),\n new Visitors\\EwVisitor($builder),\n new Visitors\\AndVisitor($builder),\n new Visitors\\OrVisitor($builder),\n new Visitors\\NotInVisitor($builder),\n new Visitors\\InVisitor($builder),\n new Visitors\\NullVisitor($builder),\n new Visitors\\NotNullVisitor($builder),\n ]);\n\n return $builder;\n }", "public function createStandardQueryBuilder()\n {\n return $this->createQueryBuilder()\n ->field('status')->notEqual(MultimediaObject::STATUS_PROTOTYPE)\n ->field('islive')->equals(false);\n }", "public function createQueryBuilder ()\r\n {\r\n return new QueryBuilder($this);\r\n }", "protected function newBaseQueryBuilder() {\n\n\n\t\t\t$connection = $this->getConnection();\n\n\n\t\t\t// we resolve instance here using service container\n\t\t\treturn app(\\MehrIt\\LaraDbExt\\Query\\Builder::class, [\n\t\t\t\t'connection' => $connection,\n\t\t\t]);\n\t\t}" ]
[ "0.8795217", "0.8543926", "0.8006339", "0.79096043", "0.78016144", "0.76515245", "0.7631066", "0.7624457", "0.75837654", "0.75286955", "0.74769896", "0.74064153", "0.7380305", "0.73491096", "0.73157424", "0.7299957", "0.71916723", "0.71906954", "0.7180035", "0.7142572", "0.7123262", "0.7104613", "0.7104613", "0.7093434", "0.708805", "0.705322", "0.704937", "0.7047985", "0.7030154", "0.7026395" ]
0.856582
1
Set sort key name
public function setSortKeyName($name) { $this->sortKey = $name; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSortKeyName()\n {\n return $this->sortKey;\n }", "public function getSortKey() {\n // results.\n if ($this->unique) {\n $prefix = 'A';\n } else {\n $prefix = 'B';\n }\n\n return $prefix.phutil_utf8_strtolower($this->getName());\n }", "public function setSortColumnName($value)\n {\n $this->sortColumnName = $value;\n }", "public static function sortName(): string\n {\n return 'sortname';\n }", "public function setSort($x) { $this->sort = $x; }", "function getSortKey($def='nickname')\n {\n switch ($this->sort) {\n case 'nickname':\n case 'created':\n return $this->sort;\n default:\n return 'nickname';\n }\n }", "public function withSortKey() {\n $this->withSortKey = 'WITHSORTKEYS';\n return $this;\n }", "public function setKeyName($key);", "public function setSorting($arrSorting);", "public function setSortField ($value)\r\n\t{\r\n\t\t$this->sortField = $value;\r\n\t}", "function init_sort(){\r\n\t\t$out='';\r\n\r\n\t\tif($this->sort===true or $this->sort==''){\r\n\t\t\tfor($i=0; $i<count($this->data[0]); $i++){\r\n\t\t\t\t$out.=($out ? '_' : '').'t';\r\n\t\t\t}\r\n\t\t\t$this->sort=$out;\r\n\t\t}\r\n\t}", "public function setSort(string $sort): void\n {\n $this->_sort = $sort;\n }", "private function makeSortId() {\n return get_class($this).$this->id;\n }", "protected function _setSortingParameters()\n {\n $sSortingParameters = $this->getViewParameter('sorting');\n if ($sSortingParameters) {\n list($sSortBy, $sSortDir) = explode('|', $sSortingParameters);\n $this->setItemSorting($this->getSortIdent(), $sSortBy, $sSortDir);\n }\n }", "final public function getPanelSortKey() {\n return sprintf(\n '%s'.chr(255).'%s',\n $this->getPanelGroup(),\n $this->getPanelName());\n }", "public function sortBy(string $key);", "public static function sortOrderCacheKey($id)\n {\n return 'category.sort.order.' . $id;\n }", "public function setSort($value)\n {\n $this->tpSort = (int) $value;\n }", "function _key($name = '')\n {\n }", "public function getSortColumnName()\n {\n return $this->sortColumnName;\n }", "public function getSortKey() {\n return $this->allBar->getSortKey();\n }", "function setSort($sort) {\n $this->sort = $sort;\n }", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "public function set_sort(){\n \tsetcookie(\"sort_by\", addslashes($_POST['sort']), time()+(60*60*24*30), '/');\n }", "function _wp_object_name_sort_cb($a, $b)\n {\n }", "public function setSortIndex($sortIndex);", "protected function _setNameValue($key, $name) {}", "public function applySort($criteria, $sort, $key) : void;" ]
[ "0.6788596", "0.6741281", "0.6481288", "0.6338583", "0.62942314", "0.62129337", "0.6113393", "0.61008865", "0.5941128", "0.58972806", "0.5843464", "0.58384025", "0.57949066", "0.5792045", "0.5765045", "0.57428914", "0.57113767", "0.5707685", "0.5700302", "0.56895685", "0.5680576", "0.5614173", "0.55843115", "0.55843115", "0.55843115", "0.55626065", "0.55447614", "0.5521601", "0.54966354", "0.54963446" ]
0.68438804
0
update the value with adding the value of the greatest parrent
public function updateValue(){ $this->value += (int)max($this->left_parent_value,$this->right_parent_value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMaxBesave( $value){\n return $this->_add(17, $value);\n }", "function actualizarEstadisticaV(){\n\t\t\t$sql=\"UPDATE estadistica SET votovalido = votovalido+1,\nvotototal = votototal+1 where idestaditica=(Select max(idestaditica) from estadistica);\";\n\t\t\treturn $sql;\n\t\t}", "function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }", "public function getMax(): float;", "protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }", "function max() { return $this->max; }", "function maximo( $resultado, $valor) {\n\t$resultado = ($valor > $resultado ) ? $valor : $resultado; \n\treturn $resultado;\n}", "private function weightScore() {\n $this->maxScore = round($this->maxScore*self::SCORE_WEIGHT); \n }", "public function update_progress_now($id_p){\n $this->db2->select('max(progress) as now_progress');\n $this->db2->from('progress_pekerjaan');\n $this->db2->where('pekerjaan',$id_p);\n $q = $this->db2->get()->row();\n $now = $q->now_progress;\n\n\n if ($now) {\n $now = $now;\n } else {\n $now = 9;\n }\n $this->db2->set('progress_now',$now);\n $this->db2->where('id', $id_p);\n $this->db2->update('pekerjaan');\n }", "function updateSecondprice($conn,$itemID){\n\t$sql_getsp = \"select MAX(price) from Bids where price < (select MAX(price) from Bids where itemID = {$itemID}) and itemID = {$itemID}\";\n\t$result_getsp = $conn->query($sql_getsp);\n\t$row = $result_getsp->fetch_assoc();\n\tif($row['MAX(price)']>0){\n\t$sql = \"update Items set currentprice = ({$sql_getsp}) where itemID = {$itemID}\";\n\t$result = $conn->query($sql);\n\t}\n\t\n\t\n}", "public function decrementMax(array $input) {\n $key = $this->getKeyFromInput($input);\n\n $max = $this->getMax($key);\n if ($this->isValid($max)) {\n $max--;\n\n DB::table(self::TABLE_NAME)\n ->where(self::C_KEY,'=',$key)\n ->update([self::C_MAX => $max]);\n }\n }", "public function calculateNextValue() {}", "public function getNextOrderingValue()\n {\n $qb = $this->createQueryBuilder('c')\n ->select('MAX(c.ordering)')\n ->setMaxResults(1);\n\n $ordering = $qb->getQuery()->getSingleScalarResult();\n if ($ordering === null) {\n return 1;\n }\n\n return $ordering + 1;\n }", "public function getMax();", "function getSumV2($list)\r\n{\r\n $cache = [];\r\n for ($i=0; $i<count($list); $i++) {\r\n array_push($cache, 0);\r\n }\r\n\r\n $cache[0] = max($cache[0], $list[0]);\r\n $cache[1] = max($cache[0], $list[1]);\r\n\r\n for ($i=2; $i<count($list); $i++) {\r\n $cache[$i] = max(($list[$i] + $cache[$i-2]), $cache[$i-1]);\r\n }\r\n return $cache[$i-1];\r\n}", "public function addMaxHands( $value){\n return $this->_add(12, $value);\n }", "public function addMaxSave( $value){\n return $this->_add(16, $value);\n }", "public function max_sale(){\n\n global $database;\n $sql = \"SELECT product_id, SUM(product_quaty) FROM orders_index GROUP by product_id ORDER BY SUM(product_quaty) DESC LIMIT 1\";\n $result_set = $database->query($sql);\n $row = mysqli_fetch_array($result_set);\n $result = array_shift($row);\n return $result;\n }", "function saisonMaximum(){\n \t// On va récupreer la journée Maximum de la dernière saison \n\tglobal $bdd;\n\t// On récupère la saison maximum\n\t$rMaxSaison = mysqli_query($bdd, 'SELECT max(saison) FROM positions');\n\t$donnees = mysqli_fetch_assoc($rMaxSaison);\n\t$maxSaison = $donnees['max(saison)'];\n\tmysqli_free_result($rMaxSaison);\n\n\treturn $maxSaison;\n}", "public function getChargeValueModifier()\n {\n $value = 0;\n\n if ($this->isCompleted() || $this->isPending()) {\n $value += $this->getValue();\n }\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if ($transaction->isRefund() && $transaction->isSucceed()) {\n $value -= abs($transaction->getValue());\n }\n }\n }\n\n return max(0, $value);\n }", "function cek_rev_p2hp($id_p2hp) {\n $sql = \"SELECT max(rev_ke) as no_rev FROM rev_p2hp WHERE rev_p2hp='$id_p2hp'\";\n $row = $this->db->query($sql)->row();\n $max_no = $row->no_rev + 1;\n return $max_no;\n }", "public function addMaxWheels( $value){\n return $this->_add(13, $value);\n }", "function cek_rev_lhp($id_p2hp) {\n $sql = \"SELECT max(rev_ke) as no_rev FROM rev_lhp WHERE rev_fk_p2hp='$id_p2hp'\";\n $row = $this->db->query($sql)->row();\n $max_no = $row->no_rev + 1;\n return $max_no;\n }", "public function updateQuality() {\n\n if ($this->sellIn > 0) {\n //Not reached sellby date\n $this->quality -= 2;\n } else {\n //Passed sellby date, so decrease in quality twice as fast\n $this->quality -= 4;\n }\n\n //Quality cannot be less than zero\n if ($this->quality < 0){\n $this->quality = 0;\n }\n }", "public function getMaxValue();", "public function getMaxValue();", "function trocaValor(&$b){\n $b += 50;\n return $b; \n\n}", "public function level_reduction($max, $item)\n {\n }", "function getMax($key, $array) {\r\n // Declare $maxValue\r\n $cardMax = 0;\r\n $maxValue = 0;\r\n /* Loop through the array, starting at the given\r\n index and ending at the last element in the\r\n array.*/\r\n for ($i = $key; $i > -1; $i--) {\r\n /* it will add the probability score for each index\r\n included in the loop*/\r\n $cardMax = $array[$i][3];\r\n $maxValue = $maxValue + $cardMax;\r\n }\r\n // and returns the max value for the key\r\n return $maxValue;\r\n }", "private function setResult() {\n $result = 0;\n foreach ($this->process AS $key => $value) {\n $total = $value['pivot'] * $value['adj']['result'];\n if($key == 0) {\n $result = $result + $total;\n }\n elseif($key == 1) {\n $result = $result - $total;\n }\n else {\n if($key % 2 == 0) {\n $result = $result + $total;\n }\n else {\n $result = $result - $total;\n }\n }\n }\n unset($key, $value, $total);\n return $result;\n }" ]
[ "0.61004823", "0.5769029", "0.5737969", "0.5733147", "0.5555722", "0.5527233", "0.548718", "0.54365724", "0.5410001", "0.54003483", "0.5397097", "0.5377685", "0.53204757", "0.5284183", "0.5282127", "0.52631366", "0.5255919", "0.5240921", "0.52273345", "0.5225409", "0.52196795", "0.519667", "0.5189152", "0.5175585", "0.51753813", "0.51753813", "0.5169199", "0.5145985", "0.5136323", "0.5114325" ]
0.69477886
0
send the value to its children
public function sendValue() { $this->updateValue(); if($this->left_child_ref != null) { $this->left_child_ref->right_parent_value = $this->value; // $left_child_ref->sendValue(); } if($this->right_child_ref != null){ $this->right_child_ref->left_parent_value = $this->value; } return $this->value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function onParentSet() : void\n {\n $value = $this->oFG->getData()->getValue($this->strName);\n $this->iValue = $value ? intval($value) : $this->iMin;\n }", "public function updateValue(){\n\n\t\t$this->value += (int)max($this->left_parent_value,$this->right_parent_value);\n\t}", "public function setData($value)\n {\n foreach($this->children as $child)\n {\n if (isset($value[$child->name]))\n {\n $child->setData($value[$child->name]);\n }\n else\n {\n $child->setData(null);\n }\n }\n \n foreach($this->children as $child)\n {\n if ($child->isValid() === false)\n {\n foreach($child->getErrors() as $errorName => $error)\n {\n $this->errors[$child->name] = $error;\n }\n }\n }\n \n parent::setData($value); \n }", "function set($id, $value){\n // Change the order of the menu links to match core\n // Collect all the parent links, and then add all of\n // their children to the list as well.\n $value = self::sort_tree($value);\n\n return parent::set($id, $value);\n }", "function serializeChildren()\r\n {\r\n //Calls children's serialize recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->serialize();\r\n }\r\n }", "function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }", "function value( $value )\n\t{\n\t\t$this->value = $value;\n\t}", "function orderChildValue($direction) {\r\n $cid = JRequest::getVar('cid', '', '', 'array');\r\n $val_id = JRequest::getVar('val_id', '', '', 'array');\r\n $field_id = $cid[0];\r\n $value_id = $val_id[0];\r\n\r\n if (!empty ($field_id) && !empty ($value_id)) {\r\n $value = & JTable::getInstance('cpvalue', 'Table');\r\n $value->load($value_id);\r\n $value->move($direction, \" field_id = '$field_id' \");\r\n $value->reorder(\" field_id = '$field_id' \");\r\n }\r\n }", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "protected function value()\n {\n $this->value = $this->lexeme;\n }", "function setValSubNode($nombre,$valor){\n\t\t$clase=$this->nmclass;\n\t\t$this->nodos[$clase][$nombre]=$valor;\n\t\t$this->anode=$nombre;\n\t\treturn 0;\n\t}", "public function forwardValueToRelated($value, \\SetaPDF_FormFiller_Field_FieldInterface $field, $encoding = 'UTF-8', $method = 'setValue') {}", "protected function populate_value()\n {\n }", "public function setParent($value)\n {\n $this->setItemValue('parent', ['id' => (int)$value]);\n }", "function act() {\n return $this->value;\n }", "public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}", "protected function set_root_value($value)\n {\n }", "function printChild($data)\n{\n\n}", "public function appendValue($value) {\n $this->current->value($value);\n }", "protected function value()\n {\n }", "public function getChilds();", "public function save(Application_Model_Child $child) \n {\n }", "public function valueSet() //use visitor to check if value is set on each leaf\n\n {\n\n $visitor = new \\cmu\\html\\form\\visitors\\ValueSetVisitor();\n\n return $this->accept($visitor);\n \n }", "public function iterateChildren();", "function get_value() {return $this->get();}", "function saveValue($parent_id = 0, $field_id = 0) {\r\n\r\n $array = array ();\r\n $array['id'] \t\t\t= $id = JRequest::getVar('cid', 0, '', 'int');\r\n $array['field_id'] = $field_id;\r\n $array['parent_id'] = $parent_id;\r\n $array['name']\t\t\t= $this->_fixName(JRequest::getVar('name', '', '', 'string'));\r\n $array['label'] \t\t= $this->_fixLabel(JRequest::getVar('label', '', '', 'string'));\r\n $array['priority'] = JRequest::getVar('priority', '', '', 'int');\r\n $array['default']\t\t= JRequest::getVar('default', '', '', 'int');\r\n $array['ordering'] \t\t= JRequest::getVar('ordering', '', '', 'int');\r\n $array['multiple'] \t\t= JRequest::getVar('multiple', '', '', 'int');\r\n $array['access_group'] \t\t= JRequest::getVar('access_group', '', '', 'int');\r\n\r\n\r\n//print_r($array);\r\n // init db object\r\n $value = & JTable::getInstance('cpvalue', 'Table');\r\n // set ordering for new fields\r\n if ($id == 0)\r\n $array['ordering'] = $value->getNextOrder();\r\n // bind temp array to db object\r\n $value->bind($array);\r\n // validity check\r\n if ($value->check()) {\r\n // save value data\r\n $value->store();\r\n $this->_id = $value->id;\r\n //save childs values\r\n if ($id > 0) { // saving values only if not a new field\r\n $save_value_result = $this->_saveValues($field_id);\r\n if ($save_value_result === true) {\r\n return true;\r\n } else {\r\n // return errors array\r\n $this->_errors = $save_value_result;\r\n return false;\r\n }\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n $this->_errors = $value->getErrors();\r\n return false;\r\n }\r\n return true;\r\n }", "function setRoot($value)\r\n {\r\n $this->_root=$value;\r\n //Gets the vars from the root object to get the pointers for the components\r\n $this->_rootvars=get_object_vars($this->_root);\r\n\r\n //Clears parents list and sets the root as the first parent\r\n $this->_parents->clear();\r\n $this->_parents->add($this->_root);\r\n\r\n }", "protected function push($value)\n {\n $this->items[] = $this->set($value);\n }", "public function setChildID($value)\n {\n return $this->set('ChildID', $value);\n }", "public function setChildID($value)\n {\n return $this->set('ChildID', $value);\n }" ]
[ "0.6235331", "0.6029104", "0.55400485", "0.5499844", "0.5454903", "0.54471433", "0.54099464", "0.534778", "0.52851087", "0.52603984", "0.5247153", "0.52039516", "0.5187952", "0.51875347", "0.51769775", "0.51569563", "0.50804675", "0.50757587", "0.50643754", "0.50233054", "0.5022384", "0.50199074", "0.5011298", "0.4995113", "0.49568856", "0.49533537", "0.49435288", "0.494173", "0.4940417", "0.4939049" ]
0.68923986
0
convert every element in the 2d array of triangle to a node in a graph. each node has two parrents and two children. root node has two children but no parrents.
function iniTriGraph($tri_A) { $tri_graph = []; //create the nodes of the graph foreach($tri_A as $i => $row) { $tri_graph[$i] =[]; foreach($row as $j=> $val) { $tri_graph[$i][$j] = new TriElement($val,null,null); } } //assign the parents and children relationship to each node for($i = 0; $i < count($tri_graph)-1;++$i) { $row = $tri_graph[$i]; $next_row = $tri_graph[$i+1]; for($j = 0; $j < count($row);++$j) { $left_child = $next_row[$j]; $right_child = $next_row[$j+1]; $row[$j]->addChild($left_child,$right_child); } } return $tri_graph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayToTree($a) {\n if (!empty($a) && !empty($a[0])) {\n $T = new Tree();\n $T->x = $a[0];\n $T->l = arrayToTree($a[1]);\n $T->r = arrayToTree($a[2]);\n return $T;\n }\n return null;\n}", "public static function buildTree($arr, $pid = 0);", "public function index()\n {\n $a = new Node(1,'A',12,34,[]);\n $b = new Node(2,'B',12,34,[]);\n $c = new Node(3,'C',12,34,[]);\n $d = new Node(4,'D',12,34,[]);\n $e = new Node(5,'E',13,45,[]); \n $f = new Node(7,'F',13,45,[]); \n $g = new Node(8,'G',13,45,[]); \n $h = new Node(9,'H',13,45,[]); \n $i = new Node(12,'I',13,45,[]); \n $j = new Node(10,'J',13,45,[]); \n $k = new Node(11,'K',13,45,[]); \n $l = new Node(13,'L',13,45,[]); \n $m = new Node(14,'M',13,45,[]); \n $n = new Node(16,'N',13,45,[]); \n $p = new Node(17,'P',13,45,[]);\n\n\n $gr = new Grafo();\n $gr->Add($a);\n $gr->Add($b);\n $gr->Add($c);\n $gr->Add($d);\n $gr->Add($e);\n $gr->Add($f);\n $gr->Add($g);\n $gr->Add($h);\n $gr->Add($i);\n $gr->Add($j);\n $gr->Add($k);\n $gr->Add($l);\n $gr->Add($m);\n $gr->Add($n);\n $gr->Add($p);\n\n // A\n $gr->AddEdge($a,8,$b);\n $gr->AddEdge($b,8,$a);\n $gr->AddEdge($a,4,$e);\n $gr->AddEdge($e,4,$a);\n $gr->AddEdge($a,5,$d);\n $gr->AddEdge($d,5,$a);\n // B\n $gr->AddEdge($b,12,$e);\n $gr->AddEdge($e,12,$b);\n $gr->AddEdge($b,4,$f);\n $gr->AddEdge($f,4,$b);\n $gr->AddEdge($b,3,$c);\n $gr->AddEdge($c,3,$b);\n // C\n $gr->AddEdge($c,9,$f);\n $gr->AddEdge($f,9,$c);\n $gr->AddEdge($c,11,$g);\n $gr->AddEdge($g,11,$c);\n // F\n $gr->AddEdge($f,1,$g);\n $gr->AddEdge($g,1,$f);\n $gr->AddEdge($f,3,$e);\n $gr->AddEdge($e,3,$f);\n $gr->AddEdge($f,8,$k);\n $gr->AddEdge($k,8,$f);\n // G\n $gr->AddEdge($g,7,$l);\n $gr->AddEdge($l,7,$g);\n $gr->AddEdge($g,8,$k);\n $gr->AddEdge($k,8,$g);\n // E\n $gr->AddEdge($e,9,$d);\n $gr->AddEdge($d,9,$e);\n $gr->AddEdge($e,5,$j);\n $gr->AddEdge($j,5,$e);\n $gr->AddEdge($e,8,$i);\n $gr->AddEdge($i,8,$e);\n // D\n $gr->AddEdge($d,6,$h);\n $gr->AddEdge($h,6,$d);\n // H\n $gr->AddEdge($h,2,$i);\n $gr->AddEdge($i,2,$h);\n $gr->AddEdge($h,7,$m);\n $gr->AddEdge($m,7,$h);\n // I\n $gr->AddEdge($i,10,$j);\n $gr->AddEdge($j,10,$i);\n $gr->AddEdge($i,6,$m);\n $gr->AddEdge($m,6,$i);\n // M\n $gr->AddEdge($m,2,$n);\n $gr->AddEdge($n,2,$m);\n // J\n $gr->AddEdge($j,6,$k);\n $gr->AddEdge($k,6,$j);\n $gr->AddEdge($j,9,$n);\n $gr->AddEdge($n,9,$j);\n // K\n $gr->AddEdge($k,5,$l);\n $gr->AddEdge($l,5,$k);\n $gr->AddEdge($k,7,$p);\n $gr->AddEdge($p,7,$k);\n // L\n $gr->AddEdge($l,6,$p);\n $gr->AddEdge($p,6,$l);\n // N\n $gr->AddEdge($n,12,$p);\n $gr->AddEdge($p,12,$n);\n // P\n\n // dd($gr);\n // return $gr->MenorDistancia([INF,INF,0,INF]);\n // return $gr->Show();\n return $gr->Disjtra($a,$p);\n }", "public static function buildTree($arr, $pid = 0)\n\t{\n\t\t$tmp = array();\n\t\tforeach ($arr as $row) {\n\t\t\tif (($row['id'] == (int)$pid)) {\n\t\t\t\t$id = $row['id'];\n\t\t\t\t$sql = \"SELECT id,parent FROM \" . self::$ClientTable . \" WHERE (id={$id}) \";\n\t\t\t\t$res = self::query($sql);\n\t\t\t\tself::buildTree($res, $row['parent']);\n\t\t\t}\n\t\t\tif (($row['parent'] == (int)$pid)) {\n\t\t\t\t$id = $row['id'];\n\t\t\t\t$sql = \"SELECT id,parent FROM \" . self::$ClientTable . \" WHERE (parent={$id}) \";\n\t\t\t\t$res = self::query($sql);\n\t\t\t\t$tmp[$row['id']] = self::buildTree($res, $row['id']);\n\t\t\t}\n\t\t}\n\t\treturn count($tmp) ? $tmp : true;\n\t}", "public function createNode($arr,$node = null){\r\n if(is_null($node)){\r\n $node = $this->root;\r\n }\r\n foreach($arr as $element => $value){\r\n $element = is_numeric($element)? $this->node_name : $element;\r\n\r\n $child = $this->createElement($element,(is_array($value)? null : $value));\r\n $node->appendChild($child);\r\n\r\n if(is_array($value)){\r\n self::createNode($value,$child);\r\n }\r\n }\r\n }", "public static function santiagoFromKml(){\n\t\t$json = json_decode(Kml::Polygons);\t\n\t\tforeach ($json->kml->Document->Folder[0]->Placemark as $polygon_data) {\t\t\t\t\t\n\t\t\t$path = $polygon_data->Polygon->outerBoundaryIs->LinearRing->coordinates;\n\t\t\t$path = explode(' ', $path);\n\t $finalpath = array();\n\t $polygon = new Polygon();\n\t $polygon->name = $polygon_data->name;\n\t $polygon->save(); \n\t foreach ($path as $p) {\n\t $points = explode(',', $p); \n\t $polygonPath = new PolygonPath(); \n\t $polygonPath->lat = (float) $points[1];\n\t $polygonPath->lng = (float) $points[0]; \n\t $polygonPath->polygon_id = $polygon->id;\n\t $polygonPath->save(); \n\t }\n\t $polygon->center_lat = $polygonPath->lat;\n\t $polygon->center_lng = $polygonPath->lng;\n\t $polygon->save();\n\t\t}\n\t}", "abstract protected function getNewChildren(): array ;", "protected function _tree($array)\n {\n $root = [\n \"children\" => []\n ];\n $current =& $root;\n\n foreach ($array as $i => $node) {\n $result = $this->_tag($node);\n\n if ($result) {\n $tag = $result[\"tag\"] ?? \"\";\n $arguments = $result[\"arguments\"] ?? \"\";\n\n if ($tag) {\n if (!$result[\"closer\"]) {\n $last = ArrayMethods::last($current[\"children\"]);\n\n if ($result[\"isolated\"] && is_string($last)) {\n array_pop($current[\"children\"]);\n }\n\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n $current =& $current[\"children\"][sizeof($current[\"children\"]) - 1];\n }\n elseif (isset($current[\"tag\"]) && $result[\"tag\"] == $current[\"tag\"]) {\n $start = $current[\"index\"] + 1;\n $length = $i - $start;\n $current[\"source\"] = implode(\" \", array_slice($array, $start, $length));\n $current =& $current[\"parent\"];\n }\n } else {\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n }\n } else {\n $current[\"children\"][] = $node;\n }\n }\n\n return $root;\n }", "protected function _tree($array) {\n\n\t\t\t$root = array(\n\t\t\t\t'children' => array()\n\t\t\t);\n\t\t\t$current = &$root;\n\n\t\t\tforeach ($array as $i => $node) {\n\n\t\t\t\t$result = $this->_tag($node);\n\t\t\t\t\n\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\tif (isset($result['tag'])) {\n\t\t\t\t\t\t$tag = $result['tag'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tag = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($result['arguments'])) {\n\t\t\t\t\t\t$arguments = $result['arguments'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arguments = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($tag) {\n\t\t\t\t\t\t// If segment does not contain a closer\n\t\t\t\t\t\tif (!$result['closer']) {\n\t\t\t\t\t\t\t// clean up syntax if segment is isolated and \n\t\t\t\t\t\t\t// preceded by an plain text segment\n\t\t\t\t\t\t\t$last = ArrayMethods::last($current['children']);\n\t\t\t\t\t\t\tif ($result['isolated'] && is_string($last)) {\n\t\t\t\t\t\t\t\tarray_pop($current['children']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$current = &$current['children'][count($current['children']) - 1];\n\t\t\t\t\t\t} else if (isset($current['tag']) && $result['tag'] == $current['tag']) {\n\t\t\t\t\t\t\t$start = $current['index'] + 1;\n\t\t\t\t\t\t\t$length = $i - $start;\n\t\t\t\t\t\t\t$current['source'] = implode(array_slice($array, $start, $length));\n\t\t\t\t\t\t\t$current = &$current['parent'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$current['children'][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $root;\n\t\t}", "function BuildTree($items)\r\n\t{\r\n\t\tif (!empty($items))\r\n\t\t{\r\n\t\t\t# Columns\r\n\t\t\t# * Gather all columns required for display and relation.\r\n\t\t\t# Children\r\n\t\t\t# * Map child names to child index.\r\n\r\n\t\t\t$cols[$this->ds->table] = array($this->ds->id => 1);\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach (array_keys($this->ds->DisplayColumns) as $col)\r\n\t\t\t\t$cols[$this->ds->table][$col] = $this->ds->id == $col;\r\n\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $ix => $child)\r\n\t\t\t{\r\n\t\t\t\t$children[$child->ds->table] = $ix;\r\n\t\t\t\t$cols[$child->ds->table][$child->parent_key] = 1;\r\n\t\t\t\t$cols[$child->ds->table][$child->child_key] = 0;\r\n\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\tforeach (array_keys($child->ds->DisplayColumns) as $col)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[$child->ds->table][$col] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Flats\r\n\t\t\t# * Convert each item into separated TreeNodes\r\n\t\t\t# * Associate all indexes by table, then id\r\n\r\n\t\t\t$flats = array();\r\n\r\n\t\t\t# Iterate all the resulting database rows.\r\n\t\t\tforeach ($items as $ix => $item)\r\n\t\t\t{\r\n\r\n\t\t\t\t# Iterate the columns that were created in step 1.\r\n\t\t\t\tforeach ($cols as $table => $columns)\r\n\t\t\t\t{\r\n\t\t\t\t\t# This will store all the associated data in the treenode\r\n\t\t\t\t\t# for the editor to reference while processing the tree.\r\n\t\t\t\t\t$data = array();\r\n\t\t\t\t\t$skip = false;\r\n\r\n\t\t\t\t\t# Now we're iterating the display columns.\r\n\t\t\t\t\tforeach ($columns as $column => $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t# This column is not associated with a database row.\r\n\t\t\t\t\t\tif (is_numeric($column)) continue;\r\n\r\n\t\t\t\t\t\t# Table names are included to avoid ambiguity.\r\n\t\t\t\t\t\t$colname = $table.'_'.$column;\r\n\r\n\t\t\t\t\t\t# ID would be specified if this is specified as a keyed\r\n\t\t\t\t\t\t# value.\r\n\t\t\t\t\t\tif ($id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (empty($item[$colname]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$skip = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$idcol = $colname;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[$this->ds->StripTable($colname)] = $item[$this->ds->StripTable($colname)];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$skip)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tn = new TreeNode($data);\r\n\t\t\t\t\t\t$tn->id = $item[$idcol];\r\n\t\t\t\t\t\t$flats[$table][$item[$idcol]] = $tn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Tree\r\n\t\t\t# * Construct tree out of all items and children.\r\n\r\n\t\t\t$tree = new TreeNode('Root');\r\n\r\n\t\t\tforeach ($flats as $table => $items)\r\n\t\t\t{\r\n\t\t\t\tforeach ($items as $ix => $node)\r\n\t\t\t\t{\r\n\t\t\t\t\t$child_id = isset($children[$table]) ? $children[$table] : null;\r\n\r\n\t\t\t\t\tif (isset($children[$table]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ckeycol = $this->ds->children[$child_id]->child_key;\r\n\t\t\t\t\t\t$pid = $node->data[\"{$table}_{$ckeycol}\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $pid = 0;\r\n\r\n\t\t\t\t\t$node->data['_child'] = $child_id;\r\n\r\n\t\t\t\t\tif ($pid != 0)\r\n\t\t\t\t\t\t$flats[$this->ds->table][$pid]->children[] = $node;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tree->children[] = $node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t# Put child table children above related children, helps to\r\n\t\t\t# understand the display.\r\n\t\t\tif (count($this->ds->children) > 0) $this->FixTree($tree);\r\n\t\t\treturn $tree;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "function triangle(int $jumlah) {\r\n\tfor ($i = $jumlah; $i >= 1; $i--) {\r\n\t \r\n\t\tif ($i == $jumlah){\r\n\t\t\tfor($j=$i;$j>=1;$j--){\r\n\t\t\t\techo \" \".\"*\".\" \";\r\n\t\t\t\t\r\n \t\t}\r\n\t\t\techo \"</br>\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Loop added for outer spacing\r\n\t\t\t for ($j = $jumlah; $j > $i; $j--) {\r\n\t\t\t\techo \"  \";\r\n\t\t\t }\r\n\t\t\t echo \"*\";\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t //Loop added for internal spacing\r\n\t\t\t for ($j = 1; $j < ($i - 1) * 2; $j++) {\r\n\t\t\t echo \"  \";\r\n\t\t\t }\r\n\t\t\t if ($i == 1)\r\n\t\t\t echo \"</br>\";\r\n\t\t\t else\r\n\t\t\t echo \"*</br>\";\r\n\t\t}\r\n\t\t\r\n\t \r\n\t}\r\n\t\r\n}", "public function createResult()\n {\n $totalCostCheapestPathFromTo = array();\n $cheapestPathFromTo = array();\n $vertexSet = array_values($this->graph->getVertices());\n\n $nVertices = count($vertexSet);\n\n //Total cost from i to i is 0\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $totalCostCheapestPathFromTo[$i][$i] = 0;\n }\n\n // Calculating shortestPath(i,j,k+1) = min(shortestPath(i,j,k),shortestPath(i,k+1,k) + shortestPath(k+1,j,k))\n for ($k = 0; $k < $nVertices; ++$k) {\n\n for ($i = 0; $i < $nVertices; ++$i) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n\n for ($j = 0; $j < $nVertices; ++$j) {\n\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $k);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $i, $j);\n $this->updateInfo($vertexSet, $totalCostCheapestPathFromTo, $cheapestPathFromTo, $k, $j);\n\n // If we find that the path from (i, k) + (k, j) is shorter than the path (i, j), the new path is\n // calculated.\n if ($totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j] < $totalCostCheapestPathFromTo[$i][$j]) {\n\n $totalCostCheapestPathFromTo[$i][$j] = $totalCostCheapestPathFromTo[$i][$k] + $totalCostCheapestPathFromTo[$k][$j];\n\n // Testing if we are not repeating a vertex' path over itself before merging the paths\n if ($vertexSet[$i]->getId() != $vertexSet[$k]->getId() || $vertexSet[$k]->getId() != $vertexSet[$j]->getId()) {\n\n $cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$j]->getId()] = array_merge($cheapestPathFromTo[$vertexSet[$i]->getId()][$vertexSet[$k]->getId()],\n $cheapestPathFromTo[$vertexSet[$k]->getId()][$vertexSet[$j]->getId()]);\n }\n\n }\n\n }\n\n }\n\n if($totalCostCheapestPathFromTo[$k][$k] < 0) {\n\n throw new UnexpectedValueException('Floyd-Warshall not supported for negative cycles');\n }\n }\n\n return new FloydWarshallResult($cheapestPathFromTo, $this->graph);\n }", "function _make_relation($parents)\n {\n if(count($parents)<1)\n return array();\n $children = array();\n // first pass - collect children\n $field_parent_id =$this->field_parent_id ;\n foreach ($parents as $t)\n {\n $pt = $t->$field_parent_id ;\n $list = @$children[$pt] ? $children[$pt] : array();\n array_push($list, $t);\n $children[$pt] = $list;\n\n }\n //echo \"<br>---list Child----<br>\";\n //print_r($children);\n return $children;\n }", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "function generar_DFS($indice,$mat,$numero){\r\n $padre[$indice] = 1;\r\n vardump($numero);\r\n for($i = 0; $i<$numero; $i++){\r\n if($i == $indice){\r\n for($j = 0; $j<$numero; $j++){\r\n if($mat[$i][$j]==1 && $padre[$j]==0){ #si el vertice inicial esta conectado al vertice final y este no fue visitado\r\n $matrizDFS[$i][$j] = 1;\r\n generar_DFS($j,$mat,$numero);\r\n } #se registra la conexion en la matriz dfs global\r\n }\r\n }\r\n }\r\n #los datos de la matriz global pasan a una matriz local\r\n return $matrizDFS; #se regresa la matriz DFS\r\n}", "function flipDiagonally($arr) {\n\t $out = array();\n\t foreach ($arr as $key => $subarr) {\n\t foreach ($subarr as $subkey => $subvalue) {\n\t $out[$subkey][$key] = $subvalue;\n\t }\n\t }\n\t return $out;\n\t}", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function renderMapRoutePathCatRelations()\n {\n $arrReturn = array();\n $rowsRelation = array();\n\n // Example\n // $relation[0]['PATH:tx_route_path->tx_route_path_cat->listOf.uid' => '2.8';\n // '2.8' is a relation like\n // tx_route_path.uid -> tx_route_path_cat.uid\n //\n\n // Get the PATH relations (each element with a prefix PATH - see example above)\n $relations = $this->renderMapRouteRelations( 'PATH' );\n//$this->pObj->dev_var_dump( $relations );\n // Get the key of a relation\n $relationKey = key( $relations[ 0 ] );\n\n // Get the lables for the tables path and pathCat\n list( $prefix, $tables ) = explode( ':', $relationKey );\n unset( $prefix );\n list( $tablePath, $tableCat ) = explode( '->', $tables );\n // Get the lables for the tables path and pathCat\n // LOOP relations\n foreach ( $relations as $relation )\n {\n // LOOP relation\n foreach ( $relation as $tablePathCat )\n {\n $arrTablePathCat = explode( $this->catDevider, $tablePathCat );\n // SWITCH : children\n switch ( true )\n {\n // CASE : children\n case( count( $arrTablePathCat ) > 1 ):\n // LOOP children\n foreach ( $arrTablePathCat as $tablePathCatChildren )\n {\n list( $pathUid, $catUid ) = explode( '.', $tablePathCatChildren );\n if ( $pathUid != null )\n {\n $rowsRelation[ $pathUid ][] = $catUid;\n $rowsRelation[ $pathUid ] = array_unique( $rowsRelation[ $pathUid ] );\n }\n }\n // LOOP children\n break;\n // CASE : children\n // CASE : no children\n case( count( $arrTablePathCat ) == 1 ):\n default:\n list( $pathUid, $catUid ) = explode( '.', $tablePathCat );\n if ( $pathUid != null )\n {\n $rowsRelation[ $pathUid ][] = $catUid;\n $rowsRelation[ $pathUid ] = array_unique( $rowsRelation[ $pathUid ] );\n }\n break;\n // CASE : no children\n }\n // SWITCH : children\n }\n // LOOP relation\n }\n // LOOP relations\n // $rowsRelation will look like:\n // array(\n // 2 => array( 8 ),\n // 1 => array( 7 ),\n // )\n // array(\n // tablePath.uid => array ( tableCat.uid, tableCat.uid, tableCat.uid ),\n // tablePath.uid => array ( tableCat.uid, tableCat.uid, tableCat.uid ),\n // )\n//$this->pObj->dev_var_dump( $rowsRelation );\n $arrReturn[ 'rowsRelation' ] = $rowsRelation;\n $arrReturn[ 'tableCat' ] = $tableCat;\n $arrReturn[ 'tablePath' ] = $tablePath;\n\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n $prompt = var_export( $rowsRelation, true );\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n\n return $arrReturn;\n }", "function uniquePaths($m, $n) {\n// 定义二维数组\n $pathNum = array();\n\n// dp[m][n] = dp[m-1][n] + dp[m][n-1]\n\n// 定义初始值\n for ($i = 0;$i < $m;$i++){\n $pathNum[$i][0] = 1;\n }\n for ($i = 0;$i < $n;$i++){\n $pathNum[0][$i] = 1;\n }\n\n for ($i = 1;$i < $m;$i++){\n for ($v = 1;$v < $n;$v++){\n $pathNum[$i][$v] = $pathNum[$i - 1][$v] + $pathNum[$i][$v - 1];\n }\n }\n\n return $pathNum[$m - 1][$n - 1];\n}", "public function traverse(array $nodes) : array;", "public function buildTree($arr)\n\t{\n\t\t$count = count($arr);\n\t\tif(!$count) return array();\n\n\t\t$first = $arr[0];\n\t\t$entryLevel = $first->level;\n\t\t$tree = new stdClass();\n\t\t$tree->type = $first->type;\n\t\t$tree->content = null;\n\t\t$tree->parent = null;\n\t\t$tree->key = 'root';\n\t\t$tree->level = $entryLevel - 1;\n\t\t$tree->children = array();\n\t\t$lastNode = $tree;\n\t\t// store the relations\n\t\t$parentList = array();\n\t\tforeach($arr as $key => $val){\n\t\t\t$level = $val->level;\n\t\t\t$lastLevel = $lastNode->level;\n\t\t\tif($level > $lastLevel){\n\t\t\t\t$lastNode->children[] = $val;\n\t\t\t\t$parentList[$key] = $lastNode;\n\t\t\t\t$lastNode = $val;\n\t\t\t} elseif($level < $lastLevel) { \n\t\t\t\t// look for the node has same level \n\t\t\t\twhile($level < $lastNode->level){\n\t\t\t\t\t$lastNode = $parentList[$lastNode->key];\n\t\t\t\t}\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t} else { // $level == $lastLevel\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t}\n\t\t}\n\t\treturn $tree;\n\t}", "public function run()\n {\n DB::table('binary_tree_nodes')->insert([\n [\n 'parent_id' => null, //1\n 'team_id' => 1,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 1, // 2\n 'team_id' => 1,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 1, // 3\n 'team_id' => 2,\n 'root_node_id' => 1,\n 'user_id' => 1,\n 'is_active' => true,\n 'is_blocked' => false,\n 'is_free' => false,\n 'is_blocked_global' => false,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 2, // 4\n 'team_id' => 1,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => false,\n 'is_free' => true,\n 'is_blocked_global' => false,\n 'is_free_global' => true,\n ],\n [\n 'parent_id' => 2, // 5\n 'team_id' => 2,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 3, // 6\n 'team_id' => 1,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 3, // 7\n 'team_id' => 2,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 4, // 8\n 'team_id' => 1,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 4, // 9\n 'team_id' => 2,\n 'root_node_id' => 4,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 5, // 10\n 'team_id' => 1,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 5, // 11\n 'team_id' => 2,\n 'root_node_id' => 5,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 6, // 12\n 'team_id' => 1,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 6, // 13\n 'team_id' => 2,\n 'root_node_id' => 6,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 7, // 14\n 'team_id' => 1,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n [\n 'parent_id' => 7, // 15\n 'team_id' => 2,\n 'root_node_id' => 7,\n 'user_id' => null,\n 'is_active' => false,\n 'is_blocked' => true,\n 'is_free' => false,\n 'is_blocked_global' => true,\n 'is_free_global' => false,\n ],\n ]);\n }", "function triangle($side)\r\n {\r\n for ($i = 1; $i <= $side; $i++) {\r\n for ($j = $i; $j < $side; $j++)\r\n echo \" \";\r\n\r\n for (\r\n $j = 1;\r\n $j <= (2 * $i - 1);\r\n $j++\r\n ) {\r\n if (\r\n $i == $side || $j == 1 ||\r\n $j == (2 * $i - 1)\r\n )\r\n echo \"*\";\r\n\r\n else\r\n echo \"*\";\r\n }\r\n echo \"<br>\";\r\n }\r\n }", "private function renderMapRouteMarkerRelations()\n {\n $arrReturn = array();\n $rowsRelation = array();\n\n // Example\n // $relation[0]['MARKER:tx_route_path->tx_route_marker->tx_route_marker_cat->listOf.uid'] = '2.3.10, ;|;2.3.9, ;|;2.3.8, ;|;2.4.10, ;|;2.4.8, ;|;2.4.7, ;|;2.5.10, ;|;2.5.8';\n // '2.3.10' is a relation like\n // tx_route_path.uid -> tx_route_marker.uid -> tx_route_marker_cat.uid\n //\n\n // Get the MARKER relations (each element with a prefix MARKER - see example above)\n $relations = $this->renderMapRouteRelations( 'MARKER' );\n//$this->pObj->dev_var_dump( $relations );\n // Get the key of a relation\n $relationKey = key( $relations[ 0 ] );\n\n // Get the lables for the tables path, marker and markerCat\n list( $prefix, $tables ) = explode( ':', $relationKey );\n unset( $prefix );\n list( $tablePath, $tableMarker, $tableMarkerCat ) = explode( '->', $tables );\n // Get the lables for the tables path, marker and markerCat\n // LOOP relations\n foreach ( $relations as $relation )\n {\n // LOOP relation\n foreach ( $relation as $tablePathMarkerCat )\n {\n $arrTablePathMarkerCat = explode( $this->catDevider, $tablePathMarkerCat );\n // SWITCH : children\n switch ( true )\n {\n // CASE : children\n case( count( $arrTablePathMarkerCat ) > 1 ):\n // LOOP children\n foreach ( $arrTablePathMarkerCat as $arrTablePathMarkerCatChildren )\n {\n list( $pathUid, $markerUid, $catUid ) = explode( '.', $arrTablePathMarkerCatChildren );\n unset( $pathUid );\n $rowsRelation[ $markerUid ][] = $catUid;\n $rowsRelation[ $markerUid ] = array_unique( $rowsRelation[ $markerUid ] );\n }\n // LOOP children\n break;\n // CASE : children\n // CASE : no children\n case( count( $arrTablePathMarkerCat ) == 1 ):\n default:\n list( $pathUid, $markerUid, $catUid ) = explode( '.', $arrTablePathMarkerCatChildren );\n unset( $pathUid );\n $rowsRelation[ $markerUid ][] = $catUid;\n $rowsRelation[ $markerUid ] = array_unique( $rowsRelation[ $markerUid ] );\n break;\n // CASE : no children\n }\n // SWITCH : children\n }\n // LOOP relation\n }\n // LOOP relations\n // $rowsRelation will look like:\n // array(\n // 7 => array( 4, 10, 7 ),\n // 5 => array( 10, 8 ),\n // )\n // array(\n // tableMarker.uid => array ( tableCat.uid, tableCat.uid, tableCat.uid ),\n // tableMarker.uid => array ( tableCat.uid, tableCat.uid, tableCat.uid ),\n // )\n//$this->pObj->dev_var_dump( $rowsRelation );\n $arrReturn[ 'rowsRelation' ] = $rowsRelation;\n $arrReturn[ 'tableCat' ] = $tableMarkerCat;\n $arrReturn[ 'tableMarker' ] = $tableMarker;\n $arrReturn[ 'tablePath' ] = $tablePath;\n\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n $prompt = var_export( $rowsRelation, true );\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n\n return $arrReturn;\n }", "public function insertNode($pid = 1){\n $query = \"\n INSERT INTO `structure`\n (`pid`)\n VALUES\n ('\" . $pid . \"')\n \";\n mysql_query($query);\n\n $id = mysql_insert_id();\n\n $query = \"\n INSERT INTO `structure_data`\n (`id`, `pid`)\n VALUES\n (\" . intval($id) . \", \" . intval($pid) . \")\n \";\n\n mysql_query($query);\n\n $part = $this->checkPart($id, $id);\n $path = $this->getNodePath($id, '', $part);\n\n if($id > 1 && $pid >= 1){\n $new_item_name = $this->new_node_prefix.\" \".$id;\n }else{\n $new_item_name = $this->root_node_name;\n };\n\n //Get all neighbours\n $query = \"\n SELECT `sort`, `id`\n FROM `structure_data`\n WHERE `pid` = \". intval($pid) .\" && `id` != \" . intval($id) . \"\n ORDER BY `sort` ASC\n \";\n\n $result = mysql_query($query);\n\n $sort = 1;\n\n while($row = mysql_fetch_assoc($result)){\n $sort += 1;\n\n $query = \"UPDATE `structure_data` SET `sort` = \" . intval($sort) . \" WHERE `id` = \" . intval($row['id']);\n\n mysql_query($query);\n }\n\n $query = \"\n UPDATE\n `structure_data`\n SET\n `part` = '\".$part.\"',\n `path` = '\".$path.\"',\n `name` = '\".$new_item_name.\"',\n `sort` = 1\n WHERE\n `id` = \".$id;\n\n mysql_query($query);\n\n return $id;\n }", "static function to_list($tree)\n {\n global $hanghoa_arr;\n \n $rs = array();\n foreach($tree as $node)\n {\n $rs[] = $node;\n //if (!empty($node[\"children\"]))\n {\n $list = to_list($node[\"child\"]);\n foreach ($list as $nd)\n {\n $rs[] = $nd;\n //die(\"co den day\");\n }\n }\n }\n \n return $rs;\n }", "public function run()\n {\n $nodes = [\n ['id' => 1, 'name' => 'Organization','parent_id' => null],\n ['id' => 2, 'name' => 'School A', 'parent_id' => 1],\n ['id' => 3, 'name' => 'Classroom A','parent_id' => 2],\n ['id' => 4, 'name' => 'Family AA', 'parent_id' => 3],\n ['id' => 5, 'name' => 'Family AB', 'parent_id' => 3],\n ['id' => 6, 'name' => 'Node AAA', 'parent_id' => 4],\n ['id' => 7, 'name' => 'Node AAB', 'parent_id' => 6],\n ['id' => 8, 'name' => 'Node ABA', 'parent_id' => 5],\n ['id' => 9, 'name' => 'Node ABB', 'parent_id' => 8],\n\n ['id' => 10, 'name' => 'School B', 'parent_id' => 1],\n ['id' => 11, 'name' => 'Classroom BA','parent_id' => 10],\n ['id' => 12, 'name' => 'Family BA', 'parent_id' => 11],\n ['id' => 13, 'name' => 'Family BB', 'parent_id' => 11],\n ['id' => 14, 'name' => 'Classroom BB', 'parent_id' => 10],\n\n ['id' => 15, 'name' => 'School C', 'parent_id' => 1],\n ['id' => 16, 'name' => 'Classroom CA','parent_id' => 15],\n ['id' => 17, 'name' => 'Family CA', 'parent_id' => 16],\n ['id' => 18, 'name' => 'Family CB', 'parent_id' => 16],\n ['id' => 19, 'name' => 'Classroom CB', 'parent_id' => 15]\n ];\n\n foreach ($nodes as $node)\n {\n Node::create($node);\n }\n\n\n }", "function topological_sort($nodeids, $edges) \n {\n\n // initialize variables\n $L = $S = $nodes = array(); \n\n // remove duplicate nodes\n $nodeids = array_unique($nodeids); \t\n\n // remove duplicate edges\n $hashes = array();\n foreach($edges as $k=>$e) {\n $hash = md5(serialize($e));\n if (in_array($hash, $hashes)) { unset($edges[$k]); }\n else { $hashes[] = $hash; }; \n }\n\n // Build a lookup table of each node's edges\n foreach($nodeids as $id) {\n $nodes[$id] = array('in'=>array(), 'out'=>array());\n foreach($edges as $e) {\n if ($id==$e[0]) { $nodes[$id]['out'][]=$e[1]; }\n if ($id==$e[1]) { $nodes[$id]['in'][]=$e[0]; }\n }\n }\n\n // While we have nodes left, we pick a node with no inbound edges, \n // remove it and its edges from the graph, and add it to the end \n // of the sorted list.\n foreach ($nodes as $id=>$n) { if (empty($n['in'])) $S[]=$id; }\n while (!empty($S)) {\n $L[] = $id = array_shift($S);\n foreach($nodes[$id]['out'] as $m) {\n $nodes[$m]['in'] = array_diff($nodes[$m]['in'], array($id));\n if (empty($nodes[$m]['in'])) { $S[] = $m; }\n }\n $nodes[$id]['out'] = array();\n }\n\n // Check if we have any edges left unprocessed\n foreach($nodes as $n) {\n if (!empty($n['in']) or !empty($n['out'])) {\n return null; // not sortable as graph is cyclic\n }\n }\n return $L;\n }", "function inflate($list){\n $r = array();\n $flat = array();\n foreach($list as $val)\n {\n $flat[$val['id']] = $val;\n }\n foreach($list as $val)\n {\n if(!isset($flat[$val['parent']])) {\n $r[$val['id']] = &$flat[$val['id']];\n }\n else {\n if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array();\n $flat[$val['parent']]['children'][] = &$flat[$val['id']];\n }\n }\n return $r;\n}" ]
[ "0.5256264", "0.52509886", "0.50479543", "0.5011412", "0.5004075", "0.49605194", "0.49559468", "0.49156216", "0.48922148", "0.4892187", "0.47608623", "0.47534987", "0.47386256", "0.4727614", "0.47189423", "0.47152692", "0.4696798", "0.46783665", "0.4643541", "0.46364123", "0.46170092", "0.46167344", "0.4612409", "0.46118233", "0.4598471", "0.45650804", "0.4536619", "0.4512681", "0.44876277", "0.44829047" ]
0.671982
0
calculate the maximum route value
function maxRouteVal($tri_graph) { $maxVal = 0; for($i = 0; $i < count($tri_graph);++$i) { $row = $tri_graph[$i]; for($j = 0; $j < count($row);++$j) { $currVal = $row[$j]->sendValue(); if($currVal > $maxVal) $maxVal = $currVal; } } return $maxVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteDistanceLimit()\n {\n return $this->route_distance_limit;\n }", "public function getMax();", "protected function get_cost_route($route){\r\n $valor = 0;\r\n foreach ($route as $index => $city){\r\n if($index > 0){\r\n $valor += $this->connections[$city][$route[$index-1]];\r\n }\r\n }\r\n return $valor;\r\n }", "public function getMax(): float;", "function max() { return $this->max; }", "protected function _getMax(): int\n {\n $field = $this->_config['right'];\n $rightField = $this->_config['rightField'];\n $edge = $this->_scope($this->_table->find())\n ->select([$field])\n ->orderByDesc($rightField)\n ->first();\n\n if ($edge === null || empty($edge[$field])) {\n return 0;\n }\n\n return $edge[$field];\n }", "public function getMaximum() {\r\n return $this->maximumvalue;\r\n }", "public function usedVO2maxValue()\n {\n if (Configuration::VO2max()->useElevationCorrection()) {\n if ($this->Activity->vo2maxWithElevation() > 0) {\n return $this->Activity->vo2maxWithElevation();\n }\n }\n\n return $this->Activity->vo2maxByHeartRate();\n }", "public function getMax() {\n return $this->max;\n }", "public static function getApproxMaxTour()\n\t{\n\t\t$playersCount = Yii::app()->db->createCommand()\n\t\t\t->select('count(*)')\n\t\t\t->from(Player::tableName())\n\t\t\t->queryScalar();\n\t\t$tourCount=ceil(log($playersCount,2)) + ceil(log(Yii::app()->params['accuracyCount'],2));\n\t\treturn (int)$tourCount;\n\t}", "public function getMaxBaths();", "function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }", "public function getMaximum()\n {\n return $this->max;\n }", "public function getMaxArea();", "public function getMaxValue();", "public function getMaxValue();", "public function getMax()\n {\n return $this->_fMax;\n }", "public function getMaxLng() {\n return $this->maxLng;\n }", "protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }", "public function getMaxPoint()\n {\n $maxPoint = 0;\n foreach ($this->jawaban as $jawaban)\n if ($jawaban->poin > $maxPoint)\n $maxPoint = $jawaban->poin;\n\n return $maxPoint;\n }", "public function getMaximum()\n {\n return $this->maximum;\n }", "public function getMax()\n {\n return $this->_maxValue;\n }", "public function maxNorm() : float\n {\n return $this->abs()->max()->max();\n }", "public function max()\n {\n $maximum = round($this->centre + $this->centre * $this->deviation);\n\n return $this->unsigned ? max($maximum, 0) : $maximum;\n }", "public function getMaxMenuPosition()\n {\n $value=DB::table('links')\n ->max('menu_position');\n return $value;\n }", "function getMax() { return $this->readMaxValue(); }", "function MaxLongitude() {\n return $GLOBALS[\"maxLong\"];\n }", "public function getMax(): int;", "public function getMaxPerIp()\n {\n return $this->maxPerIp;\n }", "public function getMaxPoints() {}" ]
[ "0.6294595", "0.6195342", "0.6154812", "0.6141669", "0.6039736", "0.5939455", "0.59179676", "0.5909401", "0.58686435", "0.58636826", "0.5849472", "0.581767", "0.5789073", "0.57845426", "0.5776645", "0.5776645", "0.57746357", "0.5770049", "0.57431316", "0.57408214", "0.5737634", "0.57365894", "0.57073283", "0.5689416", "0.56808823", "0.56785595", "0.565943", "0.5644822", "0.5612189", "0.55909646" ]
0.8221202
0
create a 2d triangle array from a string
function initTriArray($tri_str) { $tri_A = explode("\n",$tri_str); for($i = 0; $i < count($tri_A); ++$i) { $tri_A[$i] = explode(" ",$tri_A[$i]); } return $tri_A; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_matrix($str)\r\n{\r\n $str = preg_replace('/[^\\w]/', '', $str);\r\n if (strlen($str) != 400 || !is_numeric($str)) {\r\n echo \"not valid input format\" . \"<br>\";\r\n return False;\r\n }\r\n $str_arr = str_split($str);\r\n $index = 0;\r\n $matrix = [];\r\n for ($i = 0; $i < 20; $i++) {\r\n $sub_arr = [];\r\n array_push($matrix, $sub_arr);\r\n for ($j = 0; $j < 20; $j++) {\r\n array_push($matrix[$i], $str_arr[$index]);\r\n $index++;\r\n }\r\n }\r\n return $matrix;\r\n\r\n}", "function triangle($n) {\n $offset = ($n * 2) -1;\n for($i=0; $i < $offset; $i++) {\n if($i < $n - 1 && $n < $offset) {\n $position = \"top\";\n $number = $n + $i;\n echo string_pattern($number, $position, $offset, $n);\n }\n if($i == $n - 1) {\n $position = \"middle\";\n $number = $n + $i;\n echo string_pattern($number, $position, $offset, $n);\n }\n if($i > $n - 1) {\n $position = 'bottom';\n $number = $offset - ($i - $n + 1);\n // echo $number;\n echo string_pattern($number, $position, $offset, $n);\n }\n echo \"<br/>\";\n }\n \n }", "function make_2d($x, $y)\n{\n for ($_x = 0; $_x < $x; $_x++) {\n for ($_y = 0; $_y < $y; $_y++) {\n $a[$_x][$_y] = \"x{$_x}y{$_y}\";\n }\n }\n return $a;\n}", "public function triangleCreate($x1, $y1, $x2, $y2, $x3, $y3){\n\n $this->createLine($x1, $y1, $x2, $y2); \n $this->createLine($x2, $y2, $x3, $y3); \n $this->createLine($x1, $y1, $x3, $y3);\n }", "function build_tab_array($arrNotes, $arrStrings, $arrSetup, $pos = 0) {\n // create our chord info\n $arrChord = array(\"1\" => \"\", \"2\" => \"\", \"3\" => \"\", \"4\" => \"\", \"5\" => \"\", \"6\" => \"\");\n \n // loop through our strings to start processing\n for ($i = 1; $i <= 6; $i++) {\n // loop from our starting position up 4 frets\n for ($n = $pos; $n < $pos + 5; $n++) {\n // if this note is in our array, add it\n if (in_array($arrStrings[$i][$n], $arrSetup)) {\n // if not data is here, add it now\n if (!strlen($arrChord[$i])) {\n $arrChord[$i] = $n;\n }\n }\n }\n }\n \n // walk back through the array and set the last note as the root\n /*for ($i = 6; $i >= 4; $i--) {\n // if this value is the root, stop here\n if ($arrStrings[$i][$arrChord[$i]] == $arrNotes[0]) {\n break;\n } else {\n // reset the value\n $arrChord[$i] = \"\";\n }\n }*/\n \n // return the array\n return $arrChord;\n }", "function create_tab_array($notes, $strings, $start, $end) {\n // create our array\n $arrTab = array(1 => array(), 2 => array(), 3 => array(), 4 => array(), 5 => array(), 6 => array());\n \n // loop through our strings\n for ($i = 1; $i <= 6; $i++) {\n // loop through our frets\n for ($n = $start; $n <= $end; $n++) {\n // only process it if it's not on another string\n if ($i != 3 || ($i == 3 && !find_string_notes(2, $strings[$i][$n], $strings, $start, $end))) {\n // if this value is in our array, add it\n if (in_array($strings[$i][$n], $notes)) {\n $arrTab[$i][] = $n;\n }\n }\n }\n }\n \n // return the array\n return $arrTab;\n }", "function triangle(int $jumlah) {\r\n\tfor ($i = $jumlah; $i >= 1; $i--) {\r\n\t \r\n\t\tif ($i == $jumlah){\r\n\t\t\tfor($j=$i;$j>=1;$j--){\r\n\t\t\t\techo \" \".\"*\".\" \";\r\n\t\t\t\t\r\n \t\t}\r\n\t\t\techo \"</br>\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Loop added for outer spacing\r\n\t\t\t for ($j = $jumlah; $j > $i; $j--) {\r\n\t\t\t\techo \"  \";\r\n\t\t\t }\r\n\t\t\t echo \"*\";\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t //Loop added for internal spacing\r\n\t\t\t for ($j = 1; $j < ($i - 1) * 2; $j++) {\r\n\t\t\t echo \"  \";\r\n\t\t\t }\r\n\t\t\t if ($i == 1)\r\n\t\t\t echo \"</br>\";\r\n\t\t\t else\r\n\t\t\t echo \"*</br>\";\r\n\t\t}\r\n\t\t\r\n\t \r\n\t}\r\n\t\r\n}", "function strTojugada($str){\n $v = explode(\",\",$str);\n $re['palabra'] = preg_replace(\"/'/\", '', trim($v[1]));\n $re['ini']['x'] = trim(str_replace(\"(\",'',$v[2]));\n $re['ini']['y'] = trim(str_replace(\")\",'',$v[3]));\n $re['end']['x'] = trim(str_replace(\"(\",'',$v[4]));\n $re['end']['y'] = trim(str_replace(\")\",'',$v[5]));\n if($re['ini']['y']==$re['end']['y']) $re['o'] = 'h';\n if($re['ini']['x']==$re['end']['x']) $re['o'] = 'v';\n\t\t\techo '<pre>';\n\t\t\tvar_dump($re);\n\t\t\techo '<pre>';\n return $re;\n }", "public function formatTriangle(array $triangle): string\n {\n if (empty($triangle) || empty($triangle[0])) {\n return '';\n }\n\n $output = '';\n $maxChars = strlen((string)max(max($triangle)));\n $tabSpace = str_repeat(' ', $maxChars);\n $totalRows = count($triangle);\n\n foreach ($triangle as $rowNum => $row) {\n $output .= str_repeat($tabSpace, ($totalRows - $rowNum - 1));\n\n foreach ($row as $key => $value) {\n if ($key !== array_key_first($row)) {\n $output .= $tabSpace;\n $output .= str_repeat(' ', $maxChars - strlen((string)$value));\n }\n\n $output .= $value;\n }\n $output .= \"\\n\";\n }\n\n return $output;\n }", "public function createArray($str) {\n\t\t$str = substr($str, 0, -1);\n\t\treturn explode(',', $str);\n\t}", "function triangle($side)\r\n {\r\n for ($i = 1; $i <= $side; $i++) {\r\n for ($j = $i; $j < $side; $j++)\r\n echo \" \";\r\n\r\n for (\r\n $j = 1;\r\n $j <= (2 * $i - 1);\r\n $j++\r\n ) {\r\n if (\r\n $i == $side || $j == 1 ||\r\n $j == (2 * $i - 1)\r\n )\r\n echo \"*\";\r\n\r\n else\r\n echo \"*\";\r\n }\r\n echo \"<br>\";\r\n }\r\n }", "function iniTriGraph($tri_A)\n{\n\t$tri_graph = [];\n\n\t//create the nodes of the graph\n\tforeach($tri_A as $i => $row)\n\t{\n\t\t$tri_graph[$i] =[];\n\t\tforeach($row as $j=> $val)\n\t\t{\n\t\t\t$tri_graph[$i][$j] = new TriElement($val,null,null); \n\n\t\t}\n\n\t}\n\n\t//assign the parents and children relationship to each node \n\tfor($i = 0; $i < count($tri_graph)-1;++$i)\n\t{\n\t\t$row = $tri_graph[$i];\n\t\t$next_row = $tri_graph[$i+1];\n\t\tfor($j = 0; $j < count($row);++$j)\n\t\t{\n\t\t\t$left_child = $next_row[$j];\n\t\t\t$right_child = $next_row[$j+1];\n\t\t\t$row[$j]->addChild($left_child,$right_child);\n\n\t\t}\n\n\t}\n\n\treturn $tri_graph;\n\n\n}", "public function wktBuildLinestring(array $points);", "public function Generate($str = '')\n {\n $trees = $this->parser->Parse($str);\n $segments = [];\n foreach ($trees as $tree) {\n $segments[] = $this->ProcessTree($tree);\n }\n return $segments;\n }", "function hexagon($length)\r\n {\r\n\r\n for (\r\n $i = 1, $k = $length,\r\n $l = 2 * $length - 1;\r\n $i < $length;\r\n $i++, $k--, $l++\r\n ) {\r\n for ($j = 0; $j < 3 * $length; $j++)\r\n if ($j >= $k && $j <= $l)\r\n echo \"*\";\r\n\r\n else\r\n echo \"&nbsp;&nbsp;\";\r\n echo \"<br>\";\r\n }\r\n for (\r\n $i = 0, $k = 1, $l = 3 * $length - 2;\r\n $i < $length;\r\n $i++, $k++, $l--\r\n ) {\r\n for ($j = 0; $j < 3 * $length; $j++)\r\n if ($j >= $k && $j <= $l)\r\n echo \"*\";\r\n else\r\n echo \"&nbsp;&nbsp;\";\r\n echo \"<br>\";\r\n }\r\n }", "public function generateMatrix($chars, $start_range, $length){\r\n\t\t$matrix = array();\r\n\t\t$trigger = $this->string['count'];\r\n\t\t$char_count = count($chars);\r\n\t\t$y = $start_range[0];\r\n\t\t$range = 0;\r\n\t\tfor($i = 0; $i < $length; $i++){\r\n\t\t\tif($trigger < 1){\r\n\t\t\t\t$trigger = $this->string['count'];\r\n\t\t\t}if($range > count($start_range)-1){\r\n\t\t\t\t$range = 0;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$trigger--;\r\n\t\t\t}\r\n\t\t\t$y = $y + $trigger + $start_range[$range] + $length;\r\n\t\t\t$matrix[$i] = $chars[$y%$char_count];\r\n\t\t\t$range++;\r\n\t\t}\r\n\t\treturn $matrix;\r\n\t}", "public function urlarray($string = '') {\n $a = explode('/', strtolower($string));\n $array = array();\n $key = '';\n foreach($a as $k => $v){\n if($k % 2 == 0){\n $key = $v;\n } else {\n $array[$key] = $v;\n }\n }\n return $array;\n }", "private function fillWireGrid($input): array\n {\n $grid = [0 => [0 => \"B\"]];\n\n foreach($input as $line_number => $line) {\n $last_x_cor = 0;\n $last_y_cor = 0;\n $line_steps = 0;\n foreach ($line as $instruction) {\n // A letter as dir and a number as cor the direction determines X or Y the number how much\n $direction = substr($instruction, 0, 1);\n $cor = (int) substr($instruction, 1);\n\n switch ($direction) {\n case \"U\":\n for ($new_x_cor = $last_x_cor + 1; $new_x_cor <= $last_x_cor + $cor; $new_x_cor++) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $new_x_cor, $last_y_cor, $line_steps);\n }\n $last_x_cor = $last_x_cor + $cor;\n break;\n case \"D\":\n for ($new_x_cor = $last_x_cor - 1; $new_x_cor >= $last_x_cor - $cor; $new_x_cor--) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $new_x_cor, $last_y_cor, $line_steps);\n }\n $last_x_cor = $last_x_cor - $cor;\n break;\n case \"R\":\n for ($new_y_cor = $last_y_cor + 1; $new_y_cor <= $last_y_cor + $cor; $new_y_cor++) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $last_x_cor, $new_y_cor, $line_steps);\n }\n $last_y_cor = $last_y_cor + $cor;\n break;\n case \"L\":\n for ($new_y_cor = $last_y_cor - 1; $new_y_cor >= $last_y_cor - $cor; $new_y_cor--) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $last_x_cor, $new_y_cor, $line_steps);\n }\n $last_y_cor = $last_y_cor - $cor;\n break;\n }\n }\n }\n\n return $grid;\n }", "public function text_bitmap($text) \r\n { \r\n $height=count($this->ascii_table[0]); \r\n $width=count($this->ascii_table[0][0]); \r\n\r\n $result=array(); \r\n $baseY=$baseX=0; \r\n for ($index=0;$index<strlen($text);++$index) \r\n { \r\n if ($text[$index]==PHP_EOL) \r\n { \r\n $baseY+=$height; \r\n $baseX=0; \r\n continue; \r\n } \r\n $ascii_entry=$this->ascii_table[ord($text[$index])]; \r\n for ($j=0;$j<$height;++$j) \r\n { \r\n for ($i=0;$i<$width;++$i) \r\n $result[$baseY+$j][$baseX+$i]=$ascii_entry[$j][$i]; \r\n $result[$baseY+$j][$baseX+$width]=1; //space between chars \r\n } \r\n $baseX+=$width; \r\n } \r\n return $result; \r\n }", "function triangle($n) {\n\treturn $n * ($n + 1) / 2;\n}", "function qr_split($qr){\n\t$arr = array();\n\n\t$acc = NULL;\n\tfor($i = 0; $i < strlen($qr); $i++){\n\t\t$ch = $qr[$i];\n\n\t\tif(is_separator($ch)){\n\t\t\t// pokud je to separator, je nutno oddelit\n\t\t\tif(!empty($acc)){\n\t\t\t\tarray_push($arr, $acc);\n\t\t\t\t$acc = NULL;\n\t\t\t}\n\n\t\t\tif(is_operator($ch))\n\t\t\t\tarray_push($arr, $ch);\n\t\t\telse if($ch == '\"'){\n\t\t\t\t$str = $ch;\n\t\t\t\tfor($i = $i+1; $i < strlen($qr); $i++){\n\t\t\t\t\t$ch = $qr[$i];\n\n\t\t\t\t\tif($ch != '\"'){\n\t\t\t\t\t\t$str .= $ch;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$str .= $ch;\n\t\t\t\t\t\tarray_push($arr, $str);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$acc .= $ch;\n\t\t}\n\t}\n\tif(!empty($acc))\n\t\tarray_push($arr, $acc);\n\treturn $arr;\n}", "protected static function assembleParts(array $parts): array\n {\n $polygons = [];\n $count = count($parts);\n\n for ($i = 0; $i < $count; $i++) {\n if ($i % 2 !== 0) {\n [$end, $start] = explode(',', (string) $parts[$i]);\n $polygons[$i - 1] .= $end;\n $polygons[++$i] = $start.$parts[$i];\n } else {\n $polygons[] = $parts[$i];\n }\n }\n\n return $polygons;\n }", "public static function toArray($string)\n {\n return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);\n }", "public static function relationStringToArray($string)\n {\n return explode('->', $string); \n }", "function init_sudoku(array $array_str_sudoku): array\r\n{\r\n $line = 0;\r\n foreach ($array_str_sudoku as $str_sudoku_line) {\r\n if (is_numeric($str_sudoku_line[0]) || $str_sudoku_line[0] === \"_\") {\r\n $col = 0;\r\n for ($i = 0; $i < strlen($str_sudoku_line); $i++) {\r\n if (is_numeric($str_sudoku_line[$i]) || $str_sudoku_line[$i] === \"_\") {\r\n $sudoku[$line][$col] = (int) $str_sudoku_line[$i];\r\n $col++;\r\n }\r\n }\r\n $line++;\r\n }\r\n }\r\n return $sudoku;\r\n}", "public function buildArray($string)\r\n {\r\n if (strlen($string))\r\n {\r\n return explode(',', preg_replace('/\\{|\\}/', '', $string));\r\n }\r\n \r\n return array();\r\n }", "private function parseGrid($str){\n\t\t//TODO\n\t\treturn array();\n\t}", "public static function splitStringToCourseCode($str) {\n $str = trim($str);\n $parent = \"\";\n $child = \"\";\n $arr = [];\n preg_match('/^[a-zA-Z]+/',$str, $arr);\n if(sizeof($arr)>0){\n $parent = $arr[0];\n }else{\n $arr[0] = \"\";\n }\n $child = substr($str, strlen($parent));\n $arr[1] = $child;\n return $arr;\n }", "public function fromString(string $string): array;", "public static function multiLineStringToArray($string) {\n return preg_split(\"/\\r?\\n/\", $string);\n }" ]
[ "0.6382838", "0.5850405", "0.5475204", "0.5189103", "0.5186087", "0.5109182", "0.5087531", "0.5084745", "0.5059777", "0.5045231", "0.4955583", "0.49106112", "0.48780647", "0.4864545", "0.48521882", "0.47950527", "0.4784593", "0.47802445", "0.47741622", "0.47734046", "0.47605005", "0.4731675", "0.4701952", "0.46897066", "0.46842337", "0.46806094", "0.46739662", "0.46735412", "0.46598327", "0.4658003" ]
0.69291425
0
Get type of this box.
public function getType(): string { return self::$BOX_TYPE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBoxType()\n {\n return $this->get(self::_BOX_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 get_type() {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function get_type() {\n return $this->type;\n }", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }", "public function get_type() {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "function getType () {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}" ]
[ "0.858142", "0.78447074", "0.78447074", "0.78447074", "0.7844628", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.78438526", "0.7842846", "0.78116", "0.78116", "0.78100586", "0.77960575", "0.77960575", "0.77960575", "0.77960575", "0.77960575", "0.77960575", "0.77960575", "0.7776968", "0.77748376", "0.77748376", "0.77748376" ]
0.8421781
1
Get default input ports for this box.
public function getDefaultInputPorts(): array { self::init(); return self::$defaultInputPorts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultOutputPorts(): array\n {\n self::init();\n return self::$defaultOutputPorts;\n }", "public function getDefaultOutputPorts(): array\n {\n self::init();\n return self::$defaultOutputPorts;\n }", "protected function getDefaultPort()\n {\n return $this->scheme !== '' ? static::$defaultPorts[$this->scheme] : null;\n }", "public function getPorts()\n {\n return $this->_ports;\n }", "public function getPorts(): array\n {\n return $this->getSpec('ports', []);\n }", "public function GetAllowedPorts () {\n\t\treturn $this->allowedPorts;\n\t}", "public function ports() {\n // Query each HttpRequest object sequentially, and add to a master list.\n // If HTTP is used and no port is specified, then add 80\n // If HTTPS is used and no port is specified, then add 443\n $ports = array();\n foreach ($this->requests as $request) {\n $url = $request->url;\n $port = parse_url($url, PHP_URL_PORT);\n $scheme = parse_url($url, PHP_URL_SCHEME);\n if (($scheme == \"http\") && ($port == null)) {\n $port = 80;\n } else if (($scheme == \"https\") && ($port == null)) {\n $port = 443;\n }\n if (!in_array($port, $ports)) {\n $ports[] = $port;\n }\n }\n return $ports;\n }", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort();", "public function defaultPort()\n {\n return getservbyname($this->scheme ? $this->scheme : 'http', 'tcp');\n }", "public function getPort() {}", "abstract public function getMaxPorts();", "public function GetAllowPorts () {\n\t\treturn $this->allowPorts;\n\t}", "public function getPortBindings()\n {\n return $this->_portBindings;\n }", "public function getDefaultPort() : ?int\n {\n $scheme = strtolower($this->scheme);\n\n return self::$defaultPorts[$scheme] ?? null;\n }", "public function getPortList()\n {\n $value = $this->get(self::PORTLIST);\n return $value === null ? (string)$value : $value;\n }", "public function ports()\n {\n $ports = [];\n $port_list = config( 'pw-api.ports' );\n foreach ( $port_list as $name => $port )\n {\n $ports[$name]['port'] = $port;\n $ports[$name]['open'] = @fsockopen( setting('server.ip', '127.0.0.1'), $port, $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }\n return $ports;\n }", "public function getStandardPorts($scheme);", "public function getBasePort()\n {\n return (int)$this['base.port'];\n }", "protected function getConfiguredPort() {}", "protected function getConfiguredOrDefaultPort() {}", "public function getPort(): int;", "public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }", "public static function getLoginInputs()\n\t{\n\t\treturn Input::newCollection([\n\t\t\t['login', 'login', 'text'],\n\t\t\t['password', 'password', 'password']\n\t\t]);\n\t}", "public function getPort():? int;", "public function getPort() {\n return @$this->attributes['port'];\n }", "public function getPort()\n {\n\n $scheme = $this->getScheme();\n if (empty($this->_port) || (\n (isset(self::$_defaultPorts[$scheme]) && $this->_port === self::$_defaultPorts[$scheme])\n )) {\n\n return null;\n }\n\n return $this->_port;\n }", "final public function getPort(): int {}" ]
[ "0.75924945", "0.75924945", "0.6323287", "0.613309", "0.6043221", "0.60232925", "0.59844565", "0.59638757", "0.59638757", "0.59638757", "0.59638757", "0.5823332", "0.57766944", "0.5741398", "0.5734366", "0.5715268", "0.57088673", "0.56749153", "0.56464875", "0.5589411", "0.55757076", "0.55577207", "0.5400835", "0.53615785", "0.5349364", "0.5314545", "0.52458686", "0.5232783", "0.51789224", "0.51766163" ]
0.84118474
1
Get default output ports for this box.
public function getDefaultOutputPorts(): array { self::init(); return self::$defaultOutputPorts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultInputPorts(): array\n {\n self::init();\n return self::$defaultInputPorts;\n }", "public function getDefaultInputPorts(): array\n {\n self::init();\n return self::$defaultInputPorts;\n }", "public function getPorts()\n {\n return $this->_ports;\n }", "protected function getDefaultPort()\n {\n return $this->scheme !== '' ? static::$defaultPorts[$this->scheme] : null;\n }", "public function getPortList()\n {\n $value = $this->get(self::PORTLIST);\n return $value === null ? (string)$value : $value;\n }", "public function getPorts(): array\n {\n return $this->getSpec('ports', []);\n }", "public function getPort();", "public function getPort();", "public function getPort();", "public function getPort();", "public function defaultPort()\n {\n return getservbyname($this->scheme ? $this->scheme : 'http', 'tcp');\n }", "public function getPortBindings()\n {\n return $this->_portBindings;\n }", "public function getPort() {}", "public function ports() {\n // Query each HttpRequest object sequentially, and add to a master list.\n // If HTTP is used and no port is specified, then add 80\n // If HTTPS is used and no port is specified, then add 443\n $ports = array();\n foreach ($this->requests as $request) {\n $url = $request->url;\n $port = parse_url($url, PHP_URL_PORT);\n $scheme = parse_url($url, PHP_URL_SCHEME);\n if (($scheme == \"http\") && ($port == null)) {\n $port = 80;\n } else if (($scheme == \"https\") && ($port == null)) {\n $port = 443;\n }\n if (!in_array($port, $ports)) {\n $ports[] = $port;\n }\n }\n return $ports;\n }", "public function ports()\n {\n $ports = [];\n $port_list = config( 'pw-api.ports' );\n foreach ( $port_list as $name => $port )\n {\n $ports[$name]['port'] = $port;\n $ports[$name]['open'] = @fsockopen( setting('server.ip', '127.0.0.1'), $port, $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }\n return $ports;\n }", "public function GetAllowedPorts () {\n\t\treturn $this->allowedPorts;\n\t}", "protected function getConfiguredPort() {}", "abstract public function getMaxPorts();", "public function getStandardPorts($scheme);", "protected function getConfiguredOrDefaultPort() {}", "public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }", "public function getDefaultPort() : ?int\n {\n $scheme = strtolower($this->scheme);\n\n return self::$defaultPorts[$scheme] ?? null;\n }", "public function GetAllowPorts () {\n\t\treturn $this->allowPorts;\n\t}", "public function export(): array {\n $defaultPort = $this->crypto ? 443 : 80;\n\n if (isset($this->interfaces)) {\n $interfaces = array_unique($this->interfaces, SORT_REGULAR);\n } else {\n $interfaces = [[\"::\", $defaultPort]];\n if (self::separateIPv4Binding()) {\n $interfaces[] = [\"0.0.0.0\", $defaultPort];\n }\n }\n\n return [\n \"interfaces\" => $interfaces,\n \"name\" => $this->name,\n \"crypto\" => $this->crypto,\n \"actions\" => $this->actions,\n \"httpdriver\" => $this->httpDriver,\n ];\n }", "protected function getDefaultPort(): string\n {\n return (string)rand(3000, 9999);\n }", "public function getBasePort()\n {\n return (int)$this['base.port'];\n }", "protected function getConfigDefaults() {\n\t\treturn array(\n\t\t\t// @todo add description strings\n\t\t\t'port' => 80,\n\t\t\t'expose' => 1,\n\t\t);\n\t}", "public function getPort()\n {\n return isset($this->Port) ? $this->Port : null;\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }", "public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }" ]
[ "0.7342243", "0.7342243", "0.6346949", "0.6149809", "0.6126292", "0.6120841", "0.59917814", "0.59917814", "0.59917814", "0.59917814", "0.597571", "0.58993393", "0.58749497", "0.5769901", "0.5693711", "0.56882685", "0.56848174", "0.5658556", "0.55399734", "0.5521865", "0.54919356", "0.5491571", "0.54712117", "0.5393036", "0.53801465", "0.53624", "0.5347056", "0.53134245", "0.52361107", "0.52361107" ]
0.8415616
1
Get default name of this box.
public function getDefaultName(): string { return self::$DEFAULT_NAME; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function default_name(): mixed\n\t{\n\t\treturn self::$query->default_name;\n\t}", "function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }", "function get_name()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_NAME);\r\n }", "public function getDefault(): string\n {\n return $this->default;\n }", "public function getDefault(): string\n {\n return $this->default;\n }", "public function defaultNodeName()\n {\n return $this->defaultNodeName;\n }", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "function get_default_name()\n\t{\n\t\treturn 'Cuboid Blog Skin';\n\t}", "public function getDefaultStateName() {\n return $this->values->get('DefaultStateName');\n }", "public function defaultName() { return \"Enter the category name...\"; }", "protected function getDefaultName()\n {\n $name = str_replace(\n ['-', '_'],\n ' ',\n $this->getCurrentDir()\n );\n\n return ucwords($name);\n }", "public function getDefaultGatewayName()\n {\n return $this->settings['default'];\n }", "public function getAssignmentDefaultName(): string;", "public function get_name() {\r\n\t\treturn '';\r\n\t}", "public function get_name() {\r\n\t\treturn $this->options['name'];\r\n\t}", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function defaultNodeTitle()\n {\n return $this->defaultNodeTitle;\n }", "public function getName()\n {\n return ($this->_widgetEditor->getForm() ? $this->_widgetEditor->getForm()->getName() : null);\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "public function get_name() : string\n {\n return $this->additional['name'] ?? '';\n }", "public function getName()\n {\n return '';\n }", "public function getName()\n {\n return '';\n }", "public function getDefaultVal(): string\n {\n return $this->defaultText;\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : null;\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : null;\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }" ]
[ "0.74601734", "0.73229134", "0.73194414", "0.6981649", "0.6981649", "0.6938036", "0.6904179", "0.68459344", "0.6804738", "0.67755085", "0.6744741", "0.67001015", "0.66119903", "0.66018057", "0.6597491", "0.6543227", "0.6543227", "0.6543227", "0.6543227", "0.6491213", "0.64678186", "0.6443245", "0.64398295", "0.64162004", "0.64162004", "0.6414538", "0.6401574", "0.6401574", "0.63927096", "0.63927096" ]
0.7830887
1
Update attribute mass action observer for observing attributes, inventory and websites events
public function afterUpdateAttributes(Varien_Event_Observer $observer) { $eventName = $observer->getEvent()->getName(); switch ($eventName) { case "catalog_product_attribute_update_after": $productIds = $observer->getEvent()->getProductIds(); break; case "catalog_product_stock_item_mass_change": case "catalog_product_to_website_change": $productIds = $observer->getEvent()->getProducts(); break; default: $productIds = array(); break; } if (! empty($productIds)) { Mage::getResourceModel('ddg_automation/catalog')->setUnProcessed($productIds); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function mass_update();", "protected function updateAction()\n {\n }", "public function actionUpdateAttribute()\n {\n Yii::trace(\"In actionUpdateAttribute.\", \"application.controllers.ContactController\");\n \n // Default to HTML output!\n $outputFormat = \"html\";\n \n if(isset($_POST['output']) && ($_POST['output'] == 'xml' || $_POST['output'] == 'json')) {\n $outputFormat = $_POST['output'];\n }\n \n // We only update via a POST and AJAX request!\n $id = isset($_POST['id']) && is_numeric($_POST['id']) && $_POST['id'] > 0 ? (integer)$_POST['id'] : 0;\n $pk = isset($_POST['pk']) && is_numeric($_POST['pk']) && $_POST['pk'] > 0 ? (integer)$_POST['pk'] : 0;\n $aid = isset($_POST['aid']) && is_numeric($_POST['aid']) && $_POST['aid'] > 0 ? (integer)$_POST['aid'] : 0;\n $get_available = isset($_POST['get_available']) && is_numeric($_POST['get_available']) && $_POST['get_available'] > 0 ? (integer)$_POST['get_available'] : 0;\n $get_assigned = isset($_POST['$get_assigned']) && is_numeric($_POST['$get_assigned']) && $_POST['$get_assigned'] > 0 ? (integer)$_POST['$get_assigned'] : 0;\n \n if($id == 0) {\n // Work around an editable side-effect after adding a new record.\n $id = $pk;\n }\n \n // Verify we have a valid ID!\n if($id <= 0 || $pk <= 0 || $id !== $pk) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, 'Invalid parameters');\n }\n\n $this->sendResponseHeaders(400, 'json');\n \n echo json_encode(\n array(\n 'success' => false,\n 'error' => 'Invalid parameters',\n )\n );\n Yii::app()->end();\n }\n \n // Always grab the currently logged in user's ID.\n $uid = Yii::app()->user->id;\n \n if($aid > 0) {\n // Load the Arena model and ensure that the user is assigned to it!\n $arena = $this->loadArenaModel($aid, $outputFormat);\n \n // And that the user has permission to update it!\n if(!Yii::app()->user->isRestrictedArenaManager() || !$arena->isUserAssigned($uid)) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(403, 'Permission denied. You are not authorized to perform this action.');\n }\n \n $this->sendResponseHeaders(403, 'json');\n echo json_encode(array(\n 'success' => false,\n 'error' => 'Permission denied. You are not authorized to perform this action.'\n )\n );\n Yii::app()->end();\n }\n } else {\n if(!Yii::app()->user->isRestrictedArenaManager()) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(403, 'Permission denied. You are not authorized to perform this action.');\n }\n \n $this->sendResponseHeaders(403, 'json');\n echo json_encode(array(\n 'success' => false,\n 'error' => 'Permission denied. You are not authorized to perform this action.'\n )\n );\n Yii::app()->end();\n }\n }\n \n // We need to grab and validate the rest of our parameters from the request body\n // We will update one attribute at a time!\n \n // Grab the remaining parameters!\n $name = isset($_POST['name']) ? $_POST['name'] : null;\n $value = isset($_POST['value']) ? $_POST['value'] : null;\n $aids = isset($_POST['aids']) ? $_POST['aids'] : null;\n\n // Validate our remaining parameters!\n if($name === null) {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, 'Invalid parameters');\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => 'Invalid parameters',\n )\n );\n Yii::app()->end();\n }\n \n // Ok, we have what appear to be valid parameters and so\n // it is time to validate and then update the value!\n if($name == 'assign' || $name == 'unassign') {\n \n if((is_array($value) && count($value) > 0 && $aid > 0) || (is_array($aids) && count($aids) > 0)) {\n $valid = 1;\n \n if($aid <= 0 ) {\n $model = $this->loadModel($id, $outputFormat);\n }\n } else {\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, 'Invalid parameters');\n }\n \n $this->sendResponseHeaders(400, 'json');\n \n echo json_encode(\n array(\n 'success' => false,\n 'error' => 'Invalid parameters',\n )\n );\n Yii::app()->end();\n } \n } else {\n $model = $this->loadModel($id, $outputFormat);\n $model->$name = $value;\n \n $attribs = array($name);\n \n $valid = $model->validate($attribs);\n }\n \n if(!$valid) {\n $errors = $model->getErrors($name);\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n $output = '';\n\n foreach($errors as $error) {\n if($output == '') {\n $output = $error;\n } else {\n $output .= \"\\n\" . $error;\n }\n }\n throw new CHttpException(400, $output);\n }\n \n $this->sendResponseHeaders(400, 'json');\n \n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($errors),\n )\n );\n Yii::app()->end();\n }\n \n // The attribute is valid and so we should save it!!\n try {\n // We don't blindly save it even though we validated that\n // the user is a restricted manager and that they are\n // assigned to the arena. If it affects zero rows, then the user\n // wasn't authorized and we will throw a 403 error!\n if($name == 'assign') {\n if(is_array($value) && count($value) > 0 && isset($arena) && !is_null($arena)) {\n if(!$arena->assignContacts($uid, $value)) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n } elseif (is_array($aids) && count($aids) > 0) {\n if(!$model->assignArenas($uid, $aids)) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n }\n } elseif($name == 'unassign') {\n if(is_array($value) && count($value) > 0 && isset($arena) && !is_null($arena)) {\n if(!$arena->unassignContacts($uid, $value)) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n } elseif (is_array($aids) && count($aids) > 0) {\n if(!$model->unassignArenas($uid, $aids)) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n }\n } elseif($name == \"primary_contact\" && isset($arena) && !is_null($arena)) { \n // We either make the contact a primary or not\n // If we make it the primary, all other contacts are\n // removed as primary as there can be only one!\n $success = true;\n if($value == 1) {\n $success = $model->makePrimaryContact($uid, $arena->id);\n } else {\n $success = $model->makeSecondaryContact($uid, $arena->id);\n }\n \n if(!$success) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n } else {\n if($value == null) {\n $value = new CDbExpression('NULL');\n }\n \n $attributes = array(\n $name => $value,\n 'updated_by_id' => $uid,\n 'updated_on' => new CDbExpression('NOW()')\n );\n \n if(!$model->saveAttributes($attributes)) {\n $output = 'Failed to save record as the update was either unauthorized or because too many rows would be updated.';\n\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(400, $output);\n }\n\n $this->sendResponseHeaders(400, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => json_encode($output),\n )\n );\n Yii::app()->end();\n }\n }\n } catch (Exception $ex) {\n if($ex instanceof CHttpException) {\n throw $ex;\n }\n if($outputFormat == \"html\" || $outputFormat == \"xml\") {\n throw new CHttpException(500, $ex->getMessage());\n }\n\n $errorInfo = null;\n\n if(isset($ex->errorInfo) && !empty($ex->errorInfo)) {\n $errorParms = array();\n\n if(isset($ex->errorInfo[0])) {\n $errorParms['sqlState'] = $ex->errorInfo[0];\n } else {\n $errorParms['sqlState'] = \"Unknown\";\n }\n\n if(isset($ex->errorInfo[1])) {\n $errorParms['mysqlError'] = $ex->errorInfo[1];\n } else {\n $errorParms['mysqlError'] = \"Unknown\";\n }\n\n if(isset($ex->errorInfo[2])) {\n $errorParms['message'] = $ex->errorInfo[2];\n } else {\n $errorParms['message'] = \"Unknown\";\n }\n\n $errorInfo = array($errorParms);\n }\n\n $this->sendResponseHeaders(500, 'json');\n\n echo json_encode(\n array(\n 'success' => false,\n 'error' => $ex->getMessage(),\n 'exception' => true,\n 'errorCode' => $ex->getCode(),\n 'errorFile' => $ex->getFile(),\n 'errorLine' => $ex->getLine(),\n 'errorInfo' => $errorInfo,\n )\n );\n\n Yii::app()->end();\n }\n }", "public function updateAction()\n {\n }", "function action_unique_attribute_list() {\n $this->layout = null;\n\n $this->model = DB::model('Model')->fetch($_REQUEST['model_id']);\n if ($this->model->value['id']) {\n $this->model->bindMany('Attribute');\n }\n }", "protected function fireAttributeEvents()\n {\n foreach($this->getAttributeEvents() as $attributeValue => $classOrMethod) {\n [$attribute, $v] = explode(':', $attributeValue);\n\n // Skip if the attribute does not exist or if it has not been changed\n if(!array_key_exists($attribute, $this->attributes)) continue;\n if(!$this->isDirty($attribute)) continue;\n\n // Get the value of the attribute\n $value = $this->getAttributeValue($attribute);\n\n // Decide if we are to fire the event based on if the value matches the specified attribute event\n if($v === '*' // Any - always call no matter what the value is\n || $v === 'true' && $value === true // bool(true)\n || $v === 'false' && $value === false // bool(false)\n || is_numeric($v) && strpos($v, '.') !== false && $value === (float) $v // float\n || is_numeric($v) && $value === (int) $v // int\n || $v === $value\n ) {\n $this->fireModelEvent($attribute, false);\n }\n }\n }", "public function processAttributeTypeSave(Varien_Event_Observer $observer)\n {\n /** @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */\n $attribute = $observer->getEvent()->getAttribute();\n\n /** Detect if attribute is custom **/\n $attributes = Mage::getConfig()->getNode('global/virtual_attributes_types')->asArray();\n if (array_key_exists($attribute->getFrontendInput(), $attributes)) {\n $virtualAttributeConfig = $attributes[$attribute->getFrontendInput()];\n try {\n\n $attribute->setSourceModel(Smile_VirtualAttributes_Model_Catalog_Product_Attribute_Virtual::DEFAULT_SOURCE);\n /** Then set all needed values that comes from config.xml **/\n if (isset($virtualAttributeConfig['source_model'])) {\n $attribute->setSourceModel($virtualAttributeConfig['source_model']);\n }\n if (isset($virtualAttributeConfig['frontend_model'])) {\n $attribute->setFrontendModel($virtualAttributeConfig['frontend_model']);\n }\n if (isset($virtualAttributeConfig['backend_model'])) {\n $attribute->setBackendModel($virtualAttributeConfig['backend_model']);\n }\n if (isset($virtualAttributeConfig['backend_type'])) {\n $attribute->setBackendType($virtualAttributeConfig['backend_type']);\n }\n\n /** Finally call model class to build proper attribute **/\n Mage::getModel($attributes[$attribute->getFrontendInput()]['attribute_model'])->processAttributeSave($attribute);\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n }\n\n return $this;\n }", "public function run()\n {\n $productForm = $this->catalogProductEdit->getFormPageActions();\n $productForm->addNewAttribute();\n $this->catalogProductEdit->getAddAttributeModal()->createNewAttribute();\n }", "public function changeFileAttributeOutput(Varien_Event_Observer $observer)\n {\n $outputHelper = $observer->getHelper();\n $helper = Mage::helper('jvs_fileattribute');\n $outputHelper->addHandler('productAttribute', $helper);\n }", "public function update(array $attributes);", "public function actionUpdate() {}", "public function actionUpdate() {}", "function before_update() {}", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function updateAttribute(array $params)\n {\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function execute(Observer $observer)\n {\n /** @var \\Magento\\Eav\\Model\\Entity\\Attribute $attribute */\n $attribute = $observer->getEvent()->getData('attribute');\n if ($attribute->getFrontendInput() == 'smile_custom_entity') {\n $attribute->setFrontendModel(CustomEntity::class);\n }\n }", "public function updateAttributes(&$attributes)\n {\n $anchors = array();\n //$page = $this->owner->getForm()->getRecord();\n $page = \\Page::create();\n\n $config = $page->config()->anchors;\n if ($config) {\n $anchors = $config;\n }\n\n if ($page->hasMethod('getAnchors')) {\n $anchors = $page->getAnchors();\n }\n\n if (count($anchors) > 0) {\n $attributes['data-anchors'] = \\Convert::array2json($anchors);\n }\n }", "public function addMassactionToProductGrid($observer)\n\t{\n\t\t$block = $observer->getBlock();\n\t\t\n\t\tif($block instanceof Mage_Adminhtml_Block_Catalog_Product_Grid){\n\t\t\t\n\t\t\t$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n\t\t\t\t->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n\t\t\t\t->load()\n\t\t\t\t->toOptionHash();\n\t\t\n\t\t\t$block->getMassactionBlock()->addItem('flagbit_changeattributeset', array(\n\t\t\t\t'label'=> Mage::helper('catalog')->__('Change attribute set'),\n\t\t\t\t'url' => $block->getUrl('*/*/changeattributeset', array('_current'=>true)),\n\t\t\t\t'additional' => array(\n\t\t\t\t\t'visibility' => array(\n\t\t\t\t\t\t'name' => 'attribute_set',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'class' => 'required-entry',\n\t\t\t\t\t\t'label' => Mage::helper('catalog')->__('Attribute Set'),\n\t\t\t\t\t\t'values' => $sets\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)); \t\t\t\n\t\t}\n\t}", "protected function updateExtensionAction() {}", "public function updateAttributes(array $items = [])\n {\n $this->massaction($items, 'Update attributes');\n }", "public function update( $id, array $attribute){\n\n }", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if ($this->_state->getAreaCode() == \\Magento\\Framework\\App\\Area::AREA_ADMINHTML) {\n $attributeId = $this->_eavEntity->getIdByCode('catalog_product', 'wk_mppreorder_qty');\n if ($attributeId !== '' && $attributeId !== null && $attributeId !== 0) {\n $attribute = $this->_objectManager->create(\n 'Magento\\Catalog\\Model\\ResourceModel\\Eav\\Attribute'\n )->load($attributeId);\n }\n if ((int) $this->_helper->getConfigData('mppreorder_qty') == 1) {\n $attribute->setIsVisible(true)->save();\n } else {\n $attribute->setIsVisible(false)->save();\n }\n }\n }", "function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }", "public function ApplyChanges() {\n\t\tparent::ApplyChanges();\n\t\t\n\t\t$this->RegisterVariableBoolean(\"vacation\", \"Urlaub\", \"\", 0 );\n\t\t//$this->RegisterEventCyclic(\"UpdateTimer\", \"Automatische aktualisierung\", 15);\n\t}", "public function setAttributes($attributes){ }", "public function update_attributes() {\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'name'),\n\t\t\t'order' => array('Package.name ASC')\n\t\t));\n\n\t\t$count = 0;\n\t\tforeach ($packages as $package) {\n\t\t\tsleep(1);\n\t\t\tif ($this->Package->updateAttributes($package)) {\n\t\t\t\t$this->out(sprintf(__('* Updated %s'), $package['Package']['name']));\n\t\t\t\t$count++;\n\t\t\t} else {\n\t\t\t\t$this->out(sprintf(__('* Failed to update %s'), $package['Package']['name']));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t$p_count = count($packages);\n\t\t$this->out(sprintf(__('* Updated %s of %s packages'), $count, $p_count));\n\t}", "public static function editReviewsAttractionByAttractionName($pveAttractionName,$attractionName)\n\t{\n\t\tReview::where('AttractionName', '=', $pveAttractionName)->update(array('AttractionName' => $attractionName));\n\t}", "public function update(Model $model, array $attributes);", "public function update(Identifiable $model, array $newAttributes);" ]
[ "0.58175564", "0.5618338", "0.5423198", "0.5341711", "0.5317022", "0.52421814", "0.5218458", "0.5215485", "0.5207643", "0.52043796", "0.5202324", "0.5202324", "0.51672626", "0.5152394", "0.5127889", "0.51221675", "0.5116761", "0.5076136", "0.5049271", "0.50470906", "0.5021885", "0.5010909", "0.49768215", "0.49648815", "0.49558178", "0.4951641", "0.49445242", "0.494315", "0.49364427", "0.49297822" ]
0.6007345
0
Get a predefined guest group.
public static function GetGuestGroup() { static $guest; if(!is_object($guest)) { $guest = new Data\Group('guest', 'Guest'); } return $guest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGroup()\n {\n return Factory::create('group', $this->_gid);\n }", "public function getGroup() {\n\t\t$ids = $this->getGroupIds();\n\t\treturn MessageGroups::getGroup( $ids[0] );\n\t}", "function get_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->get($id);\n\t}", "public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }", "public function getGroup()\n {\n return $this->_getVar('user_group');\n }", "public function getGroupName(){\n\n\t global $db;\n\n\t #see if user is guest, if so, set gorpu name as simply guest.\n\t\tif($this->user == \"guest\"){\n\t\t\t$getGroupName = 'guest';\n\n\t\t\treturn($getGroupName);\n\t\t}else{\n\t \t$db->SQL = \"SELECT Name FROM ebb_groups where id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$getGroupName = $db->fetchResults();\n\n\t\t\treturn($getGroupName['Name']);\n\t\t}\n\t}", "public function getGroup(): GroupInterface;", "public function getGroup();", "public function getGroup();", "public function getGroup();", "private function getGroupID(){\n\n\t global $db;\n\t \n\t #set to 0, guest has no group setup.\n\t\tif($this->user == \"guest\"){\n\t\t $getGID = 0;\n\t\t return($getGID);\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT gid FROM ebb_group_users WHERE Username='\".$this->user.\"' AND Status='Active' LIMIT 1\";\n\t\t\t$getGID = $db->fetchResults();\n\n\t\t\treturn($getGID['gid']);\n\t\t}\n\t}", "protected function GetGroup() {\r\n\t\t\treturn $this->group;\r\n\t\t}", "public function getGroup()\n {\n $this->getParam('group');\n }", "function get_member_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'), array(\n\t\t\t'select' => array()\n\t\t));\n\t\t\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_member_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_member_group($vars['group_id'], $vars['select'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_member_group_end', $data);\n\n\t\t$this->response($data);\n\t}", "public static function getGroup(){\n\t\treturn FW_DAO_UserGroup::getInstance();\n\t}", "public function getUsergroup() {}", "public function systemGroup()\n\t{\n\t\t$cn = $this->config('group_prefix', 'pr-') . $this->get('alias');\n\n\t\t$group = \\Hubzero\\User\\Group::getInstance($cn);\n\n\t\tif (!$group)\n\t\t{\n\t\t\t$group = new \\Hubzero\\User\\Group();\n\t\t\t$group->set('cn', $cn);\n\t\t\t$group->create();\n\t\t}\n\n\t\treturn $group;\n\t}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "public function getGroup() {}", "function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getGroup() {\n\t\tif (empty($this->group)) {\n\t\t\t$this->group = $this->groupsTable->findById($this->groupId);\n\t\t}\n\t\treturn $this->group;\n\t}", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "public function getGroup()\n {\n return $this->group;\n }", "function getGroup() ;" ]
[ "0.70966005", "0.666593", "0.6553434", "0.65308386", "0.6497446", "0.64883864", "0.6440266", "0.6429305", "0.6429305", "0.6429305", "0.64065075", "0.6403769", "0.640137", "0.6401266", "0.63684434", "0.63438445", "0.6324317", "0.6297461", "0.6297461", "0.6297461", "0.6297461", "0.62957704", "0.62912273", "0.62689257", "0.62689257", "0.62689257", "0.62689257", "0.62689257", "0.62689257", "0.6236266" ]
0.83609116
0
Generates the data path for a group.
public static function GetPath($group_name) { return System::GetDataPath() . "groups/$group_name/data.php"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }", "function getFilename($id, $group)\n {\n if (isset($this->group_dirs[$group])) {\n return $this->group_dirs[$group] . $this->filename_prefix . $id;\n }\n\n $dir = $this->cache_dir . $group . '/';\n if (is_writeable($this->cache_dir)) {\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n clearstatcache();\n }\n } else {\n return new Cache_Error(\"Can't make directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n $this->group_dirs[$group] = $dir;\n\n return $dir . $this->filename_prefix . $id;\n }", "public static function getDataFolder()\n {\n $class = get_called_class();\n $strip = explode('\\\\', $class);\n\n return RELEASE_NAME_DATA . '/' . strtolower(array_pop($strip)) . 's';\n }", "function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }", "public function fetchGroupData() {}", "public function fetchGroupData() {}", "public function getGroupFile($group)\n\t{\n\t\tif (strpos($group, '_') !== false) {\n\t\t\tlist($key, $name) = Strings::rexplode('_', $group, 2);\n\t\t} else {\n\t\t\t$key = $group;\n\t\t\t$name = $group;\n\t\t}\n\n\t\t// We dont know about these settings?\n\t\tif (!isset($this->settings_paths[$key])) {\n\t\t\ttrigger_error(\"Unknown settings group `$group`\", \\E_USER_WARNING);\n\t\t\treturn null;\n\t\t}\n\n\t\t$path = $this->settings_paths[$key] . '/' . $name . '.php';\n\n\t\treturn $path;\n\t}", "public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }", "abstract protected function getFilename($groupName);", "private function parseDynamicGroup($group)\n {\n $regex = $group['regex'];\n $parts = explode('|', $regex);\n $data = array();\n foreach ($group['routeMap'] as $matchIndex => $routeData) {\n if (!is_array($routeData[0]) || !isset($routeData[0]['name']) || !isset($parts[$matchIndex - 1])) {\n continue;\n }\n\n $parameters = $routeData[1];\n $path = $parts[$matchIndex - 1];\n\n foreach ($parameters as $parameter) {\n $path = $this->replaceOnce('([^/]+)', '{'.$parameter.'}', $path);\n }\n\n $path = rtrim($path, '()$~');\n\n $data[$routeData[0]['name']] = array(\n 'path' => $path,\n 'params' => $parameters,\n );\n }\n\n return $data;\n }", "private function buildFinalGroups($group, $path, &$list) {\n\t\tif (count($group[\"sub_groups\"]) == 0) {\n\t\t\t$group[\"path\"] = $path;\n\t\t\tarray_push($list, $group);\n\t\t\treturn;\n\t\t}\n\t\tif ($path <> \"\") $path .= \"/\";\n\t\t$path .= $group[\"name\"];\n\t\tforeach ($group[\"sub_groups\"] as $sg)\n\t\t\t$this->buildFinalGroups($sg, $path, $list);\n\t}", "public function getDirectoryData();", "protected function saveGroup($group) {\n\t\t$link = $this->getLink();\n\t\t$link->set($this->prefix, $group);\n\t}", "protected function collectDataGroup()\n {\n $url = $this->getGroupURI();\n $this->collectDeals($url);\n }", "private function getDirectory(): string\n\t{\n\t\t$guesses = [Locator::getPatchPath($this->getPatch())];\n\n\t\t// If this patch has a duplicate then try it too\n\t\t$metaData = $this->getMetaData();\n\t\tif (isset($metaData->duplicate->data))\n\t\t{\n\t\t\t$guesses[] = Locator::getPatchPath($metaData->duplicate->data);\n\t\t}\n\n\t\tforeach ($guesses as $patchDir)\n\t\t{\n\t\t\tif (is_dir($patchDir . 'data'))\n\t\t\t{\n\t\t\t\treturn $patchDir . 'data' . DIRECTORY_SEPARATOR;\n\t\t\t}\n\t\t}\n\n\t\tthrow new RuntimeException('Unable to locate data directory for patch ' . $this->getPatch());\n\t}", "private function create_new_group_directories($group, $group_type){\n\t\t$group_name = $group->data()->prof_link;\n\t\t// Pre-set directory names:\n\t\tswitch($group_type){\n\t\t\tcase self::MUSIC:\n\t\t\t\t$group_type_upload_dir\t=\tMUSIC_GROUP_UPLOADS;\n\t\t\t\t$default_ava\t\t\t=\t'music_default.png';\n\t\t\t\tbreak;\n\t\t\tcase self::DANCE:\n\t\t\t\t$group_type_upload_dir\t=\tDANCE_GROUP_UPLOADS;\n\t\t\t\t$default_ava\t\t\t=\t'boxtar.png';\n\t\t\t\tbreak;\n\t\t\tcase self::COMEDY:\n\t\t\t\t$group_type_upload_dir\t=\tCOMEDY_GROUP_UPLOADS;\n\t\t\t\t$default_ava\t\t\t=\t'boxtar.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$group_type_upload_dir\t=\tMUSIC_GROUP_UPLOADS;\n\t\t\t\t$default_ava\t\t\t=\t'music_default.png';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$new_group_root_dir\t=\t$group_type_upload_dir.$group_name;\n\t\t$new_group_img_dir\t=\t$group_type_upload_dir.$group_name.'/img/prof'; // Recursive\n\t\t$new_group_aud_dir\t=\t$group_type_upload_dir.$group_name.'/aud';\n\t\t$new_group_vid_dir\t=\t$group_type_upload_dir.$group_name.'/vid';\n\t\t\n\t\t// CHECK NEW GROUP DIRECTORY DOES NOT EXIST:\n\t\tif(!is_dir($new_group_root_dir)){\n\t\t\tmkdir($new_group_root_dir, 0777);\n\t\t\tmkdir($new_group_img_dir, 0777, true); // @param-3: true enables recursive mode\n\t\t\tmkdir($new_group_aud_dir, 0777);\n\t\t\tmkdir($new_group_vid_dir, 0777);\n\t\t\t\n\t\t\t// Check everything went ok on the directory creating front then copy over default files:\n\t\t\tif(is_dir($new_group_root_dir) && is_dir($new_group_img_dir) && is_dir($new_group_aud_dir) && is_dir($new_group_vid_dir)){\n\t\t\t\t\n\t\t\t\treturn copy( UPLOADS_DIR.$default_ava, $new_group_img_dir.'/default.png');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "protected function getPattern(): string\n\t{\n\t\treturn $this->getDirectory() . $this->getGroup() . 'data_*_localized.json';\n\t}", "function fm_get_group_dir_space($groupid) {\r\n\t\r\n\tif ($groupid == NULL){\r\n\t\t// ERROR\r\n\t} else {\r\n\t\treturn \"file_manager/groups/$groupid\";\r\n\t}\r\n}", "public function getDataGroup() {\n\t\treturn $this->datagroup;\n\t}", "public static function getGroupData($gid);", "public function setDataGroup($datagroup) {\n\t\t$this->datagroup = $datagroup;\n\t}", "private function getGroupTplData( $group ) {\n $g = esf_Auctions::$Groups[$group];\n return array(\n 'NAME' => $group,\n 'AUCTIONGROUP' => (!isset(esf_Auctions::$Auctions[$group]) ? $group : ''),\n 'QUANTITY' => $g['q'],\n 'BID' => $g['b'],\n 'TOTAL' => $g['t'],\n 'COMMENT' => $g['c'],\n 'COUNT' => $g['a'],\n 'ENDED' => ($g['r'] < 1),\n );\n }", "abstract protected function _buildGroupBy( $group );", "protected function group($group)\n {\n if ( ! isset($this->assets[$group]) or count($this->assets[$group]) == 0) return '';\n\n $out = '';\n\n // each $assset object has a render function. Use it\n foreach ($this->assets[$group] as $asset) {\n $out .= $asset->render();\n }\n\n return $out;\n }", "public static function GetData($group_name)\n {\n $group_data_path = self::GetPath($group_name);\n\n if(file_exists($group_data_path))\n {\n $group_object = new Data\\Group($group_name);\n\n $data = new Data($group_data_path);\n\n $group_data = $data->GetRow(0);\n $group_object->name = trim($group_data['name']);\n $group_object->description = trim($group_data['description']);\n\n return $group_object;\n }\n else\n {\n throw new Exceptions\\Group\\GroupNotExistsException;\n }\n }", "function cmp_dataid2path($dataid)\n{\n return PLX_ROOT.'data/zb/'.substr($dataid,0,2).'/'.substr($dataid,2,2).'/';\n}", "function MyMod_Data_Group_Datas_Get($group,$single=FALSE)\n {\n if (empty($group)) { return array(); }\n\n if ($single)\n {\n if (!empty($this->ItemDataSGroups[ $group ][ \"TableDataMethod\" ]))\n {\n $method=$this->ItemDataSGroups[ $group ][ \"TableDataMethod\" ];\n return $this->$method($group);\n }\n }\n else\n {\n if (!empty($this->ItemDataGroups[ $group ][ \"TableDataMethod\" ]))\n {\n $method=$this->ItemDataGroups[ $group ][ \"TableDataMethod\" ];\n return $this->$method($group);\n }\n }\n \n $groupdefs=$this->MyMod_Data_Group_Defs_Get($single);\n\n $groupdef=$this->MyMod_Data_Group_Def_Get($group,$single);\n if (!$single)\n {\n $commongroupdef=$this->MyMod_Data_Group_Def_Get(\"_Common_\",$single,False);\n }\n\n $datas=array();\n foreach (array(\"Actions\",\"ShowData\",\"Data\") as $type)\n {\n $rdatas=$this->GetRealNameKey($groupdef,$type);\n if (is_array($rdatas))\n {\n $datas=array_merge($datas,$rdatas);\n }\n }\n\n if (!$single && !empty($commongroupdef))\n {\n $rdatas=$this->GetRealNameKey($commongroupdef,\"Data\");\n if (is_array($rdatas))\n {\n $datas=array_merge($rdatas,$datas);\n }\n }\n\n if (empty($datas) || !is_array($datas))\n {\n $this->AddMsg(\"Warning: Group $group has no data defined\");\n return array();\n }\n\n $rdatas=array();\n foreach ($datas as $id => $data)\n {\n if (!is_array($data)) { $data=array($data); }\n\n foreach ($data as $rdata)\n {\n if (isset($this->ItemData[ $rdata ]))\n {\n if (!$single && preg_grep('/^'.$rdata.'$/',$this->MyMod_Language_Data))\n {\n $rdata.=$this->MyLanguage_GetLanguageKey();\n }\n \n if ($this->MyMod_Access_HashAccess($this->ItemData[ $rdata ],array(1,2)))\n {\n array_push($rdatas,$rdata);\n }\n }\n elseif (isset($this->Actions[ $rdata ]))\n {\n $action=$data;\n if ($this->MyAction_Allowed($rdata))\n {\n array_push($rdatas,$rdata);\n }\n else\n {\n if (!empty($this->Actions[ $rdata ][ \"AltAction\" ]))\n {\n $altaction=$this->Actions[ $rdata ][ \"AltAction\" ];\n if ($this->MyAction_Allowed($altaction))\n {\n array_push($rdatas,$altaction);\n }\n }\n }\n }\n elseif (method_exists($this,$rdata))\n {\n array_push($rdatas,$rdata);\n }\n elseif (\n $rdata==\"No\"\n ||\n preg_match('/^newline/',$rdata)\n ||\n preg_match('/^text\\_/',$rdata)\n )\n {\n array_push($rdatas,$rdata);\n }\n }\n }\n \n return $this->MyHash_List_Unique($rdatas);\n }", "public function getTemplatePathname() : string {\n\t\treturn $this->templateBasePath . '/linklist-group.mustache';\n\t}", "protected function getVehicleModelsFilePathByTypeId(?string $group_name = null): array\n {\n $group_name = $group_name ?? 'default';\n\n $alias_map = $this->getVehicleTypeAliasByIdMap();\n\n $file_paths = [];\n\n foreach ($alias_map as $id => $alias) {\n if ($id === Specifications::VEHICLE_TYPE_DEFAULT) {\n $file_paths[$id] = \"/vehicles/{$group_name}/models.json\";\n } else {\n $file_paths[$id] = \"/vehicles/{$group_name}/models_{$alias}.json\";\n }\n }\n\n return $file_paths;\n }", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}" ]
[ "0.59197545", "0.58216393", "0.56528157", "0.5645853", "0.5568215", "0.5568215", "0.5552869", "0.5460039", "0.5458223", "0.54526633", "0.5379507", "0.5336447", "0.532782", "0.52699256", "0.524609", "0.5236351", "0.5217765", "0.5197283", "0.51830626", "0.51766974", "0.5175482", "0.5161812", "0.5116269", "0.5052029", "0.50496405", "0.5049166", "0.5021004", "0.5017399", "0.50164294", "0.50102085" ]
0.7580235
0
retrieves a listing of the given directory or the current working directory if no path has been specified. Returns a string which contains all the directory entries separated by new lines.
function dir_list($path="") { $s=""; if($this->pasv()) { if($path == '') { $this->sock_write("LIST"); } else { $this->sock_write("LIST $path"); } if($this->is_ok()) { while(true) { $line = fgets($this->data_sock); $s .= $line; if($line =='') break; } } } return $s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getDirectoryListing();", "public function listContents($directory = '', $recursive = false)\n {\n }", "public function listContents($directory = '', $recursive = false)\n {\n }", "function sd_sc_list_dir($atts) {\n\tglobal $sd_error_msg;\n\n\t$dir = sd_sc_get_path($atts);\n\tif (!$dir) { return 'Fehler: Ungültiges Verzeichnis.'; }\n\n\t// ensure that $dir starts and ends with a slash.\n\t$dir = trailingslashit( $dir );\n\tif ('/' != $dir{0}) { $dir = '/' . $dir; }\n\n\t$absdir = untrailingslashit(SD_DL_ROOT) . $dir;\n\tif (!is_dir($absdir)) { return 'Fehler: Kein Verzeichnis.'.$absdir; };\n\tif (!is_readable($absdir)) { return 'Fehler: Unlesbares Verzeichnis.'; };\n\n\t$access = sd_check_permissions($absdir);\n\tif (!$access) { return $sd_error_msg; }\n\t\n\t$list = '';\n\t$urlpath = untrailingslashit(SD_DL_BASEURL) . $dir;\n\t$baseurl = home_url() . (('/' == $urlpath{0}) ? '' : '/') . $urlpath;\n\t$d = dir($absdir);\n\twhile (false !== ($entry = $d->read())) {\n\t\tif ('.' == $entry{0}) { continue; }\n\t\t$link = $baseurl . $entry;\n\t\t$list .= '<a href=\"' . $link . '\">' . $entry . '</a> ('.$link.')<br />';\n\t}\n\t$d->close();\n\n\treturn $list;\n}", "function getDirContents($dir){\r\n foreach(scandir($dir) as $key => $value){\r\n print \"$value<BR>\";\r\n }\r\n\r\n\r\n }", "function _ls($dir = './')\n\t{\n\t\tif (!$this->_open_data_connection())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_send_command('NLST', $dir);\n\n\t\t$list = array();\n\t\twhile (!@feof($this->data_connection))\n\t\t{\n\t\t\t$filename = preg_replace('#[\\r\\n]#', '', @fgets($this->data_connection, 512));\n\n\t\t\tif ($filename !== '')\n\t\t\t{\n\t\t\t\t$list[] = $filename;\n\t\t\t}\n\t\t}\n\t\t$this->_close_data_connection();\n\n\t\t// Clear buffer\n\t\t$this->_check_command();\n\n\t\t// See bug #46295 - Some FTP daemons don't like './'\n\t\tif ($dir === './' && empty($list))\n\t\t{\n\t\t\t// Let's try some alternatives\n\t\t\t$list = $this->_ls('.');\n\n\t\t\tif (empty($list))\n\t\t\t{\n\t\t\t\t$list = $this->_ls('');\n\t\t\t}\n\n\t\t\treturn $list;\n\t\t}\n\n\t\t// Remove path if prepended\n\t\tforeach ($list as $key => $item)\n\t\t{\n\t\t\t// Use same separator for item and dir\n\t\t\t$item = str_replace('\\\\', '/', $item);\n\t\t\t$dir = str_replace('\\\\', '/', $dir);\n\n\t\t\tif (!empty($dir) && strpos($item, $dir) === 0)\n\t\t\t{\n\t\t\t\t$item = substr($item, strlen($dir));\n\t\t\t}\n\n\t\t\t$list[$key] = $item;\n\t\t}\n\n\t\treturn $list;\n\t}", "function print_dir_contents($dir_path, $parent_dir)\r\n{\r\n if (is_null($parent_dir)) {\r\n $dir_contents = glob(\"*\");\r\n } else {\r\n $dir_contents = glob(\"$dir_path/*\");\r\n }\r\n\r\n foreach ($dir_contents as $item) {\r\n if (is_dir($item)): ?>\r\n <li><a href=\"<?=$item?>\"><?=$item?>/</a></li>\r\n <ul>\r\n <?php print_dir_contents($item, $dir_path); ?>\r\n </ul>\r\n <?php else: ?>\r\n <li><a href=\"<?=$item?>\"><?=str_replace($dir_path . '/', '', $item)?></a></li>\r\n <?php endif;\r\n }\r\n}", "function ls($directory);", "public function listContents($directory = '', $recursive = false)\n {\n // TODO: Implement listContents() method.\n }", "function dirList($directory) \n{\n $results = array();\n // create a handler for the directory\n $handler = opendir($directory);\n // keep going until all files in directory have been read\n while ($file = readdir($handler)) {\n // if $file isn't this directory or its parent, \n // add it to the results array\n if ($file != '.' && $file != '..')\n $results[] = $directory.$file;\n }\n // tidy up: close the handler\n closedir($handler);\n // done!\n return $results;\n}", "public function getDirectoryTreeList();", "function listDir($fullDirectory, $directory) {\n //Scan the current directory, but we don't want '.' or '..' in the returned list.\n $files = array_diff(scandir($fullDirectory), array('.', '..'));\n\n //Don't make a list if the directory is empty:\n if(empty($files)) return; //We don't need to waste any more time here if it's empty.\n //Otherwise, time for a new list:\n echo '<ul class=\"pages-ul\">';\n //Don't make a nested list until all the directories are out of the way:\n foreach($files as $file) {\n //If it's a folder, list it and scan inside it for more folders:\n if(is_dir($fullDirectory . '/' . $file)) {\n echo '<li>' . $file . '</li>';\n listDir($fullDirectory . '/' . $file, $directory . '/' . $file);\n }\n }\n echo '</ul>'; //Done scanning through directories now.\n\n //Now that there are no more directories in the way, list the directory's files:\n echo '<ul class=\"pages-ul\">';\n foreach($files as $file) {\n //We'll want to check its extension and get its filename without its path or extension.\n $fileName = pathinfo($file);\n //If it's a php file, then list it with a link to its path.\n if(isset($fileName['extension']) && $fileName['extension'] == 'php') { //Not sure why, but $fileName['extension'] isn't always set.\n echo '<li><a href=\"' . $directory . '/' . $fileName['basename'] . '\">' . $fileName['filename'] . '</a></li>';\n }\n }\n echo '</ul>'; //Done listing the php webpages now.\n }", "function list_dir($chdir) {\r\n\t/* some globals, some cleaning */\r\n\tglobal $root, $prefix, $PHP_SELF, $SERVER_NAME, $showsize, $display, $excludedir, $excludefile;\r\n\tunset($sdirs);\r\n\tunset($sfiles);\r\n\tchdir($chdir);\r\n\t$self = basename($PHP_SELF);\r\n\r\n\t/* open current directory */\r\n\t$handle = opendir('.');\r\n\t/* read directory. If the item is a directory, place it in $sdirs, if it's a filetype we want\r\n\t * and not this file, put it in $sfiles */\r\n\twhile ($file = readdir($handle))\r\n\t{\r\n\t\tif(is_dir($file) && $file != \".\" && $file != \"..\" && !in_array($file, $excludedir))\r\n\t\t{ $sdirs[] = $file; }\r\n\t\telseif(is_file($file) && $file != \"$self\" && array_key_exists(get_extension($file), $display)\r\n\t\t\t&& !in_array($file, $excludefile))\r\n\t\t{ $sfiles[] = $file; }\r\n\t}\r\n\r\n\t/* count the slashes to determine how deep we're in the directory tree and how many\r\n\t * nice bars we need to add */\r\n\t$dir = getcwd();\r\n\t$dir1 = str_replace($root, \"\", $dir.\"/\");\r\n\t$count = substr_count($dir1, \"/\") + substr_count($dir1, \"\\\\\") - (substr_count($root, \"/\")-1);\r\n\r\n\t/* display directory names and recursively list all of them */\r\n\tif(isset($sdirs) && is_array($sdirs)) {\r\n\t\tsort($sdirs);\r\n\t\treset($sdirs);\r\n\r\n\t\tfor($y=0; $y<sizeof($sdirs); $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t \t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\t\tif((isset($sfiles) && is_array($sfiles)) || $y<sizeof($sdirs)-1)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/folder.gif> <a href=\\\"http://$SERVER_NAME$prefix/$dir1$sdirs[$y]\\\" target=\\\"_blank\\\" class=\\\"blau10b\\\">$sdirs[$y]</a>\";\r\n\t\t\tlist_dir($dir.\"/\".$sdirs[$y]);\r\n\t\t}\r\n\t}\r\n\r\n\tchdir($chdir);\r\n\r\n\t/* iterate through the array of files and display them */\r\n\tif(isset($sfiles) && is_array($sfiles)) {\r\n\t\tsort($sfiles);\r\n\t\treset($sfiles);\r\n\r\n\t\t$sizeof = sizeof($sfiles);\r\n\r\n\t\t/* what file types shall be displayed? */\r\n\t\tfor($y=0; $y<$sizeof; $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\t\tif($y == ($sizeof -1))\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/\";\r\n\t\t\techo $display[get_extension($sfiles[$y])];\r\n\t\t\techo \"> \";\r\n\r\n\r\n\t\t\t\t$valorlink=\"$prefix/$dir1$sfiles[$y]\";\r\n\t\t\t\t//echo \"<a href=\\\"$valorlink\\\" class=\\\"blau10\\\" target=\\\"_blank\\\">$sfiles[$y]</a>\";\r\n\t\t\t\techo '<a href=\"#\" class=\"blau10\" onclick=\"OpenFile(\\''.$valorlink.'\\');return false;\">'.$sfiles[$y].'</a>';\r\n\r\n\t\t\t/*if (!isset($_GET['nocopy'])) {\r\n\t\t\t\t//per copiar link\r\n\t\t\t\techo \"<input type=hidden name=\\\"$dir1$sfiles[$y]\\\" id=\\\"$dir1$sfiles[$y]\\\" value=\\\"$valorlink\\\">\";\r\n\t\t\t\techo \"&nbsp;&nbsp;&nbsp;<a href=\\\"javascript:CopyClipboard('$dir1$sfiles[$y]')\\\" title=\\\"copiar el vincle al portapapers\\\">copiar vincle</a>\";\r\n\t\t\t\t//fi\r\n\t\t\t}*/\r\n\r\n\t\t\tif($showsize) {\r\n\t\t\t\t$fsize = @filesize($sfiles[$y])/1024;\r\n\t\t\t\tprintf(\" (%.2f kB)\", $fsize);\r\n\t\t\t}\r\n\t\t\techo \"</td></tr>\";\r\n\r\n\r\n\r\n\t\t}\r\n\t\techo \"<tr><td>\";\r\n\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\techo \"</td></tr>\\n\";\r\n\t}\r\n}", "private static function getDirListing($path){\n\t\t\tlist($url,$cred,$trgt,$pth)=self::usrpwd($path);\n\t\t\t$ch=self::setup($url,$cred);\n\t\t\tif(!function_exists('k2f_ftp_getDirListingHeaders')){\n\t\t\t\tfunction k2f_ftp_getDirListingHeaders($ch,$hdr){\n\t\t\t\t\tif(CFG::get('DEBUG_VERBOSE'))xlog('FTPWRP: Read header: ',$hdr);\n\t\t\t\t\treturn strlen($hdr);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurl_setopt($ch,CURLOPT_HEADERFUNCTION,'k2f_ftp_getDirListingHeaders');\n\t\t\tif(self::isWinFtp($path))curl_setopt($ch,CURLOPT_QUOTE,array('SITE DIRSTYLE'));\n\t\t\t$dirlist=curl_exec($ch);\n\t\t\tself::error($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$dirlist=FtpDirListingParser::parse($dirlist);\n\t\t\txlog('FTPWRP: Getting listing of \"'.$path.'\":',$dirlist);\n\t\t\treturn $dirlist;\n\t\t}", "function get_dir_contents($dir)\n\t{\n\t\t$contents = Array();\n\t\t\n\t\tif ($handle = opendir($dir))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\") {\n\t\t\t\t\t$contents[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"directory opening fails\";\n\t\t}\n\t\treturn $contents;\n\t}", "function listDir() {\n\t\t$header = $this->getHeader($this->_pageId);\n\t\t$output = \"\n\t\t\t<h1>$header</h1>\n\t\t\";\n\t\t$lp = $this->listPages();\n\t\tif ($lp == \"empty\") {\n\t\t\t$output .= \"<p><i>Denne mappen er tom eller den inneholder bare bilder.</i></p>\";\n\t\t} else if ($lp == \"hidden\") {\n\t\t\tif ($this->isLoggedIn()) {\n\t\t\t\t$output .= \"<p><i>Beklager, denne mappen inneholder kun skjulte elementer.</i></p>\";\n\t\t\t} else {\n\t\t\t\t$output = innlogging::printNoAccessNotLoggedInDlg();\n\t\t\t}\n\t\t} else {\n\t\t\t$output .= $lp;\n\t\t}\n\t\t/*\n\t\t$li = $this->listImages();\n\t\t$li = \"empty\";\n\t\tif (($lp == \"empty\") && ($li == \"empty\")){\n\t\t\tprint \"<p><i>Mappen er tom</i></p>\";\n\t\t}\n\t\t*/\n\t\t//$this->notSoFatalError(\"Denne mappen har ingen index-side.\");\n\t\treturn $output;\n\t}", "public function get_directory_list() {\n\t\treturn $this->directory_list;\n\t}", "function get_directory_list ($directory, $file=true) {\n $d = dir ($directory);\n $list = array();\n while ($entry = $d->read() ) {\n if ($file == true) { // We want a list of files, not directories\n $parts_array = explode ('.', $entry);\n $extension = $parts_array[1];\n // Don't add files or directories that we don't want\n if ($entry != '.' && $entry != '..' && $entry != '.htaccess' && $extension != 'php') {\n if (!is_dir ($directory . \"/\" . $entry) ) {\n $list[] = $entry;\n }\n }\n } else { // We want the directories and not the files\n if (is_dir ($directory . \"/\" . $entry) && $entry != '.' && $entry != '..') {\n $list[] = array ('id' => $entry,\n 'text' => $entry\n );\n }\n }\n }\n $d->close();\n return $list;\n}", "function list_files($directory = '.')\n{\n if ($directory != '.')\n {\n $directory = rtrim($directory, '/') . '/';\n }\n \n if ($handle = opendir($directory))\n {\n while (false !== ($file = readdir($handle)))\n {\n if ($file != '.' && $file != '..')\n {\n echo $file.'<br>';\n }\n }\n \n closedir($handle);\n }\n}", "function getDirectoryList ($directory) {\r\r\n // create an array to hold directory list\r\r\n $results = array();\r\r\n\r\r\n // create a handler for the directory\r\r\n $handler = opendir($directory);\r\r\n\r\r\n // open directory and walk through the filenames\r\r\n while ($file = readdir($handler)) {\r\r\n\r\r\n // if file isn't this directory or its parent, add it to the results\r\r\n if ($file != \".\" && $file != \"..\") {\r\r\n $results[] = $file;\r\r\n }\r\r\n\r\r\n }\r\r\n\r\r\n // tidy up: close the handler\r\r\n closedir($handler);\r\r\n\r\r\n // done!\r\r\n return $results;\r\r\n}", "private function listMyFolder($dir = APPPATH) {\n $ffs = scandir($dir);\n\n unset($ffs[array_search('.', $ffs, true)]);\n unset($ffs[array_search('..', $ffs, true)]);\n unset($ffs[array_search('.DS_Store', $ffs, true)]);\n unset($ffs[array_search('', $ffs, true)]);\n\n if (count($ffs) < 1) {\n return;\n }\n\n $ul = '<ul>';\n foreach ($ffs as $ff) {\n if (is_dir($dir . '/' . $ff)) {\n $ul .= '<li>';\n $ul .= $ff;\n $ul .= $this->listMyFolder($dir . '/' . $ff . \"/\");\n $ul .= '</li>';\n } else {\n // Search for color class\n switch ($ff) {\n case '.htaccess' :\n $class = 'text-default';\n break;\n case 'Buildigniter.php' :\n $class = 'text-danger';\n break;\n default :\n $class = 'text-info';\n break;\n }\n // Folder search\n if (strpos($dir . $ff, '_buildigniter')) {\n $class = 'text-danger';\n }\n $ul .= '<li class=\"' . $class . '\" data-jstree=\\'{\"icon\":\"fa fa-file\"}\\'>' . $ff . '</li>';\n }\n }\n $ul .= '</ul>';\n\n return $ul;\n }", "function _ls($dir = './')\n\t{\n\t\t$list = @ftp_nlist($this->connection, $dir);\n\n\t\t// See bug #46295 - Some FTP daemons don't like './'\n\t\tif ($dir === './')\n\t\t{\n\t\t\t// Let's try some alternatives\n\t\t\t$list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list;\n\t\t\t$list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list;\n\t\t}\n\n\t\t// Return on error\n\t\tif ($list === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove path if prepended\n\t\tforeach ($list as $key => $item)\n\t\t{\n\t\t\t// Use same separator for item and dir\n\t\t\t$item = str_replace('\\\\', '/', $item);\n\t\t\t$dir = str_replace('\\\\', '/', $dir);\n\n\t\t\tif (!empty($dir) && strpos($item, $dir) === 0)\n\t\t\t{\n\t\t\t\t$item = substr($item, strlen($dir));\n\t\t\t}\n\n\t\t\t$list[$key] = $item;\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getDirContent($directory)\r\n {\r\n return array_diff(scandir(getcwd().$directory), array('..', '.'));\r\n }", "public function listCurrentDir() {\n $connConf = $this->getConnectionModel();\n $markAsAlias = false;\n $basedn = $this->getCwd();\n if(preg_match('/ALIAS=Alias of:/',$this->getCwd())) {\n $basedn = str_replace(\"ALIAS=Alias of:\",\"\",$this->getCwd());\n /**\n * This is necessary to avoid id problems in the web interface.\n * Aliased elements start with a \"*\", an 4.digit id and again, a \"*\"\n *\n */\n $result = $this->listDN($basedn);\n foreach($result as $key=>&$vals) {\n if(!is_int($key))\n continue;\n $vals[\"dn\"] = \"*\".rand(1000,9999).\"*\".$vals[\"dn\"];\n }\n return $result;\n } else return $this->listDN($basedn);\n }", "function GetDirectoryList($bIsShowResult = true, $sInFilePath = '')\n{\t\n\t$sDirectoryPath = '';\n\t\n\tif(strlen($sInFilePath) === 0)\n\t{\n\t\tif(isset($_REQUEST['file-path']) === false)\n\t\t{\n\t\t\techo '<fail>no file path</fail>';\n\t\t\treturn;\n\t\t}\n\t\t$sDirectoryPath = trim($_REQUEST['file-path']);\n\t} else\n\t{\n\t\t$sDirectoryPath = $sInFilePath;\n\t}\n\n\t\n\t\n\t$lsNamesArrayList = array();\n\t\n\t$stDirectoryHandle = opendir($sDirectoryPath);\n\t\n\tif (!($stDirectoryHandle === false)) \n\t{\n\t\t$sFileName = '';\n\t\t\n\t\twhile (false !== ($sFileName = readdir($stDirectoryHandle))) \n\t\t{ \n\t\t\tif(strcmp($sFileName, '.') != 0 && strcmp($sFileName, '..'))\n\t\t\t{\n\t\t\t\tif(is_dir($sDirectoryPath.$sFileName) === true)\n\t\t\t\t{\n\t\t\t\t\tif($bIsShowResult === true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = $sFileName.'<$%sep%$>d';\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = array('type' => 'd', 'name' => $sFileName);\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tif($bIsShowResult === true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = $sFileName.'<$%sep%$>f';\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$lsNamesArrayList[] = array('type' => 'f', 'name' => $sFileName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant open direcotry</fail>';\n\t}\n\t\n\t\n\tif($bIsShowResult === true)\n\t{\n\t\techo '<correct>directory list</correct>';\n\t\techo implode(\"\\n\", $lsNamesArrayList);\n\t} else\n\t{\n\t\treturn $lsNamesArrayList;\n\t}\n}", "function getDirContents($dir)\n{\n $handle = opendir($dir);\n if (!$handle)\n return array();\n $contents = array();\n while ($entry = readdir($handle)) {\n if ($entry == '.' || $entry == '..')\n continue;\n \n $entry = $dir . DIRECTORY_SEPARATOR . $entry;\n if (is_file($entry)) {\n $contents[] = $entry;\n } else if (is_dir($entry)) {\n $contents = array_merge($contents, getDirContents($entry));\n }\n }\n closedir($handle);\n return $contents;\n}", "function list_directory($dir, &$list)\r\n\t{\r\n\t\tif ($dh = @opendir($dir)) \r\n\t\t{\r\n\t\t\twhile(($file = readdir($dh)) !== false)\r\n\t\t\t{\r\n\t\t\t\tif( $file != \".\" and $file != \"..\") \r\n\t\t\t\t{\r\n\t\t\t\t\tif(!is_dir($dir.$file))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$list[] = str_replace(\"\\\\\", \"/\", $dir.$file);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(is_dir($dir.$file)) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$newdir = $dir.$file.\"/\";\r\n\t\t\t\t\t\tchdir($newdir);\r\n\t\t\t\t\t\tlist_directory($newdir, $list);\r\n\t\t\t\t\t} \r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tchdir(\"..\");\r\n\t\t}\r\n\t\treturn $list;\r\n\t}", "function getDirectories($dir)\r\n{\r\n\tglobal $debug;\r\n\t$directories = getFolderList($dir);\r\n\t// Only bother with it if there are any subdirectories here\r\n\tif (count($directories)>0)\r\n\t{\r\n\t\t$getDirectories = '<div class=\"list-group\">';\r\n\t\tforeach($directories as $directory)\r\n\t\t{\r\n\t\t\t// Only bother with it if there are playable tracks or subdirectories\r\n\t\t\tif ( getTracksCount($directory)>0 || getFoldersCount($directory)>0 )\r\n\t\t\t{\r\n\t\t\t\t$getDirectories .= '<a href=\"?dir='.rawurlencode($directory);\r\n\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$getDirectories .= '&debug=log';\r\n\t\t\t\t}\r\n\t\t\t\t$getDirectories .= '\" class=\"list-group-item\" title=\"Open this directory\">'.substr($directory,strrpos($directory,\"/\")+1).'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\t\tunset($directories);\r\n\t\t$getDirectories .= '</div>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$getDirectories = '';\r\n\t}\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"getDirectories(\".$dir.\")\\n----------\\n\";\r\n\t\t$log .= \"getDirectories = \".$getDirectories.\"\\n\\n\";\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $getDirectories;\r\n}", "public function getDirectory();", "public function getDirectory();" ]
[ "0.70939374", "0.6625818", "0.6625818", "0.661495", "0.6597163", "0.647934", "0.6323997", "0.62749016", "0.6273386", "0.62252563", "0.6185035", "0.6111865", "0.6080845", "0.6048426", "0.6034044", "0.60182846", "0.6006565", "0.6001035", "0.599847", "0.5995349", "0.59745", "0.5973424", "0.59701777", "0.5967433", "0.59340173", "0.5912311", "0.5905185", "0.58834666", "0.5837149", "0.5837149" ]
0.7345161
0
stores the file given in $localpath on the remote server as $remotePath
function stor($localPath,$remotePath) { log("<h3>uploading $localPath</h3>"); if($this->pasv()) { $this->sock_write("STOR $remotePath"); if($this->is_ok()) { $fp = fopen($localPath,"rb"); if($fp) { while(!feof($fp)) { $s = fread($fp,4096); fwrite($this->data_sock,$s); } return 1; } return 0; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function put($localFile, $remoteFile, $url);", "function put($remotefile, $localfile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_put($this->_socket, $remotefile, $localfile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!file_exists($localfile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"r\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Cannot read file \\\"\".$localfile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file \\\"\".$localfile.\"\\\" to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function getRemoteFile($localFile);", "public function store( $remoteFileName, $local) {\r\n\t\treturn $this;\r\n\t}", "public function receiveFile($remote_file, $local_file)\n {\n $sftp = $this->sftp;\n $stream = @fopen(\"ssh2.sftp://$sftp$remote_file\", 'r');\n if (! $stream)\n throw new Exception(\"Could not open file: $remote_file\");\n $size = $this->getFileSize($remote_file); \n $contents = '';\n $read = 0;\n $len = $size;\n while ($read < $len && ($buf = fread($stream, $len - $read))) {\n $read += strlen($buf);\n $contents .= $buf;\n } \n file_put_contents ($local_file, $contents);\n @fclose($stream);\n }", "public function putFile(string $remoteFile, string $localFile) : bool\n {\n $this->checkConnection();\n\n try {\n $result = $this->uploadFile($this->FTPHandle, $remoteFile, $localFile);\n\n } catch (\\Exception $ex) {\n\n }\n\n return $result ?? false;\n }", "function get($localfile, $remotefile, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_get($this->_socket, $localfile, $remotefile, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \tif (!$this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Error : No such file or directory \\\"\".$remotefile.\"\\\"\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \tif (@file_exists($localfile)) {\r\n \t\t$this->debug(\"Warning : local file will be overwritten\\n\");\r\n \t} else {\r\n \t\tumask($this->_umask);\r\n \t}\r\n \t\r\n \t$fp = @fopen($localfile, \"w\");\r\n \tif (!$fp) {\r\n \t\t$this->debug(\"Error : Cannot create \\\"\".$localfile.\"\\\"\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \t$this->putcmd(\"RETR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : GET failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Retrieving remote file \\\"\".$remotefile.\"\\\" to local file \\\"\".$localfile.\"\\\"\\n\");\r\n \twhile (!feof($sock_data)) {\r\n \t\tfputs($fp, fread($sock_data, 4096));\r\n \t}\r\n \tfclose($fp);\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "function setFileContent($db, $file, $localFilePath)\n{\n $storageType = 'local';\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n $uploadServerDetails = loadServer($db, $file);\n if ($uploadServerDetails != false)\n {\n $storageLocation = $uploadServerDetails['storagePath'];\n $storageType = $uploadServerDetails['serverType'];\n\n // if no storage path set & local, use system default\n if ((strlen($storageLocation) == 0) && ($storageType == 'local'))\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n\n if ($storageType == 'direct')\n {\n $storageLocation = LOCAL_STORAGE_DEFAULT_PATH;\n }\n }\n\n // get subfolder\n $subFolder = current(explode(\"/\", $file['localFilePath']));\n $originalFilename = end(explode(\"/\", $file['localFilePath']));\n\n // use ssh to get contents of 'local' files\n if (($storageType == 'local') || ($storageType == 'direct'))\n {\n // get remote file path\n $remoteFilePath = $storageLocation . $file['localFilePath'];\n // first try setting the file locally\n $done = false;\n if ((ON_SCRIPT_INSTALL == true) && file_exists($remoteFilePath))\n {\n $done = copy($localFilePath, $remoteFilePath);\n if ($done)\n {\n return true;\n }\n }\n\n // try over ssh\n if ($done == false)\n {\n\t\t\t$sshHost = LOCAL_STORAGE_SSH_HOST;\n\t\t\t$sshUser = LOCAL_STORAGE_SSH_USER;\n\t\t\t$sshPass = LOCAL_STORAGE_SSH_PASS;\n\n\t\t\t// if 'direct' file server, get SSH details\n\t\t\t$serverDetails = getDirectFileServerSSHDetails($file['serverId']);\n\t\t\tif($serverDetails)\n\t\t\t{\n\t\t\t\t$sshHost = $serverDetails['ssh_host'];\n $sshPort = $serverDetails['ssh_port'];\n\t\t\t\t$sshUser = $serverDetails['ssh_username'];\n\t\t\t\t$sshPass = $serverDetails['ssh_password'];\n\t\t\t\t$basePath = $serverDetails['file_storage_path'];\n\t\t\t\tif(substr($basePath, strlen($basePath)-1, 1) == '/')\n\t\t\t\t{\n\t\t\t\t\t$basePath = substr($basePath, 0, strlen($basePath)-1);\n\t\t\t\t}\n\t\t\t\t$remoteFilePath = $basePath . '/' . $file['localFilePath'];\n\t\t\t}\n \n if(strlen($sshPort) == 0)\n {\n $sshPort = 22;\n }\n\t\t\t\n // connect to 'local' storage via SSH\n $sftp = new Net_SFTP($sshHost, $sshPort);\n if (!$sftp->login($sshUser, $sshPass))\n {\n output(\"Error: Failed logging into \" . $sshHost . \" (Port: \".$sshPort.\") via SSH..\\n\");\n\n return false;\n }\n\n // overwrite file\n $rs = $sftp->put($remoteFilePath, $localFilePath, NET_SFTP_LOCAL_FILE);\n if ($rs)\n {\n return true;\n }\n\n output(\"Error: Failed uploading converted file to \" . LOCAL_STORAGE_SSH_HOST . \" (\" . $remoteFilePath . \") via SSH..\\n\");\n }\n\n return false;\n }\n\n // ftp\n if ($storageType == 'ftp')\n {\n // setup full path\n $prePath = $uploadServerDetails['storagePath'];\n if (substr($prePath, strlen($prePath) - 1, 1) == '/')\n {\n $prePath = substr($prePath, 0, strlen($prePath) - 1);\n }\n $remoteFilePath = $prePath . '/' . $file['localFilePath'];\n\n // connect via ftp\n $conn_id = ftp_connect($uploadServerDetails['ipAddress'], $uploadServerDetails['ftpPort'], 30);\n if ($conn_id === false)\n {\n output('Could not connect to ' . $uploadServerDetails['ipAddress'] . ' to upload file.');\n return false;\n }\n\n // authenticate\n $login_result = ftp_login($conn_id, $uploadServerDetails['ftpUsername'], $uploadServerDetails['ftpPassword']);\n if ($login_result === false)\n {\n output('Could not login to ' . $uploadServerDetails['ipAddress'] . ' with supplied credentials.');\n return false;\n }\n\n // get content\n $rs = ftp_put($conn_id, $remoteFilePath, $localFilePath, FTP_BINARY);\n if ($rs == true)\n {\n return true;\n }\n }\n\n output(\"Error: Failed uploading converted file to \" . $uploadServerDetails['ipAddress'] . \" via FTP..\\n\");\n\n return false;\n}", "public static function download($local, $remote)\n {\n // Create download agent\n $agent = new libraries\\agent;\n\n // Download file\n $agent->get($remote);\n\n // Open a local file\n $fh = fopen($local, \"w+\");\n\n // Write to a local file\n fputs($fh, $agent->body());\n\n // Done\n fclose($fh);\n }", "public function setRemoteFile($remoteFileName){\n\t\t$this->remote_file = $remoteFileName;\n\t}", "private function uploadFile($local_file, $source, $remote_file, $remote_dir) {\n if (($fh = fopen(\"$source$local_file\", \"rb\"))) {\n $buffer = fread($fh, 4096);\n fclose($fh);\n }\n if (empty($buffer))\n throw new Exception(\"Could not open local file: $source$local_file.\");\n\n $fh = fopen(\"$source$local_file\", \"rb\");\n if ($fh) {\n $maxBytes = WikiGlobalConfig::getConf('maxVarLengthFTP', 'wikiiocmodel');\n $remote_dir = \"/\".trim($remote_dir,\"/\").\"/\";\n ssh2_sftp_mkdir($this->sftp, $remote_dir, 0777, TRUE);\n\n $stream = @fopen(\"ssh2.sftp://{$this->sftp}$remote_dir$remote_file\", 'w');\n if (! $stream)\n throw new Exception(\"Could not open remote file: $remote_dir$remote_file\");\n\n while (! feof($fh)) {\n $data_to_send = @fread($fh, $maxBytes); //Llegir 1 MB\n if (@fwrite($stream, $data_to_send) === false)\n throw new Exception(\"Could not send data from file: $source$local_file.\");\n }\n $ret = fclose($stream);\n fclose($fh);\n }\n //Logger::debug(\"FtpSender::uploadFile-end: \\$ret=$ret\", 0, __LINE__, basename(__FILE__), 1);\n return $ret;\n }", "public function saveLocalFile()\n {\n if (!Storage::disk('local')->exists(self::NAME_FILE_LOCAL) && $this->verificUrl()) {\n Storage::disk('local')->put(self::NAME_FILE_LOCAL, file(self::URL_UMASS_COUNTRYS));\n }\n }", "public function setLocalFile($localFilePath) {\n\t\t$this->localFilePath = $localFilePath;\n\t}", "public function storeFileFromLocalPath($type, $path, $newFilename = null, $unlinkAfterStore = false);", "public function upload($localFile, $remoteFile)\n\t{\n\t\t$this->initScp();\n\n\t\tif (is_dir($localFile)) {\n\t\t\t$localDir = rtrim($localFile, '/') . '/';\n\t\t\t$remoteDir = rtrim($remoteFile, '/') . '/';\n\n\t\t\t$this->exec('mkdir -p ' . $remoteDir);\n\n\t\t\t$files = array_diff(scandir($localDir), array('.', '..'));\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$this->upload($localDir . $file, $remoteDir . $file);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->scp->put($remoteFile, $localFile, NET_SCP_LOCAL_FILE);\n\t\t}\n\t}", "public function put($remoteFilename, $localFilename, $transferMode = FtpClientConfig::MODE_BINARY) {\n if (false !== $this->connection) {\n return ftp_put($this->connection, $remoteFilename, $localFilename, $transferMode);\n }\n return false;\n }", "private function writeTempFile($localPath)\n {\n // Remote file name\n $tsFileName = basename($localPath);\n\n // Copy file to remote\n if ($this->write($localPath)) {\n // Get difference\n $diff = abs(filemtime($localPath) - ftp_mdtm($this->handle, $tsFileName));\n\n $this->log('Time difference between servers is [##]', $diff);\n\n ftp_delete($this->handle, $tsFileName);\n\n // Convert to hours\n return (integer)($diff > 3600 ? (floor($diff / 3600) * 3600 + $diff % 3600) : 0);\n }\n\n return 0;\n }", "function fput($remotefile, $fp, $mode = 1)\r\n {\r\n if ($this->_use_mod_ftp) {\r\n \t\tftp_fput($this->_socket, $remotefile, $fp, $mode);\r\n \t} else {\r\n \tif ($mode) {\r\n \t\t$type = \"I\";\r\n \t} else {\r\n \t\t$type = \"A\";\r\n \t}\r\n \t\r\n \t$this->putcmd(\"PASV\");\r\n \t$string = $this->getresp();\r\n \t\r\n \t$this->putcmd(\"TYPE\", $type);\r\n \t$this->getresp();\r\n \t\r\n \tif ($this->file_exists($remotefile)) {\r\n \t\t$this->debug(\"Warning : Remote file will be overwritten\\n\");\r\n \t}\r\n \t\r\n \t$this->putcmd(\"STOR\", $remotefile);\r\n \t\r\n \t$sock_data = $this->open_data_connection($string);\r\n \tif (!$sock_data) {\r\n \t\treturn FALSE;\r\n \t}\r\n \tif ($this->ok()) {\r\n \t\t$this->debug(\"Connected to remote host\\n\");\r\n \t} else {\r\n \t\t$this->debug(\"Cannot connect to remote host\\n\");\r\n \t\t$this->debug(\"Error : PUT failed\\n\");\r\n \t\treturn FALSE;\r\n \t}\r\n \t\r\n \t$this->debug(\"Storing local file to remote file \\\"\".$remotefile.\"\\\"\\n\");\r\n \twhile (!feof($fp)) {\r\n \t\tfputs($sock_data, fread($fp, 4096));\r\n \t}\r\n \t\r\n \t$this->close_data_connection($sock_data);\r\n \t}\r\n \treturn $this->ok();\r\n }", "public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}", "public function setSavePath($local, $path)\n {\n $this->save_local = $local;\n $this->save_path = $path;\n }", "public function fsockopen_remote_host_path(&$path, $url)\n {\n }", "function _downloadRemoteImageToLocalPath($sRemoteUrl, $sFile) {\n $sRemoteData = $this->_fileGetContent($sRemoteUrl, array());\n\n // Only save data if we managed to get the file content\n if ($sRemoteData) {\n $rFile = fopen($sFile, \"w+\");\n fputs($rFile, $sRemoteData);\n fclose($rFile);\n } else {\n // Try to delete file if download failed\n if (file_exists($sFile)) {\n @unlink($sFile);\n }\n\n return false;\n }\n\n return true;\n }", "public function put($remote, $local, $mode = FTP_ASCII) {\n if ($this->getActive()) {\n // Upload the local file to the remote location specified\n if (ftp_put($this->_connection, $remote, $local, $mode)) {\n return true;\n } else {\n return false;\n }\n } else {\n throw new CHttpException(403, 'EFtpComponent is inactive and cannot perform any FTP operations.');\n }\n }", "public function download($file, $local_file);", "public function upload($file, $local_file);", "public function PutFile($filename, $localPath){\n $uniquePrefix = substr(md5(microtime() . $filename), 0, 5) . \"_\";\n $prefixedFilename = $uniquePrefix . $filename;\n\n\n\n $s3 = S3Client::factory(array(\n 'credentials' => new Credentials(S3Storage::AWS_KEY, S3Storage::AWS_SECRET)\n ));\n\n try {\n $s3->putObject([\n 'Bucket' => 'shoperella-images',\n 'Key' => $prefixedFilename,\n 'Body' => fopen($localPath, 'r'),\n ]);\n } catch (\\Exception $e) {\n return \"\";\n }\n\n return \"https://s3.amazonaws.com/shoperella-images/\" . $prefixedFilename;\n }", "public function download_move($file, $local_file);", "public function download($remoteFile, $localFile = false)\n\t{\n\t\t$this->initScp();\n\n\t\treturn $this->scp->get($remoteFile, $localFile);\n\t}", "public function syncronize($localPath, $remotePath)\n {\n /**\n * @var SshConfig $sshConfig\n */\n foreach ($this->servers as $sshConfig) {\n $rsyncCommand = $this->filesystemCommand->rsyncSsh($localPath, $remotePath, $sshConfig, $this->rsyncParameters);\n $this->process->execute($rsyncCommand);\n }\n }", "function get($remoteFile, $localFile = false)\n {\n if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {\n $this->sftp_errors[] = \"No bitmap and Mask Login\";\n return false;\n }\n\n $remoteFile = $this->_realpath($remoteFile);\n if ($remoteFile === false) {\n $this->sftp_errors[] = \"Remote file not found\";\n return false;\n }\n\n $packet = pack('Na*N2', strlen($remoteFile), $remoteFile, NET_SFTP_OPEN_READ, 0);\n if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {\n $this->sftp_errors[] = \"Cannot send SFTP Open\";\n return false;\n }\n\n $response = $this->_get_sftp_packet();\n switch ($this->packet_type) {\n case NET_SFTP_HANDLE:\n $handle = substr($response, 4);\n break;\n case NET_SFTP_STATUS: // presumably SSH_FX_NO_SUCH_FILE or SSH_FX_PERMISSION_DENIED\n extract(unpack('Nstatus/Nlength', $this->_string_shift($response, 8)));\n $this->sftp_errors[] = $this->status_codes[$status] . ': ' . $this->_string_shift($response, $length);\n return false;\n default:\n user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS', E_USER_NOTICE);\n return false;\n }\n\n $packet = pack('Na*', strlen($handle), $handle);\n if (!$this->_send_sftp_packet(NET_SFTP_FSTAT, $packet)) {\n $this->sftp_errors[] = \"Cannot send FSTAT\";\n return false;\n }\n\n $response = $this->_get_sftp_packet();\n switch ($this->packet_type) {\n case NET_SFTP_ATTRS:\n $attrs = $this->_parseAttributes($response);\n break;\n case NET_SFTP_STATUS:\n extract(unpack('Nstatus/Nlength', $this->_string_shift($response, 8)));\n $this->sftp_errors[] = $this->status_codes[$status] . ': ' . $this->_string_shift($response, $length);\n return false;\n default:\n user_error('Expected SSH_FXP_ATTRS or SSH_FXP_STATUS', E_USER_NOTICE);\n return false;\n }\n\n if ($localFile !== false) {\n $filePointer = fopen($localFile, 'wb');\n if (!$filePointer) {\n $this->sftp_errors[] = \"Cannot write local file\";\n return false;\n }\n } else {\n $content = '';\n }\n\n $log = 0;\n $read = 0;\n while ($read < $attrs['size']) {\n $packet = pack('Na*N3', strlen($handle), $handle, 0, $read, 1 << 20);\n if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet)) {\n $this->sftp_errors[] = \"Cannot send read packet\";\n return false;\n }\n\n $response = $this->_get_sftp_packet();\n switch ($this->packet_type) {\n case NET_SFTP_DATA:\n $temp = substr($response, 4);\n $read+= strlen($temp);\n if ($localFile === false) {\n $content.= $temp;\n } else {\n fputs($filePointer, $temp);\n }\n break;\n case NET_SFTP_STATUS:\n extract(unpack('Nstatus/Nlength', $this->_string_shift($response, 8)));\n $this->sftp_errors[] = $this->status_codes[$status] . ': ' . $this->_string_shift($response, $length);\n break 2;\n default:\n user_error('Expected SSH_FXP_DATA or SSH_FXP_STATUS', E_USER_NOTICE);\n return false;\n }\n if ($log++ % 50 == 0) {\n $bytesIn = $this->formatBytes($read);\n $bytesTotal = $this->formatBytes($attrs['size']);\n Mage::log(\" BVSFTP - Retrieved $bytesIn of $bytesTotal.\", Zend_Log::INFO, Bazaarvoice_Connector_Helper_Data::LOG_FILE);\n }\n }\n\n if (!$this->_send_sftp_packet(NET_SFTP_CLOSE, pack('Na*', strlen($handle), $handle))) {\n return false;\n }\n\n $response = $this->_get_sftp_packet();\n if ($this->packet_type != NET_SFTP_STATUS) {\n user_error('Expected SSH_FXP_STATUS', E_USER_NOTICE);\n return false;\n }\n\n extract(unpack('Nstatus', $this->_string_shift($response, 4)));\n if ($status != NET_SFTP_STATUS_OK) {\n extract(unpack('Nlength', $this->_string_shift($response, 4)));\n $this->sftp_errors[] = $this->status_codes[$status] . ': ' . $this->_string_shift($response, $length);\n return false;\n }\n\n if (isset($content)) {\n return $content;\n }\n\n fclose($filePointer);\n return true;\n }" ]
[ "0.7364441", "0.7144072", "0.706321", "0.7050303", "0.6897472", "0.6828912", "0.6653249", "0.66260946", "0.65327495", "0.65132487", "0.64762366", "0.6444841", "0.6439745", "0.6352071", "0.629292", "0.62740403", "0.62718016", "0.6235605", "0.6214453", "0.6171865", "0.6112418", "0.6102252", "0.6077266", "0.6042119", "0.60382974", "0.6034845", "0.59497845", "0.5947728", "0.58624136", "0.5861454" ]
0.7789523
0
Truncates the string entered by the count entered. Returns &hellip ( ellipsis ) at the end of the string if count is exceeded.
function trim_string_by( $count, $string ) { return ( absint( $count ) <= str_word_count( $string ) ) ? wp_trim_words( $string, absint( $count ), '&hellip;' ) : $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function truncate($text)\n{\n $max_char=500;\n // Text length is over the limit\n if (strlen($text)>$max_char){\n // Define maximum char number\n $text = substr($text, 0, $max_char);\n // Get position of the last space\n $position_space = strrpos($text, \" \");\n $text = substr($text, 0, $max_char);\n // Add \"...\"\n $text = $text.\" ...\";\n }\n // Return the text\n return $text;\n}", "function flawless_word_trim( $string, $count, $ellipsis = false ) {\r\n\r\n if ( strlen( $string ) < $count ) {\r\n return $string;\r\n }\r\n\r\n $truncated = preg_replace( '/\\s+?( \\S+ )?$/', '', substr( $string, 0, $ellipsis ? $count + 3 : $count ) );\r\n\r\n if ( strlen( $string ) > strlen( $truncated ) && $ellipsis ) {\r\n $truncated .= '...';\r\n }\r\n\r\n return $truncated;\r\n\r\n }", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\")\n{\n if(strlen($string) <= $limit) return $string;\n\n $string = substr($string, 0, $limit);\n if(false !== ($breakpoint = strrpos($string, $break))) {\n $string = substr($string, 0, $breakpoint);\n }\n\n return $string . $pad;\n}", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\") {\n\nif(strlen($string) <= $limit) \n\nreturn $string; \n\n$string = substr($string, 0, $limit); \n\nif(false !== ($breakpoint = strrpos($string, $break))) \n\n{ \n\n$string = substr($string, 0, $breakpoint); \n\n} \n\nreturn $string . $pad; \n\n}", "function myTruncate2($string, $limit, $break=\" \", $pad=\"\")\n {\n if(strlen($string) <= $limit) return $string;\n\n $string = substr($string, 0, $limit);\n if(false !== ($breakpoint = strrpos($string, $break))) {\n $string = substr($string, 0, $breakpoint);\n }\n\n return $string . $pad;\n }", "function myTruncate($string, $limit=10, $pad=\"...\") {\n if(strlen($string) <= $limit) return $string;\n $string = substr($string, 0, $limit) . $pad;\n return $string;\n }", "function truncate_max($string, $limit, $break=\" \", $pad=\"...\") { // return with no change if string is shorter than $limit \n\tif(strlen($string) <= $limit) return $string; \n\t$string = substr($string, 0, $limit); \n\tif(false !== ($breakpoint = strrpos($string, $break))) \n\t{ $string = substr($string, 0, $breakpoint); } \n\treturn $string . $pad; \n}", "function truncate($string, $limit, $break=\".\", $pad=\"...\") {\n \tif(strlen($string) <= $limit) return $string;\n \t// is $break present between $limit and the end of the string?\n \tif(false !== ($breakpoint = strpos($string, $break, $limit)))\n \t{ if($breakpoint < strlen($string) - 1)\n \t{ $string = substr($string, 0, $breakpoint) . $pad; } }\n \n \tif (strlen($string) < 400)\n \t{\n \treturn $string;\n \t}\n \n \n \n \t// return with no change if string is shorter than $limit\n \tif(strlen($string) <= $limit) return $string;\n \n \t$string = substr($string, 0, $limit);\n \tif(false !== ($breakpoint = strrpos($string, $break))) {\n \t$string = substr($string, 0, $breakpoint);\n \t}\n \n \treturn $string . $pad;\n }", "function myTruncate($string, $limit=80, $break=\".\", $pad=\"...\")\n{\n if(strlen($string) <= $limit) return $string;\n\n // is $break present between $limit and the end of the string?\n if(false !== ($breakpoint = strpos($string, $break, $limit))) {\n if($breakpoint < strlen($string) - 1) {\n $string = substr($string, 0, $breakpoint) . $pad;\n }\n }\n \n return restoreTags($string);\n}", "function stringTruncation($string, $limit, $break, $pad)\n{\n if(strlen($string) <= $limit) return $string;\n $string = substr($string, 0, $limit);\n if(false !== ($breakpoint = strrpos($string, $break)))\n { $string = substr($string, 0, $breakpoint);\n }\n return $string . $pad;\n}", "function truncate($string, $limit, $break=\" \", $pad=\"...\") {\n\t if(strlen($string) <= $limit) return $string; \n\t // is $break present between $limit and the end of the string? \n\t if(false !== ($breakpoint = strpos($string, $break, $limit))) \n\t { \n\t \tif($breakpoint < strlen($string) - 1) \n\t \t{ \n\t \t\t$string = substr($string, 0, $breakpoint) . $pad; \n\t \t} \n\t } return $string; \n\t }", "function truncate($text, $limit = 40)\n{\n if (str_word_count($text, 0) > $limit) {\n $words = str_word_count($text, 2);\n $pos = array_keys($words);\n $text = mb_substr($text, 0, $pos[$limit], 'UTF-8') . '...';\n }\n\n return $text;\n}", "function truncate($string, $limit, $break=\".\", $pad=\"...\") {\n // return with no change if string is shorter than $limit\n if(strlen($string) <= $limit) return $string;\n // is $break present between $limit and the end of the string?\n if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint < strlen($string) - 1) { $string = substr($string, 0, $breakpoint) . $pad; } } return $string;\n}", "function truncate2($string, $limit, $break=\" \", $pad=\"...\") {\n if(strlen($string) <= $limit) return $string;\n\n // is $break present between $limit and the end of the string?\n if(false !== ($breakpoint = strpos($string, $break, $limit))) {\n if($breakpoint < strlen($string) - 1) {\n $string = substr($string, 0, $breakpoint) . $pad;\n }\n }\n\n return $string;\n}", "function truncate($string, $limit, $break=\".\", $pad=\"...\")\n{\n // return with no change if string is shorter than $limit\n if(strlen($string) <= $limit) return $string;\n\n // is $break present between $limit and the end of the string?\n if(false !== ($breakpoint = strpos($string, $break, $limit))) {\n if($breakpoint < strlen($string) - 1) {\n $string = substr($string, 0, $breakpoint) . $pad;\n }\n }\n\n return $string;\n}", "function truncate($string, $limit, $break=\" \", $pad=\"...\") {\n\n // Return with no change if string is shorter than $limit\n if(strlen($string) <= $limit) return $string;\n\n // is $break present between $limit and the end of the string?\n if(false !== ($breakpoint = strpos($string, $break, $limit))) {\n if($breakpoint < strlen($string) - 1) {\n $string = substr($string, 0, $breakpoint) . $pad;\n }\n }\n \n return $string;\n}", "public static function cut(string $s, int $limit = 100, string $end = '...'): string {\n if (mb_strlen($s) <= $limit) {\n return $s;\n }\n\n return mb_strimwidth($s, 0, $limit, $end);\n }", "function str_cut ($str, $size) {\n\t// is the string already short enough?\n\t// we count '…' for 1 extra chars.\n\tif( strlen($str) <= $size+1 ) {\n\t\treturn $str;\n\t}\n\n\treturn substr($str, 0, $size) . '…';\n}", "function truncate($input,$maxChars,$maxWords=0,$more='...'){\r\n\t//Make sure the input is not just spaces\r\n\tif ((trim($input) != \"\")){\r\n\t\t//split all the words in the input text by using space\r\n\t\t$words = preg_split('/\\s+/', $input);\r\n\r\n\t\t//Check if the maximum words is greater than 0\r\n\t\tif ($maxWords > 0)\r\n\t\t$words = array_slice($words, 0, $maxWords);\r\n\r\n\r\n\t\t$words = array_reverse($words);\r\n\r\n\t\t$chars = 0;\r\n\t\t$truncated = array();\r\n\r\n\t\twhile(count($words) > 0)\r\n\t\t{\r\n\t\t $fragment = trim(array_pop($words));\r\n\t\t $chars += strlen($fragment);\r\n\r\n\t\t if($chars > $maxChars) break;\r\n\r\n\t\t $truncated[] = $fragment;\r\n\t\t}\r\n\r\n\t\t$result = implode($truncated, ' ');\r\n\r\n\t\tif (($result == \"\") || ($maxWords == 0)){\r\n\t\t\treturn substr($input, 0,$maxChars).$more;\r\n\t\t}\r\n\r\n\t\treturn $result . ($input == $result ? '' : $more);\r\n\t}\r\n\r\n}", "function truncate($string, $length, $stopanywhere=false)\n{\n if (strlen($string) > $length)\n {\n //limit hit!\n $string = substr($string, 0, ($length - 3));\n if ($stopanywhere)\n {\n //stop anywhere\n $string .= '...';\n } else\n {\n //stop on a word.\n $string = substr($string, 0, strrpos($string, ' ')) . '...';\n }\n }\n return $string;\n}", "function truncate($string,$length=500,$append=\"&hellip;\") {\n $string = trim($string);\n\n if(strlen($string) > $length) {\n $string = wordwrap($string, $length);\n $string = explode(\"\\n\", $string, 2);\n $string = $string[0] . $append;\n }\n\n return $string;\n}", "function truncate_it($length, $string)\n{\n if (strlen(strip_tags($string)) < $length) {\n return strip_tags($string);\n }\n return substr(strip_tags($string), 0, $length) . '...';\n}", "function stringTrunc( $string, $limit, $end ) {\n\treturn ( strlen( $string ) > $limit ) ? substr( $string, 0, $limit ) . $end : $string;\n}", "function myTruncate($string, $limit, $break = \".\", $pad = \"...\") {\r\n// return with no change if string is shorter than $limit\r\n if (strlen($string) <= $limit)\r\n return $string; // is $break present between $limit and the end of the string?\r\n if (false !== ($breakpoint = strpos($string, $break, $limit))) {\r\n if ($breakpoint < strlen($string) - 1) {\r\n $string = substr($string, 0, $breakpoint) . $pad;\r\n }\r\n }\r\n return $string;\r\n}", "function truncate($text, $n = 200, $ending = '...') {\n\t\treturn $this->Text->truncate($text, $n, array('ending' => $ending, 'exact' => false));\n\t}", "function truncate($string, $limit, $break = \".\", $pad = \"...\")\n {\n if (strlen($string) <= $limit) {\n return $string;\n }\n\n // is $break present between $limit and the end of the string?\n if (false !== ($breakpoint = strpos($string, $break, $limit))) {\n if ($breakpoint < strlen($string) - 1) {\n $string = substr($string, 0, $breakpoint) . $pad;\n }\n }\n\n return $string;\n }", "function truncate_text($text, $max_chars = 70) {\n if (strlen($text) > $max_chars) {\n return explode( \"\\n\", wordwrap( $text, $max_chars))[0] . '…';\n }\n return $text;\n}", "function Truncate($str, $length=10, $trailing='...') {\n $length-=strlen($trailing);\n if (strlen($str) > $length)\n {\n // string exceeded length, truncate and add trailing dots\n return substr($str,0,$length).$trailing;\n }\n else\n {\n // string was already short enough, return the string\n $res = $str;\n }\n\n return $res;\n}", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "function stringTruncation2($string, $limit, $pad)\n{\n if(strlen($string) <= $limit)\n { return $string;\n }\n else \n { $string = substr($string, 0, $limit - 3);\n return $string . $pad;\n }\n}" ]
[ "0.70066357", "0.6977688", "0.6945699", "0.6912", "0.68919134", "0.6884434", "0.6872693", "0.68547964", "0.6824126", "0.67859066", "0.67849714", "0.67799217", "0.6736354", "0.6718578", "0.67020756", "0.6659803", "0.6644922", "0.66441554", "0.66397905", "0.6637387", "0.6631055", "0.6622013", "0.6599432", "0.65825033", "0.6581874", "0.65557253", "0.6553404", "0.6535199", "0.65265065", "0.6510577" ]
0.7121019
0
/ compose the navigation bar
private function composeNavigation() { view()->composer('partials.nav', 'App\Http\Composers\NavigationComposer'); //default wordt @compose (=compose functie) gebruikt /* //when laravel is composing the view partials/nav, execute closure view()->composer('partials.nav', function ($view) { //zo zorg je dat $latest in iedere view beschikbaar is (goed voor bvb menuitems) $view->with('latest', Article::latest()->first()); }); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Public function Anavbar(){\n\t\n\t}", "public function onNavigationBar($event) {\n if ($this->user) {\n // add the profile links\n Navigation::addBar('default', array('title' => 'View Profile', 'slug' => 'account/profile', 'icon' => 'cog'));\n\n // add the admin links\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'View Logs', 'slug' => 'logviewer', 'icon' => 'wrench'));\n Navigation::addBar('default', array('title' => 'Caching', 'slug' => 'caching', 'icon' => 'tachometer'));\n Navigation::addBar('default', array('title' => 'CloudFlare', 'slug' => 'cloudflare', 'icon' => 'cloud'));\n Navigation::addBar('default', array('title' => 'Queuing', 'slug' => 'queuing', 'icon' => 'random'));\n }\n\n // add the view users link\n if (Sentry::getUser()->hasAccess('mod')) {\n Navigation::addBar('default', array('title' => 'View Users', 'slug' => 'users', 'icon' => 'user'));\n }\n\n // add the create user link\n if (Sentry::getUser()->hasAccess('admin')) {\n Navigation::addBar('default', array('title' => 'Create User', 'slug' => 'users/create', 'icon' => 'star'));\n }\n\n // add the create page link\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Page', 'slug' => 'pages/create', 'icon' => 'pencil'));\n }\n\n // add the create post link\n if (Config::get('cms.blogging')) {\n if (Sentry::getUser()->hasAccess('blog')) {\n Navigation::addBar('default', array('title' => 'Create Post', 'slug' => 'blog/posts/create', 'icon' => 'book'));\n }\n }\n\n // add the create event link\n if (Config::get('cms.events')) {\n if (Sentry::getUser()->hasAccess('edit')) {\n Navigation::addBar('default', array('title' => 'Create Event', 'slug' => 'events/create', 'icon' => 'calendar'));\n }\n }\n }\n }", "public function nav()\n\t{\n\t\t$nav['dashboard'] = array('name' => Blocks::t('Dashboard'));\n\t\t$nav['content'] = array('name' => Blocks::t('Content'));\n\t\t$nav['assets'] = array('name' => Blocks::t('Assets'));\n\n\t\tif (Blocks::hasPackage(BlocksPackage::Users) && blx()->userSession->checkPermission('editUsers'))\n\t\t{\n\t\t\t$nav['users'] = array('name' => Blocks::t('Users'));\n\t\t}\n\n\t\t// Add any Plugin nav items\n\t\t$plugins = blx()->plugins->getPlugins();\n\n\t\tforeach ($plugins as $plugin)\n\t\t{\n\t\t\tif ($plugin->hasCpSection())\n\t\t\t{\n\t\t\t\t$lcHandle = strtolower($plugin->getClassHandle());\n\t\t\t\t$nav[$lcHandle] = array('name' => $plugin->getName());\n\n\t\t\t\t// Does the plugin have an icon?\n\t\t\t\t$resourcesPath = blx()->path->getPluginsPath().$lcHandle.'/resources/';\n\n\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-16x16.png'))\n\t\t\t\t{\n\t\t\t\t\t$nav[$lcHandle]['hasIcon'] = true;\n\n\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-16x16.png');\n\t\t\t\t\tblx()->templates->includeCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\n\t\t\t\t\t// Does it even have a hi-res version?\n\t\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-32x32.png'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-32x32.png');\n\t\t\t\t\t\tblx()->templates->includeHiResCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->checkPermission('autoUpdateBlocks'))\n\t\t{\n\t\t\t$numberOfUpdates = blx()->updates->getTotalNumberOfAvailableUpdates();\n\n\t\t\tif ($numberOfUpdates > 0)\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'), 'badge' => $numberOfUpdates);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'));\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->isAdmin())\n\t\t{\n\t\t\t$nav['settings'] = array('name' => Blocks::t('Settings'));\n\t\t}\n\n\t\treturn $nav;\n\t}", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "function navbar()\r\n {\r\n }", "function holistic_nav_widget() {\n\tregister_widget( 'Holistic_Nav_Widget' );\n}", "function reactor_do_nav_bar() { \n\tif ( has_nav_menu('main-menu') ) {\n\t\t$nav_class = ( reactor_option('mobile_menu', 1) ) ? 'class=\"hide-for-small\" ' : ''; ?>\n\t\t<div class=\"main-nav\">\n\t\t\t<nav id=\"menu\" <?php echo $nav_class; ?>role=\"navigation\">\n\t\t\t\t<div class=\"section-container horizontal-nav\" data-section=\"horizontal-nav\" data-options=\"one_up:false;\">\n\t\t\t\t\t<?php reactor_main_menu(); ?>\n\t\t\t\t</div>\n\t\t\t</nav>\n\t\t</div><!-- .main-nav -->\n\t\t\n\t<?php\t\n\tif ( reactor_option('mobile_menu', 1) ) { ?> \n\t\t<div id=\"mobile-menu-button\" class=\"show-for-small\">\n\t\t\t<button class=\"secondary button\" id=\"mobileMenuButton\" href=\"#mobile-menu\">\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t\t<span class=\"mobile-menu-icon\"></span>\n\t\t\t</button>\n\t\t</div><!-- #mobile-menu-button --> \n\t<?php }\n\t}\n}", "protected function navbar()\n\t{\n\t\tif($this->action->Id == 'show')\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn parent::navbar();\n\t}", "public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\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$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}", "private function _getNavigation()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVar( 'task' );\r\n\t\t$uri->delVar( 'submit' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action ) {\r\n\t\t\t\tif ( array_key_exists( 'task', $whmcs->input ) ) {\r\n\t\t\t\t\tif ( $whmcs->input['task'] != 'edittheme' ) {\r\n\t\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "public function renderNavigation()\n {\n return view('nova::dashboard.navigation');\n }", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "public function navbar() {\n global $CFG;\n $navbar = $this->page->navbar;\n if (!isloggedin() || isguestuser()) {\n $items = $navbar->get_items();\n foreach ($items as $i) {\n if ($i->type == navbar::NODETYPE_LEAF && $i->key == 'courses') {\n $i->action = new moodle_url($CFG->wwwroot . '/theme/savoir/pages/opencatalog.php');\n }\n }\n }\n return $this->render_from_template('core/navbar', $navbar);\n }", "public function renderNavigation()\n {\n return view('nova-blog-tool::navigation');\n }", "public function run() {\n\t\t\n\t\techo CHtml::openTag('nav', $this->htmlOptions);\n\t\techo '<div class=\"' . $this->getContainerCssClass() . '\">';\n\t\t\n\t\techo '<div class=\"navbar-header\">';\n\t\tif($this->collapse) {\n\t\t\t$this->controller->widget('booster.widgets.TbButton', array(\n\t\t\t\t'label' => '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>',\n\t\t\t\t'encodeLabel' => false,\n\t\t\t\t'htmlOptions' => array(\n\t\t\t\t\t'class' => 'navbar-toggle',\n\t\t\t\t\t'data-toggle' => 'collapse',\n\t\t\t\t\t'data-target' => '#'.self::CONTAINER_PREFIX.$this->id,\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t}\n\t\t\n\t\tif ($this->brand !== false) {\n\t\t\tif ($this->brandUrl !== false) {\n\t\t\t\tif($this->toggleSideBar){\n\t\t\t\t\techo \t\t\n\t\t\t\t\t'<button id=\"sidebar-toggle\">\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t<span class=\"icon-bar\"></span>\n\t\t\t\t\t</button>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo CHtml::openTag('a', $this->brandOptions) . $this->brand . '</a>';\n\t\t\t} else {\n\t\t\t\tunset($this->brandOptions['href']); // spans cannot have a href attribute\n\t\t\t\techo CHtml::openTag('span', $this->brandOptions) . $this->brand . '</span>';\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t\t\n\t\techo '<div class=\"collapse navbar-collapse\" id=\"'.self::CONTAINER_PREFIX.$this->id.'\">';\n\t\tforeach ($this->items as $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\techo $item;\n\t\t\t} else {\n\t\t\t\tif (isset($item['class'])) {\n\t\t\t\t\t$className = $item['class'];\n\t\t\t\t\tunset($item['class']);\n\n\t\t\t\t\t$this->controller->widget($className, $item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</div></div></nav>';\n\n\t\t$this->registerClientScript();\n\t}", "private function _getNavigation()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'themer' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action && $task != 'edittheme' ) {\r\n\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "private function build_navigation() {\n\t\t$content = \"<nav id='formlift-header' class='formlift-nav'>\";\n\t\tforeach ( $this->sections as $section ) {\n\t\t\t$content .= $section->get_header();\n\t\t}\n\n\t\treturn $content . \"<button type='submit' style='margin: 45px' class='button button-large'>SAVE CHANGES</button></nav>\";\n\t}", "function public_nav_main()\n{\n $view = get_view();\n $nav = new Omeka_Navigation;\n $nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);\n $nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);\n return $view->navigation()->menu($nav);\n}", "function side_navigation()\n\t{\n\t\t//side navigation\n\t\t$nav['dashboard'] = array(\n\t\t\t'name' => trans('admin_messages.dashboard'),\n\t\t\t'icon' => 'assessment',\n\t\t\t'has_permission' => true,\n\t\t\t'route' => route('admin.dashboard'),\n\t\t\t'active' => navigation_active('admin.dashboard'),\n\t\t);\n\n\t\t$nav['admin_management'] = array(\n\t\t\t'name' => trans('admin_messages.admin_user_management'),\n\t\t\t'icon' => 'supervised_user_circle',\n\t\t\t'has_permission' => checkPermission('view-admin'),\n\t\t\t'route' => route('admin.view_admin'),\n\t\t\t'active' => navigation_active('admin.view_admin')\n\t\t);\n\n\t\t$nav['role_management'] = array(\n\t\t\t'name' => trans('admin_messages.role_management'),\n\t\t\t'icon' => 'lock',\n\t\t\t'has_permission' => checkPermission('view-role'),\n\t\t\t'route' => route('admin.view_role'),\n\t\t\t'active' => navigation_active('admin.view_role')\n\t\t);\n\n\t\t$nav['user_management'] = array(\n\t\t\t'name' => trans('admin_messages.user_management'),\n\t\t\t'icon' => 'account_circle',\n\t\t\t'has_permission' => checkPermission('view-user'),\n\t\t\t'route' => route('admin.view_user'),\n\t\t\t'active' => navigation_active('admin.view_user')\n\t\t);\n\t\t\n\t\t$nav['driver_management'] = array(\n\t\t\t'name' => trans('admin_messages.driver_management'),\n\t\t\t'icon' => 'drive_eta',\n\t\t\t'has_permission' => checkPermission('view-driver'),\n\t\t\t'route' => route('admin.view_driver'),\n\t\t\t'active' => navigation_active('admin.view_driver')\n\t\t);\n\t\t\n\t\t$nav['home_banner'] = array(\n\t\t\t'name' => trans('admin_messages.home_banner'),\n\t\t\t'icon' => 'merge_type',\n\t\t\t'has_permission' => checkPermission('view-home_banner'),\n\t\t\t'route' => route('admin.home_banner'),\n\t\t\t'active' => navigation_active('admin.home_banner')\n\t\t);\n\t\t\n\t\t$nav['cuisine_management'] = array(\n\t\t\t'name' => trans('admin_messages.cuisine_management'),\n\t\t\t'icon' => 'category',\n\t\t\t'has_permission' => checkPermission('view-category'),\n\t\t\t'route' => route('admin.cuisine'),\n\t\t\t'active' => navigation_active('admin.cuisine')\n\t\t);\n\t\t\n\t\t$nav['restaurant_management'] = array(\n\t\t\t'name' => trans('admin_messages.store_management'),\n\t\t\t'icon' => 'restaurant',\n\t\t\t'has_permission' => checkPermission('view-restaurant'),\n\t\t\t'route' => route('admin.view_restaurant'),\n\t\t\t'active' => navigation_active('admin.view_restaurant')\n\t\t);\n\t\t\n\t\t$nav['send_message'] = array(\n\t\t\t'name' => trans('admin_messages.send_message'),\n\t\t\t'icon' => 'email',\n\t\t\t'has_permission' => checkPermission('manage-send_message'),\n\t\t\t'route' => route('admin.send_message'),\n\t\t\t'active' => navigation_active('admin.send_message')\n\t\t);\n\t\t\n\t\t$nav['order_management'] = array(\n\t\t\t'name' => trans('admin_messages.order_managemnt'),\n\t\t\t'icon' => 'add_shopping_cart',\n\t\t\t'has_permission' => checkPermission('manage-orders'),\n\t\t\t'route' => route('admin.order'),\n\t\t\t'active' => navigation_active('admin.order')\n\t\t);\n\t\t\n\t\t$nav['restaurant_payout_management'] = array(\n\t\t\t'name' => trans('admin_messages.store_payout_management'),\n\t\t\t'icon' => 'euro_symbol',\n\t\t\t'has_permission' => checkPermission('manage-payouts'),\n\t\t\t'route' => route('admin.payout', 1),\n\t\t\t'active' => navigation_active('admin.payout', 1)\n\t\t);\n\t\t\n\t\t$nav['driver_payout_management'] = array(\n\t\t\t'name' => trans('admin_messages.driver_payout_management'),\n\t\t\t'icon' => 'motorcycle',\n\t\t\t'has_permission' => checkPermission('manage-payouts'),\n\t\t\t'route' => route('admin.payout', 2),\n\t\t\t'active' => navigation_active('admin.payout', 2)\n\t\t);\n\t\t\n\t\t$nav['driver_owe_amount'] = array(\n\t\t\t'name' => trans('admin_messages.owe_amount'),\n\t\t\t'icon' => 'attach_money',\n\t\t\t'has_permission' => checkPermission('manage-owe_amount'),\n\t\t\t'route' => route('admin.owe_amount'),\n\t\t\t'active' => navigation_active('admin.owe_amount')\n\t\t);\n\t\t\n\t\t$nav['restaurant_owe_amount'] = array(\n\t\t\t'name' => trans('admin_messages.store_owe_amount'),\n\t\t\t'icon' => 'attach_money',\n\t\t\t'has_permission' => checkPermission('manage-restaurant_owe_amount'),\n\t\t\t'route' => route('admin.restaurant_owe_amount'),\n\t\t\t'active' => navigation_active('admin.restaurant_owe_amount')\n\t\t);\n\n\n\t\t$nav['penality'] = array(\n\t\t\t'name' => trans('admin_messages.penalty'),\n\t\t\t'icon' => 'thumb_down',\n\t\t\t'has_permission' => checkPermission('manage-penality'),\n\t\t\t'route' => route('admin.penality'),\n\t\t\t'active' => navigation_active('admin.penality')\n\t\t);\n\t\t\n\t\t$nav['promo_management'] = array(\n\t\t\t'name' => trans('admin_messages.promo_management'),\n\t\t\t'icon' => 'card_giftcard',\n\t\t\t'has_permission' => checkPermission('view-promo'),\n\t\t\t'route' => route('admin.promo'),\n\t\t\t'active' => navigation_active('admin.promo')\n\t\t);\n\t\t\n\t\t$nav['static_page_management'] = array(\n\t\t\t'name' => trans('admin_messages.static_page_management'),\n\t\t\t'icon' => 'description',\n\t\t\t'has_permission' => checkPermission('view-static_page'),\n\t\t\t'route' => route('admin.static_page'),\n\t\t\t'active' => navigation_active('admin.static_page')\n\t\t);\n\t\t\n\t\t$nav['home_slider'] = array(\n\t\t\t'name' => trans('admin_messages.home_slider'),\n\t\t\t'icon' => 'description',\n\t\t\t'has_permission' => checkPermission('view-restaurant_slider'),\n\t\t\t'route' => route('admin.view_home_slider'),\n\t\t\t'active' => navigation_active('admin.view_home_slider')\n\t\t);\n\t\t\n\t\t$nav['country_management'] = array(\n\t\t\t'name' => trans('admin_messages.country_management'),\n\t\t\t'icon' => 'language',\n\t\t\t'has_permission' => checkPermission('view-country'),\n\t\t\t'route' => route('admin.country'),\n\t\t\t'active' => navigation_active('admin.country')\n\t\t);\n\t\t\n\t\t$nav['currency_management'] = array(\n\t\t\t'name' => trans('admin_messages.currency_management'),\n\t\t\t'icon' => 'euro_symbol',\n\t\t\t'has_permission' => checkPermission('view-currency'),\n\t\t\t'route' => route('admin.currency'),\n\t\t\t'active' => navigation_active('admin.currency')\n\t\t);\n\t\t\n\t\t\n\t\t$nav['language_management'] = array(\n\t\t\t'name' => trans('admin_messages.language_management'),\n\t\t\t'icon' => 'translate',\n\t\t\t'has_permission' => checkPermission('view-language'),\n\t\t\t'route' => route('admin.languages'),\n\t\t\t'active' => navigation_active('admin.languages')\n\t\t);\n\t\t\n\t\t$nav['cancel_reason'] = array(\n\t\t\t'name' => trans('admin_messages.cancel_reason'),\n\t\t\t'icon' => 'cancel',\n\t\t\t'has_permission' => checkPermission('view-cancel_reason'),\n\t\t\t'route' => route('admin.order_cancel_reason'),\n\t\t\t'active' => navigation_active('admin.order_cancel_reason')\n\t\t);\n\t\t\n\t\t$nav['review_issue_type'] = array(\n\t\t\t'name' => trans('admin_messages.review_issue_type'),\n\t\t\t'icon' => 'report_problem',\n\t\t\t'has_permission' => checkPermission('view-review_issue_type'),\n\t\t\t'route' => route('admin.issue_type'),\n\t\t\t'active' => navigation_active('admin.issue_type')\n\t\t);\n\t\t\n\t\t$nav['review_vehicle_type'] = array(\n\t\t\t'name' => trans('admin_messages.manage_vehicle_type'),\n\t\t\t'icon' => 'drive_eta',\n\t\t\t'has_permission' => checkPermission('view-vehicle_type'),\n\t\t\t'route' => route('admin.vehicle_type'),\n\t\t\t'active' => navigation_active('admin.vehicle_type')\n\t\t);\n\t\t\n\t\t$nav['food_receiver'] = array(\n\t\t\t'name' => trans('admin_messages.food_receiver'),\n\t\t\t'icon' => 'receipt',\n\t\t\t'has_permission' => checkPermission('view-recipient'),\n\t\t\t'route' => route('admin.food_receiver'),\n\t\t\t'active' => navigation_active('admin.food_receiver')\n\t\t);\n\t\t\n\t\t$nav['help_category'] = array(\n\t\t\t'name' => trans('admin_messages.help_category'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help_category'),\n\t\t\t'route' => route('admin.help_category'),\n\t\t\t'active' => navigation_active('admin.help_category')\n\t\t);\n\t\t\n\t\t$nav['help_subcategory'] = array(\n\t\t\t'name' => trans('admin_messages.help_subcategory'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help_subcategory'),\n\t\t\t'route' => route('admin.help_subcategory'),\n\t\t\t'active' => navigation_active('admin.help_subcategory')\n\t\t);\n\t\t\n\t\t$nav['help'] = array(\n\t\t\t'name' => trans('admin_messages.help'),\n\t\t\t'icon' => 'help',\n\t\t\t'has_permission' => checkPermission('view-help'),\n\t\t\t'route' => route('admin.help'),\n\t\t\t'active' => navigation_active('admin.help')\n\t\t);\n\t\t\n\t\t$nav['site_setting'] = array(\n\t\t\t'name' => trans('admin_messages.site_setting'),\n\t\t\t'icon' => 'settings',\n\t\t\t'has_permission' => checkPermission('manage-site_setting'),\n\t\t\t'route' => route('admin.site_setting'),\n\t\t\t'active' => navigation_active('admin.site_setting')\n\t\t);\n\n\n\t\t$nav['support'] = array(\n\t\t\t'name' => trans('admin_messages.support'),\n\t\t\t'icon' => 'support_agent',\n\t\t\t'has_permission' => checkPermission('view-support'),\n\t\t\t'route' => route('admin.support'),\n\t\t\t'active' => navigation_active('admin.support')\n\t\t);\n\n\t\treturn $nav;\n\t}", "public function renderNav() {\n if($this->renderNav['onoff']) {\n \n if(isset($this->renderNav['html']) && $this->renderNav['html']) {\n $content = $this->renderNav['html'];\n unset($this->renderNav['html']);\n } else {\n $ct['btnAddNav'] = $this->btnAddNav;\n $ct['btnAddMultiNav'] = $this->btnAddMultiNav;\n $ct['btnDeleteNav'] = $this->btnDeleteNav;\n $ct['btnCopyNav'] = $this->btnCopyNav;\n $result = '';\n $get = r()->get();\n foreach($ct as $key => $item) {\n if($item && isset($item['onoff']) && $item['onoff']) {\n unset($item['onoff']);\n if(isset($item['href'])) {\n $href = $item['href'];\n unset($item['href']);\n } else {\n $params = isset($get['SettingsGridSearch']['table_id']) ? $get : [];\n $params['menu_admin_id'] = $this->menu_admin_id;\n $href = UtilityUrl::createUrl($item['link_children'],$params);\n }\n $html = $item['icon'].$item['html'];unset($item['html']);unset($item['icon']);unset($item['link_children']);\n $result .= Html::a($html, $href, $item).' ';\n }\n }\n $content = '<div class=\"fr\">'.$result.'</div>';\n }\n unset($this->renderNav['onoff']);\n $html = Html::tag('div',$content.$this->renderNavLeft, $this->renderNav);\n return $html;\n } else {\n return '';\n }\n }", "public function main_navigation(){\r\n\r\n echo \"<ul>\";\r\n\r\n if(isset($this->navigationSettings)){\r\n\r\n foreach((array) $this->navigationSettings as $key => $value){\r\n echo \"<li>\";\r\n echo \"<a href='$value'>$key</a>\";\r\n echo \"</li>\";\r\n }\r\n\r\n }\r\n\r\n echo \"</ul>\";\r\n\r\n }", "function oh_nav()\n{\n\twp_nav_menu(\n\tarray(\n\t\t'theme_location' => 'header-menu',\n\t\t'menu' => '',\n\t\t'container' => 'div',\n\t\t'container_class' => 'menu-{menu slug}-container',\n\t\t'container_id' => '',\n\t\t'menu_class' => 'menu',\n\t\t'menu_id' => '',\n\t\t'echo' => true,\n\t\t'fallback_cb' => 'wp_page_menu',\n\t\t'before' => '',\n\t\t'after' => '',\n\t\t'link_before' => '',\n\t\t'link_after' => '',\n\t\t'items_wrap' => '<ul class=\"nav navbar-nav navbar-right no-margin alt-font text-normal\" data-in=\"fadeIn\" data-out=\"fadeOut\">%3$s</ul>',\n\t\t'depth' => 0,\n\t\t'walker' => ''\n\t\t)\n\t);\n}", "function scribbles_nav_wrapper_open(){\n\n\tget_template_part('templates/parts/nav-border');\n\n\techo '<div class=\"main-navigation-wrapper\">';\n\n}", "function get_navbar($menu) \n{\n\t$html = \"<nav class='navbar'>\\n\";\n\tforeach($menu['items'] as $item) \n\t{\n\t\tif(basename($_SERVER['SCRIPT_FILENAME']) == $item['url'])\n\t\t{\n\t\t\t$item['class'] .= ' selected'; \n\t\t}\n\t\t$html .= \"<p><a href='{$item['url']}' class='{$item['class']}'>{$item['text']}</a>\\n</p>\";\n\t}\n\t$html .= \"</nav>\";\n\treturn $html;\n}", "function getSideBar(){\r\n $barContent = \"\";\r\n \r\n if(!isUserLoggedIn())\r\n {\r\n $barContent .= '<BR/><HR><img src=\"spartan_logo.gif\" width=\"100%\"></img><HR>';\r\n $barContent .= '<blockquote><p>Please login . . .</p></blockquote><HR><BR/>';\r\n }\r\n else\r\n {\r\n\t\t$barContent .= '<HR><ul class=\"nav nav-pills nav-stacked\">';\r\n\t\t$barContent .= \t\t'<li><font color=\"black\"><B>Menu</B></font></li>';\r\n\t\t$barContent .= \t\t'<li> <A HREF=\"#\" onClick=\"MyHome()\">&nbsp;<i class=\"glyphicon glyphicon-home\"></i>&nbsp;&nbsp;Home</a> </li>';\r\n\t\t//$barContent .= \t\t'<li> <A HREF=\"#\" onClick=\"myGraph()\">&nbsp;<i class=\"icon-list\"></i>Tran</a> </li>';\r\n\t\t//$barContent .= \t\t'<li> <A HREF=\"#\" onClick=\"MyInfo()\">&nbsp;<i class=\"glyphicon glyphicon-user\"></i>&nbsp;&nbsp;Profile</a> </li>';\r\n\t\t$barContent .= '<li> <A HREF=\"#\" onClick=\"MyInfo()\">&nbsp;<i class=\"glyphicon glyphicon-user\"></i>&nbsp;&nbsp;Profile</a> </li>';\r\n $barContent .= '<li> <A HREF=\"#\" onClick=\"readlogfile()\">&nbsp;<i class=\"glyphicon glyphicon-road\"></i>&nbsp;&nbsp;Mail Log</a> </li>';\r\n\r\n $barContent .= '</ul>';\r\n \r\n $barContent .= '<HR><ul class=\"nav nav-list\">';\r\n $barContent .= \t'<li><font color=\"black\"><B>Event Menu</B></font></li>';\r\n $barContent .= \t'<li> <A HREF=\"#\" onClick=\"eventsButtonHandler(0)\">&nbsp;<i class=\"glyphicon glyphicon-eye-open\"></i>&nbsp;&nbsp;View</a> </li>';\r\n $barContent .= \t'<li> <A HREF=\"#\" onClick=\"eventsButtonHandler(1)\">&nbsp;<i class=\"glyphicon glyphicon-plus\"></i>&nbsp;&nbsp;Create</a> </li>';\r\n $barContent .= \t'<li> <A HREF=\"#\" onClick=\"eventsButtonHandler(2)\">&nbsp;<i class=\"glyphicon glyphicon-list-alt\"></i>&nbsp;&nbsp;View Multi</a> </li>';\r\n\t$barContent .= '<li> <A HREF=\"#\" onClick=\"eventsButtonHandler(3)\">&nbsp;<i class=\"glyphicon glyphicon-tower\"></i>&nbsp;&nbsp;Multi Create</a> </li>';\r\n\t$barContent .= '</ul><HR>';\r\n\r\n $barContent .= '<img src=\"spartan_logo.gif\" width=\"90%\"></img>';\r\n $barContent .= '<HR/>';\r\n }\r\n\r\n return $barContent;\r\n}", "public function render()\n {\n return view('components.navbar-nav');\n }", "function displayNav() {\n\t\t\n\t\t$menu = getList(0);\n\t\t$count = 1;\n\t\t$nav = preg_replace('/xx/', 'nav', $menu, $count);\n\t\treturn $nav;\n\t\t\n\t\t\n\t}", "private function displayNav()\n {\n\n $links = array(\n 'home',\n 'browse',\n 'about',\n 'contact',\n );\n\n //Navbar\n $html = '<div id=\"navbar\">' . \"\\n\";\n $html .= '<ul>' . \"\\n\";\n\n // Loop through the links\n foreach ($links as $link) {\n\n $html .= '<li><a href=\"index.php?page=' . $link . '\"';\n\n if ($link == $_GET['page']) {\n $html .= ' class=\"active\"';\n }\n\n $html .= '>';\n\n if ($this->model->userLoggedIn && $link == 'home') {\n $html .= 'My Profile';\n } else {\n $html .= ucfirst($link);\n }\n\n $html .= '</a></li>' . \"\\n\";\n\n }\n\n $html .= '</ul>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n return $html;\n }", "public function compose()\n {\n // Profile\n $this->dashboard->menu\n ->add(Menu::PROFILE,\n ItemMenu::label('Empty 1')\n ->icon('icon-compass')\n )\n ->add(Menu::PROFILE,\n ItemMenu::label('Empty 2')\n ->icon('icon-heart')\n ->badge(function () {\n return 6;\n })\n );\n\n // Main\n $this->dashboard->menu\n ->add(Menu::MAIN,\n ItemMenu::label('Example')\n ->icon('icon-folder')\n ->route('platform.main')\n )->add(Menu::MAIN,\n ItemMenu::label('Users')\n ->icon('icon-user')\n ->route('platform.systems.users')\n ->permission('platform.systems.users')\n )->add(Menu::MAIN,\n ItemMenu::label('Roles')\n ->icon('icon-lock')\n ->route('platform.systems.roles')\n ->permission('platform.systems.roles')\n );\n }", "function ShowNavBar()\n{\n $navBar = \"\";\n //Navigation Start\n $navBar .= \"<nav class=\\\"navbar navbar-default navbar-sticky bootsnav\\\">\";\n $navBar .=\"<div class=\\\"container\\\">\";\n // Début Header Navigation\n $navBar .= \"<div class=\\\"navbar-header\\\">\";\n $navBar .=\"<button type=\\\"button\\\" class=\\\"navbar-toggle\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbar-menu\\\">\";\n $navBar .= \"<i class=\\\"fa fa-bars\\\"></i>\";\n $navBar .= \"</button>\";\n $navBar .= \"<a class=\\\"navbar-brand\\\" href=\\\"index.php\\\"><img src=\\\"./img/logo.png\\\" class=\\\"logo\\\" alt=\\\"Logo du site\\\"></a>\";\n $navBar .=\"</div>\";\n // Fin Header Navigation\n\n\n $navBar .= \"<div class=\\\"collapse navbar-collapse\\\" id=\\\"navbar-menu\\\">\";\n $navBar .= \"<ul class=\\\"nav navbar-nav navbar-left\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\";\n $navBar .= \"<li \".SetActivePage(\"index\") . \"><a href=\\\"index.php\\\">Accueil</a></li>\";\n //Affiche les liens de connexion et d'inscription si l'utilisateur n'est pas connecté\n if (!IsUserLoggedIn()) {\n $navBar .= \"<li \" .SetActivePage(\"login\") . \">\";\n $navBar .=\"<a href=\\\"login.php\\\">Se connecter</a>\";\n $navBar .=\"</li>\";\n $navBar .= \"<li \" .SetActivePage(\"signup\"). \">\";\n $navBar .= \"<a href=\\\"signup.php\\\">S'inscrire</a>\";\n $navBar .= \"</li>\";\n }\n //Sinon affiche les liens correspondant au type de l'utilisateur\n else \n {\n switch (GetUserType()) \n {\n //Affiche les liens correspondant au type Chercheur\n case \"Chercheur\":\n $navBar .= \"<li \" .SetActivePage(\"annonces\") . \">\";\n $navBar.= \"<a href=\\\"annonces.php\\\">Annonces</a>\";\n $navBar.= \"</li>\";\n $navBar.= \"<li \" .SetActivePage(\"wishlist\") . \">\";\n $navBar.= \"<a href=\\\"wishlist.php?idU=\".GetUserId().\"\\\">Ma Wishlist</a>\";\n $navBar.= \"</li>\";\n break;\n //Affiche les liens correspondant au type Annonceur\n case \"Annonceur\":\n $navBar .= \"<li \";\n if (isset($_GET['idU']))\n $navBar .= SetActivePage(\"annonces\");\n $navBar .= \">\";\n $navBar.=\"<a href=\\\"annonces.php?idU=\" . GetUserId() . \"\\\">Mes Annonces</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \" .SetActivePage(\"creer-annonce\"). \">\";\n $navBar.=\"<a href=\\\"creer-annonce.php\\\">Créer une annonce</a>\";\n $navBar.=\"</li>\";\n break;\n //Affiche les liens correspondant au type Administrateur\n case \"Admin\":\n $navBar .= \"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"utilisateurs\") \n $navBar .=SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=utilisateurs\\\">Gérer les utilisateurs</a>\";\n $navBar.=\"</li>\";\n $navBar.=\"<li \";\n if(isset($_GET['gestion']) && $_GET['gestion'] == \"motscles\") $navBar .= SetActivePage(\"administration\"); \n $navBar .= \">\";\n $navBar.=\"<a href=\\\"administration.php?gestion=motscles\\\">Gérer les mots-clés</a>\";\n $navBar.=\" </li>\";\n break;\n }\n \n $navBar .= \"</ul>\";\n $navBar.=\"<ul class=\\\"nav navbar-nav navbar-right\\\" data-in=\\\"fadeInDown\\\" data-out=\\\"fadeOutUp\\\">\"; \t\n $navBar.=\"<li><a href=\\\"logout.php\\\">Se déconnecter</a></li>\";\n }\n $navBar .= \"<li \".SetActivePage(\"faq\").\">\";\n $navBar .= \"<a href=\\\"faq.php\\\">Aide</a>\";\n $navBar.= \"</li>\";\n $navBar .= \"</ul>\";\n $navBar.=\"</div>\";\n $navBar.= \"</div>\" ;\n $navBar.=\"</nav>\";\n\n //Echo le contenu HTML de la barre de navigation\n echo $navBar;\n}" ]
[ "0.6735185", "0.6558581", "0.651973", "0.64074504", "0.6396304", "0.63604707", "0.6303973", "0.6283827", "0.6245404", "0.6238429", "0.62117344", "0.6193592", "0.6192793", "0.6189166", "0.6180046", "0.61707264", "0.6154797", "0.6142767", "0.6138082", "0.6128925", "0.6103196", "0.6071879", "0.60677904", "0.60623235", "0.6046602", "0.60343975", "0.6032996", "0.60256875", "0.5959651", "0.59546274" ]
0.661889
1
$sqlA[] = "UPDATE adiciondetalleingresotalla SET cantidad='0', WHERE iddetalleingreso='$iddetalleingreso' AND talla='$tallafinal1';";
function actualizarsoloparesnulossinmin($idkardex,$tallafinal,$tallafinal1,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){ $sqlA[] = "UPDATE adicionkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal';"; $sqlA[] = "UPDATE historialkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal' and idperiodo='3';"; //MostrarConsulta($sqlA); ejecutarConsultaSQLBeginCommit($sqlA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alteraTreinoAluno($conexao,$aluno,$academia,$idtreinoPadraoAluno){\n\n\t$sql = \"update treinoAluno set aluno = $aluno, academia=$academia where treinoPadraoAluno=$idtreinoPadraoAluno and idtreinoAluno <>0\";\n\n\n\t$altera= mysqli_query($conexao,$sql);\n\techo (\"<br>Linha alterada = \" . mysqli_affected_rows($conexao)).\"<br>sql: \". $sql.\"<br>\";\n}", "function actualizarsoloparesnulosin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}", "function borrarrepetidosvaloresin($idmodelodetalle,$iddetalleingreso,$cantidadm,$iddetalleingreso,$tallafin,$tallafinal1,$talla1,$return = false ){\n //$sql[] = \"UPDATE historialkardextienda SET precio2bs='$precionuevo' WHERE idcalzado = '$iddetalleingreso'; \";\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidadm',cantidad='$cantidadm',generado='0' ,fallado='1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND (talla='$tallafin' OR talla='$tallafinal1');\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}", "function Inhabilitarq_admin1(){\n\trequire '../../conexion.php'; \n \t$cate=date('Y-m-d');\n echo $consultar_nivel= \"UPDATE `administradores` SET `INHABILITADO` = '1',`decreto_traslado` = '\".$_POST['u'].\"',\t`fecha_traslado` = '\".$cate.\"' WHERE `administradores`.`ID_ADMIN` = \".$_POST['io'].\"\"; \t\n $consultar_nivel1=$conexion->prepare($consultar_nivel);\n\t$consultar_nivel1->execute(array()); \n}", "static Public function MdlActualizaAlmacen($tabla, $campo, $valor1, $valor2, $idUsuario){\n\n $stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET cant=cant+(:cant), ultusuario=:ultusuario WHERE id_producto = :id_producto\");\n $stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n $stmt->bindParam(\":cant\", $valor2, PDO::PARAM_INT);\n $stmt->bindParam(\":ultusuario\", $idUsuario, PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = null;\n\n}", "function actualizarEstadisticaV(){\n\t\t\t$sql=\"UPDATE estadistica SET votovalido = votovalido+1,\nvotototal = votototal+1 where idestaditica=(Select max(idestaditica) from estadistica);\";\n\t\t\treturn $sql;\n\t\t}", "public function desactivar($idtarifas){\n\n $sql=\" UPDATE tarifas SET estado='0' WHERE idtarifas='$idtarifas' \";\n return ejecutarConsulta($sql);\n\n\n }", "function oculta($id){\n\t$sql = 'UPDATE votos SET status = 0 WHERE cancion ='.$id;\n\tmysql_query($sql);\n}", "function actualizarsoloparesin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$precionuevo,$lineanuevo,$colornuevo,$materialnuevo,$return = false ){\n\n // $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n $sqlmarca = \" SELECT tabla,mesrango,idperiodo,fechainicio,fechafin FROM administrakardex WHERE idkardex = '$idkardex' \";\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"tabla\");\n $tabla = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"mesrango\");\n $mesrango = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"idperiodo\");\n $idperiodo = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechainicio\");\n $fechain = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechafin\");\n $fechafin = $opcionkardex['resultado'];\n if($fechafin==null ||$fechafin == \"\"){\n $fechaf = Date(\"Y-m-d\");}\n\n$select1 = \"SUM(i.cantidad) AS Pares\";\n $from1 = \"itemventa i,adicionkardextienda k, ventasdetalle vent\";\n $where1 = \"k.idcalzado = '$iddetalleingreso' AND i.idventa=vent.idventadetalle AND i.idkardextienda=k.idkardextienda AND\nk.talla='$talla' AND vent.fecha >= '$fechain'AND vent.fecha <= '$fechaf' and i.estado!='cambiado' \";\n $sql21 = \"SELECT \".$select1.\" FROM \".$from1. \" WHERE \".$where1;\n $almacenA1 = findBySqlReturnCampoUnique($sql21, true, true, 'Pares');\n $pares1 = $almacenA1['resultado'];\n if($pares1==NULL || $pares1 =='' || $pares1 == \"\"){ $pares1=\"0\"; }\n if($pares1=='0' ||$pares1==0){\n\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n\n } else{\n\n $cantidad1=$cantidad1-$pares1;\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n}\n//MostrarConsulta($sqlA);\nejecutarConsultaSQLBeginCommit($sqlA);\n\n}", "public function LimpiarFilas($fecha1,$fecha2,$tarea_id,$usuario){\n \n $query = $this->db->query(\" update tarea_detalle set hora = 0 \n where\n fecha between '\".$fecha1.\"' and '\".$fecha2.\"' and \n tarea_id = '\".$tarea_id.\"' and\n usuario_id = '\".$usuario.\"'\n\n \");\n\n\n }", "function tabelleFinitureCambiaMarchio($con) {\n $sql=\"UPDATE tabelle_finiture SET tab_mark = 'Modulo', tab_mark_id = 49 WHERE tab_line_id = 60 OR tab_line_id = 61 OR tab_line_id = 144 OR tab_line_id = 145\";\n mysqli_query($con,$sql);\n}", "function mysql24($tabla, $columna1, $valorNuevo1, $columna2, $valorNuevo2, $columnaBuscar, $queBuscar){\n\t$query01=\"UPDATE $tabla SET $columna1 = $valorNuevo1, $columna2 = $valorNuevo2 WHERE $columnaBuscar = $queBuscar\";\n $query02=mysql_query($query01);\n return $query02;\n}", "public function asistencia()\n{\nextract($_POST);\n $db=new clasedb();\n$conex=$db->conectar();\n\nif ($opcion==\"asiste\") {\n $sql=\"UPDATE asistencias SET status='A', justificacion='' WHERE id=\".$id_asistencia;\n} /*else {\n\n if ($justificacion!==\"\") {\n $sql=\"UPDATE asistencias SET status='NACJ', justificacion='\".$justificacion.\"' WHERE id=\".$id_asistencia;\n\n }*/ else {\n $sql=\"UPDATE asistencias SET status='NASJ' WHERE id=\".$id_asistencia;\n /*}*/\n \n}\n//echo $sql;\n $res=mysqli_query($conex,$sql);\n\n if ($res) {\n ?>\n <script type=\"text/javascript\">\n window.location=\"ControlA.php?operacion=index\";\n </script>\n <?php\n } else {\n ?>\n <script type=\"text/javascript\">\n alert(\"Fallido!\");\n window.location=\"ControlA.php?operacion=index\";\n </script>\n <?php\n }\n}", "function arreglasecu(){\n\t\t$mSQL='UPDATE sinv SET precio2=precio1, base2=base1, margen2=margen1 WHERE margen2>margen1';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t\t$mSQL='UPDATE sinv SET precio3=precio2, base3=base2, margen3=margen2 WHERE margen3>margen2';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t\t$mSQL='UPDATE sinv SET precio4=ROUND(ultimo*100/(100-(margen3-0.5))*(1+(iva/100)),2), base4=ROUND(ultimo*100/(100-(margen3-0.5)),2), margen4=margen3-.5 WHERE margen4>=margen3';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t}", "private function modificarCita(){\n $query = \"UPDATE \" . $this->table . \" SET PacienteId ='\" . $this->idpaciente . \"',Fecha = '\" . $this->fecha . \"', HoraInicio = '\" . $this->horarioIn . \"', HoraFin = '\" .\n $this->horarioFn . \"', Motivo = '\" . $this->motivo . \"' WHERE CitaId = '\" . $this->idcita . \"'\"; \n $resp = parent::nonQuery($query);\n if($resp >= 1){\n return $resp;\n }else{\n return 0;\n }\n }", "public function finalSanear($id_usuario){\r\n\t\t$sql = \"UPDATE tbl_usuarios SET valorPre='0' WHERE id_usuario='$id_usuario'\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "function aggiornaProdotto(){\nif(isset($_POST['aggiorna'])){\n\n $nomePdt = $_POST['nome_pdt'];\n $infoBreve = $_POST['desc_breve'];\n $prezzo = $_POST['prezzo'];\n $quantitaPdt = $_POST['quantita_pdt'];\n $immaginePdt = $_POST['immagine'];\n\n $update = query(\"UPDATE prodotti SET nome_prodotto = '{$nomePdt}' , descr_prodotto = '{$infoBreve}' , prezzo = '{$prezzo}' , quantita_pdt = '{$quantitaPdt}' , immagine = '{$immaginePdt}' WHERE id_prodotto = {$_GET['id']}\");\n\nconferma($update);\n\n\nheader('Location: visualizza-pdt.php');\n\n}\n}", "function updateMeGustaId($id, $id_usuario, $valor_megusta) {\n $c = new Conexion();\n $resultado = $c->query(\"UPDATE valoracion_mg val_mg, usuario usu SET val_mg.megusta = $valor_megusta where val_mg.id_usuario=usu.id && val_mg.id_contenido=$id && val_mg.id_usuario=$id_usuario\");\n}", "function prodottiCambiaMarchio($con) {\n $sql=\"UPDATE prodotti SET prd_mark = 'Modulo', prd_mark_id = 49 WHERE prd_line_id = 60 OR prd_line_id = 61 OR prd_line_id = 144 OR prd_line_id = 145\";\n mysqli_query($con,$sql);\n}", "public function updateCantidadPreDetalle(){\n $sql='UPDATE predetalle set cantidad = (predetalle.cantidad + ?) WHERE idPreDetalle = ?';\n $params=array($this->cantidad, $this->idPre);\n return Database::executeRow($sql, $params);\n }", "private function eliminarCita(){\n $query = \"UPDATE \" . $this->table . \" SET estado = 'Inactivo' WHERE CitaId = '\" . $this->idcita . \"'\";\n $resp = parent::nonQuery($query);\n if($resp >= 1 ){\n return $resp;\n }else{\n return 0;\n }\n }", "function reset_lampeggia_plus($par) {\r\n $pdo = connetti();\r\n $sqlu = \"UPDATE odl_riga SET \"; \r\n $col = \"tR\";\r\n $flag = \"PVIL\";\r\n if (rowcheck4value($par['idrigaodl'],\"rColore\")=='class2blink') { $sqlu .= \" rColore = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCpro\")=='class2blink') { $sqlu .= \" rCpro = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rClav\")=='class2blink') { $sqlu .= \" rClav = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCcol\")=='class2blink') { $sqlu .= \" rCcol = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCsti\")=='class2blink') { $sqlu .= \" rCsti = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCcom\")=='class2blink') { $sqlu .= \" rCcom = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCpez\")=='class2blink') { $sqlu .= \" rCpez = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCimb\")=='class2blink') { $sqlu .= \" rCimb = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCtpa\")=='class2blink') { $sqlu .= \" rCtpa = \\\"{$col}\\\", \"; }\r\n if (rowcheck4value($par['idrigaodl'],\"rCmis\")=='class2blink') { $sqlu .= \" rCmis = \\\"{$col}\\\", \"; }\r\n $sqlu .= \"controller = \\\"{$GLOBALS['utente']}:{$flag}\\\", \";\r\n $sqlu .= \"dataLastMod = \\\"{$GLOBALS['datatempo']}\\\" \";\r\n $sqlu .= \"WHERE idRigaOdL = \\\"{$par['idrigaodl']}\\\"\";\r\n if(BETA3) { echo \"<pre class=\\\"Beta3\\\">function reset_lampeggia_plus: \"; print_r($sqlu); echo \"</pre>\\n\"; }\r\n $queu = $pdo->prepare($sqlu);\r\n $queu->execute();\r\n}", "function ActualizacionCarrito($Inscription)\n{\n\tglobal $con;\n\t\t$updateSQL = sprintf(\"UPDATE cart SET transaction_made=%s WHERE id_student=%s AND transaction_made= 0\",\n\t\t\t$Inscription,\n\t\t\t$_SESSION[\"ydl_UserId\"]);\n \n $Result1 = mysqli_query($con, $updateSQL) or die(mysqli_error($con));\n}", "function ActualizacionCarrito2($Inscription2, $studentadmin)\n{\n\tglobal $con;\n\t\t$updateSQL = sprintf(\"UPDATE cart SET transaction_made=%s WHERE id_student=%s AND transaction_made= 0\",\n\t\t\t$Inscription2,\n\t\t\t$studentadmin);\n \n $Result1 = mysqli_query($con, $updateSQL) or die(mysqli_error($con));\n\t}", "function hapus_rekening($nomor_rekening) {\n global $conn; //manggil koneksi di global\n //melakukan update pada nomor rekening input dengan mengeset kolom aktif menjadi 0, sehingga tidak akan dibaca aktif lagi\n //tidak dihapus, karena akan berpengaruh pada data trasaksi yang sudah ada\n $q = $conn->prepare(\"UPDATE rekening SET aktif='0' WHERE nomor_rekening='{$_GET['account-number']}'\");\n $q->execute();\n}", "function finalizar(){\n if (isset($_GET['id'])) {\n \n $id = $_GET['id'];\n $sql_finalizar = \"UPDATE treinamentos SET concluido = 's' WHERE id = '$id'\";\n my_query($sql_finalizar); \n }\n}", "function actualizarDeuda($acceso,$id_contrato){\n\treturn;\n\t/*\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"select sum(cant_serv * costo_cobro) as deuda from contrato_servicio_deuda where id_contrato='$id_contrato' and status_con_ser='DEUDA'\");\n\t\t\t\t\tif($fila=row($acceso)){\n\t\t\t\t\t\t$deuda = trim($fila['deuda']);\n\t\t\t\t\t\t//echo \"<br>Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\";\n\t\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\");\n\t\t\t\t\t}\n\t\t\t\t\t*/\n}", "function mysql22($tabla, $columna1, $valorNuevo1, $columnaBuscar, $queBuscar){\n\t$query01=\"UPDATE $tabla SET $columna1 = $valorNuevo1 WHERE $columnaBuscar = '$queBuscar'\";\n $query02=mysql_query($query01);\n/*\nComo usar\n$tabla = '';\n$columna1 = '';\n$valorNuevo1 = '';\n$columnaBuscar = '';\n$queBuscar = '';\n$resultado = mysql22($tabla, $columna1, $valorNuevo1, $columnaBuscar, $queBuscar);\n*/\n}", "static public function mdlActualizarAdquisicion($tabla, $tabla2, $datos){\r\n\r\n\t\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla2 INNER JOIN $tabla ON $tabla2.folio = $tabla.idPedido and $tabla2.serie = $tabla.serie SET $tabla2.sinAdquisicion = $tabla.sinAdquisicion WHERE $tabla2.folio = :idPedido and $tabla2.serie = :serie\");\r\n\r\n\t\t\t$stmt -> bindParam(\":idPedido\", $datos[\"idPedido\"], PDO::PARAM_INT);\r\n\t\t\t$stmt -> bindParam(\":serie\", $datos[\"serie\"], PDO::PARAM_STR);\r\n\r\n\t\t\tif ($stmt -> execute()) {\r\n\r\n\t\t\t\treturn \"ok\";\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\treturn \"error\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$stmt -> close();\r\n\r\n\t\t\t$stmt = null;\r\n\r\n\t}", "function Alterar() {\n $SQL = \"UPDATE dd_dados_domicilio SET \n IDTIPOLOGRADOURO ='\" . $this->IDTIPOLOGRADOURO . \"',\n NOMELOGRADOURO ='\" . $this->NOMELOGRADOURO . \"',\n NUMDOMICILIO ='\" . $this->NUMDOMICILIO . \"',\n COMPLEMENTO ='\" . $this->COMPLEMENTO . \"',\n BAIRRO ='\" . $this->BAIRRO . \"',\n CEP ='\" . $this->CEP . \"',\n IDESTADO ='\" . $this->IDESTADO . \"',\n IDMUNICIPIO ='\" . $this->IDMUNICIPIO . \"',\n REFERENCIA ='\" . $this->REFERENCIA . \"',\n IDCONSTRUCAO ='\" . $this->IDCONSTRUCAO . \"',\n IDESTCONSERVACAO ='\" . $this->IDESTCONSERVACAO . \"',\n IDUTILIZACAO ='\" . $this->IDUTILIZACAO . \"',\n IDTIPOUSO ='\" . $this->IDTIPOUSO . \"',\n IDESPECIEDOMICILIO ='\" . $this->IDESPECIEDOMICILIO . \"',\n DATAINICIOMORARMUNICIP ='\" . $this->DATAINICIOMORARMUNICIP . \"',\n DATAINICIOMORARDOMICILIO ='\" . $this->DATAINICIOMORARDOMICILIO . \"',\n QUANTCOMODOS ='\" . $this->QUANTCOMODOS . \"',\n QUANTDORMIT ='\" . $this->QUANTDORMIT . \"',\n IDTIPOMATERIALPISOINT ='\" . $this->IDTIPOMATERIALPISOINT . \"',\n IDTIPOMATERIALPAREDEEXT ='\" . $this->IDTIPOMATERIALPAREDEEXT . \"',\n QTAGUACANALIZADA ='\" . $this->QTAGUACANALIZADA . \"',\n IDFORMAABASTECIMENTO ='\" . $this->IDFORMAABASTECIMENTO . \"',\n IDFORMAESCOASANITARIO ='\" . $this->IDFORMAESCOASANITARIO . \"',\n IDDESTINOLIXO ='\" . $this->IDDESTINOLIXO . \"',\n IDILUMINACAOCASA ='\" . $this->IDILUMINACAOCASA . \"',\n VALAGUAESGOTO ='\" . $this->VALAGUAESGOTO . \"',\n VALENERGIA ='\" . $this->VALENERGIA . \"',\n VALALUGUEL ='\" . $this->VALALUGUEL . \"',\n NUMFAMILIAS ='\" . $this->NUMFAMILIAS . \"',\n IDDADOSOLICITANTE ='\" . $this->IDDADOSOLICITANTE . \"'\n WHERE IDDADODOMICILIO='\" . $this->codigo . \"'\";\n\n //die($SQL);\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $con->gtiExecutaSQL($SQL);\n $con->gtiDesconecta();\n }" ]
[ "0.71112686", "0.70778257", "0.69791406", "0.6623139", "0.6599758", "0.6566934", "0.6518915", "0.6486147", "0.6454191", "0.6434565", "0.6428749", "0.6411174", "0.6332832", "0.6324948", "0.631287", "0.63090336", "0.62995434", "0.6288741", "0.62842005", "0.6274706", "0.6255504", "0.62283754", "0.6221398", "0.62016785", "0.6191835", "0.6176876", "0.61756915", "0.6166561", "0.6154844", "0.6153595" ]
0.74017036
0
$sqlA[] = "UPDATE adiciondetalleingresotalla SET cantidad='$cantidad1' WHERE iddetalleingreso='$iddetalleingreso' AND talla='$talla';";
function actualizarsoloparesnulosin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){ $sqlA[] = "UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';"; $sqlA[] = "UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';"; //MostrarConsulta($sqlA); ejecutarConsultaSQLBeginCommit($sqlA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actualizarsoloparesnulossinmin($idkardex,$tallafinal,$tallafinal1,$cantidad1,$iddetalleingreso,$idmodelodetalle,$return = false ){\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='0',cantidad='0',generado='0' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$tallafinal' and idperiodo='3';\";\n\n//MostrarConsulta($sqlA);\nejecutarConsultaSQLBeginCommit($sqlA);\n}", "function alteraTreinoAluno($conexao,$aluno,$academia,$idtreinoPadraoAluno){\n\n\t$sql = \"update treinoAluno set aluno = $aluno, academia=$academia where treinoPadraoAluno=$idtreinoPadraoAluno and idtreinoAluno <>0\";\n\n\n\t$altera= mysqli_query($conexao,$sql);\n\techo (\"<br>Linha alterada = \" . mysqli_affected_rows($conexao)).\"<br>sql: \". $sql.\"<br>\";\n}", "function mysql24($tabla, $columna1, $valorNuevo1, $columna2, $valorNuevo2, $columnaBuscar, $queBuscar){\n\t$query01=\"UPDATE $tabla SET $columna1 = $valorNuevo1, $columna2 = $valorNuevo2 WHERE $columnaBuscar = $queBuscar\";\n $query02=mysql_query($query01);\n return $query02;\n}", "function Inhabilitarq_admin1(){\n\trequire '../../conexion.php'; \n \t$cate=date('Y-m-d');\n echo $consultar_nivel= \"UPDATE `administradores` SET `INHABILITADO` = '1',`decreto_traslado` = '\".$_POST['u'].\"',\t`fecha_traslado` = '\".$cate.\"' WHERE `administradores`.`ID_ADMIN` = \".$_POST['io'].\"\"; \t\n $consultar_nivel1=$conexion->prepare($consultar_nivel);\n\t$consultar_nivel1->execute(array()); \n}", "function updateMeGustaId($id, $id_usuario, $valor_megusta) {\n $c = new Conexion();\n $resultado = $c->query(\"UPDATE valoracion_mg val_mg, usuario usu SET val_mg.megusta = $valor_megusta where val_mg.id_usuario=usu.id && val_mg.id_contenido=$id && val_mg.id_usuario=$id_usuario\");\n}", "function aggiornaProdotto(){\nif(isset($_POST['aggiorna'])){\n\n $nomePdt = $_POST['nome_pdt'];\n $infoBreve = $_POST['desc_breve'];\n $prezzo = $_POST['prezzo'];\n $quantitaPdt = $_POST['quantita_pdt'];\n $immaginePdt = $_POST['immagine'];\n\n $update = query(\"UPDATE prodotti SET nome_prodotto = '{$nomePdt}' , descr_prodotto = '{$infoBreve}' , prezzo = '{$prezzo}' , quantita_pdt = '{$quantitaPdt}' , immagine = '{$immaginePdt}' WHERE id_prodotto = {$_GET['id']}\");\n\nconferma($update);\n\n\nheader('Location: visualizza-pdt.php');\n\n}\n}", "static Public function MdlActualizaAlmacen($tabla, $campo, $valor1, $valor2, $idUsuario){\n\n $stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET cant=cant+(:cant), ultusuario=:ultusuario WHERE id_producto = :id_producto\");\n $stmt->bindParam(\":id_producto\", $valor1, PDO::PARAM_INT);\n $stmt->bindParam(\":cant\", $valor2, PDO::PARAM_INT);\n $stmt->bindParam(\":ultusuario\", $idUsuario, PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = null;\n\n}", "function borrarrepetidosvaloresin($idmodelodetalle,$iddetalleingreso,$cantidadm,$iddetalleingreso,$tallafin,$tallafinal1,$talla1,$return = false ){\n //$sql[] = \"UPDATE historialkardextienda SET precio2bs='$precionuevo' WHERE idcalzado = '$iddetalleingreso'; \";\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidadm',cantidad='$cantidadm',generado='0' ,fallado='1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND (talla='$tallafin' OR talla='$tallafinal1');\";\n\n//MostrarConsulta($sqlA);\n ejecutarConsultaSQLBeginCommit($sqlA);\n}", "function updateDoctor($nr, $vardas, $pavarde){\n// sprintf - % vietoj kiekvieno %s isves kintamuosius is eiles\n// %s -s - string, f- (float) skaicius su kableliu;\n $manoSQL = sprintf(\"UPDATE doctors SET\n name='%s',\n lname='%s'\n WHERE id=%s\n LIMIT 1;\",\n htmlspecialchars($vardas, ENT_QUOTES, UTF-8),// uzkoduoja html kabutes, $pavarde, $nr);\n htmlspecialchars($pavarde, ENT_QUOTES, UTF-8),// uzkoduoja html kabutes\n $nr);\n\n $x = mysqli_query(getPrisijungimas(), $manoSQL);\n\n if ($x) {\n echo \"Gydytojas nr $nr updeitintas!<br>\";\n }\n}", "function tabelleFinitureCambiaMarchio($con) {\n $sql=\"UPDATE tabelle_finiture SET tab_mark = 'Modulo', tab_mark_id = 49 WHERE tab_line_id = 60 OR tab_line_id = 61 OR tab_line_id = 144 OR tab_line_id = 145\";\n mysqli_query($con,$sql);\n}", "function prodottiCambiaMarchio($con) {\n $sql=\"UPDATE prodotti SET prd_mark = 'Modulo', prd_mark_id = 49 WHERE prd_line_id = 60 OR prd_line_id = 61 OR prd_line_id = 144 OR prd_line_id = 145\";\n mysqli_query($con,$sql);\n}", "function mysql22($tabla, $columna1, $valorNuevo1, $columnaBuscar, $queBuscar){\n\t$query01=\"UPDATE $tabla SET $columna1 = $valorNuevo1 WHERE $columnaBuscar = '$queBuscar'\";\n $query02=mysql_query($query01);\n/*\nComo usar\n$tabla = '';\n$columna1 = '';\n$valorNuevo1 = '';\n$columnaBuscar = '';\n$queBuscar = '';\n$resultado = mysql22($tabla, $columna1, $valorNuevo1, $columnaBuscar, $queBuscar);\n*/\n}", "public function asistencia()\n{\nextract($_POST);\n $db=new clasedb();\n$conex=$db->conectar();\n\nif ($opcion==\"asiste\") {\n $sql=\"UPDATE asistencias SET status='A', justificacion='' WHERE id=\".$id_asistencia;\n} /*else {\n\n if ($justificacion!==\"\") {\n $sql=\"UPDATE asistencias SET status='NACJ', justificacion='\".$justificacion.\"' WHERE id=\".$id_asistencia;\n\n }*/ else {\n $sql=\"UPDATE asistencias SET status='NASJ' WHERE id=\".$id_asistencia;\n /*}*/\n \n}\n//echo $sql;\n $res=mysqli_query($conex,$sql);\n\n if ($res) {\n ?>\n <script type=\"text/javascript\">\n window.location=\"ControlA.php?operacion=index\";\n </script>\n <?php\n } else {\n ?>\n <script type=\"text/javascript\">\n alert(\"Fallido!\");\n window.location=\"ControlA.php?operacion=index\";\n </script>\n <?php\n }\n}", "function modifier2($connexion,$nomTable,$nomClePrimaire1,$valeurClePrimaire1,$nomClePrimaire2,$valeurClePrimaire2,$nomChampAModifier,$ValeurChampAModifier) { \n $req =$connexion -> query(\"UPDATE $nomTable SET $nomChampAModifier = '$ValeurChampAModifier' WHERE $nomClePrimaire1 = '$valeurClePrimaire1' and $nomClePrimaire2 = '$valeurClePrimaire2' \");\n }", "public function actualizar_alumno1($columnas,$datos){\n\t\t$sql = \"UPDATE INTO alumno (\";\n\t\tforeach ($columnas as $columna) {\n\t\t\t$sql += $columna.',';\n\t\t}\n\t\ttrim($sql,',');\n\t\t$sql += ') VALUES (';\n\t\tforeach ($datos as $dato) {\n\t\t\t$sql += $dato.',';\n\t\t}\n\t\ttrim($sql,',');\n\t\t$sql += ')';\n\t\treturn $this->db->query($sql);\n\t}", "function abbinamentiCambiaMarchio($con) {\n $sql=\"UPDATE abbinamenti SET abb_mark = 'Modulo', abb_mark_id = 49 WHERE abb_line_id = 60\";\n mysqli_query($con,$sql);\n}", "function actualizarsoloparesin($idkardex,$talla,$cantidad1,$iddetalleingreso,$idmodelodetalle,$precionuevo,$lineanuevo,$colornuevo,$materialnuevo,$return = false ){\n\n // $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n $sqlA[] = \"UPDATE historialkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla' and idperiodo='3';\";\n $sqlmarca = \" SELECT tabla,mesrango,idperiodo,fechainicio,fechafin FROM administrakardex WHERE idkardex = '$idkardex' \";\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"tabla\");\n $tabla = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"mesrango\");\n $mesrango = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"idperiodo\");\n $idperiodo = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechainicio\");\n $fechain = $opcionkardex['resultado'];\n $opcionkardex = findBySqlReturnCampoUnique($sqlmarca, true, true, \"fechafin\");\n $fechafin = $opcionkardex['resultado'];\n if($fechafin==null ||$fechafin == \"\"){\n $fechaf = Date(\"Y-m-d\");}\n\n$select1 = \"SUM(i.cantidad) AS Pares\";\n $from1 = \"itemventa i,adicionkardextienda k, ventasdetalle vent\";\n $where1 = \"k.idcalzado = '$iddetalleingreso' AND i.idventa=vent.idventadetalle AND i.idkardextienda=k.idkardextienda AND\nk.talla='$talla' AND vent.fecha >= '$fechain'AND vent.fecha <= '$fechaf' and i.estado!='cambiado' \";\n $sql21 = \"SELECT \".$select1.\" FROM \".$from1. \" WHERE \".$where1;\n $almacenA1 = findBySqlReturnCampoUnique($sql21, true, true, 'Pares');\n $pares1 = $almacenA1['resultado'];\n if($pares1==NULL || $pares1 =='' || $pares1 == \"\"){ $pares1=\"0\"; }\n if($pares1=='0' ||$pares1==0){\n\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n\n } else{\n\n $cantidad1=$cantidad1-$pares1;\n $sqlA[] = \"UPDATE adicionkardextienda SET saldocantidad='$cantidad1',cantidad='$cantidad1' WHERE idmodelodetalle='$idmodelodetalle' AND idcalzado='$iddetalleingreso' AND talla='$talla';\";\n}\n//MostrarConsulta($sqlA);\nejecutarConsultaSQLBeginCommit($sqlA);\n\n}", "function newskomentar_updatedata($tbl_newskomentar, $id){\n\t$sql = mysql_query(\"UPDATE $tbl_newskomentar SET\n\t \niddownloadarea = '$iddownloadarea',\nidclient = '$idclient',\nidadmin = '$idadmin',\njudul = '$judul',\npesan = '$pesan',\ntanggalpost = '$tanggalpost',\njampost = '$jampost',\ntgltampil = '$tgltampil',\njamtampil = '$jamtampil',\nstatustampil = '$statustampil',\nipaddress = '$ipaddress'\n\n\t\tWHERE id='$id'\n\t\");\n\treturn $sql;\n}", "function arreglasecu(){\n\t\t$mSQL='UPDATE sinv SET precio2=precio1, base2=base1, margen2=margen1 WHERE margen2>margen1';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t\t$mSQL='UPDATE sinv SET precio3=precio2, base3=base2, margen3=margen2 WHERE margen3>margen2';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t\t$mSQL='UPDATE sinv SET precio4=ROUND(ultimo*100/(100-(margen3-0.5))*(1+(iva/100)),2), base4=ROUND(ultimo*100/(100-(margen3-0.5)),2), margen4=margen3-.5 WHERE margen4>=margen3';\n\t\tvar_dump($this->db->simple_query($mSQL));\n\t}", "function composizioniProdottiCambiaMarchio($con) {\n $sql=\"UPDATE composizioni_prodotti SET cmpr_mark = 'Modulo', cmpr_mark_id = 49, cmpr_mark_cmp = 'Modulo', cmpr_mark_cmp_id = 49 WHERE cmpr_line_id = 60 OR cmpr_line_id = 61 OR cmpr_line_id = 144 OR cmpr_line_id = 145\";\n mysqli_query($con,$sql);\n}", "function composizioniCambiaMarchio($con) {\n $sql=\"UPDATE composizioni SET cmp_mark = 'Modulo', cmp_mark_id = 49 WHERE cmp_line_id = 60 OR cmp_line_id = 61 OR cmp_line_id = 144 OR cmp_line_id = 145\";\n mysqli_query($con,$sql);\n}", "function aceptar($idimagen, $catgaleria)\r\n{\r\n\tglobal $db;\r\n\t$query = \"UPDATE \"._TBLCATEGORIA.\" SET idpadre = $catgaleria WHERE IDCATEGORIA = $idimagen\";\r\n\t$db->Execute($query) or errorQuery(__LINE__, __FILE__);\r\n\treturn true;\r\n\t\r\n}", "public function editarpersonal($datos){\n $c= new conectar();\n $conexion=$c->conexion();\n\n $sql=\"UPDATE personal set nombres='$datos[0]',ape_pat='$datos[1]',ape_mat='$datos[2]',dni='$datos[3]',celular='$datos[4]',correo='$datos[5]'\n where id_personal=$datos[6]\";\n return $result=mysqli_query($conexion,$sql);\n\n }", "function lineeWarChange($con) {\n $sql=\"UPDATE linee SET line_war = 5 WHERE line_war = '5 anni'\";\n mysqli_query($con,$sql);\n}", "function updateEquipo($id, $nombre, $anio) {\n $nombre = filter_var($nombre, FILTER_SANITIZE_MAGIC_QUOTES);\n $anio = filter_var($anio, FILTER_SANITIZE_MAGIC_QUOTES);\n $foto = filter_var($foto, FILTER_SANITIZE_MAGIC_QUOTES);\n\n $con = conectaBD();\n\n mysqli_query($con, 'UPDATE equipo SET nombre_equipo = \"' . $nombre . '\", anio_fundacion = \"' . $anio . '\" WHERE id_equipo = ' . $id);\n\n mysqli_close($con);\n}", "function editar_anuncio(Anuncio $anuncioEdita){\n global $mybd;\n\t\t$STH = $mybd->DBH->prepare(\"Update anuncio Set anu_titulo=:ti,anu_descricao=:de,anu_morada=:mo,anu_email=:em,anu_estado=:es,anu_telefone=:te,anu_codigopostal=:co,anu_wcprivativo=:wc,anu_mobilada=:mob,anu_utensilios=:ut,anu_despesas=:des,anu_animais=:ani,anu_latitude=:la,anu_longitude=:lo,anu_preco=:pre,anu_internet=:inte,anu_rapazes=:rap,anu_raparigas=:ra,anu_disponibilidade=:di Where anu_id=:an;\");\n if(!$STH->execute($anuncioEdita->to_array_com_id()))return false;\n return true;//\n }", "public function updateunit_progres($id_aksi, $data_progres) {\n\t\t$nilai=$data_progres['progres'];\n\t\t$ket=$data_progres['keterangan'];\n\t\t$status_progres=$data_progres['status_progres'];\n\t\t$this->db->query(\"update tb_aksiunit set progres=$nilai, keterangan='$ket', status_progres='$status_progres' where id_aksi=$id_aksi\");\n\t}", "function alterarPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"UPDATE pessoa SET\"\r\n .\" nome='{$_POST[\"nome\"]}', \"\r\n .\" nascimento='{$_POST[\"nascimento\"]}', \"\r\n .\" endereco='{$_POST[\"endereco\"]}', \"\r\n .\" telefone='{$_POST[\"telefone\"]}'\"\r\n .\" WHERE id='{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}", "function Set_Partido($partido,$fecha,$hora,$lugar,$estado,$ronda)\n{\n $valor = insertar(sprintf(\"UPDATE tb_partidos \n SET fecha='%s', hora='%s', Estado='%d',Lugar='%d',numero_fecha='%d'\n WHERE id_partido='%d' \",escape($fecha),escape($hora),escape($estado),escape($lugar),escape($ronda),escape($partido)));\n return $valor;\n}", "function updateDoctor($nr, $vardas, $pavarde){\n\n $vardas = htmlspecialchars($vardas, ENT_QUOTES); // apsauga nuo hackinimo uzkoduoja : ' \" < zenklus. NEPAMIRST NAUDOTI!!\n $pavarde = htmlspecialchars($pavarde, ENT_QUOTES);\n $nr = htmlspecialchars($nr, ENT_QUOTES);\n\n $manoSQL = \" UPDATE doctors\n SET name ='$vardas',\n lname = '$pavarde'\n WHERE id = '$nr'\n LIMIT 1\n\n \";\n $arPavyko= mysqli_query(getConnection(), $manoSQL);\n\n if ($arPavyko == false && DEBUG_MODE > 0){\n echo \"ERROR : nepavyko atnaujinti gydytojo duomenu <br />\";\n\n }\n}" ]
[ "0.7258362", "0.7095367", "0.6984995", "0.69590396", "0.6917446", "0.68281543", "0.6815225", "0.68030214", "0.6675013", "0.662284", "0.6620051", "0.65986735", "0.659735", "0.65568113", "0.65140784", "0.6506686", "0.64998215", "0.6495025", "0.64855886", "0.6483198", "0.6448969", "0.6416981", "0.6416361", "0.6411605", "0.63910544", "0.63842005", "0.6369547", "0.6366824", "0.6365133", "0.634877" ]
0.7290716
0
Test that the author page is not accessible since not authorized.
public function testAuthorPageTest() { $response = $this->get('/authors'); $response->assertStatus(302); //expect 302 since not logged in }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNonAdminUserCannotViewThePageIndex()\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/admin/blog/pages');\n\n $response->assertStatus(403);\n }", "function disable_author_page() {\n\tglobal $wp_query;\n\n\tif ( is_author() ) {\n\t\t$wp_query->set_404();\n\t\tstatus_header(404);\n\t\t// Redirect to homepage\n\t\t// wp_redirect(get_option('home'));\n\t}\n}", "public function test_show_user_as_unauthorized_user()\n {\n $user = User::factory()->create();\n $user2 = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user2->id]));\n\n $response->assertStatus(403);\n }", "public function testShowUnauthicatedAccess(): void { }", "public function testUnauthorizedAccess()\n {\n $this->get('/properties/1');\n\n $this->assertGuest();\n }", "public function test_that_unauthroized_user_cannot_view_courses()\n {\n\n }", "public function testDontIndexNewPrivatePage()\n {\n\n // Add a private page.\n $page = $this->_simplePage(false);\n\n // Should not add a Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function testRestrictPage()\n {\n $this->assertTrue(true);\n }", "public function testGuestNotAccessUsersPage()\n\t{\n\t\t$this->open('user');\n\t\t$this->assertTextNotPresent('Users');\n\t}", "function unauthorizedUsersOnly(){\n global $authenticatedUser;\n if(!empty($authenticatedUser)){\n header(\"HTTP/1.1 403 Forbidden\");\n header('Location: https://eso.vse.cz/~frim00/marvelous-movies/');\n exit();\n }\n }", "public function disable_author_page()\n {\n if (is_author()) {\n wp_redirect(home_url('/'), 301);\n exit;\n }\n }", "public function testNonPublicPages()\n {\n $this->get('/home')->assertStatus(302);\n $this->get('/routes')->assertStatus(302);\n $this->get('/themes')->assertStatus(302);\n $this->get('/users')->assertStatus(302);\n $this->get('/users/create')->assertStatus(302);\n $this->get('/phpinfo')->assertStatus(302);\n $this->get('/profile/create')->assertStatus(302);\n }", "public function testGuestNotAccessProfilePage()\n\t{\n\t\t$this->open('/user/edit/' . $this->users['sample1']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\n\t\t$this->open('/user/edit/' . $this->users['sample2']['intUserID']);\n\t\t$this->assertTextNotPresent('Edit');\n\t}", "public function testItCanNotAccessPagesPendingCurationPage()\n {\n $this->logInAsUser(['curator' => 0]);\n\n $this->get('/curation/new')->assertResponseStatus(401);\n }", "public function testIndexForGuest(): void\n {\n // Request\n $response = $this->get('api/cms/v1/widget-article');\n\n // Check response status\n $response->assertStatus(401);\n }", "public function unauthorized() {\n $page = 'unauthorized';\n require('./View/default.php');\n }", "public function testItCanNotAccessSuggestedEditsPendingCurationPage()\n {\n $this->logInAsUser(['curator' => 0]);\n\n $this->get('/curation/edits')->assertResponseStatus(401);\n }", "public function testAccessDeniedUserNotAuthorized()\n {\n $this->assertVoter(VoterInterface::ACCESS_DENIED, 'user1', 'user2');\n }", "function test_treatments_unauthorized_true()\n {\n $this->seed();\n\n $response = $this->json('GET', '/api/treatments/1');\n $response->assertUnauthorized();\n }", "public function testNotAuthenticated()\n {\n $response = $this->get('/api/auth/me');\n $response->assertStatus(302);\n\n $response = $this->followingRedirects()->get('/api/auth/me');\n $response->assertStatus(401);\n }", "public function test_show_homepage_referers_widget_disabled()\n {\n setting()->set('disable_referers', 1);\n\n $admin = User::find(1);\n $this->actingAs($admin)\n ->get('/')\n ->assertDontSee('Best referers');\n }", "public function testUserNonAdministratorCannotVisitPages(string $page)\n {\n // Prepare\n /** @var User $user */\n $user = factory(User::class)->create(['is_admin' => false,]);\n $article = factory(Post::class)->create([\n 'status' => 'draft',\n ]);\n\n $page = TestUtils::createEndpoint($page, ['id' => $article->id, 'slug' => $article->slug,]);\n\n // Request\n $response = $this->actingAs($user)->call('GET', $page);\n\n // Asserts\n $response->assertStatus(404);\n }", "public function test_unauthorized_fetch()\n {\n $headers = [\n 'Authorization' => \"Bearer None\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function testAnonymousCannotViewUnpublishedNodesWithoutTermPermissions(): void {\n $this->assertFalse($this->nodes['node_unpublished']->isPublished());\n $this->assertEquals(AccessResult::neutral(), permissions_by_entity_entity_access($this->nodes['node_unpublished'], 'view', $this->anonymousUser));\n $this->assertFalse($this->nodes['node_unpublished']->access('view', $this->anonymousUser));\n }", "public function testNoAuth() : void\n {\n $response = $this->get(action('HomeController@index'));\n\n $response->assertStatus(200);\n }", "public function testIndexFailNotAdmin()\n {\n $this->setUserSession();\n $this->get($this->indexUrl);\n $this->assertRedirect('/');\n }", "public function actionIsNotAllowed()\n {\n throw new NotFoundException(__('Page not found.'));\n }", "public function testUnauthorized()\n {\n factory(User::class)->create(); \n $response = $this->json('GET', '/api/users/posts');\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function test404PagesLoggedIn()\n {\n $this->loginAsSuperadmin();\n $testUrls = [\n $this->Slug->getProductDetail(4234, 'not valid product name'),\n $this->Slug->getCategoryDetail(4234, 'not valid category name')\n ];\n $this->assertPagesFor404($testUrls);\n $this->logout();\n }", "public function testGetUnauthorized()\n {\n $response = $this->call('GET', '/graphql', [\n 'query' => $this->queries['examplesWithAuthorize']\n ]);\n\n $this->assertEquals($response->getStatusCode(), 403);\n\n $content = $response->getData(true);\n $this->assertArrayHasKey('data', $content);\n $this->assertArrayHasKey('errors', $content);\n $this->assertNull($content['data']['examplesAuthorize']);\n }" ]
[ "0.74397033", "0.71675205", "0.7091112", "0.7034383", "0.697517", "0.6921509", "0.68423295", "0.6814638", "0.6761533", "0.6747833", "0.6720907", "0.66947794", "0.66917264", "0.666251", "0.6659985", "0.6653762", "0.6626726", "0.6618566", "0.6594027", "0.6581228", "0.6580142", "0.65751797", "0.65516615", "0.65484047", "0.65434086", "0.6531163", "0.65301424", "0.64751947", "0.6470659", "0.6468114" ]
0.7359431
1
$WORD IS WORD TO PERFORM WORK ON $START IS IS STARTING INDEX $END IS ENDING INDEX $END MUST BE > $START
function substring($word, $start, $end) { $output = ""; for($i = 0; $i < $end-$start; $i++) { $output = $output . substr($word, $start + $i, 1); } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setIndexStartEnd($start,$end = null);", "public function getIndexStart();", "public function search(string $what, int $start = 1, int $end = 1): int|false {}", "public function getIndexEnd();", "function magicIndex($A, $start, $end){\n\n if($start > $end) return;\n\n if($start <= $end){\n $m = floor(($start+$end)/2);\n\n if($A[$m] == $m){\n return $m;\n } else{\n // search left\n $left = magicIndex($A, $start, min($A[$m], $m-1));\n if(isset($left)) return $left;\n\n // search right\n $right = magicIndex($A, max($A[$m], $m+1), $end);\n if(isset($right)) return $right;\n }\n }\n}", "public function getStartIndex();", "function find_between($string, $start, $stop, $incorexc) {\r\n $temp = split_string($string, $start, AFTER, $incorexc);\r\n return split_string($temp, $stop, BEFORE, $incorexc);\r\n}", "function insides($start, $end, $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n if (is_array($content)) $content = implode('#$%',$content);\r\n $r = array(); $s=0;\r\n while ( ($s = strpos($content, $start,$s) ) !== false ) {\r\n $s += strlen($start);\r\n $e = strpos($content, $end, $s);\r\n if ($e !== false) {\r\n $r[] = trim(substr($content, $s, $e - $s));\r\n $s = $e + strlen($end);\r\n }\r\n }\r\n\r\n if (DEV)\r\n xlogc('insides', $r, $start, $end, $org_content);\r\n return $r;\r\n}", "function insidex($start, $end=\"\", $content = false) {\r\n $r = inside($start, $end, $content);\r\n if ($r) $r = $start . $r . $end;\r\n\r\n if (DEV)\r\n xlogc('insidex', $r, $start, $end, $content);\r\n\r\n return $r;\r\n}", "function StartEnd($v)\n{\n\treturn (preg_match(\"/^\\*\\*\\* (?:START|END)/m\",$v));\n}", "function idx_getPageWords($page){\n global $conf;\n $word_idx = file($conf['cachedir'].'/word.idx');\n $swfile = DOKU_INC.'inc/lang/'.$conf['lang'].'/stopwords.txt';\n if(@file_exists($swfile)){\n $stopwords = file($swfile);\n }else{\n $stopwords = array();\n }\n\n $body = rawWiki($page);\n $body = strtr($body, \"\\r\\n\\t\", ' ');\n $tokens = explode(' ', $body);\n $tokens = array_count_values($tokens); // count the frequency of each token\n\n $words = array();\n foreach ($tokens as $word => $count) {\n $word = utf8_strtolower($word);\n\n // simple filter to restrict use of utf8_stripspecials\n if (preg_match('/\\W/', $word)) {\n $arr = explode(' ', utf8_stripspecials($word,' ','._\\-:'));\n $arr = array_count_values($arr);\n\n foreach ($arr as $w => $c) {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$w] = $c + (isset($words[$w]) ? $words[$w] : 0);\n }\n } else {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0);\n }\n }\n\n // arrive here with $words = array(word => frequency)\n\n $index = array(); //resulting index\n foreach ($words as $word => $freq) {\n\tif (is_int(array_search(\"$word\\n\",$stopwords))) continue;\n $wid = array_search(\"$word\\n\",$word_idx);\n if(!is_int($wid)){\n $word_idx[] = \"$word\\n\";\n $wid = count($word_idx)-1;\n }\n $index[$wid] = $freq;\n }\n\n // save back word index\n $fh = fopen($conf['cachedir'].'/word.idx','w');\n if(!$fh){\n trigger_error(\"Failed to write word.idx\", E_USER_ERROR);\n return false;\n }\n fwrite($fh,join('',$word_idx));\n fclose($fh);\n\n return $index;\n}", "function GetBetween2($content, $start, $end) {\r\n\t$r = explode($start, $content);\r\n\tif (isset($r[1])) {\r\n\t\t$rcount = count($r);\r\n\t\t// changed from -2 to -1\r\n\t\t$r = explode($end, $r[$rcount-1]);\r\n\t\treturn $r[0];\r\n\t}\r\n\treturn '';\r\n}", "function _kala_migrate_get_between($content, $start, $end) {\n // Explode this and let's find our stuff.\n $r = explode($start, $content);\n if (isset($r[1])){\n $r = explode($end, $r[1]);\n return $r[0];\n }\n // Return empty of nothing can be found.\n return '';\n}", "public static function findEndWord($content,$offset,$charsBreak = null)\r\n\t{\r\n\t\tif($charsBreak === null)\r\n\t\t{ //Accelearte query\r\n\t\t\t//while($content[$offset] !== ' ' && $content[$offset] !== \"\\t\" && $content[$offset] !== \"\\n\"){$offset++;}\r\n\t\t\twhile(stripos('abcdefghijklmnopqrstuvwxyz0123456789_',$content[$offset]) !== false){$offset++;}\r\n\t\t\treturn $offset;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile(strpos($charsBreak,$content[$offset]) === false){$offset++;}\r\n\t\t\treturn $offset;\r\n\t\t}\r\n\t\t\r\n\t}", "function stringExtractor($string,$start,$end) {\n\t\n\t# Setup\n\tglobal $cursor; global $stringExtractor_results; $foundString = -1; $string = \" \".$string;\n\tif(!isset($stringExtractor_results)) $stringExtractor_results = Array();\n\t \t\t\n\t# Extract \t\t\n\twhile($foundString != 0) {\n\t\t$ini = strpos($string,$start,$cursor);\t\n\t\t$ini += strlen($start);\n\t\t$len = strpos($string,$end,$ini) - $ini;\n\t\t$cursor = $ini;\n\t\t$result = substr($string,$ini,$len);\n\t\tarray_push($stringExtractor_results,$result);\n\t\t$foundString = strpos($string,$start,$cursor);\t\n\t}\n\t\n\treturn $stringExtractor_results;\n\t\n}", "function buzzwords($start, $end)\n {\n //set current to the start number\n $current = $start;\n\n while($current <= $end)\n {\n if($current%2==0)\n {\n yield 'Merry Christmas!';\n }\n elseif($current%3==0)\n {\n yield 'Happy Thanksgiving!';\n }\n elseif($current%2==0 && $current%3==0)\n {\n yield 'Happy New Year 2017!';\n }\n else\n {\n yield $current;\n }\n\n //increment index \n $current++;\n }\n \n }", "function inside($start, $end=\"\", $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n $r = '';\r\n if ($start) $s = strpos($content, $start);\r\n else $s=0;\r\n if ($s !== false) {\r\n $s += strlen($start);\r\n if ($end) $e = strpos($content, $end, $s);\r\n else $e = strlen($content);\r\n if ($e !== false)\r\n $r = trim(substr($content, $s, $e - $s));\r\n }\r\n\r\n if (DEV)\r\n xlogc('inside', $r, $start, $end, $org_content);\r\n\r\n return $r;\r\n}", "function find_string($string, $start,$end) {\n //print \"start: $start, end: $end\\n\";\n // Simple hashing to improve speed\n if (isset($this->_HASHED[$string])) return $this->_HASHED[$string];\n\n if (abs($start-$end)<=1) {\n // we're done, if it's not it, bye bye\n $txt = $this->get_string_number($start);\n if ($string == $txt) {\n $this->_HASHED[$string] = $start;\n return $start;\n } else\n return -1;\n } elseif ($start>$end) {\n return $this->find_string($string,$end,$start);\n } else {\n $half = (int)(($start+$end)/2);\n $tst = $this->get_string_number($half);\n $cmp = strcmp($string,$tst);\n if ($cmp == 0) {\n $this->_HASHED[$string] = $half;\n return $half;\n } elseif ($cmp<0)\n return $this->find_string($string,$start,$half);\n else\n return $this->find_string($string,$half,$end);\n }\n }", "function netrics_get_string_between( $start, $stop, $content ) {\n $str = explode( $start, $content );\n\n if ( isset( $str[1] ) ) {\n $str_btwn = explode( $stop, $str[1] );\n return $str_btwn[0];\n } else {\n return false;\n }\n}", "public function setIndexStartLength($start,$length);", "function check_for_word($letters_hashmap,$word){\n /// found letters\n $found_letters=0;\n ///visited cordinates\n $visited=[];\n //iterate in the word letters searching for them on the hash table\n $words_count=strlen($word);\n ///\n $stop=false;\n ///start from first letter \n $the_temp_letter=$word[0];\n \n while($found_letters<$words_count && !$stop){\n//serch for the letter on the hash table\n $the_letter=$the_temp_letter;\n \n \n\n if(array_key_exists($the_letter,$letters_hashmap)\n && count(array_diff(str_split($letters_hashmap[$the_letter],2),$visited))>=1\n ){\n \n //the letter is found on the hsah table\n //let us get how many times\n ///the last number was making error in the last letter to add to hash table\n $cordenates=$letters_hashmap[$the_letter];\n $cordenates = str_replace(' ', '', $cordenates);\n \n \n \n \n\n \n ///lets iterate throw the cordenates and check if it's available\n\n \n for($j=0;$j<strlen($cordenates);$j+=2){\n ///assign the first cordinates to start the search\n \n \n \n \n if($found_letters==0 && !in_array($cordenates[$j].$cordenates[$j+1],$visited)){\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n $found_letters++;\n $the_temp_letter=$word[$found_letters];\n break;\n \n\n }\n\n\n \n ///we are not on the first letter so we need compare the second letter cord with our cords\n else{\n \n $nexX=$cordenates[$j];\n $newY=$cordenates[$j+1];\n\n\n \n \n\n\n if(($x_cord-$newY+$y_cord-$nexX)<=1 && !in_array($j.$j+1,$visited)){\n \n\n ///the new position\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n\n \n \n $found_letters++;\n ///if we reached the last letter and found it then we should stop the loop\n if($found_letters==$words_count){\n \n $stop= true;\n \n break;\n \n }\n \n \n $the_temp_letter=$word[$found_letters];\n \n break;\n \n \n \n\n\n }else{\n\n if($j==strlen($cordenates)-1){\n $found_letters--;\n\n $the_temp_letter=$word[$found_letters];\n //\n \n array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n $stop=true;\n break;\n }\n \n \n $the_temp_letter=$word[$found_letters];\n //array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n \n // break;\n\n \n\n \n \n\n }\n }\n\n\n }\n \n \n }\n //so the letter is not found on the matrix so the word cant be formated\n else{\n $stop= true;\n \n \n }\n \n\n }\n \n //return $found_letters;\n if($found_letters==$words_count){\n return $found_letters;\n }else{\n return false;\n }\n\n}", "function pinside($start, $end=\"\", $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n $r = '';\r\n if ($start) $s = strpos($content, $start);\r\n else $s=0;\r\n if ($s !== false) {\r\n $s += strlen($start);\r\n if ($end) $e = strpos($content, $end, $s);\r\n else $e = strlen($content);\r\n if ($e !== false) {\r\n $r = array(trim(substr($content, $s, $e - $s)),$s);\r\n\r\n }\r\n }\r\n\r\n if (DEV)\r\n xlogc('pinside', $r, $start, $end, $org_content);\r\n\r\n return $r;\r\n}", "function pinsides($start, $end, $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n if (is_array($content)) {\r\n $startp=$content[1];\r\n $content=$content[0];\r\n } else $startp=0;\r\n $r = array(); $s=0;\r\n while ( ($s = strpos($content, $start,$s) ) !== false ) {\r\n $s += strlen($start);\r\n $e = strpos($content, $end, $s);\r\n if ($e !== false) {\r\n $r[] = array(trim(substr($content, $s, $e - $s)),$s+$startp);\r\n $s = $e + strlen($end);\r\n }\r\n }\r\n\r\n if (DEV)\r\n xlogc('pinsides', $r, $start, $end, $org_content);\r\n return $r;\r\n}", "function find_all($string, $start, $end) {\r\n preg_match_all (\"($start(.*)$end)siU\", $string, $matching_data);\r\n return $matching_data[0];\r\n}", "function MoveWord($word,&$wordlocs,$blockfrom,$sfrom,$wfrom,$blockto,$sto,$wto)\n{\n\t$word=TrimWord($word);\n\tif (!isset($wordlocs[$word])) return;\n\t\n\tfor ($loc=0; $loc<count($wordlocs[$word]); $loc++)\n\t{\n\t\t$loci=$wordlocs[$word][$loc];\n\t\tif ($loci[0]==$blockfrom // same block\n\t\t\t&& $loci[1]==$sfrom // same sentence\n\t\t\t&& $loci[2]==$wfrom) // same word\n\t\t{\n\t\t\t// Store new location\n\t\t\t$wordlocs[$word][$loc]=array($blockto,$sto,$wto);\n\t\t}\n\t}\n}", "function get_string_between($string, $start, $end){\n $string = \" \".$string;\n $ini = strpos($string,$start);\n if ($ini == 0) return \"\";\n $ini += strlen($start); \n $len = strpos($string,$end,$ini) - $ini;\n return substr($string,$ini,$len);\n}", "function endTag($parser, $data){\n global $ind;\n if($data == \"WORD\"){\n $ind++;\n }\n}", "function get_string($string, $start, $end){\n $string = \" \".$string;\n $pos = strpos($string,$start);\n//If there's nothing between the two phrases, return an empty string\n if ($pos == 0) return \"\";\n//start from the end of the 'start' phrase\n $pos += strlen($start);\n//string length is num chars until the 'end' phrase\n $len = strpos($string,$end,$pos) - $pos;\n//return the string between starting position and 'end' phrase\n return substr($string,$pos,$len);\n}", "function substring_between($haystack,$start,$end) {\n if (strpos($haystack,$start) === false || strpos($haystack,$end) === false) {\n return false;\n } else {\n $start_position = strpos($haystack,$start)+strlen($start);\n $end_position = strpos($haystack,$end);\n return substr($haystack,$start_position,$end_position-$start_position);\n }\n}", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}" ]
[ "0.59678787", "0.5795776", "0.5666337", "0.561945", "0.56033254", "0.55782557", "0.5517714", "0.550269", "0.5474362", "0.5356174", "0.5323948", "0.52840334", "0.52768683", "0.5252184", "0.5246995", "0.5221561", "0.5184406", "0.5175754", "0.5167744", "0.5155032", "0.5152448", "0.5141681", "0.5139935", "0.5137209", "0.51259375", "0.51046103", "0.5091921", "0.5083991", "0.5080735", "0.50614357" ]
0.5817539
1
Set CookeMode Param to true if cookieHandling is enables
private function initializeCookieMode(): void { if (isset($this->configuration['cookieHandling']) && (bool)$this->configuration['cookieHandling'] === true) { $this->logger->info('Cookie Handling is set.'); $this->cookieMode = true; $this->cookieName = $this->configuration['cookieName'] ?? self::COOKIE_NAME; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function enableCookies() {}", "public function enableCookies() {\n\t\t$this->cookiesEnabled = TRUE;\n\t}", "public function set_cookie()\n {\n }", "protected function handle_cookie()\n {\n }", "public function cookieAction() {\n if($_COOKIE['tx_cookies_accepted'] && !$this->settings['showPermanent']) {\n return FALSE;\n }\n $this->view->assign('accepted', array_key_exists('tx_cookies_accepted', $_COOKIE) ? 1 : 0);\n $this->view->assign('disabled', array_key_exists('tx_cookies_disabled', $_COOKIE) ? 1 : 0);\n $this->view->assign('acceptedOrDisabled', ($_COOKIE['tx_cookies_accepted'] || $_COOKIE['tx_cookies_disabled']) ? 1 : 0);\n }", "public function setTestCookie(): void\n {\n if (!$this->areCookieEnabled()) {\n self::set(\n new Cookie(\n Cookie::DEFAULT_TEST_COOKIE_STR,\n Cookie::DEFAULT_TEST_COOKIE_STR,\n Cookie::DEFAULT_COOKIE_DURATION\n )\n );\n }\n return;\n }", "function setIsAbuse($isAbuse = 'true') {\n $_COOKIE['isInAbuse'] = $isAbuse;\n }", "public function setViewmode()\n {\n $viewmode = ee()->input->post('ee_cp_viewmode');\n if (in_array($viewmode, ['classic', 'jumpmenu'])) {\n ee()->input->set_cookie('ee_cp_viewmode', $viewmode, 31104000);\n }\n ee()->functions->redirect(ee('CP/URL')->make('homepage'));\n }", "function cookiesEnabled(){\r\n\t\t//localhost won't work -> setcookie(\"test\", \"1\", 0, \"/\", FALSE);\r\n\t\tsetcookie(\"test\", \"1\");\r\n\t\tif (!isset($_REQUEST[\"cookies\"])) {\r\n\t\t\t\theader(\"Location: \". $_SERVER['PHP_SELF'].\"?cookies=1\".$_SESSION['params']);\r\n \t\t } \t\t \r\n \t\t if (!isset($_COOKIE[\"test\"]) || (isset($_COOKIE[\"test\"]) && $_COOKIE[\"test\"] != \"1\"))\r\n \t\t\tdie(\"<h1>It seems that your browser doesn't accept cookies!</h1> <h3>Unfortunately we need cookies to provide you a good service.\r\n \t\t\tIn order to proceed on our website: enable them and reload the page</h3>\");\r\n \r\n\t}", "public function disableCookies() {\n\t\t$this->cookiesEnabled = FALSE;\n\t}", "public function acceptCookies(){\n\t\tsetcookie('isUsingCookies', true, time()+60*60*24*365);\n\t\treturn redirect()->route('home');\n\t}", "public function is_cookie_set()\n {\n }", "function cemhub_campaign_tracking_use_cookie_instead_session() {\n return (bool)variable_get('cemhub_cookies_enabled');\n}", "public function acceptCookies($allow = true) {\n\t\t$this->accept_cookies = ($allow == true);\n\t}", "function ts_check_if_use_control_panel_cookies()\r\n{\r\n\treturn false;\r\n}", "public function setCookiePolicy()\n {\n if ($this->checkSameSiteNoneCompatible()) {\n config([\n 'session.secure' => true,\n 'session.same_site' => 'none',\n ]);\n }\n }", "public function toggleViewmode()\n {\n $viewmode = ee()->input->cookie('ee_cp_viewmode');\n\n // If it doesn't exist, or it's set to classic, flip the sidebar off.\n if (empty($viewmode) || $viewmode == 'classic') {\n $viewmode = 'jumpmenu';\n } else {\n $viewmode = 'classic';\n }\n\n ee()->input->set_cookie('ee_cp_viewmode', $viewmode, 31104000);\n\n ee()->functions->redirect(ee('CP/URL')->make('homepage'));\n }", "public function testTroubleshootingModeEnabledRightCookie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc123';\n\n\t\t// This test should pass, as the hash values does now match.\n\t\t$this->assertTrue( $this->class_instance->is_troubleshooting() );\n\t}", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "function bake($name, $value){\n\tsetcookie($name, $value, 0, '/', 'getnomon.com', isset($_SERVER[\"HTTPS\"]), true);\n}", "protected static function _set_cookie()\n\t{\n\t\t/** @var Cookie::$salt string */\n\t\tCookie::$salt = Config::get('cookie.salt');\n\n\t\t/** @var Cookie::$expiration string */\n\t\tCookie::$expiration = Config::get('cookie.lifetime');\n\t}", "public function session_cookie($enable) {\r\n\t\tif (!is_bool($enable)) { trigger_error(\"session_cookie() expects parameter 1 to be boolean\", E_USER_WARNING); }\r\n\t\telseif (!empty($this->options[\"CURLOPT_COOKIEFILE\"]) || !empty($this->options[\"CURLOPT_COOKIEJAR\"])) {\r\n\t\t\ttrigger_error(\"session cookie handling is not available when file cookie is activated\", E_USER_WARNING);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (!$this->session_cookie && $enable) {\t\t\t\t\t\t\t\t\t# set directly without updating $this->options so that it can be disabled by resetting curl session\r\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_COOKIEFILE, \"\");\r\n\t\t\t\t$this->session_cookie = true;\r\n\t\t\t}\r\n\t\t\telseif ($this->session_cookie && !$enable) {\t\t\t\t\t\t\t\t# basically there is no way to disable session cookie in curl library once it is enabled, workaround by resetting curl session\r\n\t\t\t\tif (is_resource($this->ch)) { curl_close($this->ch); }\r\n\t\t\t\t$this->ch = curl_init();\r\n\t\t\t\t$this->set_opt($this->options);\r\n\t\t\t\t$this->session_cookie = false;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function setSwarmCookie()\n {\n $session = $this->getSession();\n // Visit the swarm host url before the cookie is set, so that the domain for the cookie gets set\n $session->visit($this->configParams['base_url']);\n // Set the cookie\n $session->setCookie('SwarmDataPath', $this->getP4Context()->getUUID());\n // Re-visit the swarm host url, after the cookie has been set\n $session->visit($this->configParams['base_url']);\n }", "public function isCookieSet() {}", "function jsCookieSupport()\n\t{\n\t\tif ($_COOKIE['_jok_'])\n\t\t{\n\t\t\t#_jok_ = js ok\n\t\t\tsetcookie('_cen_','****');\n\t\t\tif($_COOKIE['_cen_'])\n\t\t\t{\n\t\t\t\t#_cen_ = cookies enabled\n\t\t\t\treturn \"noerror\";\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn \"cerror\";\n\t\t}\n\t\telse\n\t\t\treturn \"jerror\";\n\t}", "public static function kapee_cookikapee_accepted() {\n\t\treturn ( isset( $_COOKIE[self::$cookie['name']] ) && strtoupper( $_COOKIE[self::$cookie['name']] ) === self::$cookie['value'] );\n\t}", "function setacookiet($value, $expire)\r\n{\r\n\tglobal $cookie_name, $cookie_path, $cookie_domain;\r\n\t$cookie_namet=$cookie_name.\"_terms\";\r\n\tif (version_compare(PHP_VERSION, '5.2.0', '>='))\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);\r\n\telse\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);\r\n}", "public function declineCookies(){\n\t\tsetcookie('isUsingCookies', false, 0);\n\t\treturn redirect()->route('home');\n\t}", "function setARCcookie($name, $value)\n{\n\tif(defined('IS_SECURE'))\n\t\tsetARCcookieReal($name, $value, '1');\n\telse\n\t\tsetARCcookieReal($name, $value, '0');\n}", "function _rocket_add_aelia_currencyswitcher_mandatory_cookie( $cookies ) {\n\t$acs_options = get_option( 'wc_aelia_currency_switcher' );\n\n\tif ( ! empty( $acs_options['ipgeolocation_enabled'] ) ) {\n\t\t$cookies[] = 'aelia_cs_selected_currency';\n\t\t$cookies[] = 'aelia_customer_country';\n\t}\n\n\treturn $cookies;\n}" ]
[ "0.70665276", "0.6843895", "0.6147448", "0.6005707", "0.5873348", "0.5846875", "0.58276325", "0.5818137", "0.5797959", "0.57474506", "0.57393813", "0.568613", "0.5682982", "0.56511074", "0.56361943", "0.5608472", "0.55333525", "0.5525064", "0.5491687", "0.5486682", "0.54670626", "0.54519343", "0.5428672", "0.5321321", "0.5318386", "0.5289201", "0.5269837", "0.526723", "0.526245", "0.52591693" ]
0.7337784
0
Store a newly created resource in storage. store new Restaurant
public function store(CreateRestaurantRequest $request) { $hash = bin2hex(random_bytes(25)); $res = Restaurant::create([ 'name' => $request->input('name'), 'country_id' => $request->input('country'), 'city_id' => $request->input('city'), 'type_food' => $request->input('type_food'), 'number' => $request->input('phone'), 'description' => $request->input('description'), 'approved' => '0', 'manager_number' => $request->input('manager_number'), 'manager_email' => $request->input('manager_email'), 'menu' => $this->saveImage($request->file('menu'), 'images/res-images/menu'), 'map_url' => $request->input('location') ]); $res->appsDelivery()->create(['mrsool' => $request->input('mrsool'), 'logmaty' => $request->input('logmaty'), 'hungerStation' => $request->input('hungerStation'), 'jahiz' => $request->input('jahiz'), 'careemNow' => $request->input('careemNow')]); $res->contract()->create(['hash' => $hash , 'approve_at ' => NULL , 'signed_name' => NULL]); return redirect()->to(route('restaurant.index'))->with(['success' => "Added Restaurant $request->name Successfully"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(StoreRestaurantRequest $request)\n {\n $restaurant = new Restaurant;\n $restaurant->name = $request->input('name');\n $restaurant->state = $request->input('state');\n $restaurant->city = $request->input('city');\n $restaurant->suburb = $request->input('suburb');\n $restaurant->post_code = $request->input('post_code');\n $restaurant->business_type = $request->input('business_type');\n $restaurant->address = $request->input('address');\n $restaurant->phone_number = $request->input('phone_number');\n $restaurant->email = $request->input('email');\n $restaurant->status = $request->input('status');\n $restaurant->capacity = $request->input('capacity');\n $restaurant->description = $request->input('description');\n \n if($request->hasFile('logo')) {\n $image = request()->file('logo');\n $name = $restaurant->id . '_' . $restaurant->email . '_logo' . '.' . $image->getClientOriginalExtension();\n $folder = '/uploads/restaurant/logo';\n $filePath = $this->uploadOne($image, $folder, $name);\n $restaurant->logo = $filePath;\n $restaurant->save();\n }\n $restaurant->save();\n\n $user = new RestaurantUser;\n $user->fullname = $request->input('fullname');\n $user->password = Hash::make($request->password);\n $user->phone_number = $request->input('phone_number');\n $user->email = $request->input('email');\n\n $restaurant->user()->save($user);\n\n return new RestaurantResource($restaurant);\n }", "public function store(CreateRestaurantRequest $request)\n\t{\n\t $rookie = Restaurant::orderBy('id','desc')->first();\n\t $request = $this->saveFiles($request);\n\t\t\n\t\t$input = $request->all();\n\t\t\n\t if ($rookie == null) {\n\t \t$number = 1;\n\t }else{\n\t \t$alias = explode('-',$rookie->alias);\n\t \tif(isset($alias[1])){\n\t \t\t$number = $alias[1]+1;\n\t \t}else{\n\t \t\t$number =1;\n\t \t}\n\t }\n\t \n\t $input['alias'] = 'list-'.$number;\n\t\t$restaurant = Restaurant::create($input);\n\n\t\treturn redirect()->route('admin.restaurant.image',$restaurant->id);\n\t}", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request,Restaurant $restaurant )\n {\n $data = $request -> all();\n \n $request -> validate($this->dishValidationArray);\n $newDish = new Dish();\n $newDish->restaurant_id = $restaurant->id;\n $slug = Str::slug($data['name'],\"-\") .\"-\".$restaurant->id;\n $data[\"slug\"] = $slug;\n //upload file\n if(array_key_exists('img', $data)){\n //sta salvando il percorso relativo del file\n $data['img'] = Storage::put('dish_imgs', $data['img']);\n }\n if(array_key_exists('gluten_free', $data) && $data['gluten_free']== 'on' ){\n $data['gluten_free'] = 1;\n }\n if(array_key_exists('vegetarian', $data) && $data['vegetarian']== 'on' ){\n $data['vegetarian'] = 1;\n }\n if(array_key_exists('vegan', $data) && $data['vegan']== 'on' ){\n $data['vegan'] = 1;\n }\n if(array_key_exists('availability', $data) && $data['availability']== 'on' ){\n $data['availability'] = 1;\n }else{\n $data['availability'] = 0;\n }\n $newDish-> fill($data);\n $newDish -> save();\n\n return redirect() -> route('admin.dishes.index', $restaurant->id);\n }", "public function store(Request $request) {\n\n $this->validate(request(), [\n 'name' => 'required',\n 'username' => 'required',\n 'password' => 'required',\n 'address' => 'required',\n 'status' => 'required',\n 'contact' => 'required',\n 'photo' => 'mimes:jpeg,jpg,png|max:10000'\n ]);\n\n if ($request->hasFile('photo')) {\n $file_name_with_ext = $request->file('photo')->getClientOriginalName();\n $file = pathinfo($file_name_with_ext, PATHINFO_FILENAME);\n $extension = $request->file('photo')->getClientOriginalExtension();\n $file_name = $file . '_' . time() . '.' . $extension;\n $path = $request->file('photo')->move('images/restaurant', $file_name);\n } else {\n $file_name = 'noimage.jpg';\n }\n\n $address = $request->address; \n $apiKey = 'AIzaSyAztLRM2c-6I3w681cHGtNQgjLVzmIQdt0'; \n // Get JSON results from this request\n $geo = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($address).'&sensor=false&key='.$apiKey);\n $geo = json_decode($geo, true); // Convert the JSON to an array\n\n $latitude = $geo['results'][0]['geometry']['location']['lat']; // Latitude\n $longitude = $geo['results'][0]['geometry']['location']['lng']; // Longitude\n $restaurant = new Restaurant;\n $restaurant->name = $request->name;\n $restaurant->username = $request->username;\n $restaurant->password = Hash::make($request->password);\n $restaurant->address = $address;\n $restaurant->status = $request->status;\n $restaurant->photo = $file_name;\n $restaurant->latitude = $latitude;\n $restaurant->longitude = $longitude;\n $restaurant->contact = $request->contact;\n $restaurant->url = bin2hex(random_bytes(6));\n $restaurant->save();\n $resturant_setting = new Setting;\n $resturant_setting->meta_tag = 'restaurant';\n $resturant_setting->meta_label = 'Accept Delivery By Machine';\n $resturant_setting->meta_key = 'delivery_by_machine';\n \n $resturant_setting->meta_input = 'checkbox';\n $resturant_setting->meta_value = 'no';\n $resturant_setting->restaurant_url = WebHelper::get_restaurant_url($restaurant->id);\n $resturant_setting->save();\n Session::flash('success', 'Restaurant added successfully!');\n return redirect()->route('restaurants.index');\n }", "public function store() {\n \n }", "public function store(Request $request)\n {\n \n if(array_key_exists('take_away',$request->all())){\n if($request->take_away === \"on\"){\n $request->merge(['take_away' => true]);\n }\n }\n \n if(array_key_exists('free_delivery',$request->all())){\n if($request->free_delivery === \"on\"){\n $request->merge(['free_delivery' => true]);\n }\n }\n\n $data = $request->all();\n\n $restaurantTypes = array();\n\n if(array_key_exists('restaurant-types', $data)){\n foreach ($data['restaurant-types'] as $value) {\n $restaurantType = RestaurantType::where('name',$value)->firstOrFail();\n $restaurantTypes[] = $restaurantType->id;\n }\n }\n \n\n $request->validate($this->validationArray);\n\n $data['slug'] = Str::of($data['name'])->slug();\n\n if(array_key_exists('img_path', $data)){\n $data['img_path'] = Storage::put('restaurant_image', $data['img_path']);\n }\n\n $newRestaurant = new Restaurant();\n $newRestaurant->fill($data);\n $newRestaurant->user_id = Auth::id();\n\n $newAddress = new Address();\n $newAddress->address = $data['address'];\n $newAddress->city = $data['city'];\n $newAddress->zip_code = $data['zip_code'];\n $newAddress->province = $data['province'];\n $newAddress->country = $data['country'];\n $newAddress->save();\n $newRestaurant->address_id = $newAddress->id;\n $newRestaurant->save();\n \n if(array_key_exists('restaurant-types',$data)){\n $newRestaurant->restaurantTypes()->attach($restaurantTypes);\n }\n return redirect()->route('owner.restaurants.show', $newRestaurant)->with('created', \"Il ristorante $newRestaurant->name è stato creato con successo\");\n }", "public function store();", "public function store();", "public function store();", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72208565", "0.71438205", "0.6749259", "0.6676085", "0.66396374", "0.66314346", "0.6603712", "0.65827566", "0.65827566", "0.65827566", "0.6580772", "0.6580772", "0.6580772", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441", "0.6538441" ]
0.7311572
0
Image select sanitize Do not touch, or think twice.
function wponion_field_image_select_sanitize( $value ) { if ( isset( $value ) && wponion_is_array( $value ) && ! count( $value ) ) { $value = $value[0]; } return empty( $value ) ? '' : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _wp_image_editor_choose($args = array())\n {\n }", "public function sanitize() {\n\t\t$attribute_query = $this->dom->xpath->query( '//*/@srcset' );\n\n\t\tif ( 0 === $attribute_query->length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $attribute_query as $attribute ) {\n\t\t\t/** @var DOMAttr $attribute */\n\t\t\tif ( ! empty( $attribute->value ) ) {\n\t\t\t\t$this->sanitize_srcset_attribute( $attribute );\n\t\t\t}\n\t\t}\n\t}", "function create_selection_list_theme_images($it = null, $filter = null, $do_id = false, $include_all = false, $under = '')\n{\n $out = new Tempcode();\n if (!$include_all) {\n $rows = $GLOBALS['SITE_DB']->query('SELECT id,path FROM ' . get_table_prefix() . 'theme_images WHERE ' . db_string_equal_to('theme', $GLOBALS['FORUM_DRIVER']->get_theme()) . ' ' . $filter . ' ORDER BY path');\n foreach ($rows as $myrow) {\n $id = $myrow['id'];\n\n if (substr($id, 0, strlen($under)) != $under) {\n continue;\n }\n\n $selected = ($id == $it);\n\n $out->attach(form_input_list_entry($id, $selected, ($do_id) ? $id : $myrow['path']));\n }\n } else {\n $rows = get_all_image_ids_type($under, true);\n foreach ($rows as $id) {\n if (substr($id, 0, strlen($under)) != $under) {\n continue;\n }\n\n $selected = ($id == $it);\n\n $out->attach(form_input_list_entry($id, $selected));\n }\n }\n\n return $out;\n}", "function influencer_sanitize_image( $image, $setting ) {\r\n /*\r\n * Array of valid image file types.\r\n *\r\n * The array includes image mime types that are included in wp_get_mime_types()\r\n */\r\n $mimes = array(\r\n 'jpg|jpeg|jpe' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'png' => 'image/png',\r\n 'bmp' => 'image/bmp',\r\n 'tif|tiff' => 'image/tiff',\r\n 'ico' => 'image/x-icon'\r\n );\r\n // Return an array with file extension and mime_type.\r\n $file = wp_check_filetype( $image, $mimes );\r\n // If $image has a valid mime_type, return it; otherwise, return the default.\r\n return ( $file['ext'] ? $image : $setting->default );\r\n}", "protected function processImage() {}", "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "protected function cropMagic(): void\n {\n $this->image->crop($this->cropWidth, $this->cropHeight, $this->cropLeft, $this->cropTop);\n }", "public function p_coverimage($trip_id) {\n if ($_FILES['coverimg']['error'] == 0 && $_FILES['coverimg']['size'] < 800*800){\n $image = Upload::upload($_FILES, \"/uploads/avatars/\", array(\"JPG\", \"JPEG\", \"jpg\", \"jpeg\", \"gif\", \"GIF\", \"png\", \"PNG\"), $trip_id);\n\n # Error message if the file type isn't on the list\n if($image == 'Invalid file type.') {\n Router::redirect(\"/trips/coverimage/\".$trip_id.\"/error\");\n }\n\n else {\n\n # Process the upload\n $data = Array(\"coverimg\" => $image);\n DB::instance(DB_NAME)->update(\"trips\", $data, \"WHERE trip_id = \".$trip_id);\n\n # Resize the image\n $imgObj = new Image(APP_PATH.\"uploads/avatars/\". $image);\n $imgObj->resize(100,100, \"crop\");\n $imgObj->save_image(APP_PATH.\"uploads/avatars/\". $image);\n\n # Go back to the cover image page\n Router::redirect('/trips/coverimage/'.$trip_id);\n }\n }\n else\n {\n # Error message if file isn't able to be processed\n Router::redirect(\"/trips/coverimage/\".$trip_id.\"/error\");\n }\n\n }", "public static function FindUnusedImages()\n {\n }", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "function imageAllReset();", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }", "function ajax_process_image() {\r\n\t\tif ( !current_user_can( 'manage_options' ) )\r\n\t\t\tdie('-1');\r\n\t\t$id = (int) $_REQUEST['id'];\r\n\t\tif ( empty($id) )\r\n\t\t\tdie('-1');\r\n\t\t$fullsizepath = get_attached_file( $id );\r\n\t\tif ( false === $fullsizepath || !file_exists($fullsizepath) )\r\n\t\t\tdie('-1');\r\n\t\tset_time_limit( 60 );\r\n\t\tif ( wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $fullsizepath ) ) )\r\n\t\t\tdie('1');\r\n\t\telse\r\n\t\t\tdie('-1');\r\n\t}", "function briavers_remove_image_type_support() {\n remove_post_type_support( 'image_contest', 'editor' );\n}", "function thinkup_extract_images_filter( $tu_post ) {\n $regex = '/<img[^>]+>/i';\n\n if ( $tu_post->body && preg_match_all($regex, $tu_post->body, $matches) ) {\n\n $matches = $matches[0];\n\n foreach ( $matches as $match ) {\n\n $regex = '/(src)=(\"[^\"]*\")/i';\n if ( preg_match_all($regex, $match, $src, PREG_SET_ORDER) ) {\n $src = $src[0];\n $tu_post->images[] = trim($src[2], '\"');\n }\n\n }\n\n }\n\n return $tu_post;\n\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "function choose_image($file_name)\n{\n static $type, $image;\n\n /* TABLES INITIALISATION */\n if (!$type || !$image) {\n $type['word'] = array(\n 'doc',\n 'dot',\n 'rtf',\n 'mcw',\n 'wps',\n 'psw',\n 'docm',\n 'docx',\n 'dotm',\n 'dotx',\n );\n $type['web'] = array(\n 'htm',\n 'html',\n 'htx',\n 'xml',\n 'xsl',\n 'php',\n 'xhtml',\n );\n $type['image'] = array(\n 'gif',\n 'jpg',\n 'png',\n 'bmp',\n 'jpeg',\n 'tif',\n 'tiff',\n );\n $type['image_vect'] = array('svg', 'svgz');\n $type['audio'] = array(\n 'wav',\n 'mid',\n 'mp2',\n 'mp3',\n 'midi',\n 'sib',\n 'amr',\n 'kar',\n 'oga',\n 'au',\n 'wma',\n );\n $type['video'] = array(\n 'mp4',\n 'mov',\n 'rm',\n 'pls',\n 'mpg',\n 'mpeg',\n 'm2v',\n 'm4v',\n 'flv',\n 'f4v',\n 'avi',\n 'wmv',\n 'asf',\n '3gp',\n 'ogv',\n 'ogg',\n 'ogx',\n 'webm',\n );\n $type['excel'] = array(\n 'xls',\n 'xlt',\n 'xls',\n 'xlt',\n 'pxl',\n 'xlsx',\n 'xlsm',\n 'xlam',\n 'xlsb',\n 'xltm',\n 'xltx',\n );\n $type['compressed'] = array('zip', 'tar', 'rar', 'gz');\n $type['code'] = array(\n 'js',\n 'cpp',\n 'c',\n 'java',\n 'phps',\n 'jsp',\n 'asp',\n 'aspx',\n 'cfm',\n );\n $type['acrobat'] = array('pdf');\n $type['powerpoint'] = array(\n 'ppt',\n 'pps',\n 'pptm',\n 'pptx',\n 'potm',\n 'potx',\n 'ppam',\n 'ppsm',\n 'ppsx',\n );\n $type['flash'] = array('fla', 'swf');\n $type['text'] = array('txt', 'log');\n $type['oo_writer'] = array('odt', 'ott', 'sxw', 'stw');\n $type['oo_calc'] = array('ods', 'ots', 'sxc', 'stc');\n $type['oo_impress'] = array('odp', 'otp', 'sxi', 'sti');\n $type['oo_draw'] = array('odg', 'otg', 'sxd', 'std');\n $type['epub'] = array('epub');\n $type['java'] = array('class', 'jar');\n $type['freemind'] = array('mm');\n\n $image['word'] = 'word.gif';\n $image['web'] = 'file_html.gif';\n $image['image'] = 'file_image.gif';\n $image['image_vect'] = 'file_svg.png';\n $image['audio'] = 'file_sound.gif';\n $image['video'] = 'film.gif';\n $image['excel'] = 'excel.gif';\n $image['compressed'] = 'file_zip.gif';\n $image['code'] = 'icons/22/mime_code.png';\n $image['acrobat'] = 'file_pdf.gif';\n $image['powerpoint'] = 'powerpoint.gif';\n $image['flash'] = 'file_flash.gif';\n $image['text'] = 'icons/22/mime_text.png';\n $image['oo_writer'] = 'file_oo_writer.gif';\n $image['oo_calc'] = 'file_oo_calc.gif';\n $image['oo_impress'] = 'file_oo_impress.gif';\n $image['oo_draw'] = 'file_oo_draw.gif';\n $image['epub'] = 'file_epub.gif';\n $image['java'] = 'file_java.png';\n $image['freemind'] = 'file_freemind.png';\n }\n\n $extension = array();\n if (!is_array($file_name)) {\n if (preg_match('/\\.([[:alnum:]]+)(\\?|$)/', $file_name, $extension)) {\n $extension[1] = strtolower($extension[1]);\n\n foreach ($type as $generic_type => $extension_list) {\n if (in_array($extension[1], $extension_list)) {\n return $image[$generic_type];\n }\n }\n }\n }\n\n return 'defaut.gif';\n}", "function imageOptions() {\n\t$length = strlen($_SESSION['cuneidemo']['imageName']);\n\t$temp = glob($_SESSION['cuneidemo']['imagesPath'] . $_SESSION['cuneidemo']['imageName'] . '(*).jpg');\n\tif(empty($temp))\n\t\treturn null;\n\n\t$options = array();\n\n\tforeach($temp as $longName) {\n\t\t$options[] = substr(basename($longName, '.jpg'), $length + 1, -1);\n\t}\n\treturn $options;\n}", "abstract protected function drop_zone($mform, $imagerepeats);", "function updated_category_image ( $term_id, $tt_id ) {\n if( isset( $_POST['category-image-id'] ) && '' !== $_POST['category-image-id'] ){\n $image = $_POST['category-image-id'];\n update_term_meta ( $term_id, 'category-image-id', $image );\n } else {\n update_term_meta ( $term_id, 'category-image-id', '' );\n }\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "function tidy_theme_img_code($new, $old, $table, $field, $db = null)\n{\n if ($new === $old) {\n return; // Still being used\n }\n\n $path = ($old == '') ? null : find_theme_image($old, true, true);\n if ((is_null($path)) || ($path == '')) {\n return;\n }\n\n if ((strpos($path, '/images_custom/') !== false) && ($GLOBALS['SITE_DB']->query_select_value('theme_images', 'COUNT(DISTINCT id)', array('path' => $path)) == 1)) {\n if (is_null($db)) {\n $db = $GLOBALS['SITE_DB'];\n }\n $count = $db->query_select_value($table, 'COUNT(*)', array($field => $old));\n if ($count == 0) {\n @unlink(get_custom_file_base() . '/' . $path);\n sync_file(get_custom_file_base() . '/' . $path);\n $GLOBALS['SITE_DB']->query_delete('theme_images', array('id' => $old));\n }\n }\n}", "function edit_form_image_editor($post)\n {\n }", "public function actionCompleteEditImage()\n\t{\n\t\t$saveThis = Image::model()->findByPk($_POST['Image']['imageid']);\n\n\t\t$saveableThings = Image::model()->allowedSaves();\n\t\t\n\t\t$tags=Image::model()->tags();\n\t\tforeach($tags as $tag)\n\t\t{\n\t\t\tif ($_POST['Image'][$tag] == true)\n\t\t\t{\n\t\t\t\t$_POST['Image'][$tag] = 'k';\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$_POST['Image'][$tag] = 'e';\n\t\t\t}\n\t\t}\n\t\t\n\t\t// parsing the date from the 3 input fields\n\t\t$saveThis->pvm = $this->parseDateInput($_POST['day'], $_POST['month'], $_POST['year']);\n\t\t\n\t\t/*\n\t\t * For details on this for loop structure and the contents of $saveableThings,\n\t\t * go see the actionSearch. This is copy pasted and modified from it.\n\t\t */\n\t\tfor($i=0;$i<count($saveableThings);$i++)\n\t\t{\t\n\t\t\tif (!is_null($_POST['Image'][$saveableThings[$i]]))\n\t\t\t{\n\t\t\t\t$saveThis->$saveableThings[$i] = $_POST['Image'][$saveableThings[$i]];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$saveThis->save();\n\t\t\n\t\t$this->actionBuildingSave($_POST['kohteet'], $saveThis->imageid, $saveThis->cd, $saveThis->id);\n\t\t\t\t\n\t\tif(isset($_GET['id']))\n\t\t{\n\t\t\t$this->renderPartial('_metadatabox',array(\n\t\t\t\t\t'dataProvider'=>$saveThis,\n\t\t\t\t\t'hideimage'=>true,\n\t\t\t\t),\n\t\t\t\tfalse, \t// \"whether the rendering result should be returned instead of being displayed ot end users\"\n\t\t\t\tfalse\t// \"whether the rendering result should be postprocessed using processOutput\"\n\t\t\t);\n\t\t\n\t\t\t$this->renderPartial('_imageControlBox',array(\n\t\t\t\t'dataProvider'=>$saveThis,\n\t\t\t)); \t\n\t\t\t\n\t\t}\n\t}", "function bavatars_filter( $avatar, $id_or_email, $size, $default, $alt ) {\n\tif ( is_object( $id_or_email ) ) {\n\t\t$id = $id_or_email->user_id;\n\t} elseif ( ( function_exists( 'is_email' ) && is_email( $id_or_email ) ) || ( !function_exists( 'is_email' ) && !is_numeric( $id_or_email ) ) ) {\n\t\t$id = get_user_by_email( $id_or_email, array( 'by' => 'email' ) )->ID;\n\t} else {\n\t\t$id = (int)$id_or_email;\n\t}\n\n\tif ( !$id )\n\t\treturn $avatar;\n\n\t$id = md5( $id );\n\n\t$location = 'avatars/' . substr( $id, 0, 1 ) . '/' . substr( $id, 0, 2 ) . '/' . substr( $id, 0, 3 ) . '/' . $id . '.png';\n\n\tif ( !file_exists( trailingslashit( BAVATARS_BBPRESS_PATH ) . $location ) )\n\t\treturn $avatar;\n\n\tif ( $size != 512 ) {\n\t\t$_location = $location;\n\t\t$location = 'avatars/' . substr( $id, 0, 1 ) . '/' . substr( $id, 0, 2 ) . '/' . substr( $id, 0, 3 ) . '/' . $id . '_' . $size . '.png';\n\t}\n\n\tif ( !file_exists( trailingslashit( BAVATARS_BBPRESS_PATH ) . $location ) ) {\n\t\t$src = imagecreatefrompng( trailingslashit( BAVATARS_BBPRESS_PATH ) . $_location );\n\t\timagesavealpha( $src, true );\n\t\timagealphablending( $src, false );\n\n\t\t$temp = imagecreatetruecolor( $size, $size );\n\t\timagesavealpha( $temp, true );\n\t\timagealphablending( $temp, false );\n\n\t\timagecopyresampled( $temp, $src, 0, 0, 0, 0, $size, $size, 512, 512 );\n\n\t\timagepng( $temp, trailingslashit( BAVATARS_BBPRESS_PATH ) . $location, 9 );\n\n\t\timagedestroy( $temp );\n\t\timagedestroy( $src );\n\t}\n\n\treturn '<img alt=\"' . $alt . '\" src=\"' . trailingslashit( BAVATARS_BBPRESS_URI ) . $location . '\" class=\"avatar avatar-' . $size . ' avatar-bavatar\" style=\"height:' . $size . 'px; width:' . $size . 'px;\" />';\n}", "function wpstart_sanitize_image($image, $setting)\n {\n $mimes = array(\n 'jpg|jpeg|jpe' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'png' => 'image/png',\n 'bmp' => 'image/bmp',\n 'tif|tiff' => 'image/tiff',\n 'ico' => 'image/x-icon'\n );\n $file = wp_check_filetype($image, $mimes);\n return $file['ext'] ? $image : $setting->default;\n }", "private function checkImage(){\r\n \r\n $images = $this->image;\r\n @$imageName = $images['name'];\r\n @$imageTmp = $images['tmp_name'];\r\n @$imageSize = $images['size'];\r\n @$imageError = $images['error'];\r\n $imageExe = explode('.', $imageName);\r\n $imageExe = strtolower(end($imageExe));\r\n $newName = uniqid('post' , FALSE) . '.' . $imageExe;\r\n \r\n $allowed = [\"jpg\",\"jpeg\" ,\"bmp\" , \"gif\",\"png\"];\r\n// if(in_array($imageExe, $allowed) != 1) {\r\n// Messages::setMsg(\"خطأ\", \"يجب اختيار صورة حقيقية\", \"danger\") ;\r\n// echo Messages::getMsg();\r\n if(0) {\r\n \r\n }else if($imageSize > 1024 * 1024) {\r\n echo \"حجم الصورة جدا كبير\";\r\n }else if($imageError != 0) {\r\n echo \"يرجى ادخال صورة صحيحة\";\r\n }\r\n else{\r\n $dir = __DIR__ . \"/../libs/photos/\" ;\r\n if(!file_exists($dir)){\r\n mkdir($dir,TRUE);\r\n }\r\n $filedire = $dir.$newName;\r\n if(move_uploaded_file($imageTmp, $filedire)) {\r\n $this->uploadImage = $newName;\r\n }\r\n return TRUE;\r\n } // end else\r\n \r\n return false;\r\n }", "function ag_img_picker() {\t\n\tinclude_once(AG_DIR . '/classes/ag_img_fetcher.php');\n\tinclude_once(AG_DIR . '/functions.php');\n\t$tt_path = AG_TT_URL; \n\t\n\t\n\tini_set('display_errors', 1);\n\tini_set('display_startup_errors', 1);\n\terror_reporting(E_ALL);\t\n\t\n\t\n\t// get vars\n\tif(!isset($_POST['gallery_id'])) {die('missing data');}\n\t$gid = $_POST['gallery_id'];\n\t\n\tif(!isset($_POST['ag_type'])) {die('missing data');}\n\t$type = $_POST['ag_type'];\n\t\n\tif(!isset($_POST['page'])) {$page = 1;}\n\telse {$page = (int)addslashes($_POST['page']);}\n\t\n\tif(!isset($_POST['per_page'])) {$per_page = 26;}\n\telse {$per_page = (int)addslashes($_POST['per_page']);}\n\n\t$search = (!isset($_POST['ag_search'])) ? '' : $_POST['ag_search'];\n\t$extra = (!isset($_POST['ag_extra'])) ? array() : $_POST['ag_extra'];\n\t\n\t// images fetcher \n\t$fetcher = new ag_img_fetcher($gid, $type, $page, $per_page, $search, $extra);\n\t$img_data = $fetcher->get;\n\t\n\t\n\t// print code\n\techo '<ul>';\n\t\n\tif($img_data['tot'] == 0) {\n\t\tdie('<p>'. __('No images found', 'ag_ml') .' .. </p>');\n\t}\n\telse {\n\t\tforeach($img_data['img'] as $true_img_id => $img) {\n\t\t\t$img_id = str_replace('.', '', uniqid('', true));\n\t\t\t\n\t\t\tif(in_array($type, array('wp', 'wp_cat', 'cpt_tax', 'rml'))) {\n\t\t\t\t$img_src = $img['id'];\n\t\t\t} \n\t\t\telseif($type == 'ag_album' || $type == 'ngg') {\n\t\t\t\t$img_src = $img['path'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$img_src = $img['url'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$img_full_src = ag_img_src_on_type($img_src, $type);\n\t\t\t$thumb_url = (!get_option('ag_use_admin_thumbs')) ? $img['url'] : ag_thumb_src($img_full_src, $width = 90, $height = 90, $quality = 90);\n\t\t\t\n\t\t\t// add link to post if WP taxonomy\n\t\t\t$link = (($type == 'wp_cat' || $type == 'cpt_tax') && isset($img['link']) && !empty($img['link']) && get_option('ag_wp_term_autolink')) ? $img['link'] : '';\n\n\t\t\techo '\n\t\t\t<li class=\"ag_sel_status ag_img_not_sel\" id=\"sel-'.$img_id.'\">\n\t\t\t\t<figure style=\"background-image: url('.$thumb_url.');\" id=\"'.$img_id.'\"\n\t\t\t\t\timg_src=\"'.esc_attr($img_src).'\" img_full_src=\"'.esc_attr($img_full_src).'\" fullurl=\"'.$img['url'].'\"\n\t\t\t\t\tclass=\"ag_all_img\" title=\"'.esc_attr($img['title']).'\" alt=\"'.esc_attr($img['descr']).'\" author=\"'.esc_attr($img['author']).'\" link=\"'.esc_attr($link).'\"\n\t\t\t\t></figure>\n\t\t\t\t\n\t\t\t <div class=\"ag_zoom_img\"></div>\n\t\t\t</li>';\t\n\t\t}\n\t}\n\t\n\techo '\n\t</ul>\n\t<br class=\"lcwp_clear\" />\n\t<table cellspacing=\"0\" cellpadding=\"5\" border=\"0\" width=\"100%\">\n\t\t<tr>\n\t\t\t<td style=\"width: 35%;\">';\t\t\t\n\t\t\tif($page > 1) {\n\t\t\t\techo '<input type=\"button\" class=\"ag_img_pick_back button-secondary\" id=\"slp_'. ($page - 1) .'\" name=\"mgslp_p\" value=\"&laquo; ' . __('Previous images', 'ag_ml') . '\" />';\n\t\t\t}\n\t\t\t\n\t\techo '</td><td style=\"width: 30%; text-align: center;\">';\n\t\t\n\t\t\tif($img_data['tot'] > 0 && $img_data['tot_pag'] > 1) {\n\t\t\t\techo '<em>page '.$img_data['pag'].' of '.$img_data['tot_pag'].'</em> - <input type=\"text\" size=\"2\" name=\"mgslp_num\" id=\"ag_img_pick_pp\" value=\"'.$per_page.'\" autocomplete=\"off\" /> <em>' . __('images per page', 'ag_ml') . '</em>';\t\n\t\t\t}\n\t\t\telse { echo '<input type=\"text\" size=\"2\" name=\"mgslp_num\" id=\"ag_img_pick_pp\" value=\"'.$per_page.'\" autocomplete=\"off\" /> <em>' . __('images per page', 'ag_ml') . '</em>';\t}\n\t\t\t\n\t\techo '</td><td style=\"width: 35%; text-align: right;\">';\n\t\t\tif($img_data['more'] != false) {\n\t\t\t\techo '<input type=\"button\" class=\"ag_img_pick_next button-secondary\" id=\"slp_'. ($page + 1) .'\" name=\"mgslp_n\" value=\"' . __('Next images', 'ag_ml') . ' &raquo;\" />';\n\t\t\t}\n\t\techo '</td>\n\t\t</tr>\n\t</table>';\n\t\n\tif($img_data['tot'] > 0) {\n\t\techo'\n\t\t<script type=\"text/javascript\">\n\t\tjQuery(\"#ag_total_img_num\").text(\"('.$img_data['tot'].')\")\n\t\t</script>';\n\t}\n\tdie();\n}" ]
[ "0.55977756", "0.5458484", "0.52893114", "0.52819335", "0.5257429", "0.5174736", "0.5091635", "0.50766224", "0.50722724", "0.5052019", "0.50408864", "0.5034027", "0.50292856", "0.50288224", "0.5011945", "0.50052196", "0.4988524", "0.49629325", "0.49582106", "0.4943711", "0.49403042", "0.4932779", "0.4925902", "0.4897274", "0.4878642", "0.4869711", "0.48670584", "0.4865548", "0.48640668", "0.48553234" ]
0.6320409
0
This file contains functions that modify EDD that suit our donation needs. Functions might be moved to a seperate plugin. / Remove download links from checkout page for all downloads
function cfc_edd_receipt_show_download_files() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function edd_downloads_remove_renewal_form(){\n\tremove_action( 'edd_before_purchase_form', 'edd_sl_renewal_form', -1 );\n}", "function remove_footer_admin () {\n\techo '© <a href=\"http://blackflag.com.br/\">Black Flag Comunicação</a> - Todos os direitos reservados';\n}", "function pw_redirect_ecpt_version_check() {\n\n\tif( empty( $_REQUEST['edd_action'] ) ) {\n\t\treturn;\n\t}\n\n\tif( 'get_version' !== $_REQUEST['edd_action'] ) {\n\t\treturn;\n\t}\n\n\tif( empty( $_REQUEST['item_name'] ) ) {\n\t\treturn;\n\t}\n\n\tif( 'Easy Content Types' !== urldecode( $_REQUEST['item_name'] ) ) {\n\t\treturn;\n\t}\n\n\t$license = ! empty( $_REQUEST['license'] ) ? $_REQUEST['license'] : '';\n\n\twp_redirect( 'http://themeisle.com/?edd_action=get_version&item_name=Easy+Content+Types&license=' . $license ); exit;\n\n}", "function OnGetDownloadURL($url){\n\t// remove that code on not Synology system\n\treturn str_replace('/volume1/web', '', $url);\n}", "function pw_redirect_rcp_version_check() {\n\n\tif( empty( $_REQUEST['edd_action'] ) ) {\n\t\treturn;\n\t}\n\n\t$actions = array(\n\t\t'get_version',\n\t\t'check_license',\n\t\t'package_download',\n\t\t'activate_license',\n\t\t'deactivate_license',\n\t);\n\n\tif( ! in_array( $_REQUEST['edd_action'], $actions ) ) {\n\t\treturn;\n\t}\n\n\tif( empty( $_REQUEST['item_name'] ) && empty( $_REQUEST['item_id'] ) ) {\n\t\treturn;\n\t}\n\n\t$item_id = isset( $_REQUEST['item_id'] ) ? (int) $_REQUEST['item_id'] : 0;\n\t$item_name = isset( $_REQUEST['item_name'] ) ? urldecode( $_REQUEST['item_name'] ) : '';\n\n\tif( 'Restrict Content Pro' !== $item_name && 7460 !== $item_id ) {\n\t\treturn;\n\t}\n\n\t$license = ! empty( $_REQUEST['license'] ) ? $_REQUEST['license'] : '';\n\t$url = ! empty( $_REQUEST['url '] ) ? $_REQUEST['url '] : '';\n\n\twp_redirect( 'https://restrictcontentpro.com/?edd_action=' . $_REQUEST['edd_action'] . '&item_id=479&license=' . $license . '&url=' . $url ); exit;\n\n}", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "function remove_footer_admin () {\n echo '&copy; - Aleksandr Gryshko Theme';\n}", "function check_for_removal($wp_query)\n {\n\t#the free version of the service only allows files to exist for 30 days. \n\t#******if you think it' sneaky to remove these lines of code, don't bother******\n\t#******the files are also deleted off the server after 30 days, so the links wont work anyway, all it will do is give you broken links.******\n\t#if you upgrade to the full version of the service, these files can be re-created.\n\t$post_date=strtotime($wp_query->post->post_date);\n\t$today=strtotime('-30 days');\n\tif ($today > $post_date) {\n\t\tif (DEVELOPMENT_ENV) {error_log(\"About to delete mp3 enclosure\");}\n\t\t#remove the info.\n\t\tdelete_post_meta($wp_query->post->ID,'enclosure');\n\t\tdelete_post_meta($wp_query->post->ID,'mp3_token');\n\t\tdelete_post_meta($wp_query->post->ID,'podcast_url');\n\t\tdelete_post_meta($wp_query->post->ID,'txt2cast_check_for_update');\n\t\tupdate_post_meta($wp_query->post->ID,'txt2cast_expired', 'expired');\n\t}\n\tif (DEVELOPMENT_ENV) {\n\t\terror_log(\"post date is: \". $post_date);\n\t\terror_log(\"today, minus 30 days, is: \".$today);\n\t\terror_log(\"post_meta, enclosure: \".get_post_meta($wp_query->post->ID,'enclosure'));\n\t\t\n\t}\n}", "function ciniki_sapos_web_processRequestDonations(&$ciniki, $settings, $tnid, $args) {\n\n //\n // Check to make sure the module is enabled\n //\n if( !isset($ciniki['tenant']['modules']['ciniki.sapos']) ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.sapos.209', 'msg'=>\"I'm sorry, the page you requested does not exist.\"));\n }\n $page = array(\n 'title'=>$args['page_title'],\n 'breadcrumbs'=>$args['breadcrumbs'],\n 'blocks'=>array(),\n 'submenu'=>array(),\n );\n\n $ciniki['response']['head']['og']['url'] = $args['domain_base_url'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'processContent');\n\n //\n // Store the content created by the page\n // Make sure everything gets generated ok before returning the content\n //\n $content = '';\n $page_content = '';\n $page_title = 'Donations';\n if( $page['title'] == '' ) {\n $page['title'] = 'Donations';\n }\n if( count($page['breadcrumbs']) == 0 ) {\n $page['breadcrumbs'][] = array('name'=>$page['title'], 'url'=>$args['base_url']);\n }\n\n //\n // Get the list of packages\n //\n $strsql = \"SELECT id, name, subname, sequence, flags, amount, primary_image_id, synopsis \"\n . \"FROM ciniki_sapos_donation_packages \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (flags&0x01) = 0x01 \"\n . \"ORDER BY sequence \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'package');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n $packages = $rc['rows'];\n }\n\n //\n // Check for a intro\n //\n if( isset($settings['sapos-donations-intro']) && $settings['sapos-donations-intro'] != '' ) {\n $page['blocks'][] = array('type'=>'content', 'wide'=>'yes', 'content'=>$settings['sapos-donations-intro']);\n }\n\n //\n // Add the packages\n //\n if( isset($packages) ) { \n $content = '';\n $cards = array();\n foreach($packages as $package) {\n $package['object'] = 'ciniki.sapos.donationpackage';\n $package['object_id'] = $package['id'];\n if( ($package['flags']&0x02) == 0 ) {\n $package['amount'] = 0;\n }\n $cards[] = $package;\n }\n $page['blocks'][] = array('type'=>'pricecards', 'cards'=>$cards);\n }\n\n return array('stat'=>'ok', 'page'=>$page);\n}", "function complete_version_removal() { return ''; }", "function dcs_dropship_uninstall()\r\n{\r\n\tglobal $wpdb;\r\n\r\n\tdelete_option( DCS_DROPSHIP_SHOPPING_CART_PAGE );\r\n\tdelete_option( DCS_DROPSHIP_APPROVED_PAGE );\r\n\tdelete_option( DCS_DROPSHIP_DECLINED_PAGE );\r\n\tdelete_option( DCS_DROPSHIP_PRODUCT_PAGE );\r\n\tdelete_option( DCS_DROPSHIP_PRODUCT_INFO_PAGE );\r\n\r\n\t$wpdb->query( \"DROP TABLE dcs_dropship_invoices;\" );\r\n\r\n\t//Clear out tasks\r\n\tif( strstr(site_url(), \"darktower\") != FALSE )\r\n\t{\r\n\t\t$timestamp = wp_next_scheduled( \"dcs_dropship_get_products\" );\r\n\t\twp_unschedule_event( $timestamp, \"dcs_dropship_get_products\" );\r\n\t\r\n\t\t$timestamp = wp_next_scheduled( \"dcs_dropship_get_inventory\" );\r\n\t\twp_unschedule_event( $timestamp, \"dcs_dropship_get_inventory\" );\r\n\t\r\n\t\t$timestamp = wp_next_scheduled( \"dcs_dropship_get_invoices\" );\r\n\t\twp_unschedule_event( $timestamp, \"dcs_dropship_get_inventory\" );\r\n\t}\r\n}", "function get_links($enrolment_mode, $payment_status, $invoice_id, $user_id, $pymnt_due_id, $class_id, $view_trainee_data, $trainee_Status,$classStatus,$company_id, $att_status=NULL) {\n if ($payment_status == 'PYNOTREQD') { \n $tempLinkStr .= '<span style=\"color:red\">Payment Not Required</span> <br>';\n } else {\n $tempLinkStr = '';\n if ($view_trainee_data->data['user']->role_id != 'ADMN') \n {\n if ($trainee_Status == 'ACTIVE' && $classStatus != 'COMPLTD') \n { \n $tempLinkStr = '<a href=\"' . base_url() . 'class_trainee/booking_acknowledge_pdf/' . $user_id . '/' . $class_id . '\">Booking ACK.</a> <br>';\n }\n if ($enrolment_mode == 'SELF' && $payment_status == 'PAID') {\n $tempLinkStr .= '<a href=\"' . base_url() . 'class_trainee/export_payment_receipt/' . $pymnt_due_id . '\">Receipt (Paid)</a> <br>';\n } else if ($enrolment_mode == 'COMPSPON' && $payment_status == 'PAID') {\n $tempLinkStr .='<a href=\"' . base_url() . 'class_trainee/export_payment_received/' . $pymnt_due_id . '\">Receipt (Paid)</a> <br>';\n } else if ($enrolment_mode == 'COMPSPON' && $payment_status == 'PARTPAID') {\n $tempLinkStr .='<a href=\"' . base_url() . 'class_trainee/export_payment_received/' . $pymnt_due_id . '\">Receipt (Part Paid)</a> <br>';\n }\n } else { \n if ($enrolment_mode == 'SELF' && $payment_status == 'PAID' && $att_status == '1') {\n $tempLinkStr .= '<a href=\"' . base_url() . 'class_trainee/export_payment_receipt/' . $pymnt_due_id . '\">Receipt</a> <br>';\n } elseif ($enrolment_mode == 'SELF' && $payment_status == 'PAID' && $att_status == '0') {\n $tempLinkStr .= '<i>Receipt Not Available(Trainee is absent)</i> <br>';\n } elseif ($enrolment_mode == 'SELF' && $payment_status == 'NOTPAID') {\n if ($trainee_Status == 'ACTIVE') {\n if($classStatus != 'COMPLTD')\n $tempLinkStr .= '<a href=\"' . base_url() . 'class_trainee/booking_acknowledge_pdf/' . $user_id . '/' . $class_id . '\">Booking ACK.</a> <br>';\n }\n } elseif ($enrolment_mode == 'COMPSPON' && $payment_status == 'PAID') {\n $tempLinkStr .='<a href=\"' . base_url() . 'class_trainee/export_payment_received/' . $pymnt_due_id . '\">Received</a> <br>';\n if ($trainee_Status == 'ACTIVE' && $classStatus != 'COMPLTD')\n $tempLinkStr .='<a href=\"' . base_url() . 'class_trainee/booking_acknowledge_pdf/' . $user_id . '/' . $class_id . '\">Booking ACK.</a> <br>';\n } elseif ($enrolment_mode == 'COMPSPON' && ($payment_status == 'PARTPAID' || $payment_status == 'NOTPAID')) {\n if ($trainee_Status == 'ACTIVE' && $classStatus != 'COMPLTD')\n $tempLinkStr .='<a href=\"' . base_url() . 'class_trainee/booking_acknowledge_pdf/' . $user_id . '/' . $class_id . '\">Booking ACK.</a> <br>';\n }\n }\n }\n return $tempLinkStr;\n }", "function orderdown() {\n\t\t\n\t\t$this->_order(1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "function storefront_footer_payment_delivery_methods()\n { \n include('footer_payment_delivery_methods.php');\n }", "function edd_downloads_upgrade_to_cart($item){\n\t$post_data \t\t\t= urldecode($_REQUEST['post_data']);\n\t$post_data_formated = array();\n\tif( (strstr($post_data,\"upgrade_license\") && strstr($post_data,\"upgrade_product_to\"))){\n\t\t$post_data_split = explode(\"&\",$post_data);\n\t\tforeach($post_data_split as $data_split){\n\t\t\t$data_array = explode(\"=\",$data_split);\n\t\t\t$post_data_formated[$data_array[0]] = $data_array[1];\n\t\t}\n\t}\n\tif(isset($post_data_formated['upgrade_license']) && isset($post_data_formated['upgrade_product_to'])){\n\t\t$price_id\t\t\t\t\t\t\t\t= isset($item['options']['price_id']) ? $item['options']['price_id'] : 0;\n\t\t$download_files \t\t\t\t\t\t= edd_get_download_files( $post_data_formated['upgrade_product_to'], $price_id );\n\t\t$post_meta \t\t\t\t\t\t\t\t= get_post_meta(absint($post_data_formated['upgrade_license']), '_edd_sl_download_id', true);\n\t\t$old_price_id\t\t\t\t\t\t\t= get_post_meta(absint($post_data_formated['upgrade_license']), '_edd_sl_download_price_id', true);\n\t\t$old_download_file \t\t\t\t\t\t= edd_get_download_files( $post_meta, $old_price_id );\n\t\t\n\t\t$item['upgrade'] \t\t\t\t\t\t= array();\n\t\t$item['upgrade']['old_product']\t\t\t= absint($post_data_formated['old_product']);\t\t\n\t\t$item['upgrade']['new_attachment_id']\t= isset($download_files[0]['attachment_id']) ? absint($download_files[0]['attachment_id']) : 0;\n\t\t$item['upgrade']['old_attachment_id']\t= isset($old_download_file[0]['attachment_id']) ? absint($old_download_file[0]['attachment_id']) : 0;\n\n\t\t$item['upgrade']['upgrade_license'] \t= absint($post_data_formated['upgrade_license']);\n\t\t$item['upgrade']['upgrade_product_to'] \t= absint($post_data_formated['upgrade_product_to']);\n\t\tif(isset($item['options']) && !empty($item['options'])){\n\t\t\t$item['upgrade']['options'] \t= $item['options'];\t\n\t\t}\n\t\t$old_product_price \t\t\t\t\t= edd_get_cart_item_price( absint($post_data_formated['old_product']), $item['options'] );\n\t\t$new_product_price \t\t\t\t\t= edd_get_cart_item_price( absint($post_data_formated['upgrade_product_to']), $item['options'] );\n\t\t$item['upgrade']['upgrade_price']\t= edd_format_amount($new_product_price - $old_product_price);//edd_get_cart_item_price( absint($post_data_formated['upgrade_product_to']), $item['options'] );\t\t\n\t\t$payment_id_lic\t\t\t\t\t\t= get_post_meta( $post_data_formated['upgrade_license'], '_edd_sl_payment_id', true );\n\t\t$item['upgrade']['upgrade_product_used'] \t= 0;\n\t\t\n\t\t$session \t\t\t\t\t\t\t= edd_get_purchase_session();\n\t\t$payment_key \t\t\t\t\t\t= edd_get_payment_key( absint($payment_id_lic) );\n\t\t$session['purchase_key']\t\t\t= $payment_key;\n\t\tedd_set_purchase_session( $session );\n\t\tEDD()->session->set( 'upgrade_license', $payment_key );\n\t}\n\treturn $item;\n}", "function deinstallPackageDyntables() {\n @unlink('/usr/local/www/diag_dhcp_leases.php');\n @unlink('/usr/local/www/javascript/dyntables.js');\n @rename('/usr/local/pkg/diag_dhcp_leases.php.org', '/usr/local/www/diag_dhcp_leases.php');\n}", "function edd_pup_eligible_updates( $payment_id, $updated_products, $object = true, $licenseditems = null, $email_id = 0 ){\r\n\r\n\tif ( empty( $payment_id) || empty( $updated_products ) || $email_id = 0 ) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( is_null( $licenseditems ) ) {\r\n\t\tglobal $wpdb;\r\n\t\t$licenseditems = $wpdb->get_results( \"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_edd_sl_enabled' AND meta_value = 1\", OBJECT_K );\r\n\t}\r\n\r\n\t$customer_updates = '';\r\n\t$licensing = edd_get_option( 'edd_pup_license' );\r\n\t$payment_meta = get_post_meta( $payment_id, '_edd_payment_meta', true );\r\n\r\n\tif ( ( $licensing != false ) && is_plugin_active('edd-software-licensing/edd-software-licenses.php' ) ) {\r\n\t\t$licenses = edd_pup_get_license_keys( $payment_id );\r\n\t}\r\n\r\n\tforeach ( maybe_unserialize( $payment_meta['cart_details'] ) as $item ){\r\n\t\t$item['name'] = addslashes( $item['name'] );\r\n\r\n\t\t// Skip $item if it is not a product being updated\r\n\t\tif ( !isset( $updated_products[ $item['id'] ] ) ){\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// If Software Licensing integration is active and the $item has software licensing enabled\r\n\t\tif ( ( $licensing != false ) && isset( $licenseditems[ $item['id'] ] ) ) {\r\n\r\n\t\t\t// If the customer has licenses and the license for this $item is enabled and active\r\n\t\t\t$enabled = get_post_status( $licenses[$item['id']]['license_id'] ) == 'publish' ? true : false;\r\n\r\n\t\t\tif ( !empty( $licenses ) && $enabled && in_array( edd_software_licensing()->get_license_status( $licenses[$item['id']]['license_id'] ), apply_filters( 'edd_pup_valid_license_statuses', array( 'active', 'inactive' ) ) ) ) {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t\t// Add the $item as an eligible updates\r\n\t\t\t\t$customer_updates[ $item['id'] ] = $object ? $item : $item['name'];\r\n\t\t}\r\n\t}\r\n\r\n\treturn $customer_updates;\r\n}", "function sensei_cust_remove_content_drip_emails() { \nremove_all_actions( 'woo_scd_daily_cron_hook' );\n}", "function tnsl_fCleanLinks(&$getNextGen) {\r\n\t$getNextGen = preg_replace('(&(?!([a-zA-Z]{2,6}|[0-9\\#]{1,6})[\\;]))', '&amp;', $getNextGen);\r\n\t$getNextGen = str_replace(array(\r\n\t\t'&amp;&amp;',\r\n\t\t'&amp;middot;',\r\n\t\t'&amp;nbsp;',\r\n\t\t'&amp;#'\r\n\t), array(\r\n\t\t'&&',\r\n\t\t'&middot;',\r\n\t\t'&nbsp;',\r\n\t\t'&#'\r\n\t), $getNextGen);\r\n\t// montego - following code is required to allow the new RNYA AJAX validations to work properly\r\n\t$getNextGen = preg_replace('/rnxhr.php\\?name=Your_Account&amp;file/', 'rnxhr.php\\?name=Your_Account&file', $getNextGen );\r\n\treturn;\r\n}", "function getfaircoin_edd_unset_other_gateways( $gateway_list ) {\r\n $download_ids = edd_get_cart_contents();\r\n if ( ! $download_ids )\r\n return $gateway_list;\r\n $download_ids = wp_list_pluck( $download_ids, 'id' );\r\n\r\n if ( $download_ids ) {\r\n foreach ( $download_ids as $id ) {\r\n $gatoWay = get_post_meta( $id, '_edd_gateway', true);\r\n //echo ':'.$gatoWay.':';//print $gatoWay;\r\n foreach ( $gateway_list as $key => $val) {\r\n if ( $key !== $gatoWay) {\r\n if ( $gatoWay == 'coopshares_mixed' && $key == 'coopshares_transfer' ) {\r\n // to let choose at checkout one or the other\r\n } elseif ( ($gatoWay == 'fc2invest_mixed' && $key == 'fc2invest_transfer') || ($gatoWay == 'fc2invest_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } elseif ( ($gatoWay == 'fairmarket_mixed' && $key == 'fairmarket_transfer') ) { //|| ($gatoWay == 'fairmarket_mixed' && $key == 'localnode') ) {\r\n\r\n // to let choose at checkout one or the other\r\n\r\n } else {\r\n unset( $gateway_list[ $key ] );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $gateway_list;\r\n}", "function edd_social_discounts_view_order_details( $payment_id ) {\n\t// return if nothing was shared\n\tif ( ! get_post_meta( $payment_id, '_edd_social_discount', true ) )\n\t\treturn;\n?>\n<div id=\"edd-purchased-files\" class=\"postbox\">\n\t<h3 class=\"hndle\"><?php printf( __( '%s/Posts/Pages that were shared before payment', 'edd-social-discounts' ), edd_get_label_plural() ); ?></h3>\n\t<div class=\"inside\">\n\t\t<table class=\"wp-list-table widefat fixed\" cellspacing=\"0\">\n\t\t\t<tbody id=\"the-list\">\n\t\t\t<?php\n\t\t\t\t$downloads = get_post_meta( $payment_id, '_edd_social_discount_shared_ids', true );\n\n\t\t\t\tif ( $downloads ) :\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ( $downloads as $download_id ) :\n\t\t\t\t\t?>\n\t\t\t\t\t\t<tr class=\"<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>\">\n\t\t\t\t\t\t\t<td class=\"name column-name\">\n\t\t\t\t\t\t\t\t<?php echo '<a href=\"' . admin_url( 'post.php?post=' . $download_id . '&action=edit' ) . '\">' . get_the_title( $download_id ) . '</a>'; ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t$i++;\n\t\t\t\t\tendforeach;\n\t\t\t\tendif;\n\t\t\t?>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n<?php }", "function edd_downloads_receipt_shortcode($atts, $content = null){\n\tglobal $edd_receipt_args;\n\n\t$edd_receipt_args = shortcode_atts( array(\n\t\t'error' => __( 'Sorry, trouble retrieving payment receipt.', 'edd_downloads' ),\n\t\t'price' => true,\n\t\t'discount' => true,\n\t\t'products' => true,\n\t\t'date' => true,\n\t\t'notes' => true,\n\t\t'payment_key' => false,\n\t\t'payment_method' => true,\n\t\t'payment_id' => true\n\t), $atts, 'edd_receipt' );\n\n\t$session = edd_get_purchase_session();\n\tif(isset($session['downloads']) && is_array($session['downloads'])){\n\t\tforeach($session['downloads'] as $download){\n\t\t\tif(isset($download['upgrade']) && $download['upgrade']['upgrade_license'] > 0){\n\t\t\t\t$payment_id_lic\t\t\t\t\t\t\t= get_post_meta( absint($download['upgrade']['upgrade_license']), '_edd_sl_payment_id', true );\n\t\t\t\t$payment_key \t\t\t\t\t\t\t= edd_get_payment_key( $payment_id_lic );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\t\n\t}\n\tif ( !isset( $payment_key ) ) {\n\t\tif ( isset( $_GET[ 'payment_key' ] ) ) {\n\t\t\t$payment_key = urldecode( $_GET[ 'payment_key' ] );\n\t\t} elseif ( $edd_receipt_args['payment_key'] ) {\n\t\t\t$payment_key = $edd_receipt_args['payment_key'];\n\t\t} else if ( $session ) {\n\t\t\t$payment_key = $session[ 'purchase_key' ];\n\t\t}\n\t}\n\t// No key found\n\tif ( ! isset( $payment_key ) )\n\t\treturn $edd_receipt_args[ 'error' ];\n\n\t$edd_receipt_args[ 'id' ] = edd_get_purchase_id_by_key( $payment_key );\n\t$customer_id = edd_get_payment_user_id( $edd_receipt_args[ 'id' ] );\n\n\t/*\n\t * Check if the user has permission to view the receipt\n\t *\n\t * If user is logged in, user ID is compared to user ID of ID stored in payment meta\n\t *\n\t * Or if user is logged out and purchase was made as a guest, the purchase session is checked for\n\t *\n\t * Or if user is logged in and the user can view sensitive shop data\n\t *\n\t */\n\n\t$user_can_view = ( is_user_logged_in() && $customer_id == get_current_user_id() ) || ( ( $customer_id == 0 || $customer_id == '-1' ) && ! is_user_logged_in() && edd_get_purchase_session() ) || current_user_can( 'view_shop_sensitive_data' );\n\n\tif ( ! apply_filters( 'edd_user_can_view_receipt', $user_can_view, $edd_receipt_args ) ) {\n\t\treturn $edd_receipt_args[ 'error' ];\n\t}\n\trequire plugin_dir_path(__FILE__).\"template/shortcode-receipt.php\";\n}", "function edd_smart_coupons_setup() {\n\tif ( empty( $_COOKIE[ EDD_SMART_COUPONS_COOKIE ] ) ) {\n\t\t?>\n\t\t<style>\n\t\t\t#edd_discount_code {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t</style>\n\t\t<script>\n\t\t\tif ( window.location.href.match( <?php echo '/[?&]' . EDD_SMART_COUPONS_ARGUMENT . '=/' ?> ) ) {\n\t\t\t\tdocument.cookie =\n\t\t\t\t\t'<?php echo EDD_SMART_COUPONS_COOKIE ?>=1; ' +\n\t\t\t\t\t'expires=' + new Date(<?php echo EDD_SMART_COUPONS_EXPIRE * 1000 ?>).toUTCString() + '; ' +\n\t\t\t\t\t'path=/';\n\n\t\t\t\tvar params = {};\n\n\t\t\t\twindow.location.search.slice( 1 ).split( '&' ).forEach(function( part ) {\n\t\t\t\t\tvar param = part.split( '=' );\n\t\t\t\t\tif ( param[0] != '<?php echo EDD_SMART_COUPONS_ARGUMENT ?>' ) {\n\t\t\t\t\t\tparams[ param[0] ] = param[1];\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\twindow.location.href = ( window.location.pathname + '?' + jQuery.param( params ) ).replace( /\\?$/, '' );\n\t\t\t}\n\t\t</script>\n\t\t<?php\n\t}\n}", "function remove_footer_admin(){\n echo '© <a href=\"http://www.ciawebsites.com.br/\">Cia Web Sites</a> - Criação e otimização de sites';\n}", "function getfaircoin_trigger_purchase_receipt( $payment_id ) {\r\n remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 );\r\n\t// Make sure we don't send a purchase receipt while editing a payment\r\n\tif ( isset( $_POST['edd-action'] ) && 'edit_payment' == $_POST['edd-action'] )\r\n\t\treturn;\r\n\r\n $gateway = edd_get_payment_gateway( $payment_id );\r\n if( $gateway == 'paypal'){\r\n // Send email with secure download link\r\n edd_email_purchase_receipt( $payment_id );\r\n } else {\r\n return;\r\n }\r\n}", "function admin_footer () {\n\techo '<a href=\"http://www.drumcreative.com\" target=\"_blank\">&copy;' . date('Y') . ' Drum Creative</a>';\n}", "function fn_divido_uninstall()\n{\n db_query(\"DELETE FROM ?:payment_processors WHERE processor_script = ?s\", 'divido.php');\n}", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "public function test19DisableLinkVoucherDownload()\n {\n $ssoData = $this->getSSOData();\n\n $data = [\n \"booking_id\" => \"VELTRA-43HS4NG7\",\n \"activity_id\" => \"VELTRA-100010679\",\n \"plan_id\" => \"VELTRA-108951-0\",\n ];\n \n $this->createBookingByDateAndParams(date('Y-m-d'), $data);\n\n $this->mockApi($data);\n\n $voucherUrlMockApi = \"#\";\n $link = '<a href=\"'.$voucherUrlMockApi.'\"';\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n 'type' => 'current'\n ];\n\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalVoucherUrl = substr_count($list, $link);\n $totalClassDisabled = substr_count($list, 'disabled');\n\n $this->assertEquals(1, $totalVoucherUrl);\n $this->assertEquals(1, $totalClassDisabled);\n }", "function view_donation() \n{\n // $con=mysqli_connect(\"localhost\",\"ccmtAdmin\",\"#us6sTek\",\"data_gcmw\");\n // if (mysqli_connect_errno())\n // {\n // echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n // }\n // else\n // {\n faq_load_css();\n echo \"<form action='.' method='post'>\";\n echo \"<input class='itin' name='donation-download' type='submit' value='Download Donation' style='background-color:white;border:none;color:#000;font-size:15px;cursor:pointer;'>\";\n echo \"</form>\";\n echo \"<form action='.' method='post'>\";\n echo \"<input class='itin' name='balvihar-download' type='submit' value='Download Balvihar Subscription' style='background-color:white;border:none;color:#000;font-size:15px;cursor:pointer;'>\";\n echo \"</form>\";\n echo \"<h2>Donation By Credit Card</h2>\";\n \n global $wpdb;\n $result = $wpdb->get_results(\"SELECT * FROM wp_donation WHERE payment_method = 'Credit Card'\");\n //$result = mysqli_query($con,\"SELECT * FROM `wp_donation` WHERE `payment_method` = 'Credit Card'\");\n echo \"<div style='width:1209px;max-height:800px;overflow-x: auto;overflow-y:auto;'>\";\n echo \"<table class='loc-table'style='empty-cells:show;'>\";\n echo \"<th>ID</th>\";\n echo \"<th>Date & Time</th>\";\n echo \"<th>Name</th>\";\n echo \"<th>Email</th>\";\n echo \"<th>Pancard No.</th>\";\n echo \"<th>Contact</th>\";\n echo \"<th>Address</th>\";\n echo \"<th>Total Amount</th>\";\n echo \"<th>Payement Method</th>\";\n echo \"<th>Status</th>\";\n echo \"<th>Transaction Id</th>\";\n echo \"<th>Receipt No.</th>\";\n echo \"<th>Bank AUthorisation Id</th>\";\n echo \"<th>Batch No.</th>\";\n \n // while($row = mysqli_fetch_array($result)) \n while($row =$result)\n {\n $id = $row['id'];\n $date = $row['date'];\n $time = $row['time'];\n $fname = $row['first_name'];\n $lname = $row['last_name'];\n $email = $row['email'];\n $pan_num = $row['pan_num'];\n $contact = $row['contact'];\n $place = $row['address1'];\n $address = $row['address2'];\n $city = $row['city'];\n $state = $row['state'];\n $country = $row['country'];\n $total_amount = $row['total_amount'];\n // $order = $row['order_id'];\n $payment_method = $row['payment_method'];\n // $bank = $row['bank'];\n // $account_no = $row['account_no'];\n // $cheque_number = $row['cheque_number'];\n // $name_on_cheque = $row['name_on_cheque'];\n // $name_of_donor = $row['name_of_donor'];\n // $originating_account = $row['originating_account'];\n $status = $row['status'];\n $transaction_id = $row['transaction_id'];\n $receipt_no = $row['receipt_no'];\n $bank_authorization_id = $row['bank_authorization_id'];\n $batch_no = $row['batch_no'];\n // $project = $row['project_name'];\n // $order = $row['order_id'];\n // $amount = $row['amount'];\n echo \"<tr value='$id'>\";\n echo \"<td>\" . $id. \"</td>\";\n echo \"<td>\" . $date.\"-\".$time. \"</td>\";\n echo \"<td>\" . $fname.\" \". $lname.\"</td>\";\n echo \"<td>\" . $email. \"</td>\";\n echo \"<td>\" . $pan_num. \"</td>\";\n echo \"<td>\" . $contact. \"</td>\";\n echo \"<td>\" . $place.\",\".$address.\",\".$city.\",\".$state.\",\".$country.\"</td>\";\n echo \"<td>\" . $total_amount. \"</td>\";\n echo \"<td>\" . $payment_method. \"</td>\";\n echo \"<td>\" . $status. \"</td>\";\n echo \"<td>\" . $transaction_id. \"</td>\";\n echo \"<td>\" . $receipt_no. \"</td>\";\n echo \"<td>\" . $bank_authorization_id. \"</td>\";\n echo \"<td>\" . $batch_no. \"</td>\";\n echo \"<td><input type='button' name='reply' id='$id' class='reply_contact' value='Reply'></td>\";\n echo \"<td><input type='button' name='detail' id='$id' class='detail_contact' value='Detail'></td>\";\n echo \"<div class='plugin_box plugin_box-$id'> <!-- OUR content_box DIV-->\";\n echo \"<h1 style='font-weight:bold;text-align:center;font-size:30px;'></h1>\";\n echo \"<a class='pluginBoxClose'>Close</a>\";\n echo \"<div class='projectcontent'>\";\n echo \"<div class='select-style'>\n <form method='post' action='.'>\n From: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='from'><br/>\n To: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' value='$email' name='to' readonly><br/>\n Subject:&nbsp;&nbsp;<input type='text' name='subject'><br/>\n <p><span style='vertical-align:top;'>Message:</span><textarea rows='5' cols='30' name='message' ></textarea></p>\n <div style='width:520px;margin-left:200px;'><input type='submit' name='submit' value='Send'></div>\n </form>\n </div>\";\n echo \"</div>\";\n echo \"</div><!-- content_box -->\";\n echo \"<div class='detail_box detail_box-$id'> <!-- OUR content_box DIV-->\";\n echo \"<h2 style='font-weight:bold;text-align:center;font-size:30px;'>Donation Detail #\".$id.\"</h2>\";\n echo \"<a class='detailBoxClose'>Close</a>\";\n echo \"<div class='projectcontent'>\";\n echo \"Name:\".$fname.\" \".$lname.\"</br>\";\n echo \"Transaction Id:\".$transaction_id.\"</br>\";\n\n $detailresult = $wpdb->get_results(\"SELECT * FROM wp_donation_project WHERE transaction_id = '$transaction_id'\");\n //$detailresult = mysqli_query($con,\"SELECT * FROM `wp_donation_project` WHERE transaction_id = '$transaction_id'\");\n \n while($detailrow = mysqli_fetch_array($detailresult)) \n {\n $id = $detailrow['id'];\n // $pcategory_id = $row['category_id'];\n $pcategory_name = $detailrow['category_name'];\n // $pproject_id = $row['project_id'];\n $pproject_name = $detailrow['project_name'];\n $porder_id = $detailrow['order_id'];\n $ptransaction_id = $detailrow['transaction_id'];\n $pamount = $detailrow['amount']; \n echo $id.\" \".$pcategory_name.\" \".$pproject_name.\" \".$porder_id.\" \".$ptransaction_id.\" \".$pamount.\"</br>\";\n }\n echo \"</div>\";\n echo \"</div><!-- content_box -->\";\n echo \"</form>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n echo \"</div>\";\n faq_load_js();\n // } \n}" ]
[ "0.587776", "0.5536161", "0.5526493", "0.54849005", "0.5480852", "0.54660463", "0.5460572", "0.54473317", "0.5400517", "0.5381509", "0.5373195", "0.53687185", "0.53351253", "0.5323185", "0.53028876", "0.52930456", "0.52900255", "0.5276051", "0.527258", "0.5262193", "0.52596384", "0.52400994", "0.52271837", "0.52262926", "0.52161825", "0.5212761", "0.52109015", "0.5199884", "0.5196031", "0.5165241" ]
0.6103611
0
/ Add custom text just before the "Purchase" button at checkout
function cfc_edd_purchase_form_before_submit() { ?> <p><?php _e('Click on the button below to make your donation', 'cfctranslation'); ?> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function organique_single_add_to_cart_text() {\n\t\treturn __( 'Add to shopping cart', 'organique_wp' );\n\t}", "function woo_custom_cart_button_text(){\n\treturn __('Comprar', 'woocommerce');\n}", "public function single_add_to_cart_text() {\n\n\t\tif ( $this->is_purchasable() && $this->is_in_stock() ) {\n\t\t\t$text = get_option( WC_Subscriptions_Admin::$option_prefix . '_add_to_cart_button_text', __( 'Sign Up Now', 'woocommerce-subscriptions' ) );\n\t\t} else {\n\t\t\t$text = parent::add_to_cart_text(); // translated \"Read More\"\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_product_single_add_to_cart_text', $text, $this );\n\t}", "function woocommerce_custom_single_add_to_cart_text() {\n return __( 'Add to cart', 'shtheme' ); \n}", "function show_my_text_on_checkout() {\n echo '<p>All credit card details are processed and stored securely via Stripe.</p>'; \n}", "public function add_to_cart_text() {\n\t\treturn apply_filters( 'woocommerce_product_add_to_cart_text', __( 'Customize', 'wc-catalog-product' ), $this );\n\t}", "function simpleshop_product_add_to_cart_text($text) {\n return '<i class=\"fa fa-shopping-basket\"></i>';\n}", "public function AAAsingle_add_to_cart_text() {\n\t\treturn apply_filters( 'woocommerce_product_single_add_to_cart_text', __( 'Order Print Copy', 'wc-catalog-product' ), $this );\n\t}", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "function wrap_before_button_cart(){\n\techo '<div class=\"d-flex flex-wrap align-items-center wrap-btn-cart\">';\n\techo '<span class=\"mr-5\">'. __( 'Choose quantity', 'shtheme' ) .'</span>';\n}", "public function render_checkout_place_order_text() {\n\n\t\t\tglobal $woocommerce;\n\t\t\t$cart_total_with_symbol = '';\n\n\t\t\tif ( isset( $woocommerce->cart->total ) && astra_get_option( 'checkout-modern-checkout-button-price' ) ) {\n\t\t\t\t$cart_total = $woocommerce->cart->total;\n\t\t\t\t$cart_total_with_symbol = ' ' . get_woocommerce_currency_symbol() . $cart_total;\n\t\t\t}\n\n\t\t\treturn astra_get_option( 'checkout-place-order-text' ) . $cart_total_with_symbol;\n\t\t}", "function insert_btn_quick_buy() {\n\tglobal $post, $product;\n\tif ( $product->is_type( 'simple' ) ) {\n\t\techo '<a class=\"button buy_now ml-3\" href=\"?quick_buy=1&add-to-cart='. $post->ID .'\" class=\"qn_btn\">'. __('Quick buy','shtheme') .'</a>';\n\t}\n}", "function BuyBoxSetNow() {\n\treturn\n'\n<a class=\"button radius primary medium\" title=\"Earlyarts Box Set\" href=\"/store/products/nurturing-young-childrens-learning-box-set/\" >Save a whopping 40% and buy this pack in a box-set!</a>\n';\n\t\n}", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "public function getPaymentSubmitButtonText()\n\t{\n\t\treturn \"Proceed to 2checkout.com to pay\";\n\t}", "public function maybe_override_single_add_to_cart_text($text, $product)\n {\n\n // Check if product can be purchased\n if ($product->is_purchasable() && $product->is_in_stock()) {\n\n // Change button label if set in settings and product is subscription\n if (RP_SUB_Settings::get('add_to_cart_label') && subscriptio_is_subscription_product($product)) {\n $text = RP_SUB_Settings::get('add_to_cart_label');\n }\n }\n\n return $text;\n }", "function basel_add_to_compare_btn() {\n\t\tglobal $product;\n\t\techo '<div class=\"basel-compare-btn product-compare-button\"><a class=\"button\" href=\"' . esc_url( basel_get_compare_page_url() ) . '\" data-added-text=\"' . esc_html__( 'Compare products', 'basel' ) . '\" data-id=\"' . esc_attr( $product->get_id() ) . '\">' . esc_html_x( 'Compare', 'add_button', 'basel' ) . '</a></div>';\n\t}", "function pacz_woocommerce_button_proceed_to_checkout() {\n\t\t$checkout_url = wc_get_checkout_url();\n\n\t\t?>\n\t\t<div class=\"button-icon-holder alt checkout-button-holder\"><a href=\"<?php echo esc_url($checkout_url); ?>\" class=\"checkout-button\"><i class=\"pacz-icon-shopping-cart\"></i><?php esc_html_e( 'Proceed to Checkout', 'classiadspro' ); ?></a></div>\n\t\t<?php\n\t}", "function bt_rename_coupon_message_on_checkout() {\n\treturn 'Have a Coupon or Gift Certificate?' . ' <a href=\"#\" class=\"showcoupon\">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';\n}", "public function showCartButton() {\n\t\t\n\t\techo $this->getCartButton();\n\t}", "function bt_thank_you() {\n\t$added_text = '<p>Thank you your order has been received. Your download link is below. You will also receive an email with your PDF download link.</p>';\n\treturn $added_text ;\n}", "public function add_quick_view_button_with_text() {\n\t\t\t$options = $this->get_options();\n\t\t\tif ( in_array( $options['shop_page_quick_view_position'], array( 'none', 'top-right' ), true ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobal $product;\n\t\t\t$class[] = $options['shop_product_quick_view_icon'] ? apply_filters( 'woostify_pro_quick_view_button_icon', 'ti-eye' ) : '';\n\t\t\t$class[] = 'quick-view-with-text quick-view-on-' . $options['shop_page_quick_view_position'];\n\t\t\t$class = implode( ' ', $class );\n\t\t\t?>\n\n\t\t\t<span title=\"<?php esc_attr_e( 'Quick View', 'woostify-pro' ); ?>\" data-pid=\"<?php echo esc_attr( $product->get_id() ); ?>\" class=\"<?php echo esc_attr( $class ); ?> product-quick-view-btn\"><?php esc_html_e( 'Quick View', 'woostify-pro' ); ?></span>\n\t\t\t<?php\n\t\t}", "public function print_button() {\n\t\t\techo do_shortcode( \"[yith_wcwl_add_to_wishlist]\" );\n\t\t}", "function make_transaction_button($product,$item_name,$purchase_id,$amount,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\n $user_details=array();\n\t\tif (!is_guest())\n\t\t{\n\t\t\t$user_details['first_name']=get_ocp_cpf('firstname');\n\t\t\t$user_details['last_name']=get_ocp_cpf('lastname');\n\t\t\t$user_details['address1']=get_ocp_cpf('building_name_or_number');\n\t\t\t$user_details['city']=get_ocp_cpf('city');\n\t\t\t$user_details['state']=get_ocp_cpf('state');\n\t\t\t$user_details['zip']=get_ocp_cpf('post_code');\n\t\t\t$user_details['country']=get_ocp_cpf('country');\n\n\t\t\tif (($user_details['address1']=='') || ($user_details['city']=='') || ($user_details['zip']=='') || ($user_details['country']==''))\n\t\t\t{\n\t\t\t\t$user_details=array(); // Causes error on PayPal due to it crashing when trying to validate the address\n\t\t\t}\n\t\t}\n\n\t\treturn do_template('ECOM_BUTTON_VIA_PAYPAL',array('_GUID'=>'b0d48992ed17325f5e2330bf90c85762','PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url,'MEMBER_ADDRESS'=>$user_details));\n\t}", "function go_back_button()\n{\n\techo'<p style=\"float: left; width:300px; font-size: 10px; line-height: 25px;\"><a class=\"button\" style=\"font-size: 10px; margin-bottom: 10px;\" href=\"http://drnonprofit.com/coaching/\">Continue Shopping</a>\n\t<br />\n\tOnly one subscription needs to be purchased at a time, additional purchases may be made after this one is completed</p>';\n}", "public function getFrontendButtonLabel()\n {\n $buttonLabel = __('Proceed to checkout');\n if ($this->isCheckoutDisabled()) {\n $buttonLabel = __('Accept Quotation');\n }\n\n return $buttonLabel;\n }", "public function checkout_place_order_button_text( $button_text ) {\n\n\t\t\tif ( ! defined( 'CARTFLOWS_VER' ) && is_checkout() && ! is_wc_endpoint_url( 'order-received' ) && 'modern' === astra_get_option( 'checkout-layout-type' ) ) {\n\t\t\t\tglobal $woocommerce;\n\t\t\t\t$cart_total_with_symbol = '';\n\n\t\t\t\tif ( isset( $woocommerce->cart->total ) && astra_get_option( 'checkout-modern-checkout-button-price' ) ) {\n\t\t\t\t\t$cart_total = $woocommerce->cart->total;\n\t\t\t\t\t$cart_total_with_symbol = ' ' . get_woocommerce_currency_symbol() . $cart_total;\n\t\t\t\t}\n\n\t\t\t\t$is_custom_text = astra_get_option( 'checkout-place-order-text' );\n\n\t\t\t\tif ( $is_custom_text && ! empty( $is_custom_text ) ) {\n\t\t\t\t\t$button_text = $is_custom_text;\n\t\t\t\t}\n\n\t\t\t\t$button_text = $button_text . $cart_total_with_symbol;\n\t\t\t}\n\n\t\t\treturn $button_text;\n\t\t}", "private function addEasyCreditConfirmationButtonTranslation()\n {\n $sql = \"INSERT INTO s_core_snippets (namespace, shopID, localeID, name, value) VALUES \"\n .\"('confirm', 1,2, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Continue to Ratenkauf by easyCredit'),\n ('confirm', 1,1, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Weiter zu Ratenkauf by easyCredit')\";\n\n Shopware()->Db()->query($sql);\n }", "function make_subscription_button($product,$item_name,$purchase_id,$amount,$length,$length_units,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\t\treturn do_template('ECOM_SUBSCRIPTION_BUTTON_VIA_PAYPAL',array('PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'LENGTH'=>strval($length),'LENGTH_UNITS'=>$length_units,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url));\n\t}", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}" ]
[ "0.73344785", "0.7121958", "0.7116409", "0.7001793", "0.68807924", "0.68762046", "0.6747143", "0.6694471", "0.6607422", "0.6541256", "0.6494585", "0.6481205", "0.6462282", "0.63546205", "0.6309921", "0.6306728", "0.62925106", "0.62601227", "0.62507546", "0.62402976", "0.6234495", "0.62084377", "0.6162489", "0.6120582", "0.6101845", "0.6091867", "0.6082493", "0.60624236", "0.6056997", "0.6056705" ]
0.7251224
1
/ Remove decimal places from all prices
function cfc_edd_remove_decimals( $decimals ) { return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFormatPrice($price='')\n {\n //Agregamos el punto decimal\n $price = str_replace(\"<sup>\", \"<sup>.\", $price);\n //removemos etiquetas html y espacios duplicados\n $price = preg_replace('/\\s+/', ' ',strip_tags($price));\n //\n //Extraemos el valor numerico de la divisa y signo de moneda\n $arrayNum = explode(\" \", $price);\n //Eliminamos las comas de las cifras de miles, millones, etc\n $arrayNum[1] = str_replace(\",\", \"\", $arrayNum[1]);\n\n return $arrayNum;\n }", "function paces_filter_price_text( $price ){\n $price = floatval( $price );\n $parts = explode( '.', (string)$price );\n\n if ( empty( $parts[1] ) ) {\n return $price;\n }\n if ( strlen( $parts[1] ) == 1 ) {\n $price = (string)$price . '0';\n }\n return $price;\n}", "function carton_trim_zeros( $price ) {\n\treturn preg_replace( '/' . preg_quote( get_option( 'carton_price_decimal_sep' ), '/' ) . '0++$/', '', $price );\n}", "function format_price($price)\n{\n $price = number_format(ceil($price), 0, \".\", \" \");\n return $price . \" \" . \"₽\";\n}", "function decimal($value) {\n return preg_replace('/\\.0+$/', '', $value);\n }", "public function price_to_s(){\n return number_format($this->price, 2, '€', '');\n }", "public function getFormattedPriceExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false));\n }", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "protected function removePriceFormat($value)\n\t{\n\t\treturn str_replace('$', '', $value);\n\t}", "protected function escapeCurrency($price)\n {\n return preg_replace(\"/[^0-9\\.,]/\", '', $price);\n }", "function formatPrice2($price)\n{\n\t$price = @number_format($price, 2, '.', ' '); // Igor\n\treturn $price;\n}", "function price () {\n global $value;\n $pricefloat = ceil($value['price']);\n\n if ($pricefloat <= 999) {\n echo $pricefloat;\n } elseif ($pricefloat >= 1000) {\n $num_format = number_format($pricefloat, 0, '.', ' ');\n echo $num_format . \" &#8381;\";\n }\n }", "public function getFormattedPrice(): string\n {\n\n return number_format($this->price, 0, '', ' ');\n\n }", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}", "public function getFormattedPriceAttribute()\n {\n //attributes['price']\n return number_format(($this->attributes['price'] / 100), 2, '.', '');\n }", "function ppom_price( $price ) {\n\t\n\t$price\t\t\t\t\t= floatval($price);\n\t\n\t$decimal_separator\t\t= wc_get_price_decimal_separator();\n\t$thousand_separator\t\t= wc_get_price_thousand_separator();\n\t$decimals\t\t\t\t= wc_get_price_decimals();\n\t$price_format\t\t\t= get_woocommerce_price_format();\n\t$negative \t\t= $price < 0;\n\t\n\t// $wc_price = number_format( $price,$decimals, $decimal_separator, $thousand_separator );\n\t$wc_price = number_format( abs($price), $decimals, $decimal_separator, $thousand_separator );\n\t$formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol(), $wc_price );\n\treturn apply_filters('ppom_woocommerce_price', $formatted_price);\n}", "function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}", "function store_parse_decimal($value)\n {\n $point = config_item('store_currency_dec_point');\n $cleaned_value = preg_replace('/[^0-9\\-'.preg_quote($point, '/').']+/', '', $value);\n\n return str_replace($point, '.', $cleaned_value);\n }", "function opaljob_get_price_decimals() {\n return absint( opaljob_options( 'price_num_decimals', 2 ) );\n}", "function formatPrice($vlprice)\n{\n\tif(!$vlprice>0) $vlprice = 0;//trantando nao tem nada no carrinho, o valor do frete vem NULL e assim daria erro\n\treturn number_format($vlprice, 2, \",\", \".\");\n}", "function convertToDollar($localAmount, $rate){\n return round ($localAmount/$rate, 3);\n //return number_format(round ($localAmount/$rate, 3), 3, \".\", \",\");\n\n}", "protected function priceFormat($price)\n {\n return number_format((float)$price, 2, '.', '') * 100;\n }", "private function _getWrappingValues(){\n return number_format(Tools::ps_round($this->context->cart->getOrderTotal(TRUE, Cart::ONLY_WRAPPING), 2), 2, '.', '');\n }", "public function pricer($price)\n {\n $string_price = number_format($price,2,',','.');\n return $string_price;\n }", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "public function formatPrice($price)\n {\n // Suppress errors from formatting the price, as we may have EUR12,00 etc\n return @number_format($price, 2, '.', '');\n }", "function precioNumero($itemPrecio){ \n $precio = str_replace('$','',$itemPrecio); //Eliminar el símbolo \n $precio = str_replace(',','',$precio); //Eliminar la coma \n return $precio; //Devolver el valor de tipo Numero sin caracteres especiales\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }", "public function getFormattedPrice()\n {\n return $this->formatted_price;\n }" ]
[ "0.7252864", "0.7083453", "0.67638874", "0.66886955", "0.66367626", "0.6538925", "0.6491706", "0.6450495", "0.6450495", "0.63677996", "0.6332667", "0.63204926", "0.6299777", "0.62808216", "0.62567765", "0.6206479", "0.61482006", "0.61339724", "0.6094123", "0.60912126", "0.6056986", "0.6046692", "0.60414344", "0.6034738", "0.6024188", "0.60187715", "0.6007812", "0.6005839", "0.59602267", "0.59602267" ]
0.71151227
1
/ Remove the default final checkout price
function cfc_edd_replace_final_total() { remove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restore_price_template() {\r\n\t\tadd_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );\r\n\t\tremove_action( 'woocommerce_before_add_to_cart_form', array( $this, 'display_suggested_price' ) );\r\n\t}", "function hide_free_price_notice( $price ) {\n remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );\n return 'Preço sob consulta';\n}", "function atcf_theme_variable_pricing() {\n\tremove_action( 'edd_purchase_link_top', 'edd_purchase_variable_pricing' );\n\tadd_action( 'edd_purchase_link_top', 'atcf_purchase_variable_pricing' );\n}", "function get_price_excluding_tax() {\n\t\t\n\t\t$price = $this->price;\n\t\t\t\n\t\tif (get_option('woocommerce_prices_include_tax')=='yes') :\n\t\t\n\t\t\tif ( $rate = $this->get_tax_base_rate() ) :\n\t\t\t\t\n\t\t\t\tif ( $rate>0 ) :\n\t\t\t\t\t\n\t\t\t\t\t$_tax = &new woocommerce_tax();\n\n\t\t\t\t\t$tax_amount = $_tax->calc_tax( $price, $rate, true );\n\t\t\t\t\t\n\t\t\t\t\t$price = $price - $tax_amount;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\tendif;\n\t\t\n\t\tendif;\n\t\t\n\t\treturn $price;\n\t}", "public function deliveryPriceOutDhaka()\n {\n }", "public function getFormattedPriceExcludingTax()\n {\n return $this->formatProductPrice($this->getFinalPrice(false));\n }", "public function replace_price_template() {\r\n\t\tglobal $product;\r\n\t\tif ( WC_Name_Your_Price_Helpers::is_nyp( $product ) && has_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' ) ) {\r\n\r\n\t\t\t// Move price template to before NYP input.\r\n\t\t\tremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );\r\n\t\t\tadd_action( 'woocommerce_before_add_to_cart_form', array( $this, 'display_suggested_price' ) );\r\n\r\n\t\t\t// Restore price template to original.\r\n\t\t\tadd_action( 'woocommerce_after_single_product', array( $this, 'restore_price_template' ) );\r\n\r\n\t\t}\r\n\t}", "public function getFinalPrice()\n {\n return ($this->sale_price > 0) ? $this->sale_price : $this->price;\n }", "public function getTotalPriceWithoutTax() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->totalWithoutTaxPrice;\r\n\t}", "function sale_regular_price_html() {\n\t\t$price = '';\n\t\t\n\t\tif( $this->_apptivo_sale_price <= 0)\n\t\t{\n\t\t\t $price .= 'This product is not ready for sale';\n\t\t\t $price = apply_filters('apptivo_ecommerce_empty_price_html', $price, $this);\n\t\t\t return $price;\t\t\n\t\t}\n\t\t\tif ($this->_apptivo_sale_price) :\n\t\t\t\tif (isset($this->_apptivo_regular_price)) :\n\t\t\t\t if($this->_apptivo_regular_price == '' ) { $this->_apptivo_regular_price = '0.00'; } \t\t\t\t\n\t\t\t\t\t$price .= '<del>'.apptivo_ecommerce_price( $this->_apptivo_regular_price ).'</del> <ins>'.apptivo_ecommerce_price($this->_apptivo_sale_price).'</ins>';\n\t\t\t\t\t$price = apply_filters('apptivo_ecommerce_sale_price_html', $price, $this);\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\telse :\t\n\t\t\t\t $price .= apptivo_ecommerce_price($this->sale_price());\t\t\t\t\t\n\t\t\t\t\t$price = apply_filters('apptivo_ecommerce_price_html', $price, $this);\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\telseif ($this->_apptivo_sale_price === '' ) :\n\t\t\t $price .= 'This product is not ready for sale';\n\t\t\t $price = apply_filters('apptivo_ecommerce_empty_price_html', $price, $this);\t\t\t\t\n\t\t\telseif ($this->_apptivo_sale_price === '0' ) :\t\t\t\n\t\t\t\t$price = __('Free!', 'apptivo_ecommerce'); \n\t\t\t\t$price = apply_filters('apptivo_ecommerce_free_price_html', $price, $this);\n\t\t\t\t\n\t\t\tendif;\n\t\n\t\t\n\t\treturn $price;\n\t}", "function carton_trim_zeros( $price ) {\n\treturn preg_replace( '/' . preg_quote( get_option( 'carton_price_decimal_sep' ), '/' ) . '0++$/', '', $price );\n}", "public function getUnsetSpecialPrice()\n {\n $value = $this->_config->get('general/unset_special_price');\n\n if ($value === null) {\n $value = false;\n }\n\n return (bool)$value && $this->getMode() === 'products';\n }", "public function getDecreasePrice() {\r\n $decrease = Mage::getStoreConfig(\r\n 'giftwrap/general/decrease_price_wrapall');\r\n if (is_numeric($decrease)) {\r\n return $decrease;\r\n } else {\r\n return 0;\r\n }\r\n }", "public function getPrice()\n {\n return '';\n }", "public function setShippingPrice() {\n if ($this->price > 200) {\n $this->shippingPrice = 0;\n }\n }", "static public function emptyCurrencyValue($price)\n {\n //TODO: Make .00 optional, and as many 0 as we want.\n return preg_match('/^[$|£|€]+0\\.00/', $price);\n }", "public function revert_display_after_variable_product() {\r\n\t\twc_deprecated_function( 'WC_Name_Your_Price_Display::revert_display_after_variable_product()', '3.0.0', 'Function replaced by WC_Name_Your_Price_Display::display_variable_price_input().' );\r\n\t\tadd_action( 'woocommerce_before_add_to_cart_button', array( $this, 'display_price_input' ), 9 );\r\n\t\tremove_action( 'woocommerce_single_variation', array( $this, 'display_price_input' ), 12 ); // After WC variation wrap and before Product Add-ons.\r\n\t}", "public function getNewTotalPrice()\n {\n return $this->newTotalPrice instanceof CentPrecisionMoneyBuilder ? $this->newTotalPrice->build() : $this->newTotalPrice;\n }", "public function setDefaultPaxPrice()\n {\n if (!$this->additionalprice) {\n $this->additionalprice = $this->transport ? 25 : $this->price;\n }\n return $this;\n }", "function cfc_edd_remove_decimals( $decimals ) {\n \n\treturn 0;\n}", "public function maybe_update_currency_to_euro() {\n global $wpdb;\n\n $current_version = $this->config->get( 'version' );\n\n // check, if the current version is greater than or equal 0.9.8\n if ( version_compare( $current_version, '0.9.8', '>=' ) ) {\n\n // map old values to new ones\n $meta_key_mapping = array(\n 'Teaser content' => 'laterpay_post_teaser',\n 'Pricing Post' => 'laterpay_post_pricing',\n 'Pricing Post Type' => 'laterpay_post_pricing_type',\n );\n\n $this->logger->info(\n __METHOD__,\n array(\n 'current_version' => $current_version,\n 'meta_key_mapping' => $meta_key_mapping,\n )\n );\n\n // update the currency to default currency 'EUR'\n update_option( 'laterpay_currency', $this->config->get( 'currency.default' ) );\n\n // remove currency table\n $sql = 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'laterpay_currency';\n $wpdb->query( $sql );\n }\n }", "function listing_no_price($id=FALSE)\n\t{\n\t\tglobal $db, $category, $class_tpl, $step;\n\t\t$ccnoprice = 'N';\n\t\tif (!$category) {\n\t\t\t$category = $class_tpl->get_template_vars('category');\n\t\t}\n\t\tif($id) {\n\t\t\t$sSQL = 'SELECT section FROM '.PREFIX.'listings WHERE id='.(int)$id;\n\t\t\t$result=$db->query($sSQL);\n\t\t\t$rs=$result->fetch();\n\t\t\t$id=$rs['section'];\n\t\t\tunset($sSQL);\n\t\t\t$sSQL = 'SELECT ccnoprice FROM '.PREFIX.'categories WHERE id='.(int)$id;\n\t\t\t$result=$db->query($sSQL);\n\t\t\t$rs=$result->fetch();\n\t\t\t$ccnoprice = $rs['ccnoprice'];\n\t\t} elseif($step==3 && $category) {\n\t\t\t$sSQL = 'SELECT ccnoprice FROM '.PREFIX.'categories WHERE id='.(int)$category;\n\t\t\t$result=$db->query($sSQL);\n\t\t\t$rs=$result->fetch();\n\t\t\t$ccnoprice = $rs['ccnoprice'];\n\t\t}\n\n\t\tif($ccnoprice=='Y') {\n\t\t\t$class_tpl->assign('checkoutDisPrice', 'N');\n\t\t}\n\t}", "function product_options_wholesale_price() {\r\n\t\t\twoocommerce_wp_text_input(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'id' => '_wholesale_price',\r\n\t\t\t\t\t'label' => __( 'Wholesale Price', 'woocommerce' ),\r\n\t\t\t\t\t'placeholder' => '',\r\n\t\t\t\t\t'desc_tip' => 'true',\r\n\t\t\t\t\t'description' => __( 'Enter a wholesale price.', 'woocommerce' ),\r\n\t\t\t\t\t'data_type' => 'price'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}", "public function getNetShippingPrice()\n {\n return 0.0;\n }", "public function removeCoupon()\n {\n $this->coupon = null;\n foreach ($this->order_configurations as $config) {\n $config->calculateFinalPrice();\n }\n $this->save();\n }", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function getBasePrice()\n {\n return $this->base_price;\n }", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "public static function onAfterUpdate(ORM\\Event $event): void\n\t{\n\t\tModel\\Price::clearSettings();\n\t}" ]
[ "0.688809", "0.6428428", "0.62119913", "0.6190316", "0.6144962", "0.61442417", "0.6107841", "0.6094542", "0.60480046", "0.60311073", "0.60068697", "0.5951969", "0.59198016", "0.58925414", "0.5856684", "0.5852879", "0.5852456", "0.58501095", "0.58158714", "0.58135825", "0.577321", "0.5755431", "0.5749664", "0.5743102", "0.57361525", "0.57354444", "0.57136077", "0.5711303", "0.5711303", "0.5695831" ]
0.69003254
0
Replace total at the bottom of the checkout page
function cfc_edd_checkout_final_total() { ?> <p id="edd_final_total_wrap"> <strong><?php _e( 'Donation Total:', 'cfctranslation' ); ?></strong> <span class="edd_cart_amount" data-subtotal="<?php echo edd_get_cart_subtotal(); ?>" data-total="<?php echo edd_get_cart_subtotal(); ?>"><?php edd_cart_total(); ?></span> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cfc_edd_replace_final_total() {\n\tremove_action( 'edd_purchase_form_before_submit', 'edd_checkout_final_total', 999 );\n}", "function give_checkout_final_total( $form_id ) {\n\n\t$total = isset( $_POST['give_total'] ) ?\n\t\tapply_filters( 'give_donation_total', give_maybe_sanitize_amount( $_POST['give_total'] ) ) :\n\t\tgive_get_default_form_amount( $form_id );\n\n\t// Only proceed if give_total available.\n\tif ( empty( $total ) ) {\n\t\treturn;\n\t}\n\t?>\n\t<p id=\"give-final-total-wrap\" class=\"form-wrap \">\n\t\t<?php\n\t\t/**\n\t\t * Fires before the donation total label\n\t\t *\n\t\t * @since 2.0.5\n\t\t */\n\t\tdo_action( 'give_donation_final_total_label_before', $form_id );\n\t\t?>\n\t\t<span class=\"give-donation-total-label\">\n\t\t\t<?php echo apply_filters( 'give_donation_total_label', esc_html__( 'Donation Total:', 'give' ) ); ?>\n\t\t</span>\n\t\t<span class=\"give-final-total-amount\"\n\t\t data-total=\"<?php echo give_format_amount( $total, array( 'sanitize' => false ) ); ?>\">\n\t\t\t<?php\n\t\t\techo give_currency_filter(\n\t\t\t\tgive_format_amount(\n\t\t\t\t\t$total, array(\n\t\t\t\t\t\t'sanitize' => false,\n\t\t\t\t\t\t'currency' => give_get_currency( $form_id ),\n\t\t\t\t\t)\n\t\t\t\t), array( 'currency_code' => give_get_currency( $form_id ) )\n\t\t\t);\n\t\t\t?>\n\t\t</span>\n\t\t<?php\n\t\t/**\n\t\t * Fires after the donation final total label\n\t\t *\n\t\t * @since 2.0.5\n\t\t */\n\t\tdo_action( 'give_donation_final_total_label_after', $form_id );\n\t\t?>\n\t</p>\n\t<?php\n}", "function _geneshop_update_total() {\n if (empty($_SESSION['basket']['items'])) {\n unset($_SESSION['basket']);\n }\n elseif (variable_get('geneshop_show_price', FALSE) && variable_get('geneshop_price_field', '')) {\n $sum = 0;\n foreach ($_SESSION['basket']['items'] as $item) {\n $sum += $item['price'];\n }\n $_SESSION['basket']['total_sum'] = $sum;\n }\n}", "public function view_total_payment()\n\t{\n\t\t$data['main_content']='total_payment';\n\t\t$this->load->view('page', $data);\n\t}", "private function setTotalFromData()\n {\n if ($this->dataHasTotal()) {\n $this->collection->items[$this->cart_hash]->total = $this->data['total'];\n $this->collection->increaseTotal($this->data['total']);\n }\n }", "private function update_total_of_cart() {\n\t\t// Get products\n\t\t$products = $this->get_current_products();\n\n\t\t// Loop through and add subtotals\n\t\t$total = 0;\n\t\tforeach ($products as $product) {\n\t\t\t$total += $product[\"subtotal\"];\n\t\t}\n\n\t\t// Check if promo code attached and delete if total drops below minimum amount\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Yes, it does, check to see if still above minimum amount\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 2) {\n\t\t\t\tif ($total < $promo_code->minimum_amount) {\n\t\t\t\t\t$this->remove_promo_code();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update and save\n\t\t$this->cart_total = $total;\n\t\t$this->save();\n\t}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function initTotals() {\n $helper = Mage::helper('cornerdrop_collect');\n\n /** @var Mage_Sales_Block_Order_Totals $parent */\n $parent = $this->getParentBlock();\n $source = $parent->getSource();\n $shipping_address = $source->getShippingAddress();\n if($shipping_address && $helper->isCornerDropAddress($source->getShippingAddress())) {\n $parent->addTotalBefore(\n new Varien_Object(array(\n 'code' => CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT,\n 'value' => $source->getData(CornerDrop_Collect_Helper_Data::CORNERDROP_FEE_AMOUNT),\n 'base_value'=> $source->getData(CornerDrop_Collect_Helper_Data::BASE_CORNERDROP_FEE_AMOUNT),\n 'label' => $helper->getCornerDropFeeLabel()\n )\n ),\n 'shipping'\n );\n }\n }", "public function calculate_cart_total()\r\n\t{\r\n\t\t$cart_total = 0;\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['shipping_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['surcharge_total'];\r\n\t\t$cart_total += (! $this->flexi_cart->cart_prices_inc_tax()) ? $this->flexi->cart_contents['summary']['tax_total'] : 0; \r\n\t\t\r\n\t\t$this->flexi->cart_contents['summary']['total'] = $this->format_calculation($cart_total);\r\n\t\t\t\t\r\n\t\treturn TRUE; \r\n\t}", "private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }", "protected function _setTotal($total = 0){\n\t\t$this->_total = $total;\n\t}", "public function total();", "public function total();", "public function total();", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }", "function dokan_add_to_cart_fragments( $fragment ) {\n $fragment['amount'] = WC()->cart->get_cart_total();\n\n return $fragment;\n}", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "public function setTotal($total)\n {\n $this->total = $total;\n }", "static function displayTotal($a_amount)\n\t{\n\t\techo \"<tr>\\n\";\n\t\techo \"<td></td>\\n\";\n\t\techo \"<td class='exTableTotal'>Total:</td>\\n\";\n\t\techo '<td class=\"exTotal\">$' . $a_amount . \"</td>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function originalTotal(): float\n {\n return $this->content()->sum(fn (CartItem $item) => $item->originalTotal());\n }", "function get_cart_total() {\n\t\t\tif (!$this->prices_include_tax) :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total);\n\t\t\telse :\n\t\t\t\treturn cmdeals_price($this->cart_contents_total + $this->tax_total);\n\t\t\tendif;\n\t\t}", "public function formattedTotal(): string;", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }", "private function getOldTotal()\n {\n return $this->collection->items[$this->cart_hash]->total;\n }", "public function get_total()\n {\n }", "function poco_handheld_footer_bar_cart() {\n ?>\n <a class=\"footer-cart\" href=\"<?php echo esc_url(wc_get_cart_url()); ?>\"\n title=\"<?php esc_attr_e('View your shopping cart', 'poco'); ?>\">\n\t\t\t\t<span\n class=\"count\"><?php echo wp_kses_data(sprintf(_n('%d', '%d', WC()->cart->get_cart_contents_count(), 'poco'), WC()->cart->get_cart_contents_count())); ?></span>\n <span class=\"title\"><?php echo esc_html__('Cart', 'poco'); ?></span>\n </a>\n <?php\n }", "protected function calculateGrandTotal()\n {\n $this->grandTotal = $this->subTotal + $this->gst + $this->unit->securityDeposit;\n }", "public function getNewShippingTotal()\r\n {\r\n $totalItem = 0;\r\n foreach ($this->_getQuote()->getAllVisibleItems() as $item) {\r\n $totalItem += $item->getQty();\r\n }\r\n return $totalItem;\r\n }", "function thb_woocomerce_ajax_cart_update($fragments) {\n\tob_start();\n\t?>\n\t\t<span class=\"float_count\"><?php echo WC()->cart->cart_contents_count; ?></span>\n\t<?php\n\t$fragments['.float_count'] = ob_get_clean();\n\treturn $fragments;\n}" ]
[ "0.7132521", "0.70181906", "0.67041427", "0.63068277", "0.6192923", "0.6184784", "0.61493003", "0.6080056", "0.5956307", "0.5937804", "0.59151644", "0.5896362", "0.5896362", "0.5896362", "0.58667964", "0.58597046", "0.5841471", "0.5837415", "0.583453", "0.5830658", "0.5829643", "0.5824285", "0.5811551", "0.58042675", "0.58013916", "0.5791917", "0.5773435", "0.57678384", "0.57608354", "0.5754876" ]
0.74943095
0
Pobiera wpis w CMS .
public function wpis($id) { return $this->cms::where('id',$id)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function adminContentArea(): void {\n global $security;\n global $media_admin;\n global $media_manager;\n\n // Prepare Query\n if(($absolute = MediaManager::absolute($_GET[\"path\"] ?? DS)) === null) {\n $absolute = PATH_UPLOADS_PAGES;\n $relative = DS;\n } else {\n $relative = MediaManager::relative($absolute);\n }\n\n // Load Main Content Modal\n include \"admin\" . DS . \"modal.php\";\n\n // Load Modals\n \trequire \"admin\" . DS . \"modal-folder.php\";\n if(PAW_MEDIA_PLUS) {\n require \"admin\" . DS . \"modal-search.php\";\n }\n }", "public function wp_content_dir()\n {\n }", "function maincontent() {\n global $pages; /* so the included files know about it */\n\n iceinclude(\"sponsors\", 0);\n \n if (\n in_array(PAGE, $pages) && (\n file_exists(BASEDIR . 'files/' . LANG . '/' . PAGE) ||\n file_exists(BASEDIR . 'files/en/' . PAGE)\n )\n ) {\n icecontent(PAGE);\n } else {\n iceinclude(\"news\", 0);\n }\n}", "function sl_before_content_setup(){\n // start of the main content container\n?>\n <section class=\"site-content\">\n<?php\n}", "function adminHTML($content, $lang, $wisig = false, $se = \"\", $conf = array(), $jQuery = false, $options = array(\"title\" => \"Admin\")){\necho '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\" lang=\".$lang.\">\n\t<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\" />\n\t<title>BackpackCSM &middot; '.$options[\"title\"].'</title>\n\t<link rel=\"icon\" href=\"../favicon.ico\" type=\"image/x-icon\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"admin.css\" />';\n\t\n\tfunction sel($e, $i){\n\t\tif($i==$e){\n\t\treturn ' class=\"selected\"';\n\t\t}\n\t}\n\t\n\tfunction selImg($e,$i){\n\t\tif($i==$e){\n\t\t// return '_sel';\n\t\treturn '';\n\t\t}\n\t}\n\t\n\t// Inclusion de jQuery sur certaines pages (+ scripts perso)\n\tif(is_array($conf) && $jQuery == true){\n\t\techo '<script src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/jquery-1.4.2.min.js\" type=\"text/javascript\"></script>';\n\t\techo '<script src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/BackpackCMS.js\" type=\"text/javascript\"></script>';\n\t}\n\t// Inclusions du WISIG sur certaines pages\n\tif(is_array($conf) && $wisig == true){\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/nice.edit.js\"></script>';\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/tinymce/tiny_mce.js\"></script>';\n\t\techo '<script type=\"text/javascript\" src=\"http://'.$_SERVER[\"SERVER_NAME\"].'/'.$conf[\"install_folder\"].'javascript/WisigEditor.js\"></script>';\n\t}\n\t\n\techo '</head>\n\t<body>\n\t<div id=\"admin-container\">';\n\t\techo '<div id=\"admin-header\">';\n\t\t\t// Inclusion du lien de déconnexion et rappel du login si connect\"\n\t\t\tif($_SESSION[\"valid\"] == true){\n\t\t\t\techo '<div id=\"admin-user\"><span style=\"color:#DFDDD0\">'.$_SESSION[\"login\"].'</span> &middot; <a href=\"logout\">'.tr(\"Déconnexion\").'</a></div>';\n\t\t\t}\n\t\techo '<h1 class=\"admin-title\">BackpackCMS</h1>';\n\t\techo '</div>';\n\t\t\n\t\t$s = '';\n\t\tif($_SESSION['valid'] == true){\n\t\techo '<div id=\"admin-nav-menu\" class=\"admin-nav round\">\n\t\t\t<div class=\"box-title first\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/panel.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Gestion du contenu\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m1\" href=\"index?m=m1\"'.sel($se,'m1').'>'.tr(\"Tableau de bord\").'</a></li>\n\t\t\t\t<li><a id=\"m2\" href=\"pages-new?m=m2\"'.sel($se,'m2').'>'.tr(\"Nouvelle page\").'</a></li>\n\t\t\t\t<li><a id=\"m3\" href=\"pages-manage?m=m3\"'.sel($se,'m3').'>'.tr(\"Gestion de pages\").'</a></li>\n\t\t\t\t<li><a id=\"m7\" href=\"media-uploads?m=m7\"'.sel($se,'m7').'>'.tr(\"Media et images\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/layout.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Apparence\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m5\" href=\"settings?m=m5\"'.sel($se,'m5').'>'.tr(\"Réglages et paramètres\").'</a></li>\n\t\t\t\t<li><a id=\"m10\" href=\"template-edit?m=m10\"'.sel($se,'m10').'>'.tr(\"Modifier l'apparence\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/list.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Administration\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m6\" href=\"accounts?m=m6\"'.sel($se,'m6').'>'.tr(\"Comptes utilisateurs\").'</a></li>\n\t\t\t\t<li><a id=\"m7\" href=\"import-export?m=m11\"'.sel($se,'m11').'>'.tr(\"Importer, exporter\").'</a></li>\n\t\t\t\t<li><a id=\"m8\" href=\"plugins-manage?m=m8\"'.sel($se,'m8').'>'.tr(\"Gestion des extensions\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/eye.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Visusalisation\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table></div>\n\t\t\t<ul>\n\t\t\t\t<li><a id=\"m9\" href=\"../index\"'.sel($se,'m9').' target=\"_target\">'.tr(\"Voir le site\").'</a></li>\n\t\t\t</ul>\n\t\t\t\n\t\t\t<div class=\"box-title\">\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t\t<td><img src=\"img/help.png\" width=\"16\" height=\"16\" align=\"left\" alt=\"Content Image\" /></td>\n\t\t\t\t\t<td>'.tr(\"Autres liens\").'</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<ul>\n\t\t\t\t<li><a href=\"SpecialArnosteo.php\">Pense-bête</a></li>\n\t\t\t\t<li><a href=\"https://sites.google.com/site/backpackcmsaide/presentation/modifier-le-theme\" target=\"_blank\">Modifier l\\'apparence</a></li>\n\t\t\t\t<li><a href=\"https://sites.google.com/site/backpackcmsaide/presentation/sauvegarder-son-site\" target=\"_blank\">Sauvegarder mon site</a></li>\n\t\t\t</ul>\n\t\t</div>';\n\t\t\n\t\t// Enlève la marge admin content\n\t\t} else {\n\t\t\t$st = ' style=\"margin-left:0px;\"';\n\t\t}\n\t\n\techo '<div id=\"admin-content\"'.$st.'>'.$content.'</div>';\n\t\n\techo '<div class=\"clear\"></div>';\n\techo '<br />';\n\t// echo '<div id=\"admin-footer\">&copy; Copyright 2011 BackpackCMS | <a href=\"logout\">Déconnexion</a> | <a href=\"http://backpackcms.honeyshare.fr/bug\">Déclarer un bug</a></div>';\necho '</div>\n</body>\n</html>';\n}", "function wpms_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'wpms_classifieds_build_permissions' );\n//\tif (isset($_GET['page']) && $_GET['page'] == 'settings_page_wp-multilingual-slider') {\n// \t add_action('admin_init', 'wpms_register');\n//\t}\n\tadd_action('admin_init', 'wpms_init');\n\tadd_action('admin_init', 'wpms_register_mysettings');\n\tadd_action('admin_menu', 'wpms_home_create_menu');\n//\tload_plugin_textdomain( 'wp-multilingual-slider', 'wp-content/plugins/wp-multilingual-slider/languages/');\n}", "public function indexTypo3PageContent() {}", "function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}", "public function createContentAndCopyLivePage() {}", "function sparcwp_setup() {\n global $cap, $content_width;\n\n // This theme styles the visual editor with editor-style.css to match the theme style.\n add_editor_style();\n\n if ( function_exists( 'add_theme_support' ) ) {\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t*/\n\t\tadd_theme_support( 'automatic-feed-links' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Thumbnails on posts and pages\n\t\t *\n\t\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t\t*/\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Formats\n\t\t*/\n\t\tadd_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );\n\t\t\n\t\t/**\n\t\t * Setup the WordPress core custom background feature.\n\t\t*/\n\t\tadd_theme_support( 'custom-background', apply_filters( 'sparcwp_custom_background_args', array(\n\t\t\t'default-color' => 'ffffff',\n\t\t\t'default-image' => '',\n\t\t) ) );\n\t\n }\n\n\n\t/**\n\t * This theme uses wp_nav_menu() in one location.\n\t*/ \n register_nav_menus(\n array(\n 'primary' => 'Main Menu',\n 'footer_menu' => 'Footer Menu'\n )\n );\n\n}", "public static function _setup(){\n\t\t$pathinfo = pathinfo(__FILE__);\n\t\t\n\t\tself::$is_mu = is_multisite();\n\t\tself::$possible = self::getUrls( TRUE );\n\t\t\n\t\tself::$baseurl = is_ssl() ? 'https://'.$_SERVER['HTTP_HOST'] : 'http://'.$_SERVER['HTTP_HOST'];\n\t\tself::$cwd = $pathinfo['dirname'];\n\t\t\n\t\t// sorry if this is confusing, some servers (media temple) have strangeness using $_SERVER['DOCUMENT_ROOT']\n\t\t// @TODO make sure second line works on MT\n\t\t//self::$path = self::_site_url_absolute(WP_PLUGIN_URL).'/'.basename( $pathinfo['dirname'] ).'/';\n\t\tself::$path = self::_site_url_absolute( str_replace(ABSPATH, '/', dirname(__FILE__)) ).'/';\n\t\t\n\t\t// these can return back urls starting with /\n\t\tadd_filter( 'bloginfo', 'AitchRef::_site_url' );\n\t\tadd_filter( 'bloginfo_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'content_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'get_pagenum_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'option_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'plugins_url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'pre_post_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'script_loader_src', 'AitchRef::_site_url' );\n\t\tadd_filter( 'style_loader_src', 'AitchRef::_site_url' );\n\t\tadd_filter( 'term_link', 'AitchRef::_site_url' );\n\t\tadd_filter( 'the_content', 'AitchRef::_site_url' );\n\t\tadd_filter( 'upload_dir', 'AitchRef::_site_url' );\n\t\tadd_filter( 'url', 'AitchRef::_site_url' );\n\t\tadd_filter( 'wp_list_pages', 'AitchRef::_site_url' );\n\t\t\n\t\t// these need to return back with leading http://\n\t\tadd_filter( 'admin_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'get_permalink', 'AitchRef::_site_url_absolute' ); \n\t\tadd_filter( 'home_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'login_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'option_home', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'option_siteurl', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'page_link', 'AitchRef::_site_url_absolute' ); \n\t\tadd_filter( 'post_link', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'siteurl', 'AitchRef::_site_url_absolute' );\t// ಠ_ಠ DEPRECATED\n\t\tadd_filter( 'site_url', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'stylesheet_uri', 'AitchRef::_site_url_absolute' );\n\t\tadd_filter( 'template_directory_uri', 'AitchRef::_site_url_absolute' );\t\n\t\tadd_filter( 'wp_get_attachment_url', 'AitchRef::_site_url_absolute' );\n\t\t\n\t\t// admin\n\t\tif( !is_admin() )\n\t\t\treturn;\n\t\t\t\n\t\tadd_action( 'admin_menu', 'AitchRef::_admin_menu' );\n\t\tadd_filter( 'plugin_action_links_'.plugin_basename(__FILE__), 'AitchRef::_admin_plugins' );\n\t}", "public static function wpInit() {}", "function poco_before_content() {\n echo <<<HTML\n<div id=\"primary\" class=\"content-area\">\n <main id=\"main\" class=\"site-main\" role=\"main\">\nHTML;\n\n }", "function install_site() {\n \n}", "function bw_setup()\n {\n add_theme_support('post-thumbnails'); \n\n //add theme support - custom logo\n add_theme_support( 'custom-logo', array(\n 'height' => 40\n ));\n\n //register menus\n register_nav_menus(array(\n 'primary-menu' => __('Primary'),\n 'footer-menu' => __('Footer'),\n 'social-menu' => __('Social')\n ));\n\n //set the permalink structure\n global $wp_rewrite;\n $wp_rewrite->set_permalink_structure( '/%postname%/');\n\n //create pages\n if (isset($_GET['activated']) && is_admin()){\n $pages = array(\n array('title' => 'Home'),\n array('title' => 'Shop'),\n array('title' => 'Our Story'),\n array('title' => 'Blog'),\n array('title' => 'Contact')\n );\n foreach($pages as $page){\n create_page($page['title']);\n }\n \n } \n }", "function genesis_simple_share_init() {\n\n\t/** Load textdomain for translation */\n load_plugin_textdomain( 'genesis-simple-share', false, basename( dirname( __FILE__ ) ) . '/languages/' );\n\t\t\n\tif( is_admin() && class_exists( 'Genesis_Admin_Boxes' ) ) {\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'admin.php' );\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'post-meta.php' );\n\t}\n\telse\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'front-end.php' );\n\t\t\n\t//require_once( GENESIS_SIMPLE_SHArE_LIB . 'functions.php' );\n\n}", "function mantis_publisher_footer()\n{\n\t$site = get_option('mantis_site_id');\n\n\tif (!$site) {\n\t\treturn;\n\t}\n\n\trequire(dirname(__FILE__) . '/html/publisher/config.php');\n\n\trequire(dirname(__FILE__) . '/html/publisher/styling.php');\n\n\tif (get_option('mantis_async')) {\n\t\trequire(dirname(__FILE__) . '/html/publisher/async.html');\n\t} else {\n\t\trequire(dirname(__FILE__) . '/html/publisher/sync.html');\n\t}\n}", "function WPLMS_plugin_init()\n{\n // Load translation support\n $domain = 'wp_lms'; // This is the translation locale.\n\n // Check the WordPress language directory for /wp-content/languages/wp_lms/wp_lms-en_US.mo first\n $locale = apply_filters('plugin_locale', get_locale(), $domain);\n load_textdomain($domain, WP_LANG_DIR . '/wp_lms/' . $domain . '-' . $locale . '.mo');\n\n // Then load the plugin version\n load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/language/');\n\n // Run setup\n WPLMS_plugin_setup(false);\n\n // ### Admin\n if (is_admin()) {\n // Menus\n add_action('admin_menu', 'WPLMS_menu_MainMenu');\n add_action('admin_menu', 'WPLMS_excludeFromMenu');\n }else{\n\n }\n\n //Admin Scripts\n add_action('admin_enqueue_scripts', 'WPLMS_adminScripts');\n\n //AJAX calls\n add_action('wp_ajax_add_new_user_course', 'WPLMS_add_new_user_course');\n\n //ShortCodes\n add_shortcode('lms_course_info', 'WPLMS_courseInfo');\n add_shortcode('lms_choose_product', 'WPLMS_chooseProduct');\n add_shortcode('lms_shopping_cart', 'WPLMS_shoppingCart');\n add_shortcode('lms_checkout', 'WPLMS_checkout');\n add_shortcode('lms_lessons', 'WPLMS_lessons');\n add_shortcode('lms_mycourses', 'WPLMS_mycourses');\n\tadd_shortcode('lms_quiz', 'WPLMS_quiz');\n\n\n\t//add_shortcode('process_product_page', 'process_product_page_shortcode');\n}", "function GaotaiDiviTheme_setup() {\n\t// Add post format support\n\tadd_theme_support('post-formats', array('chat', 'link', 'aside', 'image', 'video', 'gallery'));\n\t// Divi child theme 中文化\n\tload_child_theme_textdomain('Divi', get_stylesheet_directory().'/lang');\n\tload_child_theme_textdomain('et_builder', get_stylesheet_directory().'/includes/builder/languages');\n}", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "function roots_setup() {\n\n // Make theme available for translation\n load_theme_textdomain('roots', get_template_directory() . '/lang');\n\n // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)\n register_nav_menus(array(\n 'top_navigation' => __('Top Navigation', 'cpo'),\n 'front_buttons' => __('Front Buttons', 'cpo'),\n 'sioc_projects' => __('SIOC Navigation', 'cpo'),\n 'src_projects' => __('SRC Navigation', 'cpo'),\n 'fitted' => __('[FITTED] Navigation', 'cpo'),\n 'cposa_education_projects' => __('CPOSA Education Navigation', 'cpo'),\n 'cposa_health_projects' => __('CPOSA Health Navigation', 'cpo'),\n 'cposa_justice_projects' => __('CPOSA Social Justice Navigation', 'cpo'),\n 'srec_projects' => __('SREC Navigation', 'cpo'),\n 'cpo_nav' => __('Inner page navigation', 'cpo'),\n ));\n\n // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)\n add_theme_support('post-thumbnails');\n // set_post_thumbnail_size(150, 150, false);\n add_image_size('project-pic', 870, 9999); // 300px wide (and unlimited height)\n add_image_size('slider', 450, 350, true); // 300px wide (and unlimited height)\n\n\n // Add post formats (http://codex.wordpress.org/Post_Formats)\n // add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));\n\n // Tell the TinyMCE editor to use a custom stylesheet\n add_editor_style('css/editor-style.css');\n\n}", "function sunrise_theme_create_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "function getCmsHtml($rubrique_id=0, $element_id=0, $element_langue='') {\r\n\r\n\tglobal $WWW, $wwwRoot, $selfDir, $rep, $langues;\r\n\tif (empty($element_langue)) $element_langue = $langues[0];\r\n\r\n\tif ($element_id > 0) $E =& new Q(\"SELECT * FROM cms_pages_elements WHERE id='$element_id' AND langue='$element_langue' LIMIT 1\");\r\n\telse if ($rubrique_id > 0) $E =& new Q(\"SELECT * FROM cms_pages_elements WHERE pid='$rubrique_id' AND langue='$element_langue' ORDER BY ordre ASC\");\r\n\telse return '';\r\n\t\r\n\t$elements_type = getElementsType();\r\n\t### db($elements_type);\r\n\r\n\t$elements_html = '';\r\n\t$fileDir = $rep.'bibliotheque/';\r\n\t\r\n\t// Valeurs à protéger car fonction SANITIZE() sur tous les INPUTS mais valeur permise dans les templates\r\n\t$arr_replace = array(\r\n\t\t'#script#'=> '<script type=\"text/javascript\">',\r\n\t\t'#/script#'=> '</script>',\r\n\t\t'#iframe#'=> '<iframe',\r\n\t\t'#/iframe#'=> '</iframe>',\r\n\t\t'#object#'=> '<object',\r\n\t\t'#/object#'=> '</object>',\r\n\t\t'#embed#'=> '<embed',\r\n\t\t'#/embed#'=> '</embed>',\r\n\t);\r\n\t\t\t\t\t\r\n\t$errors = array();\r\n\t$eval_errors_type_id = false;\r\n $orig_hndl = set_error_handler('error_hndl');\r\n\t\r\n\tforeach((array)$E->V as $V) { // Pour chaque Element\r\n\t\t\r\n\t\tif ($element_id < 1 && $rubrique_id > 0 && $V['actif'] == 0) continue; // N'affiche pas les element inactif en mode page\r\n\t\t\r\n\t\t$array_ensembles = parseAbstractString($elements_type[$V['type_id']]['valeurs']);\r\n\t\t### db($array_ensembles ,'$array_ensembles');\r\n\t\t\r\n\t\t$array_valeurs = cleanUnserial($V['valeurs']);\r\n\t\t### db($array_valeurs ,'$array_valeurs');\r\n\t\t\r\n\t\t$arr_template = $elements_type[$V['type_id']]['template'];\r\n\t\t### db('$arr_template :', $arr_template);\r\n\t\t\r\n\t\t\r\n\t\t$empty = false; // Si fichier ou images absente n'affiche pas l'element\r\n\t\t$elements_empty = '';\r\n\t\t\r\n\t\tforeach((array)$array_ensembles as $i=>$array_ensemble) { // Ensembles de valeurs d'element\r\n\t\t\r\n\t\t\tif ($array_ensemble['ensemble'] == 'item') {\r\n\t\t\t\t\r\n\t\t\t\t### db($array_ensemble['valeurs']);\r\n\t\t\t\t\r\n\t\t\t\tforeach((array)$array_ensemble['valeurs'] as $i=>$element_item) { // Valeur d'un ensemble\r\n\t\t\t\t\t\r\n\t\t\t\t\t$unique_id = generateId('element');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$required = substr($element_item['titre'], -1);\r\n\t\t\t\t\tif ($empty != true) $empty = (empty($array_valeurs[$element_item['nom']]) && $required == '*' ? true : false ); // Si 1 seul element requis est vide, empty = true\r\n\r\n\t\t\t\t\tif (empty($array_valeurs[$element_item['nom']]) && $required == '*' && strpos($selfDir,'/admin/') !== false) {\r\n\t\t\t\t\t\t$elements_empty .= '<br /><h2 align=\"center\">ATTENTION &eacute;l&eacute;ment manquant : '.htmlentities($element_item['titre']).'</h2><br />';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tswitch($element_item['type']) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'image' :\r\n\r\n\t\t\t\t\t\t\t// Attention : $array_valeurs[$element_item['nom']] stock l'ID de l'image\r\n\t\t\t\t\t\t\t$array_valeurs[$element_item['nom']] = fetchValues('image', 'dat_bibliotheque_images', 'id', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementName = $element_item['nom'];\r\n\t\t\t\t\t\t\t$$elementName = $array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameSrc = $element_item['nom'].'_src';\r\n\t\t\t\t\t\t\t$$elementNameSrc = $WWW.$fileDir.$array_valeurs[$element_item['nom'].'_taille'].'/'.$array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameGde = $element_item['nom'].'_grande';\r\n\t\t\t\t\t\t\t$$elementNameGde = $WWW.$fileDir.'pop/'.$array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameTitre = $element_item['nom'].'_titre';\r\n\t\t\t\t\t\t\t$$elementNameTitre = affCleanName($array_valeurs[$element_item['nom']], 1);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameLegende = $element_item['nom'].'_legende';\r\n\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_legende'] == 1)\r\n\t\t\t\t\t\t\t\t$$elementNameLegende = fetchValues('legende_'.$element_langue, 'dat_bibliotheque_images', 'image', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\telse $$elementNameLegende = '';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNamePopup = $element_item['nom'].'_popup';\r\n\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_popup'] == 1) $$elementNamePopup = 1;\r\n\t\t\t\t\t\t\telse $$elementNamePopup = '';\r\n\r\n\t\t\t\t\t\t\t$elementNameCredits = $element_item['nom'].'_credits';\r\n\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_credits'] == 1)\r\n\t\t\t\t\t\t\t\t$$elementNameCredits = fetchValues('credits_'.$element_langue, 'dat_bibliotheque_images', 'image', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\telse $$elementNameCredits = '';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameAuteur = $element_item['nom'].'_auteur';\r\n\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_auteur'] == 1)\r\n\t\t\t\t\t\t\t\t$$elementNameAuteur = fetchValues('auteur', 'dat_bibliotheque_images', 'image', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\telse $$elementNameAuteur = '';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameDate = $element_item['nom'].'_date';\r\n\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_date'] == 1)\r\n\t\t\t\t\t\t\t\t$$elementNameDate = fetchValues('date', 'dat_bibliotheque_images', 'image', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\telse $$elementNameDate = '';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'fichier' :\r\n\r\n\t\t\t\t\t\t\t// Attention : $array_valeurs[$element_item['nom']] stock l'ID du fichier\r\n\t\t\t\t\t\t\t$array_valeurs[$element_item['nom']] = fetchValues('fichier', 'dat_bibliotheque_fichiers', 'id', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementName = $element_item['nom'];\r\n\t\t\t\t\t\t\t$$elementName = $array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameSrc = $element_item['nom'].'_src';\r\n\t\t\t\t\t\t\t$$elementNameSrc = $WWW.$fileDir.$array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameTitre = $element_item['nom'].'_titre';\r\n\t\t\t\t\t\t\t$$elementNameTitre = fetchValues('titre_'.$element_langue, 'dat_bibliotheque_fichiers', 'fichier', $array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\tif (empty($$elementNameTitre)) $$elementNameTitre = affCleanName($array_valeurs[$element_item['nom']], 1);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameExt = $element_item['nom'].'_ext';\r\n\t\t\t\t\t\t\t$$elementNameExt = getExt($array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$elementNameSize = $element_item['nom'].'_size';\r\n\t\t\t\t\t\t\t$$elementNameSize = cleanKo(filesize($wwwRoot.$fileDir.$array_valeurs[$element_item['nom']]));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'textarea' :\r\n\t\t\t\t\t\t\t$$element_item['nom'] = ($element_item['titre'] == 'Code' ? $array_valeurs[$element_item['nom']] : nl2br($array_valeurs[$element_item['nom']]));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\tif ($element_item['type'] == 'text') $$element_item['nom'] = htmlentities($array_valeurs[$element_item['nom']]);\r\n\t\t\t\t\t\t\telse $$element_item['nom'] = $array_valeurs[$element_item['nom']];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!$empty && !empty($elements_type[$V['type_id']]['valeurs'])) {\t\r\n\t\t\t\t\t$arr_template = stripslashes($arr_template);\r\n\t\t\t\t\t$arr_template = str_replace(array_keys($arr_replace), array_values($arr_replace), $arr_template);\r\n\t\t\t\t\tif (@eval('$html = \\''.$arr_template.'\\';') === false) $eval_errors_type_id = $V['type_id'];\r\n\t\t\t\t\telse $elements_html .= \"\\n\".$html; ### db($html);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t### db($array_ensemble['valeurs']);\r\n\t\t\t\tforeach((array)$array_ensemble['valeurs'] as $i=>$element_item) { // Valeur d'un ensemble\r\n\t\t\t\t\t\r\n\t\t\t\t\t$unique_id = generateId('element');\r\n\t\t\t\t\t$required = substr($element_item['titre'], -1);\r\n\r\n\t\t\t\t\tswitch($element_item['type']) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'image' :\r\n\t\t\t\t\t\t\t$arr_tmp = array();\r\n\t\t\t\t\t\t\tforeach((array)$array_valeurs[$element_item['nom']] as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif ($empty != true) $empty = (empty($val) && $required == '*' ? true : false ); // Si 1 seul element requis est vide, empty = true\r\n\t\t\t\t\t\t\t\tif (empty($val) && $required == '*' && strpos($selfDir,'/admin/') !== false) {\r\n\t\t\t\t\t\t\t\t\t$elements_empty .= '<br /><h2 align=\"center\">ATTENTION &eacute;l&eacute;ment manquant : '.htmlentities($element_item['titre']).'</h2><br />';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// Attention : $array_valeurs[$element_item['nom']] stock l'ID du fichier\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom']] = fetchValues('image', 'dat_bibliotheque_images', 'id', $val);\r\n\t\t\t\t\t\t\t\tif (!@is_file($wwwRoot.$fileDir.$arr_tmp[$key][$element_item['nom']])) continue;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_src'] = $WWW.$fileDir.$array_valeurs[$element_item['nom'].'_taille'][$key].'/'.$arr_tmp[$key][$element_item['nom']];\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_grande'] = $WWW.$fileDir.'pop/'.$arr_tmp[$key][$element_item['nom']];\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_titre'] = affCleanName($arr_tmp[$key][$element_item['nom']], 1);\r\n\r\n\t\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_legende'][$key] == 1)\r\n\t\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_legende'] = htmlentities(fetchValues('legende_'.$element_langue, 'dat_bibliotheque_images', 'id', $val));\r\n\t\t\t\t\t\t\t\telse $arr_tmp[$key][$element_item['nom'].'_legende'] = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_popup'][$key] == 1) $popup = 1;\r\n\t\t\t\t\t\t\t\telse $popup = '';\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_credits'][$key] == 1)\r\n\t\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_credits'] = htmlentities(fetchValues('credits_'.$element_langue, 'dat_bibliotheque_images', 'id', $val));\r\n\t\t\t\t\t\t\t\telse $arr_tmp[$key][$element_item['nom'].'_credits'] = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_auteur'][$key] == 1)\r\n\t\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_auteur'] = htmlentities(fetchValues('auteur', 'dat_bibliotheque_images', 'id', $val));\r\n\t\t\t\t\t\t\t\telse $arr_tmp[$key][$element_item['nom'].'_auteur'] = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($array_valeurs[$element_item['nom'].'_date'][$key] == 1)\r\n\t\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_date'] = rDate(fetchValues('date', 'dat_bibliotheque_images', 'id', $val));\r\n\t\t\t\t\t\t\t\telse $arr_tmp[$key][$element_item['nom'].'_date'] = '';\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$valeur_name = $element_item['nom'].'s';\r\n\t\t\t\t\t\t\t$$valeur_name = $arr_tmp;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase 'fichier' :\r\n\t\t\t\t\t\t\t$arr_tmp = array();\r\n\t\t\t\t\t\t\tforeach((array)$array_valeurs[$element_item['nom']] as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif ($empty != true) $empty = (empty($val) && $required == '*' ? true : false ); // Si 1 seul element requis est vide, empty = true\r\n\t\t\t\t\t\t\t\tif (empty($val) && $required == '*' && strpos($selfDir,'/admin/') !== false) {\r\n\t\t\t\t\t\t\t\t\t$elements_empty .= '<br /><h2 align=\"center\">ATTENTION &eacute;l&eacute;ment manquant : '.htmlentities($element_item['titre']).'</h2><br />';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// Attention : $array_valeurs[$element_item['nom']] stock l'ID du fichier\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom']] = fetchValues('fichier', 'dat_bibliotheque_fichiers', 'id', $val);\r\n\t\t\t\t\t\t\t\tif (!@is_file($wwwRoot.$fileDir.$arr_tmp[$key][$element_item['nom']])) continue;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_src'] = $WWW.$fileDir.$arr_tmp[$key][$element_item['nom']];\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_titre'] = htmlentities(fetchValues('titre_'.$element_langue, 'dat_bibliotheque_fichiers', 'id', $val));\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_ext'] = getExt($arr_tmp[$key][$element_item['nom']]);\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom'].'_size'] = cleanKo(filesize($wwwRoot.$fileDir.$arr_tmp[$key][$element_item['nom']]));\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$valeur_name = $element_item['nom'].'s';\r\n\t\t\t\t\t\t\t$$valeur_name = $arr_tmp;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'textarea' :\r\n\t\t\t\t\t\t\t$arr_tmp = array();\r\n\t\t\t\t\t\t\tforeach((array)$array_valeurs[$element_item['nom']] as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif ($empty != true) $empty = (empty($val) && $required == '*' ? true : false ); // Si 1 seul element requis est vide, empty = true\r\n\t\t\t\t\t\t\t\tif (empty($val) && strpos($selfDir,'/admin/') !== false) {\r\n\t\t\t\t\t\t\t\t\t$elements_empty .= '<br /><h2 align=\"center\">ATTENTION &eacute;l&eacute;ment manquant : '.htmlentities($element_item['titre']).'</h2><br />';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom']] = ($element_item['titre'] == 'Code' ? $val : nl2br($val));\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$valeur_name = $element_item['nom'].'s';\r\n\t\t\t\t\t\t\t$$valeur_name = $arr_tmp;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t$arr_tmp = array();\r\n\t\t\t\t\t\t\tforeach((array)$array_valeurs[$element_item['nom']] as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif ($empty != true) $empty = (empty($val) && $required == '*' ? true : false ); // Si 1 seul element requis est vide, empty = true\r\n\t\t\t\t\t\t\t\tif (empty($val) && $required == '*' && strpos($selfDir,'/admin/') !== false) {\r\n\t\t\t\t\t\t\t\t\t$elements_empty .= '<br /><h2 align=\"center\">ATTENTION &eacute;l&eacute;ment manquant : '.htmlentities($element_item['titre']).'</h2><br />';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$arr_tmp[$key][$element_item['nom']] = $val;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t$valeur_name = $element_item['nom'].'s';\r\n\r\n\t\t\t\t\t\t\tif ($element_item['type'] == 'text') $$valeur_name = html_array($arr_tmp);\r\n\t\t\t\t\t\t\telse $$valeur_name = $arr_tmp;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!$empty || empty($elements_type[$V['type_id']]['valeurs'])) {\r\n\t\t\t\t\t$arr_template = stripslashes($arr_template);\r\n\t\t\t\t\t$arr_template = str_replace(array_keys($arr_replace), array_values($arr_replace), $arr_template);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (@eval('$html = \\''.$arr_template.'\\';') === false) $eval_errors_type_id = $V['type_id'];\r\n\t\t\t\t\telse $elements_html .= \"\\n\".$html; ### db($html);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\trestore_error_handler();\r\n\t\r\n\t$html = '';\r\n\t\r\n\tif (!empty($elements_empty)) $html .= $elements_empty;\r\n\r\n\tif ($eval_errors_type_id) {\r\n\t\tglobal $errors;\r\n\t\t$html .= '<p align=\"center\"><br /><strong>Error while evaluating check your &eacute;l&eacute;ment type (ID '.$eval_errors_type_id.')</strong><br />&nbsp;</p>';\r\n\t\t$html .= getDb($errors, 'Php error');\r\n\t\t$html .= getDb(stripslashes($arr_template), 'Template code');\r\n\t\t$html .= getDb(getVars(get_defined_vars()));\r\n\t}\r\n\telse if (!empty($elements_html)) {\r\n\t\t\r\n\t\t//if (strpos($selfDir,'/admin/') !== false)\r\n\t\t//$elements_html = str_replace('class=\"lightwindow\"','class=\"lightwindow_iframe_link\"', $elements_html);\r\n\t\t//db($elements_html);\r\n\t\t\r\n\t\t$html .= '<div id=\"cms\">';\r\n\t\t$html .= $elements_html;\r\n\t\t$html .= '</div>';\r\n\t}\r\n\r\n\treturn $html;\r\n}", "function theme_doc()\n{\n\tinclude(\"admin/admin-shortcodes.php\");\n}", "function intromvc()\n {\n $data['$option'] = \"doc/intromvc\";\n $this->loadContent('doc/home', $data);\n }", "public function moveContentAndCopyLivePage() {}", "public function wpide() {\r\n\t\t$this->__construct();\r\n\t}", "public function update_cms($post){\r\n\t\t$data = array(\r\n 'cont_title' => $post['cont_title'],\r\n 'pagename' => $post['pagename'],\r\n\t\t\t 'contents' => htmlentities($post['contents']),\r\n\t\t\t 'meta_title' => $post['meta_title'],\r\n\t\t\t 'meta_desc' => $post['meta_desc'],\r\n\t\t\t 'meta_keys' => $post['meta_keys'],\r\n\t\t\t 'status' => $post['status']);\r\n\t\t$this->db->where('id', $post['id']);\r\n\t\treturn $this->db->update('content', $data); \r\n\t}", "function xgb_published_articles_by_you_submenu_page() {\n\t\trequire_once( plugin_dir_path(__FILE__) . \"published-articles-by-you.php\" );\n\t}", "function getting_start_content(){\n\n\t\t\t\t$options = apply_filters('gdlr_core_getting_start_option', array(), $this->settings['slug']);\n\n\t\t\t\techo '<div class=\"gdlr-core-getting-start-wrap clearfix\" >';\n\t\t\t\t$this->get_header($options['header']);\n\n\t\t\t\t$this->get_content($options['content']);\n\t\t\t\techo '</div>'; // gdlr-core-getting-start-wrap\n\n\t\t\t\tif( isset($_GET['phpinfo']) ) print_r( phpinfo() );\n\t\t\t}" ]
[ "0.61392695", "0.6074417", "0.6037293", "0.597287", "0.590437", "0.5903662", "0.58680284", "0.58441246", "0.583171", "0.57922524", "0.5769006", "0.57507974", "0.5749117", "0.5740606", "0.5734535", "0.5730453", "0.57228154", "0.57116824", "0.5705009", "0.57040876", "0.5702374", "0.5701187", "0.5695484", "0.5682737", "0.56363577", "0.56362337", "0.5635722", "0.5634784", "0.5629922", "0.56271315" ]
0.6093142
1
The index method render the resolve of the searching. If the 'word' is empty or the found journals is not global them the it renders the Searching form
public function index(){ $user_id = Authcomponent::user('id'); $word = $this->request->data['Search']['word']; $this->set('word', $word); $this->loadAditionalCss('bootstrap.components.alert'); if(!empty($this->data)){ //Who is performing the search $this->Search->setLoggedUser($this->objLoggedUser); $arrTmpJournals = $this->Search->findJournals($word); if(count($arrTmpJournals) == 0){ $this->render('search_form'); return false; } $arrMyJournals = $arrTmpJournals['arrMyJournals']; $arrGlobalJournals = $arrTmpJournals['arrGlobalJournals']; $this->set('arrMyJournals',$arrMyJournals); $this->set('arrGlobalJournals',$arrGlobalJournals); $this->render('index'); } else{ $this->set('word', ''); $this->render('search_form'); } //$this->loadAditionalCss('users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "public function showSearch()\n\t{\n\t\t$languages = WordLanguage::all();\n\t\t$types = WordType::all();\n\n\t\treturn view('search.index', compact('languages', 'types'));\n\t}", "public function searchAction(){\n $string = filter_input(INPUT_GET, 'string', FILTER_SANITIZE_STRING);\n $word = new Word();\n if(!empty($string)){\n print json_encode($word->search($string));\n }else{\n print json_encode($word->limitWords(20));\n }\n }", "public function search()\n {\n // Start calculating the execution time.\n $start = microtime(true);\n\n $query = Document::sanitize(Input::get('query'));\n\n // Validate the input.\n $validator = Validator::make([\n 'query' => $query,\n ], [\n 'query' => 'required|min:4'\n ]);\n\n // Check the validation.\n if ($validator->fails())\n {\n return Redirect::home()->with('error_message', 'الرجاء إدخال كلمة البحث و التي لا تقل عن 3 أحرف.');\n }\n\n // Other than that, everything is great.\n // TODO: Maybe rank them then order them by the ranking.\n $results = Document::whereRaw('MATCH(title, content) AGAINST(?)', [$query])->get();\n\n if ($results->count() == 0)\n {\n return Redirect::home()->with('warning_message', 'لم يتم العثور على نتائج لبحثك.');\n }\n\n $keywords = explode(' ', $query);\n\n $finish = microtime(true);\n\n $taken_time = round(($finish-$start), 3);\n\n // If there is at least one result, show it.\n return View::make('pages.search')->with(compact('results', 'query', 'keywords', 'taken_time'));\n }", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "public function search()\n {\n // General for all pages\n $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get();\n // General END\n $search_word = \"\";\n $active_tab = 0;\n return view('backEnd.search', compact(\"GeneralWebmasterSections\", \"search_word\", \"active_tab\"));\n }", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "public function searchAction(){\r\n \t$request = $this->getRequest();\r\n \t$q = $request->query->get('q');\r\n \tif(trim($q) == null || trim($q) == \"Encontre cupons de compra coletiva\"){\r\n \t\treturn $this->redirectFlash($this->generateUrl('aggregator_aggregator_index'), 'Digite um termo para a busca', 'error');\r\n \t}\r\n \t$ret['q'] = $q;\r\n \t$ret['breadcrumbs'][]['title'] = 'Resultado da busca por \"'.$q.'\" em '.$this->get('session')->get('reurbano.user.cityName');\r\n \treturn $ret;\r\n }", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "public function action_search()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// What can we search for?\n\t\t$subActions = array(\n\t\t\t'internal' => array($this, 'action_search_internal', 'permission' => 'admin_forum'),\n\t\t\t'online' => array($this, 'action_search_doc', 'permission' => 'admin_forum'),\n\t\t\t'member' => array($this, 'action_search_member', 'permission' => 'admin_forum'),\n\t\t);\n\n\t\t// Set the subaction\n\t\t$action = new Action('admin_search');\n\t\t$subAction = $action->initialize($subActions, 'internal');\n\n\t\t// Keep track of what the admin wants in terms of advanced or not\n\t\tif (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $subAction)\n\t\t{\n\t\t\t$context['admin_preferences']['sb'] = $subAction;\n\n\t\t\t// Update the preferences.\n\t\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\t\t\tupdateAdminPreferences();\n\t\t}\n\n\t\t// Setup for the template\n\t\t$context['search_type'] = $subAction;\n\t\t$context['search_term'] = $this->_req->getPost('search_term', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars[ENT_QUOTES]');\n\t\t$context['sub_template'] = 'admin_search_results';\n\t\t$context['page_title'] = $txt['admin_search_results'];\n\n\t\t// You did remember to enter something to search for, otherwise its easy\n\t\tif ($context['search_term'] === '')\n\t\t{\n\t\t\t$context['search_results'] = array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action->dispatch($subAction);\n\t\t}\n\t}", "public function searchAction(){\t\t\n\t\t\t// startup: get translater and create windowTitel\t\t\t\t \n\t\t\t$translate = $this->_owApp->translate;\n $windowTitle = $translate->_('Search results');\n $this->view->placeholder('main.window.title')->set($windowTitle);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// get search string from input field (searchbox.phtml)\n\t\t\t$nameOfPerson = $this->getParam('nameOfPerson');\n\t\t\t\t\t\t\n\t\t\tif (!empty($nameOfPerson)){\n\t\t\t\t// create query\n\t\t\t\t$query = new Erfurt_Sparql_SimpleQuery(); \n\t\t\t\t$query->setProloguePart('SELECT ?resourceUri ?Name ?yearOfBirth ?placeOfBirth ?yearOfDeath ?placeOfDeath ?labor') \n\t\t\t\t\t ->setWherePart('WHERE {'. '?resourceUri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'. '<http://drw-model.saw-leipzig.de/Person> . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://www.w3.org/2000/01/rdf-schema#label> ?Name . '.\t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfBirth> ?yearOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfBirth> ?placeOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfDeath> ?yearOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfDeath> ?placeOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/labor> ?labor . '.\n\t\t\t\t\t\t\t\t\t\t\t'FILTER regex (?Name, \"'.$nameOfPerson.'\", \"i\" )}');\t\t\t\t\t\t\t\t\n\t\t\t\t/////////// ToDo:\n\t\t\t\t// model = DRW-Katalog\t\t\t\t\t\t\t\n\t\t\t\t$this->model = $this->_owApp->selectedModel;\n\t\t\t\t$queryResult = $this->model->sparqlQuery($query);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$header = array ();\t\t\n\t\t\t\tif (is_array($queryResult) && isset ($queryResult[0]) && is_array($queryResult[0])) {\n\t\t\t\t\t$header = array_keys($queryResult[0]);\n\t\t\t\t}else {\n\t\t\t\t\t$queryResult = 'No Person was found for \"%s\".';\n\t\t\t\t\t$queryResult = sprintf($translate->_($queryResult), $nameOfPerson);\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\t// set strings to view -> search.phtml can access strings from view\t\t\n\t\t\t\t$this->view->urlBase = $this->_config->urlBase;\t\t\t\n\t\t\t\t$this->view->header = $header;\n\t\t\t\t$this->view->queryResult = $queryResult;\n\t\t\t} else /* if empty($nameOfPerson) */{\n\t\t\t\t$this->view->queryResult = $translate->_('Please enter a search item.');\n\t\t\t}\n\t\t}", "public function index()\n\t{\n $search_text = Input::has('search-text')? Input::get('search-text') : \"\";\n return $this->makeView('search.all', array('search_text' => $search_text))->render();\n\t}", "function go($word,$where,$data) { \n if ($data['all']=='all') {$where['content']=\"on\";$where['news']=\"on\";}\n if ($where['content']==\"on\") {\n\t$res1=$this->content($word);\n }\n if ($where['news']==\"on\") {$res2=$this->news($word);}\n $result=$res1.$res3.$res4.$res5.$res6.$res2;\n $smarty = new Smarty; \n $smarty->assign(\"word\",$word);\n $smarty->assign(\"where\",$where);\n $smarty->assign(\"result\",$result);\n $smarty->display(\"{$this->path}search.tpl\");\n }", "public function search(){}", "public function actionSearch()\r\n\t{\r\n\t\r\n\t\t$this->layout='//layouts/column3';\r\n\t\t$tutorials =array();\r\n\t\t$courses= array();\r\n\t\t$search_string =(isset($_GET['search_string']))? $_GET['search_string'] : '' ;\r\n\t\t//$model=new ContactForm;\r\n\t\t//if(isset($_POST['search_string']) && strlen(trim($_POST['search_string'])) > 2 )\r\n\t//\t{\r\n\t\t\r\n\t\t\t$search_string = $_GET['search_string'];\r\n\t\t\t\r\n\t\t\t$words = explode(' ', $search_string);\r\n\t\t\t\t\r\n\t\t\t$result_set = Keyword::model()->findByPk(trim($search_string));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$q = new CDbCriteria();\r\n\t\t\t$q->distinct=TRUE;\r\n\t\t\t$q->select='TUTORIAL_ID';\r\n\t\t\t\r\n\t\t foreach ($words as $word)\t\t\t\t\r\n\t\t \t\tif (strlen(trim($word)) > 2)\r\n\t\t\t\t\t$q->addSearchCondition('WORD', $word,true, 'OR');\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$tutorials = KeywordTutorial::model()->findAll( $q );\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t//\t}else {\r\n\t\t\t\r\n\t\t\t//$this->render('search',array('model'=>null, 'kTutorials'=>new arr, 'courses'=>array(), 'search_string'=>(isset($_POST['search_string']))) ? $_POST['search_string'] : null);\r\n\t//\t}\r\n\t\t\r\n\t\t$this->promotionItems = SalePromotion::model()->findAllByAttributes(\r\n\t\t\t\tarray(),\r\n\t\t\t\t$condition = 'END_DATE >= :today AND START_DATE <= :today',\r\n\t\t\t\t$params = array(\r\n\t\t\t\t\t\t':today' => date('Y-m-d', time()),\r\n\t\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t$this->render('search',array( 'kTutorials'=>$tutorials,'courses'=>$courses, 'search_string'=>$search_string));\r\n\t}", "public function searchIndex()\n {\n try {\n $ingredient = Ingredient::all();\n $origine = Origine::all();\n $plat = Plat::paginate(10);\n return view('search', compact('origine', 'ingredient', 'plat'));\n } catch (Exception $error) {\n return redirect()->route('admin')->with('danger', 'Une erreur est survenue : ' . $error);\n }\n }", "public function actionSearch()\n {\n $this->render(\"Search\");\n }", "public function searchEmployee() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n $searchKeyword = filter_input(INPUT_POST, \"searchKeyword\");\n if (isset($_POST['searchKeyword'])) {\n $searchResults = $employeeModel->searchEmployee($searchKeyword);\n } else {\n $searchResults = array();\n }\n $data = array(\"searchResults\" => $searchResults);\n return $this->render(\"searchEmployee\", $data);\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function searchAction()\n {\n $cleanTypes = $this->_getTypesList();\n $this->view->documentTypes = $cleanTypes;\n }", "public function search()\n {\n $param = $_GET['search'];\n $resultados = Article::where('name', 'like', \"%$param%\")\n ->orWhere('nomenclature', 'like', \"%$param%\")\n ->orderBy('name', 'ASC')\n ->get();\n // ->paginate(6);\n // $resultados->withPath(\"resultados?search=$param\");\n\n return view(\"/resultados\", compact('resultados', 'param'));\n }", "static public function searchPartial($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . '%;%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function search() {\n if (!Request::get('s')) {\n return view('home.layout');\n }\n\n SearchHistory::record_user_search(\n Request::get('s'),\n Auth::user() ? Auth::user()->id : -1\n );\n\n return view('search.layout', [\n 'results' => $this->get_search_results(\n Request::get('s')\n )\n ]);\n }", "function view_search()\n {\n $this->load->view('view_head');\n $this->load->view('view_main');\n \n $search_terms = $this->input->post('q');\n \n \n if ($search_terms)\n {\n $this->load->model('model_search');\n $results = $this->model_search->search($search_terms);\n }\n\n $this->load->view('view_search', array(\n 'search_terms' => $search_terms,\n 'results' => @$results\n ));\t\n $this->load->view('view_footer');\n }", "public function search()\n {\n $vereinRepository = new VereinRepository();\n $searchTerm = $_GET['searchTerm'];\n $view = new View('verein_index');\n $view->heading = 'Suchbegriff: '. $searchTerm;\n $view->title = 'Vereine';\n $view->vereine = $vereinRepository->search($searchTerm);\n\n $view->display();\n }", "public function actionIndex() {\n\n if (($term = Yii::app()->getRequest()->getParam('s'))) {\n \n $index = new Zend_Search_Lucene(Yii::getPathOfAlias('application.' . $this->_indexFiles));\n Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding(\"UTF-8\");\n $results = $index->find($term);\n $query = Zend_Search_Lucene_Search_QueryParser::parse($term);\n $dataProvider = new CArrayDataProvider($results, array(\n 'pagination' => array(\n 'pageSize' => 1,\n 'params'=>array('s'=>$term),\n ),\n ));\n \n \n $this->render('search', array('results' => $results, 'term' => $term, 'query' => $query, 'data' => $dataProvider));\n } else {\n $this->redirect(array('site/index'));\n }\n }", "public function search()\n {\n $data['resultList'] = $this->ReviewModel->searchForReview($this->input->post('searchtxt'));\n $data['body'] = 'results';\n $this->load->view('template', $data);\n }", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function search()\n {\n $query = $term = Input::get('global_query');\n $page_title = \"Search- $query : Beerhit!\";\n $page_descs = \"beerhit.com - search: $query\";\n\n $beers = DB::table('beers')->where('beer', 'LIKE','%'.strtolower($query).'%')->take(15)->get();\n $brewery = DB::table('brewery')->where('name', 'LIKE','%'.$query.'%')->take(15)->get();\n\n return view('pages.search',compact('page_title','page_descs','beers','brewery'));\n }" ]
[ "0.6885726", "0.6434963", "0.6429755", "0.6421807", "0.6378111", "0.6368966", "0.62786925", "0.62631464", "0.625469", "0.6228568", "0.6216042", "0.6214887", "0.61760634", "0.6132783", "0.60826176", "0.60450447", "0.6030578", "0.6030431", "0.6008182", "0.59906137", "0.5970503", "0.5961861", "0.5954598", "0.5930717", "0.5922221", "0.59222025", "0.59129184", "0.591006", "0.5900228", "0.5899277" ]
0.7879346
0
[[streamInsert()]] function to fill table with JSON data via stream.
public function streamInsert($model, $file, $table, $columnNames) { // Read the json file with stream $rows = JsonMachine::fromFile(Yii::$app->basePath.'/'.$file); $userData = []; foreach ($rows as $id => $row) { $this->preProcess($model, $row); if( count($userData) < 500){ $userData[] = $row; } else { // send a batch of 100 records for insertion $insertCount = Yii::$app->db->createCommand() ->batchInsert( $table, $columnNames, $userData ) ->execute(); // empty the userData array after insetion // and insert the current user in the array as a first element $userData = []; $userData[] = $row; } } // insert the remaining data if any if(count($userData) > 0) { $insertCount = Yii::$app->db->createCommand() ->batchInsert( $table, $columnNames, $userData ) ->execute(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function format($stream, $columns = [], $limit = PHP_INT_MAX, $offset = 0) {\n return new JSONLStreamTabularDataSet($columns, $stream, $this->firstRowOffset, $this->itemOffsetPath, $limit, $offset);\n }", "public function insert($table, $data, $format = \\null)\n {\n }", "public function insert($attream);", "public function insertJson() {\r\n\t\t$this->prepareDb();\r\n\t\t$json = $this->expJson();\r\n\t\tif (!$this->getFileContent()) {\r\n\t\t\tfile_put_contents($this->_path_db, json_encode([[\"id\"=>0, \"json\"=>$json, \"class\"=>get_class($this)]], JSON_PRETTY_PRINT));\r\n\t\t\t$this->_jsonId = 0;\r\n\t\t} else {\r\n\t\t\t$this->_jsonFc = json_decode($this->_jsonFc, true);\r\n\t\t\tif (is_array($this->_jsonFc)) {\r\n\t\t\t\t$this->_jsonId = $this->getDispId();\r\n\t\t\t\tarray_push($this->_jsonFc, [\"id\"=>$this->_jsonId, \"json\"=>$json, \"class\"=>get_class($this)]);\r\n\t\t\t\t$this->_jsonFc = json_encode($this->_jsonFc, JSON_PRETTY_PRINT);\r\n\t\t\t\tfile_put_contents($this->_path_db, $this->_jsonFc);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->clearDump();\r\n\t}", "public function insertToTable($json,$type='main') {\n\t\t$this->connect();\n\t\tforeach ($json[data] as $key=>$value) {\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'main':\n\t\t\t\t\t\t$res=$this->getValuefromArray($value,$type);\n\t\t\t\t\t\t$this->get_data_real($this->insertToSQL($res,TableReestr));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mi':\n\t\t\t\t\t$res=$this->getValuefromArray($value,$type);\n\t\t\t\t\t$this->get_data_real($this->insertToSQL($res,TableMi));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\t$res='None Data';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$this->close();\n\t}", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function insertFormat(): string\n {\n return 'JSONEachRow';\n }", "public function process() {\n\n\t\t\t/**\n\t\t\t * Decode all data from JSON\n\t\t\t *\n\t\t\t * @var array $data\n\t\t\t */\n\t\t\t$data = json_decode($this->getData(), true);\n\n\t\t\t/**\n\t\t\t * Get keys from first row of data set\n\t\t\t *\n\t\t\t * @var array $columNames\n\t\t\t */\n\t\t\t$columnNames = array_keys($data[0]);\n\n\t\t\t/**\n\t\t\t * Generate tablename from given columns\n\t\t\t *\n\t\t\t * @var string $tableName\n\t\t\t */\n\t\t\t$tableName = \"tmp_plista_api_\" . md5(implode($columnNames));\n\n\t\t\t/**\n\t\t\t * Building the query for creating the temporary Table\n\t\t\t * Note: This function does not fires a DROP TABLE. If the\n\t\t\t * table already exists the data gets filled in again. So the\n\t\t\t * client is responsible for droping the table after usage\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\t$sql = \"CREATE TABLE IF NOT EXISTS `\" . $tableName . \"`\n\t\t\t(\" . implode( $columnNames, \" VARCHAR(255), \" ) . \" VARCHAR(255))\n\t\t\tENGINE=MEMORY\n\t\t\tDEFAULT CHARSET=utf8;\";\n\n\t\t\t/**\n\t\t\t * Build the query for inserting data into the temporary table\n\t\t\t *\n\t\t\t * @var string $sql\n\t\t\t */\n\t\t\tforeach ($data as $row) {\n\t\t\t\t$sql .= \"\\nINSERT INTO $tableName (\" . implode($columnNames, \", \") . \") VALUES ('\" . implode($row, \"', '\") . \"');\";\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * set the data\n\t\t\t */\n\t\t\t$this->setData(\n\t\t\t\tarray(\n\t\t\t\t\t\"table_name\"\t=> $tableName,\n\t\t\t\t\t\"query\"\t\t=> $sql\n\t\t\t\t)\n\t\t\t);\n\t\t}", "protected function populateDatastreamInfo() {\n $this->datastreamHistory = $this->getDatastreamHistory();\n $this->datastreamInfo = $this->datastreamHistory[0];\n }", "public function insert($tableName, $data);", "function insert($table, $data, $format = null){\n\t\treturn $this->_insert_replace_helper($table, $data, $format, 'INSERT');\n\t}", "public function setUp()\n {\n foreach ($this->data as $row) {\n $this->table->insert($row);\n }\n\n parent::setUp();\n\n }", "public function addEntry(DataStreamEntry $entry);", "function add_stream($params)\n {\n $this->db->insert('streams', $params);\n return $this->db->insert_id();\n }", "public function insertRow() {\n global $schema;\n date_default_timezone_set(\"America/New_York\");\n $datetime = date('Y-m-d H:i:s');\n\n $statement = \"INSERT INTO $this->table (shortUrl,\";\n $marks = \"VALUES ('$this->shortUrl',\";\n $id = 0;\n foreach ($schema as $col) {\n $statement .= $col . \",\";\n $marks .=\"'\" . $this->response[$id++]['path'] . \"',\";\n }\n $statement .= 'entered) ';\n $marks .= '\"' . $datetime . '\")';\n $statement .= $marks;\n\n // Prepared statement for inserting row\n $stmt = $this->mysqli->prepare($statement);\n if (!$stmt->execute()) {\n $response = array('success' => FALSE, 'error' => 'Inserting failed!');\n header('Content-Type: application/json');\n echo json_encode($response);\n error_log($this->mysqli->error());\n }\n $stmt->close();\n }", "public function push(array $batch) { \n $records = array();\n foreach ($batch as $record) { \n $records[] = array('Data' => json_encode($record), 'PartitionKey' => uniqid(),);\n }\n $result = $this->_kinesis->putRecords(array('Records' => $records, 'StreamName' => $this->_kinesisStreamName));\n \\cli::log('Pushing to kinesis a batch of ' . sizeof($records) . ' records to ' . $this->_kinesisStreamName);\n\n return $result;\n }", "public function insert($connection, $table, $rows);", "public function test_can_create_stream_from_jsonable_data(): void {\n\n\t\t$withArray = HTTP_Helper::stream_from_scalar( array( 'key' => 'value' ) );\n\t\t$withObject = HTTP_Helper::stream_from_scalar( (object) array( 'key' => 'value' ) );\n\t\t$withString = HTTP_Helper::stream_from_scalar( 'STRING' );\n\t\t$withInt = HTTP_Helper::stream_from_scalar( 42 );\n\t\t$withFloat = HTTP_Helper::stream_from_scalar( 4.2 );\n\n\t\t// Check all streams.\n\t\t$this->assertInstanceOf( Stream::class, $withArray );\n\t\t$this->assertInstanceOf( Stream::class, $withObject );\n\t\t$this->assertInstanceOf( Stream::class, $withString );\n\t\t$this->assertInstanceOf( Stream::class, $withInt );\n\t\t$this->assertInstanceOf( Stream::class, $withFloat );\n\n\t\t// Check values.\n\t\t$this->assertEquals( '{\"key\":\"value\"}', (string) $withArray );\n\t\t$this->assertEquals( '{\"key\":\"value\"}', (string) $withObject );\n\t\t$this->assertEquals( '\"STRING\"', (string) $withString );\n\t\t$this->assertEquals( 42, (string) $withInt );\n\t\t$this->assertEquals( 4.2, (string) $withFloat );\n\t}", "function test_insert_bulk($urabe, $body)\n{\n $bulk = $body->insert_bulk;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert_bulk($table_name, $bulk->columns, $bulk->values);\n}", "public function insert(Table $table, $row);", "private function create() {\r\n $input = (array) json_decode(file_get_contents('php://input'), TRUE);\r\n\r\n // If the row is not valid the response can't be processed\r\n if(!$this->validator->validate($input)) {\r\n return $this->unprocessableResponse();\r\n }\r\n\r\n $result = $this->tableGateway->insert($input);\r\n\r\n $response['status_code_header'] = HTTP_CREATED;\r\n $response['body'] = json_encode($result);\r\n return $response;\r\n }", "public function json_table() {\n\t\t\techo json_encode($this->populate_rows());\n\t\t}", "public function insert($data, $table = null)\n {\n $GLOBALS['rlDb']->rlAllowHTML = $this->rlAllowHTML;\n return $GLOBALS['rlDb']->insert($data, $table);\n }", "public function insert($table, array $data);", "public function push(Request $request, Stream $stream)\n {\n // TODO optimize to avoid aggregate every 2 sec.\n // Create a timeseries table with current total according to constraints\n $this->authorize('broadcast', Stream::class);\n $this->authorize('update', $stream);\n\n // Same RFC, different behaviors, and dont want to rework chunk on js\n // https://w3c.github.io/media-source/webm-byte-stream-format.html\n // Firefox:\n // - Split stream by cluster with fixed size on trigger\n // - SimpleBlocks timecode counter differs on each tracks (sound and video)\n // Chrome:\n // - Clusters with infinite size that hold ~11sec that are split on trigger\n // - SimpleBlock of all tracks share the same timecode counter\n // - On push first Chunk holds the EBML header and the first Cluster\n // - On pull if you send the same first chunk and use it on appendBuffer it crashes,\n // the first chunk must always be the EBMLHeader only\n\n // TODO Stop stream if it reaches size limit\n // TODO Check if stream is in progress\n\n // Start with EBML header => look for next cluter and split\n // Not start with Cluster => look for next cluster and split by timecode, begin will be appended to last file\n // Create an handle to manage the payload\n $chunkId = $request->header('X-Chunk-Order');\n if ($chunkId <= 0) {\n // TODO Validated header\n abort('400', 'Invalid Chunk Order, must be positive');\n }\n $fStream = fopen('php://temp', 'wb');\n $chunkSize = fwrite($fStream, $request->getContent());\n rewind($fStream);\n // Get pos of first Cluster\n // Needed for Chrome, allow me flags and seeks the closest one.\n $clusterOffset = Webm::seekNextId($fStream, '1f43b675');\n rewind($fStream);\n // TODO Consistency check if possible ?\n // Chunk are ordered by client but http request may not arrive at the same time\n // Check if first bytes is the EMBL Header\n if ($chunkId == 1) {\n // Fist chunk must contains the EBMLHeader\n // TODO Parse the whole if it doesnt affects spec\n $tag = bin2hex(fread($fStream, 4));\n rewind($fStream);\n if ($tag != '1a45dfa3') {\n Log::error('stream[' . $stream->id .'] first chunk has no EBMLHeader tag');\n abort('400', 'Invalid Chunk, first chunk must hold the EBMLHeader');\n }\n $streamChunk = new StreamChunk();\n $streamChunk->stream_id = $stream->id;\n $streamChunk->chunk_id = 0;\n $streamChunk->filename = StreamChunk::getFilename($stream->id, 0, false);\n $fHeader = fopen('php://temp', 'wb');\n $streamChunk->filesize = stream_copy_to_stream($fStream, $fHeader,\n is_null($clusterOffset) ? -1 : intval($clusterOffset),\n 0);\n Storage::put($streamChunk->filename, $fHeader);\n fclose($fHeader);\n $streamChunk->save();\n Log::debug('stream[' . $stream->id .'] push header');\n // Still has cluster, set offset to 0 for next code section\n if (!is_null($clusterOffset)) {\n $clusterOffset = 0;\n }\n }\n // If not eof write chunk and flag if cluster\n if (!feof($fStream)) {\n $streamChunk = new StreamChunk();\n $streamChunk->stream_id = $stream->id;\n $streamChunk->chunk_id = $chunkId;\n $streamChunk->filename = StreamChunk::getFilename($stream->id, $chunkId, $clusterOffset);\n $streamChunk->cluster_offset = $clusterOffset;\n $fChunk = fopen('php://temp', 'wb');\n $streamChunk->filesize = stream_copy_to_stream($fStream, $fChunk);\n // Repair Chunk if wrong timecode order\n rewind($fChunk);\n if (Webm::needRepairCluster($fChunk, true)) {\n rewind($fChunk);\n $fRepaired = Webm::repairCluster($fChunk);\n Log::debug('stream[' . $stream->id .'] repair chunk ' . $chunkId);\n Storage::put($streamChunk->filename, $fRepaired);\n fclose($fRepaired);\n } else {\n Storage::put($streamChunk->filename, $fChunk);\n }\n fclose($fChunk);\n $streamChunk->save();\n Log::debug('stream[' . $stream->id .'] push chunk ' . $chunkId);\n }\n fclose($fStream);\n // Increments total_size in byte\n $stream->increment('total_size', $chunkSize);\n \n // Average Push delay of 3sec => Return views 3 sec ago\n $views = StreamChunkMetric::where([\n 'stream_id' => $stream->id,\n 'chunk_id' => max($chunkId - 1, 1)\n ])->pluck('views')->first();\n\n return response(null, 200)\n ->header('X-Views', $views);\n }", "protected abstract function insertRow($tableName, $data);", "public function run()\n {\n $properties = (new PropertiesRepository())->all();\n $finalResult = [];\n foreach($properties as $property){\n $propertyJson = (new PropertyJsonCreator($property))->create();\n $finalResult[] = [ 'property_id' => $property->id, 'json'=> json_encode($propertyJson)];\n }\n DB::table('property_json')->insert($finalResult);\n }", "function wp_stream_update_auto_300( $db_version, $current_version ) {\n\tglobal $wpdb;\n\n\t// Get only the author_meta values that are double-serialized\n\t$wpdb->query( \"RENAME TABLE {$wpdb->base_prefix}stream TO {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context TO {$wpdb->base_prefix}stream_context_tmp\" );\n\n\t$plugin = wp_stream_get_instance();\n\t$plugin->install->install( $current_version );\n\n\t$starting_row = 0;\n\t$rows_per_round = 5000;\n\n\t$stream_entries = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$wpdb->base_prefix}stream_tmp LIMIT %d, %d\", $starting_row, $rows_per_round ) );\n\n\twhile ( ! empty( $stream_entries ) ) {\n\t\tforeach ( $stream_entries as $entry ) {\n\t\t\t$context = $wpdb->get_row(\n\t\t\t\t$wpdb->prepare( \"SELECT * FROM {$wpdb->base_prefix}stream_context_tmp WHERE record_id = %s LIMIT 1\", $entry->ID )\n\t\t\t);\n\n\t\t\t$new_entry = array(\n\t\t\t\t'site_id' => $entry->site_id,\n\t\t\t\t'blog_id' => $entry->blog_id,\n\t\t\t\t'user_id' => $entry->author,\n\t\t\t\t'user_role' => $entry->author_role,\n\t\t\t\t'summary' => $entry->summary,\n\t\t\t\t'created' => $entry->created,\n\t\t\t\t'connector' => $context->connector,\n\t\t\t\t'context' => $context->context,\n\t\t\t\t'action' => $context->action,\n\t\t\t\t'ip' => $entry->ip,\n\t\t\t);\n\n\t\t\tif ( $entry->object_id && 0 !== $entry->object_id ) {\n\t\t\t\t$new_entry['object_id'] = $entry->object_id;\n\t\t\t}\n\n\t\t\t$wpdb->insert( $wpdb->base_prefix . 'stream', $new_entry );\n\t\t}\n\n\t\t$starting_row += $rows_per_round;\n\n\t\t$stream_entries = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM {$wpdb->base_prefix}stream_tmp LIMIT %d, %d\", $starting_row, $rows_per_round ) );\n\t}\n\n\t$wpdb->query( \"DROP TABLE {$wpdb->base_prefix}stream_tmp, {$wpdb->base_prefix}stream_context_tmp\" );\n\n\treturn $current_version;\n}", "public function insertRow($row);", "public function read(StreamInterface $stream)\n {\n $this->recs = $stream->readUShort();\n $this->startsz = $stream->readByte();\n $this->endsz = $stream->readByte();\n\n $this->entry = array();\n for ($i = 0; $i < $this->recs; ++$i) {\n $record = new VTableRecord();\n $record->read($stream);\n\n $this->entry[] = $record;\n }\n }" ]
[ "0.54951024", "0.52837867", "0.5276446", "0.51729035", "0.51323956", "0.51155156", "0.5100422", "0.50253797", "0.4980201", "0.49003735", "0.48982388", "0.4874407", "0.48603666", "0.48568296", "0.48504925", "0.48425916", "0.48046628", "0.47819468", "0.47677535", "0.4763859", "0.47373176", "0.46846268", "0.46743524", "0.4669825", "0.4649009", "0.4633982", "0.46265307", "0.4612131", "0.4590465", "0.45543486" ]
0.56052077
0
Function to fetch last updated time of QR Code September 27,2016
function fetchQRCodeUpdatedTime() { $data= array(); $session_values=get_user_session(); $my_session_id = $session_values['id']; if($my_session_id>0) { $data=getLastUpdatedTimeQRCode($my_session_id); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastUpdatedTimeQRCode($clientid)\n{\n\t$data= array();\n\t$qry=\"SELECT qrCodeUpdatedDateTime FROM entrp_login WHERE clientid=\".$clientid.\" \";\n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n if($count_res>0)\n {\n \twhile($row=mysqli_fetch_array($res))\n \t{\n \t\t$data['lastUpdatedAt']\t=\t$row['qrCodeUpdatedDateTime'];\n \t}\t \n }\n\treturn $data;\n}", "public function lastUpdateStr() {\n $statement = $this->db->prepare('SELECT \"created\" FROM \"temperature\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n \n return $result->fetchArray(SQLITE3_ASSOC)['created']; \n }", "function getLastModifiedTime(){\n /*$output = dbcCmd(\"getLastModifiedTime\\n\");\n \n //Error Check\n if($output[\"stdout\"] == \"failed\\n\"){\n return str_replace(\"\\n\",\"\",$output[\"stdout\"]);\n }\n \n $rtn = array(\"lastModifiedTime\"=>str_replace(\"\\n\",\"\",$output[\"stdout\"]));\n return json_encode($rtn);*/\n return;\n}", "public function lastUpdated(): string\n {\n return $this->weather['last_updated'];\n }", "public function getLastUpdated();", "public function getLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_ONLY_MODE);\n\t\n\t\t// read the first and unique line\n\t\t$lastUpdateDateTime = fgets($lastUpdateStorageFile);\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function getLastUpdate()\n {\n return $this->cache->load(\n self::CACHE_TAG\n );\n }", "function lastUpdate() {\n\t\tif ( !$this->postID && !$this->exists() )\n\t\t\treturn 999;\n\t\t\t\n\t\t$sql = \"SELECT last_update FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn 999;\t\n\t\t\n\t\t$updateTime = strtotime( $results[0]->last_update );\n\t\t$current = strtotime( date( \"Y-m-d H:i:s\" ) );\t\t\n\t\t$lastUpdate = ( $current - $updateTime ) / 3600;\t\t\n\t\t\n\t\treturn $lastUpdate;\t\t\n\t\n\t}", "public function getLastUpdateTime()\n {\n return $this->last_update_time;\n }", "public function getLastUpdateTime()\n {\n $time = Mage::getStoreConfig(self::XML_GEOIP_UPDATE_DB);\n if (!$time) {\n return false;\n }\n\n return date('F d, Y / h:i', $time);\n }", "public function getLastUpdated()\n {\n $packages = Package::get()->limit(1);\n if (!$packages->count()) {\n return '';\n }\n /** @var DBDatetime $datetime */\n $datetime = $packages->first()->dbObject('LastEdited');\n return $datetime->Date() . ' ' . $datetime->Time12();\n }", "public function retrieveServerTime(){\n //http://www.thetvdb.com/api/Updates.php?type=none\n\t \n\t if(!$this->t_mirrors){\n\t\t$this->retrieveMirrors;\n\t }\n\t \n $url = $this->t_mirrors[0].'/api/Updates.php?type=none';\n \n //$xmlStr=$this->curl_get_file_contents($url);\n\t $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $xmlStr = curl_exec($c);\n curl_close($c);\n \n $xmlServerTime = new SimpleXMLElement($xmlStr);\n return $xmlServerTime->Time;\n }", "public function getCurrentTime() {\n $timestamp = $this->getInfo();\n $http_code = $timestamp->code;\n $current_time = 'Time not set yet';\n if ($http_code == 200) {\n $current_time = date('H:i', $timestamp->data->date->timestamp);\n }\n return $current_time;\n }", "public function getLastCheckedtime()\n {\n\t\treturn $this->_getSess('checktime');\n }", "public function getLastGetTime()\n {\n return $this->get(self::_LAST_GET_TIME);\n }", "function get_last_available_with_time($time){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$limit=1&$order=:id%20DESC&time=' . $time );\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n if(isset(json_decode($result)[0]))\r\n return json_decode($result)[0];\r\n else return NULL;\r\n}", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function getLastUpdated(): int;", "public function getLastAutoRefreshTime()\n {\n return $this->get(self::_LAST_AUTO_REFRESH_TIME);\n }", "function get_last_updated($deprecated = '', $start = 0, $quantity = 40)\n {\n }", "protected function getLastModified() {\n if (!empty($this->lastModified)) {\n return $this->lastModified;\n } else {\n $response = new BstalkplusHttpResponse;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->conf['config']['api_url']);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"HEAD\");\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_USERAGENT, $this->conf['config']['user_agent']);\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, array(&$response, 'setHeader'));\n if(!curl_exec($ch)) {\n $response->status = 0;\n }\n if(!empty($this->conf['config']['debug'])) {\n $this->info = curl_getinfo($ch);\n $this->log(round($this->info['total_time'] * 1000) . \" ms [\" . $response->status_code . \"] - HEAD \" . $this->conf['config']['api_url']);\n }\n curl_close($ch);\n $this->lastModified = substr($response->headers['Last-Refresh'], 2); // t=xxxx\n return $this->lastModified;\n }\n }", "protected function getTimeLastSaved()\n {\n return SiteConfig::current_site_config()->VimeoFeed_LastSaved;\n }", "function lastupdatetime($table){\n if (first(\"SHOW TABLE STATUS FROM \" . $GLOBALS[\"database\"] . \" LIKE '\" . $table . \"';\", true , \"API.lastupdatetime\")[\"Engine\"] == \"InnoDB\") {\n $filename = first('SHOW VARIABLES WHERE Variable_name = \"datadir\"', true , \"API.lastupdatetime\")[\"Value\"] . $GLOBALS[\"database\"] . '/' . $table . '.ibd';\n return filemtime($filename);//UNIX datestamp\n }\n return first(\"SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = '\" . $GLOBALS[\"database\"] . \"' AND TABLE_NAME = '\" . $table . \"'\", true , \"API.lastupdatetime\")[\"UPDATE_TIME\"];//unknown format\n}", "public function cached_timestamp()\n\t{\n\t\t$query = $this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'));\n\t\treturn ($query->num_rows() > 0) ? $query->row()->value : 0 ;\n\t}", "public function getLastBtTime()\n {\n return $this->get(self::_LAST_BT_TIME);\n }", "public function getLatestUpdateDate()\n {\n return $this->channel->getLatestUpdateDate();\n }", "public function getLastUpdateTime()\n\t{\n\t\treturn empty($this->lastUpdateTime) ? time() : $this->lastUpdateTime;\n\t}", "public function getLastCheckTime()\n {\n return $this->cacheManager->load(self::LAST_CHECK_TIME_ID);\n }", "public static function last_update()\n {\n $gallery_date = Gallery::orderBy('updated_at', 'desc')->value('updated_at');\n $gallery_last_date = (!empty($gallery_date)) ? date(strtotime($gallery_date . '+1 hours')) : '';\n $posts_date = Posts::orderBy('updated_at', 'desc')->value('updated_at');\n $posts_last_date = (!empty($posts_date)) ? date(strtotime($posts_date . '+1 hours')) : '';\n $newsletter_date = Newsletter::orderBy('updated_at', 'desc')->value('updated_at');\n $newsletter_last_date = (!empty($newsletter_date)) ? date(strtotime($newsletter_date . '+1 hours')) : '';\n $properties_date =\n DB::table('apimo_properties')\n ->select('updated_at')\n ->where(function($query) {\n $query->orWhere('reference', 'like', 'HSTP%')\n ->orWhere('reference', 'like', 'HD%');\n })\n ->orderBy('updated_at', 'desc')\n ->value('updated_at');\n $properties_last_date = (!empty($properties_date)) ? date(strtotime($properties_date . '+1 hours')) : '';\n\n $dates = [$posts_last_date, $gallery_last_date, $properties_last_date, $newsletter_last_date];\n\n $last_update = max($dates);\n\n return date('d.m.Y - H:i', (!empty($last_update)) ? $last_update : 0);\n }", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}" ]
[ "0.7343355", "0.6841837", "0.67392385", "0.66538715", "0.66022307", "0.6558668", "0.65031064", "0.64733154", "0.639261", "0.63361514", "0.6335765", "0.6330887", "0.6309272", "0.62332886", "0.62285817", "0.6221351", "0.6209335", "0.6182824", "0.61695707", "0.61618495", "0.6147422", "0.6143397", "0.6142449", "0.61304104", "0.6069355", "0.60678285", "0.60440546", "0.6041413", "0.6035775", "0.6014601" ]
0.7967727
0
Function to fetch last updated time for QR Codes September 27,2016
function getLastUpdatedTimeQRCode($clientid) { $data= array(); $qry="SELECT qrCodeUpdatedDateTime FROM entrp_login WHERE clientid=".$clientid." "; $res=getData($qry); $count_res=mysqli_num_rows($res); if($count_res>0) { while($row=mysqli_fetch_array($res)) { $data['lastUpdatedAt'] = $row['qrCodeUpdatedDateTime']; } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchQRCodeUpdatedTime()\n{\n\t$data= array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\tif($my_session_id>0)\n\t{\n\t $data=getLastUpdatedTimeQRCode($my_session_id);\n\t}\n\treturn $data;\n}", "function getLastModifiedTime(){\n /*$output = dbcCmd(\"getLastModifiedTime\\n\");\n \n //Error Check\n if($output[\"stdout\"] == \"failed\\n\"){\n return str_replace(\"\\n\",\"\",$output[\"stdout\"]);\n }\n \n $rtn = array(\"lastModifiedTime\"=>str_replace(\"\\n\",\"\",$output[\"stdout\"]));\n return json_encode($rtn);*/\n return;\n}", "public function lastUpdateStr() {\n $statement = $this->db->prepare('SELECT \"created\" FROM \"temperature\" ORDER BY \"created\" DESC LIMIT 1');\n $result = $statement->execute();\n \n return $result->fetchArray(SQLITE3_ASSOC)['created']; \n }", "public function getLastUpdated();", "public function lastUpdated(): string\n {\n return $this->weather['last_updated'];\n }", "function lastUpdate() {\n\t\tif ( !$this->postID && !$this->exists() )\n\t\t\treturn 999;\n\t\t\t\n\t\t$sql = \"SELECT last_update FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn 999;\t\n\t\t\n\t\t$updateTime = strtotime( $results[0]->last_update );\n\t\t$current = strtotime( date( \"Y-m-d H:i:s\" ) );\t\t\n\t\t$lastUpdate = ( $current - $updateTime ) / 3600;\t\t\n\t\t\n\t\treturn $lastUpdate;\t\t\n\t\n\t}", "public function getLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_ONLY_MODE);\n\t\n\t\t// read the first and unique line\n\t\t$lastUpdateDateTime = fgets($lastUpdateStorageFile);\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function retrieveServerTime(){\n //http://www.thetvdb.com/api/Updates.php?type=none\n\t \n\t if(!$this->t_mirrors){\n\t\t$this->retrieveMirrors;\n\t }\n\t \n $url = $this->t_mirrors[0].'/api/Updates.php?type=none';\n \n //$xmlStr=$this->curl_get_file_contents($url);\n\t $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n $xmlStr = curl_exec($c);\n curl_close($c);\n \n $xmlServerTime = new SimpleXMLElement($xmlStr);\n return $xmlServerTime->Time;\n }", "public function getLastUpdate()\n {\n return $this->cache->load(\n self::CACHE_TAG\n );\n }", "public function getLastUpdateTime()\n {\n return $this->last_update_time;\n }", "function get_last_available_with_time($time){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$limit=1&$order=:id%20DESC&time=' . $time );\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n if(isset(json_decode($result)[0]))\r\n return json_decode($result)[0];\r\n else return NULL;\r\n}", "public function getLastUpdateTime()\n {\n $time = Mage::getStoreConfig(self::XML_GEOIP_UPDATE_DB);\n if (!$time) {\n return false;\n }\n\n return date('F d, Y / h:i', $time);\n }", "public function getCurrentTime() {\n $timestamp = $this->getInfo();\n $http_code = $timestamp->code;\n $current_time = 'Time not set yet';\n if ($http_code == 200) {\n $current_time = date('H:i', $timestamp->data->date->timestamp);\n }\n return $current_time;\n }", "public function getLastGetTime()\n {\n return $this->get(self::_LAST_GET_TIME);\n }", "public function getLastUpdated()\n {\n $packages = Package::get()->limit(1);\n if (!$packages->count()) {\n return '';\n }\n /** @var DBDatetime $datetime */\n $datetime = $packages->first()->dbObject('LastEdited');\n return $datetime->Date() . ' ' . $datetime->Time12();\n }", "function lastupdatetime($table){\n if (first(\"SHOW TABLE STATUS FROM \" . $GLOBALS[\"database\"] . \" LIKE '\" . $table . \"';\", true , \"API.lastupdatetime\")[\"Engine\"] == \"InnoDB\") {\n $filename = first('SHOW VARIABLES WHERE Variable_name = \"datadir\"', true , \"API.lastupdatetime\")[\"Value\"] . $GLOBALS[\"database\"] . '/' . $table . '.ibd';\n return filemtime($filename);//UNIX datestamp\n }\n return first(\"SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA = '\" . $GLOBALS[\"database\"] . \"' AND TABLE_NAME = '\" . $table . \"'\", true , \"API.lastupdatetime\")[\"UPDATE_TIME\"];//unknown format\n}", "public function getLastCheckedtime()\n {\n\t\treturn $this->_getSess('checktime');\n }", "function get_last_updated($deprecated = '', $start = 0, $quantity = 40)\n {\n }", "public function getLastUpdated(): int;", "public static function last_update()\n {\n $gallery_date = Gallery::orderBy('updated_at', 'desc')->value('updated_at');\n $gallery_last_date = (!empty($gallery_date)) ? date(strtotime($gallery_date . '+1 hours')) : '';\n $posts_date = Posts::orderBy('updated_at', 'desc')->value('updated_at');\n $posts_last_date = (!empty($posts_date)) ? date(strtotime($posts_date . '+1 hours')) : '';\n $newsletter_date = Newsletter::orderBy('updated_at', 'desc')->value('updated_at');\n $newsletter_last_date = (!empty($newsletter_date)) ? date(strtotime($newsletter_date . '+1 hours')) : '';\n $properties_date =\n DB::table('apimo_properties')\n ->select('updated_at')\n ->where(function($query) {\n $query->orWhere('reference', 'like', 'HSTP%')\n ->orWhere('reference', 'like', 'HD%');\n })\n ->orderBy('updated_at', 'desc')\n ->value('updated_at');\n $properties_last_date = (!empty($properties_date)) ? date(strtotime($properties_date . '+1 hours')) : '';\n\n $dates = [$posts_last_date, $gallery_last_date, $properties_last_date, $newsletter_last_date];\n\n $last_update = max($dates);\n\n return date('d.m.Y - H:i', (!empty($last_update)) ? $last_update : 0);\n }", "public function cached_timestamp()\n\t{\n\t\t$query = $this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'));\n\t\treturn ($query->num_rows() > 0) ? $query->row()->value : 0 ;\n\t}", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function getLastAutoRefreshTime()\n {\n return $this->get(self::_LAST_AUTO_REFRESH_TIME);\n }", "protected function getLastModified() {\n if (!empty($this->lastModified)) {\n return $this->lastModified;\n } else {\n $response = new BstalkplusHttpResponse;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->conf['config']['api_url']);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"HEAD\");\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_USERAGENT, $this->conf['config']['user_agent']);\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, array(&$response, 'setHeader'));\n if(!curl_exec($ch)) {\n $response->status = 0;\n }\n if(!empty($this->conf['config']['debug'])) {\n $this->info = curl_getinfo($ch);\n $this->log(round($this->info['total_time'] * 1000) . \" ms [\" . $response->status_code . \"] - HEAD \" . $this->conf['config']['api_url']);\n }\n curl_close($ch);\n $this->lastModified = substr($response->headers['Last-Refresh'], 2); // t=xxxx\n return $this->lastModified;\n }\n }", "private function getLastFetchTime($record, $returnInAgoFormat=false) \r\n\t{\r\n\t\tglobal $lang;\r\n\t\t$sql = \"select updated_at from redcap_ddp_records \r\n\t\t\t\twhere project_id = \" . $this->project_id . \" and record = '\" . prep($record) . \"' limit 1\";\r\n\t\t$q = db_query($sql);\r\n\t\tif (db_num_rows($q)) {\r\n\t\t\t$ts = db_result($q, 0);\r\n\t\t\t// If we're returning the time in \"X hours ago\" format, then convert it, else return as is\r\n\t\t\tif ($returnInAgoFormat) {\r\n\t\t\t\t// If timestamp is NOW, then return \"just now\" text\r\n\t\t\t\tif ($ts == NOW) return $lang['ws_176'];\r\n\t\t\t\t// First convert to minutes\r\n\t\t\t\t$ts = (strtotime(NOW) - strtotime($ts))/60;\r\n\t\t\t\t// Return if less than 60 minutes\r\n\t\t\t\tif ($ts < 60) return ($ts < 1 ? $lang['ws_177'] : (floor($ts) . \" \" . (floor($ts) == 1 ? $lang['ws_178'] : $lang['ws_179'])));\r\n\t\t\t\t// Convert to hours\r\n\t\t\t\t$ts = $ts/60;\r\n\t\t\t\t// Return if less than 24 hours\r\n\t\t\t\tif ($ts < 24) return floor($ts) . \" \" . (floor($ts) == 1 ? $lang['ws_180'] : $lang['ws_181']);\r\n\t\t\t\t// Convert to days and return\r\n\t\t\t\t$ts = $ts/24;\r\n\t\t\t\treturn floor($ts) . \" \" . (floor($ts) == 1 ? $lang['ws_182'] : $lang['ws_183']);\r\n\t\t\t}\r\n\t\t\t// Return value\r\n\t\t\treturn $ts;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "protected function getTimeLastSaved()\n {\n return SiteConfig::current_site_config()->VimeoFeed_LastSaved;\n }", "public function getLastUpdateTime()\n\t{\n\t\treturn empty($this->lastUpdateTime) ? time() : $this->lastUpdateTime;\n\t}", "public function getLastBtTime()\n {\n return $this->get(self::_LAST_BT_TIME);\n }", "function get_sensors_data_last_day(){\r\n $sensor_json_url = 'https://data.melbourne.vic.gov.au/resource/b2ak-trbp.json';\r\n $last_available_data_time = get_last_available_with_time(0)->date_time;\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_URL,$sensor_json_url . '?$where=date_time%20>%20\"' . gmdate(\"Y-m-d\\TH:i:s\", strtotime('-1 day', strtotime($last_available_data_time))) . '\"');\r\n $result=curl_exec($ch);\r\n curl_close($ch);\r\n return json_decode($result);\r\n}", "public function getRtbusUpdateTime() {\n return $this->get(self::RTBUS_UPDATE_TIME);\n }" ]
[ "0.80050284", "0.67817587", "0.6763335", "0.6659092", "0.6514451", "0.6468063", "0.6441403", "0.6416095", "0.64122826", "0.6400522", "0.63803434", "0.6361667", "0.62756574", "0.6240706", "0.6212971", "0.6182546", "0.6177763", "0.6171232", "0.61680955", "0.613054", "0.6129054", "0.6122263", "0.61058784", "0.6098967", "0.60746294", "0.6064258", "0.6048759", "0.6044369", "0.60305345", "0.60246176" ]
0.74388975
1
Function to change a user's QR Code September 27,2016
function changeQRCode() { $data= array(); $session_values=get_user_session(); $my_session_id = $session_values['id']; if($my_session_id>0) { $qrCodeToken = uniqueQRCodeToken(); saveQRCOdeforUser($my_session_id,$qrCodeToken); $data=getLastUpdatedTimeQRCode($my_session_id); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function qrCode(){\n }", "function update_qr_code_with_user ( $user_id, $form_id, $form_settings, $form_vars ) {\n foreach ( $form_vars as $value ) {\n if( $value['input_type'] == 'qr_code' ) {\n $post_data = $_POST[$value['name']];\n $this->save_qr_meta_user( $post_data, $user_id, $value['name'], $form_settings );\n }\n }\n }", "function getUserQRCode()\n{\n\t $qr = new qrcode();\n\t //the defaults starts\n\t global $myStaticVars;\n\t extract($myStaticVars); // make static vars local\n\t $member_default_avatar \t= $member_default_avatar;\n\t $member_default_cover\t\t= $member_default_cover;\n\t $member_default\t\t\t\t= $member_default;\n\t $company_default_cover\t\t= $company_default_cover;\n\t $company_default_avatar\t= $company_default_avatar;\n\t $events_default\t\t\t\t= $events_default;\n\t $event_default_poster\t\t= $event_default_poster;\n\t //the defaults ends\t\n\t\n\t $session_values=get_user_session();\n\t $my_session_id\t= $session_values['id'];\n\t if($my_session_id>0)\n\t {\n\t // how to build raw content - QRCode with Business Card (VCard) + photo \t \n\t //$tempDir = QRCODE_PATH; \n\t \n\t $data\t\t\t=\tfetch_info_from_entrp_login($my_session_id);\n\t \n\t $clientid \t\t= $data['clientid'];\n \t $username \t\t= $data['username'];\n \t $email \t\t\t= $data['email'];\n \t $firstname \t= $data['firstname'];\n \t $lastname \t\t= $data['lastname'];\n \t $voffStaff\t\t= $data['voffStaff'];\n\t\t $vofClientId\t= $data['vofClientId'];\t\n\t\t \n\t\t //Fetch qr-code from db if already generated\n\t\t $qrCode= fetchUserQRCodeFromDB($clientid);\n\t \n\t if($qrCode=='')\n\t {\n\t \t$qrCodeToken\t=\tuniqueQRCodeToken();\n\t \tsaveQRCOdeforUser($clientid,$qrCodeToken);\n\t }\n\t else\n\t {\n\t \t$qrCodeToken\t= $qrCode;\n\t }\n\t \n\t $qr->text($qrCodeToken);\n\t $data['qr_link'] \t\t\t= $qr->get_link();\n\t $data['client_id'] \t\t\t= $clientid;\n\t $data['vofClientId'] \t\t= $vofClientId;\n\t $data['vofStaffStatus'] \t= $voffStaff;\n\t //return $qr->get_link(); \n\t return $data; \n\t }\t \n}", "function saveQRCOdeforUser($clientid,$qrCodeToken)\n{\n\tdate_default_timezone_set('UTC');\n\t$updatedAt=date('Y-m-d H:i:s');\n\t$qry=\"UPDATE entrp_login SET qrCode='\".$qrCodeToken.\"',qrCodeUpdatedDateTime='\".$updatedAt.\"' WHERE clientid=\".$clientid.\" \";\n\tsetData($qry);\n}", "public function showQrCode()\n {\n $this->app->qrCode->show($this->app->config['server.qr_uuid']);\n }", "function getQRCode( $qraddress, $size ) {\n $alt_text = 'Send VRSC to ' . $qraddress;\n return \"\\n\" . '<img src=\"https://chart.googleapis.com/chart?chld=H|2&chs='.$size.'x'.$size.'&cht=qr&chl=' . $qraddress . '\" alt=\"' . $alt_text . '\" />' . \"\\n\";\n}", "public function qrcodeSave() {\r\n $user_id = \\Yii::$app->user->getId();\r\n $baseimgurl = 'date/upload/wechat/qrcode/';\r\n $createpath=\\Yii::$app->basePath.'/web/'.$baseimgurl;\r\n ToolService::createdir($createpath);\r\n //生成随机文件名\r\n $basefilename = $user_id . '_' . time() . '_' . rand(1000, 9999);\r\n $this->s_img_url = $sfilename = $baseimgurl . 's' . $basefilename . '.' . $this->file->extension;\r\n $this->o_img_url = $ofilename = $baseimgurl . 'o' . $basefilename . '.' . $this->file->extension;\r\n $this->m_img_url = $mfilename = $baseimgurl . 'm' . $basefilename . '.' . $this->file->extension;\r\n $this->b_img_url = $bfilename = $baseimgurl . 'b' . $basefilename . '.' . $this->file->extension;\r\n $this->file->saveAs($bfilename);\r\n $image = \\Yii::$app->image->load($bfilename);\r\n //生成中图片\r\n $image->resize(100, 100, Image::NONE);\r\n $image->save($mfilename);\r\n //生成小图片\r\n $image->resize(64, 64, Image::NONE);\r\n $image->save($sfilename);\r\n //生成微略图\r\n $image->resize(48, 48, Image::NONE);\r\n $image->save($ofilename);\r\n\r\n\r\n $newpic = new Pic();\r\n $newpic->setAttributes([\r\n 'user_id' => $user_id,\r\n 'pic_type' => 3,\r\n 'pic_s_img' => '/' . $sfilename,\r\n 'pic_m_img' => '/' . $mfilename,\r\n 'pic_b_img' => '/' . $bfilename\r\n ]);\r\n if ($newpic->save()) {\r\n $this->id = \\Yii::$app->db->getLastInsertID();\r\n return true;\r\n }\r\n return FALSE;\r\n }", "public static function getGenerateQrCode(Request $request){\n $title = \"Generate Qr Code\";\n $projectDetailObj = new \\App\\Project;\n $input = $request->all();\n $project = $projectDetailObj->find($input['id']);\n try{\n DB::beginTransaction();\n $explode_name = explode(' ',$project->name);\n\n $qrcode = mt_rand(1000000, 9999999).$explode_name[0].$project->id;\n // QrCode::size(500)->format('png')->generate($qrcode, public_path('storage/public/storage/user_images/'.$input['id'].'-code.png'));\n $project->update(['qrcode'=>$qrcode,'need_to_scan_qr'=>'enable']);\n DB::commit();\n /* Transaction successful. */\n }catch(\\Exception $e){ \n DB::rollback();\n /* Transaction failed. */\n }\n return \"1\" ;\n }", "public function testQRCodeDefaultsAreCorrect()\n {\n $this -> printer -> qrCode(\"1234\", Printer::QR_ECLEVEL_L, 3, Printer::QR_MODEL_2);\n $this -> checkOutput(\"\\x1b@\\x1d(k\\x04\\x001A2\\x00\\x1d(k\\x03\\x001C\\x03\\x1d(k\\x03\\x001E0\\x1d(k\\x07\\x001P01234\\x1d(k\\x03\\x001Q0\");\n }", "function edit_qr_code_form ( $name, $count, $input_field ) {\n $this->qr_code_new_form ( $name, $count, $input_field );\n }", "private function generate_barcode($userName) {\n $hash = substr(hash('sha256',$userName.time()), 0, 20);\n $chars = str_split($hash);\n $newhash = '';\n foreach ($chars as $c) {\n $num = ord($c);\n if (($num > 47) && ($num < 58)) {\n //numbers are ok\n $newhash .= $c;\n }\n else if (($num > 64) && ($num < 91)) {\n //uppercase letters: \"translate\" to a number\n $newhash .= strval($num - 64);\n }\n else if (($num > 96) && ($num < 123)) {\n //lowercase letters: \"translate\" to a number\n $newhash .= strval($num - 96);\n }\n //else: skip the others\n }\n //put '90' before the first 8 characters, making it very possible that the resulting barcode is not unique...\n return '90'.substr($newhash, 0, 8);\n }", "function save_qr_meta_user( $post_data, $user_id, $meta_key, $form_settings ) {\n $type = $post_data['qr_code_type'];\n\n if( $type == '' && empty( $type ) ) {\n return;\n }\n\n $metadata = array(\n 'type' => $post_data['qr_code_type'],\n 'type_param' => $post_data['type_param']\n );\n\n update_user_meta( $user_id, $meta_key, $metadata );\n }", "function attendance_renderqrcode($session) {\n global $CFG;\n\n if (strlen($session->studentpassword) > 0) {\n $qrcodeurl = $CFG->wwwroot . '/mod/attendance/attendance.php?qrpass=' .\n $session->studentpassword . '&sessid=' . $session->id;\n } else {\n $qrcodeurl = $CFG->wwwroot . '/mod/attendance/attendance.php?sessid=' . $session->id;\n }\n\n $barcode = new TCPDF2DBarcode($qrcodeurl, 'QRCODE');\n $image = $barcode->getBarcodePngData(15, 15);\n echo html_writer::img('data:image/png;base64,' . base64_encode($image), get_string('qrcode', 'attendance'));\n}", "function AtualizaQRCode($id){\n\t$conteudo = file_get_contents(\"php://input\");\n\t$resposta = array();\n\n\t//Verifica se o id foi recebido\n\tif($id == 0){\n\t\t$resposta = mensagens(9);\n\t}\n\telse{\n\t\t//Verifica se o conteudo foi recebido\n\t\tif(empty($conteudo)){\n\t\t\t$resposta = mensagens(2);\n\t\t}\n\t\telse{\n\t\t\t//Converte o json recebido pra array\n\t\t\t$dados = json_decode($conteudo,true);\n\t\t\t\n\t\t\t//Verifica se as infromações esperadas foram recebidas\n\t\t\tif(!isset($dados[\"QRCode\"]))\n\t\t\t{\n\t\t\t\t$resposta = mensagens(3);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tinclude(\"conectar.php\");\n\t\t\t\tinclude(\"uploadDeFotos.php\");\n\t\t\t\t\n\t\t\t\t//Evita SQL injection\n\t\t\t\t$QRCode = mysqli_real_escape_string($conexao,$dados[\"QRCode\"]);\n\t\t\t\t\n\t\t\t\t$caminho = uploadDeQRCode($QRCode);\n\t\t\t\t\n\t\t\t\t//Atualiza animal no banco\n\t\t\t\t$query = mysqli_query($conexao, \"UPDATE Animal SET QRCode = '\" .$caminho .\"' WHERE idAnimal=\" .$id) or die(mysqli_error($conexao));\n\t\t\t\t$resposta = array(\"QRCode\" => $caminho);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $resposta;\n\n}", "public function generateQrCode()\n {\n return $this->doRequest('GET', 'qr-code', []);\n }", "function fetchUserQRCodeFromDB($clientid)\n{\n\t$qrCode= '';\n \t$qry=\"SELECT qrCode\n\t\t\tFROM entrp_login \n\t\t\tWHERE clientid=\".$clientid.\"\n\t \";\n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n\tif($count_res>0)\n {\n \twhile($row=mysqli_fetch_array($res))\n {\n \t$qrCode\t=\t$row['qrCode'];\n\t\t} \t \t\n }\n return $qrCode;\n}", "public function generate(Request $request){ \n $data = $request->all();\n QRCode::text($data['code'])->png(); \n }", "function qrcodeGenerate()\r\n\t {\r\n\t \t$selectedValue = JRequest::getVar('selectedValue');\r\n\t \t$selectedProductId = explode(\",\", $selectedValue);\r\n\t \tarray_pop($selectedProductId);\r\n\t \t$qrcodeId = implode(',',$selectedProductId);\r\n\t \t$qrcodeGenerateResult = $this->generateQrcode($selectedProductId);//function to generate qrcode for product.\r\n\t \t$path = urldecode(JRequest::getVar('redirectPath'));\r\n\t $this->setRedirect($path,$qrcodeGenerateResult);\r\n\t }", "public function changeCreaditCard(){\n return View::make('user.change_credit_card')->with(array('title_for_layout' => 'Thay đổi thẻ tín dụng'));\n }", "function modificarPQR($estado_pqr,$idPQR){\n\t\t\t$query = \"UPDATE pqr SET \n\t\t\t\testado = '\".$estado_pqr.\"',\n\t\t\t\tupdated_at = NOW()\n\t\t\t\tWHERE id = '\".$idPQR.\"';\";\n\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}", "function AddQRCode($aName,$db){\r\n\r\n\t\r\n\t$tempDir = dirname(__FILE__).DIRECTORY_SEPARATOR.'phpqrcode'.DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //setting the tempory directory to store the qrcode\r\n\t$fileName = $tempDir.$aName.'.png';//naming the qrcode file \r\n\t$errorCorrectionLevel = 'Q'; //setting the error correction level of the qrcode\r\n\t$matrixPointSize = 5; //setting the size of the generated qrcode\r\n\t$generationDate = date('Y/m/d');//setting the date\r\n\t\r\n\t//generating the qrcode and saving it to the temp folder\r\n\tQRcode::png($aName,$fileName,$errorCorrectionLevel,$matrixPointSize, 2);\r\n\t\t\r\n\t//gets the animals animal_ID\r\n\t$sql = \"SELECT animal_ID FROM tbl_Animals WHERE animal_Name ='\".$aName.\"'\";\r\n\t\r\n\tif(!$result = $db->query($sql)){\r\n\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t}\r\n\telse{\r\n\t\twhile ($row = $result->fetch_assoc()){\r\n\t\t\t$animal_ID = $row['animal_ID'];\r\n\t\t}\r\n\t\t\t//storing qrcode image as binary\r\n\t\t\t$QRImage = addslashes(file_get_contents($fileName));\r\n\t\t\t\r\n\t\t\t//sql to insert qrcode into tbl_QRCodes\r\n\t\t\t$insertQRCodeSQL = \"INSERT INTO tbl_QRCodes VALUES(NULL,'$QRImage','$generationDate','$animal_ID')\";\r\n\t\t\t\r\n\t\t\t\tif(!$result = $db->query($insertQRCodeSQL)){\r\n\t\t\t\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(DeleteTempQRCode($fileName)){\r\n\t\t\t\t\t\t$GLOBALS['Success'] = ' Animal Added';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$GLOBALS['Warning'] = ' Animal added but there was an error deleting the QRCode';\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\t\r\n}", "public function QRcode($kodenya)\n\t\t{\n\t\t QRcode::png(\n\t\t $kodenya,\n\t\t $outfile = false,\n\t\t $level = QR_ECLEVEL_H,\n\t\t $size = 6,\n\t\t $margin = 2\n\t\t );\n\t\t}", "public function CreateQR($cinema,$purchase,$number){\n $room=$cinema->getCinemaRoomList()[0];\n $function=$room->getFunctionList()[0];\n $movie=$function->getMovie();\n $QR=\"https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=\".$cinema->getCinemaName().\"/\".$cinema->getIdCinema().\"/\".$room->getRoomName().\"/\".$room->getIdCinemaRoom().\"/\".$function->getIdFunction().\"/\".$function->getDate().\"/\".$function->getTime().\"/\".$purchase->getIdPurchase().\"/\".$movie->getMovieName().\"/\".$movie->getIdMovie().\"/\".$number.\"&choe=UTF-8\";\n $QR=str_replace(\" \",\"-\",$QR);\n return $QR;\n }", "function addQRCode() {\n?>\n<script src=\"https://cdn.rawgit.com/davidshimjs/qrcodejs/04f46c6a/qrcode.min.js\">\n</script>\n<script src=\"https://unpkg.com/[email protected]/distribution/globalinputmessage.min.js\">\n</script>\n<script>\n\tjQuery(document).ready(function(){\n\t\tjQuery( \".message\" ).append('12121212');\n\n\t});\t\t\n</script>\n<script type=\"text/javascript\">\n\n\t(function() {\n\n\t var formElement = document.getElementById(\"loginform\");\n\t qrCodeElement = document.createElement('p');\n\n\t qrCodeElement.style.padding = \"10px\";\n\t qrCodeElement.style.backgroundColor = \"#FFFFFF\";\n\n\t formElement.parentNode.insertBefore(qrCodeElement, formElement);\n\n\t var globalinput = {\n\t api: require(\"global-input-message\")\n\t };\n\n\n\t globalinput.config = {\n\t onSenderConnected: function() {\n\t qrCodeElement.style.display = \"none\";\n\t },\n\t onSenderDisconnected: function() {\n\t qrCodeElement.style.display = \"block\";\n\t },\n\t initData: {\n\t action: \"input\",\n\t dataType: \"form\",\n\t form: {\n\t id: \"###username###@\" + window.location.hostname + \".wordpress\",\n\t title: \"Wordpress login\",\n\t fields: [{\n\t label: \"Username\",\n\t id: \"username\",\n\t operations: {\n\t onInput: function(username) {\n\t document.getElementById(\"user_login\").value = username;\n\t }\n\t }\n\n\t }, {\n\t label: \"Password\",\n\t id: \"password\",\n\t type: \"secret\",\n\t operations: {\n\t onInput: function(password) {\n\t document.getElementById(\"user_pass\").value = password;\n\t }\n\t }\n\n\t }, {\n\t label: \"Login\",\n\t type: \"button\",\n\t operations: {\n\t onInput: function() {\n\t document.getElementById(\"wp-submit\").click();\n\t }\n\t }\n\n\t }]\n\t }\n\t }\n\n\t };\n\t \n\t globalinput.connector = globalinput.api.createMessageConnector();\n\t globalinput.connector.connect(globalinput.config);\n\t var codedata = globalinput.connector.buildInputCodeData();\n\t var qrcode = new QRCode(qrCodeElement, {\n\t text: codedata,\n\t width: 300,\n\t height: 300,\n\t colorDark: \"#000000\",\n\t colorLight: \"#ffffff\",\n\t correctLevel: QRCode.CorrectLevel.H\n\t });\n\n\t})();\n\n</script>\n<?php\n\t}", "public function QRcode($kodenya){\n QRcode::png(\n $kodenya,\n $outfile = false,\n $level = QR_ECLEVEL_H,\n $size = 10,\n $margin = 1\n );\n }", "abstract public function setReceptionCode($newCode, $userId);", "abstract public function setReceptionCode($newCode, $userId);", "public function qrcode($no_peminjaman)\n {\n $peminjaman = Peminjaman::where('no_peminjaman', $no_peminjaman)\n ->where('email', Auth::user()->email)\n ->where('status_peminjaman', 'Booking')\n ->first();\n if (empty($peminjaman)) {\n return redirect('/daftar-peminjaman');\n } \n\n $renderer = new ImageRenderer(\n new RendererStyle(200),\n new ImagickImageBackEnd()\n );\n $writer = new Writer($renderer);\n // $qrcode = $writer->writeFile('Hello World!', 'qrcode.png');\n $qrcode = base64_encode($writer->writeString($peminjaman->token));\n\n return view('peminjaman.qrcode', compact('qrcode'));\n \n }", "public function changeuserpicture(){\n\t\t$this->load->model('front/customer_model');\n\t\t$id=$this->input->get('id');\n\t\t$data=$this->customer_model->edit_userpicture($id);\n\t\t$this->load->view('front/change_userpicture',$data);\n\t}", "function uniqueQRCodeToken()\n{\n\t$token = substr(md5(uniqid(rand(), true)),0,32); // creates a 32 digit token\n\t//SELECT * FROM entrp_login where qrCode='70f804625753d84827ef993329c3b1b8'\n $qry = \"SELECT * FROM entrp_login WHERE qrCode='\".$token.\"'\";\n $res=getData($qry);\n $count_res=mysqli_num_rows($res);\n if($count_res > 0)\n {\n uniqueQRCodeToken();\n } \n else \n {\n return $token;\n }\t\n}" ]
[ "0.64189076", "0.6334579", "0.6301796", "0.6230757", "0.6188718", "0.6108842", "0.5811042", "0.5739008", "0.5672111", "0.5582518", "0.55706817", "0.5555643", "0.55349094", "0.55248266", "0.5464873", "0.5456323", "0.54541564", "0.5434868", "0.541987", "0.54063636", "0.54046696", "0.5403771", "0.53960556", "0.5368828", "0.53664774", "0.5360248", "0.5360248", "0.5331827", "0.5313165", "0.53090113" ]
0.76036614
0
Function to fetch qrcode from database, if already generated September 22,2016
function fetchUserQRCodeFromDB($clientid) { $qrCode= ''; $qry="SELECT qrCode FROM entrp_login WHERE clientid=".$clientid." "; $res=getData($qry); $count_res=mysqli_num_rows($res); if($count_res>0) { while($row=mysqli_fetch_array($res)) { $qrCode = $row['qrCode']; } } return $qrCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function qrCode(){\n }", "function uniqueQRCodeToken()\n{\n\t$token = substr(md5(uniqid(rand(), true)),0,32); // creates a 32 digit token\n\t//SELECT * FROM entrp_login where qrCode='70f804625753d84827ef993329c3b1b8'\n $qry = \"SELECT * FROM entrp_login WHERE qrCode='\".$token.\"'\";\n $res=getData($qry);\n $count_res=mysqli_num_rows($res);\n if($count_res > 0)\n {\n uniqueQRCodeToken();\n } \n else \n {\n return $token;\n }\t\n}", "function getUserQRCode()\n{\n\t $qr = new qrcode();\n\t //the defaults starts\n\t global $myStaticVars;\n\t extract($myStaticVars); // make static vars local\n\t $member_default_avatar \t= $member_default_avatar;\n\t $member_default_cover\t\t= $member_default_cover;\n\t $member_default\t\t\t\t= $member_default;\n\t $company_default_cover\t\t= $company_default_cover;\n\t $company_default_avatar\t= $company_default_avatar;\n\t $events_default\t\t\t\t= $events_default;\n\t $event_default_poster\t\t= $event_default_poster;\n\t //the defaults ends\t\n\t\n\t $session_values=get_user_session();\n\t $my_session_id\t= $session_values['id'];\n\t if($my_session_id>0)\n\t {\n\t // how to build raw content - QRCode with Business Card (VCard) + photo \t \n\t //$tempDir = QRCODE_PATH; \n\t \n\t $data\t\t\t=\tfetch_info_from_entrp_login($my_session_id);\n\t \n\t $clientid \t\t= $data['clientid'];\n \t $username \t\t= $data['username'];\n \t $email \t\t\t= $data['email'];\n \t $firstname \t= $data['firstname'];\n \t $lastname \t\t= $data['lastname'];\n \t $voffStaff\t\t= $data['voffStaff'];\n\t\t $vofClientId\t= $data['vofClientId'];\t\n\t\t \n\t\t //Fetch qr-code from db if already generated\n\t\t $qrCode= fetchUserQRCodeFromDB($clientid);\n\t \n\t if($qrCode=='')\n\t {\n\t \t$qrCodeToken\t=\tuniqueQRCodeToken();\n\t \tsaveQRCOdeforUser($clientid,$qrCodeToken);\n\t }\n\t else\n\t {\n\t \t$qrCodeToken\t= $qrCode;\n\t }\n\t \n\t $qr->text($qrCodeToken);\n\t $data['qr_link'] \t\t\t= $qr->get_link();\n\t $data['client_id'] \t\t\t= $clientid;\n\t $data['vofClientId'] \t\t= $vofClientId;\n\t $data['vofStaffStatus'] \t= $voffStaff;\n\t //return $qr->get_link(); \n\t return $data; \n\t }\t \n}", "public function generateQrCode()\n {\n return $this->doRequest('GET', 'qr-code', []);\n }", "public function stock_get_qr_code($card_id, Request $request){\n\t\t$card = App\\Card::find($card_id);\n\t\tif($card !== null){\n\t\t\t$qr_code_str = base64_encode(json_encode(array(\"code\" => $card->code, \"password\" => $card->passwd)));\n\t\t\t$code_image = 'card/qrcode_'.$card->id.'.png';\n\t\t\t\n\t\t\tif(!is_file(public_path($code_image))){\n\t\t\t\t$renderer = new \\BaconQrCode\\Renderer\\Image\\Png();\n\t\t\t\t$renderer->setHeight(256);\n\t\t\t\t$renderer->setWidth(256);\n\t\t\t\t$writer = new \\BaconQrCode\\Writer($renderer);\n\t\t\t\t$writer->writeFile($qr_code_str, public_path($code_image));\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return_arr = array(\"status\" => true, \"img_code\" => $code_image);\n\t\t}else{\n\t\t\t$return_arr = array(\"status\" => false);\n\t\t}\n\t\techo json_encode($return_arr);\n\t}", "public static function getGenerateQrCode(Request $request){\n $title = \"Generate Qr Code\";\n $projectDetailObj = new \\App\\Project;\n $input = $request->all();\n $project = $projectDetailObj->find($input['id']);\n try{\n DB::beginTransaction();\n $explode_name = explode(' ',$project->name);\n\n $qrcode = mt_rand(1000000, 9999999).$explode_name[0].$project->id;\n // QrCode::size(500)->format('png')->generate($qrcode, public_path('storage/public/storage/user_images/'.$input['id'].'-code.png'));\n $project->update(['qrcode'=>$qrcode,'need_to_scan_qr'=>'enable']);\n DB::commit();\n /* Transaction successful. */\n }catch(\\Exception $e){ \n DB::rollback();\n /* Transaction failed. */\n }\n return \"1\" ;\n }", "function AddQRCode($aName,$db){\r\n\r\n\t\r\n\t$tempDir = dirname(__FILE__).DIRECTORY_SEPARATOR.'phpqrcode'.DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //setting the tempory directory to store the qrcode\r\n\t$fileName = $tempDir.$aName.'.png';//naming the qrcode file \r\n\t$errorCorrectionLevel = 'Q'; //setting the error correction level of the qrcode\r\n\t$matrixPointSize = 5; //setting the size of the generated qrcode\r\n\t$generationDate = date('Y/m/d');//setting the date\r\n\t\r\n\t//generating the qrcode and saving it to the temp folder\r\n\tQRcode::png($aName,$fileName,$errorCorrectionLevel,$matrixPointSize, 2);\r\n\t\t\r\n\t//gets the animals animal_ID\r\n\t$sql = \"SELECT animal_ID FROM tbl_Animals WHERE animal_Name ='\".$aName.\"'\";\r\n\t\r\n\tif(!$result = $db->query($sql)){\r\n\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t}\r\n\telse{\r\n\t\twhile ($row = $result->fetch_assoc()){\r\n\t\t\t$animal_ID = $row['animal_ID'];\r\n\t\t}\r\n\t\t\t//storing qrcode image as binary\r\n\t\t\t$QRImage = addslashes(file_get_contents($fileName));\r\n\t\t\t\r\n\t\t\t//sql to insert qrcode into tbl_QRCodes\r\n\t\t\t$insertQRCodeSQL = \"INSERT INTO tbl_QRCodes VALUES(NULL,'$QRImage','$generationDate','$animal_ID')\";\r\n\t\t\t\r\n\t\t\t\tif(!$result = $db->query($insertQRCodeSQL)){\r\n\t\t\t\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(DeleteTempQRCode($fileName)){\r\n\t\t\t\t\t\t$GLOBALS['Success'] = ' Animal Added';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$GLOBALS['Warning'] = ' Animal added but there was an error deleting the QRCode';\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\t\r\n}", "public function queryQRbyItsID($qrID){\n try{\n\n if($stmt=$this->DataBaseCon->prepare(\"SELECT QRitems FROM QRDataSet WHERE QRID=? \")){\n $stmt->bind_param('s',$qrID);\n $stmt->execute();\n $stmt->bind_result($QRitems);\n while ($stmt->fetch())\n {\n $getarray = unserialize($QRitems);\n }\n $stmt -> close();\n $array=array();\n foreach($getarray as $value){\n array_push($array,$this->getImageByItsID($value));\n }\n\n return $array;\n\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n\n }", "function comprobarcodeunico($codeunico)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT code FROM adm_discount_list WHERE code = %s \",\n\t\t GetSQLValueString($codeunico, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\tif ($totalRows_ConsultaFuncion==0) \n\t\treturn true;\n\telse return false;\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function getQRCode( $qraddress, $size ) {\n $alt_text = 'Send VRSC to ' . $qraddress;\n return \"\\n\" . '<img src=\"https://chart.googleapis.com/chart?chld=H|2&chs='.$size.'x'.$size.'&cht=qr&chl=' . $qraddress . '\" alt=\"' . $alt_text . '\" />' . \"\\n\";\n}", "function show_wpuf_qrcode( $id, $metakey ) {\n $qr_meta = get_post_meta( $id, $metakey , false );\n\n return $qr_meta[0]['image'];\n}", "public function qrcodeSave() {\r\n $user_id = \\Yii::$app->user->getId();\r\n $baseimgurl = 'date/upload/wechat/qrcode/';\r\n $createpath=\\Yii::$app->basePath.'/web/'.$baseimgurl;\r\n ToolService::createdir($createpath);\r\n //生成随机文件名\r\n $basefilename = $user_id . '_' . time() . '_' . rand(1000, 9999);\r\n $this->s_img_url = $sfilename = $baseimgurl . 's' . $basefilename . '.' . $this->file->extension;\r\n $this->o_img_url = $ofilename = $baseimgurl . 'o' . $basefilename . '.' . $this->file->extension;\r\n $this->m_img_url = $mfilename = $baseimgurl . 'm' . $basefilename . '.' . $this->file->extension;\r\n $this->b_img_url = $bfilename = $baseimgurl . 'b' . $basefilename . '.' . $this->file->extension;\r\n $this->file->saveAs($bfilename);\r\n $image = \\Yii::$app->image->load($bfilename);\r\n //生成中图片\r\n $image->resize(100, 100, Image::NONE);\r\n $image->save($mfilename);\r\n //生成小图片\r\n $image->resize(64, 64, Image::NONE);\r\n $image->save($sfilename);\r\n //生成微略图\r\n $image->resize(48, 48, Image::NONE);\r\n $image->save($ofilename);\r\n\r\n\r\n $newpic = new Pic();\r\n $newpic->setAttributes([\r\n 'user_id' => $user_id,\r\n 'pic_type' => 3,\r\n 'pic_s_img' => '/' . $sfilename,\r\n 'pic_m_img' => '/' . $mfilename,\r\n 'pic_b_img' => '/' . $bfilename\r\n ]);\r\n if ($newpic->save()) {\r\n $this->id = \\Yii::$app->db->getLastInsertID();\r\n return true;\r\n }\r\n return FALSE;\r\n }", "function changeQRCode()\n{\n\t$data= array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\tif($my_session_id>0)\n\t{\n\t\t$qrCodeToken\t=\tuniqueQRCodeToken();\n\t saveQRCOdeforUser($my_session_id,$qrCodeToken);\n\t $data=getLastUpdatedTimeQRCode($my_session_id);\n\t}\n\treturn $data;\n}", "public function qrcode($no_peminjaman)\n {\n $peminjaman = Peminjaman::where('no_peminjaman', $no_peminjaman)\n ->where('email', Auth::user()->email)\n ->where('status_peminjaman', 'Booking')\n ->first();\n if (empty($peminjaman)) {\n return redirect('/daftar-peminjaman');\n } \n\n $renderer = new ImageRenderer(\n new RendererStyle(200),\n new ImagickImageBackEnd()\n );\n $writer = new Writer($renderer);\n // $qrcode = $writer->writeFile('Hello World!', 'qrcode.png');\n $qrcode = base64_encode($writer->writeString($peminjaman->token));\n\n return view('peminjaman.qrcode', compact('qrcode'));\n \n }", "public function qrDownload(Document $document)\n {\n // si se hace la búsqueda por uuid y no se encuentra el resulado usar abort(404);\n return Storage::download(\"documents/{$document->qr_image}\");\n }", "public function generate(Request $request){ \n $data = $request->all();\n QRCode::text($data['code'])->png(); \n }", "public function showQrCode()\n {\n $this->app->qrCode->show($this->app->config['server.qr_uuid']);\n }", "function makeCode($url){\n $url = checkurl($url);\n \n $url = escape_string($url);\n //check if URL already exist\n $exist = query(\"SELECT code FROM links WHERE url = '{$url}'\");\n \n if(num_rows($exist) > 0){\n while ($row = mysqli_fetch_object($exist)) {\n return $row->code;\n }\n }\n \n $inserted_code = query(\"INSERT INTO links(url,date_created)VALUES('{$url}',NOW())\");\n //generate and store url code\n global $db;\n $code = mysqli_insert_id($db);\n $code = generateCode($code);\n \n //update the record with the generated code\n query(\"UPDATE links SET code ='{$code}' WHERE url = '{$url}'\");\n return $code;\n }", "function fetchQRCodeUpdatedTime()\n{\n\t$data= array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\tif($my_session_id>0)\n\t{\n\t $data=getLastUpdatedTimeQRCode($my_session_id);\n\t}\n\treturn $data;\n}", "function getASNCode($NGSSCode){\r\n $dbConnection = GetDBConnection();\r\n $queryNGSS = \"SELECT sCode FROM ngss_uri_mappings WHERE pCode = '\" . $NGSSCode . \"'\";\r\n if($res = mysqli_query($dbConnection, $queryNGSS)){\r\n if($row=$res->fetch_assoc()){\r\n return $row[\"sCode\"];\r\n }\r\n return \"error1\";\r\n }\r\n return \"error2\";\r\n}", "function getLastUpdatedTimeQRCode($clientid)\n{\n\t$data= array();\n\t$qry=\"SELECT qrCodeUpdatedDateTime FROM entrp_login WHERE clientid=\".$clientid.\" \";\n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n if($count_res>0)\n {\n \twhile($row=mysqli_fetch_array($res))\n \t{\n \t\t$data['lastUpdatedAt']\t=\t$row['qrCodeUpdatedDateTime'];\n \t}\t \n }\n\treturn $data;\n}", "function seatScanQR(Request $req){\n $input = app('request')->all();\n\n $rules = [\n 'qr_code' => ['required']\n ];\n\n $validator = app('validator')->make($input, $rules);\n if($validator->fails()){\n return $this->respond_json(412, 'Invalid input', $input);\n }\n\n $bookh = new BookingHelper;\n return $bookh->checkSeat($req->qr_code, 'qr_code');\n }", "function download_rcpt()\n\t{\n\n\t\t$root = $_SERVER['DOCUMENT_ROOT'];\n\t\t$nmfile = glob($root.'/qrcode/download/ebs/unprocess/*7167STOCKRECEIPT*.csv', GLOB_BRACE);\n\n\t\t$sql\t=\" select count(1) ADA_DATA \n\t\t\t\t\t from STOCK_ISSUE_INBOUND\n\t\t\t\t\t where file_name = $nmfile\n\t\t\t\t\t and STATUS not in ('DRAFT')\n\t\t\t\t\t \";\t\t\n\n\t\t$qReqID = $this->db->query($sql);\n\t\t$row = $qReqID->row(); \t\n\t\t$isAdaData = $row->ADA_DATA; \n\n\t\t// end validasi\n\t\tset_time_limit(0);\n\t\t\n\t\tif ($isAdaData == 1)\n\t\t{\n\t\t\techo '2';\t\n\t\t} else \n\t\t{\n\t\t\t$data\t= $this->Sync_Ebis_mdl->get_download_rcpt();\n\t\t\t\n\t\t\tif($data){\n\t\t\t\techo '1';\n\t\t\t} else {\n\t\t\t\techo '0';\n\t\t\t}\n\t\t}\n\t}", "function cargarPQR($idPQR){\n\t\t\t$query = \"SELECT *, p.id as pqrId, u.id as userId FROM pqr p\n\t\t\tINNER JOIN users u ON u.`id` = p.`id_usuario`\n\t\t\t WHERE p.id = $idPQR\";\n\t\t\t$rst = $this->db->enviarQuery($query,'R');\n\t\t\t\n\t\t\tif(@$rst[0]['id'] != \"\"){\n\t\t\t\treturn $rst;\n\t\t\t}else{\n\t\t\t\treturn array(\"ErrorStatus\"=>true);\n\t\t\t}\n\t\t}", "public function download_qrcode($filename)\n {\n $file_path = storage_path() .'/app/public/img/qr-code/kader/'. $filename;\n if (file_exists($file_path))\n {\n // Send Download\n return Response::download($file_path, $filename, [\n 'Content-Length: '. filesize($file_path)\n ]);\n }\n else\n {\n Session::flash('error','Requested file does not exist on our server!');\n // Error\n return back();\n }\n }", "function getzazzleurlcode($id){\n\n\t$query=(\"SELECT * FROM lala_camisetas WHERE id = '$id'\");\n\t$result=mysql_query($query);\n\t$row = mysql_fetch_array($result);\n\t\n\tif ($row['zazzlecodeURL']==\"\") {$ret = 0;} else {$ret=$row['zazzlecodeURL'];}\n\t\n\treturn $ret;\n\n}", "abstract protected function getTCPDFBarcode();", "public function qr(Link $link): Response\n {\n return response($link->qrCodeImage)\n ->header('Content-type','image/png');\n }", "public function exportQrcodes()\n {\n try {\n $fields = [\n 'qrcodes.id',\n 'books.title',\n DB::raw('CONCAT(prefix, IF(LENGTH(code_id) < ' . Qrcode::LENGTH_OF_QRCODE . ', LPAD(code_id, ' . Qrcode::LENGTH_OF_QRCODE . ', 0), code_id)) AS qrcode'),\n ];\n $qrcodes = Qrcode::select($fields)\n ->join('books', 'books.id', '=', 'qrcodes.book_id')\n ->where('qrcodes.status', Qrcode::IS_NOT_PRINTED)\n ->get()\n ->toArray();\n if (!empty($qrcodes)) {\n Excel::create('Qrcodes', function ($excel) use ($qrcodes) {\n $excel->sheet('Export Qrcode', function ($sheet) use ($qrcodes) {\n $sheet->fromArray($qrcodes);\n });\n DB::table('qrcodes')\n ->where('status', Qrcode::IS_NOT_PRINTED)\n ->update(['status' => Qrcode::IS_PRINTED]);\n })->export(config('define.qrcodes.format_file_export'));\n } else {\n flash(__('qrcodes.download_failed'))->error();\n return redirect()->route('qrcodes.index');\n }\n } catch (Exception $e) {\n \\Log::error($e);\n return redirect()->back();\n }\n }", "static protected function RequestCodex(){\n\n\t\t\t\treturn \\_nativeCrypt::RKCRandm(\\_nativeCrypt::PALETTE_iALPHA . date('Ymd.his') . '::' . \\_nativeCrypt::PALETTE_NUMERIC);\n\n\t\t\t}" ]
[ "0.6689841", "0.6598756", "0.6598087", "0.62843734", "0.6255885", "0.6210461", "0.6180097", "0.59823817", "0.5951755", "0.5935147", "0.5934314", "0.58158976", "0.5798777", "0.5797228", "0.57851756", "0.57811624", "0.5737487", "0.5725353", "0.5701284", "0.569396", "0.56815964", "0.565689", "0.5609386", "0.5598348", "0.5592953", "0.5544299", "0.55384874", "0.55081654", "0.5506839", "0.5504457" ]
0.70207036
0
Function to save QR code of the user in database September 22,2016
function saveQRCOdeforUser($clientid,$qrCodeToken) { date_default_timezone_set('UTC'); $updatedAt=date('Y-m-d H:i:s'); $qry="UPDATE entrp_login SET qrCode='".$qrCodeToken."',qrCodeUpdatedDateTime='".$updatedAt."' WHERE clientid=".$clientid." "; setData($qry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function qrcodeSave() {\r\n $user_id = \\Yii::$app->user->getId();\r\n $baseimgurl = 'date/upload/wechat/qrcode/';\r\n $createpath=\\Yii::$app->basePath.'/web/'.$baseimgurl;\r\n ToolService::createdir($createpath);\r\n //生成随机文件名\r\n $basefilename = $user_id . '_' . time() . '_' . rand(1000, 9999);\r\n $this->s_img_url = $sfilename = $baseimgurl . 's' . $basefilename . '.' . $this->file->extension;\r\n $this->o_img_url = $ofilename = $baseimgurl . 'o' . $basefilename . '.' . $this->file->extension;\r\n $this->m_img_url = $mfilename = $baseimgurl . 'm' . $basefilename . '.' . $this->file->extension;\r\n $this->b_img_url = $bfilename = $baseimgurl . 'b' . $basefilename . '.' . $this->file->extension;\r\n $this->file->saveAs($bfilename);\r\n $image = \\Yii::$app->image->load($bfilename);\r\n //生成中图片\r\n $image->resize(100, 100, Image::NONE);\r\n $image->save($mfilename);\r\n //生成小图片\r\n $image->resize(64, 64, Image::NONE);\r\n $image->save($sfilename);\r\n //生成微略图\r\n $image->resize(48, 48, Image::NONE);\r\n $image->save($ofilename);\r\n\r\n\r\n $newpic = new Pic();\r\n $newpic->setAttributes([\r\n 'user_id' => $user_id,\r\n 'pic_type' => 3,\r\n 'pic_s_img' => '/' . $sfilename,\r\n 'pic_m_img' => '/' . $mfilename,\r\n 'pic_b_img' => '/' . $bfilename\r\n ]);\r\n if ($newpic->save()) {\r\n $this->id = \\Yii::$app->db->getLastInsertID();\r\n return true;\r\n }\r\n return FALSE;\r\n }", "function save_qrcoupon($Data){\n $this->db->insert(\"r_app_qrcode_values\", $Data);\n return $this->db->insert_id();\n }", "function save_qr_meta_user( $post_data, $user_id, $meta_key, $form_settings ) {\n $type = $post_data['qr_code_type'];\n\n if( $type == '' && empty( $type ) ) {\n return;\n }\n\n $metadata = array(\n 'type' => $post_data['qr_code_type'],\n 'type_param' => $post_data['type_param']\n );\n\n update_user_meta( $user_id, $meta_key, $metadata );\n }", "function changeQRCode()\n{\n\t$data= array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\tif($my_session_id>0)\n\t{\n\t\t$qrCodeToken\t=\tuniqueQRCodeToken();\n\t saveQRCOdeforUser($my_session_id,$qrCodeToken);\n\t $data=getLastUpdatedTimeQRCode($my_session_id);\n\t}\n\treturn $data;\n}", "function save_QRCode_Event_BA_DM_Plugin(){\n\t\tglobal $post;\n\t\t# prüft zerst $post, ist er nicht vorhanden dann lohnen sich die unteren Abfragen nicht, da es ja noch keine Posts dazu gibt und es zu lauter Fehlermeldungen führen würde (wegen nicht vorhandener Post-Einträge)\n\t\tif (!empty($post)) {\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_name\", $_POST['qrCode_event_name']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_start\", $_POST['qrCode_event_start']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_end\", $_POST['qrCode_event_end']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_location\", $_POST['qrCode_event_location']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_description\", $_POST['qrCode_event_description']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_size\", $_POST['qrCode_event_size']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_ecc_level\", $_POST['qrCode_event_ecc_level']);\n\t\t}\n\n\t}", "function guardarPQR($idUsuario,$tipo_pqr,$asunto_pqr ){\n\t\t\t$fecha_creacion = date('Y-m-d h:i:s');\n\t\t\t\n\t\t\t//validacion vencimiento segun tipo de PQR\n\t\t\tif($tipo_pqr == 'Petición'){\n\t\t\t\t$limiteAtencion = 7;\n\t\t\t}else if($tipo_pqr == 'Queja'){\n\t\t\t\t$limiteAtencion = 3;\n\t\t\t}else if($tipo_pqr == 'Reclamo'){\n\t\t\t\t$limiteAtencion = 2;\n\t\t\t}\n\t\t\t$nuevafecha = strtotime ( '+'.$limiteAtencion.' day' , strtotime ( $fecha_creacion ) ) ;\n\t\t\t$fechaLimite = date ( 'Y-m-d h:i:s' , $nuevafecha );\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t$query = \"INSERT INTO pqr (id_usuario,tipo_pqr,asunto_pqr,estado,fecha_creacion,fecha_limite) \n\t\t\tVALUES (\n\t\t\t\t'\".$idUsuario.\"',\n\t\t\t\t'\".$tipo_pqr.\"',\n\t\t\t\t'\".$asunto_pqr.\"',\n\t\t\t\t'Nuevo',\n\t\t\t\t'\".$fecha_creacion.\"',\n\t\t\t\t'\".$fechaLimite.\"'\n\t\t\t\t);\";\n\n\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}", "function AddQRCode($aName,$db){\r\n\r\n\t\r\n\t$tempDir = dirname(__FILE__).DIRECTORY_SEPARATOR.'phpqrcode'.DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //setting the tempory directory to store the qrcode\r\n\t$fileName = $tempDir.$aName.'.png';//naming the qrcode file \r\n\t$errorCorrectionLevel = 'Q'; //setting the error correction level of the qrcode\r\n\t$matrixPointSize = 5; //setting the size of the generated qrcode\r\n\t$generationDate = date('Y/m/d');//setting the date\r\n\t\r\n\t//generating the qrcode and saving it to the temp folder\r\n\tQRcode::png($aName,$fileName,$errorCorrectionLevel,$matrixPointSize, 2);\r\n\t\t\r\n\t//gets the animals animal_ID\r\n\t$sql = \"SELECT animal_ID FROM tbl_Animals WHERE animal_Name ='\".$aName.\"'\";\r\n\t\r\n\tif(!$result = $db->query($sql)){\r\n\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t}\r\n\telse{\r\n\t\twhile ($row = $result->fetch_assoc()){\r\n\t\t\t$animal_ID = $row['animal_ID'];\r\n\t\t}\r\n\t\t\t//storing qrcode image as binary\r\n\t\t\t$QRImage = addslashes(file_get_contents($fileName));\r\n\t\t\t\r\n\t\t\t//sql to insert qrcode into tbl_QRCodes\r\n\t\t\t$insertQRCodeSQL = \"INSERT INTO tbl_QRCodes VALUES(NULL,'$QRImage','$generationDate','$animal_ID')\";\r\n\t\t\t\r\n\t\t\t\tif(!$result = $db->query($insertQRCodeSQL)){\r\n\t\t\t\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(DeleteTempQRCode($fileName)){\r\n\t\t\t\t\t\t$GLOBALS['Success'] = ' Animal Added';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$GLOBALS['Warning'] = ' Animal added but there was an error deleting the QRCode';\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\t\r\n}", "function getUserQRCode()\n{\n\t $qr = new qrcode();\n\t //the defaults starts\n\t global $myStaticVars;\n\t extract($myStaticVars); // make static vars local\n\t $member_default_avatar \t= $member_default_avatar;\n\t $member_default_cover\t\t= $member_default_cover;\n\t $member_default\t\t\t\t= $member_default;\n\t $company_default_cover\t\t= $company_default_cover;\n\t $company_default_avatar\t= $company_default_avatar;\n\t $events_default\t\t\t\t= $events_default;\n\t $event_default_poster\t\t= $event_default_poster;\n\t //the defaults ends\t\n\t\n\t $session_values=get_user_session();\n\t $my_session_id\t= $session_values['id'];\n\t if($my_session_id>0)\n\t {\n\t // how to build raw content - QRCode with Business Card (VCard) + photo \t \n\t //$tempDir = QRCODE_PATH; \n\t \n\t $data\t\t\t=\tfetch_info_from_entrp_login($my_session_id);\n\t \n\t $clientid \t\t= $data['clientid'];\n \t $username \t\t= $data['username'];\n \t $email \t\t\t= $data['email'];\n \t $firstname \t= $data['firstname'];\n \t $lastname \t\t= $data['lastname'];\n \t $voffStaff\t\t= $data['voffStaff'];\n\t\t $vofClientId\t= $data['vofClientId'];\t\n\t\t \n\t\t //Fetch qr-code from db if already generated\n\t\t $qrCode= fetchUserQRCodeFromDB($clientid);\n\t \n\t if($qrCode=='')\n\t {\n\t \t$qrCodeToken\t=\tuniqueQRCodeToken();\n\t \tsaveQRCOdeforUser($clientid,$qrCodeToken);\n\t }\n\t else\n\t {\n\t \t$qrCodeToken\t= $qrCode;\n\t }\n\t \n\t $qr->text($qrCodeToken);\n\t $data['qr_link'] \t\t\t= $qr->get_link();\n\t $data['client_id'] \t\t\t= $clientid;\n\t $data['vofClientId'] \t\t= $vofClientId;\n\t $data['vofStaffStatus'] \t= $voffStaff;\n\t //return $qr->get_link(); \n\t return $data; \n\t }\t \n}", "public function store(QRCodeInterface $qrCode, $id = null);", "public function save_to_db() {\r\n if ($this->id) {\r\n $stmt = $this->pdo->prepare(\"UPDATE contract SET\r\n companyName=:companyName,\r\n Signature=:Signature\r\n WHERE id=:identity\r\n \");\r\n $input_parameters = array(\r\n ':identity' => $this->id,\r\n ':companyName' => $this->companyName,\r\n ':sygnatura' => $this->signature,\r\n );\r\n $upload = $stmt->execute(\r\n $input_parameters\r\n );\r\n }\r\n//po��czenie z baz� i sprawdzenie czy ju� jest taka umowa\r\n else {\r\n $stmt = $this->pdo->prepare(\"SELECT * FROM contract WHERE Signature=:signature\");\r\n $stmt->bindParam(':signature', $this->signature, PDO::PARAM_STR);\r\n\r\n if ($stmt->rowCount() > 0)\r\n return self::SAVE_ERROR_DUPLICATE_SIGNATURE;\r\n $stmt = $this->pdo->prepare(\"INSERT INTO contract VALUES (NULL, :companyName, :signature,NULL, NULL )\");\r\n $upload = $stmt->execute(\r\n array(\r\n ':signature' => $this->signature,\r\n ':companyName' => $this->companyName\r\n )\r\n );\r\n }\r\n// komunikat o zapisie\r\n if ($upload)\r\n return self::SAVE_OK;\r\n else\r\n return self::SAVE_ERROR_DB;\r\n }", "function save_qr_meta( $post_data, $post_id, $meta_key, $form_settings ) {\n $type = $post_data['qr_code_type'];\n\n if( $type == '' && empty( $type ) ) {\n return;\n }\n\n $metadata = array(\n 'type' => $post_data['qr_code_type'],\n 'type_param' => $post_data['type_param']\n );\n\n update_post_meta( $post_id, $meta_key, $metadata );\n }", "public static function getGenerateQrCode(Request $request){\n $title = \"Generate Qr Code\";\n $projectDetailObj = new \\App\\Project;\n $input = $request->all();\n $project = $projectDetailObj->find($input['id']);\n try{\n DB::beginTransaction();\n $explode_name = explode(' ',$project->name);\n\n $qrcode = mt_rand(1000000, 9999999).$explode_name[0].$project->id;\n // QrCode::size(500)->format('png')->generate($qrcode, public_path('storage/public/storage/user_images/'.$input['id'].'-code.png'));\n $project->update(['qrcode'=>$qrcode,'need_to_scan_qr'=>'enable']);\n DB::commit();\n /* Transaction successful. */\n }catch(\\Exception $e){ \n DB::rollback();\n /* Transaction failed. */\n }\n return \"1\" ;\n }", "function insert_data($qr)\n {\n $this->db->insert($this->tbl_qr, $qr);\n return ($this->db->affected_rows());\n }", "function save() {\n if ($this->nid && $this->license_uri) {\n $data = serialize($this);\n $data = str_replace(\"'\", \"\\'\", $data);\n $result = db_query(\"INSERT INTO {creativecommons} (nid, data) VALUES (%d, '%s')\", $this->nid, $data);\n return $result;\n }\n return;\n }", "function update_qr_code_with_user ( $user_id, $form_id, $form_settings, $form_vars ) {\n foreach ( $form_vars as $value ) {\n if( $value['input_type'] == 'qr_code' ) {\n $post_data = $_POST[$value['name']];\n $this->save_qr_meta_user( $post_data, $user_id, $value['name'], $form_settings );\n }\n }\n }", "function save()\r\n\t {\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \tif($model->saveSettings() && $this->createPrintSettingsConfFile())\r\n\t \t{\r\n\t \t\t$msg = JText::_('COM_QRCODE_SETTINGS_SAVE');\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\t$msg = JText::_('COM_QRCODE_SETTINGS_SAVE_ERROR');\r\n\t \t}\r\n\t \t$link = JRoute::_('index.php?option=com_qrcode', false);\r\n\t $this->setRedirect($link, $msg);\r\n\t }", "public function insertQrReocrd($getQrid,$getQrCodeUrl,$qrName,$qrItems,$userSession){\n date_default_timezone_set('Australia/Melbourne');\n $date = date('m/d/Y h:i:s a', time());\n try{\n\n if($stmt=$this->DataBaseCon->prepare(\"INSERT QRDataSet (QRID,QRPath,QRName,QRitems,QRDate,userID) VALUE (?,?,?,?,?,?)\")){\n $stmt->bind_param('ssssss',$getQrid,$getQrCodeUrl,$qrName,$qrItems,$date,$userSession);\n $stmt->execute();\n $stmt->close();\n return true;\n\n }\n else{\n return false;\n }\n\n }catch(Expection $e){\n return false;\n }\n\n }", "public function saveNewUser()\n\t{\n\t\t \n\t\t\n\t\t $date=date(\"Y-m-d H:i:s\");\n\t\t// $time= date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $date)));\n\t\t \n\t\t$database = new db_Database();\n\t\t\n\t\t//$database->query(\"select * from users\");\n\t\t\n\t\t$database->query(\"insert into users (email,pass,userName,signUpTime) VALUES(:email,:pass,:userName,:signUpTime)\");\n\t\t\n\t\t\n\t\t$pass=md5($this->password);\n\t\tif ($this->password==\"\")\n\t\t{\n\t\t\t$pass=\"-1\";\t\n\t\t}\n\t\t$database->bind(\":email\",$this->email);\n\t\t$database->bind(\":pass\",$pass);\n\t\t\n\t\t$database->bind(\":userName\",$this->userName);\n\t\t$database->bind(\":signUpTime\",$date);\n\t\n\t//\techo $database->q;\n\t\t\n\t\t$database->execute();\n\t\t\n\t\t$database->query(\"select * from users\");\n\t\t$database->execute();\n\t\t\n\t\t\n\t\t\n\t\t$database->query(\"select id from users where email=:email\");\n\t\t$database->bind(\":email\",$this->email);\n\t\t$result=$database->resultset();\n\t\t\n\t\t$id2=$result[0]['id'];\n\t\t$this->userID=$id2;\n\t\t\n\t\t$myCode=$id2.$this->userName.$this->email;\n\t\t$myCode=md5($myCode);\n\t\t//file_put_contents(\"newUser.txt\",$this->userName);\n\t\t\n\t\t$pubCode=$this->email.$id2;\n\t\t$pubCode=md5($pubCode);\n\t\t\n\t\t//echo \"update user code \";\n\t\t//$database3 = new db_Database();\n\t\t$database->query(\"update users set userCode=:myCode where id=:id\");\n\t\t$database->bind(\":myCode\",$myCode);\n\t\t$database->bind(\":id\",$id2);\n\t\t$database->execute();\n\t\t\n\t\t$this->userCode=$myCode;\n\t\t\n\t\t\n\t}", "public function qrCode(){\n }", "function saveUserAccessCode($user_id, $access_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// not really sure what to do about ANONYMOUS_USER_ID\n\t\t\n\t\t$next_id = $ilDB->nextId('svy_anonymous');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_anonymous (anonymous_id, survey_key, survey_fi, user_key, tstamp) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text', 'integer', 'text', 'integer'),\n\t\t\tarray($next_id, $access_code, $this->getSurveyId(), md5($user_id), time())\n\t\t);\n\t}", "function save_qr_code_with_post( $post_id, $form_id, $form_settings, $form_vars ) {\n foreach ( $form_vars as $value ) {\n if( $value['input_type'] == 'qr_code' ) {\n $post_data = $_POST[$value['name']];\n $this->save_qr_meta( $post_data, $post_id, $value['name'], $form_settings );\n }\n }\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();" ]
[ "0.6927675", "0.66051584", "0.64536387", "0.64484525", "0.6445947", "0.6445253", "0.6400585", "0.63203114", "0.6203617", "0.6072156", "0.6022365", "0.59619814", "0.58937997", "0.58912724", "0.58901906", "0.587052", "0.5861061", "0.5836587", "0.5833277", "0.57605004", "0.571491", "0.56979126", "0.56979126", "0.56979126", "0.56979126", "0.56979126", "0.56979126", "0.56979126", "0.56979126", "0.56979126" ]
0.7427749
0
Function to generate qrcode for a user September 17,2016
function getUserQRCode() { $qr = new qrcode(); //the defaults starts global $myStaticVars; extract($myStaticVars); // make static vars local $member_default_avatar = $member_default_avatar; $member_default_cover = $member_default_cover; $member_default = $member_default; $company_default_cover = $company_default_cover; $company_default_avatar = $company_default_avatar; $events_default = $events_default; $event_default_poster = $event_default_poster; //the defaults ends $session_values=get_user_session(); $my_session_id = $session_values['id']; if($my_session_id>0) { // how to build raw content - QRCode with Business Card (VCard) + photo //$tempDir = QRCODE_PATH; $data = fetch_info_from_entrp_login($my_session_id); $clientid = $data['clientid']; $username = $data['username']; $email = $data['email']; $firstname = $data['firstname']; $lastname = $data['lastname']; $voffStaff = $data['voffStaff']; $vofClientId = $data['vofClientId']; //Fetch qr-code from db if already generated $qrCode= fetchUserQRCodeFromDB($clientid); if($qrCode=='') { $qrCodeToken = uniqueQRCodeToken(); saveQRCOdeforUser($clientid,$qrCodeToken); } else { $qrCodeToken = $qrCode; } $qr->text($qrCodeToken); $data['qr_link'] = $qr->get_link(); $data['client_id'] = $clientid; $data['vofClientId'] = $vofClientId; $data['vofStaffStatus'] = $voffStaff; //return $qr->get_link(); return $data; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateQrCode()\n {\n return $this->doRequest('GET', 'qr-code', []);\n }", "public function generateQRCode()\n {\n if (! $this->getUser()->loginSecurity || ! $this->getUser()->loginSecurity->google2fa_secret) {\n $this->generate2faSecret();\n $this->getUser()->refresh();\n }\n\n $g2faUrl = $this->googleTwoFaService->getQRCodeUrl(\n config('app.name'),\n $this->getUser()->email,\n $this->getUser()->loginSecurity->google2fa_secret\n );\n\n $writer = new Writer(\n new ImageRenderer(\n new RendererStyle(400),\n new ImagickImageBackEnd()\n )\n );\n\n return [\n 'image' => 'data:image/png;base64,' . base64_encode($writer->writeString($g2faUrl)),\n 'otp_url' => $g2faUrl,\n 'secret' => $this->getUser()->loginSecurity->google2fa_secret,\n ];\n }", "private function generate_barcode($userName) {\n $hash = substr(hash('sha256',$userName.time()), 0, 20);\n $chars = str_split($hash);\n $newhash = '';\n foreach ($chars as $c) {\n $num = ord($c);\n if (($num > 47) && ($num < 58)) {\n //numbers are ok\n $newhash .= $c;\n }\n else if (($num > 64) && ($num < 91)) {\n //uppercase letters: \"translate\" to a number\n $newhash .= strval($num - 64);\n }\n else if (($num > 96) && ($num < 123)) {\n //lowercase letters: \"translate\" to a number\n $newhash .= strval($num - 96);\n }\n //else: skip the others\n }\n //put '90' before the first 8 characters, making it very possible that the resulting barcode is not unique...\n return '90'.substr($newhash, 0, 8);\n }", "public function qrCode(){\n }", "function getQRCode( $qraddress, $size ) {\n $alt_text = 'Send VRSC to ' . $qraddress;\n return \"\\n\" . '<img src=\"https://chart.googleapis.com/chart?chld=H|2&chs='.$size.'x'.$size.'&cht=qr&chl=' . $qraddress . '\" alt=\"' . $alt_text . '\" />' . \"\\n\";\n}", "public function generate(Request $request){ \n $data = $request->all();\n QRCode::text($data['code'])->png(); \n }", "public static function getGenerateQrCode(Request $request){\n $title = \"Generate Qr Code\";\n $projectDetailObj = new \\App\\Project;\n $input = $request->all();\n $project = $projectDetailObj->find($input['id']);\n try{\n DB::beginTransaction();\n $explode_name = explode(' ',$project->name);\n\n $qrcode = mt_rand(1000000, 9999999).$explode_name[0].$project->id;\n // QrCode::size(500)->format('png')->generate($qrcode, public_path('storage/public/storage/user_images/'.$input['id'].'-code.png'));\n $project->update(['qrcode'=>$qrcode,'need_to_scan_qr'=>'enable']);\n DB::commit();\n /* Transaction successful. */\n }catch(\\Exception $e){ \n DB::rollback();\n /* Transaction failed. */\n }\n return \"1\" ;\n }", "public function new_barcode($userName) {\n $barcode = $this->generate_barcode($userName);\n //check max 20 times in WMS whether the barcode already exists\n $max_repeats = 20;\n $repeat = 0;\n while ($this->barcode_exists($barcode) && ($repeat < $max_repeats)) {\n $repeat++;\n $barcode = $this->generate_barcode($userName);\n }\n if ($repeat >= $max_repeats) {\n return FALSE;\n }\n else {\n return $barcode;\n }\n }", "public function qrcode($no_peminjaman)\n {\n $peminjaman = Peminjaman::where('no_peminjaman', $no_peminjaman)\n ->where('email', Auth::user()->email)\n ->where('status_peminjaman', 'Booking')\n ->first();\n if (empty($peminjaman)) {\n return redirect('/daftar-peminjaman');\n } \n\n $renderer = new ImageRenderer(\n new RendererStyle(200),\n new ImagickImageBackEnd()\n );\n $writer = new Writer($renderer);\n // $qrcode = $writer->writeFile('Hello World!', 'qrcode.png');\n $qrcode = base64_encode($writer->writeString($peminjaman->token));\n\n return view('peminjaman.qrcode', compact('qrcode'));\n \n }", "function attendance_renderqrcode($session) {\n global $CFG;\n\n if (strlen($session->studentpassword) > 0) {\n $qrcodeurl = $CFG->wwwroot . '/mod/attendance/attendance.php?qrpass=' .\n $session->studentpassword . '&sessid=' . $session->id;\n } else {\n $qrcodeurl = $CFG->wwwroot . '/mod/attendance/attendance.php?sessid=' . $session->id;\n }\n\n $barcode = new TCPDF2DBarcode($qrcodeurl, 'QRCODE');\n $image = $barcode->getBarcodePngData(15, 15);\n echo html_writer::img('data:image/png;base64,' . base64_encode($image), get_string('qrcode', 'attendance'));\n}", "function qrcodeGenerate()\r\n\t {\r\n\t \t$selectedValue = JRequest::getVar('selectedValue');\r\n\t \t$selectedProductId = explode(\",\", $selectedValue);\r\n\t \tarray_pop($selectedProductId);\r\n\t \t$qrcodeId = implode(',',$selectedProductId);\r\n\t \t$qrcodeGenerateResult = $this->generateQrcode($selectedProductId);//function to generate qrcode for product.\r\n\t \t$path = urldecode(JRequest::getVar('redirectPath'));\r\n\t $this->setRedirect($path,$qrcodeGenerateResult);\r\n\t }", "public function createQrCodeForUser($type = 'PNG')\n\t{\n\t\treturn $this->createQrCode($this->getOtpAuthUrl($this->secret, \\App\\User::getUserModel($this->userId)->getDetail('user_name')), $type);\n\t}", "public function CreateQR($cinema,$purchase,$number){\n $room=$cinema->getCinemaRoomList()[0];\n $function=$room->getFunctionList()[0];\n $movie=$function->getMovie();\n $QR=\"https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=\".$cinema->getCinemaName().\"/\".$cinema->getIdCinema().\"/\".$room->getRoomName().\"/\".$room->getIdCinemaRoom().\"/\".$function->getIdFunction().\"/\".$function->getDate().\"/\".$function->getTime().\"/\".$purchase->getIdPurchase().\"/\".$movie->getMovieName().\"/\".$movie->getIdMovie().\"/\".$number.\"&choe=UTF-8\";\n $QR=str_replace(\" \",\"-\",$QR);\n return $QR;\n }", "function uniqueQRCodeToken()\n{\n\t$token = substr(md5(uniqid(rand(), true)),0,32); // creates a 32 digit token\n\t//SELECT * FROM entrp_login where qrCode='70f804625753d84827ef993329c3b1b8'\n $qry = \"SELECT * FROM entrp_login WHERE qrCode='\".$token.\"'\";\n $res=getData($qry);\n $count_res=mysqli_num_rows($res);\n if($count_res > 0)\n {\n uniqueQRCodeToken();\n } \n else \n {\n return $token;\n }\t\n}", "public function qrcodeSave() {\r\n $user_id = \\Yii::$app->user->getId();\r\n $baseimgurl = 'date/upload/wechat/qrcode/';\r\n $createpath=\\Yii::$app->basePath.'/web/'.$baseimgurl;\r\n ToolService::createdir($createpath);\r\n //生成随机文件名\r\n $basefilename = $user_id . '_' . time() . '_' . rand(1000, 9999);\r\n $this->s_img_url = $sfilename = $baseimgurl . 's' . $basefilename . '.' . $this->file->extension;\r\n $this->o_img_url = $ofilename = $baseimgurl . 'o' . $basefilename . '.' . $this->file->extension;\r\n $this->m_img_url = $mfilename = $baseimgurl . 'm' . $basefilename . '.' . $this->file->extension;\r\n $this->b_img_url = $bfilename = $baseimgurl . 'b' . $basefilename . '.' . $this->file->extension;\r\n $this->file->saveAs($bfilename);\r\n $image = \\Yii::$app->image->load($bfilename);\r\n //生成中图片\r\n $image->resize(100, 100, Image::NONE);\r\n $image->save($mfilename);\r\n //生成小图片\r\n $image->resize(64, 64, Image::NONE);\r\n $image->save($sfilename);\r\n //生成微略图\r\n $image->resize(48, 48, Image::NONE);\r\n $image->save($ofilename);\r\n\r\n\r\n $newpic = new Pic();\r\n $newpic->setAttributes([\r\n 'user_id' => $user_id,\r\n 'pic_type' => 3,\r\n 'pic_s_img' => '/' . $sfilename,\r\n 'pic_m_img' => '/' . $mfilename,\r\n 'pic_b_img' => '/' . $bfilename\r\n ]);\r\n if ($newpic->save()) {\r\n $this->id = \\Yii::$app->db->getLastInsertID();\r\n return true;\r\n }\r\n return FALSE;\r\n }", "public static function getQRCode($secret, $username, $width = 200, $height = 200, $returnAsImage = true) {\n\n\t\tglobal $wgGAIssuer, $wgSitename;\n\n\t\t// Replace sitename to $wgSitename\n\t\t$issuer = str_replace('__SITENAME__', $wgSitename, $wgGAIssuer);\n\n\t\t// Set CHL\n\t\t$chl = urlencode(\"otpauth://totp/{$username}?secret={$secret}\");\n\t\t$chl .= urlencode(\"&issuer=\". urlencode(\"{$issuer}\"));\n\n\t\t// Set the sourceUrl\n\t\t$sourceUrl = \"https://chart.googleapis.com/chart?chs={$width}x{$height}&chld=H|0&cht=qr&chl={$chl}\";\n\n\t\treturn ($returnAsImage)\n\t\t\t? file_get_contents( $sourceUrl )\n\t\t\t: $sourceUrl;\n\n\t}", "function generateQrcode($selectedProductId)\r\n \t{\r\n \t\t$ProductId = implode(',',$selectedProductId);\r\n \t\t$model\t\t= &$this->getModel();\r\n \t\t$productDetails = $model->getCategoryByProduct($ProductId);\r\n \t\t$qrcodeImagePath = JPATH_ROOT.DS . 'images'.DS.'qrcode';\r\n if ( !is_dir($qrcodeImagePath) )\r\n\t\t\t{\r\n\t\t\t\tmkdir($qrcodeImagePath,0777,true);\r\n\t\t\t}\r\n \t\tfor($i = 0;$i <count($productDetails);$i++)\r\n \t\t{\r\n \t\t\t$qrcodeProductId = $selectedProductId[$i];\r\n \t\t\t$qrcodeCategoryId = $productDetails[$i][0];\r\n \t\t\t$qrcodeImageContent = urlencode(JURI::root().(\"index.php?option=com_virtuemart&page=shop.product_details&product_id=$qrcodeProductId&category_id=$qrcodeCategoryId\"));\r\n \t\t\t$imageName = $qrcodeProductId.'.png';\r\n\t\t\t\t$qrcodeImage[] = $qrcodeProductId.'.png';\r\n\t\t\t\t// save image in configured image uploads folder \r\n\t\t\t\t$imagePath = $qrcodeImagePath . DS . $imageName;\r\n\t\t\t\t\t \r\n\t\t\t\t$size = \"500x500\";\r\n\t\t\t\t$image_url_qr = \"https://chart.googleapis.com/chart?cht=qr&chs=$size&chl=$qrcodeImageContent\";\r\n\t\t\t\t\r\n\t\t\t\tif(function_exists('curl_init'))\r\n\t\t\t\t{\r\n\t\t\t\t$curl_handle=curl_init();\r\n\t\t\t\tcurl_setopt($curl_handle,CURLOPT_URL,$image_url_qr);\r\n\t\t\t\tcurl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);\r\n\t\t\t\tcurl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,true);\r\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\r\n\t\t\t\t$returnData = curl_exec($curl_handle);\r\n\t\t\t\tcurl_close($curl_handle);\r\n\t\t\t\t\r\n\t\t\t\t$imageContent = $returnData;\r\n\t\t\t\t\t\t\r\n\t\t\t\t$imageLocation = fopen($imagePath , 'w');\r\n\t\t\t\tchmod($imagePath , 0777);\r\n\t\t\t\t$fp = fwrite($imageLocation, $imageContent);\r\n\t\t\t\tfclose($imageLocation);\r\n\t\t\t\t$errorMessage = JText::_('COM_QRCODE_CONTROLLER_GENERATE_QRCODE_SUCCESS');\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\t$errorMessage = JError::raiseWarning('',\"COM_QRCODE_CONTROLLER_ENABLE_CURL\");\r\n\t\t\t\t}\t\t\t\t\t\r\n \t\t}\r\n \t\tif($fp)//If image content write to folder, then store the value in database.\r\n\t\t\t$model->storeQrcodeDetails($selectedProductId,$qrcodeImage);\r\n\t\t\treturn $errorMessage;\r\n \t}", "function generateQRImageTag( $identifier){\n\n ob_start();\n QRCode::png($identifier,false,'L',9,2);\n $imageString = base64_encode(ob_get_clean());\n return '<img src =\"data:image/png;base64,'.$imageString.'\"/>';\n }", "function fetchUserQRCodeFromDB($clientid)\n{\n\t$qrCode= '';\n \t$qry=\"SELECT qrCode\n\t\t\tFROM entrp_login \n\t\t\tWHERE clientid=\".$clientid.\"\n\t \";\n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n\tif($count_res>0)\n {\n \twhile($row=mysqli_fetch_array($res))\n {\n \t$qrCode\t=\t$row['qrCode'];\n\t\t} \t \t\n }\n return $qrCode;\n}", "public function actionGenerateBarcode() \n {\n\t\t$inputCode = Yii::app()->request->getParam(\"code\", \"\");\n\t\t$bc = new BarcodeGenerator;\n\t\t$bc->init('png');\n\t\t$bc->build($inputCode);\n }", "public function testGenerateBarcodeQRCode()\n {\n }", "function attendance_renderqrcoderotate($session) {\n // Load required js.\n echo html_writer::tag('script', '',\n [\n 'src' => 'js/qrcode/qrcode.min.js',\n 'type' => 'text/javascript'\n ]\n );\n echo html_writer::tag('script', '',\n [\n 'src' => 'js/password/attendance_QRCodeRotate.js',\n 'type' => 'text/javascript'\n ]\n );\n echo html_writer::div('', '', ['id' => 'qrcode']); // Div to display qr code.\n echo html_writer::div(get_string('qrcodevalidbefore', 'attendance').' '.\n html_writer::span('0', '', ['id' => 'rotate-time']).' '\n .get_string('qrcodevalidafter', 'attendance'), 'qrcodevalid'); // Div to display timer.\n // Js to start the password manager.\n echo '\n <script type=\"text/javascript\">\n let qrCodeRotate = new attendance_QRCodeRotate();\n qrCodeRotate.start(' . $session->id . ', document.getElementById(\"qrcode\"), document.getElementById(\"rotate-time\"));\n </script>';\n}", "public function stock_get_qr_code($card_id, Request $request){\n\t\t$card = App\\Card::find($card_id);\n\t\tif($card !== null){\n\t\t\t$qr_code_str = base64_encode(json_encode(array(\"code\" => $card->code, \"password\" => $card->passwd)));\n\t\t\t$code_image = 'card/qrcode_'.$card->id.'.png';\n\t\t\t\n\t\t\tif(!is_file(public_path($code_image))){\n\t\t\t\t$renderer = new \\BaconQrCode\\Renderer\\Image\\Png();\n\t\t\t\t$renderer->setHeight(256);\n\t\t\t\t$renderer->setWidth(256);\n\t\t\t\t$writer = new \\BaconQrCode\\Writer($renderer);\n\t\t\t\t$writer->writeFile($qr_code_str, public_path($code_image));\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return_arr = array(\"status\" => true, \"img_code\" => $code_image);\n\t\t}else{\n\t\t\t$return_arr = array(\"status\" => false);\n\t\t}\n\t\techo json_encode($return_arr);\n\t}", "function AddQRCode($aName,$db){\r\n\r\n\t\r\n\t$tempDir = dirname(__FILE__).DIRECTORY_SEPARATOR.'phpqrcode'.DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR; //setting the tempory directory to store the qrcode\r\n\t$fileName = $tempDir.$aName.'.png';//naming the qrcode file \r\n\t$errorCorrectionLevel = 'Q'; //setting the error correction level of the qrcode\r\n\t$matrixPointSize = 5; //setting the size of the generated qrcode\r\n\t$generationDate = date('Y/m/d');//setting the date\r\n\t\r\n\t//generating the qrcode and saving it to the temp folder\r\n\tQRcode::png($aName,$fileName,$errorCorrectionLevel,$matrixPointSize, 2);\r\n\t\t\r\n\t//gets the animals animal_ID\r\n\t$sql = \"SELECT animal_ID FROM tbl_Animals WHERE animal_Name ='\".$aName.\"'\";\r\n\t\r\n\tif(!$result = $db->query($sql)){\r\n\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t}\r\n\telse{\r\n\t\twhile ($row = $result->fetch_assoc()){\r\n\t\t\t$animal_ID = $row['animal_ID'];\r\n\t\t}\r\n\t\t\t//storing qrcode image as binary\r\n\t\t\t$QRImage = addslashes(file_get_contents($fileName));\r\n\t\t\t\r\n\t\t\t//sql to insert qrcode into tbl_QRCodes\r\n\t\t\t$insertQRCodeSQL = \"INSERT INTO tbl_QRCodes VALUES(NULL,'$QRImage','$generationDate','$animal_ID')\";\r\n\t\t\t\r\n\t\t\t\tif(!$result = $db->query($insertQRCodeSQL)){\r\n\t\t\t\t\t$GLOBALS['Error'] = 'There was an error running the query['.$db->error.']';\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif(DeleteTempQRCode($fileName)){\r\n\t\t\t\t\t\t$GLOBALS['Success'] = ' Animal Added';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$GLOBALS['Warning'] = ' Animal added but there was an error deleting the QRCode';\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n\t\r\n}", "public function QRcode($kodenya)\n\t\t{\n\t\t QRcode::png(\n\t\t $kodenya,\n\t\t $outfile = false,\n\t\t $level = QR_ECLEVEL_H,\n\t\t $size = 6,\n\t\t $margin = 2\n\t\t );\n\t\t}", "public function qr_generator_view()\n {\n $data = [\n \"route_info\" => \\sr::api(\"qr-gene\"),\n 'theme' => $this->themes[0],\n 'ng_app' => \"myApp\",\n 'ng_controller' => \"main\",\n ];\n return $this->get_view(\"Apis.qr\", $data);\n }", "public function QRcode($kodenya = null){\n \tQRcode::png(\n \t\t$kodenya,\n \t\t$outfile = false,\n \t\t$level = QR_ECLEVEL_H,\n \t\t$size = 13,\n \t\t$margin = 3\n \t);\n }", "public function QRcode($kodenya)\n {\n // render qr dengan format gambar PNG\n QRcode::png(\n $kodenya,\n $outfile = false,\n $level = QR_ECLEVEL_H,\n $size = 6,\n $margin = 2\n );\n }", "public function generateQRCodeImage($url)\n {\n $image = imagecreatefrompng($url);\n $bg = imagecreatetruecolor(imagesx($image), imagesy($image));\n\n imagefill($bg, 0, 0, imagecolorallocate($bg, 255, 255, 255));\n imagealphablending($bg, TRUE);\n imagecopy($bg, $image, 0, 0, 0, 0, imagesx($image), imagesy($image));\n imagedestroy($image);\n\n header('Content-Type: image/jpeg');\n\n $quality = 50;\n imagejpeg($bg);\n imagedestroy($bg);\n }", "public function createQRcode(string $address, string $cryptocurrency, float $amount): string\n {\n return \"https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl={$cryptocurrency}:{$address}?amount={$amount}\";\n }" ]
[ "0.7057807", "0.6992457", "0.6919701", "0.6863013", "0.6595573", "0.65870583", "0.65730387", "0.6352657", "0.63361603", "0.63141984", "0.6283551", "0.6168217", "0.6090191", "0.60780007", "0.6055569", "0.60196775", "0.5964249", "0.5955374", "0.5946925", "0.5930047", "0.5871183", "0.5868279", "0.5823909", "0.58184624", "0.57961214", "0.5785539", "0.57776076", "0.5707779", "0.5696906", "0.5680905" ]
0.7094792
0
Function to cache an image
function cacheThisImage($img) { require_once 'externalLibraries/ImageCache.php'; $baseurl=base_url(); $imagecache = new ImageCache(); //$imagecache->cached_image_directory = $baseurl. 'entreprenity/api/cachedImages/'; $imagecache->cached_image_directory = dirname(__FILE__) . '/cachedImages'; $cached_src_one = $imagecache->cache($img); //return $imagecache->cached_image_directory; return $cached_src_one; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cacheImage($url) {\r\n\t\ttry {\r\n\t\t\t$cacheDir = dirname(__FILE__) . '/img/cache/';\r\n if (!file_exists($cacheDir)) {\r\n mkdir($cacheDir, 0777, true);\r\n }\r\n \t$cached_filename = md5($url);\r\n\t\t\t$files = glob($cacheDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\r\n\t\t\t$now = time();\r\n\t\t\tforeach ($files as $file) {\r\n\t\t\t\tif (is_file($file)) {\r\n\t\t\t\t\tif ($now - filemtime($file) >= 60 * 60 * 24 * 5) { // 5 days\r\n\t\t\t\t\t\tunlink($file);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($files as $file) {\r\n\t\t\t\t$fileName = explode('.',basename($file));\r\n\t\t\t\tif ($fileName[0] == $cached_filename) {\r\n\t\t\t\t $path = getRelativePath(dirname(__FILE__),$file);\r\n\t\t\t\t\t return $path;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$image = file_get_contents($url);\r\n\t\t\tif ($image) {\r\n\t\t\t\t$tempName = $cacheDir . $cached_filename;\r\n\t\t\t\tfile_put_contents($tempName,$image);\r\n\t\t\t\t$imageData = getimagesize($tempName);\r\n\t\t\t\t$extension = image_type_to_extension($imageData[2]);\r\n\t\t\t\tif($extension) {\r\n\t\t\t\t\t$filenameOut = $cacheDir . $cached_filename . $extension;\r\n\t\t\t\t\t$result = file_put_contents($filenameOut, $image);\r\n\t\t\t\t\tif ($result) {\r\n\t\t\t\t\t\trename($tempName,$filenameOut);\r\n\t\t\t\t\t\treturn getRelativePath(dirname(__FILE__),$filenameOut);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunset($tempName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (\\Exception $e) {\r\n\t\t\twrite_log('Exception: ' . $e->getMessage());\r\n\t\t}\r\n\t\treturn $url;\r\n\t}", "protected function _create_cached()\n {\n if($this->url_params['c'])\n {\n // Resize to highest width or height with overflow on the larger side\n $this->image->resize($this->url_params['w'], $this->url_params['h'], Image::INVERSE);\n\n // Crop any overflow from the larger side\n $this->image->crop($this->url_params['w'], $this->url_params['h']);\n }\n else\n {\n // Just Resize\n $this->image->resize($this->url_params['w'], $this->url_params['h']);\n }\n\n // Apply any valid watermark params\n $watermarks = Arr::get($this->config, 'watermarks');\n if ( ! empty($watermarks))\n {\n foreach ($watermarks as $key => $watermark)\n {\n if (key_exists($key, $this->url_params))\n {\n $image = Image::factory($watermark['image']);\n $this->image->watermark($image, $watermark['offset_x'], $watermark['offset_y'], $watermark['opacity']);\n }\n }\n }\n\n // Save\n if($this->url_params['q'])\n {\n //Save image with quality param\n $this->image->save($this->cached_file, $this->url_params['q']);\n }\n else\n {\n //Save image with default quality\n $this->image->save($this->cached_file, Arr::get($this->config, 'quality', 80));\n }\n }", "private function PrepareImageForCache()\n {\n if($this->verbose) { self::verbose(\"File extension is: {$this->fileExtension}\"); }\n\n switch($this->fileExtension) {\n case 'jpg':\n case 'jpeg':\n $image = imagecreatefromjpeg($this->pathToImage);\n if($this->verbose) { self::verbose(\"Opened the image as a JPEG image.\"); }\n break;\n\n case 'png':\n $image = imagecreatefrompng($this->pathToImage);\n if($this->verbose) { self::verbose(\"Opened the image as a PNG image.\"); }\n break;\n\n default: errorPage('No support for this file extension.');\n }\n return $image;\n }", "private function _cache_image($user_id)\n\t{\n\t\t$image_cache = \"images/\";\n\t\t$this->_build_cache_directory($image_cache);\n\t\t$cached_image = CACHE_DIRECTORY.$image_cache.\"$user_id.jpg\";\n\n\t\tif ( ! file_exists($cached_image) || (((time() - filemtime($cached_image)) / 60) > IMAGE_CACHE_TIME)) {\n\t\t\t$image = file_get_contents(\"http://graph.facebook.com/\" . $user_id . \"/picture/\");\n\t\t\tfile_put_contents($cached_image, $image);\n\t\t}\n\n\t\t$image_url = str_replace($_SERVER[\"DOCUMENT_ROOT\"], \"\", $cached_image);\n\n\t\treturn $image_url;\n\t}", "function cache($field, $type, $id,$delta, $item) {\n $cid = \"{$field}_{$type}_{$id}_{$delta}:\" . \\Drupal::languageManager()\n ->getCurrentLanguage()\n ->getId();\n $camData = NULL;\n\n if ($cache = \\Drupal::cache()\n ->get($cid)) {\n // It's in cache\n $camData = $cache->data;\n\n if($this->currentTimeMillis() >= $camData['time'] ) {\n // Cache expired\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }elseif($camData['src'] != false){\n // Failed to retrieve the image, but there is an old one in the cache\n $imageSrc = $camData['src'];\n }else{\n // Failed to retrieve the image, and there isn't one in the cache\n $imageSrc = false;\n }\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return isset($imageSrc) ? $imageSrc : $camData['src'];\n }\n else {\n // We don't have it in cache\n $info = pathinfo($item->link);\n $data = WebcamHelper::requesturl( $item->link, $item->refresh_rate/1000);\n\n if ($data != false) {\n $imageSrc = 'data:image/' . $info['extension'] . ';base64,' . base64_encode($data);\n }else{\n $imageSrc = false;\n }\n\n \\Drupal::cache()\n ->set($cid, ['src' => $imageSrc, 'time' => $this->currentTimeMillis() + $item->refresh_rate]);\n }\n return $imageSrc;\n }", "private function _cache($image, $remote){\n $this->cacheData = $this->cacheType == 'json' ? $this->_jsonCache() : $this->_apcCache();\n }", "public static function getImageCache($imageurl)\n {\n\t // $urlsample = \"http://\".env(\"DOMAINNAME\").\"/imgcache/\".$imageurl;\n\t\t// getimagesize() supports jpg / png / gif, but not mp4\n\t\t\n\t\t$imageurl = str_replace(\"@@@\", \"/\", $imageurl);\n\t\t\n \t$x = getimagesize($imageurl);\n\t\t\n\t\t$ext = \"\";\n\t\tif ($x != false && is_array($x)) {\n\t\t\tswitch ($x['mime']) {\n\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t$ext = \"gif\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\t$ext = \"jpg\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image/png\":\n\t\t\t\t\t$ext = \"png\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//echo $x['mime'];die();\n\t\t\n\t\tif($ext != \"\") {\n\t\t\t//return response(readfile($imageurl), 200)->header('Content-Type', $x['mime']);\n\t\t\tob_start();\n\t\t\theader(\"Content-type: \".$x['mime']);\n\t\t\treadfile($imageurl);\n\t\t\tob_end_flush();\n\t\t\treturn true;\n\t\t}\n }", "function cache();", "abstract protected function cacheData();", "function refreshCache($source_file, $cache_file, $quality) {\n\tif (file_exists($cache_file)) {\n // Not modified\n if (filemtime($cache_file) >= filemtime($source_file)) {\n return $cache_file;\n }\n\n // Modified, clear it\n unlink($cache_file);\n }\n return generateImage($source_file, $cache_file, $quality);\n}", "private function cacheImage($url, $illustId, $isImage)\n {\n $illustId = preg_replace('/[^0-9]/', '', $illustId);\n $thumbnailurl = $url;\n\n $path = PATH_CACHE . 'pixiv_img/';\n if (!is_dir($path)) {\n mkdir($path, 0755, true);\n }\n\n $path .= $illustId;\n if ($this->getInput('fullsize')) {\n $path .= '_fullsize';\n }\n $path .= '.jpg';\n\n if (!is_file($path)) {\n // Get fullsize URL\n if ($isImage && $this->getInput('fullsize')) {\n $ajax_uri = static::URI . 'ajax/illust/' . $illustId;\n $imagejson = json_decode(getContents($ajax_uri), true);\n $url = $imagejson['body']['urls']['original'];\n }\n\n $headers = ['Referer: ' . static::URI];\n try {\n $illust = getContents($url, $headers);\n } catch (Exception $e) {\n $illust = getContents($thumbnailurl, $headers); // Original thumbnail\n }\n file_put_contents($path, $illust);\n }\n\n return get_home_page_url() . 'cache/pixiv_img/' . preg_replace('/.*\\//', '', $path);\n }", "function getCachedFname( $xtile, $ytile, $zoom ) {\n $remoteImageFilename = \n \"http://a.tile.opencyclemap.org/cycle/$zoom/$xtile/$ytile.png\";\n // strip away everything except for /14/4944/6053\n $localImageFilename = preg_replace(\n \"/(http:\\/\\/)(.*?)(cycle\\/)(.*?)(.png)/\",\"\\\\4\", \n $remoteImageFilename);\n // replace the forward slash '/' with underscore '_'\n $localImageFilename = preg_replace(\"/\\//\",\"_\",\n $localImageFilename);\n $localImageDirectory = \"images\";\n $cacheName = \n $localImageDirectory . \"/\" . $localImageFilename . \".png\";\n // go get the remote image only if it's not in the cache\n // check to make sure it is strictly equal to false (===)\n if(file_exists($cacheName)===false){\n $image = file_get_contents($remoteImageFilename); \n file_put_contents($cacheName, $image);\n } \n return $cacheName;\n}", "function &createCache() {}", "function generateImage($source_file, $cache_file, $quality)\n{\n\t$extension = strtolower(pathinfo($source_file, PATHINFO_EXTENSION));\n\n // Check the image dimensions\n $dimensions = GetImageSize($source_file);\n $width = $dimensions[0];\n $height = $dimensions[1];\n\t\n $dst = ImageCreateTrueColor($width, $height); // re-sized image\n\n\tswitch ($extension) {\n case 'png':\n $src = @ImageCreateFromPng($source_file); // original image\n break;\n case 'gif':\n $src = @ImageCreateFromGif($source_file); // original image\n break;\n default:\n $src = @ImageCreateFromJpeg($source_file); // original image\n ImageInterlace($dst, true); // Enable interlancing (progressive JPG, smaller size file)\n break;\n }\n\n if ($extension == 'png') {\n imagealphablending($dst, false);\n imagesavealpha($dst, true);\n $transparent = imagecolorallocatealpha($dst, 255, 255, 255, 127);\n imagefilledrectangle($dst, 0, 0, $width, $height, $transparent);\n }\n\n ImageCopyResampled($dst, $src, 0, 0, 0, 0, $width, $height, $width, $height); // do the resize in memory\n ImageDestroy($src);\n\n\tif(STAMPED)\n {\n $text_color = ImageColorAllocate($dst, 255, 255, 255);\n\t\timagettftext($dst, 40, 0, 10, 50, $text_color, '../font/coolvetica.ttf', 'Qualité : '.$quality);\n }\n\n $cache_dir = dirname($cache_file);\n\n // does the directory exist already?\n if (!is_dir($cache_dir)) {\n if (!mkdir($cache_dir, 0755, true)) {\n // check again if it really doesn't exist to protect against race conditions\n if (!is_dir($cache_dir)) {\n // uh-oh, failed to make that directory\n ImageDestroy($dst);\n sendErrorImage(\"Failed to create cache directory: $cache_dir\");\n }\n }\n }\n\n if (!is_writable($cache_dir)) {\n sendErrorImage(\"The cache directory is not writable: $cache_dir\");\n }\n\t\n // save the new file in the appropriate path, and send a version to the browser\n switch ($extension) {\n case 'png':\n $gotSaved = ImagePng($dst, $cache_file);\n break;\n case 'gif':\n $gotSaved = ImageGif($dst, $cache_file);\n break;\n default:\n $gotSaved = ImageJpeg($dst, $cache_file, $quality);\n break;\n }\n ImageDestroy($dst);\n\t\n if (!$gotSaved && !file_exists($cache_file)) {\t\n\t\tsendErrorImage(\"Failed to create image: $cache_file\");\n }\n\n return $cache_file;\n}", "function getImage($url, $maxImageSize = 50000)\n{\n $imageFile = CACHE.'/'.basename($url);\n \n // is cached image missing or > 24 hours old?\n if(!file_exists($imageFile) ||\n ((mktime() - filemtime($imageFile)) > 24*60*60))\n {\n // get image\n $fp = fopen($url, 'rb');\n if(!$fp)\n die ('Sorry, could not download image.');\n $image = fread($fp, $maxImageSize);\n if(!$image)\n die ('Sorry, could not download image.');\n fclose($fp);\n\n // store image\n $fp = fopen($imageFile, 'wb');\n if(!$fp||(fwrite($fp, $image)==-1))\n {\n die ('Sorry, could not store image file');\n }\n fclose($fp);\n }\n return $imageFile;\n}", "function cacheAvatar($eventData, $fContent)\n {\n\n $cache_file = $this->getCacheFilePath($eventData);\n $this->log(\"cacheAvatar: \" . $cache_file);\n\n // Save image\n if (! file_exists($this->getCacheDirectory())) {\n mkdir($this->getCacheDirectory());\n }\n $fp = @fopen($cache_file, 'wb');\n if (!$fp) {\n $this->log(\"! Error writing cache file $cache_file\");\n if (file_exists($cache_file)) {\n return $cache_file;\n }\n else {\n return false;\n }\n }\n fwrite($fp, $fContent);\n fclose($fp);\n\n return $cache_file;\n }", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "function show_image ($mime_type, $image_resized, $quality, $cache_dir, $zoom_crop) {\n $is_writable = 0;\n $cache_file_name = $cache_dir . '/' . get_cache_file($quality, $zoom_crop);\n\n if( touch( $cache_file_name ) ) {\n // give 666 permissions so that the developer\n // can overwrite web server user\n chmod( $cache_file_name, 0666 );\n $is_writable = 1;\n } else {\n $cache_file_name = NULL;\n header('Content-type: ' . $mime_type);\n }\n\n if(stristr( $mime_type, 'gif' ) ) {\n imagegif( $image_resized, $cache_file_name );\n } elseif( stristr( $mime_type, 'jpeg' ) ) {\n imagejpeg( $image_resized, $cache_file_name, $quality );\n } elseif( stristr( $mime_type, 'png' ) ) {\n imagepng( $image_resized, $cache_file_name, ceil( $quality / 10 ) );\n }\n\n if( $is_writable ) { show_cache_file( $cache_dir, $quality, $zoom_crop ); }\n\n exit;\n\n}", "private function cacheImage(string $name, string $content): void\n\t{\n\t\t// Write content file\n\t\t$path = $this->_cacheFolder . $name;\n\t\t$fh = fopen($path, 'w') or die(\"can't open file\");\n\t\tfwrite($fh, $content);\n\t\tfclose($fh);\n\t}", "abstract function cache_output();", "function _getCachedThumbnail($aArgs = null) {\n $aArgs = is_array($aArgs) ? $aArgs : array();\n\n // Use arguments to work out the target filename\n $sFilename = $this->_generateHash($aArgs).'.jpg';\n $sFile = $this->thumbnail_dir . $sFilename;\n\n $sReturnName = false;\n // Work out if we need to update the cached thumbnail\n $iForceUpdate = $aArgs['stwredo'] ? true : false;\n if ($iForceUpdate || $this->_cacheFileExpired($sFile)) {\n // if bandwidth limit has reached return the BANDWIDTH_IMAGE\n if ($this->_checkLimitReached($this->thumbnail_dir . $this->bandwidth_image)) {\n $sFilename = $this->bandwidth_image;\n // if quota limit has reached return the QUOTA_IMAGE\n } else if ($this->_checkLimitReached($this->thumbnail_dir . $this->quota_image)) {\n $sFilename = $this->quota_image;\n\t\t\t// if WAY OVER the limits (i.e. request is ignored by STW) return the NO_RESPONSE_IMAGE\n } else if ($this->_checkLimitReached($this->thumbnail_dir . $this->no_response_image)) {\n $sFilename = $this->no_response_image;\n } else {\n // check if the thumbnail was captured\n $aImage = $this->_checkWebsiteThumbnailCaptured($aArgs);\n switch ($aImage['status']) {\n case 'save': // download the image to local path\n $this->_downloadRemoteImageToLocalPath($aImage['url'], $sFile);\n break;\n\n case 'nosave': // dont save the image but return the url\n return $aImage['url'];\n break;\n\n case 'quota_exceed': // download the image to local path for locking requests\n $sFilename = $this->quota_image;\n $sFile = $this->thumbnail_dir . $sFilename;\n $this->_downloadRemoteImageToLocalPath($aImage['url'], $sFile);\n break;\n\n case 'bandwidth_exceed': // download the image to local path for locking requests\n $sFilename = $this->bandwidth_image;\n $sFile = $this->thumbnail_dir . $sFilename;\n $this->_downloadRemoteImageToLocalPath($aImage['url'], $sFile);\n break;\n\n default: // otherwise return the status\n return $aImage['status'];\n }\n }\n }\n\n $sFile = $this->thumbnail_dir . $sFilename;\n // Check if file exists\n if (file_exists($sFile)) {\n $sReturnName = $this->thumbnail_uri . $sFilename;\n }\n\n return $sReturnName;\n }", "function ciniki_web_getScaledImageURL($ciniki, $image_id, $version, $maxwidth, $maxheight, $quality='60') {\n\n if( $maxwidth == 0 && $maxheight == 0 ) {\n $size = 'o';\n } elseif( $maxwidth == 0 ) {\n $size = 'h' . $maxheight;\n } else {\n $size = 'w' . $maxwidth;\n }\n\n //\n // NOTE: The cache.db was an attempt to speed up EFS(nfs) on Amazon AWS. It did not appear\n // help performance at all and should not be enabled. The code remains in here incase\n // it can be useful in the future.\n //\n\n //\n // Load last_updated date to check against the cache\n //\n $reload_image = 'no';\n/* if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on' ) {\n $strsql = \"SELECT ciniki_images.id, \"\n . \"ciniki_images.type, \"\n . \"UNIX_TIMESTAMP(ciniki_images.last_updated) AS last_updated, \"\n . \"UNIX_TIMESTAMP(ciniki_web_image_cache.last_updated) AS cache_last_updated \"\n . \"FROM ciniki_images \"\n . \"LEFT JOIN ciniki_web_image_cache ON (\"\n . \"ciniki_images.id = ciniki_web_image_cache.image_id \"\n . \"AND ciniki_web_image_cache.tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"AND ciniki_web_image_cache.size = '\" . ciniki_core_dbQuote($ciniki, $size) . \"' \"\n . \") \"\n . \"WHERE ciniki_images.id = '\" . ciniki_core_dbQuote($ciniki, $image_id) . \"' \"\n . \"AND ciniki_images.tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"\";\n $reload_image = 'yes';\n } else { */\n $strsql = \"SELECT id, type, UNIX_TIMESTAMP(ciniki_images.last_updated) AS last_updated \"\n . \"FROM ciniki_images \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $image_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"' \"\n . \"\";\n/* } */\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.images', 'image');\n if( $rc['stat'] != 'ok' ) { \n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.web.103', 'msg'=>'Unable to load image', 'err'=>$rc['err']));\n }\n if( !isset($rc['image']) ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.web.104', 'msg'=>'The image you requested does not exist.'));\n }\n $img = $rc['image'];\n\n //\n // Build working path, and final url\n //\n if( $img['type'] == 2 ) {\n $extension = 'png';\n } else {\n $extension = 'jpg';\n }\n if( $maxwidth == 0 && $maxheight == 0 ) {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/o/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/o/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'o';\n } elseif( $maxwidth == 0 ) {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/h' . $maxheight . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/h' . $maxheight . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'h' . $maxheight;\n } else {\n// $filename = '/' . sprintf('%02d', ($ciniki['request']['tnid']%100)) . '/'\n// . sprintf('%07d', $ciniki['request']['tnid'])\n// . '/w' . $maxwidth . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $filename = '/w' . $maxwidth . '/' . sprintf('%010d', $img['id']) . '.' . $extension;\n $size = 'w' . $maxwidth;\n }\n $img_filename = $ciniki['tenant']['web_cache_dir'] . $filename;\n $img_url = $ciniki['tenant']['web_cache_url'] . $filename;\n $img_domain_url = 'http://' . $ciniki['request']['domain'] . $ciniki['tenant']['web_cache_url'] . $filename;\n\n //\n // Check db for cache details\n //\n if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on'\n && isset($img['cache_last_updated']) && $img['cache_last_updated'] >= $img['last_updated']\n ) {\n return array('stat'=>'ok', 'url'=>$img_url, 'domain_url'=>$img_domain_url);\n }\n\n //\n // Check last_updated against the file timestamp, if the file exists\n //\n if( $reload_image == 'yes' || !file_exists($img_filename) || filemtime($img_filename) < $img['last_updated'] ) {\n\n //\n // Load the image from the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'loadImage');\n $rc = ciniki_images_loadImage($ciniki, $ciniki['request']['tnid'], $img['id'], $version);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $image = $rc['image'];\n\n //\n // Scale image\n //\n if( $maxwidth > 0 || $maxheight > 0 ) {\n $image->scaleImage($maxwidth, $maxheight);\n }\n\n //\n // Apply a border\n //\n // $image->borderImage(\"rgb(255,255,255)\", 10, 10);\n\n //\n // Check if directory exists\n //\n if( !file_exists(dirname($img_filename)) ) {\n mkdir(dirname($img_filename), 0755, true);\n }\n\n //\n // Write the file\n //\n $h = fopen($img_filename, 'w');\n if( $h ) {\n if( $img['type'] == 2 ) {\n $image->setImageFormat('png');\n } else {\n $image->setImageCompressionQuality($quality);\n }\n fwrite($h, $image->getImageBlob());\n fclose($h);\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.web.105', 'msg'=>'Unable to load image'));\n }\n\n //\n // Update database\n //\n/* if( isset($ciniki['config']['ciniki.web']['cache.db']) && $ciniki['config']['ciniki.web']['cache.db'] == 'on' ) {\n $strsql = \"INSERT INTO ciniki_web_image_cache (tnid, image_id, size, last_updated) \" \n . \"VALUES('\" . ciniki_core_dbQuote($ciniki, $ciniki['request']['tnid']) . \"'\"\n . \", '\" . ciniki_core_dbQuote($ciniki, $img['id']) . \"'\"\n . \", '\" . ciniki_core_dbQuote($ciniki, $size) . \"'\"\n . \", UTC_TIMESTAMP()) \"\n . \"ON DUPLICATE KEY UPDATE last_updated = UTC_TIMESTAMP() \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n $rc = ciniki_core_dbInsert($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n error_log('CACHE: Unable to save ' . $img_filename . ' to ciniki_web_cache');\n return $rc;\n }\n } */\n }\n\n return array('stat'=>'ok', 'url'=>$img_url, 'domain_url'=>$img_domain_url, 'filename'=>$img_filename);\n}", "public function getCache();", "private function cachedImage(string $name): string|false\n\t{\n\t\t$file = $this->_cacheFolder . $name;\n\t\t$fh = fopen($file, 'r');\n\t\t$content = fread($fh, filesize($file));\n\t\tfclose($fh);\n\t\treturn $content;\n\t}", "public function saveToCacheForever();", "protected function buildImage()\n\t{\n\t\t$this->buildFileName = $this->buildFileName();\n\t\t$this->buildCachedFileNamePath = $this->cachePath . '/' . $this->buildFileName;\n\t\t$this->buildCachedFileNameUrl = $this->cacheUrl . '/' . $this->buildFileName;\n\n\t\tif(!file_exists($this->buildCachedFileNamePath)) {\n\t\t\t$this->image = iImage::make($this->mediaFilePath);\n\n\t\t\t$this->image->{$this->method}($this->width, $this->height, $this->closure);\n\n\t\t\t$this->image->save($this->buildCachedFileNamePath, $this->quality);\n\t\t}\n\t}", "function generateImage($source_file, $cache_file, $resolution_req) {\t/* Renamed $resolution to $resolution_req(ested), to not confuse this with the global variable! */\n \n global $sharpen, $sharpen_amount, $sharpen_progressive;\n\t\tglobal $jpg_quality, $jpg_quality_retina, $jpg_quality_progressive;\n\t\tglobal $setup_ratio, $wp_setup_ratio;\n global $is_highppi;\n\t\t\n\n\t\t// Double-check, if path exists and is writable\n $cache_dir = dirname($cache_file);\n\n /* does the directory exist already? */\n if (!is_dir($cache_dir)) { \n if (!mkdir($cache_dir, 0755, true)) {\n /* check again if it really doesn't exist to protect against race conditions */\n if (!is_dir($cache_dir)) {\n sendErrorImage(\"Failed to create cache directory: $cache_dir\");\n \t}\n \t}\n \t}\n\n if (!is_writable($cache_dir)) {\n sendErrorImage(\"The cache directory is not writable: $cache_dir\");\n \t}\n\t\t\n\t\t\n $extension = strtolower(pathinfo($source_file, PATHINFO_EXTENSION));\n\n /* Check the image dimensions */\n $dimensions = GetImageSize($source_file);\n $width = $dimensions[0];\n $height = $dimensions[1];\n\t\t\n\n /* Do we need to downscale the image? */\n /* because of cropping, we need to prozess the image\n if ($width <= $resolution) { // no, because the width of the source image is already less than the client width\n return $source_file;\n }\n */\n \n // General quality setting\n $jpg_quality_high = $jpg_quality;\n\t\tif ($is_highppi) $jpg_quality = $jpg_quality_retina;\n\t\t\n\n\t\t \n\t\t// TODO! ################\n\t\t// When jpg_quality_progressive \n\t\t// Do some clever stuff to only scale and compress when necessary\n\t\t// Or maybe even serve the original file\n\t\t\n\t\tif ($jpg_quality_progressive) {\n\t\t\t\n\t\t\t\t// Give slighly higher quality, when requested image is already very small\n\t\t\t\t$threshold_min = 320; /* px */\n\t\t\t\tif ($resolution_req <= $threshold_min and !$is_highppi) $jpg_quality = ($jpg_quality+1 > 100) ? 100 : $jpg_quality + 1;\n\t\t\t\tif ($resolution_req <= $threshold_min*1.5 and $is_highppi) $jpg_quality = ($jpg_quality+2 > 99) ? 99 : $jpg_quality + 2;\n\t\t\t\t\n\t\t\t\t// Lower quality just a bit more, when image should become relatively huge\n\t\t\t\t$threshold_max = 1280; /* px */\n\t\t\t\tif ( $resolution_req > $threshold_max and !$is_highppi) $jpg_quality = $jpg_quality - 3;\n\t\t\t\tif ( $resolution_req > $threshold_max*1.5 and $is_highppi) $jpg_quality = $jpg_quality - 2;\n\n\t\t\t\t// In case no cropping needs to be done and no high-ppi compression, and no resizing at all: we can serve the source file\n\t\t\t\tif (!$setup_ratio and $width <= $resolution_req and !$is_highppi) return $source_file;\n\t\t\t\tif (!$wp_setup_ratio and $width <= $resolution_req and !$is_highppi) return $source_file;\n\t\t\n\t\t\t\t}\n\n\n\n\t\t// Progressive Sharpening\n\t\tif ( $sharpen_progressive ) {\n\t\t\t$factor = $resolution_req / $width;\n\t\t\t$sharpen_amount = $sharpen_amount * ( 1 - pow($factor,3) );\n\t\t\t$sharpen_amount = ($sharpen_amount > 0) ? floor($sharpen_amount) : 0;\n\t\t\t}\n\t\t\n\n \n /* We need to resize the source image to the width of the resolution breakpoint we're working with */\n $ratio = $height / $width;\n if ($width <= $resolution_req) {\n \t\t$new_width = $width;\n }\n else {\n \t$new_width = $resolution_req;\n }\n \n $new_height = ceil($new_width * $ratio);\n \n $debug_width = $new_width;\n $debug_height = $new_height;\n \n $start_x = 0;\n $start_y = 0;\n \n\t\t\n\t\t// In case something about cropping is to be done\n if ( $setup_ratio or $wp_setup_ratio) {\n\n /* set height for new image */ \n $orig_ratio = $new_width / $new_height;\n \n\t\t\t// Set crop ration, but priorize the one of the size terms\n $crop_ratio = ($setup_ratio) ? $setup_ratio : $wp_setup_ratio;\n\t\t\t\n $ratio_diff = $orig_ratio / $crop_ratio;\n $ini_new_height = ceil($new_height * $ratio_diff);\n \n $dst = ImageCreateTrueColor($new_width, $ini_new_height); /* re-sized image */\n \n $debug_width = $new_width;\n $debug_height = $ini_new_height;\n \n /* set new width and height for skaleing image to fit new height */\n \n if($ini_new_height > $new_height) {\n $crop_factor = $ini_new_height / $new_height;\n $temp_new_width = ceil($new_width * $crop_factor);\n $new_height = ceil($new_height * $crop_factor);\n $start_x = ($new_width - $temp_new_width) / 2;\n $new_width = $temp_new_width;\n }\n else {\n $start_y = -($new_height - $ini_new_height) / 2;\n }\n }\n else {\n $dst = ImageCreateTrueColor($new_width, $new_height); /* re-sized image */\n }\n \n switch ($extension) {\n case 'png':\n $src = @ImageCreateFromPng($source_file); \t/* original image */\n break;\n case 'gif':\n $src = @ImageCreateFromGif($source_file); \t/* original image */\n break;\n default:\n $src = @ImageCreateFromJpeg($source_file); \t/* original image */\n ImageInterlace($dst, true); \t\t\t\t/* Enable interlancing (progressive JPG, smaller size file) */\n break;\n }\n if($extension=='png') {\n imagealphablending($dst, false);\n imagesavealpha($dst,true);\n $transparent = imagecolorallocatealpha($dst, 255, 255, 255, 127);\n imagefilledrectangle($dst, 0, 0, $new_width, $new_height, $transparent);\n }\n \n ImageCopyResampled($dst, $src, $start_x, $start_y, 0, 0, $new_width, $new_height, $width, $height); /* do the resize in memory */\n \n /* debug mode */\n global $debug_mode;\n\t\tglobal $wp, $wp_width, $wp_height, $fallback;\n\t\t\n if($debug_mode) {\n \t\n\t\t\t$color = imagecolorallocate($dst, 255, 0, 255); // Use fresh magenta\n\t\t\t\n // first debug line: write a textstring with dimensions etc.\n $cookie_data = explode(',', $_COOKIE['resolution']);\n $debug_ratio = false;\n\t \tif( $setup_ratio ) $debug_ratio = $setup_ratio . ':1';\n imagestring( $dst, 5, 10, 5, $debug_width.\" x \".$debug_height . ' ' . $debug_ratio . ' device:' . $cookie_data[0] . '*' . $cookie_data[1] . '=' . ceil($cookie_data[0] * $cookie_data[1]) . $addonstring, $color);\n\t \n\t \t// second debug line: show size term if provided\n\t \t$secondline = $_GET['size'];\n\t \timagestring( $dst, 5, 10, 20, $secondline, $color);\n\n\t\t\t// Third line: Wpordpress detection active\n\t\t\tif ( $wp ) $thirdline = \"Wordpress detection is active!\";\n\t\t\timagestring( $dst, 5, 10, 35, $thirdline, $color);\n\t\t\t\n\t\t\t// Fourth debug line: is fallback active?\n\t\t \tif ( $fallback ) $fourthline = \"Fallback active!\";\n\t\t \timagestring( $dst, 5, 10, 50, $fourthline, $color);\n\t\t\t\n\t\t\t$fifthline = \"Sharpen Amount: \" . $sharpen_amount;\n\t\t\timagestring( $dst, 5, 10, 65, $fifthline, $color);\n\t\t\t\n }\n\n \n ImageDestroy($src);\n\n\n\n /* sharpen the image */\n if($sharpen == TRUE) {\n $amount = $sharpen_amount; /* max 500 */\n $radius = '1'; /* 50 */\n $threshold = '0'; /* max 255 */\n \n if ( strtolower($extension) == 'jpg' OR strtolower($extension) == 'jpeg') {\n if($amount !== '0') $dst = UnsharpMask($dst, $amount, $radius, $threshold);\n }\n }\n\n\n\n /* save the new file in the appropriate path, and send a version to the browser */\n switch ($extension) {\n case 'png':\n $gotSaved = ImagePng($dst, $cache_file);\n break;\n case 'gif':\n $gotSaved = ImageGif($dst, $cache_file);\n break;\n default:\n $gotSaved = ImageJpeg($dst, $cache_file, $jpg_quality);\n break;\n }\n ImageDestroy($dst);\n\n if (!$gotSaved && !file_exists($cache_file)) {\n sendErrorImage(\"Failed to create image: $cache_file\");\n }\n\n return $cache_file;\n\t\t\n }", "protected function createImageCache(HGImage $image, $size = null)\n {\n $file = $image->getHGFile();\n $type = $image->getImgType();\n $source = $this->getFileManager()->getFilePath($file);\n $dest = $this->getCachePath($image, $size);\n\n if (!is_dir(dirname($dest)))\n {\n mkdir(dirname($dest), 0777, true);\n }\n\n copy($source, $dest);\n\n // original size\n\n $img = $this->imageCreator->createImageFromFile($dest, $image->getHGFile()->getFilMimeType());\n\n if (is_null($size))\n {\n $size = $this->defaultSize;\n }\n\n if ($size != $this->defaultSize)\n {\n //$img->setQuality(85);\n\n $dimensions = $this->getDimensions($type, $size);\n\n $typeCf = $this->getTypeConfig($type);\n $sizeCf = $typeCf['sizes'][$size];\n\n $method = $this->getMethod($type, $size);\n if ($method == 'rotate')\n {\n $img->rotate($sizeCf['angle']);\n $method = $sizeCf['subMethod'];\n }\n switch ($method)\n {\n case 'as_is':\n return;\n case 'crop':\n $cMethod = isset($sizeCf['cropMethod']) ? $sizeCf['cropMethod'] : 'center';\n $cBackground = isset($sizeCf['cropBackground']) ? $sizeCf['cropBackground'] : null;\n\n $img->thumbnail($dimensions[0], $dimensions[1], $cMethod, $cBackground);\n break;\n\n case 'resize':\n $rInflate = isset($sizeCf['resizeInflate']) ? $sizeCf['resizeInflate'] : true;\n $rProp = isset($sizeCf['resizeProportional']) ? $sizeCf['resizeProportional'] : true;\n\n $img->resize($dimensions[0], $dimensions[1], $rInflate, $rProp);\n break;\n\n case 'fit':\n $origWidth = $img->getWidth();\n $origHeight = $img->getHeight();\n\n $imgWidth = $dimensions[0];\n $imgHeight = $dimensions[1];\n if ($origWidth == $imgWidth && $imgHeight == $origHeight)\n {\n break;\n }\n $cBackground = isset($sizeCf['background']) ? $sizeCf['background'] : null;\n\n $this->fitResize($img, $dimensions);\n $image = clone $img;\n\n $img->create($dimensions[0], $dimensions[1]);\n\n if(!is_null($cBackground) && $cBackground != '')\n {\n $img->fill(0,0, $cBackground);\n }\n\n $position = isset($sizeCf['position']) ? $sizeCf['position'] : 'center';\n \n $img->overlay($image, $position);\n\n break;\n\n case 'transparent-fit':\n $imgWidth = $dimensions[0];\n $imgHeight = $dimensions[1];\n $this->fitResize($img, $dimensions);\n\n $im = imagecreatetruecolor($imgWidth, $imgHeight);\n $transparent = imagecolorallocatealpha($im, 255, 255, 255, 127);\n imagealphablending($im, false);\n imagefill($im, 0, 0, $transparent);\n\n $position = isset($sizeCf['position']) ? $sizeCf['position'] : 'center';\n\n if (strpos($position, 'left') !== false)\n {\n $x = 0;\n }\n elseif (strpos($position, 'right') !== false)\n {\n $x = $imgWidth - $img->getWidth();\n }\n else\n {\n $x = ($imgWidth - $img->getWidth())/2;\n }\n\n if (strpos($position, 'top') !== false)\n {\n $y = 0;\n }\n elseif (strpos($position, 'bottom') !== false)\n {\n $y = $imgHeight - $img->getHeight();\n }\n else\n {\n $y = ($imgHeight - $img->getHeight())/2;\n }\n imagecopymerge($im, $img->getAdapter()->getHolder(),$x, $y, 0, 0, $img->getWidth(), $img->getHeight(), 100);\n\n imagedestroy($img->getAdapter()->getHolder());\n imagesavealpha($im, true);\n imagealphablending($im, true);\n\n $img->getAdapter()->setMimeType(isset($sizeCf['mime']) ? $sizeCf['mime'] : 'image/png');\n $img->getAdapter()->setHolder($im);\n break;\n\n case 'fill':\n $origWidth = $img->getWidth();\n $origHeight = $img->getHeight();\n\n $imgWidth = $dimensions[0];\n $imgHeight = $dimensions[1];\n if ($origWidth == $imgWidth && $imgHeight == $origHeight)\n {\n break;\n }\n if ($imgWidth/$origWidth > $imgHeight/$origHeight)\n {\n $newWidth = $imgWidth;\n $newHeight = round($origHeight * ($newWidth/$origWidth));\n }\n else\n {\n $newHeight = $imgHeight;\n $newWidth = round($origWidth * ($newHeight/$origHeight));\n }\n\n $position = isset($sizeCf['position']) ? $sizeCf['position'] : 'center';\n\n $rInflate = isset($sizeCf['resizeInflate']) ? $sizeCf['resizeInflate'] : true;\n $rProp = isset($sizeCf['resizeProportional']) ? $sizeCf['resizeProportional'] : true;\n\n $img->resize($newWidth, $newHeight, $rInflate, $rProp);\n $imgHeight = $img->getHeight();\n $imgWidth = $img->getWidth();\n\n if(false !== strstr($position, 'top'))\n {\n $top = 0;\n }\n else if(false !== strstr($position, 'bottom'))\n {\n $top = $imgHeight - $dimensions[1];\n }\n else\n {\n $top = (int)round(($imgHeight - $dimensions[1]) / 2);\n }\n\n if(false !== strstr($position, 'left'))\n {\n $left = 0;\n }\n else if(false !== strstr($position, 'right'))\n {\n $left = $imgWidth - $dimensions[0];\n }\n else\n {\n $left = (int)round(($imgWidth - $dimensions[0]) / 2);\n }\n\n $img->crop($left, $top, $dimensions[0], $dimensions[1]);\n\n break;\n\n case 'exact':\n $noWidth = is_null($dimensions[0]) || $dimensions[0] <= 0;\n $noHeight = is_null($dimensions[1]) || $dimensions[1] <= 0;\n\n if (!$noWidth || !$noHeight)\n {\n $origWidth = $img->getWidth();\n $origHeight = $img->getHeight();\n\n if (!$noWidth && !$noHeight)\n {\n $newWidth = $dimensions[0];\n $newHeight = $dimensions[1];\n $img->resize($newWidth, $newHeight, false, false);\n }\n elseif ($noHeight)\n {\n $newWidth = $dimensions[0];\n $newHeight = round($origHeight * ($newWidth/$origWidth));\n $img->resize($newWidth, $newHeight, false, true);\n }\n elseif ($noWidth)\n {\n $newHeight = $dimensions[1];\n $newWidth = round($origWidth * ($newHeight/$origHeight));\n $img->resize($newWidth, $newHeight, false, true);\n }\n }\n break;\n\n default:\n $img->$method($sizeCf);\n\n break;\n\n }\n }\n\n if (isset($sizeCf['quality']))\n {\n $img->setQuality($sizeCf['quality']);\n } \n\n // watermarking\n if ($watermark = $this->getWatermarkPath($type, $size))\n {\n $img->overlay($this->imageCreator->createImageFromFile($watermark), $this->settings['watermark_position']);\n }\n\n $img->saveAs($dest, isset($sizeCf['mime']) ? $sizeCf['mime'] : (isset($method) && strpos($method, 'transparent') !== false ? 'image/png' : ''));\n }", "public function updateCache();", "function load_theme_image_cache($db, $site, $true_theme, $true_lang)\n{\n global $THEME_IMAGES_CACHE, $THEME_IMAGES_SMART_CACHE_LOAD, $SMART_CACHE;\n\n if ($THEME_IMAGES_SMART_CACHE_LOAD == 0) {\n $THEME_IMAGES_CACHE[$site] = $SMART_CACHE->get('theme_images_' . $true_theme . '_' . $true_lang);\n if (is_null($THEME_IMAGES_CACHE[$site])) {\n $THEME_IMAGES_CACHE[$site] = array();\n }\n } elseif ($THEME_IMAGES_SMART_CACHE_LOAD == 1) {\n $test = $db->query_select('theme_images', array('id', 'path'), array('theme' => $true_theme, 'lang' => $true_lang));\n $THEME_IMAGES_CACHE[$site] = collapse_2d_complexity('id', 'path', $test);\n }\n\n $THEME_IMAGES_SMART_CACHE_LOAD++;\n}" ]
[ "0.7534191", "0.7436239", "0.71659476", "0.709847", "0.7057842", "0.704647", "0.6944", "0.68771976", "0.67925733", "0.6783626", "0.66606313", "0.65780807", "0.65701824", "0.65622705", "0.6553189", "0.6546614", "0.65371907", "0.6492414", "0.64840305", "0.6443609", "0.64056194", "0.6371444", "0.63179874", "0.62540495", "0.62067837", "0.61945397", "0.6184658", "0.61795187", "0.61407685", "0.6134969" ]
0.81290287
0
Function to fetch events hosted by a company using companyid June 28,2016 August 16,2016: HTML character encoding support
function fetchCompanyEvents($companyid) { //the defaults starts global $myStaticVars; extract($myStaticVars); // make static vars local $member_default_avatar = $member_default_avatar; $member_default_cover = $member_default_cover; $member_default = $member_default; $company_default_cover = $company_default_cover; $company_default_avatar = $company_default_avatar; $events_default = $events_default; $event_default_poster = $event_default_poster; //the defaults ends $data= array(); $qry="SELECT * FROM entrp_events WHERE companyid=".$companyid." AND status=1"; $res=getData($qry); $count_res=mysqli_num_rows($res); $i=0; //to initiate count if($count_res>0) { while($row=mysqli_fetch_array($res)) { $data[$i]['id'] = $row['id']; $data[$i]['eventName'] = $row['eventName']; $data[$i]['eventTagId'] = $row['eventTagId']; $data[$i]['description'] = htmlspecialchars_decode($row['description'],ENT_QUOTES); if($row['poster']!='') { $data[$i]['poster'] = $row['poster']; } else { $data[$i]['poster'] = $event_default_poster; } $data[$i]['city'] = $row['city']; $data[$i]['date'] = $row['event_date']; $data[$i]['time'] = $row['event_time']; $data[$i]['joining'] = goingForThisEventorNot($data[$i]['id']); $i++; } } else { $data[$i]['id'] = ""; $data[$i]['eventName'] = ""; $data[$i]['eventTagId'] = ""; $data[$i]['description'] = ""; $data[$i]['poster'] = ""; $data[$i]['city'] = ""; $data[$i]['date'] = ""; $data[$i]['time'] = ""; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEventsHostedByCompany()\n{\n\t$companyUserName=validate_input($_GET['companyUserName']);\n\t$companyid=getCompanyIdfromCompanyUserName($companyUserName);\t\n}", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "function get_event_content_from_eventbrite($post_id = null) {\n if ($post_id == null) {\n return;\n }\n\n $eb_description_endpoint = \"https://www.eventbriteapi.com/v3/events/\" . get_field('eventbrite_id', $post_id) . '/description/';\n $eb_private_token = get_field('eb_private_token', 'option');\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $eb_description_endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n \"Authorization: Bearer \" . $eb_private_token\n ));\n\n $response = curl_exec($ch);\n curl_close($ch);\n return json_decode($response)->description;\n}", "function icalendar_get_events( $url = '', $count = 5 ) {\n\t// Find your calendar's address http://support.google.com/calendar/bin/answer.py?hl=en&answer=37103\n\t$ical = new iCalendarReader();\n\treturn $ical->get_events( $url, $count );\n}", "function mozilla_download_campaign_events() {\n\n\tif ( ! is_admin() && in_array( 'administrator', wp_get_current_user()->roles, true ) === false ) {\n\t\treturn;\n\t}\n\n\t// Verify nonce.\n\tif ( ! isset( $_GET['nonce'] ) || false === wp_verify_nonce( sanitize_key( $_GET['nonce'] ), 'campaign-events' ) ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $_GET['campaign'] ) && strlen( sanitize_key( $_GET['campaign'] ) ) > 0 ) {\n\t\t$campaign_id = sanitize_key( $_GET['campaign'] );\n\t\t$campaign = get_post( intval( sanitize_key( $campaign_id ) ) );\n\n\t\t$args = array( 'scope' => 'all' );\n\t\t$events = EM_Events::get( $args );\n\t\t$related_events = array();\n\n\t\tforeach ( $events as $event ) {\n\t\t\t$event_meta = get_post_meta( $event->post_id, 'event-meta' );\n\t\t\tif ( isset( $event_meta[0]->initiative ) && intval( $event_meta[0]->initiative ) === intval( $campaign->ID ) ) {\n\t\t\t\t$event->meta = $event_meta[0];\n\t\t\t\t$related_events[] = $event;\n\t\t\t}\n\t\t}\n\n\t\t$theme_directory = get_template_directory();\n\t\tinclude \"{$theme_directory}/languages.php\";\n\t\t$countries = em_get_countries();\n\n\t\theader( 'Content-Type: text/csv' );\n\t\theader( \"Content-Disposition: attachment;filename=campaign-{$campaign_id}-events.csv\" );\n\t\t$out = fopen( 'php://output', 'w' );\n\n\t\t$heading = array( 'ID', 'Event Title', 'Event Start Date', 'Event End Date', 'Description', 'Goals', 'Attendee Count', 'Expected Attendee Count', 'Language', 'Location', 'Tags', 'Hosted By', 'User ID', 'Group', 'Group ID' );\n\t\tfputcsv( $out, $heading );\n\n\t\tforeach ( $related_events as $related_event ) {\n\t\t\t$attendees = count( $related_event->get_bookings()->bookings );\n\t\t\t$language = isset( $related_event->meta->language ) && strlen( $related_event->meta->language ) > 0 ? $languages[ $related_event->meta->language ] : 'N/A';\n\t\t\t$event_meta = get_post_meta( $related_event->post_id, 'event-meta' );\n\t\t\t$location_type = isset( $event_meta[0]->location_type ) ? $event_meta[0]->location_type : '';\n\t\t\t$location_object = em_get_location( $related_event->location_id );\n\t\t\t$tag_object = $related_event->get_categories();\n\t\t\t$tags = '';\n\t\t\t$user_id = $related_event->event_owner;\n\t\t\t$event_creator = get_user_by( 'ID', $user_id );\n\n\t\t\tforeach ( $tag_object->terms as $tag ) {\n\t\t\t\t$tags = $tag->name . ', ';\n\t\t\t}\n\n\t\t\t// Remove last comma.\n\t\t\t$tags = rtrim( $tags, ', ' );\n\n\t\t\t$address = $location_object->address;\n\t\t\tif ( $location_object->city ) {\n\t\t\t\t$address = $address . ' ' . $location_object->city;\n\t\t\t}\n\n\t\t\tif ( $location_object->town ) {\n\t\t\t\t$address = $address . ' ' . $location_object->town;\n\t\t\t}\n\n\t\t\tif ( $location_object->country ) {\n\t\t\t\t$address = $address . ' ' . $countries[ $location_object->country ];\n\t\t\t}\n\n\t\t\t$location = 'OE' === $location->country ? 'Online' : $address;\n\t\t\t$group_object = new BP_Groups_Group( $related_event->group_id );\n\t\t\t$group = ( $group_object->id ) ? $group_object->name : 'N/A';\n\t\t\t$row = array(\n\t\t\t\t$related_event->event_id,\n\t\t\t\t$related_event->name,\n\t\t\t\t$related_event->event_start_date,\n\t\t\t\t$related_event->event_end_date,\n\t\t\t\t$related_event->post_content,\n\t\t\t\t$related_event->meta->goal,\n\t\t\t\t$attendees,\n\t\t\t\t$related_event->meta->projected_attendees,\n\t\t\t\t$language,\n\t\t\t\t$location,\n\t\t\t\t$tags,\n\t\t\t\t$event_creator->data->user_nicename,\n\t\t\t\t$user_id,\n\t\t\t\t$group,\n\t\t\t\t$group_object->id,\n\t\t\t);\n\n\t\t\tfputcsv( $out, $row );\n\n\t\t}\n\n\t\tfclose( $out );\n\t}\n\n\tdie();\n}", "function getEvents(){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('is_closed'=>false));\r\n\t\t$recordSet = $this->db->get(TBL_EVENTS);\r\n\t\t$events=$recordSet->result() ;\t\t\r\n\t\t//return json_encode($events);\r\n\t\tif (stristr($_SERVER[\"HTTP_ACCEPT\"],\"application/xhtml+xml\") ) {\r\n\t\t\t\theader(\"Content-type: application/xhtml+xml\"); } \r\n\t\telse{\r\n\t\t\t\theader(\"Content-type: text/xml\");\r\n\t\t}\r\n\t\t$xml=\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\";\r\n\t\t$xmlinner=\"\";\r\n\t\t$xmlinner=\"<newslist title=\\\"Event Calendar:\\\">\";\r\n\t\tforeach($events as $row){\r\n\t\t\t$xmlinner=$xmlinner.\"<news url=\\\"javascript:void(0)\\\" date='\".dateformat($row->event_date).\"' time='\".$row->event_time.\"'>\";\r\n\t\t\t$xmlinner=$xmlinner.\"<headline><![CDATA[\".$row->title.\"]]></headline>\";\r\n\t\t\t$xmlinner=$xmlinner.\"<detail><![CDATA[\".$row->venue.\"]]></detail>\";\r\n\t\t\t$xmlinner=$xmlinner.\"</news>\";\t\t\t\r\n\t\t}\r\n\t\t$xmlinner=$xmlinner.\"</newslist>\";\r\n\t\treturn $xml.$xmlinner;\r\n\t}", "function getEventsFeed($args = array()) {\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t$esc_chars = \",;\\\\\";\n\n\t \t// Get Page url if any\n\t \t$page_id = intval(get_option('fse_page'));\n\t \tif (!empty($page_id)) {\n\t \t\t$page_url = get_permalink($page_id);\n\t \t\tif (!empty($page_url)) {\n\t \t\t\tif (strpos($page_url, '?') === false)\n\t \t\t\t$page_url .= '?event=';\n\t \t\t\telse\n\t \t\t\t$page_url .= '&event=';\n\t \t\t}\n\t \t}\n\n\t \t$feed = array();\n\t \t$feed[] = 'BEGIN:VCALENDAR';\n\t \t$feed[] = 'METHOD:PUBLISH';\n\t \t$feed[] = 'PRODID:http://www.faebusoft.ch/webentwicklung/wpcalendar/';\n\t \t$feed[] = 'VERSION:2.0';\n\t \t$feed[] = 'X-WR-TIMEZONE:'.get_option('timezone_string');\n\n\t \t//print_r($events);\n\n\t \tforeach($events as $e) {\n\n\t \t\t$feed[] = 'BEGIN:VEVENT';\n\n\t \t\t$feed[] = 'UID:'.get_bloginfo('url').'/feed/ical/'.$e->eventid;\n\t \t\t//$feed[] = 'UID:'.md5(uniqid());\n\n\t \t\t// Add description\n\t \t\t$feed[] = 'DESCRIPTION:'.str_replace(array(\"\\r\",\"\\n\"), array('','\\n'),addcslashes(trim(strip_tags($e->getDescription())), $esc_chars));\n\n\t \t\t// Categories\n\t \t\tforeach($e->categories_t as $k => $c) {\n\t \t\t\t$e->categories_t[$k] = addcslashes($c, $esc_chars);\n\t \t\t}\n\t \t\t$feed[] = 'CATEGORIES:'.implode(',',$e->categories_t);\n\n\t \t\t// Location\n\t \t\t$feed[] = 'LOCATION:'.addcslashes($e->location, $esc_chars);\n\n\t \t\t// Summary\n\t \t\t$feed[] = 'SUMMARY:'.addcslashes($e->subject, $esc_chars);\n\n\t \t\t// Times\n\t \t\tif ($e->allday == true) {\n\t \t\t\t$feed[] = 'DTSTART;TZID='.get_option('timezone_string').';VALUE=DATE:'.mysql2date('Ymd', $e->from);\n\n\t \t\t\t// End has to be + 1!\n\t \t\t\t$end = strtotime($e->to)+(60*60*24);\n\t \t\t\t$feed[] = 'DTEND;TZID='.get_option('timezone_string').';VALUE=DATE:'.date('Ymd', $end);\n\t \t\t} else {\n\t \t\t\t$feed[] = 'DTSTART;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->from);\n\t \t\t\t$feed[] = 'DTEND;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->to);\n\t \t\t}\n\n\t \t\t// Classification\n\t \t\t$feed[] = 'CLASS:PUBLIC';\n\n\t \t\t// Publish Date of event\n\t \t\t$feed[] = 'DTSTAMP;TZID='.get_option('timezone_string').':'.mysql2date('Ymd\\THis', $e->publishdate);\n\n\t \t\t// URL of event\n\t \t\tif (!empty($e->postid)) {\n\t \t\t\t$feed[] = 'URL:'.get_permalink($e->postid);\n\t \t\t} elseif (!empty($page_url)) {\n\t \t\t\t$feed[] = 'URL:'.$page_url.$e->eventid;\n\t \t\t}\n\n\t \t\t$feed[] = 'END:VEVENT';\n\t \t}\n\n\t \t$feed[] = 'END:VCALENDAR';\n\n\t \t// Now trim all date to maxium 75chars\n\t \t$output = '';\n\t \tforeach ($feed as $f) {\n\t \t\t$new_line = true;\n\t \t\twhile(strlen($f) > 0) {\n\t \t\t\tif (!$new_line) {\n\t \t\t\t\t$output .= \"\\r\\n \"; // Add CRLF + Space!\n\t \t\t\t}\n\t \t\t\t$output .= substr($f, 0, 72);\n\t \t\t\t// String kürzen\n\t \t\t\tif (strlen($f) > 72) {\n\t \t\t\t\t$f = substr($f, 72);\n\t \t\t\t\t$new_line = false;\n\t \t\t\t} else {\n\t \t\t\t\t$f = '';\n\t \t\t\t}\n\t \t\t}\n\t \t\t$output .= \"\\r\\n\";\n\t \t}\n\n\t \treturn $output;\n\t }", "function icalendar_render_events( $url = '', $args = array() ) {\n\t$ical = new iCalendarReader();\n\treturn $ical->render( $url, $args );\n}", "public static function getEvents($calendars, $companyId, $employeeId, $start, $end) {\n\n $sql = \" SELECT event.id, event.name,event.start_datetime,event.end_datetime,event.color,is_all_day \"\n . \" FROM event \"\n . \" INNER JOIN calendar\t\"\n . \" ON event.calendar_id= calendar.id \"\n . \" AND calendar.company_id={$companyId} \"\n . \" AND calendar.disabled=\" . self::STATUS_ENABLE\n . \" WHERE ( \"\n . \" event.is_public=1 \"\n . \" OR event.created_employee_id={$employeeId}\t \"\n . \" OR (EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" WHERE invitation.event_id= event.id \"\n . \" AND invitation.owner_id={$employeeId} \"\n . \" AND invitation.owner_table='employee' \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" OR(EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" INNER JOIN department \"\n . \" ON invitation.owner_id=department.id \"\n . \" AND invitation.owner_table='department' \"\n . \" AND department.company_id={$companyId} \"\n . \" AND department.disabled=\" . self::STATUS_ENABLE\n . \" INNER JOIN employee \"\n . \" ON department.id=employee.department_id \"\n . \" AND employee.company_id={$companyId} \"\n . \" AND employee.id={$employeeId} \"\n . \" AND employee.disabled=\" . self::STATUS_ENABLE\n . \" WHERE invitation.event_id=event.id \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" ) \"\n . \" AND event.end_datetime <= \" . strtotime($end . \" 23:59:59\")\n . \" AND event.start_datetime >= \" . strtotime($start . \" 00:00:00\")\n . \" AND event.company_id={$companyId} \"\n . \" AND event.disabled=\" . self::STATUS_ENABLE;\n\n if (!empty($calendars)) {\n $sql .= \" AND event.calendar_id IN (\" . implode(',', $calendars) . \") \";\n $command = \\Yii::$app->getDb()->createCommand($sql);\n return $command->queryAll();\n }\n \n return [];\n }", "function getEvents($date = ''){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$eventListHTML = '';\r\n\t$date = $date?$date:date(\"Y-m-d\");\r\n\t//Get events based on the current date\r\n\t$result = $db->query(\"SELECT title FROM cakemaker WHERE date = '\".$date.\"' AND status = 1\");\r\n\tif($result->num_rows > 0){\r\n\t\t$eventListHTML = '<h2>Events on '.date(\"l, d M Y\",strtotime($date)).'</h2>';\r\n\t\t$eventListHTML .= '<ul>';\r\n\t\twhile($row = $result->fetch_assoc()){ \r\n $eventListHTML .= '<li>'.$row['title'].'</li>';\r\n }\r\n\t\t$eventListHTML .= '</ul>';\r\n\t}\r\n\techo $eventListHTML;\r\n}", "function fetch_events($event_id=SELECT_ALL_EVENTS, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n\t\t$date_time_option=SELECT_DT_BOTH, $privacy=PRIVACY_ALL, $tag_name=NULL) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$ret_events= NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry {\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \"; \n\t\t// Set up event id selection\n\t\tif ($event_id != NULL AND $event_id != SELECT_ALL_EVENTS) {\n\t\t\t$where = $where . $sql_and . \" eID = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t$param_values [] = $event_id; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif (($sdate_time != NULL AND $sdate_time != MIN_DATE_TIME) OR\n\t\t\t\t($edate_time != NULL AND $edate_time != MAX_DATE_TIME)) {\n\t\t\t// Check and set up if need to compare both (start and end time) or just start or end time\n\t\t\t// Set up Start date\n\t\t\tif ($date_time_option == SELECT_DT_START) {\n\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Set up end date\n\t\t\t\tif ($date_time_option == SELECT_DT_END) {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) \";\n\t\t\t\t\t$param_types = $param_types . \"ss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$where = $where . $sql_and .\n\t\t\t\t\t\" ( (sdate_time BETWEEN ? AND ? )\"\n\t\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\t\" (edate_time BETWEEN ? AND ? ) )\";\n\t\t\t\t\t$param_types = $param_types . \"ssss\"; // add parameter type\n\t\t\t\t\tarray_push($param_values,$sdate_time, $edate_time, $sdate_time, $edate_time); // add parameter value\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t\n\t\t// Set up privacy \n\t\tif ($privacy != NULL AND $privacy != PRIVACY_ALL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t//\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\t\t// build sqlstring \n\t\t$sqlString = \n\t\t \"SELECT * FROM events_all_v \"\n\t\t \t\t. $where .\n\t\t \" ORDER BY sdate_time, edate_time, eID\";\n\t\t// prepare statement\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t\t\t\n\t\t// bind parameters\n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\n\t\tif (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t// execute statement\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting events, event id: \" . $event_id .\n\t\t\" Date time: \" . $start_date_time . \" \" . $end_date_time .\n\t\t\" Date time option: \" . $date_time_option . \" privacy: \" . $privacy;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "public function fetchExternalEvents()\n {\n $db = \\JFactory::getDbo();\n $config = $GLOBALS['com_pbbooking_data']['config'];\n\n foreach ($GLOBALS['com_pbbooking_data']['calendars'] as $cal)\n {\n if ( isset($cal->enable_google_cal) && $cal->enable_google_cal == 1 )\n {\n // This has a google cal and should get external events.\n $service = new \\Google_Service_Calendar($this->googleClient);\n\n // Get the date range\n $dtfrom = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE));\n $dtto = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE))->modify('+ ' . $config->sync_future_events . 'months');\n\n $params = array(\n 'timeMin' => $dtfrom->format(DATE_ATOM),\n 'timeMax' => $dtto->format(DATE_ATOM),\n 'maxResults' => $config->google_max_results\n );\n\n $googleEvents = $service->events->listEvents(trim($cal->gcal_id),$params);\n\n // Now loop through the events\n\n //let's first of all the gcalids of the external events then I can unset the element to be left with an array\n //of events that USED to be in the goolge cal but aren't any more. Then I can just deleted.\n $cur_externals = $db->setQuery('select gcal_id from #__pbbooking_events where cal_id = ' . (int)$cal->id.' and externalevent = 1')->loadColumn();\n $real_externals = array();\n\n foreach ($googleEvents as $gEvent)\n {\n\n //first check to see if the event with that gcal_id exists\n $db_event = $db->setQuery('select * from #__pbbooking_events where gcal_id = \"'.$db->escape($gEvent->getId()).'\"')->loadObject();\n //if it exists check to see if it is \"owned\" by externalevent\n if ($db_event && isset($db_event->externalevent) && $db_event->externalevent == 1)\n {\n //if it is owned by externalevent then update in the database\n $db_event->summary = $gEvent->getSummary();\n $db_event->dtend = date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db_event->dtstart = date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db->updateObject('#__pbbooking_events',$db_event,'id');\n\n $real_externals[] = $gEvent->getId();\n\n echo '<br/>External event updated succesfully';\n } \n\n //if it's not ownedby externalevent then we don't need to do anything as it's owned by pbbooking\n \n \n if (!$db_event)\n {\n //else it doesn't exist in the database so we need to create \n $new_event = array(\n 'cal_id' => $cal->id,\n 'summary' => $gEvent->getSummary(),\n 'dtend' => date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'dtstart' => date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'verified' => 1,\n 'externalevent' => 1,\n 'gcal_id' => $gEvent->getId()\n );\n $db->insertObject('#__pbbooking_events',new \\JObject($new_event),'id');\n\n echo '<br/>External event created succesfully';\n }\n }\n\n $stale_externals = array_diff($cur_externals,$real_externals);\n //delete stale gcal events\n foreach ($stale_externals as $rmevent) {\n $db->setQuery('delete from #__pbbooking_events where gcal_id = \"'.$db->escape($rmevent).'\"')->execute();\n echo '<br/>External event deleted succesfully';\n }\n\n }\n }\n \n }", "function getEvents($date = '') {\n include 'config.php';\n $eventListHTML = '';\n $date = $date ? $date : date(\"Y-m-d\");\n //Get events based on the current date\n $result = $con->query(\"SELECT * FROM med_records WHERE entry_date = '\" . $date . \"' \");\n if ($result->num_rows > 0) {\n $eventListHTML = '<h2>Events on ' . date(\"l, d M Y\", strtotime($date)) . '</h2>';\n $eventListHTML .= '<td>';\n while ($row = $result->fetch_assoc()) {\n $eventListHTML .= '<td>' . $row['emp_name'] . '</td>';\n }\n $eventListHTML .= '</td>';\n }\n echo $eventListHTML;\n}", "function hookAjaxGetEvents() {\n\n\t \t$start = intval($_POST['start']);\n\t \t$end = intval($_POST['end']);\n\n\t \t$args['datefrom'] = $start;\n\t \t$args['dateto'] = $end;\n\t \t$args['datemode'] = FSE_DATE_MODE_ALL;\n\t \t$args['number'] = 0; // Do not limit!\n\n\t \tif (isset($_POST['state']))\n\t \t$args['state'] = $_POST['state'];\n\t \tif (isset($_POST['author']))\n\t \t$args['author'] = $_POST['author'];\n\t \tif (isset($_POST['categories']))\n\t \t$args['categories'] = $_POST['categories'];\n\t \tif (isset($_POST['include']))\n\t \t$args['include'] = $_POST['include'];\n\t \tif (isset($_POST['exclude']))\n\t \t$args['exclude'] = $_POST['exclude'];\n\t \t$events = $this->getEventsExternal($args);\n\n\t \t// Process array of events\n\t \t$events_out = array();\n\t \tforeach($events as $evt) {\n\t \t\tunset($e);\n\t \t\t$e['id'] = $evt->eventid;\n\t \t\t$e['post_id'] = $evt->postid;\n\t \t\t$e['post_url'] = (empty($evt->postid) ? '' : get_permalink($evt->postid));\n\t \t\t$e['title'] = $evt->subject;\n\t \t\t$e['allDay'] = ($evt->allday == true ? true : false);\n\t \t\t$e['start'] = mysql2date('c', $evt->from);\n\t \t\t$e['end'] = mysql2date('c', $evt->to);\n\t \t\t$e['editable'] = false;\n\n\t \t\t$classes = array();\n\t \t\tforeach($evt->categories as $c) {\n\t \t\t\t$classes[] = 'category-'.$c;\n\t \t\t}\n\t \t\tif (count($classes) > 0) {\n\t \t\t\t$e['className'] = $classes;\n\t \t\t}\n\t \t\t\n\t \t\t$events_out[] = $e;\n\t \t}\n\n\t \t$response = json_encode($events_out);\n\n\t \theader(\"Content-Type: application/json\");\n\t \techo $response;\n\n\t \texit;\n\t }", "function eventoni_get_events_by_id()\n{\n\t$event_ids = $_POST['event_ids'];\n\n\t// Aufsplitten des Strings in ein Array mit den Events\n\t$event_ids = explode('-',$event_ids);\n\n\t// Holen der Informationen zu den Events\n\t$data = eventoni_fetch('',true,$event_ids);\n\n\t// Rückgabe der Informationen zu den Events in XML\n\techo $data['xml'];\n\tdie();\n}", "function getEvents($date = '') {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $eventListHTML = '';\r\n $date = $date ? $date : date(\"Y-m-d\");\r\n //Get events based on the current date\r\n $result = $db->query(\"SELECT title FROM floralbookings WHERE date = '\" . $date . \"' AND status = 1\");\r\n if ($result->num_rows > 0) {\r\n $eventListHTML = '<h2>Events on ' . date(\"l, d M Y\", strtotime($date)) . '</h2>';\r\n $eventListHTML .= '<ul>';\r\n while ($row = $result->fetch_assoc()) {\r\n $eventListHTML .= '<li>' . $row['title'] . '</li>';\r\n }\r\n $eventListHTML .= '</ul>';\r\n }\r\n echo $eventListHTML;\r\n}", "function getEventsExternal($args = array()) {\n\t \t$author = $dateto = $allday = '';\n\t \t$datemode = FSE_DATE_MODE_ALL;\n\t \t$state = 'publish';\n\t \t//$d = time();\n\t \t//$datefrom = mktime(0,0,0, fsCalendar::date('m', $d), fsCalendar::date('d', $d), fsCalendar::date('Y', $d));\n\t \t$datefrom = 'now';\n\t \t$categories = $orderby = $orderdir = $include = $exclude = array();\n\t \t$start = 0;\n\t \t$count = false;\n\t \t$page = 0;\n\n\t \t// Get some values from options\n\t \t$number = intval(get_option('fse_number'));\n\n\t \tforeach($args as $k => $a) {\n\t \t\tswitch($k) {\n\t \t\t\tcase 'number':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\tif ($a >= 0) {\n\t \t\t\t\t\t$number = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'start':\n\t \t\t\t\t$start = intval($a);\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'exclude':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $e) {\n\t \t\t\t\t\t$e = intval($e);\n\t \t\t\t\t\tif (!empty($e)) {\n\t \t\t\t\t\t\t$exclude[] = intval($e);\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'include':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $e) {\n\t \t\t\t\t\t$e = intval($e);\n\t \t\t\t\t\tif (!empty($e)) {\n\t \t\t\t\t\t\t$include[] = intval($e);\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'state':\n\t \t\t\t\tif (in_array($a,array('publish', 'draft')))\n\t \t\t\t\t$state = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'author':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\t$u = new WP_User($a);\n\t \t\t\t\tif (!empty($u->ID)) {\n\t \t\t\t\t\t$author = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'categories':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $c) {\n\t \t\t\t\t\t$c = intval($c);\n\t \t\t\t\t\tif (!empty($c))\n\t \t\t\t\t\t$categories[] = $c;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'datefrom':\n\t \t\t\t\t$datefrom = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'allday':\n\t \t\t\t\tif (is_bool($a)) {\n\t \t\t\t\t\t$allday = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'dateto':\n\t \t\t\t\t$dateto = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'datemode':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\tif (in_array($a, array(1,2,3)))\n\t \t\t\t\t\t$datemode = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'orderby':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = array($a);\n\t \t\t\t\t$orderby = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'orderdir':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = array($a);\n\t \t\t\t\t$orderdir = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'count':\n\t \t\t\t\t$count = true;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'page':\n\t \t\t\t\t$page = intval($a);\n\t \t\t\t\tbreak;\n\t \t\t}\n\t \t}\n\n\t \t// Calculate values for page\n\t \tif ($page > 0) {\n\t \t\t$start = ($page - 1) * $number;\n\t \t}\n\n\t \t$sortstring = '';\n\t \tif (count($orderby) > 0) {\n\t \t\t$dir = array('desc','asc','descending','ascending');\n\t \t\tforeach($orderby as $k => $o) {\n\t \t\t\t$o = trim(strtolower($o));\n\t \t\t\tif (in_array($o, self::$valid_fields)) {\n\t \t\t\t\tif (!empty($sortstring))\n\t \t\t\t\t$sortstring .= ', ';\n\t \t\t\t\tif (strpos($o, '.') === false)\n\t \t\t\t\t$sortstring .= 'e.';\n\t \t\t\t\t$sortstring .= $o;\n\n\t \t\t\t\tif (isset($orderdir[$k])) {\n\t \t\t\t\t\t$d = trim(strtolower($orderdir[$k]));\n\t \t\t\t\t\tif (in_array($d, $dir)) {\n\t \t\t\t\t\t\t$sortstring .= ' '.$d;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t \tif (!empty($state))\n\t \t\t$filter['state'] = $state;\n\t \tif (!empty($author))\n\t \t\t$filter['author'] = $author;\n\t \tif (count($categories) > 0)\n\t \t\t$filter['categories'] = $categories;\n\t \tif (!empty($datefrom))\n\t \t\t$filter['datefrom'] = $datefrom;\n\t \tif (!empty($dateto))\n\t \t\t$filter['dateto'] = $dateto;\n\t \tif (count($include) > 0)\n\t \t\t$filter['id_inc'] = $include;\n\t \tif (count($exclude) > 0)\n\t \t\t$filter['id_exc'] = $exclude;\n\t \tif (is_bool($allday) == true) // Type!\n\t \t\t$filter['allday'] = $allday;\n\t \t\t\n\t \t$filter['datemode'] = $datemode;\n\n\t \tif ($count == true) {\n\t \t\treturn $this->getEvents($filter, $sortstring, 0, 0, true);\n\t \t} else {\n\t \t\t$evt = $this->getEvents($filter, $sortstring, $number, $start);\n\t \t}\n\n\n\t \tif ($evt === false) {\n\t \t\treturn false;\n\t \t}\n\t \t$ret = array();\n\t \tforeach($evt as $e) {\n\t \t\t$et = new fsEvent($e, '', false);\n\t \t\tif ($et->eventid > 0) {\n\t \t\t\t$ret[] = $et;\n\t \t\t}\n\t \t}\n\n\t \treturn $ret;\n\t }", "private function _get_event_entries()\n\t{\n\t\t// --------------------------------------\n\t\t// Default status to open\n\t\t// --------------------------------------\n\n\t\tif ( ! $this->EE->TMPL->fetch_param('status'))\n\t\t{\n\t\t\t$this->EE->TMPL->tagparams['status'] = 'open';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Start composing query\n\t\t// --------------------------------------\n\n\t\t$this->EE->db->select($this->model->entry_attributes('e.'))\n\t\t ->from($this->model->table(). ' e')\n\t\t ->join('channel_titles t', 'e.entry_id = t.entry_id')\n\t\t ->where_in('t.site_id', $this->EE->TMPL->site_ids);\n\n\t\t// --------------------------------------\n\t\t// Apply simple filters\n\t\t// --------------------------------------\n\n\t\t$filters = array(\n\t\t\t'entry_id' => 't.entry_id',\n\t\t\t'url_title' => 't.url_title',\n\t\t\t'channel_id' => 't.channel_id',\n\t\t\t'author_id' => 't.author_id',\n\t\t\t'status' => 't.status'\n\t\t);\n\n\t\tforeach ($filters AS $param => $attr)\n\t\t{\n\t\t\t$this->_simple_filter($param, $attr);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by events field, prefixed\n\t\t// --------------------------------------\n\n\t\t$this->_event_field_filter('e');\n\n\t\t// --------------------------------------\n\t\t// Are we getting all events or just upcoming\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_passed') == 'no')\n\t\t{\n\t\t\t$this->EE->db->where('e.end_date >=', $this->today);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by channel name\n\t\t// --------------------------------------\n\n\t\tif ($channel = $this->EE->TMPL->fetch_param('channel'))\n\t\t{\n\t\t\t// Determine which channels to filter by\n\t\t\tlist($channel, $in) = low_explode_param($channel);\n\n\t\t\t// Adjust query accordingly\n\t\t\t$this->EE->db->join('channels c', 'c.channel_id = t.channel_id');\n\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('c.channel_name', $channel);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter by category\n\t\t// --------------------------------------\n\n\t\tif ($categories_param = $this->EE->TMPL->fetch_param('category'))\n\t\t{\n\t\t\t// Determine which categories to filter by\n\t\t\tlist($categories, $in) = low_explode_param($categories_param);\n\n\t\t\t// Allow for inclusive list: category=\"1&2&3\"\n\t\t\tif (strpos($categories_param, '&'))\n\t\t\t{\n\t\t\t\t// Execute query the old-fashioned way, so we don't interfere with active record\n\t\t\t\t// Get the entry ids that have all given categories assigned\n\t\t\t\t$query = $this->EE->db->query(\n\t\t\t\t\t\"SELECT entry_id, COUNT(*) AS num\n\t\t\t\t\tFROM exp_category_posts\n\t\t\t\t\tWHERE cat_id IN (\".implode(',', $categories).\")\n\t\t\t\t\tGROUP BY entry_id HAVING num = \". count($categories));\n\n\t\t\t\t// If no entries are found, make sure we limit the query accordingly\n\t\t\t\tif ( ! ($entry_ids = low_flatten_results($query->result_array(), 'entry_id')))\n\t\t\t\t{\n\t\t\t\t\t$entry_ids = array(0);\n\t\t\t\t}\n\n\t\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('t.entry_id', $entry_ids);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Join category table\n\t\t\t\t$this->EE->db->join('category_posts cp', 'cp.entry_id = t.entry_id');\n\t\t\t\t$this->EE->db->{($in ? 'where_in' : 'where_not_in')}('cp.cat_id', $categories);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Hide expired entries\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_expired', 'no') != 'yes')\n\t\t{\n\t\t\t$this->EE->db->where('(t.expiration_date = 0 OR t.expiration_date >= '.$this->date->now().')');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Hide future entries\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('show_future_entries', 'no') != 'yes')\n\t\t{\n\t\t\t$this->EE->db->where('t.entry_date <=', $this->date->now());\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Handle search fields\n\t\t// --------------------------------------\n\n\t\tif ($search_fields = $this->_search_where($this->EE->TMPL->search_fields, 'd.'))\n\t\t{\n\t\t\t// Join exp_channel_data table\n\t\t\t$this->EE->db->join('channel_data d', 't.entry_id = d.entry_id');\n\t\t\t$this->EE->db->where(implode(' AND ', $search_fields), NULL, FALSE);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Return the results\n\t\t// --------------------------------------\n\n\t\treturn $this->EE->db->get()->result_array();\n\t}", "function eventoni_suggest_events()\n{\n\t// POST-Daten (Inhalt + Titel) auslesen und analysieren\n\t$content = $_POST['content'];\n\t$what = analyse_content($content);\n\n\t// hole Rohdaten zu den Events anhand des analysierten Text-Inhalts\n\t$data = eventoni_fetch('&wt='.$what, true);\n\techo $data['xml'];\n\tdie();\n}", "public function getCalendarEvents($uid, $appName, $facebook_page_id = '') {\n $user = \\Drupal::currentUser();\n if ($appName) {\n $terms_obj = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($appName);\n $socialname = $terms_obj->getName();\n $events = array();\n $query = \\Drupal::database()->select('social_media', 'sm');\n if ($facebook_page_id) {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->condition('sm.page_id', $facebook_page_id, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n } else {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n }\n if (!empty($result)) {\n foreach ($result as $row_object) {\n $date = new DrupalDateTime(date('Y-m-d H:i:s', $row_object->scheduled_timestamp), new \\DateTimeZone('utc'));\n $date->setTimezone(new \\DateTimeZone($user->getTimeZone()));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n //$manual_datetime = $scheduled_data->manual_datetime;\n $published_date = date('Y-m-d H:i:s', $manual_datetime);\n $Onlytime = explode(\" \", $published_date);\n $formatedTime = date(\"g:i a\", strtotime($Onlytime[1]));\n $unformatedTime = date('Y-m-d H:00', $manual_datetime);\n $events[] = array('start' => $unformatedTime);\n }\n }\n }\n return $events;\n }", "function listEventInfo() {\n\t\t$query = \"SELECT e_description, c_name, tag_name, start_datetime, end_datetime, capacity, v.name AS vname, address,o.name AS oname, v.address, v.city, v.state, v.postal_code \n\t\tFROM yam14.F_event e, yam14.F_venue v, yam14.F_category c, yam14.F_topic t, yam14.F_organizer o\n\t\tWHERE e.venue_id = v.v_id \n\t\tAND c.c_id = e.c_id \n\t\tAND t.tag_id = e.tag_id \n\t\tAND o.o_id = e.organizer_id\n\t\tAND e.e_id = $this->eid ;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->category = $row['c_name'];\n\t\t\t$this->tag = $row['tag_name'];\n\t\t\t$this->description = $row['e_description'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t$this->capacity = $row['capacity'];\n\t\t\t$this->venue = $row['vname'];\n\t\t\t$this->address = $row['address'] . \", \" . $row['city'] . \", \" . $row['state'] . \" \" . $row['postal_code'];\n\t\t\t$this->organizer = $row['oname'];\n\t\t\techo \"<hr />\";\n\t\t\techo \"<div class=\\\"panel panel-default\\\">\";\n\t\t\techo \t\"<div class=\\\"panel-heading\\\">\";\n\t\t\techo \t\"<h3 class=\\\"panel-title\\\">Event Information</h3>\";\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"<div class=\\\"panel-body\\\">\";\n\t\t\techo \"<p><b>Description: </b>$this->description</p>\";\n\t\t\techo \t\"<p><b>Category: </b>$this->category</p>\";\n\t\t\techo \t\"<p><b>Topic: </b>$this->tag</p>\";\n\t\t\techo \t\"<p><b>Start Date: </b>$this->startdate</p>\";\n\t\t\techo \t\"<p><b>Start Time: </b>$this->starttime</p>\";\n\t\t\techo \t\"<p><b>End Date: </b>$this->enddate</p>\";\n\t\t\techo \t\"<p><b>End Time: </b>$this->endtime</p>\";\n\t\t\techo \t\"<p><b>Capacity: </b>$this->capacity</p>\";\n\t\t\techo \t\"<p><b>Organizer: </b>$this->organizer</p>\";\n\t\t\techo \t\"<p><b>Location: </b>$this->venue</p>\";\n\t\t\techo \t\"<p><b>Address: </b>$this->address</p>\";\n\t\t\t\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"</div>\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t}", "function obj_cx_events_list_inner( $events, $bottom_banner, $pagination, $event_list_deets = null ) {\n echo '<h3 class=\"section-title green\">Upcoming events</h3>';\n obj_do_cx_events_list_filter( $events );\n obj_do_cx_events_list( $events );\n obj_do_cx_event_bottom_banner_output( $bottom_banner );\n obj_do_cx_events_list_pagination( $pagination );\n}", "function get_event_xml(){\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/calendar-categories.xml\"));\n $categories = array();\n $xml = $xml->{'system-page'};\n foreach ($xml->children() as $child) {\n if($child->getName() == \"dynamic-metadata\"){\n foreach($child->children() as $metadata){\n if($metadata->getName() == \"value\"){\n array_push($categories, (string)$metadata);\n }\n }\n }\n }\n// $xml = simplexml_load_file($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\");\n $xml = autoCache(\"simplexml_load_file\", array($_SERVER[\"DOCUMENT_ROOT\"] . \"/_shared-content/xml/events.xml\"));\n $event_pages = $xml->xpath(\"//system-page[system-data-structure[@definition-path='Event']]\");\n $dates = array();\n $datePaths = array();\n foreach($event_pages as $child ){\n $page_data = inspect_page($child, $categories);\n if (!$page_data[\"hide-from-calendar\"]){\n $dates = add_event_to_array($dates, $page_data, $datePaths);\n }\n }\n return $dates;\n}", "private function makeDayEventListHTML()\n\t{\n\t\t$showtext = \"\";\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\n\t\t\t\t$category = (strlen($item['cat']) > 0 ? 'Category: '.$item['cat'].' - ' : '');\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$href = '<a href=\"'.$item['url'].'?id='.$item['id'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>';\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$href = (strlen($item['url']) > 0 ? '<a href=\"'.$item['url'].'\" title=\"'.$category.$item['desc'].'\">'.$item['text'].'</a>' : $item['text']);\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$style = (strlen($item['catcolor']) > 0 ? ' style=\"background-color:#'.str_replace('#','',$item['catcolor']).';\" ' : ' style=\"background-color:#eeeeee;\" ');\n\t\t\t\t\n\t\t\t\t$showtext .= \"\\n\\t\\t\\t<div class=\\\"dayContent\\\"\".$style.\">\".$href.\"</div>\\n\\t\\t\";\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\treturn $showtext;\n\t}", "function render($events){\n\t\t// in the weekly event view\n\t\t$number_of_events=sizeof($events);\n\t\t$i=0;\n\t\t$return_val=\"\";\n\t\twhile($i<$number_of_events){\n\t\t\t$next_event=$events[$i];\n\t\t\t$return_val=$return_val.\"<a href=\\\"event_display_detail.php?event_id=\";\n\t\t\t$return_val=$return_val.($next_event->get_id());\n\t\t\t$return_val=$return_val.\"&amp;day=\".$next_event->get_start_day();\n\t\t\t$return_val.=\"&amp;month=\".$next_event->get_start_month();\n\t\t\t$return_val.=\"&amp;year=\".$next_event->get_start_year();\n\t\t\t$return_val.=\"\\\" class=\\\"eventTitle\\\">\";\n\t\t\t$return_val=$return_val.(htmlspecialchars($next_event->get_title()));\n\t\t\t$return_val=$return_val.\"</a><br />\";\n\n\t\t\t$start_time_obj=$next_event->get_start_time_object();\n\t\t\t$display_timerange=$start_time_obj->get_display_time();\n\t\t\tif ($next_event->get_duration()>0){\n\t\t\t\t$end_time_obj=$next_event->get_end_time_object();\n\t\t\t\t$display_timerange=$display_timerange.\" - \".$end_time_obj->get_display_time();\n\n\t\t\t}\n\n\t\t\t$return_val=$return_val.$display_timerange.\"<br />\";\n\t\t\tif (strlen(trim($next_event->get_event_type_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_event_type_name()).\"<br />\";\n\t\t\t}\n\t\t\tif (strlen(trim($next_event->get_location_name()))>0){\n\t\t\t\t$return_val=$return_val.htmlspecialchars($next_event->get_location_name()).\"<br />\";\n\t\t\t}\n\t\t\t$return_val=$return_val.\"<br />\";\n\t\t\t$i=$i+1;\n\t\t}\n\t\tif (strlen($return_val)==0){\n\t\t\treturn \"&nbsp;\";\n\t\t}\n\t\treturn $return_val;\n\t}", "function searchEventsDetailsBasicFormating($keyWordParams) {\r\t$resultString = '';\r\t$keyWordParams['websiteConfigID'] = WEB_CONF_ID;\r\tif($keyWordParams['searchTerms']) {\r\t\t$client = new SoapClient(WSDL);\r\t\t$result = $client -> __soapCall('SearchEvents', array('parameters' => $keyWordParams));\r\t\tif(is_soap_fault($result)) {\r\t\t\techo '<h2>Fault</h2><pre>';\r\t\t\tprint_r($result);\r\t\t\techo '</pre>';\r\t\t}\r\n\t\t$eventDetails=\"\";\r\t\tif(empty($result)){\r\t\t\treturn \"No results match the specified terms\";\r\t\t}else {\r\n\t\t\tfor($q=0;$q<count($result->SearchEventsResult->Event);$q++){\r\n\t\t\t\t$resultsObj=$result->SearchEventsResult->Event[$q];\r\n\t\t\t\t$eventDetails.=\"<b>ID: </b>\".$resultsObj->ID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Name: </b>\".$resultsObj->Name.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Date: </b>\".$resultsObj->Date.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>DisplayDate: </b>\".$resultsObj->DisplayDate.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Venue: </b>\".$resultsObj->Venue.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>City: </b>\".$resultsObj->City.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>StateProvince: </b>\".$resultsObj->StateProvince.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>ParentCategoryID: </b>\".$resultsObj->ParentCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>ChildCategoryID: </b>\".$resultsObj->ChildCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>GrandchildCategoryID: </b>\".$resultsObj->GrandchildCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>MapURL: </b>\".$resultsObj->MapURL.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>VenueID: </b>\".$resultsObj->VenueID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>StateProvinceID: </b>\".$resultsObj->StateProvinceID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>VenueConfigurationID: </b>\".$resultsObj->VenueConfigurationID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Clicks: </b>\".$resultsObj->Clicks.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>IsWomensEvent: </b>\".$resultsObj->IsWomensEvent.\"<br><br>\";\r\n\t\t\t}\r\n\t\t\tunset($client);\r\n\t\t\treturn $eventDetails;\r\t\t}\r\t}\r}", "function tbt_ws_event(){\r\n\r\n\t$html_code_s_template='\r\n\t\t\t<div class=\"ws_ev\">\r\n\t\t\t\t<div class=\"ws_ev_cl\">\r\n\t\t\t\t\t[calendar]\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"ws_ev_tl1\">\r\n\t\t\t\t\t[ev_tl_1]\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"ws_ev_tl2\">\r\n\t\t\t\t\t[ev_tl_2]\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"ws_ev_soc\">\r\n\t\t\t\t\t[social]\r\n\t\t\t\t</div>\r\n\t\t\t</div>';\r\n\t$total_events=4;\r\n\t$event_number=1;\r\n\t// query db\r\n\t$s_event = [];\r\n\t$s_event['calendar']=\"dddd\";\r\n\t$s_event['ev_tl_1']=\"GO LIVE EVENT!!\";\r\n\t$s_event['ev_tl_2']=\"platform presentation\";\r\n\t$s_event['social']='\r\n\t\t\t\t\t\t<a href=\"#\"><img src=\"../_web_st/templates/000/imgs/face.png\" /></a>\r\n\t\t\t\t\t\t<a href=\"#\"><img src=\"../_web_st/templates/000/imgs/google.png\" /></a>\r\n\t\t\t\t\t\t<a href=\"#\"><img src=\"../_web_st/templates/000/imgs/inst.png\" /></a>\r\n\t\t\t\t\t\t<a href=\"#\"><img src=\"../_web_st/templates/000/imgs/pin.png\" /></a>\r\n\t\t\t\t\t\t<a href=\"#\"><img src=\"../_web_st/templates/000/imgs/twitter.png\" /></a>\r\n\t\t\t\t\t';\r\n\r\n\r\n\twhile($event_number<=$total_events){\r\n\t\t// insert data\r\n\t\t$html_code_s=$html_code_s_template;\r\n\t \tforeach ($s_event as $key => $value) {\r\n\t\t\t# code...\r\n\t\t\t$html_code_s=str_replace( \"[\".$key.\"]\",$value, $html_code_s);\r\n\t\t\t\r\n\t\t} \r\n\t\t$html_code=$html_code_s.$html_code;\r\n\t\t$event_number++;\r\n\t\t}\r\n\treturn '<div id=\"event\">'.$html_code.'</div>';\r\n\r\n}", "function get_event_wct($html) {\n\t$event_name = $html->find(\".wctlight\")[0]->plaintext;\n\t//Common Sense check\n\tif (strlen($event_name) <= 3) {\n\t\techo \"\\n\\n*****ERROR: Short Event name found\\n\";\n\t\tpause(\"\");\n\t}\n\t\n\t$event_location = $html->find(\".wctlight\")[1]->plaintext;\n\t//Common Sense check\n\tif (strlen($event_location) <= 3) {\n\t\techo \"\\n\\n****ERROR: Short Event location found*****\\n\\n\";\n\t\tpause(\"\");\n\t}\n\t//Get the event date\n\t$event_date_html = str_replace(\"&nbsp;\", \"\", $html->find(\".wctlight\")[3]->plaintext);\n\t$start_date = get_date_wct($event_date_html, \"start\");\n\t$end_date = get_date_wct($event_date_html, \"end\");\n\t\n\t//Get the event purse\n\t$event_purse = get_purse_wct($html->find(\".wctlight\")[5]->plaintext);\n\t\n\t$event_currency = get_currency_wct($html->find(\".wctlight\")[5]->plaintext);\n\t\n\t$event_gender = get_gender_wct($html);\n\n\treturn new Event($event_location, $start_date, $end_date, $event_purse, $event_currency, $event_name, $event_gender);\n}", "function display_day()\n{\n global $phpcid, $phpc_cal, $phpc_script, $phpcdb, $day, $month, $year;\n\n\t$monthname = month_name($month);\n\n $results = $phpcdb->get_occurrences_by_date($phpcid, $year, $month, $day);\n\n\t$have_events = false;\n\n\t$html_table = tag('table', attributes('class=\"phpc-main\"'),\n\t\t\ttag('caption', \"$day $monthname $year\"),\n\t\t\ttag('thead',\n\t\t\t\ttag('tr',\n\t\t\t\t\ttag('th', __('Title')),\n\t\t\t\t\ttag('th', __('Time')),\n\t\t\t\t\ttag('th', __('Description'))\n\t\t\t\t )));\n\tif($phpc_cal->can_modify()) {\n\t\t$html_table->add(tag('tfoot',\n\t\t\t\t\ttag('tr',\n\t\t\t\t\t\ttag('td',\n\t\t\t\t\t\t\tattributes('colspan=\"4\"'),\n\t\t\t\t\t\t\tcreate_hidden('action', 'event_delete'),\n\t\t\t\t\t\t\tcreate_hidden('day', $day),\n\t\t\t\t\t\t\tcreate_hidden('month', $month),\n\t\t\t\t\t\t\tcreate_hidden('year', $year),\n\t\t\t\t\t\t\tcreate_submit(__('Delete Selected'))))));\n\t}\n\n\t$html_body = tag('tbody');\n\n\twhile($row = $results->fetch_assoc()) {\n\t\n\t\t$event = new PhpcOccurrence($row);\n\n\t\tif(!$event->can_read())\n\t\t\tcontinue;\n\n\t\t$have_events = true;\n\n\t\t$eid = $event->get_eid();\n\t\t$oid = $event->get_oid();\n\n\t\t$html_subject = tag('td');\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(create_checkbox('eid[]',\n\t\t\t\t\t\t$eid));\n\t\t}\n\n\t\t$html_subject->add(create_occurrence_link(tag('strong',\n\t\t\t\t\t\t$event->get_subject()),\n\t\t\t\t\t'display_event', $oid));\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(\" (\");\n\t\t\t$html_subject->add(create_event_link(\n\t\t\t\t\t\t__('Modify'), 'event_form',\n\t\t\t\t\t\t$eid));\n\t\t\t$html_subject->add(')');\n\t\t}\n\n\t\t$html_body->add(tag('tr',\n\t\t\t\t\t$html_subject,\n\t\t\t\t\ttag('td', $event->get_time_span_string()),\n\t\t\t\t\ttag('td', attributes('class=\"phpc-desc\"'), $event->get_desc())));\n\t}\n\n\t$html_table->add($html_body);\n\n\tif($phpc_cal->can_modify()) {\n\t\t$output = tag('form',\n\t\t\t\tattributes(\"action=\\\"$phpc_script\\\"\"),\n\t\t\t\t$html_table);\n\t} else {\n\t\t$output = $html_table;\n\t}\n\n\tif(!$have_events)\n\t\t$output = tag('h2', __('No events on this day.'));\n\n\treturn tag('', create_day_menu(), $output);\n}", "function events($year, $month)\n {\n $cursor = '';\n $events = array();\n\n // Tadpoles returns events spread across multiple pages of data.\n // Keep grabbing the next page until we've exhausted all available events.\n do {\n $month = str_pad($month, 2, '0', STR_PAD_LEFT);\n\n $last_day = date('t', strtotime(\"$year-$month-01\"));\n $last_day = str_pad($last_day, 2, '0', STR_PAD_LEFT);\n\n $earliest_ts = strtotime(\"$year-$month-01 00:00:00\");\n $latest_ts = strtotime(\"$year-$month-$last_day 23:59:59\");\n\n $params = array('num_events' => '100', 'state' => 'client', 'direction' => 'range', 'earliest_event_time' => $earliest_ts, 'latest_event_time' => $latest_ts, 'cursor' => $cursor);\n $jsonStr = curl('https://www.tadpoles.com/remote/v1/events?' . http_build_query($params));\n $json = json_decode($jsonStr);\n\n $events = array_merge($events, $json->events);\n $cursor = $json->cursor;\n } while(isset($json->cursor) && strlen($json->cursor) > 0);\n\n return $events;\n }" ]
[ "0.6719177", "0.5737817", "0.57055044", "0.56928104", "0.5660665", "0.5620502", "0.5587777", "0.5515329", "0.54409856", "0.54086524", "0.53949827", "0.53800833", "0.5368406", "0.5316244", "0.53147215", "0.5311054", "0.530174", "0.52827525", "0.5282623", "0.52796596", "0.5237314", "0.5213808", "0.5205971", "0.5198465", "0.5162432", "0.51555884", "0.51525134", "0.51475286", "0.51396936", "0.51371306" ]
0.5792048
1
Function to fetch events hosted by a company using company user name (Not in use as of now. This is fetched from mother function internally) June 28,2016
function getEventsHostedByCompany() { $companyUserName=validate_input($_GET['companyUserName']); $companyid=getCompanyIdfromCompanyUserName($companyUserName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchCompanyEvents($companyid)\n{\n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\t\n\t\n\t$data= array();\n\t\n\t$qry=\"SELECT * FROM entrp_events WHERE companyid=\".$companyid.\" AND status=1\";\n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n $i=0; //to initiate count\n if($count_res>0)\n {\n \twhile($row=mysqli_fetch_array($res))\n {\n \t$data[$i]['id']\t\t\t\t=\t$row['id'];\n\t\t\t$data[$i]['eventName']\t\t=\t$row['eventName'];\n\t\t\t$data[$i]['eventTagId']\t\t=\t$row['eventTagId'];\n\t\t\t$data[$i]['description']\t=\thtmlspecialchars_decode($row['description'],ENT_QUOTES);\n\t\t\tif($row['poster']!='')\n\t\t\t{\n\t\t\t\t$data[$i]['poster']\t\t\t=\t$row['poster'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data[$i]['poster']\t\t\t=\t$event_default_poster;\n\t\t\t}\n\t\t\t\n\t\t\t$data[$i]['city']\t\t\t\t=\t$row['city'];\n\t\t\t$data[$i]['date']\t\t\t\t=\t$row['event_date'];\n\t\t\t$data[$i]['time']\t\t\t\t=\t$row['event_time'];\n\t\t\t$data[$i]['joining']\t\t\t=\tgoingForThisEventorNot($data[$i]['id']);\n\t\t\t$i++;\n }\t\n }\n else\n {\n \t$data[$i]['id']\t\t\t\t=\t\"\";\n\t\t$data[$i]['eventName']\t\t=\t\"\";\n\t\t$data[$i]['eventTagId']\t\t=\t\"\";\n\t\t$data[$i]['description']\t=\t\"\";\n\t\t$data[$i]['poster']\t\t\t=\t\"\";\n\t\t$data[$i]['city']\t\t\t\t=\t\"\";\n\t\t$data[$i]['date']\t\t\t\t=\t\"\";\n\t\t$data[$i]['time']\t\t\t\t=\t\"\";\n }\n\t\n\treturn $data;\n\n}", "function fetch_user_events_by_email ($pass_email=NULL, $sdate_time=MIN_DATE_TIME, $edate_time=MAX_DATE_TIME,\n \t\t $privacy=NULL, $role_ids=NULL, $tag_name=NULL) {\n \tglobal $cxn;\n \t// Initialize variables\n \t$ret_events=NULL;\n \t// Check and replace start date time and end date time\n \tif ($sdate_time == NULL ) {\n \t\t$sdate_time = MIN_DATE_TIME;\n \t} \n \tif ($edate_time == NULL ) {\n \t\t$edate_time = MAX_DATE_TIME;\n \t}\n\n \t$errArr=init_errArr(__FUNCTION__);\n \ttry\n\t{\n\t\t// initialize variables\n\t\t$where = ZERO_LENGTH_STRING;\n\t\t$param_types = ZERO_LENGTH_STRING;\n\t\t$param_values = array();\n\t\t$sql_and = \" \";\n\t\t// Set email selection\n\t\tif ($pass_email != NULL) {\n\t\t\t$where = $where . $sql_and . \" email = ? \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t$param_values [] = $pass_email; // add parameter value\n\t\t}\n\t\t// Set up date and time selection\n\t\tif ($sdate_time != MIN_DATE_TIME OR $edate_time != MAX_DATE_TIME) {\n\t\t\t$where = $where . $sql_and .\n\t\t\t \" (sdate_time BETWEEN ? AND ? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t// Initialize parameter types and parameter values\n\t\t\t$param_types = $param_types . \"ss\";\n\t\t\tarray_push($param_values, $sdate_time, $edate_time);\n\t\t}\n\t\t// set up privacy\n\t\tif ($privacy != NULL) {\n\t\t\t$where = $where . $sql_and . \" privacy = ?\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$param_types = $param_types . \"s\"; // add parameter type\n\t\t\t$param_values [] = $privacy; // add parameter value\n\t\t}\n\t\t// set up Role selection\n\t\tif ($role_ids != NULL and count($role_ids) > 0) {\n\t\t\t$where = $where . $sql_and . \" role_id IN (\";\n\t\t\t$first_element=TRUE;\n\t\t\tforeach ($role_ids as $rid) {\n\t\t\t\tif ($first_element) {\n\t\t\t\t\t$first_element = FALSE;\n\t\t\t\t\t$comma = \"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$comma = \",\";\n\t\t\t\t}\n\t\t\t\t$where = $where . $comma . \"?\";\n\t\t\t\t$param_types = $param_types . \"i\"; // add parameter type\n\t\t\t\t$param_values [] = $rid; // add parameter value\n\t\t\t}\n\t\t\t$where = $where . \")\";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t}\n\t\t//\n\t\tif ($tag_name != NULL) {\n\t\t\t$where = $where . $sql_and . \" ( tag_1=? OR tag_2=? OR tag_3=? OR tag_4=? OR tag_5=? OR tag_6=? ) \";\n\t\t\t$sql_and = \" AND \"; // set up \"AND\" value tobe used in following settings\n\t\t\t$i = 0;\n\t\t\tdo {\n\t\t\t\t$param_types = $param_types . \"s\" ; // add parameter type\n\t\t\t\t$param_values [] = $tag_name; // add parameter value\n\t\t\t\t$i++;\n\t\t\t} while ($i < 6);\n\t\t}\n\t\t// Add WHERE keyword\t\t\n\t\tif (trim($where) !== ZERO_LENGTH_STRING) {\n\t\t\t$where = \" WHERE \" . $where;\n\t\t}\n\n\t\t// SQL String\n\t\t$sqlString = \"SELECT * \"\n\t\t\t \t. \" FROM users_events_dtl_v \"\n\t\t\t \t. $where . \n\t\t\t \t\" ORDER BY sdate_time, eID\";\t\t\n\t\t\t \t\n \t$stmt = $cxn->prepare($sqlString);\n\t\t// bind parameters \n\t\t// Create array of types and their values\n\t\t$params=array_merge( array($param_types), $param_values);\n\t\t\t\t\n\t if (count($param_values) > 0) {\n\t\t\tcall_user_func_array ( array($stmt, \"bind_param\"), ref_values($params) );\n\t\t}\n\t\t$stmt->execute();\n\t\t// Store result\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$ret_events[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code = 1;\n\t\t$err_descr = \"Error selecting user events for the email: \" . $pass_email . \" \" .\n\t\t\t\t$sdate_time . \" \" . $edate_time . \" \" .\n \t\t $privacy . \" \" . $role_ids . \" \" . $tag_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $ret_events);\n}", "function getUserData($companyName){\n\t\t\t\t$date = date('Y-m-d H:i:s'); // getting the date when a user visits this page\n\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t$time_of_click = date(\"H:i:s\");\n\t\t\t\t$utility = new utility();\n\t\t\t\t$userData= $utility->getBrowser();\n\t\t\t\t$userInfo = array(\n\t\t\t\t\t\"company_name\"=> $companyName,\n\t\t\t\t\t\"browserName\" => $userData['name'],\n\t\t\t\t\t\"OS\" => $userData['platform'],\n\t\t\t\t\t\"broswerVersion\" => $userData['version'],\n\t\t\t\t\t\"date\" => $date,\n\t\t\t\t);\n\t\n\t\t\t$this->manage_content->insertTrackingValues($userInfo['company_name'],$userInfo['browserName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$userInfo['OS'],$userInfo['broswerVersion'],$userInfo['date'],$ip,$time_of_click);\t \n\t\t\t\t\n\t\n\t\t}", "public function getCalendarEvents($uid, $appName, $facebook_page_id = '') {\n $user = \\Drupal::currentUser();\n if ($appName) {\n $terms_obj = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($appName);\n $socialname = $terms_obj->getName();\n $events = array();\n $query = \\Drupal::database()->select('social_media', 'sm');\n if ($facebook_page_id) {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->condition('sm.page_id', $facebook_page_id, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n } else {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n }\n if (!empty($result)) {\n foreach ($result as $row_object) {\n $date = new DrupalDateTime(date('Y-m-d H:i:s', $row_object->scheduled_timestamp), new \\DateTimeZone('utc'));\n $date->setTimezone(new \\DateTimeZone($user->getTimeZone()));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n //$manual_datetime = $scheduled_data->manual_datetime;\n $published_date = date('Y-m-d H:i:s', $manual_datetime);\n $Onlytime = explode(\" \", $published_date);\n $formatedTime = date(\"g:i a\", strtotime($Onlytime[1]));\n $unformatedTime = date('Y-m-d H:00', $manual_datetime);\n $events[] = array('start' => $unformatedTime);\n }\n }\n }\n return $events;\n }", "function GetEventList($year=NULL, $month=NULL, $day=NULL, $forward=0, $customerid=0, $userid=0, $type = 0, $privacy = 0, $closed = '') {\n\tglobal $AUTH;\n\n\t$DB = LMSDB::getInstance();\n\n\t$t = time();\n\n\tif(!$year) $year = date('Y', $t);\n\tif(!$month) $month = date('n', $t);\n\tif(!$day) $day = date('j', $t);\n\n\tunset($t);\n\n\tswitch ($privacy) {\n\t\tcase 0:\n\t\t\t$privacy_condition = '(private = 0 OR (private = 1 AND userid = ' . intval(Auth::GetCurrentUser()) . '))';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$privacy_condition = 'private = 0';\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$privacy_condition = 'private = 1 AND userid = ' . intval(Auth::GetCurrentUser());\n\t\t\tbreak;\n\t}\n\n\t$startdate = mktime(0,0,0, $month, $day, $year);\n\t$enddate = mktime(0,0,0, $month, $day+$forward, $year);\n\n\tif(!isset($userid) && empty($userid))\n\t\t$userfilter = '';\n\telse\n\t{\n\t\tif(is_array($userid))\n\t\t{\n\t\t\t$userfilter = ' AND EXISTS ( SELECT 1 FROM eventassignments WHERE eventid = events.id AND userid IN ('.implode(',', $userid).'))';\n\t\t\tif(in_array('-1', $userid))\n\t\t\t\t$userfilter = ' AND NOT EXISTS (SELECT 1 FROM eventassignments WHERE eventid = events.id)';\n\t\t}\n\t}\n\n\t$list = $DB->GetAll(\n\t\t'SELECT events.id AS id, title, note, description, date, begintime, enddate, endtime, customerid, closed, events.type, '\n\t\t.$DB->Concat('UPPER(c.lastname)',\"' '\",'c.name').' AS customername,\n\t\tuserid, vusers.name AS username, '.$DB->Concat('c.city',\"', '\",'c.address').' AS customerlocation,\n\t\tevents.address_id, va.location, nodeid, vn.location AS nodelocation, ticketid\n\t\tFROM events\n\t\tLEFT JOIN vaddresses va ON va.id = events.address_id\n\t\tLEFT JOIN vnodes as vn ON (nodeid = vn.id)\n\t\tLEFT JOIN customerview c ON (customerid = c.id)\n\t\tLEFT JOIN vusers ON (userid = vusers.id)\n\t\tWHERE ((date >= ? AND date < ?) OR (enddate <> 0 AND date < ? AND enddate >= ?)) AND ' . $privacy_condition\n\t\t.($customerid ? ' AND customerid = '.intval($customerid) : '')\n\t\t. $userfilter\n\t\t. (!empty($type) ? ' AND events.type ' . (is_array($type) ? 'IN (' . implode(',', array_filter($type, 'intval')) . ')' : '=' . intval($type)) : '')\n\t\t. ($closed != '' ? ' AND closed = ' . intval($closed) : '')\n\t\t.' ORDER BY date, begintime',\n\t\t array($startdate, $enddate, $enddate, $startdate, Auth::GetCurrentUser()));\n\n\t$list2 = array();\n\tif ($list)\n\t\tforeach ($list as $idx => $row) {\n\t\t\t$row['userlist'] = $DB->GetAll('SELECT userid AS id, vusers.name\n\t\t\t\t\tFROM eventassignments, vusers\n\t\t\t\t\tWHERE userid = vusers.id AND eventid = ? ',\n\t\t\t\t\tarray($row['id']));\n\t\t\t$endtime = $row['endtime'];\n\t\t\tif ($row['enddate'] && $row['enddate'] - $row['date']) {\n\t\t\t\t$days = round(($row['enddate'] - $row['date']) / 86400);\n\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t$row['endtime'] = 0;\n\t\t\t\t$dst = date('I', $row['date']);\n\t\t\t\t$list2[] = $row;\n\t\t\t\twhile ($days) {\n\t\t\t\t\tif ($days == 1)\n\t\t\t\t\t\t$row['endtime'] = $endtime;\n\t\t\t\t\t$row['date'] += 86400;\n\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\tif ($newdst != $dst) {\n\t\t\t\t\t\tif ($newdst < $dst)\n\t\t\t\t\t\t\t$row['date'] += 3600;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$row['date'] -= 3600;\n\t\t\t\t\t\t$newdst = date('I', $row['date']);\n\t\t\t\t\t}\n\t\t\t\t\tlist ($year, $month, $day) = explode('/', date('Y/n/j', $row['date']));\n\t\t\t\t\t$row['date'] = mktime(0, 0, 0, $month, $day, $year);\n\t\t\t\t\t$row['enddate'] = $row['date'] + 86400;\n\t\t\t\t\tif ($days > 1 || $endtime)\n\t\t\t\t\t\t$list2[] = $row;\n\t\t\t\t\t$days--;\n\t\t\t\t\t$dst = $newdst;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$list2[] = $row;\n\t\t}\n\n\treturn $list2;\n}", "public function getEvents(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/event\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the reponse of the API\n\t\t$events = json_decode($output, true);\n\n\t\t// format the date\n\t\tforeach ($events as $key => $event) {\n\t\t\t$events[$key]['date'] = explode('T', $event['date'])[0];\n\t\t}\n\n\t\t// if the user is not connected or if he is a student, remove events which are not public\n\t\tif (!isset($_SESSION['status']) || $_SESSION['status'] == 'student'){\n\t\t\t$publicEvents = [];\n\t\t\t$eventNumber = sizeof($events);\n\t\t\tfor($i=0 ; $i < $eventNumber; $i++){\n\t\t\t\t$event = array_shift($events);\n\t\t\t\tif($event['is_public'] == 1){\n\t\t\t\t\tarray_push($publicEvents, $event);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $publicEvents;\n\t\t}\n\n\t\t// return all events\n\t\treturn $events;\n\t}", "public static function getEvents($calendars, $companyId, $employeeId, $start, $end) {\n\n $sql = \" SELECT event.id, event.name,event.start_datetime,event.end_datetime,event.color,is_all_day \"\n . \" FROM event \"\n . \" INNER JOIN calendar\t\"\n . \" ON event.calendar_id= calendar.id \"\n . \" AND calendar.company_id={$companyId} \"\n . \" AND calendar.disabled=\" . self::STATUS_ENABLE\n . \" WHERE ( \"\n . \" event.is_public=1 \"\n . \" OR event.created_employee_id={$employeeId}\t \"\n . \" OR (EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" WHERE invitation.event_id= event.id \"\n . \" AND invitation.owner_id={$employeeId} \"\n . \" AND invitation.owner_table='employee' \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" OR(EXISTS( \"\n . \" SELECT * \"\n . \" FROM invitation \"\n . \" INNER JOIN department \"\n . \" ON invitation.owner_id=department.id \"\n . \" AND invitation.owner_table='department' \"\n . \" AND department.company_id={$companyId} \"\n . \" AND department.disabled=\" . self::STATUS_ENABLE\n . \" INNER JOIN employee \"\n . \" ON department.id=employee.department_id \"\n . \" AND employee.company_id={$companyId} \"\n . \" AND employee.id={$employeeId} \"\n . \" AND employee.disabled=\" . self::STATUS_ENABLE\n . \" WHERE invitation.event_id=event.id \"\n . \" AND invitation.company_id={$companyId} \"\n . \" AND invitation.disabled=\" . self::STATUS_ENABLE\n . \" ) \"\n . \" ) \"\n . \" ) \"\n . \" AND event.end_datetime <= \" . strtotime($end . \" 23:59:59\")\n . \" AND event.start_datetime >= \" . strtotime($start . \" 00:00:00\")\n . \" AND event.company_id={$companyId} \"\n . \" AND event.disabled=\" . self::STATUS_ENABLE;\n\n if (!empty($calendars)) {\n $sql .= \" AND event.calendar_id IN (\" . implode(',', $calendars) . \") \";\n $command = \\Yii::$app->getDb()->createCommand($sql);\n return $command->queryAll();\n }\n \n return [];\n }", "public function getCompanyWithUsers();", "public function fetchExternalEvents()\n {\n $db = \\JFactory::getDbo();\n $config = $GLOBALS['com_pbbooking_data']['config'];\n\n foreach ($GLOBALS['com_pbbooking_data']['calendars'] as $cal)\n {\n if ( isset($cal->enable_google_cal) && $cal->enable_google_cal == 1 )\n {\n // This has a google cal and should get external events.\n $service = new \\Google_Service_Calendar($this->googleClient);\n\n // Get the date range\n $dtfrom = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE));\n $dtto = date_create(\"now\", new \\DateTimeZone(PBBOOKING_TIMEZONE))->modify('+ ' . $config->sync_future_events . 'months');\n\n $params = array(\n 'timeMin' => $dtfrom->format(DATE_ATOM),\n 'timeMax' => $dtto->format(DATE_ATOM),\n 'maxResults' => $config->google_max_results\n );\n\n $googleEvents = $service->events->listEvents(trim($cal->gcal_id),$params);\n\n // Now loop through the events\n\n //let's first of all the gcalids of the external events then I can unset the element to be left with an array\n //of events that USED to be in the goolge cal but aren't any more. Then I can just deleted.\n $cur_externals = $db->setQuery('select gcal_id from #__pbbooking_events where cal_id = ' . (int)$cal->id.' and externalevent = 1')->loadColumn();\n $real_externals = array();\n\n foreach ($googleEvents as $gEvent)\n {\n\n //first check to see if the event with that gcal_id exists\n $db_event = $db->setQuery('select * from #__pbbooking_events where gcal_id = \"'.$db->escape($gEvent->getId()).'\"')->loadObject();\n //if it exists check to see if it is \"owned\" by externalevent\n if ($db_event && isset($db_event->externalevent) && $db_event->externalevent == 1)\n {\n //if it is owned by externalevent then update in the database\n $db_event->summary = $gEvent->getSummary();\n $db_event->dtend = date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db_event->dtstart = date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM);\n $db->updateObject('#__pbbooking_events',$db_event,'id');\n\n $real_externals[] = $gEvent->getId();\n\n echo '<br/>External event updated succesfully';\n } \n\n //if it's not ownedby externalevent then we don't need to do anything as it's owned by pbbooking\n \n \n if (!$db_event)\n {\n //else it doesn't exist in the database so we need to create \n $new_event = array(\n 'cal_id' => $cal->id,\n 'summary' => $gEvent->getSummary(),\n 'dtend' => date_create($gEvent->getEnd()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'dtstart' => date_create($gEvent->getStart()->getDateTime(),new \\DateTimeZone(PBBOOKING_TIMEZONE))->format(DATE_ATOM),\n 'verified' => 1,\n 'externalevent' => 1,\n 'gcal_id' => $gEvent->getId()\n );\n $db->insertObject('#__pbbooking_events',new \\JObject($new_event),'id');\n\n echo '<br/>External event created succesfully';\n }\n }\n\n $stale_externals = array_diff($cur_externals,$real_externals);\n //delete stale gcal events\n foreach ($stale_externals as $rmevent) {\n $db->setQuery('delete from #__pbbooking_events where gcal_id = \"'.$db->escape($rmevent).'\"')->execute();\n echo '<br/>External event deleted succesfully';\n }\n\n }\n }\n \n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function getCalendarEvents($organizationId, $userId, $calendarId, $start, $end, $connections, $extraField);", "function getCalendarEvents() {\n$client = getClient();\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => TRUE,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n\nif (count($results->getItems()) == 0) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($results->getItems() as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n}\n}", "function GetMyClubEventsByName($atts)\n{\n\t//MyClubAPI events url\n\textract(shortcode_atts(array\n\t\t('url' => '',\n\t\t 'name' => '',\n\t\t 'amount' => '',\n\t\t ),$atts));\n\treturn getMyClubApiEventsViaGroupName($atts['url'],$atts['name'],$atts['amount']);\n}", "function getEventsExternal($args = array()) {\n\t \t$author = $dateto = $allday = '';\n\t \t$datemode = FSE_DATE_MODE_ALL;\n\t \t$state = 'publish';\n\t \t//$d = time();\n\t \t//$datefrom = mktime(0,0,0, fsCalendar::date('m', $d), fsCalendar::date('d', $d), fsCalendar::date('Y', $d));\n\t \t$datefrom = 'now';\n\t \t$categories = $orderby = $orderdir = $include = $exclude = array();\n\t \t$start = 0;\n\t \t$count = false;\n\t \t$page = 0;\n\n\t \t// Get some values from options\n\t \t$number = intval(get_option('fse_number'));\n\n\t \tforeach($args as $k => $a) {\n\t \t\tswitch($k) {\n\t \t\t\tcase 'number':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\tif ($a >= 0) {\n\t \t\t\t\t\t$number = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'start':\n\t \t\t\t\t$start = intval($a);\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'exclude':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $e) {\n\t \t\t\t\t\t$e = intval($e);\n\t \t\t\t\t\tif (!empty($e)) {\n\t \t\t\t\t\t\t$exclude[] = intval($e);\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'include':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $e) {\n\t \t\t\t\t\t$e = intval($e);\n\t \t\t\t\t\tif (!empty($e)) {\n\t \t\t\t\t\t\t$include[] = intval($e);\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'state':\n\t \t\t\t\tif (in_array($a,array('publish', 'draft')))\n\t \t\t\t\t$state = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'author':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\t$u = new WP_User($a);\n\t \t\t\t\tif (!empty($u->ID)) {\n\t \t\t\t\t\t$author = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'categories':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = explode(',', $a);\n\t \t\t\t\tforeach($a as $c) {\n\t \t\t\t\t\t$c = intval($c);\n\t \t\t\t\t\tif (!empty($c))\n\t \t\t\t\t\t$categories[] = $c;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'datefrom':\n\t \t\t\t\t$datefrom = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'allday':\n\t \t\t\t\tif (is_bool($a)) {\n\t \t\t\t\t\t$allday = $a;\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'dateto':\n\t \t\t\t\t$dateto = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'datemode':\n\t \t\t\t\t$a = intval($a);\n\t \t\t\t\tif (in_array($a, array(1,2,3)))\n\t \t\t\t\t\t$datemode = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'orderby':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = array($a);\n\t \t\t\t\t$orderby = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'orderdir':\n\t \t\t\t\tif (!is_array($a))\n\t \t\t\t\t$a = array($a);\n\t \t\t\t\t$orderdir = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'count':\n\t \t\t\t\t$count = true;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'page':\n\t \t\t\t\t$page = intval($a);\n\t \t\t\t\tbreak;\n\t \t\t}\n\t \t}\n\n\t \t// Calculate values for page\n\t \tif ($page > 0) {\n\t \t\t$start = ($page - 1) * $number;\n\t \t}\n\n\t \t$sortstring = '';\n\t \tif (count($orderby) > 0) {\n\t \t\t$dir = array('desc','asc','descending','ascending');\n\t \t\tforeach($orderby as $k => $o) {\n\t \t\t\t$o = trim(strtolower($o));\n\t \t\t\tif (in_array($o, self::$valid_fields)) {\n\t \t\t\t\tif (!empty($sortstring))\n\t \t\t\t\t$sortstring .= ', ';\n\t \t\t\t\tif (strpos($o, '.') === false)\n\t \t\t\t\t$sortstring .= 'e.';\n\t \t\t\t\t$sortstring .= $o;\n\n\t \t\t\t\tif (isset($orderdir[$k])) {\n\t \t\t\t\t\t$d = trim(strtolower($orderdir[$k]));\n\t \t\t\t\t\tif (in_array($d, $dir)) {\n\t \t\t\t\t\t\t$sortstring .= ' '.$d;\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t \tif (!empty($state))\n\t \t\t$filter['state'] = $state;\n\t \tif (!empty($author))\n\t \t\t$filter['author'] = $author;\n\t \tif (count($categories) > 0)\n\t \t\t$filter['categories'] = $categories;\n\t \tif (!empty($datefrom))\n\t \t\t$filter['datefrom'] = $datefrom;\n\t \tif (!empty($dateto))\n\t \t\t$filter['dateto'] = $dateto;\n\t \tif (count($include) > 0)\n\t \t\t$filter['id_inc'] = $include;\n\t \tif (count($exclude) > 0)\n\t \t\t$filter['id_exc'] = $exclude;\n\t \tif (is_bool($allday) == true) // Type!\n\t \t\t$filter['allday'] = $allday;\n\t \t\t\n\t \t$filter['datemode'] = $datemode;\n\n\t \tif ($count == true) {\n\t \t\treturn $this->getEvents($filter, $sortstring, 0, 0, true);\n\t \t} else {\n\t \t\t$evt = $this->getEvents($filter, $sortstring, $number, $start);\n\t \t}\n\n\n\t \tif ($evt === false) {\n\t \t\treturn false;\n\t \t}\n\t \t$ret = array();\n\t \tforeach($evt as $e) {\n\t \t\t$et = new fsEvent($e, '', false);\n\t \t\tif ($et->eventid > 0) {\n\t \t\t\t$ret[] = $et;\n\t \t\t}\n\t \t}\n\n\t \treturn $ret;\n\t }", "function get_events($start, $event_limit, $cond=array())\r\n\t{\r\n\t\t$c_filter = '';\r\n\t\tif (is_domain_user() == true) {\r\n\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t}\r\n\t\tif (valid_array($cond)) {\r\n\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t}\r\n\t\tif (is_app_user()) {\r\n\t\t\t$c_filter .= ' AND TL.created_by_id = '.intval($this->CI->entity_user_id);\r\n\t\t}\r\n\t\t$query = 'select TL.*, TLE.event_title, TLE.event_icon \r\n\t\t\t\tfrom timeline TL \r\n\t\t\t\tJOIN timeline_master_event TLE \r\n\t\t\t\twhere TL.event_origin=TLE.origin '.$c_filter.' order by TL.origin desc limit '.$start.','.$event_limit;\r\n\t\treturn $this->CI->db->query($query)->result_array();\r\n\t}", "function icalendar_get_events( $url = '', $count = 5 ) {\n\t// Find your calendar's address http://support.google.com/calendar/bin/answer.py?hl=en&answer=37103\n\t$ical = new iCalendarReader();\n\treturn $ical->get_events( $url, $count );\n}", "public function indexCompany()\n {\n return TimelineResource::collection(\n $this->user->company->timeline()\n ->with(['pictures', 'videos', 'geo', 'links'])\n ->paginate(request()->get('per_page') ?? 15)->appends(request()->all())\n );\n }", "function fetch_user_events($user_id) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$event_ids=NULL;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"SELECT event_id\n\t\t\t\tFROM user_events\n\t\t\t\tWHERE user_id=?\n\t\t\t\tORDER BY event_id\";\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->bind_param(\"i\", $user_id);\n\n\t\t$stmt->execute();\n\n\t\t/* Bind results to variables */\n\t\t$stmt->bind_result($event_id);\n\n\t\t/* fetch values */\n\t\twhile ($stmt->fetch()) {\n\t\t\t$event_ids[]=$event_id;\n\t\t}\n\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting event_id with user_id: \" . $user_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $event_ids);\n}", "function user_viewed_company_query($user_id='', $viewing_type='', $company_id=\"\",$lebel=\"\")\n\t{\n\t\t$sql = \"SELECT MAX(UVC.viewing_date) AS viewing_date,\n\t\t\t\tUVC.id, UVC.user_id, UVC.company_id, UVC.viewing_type, \n\t\t\t\tIF(CU.users_profilepic IS NULL OR CU.users_profilepic = '', 'no_company_logo.png', CU.users_profilepic)AS users_profilepic,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tC.company_name, C.company_logo,\n\t\t\t\tfnStripTags(CU.users_bio) AS users_bio, CU.users_id AS company_user_id, CU.users_bio AS full_com_desc,\n\t\t\t\t IF(CU.users_phone IS NULL OR CU.users_phone = '', 'N/A', CU.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name\n\t\t\t\tFROM hia_user_view_company AS UVC\n\t\t\t\tJOIN hia_users AS U ON( UVC.user_id = U.users_id )\n\t\t\t\tJOIN hia_company AS C ON (UVC.company_id = C.company_id)\n\t\t\t\tJOIN hia_users AS CU ON( C.company_id = CU.users_companyid AND CU.users_type = '2' AND CU.users_status != '1')\n\t\t\t\tLEFT JOIN hia_cities ON (CU.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (CU.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (CU.users_country = hia_countries.id)\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1' \n\t\t\t\tAND UVC.company_id NOT IN (SELECT company_id FROM hia_user_following_company WHERE user_id = '$user_id' AND following_type = 'user') \";\n\n\t\tif ($viewing_type != \"\") {\n\t\t\t$sql.= \" AND UVC.viewing_type = '$viewing_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UVC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\t// if ($company_id != \"\") {\n\t\t// \t$sql.= \" AND UVC.company_id = '$company_id' \";\n\t\t// }\n\n\t\tif ($company_id != \"\") {\t\t\t\n\t\t\tif($lebel == 'next'){\n\t\t\t\t$sql.= \" AND CU.users_id > '$company_id' \";\t\t\t\t\n\t\t\t}\n\t\t\tif($lebel == 'prev'){\n\t\t\t\t$sql.= \" AND CU.users_id < '$company_id' \";\t\t\t\t \n\t\t\t}\n\t\t}\n\n\t\t// if($lebel == 'next'){\n\t\t// \t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t// }\n\t\tif($lebel == 'prev'){\n\t\t\t$sql.= \" GROUP BY UVC.company_id order by UVC.company_id DESC \";\t\n\t\t}else{\n\t\t\t$sql.= \" GROUP BY UVC.company_id \";\t\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "function suggeted_company_for_user_query($user_id='', $view_status = '', $follow_status='', $next_company='',$lebel ='')\n\t{\n\t\t$sql = \"SELECT COM_MATCH.company_id, COM_MATCH.company_name, COM_MATCH.company_life_friendly, \n\t\t\t\tCOM_MATCH.company_logo, COM_MATCH.contact_person, COM_MATCH.about, COM_MATCH.address, COM_MATCH.phone, \n\t\t\t\tfnStripTags(CU.users_bio) AS users_bio, CU.users_id AS company_user_id, CU.users_bio AS full_com_desc,\n\t\t\t\tIF(CU.users_profilepic IS NULL OR CU.users_profilepic = '', 'no_company_logo.png', CU.users_profilepic)AS users_profilepic,\n\t\t\t\tIF(CU.users_phone IS NULL OR CU.users_phone = '', 'N/A', CU.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tSUM(COM_MATCH.jobfit_status) AS jobfit_status, SUM( COM_MATCH.employeefit_status ) AS employeefit_status, SUM( COM_MATCH.location_status ) AS location_status,\n\t\t\t\tSUM( COM_MATCH.industry_status ) AS industry_status, SUM( COM_MATCH.area_status ) AS area_status,\n\t\t\t\tUCV.company_id AS viewing_company_id, UCV.id AS viewing_id, UCV.viewing_date AS max_view_date\n\t\t\t\tFROM(\n\t\t\t\t\tSELECT DISTINCT COM.*, 1 AS jobfit_status, 0 AS employeefit_status, 0 AS location_status, 0 AS industry_status, 0 AS area_status\n\t\t\t\t\tFROM hia_company AS COM\n\t\t\t\t\tJOIN hia_users AS USR ON (COM.company_id = USR.users_companyid AND USR.users_type = '2' AND USR.company_type != '1')\n\t\t\t\t\tJOIN hia_type_user_rel AS TUR ON (USR.users_id = TUR.type_rel_userid AND TUR.type_rel_category IN('job_fit') )\n\t\t\t\t\tJOIN hia_users AS USR1 ON ( USR1.users_id = '$user_id')\n\t\t\t\t\tJOIN hia_type_user_rel AS TUR1 ON (USR1.users_id = TUR1.type_rel_userid AND TUR1.type_rel_category IN('job_fit') AND TUR.type_id = TUR1.type_id)\n\t\t\t\t\t\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT DISTINCT COM.*, 0 AS jobfit_status, 1 AS employeefit_status, 0 AS location_status, 0 AS industry_status, 0 AS area_status\n\t\t\t\t\tFROM hia_company AS COM\n\t\t\t\t\tJOIN hia_users AS USR ON (COM.company_id = USR.users_companyid AND USR.users_type = '2' AND USR.company_type != '1')\n\t\t\t\t\tJOIN hia_type_user_rel AS TUR ON (USR.users_id = TUR.type_rel_userid AND TUR.type_rel_category IN('employer_fit') )\n\t\t\t\t\tJOIN hia_users AS USR1 ON ( USR1.users_id = '$user_id')\n\t\t\t\t\tJOIN hia_type_user_rel AS TUR1 ON (USR1.users_id = TUR1.type_rel_userid AND TUR1.type_rel_category IN('employer_fit') AND TUR.type_id = TUR1.type_id)\n\t\t\t\t\t \n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT DISTINCT COM.*, 0 AS jobfit_status, 0 AS employeefit_status, 1 AS location_status, 0 AS industry_status, 0 AS area_status\n\t\t\t\t\tFROM hia_company AS COM\n\t\t\t\t\tJOIN hia_users AS USR ON (COM.company_id = USR.users_companyid AND USR.users_type = '2' AND USR.company_type != '1')\n\t\t\t\t\tJOIN hia_users AS USR1 ON ( USR1.users_id = '$user_id' AND USR.users_city = USR1.users_city )\n\t\t\t\t\t\n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT DISTINCT COM.*, 0 AS jobfit_status, 0 AS employeefit_status, 0 AS location_status, 1 AS industry_status, 0 AS area_status\n\t\t\t\t\tFROM hia_company AS COM\n\t\t\t\t\tJOIN hia_users AS USR ON (COM.company_id = USR.users_companyid AND USR.users_type = '2' AND USR.company_type != '1')\n\t\t\t\t\tJOIN hia_industry_user_relation AS IUR ON (USR.users_id = IUR.users_id )\n\t\t\t\t\tJOIN hia_users AS USR1 ON ( USR1.users_id = '$user_id')\n\t\t\t\t\tJOIN hia_industry_user_relation AS IUR1 ON (USR1.users_id = IUR1.users_id AND IUR.industry_id = IUR1.industry_id)\n\t\t\t\t\t \n\t\t\t\t\tUNION\n\t\t\t\t\tSELECT DISTINCT COM.*, 0 AS jobfit_status, 0 AS employeefit_status, 0 AS location_status, 0 AS industry_status, 1 AS area_status\n\t\t\t\t\tFROM hia_company AS COM\n\t\t\t\t\tJOIN hia_users AS USR ON (COM.company_id = USR.users_companyid AND USR.users_type = '2' AND USR.company_type != '1')\n\t\t\t\t\tJOIN hia_assign_industry AS IUR ON (USR.users_id = IUR.userid )\n\t\t\t\t\tJOIN hia_users AS USR1 ON ( USR1.users_id = '$user_id')\n\t\t\t\t\tJOIN hia_assign_industry AS IUR1 ON (USR1.users_id = IUR1.userid AND IUR.area_id = IUR1.area_id)\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t) COM_MATCH\n\t\t\t\t\tJOIN hia_users AS CU ON( COM_MATCH.company_id = CU.users_companyid AND CU.users_type = '2' AND CU.users_status != '1' AND CU.company_type != '1')\n\t\t\t\t\tLEFT JOIN hia_cities ON (CU.users_city = hia_cities.id)\n\t\t\t\t\tLEFT JOIN hia_states ON (CU.users_state = hia_states.id)\n\t\t\t\t\tLEFT JOIN hia_countries ON (CU.users_country = hia_countries.id)\n\t\t\t\t\tLEFT JOIN \n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT id, user_id, company_id, viewing_type, MAX(viewing_date) AS viewing_date \n\t\t\t\t\t\tFROM hia_user_view_company WHERE user_id = '$user_id' AND viewing_type = 'user'\n\t\t\t\t\t\tGROUP BY company_id\n\t\t\t\t\t\t\n\t\t\t\t\t) UCV ON ( COM_MATCH.company_id = UCV.company_id )\n\t\t\t\tWHERE COM_MATCH.company_id NOT IN (SELECT company_id FROM hia_user_following_company WHERE user_id = '$user_id' AND following_type = 'user') \t\n\t\t\t\t\n\t\t\t\" ;\n\n\t\tif ($view_status == \"NO\") {\n\t\t\t$sql.= \" AND COM_MATCH.company_id NOT IN (SELECT company_id FROM hia_user_view_company WHERE user_id = '$user_id' AND viewing_type = 'user') \";\n\t\t}\n\t\tif ($next_company != \"\") {\n\t\t\t\n\t\t\tif($lebel == 'next'){\n\t\t\t\t$sql.= \" AND CU.users_id > '$next_company' \";\n\t\t\t}\n\t\t\tif($lebel == 'prev'){\n\t\t\t\t$sql.= \" AND CU.users_id < '$next_company' \";\n\t\t\t}\n\t\t}\n\n\t\t// if($lebel == 'next'){\n\t\t// \t$sql.=\" GROUP BY COM_MATCH.company_id \";\n\t\t// }\n\t\tif($lebel == 'prev'){\n\t\t\t$sql.=\" GROUP BY COM_MATCH.company_id order by COM_MATCH.company_id DESC \";\n\t\t}else{\n\t\t\t$sql.=\" GROUP BY COM_MATCH.company_id \";\n\t\t}\n\n\n\t\t//echo $sql;exit;\t\t\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "function user_viewed_by_company_query($company_id='', $viewing_type='', $user_id=\"\", $current_user_id=\"\", $short_type='')\n\t{\n\t\t$sql = \"SELECT MAX(UVC.viewing_date) AS viewing_date, UVC.user_id AS next_user_id,\n\t\t\t\tUVC.id, UVC.user_id, UVC.company_id, UVC.viewing_type, \n\t\t\t\tU.users_firstname, U.users_lastname, IF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'admin-no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\t SUBSTRING_INDEX(U.users_bio, ' ', 4) AS users_bio,\n\t\t\t\t IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUFC.id AS following_id\n\t\t\t\tFROM hia_user_view_company AS UVC\n\t\t\t\tJOIN hia_users AS U ON( UVC.user_id = U.users_id )\n\t\t\t\t\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN hia_user_following_company AS UFC ON(U.users_id = UFC.user_id AND UFC.company_id = '$company_id' AND UFC.following_type = 'user' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1' \n\t\t\t\tAND UVC.user_id NOT IN (SELECT user_id FROM hia_user_following_company WHERE company_id = '$company_id' AND following_type = 'company') \";\n\n\t\tif ($viewing_type != \"\") {\n\t\t\t$sql.= \" AND UVC.viewing_type = '$viewing_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UVC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UVC.company_id = '$company_id' \";\n\t\t}\n\n\t\tif ($current_user_id != \"\" && $short_type=='next') {\n\t\t\t$sql.= \" AND UVC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type=='prev') {\n\t\t\t$sql.= \" AND UVC.user_id < '$current_user_id' \";\n\t\t}\n\n\t\t$sql.= \" GROUP BY UVC.user_id \";\t\n\n\t\t//echo $sql;\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UVC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UVC.user_id ASC \";\n\t\t}\n\n\n\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "function culturefeed_ui_page_top_events_json() {\n\n $sort = variable_get('culturefeed_ui_block_top_events_sort', CultureFeed::TOP_EVENTS_SORT_ACTIVE);\n\n try {\n $events = DrupalCultureFeed::getTopEvents($sort, CULTUREFEED_UI_BLOCK_TOP_EVENTS_COUNT);\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_ui', $e);\n return;\n }\n\n $items = array();\n\n $events_info = culturefeed_get_nodes_for_cdbids('event', $events);\n\n // Search what top events are liked.\n $user_likes = array();\n $user_goes = array();\n if (DrupalCultureFeed::isCultureFeedUser()) {\n try {\n\n $query = new CultureFeed_SearchActivitiesQuery();\n $query->type = array(CultureFeed_Activity::TYPE_LIKE, CultureFeed_Activity::TYPE_IK_GA,);\n $query->nodeId = $events;\n $query->contentType = CultureFeed_Activity::CONTENT_TYPE_EVENT;\n $query->userId = DrupalCultureFeed::getLoggedInUserId();\n $query->private = TRUE;\n\n $activities = DrupalCultureFeed::searchActivities($query);\n\n foreach ($activities->objects as $activity) {\n if ($activity->type == CultureFeed_Activity::TYPE_LIKE) {\n $user_likes[$activity->nodeId] = TRUE;\n }\n else {\n $user_goes[$activity->nodeId] = TRUE;\n }\n }\n\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_ui', $e);\n }\n }\n\n $items = array();\n\n foreach ($events as $cdbid) {\n\n if (!isset($events_info[$cdbid])) {\n continue;\n }\n\n $event = $events_info[$cdbid];\n\n $anonymous = '';\n $disable = array();\n if (user_is_anonymous()) {\n $url = 'culturefeed/do/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid;\n $anonymous = theme('culturefeed_ui_connect_hover', array('url' => $url));\n $disable = array('disable');\n }\n\n if (!isset($user_likes[$cdbid])) {\n\n $positive = array(\n '#type' => 'link',\n '#id' => 'top-like-'. $cdbid,\n '#title' => 'Vind ik leuk',\n '#href' => 'culturefeed/do/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid . '/noredirect',\n '#attributes' => array('class' => array_merge(array('like-link'), $disable)),\n '#options' => array('query' => drupal_get_destination()),\n '#ajax' => array(\n 'wrapper' => 'rate-' . $cdbid,\n ),\n );\n\n $link = render($positive) . $anonymous;\n }\n else {\n\n $negative = array(\n '#type' => 'link',\n '#id' => 'top-like-'. $cdbid,\n '#title' => 'Niet meer',\n '#href' => 'culturefeed/undo/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid . '/noredirect',\n '#attributes' => array('class' => array('unlike-link'), 'title' => 'Vind ik niet meer leuk'),\n '#ajax' => array(\n 'wrapper' => 'rate-' . $cdbid,\n ),\n );\n\n $link = render($negative);\n }\n\n $items[] = theme('culturefeed_ui_top_event', array('event' => $event, 'rate_link' => $link));\n\n }\n\n $content = array();\n if (!empty($items)) {\n $content = array(\n '#theme' => 'item_list',\n '#items' => $items,\n '#type' => 'ol',\n '#attributes' => array('class' => 'event-teaser-list'),\n );\n }\n\n $commands = array();\n\n $data = drupal_render($content);\n $commands[] = ajax_command_html('#top-events', $data);\n\n ajax_deliver(array('#type' => 'ajax', '#commands' => $commands));\n\n}", "public function getUserEvents() {\n\t\tif(!$data = $this->getNikePlusFile('http://nikerunning.nike.com/nikeplus/v2/services/userevent/get_user_events.jsp?_plus=true')) {\n\t\t\tthrow new Exception($this->feedErrorMessage);\n\t\t}\n\t\treturn $data;\n\t}", "function get_user_serv_history ($db, $user){\n $query = \"SELECT Appointments.service_id, Appointments.appt_time, Appointments.cust_comments, Services.serv_description FROM Appointments\n INNER JOIN Services ON Services.service_id=Appointments.service_id\n WHERE (Appointments.cust_email='$user')\n ORDER BY Appointments.appt_time\";\n $statement = $db->prepare($query);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n return $result;\n}", "public function getCompanyEmployees();", "public function companyInfo()\n {\n $this->startBrokerSession();\n $user = null;\n\n// $userId = $this->getSessionData('sso_user');\n $companyId = $this->getSessionData('sso_company');\n\n if ($companyId) {\n $company = $this->getCompanyInfo($companyId);\n if (!$company) return $this->fail(\"company not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($company);\n }", "function findCompanyWebsite($company_name) \n {\n \n }", "final public function getParticipants() {\n\n\t\t// all events\n\t\t$search = new MetaSearch($config);\n\t\t$search->setWebNameFilter('Main');\n\t\t$search->setFormNameFilter('EventForm');\n\t\t$search->executeQuery();\n\n\t\t$this->config->pushStrictMode(false);\n\t\tforeach($search->getResults() as $eventTopicName) {\n\t\t\t$topic = $this->topicFactory->loadTopicByName($eventTopicName);\n\t\t\t$event = new CiantEvent($topic);\n\n\t\t\t$collaborators = $event->getCollaborators();\n\t\t}\n\t\t$this->config->popStrictMode();\n\n//\t\t$list = array();\n//\t\tforeach($search->getResults() as $topicName) {\n//\t\t\t$topic = $db->loadTopicByName($topicName);\n//\t\t\t$event = new CiantEvent($topic);\n//\t\t\t$collab = $event->getCollaborators();\n//\t\t\tforeach($collab as $user) {\n//\t\t\t\tif($user instanceof CiantUser) {\n//\t\t\t\t\t$list[spl_object_hash($user)] = $user;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\tforeach($list as $idx => $user) {\n//\t\t\tassert($user instanceof CiantUser);\n//\t\t\techo $user->getName().\", \";\n//\t\t}\n\t}", "public function get_events($args = [])\n {\n global $db, $system;\n /* initialize arguments */\n $user_id = !isset($args['user_id']) ? null : $args['user_id'];\n $offset = !isset($args['offset']) ? 0 : $args['offset'];\n $get_all = !isset($args['get_all']) ? false : true;\n $suggested = !isset($args['suggested']) ? false : true;\n $random = !isset($args['random']) ? false : true;\n $managed = !isset($args['managed']) ? false : true;\n $filter = !isset($args['filter']) ? \"admin\" : $args['filter'];\n $results = !isset($args['results']) ? $system['max_results_even'] : $args['results'];\n /* initialize vars */\n $events = [];\n $offset *= $results;\n /* get suggested events */\n if ($suggested) {\n $where_statement = \"\";\n /* make a list from joined events */\n $events_ids = $this->get_events_ids();\n if ($events_ids) {\n $events_list = implode(',', $events_ids);\n $where_statement .= \"AND event_id NOT IN (\" . $events_list . \") \";\n }\n $sort_statement = ($random) ? \" ORDER BY RAND() \" : \" ORDER BY event_id DESC \";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(\"SELECT * FROM `events` WHERE event_privacy != 'secret' \" . $where_statement . $sort_statement . $limit_statement) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"taget\" all events who admin */\n } elseif ($managed) {\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"viewer\" events who (going|interested|invited|admin) */\n } elseif ($user_id == null) {\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n switch ($filter) {\n case 'going':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_going = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'interested':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_interested = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'invited':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_invited = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n default:\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n /* get the \"target\" events */\n } else {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_events FROM users WHERE user_id = %s\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_events'], $user_id)) {\n return $events;\n }\n /* if the viewer not the target exclude secret groups */\n $where_statement = ($this->_data['user_id'] == $user_id) ? \"\" : \"AND `events`.event_privacy != 'secret'\";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE (events_members.is_going = '1' OR events_members.is_interested = '1') AND events_members.user_id = %s \" . $where_statement . \" ORDER BY event_id DESC \" . $limit_statement, secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_events->num_rows > 0) {\n while ($event = $get_events->fetch_assoc()) {\n $event['event_picture'] = get_picture($event['event_cover'], 'event');\n /* check if the viewer joined the event */\n $event['i_joined'] = $this->check_event_membership($this->_data['user_id'], $event['event_id']);;\n $events[] = $event;\n }\n }\n return $events;\n }" ]
[ "0.58884996", "0.5864408", "0.5729649", "0.5683063", "0.5665857", "0.55873835", "0.5560339", "0.55186605", "0.5514727", "0.55022305", "0.5478791", "0.5450705", "0.5442758", "0.542622", "0.5418258", "0.5413679", "0.5412229", "0.5382358", "0.5369456", "0.53636694", "0.5359975", "0.53544974", "0.53432125", "0.5330089", "0.52811974", "0.52761906", "0.5264351", "0.5251981", "0.5210382", "0.51314414" ]
0.8137219
0
Function to fetch a company's follower list May 13,2016
function getCompanyFollowers() { //the defaults starts global $myStaticVars; extract($myStaticVars); // make static vars local $member_default_avatar = $member_default_avatar; $member_default_cover = $member_default_cover; $member_default = $member_default; $company_default_cover = $company_default_cover; $company_default_avatar = $company_default_avatar; $events_default = $events_default; $event_default_poster = $event_default_poster; //the defaults ends $companyUserName=validate_input($_GET['company']); $companyid=getCompanyIdfromCompanyUserName($companyUserName); $session_values=get_user_session(); $my_session_id = $session_values['id']; $data= array(); $data=fetch_company_information_from_companyid($companyid); if($my_session_id) { $data['followed']= doIFollowThisCompany($my_session_id,$companyid); } $data['followersObjects'] = getThisCompanyfollowerObjects($companyid); return $data; /* data = { "id": 1, "companyUserName": "nbbit", "profilePhoto": "company01.jpg", "coverPhoto": "memberCover01.jpg", "name": "Pet Studio.com", "location": "Fort Legend Tower", "followed": true, "followers": "1", "following": "1", "followersObjects": [ { "id": 1, "username": "jordan", "avatar": "member01.jpg", "coverPhoto": "memberCover01.jpg", "firstName": "Jordan", "lastName": "Rains", "position": "Office Assistant", "company": [{ "companyName": "Pet Studio.com", "companyDesc": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }] } ] }; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFollowers(){\n\n\t}", "function getFollowers()\n{\n global $channel;\n // Get list of followers\n // Make API Call\n $ch = curl_init();\n curl_setopt_array($ch, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://api.twitch.tv/kraken/channels/' . $channel . '/follows',\n CURLOPT_HTTPHEADER => array('Accept: application/vnd.twitchtv.v3+json')\n ));\n $resp = curl_exec($ch);\n if(!curl_exec($ch)){\n die('Error: \"' . curl_error($ch) . '\" - Code: ' . curl_errno($ch));\n } else {\n $json = json_decode($resp, true);\n }\n curl_close($ch);\n \n return $json;\n}", "public function getOwnerFollowedBy()\n {\n return $this->http->get('/users/%s/followed-by', 'self');\n }", "public function getOwnerFollows()\n {\n return $this->http->get('/users/%s/follows', 'self');\n }", "public function getUserFollowers($userId);", "public function twitterFollowersList(array $args = array()) {\n\n $app = $this->getContainer();\n\n // Get values from config\n $extensionConfig = $this->getConfig();\n $config = $app['config']->get('general');\n\n // Set our request method\n $requestMethod = 'GET';\n\n // Create our API URL\n $baseUrl = \"https://api.twitter.com/1.1/followers/list.json\";\n $fullUrl = $this->constructFullUrl($baseUrl, $args);\n\n // Setup our Oauth values array with values as per docs\n $oauth = $this->setOauthValues($requestMethod, $baseUrl, $args);\n\n // Create header string to set in our request\n $header = array($this->buildHeaderString($oauth));\n\n $key = 'followerslist-'.md5($fullUrl);\n if ($app['cache']->contains($key) && $extensionConfig['cache_time'] > 0) {\n // If this request has been cached and setting is not disabling cache, then retrieve it\n $result = $app['cache']->fetch($key);\n } else {\n // If not in cache then send our request to the Twitter API with appropriate Authorization header as per docs\n try {\n $result = $app['guzzle.client']->get($fullUrl, ['headers' => ['Authorization' => $header]])->getBody(true);\n } catch(\\Exception $e) {\n return ['error' => $e->getMessage()];\n }\n // Decode the JSON that is returned\n $result = json_decode($result, true);\n $app['cache']->save($key, $result, $extensionConfig['cache_time']);\n }\n\n return $result;\n }", "public function getFollowers()\n {\n return $this->followers;\n }", "public function getFollowUpInfoList() {\n return $this->_get(3);\n }", "function getMemberFollowers()\n{\n\t\n //the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\n\t$userName=validate_input($_GET['user']);\n\t$clientid=getUserIdfromUserName($userName);\t\n\t\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t\n\t$data= array();\t\n\t\n\t$data\t\t\t\t\t\t\t\t\t= fetch_user_information_from_id($clientid);\n\tif($my_session_id)\n\t{\n\t\t$data['followed']\t\t\t\t= doIFollowThisUser($my_session_id,$clientid);\n\t}\n\t\n\t$data['followersObjects']\t\t= getThisUserfollowerObjects($clientid);\n\t\n\treturn $data;\n\n}", "public function followers($options = []);", "public static function getFollowers() {\n $db = Db::instance();\n $q = \"SELECT * FROM `\".self::DB_TABLE.\"`\";\n $result = $db->query($q);\n\n $followers = array();\n if($result->num_rows != 0) {\n while($row = $result->fetch_assoc()) {\n $followers[] = self::getFollower($row['id']);\n }\n }\n return $followers;\n }", "public function follower()\n {\n return $this->belongsTo(CommunityFacade::getUserClass(), 'follower_account_id');\n }", "public function follower(Request $request)\n {\n /*\n * --------------------------------------------------------------------------\n * Populating account followers\n * --------------------------------------------------------------------------\n * Retrieve followers 10 data per request, because we implement lazy\n * pagination via ajax so return json data when 'page' variable exist, and\n * return view if doesn't.\n */\n\n $contributor = new Contributor();\n\n $followers = $contributor->contributorFollower(Auth::user()->username);\n\n if (Input::get('page', false) && $request->ajax()) {\n return $followers;\n } else {\n return view('contributor.follower', compact('followers'));\n }\n }", "function get_followers_tuples()\n {\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name\n FROM friend_relationships LEFT JOIN user_meta ON friend_relationships.user_id = user_meta.user_id\n WHERE friend_relationships.follow_id = ? ORDER BY user_meta.last_name ASC\";\n $query = $this->db->query($query_string, array($this->ion_auth->get_user()->id));\n\n $return_array = array();\n foreach ($query->result() as $row)\n {\n $return_array[] = array('id' => $row->user_id, 'name' => $row->first_name . ' ' . $row->last_name);\n }\n\n return $return_array;\n }", "function new_followers_count_query($company_id='')\n\t{\n\t\t$sql = \"SELECT COUNT(FC.user_id) AS no_of_users\n\t\t\t\tFROM hia_user_following_company AS FC\n\t\t\t\tLEFT JOIN hia_user_view_company AS VC ON (FC.user_id = VC.user_id AND VC.company_id = '$company_id' AND VC.viewing_type='company' )\n\t\t\t\tWHERE FC.company_id = '$company_id' AND FC.following_type = 'user'\n\t\t\t\tAND VC.id IS NULL \" ;\n\n\t\t//echo $sql;\t\t\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function getFollowerList(Request $request)\n { \n $input = $request->input();\n\n $validator = Validator::make($input, [\n 'businessId' => 'required|integer',\n 'index' => 'required',\n 'limit' => 'required',\n ]);\n\n if ($validator->fails()) {\n return response()->json(['status' => 'exception','response' => $validator->errors()->first()]); \n }\n\n $userIds = BusinessFollower::whereBusinessId($input['businessId'])->pluck('user_id');\n $response = User::select('first_name', 'middle_name', 'last_name', 'email', 'image')->whereIn('id', $userIds)->skip($input['index'])->take($input['limit'])->get();\n\n if (count($response) > 0) {\n return response()->json(['status' => 'success','response' => $response]); \n } else {\n return response()->json(['status' => 'exception','response' => 'No follower found.']); \n } \n }", "function followerIds($settings, $user_id)\r\n{\r\n$url = \"https://api.twitter.com/1.1/followers/ids.json\";\r\n$requestMethod = \"GET\";\r\n$getfield = \"?user_id=\" . $user_id;\r\n$twitter = new TwitterAPIExchange($settings);\r\n$string = json_decode($twitter->setGetfield($getfield)\r\n ->buildOauth($url, $requestMethod)\r\n ->performRequest(),$assoc = TRUE);\r\nif($string[\"errors\"][0][\"message\"] != \"\") {echo \"<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>\".$string[errors][0][\"message\"].\"</em></p>\";exit();}\r\necho \"<h1><u>Followers IDS for the Tweet ID \" . $user_id . \"</u></h1>\";\r\necho \"<br>\";\r\n$i = 0;\r\nforeach($string[\"ids\"] as $items)\r\n{\r\n$i++;\r\necho \"ID: \". $items. \"<br />\";\r\necho \"<br>\";\r\n}\r\n}", "private function updateFollowers()\r\n {\r\n $fields = $this->getDefinition()->getfields();\r\n\r\n foreach ($fields as $field)\r\n {\r\n switch ($field->type)\r\n {\r\n case 'text':\r\n // Check if any text fields are tagging users\r\n $tagged = self::getTaggedObjRef($this->getValue($field->name));\r\n foreach ($tagged as $objRef)\r\n {\r\n\t\t\t\t\t// We need to have a valid uid, before we add it as follower\r\n\t\t\t\t\tif ($objRef['obj_type'] === 'user' && $objRef['id'] &&\r\n\t\t\t\t\t\tis_numeric($objRef['id']) && $objRef['id'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->addMultiValue(\"followers\", $objRef['id'], $objRef['name']);\r\n\t\t\t\t\t}\r\n }\r\n break;\r\n\r\n case 'object':\r\n case 'object_multi':\r\n // Check if any fields are referencing users\r\n if ($field->subtype === \"user\")\r\n {\r\n $value = $this->getValue($field->name);\r\n\r\n if (is_array($value))\r\n {\r\n foreach ($value as $entityId)\r\n {\r\n if (is_numeric($entityId) && $entityId > 0)\r\n {\r\n $this->addMultiValue(\r\n \"followers\",\r\n $entityId,\r\n $this->getValueName($field->name, $entityId)\r\n );\r\n }\r\n }\r\n }\r\n else if (is_numeric($value) && $value > 0)\r\n {\r\n $this->addMultiValue(\r\n \"followers\",\r\n $value,\r\n $this->getValueName($field->name, $value)\r\n );\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }", "public static function followers ( $list = false ) {\n\n\t\tstatic::api()->request('GET', static::api()->url('1.1/followers/ids'), array(\n\t\t\t'screen_name' => static::$screen_name\n\t\t));\n\n\t\t$response = static::api()->response['response'];\n\t\t$code = static::api()->response['code'];\n\n\t\tif ($code === 200) {\n\t\t\t$response = json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n\t\t\tif ($list === TRUE) {\n\t\t\t\treturn static::users($response->ids);\n\t\t\t} else {\n\t\t\t\treturn count($response->ids);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function getFollowers()\n {\n $data = [];\n \n foreach(Users::find(authApi()->user()->id)->followers()->get() as $user){\n $user->profile_pic = getImage($user->profile_pic);\n \n $user['isFollowed'] = authApi()->user() ? \n Follow::where('followed_id', $user->id)->where('user_id', authApi()->user()->id)->first() \n ? true : false : false;\n $data[] = $user;\n }\n \n $json['data']['followers'] = $data;\n\n return response()->json($json, 200);\n }", "public function followers()\n {\n return $this->hasMany(Models\\AccountFollower::class, 'account_id');\n }", "public function get_user_followers($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n $filter = $filters['filter'];\n \n //Most Recent\n $active_filter = \" ORDER BY created_at DESC, u.first_name, u.last_name\";\n if($filter == 1) {\n //Alphabetical\n $active_filter = \" ORDER BY u.first_name, u.last_name\";\n } else if($filter == 2) {\n //By number of followers\n $active_filter = \" ORDER BY followers DESC, u.first_name, u.last_name\";\n } else if($filter == 3) {\n //By number of mutual friends\n $active_filter = \" ORDER BY mutual_friends DESC, u.first_name, u.last_name\";\n } else if($filter == 4) {\n //By number of similar interests\n $active_filter = \" ORDER BY similar_interest DESC, u.first_name, u.last_name\";\n }\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NOT NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n coalesce(mf.mutualfriends,0) as mutual_friends,\n coalesce(ms.mutualstrings,0) as similar_interest,\n uq.created_at\n FROM useracquiantances uq\n JOIN users u ON u.id = uq.user_one_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uq.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uq.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uq.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uq.user_two_id\n LEFT OUTER JOIN (select uf5.user_one_id,\n COUNT(*) mutualfriends\n FROM userfriends uf5\n WHERE uf5.status=1 AND\n uf5.user_two_id IN (SELECT uf6.user_two_id\n FROM userfriends uf6\n WHERE uf6.user_one_id={$active_login_userid} AND status=1)\n GROUP BY uf5.user_one_id) as mf ON mf.user_one_id = u.id\n LEFT OUTER JOIN (select tr.user_id,\n COUNT(*) mutualstrings\n FROM topictrack tr\n LEFT JOIN topic t ON t.id = tr.topic_id\n WHERE t.deleted_at IS NULL AND tr.mask=0 AND\n tr.topic_id IN (SELECT tr2.topic_id \n FROM topictrack tr2\n LEFT JOIN topic t2 ON tr2.topic_id = t2.id\n WHERE tr2.user_id={$active_login_userid} \n AND t.deleted_at IS NULL \n AND tr.mask=0)\n GROUP BY tr.user_id) as ms ON ms.user_id = u.id\n WHERE (uq.user_two_id={$owner_profile_userid} AND uq.status=1)\n {$active_filter}\n LIMIT {$limit}\";\n \n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function getFollowers()\n {\n $savedFollowers = $this->getSavedFollowers();\n \n if ($latestFollowers = $this->getUpdatedFollowers()) {\n $this->saveUnfollowers($savedFollowers, $latestFollowers);\n return $latestFollowers;\n }\n \n return $savedFollowers;\n }", "public function following()\n {\n \t$following = DB::table('followers')\n \t\t->left_join('users', 'users.id', '=', 'followers.following_id')\n \t\t->where('followers.follower_id', '=', $this->id)\n \t\t->where(\"followers.isCurrent\", \"=\", 1)\n \t\t->get();\n \treturn $following;\n }", "public function getFollowedByList($perPage = null)\n {\n return $this->getOrPaginateFollowedBy($this->getFollowedByQueryBuilder(), $perPage);\n }", "public function followers() {\n return $this->belongsToMany(User::class);\n }", "public function nextFollowersAction()\n {\n // check if request is Ajax\n if (Helper::isAjaxRequest()) {\n // get request\n $code = Helper::requestGet('code', null);\n $userName = Helper::requestGet('userName', null);\n\n // get followers next url\n $url = $this->getFollowersNextUrlByCode($code);\n\n if ($url) {\n // get next followers content\n $media = file_get_contents($url);\n\n $media = json_decode($media);\n\n // check for error\n $this->hasError($media);\n\n if (!json_last_error() && $media->meta->code == self::SUCCESS_RESPONSE && !empty($media->data)) {\n $hasNextUrl = false;\n\n if (isset($media->pagination->next_url)) {\n $hasNextUrl = true;\n\n $this->setFollowersNextUrlByCode($code, $media->pagination->next_url);\n }\n\n $media = $media->data;\n\n $options = [\n 'c' => Config::get('defaultController'),\n 'a_next' => 'nextFollowers',\n 'code' => $code,\n 'userName' => $userName,\n 'hasNextUrl' => $hasNextUrl,\n ];\n\n Helper::renderStatic('main/_followersList', compact('media','hasNextUrl','options'), false);\n\n exit;\n }\n }\n }\n }", "function showFollowers($userid){\n $res = $this->db->get_where(\"following\", array('follower_id' => $userid));\n $followerFound = array();\n foreach($res->result() as $row){\n $followerFound[] = new Follower($row->user_id,$row->follower_id,$row->user_name,$row->follower_name);\n }\n return $followerFound;\n }", "function company_following_user_query( $company_id=\"\", $following_type='', $user_id, $current_user_id=\"\", $short_type='' )\n\t{\n\t\t//echo $current_user_id.\"<br>\";\n\t\t$sql = \"SELECT UFC.id, UFC.user_id, UFC.company_id, UFC.following_date, UFC.following_type, UFC.user_id AS next_user_id,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tIF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\tfnStripTags(U.users_bio) AS users_bio, IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, U.users_current_employer,U.users_current_title,\n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUCV.company_id AS viewing_company_id, UCV.id AS viewing_id, UCV.viewing_date AS max_view_date\n\t\t\t\tFROM hia_user_following_company AS UFC\n\t\t\t\tJOIN hia_users AS U ON( UFC.user_id = U.users_id )\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN \n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT id, user_id, company_id, viewing_type, MAX(viewing_date) AS viewing_date \n\t\t\t\t\t\tFROM hia_user_view_company WHERE company_id = '$company_id' AND viewing_type = 'company'\n\t\t\t\t\t\tGROUP BY user_id\n\t\t\t\t\t\t\n\t\t\t\t\t) UCV ON (U.users_id = UCV.user_id AND UCV.company_id = '$company_id' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1'\n\t\t\t\tAND U.company_type != '1' \";\n\n\t\tif ($following_type != \"\") {\n\t\t\t$sql.= \" AND UFC.following_type = '$following_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UFC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UFC.company_id = '$company_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='next') {\n\t\t\t$sql.= \" AND UFC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='prev') {\n\t\t\t$sql.= \" AND UFC.user_id < '$current_user_id' \";\n\t\t}\n\t\t\n\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UFC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UFC.user_id ASC \";\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function followers()\n {\n return $this->belongsToMany(User::class, 'followers', 'follower_id', 'user_id')->withTimestamps();\n }" ]
[ "0.7318261", "0.66867286", "0.65964127", "0.65099967", "0.64146245", "0.6409975", "0.63672197", "0.6352361", "0.6206488", "0.61753994", "0.6169993", "0.6110213", "0.61028624", "0.6060269", "0.60569423", "0.60475904", "0.59910464", "0.59776086", "0.59770566", "0.5962655", "0.59506476", "0.59344935", "0.5911598", "0.5873402", "0.5870675", "0.58690244", "0.58626044", "0.58484685", "0.5844691", "0.5839085" ]
0.69413173
1
Function to fetch a member's follower list May 13,2016
function getMemberFollowers() { //the defaults starts global $myStaticVars; extract($myStaticVars); // make static vars local $member_default_avatar = $member_default_avatar; $member_default_cover = $member_default_cover; $member_default = $member_default; $company_default_cover = $company_default_cover; $company_default_avatar = $company_default_avatar; $events_default = $events_default; $event_default_poster = $event_default_poster; //the defaults ends $userName=validate_input($_GET['user']); $clientid=getUserIdfromUserName($userName); $session_values=get_user_session(); $my_session_id = $session_values['id']; $data= array(); $data = fetch_user_information_from_id($clientid); if($my_session_id) { $data['followed'] = doIFollowThisUser($my_session_id,$clientid); } $data['followersObjects'] = getThisUserfollowerObjects($clientid); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFollowers(){\n\n\t}", "public function getFollowers()\n {\n return $this->followers;\n }", "public function getFollowUpInfoList() {\n return $this->_get(3);\n }", "public function getOwnerFollowedBy()\n {\n return $this->http->get('/users/%s/followed-by', 'self');\n }", "public function getUserFollowers($userId);", "function getFollowers()\n{\n global $channel;\n // Get list of followers\n // Make API Call\n $ch = curl_init();\n curl_setopt_array($ch, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://api.twitch.tv/kraken/channels/' . $channel . '/follows',\n CURLOPT_HTTPHEADER => array('Accept: application/vnd.twitchtv.v3+json')\n ));\n $resp = curl_exec($ch);\n if(!curl_exec($ch)){\n die('Error: \"' . curl_error($ch) . '\" - Code: ' . curl_errno($ch));\n } else {\n $json = json_decode($resp, true);\n }\n curl_close($ch);\n \n return $json;\n}", "function get_followers_tuples()\n {\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name\n FROM friend_relationships LEFT JOIN user_meta ON friend_relationships.user_id = user_meta.user_id\n WHERE friend_relationships.follow_id = ? ORDER BY user_meta.last_name ASC\";\n $query = $this->db->query($query_string, array($this->ion_auth->get_user()->id));\n\n $return_array = array();\n foreach ($query->result() as $row)\n {\n $return_array[] = array('id' => $row->user_id, 'name' => $row->first_name . ' ' . $row->last_name);\n }\n\n return $return_array;\n }", "public function twitterFollowersList(array $args = array()) {\n\n $app = $this->getContainer();\n\n // Get values from config\n $extensionConfig = $this->getConfig();\n $config = $app['config']->get('general');\n\n // Set our request method\n $requestMethod = 'GET';\n\n // Create our API URL\n $baseUrl = \"https://api.twitter.com/1.1/followers/list.json\";\n $fullUrl = $this->constructFullUrl($baseUrl, $args);\n\n // Setup our Oauth values array with values as per docs\n $oauth = $this->setOauthValues($requestMethod, $baseUrl, $args);\n\n // Create header string to set in our request\n $header = array($this->buildHeaderString($oauth));\n\n $key = 'followerslist-'.md5($fullUrl);\n if ($app['cache']->contains($key) && $extensionConfig['cache_time'] > 0) {\n // If this request has been cached and setting is not disabling cache, then retrieve it\n $result = $app['cache']->fetch($key);\n } else {\n // If not in cache then send our request to the Twitter API with appropriate Authorization header as per docs\n try {\n $result = $app['guzzle.client']->get($fullUrl, ['headers' => ['Authorization' => $header]])->getBody(true);\n } catch(\\Exception $e) {\n return ['error' => $e->getMessage()];\n }\n // Decode the JSON that is returned\n $result = json_decode($result, true);\n $app['cache']->save($key, $result, $extensionConfig['cache_time']);\n }\n\n return $result;\n }", "public function getOwnerFollows()\n {\n return $this->http->get('/users/%s/follows', 'self');\n }", "function getMemberFollowing()\n{\n\t\n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\n\t$userName=validate_input($_GET['user']);\n\t$clientid=getUserIdfromUserName($userName);\t\n\t\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t\n\t$data= array();\t\n\t\n\t$data\t\t\t\t\t\t\t\t\t= fetch_user_information_from_id($clientid);\n\tif($my_session_id)\n\t{\n\t\t$data['followed']\t\t\t\t= doIFollowThisUser($my_session_id,$clientid);\n\t}\n\t\n\t$data['followingObjects']\t\t= getThisUserfollowingObjects($clientid);\n\t\n\treturn $data;\t\t\n\n\t\t/*\n\t\tdata = {\n\t\t\t\"id\": 1,\n\t\t\t\"userName\": \"jordan\",\n\t\t\t\"avatar\": \"member01.jpg\",\n\t\t\t\"coverPhoto\": \"memberCover01.jpg\",\n\t\t\t\"firstName\": \"Jordan\",\n\t\t\t\"lastName\": \"Rains\",\n\t\t\t\"position\": \"Office Assistant\",\n\t\t\t\"company\": [\n\t\t\t\t{\n\t\t\t\t\t\"companyName\": \"Pet Studio.com\",\n\t\t\t\t\t\"companyDesc\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"followed\": true,\n\t\t\t\"followers\": \"1\",\n\t\t\t\"following\": \"1\",\n\t\t\t\"followingObjects\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"username\": \"jordan\",\n\t\t\t\t\t\"avatar\": \"member01.jpg\",\n\t\t\t\t\t\"coverPhoto\": \"memberCover01.jpg\",\n\t\t\t\t\t\"firstName\": \"Jordan\",\n\t\t\t\t\t\"lastName\": \"Rains\",\n\t\t\t\t\t\"position\": \"Office Assistant\",\n\t\t\t\t\t\"company\": [{\n\t\t\t\t\t\t\"companyName\": \"Pet Studio.com\",\n\t\t\t\t\t\t\"companyDesc\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t */\n\n}", "public static function getFollowers() {\n $db = Db::instance();\n $q = \"SELECT * FROM `\".self::DB_TABLE.\"`\";\n $result = $db->query($q);\n\n $followers = array();\n if($result->num_rows != 0) {\n while($row = $result->fetch_assoc()) {\n $followers[] = self::getFollower($row['id']);\n }\n }\n return $followers;\n }", "public static function followers ( $list = false ) {\n\n\t\tstatic::api()->request('GET', static::api()->url('1.1/followers/ids'), array(\n\t\t\t'screen_name' => static::$screen_name\n\t\t));\n\n\t\t$response = static::api()->response['response'];\n\t\t$code = static::api()->response['code'];\n\n\t\tif ($code === 200) {\n\t\t\t$response = json_decode($response, false, 512, JSON_BIGINT_AS_STRING);\n\t\t\tif ($list === TRUE) {\n\t\t\t\treturn static::users($response->ids);\n\t\t\t} else {\n\t\t\t\treturn count($response->ids);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function followers() {\n return $this->belongsToMany(User::class);\n }", "public function Followers()\n {\n return $this->belongsToMany('App\\User', 'user_following', 'following_id', 'user_id' );\n }", "public function FollowingList()\n {\n return $this->belongsToMany('App\\User', 'user_following', 'user_id', 'following_id' );\n }", "public function followers($options = []);", "function followerIds($settings, $user_id)\r\n{\r\n$url = \"https://api.twitter.com/1.1/followers/ids.json\";\r\n$requestMethod = \"GET\";\r\n$getfield = \"?user_id=\" . $user_id;\r\n$twitter = new TwitterAPIExchange($settings);\r\n$string = json_decode($twitter->setGetfield($getfield)\r\n ->buildOauth($url, $requestMethod)\r\n ->performRequest(),$assoc = TRUE);\r\nif($string[\"errors\"][0][\"message\"] != \"\") {echo \"<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>\".$string[errors][0][\"message\"].\"</em></p>\";exit();}\r\necho \"<h1><u>Followers IDS for the Tweet ID \" . $user_id . \"</u></h1>\";\r\necho \"<br>\";\r\n$i = 0;\r\nforeach($string[\"ids\"] as $items)\r\n{\r\n$i++;\r\necho \"ID: \". $items. \"<br />\";\r\necho \"<br>\";\r\n}\r\n}", "function bp_follow_screen_followers() {\n\n\tdo_action( 'bp_follow_screen_followers' );\n\n\t// ignore the template referenced here\n\t// 'members/single/followers' is for older themes already using this template\n\t//\n\t// view bp_follow_load_template_filter() for more info.\n\tbp_core_load_template( 'members/single/followers' );\n}", "public function following()\n {\n \t$following = DB::table('followers')\n \t\t->left_join('users', 'users.id', '=', 'followers.following_id')\n \t\t->where('followers.follower_id', '=', $this->id)\n \t\t->where(\"followers.isCurrent\", \"=\", 1)\n \t\t->get();\n \treturn $following;\n }", "public function follower()\n {\n return $this->belongsTo(CommunityFacade::getUserClass(), 'follower_account_id');\n }", "public function followers()\n {\n return $this->belongsToMany(User::class, 'followers', 'follower_id', 'user_id')->withTimestamps();\n }", "public function getFollowers()\n {\n $savedFollowers = $this->getSavedFollowers();\n \n if ($latestFollowers = $this->getUpdatedFollowers()) {\n $this->saveUnfollowers($savedFollowers, $latestFollowers);\n return $latestFollowers;\n }\n \n return $savedFollowers;\n }", "protected function renderFollowing() {\n $auth = new \\tweeterapp\\auth\\TweeterAuthentification();\n $html = '<h2>Liste des utilisateurs suivis</h2><ul id=\"followees\">';\n $user = User::where('username','=',$auth->user_login)->first();\n $liste_following = $user->follows()->get();\n foreach($liste_following as $l) {\n $html .= ' <li>\n <div class=\"tweet\">\n <div class=\"tweet-text\"><a href=\"'.Router::urlFor('user',[\"id\" => $l->id]).'\">'.$l->fullname.'</a></div>\n </div>\n </li>';\n }\n $html .= '</ul>';\n return $html;\n }", "public function followers()\n {\n return $this->hasMany(Models\\AccountFollower::class, 'account_id');\n }", "static function getFollowingUsers($chef) {\n $users = get_user_meta($chef, 'following_user', true);\n $followingUsers = ($users ? $users : array());\n return $followingUsers;\n }", "public function get_FollowingList($user_id){\r\n $this->db->select(\"followers.user_id,followers.follower_id,followers.created_at,users.full_name,users.user_name,users.picture\");\r\n $this->db->from('followers');\r\n $this->db->order_by(\"full_name\", \"asc\");\r\n $this->db->join('users','users.user_id = followers.user_id');\r\n $this->db->where('followers.follower_id',$user_id);\r\n $followinglist=$this->db->get();\r\n return $followinglist->result();\r\n }", "public function getFollowedByList($perPage = null)\n {\n return $this->getOrPaginateFollowedBy($this->getFollowedByQueryBuilder(), $perPage);\n }", "private function updateFollowers()\r\n {\r\n $fields = $this->getDefinition()->getfields();\r\n\r\n foreach ($fields as $field)\r\n {\r\n switch ($field->type)\r\n {\r\n case 'text':\r\n // Check if any text fields are tagging users\r\n $tagged = self::getTaggedObjRef($this->getValue($field->name));\r\n foreach ($tagged as $objRef)\r\n {\r\n\t\t\t\t\t// We need to have a valid uid, before we add it as follower\r\n\t\t\t\t\tif ($objRef['obj_type'] === 'user' && $objRef['id'] &&\r\n\t\t\t\t\t\tis_numeric($objRef['id']) && $objRef['id'] > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->addMultiValue(\"followers\", $objRef['id'], $objRef['name']);\r\n\t\t\t\t\t}\r\n }\r\n break;\r\n\r\n case 'object':\r\n case 'object_multi':\r\n // Check if any fields are referencing users\r\n if ($field->subtype === \"user\")\r\n {\r\n $value = $this->getValue($field->name);\r\n\r\n if (is_array($value))\r\n {\r\n foreach ($value as $entityId)\r\n {\r\n if (is_numeric($entityId) && $entityId > 0)\r\n {\r\n $this->addMultiValue(\r\n \"followers\",\r\n $entityId,\r\n $this->getValueName($field->name, $entityId)\r\n );\r\n }\r\n }\r\n }\r\n else if (is_numeric($value) && $value > 0)\r\n {\r\n $this->addMultiValue(\r\n \"followers\",\r\n $value,\r\n $this->getValueName($field->name, $value)\r\n );\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }", "public function follower(Request $request)\n {\n /*\n * --------------------------------------------------------------------------\n * Populating account followers\n * --------------------------------------------------------------------------\n * Retrieve followers 10 data per request, because we implement lazy\n * pagination via ajax so return json data when 'page' variable exist, and\n * return view if doesn't.\n */\n\n $contributor = new Contributor();\n\n $followers = $contributor->contributorFollower(Auth::user()->username);\n\n if (Input::get('page', false) && $request->ajax()) {\n return $followers;\n } else {\n return view('contributor.follower', compact('followers'));\n }\n }", "function bp_follow_screen_following() {\n\n\tdo_action( 'bp_follow_screen_following' );\n\n\t// ignore the template referenced here\n\t// 'members/single/following' is for older themes already using this template\n\t//\n\t// view bp_follow_load_template_filter() for more info.\n\tbp_core_load_template( 'members/single/following' );\n}" ]
[ "0.7804757", "0.69050694", "0.68526393", "0.6812313", "0.6775977", "0.66875887", "0.6652494", "0.6646586", "0.663733", "0.6635028", "0.65793496", "0.6563486", "0.654302", "0.653837", "0.65383255", "0.653826", "0.6514652", "0.6498564", "0.6473889", "0.6469816", "0.6458867", "0.6427594", "0.63943076", "0.6334854", "0.6334001", "0.632077", "0.62985885", "0.6291505", "0.6257998", "0.62576234" ]
0.69889355
1
Function to fetch a user profile April 22,2016 Updated on May 03, 2016: to fetch secondary mobile and designation Updated May 11, 2016: To check if I follow this user or not August 10, 2016: Changes after implementing companyuser relation August 16,2016: HTML character encoding support August 17,2016: Check if I am me
function viewUserProfile() { //$clientid=validate_input($_GET['id']); $userName=validate_input($_GET['id']); $clientid=getUserIdfromUserName($userName); $session_values=get_user_session(); $my_session_id = $session_values['id']; $data= array(); if($my_session_id) { $data['followed']= doIFollowThisUser($my_session_id,$clientid); } //the defaults starts global $myStaticVars; extract($myStaticVars); // make static vars local $member_default_avatar = $member_default_avatar; $member_default_cover = $member_default_cover; $member_default = $member_default; $company_default_cover = $company_default_cover; $company_default_avatar = $company_default_avatar; $events_default = $events_default; $event_default_poster = $event_default_poster; //the defaults ends /* $qry="SELECT entrp_login.clientid,entrp_login.firstname,entrp_login.lastname,entrp_login.username,client_profile.city,client_profile.country,client_profile.contact_email as email, client_profile.avatar,client_profile.cover_pic,client_profile.designation,client_profile.mobile,client_profile.website,client_profile.about_me, client_profile.secondary_mobile, location_info.location_desc, company_profiles.company_name,company_profiles.description FROM entrp_login LEFT JOIN client_profile ON entrp_login.clientid=client_profile.clientid LEFT JOIN location_info ON location_info.id=client_profile.client_location LEFT JOIN company_profiles ON company_profiles.clientid=entrp_login.clientid WHERE entrp_login.clientid=".$clientid." "; */ $qry="SELECT entrp_login.clientid,entrp_login.firstname,entrp_login.lastname,entrp_login.username,client_profile.city,client_profile.country,client_profile.contact_email as email, client_profile.avatar,client_profile.cover_pic,client_profile.designation,client_profile.mobile,client_profile.website,client_profile.about_me, client_profile.secondary_mobile, location_info.location_desc FROM entrp_login LEFT JOIN client_profile ON entrp_login.clientid=client_profile.clientid LEFT JOIN location_info ON location_info.id=client_profile.client_location WHERE entrp_login.clientid=".$clientid." "; $res=getData($qry); $count_res=mysqli_num_rows($res); if($count_res>0) { while($row=mysqli_fetch_array($res)) { $data['id'] = $row['clientid']; if($row['avatar']!='') { $data['avatar'] = $row['avatar']; } else { $data['avatar'] = $member_default_avatar; } if($row['cover_pic']!='') { $data['coverPhoto'] = $row['cover_pic']; } else { $data['coverPhoto'] = ''; } $data['firstName'] = $row['firstname']; $data['lastName'] = $row['lastname']; $data['userName'] = $row['username']; $data['position'] = $row['designation']; $data['city'] = $row['city']; $data['aboutMe'] = htmlspecialchars_decode($row['about_me'],ENT_QUOTES); $data['email'] = $row['email']; $data['website'] = $row['website']; $data['mobile'] = $row['mobile']; $data['tel'] = $row['secondary_mobile']; $data['success'] = true; $data['msg'] = 'Profile fetched'; } $companyID = getCompanyIDFromCompUserRelation($clientid); $data['company']['companyName'] = getCompanyNameUsingCompUserRelation($companyID); $data['company']['companyDesc'] = getCompanyDescriptionUsingCompUserRelation($companyID); $data['skills'] = get_user_skill_sets($clientid); $data['interests'] = get_user_interest_sets($clientid); //Function to get total followers of a user $data['followers'] = user_followers($clientid); //Function to get total followings of a user $data['following'] = user_following($clientid); //if i am me if($data['id']==$my_session_id) { $data['myProfile'] = 1; } else { $data['myProfile'] = 0; } } else { $data['success'] = false; $data['msg'] = 'Please check your credentials once again'; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getUserProfile();", "public function getUserProfile();", "public function get_profile_details($user_id)\n {\n $sql = \"SELECT u.id as user_id, \n u.profile_code,\n u.bio_info,\n u.created_at as register_date,\n u.email,\n u.last_name,\n u.first_name,\n ub.middlename,\n u.fullname_last_edited,\n uc.address,\n rc.name as country,\n (case u.gender\n when 'N' then CONCAT('Others','',u.gender_custom)\n when 'F' then 'Female'\n when 'M' then 'Male'\n else ''\n end) 'gender',\n u.gender_num_times_edited,\n ub.birthday,\n u.birthyear,\n u.birthdate_num_times_edited,\n ub.politics as political_view,\n ub.religion,\n rb.name as bloodtype,\n uc.contact1,\n uc.contact2,\n uc.contact3,\n uc.webtitle1, \n uc.weblink1, \n uc.webtitle2, \n uc.weblink2,\n uc.webtitle3, \n uc.weblink3,\n coalesce(a.comments,0) + coalesce(b.discussion,0)as total_comments,\n coalesce(m.friends,0) as total_friends,\n coalesce(n.followers,0) as total_followers,\n coalesce(o.following,0) as total_following,\n coalesce(c.post,0) as total_post,\n coalesce(c.image,0) as total_images,\n coalesce(c.poll,0) as total_poll,\n coalesce(c.question,0) as total_question,\n coalesce(c.article,0) as total_article,\n (coalesce(d.yaycontent,0) + coalesce(e.yaycomment,0) + coalesce(f.yayreply,0) + coalesce(g.yayreplyl2,0) + coalesce(h.yayreplyl3,0) + coalesce(i.yaydiscussion,0) + coalesce(j.yaytopicreply,0) + coalesce(k.yaytopicreplyl2,0) + coalesce(l.yaytopicreplyl3,0)) as totalyayreceived,\n (coalesce(d.naycontent,0) + coalesce(e.naycomment,0) + coalesce(f.nayreply,0) + coalesce(g.nayreplyl2,0) + coalesce(h.nayreplyl3,0) + coalesce(i.naydiscussion,0) + coalesce(j.naytopicreply,0) + coalesce(k.naytopicreplyl2,0) + coalesce(l.naytopicreplyl3,0)) as totalnayreceived,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then CONCAT(ucol.course, ', ', ucol.schoolname)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n\t (coalesce(ugen2.total,0) + coalesce(ucol2.total,0) + coalesce(uwork2.total,0)) as total_credentials\n FROM users u\n LEFT JOIN userbasicinfo ub ON u.id = ub.user_id\n LEFT JOIN usercontactinfo uc ON uc.user_id = u.id\n LEFT JOIN refcountry rc ON rc.id = uc.country \n LEFT JOIN refbloodtype rb ON rb.id = ub.bloodtype\n LEFT OUTER JOIN(SELECT po.user_id, \n count(*) comments\n FROM postopinion po\n WHERE po.deleted_at IS NULL AND po.mask= 0\n GROUP BY po.user_id) as a ON a.user_id = u.id\t\n LEFT OUTER JOIN(SELECT top_o.user_id,\n count(*) discussion\n FROM topicopinion top_o\n WHERE top_o.deleted_at IS NULL AND top_o.mask=0\n GROUP BY top_o.user_id) as b ON b.user_id = u.id \n LEFT OUTER JOIN (select pc.user_id,\n sum(Case when type = 'F' then 1 else 0 end) image,\n sum(Case when type = 'Q' then 1 else 0 end) question,\n sum(Case when type = 'A' then 1 else 0 end) article,\n sum(Case when type = 'P' then 1 else 0 end) poll,\n count(*) post\n FROM postcontent pc\n WHERE pc.deleted_at IS NULL and pc.mask=0\n GROUP BY pc.user_id) as c ON c.user_id = u.id \n LEFT OUTER JOIN (select pca.postcontent_id, pc.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycontent,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycontent\n FROM postcontentapprovalrate pca\n LEFT JOIN postcontent pc ON pc.id=pca.postcontent_id\n WHERE pc.deleted_at IS NULL AND pc.mask=0\n GROUP BY pc.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select poa.postopinion_id, po.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycomment,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naycomment\n FROM postopinionapprovalrate poa\n LEFT JOIN postopinion po ON po.id = poa.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL AND po.mask=0\n GROUP BY po.user_id) as e ON e.user_id = u.id\n LEFT OUTER JOIN (select pra.postreply_id, pra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreply\n FROM postreplyapprovalrate pra\n LEFT JOIN postreply pr ON pr.id = pra.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr.mask=0\n GROUP BY pr.user_id) as f ON f.user_id = u.id\n LEFT OUTER JOIN (select pral2.postreplyL2_id, pral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl2\n FROM postreplyL2approvalrate pral2\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pral2.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at AND pr2.mask=0\n GROUP BY pr2.user_id) as g ON g.user_id = u.id\n LEFT OUTER JOIN (select pral3.postreplyL3_id, pral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yayreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) nayreplyl3\n FROM postreplyL3approvalrate pral3\n LEFT JOIN postreplyL3 pr3 ON pr3.id = pral3.postreplyL3_id\n LEFT JOIN postreplyL2 pr2 ON pr2.id = pr3.postreplyL2_id\n LEFT JOIN postreply pr ON pr.id = pr2.postreply_id\n LEFT JOIN postopinion po ON po.id = pr.postopinion_id\n LEFT JOIN postcontent pc ON pc.id=po.postcontent_id\n WHERE pc.deleted_at IS NULL AND po.deleted_at IS NULL \n AND pr.deleted_at IS NULL AND pr2.deleted_at \n AND pr3.deleted_at IS NULL AND pr3.mask=0\n GROUP BY pr3.user_id) as h ON h.user_id = u.id\n LEFT OUTER JOIN (select toa.topicopinion_id, ton.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaydiscussion,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naydiscussion\n FROM topicopinionapprovalrate toa\n LEFT JOIN topicopinion ton ON ton.id = toa.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL AND ton.mask=0\n GROUP BY ton.user_id) as i ON i.user_id = u.id\n LEFT OUTER JOIN (select tra.topicreply_id, tra.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreply,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreply\n FROM topicreplyapprovalrate tra\n LEFT JOIN topicreply tr ON tr.id = tra.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr.mask=0\n GROUP BY tr.user_id) as j ON j.user_id = u.id\n LEFT OUTER JOIN (select tral2.topicreplyl2_id, tral2.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl2,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl2\n FROM topicreplyl2approvalrate tral2\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tral2.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL AND tr2.mask=0\n GROUP BY tr2.user_id) as k ON k.user_id = u.id\n LEFT OUTER JOIN (select tral3.topicreplyl3_id, tral3.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaytopicreplyl3,\n sum(Case when approvalrate = 'N' then 1 else 0 end) naytopicreplyl3\n FROM topicreplyl3approvalrate tral3\n LEFT JOIN topicreplyl3 tr3 ON tr3.id = tral3.topicreplyl3_id\n LEFT JOIN topicreplyl2 tr2 ON tr2.id = tr3.topicreplyl2_id\n LEFT JOIN topicreply tr ON tr.id = tr2.topicreply_id\n LEFT JOIN topicopinion ton ON ton.id = tr.topicopinion_id\n LEFT JOIN topic t ON t.id=ton.topic_id\n WHERE t.deleted_at IS NULL AND ton.deleted_at IS NULL \n AND tr.deleted_at IS NULL AND tr2.deleted_at IS NULL \n AND tr3.deleted_at IS NULL AND tr3.mask=0\n GROUP BY tr3.user_id) as l ON l.user_id = u.id\n LEFT OUTER JOIN(SELECT uf.user_one_id, \n count(*) friends\n FROM userfriends uf\n WHERE uf.status=1\n GROUP BY uf.user_one_id) as m ON m.user_one_id = u.id\t\n LEFT OUTER JOIN(SELECT ua.user_two_id, \n count(*) followers\n FROM useracquiantances ua\n WHERE ua.status=1\n GROUP BY ua.user_two_id) as n ON n.user_two_id = u.id\n LEFT OUTER JOIN(SELECT ua2.user_one_id, \n count(*) following\n FROM useracquiantances ua2\n WHERE ua2.status=1\n GROUP BY ua2.user_one_id) as o ON o.user_one_id = u.id\n LEFT JOIN usersettings us on us.user_id = u.id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (SELECT usergeneralinfo.user_id,\n COUNT(*) total\n FROM usergeneralinfo\n GROUP BY usergeneralinfo.user_id) as ugen2 ON ugen2.user_id = u.id\n LEFT OUTER JOIN (SELECT usereduccollege.user_id,\n COUNT(*) total\n FROM usereduccollege\n GROUP BY usereduccollege.user_id) as ucol2 ON ucol2.user_id = u.id\n LEFT OUTER JOIN (SELECT userworkhistory.user_id,\n COUNT(*) total\n FROM userworkhistory\n GROUP BY userworkhistory.user_id) as uwork2 ON uwork2.user_id = u.id\n WHERE u.id = {$user_id}\";\n \n return DB::select(DB::raw($sql));\n }", "function fetch_user_profile($data)\n {\n // $data['is_logged_in'] = 1;\n // $data = array('username' => $data);\n $this->load->library('encrypt');\n $profile = $this->db->get_where('user', array('email' => $data));\n if ($profile->num_rows() > 0) {\n $profile = $profile->row_array();\n $profile['avatar'] = ($profile['avatar'] != '' && file_exists('./uploads/ava/' . $profile['avatar'])) ? base_url() . 'uploads/ava/' . $profile['avatar'] : '';\n $profile['expire_date'] = ($profile['expire_date']) ? date('Y-m-d', $profile['expire_date']) : '';\n $profile['password'] = $this->encrypt->decode($profile['password']);\n $profile['city_name'] = db_get_one('ref_city', 'name', \"id = '\" . $profile['city'] . \"'\");;\n $profile['workshop_name'] = db_get_one('ref_location', 'location',\n \"id_ref_location = '\" . $profile['nearest_workshop'] . \"'\");;\n } else {\n $profile = false;\n }\n return $profile;\n }", "function getProfileInfo($user){\n\t\tglobal $db;\n\t\t$sql = \"SELECT * from personalinfo WHERE user_email ='$user'\";\n\t\t$result =$db->query($sql);\n\t\t$infotable = $result->fetch_assoc();\n\t\treturn $infotable;\n\t}", "function getMyCompanyProfileDetails()\n{\n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\t\n\t\t\n\t$data= array();\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t$companyID\t=\tgetCompanyIDFromCompUserRelation($my_session_id);\n\t$role\t\t\t=\tgetUserDesignationFromCompUserRelation($my_session_id);\n\t/*\n\t$qry=\"SELECT company_profiles.id,company_profiles.company_name,company_profiles.company_username,company_profiles.description,company_profiles.avatar,company_profiles.city,company_profiles.cover_photo,\n\t\t\t \t\t company_profiles.website,company_profiles.email,company_profiles.mobile,company_profiles.telephone,company_profiles.fax,\n\t\t\t \t\t location_info.location_desc\n\t\t\tFROM company_profiles\n\t\t\tLEFT JOIN location_info ON location_info.id=company_profiles.client_location\n\t\t\tWHERE company_profiles.clientid=\".$my_session_id.\"\n\t \";\n\t */ \n\t$qry=\"SELECT company_profiles.id,company_profiles.company_name,company_profiles.company_username,company_profiles.description,company_profiles.avatar,company_profiles.city,company_profiles.cover_photo,\n\t\t\t \t\t company_profiles.website,company_profiles.email,company_profiles.mobile,company_profiles.telephone,company_profiles.fax,\n\t\t\t \t\t location_info.location_desc\n\t\t\tFROM company_profiles\n\t\t\tLEFT JOIN location_info ON location_info.id=company_profiles.client_location\n\t\t\tWHERE company_profiles.id=\".$companyID.\"\n\t \";\n\t \n\t$res=getData($qry);\n $count_res=mysqli_num_rows($res);\n\tif($count_res>0)\n\t{\n\t\twhile($row=mysqli_fetch_array($res))\n\t\t{\n\t\t\t$data['id']\t\t\t\t\t=\t$row['id']; \t\t\t\t\t\t\n\t\t\t$data['companyUserName']=\t$row['company_username'];\t\t\t\t\t\t\t\t\n\t\t\t$data['companyName']\t\t=\t$row['company_name']; \t\t\t\n\t\t\t$data['location']\t\t\t=\t$row['location_desc']; \t\t\t\n\t\t\t$data['companyDesc']\t\t=\thtmlspecialchars_decode($row['description'],ENT_QUOTES);\t\n\t\t\t$data['email']\t\t\t\t=\t$row['email']; \t\t\t\n\t\t\t$data['website']\t\t\t=\t$row['website']; \t\t\t\n\t\t\t$data['mobile']\t\t\t=\t$row['mobile']; \t\t\t\n\t\t\t$data['tel']\t\t\t\t=\t$row['telephone']; \t\t\t\n\t\t\t$data['fax']\t\t\t\t=\t$row['fax']; \t\n\t\t\t\n\t\t\tif($row['avatar']!='')\n \t\t{\n \t\t\t$data['profilePhoto']\t\t\t\t=\t$row['avatar'];\n \t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['profilePhoto']\t\t\t\t=\t$company_default_avatar;\n\t\t\t} \n\t\t\t\n\t\t\tif($row['cover_photo']!='')\n \t\t{\n \t\t\t$data['coverPhoto']\t\t\t\t=\t$row['cover_photo'];\n \t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['coverPhoto']\t\t\t\t=\t$company_default_cover;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t}\n\t\t$company_id=$data['id'];\n\t\t$data['categories']\t= fetch_company_categories($company_id);\t\n\t\t$data['followers']\t= entrp_company_follows($company_id);\n\t\t$data['companyEvents']\t= fetchCompanyEvents($company_id);\t\n\t\t$data['companyMembers']\t= fetchThisCompanyMembers($company_id);\t\n\t\t$data['role']\t= $role;\t\n\t}\n\telse \n\t{\n\t\t$data['id']\t\t\t\t\t=\t''; \t\t\t\n\t\t$data['profilePhoto']\t=\t''; \t\t\n\t\t$data['coverPhoto']\t\t=\t''; \t\t\n\t\t$data['companyName']\t\t=\t''; \n\t\t$data['location']\t\t\t=\t''; \t\t\t\n\t\t$data['companyDesc']\t\t=\t''; \t\t\n\t\t$data['email']\t\t\t\t=\t''; \t\t\t\n\t\t$data['website']\t\t\t=\t''; \t\t\t\n\t\t$data['mobile']\t\t\t=\t''; \t\n\t\t$data['tel']\t\t\t\t=\t''; \t\t\t\n\t\t$data['fax']\t\t\t\t=\t''; \n\t\t$data['companyUserName']='';\n\t}\n\t\n\treturn $data;\n\t/*\n\t{\n\t\"id\": 1,\n\t\"profilePhoto\": \"member01.jpg\",\n\t\"coverPhoto\": \"memberCover01.jpg\",\n\t\"companyName\": \"vOffice\",\n\t\"location\": \"Fort Legend Tower\",\n\t\"companyDesc\": \"We provide businesses superior reach and access to South East Asia markets like Jakarta, Manila, Kuala Lumpur and Singapore.\",\n\t\"email\": \"[email protected]\",\n\t\"website\": \"voffice.com.ph\",\n\t\"mobile\": \"6322242000\",\n\t\"category\": [\n\t\t\"Virtual Office\",\n\t\t\"Serviced Office\",\n\t\t\"Coworking Space\"\n\t],\n\t\"allCategory\" : []\n\t};\n\t*/\n}", "function getBasicUserInformation()\n{\n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\t\n\t$data= array();\n \n\t//$userid=validate_input($_GET['id']);\n\t$session_values=get_user_session();\n\t$my_session_id\t= $session_values['id'];\n\t$userid=$my_session_id;\n\tif($userid)\n\t{\n\t\t\t/*\n\t\t\t$qry=\"SELECT entrp_login.clientid,entrp_login.firstname,entrp_login.lastname,entrp_login.username,\n\t\t\t\t\t \t\t client_profile.avatar,client_profile.designation,client_profile.company_name,client_profile.cover_pic,\n\t\t\t\t\t \t\t company_profiles.company_username\n\t\t\t\t\tFROM entrp_login\n\t\t\t\t\tLEFT JOIN client_profile ON entrp_login.clientid=client_profile.clientid\n\t\t\t\t\t//LEFT JOIN company_profiles ON entrp_login.clientid=company_profiles.clientid\n\t\t\t\t\tWHERE entrp_login.clientid=\".$userid.\"\n\t\t\t \";\n\t\t\t */\n\t\t\t$qry=\"SELECT entrp_login.clientid,entrp_login.firstname,entrp_login.lastname,entrp_login.username,\n\t\t\t\t\t \t\t client_profile.avatar,client_profile.designation,client_profile.company_name,client_profile.cover_pic \n\t\t\t\t\tFROM entrp_login\n\t\t\t\t\tLEFT JOIN client_profile ON entrp_login.clientid=client_profile.clientid\n\t\t\t\t\tWHERE entrp_login.clientid=\".$userid.\"\n\t\t\t \";\n\t\t\t$res=getData($qry);\n\t\t $count_res=mysqli_num_rows($res);\n\t\t if($count_res>0)\n\t\t {\n\t\t \twhile($row=mysqli_fetch_array($res))\n\t\t \t{\n\t\t \t\t$data['id']\t\t\t=\t$row['clientid'];\n\t\t \t\t\n\t\t \t\tif($row['avatar']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['avatar']\t\t\t\t=\t$row['avatar'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['avatar']\t\t\t\t=\t$member_default_avatar;\n \t\t\t\t}\n \t\t\t\tif($row['cover_pic']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['coverPhoto']\t\t\t\t=\t$row['cover_pic'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['coverPhoto']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif($row['firstname']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['firstName']\t\t\t=\t$row['firstname'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['firstName']\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif($row['lastname']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['lastName']\t\t\t\t=\t$row['lastname'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['lastName']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif($row['username']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['userName']\t\t\t\t=\t$row['username'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['userName']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif($row['designation']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['position']\t\t\t\t=\t$row['designation'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['position']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t/*\n \t\t\t\tif($row['company_name']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['myOffice']\t\t\t\t=\t$row['company_name'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['myOffice']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif($row['company_username']!='')\n \t\t\t\t{\n \t\t\t\t\t$data['companyUserName']\t\t\t\t=\t$row['company_username'];\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$data['companyUserName']\t\t\t\t=\t'';\n \t\t\t\t}\n \t\t\t\t*/\n\t\t \t}\t\n\t\t \t\n\t\t \t$companyID\t=\tgetCompanyIDFromCompUserRelation($userid);\n\t\t \t$data['companyUserName']\t=\tgetCompanyUserNameUsingCompUserRelation($companyID);\t\n\t\t \t$data['myOffice']\t\t\t\t= getCompanyNameUsingCompUserRelation($companyID);\t \n\t\t }\n\t\t else\n\t\t {\n\t\t\t\t\t$data['id']\t\t\t\t\t=\t'';\n\t\t\t\t\t$data['avatar']\t\t\t=\t'';\n\t\t\t\t\t$data['firstName']\t\t=\t'';\n\t\t\t\t\t$data['lastName']\t\t\t=\t'';\n\t\t\t\t\t$data['userName']\t\t\t=\t'';\n\t\t\t\t\t$data['position']\t\t\t=\t'';\n\t\t\t\t\t$data['myOffice']\t\t\t=\t'';\t\t \n\t\t }\t\n\t}\n\treturn $data;\n\n}", "function mozilla_get_user_info($me, $user, $logged_in) {\n $object = new stdClass();\n $object->value = $user->user_nicename;\n $object->display = true;\n \n $data = Array(\n 'username' => $object,\n 'id' => $user->ID\n );\n\n $is_me = $logged_in && intval($me->ID) === intval($user->ID);\n $meta = get_user_meta($user->ID);\n $community_fields = isset($meta['community-meta-fields'][0]) ? unserialize($meta['community-meta-fields'][0]) : Array();\n\n // First Name\n $object = new stdClass();\n $object->value = isset($meta['first_name'][0]) ? $meta['first_name'][0] : false;\n $object->display = mozilla_display_field('first_name', isset($meta['first_name_visibility'][0]) ? $meta['first_name_visibility'][0] : false, $is_me, $logged_in);\n \n $data['first_name'] = $object;\n\n // Last Name\n $object = new stdClass();\n $object->value = isset($meta['last_name'][0]) ? $meta['last_name'][0] : false;\n $object->display = mozilla_display_field('last_name', isset($meta['last_name_visibility'][0]) ? $meta['last_name_visibility'][0] : false, $is_me, $logged_in);\n $data['last_name'] = $object;\n\n // Email\n $object = new stdClass();\n $object->value = isset($meta['email'][0]) ? $meta['email'][0] : false;\n $object->display = mozilla_display_field('email', isset($meta['email_visibility'][0]) ? $meta['email_visibility'][0] : false , $is_me, $logged_in);\n $data['email'] = $object;\n\n // Location\n global $countries;\n $object = new stdClass();\n if(isset($community_fields['city']) && strlen($community_fields['city']) > 0 && isset($community_fields['country']) && strlen($community_fields['country']) > 1) {\n $object->value = \"{$community_fields['city']}, {$countries[$community_fields['country']]}\";\n } else {\n if(isset($community_fields['city']) && strlen($community_fields['city']) > 0) {\n $object->value = $community_fields['city'];\n } elseif(isset($community_fields['country']) && strlen($community_fields['country']) > 0) {\n $object->value = $countries[$community_fields['country']];\n } else {\n $object->value = false;\n }\n }\n \n $object->display = mozilla_display_field('location', isset($meta['profile_location_visibility'][0]) ? $meta['profile_location_visibility'][0] : false , $is_me, $logged_in);\n $data['location'] = $object;\n\n // Profile Image\n $object = new stdClass();\n $object->value = isset($community_fields['image_url']) && strlen($community_fields['image_url']) > 0 ? $community_fields['image_url'] : false;\n $object->display = mozilla_display_field('image_url', isset($community_fields['profile_image_url_visibility']) ? $community_fields['profile_image_url_visibility'] : false , $is_me, $logged_in);\n $data['profile_image'] = $object;\n\n // Bio\n $object = new stdClass();\n $object->value = isset($community_fields['bio']) && strlen($community_fields['bio']) > 0 ? $community_fields['bio'] : false;\n $object->display = mozilla_display_field('bio', isset($community_fields['bio_visibility']) ? $community_fields['bio_visibility'] : false , $is_me, $logged_in);\n $data['bio'] = $object;\n\n // Pronoun Visibility \n $object = new stdClass();\n $object->value = isset($community_fields['pronoun']) && strlen($community_fields['pronoun']) > 0 ? $community_fields['pronoun'] : false;\n $object->display = mozilla_display_field('pronoun', isset($community_fields['pronoun_visibility']) ? $community_fields['pronoun_visibility'] : false , $is_me, $logged_in);\n $data['pronoun'] = $object;\n\n // Phone\n $object = new stdClass();\n $object->value = isset($community_fields['phone']) ? $community_fields['phone'] : false;\n $object->display = mozilla_display_field('phone', isset($community_fields['phone_visibility']) ? $community_fields['phone_visibility'] : false , $is_me, $logged_in);\n $data['phone'] = $object;\n\n // Groups Joined\n $object = new stdClass();\n $object->display = mozilla_display_field('groups_joined', isset($community_fields['profile_groups_joined_visibility']) ? $community_fields['profile_groups_joined_visibility'] : false , $is_me, $logged_in);\n $data['groups'] = $object;\n\n // Events Attended\n $object = new stdClass();\n $object->display = mozilla_display_field('events_attended', isset($community_fields['profile_events_attended_visibility']) ? $community_fields['profile_events_attended_visibility'] : false , $is_me, $logged_in);\n $data['events_attended'] = $object;\n\n // Events Organized\n $object = new stdClass();\n $object->display = mozilla_display_field('events_organized', isset($community_fields['profile_events_organized_visibility']) ? $community_fields['profile_events_organized_visibility'] : false , $is_me, $logged_in);\n $data['events_organized'] = $object;\n \n // Campaigns\n $object = new StdClass();\n $object->display = mozilla_display_field('campaigns_participated', isset($community_fields['profile_campaigns_visibility']) ? $community_fields['profile_campaigns_visibility'] : false , $is_me, $logged_in);\n $data['campaigns_participated'] = $object;\n\n // Social Media \n $object = new stdClass();\n $object->value = isset($community_fields['telegram']) && strlen($community_fields['telegram']) > 0 ? $community_fields['telegram'] : false;\n $object->display = mozilla_display_field('telegram', isset($community_fields['profile_telegram_visibility']) ? $community_fields['profile_telegram_visibility'] : false , $is_me, $logged_in);\n $data['telegram'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['facebook']) && strlen($community_fields['facebook']) > 0 ? $community_fields['facebook'] : false;\n $object->display = mozilla_display_field('facebook', isset($community_fields['profile_facebook_visibility']) ? $community_fields['profile_facebook_visibility'] : false , $is_me, $logged_in);\n $data['facebook'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['twitter']) && strlen($community_fields['twitter']) > 0 ? $community_fields['twitter'] : false;\n $object->display = mozilla_display_field('twitter', isset($community_fields['profile_twitter_visibility']) ? $community_fields['profile_twitter_visibility'] : false , $is_me, $logged_in);\n $data['twitter'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['linkedin']) && strlen($community_fields['linkedin']) > 0 ? $community_fields['linkedin'] : false;\n $object->display = mozilla_display_field('linkedin', isset($community_fields['profile_linkedin_visibility']) ? $community_fields['profile_linkedin_visibility'] : false , $is_me, $logged_in);\n $data['linkedin'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['discourse']) && strlen($community_fields['discourse']) > 0 ? $community_fields['discourse'] : false;\n $object->display = mozilla_display_field('discourse', isset($community_fields['profile_discourse_visibility']) ? $community_fields['profile_discourse_visibility'] : false , $is_me, $logged_in);\n $data['discourse'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['github']) && strlen($community_fields['github']) > 0 ? $community_fields['github'] : false;\n $object->display = mozilla_display_field('github', isset($community_fields['profile_github_visibility']) ? $community_fields['profile_github_visibility'] : false , $is_me, $logged_in);\n\t$data['github'] = $object;\n\t\n\t$object = new stdClass();\n $object->value = isset($community_fields['matrix']) && strlen($community_fields['matrix']) > 0 ? $community_fields['matrix'] : false;\n $object->display = mozilla_display_field('matrix', isset($community_fields['profile_matrix_visibility']) ? $community_fields['profile_matrix_visibility'] : false , $is_me, $logged_in);\n $data['matrix'] = $object;\n\n //Languages\n $object = new stdClass();\n $object->value = isset($community_fields['languages']) && sizeof($community_fields['languages']) > 0 ? $community_fields['languages'] : false;\n $object->display = mozilla_display_field('languages', isset($community_fields['profile_languages_visibility']) ? $community_fields['profile_languages_visibility'] : false , $is_me, $logged_in);\n $data['languages'] = $object;\n\n // Tags\n $object = new stdClass();\n $object->value = isset($community_fields['tags']) && strlen($community_fields['tags']) > 0 ? $community_fields['tags'] : false;\n $object->display = mozilla_display_field('tags', isset($community_fields['profile_tags_visibility']) ? $community_fields['profile_tags_visibility'] : false , $is_me, $logged_in);\n $data['tags'] = $object;\n \n $object = null;\n return $data;\n}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function company_following_user_query( $company_id=\"\", $following_type='', $user_id, $current_user_id=\"\", $short_type='' )\n\t{\n\t\t//echo $current_user_id.\"<br>\";\n\t\t$sql = \"SELECT UFC.id, UFC.user_id, UFC.company_id, UFC.following_date, UFC.following_type, UFC.user_id AS next_user_id,\n\t\t\t\tU.users_firstname, U.users_lastname, \n\t\t\t\tIF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\tfnStripTags(U.users_bio) AS users_bio, IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, U.users_current_employer,U.users_current_title,\n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUCV.company_id AS viewing_company_id, UCV.id AS viewing_id, UCV.viewing_date AS max_view_date\n\t\t\t\tFROM hia_user_following_company AS UFC\n\t\t\t\tJOIN hia_users AS U ON( UFC.user_id = U.users_id )\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN \n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT id, user_id, company_id, viewing_type, MAX(viewing_date) AS viewing_date \n\t\t\t\t\t\tFROM hia_user_view_company WHERE company_id = '$company_id' AND viewing_type = 'company'\n\t\t\t\t\t\tGROUP BY user_id\n\t\t\t\t\t\t\n\t\t\t\t\t) UCV ON (U.users_id = UCV.user_id AND UCV.company_id = '$company_id' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1'\n\t\t\t\tAND U.company_type != '1' \";\n\n\t\tif ($following_type != \"\") {\n\t\t\t$sql.= \" AND UFC.following_type = '$following_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UFC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UFC.company_id = '$company_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='next') {\n\t\t\t$sql.= \" AND UFC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type =='prev') {\n\t\t\t$sql.= \" AND UFC.user_id < '$current_user_id' \";\n\t\t}\n\t\t\n\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UFC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UFC.user_id ASC \";\n\t\t}\n\t\t//echo $sql;exit;\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}", "public function profile() {\r\n if (!$this->common_model->isLoggedIn()) {\r\n redirect('signin');\r\n }\r\n $data = $this->common_model->commonFunction();\r\n $data['user_session'] = $this->session->userdata('user_account');\r\n\r\n $arr_user_data = array();\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = 'user_id,first_name,last_name,user_email,user_name,user_type,user_status,profile_picture,gender';\r\n $condition_to_pass = array(\"user_id\" => $data['user_session']['user_id']);\r\n $arr_user_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n $data['arr_user_data'] = $arr_user_data[0];\r\n\r\n $data['site_title'] = \"Profile\";\r\n $this->load->view('front/includes/header', $data);\r\n $this->load->view('front/user-account/user-profile', $data);\r\n $this->load->view('front/includes/footer');\r\n }", "abstract public function getUserInfo();", "function getUserInfo($id){\n\t\n\t$usr_info = mysql_fetch_object(listAll(\"user\", \"WHERE id = '$id'\"));\n\t$descripcion = getUserData($id, \"2\");\n\t$user_img = getUserData($id, \"1\");\n\t$direccion = getUserData($id, \"3\");\n\t$ciudad = getUserData($id, \"10\");\n\t$cp = getUserData($id, \"4\");\n\t$pais = getUserData($id, \"5\");\n\t$telefono = getUserData($id, \"6\");\n\t$movil =getUserData($id, \"7\");\n\t$exp = getUserData($id, \"14\");\n\t$cam = getUserData($id, \"11\");\n\t$lentes = getUserData($id, \"12\");\n\t$equip = getUserData($id, \"13\");\n\t$cover = getUserData($id, \"16\");\n\t$user_pago = getUserData($id, \"17\");\n $escuelaFotografia = getUserData($id, \"18\");\n $masEducacion = getUserData($id, \"19\");\n $experienciaLaboral = getRecentUserData($id, \"20\");\n $idiomas = getUserData($id, \"22\");\n $habilidades = getUserData($id, \"21\");\n $rut = getUserData($id, \"23\");\n\t\n\tif($usr_info->gender == \"H\"){\n\t\t$gender = \"Hombre\";\n\t}else{\n\t\t$gender = \"Mujer\";\n\t}\n\n\t$paisf = listAll(\"paises\",\"WHERE iso = '$pais->description'\");\n\t$rs_paisf = mysql_fetch_object($paisf);\n\t\n\t$user['id'] = $usr_info->id;\n\t$user['user_type'] = $usr_info->user_type;\n\t$user['email'] = $usr_info->user;\n $user['new_email'] = $usr_info->new_email;\n $user['new_email_code'] = $usr_info->new_email_code;\n\t$user['descripcion'] = $descripcion->description;\n\t$user['user_img']= $user_img->description;\n\t$user[\"name\"] = $usr_info->name;\n\t$user['lastname'] = $usr_info->lastname;\n\t$user['dob']= DateHelper::getLongDate($usr_info->dob);\n $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y');\n\t$user['sex']= $gender;\n\t$user['act']= $usr_info->act;\n\t$dob = explode(\"-\",$usr_info->dob);\n\t$user['ano'] = $dob[0];\n\t$user['mes'] = $dob[1];\n\t$user['dia'] = $dob[2];\n\t$user['direccion'] = $direccion->description;\n\t$user['ciudad'] = $ciudad->description;\n\t$user['cp'] = $cp->description;\n\t$user['pais'] = utf8_encode($rs_paisf->nombre);\n\t$user['pais_ab'] = utf8_encode($rs_paisf->iso);\n\t$user['telefono'] = $telefono->description;\n\t$user['movil'] = $movil->description;\n\t$user['exp'] = $exp->description;\n $user['escuela-fotografia'] = $escuelaFotografia->description;\n $user['mas-educacion'] = $masEducacion->description;\n $user['experiencia-laboral'] = json_decode($experienciaLaboral->description);\n $user['idiomas'] = json_decode($idiomas->description);\n $user['habilidades'] = json_decode($habilidades->description);\n $user['rut'] = $rut->description;\n\t$user['cam'] = json_decode($cam->description);\n\t$user['lentes'] = json_decode($lentes->description);\n\t$user['equip'] = json_decode($equip->description);\n\t$user[\"act_code\"] = $usr_info->act_code;\n $user[\"profile_completed\"] = $usr_info->profile_completed;\n $user[\"wizard_completed\"] = $usr_info->wizard_completed;\n $user[\"wizard_contact_creative_completed\"] = $usr_info->wizard_contact_creative_completed;\n\t$user['user_cover'] = $cover->description;\n\t$user['user_pago'] = $user_pago->description;\n\t$user['full_name'] = ucwords($user[\"name\"] . \" \" . $user['lastname']);\n //TODO make it an external function\n //TODO set a default image if file does not exists\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/profile.jpg\")){\n $user['profile_image_url'] = \"profiles/\".sha1($usr_info->id).\"/profile.jpg\";\n } else {\n if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) {\n $user['profile_image_url'] = \"images/profile_default_photographer.jpg\";\n } else {\n $user['profile_image_url'] = \"images/profile_default_client.jpg\";\n }\n }\n\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/cover.jpg\")){\n $user['cover_image_url'] = \"profiles/\".sha1($usr_info->id).\"/cover.jpg\";\n } else {\n $user['cover_image_url'] = \"images/cover_default.jpg\";\n }\n\n return $user;\n}", "function sociallogin_getuser_data($userprofile) {\n $lrdata['id'] = tep_db_prepare_input((!empty($userprofile->ID) ? $userprofile->ID : ''));\n\t$lrdata['session'] = uniqid('LoginRadius_', true);\n $lrdata['Provider'] = tep_db_prepare_input((!empty($userprofile->Provider) ? $userprofile->Provider : ''));\n $lrdata['FirstName'] = tep_db_prepare_input((!empty($userprofile->FirstName) ? $userprofile->FirstName : ''));\n $lrdata['LastName'] = tep_db_prepare_input((!empty($userprofile->LastName) ? $userprofile->LastName : ''));\n\t$lrdata['NickName'] = tep_db_prepare_input((!empty($userprofile->NickName) ? $userprofile->NickName : ''));\n $lrdata['FullName'] = tep_db_prepare_input((!empty($userprofile->FullName) ? $userprofile->FullName : ''));\n $lrdata['ProfileName'] = tep_db_prepare_input((!empty($userprofile->ProfileName) ? $userprofile->ProfileName : ''));\n $lrdata['dob'] = tep_db_prepare_input((!empty($userprofile->BirthDate) ? $userprofile->BirthDate : ''));\n\t// Convert the birth date.\n\t$lrdata['dob'] = date('m-d-Y', strtotime($lrdata['dob']));\n $lrdata['telephone'] = tep_db_prepare_input($userprofile->PhoneNumbers[0]->PhoneNumber);\n if (empty($lrdata['telephone'])) {\n $lrdata['telephone'] = 'default';\n }\n $lrdata['gender'] = tep_db_prepare_input((!empty($userprofile->Gender) ? $userprofile->Gender : ''));\n\tif ($lrdata['gender'] == 'M' OR $lrdata['gender'] == 'm' OR $lrdata['gender'] == 'Male') {\n\t $lrdata['gender'] = 'male';\n\t}\n\telse if ($lrdata['gender'] == 'F' OR $lrdata['gender'] == 'f' OR $lrdata['gender'] == 'Female') {\n\t $lrdata['gender'] = 'female';\n\t}\n\telse {\n\t $lrdata['gender'] = 'male';\n\t}\n $lrdata['city'] = tep_db_prepare_input((!empty($userprofile->City) ? $userprofile->City : ''));\n if (empty($lrdata['city'])) {\n $lrdata['city'] = tep_db_prepare_input((!empty($userprofile->HomeTown) ? $userprofile->HomeTown : ''));\n }\n $lrdata['state'] = $lrdata['city'];\n $lrdata['address'] = tep_db_prepare_input((!empty($userprofile->Addresses) ? $userprofile->MainAddress : ''));\n if (empty($lrdata['address'])) {\n $lrdata['address'] = $lrdata['city'];\n }\n $lrdata['company'] = tep_db_prepare_input($userprofile->Positions[1]->Comapny->Name);\n\tif (empty($lrdata['company'])) {\n $lrdata['company'] = tep_db_prepare_input((!empty($userprofile->Industry) ? $userprofile->Industry : ''));\n }\n $lrdata['password'] = mt_rand(8, 15);\n $lrdata['Email'] = tep_db_prepare_input((sizeof($userprofile->Email) > 0 ? $userprofile->Email[0]->Value : ''));\n $lrdata['thumbnail'] = (!empty($userprofile->ImageUrl) ? trim($userprofile->ImageUrl) : '');\n if (empty($lrdata['thumbnail']) && $lrdata['provider'] == 'facebook') {\n $lrdata['thumbnail'] = \"https://graph.facebook.com/\" . $lrdata['id'] . \"/picture?type=large\";\n }\n return $lrdata;\n }", "public function get_userInfo_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userInfo($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function userProfile($mobile)\n {\n $response = $this->client->get('?phone_number=' . $mobile . '&include_messages=true');\n\n $xml = $response->xml();\n\n $json = json_encode($xml);\n\n $array = json_decode($json, TRUE);\n\n if (empty($array['error'])){\n return array_filter($array['profile']);\n }\n }", "function getUserProfile()\n\t{\n\t\t// refresh tokens if needed \n\t\t$this->refreshToken();\n\n\t\ttry{\n\t\t\t$authTest = $this->api->api( \"auth.test\" );\n\t\t\t$response = $this->api->get( \"users.info\", array( \"user\" => $authTest->user_id ) );\n\t\t}\n\t\tcatch( SlackException $e ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error: $e\", 6 );\n\t\t}\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ), 6 );\n\t\t}\n\n\t\tif ( ! is_object( $response ) || ! isset( $response->user->id ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response.\", 6 );\n\t\t}\n\t\t# store the user profile. \n\t\t$this->user->profile->identifier\t\t=\t@$response->user->id;\n\t\t$this->user->profile->profileURL\t\t=\t\"\";\n\t\t$this->user->profile->webSiteURL\t\t=\t\"\";\n\t\t$this->user->profile->photoURL\t\t\t=\t@$response->user->profile->image_original;\n\t\t$this->user->profile->displayName\t\t=\t@$response->user->profile->real_name;\n\t\t$this->user->profile->description\t\t=\t\"\";\n\t\t$this->user->profile->firstName\t\t\t=\t@$response->user->profile->first_name;\n\t\t$this->user->profile->lastName\t\t\t=\t@$response->user->profile->last_name;\n\t\t$this->user->profile->gender\t\t\t=\t\"\";\n\t\t$this->user->profile->language\t\t\t=\t\"\";\n\t\t$this->user->profile->age\t\t\t\t=\t\"\";\n\t\t$this->user->profile->birthDay\t\t\t=\t\"\";\n\t\t$this->user->profile->birthMonth\t\t=\t\"\";\n\t\t$this->user->profile->birthYear\t\t\t=\t\"\";\n\t\t$this->user->profile->email\t\t\t\t=\t@$response->user->profile->email;\n\t\t$this->user->profile->emailVerified\t =\t\"\";\n\t\t$this->user->profile->phone\t\t\t\t=\t\"\";\n\t\t$this->user->profile->address\t\t\t=\t\"\";\n\t\t$this->user->profile->country\t\t\t=\t\"\";\n\t\t$this->user->profile->region\t\t\t=\t\"\";\n\t\t$this->user->profile->city\t\t\t\t=\t\"\";\n\t\t$this->user->profile->zip\t\t\t\t=\t\"\";\n\n\t\treturn $this->user->profile;\n\t}", "function update_user_profile() {\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggdomainname = $CFG->wwwroot.$config->elggpath;\n $elggmethod = 'get.user.info';\n $elgg_api_key = $config->elggapikey;\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $elggdomainname.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $dataobject = new stdClass;\n $dataobject->id = $result->id;\n if($fetched->result->firstname || $fetched->result->firstname !== null) {\n $dataobject->firstname = $fetched->result->firstname;\n }\n if($fetched->result->lastname || $fetched->result->lastname !== null) {\n $dataobject->lastname = $fetched->result->lastname;\n }\n if($fetched->result->email || $fetched->result->email !== null) {\n $dataobject->email = $fetched->result->email;\n }\n if($fetched->result->phone || $fetched->result->phone !== null) {\n $dataobject->phone1 = $fetched->result->phone;\n }\n if($fetched->result->mobile || $fetched->result->mobile !== null) {\n $dataobject->phone2 = $fetched->result->mobile;\n }\n if($fetched->result->city || $fetched->result->city !== null) {\n $dataobject->city = $fetched->result->city;\n $dataobject->country = 'BR';\n }\n if($fetched->result->description || $fetched->result->description !== null) {\n $dataobject->description = $fetched->result->description;\n }\n $DB->update_record('user',$dataobject);\n unset($dataobject);\n if($fetched->result->company || $fetched->result->company !== null) {\n $companyfieldid =[];\n try {\n $companyfieldid = $DB->get_record_sql(\"SELECT uid.id,uid.data\n FROM {user_info_data} AS uid\n JOIN {user_info_field} AS uif ON (uif.id = uid.fieldid)\n WHERE uid.userid = :userid\n AND uif.shortname = 'empresa'\",array('userid'=>$result->id),MUST_EXIST);\n if(strcmp($companyfieldid->data,$fetched->result->company) !== 0) {\n $DB->update_record('user_info_data',array('id'=>$companyfieldid->id,'data'=>$fetched->result->company));\n }\n }\n catch(Exception $e) {\n echo $e;\n }\n }\n }\n }\n }\n return true;\n}", "function user_info($user_master_id){\n $select=\"SELECT * FROM login_users as lu LEFT JOIN service_person_details as cd ON lu.id=cd.user_master_id WHERE lu.id='$user_master_id'\";\n $res = $this->db->query($select);\n if($res->num_rows()==1){\n foreach($res->result() as $rows){}\n $profile=$rows->profile_pic;\n if(empty($profile)){\n $pic=\"\";\n }else{\n $pic=base_url().'assets/persons/'.$profile;\n }\n $user_info=array(\n \"phone_no\"=>$rows->phone_no,\n \"email\"=>$rows->email,\n \"full_name\"=>$rows->full_name,\n \"gender\"=>$rows->gender,\n \"profile_pic\"=>$pic,\n );\n $response=array(\"status\"=>\"success\",\"msg\"=>\"User information\",\"user_details\"=>$user_info,\"msg\"=>\"\",\"msg_ta\"=>\"\");\n\n }else{\n $response=array(\"status\"=>\"error\",\"msg\"=>\"No User information found\",\"msg\"=>\"User details not found!\",\"msg_ta\"=>\"பயனர் விபரங்கள் கிடைக்கவில்லை!\");\n }\n return $response;\n }", "public function get_user_following($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n $filter = $filters['filter'];\n \n //Most Recent\n $active_filter = \" ORDER BY created_at DESC, u.first_name, u.last_name\";\n if($filter == 1) {\n //Alphabetical\n $active_filter = \" ORDER BY u.first_name, u.last_name\";\n } else if($filter == 2) {\n //By number of followers\n $active_filter = \" ORDER BY followers DESC, u.first_name, u.last_name\";\n } else if($filter == 3) {\n //By number of mutual friends\n $active_filter = \" ORDER BY mutual_friends DESC, u.first_name, u.last_name\";\n } else if($filter == 4) {\n //By number of similar interests\n $active_filter = \" ORDER BY similar_interest DESC, u.first_name, u.last_name\";\n }\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NOT NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n coalesce(mf.mutualfriends,0) as mutual_friends,\n coalesce(ms.mutualstrings,0) as similar_interest,\n uq.created_at\n FROM useracquiantances uq\n JOIN users u ON u.id = uq.user_two_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uq.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uq.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uq.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uq.user_two_id\n LEFT OUTER JOIN (select uf5.user_one_id,\n COUNT(*) mutualfriends\n FROM userfriends uf5\n WHERE uf5.status=1 AND\n uf5.user_two_id IN (SELECT uf6.user_two_id\n FROM userfriends uf6\n WHERE uf6.user_one_id={$active_login_userid} AND status=1)\n GROUP BY uf5.user_one_id) as mf ON mf.user_one_id = u.id\n LEFT OUTER JOIN (select tr.user_id,\n COUNT(*) mutualstrings\n FROM topictrack tr\n LEFT JOIN topic t ON t.id = tr.topic_id\n WHERE t.deleted_at IS NULL AND tr.mask=0 AND\n tr.topic_id IN (SELECT tr2.topic_id \n FROM topictrack tr2\n LEFT JOIN topic t2 ON tr2.topic_id = t2.id\n WHERE tr2.user_id={$active_login_userid} \n AND t.deleted_at IS NULL \n AND tr.mask=0)\n GROUP BY tr.user_id) as ms ON ms.user_id = u.id\n WHERE (uq.user_one_id={$owner_profile_userid} AND uq.status=1)\n {$active_filter}\n LIMIT {$limit}\";\n \n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function api_entry_getprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n unset($user->password);\n\n $this->load->model('Mdl_Requests');\n $this->load->model('Mdl_Prays');\n\n $user->ipray_praying_for_me = 0;\n $user->ipray_i_am_praying_for = 0;\n $user->ipray_request_attended = 0;\n\n $prays = $this->Mdl_Prays->getAll();\n $requests = array();\n\n if (count($prays)) {\n foreach ($prays as $key => $val) {\n $request = $this->Mdl_Requests->get($val->request);\n $prayer = $this->Mdl_Users->get($val->prayer);\n\n if ($_POST[\"user\"] == $request->host) {\n if ($val->status == 1) $user->ipray_request_attended++;\n $user->ipray_praying_for_me++;\n }\n if ($_POST[\"user\"] == $val->prayer) {\n $user->ipray_i_am_praying_for++;\n }\n }\n }\n \n\n parent::returnWithoutErr(\"User profile fetched successfully.\", $user);\n }", "public function show_profile()\n\t\t{\n\t\t\t$this->db->select('users.ID as uid,users.first_name as firstname,users.last_name as lastname,user_profile.*');\n\t\t $this->db->from('user_profile');\n\t\t $this->db->join(\"users\",'user_profile.user_id = users.ID');\n\t\t //$this->db->join(\"report_spam_profile\",'report_spam_profile.blocked_id = user_profile.user_id');\n\t\t $query \t\t=\t$this->db->get();\n\t\t\t$userdata\t=\t$query->result_array();\n\t\t\tif($userdata)\n\t\t\t{ \t\n\t\t\t\treturn $userdata;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\t\t\t \n\t\t}", "function getUserProfile()\n\t{\n\t\t$response = $this->api->get( 'user/get.json' );\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} returned an error: \" . $this->errorMessageByStatus( $this->api->http_code ), 6 );\n\t\t}\n\n\t\tif ( ! is_object( $response ) || ! isset( $response->id_user ) ){\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response.\", 6 );\n\t\t}\n\n\t\t# store the user profile.\n\t\t$this->user->profile->identifier = (property_exists($response,'id_user'))?$response->id_user:\"\";\n\t\t$this->user->profile->displayName = (property_exists($response,'username'))?$response->username:\"\";\n\t\t$this->user->profile->profileURL = (property_exists($response,'user_url'))?$response->user_url:\"\";\n\t\t$this->user->profile->photoURL = (property_exists($response,'avatar_url'))?$response->avatar_url:\"\";\n//unknown\t\t$this->user->profile->description = (property_exists($response,'description'))?$response->description:\"\";\n\t\t$this->user->profile->firstName = (property_exists($response,'firstname'))?$response->firstname:\"\";\n\t\t$this->user->profile->lastName = (property_exists($response,'name'))?$response->name:\"\";\n\n\t\tif( property_exists($response,'gender') ) {\n\t\t\tif( $response->gender == 1 ){\n\t\t\t\t$this->user->profile->gender = \"male\";\n\t\t\t}\n\t\t\telseif( $response->gender == 2 ){\n\t\t\t\t$this->user->profile->gender = \"female\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->user->profile->gender = \"\";\n\t\t\t}\n\t\t}\n\n\t\t$this->user->profile->language = (property_exists($response,'lang'))?$response->lang:\"\";\n\n\t\tif( property_exists( $response,'birth_date' ) && $response->birth_date ) {\n $birthday = date_parse($response->birth_date);\n\t\t\t$this->user->profile->birthDay = $birthday[\"day\"];\n\t\t\t$this->user->profile->birthMonth = $birthday[\"month\"];\n\t\t\t$this->user->profile->birthYear = $birthday[\"year\"];\n\t\t}\n\n\t\t$this->user->profile->email = (property_exists($response,'email'))?$response->email:\"\";\n\t\t$this->user->profile->emailVerified = (property_exists($response,'email'))?$response->email:\"\";\n\n//unknown\t\t$this->user->profile->phone = (property_exists($response,'unknown'))?$response->unknown:\"\";\n\t\t$this->user->profile->address = (property_exists($response,'address1'))?$response->address1:\"\";\n\t\t$this->user->profile->address .= (property_exists($response,'address2'))?$response->address2:\"\";\n\t\t$this->user->profile->country = (property_exists($response,'country'))?$response->country:\"\";\n//unknown\t\t$this->user->profile->region = (property_exists($response,'unknown'))?$response->unknown:\"\";\n\t\t$this->user->profile->city = (property_exists($response,'city'))?$response->city:\"\";\n\t\t$this->user->profile->zip = (property_exists($response,'postalcode'))?$response->postalcode:\"\";\n\n\t\treturn $this->user->profile;\n\t}", "public function get_userInfo($user_id){\n\n\t\t\t//$user_id=$this->session->userdata('user_id');\n\t\t\t//$profile_type=$this->session->userdata('profile_type');\n\n\n//\t\t\tif(($this->session->userdata('selected_profile_type'))!=''){\n//\t\t\t\t$profile_type=$this->session->userdata('selected_profile_type');\n//\t\t\t}\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/ViewProfile_api/get_userInfo?user_id='.$user_id;\t\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t\treturn $response;\t\n\t\t}", "public function getUserDetails()\n {\n $this->db->select('*');\n $this->db->from('User');\n $this->db->where('email', $this->session->userdata('email'));\n $query = $this->db->get();\n\n $user = new User();\n\n $user->setUserId($query->row_array()['userId']);\n $user->setFirstName($query->row_array()['firstName']);\n $user->setLastName($query->row_array()['lastName']);\n $user->setProfilePicture($query->row_array()['profilePicture']);\n\n return $this->getUserFollowerCount($user);\n }", "function GetUserProfileInfo($access_token) {\t\n\t\t$url = 'https://www.googleapis.com/plus/v1/people/me';\t\t\t\n\t\t\n\t\t$ch = curl_init();\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\t\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer '. $access_token));\n\t\t$data = json_decode(curl_exec($ch), true);\n\t\t$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\t\t\n\t\tif($http_code != 200) \n\t\t\tthrow new Exception('Error : Failed to get user information');\n\t\t\t\n\t\treturn $data;\n\t}", "protected function readUserProfile()\n {\n if (isset($_GET['code'])) {\n $params = array(\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'grant_type' => 'authorization_code',\n 'code' => $_GET['code']\n );\n\n $tokenInfo = $this->post('https://accounts.google.com/o/oauth2/token', $params);\n\n if (isset($tokenInfo['access_token']) && isset($tokenInfo['id_token']))\n {\n $params = array('id_token' => $tokenInfo['id_token']);\n $validateToken = $this->get('https://www.googleapis.com/oauth2/v1/tokeninfo', $params);\n\n if (!isset($validateToken['email'])) {\n return false;\n }\n\n $params = array('access_token' => $tokenInfo['access_token']);\n $userInfo = $this->get('https://www.googleapis.com/plus/v1/people/me', $params);\n\n if (isset($userInfo['kind']) && $userInfo['kind'] == 'plus#person')\n {\n $this->parseUserData($userInfo);\n\n $this->userInfo['email'] = $validateToken['email'];\n\n if (isset($this->response['birthday']))\n {\n $birthDate = explode('-', $this->response['birthday']);\n $this->userInfo['birthDay'] = isset($birthDate[2]) ? $birthDate[2] : null;\n $this->userInfo['birthMonth'] = isset($birthDate[1]) ? $birthDate[1] : null;\n $this->userInfo['birthYear'] = isset($birthDate[0]) ? $birthDate[0] : null;\n }\n\n return true;\n }\n }\n }\n\n return false;\n }", "function user_viewed_by_company_query($company_id='', $viewing_type='', $user_id=\"\", $current_user_id=\"\", $short_type='')\n\t{\n\t\t$sql = \"SELECT MAX(UVC.viewing_date) AS viewing_date, UVC.user_id AS next_user_id,\n\t\t\t\tUVC.id, UVC.user_id, UVC.company_id, UVC.viewing_type, \n\t\t\t\tU.users_firstname, U.users_lastname, IF(U.users_profilepic IS NULL OR U.users_profilepic = '', 'admin-no-image.png', U.users_profilepic)AS users_profilepic,\n\t\t\t\t SUBSTRING_INDEX(U.users_bio, ' ', 4) AS users_bio,\n\t\t\t\t IF(U.users_phone IS NULL OR U.users_phone = '', 'N/A', U.users_phone) AS users_phone, \n\t\t\t\thia_cities.name AS city_name, hia_states.name AS state_name, hia_countries.name AS country_name,\n\t\t\t\tUFC.id AS following_id\n\t\t\t\tFROM hia_user_view_company AS UVC\n\t\t\t\tJOIN hia_users AS U ON( UVC.user_id = U.users_id )\n\t\t\t\t\n\t\t\t\tLEFT JOIN hia_cities ON (U.users_city = hia_cities.id)\n\t\t\t\tLEFT JOIN hia_states ON (U.users_state = hia_states.id)\n\t\t\t\tLEFT JOIN hia_countries ON (U.users_country = hia_countries.id)\n\t\t\t\tLEFT JOIN hia_user_following_company AS UFC ON(U.users_id = UFC.user_id AND UFC.company_id = '$company_id' AND UFC.following_type = 'user' )\n\t\t\t\tWHERE U.users_type != '3'\n\t\t\t\tAND U.users_status != '1' \n\t\t\t\tAND UVC.user_id NOT IN (SELECT user_id FROM hia_user_following_company WHERE company_id = '$company_id' AND following_type = 'company') \";\n\n\t\tif ($viewing_type != \"\") {\n\t\t\t$sql.= \" AND UVC.viewing_type = '$viewing_type' \";\n\t\t}\n\t\t\t\t\n\t\tif ($user_id != \"\") {\n\t\t\t$sql.= \" AND UVC.user_id = '$user_id' \";\n\t\t}\n\t\t\t\t\n\t\tif ($company_id != \"\") {\n\t\t\t$sql.= \" AND UVC.company_id = '$company_id' \";\n\t\t}\n\n\t\tif ($current_user_id != \"\" && $short_type=='next') {\n\t\t\t$sql.= \" AND UVC.user_id > '$current_user_id' \";\n\t\t}\n\t\tif ($current_user_id != \"\" && $short_type=='prev') {\n\t\t\t$sql.= \" AND UVC.user_id < '$current_user_id' \";\n\t\t}\n\n\t\t$sql.= \" GROUP BY UVC.user_id \";\t\n\n\t\t//echo $sql;\n\t\tif ( $short_type=='prev') {\n\t\t\t$sql.= \" ORDER BY UVC.user_id DESC \";\n\t\t}\n\t\telse {\n\t\t\t$sql.= \" ORDER BY UVC.user_id ASC \";\n\t\t}\n\n\n\n\n\t\tif ( ! $this->db->simple_query($sql))\n\t\t{\n\t\t\t$error = $this->db->error();\n\t\t\t//print_r($error);\n\t\t\t//exit();\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = $this->db->query($sql);\n\t\t\t\n\t\t\treturn $query->result_array();\n\t\t}\n\t\t\n\t}" ]
[ "0.69692224", "0.681772", "0.68147206", "0.6642474", "0.6641549", "0.6616106", "0.6592096", "0.6578135", "0.65147585", "0.65020126", "0.6415147", "0.63887554", "0.6384892", "0.63510466", "0.63503665", "0.63234943", "0.63196564", "0.62999815", "0.6288087", "0.627537", "0.6254172", "0.62507945", "0.62499905", "0.6240447", "0.62343067", "0.62287366", "0.62139076", "0.6207652", "0.6199584", "0.61974055" ]
0.68177974
1
Get RPX Domestic Rates from Origin to Destination with a Specific Weight and Discount
public function getRates( string $origin, string $destination, ?string $service_type, ?float $weight, ?float $disc ) { $data = compact('origin', 'destination', 'service_type', 'weight', 'disc'); return $this->send('POST', 'getRates', $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getWeights($visits, $conversions, $xSales, $revenue, $sumSqRev);", "public function getRate(Mage_Shipping_Model_Rate_Request $request)\n\t{\n\t \n $adapter = $this->_getReadAdapter();\n $bind = array(\n ':website_id' => (int) $request->getWebsiteId(),\n ':country_id' => $request->getDestCountryId(),\n ':region_id' => (int) $request->getDestRegionId(),\n ':postcode' => $request->getDestPostcode()\n );\n $select = $adapter->select()\n ->from(Mage::getSingleton('core/resource')->getTableName('correos/correos'))\n ->where('website_id = :website_id')\n ->order(array('dest_country_id DESC', 'dest_region_id DESC', 'dest_zip DESC'))\n ->limit(1);\n\n // Render destination condition\n $orWhere = '(' . implode(') OR (', array(\n \"dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode\",\n \"dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''\",\n\n // Handle asterix in dest_zip field\n \"dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = '*'\",\n \"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'\",\n \"dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = '*'\",\n \"dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'\",\n\n \"dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = ''\",\n\n \"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = ''\",\n \"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = :postcode\",\n \"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'\",\n )) . ')';\n $select->where($orWhere);\n \n \n // Render condition by condition name\n if (is_array($request->getConditionName())) {\n $orWhere = array();\n $i = 0;\n foreach ($request->getConditionName() as $conditionName) {\n $bindNameKey = sprintf(':condition_name_%d', $i);\n $bindValueKey = sprintf(':condition_value_%d', $i);\n $orWhere[] = \"(condition_name = {$bindNameKey} AND condition_value <= {$bindValueKey})\";\n $bind[$bindNameKey] = $conditionName;\n $bind[$bindValueKey] = $request->getData($conditionName);\n $i++;\n }\n\n if ($orWhere) {\n $select->where(implode(' OR ', $orWhere));\n }\n } else {\n $bind[':condition_name'] = $request->getConditionName();\n $bind[':condition_value'] = $request->getData($request->getConditionName());\n\n $select->where('condition_name = :condition_name');\n $select->where('condition_value <= :condition_value');\n $select->where('method_code=?', $request->getMethodCode());\n }\n\n $result = $adapter->fetchRow($select, $bind);\n \n \n // log\n Mage::helper('correos')->_logger('Consulta de petición de rates [' . $request->getMethodCode() . ']');\n $adapter->getProfiler()->setEnabled(true); //enable profiler\n Mage::helper('correos')->_logger($adapter->getProfiler()->getLastQueryProfile());\n \n \n // Normalize destination zip code\n if ($result && $result['dest_zip'] == '*') {\n $result['dest_zip'] = '';\n }\n return $result;\n \n\t}", "public function getRatesPostalCode(\n string $origin_postal_code,\n string $destination_postal_code,\n ?string $service_type,\n ?float $weight,\n ?float $disc\n ) {\n $format = $this->format;\n $account_number = $this->account_number;\n $data = compact(\n 'origin_postal_code',\n 'destination_postal_code',\n 'service_type',\n 'weight',\n 'disc',\n 'format',\n 'account_number'\n );\n\n return $this->send('POST', 'getRatesPostalCode', $data);\n }", "public function getFlightsCustom($start_date, $end_date, $origin, $destination)\n {\n /*\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT p FROM FlyingMainBundle:Flights p\n WHERE p.active = 1\n AND p.date >= :start_date AND p.date <= :end_date\n AND p.origin = :origin AND p.destination = :destination'\n )->setParameters(array('start_date' => $start_date, 'end_date' => $end_date, 'origin' => $origin, 'destination' => $destination));\n */\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT p FROM FlyingMainBundle:Flights p\n WHERE p.price > 0 AND p.flightNumber != :na\n AND p.active = 1\n AND p.date >= :start_date AND p.date <= :end_date\n AND p.origin = :origin AND p.destination = :destination'\n )->setParameters(array('na' => 'NA', 'start_date' => $start_date, 'end_date' => $end_date, 'origin' => $origin, 'destination' => $destination));\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n\n }", "public function getRates()\n {\n return (new Rates)->fetchRates(); \n }", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\r\n {\r\r\n\t\tif (!$this->getConfigFlag('active')) \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\r\n\t\t$result = Mage::getModel('shipping/rate_result');\t\t\r\r\n\t\t// Switch between domestic and international shipping methods based\r\t\t// on destination country.\r\t\t//if($destCountry == \"AU\")\r\n\t\t//{\r\r\n\t\t\t$arr_resp = $this->_drcRequest($request);\r\n\t\t\t\t$quote_count = ((int) $arr_resp[\"QUOTECOUNT\"]) - 1;\r\r\r\n\t\t\t\t# ASSIGNING VALUES TO ARRAY METHODS \r\n\t\t\t\tfor ($x=0; $x<=$quote_count; $x++){\t\r\r\n\t\t\t\t\t$title = $this->getConfigData('name') . \" \" . \r\t\t\t\t\tucfirst(strtolower($arr_resp[\"QUOTE($x)_ESTIMATEDTRANSITTIME\"])) ;\r\n\t\t\t\t\t$method = $this->_createMethod($request, $x, $title, $arr_resp[\"QUOTE({$x})_TOTAL\"], $arr_resp[\"QUOTE({$x})_TOTAL\"]);\r\t\t\t\t\t$result->append($method);\r\r\n\t\t\t\t}\r\r\n //}\r\r\n return $result;\r\n }", "public function getRate($orderPrice, $orderWeight, Varien_Object $config ) \n { \n $code = $config->getSystemPath();\n Mage::log(\"destination coutnry {$config->getDestCountry()}\");\n if($config->getMultiprices()){\n $ratePath = sprintf('carriers/%s/price_%s',$code, $config->getDestCountry());\n }else{\n $ratePath = sprintf('carriers/%s/%s',$code, $config->getPriceCode());\n }\n \n $result = Mage::getStoreConfig($ratePath);\n if(!$result){\n Mage::log(\"no rate for code $code and path $ratePath\" );\n \n return FALSE;\n }\n $pickupShippingRates = unserialize($result); \n if (is_array($pickupShippingRates) && !empty($pickupShippingRates)) {\n foreach ($pickupShippingRates as $pickupShippingRate) {\n if( (float)$pickupShippingRate['orderminprice'] <= (float)$orderPrice\n && ( (float)$pickupShippingRate['ordermaxprice'] >= (float)$orderPrice || (float)$pickupShippingRate['ordermaxprice'] == 0)\n && (float)$pickupShippingRate['orderminweight'] <= (float)$orderWeight\n && ( (float)$pickupShippingRate['ordermaxweight'] >= (float)$orderWeight || (float)$pickupShippingRate['ordermaxweight'] == 0)\n ) {\n return $pickupShippingRate['price'];\n }\n }\n }\n }", "abstract public function getExchangeRate($fromCurrency, $toCurrency);", "public function calculateRates(ShipmentInterface $shipment);", "public function getStoreToOrderRate();", "public function getRates()\n {\n $this->uri = \"/?section=shipping&action=getRates\";\n \n return $this->send();\n }", "function get_flight_inter_from_ws($depcode, $arvcode, $outbound_date, $inbound_date, $adult, $child, $infant, $triptype='ROUND_TRIP', $format='json'){\n\t\n\t$outbound_date = str_replace('/','-',$outbound_date);\n\t$inbound_date = isset($inbound_date) && !empty($inbound_date) ? str_replace('/','-',$inbound_date) : $outbound_date;\n\t$api_key = '70cd2199f6dc871824ea9fed45170af354ffe9e6';\n\t$supplier = 'hnh';\n\t\n\t$url = 'http://api.vemaybaynamphuong.com/index.php/apiv1/api/flight_search_inter/format/'.$format;\n\t$url .= '/supplier/'.$supplier;\n\t$url .= '/depcode/'.$depcode;\n\t$url .= '/arvcode/'.$arvcode;\n\t$url .= '/outbound_date/'.$outbound_date;\n\t$url .= '/inbound_date/'.$inbound_date;\n\t$url .= '/adult/'.$adult;\n\tif($child > 0){\n\t\t$url .= '/child/'.$child;\n\t}\n\tif($infant > 0){\n\t\t$url .= '/infant/'.$infant;\n\t}\n\t$url .= '/triptype/'.$triptype;\n\t\n\t$curl_handle = curl_init();\n\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\n\tcurl_setopt($curl_handle, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);\n\tcurl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('X-API-KEY: '.$api_key));\n\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\n\t$buffer = curl_exec($curl_handle);\n\tcurl_close($curl_handle);\n\t$result = json_decode($buffer, true);\n\treturn $result;\n}", "function daylist_get() {\n $condition = \"\";\n $fromdate = $this->get('fromdate');\n $todate = $this->get('todate');\n $status = $this->get('status');\n $store = $this->get('store');\n $total_cost = 0.00;\n\n if ($status != \"\") {\n if ($status == \"Delivered\") {\n $condition .= \" and o.status='Delivered' and o.delivery_accept='1' \"; // and delivery_recieved='1'\n }else if ($status == \"Rejected\") {\n $condition .= \" and o.status='Delivered' and o.delivery_reject='1'\";\n }else{\n $condition .= \" and o.status='$status'\"; \n }\n \n };\n \n\n if ($store != \"\")\n $condition .= \" and o.orderedby='$store'\";\n if ($fromdate != \"\" && $todate == \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n } else if ($fromdate != \"\" && $todate != \"\") {\n $fromdate = date(\"Y-m-d\", strtotime($fromdate));\n $todate = date(\"Y-m-d\", strtotime($todate));\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$todate 23:59:59'\";\n }\n } else if ($fromdate == \"\" && $todate == \"\") {\n\n $fromdate = date(\"Y-m-d\");\n if($status == \"Delivered\") {\n $condition .= \" and o.`deliveredon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }else{\n $condition .= \" and o.`orderedon` between '$fromdate 00:00:00' and '$fromdate 23:59:59'\";\n }\n \n }\n // echo \"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\";\n $result_set = $this->model_all->getTableDataFromQuery(\"select o.id,o.order_id,o.`orderedon`,s.name as store,o.order_value from orders o,stores s where o.orderedby = s.id $condition\");\n //echo $this->db->last_query();\n if ($result_set->num_rows() > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"total_records\"] = $result_set->num_rows();\n foreach ($result_set->result_array() as $row) {\n $row['orderedon'] = date(\"d-m-Y\", strtotime($row['orderedon']));\n $total_cost = $total_cost + $row['order_value'];\n $result[\"records\"][] = $row;\n }\n $result[\"total_cost\"] = \"Rs \" . $total_cost . \" /-\";\n\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"No records Found\";\n $this->response($result, 200);\n exit;\n }\n }", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }", "function it_finds_a_daily_rate_price_from_date_range_rate()\n {\n $dailyPrice = Price::fromString('10', Currency::fromString('EUR'));\n $equipment = new Equipment('Jack Hammer', new Rate(null, $dailyPrice, 1));\n\n $rentalQuery = new RentalQuery(\n $equipment,\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-01'), new \\DateTime('2014-07-07'), 1)\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($dailyPrice);\n\n //////////\n $tempPrice = Price::fromString('8', Currency::fromString('EUR'));\n $equipment->addRate(\n RentalPeriod::fromDateTime(new \\DateTime('2014-07-04'), new \\DateTime('2014-07-10')),\n $tempPrice,\n 1\n );\n\n $quotes = $this->getQuotesFor($rentalQuery);\n $quote = $quotes[0];\n\n /** @var RateQuote $quote */\n $quote->getLineItems()->shouldHaveCount(1);\n $lineItems = $quote->getLineItems();\n /** @var RateQuoteLineItem $lineItem */\n $lineItem = $lineItems[0];\n $lineItem->getRate()->getPrice()->equals($tempPrice);\n\n }", "public function getCost(array $origin, array $destination, $metrics, $courier)\n {\n $params[ 'courier' ] = strtolower($courier);\n\n $params[ 'originType' ] = strtolower(key($origin));\n $params[ 'destinationType' ] = strtolower(key($destination));\n\n if ($params[ 'originType' ] !== 'city') {\n $params[ 'originType' ] = 'subdistrict';\n }\n\n if ( ! in_array($params[ 'destinationType' ], ['city', 'country'])) {\n $params[ 'destinationType' ] = 'subdistrict';\n }\n\n if (is_array($metrics)) {\n if ( ! isset($metrics[ 'weight' ]) AND\n isset($metrics[ 'length' ]) AND\n isset($metrics[ 'width' ]) AND\n isset($metrics[ 'height' ])\n ) {\n $metrics[ 'weight' ] = (($metrics[ 'length' ] * $metrics[ 'width' ] * $metrics[ 'height' ]) / 6000) * 1000;\n } elseif (isset($metrics[ 'weight' ]) AND\n isset($metrics[ 'length' ]) AND\n isset($metrics[ 'width' ]) AND\n isset($metrics[ 'height' ])\n ) {\n $weight = (($metrics[ 'length' ] * $metrics[ 'width' ] * $metrics[ 'height' ]) / 6000) * 1000;\n\n if ($weight > $metrics[ 'weight' ]) {\n $metrics[ 'weight' ] = $weight;\n }\n }\n\n foreach ($metrics as $key => $value) {\n $params[ $key ] = $value;\n }\n } elseif (is_numeric($metrics)) {\n $params[ 'weight' ] = $metrics;\n }\n\n switch ($this->accountType) {\n case 'starter':\n\n if ($params[ 'destinationType' ] === 'country') {\n $this->errors[ 301 ] = 'Unsupported International Destination. Tipe akun starter tidak mendukung pengecekan destinasi international.';\n\n return false;\n } elseif ($params[ 'originType' ] === 'subdistrict' OR $params[ 'destinationType' ] === 'subdistrict') {\n $this->errors[ 302 ] = 'Unsupported Subdistrict Origin-Destination. Tipe akun starter tidak mendukung pengecekan ongkos kirim sampai kecamatan.';\n\n return false;\n }\n\n if ( ! isset($params[ 'weight' ]) AND\n isset($params[ 'length' ]) AND\n isset($params[ 'width' ]) AND\n isset($params[ 'height' ])\n ) {\n $this->errors[ 304 ] = 'Unsupported Dimension. Tipe akun starter tidak mendukung pengecekan biaya kirim berdasarkan dimensi.';\n\n return false;\n } elseif (isset($params[ 'weight' ]) AND $params[ 'weight' ] > 30000) {\n $this->errors[ 305 ] = 'Unsupported Weight. Tipe akun starter tidak mendukung pengecekan biaya kirim dengan berat lebih dari 30000 gram (30kg).';\n\n return false;\n }\n\n if ( ! in_array($params[ 'courier' ], $this->supportedCouriers[ $this->accountType ])) {\n $this->errors[ 303 ] = 'Unsupported Courier. Tipe akun starter tidak mendukung pengecekan biaya kirim dengan kurir ' . $this->couriersList[ $courier ] . '.';\n\n return false;\n }\n\n break;\n\n case 'basic':\n\n if ($params[ 'originType' ] === 'subdistrict' OR $params[ 'destinationType' ] === 'subdistrict') {\n $this->errors[ 302 ] = 'Unsupported Subdistrict Origin-Destination. Tipe akun basic tidak mendukung pengecekan ongkos kirim sampai kecamatan.';\n\n return false;\n }\n\n if ( ! isset($params[ 'weight' ]) AND\n isset($params[ 'length' ]) AND\n isset($params[ 'width' ]) AND\n isset($params[ 'height' ])\n ) {\n $this->errors[ 304 ] = 'Unsupported Dimension. Tipe akun basic tidak mendukung pengecekan biaya kirim berdasarkan dimensi.';\n\n return false;\n } elseif (isset($params[ 'weight' ]) AND $params[ 'weight' ] > 30000) {\n $this->errors[ 305 ] = 'Unsupported Weight. Tipe akun basic tidak mendukung pengecekan biaya kirim dengan berat lebih dari 30000 gram (30kg).';\n\n return false;\n } elseif (isset($params[ 'weight' ]) AND $params[ 'weight' ] < 30000) {\n unset($params[ 'length' ], $params[ 'width' ], $params[ 'height' ]);\n }\n\n if ( ! in_array($params[ 'courier' ], $this->supportedCouriers[ $this->accountType ])) {\n $this->errors[ 303 ] = 'Unsupported Courier. Tipe akun basic tidak mendukung pengecekan biaya kirim dengan kurir ' . $this->couriersList[ $courier ] . '.';\n\n return false;\n }\n\n break;\n }\n\n $params[ 'origin' ] = $origin[ key($origin) ];\n $params[ 'destination' ] = $destination[ key($destination) ];\n\n $path = key($destination) === 'country' ? 'internationalCost' : 'cost';\n\n return $this->request($path, $params, 'POST');\n }", "public function getShippingRate();", "public function getRoiSources()\n {\n //get DBO\n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n\n //construct query string\n $query->select(\"s.id,s.name,count(d.id) as number_of_deals,sum(d.amount) as revenue,s.type,s.cost\");\n $query->select(\"IF ( s.type <> 'per', ( ( ( ( sum(d.amount) - s.cost ) / s.cost ) * 100 ) ), ( ( sum(d.amount) - ( s.cost * count(d.id) ) ) / ( s.cost * count(d.id) ) * 100 ) ) AS roi\");\n $query->from(\"#__sources AS s\");\n\n //left join data\n $won_stage_ids = DealHelper::getWonStages();\n $query->leftJoin(\"#__deals AS d ON d.source_id = s.id AND d.stage_id IN (\".implode(',',$won_stage_ids).\") AND d.published=1 AND d.archived=0\");\n $query->leftJoin(\"#__users AS u ON u.id = d.owner_id\");\n\n //set our sorting direction if set via post\n $query->order($this->getState('Source.filter_order') . ' ' . $this->getState('Source.filter_order_Dir'));\n\n //group data\n $query->group(\"s.id\");\n\n if ($this->_id) {\n if ( is_array($this->_id) ) {\n $query->where(\"s.id IN (\".implode(',',$this->_id).\")\");\n } else {\n $query->where(\"s.id=$this->_id\");\n }\n }\n\n //filter based on member access roles\n $user_id = UsersHelper::getUserId();\n $member_role = UsersHelper::getRole();\n $team_id = UsersHelper::getTeamId();\n\n if ($member_role != 'exec') {\n\n if ($member_role == 'manager') {\n $query->where(\"u.team_id=$team_id\");\n } else {\n $query->where(\"(d.owner_id=$user_id)\");\n }\n\n }\n\n //set query and load results\n $db->setQuery($query);\n $results = $db->loadAssocList();\n\n return $results;\n }", "public function getRate($destination, $weight)\n {\n $result = false;\n\n // Get rate per grams\n $identifier = $destination == 'manila' ? 'intra-province' : 'inter-land';\n $result = $this->_getRate($identifier, $weight);\n\n return $result;\n }", "public function collectFreightRates(Mage_Shipping_Model_Rate_Request $request)\n {\n \t$freightRateConfig=Mage::getStoreConfig('carriers/freightrate'); \t\n\t\t$items = $request->getAllItems();\n \t\n \tif (!$freightRateConfig['active'] || sizeof($request->getAllItems())<1 || !Mage::helper('freightrate')->customerGroupApplies($items)\n \t\t|| !$request->getDropshipCollecting() ) { \n \t\treturn $this->collectDropshipRates($request);\n \t}\n \t\n \t$limitCarrier = $request->getLimitCarrier();\n \tif (is_array($limitCarrier) && !in_array('freightrate',$limitCarrier)) {\n \t\treturn $this->collectDropshipRates($request);\n \t}\n\n \t// else want to restrict what's sent to the carriers\n \t$newRequest = clone $request;\n \t$freightModel = Mage::getModel('freightrate/freightrate');\n \t$nonFreightItemPresent = false;\n \t$this->_freightFound=false;\n \t$exceedsMinOrder = false;\n \t$this->_debug = Mage::helper('wsalogger')->isDebug('Webshopapps_Freightrate');\n \t \t\n \tif (Mage::helper('freightrate')->cartExceedsMinOrder($request)) {\n \t\t$exceedsMinOrder = true;\n \t}\n \t\n \tif ($freightModel->getNonFreightItems($newRequest,$nonFreightItemPresent) ) {\n \t\t$this->_freightFound=true; \t\n \t}\n \t\n \tif (!$this->_freightFound && !$exceedsMinOrder) {\n \t\treturn $this->collectDropshipRates($request);\n \t}\n \tif (!Mage::helper('wsacommon')->checkItems('Y2FycmllcnMvZnJlaWdodHJhdGUvc2hpcF9vbmNl',\n \t'aG9yc2VzaG9l','Y2FycmllcnMvZnJlaWdodHJhdGUvc2VyaWFs')) { return $this->collectDropshipRates($request); }\n \n \tif (($nonFreightItemPresent && !Mage::getStoreConfig('carriers/freightrate/force_freight')) &&\n \t\tMage::helper('freightrate')->showOtherRates($exceedsMinOrder)) {\n\t $this->collectDropshipRates($request);\n \t} \t\n \t\n $myResults=$this->getResult();\n if ( (!$exceedsMinOrder || $this->_freightFound) && !empty($myResults) &&\n\t\t \t\t\tis_array($myResults->getAllRates()) && count($myResults->getAllRates())) {\n\n\t \t\t$rates=$myResults->getAllRates();\n\t \t\tforeach ($rates as $rate) {\n \t\t\t if ($rate instanceof Mage_Shipping_Model_Rate_Result_Method) {\n\t\t \t\t\treturn $this;\n\t\t \t\t}\n\t \t\t}\n \t }\n \t // otherwise not found rate, so use freightrate\n \t$carrier = $this->getCarrierByCode(\"freightrate\", $newRequest->getStoreId());\n \t$this->getResult()->append($carrier->collectFreightRates($newRequest));\n $error = Mage::getModel('shipping/rate_result_error');\n $error->setCarrier(\"freightrate\");\n $error->setCarrierTitle($carrier->getCarrierTitle());\n $error->setErrorMessage($freightModel->getDisclaimer());\n $this->getResult()->append($error);\n \n return $this;\n \t\n \t\n }", "function get_flight_from_ws($airline, $depcode, $descode, $depdate, $retdate, $direction=1, $format='json'){\n\t\n\t$airline = strtoupper(trim($airline));\n\t$depcode = strtoupper(trim($depcode));\n\t$descode = strtoupper(trim($descode));\n\t$depdate = str_replace('/','-',$depdate);\n\t$retdate = isset($retdate) && !empty($retdate) ? str_replace('/','-',$retdate) : $depdate; \n\t$api_key = '70cd2199f6dc871824ea9fed45170af354ffe9e6';\n \n $timeout = 30;\n \n\tif ($airline == 'VN' || $airline == 'QH') {\n $urls = array(\n // 'http://fs2.vietjet.net',\n 'http://fs3.vietjet.net',\n 'http://fs4.vietjet.net',\n 'http://fs5.vietjet.net',\n 'http://fs6.vietjet.net',\n 'http://fs7.vietjet.net',\n 'http://fs8.vietjet.net',\n 'http://fs9.vietjet.net',\n 'http://fs10.vietjet.net',\n 'http://fs11.vietjet.net',\n 'http://fs12.vietjet.net',\n 'http://fs13.vietjet.net',\n 'http://fs14.vietjet.net',\n 'http://fs15.vietjet.net',\n 'http://fs16.vietjet.net',\n 'http://fs17.vietjet.net',\n 'http://fs18.vietjet.net',\n 'http://fs19.vietjet.net',\n 'http://fs20.vietjet.net',\n 'http://fs21.vietjet.net',\n 'http://fs22.vietjet.net',\n 'http://fs23.vietjet.net',\n 'http://fs24.vietjet.net',\n 'http://fs25.vietjet.net',\n 'http://fs26.vietjet.net',\n 'http://fs27.vietjet.net',\n 'http://fs28.vietjet.net',\n 'http://fs29.vietjet.net',\n 'http://fs30.vietjet.net',\n );\n } else if ($airline == 'VJ' || $airline == 'BL'){\n $timeout = 35;\n $urls = array(\n 'http://fs2.vietjet.net',\n );\n }\n\n shuffle($urls);\n $url = $urls[array_rand($urls)];\n\t$url .= '/index.php/apiv1/api/flight_search/format/'.$format;\n\t$url .= '/airline/'.$airline.'/depcode/'.$depcode.'/descode/'.$descode.'/departdate/'.$depdate.'/returndate/'.$retdate.'/direction/'.$direction;\n\n\t$curl_handle = curl_init();\n\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\n\tcurl_setopt($curl_handle, CURLOPT_ENCODING, 'gzip');\n\tcurl_setopt($curl_handle, CURLOPT_TIMEOUT, $timeout);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, $timeout);\n\tcurl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('X-API-KEY: '.$api_key));\n\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $buffer = curl_exec($curl_handle);\n\n curl_close($curl_handle);\n $result = json_decode($buffer, true);\n\n\treturn $result;\n}", "protected function dataSource()\n {\n $range = $this->sibling(\"PaymentDateRange\")->value();\n\n //Apply to query\n return AutoMaker::table(\"payments\")\n ->join(\"customers\",\"customers.customerNumber\",\"=\",\"payments.customerNumber\")\n ->whereBetween(\"paymentDate\",$range)\n ->select(\"customerName\",\"paymentDate\",\"checkNumber\",\"amount\");\n }", "function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('cost/find', array(\r\n 'from' =&amp;gt; $from,\r\n 'to' =&amp;gt; $to,\r\n 'weight' =&amp;gt; $weight.'000',\r\n 'courier' =&amp;gt; 'jne',\r\n'API-Key' =&amp;gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&amp;gt;origin . ' ke ' . $city-&amp;gt;destination . '&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;';\r\n \r\n foreach ($prices-&amp;gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&amp;gt;service . ', dengan harga : Rp. ' . $item-&amp;gt;value . ',- &amp;lt;br /&amp;gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "public function prepare_generateRatesBreakDown($params)\n\t{\n\t\t$xml_string = \"p_VillaID=\".$params['p_VillaID'].\"&p_CIDate=\".$params['p_CIDate'].\"&p_CODate=\".$params['p_CODate'].\"\";\n\t\treturn $xml_string;\n\t}", "function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n global $customer_zone_id, $customer_country_id;\n\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n }\n\n $Qtax = Registry::get('Db')->prepare('select sum(tax_rate) as tax_rate from :table_tax_rates tr left join :table_zones_to_geo_zones za on tr.tax_zone_id = za.geo_zone_id left join :table_geo_zones tz on tz.geo_zone_id = tr.tax_zone_id where (za.zone_country_id IS NULL OR za.zone_country_id = \"0\" OR za.zone_country_id = :zone_country_id) AND (za.zone_id IS NULL OR za.zone_id = \"0\" OR za.zone_id = :zone_id) AND tr.tax_class_id = :tax_class_id group by tr.tax_priority');\n $Qtax->bindInt(':zone_country_id', (int)$country_id);\n $Qtax->bindInt(':zone_id', (int)$zone_id);\n $Qtax->bindInt(':tax_class_id', (int)$class_id);\n $Qtax->execute();\n\n if ($Qtax->fetch() !== false) {\n $tax_multiplier = 0;\n\n do {\n $tax_multiplier += $Qtax->value('tax_rate');\n } while ($Qtax->fetch());\n\n return $tax_multiplier;\n } else {\n return 0;\n }\n }", "public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }", "public function getFlightsCustomAll($start_date, $end_date, $origin, $destination, $update_date_only)\n {\n \n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT p FROM FlyingMainBundle:Flights p\n WHERE p.active = 1\n AND p.date >= :start_date AND p.date <= :end_date\n AND p.origin = :origin AND p.destination = :destination\n AND p.lastUpdated <= :update_date_only'\n )->setParameters(array('start_date' => $start_date, 'end_date' => $end_date, 'origin' => $origin, 'destination' => $destination, 'update_date_only' => $update_date_only));\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n\n }", "public function getIncludedDiscounts();", "function calculate($shipping) {\n\t\t\t// Packages - make sure they don't exceed maximum\n\t\t\t$packages = $shipping->packages;\n\t\t\tif($this->package_max) $packages = $shipping->packages_max($packages,$this->package_max);\n\t\t\t\n\t\t\t// Missing credentials\n\t\t\tif(!$this->username) {\n\t\t\t\tthrow new \\Exception(\"USPS username is missing.\");\t\n\t\t\t}\n\t\t\t// Missing shipping object\n\t\t\tif(!$shipping) {\n\t\t\t\tthrow new \\Exception(\"No 'shipping' object passed.\");\n\t\t\t}\n\t\t\t// No methods\n\t\t\tif(!$this->methods) {\n\t\t\t\tthrow new \\Exception(\"No shipping methods defined.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Rates\n\t\t\t$rates = NULL;\n\t\t\t\t\n\t\t\t// Strip - characters they add in to their 'codes' that we don't want\n\t\t\t$strip = array(\n\t\t\t\t'&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt;',\n\t\t\t\t'&amp;lt;sup&amp;gt;&amp;amp;trade;&amp;lt;/sup&amp;gt;',\n\t\t\t\t'&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;',\n\t\t\t\t'&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;',\n\t\t\t\t' 1-Day',\n\t\t\t\t' 2-Day',\n\t\t\t\t' 3-Day',\n\t\t\t\t' Military',\n\t\t\t\t' DPO',\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\t\t\t\n\t\t\t// Countries - United States - US territories that have their own country code\n\t\t\t$countries_us = array(\n\t\t\t\t'AS', // Samoa American\n\t\t\t\t'GU', // Guam\n\t\t\t\t'MP', // Northern Mariana Islands\n\t\t\t\t'PW', // Palau\n\t\t\t\t'PR', // Puerto Rico\n\t\t\t\t'VI' // Virgin Islands US\n\t\t\t);\n\t\t\t\n\t\t\t// United States (and US territories)\n\t\t\tif($shipping->to_country == \"US\" or in_array($shipping->to_country,$countries_us)) {\n\t\t\t\t$url = \"http://production.shippingapis.com/ShippingAPI.dll\";\n\t\t\t\t$xml = '\n\t<RateV4Request USERID=\"'.$this->username.'\">';\n\t\t\t\tforeach($packages as $x => $package) {\n\t\t\t\t\t// Weight (in lbs) - already in lbs, but just in case\n\t\t\t\t\t$weight = $shipping->convert_weight($package['weight'],$package['weight_unit'],'lb');\n\t\t\t\t\t// Split into lbs and ozs\n\t\t\t\t\t$lbs = floor($weight);\n\t\t\t\t\t$ozs = ($weight - $lbs) * 16;\n\t\t\t\t\tif($lbs == 0 and $ozs < 1) $ozs = 1;\n\t\t\t\t\t\n\t\t\t\t\t// Dimensions - have to re-convert here because requires a minimum of 1\n\t\t\t\t\t$width = $shipping->convert_dimensions($package['dimensions_width'],$package['dimensions_unit'],\"in\",1);\n\t\t\t\t\t$length = $shipping->convert_dimensions($package['dimensions_length'],$package['dimensions_unit'],\"in\",1);\n\t\t\t\t\t$height = $shipping->convert_dimensions($package['dimensions_height'],$package['dimensions_unit'],\"in\",1);\n\t\t\t\t\t// Package size\n\t\t\t\t\t$size = 'REGULAR';\n\t\t\t\t\tif($width > 12 or $length > 12 or $height > 12) $size = \"LARGE\";\n\t\t\t\t\t// Package container\n\t\t\t\t\tif($size == \"LARGE\") $container = 'RECTANGULAR';\n\t\t\t\t\t\n\t\t\t\t\t// XML\n\t\t\t\t\t$xml .= '\n\t\t<Package ID=\"'.($x + 1).'\">\n\t\t\t<Service>'.(/*count($this->methods) == 1 ? reset($this->methods) : */\"ALL\").'</Service>\n\t\t\t<ZipOrigination>'.$shipping->from_zip.'</ZipOrigination>\n\t\t\t<ZipDestination>'.$shipping->to_zip.'</ZipDestination>\n\t\t\t<Pounds>'.$lbs.'</Pounds>\n\t\t\t<Ounces>'.$ozs.'</Ounces>\n\t\t\t<Container>'.(isset($container) ? $container : '').'</Container>\n\t\t\t<Size>'.$size.'</Size>\n\t\t\t<Width>'.$width.'</Width> \n\t\t\t<Length>'.$length.'</Length> \n\t\t\t<Height>'.$height.'</Height> \n\t\t\t<Machinable>TRUE</Machinable>\n\t\t</Package>';\n\t\t\t\t}\n\t\t\t\t$xml .= '\n\t</RateV4Request>';\n\t\t\t\t$data = \"API=RateV4&XML=\".$xml;\n\t\t\t\n\t\t\t\t// Curl\n\t\t\t\t$results = $shipping->curl($url,$data);\n\t\t\t\t\n\t\t\t\t// Debug\n\t\t\t\tif($shipping->debug) {\n\t\t\t\t\tprint \"xml: <xmp>\".$xml.\"</xmp><br />\";\n\t\t\t\t\tprint \"results: <xmp>\".$results.\"</xmp><br />\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Match rate(s)\n\t\t\t\tpreg_match_all('/<Package ID=\"([0-9]{1,3})\">(.+?)<\\/Package>/s',$results,$results_packages);\n\t\t\t\tforeach($results_packages[2] as $x => $results_package) {\n\t\t\t\t\tpreg_match_all('/<Postage CLASSID=\"([0-9]{1,3})\">(.+?)<\\/Postage>/s',$results_package,$results_methods);\n\t\t\t\t\tforeach($results_methods[2] as $y => $results_method) {\n\t\t\t\t\t\t// Name\n\t\t\t\t\t\tpreg_match('/<MailService>(.+?)<\\/MailService>/',$results_method,$name);\n\t\t\t\t\t\t$name = str_replace($strip,'',$name[1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Use name, get rate\n\t\t\t\t\t\tif($name and in_array($name,$this->methods)) {\n\t\t\t\t\t\t\tpreg_match('/<Rate>(.+?)<\\/Rate>/',$results_method,$rate);\n\t\t\t\t\t\t\tif($rate[1]) {\n\t\t\t\t\t\t\t\tif($this->package_fits($shipping,$packages,$name)) {\n\t\t\t\t\t\t\t\t\tif(!isset($rates['rates'][$name])) $rates['rates'][$name] = 0;\n\t\t\t\t\t\t\t\t\t$rates['rates'][$name] += $rate[1];\n\t\t\t\t\t\t\t\t\t$rates['packages'][$x]['package'] = $packages[$x];\n\t\t\t\t\t\t\t\t\tif(!isset($rates['packages'][$x]['rates'][$name])) $rates['packages'][$x]['rates'][$name] = 0;\n\t\t\t\t\t\t\t\t\t$rates['packages'][$x]['rates'][$name] += $rate[1];\n\t\t\t\t\t\t\t\t\tif(!isset($rates['names'][$name])) $rates['names'][$name] = $this->name($name);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// International\n\t\t\telse {\n\t\t\t\t// Counties - need to pass country name, not code\n\t\t\t\t $countries = array(\n\t\t\t\t\t'AF' => 'Afghanistan',\n\t\t\t\t\t'AL' => 'Albania',\n\t\t\t\t\t'AX' => 'Aland Island (Finland)',\n\t\t\t\t\t'DZ' => 'Algeria',\n\t\t\t\t\t'AD' => 'Andorra',\n\t\t\t\t\t'AO' => 'Angola',\n\t\t\t\t\t'AI' => 'Anguilla',\n\t\t\t\t\t'AG' => 'Antigua and Barbuda',\n\t\t\t\t\t'AR' => 'Argentina',\n\t\t\t\t\t'AM' => 'Armenia',\n\t\t\t\t\t'AW' => 'Aruba',\n\t\t\t\t\t'AU' => 'Australia',\n\t\t\t\t\t'AT' => 'Austria',\n\t\t\t\t\t'AZ' => 'Azerbaijan',\n\t\t\t\t\t'BS' => 'Bahamas',\n\t\t\t\t\t'BH' => 'Bahrain',\n\t\t\t\t\t'BD' => 'Bangladesh',\n\t\t\t\t\t'BB' => 'Barbados',\n\t\t\t\t\t'BY' => 'Belarus',\n\t\t\t\t\t'BE' => 'Belgium',\n\t\t\t\t\t'BZ' => 'Belize',\n\t\t\t\t\t'BJ' => 'Benin',\n\t\t\t\t\t'BM' => 'Bermuda',\n\t\t\t\t\t'BT' => 'Bhutan',\n\t\t\t\t\t'BO' => 'Bolivia',\n\t\t\t\t\t'BA' => 'Bosnia-Herzegovina',\n\t\t\t\t\t'BW' => 'Botswana',\n\t\t\t\t\t'BR' => 'Brazil',\n\t\t\t\t\t'VG' => 'British Virgin Islands',\n\t\t\t\t\t'BN' => 'Brunei Darussalam',\n\t\t\t\t\t'BG' => 'Bulgaria',\n\t\t\t\t\t'BF' => 'Burkina Faso',\n\t\t\t\t\t'MM' => 'Burma',\n\t\t\t\t\t'BI' => 'Burundi',\n\t\t\t\t\t'KH' => 'Cambodia',\n\t\t\t\t\t'CM' => 'Cameroon',\n\t\t\t\t\t'CA' => 'Canada',\n\t\t\t\t\t'CV' => 'Cape Verde',\n\t\t\t\t\t'KY' => 'Cayman Islands',\n\t\t\t\t\t'CF' => 'Central African Republic',\n\t\t\t\t\t'TD' => 'Chad',\n\t\t\t\t\t'CL' => 'Chile',\n\t\t\t\t\t'CN' => 'China',\n\t\t\t\t\t'CX' => 'Christmas Island (Australia)',\n\t\t\t\t\t'CC' => 'Cocos Island (Australia)',\n\t\t\t\t\t'CO' => 'Colombia',\n\t\t\t\t\t'KM' => 'Comoros',\n\t\t\t\t\t'CG' => 'Congo, Republic of the',\n\t\t\t\t\t'CD' => 'Congo, Democratic Republic of the',\n\t\t\t\t\t'CK' => 'Cook Islands (New Zealand)',\n\t\t\t\t\t'CR' => 'Costa Rica',\n\t\t\t\t\t'CI' => 'Cote d Ivoire (Ivory Coast)',\n\t\t\t\t\t'HR' => 'Croatia',\n\t\t\t\t\t'CU' => 'Cuba',\n\t\t\t\t\t'CY' => 'Cyprus',\n\t\t\t\t\t'CZ' => 'Czech Republic',\n\t\t\t\t\t'DK' => 'Denmark',\n\t\t\t\t\t'DJ' => 'Djibouti',\n\t\t\t\t\t'DM' => 'Dominica',\n\t\t\t\t\t'DO' => 'Dominican Republic',\n\t\t\t\t\t'EC' => 'Ecuador',\n\t\t\t\t\t'EG' => 'Egypt',\n\t\t\t\t\t'SV' => 'El Salvador',\n\t\t\t\t\t'GQ' => 'Equatorial Guinea',\n\t\t\t\t\t'ER' => 'Eritrea',\n\t\t\t\t\t'EE' => 'Estonia',\n\t\t\t\t\t'ET' => 'Ethiopia',\n\t\t\t\t\t'FK' => 'Falkland Islands',\n\t\t\t\t\t'FO' => 'Faroe Islands',\n\t\t\t\t\t'FJ' => 'Fiji',\n\t\t\t\t\t'FI' => 'Finland',\n\t\t\t\t\t'FR' => 'France',\n\t\t\t\t\t'GF' => 'French Guiana',\n\t\t\t\t\t'PF' => 'French Polynesia',\n\t\t\t\t\t'GA' => 'Gabon',\n\t\t\t\t\t'GM' => 'Gambia',\n\t\t\t\t\t'GE' => 'Georgia, Republic of',\n\t\t\t\t\t'DE' => 'Germany',\n\t\t\t\t\t'GH' => 'Ghana',\n\t\t\t\t\t'GI' => 'Gibraltar',\n\t\t\t\t\t'GB' => 'Great Britain and Northern Ireland',\n\t\t\t\t\t'GR' => 'Greece',\n\t\t\t\t\t'GL' => 'Greenland',\n\t\t\t\t\t'GD' => 'Grenada',\n\t\t\t\t\t'GP' => 'Guadeloupe',\n\t\t\t\t\t'GT' => 'Guatemala',\n\t\t\t\t\t'GN' => 'Guinea',\n\t\t\t\t\t'GW' => 'Guinea-Bissau',\n\t\t\t\t\t'GY' => 'Guyana',\n\t\t\t\t\t'HT' => 'Haiti',\n\t\t\t\t\t'HN' => 'Honduras',\n\t\t\t\t\t'HK' => 'Hong Kong',\n\t\t\t\t\t'HU' => 'Hungary',\n\t\t\t\t\t'IS' => 'Iceland',\n\t\t\t\t\t'IN' => 'India',\n\t\t\t\t\t'ID' => 'Indonesia',\n\t\t\t\t\t'IR' => 'Iran',\n\t\t\t\t\t'IQ' => 'Iraq',\n\t\t\t\t\t'IE' => 'Ireland',\n\t\t\t\t\t'IL' => 'Israel',\n\t\t\t\t\t'IT' => 'Italy',\n\t\t\t\t\t'JM' => 'Jamaica',\n\t\t\t\t\t'JP' => 'Japan',\n\t\t\t\t\t'JO' => 'Jordan',\n\t\t\t\t\t'KZ' => 'Kazakhstan',\n\t\t\t\t\t'KE' => 'Kenya',\n\t\t\t\t\t'KI' => 'Kiribati',\n\t\t\t\t\t'KW' => 'Kuwait',\n\t\t\t\t\t'KG' => 'Kyrgyzstan',\n\t\t\t\t\t'LA' => 'Laos',\n\t\t\t\t\t'LV' => 'Latvia',\n\t\t\t\t\t'LB' => 'Lebanon',\n\t\t\t\t\t'LS' => 'Lesotho',\n\t\t\t\t\t'LR' => 'Liberia',\n\t\t\t\t\t'LY' => 'Libya',\n\t\t\t\t\t'LI' => 'Liechtenstein',\n\t\t\t\t\t'LT' => 'Lithuania',\n\t\t\t\t\t'LU' => 'Luxembourg',\n\t\t\t\t\t'MO' => 'Macao',\n\t\t\t\t\t'MK' => 'Macedonia, Republic of',\n\t\t\t\t\t'MG' => 'Madagascar',\n\t\t\t\t\t'MW' => 'Malawi',\n\t\t\t\t\t'MY' => 'Malaysia',\n\t\t\t\t\t'MV' => 'Maldives',\n\t\t\t\t\t'ML' => 'Mali',\n\t\t\t\t\t'MT' => 'Malta',\n\t\t\t\t\t'MQ' => 'Martinique',\n\t\t\t\t\t'MR' => 'Mauritania',\n\t\t\t\t\t'MU' => 'Mauritius',\n\t\t\t\t\t'YT' => 'Mayotte (France)',\n\t\t\t\t\t'MX' => 'Mexico',\n\t\t\t\t\t'FM' => 'Micronesia, Federated States of',\n\t\t\t\t\t'MD' => 'Moldova',\n\t\t\t\t\t'MC' => 'Monaco (France)',\n\t\t\t\t\t'MN' => 'Mongolia',\n\t\t\t\t\t'MS' => 'Montserrat',\n\t\t\t\t\t'MA' => 'Morocco',\n\t\t\t\t\t'MZ' => 'Mozambique',\n\t\t\t\t\t'NA' => 'Namibia',\n\t\t\t\t\t'NR' => 'Nauru',\n\t\t\t\t\t'NP' => 'Nepal',\n\t\t\t\t\t'NL' => 'Netherlands',\n\t\t\t\t\t'AN' => 'Netherlands Antilles',\n\t\t\t\t\t'NC' => 'New Caledonia',\n\t\t\t\t\t'NZ' => 'New Zealand',\n\t\t\t\t\t'NI' => 'Nicaragua',\n\t\t\t\t\t'NE' => 'Niger',\n\t\t\t\t\t'NG' => 'Nigeria',\n\t\t\t\t\t'KP' => 'North Korea (Korea, Democratic People\\'s Republic of)',\n\t\t\t\t\t'NO' => 'Norway',\n\t\t\t\t\t'OM' => 'Oman',\n\t\t\t\t\t'PK' => 'Pakistan',\n\t\t\t\t\t'PA' => 'Panama',\n\t\t\t\t\t'PG' => 'Papua New Guinea',\n\t\t\t\t\t'PY' => 'Paraguay',\n\t\t\t\t\t'PE' => 'Peru',\n\t\t\t\t\t'PH' => 'Philippines',\n\t\t\t\t\t'PN' => 'Pitcairn Island',\n\t\t\t\t\t'PL' => 'Poland',\n\t\t\t\t\t'PT' => 'Portugal',\n\t\t\t\t\t'QA' => 'Qatar',\n\t\t\t\t\t'RE' => 'Reunion',\n\t\t\t\t\t'RO' => 'Romania',\n\t\t\t\t\t'RU' => 'Russia',\n\t\t\t\t\t'RW' => 'Rwanda',\n\t\t\t\t\t'SH' => 'Saint Helena',\n\t\t\t\t\t'KN' => 'Saint Kitts (St. Christopher and Nevis)',\n\t\t\t\t\t'LC' => 'Saint Lucia',\n\t\t\t\t\t'PM' => 'Saint Pierre and Miquelon',\n\t\t\t\t\t'VC' => 'Saint Vincent and the Grenadines',\n\t\t\t\t\t'SM' => 'San Marino',\n\t\t\t\t\t'ST' => 'Sao Tome and Principe',\n\t\t\t\t\t'SA' => 'Saudi Arabia',\n\t\t\t\t\t'SN' => 'Senegal',\n\t\t\t\t\t'RS' => 'Serbia',\n\t\t\t\t\t'SC' => 'Seychelles',\n\t\t\t\t\t'SL' => 'Sierra Leone',\n\t\t\t\t\t'SG' => 'Singapore',\n\t\t\t\t\t'SK' => 'Slovak Republic',\n\t\t\t\t\t'SI' => 'Slovenia',\n\t\t\t\t\t'SB' => 'Solomon Islands',\n\t\t\t\t\t'SO' => 'Somalia',\n\t\t\t\t\t'ZA' => 'South Africa',\n\t\t\t\t\t'GS' => 'South Georgia (Falkland Islands)',\n\t\t\t\t\t'KR' => 'South Korea (Korea, Republic of)',\n\t\t\t\t\t'ES' => 'Spain',\n\t\t\t\t\t'LK' => 'Sri Lanka',\n\t\t\t\t\t'SD' => 'Sudan',\n\t\t\t\t\t'SR' => 'Suriname',\n\t\t\t\t\t'SZ' => 'Swaziland',\n\t\t\t\t\t'SE' => 'Sweden',\n\t\t\t\t\t'CH' => 'Switzerland',\n\t\t\t\t\t'SY' => 'Syrian Arab Republic',\n\t\t\t\t\t'TW' => 'Taiwan',\n\t\t\t\t\t'TJ' => 'Tajikistan',\n\t\t\t\t\t'TZ' => 'Tanzania',\n\t\t\t\t\t'TH' => 'Thailand',\n\t\t\t\t\t'TL' => 'East Timor (Indonesia)',\n\t\t\t\t\t'TG' => 'Togo',\n\t\t\t\t\t'TK' => 'Tokelau (Union) Group (Western Samoa)',\n\t\t\t\t\t'TO' => 'Tonga',\n\t\t\t\t\t'TT' => 'Trinidad and Tobago',\n\t\t\t\t\t'TN' => 'Tunisia',\n\t\t\t\t\t'TR' => 'Turkey',\n\t\t\t\t\t'TM' => 'Turkmenistan',\n\t\t\t\t\t'TC' => 'Turks and Caicos Islands',\n\t\t\t\t\t'TV' => 'Tuvalu',\n\t\t\t\t\t'UG' => 'Uganda',\n\t\t\t\t\t'UA' => 'Ukraine',\n\t\t\t\t\t'AE' => 'United Arab Emirates',\n\t\t\t\t\t'UY' => 'Uruguay',\n\t\t\t\t\t'UZ' => 'Uzbekistan',\n\t\t\t\t\t'VU' => 'Vanuatu',\n\t\t\t\t\t'VA' => 'Vatican City',\n\t\t\t\t\t'VE' => 'Venezuela',\n\t\t\t\t\t'VN' => 'Vietnam',\n\t\t\t\t\t'WF' => 'Wallis and Futuna Islands',\n\t\t\t\t\t'WS' => 'Western Samoa',\n\t\t\t\t\t'YE' => 'Yemen',\n\t\t\t\t\t'ZM' => 'Zambia',\n\t\t\t\t\t'ZW' => 'Zimbabwe'\n\t\t\t\t);\n\t\t\t\t \n\t\t\t\t$url = \"http://production.shippingapis.com/ShippingAPI.dll\";\n\t\t\t\t$xml = '\n\t<IntlRateV2Request USERID=\"'.$this->username.'\">';\n\t\t\t\tforeach($packages as $x => $package) {\n\t\t\t\t\t// Weight (in lbs) - already in lbs, but just in case\n\t\t\t\t\t$weight = $shipping->convert_weight($package['weight'],$package['weight_unit'],'lb');\n\t\t\t\t\t// Split into lbs and ozs\n\t\t\t\t\t$lbs = floor($weight);\n\t\t\t\t\t$ozs = ($weight - $lbs) * 16;\n\t\t\t\t\tif($lbs == 0 and $ozs < 1) $ozs = 1;\n\t\t\t\t\t\n\t\t\t\t\t// XML\n\t\t\t\t\t$xml .= '\n\t\t<Package ID=\"'.($x + 1).'\">\n\t\t\t<Pounds>'.$lbs.'</Pounds>\n\t\t\t<Ounces>'.$ozs.'</Ounces>\n\t\t\t<Machinable>TRUE</Machinable>\n\t\t\t<MailType>Package</MailType>\n\t\t\t<GXG>\n\t\t\t\t<POBoxFlag>N</POBoxFlag>\n\t\t\t\t<GiftFlag>N</GiftFlag>\n\t\t\t</GXG>\n\t\t\t<ValueOfContents>0.00</ValueOfContents>\n\t\t\t<Country>'.$countries[$shipping->to_country].'</Country>\n\t\t\t<Container>RECTANGULAR</Container>\n\t\t\t<Size>REGULAR</Size>';\n\t\t\t\t\t// Dimensions - have to re-convert here because requires a minimum of 1\n\t\t\t\t\t$xml .= '\n\t\t\t<Width>'.$shipping->convert_dimensions($package['dimensions_width'],$package['dimensions_unit'],\"in\",1).'</Width> \n\t\t\t<Length>'.$shipping->convert_dimensions($package['dimensions_length'],$package['dimensions_unit'],\"in\",1).'</Length> \n\t\t\t<Height>'.$shipping->convert_dimensions($package['dimensions_height'],$package['dimensions_unit'],\"in\",1).'</Height> \n\t\t\t<Girth>10</Girth> \n\t\t</Package>';\n\t\t\t\t}\n\t\t\t\t$xml .= '\n\t</IntlRateV2Request>';\n\t\t\t\t$data = \"API=IntlRateV2&XML=\".$xml;\n\t\t\t\n\t\t\t\t// Curl\n\t\t\t\t$results = $shipping->curl($url,$data);\n\t\t\t\t\n\t\t\t\t// Debug\n\t\t\t\tif($shipping->debug) {\n\t\t\t\t\tprint \"xml: <xmp>\".$xml.\"</xmp><br />\";\n\t\t\t\t\tprint \"results: <xmp>\".$results.\"</xmp><br />\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Rate(s)\n\t\t\t\tpreg_match_all('/<Package ID=\"([0-9]{1,3})\">(.+?)<\\/Package>/s',$results,$results_packages);\n\t\t\t\tforeach($results_packages[2] as $x => $results_package) {\n\t\t\t\t\tpreg_match_all('/<Service ID=\"([0-9]{1,3})\">(.+?)<\\/Service>/s',$results_package,$results_methods);\n\t\t\t\t\tforeach($results_methods[2] as $y => $results_method) {\n\t\t\t\t\t\t// Name\n\t\t\t\t\t\tpreg_match('/<SvcDescription>(.+?)<\\/SvcDescription>/',$results_method,$name);\n\t\t\t\t\t\t$name = str_replace($strip,'',$name[1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Use name, get rate\n\t\t\t\t\t\tif($name and in_array($name,$this->methods)) {\n\t\t\t\t\t\t\tpreg_match('/<Postage>(.+?)<\\/Postage>/',$results_method,$rate);\n\t\t\t\t\t\t\tif($rate[1]) {\n\t\t\t\t\t\t\t\tif($this->package_fits($shipping,$packages,$name)) {\n\t\t\t\t\t\t\t\t\t$rates['rates'][$name] += $rate[1];\n\t\t\t\t\t\t\t\t\t$rates['packages'][$x]['package'] = $packages[$x];\n\t\t\t\t\t\t\t\t\t$rates['packages'][$x]['rates'][$name] += $rate[1];\n\t\t\t\t\t\t\t\t\tif(!isset($rates['names'][$name])) $rates['names'][$name] = $name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Return\n\t\t\treturn $rates;\n\t\t}", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\n {\n if (!$this->getConfigFlag('active') || !$this->getConfigFlag('license_status')) {\n return false;\n }\n if(!$request->getCountryId()){\n return Mage::log('PostNord: No origin country');\n }\n // exclude Virtual products price from Package value if pre-configured\n if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {\n foreach ($request->getAllItems() as $item) {\n if ($item->getParentItem()) {\n continue;\n }\n if ($item->getHasChildren() && $item->isShipSeparately()) {\n foreach ($item->getChildren() as $child) {\n if ($child->getProduct()->isVirtual()) {\n $request->setPackageValue($request->getPackageValueWithDiscount() - $child->getBaseRowTotal());\n }\n }\n } elseif ($item->getProduct()->isVirtual()) {\n $request->setPackageValue($request->getPackageValueWithDiscount() - $item->getBaseRowTotal());\n }\n }\n }\n\n // Free shipping by qty\n $freeQty = 0;\n if ($request->getAllItems()) {\n foreach ($request->getAllItems() as $item) {\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\n continue;\n }\n\n if ($item->getHasChildren() && $item->isShipSeparately()) {\n foreach ($item->getChildren() as $child) {\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\n $freeQty += $item->getQty() * ($child->getQty() - (is_numeric($child->getFreeShipping()) ? $child->getFreeShipping() : 0));\n }\n }\n } elseif ($item->getFreeShipping()) {\n $freeQty += ($item->getQty() - (is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0));\n }\n }\n }\n \n // Package weight and qty free shipping\n $oldWeight = $request->getPackageWeight();\n $oldQty = $request->getPackageQty();\n\n $request->setPackageWeight($request->getFreeMethodWeight());\n $request->setPackageQty($oldQty - $freeQty);\n\n $request->setPackageWeight($oldWeight);\n $request->setPackageQty($oldQty);\n \n $result = Mage::getModel('shipping/rate_result');\n /* @var $result Mage_Shipping_Model_Rate_Result */\n $methods = new Varien_Data_Collection();\n Mage::dispatchEvent('vconnect_postnord_collect_shipping_methods',array(\n 'request' => $request,\n 'methods' => $methods,\n ));\n if(!$methods->count()){\n return false;\n }\n\n $items = $methods->getItems();\n usort($items, function($a,$b){\n if (isset($a['system_path']) && isset($b['system_path'])) {\n $a['sort_order'] = (int)Mage::getStoreConfig(\"carriers/{$a['system_path']}/sort_order\");\n $b['sort_order'] = (int)Mage::getStoreConfig(\"carriers/{$b['system_path']}/sort_order\");\n if ($a['sort_order'] == $b['sort_order']) {\n return 0;\n }\n return ($a['sort_order'] < $b['sort_order']) ? -1 : 1;\n } else {\n return 0;\n }\n });\n\n foreach ( $items as $_method ){\n $method = $this->_createShippingMethodByCode($request,$freeQty,$_method );\n if( !$method ) {\n continue;\n }\n $result->append($method);\n }\n \n return $result;\n }" ]
[ "0.6150388", "0.58662164", "0.5583853", "0.53943115", "0.5378202", "0.5344443", "0.5319539", "0.52831733", "0.52678406", "0.52150834", "0.52100194", "0.52062804", "0.51879424", "0.518293", "0.51803243", "0.51533395", "0.5124004", "0.51203674", "0.5108891", "0.50809115", "0.50706905", "0.5065526", "0.50499", "0.5049023", "0.50446945", "0.5035529", "0.5034429", "0.502398", "0.49978095", "0.49859285" ]
0.6182536
0
Get Tracking Data from an AWB
public function getTrackingAWB(string $awb) { return $this->send('POST', 'getTrackingAWB', compact('awb')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getData() {\n\t\t/** @var GoogleApi_Helper */\n\t\t$helper = DI::getDefault()->get('googleApiHelper');\n\t\treturn $helper->getFileDataById($this->googleId);\n\t}", "function tsuiseki_tracking_get_data($ref = '') {\n $ref = (string)($ref);\n $opts = _tsuiseki_tracking_extract_data_from_url($ref);\n $c_network = '';\n $c_partner = '';\n $c_query = '';\n\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_NAME])) {\n $cookie_data = $_SESSION[TSUISEKI_TRACKER_COOKIE_NAME];\n if (_tsuiseki_tracking_validate_cookie_value($cookie_data)) {\n $parts = _tsuiseki_tracking_extract_cookie_data($cookie_data);\n $data = (string)trim($parts['data']);\n $c_opts = _tsuiseki_tracking_extract_data_from_url($data);\n // Get the values from the cookie.\n $c_network = _tsuiseki_tracking_get_network($c_opts);\n $c_partner = _tsuiseki_tracking_get_partner_id($c_opts);\n $c_query = _tsuiseki_tracking_get_query($c_opts);\n }\n }\n\n $output = '';\n $network = _tsuiseki_tracking_get_network($opts);\n if (!empty($c_network) && ($network == 'free' && $network != $c_network)) {\n // If the network parameter is 'free' and we have a different entry in the\n // session cookie the cookie entry is prefered.\n $network = _check_plain($c_network);\n }\n if (!empty($network)) {\n $output .= '&network='. $network;\n }\n\n $partner = _tsuiseki_tracking_get_partner_id($opts);\n if (empty($partner) && !empty($c_partner)) {\n $partner = _check_plain($c_partner);\n }\n if (!empty($partner)) {\n $output .= '&partner='. $partner;\n }\n\n $query = _tsuiseki_tracking_get_query($opts);\n if (empty($query) && !empty($c_query)) {\n $query = _check_plain($c_query);\n }\n if (!empty($query)) {\n $output .= '&query='. $query;\n }\n return $output;\n}", "protected function readDataRecords()\n {\n \tparent::readDataRecords();\n\n \tforeach ($this->file_contents->Activities->Activity->Lap->Track->Trackpoint as $theSeg) {\n \t\n \t\t$data['Time']=$theSeg->Time;\n \t\t$data['Ele']=$theSeg->AltitudeMeters;\n \t\t$data['Dist']=$theSeg->DistanceMeters/1000;\n \t\t$data['Cadence']=$theSeg->Cadence;\n \t\t$data['Heart']=$theSeg->HeartRateBpm->Value;\n \t\t$data['Lat']=$theSeg->Position->LatitudeDegrees;\n \t\t$data['Long']=$theSeg->Position->LongitudeDegrees;\n \t\n \t\n \t\t$this->addData($data);\n \t\t\t\n \t}\n \t$this->makeSession();\n \n }", "function getReport() ;", "public function get_tracker_data() {\n\t\t$option_object = $this->get_analytics_options();\n\n\t\t// Look for a site level Google Analytics ID\n\t\t$google_analytics_id = get_option( 'wsuwp_ga_id', false );\n\n\t\t// Look for a site level Google Analytics ID\n\t\t$ga4_google_analytics_id = get_option( 'wsuwp_ga4_id', false );\n\n\t\t// If a site level ID does not exist, look for a network level Google Analytics ID\n\t\tif ( ! $google_analytics_id ) {\n\t\t\t$google_analytics_id = get_site_option( 'wsuwp_network_ga_id', false );\n\t\t}\n\n\t\t// Provide this via filter in your instance of WordPress. In the WSUWP Platform, this will\n\t\t// be part of a must-use plugin.\n\t\t$app_analytics_id = apply_filters( 'wsu_analytics_app_analytics_id', '' );\n\n\t\t$spine_color = '';\n\t\t$spine_grid = '';\n\t\t$wsuwp_network = '';\n\n\t\tif ( function_exists( 'spine_get_option' ) ) {\n\t\t\t$spine_color = esc_js( spine_get_option( 'spine_color' ) );\n\t\t\t$spine_grid = esc_js( spine_get_option( 'grid_style' ) );\n\t\t}\n\n\t\tif ( is_multisite() ) {\n\t\t\t$wsuwp_network = get_network()->domain;\n\t\t}\n\n\t\t// Do not track site analytics on admin or preview views.\n\t\tif ( is_admin() || is_preview() ) {\n\t\t\t$option_object['track_site'] = false;\n\t\t}\n\n\t\t// Escaping of tracker data for output as JSON is handled via wp_localize_script().\n\t\t$tracker_data = array(\n\t\t\t'defaults' => array(\n\t\t\t\t'cookieDomain' => $this->get_cookie_domain(),\n\t\t\t),\n\n\t\t\t'wsuglobal' => array(\n\t\t\t\t'ga_code' => 'true' === $option_object['track_global'] ? 'UA-55791317-1' : false, // Hard coded global analytics ID for WSU.\n\t\t\t\t'campus' => $option_object['campus'],\n\t\t\t\t'college' => $option_object['college'],\n\t\t\t\t'unit_type' => $option_object['unit_type'],\n\t\t\t\t// Fallback to the subunit if a unit is not selected.\n\t\t\t\t'unit' => 'none' === $option_object['unit'] && 'none' !== $option_object['subunit'] ? $option_object['subunit'] : $option_object['unit'],\n\t\t\t\t// If a subunit has been used as a fallback, output \"none\" as the subunit.\n\t\t\t\t'subunit' => 'none' !== $option_object['unit'] ? $option_object['subunit'] : 'none',\n\t\t\t\t'is_editor' => $this->is_editor() ? 'true' : 'false',\n\t\t\t\t'track_view' => is_admin() ? 'no' : 'yes',\n\t\t\t\t'events' => array(),\n\t\t\t),\n\n\t\t\t'app' => array(\n\t\t\t\t'ga_code' => 'true' === $option_object['track_app'] ? $this->sanitize_ga_id( $app_analytics_id ) : false,\n\t\t\t\t'page_view_type' => $this->get_page_view_type(),\n\t\t\t\t'authenticated_user' => $this->get_authenticated_user(),\n\t\t\t\t'user_id' => ( is_admin() ) ? get_current_user_id() : 0,\n\t\t\t\t'server_protocol' => $_SERVER['SERVER_PROTOCOL'],\n\t\t\t\t'wsuwp_network' => $wsuwp_network,\n\t\t\t\t'spine_grid' => $spine_grid,\n\t\t\t\t'spine_color' => $spine_color,\n\t\t\t\t'events' => array(),\n\t\t\t),\n\n\t\t\t'site' => array(\n\t\t\t\t'ga_code' => 'true' === $option_object['track_site'] ? $google_analytics_id : false,\n\t\t\t\t'ga4_code' => $ga4_google_analytics_id,\n\t\t\t\t'track_view' => is_admin() ? 'no' : 'yes',\n\t\t\t\t'events' => array(),\n\t\t\t),\n\t\t);\n\n\t\treturn $tracker_data;\n\t}", "abstract function fetchData($trackingNumber);", "function getTrackingDataOfUser($a_user_id = 0)\n\t{\n\t\tglobal $ilDB, $ilUser;\n\n\t\tif ($a_user_id == 0)\n\t\t{\n\t\t\t$a_user_id = $ilUser->getId();\n\t\t}\n\n\t\t$track_set = $ilDB->queryF('\n\t\tSELECT lvalue, rvalue FROM scorm_tracking \n\t\tWHERE sco_id = %s\n\t\tAND user_id = %s\n\t\tAND obj_id = %s',\n\t\tarray('integer','integer','integer'),\n\t\tarray($this->getId(), $a_user_id, $this->getALMId()));\n\t\t\n\t\t$trdata = array();\n\t\twhile ($track_rec = $ilDB->fetchAssoc($track_set))\n\t\t{\n\t\t\t$trdata[$track_rec[\"lvalue\"]] = $track_rec[\"rvalue\"];\n\t\t}\n\t\t\n\t\t\n\t\treturn $trdata;\n\t}", "function _tsuiseki_tracking_extract_data_from_url($ref) {\n $ref = (string)($ref);\n $opts = array();\n if (!empty($ref)) {\n $ref = urldecode($ref);\n $parts = preg_split('/[&|?]/', $ref);\n if (!empty($parts)) {\n $p = array();\n foreach ($parts as $part) {\n if (preg_match('/\\w+?=.*\\/i=1/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1] .'='. $p[2];\n }\n else if (preg_match('/\\w+?=.*/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1];\n }\n } // foreach\n }\n }\n return $opts;\n}", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "public function downloadObservations() {\n $this->loginToWigle();\n\n $ap = $this->database->table('wigle_aps')\n ->where('downloaded',0)\n ->order('priority DESC, rand()')\n ->limit(1)\n ->fetch();\n\n $observationsWigle = $this->sendCurlRequest(self::WIGLE_OBSERVATIONS_URL,array('netid'=>$ap['mac']));\n\n $observationsDecoded = json_decode($observationsWigle,true);\n\n dump($observationsDecoded);\n\n $wifis = array();\n\n foreach($observationsDecoded['result'] as $r) {\n foreach($r['locationData'] as $o) {\n $wifi = new Wifi();\n $wifi->setAltitude($o['alt']);\n $wifi->setAccuracy($o['accuracy']);\n $wifi->setBcninterval($r['bcninterval']);\n $wifi->setChannel($r['channel']);\n $wifi->setComment($r['comment']);\n $wifi->setDateAdded(new DateTime());\n $wifi->setFirsttime($r['firsttime']);\n $wifi->setFlags($r['flags']);\n $wifi->setFreenet($r['freenet']);\n $wifi->setLasttime($o['time']);\n $wifi->setLastupdt($o['lastupdt']);\n $wifi->setLatitude($o['latitude']);\n $wifi->setLongitude($o['longitude']);\n $wifi->setMac($o['netid']);\n $wifi->setName($o['name']);\n $wifi->setPaynet($r['paynet']);\n $wifi->setQos($r['qos']);\n $wifi->setSource(WigleDownload::ID_SOURCE);\n $wifi->setSsid($o['ssid']);\n $wifi->setType($r['type']);\n $wifi->setWep($o['wep']);\n $wifis[] = $wifi;\n }\n }\n\n $this->database->beginTransaction();\n $rows = $this->saveAll($wifis);\n $id_wigle_download_queue = $ap['id_wigle_download_queue'];\n\n\n // stazeno z wigle -> v najdem pokud je v donwload importu tak pridame do google\n $this->database->table(DownloadImportService::TABLE)\n ->where('id_wigle_aps',$ap['id'])\n ->where('state',1)\n ->update(array('state'=>DownloadImport::DOWNLOADED_WIGLE));\n\n\n $idGR = null;\n\n $googleDownloadService = new GoogleDownload($this->database);\n if ($rows) foreach($rows as $row) {\n $w = Wifi::createWifiFromDBRow($row);\n if($w) {\n $idGR = $googleDownloadService->createRequestFromWifi($w,2);\n }\n }\n\n $this->database->table(DownloadImportService::TABLE)\n ->where('id_wigle_aps',$ap['id'])\n ->where('state',DownloadImport::DOWNLOADED_WIGLE)\n ->where('id_google_request',null)\n ->update(array(\n 'state'=>DownloadImport::ADDED_GOOGLE,\n 'id_google_request' => $idGR\n ));\n\n $ap->update(array('downloaded'=>1,'downloaded_date'=>new DateTime()));\n if($id_wigle_download_queue) {\n $this->database->table('wigle_download_queue')\n ->where('id',$id_wigle_download_queue)\n ->update(array('count_downloaded_observations'=>new SqlLiteral('count_downloaded_observations + 1')));\n }\n $this->database->commit();\n // PO UPDATE wigle_download_queue se pomoci DB triggeru zmeni hodnoty u download_requestu\n // a pokud je ten reuqest jiz dokoncen tak i requesty ktere cekaly na ten dany request\n dump($wifis);\n }", "public function getTrackContent() {\n $fields = array(\n 'track' => array(\n 'creator' => 'searchCode',\n 'title' => 'title',\n 'details' => 'details'\n )\n );\n return TingOpenformatMethods::parseFields($this->_getTracks(), $fields);\n }", "public function getReport() {}", "public function getReport() {}", "public function getOpenTracking()\n {\n return $this->open_tracking;\n }", "function get_tracking_info($serial) {\n\n global $TRACKING_CONDITION_ID;\n $result2 = array();\n // Database connection \n $conn = database_connection();\n //Get part id by its serial number\n $sql = \"SELECT PART_ID FROM CMS_GEM_CORE_CONSTRUCT.PARTS WHERE SERIAL_NUMBER='\" . $serial . \"'\";\n\n $query = oci_parse($conn, $sql);\n $arr = oci_execute($query);\n $result = '';\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $result = $row['PART_ID'];\n }\n // if found get its condition datasets where kind of condition == $TRACKING_CONDITION_ID\n if ($result != '') {\n $sql1 = \"SELECT CONDITION_DATA_SET_ID, COND_RUN_ID FROM CMS_GEM_CORE_COND.COND_DATA_SETS WHERE PART_ID ='\" . $result . \"' AND KIND_OF_CONDITION_ID ='\" . $TRACKING_CONDITION_ID . \"' \";\n $query1 = oci_parse($conn, $sql1);\n $arr1 = oci_execute($query1);\n $result1 = array();\n $itr = array();\n while ($row1 = oci_fetch_array($query1, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $itr['CONDITION_DATA_SET_ID'] = $row1['CONDITION_DATA_SET_ID'];\n $itr['COND_RUN_ID'] = $row1['COND_RUN_ID'];\n $result1[] = $itr;\n }\n // if datasets found get tracking info\n if ( sizeof($result1) >= 1) {\n foreach ($result1 as $key => $value) {\n $run = $value['COND_RUN_ID'];\n $sql2 = \"SELECT SHIPPED_FROM,DESTINATION,DATE_SHIPPED,MODE_SHIPPED,ADDN_SHIPPING_INFO,STATUS FROM CMS_GEM_MUON_COND.GEM_COMPONENT_TRACKING WHERE CONDITION_DATA_SET_ID = '\" .$value['CONDITION_DATA_SET_ID']. \"'\";\n $query2 = oci_parse($conn, $sql2);\n $arr2 = oci_execute($query2);\n $itr1 = array();\n while ($row2 = oci_fetch_array($query2, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $itr1['SHIPPED_FROM'] = $row2['SHIPPED_FROM'];\n $itr1['DESTINATION'] = $row2['DESTINATION'];\n $itr1['DATE_SHIPPED'] = $row2['DATE_SHIPPED'];\n $itr1['MODE_SHIPPED'] = $row2['MODE_SHIPPED'];\n $itr1['ADDN_SHIPPING_INFO'] = $row2['ADDN_SHIPPING_INFO'];\n $itr1['STATUS'] = $row2['STATUS'];\n $itr1['COND_RUN_ID'] = $run;\n $result2[] = $itr1;\n }\n }\n } else {\n //no data sets found \n return -1;\n }\n } else {\n //no part with this serial\n return 0;\n }\n\n\n\n return $result2;\n}", "public function all() {\n $trackings = [];\n foreach (glob('./.time-tracking/report-*') as $report):\n $tracking_id = str_replace('report-', '', \\basename($report));\n $tracking_id = str_replace('.json', '', $tracking_id);\n \n $tracking = new TrackingEntity();\n $tracking->id = $tracking_id;\n \n $report = new Report($tracking);\n $tracking = $report->read($report->file);\n // Informations\n $trackings[] = $tracking->getInformations();\n endforeach;\n\n // Order by date\n usort($trackings, function($a, $b) {\n $ad = strtotime($a['date']);\n $bd = strtotime($b['date']);\n if ($ad == $bd): return 0; endif;\n return $ad < $bd ? -1 : 1;\n });\n \n return $trackings;\n }", "function edd_load_tracking_info() {\n\treturn EDD_Tracking_Info::instance();\n}", "public function decodeTrackingNo($trackingNo);", "function tsuiseki_tracking_buffer_data() {\n $dirty = FALSE;\n $c_network = '';\n $c_partner = '';\n $c_query = '';\n\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_NAME])) {\n $cookie_data = $_SESSION[TSUISEKI_TRACKER_COOKIE_NAME];\n if (_tsuiseki_tracking_validate_cookie_value($cookie_data)) {\n $parts = _tsuiseki_tracking_extract_cookie_data($cookie_data);\n $data = (string)trim($parts['data']);\n $c_opts = _tsuiseki_tracking_extract_data_from_url($data);\n // Get the values from the cookie.\n $c_network = _tsuiseki_tracking_get_network($c_opts);\n $c_partner = _tsuiseki_tracking_get_partner_id($c_opts);\n $c_query = _tsuiseki_tracking_get_query($c_opts);\n }\n else {\n $dirty = TRUE;\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME])) {\n unset($_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME]);\n }\n }\n }\n // Get the values from the url.\n $network = _tsuiseki_tracking_get_network();\n $partner = _tsuiseki_tracking_get_partner_id();\n $query = _tsuiseki_tracking_get_query();\n // Now we validate the data and decide if we update the cookie values.\n if (empty($c_network) || (!empty($network) && ($network != 'free') && ($network != $c_network))) {\n $c_network = $network;\n $dirty = TRUE;\n }\n if (empty($c_partner) || (!empty($partner) && ($partner != $c_partner))) {\n $c_partner = $partner;\n $dirty = TRUE;\n }\n else {\n // If we have seen this guy more than once we append an '/i=1' to the\n // partner field to mark it as an internal view.\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME]) && (int)$_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME] > 1) {\n // As the partner field was very likely deleted from the url if the\n // visitor moved around the website we prefer the value from the cookie.\n if (!empty($c_partner)) {\n $partner = $c_partner;\n }\n else {\n $partner = '';\n }\n if (!preg_match('/.*\\/i=1$/', $partner)) {\n $c_partner = $partner .'/i=1';\n $dirty = TRUE;\n }\n }\n }\n if (empty($query) || (!empty($query) && ($query != $c_query))) {\n $c_query = $query;\n $dirty = TRUE;\n }\n // Now we store the data in the session if it was modified.\n if ($dirty) {\n $name = ip2long($_SERVER['REMOTE_ADDR']);\n $time = _tsuiseki_tracking_get_expiration_time();\n $data = _tsuiseki_tracking_create_cookie_data($c_network, $c_partner, $c_query);\n $cookie_data = _tsuiseki_tracking_calculate_cookie_value($name, $time, $data);\n $_SESSION[TSUISEKI_TRACKER_COOKIE_NAME] = $cookie_data;\n }\n // At last we count the times this function is fired.\n if (isset($_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME])) {\n $_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME] =\n (int)$_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME] + 1;\n }\n else {\n $_SESSION[TSUISEKI_TRACKER_COOKIE_VIEW_COUNTER_NAME] = 1;\n }\n $_SESSION['TSUISEKI_TRACKER_KEY'] = (string)trim(tsuiseki_tracking_get_key());\n\n return $dirty;\n}", "private function getEbayTracking($limit = 0) {\n\n// get all our items referral_ebay_item_id = 1\n $criteria = new CDbCriteria();\n $criteria->condition = 'flow = ' . EbayTracking::OUR_ITEM;\n if ($limit > 0)\n $criteria->limit = $limit;\n\n $our_EbayTracking = EbayTracking::model()->findAll($criteria);\n\n// create php for our_item array to use \n $our_item_array = array();\n foreach ($our_EbayTracking as $our_item) {\n $our_item_array[$our_item->ebay_item_id]['level'] = 'parent';\n $our_item_array[$our_item->ebay_item_id]['id'] = $our_item->id;\n $our_item_array[$our_item->ebay_item_id]['ebay_item_id'] = $our_item->ebay_item_id;\n $our_item_array[$our_item->ebay_item_id]['modified'] = $our_item->modified;\n $our_item_array[$our_item->ebay_item_id]['flow'] = $our_item->flow;\n $our_item_array[$our_item->ebay_item_id]['referral_ebay_item_id'] = $our_item->referral_ebay_item_id;\n $our_item_array[$our_item->ebay_item_id]['price'] = $our_item->price;\n $our_item_array[$our_item->ebay_item_id]['log'] = $our_item->log;\n }\n\n// based on ours items we collect corresponding items our competition\n $ebay_tracking_array = array();\n foreach ($our_item_array as $our_ebay_item_id => $details) {\n\n// get all our items referral_ebay_item_id = 1\n $criteria = new CDbCriteria();\n $criteria->condition = 'flow = ' . EbayTracking::COMPETITOR_ITEM . ' AND referral_ebay_item_id = ' . $our_ebay_item_id;\n $competitor_EbayTracking = EbayTracking::model()->findAll($criteria);\n//\n $ebay_tracking_array[$our_ebay_item_id] = $our_item_array[$our_ebay_item_id];\n\n// create php for competitor_item array to use \n foreach ($competitor_EbayTracking as $competitor_item) {\n $ebay_tracking_array[$competitor_item->ebay_item_id]['level'] = 'child';\n $ebay_tracking_array[$competitor_item->ebay_item_id]['id'] = $competitor_item->id;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['ebay_item_id'] = $competitor_item->ebay_item_id;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['modified'] = $competitor_item->modified;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['flow'] = $competitor_item->flow;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['referral_ebay_item_id'] = $competitor_item->referral_ebay_item_id;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['price'] = $competitor_item->price;\n $ebay_tracking_array[$competitor_item->ebay_item_id]['log'] = $competitor_item->log;\n }\n }\n return $ebay_tracking_array;\n }", "public function getRawData() {}", "function scrapeBusinessPage($AHSID){\n $url = ALL_BUSINESS_OPT_URL . $AHSID;\n //get simplehtmldom object\n $html = $this->getPage($url);\n //get a Business object form the page\n $business = $this->parseBusinessPage($html, $AHSID);\n //get an Inspection object from business page\n $inspections = $this->parseInspections($html);\n //If there was more than one inspection we will add another query string to show all of the violations\n if(count($inspections) > 1){\n //clear $html to avoid memory leaks\n $html->clear();\n unset($html);\n $html = null;\n //get url that shows all violations\n $vURL = ALL_BUSINESS_OPT_URL . $AHSID . ALL_VIOL_END_QUERY;\n $html = $this->getPage($vURL);\n }\n //get Violation object from business page\n $violations = $this->parseViolations($html, count($inspections));\n // sync violations with inspections\n foreach ($inspections as $inspection) {\n $subViolArray = array();\n $iDate = $inspection->getDate();\n if(!empty($violations)){\n foreach ($violations as $violation) {\n //get violation date and strip any tags\n $vDate = strip_tags($violation->getDate());\n if($vDate == $iDate || $vDate == \"\"){\n array_push($subViolArray, $violation);\n }\n }\n //place violation array in the inspection object\n $inspection->setViolations($subViolArray);\n }\n }\n // update Business object's inspection array\n $business->setInspectionsArray($inspections);\n //clear $html to avoid memory leaks\n $html->clear();\n unset($html);\n $html = null;\n return $business;\n }", "function IPETrackingBuscarGuia($agecod,$tipfor,$guinro)\r{\r\r\t$client = new IPETrackingWS();\r\r\t$token = new VerifyToken();\r\t$token->token = 'CE47345CC893D75CE19E103825117ABA';\r\r\t$validateToken = $client->VerifyToken($token);\r\r\tif($validateToken->VerifyTokenResult)\r\t{\r\t\t$query = new BuscarGuia();\r\t\t\r\t\t$query->token = $token->token;\r\t\t\r\t\t$query->agecod = $agecod;\r\t\t$query->tipfor = $tipfor;\r\t\t$query->guinro = $guinro;\r\t\t\r\t\t$queryResult = $client->BuscarGuia($query);\r\t\t\r\t\treturn $queryResult->BuscarGuiaResult;\r\t}\r\t\r\treturn null;\r\t\r}", "private function getData()\n\t{\n\t\t// get the record\n\t\t$this->record = (array) BackendBannersModel::get($this->id);\n\n\t\t// no item found, throw an exceptions, because somebody is fucking with our URL\n\t\tif(empty($this->record)) $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');\n\t}", "public function getRawData();", "public function getRawData();", "public function getRecordInformation() {}", "public function get_data_for_xlpro_hotel($htl_data)\r\n\t{\r\n\t\t$booking = $htl_data['data'];\r\n\t\t// debug($booking);exit();\r\n\t\t$no_of_pax = count($booking['booking_customer_details']);\r\n\r\n\t\t$doc_srno = 1;\r\n\t\t// loop for each pax\r\n\t\tfor($i = 0; $i < $no_of_pax; $i++) {\r\n\t\t\t$customer = $booking['booking_customer_details'][$i];\r\n\t\t\t// invouce no\r\n\t\t\t$doc_no = '';\r\n\r\n\t\t\t$agent_info = false;\r\n\t\t\t// pax sr no \r\n\t\t\t$doc_srno = $i+1;\r\n\t\t\t$idate = date('d/m/Y', strtotime($booking['booking_details'][0]['created_datetime']));\r\n\t\t\t\r\n\t\t\t$ccode = ''; // C + 5char clint code as per account client master\r\n\t\t\t// if( $booking['booking_details'][0]['created_by_id'] > 0 ) {\r\n\t\t\tif( $customer['employee_id'] > 0 ) {\r\n\t\t\t\t// get the agent client code\r\n\t\t\t\t$agent_info = $this->get_employee_xlcode($customer['employee_id']);\r\n\t\t\t\t// debug($agent_info);exit();\r\n\t\t\t\t$agent_info = $agent_info[0];\r\n\r\n\t\t\t\tif(!empty($agent_info)) {\r\n\t\t\t\t\t// remove this condition later\r\n\t\t\t\t\tif(empty($agent_info['e_xl_code'])) {\r\n\t\t\t\t\t\tif(empty($agent_info['c_xl_code'])) {\r\n\t\t\t\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$ccode = 'C'.$agent_info['c_xl_code'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$ccode = 'C'.$agent_info['e_xl_code'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$ccode = 'C'.'U0003';\r\n\t\t\t}\r\n\t\t\t$doc_nos = $booking['booking_details'][0]['xlpro_invoice_no'];\r\n\t\t\t$hcode = 'H00000';\r\n\t\t\t$hcode = $this->get_hotel_code($booking['booking_details'][0]['hotel_name']);\r\n\r\n\t\t\t// if hotel paid for booking\r\n\t\t\t$scode = $hcode;\r\n\r\n\t\t\t$hotel_name = '';\r\n\t\t\tif($hcode == 'H00000') {\r\n\t\t\t\t$hotel_name = $booking['booking_details'][0]['hotel_name'] ;\r\n\t\t\t} elseif (empty($hcode)) {\r\n\t\t\t\t$hotel_name = $booking['booking_details'][0]['hotel_name'] ;\r\n\t\t\t}\r\n\r\n\t\t\t$ticketno = 'HW'.$doc_nos.$doc_srno;\r\n\t\t\t$pax = $customer['first_name'] . ' ' . $customer['last_name'];\r\n\t\t\t$check_in_date = date('d/m/Y', strtotime($booking['booking_details'][0]['hotel_check_in']));\r\n\t\t\t$check_out_date = date('d/m/Y', strtotime($booking['booking_details'][0]['hotel_check_out']));\r\n\r\n\t\t\t// as per city master tabel in xlpro\r\n\t\t\t$city_code = '000';\r\n\t\t\t$city_code = $this->get_hotel_city_code($booking['booking_details'][0]['location']);\r\n\t\t\t$room_name = $booking['booking_itinerary_details'][0]['room_type_name'];\r\n\t\t\t$room_type = $booking['booking_itinerary_details'][0]['room_type'];\r\n\t\t\t$roomtype = '000';\r\n\t\t\t\r\n\r\n\t\t\t$total_supplier = 0;\r\n\t\t\t$total_client = 0;\r\n\r\n\t\t\t// echo $room_cnt;\r\n\t\t\t$room_sgl_nos = 0;\r\n\t\t\t$room_sgl_pax = 0;\r\n\t\t\t$room_sgl_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_dbl_nos = 0;\r\n\t\t\t$room_dbl_pax = 0;\r\n\t\t\t$room_dbl_rate = 0;\r\n\r\n\t\t\t$room_twn_nos = 0;\r\n\t\t\t$room_twn_pax = 0;\r\n\t\t\t$room_twn_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_trp_nos = 0;\r\n\t\t\t$room_trp_pax = 0;\r\n\t\t\t$room_trp_rate = 0;\r\n\t\t\t\r\n\t\t\t$room_qad_nos = 0;\r\n\t\t\t$room_qad_pax = 0;\r\n\t\t\t$room_qad_rate = 0;\r\n\r\n\t\t\t$count = count($booking['booking_customer_details']);\r\n\r\n\t\t\t// if excel room code is not selected while update\r\n\t\t\tif(empty($room_type)) {\r\n\t\t\t\t$roomtype = $this->get_room_type($room_name);\r\n\r\n\t\t\t\tif(strcasecmp($room_name,'triple') == 0) {\r\n\t\t\t\t\t$room_trp_nos = 1;\r\n\t\t\t\t\t$room_trp_pax = 1;\r\n\t\t\t\t\t$room_trp_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_trp_rate;\r\n\t\t\t\t\t$total_client = $room_trp_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t} elseif (strcasecmp($room_name,'double') == 0) {\r\n\t\t\t\t\t$room_twn_nos = 1;\r\n\t\t\t\t\t$room_twn_pax = 1;\r\n\t\t\t\t\t$room_twn_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_twn_rate;\r\n\t\t\t\t\t$total_client = $room_twn_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t$dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$roomtype = $room_type;\r\n\t\t\t\tswitch ($room_type) {\r\n\t\t\t\t\tcase 'D01':\r\n\t\t\t\t\t\t$room_dbl_nos = 1;\r\n\t\t\t\t\t\t$room_dbl_pax = 1;\r\n\t\t\t\t\t\t$room_dbl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_dbl_rate;\r\n\t\t\t\t\t\t$total_client = $room_dbl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'Q01':\r\n\t\t\t\t\t\t$room_qad_nos = 1;\r\n\t\t\t\t\t\t$room_qad_pax = 1;\r\n\t\t\t\t\t\t$room_qad_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_qad_rate;\r\n\t\t\t\t\t\t$total_client = $room_qad_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'S01':\r\n\t\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'T00':\r\n\t\t\t\t\t\t$room_trp_nos = 1;\r\n\t\t\t\t\t\t$room_trp_pax = 1;\r\n\t\t\t\t\t\t$room_trp_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_trp_rate;\r\n\t\t\t\t\t\t$total_client = $room_trp_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'T01':\r\n\t\t\t\t\t\t$room_twn_nos = 1;\r\n\t\t\t\t\t\t$room_twn_pax = 1;\r\n\t\t\t\t\t\t$room_twn_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_twn_rate;\r\n\t\t\t\t\t\t$total_client = $room_twn_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t// use single room code\r\n\t\t\t\t\t\t$room_sgl_nos = 1;\r\n\t\t\t\t\t\t$room_sgl_pax = 1;\r\n\t\t\t\t\t\t$room_sgl_rate = round($booking['booking_itinerary_details'][0]['total_fare']/$count);\r\n\t\t\t\t\t\t$total_supplier = $room_sgl_rate;\r\n\t\t\t\t\t\t$total_client = $room_sgl_rate;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t// $dat = $this->calc_hotel_management_fee($total_client, $agent_info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$info['c_user_id'] = $agent_info['c_user_id'];\r\n\t\t\t\t$query = $this->CI->db->query('SELECT state_name, state_gst from crs_hotel_details where origin = '. $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$htl = $query->result_array();\r\n\t\t\t\t$info['gst_state_name'] = $htl[0]['state_name'];\r\n\t\t\t\t$info['gst_state'] = $htl[0]['state_gst'];\r\n\t\t\t\t$dat = $this->calc_hotel_management_fee_gst ($total_client, $info, $booking['booking_details'][0]['hotel_code']);\r\n\t\t\t\t$srv_chrg1c = $dat['data']['srv_chrg1c'];\r\n\t\t\t\t$serv_educ = $dat['data']['serv_educ'];\r\n\t\t\t\t$serv_taxc = $dat['data']['serv_taxc'];\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$nos_pax_a = 0;\r\n\t\t\t$nos_pax_c = 0;\r\n\t\t\tif($customer['pax_type'] == 'Adult') {\r\n\t\t\t\t$nos_pax_a = 1;\r\n\t\t\t} elseif ($customer['pax_type'] == 'Child') {\r\n\t\t\t\t$nos_pax_c = 1;\r\n\t\t\t}\r\n\r\n\t\t\t$at = array('management_fee' => $srv_chrg1c);\r\n\t\t\t$condition = array('app_reference' => $booking['booking_itinerary_details'][0]['app_reference']);\r\n\t\t\t$dst = $this->CI->custom_db->update_record('hotel_booking_itinerary_details', $at, $condition);\r\n\r\n\t\t\t$result[] = $this->format_for_xlwebpro_htl($doc_nos, $doc_srno, $idate, $ccode, $scode, $hotel_name, $ticketno, $pax, $check_in_date, $check_out_date, $city_code, $total_client, $total_supplier, $nos_pax_a, $nos_pax_c, $room_sgl_nos, $room_sgl_pax, $room_sgl_rate, $room_trp_nos, $room_trp_pax, $room_trp_rate, $room_qad_nos, $room_qad_pax, $room_qad_rate, $room_twn_nos, $room_twn_pax, $room_twn_rate, $room_dbl_nos, $room_dbl_pax, $room_dbl_rate, $roomtype, $srv_chrg1c, $serv_educ, $serv_taxc, $hcode );\r\n\t\t} // END LOOP\r\n\t\t// debug($result);\r\n\t\t// exit();\r\n\t\t$result['cols'] = array(\r\n\t\t\t'doc_prf' => 'DOC_PRF',\r\n\t\t\t'doc_nos' => 'DOC_NOS',\r\n\t\t\t'doc_srno' => 'DOC_SRNO',\r\n\t\t\t'idm_flag' => 'IDM_FLAG',\r\n\t\t\t'il_ref' => 'IL_REF',\r\n\t\t\t'vd_ref' => 'VD_REF',\r\n\t\t\t'idate' => 'IDATE',\r\n\t\t\t'ccode' => 'CCODE',\r\n\t\t\t'dcode' => 'DCODE',\r\n\t\t\t'ecode' => 'ECODE',\r\n\t\t\t'bcode' => 'BCODE',\r\n\t\t\t'narration' => 'NARRATION',\r\n\t\t\t'xo_ref' => 'XO_REF',\r\n\t\t\t'loc_code' => 'LOC_CODE',\r\n\t\t\t'cst_code' => 'CST_CODE',\r\n\t\t\t'curcode_c' => 'CURCODE_C',\r\n\t\t\t'curcode_s' => 'CURCODE_S',\r\n\t\t\t'refr_key' => 'REFR_KEY',\r\n\t\t\t'gcode' => 'GCODE',\r\n\t\t\t'hcode' => 'HCODE',\r\n\t\t\t'scode' => 'SCODE',\r\n\t\t\t'hotel_name' => 'HOTEL_NAME',\r\n\t\t\t'xo_nos' => 'XO_NOS',\r\n\t\t\t'ticketno' => 'TICKETNO',\r\n\t\t\t'pax' => 'PAX',\r\n\t\t\t'check_in_date' => 'CHECK_IN_DATE',\r\n\t\t\t'check_out_date' => 'CHECK_OUT_DATE',\r\n\t\t\t'roomview' => 'ROOMVIEW',\r\n\t\t\t'mealplan ' => 'MEALPLAN ',\r\n\t\t\t'roomtype' => 'ROOMTYPE',\r\n\t\t\t'tarifftype' => 'TARIFFTYPE',\r\n\t\t\t'pkg_code' => 'PKG_CODE',\r\n\t\t\t'city' => 'CITY',\r\n\t\t\t'room_sgl_nos' => 'ROOM_SGL_NOS',\r\n\t\t\t'room_sgl_pax' => 'ROOM_SGL_PAX',\r\n\t\t\t'room_sgl_rate' => 'ROOM_SGL_RATE',\r\n\t\t\t'room_sgl_purmth' => 'ROOM_SGL_PURMTH',\r\n\t\t\t'room_sgl_purval' => 'ROOM_SGL_PURVAL',\r\n\t\t\t'room_dbl_nos' => 'ROOM_DBL_NOS',\r\n\t\t\t'room_dbl_pax' => 'ROOM_DBL_PAX',\r\n\t\t\t'room_dbl_rate' => 'ROOM_DBL_RATE',\r\n\t\t\t'room_dbl_purmth' => 'ROOM_DBL_PURMTH',\r\n\t\t\t'room_dbl_purval' => 'ROOM_DBL_PURVAL',\r\n\t\t\t'room_twn_nos' => 'ROOM_TWN_NOS',\r\n\t\t\t'room_twn_pax' => 'ROOM_TWN_PAX',\r\n\t\t\t'room_twn_rate' => 'ROOM_TWN_RATE',\r\n\t\t\t'room_twn_purmth' => 'ROOM_TWN_PURMTH',\r\n\t\t\t'room_twn_purval' => 'ROOM_TWN_PURVAL',\r\n\t\t\t'room_trp_nos' => 'ROOM_TRP_NOS',\r\n\t\t\t'room_trp_pax' => 'ROOM_TRP_PAX',\r\n\t\t\t'room_trp_rate' => 'ROOM_TRP_RATE',\r\n\t\t\t'room_trp_purmth' => 'ROOM_TRP_PURMTH',\r\n\t\t\t'room_trp_purval' => 'ROOM_TRP_PURVAL',\r\n\t\t\t'room_qad_nos' => 'ROOM_QAD_NOS',\r\n\t\t\t'room_qad_pax' => 'ROOM_QAD_PAX',\r\n\t\t\t'room_qad_rate' => 'ROOM_QAD_RATE',\r\n\t\t\t'room_qad_purmth' => 'ROOM_QAD_PURMTH',\r\n\t\t\t'room_qad_purval' => 'ROOM_QAD_PURVAL',\r\n\t\t\t'room_adt_nos' => 'ROOM_ADT_NOS',\r\n\t\t\t'room_adt_pax' => 'ROOM_ADT_PAX',\r\n\t\t\t'room_adt_rate' => 'ROOM_ADT_RATE',\r\n\t\t\t'room_adt_purmth' => 'ROOM_ADT_PURMTH',\r\n\t\t\t'room_adt_purval' => 'ROOM_ADT_PURVAL',\r\n\t\t\t'room_chd_nos' => 'ROOM_CHD_NOS',\r\n\t\t\t'room_chd_pax' => 'ROOM_CHD_PAX',\r\n\t\t\t'room_chd_rate' => 'ROOM_CHD_RATE',\r\n\t\t\t'room_chd_purmth' => 'ROOM_CHD_PURMTH',\r\n\t\t\t'room_chd_purval' => 'ROOM_CHD_PURVAL',\r\n\t\t\t'room_cwb_nos' => 'ROOM_CWB_NOS',\r\n\t\t\t'room_cwb_pax' => 'ROOM_CWB_PAX',\r\n\t\t\t'room_cwb_rate' => 'ROOM_CWB_RATE',\r\n\t\t\t'room_cwb_purmth' => 'ROOM_CWB_PURMTH',\r\n\t\t\t'room_cwb_purval' => 'ROOM_CWB_PURVAL',\r\n\t\t\t'room_foc_nos' => 'ROOM_FOC_NOS',\r\n\t\t\t'room_foc_pax' => 'ROOM_FOC_PAX',\r\n\t\t\t'room_foc_rate' => 'ROOM_FOC_RATE',\r\n\t\t\t'room_foc_purmth' => 'ROOM_FOC_PURMTH',\r\n\t\t\t'room_foc_purval' => 'ROOM_FOC_PURVAL',\r\n\t\t\t'stx_cenvat' => 'STX_CENVAT',\r\n\t\t\t'stx_method' => 'STX_METHOD',\r\n\t\t\t'nos_pax_a' => 'NOS_PAX_A',\r\n\t\t\t'nos_pax_c' => 'NOS_PAX_C',\r\n\t\t\t'nos_pax_i' => 'NOS_PAX_I',\r\n\t\t\t'narr_1' => 'NARR_1',\r\n\t\t\t'narr_2' => 'NARR_2',\r\n\t\t\t'narr_3' => 'NARR_3',\r\n\t\t\t'narr_4' => 'NARR_4',\r\n\t\t\t'narr_5' => 'NARR_5',\r\n\t\t\t'narr_6' => 'NARR_6',\r\n\t\t\t'r_o_e_c' => 'R_O_E_C',\r\n\t\t\t'r_o_e_s' => 'R_O_E_S',\r\n\t\t\t'basic_c' => 'BASIC_C',\r\n\t\t\t'basic_s' => 'BASIC_S',\r\n\t\t\t'tax_c' => 'TAX_C',\r\n\t\t\t'tax_s' => 'TAX_S',\r\n\t\t\t'disc_paidm1' => 'DISC_PAIDM1',\r\n\t\t\t'disc_paidm2' => 'DISC_PAIDM2',\r\n\t\t\t'disc_recdm1' => 'DISC_RECDM1',\r\n\t\t\t'brok_paidm1' => 'BROK_PAIDM1',\r\n\t\t\t'disc_paidv1' => 'DISC_PAIDV1',\r\n\t\t\t'disc_recdv1' => 'DISC_RECDV1',\r\n\t\t\t'brok_paidv1' => 'BROK_PAIDV1',\r\n\t\t\t'disc_paid1' => 'DISC_PAID1',\r\n\t\t\t'disc_recd1' => 'DISC_RECD1',\r\n\t\t\t'brok_paid1' => 'BROK_PAID1',\r\n\t\t\t'srv_paidm2' => 'SRV_PAIDM2',\r\n\t\t\t'srv_chrg1c' => 'SRV_CHRG1C',\r\n\t\t\t'srv_chrg2c' => 'SRV_CHRG2C',\r\n\t\t\t'srv_chrg3c' => 'SRV_CHRG3C',\r\n\t\t\t'raf_c' => 'RAF_C',\r\n\t\t\t'srv_chrg1p' => 'SRV_CHRG1P',\r\n\t\t\t'srv_chrg2p' => 'SRV_CHRG2P',\r\n\t\t\t'srv_chrg3p' => 'SRV_CHRG3P',\r\n\t\t\t'raf_p' => 'RAF_P',\r\n\t\t\t'serv_taxc' => 'SERV_TAXC',\r\n\t\t\t'serv_educ' => 'SERV_EDUC',\r\n\t\t\t'tdc_paidv1' => 'TDC_PAIDV1',\r\n\t\t\t'tds_c' => 'TDS_C',\r\n\t\t\t'serv_taxp' => 'SERV_TAXP',\r\n\t\t\t'serv_edup' => 'SERV_EDUP',\r\n\t\t\t'tds_paidv1' => 'TDS_PAIDV1',\r\n\t\t\t'tds_p' => 'TDS_P',\r\n\t\t\t'tdb_paidv1' => 'TDB_PAIDV1',\r\n\t\t\t'tds_b' => 'TDS_B',\r\n\t\t\t'created_by' => 'CREATED_BY',\r\n\t\t\t'created_on' => 'CREATED_ON',\r\n\t\t\t);\r\n\t\treturn $result;\r\n\t}", "function narrative_track_data($narrative_id)\n{\n $CI =& get_instance();\n $base_dir = $CI->config->item('site_data_dir') . '/' . $narrative_id;\n $path = $base_dir . \"/AudioTimes.xml\";\n if (!file_exists($path))\n {\n return FALSE;\n }\n $xml_reader = simplexml_load_file($path);\n $paths = array('tracks' => array(), 'pictures' => array());\n $last_picture = '';\n\n foreach ($xml_reader->Narrative as $narrative)\n {\n $paths['tracks'][] = $CI->config->item('site_data_dir') . '/' . $narrative_id . '/' . $narrative->Mp3Name;\n\n if (strcmp($last_picture, $narrative->Image))\n {\n $last_picture = $narrative->Image;\n $paths['pictures'][] = $CI->config->item('site_data_dir') . '/' . $narrative_id . '/' . $last_picture;\n }\n }\n\n return $paths;\n}", "public function Individualgetdata();" ]
[ "0.53232366", "0.5309724", "0.5239556", "0.5219601", "0.51100516", "0.5078303", "0.5049868", "0.4967216", "0.49184638", "0.49145064", "0.4905321", "0.48681128", "0.48681128", "0.48600742", "0.48323372", "0.47809556", "0.4761784", "0.4750168", "0.47463217", "0.47186333", "0.46882328", "0.46603277", "0.4658969", "0.46577138", "0.46451554", "0.46451554", "0.46427587", "0.46211293", "0.46174735", "0.46069345" ]
0.6057252
0
Get List of AWB by Reference Number
public function getAWBbyReference(string $reference_no) { return $this->send('POST', 'getAWBbyReference', compact('reference_no')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAddressBooks();", "public function getReferencesList(){\n return $this->_get(1);\n }", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "private function parse_reference_page($ref_no)\n {\n // $ref_no = 7728; //debug only\n $final = array();\n $url = $this->page['reference_page'].$ref_no;\n if($html = Functions::lookup_with_cache($url, $this->download_options)) {\n if(preg_match_all(\"/<tr class=\\\"(.*?)<\\/tr>/ims\", $html, $arr)) {\n foreach($arr[1] as $str) {\n $rec = array();\n if(preg_match(\"/<td class=\\\"biblio-row-title\\\">(.*?)<\\/td>/ims\", $str, $arr2)) $field = $arr2[1];\n if(preg_match(\"/<td>(.*?)<\\/td>/ims\", $str, $arr2)) $value = $arr2[1];\n if($field && $value) $final[$field] = $value;\n }\n }\n }\n return $final;\n }", "public function getBioSamplesList() {\n return $this->_get(11);\n }", "public function getActiveAddressBooks();", "function get_list_file_download($params) {\n $sql = \"SELECT a.file_id, b.ref_name \n FROM fa_files a\n INNER JOIN fa_file_reference b ON a.ref_id = b.ref_id\n WHERE data_id = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getBookList()\n {\n return $this->bookDao->getBookList();\n }", "public function queryReferencesByReference($ref_id){\n $result=$this->query(\"SELECT page_id FROM Reference WHERE ref_id='$ref_id'\");\n }", "public function getBulanRef()\n {\n return $this->db->get('ref_Bulan')->result_array();\n }", "public function getRefBancaria(){\n return $this->ref_bancaria->toArray();\n }", "public function getAwardIdList()\n {\n $sql = \"SELECT id FROM casino_award \";\n return $this->_rdb->fetchAll($sql);\n }", "public function queryReferencesByPage($page_id){\n $result=$this->query(\"SELECT ref_id FROM Reference WHERE page_id='$page_id'\");\n\n return $result->fetch_all();\n }", "public function getOtherBioSamplesList() {\n return $this->_get(13);\n }", "public function getBookList()\n\t{\n\t\treturn array(\n\t\t\t\"1\" => new Book(\"Être et Temps\", \"9782070707393\", 1, 1, 1),\n\t\t\t\"2\" => new Book(\"Finnegans Wake\", \"9782070402250\", 2, 2, 2),\n\t\t\t\"3\" => new Book(\"Critique de la raison pure\", \"9782070325757\", 3, 3, 3)\n\t\t);\n\t}", "public function getBorrowings();", "public function getSubawards(){\n\t\t$connection = Database::getConnection();\n\t\t$query = \"SELECT * FROM watson WHERE status!='Award -- Terminated' and shortAwardNumber!='' ORDER BY shortAwardNumber\";\n\t\t$items=\"\";\n\t\t$result_obj=$connection->query($query);\n\t\ttry{\n\t\t\twhile($result = $result_obj->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$items[]=$result;\n\t\t\t}\n\t\t\treturn($items);\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "function ldap_queryabooks($filter,$types){\n global $conf;\n global $LDAP_CON;\n\n // make sure $types is an array\n if(!is_array($types)){\n $types = explode(',',$types);\n $types = array_map('trim',$types);\n }\n\n $results = array();\n $result1 = array();\n $result2 = array();\n $result3 = array();\n\n // public addressbook\n $sr = @ldap_search($LDAP_CON,$conf['publicbook'],\n $filter,$types);\n tpl_ldaperror();\n $result1 = ldap_get_binentries($LDAP_CON, $sr);\n ldap_free_result($sr);\n\n // private addressbook\n if(!empty($_SESSION['ldapab']['binddn']) && $conf['privatebook']){\n $sr = @ldap_list($LDAP_CON,$conf['privatebook'].\n ','.$_SESSION['ldapab']['binddn'],\n $filter,$types);\n if(ldap_errno($LDAP_CON) != 32) tpl_ldaperror(); // ignore missing address book\n $result2 = ldap_get_binentries($LDAP_CON, $sr);\n }\n\n // user account entries\n if ($conf['displayusertree']) {\n $sr = @ldap_list($LDAP_CON,$conf['usertree'],\n $filter,$types);\n tpl_ldaperror();\n $result3 = ldap_get_binentries($LDAP_CON, $sr);\n ldap_free_result($sr);\n }\n\n\n\n // return merged results\n return array_merge((array)$result1,(array)$result2,(array)$result3);\n}", "public function getBrochures(){\n\t\n\t\tif( empty($this->_brochures) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'b.bro_id AS value, b.bro_title AS text' );\n\t\t\t$query->from( '#__zbrochure_brochures AS b' );\n\t\t\t$query->where( 'b.bro_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_brochures = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_brochures;\n\t\n\t}", "function reference_from_page($pages)\n{\n\tglobal $db;\n\t\n\t$references = array();\n\t\n\t$sql = 'SELECT * from rdmp_reference_page_joiner WHERE PageID IN (' . join(\",\", $pages) . ')';\n\n\t$result = $db->Execute($sql);\n\tif ($result == false) die(\"failed [\" . __FILE__ . \":\" . __LINE__ . \"]: \" . $sql);\n\t\n\twhile (!$result->EOF) \n\t{\n\t\t$references[$result->fields['PageID']] = $result->fields['reference_id'];\n\t\t$result->MoveNext();\t\t\t\t\n\t}\t\n\t\n\t$references = array_unique($references);\n\t\n\treturn $references;\n}", "function orcid_works($obj)\n{\n\t$links = array();\n\t\n\t$works = array();\n\t\n\t// Extract works\n\t\n\tif (isset($obj->{'orcid-profile'}->{'orcid-activities'}))\n\t{\n\t\t$works = $obj->{'orcid-profile'}->{'orcid-activities'}->{'orcid-works'}->{'orcid-work'};\n\t\t\n\t\tif ($works)\n\t\t{\n\t\t\tforeach ($works as $work)\n\t\t\t{\n\t\t\t\t$reference = new stdclass;\n\t\n\t\t\t\t// Use put-code as bnode identifier\n\t\t\t\t$reference->id = $work->{'put-code'};\n\t\t\n\t\t\t\t$reference->title = $work->{'work-title'}->{'title'}->value;\n\t\n\t\t\t\t// Journal?\n\t\t\t\tif (isset($work->{'journal-title'}->value))\n\t\t\t\t{\n\t\t\t\t\t$reference->journal = $work->{'journal-title'}->value;\n\t\t\t\t}\t\t\n\t\t\n\t\t\t\t// date\n\t\t\t\t$date = '';\n\t\t\t\tif (isset($work->{'publication-date'}))\n\t\t\t\t{\n\t\t\t\t\tif (isset($work->{'publication-date'}->{'year'}->value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$date = $work->{'publication-date'}->{'year'}->value;\n\t\t\t\t\t}\n\t\t\t\t\t$reference->date = $date;\n\t\t\t\t}\n\t\t\n\n\t\t\t\t// Parse BibTex-------------------------------------------------------------------\n\t\t\t\tif (isset($work->{'work-citation'}->citation))\n\t\t\t\t{\n\t\t\t\t\t$bibtext = $work->{'work-citation'}->citation;\n\t\t\n\t\t\t\t\tif (!isset($work->{'journal-title'}->value))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (preg_match('/journal = \\{(?<journal>.*)\\}/Uu', $bibtext, $m))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$reference->journal = $m['journal'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif ($date == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif (preg_match('/year = \\{(?<year>[0-9]{4})\\}/', $bibtext, $m))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$reference->date = $m['year'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tif (preg_match('/volume = \\{(?<volume>.*)\\}/Uu', $bibtext, $m))\n\t\t\t\t\t{\n\t\t\t\t\t\t$reference->volume = $m['volume'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (preg_match('/number = \\{(?<issue>.*)\\}/Uu', $bibtext, $m))\n\t\t\t\t\t{\n\t\t\t\t\t\t$reference->issue = $m['issue'];\n\t\t\t\t\t}\n\n\t\t\t\t\t// pages = {41-68}\n\t\t\t\t\tif (preg_match('/pages = \\{(?<pages>.*)\\}/Uu', $bibtext, $m))\n\t\t\t\t\t{\n\t\t\t\t\t\t$pages = $m['pages'];\n\t\t\t\t\t\tif (preg_match('/(?<spage>\\d+)-[-]?(?<epage>\\d+)/', $pages, $mm))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$reference->pageStart = $mm['spage'];\n\t\t\t\t\t\t\t$reference->pageEnd = $mm['epage'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t$reference->pages = $pages;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\n\t\t\t\t// Identifiers\n\t\t\t\tif (isset($work->{'work-external-identifiers'}))\n\t\t\t\t{\n\t\t\t\t\tforeach ($work->{'work-external-identifiers'}->{'work-external-identifier'} as $identifier)\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($identifier->{'work-external-identifier-type'})\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'DOI':\n\t\t\t\t\t\t\t\t$value = $identifier->{'work-external-identifier-id'}->value;\n\t\t\t\t\t\t\t\t// clean\n\t\t\t\t\t\t\t\t$value = preg_replace('/^doi:/', '', $value);\n\t\t\t\t\t\t\t\t$value = preg_replace('/\\.$/', '', $value);\n\t\t\t\t\t\t\t\t$value = preg_replace('/\\s+/', '', $value);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t// DOI\n\t\t\t\t\t\t\t\t$reference->doi = $value;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'ISBN':\n\t\t\t\t\t\t\t\t$value = $identifier->{'work-external-identifier-id'}->value;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($work_type == 'BOOK')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$reference->isbn = $value;\n\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\tbreak;\n\n\t\t\t\t\t\t\tcase 'ISSN':\n\t\t\t\t\t\t\t\t$value = $identifier->{'work-external-identifier-id'}->value;\n\t\t\t\t\t\t\t\t$parts = explode(\";\", $value);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$reference->issn = $parts;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'PMC':\n\t\t\t\t\t\t\t\t$value = $identifier->{'work-external-identifier-id'}->value;\n\t\t\t\t\t\t\t\t$reference->pmc = $value;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'PMID':\n\t\t\t\t\t\t\t\t$value = $identifier->{'work-external-identifier-id'}->value;\n\t\t\t\t\t\t\t\t$reference->pmid = $value;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t// URL\n\t\t\t\tif (isset($work->{'url'}))\n\t\t\t\t{\n\t\t\t\t\tif (isset($work->{'url'}->{'value'}))\n\t\t\t\t\t{\n\t\t\t\t\t\t$urls = explode(\",\", $work->{'url'}->{'value'});\n\t\t\t\t\t\t$reference->url = $urls[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// look for DOI if not present\n\t\t\t\tif (!isset($reference->doi))\n\t\t\t\t{\n\t\t\t\t\t$citation = '';\n\t\t\t\t\tif (isset($reference->title))\n\t\t\t\t\t{\n\t\t\t\t\t\t$citation = $reference->title;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($reference->journal))\n\t\t\t\t\t{\n\t\t\t\t\t\t$citation .= ' ' . $reference->journal;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($citation != '')\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\techo \"Looking up \\\"$citation\\\"... \";\n\t\t\t\t\t\t$result = crossref_search($citation);\n\t\t\t\t\t\tif (isset($result->doi))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo $result->doi;\n\t\t\t\t\t\t\t$reference->doi = $result->doi;\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// keep track of these for now\n\t\t\t\t$works[] = $reference;\n\t\t\n\t\t\t\t// links for this work\n\t\t\t\t$link = '';\n\t\t\t\tif ($link == '')\n\t\t\t\t{\n\t\t\t\t\tif (isset($reference->doi))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link = 'http://dx.doi.org/' . $reference->doi;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($link == '')\n\t\t\t\t{\n\t\t\t\t\tif (isset($reference->pmid))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link = 'http://www.ncbi.nlm.nih.gov/pubmed/' . $reference->pmid;\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\tif ($link == '')\n\t\t\t\t{\n\t\t\t\t\tif (isset($reference->pmc))\n\t\t\t\t\t{\n\t\t\t\t\t\t$link = 'http://www.ncbi.nlm.nih.gov/pmc/articles/' . $reference->pmc;\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\n\t\t\t\tif ($link != '')\n\t\t\t\t{\n\t\t\t\t\t$links[] = $link;\n\t\t\t\t}\n\t\t\n\t\t\t\t// links for container\n\t\t\t\tif (isset($reference->issn))\n\t\t\t\t{\n\t\t\t\t\tforeach ($reference->issn as $issn)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t$link = 'http://www.worldcat.org/issn/' . $issn;\n\t\t\t\t\t\tif (!in_array($link, $links))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$links[] = $link;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\n\t\t\t}\n\t\t}\n\t}\t\n\tprint_r($links);\n\t\n\treturn $links;\t\n\t\n}", "public static function getList()\n\t{\n\t\treturn Letdown::select('move_doc_number')\n\t\t\t->where('lt_status', '=', 0)->get();\n\t}", "public function getListingBooks()\n {\n return $this->listingBooks;\n }", "public function getReferenceSetsList(){\n return $this->_get(1);\n }", "public function getBibData($findno) {\r\r\n\t\treturn $this->dbHandle->sql_query(\"SELECT b.auth, b.title1, b.title2, b.year, b.picture, b.bibtype FROM rp_bib b, rp_findbib f WHERE f.findno=\".$findno.\" AND b.bibno=f.bibno ORDER BY b.year ASC;\");\r\r\n\t}", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function getBorrowList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$book = D('Borrow');\n\t\t\t$sql = \"SELECT * FROM lib_borrow left join lib_book_unique using(book_id) join lib_book_species using (isbn) join lib_user using (user_id);\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\tfor($k=0;$k<count($return);$k++){\n\t\t\t\t\t$return[$k]['book_id'] = substr($return[$k]['book_id']+100000,1,5);\n\t\t\t\t}\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'query error'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function getReferences() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('references'));\n return (is_array($result)) ? reset($result) : $result;\n }", "public static function findByReference($reference) {\n\t\t\t\n\t\t\treturn Booking::where('reference', $reference)->first();\n\t\t}", "public function getListing(){\n $BusInfo = $this->BusinessOwnerModel->getBusinessID();\n \n foreach($BusInfo as $row1){\n $busID = $row1->bid;\n }\n \n $query = $this->db->get_where('BusinessListing', array('bid' => $busID));\n \n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }" ]
[ "0.557477", "0.5542515", "0.55289024", "0.54825747", "0.5428923", "0.5311744", "0.52591854", "0.52557635", "0.52177304", "0.52170736", "0.5157964", "0.5144432", "0.514197", "0.51402044", "0.5106787", "0.50905496", "0.5080884", "0.50708956", "0.50442415", "0.5011077", "0.4958191", "0.49570322", "0.4948737", "0.49086258", "0.48923296", "0.48811337", "0.48790458", "0.48515365", "0.48396337", "0.4836607" ]
0.58042395
0
To Return Chart Of Account Primary Key
public function getChartOfAccountId() { return $this->chartOfAccountId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAccountID()\n {\n return $this->getKey('AccountID');\n }", "public function getAccountID();", "public function getAccount_id()\n {\n return $this->fv_account_id;\n }", "public function getUserAccountPublicId();", "public function getAccountID()\n {\n return $this->accountID;\n }", "public function getAccountID()\n {\n return $this->accountID;\n }", "public function GetAccountID () \r\n\t{\r\n\t\treturn ($AccountID);\r\n\t}", "public function getAccountingId()\n {\n return $this->accountingId;\n }", "public function getAccountKey()\n {\n return $this->accountKey;\n }", "public function getAccount();", "public function getAccountId()\n {\n return $this->account_id;\n }", "public function getAccountId()\n {\n return $this->account_id;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_dl' => $this->iid_dl);\n }\n return $this->aPrimary_key;\n }", "function getCompanyid() {\n $payment_id = $this->input->post('id');\n $payment_data = json_decode($this->front_model->getDataCollectionByID('tbl_payment',$payment_id));\n $result = json_encode(array (\n 'company_id' => $payment_data->company_id,\n 'policy_number' => $payment_data->policy_number\n ));\n print_r($result);\n }", "protected function getAccountData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select('*')\n\t\t\t\t->from('#__accountdata')\n\t\t\t\t->where('(w20_facebook <> \"\" OR w20_twitter <> \"\")')\n\t\t\t\t->where('typ = 0')\n\t\t\t\t// ->where('bid IN (2657)')\n\t\t\t\t->where('status = 0');\n\n\n\t\t$db->setQuery($query);\n\t\t$this->adata = $db->loadObjectList();\n\n\t\treturn $this->adata;\n\t}", "public function PK() {\n $returnvalue = '';\n $returnvalue .= $this->getDeterminationID();\n return $returnvalue;\n }", "public function getAccountCode();", "public function getAccountCode();", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "public function key()\n\t{\n\t\t$this->databaseResult->key();\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('nivel_stgr' => $this->inivel_stgr);\n }\n return $this->aPrimary_key;\n }", "public function getScoutKey()\n {\n return $this->id;\n }", "public function index()\n {\n return new ChartOfAccountCollection(ChartOfAccount::orderBy('type_id')->orderBy('number')->orderBy('alias')->get());\n }", "function get_account_id($cellphone)\n {\n $query=$this->db->query(\"select id from xl_account where cellphone='{$cellphone}'\");\n \n $arr = array();\n\n foreach($query->result_array() as $row)\n {\n array_push($arr,$row);\n }\n\n return $arr[0]['id'];\n }", "abstract function getPrimaryKey();", "function beneficiaire_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_beneficiaire\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public function getSubAccountId(): string;", "public function actionChart()\n {\n $data = Account::find()->where('id_user='.Yii::$app->user->id)->all();\n $accounts = ArrayHelper::map($data, 'id', 'title');\n\n $operationsByAccount = [];\n foreach($accounts as $id_account=>$title){\n $operations = OperationController::findOperationsOfAccount($id_account);\n $operationsByAccount[$title] = $this->splitValueByMonths($operations);\n }\n\n $chart = new Chart($operationsByAccount);\n $data = $chart->data;\n\n return $this->render('chart', [\n 'data' => $data,\n ]);\n }" ]
[ "0.673483", "0.6549242", "0.59513855", "0.59432256", "0.58281016", "0.58281016", "0.57594967", "0.57327837", "0.5704079", "0.56193835", "0.5602827", "0.5602827", "0.55944484", "0.5572595", "0.55538255", "0.55458677", "0.5545149", "0.5545149", "0.55444443", "0.55444443", "0.55444443", "0.5543737", "0.55388826", "0.55299455", "0.5511872", "0.5508147", "0.550599", "0.55038196", "0.54976076", "0.54969126" ]
0.7041185
0
To Return Equipment Status
public function getEquipmentStatusId() { return $this->equipmentStatusId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "abstract public function GetStatus();", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "abstract public function getStatus();", "function getDetailedStatus() ;", "public function getDetailedSystemStatus() {}", "public function GetStatus()\n\t{\treturn new ProductStatus($this->details['tstatus']);\t\n\t}", "function getStatus();", "public function getItemStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0,\r\n\t\t\t\t\t\t\t'name' => 'Sold',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'sold'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[1] = array('id' => 1,\r\n\t\t\t\t\t\t\t'name' => 'Available',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'available'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[2] = array('id' => 2,\r\n\t\t\t\t\t\t\t'name' => 'Out on Job',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_job'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[3] = array('id' => 3,\r\n\t\t\t\t\t\t\t'name' => 'Pending Sale',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_sale'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[4] = array('id' => 4,\r\n\t\t\t\t\t\t\t'name' => 'Out on Memo',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_memo'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[5] = array('id' => 5,\r\n\t\t\t\t\t\t\t'name' => 'Burgled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'burgled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[6] = array('id' => 6,\r\n\t\t\t\t\t\t\t'name' => 'Assembled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'assembled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[7] = array('id' => 7,\r\n\t\t\t\t\t\t\t'name' => 'Returned To Consignee',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'return_to_consignee'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[8] = array(\r\n\t\t\t\t\t\t\t'id' => 8,\r\n\t\t\t\t\t\t\t'name' => 'Pending Repair Queue',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_repair'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[91] = array('id' => 91,\r\n\t\t\t\t\t\t\t'name' => 'Francesklein Import',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'francesklein_import'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[98] = array('id' => 98,\r\n\t\t\t\t\t\t\t'name' => 'Never Going Online',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'never_going_online'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[99] = array('id' => 99,\r\n\t\t\t\t\t\t\t'name' => 'Unavailable',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'unavailable'\r\n\t\t\t\t\t);\r\n\t\treturn $status;\r\n\t}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}" ]
[ "0.71064234", "0.68311775", "0.68311775", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.6795706", "0.679065", "0.66528785", "0.66528463", "0.66528463", "0.66356784", "0.65806115", "0.65105337", "0.6496619", "0.64683163", "0.64653593", "0.6453601", "0.6453601", "0.6453601", "0.6453601", "0.6453601", "0.6453601", "0.6453601" ]
0.7082567
1
To Return Document Number
public function getDocumentNumber() { return $this->documentNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDocumentNumber()\n {\n return $this->documentNumber;\n }", "public function getPageNo(\\SetaPDF_Core_Document $document) {}", "public function getNextDocumentNumber() {\n \n }", "public function getNextInitAppDocNumber(){\n $lastDoc = File::orderBy('id', 'desc')->first();\n\n /*\n In a case where no record is found get 1 as a\n virtual record to generate document number.\n */\n if(is_null($lastDoc)){\n /*\n create an object counter (number) to store document ID and\n initialiaze it to 1.\n */\n $id = File::find(1);\n $number = $id;\n\n //assign and add the number with Doc ID\n $number += File::find(1);\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n\n }else{\n /*\n The document exists then\n create variable number to store document ID\n initialiaze it to 0.\n */\n $number = 0;\n\n //assign and add the number with Doc ID\n $number += $lastDoc->id;\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n }\n\n }", "public function getNextRevDocNumber(){\n $lastDoc = File::orderBy('id', 'desc')->first();\n\n /*\n In a case where no record is found get 1 as a\n virtual record to generate document number.\n */\n if(is_null($lastDoc)){\n /*\n create an object counter (number) to store document ID and\n initialiaze it to 1.\n */\n $id = File::find(1);\n $number = $id;\n\n //assign and add the number with Doc ID\n $number += File::find(1);\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n\n }else{\n /*\n The document exists then\n create variable number to store document ID\n initialiaze it to 0.\n */\n $number = 0;\n\n //assign and add the number with Doc ID\n $number += $lastDoc->id;\n\n /*\n concatenate BRS-DFT- with the last inserted Doc ID\n that will end with 3 numbers.\n */\n return 'BRS-DFT-' . sprintf('%03d', intval($number) + 1);\n }\n\n }", "public function getDocumentId(): int\r\n {\r\n return $this->document_id;\r\n }", "public function getTaxDocumentNumber()\n\t{\n\t\treturn $this->getIfSet('number', $this->data->taxDocument);\n\t}", "function PDF_pcos_get_number($p, $doc, $path)\n{\n}", "public function getNumberOfDocuments(): int\n {\n\n return $this->numberofDocuments;\n\n }", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function getDocumentID()\n {\n return $this->documentID;\n }", "public function number(): int {\n\t\treturn $this->page['number'] ?? 1;\n\t}", "public function getDocumentDateAndNumber()\n {\n return $this->get(self::DOCUMENTDATEANDNUMBER);\n }", "public static function getTotalDocuments()\n {\n $db = JFactory::getDbo();\n\n $query = $db->getQuery(true);\n\n $query = \"SELECT COUNT(id) FROM #__papiersdefamilles_documents WHERE num_id != ''\";\n\n $result = $db->setQuery($query)->loadResult();\n\n return $result;\n }", "public function getNumFound()\n {\n return $this->numberOfFoundDocuments;\n }", "public function getDocId()\n {\n return $this->doc_id;\n }", "public function getDocid(): string\n {\n return $this->docid;\n }", "public function getDocumentID() {\n\t\treturn $this->documentID;\n\t}", "public function getDocumentID() {\n\t\treturn $this->documentID;\n\t}", "function trovaNuovoNumero($gTables) {\n\t// https://sourceforge.net/p/gazie/discussion/468173/thread/572dcb76/\n\t//\n\t$orderBy = \"datemi desc, numdoc desc\";\n\tparse_str(parse_url($_POST['ritorno'],PHP_URL_QUERY),$output);\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], $gTables['tesbro'].\".tipdoc=\".\"'\".$output['auxil'].\"'\", $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\t// se e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t/*$orderBy = \"datemi desc, numdoc desc\";\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], 1, $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\tse e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t*/\n $numdoc = $ultimo_documento['numdoc'] + 1;\n } else {\n $numdoc = 1;\n }\n return $numdoc;\n}", "function getDocumentID() {\n\t\treturn $this->iDocumentID;\n\t}", "public function getPageNumber();", "public function getPageNumber();", "public function getDocumentCode()\r\n {\r\n return $this->documentCode;\r\n }", "function getIdDoc() {\r\n return $this->IdDoc;\r\n }", "public function getDocumentId()\n {\n return $this->_documentId;\n }", "public function get_document(){\n\t\t\t$query = $this->db->get_where(\"tipodocum\");\n\t\t\treturn $query->result();\n\t\t}", "public function getDocumentDetails($mani_no, $partial_status) {\n $port_id = Session::get('PORT_ID');\n $mani_id = DB::table('manifests')\n \t\t\t->where('manifest', $mani_no)\n ->where('port_id', $port_id)\n \t\t\t->select('id')\n \t\t\t->get();\n $docunemtCharge = DB::select('SELECT dc.number_of_document FROM assessment_documents dc \n \t\t\t\t\tWHERE dc.manifest_id=? AND dc.partial_status=? AND dc.port_id=?\n ORDER BY dc.id DESC LIMIT 1', [$mani_id[0]->id, $partial_status, $port_id]);\n if($docunemtCharge) {\n \treturn $docunemtCharge;\n } else {\n \treturn 'notFound';\n }\n }", "public function getArticleNumber()\n {\n return $this->_articleNumber;\n }" ]
[ "0.8033857", "0.75927866", "0.7371253", "0.71659225", "0.71575606", "0.7060846", "0.6928596", "0.6813762", "0.66853154", "0.65247136", "0.65247136", "0.6488724", "0.64376456", "0.64333916", "0.64084774", "0.6389939", "0.63849664", "0.6376377", "0.63759756", "0.63759756", "0.63697755", "0.6360135", "0.6352619", "0.6352619", "0.6352299", "0.62562495", "0.62105596", "0.61906534", "0.61877465", "0.6185814" ]
0.791522
1
Get the value of withUser
public function getWithUser() { return $this->withUser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "public function getUser(){\n\t\treturn $this->user;\n\t}", "public function user() { return $this->user; }", "public function user()\n {\n return call_user_func($this->getUserResolver());\n }", "public function getUser()\n {\n $this->getParam('user');\n }", "public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}", "public function getUser() {\r\n return $this->user;\r\n }", "public static function user ()\n {\n return self::$user;\n }", "public function get_user() {\n\t\treturn $this->user;\n\t}", "public function getUserCheck()\n {\n return $this->get(self::_USER_CHECK);\n }", "function getUser() \n {\n\t\t\treturn $this->user;\n\t\t}", "public function getUser()\r\n {\r\n return $this->user;\r\n }", "public function getUser() {}", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->user;\n }", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}" ]
[ "0.72810036", "0.7270481", "0.7226088", "0.7226088", "0.7047616", "0.7002039", "0.69639933", "0.6932346", "0.69226205", "0.6906708", "0.6902393", "0.69004846", "0.68988764", "0.68957585", "0.68550485", "0.68309766", "0.6807405", "0.6807405", "0.6807405", "0.68018425", "0.68018425", "0.6801375", "0.6801375", "0.6801375", "0.6801375", "0.6801375", "0.6801375", "0.6801375", "0.6800216", "0.6800216" ]
0.77812624
0
Publish the language directory if it doesn't exists.
private function publishLanguage() { if (!file_exists(base_path().'/resources/lang/')) { mkdir(base_path().'/resources/lang'); $this->info('Published language directory in '.base_path().'/resources/lang/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function publishContentLanguages()\n\t{\n\t\t// Publish the Content Languages.\n\t\t$tableLanguage = Table::getInstance('Language');\n\n\t\t$siteLanguages = $this->getInstalledlangs('site');\n\n\t\t// For each content language.\n\t\tforeach ($siteLanguages as $siteLang)\n\t\t{\n\t\t\tif ($tableLanguage->load(array('lang_code' => $siteLang->language, 'published' => 0)) && !$tableLanguage->publish())\n\t\t\t{\n\t\t\t\t$this->app->enqueueMessage(Text::sprintf('INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CONTENT_LANGUAGE', $siteLang->name), 'warning');\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function langHandle()\n {\n $packageTranslationsPath = __DIR__.'/resources/lang';\n\n $this->loadTranslationsFrom($packageTranslationsPath, 'task-management');\n\n $this->publishes([\n $packageTranslationsPath => resource_path('lang/vendor/task-management'),\n ], 'lang');\n }", "public function publish($language)\n {\n $translations = $this->getTranslationGroups($language->translations);\n foreach ($translations as $area => $groups) {\n foreach ($groups as $group => $items) {\n if (!isset($this->hints[$group])) {\n continue;\n }\n $path = $this->getResourcePath($language->code, $area, $group);\n $this->publishTranslations($path, $items);\n }\n $this->putGitignore($area);\n }\n return true;\n }", "protected function publishOrchestraLang($path)\n {\n $this->publishes([\n $path.'/lang/orchestra' => base_path('resources/lang/packages/orchestra/foundation/ms'),\n $path.'/lang/app' => base_path('resources/lang/ms'),\n ]);\n }", "private function publishModule()\n {\n $from = base_path('vendor/typicms/things/src');\n $to = base_path('Modules/' . $this->module);\n\n if ($this->files->isDirectory($from)) {\n $this->publishDirectory($from, $to);\n } else {\n $this->error(\"Can’t locate path: <{$from}>\");\n }\n }", "private function ensureFolderStructure()\n {\n $localeDir = Strata::getLocalePath();\n if (!is_dir($localeDir)) {\n mkdir($localeDir);\n }\n }", "protected function publishFiles()\n {\n $this->publishes([\n __DIR__.'/Config/installer.php' => config_path('installer.php'),\n ], 'nickelcms');\n\n // $this->publishes([\n // __DIR__.'/assets' => resource_path('nicklecms/admin'),\n // ], 'nickelcms_assets');\n\n }", "public function translations()\n {\n $this->loadTranslationsFrom(__DIR__.'/Resources/Lang', $this->packageName);\n\n $this->publishes([\n __DIR__.'/path/to/translations' => resource_path('lang/vendor/courier'),\n ], $this->packageName.'-translations');\n }", "function wp_set_lang_dir()\n {\n }", "public function publishFiles()\n {\n $this->publishes(\n [ __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')],\n 'avored-module-views'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/front' => base_path('public/js')],\n 'avored-front-js'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/admin' => base_path('public/avored-admin/js')],\n 'avored-admin-js'\n );\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }", "public function wp_lang_dir()\n {\n }", "protected function publishFiles()\r\n {\r\n $this->publishes([\r\n __DIR__.'/../Config/installer.php' => base_path('config/installer.php'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../assets' => public_path('installer'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../Views' => base_path('resources/views/vendor/installer'),\r\n ], 'laravelinstaller');\r\n\r\n $this->publishes([\r\n __DIR__.'/../Lang' => base_path('resources/lang'),\r\n ], 'laravelinstaller');\r\n }", "function publishLanguage($p_lname, $option){\n\tjosSpoofCheck();\n\t$config = '';\n\n\t$fp = fopen('../configuration.php', 'r');\n\twhile(!feof($fp)){\n\t\t$buffer = fgets($fp, 4096);\n\t\tif(strstr($buffer, \"\\$mosConfig_lang\")){\n\t\t\t$config .= \"\\$mosConfig_lang = \\\"$p_lname\\\";\\n\";\n\t\t} else{\n\t\t\t$config .= $buffer;\n\t\t}\n\t}\n\tfclose($fp);\n\n\tif($fp = fopen('../configuration.php', 'w')){\n\t\tfputs($fp, $config, strlen($config));\n\t\tfclose($fp);\n\t\tmosRedirect('index2.php?option=com_languages', _LANGUAGE_SAVED . \" $p_lname\");\n\t} else{\n\t\tmosRedirect('index2.php?option=com_languages', 'Ошибка!');\n\t}\n\n}", "public function publishAllFiles()\n {\n $this->publishes([\n $this->package_path('Controllers') => app_path(config('starter.controller.path')),\n $this->package_path('Data/Models') => app_path(config('starter.model.path')),\n $this->package_path('Templates/init-middleware.php') => app_path('Http/Kernel.php'),\n $this->package_path('config/view.php') => base_path('config/view.php'),\n ]);\n }", "public static function getLanguageDir() {\n return public_path(self::LANGUAGE_DIR);\n }", "private function registerLangPublisher(): void\n {\n $this->singleton(TransPublisherContract::class, function (Application $app) {\n return new TransPublisher(\n $app['files'],\n $app[TransManagerContract::class],\n $app->langPath()\n );\n });\n }", "public function publishFiles()\n {\n\n $dir = __DIR__;\n\n // config\n $this->publishes([\n $dir . '/../config/permissions.php' => config_path('permissions.php'),\n ], 'config-role');\n\n /**\n * Database\n */\n $migration_path = database_path('migrations/');\n $seeds_path = database_path('seeds/');\n\n // migrations\n $this->publishes([\n $dir . '/../database/migrations/create_roles_table.php.stub' => $migration_path . date('Y_m_d_His', time()) . '_create_roles_table.php',\n $dir . '/../database/migrations/create_role_user_table.php.stub' => $migration_path . date('Y_m_d_His', time()) . '_create_role_user_table.php',\n ], 'migrations-role');\n\n // seeds\n $this->publishes([\n $dir . '/../database/seeds/RoleTableSeeder.php.stub' => $seeds_path . 'RoleTableSeeder.php',\n ], 'seeder-role');\n }", "public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }", "private function init_tftp_lang_path() {\n $dir = $this->sccppath[\"tftp_lang_path\"];\n foreach ($this->extconfigs->getextConfig('sccp_lang') as $lang_key => $lang_value) {\n $filename = $dir . DIRECTORY_SEPARATOR . $lang_value['locale'];\n if (!file_exists($filename)) {\n if (!mkdir($filename, 0777, true)) {\n die('Error create lang dir');\n }\n }\n }\n }", "protected function addStreamsLangPath()\n {\n $this->app->bind(\n 'path.lang',\n function () {\n return __DIR__ . '/../../../../../resources/lang';\n }\n );\n }", "private function registerTranslations()\n {\n $langPath = $this->getBasePath() . '/resources/lang';\n\n $this->loadTranslationsFrom($langPath, $this->package);\n $this->publishes([\n $langPath => base_path(\"resources/lang/arcanedev/{$this->package}\"),\n ], 'translations');\n }", "public function publish()\n {\n $this->move('config/auth.php', config_path(), 'auth.php');\n $this->move('config/services.php', config_path(), 'services.php');\n\n $this->notify('Publishing: Config Files');\n }", "public function createNewLanguage($newLocale)\n {\n //check exist or not File\n if(!$this->fileSystem->exists($newLocale)){\n\n $this->fileSystem->makeDirectory($this->getLanguagePath() . DIRECTORY_SEPARATOR . $newLocale);\n return true;\n }\n\n return false;\n }", "public function registerDirectories()\n {\n // Publish config files\n $this->publishes(\n [\n // Paths\n $this->getPublishesPath('config'.DIRECTORY_SEPARATOR.'porteiro.php') => config_path('porteiro.php'),\n ],\n ['config', 'sitec', 'sitec-config']\n );\n\n // // Publish porteiro css and js to public directory\n // $this->publishes([\n // $this->getDistPath('porteiro') => public_path('assets/porteiro')\n // ], ['public', 'sitec', 'sitec-public']);\n\n $this->loadViews();\n $this->loadTranslations();\n }", "protected function publishFiles()\n {\n $this->publishes([\n __DIR__ . '/librerie/sweetalert.css' => base_path('resources/assets/css/sweetalert.css'),\n __DIR__ . '/librerie/sweetalert.js' => base_path('resources/assets/js/sweetalert.js'),\n __DIR__ . '/views/dsalerts.blade.php' => base_path('resources/views/vendor/dsalerts/dsalerts.blade.php'),\n ], 'dsalerts');\n }", "protected function _writeLocale()\n {\n $text = $this->_tpl['locale'];\n \n $file = $this->_class_dir . DIRECTORY_SEPARATOR . \"/Locale/en_US.php\";\n if (file_exists($file)) {\n $this->_outln('Locale file exists.');\n } else {\n $this->_outln('Writing locale file.');\n file_put_contents($file, $text);\n }\n }", "function sti_get_localization_directory()\r\n\t{\r\n\t\treturn \"localization\";\r\n\t}", "protected function checkIfLanguagesExist() {}", "private function publishView()\n {\n if (!file_exists(base_path().'/resources/views/lazy-strings')) {\n mkdir(base_path().'/resources/views/lazy-strings');\n }\n\n copy(__DIR__.'/../views/lazy.blade.php', base_path().'/resources/views/lazy-strings/lazy.blade.php');\n $this->info('Published view to '.base_path().'/resources/views/lazy-strings/lazy.blade.php');\n }", "function sti_get_localization_directory()\n\t{\n\t\treturn \"localization\";\n\t}" ]
[ "0.6533153", "0.6461036", "0.63219535", "0.62832725", "0.626728", "0.62158537", "0.6187548", "0.6109286", "0.6003677", "0.5981178", "0.5979843", "0.5906641", "0.5882832", "0.5814616", "0.5704598", "0.5700723", "0.5692256", "0.5544377", "0.5489684", "0.5462505", "0.5439634", "0.5436172", "0.5424878", "0.5417949", "0.53967893", "0.5360845", "0.5358524", "0.5336773", "0.532948", "0.5324129" ]
0.90800023
0
first read strlen(2byte), then read str
public function readString() { $len = $this->readUInt16(); if($len <=0 || $this->getBytesAvailable() < $len){ return false; } $key = '/a'. $len . 'k'; $arr = unpack('@' . $this->position . $key, $this->data); $this->position += $len; return $arr['k']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readUTF();", "function readString($length) {\n $d = unpack(\"A*\", $this->read($length));\n return $d[1];\n }", "public function read_string() { return $this->read_bytes(); }", "public function readString()\n {\n return $this->readBytes();\n }", "function read_string(&$payload) {\n $length = read_uint32($payload);\n $string = \\substr($payload, 0, $length);\n $payload = \\substr($payload, $length);\n\n return $string;\n}", "private static function readString($handle, $length) {\n\t\treturn self::readUnpacked($handle, 'a*', $length);\n\t}", "private function read_ue4_string(&$file_pointer)\n {\n $string_header = fread($file_pointer, 4);\n $string_header_byte_count = current(unpack(\"i\", $string_header));\n if ($string_header_byte_count > 0) {\n return $this->tidyUpData(\n utf8_encode(\n fread($file_pointer, $string_header_byte_count)\n )\n );\n }\n return FALSE;\n }", "function readPayloadString($string, &$p) {\n // make sure that we're reading in a string\n if (ord($string[$p++]) != 2)\n return null;\n // grab the length of the string\n $length = hexdec(sprintf(\"%02X\", ord($string[$p++])).sprintf(\"%02X\", ord($string[$p++])));;\n // initialize the return string\n $return = \"\";\n // read through over characters with length and append the string\n for ($i = 0; $i < $length; $i++)\n $return .= substr($string, $p++, 1);\n // return the string back\n return $return;\n}", "function toString($str) {\n $text_array = explode(\"\\r\\n\", chunk_split($str, 8));\n $newstring = '';\n for ($n = 0; $n < count($text_array) - 1; $n++) {\n $newstring .= chr(base_convert($text_array[$n], 2, 10));\n }\n return $newstring;\n}", "private function len($str) {\n\t\treturn mb_strlen($str, $this->encoding);\n\t}", "private function readString($file_type, $length, $flag_utf8_encode = false)\n {\n $ret = current(unpack('A*', $this->readData($file_type, $length)));\n if ($flag_utf8_encode && $this->getOption(Shapefile::OPTION_DBF_CONVERT_TO_UTF8)) {\n $ret = @iconv($this->getCharset(), 'UTF-8', $ret);\n if ($ret === false) {\n throw new ShapefileException(Shapefile::ERR_DBF_CHARSET_CONVERSION);\n }\n }\n return trim($ret);\n }", "protected function decodeChunked($str)\n {\n for ($res = ''; !empty($str); $str = trim($str)) {\n $pos = strpos($str, \"\\r\\n\");\n $len = hexdec(substr($str, 0, $pos));\n $res.= substr($str, $pos + 2, $len);\n $str = substr($str, $pos + 2 + $len);\n }\n return $res;\n }", "function readStringNull(): string {\n $pos = \\strpos($this->buffer, \"\\0\");\n if($pos === false) {\n throw new \\InvalidArgumentException('Missing NULL character');\n }\n \n $str = $this->read($pos);\n $this->read(1); // discard NULL byte\n \n return $str;\n }", "function stream_read( $count ) {\r\n\t\tif ( ! isset( $this->data_ref ) ) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\t$ret = substr( $this->data_ref, $this->position, $count );\r\n\r\n\t\t$this->position += strlen( $ret );\r\n\t\treturn $ret;\r\n\t}", "public static function readShort($str){\n\t\treturn unpack(\"n\", $str)[1];\n\t}", "public function readString()\n {\n $stringReference = $this->readInteger();\n\n //Check if this is a reference string\n if (($stringReference & 0x01) == 0) {\n // reference string\n $stringReference = $stringReference >> 1;\n if ($stringReference >= count($this->_referenceStrings)) {\n $this->throwZendException('Undefined string reference: {0}',[$stringReference]);\n }\n // reference string found\n return $this->_referenceStrings[$stringReference];\n }\n\n $length = $stringReference >> 1;\n if ($length) {\n $string = $this->_stream->readBytes($length);\n $this->_referenceStrings[] = $string;\n } else {\n $string = \"\";\n }\n return $string;\n }", "function realStringLength($str) {\n return mb_strlen($str, \"UTF-8\");\n}", "public static function stringToBytes($str)\n {\n return self::unpackStringToArray('c*', $str);\n }", "public function packerOneUnpack(string $data): string\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 10, \"utf-8\");\n $partTwo = mb_substr($data, 12, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }", "public function read($length);", "public function read($length);", "public function read($length);", "public static function strBytes($str)\n {\n // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT\n\n // Number of characters in string\n $strlen_var = strlen($str);\n\n // string bytes counter\n $d = 0;\n\n /*\n * Iterate over every character in the string,\n * escaping with a slash or encoding to UTF-8 where necessary\n */\n for($c = 0; $c < $strlen_var; ++$c)\n {\n $ord_var_c = ord($str{$c});\n\n switch(true)\n {\n case(($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):\n // characters U-00000000 - U-0000007F (same as ASCII)\n $d ++;\n break;\n case(($ord_var_c & 0xE0) == 0xC0):\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n $d += 2;\n break;\n case(($ord_var_c & 0xF0) == 0xE0):\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n $d += 3;\n break;\n case(($ord_var_c & 0xF8) == 0xF0):\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n $d += 4;\n break;\n case(($ord_var_c & 0xFC) == 0xF8):\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n $d += 5;\n break;\n case(($ord_var_c & 0xFE) == 0xFC):\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n $d += 6;\n break;\n default:\n $d ++;\n }//switch\n }//for\n\n return number_format($d);\n }", "public function read(int $length = 2048): string\n {\n $output = '';\n\n if (!is_resource($this->socket)) {\n Bolt::error('Not initialized socket');\n return $output;\n }\n\n do {\n $readed = socket_read($this->socket, $length - mb_strlen($output, '8bit'), PHP_BINARY_READ);\n if ($readed === false) {\n $code = socket_last_error($this->socket);\n Bolt::error(socket_strerror($code), $code);\n } else {\n $output .= $readed;\n }\n } while (mb_strlen($output, '8bit') < $length);\n\n if (Bolt::$debug)\n $this->printHex($output, false);\n\n return $output;\n }", "function prepare_input($str, $len = 255)\n\t{\n\t\tif (!$str = trim(html_entity_decode($str, ENT_COMPAT | ENT_HTML5, HTML_ENTITIES_CHARSET), ' -')) return '';\n\t\telse if (strpos($str, \"\\n\")) return '';\n\t\telse if ($sp = strpos($str, ' ')) $str = substr($str, 0, $sp);\n\n\t\treturn substr($str, 0, $len);\n\t}", "function MBGetStringLength($s){\r\n if($this->CurrentFont['type']=='Type0')\r\n {\r\n $len = 0;\r\n $nbbytes = strlen($s);\r\n for ($i = 0; $i < $nbbytes; $i++)\r\n {\r\n if (ord($s[$i])<128)\r\n $len++;\r\n else\r\n {\r\n $len++;\r\n $i++;\r\n }\r\n }\r\n return $len;\r\n }\r\n else\r\n return strlen($s);\r\n }", "public function read($len) {\r\n\t\tif($len<0) {\r\n\t\t\tthrow new Curly_Stream_Exception('The given length '.$len.' is invalid for a read operation. Only positive values area valid.');\r\n\t\t}\r\n\t\t\r\n\t\t$read='';\r\n\t\t$readLen=0;\r\n\t\t\r\n\t\t// Read from every stream, until we have enough data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\t$read.=$stream->read($len-$readLen);\r\n\t\t\t\r\n\t\t\t// Enough data read\r\n\t\t\t$readLen=strlen($read);\r\n\t\t\tif($readLen==$len) {\r\n\t\t\t\treturn $read;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->shift();\r\n\t\t}\r\n\t\t\r\n\t\t// So, not enough data found, but return what we´ve got.\r\n\t\treturn $read;\r\n\t}", "function readPascalString() {\n $l = $this->readUByte();\n\n if ($l == 0) {\n return \"\";\n }\n\n return $this->readString($l);\n }", "public function packerTwoUnpack(string $data): string\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 5, \"utf-8\");\n $partTwo = mb_substr($data, 7, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }", "function _substr($binary_string, $start, $length) {\r\n if (function_exists('mb_substr')) {\r\n return mb_substr($binary_string, $start, $length, '8bit');\r\n }\r\n return substr($binary_string, $start, $length);\r\n }" ]
[ "0.6887624", "0.674945", "0.673881", "0.65388215", "0.6517012", "0.64929825", "0.59863263", "0.5909791", "0.585225", "0.58437526", "0.5795858", "0.57302433", "0.572138", "0.57022446", "0.5667134", "0.55890465", "0.55887413", "0.5502986", "0.54946357", "0.5492749", "0.5492749", "0.5492749", "0.5491237", "0.54910296", "0.5480541", "0.5458488", "0.54447323", "0.5421949", "0.5421244", "0.54167426" ]
0.6778231
1
End of Declare \Markguyver\LivefyreImporter\Data\Livefyre\Conversation>get_delay_export() function
public function get_delay_export() { // Declare \Markguyver\LivefyreImporter\Data\Livefyre\Conversation->get_delay_export() function return $this->delay_export; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_delay_export( $delay_export ) { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->set_delay_export() function\n\t\t\t$this->delay_export = $this->validate_boolean( $delay_export );\n\t\t}", "public function getDelay(): int;", "public function getDelay()\n {\n return $this->delay;\n }", "public function check_delay_export() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_delay_export() function\n\t\t\t$return = false;\n\t\t\tif ( 0 === strpos( $this->title, 'http' ) ) { // Check for URL in Title\n\t\t\t\t$return = true;\n\t\t\t} // End of Check for URL in Title\n\t\t\treturn $return;\n\t\t}", "public function getDelayTime() {}", "public function getDelayType()\n {\n return $this->delayType;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function showDelay()\n {\n global $conf, $langs;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n if (empty($this->date_delivery)) $text=$langs->trans(\"OrderDate\").' '.dol_print_date($this->date_commande, 'day');\n else $text=$text=$langs->trans(\"DeliveryDate\").' '.dol_print_date($this->date_delivery, 'day');\n $text.=' '.($conf->commande->fournisseur->warning_delay>0?'+':'-').' '.round(abs($conf->commande->fournisseur->warning_delay)/3600/24, 1).' '.$langs->trans(\"days\").' < '.$langs->trans(\"Today\");\n\n return $text;\n }", "public function getAfterDelay()\n {\n return $this->afterDelay;\n }", "function get_timing_delay() {\n\n\t\t$timing_type = $this->get_timing_type();\n\n\t\tif ( ! in_array( $timing_type, [ 'delayed', 'scheduled' ] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$number = $this->get_timing_delay_number();\n\t\t$unit = $this->get_timing_delay_unit();\n\n\t\t$units = [\n\t\t\t'm' => MINUTE_IN_SECONDS,\n\t\t\t'h' => HOUR_IN_SECONDS,\n\t\t\t'd' => DAY_IN_SECONDS,\n\t\t\t'w' => WEEK_IN_SECONDS\n\t\t];\n\n\t\tif ( ! $number || ! isset( $units[$unit] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $number * $units[$unit];\n\t}", "public static function getThrottleDelay() {}", "public function getDelayBand()\n {\n return $this->delayBand;\n }", "protected function saveDelaySettings(): array\n {\n $mission = MissionConfig::getInstance();\n\n \n\n // Default response\n $response = array(\n 'success' => false, \n 'error' => array()\n );\n\n $data = array();\n\n // Manual delay\n if(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::MANUAL)\n {\n // Set delay type\n $data['delay_type'] = Delay::MANUAL;\n\n // Extract value selected by the user\n $temp = $_POST['delay_manual'] ?? '';\n $temp = trim($temp);\n\n // User input must be a number. \n if(!preg_match(AdminModule::FLOAT_FORMAT_REGEX, $temp))\n {\n $response['error'][] = 'Invalid \"Manual Delay\" entered. Only numbers allowed.';\n }\n else\n {\n // \n $currTimeObj = new DelayTime();\n $currTime = $currTimeObj->getTimestamp();\n\n $startTime = DelayTime::getStartTimeUTC();\n $endTime = DelayTime::getEndTimeUTC();\n\n if($startTime < $currTime && $currTime <= $endTime)\n {\n $delayConfig = array_merge(\n $mission->delay_config, \n array(array('ts'=>$currTimeObj->getTime(), 'eq'=>floatval($temp)))\n );\n }\n else\n {\n $delayConfig = array(array('ts'=>$currTimeObj->getTime(), 'eq'=>floatval($temp)));\n }\n \n }\n }\n elseif(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::TIMED)\n {\n $data['delay_type'] = Delay::TIMED;\n if(count($_POST['delay_time']) != count($_POST['delay_eq']) && \n count($_POST['delay_time']) != count($_POST['delay_date']))\n {\n $response['error'][] = 'Invalid/incomplete piece-wise delay definitions.';\n }\n elseif(count($_POST['delay_time']) == 0)\n {\n $response['error'][] = 'At least one piece-wise definition is needed.';\n }\n else\n {\n for($i = 0; $i < count($_POST['delay_time']); $i++)\n {\n $delayConfig[$i] = array(\n 'ts' => $_POST['delay_date'][$i].' '.$_POST['delay_time'][$i].':00', \n 'eq' => $_POST['delay_eq'][$i]\n );\n }\n \n for($i = 0; $i < count($_POST['delay_time']); $i++)\n {\n if(!preg_match(DelayTime::DATE_FORMAT_REGEX, $delayConfig[$i]['ts']))\n {\n $response['error'][] = 'Invalid piece-wise date/time entry in row '.($i+1).'.';\n }\n elseif(!$this->isValidDelayEquationOfTime($delayConfig[$i]['eq']))\n {\n $response['error'][] = 'Invalid piece-wise f(time) equation in row '.($i+1).'.';\n }\n else\n {\n $delayConfig[$i]['ts'] = DelayTime::convertTimestampTimezone(\n $delayConfig[$i]['ts'], $mission->mcc_timezone, 'UTC');\n }\n }\n }\n }\n else if(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::MARS)\n {\n $data['delay_type'] = Delay::MARS;\n $currTimeObj = new DelayTime();\n $delayConfig = array(array('ts'=>$currTimeObj->getTime(), 'eq'=>0));\n }\n else\n {\n $response['error'][] = 'Field \"Delay Configuration\" cannot be empty.';\n }\n\n $response['success'] = count($response['error']) == 0;\n if($response['success'])\n {\n uasort($delayConfig, array('Delay', 'sortAutoDelay'));\n $data['delay_config'] = json_encode($delayConfig);\n $missionDao = MissionDao::getInstance();\n $missionDao->updateMissionConfig($data);\n Logger::info('Saved delay settings.', $delayConfig);\n }\n \n return $response;\n }", "public function getDelayInterval()\n {\n $delay = $this->getData();\n $modifier = ( $delay['delay_type'] == 'before' ) ? '-' : '+';\n $base = $delay['delay_value'];\n $unit = $delay['delay_unit'];\n return \"{$modifier}{$base} {$unit}\";\n }", "public function getDelayedTime()\n {\n $packet = $this->getPacket();\n\n if ($packet['delayed'] > 0) {\n return $packet['delayed'];\n }\n\n return -1;\n }", "public function status($delay = FALSE);", "public function getWarnDisconnectDelay()\n {\n $result = $this->client->GetWarnDisconnectDelay();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function hasDelay()\n {\n global $conf;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n $now = dol_now();\n $date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery;\n\n return ($this->statut > 0 && $this->statut < 4) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);\n }", "public function __sleep(){\r\n\t\treturn [\r\n\t\t\t\t'ticket',\r\n\t\t\t\t'time',\r\n\t\t\t\t'stage',\r\n\t\t\t\t'enemy',\r\n\t\t\t\t'attack',\r\n\t\t\t\t'effect',\r\n//\t\t\t\t'lv_data'\r\n\t\t];\r\n\t}", "function formatDelay($delay) {\n\tif ($delay) {\n\t\tlist($dh,$dm) = explode('.',$delay);\n\t\treturn '+' . ( 60*$dh + $dm ) . '\\'';\n\t} else return \"\";\n}", "public function __sleep()\n\t{\n\t\t$serialize_array = array('_data','_lang_data');\n\t\treturn $serialize_array;\n\t}", "function com_message_pump($timeoutms = 0) {}", "public function __sleep() {\n return array('filename');\n }", "function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t$output[] = $row['lead_id'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->display(\"Query failed: $query\" . mysql_error($this->conn));\n\t\t}\n\n\t\treturn $output;\n\t}", "protected function delay()\n {\n if (!isset($this->headers['x-rate-limit-reset'])) {\n exit('Rate limited, but no rate limit header found');\n }\n\n $delay = $this->headers['x-rate-limit-reset'] - time();\n\n if ($delay < 10) {\n $delay = 60 * 15; // 15 minute delay if the given delay seems unreasonably small (can be due to server time differences)\n }\n \n print \"\\n\";\n\n do {\n print \"\\r\\e[K\";\n printf('Sleeping for %d seconds', $delay--);\n sleep(1);\n } while ($delay);\n }", "public function getHaltDelay()\n {\n return $this->_haltDelay;\n }", "public function get_delay_between_checks(): int {\n $period = get_config('realtimeplugin_phppoll', 'checkinterval');\n return max($period, 200);\n }", "public function __sleep()\n\t{\n\t\treturn array('objectname', 'elements', 'deffile');\n\t}", "public function delay($value) {\n return $this->setProperty('delay', $value);\n }" ]
[ "0.68835616", "0.6474485", "0.64270294", "0.640562", "0.63719296", "0.62447023", "0.62289864", "0.62289864", "0.6030264", "0.59385717", "0.583899", "0.56244296", "0.540658", "0.538695", "0.52635485", "0.5241311", "0.5220851", "0.51730233", "0.51513165", "0.51444924", "0.5102177", "0.5086684", "0.50311303", "0.49810508", "0.493743", "0.49070168", "0.4904601", "0.4884296", "0.48833984", "0.48320928" ]
0.87689084
0
End of Declare \Markguyver\LivefyreImporter\Data\Livefyre\Conversation>get_delay_export() function
public function set_delay_export( $delay_export ) { // Declare \Markguyver\LivefyreImporter\Data\Livefyre\Conversation->set_delay_export() function $this->delay_export = $this->validate_boolean( $delay_export ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_delay_export() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_delay_export() function\n\t\t\treturn $this->delay_export;\n\t\t}", "public function getDelay(): int;", "public function getDelay()\n {\n return $this->delay;\n }", "public function check_delay_export() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_delay_export() function\n\t\t\t$return = false;\n\t\t\tif ( 0 === strpos( $this->title, 'http' ) ) { // Check for URL in Title\n\t\t\t\t$return = true;\n\t\t\t} // End of Check for URL in Title\n\t\t\treturn $return;\n\t\t}", "public function getDelayTime() {}", "public function getDelayType()\n {\n return $this->delayType;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function showDelay()\n {\n global $conf, $langs;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n if (empty($this->date_delivery)) $text=$langs->trans(\"OrderDate\").' '.dol_print_date($this->date_commande, 'day');\n else $text=$text=$langs->trans(\"DeliveryDate\").' '.dol_print_date($this->date_delivery, 'day');\n $text.=' '.($conf->commande->fournisseur->warning_delay>0?'+':'-').' '.round(abs($conf->commande->fournisseur->warning_delay)/3600/24, 1).' '.$langs->trans(\"days\").' < '.$langs->trans(\"Today\");\n\n return $text;\n }", "public function getAfterDelay()\n {\n return $this->afterDelay;\n }", "function get_timing_delay() {\n\n\t\t$timing_type = $this->get_timing_type();\n\n\t\tif ( ! in_array( $timing_type, [ 'delayed', 'scheduled' ] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$number = $this->get_timing_delay_number();\n\t\t$unit = $this->get_timing_delay_unit();\n\n\t\t$units = [\n\t\t\t'm' => MINUTE_IN_SECONDS,\n\t\t\t'h' => HOUR_IN_SECONDS,\n\t\t\t'd' => DAY_IN_SECONDS,\n\t\t\t'w' => WEEK_IN_SECONDS\n\t\t];\n\n\t\tif ( ! $number || ! isset( $units[$unit] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $number * $units[$unit];\n\t}", "public static function getThrottleDelay() {}", "public function getDelayBand()\n {\n return $this->delayBand;\n }", "protected function saveDelaySettings(): array\n {\n $mission = MissionConfig::getInstance();\n\n \n\n // Default response\n $response = array(\n 'success' => false, \n 'error' => array()\n );\n\n $data = array();\n\n // Manual delay\n if(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::MANUAL)\n {\n // Set delay type\n $data['delay_type'] = Delay::MANUAL;\n\n // Extract value selected by the user\n $temp = $_POST['delay_manual'] ?? '';\n $temp = trim($temp);\n\n // User input must be a number. \n if(!preg_match(AdminModule::FLOAT_FORMAT_REGEX, $temp))\n {\n $response['error'][] = 'Invalid \"Manual Delay\" entered. Only numbers allowed.';\n }\n else\n {\n // \n $currTimeObj = new DelayTime();\n $currTime = $currTimeObj->getTimestamp();\n\n $startTime = DelayTime::getStartTimeUTC();\n $endTime = DelayTime::getEndTimeUTC();\n\n if($startTime < $currTime && $currTime <= $endTime)\n {\n $delayConfig = array_merge(\n $mission->delay_config, \n array(array('ts'=>$currTimeObj->getTime(), 'eq'=>floatval($temp)))\n );\n }\n else\n {\n $delayConfig = array(array('ts'=>$currTimeObj->getTime(), 'eq'=>floatval($temp)));\n }\n \n }\n }\n elseif(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::TIMED)\n {\n $data['delay_type'] = Delay::TIMED;\n if(count($_POST['delay_time']) != count($_POST['delay_eq']) && \n count($_POST['delay_time']) != count($_POST['delay_date']))\n {\n $response['error'][] = 'Invalid/incomplete piece-wise delay definitions.';\n }\n elseif(count($_POST['delay_time']) == 0)\n {\n $response['error'][] = 'At least one piece-wise definition is needed.';\n }\n else\n {\n for($i = 0; $i < count($_POST['delay_time']); $i++)\n {\n $delayConfig[$i] = array(\n 'ts' => $_POST['delay_date'][$i].' '.$_POST['delay_time'][$i].':00', \n 'eq' => $_POST['delay_eq'][$i]\n );\n }\n \n for($i = 0; $i < count($_POST['delay_time']); $i++)\n {\n if(!preg_match(DelayTime::DATE_FORMAT_REGEX, $delayConfig[$i]['ts']))\n {\n $response['error'][] = 'Invalid piece-wise date/time entry in row '.($i+1).'.';\n }\n elseif(!$this->isValidDelayEquationOfTime($delayConfig[$i]['eq']))\n {\n $response['error'][] = 'Invalid piece-wise f(time) equation in row '.($i+1).'.';\n }\n else\n {\n $delayConfig[$i]['ts'] = DelayTime::convertTimestampTimezone(\n $delayConfig[$i]['ts'], $mission->mcc_timezone, 'UTC');\n }\n }\n }\n }\n else if(isset($_POST['delay_type']) && $_POST['delay_type'] == Delay::MARS)\n {\n $data['delay_type'] = Delay::MARS;\n $currTimeObj = new DelayTime();\n $delayConfig = array(array('ts'=>$currTimeObj->getTime(), 'eq'=>0));\n }\n else\n {\n $response['error'][] = 'Field \"Delay Configuration\" cannot be empty.';\n }\n\n $response['success'] = count($response['error']) == 0;\n if($response['success'])\n {\n uasort($delayConfig, array('Delay', 'sortAutoDelay'));\n $data['delay_config'] = json_encode($delayConfig);\n $missionDao = MissionDao::getInstance();\n $missionDao->updateMissionConfig($data);\n Logger::info('Saved delay settings.', $delayConfig);\n }\n \n return $response;\n }", "public function getDelayInterval()\n {\n $delay = $this->getData();\n $modifier = ( $delay['delay_type'] == 'before' ) ? '-' : '+';\n $base = $delay['delay_value'];\n $unit = $delay['delay_unit'];\n return \"{$modifier}{$base} {$unit}\";\n }", "public function getDelayedTime()\n {\n $packet = $this->getPacket();\n\n if ($packet['delayed'] > 0) {\n return $packet['delayed'];\n }\n\n return -1;\n }", "public function status($delay = FALSE);", "public function getWarnDisconnectDelay()\n {\n $result = $this->client->GetWarnDisconnectDelay();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function hasDelay()\n {\n global $conf;\n\n if (empty($this->date_delivery) && ! empty($this->date_livraison)) $this->date_delivery = $this->date_livraison; // For backward compatibility\n\n $now = dol_now();\n $date_to_test = empty($this->date_delivery) ? $this->date_commande : $this->date_delivery;\n\n return ($this->statut > 0 && $this->statut < 4) && $date_to_test && $date_to_test < ($now - $conf->commande->fournisseur->warning_delay);\n }", "public function __sleep(){\r\n\t\treturn [\r\n\t\t\t\t'ticket',\r\n\t\t\t\t'time',\r\n\t\t\t\t'stage',\r\n\t\t\t\t'enemy',\r\n\t\t\t\t'attack',\r\n\t\t\t\t'effect',\r\n//\t\t\t\t'lv_data'\r\n\t\t];\r\n\t}", "function formatDelay($delay) {\n\tif ($delay) {\n\t\tlist($dh,$dm) = explode('.',$delay);\n\t\treturn '+' . ( 60*$dh + $dm ) . '\\'';\n\t} else return \"\";\n}", "public function __sleep()\n\t{\n\t\t$serialize_array = array('_data','_lang_data');\n\t\treturn $serialize_array;\n\t}", "function com_message_pump($timeoutms = 0) {}", "public function __sleep() {\n return array('filename');\n }", "function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t$output[] = $row['lead_id'];\n\t\t\t}\n\t\t}else{\n\t\t\t$this->display(\"Query failed: $query\" . mysql_error($this->conn));\n\t\t}\n\n\t\treturn $output;\n\t}", "protected function delay()\n {\n if (!isset($this->headers['x-rate-limit-reset'])) {\n exit('Rate limited, but no rate limit header found');\n }\n\n $delay = $this->headers['x-rate-limit-reset'] - time();\n\n if ($delay < 10) {\n $delay = 60 * 15; // 15 minute delay if the given delay seems unreasonably small (can be due to server time differences)\n }\n \n print \"\\n\";\n\n do {\n print \"\\r\\e[K\";\n printf('Sleeping for %d seconds', $delay--);\n sleep(1);\n } while ($delay);\n }", "public function getHaltDelay()\n {\n return $this->_haltDelay;\n }", "public function get_delay_between_checks(): int {\n $period = get_config('realtimeplugin_phppoll', 'checkinterval');\n return max($period, 200);\n }", "public function __sleep()\n\t{\n\t\treturn array('objectname', 'elements', 'deffile');\n\t}", "public function delay($value) {\n return $this->setProperty('delay', $value);\n }" ]
[ "0.87688065", "0.64770997", "0.6430185", "0.6403929", "0.637501", "0.62470186", "0.62316465", "0.62316465", "0.60334605", "0.5940774", "0.5841599", "0.56286246", "0.5409225", "0.5390306", "0.52666473", "0.5243022", "0.52224904", "0.51745665", "0.51540774", "0.5146064", "0.5105488", "0.5087677", "0.50313795", "0.4982816", "0.493647", "0.4910813", "0.49054644", "0.48877218", "0.48846775", "0.4836117" ]
0.68827325
1
returns an absolute path to the include directory, without trailing slash
function includePath() { $self = __FILE__; $lastSlash = strrpos($self, "/"); return substr($self, 0, $lastSlash); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIncludePath()\n {\n return $this->includePath;\n }", "public function loader_get_include_path () {\r\n\t\treturn $this->_include_path;\r\n\t}", "function dirPath() {return (\"../../../../\"); }", "function serendipity_getRealDir($file) {\n $dir = str_replace( \"\\\\\", \"/\", dirname($file));\n $base = preg_replace('@/include$@', '', $dir) . '/';\n return $base;\n}", "function dirPath() { return (\"../\"); }", "function dirPath () { return (\"../../\"); }", "static private function buildIncludePath() {\n\n foreach (self::$config['modules_locations'] as $location) {\n\n foreach (new DirectoryIterator($location) as $folder) {\n\n if (!$folder->isDir() || $folder->isDot()) {\n continue;\n }\n\n // Remember modules.\n self::$modules[] = $folder->getBasename();\n\n $paths[] = realpath($folder->getPathname()) . DIRECTORY_SEPARATOR . 'libraries';\n }\n }\n\n // Combine modules and core\n $paths = array_merge(array('.',\n realpath(APPPATH) . DIRECTORY_SEPARATOR . 'extensions',\n realpath(APPPATH) . DIRECTORY_SEPARATOR . 'libraries'\n ), $paths);\n\n // Build the new include path & return\n $include_path = join($paths, PATH_SEPARATOR);\n\n return $include_path;\n }", "private function getPath()\r\n\t{\r\n\t\treturn WORDWEBPRESS_INCLUDE . \r\n\t\t\t\tWordwebpress::getInstance()->configuration()->get_cfn_value('core_path') .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Wordwebpress' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Admin' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Html' .\r\n\t\t\t\tDIRECTORY_SEPARATOR;\r\n\t}", "function getIncludePath (string $file, string $page = ''): string {\n\tif ($page === '') return _ROOT_PATH.'inc/'.$file.'.php';\n\treturn _ROOT_PATH.'page/inc/'.$page.'/'.$file.'.php';\n}", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "public static function getLibraryPath(): string\n {\n return realpath(__DIR__ . \"/../\");\n }", "protected function checkCurrentDirectoryIsInIncludePath() {}", "protected function projectRootAbsolutePath()\n {\n return realpath(__DIR__ . '/../../../..');\n }", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "public static function client_helper_path() {\n // Allow integration modules to control path handling, e.g. Drupal).\n if (function_exists('iform_client_helpers_path')) {\n return iform_client_helpers_path();\n }\n else {\n $fullpath = str_replace('\\\\', '/', realpath(__FILE__));\n $root = $_SERVER['DOCUMENT_ROOT'] . self::getRootFolder();\n $root = str_replace('\\\\', '/', $root);\n $client_helper_path = dirname(str_replace($root, '', $fullpath)) . '/';\n return $client_helper_path;\n }\n }", "public function getIncludePath($sub = null)\n {\n return $this->getSubPath('include', $sub);\n }", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "function base_path()\n {\n return dirname(__DIR__);\n }", "function basePath() {\n\t$commonPath = __FILE__;\n\t$requestPath = $_SERVER['SCRIPT_FILENAME'];\n\t\n\t//count the number of slashes\n\t// number of .. needed for include level is numslashes(request) - numslashes(common)\n\t// then add one more to get to base\n\t$commonSlashes = substr_count($commonPath, '/');\n\t$requestSlashes = substr_count($requestPath, '/');\n\t$numParent = $requestSlashes - $commonSlashes + 1;\n\t\n\t$basePath = \".\";\n\tfor($i = 0; $i < $numParent; $i++) {\n\t\t$basePath .= \"/..\";\n\t}\n\t\n\treturn $basePath;\n}", "public function getBasePath()\n {\n return __DIR__ . '/..';\n }", "static public function get_dir() {\n\t\treturn apply_filters( 'themeisle_site_import_uri', trailingslashit( get_template_directory_uri() ) . self::OBOARDING_PATH );\n\t}", "public static function getModulePath()\n {\n return dirname(__DIR__);\n }", "public function getIncludePaths()\n\t{\n\t\tif (!is_array($this->_includePaths)) {\n\t\t\t$this->_includePaths = explode(PATH_SEPARATOR, (string)$this->_includePaths);\n\t\t}\n\t\t$paths = array();\n\t\tforeach ($this->_includePaths as $path) {\n\t\t\t$paths[] = $this->_isAbsolute($path)\n\t\t\t\t? $path\n\t\t\t\t: ($this->getAppPath() . '/' . $path);\n\t\t}\n\t\treturn $paths;\n\t}", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "public function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }" ]
[ "0.72928655", "0.72707367", "0.7077098", "0.70489055", "0.70401007", "0.6928244", "0.6870859", "0.6756299", "0.66347796", "0.6632205", "0.66260797", "0.6542704", "0.63725823", "0.63158613", "0.6309371", "0.63003606", "0.6268338", "0.6232803", "0.6219213", "0.6190017", "0.6166158", "0.6153783", "0.61396843", "0.61080205", "0.60670847", "0.6019649", "0.6016466", "0.60160726", "0.5995955", "0.5987023" ]
0.8402538
0
array of ('id' => reminder id, 'subject' => reminder subject, 'time' => send time)
function getReminders($user_id) { $user_id = escape($user_id); $result = mysql_query("SELECT id, title, time FROM reminders WHERE user_id = '$user_id'"); $reminders = array(); while($row = mysql_fetch_array($result)) { $reminders[] = array('id' => $row[0], 'subject' => $row[1], 'time' => $row[2]); } return $reminders; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEmailSent();", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "public function reminder_send(){\n \t/*\n \t//reminder send\n \t$total = $this->db->where(array('reminder_send' => 'no', 'id' => 1))->get('samplings')->num_rows(); \n \tif($total == 1){\n\t \t$up_result = $this->db->where('id', 1)->update('samplings', array('reminder_send' => 'yes'));\n\t \tif($up_result){ //yet //test\n\t \t\t$query = \"SELECT * FROM sample_users WHERE iris_redemption = 'yet' and iris_reminder = 'yet' and sampling_id = 1 order by id asc\";\n\t\t \t$data = $this->db->query($query)->result_array();\n\t\t \t//echo count($data);\n\t\t \t//exit;\n\t\t \t\n\t\t \t//\n\t\t \tif(count($data)){\n\t\t\t\t\tforeach ($data as $user_detail) {\n\t\t\t\t\t \t$email_subject = \"Redemption of Sulwhasoo Complimentary Anti-Aging Kit.\"; \n\t\t\t\t\t\t$email_body = \"<p>Hi \".$user_detail['first_name'].\" \".$user_detail['family_name'].\", </p>\n\t\t\t\t\t\t\t<p>Thank you for taking part in the Sulwhasoo Complimentary Anti-Aging Kit. You are entitled to redeem your trial kit.</p>\n\t\t\t\t\t\t\t<p>We have noticed that you have not redeemed your Sulwhasoo Complimentary Anti-Aging Kit*. Your trial kit will be ready for collection only at Sulwhasoo booth at ION Orchard L1 Atrium from <b>now till 6th September 2017</b>. You may redeem your trial kit by presenting the QR Code below.</p>\n\t\t\t\t\t\t\t<p><b>Strictly one redemption is allowed per person.</b></p>\n\t\t\t\t\t\t\t<p>The Organizer reserves the right to request written proof of NRIC number before collection of trial kit. The Organizer reserves the right to forfeit the campaign for any fans who do not provide the required details upon receiving the request/notification from the Organizer. </p>\n\t\t\t\t\t\t\t<p>Trial kit are not exchangeable, transferable or redeemable in any other form for whatever reason. </p>\n\t\t\t\t\t\t\t<p>Please present the email upon redemption. </p>\n\t\t\t\t\t\t\t<p>QR Code : <img src='\".$user_detail['qr_code'].\"'>\n\t\t\t\t\t\t\t<br>Unique Code :\". $user_detail['iris_code'].\"</p>\n\t\t\t\t\t\t\t<p>Terms and Conditions apply.</p>\n\t\t\t\t\t\t\t<p>*While stocks last.</p>\n\t\t\t\t\t\t\t<p>Regards,\n\t\t\t\t\t\t\t<br>Sulwhasoo Singapore</p>\n\t\t\t\t\t\t\";\t\t\t\n\t\t\t\t\t\t$this->load->library('email');\n\t\t\t\t\t\t$config['mailtype'] = \"html\";\n\t\t\t\t\t\t$this->email->initialize($config);\n\t\t\t\t\t\t$this->email->from(\"[email protected]\",\"Sulwhasoo Singapore\");\n\t\t\t\t\t\t$this->email->to($user_detail['email']);\n\t\t\t\t\t\t$this->email->subject($email_subject);\n\t\t\t\t\t\t$this->email->message($email_body);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->email->send()) {\n\t\t\t\t\t\t\t$sql = \"Update sample_users SET iris_reminder = 'sent' WHERE id = \".$user_detail['id'];\n \t\t\t\t\t\t$this->db->query($sql); \t\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t\t//\n\t\t\t\t\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t\t*/\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\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\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function getReminders()\n {\n if (array_key_exists(\"reminders\", $this->_propDict)) {\n return $this->_propDict[\"reminders\"];\n } else {\n return null;\n }\n }", "public function get_task($id, $reminder = null)\n {\n if (!is_null($reminder)) {\n $qid = $this->query('SELECT `eid` FROM '.$this->Tbl['cal_reminder'].' WHERE `ref`=\"tsk\" AND id='.doubleval($reminder));\n list($id) = $this->fetchrow($qid);\n if (!$id) {\n return array();\n }\n }\n $id = doubleval($id);\n\n // Allows to retrieve events from calendars, which are shared with us\n $gidFilter = $this->getGroupAndShareFilter(0, 't');\n\n $query = 'SELECT t.`gid`,t.`title`,t.`location`,t.`description`,t.`starts`,t.`ends`,t.`type`,t.`status`,t.`importance`,t.`completion`,t.`uuid`,fs.`val` `colour`'\n .', IF(t.`starts` IS NULL, NULL, UNIX_TIMESTAMP(t.`starts`)) `start`, IF(t.`ends` IS NULL, NULL, UNIX_TIMESTAMP(t.`ends`)) `end`'\n .' FROM '.$this->Tbl['cal_task'].' t'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=t.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=t.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .' WHERE ('.$gidFilter.') AND t.id='.doubleval($id);\n $task = $this->assoc($this->query($query));\n $task['reminders'] = array();\n $qid = $this->query('SELECT `id`,`time`,`mode`,`text`,`mailto`,`smsto` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$id.' AND `ref`=\"tsk\" ORDER BY `mode` DESC, `time` DESC');\n while ($line = $this->assoc($qid)) {\n $task['reminders'][] = $line;\n if (!is_null($reminder) && $line['id'] == $reminder) {\n $task['reminder_text'] = $line['text'];\n }\n }\n return $task;\n }", "function ef_notifications_get($transition = NULL, $rid = NULL) {\n $emails = array();\n $query = db_select('ef_notifications_emails', 'wve')\n ->fields('wve', array('rid', 'from_name', 'to_name', 'subject', 'message'));\n if ($transition) {\n $query->condition('wve.from_name', $transition->from_name);\n $query->condition('wve.to_name', $transition->to_name);\n }\n if ($rid) {\n $query->condition('wve.rid', $rid);\n }\n $result = $query->execute();\n foreach ($result as $row) {\n $emails[$row->from_name . '_to_' . $row->to_name][$row->rid] = $row;\n }\n return $emails;\n}", "public function get_event($id, $reminder = null)\n {\n if (!is_null($reminder)) {\n $qid = $this->query('SELECT `eid` FROM '.$this->Tbl['cal_reminder'].' WHERE `ref`=\"evt\" AND id='.doubleval($reminder));\n list($id) = $this->fetchrow($qid);\n if (!$id) {\n return array();\n }\n }\n $id = doubleval($id);\n\n // Allows to retrieve events from calendars, which are shared with us\n $gidFilter = $this->getGroupAndShareFilter(0);\n\n $query = 'SELECT e.`id`,e.`id` `eid`,e.uid ,UNIX_TIMESTAMP(e.starts) `start`, UNIX_TIMESTAMP(e.ends) `end`, e.`starts`, e.`ends`'\n .',e.`title`,e.`description`,e.`location`,e.`type`,e.`status`,e.`opaque`,e.`gid`,e.`uuid`, fs.`val` `colour`, eg.`type` `calendar_type`'\n .' FROM '.$this->Tbl['cal_event'].' e'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=e.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=e.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .' WHERE ('.$gidFilter.') AND e.id='.$id;\n $event = $this->assoc($this->query($query));\n $event['reminders'] = array();\n $qid = $this->query('SELECT `id`,`time`,`mode`,`text`,`mailto`,`smsto` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$id.' AND `ref`=\"evt\" ORDER BY `mode` DESC, `time` DESC');\n while ($line = $this->assoc($qid)) {\n $event['reminders'][] = $line;\n if (!is_null($reminder) && $line['id'] == $reminder) {\n $event['reminder_text'] = $line['text'];\n }\n }\n $event['repetitions'] = array();\n $qid = $this->query('SELECT `id`,`type`,`repeat`,`extra`,`until`,IF (`until` IS NOT NULL, unix_timestamp(`until`), 0) `until_unix`'\n .' FROM '.$this->Tbl['cal_repetition'].' WHERE `eid`='.$id.' AND `ref`=\"evt\" ORDER BY `id` ASC');\n while ($line = $this->assoc($qid)) {\n $event['repetitions'][] = $line;\n }\n return $event;\n }", "public function aim_onlinetime()\r\n\t{\r\n\t\t$s = time() - $this->core->user['timer'];\r\n\t\t$d = intval($s / 86400);\r\n\t\t$s -= $d * 86400;\r\n\t\t$h = intval($s / 3600);\r\n\t\t$s -= $h * 3600;\r\n\t\t$m = intval($s / 60);\r\n\t\t$s -= $m * 60;\r\n\t\treturn array('days' => $d, 'hours' => $h, 'mins' => $m, 'secs' => $s);\r\n\t}", "function send_first_reminder()\n\t{\n\t\tlog_message('debug', '_message_cron/send_first_reminder');\n\t\t# get non-responsive invites that are more than FIRST_INVITE_PERIOD days old\n\t\t$list = $this->_query_reader->get_list('get_non_responsive_invitations', array('days_old'=>FIRST_INVITE_PERIOD, 'limit_text'=>' LIMIT '.MAXIMUM_INVITE_BATCH_LIMIT, 'old_message_code'=>'invitation_to_join_clout'));\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [1] list='.json_encode($list));\n\t\t# resend old invite as a reminder\n\t\t$results = array();\n\t\tforeach($list AS $i=>$row){\n\t\t\t$results[$i] = $this->_query_reader->run('resend_old_invite', array('invite_id'=>$row['invite_id'], 'new_code'=>'first_reminder_to_join_clout', 'new_status'=>'pending'));\n\t\t}\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [2] results='.json_encode($results));\n\t\t$reason = empty($results)? 'no-users': '';\n\t\treturn array('result'=>(get_decision($results)? 'SUCCESS': 'FAIL'), 'count'=>count($results), 'reason'=>$reason);\n\t}", "public function sendAssignmentNotification()\n {\n \t$ctime = date('Y-m-d'); //get current day\n \n \t//get facebook id from the user setting for facebook reminder\n \t$this->PleAssignmentReminder->virtualFields = array('tid' => 'PleUserMapTwitter.twitterId');\n \n \t//get last sent id\n \t$last_sent_id = $this->PleLastReminderSent->find('first',array('conditions' => array('PleLastReminderSent.date' => $ctime, 'PleLastReminderSent.type' => 'twitter')));\n \n \tif( count($last_sent_id) > 0 ) {\n \t\t$options['conditions'][] = array('PleAssignmentReminder.id >' => $last_sent_id['PleLastReminderSent']['last_sent_rid']);\n \t}\n \n \t//get appController class object\n \t$obj = new AppController();\n \t$assignments = $obj->getAssignmentConstraints();\n \n \t//get today assignments\n \n \t$options['conditions'][] = $assignments;\n \t$options['fields'] = array('id', 'user_id', 'assignment_uuid', 'assignment_title', 'due_date', 'course_id');\n \t$options['order'] = array('PleAssignmentReminder.id ASC');\n \n \t//execute query\n \t$assignmnet_details = $this->PleAssignmentReminder->find('all', $options);\n \t\n \n \t//send twitter reminder\n \tforeach( $assignmnet_details as $assignmnet_detail ) {\n\t $user_id = $assignmnet_detail['PleAssignmentReminder']['user_id'];\n \t\t//$to_twitter = $assignmnet_detail['PleAssignmentReminder']['tid'];\n \t\t$body = $assignmnet_detail['PleAssignmentReminder']['assignment_title'];\n\t\t$course_id = $assignmnet_detail['PleAssignmentReminder']['course_id'];\n \t\t\n\t\t//get twitter users array if user is instructor\n \t\t$twitter_users_array = $this->getChildren( $user_id, $course_id );\n\t\t\n \t\t//set display date for assignments\n \t\t$originalDate = $assignmnet_detail['PleAssignmentReminder']['due_date'];\n\t\tif($originalDate != \"\"){\n \t\t$newDate = date(\"F d, Y\", strtotime($originalDate));\n \t\t$due_date = \" due on $newDate\";\n\t\t}else{\n\t\t \t$due_date = \" is due on NA\";\n\t\t }\n \t\t\n \t\t//compose mail date\n \t\t$mail_data = \"Assignment Reminder! $course_id. Your assignment, $body, $due_date.\";\n \t\t$subject = $course_id.\" - \".$body;\n \n\t\t//send the reminder to multiple users\n \t\tforeach ($twitter_users_array as $to_twitter_data ) {\n\t\t$to_twitter = $to_twitter_data['twitter_id'];\n \t\t$to_id = $to_twitter_data['id'];\n \t\t$send_twitter = $this->sendNotification( $to_twitter, $mail_data );\n \n \t\t//check for if facebook reminder sent\n \t\tif ( $send_twitter == 1) {\n \n \t\t\t//remove the previous entry of current date\n \t\t\t$this->PleLastReminderSent->deleteAll(array('PleLastReminderSent.date'=>$ctime, 'PleLastReminderSent.type'=>'twitter'));\n \t\t\t$this->PleLastReminderSent->create();\n \n \t\t\t//update the table for sent facebook reminder\n \t\t\t$data['PleLastReminderSent']['last_sent_rid'] = $assignmnet_detail['PleAssignmentReminder']['id'];\n \t\t\t$data['PleLastReminderSent']['type'] = 'twitter';\n \t\t\t$data['PleLastReminderSent']['date'] = $ctime;\n \t\t\t$this->PleLastReminderSent->save($data);\n \n \t\t\t//create the CSV user data array\n \t\t\t$csv_data = array('id'=>$to_id, 'tid'=>$to_twitter, 'mail_data'=> $mail_data);\n \n \t\t\t//write the csv\n \t\t\t$this->writeTwitterCsv($csv_data);\n \n \t\t\t//unset the csv data array\n \t\t\tunset($csv_data);\n \t\t} else if ( $send_twitter == 2) { //twitter app not following case(can be used for future for notification on dashboard)\n \t\t\t\n \t\t} else {\n \t\t\t//handling for twitter reminder failure\n\t \t\t$tw_data = array();\n\t \t\t$tw_data['AssignmentTwitterFailure']['twitter_id'] = $to_twitter;\n\t \t\t$tw_data['AssignmentTwitterFailure']['mail_data'] = $mail_data;\n\t \t\t$this->AssignmentTwitterFailure->create();\n\t \t\t$this->AssignmentTwitterFailure->save($tw_data);\n \t\t}\n\t\t}\n \t}\n }", "public function broadcastOn()\n {\n return [$this->reciever_id];\n }", "static public function sendReminders($vars)\n {\n global $whups_driver;\n\n if ($vars->get('id')) {\n $info = array('id' => $vars->get('id'));\n } elseif ($vars->get('queue')) {\n $info['queue'] = $vars->get('queue');\n if ($vars->get('category')) {\n $info['category'] = $vars->get('category');\n } else {\n // Make sure that resolved tickets aren't returned.\n $info['category'] = array('unconfirmed', 'new', 'assigned');\n }\n } else {\n throw new Whups_Exception(_(\"You must select at least one queue to send reminders for.\"));\n }\n\n $tickets = $whups_driver->getTicketsByProperties($info);\n self::sortTickets($tickets);\n if (!count($tickets)) {\n throw new Whups_Exception(_(\"No tickets matched your search criteria.\"));\n }\n\n $unassigned = $vars->get('unassigned');\n $remind = array();\n foreach ($tickets as $info) {\n $info['link'] = self::urlFor('ticket', $info['id'], true, -1);\n $owners = current($whups_driver->getOwners($info['id']));\n if (!empty($owners)) {\n foreach ($owners as $owner) {\n $remind[$owner][] = $info;\n }\n } elseif (!empty($unassigned)) {\n $remind['**' . $unassigned][] = $info;\n }\n }\n\n /* Build message template. */\n $view = new Horde_View(array('templatePath' => WHUPS_BASE . '/config'));\n $view->date = strftime($GLOBALS['prefs']->getValue('date_format'));\n\n /* Get queue specific notification message text, if available. */\n $message_file = WHUPS_BASE . '/config/reminder_email.plain';\n if (file_exists($message_file . '.local.php')) {\n $message_file .= '.local.php';\n } else {\n $message_file .= '.php';\n }\n $message_file = basename($message_file);\n\n foreach ($remind as $user => $utickets) {\n if (empty($user) || !count($utickets)) {\n continue;\n }\n $view->tickets = $utickets;\n $subject = _(\"Reminder: Your open tickets\");\n $whups_driver->mail(array('recipients' => array($user => 'owner'),\n 'subject' => $subject,\n 'view' => $view,\n 'template' => $message_file,\n 'from' => $user));\n }\n }", "public function Action_Reminder()\n {\n $this->Chunk_Init();\n\n if ( $_REQUEST['Users']['Keystring'] != Zero_App::$Users->Keystring )\n {\n $this->SetMessage(-1, ['Контрольная строка не верна']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $this->Model->Load_Email($_REQUEST['Users']['Email']);\n if ( 0 == $this->Model->ID )\n {\n $this->SetMessage(-1, ['Пользователь не найден']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $password = substr(md5(uniqid(mt_rand())), 0, 10);\n $this->Model->Password = md5($password);\n $this->Model->Save();\n\n $subject = \"Reminder access details \" . HTTP;\n $View = new Zero_View('Zero_Users_ReminderMail');\n $View->Assign('Users', $this->Model);\n $View->Assign('password', $password);\n $message = $View->Fetch();\n\n $email = [\n 'Reply' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'From' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'To' => [\n $this->Model->Email => $this->Model->Name,\n ],\n 'Subject' => \"Reminder access details \" . HTTP,\n 'Message' => $message,\n 'Attach' => [],\n ];\n $cnt = Helper_Mail::SendMessage($email);\n if ( 0 < $cnt )\n $this->SetMessageError(-1, [\"Реквизиты не отправлены на почту\"]);\n else\n $this->SetMessage(0, [\"Реквизиты отправлены на почту\"]);\n $this->Chunk_View();\n return $this->View;\n }", "public function broadcastOn()\n {\n return ['ticket_'.$this->ticket->id];\n }", "function defineMeetingTime(){\r\n\r\n\t$SQL=\"select * from agenda where event<>'' order by meetingTime\";\r\n\t$agendaArray=get_obj_info($SQL , array(\"meetingTime\",\"event\"));\r\n\tfor($i=0;$i<count($agendaArray);$i++){\r\n\t\t$meetingTime = $agendaArray[$i]->meetingTime;\r\n\t\t$meetingTime_array[$i] = strftime(\"%H:%M\", mkdate($meetingTime));\r\n\t}\r\n\t\r\n\treturn $meetingTime_array;\r\n}", "public static function sendReminderEmails($rows, $bccEmail, $time = 1)\n\t{\n\t\t$config = OSMembershipHelper::getConfig();\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$mailer = static::getMailer($config);\n\n\t\tif (JMailHelper::isEmailAddress($bccEmail))\n\t\t{\n\t\t\t$mailer->addBcc($bccEmail);\n\t\t}\n\n\t\t$fieldSuffixes = array();\n\n\t\tswitch ($time)\n\t\t{\n\t\t\tcase 2:\n\t\t\t\t$fieldPrefix = 'second_reminder_';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$fieldPrefix = 'third_reminder_';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$fieldPrefix = 'first_reminder_';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$message = OSMembershipHelper::getMessages();\n\t\t$timeSent = $db->quote(JFactory::getDate()->toSql());\n\t\tfor ($i = 0, $n = count($rows); $i < $n; $i++)\n\t\t{\n\t\t\t$row = $rows[$i];\n\n\t\t\tif ($row->number_days < 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$query->clear()\n\t\t\t\t->select('COUNT(*)')\n\t\t\t\t->from('#__osmembership_subscribers')\n\t\t\t\t->where('plan_id = ' . $row->plan_id)\n\t\t\t\t->where('published = 1')\n\t\t\t\t->where('DATEDIFF(from_date, NOW()) >=0')\n\t\t\t\t->where('((user_id > 0 AND user_id = ' . (int) $row->user_id . ') OR email=\"' . $row->email . '\")');\n\t\t\t$db->setQuery($query);\n\t\t\t$total = (int) $db->loadResult();\n\t\t\tif ($total)\n\t\t\t{\n\t\t\t\t$query->clear()\n\t\t\t\t\t->update('#__osmembership_subscribers')\n\t\t\t\t\t->set($db->quoteName($fieldPrefix . 'sent') . ' = 1 ')\n\t\t\t\t\t->where('id = ' . $row->id);\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$db->execute();\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$fieldSuffix = '';\n\t\t\tif ($row->language)\n\t\t\t{\n\t\t\t\tif (!isset($fieldSuffixes[$row->language]))\n\t\t\t\t{\n\t\t\t\t\t$fieldSuffixes[$row->language] = OSMembershipHelper::getFieldSuffix($row->language);\n\t\t\t\t}\n\n\t\t\t\t$fieldSuffix = $fieldSuffixes[$row->language];\n\t\t\t}\n\n\t\t\t$query->clear()\n\t\t\t\t->select('title' . $fieldSuffix . ' AS title')\n\t\t\t\t->from('#__osmembership_plans')\n\t\t\t\t->where('id = ' . $row->plan_id);\n\n\t\t\t$db->setQuery($query);\n\t\t\t$planTitle = $db->loadResult();\n\n\t\t\t$query->clear();\n\t\t\t$replaces = array();\n\t\t\t$replaces['plan_title'] = $planTitle;\n\t\t\t$replaces['first_name'] = $row->first_name;\n\t\t\t$replaces['last_name'] = $row->last_name;\n\t\t\t$replaces['number_days'] = $row->number_days;\n\t\t\t$replaces['expire_date'] = JHtml::_('date', $row->to_date, $config->date_format);\n\n\t\t\tif (strlen($message->{$fieldPrefix . 'email_subject' . $fieldSuffix}))\n\t\t\t{\n\t\t\t\t$subject = $message->{$fieldPrefix . 'email_subject' . $fieldSuffix};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$subject = $message->{$fieldPrefix . 'email_subject'};\n\t\t\t}\n\n\t\t\tif (strlen(strip_tags($message->{$fieldPrefix . 'email_body' . $fieldSuffix})))\n\t\t\t{\n\t\t\t\t$body = $message->{$fieldPrefix . 'email_body' . $fieldSuffix};\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$body = $message->{$fieldSuffix . 'email_body'};\n\t\t\t}\n\n\t\t\tforeach ($replaces as $key => $value)\n\t\t\t{\n\t\t\t\t$key = strtoupper($key);\n\t\t\t\t$body = str_ireplace(\"[$key]\", $value, $body);\n\t\t\t\t$subject = str_ireplace(\"[$key]\", $value, $subject);\n\t\t\t}\n\n\t\t\tif (JMailHelper::isEmailAddress($row->email))\n\t\t\t{\n\t\t\t\tstatic::send($mailer, array($row->email), $subject, $body);\n\n\t\t\t\t$mailer->clearAddresses();\n\t\t\t}\n\n\t\t\t$query->clear()\n\t\t\t\t->update('#__osmembership_subscribers')\n\t\t\t\t->set($fieldPrefix . 'sent = 1')\n\t\t\t\t->set($fieldPrefix . 'sent_at = ' . $timeSent)\n\t\t\t\t->where('id = ' . $row->id);\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\t\t}\n\t}", "function ef_notifications_get($transition = NULL, $rid = NULL) {\n $emails = array();\n $query = db_select('ef_notifications_emails', 'nfe')\n ->fields('nfe', array('rid', 'from_name', 'to_name', 'subject', 'message'));\n if ($transition) {\n $query->condition('nfe.from_name', $transition->from_name);\n $query->condition('nfe.to_name', $transition->to_name);\n }\n if ($rid) {\n $query->condition('nfe.rid', $rid);\n }\n $result = $query->execute();\n foreach ($result as $row) {\n $emails[$row->from_name . '_to_' . $row->to_name][$row->rid] = $row;\n }\n return $emails;\n}", "private function getMessageEventData(): array {\n $data = [\n \"type\" => \"message\",\n \"channel\" => \"C2147483705\",\n \"user\" => \"U2147483697\",\n \"text\" => \"Hello world\",\n \"ts\" => \"1355517523.000005\"\n ];\n if ( rand( 0, 1 ) == 0 ) {\n return $data;\n } else {\n $data[ 'edited' ] = [\n \"user\" => \"U2147483697\",\n \"ts\" => \"1355517536.000001\"\n ];\n return $data;\n }\n }", "public function definition()\n {\n $sender = Sender::inRandomOrder()->first();\n $rcpt = Recipient::inRandomOrder()->first();\n\n return [\n 'sender_id' => $sender->id,\n 'recipient_id' => $rcpt->id,\n 'subject' => $this->faker->text(100),\n 'plain_content' => $this->faker->text(300),\n 'html_content' => $this->faker->text(300),\n 'status' => \\Arr::random(['posted', 'sent', 'failed'])\n ];\n }", "public function agenda_reminder($id,$team_id= null){\n\t\t$from = date('H:i:s',strtotime ( '-70 min' , strtotime (date('H:i:s')) ));\n\t \t$to = date('H:i:s');\n\n\t $agendas = AgendaMast::whereBetween('required_at',array($from,$to))\n\t ->where('days_active','like','%'.date('N').'%')\n\t ->get(); \n\n\t foreach($agendas as $agenda){\n\t \t$users = User::whereIn('id', json_decode($agenda->permissions)->can_respond)->get();\n\t\t $team = null;\n\t\t Notification::send($users, new SendAgendaMessage($agenda,$team));\n\t }\n\t }", "public function data()\n {\n $email_subject = $this->getEmailSubject();\n $email_body = $this->getEmailBody();\n $headers = Helper::getMailHeader($this->email_headers);\n \n return [\n 'to' => [\n 'email' => $this->email_address\n ],\n 'headers' => $headers,\n 'subject' => $email_subject,\n 'body' => $email_body,\n 'campaign_id' => $this->campaign_id,\n 'id' => $this->id,\n 'subscriber_id' => $this->subscriber_id\n ];\n }", "public function sendReminder()\n {\n $token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTU4MDU1OTc5OCwiZXhwIjo0MTAyNDQ0ODAwLCJ1aWQiOjc3MTA4LCJyb2xlcyI6WyJST0xFX1VTRVIiXX0.0itAev15AZH70jnynEZbqL5K0Z_YQe-Kvp1m5MZ_Ij0\";\n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n\n $accountsdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date = CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n $accountsoverdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date < CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n foreach($accountsdue as $key => $account){\n \n $smsBody= $currentTime . \" \" . $account->account_number . \"/\" . $account->account_name . \". Your account is due today.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody;\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n \n //\n }\n\n foreach($accountsoverdue as $key => $account){\n \n $smsBody= $account->account_number . \"/\" . $account->account_name . \". Your account is overdue.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody . \" \";\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n }\n }", "public function getBorrowReminder() {\n $dataReminder = DB::table('settings')->where('name', 'dayredm')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n $toDate = Carbon::now()->addDays($dataReminder->content);\n\n $data = Borrow::where('status', '<', '20')->whereBetween( 'ngaydaohan', array($fromDate->toDateTimeString(), $toDate->toDateTimeString()) )->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $userObj = User::where('id', $record->uid)->first();\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'], 'REMINDER_1');\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '20'));\n }\n } else {\n echo 'No data';\n }\n }", "public function getUserIDToSendMail(){\n\t\t \n\t\t $userSessionID = Input::get('user_session_id'); \n\t\t \t$logTable = \"log_vistaws_\" . date('Y_m');\t \n\t\t \n\t\t $DataLogBooking = DB::table($logTable)\n\t\t\t\t\t\t ->select('phone', 'email', 'cname', 'theater', \n\t\t\t\t\t\t \t\t 'show_time', 'session_id', 'movie', 'seat', 'amount' , 'pincode' )\n\t\t\t\t\t\t ->where('user_session_id','=', $userSessionID) \n\t\t\t\t\t\t ->where('pincode','!=', '')\n\t\t\t\t\t\t ->get(); \n\t\t\t\t\t\t \n\t\t foreach ($DataLogBooking as $resultLog){ \n\t\t\t\t$mobile \t\t= $resultLog->phone;\n\t\t\t\t$email\t\t= $resultLog->email;\n\t\t\t\t$cname \t\t= $resultLog->cname;\n\t\t\t\t$hall\t \t= $resultLog->theater;\n\t\t\t\t$movieSession \t= $resultLog->show_time;\n\t\t\t \t$sessID\t = $resultLog->session_id;\n\t\t\t\t$movieName = $resultLog->movie;\n\t\t\t $seatPosition = $resultLog->seat;\n\t\t\t\t$SeatPrice\t = $resultLog->amount; \n\t\t\t\t$pincode\t = $resultLog->pincode; \n\t\t\t} #end foreach\n\t\t\t\n\t\t\t//**********\n\t\t $rowMovieDetail = DB::table('movie_showtimes')\n\t\t\t\t\t\t\t ->leftJoin('movie_list', 'movie_showtimes.showtime_Movie_strID', '=', 'movie_list.movie_strID')\n\t\t\t\t\t\t\t ->where('movie_showtimes.showtime_Session_strID','=', $sessID) \n\t\t\t\t\t\t\t ->where('movie_list.movieID','>', '0')\n\t\t\t\t\t\t\t ->where('movie_list.movie_Publish' , '1') \n\t\t\t\t\t\t\t ->get(); \n\t\t\t//***********\n\t\t\tforeach ($rowMovieDetail as $resultMovieDetail){ \n\t\t\t\t$movieName \t\t\t= $resultMovieDetail->movie_Name_EN;\n\t\t\t\t$imgPoster\t\t\t= $resultMovieDetail->movie_Img_Thumb;\n\t\t\t\t$showtimes \t\t\t= $resultMovieDetail->showtime_soundAttributes;\n\t\t\t\t$movie_Rating \t\t\t= $resultMovieDetail->movie_Rating; \n\t\t\t\t$showtime_SystemType \t= $resultMovieDetail->showtime_SystemType; \n\t\t\t\t\n\t\t\t} #end foreach\n\t\t\t\n\t\t\t\tif($movie_Rating == \"ส.\"){ \n\t\t\t\t\t$imgRate = \"rate_raise.png\"; \n\t\t\t\t }else if($movie_Rating == \"น13+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_13_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น15+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_15_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น18+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_18_en.png\";\n\t\t\t\t }else if($movie_Rating == \"ฉ20-\"){ \n\t\t\t\t\t$imgRate = \"rate_under_20_en.png\";\n\t\t\t\t }else { \n\t\t\t\t\t$imgRate = \"rate_general_en.png\";\n\t\t\t\t }//***********\n\t\t\t\t \n\t\t\t\t if($showtime_SystemType == \"VS00000001\"){ \n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000001\"){ \n\t\t\t\t\t$imgSystem = \"type_3d.png\";\n\t\t\t\t\t$systemName = 'D3D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000002\"){ \n\t\t\t\t\t$imgSystem = \"type_hfr_3d.png\";\n\t\t\t\t\t$systemName = 'HFR 3D';\t\t \n\t\t\t\t }else{\n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t } //*************\n\t\t\t\n\t\t//********** Start Send mail **/////////////\n\t\t$data = array(\n\t\t\t\t'seatPosition'\t=> $seatPosition,\n\t\t\t\t'SeatPrice'\t\t=> $SeatPrice,\n\t\t\t\t'imgSystem'\t\t=> $imgSystem,\n\t\t\t\t'systemName'\t=> $systemName, \n\t\t\t\t'imgRate'\t\t=> $imgRate, \n\t\t\t\t'movieName'\t\t=> $movieName,\n\t\t\t\t'sessID'\t\t=> $sessID,\n\t\t\t\t'imgPoster'\t\t=> $imgPoster,\n\t\t\t\t'movieSession'\t=> $movieSession, \n\t\t\t\t'pincode'\t\t=> $pincode,\n\t\t\t\t'mobile'\t\t=> $mobile,\n\t\t\t\t'hall'\t\t\t=> $hall, \n\t\t\t\t'showtimes'\t\t=> $showtimes, \n\t\t\t\t'cname'\t\t\t=> $cname, \t\t \n\t\t\t\t'email'\t\t\t=> $email \n\t\t\t); \n\t\t\t\n\t\t\t$user = array(\n\t\t\t\t\t'email'=> $email \n\t\t\t);\n\t\t\t \n\t Mail::send('emails.enews', $data , function($message)use ($user){ \n\t\t\t $message->to($user['email'], $user['email'])->subject('Movie ticket booking notification from Embassycineplex.com');\n\t\t });\t/**/\n\t\t echo 'OK';\n\t\t//********* ****************************\t\n\t\t\t\n\t \n\t}", "public function toArray()\n {\n return [\n 'on' => $this->on,\n 'message' => $this->message,\n 'remaining' => $this->remaining\n ];\n }", "function sendFirstReminderEmails($rows) {\t\t\r\n\t\t$config = OSMembershipHelper::getConfig() ;\r\n\t\t$jconfig = new JConfig();\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$fromEmail = $jconfig->mailfrom;\r\n\t\t$fromName = $jconfig->fromname;\r\n\t\t$planTitles = array() ;\r\n\t\t$subscriberIds = array();\r\n\t\tif (version_compare(JVERSION, '3.0', 'ge')) {\r\n\t\t\t$j3 = true ;\r\n\t\t\t$mailer = new JMail() ;\r\n\t\t} else {\r\n\t\t\t$j3 = false ;\r\n\t\t}\r\n\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\r\n\t\t\t$row = $rows[$i] ;\r\n\t\t\tif(!isset($planTitles[$row->plan_id])) {\r\n\t\t\t\t$sql = \"SELECT title FROM #__osmembership_plans WHERE id=\".$row->plan_id ;\r\n\t\t\t\t$db->setQuery($sql) ;\r\n\t\t\t\t$planTitle = $db->loadResult();\r\n\t\t\t\t$planTitles[$row->plan_id] = $planTitle ;\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\t$replaces = array() ;\r\n\t\t\t$replaces['plan_title'] = $planTitles[$row->plan_id] ;\r\n\t\t\t$replaces['first_name'] = $row->first_name ;\r\n\t\t\t$replaces['last_name'] = $row->last_name ;\r\n\t\t\t$replaces['number_days'] = $row->number_days ;\r\n\t\t\t$replaces['expire_date'] = JHTML::_('date', $row->to_date, $config->date_format);\r\n\r\n\t\t\t\r\n\t\t\t//Over-ridde email message\r\n\t\t\t$subject = $config->first_reminder_email_subject ;\t\t\t\r\n\t\t\t$body = $config->first_reminder_email_body ;\t\t\t\t\t\t\t\t\t\r\n\t\t\tforeach ($replaces as $key=>$value) {\r\n\t\t\t\t$key = strtoupper($key) ;\r\n\t\t\t\t$body = str_replace(\"[$key]\", $value, $body) ;\r\n\t\t\t\t$subject = str_replace(\"[$key]\", $value, $subject) ;\r\n\t\t\t}\t\t\t\r\n\t\t\tif ($j3)\r\n\t\t\t\t$mailer->sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\r\n\t\t\telse\t\t\t\r\n\t\t\t\tJUtility::sendMail($fromEmail, $fromName, $row->email, $subject, $body, 1);\t\t\t\r\n\t\t\t$subscriberIds[] = $row->id ;\r\n\t\t}\r\n\t\tif (count($subscriberIds)) {\r\n\t\t\t$sql = 'UPDATE #__osmembership_subscribers SET first_reminder_sent=1 WHERE id IN ('.implode(',', $subscriberIds).')';\r\n\t\t\t$db->setQuery($sql) ;\r\n\t\t\t$db->query();\t\r\n\t\t}\r\n\t\t\r\n\t\treturn true ;\t\t\t\t\t\r\n\t}", "public function send_reminder()\n\t{\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$device_id = $this->input->post('device_id');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nWear facemask and faceshield properly. Bring Ballpen.\";\n\t \t\t$message .= \"\\nSalamat po.\";\n\t\t\t$this->send_text($message,$contact_number,$device_id);\n\t\t}\n\t}", "public function get_all_subscribed4explanations () {\n\n $list = array();\n $result = $this->query( \"SELECT * FROM beamtime_subscriber\" );\n $nrows = mysql_numrows( $result );\n for( $i = 0; $i < $nrows; $i++ ) {\n $row = mysql_fetch_array( $result, MYSQL_ASSOC );\n $row['subscribed_time'] = LusiTime::from64($row['subscribed_time']);\n array_push ( $list, $row );\n }\n return $list;\n }", "public function getNew()\n\t{\n\t\t$msgs = $this->getAllByQuery(\"date_sent >= ?\", [$this->last_query_time]);\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}" ]
[ "0.5956409", "0.5942598", "0.5855934", "0.57800454", "0.57195127", "0.57024467", "0.5694397", "0.5691844", "0.5671454", "0.5665917", "0.56631905", "0.56370395", "0.5629976", "0.5623494", "0.56022614", "0.55840594", "0.5577926", "0.5555138", "0.5526997", "0.5521709", "0.5513553", "0.55119526", "0.54842865", "0.54516554", "0.544747", "0.5445615", "0.5419892", "0.5419663", "0.54118544", "0.54067206" ]
0.6444044
0
determine whether we should postpone in addition to reminder time or measured from current time
function postponeReminder($user_id, $id, $time, $time_type) { $postponeCurrent = getPreference($user_id, 'postpone_current') === 'yes'; $new_time = $postponeCurrent ? time() : "time"; $time = escape($time); if($time_type == "hour" || $time_type == "minute" || $time_type == "day") { if($postponeCurrent) { $new_time = strtotime("+ $time $time_type"); if($new_time === false) { //if failed, then don't change anything $new_time = "time"; } } else { //just add on the number of seconds represented if($time_type == "hour") { $new_time .= "+3600"; } else if($time_type == "minute") { $new_time .= "+60"; } else if($time_type == "day") { $new_time .= "+" . (3600 * 24); } } } $user_id = escape($user_id); $id = escape($id); mysql_query("UPDATE reminders SET time = $new_time WHERE user_id = '$user_id' AND id = '$id'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRedeemed() {\n // we get if it wasn't used yet\n return $this->getUsed_at() != '';\n }", "public function hasRelivetime(){\n return $this->_has(3);\n }", "public function hasLastrewardtime(){\n return $this->_has(7);\n }", "public static function reschedule_if_needed() {\n\t\n\t\tglobal $updraftplus;\n\t\n\t\t// If nothing is scheduled, then no re-scheduling is needed, so return\n\t\tif (empty($updraftplus->newresumption_scheduled)) return;\n\t\t\n\t\t$time_away = $updraftplus->newresumption_scheduled - time();\n\t\t\n\t\t// 45 is chosen because it is 15 seconds more than what is used to detect recent activity on files (file mod times). (If we use exactly the same, then it's more possible to slightly miss each other)\n\t\tif ($time_away > 1 && $time_away <= 45) {\n\t\t\t$updraftplus->log('The scheduled resumption is within 45 seconds - will reschedule');\n\t\t\t// Increase interval generally by 45 seconds, on the assumption that our prior estimates were innaccurate (i.e. not just 45 seconds *this* time)\n\t\t\tself::increase_resume_and_reschedule(45);\n\t\t}\n\t}", "public function shouldTargetToCurrentTime()\n {\n return $this->targetToCurrentTime;\n }", "public function appliesForReminder(Mage_Sales_Model_Order $order)\n {\n $reminderDays = $this->config->getPaymentReminderDays();\n $dateNow = new \\DateTime();\n\n try {\n $orderReminderDate = new \\DateTime($order->getCreatedAt());\n $orderReminderDate->add(\n new \\DateInterval(\"P{$reminderDays}D\")\n );\n $isOldEnough = $orderReminderDate->getTimestamp() < $dateNow->getTimestamp();\n } catch(\\Exception $exception) {\n $isOldEnough = false;\n Mage::logException($exception);\n }\n\n $reminderSend = $order->getPayment()->getAdditionalInformation('reminder_sent') === 1;\n\n return $isOldEnough && !$reminderSend;\n }", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "function flagReminded($subscriptionId, $reminderType) {\n\t\t$this->update(\n\t\t\tsprintf(\n\t\t\t\t'UPDATE subscriptions SET %s=%s WHERE subscription_id=?',\n\t\t\t\t$reminderType==SUBSCRIPTION_REMINDER_FIELD_BEFORE_EXPIRY?'date_reminded_before':'date_reminded_after',\n\t\t\t\t$this->datetimeToDB(Core::getCurrentDate())\n\t\t\t),\n\t\t\tarray((int) $subscriptionId)\n\t\t);\n\t}", "public function checkTimeEnd(): bool;", "public function matchTime()\n {\n $zone = $this->automation->customer->getTimezone();\n $today = Carbon::now($zone)->toTimeString();\n $time = Carbon::parse($this->getDataValue('time'))->tz($zone)->toTimeString();\n return $today >= $time;\n }", "public function getAnswerTime();", "public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }", "public function isPended() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->pendingDate) ? false: true;\r\n\t}", "public function isDone()\n\t{\n\t $today = Carbon::now()->setTimezone('America/Los_Angeles')->startOfDay();\n\t return $today->gte($this->event_date->endOfDay());\n\t}", "function sendNextReminder($regitem)\n {\n list($confirm, $opts) = $regitem;\n\n $regDate = strtotime($confirm->modified); // Seems like my best bet\n $now = strtotime('now');\n\n // Days since registration\n $days = ($now - $regDate) / 86499; // 60*60*24 = 86499\n // $days = ($now - $regDate) / 120; // Two mins, good for testing\n\n if ($days > 7 && isset($opts['onetime'])) {\n // Don't send the reminder if we're past the normal reminder window and\n // we've already pestered her at all before\n if (Email_reminder::needsReminder(self::REGISTER_REMINDER, $confirm)) {\n common_log(LOG_INFO, \"Sending one-time registration confirmation reminder to {$confirm->address}\", __FILE__);\n $subject = _m(\"Reminder - please confirm your registration!\");\n return EmailReminderPlugin::sendReminder(\n self::REGISTER_REMINDER,\n $confirm,\n $subject,\n -1 // special one-time indicator\n );\n }\n }\n\n // Welcome to one of the ugliest switch statement I've ever written\n\n switch($days) {\n case ($days > 1 && $days < 2):\n if (Email_reminder::needsReminder(self::REGISTER_REMINDER, $confirm, 1)) {\n common_log(LOG_INFO, \"Sending one day registration confirmation reminder to {$confirm->address}\", __FILE__);\n // TRANS: Subject for reminder e-mail.\n $subject = _m('Reminder - please confirm your registration!');\n return EmailReminderPlugin::sendReminder(\n self::REGISTER_REMINDER,\n $confirm,\n $subject,\n 1\n );\n } else {\n return true;\n }\n break;\n case ($days > 3 && $days < 4):\n if (Email_reminder::needsReminder(self::REGISTER_REMINDER, $confirm, 3)) {\n common_log(LOG_INFO, \"Sending three day registration confirmation reminder to {$confirm->address}\", __FILE__);\n // TRANS: Subject for reminder e-mail.\n $subject = _m('Second reminder - please confirm your registration!');\n return EmailReminderPlugin::sendReminder(\n self::REGISTER_REMINDER,\n $confirm,\n $subject,\n 3\n );\n } else {\n return true;\n }\n break;\n case ($days > 7 && $days < 8):\n if (Email_reminder::needsReminder(self::REGISTER_REMINDER, $confirm, 7)) {\n common_log(LOG_INFO, \"Sending one week registration confirmation reminder to {$confirm->address}\", __FILE__);\n // TRANS: Subject for reminder e-mail.\n $subject = _m('Final reminder - please confirm your registration!');\n return EmailReminderPlugin::sendReminder(\n self::REGISTER_REMINDER,\n $confirm,\n $subject,\n 7\n );\n } else {\n return true;\n }\n break;\n default:\n common_log(LOG_INFO, \"No need to send registration reminder to {$confirm->address}.\", __FILE__);\n break;\n }\n return true;\n }", "public function isDayPassed()\n {\n return ($this->declineTime < (time() - self::ONE_DAY_IN_SECONDS));\n }", "public function remember()\r\n {\r\n $iNewTime = PHPFOX_TIME + (strtotime(\"+\" . Phpfox::getParam('waytime.time_remain_complete_waytime')) - time());\r\n return $this->database()->update(Phpfox::getT('waytime_profile'), array('remind_time' => $iNewTime), 'user_id = '.Phpfox::getUserId());\r\n }", "public function isTomorrow()\n {\n \t$tomorrow = new Tiramizoo_Shipping_Model_Date('+1 days');\n \treturn $this->get('Y-m-d') == $tomorrow->get('Y-m-d');\n }", "public function getWasted()\n {\n if (empty($this->deadline)) {\n return false;\n } else {\n return time() > strtotime($this->deadline);\n }\n }", "public function hasTime(){\n return $this->_has(3);\n }", "public function hasTime(){\n return $this->_has(6);\n }", "public function isStarted(){\n\n //Comparing the time to decide wither it's started or not ....\n $start = new Carbon($this->start_time);\n $now = Carbon::now();\n $end = $start->copy()->addMinutes($this->duration);\n\n $started = $now->gt($start) && $now->lt($end);\n\n //checking if it has expired announcement and remove it with resetting status to 0\n if($this->hasAnnouncement()){\n $now = Carbon::now();\n $end = new Carbon($this->start_time);\n $end->addMinutes($this->duration);\n\n //Checking if the announcement has expired and delete it ...\n if($now->gt($end))\n $this->deleteAnnouncement();\n\n }\n\n return $started;\n\n }", "public function haveTime(){\n\t\tif($this->mCallbackHaveTime){\n\t\t\treturn call_user_func_array($this->mCallbackHaveTime, [$this]);\n\t\t}\n\t\treturn microtime(true) - $this->fStartTime < $this->fStepTime;\n\t}", "public function enteredPenaltyReliefMode()\n {\n $enteredPenaltyReliefModeTimestamp = Timestamp :: build( $this ) -> getStopChargingTimestamp();\n return !! $enteredPenaltyReliefModeTimestamp; \n }", "public function isOnPenalty()\n {\n return !! Timestamp :: build( $this ) -> getPenaltyTimestamp();\n }", "public function isExpire(){\n\t\t$duedate = new DateTime($this->duedate);\n\t\t$today = new DateTime(\"now\");\n\t\t\n\t\tif($duedate < $today) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "abstract protected function isRealTime();", "private function checkIfTimeLeft()\r\n {\r\n if($this->expireDateTime < strtotime(\"now\"))\r\n {\r\n generic::successEncDisplay(\"Emails have been sent out, however, there are a number of emails to be sent, and the server run out of time.\");\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function hasLastTime(){\n return $this->_has(18);\n }", "function haltDecrementation()\n {\n return ( //THIS BLOCK TEST WHETHER THE CURRENT DAY IS A SUNDAY\n date('N', intval($this->workTime)) == 7\n && // THIS BLOCK CHECKS THAT THE DATE HAS ASCENDED IN DECREMENTATION\n // MEANING THAT WE HAVE ENTERED A NEW MONTH\n (\n intval(date('m', $this->workTime - 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // IF IT WAS JUST A WEEK VIEW, WE WILL STOP NOW.\n $_GET['weekOrMonth'] == 'week'\n )\n );\n }" ]
[ "0.62976205", "0.62007403", "0.59558934", "0.58818674", "0.5867944", "0.58383155", "0.5715613", "0.5686101", "0.5685122", "0.5672271", "0.561939", "0.5619341", "0.5616805", "0.56141", "0.56004775", "0.55541396", "0.55509377", "0.5541396", "0.55316705", "0.54782194", "0.5475988", "0.54686666", "0.5464734", "0.54627174", "0.5460906", "0.5455997", "0.54420775", "0.54395604", "0.5437685", "0.54309607" ]
0.6641859
0
secure_random_bytes from / The function is providing, at least at the systems tested :), $len bytes of entropy under any PHP installation or operating system. The execution time should be at most 1020 ms in any system.
function secure_random_bytes($len = 10) { /* * Our primary choice for a cryptographic strong randomness function is * openssl_random_pseudo_bytes. */ $SSLstr = '4'; // http://xkcd.com/221/ if (function_exists('openssl_random_pseudo_bytes') && (version_compare(PHP_VERSION, '5.3.4') >= 0 || substr(PHP_OS, 0, 3) !== 'WIN')) { $SSLstr = openssl_random_pseudo_bytes($len, $strong); if ($strong) return $SSLstr; } /* * If mcrypt extension is available then we use it to gather entropy from * the operating system's PRNG. This is better than reading /dev/urandom * directly since it avoids reading larger blocks of data than needed. * Older versions of mcrypt_create_iv may be broken or take too much time * to finish so we only use this function with PHP 5.3 and above. */ if (function_exists('mcrypt_create_iv') && (version_compare(PHP_VERSION, '5.3.0') >= 0 || substr(PHP_OS, 0, 3) !== 'WIN')) { $str = mcrypt_create_iv($len, MCRYPT_DEV_URANDOM); if ($str !== false) return $str; } /* * No build-in crypto randomness function found. We collect any entropy * available in the PHP core PRNGs along with some filesystem info and memory * stats. To make this data cryptographically strong we add data either from * /dev/urandom or if its unavailable, we gather entropy by measuring the * time needed to compute a number of SHA-1 hashes. */ $str = ''; $bits_per_round = 2; // bits of entropy collected in each clock drift round $msec_per_round = 400; // expected running time of each round in microseconds $hash_len = 20; // SHA-1 Hash length $total = $len; // total bytes of entropy to collect $handle = @fopen('/dev/urandom', 'rb'); if ($handle && function_exists('stream_set_read_buffer')) @stream_set_read_buffer($handle, 0); do { $bytes = ($total > $hash_len)? $hash_len : $total; $total -= $bytes; //collect any entropy available from the PHP system and filesystem $entropy = rand() . uniqid(mt_rand(), true) . $SSLstr; $entropy .= implode('', @fstat(@fopen( __FILE__, 'r'))); $entropy .= memory_get_usage(); if ($handle) { $entropy .= @fread($handle, $bytes); } else { // Measure the time that the operations will take on average for ($i = 0; $i < 3; $i ++) { $c1 = microtime(true); $var = sha1(mt_rand()); for ($j = 0; $j < 50; $j++) { $var = sha1($var); } $c2 = microtime(true); $entropy .= $c1 . $c2; } // Based on the above measurement determine the total rounds // in order to bound the total running time. $rounds = (int)($msec_per_round*50 / (int)(($c2-$c1)*1000000)); // Take the additional measurements. On average we can expect // at least $bits_per_round bits of entropy from each measurement. $iter = $bytes*(int)(ceil(8 / $bits_per_round)); for ($i = 0; $i < $iter; $i ++) { $c1 = microtime(); $var = sha1(mt_rand()); for ($j = 0; $j < $rounds; $j++) { $var = sha1($var); } $c2 = microtime(); $entropy .= $c1 . $c2; } } // We assume sha1 is a deterministic extractor for the $entropy variable. $str .= sha1($entropy, true); } while ($len > strlen($str)); if ($handle) @fclose($handle); return substr($str, 0, $len); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tf_secure_rand($length)\r\n {\r\n if (function_exists('openssl_random_pseudo_bytes')) {\r\n $rnd = openssl_random_pseudo_bytes($length, $strong);\r\n if ($strong) {\r\n return $rnd;\r\n }\r\n }\r\n\r\n $sha ='';\r\n $rnd ='';\r\n\r\n if (file_exists('/dev/urandom')) {\r\n $fp = fopen('/dev/urandom', 'rb');\r\n if ($fp) {\r\n if (function_exists('stream_set_read_buffer')) {\r\n stream_set_read_buffer($fp, 0);\r\n }\r\n $sha = fread($fp, $length);\r\n fclose($fp);\r\n }\r\n }\r\n\r\n for ($i = 0; $i < $length; $i++) {\r\n $sha = hash('sha256', $sha.mt_rand());\r\n $char = mt_rand(0, 62);\r\n $rnd .= chr(hexdec($sha[$char].$sha[$char+1]));\r\n }\r\n\r\n return $rnd;\r\n }", "static function randBytes($length = 256) {\n\t\tif(function_exists('random_bytes')) { // PHP 7\n\t\t\treturn random_bytes($length);\n\t\t}\n\t\tif(function_exists('openssl_random_pseudo_bytes')) { // OpenSSL\n\t\t\t$result = openssl_random_pseudo_bytes($length, $strong);\n\t\t\tif(!$strong) {\n\t\t\t\tthrow new Exception('OpenSSL failed to generate secure randomness.');\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tif(file_exists('/dev/urandom') && is_readable('/dev/urandom')) { // Unix\n\t\t\t$fh = fopen('/dev/urandom', 'rb');\n\t\t\tif ($fh !== false) {\n\t\t\t\t$result = fread($fh, $length);\n\t\t\t\tfclose($fh);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\tthrow new Exception('No secure random source available.');\n\t}", "function openssl_random_pseudo_bytes($length, &$strong)\n {\n global $mockRandomPseudoBytes;\n if (isset($mockRandomPseudoBytes) && $mockRandomPseudoBytes === true) {\n $strong = false;\n\n return 12345;\n } else {\n return \\openssl_random_pseudo_bytes($length, $strong);\n }\n }", "function psuedo_random_hex_bytes($length)\n{\n return bin2hex(openssl_random_pseudo_bytes($length / 2));\n}", "private function rand($length) {\n if (function_exists('random_bytes')) {\n return call_user_func('random_bytes', $length);\n } else if (function_exists('openssl_random_pseudo_bytes')) {\n return call_user_func('openssl_random_pseudo_bytes', $length);\n } else if (function_exists('mcrypt_encrypt')) {\n return call_user_func('mcrypt_create_iv', $length, MCRYPT_DEV_URANDOM);\n }\n }", "function randPass($length = 8){\n \treturn substr(md5(rand().rand()), 0, $length);\n }", "function random_pass($len)\r\n{\r\n\t$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n\r\n\t$password = '';\r\n\tfor ($i = 0; $i < $len; ++$i)\r\n\t\t$password .= substr($chars, (mt_rand() % strlen($chars)), 1);\r\n\r\n\treturn $password;\r\n}", "final public static function rand($len = 0)\n {\n $chars = 'qwertyuiopasdfghjklzxcvbnm_-1234567890QWERTYUIOPZXCVBNMLKJHGFDSA';\n return substr(str_shuffle(($chars)), 0, (($len == 0) ? random_int(6, 64) : $len));\n }", "protected function generateRandomKey($len = 20)\r\n {\r\n return base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);\r\n }", "private static function generateBytes($length)\n {\n if (self::hasOpensslRandomPseudoBytes()) {\n return openssl_random_pseudo_bytes($length);\n }\n\n $bytes = '';\n for ($i = 1; $i <= $length; $i++) {\n $bytes = chr(mt_rand(0, 255)) . $bytes;\n }\n\n return $bytes;\n }", "function generate_random_password($len = 8)\n {\n }", "function random_bytes($count) {\n\n\t\t//--------------------------------------------------\n\t\t// Preserved values\n\n\t\t\tstatic $random_state, $bytes;\n\n\t\t//--------------------------------------------------\n\t\t// Init on the first call. The contents of $_SERVER\n\t\t// includes a mix of user-specific and system\n\t\t// information that varies a little with each page.\n\n\t\t\tif (!isset($random_state)) {\n\t\t\t\t$random_state = print_r($_SERVER, true);\n\t\t\t\tif (function_exists('getmypid')) {\n\t\t\t\t\t$random_state .= getmypid(); // Further initialise with the somewhat random PHP process ID.\n\t\t\t\t}\n\t\t\t\t$bytes = '';\n\t\t\t}\n\n\t\t//--------------------------------------------------\n\t\t// Need more bytes of data\n\n\t\t\tif (strlen($bytes) < $count) {\n\n\t\t\t\t//--------------------------------------------------\n\t\t\t\t// /dev/urandom is available on many *nix systems\n\t\t\t\t// and is considered the best commonly available\n\t\t\t\t// pseudo-random source (but output may contain\n\t\t\t\t// less entropy than the blocking /dev/random).\n\n\t\t\t\t\tif ($fh = @fopen('/dev/urandom', 'rb')) {\n\n\t\t\t\t\t\t// PHP only performs buffered reads, so in reality it will always read\n\t\t\t\t\t\t// at least 4096 bytes. Thus, it costs nothing extra to read and store\n\t\t\t\t\t\t// that much so as to speed any additional invocations.\n\n\t\t\t\t\t\t$bytes .= fread($fh, max(4096, $count));\n\t\t\t\t\t\tfclose($fh);\n\n\t\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------------\n\t\t\t\t// If /dev/urandom is not available or returns no\n\t\t\t\t// bytes, this loop will generate a good set of\n\t\t\t\t// pseudo-random bytes on any system.\n\n\t\t\t\t\twhile (strlen($bytes) < $count) {\n\n\t\t\t\t\t\t// Note that it may be important that our $random_state is passed\n\t\t\t\t\t\t// through hash() prior to being rolled into $output, that the two hash()\n\t\t\t\t\t\t// invocations are different, and that the extra input into the first one -\n\t\t\t\t\t\t// the microtime() - is prepended rather than appended. This is to avoid\n\t\t\t\t\t\t// directly leaking $random_state via the $output stream, which could\n\t\t\t\t\t\t// allow for trivial prediction of further \"random\" numbers.\n\n\t\t\t\t\t\t$random_state = hash('sha256', microtime() . mt_rand() . $random_state);\n\t\t\t\t\t\t$bytes .= hash('sha256', mt_rand() . $random_state, true);\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t//--------------------------------------------------\n\t\t// Extract the required output from $bytes\n\n\t\t\t$output = substr($bytes, 0, $count);\n\t\t\t$bytes = substr($bytes, $count);\n\n\t\t//--------------------------------------------------\n\t\t// Return\n\n\t\t\treturn $output;\n\n\t}", "function randombytes_buf($length)\n {\n return '';\n }", "function getRand($len) {\n\t\t$char = 'abcdefghijklmnopqrstuvwxyz';\n\t\t$rand = '';\n\t\tfor ($i = 0; $i < $len; $i++) {\n\t\t\t$rand .= $char[rand(0, strlen($char) - 1)];\n\t\t}\n\t\treturn $rand;\n\t}", "function generate_password($len)\r\n\t{\r\n\t\t$chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz\";\r\n\t\tfor($i=0; $i<$len; $i++) $r_str .= substr($chars,rand(0,strlen($chars)),1);\r\n\t\treturn $r_str;\r\n\t}", "protected static function getRandomBytes($length)\n {\n if (is_readable('/dev/urandom')) {\n $handle = fopen('/dev/urandom', 'rb');\n $read = fread($handle, $length);\n fclose($handle);\n return $read;\n }\n if (function_exists('random_bytes')) {\n return random_bytes($length);\n }\n if (function_exists('mcrypt_create_iv')) {\n return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);\n }\n\t\treturn pack('I', mt_rand(0, mt_getrandmax()));\n\t}", "function RandomString($length)\n{\n $string = md5(microtime());\n $highest_startpoint = 32-$length;\n $randomString = substr($string,rand(0,$highest_startpoint),$length);\n return $randomString;\n\n}", "protected function generateRandomKey($len = 20) {\n return base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);\n }", "public static function make($len = 32) {\r\n\t\t$bytes = openssl_random_pseudo_bytes($len / 2);\r\n\t\treturn bin2hex($bytes);\r\n\t}", "function gener_random($length){\r\n\r\n\tsrand((double)microtime()*1000000 );\r\n\t\r\n\t$random_id = \"\";\r\n\t\r\n\t$char_list = \"abcdefghijklmnopqrstuvwxyz\";\r\n\t\r\n\tfor($i = 0; $i < $length; $i++) {\r\n\t\t$random_id .= substr($char_list,(rand()%(strlen($char_list))), 1);\r\n\t}\r\n\t\r\n\treturn $random_id;\r\n}", "function gen_salt($salt_length=22)\n\t{\n\t\t$raw_salt_len = 16;\n \t\t$buffer = '';\n $buffer_valid = false;\n\n\t\tif (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\n\t\t\t$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t$buffer = openssl_random_pseudo_bytes($raw_salt_len);\n\t\t\tif ($buffer) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid && @is_readable('/dev/urandom')) {\n\t\t\t$f = fopen('/dev/urandom', 'r');\n\t\t\t$read = strlen($buffer);\n\t\t\twhile ($read < $raw_salt_len) {\n\t\t\t\t$buffer .= fread($f, $raw_salt_len - $read);\n\t\t\t\t$read = strlen($buffer);\n\t\t\t}\n\t\t\tfclose($f);\n\t\t\tif ($read >= $raw_salt_len) {\n\t\t\t\t$buffer_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!$buffer_valid || strlen($buffer) < $raw_salt_len) {\n\t\t\t$bl = strlen($buffer);\n\t\t\tfor ($i = 0; $i < $raw_salt_len; $i++) {\n\t\t\t\tif ($i < $bl) {\n\t\t\t\t\t$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\n\t\t\t\t} else {\n\t\t\t\t\t$buffer .= chr(mt_rand(0, 255));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$salt = $buffer;\n\n\t\t// encode string with the Base64 variant used by crypt\n\t\t$base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t\t$bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\t$base64_string = base64_encode($salt);\n\t\t$salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\n\n\t\t$salt = substr($salt, 0, $salt_length);\n\n\t\treturn $salt;\n\t}", "function nullbute_generate_pwd($len) {\n $pwd = '';\n // generate random string\n while (strlen($pwd) < $len) {\n $pwd .= md5(uniqid());\n }\n $pwd = substr($pwd, 0, $len);\n // more entropy by capitalizing some letters\n for ($i = 0; $i < $len; $i++) {\n if (!is_numeric($pwd[$i]) && rand() % 2) $pwd[$i] = strtoupper($pwd[$i]);\n }\n return $pwd;\n}", "function randfuzz($len) \n{\n if (is_readable('/dev/urandom')) {\n $f=fopen('/dev/urandom', 'r');\n $urandom=fread($f, $len);\n fclose($f);\n }\n else\n {\n die(\"either /dev/urandom isnt readable or this isnt a linux \nmachine!\");\n }\n $return='';\n for ($i=0;$i < $len;++$i) {\n if (!!empty($urandom)) {\n if ($i%2==0) mt_srand(time()%2147 * 1000000 + \n(double)microtime() * 1000000);\n $rand=48+mt_rand()%64;\n } else $rand=48+ord($urandom[$i])%64;\n\n if ( 57 < $rand ) $rand+=7; \n if ( 90 < $rand ) $rand+=6; \n\n if ($rand==123) $rand=45;\n if ($rand==124) $rand=46;\n $return.=chr($rand);\n }\n return $return; \n}", "function randomize(int $length = 16)\n {\n return Crypter::random($length);\n }", "function generateValue($lenght) {\r\n return bin2hex(openssl_random_pseudo_bytes($lenght));\r\n}", "static function random(int $length = 16): string {\n $string = '';\n while (($len = \\strlen($string)) < $length) {\n /** @var positive-int $size */\n $size = $length - $len;\n $bytes = random_bytes($size);\n $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);\n }\n\n return $string;\n }", "function mknonce($len = 64)\n{\n\t$SNChars = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';\n\t$SNCCount = strlen($SNChars);\n\t$s = '';\n\twhile (strlen($s) < $len)\n\t{\n\t\t$s .= $SNChars[random_int(0, $SNCCount-1)];\n\t}\n\treturn $s;\n}", "public function random($length = 32, $base64 = true)\n {\n // Try with mcrypt_create_iv function\n if (function_exists('mcrypt_create_iv') && self::isPHPVersionHigher('5.3.7')) {\n $bytes = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);\n if ($bytes !== false && strlen($bytes) === $length) {\n return $base64 ? base64_encode($bytes) : $bytes;\n }\n }\n\n // Try with openssl_random_pseudo_bytes function\n if (function_exists('openssl_random_pseudo_bytes') && self::isPHPVersionHigher('5.3.4')) {\n $bytes = openssl_random_pseudo_bytes($length, $usable);\n if ($usable === true) {\n return $base64 ? base64_encode($bytes) : $bytes;\n }\n }\n\n // Try with CAPICOM Microsoft class\n if (self::isWindows() && class_exists('\\\\COM', false)) {\n try {\n $capicomClass = self::CAPICOM_CLASS;\n $capi = new $capicomClass('CAPICOM.Utilities.1');\n $bytes = $capi->GetRandom($length, 0);\n if ($bytes !== false && strlen($bytes) === $length) {\n return $base64 ? base64_encode($bytes) : $bytes;\n }\n } catch (Exception $ex) {\n }\n }\n\n // Try with /dev/urandom\n if (!self::isWindows() && file_exists('/dev/urandom') && is_readable('/dev/urandom')) {\n $fp = @fopen('/dev/urandom', 'rb');\n if ($fp !== false) {\n $bytes = @fread($fp, $length);\n @fclose($fp);\n if ($bytes !== false && strlen($bytes) === $length) {\n return $base64 ? base64_encode($bytes) : $bytes;\n }\n }\n }\n\n // Otherwise use mt_rand() and getmypid() functions\n if (strlen($bytes) < $length) {\n $bytes = '';\n $state = mt_rand();\n if (function_exists('getmypid')) {\n $state .= getmypid();\n }\n for ($i = 0; $i < $length; $i += 16) {\n $state = md5(mt_rand().$state);\n $bytes .= pack('H*', md5($state));\n }\n\n return substr($bytes, 0, $length);\n }\n\n $this->error = 'Unable to generate sufficiently strong random bytes due to a lack of sources with sufficient entropy...';\n $this->cwsDebug->error($this->error);\n }", "function __generateRandom($length = 8, $salt = 'abcdefghijklmnopqrstuvwxyz0123456789') {\r\n\t\t$salt = str_shuffle ($salt);\r\n\t\t$return = \"\";\r\n\t\t$i = 0;\r\n\t\twhile ($i < $length) {\r\n\t\t\t$num = rand(0, strlen($salt) -1);\r\n\t\t\t$tmp = $salt[$num];\r\n\t\t\t$return .= $tmp;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn str_shuffle($return);\r\n\t}", "function salt($len=16) {\n $pool = range('!', '~');\n $high = count($pool) - 1;\n $tmp = '';\n for ($c = 0; $c < $len; $c++) {\n $tmp .= $pool[rand(0, $high)];\n }\n return $tmp;\n}" ]
[ "0.77263725", "0.71910405", "0.6986814", "0.6916504", "0.6887284", "0.6835139", "0.68115693", "0.6751972", "0.6737933", "0.6737527", "0.6734642", "0.67274714", "0.67096144", "0.67087436", "0.66707814", "0.664992", "0.660424", "0.65923333", "0.6587896", "0.6571497", "0.6562536", "0.6561868", "0.6559515", "0.652343", "0.65153855", "0.65139663", "0.650598", "0.6496069", "0.6491245", "0.647469" ]
0.841408
0
accessor method for user city
public function getUserCity(){ return($this->userCity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCity() {}", "public function getCity();", "function getCity() {\r\r\n\t\treturn $this->city;\r\r\n\t}", "public function getCity() \n {\n return $this->city;\n }", "public function getUserCity() {\n\t\treturn ($this->userCity);\n\t}", "public function getCity(){\r\n\t\treturn $this->city;\r\n\t}", "public function getCity()\n {\n return parent::getValue('city');\n }", "public function getCity()\r\n {\r\n return $this->city;\r\n }", "public function getCity()\r\n {\r\n return $this->city;\r\n }", "public function getCity()\r\n {\r\n return $this->city;\r\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\r\n {\r\n return $this->_city;\r\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }", "public function getCity()\n {\n return $this->city;\n }" ]
[ "0.8596332", "0.84837425", "0.84189755", "0.8347452", "0.8284131", "0.82552654", "0.8232774", "0.81867206", "0.81867206", "0.81867206", "0.8144807", "0.81186444", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398", "0.8089398" ]
0.8735699
0
accessor method for user state
public function getUserState(){ return($this->userState); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserState() {\n\t\treturn ($this->userState);\n\t}", "public function getEnableUserState();", "public function state(){\n return $this->state;\n }", "public function getState() {}", "public function getState() {}", "public function getState() {}", "public function state();", "public function getState()\n {\n }", "public function actionUserState ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\t\t\t\t$user->active = $post[ 'state' ];\n\t\t\t\t$user->save();\n\t\t\t}\n\t\t\techo $post[ 'state' ];\n\n\t\t\tYii::$app->end();\n\t\t}", "public function getState(){\n\t\treturn $this->state;\n\t}", "public function getDefaultUserState();", "public function getState() { return $this->data->get(\"state\"); }", "protected function getCurrentUserData() {}", "protected function getCurrentUserData() {}", "protected function _getState()\n {\n return $this->state;\n }", "public function getState(){\n return $this->_getData(self::STATE);\n }", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();" ]
[ "0.76730424", "0.7081535", "0.69570285", "0.69018674", "0.6900374", "0.68998414", "0.6738225", "0.6705128", "0.67023635", "0.6680954", "0.6623362", "0.6581329", "0.656958", "0.6569548", "0.6557736", "0.6519172", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234", "0.6513234" ]
0.8023415
0
accessor method for user zip code
public function getUserZip(){ return($this->userZip); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getZipCode()\n {\n return parent::getValue('zip_code');\n }", "public function getZipCode(){\r\n\t\treturn $this->zipCode;\r\n\t}", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipCode()\n {\n return $this->zipCode;\n }", "public function getZipCode()\n {\n return $this->zipCode;\n }", "public function getZipCode(): string\n {\n return $this->_zipCode;\n }", "public function getUserZip() {\n\t\treturn ($this->userZip);\n\t}", "public function getZipCode()\n {\n return $this->getParameter('zip');\n }", "public function zipCode(): string\n {\n return $this->getData('ZipCode');\n }", "public function getFactZipCode() {\n return $this->fact_zip_code;\n }", "public function getRegZipCode() {\n return $this->reg_zip_code;\n }", "public function getPostalCode();", "public function getPostalCode();", "public function getApplicantZipPostalCode()\n {\n return $this->getProperty('applicant_zip_postal_code');\n }", "public function getPostalcode();", "public function getReqZipcode()\n\t{\n\t\treturn $this->req_zipcode;\n\t}", "function getZip() {\r\r\n\t\treturn $this->zip;\r\r\n\t}", "public function getZip()\r\n {\r\n return $this->zip;\r\n }", "abstract public function postalCode();", "public function getZipcode(): ?string\n {\n return $this->Zipcode ?? null;\n }", "public function getZip() {}", "public function getcodePostal() \n {\n return $this->codePostal;\n }", "public function getZip()\n {\n return $this->zip;\n }", "public function getZip()\n {\n return $this->zip;\n }", "public function getZip()\n {\n return $this->zip;\n }", "public function getShipzip()\n {\n return $this->shipzip;\n }", "public function getPostalCode()\n {\n return $this->postal_code;\n }", "public function getZip() {\n return $this->zip;\n }" ]
[ "0.8226972", "0.7949336", "0.7905355", "0.7905355", "0.7905355", "0.78147596", "0.78147596", "0.7728549", "0.7577471", "0.7571427", "0.7568071", "0.75587696", "0.73121023", "0.72362256", "0.72362256", "0.7234989", "0.72164655", "0.7211782", "0.70051414", "0.6905916", "0.6872389", "0.68545544", "0.6832214", "0.6823829", "0.6817705", "0.6817705", "0.6817705", "0.68069535", "0.6781113", "0.6778758" ]
0.795889
1
mutator method for user zip code
public function setUserZip($newUserZip){ //clear out white space $newUserZip = trim($newUserZip); //allows null if($newUserZip === null){ $this->userZip = null; return; } //validates value is Integer if(filter_var($newUserZip, FILTER_VALIDATE_INT) === false){ throw(new UnexpectedValueException("The Zip Code you entered is Invalid")); } //sets value $this->userZip = $newUserZip; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_zip( $zip ) {\n\t\treturn $this->set_field( 'OWNERZIP', $zip );\n\t}", "function setZip( $value )\n {\n $this->Zip = $value;\n }", "public function getUserZip(){\n return($this->userZip);\n }", "public function getZipCode()\n {\n return parent::getValue('zip_code');\n }", "public function setZipCode($zip_code): void\n {\n $trimmedZip = preg_replace('/\\s/', '', $zip_code);\n if( strlen($trimmedZip) > 6 )\n {\n throw new InvalidArgumentException(\"Attempted to set zip code to a string longer than the limit of 6 characters [$trimmedZip]\");\n }\n $this->_zipCode = $trimmedZip;\n }", "public function getZipCode(){\r\n\t\treturn $this->zipCode;\r\n\t}", "function setZip($zip) {\r\r\n\t\t$this->zip = $zip;\r\r\n\t}", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipcode()\n {\n return $this->zipcode;\n }", "public function getZipCode()\n {\n return $this->zipCode;\n }", "public function getZipCode()\n {\n return $this->zipCode;\n }", "public function setRecipientZip($value)\n {\n return $this->set('RecipientZip', $value);\n }", "public function setRecipientZip($value)\n {\n return $this->set('RecipientZip', $value);\n }", "public function getUserZip() {\n\t\treturn ($this->userZip);\n\t}", "public function setZipCode($value)\n {\n return $this->set('ZipCode', $value);\n }", "public function getZipCode()\n {\n return $this->getParameter('zip');\n }", "public function getZipCode(): string\n {\n return $this->_zipCode;\n }", "public function setZip($zip)\r\n {\r\n $this->_zip = $zip;\r\n }", "public function setZipCode($value)\n {\n parent::setValue('zip_code', $value);\n\n return $this;\n }", "public function setZip($zip)\n {\n $this->zip = $zip;\n }", "public function setZip($zip) {\n\t\t$this->zip = $zip;\n\t}", "public function getFactZipCode() {\n return $this->fact_zip_code;\n }", "public function zipCode(): string\n {\n return $this->getData('ZipCode');\n }", "abstract public function postalCode();", "public function setZip($zip) {\n $this->zip = $zip;\n return $this;\n }", "public function setCustomerZip($customerZip = '') {\n $zip = array(\n 'x_zip'=>$this->truncateChars($customerZip, 20),\n );\n $this->NVP = array_merge($this->NVP, $zip); \n }", "public function getZip() {}", "public function setZip($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->zip !== $v) {\n $this->zip = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ZIP] = true;\n }\n\n return $this;\n }", "public function setZipcode(string $zipcode)\n {\n $this->Zipcode = str_replace(\" \", \"\", $zipcode);\n return $this;\n }" ]
[ "0.70573556", "0.6840066", "0.68258786", "0.68133986", "0.65185314", "0.65127647", "0.64797896", "0.640869", "0.640869", "0.640869", "0.63626444", "0.63626444", "0.6360515", "0.6360515", "0.63586694", "0.6336586", "0.62823594", "0.6226586", "0.62069285", "0.61757106", "0.6155162", "0.6150362", "0.6122297", "0.6117506", "0.61026835", "0.60664403", "0.6059829", "0.60589135", "0.6054155", "0.60385424" ]
0.71179193
0
accessor method for user website link
public function getUserWebsite(){ return($this->userWebsite); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLink();", "public function getLink();", "public function getOfficialLink();", "public function getLink() {}", "public function getLink(): string;", "public function getLink(): string;", "function getLink(): string;", "public function link() {\n return isset($this->_adaptee->user_info['user_username']) ? \"profile.php?user=\".$this->_adaptee->user_info['user_username'] : null;\n }", "function getLink() {\n return new Hyperlink($this->getName(),\"/user/$this->id\",'userlink');\n }", "public function getLink():string;", "public function getWebsite();", "public function href();", "public function getURL ();", "public function siteUrl() {}", "function getURL() \n {\n return $this->getValueByFieldName( 'navbarlink_url' );\n }", "public abstract function getURL();", "function url ($link) {\r\n\treturn $link;\r\n}", "public function Link()\n {\n return $this->Url;\n }", "public function getURL();", "public function getURL();", "function Link()\n\t{\tif ($this->details[\"hblink\"])\n\t\t{\tif (strstr($this->details[\"hblink\"], \"http://\") || strstr($this->details[\"hblink\"], \"https://\"))\n\t\t\t{\treturn $this->details[\"hblink\"];\n\t\t\t} else\n\t\t\t{\treturn SITE_URL . $this->details[\"hblink\"];\n\t\t\t}\n\t\t}\n\t}", "function ShowLink()\n {\n $CompaniesPage = CompanyListPage::get()->first();\n if ($this->Description) {\n return $CompaniesPage->Link() . \"profile/\" . $this->URLSegment;\n } else {\n return $this->URL;\n }\n }", "public function getLink(){\n return $this->link;\n }", "public function get_url();", "public function get_link() {\r\n return $this->link;\r\n }", "public static function getThisUrl() {}", "function getLink() {return $this->_link;}", "function getLink() {return $this->_link;}", "public function getWebsiteURL() {\n return $this->getChaveValor('WEBSITE_URL');\n }", "public function getUserPageUrl()\n {\n return $this->getUserAttribute(static::ATTRIBUTE_PAGE_URL);\n }" ]
[ "0.7495109", "0.7495109", "0.74159247", "0.7360608", "0.7346507", "0.7346507", "0.7342497", "0.7325689", "0.73169696", "0.73045343", "0.725687", "0.71604466", "0.71265966", "0.7114497", "0.7112476", "0.7098522", "0.70774454", "0.70651215", "0.70521", "0.70521", "0.7050066", "0.69563395", "0.6953549", "0.6942382", "0.6937797", "0.692675", "0.6870166", "0.6870166", "0.6855662", "0.6846584" ]
0.7524807
0
accessor method for user avatar
public function getUserAvatar(){ return($this->userAvatar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvatar()\n {\n return $this->user['avatar'];\n }", "public function getAvatar(): string;", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getImg_avatar()\r\n {\r\n return $this->img_avatar;\r\n }", "protected function getAvatar()\n\t{\n\t\treturn $this->avatar();\n\t}", "public function getAvatar()\n {\n return $this->avatar;\n }", "public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getAvatar()\n {\n return $this->Avatar;\n }", "public function getAvatar() {\n\t\treturn $this->avatar;\n\t}", "public function avatarUser()\n {\n return asset(\"storage/images/$this->avatar\");\n }", "public function getAvatar() {\n\t\tif ( !empty($this->_rowData[config::get('userAvatar', 'avatar')]) ) {\n\t\t\t$this->_avatar = $this->_rowData[config::get('userAvatar', 'avatar')]->path;\n\t\t}\n\t\treturn $this->_avatar;\n\t}", "public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('from_user_id'));\n\t}", "public function getAvatar()\n {\n return $this->profile->getAvatar();\n }", "public function getAvatar()\n {\n return $this->attributes['avatar'] ?? null;\n }", "public function getAvatar()\n {\n return $this->getProfilePicture();\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar()\n {\n return $this->get(self::_AVATAR);\n }", "public function getAvatar(): Avatar {\n return $this->avatar;\n }", "public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}", "public function getAvatarFile()\n {\n return $this->avatarFile;\n }", "public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }" ]
[ "0.85839665", "0.8453341", "0.83607984", "0.83607984", "0.83607984", "0.83607984", "0.83607984", "0.83607984", "0.83596975", "0.83207226", "0.82787347", "0.8274242", "0.8260178", "0.8260178", "0.81948733", "0.8182618", "0.8173914", "0.8130568", "0.8120114", "0.8118852", "0.8098083", "0.8079839", "0.8079278", "0.8079278", "0.8079278", "0.8079278", "0.8034582", "0.8005066", "0.78642553", "0.7844342" ]
0.8747592
0
gets values of userActivityList
public function getUserActivityList(){ return($this->userActivityList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getList()\n {\n $result = array();\n $list = Pi::registry('activity', 'user')->read();\n foreach ($list as $name => $activity) {\n $result[$name] = array(\n 'title' => $activity['title'],\n 'icon' => $activity['icon'],\n );\n }\n\n return $result;\n }", "function activityList($userId,$data){\n\n $activity = array(); \n $activity['hasAffiliates'] = 0;\n $aff = $this->common_model->is_data_exists(USER_AFFILIATES,array('user_id'=>$userId));\n if($aff){\n $activity['hasAffiliates'] = 1;\n }\n switch($data['listType']){ //For get activity list\n case 'today' : \n $activity['today'] = $this->todayActivityList($userId,$data);\n break;\n\n case 'tomorrow' : \n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n break;\n\n case 'soon' :\n $activity['soon'] = $this->soonActivityList($userId,$data);\n break;\n\n case 'others' :\n $activity['others'] = $this->othersActivityList($userId,$data);\n break;\n\n default:\n $activity['today'] = $this->todayActivityList($userId,$data);\n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n $activity['soon'] = $this->soonActivityList($userId,$data); \n $activity['others'] = $this->othersActivityList($userId,$data); \n }//End of activity list\n\n //Now we will set events for each activities\n if(!empty($activity['today']) && isset($activity['today'])){\n foreach ($activity['today'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['today'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['tomorrow']) && isset($activity['tomorrow'])){\n foreach ($activity['tomorrow'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['tomorrow'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['soon']) && isset($activity['soon'])){ \n foreach ($activity['soon'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['soon'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }//End of setting events\n return $activity;\n\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "public function getUserActivitiesAction()\n {\n $getOperations = false;\n $activity = new Workapp_Activity();\n $data = $this->getRequestData();\n if (isset($data['getoperations'])) {\n $getOperations = $data['getoperations'];\n }\n $this->_helper->json($activity->getActivityList(array('user_id' => $this->getDeviceSession()->getUserId(), 'getoperations' => $getOperations)));\n }", "function getActivityList() {\n try {\n $items = $this->perform_query_no_param(\"SELECT * from activityModel\");\n return $this->result_to_array($items);\n } catch (Exception $ex) {\n $this->print_error_message(\"Unable to Getting Activity List\");\n return null;\n }\n }", "public function listActiUser($activity_id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities_user WHERE actividad=?\");\r\n\t\t$stmt->execute(array($activity_id));\r\n\t\t$relations_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$relations = array();\r\n\r\n\t\tforeach ($relations_db as $relation) {\r\n\t\t\tarray_push($relations, new ActivityWUser($relation[\"usuario\"], $relation[\"actividad\"], $relation[\"conf\"]));\r\n\t\t}\r\n\r\n\t\treturn $relations;\r\n\t}", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "function myActivityList($userId,$data){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n if(empty($data['limit']) && empty($data['offset'])){\n $data['offset'] = 0; $data['limit']= 5; \n }\n $where = array('c.status'=>'1','cc.status'=>'1','a.status'=>'1','a.creator_id'=>$userId);\n \n $this->db->select('IF(a.image IS NULL or a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,a.name as activityName,a.is_hide,a.activityId,c.club_name');\n $this->db->from(ACTIVITIES.' as a'); \n $this->db->join(CLUBS.' as c','a.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId'); \n $this->db->join(ACTIVITY_EVENTS.' as ae','a.activityId = ae.activity_id AND ae.status = \"1\"','left');\n \n $this->db->where($where);\n $this->db->group_by('a.activityId');\n $this->db->order_by(\"a.activityId desc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n foreach ($activityData as $key => $value) {\n $activityId = $value->activityId;\n $activityData[$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n return $activityData;\n }", "function getUserActivity( $stream )\n\t{\n\t\tif( $stream == \"me\" ){\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=own' );\n\t\t}\n\t\telse{\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=friends' );\n\t\t}\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User activity stream request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$activities = ARRAY();\n\n\t\tforeach( $response as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'id_event'))?$item->id_event:\"\";\n\t\t\t$ua->date = (property_exists($item,'timestamp'))?$item->timestamp:\"\";\n\t\t\t$ua->text = (property_exists($item,'content'))?$item->content:\"\";\n\t\t\t$ua->text = ($ua->text)?trim(strip_tags($ua->text)):\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item->from,'id_user'))?$item->from->id_user:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item->from,'username'))?$item->from->username:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item->from,'user_url'))?$item->from->user_url:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item->from,'avatar_url'))?$item->from->avatar_url:\"\";\n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\treturn $activities;\n\t}", "function getUserActivity( $stream ) \n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count']\t= 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/updates', $parameters);\n\n\t\tif( ! $response->updates || $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\t$activities = array();\n\n\t\tforeach( $response->updates as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'collectionID'))?$item->collectionID:\"\";\n\t\t\t$ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:\"\";\n\t\t\t$ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:\"\"; \n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\tif( $stream == \"me\" ){\n\t\t\t$userId = $this->getCurrentUserId();\n\t\t\t$my_activities = array();\n\n\t\t\tforeach( $activities as $a ){\n\t\t\t\tif( $a->user->identifier == $userId ){\n\t\t\t\t\t$my_activities[] = $a;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $my_activities;\n\t\t}\n\n\t\treturn $activities;\n\t}", "public function getUserListAttribute()\n {\n return $this->users->pluck('id')->all();\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function getAll () {\n return $this->curl->get('activityTypes')['data'];\n }", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "function getActivities() \n {\n return $this->instance->getActivities();\n }", "public function actionShowusersactivities()\n\t{\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->limit=6;\t\n\t\t$uid = Yii::app()->user->id; //logged in userId\n\t\t$activityArray = array(); //contains, all activities, Like,Dislikes,Become friends etc\n\t\t$str='';\n\t\t$limit = 10;\n\t\t$flag = (isset($_GET['flag']))?$_GET['flag']:'';\n\t\tif(!empty($uid))\n\t\t{\n\t\t\t// ** User Logged IN ***\n\t\t\t//Show Photo Likes activities of Me & friends of Me\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit,$uid);\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$uname = ($uid==$v['userid'])?'You':$v['username'];\n\t\t\t\t\t$owner_name = $v['ownername'];\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$owner_name.'&#39;s photo:';\n\t\t\t\t\t$src=Yii::app()->baseUrl.'/files/'.$v['owner_id'].'/thumbnail/'.$v['photos_name'];\t\t\t\t\n\t\t\t\t\t$file_path = Yii::getPathOfAlias('webroot').'/files/'.$v['owner_id'].'/'.$v['photos_name'];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($file_path)){\n\t\t\t\t\t\t$src=Yii::app()->theme->baseUrl.'/img/noimage.jpg';\n\t\t\t\t\t}\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.$src.'\" />';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t\n\t\t\t\t\t//Duplicate Testing\tDUMMY Data .......\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />';\n\t\t\t\t\t$activityArray['1410354280'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t$activityArray['1410354380'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\t\t\t\t\t\n\t\t\t\t\t//Duplicate Ends\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of Friends..ie who had recently become your friend\t\t\n\t\t\t$criteria->condition = \"t.user_id='\".$uid.\"' AND t.status=1\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['friend']['user_details_avatar'],'name'=>'you','message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Users..ie who had recently Send You Friends Request\t\t\n\t\t\t$criteria->condition = \"t.friend_id='\".$uid.\"' AND t.status=0\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' Had Sent You a Friend Request';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$v['user']['user_details_firstname'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Friend's friends..ie your friend who had add another friend\t\t\t\n\t\t\t$friends=UsersFriends::model()->getActivityFriends($limit,$uid);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t//where $[name] is your(loggedIn User) frnd , who also become frnd with $v['ffname']\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' and '.$v['ffname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Get List of users who started to follow you..\n\t\t\t$followers=UsersFollow::model()->getActivityFollow($limit,$uid);\n\t\t\tif(count($followers)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($followers as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' is now your follower';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tunset($followers);\n\t\t\t\n\t\t\t//Now get List of Extra Notification of Posly, only for Top-Header DUMMY Data .......\n\t\t\tif($flag==\"header\"){\n\t\t\t\t$msg = 'There is an event to be organised at bangalore, at 1-oct-14, for Fashion ..an fasion event';\n\t\t\t\t$activityArray['1410835502'] = array('avatar'=>'avatar1_small.jpg','name'=>'Posly','message'=>$msg,'image'=>''); \n\t\t\t\t//*Duplicate Testing Data\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ** User NOT Logged IN ***\n\t\t\t//Show general user Photo Likes activities , as no body has loggedIn\t\t\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit); \t\t\t\t\t\t\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v){\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$v['ownername'].'&#39;s photo:';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$v['username'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of any user who had recently become friends\n\t\t\t$criteria->condition = \"status=1\";\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$user = $v['user']['user_details_firstname'].' '.$v['user']['user_details_lastname'];\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$user,'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t}\n\t\t\n\t\t//Now Create the display Activity HTML\t\t\n\t\tif(count($activityArray)>0)\n\t\t{\n\t\t\tkrsort($activityArray); \n\t\t\t//Sort activity Array By Keys -- SORT\t\n\t\t\t$unread_notifycount=0;\n\t\t\t$user_notifyReaddate = (!empty($uid))?Yii::app()->user->getState(\"notify_readdate\"):'0';\t\t\t\n\t\t\tforeach($activityArray as $keys=>$values)\n\t\t\t{\t\t\t\n\t\t\t\t$fromurl=strstr($values['avatar'], '://', true);\n\t\t\t\tif($fromurl=='http' || $fromurl=='https')\n\t\t\t\t\t$avatar = $values['avatar']; \n\t\t\t\telse\n\t\t\t\t$avatar = Yii::app()->baseUrl.'/profiles/'.$values['avatar'];\n\t\t\t\tif($flag==\"header\")\n\t\t\t\t{\n\t\t\t\t\t//This is for Top-Header Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li> \n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<div class=\"main\">\n\t\t\t\t\t<span class=\"photo\">\n\t\t\t\t\t<img class=\"avatar-user-l img-responsive\" src=\"'.$avatar.'\" alt=\"\"/>\n\t\t\t\t\t</span>\t\t\t\t\t\n\t\t\t\t\t<div class=\"message\"> \n\t\t\t\t\t\t<span class=\"name\">'.$values['name'].'</span> '.$values['message'].' \n\t\t\t\t\t\t<div class=\"newtime\">'.$this->get_msgtime($keys).'</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</a> \n\t\t\t\t\t</li>\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t} else{\n\t\t\t\t\t//This for Side-Bar UserActivity/Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.$avatar.'\" />\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<span class=\"notimsg\"><span class=\"name\">'.$values['name'].'</span> '.$values['message'].'</span>'.$values['image'].'\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\t\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t//Now check For notify Cnt for LoggedIn user\t\t\t\t\n\t\t\t\tif(!empty($uid))\n\t\t\t\t{ //Condition if notify Date in DB is Less then Keys(notifyTimedate), then its an Unread\t\t\n\t\t\t\t\tif($user_notifyReaddate < $keys){\n\t\t\t\t\t\t$unread_notifycount++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!empty($uid)){\n\t\t\t\t$unread_notifycount = ($unread_notifycount==0)?'':$unread_notifycount;\n\t\t\t\tYii::app()->user->setState('notify_count', $unread_notifycount);\n\t\t\t}\n\t\t}\n\t\tunset($activityArray);\n\t\tif(empty($str)){\n\t\t\t//a Default Dummy status.\n\t\t\t$str='<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />\n\t\t\t<div class=\"message\"> <span class=\"name\">Chanh Ny</span> likes Chi Minh Anh photo. </div>\n\t\t\t</li>';\n\t\t}\t\t\n\t\techo $str;\t\t\n\t\tYii::app()->end();\t\n\t}", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "public function getUsers()\n {\n return $this->users->getValues();\n }", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "public function get_active_users() {\n /** check for invalid users, users that have not been active since 1 hour ago **/\n $datetime = strtotime('-5 minutes',strtotime(date('Y-m-d H:i:s')));\n $params_d = array(\n 'stream' => 'active_users',\n 'namespace' => $this->namespace,\n 'where' => \"last_activity_u_a < '\" .$datetime.\"'\"\n );\n $entries_d = $this->streams->entries->get_entries($params_d);\n foreach($entries_d['entries'] as $e_d){\n $this->streams->entries->delete_entry($e_d['id'], 'active_users', $this->namespace);\n }\n $params = array(\n 'stream' => 'active_users',\n 'namespace' => $this->namespace\n );\n $entries = $this->streams->entries->get_entries($params);\n $users = array();\n foreach ($entries['entries'] as $e) {\n $users[] = array(\n 'user_id' => $e['created_by']['user_id'],\n 'user' => $e['created_by']['display_name'],\n 'gest_name' => (!empty($e['user_nick_c'])) ? $e['user_nick_c'] : false,\n 'isUser' => (!empty($e['created_by']['user_id'])) ? true : false,\n 'last_activity' => date('Y-m-d H:i:s', $e['last_activity_u_a']),\n 'user_ip' => $e['user_b_ip']\n );\n }\n echo json_encode($users);\n }", "public function getUsers(){\n\t\t\n\t\t$ar = array();\n\t\t\n\t\t$result = $this->adapter->query(\"select * from vemplist order by ctct_name\")->execute();\n\t\t\n\t\tforeach ($result as $row) \n\t\t\t{\n\t\t\t\t$ar[$row['emp_id']]=$row['ctct_name'];\n\t\t\t}\n\t\t\n\t\treturn $ar;\n\t}", "public function activities()\n {\n return $this->hasMany(Activity::class, 'activity_of_user_id', 'id');\n }", "public function getUsersList()\n {\n }", "public function listValue($iduser)\r\n\t{\r\n\t\t$sql = \"SELECT useratribute . * , `key`.name\r\n\t\t\t\tFROM `useratribute`\r\n\t\t\t\tJOIN `key` ON useratribute.`keyu` = `key`.idkey\r\n\t\t\t\tWHERE useratribute.idusers = $iduser\r\n\t\t\t\t\";\r\n\t\treturn $this->getDI()->get('db')->fetchAll($sql, Phalcon\\Db::FETCH_OBJ);\r\n\t}", "function readActivity()\n{\n $json = file_get_contents(USER_STATS);\n return json_decode($json, true);\n}", "private function getData()\n {\n return Activity::fromSource(BackendAuth::getUser())\n ->orderBy('created_at', 'desc')\n ->limit($this->property(\"recordsCount\", self::DEFAULT_RECORDS_COUNT))\n ->get();\n }", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}" ]
[ "0.7410807", "0.6813622", "0.6753115", "0.65422654", "0.63250273", "0.63079065", "0.62400573", "0.6175359", "0.6076435", "0.5984821", "0.597571", "0.5968565", "0.5952024", "0.59403527", "0.5912986", "0.5908393", "0.5896454", "0.5862293", "0.57719445", "0.5769078", "0.57370466", "0.5721098", "0.5712672", "0.5691957", "0.56770116", "0.56760067", "0.56755584", "0.56751084", "0.5669866", "0.5646118" ]
0.8255953
0
/ sets value of userActivityList
public function setUserActivityList($newUserActivityList){ //filter $newUserActivityList = trim($newUserActivityList); $newUserActivityList = filter_var($newUserActivityList, FILTER_SANITIZE_STRING); //set values $this->userActivityList = $newUserActivityList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserActivityList(){\n return($this->userActivityList);\n }", "public function setActivity($value)\n {\n return $this->set('Activity', $value);\n }", "function activityList($userId,$data){\n\n $activity = array(); \n $activity['hasAffiliates'] = 0;\n $aff = $this->common_model->is_data_exists(USER_AFFILIATES,array('user_id'=>$userId));\n if($aff){\n $activity['hasAffiliates'] = 1;\n }\n switch($data['listType']){ //For get activity list\n case 'today' : \n $activity['today'] = $this->todayActivityList($userId,$data);\n break;\n\n case 'tomorrow' : \n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n break;\n\n case 'soon' :\n $activity['soon'] = $this->soonActivityList($userId,$data);\n break;\n\n case 'others' :\n $activity['others'] = $this->othersActivityList($userId,$data);\n break;\n\n default:\n $activity['today'] = $this->todayActivityList($userId,$data);\n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n $activity['soon'] = $this->soonActivityList($userId,$data); \n $activity['others'] = $this->othersActivityList($userId,$data); \n }//End of activity list\n\n //Now we will set events for each activities\n if(!empty($activity['today']) && isset($activity['today'])){\n foreach ($activity['today'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['today'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['tomorrow']) && isset($activity['tomorrow'])){\n foreach ($activity['tomorrow'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['tomorrow'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['soon']) && isset($activity['soon'])){ \n foreach ($activity['soon'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['soon'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }//End of setting events\n return $activity;\n\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "function setUserNameList($newVal)\r\n\t{\r\n\t\t$this->UserNameList = $newVal;\r\n\t}", "function setUserIDRoleList($newVal)\r\n\t{\r\n\t\t$this->UserIDRoleList = $newVal;\r\n\t}", "function socialActivitySet($opt){\nif($opt['debug']) $this->pre(\"OPTION\", $opt);\n\n\t$id_user\t= $opt['id_user'];\t\t\t\tif(intval($id_user) <= 0)\t\treturn false;\n\t$key\t\t= $opt['socialActivityKey'];\tif($key == NULL)\t\t\t\treturn false;\n\t$flag\t\t= $opt['socialActivityFlag'];\tif($flag == NULL)\t\t\t\treturn false;\n\t$id\t\t\t= $opt['socialActivityId'];\n\t$thread\t\t= $opt['socialActivityThread'];\n\n\n\t# REMOVE\n\t#\n\tif($opt['remove']){\n\t\t$act = $this->dbOne(\"SELECT * FROM k_socialactivity WHERE socialActivityKey='\".$key.\"' AND socialActivityId=\".$id);\n\n\t\tif(intval($act['id_socialactivity']) > 0){\n\t\t\t$this->dbQuery(\"DELETE FROM k_socialactivity\t\tWHERE id_socialactivity=\".$act['id_socialactivity']);\n\t\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\n\t\t\t$this->dbQuery(\"DELETE FROM k_socialnotification\tWHERE id_socialactivity=\".$act['id_socialactivity']);\n\t\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\t\t}\n\t}\n\n\t# ADD\n\t#\n\telse{\n\n\t\t$query = $this->dbInsert(array('k_socialactivity' => array(\n\t\t\t'id_user'\t\t\t\t=> array('value'\t=> $id_user),\n\n\t\t\t'socialActivityKey'\t\t=> array('value'\t=> $key),\n\t\t\t'socialActivityId'\t\t=> array('value'\t=> $id, \t\t'null' => true),\n\t\t\t'socialActivityThread'\t=> array('value'\t=> $thread,\t\t'null' => true),\n\t\t\t'socialActivityFlag'\t=> array('value'\t=> strtoupper($flag)),\n\n\t\t\t'socialActivityDate'\t=> array('value'\t=> date(\"Y-m-d H:i:s\")),\n\t\t)));\n\n\t\t$this->dbQuery($query);\n\t\t$id_act = $this->db_insert_id;\n\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\n\t\t# Create NOTIFICATION\n\t\t#\n\t\tif($id_act > 0 && $opt['notification']){\n\n\t\t\tif($opt['socialActivityKey'] == 'id_socialpost'){\n\t\t\t\t$noti\t= 'socialPostSubscribed';\n\t\t\t\t$table\t= 'k_socialpost';\n\t\t\t\t$thrd\t= 'id_socialpostthread';\n\t\t\t}else\n\t\t\tif($opt['socialActivityKey'] == 'id_socialmessage'){\n\t\t\t\t$noti\t= 'socialMessageSubscribed';\n\t\t\t\t$table\t= 'k_socialmessage';\n\t\t\t\t$thrd\t= 'id_socialmessagethread';\n\t\t\t}\n\t\t\t\n\t\t\t// ?\n\t\t\t$item = $this->dbOne(\"SELECT \".$noti.\" FROM \".$table.\" WHERE \".$thrd.\"=\".$thread.\" AND \".$noti.\" != ''\");\n\t\t\t//$item = $this->dbOne(\"SELECT \".$noti.\" FROM \".$table.\" WHERE \".$thrd.\"=\".$thread);\n\t\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\t\t\t\n\t\t\t$usrs = json_decode($item[$noti], true);\n\t\t\t$usrs = is_array($usrs) ? $usrs : array();\n\t\t\t\n\t\t\t// Lever une notification pour tous les SUBSCRIBED USER sauf MOI\n\t\t\tforeach($usrs as $u){\n\t\t\t\tif($id_user != $u) $tmp[] = \"(\".$id_act.\",\".$u.\")\";\n\t\t\t}\n\t\t\t\n\t\t\tif(sizeof($tmp) > 0){\n\t\t\t\t$this->dbQuery(\"INSERT INTO k_socialnotification (id_socialactivity, id_user) VALUES\\n\".implode(\",\\n\", $tmp));\n\t\t\t\tif($opt['debug']) $this->pre($this->db_query, $this->db_error);\n\t\t\t}\n\t\t}\n\t}\n\n}", "public function setActivityGroupNames(?array $value): void {\n $this->getBackingStore()->set('activityGroupNames', $value);\n }", "public function set_users_id($value) {\r\n $this->users_id = $value;\r\n data::add(\"users_id\", $this->users_id == \"\" ? session::get(CURRENT_USER_SESSION_NAME) : $this->users_id, $this->table_fields);\r\n }", "function setLinks($links) \r\n {\r\n\r\n $this->activity_list->setLinks($links); \r\n \t\t \r\n// \t\t echo print_r($this->linkValues,true);\t \r\n \t parent::setLinks($links);\r\n \r\n }", "public function setMemberships(?int $value): void {\n $this->getBackingStore()->set('memberships', $value);\n }", "public function setMembers(?array $value): void {\n $this->getBackingStore()->set('members', $value);\n }", "public function setAssignees(?array $value): void {\n $this->getBackingStore()->set('assignees', $value);\n }", "protected function lstUsersAsAssessmentManager_Update() {\n\t\t\tif ($this->lstUsersAsAssessmentManager) {\n\t\t\t\t$this->objGroupAssessmentList->UnassociateAllUsersAsAssessmentManager();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsAssessmentManager->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objGroupAssessmentList->AssociateUserAsAssessmentManager(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setSuccessfulUsers(?int $value): void {\n $this->getBackingStore()->set('successfulUsers', $value);\n }", "function setAutoAssignPermissions($value) {\n \treturn parent::setAutoAssignPermissions(serialize($value));\n }", "protected function lstUsersAsCharity_Update() {\n\t\t\tif ($this->lstUsersAsCharity) {\n\t\t\t\t$this->objCharityPartner->UnassociateAllUsersAsCharity();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsCharity->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objCharityPartner->AssociateUserAsCharity(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function updateUserActivityAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Activity!');\n } else {\n if (isset($data['title'])) {\n $activity->setTitle($data['title']);\n }\n if (isset($data['photo'])) {\n $activity->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (!$activity->save()) {\n $this->setErrorResponse('cannot update Activity object');\n }\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "private function fillMemcacheUserVars()\n\t{\n\t\t$info = $this->model->getVal('infomail_message', 'foodsaver', fsId());\n\t\t\n\t\tif((int)$info > 0)\n\t\t{\n\t\t\tMem::userSet(fsId(), 'infomail', true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tMem::userSet(fsId(), 'infomail', false);\n\t\t}\n\t\t\n\t\t$this->model->updateActivity();\n\t}", "public function setExistingActivity($activity, $currentUser)\n {\n $activity->setDateChanged(new \\DateTime());\n $activity->setChangedBy($currentUser);\n $this->activityRepository->storeActivity($activity);\n }", "public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }", "public function setMembers($list)\n {\n $this->members_objs = array();\n if (!isset($list)) {\n return;\n }\n foreach ($list as $user) {\n $this->members_objs[] = is_array($user) ? User::find($user['unique_id'], $user) : $user;\n }\n }", "public function setUserPriorityListing($userId, $value){\r\n\r\n Doctrine_Query::create()->update('Users')\r\n ->set('PriorityListing','?', $value)\r\n ->where('Id = ? ', $userId)\r\n ->execute();\r\n return true;\r\n }", "public function setCompleteUsersCount(?int $value): void {\n $this->getBackingStore()->set('completeUsersCount', $value);\n }" ]
[ "0.6604992", "0.62129027", "0.5811472", "0.57975274", "0.57975274", "0.5797365", "0.5797365", "0.5797365", "0.5797365", "0.5797365", "0.57298046", "0.57009274", "0.56257886", "0.5439595", "0.5376976", "0.5341953", "0.531483", "0.5311148", "0.5298516", "0.52786875", "0.5273712", "0.52714205", "0.5266508", "0.52655876", "0.52622837", "0.52123564", "0.5198884", "0.5192531", "0.5186468", "0.5172124" ]
0.73870367
0
Handle a new interaction that has been added. This is also called when all users are forced to follow an existing interaction
public function newInteraction(Interaction $interaction, $sendAll=false) { $courseName = $this->site->course->name; $id = $interaction->id; $summary = $interaction->summary; $message = $interaction->message; $attribution = $interaction->attribution($this->site, $this->user, true); $url = $this->site->server . $this->site->root . '/cl/interact/' . $id; $announce = 'New interaction'; $msg = <<<MSG <p>$announce @$id in the $courseName <a href="$url" target="INTERACT">Interact! system</a>.</p> <p>$summary<br /> $attribution</p> $message <p class="notice">You are receiving this message because you are following this interaction. You will automatically follow all interactions you create or contribute to. You can turn off following in the Interact! system.</p> MSG; if($sendAll) { $msg .= <<<MSG <p>Course staff has sent this interaction to all course participants. Future discussions will not be automatically sent unless you choose to follow the interaction.</p> MSG; } $userName = $this->user->displayName; $staff = <<<MSG <p>@$id created by $userName</p> MSG; $this->notifyFollowers($interaction, $msg, $staff, $sendAll); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function handleItself()\n {\n if ($this->isMoved($this->event)) {\n if ($this->getResource()->exists() && $this->addWatch() === $this->id) {\n return;\n }\n\n $this->unwatch($this->id);\n }\n\n if ($this->getResource()->exists()) {\n if ($this->isIgnored($this->event) || $this->isMoved($this->event) || !$this->id) {\n $this->setEvent($this->id ? IN_MODIFY : IN_CREATE);\n $this->watch();\n }\n } elseif ($this->id) {\n $this->event = IN_DELETE;\n $this->getBag()->remove($this);\n $this->unwatch($this->id);\n $this->id = null;\n }\n }", "public function push() {\n\t\t\n\t\t/*\n\t\t * Check if there is an application context, and only an application context.\n\t\t * Users shouldn't be allowed to modify their own reputation.\n\t\t */\n\t\tif (!$this->authapp || $this->user) {\n\t\t\tthrow new PublicException('Users are not allowed to push interactions. Please do so from an application', 403);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Retrieve the source from the request. This is the user where the interaction\n\t\t * stems from.\n\t\t */\n\t\t$src = db()->table('user')->get('_id', $_POST['source'])->first();\n\t\tif (!$src && $_POST['source']) { $src = UserModel::make($this->sso->getUser($_POST['source'])); }\n\t\t\n\t\t/*\n\t\t * Get the user that received the interaction.\n\t\t */\n\t\t$tgt = db()->table('user')->get('_id', $_POST['target'])->first();\n\t\tif (!$tgt && $_POST['target']) { $tgt = UserModel::make($this->sso->getUser($_POST['target'])); }\n\t\t\n\t\tif (!$src && !$tgt) {\n\t\t\tthrow new PublicException('Could not find users', 400);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Create the record and store it to the database.\n\t\t */\n\t\t$record = db()->table('interaction')->newRecord();\n\t\t$record->src = $src;\n\t\t$record->tgt = $tgt;\n\t\t$record->name = $_POST['name'];\n\t\t$record->value = $_POST['value'];\n\t\t$record->caption = $_POST['caption'];\n\t\t$record->url = $_POST['url'];\n\t\t$record->created = time();\n\t\t$record->store();\n\t\t\n\t\t/*\n\t\t * Pass the data onto the view, so the application sending the request can\n\t\t * parse it and extract data from it.\n\t\t */\n\t\t$this->view->set('record', $record);\n\t}", "public function testAddInteraction()\n {\n $this->addInteraction(\n new Interaction(\n new User('123'),\n new ItemUUID('1', 'product'),\n 'click',\n [\n 'position' => 1,\n ]\n )\n );\n\n $this->assertTrue(true);\n }", "public function setInteractionStrategy(InteractionStrategyInterface $interactionStrategy) : void;", "public function follow(Request $request)\n {\n /*\n * --------------------------------------------------------------------------\n * Perform follow request\n * --------------------------------------------------------------------------\n * This operation only for authenticate user, a contributor follow another\n * contributor, populate the data and make sure there is no record following\n * from contributor A to B before then perform insert data.\n */\n\n if (Auth::check() && $request->ajax()) {\n $contributor_id = Auth::user()->id;\n\n $following_id = $request->input('id');\n\n $isFollowing = Follower::whereContributorId($contributor_id)\n ->whereFollowing($following_id)->count();\n\n if (!$isFollowing) {\n $follower = new Follower();\n\n $follower->contributor_id = $contributor_id;\n\n $follower->following = $following_id;\n\n if ($follower->save()) {\n $following = Contributor::findOrFail($following_id);\n\n /*\n * --------------------------------------------------------------------------\n * Create following activity\n * --------------------------------------------------------------------------\n * Create new instance of Activity and insert following activity.\n */\n\n Activity::create([\n 'contributor_id' => $contributor_id,\n 'activity' => Activity::followActivity(Auth::user()->username, $following->username)\n ]);\n\n if ($following->email_follow) {\n $follower->sendEmailNotification(Auth::user(), $following);\n }\n return response('success');\n }\n\n return response('failed', 500);\n }\n return response('success');\n } else {\n return response('restrict', 401);\n }\n }", "public function addFollowedDjipAction()\n {\n $user = $this->container->get('security.context')->getToken()->getUser();\n \n if(!is_object($user)){\n $response = $this->forward('FOSUserBundle:Security:login');\n return $response;}\n \n $request = $this->container->get('request');\n \n if($request->isXmlHttpRequest())\n {\n \n $id = $request->request->get('id');\n \n $em = $this->getDoctrine()->getManager();\n $article = $em->getRepository('SdACoreBundle:Article')->find($id);\n $article->addFollower($user);\n \n $em->persist($user);\n $em->persist($article);\n $em->flush();\n }\n \n return new Response(1);\n }", "protected function changeFollow()\n\t{\n\t\tif ( !\\IPS\\Member::loggedIn()->modPermission('can_modify_profiles') AND ( \\IPS\\Member::loggedIn()->member_id !== $this->member->member_id OR !$this->member->group['g_edit_profile'] ) )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'no_permission_edit_profile', '2C138/3', 403, '' );\n\t\t}\n\n\t\t\\IPS\\Session::i()->csrfCheck();\n\n\t\t\\IPS\\Member::loggedIn()->members_bitoptions['pp_setting_moderate_followers'] = ( \\IPS\\Request::i()->enabled == 1 ? FALSE : TRUE );\n\t\t\\IPS\\Member::loggedIn()->save();\n\n\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( 'OK' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->redirect( $this->member->url(), 'follow_saved' );\n\t\t}\n\t}", "private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }", "public function notifyInteraction($user, $targetUser, $interactionCode, $item = null, array $categories = []);", "public function ajaxFollow()\n\t{\n\t\t//get User's Id to followng or unfollow\n\t\t$userId = Input::get('userId');\n\n\t\t///Check if user has followed this user.\n\t\t$count = DB::table('follower')\n\t\t\t\t\t->whereRaw('follow_id = ?', array(Auth::id()))\n\t\t\t\t\t->whereRaw('user_id = ?', array($userId))\n\t\t\t\t\t->count();\n\n\t\t$action = null;\n\t\t//If not following, follow this user.\n\t\tif( $count == 0 )\n\t\t{\n\n\t\t\t//Add to Activities for \"follow\" action of this user\n\t\t\tActivities::create(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'user_id' => Auth::id(),\n\t\t\t\t\t\t\t\t'action' => 2,\n\t\t\t\t\t\t\t\t//Action 2 mean \"Follow\"\n\t\t\t\t\t\t\t\t'object_id' => $userId\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t));\n\n\t\t\tDB::table('follower')\n\t\t\t\t->insert(\n \t\t\t\t\tarray(\n \t\t\t\t\t'follow_id' => Auth::id(),\n \t\t\t\t\t'user_id' => $userId\n \t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t//Set the response is 1 when unfollow\n\t\t\t$action = 1;\n\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\tActivities::whereRaw('action = 2 and user_id = ?', array(Auth::id()))\n\t\t\t\t\t->whereRaw('object_id = ?', array($userId))\n\t\t\t\t\t->delete();\n\t\t\t\t\t\n\t\t//If has followed, unfollow.\t\n\t\t\tDB::table('follower')\n\t\t\t\t->whereRaw('follow_id = ?', array(Auth::id()))\n\t\t\t\t->whereRaw('user_id = ?', array($userId))\n \t\t\t->delete();\n \t\t//Set the response is 0 when unfollow\n \t\t$action=0;\n\t\t}\n\t\t//Return 1 if successful Follow and 0 if Unfollow\n return Response::json($action);\n\t}", "function onProcess () {\n switch (parent::getAction()) {\n case \"save\":\n if (Context::hasRole(\"user.friendRequest.edit\")) {\n }\n parent::blur();\n parent::redirect();\n break;\n case \"edit\":\n if (Context::hasRole(\"user.friendRequest.edit\")) {\n parent::focus();\n }\n break;\n case \"accept\":\n if (Context::hasRole(\"user.friendRequest.view\")) {\n $friendRequest = UserFriendModel::getFriendRequest(parent::get(\"id\"));\n if (!empty($friendRequest) && $friendRequest->dstuserid == Context::getUserId()) {\n UserFriendModel::confirmUserFriendRequest($friendRequest->id);\n SocialController::notifyFriendAccepted($friendRequest->id);\n }\n }\n break;\n case \"decline\":\n if (Context::hasRole(\"user.friendRequest.view\")) {\n $friendRequest = UserFriendModel::getFriendRequest(parent::get(\"id\"));\n if (!empty($friendRequest) && $friendRequest->dstuserid == Context::getUserId()) {\n UserFriendModel::declineUserFriendRequest($friendRequest->id);\n }\n }\n break;\n default:\n if (parent::get(\"userId\")) {\n Context::setSelectedUser(parent::get(\"userId\"));\n } else if (parent::param(\"mode\") == self::modeCurrentUser) {\n Context::setSelectedUser(Context::getUserId());\n }\n }\n }", "public function store(CreateInteractionRequest $request)\n {\n $tagNames = $request->tags;\n $tags = array();\n if ($tagNames != null)\n {\n foreach ($tagNames as $tagName)\n {\n $tagName = removeAccents(strtr(trim($tagName), array(' ' => '-')));\n if (!preg_match('/^[a-zA-Z0-9-]+$/i', $tagName))\n {\n return Redirect::back()->withErrors(trans('messages.tagCharacterError'));\n }\n array_push($tags, $tagName);\n }\n }\n\n $person = Person::find($request->person_id);\n $interaction = new Interaction;\n $destinationMail = $request->destination;\n $input = $request->all();\n $interaction->fill($input);\n $interaction->user_id = Auth::id();\n $success = $interaction->save();\n\n if (!is_null($tags))\n {\n $interaction->retag($tags);\n }\n\n $seEnviaronMails = false;\n if (env('MAIL_USERNAME') != null && env('MAIL_PASSWORD') != null)\n {\n // El usuario puede elegir un correo electrónico para enviar el mail de derivación\n if ($destinationMail != '' && !is_null($person))\n {\n $seEnviaronMails = true;\n try\n {\n sendMail($destinationMail,$person);\n flash()->success(trans('messages.mailSuccess'));\n }\n catch (\\Exception $e)\n {\n flash()->error(trans('messages.mailFailed'))->important();\n }\n }\n\n // Si hay tags se envian mails a todos los usuarios que tengan alguno de los tags seleccionados\n if (!is_null($tags) && allowed_to_tag(Auth::user(),$tags) && !$interaction->fixed && !$seEnviaronMails)\n {\n $users = User::withAnyTag($tags)->get();\n if ($users != null && count($users) > 0)\n {\n $seEnviaronMails = true;\n try\n {\n sendMailToUsers($users,$person);\n flash()->success(trans('messages.mailsSuccess'));\n }\n catch (\\Exception $e)\n {\n flash()->error(trans('messages.mailsFailed'))->important();\n }\n }\n\n }\n }\n\n if (!$seEnviaronMails)\n {\n if ($success)\n {\n flash()->success(trans('messages.interactionCreated'));\n }\n else\n {\n flash()->error(trans('messages.interactionFailed'));\n }\n }\n\n return redirect('person/'.$interaction->person_id);\n }", "public function follower($input){\n DB::transaction(function ($input) use ($input) {\n try{\n $user = $this->getById($input['follower_id']);\n Followers::create($input);\n $user->increment('follower_count');\n }catch (\\Exception $e){\n throw $e;\n }\n\n });\n }", "public function handle(ThreadHasNewReply $event)\n {\n preg_match_all('/@([\\w\\-]+)/', $event->reply->body, $matches);\n\n $names = $matches[1];\n\n foreach ($names as $name) {\n $user = User::whereName($name)->first();\n\n if ($user) {\n $user->notify(new YouWereMentioned($event->reply));\n }\n }\n }", "public function handle(): void\n {\n $lms = new Moodle();\n $lms->syncPersonInfo($this->person);\n ActionLog::record($this->person, 'lms-sync-user', 'person update');\n }", "public function follow($params)\n {\n // Throw 401 if not logged in\n $token = $this->require_authentication();\n $currUser = $token->getUser()->getUserId();\n // Throw 401 if not logged in\n $id = $params['userId'];\n\n // See if there is a ref param to redirect to\n if(array_key_exists('ref', $_POST)) {\n $referrer = $_POST['ref'];\n } else {\n $referrer = '/users/all';\n }\n\n try {\n // Add to DB\n $db = $this->getDBConn();\n $follow = new Following();\n $res = $follow->setUserFrom($currUser)\n ->setUserTo($id)\n ->commit($db);\n\n error_log(\"Added following relationship \" . $follow->getFollowId());\n $this->addFlashMessage('Now following user.', self::FLASH_LEVEL_SUCCESS);\n } catch (\\PDOException $dbErr) {\n $this->addFlashMessage('Database error on adding following relationship:<br>' . $dbErr->getMessage(), self::FLASH_LEVEL_SERVER_ERR);\n }\n\n $this->redirect($referrer);\n }", "protected function appendHandleMethod($interaction, $method = 'handle')\n {\n if (!str_contains($interaction, '@')) {\n $interaction .= '@' . $method;\n }\n\n return $interaction;\n }", "public function Base_AfterFlag_Handler($Sender, $Args) {\n if (CheckPermission('Conversations.Conversations.Add'))\n $this->AddSendMessageButton($Sender, $Args);\n }", "public function postBehavior( Request $request ) {\n\n $user = JWTAuth::parseToken()->toUser();\n\n $behavior = new Behavior();\n $behavior->breakfast = $request->input('breakfast');\n $behavior->daily_routine = $request->input('daily_routine');\n $behavior->feeling = $request->input('feeling');\n\n //attach the user_id to behaviors by using the relationship set up in User Model\n $user->behaviors()->save($behavior);\n\n return response()->json([ \n 'behavior' => $behavior, \n 'user' => $user \n ], 201);\n\n }", "public function addFollow(Request $request)\n {\n $json = [];\n\n $validator = Validator::make($request->all(), [\n 'user_id' => 'required|integer',\n ]);\n\n if ($validator->fails()) {\n\n $json['errors'] = $validator->errors()->all();\n\n return response()->json($json, 200);\n }\n \n $follow_id = $request->get('user_id');\n $current_user_id = authApi()->user()->id;\n\n \n if (!Users::where('id', '=', $follow_id)->exists()) {\n\n $json['message'] = 'This User Don\\'t Exists';\n $json['isFollowed'] = false;\n $json['data'] = [];\n\n return response()->json($json, 200);\n }\n\n if(Follow::where('user_id', $current_user_id)->where('followed_id', $follow_id)->first())\n {\n $json['message'] = 'You Are Already Followed This User';\n $json['isFollowed'] = true;\n $json['data'] = [];\n\n return response()->json($json, 200);\n }\n\n Follow::create([\n 'user_id' => $current_user_id,\n 'followed_id' => $follow_id\n ]);\n\n $json['message'] = 'Success Followed';\n $json['isFollowed'] = true;\n $json['data'] = [];\n\n return response()->json($json, 200);\n }", "public function update(CreateInteractionRequest $request, $id)\n {\n $interaction = Interaction::findorFail($id);\n\n $tagNames = $request->tags;\n $tags = array();\n if ($tagNames != null)\n {\n foreach ($tagNames as $tagName)\n {\n $tagName = removeAccents(strtr(trim($tagName), array(' ' => '-')));\n if (!preg_match('/^[a-zA-Z0-9-]+$/i', $tagName))\n {\n return Redirect::back()->withErrors(trans('messages.tagCharacterError'));\n }\n array_push($tags,$tagName);\n }\n }\n\n $input = $request->all();\n $interaction->fill($input);\n $interaction->update();\n\n if (!is_null($tags) && allowed_to_tag(Auth::user(),$tags))\n {\n $interaction->retag($tags);\n }\n else\n {\n $interaction->untag();\n }\n\n flash()->success(trans('messages.interactionUpdated'));\n return redirect('person/'.$interaction->person_id);\n }", "public function follow($id){\n $add = Friendship::create([\n 'requester' => Auth::user()->id,\n 'user_requested' => $id\n ]);\n \n return back();\n\n }", "public function handle()\n {\n foreach (Article::where('post_type', 'addon-introduction')->active()->with('user')->cursor() as $article) {\n $link = $article->getContents('link');\n\n if(!self::isStatusOK($link)) {\n $this->info('dead link '.$link);\n logger('dead link '.$link);\n $article->status = config('status.private');\n $article->save();\n\n Notification::send($article->user, new DeadLinkDetected($article));\n }\n }\n }", "function handle($args)\n {\n parent::handle($args);\n \n// \tif (!in_array($this->action, array('home', 'groups', 'public', 'game'))) {\n// $this->clientError('链接不正确!', 404);\n// return;\n// }\n \n if (empty($this->token) || $this->token != $this->profile->token) {\n $this->clientError('您输入的参数错误.',\n 404, $this->format);\n return;\n }\n \n \t// success!\n if (!common_set_user($this->user)) {\n $this->clientError('设置用户时发生错误。');\n return;\n }\n \n common_redirect($this->url, 303);\n \n// if($this->action == 'game') { \t\n// \tcommon_redirect(common_local_url($this->action, array('gameid' => $this->user->game_id)), 303);\n// } else {\n// \tcommon_redirect(common_local_url($this->action), 303);\n// }\n\t\t\n }", "public function follow($id, Request $request)\n {\n // check if there is a logged in user\n if (!$this->user) {\n flash()->error('Error', 'No user is logged in.');\n\n return back();\n };\n\n if (!$object = Entity::find($id)) {\n flash()->error('Error', 'No such entity');\n\n return back();\n };\n\n // add the following response\n $follow = new Follow;\n $follow->object_id = $id;\n $follow->user_id = $this->user->id;\n $follow->object_type = 'entity'; // 1 = Attending, 2 = Interested, 3 = Uninterested, 4 = Cannot Attend\n $follow->save();\n\n Log::info('User ' . $id . ' is following ' . $entity->name);\n\n flash()->success('Success', 'You are now following the entity - ' . $entity->name);\n\n return back();\n }", "function agreeFriendHandler() {\n global $inputs;\n\n $res = getOne('SELECT * FROM member_friend_apply WHERE id = ?',[$inputs['id']]);\n\n insert('member_friend',[\n 'member_id' => getLogin()['mid'],\n 'friend_id' => $res['member_id']\n ]);\n\n insert('member_friend',[\n 'member_id' => $res['member_id'],\n 'friend_id' =>getLogin()['mid']\n ]);\n\n $sql = \"DELETE FROM `member_friend_apply` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'option success');\n}", "public function follow($user_id_followed) {\n $data = Array(\n \"created\" => Time::now(),\n \"user_id\" => $this->user->user_id,\n \"user_id_followed\" => $user_id_followed\n );\n\n # Do the insert\n DB::instance(DB_NAME)->insert('users_users', $data);\n\n # Send them back\n Router::redirect(\"/activities/users\");\n\n }", "public function checkForFollowUp()\n {\n $now = Carbon::now();\n $preceding = $this->previousEvent;\n\n if (is_null($preceding)) {\n return;\n }\n\n // if already followed\n if ($preceding->triggersToFollowUp->isEmpty()) {\n return;\n }\n\n // One event may be triggered multiple times\n // For example: triggerd by birthday --> make sure to follow all these triggers\n foreach($preceding->triggersToFollowUp as $trigger) {\n if ($now->gte($trigger->start_at->copy()->modify($this->getDelayInterval()))) {\n // for follow-up type of auto-event, need to pass a preceding trigger\n // empty $trigger->subscriber indicates ALL\n MailLog::info(sprintf('Trigger sending follow-up email for automation %s, preceding event ID: %s, event ID: %s', $this->automation->name, $preceding->id, $this->id));\n if ($trigger->subscriber()->exists()) {\n // follow up individual subscriber\n $this->fire([$trigger->subscriber], $trigger);\n } else {\n // follow up the entire list (for the FollowUpSend event)\n $this->fire(null, $trigger);\n }\n }\n }\n }", "public function postDelete($interaction)\n {\n // Was the ad deleted?\n if($interaction->delete()) {\n // Redirect to the ad management page\n return Redirect::to('admin/successful-delete')->with('success', Lang::get('admin/interactions/messages.delete.success'));\n }\n\n // There was a problem deleting the ad\n return Redirect::to('admin/interactions')->with('error', Lang::get('admin/interactions/messages.delete.error'));\n }", "function bp_follow_screen_activity_following() {\n\tbp_update_is_item_admin( is_super_admin(), 'activity' );\n\tdo_action( 'bp_activity_screen_following' );\n\tbp_core_load_template( apply_filters( 'bp_activity_template_following', 'members/single/home' ) );\n}" ]
[ "0.52635676", "0.51510584", "0.5129906", "0.5071807", "0.504189", "0.50019425", "0.4997001", "0.49830362", "0.4918581", "0.48699692", "0.48649976", "0.4851558", "0.48176053", "0.47847193", "0.47375214", "0.47349742", "0.4728492", "0.47129658", "0.46974373", "0.4683784", "0.4681224", "0.46782795", "0.46662214", "0.4657528", "0.46518958", "0.46417278", "0.4639502", "0.4636041", "0.46335256", "0.46265998" ]
0.52422744
1
Handle a new discussion added to an existing interaction
public function newDiscussion(Interaction $interaction, Discussion $discussion) { $courseName = $this->site->course->name; $id = $interaction->id; $summary = $interaction->summary; $interactMessage = $interaction->message; $attribution = $interaction->attribution($this->site, $this->user, true); $url = $this->site->server . $this->site->root . '/cl/interact/' . $id; $discussMessage = $discussion->message; $msg = <<<MSG <p>New interaction @$id in the $courseName <a href="$url">Interact! system</a>.</p> <p>$summary<br /> $attribution</p> <p><em>New discussion contribution:</em></p> $discussMessage <p><em>Interaction:</em></p> $interactMessage <p class="notice">You are receiving this message because you are following this interaction. You will automatically follow all interactions you create or contribute to the discussion in and course staff can force all students in the course to follow an interaction. You can turn off following in the Interact! system.</p> MSG; $interacterName = $interaction->user->displayName; $discusserName = $discussion->user->displayName; $staff = <<<MSG <p>@$id created by $interacterName<br> Discussion by $discusserName</p> MSG; $this->notifyFollowers($interaction, $msg, $staff, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postDiscussionReply()\n\t{\n\t\t//init variable\n\t\t$mainframe = JFactory::getApplication();\n\t\t$log_user = $this->plugin->get('user')->id;\n\t\t// Load the discussion\n\t\t$discuss_id \t= $mainframe->input->get('discussion_id',0,'INT');\n\t\t$groupId \t= $mainframe->input->get('group_id',0,'INT');\n\t\t$content \t= $mainframe->input->get('content','','RAW');\n\t\t\n\t\t$content = str_replace('<p>','',$content);\n\t\t$content = str_replace('</p>','',$content);\n\t\t$content = str_replace('<','[',$content);\n\t\t$content = str_replace('>',']',$content);\n\t\t\n\t\t$wres = new stdClass;\n\t\t\n\t\t$discussion = FD::table( 'Discussion' );\n\t\t$discussion->load( $discuss_id );\n\t\t\n\t\t// Get the current logged in user.\n\t\t$my\t\t= FD::user($log_user);\n\n\t\t// Get the group\n\t\t$group\t\t= FD::group( $groupId );\n\t\t\n\t\t$reply \t\t\t\t= FD::table( 'Discussion' );\n\t\t$reply->uid \t\t= $discussion->uid;\n\t\t$reply->type \t\t= $discussion->type;\n\t\t$reply->content \t= $content;\n\t\t$reply->created_by \t= $log_user;\n\t\t$reply->parent_id \t= $discussion->id;\n\t\t$reply->state \t\t= SOCIAL_STATE_PUBLISHED;\n\n\t\t// Save the reply.\n\t\t$state = $reply->store();\n\t\t\n\t\tif($state)\n\t\t{\t\n\t\t\t$this->createStream($discussion,$group,$reply,$log_user);\n\t\t\t$wres->id = $discussion->id;\n\t\t\t$wres->message[] = JText::_( 'PLG_API_EASYSOCIAL_DISCUSSION_REPLY_MESSAGE' );\n\t\t\treturn $wres;\n\t\t}\n\t}", "public function addAction()\n {\n /* Checking if user is signed in to be allowed to add new answer */\n $this->requireSignin();\n\n /* Getting Question by id */\n $question = Question::getById(intval($_POST['question_id']));\n\n if ($question) {\n\n /* Checking if question is not closed */\n if ($question->is_closed == 0 && $question->active == 1) {\n\n /* Creating new Answer's object */\n $answer = new Answer($_POST);\n\n /* Checking if answer is not empty */\n if (strlen($answer->answer) < 2) {\n\n /* Show error message and redirect to question's page */\n Flash::addMessage('You can not add emty answer', Flash::INFO);\n }\n\n /* Getting user's id and set it as question's user_id */\n $user = Auth::getUser();\n $answer->user_id = $user->id;\n\n $answerId = $answer->add();\n\n if ($answerId) {\n\n /* Send notification to question's author */\n Notification::add([\n 'to_user' => $question->user_id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n\n /* Send notifications to users who are following question */\n $followers = FollowedQuestion::getFollowers($question->id);\n foreach ($followers as $follower) {\n\n Notification::add([\n 'to_user' => $follower['user_id'],\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'na',\n 'from_user' => $answer->user_id,\n ]);\n }\n\n /* Send notifications to mentioned users */\n $mention_number = 0;\n preg_match_all('/(<span class=\"mention\" [^>]*value=\"([^\"]*)\"[^>]*)>(.*?)<\\/span><\\/span>/i', $answer->answer, $mentions);\n\n foreach($mentions[2] as $mention) {\n\n /* Allow max 10 mentions */\n if ($mention_number < 10) {\n\n /* Check if user exists */\n $this_user = User::getByUsername($mention);\n\n if ($this_user) {\n\n Notification::add([\n 'to_user' => $this_user->id,\n 'question_id' => $question->id,\n 'answer_id' => $answerId,\n 'type' => 'nm',\n 'from_user' => $answer->user_id,\n ]);\n }\n }\n }\n\n /* Redirect to question's page and show success message */\n Flash::addMessage('Answer added!', Flash::INFO);\n $this->redirect('/question/'.$question->url.'#answer_'.$answerId);\n\n } else {\n \n /* Redirect to question's page and show error messages */\n Flash::addMessage(\"Error: \".implode(\", \", $answer->errors), Flash::INFO);\n }\n\n } else {\n \n /* Redirect to question's page and show error message */\n Flash::addMessage('This question is closed for new answers.', Flash::INFO);\n }\n\n $this->redirect('/question/'.$question->url);\n\n } else {\n\n /* Redirect to stream page and show error messages */\n Flash::addMessage('This question is unavailable.', Flash::INFO);\n $this->redirect('/');\n }\n }", "public function store(CreateReplyRequest $request, Discussion $discussion)\n {\n auth()->user()->replies()->create([\n 'content' => $request->content,\n 'discussion_id' => $discussion->id\n ]);\n\n auth()->user()->points += 25;\n auth()->user()->save();\n\n if($discussion->author->id !== auth()->user()->id) {\n $discussion->author->notify(new NewReplyAdded($discussion));\n }\n\n session()->flash('success', 'Reply Added!');\n\n return redirect()->back();\n }", "public function store(CreateDiscussionRequest $request)\n {\n $validated = $request->validated();\n auth()->user()->discussion()->create([\n 'user_id' => auth()->user()->id,\n 'title' => $request['title'],\n 'content' => $request['content'],\n 'slug' => str_slug($request['title']),\n 'channel_id' => $request['channel']\n ]);\n return $this->curdSucess('success', 'Created discussion successfully', 'discussions.index');\n }", "public function actionAdd() {\n $request = Yii::$app->request;\n $db = new Connection(Yii::$app->db);\n if (!is_null($request)) { //check wheter request exist or not\n $ip = $request->post('ip');\n $comment = $request->post('comment');\n $db->createCommand()->insert('discuss', [\n 'ip' => $ip,\n 'comment' => $comment,\n ])->execute();\n return json_encode([\"status\" => \"passed\"]);\n } else {\n return json_encode([\"status\" => \"failed\"]);\n }\n }", "protected static function discussionAction($ajax) {\n\t\tglobal $db, $user;\n\t\tif(isset($_GET['discussion']) && $discid = +$_GET['discussion'])\n\t\t\tif($replies = $db->query('select r.id, r.posted, r.user as canchange, u.username, u.displayname, u.avatar, case u.level when 1 then \\'new\\' when 2 then \\'known\\' when 3 then \\'trusted\\' when 4 then \\'admin\\' else null end as level, f.fan as friend, r.name, r.contacturl, r.markdown, r.html, group_concat(concat(e.posted, \\'\\t\\', eu.username, \\'\\t\\', eu.displayname) order by e.posted separator \\'\\n\\') as edits from forum_replies as r left join users as u on u.id=r.user left join users_friends as f on f.friend=r.user and f.fan=\\'' . +$user->ID . '\\' left join forum_edits as e on e.reply=r.id left join users as eu on eu.id=e.editor where r.discussion=\\'' . +$discid . '\\' group by r.id order by r.posted')) {\n\t\t\t\t$ajax->Data->replies = [];\n\t\t\t\twhile($reply = $replies->fetch_object()) {\n\t\t\t\t\t$reply->posted = t7format::TimeTag(t7format::DATE_LONG, $reply->posted);\n\t\t\t\t\tif(!$user->IsLoggedIn() && substr($reply->contacturl, 0, 7) == 'mailto:')\n\t\t\t\t\t\t$reply->contacturl = '';\n\t\t\t\t\t$reply->canchange = $user->IsLoggedIn() && ($reply->canchange == $user->ID && $reply->markdown || $user->IsAdmin());\n\t\t\t\t\tif($reply->edits) {\n\t\t\t\t\t\t$edits = [];\n\t\t\t\t\t\tforeach(explode(\"\\n\", $reply->edits) as $e) {\n\t\t\t\t\t\t\tlist($posted, $username, $display) = explode(\"\\t\", $e);\n\t\t\t\t\t\t\t$edits[] = ['datetime' => $posted, 'posted' => strtolower(t7format::LocalDate(t7format::DATE_LONG, $posted)), 'username' => $username, 'displayname' => $display];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$reply->edits = $edits;\n\t\t\t\t\t} else\n\t\t\t\t\t\t$reply->edits = [];\n\t\t\t\t\tif(!$reply->canchange)\n\t\t\t\t\t\tunset($reply->markdown);\n\t\t\t\t\telseif(!$reply->markdown && $user->IsAdmin())\n\t\t\t\t\t\t$reply->markdown = $reply->html;\n\t\t\t\t\tif($reply->avatar === '')\n\t\t\t\t\t\t$reply->avatar = t7user::DEFAULT_AVATAR;\n\t\t\t\t\t$ajax->Data->replies[] = $reply;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\t$ajax->Fail('database error looking up discussion detail', $db->errno . ' ' . $db->error);\n\t\telse\n\t\t\t$ajax->Fail('discussion is required');\n\t}", "function addCommentHandler() {\n global $inputs;\n\n $content = $inputs['content'];\n $id = $inputs['id'];\n $replyId = insert('reply',[\n 'content' => $content\n ]);\n\n insert('posting_reply',[\n 'posting_id' => $id,\n 'reply_id' => $replyId\n ]);\n\n insert('member_reply',[\n 'member_id' => getLogin()['mid'],\n 'posting_id' => $id\n ]);\n\n formatOutput(true, 'success');\n}", "public function NewCommentEpisode(){\r\n $this->comment();\r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],false,true); \r\n header('location: Episode&id='.$_GET[\"id\"]); \r\n }", "public function discussion($request, $discu_id){\n $userArray = $this->verify_token($request);\n if ($userArray==false){\n return new Response(401, ['Content-Type' => 'application/json'], json_encode(array(\n \"status\" => \"error\",\n \"message\" => \"Invalid authorized access\"\n )));\n }\n\n $user_id = $userArray[\"id\"];\n\n $discussion = new Discussion();\n $discussion->setId($discu_id);\n\n $messages = $discussion->getMessages();\n\n $messagesJson = array();\n foreach ($messages as $message) {\n $messageArray = array();\n $messageArray[\"type\"] = $message->getType();\n $messageArray[\"msg_text\"] = $message->getMsg_text();\n $link = null;\n if ($messageArray[\"type\"] == \"media\"){\n $link = $message->getMessageMediaLink($messageArray[\"msg_text\"]);\n }\n $messageArray[\"link\"] = $link;\n $messageArray[\"date\"] = $message->getDate_envoi();\n $messageArray[\"user\"] = $message->getUserNecessityArray();\n array_push($messagesJson, $messageArray);\n }\n\n return $this->renderJson(array(\n \"current_user_id\" => $user_id,\n \"messages\" => $messagesJson,\n ));\n }", "public function addComment(): void\n {\n $this->articleId = $_GET['articleId'];\n $this->content = $_POST['comment'];\n $this->author = $_POST['nickname'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n\n $this->commentModel->addComment($this->content, $this->date, $this->author, $this->articleId);\n\n // Redirect to the article page\n Router::redirectTo('articleDetails&id=' . $this->articleId);\n exit();\n }", "public function create()\n\t{\n\t\treturn View::make('discussions.create');\n\t}", "public function saving(ContractDiscussion $discussion)\n {\n if (company()) {\n $discussion->company_id = company()->id;\n }\n }", "public function awaitIssueAdded(ContextInterface $ctx): IssueAddedEvent;", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Discussion::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\t\t$data['user_id'] = Auth::id();\n\t\tDiscussion::create($data);\n\t\treturn Redirect::route('discussions.index');\n\t}", "public function newAction()\n {\n $this->view->disable();\n\n if (!$this->auth->isAuthorizedVisitor()) {\n $this->flashSession->error(t('You must be logged in first to post answer'));\n return $this->currentRedirect();\n }\n\n if ($this->request->isPost()) {\n $postId = $this->request->getPost('id');\n $content = $this->request->getPost('content', 'trim');\n if (str_word_count($content) < 10) {\n $this->flashSession->error(t('Body must be at least 15 word'));\n return $this->currentRedirect();\n }\n $post = Posts::findFirstById($postId);\n $user = Users::findFirstById($this->auth->getUserId());\n if (!$post) {\n $this->flashSession->error(t('Hack attempt!'));\n return $this->currentRedirect();\n }\n //Only update the number of replies if the user that commented isn't the same that posted\n if ($user->getId() != $post->getUsersId()) {\n $post->setNumberReply($post->getNumberReply() + 1);\n $post->user->increaseKarma(Karma::SOMEONE_REPLIED_TO_MY_POST);\n // $user->increaseKarma(Karma::REPLY_ON_SOMEONE_ELSE_POST);\n\n if (!$post->save() || !$user->save()) {\n $this->logger->error('Save fail answerAction. I am on here ' . __LINE__);\n }\n }\n $object = new Comments();\n $object->setPostsId($postId);\n $object->setContent($content);\n $object->setUsersId($this->auth->getUserId());\n if (!$object->save()) {\n foreach ($object->getMessages() as $message) {\n $this->flashSession->error($message);\n }\n\n return $this->currentRedirect();\n }\n $this->flashSession->success(t('Data was successfully saved'));\n return $this->currentRedirect();\n }\n }", "public function test_add_new_talkpoint_to_non_existent_activity() {\n $client = new Client($this->_app);\n $client->request('GET', '/999/add');\n }", "function discussions_handle_on_quick_add(&$quick_add_urls) {\n $quick_add_urls['discussion'] = assemble_url('project_discussions_quick_add', array('project_id' => '-PROJECT-ID-'));\n }", "public function run()\n {\n $replies = [\n ['user_id'=>1, 'discussion_id'=>1,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>2, 'discussion_id'=>2,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>1, 'discussion_id'=>3,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>2, 'discussion_id'=>4,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ];\n\n Reply::insert($replies);\n }", "public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "public function create()\n {\n return view('discussion.create');\n }", "public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }", "public function createInteraction($metric_id, $fields = array()) { \n $data = array_merge(array( \n \"authorId\"=> \"me\",\n \"kind\" => \"comment\"\n ), $fields); \n $result = $this->post(\"/v1/metrics/{$metric_id}/interactions\", $data);\n return $result; \n }", "public function add_postAction() {\r\n\t\t$info = $this->getPost(array('sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$result = Gou_Service_Notice::addNotice($info);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function addPostFromDiscord(Request $request) {\n\n $course = Course::where('code', trim($request->course, \"[]\"))->first();\n $topic = Topics::where('course_id', $course->id)->where('name', 'Discord')->first();\n\n if($topic == null) {\n $topic = new Topics();\n $topic->name = \"Discord\";\n $topic->course_id =$course->id;\n $topic->save();\n }\n\n $post = new Post();\n $post->author_id = 6;\n $post->topic_id = $topic->id;\n $post->course_id = $course->id;\n $post->title = \"Discord post\";\n $post->content = $request->content;\n $post->downvotes = 0;\n $post->upvotes = 0;\n $post->type = 'Diskuze';\n $post->save();\n return true;\n }", "public function push() {\n\t\t\n\t\t/*\n\t\t * Check if there is an application context, and only an application context.\n\t\t * Users shouldn't be allowed to modify their own reputation.\n\t\t */\n\t\tif (!$this->authapp || $this->user) {\n\t\t\tthrow new PublicException('Users are not allowed to push interactions. Please do so from an application', 403);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Retrieve the source from the request. This is the user where the interaction\n\t\t * stems from.\n\t\t */\n\t\t$src = db()->table('user')->get('_id', $_POST['source'])->first();\n\t\tif (!$src && $_POST['source']) { $src = UserModel::make($this->sso->getUser($_POST['source'])); }\n\t\t\n\t\t/*\n\t\t * Get the user that received the interaction.\n\t\t */\n\t\t$tgt = db()->table('user')->get('_id', $_POST['target'])->first();\n\t\tif (!$tgt && $_POST['target']) { $tgt = UserModel::make($this->sso->getUser($_POST['target'])); }\n\t\t\n\t\tif (!$src && !$tgt) {\n\t\t\tthrow new PublicException('Could not find users', 400);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Create the record and store it to the database.\n\t\t */\n\t\t$record = db()->table('interaction')->newRecord();\n\t\t$record->src = $src;\n\t\t$record->tgt = $tgt;\n\t\t$record->name = $_POST['name'];\n\t\t$record->value = $_POST['value'];\n\t\t$record->caption = $_POST['caption'];\n\t\t$record->url = $_POST['url'];\n\t\t$record->created = time();\n\t\t$record->store();\n\t\t\n\t\t/*\n\t\t * Pass the data onto the view, so the application sending the request can\n\t\t * parse it and extract data from it.\n\t\t */\n\t\t$this->view->set('record', $record);\n\t}", "public function sendAnswer(Request $request,$dis_id){\n try {\n Answers::create(\n [\n 'answer_user_id' => $request->session()->get('id'),\n 'answer_discuss_id'=> $dis_id,\n 'answer_content'=> $request->input('komentar'),\n ]\n );\n // Session::flash('success', \"Forum Diskusi Berhasil dibuat\");\n // return redirect('create-discussion');\n return back();\n\n } catch (\\Illuminate\\Database\\QueryException $e) {\n $errorCode = $e->errorInfo[1];\n $errorMsg = $e->errorInfo[2];\n if ($errorCode == 1062) {\n return back();;\n }\n // Session::flash('error', $errorMsg);\n return back();;\n // return view('dashboards.create-discussion');\n }\n \n \n }", "public function testAddRelatedWatches() {\n\t\t$editor = self::$users['sysop']->getUser()->getName();\n\t\t$talkPage = self::$users['uploader']->getUser()->getName();\n\t\t// A set of messages which will be inserted\n\t\t$messages = [\n\t\t\t'Moar Cowbell',\n\t\t\t\"I can haz test\\n\\nplz?\", // checks that the parser allows multi-line comments\n\t\t\t'blah blah',\n\t\t\t\"another\"\n\t\t];\n\n\t\t$messageCount = 1;\n\t\t$this->assertCount( 1, $this->fetchAllEvents() );\n\t\t// Start a talkpage\n\t\t$content = \"== Section 8 ==\\n\\n\" . $this->signedMessage( $editor, $messages[$messageCount] );\n\t\t$this->editPage( $talkPage, $content, '', NS_USER_TALK );\n\n\t\t// Ensure the proper event was created\n\t\t$events = $this->fetchAllEvents();\n\t\t$this->assertCount( 1 + $messageCount, $events, 'After initial edit a single event must exist.' ); // +1 is due to 0 index\n\t\t$row = array_shift( $events );\n\t\t$this->assertEquals( 'thank-you-edit', $row->event_type );\n\n\t\t// Add another message to the talk page\n\t\t$messageCount++;\n\t\t$content .= $this->signedMessage( $editor, $messages[$messageCount] );\n\t\t$this->editPage( $talkPage, $content, '', NS_USER_TALK );\n\n\t\t// Ensure another event was created\n\t\t$events = $this->fetchAllEvents();\n\t\t$this->assertCount( 1 + $messageCount, $events );\n\t\t$row = array_shift( $events );\n\t\t$this->assertEquals( 'thank-you-edit', $row->event_type );\n\n\t\t// Add a new section and a message within it\n\t\t$messageCount++;\n\t\t$content .= \"\\n\\n== EE ==\\n\\n\" . $this->signedMessage( $editor, $messages[$messageCount] );\n\t\t$this->editPage( $talkPage, $content, '', NS_USER_TALK );\n\n\t\t// Ensure this event has the new section title\n\t\t$events = $this->fetchAllEvents();\n\t\t$this->assertCount( 1 + $messageCount, $events );\n\t\t$row = array_pop( $events );\n\t\t$this->assertEquals( 'edit-user-talk', $row->event_type );\n\t}", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function diagram_new($id = NULL, $action = NULL) {\n $parent_id = 0; // current add parent id\n\n /*\n check the action type\n */\n \n /*\n if add a child, $id is a parent id\n */\n if ($action == 'add_a_child') {\n $parent_id = $id;\n $id = NULL;\n /*\n if add done, $id is previous diagram id, set the previous diagram parent id for current add id\n */\n } else if ($action == 'add_done') {\n $parent_id = ORM::factory('diagram')->where('id', $id)->find()->parent_id;\n $id = NULL;\n }\n\n $diagram = new Diagram_Model($id);\n $customfields = $diagram->customfields;\n\n // add new or save edit\n if ($post = $this->input->post()) {\n\n $type = $this->input->post('type');\n $parent_id = $this->input->post('parent_id');\n $uri = $this->input->post('uri');\n $uri = $uri == '/' ? '/' : trim($uri, '/');\n\n $diagram->type = $type;\n $diagram->uri = $uri;\n $diagram->parent_id = $parent_id;\n $diagram->title = trim($this->input->post('title'));\n $diagram->template = $this->input->post('template');\n $diagram->content = $this->input->post('content');\n\n $metavalue = array();\n $metavalue['post_template'] = $this->input->post('post_template');\n\n if (!empty($metavalue)) {\n $diagram->metavalue = serialize($metavalue);\n } else {\n $diagram->metavalue = '';\n }\n\n $set_order = false;\n if (empty($diagram->id)) {\n $set_order = true;\n $diagram->date = time();\n $diagram->user_id = $this->user->id;\n }\n\n $customfields_post = $this->input->post('customfields');\n // get a object list for customfields edit\n $customfields = self::_customfiled_to_object($customfields_post);\n\n if (!$diagram->is_unique_uri($uri, $type)) {\n Tip::set('Diagram uri is not unique.');\n } else if (!valid::uri($uri)) {\n Tip::set('Invalid diagram uri.');\n } else {\n $diagram->save();\n if ($set_order) {\n $diagram->order = $diagram->id; // set the diagram display order\n }\n\n self::_save_customfields($diagram->id, $customfields_post); // save customfiels\n\n // save diagram\n $diagram->save();\n\n // update the diagrams cache\n Diagram::cache_diagrams();\n\n if ($action == 'edit') {\n $tip = 'Edit done.';\n $redirect = 'diagram_manage';\n } else {\n // redirect to the tip add done\n $tip = 'Add done.';\n $redirect = \"diagram_manage/diagram_new/$diagram->id/add_done/\";\n }\n\n Tip::set(T::_($tip) . ' ' . html::admin_anchor(\"/diagram_manage/diagram_new/$diagram->id/edit?redirect_uri=diagram_manage/diagram_new\", T::_('View or edit')));\n\n $redirect_uri = $this->input->get('redirect_uri');\n if (!empty($redirect_uri)) {\n $redirect = $redirect_uri;\n }\n url::admin_redirect($redirect);\n }\n }\n\n $view = new View('layouts/admin');\n // type checked status\n $view->type_page = '';\n $view->type_list = '';\n $view->type_item = '';\n $view->type_url = '';\n\n // page content;\n $view->id = $diagram->id;\n $view->{\"type_$diagram->type\"} = TRUE;\n $view->title = $diagram->title;\n $view->content = $diagram->content;\n $view->uri = $diagram->uri;\n $view->template = $diagram->template;\n $view->post_template = $diagram->post_template;\n\n // set the diagram type check status\n if ($action == 'edit') {\n $view->buttom = 'Edit';\n $view->page_title = 'Diagram Edit';\n $parent_id = $diagram->parent_id;\n } else {\n $view->buttom = 'Add new';\n $view->page_title = 'Diagram New';\n }\n\n $view->customfields = !empty($customfields) ? $customfields : array();\n\n $view->select_options = Diagram::get_diagram_select(array('uses'=>'diagram', 'selected'=>$parent_id, 'current_diagram_id'=>$diagram->id));\n $theme = Kohana::config('core.theme');\n $view->templates = Template::all_as_array($theme, array('page', 'list'));\n $view->post_templates = Template::all_as_array($theme, 'post');\n $view->field_types = CustomField::types();\n $view->render(TRUE);\n }" ]
[ "0.603785", "0.5749934", "0.5734008", "0.57267725", "0.56739557", "0.555863", "0.5508936", "0.5470304", "0.5448299", "0.54145736", "0.53847533", "0.53444254", "0.53359056", "0.5328699", "0.5308945", "0.5292785", "0.529139", "0.526294", "0.5229736", "0.5205726", "0.5193806", "0.51681787", "0.5146875", "0.5133485", "0.5132251", "0.5118209", "0.5115602", "0.5115219", "0.51139843", "0.50966847" ]
0.6311524
0
Handle an escalation of an interaction. This is also called when all users are forced to follow an existing interaction
public function escalated(Interaction $interaction) { $id = $interaction->id; $message = $interaction->message; $attribution = $interaction->attribution($this->site, $this->user, true); $url = $this->site->server . $this->site->root . '/cl/interact/' . $id; $announce = '<strong>Interaction has been Escalated</strong>'; $userName = $this->user->displayName; $course = $this->site->course; $courseName = $course->name; $summary = $interaction->summary; $interactDir = __DIR__ . '/../..'; $style = file_get_contents($interactDir . '/interact_content.css'); $msg = <<<MSG <style>$style</style> <div class="interact-content"> <p>$announce @$id in the $courseName <a href="$url" target="INTERACT">Interact! system</a>.</p> <p>$summary<br /> $attribution</p> $message <p>@$id escalated by $userName</p> </div> MSG; set_time_limit(120); // Determine who to send to $recipients = []; $members = new Members($this->site->db); $staff = $members->query([ 'semester'=>$this->user->member->semester, 'section'=>$this->user->member->sectionId, 'atLeast'=>Member::STAFF, 'metadata'=>true ]); foreach($staff as $staffUser) { $receiving = $staffUser->member->meta->get(Interact::INTERACT_CATEGORY, Interact::RECEIVE_ESCALATION, $staffUser->atLeast(Member::TA)); if($receiving) { $recipients[] = $staffUser; } } foreach($recipients as $recipient) { // Don't send to the escalator... if($recipient->member->id === $this->user->member->id) { continue; } $this->email->send($this->site, $recipient->email, $recipient->displayName, "$courseName Interact Escalation!: " . $summary, $msg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reactToOnAfterDealtDamage($event) { }", "public function undoFinalAdmit()\n {\n if (!is_null($this->acceptOffer) and !is_null($this->declineOffer)) {\n throw new \\Jazzee\\Exception('Cannot undo admit for an applicant with a offer response.');\n }\n $this->finalAdmit = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }", "public function reactToOnAfterTakingDamage($event) { }", "public function prevent_direct_user_input() {\n if ($this->action != SURVEYPRO_NOACTION) {\n require_sesskey();\n }\n if ($this->action == SURVEYPRO_DELETEUTEMPLATE) {\n require_capability('mod/surveypro:deleteusertemplates', $this->context);\n }\n if ($this->action == SURVEYPRO_DELETEALLITEMS) {\n require_capability('mod/surveypro:manageusertemplates', $this->context);\n }\n if ($this->action == SURVEYPRO_EXPORTUTEMPLATE) {\n require_capability('mod/surveypro:downloadusertemplates', $this->context);\n }\n }", "public function handle_dismiss_autosave_or_lock_request()\n {\n }", "public function reactToOnBeforeDealDamage($event) { }", "public function setInteractionStrategy(InteractionStrategyInterface $interactionStrategy) : void;", "private function botActionEnding(BotAction $action): void\n {\n if ($this->bots->getActiveHandler()->shouldReleaseCooldown()) {\n $action->releaseCooldown();\n }\n }", "public static function handle() {\n die(call_user_func([new self::$_class, self::$_action]));\n }", "protected abstract function onAuthorizeMissingOwner(): Effect|Response;", "private function clearAutoResponses()\n {\n $this->getEventDispatcher()->addListener(\n 'kernel.terminate',\n [$this->getAutoResponseRuleRepository(), 'clearAutoResponses']\n );\n }", "public function endConversation() {\n\t $this->expectUserResponse = false;\n }", "public function reactToOnBeforeTakingDamage($event) { }", "protected function willExecute() {\n return;\n }", "protected function tryAgain()\n {\n $this->invoice->status = 'overdue';\n if ($this->invoice->num_tries >= 3) {\n $this->invoice->status = 'error';\n }\n\n $this->invoice->try_on_date = Carbon::tomorrow(env('TIMEZONE'))->timezone('UTC');\n $this->invoice->increment('num_tries');\n $this->invoice->save();\n\n event(new InvoiceWasNotPaid($this->invoice));\n }", "public function afterUserMethodAdvice()\n {\n }", "public function ability() {\n\n $this->startMove(3, 0.2);\n echo \"THE ENGINE IS OVERHEATED!\\n\";\n $this->switchEngine();\n\n\n\n\n }", "public function reactToOnAfterAction($event) { }", "public function handle(): void\n {\n Delegate::pending()->each(function ($delegate) {\n if ($delegate->claimHasExpired()) {\n $delegate->reset();\n }\n });\n }", "public function handle()\n {\n\n // auto debit the delivered order which hasn't been confirmed \"received\" by user after 1 hour.\n $this->lockDeliveredOrder();\n\n // also sweep order in STATUS_ORDERED to become expired in 5 hours after travel limit time\n $this->changeOldOrderFlag();\n\n Event::fire(new ProfitChanged(User::SYSTEM_USER));\n }", "public function setExcavateReply(Down_ExcavateReply $value)\n {\n return $this->set(self::_EXCAVATE_REPLY, $value);\n }", "public function postDelete($interaction)\n {\n // Was the ad deleted?\n if($interaction->delete()) {\n // Redirect to the ad management page\n return Redirect::to('admin/successful-delete')->with('success', Lang::get('admin/interactions/messages.delete.success'));\n }\n\n // There was a problem deleting the ad\n return Redirect::to('admin/interactions')->with('error', Lang::get('admin/interactions/messages.delete.error'));\n }", "public function handle()\n {\n (new RefundModule())->autoExpireRefund();\n }", "public function undoFinalDeny()\n {\n $this->finalDeny = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }", "protected function handleItself()\n {\n if ($this->isMoved($this->event)) {\n if ($this->getResource()->exists() && $this->addWatch() === $this->id) {\n return;\n }\n\n $this->unwatch($this->id);\n }\n\n if ($this->getResource()->exists()) {\n if ($this->isIgnored($this->event) || $this->isMoved($this->event) || !$this->id) {\n $this->setEvent($this->id ? IN_MODIFY : IN_CREATE);\n $this->watch();\n }\n } elseif ($this->id) {\n $this->event = IN_DELETE;\n $this->getBag()->remove($this);\n $this->unwatch($this->id);\n $this->id = null;\n }\n }", "public function onPlayerInteract(Player $player) : void {\n\t}", "public function stopImpersonateUser(): void\n {\n $this->impersonateUser = null;\n }", "private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }", "public function handle()\n {\n MakeUnattachedGovernmentsInActive::dispatch();\n }", "function act() {\n throw $this->exception;\n }" ]
[ "0.5407917", "0.52230626", "0.5199871", "0.50991845", "0.5069394", "0.50540364", "0.4964697", "0.49339163", "0.4917487", "0.480529", "0.47932002", "0.4739742", "0.46850604", "0.46784502", "0.4669317", "0.4659351", "0.46370843", "0.4570588", "0.4567197", "0.45294803", "0.4529343", "0.4523344", "0.45159107", "0.44868037", "0.44843954", "0.4477222", "0.44436973", "0.4439413", "0.44366884", "0.4425753" ]
0.70590514
0
Replace the target attribute of link tags in processedContent with the target specified by externalLinkTarget and resourceLinkTarget options. Additionally set rel="noopener" for links with target="_blank".
protected function replaceLinkTargets(string $processedContent): string { $noOpenerString = $this->fusionValue('setNoOpener') ? ' rel="noopener"' : ''; $externalLinkTarget = trim($this->fusionValue('externalLinkTarget')); $resourceLinkTarget = trim($this->fusionValue('resourceLinkTarget')); if ($externalLinkTarget === '' && $resourceLinkTarget === '') { return $processedContent; } $controllerContext = $this->runtime->getControllerContext(); $host = $controllerContext->getRequest()->getHttpRequest()->getUri()->getHost(); $processedContent = preg_replace_callback( '~<a.*?href="(.*?)".*?>~i', function ($matches) use ($externalLinkTarget, $resourceLinkTarget, $host, $noOpenerString) { list($linkText, $linkHref) = $matches; $uriHost = parse_url($linkHref, PHP_URL_HOST); $target = null; if ($externalLinkTarget !== '' && is_string($uriHost) && $uriHost !== $host) { $target = $externalLinkTarget; } if ($resourceLinkTarget !== '' && strpos($linkHref, '_Resources') !== false) { $target = $resourceLinkTarget; } if ($target === null) { return $linkText; } if (preg_match_all('~target="(.*?)~i', $linkText, $targetMatches)) { return preg_replace( '/target=".*?"/', sprintf('target="%s"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText ); } return str_replace( '<a', sprintf('<a target="%s"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText ); }, $processedContent ) ?: ''; return $processedContent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function replaceLinkTargets($processedContent)\n {\n $noOpenerString = $this->fusionValue('setNoOpener') ? ' rel=\"noopener\"' : '';\n $externalLinkTarget = trim($this->fusionValue('externalLinkTarget'));\n $resourceLinkTarget = trim($this->fusionValue('resourceLinkTarget'));\n if ($externalLinkTarget === '' && $resourceLinkTarget === '') {\n return $processedContent;\n }\n $controllerContext = $this->runtime->getControllerContext();\n $host = $controllerContext->getRequest()->getHttpRequest()->getUri()->getHost();\n $processedContent = preg_replace_callback(\n '~<a.*?href=\"(.*?)\".*?>~i',\n function ($matches) use ($externalLinkTarget, $resourceLinkTarget, $host, $noOpenerString) {\n list($linkText, $linkHref) = $matches;\n $uriHost = parse_url($linkHref, PHP_URL_HOST);\n $target = null;\n if ($externalLinkTarget !== '' && is_string($uriHost) && $uriHost !== $host) {\n $target = $externalLinkTarget;\n }\n if ($resourceLinkTarget !== '' && strpos($linkHref, '_Resources') !== false) {\n $target = $resourceLinkTarget;\n }\n if ($target === null) {\n return $linkText;\n }\n if (preg_match_all('~target=\"(.*?)~i', $linkText, $targetMatches)) {\n return preg_replace('/target=\".*?\"/', sprintf('target=\"%s\"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText);\n }\n return str_replace('<a', sprintf('<a target=\"%s\"%s', $target, $target === '_blank' ? $noOpenerString : ''), $linkText);\n },\n $processedContent\n );\n return $processedContent;\n }", "function links_add_target($content, $target = '_blank', $tags = array('a'))\n {\n }", "function _links_add_target($m)\n {\n }", "function getLinkTarget() {return $this->_linktarget;}", "public function setModifyLink($link, $target = '_self')\n {\n $this->modifyLink = $link;\n $this->modifyLinkTarget = $target;\n return $this;\n }", "function my_avf_admin_bar_link_target_frontend( $target, $context )\n{\n\tswitch( $context )\n\t{\n\t\tcase 'edit_button':\n\t\tcase 'dynamic_template':\n\t\tcase 'theme_options':\n\t\tcase 'edit_button_gutenberg':\n\t\t\t$target = '_blank';\n\t\t\tbreak;\n\t}\n\t\n\treturn $target;\n}", "function wp_remove_targeted_link_rel_filters()\n {\n }", "public function getItemLinkTarget()\n {\n return $this->getEntity()->getData('target_blank');\n }", "public function appendHyperlink(?string $href = null, mixed $content = null, ?string $target = null): A;", "public static function popup_links($text) {\n\t\t// Right now it's a moderately dumb function, ideally it would detect whether\n\t\t// a target or rel attribute was already there and adjust its actions accordingly.\n\t\t$text = preg_replace('/<a (.+?)>/i', \"<a $1 target='_blank' rel='external'>\", $text);\n\t\treturn $text;\n\t}", "public function http_makelinks($data, $conf)\n {\n $aTagParams = $this->getATagParams($conf);\n $textstr = '';\n foreach ([ 'http://', 'https://' ] as $scheme) {\n $textpieces = explode($scheme, $data);\n $pieces = count($textpieces);\n $textstr = $textpieces[0];\n for ($i = 1; $i < $pieces; $i++) {\n $len = strcspn($textpieces[$i], chr(32) . TAB . CRLF);\n if (trim(substr($textstr, -1)) === '' && $len) {\n $lastChar = substr($textpieces[$i], $len - 1, 1);\n if (!preg_match('/[A-Za-z0-9\\\\/#_-]/', $lastChar)) {\n $len--;\n }\n // Included '\\/' 3/12\n $parts[0] = substr($textpieces[$i], 0, $len);\n $parts[1] = substr($textpieces[$i], $len);\n $keep = $conf['keep'];\n $linkParts = parse_url($scheme . $parts[0]);\n $linktxt = '';\n if (strstr($keep, 'scheme')) {\n $linktxt = $scheme;\n }\n $linktxt .= $linkParts['host'];\n if (strstr($keep, 'path')) {\n $linktxt .= $linkParts['path'];\n // Added $linkParts['query'] 3/12\n if (strstr($keep, 'query') && $linkParts['query']) {\n $linktxt .= '?' . $linkParts['query'];\n } elseif ($linkParts['path'] === '/') {\n $linktxt = substr($linktxt, 0, -1);\n }\n }\n if (isset($conf['extTarget'])) {\n if (isset($conf['extTarget.'])) {\n $target = $this->stdWrap($conf['extTarget'], $conf['extTarget.']);\n } else {\n $target = $conf['extTarget'];\n }\n } else {\n $target = $this->getTypoScriptFrontendController()->extTarget;\n }\n\n // check for jump URLs or similar\n $linkUrl = $this->processUrl(UrlProcessorInterface::CONTEXT_COMMON, $scheme . $parts[0], $conf);\n\n $res = '<a href=\"' . htmlspecialchars($linkUrl) . '\"'\n . ($target !== '' ? ' target=\"' . htmlspecialchars($target) . '\"' : '')\n . $aTagParams . $this->extLinkATagParams(('http://' . $parts[0]), 'url') . '>';\n\n $wrap = isset($conf['wrap.']) ? $this->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];\n if ((string)$conf['ATagBeforeWrap'] !== '') {\n $res = $res . $this->wrap($linktxt, $wrap) . '</a>';\n } else {\n $res = $this->wrap($res . $linktxt . '</a>', $wrap);\n }\n $textstr .= $res . $parts[1];\n } else {\n $textstr .= $scheme . $textpieces[$i];\n }\n }\n $data = $textstr;\n }\n return $textstr;\n }", "protected function pakTargetAttr(): string\n {\n return $this->extern ? \" target='_blank' \" : \"\";\n }", "function wp_targeted_link_rel($text)\n {\n }", "public function link(string $target, string $link): Promise;", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "protected function fix_supporting_file_references() {\r\n\t\tpreg_match_all('/<link([^<>]*?) href=\"([^\"]*?)\"([^<>]*?)\\/>/is', $this->code, $link_matches);\r\n\t\t/*$counter = sizeof($link_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t\r\n\t\t\t$counter--;\r\n\t\t}*/\r\n\t\t$array_replaces = array();\r\n\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t$href_content = $link_matches[2][$index];\r\n\t\t\tif($href_content[0] === '/' || strpos($href_content, 'http://') !== false) { // avoid root references and URLs\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$initial_href_content = $href_content;\r\n\t\t\t\t\t// first try looking closer\r\n\t\t\t\t\t$proper_reference = false;\r\n\t\t\t\t\twhile(!$proper_reference && substr($href_content, 0, 3) === '../') {\r\n\t\t\t\t\t\t$href_content = substr($href_content, 3);\r\n\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // try looking farther\r\n\t\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\t\twhile(!$proper_reference && $counter < 10) {\r\n\t\t\t\t\t\t\t$href_content = '../' . $href_content;\r\n\t\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$counter++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // give up or finish\r\n\t\t\t\t\t\tvar_dump($this->file, $href_content, $relative_path);exit(0);\r\n\t\t\t\t\t\tprint('<span style=\"color: red;\">Could not fix broken reference in &lt;link&gt;: ' . $value . '</span>');exit(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->logMsg('Reference ' . htmlentities($value) . ' was fixed.');\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\tforeach($array_replaces as $index => $value) {\r\n\t\t\t$this->code = str_replace($index, $value, $this->code);\r\n\t\t}\r\n\t}", "public function setTarget( $target )\n\t{\n\t\t$this->setAttribute( \"target\", $target );\n\t}", "public function setTarget($target)\n\t{\n\t\t// To do: verify format\n\t\t$this->target = $target;\n\t\t$this->setAttribute('target',$target); // set attribute in DOM\n\t}", "public function resolveLink(ManualLinkResolverEvent $event): void {\n $link_entity = $this->entityRepository->getTranslationFromContext($event->getLinkEntity());\n if ($link_entity->bundle() !== 'internal_media') {\n return;\n }\n\n $referenced_media = $link_entity->get('media_target')->entity;\n if (!$referenced_media instanceof MediaInterface) {\n // If the Media entity was deleted, we cannot resolve anything anymore.\n return;\n }\n\n /** @var \\Drupal\\media\\MediaInterface $referenced_media */\n $referenced_media = $this->entityRepository->getTranslationFromContext($referenced_media);\n\n // Dispatch an event to turn the referenced media into a Link object.\n // We default to the oe_link_lists defaults and go with an empty teaser\n // as we don't have a field to map to the teaser. Modules that add fields\n // to the media can subscribe to this event and fill in the teaser.\n $resolver_event = new EntityValueResolverEvent($referenced_media);\n $this->eventDispatcher->dispatch($resolver_event, EntityValueResolverEvent::NAME);\n $link = $resolver_event->getLink();\n $link->addCacheableDependency($referenced_media);\n\n // Override the title and teaser if needed.\n if (!$link_entity->get('title')->isEmpty()) {\n $link->setTitle($link_entity->getTitle());\n }\n if (!$link_entity->get('teaser')->isEmpty()) {\n $link->setTeaser(['#markup' => $link_entity->getTeaser()]);\n }\n\n // Dispatch an event to allow others to perform overrides on the link.\n $override_event = new EntityValueOverrideResolverEvent($referenced_media, $link_entity, $link);\n $this->eventDispatcher->dispatch($override_event, EntityValueOverrideResolverEvent::NAME);\n $event->setLink($override_event->getLink());\n $event->stopPropagation();\n }", "public function getSourceLink(Array $parameters = array()){\n if(!empty($this->website)){\n $name = str_replace('http://','',$this->website);\n $name = str_replace('www.','',$name);\n $name = preg_replace('/\\/.*/u','',$name);\n $parameters['target'] = '_blank';\n return HTML::anchor('/catalog/goto/' . $this->id, $name, $parameters);\n }\n return NULL;\n }", "public function replaceInternalHtmlLinks($usingUrlParam=false)\n\t{\n\t\t$this->html = preg_replace_callback('/(src|href)=([\"\\'])(?!(([\"\\'])?https?:|([\"\\'])?\\/\\/))(.*?)\\2/i', function ($matches) use ($usingUrlParam) {\n return $matches[1] . '=' . $matches[2]\n . rtrim($this->proxyPath, '/')\n . (\n\t\t\t\t\t$usingUrlParam\n\t\t\t\t\t\t? urlencode('/' . ltrim(htmlspecialchars_decode($matches[6]), '/')) # url encode when using url param method\n\t\t\t\t\t\t: '/' . ltrim($matches[6], '/')\n\t\t\t\t)\n . $matches[2];\n }, $this->html);\n\t}", "function linkify_external($s) {\n $s = linkify($s);\n\n $s = '<p>' . $s . '</p>';\n $dom = str_get_html($s);\n\n foreach ($dom->nodes as $el) {\n if ($el->tag == 'a') {\n $el->rel = 'nofollow';\n $el->target = '_blank';\n }\n }\n\n return substr($dom->save(), 3, -4);\n\n }", "function _hyperlinkUrls($text, $mode = '0', $trunc_before = '', $trunc_after = '...', $open_in_new_window = true) {\n\t\t$text = ' ' . $text . ' ';\n\t\t$new_win_txt = ($open_in_new_window) ? ' target=\"_blank\"' : '';\n\n\t\t# Hyperlink Class B domains\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-\\.]+)\\.(com|org|net|gov|edu|us|info|biz|ws|name|tv|eu|mobi)((?:/[^\\s{}\\(\\)\\[\\]]*[^\\.,\\s{}\\(\\)\\[\\]]?)?)#ie\", \"'$1<a href=\\\"http://$2.$3$4\\\" title=\\\"http://$2.$3$4\\\"$new_win_txt>' . $this->_truncateLink(\\\"$2.$3$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink anything with an explicit protocol\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])(([a-z]+?)://([A-Za-z_0-9\\-]+\\.([^\\s{}\\(\\)\\[\\]]+[^\\s,\\.\\;{}\\(\\)\\[\\]])))#ie\", \"'$1<a href=\\\"$2\\\" title=\\\"$2\\\"$new_win_txt>' . $this->_truncateLink(\\\"$4\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\t# Hyperlink e-mail addresses\n\t\t$text = preg_replace(\"#([\\s{}\\(\\)\\[\\]])([A-Za-z0-9\\-_\\.]+?)@([^\\s,{}\\(\\)\\[\\]]+\\.[^\\s.,{}\\(\\)\\[\\]]+)#ie\", \"'$1<a href=\\\"mailto:$2@$3\\\" title=\\\"mailto:$2@$3\\\">' . $this->_truncateLink(\\\"$2@$3\\\", \\\"$mode\\\", \\\"$trunc_before\\\", \\\"$trunc_after\\\") . '</a>'\", $text);\n\n\t\treturn substr($text, 1, strlen($text) - 2);\n\t}", "public function processReferencedLink(Text $text, array $options = array())\n {\n if (!$text->contains('[')) {\n return;\n }\n\n /** @noinspection PhpUnusedParameterInspection */\n $text->replace('{\n #( # wrap whole match in $1\n \\[\n (' . $this->getNestedBrackets() . ') # link text = $2\n \\]\n\n [ ]? # one optional space\n (?:\\n[ ]*)? # one optional newline followed by spaces\n\n \\[\n (.*?) # id = $3\n \\]\n #)\n }xs', function (Text $whole, Text $linkText, Text $id = null) use ($options) {\n if (is_null($id) || (string) $id == '') {\n $id = new Text($linkText);\n }\n\n $id->lower();\n\n if ($this->markdown->getUrlRegistry()->exists($id)) {\n $url = new Text($this->markdown->getUrlRegistry()->get($id));\n $url->escapeHtml()->replace('/(?<!\\\\\\\\)_/', '\\\\\\\\_');\n $this->markdown->emit('escape.special_chars', [$url]);\n\n $linkOptions = [\n 'href' => $url->getString(),\n ];\n\n if ($this->markdown->getTitleRegistry()->exists($id)) {\n $title = new Text($this->markdown->getTitleRegistry()->get($id));\n $linkOptions['title'] = $title->escapeHtml()->getString();\n }\n\n return $this->getRenderer()->renderLink($linkText->getString(), $linkOptions);\n } else {\n if ($options['strict']) {\n throw new SyntaxError(\n sprintf('Unable to find id \"%s\" in Reference-style link', $id),\n $this, $whole, $this->markdown\n );\n }\n\n return $whole;\n }\n });\n }", "public function makeClickableLinks()\n {\n $this->texte = trim(preg_replace(\n \"#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i\",\n \"$1$3</a>\",\n preg_replace_callback(\n '#([\\s>])((www|ftp)\\.[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches, 'http://');\n },\n preg_replace_callback(\n '#([\\s>])([\\w]+?://[\\w\\\\x80-\\\\xff\\#$%&~/.\\-;:=,?@\\[\\]+]*)#is',\n function ($matches) {\n return $this->makeClickableUrlCallback($matches);\n },\n ' '.$this->texte\n )\n )\n ));\n\n return $this;\n }", "function adabs_link( $wp_admin_bar ) {\n $args = array(\n 'id' => '',\n 'title' => '',\n 'href' => 'https://adabs.ch',\n 'meta' => array( 'target' => '_blank', 'rel' => 'noopener' ),\n 'parent' => 'top-secondary'\n );\n\t$wp_admin_bar->add_node( $args );\n}", "function wp_init_targeted_link_rel_filters()\n {\n }", "function replace_links($content) {\r\n\tpreg_match_all(\"/<a\\s*[^>]*>(.*)<\\/a>/siU\", $content, $matches);\r\n\t//preg_match_all(\"/<a\\s[^>]*>(.*?)(</a>)/siU\", $content, $matches);\t\r\n\t$foundLinks = $matches[0];\r\n\t$wpbar_options = get_option(\"wpbar_options\");\r\n\t\r\n\tforeach ($foundLinks as $theLink) {\r\n\t\t$uri = getAttribute('href',$theLink);\r\n\t\tif($wpbar_options[\"validateURL\"]) {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink) && isValidURL($uri)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif(!isWhiteListed(get_domain($uri)) && !isSociable($theLink)) {\r\n\t\t\t\t$uid = isInDB($uri);\r\n\t\t\t\t$nofollow = is_nofollow($uid) ? \"rel='nofollow'\" : \"\";\r\n\t\t\t\t$content=str_replace(\"href=\\\"\".$uri.\"\\\"\",\"title='Original Link: \".$uri.\"' \".$nofollow.\" href=\\\"\".get_option('home').\"/?\".$uid.\"\\\"\",$content);\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\treturn $content;\r\n}", "function render_external_link($text, $link, $params = array(), $no_banner = true,\n $alt_src = null) {\n if (is_mobile() || $no_banner) {\n $params = array_merge($params, array('target' => '_blank'));\n } else {\n $link = BASE_URL.'ex/?s='.urlencode($link);\n if ($alt_src) {\n $link .= '&a='.urldecode($alt_src);\n }\n }\n return render_link_helper($text, $link, false, $params);\n}", "public function replaceInternalCssLinks($usingUrlParam=false)\n\t{\n\t\t$this->html = preg_replace_callback('/url\\(([\"\\'])?(?!(([\"\\'])?https?:|([\"\\'])?\\/\\/))(.*?)([\"\\'])?\\)/i', function ($matches) use ($usingUrlParam) {\n\t\t\treturn 'url(' . $matches[1] . rtrim($this->proxyPath, '/') . '/'\n\t\t\t\t. (\n\t\t\t\t\t$usingUrlParam\n\t\t\t\t\t\t? urlencode(ltrim(htmlspecialchars_decode($matches[5]), '/')) # url encode when using url param method\n\t\t\t\t\t\t: ltrim($matches[5], '/')\n\t\t\t\t)\n\t\t\t\t. $matches[1] . ')';\n\t\t}, $this->html);\n\t}" ]
[ "0.70427173", "0.5915139", "0.5091102", "0.4963319", "0.4935978", "0.48445374", "0.48383734", "0.48188233", "0.47685763", "0.47677878", "0.47554263", "0.4685721", "0.4653619", "0.46294224", "0.46191883", "0.46089977", "0.45970786", "0.45853704", "0.4580751", "0.45305595", "0.4525025", "0.45154276", "0.4503806", "0.4487304", "0.44749576", "0.4452837", "0.44294587", "0.44222635", "0.44203532", "0.44157672" ]
0.66873354
1
Gets user information for a given user Returns the contents of the usertable if the user is found or false
public function getInformation( $userid ) { $this->debug->guard( ); $sql = $this->database->prepare( "SELECT * FROM " . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_users' ) . " WHERE user_id = ?" ); $sql->bindParam( 1, $userid ); if ( !$sql->execute( ) ) { $this->debug->write( 'Problem getting user information: could not read from users table', 'warning' ); $this->messages->setMessage( 'Problem getting user information: could not read from users table', 'warning' ); $this->debug->unguard( false ); return false; } if ( $sql->rowCount( ) > 0 ) { $ret = $sql->fetch( PDO::FETCH_ASSOC ); $this->debug->unguard( $ret ); return $ret; } $this->debug->write( 'Problem getting user information: user not found', 'warning' ); $this->messages->setMessage( 'Problem getting user information: user not found', 'warning' ); $this->debug->unguard( false ); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProfileInfo($user){\n\t\tglobal $db;\n\t\t$sql = \"SELECT * from personalinfo WHERE user_email ='$user'\";\n\t\t$result =$db->query($sql);\n\t\t$infotable = $result->fetch_assoc();\n\t\treturn $infotable;\n\t}", "public static function retrieveUserInformation($user) {\n return R::find('user', 'username = ? ', [ $user ]);\n }", "function getUserInfo($user='',$field='')\r\n\t{\r\n\t\tif($user != '')\r\n\t\t{\r\n\t\t\t$sql = $GLOBALS['db']->Query(\"SELECT $field FROM \" . PREFIX . \"_users WHERE Status = '1' AND Id = '$user'\");\r\n\t\t\t$row = $sql->fetchrow();\r\n\t\t\t$sql->close();\r\n\t\t\treturn $row->$field;\r\n\t\t}\r\n\t}", "public static function get_user($user_id);", "public function user_information($user_name)\n {\n $url = preg_replace('/set/i', 'user:' . $user_name, $this->public_url);\n return $this->curl($url)->user;\n }", "public function getUserInfo($user_id){\n $sql=\"SELECT * FROM `users` INNER JOIN `accounts` ON users.account_id=accounts.account_id WHERE user_id='$user_id'\";\n $result=$this->conn->query($sql);\n\n if($result==true){\n return $result->fetch_assoc();\n }\n }", "public function getUserInfoByID($userid) {\n $stmt = $this->db->query(\"SELECT * FROM users WHERE userid = $userid\");\n $stmt->execute();\n if ($row = $stmt->fetch()) {\n return $row;\n } else {\n return false;\n }\n }", "public function getInfosUser()\n\t{\n\t\t$sql = \"SELECT * FROM utilisateur WHERE ut_mail=?\";\n\t\t$res = $this -> executerRequete($sql,array($this->email));\n\t\tif($result = $res->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse return false;\n\t}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "public function return_user_fulldata( $user ){\n //Clean variable for input\n $user = $this->main->prepare_sql_input( $user );\n //Prepare sql query\n $query =\n ' SELECT t1.*,\n\t\t\t\t\t\t t2.NivelUsuNombre,\n\t\t\t\t\t\t t3.TipoUsuNombre,\n\t\t\t\t\t\t t4.FacultadNombre,\n\t\t\t\t\t\t t5.LicenciaturaNombre\n\t\t\tFROM Usuario AS t1\n\t\t\tLEFT JOIN NivelUsuario as t2\n\t\t\tON t1.NivelUsuId = t2.NivelUsuId\n\t\t\tLEFT JOIN TipoUsuario as t3\n\t\t\tON t1.TipoUsuId = t3.TipoUsuId\n\t\t\tLEFT JOIN Facultad as t4\n\t\t\tON t1.FacultadId = t4.FacultadId\n\t\t\tLEFT JOIN Licenciatura as t5\n\t\t\tON t1.LicenciaturaId = t5.LicenciaturaId\n WHERE \tt1.UsuarioAcceso = ?\n LIMIT 1\n ';\n //Execute query with security scape variables\n\t\t$result = $this->db->query( $query,array($user) );\n\n\t\t//Check if user exists and return data\n\t\tif( $result->num_rows() > 0 ){\n\t\t\t$data = $result->row();\n\t\t}\n\t\telse {\n\t\t\t$data = false;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function get_user_info()\n\t{\n\t\tif ( function_exists('wp_remote_get') ) {\n\t\t\t$json = wp_remote_get($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json['body'], true);\n\t\t} else {\n\t\t\t$json = @file_get_contents($this->API_URL . '?username='. $this->user);\n\t\t\t$user_info = @json_decode($json, true);\n\t\t}\n\t\t\n\t\treturn $user_info['resp'];\n\t}", "function getUserById($user_id)\n\t{\n\t\t$user_info = false;\n\t\t\n\t\tif (is_numeric($user_id) && $user_id>0) {\n\t\t\t$this->db->where(array( 'id' => $user_id, 'activated' => 1));\n\t\t\t$query = $this->db->get($this->table_name);\n\t\t\t$num_rows = $query->num_rows();\n\t\t\tif ($num_rows == 1) {\n\t\t\t\t$users_info = $query->result();\n\t\t\t\t$user_info = $users_info[0];\n\n\t\t\t} elseif ($num_rows > 2) {\n\t\t\t\t// ---------------------------------------- \n\t\t\t\t// @TODO mandar un correo de aviso.\n\t\t\t\t// ----------------------------------------\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $user_info;\n\t}", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "public function get_info()\n {\n // if database connection opened\n if ($this->databaseConnection()) {\n // try to update user with specified information\n $query_user = $this->db_connection->prepare('SELECT * FROM directory WHERE username = :user_name AND id = :id');\n $query_user->bindValue(':user_name', $_SESSION['user_name'], PDO::PARAM_STR);\n $query_user->bindValue(':id', $_SESSION['user_id'], PDO::PARAM_STR);\n $query_user->execute();\n\n if ($query_user->rowCount() > 0) {\n return $query_user->fetchObject();\n } else {\n return false;\n }\n }\n }", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\n}", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "function User_Info($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\t$R=j::SQL(\"SELECT * FROM jfp_xuser AS XU JOIN jf_users AS U ON (U.ID=XU.ID) WHERE XU.ID=?\",$UserID);\n\t\tif ($R) return $R[0];\n\t\telse return null;\n\t}", "function getUserInfo($uid)\n {\n $rs = db()->select(\n 'user.username, user.password, attrib.*'\n , [\n '[+prefix+]manager_users user',\n 'INNER JOIN [+prefix+]user_attributes attrib ON ua.internalKey=user.id'\n ]\n , sprintf(\"user.id='%s'\", db()->escape($uid))\n );\n if (db()->count($rs) == 1) {\n $row = db()->getRow($rs);\n if (!isset($row['usertype'])) {\n $row['usertype'] = 'manager';\n }\n if (!isset($row['failedlogins'])) {\n $row['failedlogins'] = 0;\n }\n return $row;\n }\n return false;\n }", "public function getMyAccountInfo()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n $user = array_pop($user);\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'Successfully retrieved user info';\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "abstract public function getUserInfo();", "function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }", "public function getUserInformation($uid, User &$userObject = null);", "public function getUser($user = null) {\n\t\t\t$user = $user == null ? $user = $this->user : $user;\n\t\t\t$get_user_sql = \"SELECT * FROM `po-users` WHERE `id` = :id ORDER BY `id` LIMIT 1\";\n\t\t\t$get_user_query = $this->getConnection()->prepare($get_user_sql);\n\t\t\t$get_user_query->bindParam(\":id\", $user);\n\t\t\t$get_user_query->execute();\n\t\t\treturn $get_user_query->fetch(PDO::FETCH_ASSOC);\n\t\t}", "public function getUserInfo($user_name) {\n $query = \"SELECT * FROM users WHERE user_name = '%s'\";\n $vals = Array();\n $vals[] = $user_name;\n $user_info = $this->read_one($query, $vals);\n return $user_info;\n }", "public function UserDetails($user_id=\"\"){\n\t\t\t$broker_userdet = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$broker_userdet->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $broker_userdet->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "public function public_user_data($user_name)\n {\n $url = preg_replace('/set/i', 'user:' . $user_name, $this->public_url);\n return $this->curl($url)->user;\n }", "function user_info($u = false)\n{\n global $idx, $user;\n\n $u = $u ? $u : $user;\n $result = @sqlite_unbuffered_query($idx, \"SELECT * FROM users WHERE username='\" . sqlite_escape_string($u) . \"'\");\n if (!$result) {\n return false;\n }\n\n return sqlite_fetch_array($result, SQLITE_ASSOC);\n}", "private function getUser()\n {\n if ($this->userData['id']) {\n $user = gateway('northstar')->asClient()->getUser($this->userData['id']);\n\n if ($user && $user->id) {\n info('Found user by id', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if ($this->userData['email']) {\n $user = gateway('northstar')->asClient()->getUserByEmail($this->userData['email']);\n\n if ($user && $user->id) {\n info('Found user by email', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if (! isset($this->userData['mobile'])) {\n return null;\n }\n\n $user = gateway('northstar')->asClient()->getUserByMobile($this->userData['mobile']);\n\n if ($user && $user->id) {\n info('Found user by mobile', ['user' => $user->id]);\n\n return $user;\n }\n\n return null;\n }", "public function getUser();" ]
[ "0.7075433", "0.6991077", "0.6984418", "0.6941098", "0.69405437", "0.6934852", "0.68880785", "0.6868895", "0.6860437", "0.6852069", "0.68350416", "0.680874", "0.6804602", "0.67736745", "0.6772155", "0.67243004", "0.67113876", "0.66955745", "0.6679575", "0.6675333", "0.66741836", "0.6667911", "0.66619897", "0.6651452", "0.66478014", "0.6646074", "0.6635495", "0.66324335", "0.6631801", "0.6627896" ]
0.70491934
1
Gets the confirmation key for a given user Returns the confirmation key if the user is found or false
public function getConfirmationKey( $userid ) { $this->debug->guard( ); $sql = $this->database->prepare( "SELECT * FROM " . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_userconfirmation' ) . " WHERE userconfirmation_user = ?" ); $sql->bindParam( 1, $userid ); if ( !$sql->execute( ) ) { $this->debug->write( 'Problem confirming a user: could not read from user confirmation table', 'warning' ); $this->messages->setMessage( 'Problem confirming a user: could not read from user confirmation table', 'warning' ); $this->debug->unguard( false ); return false; } if ( $sql->rowCount( ) > 0 ) { $row = $sql->fetch( PDO::FETCH_ASSOC ); $ret = $row[ 'userconfirmation_key' ]; $this->debug->unguard( $ret ); return $ret; } $this->debug->write( 'Problem confirming a user: key not found for given user', 'warning' ); $this->messages->setMessage( 'Problem confirming a user: key not found for given user', 'warning' ); $this->debug->unguard( false ); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function getUserFromKey() {\n\t\tstatic $user;\n\t\t\n\t\tif ($user === null) {\n\t\t\t$user = false;\n\t\t\tif ($key = Request::getGET('key')) {\n\t\t\t\t$l = User::getUsers();\n\t\t\t\t$l = $l->filter($l->exprEqual($l->exprMember('unconfirmedEmailKey'),\n\t\t\t\t\t$key));\n\t\t\t\tif ($l->getCount() == 1)\n\t\t\t\t\t$user = $l->get(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($user === false)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn $user;\n\t}", "public function checkConfirmation( $confirmationkey )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\t$sql = $this->database->prepare( \"SELECT * FROM \" . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_userconfirmation' ) . \" WHERE userconfirmation_key = ?\" );\r\n\t\t$sql->bindParam( 1, $confirmationkey );\r\n\r\n\t\tif ( !$sql->execute( ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem confirming a user: could not read from user confirmation table', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem confirming a user: could not read from user confirmation table', '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\tif ( $sql->rowCount( ) > 0 )\r\n\t\t{\r\n\t\t\t$row = $sql->fetch( PDO::FETCH_ASSOC );\r\n\t\t\t$ret = $row[ 'userconfirmation_user' ];\r\n\r\n\t\t\t$this->debug->unguard( $ret );\r\n\t\t\treturn $ret;\r\n\t\t}\r\n\r\n\t\t$this->debug->write( 'Problem confirming a user: given key not found', 'warning' );\r\n\t\t$this->messages->setMessage( 'Problem confirming a user: given key not found', 'warning' );\r\n\t\t$this->debug->unguard( false );\r\n\t\treturn false;\r\n\t}", "protected function generateConfirmationCode()\n {\n $this->attributes['user_activation_key'] = Hash::make($this->user_email . time());\n\n if (is_null($this->attributes['user_activation_key']))\n return false; // failed to create user_activation_key\n else\n return true;\n }", "public function getConfirmUser($tokenKey){\n $this->db->query('SELECT * FROM users WHERE us_token = :tokenKey');\n // Bind values\n $this->db->bind(':tokenKey', $tokenKey);\n $row = $this->db->single();\n return $row;\n }", "abstract protected function getConfirmationSecret();", "public static function getVerificationKey() {\n return $_SESSION['user']['verified'];\n }", "public function userFromKey($key){\r\n $query = $this->conn->prepare('SELECT `user_id` FROM `user` WHERE confirmationKey = :key'); // Création de la requête + utilisation order by pour ne pas utiliser sort\r\n $query->execute([':key' => $key ]); // Exécution de la requête\r\n return $query->fetch(\\PDO::FETCH_ASSOC);\r\n\r\n }", "function get_user_api_key() {\n $currentUser = current_user();\n if ($currentUser) {\n $db = get_db();\n $res = $db->getTable('Key')->findBy(array('user_id' => $currentUser->id));\n if (sizeof($res) > 0) {\n return $res[0]->key;\n }\n }\n}", "public static function getAuthKey($userType)\n {\n return isset(self::$_auth_keys[$userType]) ?\n self::$_auth_keys[$userType] : false;\n }", "public function findUserByConfirmationToken($token);", "public function findUserByConfirmationToken($token);", "public function findUserByConfirmationToken($token);", "public function CheckActivationKeyExists( )\n\t\t{\n\t\t\t$dataArray = array(\n \"activationKey\"=>$this->activationKey\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/CheckActivationKeyExists/123\", \"json\" );\n \n return $response;\n\t\t}", "public function get_confirm($user_id=0, $confirmation_code=0) {\n \n // If not information was provider, show the confirmation form\n if($user_id==0) {\n return View::make('login.confirm'); \n } else {\n // Confirm the account\n $user = User::where('id', '=', $user_id)\n ->where('confirmation_code', '=', $confirmation_code)\n ->first();\n\n if(is_null($user)) {\n return View::make('login.confirm')->with('confirm_error', true);\n } else {\n // Confirmed\n $user->confirmed='Y';\n $user->confirmation_code=null;\n $user->save();\n\n $this->successes[] = \"Your account has been confirmed successfully.\";\n //Session::put('successes', serialize($this->successes));\n\n // if the user is not logged in it will be redirected to the login page.\n if (Auth::guest()) return Redirect::to('login')->with('successes', serialize($this->successes));\n\n return Redirect::to('dashboard'); \n }\n }\n \n }", "function user_confirm() {\n // I'm not passing in any values or declaring globals\n global $supersecret_hash_padding;\n\n // Verify that they didn't tamper with the email address\n $new_hash = md5($_GET['email'].$supersecret_hash_padding);\n if ($new_hash && ($new_hash == $_GET['hash'])) {\n $query = \"SELECT user_name\n FROM user\n WHERE confirm_hash = '$new_hash'\";\n $result = mysql_query($query);\n if (!$result || mysql_num_rows($result) < 1) {\n $feedback = 'ERROR - Hash not found';\n return $feedback;\n } else {\n // Confirm the email and set account to active\n $email = $_GET['email'];\n $hash = $_GET['hash'];\n $query = \"UPDATE user SET email='$email', is_confirmed=1 WHERE confirm_hash='$hash'\";\n $result = mysql_query($query);\n return 1;\n }\n } else {\n $feedback = 'ERROR - Values do not match';\n return $feedback;\n }\n}", "public function get_activation_key($email_or_username){\n\t\t$sql = \"select * from admin where email='$email_or_username' or username='$email_or_username'\";\n\t\tif ($this->num_rows($sql) == 0){\n\t\t\techo \"Username atau email yang anda masukan tidak terdaftar sebagai member di situs ini!.\";\n\t\t\texit();\n\t\t}\n\t\t$data = $this->fetch($sql);\n\t\t$id = $data['id'];\n\t\t$name = $data['name'];\n\t\t$email = $data['email'];\n\t\t$pswd = $data['pswd'];\n\t\t$image = $data['image'];\n\t\t$bio = $data['bio'];\n\t\t$link = $data['link'];\n\t\t$level = $data['level'];\n\t\t$today = date(\"Y-m-d\");\n\t\t$time = date(\"H:i:s\");\n\t\t$total_art = $this->num_rows(\"select id from article where user='$id'\");\n\t\t$total_page = $this->num_rows(\"select id from pages where user='$id'\");\n\t\t$total_files = $this->num_rows(\"select id from files where user='$id'\");\n\t\t$activation_key = md5($id.$name.$email.$pswd.$email.$image.$bio.$link.$level.$today.$total_art.$total_page.$total_files);\n\t\t$this->email=$email;\n\t\t$this->name=$name;\n\t\treturn $activation_key;\n\t}", "public static function generateConfirmationHash($user)\n {\n $id = is_object($user) ? $user->getId() : $user;\n \n return sprintf('%010s', substr(base_convert(md5($id . static::getSecret()), 16, 36), -10) .\n base_convert($id, 10, 36));\n }", "public function getActivationKey()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\t$activationKey = md5(time().mt_rand().$record->correo);\n\t\tif (!$record->saveAttributes(array('llave_activacion' => $activationKey))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $activationKey;\n\t}", "function ConfirmUser(){\r\n if(empty($_GET['code'])||strlen($_GET['code'])<=10){\r\n $this->HandleError(\"Please provide the confirm code\");\r\n return false;\r\n }\r\n $user_rec = array();\r\n if(!$this->UpdateDBRecForConfirmation($user_rec)){\r\n return false;\r\n }\r\n \r\n $this->SendUserWelcomeEmail($user_rec);\r\n \r\n $this->SendAdminIntimationOnRegComplete($user_rec);\r\n \r\n return true;\r\n }", "function pmpromrss_getMemberKey($user_id = NULL)\r\n{\r\n\t//default to current user\r\n\tif(empty($user_id))\r\n\t{\r\n\t\tglobal $current_user;\r\n\t\t$user_id = $current_user->ID;\r\n\t}\r\n\t\r\n\t//make sure we have a user\r\n\tif(empty($user_id))\r\n\t\treturn false;\r\n\t\t\r\n\t$user = get_userdata($user_id);\r\n\r\n\t//get key\r\n\t$key = get_user_meta($user->ID, \"pmpromrss_key\", true);\r\n\t\r\n\t//create member key if they don't already have one\r\n\tif(empty($key))\r\n\t{\r\n\t\t$key = md5(time() . $user->user_login . AUTH_KEY);\r\n\t\tupdate_user_meta($user->ID, \"pmpromrss_key\", $key);\r\n\t}\r\n\t\r\n\treturn $key;\r\n}", "function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')\n{\n\tglobal $user, $template, $db;\n\tglobal $phpEx, $phpbb_root_path;\n\n\tif (isset($_POST['cancel']))\n\t{\n\t\treturn false;\n\t}\n\n\t$confirm = false;\n\tif (isset($_POST['confirm']))\n\t{\n\t\t// language frontier\n\t\tif ($_POST['confirm'] === $user->lang['YES'])\n\t\t{\n\t\t\t$confirm = true;\n\t\t}\n\t}\n\n\tif ($check && $confirm)\n\t{\n\t\t$user_id = request_var('confirm_uid', 0);\n\t\t$session_id = request_var('sess', '');\n\t\t$confirm_key = request_var('confirm_key', '');\n\n\t\tif ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Reset user_last_confirm_key\n\t\t$sql = 'UPDATE ' . USERS_TABLE . \" SET user_last_confirm_key = ''\n\t\t\tWHERE user_id = \" . $user->data['user_id'];\n\t\t$db->sql_query($sql);\n\n\t\treturn true;\n\t}\n\telse if ($check)\n\t{\n\t\treturn false;\n\t}\n\n\t$s_hidden_fields = build_hidden_fields(array(\n\t\t'confirm_uid'\t=> $user->data['user_id'],\n\t\t'sess'\t\t\t=> $user->session_id,\n\t\t'sid'\t\t\t=> $user->session_id,\n\t));\n\n\t// generate activation key\n\t$confirm_key = gen_rand_string(10);\n\n\tif (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])\n\t{\n\t\tadm_page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]);\n\t}\n\telse\n\t{\n\t\tpage_header(((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]), false);\n\t}\n\n\t$template->set_filenames(array(\n\t\t'body' => $html_body)\n\t);\n\n\t// If activation key already exist, we better do not re-use the key (something very strange is going on...)\n\tif (request_var('confirm_key', ''))\n\t{\n\t\t// This should not occur, therefore we cancel the operation to safe the user\n\t\treturn false;\n\t}\n\n\t// re-add sid / transform & to &amp; for user->page (user->page is always using &)\n\t$use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);\n\t$u_action = reapply_sid($use_page);\n\t$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;\n\n\t$template->assign_vars(array(\n\t\t'MESSAGE_TITLE'\t\t=> (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],\n\t\t'MESSAGE_TEXT'\t\t=> (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],\n\n\t\t'YES_VALUE'\t\t\t=> $user->lang['YES'],\n\t\t'S_CONFIRM_ACTION'\t=> $u_action,\n\t\t'S_HIDDEN_FIELDS'\t=> $hidden . $s_hidden_fields)\n\t);\n\n\t$sql = 'UPDATE ' . USERS_TABLE . \" SET user_last_confirm_key = '\" . $db->sql_escape($confirm_key) . \"'\n\t\tWHERE user_id = \" . $user->data['user_id'];\n\t$db->sql_query($sql);\n\n\tif (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])\n\t{\n\t\tadm_page_footer();\n\t}\n\telse\n\t{\n\t\tpage_footer();\n\t}\n}", "function acount_removal_generate_confirm_token($type, $user_guid) {\n\t\n\t$hmac = account_removal_get_hmac($type, $user_guid);\n\tif (empty($hmac)) {\n\t\treturn false;\n\t}\n\t\n\treturn $hmac->getToken();\n}", "public function getConfirmed(){\n $db = DB::prepare('SELECT confirmed FROM users WHERE UPPER(username) = UPPER(?) AND password=?');\n $db->execute(array($this->username, $this->password));\n \n $result = $db->fetchObject();\n $this->confirmed = $result->confirmed;\n return $this->confirmed;\n }", "static function confirm_email($email, $key) {\n // update data base to email_confirmed = 1 if the key is correct\n \n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` = '\".$email.\"' AND `hash` = '\".$key.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 1) { // the given key exists\n $sql = \"UPDATE `user` SET `email_confirmed` = 1 WHERE `id` = \".self::email2id($email).\";\";\n $query = mysqli_query($con, $sql);\n return TRUE;\n }\n return FALSE;\n }", "function get_key() {\n\t\t// get_cert() also fetches key\n\t\tif (!isset($_SESSION['user_key']))\n\t\t\t$this->get_cert();\n\t\treturn $_SESSION['user_key'];\n\t}", "function getConfirmPassword() {\n\t$COMMON = new Common($debug);\n\n\t$sql = \"SELECT * FROM `Proj2Advisors` WHERE `New` = 'true'\";\n \t$rs = $COMMON->executeQuery($sql, \"Advising Appointments\");\n \t$row = mysql_fetch_row($rs);\n\n\treturn $row[5];\n}", "public function create_new_activationkey($user_id){\n\t\t\t$user_key = random_string(true, 32);\n\t\t\t$sql = \"UPDATE __users\n\t\t\t\t\t\tSET user_key='\" . $this->db->escape($user_key) . \"'\n\t\t\t\t\t\tWHERE user_id='\" . $this->db->escape($user_id) . \"'\";\n\t\t\tif(!$this->db->query($sql)) return false;\n\t\t\t$this->pdh->enqueue_hook('user');\n\t\t\treturn $user_key;\n\t\t}", "function findByConfirmationToken($token);", "public function get_pgp_key($user_id)\n {\n $this->db->select('fingerprint, public_key');\n $query = $this->db->get_where('pgp_keys', array('user_id' => $user_id));\n\n if ($query->num_rows() > 0) {\n $row = $query->row_array();\n $row['fingerprint_f'] = '0x' . substr($row['fingerprint'], (strlen($row['fingerprint']) - 16), 16);\n return $row;\n }\n\n return FALSE;\n }", "function get_user_validation_key($user_id) {\n $details = $this->get_user_details($user_id);\n return $details['ValidationKey'];\n\t}" ]
[ "0.67937714", "0.65344864", "0.6500987", "0.64060664", "0.6258799", "0.624875", "0.6248397", "0.612746", "0.6071338", "0.59913766", "0.59913766", "0.59913766", "0.5953208", "0.59467226", "0.593326", "0.59253746", "0.5823985", "0.5819847", "0.5817748", "0.5816006", "0.58100146", "0.5807767", "0.5807264", "0.578941", "0.57817125", "0.5779437", "0.5747651", "0.56920785", "0.5688913", "0.5686387" ]
0.78570145
0
Checks if the confirmation key exists Returns the user id if the key is found or false if key is invalid
public function checkConfirmation( $confirmationkey ) { $this->debug->guard( ); $sql = $this->database->prepare( "SELECT * FROM " . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_userconfirmation' ) . " WHERE userconfirmation_key = ?" ); $sql->bindParam( 1, $confirmationkey ); if ( !$sql->execute( ) ) { $this->debug->write( 'Problem confirming a user: could not read from user confirmation table', 'warning' ); $this->messages->setMessage( 'Problem confirming a user: could not read from user confirmation table', 'warning' ); $this->debug->unguard( false ); return false; } if ( $sql->rowCount( ) > 0 ) { $row = $sql->fetch( PDO::FETCH_ASSOC ); $ret = $row[ 'userconfirmation_user' ]; $this->debug->unguard( $ret ); return $ret; } $this->debug->write( 'Problem confirming a user: given key not found', 'warning' ); $this->messages->setMessage( 'Problem confirming a user: given key not found', 'warning' ); $this->debug->unguard( false ); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function CheckActivationKeyExists( )\n\t\t{\n\t\t\t$dataArray = array(\n \"activationKey\"=>$this->activationKey\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/CheckActivationKeyExists/123\", \"json\" );\n \n return $response;\n\t\t}", "public function getConfirmationKey( $userid )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\t$sql = $this->database->prepare( \"SELECT * FROM \" . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_userconfirmation' ) . \" WHERE userconfirmation_user = ?\" );\r\n\t\t$sql->bindParam( 1, $userid );\r\n\r\n\t\tif ( !$sql->execute( ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem confirming a user: could not read from user confirmation table', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem confirming a user: could not read from user confirmation table', '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\tif ( $sql->rowCount( ) > 0 )\r\n\t\t{\r\n\t\t\t$row = $sql->fetch( PDO::FETCH_ASSOC );\r\n\t\t\t$ret = $row[ 'userconfirmation_key' ];\r\n\r\n\t\t\t$this->debug->unguard( $ret );\r\n\t\t\treturn $ret;\r\n\t\t}\r\n\r\n\t\t$this->debug->write( 'Problem confirming a user: key not found for given user', 'warning' );\r\n\t\t$this->messages->setMessage( 'Problem confirming a user: key not found for given user', 'warning' );\r\n\r\n\t\t$this->debug->unguard( false );\r\n\t\treturn false;\r\n\t}", "static function confirm_email($email, $key) {\n // update data base to email_confirmed = 1 if the key is correct\n \n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` = '\".$email.\"' AND `hash` = '\".$key.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 1) { // the given key exists\n $sql = \"UPDATE `user` SET `email_confirmed` = 1 WHERE `id` = \".self::email2id($email).\";\";\n $query = mysqli_query($con, $sql);\n return TRUE;\n }\n return FALSE;\n }", "public function verify($key){\n\t\tif(!isset($key))return false;\n\t\t$query = Queries::getuserbykey($key);\n\t\t$user = $this->query($query)[0];\n\t\t$query = Queries::verify($key);\n\t\t$this->log(\"verifying @\".$user[\"id\"].\" (\".$user[\"username\"].\")\");\n\t\tif(!$this->query($query))return false;\n\t\treturn $user;\n\t}", "function check_hash_key($hash_key)\n\t\t{\n\t\t\t$statement = $this->conn_id->prepare(\"select user_id,is_active from users where hash_key = :hash_key\");\n\t\t\t$statement->execute(array(':hash_key' => $hash_key));\n\t\t\t$row = $statement->fetch();\n\t\t\tif (isset($row['user_id']))\n\t\t\t{\n\t\t\t\tif ( $row['is_active'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t// Already a verified user\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( $this->verify_success($row['user_id']) == TRUE )\n\t\t\t\t\t{\n\t\t\t\t\t\t// Now you are a verified user\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Still not verified\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Supplied hash key doesn't exist\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "function validateUser($id, $key)\n{\n\n if (!isset($id, $key)) return false;\n\n $valid_users = array(\n 'demo' => 'TEST_USER_SOFTWARE_KEY'\n );\n\n return (array_key_exists($id, $valid_users) && $valid_users[$id] == $key);\n}", "protected function generateConfirmationCode()\n {\n $this->attributes['user_activation_key'] = Hash::make($this->user_email . time());\n\n if (is_null($this->attributes['user_activation_key']))\n return false; // failed to create user_activation_key\n else\n return true;\n }", "private static function getUserFromKey() {\n\t\tstatic $user;\n\t\t\n\t\tif ($user === null) {\n\t\t\t$user = false;\n\t\t\tif ($key = Request::getGET('key')) {\n\t\t\t\t$l = User::getUsers();\n\t\t\t\t$l = $l->filter($l->exprEqual($l->exprMember('unconfirmedEmailKey'),\n\t\t\t\t\t$key));\n\t\t\t\tif ($l->getCount() == 1)\n\t\t\t\t\t$user = $l->get(0);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($user === false)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn $user;\n\t}", "public function getConfirmUser($tokenKey){\n $this->db->query('SELECT * FROM users WHERE us_token = :tokenKey');\n // Bind values\n $this->db->bind(':tokenKey', $tokenKey);\n $row = $this->db->single();\n return $row;\n }", "public function userFromKey($key){\r\n $query = $this->conn->prepare('SELECT `user_id` FROM `user` WHERE confirmationKey = :key'); // Création de la requête + utilisation order by pour ne pas utiliser sort\r\n $query->execute([':key' => $key ]); // Exécution de la requête\r\n return $query->fetch(\\PDO::FETCH_ASSOC);\r\n\r\n }", "public function check_key($email){\n \n $this->db->where('u_email', $email);\n \n $result = $this->db->get('users');\n\n if($result->num_rows() == 1){\n if($result->row(0)->u_app_key != ''){\n return false;\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "public function verifyAction()\n\t{\n\t\t$this->view->headTitle(\"Registration Process\");\n\t\t\n\t\t//Retrieve key from url\n\t\t$registrationKey = $this->getRequest()->getParam('key');\n\t\t\n\t\t//Identitfy the user associated with the key\n\t\t$user = new Default_Model_User();\n\t\t\n\t\t//Determine is user already confirm\n\t\tif($user->isUserConfirmed($registrationKey)){\n\t\t$this->view->isConfirmed = 1;\n\t\t$this->view->errors[] = \"User is already confirmed\";\n\t\treturn;\n\t\t}\n\n\t\t$resultRow = $user->getUserByRegkey($registrationKey);\n\t\t\n\t\t//If the user has been located, set the confirmed column.\n\t\tif(count($resultRow)){\n\t\t\t$resultRow->confirmed = 1;\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t\t$this->view->success = 1;\n\t\t\t$this->view->firstName = $resultRow->first_name;\n\t\t\n\t\t} else{\n\t\t\t$this->view->errors[] = \"Unable to locate registration key\";\n\t\t}\n\n\t}", "public function validate_key_user($id, $key)\n {\n return $this->db->from('ec_client')->where(array('id_client' => $id, 'restore_key' => $key))->count_all_results();\n }", "function check_key($key)\n {\n $this->db->where('reset_code', $key);\n $result = $this->db->get('users'); \n if($result->num_rows() > 0)\n {\n foreach($result->result() as $row)\n {\n return $row;\n }\n }\n else\n {\n return false;\n }\n }", "public function isValidUser($apikey) {\n\t\t$stmt = $this->con->prepare(\"SELECT id from users WHERE apikey = ?\");\n\t\t$stmt->bind_para(\"s\", $apikey);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\t\n\t\treturn $num_rows > 0;\n\t}", "public function verifyEmailID($key)\n\t\t{\n\t\t\t$data = array('status' => 1);\n\t\t\t$this->db->where('md5(email)', $key);\n\t\t\treturn $this->db->update('tb_siswa', $data);\n\t\t}", "public function confirm($key)\n {\n try {\n $user = Sentry::findUserByActivationCode($key);\n\n if ($user->attemptActivation($key)) {\n return Redirect::to('login')->withMessage(['success' => Lang::get('flash.account_activated')]);\n }\n } catch (Exception $e) {\n // Nothing here, so just fall through.\n }\n\n return Redirect::to('/')->withMessage(['danger' => Lang::get('flash.invalid_code')]);\n }", "public function isValidApiKey($api_key) {\n \n $result=$this->con->query(\"SELECT iduser FROM user WHERE api_key='\".$api_key.\"';\");\n $num_rows=$result->num_rows;\n if($num_rows==1) return 1;\n else return 0;\n }", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function hasSignupId(){\n return $this->_has(4);\n }", "public function verifyemail($key){\n $data = array('confirmed' => 1);\n $this->db->where('md5(email)', $key);\n return $this->db->update('BusinessOwner', $data);\n }", "public function confirm_member(){\n\t\tif(isset($_SESSION['status'], $_SESSION['user_id'], $_SESSION['login_string'])){\n\t\t\t$user_id = $_SESSION['user_id'];\n\t\t\t$status = $_SESSION['status'];\n\t\t\t$login_string = $_SESSION['login_string'];\n\t\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\n\t\t\t$user_browser = $_SERVER['HTTP_USER_AGENT'];\n\t\t\t$mysql = New Mysql();\n\t\t\t$password = $mysql->get_password_by_id($user_id);\n\t\t\tif( $password != \"\" ){\n\t\t\t\t$login_check = hash('sha512', $password . $ip_address . $user_browser);\n\t\t\t\tif($login_check == $login_string && $status == 'authorized'){\n\t\t\t\t\treturn $user_id;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\techo(\"Variables are not set\");\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate_url_confirm_account($id, $key)\n {\n if ($this->db->from('ec_client')->select('id_client, key_register')->where(array('id_client' => $id, 'key_register' => $key))->count_all_results() > 0 ) {\n $this->db->set('status_register', 1)->where('id_client', $id)->update('ec_client');\n return true;\n }\n return false;\n }", "public function isValidApiKey($api_key) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE api_key = ?\");\n $stmt->bind_param(\"s\", $api_key);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public function hasAccount($key);", "public function verify_user($playerId, $playerKey) {\n try {\n // Check for a user with this id\n $query = 'SELECT name_ingame, status FROM player_view WHERE id = :id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':id' => $playerId));\n $fetchResult = $statement->fetchAll();\n\n // Make sure that user ID exists and is waiting to be verified\n if (count($fetchResult) != 1) {\n $this->message = 'Could not lookup user ID ' . $playerId;\n return NULL;\n }\n $username = $fetchResult[0]['name_ingame'];\n $status = $fetchResult[0]['status'];\n if ($status != 'UNVERIFIED') {\n $this->message = 'User with ID ' . $playerId . ' is not waiting to be verified';\n return NULL;\n }\n\n // Find the verification key for the specified user ID\n $query = 'SELECT verification_key FROM player_verification WHERE player_id = :player_id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':player_id' => $playerId));\n $fetchResult = $statement->fetchAll();\n\n if (count($fetchResult) != 1) {\n $this->message = 'Could not find verification key for user ID ' . $playerId;\n return NULL;\n }\n $databaseKey = $fetchResult[0]['verification_key'];\n\n // Now check that the provided key matches the one in the database\n if ($playerKey != $databaseKey) {\n $this->message = 'Wrong verification key! Make sure you pasted the URL from the e-mail exactly.';\n return NULL;\n }\n\n // Everything checked out okay. Activate the account\n $query = 'UPDATE player ' .\n 'SET status_id = (SELECT ps.id FROM player_status ps WHERE ps.name = \"ACTIVE\") ' .\n 'WHERE id = :id';\n $statement = self::$conn->prepare($query);\n $statement->execute(array(':id' => $playerId));\n $this->message = 'Account activated for player ' . $username . '!';\n $result = TRUE;\n return $result;\n\n } catch (Exception $e) {\n $errorData = $statement->errorInfo();\n $this->message = 'User create failed: ' . $errorData[2];\n return NULL;\n }\n }", "function verify_user($conn, $id, $hash){\n\t$sql = \"SELECT id from Session\n\tWHERE id=$id and hash='$hash'\";\n\n\t$result = $conn->query($sql);\n\n\treturn ($result->num_rows > 0);\n}", "private function _checkPk() {\n\t\t$result = false;\n\t\t$private_key = Mage::helper ( 'masterpass' )->checkPrivateKey ();\n\t\tif (! $private_key) {\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t// save long access token\n\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t$longAccessToken = null;\n\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\n\t\t\t$customerData->save ();\n\t\t\t// $this->_redirect('checkout/cart');\n\t\t\t// $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n\t}", "public function checkExists($activationkey)\n\t{\n\t\tif (!$this->hasErrors())\n\t\t{\n\t\t\tif (!strpos($this->email,'@'))\n\t\t\t\t$this->addError('email', 'Email is incorrect!');\n\t\t\telse\n\t\t\t{\n\t\t\t\t//verify user's email against user data storage\n\t\t\t\t$user = User::model()->findByAttributes(array('email'=>$this->email)); \n\t\t\t\tif ($user === null)\n\t\t\t\t{\n\t\t\t\t\t$this->addError('email', 'Can not find your email!');\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$user->activeKey = $activationkey;\n\t\t\t\t\tif ($user->update())\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\n\t\t}\n\t\t\n\t}" ]
[ "0.6910243", "0.690416", "0.6830469", "0.6740901", "0.6632601", "0.6622493", "0.649094", "0.6441743", "0.64118266", "0.6394355", "0.62788266", "0.62299716", "0.615836", "0.6095198", "0.6050283", "0.60411996", "0.5985923", "0.59826607", "0.5981559", "0.5977365", "0.597291", "0.59707344", "0.5970144", "0.59352577", "0.59268916", "0.5922328", "0.5875522", "0.5872085", "0.58495754", "0.57907933" ]
0.7233384
0
Converts an array of options to instance of SchemaConfig (or just returns empty config when array is not passed).
public static function create(array $options = []) { $config = new static(); if (!empty($options)) { if (isset($options['query'])) { Utils::invariant( $options['query'] instanceof ObjectType, 'Schema query must be Object Type if provided but got: %s', Utils::printSafe($options['query']) ); $config->setQuery($options['query']); } if (isset($options['mutation'])) { Utils::invariant( $options['mutation'] instanceof ObjectType, 'Schema mutation must be Object Type if provided but got: %s', Utils::printSafe($options['mutation']) ); $config->setMutation($options['mutation']); } if (isset($options['subscription'])) { Utils::invariant( $options['subscription'] instanceof ObjectType, 'Schema subscription must be Object Type if provided but got: %s', Utils::printSafe($options['subscription']) ); $config->setSubscription($options['subscription']); } if (isset($options['types'])) { Utils::invariant( is_array($options['types']) || is_callable($options['types']), 'Schema types must be array or callable if provided but got: %s', Utils::printSafe($options['types']) ); $config->setTypes($options['types']); } if (isset($options['directives'])) { Utils::invariant( is_array($options['directives']), 'Schema directives must be array if provided but got: %s', Utils::printSafe($options['directives']) ); $config->setDirectives($options['directives']); } if (isset($options['typeResolution'])) { trigger_error( 'Type resolution strategies are deprecated. Just pass single option `typeLoader` '. 'to schema constructor instead.', E_USER_DEPRECATED ); if ($options['typeResolution'] instanceof Resolution && !isset($options['typeLoader'])) { $strategy = $options['typeResolution']; $options['typeLoader'] = function($name) use ($strategy) { return $strategy->resolveType($name); }; } } if (isset($options['typeLoader'])) { Utils::invariant( is_callable($options['typeLoader']), 'Schema type loader must be callable if provided but got: %s', Utils::printSafe($options['typeLoader']) ); $config->setTypeLoader($options['typeLoader']); } if (isset($options['astNode'])) { Utils::invariant( $options['astNode'] instanceof SchemaDefinitionNode, 'Schema astNode must be an instance of SchemaDefinitionNode but got: %s', Utils::printSafe($options['typeLoader']) ); $config->setAstNode($options['astNode']); } } return $config; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOptions(array $options): DbConnectionConfigInterface;", "public static function fromSchema(\\GraphQL\\Type\\Schema $schema, array $options = []) : ?array\n {\n }", "protected function createOptions($options)\n {\n if (is_array($options)) {\n return new Configuration\\Options($options);\n }\n\n if ($options instanceof LoopInterface) {\n return new Configuration\\Options(['eventloop' => $options]);\n }\n\n if ($options instanceof OptionsInterface) {\n return $options;\n }\n\n throw new \\InvalidArgumentException('Invalid type for client options');\n }", "public static function fromArray($options, $strict = true)\n {\n if (!is_array($options)) {\n if ($strict) {\n throw new \\InvalidArgumentException('Options must be an array, is: ' . print_r($options, true));\n } else {\n $options = array();\n }\n }\n $instance = new static();\n $instance->populateAttributes($options, $strict);\n return $instance;\n }", "public function createConfiguration(array $options)\n {\n // strip controller options\n\n $files = $options['files'];\n // if $files is a single object, casting will break it\n if (is_object($files)) {\n $files = array($files);\n } elseif (! is_array($files)) {\n $files = (array)$files;\n }\n unset($options['files']);\n\n $sources = array();\n foreach ($files as $file) {\n try {\n $sources[] = $this->sourceFactory->makeSource($file);\n } catch (Minify_Source_FactoryException $e) {\n $this->logger->error($e->getMessage());\n\n return new Minify_ServeConfiguration($options);\n }\n }\n\n return new Minify_ServeConfiguration($options, $sources);\n }", "protected function createOptions($options)\n {\n if (is_array($options)) {\n return new Options($options);\n }\n\n if ($options instanceof OptionsInterface) {\n return $options;\n }\n\n throw new InvalidArgumentException(\"Invalid type for client options.\");\n }", "protected static function build(array $options)\n {\n if (class_exists('\\PDO')) {\n return new PDO($options);\n } else if (class_exists('\\mysqli')) {\n return new Mysqli($options);\n } else {\n return new Mysql($options);\n }\n }", "public function setSchema($var)\n {\n GPBUtil::checkMessage($var, \\Grpc\\Gateway\\Protoc_gen_openapiv2\\Options\\Schema::class);\n $this->schema = $var;\n\n return $this;\n }", "public function applyOptions(array $options): Builder;", "public static function make($options = [])\n {\n if (is_string($options)) {\n return new static(['extend' => $options]);\n }\n\n return new static($options);\n }", "public function config($options = array())\n {\n $this->config = ($this->config) ?:self::defaults();\n\n if (!empty($options)) {\n $this->config = array_replace_recursive(self::defaults(), $options);\n }\n return $this->config;\n }", "private function getConfigs(array $options = [])\n {\n return array_merge($this->_defaultConfigs, $options);\n }", "public static function fromOptions(array $options)\n {\n $commands = array();\n\n $options = array_change_key_case($options, CASE_LOWER);\n\n $type = strtolower($options['database_type']);\n\n switch ($type) {\n case 'mariadb':\n $type = 'mysql';\n\n case 'mysql':\n if ($options['socket']) {\n $dsn = $type . ':unix_socket=' . $options['socket'] . ';dbname=' . $options['database_name'];\n }\n else {\n $dsn = $type . ':host=' . $options['server'] . ($options['port'] ? ';port=' . $options['port'] : '') . ';dbname=' . $options['database_name'];\n }\n\n // Make MySQL using standard quoted identifier\n $commands[] = 'SET SQL_MODE=ANSI_QUOTES';\n break;\n\n case 'pgsql':\n $dsn = $type . ':host=' . $options['server'] . ($options['port'] ? ';port=' . $options['port'] : '') . ';dbname=' . $options['database_name'];\n break;\n\n case 'sybase':\n $dsn = 'dblib:host=' . $options['server'] . ($options['port'] ? ':' . $options['port'] : '') . ';dbname=' . $options['database_name'];\n break;\n\n case 'oracle':\n $dbname = $options['server'] ?\n '//' . $options['server'] . ($options['port'] ? ':' . $options['port'] : ':1521') . '/' . $options['database_name'] :\n $options['database_name'];\n\n $dsn = 'oci:dbname=' . $dbname . ($options['charset'] ? ';charset=' . $options['charset'] : '');\n break;\n\n case 'mssql':\n $dsn = strstr(PHP_OS, 'WIN') ?\n 'sqlsrv:server=' . $options['server'] . ($options['port'] ? ',' . $options['port'] : '') . ';database=' . $options['database_name'] :\n 'dblib:host=' . $options['server'] . ($options['port'] ? ':' . $options['port'] : '') . ';dbname=' . $options['database_name'];\n\n // Keep MSSQL QUOTED_IDENTIFIER is ON for standard quoting\n $commands[] = 'SET QUOTED_IDENTIFIER ON';\n break;\n\n case 'sqlite':\n $dsn = $type . ':' . $options['database_file'];\n $options['username'] = null;\n $options['password'] = null;\n break;\n }\n\n if (in_array($type, ['mariadb', 'mysql', 'pgsql', 'sybase', 'mssql']) && $options['charset']) {\n $commands[] = \"SET NAMES '\" . $options['charset'] . \"'\";\n }\n\n $sqlDatabase = new SQLDatabase($dsn, $options['username'], $options['password'], $options['pdoOption']);\n $sqlDatabase->_debug_mode = $options['debug_mode'] ? : $sqlDatabase->_debug_mode;\n\n foreach ($commands as $value) {\n $sqlDatabase->exec($value);\n }\n\n return $sqlDatabase;\n }", "public function __construct($options = array()) {\n\t\t$defaults = array(\n\t\t\t'null' => FALSE,\n\t\t\t'blank' => FALSE,\n\t\t\t'db_column' => NULL,\n\t\t\t'db_index' => FALSE,\n\t\t\t'default' => NULL,\n\t\t\t'primary_key' => FALSE,\n\t\t\t'unique' => FALSE,\n\t\t);\n\n\t\tforeach ($defaults AS $opt_name => $default_value) {\n\t\t\tif (isset($options[$opt_name])) {\n\t\t\t\t$this->$opt_name = $opt_values[$opt_name];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->$opt_name = $default_value;\n\t\t\t}\n\t\t}\n\t}", "public static function make(array $options = []);", "public static function createFromOptions($options)\n {\n $operation = new self();\n $operation->fromArray($options);\n\n return $operation;\n }", "public static function createFromOptions($options)\n {\n $operation = new self();\n $operation->fromArray($options);\n\n return $operation;\n }", "public function setOptions(array $options): AdapterInterface\n {\n $hydrator = $this->getHydrator();\n $hydrator->hydrate($this, $options);\n\n return $this;\n }", "public static function createFromArray(array $array){\n $configuration = new Configuration();\n foreach ($array as $name => $value){\n $configuration->add(new ConfigurationAttribute($name,$value));\n }\n return $configuration;\n }", "public static function configure(){\n $args = func_get_args();\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n case 1:{\n if (is_array($args[0])){\n self::configureWithOptions($args[0]);\n } else {\n self::configureWithDsnAndOptions($args[0]);\n }\n break;\n }\n case 2:{\n if (is_array($args[0])){\n self::configureWithOptions($args[0], $args[1]);\n } else {\n self::configureWithDsnAndOptions($args[0], $args[1]);\n }\n break;\n }\n case 3: {\n self::configureWithDsnAndOptions($args[0], $args[1], $args[2]);\n break;\n }\n }\n }", "protected function getPdoOptions(array $options)\n {\n $result = $this->pdoDefaultOptions;\n\n foreach ($options as $k => $v)\n {\n $result[$k] = $v;\n }\n\n return $result;\n }", "private function getGeneratorConfig(array $soapClientOptions)\n {\n $params = [];\n $params['inputFile'] = $this->serviceWsdlUrl;\n $params['outputDir'] = $this->clientClassesOutputFolder;\n $params['namespaceName'] = $this->clientClassesNamespace;\n $params['soapClientOptions'] = $soapClientOptions;\n\n $config = new \\Wsdl2PhpGenerator\\Config($params);\n\n return $config;\n }", "public static function createFromConfig(array $config);", "public static function factory($options = array())\r\n {\r\n if ($options instanceof \\Traversable) {\r\n $options = ArrayUtils::iteratorToArray($options);\r\n } elseif (!is_array($options)) {\r\n throw new InvalidArgumentException(__METHOD__ . ' expects an array or Traversable set of options');\r\n }\r\n\r\n if (!isset($options['defaults'])) {\r\n $options['defaults'] = array();\r\n }\r\n\r\n return new static($options['defaults']);\r\n }", "private function configureDeliveryOptions(array $options): array\n {\n $logger = $options['options']['logger'];\n if (null !== $logger) {\n $options['options']['logger'] = true === $logger\n ? new Reference(LoggerInterface::class)\n : new Reference($options['options']['logger']);\n }\n\n if (null !== $options['options']['client']) {\n $options['options']['client'] = new Reference($options['options']['client']);\n }\n\n $pool = $options['options']['cache']['pool'];\n if (null !== $pool) {\n $options['options']['cache']['pool'] = true === $pool\n ? new Reference(CacheItemPoolInterface::class)\n : new Reference($pool);\n }\n\n return $options;\n }", "public function buildOptions(array $options)\n {\n $options = array_merge([\n 'content' => null,\n 'linkType' => null,\n 'extras' => [],\n ], $options);\n\n if (null === $options['linkType']) {\n $options['linkType'] = $this->determineLinkType($options);\n }\n\n $this->validateLinkType($options['linkType']);\n\n if ('content' === $options['linkType']) {\n if (!isset($options['content'])) {\n throw new \\InvalidArgumentException(sprintf('Link type content configured, but could not find content option in the provided options: %s', implode(', ', array_keys($options))));\n }\n\n $options['uri'] = $this->contentRouter->generate(\n $options['content'],\n isset($options['routeParameters']) ? $options['routeParameters'] : [],\n (isset($options['routeAbsolute']) && $options['routeAbsolute']) ? UrlGeneratorInterface::ABSOLUTE_URL : UrlGeneratorInterface::ABSOLUTE_PATH\n );\n }\n\n if (isset($options['route']) && 'route' !== $options['linkType']) {\n unset($options['route']);\n }\n\n $options['extras']['content'] = $options['content'];\n\n return $options;\n }", "public static function createFromArray($values, array $options = [])\n {\n $document = new static($options);\n foreach ($values as $key => $value) {\n $document->set($key, $value);\n }\n\n $document->setChanged(true);\n\n return $document;\n }", "public static function build(array $introspectionQuery, array $options = []) : \\GraphQL\\Type\\Schema\n {\n }", "public function getDefaultOptions(array $options)\n {\n $collectionConstraint = new Collection(array(\n 'name' => array(\n\t\t\t\tnew MinLength(array('limit'=>7, 'message' => 'numele trebuie sa fie din minim {{ limit }} caractere')),\n\t\t\t),\n 'email' => array(\n\t\t\t\tnew Email(array('message' => 'Invalid email address')),\n\t\t\t),\n\t\t\t'body' => array(\n\t\t\t\tnew MinLength(array('limit'=>10, 'message' => 'continutul trebuie sa fie din minim {{ limit }} caractere') )\n\t\t\t)\n ));\n \n\t\t//$options = parent::getDefaultOptions($options);\n\t\t\n\t\treturn array(\n //'data_class' => 'My\\TestBundle\\Core\\Test',\n 'validation_constraint' => $collectionConstraint\n );\n\t\t\n\t\t/*$resolver->setDefaults(array(\n 'constraints' => $collectionConstraint\n ));*/\n\t\t/*return array(\n 'currency' => null,\n\t\t\t);*/\n }", "public function __construct($options = null)\n\t{\n\t\t$this->_config = new Syx_Config();\n\t\tif (is_string($options)) {\n\t\t\t$this->_config->load($options);\n\t\t} elseif (is_array($options)) {\n\t\t\t$this->_config->merge($options);\n\t\t} elseif (is_object($options) && method_exists($options, 'toArray')) {\n\t\t\t$this->_config->merge($options->toArray());\n\t\t}\n\n\t\t$options = $this->_config->toArray();\n\t\tif (!empty($options)) {\n\t\t\t$this->setOptions($options);\n\t\t}\n\t}" ]
[ "0.5983118", "0.58971643", "0.5746393", "0.56597424", "0.5589784", "0.5340649", "0.52947885", "0.517248", "0.5090501", "0.50148433", "0.50102144", "0.50060755", "0.49770018", "0.4961225", "0.49577552", "0.49570438", "0.49570438", "0.49139014", "0.48852366", "0.48714745", "0.4861134", "0.48240054", "0.48190385", "0.4768571", "0.47588617", "0.47368094", "0.47180754", "0.47135225", "0.4672991", "0.46354753" ]
0.6957762
0
Show form to get infinite session key.
function show_session_form($api_key, $expires){?> <div class="main"> <a href="http://www.facebook.com/code_gen.php?v=1.0&api_key=<?=$api_key?>" target="_blank">Generate a "one time" code</a> <div class="regForm"> <form action="" method="POST"> <div class="label">Your CODE:</div><input type="text" name="auth_token" value="" size="15" /> <br /> <input type="hidden" name="verify" value="1" /> <input type="hidden" name="type" value="session" /> <input type="submit" name="submit" value="Generate" /> </form> </div> <div class="regIntro"> <p>You session will expire in <?=date('Y:m:d H:i:s', $expires)?></p> <p>Why you need a infinite session?</p> <p>1.Post to mini/news feed when your locker changed.</p> <p>2.Update your profile box when your locker changed.</p> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormkey()\n {\n // generate the key and store it inside the class\n $this->formkey = $this->generateFormkey();\n // store the form key in the session\n $_SESSION['formkey'] = $this->formkey;\n // output the form key\n return \"<input type='hidden' name='formkey' value='\" . $this->formkey . \"' />\";\n }", "function generateSessionKey(){\n\t\t // genereate session and form key\n\t\t$this->formSession['key'] = rand();\n\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey('ses',$this->extKey, $this->formSession);\n\t\t$GLOBALS[\"TSFE\"]->storeSessionData();\n\t}", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "public function getFormKey()\n {\n return Mage::getSingleton('core/session')->getFormKey();\n }", "function nonce_input() {\n\techo '<input type=\"hidden\" name=\"nonce\" id=\"form_key\" value=\"' . $_SESSION['nonce'] . '\">';\n}", "function clearFormKey(){\n\t\t // session genereate key\n\t\t$this->formSession['key'] = null;\n\t}", "public function disableFormKey()\r\n {\r\n Mage::getSingleton('core/session')->setData('_form_key', 'disabled');\r\n }", "public function getSessionKey();", "public function display_api_key() {\r\n\t\t$key = 'inf_key';\r\n\r\n\t\tif ( isset( $this->existing_options[$key] ) && $this->existing_options[$key] )\r\n\t\t\t$existing_value = $this->existing_options[$key];\r\n\t\telse\r\n\t\t\t$existing_value = '';\r\n\r\n\t\t$id = $key;\r\n\t\tsettings_errors( $id );\r\n\t\techo '<input type=\"password\" name=\"' . self::OPTION_NAME . '[' . $key . ']\" id=\"' . $id . '\"';\r\n\t\tif ( $existing_value )\r\n\t\t\techo ' value=\"' . esc_attr( $existing_value ) . '\"';\r\n\t\techo ' size=\"40\" autocomplete=\"off\" pattern=\"[a-zA-Z0-9-_]+\" />';\r\n\r\n\t\techo '<p class=\"description\">' . __( 'Not sure what the API key is or where to get it? <a target=\"_blank\" href=\"http://kb.infusionsoft.com/index.php?/article/AA-00442/0/How-do-I-enable-the-Infusionsoft-API.html\">Click here</a>', 'fb-eventpresso' ) . '</p>';\r\n\t}", "function protectForm() {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"spack_token\\\" value=\\\"\".$this->token.\"\\\" />\";\n\t}", "public function formAction()\n {\n $token = Generator::getRandomString(25);\n $this->set(\"token\", $token);\n $_SESSION['token'] = $token;\n }", "public function display_option_server_key() {\n $server_key = $this->options['server_key'];\n $this->display_input_text_field('server_key', $server_key);\n?>\nThe secret key that clients must use to clear the cache on this blog, passed in the <code><?php esc_attr_e($this->plugin->query_var()); ?></code> parameter.\n<?php\n }", "public function display_option_client_key() {\n $client_key = $this->options['client_key'];\n $this->display_input_text_field('client_key', $client_key);\n?>\nThe key that the server requires for authentication, passed in the <code><?php esc_attr_e($this->plugin->query_var()); ?></code> parameter.\n<?php\n }", "function get($key)\n {\n if($this->isStarted())\n {\n if(isset($this->keyvalList[$key]))\n return ($this->keyvalList[$key]);\n elseif($key=='__ASC_FORM_ID__')\n\t\t\t\t_fatal(array(\"CODE\"=>\"SESSION_001\",\"MESSAGE\"=>\"Access denied due to security reason\"));\n// die('Access denied due to security reason');\n else\n\t\t\t\t_fatal(array(\"CODE\"=>\"SESSION_002\",\"MESSAGE\"=>\"Session::get() !isset(\\$this->keyvalList[$key])\"));\n// die(\"Session::get() !isset(\\$this->keyvalList[$key])\");\n }\n else\n\t\t\t\t_fatal(array(\"CODE\"=>\"SESSION_003\",\"MESSAGE\"=>\"Session::getKey() !\\$this->isStarted()\"));\n// die(\"Session::getKey() !\\$this->isStarted()\");\n }", "function zen_hide_session_id() {\n global $session_started;\n\n if ( ($session_started == true) && defined('SID') && zen_not_null(SID) ) {\n return zen_draw_hidden_field(zen_session_name(), zen_session_id());\n }\n }", "public function createTokenInput(){\n $this->generateToken();\n return '<input type=\"hidden\" name=\"_once\" value=\"' . $_SESSION['token'] . '\">';\n }", "private function setSessionKey()\n {\n $this->sessionKey = 'formfactory.captcha.' . $this->formRequestClass;\n }", "public function showLoginForm()\n {\n\n/* $routes = collect(\\Route::getRoutes())->map(function ($route) { return $route->uri(); });\n\n $previousPath = $this->getPreviousRequestedRoute();\n\n foreach ($routes as $route) {\n // dnd([$route, $previousPath]);\n if (\n $route === $previousPath\n ) {\n // dd([$route, $previousPath, \"found\"]);\n // dd([\"setting url.intended\", $previousPath]);\n Session::put(\n 'intended_request',\n $previousPath\n );\n session()->save();\n } else {\n Session::remove(\n 'intended_request'\n );\n }\n }*/\n\n return view('auth.login');\n }", "private function openSession() {\n $this->sessionId = isset($_POST['key']) ? $_POST['key'] : (isset($_GET['key']) ? $_GET['key'] : 'null');\n\n if($this->sessionId == 'null' || strlen($this->sessionId) === 0) {\n $this->sessionId = rand(0, 999999999);\n }\n\n session_id($this->sessionId);\n session_name(\"gibSession\");\n session_start();\n }", "function page_Special_YMS_ShowAESKey()\n{\n global $db, $session, $paths, $template, $plugins; // Common objects\n global $lang, $output, $yms_client_id;\n \n $output->add_after_header('<div class=\"breadcrumbs\">\n <a href=\"' . makeUrlNS('Special', 'YMS') . '\">' . $lang->get('yms_specialpage_yms') . '</a> &raquo;\n ' . $lang->get('yms_btn_show_aes') . '\n </div>');\n \n $id = intval($paths->getParam(1));\n \n // verify ownership, retrieve key\n $q = $db->sql_query('SELECT client_id, public_id, aes_secret, session_count, token_count, flags FROM ' . table_prefix . \"yms_yubikeys WHERE id = $id;\");\n if ( !$q )\n $db->_die();\n \n if ( $db->numrows() < 1 )\n {\n die_friendly('no rows', '<p>key not found</p>');\n }\n \n list($client_id, $public_id, $secret, $scount, $tcount, $flags) = $db->fetchrow_num();\n $db->free_result();\n \n if ( $client_id !== $yms_client_id )\n die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');\n \n $output->header();\n ?>\n \n <h3><?php echo $lang->get('yms_showaes_heading_main'); ?></h3>\n \n <form action=\"<?php echo makeUrlNS('Special', 'YMS'); ?>\" method=\"post\">\n <input type=\"hidden\" name=\"update_counters\" value=\"<?php echo $id; ?>\" />\n \n <div class=\"tblholder\">\n <table border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\n <tr>\n <th colspan=\"2\">\n <?php echo $lang->get('yms_showaes_th', array('public_id' => yms_modhex_encode($public_id))); ?>\n </th>\n </tr>\n \n <!-- hex -->\n <tr>\n <td class=\"row2\" style=\"width: 50%;\">\n <?php echo $lang->get('yms_showaes_lbl_hex'); ?>\n </td>\n <td class=\"row1\">\n <?php echo $secret; ?>\n </td>\n </tr>\n \n <!-- modhex -->\n <tr>\n <td class=\"row2\">\n <?php echo $lang->get('yms_showaes_lbl_modhex'); ?>\n </td>\n <td class=\"row1\">\n <?php echo yms_modhex_encode($secret); ?>\n </td>\n </tr>\n \n <!-- base64 -->\n <tr>\n <td class=\"row2\">\n <?php echo $lang->get('yms_showaes_lbl_base64'); ?>\n </td>\n <td class=\"row1\">\n <?php echo base64_encode(yms_tobinary($secret)); ?>\n </td>\n </tr>\n \n <!-- COUNTERS -->\n <tr>\n <th colspan=\"2\">\n <?php echo $lang->get('yms_showaes_th_counter'); ?>\n </th>\n </tr>\n \n <tr>\n <td class=\"row2\">\n <?php echo $lang->get('yms_showaes_field_session_count'); ?><br />\n <small><?php echo $lang->get('yms_showaes_field_session_count_hint'); ?></small>\n </td>\n <td class=\"row1\">\n <input type=\"text\" name=\"session_count\" value=\"<?php echo $scount; ?>\" size=\"5\" />\n </td>\n </tr>\n \n <tr>\n <td class=\"row2\">\n <?php echo $lang->get('yms_showaes_field_otp_count'); ?><br />\n <small><?php echo $lang->get('yms_showaes_field_otp_count_hint'); ?></small>\n </td>\n <td class=\"row1\">\n <input type=\"text\" name=\"token_count\" value=\"<?php echo $tcount; ?>\" size=\"5\" />\n </td>\n </tr>\n \n <!-- Any client -->\n <tr>\n <td class=\"row2\">\n <?php echo $lang->get('yms_lbl_addkey_field_any_client_name'); ?><br />\n <small><?php echo $lang->get('yms_lbl_addkey_field_any_client_hint'); ?></small>\n </td>\n <td class=\"row1\">\n <label>\n <input type=\"checkbox\" name=\"any_client\" <?php if ( $flags & YMS_ANY_CLIENT ) echo 'checked=\"checked\" '; ?>/>\n <?php echo $lang->get('yms_lbl_addkey_field_any_client'); ?>\n </label>\n </td>\n </tr>\n \n <tr>\n <th class=\"subhead\" colspan=\"2\">\n <input type=\"submit\" value=\"<?php echo $lang->get('etc_save_changes'); ?>\" />\n </td>\n </tr>\n \n </table>\n </div>\n \n </form>\n <?php\n $output->footer();\n}", "public function monitorSigninForm() {\n\t\t$this->monitorView->displayLoginForm();\n\t}", "public function showLoginForm()\n {\n\n /** set session refferrer */\n $this->setPreviousUrl();\n\n /** @var String $title */\n $this->title = __(\"admin.pages_login_title\");\n /** @var String $content */\n $this->template = 'Admin::Auth.login';\n\n /**render output*/\n return $this->renderOutput();\n }", "public function key() {\n\t\treturn key($this->session);\n\t}", "function access_key_gui() {\n $access_key = get_option('amazon_polly_access_key');\n echo '<input type=\"text\" class=\"regular-text\" name=\"amazon_polly_access_key\" id=\"amazon_polly_access_key\" value=\"' . esc_attr($access_key) . '\" autocomplete=\"off\"> ';\n echo '<p class=\"description\" id=\"amazon_polly_access_key\">Required only if you aren\\'t using IAM roles</p>';\n }", "public function settings_field_private_key() {\n\t\t?>\n\t\t<input name=\"theme_my_login_recaptcha[private_key]\" type=\"text\" id=\"theme_my_login_recaptcha_private_key\" value=\"<?php echo esc_attr( $this->get_option( 'private_key' ) ); ?>\" class=\"regular-text\" />\n\t\t<?php\n\t}", "function displaySessions()\n\t{\n\t\trequire_once('Services/Authentication/classes/class.ilSessionControl.php');\n\n\t\t$this->checkDisplayMode(\"setup_sessions\");\n\n\t\tif (!$this->setup->getClient()->db_installed)\n\t\t{\n\t\t\t// program should never come to this place\n\t\t\t$message = \"No database found! Please install database first.\";\n\t\t\tilUtil::sendInfo($message);\n\t\t}\n\n\t\t$setting_fields = ilSessionControl::getSettingFields();\n\n\t\t$valid = true;\n\t\t$settings = array();\n\n\t\tforeach( $setting_fields as $field )\n\t\t{\n\t\t\tif( $field == 'session_allow_client_maintenance' )\n\t\t\t{\n\t\t\t\tif( isset($_POST[$field]) )\t\t$_POST[$field] = '1';\n\t\t\t\telse\t\t\t\t\t\t\t$_POST[$field] = '0';\n\t\t\t}\n\n\t\t\tif( isset($_POST[$field]) && $_POST[$field] != '' )\n\t\t\t{\n\t\t\t\t$settings[$field] = $_POST[$field];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$valid = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\tif($valid) $this->setup->setSessionSettings($settings);\n\n\t\t$settings = $this->setup->getSessionSettings();\n\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$form = new ilPropertyFormGUI();\n\n\t\tinclude_once 'Services/Authentication/classes/class.ilSession.php';\n\n\t\t// BEGIN SESSION SETTINGS\n\t\t// create session handling radio group\n\t\t$ssettings = new ilRadioGroupInputGUI($this->lng->txt('sess_mode'), 'session_handling_type');\n\t\t$ssettings->setValue($settings['session_handling_type'], ilSession::SESSION_HANDLING_FIXED);\n\n\t\t// first option, fixed session duration\n\t\t$fixed = new ilRadioOption($this->lng->txt('sess_fixed_duration'), ilSession::SESSION_HANDLING_FIXED);\n\n\t\t// add session handling to radio group\n\t\t$ssettings->addOption($fixed);\n\n\t\t// second option, session control\n\t\t$ldsh = new ilRadioOption($this->lng->txt('sess_load_dependent_session_handling'), ilSession::SESSION_HANDLING_LOAD_DEPENDENT);\n\n\t\t// this is the max count of active sessions\n\t\t// that are getting started simlutanously\n\t\t$ti = new ilTextInputGUI($this->lng->txt('sess_max_session_count'), \"session_max_count\");\n\t\t$ti->setInfo($this->lng->txt('sess_max_session_count_info'));\n\t\t$ti->setMaxLength(5);\n\t\t$ti->setSize(5);\n\t\t$ti->setValue($settings['session_max_count']);\n\t\t$ldsh->addSubItem($ti);\n\n\t\t// after this (min) idle time the session can be deleted,\n\t\t// if there are further requests for new sessions,\n\t\t// but max session count is reached yet\n\t\t$ti = new ilTextInputGUI($this->lng->txt('sess_min_session_idle'), \"session_min_idle\");\n\t\t$ti->setInfo($this->lng->txt('sess_min_session_idle_info'));\n\t\t$ti->setMaxLength(5);\n\t\t$ti->setSize(5);\n\t\t$ti->setValue($settings['session_min_idle']);\n\t\t$ldsh->addSubItem($ti);\n\n\t\t// after this (max) idle timeout the session expires\n\t\t// and become invalid, so it is not considered anymore\n\t\t// when calculating current count of active sessions\n\t\t$ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle'), \"session_max_idle\");\n\t\t$ti->setInfo($this->lng->txt('sess_max_session_idle_info'));\n\t\t$ti->setMaxLength(5);\n\t\t$ti->setSize(5);\n\t\t$ti->setValue($settings['session_max_idle']);\n\t\t$ldsh->addSubItem($ti);\n\n\t\t// this is the max duration that can elapse between the first and the secnd\n\t\t// request to the system before the session is immidietly deleted\n\t\t$ti = new ilTextInputGUI($this->lng->txt('sess_max_session_idle_after_first_request'), \"session_max_idle_after_first_request\");\n\t\t$ti->setInfo($this->lng->txt('sess_max_session_idle_after_first_request_info'));\n\t\t$ti->setMaxLength(5);\n\t\t$ti->setSize(5);\n\t\t$ti->setValue($settings['session_max_idle_after_first_request']);\n\t\t$ldsh->addSubItem($ti);\n\n\t\t// add session control to radio group\n\t\t$ssettings->addOption($ldsh);\n\n\t\t$form->addItem($ssettings);\n\n\t\t// controls the ability t maintenance the following\n\t\t// settings in client administration\n\t\t$chkb = new ilCheckboxInputGUI($this->lng->txt('sess_allow_client_maintenance'), \"session_allow_client_maintenance\");\n\t\t$chkb->setInfo($this->lng->txt('sess_allow_client_maintenance_info'));\n\t\t$chkb->setChecked($settings['session_allow_client_maintenance'] ? true : false);\n\t\t$form->addItem($chkb);\n\t\t// END SESSION SETTINGS\n\n\t\t// save and cancel commands\n\t\t$form->addCommandButton(\"sess\", $this->lng->txt('save'));\n\n\t\t$form->setTitle($this->lng->txt(\"sess_sessions\"));\n\t\t$form->setFormAction('setup.php?client_id='.$this->client_id.'&cmd=sess');\n\n\t\t$this->tpl->setVariable(\"TXT_SETUP_TITLE\",ucfirst(trim($this->lng->txt('sess_sessions'))));\n\t\t$this->tpl->setVariable(\"TXT_INFO\", '');\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $form->getHTML());\n\n\t\t/*$this->setButtonPrev(\"db\");\n\n\t\tif($this->setup->checkClientSessionSettings($this->client,true))\n\t\t{\n\t\t\t$this->setButtonNext(\"lang\");\n\t\t}*/\n\n\t\t$this->checkPanelMode();\n\t}", "public function showForm()\n\t{\n echo view($this->config->views['login']);\n\t}", "function secret_key_gui() {\n $secret_key = get_option('amazon_polly_secret_key');\n echo '<input type=\"password\" class=\"regular-text\" name=\"amazon_polly_secret_key\" id=\"amazon_polly_secret_key\" value=\"' . esc_attr($secret_key) . '\" autocomplete=\"off\"> ';\n echo '<p class=\"description\" id=\"amazon_polly_access_key\">Required only if you aren\\'t using IAM roles</p>';\n }", "public function display() {\n\t\techo \"<input id='\" . esc_attr( $this->setting_id ) . \"' type='hidden' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( wp_json_encode( $this->get(), JSON_UNESCAPED_UNICODE ) ) . \"'>\";\n\t}", "public function ShowForm()\n {\n return false;\n }" ]
[ "0.69624966", "0.63261014", "0.62716", "0.6216346", "0.61938137", "0.61407256", "0.59830785", "0.59282553", "0.59267884", "0.59084153", "0.58274794", "0.5826904", "0.57910126", "0.5789528", "0.57878554", "0.5747059", "0.57011044", "0.5648133", "0.5636265", "0.5604613", "0.55940384", "0.5575813", "0.5574485", "0.5573909", "0.55706084", "0.5555529", "0.55206794", "0.55041265", "0.54484665", "0.54110646" ]
0.6455995
1
Options key can be 'shipping address' and 'billing_address' or 'address' Each of these keys must have an address array like: $address['name'] $address['company'] $address['address1'] $address['address2'] $address['city'] $address['state'] $address['country'] $address['zip'] $address['phone'] common pattern for address is $billing_address = isset($options['billing_address']) ? $options['billing_address'] : $options['address']; $shipping_address = $options['shipping_address'];
private function addAddress($options) { $address = $options['billing_address'] ?: $options['address']; $this->post['card']['address_line1'] = $address['address1']; $this->post['card']['address_line2'] = $address['address2']; $this->post['card']['address_city'] = $address['city']; $this->post['card']['address_postcode'] = $address['zip']; $this->post['card']['address_state'] = $address['state']; $this->post['card']['address_country'] = $address['country']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addAddress($options)\n {\n if (!isset($options['address'])\n || !isset($options['billing_address'])\n ) {\n return false;\n }\n\n $address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['BillingStreet'] = isset($address['address1']) ? $address['address1'] : null;\n $this->post['BillingHouseNumber'] = isset($address['address2']) ? $address['address2'] : null;\n $this->post['BillingCity'] = isset($address['city']) ? $address['city'] : null;\n $this->post['BillingState'] = isset($address['state']) ? $address['state'] : null;\n $this->post['BillingPostCode'] = isset($address['zip']) ? $address['zip'] : null;\n }", "private function getShippingAddress(array $order) {\n\n $address = array('address_book_id' => '',\n 'address_type' => 'ship',\n 'lastname' => $order['shipping_lastname'],\n 'firstname' => $order['shipping_firstname'],\n 'telephone' => $order['telephone'],\n 'mobile' => '',\n 'gender' => '',\n 'postcode' => $order['shipping_postcode'],\n 'city' => $order['shipping_city'],\n 'zone_id' => $order['shipping_zone_id'],\n 'zone_code' => $order['shipping_zone_code'],\n 'zone_name' => $order['shipping_zone'],\n 'state' => '',\n 'address1' => $order['shipping_address_1'],\n 'address2' => $order['shipping_address_2'],\n 'country_id' => $order['shipping_country_id'],\n 'country_code' => $order['shipping_iso_code_3'],\n 'country_name' => $order['shipping_country'],\n 'company' => $order['shipping_company']);\n\n return $address;\n }", "public function set_sess_cart_shipping_address()\n {\n $std = new stdClass();\n $std->shipping_first_name = $this->input->post('shipping_first_name', true);\n $std->shipping_last_name = $this->input->post('shipping_last_name', true);\n $std->shipping_email = $this->input->post('shipping_email', true);\n $std->shipping_phone_number = $this->input->post('shipping_phone_number', true);\n $std->shipping_address_1 = $this->input->post('shipping_address_1', true);\n $std->shipping_address_2 = $this->input->post('shipping_address_2', true);\n $std->shipping_country_id = $this->input->post('shipping_country_id', true);\n $std->shipping_state = $this->input->post('shipping_state', true);\n $std->shipping_city = $this->input->post('shipping_city', true);\n $std->shipping_zip_code = $this->input->post('shipping_zip_code', true);\n $std->billing_first_name = $this->input->post('billing_first_name', true);\n $std->billing_last_name = $this->input->post('billing_last_name', true);\n $std->billing_email = $this->input->post('billing_email', true);\n $std->billing_phone_number = $this->input->post('billing_phone_number', true);\n $std->billing_address_1 = $this->input->post('billing_address_1', true);\n $std->billing_address_2 = $this->input->post('billing_address_2', true);\n $std->billing_country_id = $this->input->post('billing_country_id', true);\n $std->billing_state = $this->input->post('billing_state', true);\n $std->billing_city = $this->input->post('billing_city', true);\n $std->billing_zip_code = $this->input->post('billing_zip_code', true);\n $std->use_same_address_for_billing = $this->input->post('use_same_address_for_billing', true);\n if (!isset($std->use_same_address_for_billing)) {\n $std->use_same_address_for_billing = 0;\n }\n\n if ($std->use_same_address_for_billing == 1) {\n $std->billing_first_name = $std->shipping_first_name;\n $std->billing_last_name = $std->shipping_last_name;\n $std->billing_email = $std->shipping_email;\n $std->billing_phone_number = $std->shipping_phone_number;\n $std->billing_address_1 = $std->shipping_address_1;\n $std->billing_address_2 = $std->shipping_address_2;\n $std->billing_country_id = $std->shipping_country_id;\n $std->billing_state = $std->shipping_state;\n $std->billing_city = $std->shipping_city;\n $std->billing_zip_code = $std->shipping_zip_code;\n } else {\n if (empty($std->billing_first_name)) {\n $std->billing_first_name = $std->shipping_first_name;\n }\n if (empty($std->billing_last_name)) {\n $std->billing_last_name = $std->shipping_last_name;\n }\n if (empty($std->billing_email)) {\n $std->billing_email = $std->shipping_email;\n }\n if (empty($std->billing_phone_number)) {\n $std->billing_phone_number = $std->shipping_phone_number;\n }\n if (empty($std->billing_address_1)) {\n $std->billing_address_1 = $std->shipping_address_1;\n }\n if (empty($std->billing_address_2)) {\n $std->billing_address_2 = $std->shipping_address_2;\n }\n if (empty($std->billing_country_id)) {\n $std->billing_country_id = $std->shipping_country_id;\n }\n if (empty($std->billing_state)) {\n $std->billing_state = $std->shipping_state;\n }\n if (empty($std->billing_city)) {\n $std->billing_city = $std->shipping_state;\n }\n if (empty($std->billing_zip_code)) {\n $std->billing_zip_code = $std->shipping_zip_code;\n }\n }\n $this->session->set_userdata('mds_cart_shipping_address', $std);\n }", "private function _generateShippingAddressData(){\n \n $address = new PagSeguroAddress();\n $delivery_address = new Address($this->context->cart->id_address_delivery);\n \n if (!is_null($delivery_address)){\n $address->setCity($delivery_address->city);\n $address->setPostalCode($delivery_address->postcode);\n $address->setStreet($delivery_address->address1);\n $address->setDistrict($delivery_address->address2);\n $address->setComplement($delivery_address->other);\n $address->setCity($delivery_address->city);\n \n $country = new Country($delivery_address->id_country);\n $address->setCountry($country->iso_code);\n \n $state = new State($delivery_address->id_state);\n $address->setState($state->iso_code);\n }\n \n return $address;\n }", "private function addCustomerData($options)\n {\n $this->post['BillingEmail'] = isset($options['email']) ? $options['email'] : null;\n $this->post['BillingPhoneNumber'] = isset($options['phone']) ? $options['phone'] : null;\n }", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function getStreet(array $options = []);", "protected function _getDefaultAddress()\n {\n $result = array(\n 'shipping' => array(\n 'country_id' => null,\n 'city' => null,\n 'region_id' => null,\n 'postcode' => null,\n 'customer_address_id' => false\n ),\n 'billing' => array(\n 'country_id' => null,\n 'city' => null,\n 'region_id' => null,\n 'postcode' => null,\n 'customer_address_id' => false,\n 'use_for_shipping' => Mage::getStoreConfig('firecheckout/general/shipping_address_checkbox_state'),\n 'register_account' => 0\n )\n );\n if (($customer = Mage::getSingleton('customer/session')->getCustomer())\n && ($addresses = $customer->getAddresses())) {\n\n if (!$shippingAddress = $customer->getPrimaryShippingAddress()) {\n foreach ($addresses as $address) {\n $shippingAddress = $address;\n break;\n }\n }\n if (!$billingAddress = $customer->getPrimaryBillingAddress()) {\n foreach ($addresses as $address) {\n $billingAddress = $address;\n break;\n }\n }\n $result['shipping'] = $shippingAddress->getData();\n $result['shipping']['country_id'] = $shippingAddress->getCountryId();\n $result['shipping']['customer_address_id'] = $shippingAddress->getId();\n $result['billing'] = $billingAddress->getData();\n $result['billing']['country_id'] = $billingAddress->getCountryId();\n $result['billing']['customer_address_id'] = $billingAddress->getId();\n $result['billing']['use_for_shipping'] = $shippingAddress->getId() === $billingAddress->getId();\n } else if ($this->getQuote()->getShippingAddress()->getCountryId()) {\n // Estimated shipping cost from shopping cart\n $address = $this->getQuote()->getShippingAddress();\n $result['shipping'] = $address->getData();\n if (!$address->getSameAsBilling()) {\n $address = $this->getQuote()->getBillingAddress();\n $result['billing'] = $address->getData();\n $result['billing']['use_for_shipping'] = false;\n } else {\n $result['billing'] = $result['shipping'];\n $result['billing']['use_for_shipping'] = true;\n }\n } else {\n $detectCountry = Mage::getStoreConfig('firecheckout/geo_ip/country');\n $detectCity = Mage::getStoreConfig('firecheckout/geo_ip/city');\n if ($detectCountry || $detectCity) {\n $remoteAddr = Mage::helper('core/http')->getRemoteAddr();\n try {\n $data = Mage::helper('firecheckout/geoip')->detect($remoteAddr);\n foreach ($data as $key => $value) {\n $result['shipping'][$key] =\n $result['billing'][$key] = $value;\n }\n } catch (Exception $e) {\n $this->_checkoutSession->addError($e->getMessage());\n }\n }\n\n if (empty($result['shipping']['country_id'])\n || !Mage::getResourceModel('directory/country_collection')\n ->addCountryCodeFilter($result['shipping']['country_id'])\n ->loadByStore()\n ->count()) {\n\n $result['shipping']['country_id'] =\n $result['billing']['country_id'] = Mage::helper('core')->getDefaultCountry();\n }\n }\n\n return $result;\n }", "function edd_stripe_setup_billing_address_fields() {\n\n\tif( ! function_exists( 'edd_use_taxes' ) ) {\n\t\treturn;\n\t}\n\n\tif( edd_use_taxes() || 'stripe' !== edd_get_chosen_gateway() || ! edd_get_cart_total() > 0 ) {\n\t\treturn;\n\t}\n\n\t$display = edd_get_option( 'stripe_billing_fields', 'full' );\n\n\tswitch( $display ) {\n\n\t\tcase 'full' :\n\n\t\t\t// Make address fields required\n\t\t\tadd_filter( 'edd_require_billing_address', '__return_true' );\n\n\t\t\tbreak;\n\n\t\tcase 'zip_country' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\t\t\tadd_action( 'edd_after_cc_fields', 'edd_stripe_zip_and_country', 9 );\n\n\t\t\t// Make Zip required\n\t\t\tadd_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' );\n\n\t\t\tbreak;\n\n\t\tcase 'none' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\n\t\t\tbreak;\n\n\t}\n\n}", "public function setShipToAddress($data=null) {\n if(!is_array($data)) {\n $s = $this->getShipping();\n $data = array(\n 'SHIPTONAME' => $s['firstName'] . ' ' . $s['lastName'],\n 'SHIPTOSTREET' => $s['address'],\n 'SHIPTOSTREET2' => $s['address2'],\n 'SHIPTOCITY' => $s['city'],\n 'SHIPTOSTATE' => $s['state'],\n 'SHIPTOCOUNTRYCODE' => $s['country'],\n 'SHIPTOZIP' => $s['zip']\n );\n }\n $this->_payerShipToAddress = $data;\n }", "public function shipping_address_select_field( $fields ) {\n\n\t\t$address_book = $this->get_address_book();\n\t\t$customer_id = wp_get_current_user();\n\n\t\t$address_selector['address_book'] = array(\n\t\t\t'type' => 'select',\n\t\t\t'class' => array( 'form-row-wide', 'address_book' ),\n\t\t\t'label' => __( 'Address Book', 'wc-address-book' ),\n\t\t\t'order' => -1,\n\t\t\t'priority' => -1,\n\t\t);\n\n\t\tif ( ! empty( $address_book ) && false !== $address_book ) {\n\n\t\t\tforeach ( $address_book as $name => $address ) {\n\n\t\t\t\tif ( ! empty( $address[ $name . '_address_1' ] ) ) {\n\t\t\t\t\t$address_selector['address_book']['options'][ $name ] = $this->address_select_label( $address, $name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$address_selector['address_book']['options']['add_new'] = __( 'Add New Address', 'wc-address-book' );\n\n\t\t\t$fields['shipping'] = $address_selector + $fields['shipping'];\n\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function setAddress($data=null) {\n if(!is_array($data)) {\n $b = $this->getBilling();\n $p = $this->getPayment();\n $data = array(\n 'STREET' => $b['address'],\n 'STREET2' => $b['address2'],\n 'CITY' => $b['city'],\n 'STATE' => $b['state'],\n 'COUNTRYCODE' => $b['country'],\n 'ZIP' => $b['zip'],\n 'SHIPTOPHONENUM' => $p['phone']\n );\n }\n $this->_payerAddress = $data;\n }", "function restify_check_delivery() {\n if ($_POST['delivery_is_address']==t('Yes')) {\n foreach($_POST as $key=>$val) {\n if (substr($key, 0, 8)=='address-') {\n $_POST[str_replace('address-', 'delivery-', $key)]=$val;\n }\n }\n }\n}", "private function addCustomerData($options)\n {\n $this->post['email'] = $options['email'];\n $this->post['ip_address'] = $options['ip'];\n }", "function edd_stripe_zip_and_country() {\n\n\t$logged_in = is_user_logged_in();\n\t$customer = EDD()->session->get( 'customer' );\n\t$customer = wp_parse_args( $customer, array( 'address' => array(\n\t\t'line1' => '',\n\t\t'line2' => '',\n\t\t'city' => '',\n\t\t'zip' => '',\n\t\t'state' => '',\n\t\t'country' => ''\n\t) ) );\n\n\t$customer['address'] = array_map( 'sanitize_text_field', $customer['address'] );\n\n\tif( $logged_in ) {\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\tif ( empty( $existing_cards ) ) {\n\n\t\t\t$user_address = edd_get_customer_address( get_current_user() );\n\n\t\t\tforeach( $customer['address'] as $key => $field ) {\n\n\t\t\t\tif ( empty( $field ) && ! empty( $user_address[ $key ] ) ) {\n\t\t\t\t\t$customer['address'][ $key ] = $user_address[ $key ];\n\t\t\t\t} else {\n\t\t\t\t\t$customer['address'][ $key ] = '';\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ( $existing_cards as $card ) {\n\t\t\t\tif ( false === $card['default'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$source = $card['source'];\n\t\t\t\t$customer['address'] = array(\n\t\t\t\t\t'line1' => $source->address_line1,\n\t\t\t\t\t'line2' => $source->address_line2,\n\t\t\t\t\t'city' => $source->address_city,\n\t\t\t\t\t'zip' => $source->address_zip,\n\t\t\t\t\t'state' => $source->address_state,\n\t\t\t\t\t'country' => $source->address_country,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}\n?>\n\t<fieldset id=\"edd_cc_address\" class=\"cc-address\">\n\t\t<legend><?php _e( 'Billing Details', 'edds' ); ?></legend>\n\t\t<p id=\"edd-card-country-wrap\">\n\t\t\t<label for=\"billing_country\" class=\"edd-label\">\n\t\t\t\t<?php _e( 'Billing Country', 'edds' ); ?>\n\t\t\t\t<?php if( edd_field_is_required( 'billing_country' ) ) { ?>\n\t\t\t\t\t<span class=\"edd-required-indicator\">*</span>\n\t\t\t\t<?php } ?>\n\t\t\t</label>\n\t\t\t<span class=\"edd-description\"><?php _e( 'The country for your billing address.', 'edds' ); ?></span>\n\t\t\t<select name=\"billing_country\" id=\"billing_country\" class=\"billing_country edd-select<?php if( edd_field_is_required( 'billing_country' ) ) { echo ' required'; } ?>\"<?php if( edd_field_is_required( 'billing_country' ) ) { echo ' required '; } ?> autocomplete=\"billing country\">\n\t\t\t\t<?php\n\n\t\t\t\t$selected_country = edd_get_shop_country();\n\n\t\t\t\tif( ! empty( $customer['address']['country'] ) && '*' !== $customer['address']['country'] ) {\n\t\t\t\t\t$selected_country = $customer['address']['country'];\n\t\t\t\t}\n\n\t\t\t\t$countries = edd_get_country_list();\n\t\t\t\tforeach( $countries as $country_code => $country ) {\n\t\t\t\t echo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p id=\"edd-card-zip-wrap\">\n\t\t\t<label for=\"card_zip\" class=\"edd-label\">\n\t\t\t\t<?php _e( 'Billing Zip / Postal Code', 'edds' ); ?>\n\t\t\t\t<?php if( edd_field_is_required( 'card_zip' ) ) { ?>\n\t\t\t\t\t<span class=\"edd-required-indicator\">*</span>\n\t\t\t\t<?php } ?>\n\t\t\t</label>\n\t\t\t<span class=\"edd-description\"><?php _e( 'The zip or postal code for your billing address.', 'edds' ); ?></span>\n\t\t\t<input type=\"text\" size=\"4\" name=\"card_zip\" id=\"card_zip\" class=\"card-zip edd-input<?php if( edd_field_is_required( 'card_zip' ) ) { echo ' required'; } ?>\" placeholder=\"<?php _e( 'Zip / Postal Code', 'edds' ); ?>\" value=\"<?php echo $customer['address']['zip']; ?>\"<?php if( edd_field_is_required( 'card_zip' ) ) { echo ' required '; } ?> autocomplete=\"billing postal-code\" />\n\t\t</p>\n\t</fieldset>\n<?php\n}", "function useDifferentShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = true;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}", "private function getBillingAddress(array $order) {\n\n $address = array('address_book_id' => '',\n 'address_type' => 'bill',\n 'lastname' => $order['payment_lastname'],\n 'firstname' => $order['payment_firstname'],\n 'telephone' => $order['telephone'],\n 'mobile' => '',\n 'gender' => '',\n 'postcode' => $order['payment_postcode'],\n 'city' => $order['payment_city'],\n 'zone_id' => $order['payment_zone_id'],\n 'zone_code' => $order['payment_zone_code'],\n 'zone_name' => $order['payment_zone'],\n 'state' => '',\n 'address1' => $order['payment_address_1'],\n 'address2' => $order['payment_address_2'],\n 'country_id' => $order['payment_country_id'],\n 'country_code' => $order['payment_iso_code_3'],\n 'country_name' => $order['payment_country'],\n 'company' => $order['payment_company']);\n\n return $address;\n }", "function store_shipping_address($order_id)\n\t{\n\t\tif (is_null(post_param('address_name',NULL))) return NULL;\n\n\t\tif (is_null($GLOBALS['SITE_DB']->query_value_null_ok('shopping_order_addresses','id',array('order_id'=>$order_id))))\n\t\t{\n\t\t\t$shipping_address=array();\n\t\t\t$shipping_address['order_id']=$order_id;\n\t\t\t$shipping_address['address_name']=post_param('address_name','');\n\t\t\t$shipping_address['address_street']=post_param('address_street','');\n\t\t\t$shipping_address['address_zip']=post_param('address_zip','');\n\t\t\t$shipping_address['address_city']=post_param('address_city','');\n\t\t\t$shipping_address['address_country']=post_param('address_country','');\n\t\t\t$shipping_address['receiver_email']=post_param('payer_email','');\n\n\t\t\treturn $GLOBALS['SITE_DB']->query_insert('shopping_order_addresses',$shipping_address,true);\t\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function formAddressShipping(Zend_Form $form = null, array $options = array())\n {\n if (isset($options['mode'])){\n $this->_mode = $options['mode'];\n }\n if (isset($options['requiredValidator'])){\n $this->_requiredValidator = $options['requiredValidator'];\n unset($options['requiredValidator']);\n }\n $address = new Cible_Form_SubForm($options);\n $address->setName('addressShipping')\n ->setLegend(Cible_Translation::getCibleText('fieldset_addressShipping'))\n ->setAttrib('class', 'identificationClass subFormClass')\n ->removeDecorator('DtDdWrapper');\n $addr = new Cible_View_Helper_FormAddress($address);\n $addr->duplicateAddress($address);\n $addr->enableFields(array(\n 'firstTel',\n 'secondTel',\n 'firstAddress',\n 'cityTxt',\n 'zipCode',\n 'country',\n 'state',\n ));\n\n $addr->formAddress();\n $address->getElement('AI_FirstAddress')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-12'))));\n $address->setRowDecorator(array($address->getElement('AI_FirstAddress')->getName()), 'addrOne');\n $address->getElement('AI_FirstTel')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('AI_SecondTel')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $secRow = array(\n $address->getElement('AI_FirstTel')->getName(),\n $address->getElement('AI_SecondTel')->getName(),\n );\n $address->setRowDecorator($secRow, 'addrTwo');\n $address->getElement('A_CityTextValue')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('A_StateId')->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $thirdRow = array(\n $address->getElement('A_CityTextValue')->getName(),\n $address->getElement('A_ZipCode')->getName(),\n );\n $address->setRowDecorator($thirdRow, 'addrThree');\n $address->getElement('A_ZipCode')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $address->getElement('A_CountryId')\n ->setAttrib('class', 'full-width')\n ->setDecorators(array('ViewHelper', 'Errors',\n array('Label', array('class'=> 'full-width') ),\n array('row' => 'HtmlTag', array('tag' => 'div', 'class' => 'col-md-6'))));\n $fourthRow = array(\n $address->getElement('A_StateId')->getName(),\n $address->getElement('A_CountryId')->getName(),\n );\n $address->setRowDecorator($fourthRow, 'addrFour', array('class' => 'row '));\n $address->setAttrib('class', 'col-md-6');\n $hiddenId = new Zend_Form_Element_Hidden('MP_ShippingAddrId');\n $hiddenId->setDecorators(array('ViewHelper'));\n $address->addElement($hiddenId);\n $form->addSubForm($address, 'addressShipping');\n }", "public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}", "function idc_save_shipping_info($user_id, $order_id, $paykey = '', $fields = null, $source = '') {\n\tif (!empty($fields)) {\n\t\t$address_info = get_user_meta($user_id, 'md_shipping_info', true);\n\t\tif (empty($address_info)) {\n\t\t\t$address_info = array(\n\t\t\t\t'address' => '',\n\t\t\t\t'address_two' => '',\n\t\t\t\t'city' => '',\n\t\t\t\t'state' => '',\n\t\t\t\t'zip' => '',\n\t\t\t\t'country' => ''\n\t\t\t);\n\t\t}\n\t\tforeach ($fields as $field) {\n\t\t\tif (array_key_exists($field['name'], $address_info)) {\n\t\t\t\tif (!empty($field['value'])) {\n\t\t\t\t\t$address_info[$field['name']] = sanitize_text_field(str_replace('%20', ' ', $field['value']));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the Address info to shipping info to show in Account tab\n\t\tif (!empty($address_info)) {\n\t\t\tupdate_user_meta($user_id, 'md_shipping_info', $address_info);\n\t\t}\n\n\t\t// Adding address to order meta as well, in case needed\n\t\tID_Member_Order::update_order_meta($order_id, 'shipping_info', $address_info);\n\t}\n}", "protected function _setShippingAddress(Mage_Sales_Model_Order $order, array $postData)\n {\n $order->getShippingAddress()\n ->setFirstname($postData['firstname'])\n ->setLastname($postData['lastname'])\n ->setCompany($postData['company'])\n ->setStreetFull($postData['street'])\n ->setCity($postData['city'])\n ->setPostcode($postData['postcode'])\n ->setCountryId($postData['country_id'])\n ;\n }", "public function getDeliveryOption($default_country = null, $doNotAutoSelectOptions = false, $use_cache = true){\n static $cache = array();\n $cache_id = (int)(is_object($default_country) ? $default_country->country_id : 0).'_'.(int)$doNotAutoSelectOptions;\n if (isset($cache[$cache_id]) && $use_cache){\n return $cache[$cache_id];\n }\n $delivery_option_list = $this->getDeliveryOptionList($default_country);\n\n // The delivery option was selected\n if (isset($this->delivery_option) && $this->delivery_option != '') {\n $delivery_option = Tools::unSerialize($this->delivery_option);\n $validated = true;\n foreach ($delivery_option as $address_id => $key) {\n if (!isset($delivery_option_list[$address_id][$key])) {\n $validated = false;\n break;\n }\n }\n\n if ($validated){\n $cache[$cache_id] = $delivery_option;\n return $delivery_option;\n }\n }\n\n if ($doNotAutoSelectOptions){ return false; }\n\n // No delivery option selected or delivery option selected is not valid, get the better for all options\n $delivery_option = array();\n foreach ($delivery_option_list as $address_id => $options)\n {\n foreach ($options as $key => $option) {\n if (JeproshopSettingModelSeting::getValue('default_carrier') == -1 && $option['is_best_price']) {\n $delivery_option[$address_id] = $key;\n break;\n } elseif (JeproshopSettingModelSeting::getValue('default_carrier') == -2 && $option['is_best_grade']) {\n $delivery_option[$address_id] = $key;\n break;\n } elseif ($option['unique_carrier'] && in_array(JeproshopSettingModelSeting::getValue('default_carrier'), array_keys($option['carrier_list']))) {\n $delivery_option[$address_id] = $key;\n break;\n }\n }\n\n reset($options);\n if (!isset($delivery_option[$address_id]))\n $delivery_option[$address_id] = key($options);\n }\n\n $cache[$cache_id] = $delivery_option;\n\n return $delivery_option;\n }", "public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }", "function give_require_billing_address( $payment_mode ) {\n\n\t$return = false;\n\t$billing_country = ! empty( $_POST['billing_country'] ) ? give_clean( $_POST['billing_country'] ) : 0; // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\tif ( $billing_country || did_action( \"give_{$payment_mode}_cc_form\" ) || did_action( 'give_cc_form' ) ) {\n\t\t$return = true;\n\t}\n\n\t// Let payment gateways and other extensions determine if address fields should be required.\n\treturn apply_filters( 'give_require_billing_address', $return );\n\n}", "public function setShippingAddress($shippingAddress = '') {\n $address = array(\n 'x_ship_to_address'=>$this->truncateChars($shippingAddress, 60),\n );\n $this->NVP = array_merge($this->NVP, $address); \n }", "public function toOptionArray()\n {\n return [\n [\n 'value' => self::DM_BILL_STR1,\n 'label' => 'HPP_BILLING_STREET1',\n ],\n [\n 'value' => self::DM_BILL_STR2,\n 'label' => 'HPP_BILLING_STREET2',\n ],\n [\n 'value' => self::DM_BILL_CITY,\n 'label' => 'HPP_BILLING_CITY',\n ],\n [\n 'value' => self::DM_BILL_POSTAL,\n 'label' => 'HPP_BILLING_POSTALCODE',\n ],\n [\n 'value' => self::DM_BILL_STATE,\n 'label' => 'HPP_BILLING_STATE',\n ],\n [\n 'value' => self::DM_BILL_COUNTRY,\n 'label' => 'BILLING_CO',\n ],\n [\n 'value' => self::DM_SHIPPING_FIRST,\n 'label' => 'HPP_SHIPPING_FIRSTNAME',\n ],\n [\n 'value' => self::DM_SHIPPING_LAST,\n 'label' => 'HPP_SHIPPING_LASTNAME',\n ],\n [\n 'value' => self::DM_SHIPPING_PHONE,\n 'label' => 'HPP_SHIPPING_PHONE',\n ],\n [\n 'value' => self::DM_SHIPPING_METHOD,\n 'label' => 'HPP_SHIPPING_SHIPPINGMETHOD',\n ],\n [\n 'value' => self::DM_SHIPPING_STR1,\n 'label' => 'HPP_SHIPPING_STREET1',\n ],\n [\n 'value' => self::DM_SHIPPING_STR2,\n 'label' => 'HPP_SHIPPING_STREET2',\n ],\n\n [\n 'value' => self::DM_SHIPPING_CITY,\n 'label' => 'HPP_SHIPPING_CITY',\n ],\n [\n 'value' => self::DM_SHIPPING_POSTAL,\n 'label' => 'HPP_SHIPPING_POSTALCODE',\n ],\n [\n 'value' => self::DM_SHIPPING_STATE,\n 'label' => 'HPP_SHIPPING_STATE',\n ],\n [\n 'value' => self::DM_SHIPPING_COUNTRY,\n 'label' => 'SHIPPING_CO',\n ],\n [\n 'value' => self::DM_CUSTOMER_ID,\n 'label' => 'HPP_CUSTOMER_ID',\n ],\n [\n 'value' => self::DM_CUSTOMER_DOB,\n 'label' => 'HPP_CUSTOMER_DATEOFBIRTH',\n ],\n [\n 'value' => self::DM_CUSTOMER_EMAIL_DOMAIN,\n 'label' => 'HPP_CUSTOMER_DOMAINNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_EMAIL,\n 'label' => 'HPP_CUSTOMER_EMAIL',\n ],\n [\n 'value' => self::DM_CUSTOMER_FIRST,\n 'label' => 'HPP_CUSTOMER_FIRSTNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_LAST,\n 'label' => 'HPP_CUSTOMER_LASTNAME',\n ],\n [\n 'value' => self::DM_CUSTOMER_PHONE,\n 'label' => 'HPP_CUSTOMER_PHONENUMBER',\n ],\n [\n 'value' => self::DM_PRODUCTS_TOTAL,\n 'label' => 'HPP_PRODUCTS_UNITPRICE',\n ],\n [\n 'value' => self::DM_FRAUD_HOST,\n 'label' => 'HPP_FRAUD_DM_BILLHOSTNAME',\n ],\n [\n 'value' => self::DM_FRAUD_COOKIES,\n 'label' => 'HPP_FRAUD_DM_BILLHTTPBROWSERCOOKIESACCEPTED',\n ],\n [\n 'value' => self::DM_FRAUD_BROWSER,\n 'label' => 'HPP_FRAUD_DM_BILLTOHTTPBROWSERTYPE',\n ],\n [\n 'value' => self::DM_FRAUD_IP,\n 'label' => 'HPP_FRAUD_DM_BILLTOIPNETWORKADDRESS',\n ],\n [\n 'value' => self::DM_FRAUD_TENDER,\n 'label' => 'HPP_FRAUD_DM_INVOICEHEADERTENDERTYPE',\n ],\n ];\n }", "public function needs_shipping_address() {\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping_address', true === $this->needs_shipping() && ! wc_ship_to_billing_address_only() );\n\t}", "public function ValidateGuestCheckoutAddress($type, &$errors)\n\t{\n\t\t$address = array();\n\t\t$errors = array();\n\n\t\t// for the billing address we need to validate the email address\n\t\t$email = '';\n\t\tif($type == 'billing' && !customerIsSignedIn()) {\n\t\t\t$emailField = $GLOBALS['ISC_CLASS_FORM']->getFormField(FORMFIELDS_FORM_ACCOUNT, '1', '', true);\n\t\t\t$email = $emailField->getValue();\n\n\t\t\tif($email == '' || !is_email_address($email)) {\n\t\t\t\t$errors[] = GetLang('AccountEnterValidEmail');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// if guess checkout enabled and guess account creation on checkout is enabled and the entered email is already exist in the system\n\t\t\t// then we do email existance checking\n\t\t\t$customer = GetClass('ISC_CUSTOMER');\n\t\t\tif(getConfig('GuestCheckoutEnabled') && getConfig('GuestCheckoutCreateAccounts') && $customer->AccountWithEmailAlreadyExists($email)) {\n\t\t\t\t$errors[] = sprintf(GetLang('AccountEmailTaken'), isc_html_escape($email));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$address['shipemail'] = $email;\n\t\t}\n\n\t\trequire_once(ISC_BASE_PATH . '/lib/addressvalidation.php');\n\n\t\t// parse the form fields and validate them\n\t\t$errmsg = '';\n\t\tif($type == 'billing') {\n\t\t\t$formFieldType = FORMFIELDS_FORM_BILLING;\n\t\t}\n\t\telse {\n\t\t\t$formFieldType = FORMFIELDS_FORM_SHIPPING;\n\t\t}\n\n\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formFieldType, true);\n\n\t\t$countryFieldId = 0;\n\t\t$stateFieldId = 0;\n\t\tforeach($fields as $fieldId => $formField) {\n\t\t\tif($formField->record['formfieldprivateid'] == 'Country') {\n\t\t\t\t$countryFieldId = $fieldId;\n\t\t\t}\n\t\t\telse if($formField->record['formfieldprivateid'] == 'State') {\n\t\t\t\t$stateFieldId = $fieldId;\n\t\t\t}\n\t\t}\n\n\t\t// Mark the state field as being optional if there are no states in the\n\t\t// selected country.\n\t\tif ($countryFieldId && $stateFieldId) {\n\t\t\t$countryId = GetCountryByName($fields[$countryFieldId]->getValue());\n\t\t\t$stateOptions = GetStateListAsIdValuePairs($countryId);\n\n\t\t\tif (is_array($stateOptions) && !empty($stateOptions)) {\n\t\t\t\t$fields[$stateFieldId]->setOptions($stateOptions);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$fields[$stateFieldId]->setRequired(false);\n\t\t\t}\n\t\t}\n\n\t\tif (!validateFieldData($fields, $errmsg)) {\n\t\t\t$errors[] = $errmsg;\n\t\t\treturn false;\n\t\t}\n\n\t\t$fieldMap = array(\n\t\t\t'FirstName' => 'firstname',\n\t\t\t'LastName' => 'lastname',\n\t\t\t'CompanyName' => 'company',\n\t\t\t'AddressLine1' => 'address1',\n\t\t\t'AddressLine2' => 'address2',\n\t\t\t'City' => 'city',\n\t\t\t'State' => 'state',\n\t\t\t'Country' => 'country',\n\t\t\t'Zip' => 'zip',\n\t\t\t'Phone' => 'phone',\n\t\t\t'Email' => 'email',\n\t\t);\n\n\t\tforeach($fields as $fieldId => $formField) {\n\t\t\t// This isn't a built in field, so save the value for later handling\n\t\t\tif(!$formField->record['formfieldprivateid']) {\n\t\t\t\t$address['customFormFields'][$fieldId] = $formField->getValue();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Disregard any fields we don't know about\n\t\t\telse if(!isset($fieldMap[$formField->record['formfieldprivateid']])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$key = 'ship' . $fieldMap[$formField->record['formfieldprivateid']];\n\t\t\t$address[$key] = $formField->getValue();\n\t\t}\n\n\t\treturn $address;\n\t}", "public function add_delivery_address(){\n $save_data['customer_id'] = $_REQUEST['customer_id'];\n $save_data['address_title'] = $_REQUEST['address_title'];\n $save_data['address'] = $_REQUEST['address'];\n $save_data['country_id'] = $_REQUEST['country_id'];\n $save_data['state_id'] = $_REQUEST['state_id'];\n $save_data['city_id'] = $_REQUEST['city_id'];\n $save_data['pincode'] = $_REQUEST['pincode'];\n\n $is_default = $_REQUEST['is_default'];\n $customer_id = $_REQUEST['customer_id'];\n\n $address_id = $this->User_Model->save_data('delivery_address', $save_data);\n if ($address_id) {\n if($is_default == 1){\n $up_data1['is_default'] = 0;\n $this->User_Model->update_info('customer_id', $customer_id, 'delivery_address', $up_data1);\n $up_data2['is_default'] = 1;\n $this->User_Model->update_info('address_id', $address_id, 'delivery_address', $up_data2);\n }\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Address Saved Successfuly\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Address Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }" ]
[ "0.73244375", "0.61901116", "0.6184904", "0.6105477", "0.60853773", "0.608445", "0.60805005", "0.6030986", "0.6005295", "0.5986377", "0.5928364", "0.59214926", "0.59046155", "0.5876022", "0.5863342", "0.5849309", "0.5841731", "0.58101356", "0.57722956", "0.5761561", "0.5743145", "0.5710699", "0.5704249", "0.56998587", "0.56913173", "0.5656799", "0.5648897", "0.5645779", "0.56151485", "0.56039745" ]
0.7215753
1
Returns fraud review from gateway response
private function fraudReviewFrom($response) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_correct_response()\n {\n return null;\n }", "public function reportaproblem() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->problem_type):\n // && !empty($request_data->comment):\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } else {\n\n $dataArray = array();\n $dataArray['Feedback']['problem_type'] = $request_data->problem_type;\n if (!empty($request_data->spam_or_abuse_type))\n $dataArray['Feedback']['spam_or_abuse_type'] = $request_data->spam_or_abuse_type;\n $dataArray['Feedback']['comment'] = trim($request_data->comment);\n $dataArray['Feedback']['user_id'] = (string) $data[0]['User']['_id'];\n\n if ($this->Feedback->save($dataArray)) {\n $success = true;\n $status = SUCCESS;\n $message = 'Your problem has been saved.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Problem type blank in request\n case!empty($request_data) && empty($request_data->problem_type):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Problem type cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function get_correct_response() \n {\n return array('answer' => 0);\n }", "private function reviewDestiny()\n {\n $this->setExpectations();\n return $this->reviewTicket();\n }", "function getRecommendationFeedbackbyID($recID){\n\n\tglobal $dclserver;\n\n\t//print \"Rec ID is \".$recID;\n\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/SupportingLayer/RecommendationFeedback/$recID\";\n\t$recommendationFeedbackJson=getJsonRest($url);\n\t\n\tif(count($recommendationFeedbackJson)>0)\n\t\n\t\t\tif($recommendationFeedbackJson[0]['rate']==1)\n\t\t\t\tprint \"I liked the Recommendation. \". $recommendationFeedbackJson[0]['reason'];\n\t\t\telse if($recommendationFeedbackJson[0]['rate']==0)\n\t\t\t\tprint \"I did not like the Recommendation.\". $recommendationFeedbackJson[0]['reason'];\n\t\n\n\n}", "function freelancer_review_action() {\n global $user_ID;\n $args = $_POST;\n $project_id = $args['project_id'];\n \n $status = get_post_status($project_id);\n \n $bid_id_accepted = get_post_meta($project_id, 'accepted', true);\n \n $author_bid = (int)get_post_field('post_author', $bid_id_accepted);\n \n $freelancer_id = get_post_field('post_author', $bid_id_accepted);\n \n /*\n * validate data\n */\n if (!isset($args['score']) || empty($args['score'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('You have to rate this project.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n if (!isset($args['comment_content']) || empty($args['comment_content'])) {\n $result = array(\n 'succes' => false,\n 'msg' => __('Please post a review for this freelancer.', ET_DOMAIN)\n );\n wp_send_json($result);\n }\n \n /*\n * check permission\n */\n if ($user_ID !== $author_bid || !$user_ID) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You don\\'t have permission to review.', ET_DOMAIN)\n ));\n }\n \n /*\n * check status of project\n */\n if ($status !== 'complete') {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You can\\'t not reivew on this project.', ET_DOMAIN)\n ));\n }\n \n /**\n * check user reviewed project owner or not\n * @author Dan\n */\n $role = ae_user_role($user_ID);\n $type = 'em_review';\n if ($role == FREELANCER) {\n $type = 'fre_review';\n }\n \n $comment = get_comments(array(\n 'status' => 'approve',\n 'type' => $type,\n 'post_id' => $project_id\n ));\n \n if (!empty($comment)) {\n wp_send_json(array(\n 'succes' => false,\n 'msg' => __('You have reviewed on this project.', ET_DOMAIN)\n ));\n }\n \n // end check user review project owner\n \n // add review\n $args['comment_post_ID'] = $project_id;\n $args['comment_approved'] = 1;\n $this->comment_type = 'fre_review';\n $review = Fre_Review::get_instance(\"fre_review\");\n \n $comment = $review->insert($args);\n \n if (!is_wp_error($comment)) {\n \n /**\n * fire action after freelancer review employer base on project\n * @param int $int project id\n * @param Array $args submit args (rating score, comment)\n * @since 1.2\n * @author Dakachi\n */\n do_action('fre_freelancer_review_employer', $project_id, $args);\n \n //update project, bid, bid author, project author after review\n $this->update_after_fre_review($project_id, $comment);\n wp_send_json(array(\n 'success' => true,\n 'msg' => __(\"Your review has been submitted.\", ET_DOMAIN)\n ));\n } else {\n \n // revert bid status\n wp_update_post(array(\n 'ID' => $bid_id_accepted,\n 'post_status' => 'publish'\n ));\n \n wp_send_json(array(\n 'success' => false,\n 'msg' => $comment->get_error_message()\n ));\n }\n }", "function ProcessRiskInformationNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Risk information notifications provide financial information about\n * a transaction to help you ensure that an order is not fraudulent.\n * A <risk-information-notification> includes the customer's billing\n * address, a partial credit card number and other values to help you\n * verify that an order is not fraudulent. Google Checkout will send you a\n * <risk-information-notification> message after completing its\n * risk analysis on a new order.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <risk-information-notification> to your internal systems that\n * process this order data.\n */\n /*\n Google AVS constants\n Y - Full AVS match (address and postal code)\n P - Partial AVS match (postal code only)\n A - Partial AVS match (address only)\n N - No AVS match\n U - AVS not supported by issuer\n Google CVN constants\n M - CVN match\n N - No CVN match\n U - CVN not available\n E - CVN error\n */\n $dom_data_root = $dom_response_obj->document_element();\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n $avs_data = $dom_data_root->get_elements_by_tagname(\"avs-response\");\n $avs = $avs_data[0]->get_content();\n $cvn_data = $dom_data_root->get_elements_by_tagname(\"cvn-response\");\n $cvn = $cvn_data[0]->get_content();\n // decode risk information\n $avs_string = '';\n switch($avs)\n {\n case 'Y': $avs_string = 'Full AVS match (address and postal code)'; break;\n case 'P': $avs_string = 'Partial AVS match (postal code only)'; break;\n case 'A': $avs_string = 'Partial AVS match (address only)'; break;\n case 'N': $avs_string = 'No AVS match'; break;\n case 'U': $avs_string = 'AVS not supported by issuer'; break;\n }\n $cvn_string = '';\n switch($cvn)\n {\n case 'M': $cvn_string = 'CVN match'; break;\n case 'N': $cvn_string = 'No CVN match'; break;\n case 'U': $cvn_string = 'CVN not available'; break;\n case 'E': $cvn_string = 'CVN error'; break;\n }\n $message = \"Risk Information:\\n\" . $avs_string . \"\\n\" . $cvn_string;\n // put results to the order status history\n $order = tep_db_fetch_array(tep_db_query(\"select orders_id, orders_status from \" . TABLE_ORDERS . \" where google_orders_id='\" . $number . \"'\"));\n tep_db_query(\"insert into \" . TABLE_ORDERS_STATUS_HISTORY . \" (orders_id, orders_status_id, date_added, comments) values('\" . $order['orders_id'] . \"', '\" . $order['orders_status'] . \"', now(), '\" . $message . \"')\");\n SendNotificationAcknowledgment();\n}", "function zg_ai_interpret_debate_results($bot) {\n $data = zg_ai_get_last_value();\n zg_ai_out($data, 'debate results data from last value');\n $server_response = reset($data);\n $success = FALSE;\n\n if ($server_response === 'debate-won') {\n $success = TRUE;\n }\n\n if ($server_response === 'debate-no-action') {\n // FIXME: consider spending Luck to refill actions?\n }\n\n// if ($server_response == 'debate-must-wait') {\n// }\n\n if ($server_response === 'debate-lost') {\n return zg_ai_goals_type([\n ['increase elocution stats']\n ]);\n }\n\n return zg_ai_data_type([$success]);\n}", "public function getReviewAction()\n\t{\n\t\t$this->_ajaxValidation();\n\t\t$response['content']=$this->_getReviewHtml();\n\t\t$this->getResponse()->setBody(json_encode($response));\n\t}", "function getReview()\n {\n $this->logged_in = $this->flexi_auth->is_logged_in();\n if (!$this->logged_in) {\n # if not logged show error message\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $receiver_id = intval($this->input->post('receiver_id'));\n if (!$receiver_id) {\n $dataArr = array();\n $pageArr = array('controller' => 'review', 'view' => 'error');\n $this->ajax->render($pageArr, $dataArr);\n }\n\n $login_id = $this->flexi_auth->get_user_id();\n $reviewDtlArr = $this->review->getReviewsByReceiver($receiver_id);\n $receiverArr = array();\n $userDtlArr = array();\n if (count($reviewDtlArr)) {\n foreach ($reviewDtlArr as $key => $value) {\n # code...\n array_push($receiverArr, $value['sender_id']);\n }\n array_push($receiverArr, $receiver_id);\n $receiverArr = array_unique($receiverArr);\n $receiverArr = array_filter($receiverArr);\n\n if (count($receiverArr)) {\n\n foreach ($receiverArr as $key_2 => $value_2) {\n # code...\n $tempUserArr = array();\n array_push($tempUserArr, $this->user->getUserDetailsById($value_2));\n $userDtlArr[$value_2] = isset($tempUserArr[0][0]) ? $tempUserArr[0][0] : '';\n }\n }\n $userDtlArr = array_filter($userDtlArr);\n\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => true,\n 'userDtlArr' => $userDtlArr,\n 'reviewDtlArr' => $reviewDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n\n } else {\n $tempUserArr = $this->user->getUserDetailsById($receiver_id);\n $userDtlArr[$receiver_id] = isset($tempUserArr[0]) ? $tempUserArr[0] : '';\n #print_r($userDtlArr);\n $pageArr = array(\n 'controller' => 'review',\n 'view' => 'show_review'\n );\n $dataArr = array(\n 'receiver_id' => $receiver_id,\n 'review_count' => false,\n 'userDtlArr' => $userDtlArr\n );\n $this->ajax->render($pageArr, $dataArr);\n }\n\n\n }", "public function getReviewstate() {}", "function ajaxAdsReview()\n{\n header('Content-type: application/json');\n\n $retour = new \\stdClass();\n $retour->error = false;\n $retour->message = 'ok';\n\n $fields = $_POST['fields'];\n $fields = json_decode(stripslashes($fields));\n\n $refClient = $fields->choisir_client_leboncoin; // vaut false si prospect ou nouveau ou ref_eleve (si !prospect )\n\n $phone = $fields->phone;\n\n if (! $phone) {\n $phone = 'pas-de-num';\n }\n\n $lbcProcessMg = new \\spamtonprof\\stp_api\\LbcProcessManager();\n $lbcAcctMg = new \\spamtonprof\\stp_api\\LbcAccountManager();\n\n $ads = $lbcProcessMg->generateAds($refClient, 50, $phone);\n $lbcAccts = $lbcAcctMg->getAll(array(\n 'ref_client' => $refClient\n ));\n\n $emails = [];\n foreach ($lbcAccts as $lbcAcct) {\n $emails[] = $lbcAcct->getMail();\n }\n\n // récupération des prénoms du client\n \n $clientMg = new \\spamtonprof\\stp_api\\LbcClientManager();\n $client = $clientMg->get(array('ref_client' => $refClient));\n \n $prenomMg = new \\spamtonprof\\stp_api\\PrenomLbcManager();\n $prenoms = $prenomMg -> getAll(array('ref_cat_prenom' => $client->getRef_cat_prenom()));\n \n \n \n // récupération des réponses du client\n $texteMg = new \\spamtonprof\\stp_api\\LbcTexteManager();\n $reponses = $texteMg -> getAll(array(\"ref_type_texte\" => $client->getRef_reponse_lbc()));\n \n \n $retour->phone = $phone;\n $retour->refClient = $refClient;\n $retour->ads = $ads;\n $retour->emails = $emails;\n $retour->prenoms = $prenoms;\n $retour->reponses = $reponses;\n \n \n \n echo (json_encode($retour));\n\n die();\n}", "public function feedback_api_post()\n {\n $data=($_POST);\n $result = $this->Post_project_model->save_feedback_freelancer($data);\n return $this->response($result);\n }", "public function story_response()\n {\n $user_id = $this->_require_login();\n $this->_require_register();\n\n $post_data = $this->input->post(NULL, TRUE);\n $story_id = $post_data['story_id'];\n $story = $this->story_model->get($story_id);\n\n if($this->_is_user_bottle($story_id) == 0 && $story[0]['story_user_id'] != $user_id){\n redirect('/pick');\n }else{\n\n $reply_to_id = $story[0]['story_user_id'];\n\n $reply_data = array(\n 'reply_sender_id' => $user_id,\n 'reply_story_id' => $story_id,\n 'reply_to_id' => $post_data['reply_to_id'],\n 'reply_text' => $post_data['response_content'],\n 'reply_time' => date(\"Y-m-d H:i:s\")\n );\n\n $reply_id = $this->reply_model->insert($reply_data);\n redirect('/bottles/'.$story_id);\n }\n }", "function getFeedback($req){\n\n require_once __DIR__ . \"/../../models/volunteerModel.php\";\n\n $volunteer = new volunteerModel();\n\n $result = $volunteer->get_volunteer_review_by_id($req['params']['voluntId']);\n\n $output = array();\n\n if ($result){\n $output = array_merge(array(), $result);\n }\n\n Response::status(200);\n Response::json($output);\n\n}", "public function getReview(){\r\n\t\treturn $this->SupportReviews();\r\n\t}", "public function giftcard()\n {\n // for API brands\n $var = preg_split(\"/\\//\", $this->url->current());\n $new = str_replace('%20', ' ', $var[5]);\n try {\n $client = new GuzzleHttpClient();\n $apiRequest = $client->request('GET', 'https://eo2i7chdqb.execute-api.us-east-1.amazonaws.com/dev/api/templates');\n $content = json_decode($apiRequest->getBody()->getContents());\n\n foreach ($content as $key => $value){\n if($value->template == $new){\n $data[] = array(\n 'template' => $value->template,\n 'denominations' => $value->denominations,\n 'thumbnail' => $value->thumbnail,\n );\n }\n }\n $data_array = json_encode($data);\n $data_object['res'] = json_decode($data_array , true);\n $data_object['fword'] = preg_split(\"/\\s+/\", $data[0]['template'], -1, PREG_SPLIT_NO_EMPTY);\n return view('giftcard',$data_object);\n } catch (RequestException $re) {\n }\n }", "public function yelpreview() \n {\n $yelp=Socialmedia::where('name', 'yelp')->value('id');\n $token=Social::where('user_id', Auth::user()->id)->where('social_id',$yelp)->value('api');\n $socialurl = Social::where('user_id', Auth::user()->id, true)->where('social_id', $yelp)->value('secret');\n $url='https://api.yelp.com/v3/businesses/'.$socialurl.'/reviews';\n $response=$this->curl($url, $token);\n $responses = json_decode($response, true);\n if(isset($responses['error']))\n {\n if($responses['error']['code']=='BUSINESS_NOT_FOUND')\n {\n return Redirect::back()->withErrors(['Invalid Business Id', 'The Message']);\n }\n elseif($responses['error']['code']=='TOKEN_INVALID')\n {\n return Redirect::back()->withErrors(['Invalid API ID', 'The Message']);\n }\n elseif($responses['error']['code']=='TOKEN_MISSING')\n {\n return Redirect::back()->withErrors(['Invalid API ID', 'The Message']);\n }\n }\n else\n {\n if(isset($responses['reviews']))\n {\n $reviews=$responses['reviews'];\n //$totalrow=count($reviews);\n $insertrow=0; $exists=0;\n foreach($reviews as $rating) \n {\n $url=Rating::where('review_type', $yelp)->where('user_url', $rating['url'])->get()->count();\n \n if($url==0)\n {\n $rating=Rating::create([\n 'customer_id'=>Auth::user()->id,\n 'comment'=>$rating['text'],\n 'rating'=>$rating['rating'],\n 'name'=>$rating['user']['name'],\n 'user_url'=>$rating['url'],\n 'review_type'=>$yelp,\n 'created'=>'2017-11-01'\n ]);\n $insertrow++; \n }\n else\n {\n $exists++;\n }\n }\n return Redirect('manage_site')->with('success', 'Feedback Inserted Successfully (Summary:- '.$insertrow. ' New Feedback Inserted - '.$exists.' Feedback Already exists)' );\n }\n }\n }", "protected function _getReviewHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_review');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "public function responded(){\n\t$comment_id = ee()->TMPL->fetch_param('comment_id');\n\tee()->db->where('parent_id',$comment_id);\n\t$count = ee()->db->count_all_results('exp_mtt_ratings');\n\tif($count > 0){return 'y';}\n\telse{return 'n';}\t\n\t}", "function getRecommendationFeedbackbyUserID($uid){\n\n\n\t\t$sentiment = array(\n\t\t\t\t\t\"sittingpositive\" => 0,\n\t\t\t\t\t\"sittingnegative\" => 0,\n\t\t\t\t\t\"standingpositive\"=> 0,\n\t\t\t\t\t\"standingnegative\"=> 0,\n\t\t\t\t\t\"walkingpositive\" => 0,\n\t\t\t\t\t\"walkingnegative\" => 0,\n\t\t\t\t\t\"runningpositive\" => 0,\n\t\t\t\t\t\"runningnegative\" => 0,\n\t\t\t\t\t\"LyingDownpositive\" => 0,\n\t\t\t\t\t\"LyingDownnegative\" => 0,\n\t\t\t\t\t\"joggingpositive\" => 0,\n\t\t\t\t\t\"joggingnegative\" => 0\n\t\t\t\t);\t\t\n\n\t\tglobal $dclserver;\n\t\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/SupportingLayer/RecommendationFeedbackByUserID/$uid\";\n\t\t$getRecommendationFeedbackbyUserID=getJsonRest($url);\n\n\t\t$positive=0;\n\t\t$negative=0;\n\t\tfor($i=0;$i<count($getRecommendationFeedbackbyUserID);$i++){\n\n\t\t\t\n\t\t\t\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Sitting\")\n\t\t\t\t$sentiment[\"sittingpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Sitting\")\n\t\t\t\t$sentiment[\"sittingnegative\"]++;\n\t\t\t\t\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Standing\")\n\t\t\t\t$sentiment[\"standingpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Standing\")\n\t\t\t\t$sentiment[\"standingnegative\"]++;\n\t\t\t\t\n\t\t\t\t\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Walking\")\n\t\t\t\t$sentiment[\"walkingpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Walking\")\n\t\t\t\t$sentiment[\"walkingnegative\"]++;\t\t\n\n\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Running\")\n\t\t\t\t$sentiment[\"runningpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Running\")\n\t\t\t\t$sentiment[\"runningnegative\"]++;\t\n\t\t\t\n\t\t\t\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"LyingDown\")\n\t\t\t\t$sentiment[\"LyingDownpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"LyingDown\")\n\t\t\t\t$sentiment[\"LyingDownnegative\"]++;\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\tif($getRecommendationFeedbackbyUserID[$i]['rate']==1 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Jogging\")\n\t\t\t\t$sentiment[\"joggingpositive\"]++;\n\t\t\telse if($getRecommendationFeedbackbyUserID[$i]['rate']==0 && $getRecommendationFeedbackbyUserID[$i]['situationCategoryDescription']==\"Jogging\")\n\t\t\t\t$sentiment[\"joggingnegative\"]++;\t\t\t\t\t\n}\n\t\n\t\t\n\t\t\n\treturn $sentiment;\n\t\n\n\n}", "public function get_autograde_feedback(array $response)\n {\n list(, $files) = $this->get_files_necessary_for_testing($response);\n\n //If this response has no files, then notify the user, and don't\n //generate any feedback.\n if(!count($files)) {\n return get_string('pleasesubmit', 'qtype_vhdl');\n }\n\n try\n {\n //process the response, and extract feedback\n $processed = $this->process_response($response);\n return $processed['feedback'];\n }\n catch(SimulationException $e)\n {\n return $e->getMessage();\n }\n }", "public function showResponse($token)\n {\n $pipeline_details = WorkTypeData::where('comparisonToken.token', $token)->first();\n if (isset($pipeline_details->insurerResponse['mailStatus'])) {\n if ($pipeline_details->insurerResponse['mailStatus'] == 'active') {\n $insurerReplay = $pipeline_details['insurerReply'];\n foreach ($insurerReplay as $insures_rep) {\n if (isset($insures_rep['customerDecision'])) {\n if ($insures_rep['quoteStatus'] == 'active' && $insures_rep['customerDecision']['decision'] == 'Approved') {\n $insures_details = $insures_rep;\n break;\n }\n }\n }\n $pipelineId = $pipeline_details->_id;\n $workType = $pipeline_details->workTypeId['name'];\n\n\n $eQuotationData = [];\n $InsurerData = [];\n $Insurer = [];\n $formValues = $pipeline_details;\n\n $d = $pipeline_details['eSlipData'];\n $formData = [];\n if (!empty($d)) {\n foreach ($d as $step => $value) {\n foreach ($value as $key => $val) {\n $formData[$val['fieldName']] = $val;\n }\n }\n }\n if ($pipeline_details) {\n $eQuotationData = $pipeline_details->eSlipData;\n $Insurer = [];\n foreach ($pipeline_details->insurerReply as $insurer) {\n if ($pipeline_details->selected_insurers) {\n foreach ($pipeline_details->selected_insurers as $selected) {\n if ($insurer['quoteStatus'] == 'active') {\n if ($selected['insurer'] == $insurer['uniqueToken']) {\n if (!empty($insurer['customerDecision']) && $insurer['customerDecision']['decision'] == \"Approved\") {\n $Insurer[] = $insurer;\n }\n\n }\n }\n }\n }\n }\n $InsurerData = $this->flip($Insurer);\n }\n\n return view('pages.insurer_view_approval')->with(\n compact(\n 'pipelineId',\n 'pipeline_details',\n 'insures_details',\n 'InsurerData',\n 'formValues',\n 'formData',\n 'Insurer'\n )\n );\n } else {\n Session::flash('msg', 'You have already responded to the request');\n return redirect('customer-notification');\n }\n } else {\n return view('error');\n }\n }", "function bb2_get_response($key)\n{\n\t$bb2_responses = [\n\t\t'00000000' => ['response' => 200, 'explanation' => '', 'log' => 'Permitted'],\n\t\t'136673cd' => ['response' => 403, 'explanation' => 'Your Internet Protocol address is listed on a blacklist of addresses involved in malicious or illegal activity. See the listing below for more details on specific blacklists and removal procedures.', 'log' => 'IP address found on external blacklist'],\n\t\t'17566707' => ['response' => 403, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Required header \\'Accept\\' missing'],\n\t\t'17f4e8c8' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User-Agent was found on blacklist'],\n\t\t'21f11d3f' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a mobile Web device, but you do not actually appear to be a mobile Web device.', 'log' => 'User-Agent claimed to be AvantGo, claim appears false'],\n\t\t'2b021b1f' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'IP address found on http:BL blacklist'],\n\t\t'2b90f772' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. If you are using the Opera browser, then Opera must appear in your user agent.', 'log' => 'Connection: TE present, not supported by MSIE'],\n\t\t'35ea7ffa' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Check your browser\\'s language and locale settings.', 'log' => 'Invalid language specified'],\n\t\t'408d7e72' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'POST comes too quickly after GET'],\n\t\t'41feed15' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by a malfunctioning proxy server. Bypass the proxy server and connect directly, or contact your proxy server administrator.', 'log' => 'Header \\'Pragma\\' without \\'Cache-Control\\' prohibited for HTTP/1.1 requests'],\n\t\t'45b35e30' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Header \\'Referer\\' is corrupt'],\n\t\t'57796684' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Prohibited header \\'X-Aaaaaaaaaa\\' or \\'X-Aaaaaaaaaaaa\\' present'],\n\t\t'582ec5e4' => ['response' => 400, 'explanation' => 'An invalid request was received. If you are using a proxy server, bypass the proxy server or contact your proxy server administrator. This may also be caused by a bug in the Opera web browser.', 'log' => '\"Header \\'TE\\' present but TE not specified in \\'Connection\\' header'],\n\t\t'69920ee5' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Header \\'Referer\\' present but blank'],\n\t\t'6c502ff1' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Bot not fully compliant with RFC 2965'],\n\t\t'70e45496' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User agent claimed to be CloudFlare, claim appears false'],\n\t\t'71436a15' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be Yahoo, claim appears to be false'],\n\t\t'799165c2' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Rotating user-agents detected'],\n\t\t'7a06532b' => ['response' => 400, 'explanation' => 'An invalid request was received from your browser. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'Required header \\'Accept-Encoding\\' missing'],\n\t\t'7ad04a8a' => ['response' => 400, 'explanation' => 'The automated program you are using is not permitted to access this server. Please use a different program or a standard Web browser.', 'log' => 'Prohibited header \\'Range\\' present'],\n\t\t'7d12528e' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Prohibited header \\'Range\\' or \\'Content-Range\\' in POST request'],\n\t\t'939a6fbb' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Banned proxy server in use'],\n\t\t'96c0bd29' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'URL pattern found on blacklist'],\n\t\t'9c9e4979' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Prohibited header \\'via\\' present'],\n\t\t'a0105122' => ['response' => 417, 'explanation' => 'Expectation failed. Please retry your request.', 'log' => 'Header \\'Expect\\' prohibited; resend without Expect'],\n\t\t'a1084bad' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'User-Agent claimed to be MSIE, with invalid Windows version'],\n\t\t'a52f0448' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by a malfunctioning proxy server or browser privacy software. If you are using a proxy server, bypass the proxy server or contact your proxy server administrator.', 'log' => 'Header \\'Connection\\' contains invalid values'],\n\t\t'b0924802' => ['response' => 400, 'explanation' => 'An invalid request was received. This may be caused by malicious software on your computer.', 'log' => 'Incorrect form of HTTP/1.0 Keep-Alive'],\n\t\t'b40c8ddc' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, close your browser, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'POST more than two days after GET'],\n\t\t'b7830251' => ['response' => 400, 'explanation' => 'Your proxy server sent an invalid request. Please contact the proxy server administrator to have this problem fixed.', 'log' => 'Prohibited header \\'Proxy-Connection\\' present'],\n\t\t'b9cc1d86' => ['response' => 403, 'explanation' => 'The proxy server you are using is not permitted to access this server. Please bypass the proxy server, or contact your proxy server administrator.', 'log' => 'Prohibited header \\'X-Aaaaaaaaaa\\' or \\'X-Aaaaaaaaaaaa\\' present'],\n\t\t'c1fa729b' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Use of rotating proxy servers detected'],\n\t\t'cd361abb' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Data may not be posted from offsite forms.', 'log' => 'Referer did not point to a form on this site'],\n\t\t'd60b87c7' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, please remove any viruses or spyware from your computer.', 'log' => 'Trackback received via proxy server'],\n\t\t'dfd9b1ad' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'Request contained a malicious JavaScript or SQL injection attack'],\n\t\t'e3990b47' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, please remove any viruses or spyware from your computer.', 'log' => 'Obviously fake trackback received'],\n\t\t'e4de0453' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be msnbot, claim appears to be false'],\n\t\t'e87553e1' => ['response' => 403, 'explanation' => 'You do not have permission to access this server.', 'log' => 'I know you and I don\\'t like you, dirty spammer.'],\n\t\t'f0dcb3fd' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. Before trying again, run anti-virus and anti-spyware software and remove any viruses and spyware from your computer.', 'log' => 'Web browser attempted to send a trackback'],\n\t\t'f1182195' => ['response' => 403, 'explanation' => 'An invalid request was received. You claimed to be a major search engine, but you do not appear to actually be a major search engine.', 'log' => 'User-Agent claimed to be Googlebot, claim appears to be false.'],\n\t\t'f9f2b8b9' => ['response' => 403, 'explanation' => 'You do not have permission to access this server. This may be caused by a malfunctioning proxy server or browser privacy software.', 'log' => 'A User-Agent is required but none was provided.'],\n\t];\n\n\tif (array_key_exists($key, $bb2_responses)) return $bb2_responses[$key];\n\n\treturn ['00000000'];\n}", "public function postGetReview()\n {\n\n $id = Input::get('id');\n $f = Review::getReview( $id );\n \n echo json_encode($f);\n \n }", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function getPayPalResponse(){\r\n\t\t\r\n\t}", "public function reponse()\n {\n $paymentResponse = new Mercanet('S9i8qClCnb2CZU3y3Vn0toIOgz3z_aBi79akR30vM9o');\n\n $paymentResponse->setResponse($_POST);\n\n if ($paymentResponse->isValid() && $paymentResponse->isSuccessful()) {\n // Traitement pour les paiements valides\n return $this->render('shop/commande-ok.html.twig');\n } else {\n // Traitement pour les paiements en echec\n return $this->render('shop/commande-echec.html.twig');\n }\n }", "public function getPractice()\r\n {\r\n\t\t$url = \"http://www.kloudtransact.com/cobra-deals\";\r\n\t $msg = \"<h2 style='color: green;'>A new deal has been uploaded!</h2><p>Name: <b>My deal</b></p><br><p>Uploaded by: <b>A Store owner</b></p><br><p>Visit $url for more details.</><br><br><small>KloudTransact Admin</small>\";\r\n\t\t$dt = [\r\n\t\t 'sn' => \"Tee\",\r\n\t\t 'em' => \"[email protected]\",\r\n\t\t 'sa' => \"KloudTransact\",\r\n\t\t 'subject' => \"A new deal was just uploaded. (read this)\",\r\n\t\t 'message' => $msg,\r\n\t\t];\r\n \treturn $this->helpers->bomb($dt);\r\n }", "public function postFeedback(){\n\n\t \t\t// Receive data from client\n\t \t\t// post pramater\n \t$repuestData = (array)$this->request->input('json_decode');\n $feedbackData = (array)$repuestData['feedback']; \n\n $user_id = null; $restaurant_id = null; \n // Receive token and decode \n //$user_id = get from token decod\n //$restaurant_id = query from user_id\n \n\n \tif(checkUser() && !empty(trim($feedbackData['email'])) && !empty(trim($feedbackData['firstName'])) \n \t\t&& !empty(trim($feedbackData['lastName'])) && !empty(trim($feedbackData['phone'])) \n \t\t&& !empty(trim($feedbackData['content']))){\n \t\t$data = array(\n \t\t\t'user_id' => $user_id,\n \t\t\t'restaurant_id' => $restaurant_id,\n\t \t\t'email' => $feedbackData['email'],\n\t \t\t'first_name' => $feedbackData['firstName'],\n\t \t\t'last_name' => $feedbackData['lastName'],\n\t \t\t'phone' => $feedbackData['phone'],\n\t \t\t'content' => $feedbackData['content'],\n\t \t);\n\t \tif($this->FeedBack->saveFeeBack($data)){\n\t\t\t\t\t$result = array(\"error\"=>array('code'=>0,'message'=>'Connect success'));\n\t\t\t\t\techo json_encode($result);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$result = array(\"error\"=>array('code'=>404,'message'=>'Connect failed'));\n\t\t\t\t\techo json_encode($result);\n\t \t}\n\t }\n \telse{\n \t\t$result = array(\"error\"=>array('code'=>404,'message'=>'Connect failed'));\n\t\t\t\techo json_encode($result);\n \t}\n \tdie; \t \n }" ]
[ "0.6473846", "0.58423346", "0.5823156", "0.56975937", "0.5694275", "0.5677829", "0.5630861", "0.5574338", "0.5541718", "0.55250627", "0.5519216", "0.54644585", "0.54472065", "0.5440155", "0.5435801", "0.54085773", "0.53901", "0.5371655", "0.53619933", "0.53540766", "0.5353162", "0.53264165", "0.53262013", "0.5303792", "0.5289776", "0.5286799", "0.52698255", "0.52584004", "0.52537537", "0.5236346" ]
0.77837133
0